@vetta-org/plugin-sdk 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent.d.ts +0 -12
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js.map +1 -1
- package/dist/ai.d.ts +13 -0
- package/dist/ai.d.ts.map +1 -1
- package/dist/ai.js.map +1 -1
- package/dist/app-actions.d.ts +0 -1
- package/dist/app-actions.d.ts.map +1 -1
- package/dist/app-actions.js.map +1 -1
- package/dist/cli-provider.d.ts +18 -0
- package/dist/cli-provider.d.ts.map +1 -0
- package/dist/cli-provider.js +2 -0
- package/dist/cli-provider.js.map +1 -0
- package/dist/context.d.ts +13 -2
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js.map +1 -1
- package/dist/index.d.ts +10 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/manifest-schema.d.ts +454 -51
- package/dist/manifest-schema.d.ts.map +1 -1
- package/dist/manifest-schema.js +139 -33
- package/dist/manifest-schema.js.map +1 -1
- package/dist/manifest.d.ts +2 -2
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +164 -38
- package/dist/manifest.js.map +1 -1
- package/dist/models.d.ts +35 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +2 -0
- package/dist/models.js.map +1 -0
- package/dist/ocr.d.ts +78 -0
- package/dist/ocr.d.ts.map +1 -0
- package/dist/ocr.js +2 -0
- package/dist/ocr.js.map +1 -0
- package/dist/official.d.ts +1 -0
- package/dist/official.d.ts.map +1 -1
- package/dist/official.js.map +1 -1
- package/dist/permissions.d.ts +1 -1
- package/dist/permissions.d.ts.map +1 -1
- package/dist/permissions.js +8 -0
- package/dist/permissions.js.map +1 -1
- package/dist/secrets.d.ts +27 -0
- package/dist/secrets.d.ts.map +1 -0
- package/dist/secrets.js +2 -0
- package/dist/secrets.js.map +1 -0
- package/dist/service-provider.d.ts +62 -0
- package/dist/service-provider.d.ts.map +1 -0
- package/dist/service-provider.js +2 -0
- package/dist/service-provider.js.map +1 -0
- package/dist/storage.d.ts +39 -6
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +8 -1
- package/dist/storage.js.map +1 -1
- package/dist/ui.d.ts +118 -7
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js.map +1 -1
- package/docs/.source.json +22 -0
- package/docs/README.md +104 -0
- package/docs/ability-details.md +424 -0
- package/docs/ai.md +121 -0
- package/docs/app-actions.md +111 -0
- package/docs/browser.md +80 -0
- package/docs/conversation-and-agent.md +619 -0
- package/docs/file-explorer.md +118 -0
- package/docs/getting-started.md +295 -0
- package/docs/guiding-the-agent.md +183 -0
- package/docs/manifest.md +296 -0
- package/docs/mcp.md +152 -0
- package/docs/media.md +141 -0
- package/docs/message-cards.md +188 -0
- package/docs/permissions.md +145 -0
- package/docs/styling-and-pitfalls.md +254 -0
- package/docs/system-plugins.md +58 -0
- package/docs/ui-slots.md +628 -0
- package/package.json +7 -3
- package/dist/settings.d.ts +0 -13
- package/dist/settings.d.ts.map +0 -1
- package/dist/settings.js +0 -2
- package/dist/settings.js.map +0 -1
package/dist/agent.d.ts
CHANGED
|
@@ -31,15 +31,6 @@ export interface PluginAgentToolRegistration<TInput = unknown> {
|
|
|
31
31
|
* 需要限定使用场景请写进 description 的反向触发段(Do NOT / Only for)。
|
|
32
32
|
*/
|
|
33
33
|
agent_mode?: readonly string[];
|
|
34
|
-
/**
|
|
35
|
-
* Optional association with this plugin's `contributes.settings` definition.
|
|
36
|
-
* Omit `settingKeys` to associate all declared settings. The host adapts these
|
|
37
|
-
* values into the shared Runtime Configuration catalog; tools without this
|
|
38
|
-
* field remain completely outside that catalog.
|
|
39
|
-
*/
|
|
40
|
-
configuration?: {
|
|
41
|
-
settingKeys?: readonly string[];
|
|
42
|
-
};
|
|
43
34
|
context?: {
|
|
44
35
|
conversation?: "summary" | "messages";
|
|
45
36
|
};
|
|
@@ -87,7 +78,6 @@ export interface PluginSystemPromptProviderContext {
|
|
|
87
78
|
plugin: {
|
|
88
79
|
id: string;
|
|
89
80
|
providerId: string;
|
|
90
|
-
settings: Readonly<Record<string, unknown>>;
|
|
91
81
|
};
|
|
92
82
|
session: {
|
|
93
83
|
id: string;
|
|
@@ -160,7 +150,6 @@ export interface PluginAgentHandlerContext<TTrigger> {
|
|
|
160
150
|
plugin: {
|
|
161
151
|
id: string;
|
|
162
152
|
contributionId: string;
|
|
163
|
-
settings: Readonly<Record<string, unknown>>;
|
|
164
153
|
};
|
|
165
154
|
session: PluginSystemPromptProviderContext["session"];
|
|
166
155
|
model: PluginSystemPromptProviderContext["model"];
|
|
@@ -324,7 +313,6 @@ export interface PluginCodingAgentHookHandlerContext<E extends PluginCodingAgent
|
|
|
324
313
|
plugin: {
|
|
325
314
|
id: string;
|
|
326
315
|
contributionId: string;
|
|
327
|
-
settings: Readonly<Record<string, unknown>>;
|
|
328
316
|
};
|
|
329
317
|
session: {
|
|
330
318
|
id: string;
|
package/dist/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEtC,MAAM,WAAW,kBAAkB;IAClC,EAAE,EAAE,WAAW,CAAC;IAChB,YAAY,EAAE,qBAAqB,CAAC;CACpC;AAED,MAAM,WAAW,2BAA2B,CAAC,MAAM,GAAG,OAAO;IAC5D,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,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AAG,UAAU,CAAC;IACvF,2EAA2E;IAC3E,YAAY,CAAC,CAAC,SAAS,8BAA8B,EACpD,YAAY,EAAE,iCAAiC,CAAC,CAAC,CAAC,GAChD,UAAU,CAAC;CACd","sourcesContent":["import type { PluginConversationApi } from \"./conversation.js\";\nimport type { Disposable } from \"./disposable.js\";\nimport type { PluginFsApi } from \"./fs.js\";\nimport type { ConversationScenario } from \"./scenario.js\";\n\nexport type PluginJsonSchema = object;\n\nexport interface PluginAgentToolApi {\n\tfs: PluginFsApi;\n\tconversation: PluginConversationApi;\n}\n\nexport interface PluginAgentToolRegistration<TInput = unknown> {\n\tid: string;\n\tname?: string;\n\t/**\n\t * Host UI display name for this tool (e.g. Work-mode tool headers).\n\t * Supports `%catalogKey%` resolved against the plugin's locales; bare strings\n\t * are used as literals. Not sent to the model — use {@link description} for that.\n\t */\n\tlabel?: string;\n\tdescription: string;\n\tparameters: PluginJsonSchema;\n\ttimeoutMs?: number;\n\t/**\n\t * 允许该工具出现的对话场景 slug 列表。**fail-closed**:未声明/空数组 = 所有场景都不激活。\n\t * 插件须显式声明。\n\t */\n\tscope_use?: readonly ConversationScenario[];\n\t/** 需要的会话能力 slug(如 \"knowledge\");全满足才激活。一般插件无需设置。 */\n\trequires?: string[];\n\t/**\n\t * @deprecated 工作模式不再影响工具的可用性与顺序(ADR-0071)。字段容忍传入但被宿主忽略;\n\t * 需要限定使用场景请写进 description 的反向触发段(Do NOT / Only for)。\n\t */\n\tagent_mode?: readonly string[];\n\t/**\n\t * Optional association with this plugin's `contributes.settings` definition.\n\t * Omit `settingKeys` to associate all declared settings. The host adapts these\n\t * values into the shared Runtime Configuration catalog; tools without this\n\t * field remain completely outside that catalog.\n\t */\n\tconfiguration?: { settingKeys?: readonly string[] };\n\tcontext?: { conversation?: \"summary\" | \"messages\" };\n\thandler: PluginAgentToolHandler<TInput>;\n}\n\nexport interface PluginSystemPromptBlock {\n\tid: string;\n\tcontent: string;\n\tpriority?: number;\n\tenabled?: boolean;\n}\n\nexport type PluginDynamicSystemPromptOperation =\n\t| { type: \"addBlock\"; block: PluginSystemPromptBlock }\n\t| { type: \"replaceBlock\"; blockId: string; block: Omit<PluginSystemPromptBlock, \"id\"> }\n\t| {\n\t\t\ttype: \"updateBlock\";\n\t\t\tblockId: string;\n\t\t\tpatch: Partial<Pick<PluginSystemPromptBlock, \"content\" | \"priority\" | \"enabled\">>;\n\t }\n\t| { type: \"removeBlock\"; blockId: string }\n\t| { type: \"setBlockEnabled\"; blockId: string; enabled: boolean }\n\t| { type: \"setToolEnabled\"; toolName: string; enabled: boolean }\n\t| { type: \"requestContinuation\"; result: PluginContinuationResult };\n\nexport interface PluginSystemPromptMessage {\n\trole: string;\n\ttext: string;\n\ttimestamp?: number;\n\ttoolName?: string;\n}\n\nexport interface PluginSystemPromptProviderContext {\n\tplugin: {\n\t\tid: string;\n\t\tproviderId: string;\n\t\tsettings: Readonly<Record<string, unknown>>;\n\t};\n\tsession: {\n\t\tid: string;\n\t\tcwd: string;\n\t\tscenario: ConversationScenario;\n\t};\n\tmodel: {\n\t\tprovider: string;\n\t\tid: string;\n\t\tapi: string;\n\t\tinput: readonly string[];\n\t\tcontextWindow?: number;\n\t\tmaxTokens?: number;\n\t};\n\tconversation: {\n\t\tmessages: readonly PluginSystemPromptMessage[];\n\t\tmessageCount: number;\n\t};\n\truntime: {\n\t\tactiveToolNames: readonly string[];\n\t\tavailableToolNames: readonly string[];\n\t\trunIndex: number;\n\t};\n\ttrigger: {\n\t\tkind: \"agent-run\";\n\t\ttimestamp: number;\n\t};\n\tsystemPrompt?: {\n\t\tbase: {\n\t\t\tblocks?: readonly PluginSystemPromptBlockView[];\n\t\t\trendered?: string;\n\t\t};\n\t\tcurrent: {\n\t\t\tblocks?: readonly PluginSystemPromptBlockView[];\n\t\t\trendered?: string;\n\t\t};\n\t};\n}\n\nexport interface PluginSystemPromptBlockView extends PluginSystemPromptBlock {\n\ttype: string;\n\tsource: {\n\t\tkind: \"core\" | \"plugin\";\n\t\tpluginId?: string;\n\t};\n\tpriority: number;\n\tenabled: boolean;\n}\n\nexport interface PluginAgentActions {\n\tsystemPrompt: {\n\t\taddBlock(block: PluginSystemPromptBlock): void;\n\t\treplaceBlock(blockId: string, block: Omit<PluginSystemPromptBlock, \"id\">): void;\n\t\tupdateBlock(\n\t\t\tblockId: string,\n\t\t\tpatch: Partial<Pick<PluginSystemPromptBlock, \"content\" | \"priority\" | \"enabled\">>,\n\t\t): void;\n\t\tremoveBlock(blockId: string): void;\n\t\tsetBlockEnabled(blockId: string, enabled: boolean): void;\n\t};\n\ttools: {\n\t\t/** Emit a Turn-local tool effect. It applies after this handler succeeds. */\n\t\tsetEnabled(toolName: string, enabled: boolean): void;\n\t\t/** Enable an already registered tool for subsequent model calls in this Turn. */\n\t\tenable(toolName: string): void;\n\t\t/** Disable an already registered tool for subsequent model calls in this Turn. */\n\t\tdisable(toolName: string): void;\n\t};\n\tcontinuation: {\n\t\trequest(result: PluginContinuationResult): void;\n\t};\n}\n\nexport interface PluginAgentHandlerContext<TTrigger> {\n\tinvocationId: string;\n\tplugin: {\n\t\tid: string;\n\t\tcontributionId: string;\n\t\tsettings: Readonly<Record<string, unknown>>;\n\t};\n\tsession: PluginSystemPromptProviderContext[\"session\"];\n\tmodel: PluginSystemPromptProviderContext[\"model\"];\n\tconversation: PluginSystemPromptProviderContext[\"conversation\"];\n\truntime: PluginSystemPromptProviderContext[\"runtime\"];\n\ttrigger: TTrigger;\n\tsystemPrompt?: PluginSystemPromptProviderContext[\"systemPrompt\"];\n\tactions: PluginAgentActions;\n\thost: PluginAgentToolApi;\n}\n\nexport type PluginAgentToolHandler<TInput = unknown> = (\n\tcontext: PluginAgentHandlerContext<{\n\t\tkind: \"tool-call\";\n\t\ttimestamp: number;\n\t\ttoolCallId: string;\n\t\ttoolId: string;\n\t\ttoolName: string;\n\t\tinput: TInput;\n\t}>,\n) => unknown | Promise<unknown>;\n\nexport type PluginSystemPromptProviderHandler = (\n\tcontext: PluginAgentHandlerContext<{ kind: \"agent-run\"; timestamp: number }>,\n) => void | PluginDynamicSystemPromptOperation[] | Promise<void | PluginDynamicSystemPromptOperation[]>;\n\nexport interface PluginSystemPromptProviderRegistration {\n\tid: string;\n\ttimeoutMs?: number;\n\t/**\n\t * Large context is opt-in. Omitted fields are not serialized across the\n\t * host/renderer boundary.\n\t */\n\tcontext?: {\n\t\tsystemPrompt?: \"none\" | \"blocks\" | \"rendered\" | \"full\";\n\t\tconversation?: \"summary\" | \"messages\";\n\t};\n\thandler: PluginSystemPromptProviderHandler;\n}\n\nexport interface PluginContinuationResult {\n\ttext: string;\n\t/** Stable key used by the host to suppress duplicate continuations in a session. */\n\tidempotencyKey?: string;\n}\n\nexport type PluginContinuationHandler = (\n\tcontext: PluginAgentHandlerContext<{ kind: \"continuation\"; timestamp: number }>,\n) => PluginContinuationResult | null | Promise<PluginContinuationResult | null>;\n\nexport interface PluginContinuationRegistration {\n\tid: string;\n\ttimeoutMs?: number;\n\tcontext?: { conversation?: \"summary\" | \"messages\" };\n\thandler: PluginContinuationHandler;\n}\n\nexport const PLUGIN_CODING_AGENT_HOOK_EVENT_NAMES = [\n\t\"SessionStart\",\n\t\"SessionEnd\",\n\t\"UserPromptSubmit\",\n\t\"PreToolUse\",\n\t\"PermissionRequest\",\n\t\"PostToolUse\",\n\t\"PostToolUseFailure\",\n\t\"PreCompact\",\n\t\"PostCompact\",\n\t\"SubagentStart\",\n\t\"SubagentStop\",\n\t\"Stop\",\n] as const;\n\nexport type PluginCodingAgentHookEventName = (typeof PLUGIN_CODING_AGENT_HOOK_EVENT_NAMES)[number];\nexport type PluginCodingAgentPermissionMode =\n\t| \"default\"\n\t| \"acceptEdits\"\n\t| \"plan\"\n\t| \"dontAsk\"\n\t| \"bypassPermissions\";\n\nexport interface PluginCodingAgentHookTool {\n\thostName: string;\n\tkind: \"function\" | \"shell\" | \"mcp\" | \"file-edit\" | \"agent\" | \"custom\";\n\tsource?: { ecosystem?: string; serverName?: string; originalName?: string };\n}\n\ninterface PluginCodingAgentHookEventBase {\n\tsessionId: string;\n\tcwd: string;\n\tmodel: string;\n\tpermissionMode: PluginCodingAgentPermissionMode;\n\tsubagent?: { agentId: string; agentType: string };\n}\n\nexport type PluginCodingAgentHookEvent =\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"SessionStart\";\n\t\t\tsource: \"startup\" | \"resume\" | \"clear\" | \"compact\";\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"SessionEnd\";\n\t\t\tcause: \"new_session\" | \"switch_session\" | \"fork_session\" | \"dispose\";\n\t\t})\n\t| (PluginCodingAgentHookEventBase & { eventName: \"UserPromptSubmit\"; turnId: string; prompt: string })\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"PreToolUse\";\n\t\t\tturnId: string;\n\t\t\ttool: PluginCodingAgentHookTool;\n\t\t\ttoolUseId: string;\n\t\t\ttoolInput: unknown;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"PermissionRequest\";\n\t\t\tturnId: string;\n\t\t\ttool: PluginCodingAgentHookTool;\n\t\t\ttoolInput: unknown;\n\t\t\trunIdSuffix: string;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"PostToolUse\";\n\t\t\tturnId: string;\n\t\t\ttool: PluginCodingAgentHookTool;\n\t\t\ttoolUseId: string;\n\t\t\ttoolInput: unknown;\n\t\t\ttoolResponse: unknown;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"PostToolUseFailure\";\n\t\t\tturnId: string;\n\t\t\ttool: PluginCodingAgentHookTool;\n\t\t\ttoolUseId: string;\n\t\t\ttoolInput: unknown;\n\t\t\terror: string;\n\t\t\tisInterrupt?: boolean;\n\t\t\tdurationMs?: number;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"PreCompact\" | \"PostCompact\";\n\t\t\tturnId: string;\n\t\t\ttrigger: \"manual\" | \"auto\";\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"SubagentStart\";\n\t\t\tturnId: string;\n\t\t\tagentId: string;\n\t\t\tagentType: string;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"SubagentStop\";\n\t\t\tturnId: string;\n\t\t\tagentId: string;\n\t\t\tagentType: string;\n\t\t\tstopHookActive: boolean;\n\t\t\tlastAssistantMessage: string | null;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"Stop\";\n\t\t\tturnId: string;\n\t\t\tstopHookActive: boolean;\n\t\t\tlastAssistantMessage: string | null;\n\t\t});\n\nexport type PluginCodingAgentHookEventOf<E extends PluginCodingAgentHookEventName> = Extract<\n\tPluginCodingAgentHookEvent,\n\t{ eventName: E }\n>;\n\ninterface PluginCodingAgentHookContinueResult {\n\taction: \"continue\";\n\tadditionalContexts?: readonly string[];\n\tfeedbackMessage?: string;\n}\n\ntype PluginCodingAgentHookTerminalResult =\n\t| { action: \"block\"; reason: string }\n\t| { action: \"stop\"; reason?: string };\n\nexport type PluginCodingAgentHookResult<E extends PluginCodingAgentHookEventName> =\n\t| PluginCodingAgentHookTerminalResult\n\t| (PluginCodingAgentHookContinueResult &\n\t\t\t(E extends \"PreToolUse\" ? { updatedToolInput?: Record<string, unknown> } : object) &\n\t\t\t(E extends \"PermissionRequest\"\n\t\t\t\t? { permissionDecision?: \"allow\" | \"deny\"; permissionMessage?: string }\n\t\t\t\t: object))\n\t| (E extends \"Stop\" | \"SubagentStop\"\n\t\t\t? { action: \"continue-agent\"; continuationFragments: readonly string[] }\n\t\t\t: never);\n\nexport interface PluginCodingAgentHookHandlerContext<E extends PluginCodingAgentHookEventName> {\n\tinvocationId: string;\n\tplugin: {\n\t\tid: string;\n\t\tcontributionId: string;\n\t\tsettings: Readonly<Record<string, unknown>>;\n\t};\n\tsession: { id: string; cwd: string; scenario: ConversationScenario };\n\tevent: PluginCodingAgentHookEventOf<E>;\n\thost: PluginAgentToolApi;\n}\n\nexport type PluginCodingAgentHookHandler<E extends PluginCodingAgentHookEventName> = (\n\tcontext: PluginCodingAgentHookHandlerContext<E>,\n) => void | PluginCodingAgentHookResult<E> | Promise<void | PluginCodingAgentHookResult<E>>;\n\nexport interface PluginCodingAgentHookRegistration<\n\tE extends PluginCodingAgentHookEventName = PluginCodingAgentHookEventName,\n> {\n\tid: string;\n\teventName: E;\n\t/** Hook 是可执行贡献,必须显式声明允许出现的会话场景。 */\n\tscope_use: readonly ConversationScenario[];\n\t/** @deprecated 工作模式不参与 hook 触发(ADR-0071)。字段容忍传入但被宿主忽略。 */\n\tagent_mode?: readonly string[];\n\t/** 工具事件只匹配列出的宿主工具名;缺省/空数组表示所有工具。 */\n\ttoolNames?: readonly string[];\n\ttimeoutMs?: number;\n\thandler: PluginCodingAgentHookHandler<E>;\n}\n\nexport interface PluginAgentApi {\n\tregisterTool<TInput = unknown>(registration: PluginAgentToolRegistration<TInput>): Disposable;\n\t/**\n\t * Register a provider evaluated once at the beginning of each Agent Turn.\n\t * Its effects are replayed across later model calls in that Turn; changing plugin\n\t * state does not re-run the provider before the next Turn.\n\t */\n\tregisterSystemPromptProvider(registration: PluginSystemPromptProviderRegistration): Disposable;\n\t/**\n\t * Register a policy consulted when the agent reaches a natural stopping point.\n\t * Return null to allow the agent to stop, or a message to continue with another turn.\n\t */\n\tregisterContinuationProvider(registration: PluginContinuationRegistration): Disposable;\n\t/** Register a typed, dynamically removable Coding Agent lifecycle hook. */\n\tregisterHook<E extends PluginCodingAgentHookEventName>(\n\t\tregistration: PluginCodingAgentHookRegistration<E>,\n\t): Disposable;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD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GAAG,UAAU,CAAC;IACvF,2EAA2E;IAC3E,YAAY,CAAC,CAAC,SAAS,8BAA8B,EACpD,YAAY,EAAE,iCAAiC,CAAC,CAAC,CAAC,GAChD,UAAU,CAAC;CACd","sourcesContent":["import type { PluginConversationApi } from \"./conversation.js\";\nimport type { Disposable } from \"./disposable.js\";\nimport type { PluginFsApi } from \"./fs.js\";\nimport type { ConversationScenario } from \"./scenario.js\";\n\nexport type PluginJsonSchema = object;\n\nexport interface PluginAgentToolApi {\n\tfs: PluginFsApi;\n\tconversation: PluginConversationApi;\n}\n\nexport interface PluginAgentToolRegistration<TInput = unknown> {\n\tid: string;\n\tname?: string;\n\t/**\n\t * Host UI display name for this tool (e.g. Work-mode tool headers).\n\t * Supports `%catalogKey%` resolved against the plugin's locales; bare strings\n\t * are used as literals. Not sent to the model — use {@link description} for that.\n\t */\n\tlabel?: string;\n\tdescription: string;\n\tparameters: PluginJsonSchema;\n\ttimeoutMs?: number;\n\t/**\n\t * 允许该工具出现的对话场景 slug 列表。**fail-closed**:未声明/空数组 = 所有场景都不激活。\n\t * 插件须显式声明。\n\t */\n\tscope_use?: readonly ConversationScenario[];\n\t/** 需要的会话能力 slug(如 \"knowledge\");全满足才激活。一般插件无需设置。 */\n\trequires?: string[];\n\t/**\n\t * @deprecated 工作模式不再影响工具的可用性与顺序(ADR-0071)。字段容忍传入但被宿主忽略;\n\t * 需要限定使用场景请写进 description 的反向触发段(Do NOT / Only for)。\n\t */\n\tagent_mode?: readonly string[];\n\tcontext?: { conversation?: \"summary\" | \"messages\" };\n\thandler: PluginAgentToolHandler<TInput>;\n}\n\nexport interface PluginSystemPromptBlock {\n\tid: string;\n\tcontent: string;\n\tpriority?: number;\n\tenabled?: boolean;\n}\n\nexport type PluginDynamicSystemPromptOperation =\n\t| { type: \"addBlock\"; block: PluginSystemPromptBlock }\n\t| { type: \"replaceBlock\"; blockId: string; block: Omit<PluginSystemPromptBlock, \"id\"> }\n\t| {\n\t\t\ttype: \"updateBlock\";\n\t\t\tblockId: string;\n\t\t\tpatch: Partial<Pick<PluginSystemPromptBlock, \"content\" | \"priority\" | \"enabled\">>;\n\t }\n\t| { type: \"removeBlock\"; blockId: string }\n\t| { type: \"setBlockEnabled\"; blockId: string; enabled: boolean }\n\t| { type: \"setToolEnabled\"; toolName: string; enabled: boolean }\n\t| { type: \"requestContinuation\"; result: PluginContinuationResult };\n\nexport interface PluginSystemPromptMessage {\n\trole: string;\n\ttext: string;\n\ttimestamp?: number;\n\ttoolName?: string;\n}\n\nexport interface PluginSystemPromptProviderContext {\n\tplugin: {\n\t\tid: string;\n\t\tproviderId: string;\n\t};\n\tsession: {\n\t\tid: string;\n\t\tcwd: string;\n\t\tscenario: ConversationScenario;\n\t};\n\tmodel: {\n\t\tprovider: string;\n\t\tid: string;\n\t\tapi: string;\n\t\tinput: readonly string[];\n\t\tcontextWindow?: number;\n\t\tmaxTokens?: number;\n\t};\n\tconversation: {\n\t\tmessages: readonly PluginSystemPromptMessage[];\n\t\tmessageCount: number;\n\t};\n\truntime: {\n\t\tactiveToolNames: readonly string[];\n\t\tavailableToolNames: readonly string[];\n\t\trunIndex: number;\n\t};\n\ttrigger: {\n\t\tkind: \"agent-run\";\n\t\ttimestamp: number;\n\t};\n\tsystemPrompt?: {\n\t\tbase: {\n\t\t\tblocks?: readonly PluginSystemPromptBlockView[];\n\t\t\trendered?: string;\n\t\t};\n\t\tcurrent: {\n\t\t\tblocks?: readonly PluginSystemPromptBlockView[];\n\t\t\trendered?: string;\n\t\t};\n\t};\n}\n\nexport interface PluginSystemPromptBlockView extends PluginSystemPromptBlock {\n\ttype: string;\n\tsource: {\n\t\tkind: \"core\" | \"plugin\";\n\t\tpluginId?: string;\n\t};\n\tpriority: number;\n\tenabled: boolean;\n}\n\nexport interface PluginAgentActions {\n\tsystemPrompt: {\n\t\taddBlock(block: PluginSystemPromptBlock): void;\n\t\treplaceBlock(blockId: string, block: Omit<PluginSystemPromptBlock, \"id\">): void;\n\t\tupdateBlock(\n\t\t\tblockId: string,\n\t\t\tpatch: Partial<Pick<PluginSystemPromptBlock, \"content\" | \"priority\" | \"enabled\">>,\n\t\t): void;\n\t\tremoveBlock(blockId: string): void;\n\t\tsetBlockEnabled(blockId: string, enabled: boolean): void;\n\t};\n\ttools: {\n\t\t/** Emit a Turn-local tool effect. It applies after this handler succeeds. */\n\t\tsetEnabled(toolName: string, enabled: boolean): void;\n\t\t/** Enable an already registered tool for subsequent model calls in this Turn. */\n\t\tenable(toolName: string): void;\n\t\t/** Disable an already registered tool for subsequent model calls in this Turn. */\n\t\tdisable(toolName: string): void;\n\t};\n\tcontinuation: {\n\t\trequest(result: PluginContinuationResult): void;\n\t};\n}\n\nexport interface PluginAgentHandlerContext<TTrigger> {\n\tinvocationId: string;\n\tplugin: {\n\t\tid: string;\n\t\tcontributionId: string;\n\t};\n\tsession: PluginSystemPromptProviderContext[\"session\"];\n\tmodel: PluginSystemPromptProviderContext[\"model\"];\n\tconversation: PluginSystemPromptProviderContext[\"conversation\"];\n\truntime: PluginSystemPromptProviderContext[\"runtime\"];\n\ttrigger: TTrigger;\n\tsystemPrompt?: PluginSystemPromptProviderContext[\"systemPrompt\"];\n\tactions: PluginAgentActions;\n\thost: PluginAgentToolApi;\n}\n\nexport type PluginAgentToolHandler<TInput = unknown> = (\n\tcontext: PluginAgentHandlerContext<{\n\t\tkind: \"tool-call\";\n\t\ttimestamp: number;\n\t\ttoolCallId: string;\n\t\ttoolId: string;\n\t\ttoolName: string;\n\t\tinput: TInput;\n\t}>,\n) => unknown | Promise<unknown>;\n\nexport type PluginSystemPromptProviderHandler = (\n\tcontext: PluginAgentHandlerContext<{ kind: \"agent-run\"; timestamp: number }>,\n) => void | PluginDynamicSystemPromptOperation[] | Promise<void | PluginDynamicSystemPromptOperation[]>;\n\nexport interface PluginSystemPromptProviderRegistration {\n\tid: string;\n\ttimeoutMs?: number;\n\t/**\n\t * Large context is opt-in. Omitted fields are not serialized across the\n\t * host/renderer boundary.\n\t */\n\tcontext?: {\n\t\tsystemPrompt?: \"none\" | \"blocks\" | \"rendered\" | \"full\";\n\t\tconversation?: \"summary\" | \"messages\";\n\t};\n\thandler: PluginSystemPromptProviderHandler;\n}\n\nexport interface PluginContinuationResult {\n\ttext: string;\n\t/** Stable key used by the host to suppress duplicate continuations in a session. */\n\tidempotencyKey?: string;\n}\n\nexport type PluginContinuationHandler = (\n\tcontext: PluginAgentHandlerContext<{ kind: \"continuation\"; timestamp: number }>,\n) => PluginContinuationResult | null | Promise<PluginContinuationResult | null>;\n\nexport interface PluginContinuationRegistration {\n\tid: string;\n\ttimeoutMs?: number;\n\tcontext?: { conversation?: \"summary\" | \"messages\" };\n\thandler: PluginContinuationHandler;\n}\n\nexport const PLUGIN_CODING_AGENT_HOOK_EVENT_NAMES = [\n\t\"SessionStart\",\n\t\"SessionEnd\",\n\t\"UserPromptSubmit\",\n\t\"PreToolUse\",\n\t\"PermissionRequest\",\n\t\"PostToolUse\",\n\t\"PostToolUseFailure\",\n\t\"PreCompact\",\n\t\"PostCompact\",\n\t\"SubagentStart\",\n\t\"SubagentStop\",\n\t\"Stop\",\n] as const;\n\nexport type PluginCodingAgentHookEventName = (typeof PLUGIN_CODING_AGENT_HOOK_EVENT_NAMES)[number];\nexport type PluginCodingAgentPermissionMode =\n\t| \"default\"\n\t| \"acceptEdits\"\n\t| \"plan\"\n\t| \"dontAsk\"\n\t| \"bypassPermissions\";\n\nexport interface PluginCodingAgentHookTool {\n\thostName: string;\n\tkind: \"function\" | \"shell\" | \"mcp\" | \"file-edit\" | \"agent\" | \"custom\";\n\tsource?: { ecosystem?: string; serverName?: string; originalName?: string };\n}\n\ninterface PluginCodingAgentHookEventBase {\n\tsessionId: string;\n\tcwd: string;\n\tmodel: string;\n\tpermissionMode: PluginCodingAgentPermissionMode;\n\tsubagent?: { agentId: string; agentType: string };\n}\n\nexport type PluginCodingAgentHookEvent =\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"SessionStart\";\n\t\t\tsource: \"startup\" | \"resume\" | \"clear\" | \"compact\";\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"SessionEnd\";\n\t\t\tcause: \"new_session\" | \"switch_session\" | \"fork_session\" | \"dispose\";\n\t\t})\n\t| (PluginCodingAgentHookEventBase & { eventName: \"UserPromptSubmit\"; turnId: string; prompt: string })\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"PreToolUse\";\n\t\t\tturnId: string;\n\t\t\ttool: PluginCodingAgentHookTool;\n\t\t\ttoolUseId: string;\n\t\t\ttoolInput: unknown;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"PermissionRequest\";\n\t\t\tturnId: string;\n\t\t\ttool: PluginCodingAgentHookTool;\n\t\t\ttoolInput: unknown;\n\t\t\trunIdSuffix: string;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"PostToolUse\";\n\t\t\tturnId: string;\n\t\t\ttool: PluginCodingAgentHookTool;\n\t\t\ttoolUseId: string;\n\t\t\ttoolInput: unknown;\n\t\t\ttoolResponse: unknown;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"PostToolUseFailure\";\n\t\t\tturnId: string;\n\t\t\ttool: PluginCodingAgentHookTool;\n\t\t\ttoolUseId: string;\n\t\t\ttoolInput: unknown;\n\t\t\terror: string;\n\t\t\tisInterrupt?: boolean;\n\t\t\tdurationMs?: number;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"PreCompact\" | \"PostCompact\";\n\t\t\tturnId: string;\n\t\t\ttrigger: \"manual\" | \"auto\";\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"SubagentStart\";\n\t\t\tturnId: string;\n\t\t\tagentId: string;\n\t\t\tagentType: string;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"SubagentStop\";\n\t\t\tturnId: string;\n\t\t\tagentId: string;\n\t\t\tagentType: string;\n\t\t\tstopHookActive: boolean;\n\t\t\tlastAssistantMessage: string | null;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"Stop\";\n\t\t\tturnId: string;\n\t\t\tstopHookActive: boolean;\n\t\t\tlastAssistantMessage: string | null;\n\t\t});\n\nexport type PluginCodingAgentHookEventOf<E extends PluginCodingAgentHookEventName> = Extract<\n\tPluginCodingAgentHookEvent,\n\t{ eventName: E }\n>;\n\ninterface PluginCodingAgentHookContinueResult {\n\taction: \"continue\";\n\tadditionalContexts?: readonly string[];\n\tfeedbackMessage?: string;\n}\n\ntype PluginCodingAgentHookTerminalResult =\n\t| { action: \"block\"; reason: string }\n\t| { action: \"stop\"; reason?: string };\n\nexport type PluginCodingAgentHookResult<E extends PluginCodingAgentHookEventName> =\n\t| PluginCodingAgentHookTerminalResult\n\t| (PluginCodingAgentHookContinueResult &\n\t\t\t(E extends \"PreToolUse\" ? { updatedToolInput?: Record<string, unknown> } : object) &\n\t\t\t(E extends \"PermissionRequest\"\n\t\t\t\t? { permissionDecision?: \"allow\" | \"deny\"; permissionMessage?: string }\n\t\t\t\t: object))\n\t| (E extends \"Stop\" | \"SubagentStop\"\n\t\t\t? { action: \"continue-agent\"; continuationFragments: readonly string[] }\n\t\t\t: never);\n\nexport interface PluginCodingAgentHookHandlerContext<E extends PluginCodingAgentHookEventName> {\n\tinvocationId: string;\n\tplugin: {\n\t\tid: string;\n\t\tcontributionId: string;\n\t};\n\tsession: { id: string; cwd: string; scenario: ConversationScenario };\n\tevent: PluginCodingAgentHookEventOf<E>;\n\thost: PluginAgentToolApi;\n}\n\nexport type PluginCodingAgentHookHandler<E extends PluginCodingAgentHookEventName> = (\n\tcontext: PluginCodingAgentHookHandlerContext<E>,\n) => void | PluginCodingAgentHookResult<E> | Promise<void | PluginCodingAgentHookResult<E>>;\n\nexport interface PluginCodingAgentHookRegistration<\n\tE extends PluginCodingAgentHookEventName = PluginCodingAgentHookEventName,\n> {\n\tid: string;\n\teventName: E;\n\t/** Hook 是可执行贡献,必须显式声明允许出现的会话场景。 */\n\tscope_use: readonly ConversationScenario[];\n\t/** @deprecated 工作模式不参与 hook 触发(ADR-0071)。字段容忍传入但被宿主忽略。 */\n\tagent_mode?: readonly string[];\n\t/** 工具事件只匹配列出的宿主工具名;缺省/空数组表示所有工具。 */\n\ttoolNames?: readonly string[];\n\ttimeoutMs?: number;\n\thandler: PluginCodingAgentHookHandler<E>;\n}\n\nexport interface PluginAgentApi {\n\tregisterTool<TInput = unknown>(registration: PluginAgentToolRegistration<TInput>): Disposable;\n\t/**\n\t * Register a provider evaluated once at the beginning of each Agent Turn.\n\t * Its effects are replayed across later model calls in that Turn; changing plugin\n\t * state does not re-run the provider before the next Turn.\n\t */\n\tregisterSystemPromptProvider(registration: PluginSystemPromptProviderRegistration): Disposable;\n\t/**\n\t * Register a policy consulted when the agent reaches a natural stopping point.\n\t * Return null to allow the agent to stop, or a message to continue with another turn.\n\t */\n\tregisterContinuationProvider(registration: PluginContinuationRegistration): Disposable;\n\t/** Register a typed, dynamically removable Coding Agent lifecycle hook. */\n\tregisterHook<E extends PluginCodingAgentHookEventName>(\n\t\tregistration: PluginCodingAgentHookRegistration<E>,\n\t): Disposable;\n}\n"]}
|
package/dist/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAuNA,MAAM,CAAC,MAAM,oCAAoC,GAAG;IACnD,cAAc;IACd,YAAY;IACZ,kBAAkB;IAClB,YAAY;IACZ,mBAAmB;IACnB,aAAa;IACb,oBAAoB;IACpB,YAAY;IACZ,aAAa;IACb,eAAe;IACf,cAAc;IACd,MAAM;CACG,CAAC","sourcesContent":["import type { PluginConversationApi } from \"./conversation.js\";\nimport type { Disposable } from \"./disposable.js\";\nimport type { PluginFsApi } from \"./fs.js\";\nimport type { ConversationScenario } from \"./scenario.js\";\n\nexport type PluginJsonSchema = object;\n\nexport interface PluginAgentToolApi {\n\tfs: PluginFsApi;\n\tconversation: PluginConversationApi;\n}\n\nexport interface PluginAgentToolRegistration<TInput = unknown> {\n\tid: string;\n\tname?: string;\n\t/**\n\t * Host UI display name for this tool (e.g. Work-mode tool headers).\n\t * Supports `%catalogKey%` resolved against the plugin's locales; bare strings\n\t * are used as literals. Not sent to the model — use {@link description} for that.\n\t */\n\tlabel?: string;\n\tdescription: string;\n\tparameters: PluginJsonSchema;\n\ttimeoutMs?: number;\n\t/**\n\t * 允许该工具出现的对话场景 slug 列表。**fail-closed**:未声明/空数组 = 所有场景都不激活。\n\t * 插件须显式声明。\n\t */\n\tscope_use?: readonly ConversationScenario[];\n\t/** 需要的会话能力 slug(如 \"knowledge\");全满足才激活。一般插件无需设置。 */\n\trequires?: string[];\n\t/**\n\t * @deprecated 工作模式不再影响工具的可用性与顺序(ADR-0071)。字段容忍传入但被宿主忽略;\n\t * 需要限定使用场景请写进 description 的反向触发段(Do NOT / Only for)。\n\t */\n\tagent_mode?: readonly string[];\n\t/**\n\t * Optional association with this plugin's `contributes.settings` definition.\n\t * Omit `settingKeys` to associate all declared settings. The host adapts these\n\t * values into the shared Runtime Configuration catalog; tools without this\n\t * field remain completely outside that catalog.\n\t */\n\tconfiguration?: { settingKeys?: readonly string[] };\n\tcontext?: { conversation?: \"summary\" | \"messages\" };\n\thandler: PluginAgentToolHandler<TInput>;\n}\n\nexport interface PluginSystemPromptBlock {\n\tid: string;\n\tcontent: string;\n\tpriority?: number;\n\tenabled?: boolean;\n}\n\nexport type PluginDynamicSystemPromptOperation =\n\t| { type: \"addBlock\"; block: PluginSystemPromptBlock }\n\t| { type: \"replaceBlock\"; blockId: string; block: Omit<PluginSystemPromptBlock, \"id\"> }\n\t| {\n\t\t\ttype: \"updateBlock\";\n\t\t\tblockId: string;\n\t\t\tpatch: Partial<Pick<PluginSystemPromptBlock, \"content\" | \"priority\" | \"enabled\">>;\n\t }\n\t| { type: \"removeBlock\"; blockId: string }\n\t| { type: \"setBlockEnabled\"; blockId: string; enabled: boolean }\n\t| { type: \"setToolEnabled\"; toolName: string; enabled: boolean }\n\t| { type: \"requestContinuation\"; result: PluginContinuationResult };\n\nexport interface PluginSystemPromptMessage {\n\trole: string;\n\ttext: string;\n\ttimestamp?: number;\n\ttoolName?: string;\n}\n\nexport interface PluginSystemPromptProviderContext {\n\tplugin: {\n\t\tid: string;\n\t\tproviderId: string;\n\t\tsettings: Readonly<Record<string, unknown>>;\n\t};\n\tsession: {\n\t\tid: string;\n\t\tcwd: string;\n\t\tscenario: ConversationScenario;\n\t};\n\tmodel: {\n\t\tprovider: string;\n\t\tid: string;\n\t\tapi: string;\n\t\tinput: readonly string[];\n\t\tcontextWindow?: number;\n\t\tmaxTokens?: number;\n\t};\n\tconversation: {\n\t\tmessages: readonly PluginSystemPromptMessage[];\n\t\tmessageCount: number;\n\t};\n\truntime: {\n\t\tactiveToolNames: readonly string[];\n\t\tavailableToolNames: readonly string[];\n\t\trunIndex: number;\n\t};\n\ttrigger: {\n\t\tkind: \"agent-run\";\n\t\ttimestamp: number;\n\t};\n\tsystemPrompt?: {\n\t\tbase: {\n\t\t\tblocks?: readonly PluginSystemPromptBlockView[];\n\t\t\trendered?: string;\n\t\t};\n\t\tcurrent: {\n\t\t\tblocks?: readonly PluginSystemPromptBlockView[];\n\t\t\trendered?: string;\n\t\t};\n\t};\n}\n\nexport interface PluginSystemPromptBlockView extends PluginSystemPromptBlock {\n\ttype: string;\n\tsource: {\n\t\tkind: \"core\" | \"plugin\";\n\t\tpluginId?: string;\n\t};\n\tpriority: number;\n\tenabled: boolean;\n}\n\nexport interface PluginAgentActions {\n\tsystemPrompt: {\n\t\taddBlock(block: PluginSystemPromptBlock): void;\n\t\treplaceBlock(blockId: string, block: Omit<PluginSystemPromptBlock, \"id\">): void;\n\t\tupdateBlock(\n\t\t\tblockId: string,\n\t\t\tpatch: Partial<Pick<PluginSystemPromptBlock, \"content\" | \"priority\" | \"enabled\">>,\n\t\t): void;\n\t\tremoveBlock(blockId: string): void;\n\t\tsetBlockEnabled(blockId: string, enabled: boolean): void;\n\t};\n\ttools: {\n\t\t/** Emit a Turn-local tool effect. It applies after this handler succeeds. */\n\t\tsetEnabled(toolName: string, enabled: boolean): void;\n\t\t/** Enable an already registered tool for subsequent model calls in this Turn. */\n\t\tenable(toolName: string): void;\n\t\t/** Disable an already registered tool for subsequent model calls in this Turn. */\n\t\tdisable(toolName: string): void;\n\t};\n\tcontinuation: {\n\t\trequest(result: PluginContinuationResult): void;\n\t};\n}\n\nexport interface PluginAgentHandlerContext<TTrigger> {\n\tinvocationId: string;\n\tplugin: {\n\t\tid: string;\n\t\tcontributionId: string;\n\t\tsettings: Readonly<Record<string, unknown>>;\n\t};\n\tsession: PluginSystemPromptProviderContext[\"session\"];\n\tmodel: PluginSystemPromptProviderContext[\"model\"];\n\tconversation: PluginSystemPromptProviderContext[\"conversation\"];\n\truntime: PluginSystemPromptProviderContext[\"runtime\"];\n\ttrigger: TTrigger;\n\tsystemPrompt?: PluginSystemPromptProviderContext[\"systemPrompt\"];\n\tactions: PluginAgentActions;\n\thost: PluginAgentToolApi;\n}\n\nexport type PluginAgentToolHandler<TInput = unknown> = (\n\tcontext: PluginAgentHandlerContext<{\n\t\tkind: \"tool-call\";\n\t\ttimestamp: number;\n\t\ttoolCallId: string;\n\t\ttoolId: string;\n\t\ttoolName: string;\n\t\tinput: TInput;\n\t}>,\n) => unknown | Promise<unknown>;\n\nexport type PluginSystemPromptProviderHandler = (\n\tcontext: PluginAgentHandlerContext<{ kind: \"agent-run\"; timestamp: number }>,\n) => void | PluginDynamicSystemPromptOperation[] | Promise<void | PluginDynamicSystemPromptOperation[]>;\n\nexport interface PluginSystemPromptProviderRegistration {\n\tid: string;\n\ttimeoutMs?: number;\n\t/**\n\t * Large context is opt-in. Omitted fields are not serialized across the\n\t * host/renderer boundary.\n\t */\n\tcontext?: {\n\t\tsystemPrompt?: \"none\" | \"blocks\" | \"rendered\" | \"full\";\n\t\tconversation?: \"summary\" | \"messages\";\n\t};\n\thandler: PluginSystemPromptProviderHandler;\n}\n\nexport interface PluginContinuationResult {\n\ttext: string;\n\t/** Stable key used by the host to suppress duplicate continuations in a session. */\n\tidempotencyKey?: string;\n}\n\nexport type PluginContinuationHandler = (\n\tcontext: PluginAgentHandlerContext<{ kind: \"continuation\"; timestamp: number }>,\n) => PluginContinuationResult | null | Promise<PluginContinuationResult | null>;\n\nexport interface PluginContinuationRegistration {\n\tid: string;\n\ttimeoutMs?: number;\n\tcontext?: { conversation?: \"summary\" | \"messages\" };\n\thandler: PluginContinuationHandler;\n}\n\nexport const PLUGIN_CODING_AGENT_HOOK_EVENT_NAMES = [\n\t\"SessionStart\",\n\t\"SessionEnd\",\n\t\"UserPromptSubmit\",\n\t\"PreToolUse\",\n\t\"PermissionRequest\",\n\t\"PostToolUse\",\n\t\"PostToolUseFailure\",\n\t\"PreCompact\",\n\t\"PostCompact\",\n\t\"SubagentStart\",\n\t\"SubagentStop\",\n\t\"Stop\",\n] as const;\n\nexport type PluginCodingAgentHookEventName = (typeof PLUGIN_CODING_AGENT_HOOK_EVENT_NAMES)[number];\nexport type PluginCodingAgentPermissionMode =\n\t| \"default\"\n\t| \"acceptEdits\"\n\t| \"plan\"\n\t| \"dontAsk\"\n\t| \"bypassPermissions\";\n\nexport interface PluginCodingAgentHookTool {\n\thostName: string;\n\tkind: \"function\" | \"shell\" | \"mcp\" | \"file-edit\" | \"agent\" | \"custom\";\n\tsource?: { ecosystem?: string; serverName?: string; originalName?: string };\n}\n\ninterface PluginCodingAgentHookEventBase {\n\tsessionId: string;\n\tcwd: string;\n\tmodel: string;\n\tpermissionMode: PluginCodingAgentPermissionMode;\n\tsubagent?: { agentId: string; agentType: string };\n}\n\nexport type PluginCodingAgentHookEvent =\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"SessionStart\";\n\t\t\tsource: \"startup\" | \"resume\" | \"clear\" | \"compact\";\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"SessionEnd\";\n\t\t\tcause: \"new_session\" | \"switch_session\" | \"fork_session\" | \"dispose\";\n\t\t})\n\t| (PluginCodingAgentHookEventBase & { eventName: \"UserPromptSubmit\"; turnId: string; prompt: string })\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"PreToolUse\";\n\t\t\tturnId: string;\n\t\t\ttool: PluginCodingAgentHookTool;\n\t\t\ttoolUseId: string;\n\t\t\ttoolInput: unknown;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"PermissionRequest\";\n\t\t\tturnId: string;\n\t\t\ttool: PluginCodingAgentHookTool;\n\t\t\ttoolInput: unknown;\n\t\t\trunIdSuffix: string;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"PostToolUse\";\n\t\t\tturnId: string;\n\t\t\ttool: PluginCodingAgentHookTool;\n\t\t\ttoolUseId: string;\n\t\t\ttoolInput: unknown;\n\t\t\ttoolResponse: unknown;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"PostToolUseFailure\";\n\t\t\tturnId: string;\n\t\t\ttool: PluginCodingAgentHookTool;\n\t\t\ttoolUseId: string;\n\t\t\ttoolInput: unknown;\n\t\t\terror: string;\n\t\t\tisInterrupt?: boolean;\n\t\t\tdurationMs?: number;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"PreCompact\" | \"PostCompact\";\n\t\t\tturnId: string;\n\t\t\ttrigger: \"manual\" | \"auto\";\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"SubagentStart\";\n\t\t\tturnId: string;\n\t\t\tagentId: string;\n\t\t\tagentType: string;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"SubagentStop\";\n\t\t\tturnId: string;\n\t\t\tagentId: string;\n\t\t\tagentType: string;\n\t\t\tstopHookActive: boolean;\n\t\t\tlastAssistantMessage: string | null;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"Stop\";\n\t\t\tturnId: string;\n\t\t\tstopHookActive: boolean;\n\t\t\tlastAssistantMessage: string | null;\n\t\t});\n\nexport type PluginCodingAgentHookEventOf<E extends PluginCodingAgentHookEventName> = Extract<\n\tPluginCodingAgentHookEvent,\n\t{ eventName: E }\n>;\n\ninterface PluginCodingAgentHookContinueResult {\n\taction: \"continue\";\n\tadditionalContexts?: readonly string[];\n\tfeedbackMessage?: string;\n}\n\ntype PluginCodingAgentHookTerminalResult =\n\t| { action: \"block\"; reason: string }\n\t| { action: \"stop\"; reason?: string };\n\nexport type PluginCodingAgentHookResult<E extends PluginCodingAgentHookEventName> =\n\t| PluginCodingAgentHookTerminalResult\n\t| (PluginCodingAgentHookContinueResult &\n\t\t\t(E extends \"PreToolUse\" ? { updatedToolInput?: Record<string, unknown> } : object) &\n\t\t\t(E extends \"PermissionRequest\"\n\t\t\t\t? { permissionDecision?: \"allow\" | \"deny\"; permissionMessage?: string }\n\t\t\t\t: object))\n\t| (E extends \"Stop\" | \"SubagentStop\"\n\t\t\t? { action: \"continue-agent\"; continuationFragments: readonly string[] }\n\t\t\t: never);\n\nexport interface PluginCodingAgentHookHandlerContext<E extends PluginCodingAgentHookEventName> {\n\tinvocationId: string;\n\tplugin: {\n\t\tid: string;\n\t\tcontributionId: string;\n\t\tsettings: Readonly<Record<string, unknown>>;\n\t};\n\tsession: { id: string; cwd: string; scenario: ConversationScenario };\n\tevent: PluginCodingAgentHookEventOf<E>;\n\thost: PluginAgentToolApi;\n}\n\nexport type PluginCodingAgentHookHandler<E extends PluginCodingAgentHookEventName> = (\n\tcontext: PluginCodingAgentHookHandlerContext<E>,\n) => void | PluginCodingAgentHookResult<E> | Promise<void | PluginCodingAgentHookResult<E>>;\n\nexport interface PluginCodingAgentHookRegistration<\n\tE extends PluginCodingAgentHookEventName = PluginCodingAgentHookEventName,\n> {\n\tid: string;\n\teventName: E;\n\t/** Hook 是可执行贡献,必须显式声明允许出现的会话场景。 */\n\tscope_use: readonly ConversationScenario[];\n\t/** @deprecated 工作模式不参与 hook 触发(ADR-0071)。字段容忍传入但被宿主忽略。 */\n\tagent_mode?: readonly string[];\n\t/** 工具事件只匹配列出的宿主工具名;缺省/空数组表示所有工具。 */\n\ttoolNames?: readonly string[];\n\ttimeoutMs?: number;\n\thandler: PluginCodingAgentHookHandler<E>;\n}\n\nexport interface PluginAgentApi {\n\tregisterTool<TInput = unknown>(registration: PluginAgentToolRegistration<TInput>): Disposable;\n\t/**\n\t * Register a provider evaluated once at the beginning of each Agent Turn.\n\t * Its effects are replayed across later model calls in that Turn; changing plugin\n\t * state does not re-run the provider before the next Turn.\n\t */\n\tregisterSystemPromptProvider(registration: PluginSystemPromptProviderRegistration): Disposable;\n\t/**\n\t * Register a policy consulted when the agent reaches a natural stopping point.\n\t * Return null to allow the agent to stop, or a message to continue with another turn.\n\t */\n\tregisterContinuationProvider(registration: PluginContinuationRegistration): Disposable;\n\t/** Register a typed, dynamically removable Coding Agent lifecycle hook. */\n\tregisterHook<E extends PluginCodingAgentHookEventName>(\n\t\tregistration: PluginCodingAgentHookRegistration<E>,\n\t): Disposable;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AA8MA,MAAM,CAAC,MAAM,oCAAoC,GAAG;IACnD,cAAc;IACd,YAAY;IACZ,kBAAkB;IAClB,YAAY;IACZ,mBAAmB;IACnB,aAAa;IACb,oBAAoB;IACpB,YAAY;IACZ,aAAa;IACb,eAAe;IACf,cAAc;IACd,MAAM;CACG,CAAC","sourcesContent":["import type { PluginConversationApi } from \"./conversation.js\";\nimport type { Disposable } from \"./disposable.js\";\nimport type { PluginFsApi } from \"./fs.js\";\nimport type { ConversationScenario } from \"./scenario.js\";\n\nexport type PluginJsonSchema = object;\n\nexport interface PluginAgentToolApi {\n\tfs: PluginFsApi;\n\tconversation: PluginConversationApi;\n}\n\nexport interface PluginAgentToolRegistration<TInput = unknown> {\n\tid: string;\n\tname?: string;\n\t/**\n\t * Host UI display name for this tool (e.g. Work-mode tool headers).\n\t * Supports `%catalogKey%` resolved against the plugin's locales; bare strings\n\t * are used as literals. Not sent to the model — use {@link description} for that.\n\t */\n\tlabel?: string;\n\tdescription: string;\n\tparameters: PluginJsonSchema;\n\ttimeoutMs?: number;\n\t/**\n\t * 允许该工具出现的对话场景 slug 列表。**fail-closed**:未声明/空数组 = 所有场景都不激活。\n\t * 插件须显式声明。\n\t */\n\tscope_use?: readonly ConversationScenario[];\n\t/** 需要的会话能力 slug(如 \"knowledge\");全满足才激活。一般插件无需设置。 */\n\trequires?: string[];\n\t/**\n\t * @deprecated 工作模式不再影响工具的可用性与顺序(ADR-0071)。字段容忍传入但被宿主忽略;\n\t * 需要限定使用场景请写进 description 的反向触发段(Do NOT / Only for)。\n\t */\n\tagent_mode?: readonly string[];\n\tcontext?: { conversation?: \"summary\" | \"messages\" };\n\thandler: PluginAgentToolHandler<TInput>;\n}\n\nexport interface PluginSystemPromptBlock {\n\tid: string;\n\tcontent: string;\n\tpriority?: number;\n\tenabled?: boolean;\n}\n\nexport type PluginDynamicSystemPromptOperation =\n\t| { type: \"addBlock\"; block: PluginSystemPromptBlock }\n\t| { type: \"replaceBlock\"; blockId: string; block: Omit<PluginSystemPromptBlock, \"id\"> }\n\t| {\n\t\t\ttype: \"updateBlock\";\n\t\t\tblockId: string;\n\t\t\tpatch: Partial<Pick<PluginSystemPromptBlock, \"content\" | \"priority\" | \"enabled\">>;\n\t }\n\t| { type: \"removeBlock\"; blockId: string }\n\t| { type: \"setBlockEnabled\"; blockId: string; enabled: boolean }\n\t| { type: \"setToolEnabled\"; toolName: string; enabled: boolean }\n\t| { type: \"requestContinuation\"; result: PluginContinuationResult };\n\nexport interface PluginSystemPromptMessage {\n\trole: string;\n\ttext: string;\n\ttimestamp?: number;\n\ttoolName?: string;\n}\n\nexport interface PluginSystemPromptProviderContext {\n\tplugin: {\n\t\tid: string;\n\t\tproviderId: string;\n\t};\n\tsession: {\n\t\tid: string;\n\t\tcwd: string;\n\t\tscenario: ConversationScenario;\n\t};\n\tmodel: {\n\t\tprovider: string;\n\t\tid: string;\n\t\tapi: string;\n\t\tinput: readonly string[];\n\t\tcontextWindow?: number;\n\t\tmaxTokens?: number;\n\t};\n\tconversation: {\n\t\tmessages: readonly PluginSystemPromptMessage[];\n\t\tmessageCount: number;\n\t};\n\truntime: {\n\t\tactiveToolNames: readonly string[];\n\t\tavailableToolNames: readonly string[];\n\t\trunIndex: number;\n\t};\n\ttrigger: {\n\t\tkind: \"agent-run\";\n\t\ttimestamp: number;\n\t};\n\tsystemPrompt?: {\n\t\tbase: {\n\t\t\tblocks?: readonly PluginSystemPromptBlockView[];\n\t\t\trendered?: string;\n\t\t};\n\t\tcurrent: {\n\t\t\tblocks?: readonly PluginSystemPromptBlockView[];\n\t\t\trendered?: string;\n\t\t};\n\t};\n}\n\nexport interface PluginSystemPromptBlockView extends PluginSystemPromptBlock {\n\ttype: string;\n\tsource: {\n\t\tkind: \"core\" | \"plugin\";\n\t\tpluginId?: string;\n\t};\n\tpriority: number;\n\tenabled: boolean;\n}\n\nexport interface PluginAgentActions {\n\tsystemPrompt: {\n\t\taddBlock(block: PluginSystemPromptBlock): void;\n\t\treplaceBlock(blockId: string, block: Omit<PluginSystemPromptBlock, \"id\">): void;\n\t\tupdateBlock(\n\t\t\tblockId: string,\n\t\t\tpatch: Partial<Pick<PluginSystemPromptBlock, \"content\" | \"priority\" | \"enabled\">>,\n\t\t): void;\n\t\tremoveBlock(blockId: string): void;\n\t\tsetBlockEnabled(blockId: string, enabled: boolean): void;\n\t};\n\ttools: {\n\t\t/** Emit a Turn-local tool effect. It applies after this handler succeeds. */\n\t\tsetEnabled(toolName: string, enabled: boolean): void;\n\t\t/** Enable an already registered tool for subsequent model calls in this Turn. */\n\t\tenable(toolName: string): void;\n\t\t/** Disable an already registered tool for subsequent model calls in this Turn. */\n\t\tdisable(toolName: string): void;\n\t};\n\tcontinuation: {\n\t\trequest(result: PluginContinuationResult): void;\n\t};\n}\n\nexport interface PluginAgentHandlerContext<TTrigger> {\n\tinvocationId: string;\n\tplugin: {\n\t\tid: string;\n\t\tcontributionId: string;\n\t};\n\tsession: PluginSystemPromptProviderContext[\"session\"];\n\tmodel: PluginSystemPromptProviderContext[\"model\"];\n\tconversation: PluginSystemPromptProviderContext[\"conversation\"];\n\truntime: PluginSystemPromptProviderContext[\"runtime\"];\n\ttrigger: TTrigger;\n\tsystemPrompt?: PluginSystemPromptProviderContext[\"systemPrompt\"];\n\tactions: PluginAgentActions;\n\thost: PluginAgentToolApi;\n}\n\nexport type PluginAgentToolHandler<TInput = unknown> = (\n\tcontext: PluginAgentHandlerContext<{\n\t\tkind: \"tool-call\";\n\t\ttimestamp: number;\n\t\ttoolCallId: string;\n\t\ttoolId: string;\n\t\ttoolName: string;\n\t\tinput: TInput;\n\t}>,\n) => unknown | Promise<unknown>;\n\nexport type PluginSystemPromptProviderHandler = (\n\tcontext: PluginAgentHandlerContext<{ kind: \"agent-run\"; timestamp: number }>,\n) => void | PluginDynamicSystemPromptOperation[] | Promise<void | PluginDynamicSystemPromptOperation[]>;\n\nexport interface PluginSystemPromptProviderRegistration {\n\tid: string;\n\ttimeoutMs?: number;\n\t/**\n\t * Large context is opt-in. Omitted fields are not serialized across the\n\t * host/renderer boundary.\n\t */\n\tcontext?: {\n\t\tsystemPrompt?: \"none\" | \"blocks\" | \"rendered\" | \"full\";\n\t\tconversation?: \"summary\" | \"messages\";\n\t};\n\thandler: PluginSystemPromptProviderHandler;\n}\n\nexport interface PluginContinuationResult {\n\ttext: string;\n\t/** Stable key used by the host to suppress duplicate continuations in a session. */\n\tidempotencyKey?: string;\n}\n\nexport type PluginContinuationHandler = (\n\tcontext: PluginAgentHandlerContext<{ kind: \"continuation\"; timestamp: number }>,\n) => PluginContinuationResult | null | Promise<PluginContinuationResult | null>;\n\nexport interface PluginContinuationRegistration {\n\tid: string;\n\ttimeoutMs?: number;\n\tcontext?: { conversation?: \"summary\" | \"messages\" };\n\thandler: PluginContinuationHandler;\n}\n\nexport const PLUGIN_CODING_AGENT_HOOK_EVENT_NAMES = [\n\t\"SessionStart\",\n\t\"SessionEnd\",\n\t\"UserPromptSubmit\",\n\t\"PreToolUse\",\n\t\"PermissionRequest\",\n\t\"PostToolUse\",\n\t\"PostToolUseFailure\",\n\t\"PreCompact\",\n\t\"PostCompact\",\n\t\"SubagentStart\",\n\t\"SubagentStop\",\n\t\"Stop\",\n] as const;\n\nexport type PluginCodingAgentHookEventName = (typeof PLUGIN_CODING_AGENT_HOOK_EVENT_NAMES)[number];\nexport type PluginCodingAgentPermissionMode =\n\t| \"default\"\n\t| \"acceptEdits\"\n\t| \"plan\"\n\t| \"dontAsk\"\n\t| \"bypassPermissions\";\n\nexport interface PluginCodingAgentHookTool {\n\thostName: string;\n\tkind: \"function\" | \"shell\" | \"mcp\" | \"file-edit\" | \"agent\" | \"custom\";\n\tsource?: { ecosystem?: string; serverName?: string; originalName?: string };\n}\n\ninterface PluginCodingAgentHookEventBase {\n\tsessionId: string;\n\tcwd: string;\n\tmodel: string;\n\tpermissionMode: PluginCodingAgentPermissionMode;\n\tsubagent?: { agentId: string; agentType: string };\n}\n\nexport type PluginCodingAgentHookEvent =\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"SessionStart\";\n\t\t\tsource: \"startup\" | \"resume\" | \"clear\" | \"compact\";\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"SessionEnd\";\n\t\t\tcause: \"new_session\" | \"switch_session\" | \"fork_session\" | \"dispose\";\n\t\t})\n\t| (PluginCodingAgentHookEventBase & { eventName: \"UserPromptSubmit\"; turnId: string; prompt: string })\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"PreToolUse\";\n\t\t\tturnId: string;\n\t\t\ttool: PluginCodingAgentHookTool;\n\t\t\ttoolUseId: string;\n\t\t\ttoolInput: unknown;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"PermissionRequest\";\n\t\t\tturnId: string;\n\t\t\ttool: PluginCodingAgentHookTool;\n\t\t\ttoolInput: unknown;\n\t\t\trunIdSuffix: string;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"PostToolUse\";\n\t\t\tturnId: string;\n\t\t\ttool: PluginCodingAgentHookTool;\n\t\t\ttoolUseId: string;\n\t\t\ttoolInput: unknown;\n\t\t\ttoolResponse: unknown;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"PostToolUseFailure\";\n\t\t\tturnId: string;\n\t\t\ttool: PluginCodingAgentHookTool;\n\t\t\ttoolUseId: string;\n\t\t\ttoolInput: unknown;\n\t\t\terror: string;\n\t\t\tisInterrupt?: boolean;\n\t\t\tdurationMs?: number;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"PreCompact\" | \"PostCompact\";\n\t\t\tturnId: string;\n\t\t\ttrigger: \"manual\" | \"auto\";\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"SubagentStart\";\n\t\t\tturnId: string;\n\t\t\tagentId: string;\n\t\t\tagentType: string;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"SubagentStop\";\n\t\t\tturnId: string;\n\t\t\tagentId: string;\n\t\t\tagentType: string;\n\t\t\tstopHookActive: boolean;\n\t\t\tlastAssistantMessage: string | null;\n\t\t})\n\t| (PluginCodingAgentHookEventBase & {\n\t\t\teventName: \"Stop\";\n\t\t\tturnId: string;\n\t\t\tstopHookActive: boolean;\n\t\t\tlastAssistantMessage: string | null;\n\t\t});\n\nexport type PluginCodingAgentHookEventOf<E extends PluginCodingAgentHookEventName> = Extract<\n\tPluginCodingAgentHookEvent,\n\t{ eventName: E }\n>;\n\ninterface PluginCodingAgentHookContinueResult {\n\taction: \"continue\";\n\tadditionalContexts?: readonly string[];\n\tfeedbackMessage?: string;\n}\n\ntype PluginCodingAgentHookTerminalResult =\n\t| { action: \"block\"; reason: string }\n\t| { action: \"stop\"; reason?: string };\n\nexport type PluginCodingAgentHookResult<E extends PluginCodingAgentHookEventName> =\n\t| PluginCodingAgentHookTerminalResult\n\t| (PluginCodingAgentHookContinueResult &\n\t\t\t(E extends \"PreToolUse\" ? { updatedToolInput?: Record<string, unknown> } : object) &\n\t\t\t(E extends \"PermissionRequest\"\n\t\t\t\t? { permissionDecision?: \"allow\" | \"deny\"; permissionMessage?: string }\n\t\t\t\t: object))\n\t| (E extends \"Stop\" | \"SubagentStop\"\n\t\t\t? { action: \"continue-agent\"; continuationFragments: readonly string[] }\n\t\t\t: never);\n\nexport interface PluginCodingAgentHookHandlerContext<E extends PluginCodingAgentHookEventName> {\n\tinvocationId: string;\n\tplugin: {\n\t\tid: string;\n\t\tcontributionId: string;\n\t};\n\tsession: { id: string; cwd: string; scenario: ConversationScenario };\n\tevent: PluginCodingAgentHookEventOf<E>;\n\thost: PluginAgentToolApi;\n}\n\nexport type PluginCodingAgentHookHandler<E extends PluginCodingAgentHookEventName> = (\n\tcontext: PluginCodingAgentHookHandlerContext<E>,\n) => void | PluginCodingAgentHookResult<E> | Promise<void | PluginCodingAgentHookResult<E>>;\n\nexport interface PluginCodingAgentHookRegistration<\n\tE extends PluginCodingAgentHookEventName = PluginCodingAgentHookEventName,\n> {\n\tid: string;\n\teventName: E;\n\t/** Hook 是可执行贡献,必须显式声明允许出现的会话场景。 */\n\tscope_use: readonly ConversationScenario[];\n\t/** @deprecated 工作模式不参与 hook 触发(ADR-0071)。字段容忍传入但被宿主忽略。 */\n\tagent_mode?: readonly string[];\n\t/** 工具事件只匹配列出的宿主工具名;缺省/空数组表示所有工具。 */\n\ttoolNames?: readonly string[];\n\ttimeoutMs?: number;\n\thandler: PluginCodingAgentHookHandler<E>;\n}\n\nexport interface PluginAgentApi {\n\tregisterTool<TInput = unknown>(registration: PluginAgentToolRegistration<TInput>): Disposable;\n\t/**\n\t * Register a provider evaluated once at the beginning of each Agent Turn.\n\t * Its effects are replayed across later model calls in that Turn; changing plugin\n\t * state does not re-run the provider before the next Turn.\n\t */\n\tregisterSystemPromptProvider(registration: PluginSystemPromptProviderRegistration): Disposable;\n\t/**\n\t * Register a policy consulted when the agent reaches a natural stopping point.\n\t * Return null to allow the agent to stop, or a message to continue with another turn.\n\t */\n\tregisterContinuationProvider(registration: PluginContinuationRegistration): Disposable;\n\t/** Register a typed, dynamically removable Coding Agent lifecycle hook. */\n\tregisterHook<E extends PluginCodingAgentHookEventName>(\n\t\tregistration: PluginCodingAgentHookRegistration<E>,\n\t): Disposable;\n}\n"]}
|
package/dist/ai.d.ts
CHANGED
|
@@ -79,10 +79,23 @@ export interface PluginAiCompleteResult {
|
|
|
79
79
|
stopReason: "stop" | "length";
|
|
80
80
|
usage: PluginAiUsage;
|
|
81
81
|
}
|
|
82
|
+
export interface PluginAiTextDeltaEvent {
|
|
83
|
+
/** Newly generated text in this event. */
|
|
84
|
+
delta: string;
|
|
85
|
+
/** Complete text generated by this request so far. */
|
|
86
|
+
text: string;
|
|
87
|
+
}
|
|
88
|
+
export interface PluginAiStreamOptions {
|
|
89
|
+
/** Cancels the provider request and rejects the returned promise when aborted. */
|
|
90
|
+
signal?: AbortSignal;
|
|
91
|
+
onTextDelta?(event: PluginAiTextDeltaEvent): void;
|
|
92
|
+
}
|
|
82
93
|
/** Host-managed text inference. Provider credentials never enter the plugin runtime. */
|
|
83
94
|
export interface PluginAiApi {
|
|
84
95
|
listModels(): Promise<PluginAiModelListResult>;
|
|
85
96
|
complete(request: PluginAiCompleteRequest): Promise<PluginAiCompleteResult>;
|
|
97
|
+
/** Streams one assistant response while resolving to the same final contract as complete(). */
|
|
98
|
+
stream(request: PluginAiCompleteRequest, options?: PluginAiStreamOptions): Promise<PluginAiCompleteResult>;
|
|
86
99
|
/**
|
|
87
100
|
* Stateless multi-turn completion. The plugin owns and persists the transcript;
|
|
88
101
|
* each call sends the full message history (optionally with plugin-internal tools)
|
package/dist/ai.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../src/ai.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACvC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE,aAAa,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,uBAAuB;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,uBAAuB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,4BAA4B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,CAAC;IAC9B,KAAK,EAAE,aAAa,CAAC;CACrB;AAED,wFAAwF;AACxF,MAAM,WAAW,WAAW;IAC3B,UAAU,IAAI,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAC/C,QAAQ,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAC5E;;;;OAIG;IACH,IAAI,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAChE","sourcesContent":["export interface PluginAiModel {\n\tmodelKey: string;\n\tprovider: string;\n\tid: string;\n\tname: string;\n\tapi: string;\n\treasoning: boolean;\n\tinput: Array<\"text\" | \"image\">;\n\tcontextWindow: number;\n\tmaxTokens?: number;\n}\n\nexport interface PluginAiModelListResult {\n\tdefaultModel: string | null;\n\tmodels: PluginAiModel[];\n}\n\nexport interface PluginAiCompleteRequest {\n\tmodelKey?: string;\n\tsystemPrompt?: string;\n\tprompt: string;\n\ttemperature?: number;\n\tmaxTokens?: number;\n\treasoning?: string;\n}\n\nexport interface PluginAiUsage {\n\tinputTokens: number;\n\toutputTokens: number;\n\ttotalTokens: number;\n}\n\nexport interface PluginAiToolCall {\n\tid: string;\n\tname: string;\n\targuments: Record<string, unknown>;\n}\n\nexport interface PluginAiChatUserMessage {\n\trole: \"user\";\n\tcontent: string;\n}\n\nexport interface PluginAiChatAssistantMessage {\n\trole: \"assistant\";\n\tcontent: string;\n\ttoolCalls?: PluginAiToolCall[];\n}\n\nexport interface PluginAiChatToolResultMessage {\n\trole: \"toolResult\";\n\ttoolCallId: string;\n\ttoolName: string;\n\tcontent: string;\n\tisError?: boolean;\n}\n\nexport type PluginAiChatMessage =\n\t| PluginAiChatUserMessage\n\t| PluginAiChatAssistantMessage\n\t| PluginAiChatToolResultMessage;\n\n/** Tool visible only to this chat request. The plugin executes matching tool calls itself. */\nexport interface PluginAiChatTool {\n\tname: string;\n\tdescription: string;\n\t/** JSON Schema object describing the tool arguments. */\n\tparameters: Record<string, unknown>;\n}\n\nexport interface PluginAiChatRequest {\n\tmodelKey?: string;\n\tsystemPrompt?: string;\n\t/** Full conversation transcript, oldest first. The host keeps no chat state between calls. */\n\tmessages: PluginAiChatMessage[];\n\ttools?: PluginAiChatTool[];\n\ttemperature?: number;\n\tmaxTokens?: number;\n\treasoning?: string;\n}\n\nexport interface PluginAiChatResult {\n\tmodelKey: string;\n\ttext: string;\n\t/** Pending tool calls the plugin must execute and answer via `toolResult` messages. */\n\ttoolCalls: PluginAiToolCall[];\n\tstopReason: \"stop\" | \"length\" | \"toolUse\";\n\tusage: PluginAiUsage;\n}\n\nexport interface PluginAiCompleteResult {\n\tmodelKey: string;\n\ttext: string;\n\tstopReason: \"stop\" | \"length\";\n\tusage: PluginAiUsage;\n}\n\n/** Host-managed text inference. Provider credentials never enter the plugin runtime. */\nexport interface PluginAiApi {\n\tlistModels(): Promise<PluginAiModelListResult>;\n\tcomplete(request: PluginAiCompleteRequest): Promise<PluginAiCompleteResult>;\n\t/**\n\t * Stateless multi-turn completion. The plugin owns and persists the transcript;\n\t * each call sends the full message history (optionally with plugin-internal tools)\n\t * and receives the next assistant turn. Requires the `ai.complete` permission.\n\t */\n\tchat(request: PluginAiChatRequest): Promise<PluginAiChatResult>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../src/ai.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB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AE,uBAAuB,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAC3G;;;;OAIG;IACH,IAAI,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAChE","sourcesContent":["export interface PluginAiModel {\n\tmodelKey: string;\n\tprovider: string;\n\tid: string;\n\tname: string;\n\tapi: string;\n\treasoning: boolean;\n\tinput: Array<\"text\" | \"image\">;\n\tcontextWindow: number;\n\tmaxTokens?: number;\n}\n\nexport interface PluginAiModelListResult {\n\tdefaultModel: string | null;\n\tmodels: PluginAiModel[];\n}\n\nexport interface PluginAiCompleteRequest {\n\tmodelKey?: string;\n\tsystemPrompt?: string;\n\tprompt: string;\n\ttemperature?: number;\n\tmaxTokens?: number;\n\treasoning?: string;\n}\n\nexport interface PluginAiUsage {\n\tinputTokens: number;\n\toutputTokens: number;\n\ttotalTokens: number;\n}\n\nexport interface PluginAiToolCall {\n\tid: string;\n\tname: string;\n\targuments: Record<string, unknown>;\n}\n\nexport interface PluginAiChatUserMessage {\n\trole: \"user\";\n\tcontent: string;\n}\n\nexport interface PluginAiChatAssistantMessage {\n\trole: \"assistant\";\n\tcontent: string;\n\ttoolCalls?: PluginAiToolCall[];\n}\n\nexport interface PluginAiChatToolResultMessage {\n\trole: \"toolResult\";\n\ttoolCallId: string;\n\ttoolName: string;\n\tcontent: string;\n\tisError?: boolean;\n}\n\nexport type PluginAiChatMessage =\n\t| PluginAiChatUserMessage\n\t| PluginAiChatAssistantMessage\n\t| PluginAiChatToolResultMessage;\n\n/** Tool visible only to this chat request. The plugin executes matching tool calls itself. */\nexport interface PluginAiChatTool {\n\tname: string;\n\tdescription: string;\n\t/** JSON Schema object describing the tool arguments. */\n\tparameters: Record<string, unknown>;\n}\n\nexport interface PluginAiChatRequest {\n\tmodelKey?: string;\n\tsystemPrompt?: string;\n\t/** Full conversation transcript, oldest first. The host keeps no chat state between calls. */\n\tmessages: PluginAiChatMessage[];\n\ttools?: PluginAiChatTool[];\n\ttemperature?: number;\n\tmaxTokens?: number;\n\treasoning?: string;\n}\n\nexport interface PluginAiChatResult {\n\tmodelKey: string;\n\ttext: string;\n\t/** Pending tool calls the plugin must execute and answer via `toolResult` messages. */\n\ttoolCalls: PluginAiToolCall[];\n\tstopReason: \"stop\" | \"length\" | \"toolUse\";\n\tusage: PluginAiUsage;\n}\n\nexport interface PluginAiCompleteResult {\n\tmodelKey: string;\n\ttext: string;\n\tstopReason: \"stop\" | \"length\";\n\tusage: PluginAiUsage;\n}\n\nexport interface PluginAiTextDeltaEvent {\n\t/** Newly generated text in this event. */\n\tdelta: string;\n\t/** Complete text generated by this request so far. */\n\ttext: string;\n}\n\nexport interface PluginAiStreamOptions {\n\t/** Cancels the provider request and rejects the returned promise when aborted. */\n\tsignal?: AbortSignal;\n\tonTextDelta?(event: PluginAiTextDeltaEvent): void;\n}\n\n/** Host-managed text inference. Provider credentials never enter the plugin runtime. */\nexport interface PluginAiApi {\n\tlistModels(): Promise<PluginAiModelListResult>;\n\tcomplete(request: PluginAiCompleteRequest): Promise<PluginAiCompleteResult>;\n\t/** Streams one assistant response while resolving to the same final contract as complete(). */\n\tstream(request: PluginAiCompleteRequest, options?: PluginAiStreamOptions): Promise<PluginAiCompleteResult>;\n\t/**\n\t * Stateless multi-turn completion. The plugin owns and persists the transcript;\n\t * each call sends the full message history (optionally with plugin-internal tools)\n\t * and receives the next assistant turn. Requires the `ai.complete` permission.\n\t */\n\tchat(request: PluginAiChatRequest): Promise<PluginAiChatResult>;\n}\n"]}
|
package/dist/ai.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.js","sourceRoot":"","sources":["../src/ai.ts"],"names":[],"mappings":"","sourcesContent":["export interface PluginAiModel {\n\tmodelKey: string;\n\tprovider: string;\n\tid: string;\n\tname: string;\n\tapi: string;\n\treasoning: boolean;\n\tinput: Array<\"text\" | \"image\">;\n\tcontextWindow: number;\n\tmaxTokens?: number;\n}\n\nexport interface PluginAiModelListResult {\n\tdefaultModel: string | null;\n\tmodels: PluginAiModel[];\n}\n\nexport interface PluginAiCompleteRequest {\n\tmodelKey?: string;\n\tsystemPrompt?: string;\n\tprompt: string;\n\ttemperature?: number;\n\tmaxTokens?: number;\n\treasoning?: string;\n}\n\nexport interface PluginAiUsage {\n\tinputTokens: number;\n\toutputTokens: number;\n\ttotalTokens: number;\n}\n\nexport interface PluginAiToolCall {\n\tid: string;\n\tname: string;\n\targuments: Record<string, unknown>;\n}\n\nexport interface PluginAiChatUserMessage {\n\trole: \"user\";\n\tcontent: string;\n}\n\nexport interface PluginAiChatAssistantMessage {\n\trole: \"assistant\";\n\tcontent: string;\n\ttoolCalls?: PluginAiToolCall[];\n}\n\nexport interface PluginAiChatToolResultMessage {\n\trole: \"toolResult\";\n\ttoolCallId: string;\n\ttoolName: string;\n\tcontent: string;\n\tisError?: boolean;\n}\n\nexport type PluginAiChatMessage =\n\t| PluginAiChatUserMessage\n\t| PluginAiChatAssistantMessage\n\t| PluginAiChatToolResultMessage;\n\n/** Tool visible only to this chat request. The plugin executes matching tool calls itself. */\nexport interface PluginAiChatTool {\n\tname: string;\n\tdescription: string;\n\t/** JSON Schema object describing the tool arguments. */\n\tparameters: Record<string, unknown>;\n}\n\nexport interface PluginAiChatRequest {\n\tmodelKey?: string;\n\tsystemPrompt?: string;\n\t/** Full conversation transcript, oldest first. The host keeps no chat state between calls. */\n\tmessages: PluginAiChatMessage[];\n\ttools?: PluginAiChatTool[];\n\ttemperature?: number;\n\tmaxTokens?: number;\n\treasoning?: string;\n}\n\nexport interface PluginAiChatResult {\n\tmodelKey: string;\n\ttext: string;\n\t/** Pending tool calls the plugin must execute and answer via `toolResult` messages. */\n\ttoolCalls: PluginAiToolCall[];\n\tstopReason: \"stop\" | \"length\" | \"toolUse\";\n\tusage: PluginAiUsage;\n}\n\nexport interface PluginAiCompleteResult {\n\tmodelKey: string;\n\ttext: string;\n\tstopReason: \"stop\" | \"length\";\n\tusage: PluginAiUsage;\n}\n\n/** Host-managed text inference. Provider credentials never enter the plugin runtime. */\nexport interface PluginAiApi {\n\tlistModels(): Promise<PluginAiModelListResult>;\n\tcomplete(request: PluginAiCompleteRequest): Promise<PluginAiCompleteResult>;\n\t/**\n\t * Stateless multi-turn completion. The plugin owns and persists the transcript;\n\t * each call sends the full message history (optionally with plugin-internal tools)\n\t * and receives the next assistant turn. Requires the `ai.complete` permission.\n\t */\n\tchat(request: PluginAiChatRequest): Promise<PluginAiChatResult>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ai.js","sourceRoot":"","sources":["../src/ai.ts"],"names":[],"mappings":"","sourcesContent":["export interface PluginAiModel {\n\tmodelKey: string;\n\tprovider: string;\n\tid: string;\n\tname: string;\n\tapi: string;\n\treasoning: boolean;\n\tinput: Array<\"text\" | \"image\">;\n\tcontextWindow: number;\n\tmaxTokens?: number;\n}\n\nexport interface PluginAiModelListResult {\n\tdefaultModel: string | null;\n\tmodels: PluginAiModel[];\n}\n\nexport interface PluginAiCompleteRequest {\n\tmodelKey?: string;\n\tsystemPrompt?: string;\n\tprompt: string;\n\ttemperature?: number;\n\tmaxTokens?: number;\n\treasoning?: string;\n}\n\nexport interface PluginAiUsage {\n\tinputTokens: number;\n\toutputTokens: number;\n\ttotalTokens: number;\n}\n\nexport interface PluginAiToolCall {\n\tid: string;\n\tname: string;\n\targuments: Record<string, unknown>;\n}\n\nexport interface PluginAiChatUserMessage {\n\trole: \"user\";\n\tcontent: string;\n}\n\nexport interface PluginAiChatAssistantMessage {\n\trole: \"assistant\";\n\tcontent: string;\n\ttoolCalls?: PluginAiToolCall[];\n}\n\nexport interface PluginAiChatToolResultMessage {\n\trole: \"toolResult\";\n\ttoolCallId: string;\n\ttoolName: string;\n\tcontent: string;\n\tisError?: boolean;\n}\n\nexport type PluginAiChatMessage =\n\t| PluginAiChatUserMessage\n\t| PluginAiChatAssistantMessage\n\t| PluginAiChatToolResultMessage;\n\n/** Tool visible only to this chat request. The plugin executes matching tool calls itself. */\nexport interface PluginAiChatTool {\n\tname: string;\n\tdescription: string;\n\t/** JSON Schema object describing the tool arguments. */\n\tparameters: Record<string, unknown>;\n}\n\nexport interface PluginAiChatRequest {\n\tmodelKey?: string;\n\tsystemPrompt?: string;\n\t/** Full conversation transcript, oldest first. The host keeps no chat state between calls. */\n\tmessages: PluginAiChatMessage[];\n\ttools?: PluginAiChatTool[];\n\ttemperature?: number;\n\tmaxTokens?: number;\n\treasoning?: string;\n}\n\nexport interface PluginAiChatResult {\n\tmodelKey: string;\n\ttext: string;\n\t/** Pending tool calls the plugin must execute and answer via `toolResult` messages. */\n\ttoolCalls: PluginAiToolCall[];\n\tstopReason: \"stop\" | \"length\" | \"toolUse\";\n\tusage: PluginAiUsage;\n}\n\nexport interface PluginAiCompleteResult {\n\tmodelKey: string;\n\ttext: string;\n\tstopReason: \"stop\" | \"length\";\n\tusage: PluginAiUsage;\n}\n\nexport interface PluginAiTextDeltaEvent {\n\t/** Newly generated text in this event. */\n\tdelta: string;\n\t/** Complete text generated by this request so far. */\n\ttext: string;\n}\n\nexport interface PluginAiStreamOptions {\n\t/** Cancels the provider request and rejects the returned promise when aborted. */\n\tsignal?: AbortSignal;\n\tonTextDelta?(event: PluginAiTextDeltaEvent): void;\n}\n\n/** Host-managed text inference. Provider credentials never enter the plugin runtime. */\nexport interface PluginAiApi {\n\tlistModels(): Promise<PluginAiModelListResult>;\n\tcomplete(request: PluginAiCompleteRequest): Promise<PluginAiCompleteResult>;\n\t/** Streams one assistant response while resolving to the same final contract as complete(). */\n\tstream(request: PluginAiCompleteRequest, options?: PluginAiStreamOptions): Promise<PluginAiCompleteResult>;\n\t/**\n\t * Stateless multi-turn completion. The plugin owns and persists the transcript;\n\t * each call sends the full message history (optionally with plugin-internal tools)\n\t * and receives the next assistant turn. Requires the `ai.complete` permission.\n\t */\n\tchat(request: PluginAiChatRequest): Promise<PluginAiChatResult>;\n}\n"]}
|
package/dist/app-actions.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-actions.d.ts","sourceRoot":"","sources":["../src/app-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEjE,+EAA+E;AAC/E,MAAM,WAAW,oBAAoB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB,CAAC,MAAM,GAAG,OAAO;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,6BAA6B,CAAC,MAAM,GAAG,OAAO;IAC9D,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE;QACP,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"app-actions.d.ts","sourceRoot":"","sources":["../src/app-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEjE,+EAA+E;AAC/E,MAAM,WAAW,oBAAoB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB,CAAC,MAAM,GAAG,OAAO;IACvD,WAAW,EAA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AE,CAAC,CAAC;CAC/D;AAED,MAAM,WAAW,2BAA2B,CAAC,MAAM,GAAG,OAAO;IAC5D,uEAA+C;IAC/C,EAAE,EAAE,MAAM,CAAC;IACX,iHAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mFAAmF;IACnF,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,qBAAqB,CAAC;IAC9B,6FAAyC;IACzC,QAAQ,CAAC,EAAE,uBAAuB,CAAC;IACnC,WAAW,EAAE,gBAAgB,CAAC;IAC9B,QAAQ,CAAC,EAAE,sBAAsB,CAAC,MAAM,CAAC,EAAE,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4EAA8B;IAC9B,WAAW,CAAC,EAAE,2BAA2B,CAAC,MAAM,CAAC,CAAC;IAClD,OAAO,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,MAAM,GAAG,OAAO,EAAE,YAAY,EAAE,2BAA2B,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC;CAC1F","sourcesContent":["import type { PluginJsonSchema } from \"./agent.js\";\nimport type { Disposable } from \"./disposable.js\";\n\nexport type PluginAppActionEffect = \"read\" | \"write\" | \"execute\";\n\n/** Model-facing routing guidance, not authorization or an execution policy. */\nexport interface PluginAppActionUsage {\n\ttarget: string;\n\tuseWhen: string;\n\tavoidWhen: string;\n\talternatives: string;\n}\n\nexport interface PluginAppActionExample<TInput = unknown> {\n\tdescription: string;\n\tinput: TInput;\n}\n\nexport interface PluginAppActionHandlerContext<TInput = unknown> {\n\tinvocationId: string;\n\tplugin: {\n\t\tid: string;\n\t\tactionId: string;\n\t};\n\tinput: TInput;\n\tsignal: AbortSignal;\n}\n\nexport type PluginAppActionHandler<TInput = unknown> = (\n\tcontext: PluginAppActionHandlerContext<TInput>,\n) => unknown | Promise<unknown>;\n\nexport type PluginAppActionReadyHandler<TInput = unknown> = (\n\tcontext: PluginAppActionHandlerContext<TInput>,\n) => void | Promise<void>;\n\n/** 插件 Action 向宿主返回稳定错误码与可序列化详情。 */\nexport class PluginAppActionError extends Error {\n\treadonly code: string;\n\treadonly details?: unknown;\n\n\tconstructor(code: string, message: string, details?: unknown) {\n\t\tsuper(message);\n\t\tthis.name = \"PluginAppActionError\";\n\t\tthis.code = code;\n\t\tthis.details = details;\n\t}\n}\n\nexport interface PluginAppActionApprovalPresentation {\n\tid: string;\n\ttitle: string;\n\tdescription: string;\n}\n\nexport interface PluginAppActionApproval {\n\t/** 默认使用的宿主审批界面。 */\n\tdefaultPresentation: string;\n\t/** 可用的宿主审批界面;仅官方插件可以声明。 */\n\tpresentations: PluginAppActionApprovalPresentation[];\n\t/** 根据 input.operation 自动选择审批界面,不要求 Agent 传 approvalUi。 */\n\tpresentationByOperation?: Record<string, string>;\n\t/** 某 operation 明确允许的附加审批界面;宿主仍会拒绝未列出的调用方选择。 */\n\talternativePresentationsByOperation?: Record<string, string[]>;\n}\n\nexport interface PluginAppActionRegistration<TInput = unknown> {\n\t/** 插件内局部 id;宿主公开为 `plugin.<pluginId>.<id>`。 */\n\tid: string;\n\t/** 可信官方插件可指定稳定公共 id;若 id 已被占用则后到者忽略(先注册为准)。 */\n\tpublicId?: string;\n\ttitle: string;\n\tsummary: string;\n\tdescription?: string;\n\t/** Returned by search and describe; exclusions are never positive search terms. */\n\tusage?: PluginAppActionUsage;\n\tkeywords?: string[];\n\teffect: PluginAppActionEffect;\n\t/** 官方插件可引用宿主已有审批界面;不能关闭 effect 对应的审批。 */\n\tapproval?: PluginAppActionApproval;\n\tinputSchema: PluginJsonSchema;\n\texamples?: PluginAppActionExample<TInput>[];\n\ttimeoutMs?: number;\n\t/** 审批前业务就绪校验;失败时不会向用户弹出审批。 */\n\tassertReady?: PluginAppActionReadyHandler<TInput>;\n\thandler: PluginAppActionHandler<TInput>;\n}\n\nexport interface PluginAppActionsApi {\n\tregister<TInput = unknown>(registration: PluginAppActionRegistration<TInput>): Disposable;\n}\n"]}
|
package/dist/app-actions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-actions.js","sourceRoot":"","sources":["../src/app-actions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-actions.js","sourceRoot":"","sources":["../src/app-actions.ts"],"names":[],"mappings":"AAoCA,2EAAmC;AACnC,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IACrC,IAAI,CAAS;IACb,OAAO,CAAW;IAE3B,YAAY,IAAY,EAAE,OAAe,EAAE,OAAiB,EAAE;QAC7D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAAA,CACvB;CACD","sourcesContent":["import type { PluginJsonSchema } from \"./agent.js\";\nimport type { Disposable } from \"./disposable.js\";\n\nexport type PluginAppActionEffect = \"read\" | \"write\" | \"execute\";\n\n/** Model-facing routing guidance, not authorization or an execution policy. */\nexport interface PluginAppActionUsage {\n\ttarget: string;\n\tuseWhen: string;\n\tavoidWhen: string;\n\talternatives: string;\n}\n\nexport interface PluginAppActionExample<TInput = unknown> {\n\tdescription: string;\n\tinput: TInput;\n}\n\nexport interface PluginAppActionHandlerContext<TInput = unknown> {\n\tinvocationId: string;\n\tplugin: {\n\t\tid: string;\n\t\tactionId: string;\n\t};\n\tinput: TInput;\n\tsignal: AbortSignal;\n}\n\nexport type PluginAppActionHandler<TInput = unknown> = (\n\tcontext: PluginAppActionHandlerContext<TInput>,\n) => unknown | Promise<unknown>;\n\nexport type PluginAppActionReadyHandler<TInput = unknown> = (\n\tcontext: PluginAppActionHandlerContext<TInput>,\n) => void | Promise<void>;\n\n/** 插件 Action 向宿主返回稳定错误码与可序列化详情。 */\nexport class PluginAppActionError extends Error {\n\treadonly code: string;\n\treadonly details?: unknown;\n\n\tconstructor(code: string, message: string, details?: unknown) {\n\t\tsuper(message);\n\t\tthis.name = \"PluginAppActionError\";\n\t\tthis.code = code;\n\t\tthis.details = details;\n\t}\n}\n\nexport interface PluginAppActionApprovalPresentation {\n\tid: string;\n\ttitle: string;\n\tdescription: string;\n}\n\nexport interface PluginAppActionApproval {\n\t/** 默认使用的宿主审批界面。 */\n\tdefaultPresentation: string;\n\t/** 可用的宿主审批界面;仅官方插件可以声明。 */\n\tpresentations: PluginAppActionApprovalPresentation[];\n\t/** 根据 input.operation 自动选择审批界面,不要求 Agent 传 approvalUi。 */\n\tpresentationByOperation?: Record<string, string>;\n\t/** 某 operation 明确允许的附加审批界面;宿主仍会拒绝未列出的调用方选择。 */\n\talternativePresentationsByOperation?: Record<string, string[]>;\n}\n\nexport interface PluginAppActionRegistration<TInput = unknown> {\n\t/** 插件内局部 id;宿主公开为 `plugin.<pluginId>.<id>`。 */\n\tid: string;\n\t/** 可信官方插件可指定稳定公共 id;若 id 已被占用则后到者忽略(先注册为准)。 */\n\tpublicId?: string;\n\ttitle: string;\n\tsummary: string;\n\tdescription?: string;\n\t/** Returned by search and describe; exclusions are never positive search terms. */\n\tusage?: PluginAppActionUsage;\n\tkeywords?: string[];\n\teffect: PluginAppActionEffect;\n\t/** 官方插件可引用宿主已有审批界面;不能关闭 effect 对应的审批。 */\n\tapproval?: PluginAppActionApproval;\n\tinputSchema: PluginJsonSchema;\n\texamples?: PluginAppActionExample<TInput>[];\n\ttimeoutMs?: number;\n\t/** 审批前业务就绪校验;失败时不会向用户弹出审批。 */\n\tassertReady?: PluginAppActionReadyHandler<TInput>;\n\thandler: PluginAppActionHandler<TInput>;\n}\n\nexport interface PluginAppActionsApi {\n\tregister<TInput = unknown>(registration: PluginAppActionRegistration<TInput>): Disposable;\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PluginCommandRunOptions, PluginCommandRunResult, PluginCommandSpawnHandle, PluginCommandSpawnOptions } from "./command.js";
|
|
2
|
+
import type { Disposable } from "./disposable.js";
|
|
3
|
+
export type PluginCliProviderPhase = "disabled" | "checking" | "installing" | "verifying" | "ready" | "failed";
|
|
4
|
+
export interface PluginCliProviderStatus {
|
|
5
|
+
providerId: string;
|
|
6
|
+
phase: PluginCliProviderPhase;
|
|
7
|
+
message?: string;
|
|
8
|
+
recentOutput: string;
|
|
9
|
+
}
|
|
10
|
+
/** Host-managed CLI dependency declared by `plugin.json#providers.cli`. */
|
|
11
|
+
export interface PluginCliProviderApi {
|
|
12
|
+
getStatus(providerId: string): Promise<PluginCliProviderStatus>;
|
|
13
|
+
onStatusChanged(listener: (status: PluginCliProviderStatus) => void): Disposable;
|
|
14
|
+
retry(providerId: string): Promise<void>;
|
|
15
|
+
run(providerId: string, args?: string[], options?: PluginCommandRunOptions): Promise<PluginCommandRunResult>;
|
|
16
|
+
spawn(providerId: string, args?: string[], options?: PluginCommandSpawnOptions): Promise<PluginCommandSpawnHandle>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=cli-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-provider.d.ts","sourceRoot":"","sources":["../src/cli-provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,sBAAsB,GAAG,UAAU,GAAG,UAAU,GAAG,YAAY,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE/G,MAAM,WAAW,uBAAuB;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,sBAAsB,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACrB;AAED,2EAA2E;AAC3E,MAAM,WAAW,oBAAoB;IACpC,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAChE,eAAe,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI,GAAG,UAAU,CAAC;IACjF,KAAK,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,GAAG,CACF,UAAU,EAAE,MAAM,EAClB,IAAI,CAAC,EAAE,MAAM,EAAE,EACf,OAAO,CAAC,EAAE,uBAAuB,GAC/B,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACnC,KAAK,CACJ,UAAU,EAAE,MAAM,EAClB,IAAI,CAAC,EAAE,MAAM,EAAE,EACf,OAAO,CAAC,EAAE,yBAAyB,GACjC,OAAO,CAAC,wBAAwB,CAAC,CAAC;CACrC","sourcesContent":["import type {\n\tPluginCommandRunOptions,\n\tPluginCommandRunResult,\n\tPluginCommandSpawnHandle,\n\tPluginCommandSpawnOptions,\n} from \"./command.js\";\nimport type { Disposable } from \"./disposable.js\";\n\nexport type PluginCliProviderPhase = \"disabled\" | \"checking\" | \"installing\" | \"verifying\" | \"ready\" | \"failed\";\n\nexport interface PluginCliProviderStatus {\n\tproviderId: string;\n\tphase: PluginCliProviderPhase;\n\tmessage?: string;\n\trecentOutput: string;\n}\n\n/** Host-managed CLI dependency declared by `plugin.json#providers.cli`. */\nexport interface PluginCliProviderApi {\n\tgetStatus(providerId: string): Promise<PluginCliProviderStatus>;\n\tonStatusChanged(listener: (status: PluginCliProviderStatus) => void): Disposable;\n\tretry(providerId: string): Promise<void>;\n\trun(\n\t\tproviderId: string,\n\t\targs?: string[],\n\t\toptions?: PluginCommandRunOptions,\n\t): Promise<PluginCommandRunResult>;\n\tspawn(\n\t\tproviderId: string,\n\t\targs?: string[],\n\t\toptions?: PluginCommandSpawnOptions,\n\t): Promise<PluginCommandSpawnHandle>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-provider.js","sourceRoot":"","sources":["../src/cli-provider.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n\tPluginCommandRunOptions,\n\tPluginCommandRunResult,\n\tPluginCommandSpawnHandle,\n\tPluginCommandSpawnOptions,\n} from \"./command.js\";\nimport type { Disposable } from \"./disposable.js\";\n\nexport type PluginCliProviderPhase = \"disabled\" | \"checking\" | \"installing\" | \"verifying\" | \"ready\" | \"failed\";\n\nexport interface PluginCliProviderStatus {\n\tproviderId: string;\n\tphase: PluginCliProviderPhase;\n\tmessage?: string;\n\trecentOutput: string;\n}\n\n/** Host-managed CLI dependency declared by `plugin.json#providers.cli`. */\nexport interface PluginCliProviderApi {\n\tgetStatus(providerId: string): Promise<PluginCliProviderStatus>;\n\tonStatusChanged(listener: (status: PluginCliProviderStatus) => void): Disposable;\n\tretry(providerId: string): Promise<void>;\n\trun(\n\t\tproviderId: string,\n\t\targs?: string[],\n\t\toptions?: PluginCommandRunOptions,\n\t): Promise<PluginCommandRunResult>;\n\tspawn(\n\t\tproviderId: string,\n\t\targs?: string[],\n\t\toptions?: PluginCommandSpawnOptions,\n\t): Promise<PluginCommandSpawnHandle>;\n}\n"]}
|
package/dist/context.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { PluginArtifactsApi } from "./artifacts.js";
|
|
|
5
5
|
import type { PluginBrowserApi } from "./browser.js";
|
|
6
6
|
import type { PluginCaptureApi } from "./capture.js";
|
|
7
7
|
import type { PluginCommandApi } from "./command.js";
|
|
8
|
+
import type { PluginCliProviderApi } from "./cli-provider.js";
|
|
8
9
|
import type { PluginConversationApi } from "./conversation.js";
|
|
9
10
|
import type { Disposable } from "./disposable.js";
|
|
10
11
|
import type { PluginFileExplorerApi } from "./file-explorer.js";
|
|
@@ -13,10 +14,13 @@ import type { PluginGatewayApi } from "./gateway.js";
|
|
|
13
14
|
import type { PluginI18nApi } from "./i18n.js";
|
|
14
15
|
import type { PluginJobsApi } from "./jobs.js";
|
|
15
16
|
import type { PluginMediaApi } from "./media.js";
|
|
17
|
+
import type { OcrClient } from "./ocr.js";
|
|
18
|
+
import type { PluginModelsApi } from "./models.js";
|
|
16
19
|
import type { PluginNetworkApi } from "./network.js";
|
|
17
20
|
import type { PluginOfficialApi } from "./official.js";
|
|
18
21
|
import type { PluginPermission } from "./permissions.js";
|
|
19
|
-
import type {
|
|
22
|
+
import type { PluginSecretsApi } from "./secrets.js";
|
|
23
|
+
import type { PluginServiceApi } from "./service-provider.js";
|
|
20
24
|
import type { PluginStorageApi } from "./storage.js";
|
|
21
25
|
import type { PluginUiApi } from "./ui.js";
|
|
22
26
|
export interface PluginPermissionApi {
|
|
@@ -49,7 +53,13 @@ export interface PluginContext {
|
|
|
49
53
|
official: PluginOfficialApi;
|
|
50
54
|
fs: PluginFsApi;
|
|
51
55
|
command: PluginCommandApi;
|
|
56
|
+
cliProviders: PluginCliProviderApi;
|
|
57
|
+
/** Plugin-provisioned, host-managed local services declared by `plugin.json#providers.services`. */
|
|
58
|
+
services: PluginServiceApi;
|
|
59
|
+
/** Explicitly permissioned model provider owned by this plugin's id namespace. */
|
|
60
|
+
models: PluginModelsApi;
|
|
52
61
|
media: PluginMediaApi;
|
|
62
|
+
ocr: OcrClient;
|
|
53
63
|
jobs: PluginJobsApi;
|
|
54
64
|
artifacts: PluginArtifactsApi;
|
|
55
65
|
/** 主进程离屏窗口截图(`capture.offscreen` 权限)。旧宿主上为 `undefined`,使用前判空。 */
|
|
@@ -63,7 +73,8 @@ export interface PluginContext {
|
|
|
63
73
|
*/
|
|
64
74
|
gateway?: PluginGatewayApi;
|
|
65
75
|
storage: PluginStorageApi;
|
|
66
|
-
|
|
76
|
+
/** Encrypted per-plugin secret storage (`secrets.read` / `secrets.write`). */
|
|
77
|
+
secrets: PluginSecretsApi;
|
|
67
78
|
i18n: PluginI18nApi;
|
|
68
79
|
/**
|
|
69
80
|
* 当前的**新会话默认工作模式**(agent_mode 轴,见 ADR-0046 及其 2026-08 修订)。
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAA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AS,EAAE,kBAAkB,CAAC;IAC9B,qHAAiE;IACjE,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,2FAAmC;IACnC,OAAO,EAAE,gBAAgB,CAAC;IAC1B,OAAO,EAAE,gBAAgB,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,8EAA8E;IAC9E,OAAO,EAAE,gBAAgB,CAAC;IAC1B,IAAI,EAAE,aAAa,CAAC;IACpB;;;;;;OAMG;IACH,YAAY,IAAI,SAAS,CAAC;IAC1B,uGAA+C;IAC/C,kBAAkB,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,GAAG,UAAU,CAAC;CACpE;AAED,MAAM,MAAM,uBAAuB,GAAG,UAAU,GAAG,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAEhF,MAAM,WAAW,gBAAgB;IAChC;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,GAAG,uBAAuB,GAAG,OAAO,CAAC,IAAI,GAAG,uBAAuB,CAAC,CAAC;IACvG,qFAAqF;IACrF,UAAU,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAEvE","sourcesContent":["import type { PluginAgentApi } from \"./agent.js\";\nimport type { PluginAiApi } from \"./ai.js\";\nimport type { PluginAppActionsApi } from \"./app-actions.js\";\nimport type { PluginArtifactsApi } from \"./artifacts.js\";\nimport type { PluginBrowserApi } from \"./browser.js\";\nimport type { PluginCaptureApi } from \"./capture.js\";\nimport type { PluginCommandApi } from \"./command.js\";\nimport type { PluginCliProviderApi } from \"./cli-provider.js\";\nimport type { PluginConversationApi } from \"./conversation.js\";\nimport type { Disposable } from \"./disposable.js\";\nimport type { PluginFileExplorerApi } from \"./file-explorer.js\";\nimport type { PluginFsApi } from \"./fs.js\";\nimport type { PluginGatewayApi } from \"./gateway.js\";\nimport type { PluginI18nApi } from \"./i18n.js\";\nimport type { PluginJobsApi } from \"./jobs.js\";\nimport type { PluginMediaApi } from \"./media.js\";\nimport type { OcrClient } from \"./ocr.js\";\nimport type { PluginModelsApi } from \"./models.js\";\nimport type { PluginNetworkApi } from \"./network.js\";\nimport type { PluginOfficialApi } from \"./official.js\";\nimport type { PluginPermission } from \"./permissions.js\";\nimport type { PluginSecretsApi } from \"./secrets.js\";\nimport type { PluginServiceApi } from \"./service-provider.js\";\nimport type { PluginStorageApi } from \"./storage.js\";\nimport type { PluginUiApi } from \"./ui.js\";\n\nexport interface PluginPermissionApi {\n\thas(permission: PluginPermission): boolean;\n\trequire(permission: PluginPermission): void;\n}\n\n/**\n * 工作模式 id。合法值由宿主的模式注册表定义(ADR-0071),插件不应硬编码枚举;\n * 需要区分模式时按 id 字符串比较,未知 id 一律按通用处理。\n */\nexport type AgentMode = string;\n\nexport interface PluginContext {\n\tplugin: {\n\t\tid: string;\n\t\tversion: string;\n\t\t/**\n\t\t * Host-resolved brand icon from `plugin.json#icon` (if declared).\n\t\t * Opaque string for `<img src>` / Iconify — plugins must not invent\n\t\t * host protocols; use this or omit Activity Tab `icon` to inherit it.\n\t\t */\n\t\ticonUrl?: string;\n\t};\n\tpermissions: PluginPermissionApi;\n\tui: PluginUiApi;\n\tfileExplorer: PluginFileExplorerApi;\n\tconversation: PluginConversationApi;\n\tagent: PluginAgentApi;\n\tappActions: PluginAppActionsApi;\n\tai: PluginAiApi;\n\tofficial: PluginOfficialApi;\n\tfs: PluginFsApi;\n\tcommand: PluginCommandApi;\n\tcliProviders: PluginCliProviderApi;\n\t/** Plugin-provisioned, host-managed local services declared by `plugin.json#providers.services`. */\n\tservices: PluginServiceApi;\n\t/** Explicitly permissioned model provider owned by this plugin's id namespace. */\n\tmodels: PluginModelsApi;\n\tmedia: PluginMediaApi;\n\tocr: OcrClient;\n\tjobs: PluginJobsApi;\n\tartifacts: PluginArtifactsApi;\n\t/** 主进程离屏窗口截图(`capture.offscreen` 权限)。旧宿主上为 `undefined`,使用前判空。 */\n\tcapture?: PluginCaptureApi;\n\t/** 宿主管理的浏览器能力;各具体方法会根据插件权限单独校验。 */\n\tbrowser: PluginBrowserApi;\n\tnetwork: PluginNetworkApi;\n\t/**\n\t * Vetta 服务端网关调用(ADR-0056)。**仅内置 official 插件可用**,\n\t * 第三方插件读到 `undefined`,故使用前必须判空。\n\t */\n\tgateway?: PluginGatewayApi;\n\tstorage: PluginStorageApi;\n\t/** Encrypted per-plugin secret storage (`secrets.read` / `secrets.write`). */\n\tsecrets: PluginSecretsApi;\n\ti18n: PluginI18nApi;\n\t/**\n\t * 当前的**新会话默认工作模式**(agent_mode 轴,见 ADR-0046 及其 2026-08 修订)。\n\t *\n\t * 工作模式只在会话创建时固化,之后会话内不可变,因此这里读到的是用户此刻的设置值,\n\t * **不是**某个已存在会话正在使用的模式,不要用它推断进行中的会话。\n\t * 模式也不再隐藏任何插件能力,只适合做展示层的软性定制,不要据此隐藏功能入口。\n\t */\n\tgetAgentMode(): AgentMode;\n\t/** 订阅默认工作模式变更(用户改设置时触发)。返回 Disposable 取消订阅。 */\n\tonAgentModeChanged(listener: (mode: AgentMode) => void): Disposable;\n}\n\nexport type PluginActivationCleanup = Disposable | (() => void | Promise<void>);\n\nexport interface PluginDefinition {\n\t/**\n\t * Activate one plugin instance. Returning a cleanup binds resource ownership to\n\t * this specific activation, including overlapping hot-reload activations.\n\t */\n\tactivate(ctx: PluginContext): void | PluginActivationCleanup | Promise<void | PluginActivationCleanup>;\n\t/** Legacy module-level cleanup. Prefer an activation-scoped cleanup return value. */\n\tdeactivate?(): void | Promise<void>;\n}\n\nexport function definePlugin(plugin: PluginDefinition): PluginDefinition {\n\treturn plugin;\n}\n"]}
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAyGA,MAAM,UAAU,YAAY,CAAC,MAAwB,EAAoB;IACxE,OAAO,MAAM,CAAC;AAAA,CACd","sourcesContent":["import type { PluginAgentApi } from \"./agent.js\";\nimport type { PluginAiApi } from \"./ai.js\";\nimport type { PluginAppActionsApi } from \"./app-actions.js\";\nimport type { PluginArtifactsApi } from \"./artifacts.js\";\nimport type { PluginBrowserApi } from \"./browser.js\";\nimport type { PluginCaptureApi } from \"./capture.js\";\nimport type { PluginCommandApi } from \"./command.js\";\nimport type { PluginCliProviderApi } from \"./cli-provider.js\";\nimport type { PluginConversationApi } from \"./conversation.js\";\nimport type { Disposable } from \"./disposable.js\";\nimport type { PluginFileExplorerApi } from \"./file-explorer.js\";\nimport type { PluginFsApi } from \"./fs.js\";\nimport type { PluginGatewayApi } from \"./gateway.js\";\nimport type { PluginI18nApi } from \"./i18n.js\";\nimport type { PluginJobsApi } from \"./jobs.js\";\nimport type { PluginMediaApi } from \"./media.js\";\nimport type { OcrClient } from \"./ocr.js\";\nimport type { PluginModelsApi } from \"./models.js\";\nimport type { PluginNetworkApi } from \"./network.js\";\nimport type { PluginOfficialApi } from \"./official.js\";\nimport type { PluginPermission } from \"./permissions.js\";\nimport type { PluginSecretsApi } from \"./secrets.js\";\nimport type { PluginServiceApi } from \"./service-provider.js\";\nimport type { PluginStorageApi } from \"./storage.js\";\nimport type { PluginUiApi } from \"./ui.js\";\n\nexport interface PluginPermissionApi {\n\thas(permission: PluginPermission): boolean;\n\trequire(permission: PluginPermission): void;\n}\n\n/**\n * 工作模式 id。合法值由宿主的模式注册表定义(ADR-0071),插件不应硬编码枚举;\n * 需要区分模式时按 id 字符串比较,未知 id 一律按通用处理。\n */\nexport type AgentMode = string;\n\nexport interface PluginContext {\n\tplugin: {\n\t\tid: string;\n\t\tversion: string;\n\t\t/**\n\t\t * Host-resolved brand icon from `plugin.json#icon` (if declared).\n\t\t * Opaque string for `<img src>` / Iconify — plugins must not invent\n\t\t * host protocols; use this or omit Activity Tab `icon` to inherit it.\n\t\t */\n\t\ticonUrl?: string;\n\t};\n\tpermissions: PluginPermissionApi;\n\tui: PluginUiApi;\n\tfileExplorer: PluginFileExplorerApi;\n\tconversation: PluginConversationApi;\n\tagent: PluginAgentApi;\n\tappActions: PluginAppActionsApi;\n\tai: PluginAiApi;\n\tofficial: PluginOfficialApi;\n\tfs: PluginFsApi;\n\tcommand: PluginCommandApi;\n\tcliProviders: PluginCliProviderApi;\n\t/** Plugin-provisioned, host-managed local services declared by `plugin.json#providers.services`. */\n\tservices: PluginServiceApi;\n\t/** Explicitly permissioned model provider owned by this plugin's id namespace. */\n\tmodels: PluginModelsApi;\n\tmedia: PluginMediaApi;\n\tocr: OcrClient;\n\tjobs: PluginJobsApi;\n\tartifacts: PluginArtifactsApi;\n\t/** 主进程离屏窗口截图(`capture.offscreen` 权限)。旧宿主上为 `undefined`,使用前判空。 */\n\tcapture?: PluginCaptureApi;\n\t/** 宿主管理的浏览器能力;各具体方法会根据插件权限单独校验。 */\n\tbrowser: PluginBrowserApi;\n\tnetwork: PluginNetworkApi;\n\t/**\n\t * Vetta 服务端网关调用(ADR-0056)。**仅内置 official 插件可用**,\n\t * 第三方插件读到 `undefined`,故使用前必须判空。\n\t */\n\tgateway?: PluginGatewayApi;\n\tstorage: PluginStorageApi;\n\t/** Encrypted per-plugin secret storage (`secrets.read` / `secrets.write`). */\n\tsecrets: PluginSecretsApi;\n\ti18n: PluginI18nApi;\n\t/**\n\t * 当前的**新会话默认工作模式**(agent_mode 轴,见 ADR-0046 及其 2026-08 修订)。\n\t *\n\t * 工作模式只在会话创建时固化,之后会话内不可变,因此这里读到的是用户此刻的设置值,\n\t * **不是**某个已存在会话正在使用的模式,不要用它推断进行中的会话。\n\t * 模式也不再隐藏任何插件能力,只适合做展示层的软性定制,不要据此隐藏功能入口。\n\t */\n\tgetAgentMode(): AgentMode;\n\t/** 订阅默认工作模式变更(用户改设置时触发)。返回 Disposable 取消订阅。 */\n\tonAgentModeChanged(listener: (mode: AgentMode) => void): Disposable;\n}\n\nexport type PluginActivationCleanup = Disposable | (() => void | Promise<void>);\n\nexport interface PluginDefinition {\n\t/**\n\t * Activate one plugin instance. Returning a cleanup binds resource ownership to\n\t * this specific activation, including overlapping hot-reload activations.\n\t */\n\tactivate(ctx: PluginContext): void | PluginActivationCleanup | Promise<void | PluginActivationCleanup>;\n\t/** Legacy module-level cleanup. Prefer an activation-scoped cleanup return value. */\n\tdeactivate?(): void | Promise<void>;\n}\n\nexport function definePlugin(plugin: PluginDefinition): PluginDefinition {\n\treturn plugin;\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,33 +9,38 @@ export type { ConversationScenario } from "./scenario.js";
|
|
|
9
9
|
export { PLUGIN_PERMISSIONS } from "./permissions.js";
|
|
10
10
|
export type { PluginPermission } from "./permissions.js";
|
|
11
11
|
export type { Disposable } from "./disposable.js";
|
|
12
|
-
export type { PluginAgentManifest, PluginBrowserManifest, PluginManifest, PluginManifestInput, PluginManifestResourceReference, PluginMcpServerConfig, PluginNetworkManifest,
|
|
12
|
+
export type { PluginAgentManifest, PluginBrowserManifest, PluginCliProviderManifest, PluginServiceArtifact, PluginServicePlatform, PluginServiceProviderManifest, PluginServiceRuntimeKind, PluginManifest, PluginManifestInput, PluginManifestResourceReference, PluginMcpServerConfig, PluginNetworkManifest, PluginSkillPresentation, PluginSkillPresentationRule, } from "./manifest.js";
|
|
13
13
|
export type { PluginFileExplorerEntry, PluginWorkspaceRoot, PluginFileExplorerWhen, PluginFileExplorerActionContext, PluginFileExplorerContextMenuContribution, PluginFileExplorerToolbarContext, PluginFileExplorerToolbarContribution, PluginFileExplorerDecoration, PluginFileExplorerDecorationProvider, PluginFileExplorerChange, PluginFileExplorerRevealOptions, PluginFileExplorerApi, } from "./file-explorer.js";
|
|
14
14
|
export type { ConversationState, ConversationMessage, ConversationEvent, ConversationQueueState, CreateSessionOptions, PluginConversationApi, SendPromptResult, } from "./conversation.js";
|
|
15
|
-
export type { PluginGlobalSlotContribution, PluginNavBadge, PluginNavBadgeTone, PluginWorkspaceViewProps, PluginWorkspaceViewContribution, PluginWorkspaceViewHeader, PluginAudioMetadata, PluginPreviewUrlOptions, PluginPreviewFile, PluginFilePreviewProps, PluginFilePreviewContribution, PluginActivityTabContribution, PluginActivityTabRetention, PluginActivityTabTargetOptions, PluginCaptureRegion, PluginOpenActivityTabOptions, PluginPromptDecoration, PluginInputActionContribution, CardDescriptor, PluginPendingToolCall, PluginCardProps, PluginCardRendererContribution, PluginToolCallSlotToolCall, PluginToolCallSlotProps, PluginToolCallSlotContribution, PluginTurnCardContribution, PluginNotifyOptions, PluginUiApi, } from "./ui.js";
|
|
15
|
+
export type { PluginGlobalSlotContribution, PluginAbilityDetailSlotContribution, PluginAbilityDetailSlotProps, PluginNavBadge, PluginNavBadgeTone, PluginWorkspaceViewProps, PluginWorkspaceViewContribution, PluginWorkspaceViewHeader, PluginAudioMetadata, PluginPreviewUrlOptions, PluginPreviewFile, PluginFilePreviewProps, PluginFilePreviewContribution, PluginActivityTabContribution, PluginActivityTabRetention, PluginActivityTabTargetOptions, PluginCaptureRegion, PluginOpenActivityTabOptions, PluginPromptDecoration, PluginInputActionContribution, PluginNewSessionContext, PluginNewSessionContextActivation, PluginNewSessionContextContribution, PluginNewSessionTarget, CardDescriptor, PluginPendingToolCall, PluginCardProps, PluginCardRendererContribution, PluginToolCallSlotToolCall, PluginToolCallSlotProps, PluginToolCallSlotContribution, PluginTurnCardContribution, PluginNotifyOptions, PluginUiApi, } from "./ui.js";
|
|
16
16
|
export type { PluginShortcutScopeKind, PluginShortcutWhen, PluginShortcutBinding, PluginShortcutScopeContribution, PluginRegisterShortcutScope, UsePluginShortcutScopeOptions, } from "./shortcuts.js";
|
|
17
17
|
export { usePluginShortcutScope } from "./shortcuts.js";
|
|
18
18
|
export type { PluginJsonSchema, PluginAgentToolApi, PluginAgentToolRegistration, PluginSystemPromptBlock, PluginDynamicSystemPromptOperation, PluginSystemPromptMessage, PluginSystemPromptProviderContext, PluginSystemPromptBlockView, PluginAgentActions, PluginAgentHandlerContext, PluginAgentToolHandler, PluginCodingAgentHookEvent, PluginCodingAgentHookEventName, PluginCodingAgentHookEventOf, PluginCodingAgentHookHandler, PluginCodingAgentHookHandlerContext, PluginCodingAgentHookRegistration, PluginCodingAgentHookResult, PluginCodingAgentHookTool, PluginCodingAgentPermissionMode, PluginSystemPromptProviderHandler, PluginSystemPromptProviderRegistration, PluginContinuationResult, PluginContinuationHandler, PluginContinuationRegistration, PluginAgentApi, } from "./agent.js";
|
|
19
19
|
export { PLUGIN_CODING_AGENT_HOOK_EVENT_NAMES } from "./agent.js";
|
|
20
20
|
export type { PluginAppActionEffect, PluginAppActionExample, PluginAppActionHandlerContext, PluginAppActionHandler, PluginAppActionReadyHandler, PluginAppActionApprovalPresentation, PluginAppActionApproval, PluginAppActionRegistration, PluginAppActionUsage, PluginAppActionsApi, } from "./app-actions.js";
|
|
21
21
|
export { PluginAppActionError } from "./app-actions.js";
|
|
22
|
-
export type { PluginAiApi, PluginAiChatAssistantMessage, PluginAiChatMessage, PluginAiChatRequest, PluginAiChatResult, PluginAiChatTool, PluginAiChatToolResultMessage, PluginAiChatUserMessage, PluginAiCompleteRequest, PluginAiCompleteResult, PluginAiModel, PluginAiModelListResult, PluginAiToolCall, PluginAiUsage, } from "./ai.js";
|
|
22
|
+
export type { PluginAiApi, PluginAiChatAssistantMessage, PluginAiChatMessage, PluginAiChatRequest, PluginAiChatResult, PluginAiChatTool, PluginAiChatToolResultMessage, PluginAiChatUserMessage, PluginAiCompleteRequest, PluginAiCompleteResult, PluginAiStreamOptions, PluginAiTextDeltaEvent, PluginAiModel, PluginAiModelListResult, PluginAiToolCall, PluginAiUsage, } from "./ai.js";
|
|
23
23
|
export type { PluginOfficialGeneralSettings, PluginOfficialGeneralSettingsUpdate, PluginOfficialExperimentalSettings, PluginOfficialDownloadItem, PluginOfficialUpdaterState, PluginOfficialWebhookKind, PluginOfficialWebhookEndpoint, PluginOfficialWebhookProvider, PluginOfficialWebhookCreateInput, PluginOfficialWebhookUpdateInput, PluginOfficialWebhookMessage, PluginOfficialWebhookSendResult, PluginOfficialSkillInfo, PluginOfficialInstalledSkill, PluginOfficialShortcutBinding, PluginOfficialQuickPanelSettings, PluginOfficialImStatus, PluginOfficialImLog, PluginOfficialMcpServerSummary, PluginOfficialMcpServerDetail, PluginOfficialMcpUpsertData, PluginOfficialExecutionMode, PluginOfficialSelectedSkill, PluginOfficialBatchProjectCreateData, PluginOfficialBatchProjectUpdateData, PluginOfficialSchedulerTaskCreateData, PluginOfficialSchedulerTaskUpdateData, PluginOfficialModelSummary, PluginOfficialProviderSummary, PluginOfficialProviderDetail, PluginOfficialProviderUpsertData, PluginOfficialProjectEntry, PluginOfficialSessionHandle, PluginOfficialNavigationOpenInput, PluginOfficialOpenFilesOptions, PluginOfficialOpenedFile, PluginOfficialSessionAccess, PluginOfficialSessionRunningEvent, PluginOfficialSessionSummary, PluginOfficialPluginSummary, PluginOfficialKnowledgeBase, PluginOfficialKnowledgeProcessingSettings, PluginOfficialApi, } from "./official.js";
|
|
24
24
|
export type { PluginFsEntry, PluginFsFileRef, PluginFsBinaryReadResult, PluginFsStatResult, PluginFsReadResult, PluginFsApi, } from "./fs.js";
|
|
25
25
|
export type { PluginCommandRunOptions, PluginCommandRunResult, PluginCommandSpawnOptions, PluginCommandSpawnExit, PluginCommandSpawnStatus, PluginCommandSpawnHandle, PluginCommandApi, } from "./command.js";
|
|
26
|
+
export type { PluginCliProviderApi, PluginCliProviderPhase, PluginCliProviderStatus, } from "./cli-provider.js";
|
|
27
|
+
export type { PluginServiceApi, PluginServiceArtifactPayload, PluginServiceConnection, PluginServiceHostPlatform, PluginServicePhase, PluginServiceRequest, PluginServiceResponse, PluginServiceStatus, PluginServiceDataEncoding, } from "./service-provider.js";
|
|
28
|
+
export type { PluginModelDefinition, PluginModelProviderConfig, PluginModelsApi } from "./models.js";
|
|
26
29
|
export type { PluginBrowserAction, PluginBrowserActionResult, PluginBrowserApi, PluginBrowserPageState, PluginBrowserProfile, PluginBrowserRuntimePhase, PluginBrowserRuntimeStatus, PluginBrowserScreenshot, PluginBrowserSession, PluginBrowserSessionOptions, PluginBrowserSessionStatus, PluginBrowserSnapshot, PluginBrowserSource, PluginBrowserTextContent, } from "./browser.js";
|
|
27
30
|
export type { PluginCaptureApi, PluginOffscreenCaptureOptions, PluginOffscreenCaptureResult, } from "./capture.js";
|
|
28
31
|
export type { PluginImageRef } from "./images.js";
|
|
29
32
|
export type { PluginArtifactDestination, PluginArtifactRef, PluginArtifactsApi, PluginPersistedArtifact, } from "./artifacts.js";
|
|
30
33
|
export type { PluginJob, PluginJobFailure, PluginJobProgress, PluginJobRef, PluginJobsApi, PluginJobStatus, PluginJobWaitOptions, } from "./jobs.js";
|
|
31
34
|
export type { PluginMediaApi, PluginMediaArtifact, PluginMediaCapability, PluginMediaComposeRequest, PluginMediaDimensions, PluginMediaErrorCode, PluginMediaFailure, PluginMediaGenerateRequest, PluginMediaGenerationInputSlot, PluginMediaGenerationMode, PluginMediaGenerationModeCapability, PluginMediaInput, PluginMediaInputSource, PluginMediaInputUploadRequest, PluginMediaJob, PluginMediaKind, PluginMediaOperation, PluginMediaOutput, PluginMediaOutputKind, PluginMediaProviderDescriptor, PluginMediaProviderArtifact, PluginMediaProviderArtifactSource, PluginMediaProviderHandlerContext, PluginMediaProviderInput, PluginMediaProviderJob, PluginMediaProviderRegistration, PluginMediaProviderSubmitRequest, PluginMediaSubmitRequest, PluginMediaTranscodeRequest, PluginMediaTransferResponse, } from "./media.js";
|
|
35
|
+
export type { OcrBlock, OcrClient, OcrErrorCode, OcrItemResult, OcrInput, OcrProgress, OcrProviderContext, OcrProviderDescriptor, OcrProviderInput, OcrProviderRegistration, OcrProviderRequest, OcrProviderResult, OcrRequest, OcrResult, OcrTransferResponse, OcrUploadRequest, } from "./ocr.js";
|
|
32
36
|
export { PluginMediaError } from "./media.js";
|
|
33
37
|
export type { PluginPromptAttachment, PluginPromptContext, PluginPromptContextJsonValue, } from "./prompt-attachment.js";
|
|
34
38
|
export { definePluginPromptContext } from "./prompt-attachment.js";
|
|
35
39
|
export type { PluginNetworkApi, PluginNetworkBody, PluginNetworkRequest, PluginNetworkResponse, } from "./network.js";
|
|
36
40
|
export type { PluginGatewayApi, PluginGatewayRequest, PluginGatewayResponse } from "./gateway.js";
|
|
37
|
-
export type { PluginPutBlobInput, PluginPutBlobFromFileInput, PluginStorageApi, PluginStoredBlob, PluginStoredBlobRef, } from "./storage.js";
|
|
38
|
-
export
|
|
41
|
+
export type { PluginPutBlobInput, PluginPutBlobFromFileInput, PluginStorageApi, PluginStorageChange, PluginStorageCommitOptions, PluginStorageCommitResult, PluginStorageEncoding, PluginStorageSnapshot, PluginStorageWrite, PluginStoredBlob, PluginStoredBlobRef, } from "./storage.js";
|
|
42
|
+
export { readJsonFile, writeJsonFile } from "./storage.js";
|
|
43
|
+
export type { PluginSecretsApi } from "./secrets.js";
|
|
39
44
|
export type { PluginLocaleCatalog, PluginLocales, PluginTranslate, PluginI18nApi, } from "./i18n.js";
|
|
40
45
|
export { interpolatePluginText, resolveCatalogKey, resolvePluginText } from "./i18n.js";
|
|
41
46
|
export type { PluginPermissionApi, AgentMode, PluginActivationCleanup, PluginContext, PluginDefinition, } from "./context.js";
|