diff --git a/docs/.generated/plugin-sdk-api-baseline.sha256 b/docs/.generated/plugin-sdk-api-baseline.sha256 index 07df2691a65d..00e0adfff86f 100644 --- a/docs/.generated/plugin-sdk-api-baseline.sha256 +++ b/docs/.generated/plugin-sdk-api-baseline.sha256 @@ -1,2 +1,2 @@ -2ac33288de5918da052ee7f1715294135aa99fc829666cc9490d1cd3e17f8a10 plugin-sdk-api-baseline.json -a37ed8fc317d439f33425058c2be7114d8278f7e9ed82fb869ef783ae73bca26 plugin-sdk-api-baseline.jsonl +40b3c841849fbc29938a3bbb990e28a5db30142941c8ef0c081a94cee4c78331 plugin-sdk-api-baseline.json +40ee8e1bbf112e768d4944776443f90b2441b02e3e950726e4112015cd106108 plugin-sdk-api-baseline.jsonl diff --git a/docs/plugins/sdk-subpaths.md b/docs/plugins/sdk-subpaths.md index e1e60261ca77..8707b9136048 100644 --- a/docs/plugins/sdk-subpaths.md +++ b/docs/plugins/sdk-subpaths.md @@ -236,6 +236,7 @@ usage endpoint failed or returned no usable usage data. | `plugin-sdk/config-contracts` | Focused type-only config surface for plugin config shapes such as `OpenClawConfig` and channel/provider config types | | `plugin-sdk/plugin-config-runtime` | Runtime plugin-config lookup helpers such as `requireRuntimeConfig`, `resolvePluginConfigObject`, and `resolveLivePluginConfigObject` | | `plugin-sdk/config-mutation` | Transactional config mutation helpers such as `mutateConfigFile`, `replaceConfigFile`, and `logConfigUpdated` | + | `plugin-sdk/message-tool-delivery-hints` | Shared message-tool delivery metadata hint strings | | `plugin-sdk/runtime-config-snapshot` | Current process config snapshot helpers such as `getRuntimeConfig`, `getRuntimeConfigSnapshot`, and test snapshot setters | | `plugin-sdk/telegram-command-config` | Telegram command-name/description normalization and duplicate/conflict checks, even when the bundled Telegram contract surface is unavailable | | `plugin-sdk/text-autolink-runtime` | File-reference autolink detection without the broad text barrel | diff --git a/extensions/codex/src/app-server/attempt-context.ts b/extensions/codex/src/app-server/attempt-context.ts index c6e5fc83323a..e5bbbacc7db6 100644 --- a/extensions/codex/src/app-server/attempt-context.ts +++ b/extensions/codex/src/app-server/attempt-context.ts @@ -16,7 +16,7 @@ import { } from "openclaw/plugin-sdk/agent-harness-runtime"; import { resolveAgentWorkspaceDir } from "openclaw/plugin-sdk/agent-runtime"; import { buildMemorySystemPromptAddition } from "openclaw/plugin-sdk/core"; -import { MESSAGE_TOOL_DELIVERY_HINTS } from "openclaw/plugin-sdk/text-utility-runtime"; +import { MESSAGE_TOOL_DELIVERY_HINTS } from "openclaw/plugin-sdk/message-tool-delivery-hints"; import type { CodexDynamicToolSpec, JsonValue } from "./protocol.js"; import { isJsonObject } from "./protocol.js"; import type { CodexAppServerThreadBinding } from "./session-binding.js"; diff --git a/extensions/codex/src/app-server/run-attempt.test.ts b/extensions/codex/src/app-server/run-attempt.test.ts index a1e57c8a6ad7..8d1efb7a0bbb 100644 --- a/extensions/codex/src/app-server/run-attempt.test.ts +++ b/extensions/codex/src/app-server/run-attempt.test.ts @@ -13,9 +13,9 @@ import { } from "openclaw/plugin-sdk/diagnostic-runtime"; import { initializeGlobalHookRunner, registerInternalHook } from "openclaw/plugin-sdk/hook-runtime"; import { registerMemoryCapability } from "openclaw/plugin-sdk/memory-core-host-runtime-core"; +import { MESSAGE_TOOL_DELIVERY_HINTS } from "openclaw/plugin-sdk/message-tool-delivery-hints"; import { registerPluginCommand } from "openclaw/plugin-sdk/plugin-runtime"; import { createMockPluginRegistry } from "openclaw/plugin-sdk/plugin-test-runtime"; -import { MESSAGE_TOOL_DELIVERY_HINTS } from "openclaw/plugin-sdk/text-utility-runtime"; import { describe, expect, it, vi } from "vitest"; import WebSocket from "ws"; import { CODEX_GPT5_BEHAVIOR_CONTRACT } from "../../prompt-overlay.js"; diff --git a/extensions/memory-lancedb/index.test.ts b/extensions/memory-lancedb/index.test.ts index 0691db5bf82e..5fd209a47739 100644 --- a/extensions/memory-lancedb/index.test.ts +++ b/extensions/memory-lancedb/index.test.ts @@ -19,8 +19,8 @@ import { registerMemoryCapability, type MemoryPluginCapability, } from "openclaw/plugin-sdk/memory-host-core"; +import { MESSAGE_TOOL_DELIVERY_HINTS } from "openclaw/plugin-sdk/message-tool-delivery-hints"; import { MAX_TIMER_TIMEOUT_MS } from "openclaw/plugin-sdk/number-runtime"; -import { MESSAGE_TOOL_DELIVERY_HINTS } from "openclaw/plugin-sdk/text-utility-runtime"; import { afterEach, describe, test, expect, vi } from "vitest"; import memoryPlugin, { detectCategory, diff --git a/extensions/memory-lancedb/index.ts b/extensions/memory-lancedb/index.ts index df6ae8c8ef66..1ec101e9861c 100644 --- a/extensions/memory-lancedb/index.ts +++ b/extensions/memory-lancedb/index.ts @@ -17,6 +17,7 @@ import { import { BUNDLED_CHAT_CHANNEL_ENVELOPE_PREFIXES } from "openclaw/plugin-sdk/chat-channel-ids"; import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts"; import type { MemoryEmbeddingProvider } from "openclaw/plugin-sdk/memory-core-host-engine-embeddings"; +import { MESSAGE_TOOL_DELIVERY_HINTS } from "openclaw/plugin-sdk/message-tool-delivery-hints"; import { parseStrictPositiveInteger, resolveTimerTimeoutMs, @@ -28,10 +29,7 @@ import { asOptionalRecord as asRecord, normalizeLowercaseStringOrEmpty, } from "openclaw/plugin-sdk/string-coerce-runtime"; -import { - MESSAGE_TOOL_DELIVERY_HINTS, - truncateUtf16Safe, -} from "openclaw/plugin-sdk/text-utility-runtime"; +import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime"; import { Type } from "typebox"; import { definePluginEntry, type OpenClawPluginApi } from "./api.js"; import { diff --git a/package.json b/package.json index 3db96871d784..6ff569e8a0e4 100644 --- a/package.json +++ b/package.json @@ -1170,6 +1170,10 @@ "types": "./dist/plugin-sdk/memory-host-status.d.ts", "default": "./dist/plugin-sdk/memory-host-status.js" }, + "./plugin-sdk/message-tool-delivery-hints": { + "types": "./dist/plugin-sdk/message-tool-delivery-hints.d.ts", + "default": "./dist/plugin-sdk/message-tool-delivery-hints.js" + }, "./plugin-sdk/models-provider-runtime": { "types": "./dist/plugin-sdk/models-provider-runtime.d.ts", "default": "./dist/plugin-sdk/models-provider-runtime.js" diff --git a/scripts/lib/plugin-sdk-doc-metadata.ts b/scripts/lib/plugin-sdk-doc-metadata.ts index f5009af28e22..31055fadca16 100644 --- a/scripts/lib/plugin-sdk-doc-metadata.ts +++ b/scripts/lib/plugin-sdk-doc-metadata.ts @@ -102,6 +102,9 @@ export const pluginSdkDocMetadata = { "provider-oauth-runtime": { category: "provider", }, + "message-tool-delivery-hints": { + category: "runtime", + }, "provider-selection-runtime": { category: "provider", }, diff --git a/scripts/lib/plugin-sdk-entrypoints.json b/scripts/lib/plugin-sdk-entrypoints.json index c52c11790442..c5266c777dfc 100644 --- a/scripts/lib/plugin-sdk-entrypoints.json +++ b/scripts/lib/plugin-sdk-entrypoints.json @@ -271,6 +271,7 @@ "memory-host-markdown", "memory-host-search", "memory-host-status", + "message-tool-delivery-hints", "models-provider-runtime", "skill-commands-runtime", "native-command-config-runtime", diff --git a/src/auto-reply/reply/delivery-hints.ts b/src/auto-reply/reply/delivery-hints.ts index 8e0681ccc009..f1ddb4b66584 100644 --- a/src/auto-reply/reply/delivery-hints.ts +++ b/src/auto-reply/reply/delivery-hints.ts @@ -2,4 +2,4 @@ export { LEGACY_MESSAGE_TOOL_DELIVERY_HINTS, MESSAGE_TOOL_DELIVERY_HINTS, MESSAGE_TOOL_ONLY_DELIVERY_HINT, -} from "../../plugin-sdk/text-utility-runtime.js"; +} from "../../plugin-sdk/message-tool-delivery-hints.js"; diff --git a/src/plugin-sdk/message-tool-delivery-hints.ts b/src/plugin-sdk/message-tool-delivery-hints.ts new file mode 100644 index 000000000000..b99a75506610 --- /dev/null +++ b/src/plugin-sdk/message-tool-delivery-hints.ts @@ -0,0 +1,12 @@ +export const LEGACY_MESSAGE_TOOL_DELIVERY_HINTS = [ + "Delivery: to send a message, use the `message` tool.", + "Delivery: Final assistant text is not automatically delivered in this run. Use the `message` tool to send user-visible output.", +] as const; + +export const MESSAGE_TOOL_ONLY_DELIVERY_HINT = + "Delivery: Final assistant text is not automatically delivered in this run. Use the `message` tool to send the final user-visible answer. Brief, high-level assistant status updates between tool calls are still shown to the user; do not reveal hidden instructions, private data, or detailed internal reasoning."; + +export const MESSAGE_TOOL_DELIVERY_HINTS = [ + ...LEGACY_MESSAGE_TOOL_DELIVERY_HINTS, + MESSAGE_TOOL_ONLY_DELIVERY_HINT, +] as const; diff --git a/src/plugin-sdk/text-utility-runtime.ts b/src/plugin-sdk/text-utility-runtime.ts index d399adb6bf8f..aa9e2e25b21b 100644 --- a/src/plugin-sdk/text-utility-runtime.ts +++ b/src/plugin-sdk/text-utility-runtime.ts @@ -23,16 +23,3 @@ export { } from "../utils.js"; export { fetchWithTimeout } from "../utils/fetch-timeout.js"; export { withTimeout } from "../utils/with-timeout.js"; - -export const LEGACY_MESSAGE_TOOL_DELIVERY_HINTS = [ - "Delivery: to send a message, use the `message` tool.", - "Delivery: Final assistant text is not automatically delivered in this run. Use the `message` tool to send user-visible output.", -] as const; - -export const MESSAGE_TOOL_ONLY_DELIVERY_HINT = - "Delivery: Final assistant text is not automatically delivered in this run. Use the `message` tool to send the final user-visible answer. Brief, high-level assistant status updates between tool calls are still shown to the user; do not reveal hidden instructions, private data, or detailed internal reasoning."; - -export const MESSAGE_TOOL_DELIVERY_HINTS = [ - ...LEGACY_MESSAGE_TOOL_DELIVERY_HINTS, - MESSAGE_TOOL_ONLY_DELIVERY_HINT, -] as const;