@vetta-org/plugin-sdk 0.0.4 → 0.1.0
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 +5 -0
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js.map +1 -1
- package/dist/context.d.ts +4 -2
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js.map +1 -1
- package/dist/conversation.d.ts +7 -1
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js.map +1 -1
- package/dist/fs.d.ts +9 -0
- package/dist/fs.d.ts.map +1 -1
- package/dist/fs.js.map +1 -1
- package/dist/hooks.d.ts +4 -6
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +4 -6
- package/dist/hooks.js.map +1 -1
- package/dist/host-bridge.d.ts +2 -2
- package/dist/host-bridge.d.ts.map +1 -1
- package/dist/host-bridge.js.map +1 -1
- package/dist/images.d.ts +0 -41
- package/dist/images.d.ts.map +1 -1
- package/dist/images.js.map +1 -1
- package/dist/index.d.ts +7 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/network.d.ts +38 -0
- package/dist/network.d.ts.map +1 -0
- package/dist/network.js +2 -0
- package/dist/network.js.map +1 -0
- package/dist/official.d.ts +0 -1
- 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.map +1 -1
- package/dist/prompt-attachment.d.ts +15 -0
- package/dist/prompt-attachment.d.ts.map +1 -0
- package/dist/prompt-attachment.js +2 -0
- package/dist/prompt-attachment.js.map +1 -0
- package/dist/storage.d.ts +31 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +2 -0
- package/dist/storage.js.map +1 -0
- package/dist/ui.d.ts +39 -9
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js.map +1 -1
- package/package.json +1 -1
package/dist/agent.d.ts
CHANGED
|
@@ -10,6 +10,11 @@ export interface PluginAgentToolApi {
|
|
|
10
10
|
export interface PluginAgentToolRegistration<TInput = unknown> {
|
|
11
11
|
id: string;
|
|
12
12
|
name?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Host UI display name for this tool (e.g. Work-mode tool headers).
|
|
15
|
+
* Supports `%catalogKey%` resolved against the plugin's locales; bare strings
|
|
16
|
+
* are used as literals. Not sent to the model — use {@link description} for that.
|
|
17
|
+
*/
|
|
13
18
|
label?: string;
|
|
14
19
|
description: string;
|
|
15
20
|
parameters: PluginJsonSchema;
|
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,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC5C,yGAAmD;IACnD,QAAQ,CAAC,EAAE,MAAM,E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G,UAAU,CAAC;KACtC,CAAC;IACF,OAAO,EAAE,iCAAiC,CAAC;CAC3C;AAED,MAAM,WAAW,wBAAwB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,oFAAoF;IACpF,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,yBAAyB,GAAG,CACvC,OAAO,EAAE,yBAAyB,CAAC;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,KAC3E,wBAAwB,GAAG,IAAI,GAAG,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAAC;AAEhF,MAAM,WAAW,8BAA8B;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;KAAE,CAAC;IACpD,OAAO,EAAE,yBAAyB,CAAC;CACnC;AAED,MAAM,WAAW,cAAc;IAC9B,YAAY,CAAC,MAAM,GAAG,OAAO,EAAE,YAAY,EAAE,2BAA2B,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC;IAC9F,4DAA4D;IAC5D,4BAA4B,CAAC,YAAY,EAAE,sCAAsC,GAAG,UAAU,CAAC;IAC/F;;;OAGG;IACH,4BAA4B,CAAC,YAAY,EAAE,8BAA8B,GAAG,UAAU,CAAC;CACvF","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\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/** 允许该工具出现的工作模式 slug(agent_mode 轴,如 \"work\"/\"coding\")。缺省/空 = 通用。见 ADR-0046。 */\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\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\tsetEnabled(toolName: string, enabled: boolean): void;\n\t\tenable(toolName: string): void;\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 interface PluginAgentApi {\n\tregisterTool<TInput = unknown>(registration: PluginAgentToolRegistration<TInput>): Disposable;\n\t/** Register a provider evaluated before every Agent run. */\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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hF,MAAM,WAAW,8BAA8B;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;KAAE,CAAC;IACpD,OAAO,EAAE,yBAAyB,CAAC;CACnC;AAED,MAAM,WAAW,cAAc;IAC9B,YAAY,CAAC,MAAM,GAAG,OAAO,EAAE,YAAY,EAAE,2BAA2B,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC;IAC9F,4DAA4D;IAC5D,4BAA4B,CAAC,YAAY,EAAE,sCAAsC,GAAG,UAAU,CAAC;IAC/F;;;OAGG;IACH,4BAA4B,CAAC,YAAY,EAAE,8BAA8B,GAAG,UAAU,CAAC;CACvF","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/** 允许该工具出现的工作模式 slug(agent_mode 轴,如 \"work\"/\"coding\")。缺省/空 = 通用。见 ADR-0046。 */\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\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\tsetEnabled(toolName: string, enabled: boolean): void;\n\t\tenable(toolName: string): void;\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 interface PluginAgentApi {\n\tregisterTool<TInput = unknown>(registration: PluginAgentToolRegistration<TInput>): Disposable;\n\t/** Register a provider evaluated before every Agent run. */\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}\n"]}
|
package/dist/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"","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\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/** 允许该工具出现的工作模式 slug(agent_mode 轴,如 \"work\"/\"coding\")。缺省/空 = 通用。见 ADR-0046。 */\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\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\tsetEnabled(toolName: string, enabled: boolean): void;\n\t\tenable(toolName: string): void;\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 interface PluginAgentApi {\n\tregisterTool<TInput = unknown>(registration: PluginAgentToolRegistration<TInput>): Disposable;\n\t/** Register a provider evaluated before every Agent run. */\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}\n"]}
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"","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/** 允许该工具出现的工作模式 slug(agent_mode 轴,如 \"work\"/\"coding\")。缺省/空 = 通用。见 ADR-0046。 */\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\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\tsetEnabled(toolName: string, enabled: boolean): void;\n\t\tenable(toolName: string): void;\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 interface PluginAgentApi {\n\tregisterTool<TInput = unknown>(registration: PluginAgentToolRegistration<TInput>): Disposable;\n\t/** Register a provider evaluated before every Agent run. */\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}\n"]}
|
package/dist/context.d.ts
CHANGED
|
@@ -5,10 +5,11 @@ import type { PluginConversationApi } from "./conversation.js";
|
|
|
5
5
|
import type { Disposable } from "./disposable.js";
|
|
6
6
|
import type { PluginFsApi } from "./fs.js";
|
|
7
7
|
import type { PluginI18nApi } from "./i18n.js";
|
|
8
|
-
import type {
|
|
8
|
+
import type { PluginNetworkApi } from "./network.js";
|
|
9
9
|
import type { PluginOfficialApi } from "./official.js";
|
|
10
10
|
import type { PluginPermission } from "./permissions.js";
|
|
11
11
|
import type { PluginSettingsApi } from "./settings.js";
|
|
12
|
+
import type { PluginStorageApi } from "./storage.js";
|
|
12
13
|
import type { PluginUiApi } from "./ui.js";
|
|
13
14
|
export interface PluginPermissionApi {
|
|
14
15
|
has(permission: PluginPermission): boolean;
|
|
@@ -29,7 +30,8 @@ export interface PluginContext {
|
|
|
29
30
|
official: PluginOfficialApi;
|
|
30
31
|
fs: PluginFsApi;
|
|
31
32
|
command: PluginCommandApi;
|
|
32
|
-
|
|
33
|
+
network: PluginNetworkApi;
|
|
34
|
+
storage: PluginStorageApi;
|
|
33
35
|
settings: PluginSettingsApi;
|
|
34
36
|
i18n: PluginI18nApi;
|
|
35
37
|
/** 当前工作模式(agent_mode 轴)。开发者据此做模式定制。见 ADR-0046。 */
|
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,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,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,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,
|
|
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,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MA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;IAC1B,8FAA4C;IAC5C,kBAAkB,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,GAAG,UAAU,CAAC;CACpE;AAED,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,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 { PluginAppActionsApi } from \"./app-actions.js\";\nimport type { PluginCommandApi } from \"./command.js\";\nimport type { PluginConversationApi } from \"./conversation.js\";\nimport type { Disposable } from \"./disposable.js\";\nimport type { PluginFsApi } from \"./fs.js\";\nimport type { PluginI18nApi } from \"./i18n.js\";\nimport type { PluginNetworkApi } from \"./network.js\";\nimport type { PluginOfficialApi } from \"./official.js\";\nimport type { PluginPermission } from \"./permissions.js\";\nimport type { PluginSettingsApi } from \"./settings.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/** 工作模式(agent_mode 轴,见 ADR-0046)。宿主 Work/Coding,未来可能扩展。 */\nexport type AgentMode = \"work\" | \"coding\";\n\nexport interface PluginContext {\n\tplugin: {\n\t\tid: string;\n\t\tversion: string;\n\t};\n\tpermissions: PluginPermissionApi;\n\tui: PluginUiApi;\n\tconversation: PluginConversationApi;\n\tagent: PluginAgentApi;\n\tappActions: PluginAppActionsApi;\n\tofficial: PluginOfficialApi;\n\tfs: PluginFsApi;\n\tcommand: PluginCommandApi;\n\tnetwork: PluginNetworkApi;\n\tstorage: PluginStorageApi;\n\tsettings: PluginSettingsApi;\n\ti18n: PluginI18nApi;\n\t/** 当前工作模式(agent_mode 轴)。开发者据此做模式定制。见 ADR-0046。 */\n\tgetAgentMode(): AgentMode;\n\t/** 订阅工作模式变更(纯全局实时切换)。返回 Disposable 取消订阅。 */\n\tonAgentModeChanged(listener: (mode: AgentMode) => void): Disposable;\n}\n\nexport interface PluginDefinition {\n\tactivate(ctx: PluginContext): void | Promise<void>;\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":"AAkDA,MAAM,UAAU,YAAY,CAAC,MAAwB,EAAoB;IACxE,OAAO,MAAM,CAAC;AAAA,CACd","sourcesContent":["import type { PluginAgentApi } from \"./agent.js\";\nimport type { PluginAppActionsApi } from \"./app-actions.js\";\nimport type { PluginCommandApi } from \"./command.js\";\nimport type { PluginConversationApi } from \"./conversation.js\";\nimport type { Disposable } from \"./disposable.js\";\nimport type { PluginFsApi } from \"./fs.js\";\nimport type { PluginI18nApi } from \"./i18n.js\";\nimport type { PluginNetworkApi } from \"./network.js\";\nimport type { PluginOfficialApi } from \"./official.js\";\nimport type { PluginPermission } from \"./permissions.js\";\nimport type { PluginSettingsApi } from \"./settings.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/** 工作模式(agent_mode 轴,见 ADR-0046)。宿主 Work/Coding,未来可能扩展。 */\nexport type AgentMode = \"work\" | \"coding\";\n\nexport interface PluginContext {\n\tplugin: {\n\t\tid: string;\n\t\tversion: string;\n\t};\n\tpermissions: PluginPermissionApi;\n\tui: PluginUiApi;\n\tconversation: PluginConversationApi;\n\tagent: PluginAgentApi;\n\tappActions: PluginAppActionsApi;\n\tofficial: PluginOfficialApi;\n\tfs: PluginFsApi;\n\tcommand: PluginCommandApi;\n\tnetwork: PluginNetworkApi;\n\tstorage: PluginStorageApi;\n\tsettings: PluginSettingsApi;\n\ti18n: PluginI18nApi;\n\t/** 当前工作模式(agent_mode 轴)。开发者据此做模式定制。见 ADR-0046。 */\n\tgetAgentMode(): AgentMode;\n\t/** 订阅工作模式变更(纯全局实时切换)。返回 Disposable 取消订阅。 */\n\tonAgentModeChanged(listener: (mode: AgentMode) => void): Disposable;\n}\n\nexport interface PluginDefinition {\n\tactivate(ctx: PluginContext): void | Promise<void>;\n\tdeactivate?(): void | Promise<void>;\n}\n\nexport function definePlugin(plugin: PluginDefinition): PluginDefinition {\n\treturn plugin;\n}\n"]}
|
package/dist/conversation.d.ts
CHANGED
|
@@ -44,7 +44,13 @@ export interface PluginConversationApi {
|
|
|
44
44
|
insertText(text: string): void;
|
|
45
45
|
/** Abort the active conversation's current turn. */
|
|
46
46
|
abort(): Promise<void>;
|
|
47
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Subscribe to real-time conversation events. The listener is replayed one
|
|
49
|
+
* `conversation-changed` with the current state right after subscribing (in a
|
|
50
|
+
* microtask), so logic keyed off the active conversation — e.g. deciding
|
|
51
|
+
* whether an activity tab belongs in the tab bar for this cwd — runs without
|
|
52
|
+
* waiting for the next session switch.
|
|
53
|
+
*/
|
|
48
54
|
on(listener: (event: ConversationEvent) => void): Disposable;
|
|
49
55
|
}
|
|
50
56
|
//# sourceMappingURL=conversation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../src/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,WAAW,iBAAiB;IACjC,wEAAwE;IACxE,EAAE,EAAE,M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AC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,sEAAsE;IACtE,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,oDAAoD;IACpD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB;;;;;;OAMG;IACH,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GAAG,UAAU,CAAC;CAC7D","sourcesContent":["import type { Disposable } from \"./disposable.js\";\n\nexport interface ConversationState {\n\t/** Active session runtimeId, or null when no conversation is active. */\n\tid: string | null;\n\tcwd: string | null;\n\tsessionPath: string | null;\n\tmodel: string | null;\n\tisStreaming: boolean;\n}\n\nexport interface ConversationMessage {\n\tid: string;\n\trole: \"user\" | \"assistant\" | \"compaction\";\n\ttext: string;\n\ttimestamp?: number;\n}\n\nexport type ConversationEvent =\n\t| { type: \"turn-start\" }\n\t| { type: \"turn-end\"; stopReason: string }\n\t| { type: \"message-added\"; message: ConversationMessage }\n\t| { type: \"message-updated\"; delta: string }\n\t| { type: \"tool-call-start\"; toolCallId: string; toolName: string }\n\t| { type: \"tool-call-end\"; toolCallId: string; toolName: string; isError: boolean }\n\t| { type: \"conversation-changed\"; conversation: ConversationState };\n\nexport interface PluginConversationApi {\n\t/** Send a prompt into the active conversation (renders as a user turn). */\n\tsendPrompt(text: string): Promise<void>;\n\t/** Fill the input bar without sending; the user can edit and send. */\n\tinsertText(text: string): void;\n\t/** Abort the active conversation's current turn. */\n\tabort(): Promise<void>;\n\t/**\n\t * Subscribe to real-time conversation events. The listener is replayed one\n\t * `conversation-changed` with the current state right after subscribing (in a\n\t * microtask), so logic keyed off the active conversation — e.g. deciding\n\t * whether an activity tab belongs in the tab bar for this cwd — runs without\n\t * waiting for the next session switch.\n\t */\n\ton(listener: (event: ConversationEvent) => void): Disposable;\n}\n"]}
|
package/dist/conversation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../src/conversation.ts"],"names":[],"mappings":"","sourcesContent":["import type { Disposable } from \"./disposable.js\";\n\nexport interface ConversationState {\n\t/** Active session runtimeId, or null when no conversation is active. */\n\tid: string | null;\n\tcwd: string | null;\n\tsessionPath: string | null;\n\tmodel: string | null;\n\tisStreaming: boolean;\n}\n\nexport interface ConversationMessage {\n\tid: string;\n\trole: \"user\" | \"assistant\" | \"compaction\";\n\ttext: string;\n\ttimestamp?: number;\n}\n\nexport type ConversationEvent =\n\t| { type: \"turn-start\" }\n\t| { type: \"turn-end\"; stopReason: string }\n\t| { type: \"message-added\"; message: ConversationMessage }\n\t| { type: \"message-updated\"; delta: string }\n\t| { type: \"tool-call-start\"; toolCallId: string; toolName: string }\n\t| { type: \"tool-call-end\"; toolCallId: string; toolName: string; isError: boolean }\n\t| { type: \"conversation-changed\"; conversation: ConversationState };\n\nexport interface PluginConversationApi {\n\t/** Send a prompt into the active conversation (renders as a user turn). */\n\tsendPrompt(text: string): Promise<void>;\n\t/** Fill the input bar without sending; the user can edit and send. */\n\tinsertText(text: string): void;\n\t/** Abort the active conversation's current turn. */\n\tabort(): Promise<void>;\n\t
|
|
1
|
+
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../src/conversation.ts"],"names":[],"mappings":"","sourcesContent":["import type { Disposable } from \"./disposable.js\";\n\nexport interface ConversationState {\n\t/** Active session runtimeId, or null when no conversation is active. */\n\tid: string | null;\n\tcwd: string | null;\n\tsessionPath: string | null;\n\tmodel: string | null;\n\tisStreaming: boolean;\n}\n\nexport interface ConversationMessage {\n\tid: string;\n\trole: \"user\" | \"assistant\" | \"compaction\";\n\ttext: string;\n\ttimestamp?: number;\n}\n\nexport type ConversationEvent =\n\t| { type: \"turn-start\" }\n\t| { type: \"turn-end\"; stopReason: string }\n\t| { type: \"message-added\"; message: ConversationMessage }\n\t| { type: \"message-updated\"; delta: string }\n\t| { type: \"tool-call-start\"; toolCallId: string; toolName: string }\n\t| { type: \"tool-call-end\"; toolCallId: string; toolName: string; isError: boolean }\n\t| { type: \"conversation-changed\"; conversation: ConversationState };\n\nexport interface PluginConversationApi {\n\t/** Send a prompt into the active conversation (renders as a user turn). */\n\tsendPrompt(text: string): Promise<void>;\n\t/** Fill the input bar without sending; the user can edit and send. */\n\tinsertText(text: string): void;\n\t/** Abort the active conversation's current turn. */\n\tabort(): Promise<void>;\n\t/**\n\t * Subscribe to real-time conversation events. The listener is replayed one\n\t * `conversation-changed` with the current state right after subscribing (in a\n\t * microtask), so logic keyed off the active conversation — e.g. deciding\n\t * whether an activity tab belongs in the tab bar for this cwd — runs without\n\t * waiting for the next session switch.\n\t */\n\ton(listener: (event: ConversationEvent) => void): Disposable;\n}\n"]}
|
package/dist/fs.d.ts
CHANGED
|
@@ -19,9 +19,15 @@ export interface PluginFsReadResult {
|
|
|
19
19
|
content: string;
|
|
20
20
|
encoding: "utf8" | "base64";
|
|
21
21
|
}
|
|
22
|
+
export interface PluginFsBinaryReadResult {
|
|
23
|
+
data: string;
|
|
24
|
+
mimeType: string;
|
|
25
|
+
size: number;
|
|
26
|
+
}
|
|
22
27
|
export interface PluginFsApi {
|
|
23
28
|
readDir(dirPath: string): Promise<PluginFsEntry[]>;
|
|
24
29
|
readFile(filePath: string): Promise<PluginFsReadResult>;
|
|
30
|
+
readBinaryFile(filePath: string): Promise<PluginFsBinaryReadResult>;
|
|
25
31
|
/** Pass `encoding: "base64"` to write binary payloads (decoded from base64 text). */
|
|
26
32
|
writeFile(filePath: string, content: string, encoding?: "utf8" | "base64"): Promise<void>;
|
|
27
33
|
stat(filePath: string): Promise<PluginFsStatResult | null>;
|
|
@@ -30,5 +36,8 @@ export interface PluginFsApi {
|
|
|
30
36
|
move(sourcePath: string, destDir: string): Promise<void>;
|
|
31
37
|
createDirectory(dirPath: string): Promise<void>;
|
|
32
38
|
listFilesRecursive(rootPath: string): Promise<PluginFsFileRef[]>;
|
|
39
|
+
/** Watch one directory for host-debounced changes. Requires `fs.read`. */
|
|
40
|
+
watchDirectory(dirPath: string, listener: (changedPath: string) => void): Disposable;
|
|
33
41
|
}
|
|
42
|
+
import type { Disposable } from "./disposable.js";
|
|
34
43
|
//# sourceMappingURL=fs.d.ts.map
|
package/dist/fs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../src/fs.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC5B;AAED,MAAM,WAAW,WAAW;IAC3B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IACnD,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACxD,qFAAqF;IACrF,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1F,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IAC3D,M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C;IACnD,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACxD,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACpE,qFAAqF;IACrF,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1F,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IAC3D,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;IACjE,0EAA0E;IAC1E,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,GAAG,UAAU,CAAC;CACrF;AACD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export interface PluginFsEntry {\n\tname: string;\n\tpath: string;\n\tisDirectory: boolean;\n\tsize: number;\n\tmodifiedAt: number;\n}\n\nexport interface PluginFsFileRef {\n\tname: string;\n\tpath: string;\n\trelPath: string;\n}\n\nexport interface PluginFsStatResult {\n\tsize: number;\n\tmodifiedAt: number;\n\tcreatedAt: number;\n}\n\nexport interface PluginFsReadResult {\n\tcontent: string;\n\tencoding: \"utf8\" | \"base64\";\n}\n\nexport interface PluginFsBinaryReadResult {\n\tdata: string;\n\tmimeType: string;\n\tsize: number;\n}\n\nexport interface PluginFsApi {\n\treadDir(dirPath: string): Promise<PluginFsEntry[]>;\n\treadFile(filePath: string): Promise<PluginFsReadResult>;\n\treadBinaryFile(filePath: string): Promise<PluginFsBinaryReadResult>;\n\t/** Pass `encoding: \"base64\"` to write binary payloads (decoded from base64 text). */\n\twriteFile(filePath: string, content: string, encoding?: \"utf8\" | \"base64\"): Promise<void>;\n\tstat(filePath: string): Promise<PluginFsStatResult | null>;\n\trename(oldPath: string, newPath: string): Promise<void>;\n\tdelete(targetPath: string): Promise<void>;\n\tmove(sourcePath: string, destDir: string): Promise<void>;\n\tcreateDirectory(dirPath: string): Promise<void>;\n\tlistFilesRecursive(rootPath: string): Promise<PluginFsFileRef[]>;\n\t/** Watch one directory for host-debounced changes. Requires `fs.read`. */\n\twatchDirectory(dirPath: string, listener: (changedPath: string) => void): Disposable;\n}\nimport type { Disposable } from \"./disposable.js\";\n"]}
|
package/dist/fs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs.js","sourceRoot":"","sources":["../src/fs.ts"],"names":[],"mappings":"","sourcesContent":["export interface PluginFsEntry {\n\tname: string;\n\tpath: string;\n\tisDirectory: boolean;\n\tsize: number;\n\tmodifiedAt: number;\n}\n\nexport interface PluginFsFileRef {\n\tname: string;\n\tpath: string;\n\trelPath: string;\n}\n\nexport interface PluginFsStatResult {\n\tsize: number;\n\tmodifiedAt: number;\n\tcreatedAt: number;\n}\n\nexport interface PluginFsReadResult {\n\tcontent: string;\n\tencoding: \"utf8\" | \"base64\";\n}\n\nexport interface PluginFsApi {\n\treadDir(dirPath: string): Promise<PluginFsEntry[]>;\n\treadFile(filePath: string): Promise<PluginFsReadResult>;\n\t/** Pass `encoding: \"base64\"` to write binary payloads (decoded from base64 text). */\n\twriteFile(filePath: string, content: string, encoding?: \"utf8\" | \"base64\"): Promise<void>;\n\tstat(filePath: string): Promise<PluginFsStatResult | null>;\n\trename(oldPath: string, newPath: string): Promise<void>;\n\tdelete(targetPath: string): Promise<void>;\n\tmove(sourcePath: string, destDir: string): Promise<void>;\n\tcreateDirectory(dirPath: string): Promise<void>;\n\tlistFilesRecursive(rootPath: string): Promise<PluginFsFileRef[]>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"fs.js","sourceRoot":"","sources":["../src/fs.ts"],"names":[],"mappings":"","sourcesContent":["export interface PluginFsEntry {\n\tname: string;\n\tpath: string;\n\tisDirectory: boolean;\n\tsize: number;\n\tmodifiedAt: number;\n}\n\nexport interface PluginFsFileRef {\n\tname: string;\n\tpath: string;\n\trelPath: string;\n}\n\nexport interface PluginFsStatResult {\n\tsize: number;\n\tmodifiedAt: number;\n\tcreatedAt: number;\n}\n\nexport interface PluginFsReadResult {\n\tcontent: string;\n\tencoding: \"utf8\" | \"base64\";\n}\n\nexport interface PluginFsBinaryReadResult {\n\tdata: string;\n\tmimeType: string;\n\tsize: number;\n}\n\nexport interface PluginFsApi {\n\treadDir(dirPath: string): Promise<PluginFsEntry[]>;\n\treadFile(filePath: string): Promise<PluginFsReadResult>;\n\treadBinaryFile(filePath: string): Promise<PluginFsBinaryReadResult>;\n\t/** Pass `encoding: \"base64\"` to write binary payloads (decoded from base64 text). */\n\twriteFile(filePath: string, content: string, encoding?: \"utf8\" | \"base64\"): Promise<void>;\n\tstat(filePath: string): Promise<PluginFsStatResult | null>;\n\trename(oldPath: string, newPath: string): Promise<void>;\n\tdelete(targetPath: string): Promise<void>;\n\tmove(sourcePath: string, destDir: string): Promise<void>;\n\tcreateDirectory(dirPath: string): Promise<void>;\n\tlistFilesRecursive(rootPath: string): Promise<PluginFsFileRef[]>;\n\t/** Watch one directory for host-debounced changes. Requires `fs.read`. */\n\twatchDirectory(dirPath: string, listener: (changedPath: string) => void): Disposable;\n}\nimport type { Disposable } from \"./disposable.js\";\n"]}
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ConversationMessage, ConversationState } from "./conversation.js";
|
|
2
2
|
import type { PluginLocales, PluginTranslate } from "./i18n.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { PluginPromptAttachment } from "./prompt-attachment.js";
|
|
4
4
|
export interface PluginI18nContextValue {
|
|
5
5
|
/** This plugin's catalogs, keyed by locale code. */
|
|
6
6
|
locales: PluginLocales;
|
|
@@ -30,10 +30,8 @@ export declare function useActiveConversation(): ConversationState;
|
|
|
30
30
|
/** Reactive: the active conversation's messages. */
|
|
31
31
|
export declare function useConversationMessages(): ConversationMessage[];
|
|
32
32
|
/**
|
|
33
|
-
* Reactive: the
|
|
34
|
-
*
|
|
35
|
-
* "selected for edit" highlight — clears automatically when the host drops the
|
|
36
|
-
* attachment (send, capsule close, or session switch).
|
|
33
|
+
* Reactive: the plugin-owned one-shot context attached to the next prompt.
|
|
34
|
+
* Clears automatically after send, capsule close, or session switch.
|
|
37
35
|
*/
|
|
38
|
-
export declare function
|
|
36
|
+
export declare function usePromptAttachment(): PluginPromptAttachment | null;
|
|
39
37
|
//# sourceMappingURL=hooks.d.ts.map
|
package/dist/hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEhF,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEhE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEhF,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEhE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAIrE,MAAM,WAAW,sBAAsB;IACtC,oDAAoD;IACpD,OAAO,EAAE,aAAa,CAAC;IACvB,mEAAmE;IACnE,aAAa,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,iDAG9B,CAAC;AAEH,MAAM,WAAW,iBAAiB;IACjC,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,CAAC,EAAE,eAAe,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,iBAAiB,CAQlD;AAED,2DAA2D;AAC3D,wBAAgB,qBAAqB,IAAI,iBAAiB,CAEzD;AAED,oDAAoD;AACpD,wBAAgB,uBAAuB,IAAI,mBAAmB,EAAE,CAE/D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,sBAAsB,GAAG,IAAI,CAEnE","sourcesContent":["import { createContext, useCallback, useContext } from \"react\";\nimport type { ConversationMessage, ConversationState } from \"./conversation.js\";\nimport { requireBridge } from \"./host-bridge.js\";\nimport type { PluginLocales, PluginTranslate } from \"./i18n.js\";\nimport { resolveCatalogKey } from \"./i18n.js\";\nimport type { PluginPromptAttachment } from \"./prompt-attachment.js\";\n\n// ─── i18n context (host-provided, per plugin) ───\n\nexport interface PluginI18nContextValue {\n\t/** This plugin's catalogs, keyed by locale code. */\n\tlocales: PluginLocales;\n\t/** Fallback locale when a key is missing in the current locale. */\n\tdefaultLocale: string;\n}\n\n/**\n * Internal: the host wraps plugin-rendered components in this context's Provider,\n * carrying THIS plugin's catalogs. Module Federation shares this single SDK\n * instance, so the value the host provides is visible to {@link useTranslation}.\n */\nexport const __PluginI18nContext = createContext<PluginI18nContextValue>({\n\tlocales: {},\n\tdefaultLocale: \"zh\",\n});\n\nexport interface PluginTranslation {\n\t/** The host's current locale code (e.g. \"zh\"). */\n\tlocale: string;\n\t/** Resolve a bare catalog key at the current locale, with optional `{{params}}`. */\n\tt: PluginTranslate;\n}\n\n/**\n * Reactive translation for plugin React components — re-renders when the host\n * language changes. `t` resolves a BARE catalog key (no `%...%` wrapper) against\n * THIS plugin's catalogs; the host provides them via __PluginI18nContext.\n */\nexport function useTranslation(): PluginTranslation {\n\tconst locale = requireBridge().useLocale();\n\tconst { locales, defaultLocale } = useContext(__PluginI18nContext);\n\tconst t = useCallback<PluginTranslate>(\n\t\t(key, params) => resolveCatalogKey(key, locales, locale, defaultLocale, params),\n\t\t[locales, locale, defaultLocale],\n\t);\n\treturn { locale, t };\n}\n\n/** Reactive: the currently-active conversation's state. */\nexport function useActiveConversation(): ConversationState {\n\treturn requireBridge().useActiveConversation();\n}\n\n/** Reactive: the active conversation's messages. */\nexport function useConversationMessages(): ConversationMessage[] {\n\treturn requireBridge().useConversationMessages();\n}\n\n/**\n * Reactive: the plugin-owned one-shot context attached to the next prompt.\n * Clears automatically after send, capsule close, or session switch.\n */\nexport function usePromptAttachment(): PluginPromptAttachment | null {\n\treturn requireBridge().usePromptAttachment();\n}\n"]}
|
package/dist/hooks.js
CHANGED
|
@@ -30,12 +30,10 @@ export function useConversationMessages() {
|
|
|
30
30
|
return requireBridge().useConversationMessages();
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
-
* Reactive: the
|
|
34
|
-
*
|
|
35
|
-
* "selected for edit" highlight — clears automatically when the host drops the
|
|
36
|
-
* attachment (send, capsule close, or session switch).
|
|
33
|
+
* Reactive: the plugin-owned one-shot context attached to the next prompt.
|
|
34
|
+
* Clears automatically after send, capsule close, or session switch.
|
|
37
35
|
*/
|
|
38
|
-
export function
|
|
39
|
-
return requireBridge().
|
|
36
|
+
export function usePromptAttachment() {
|
|
37
|
+
return requireBridge().usePromptAttachment();
|
|
40
38
|
}
|
|
41
39
|
//# sourceMappingURL=hooks.js.map
|
package/dist/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAY9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAyB;IACxE,OAAO,EAAE,EAAE;IACX,aAAa,EAAE,IAAI;CACnB,CAAC,CAAC;AASH;;;;GAIG;AACH,MAAM,UAAU,cAAc,GAAsB;IACnD,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC,SAAS,EAAE,CAAC;IAC3C,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAC;IACnE,MAAM,CAAC,GAAG,WAAW,CACpB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,EAC/E,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC,CAChC,CAAC;IACF,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AAAA,CACrB;AAED,2DAA2D;AAC3D,MAAM,UAAU,qBAAqB,GAAsB;IAC1D,OAAO,aAAa,EAAE,CAAC,qBAAqB,EAAE,CAAC;AAAA,CAC/C;AAED,oDAAoD;AACpD,MAAM,UAAU,uBAAuB,GAA0B;IAChE,OAAO,aAAa,EAAE,CAAC,uBAAuB,EAAE,CAAC;AAAA,CACjD;AAED
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAY9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAyB;IACxE,OAAO,EAAE,EAAE;IACX,aAAa,EAAE,IAAI;CACnB,CAAC,CAAC;AASH;;;;GAIG;AACH,MAAM,UAAU,cAAc,GAAsB;IACnD,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC,SAAS,EAAE,CAAC;IAC3C,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAC;IACnE,MAAM,CAAC,GAAG,WAAW,CACpB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,EAC/E,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC,CAChC,CAAC;IACF,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AAAA,CACrB;AAED,2DAA2D;AAC3D,MAAM,UAAU,qBAAqB,GAAsB;IAC1D,OAAO,aAAa,EAAE,CAAC,qBAAqB,EAAE,CAAC;AAAA,CAC/C;AAED,oDAAoD;AACpD,MAAM,UAAU,uBAAuB,GAA0B;IAChE,OAAO,aAAa,EAAE,CAAC,uBAAuB,EAAE,CAAC;AAAA,CACjD;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,GAAkC;IACpE,OAAO,aAAa,EAAE,CAAC,mBAAmB,EAAE,CAAC;AAAA,CAC7C","sourcesContent":["import { createContext, useCallback, useContext } from \"react\";\nimport type { ConversationMessage, ConversationState } from \"./conversation.js\";\nimport { requireBridge } from \"./host-bridge.js\";\nimport type { PluginLocales, PluginTranslate } from \"./i18n.js\";\nimport { resolveCatalogKey } from \"./i18n.js\";\nimport type { PluginPromptAttachment } from \"./prompt-attachment.js\";\n\n// ─── i18n context (host-provided, per plugin) ───\n\nexport interface PluginI18nContextValue {\n\t/** This plugin's catalogs, keyed by locale code. */\n\tlocales: PluginLocales;\n\t/** Fallback locale when a key is missing in the current locale. */\n\tdefaultLocale: string;\n}\n\n/**\n * Internal: the host wraps plugin-rendered components in this context's Provider,\n * carrying THIS plugin's catalogs. Module Federation shares this single SDK\n * instance, so the value the host provides is visible to {@link useTranslation}.\n */\nexport const __PluginI18nContext = createContext<PluginI18nContextValue>({\n\tlocales: {},\n\tdefaultLocale: \"zh\",\n});\n\nexport interface PluginTranslation {\n\t/** The host's current locale code (e.g. \"zh\"). */\n\tlocale: string;\n\t/** Resolve a bare catalog key at the current locale, with optional `{{params}}`. */\n\tt: PluginTranslate;\n}\n\n/**\n * Reactive translation for plugin React components — re-renders when the host\n * language changes. `t` resolves a BARE catalog key (no `%...%` wrapper) against\n * THIS plugin's catalogs; the host provides them via __PluginI18nContext.\n */\nexport function useTranslation(): PluginTranslation {\n\tconst locale = requireBridge().useLocale();\n\tconst { locales, defaultLocale } = useContext(__PluginI18nContext);\n\tconst t = useCallback<PluginTranslate>(\n\t\t(key, params) => resolveCatalogKey(key, locales, locale, defaultLocale, params),\n\t\t[locales, locale, defaultLocale],\n\t);\n\treturn { locale, t };\n}\n\n/** Reactive: the currently-active conversation's state. */\nexport function useActiveConversation(): ConversationState {\n\treturn requireBridge().useActiveConversation();\n}\n\n/** Reactive: the active conversation's messages. */\nexport function useConversationMessages(): ConversationMessage[] {\n\treturn requireBridge().useConversationMessages();\n}\n\n/**\n * Reactive: the plugin-owned one-shot context attached to the next prompt.\n * Clears automatically after send, capsule close, or session switch.\n */\nexport function usePromptAttachment(): PluginPromptAttachment | null {\n\treturn requireBridge().usePromptAttachment();\n}\n"]}
|
package/dist/host-bridge.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ConversationMessage, ConversationState, PluginConversationApi } from "./conversation.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { PluginPromptAttachment } from "./prompt-attachment.js";
|
|
3
3
|
export interface PluginHostBridge {
|
|
4
4
|
useActiveConversation(): ConversationState;
|
|
5
5
|
useConversationMessages(): ConversationMessage[];
|
|
6
|
-
|
|
6
|
+
usePromptAttachment(): PluginPromptAttachment | null;
|
|
7
7
|
/** Reactive: the host's current locale code (e.g. "zh"). */
|
|
8
8
|
useLocale(): string;
|
|
9
9
|
conversation: PluginConversationApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-bridge.d.ts","sourceRoot":"","sources":["../src/host-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AACvG,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"host-bridge.d.ts","sourceRoot":"","sources":["../src/host-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AACvG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAUrE,MAAM,WAAW,gBAAgB;IAChC,qBAAqB,IAAI,iBAAiB,CAAC;IAC3C,uBAAuB,IAAI,mBAAmB,EAAE,CAAC;IACjD,mBAAmB,IAAI,sBAAsB,GAAG,IAAI,CAAC;IACrD,4DAA4D;IAC5D,SAAS,IAAI,MAAM,CAAC;IACpB,YAAY,EAAE,qBAAqB,CAAC;CACpC;AAID,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAEpE;AAED,6EAA6E;AAC7E,wBAAgB,aAAa,IAAI,gBAAgB,CAKhD","sourcesContent":["import type { ConversationMessage, ConversationState, PluginConversationApi } from \"./conversation.js\";\nimport type { PluginPromptAttachment } from \"./prompt-attachment.js\";\n\n// ─── Host bridge ───\n//\n// React hooks and conversation state read the host's jotai store. plugin-sdk\n// cannot depend on desktop-app, so the host injects its implementation at\n// startup (installPluginHostShim → __setPluginHostBridge). Module Federation\n// makes host and plugins share this single pluginSdk instance, so the bridge\n// the host sets is visible to the hooks the plugin calls.\n\nexport interface PluginHostBridge {\n\tuseActiveConversation(): ConversationState;\n\tuseConversationMessages(): ConversationMessage[];\n\tusePromptAttachment(): PluginPromptAttachment | null;\n\t/** Reactive: the host's current locale code (e.g. \"zh\"). */\n\tuseLocale(): string;\n\tconversation: PluginConversationApi;\n}\n\nlet hostBridge: PluginHostBridge | undefined;\n\nexport function __setPluginHostBridge(bridge: PluginHostBridge): void {\n\thostBridge = bridge;\n}\n\n/** Package-internal: throws if the host has not installed the bridge yet. */\nexport function requireBridge(): PluginHostBridge {\n\tif (!hostBridge) {\n\t\tthrow new Error(\"Vetta plugin host bridge is not installed\");\n\t}\n\treturn hostBridge;\n}\n"]}
|
package/dist/host-bridge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-bridge.js","sourceRoot":"","sources":["../src/host-bridge.ts"],"names":[],"mappings":"AAoBA,IAAI,UAAwC,CAAC;AAE7C,MAAM,UAAU,qBAAqB,CAAC,MAAwB,EAAQ;IACrE,UAAU,GAAG,MAAM,CAAC;AAAA,CACpB;AAED,6EAA6E;AAC7E,MAAM,UAAU,aAAa,GAAqB;IACjD,IAAI,CAAC,UAAU,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,UAAU,CAAC;AAAA,CAClB","sourcesContent":["import type { ConversationMessage, ConversationState, PluginConversationApi } from \"./conversation.js\";\nimport type {
|
|
1
|
+
{"version":3,"file":"host-bridge.js","sourceRoot":"","sources":["../src/host-bridge.ts"],"names":[],"mappings":"AAoBA,IAAI,UAAwC,CAAC;AAE7C,MAAM,UAAU,qBAAqB,CAAC,MAAwB,EAAQ;IACrE,UAAU,GAAG,MAAM,CAAC;AAAA,CACpB;AAED,6EAA6E;AAC7E,MAAM,UAAU,aAAa,GAAqB;IACjD,IAAI,CAAC,UAAU,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,UAAU,CAAC;AAAA,CAClB","sourcesContent":["import type { ConversationMessage, ConversationState, PluginConversationApi } from \"./conversation.js\";\nimport type { PluginPromptAttachment } from \"./prompt-attachment.js\";\n\n// ─── Host bridge ───\n//\n// React hooks and conversation state read the host's jotai store. plugin-sdk\n// cannot depend on desktop-app, so the host injects its implementation at\n// startup (installPluginHostShim → __setPluginHostBridge). Module Federation\n// makes host and plugins share this single pluginSdk instance, so the bridge\n// the host sets is visible to the hooks the plugin calls.\n\nexport interface PluginHostBridge {\n\tuseActiveConversation(): ConversationState;\n\tuseConversationMessages(): ConversationMessage[];\n\tusePromptAttachment(): PluginPromptAttachment | null;\n\t/** Reactive: the host's current locale code (e.g. \"zh\"). */\n\tuseLocale(): string;\n\tconversation: PluginConversationApi;\n}\n\nlet hostBridge: PluginHostBridge | undefined;\n\nexport function __setPluginHostBridge(bridge: PluginHostBridge): void {\n\thostBridge = bridge;\n}\n\n/** Package-internal: throws if the host has not installed the bridge yet. */\nexport function requireBridge(): PluginHostBridge {\n\tif (!hostBridge) {\n\t\tthrow new Error(\"Vetta plugin host bridge is not installed\");\n\t}\n\treturn hostBridge;\n}\n"]}
|
package/dist/images.d.ts
CHANGED
|
@@ -14,45 +14,4 @@ export interface PluginImageRef {
|
|
|
14
14
|
*/
|
|
15
15
|
rootId?: string;
|
|
16
16
|
}
|
|
17
|
-
export interface PluginGenerateImageInput {
|
|
18
|
-
prompt: string;
|
|
19
|
-
/** Output size (e.g. "1024x1024"), decided by the agent and forwarded to the model. */
|
|
20
|
-
size?: string;
|
|
21
|
-
/** Optional reference id for grouping (e.g. the conversation/session). */
|
|
22
|
-
sessionId?: string;
|
|
23
|
-
}
|
|
24
|
-
export interface PluginEditImageInput {
|
|
25
|
-
prompt: string;
|
|
26
|
-
/**
|
|
27
|
-
* Source image to edit. Either an existing host image id (continue a
|
|
28
|
-
* lineage) or raw base64 bytes (e.g. a user upload).
|
|
29
|
-
*/
|
|
30
|
-
source: {
|
|
31
|
-
imageId: string;
|
|
32
|
-
} | {
|
|
33
|
-
data: string;
|
|
34
|
-
mimeType: string;
|
|
35
|
-
};
|
|
36
|
-
sessionId?: string;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Image generation, routed to the host's main-process image service (single
|
|
40
|
-
* implementation shared with the agent's built-in image tool). Bytes are
|
|
41
|
-
* stored out-of-band; results are returned as host media references.
|
|
42
|
-
*/
|
|
43
|
-
export interface PluginImagesApi {
|
|
44
|
-
/** Text-to-image. Resolves to the produced image reference(s). */
|
|
45
|
-
generate(input: PluginGenerateImageInput): Promise<PluginImageRef[]>;
|
|
46
|
-
/** Image-to-image edit, producing the next version in a lineage. */
|
|
47
|
-
edit(input: PluginEditImageInput): Promise<PluginImageRef[]>;
|
|
48
|
-
/** The edit lineage (base image + its edits, oldest first) for an image. */
|
|
49
|
-
lineage(imageId: string): Promise<PluginImageRef[]>;
|
|
50
|
-
/**
|
|
51
|
-
* Every edit lineage the given session touched (generated or edited a version
|
|
52
|
-
* in), newest lineage first; each lineage's versions oldest → newest. The
|
|
53
|
-
* sessionId is the agent session id — derive it from the active conversation's
|
|
54
|
-
* `sessionPath` (the UUID embedded in the session file name).
|
|
55
|
-
*/
|
|
56
|
-
sessionLineages(sessionId: string): Promise<PluginImageRef[][]>;
|
|
57
|
-
}
|
|
58
17
|
//# sourceMappingURL=images.d.ts.map
|
package/dist/images.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../src/images.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB
|
|
1
|
+
{"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../src/images.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB","sourcesContent":["/**\n * A reference to an image produced out-of-band by the host (e.g. an image\n * tool's result). The bytes are NOT carried inline — `url` is a host media\n * URL (Range-capable, usable directly as an `<img src>`).\n */\nexport interface PluginImageRef {\n\tid: string;\n\turl: string;\n\tmimeType?: string;\n\t/**\n\t * The edit-lineage root id this image belongs to (base image + all its edits\n\t * share one rootId). Lets the host dedup per-message previews — only the\n\t * latest message producing a given rootId renders the version swiper.\n\t */\n\trootId?: string;\n}\n"]}
|
package/dist/images.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"images.js","sourceRoot":"","sources":["../src/images.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * A reference to an image produced out-of-band by the host (e.g. an image\n * tool's result). The bytes are NOT carried inline — `url` is a host media\n * URL (Range-capable, usable directly as an `<img src>`).\n */\nexport interface PluginImageRef {\n\tid: string;\n\turl: string;\n\tmimeType?: string;\n\t/**\n\t * The edit-lineage root id this image belongs to (base image + all its edits\n\t * share one rootId). Lets the host dedup per-message previews — only the\n\t * latest message producing a given rootId renders the version swiper.\n\t */\n\trootId?: string;\n}\n
|
|
1
|
+
{"version":3,"file":"images.js","sourceRoot":"","sources":["../src/images.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * A reference to an image produced out-of-band by the host (e.g. an image\n * tool's result). The bytes are NOT carried inline — `url` is a host media\n * URL (Range-capable, usable directly as an `<img src>`).\n */\nexport interface PluginImageRef {\n\tid: string;\n\turl: string;\n\tmimeType?: string;\n\t/**\n\t * The edit-lineage root id this image belongs to (base image + all its edits\n\t * share one rootId). Lets the host dedup per-message previews — only the\n\t * latest message producing a given rootId renders the version swiper.\n\t */\n\trootId?: string;\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,14 +10,17 @@ export type { PluginPermission } from "./permissions.js";
|
|
|
10
10
|
export type { Disposable } from "./disposable.js";
|
|
11
11
|
export type { PluginMcpServerConfig, PluginAgentManifest } from "./manifest.js";
|
|
12
12
|
export type { ConversationState, ConversationMessage, ConversationEvent, PluginConversationApi, } from "./conversation.js";
|
|
13
|
-
export type { PluginGlobalSlotContribution, PluginAudioMetadata, PluginPreviewUrlOptions, PluginPreviewFile, PluginFilePreviewProps, PluginFilePreviewContribution, PluginActivityTabContribution, PluginOpenActivityTabOptions, PluginPromptDecoration, PluginInputActionContribution, CardDescriptor, PluginPendingToolCall, PluginCardProps, PluginCardRendererContribution, PluginToolCallSlotToolCall, PluginToolCallSlotProps, PluginToolCallSlotContribution, PluginTurnCardContribution, PluginNotifyOptions, PluginUiApi, } from "./ui.js";
|
|
13
|
+
export type { PluginGlobalSlotContribution, PluginAudioMetadata, PluginPreviewUrlOptions, PluginPreviewFile, PluginFilePreviewProps, PluginFilePreviewContribution, PluginActivityTabContribution, PluginCaptureRegion, PluginOpenActivityTabOptions, PluginPromptDecoration, PluginInputActionContribution, CardDescriptor, PluginPendingToolCall, PluginCardProps, PluginCardRendererContribution, PluginToolCallSlotToolCall, PluginToolCallSlotProps, PluginToolCallSlotContribution, PluginTurnCardContribution, PluginNotifyOptions, PluginUiApi, } from "./ui.js";
|
|
14
14
|
export type { PluginJsonSchema, PluginAgentToolApi, PluginAgentToolRegistration, PluginSystemPromptBlock, PluginDynamicSystemPromptOperation, PluginSystemPromptMessage, PluginSystemPromptProviderContext, PluginSystemPromptBlockView, PluginAgentActions, PluginAgentHandlerContext, PluginAgentToolHandler, PluginSystemPromptProviderHandler, PluginSystemPromptProviderRegistration, PluginContinuationResult, PluginContinuationHandler, PluginContinuationRegistration, PluginAgentApi, } from "./agent.js";
|
|
15
15
|
export type { PluginAppActionEffect, PluginAppActionExample, PluginAppActionHandlerContext, PluginAppActionHandler, PluginAppActionReadyHandler, PluginAppActionApprovalPresentation, PluginAppActionApproval, PluginAppActionRegistration, PluginAppActionsApi, } from "./app-actions.js";
|
|
16
16
|
export { PluginAppActionError } from "./app-actions.js";
|
|
17
17
|
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, PluginOfficialPluginSummary, PluginOfficialKnowledgeBase, PluginOfficialKnowledgeProcessingSettings, PluginOfficialApi, } from "./official.js";
|
|
18
|
-
export type { PluginFsEntry, PluginFsFileRef, PluginFsStatResult, PluginFsReadResult, PluginFsApi, } from "./fs.js";
|
|
18
|
+
export type { PluginFsEntry, PluginFsFileRef, PluginFsBinaryReadResult, PluginFsStatResult, PluginFsReadResult, PluginFsApi, } from "./fs.js";
|
|
19
19
|
export type { PluginCommandRunOptions, PluginCommandRunResult, PluginCommandApi, } from "./command.js";
|
|
20
|
-
export type { PluginImageRef
|
|
20
|
+
export type { PluginImageRef } from "./images.js";
|
|
21
|
+
export type { PluginPromptAttachment } from "./prompt-attachment.js";
|
|
22
|
+
export type { PluginNetworkApi, PluginNetworkBody, PluginNetworkRequest, PluginNetworkResponse, } from "./network.js";
|
|
23
|
+
export type { PluginPutBlobInput, PluginStorageApi, PluginStoredBlob, PluginStoredBlobRef, } from "./storage.js";
|
|
21
24
|
export type { PluginSettingsApi } from "./settings.js";
|
|
22
25
|
export type { PluginLocaleCatalog, PluginLocales, PluginTranslate, PluginI18nApi, } from "./i18n.js";
|
|
23
26
|
export { interpolatePluginText, resolveCatalogKey, resolvePluginText } from "./i18n.js";
|
|
@@ -28,5 +31,5 @@ export { __setPluginHostBridge } from "./host-bridge.js";
|
|
|
28
31
|
export type { ActivityTabContextValue } from "./activity-tab.js";
|
|
29
32
|
export { __ActivityTabContext, useActivityTab } from "./activity-tab.js";
|
|
30
33
|
export type { PluginI18nContextValue, PluginTranslation } from "./hooks.js";
|
|
31
|
-
export { __PluginI18nContext, useTranslation, useActiveConversation, useConversationMessages,
|
|
34
|
+
export { __PluginI18nContext, useTranslation, useActiveConversation, useConversationMessages, usePromptAttachment, } from "./hooks.js";
|
|
32
35
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1D,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGhF,YAAY,EACX,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,GACrB,MAAM,mBAAmB,CAAC;AAG3B,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E,MAAM,wBAAwB,CAAC;AACrE,YAAY,EACX,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,GACrB,MAAM,cAAc,CAAC;AACtB,YAAY,EACX,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,GACnB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGvD,YAAY,EACX,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,aAAa,GACb,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAGxF,YAAY,EAAE,mBAAmB,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,YAAY,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGzE,YAAY,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EACN,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,GACnB,MAAM,YAAY,CAAC","sourcesContent":["/**\n * @vetta-org/plugin-sdk public surface.\n *\n * Implementation is split by domain under `src/*.ts`; this barrel re-exports\n * the stable package API. Prefer importing from `@vetta-org/plugin-sdk` rather\n * than deep paths.\n */\n\n// Core primitives\nexport type { ConversationScenario } from \"./scenario.js\";\nexport type { PluginPermission } from \"./permissions.js\";\nexport type { Disposable } from \"./disposable.js\";\nexport type { PluginMcpServerConfig, PluginAgentManifest } from \"./manifest.js\";\n\n// Conversation\nexport type {\n\tConversationState,\n\tConversationMessage,\n\tConversationEvent,\n\tPluginConversationApi,\n} from \"./conversation.js\";\n\n// UI slots\nexport type {\n\tPluginGlobalSlotContribution,\n\tPluginAudioMetadata,\n\tPluginPreviewUrlOptions,\n\tPluginPreviewFile,\n\tPluginFilePreviewProps,\n\tPluginFilePreviewContribution,\n\tPluginActivityTabContribution,\n\tPluginCaptureRegion,\n\tPluginOpenActivityTabOptions,\n\tPluginPromptDecoration,\n\tPluginInputActionContribution,\n\tCardDescriptor,\n\tPluginPendingToolCall,\n\tPluginCardProps,\n\tPluginCardRendererContribution,\n\tPluginToolCallSlotToolCall,\n\tPluginToolCallSlotProps,\n\tPluginToolCallSlotContribution,\n\tPluginTurnCardContribution,\n\tPluginNotifyOptions,\n\tPluginUiApi,\n} from \"./ui.js\";\n\n// Agent runtime\nexport type {\n\tPluginJsonSchema,\n\tPluginAgentToolApi,\n\tPluginAgentToolRegistration,\n\tPluginSystemPromptBlock,\n\tPluginDynamicSystemPromptOperation,\n\tPluginSystemPromptMessage,\n\tPluginSystemPromptProviderContext,\n\tPluginSystemPromptBlockView,\n\tPluginAgentActions,\n\tPluginAgentHandlerContext,\n\tPluginAgentToolHandler,\n\tPluginSystemPromptProviderHandler,\n\tPluginSystemPromptProviderRegistration,\n\tPluginContinuationResult,\n\tPluginContinuationHandler,\n\tPluginContinuationRegistration,\n\tPluginAgentApi,\n} from \"./agent.js\";\n\n// App actions\nexport type {\n\tPluginAppActionEffect,\n\tPluginAppActionExample,\n\tPluginAppActionHandlerContext,\n\tPluginAppActionHandler,\n\tPluginAppActionReadyHandler,\n\tPluginAppActionApprovalPresentation,\n\tPluginAppActionApproval,\n\tPluginAppActionRegistration,\n\tPluginAppActionsApi,\n} from \"./app-actions.js\";\nexport { PluginAppActionError } from \"./app-actions.js\";\n\n// Official host capabilities\nexport type {\n\tPluginOfficialGeneralSettings,\n\tPluginOfficialGeneralSettingsUpdate,\n\tPluginOfficialExperimentalSettings,\n\tPluginOfficialDownloadItem,\n\tPluginOfficialUpdaterState,\n\tPluginOfficialWebhookKind,\n\tPluginOfficialWebhookEndpoint,\n\tPluginOfficialWebhookProvider,\n\tPluginOfficialWebhookCreateInput,\n\tPluginOfficialWebhookUpdateInput,\n\tPluginOfficialWebhookMessage,\n\tPluginOfficialWebhookSendResult,\n\tPluginOfficialSkillInfo,\n\tPluginOfficialInstalledSkill,\n\tPluginOfficialShortcutBinding,\n\tPluginOfficialQuickPanelSettings,\n\tPluginOfficialImStatus,\n\tPluginOfficialImLog,\n\tPluginOfficialMcpServerSummary,\n\tPluginOfficialMcpServerDetail,\n\tPluginOfficialMcpUpsertData,\n\tPluginOfficialExecutionMode,\n\tPluginOfficialSelectedSkill,\n\tPluginOfficialBatchProjectCreateData,\n\tPluginOfficialBatchProjectUpdateData,\n\tPluginOfficialSchedulerTaskCreateData,\n\tPluginOfficialSchedulerTaskUpdateData,\n\tPluginOfficialModelSummary,\n\tPluginOfficialProviderSummary,\n\tPluginOfficialProviderDetail,\n\tPluginOfficialProviderUpsertData,\n\tPluginOfficialProjectEntry,\n\tPluginOfficialPluginSummary,\n\tPluginOfficialKnowledgeBase,\n\tPluginOfficialKnowledgeProcessingSettings,\n\tPluginOfficialApi,\n} from \"./official.js\";\n\n// Files / command / images / settings\nexport type {\n\tPluginFsEntry,\n\tPluginFsFileRef,\n\tPluginFsBinaryReadResult,\n\tPluginFsStatResult,\n\tPluginFsReadResult,\n\tPluginFsApi,\n} from \"./fs.js\";\nexport type {\n\tPluginCommandRunOptions,\n\tPluginCommandRunResult,\n\tPluginCommandApi,\n} from \"./command.js\";\nexport type { PluginImageRef } from \"./images.js\";\nexport type { PluginPromptAttachment } from \"./prompt-attachment.js\";\nexport type {\n\tPluginNetworkApi,\n\tPluginNetworkBody,\n\tPluginNetworkRequest,\n\tPluginNetworkResponse,\n} from \"./network.js\";\nexport type {\n\tPluginPutBlobInput,\n\tPluginStorageApi,\n\tPluginStoredBlob,\n\tPluginStoredBlobRef,\n} from \"./storage.js\";\nexport type { PluginSettingsApi } from \"./settings.js\";\n\n// i18n\nexport type {\n\tPluginLocaleCatalog,\n\tPluginLocales,\n\tPluginTranslate,\n\tPluginI18nApi,\n} from \"./i18n.js\";\nexport { interpolatePluginText, resolveCatalogKey, resolvePluginText } from \"./i18n.js\";\n\n// Context & lifecycle\nexport type { PluginPermissionApi, AgentMode, PluginContext, PluginDefinition } from \"./context.js\";\nexport { definePlugin } from \"./context.js\";\n\n// Host bridge (host-injected; plugins use hooks)\nexport type { PluginHostBridge } from \"./host-bridge.js\";\nexport { __setPluginHostBridge } from \"./host-bridge.js\";\n\n// Activity tab context\nexport type { ActivityTabContextValue } from \"./activity-tab.js\";\nexport { __ActivityTabContext, useActivityTab } from \"./activity-tab.js\";\n\n// React hooks\nexport type { PluginI18nContextValue, PluginTranslation } from \"./hooks.js\";\nexport {\n\t__PluginI18nContext,\n\tuseTranslation,\n\tuseActiveConversation,\n\tuseConversationMessages,\n\tusePromptAttachment,\n} from \"./hooks.js\";\n"]}
|
package/dist/index.js
CHANGED
|
@@ -10,5 +10,5 @@ export { interpolatePluginText, resolveCatalogKey, resolvePluginText } from "./i
|
|
|
10
10
|
export { definePlugin } from "./context.js";
|
|
11
11
|
export { __setPluginHostBridge } from "./host-bridge.js";
|
|
12
12
|
export { __ActivityTabContext, useActivityTab } from "./activity-tab.js";
|
|
13
|
-
export { __PluginI18nContext, useTranslation, useActiveConversation, useConversationMessages,
|
|
13
|
+
export { __PluginI18nContext, useTranslation, useActiveConversation, useConversationMessages, usePromptAttachment, } from "./hooks.js";
|
|
14
14
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA0EH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AA+ExD,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAIxF,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAI5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAIzD,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAIzE,OAAO,EACN,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,GACnB,MAAM,YAAY,CAAC","sourcesContent":["/**\n * @vetta-org/plugin-sdk public surface.\n *\n * Implementation is split by domain under `src/*.ts`; this barrel re-exports\n * the stable package API. Prefer importing from `@vetta-org/plugin-sdk` rather\n * than deep paths.\n */\n\n// Core primitives\nexport type { ConversationScenario } from \"./scenario.js\";\nexport type { PluginPermission } from \"./permissions.js\";\nexport type { Disposable } from \"./disposable.js\";\nexport type { PluginMcpServerConfig, PluginAgentManifest } from \"./manifest.js\";\n\n// Conversation\nexport type {\n\tConversationState,\n\tConversationMessage,\n\tConversationEvent,\n\tPluginConversationApi,\n} from \"./conversation.js\";\n\n// UI slots\nexport type {\n\tPluginGlobalSlotContribution,\n\tPluginAudioMetadata,\n\tPluginPreviewUrlOptions,\n\tPluginPreviewFile,\n\tPluginFilePreviewProps,\n\tPluginFilePreviewContribution,\n\tPluginActivityTabContribution,\n\tPluginCaptureRegion,\n\tPluginOpenActivityTabOptions,\n\tPluginPromptDecoration,\n\tPluginInputActionContribution,\n\tCardDescriptor,\n\tPluginPendingToolCall,\n\tPluginCardProps,\n\tPluginCardRendererContribution,\n\tPluginToolCallSlotToolCall,\n\tPluginToolCallSlotProps,\n\tPluginToolCallSlotContribution,\n\tPluginTurnCardContribution,\n\tPluginNotifyOptions,\n\tPluginUiApi,\n} from \"./ui.js\";\n\n// Agent runtime\nexport type {\n\tPluginJsonSchema,\n\tPluginAgentToolApi,\n\tPluginAgentToolRegistration,\n\tPluginSystemPromptBlock,\n\tPluginDynamicSystemPromptOperation,\n\tPluginSystemPromptMessage,\n\tPluginSystemPromptProviderContext,\n\tPluginSystemPromptBlockView,\n\tPluginAgentActions,\n\tPluginAgentHandlerContext,\n\tPluginAgentToolHandler,\n\tPluginSystemPromptProviderHandler,\n\tPluginSystemPromptProviderRegistration,\n\tPluginContinuationResult,\n\tPluginContinuationHandler,\n\tPluginContinuationRegistration,\n\tPluginAgentApi,\n} from \"./agent.js\";\n\n// App actions\nexport type {\n\tPluginAppActionEffect,\n\tPluginAppActionExample,\n\tPluginAppActionHandlerContext,\n\tPluginAppActionHandler,\n\tPluginAppActionReadyHandler,\n\tPluginAppActionApprovalPresentation,\n\tPluginAppActionApproval,\n\tPluginAppActionRegistration,\n\tPluginAppActionsApi,\n} from \"./app-actions.js\";\nexport { PluginAppActionError } from \"./app-actions.js\";\n\n// Official host capabilities\nexport type {\n\tPluginOfficialGeneralSettings,\n\tPluginOfficialGeneralSettingsUpdate,\n\tPluginOfficialExperimentalSettings,\n\tPluginOfficialDownloadItem,\n\tPluginOfficialUpdaterState,\n\tPluginOfficialWebhookKind,\n\tPluginOfficialWebhookEndpoint,\n\tPluginOfficialWebhookProvider,\n\tPluginOfficialWebhookCreateInput,\n\tPluginOfficialWebhookUpdateInput,\n\tPluginOfficialWebhookMessage,\n\tPluginOfficialWebhookSendResult,\n\tPluginOfficialSkillInfo,\n\tPluginOfficialInstalledSkill,\n\tPluginOfficialShortcutBinding,\n\tPluginOfficialQuickPanelSettings,\n\tPluginOfficialImStatus,\n\tPluginOfficialImLog,\n\tPluginOfficialMcpServerSummary,\n\tPluginOfficialMcpServerDetail,\n\tPluginOfficialMcpUpsertData,\n\tPluginOfficialExecutionMode,\n\tPluginOfficialSelectedSkill,\n\tPluginOfficialBatchProjectCreateData,\n\tPluginOfficialBatchProjectUpdateData,\n\tPluginOfficialSchedulerTaskCreateData,\n\tPluginOfficialSchedulerTaskUpdateData,\n\tPluginOfficialModelSummary,\n\tPluginOfficialProviderSummary,\n\tPluginOfficialProviderDetail,\n\tPluginOfficialProviderUpsertData,\n\tPluginOfficialProjectEntry,\n\tPluginOfficialPluginSummary,\n\tPluginOfficialKnowledgeBase,\n\tPluginOfficialKnowledgeProcessingSettings,\n\tPluginOfficialApi,\n} from \"./official.js\";\n\n// Files / command / images / settings\nexport type {\n\tPluginFsEntry,\n\tPluginFsFileRef,\n\tPluginFsBinaryReadResult,\n\tPluginFsStatResult,\n\tPluginFsReadResult,\n\tPluginFsApi,\n} from \"./fs.js\";\nexport type {\n\tPluginCommandRunOptions,\n\tPluginCommandRunResult,\n\tPluginCommandApi,\n} from \"./command.js\";\nexport type { PluginImageRef } from \"./images.js\";\nexport type { PluginPromptAttachment } from \"./prompt-attachment.js\";\nexport type {\n\tPluginNetworkApi,\n\tPluginNetworkBody,\n\tPluginNetworkRequest,\n\tPluginNetworkResponse,\n} from \"./network.js\";\nexport type {\n\tPluginPutBlobInput,\n\tPluginStorageApi,\n\tPluginStoredBlob,\n\tPluginStoredBlobRef,\n} from \"./storage.js\";\nexport type { PluginSettingsApi } from \"./settings.js\";\n\n// i18n\nexport type {\n\tPluginLocaleCatalog,\n\tPluginLocales,\n\tPluginTranslate,\n\tPluginI18nApi,\n} from \"./i18n.js\";\nexport { interpolatePluginText, resolveCatalogKey, resolvePluginText } from \"./i18n.js\";\n\n// Context & lifecycle\nexport type { PluginPermissionApi, AgentMode, PluginContext, PluginDefinition } from \"./context.js\";\nexport { definePlugin } from \"./context.js\";\n\n// Host bridge (host-injected; plugins use hooks)\nexport type { PluginHostBridge } from \"./host-bridge.js\";\nexport { __setPluginHostBridge } from \"./host-bridge.js\";\n\n// Activity tab context\nexport type { ActivityTabContextValue } from \"./activity-tab.js\";\nexport { __ActivityTabContext, useActivityTab } from \"./activity-tab.js\";\n\n// React hooks\nexport type { PluginI18nContextValue, PluginTranslation } from \"./hooks.js\";\nexport {\n\t__PluginI18nContext,\n\tuseTranslation,\n\tuseActiveConversation,\n\tuseConversationMessages,\n\tusePromptAttachment,\n} from \"./hooks.js\";\n"]}
|