@ycodium-ai/plugin-api 0.2.3377 → 0.2.3391

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
@@ -56,7 +56,7 @@ import { definePlugin } from "@ycodium-ai/plugin-api";
56
56
 
57
57
  export default definePlugin({
58
58
  id: "my-plugin",
59
- apiVersion: 36,
59
+ apiVersion: 37,
60
60
  activate: (ctx) => {
61
61
  ctx.log.info("hello");
62
62
 
@@ -262,12 +262,18 @@ shows up there without anyone registering it.
262
262
 
263
263
  ## THERE WILL BE COMPATIBILITY-BREAKING CHANGES
264
264
 
265
- The definition's `apiVersion` is a closed window: the host loads 36, and refuses every other
265
+ The definition's `apiVersion` is a closed window: the host loads 37, and refuses every other
266
266
  value. Declare the version your plugin targets as a literal; do not read the host's
267
- `PLUGIN_API_VERSION` to make the declaration automatically match. The current API is 36. Plugins
267
+ `PLUGIN_API_VERSION` to make the declaration automatically match. The current API is 37. Plugins
268
268
  targeting an older API are refused before activation; the message names the version the plugin
269
269
  declared and the one this Ycodium loads, and the plugin card offers an update. A plugin that
270
- declares a version newer than 36 is refused until Ycodium itself is updated, with no update button.
270
+ declares a version newer than 37 is refused until Ycodium itself is updated, with no update button.
271
+
272
+ API 37 adds the `work.start` operation to `ctx.operations.guard`: a plugin can refuse a claim
273
+ that takes a work item, or an update that moves it into the started group, before the engine
274
+ commits it. `PluginOperationCheckInput<"work.start">` carries the starter, the route (`claim` or
275
+ `update`) and the assignees before the commit; a refusal comes back as `start-blocked`. No other
276
+ public type changes.
271
277
 
272
278
  API 36 adds `ctx.threads.agents.history.get` and `page` for bounded, read-only agent transcripts.
273
279
  An executor can provide `sessions.openHistory`, whose source pages or follows a native transcript
@@ -545,7 +551,7 @@ An empty page with a cursor still continues. All failures propagate unchanged, i
545
551
  `ThreadNotFoundError` when the thread is missing; use `isThreadNotFound(error)` to identify it.
546
552
  `ctx.communication.inbox.read` is gone; that port always rejected a plugin, because only the agent
547
553
  in the thread has its own inbox. Plugins targeting these earlier versions are refused on the current host;
548
- the minimum version is 36.
554
+ the minimum version is 37.
549
555
 
550
556
  API 8 changed what the UI gets for a communication record. `ConversationCommunicationRecord`
551
557
  (from the conversation host's `useCommunicationRecord`) and `CommunicationViewExchange` carry `bodyState`, and their
package/dist/index.d.ts CHANGED
@@ -54,9 +54,9 @@ export type { PluginDisposer, PluginSettings, PluginCommandReceipt, PluginOperat
54
54
  export type { PluginEnvironment, PluginProviderModel, PluginProviderInstance, PluginProviderNativeSessions, PluginProviders, PluginModelSelection, } from "./pluginContextProviders.ts";
55
55
  export type { PluginWorkspace, PluginProxy, ProxyChoiceOption, PluginRequiredProxySelection, PluginProxySelection, PluginProxies, PluginProject, } from "./pluginContextWorkspace.ts";
56
56
  export type { PluginAttachmentInput, PluginAttachment, PluginAttachments, PluginThreadMessage, PluginThreadSession, PluginThreadOrigin, PluginThreadForkPoint, PluginTurnIntent, PluginThreadExecution, } from "./pluginContextThreads.ts";
57
- export declare const PLUGIN_API_VERSION = 36;
57
+ export declare const PLUGIN_API_VERSION = 37;
58
58
  /**
59
- * 宿主只装载版本 36;ConversationComposerApi.imageCompression 必须使用 prepareFileForAttachment,
59
+ * 宿主只装载版本 37;ConversationComposerApi.imageCompression 必须使用 prepareFileForAttachment,
60
60
  * 不能再调用 isHeicFile 或 prepareForAttachment;大小超限失败带 maxBytes,unreadable 不带。
61
61
  * 成功结果须按 kind 区分 image / file / file-fallback;失败提示须翻译 attachmentPreparationError 的 key 与插值。
62
62
  * plugins.installed.setEnabled 的 force 可选;只有 human / client 调用方能传 force: true;
@@ -80,8 +80,8 @@ export declare const PLUGIN_API_VERSION = 36;
80
80
  * 插件样式 ui.css 多了 --radius-composer;
81
81
  * 第一条插件数据流 threads.subscribeList(逐帧 emit,受 AbortSignal 与插件挂载寿命约束)。
82
82
  */
83
- export declare const PLUGIN_API_MIN_VERSION = 36;
84
- export type PluginApiVersion = 36;
83
+ export declare const PLUGIN_API_MIN_VERSION = 37;
84
+ export type PluginApiVersion = 37;
85
85
  /**
86
86
  * 只读投影查询。写投影是编排的事,插件碰不到。
87
87
  *
package/dist/index.js CHANGED
@@ -10,9 +10,9 @@ export * from "./projects.js";
10
10
  export * from "./threads.js";
11
11
  export * from "./settings-card-shape.js";
12
12
  export { parseRetryAfterMs } from "./usage.js";
13
- export const PLUGIN_API_VERSION = 36;
13
+ export const PLUGIN_API_VERSION = 37;
14
14
  /**
15
- * 宿主只装载版本 36;ConversationComposerApi.imageCompression 必须使用 prepareFileForAttachment,
15
+ * 宿主只装载版本 37;ConversationComposerApi.imageCompression 必须使用 prepareFileForAttachment,
16
16
  * 不能再调用 isHeicFile 或 prepareForAttachment;大小超限失败带 maxBytes,unreadable 不带。
17
17
  * 成功结果须按 kind 区分 image / file / file-fallback;失败提示须翻译 attachmentPreparationError 的 key 与插值。
18
18
  * plugins.installed.setEnabled 的 force 可选;只有 human / client 调用方能传 force: true;
@@ -36,5 +36,5 @@ export const PLUGIN_API_VERSION = 36;
36
36
  * 插件样式 ui.css 多了 --radius-composer;
37
37
  * 第一条插件数据流 threads.subscribeList(逐帧 emit,受 AbortSignal 与插件挂载寿命约束)。
38
38
  */
39
- export const PLUGIN_API_MIN_VERSION = 36;
39
+ export const PLUGIN_API_MIN_VERSION = 37;
40
40
  //# sourceMappingURL=index.js.map
@@ -27,7 +27,7 @@ export interface PluginSettings<Config> {
27
27
  }
28
28
  export type PluginCommandReceipt = ThreadsCommandReceiptsGetOutput;
29
29
  /** 宿主会问插件的操作。只增不删:老插件登记过的名字永远还认。 */
30
- export type PluginOperationName = "server.upgrade" | "project.archive" | "work.assign";
30
+ export type PluginOperationName = "server.upgrade" | "project.archive" | "work.assign" | "work.start";
31
31
  /**
32
32
  * 交给 check 的入参,按操作名分派。`server.upgrade` 带发起升级的会话;
33
33
  * `project.archive` 带即将归档的项目,拿掉这个项目在这台机器上的文件夹时问的也是它。
@@ -51,6 +51,18 @@ export type PluginOperationCheckInput<O extends PluginOperationName = PluginOper
51
51
  readonly added: NonNullable<WorkItemsCreateInput["assignees"]>;
52
52
  /** 回答前须用 derivedState.get({ throughSequence }) 追到此已提交序号。 */
53
53
  readonly throughSequence: number;
54
+ } : O extends "work.start" ? {
55
+ readonly operation: "work.start";
56
+ readonly projectId: string;
57
+ readonly workItemId: string;
58
+ /** 开工的主体:认领人,或把件挪进 started 组的调用者。只会是人、本机 agent 或远端主体。 */
59
+ readonly starter: NonNullable<WorkItemsCreateInput["assignees"]>[number];
60
+ /** `claim`:认领;`update`:改状态从非 started 组进 started 组。 */
61
+ readonly via: "claim" | "update";
62
+ /** 这件提交前的指派。 */
63
+ readonly assignees: NonNullable<WorkItemsCreateInput["assignees"]>;
64
+ /** 回答前须用 derivedState.get({ throughSequence }) 追到此已提交序号。 */
65
+ readonly throughSequence: number;
54
66
  } : never;
55
67
  export interface PluginOperations {
56
68
  /**
@@ -64,6 +76,9 @@ export interface PluginOperations {
64
76
  * - `work.assign` 在引擎串行提交前检查建件带指派、改指派加人及认领,只问新增主体。
65
77
  * 不按会话归属限定;只读、5 秒时限与失败拒绝同 `project.archive`。没有新增主体不问,
66
78
  * 重放不重问。首次拒绝写持久收据,同 requestId 永远返回首次拒绝;解除门槛后须换新 requestId。
79
+ * - `work.start` 在引擎串行提交前检查开工:认领会真领到这件,或改状态从非 started 组进 started 组;
80
+ * 已经由自己做着的空操作不问。排在 `work.assign` 之后,两道都拒时先报指派那句。拒绝码是
81
+ * `start-blocked`;只读、5 秒时限、失败拒绝、持久收据与重放同 `work.assign`。
67
82
  *
68
83
  * 具名声明规则对象时用 `PluginOperationCheckInput<"server.upgrade">` 标 check 的入参。
69
84
  * 不要写 `Parameters<PluginOperations["guard"]>[0]`:泛型 O 取不到具体操作,入参会
@@ -1 +1 @@
1
- {"version":3,"file":"pluginContextCommands.d.ts","sourceRoot":"","sources":["../src/pluginContextCommands.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,0BAA0B,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AC,CAAC,SAAS,mBAAmB,EAAE,KAAK,EAAE;QACrD,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC,EAAE,CAAC;QAClC,QAAQ,CAAC,KAAK,EAAE,CACd,KAAK,EAAE,yBAAyB,CAAC,CAAC,CAAC,KAChC,OAAO,CAAC;YAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAA;SAAE,GAAG;YAAE,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;YAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACjG,KAAK,cAAc,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC,UAAU,CAAC,GAAG;IACzD;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE;QACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE;YACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;YAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;YAC3B,2BAA2B;YAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YACvC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;SAClC,KAAK,OAAO,CACX;YAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAA;SAAE,GAAG;YAAE,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;YAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAClF,CAAC;KACH,KAAK,cAAc,CAAC;CACtB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/plugin-api",
3
- "version": "0.2.3377",
3
+ "version": "0.2.3391",
4
4
  "description": "Types and definePlugin for authoring Ycodium plugins. Zero runtime dependencies.",
5
5
  "keywords": [
6
6
  "ycodium"