@ycodium-ai/plugin-api 0.2.5503 → 0.2.5557

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/README.md CHANGED
@@ -125,8 +125,12 @@ plugins, npm installations, local directories, and temporary plugins. Plugins do
125
125
  to copy the API into their package or depend on a particular installation directory.
126
126
  The host refuses to resolve `@ycodium-ai/plugin-api/version` at runtime.
127
127
 
128
- Browser bundles use the same rule. Map runtime API imports to the host's module table,
129
- `window.__ycodiumPluginHost.modules`, as you map React to the host's React instance.
128
+ Browser bundles use the same rule. Alias `react` to a shim that exports
129
+ `window.__ycodiumPluginHost.react` and its named exports. Alias `react/jsx-runtime` to a
130
+ shim that exports `jsx`, `jsxs`, and `Fragment` from
131
+ `window.__ycodiumPluginHost.jsxRuntime`. This keeps the host and the plugin on the
132
+ same React instance. Map runtime API imports to the host's module table,
133
+ `window.__ycodiumPluginHost.modules`.
130
134
  For example, an alias module for a UI helper can re-export the host value:
131
135
 
132
136
  ```js
@@ -162,7 +166,21 @@ A newer host rejects an old bundle before calling `register`; a new bundle check
162
166
  against an older host inside `register`. The page and the embedded plugin surface use the same
163
167
  exact-version rule. The host bridge version is independent of the server's `PLUGIN_API_VERSION`.
164
168
 
165
- ## Embedded views and host controls
169
+ ## Plugin pages, panels, and embedded views
170
+
171
+ Point `package.json#ycodium.ui.assets` at the asset directory and set `entry` to
172
+ the ESM file within that directory. Default-export a `register(bridge)` function.
173
+ The keys of the returned `pages` and `panels` match their manifest IDs.
174
+ Pages receive no props. Panels receive `environmentId` and `threadId`.
175
+
176
+ Pages get a host header and scroll container by default. Set `chrome: "own"` on a
177
+ page that needs a custom header, and give that page its own responsive layout, scroll
178
+ container, and light/dark background. Loading, failure, and unavailable states are
179
+ rendered by the host. Panels always use the host drawer.
180
+
181
+ A page or panel can declare a host icon or a relative path to a PNG in the asset
182
+ directory. Keep the PNG within 64 KiB and legible in both themes. The host displays
183
+ it as supplied and uses a built-in icon if it cannot load the file.
166
184
 
167
185
  `register(bridge)` can return an optional `views` map alongside `pages` and `panels`.
168
186
  A view has no navigation entry. Its caller supplies the agreed props; the host loads it
@@ -265,11 +283,16 @@ does not expose them.
265
283
 
266
284
  ## Experimental seats
267
285
 
268
- `project.workbench.tab` and `sidebar.project.actions` render on Web and Desktop.
269
- Mobile loads a plugin that registers them and does not draw the seats. The props,
270
- when the host refreshes them, and what happens when a tab throws are experimental.
271
- Do not treat that shape as a stable contract. It will be fixed when the first real
272
- plugin depends on it.
286
+ `project.workbench.tab`, `sidebar.project.actions`, `sidebar.machine.actions` and `machine.overview.section` render on Web
287
+ and Desktop. Declare each seat in the plugin's `ui.seats` permission. A machine overview
288
+ component receives its `environmentId`.
289
+
290
+ To run an action on the selected machine, register a `sidebar.machine.actions` slot with a `titleKey` and
291
+ an `actionView` naming a component in the same registration's `views`. The component receives
292
+ `environmentId` and `onClose`. The host keeps it mounted after
293
+ the menu closes. Call `onClose()` to dismiss it. An optional `disabledReasonKey(context)`
294
+ returns a key in your plugin's catalog or `null` when the action is available. Project actions
295
+ that navigate to a tab or a `hostPage` can keep their existing registration.
273
296
 
274
297
  ## Permissions
275
298
 
@@ -661,7 +684,15 @@ No thread, timeout, interruption or restart cancels the call. Guard callbacks st
661
684
 
662
685
  <!-- plugin-api-versions:start (generated by scripts/gen-plugin-api-version.ts from packages/plugin-api/version-history.json; edit that file) -->
663
686
 
664
- The current API is **173**. This Ycodium loads plugins declaring 166 through 173.
687
+ The current API is **175**. This Ycodium loads plugins declaring 166 through 175.
688
+
689
+ API 175 Executor probes can restrict turn steering for the installed runtime version
690
+
691
+ API 174 adds command roles and data types for machine diagnostics sources reporting trace summaries or process samples, history and collector retries.
692
+
693
+ API 174 adds machine action views that stay mounted after their menu closes and a machine overview section seat for desktop and web.
694
+
695
+ API 174 adds machine-bound registered port forwarding and cancellable command streams for plugin views, and lets plugins declare MCP catalog search commands
665
696
 
666
697
  API 173 validates native-session references and represents an omitted scan directory by an absent key
667
698
 
@@ -86,6 +86,8 @@ export type PluginJsonSchema = Record<string, unknown>;
86
86
  */
87
87
  export type PluginContractName = string;
88
88
  export interface PluginCommand {
89
+ /** 客户端据此从本机已加载插件选择 MCP 目录或诊断数据源。重试采集需要 operate,其余查询需要 read。 */
90
+ readonly role?: "mcp-registry-search" | "diagnostics-trace-summary" | "diagnostics-resource-history" | "diagnostics-resource-retry";
89
91
  /**
90
92
  * 插件内唯一;跨插件由 pluginId 隔开,不会撞名。
91
93
  *
@@ -140,6 +142,8 @@ export declare const MAX_PLUGIN_STREAM_BUFFER = 1024;
140
142
  * 中止表示订阅方挂断,handle 应尽快返回,之后的 emit 会被宿主静默丢弃。
141
143
  */
142
144
  export interface PluginStreamCommand {
145
+ /** 诊断页订阅本机进程采样快照。仅适用于只读流。 */
146
+ readonly role?: "diagnostics-resource-snapshots";
143
147
  /** 与 `PluginCommand.name` 同一张表:重复即抛错,activate 失败。 */
144
148
  readonly name: string;
145
149
  readonly description?: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;AAE5B,sDAAsD;AACtD,MAAM,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAEjD,kEAAkE;AAClE,MAAM,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAEjD,mCAAmC;AACnC,MAAM,MAAM,YAAY,GAAG,iBAAiB,CAAC;AAE7C;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,6BAA6B;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5E,oBAAoB;IACpB,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CA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;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IAC1D;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,CACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,EAC9B,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,uBAAuB,KAChC,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAgJA;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC"}
1
+ {"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAsJA;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC"}
@@ -876,6 +876,7 @@ type Union_49 = ReadonlyArray<string> | undefined;
876
876
  type Arrays_30 = ReadonlyArray<{
877
877
  readonly "kind": "signIn" | "toolkit" | "reactor" | "settingsCard" | "modelPreset" | "command" | "cli" | "interval" | "executor" | "protocolConversion" | "skill" | "filePreviewConverter" | "systemPrompt.section" | "systemPrompt.context" | "messages.beforeSend" | "slashCommand" | "tools.guard" | "ui.seats" | "agentPresets" | "sessionProjections" | "continuation";
878
878
  readonly "name": string;
879
+ readonly "role"?: string;
879
880
  }>;
880
881
  type Union_50 = {
881
882
  readonly "eventsHandled": number;
@@ -6202,7 +6203,7 @@ export type PluginsInstalledListOutput = {
6202
6203
  }>;
6203
6204
  } | Objects_136 | Objects_137 | Objects_138 | Objects_139 | Objects_140 | Objects_141 | Objects_142 | Objects_143 | {
6204
6205
  readonly "kind": "ui.seats";
6205
- readonly "seats": ReadonlyArray<"conversation.view" | "conversation.chat.turnTail" | "conversation.session.header.actions" | "settings.section" | "conversation.hero.agentPreset" | "conversation.input.dock" | "project.workbench.tab" | "sidebar.project.actions" | "team.view">;
6206
+ readonly "seats": ReadonlyArray<"conversation.view" | "conversation.chat.turnTail" | "conversation.session.header.actions" | "settings.section" | "machine.overview.section" | "sidebar.machine.actions" | "conversation.hero.agentPreset" | "conversation.input.dock" | "project.workbench.tab" | "sidebar.project.actions" | "team.view">;
6206
6207
  } | {
6207
6208
  readonly "kind": "commands.dispatch";
6208
6209
  readonly "commands": ReadonlyArray<string>;