@vetta-org/plugin-sdk 0.0.2 → 0.0.4
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/activity-tab.d.ts +18 -0
- package/dist/activity-tab.d.ts.map +1 -0
- package/dist/activity-tab.js +12 -0
- package/dist/activity-tab.js.map +1 -0
- package/dist/agent.d.ts +206 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +2 -0
- package/dist/agent.js.map +1 -0
- package/dist/app-actions.d.ts +63 -0
- package/dist/app-actions.d.ts.map +1 -0
- package/dist/app-actions.js +12 -0
- package/dist/app-actions.js.map +1 -0
- package/dist/command.d.ts +25 -0
- package/dist/command.d.ts.map +1 -0
- package/dist/command.js +2 -0
- package/dist/command.js.map +1 -0
- package/dist/context.d.ts +45 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +4 -0
- package/dist/context.js.map +1 -0
- package/dist/conversation.d.ts +50 -0
- package/dist/conversation.d.ts.map +1 -0
- package/dist/conversation.js +2 -0
- package/dist/conversation.js.map +1 -0
- package/dist/disposable.d.ts +4 -0
- package/dist/disposable.d.ts.map +1 -0
- package/dist/disposable.js +2 -0
- package/dist/disposable.js.map +1 -0
- package/dist/fs.d.ts +34 -0
- package/dist/fs.d.ts.map +1 -0
- package/dist/fs.js +2 -0
- package/dist/fs.js.map +1 -0
- package/dist/hooks.d.ts +39 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +41 -0
- package/dist/hooks.js.map +1 -0
- package/dist/host-bridge.d.ts +14 -0
- package/dist/host-bridge.d.ts.map +1 -0
- package/dist/host-bridge.js +12 -0
- package/dist/host-bridge.js.map +1 -0
- package/dist/i18n.d.ts +35 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +29 -0
- package/dist/i18n.js.map +1 -0
- package/dist/images.d.ts +58 -0
- package/dist/images.d.ts.map +1 -0
- package/dist/images.js +2 -0
- package/dist/images.js.map +1 -0
- package/dist/index.d.ts +29 -885
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -88
- package/dist/index.js.map +1 -1
- package/dist/manifest.d.ts +57 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +2 -0
- package/dist/manifest.js.map +1 -0
- package/dist/official.d.ts +520 -0
- package/dist/official.d.ts.map +1 -0
- package/dist/official.js +2 -0
- package/dist/official.js.map +1 -0
- package/dist/permissions.d.ts +2 -0
- package/dist/permissions.d.ts.map +1 -0
- package/dist/permissions.js +2 -0
- package/dist/permissions.js.map +1 -0
- package/dist/scenario.d.ts +9 -0
- package/dist/scenario.d.ts.map +1 -0
- package/dist/scenario.js +2 -0
- package/dist/scenario.js.map +1 -0
- package/dist/settings.d.ts +13 -0
- package/dist/settings.d.ts.map +1 -0
- package/dist/settings.js +2 -0
- package/dist/settings.js.map +1 -0
- package/dist/ui.d.ts +338 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +2 -0
- package/dist/ui.js.map +1 -0
- package/package.json +1 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGtD;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAC7B,SAAS,GACT,cAAc,GACd,SAAS,GACT,OAAO,GACP,YAAY,GACZ,eAAe,GACf,KAAK,CAAC;AAET,MAAM,MAAM,gBAAgB,GACzB,gBAAgB,GAChB,sBAAsB,GACtB,sBAAsB,GACtB,sBAAsB,GACtB,iBAAiB,GACjB,mBAAmB,GACnB,mBAAmB,GACnB,oBAAoB,GACpB,qBAAqB,GACrB,mBAAmB,GACnB,yBAAyB,GACzB,0BAA0B,GAC1B,gCAAgC,GAChC,sBAAsB,GACtB,mBAAmB,GACnB,qBAAqB,GACrB,sBAAsB,GACtB,2B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B;IACvC;;;;;OAKG;IACH,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACnB;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,kDAAwD,CAAC;AAE1F,yEAAyE;AACzE,wBAAgB,cAAc,IAAI,uBAAuB,CAExD;AAID,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;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,cAAc,GAAG,IAAI,CAE9D","sourcesContent":["import type { ComponentType, ReactNode } from \"react\";\nimport { createContext, useCallback, useContext } from \"react\";\n\n/**\n * 对话场景 slug——决定一个工具 / 会话页插槽在哪些类型的会话里激活或可见。\n *\n * 本类型在 plugin-sdk 内本地定义(SDK 零依赖,不引入宿主包),与宿主\n * `@vetta/coding-agent` 的 `ConversationScenario` 保持一一对应;任一侧增删场景时两边须同步,\n * 否则宿主回传的 scenario 与此 union 不一致会触发编译错误(即为期望的漂移护栏)。\n */\nexport type ConversationScenario =\n\t| \"im-claw\" // Claw IM 对话\n\t| \"conversation\" // 普通对话\n\t| \"project\" // 普通项目中对话\n\t| \"batch\" // 批量任务对话\n\t| \"automation\" // 自动化任务对话\n\t| \"kb-processing\" // 知识库加工对话\n\t| \"cli\"; // 裸 CLI / SDK 消费者\n\nexport type PluginPermission =\n\t| \"ui.slot.global\"\n\t| \"ui.slot.file-preview\"\n\t| \"ui.slot.activity-tab\"\n\t| \"ui.slot.input-action\"\n\t| \"ui.slot.message\"\n\t| \"ui.slot.tool-call\"\n\t| \"ui.slot.turn-card\"\n\t| \"agent.session.read\"\n\t| \"agent.session.write\"\n\t| \"agent.command.run\"\n\t| \"agent.systemPrompt.read\"\n\t| \"agent.systemPrompt.write\"\n\t| \"agent.systemPrompt.fullControl\"\n\t| \"agent.skills.control\"\n\t| \"agent.mcp.control\"\n\t| \"agent.tools.control\"\n\t| \"agent.tools.register\"\n\t| \"agent.toolHandler.execute\"\n\t| \"agent.state.read\"\n\t| \"agent.state.write\"\n\t| \"agent.continuation.register\"\n\t| \"agent.runtime.configure\"\n\t| \"fs.read\"\n\t| \"fs.write\"\n\t| \"network.fetch\"\n\t| \"images.generate\"\n\t| \"settings.read\"\n\t| \"settings.write\";\n\n/**\n * MCP server config declared inside a plugin (stdio or http). Relative paths in\n * stdio `command`/`args`/`cwd` are resolved against the plugin root at contribute time.\n */\nexport type PluginMcpServerConfig =\n\t| {\n\t\t\ttype?: \"stdio\";\n\t\t\tcommand: string;\n\t\t\targs?: string[];\n\t\t\tenv?: Record<string, string>;\n\t\t\tcwd?: string;\n\t\t\tdisabled?: boolean;\n\t\t\tautoApprove?: string[];\n\t\t\tstartupTimeout?: number;\n\t\t\tdebug?: boolean;\n\t\t\tdisplayName?: string;\n\t\t\tdescription?: string;\n\t }\n\t| {\n\t\t\ttype: \"http\";\n\t\t\turl: string;\n\t\t\theaders?: Record<string, string>;\n\t\t\toauthClientId?: string;\n\t\t\toauthDeviceFlow?: boolean;\n\t\t\toauthScopes?: string;\n\t\t\tdisabled?: boolean;\n\t\t\tautoApprove?: string[];\n\t\t\tstartupTimeout?: number;\n\t\t\tdebug?: boolean;\n\t\t\tdisplayName?: string;\n\t\t\tdescription?: string;\n\t };\n\nexport interface PluginAgentManifest {\n\tsystemPrompt?: {\n\t\t/**\n\t\t * Plugin-packaged prompt contribution file paths. Main-process aggregation\n\t\t * resolves these relative to the installed plugin root.\n\t\t */\n\t\tpromptPaths?: string[];\n\t};\n\t/** Plugin-packaged skill files or directories to add to the agent resource graph. */\n\tskillPaths?: string[];\n\t/**\n\t * Plugin-scoped MCP servers. Either a relative path to `.mcp.json`\n\t * (shape `{ mcpServers: { ... } }`) or an inline map of server configs.\n\t * Requires permission `agent.mcp.control`. Never written into user mcp.json.\n\t */\n\tmcpServers?: string | Record<string, PluginMcpServerConfig>;\n\t/** Declarative tool visibility policy. Names are tool ids after registration. */\n\ttoolPolicy?: {\n\t\tallow?: string[];\n\t\tdeny?: string[];\n\t};\n}\n\nexport interface Disposable {\n\tdispose(): void;\n}\n\n// ─── UI slots ───\n\nexport interface PluginGlobalSlotContribution {\n\tid: string;\n\tcomponent: ComponentType;\n}\n\nexport interface PluginAudioMetadata {\n\t/** Embedded title; preview renderers should fall back to file.name. */\n\ttitle?: string;\n\tartist?: string;\n\t/** Embedded cover art as a Data URL when available. */\n\tcoverDataUrl?: string;\n}\n\nexport interface PluginPreviewUrlOptions {\n\t/** Optional media hint for ambiguous containers such as webm. */\n\tmediaKind?: \"audio\" | \"video\";\n}\n\n/**\n * The file handed to a file-preview plugin component. The host does NOT\n * pre-read or guess encoding — the plugin decides whether to read text or\n * bytes. `path` is also exposed for plugins that prefer native fetch.\n */\nexport interface PluginPreviewFile {\n\tpath: string | null;\n\tname: string;\n\textension: string;\n\tmime: string;\n\tsize: number;\n\t/** Read the file as a UTF-8 string. */\n\treadText(): Promise<string>;\n\t/** Read the raw file bytes. */\n\treadBytes(): Promise<ArrayBuffer>;\n\t/** A fetchable streaming URL for the file (Range-capable). */\n\tgetUrl(options?: PluginPreviewUrlOptions): string;\n\t/**\n\t * Subscribe to on-disk changes of this file. The listener fires (debounced\n\t * by the host) whenever the file's contents change, letting previews update\n\t * live. Returns a Disposable; call dispose() to stop watching. A no-op for\n\t * files without a real path (url-only sources).\n\t */\n\twatch(listener: () => void): Disposable;\n\t/**\n\t * Host-provided audio metadata for local media files. Returns null when the\n\t * host cannot provide metadata, e.g. url-only sources or unsupported files.\n\t */\n\tgetAudioMetadata?(): Promise<PluginAudioMetadata | null>;\n}\n\nexport interface PluginFilePreviewProps {\n\tfile: PluginPreviewFile;\n}\n\nexport interface PluginFilePreviewContribution {\n\t/** Lower-case extensions without the dot, e.g. [\"svg\"]. */\n\textensions: string[];\n\tcomponent: ComponentType<PluginFilePreviewProps>;\n}\n\n/**\n * An activity-panel tab contributed by a plugin. Registering only adds the\n * tab to the \"addable pool\" — it renders only after the user attaches it in\n * the activity panel (scoped by session cwd).\n */\nexport interface PluginActivityTabContribution {\n\tid: string;\n\tlabel: string;\n\t/** Tab icon as a React node (not an iconify class string). */\n\ticon?: ReactNode;\n\tcomponent: ComponentType;\n\t/**\n\t * 允许该标签卡出现的对话场景 slug 列表(镜像工具的 scope_use)。**fail-closed**:\n\t * 未声明/空数组 = 任何会话都不显示;声明后仅在列出的场景里出现(如\n\t * `[\"project\", \"conversation\"]`)。会话页插槽据此随对话类型显隐。\n\t */\n\tscope_use?: readonly ConversationScenario[];\n}\n\n/** Options for {@link PluginUiApi.openActivityTab}. */\nexport interface PluginOpenActivityTabOptions {\n\t/**\n\t * Desired panel width as it opens: a pixel number, or `\"max\"` for the widest\n\t * the current window allows. The host clamps to its min/max bounds. Omit to\n\t * keep the user's current width.\n\t */\n\twidth?: number | \"max\";\n}\n\n/**\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\n/**\n * Decoration a plugin contributes to the next outgoing prompt while its input\n * action is active. `metadata` is shallow-merged into the prompt request's\n * `metadata` bag, which the agent turn can read (e.g. `{ imageMode: true }`).\n */\nexport interface PluginPromptDecoration {\n\tmetadata?: Record<string, unknown>;\n}\n\n/**\n * An action button shown in a row beneath the AI input bar. Rendered as a\n * toggle: clicking activates, clicking again deactivates. While active, the\n * host calls `decoratePrompt()` before each send and merges the returned\n * metadata into the outgoing prompt request. The plugin owns any side state\n * (it is the same Module Federation instance as its other slots).\n */\nexport interface PluginInputActionContribution {\n\tid: string;\n\tlabel: string;\n\t/** Button icon as a React node (not an iconify class string). */\n\ticon?: ReactNode;\n\t/** Whether the action begins in the active state. Defaults to false. */\n\tdefaultActive?: boolean;\n\t/**\n\t * 该输入动作所依赖的 agent 工具名。设置后,仅当该工具在当前会话处于激活(按工具的\n\t * scope_use 解析)时才显示这个 badge——避免在工具被场景屏蔽(如批量任务)时仍显示一个\n\t * 点了也无效的开关。不设则始终显示。例如「图像生成」设为 \"generate_image\"。\n\t */\n\trequiresActiveTool?: string;\n\t/**\n\t * 允许该 toggle 出现的对话场景 slug 列表(镜像工具的 scope_use)。**fail-closed**:\n\t * 未声明/空数组 = 任何会话都不显示;声明后仅在列出的场景里出现。与 `requiresActiveTool`\n\t * 取「与」:两者都满足才显示。\n\t */\n\tscope_use?: readonly ConversationScenario[];\n\t/**\n\t * When true, this plugin's agent contributions (tools / skills / MCP /\n\t * systemPrompt) and Activity Tabs are hard-isolated: inactive until this\n\t * toggle is on (ADR-0041, knowledgeMode-style). Default false.\n\t */\n\thardIsolation?: boolean;\n\t/**\n\t * Fired when the user toggles the action; `active` is the new state. Return\n\t * `false` when `active` is true to VETO the activation (e.g. the plugin needs\n\t * configuration first) — the toggle stays off. Deactivation can't be vetoed.\n\t */\n\tonToggle?(active: boolean): boolean | void;\n\t/**\n\t * Called by the host before sending while the action is active. The\n\t * returned metadata is merged into the outgoing prompt request.\n\t */\n\tdecoratePrompt?(): PluginPromptDecoration | void;\n}\n\n/**\n * A declarative, serializable descriptor for one card rendered beneath a\n * message. `type` selects a registered card renderer; `key` drives cross-turn\n * dedup (same key across turns = one logical card, shown only under its latest\n * anchor); `payload` carries STABLE REFERENCES (e.g. image ids), not a content\n * snapshot — the renderer resolves live state from it. `title`/`icon` label the\n * card's tab (override the renderer's registration defaults). Rides a tool\n * result's out-of-band `details.cards`; crosses the agent→host boundary, so\n * `icon` is an icon-symbol string, not a node.\n */\nexport interface CardDescriptor {\n\ttype: string;\n\tkey?: string;\n\tpayload?: unknown;\n\ttitle?: string;\n\ticon?: string;\n}\n\n/** A pending (in-flight) tool call handed to a renderer's `pendingFor`. */\nexport interface PluginPendingToolCall {\n\ttoolName: string;\n\targs: Record<string, unknown>;\n}\n\n/**\n * Props for a card renderer. `descriptor` is the card's data; `pending` is true\n * while it was synthesized from an in-flight tool (render a skeleton); `message`\n * is the anchoring conversation message.\n */\nexport interface PluginCardProps {\n\tdescriptor: CardDescriptor;\n\tpending: boolean;\n\tmessage: ConversationMessage;\n}\n\n/**\n * A card renderer registered by a plugin, keyed by `type`. A descriptor whose\n * `type` matches is rendered by `component`. `title`/`icon` are the default tab\n * label/icon (a descriptor may override `title`). `pendingFor`, given an\n * in-flight tool call, returns a provisional descriptor so a skeleton card\n * appears (and claims a tab) before the tool's result lands — or null when this\n * renderer doesn't handle that tool. The `type` must be globally unique across\n * plugins (convention: prefix with the plugin id, e.g. \"image-gen:preview\").\n */\nexport interface PluginCardRendererContribution {\n\ttype: string;\n\tcomponent: ComponentType<PluginCardProps>;\n\ttitle?: string;\n\t/** Default tab icon as a React node (not an iconify class string). */\n\ticon?: ReactNode;\n\tpendingFor?: (toolCall: PluginPendingToolCall) => CardDescriptor | null;\n}\n\n/** A tool call handed to a tool-call slot renderer. */\nexport interface PluginToolCallSlotToolCall {\n\ttoolCallId: string;\n\ttoolName: string;\n\targs: Record<string, unknown>;\n\tstatus: \"pending\" | \"success\" | \"error\";\n\tresult?: string;\n\tisError?: boolean;\n}\n\nexport interface PluginToolCallSlotProps {\n\ttoolCall: PluginToolCallSlotToolCall;\n}\n\n/**\n * A component that **replaces the host's default inline transcript rendering**\n * for a specific tool (matched by `toolName`; first registered renderer wins).\n * This is how a plugin renders rich UI for its OWN agent tool's output — plugin\n * tools cannot emit `details.cards`, so the message card system (registerCardRenderer)\n * does not serve them; the tool-call slot does.\n */\nexport interface PluginToolCallSlotContribution {\n\tid: string;\n\ttoolName: string;\n\tcomponent: ComponentType<PluginToolCallSlotProps>;\n}\n\n/**\n * A card rendered at the bottom of the message list for the LATEST turn — NOT\n * bound to a tool call. The host mounts `component` in the footer slot and\n * re-mounts it each session/turn; the plugin owns visibility entirely (it reads\n * live state via SDK hooks — `useActiveConversation`, `useConversationMessages`,\n * `ctx.conversation.on(\"turn-end\")` — and returns `null` to render nothing,\n * e.g. git renders only inside a repo that has changes). `scope_use` gates which\n * conversation scenarios it may appear in (**fail-closed**, mirrors the other\n * slots). `id` must be unique within the plugin.\n */\nexport interface PluginTurnCardContribution {\n\tid: string;\n\tcomponent: ComponentType;\n\t/**\n\t * 允许该 turn 卡出现的对话场景 slug 列表(镜像其它插槽的 scope_use)。**fail-closed**:\n\t * 未声明/空数组 = 任何会话都不显示;声明后仅在列出的场景里出现(如 `[\"project\"]`)。\n\t */\n\tscope_use?: readonly ConversationScenario[];\n}\n\nexport interface PluginUiApi {\n\tregisterGlobalSlot(contribution: PluginGlobalSlotContribution): Disposable;\n\t/**\n\t * Register a preview component keyed by file extension. The host dispatches\n\t * registered extensions before its built-in fallback renderers; first\n\t * registrant wins on conflict.\n\t */\n\tregisterFilePreview(contribution: PluginFilePreviewContribution): Disposable;\n\t/**\n\t * Register an activity-panel tab into the addable pool. The user attaches\n\t * it manually via the panel's \"+\" picker; attach records are keyed by the\n\t * session cwd.\n\t */\n\tregisterActivityTab(contribution: PluginActivityTabContribution): Disposable;\n\t/**\n\t * Register a toggle action shown beneath the AI input bar. While active,\n\t * its `decoratePrompt()` annotates the next outgoing prompt.\n\t */\n\tregisterInputAction(contribution: PluginInputActionContribution): Disposable;\n\t/**\n\t * Register a card renderer keyed by `type`. Cards rendered beneath a message\n\t * come from tool results' out-of-band `details.cards` (or `pendingFor` for\n\t * in-flight tools); the host resolves each card's `type` to a registered\n\t * renderer. Multiple cards under one message are shown as a tab-switcher\n\t * (\"收纳\") or a flat list.\n\t */\n\tregisterCardRenderer(contribution: PluginCardRendererContribution): Disposable;\n\t/**\n\t * Register a renderer that replaces the host's default inline transcript UI\n\t * for a tool call (matched by `toolName`). The complement to card renderers:\n\t * use it to render UI for a plugin's own agent tool output.\n\t */\n\tregisterToolCallSlot(contribution: PluginToolCallSlotContribution): Disposable;\n\t/**\n\t * Register a card rendered at the bottom of the message list for the latest\n\t * turn — NOT bound to a tool call. The host mounts the component in the\n\t * footer slot; the plugin owns visibility (return `null` to render nothing,\n\t * e.g. git renders only in a repo with changes). Gated by `scope_use`\n\t * (fail-closed). Needs the `ui.slot.turn-card` permission.\n\t */\n\tregisterTurnCard(contribution: PluginTurnCardContribution): Disposable;\n\t/**\n\t * Programmatically attach (if needed) and activate one of this plugin's\n\t * own activity tabs in the current conversation's activity panel. `tabId`\n\t * is the contribution id passed to registerActivityTab. Any payload (e.g.\n\t * which image to edit) is passed via the plugin's own in-memory state.\n\t *\n\t * Pass `options.width` to size the panel as it opens — a pixel number, or\n\t * `\"max\"` to expand it to the widest the current window allows (the host\n\t * still clamps to its min/max and auto-hides the sidebar when needed). Omit\n\t * to leave the user's current width untouched.\n\t */\n\topenActivityTab(tabId: string, options?: PluginOpenActivityTabOptions): void;\n\t/**\n\t * Bind (or clear, with `null`) an image as the \"edit target\" for the next\n\t * outgoing prompt. The host renders it as a thumbnail capsule in the AI input\n\t * bar's top capsule strip and, at send time, injects `metadata.editImageId`\n\t * (the ref's id) so this turn edits that image. One-shot: cleared after the\n\t * prompt is sent (or when the user closes the capsule). Only the image\n\t * reference (id/url) crosses over — bytes stay out-of-band.\n\t */\n\tsetEditImageAttachment(ref: PluginImageRef | null): void;\n\t/**\n\t * Open the host's global full-screen image previewer for the given image.\n\t * Only the image reference (id/url) crosses over — bytes stay out-of-band.\n\t *\n\t * Pass `group` (e.g. all images of the message) to open as an image group:\n\t * the previewer shows a thumbnail strip + arrows and starts at `ref`.\n\t */\n\tpreviewImage(ref: PluginImageRef, group?: PluginImageRef[]): void;\n\t/**\n\t * Open the app settings, scrolled to and highlighting THIS plugin's own\n\t * settings section (e.g. so the user can fill in a required API key/model).\n\t * The host owns the navigation; the plugin only asks to jump there.\n\t */\n\topenPluginSettings(): void;\n\t/**\n\t * Show a global toast in the host UI (bottom-right). No permission required.\n\t * Prefer this over swallowing errors into opaque UI copy: pass `error` so\n\t * the host attaches a one-click \"copy stack\" action for the user.\n\t *\n\t * Capture `ctx.ui.notify` in `activate` if React components need it\n\t * (components do not receive `ctx`).\n\t */\n\tnotify(options: PluginNotifyOptions): void;\n}\n\n/**\n * Options for {@link PluginUiApi.notify}. Surfaces a host toast so users can\n * see plugin failures without opening DevTools.\n */\nexport interface PluginNotifyOptions {\n\t/** Toast body. Required even when `error` is set (user-facing summary). */\n\tmessage: string;\n\t/** Defaults to plugin display name when omitted. */\n\ttitle?: string;\n\t/** Defaults to `\"info\"`; when `error` is set and variant omitted, host uses `\"error\"`. */\n\tvariant?: \"info\" | \"success\" | \"warning\" | \"error\";\n\t/**\n\t * Optional failure cause. Host formats message + stack and adds a\n\t * \"复制堆栈\" action so the user can paste it into bug reports / chat.\n\t */\n\terror?: unknown;\n\t/**\n\t * Auto-dismiss delay in ms. `0` keeps the toast until dismissed.\n\t * Defaults: sticky (`0`) when `error` is present, otherwise host default (~4s).\n\t */\n\tdurationMs?: number;\n}\n\n// ─── Conversation ───\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/** Subscribe to real-time conversation events. */\n\ton(listener: (event: ConversationEvent) => void): Disposable;\n}\n\n// ─── Agent runtime ───\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\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 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\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\n// ─── Files ───\n\nexport 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\n// ─── Command execution ───\n\nexport interface PluginCommandRunOptions {\n\t/** Working directory. Must resolve inside a host-allowed root (e.g. a project). */\n\tcwd?: string;\n\t/** Extra environment entries, merged over the host process env (PATH preserved). */\n\tenv?: Record<string, string>;\n\t/** Hard timeout in ms; the host clamps to its own maximum. */\n\ttimeoutMs?: number;\n}\n\nexport interface PluginCommandRunResult {\n\tstdout: string;\n\tstderr: string;\n\t/** Process exit code; null when the process was killed by a signal/timeout. */\n\texitCode: number | null;\n}\n\n/**\n * Run an allowed host command (e.g. `git`). execFile semantics — NO shell, args\n * are passed as an array (no string splitting, no injection). The executable\n * must be declared in plugin.json's `commands` and currently enabled by the\n * user; otherwise the call is rejected (and the host notifies the user). Needs\n * the `agent.command.run` permission.\n */\nexport interface PluginCommandApi {\n\trun(file: string, args?: string[], options?: PluginCommandRunOptions): Promise<PluginCommandRunResult>;\n}\n\n// ─── Context & definition ───\n\nexport interface PluginPermissionApi {\n\thas(permission: PluginPermission): boolean;\n\trequire(permission: PluginPermission): void;\n}\n\n// ─── Images ───\n\nexport interface PluginGenerateImageInput {\n\tprompt: string;\n\t/** Output size (e.g. \"1024x1024\"), decided by the agent and forwarded to the model. */\n\tsize?: string;\n\t/** Optional reference id for grouping (e.g. the conversation/session). */\n\tsessionId?: string;\n}\n\nexport interface PluginEditImageInput {\n\tprompt: string;\n\t/**\n\t * Source image to edit. Either an existing host image id (continue a\n\t * lineage) or raw base64 bytes (e.g. a user upload).\n\t */\n\tsource: { imageId: string } | { data: string; mimeType: string };\n\tsessionId?: string;\n}\n\n/**\n * Image generation, routed to the host's main-process image service (single\n * implementation shared with the agent's built-in image tool). Bytes are\n * stored out-of-band; results are returned as host media references.\n */\nexport interface PluginImagesApi {\n\t/** Text-to-image. Resolves to the produced image reference(s). */\n\tgenerate(input: PluginGenerateImageInput): Promise<PluginImageRef[]>;\n\t/** Image-to-image edit, producing the next version in a lineage. */\n\tedit(input: PluginEditImageInput): Promise<PluginImageRef[]>;\n\t/** The edit lineage (base image + its edits, oldest first) for an image. */\n\tlineage(imageId: string): Promise<PluginImageRef[]>;\n\t/**\n\t * Every edit lineage the given session touched (generated or edited a version\n\t * in), newest lineage first; each lineage's versions oldest → newest. The\n\t * sessionId is the agent session id — derive it from the active conversation's\n\t * `sessionPath` (the UUID embedded in the session file name).\n\t */\n\tsessionLineages(sessionId: string): Promise<PluginImageRef[][]>;\n}\n\n// ─── Settings ───\n\n/**\n * Read-side access to this plugin's settings (the values configured against\n * the `contributes.settings` schema declared in plugin.json, namespaced by\n * plugin id). Writes go through the host's settings UI, not the plugin.\n */\nexport interface PluginSettingsApi {\n\tget<T = unknown>(key: string): T | undefined;\n\tgetAll(): Record<string, unknown>;\n\t/** Fired when any of this plugin's setting values change. */\n\tonChange(listener: (values: Record<string, unknown>) => void): Disposable;\n}\n\n// ─── i18n ───\n\n/** A flat catalog: translation key → localized string. */\nexport type PluginLocaleCatalog = Record<string, string>;\n/** Every catalog a plugin ships, keyed by locale code (e.g. \"zh\", \"en\"). */\nexport type PluginLocales = Record<string, PluginLocaleCatalog>;\n\n/** Replace `{{name}}` placeholders in a resolved string with `params`. */\nexport function interpolatePluginText(text: string, params?: Record<string, string | number>): string {\n\tif (!params) return text;\n\treturn text.replace(/\\{\\{(\\w+)\\}\\}/g, (match, name: string) => (name in params ? String(params[name]) : match));\n}\n\n/**\n * Resolve a bare catalog key against a plugin's catalogs. Fallback chain:\n * current-locale catalog → the plugin's `defaultLocale` catalog → the bare key\n * itself (a dev signal for a missing translation). Then interpolate `{{params}}`.\n */\nexport function resolveCatalogKey(\n\tkey: string,\n\tlocales: PluginLocales,\n\tcurrentLocale: string,\n\tdefaultLocale: string,\n\tparams?: Record<string, string | number>,\n): string {\n\tconst fromCurrent = locales[currentLocale]?.[key];\n\tconst fromDefault = locales[defaultLocale]?.[key];\n\treturn interpolatePluginText(fromCurrent ?? fromDefault ?? key, params);\n}\n\nconst I18N_KEY_PATTERN = /^%([^%]+)%$/;\n\n/**\n * Resolve a host-rendered plugin string. A value of the exact form `%key%` is a\n * catalog key (resolved via {@link resolveCatalogKey}); any other string is a\n * literal and returned unchanged — backwards compatible with bare strings.\n */\nexport function resolvePluginText(\n\traw: string,\n\tlocales: PluginLocales,\n\tcurrentLocale: string,\n\tdefaultLocale: string,\n\tparams?: Record<string, string | number>,\n): string {\n\tconst match = I18N_KEY_PATTERN.exec(raw);\n\tif (!match) return raw;\n\treturn resolveCatalogKey(match[1], locales, currentLocale, defaultLocale, params);\n}\n\nexport type PluginTranslate = (key: string, params?: Record<string, string | number>) => string;\n\n/**\n * This plugin's i18n surface on the context. `locale` always equals the host's\n * current language; `t` resolves a BARE catalog key (no `%...%` wrapper) against\n * this plugin's catalogs at the current locale. Imperative — for plugin React\n * components prefer the reactive {@link useTranslation} hook.\n */\nexport interface PluginI18nApi {\n\t/** The host's current locale code (e.g. \"zh\"). */\n\treadonly locale: string;\n\t/** Resolve a bare catalog key at the current locale, with optional `{{params}}`. */\n\tt: PluginTranslate;\n\t/** Fired when the host language changes. */\n\tonChange(listener: (locale: string) => void): Disposable;\n}\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\tfs: PluginFsApi;\n\tcommand: PluginCommandApi;\n\timages: PluginImagesApi;\n\tsettings: PluginSettingsApi;\n\ti18n: PluginI18nApi;\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\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\tuseEditImageAttachment(): PluginImageRef | 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\nfunction requireBridge(): PluginHostBridge {\n\tif (!hostBridge) {\n\t\tthrow new Error(\"Vetta plugin host bridge is not installed\");\n\t}\n\treturn hostBridge;\n}\n\n// ─── Activity tab context ───\n\nexport interface ActivityTabContextValue {\n\t/**\n\t * The cwd scope of the activity panel this tab is rendered in — the same\n\t * key the attach record uses. Do NOT substitute useActiveConversation().cwd:\n\t * on the project detail page the panel cwd is the project's, while the\n\t * active conversation may belong to another project (or be null).\n\t */\n\tcwd: string | null;\n}\n\n/**\n * Internal: the host wraps attached activity-tab components in this context's\n * Provider. Module Federation shares this single SDK instance, so the value\n * the host provides is visible to plugin components.\n */\nexport const __ActivityTabContext = createContext<ActivityTabContextValue>({ cwd: null });\n\n/** The panel scope of the activity tab this component is rendered in. */\nexport function useActivityTab(): ActivityTabContextValue {\n\treturn useContext(__ActivityTabContext);\n}\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 image currently bound as the edit target via\n * `ui.setEditImageAttachment` (or null). Single source of truth for the\n * \"selected for edit\" highlight — clears automatically when the host drops the\n * attachment (send, capsule close, or session switch).\n */\nexport function useEditImageAttachment(): PluginImageRef | null {\n\treturn requireBridge().useEditImageAttachment();\n}\n"]}
|
|
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,YAAY,EACX,4BAA4B,EAC5B,mBAAm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,6BAA6B,EAC7B,4BAA4B,EAC5B,gCAAgC,EAChC,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC3B,yCAAyC,EACzC,iBAAiB,GACjB,MAAM,eAAe,CAAC;AAGvB,YAAY,EACX,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,GACX,MAAM,SAAS,CAAC;AACjB,YAAY,EACX,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,GAChB,MAAM,cAAc,CAAC;AACtB,YAAY,EACX,cAAc,EACd,wBAAwB,EACxB,oBAAoB,EACpB,eAAe,GACf,MAAM,aAAa,CAAC;AACrB,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,sBAAsB,GACtB,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\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\tPluginFsStatResult,\n\tPluginFsReadResult,\n\tPluginFsApi,\n} from \"./fs.js\";\nexport type {\n\tPluginCommandRunOptions,\n\tPluginCommandRunResult,\n\tPluginCommandApi,\n} from \"./command.js\";\nexport type {\n\tPluginImageRef,\n\tPluginGenerateImageInput,\n\tPluginEditImageInput,\n\tPluginImagesApi,\n} from \"./images.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\tuseEditImageAttachment,\n} from \"./hooks.js\";\n"]}
|
package/dist/index.js
CHANGED
|
@@ -1,90 +1,14 @@
|
|
|
1
|
-
import { createContext, useCallback, useContext } from "react";
|
|
2
|
-
/** Replace `{{name}}` placeholders in a resolved string with `params`. */
|
|
3
|
-
export function interpolatePluginText(text, params) {
|
|
4
|
-
if (!params)
|
|
5
|
-
return text;
|
|
6
|
-
return text.replace(/\{\{(\w+)\}\}/g, (match, name) => (name in params ? String(params[name]) : match));
|
|
7
|
-
}
|
|
8
1
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
* catalog key (resolved via {@link resolveCatalogKey}); any other string is a
|
|
22
|
-
* literal and returned unchanged — backwards compatible with bare strings.
|
|
23
|
-
*/
|
|
24
|
-
export function resolvePluginText(raw, locales, currentLocale, defaultLocale, params) {
|
|
25
|
-
const match = I18N_KEY_PATTERN.exec(raw);
|
|
26
|
-
if (!match)
|
|
27
|
-
return raw;
|
|
28
|
-
return resolveCatalogKey(match[1], locales, currentLocale, defaultLocale, params);
|
|
29
|
-
}
|
|
30
|
-
export function definePlugin(plugin) {
|
|
31
|
-
return plugin;
|
|
32
|
-
}
|
|
33
|
-
let hostBridge;
|
|
34
|
-
export function __setPluginHostBridge(bridge) {
|
|
35
|
-
hostBridge = bridge;
|
|
36
|
-
}
|
|
37
|
-
function requireBridge() {
|
|
38
|
-
if (!hostBridge) {
|
|
39
|
-
throw new Error("Vetta plugin host bridge is not installed");
|
|
40
|
-
}
|
|
41
|
-
return hostBridge;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Internal: the host wraps attached activity-tab components in this context's
|
|
45
|
-
* Provider. Module Federation shares this single SDK instance, so the value
|
|
46
|
-
* the host provides is visible to plugin components.
|
|
47
|
-
*/
|
|
48
|
-
export const __ActivityTabContext = createContext({ cwd: null });
|
|
49
|
-
/** The panel scope of the activity tab this component is rendered in. */
|
|
50
|
-
export function useActivityTab() {
|
|
51
|
-
return useContext(__ActivityTabContext);
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Internal: the host wraps plugin-rendered components in this context's Provider,
|
|
55
|
-
* carrying THIS plugin's catalogs. Module Federation shares this single SDK
|
|
56
|
-
* instance, so the value the host provides is visible to {@link useTranslation}.
|
|
57
|
-
*/
|
|
58
|
-
export const __PluginI18nContext = createContext({
|
|
59
|
-
locales: {},
|
|
60
|
-
defaultLocale: "zh",
|
|
61
|
-
});
|
|
62
|
-
/**
|
|
63
|
-
* Reactive translation for plugin React components — re-renders when the host
|
|
64
|
-
* language changes. `t` resolves a BARE catalog key (no `%...%` wrapper) against
|
|
65
|
-
* THIS plugin's catalogs; the host provides them via __PluginI18nContext.
|
|
66
|
-
*/
|
|
67
|
-
export function useTranslation() {
|
|
68
|
-
const locale = requireBridge().useLocale();
|
|
69
|
-
const { locales, defaultLocale } = useContext(__PluginI18nContext);
|
|
70
|
-
const t = useCallback((key, params) => resolveCatalogKey(key, locales, locale, defaultLocale, params), [locales, locale, defaultLocale]);
|
|
71
|
-
return { locale, t };
|
|
72
|
-
}
|
|
73
|
-
/** Reactive: the currently-active conversation's state. */
|
|
74
|
-
export function useActiveConversation() {
|
|
75
|
-
return requireBridge().useActiveConversation();
|
|
76
|
-
}
|
|
77
|
-
/** Reactive: the active conversation's messages. */
|
|
78
|
-
export function useConversationMessages() {
|
|
79
|
-
return requireBridge().useConversationMessages();
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Reactive: the image currently bound as the edit target via
|
|
83
|
-
* `ui.setEditImageAttachment` (or null). Single source of truth for the
|
|
84
|
-
* "selected for edit" highlight — clears automatically when the host drops the
|
|
85
|
-
* attachment (send, capsule close, or session switch).
|
|
86
|
-
*/
|
|
87
|
-
export function useEditImageAttachment() {
|
|
88
|
-
return requireBridge().useEditImageAttachment();
|
|
89
|
-
}
|
|
2
|
+
* @vetta-org/plugin-sdk public surface.
|
|
3
|
+
*
|
|
4
|
+
* Implementation is split by domain under `src/*.ts`; this barrel re-exports
|
|
5
|
+
* the stable package API. Prefer importing from `@vetta-org/plugin-sdk` rather
|
|
6
|
+
* than deep paths.
|
|
7
|
+
*/
|
|
8
|
+
export { PluginAppActionError } from "./app-actions.js";
|
|
9
|
+
export { interpolatePluginText, resolveCatalogKey, resolvePluginText } from "./i18n.js";
|
|
10
|
+
export { definePlugin } from "./context.js";
|
|
11
|
+
export { __setPluginHostBridge } from "./host-bridge.js";
|
|
12
|
+
export { __ActivityTabContext, useActivityTab } from "./activity-tab.js";
|
|
13
|
+
export { __PluginI18nContext, useTranslation, useActiveConversation, useConversationMessages, useEditImageAttachment, } from "./hooks.js";
|
|
90
14
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","s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,CAAC;AAAA,CAC/C;AAED,oDAAoD;AACpD,MAAM,UAAU,uBAAuB,GAA0B;IAChE,OAAO,aAAa,EAAE,CAAC,uBAAuB,EAAE,CAAC;AAAA,CACjD;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,GAA0B;IAC/D,OAAO,aAAa,EAAE,CAAC,sBAAsB,EAAE,CAAC;AAAA,CAChD","sourcesContent":["import type { ComponentType, ReactNode } from \"react\";\nimport { createContext, useCallback, useContext } from \"react\";\n\n/**\n * 对话场景 slug——决定一个工具 / 会话页插槽在哪些类型的会话里激活或可见。\n *\n * 本类型在 plugin-sdk 内本地定义(SDK 零依赖,不引入宿主包),与宿主\n * `@vetta/coding-agent` 的 `ConversationScenario` 保持一一对应;任一侧增删场景时两边须同步,\n * 否则宿主回传的 scenario 与此 union 不一致会触发编译错误(即为期望的漂移护栏)。\n */\nexport type ConversationScenario =\n\t| \"im-claw\" // Claw IM 对话\n\t| \"conversation\" // 普通对话\n\t| \"project\" // 普通项目中对话\n\t| \"batch\" // 批量任务对话\n\t| \"automation\" // 自动化任务对话\n\t| \"kb-processing\" // 知识库加工对话\n\t| \"cli\"; // 裸 CLI / SDK 消费者\n\nexport type PluginPermission =\n\t| \"ui.slot.global\"\n\t| \"ui.slot.file-preview\"\n\t| \"ui.slot.activity-tab\"\n\t| \"ui.slot.input-action\"\n\t| \"ui.slot.message\"\n\t| \"ui.slot.tool-call\"\n\t| \"ui.slot.turn-card\"\n\t| \"agent.session.read\"\n\t| \"agent.session.write\"\n\t| \"agent.command.run\"\n\t| \"agent.systemPrompt.read\"\n\t| \"agent.systemPrompt.write\"\n\t| \"agent.systemPrompt.fullControl\"\n\t| \"agent.skills.control\"\n\t| \"agent.mcp.control\"\n\t| \"agent.tools.control\"\n\t| \"agent.tools.register\"\n\t| \"agent.toolHandler.execute\"\n\t| \"agent.state.read\"\n\t| \"agent.state.write\"\n\t| \"agent.continuation.register\"\n\t| \"agent.runtime.configure\"\n\t| \"fs.read\"\n\t| \"fs.write\"\n\t| \"network.fetch\"\n\t| \"images.generate\"\n\t| \"settings.read\"\n\t| \"settings.write\";\n\n/**\n * MCP server config declared inside a plugin (stdio or http). Relative paths in\n * stdio `command`/`args`/`cwd` are resolved against the plugin root at contribute time.\n */\nexport type PluginMcpServerConfig =\n\t| {\n\t\t\ttype?: \"stdio\";\n\t\t\tcommand: string;\n\t\t\targs?: string[];\n\t\t\tenv?: Record<string, string>;\n\t\t\tcwd?: string;\n\t\t\tdisabled?: boolean;\n\t\t\tautoApprove?: string[];\n\t\t\tstartupTimeout?: number;\n\t\t\tdebug?: boolean;\n\t\t\tdisplayName?: string;\n\t\t\tdescription?: string;\n\t }\n\t| {\n\t\t\ttype: \"http\";\n\t\t\turl: string;\n\t\t\theaders?: Record<string, string>;\n\t\t\toauthClientId?: string;\n\t\t\toauthDeviceFlow?: boolean;\n\t\t\toauthScopes?: string;\n\t\t\tdisabled?: boolean;\n\t\t\tautoApprove?: string[];\n\t\t\tstartupTimeout?: number;\n\t\t\tdebug?: boolean;\n\t\t\tdisplayName?: string;\n\t\t\tdescription?: string;\n\t };\n\nexport interface PluginAgentManifest {\n\tsystemPrompt?: {\n\t\t/**\n\t\t * Plugin-packaged prompt contribution file paths. Main-process aggregation\n\t\t * resolves these relative to the installed plugin root.\n\t\t */\n\t\tpromptPaths?: string[];\n\t};\n\t/** Plugin-packaged skill files or directories to add to the agent resource graph. */\n\tskillPaths?: string[];\n\t/**\n\t * Plugin-scoped MCP servers. Either a relative path to `.mcp.json`\n\t * (shape `{ mcpServers: { ... } }`) or an inline map of server configs.\n\t * Requires permission `agent.mcp.control`. Never written into user mcp.json.\n\t */\n\tmcpServers?: string | Record<string, PluginMcpServerConfig>;\n\t/** Declarative tool visibility policy. Names are tool ids after registration. */\n\ttoolPolicy?: {\n\t\tallow?: string[];\n\t\tdeny?: string[];\n\t};\n}\n\nexport interface Disposable {\n\tdispose(): void;\n}\n\n// ─── UI slots ───\n\nexport interface PluginGlobalSlotContribution {\n\tid: string;\n\tcomponent: ComponentType;\n}\n\nexport interface PluginAudioMetadata {\n\t/** Embedded title; preview renderers should fall back to file.name. */\n\ttitle?: string;\n\tartist?: string;\n\t/** Embedded cover art as a Data URL when available. */\n\tcoverDataUrl?: string;\n}\n\nexport interface PluginPreviewUrlOptions {\n\t/** Optional media hint for ambiguous containers such as webm. */\n\tmediaKind?: \"audio\" | \"video\";\n}\n\n/**\n * The file handed to a file-preview plugin component. The host does NOT\n * pre-read or guess encoding — the plugin decides whether to read text or\n * bytes. `path` is also exposed for plugins that prefer native fetch.\n */\nexport interface PluginPreviewFile {\n\tpath: string | null;\n\tname: string;\n\textension: string;\n\tmime: string;\n\tsize: number;\n\t/** Read the file as a UTF-8 string. */\n\treadText(): Promise<string>;\n\t/** Read the raw file bytes. */\n\treadBytes(): Promise<ArrayBuffer>;\n\t/** A fetchable streaming URL for the file (Range-capable). */\n\tgetUrl(options?: PluginPreviewUrlOptions): string;\n\t/**\n\t * Subscribe to on-disk changes of this file. The listener fires (debounced\n\t * by the host) whenever the file's contents change, letting previews update\n\t * live. Returns a Disposable; call dispose() to stop watching. A no-op for\n\t * files without a real path (url-only sources).\n\t */\n\twatch(listener: () => void): Disposable;\n\t/**\n\t * Host-provided audio metadata for local media files. Returns null when the\n\t * host cannot provide metadata, e.g. url-only sources or unsupported files.\n\t */\n\tgetAudioMetadata?(): Promise<PluginAudioMetadata | null>;\n}\n\nexport interface PluginFilePreviewProps {\n\tfile: PluginPreviewFile;\n}\n\nexport interface PluginFilePreviewContribution {\n\t/** Lower-case extensions without the dot, e.g. [\"svg\"]. */\n\textensions: string[];\n\tcomponent: ComponentType<PluginFilePreviewProps>;\n}\n\n/**\n * An activity-panel tab contributed by a plugin. Registering only adds the\n * tab to the \"addable pool\" — it renders only after the user attaches it in\n * the activity panel (scoped by session cwd).\n */\nexport interface PluginActivityTabContribution {\n\tid: string;\n\tlabel: string;\n\t/** Tab icon as a React node (not an iconify class string). */\n\ticon?: ReactNode;\n\tcomponent: ComponentType;\n\t/**\n\t * 允许该标签卡出现的对话场景 slug 列表(镜像工具的 scope_use)。**fail-closed**:\n\t * 未声明/空数组 = 任何会话都不显示;声明后仅在列出的场景里出现(如\n\t * `[\"project\", \"conversation\"]`)。会话页插槽据此随对话类型显隐。\n\t */\n\tscope_use?: readonly ConversationScenario[];\n}\n\n/** Options for {@link PluginUiApi.openActivityTab}. */\nexport interface PluginOpenActivityTabOptions {\n\t/**\n\t * Desired panel width as it opens: a pixel number, or `\"max\"` for the widest\n\t * the current window allows. The host clamps to its min/max bounds. Omit to\n\t * keep the user's current width.\n\t */\n\twidth?: number | \"max\";\n}\n\n/**\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\n/**\n * Decoration a plugin contributes to the next outgoing prompt while its input\n * action is active. `metadata` is shallow-merged into the prompt request's\n * `metadata` bag, which the agent turn can read (e.g. `{ imageMode: true }`).\n */\nexport interface PluginPromptDecoration {\n\tmetadata?: Record<string, unknown>;\n}\n\n/**\n * An action button shown in a row beneath the AI input bar. Rendered as a\n * toggle: clicking activates, clicking again deactivates. While active, the\n * host calls `decoratePrompt()` before each send and merges the returned\n * metadata into the outgoing prompt request. The plugin owns any side state\n * (it is the same Module Federation instance as its other slots).\n */\nexport interface PluginInputActionContribution {\n\tid: string;\n\tlabel: string;\n\t/** Button icon as a React node (not an iconify class string). */\n\ticon?: ReactNode;\n\t/** Whether the action begins in the active state. Defaults to false. */\n\tdefaultActive?: boolean;\n\t/**\n\t * 该输入动作所依赖的 agent 工具名。设置后,仅当该工具在当前会话处于激活(按工具的\n\t * scope_use 解析)时才显示这个 badge——避免在工具被场景屏蔽(如批量任务)时仍显示一个\n\t * 点了也无效的开关。不设则始终显示。例如「图像生成」设为 \"generate_image\"。\n\t */\n\trequiresActiveTool?: string;\n\t/**\n\t * 允许该 toggle 出现的对话场景 slug 列表(镜像工具的 scope_use)。**fail-closed**:\n\t * 未声明/空数组 = 任何会话都不显示;声明后仅在列出的场景里出现。与 `requiresActiveTool`\n\t * 取「与」:两者都满足才显示。\n\t */\n\tscope_use?: readonly ConversationScenario[];\n\t/**\n\t * When true, this plugin's agent contributions (tools / skills / MCP /\n\t * systemPrompt) and Activity Tabs are hard-isolated: inactive until this\n\t * toggle is on (ADR-0041, knowledgeMode-style). Default false.\n\t */\n\thardIsolation?: boolean;\n\t/**\n\t * Fired when the user toggles the action; `active` is the new state. Return\n\t * `false` when `active` is true to VETO the activation (e.g. the plugin needs\n\t * configuration first) — the toggle stays off. Deactivation can't be vetoed.\n\t */\n\tonToggle?(active: boolean): boolean | void;\n\t/**\n\t * Called by the host before sending while the action is active. The\n\t * returned metadata is merged into the outgoing prompt request.\n\t */\n\tdecoratePrompt?(): PluginPromptDecoration | void;\n}\n\n/**\n * A declarative, serializable descriptor for one card rendered beneath a\n * message. `type` selects a registered card renderer; `key` drives cross-turn\n * dedup (same key across turns = one logical card, shown only under its latest\n * anchor); `payload` carries STABLE REFERENCES (e.g. image ids), not a content\n * snapshot — the renderer resolves live state from it. `title`/`icon` label the\n * card's tab (override the renderer's registration defaults). Rides a tool\n * result's out-of-band `details.cards`; crosses the agent→host boundary, so\n * `icon` is an icon-symbol string, not a node.\n */\nexport interface CardDescriptor {\n\ttype: string;\n\tkey?: string;\n\tpayload?: unknown;\n\ttitle?: string;\n\ticon?: string;\n}\n\n/** A pending (in-flight) tool call handed to a renderer's `pendingFor`. */\nexport interface PluginPendingToolCall {\n\ttoolName: string;\n\targs: Record<string, unknown>;\n}\n\n/**\n * Props for a card renderer. `descriptor` is the card's data; `pending` is true\n * while it was synthesized from an in-flight tool (render a skeleton); `message`\n * is the anchoring conversation message.\n */\nexport interface PluginCardProps {\n\tdescriptor: CardDescriptor;\n\tpending: boolean;\n\tmessage: ConversationMessage;\n}\n\n/**\n * A card renderer registered by a plugin, keyed by `type`. A descriptor whose\n * `type` matches is rendered by `component`. `title`/`icon` are the default tab\n * label/icon (a descriptor may override `title`). `pendingFor`, given an\n * in-flight tool call, returns a provisional descriptor so a skeleton card\n * appears (and claims a tab) before the tool's result lands — or null when this\n * renderer doesn't handle that tool. The `type` must be globally unique across\n * plugins (convention: prefix with the plugin id, e.g. \"image-gen:preview\").\n */\nexport interface PluginCardRendererContribution {\n\ttype: string;\n\tcomponent: ComponentType<PluginCardProps>;\n\ttitle?: string;\n\t/** Default tab icon as a React node (not an iconify class string). */\n\ticon?: ReactNode;\n\tpendingFor?: (toolCall: PluginPendingToolCall) => CardDescriptor | null;\n}\n\n/** A tool call handed to a tool-call slot renderer. */\nexport interface PluginToolCallSlotToolCall {\n\ttoolCallId: string;\n\ttoolName: string;\n\targs: Record<string, unknown>;\n\tstatus: \"pending\" | \"success\" | \"error\";\n\tresult?: string;\n\tisError?: boolean;\n}\n\nexport interface PluginToolCallSlotProps {\n\ttoolCall: PluginToolCallSlotToolCall;\n}\n\n/**\n * A component that **replaces the host's default inline transcript rendering**\n * for a specific tool (matched by `toolName`; first registered renderer wins).\n * This is how a plugin renders rich UI for its OWN agent tool's output — plugin\n * tools cannot emit `details.cards`, so the message card system (registerCardRenderer)\n * does not serve them; the tool-call slot does.\n */\nexport interface PluginToolCallSlotContribution {\n\tid: string;\n\ttoolName: string;\n\tcomponent: ComponentType<PluginToolCallSlotProps>;\n}\n\n/**\n * A card rendered at the bottom of the message list for the LATEST turn — NOT\n * bound to a tool call. The host mounts `component` in the footer slot and\n * re-mounts it each session/turn; the plugin owns visibility entirely (it reads\n * live state via SDK hooks — `useActiveConversation`, `useConversationMessages`,\n * `ctx.conversation.on(\"turn-end\")` — and returns `null` to render nothing,\n * e.g. git renders only inside a repo that has changes). `scope_use` gates which\n * conversation scenarios it may appear in (**fail-closed**, mirrors the other\n * slots). `id` must be unique within the plugin.\n */\nexport interface PluginTurnCardContribution {\n\tid: string;\n\tcomponent: ComponentType;\n\t/**\n\t * 允许该 turn 卡出现的对话场景 slug 列表(镜像其它插槽的 scope_use)。**fail-closed**:\n\t * 未声明/空数组 = 任何会话都不显示;声明后仅在列出的场景里出现(如 `[\"project\"]`)。\n\t */\n\tscope_use?: readonly ConversationScenario[];\n}\n\nexport interface PluginUiApi {\n\tregisterGlobalSlot(contribution: PluginGlobalSlotContribution): Disposable;\n\t/**\n\t * Register a preview component keyed by file extension. The host dispatches\n\t * registered extensions before its built-in fallback renderers; first\n\t * registrant wins on conflict.\n\t */\n\tregisterFilePreview(contribution: PluginFilePreviewContribution): Disposable;\n\t/**\n\t * Register an activity-panel tab into the addable pool. The user attaches\n\t * it manually via the panel's \"+\" picker; attach records are keyed by the\n\t * session cwd.\n\t */\n\tregisterActivityTab(contribution: PluginActivityTabContribution): Disposable;\n\t/**\n\t * Register a toggle action shown beneath the AI input bar. While active,\n\t * its `decoratePrompt()` annotates the next outgoing prompt.\n\t */\n\tregisterInputAction(contribution: PluginInputActionContribution): Disposable;\n\t/**\n\t * Register a card renderer keyed by `type`. Cards rendered beneath a message\n\t * come from tool results' out-of-band `details.cards` (or `pendingFor` for\n\t * in-flight tools); the host resolves each card's `type` to a registered\n\t * renderer. Multiple cards under one message are shown as a tab-switcher\n\t * (\"收纳\") or a flat list.\n\t */\n\tregisterCardRenderer(contribution: PluginCardRendererContribution): Disposable;\n\t/**\n\t * Register a renderer that replaces the host's default inline transcript UI\n\t * for a tool call (matched by `toolName`). The complement to card renderers:\n\t * use it to render UI for a plugin's own agent tool output.\n\t */\n\tregisterToolCallSlot(contribution: PluginToolCallSlotContribution): Disposable;\n\t/**\n\t * Register a card rendered at the bottom of the message list for the latest\n\t * turn — NOT bound to a tool call. The host mounts the component in the\n\t * footer slot; the plugin owns visibility (return `null` to render nothing,\n\t * e.g. git renders only in a repo with changes). Gated by `scope_use`\n\t * (fail-closed). Needs the `ui.slot.turn-card` permission.\n\t */\n\tregisterTurnCard(contribution: PluginTurnCardContribution): Disposable;\n\t/**\n\t * Programmatically attach (if needed) and activate one of this plugin's\n\t * own activity tabs in the current conversation's activity panel. `tabId`\n\t * is the contribution id passed to registerActivityTab. Any payload (e.g.\n\t * which image to edit) is passed via the plugin's own in-memory state.\n\t *\n\t * Pass `options.width` to size the panel as it opens — a pixel number, or\n\t * `\"max\"` to expand it to the widest the current window allows (the host\n\t * still clamps to its min/max and auto-hides the sidebar when needed). Omit\n\t * to leave the user's current width untouched.\n\t */\n\topenActivityTab(tabId: string, options?: PluginOpenActivityTabOptions): void;\n\t/**\n\t * Bind (or clear, with `null`) an image as the \"edit target\" for the next\n\t * outgoing prompt. The host renders it as a thumbnail capsule in the AI input\n\t * bar's top capsule strip and, at send time, injects `metadata.editImageId`\n\t * (the ref's id) so this turn edits that image. One-shot: cleared after the\n\t * prompt is sent (or when the user closes the capsule). Only the image\n\t * reference (id/url) crosses over — bytes stay out-of-band.\n\t */\n\tsetEditImageAttachment(ref: PluginImageRef | null): void;\n\t/**\n\t * Open the host's global full-screen image previewer for the given image.\n\t * Only the image reference (id/url) crosses over — bytes stay out-of-band.\n\t *\n\t * Pass `group` (e.g. all images of the message) to open as an image group:\n\t * the previewer shows a thumbnail strip + arrows and starts at `ref`.\n\t */\n\tpreviewImage(ref: PluginImageRef, group?: PluginImageRef[]): void;\n\t/**\n\t * Open the app settings, scrolled to and highlighting THIS plugin's own\n\t * settings section (e.g. so the user can fill in a required API key/model).\n\t * The host owns the navigation; the plugin only asks to jump there.\n\t */\n\topenPluginSettings(): void;\n\t/**\n\t * Show a global toast in the host UI (bottom-right). No permission required.\n\t * Prefer this over swallowing errors into opaque UI copy: pass `error` so\n\t * the host attaches a one-click \"copy stack\" action for the user.\n\t *\n\t * Capture `ctx.ui.notify` in `activate` if React components need it\n\t * (components do not receive `ctx`).\n\t */\n\tnotify(options: PluginNotifyOptions): void;\n}\n\n/**\n * Options for {@link PluginUiApi.notify}. Surfaces a host toast so users can\n * see plugin failures without opening DevTools.\n */\nexport interface PluginNotifyOptions {\n\t/** Toast body. Required even when `error` is set (user-facing summary). */\n\tmessage: string;\n\t/** Defaults to plugin display name when omitted. */\n\ttitle?: string;\n\t/** Defaults to `\"info\"`; when `error` is set and variant omitted, host uses `\"error\"`. */\n\tvariant?: \"info\" | \"success\" | \"warning\" | \"error\";\n\t/**\n\t * Optional failure cause. Host formats message + stack and adds a\n\t * \"复制堆栈\" action so the user can paste it into bug reports / chat.\n\t */\n\terror?: unknown;\n\t/**\n\t * Auto-dismiss delay in ms. `0` keeps the toast until dismissed.\n\t * Defaults: sticky (`0`) when `error` is present, otherwise host default (~4s).\n\t */\n\tdurationMs?: number;\n}\n\n// ─── Conversation ───\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/** Subscribe to real-time conversation events. */\n\ton(listener: (event: ConversationEvent) => void): Disposable;\n}\n\n// ─── Agent runtime ───\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\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 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\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\n// ─── Files ───\n\nexport 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\n// ─── Command execution ───\n\nexport interface PluginCommandRunOptions {\n\t/** Working directory. Must resolve inside a host-allowed root (e.g. a project). */\n\tcwd?: string;\n\t/** Extra environment entries, merged over the host process env (PATH preserved). */\n\tenv?: Record<string, string>;\n\t/** Hard timeout in ms; the host clamps to its own maximum. */\n\ttimeoutMs?: number;\n}\n\nexport interface PluginCommandRunResult {\n\tstdout: string;\n\tstderr: string;\n\t/** Process exit code; null when the process was killed by a signal/timeout. */\n\texitCode: number | null;\n}\n\n/**\n * Run an allowed host command (e.g. `git`). execFile semantics — NO shell, args\n * are passed as an array (no string splitting, no injection). The executable\n * must be declared in plugin.json's `commands` and currently enabled by the\n * user; otherwise the call is rejected (and the host notifies the user). Needs\n * the `agent.command.run` permission.\n */\nexport interface PluginCommandApi {\n\trun(file: string, args?: string[], options?: PluginCommandRunOptions): Promise<PluginCommandRunResult>;\n}\n\n// ─── Context & definition ───\n\nexport interface PluginPermissionApi {\n\thas(permission: PluginPermission): boolean;\n\trequire(permission: PluginPermission): void;\n}\n\n// ─── Images ───\n\nexport interface PluginGenerateImageInput {\n\tprompt: string;\n\t/** Output size (e.g. \"1024x1024\"), decided by the agent and forwarded to the model. */\n\tsize?: string;\n\t/** Optional reference id for grouping (e.g. the conversation/session). */\n\tsessionId?: string;\n}\n\nexport interface PluginEditImageInput {\n\tprompt: string;\n\t/**\n\t * Source image to edit. Either an existing host image id (continue a\n\t * lineage) or raw base64 bytes (e.g. a user upload).\n\t */\n\tsource: { imageId: string } | { data: string; mimeType: string };\n\tsessionId?: string;\n}\n\n/**\n * Image generation, routed to the host's main-process image service (single\n * implementation shared with the agent's built-in image tool). Bytes are\n * stored out-of-band; results are returned as host media references.\n */\nexport interface PluginImagesApi {\n\t/** Text-to-image. Resolves to the produced image reference(s). */\n\tgenerate(input: PluginGenerateImageInput): Promise<PluginImageRef[]>;\n\t/** Image-to-image edit, producing the next version in a lineage. */\n\tedit(input: PluginEditImageInput): Promise<PluginImageRef[]>;\n\t/** The edit lineage (base image + its edits, oldest first) for an image. */\n\tlineage(imageId: string): Promise<PluginImageRef[]>;\n\t/**\n\t * Every edit lineage the given session touched (generated or edited a version\n\t * in), newest lineage first; each lineage's versions oldest → newest. The\n\t * sessionId is the agent session id — derive it from the active conversation's\n\t * `sessionPath` (the UUID embedded in the session file name).\n\t */\n\tsessionLineages(sessionId: string): Promise<PluginImageRef[][]>;\n}\n\n// ─── Settings ───\n\n/**\n * Read-side access to this plugin's settings (the values configured against\n * the `contributes.settings` schema declared in plugin.json, namespaced by\n * plugin id). Writes go through the host's settings UI, not the plugin.\n */\nexport interface PluginSettingsApi {\n\tget<T = unknown>(key: string): T | undefined;\n\tgetAll(): Record<string, unknown>;\n\t/** Fired when any of this plugin's setting values change. */\n\tonChange(listener: (values: Record<string, unknown>) => void): Disposable;\n}\n\n// ─── i18n ───\n\n/** A flat catalog: translation key → localized string. */\nexport type PluginLocaleCatalog = Record<string, string>;\n/** Every catalog a plugin ships, keyed by locale code (e.g. \"zh\", \"en\"). */\nexport type PluginLocales = Record<string, PluginLocaleCatalog>;\n\n/** Replace `{{name}}` placeholders in a resolved string with `params`. */\nexport function interpolatePluginText(text: string, params?: Record<string, string | number>): string {\n\tif (!params) return text;\n\treturn text.replace(/\\{\\{(\\w+)\\}\\}/g, (match, name: string) => (name in params ? String(params[name]) : match));\n}\n\n/**\n * Resolve a bare catalog key against a plugin's catalogs. Fallback chain:\n * current-locale catalog → the plugin's `defaultLocale` catalog → the bare key\n * itself (a dev signal for a missing translation). Then interpolate `{{params}}`.\n */\nexport function resolveCatalogKey(\n\tkey: string,\n\tlocales: PluginLocales,\n\tcurrentLocale: string,\n\tdefaultLocale: string,\n\tparams?: Record<string, string | number>,\n): string {\n\tconst fromCurrent = locales[currentLocale]?.[key];\n\tconst fromDefault = locales[defaultLocale]?.[key];\n\treturn interpolatePluginText(fromCurrent ?? fromDefault ?? key, params);\n}\n\nconst I18N_KEY_PATTERN = /^%([^%]+)%$/;\n\n/**\n * Resolve a host-rendered plugin string. A value of the exact form `%key%` is a\n * catalog key (resolved via {@link resolveCatalogKey}); any other string is a\n * literal and returned unchanged — backwards compatible with bare strings.\n */\nexport function resolvePluginText(\n\traw: string,\n\tlocales: PluginLocales,\n\tcurrentLocale: string,\n\tdefaultLocale: string,\n\tparams?: Record<string, string | number>,\n): string {\n\tconst match = I18N_KEY_PATTERN.exec(raw);\n\tif (!match) return raw;\n\treturn resolveCatalogKey(match[1], locales, currentLocale, defaultLocale, params);\n}\n\nexport type PluginTranslate = (key: string, params?: Record<string, string | number>) => string;\n\n/**\n * This plugin's i18n surface on the context. `locale` always equals the host's\n * current language; `t` resolves a BARE catalog key (no `%...%` wrapper) against\n * this plugin's catalogs at the current locale. Imperative — for plugin React\n * components prefer the reactive {@link useTranslation} hook.\n */\nexport interface PluginI18nApi {\n\t/** The host's current locale code (e.g. \"zh\"). */\n\treadonly locale: string;\n\t/** Resolve a bare catalog key at the current locale, with optional `{{params}}`. */\n\tt: PluginTranslate;\n\t/** Fired when the host language changes. */\n\tonChange(listener: (locale: string) => void): Disposable;\n}\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\tfs: PluginFsApi;\n\tcommand: PluginCommandApi;\n\timages: PluginImagesApi;\n\tsettings: PluginSettingsApi;\n\ti18n: PluginI18nApi;\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\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\tuseEditImageAttachment(): PluginImageRef | 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\nfunction requireBridge(): PluginHostBridge {\n\tif (!hostBridge) {\n\t\tthrow new Error(\"Vetta plugin host bridge is not installed\");\n\t}\n\treturn hostBridge;\n}\n\n// ─── Activity tab context ───\n\nexport interface ActivityTabContextValue {\n\t/**\n\t * The cwd scope of the activity panel this tab is rendered in — the same\n\t * key the attach record uses. Do NOT substitute useActiveConversation().cwd:\n\t * on the project detail page the panel cwd is the project's, while the\n\t * active conversation may belong to another project (or be null).\n\t */\n\tcwd: string | null;\n}\n\n/**\n * Internal: the host wraps attached activity-tab components in this context's\n * Provider. Module Federation shares this single SDK instance, so the value\n * the host provides is visible to plugin components.\n */\nexport const __ActivityTabContext = createContext<ActivityTabContextValue>({ cwd: null });\n\n/** The panel scope of the activity tab this component is rendered in. */\nexport function useActivityTab(): ActivityTabContextValue {\n\treturn useContext(__ActivityTabContext);\n}\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 image currently bound as the edit target via\n * `ui.setEditImageAttachment` (or null). Single source of truth for the\n * \"selected for edit\" highlight — clears automatically when the host drops the\n * attachment (send, capsule close, or session switch).\n */\nexport function useEditImageAttachment(): PluginImageRef | null {\n\treturn requireBridge().useEditImageAttachment();\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAyEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAsExD,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,sBAAsB,GACtB,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\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\tPluginFsStatResult,\n\tPluginFsReadResult,\n\tPluginFsApi,\n} from \"./fs.js\";\nexport type {\n\tPluginCommandRunOptions,\n\tPluginCommandRunResult,\n\tPluginCommandApi,\n} from \"./command.js\";\nexport type {\n\tPluginImageRef,\n\tPluginGenerateImageInput,\n\tPluginEditImageInput,\n\tPluginImagesApi,\n} from \"./images.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\tuseEditImageAttachment,\n} from \"./hooks.js\";\n"]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP server config declared inside a plugin (stdio or http). Relative paths in
|
|
3
|
+
* stdio `command`/`args`/`cwd` are resolved against the plugin root at contribute time.
|
|
4
|
+
*/
|
|
5
|
+
export type PluginMcpServerConfig = {
|
|
6
|
+
type?: "stdio";
|
|
7
|
+
command: string;
|
|
8
|
+
args?: string[];
|
|
9
|
+
env?: Record<string, string>;
|
|
10
|
+
cwd?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
autoApprove?: string[];
|
|
13
|
+
startupTimeout?: number;
|
|
14
|
+
debug?: boolean;
|
|
15
|
+
displayName?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
/** 该 server 的工具允许出现的工作模式 slug(agent_mode 轴,缺省/空 = 通用)。见 ADR-0046。 */
|
|
18
|
+
agent_mode?: string | string[];
|
|
19
|
+
} | {
|
|
20
|
+
type: "http";
|
|
21
|
+
url: string;
|
|
22
|
+
headers?: Record<string, string>;
|
|
23
|
+
oauthClientId?: string;
|
|
24
|
+
oauthDeviceFlow?: boolean;
|
|
25
|
+
oauthScopes?: string;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
autoApprove?: string[];
|
|
28
|
+
startupTimeout?: number;
|
|
29
|
+
debug?: boolean;
|
|
30
|
+
displayName?: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
/** 该 server 的工具允许出现的工作模式 slug(agent_mode 轴,缺省/空 = 通用)。见 ADR-0046。 */
|
|
33
|
+
agent_mode?: string | string[];
|
|
34
|
+
};
|
|
35
|
+
export interface PluginAgentManifest {
|
|
36
|
+
systemPrompt?: {
|
|
37
|
+
/**
|
|
38
|
+
* Plugin-packaged prompt contribution file paths. Main-process aggregation
|
|
39
|
+
* resolves these relative to the installed plugin root.
|
|
40
|
+
*/
|
|
41
|
+
promptPaths?: string[];
|
|
42
|
+
};
|
|
43
|
+
/** Plugin-packaged skill files or directories to add to the agent resource graph. */
|
|
44
|
+
skillPaths?: string[];
|
|
45
|
+
/**
|
|
46
|
+
* Plugin-scoped MCP servers. Either a relative path to `.mcp.json`
|
|
47
|
+
* (shape `{ mcpServers: { ... } }`) or an inline map of server configs.
|
|
48
|
+
* Requires permission `agent.mcp.control`. Never written into user mcp.json.
|
|
49
|
+
*/
|
|
50
|
+
mcpServers?: string | Record<string, PluginMcpServerConfig>;
|
|
51
|
+
/** Declarative tool visibility policy. Names are tool ids after registration. */
|
|
52
|
+
toolPolicy?: {
|
|
53
|
+
allow?: string[];
|
|
54
|
+
deny?: string[];
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAC9B;IACA,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uHAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC9B,GACD;IACA,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uHAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC9B,CAAC;AAEL,MAAM,WAAW,mBAAmB;IACnC,YAAY,CAAC,EAAE;QACd;;;WAGG;QACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;KACvB,CAAC;IACF,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAC5D,iFAAiF;IACjF,UAAU,CAAC,EAAE;QACZ,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;KAChB,CAAC;CACF","sourcesContent":["/**\n * MCP server config declared inside a plugin (stdio or http). Relative paths in\n * stdio `command`/`args`/`cwd` are resolved against the plugin root at contribute time.\n */\nexport type PluginMcpServerConfig =\n\t| {\n\t\t\ttype?: \"stdio\";\n\t\t\tcommand: string;\n\t\t\targs?: string[];\n\t\t\tenv?: Record<string, string>;\n\t\t\tcwd?: string;\n\t\t\tdisabled?: boolean;\n\t\t\tautoApprove?: string[];\n\t\t\tstartupTimeout?: number;\n\t\t\tdebug?: boolean;\n\t\t\tdisplayName?: string;\n\t\t\tdescription?: string;\n\t\t\t/** 该 server 的工具允许出现的工作模式 slug(agent_mode 轴,缺省/空 = 通用)。见 ADR-0046。 */\n\t\t\tagent_mode?: string | string[];\n\t }\n\t| {\n\t\t\ttype: \"http\";\n\t\t\turl: string;\n\t\t\theaders?: Record<string, string>;\n\t\t\toauthClientId?: string;\n\t\t\toauthDeviceFlow?: boolean;\n\t\t\toauthScopes?: string;\n\t\t\tdisabled?: boolean;\n\t\t\tautoApprove?: string[];\n\t\t\tstartupTimeout?: number;\n\t\t\tdebug?: boolean;\n\t\t\tdisplayName?: string;\n\t\t\tdescription?: string;\n\t\t\t/** 该 server 的工具允许出现的工作模式 slug(agent_mode 轴,缺省/空 = 通用)。见 ADR-0046。 */\n\t\t\tagent_mode?: string | string[];\n\t };\n\nexport interface PluginAgentManifest {\n\tsystemPrompt?: {\n\t\t/**\n\t\t * Plugin-packaged prompt contribution file paths. Main-process aggregation\n\t\t * resolves these relative to the installed plugin root.\n\t\t */\n\t\tpromptPaths?: string[];\n\t};\n\t/** Plugin-packaged skill files or directories to add to the agent resource graph. */\n\tskillPaths?: string[];\n\t/**\n\t * Plugin-scoped MCP servers. Either a relative path to `.mcp.json`\n\t * (shape `{ mcpServers: { ... } }`) or an inline map of server configs.\n\t * Requires permission `agent.mcp.control`. Never written into user mcp.json.\n\t */\n\tmcpServers?: string | Record<string, PluginMcpServerConfig>;\n\t/** Declarative tool visibility policy. Names are tool ids after registration. */\n\ttoolPolicy?: {\n\t\tallow?: string[];\n\t\tdeny?: string[];\n\t};\n}\n"]}
|
package/dist/manifest.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * MCP server config declared inside a plugin (stdio or http). Relative paths in\n * stdio `command`/`args`/`cwd` are resolved against the plugin root at contribute time.\n */\nexport type PluginMcpServerConfig =\n\t| {\n\t\t\ttype?: \"stdio\";\n\t\t\tcommand: string;\n\t\t\targs?: string[];\n\t\t\tenv?: Record<string, string>;\n\t\t\tcwd?: string;\n\t\t\tdisabled?: boolean;\n\t\t\tautoApprove?: string[];\n\t\t\tstartupTimeout?: number;\n\t\t\tdebug?: boolean;\n\t\t\tdisplayName?: string;\n\t\t\tdescription?: string;\n\t\t\t/** 该 server 的工具允许出现的工作模式 slug(agent_mode 轴,缺省/空 = 通用)。见 ADR-0046。 */\n\t\t\tagent_mode?: string | string[];\n\t }\n\t| {\n\t\t\ttype: \"http\";\n\t\t\turl: string;\n\t\t\theaders?: Record<string, string>;\n\t\t\toauthClientId?: string;\n\t\t\toauthDeviceFlow?: boolean;\n\t\t\toauthScopes?: string;\n\t\t\tdisabled?: boolean;\n\t\t\tautoApprove?: string[];\n\t\t\tstartupTimeout?: number;\n\t\t\tdebug?: boolean;\n\t\t\tdisplayName?: string;\n\t\t\tdescription?: string;\n\t\t\t/** 该 server 的工具允许出现的工作模式 slug(agent_mode 轴,缺省/空 = 通用)。见 ADR-0046。 */\n\t\t\tagent_mode?: string | string[];\n\t };\n\nexport interface PluginAgentManifest {\n\tsystemPrompt?: {\n\t\t/**\n\t\t * Plugin-packaged prompt contribution file paths. Main-process aggregation\n\t\t * resolves these relative to the installed plugin root.\n\t\t */\n\t\tpromptPaths?: string[];\n\t};\n\t/** Plugin-packaged skill files or directories to add to the agent resource graph. */\n\tskillPaths?: string[];\n\t/**\n\t * Plugin-scoped MCP servers. Either a relative path to `.mcp.json`\n\t * (shape `{ mcpServers: { ... } }`) or an inline map of server configs.\n\t * Requires permission `agent.mcp.control`. Never written into user mcp.json.\n\t */\n\tmcpServers?: string | Record<string, PluginMcpServerConfig>;\n\t/** Declarative tool visibility policy. Names are tool ids after registration. */\n\ttoolPolicy?: {\n\t\tallow?: string[];\n\t\tdeny?: string[];\n\t};\n}\n"]}
|