@zq-silk/yui 0.15.7 → 0.15.8

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.
Files changed (281) hide show
  1. package/ARCHITECTURE.md +192 -399
  2. package/README.md +127 -1149
  3. package/dist/agent/adapterCatalog.js +15 -2
  4. package/dist/agent/agent.js +23 -3
  5. package/dist/agent/argumentPolicy.js +7 -1
  6. package/dist/agent/connectionPlan.js +62 -0
  7. package/dist/agent/executionComponents.js +158 -0
  8. package/dist/agent/launchEnvironment.js +31 -3
  9. package/dist/agent/managedRuntimeEnvironment.js +3 -5
  10. package/dist/{turn/turn.js → agentRun/agentRun.js} +166 -109
  11. package/dist/{turn/turnIdentity.js → agentRun/runIdentity.js} +4 -4
  12. package/dist/brief/taskBrief.js +12 -0
  13. package/dist/cli/agentConfigurationPicker.js +13 -0
  14. package/dist/cli/commandCatalog.js +157 -70
  15. package/dist/cli/interactionCandidates.js +5 -5
  16. package/dist/cli/interactionPolicy.js +38 -8
  17. package/dist/cli/invocationRouter.js +1 -1
  18. package/dist/cli/managedDiagnostics.js +28 -0
  19. package/dist/cli/operatorWizard.js +1 -7
  20. package/dist/cli/roleOptionOrder.js +27 -0
  21. package/dist/cli/roleWizard.js +50 -14
  22. package/dist/cli/updateOrchestrator.js +1 -1
  23. package/dist/cli/updatePorts.js +3 -4
  24. package/dist/cli.js +178 -95
  25. package/dist/commands/agentCommands.js +72 -14
  26. package/dist/commands/capabilityCommands.js +9 -6
  27. package/dist/commands/configCommands.js +20 -20
  28. package/dist/commands/deliveryGuardPreflight.js +2 -2
  29. package/dist/commands/executionAuditCommands.js +24 -24
  30. package/dist/commands/globalRoleCommands.js +1 -1
  31. package/dist/commands/grantCommands.js +4 -4
  32. package/dist/commands/operatorCommands.js +1 -7
  33. package/dist/commands/projectCommands.js +4 -4
  34. package/dist/commands/resourcesCommands.js +2 -2
  35. package/dist/commands/roleConfiguration.js +25 -5
  36. package/dist/commands/roleRuntimeGuard.js +4 -5
  37. package/dist/commands/sessionCommands.js +3 -7
  38. package/dist/commands/taskActivationCommands.js +259 -0
  39. package/dist/commands/taskActor.js +28 -49
  40. package/dist/commands/taskCommands.js +1188 -710
  41. package/dist/commands/taskContextCommand.js +39 -583
  42. package/dist/commands/taskExecutionCommands.js +32 -32
  43. package/dist/commands/taskInputCommands.js +40 -104
  44. package/dist/commands/taskIntegrationCommands.js +3 -2
  45. package/dist/commands/taskIntegrationQueueCommands.js +1 -1
  46. package/dist/commands/taskNextActionCommand.js +8 -8
  47. package/dist/commands/taskOverviewCommand.js +33 -45
  48. package/dist/commands/taskRemoteDeliveryCommand.js +2 -2
  49. package/dist/commands/taskRoleRuntimeStatus.js +133 -102
  50. package/dist/commands/telemetryCommands.js +36 -38
  51. package/dist/config/configCatalog.js +4 -4
  52. package/dist/config/yuiConfig.js +8 -8
  53. package/dist/context/contextSnapshot.js +10 -10
  54. package/dist/context/dispatchContext.js +11 -11
  55. package/dist/context/roleSessionContext.js +6 -3
  56. package/dist/context/{turnContextPack.js → runContextPack.js} +146 -81
  57. package/dist/context/{turnInputContract.js → runInputContract.js} +73 -60
  58. package/dist/context/sessionBootstrapManifest.js +21 -2
  59. package/dist/context/sourceRunContext.js +30 -0
  60. package/dist/context/taskContext.js +458 -0
  61. package/dist/context/wakeNotification.js +27 -27
  62. package/dist/controller/agentRuntimeObserver.js +21 -24
  63. package/dist/controller/capabilityBridge.js +17 -6
  64. package/dist/controller/clientRuntime.js +65 -92
  65. package/dist/controller/controller.js +114 -188
  66. package/dist/controller/fileSchedulerStoreAdapter.js +787 -887
  67. package/dist/controller/jobControl.js +54 -85
  68. package/dist/controller/resourceInventory.js +8 -27
  69. package/dist/controller/resourceInventoryLinux.js +12 -13
  70. package/dist/controller/runtime.js +529 -479
  71. package/dist/controller/runtimeEventInbox.js +55 -25
  72. package/dist/controller/runtimeEventProcessor.js +22 -31
  73. package/dist/controller/{runtimeHookTurnFence.js → runtimeHookRunFence.js} +91 -115
  74. package/dist/controller/runtimeLaunchCoordinator.js +80 -426
  75. package/dist/controller/runtimeObservationHook.js +14 -18
  76. package/dist/controller/sessionNotify.js +16 -24
  77. package/dist/controller/sessionOwnerReconciliation.js +168 -50
  78. package/dist/controller/structuredProviderObservation.js +138 -99
  79. package/dist/coordination/workMailbox.js +3 -3
  80. package/dist/coordination/workMailboxQueue.js +36 -33
  81. package/dist/core/boundedRpc.js +8 -1
  82. package/dist/core/controllerClient.js +20 -1
  83. package/dist/core/controllerServer.js +4 -4
  84. package/dist/doctor/doctor.js +13 -2
  85. package/dist/domain/agentResultTransport.js +9 -9
  86. package/dist/execution/codexThreadNaming.js +2 -8
  87. package/dist/execution/executionHealth.js +51 -63
  88. package/dist/execution/reviewMainRun.js +137 -0
  89. package/dist/execution/workItemExecution.js +28 -29
  90. package/dist/execution/workItemExecutionProjection.js +99 -107
  91. package/dist/execution/workItemMainRun.js +141 -0
  92. package/dist/executor/agentAdapter.js +227 -20
  93. package/dist/executor/agentConfigurationCatalog.js +126 -4
  94. package/dist/executor/agentConfigurationProbe.js +162 -4
  95. package/dist/executor/agentExecutor.js +79 -78
  96. package/dist/executor/effectiveLaunch.js +105 -18
  97. package/dist/executor/executorRegistry.js +29 -44
  98. package/dist/executor/fileRoleLaunchPlanner.js +229 -154
  99. package/dist/executor/workspacePreflightClassification.js +16 -16
  100. package/dist/grant/capabilityGrant.js +6 -3
  101. package/dist/input/inputRequest.js +12 -10
  102. package/dist/integration/gitIntegrationService.js +4 -11
  103. package/dist/integration/integrationQueueService.js +4 -4
  104. package/dist/interaction/operatorPresentation.js +1 -1
  105. package/dist/kernel/builtinCapabilities.js +247 -12
  106. package/dist/kernel/capabilityRegistry.js +64 -18
  107. package/dist/kernel/instanceHost.js +12 -1
  108. package/dist/kernel/kernelPorts.js +2 -2
  109. package/dist/lifecycle/canonicalLifecycleEvent.js +44 -49
  110. package/dist/lifecycle/exactRunTerminalization.js +449 -0
  111. package/dist/message/message.js +62 -6
  112. package/dist/message/messageContinuation.js +204 -0
  113. package/dist/observability/executionAudit.js +70 -72
  114. package/dist/observability/faultClassification.js +2 -2
  115. package/dist/observability/orchestrationMetrics.js +8 -8
  116. package/dist/operator/operatorSessionHistory.js +1 -7
  117. package/dist/output/agentConfigurationPresentation.js +8 -3
  118. package/dist/output/agentRunConfigurationPresentation.js +128 -0
  119. package/dist/output/rolePresentation.js +54 -3
  120. package/dist/plugins/pluginChild.js +104 -0
  121. package/dist/plugins/pluginIntent.js +26 -0
  122. package/dist/plugins/pluginInterpreter.js +43 -0
  123. package/dist/plugins/pluginPackage.js +101 -0
  124. package/dist/plugins/pluginProcess.js +112 -0
  125. package/dist/plugins/pluginService.js +380 -0
  126. package/dist/profile/agentProfile.js +1 -1
  127. package/dist/repository/gitWorkspace.js +26 -4
  128. package/dist/repository/project.js +19 -4
  129. package/dist/repository/taskBaseFreshness.js +13 -13
  130. package/dist/repository/taskWorkspaceCoordinator.js +20 -27
  131. package/dist/repository/taskWorkspacePreparer.js +344 -83
  132. package/dist/resources/autoResourceGc.js +3 -3
  133. package/dist/resources/liveReferences.js +3 -3
  134. package/dist/resources/projectResource.js +123 -0
  135. package/dist/resources/projectResourceService.js +421 -0
  136. package/dist/resources/resourceDiscovery.js +6 -6
  137. package/dist/resources/resourceGc.js +1 -1
  138. package/dist/resources/resourceRegistrar.js +1 -1
  139. package/dist/resources/resourceTypes.js +1 -1
  140. package/dist/review/deltaRecheck.js +3 -3
  141. package/dist/review/reviewAcceptance.js +16 -16
  142. package/dist/review/reviewDecision.js +7 -7
  143. package/dist/review/reviewRound.js +21 -20
  144. package/dist/review/reviewerAvailability.js +2 -2
  145. package/dist/role/role.js +51 -7
  146. package/dist/role/taskRoleUpdate.js +30 -0
  147. package/dist/runtime/acpProtocol.js +425 -0
  148. package/dist/runtime/acpSession.js +731 -0
  149. package/dist/runtime/acpSessionConfiguration.js +260 -0
  150. package/dist/runtime/agentDriver.js +30 -11
  151. package/dist/runtime/agentEndpoint.js +278 -0
  152. package/dist/runtime/agentEndpointIdentity.js +86 -0
  153. package/dist/runtime/agentEndpointOwnership.js +239 -0
  154. package/dist/runtime/agentError.js +2 -10
  155. package/dist/runtime/agentHost.js +565 -314
  156. package/dist/runtime/agentRunConfiguration.js +258 -0
  157. package/dist/runtime/builtinAgentDrivers.js +134 -18
  158. package/dist/runtime/builtinAgentErrorMappers.js +55 -3
  159. package/dist/runtime/builtinTranscriptUsage.js +1 -1
  160. package/dist/runtime/claude-process-owner +0 -0
  161. package/dist/runtime/codexAppServerRuntime.js +38 -30
  162. package/dist/runtime/codexInteractiveHost.js +41 -6
  163. package/dist/runtime/continuationManager.js +2 -6
  164. package/dist/runtime/executionEnvironment.js +30 -0
  165. package/dist/runtime/firstProgressAdvisory.js +11 -11
  166. package/dist/runtime/index.js +4 -3
  167. package/dist/runtime/jsonLineChannel.js +109 -0
  168. package/dist/runtime/launchBroker.js +91 -16
  169. package/dist/runtime/launchDiagnostics.js +2 -2
  170. package/dist/runtime/lifecycleReservation.js +10 -18
  171. package/dist/runtime/managedCaller.js +61 -17
  172. package/dist/runtime/nativeSessionControl.js +102 -0
  173. package/dist/runtime/ports.js +6 -21
  174. package/dist/runtime/processExitObservation.js +8 -7
  175. package/dist/runtime/promptEnvelope.js +17 -6
  176. package/dist/runtime/providerContinuation.js +3 -9
  177. package/dist/runtime/providerContinuationReconciliationService.js +4 -13
  178. package/dist/runtime/providerControl.js +2 -7
  179. package/dist/runtime/providerRuntimeIdentity.js +110 -222
  180. package/dist/runtime/providerRuntimeReconciler.js +5 -9
  181. package/dist/runtime/runtimeBinding.js +0 -1
  182. package/dist/runtime/runtimeContinuationProjection.js +4 -7
  183. package/dist/runtime/runtimeDeadlines.js +9 -0
  184. package/dist/runtime/runtimeHealthPolicy.js +1 -1
  185. package/dist/runtime/runtimeObservation.js +29 -65
  186. package/dist/runtime/runtimeProjection.js +43 -51
  187. package/dist/runtime/runtimeSessionCandidate.js +1 -3
  188. package/dist/runtime/sessionLaunchRequest.js +3 -7
  189. package/dist/runtime/sessionOwnerIdentity.js +7 -54
  190. package/dist/runtime/sessionOwnerRegistry.js +22 -17
  191. package/dist/runtime/sessionReconciliation.js +4 -8
  192. package/dist/runtime/sessionTerminationGuard.js +70 -259
  193. package/dist/runtime/sessionTokenMetrics.js +5 -16
  194. package/dist/runtime/structuredProviderHost.js +237 -117
  195. package/dist/runtime/taskRuntimeIsolation.js +39 -122
  196. package/dist/runtime/tmuxAdapters.js +39 -86
  197. package/dist/scheduler/activeRoleRunDelivery.js +354 -0
  198. package/dist/scheduler/leaderWakeupProcessor.js +75 -266
  199. package/dist/scheduler/operatorInputNotificationProcessor.js +1 -1
  200. package/dist/scheduler/ports.js +80 -9
  201. package/dist/scheduler/{roleTurnLiveness.js → roleRunLiveness.js} +26 -30
  202. package/dist/scheduler/{roleTurnStall.js → roleRunStall.js} +128 -139
  203. package/dist/scheduler/taskExecutionProjection.js +120 -124
  204. package/dist/scheduler/taskObservabilityProjection.js +29 -29
  205. package/dist/scheduler/taskWake.js +11 -4
  206. package/dist/scheduler/wakeReason.js +9 -1
  207. package/dist/setup/setupCommand.js +1 -0
  208. package/dist/storage/migrations/agentRunContract.js +159 -0
  209. package/dist/storage/migrations/removeRuntimeGeneration.js +207 -0
  210. package/dist/storage/sqliteSchema.js +431 -5
  211. package/dist/storage/sqliteStore.js +375 -220
  212. package/dist/storage/storageVersions.js +1 -1
  213. package/dist/storage/storeRpc.js +10 -5
  214. package/dist/storage/taskStore.js +13 -11
  215. package/dist/storage/upgrade/upgradeOrchestrator.js +5 -7
  216. package/dist/surface/surfaceContributions.js +102 -0
  217. package/dist/task/completionReadiness.js +32 -6
  218. package/dist/task/deliveryGuard.js +16 -16
  219. package/dist/task/draftPlan.js +72 -12
  220. package/dist/task/nextAction.js +144 -128
  221. package/dist/task/remoteDelivery.js +6 -6
  222. package/dist/task/task.js +184 -18
  223. package/dist/task/taskActivation.js +301 -0
  224. package/dist/task/taskActivationService.js +392 -0
  225. package/dist/task/taskRecordReference.js +5 -4
  226. package/dist/task/taskRecordRetirement.js +1 -1
  227. package/dist/telemetry/sqliteTelemetryStore.js +55 -68
  228. package/dist/telemetry/telemetryConfig.js +14 -14
  229. package/dist/telemetry/telemetryWiring.js +2 -2
  230. package/dist/web/assets/assetManifest.js +2 -0
  231. package/dist/web/assets/client/app.js +120 -20
  232. package/dist/web/assets/client/components.js +87 -54
  233. package/dist/web/assets/client/i18n.js +83 -41
  234. package/dist/web/assets/client/markdown.js +1 -1
  235. package/dist/web/assets/client/taskSurface.js +353 -0
  236. package/dist/web/assets/client/view.js +49 -44
  237. package/dist/web/assets/shell.js +1 -1
  238. package/dist/web/assets/styles/cards.js +22 -4
  239. package/dist/web/controllerWeb.js +60 -0
  240. package/dist/web/webMutation.js +28 -0
  241. package/dist/web/webServer.js +118 -8
  242. package/dist/web/webSnapshot.js +81 -74
  243. package/dist/web/webTaskSurface.js +64 -0
  244. package/dist/workItem/dependencyGate.js +1 -1
  245. package/dist/workItem/workItem.js +80 -48
  246. package/dist/workspace/workItemChangeSetManager.js +16 -9
  247. package/docs/agent-result-consumption.md +94 -0
  248. package/docs/agent-runtime-drivers.md +91 -0
  249. package/docs/architecture/README.md +38 -0
  250. package/docs/architecture/capabilities-and-resources.md +79 -0
  251. package/docs/managed-turn-and-session-runtime.md +222 -0
  252. package/docs/observability/README.md +81 -0
  253. package/docs/plugin-sdk.md +290 -0
  254. package/docs/provider-runtime.md +163 -0
  255. package/docs/release-workflow.md +303 -0
  256. package/docs/roles-and-configuration.md +113 -0
  257. package/docs/sqlite-control-plane-design.md +76 -0
  258. package/docs/task-dag-semantics.md +57 -0
  259. package/docs/task-delivery.md +103 -0
  260. package/docs/task-local-identity.md +6 -6
  261. package/docs/testing/verification-levels.md +86 -0
  262. package/i18n/README.zh-CN.md +98 -739
  263. package/package.json +2 -2
  264. package/skills/yui-leader/SKILL.md +130 -103
  265. package/skills/yui-leader/references/integration.md +39 -0
  266. package/skills/yui-leader/references/replicated-execution.md +42 -0
  267. package/skills/yui-leader/references/task-plugins.md +33 -0
  268. package/skills/yui-operator/SKILL.md +30 -59
  269. package/skills/yui-reviewer/SKILL.md +35 -36
  270. package/skills/yui-runtime/SKILL.md +88 -24
  271. package/skills/yui-runtime/references/publication.md +22 -0
  272. package/skills/yui-runtime/references/recovery.md +64 -0
  273. package/skills/yui-worker/SKILL.md +37 -39
  274. package/dist/cli/roleOptionCatalog.js +0 -68
  275. package/dist/context/sourceTurnContext.js +0 -30
  276. package/dist/execution/reviewMainTurn.js +0 -161
  277. package/dist/execution/workItemMainTurn.js +0 -164
  278. package/dist/lifecycle/exactTurnTerminalization.js +0 -407
  279. package/dist/runtime/preallocatedNativeSession.js +0 -13
  280. package/dist/runtime/runtimeStopReceipt.js +0 -42
  281. package/dist/scheduler/activeRoleTurnDelivery.js +0 -315
@@ -1,4 +1,5 @@
1
1
  import { supportedAgentAdapterIds } from "../agent/adapterCatalog.js";
2
+ import { supportedAgentExecutionComponentIds } from "../agent/executionComponents.js";
2
3
  import { CONFIG_DEFINITIONS, CONFIG_DOMAINS, configDefinitionsForDomain } from "../config/configCatalog.js";
3
4
  function buildNode(input, parentPath = []) {
4
5
  const path = [...parentPath, input.name];
@@ -101,10 +102,13 @@ function durableConfigDomainNode(domain) {
101
102
  const agentChildren = [
102
103
  {
103
104
  name: "add",
104
- summary: "Add a configured native Agent CLI.",
105
- usage: "yui config agent add <id> [--adapter <adapter>] --command <command> [--arg <arg> ...] [--env TARGET=PROCESS_NAME ...]",
106
- options: ["--adapter", "--command", "--arg", "--env"],
107
- optionValues: { "--adapter": supportedAgentAdapterIds() },
105
+ summary: "Add a configured Agent execution component.",
106
+ usage: "yui config agent add <id> [--component <component>] [--adapter <adapter>] --command <command> [--arg <arg> ...] [--env TARGET=PROCESS_NAME ...]",
107
+ options: ["--component", "--adapter", "--command", "--arg", "--env"],
108
+ optionValues: {
109
+ "--component": supportedAgentExecutionComponentIds(),
110
+ "--adapter": supportedAgentAdapterIds()
111
+ },
108
112
  executableOptions: ["--command"]
109
113
  },
110
114
  { name: "list", summary: "List configured Agents." },
@@ -117,9 +121,12 @@ const agentChildren = [
117
121
  {
118
122
  name: "update",
119
123
  summary: "Update a configured Agent.",
120
- usage: "yui config agent update <id> [--adapter <adapter>] [--command <command>] [--arg <arg> ... | --clear-args] [--env TARGET=PROCESS_NAME ... | --clear-env]",
121
- options: ["--adapter", "--command", "--arg", "--clear-args", "--env", "--clear-env", "--yes"],
122
- optionValues: { "--adapter": supportedAgentAdapterIds() },
124
+ usage: "yui config agent update <id> [--component <component>] [--adapter <adapter>] [--command <command>] [--arg <arg> ... | --clear-args] [--env TARGET=PROCESS_NAME ... | --clear-env]",
125
+ options: ["--component", "--adapter", "--command", "--arg", "--clear-args", "--env", "--clear-env", "--yes"],
126
+ optionValues: {
127
+ "--component": supportedAgentExecutionComponentIds(),
128
+ "--adapter": supportedAgentAdapterIds()
129
+ },
123
130
  executableOptions: ["--command"]
124
131
  },
125
132
  { name: "remove", summary: "Remove a configured Agent.", usage: "yui config agent remove <id>" }
@@ -282,6 +289,35 @@ const taskChildren = [
282
289
  }
283
290
  },
284
291
  { name: "activate", summary: "Activate a Draft Task.", usage: "yui task activate <id>" },
292
+ {
293
+ name: "activation",
294
+ summary: "Request, cancel or inspect explicit Task Activation.",
295
+ sections: [{ id: "manage", title: "Commands", entries: ["request", "cancel", "show"] }],
296
+ children: [
297
+ {
298
+ name: "request",
299
+ summary: "Record an Activation request. empty adds no extra environment (bound Projects still get managed worktrees); scratch creates a Task directory; local requires a registered Resource and grant, not a Project ID.",
300
+ usage: "yui task activation request <task> --request-id <id> "
301
+ + "--environment <empty|scratch|local:<resource>:<read|write>>",
302
+ options: ["--request-id", "--environment"],
303
+ examples: [
304
+ "yui task activation request <task> --request-id start-1 --environment empty",
305
+ "yui task activation request <gitless-task> --request-id start-1 --environment scratch"
306
+ ]
307
+ },
308
+ {
309
+ name: "cancel",
310
+ summary: "Cancel a pending Activation request so it is never adopted.",
311
+ usage: "yui task activation cancel <task> --request-id <id> --reason <text>",
312
+ options: ["--request-id", "--reason"]
313
+ },
314
+ {
315
+ name: "show",
316
+ summary: "Show the Task's Activation request and its disposition.",
317
+ usage: "yui task activation show <task>"
318
+ }
319
+ ]
320
+ },
285
321
  {
286
322
  name: "execution",
287
323
  summary: "Fence or resume all execution for a Task.",
@@ -303,8 +339,8 @@ const taskChildren = [
303
339
  {
304
340
  name: "complete",
305
341
  summary: "Complete an active Task and stop automatic wakeups.",
306
- usage: "yui task complete <id> (--summary <text>|--summary-file <path|->) [--refresh-remote] [--accept-published-tree <publication-id>]",
307
- options: ["--summary", "--summary-file", "--refresh-remote", "--accept-published-tree"],
342
+ usage: "yui task complete <id> (--summary <text>|--summary-file <path|->) [--artifact-ref <artifact-id|turn:id|url> ...] [--refresh-remote] [--accept-published-tree <publication-id>]",
343
+ options: ["--summary", "--summary-file", "--artifact-ref", "--refresh-remote", "--accept-published-tree"],
308
344
  fileOptions: ["--summary-file"]
309
345
  },
310
346
  {
@@ -320,7 +356,14 @@ const taskChildren = [
320
356
  }
321
357
  ]
322
358
  },
323
- { name: "reopen", summary: "Reopen a completed Task.", usage: "yui task reopen <id>" },
359
+ { name: "reopen", summary: "Explicitly reopen completed or cancelled intent without replaying historical inputs.", usage: "yui task reopen <id>" },
360
+ {
361
+ name: "cancel",
362
+ summary: "Stop pursuing a Task without claiming its processes stopped.",
363
+ usage: "yui task cancel <task> (--summary <text>|--summary-file <path|->)",
364
+ options: ["--summary", "--summary-file"],
365
+ fileOptions: ["--summary-file"]
366
+ },
324
367
  {
325
368
  name: "retire",
326
369
  summary: "Retire a stale Task while preserving its historical evidence.",
@@ -335,10 +378,21 @@ const taskChildren = [
335
378
  options: ["--all", "--verbose"]
336
379
  },
337
380
  { name: "show", summary: "Show a Task.", usage: "yui task show <id>" },
381
+ {
382
+ name: "artifact",
383
+ summary: "Save fixed Task results and read history without the original Runtime.",
384
+ sections: [{ id: "manage", title: "Commands", entries: ["list", "show", "save"] }],
385
+ children: [
386
+ { name: "list", summary: "List saved Task artifacts.", usage: "yui task artifact list <task>" },
387
+ { name: "show", summary: "Read one saved artifact.", usage: "yui task artifact show <task> <artifact-id>" },
388
+ { name: "save", summary: "Save content, a version, receipt, or reference.", usage: "yui task artifact save <task> <artifact-json>" }
389
+ ]
390
+ },
338
391
  {
339
392
  name: "context",
340
- summary: "Show consolidated working context for a Task.",
341
- usage: "yui task context <task>"
393
+ summary: "Read compact authorized facts, fixed-bound delta, or inspect a Context reference.",
394
+ usage: "yui task context [read|delta|inspect] <task> [--after <cursor>] [--continuation <cursor>] [--limit <n>] [--store <store> --ref <id>] [--digest <digest>]",
395
+ options: ["--after", "--continuation", "--limit", "--store", "--ref", "--digest"]
342
396
  },
343
397
  {
344
398
  name: "next-action",
@@ -381,13 +435,19 @@ const taskChildren = [
381
435
  {
382
436
  name: "message",
383
437
  summary: "Manage durable Task messages.",
384
- sections: [{ id: "manage", title: "Commands", entries: ["send", "list", "update", "retire"] }],
438
+ sections: [{ id: "manage", title: "Commands", entries: ["send", "handoff", "list", "show", "update", "retire"] }],
385
439
  children: [
440
+ {
441
+ name: "handoff",
442
+ summary: "Explicitly hand an unassigned Message to the current dispatched owner of the same work.",
443
+ usage: "yui task message handoff <task/message> --to <role>",
444
+ options: ["--to"]
445
+ },
386
446
  {
387
447
  name: "send",
388
448
  summary: "Send a Task message.",
389
- usage: "yui task message send <id> (<body>|--body-file <path|->) [--wake-policy leader|none]",
390
- options: ["--body-file", "--wake-policy"],
449
+ usage: "yui task message send <id> (<body>|--body-file <path|->) [--wake-policy leader|none] [--to <role> --work-item <id>|--review-round <id>]",
450
+ options: ["--body-file", "--wake-policy", "--to", "--work-item", "--review-round"],
391
451
  optionValues: {
392
452
  "--wake-policy": ["leader", "none"]
393
453
  },
@@ -399,6 +459,11 @@ const taskChildren = [
399
459
  usage: "yui task message list <id> [--after <timestamp>] [--limit <n>]",
400
460
  options: ["--after", "--limit"]
401
461
  },
462
+ {
463
+ name: "show",
464
+ summary: "Read a scoped Message and expand its single execution result.",
465
+ usage: "yui task message show <task>/<message>"
466
+ },
402
467
  {
403
468
  name: "update",
404
469
  summary: "Replace the mutable body and wake policy of a Draft user/operator Message.",
@@ -424,7 +489,7 @@ const taskChildren = [
424
489
  children: [
425
490
  {
426
491
  name: "request",
427
- summary: "Pause the active Leader Turn and request user input.",
492
+ summary: "Pause the active Leader AgentRun and request user input.",
428
493
  usage: "yui task input request <task> --question <text> [--choice <key=label> ...] [--blocks <work-item:id|turn:id> ...] [--recommend <key> --timeout-seconds <seconds>]",
429
494
  options: ["--question", "--choice", "--blocks", "--recommend", "--timeout-seconds"]
430
495
  },
@@ -576,8 +641,8 @@ const taskChildren = [
576
641
  {
577
642
  name: "update",
578
643
  summary: "Update a Task Role; Agent settings target the named or active binding without switching it.",
579
- usage: "yui task role update <task> <role> [--profile <id>] [--agent <id>] [Role and Agent settings]",
580
- options: ["--profile", "--agent", ...roleProfileOptions, ...roleAgentOptions,
644
+ usage: "yui task role update <task> <role> [--profile <id>] [--agent <id>] [--environment <preparation-id> | --managed-environment] [Role and Agent settings]",
645
+ options: ["--profile", "--agent", "--environment", "--managed-environment", ...roleProfileOptions, ...roleAgentOptions,
581
646
  ...roleProfileClearOptions, ...roleAgentClearOptions, "--yes"],
582
647
  optionValues: roleAgentOptionValues
583
648
  },
@@ -586,20 +651,26 @@ const taskChildren = [
586
651
  { name: "unbind", summary: "Unbind a dormant Agent from a Task Role.", usage: "yui task role unbind <task> <role> <agent-id>" },
587
652
  {
588
653
  name: "session",
589
- summary: "Inspect or stop one Task Role's native Session.",
654
+ summary: "Inspect, stop or explicitly select a new Task Role Session.",
590
655
  executable: true,
591
- sections: [{ id: "manage", title: "Commands", entries: ["inspect", "stop"] }],
656
+ sections: [{ id: "manage", title: "Commands", entries: ["inspect", "stop", "new"] }],
592
657
  children: [
593
658
  {
594
659
  name: "inspect",
595
- summary: "Read the current Session, Host activation, and Turn facts.",
660
+ summary: "Read the current Session, Host process, and AgentRun facts.",
596
661
  usage: "yui task role session inspect <task> <role>"
597
662
  },
598
663
  {
599
664
  name: "stop",
600
- summary: "Stop one idle Session and its exact Host activation.",
665
+ summary: "Stop the exact Session execution and retain its conversation for possible reuse; preserve Task progress.",
601
666
  usage: "yui task role session stop <task> <role> --reason <text>",
602
667
  options: ["--reason"]
668
+ },
669
+ {
670
+ name: "new",
671
+ summary: "Request replacement even for active or ended Sessions; stop exact execution and preserve Task context, results and workspaces.",
672
+ usage: "yui task role session new <task> <role> --reason <text>",
673
+ options: ["--reason"]
603
674
  }
604
675
  ]
605
676
  },
@@ -627,7 +698,7 @@ const taskChildren = [
627
698
  id: "manage",
628
699
  title: "Commands",
629
700
  entries: [
630
- "create", "list", "show", "edit", "update", "scope", "dispatch", "isolate", "capture", "cleanup",
701
+ "create", "list", "show", "edit", "update", "scope", "dispatch", "synthesize", "isolate", "capture", "cleanup",
631
702
  "review", "accept", "reject", "retire"
632
703
  ]
633
704
  }],
@@ -642,7 +713,7 @@ const taskChildren = [
642
713
  { name: "show", summary: "Show one Work Item.", usage: "yui task work show <work>" },
643
714
  {
644
715
  name: "edit",
645
- summary: "Replace mutable definition fields on an execution-free Draft WorkItem.",
716
+ summary: "Edit current requirements without changing frozen Assignments or acceptance.",
646
717
  usage: "yui task work edit <task>/<work> [--title <text>] [--objective <text>] [--accept <criterion> ...|--clear-acceptance] [--after <work> ...|--clear-dependencies] [--project <project> ...|--clear-projects] [--base-ref <project>=<ref> ...|--clear-base-refs] [--role <name>|--clear-role]",
647
718
  options: [
648
719
  "--title", "--objective", "--accept", "--clear-acceptance",
@@ -652,9 +723,9 @@ const taskChildren = [
652
723
  },
653
724
  {
654
725
  name: "update",
655
- summary: "Update a work item's state.",
656
- usage: "yui task work update <task>/<work> <todo|running|done|failed> [--summary <text>]",
657
- options: ["--summary"],
726
+ summary: "Record progress or submit a Candidate; acceptance remains explicit.",
727
+ usage: "yui task work update <task>/<work> <todo|running|done|failed> [--summary <text>] [--artifact-ref <artifact-id> ...]",
728
+ options: ["--summary", "--artifact-ref"],
658
729
  argumentValues: {
659
730
  1: ["todo", "running", "done", "failed"]
660
731
  }
@@ -671,6 +742,12 @@ const taskChildren = [
671
742
  usage: "yui task work dispatch <task>/<work> [--input <text>] [--lane-role <role> ...]",
672
743
  options: ["--input", "--lane-role"]
673
744
  },
745
+ {
746
+ name: "synthesize",
747
+ summary: "Dispatch synthesis over explicitly selected original Producer AgentRuns.",
748
+ usage: "yui task work synthesize <task>/<work> --source-run <task>/<run> ...",
749
+ options: ["--source-run"]
750
+ },
674
751
  {
675
752
  name: "isolate",
676
753
  summary: "Create a WorkItem-owned isolated worktree.",
@@ -700,7 +777,7 @@ const taskChildren = [
700
777
  children: [
701
778
  {
702
779
  name: "retry",
703
- summary: "Retry a failed Task-final ReviewRound that has no Reviewer Turn.",
780
+ summary: "Retry a failed Task-final ReviewRound that has no Reviewer AgentRun.",
704
781
  usage: "yui task work review retry <task>/<review-round>"
705
782
  },
706
783
  {
@@ -718,87 +795,93 @@ const taskChildren = [
718
795
  {
719
796
  name: "accept",
720
797
  summary: "Accept a successful, validated, integrated Work Item.",
721
- usage: "yui task work accept <task>/<work> --summary <text>",
722
- options: ["--summary"]
798
+ usage: "yui task work accept <task>/<work> --summary <text> [--candidate <id>]",
799
+ options: ["--summary", "--candidate"]
723
800
  },
724
801
  {
725
802
  name: "reject",
726
- summary: "Reject an awaiting Work Item so it can be retried.",
803
+ summary: "Decline a result or withdraw acceptance while preserving its history.",
727
804
  usage: "yui task work reject <task>/<work> --summary <text>",
728
805
  options: ["--summary"]
729
806
  },
730
807
  {
731
808
  name: "retire",
732
- summary: "Retire a WorkItem and settle its exact Turns.",
809
+ summary: "Retire a WorkItem and settle its exact AgentRuns.",
733
810
  usage: "yui task work retire <work> --summary <text> [--replacement <work>]",
734
811
  options: ["--summary", "--replacement"]
735
812
  }
736
813
  ]
737
814
  },
738
815
  {
739
- name: "turn",
740
- summary: "Inspect and control Task Role Turns.",
816
+ name: "run",
817
+ summary: "Inspect and control Task Role AgentRuns.",
741
818
  sections: [{ id: "manage", title: "Commands", entries: ["list", "show", "retry", "settle", "context", "checkpoint", "retire"] }],
742
819
  children: [
743
- { name: "list", summary: "List all Turns for a Task or one WorkItem.", usage: "yui task turn list <task|task/work>" },
820
+ { name: "list", summary: "List all AgentRuns for a Task or one WorkItem.", usage: "yui task run list <task|task/work>" },
744
821
  {
745
822
  name: "show",
746
- summary: "Show one Turn and its retained audit evidence.",
747
- usage: "yui task turn show <task>/<turn> [--json]"
823
+ summary: "Show one AgentRun and its retained audit evidence.",
824
+ usage: "yui task run show <task>/<run> [--json]"
748
825
  },
749
826
  {
750
827
  name: "retry",
751
- summary: "Retry an exact failed execution or review Turn while preserving its semantic unit.",
752
- usage: "yui task turn retry <task>/<turn>"
828
+ summary: "Retry an exact failed execution or review AgentRun while preserving its semantic unit.",
829
+ usage: "yui task run retry <task>/<run>"
753
830
  },
754
831
  {
755
832
  name: "settle",
756
- summary: "Explicitly settle a failed WorkItem Lane or an obsolete stranded final Review Turn.",
757
- usage: "yui task turn settle <task>/<turn>"
833
+ summary: "Explicitly settle a failed WorkItem Lane or an obsolete stranded final Review AgentRun.",
834
+ usage: "yui task run settle <task>/<run>"
758
835
  },
759
836
  {
760
837
  name: "context",
761
- summary: "Load the exact authorized Turn context.",
762
- usage: "yui task turn context <task>/<turn> [--json]",
838
+ summary: "Load the exact authorized AgentRun context.",
839
+ usage: "yui task run context <task>/<run> [--json]",
763
840
  executable: true,
764
841
  hidden: true,
765
842
  sections: [{ id: "load", title: "Commands", entries: ["expand", "delta"] }],
766
843
  children: [
767
844
  {
768
845
  name: "expand",
769
- summary: "Expand one authorized Turn context reference.",
770
- usage: "yui task turn context expand <task>/<turn> <ref-id> [--store <store>] [--mode full]",
846
+ summary: "Expand one authorized AgentRun context reference.",
847
+ usage: "yui task run context expand <task>/<run> <ref-id> [--store <store>] [--mode full]",
771
848
  options: ["--store", "--mode"]
772
849
  },
773
850
  {
774
851
  name: "delta",
775
- summary: "Load authorized Turn context changes after a cursor.",
776
- usage: "yui task turn context delta <task>/<turn> --after <cursor>",
852
+ summary: "Load authorized AgentRun context changes after a cursor.",
853
+ usage: "yui task run context delta <task>/<run> --after <cursor>",
777
854
  options: ["--after"]
778
855
  }
779
856
  ]
780
857
  },
781
858
  {
782
859
  name: "checkpoint",
783
- summary: "Record durable progress for a long-running Turn.",
784
- usage: "yui task turn checkpoint <turn> (--note <text>|--note-file <path|->)",
860
+ summary: "Record durable progress for a long-running AgentRun.",
861
+ usage: "yui task run checkpoint <run> (--note <text>|--note-file <path|->)",
785
862
  options: ["--note", "--note-file"],
786
863
  fileOptions: ["--note-file"],
787
864
  hidden: true
788
865
  },
789
866
  {
790
867
  name: "retire",
791
- summary: "Retire an incorrect historical Turn without deleting its audit record.",
792
- usage: "yui task turn retire <task>/<turn> --reason <text> [--expected-progress-at <timestamp>] [--agent-id <id>] [--adapter-id <id>] [--native-session-id <id>] [--launch-id <id>]",
793
- options: ["--reason", "--expected-progress-at", "--progress-at", "--agent-id", "--adapter-id", "--native-session-id", "--launch-id"]
868
+ summary: "Retire an incorrect historical AgentRun without deleting its audit record.",
869
+ usage: "yui task run retire <task>/<run> --reason <text> [--expected-progress-at <timestamp>] [--agent-id <id>] [--adapter-id <id>] [--native-session-id <id>]",
870
+ options: ["--reason", "--expected-progress-at", "--progress-at", "--agent-id", "--adapter-id", "--native-session-id"]
794
871
  }
795
872
  ]
796
873
  },
797
874
  {
798
875
  name: "review",
799
876
  summary: "Control Task-final ReviewRounds.",
800
- sections: [{ id: "manage", title: "Commands", entries: ["request", "retry"] }],
877
+ sections: [{ id: "manage", title: "Commands", entries: ["request", "synthesize", "retry"] }],
801
878
  children: [
879
+ {
880
+ name: "synthesize",
881
+ summary: "Dispatch main Review over selected Producer AgentRuns and the frozen candidate.",
882
+ usage: "yui task review synthesize <task>/<review-round> --source-run <task>/<run> ...",
883
+ options: ["--source-run"]
884
+ },
802
885
  {
803
886
  name: "request",
804
887
  summary: "Request a direct or replicated Task-local final ReviewRound.",
@@ -807,7 +890,7 @@ const taskChildren = [
807
890
  },
808
891
  {
809
892
  name: "retry",
810
- summary: "Retry a failed Task-final ReviewRound without a Reviewer Turn.",
893
+ summary: "Retry a failed Task-final ReviewRound without a Reviewer AgentRun.",
811
894
  usage: "yui task review retry <task>/<review-round>"
812
895
  }
813
896
  ]
@@ -826,7 +909,7 @@ const taskChildren = [
826
909
  },
827
910
  {
828
911
  name: "continue",
829
- summary: "Continue a Leader-approved manual resolution.",
912
+ summary: "Consume a finished check Job and finalize this exact Integration, or continue an approved manual resolution.",
830
913
  usage: "yui task integration continue <task>/<integration>"
831
914
  },
832
915
  {
@@ -953,10 +1036,12 @@ const taskChildren = [
953
1036
  {
954
1037
  name: "wake",
955
1038
  summary: "Inspect the durable Leader wake ledger and its delta content.",
956
- sections: [{ id: "manage", title: "Commands", entries: ["list", "show"] }],
1039
+ sections: [{ id: "manage", title: "Commands", entries: ["list", "show", "resolve"] }],
957
1040
  children: [
958
1041
  { name: "list", summary: "List recorded Leader wakes.", usage: "yui task wake list <task>" },
959
- { name: "show", summary: "Show one wake and its delta content.", usage: "yui task wake show <task> <wake>" }
1042
+ { name: "show", summary: "Show one wake and its delta content.", usage: "yui task wake show <task> <wake>" },
1043
+ { name: "resolve", summary: "Release an unknown notification claim after explicit quiescence evidence, without replay.",
1044
+ usage: "yui task wake resolve <task> <wake> --reason <quiescence-evidence>", options: ["--reason"] }
960
1045
  ]
961
1046
  },
962
1047
  {
@@ -1007,9 +1092,9 @@ export const ROOT_COMMAND = buildNode({
1007
1092
  { name: "doctor", summary: "Check Yui dependencies and file state." },
1008
1093
  {
1009
1094
  name: "web",
1010
- summary: "Serve the local Task and Agent control room.",
1011
- usage: "yui web [--host <loopback>] [--port <port>]",
1012
- options: ["--host", "--port"]
1095
+ summary: "Serve the control room using the running Controller's capability Host.",
1096
+ usage: "yui web [--host <loopback>] [--port <port>] | --status | --stop",
1097
+ options: ["--host", "--port", "--status", "--stop"]
1013
1098
  },
1014
1099
  {
1015
1100
  name: "controller",
@@ -1039,7 +1124,7 @@ export const ROOT_COMMAND = buildNode({
1039
1124
  },
1040
1125
  {
1041
1126
  name: "live-identity",
1042
- summary: "Read the authenticated live Controller runtime generation identity.",
1127
+ summary: "Read the authenticated live Controller runtime identity.",
1043
1128
  hidden: true
1044
1129
  },
1045
1130
  { name: "stop", summary: "Stop the Controller." },
@@ -1057,7 +1142,7 @@ export const ROOT_COMMAND = buildNode({
1057
1142
  children: [
1058
1143
  {
1059
1144
  name: "audit",
1060
- summary: "Report Turns, wakes, Sessions, Reviews, Integrations, and telemetry volume.",
1145
+ summary: "Report AgentRuns, wakes, Sessions, Reviews, Integrations, and telemetry volume.",
1061
1146
  usage: "yui execution audit [--task <id>] [--since <iso>] [--until <iso>]",
1062
1147
  options: ["--task", "--since", "--until"]
1063
1148
  }
@@ -1152,7 +1237,7 @@ export const ROOT_COMMAND = buildNode({
1152
1237
  },
1153
1238
  {
1154
1239
  name: "role",
1155
- summary: "Manage reusable global Roles and desired Agent launch configuration for the next Host activation.",
1240
+ summary: "Manage reusable global Roles and desired Agent launch configuration for the next Host process.",
1156
1241
  examples: ["yui config role list", "yui config role show operator"],
1157
1242
  sections: [
1158
1243
  { id: "inspect", title: "Inspect", entries: ["list", "show"] },
@@ -1378,10 +1463,10 @@ export const ROOT_COMMAND = buildNode({
1378
1463
  },
1379
1464
  {
1380
1465
  name: "task",
1381
- summary: "Manage Tasks, WorkItems, Turns, and integration.",
1466
+ summary: "Manage Tasks, WorkItems, AgentRuns, and integration.",
1382
1467
  sections: [
1383
- { id: "lifecycle", title: "Lifecycle", entries: ["create", "project", "base", "update", "activate", "execution", "complete", "reopen", "retire", "list", "show", "context", "next-action", "remote-delivery", "archive", "replace", "reconcile", "upstream"] },
1384
- { id: "collaboration", title: "Collaboration", entries: ["message", "input", "grant", "workflow", "publication", "work", "turn", "review", "integration", "role", "overlap", "change-set"] },
1468
+ { id: "lifecycle", title: "Lifecycle", entries: ["create", "project", "base", "update", "activate", "activation", "execution", "complete", "cancel", "reopen", "retire", "list", "show", "context", "next-action", "remote-delivery", "archive", "replace", "reconcile", "upstream", "artifact"] },
1469
+ { id: "collaboration", title: "Collaboration", entries: ["message", "input", "grant", "workflow", "publication", "work", "run", "review", "integration", "role", "overlap", "change-set"] },
1385
1470
  { id: "knowledge", title: "Task Knowledge", entries: ["brief", "decision", "milestone", "event", "continuation", "wake"] }
1386
1471
  ],
1387
1472
  children: taskChildren
@@ -1389,9 +1474,11 @@ export const ROOT_COMMAND = buildNode({
1389
1474
  {
1390
1475
  name: "capability",
1391
1476
  summary: "Discover and call authorized capabilities through the Controller.",
1392
- sections: [{ id: "entry", title: "Commands", entries: ["search", "describe", "call"] }],
1477
+ sections: [{ id: "entry", title: "Commands", entries: ["search", "commands", "panels", "describe", "call"] }],
1393
1478
  children: [
1394
1479
  { name: "search", summary: "Search the current authorized directory.", usage: "yui capability search [query] --task <id>" },
1480
+ { name: "commands", summary: "List current command names, help and capability mappings; invoke via capability call.", usage: "yui capability commands --task <id>" },
1481
+ { name: "panels", summary: "List authorized text/link or query-only JSON panel descriptors.", usage: "yui capability panels --task <id>" },
1395
1482
  { name: "describe", summary: "Describe one contract or report Provider ambiguity.", usage: "yui capability describe <name> --task <id> [--provider <id>] [--version <version>]" },
1396
1483
  { name: "call", summary: "Invoke one implementation under the current managed identity.", usage: "yui capability call <name> --task <id> --input <json> [--provider <id>] [--version <version>] [--request-id <id>]" }
1397
1484
  ]
@@ -1422,8 +1509,8 @@ export const ROOT_COMMAND = buildNode({
1422
1509
  sections: [{ id: "manage", title: "Commands", entries: ["status", "prune", "read"] }],
1423
1510
  children: [
1424
1511
  { name: "status", summary: "Show sidecar health, row counts, and retention settings.", usage: "yui telemetry status" },
1425
- { name: "prune", summary: "Apply terminal retention and active-Turn caps.", usage: "yui telemetry prune [--task <id>] [--keep <n>] [--dry-run]" },
1426
- { name: "read", summary: "Page through retained progress rows or read a Turn aggregate.", usage: "yui telemetry read --task <id> [--turn <id>] [--aggregate] [--limit <n>] [--offset <n>]" }
1512
+ { name: "prune", summary: "Apply terminal retention and active-AgentRun caps.", usage: "yui telemetry prune [--task <id>] [--keep <n>] [--dry-run]" },
1513
+ { name: "read", summary: "Page through retained progress rows or read a AgentRun aggregate.", usage: "yui telemetry read --task <id> [--run <id>] [--aggregate] [--limit <n>] [--offset <n>]" }
1427
1514
  ]
1428
1515
  },
1429
1516
  {
@@ -1439,7 +1526,7 @@ export const ROOT_COMMAND = buildNode({
1439
1526
  {
1440
1527
  name: "agent-host",
1441
1528
  summary: "Run the persistent structured Provider host.",
1442
- usage: "yui internal agent-host <launch-id> <ticket>"
1529
+ usage: "yui internal agent-host <ticket>"
1443
1530
  },
1444
1531
  {
1445
1532
  name: "session-notify",
@@ -1,4 +1,4 @@
1
- import { orderRoleOptions } from "./roleOptionCatalog.js";
1
+ import { orderRoleOptions } from "./roleOptionOrder.js";
2
2
  export async function getSelectionCandidates(selector, ports, args) {
3
3
  switch (selector.provider) {
4
4
  case "tasks":
@@ -70,11 +70,11 @@ export async function getSelectionCandidates(selector, ports, args) {
70
70
  }
71
71
  case "work-items":
72
72
  return entities("work item", "Select work item", qualifyTaskRecords(await listAllWorkItems(ports)), ["qualifiedId", "title", "status"]);
73
- case "turns": {
73
+ case "runs": {
74
74
  const workItemId = dependencyValue(selector, args);
75
- const turns = await listAllByTask(ports, "task.turn.list", "turns");
76
- return entities("turn", workItemId === undefined ? "Select Turn" : `Select Turn: ${workItemId}`, qualifyTaskRecords(turns.filter((turn) => workItemId === undefined
77
- || matchesTaskRecordReference(turn, "workItemId", workItemId))), ["qualifiedId", "roleName", "status", "summary"]);
75
+ const runs = await listAllByTask(ports, "task.run.list", "runs");
76
+ return entities("run", workItemId === undefined ? "Select AgentRun" : `Select AgentRun: ${workItemId}`, qualifyTaskRecords(runs.filter((run) => workItemId === undefined
77
+ || matchesTaskRecordReference(run, "workItemId", workItemId))), ["qualifiedId", "roleName", "status", "summary"]);
78
78
  }
79
79
  case "integration-attempts":
80
80
  return entities("Integration Attempt", "Select Integration Attempt", qualifyTaskRecords((await listAllByTask(ports, "task.integration.list", "integrations")).filter((attempt) => selector.statuses === undefined
@@ -176,11 +176,41 @@ export const INTERACTION_POLICIES = Object.freeze([
176
176
  }
177
177
  },
178
178
  taskTarget("activate", 2, ["draft"]),
179
+ {
180
+ commandPath: ["task", "activation", "request"],
181
+ selectors: [{
182
+ argumentIndex: 3,
183
+ entity: "task",
184
+ provider: "tasks",
185
+ actionTarget: true,
186
+ statuses: ["draft"]
187
+ }],
188
+ trailingOptions: { "--request-id": "value", "--environment": "value" }
189
+ },
190
+ {
191
+ commandPath: ["task", "activation", "cancel"],
192
+ selectors: [{
193
+ argumentIndex: 3,
194
+ entity: "task",
195
+ provider: "tasks",
196
+ actionTarget: true,
197
+ statuses: ["draft"]
198
+ }],
199
+ trailingOptions: { "--request-id": "value", "--reason": "value" }
200
+ },
201
+ {
202
+ commandPath: ["task", "activation", "show"],
203
+ selectors: [{ argumentIndex: 3, entity: "task", provider: "tasks", actionTarget: true }]
204
+ },
179
205
  {
180
206
  ...taskTarget("complete", 2, ["active"]),
181
207
  trailingOptions: { "--summary": "value" }
182
208
  },
183
- taskTarget("reopen", 2, ["completed"]),
209
+ taskTarget("reopen", 2, ["completed", "cancelled"]),
210
+ {
211
+ ...taskTarget("cancel", 2, ["draft", "active"]),
212
+ trailingOptions: { "--summary": "value", "--summary-file": "value" }
213
+ },
184
214
  {
185
215
  ...taskTarget("retire", 2, ["draft", "active"]),
186
216
  trailingOptions: {
@@ -200,7 +230,7 @@ export const INTERACTION_POLICIES = Object.freeze([
200
230
  trailingOptions: { "--json": "flag" }
201
231
  },
202
232
  {
203
- ...taskTarget("archive", 2, ["completed", "retired"]),
233
+ ...taskTarget("archive", 2, ["completed", "cancelled"]),
204
234
  trailingOptions: { "--integrated": "flag", "--abandon": "flag", "--force": "flag" },
205
235
  confirmation: { action: "Archive task", targetArgumentIndex: 2 }
206
236
  },
@@ -436,7 +466,7 @@ export const INTERACTION_POLICIES = Object.freeze([
436
466
  }
437
467
  }
438
468
  : command === "update"
439
- ? { trailingOptions: { "--summary": "value" } }
469
+ ? { trailingOptions: { "--summary": "value", "--artifact-ref": "value" } }
440
470
  : command === "dispatch"
441
471
  ? { trailingOptions: { "--input": "value" } }
442
472
  : command === "cleanup"
@@ -471,15 +501,15 @@ export const INTERACTION_POLICIES = Object.freeze([
471
501
  confirmation: { action: "Retire Work Item", targetArgumentIndex: 3 }
472
502
  },
473
503
  {
474
- commandPath: ["task", "turn", "list"],
504
+ commandPath: ["task", "run", "list"],
475
505
  selectors: [{ argumentIndex: 3, entity: "work-item", provider: "work-items", actionTarget: true }],
476
506
  },
477
507
  {
478
- commandPath: ["task", "turn", "retry"],
508
+ commandPath: ["task", "run", "retry"],
479
509
  selectors: [{
480
510
  argumentIndex: 3,
481
- entity: "turn",
482
- provider: "turns",
511
+ entity: "run",
512
+ provider: "runs",
483
513
  actionTarget: true
484
514
  }]
485
515
  },
@@ -573,7 +603,7 @@ export const INTERACTION_POLICIES = Object.freeze([
573
603
  ].map(([group, command]) => {
574
604
  const trailingOptions = {};
575
605
  if (group === "brief" && command === "update") {
576
- Object.assign(trailingOptions, { "--objective": "value", "--boundary": "value", "--focus": "value", "--leader-summary": "value" });
606
+ Object.assign(trailingOptions, { "--objective": "value", "--boundary": "value", "--approach": "value", "--focus": "value", "--leader-summary": "value" });
577
607
  }
578
608
  else if (group === "decision" && command === "record") {
579
609
  Object.assign(trailingOptions, { "--title": "value", "--rationale": "value" });
@@ -32,7 +32,7 @@ function resolveExecutionPath(args) {
32
32
  const child = findChild(node, args[index] ?? "");
33
33
  const internalExecutable = child !== undefined && ((node === ROOT_COMMAND && child.name === "internal")
34
34
  || (node.path.join(" ") === "yui config completion" && child.name === "candidates")
35
- || (node.path.join(" ") === "yui task turn"
35
+ || (node.path.join(" ") === "yui task run"
36
36
  && (child.name === "checkpoint" || child.name === "context"))
37
37
  || (node.path.join(" ") === "yui controller"
38
38
  && (child.name === "identity" || child.name === "live-identity")));