@ycodium-ai/plugin-api 0.2.4394 → 0.2.4448

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
@@ -415,6 +415,10 @@ Each `startSession(input)` receives its own `input.events.emit(event)` channel.
415
415
  channel in the session context; the host assigns event generations. When reusing a process,
416
416
  return its original `bindingGeneration` and keep emitting through its original channel.
417
417
 
418
+ `input.nativeHistory?` carries the main conversation's `{ nativeSessionId, transcriptPath }`
419
+ saved by the host from earlier `thread.metadata.updated` events. Use it only when its native ID
420
+ matches the conversation being resumed; it can fill metadata missing from an earlier send receipt.
421
+
418
422
  The `@ycodium-ai/plugin-api/testing` subpath has no runtime dependencies or test framework.
419
423
  Wrap your executor with `withTestChannels(instance)`, use its session methods, then call
420
424
  `assertGenerationSettled(instance.recorded, generation)`. Assertion failures throw `Error`.
@@ -514,7 +518,27 @@ republish.
514
518
 
515
519
  <!-- plugin-api-versions:start (generated by scripts/gen-plugin-api-version.ts from packages/plugin-api/version-history.json; edit that file) -->
516
520
 
517
- The current API is **114**. This Ycodium loads plugins declaring 111 through 114.
521
+ The current API is **117**. This Ycodium loads plugins declaring 111 through 117.
522
+
523
+ 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`.
524
+
525
+ 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.
526
+
527
+ 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.
528
+
529
+ 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.
530
+
531
+ 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.
532
+
533
+ 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.
534
+
535
+ 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.
536
+
537
+ 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.
538
+
539
+ API 115 the machine task create operation can fail with `approval-required` when a person's request for another machine is neither account-trusted nor approved by that machine's owner.
540
+
541
+ API 115 adds an optional `members` list to the thread objects plugins read (`threads.*` outputs): the members, people and sessions that take part in the conversation. Older threads do not carry it, so a plugin must treat its absence as the implied pair of the conversation's own agent and the person who opened it.
518
542
 
519
543
  API 114 adds an optional `memberId` to the `remote-agent` variant of `PluginToolInvocation.caller`: the member the member machine signed for the call and the host verified. It is absent for an older member machine or a machine-level call, and a tool that decides by member must refuse then.
520
544
 
@@ -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];
@@ -167,6 +167,23 @@ type Objects_23 = {
167
167
  readonly "requestedBy": "agent" | "continuation" | "person";
168
168
  readonly "notificationPolicy"?: "wake" | "activity-only" | undefined;
169
169
  };
170
+ type ThreadMemberRef = {
171
+ readonly "kind": "member";
172
+ readonly "memberId": string;
173
+ } | {
174
+ readonly "kind": "person";
175
+ readonly "person": {
176
+ readonly "kind": "account";
177
+ readonly "userId": string;
178
+ } | {
179
+ readonly "kind": "local-owner";
180
+ readonly "environmentId": string;
181
+ };
182
+ } | {
183
+ readonly "kind": "thread";
184
+ readonly "environmentId": string;
185
+ readonly "threadId": string;
186
+ };
170
187
  type Objects_24 = {
171
188
  readonly "userId": string;
172
189
  readonly "displayName": string;
@@ -204,7 +221,7 @@ type Union_14 = {
204
221
  readonly "httpStatus"?: number | undefined;
205
222
  } | null | undefined;
206
223
  type Union_15 = {
207
- readonly "phase": "handling" | "unanswered";
224
+ readonly "phase": "handling" | "unanswered" | "direct";
208
225
  readonly "parentThreadId": string;
209
226
  } | undefined;
210
227
  type Union_16 = {
@@ -400,6 +417,7 @@ type Objects_57 = {
400
417
  readonly "replied": {
401
418
  readonly "recordId"?: string | undefined;
402
419
  readonly "turnId"?: string | undefined;
420
+ readonly "resolution"?: "approved" | "denied" | "handled" | "answered" | "dismissed" | "expired" | "cancelled" | undefined;
403
421
  readonly "at": string;
404
422
  } | null;
405
423
  };
@@ -633,6 +651,16 @@ type Objects_87 = {
633
651
  readonly "inUse": boolean;
634
652
  }>;
635
653
  };
654
+ type MachineLogRecord = {
655
+ readonly "time": string;
656
+ readonly "level"?: string;
657
+ readonly "message"?: unknown;
658
+ readonly "cause"?: string;
659
+ readonly "annotations"?: {
660
+ readonly [x: string]: unknown;
661
+ };
662
+ readonly "clipped"?: boolean;
663
+ };
636
664
  type Arrays_20 = ReadonlyArray<{
637
665
  readonly "id": string;
638
666
  readonly "value": string | boolean;
@@ -1099,6 +1127,23 @@ type Objects_184 = {
1099
1127
  readonly "requestedBy": "agent" | "continuation" | "person";
1100
1128
  readonly "notificationPolicy"?: "wake" | "activity-only" | undefined;
1101
1129
  };
1130
+ type ThreadMemberRef_1 = {
1131
+ readonly "kind": "member";
1132
+ readonly "memberId": string;
1133
+ } | {
1134
+ readonly "kind": "person";
1135
+ readonly "person": {
1136
+ readonly "kind": "account";
1137
+ readonly "userId": string;
1138
+ } | {
1139
+ readonly "kind": "local-owner";
1140
+ readonly "environmentId": string;
1141
+ };
1142
+ } | {
1143
+ readonly "kind": "thread";
1144
+ readonly "environmentId": string;
1145
+ readonly "threadId": string;
1146
+ };
1102
1147
  type Objects_185 = {
1103
1148
  readonly "userId": string;
1104
1149
  readonly "displayName": string;
@@ -1120,7 +1165,7 @@ type Objects_189 = {
1120
1165
  readonly "needsRefinement": boolean;
1121
1166
  };
1122
1167
  type Union_67 = {
1123
- readonly "phase": "handling" | "unanswered";
1168
+ readonly "phase": "handling" | "unanswered" | "direct";
1124
1169
  readonly "parentThreadId": string;
1125
1170
  } | undefined;
1126
1171
  type Union_68 = {
@@ -1279,6 +1324,8 @@ type Objects_173 = {
1279
1324
  };
1280
1325
  type Union_5 = Objects_22 | null | undefined;
1281
1326
  type Union_6 = Objects_23 | null | undefined;
1327
+ type ThreadMembers = ReadonlyArray<ThreadMemberRef>;
1328
+ type ThreadMembers_1 = ReadonlyArray<ThreadMemberRef>;
1282
1329
  type Union_7 = Objects_24 | null | undefined;
1283
1330
  type Union_24 = Objects_24 | null | undefined;
1284
1331
  type Union_9 = ReadonlyArray<Objects_26> | undefined;
@@ -1418,6 +1465,7 @@ type Arrays_11 = ReadonlyArray<{
1418
1465
  readonly "supportsTurnSteering"?: boolean | undefined;
1419
1466
  readonly "runtimeModeSwitch"?: "in-session" | "next-turn";
1420
1467
  readonly "reportsSpawnedAgents"?: boolean;
1468
+ readonly "blocksHostMcpWritesInAuto"?: boolean;
1421
1469
  readonly "modelSlugAliases"?: Objects_66;
1422
1470
  readonly "enabled": boolean;
1423
1471
  readonly "installed": boolean;
@@ -1655,6 +1703,8 @@ type Objects_191 = {
1655
1703
  };
1656
1704
  type Union_73 = Objects_183 | undefined;
1657
1705
  type Union_60 = Objects_184 | null | undefined;
1706
+ type ThreadMembers_2 = ReadonlyArray<ThreadMemberRef_1>;
1707
+ type ThreadMembers_3 = ReadonlyArray<ThreadMemberRef_1>;
1658
1708
  type Union_61 = Objects_185 | null | undefined;
1659
1709
  type Union_72 = Objects_185 | null | undefined;
1660
1710
  type Union_63 = ReadonlyArray<Objects_187> | undefined;
@@ -2275,6 +2325,7 @@ type Objects_192 = {
2275
2325
  readonly "forkedFrom"?: Objects_182 | null | undefined;
2276
2326
  readonly "presetId"?: string | null | undefined;
2277
2327
  readonly "memberId"?: string | undefined;
2328
+ readonly "members"?: ThreadMembers_2;
2278
2329
  readonly "createdBy"?: Union_61;
2279
2330
  readonly "latestTurn": Union_62;
2280
2331
  readonly "stopRequestedAt"?: string | null;
@@ -2340,6 +2391,7 @@ type Objects_16 = {
2340
2391
  readonly "linkedPullRequest"?: Union_5;
2341
2392
  readonly "origin"?: Union_6;
2342
2393
  readonly "presetId"?: string | null | undefined;
2394
+ readonly "members"?: ThreadMembers;
2343
2395
  readonly "createdBy"?: Union_7;
2344
2396
  readonly "latestTurn": Union_8;
2345
2397
  readonly "stopRequestedAt"?: string | null;
@@ -2393,6 +2445,7 @@ type Objects_34 = {
2393
2445
  readonly "forkedFrom"?: Objects_17 | null | undefined;
2394
2446
  readonly "presetId"?: string | null | undefined;
2395
2447
  readonly "memberId"?: string | undefined;
2448
+ readonly "members"?: ThreadMembers;
2396
2449
  readonly "createdBy"?: Union_7;
2397
2450
  readonly "latestTurn": Union_8;
2398
2451
  readonly "stopRequestedAt"?: string | null;
@@ -2554,6 +2607,7 @@ export type CommunicationWakeLoopsListOutput = ReadonlyArray<{
2554
2607
  readonly "halfTrips": number;
2555
2608
  readonly "lastSender": string | null;
2556
2609
  readonly "updatedAt": string;
2610
+ readonly "waiting"?: number;
2557
2611
  }>;
2558
2612
  export type CommunicationWakeLoopsResumeInput = {
2559
2613
  readonly "threadId": string;
@@ -3224,6 +3278,7 @@ export type ThreadsHistoryOutput = {
3224
3278
  readonly "forkedFrom"?: Objects_17 | null | undefined;
3225
3279
  readonly "presetId"?: string | null | undefined;
3226
3280
  readonly "memberId"?: string | undefined;
3281
+ readonly "members"?: ThreadMembers_1;
3227
3282
  readonly "createdBy"?: Objects_24 | null | undefined;
3228
3283
  readonly "latestTurn": Objects_25 | null;
3229
3284
  readonly "stopRequestedAt"?: string | null;
@@ -4653,6 +4708,7 @@ export type MachineSettingsConfigGetOutput = {
4653
4708
  readonly "workBoard"?: boolean;
4654
4709
  readonly "groupMessages"?: boolean;
4655
4710
  readonly "machineTasks"?: boolean;
4711
+ readonly "machineLog"?: boolean;
4656
4712
  readonly "tolerantMachineActions"?: boolean;
4657
4713
  readonly "machineAdmissionIdentityCheck"?: boolean;
4658
4714
  readonly "threadTitleRegeneration"?: boolean;
@@ -4733,6 +4789,20 @@ export type MachineSettingsRuntimeHealthGetInput = {};
4733
4789
  export type MachineSettingsRuntimeHealthGetOutput = Objects_85;
4734
4790
  export type MachineSettingsRuntimeInventoryGetInput = {};
4735
4791
  export type MachineSettingsRuntimeInventoryGetOutput = Objects_87;
4792
+ export type MachineSettingsLogRecentInput = {
4793
+ readonly "minutes"?: number;
4794
+ readonly "levels"?: ReadonlyArray<"WARN" | "ERROR" | "FATAL">;
4795
+ readonly "homeEnvironmentId"?: string;
4796
+ readonly "limit"?: number;
4797
+ };
4798
+ export type MachineSettingsLogRecentOutput = {
4799
+ readonly "enabled": boolean;
4800
+ readonly "records": ReadonlyArray<MachineLogRecord>;
4801
+ readonly "matched": number;
4802
+ readonly "olderRecordsNotScanned"?: boolean;
4803
+ readonly "rotatedDuringScan"?: boolean;
4804
+ readonly "unreadableFiles"?: number;
4805
+ };
4736
4806
  export type MachineSettingsProxiesTestInput = {
4737
4807
  readonly "config": {
4738
4808
  readonly "displayName"?: string;
@@ -4950,6 +5020,7 @@ export type ProvidersExecutorsListOutput = {
4950
5020
  readonly "discoversRepoSkills"?: boolean | undefined;
4951
5021
  readonly "confirmsToolTermination"?: boolean | undefined;
4952
5022
  readonly "acceptsAdditionalDirectories"?: boolean | undefined;
5023
+ readonly "blocksHostMcpWritesInAuto"?: boolean | undefined;
4953
5024
  readonly "inlineImages"?: {
4954
5025
  readonly "maxBytes": number;
4955
5026
  readonly "maxEdgePixels"?: number | undefined;
@@ -7414,6 +7485,16 @@ export type ProjectsUpdateInput = {
7414
7485
  readonly "defaultFolderId"?: string | null;
7415
7486
  };
7416
7487
  export type ProjectsUpdateOutput = Objects_169;
7488
+ export type ProjectsHomeSetInput = {
7489
+ readonly "requestId"?: string;
7490
+ readonly "projectId": string;
7491
+ readonly "homeEnvironmentId": string;
7492
+ };
7493
+ export type ProjectsHomeSetOutput = {
7494
+ readonly "sequence": number;
7495
+ readonly "result": {};
7496
+ readonly "replayed"?: boolean;
7497
+ };
7417
7498
  export type ProjectsArchiveInput = {
7418
7499
  readonly "requestId"?: string;
7419
7500
  readonly "projectId": string;
@@ -7632,6 +7713,7 @@ export type ThreadsListEncodedOutput = {
7632
7713
  readonly "linkedPullRequest"?: Union_59;
7633
7714
  readonly "origin"?: Union_60;
7634
7715
  readonly "presetId"?: string | null | undefined;
7716
+ readonly "members"?: ThreadMembers_2;
7635
7717
  readonly "createdBy"?: Union_61;
7636
7718
  readonly "latestTurn": Union_62;
7637
7719
  readonly "stopRequestedAt"?: string | null;
@@ -7704,6 +7786,7 @@ export type ThreadsHistoryEncodedOutput = {
7704
7786
  readonly "forkedFrom"?: Objects_182 | null | undefined;
7705
7787
  readonly "presetId"?: string | null | undefined;
7706
7788
  readonly "memberId"?: string | undefined;
7789
+ readonly "members"?: ThreadMembers_3;
7707
7790
  readonly "createdBy"?: Objects_185 | null | undefined;
7708
7791
  readonly "latestTurn": Objects_186 | null;
7709
7792
  readonly "stopRequestedAt"?: string | null;
@@ -8099,6 +8182,7 @@ export type MachineSettingsProvidersGetEncodedOutput = {
8099
8182
  readonly "supportsTurnSteering"?: boolean | undefined;
8100
8183
  readonly "runtimeModeSwitch"?: "in-session" | "next-turn";
8101
8184
  readonly "reportsSpawnedAgents"?: boolean;
8185
+ readonly "blocksHostMcpWritesInAuto"?: boolean;
8102
8186
  readonly "modelSlugAliases"?: Objects_66;
8103
8187
  readonly "enabled": boolean;
8104
8188
  readonly "installed": boolean;
@@ -8368,6 +8452,7 @@ export type MachineSettingsConfigGetEncodedOutput = {
8368
8452
  readonly "workBoard"?: boolean;
8369
8453
  readonly "groupMessages"?: boolean;
8370
8454
  readonly "machineTasks"?: boolean;
8455
+ readonly "machineLog"?: boolean;
8371
8456
  readonly "tolerantMachineActions"?: boolean;
8372
8457
  readonly "machineAdmissionIdentityCheck"?: boolean;
8373
8458
  readonly "threadTitleRegeneration"?: boolean;
@@ -8832,6 +8917,9 @@ export interface PluginDataPorts {
8832
8917
  readonly runtimeInventory: {
8833
8918
  readonly get: (input: MachineSettingsRuntimeInventoryGetInput) => Promise<MachineSettingsRuntimeInventoryGetOutput>;
8834
8919
  };
8920
+ readonly log: {
8921
+ readonly recent: (input: MachineSettingsLogRecentInput) => Promise<MachineSettingsLogRecentOutput>;
8922
+ };
8835
8923
  readonly runtime: {
8836
8924
  readonly control: (input: MachineSettingsRuntimeControlInput) => Promise<MachineSettingsRuntimeControlOutput>;
8837
8925
  readonly upgrade: (input: MachineSettingsRuntimeUpgradeInput) => Promise<MachineSettingsRuntimeUpgradeOutput>;
@@ -9017,6 +9105,9 @@ export interface PluginDataPorts {
9017
9105
  readonly set: (input: ProjectsToolkitsSetInput) => Promise<ProjectsToolkitsSetOutput>;
9018
9106
  };
9019
9107
  readonly update: (input: ProjectsUpdateInput) => Promise<ProjectsUpdateOutput>;
9108
+ readonly home: {
9109
+ readonly set: (input: ProjectsHomeSetInput) => Promise<ProjectsHomeSetOutput>;
9110
+ };
9020
9111
  readonly archive: (input: ProjectsArchiveInput) => Promise<ProjectsArchiveOutput>;
9021
9112
  readonly unarchive: (input: ProjectsUnarchiveInput) => Promise<ProjectsUnarchiveOutput>;
9022
9113
  readonly delete: (input: ProjectsDeleteInput) => Promise<ProjectsDeleteOutput>;
@@ -9548,6 +9639,10 @@ export interface PluginUiDataReads {
9548
9639
  readonly input: MachineSettingsRuntimeInventoryGetInput;
9549
9640
  readonly output: MachineSettingsRuntimeInventoryGetOutput;
9550
9641
  };
9642
+ readonly "machineSettings.log.recent": {
9643
+ readonly input: MachineSettingsLogRecentInput;
9644
+ readonly output: MachineSettingsLogRecentOutput;
9645
+ };
9551
9646
  readonly "machineSettings.proxies.test": {
9552
9647
  readonly input: MachineSettingsProxiesTestInput;
9553
9648
  readonly output: MachineSettingsProxiesTestOutput;