fix: sync plugin sdk guardrails and test drift

This commit is contained in:
Peter Steinberger
2026-03-27 20:46:05 +00:00
parent 2bdbb189bd
commit cb5aefb790
9 changed files with 15 additions and 53 deletions

View File

@@ -242,9 +242,13 @@ describe("line runtime api", () => {
});
}, 240_000);
it("keeps the LINE runtime barrel self-contained ahead of the plugin-sdk facade", () => {
it("keeps the LINE runtime barrel self-contained", () => {
const runtimeApiPath = path.join(process.cwd(), "extensions", "line", "runtime-api.ts");
expect(collectRuntimeApiPreExports(runtimeApiPath)).toEqual([]);
const runtimeApiSource = readFileSync(runtimeApiPath, "utf8");
expect(runtimeApiSource).not.toContain("openclaw/plugin-sdk/line-runtime");
expect(collectRuntimeApiPreExports(runtimeApiPath)).toEqual([]);
});
});

View File

@@ -257,7 +257,6 @@ async function summarizeChunks(params: {
model,
params.reserveTokens,
params.apiKey,
undefined,
params.signal,
effectiveInstructions,
summary,

View File

@@ -60,13 +60,7 @@ function buildEntry(name: string): SkillEntry {
description: `${name} test skill`,
filePath: path.join(skillDir, "SKILL.md"),
baseDir: skillDir,
sourceInfo: {
path: skillDir,
source: "openclaw-workspace",
scope: "project",
origin: "package",
baseDir: skillDir,
},
source: "openclaw-workspace",
disableModelInvocation: false,
},
frontmatter: {},

View File

@@ -17,13 +17,7 @@ describe("buildWorkspaceSkillStatus", () => {
description: "test",
filePath: "/tmp/os-scoped",
baseDir: "/tmp",
sourceInfo: {
path: "/tmp",
source: "test",
scope: "project",
origin: "package",
baseDir: "/tmp",
},
source: "test",
disableModelInvocation: false,
},
frontmatter: {},

View File

@@ -24,13 +24,7 @@ function makeEntry(params: {
description: `desc:${params.name}`,
filePath: `/tmp/${params.name}/SKILL.md`,
baseDir: `/tmp/${params.name}`,
sourceInfo: {
path: `/tmp/${params.name}`,
source: params.source ?? "openclaw-workspace",
scope: "project",
origin: "package",
baseDir: `/tmp/${params.name}`,
},
source: params.source ?? "openclaw-workspace",
disableModelInvocation: false,
},
frontmatter: {},

View File

@@ -17,13 +17,7 @@ describe("resolveSkillsPromptForRun", () => {
description: "Demo",
filePath: "/app/skills/demo-skill/SKILL.md",
baseDir: "/app/skills/demo-skill",
sourceInfo: {
path: "/app/skills/demo-skill",
source: "openclaw-bundled",
scope: "project",
origin: "package",
baseDir: "/app/skills/demo-skill",
},
source: "openclaw-bundled",
disableModelInvocation: false,
},
frontmatter: {},

View File

@@ -15,13 +15,7 @@ function makeSkill(name: string, desc = "A skill", filePath = `/skills/${name}/S
description: desc,
filePath,
baseDir: `/skills/${name}`,
sourceInfo: {
path: filePath,
source: "workspace",
scope: "project",
origin: "package",
baseDir: `/skills/${name}`,
},
source: "workspace",
disableModelInvocation: false,
};
}

View File

@@ -38,13 +38,7 @@ describe("skills-cli (e2e)", () => {
description: "Capture UI screenshots",
filePath: path.join(baseDir, "SKILL.md"),
baseDir,
sourceInfo: {
path: baseDir,
source: "openclaw-bundled",
scope: "project",
origin: "package",
baseDir,
},
source: "openclaw-bundled",
disableModelInvocation: false,
},
frontmatter: {},

View File

@@ -15,7 +15,6 @@ const RUNTIME_API_EXPORT_GUARDS: Record<string, readonly string[]> = {
'export * from "./src/channel-actions.js";',
'export * from "./src/directory-live.js";',
'export * from "./src/monitor.js";',
'export { __testing as discordMonitorTesting } from "./src/monitor/provider.js";',
'export * from "./src/monitor/gateway-plugin.js";',
'export * from "./src/monitor/gateway-registry.js";',
'export * from "./src/monitor/presence-cache.js";',
@@ -27,15 +26,12 @@ const RUNTIME_API_EXPORT_GUARDS: Record<string, readonly string[]> = {
'export * from "./src/resolve-users.js";',
'export * from "./src/outbound-session-route.js";',
'export * from "./src/send.js";',
'export const discordSessionBindingAdapterChannels = ["discord"] as const;',
],
"extensions/imessage/runtime-api.ts": [
'export { DEFAULT_ACCOUNT_ID, PAIRING_APPROVED_MESSAGE, buildComputedAccountStatusSnapshot, buildChannelConfigSchema, collectStatusIssuesFromLastError, formatTrimmedAllowFromEntries, getChatChannelMeta, looksLikeIMessageTargetId, normalizeIMessageMessagingTarget, resolveChannelMediaMaxBytes, resolveIMessageConfigAllowFrom, resolveIMessageConfigDefaultTo, IMessageConfigSchema, type ChannelPlugin, type IMessageAccountConfig } from "openclaw/plugin-sdk/imessage";',
'export { resolveIMessageGroupRequireMention, resolveIMessageGroupToolPolicy } from "./src/group-policy.js";',
'export { monitorIMessageProvider } from "./src/monitor.js";',
'export type { MonitorIMessageOpts } from "./src/monitor.js";',
'export { __testing as imessageMonitorTesting } from "./src/monitor/monitor-provider.js";',
'export { imessageOutbound } from "./src/outbound-adapter.js";',
'export { probeIMessage } from "./src/probe.js";',
'export { sendMessageIMessage } from "./src/send.js";',
],
@@ -43,9 +39,11 @@ const RUNTIME_API_EXPORT_GUARDS: Record<string, readonly string[]> = {
"extensions/matrix/runtime-api.ts": [
'export * from "./src/auth-precedence.js";',
'export { requiresExplicitMatrixDefaultAccount, resolveMatrixDefaultOrOnlyAccountId } from "./src/account-selection.js";',
'export * from "./helper-api.js";',
'export * from "./src/account-selection.js";',
'export * from "./src/env-vars.js";',
'export * from "./src/storage-paths.js";',
'export { assertHttpUrlTargetsPrivateNetwork, closeDispatcher, createPinnedDispatcher, resolvePinnedHostnameWithPolicy, ssrfPolicyFromAllowPrivateNetwork, type LookupFn, type SsrFPolicy } from "openclaw/plugin-sdk/ssrf-runtime";',
'export { setMatrixThreadBindingIdleTimeoutBySessionKey, setMatrixThreadBindingMaxAgeBySessionKey } from "./thread-bindings-runtime.js";',
'export { setMatrixThreadBindingIdleTimeoutBySessionKey, setMatrixThreadBindingMaxAgeBySessionKey } from "./src/matrix/thread-bindings-shared.js";',
'export { setMatrixRuntime } from "./src/runtime.js";',
'export { writeJsonFileAtomically } from "openclaw/plugin-sdk/json-store";',
'export type { ChannelDirectoryEntry, ChannelMessageActionContext, OpenClawConfig, PluginRuntime, RuntimeLogger, RuntimeEnv, WizardPrompter } from "openclaw/plugin-sdk/matrix";',
@@ -59,7 +57,6 @@ const RUNTIME_API_EXPORT_GUARDS: Record<string, readonly string[]> = {
'export * from "./src/action-runtime.js";',
'export * from "./src/directory-live.js";',
'export * from "./src/index.js";',
'export { __testing as slackMonitorTesting } from "./src/monitor/provider.js";',
'export * from "./src/resolve-channels.js";',
'export * from "./src/resolve-users.js";',
],
@@ -82,9 +79,7 @@ const RUNTIME_API_EXPORT_GUARDS: Record<string, readonly string[]> = {
'export { makeProxyFetch } from "./src/proxy.js";',
'export { createForumTopicTelegram, deleteMessageTelegram, editForumTopicTelegram, editMessageReplyMarkupTelegram, editMessageTelegram, pinMessageTelegram, reactMessageTelegram, renameForumTopicTelegram, sendMessageTelegram, sendPollTelegram, sendStickerTelegram, sendTypingTelegram, unpinMessageTelegram } from "./src/send.js";',
'export { createTelegramThreadBindingManager, getTelegramThreadBindingManager, setTelegramThreadBindingIdleTimeoutBySessionKey, setTelegramThreadBindingMaxAgeBySessionKey } from "./src/thread-bindings.js";',
'export { __testing as telegramThreadBindingTesting } from "./src/thread-bindings.js";',
'export { resolveTelegramToken } from "./src/token.js";',
'export const telegramSessionBindingAdapterChannels = ["telegram"] as const;',
],
"extensions/whatsapp/runtime-api.ts": [
'export * from "./src/active-listener.js";',