@ycodium-ai/plugin-api 0.2.4408 → 0.2.4477

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
@@ -195,14 +195,11 @@ estimate missing durations from messages or token events.
195
195
 
196
196
  - `PluginIcon` (`PluginIconProps` from `@ycodium-ai/plugin-api/ui`) takes `{ name: string; className?: string }` and draws a decorative host-whitelisted icon at font size. Unknown names render nothing.
197
197
 
198
- - `ProjectToolkitSwitch` is a host control with data and dispatch. Its
199
- `ProjectToolkitSwitchProps` (exported from `@ycodium-ai/plugin-api/ui`) accepts only
200
- `environmentId`, `projectId`, and `toolkit` (`board`, `memory`, or `messages`). The plugin places
201
- it; the host reads the switch, supplies the wording, and dispatches as the current person,
202
- because plugins cannot flip these switches themselves. On web and desktop the **Memory**
203
- cell uses the same control. In a mobile plugin WebView without a host connection it renders
204
- nothing. Check that `bridge.ui.ProjectToolkitSwitch` exists before using it; an older host
205
- may not provide it.
198
+ - `bridge.openProjectSettings?.({ environmentId, projectId, section: "agent-tools" })` opens the
199
+ project's **Agent tools** section on web and desktop, selecting the source machine. Omit
200
+ `section` to open the project settings page. The host resolves the project's home machine;
201
+ plugins do not build its route. Mobile has no project settings page and omits this method.
202
+ Project tool switches can only be changed by a person in project settings or through the CLI.
206
203
 
207
204
  A view can also draw the result of one of your own tools in the conversation. Declare it in
208
205
  `ycodium.ui.toolViews` as `{ "tool": "render", "view": "render-result" }`, where `tool` is the
@@ -415,6 +412,10 @@ Each `startSession(input)` receives its own `input.events.emit(event)` channel.
415
412
  channel in the session context; the host assigns event generations. When reusing a process,
416
413
  return its original `bindingGeneration` and keep emitting through its original channel.
417
414
 
415
+ `input.nativeHistory?` carries the main conversation's `{ nativeSessionId, transcriptPath }`
416
+ saved by the host from earlier `thread.metadata.updated` events. Use it only when its native ID
417
+ matches the conversation being resumed; it can fill metadata missing from an earlier send receipt.
418
+
418
419
  The `@ycodium-ai/plugin-api/testing` subpath has no runtime dependencies or test framework.
419
420
  Wrap your executor with `withTestChannels(instance)`, use its session methods, then call
420
421
  `assertGenerationSettled(instance.recorded, generation)`. Assertion failures throw `Error`.
@@ -514,7 +515,25 @@ republish.
514
515
 
515
516
  <!-- plugin-api-versions:start (generated by scripts/gen-plugin-api-version.ts from packages/plugin-api/version-history.json; edit that file) -->
516
517
 
517
- The current API is **115**. This Ycodium loads plugins declaring 111 through 115.
518
+ The current API is **118**. This Ycodium loads only plugins declaring 118.
519
+
520
+ API 118 adds optional `bridge.openProjectSettings({ environmentId, projectId, section })` on web and desktop, and removes the host `ProjectToolkitSwitch` control and its props; project tool switches are managed in project settings
521
+
522
+ API 118 adds the typed ports `ctx.communication.posts.send`, `.withdraw`, `.delete` and `.bind` for the unified post. They are not for plugins yet: a call is refused until the old message ports switch over.
523
+
524
+ API 117 adds `cancelled` to the values of `stages.replied.resolution` on a child session's report: a person or agent answered its approval with cancel. A cancel that came from the session exiting or the provider interrupting the turn stays `expired`. A provider cancelling a question (empty answers or no answer to any asked question) is `expired` too, instead of `answered`.
525
+
526
+ API 117 adds `expired` to the values of `stages.replied.resolution` on a child session's report: the approval or question it carried lapsed without an answer, because the child's session exited, its turn ended or the provider no longer knew the request.
527
+
528
+ API 117 gives `stages.replied` on communication records an optional `resolution` (`approved`, `denied`, `handled`, `answered` or `dismissed`). It appears on a child session's report once the approval or question it carried has been answered, whether by the parent session or by a person; older records and other records leave it out.
529
+
530
+ API 117 gives each pair returned by `communication.wakeLoops.list` an optional `waiting`: how many messages from the other session are held back for the session you asked about while automatic wake-ups are paused. It returns to 0 once a person continues or the session picks them up; older hosts leave it out.
531
+
532
+ API 117 adds the optional executor card capability `blocksHostMcpWritesInAuto`. Declare it when the agent's own CLI refuses the host's MCP tools that write (for example a team member reporting back) in `auto` mode instead of asking; the host then opens a member's session on that agent in `full-access`. Absent means it does not refuse.
533
+
534
+ API 117 adds optional `ExecutorSessionStartInput.nativeHistory` with the main conversation's native ID and transcript path saved by the host. Executors can recover a matching conversation whose opaque resume cursor predates its transcript hook.
535
+
536
+ API 116 adds the typed port `ctx.projects.home.set({ projectId, homeEnvironmentId, requestId? })`, which changes which machine a project is registered to. It is human-only: a plugin cannot be granted it, and a call is refused.
518
537
 
519
538
  API 115 adds `ctx.machineSettings.log.recent()`: the recent warnings and errors in the machine's own server log, newest first, optionally only those about one home machine, and the optional `machineLog` capability on the environment descriptor the machine configuration read returns.
520
539
 
@@ -13,7 +13,7 @@ import type { CommunicationRecordsGetOutput } from "./dataPorts.gen.ts";
13
13
  * 一条通信记录,与客户端读到的同一份。`delivery`:`quiet` 等收件方下次取件,`wake` 叫醒收件方,`steer` 插进
14
14
  * 收件方正在跑的那一轮。`stages.handedOff.certainty`:`confirmed` 是收件方取件了,`not-dispatched` 是还没取,
15
15
  * `unknown` 是投递结果不明(不会重投)。`stages.replied` 带 `recordId` 是收件方那条回信,只有 `turnId` 表示
16
- * 处理它的那一轮结束了。`to` 只有回填的历史团队消息在角色当时没人挂接时才是 null。`text` 只在
16
+ * 处理它的那一轮结束了;子会话回报带的审批或提问被答了时有 `resolution`(批准、拒绝、回答等)。`to` 只有回填的历史团队消息在角色当时没人挂接时才是 null。`text` 只在
17
17
  * `bodyState` 是 `present` 时有;`withdrawn`、`deleted` 是作者或人拿掉了正文,`unavailable` 是正文应该在却读不到。
18
18
  */
19
19
  export type PluginCommunicationRecord = CommunicationRecordsGetOutput[number];
@@ -221,7 +221,7 @@ type Union_14 = {
221
221
  readonly "httpStatus"?: number | undefined;
222
222
  } | null | undefined;
223
223
  type Union_15 = {
224
- readonly "phase": "handling" | "unanswered";
224
+ readonly "phase": "handling" | "unanswered" | "direct";
225
225
  readonly "parentThreadId": string;
226
226
  } | undefined;
227
227
  type Union_16 = {
@@ -417,6 +417,7 @@ type Objects_57 = {
417
417
  readonly "replied": {
418
418
  readonly "recordId"?: string | undefined;
419
419
  readonly "turnId"?: string | undefined;
420
+ readonly "resolution"?: "approved" | "denied" | "handled" | "answered" | "dismissed" | "expired" | "cancelled" | undefined;
420
421
  readonly "at": string;
421
422
  } | null;
422
423
  };
@@ -1104,6 +1105,39 @@ type DatabaseSpaceStatus = {
1104
1105
  readonly "targetBytes": number;
1105
1106
  readonly "unavailableReason": "not-converted" | "reader" | "no-free-pages" | null;
1106
1107
  };
1108
+ type CommunicationPostReplyInput = {
1109
+ readonly "kind": "post";
1110
+ readonly "id": string;
1111
+ } | {
1112
+ readonly "kind": "record";
1113
+ readonly "id": string;
1114
+ } | {
1115
+ readonly "kind": "comment";
1116
+ readonly "id": string;
1117
+ };
1118
+ type CommunicationPostAttachmentPath = {
1119
+ readonly "path": string;
1120
+ readonly "name"?: string;
1121
+ readonly "mimeType"?: string;
1122
+ };
1123
+ type CommunicationPostAttachmentRef = {
1124
+ readonly "attachmentId": string;
1125
+ readonly "name": string;
1126
+ readonly "mimeType"?: string;
1127
+ readonly "sourcePath"?: string;
1128
+ };
1129
+ type CommunicationPostResult = {
1130
+ readonly "postId": string;
1131
+ };
1132
+ type CommunicationPostChange = {
1133
+ readonly "projectId": string;
1134
+ readonly "requestId"?: string;
1135
+ readonly "postId": string;
1136
+ };
1137
+ type CommunicationPostBindResult = {
1138
+ readonly "postId": string;
1139
+ readonly "targetKey": string;
1140
+ };
1107
1141
  type ProjectMachineRemoval_3 = {
1108
1142
  readonly "environmentId": string;
1109
1143
  readonly "removalId": string;
@@ -1164,7 +1198,7 @@ type Objects_189 = {
1164
1198
  readonly "needsRefinement": boolean;
1165
1199
  };
1166
1200
  type Union_67 = {
1167
- readonly "phase": "handling" | "unanswered";
1201
+ readonly "phase": "handling" | "unanswered" | "direct";
1168
1202
  readonly "parentThreadId": string;
1169
1203
  } | undefined;
1170
1204
  type Union_68 = {
@@ -1422,6 +1456,21 @@ type Objects_140 = {
1422
1456
  readonly "kind": "human";
1423
1457
  readonly "principal": Union_33;
1424
1458
  };
1459
+ type CommunicationPostRecipientInput = {
1460
+ readonly "kind": "member";
1461
+ readonly "memberId": string;
1462
+ } | {
1463
+ readonly "kind": "person";
1464
+ readonly "person": Union_33;
1465
+ } | {
1466
+ readonly "kind": "thread";
1467
+ readonly "environmentId": string;
1468
+ readonly "threadId": string;
1469
+ } | {
1470
+ readonly "kind": "principal";
1471
+ readonly "principalId": string;
1472
+ readonly "memberId"?: string;
1473
+ };
1425
1474
  type Objects_126 = {
1426
1475
  readonly "kind": "human";
1427
1476
  readonly "principal": Union_34;
@@ -1464,6 +1513,7 @@ type Arrays_11 = ReadonlyArray<{
1464
1513
  readonly "supportsTurnSteering"?: boolean | undefined;
1465
1514
  readonly "runtimeModeSwitch"?: "in-session" | "next-turn";
1466
1515
  readonly "reportsSpawnedAgents"?: boolean;
1516
+ readonly "blocksHostMcpWritesInAuto"?: boolean;
1467
1517
  readonly "modelSlugAliases"?: Objects_66;
1468
1518
  readonly "enabled": boolean;
1469
1519
  readonly "installed": boolean;
@@ -1884,6 +1934,21 @@ type Arrays_10 = ReadonlyArray<{
1884
1934
  } | null;
1885
1935
  };
1886
1936
  }>;
1937
+ type CommunicationPostAddressInput = {
1938
+ readonly "workItemId": string;
1939
+ } | {
1940
+ readonly "threadId": string;
1941
+ } | Objects_63 | {
1942
+ readonly "principalId": string;
1943
+ readonly "memberId"?: string;
1944
+ } | {
1945
+ readonly "group": {
1946
+ readonly "threadId": string;
1947
+ };
1948
+ };
1949
+ type CommunicationPostBindParticipantInput = {
1950
+ readonly "threadId": string;
1951
+ } | Objects_63 | Objects_64;
1887
1952
  type Union_50 = Objects_140 | Objects_141 | Objects_142 | {
1888
1953
  readonly "kind": "member";
1889
1954
  readonly "memberId": string;
@@ -2605,6 +2670,7 @@ export type CommunicationWakeLoopsListOutput = ReadonlyArray<{
2605
2670
  readonly "halfTrips": number;
2606
2671
  readonly "lastSender": string | null;
2607
2672
  readonly "updatedAt": string;
2673
+ readonly "waiting"?: number;
2608
2674
  }>;
2609
2675
  export type CommunicationWakeLoopsResumeInput = {
2610
2676
  readonly "threadId": string;
@@ -5017,6 +5083,7 @@ export type ProvidersExecutorsListOutput = {
5017
5083
  readonly "discoversRepoSkills"?: boolean | undefined;
5018
5084
  readonly "confirmsToolTermination"?: boolean | undefined;
5019
5085
  readonly "acceptsAdditionalDirectories"?: boolean | undefined;
5086
+ readonly "blocksHostMcpWritesInAuto"?: boolean | undefined;
5020
5087
  readonly "inlineImages"?: {
5021
5088
  readonly "maxBytes": number;
5022
5089
  readonly "maxEdgePixels"?: number | undefined;
@@ -7481,6 +7548,16 @@ export type ProjectsUpdateInput = {
7481
7548
  readonly "defaultFolderId"?: string | null;
7482
7549
  };
7483
7550
  export type ProjectsUpdateOutput = Objects_169;
7551
+ export type ProjectsHomeSetInput = {
7552
+ readonly "requestId"?: string;
7553
+ readonly "projectId": string;
7554
+ readonly "homeEnvironmentId": string;
7555
+ };
7556
+ export type ProjectsHomeSetOutput = {
7557
+ readonly "sequence": number;
7558
+ readonly "result": {};
7559
+ readonly "replayed"?: boolean;
7560
+ };
7484
7561
  export type ProjectsArchiveInput = {
7485
7562
  readonly "requestId"?: string;
7486
7563
  readonly "projectId": string;
@@ -7598,6 +7675,45 @@ export type MachineSettingsDatabaseSpaceStartInput = DatabaseSpaceInput;
7598
7675
  export type MachineSettingsDatabaseSpaceStartOutput = DatabaseSpaceStatus;
7599
7676
  export type MachineSettingsDatabaseSpaceStopInput = DatabaseSpaceInput;
7600
7677
  export type MachineSettingsDatabaseSpaceStopOutput = DatabaseSpaceStatus;
7678
+ export type CommunicationPostsSendInput = {
7679
+ readonly "projectId": string;
7680
+ readonly "requestId"?: string;
7681
+ readonly "to": CommunicationPostAddressInput;
7682
+ readonly "text": string;
7683
+ readonly "replyTo"?: CommunicationPostReplyInput;
7684
+ readonly "delivery"?: "quiet" | "wake" | "steer";
7685
+ readonly "mentions"?: ReadonlyArray<CommunicationPostRecipientInput>;
7686
+ readonly "attachments"?: ReadonlyArray<CommunicationPostAttachmentPath | CommunicationPostAttachmentRef>;
7687
+ };
7688
+ export type CommunicationPostsSendOutput = {
7689
+ readonly "sequence": number;
7690
+ readonly "result": CommunicationPostResult;
7691
+ readonly "replayed"?: boolean;
7692
+ };
7693
+ export type CommunicationPostsWithdrawInput = CommunicationPostChange;
7694
+ export type CommunicationPostsWithdrawOutput = {
7695
+ readonly "sequence": number;
7696
+ readonly "result": CommunicationPostResult;
7697
+ readonly "replayed"?: boolean;
7698
+ };
7699
+ export type CommunicationPostsDeleteInput = CommunicationPostChange;
7700
+ export type CommunicationPostsDeleteOutput = {
7701
+ readonly "sequence": number;
7702
+ readonly "result": CommunicationPostResult;
7703
+ readonly "replayed"?: boolean;
7704
+ };
7705
+ export type CommunicationPostsBindInput = {
7706
+ readonly "projectId": string;
7707
+ readonly "requestId"?: string;
7708
+ readonly "postId": string;
7709
+ readonly "targetKey": string;
7710
+ readonly "to": CommunicationPostBindParticipantInput;
7711
+ };
7712
+ export type CommunicationPostsBindOutput = {
7713
+ readonly "sequence": number;
7714
+ readonly "result": CommunicationPostBindResult;
7715
+ readonly "replayed"?: boolean;
7716
+ };
7601
7717
  export type ProjectsMachinesListEncodedOutput = {
7602
7718
  readonly "accountDiscovery"?: AccountMachineDiscoveryStatus;
7603
7719
  readonly "items": ReadonlyArray<{
@@ -8168,6 +8284,7 @@ export type MachineSettingsProvidersGetEncodedOutput = {
8168
8284
  readonly "supportsTurnSteering"?: boolean | undefined;
8169
8285
  readonly "runtimeModeSwitch"?: "in-session" | "next-turn";
8170
8286
  readonly "reportsSpawnedAgents"?: boolean;
8287
+ readonly "blocksHostMcpWritesInAuto"?: boolean;
8171
8288
  readonly "modelSlugAliases"?: Objects_66;
8172
8289
  readonly "enabled": boolean;
8173
8290
  readonly "installed": boolean;
@@ -8834,6 +8951,12 @@ export interface PluginDataPorts {
8834
8951
  readonly bind: (input: CommunicationDeliveriesBindInput) => Promise<CommunicationDeliveriesBindOutput>;
8835
8952
  readonly listUnbound: (input: CommunicationDeliveriesListUnboundInput) => Promise<CommunicationDeliveriesListUnboundOutput>;
8836
8953
  };
8954
+ readonly posts: {
8955
+ readonly send: (input: CommunicationPostsSendInput) => Promise<CommunicationPostsSendOutput>;
8956
+ readonly withdraw: (input: CommunicationPostsWithdrawInput) => Promise<CommunicationPostsWithdrawOutput>;
8957
+ readonly delete: (input: CommunicationPostsDeleteInput) => Promise<CommunicationPostsDeleteOutput>;
8958
+ readonly bind: (input: CommunicationPostsBindInput) => Promise<CommunicationPostsBindOutput>;
8959
+ };
8837
8960
  };
8838
8961
  readonly machineSettings: {
8839
8962
  readonly browser: {
@@ -9090,6 +9213,9 @@ export interface PluginDataPorts {
9090
9213
  readonly set: (input: ProjectsToolkitsSetInput) => Promise<ProjectsToolkitsSetOutput>;
9091
9214
  };
9092
9215
  readonly update: (input: ProjectsUpdateInput) => Promise<ProjectsUpdateOutput>;
9216
+ readonly home: {
9217
+ readonly set: (input: ProjectsHomeSetInput) => Promise<ProjectsHomeSetOutput>;
9218
+ };
9093
9219
  readonly archive: (input: ProjectsArchiveInput) => Promise<ProjectsArchiveOutput>;
9094
9220
  readonly unarchive: (input: ProjectsUnarchiveInput) => Promise<ProjectsUnarchiveOutput>;
9095
9221
  readonly delete: (input: ProjectsDeleteInput) => Promise<ProjectsDeleteOutput>;