mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +00:00
build: fix plugin sdk boundary exports
This commit is contained in:
@@ -11,6 +11,7 @@ export {
|
||||
} from "./src/command-config.js";
|
||||
export { parseTelegramTopicConversation } from "./src/topic-conversation.js";
|
||||
export { singleAccountKeysToMove } from "./src/setup-contract.js";
|
||||
export { mergeTelegramAccountConfig } from "./src/accounts.js";
|
||||
export {
|
||||
buildCommandsPaginationKeyboard,
|
||||
buildTelegramModelsProviderChannelData,
|
||||
|
||||
@@ -60,6 +60,10 @@
|
||||
"types": "./dist/src/plugin-sdk/secret-input.d.ts",
|
||||
"default": "./src/secret-input.ts"
|
||||
},
|
||||
"./text-runtime": {
|
||||
"types": "./dist/src/plugin-sdk/text-runtime.d.ts",
|
||||
"default": "./src/text-runtime.ts"
|
||||
},
|
||||
"./testing": {
|
||||
"types": "./dist/src/plugin-sdk/testing.d.ts",
|
||||
"default": "./src/testing.ts"
|
||||
|
||||
1
packages/plugin-sdk/src/text-runtime.ts
Normal file
1
packages/plugin-sdk/src/text-runtime.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { normalizeOptionalString, readStringValue } from "../../../src/shared/string-coerce.js";
|
||||
@@ -414,6 +414,11 @@ const BUNDLED_SINGLE_ACCOUNT_PROMOTION_FALLBACKS: Record<string, readonly string
|
||||
telegram: ["streaming"],
|
||||
};
|
||||
|
||||
const BUNDLED_NAMED_ACCOUNT_PROMOTION_FALLBACKS: Record<string, readonly string[]> = {
|
||||
// Keep top-level Telegram policy fallback intact when only auth needs seeding.
|
||||
telegram: ["botToken", "tokenFile"],
|
||||
};
|
||||
|
||||
type ChannelSetupPromotionSurface = {
|
||||
singleAccountKeysToMove?: readonly string[];
|
||||
namedAccountPromotionKeys?: readonly string[];
|
||||
@@ -455,9 +460,9 @@ export function resolveSingleAccountKeysToMove(params: {
|
||||
const hasNamedAccounts =
|
||||
Object.keys((params.channel.accounts as Record<string, unknown>) ?? {}).filter(Boolean).length >
|
||||
0;
|
||||
const namedAccountPromotionKeys = getChannelSetupPromotionSurface(
|
||||
params.channelKey,
|
||||
)?.namedAccountPromotionKeys;
|
||||
const namedAccountPromotionKeys =
|
||||
getChannelSetupPromotionSurface(params.channelKey)?.namedAccountPromotionKeys ??
|
||||
BUNDLED_NAMED_ACCOUNT_PROMOTION_FALLBACKS[params.channelKey];
|
||||
return Object.entries(params.channel)
|
||||
.filter(([key, value]) => {
|
||||
if (key === "accounts" || key === "enabled" || value === undefined) {
|
||||
|
||||
@@ -24,3 +24,8 @@ export const collectTelegramSecurityAuditFindings: FacadeModule["collectTelegram
|
||||
loadFacadeModule().collectTelegramSecurityAuditFindings(
|
||||
...args,
|
||||
)) as FacadeModule["collectTelegramSecurityAuditFindings"];
|
||||
|
||||
export const mergeTelegramAccountConfig: FacadeModule["mergeTelegramAccountConfig"] = ((...args) =>
|
||||
loadFacadeModule().mergeTelegramAccountConfig(
|
||||
...args,
|
||||
)) as FacadeModule["mergeTelegramAccountConfig"];
|
||||
|
||||
@@ -14,6 +14,7 @@ const ALLOWED_BUNDLED_CAPABILITY_METADATA_CONSUMERS = new Set([
|
||||
const ALLOWED_EXTENSION_PATH_STRING_TESTS = new Set([
|
||||
"src/plugin-sdk/browser-maintenance.test.ts",
|
||||
"src/channels/plugins/bundled.shape-guard.test.ts",
|
||||
"src/commands/doctor-legacy-config.migrations.test.ts",
|
||||
"src/plugins/contracts/bundled-extension-config-api-guardrails.test.ts",
|
||||
"src/scripts/test-projects.test.ts",
|
||||
]);
|
||||
|
||||
@@ -131,6 +131,7 @@ describe("opt-in extension package boundaries", () => {
|
||||
expect(packageJson.exports?.["./text-runtime"]?.types).toBe(
|
||||
"./dist/src/plugin-sdk/text-runtime.d.ts",
|
||||
);
|
||||
);
|
||||
expect(packageJson.exports?.["./video-generation"]?.types).toBe(
|
||||
"./dist/src/plugin-sdk/video-generation.d.ts",
|
||||
);
|
||||
|
||||
@@ -24,7 +24,7 @@ function resolveBundledSetupCliBackends(): SetupCliBackendRuntimeEntry[] {
|
||||
if (bundledSetupCliBackendsCache) {
|
||||
return bundledSetupCliBackendsCache;
|
||||
}
|
||||
bundledSetupCliBackendsCache = loadPluginManifestRegistry({})
|
||||
bundledSetupCliBackendsCache = loadPluginManifestRegistry({ cache: true })
|
||||
.plugins.filter((plugin) => plugin.origin === "bundled" && plugin.cliBackends.length > 0)
|
||||
.flatMap((plugin) =>
|
||||
plugin.cliBackends.map(
|
||||
|
||||
Reference in New Issue
Block a user