@zq-silk/yui 0.8.2 → 0.8.6

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 (68) hide show
  1. package/ARCHITECTURE.md +40 -22
  2. package/README.md +61 -9
  3. package/dist/cli/commandCatalog.js +31 -14
  4. package/dist/cli/operatorWizard.js +10 -20
  5. package/dist/cli.js +187 -22
  6. package/dist/commands/executionAuditCommands.js +30 -0
  7. package/dist/commands/operatorCommands.js +42 -1
  8. package/dist/commands/taskCommands.js +648 -74
  9. package/dist/commands/taskCompletionGate.js +166 -2
  10. package/dist/commands/taskContextCommand.js +6 -1
  11. package/dist/commands/taskInputCommands.js +48 -10
  12. package/dist/commands/taskNextActionCommand.js +36 -3
  13. package/dist/context/runContextPack.js +19 -4
  14. package/dist/context/sessionBootstrapManifest.js +83 -2
  15. package/dist/controller/clientRuntime.js +7 -7
  16. package/dist/controller/controller.js +16 -8
  17. package/dist/controller/fileSchedulerStoreAdapter.js +64 -5
  18. package/dist/controller/handoverCandidate.js +10 -3
  19. package/dist/controller/sessionNotify.js +4 -22
  20. package/dist/executor/agentAdapter.js +2 -2
  21. package/dist/executor/agentExecutor.js +25 -5
  22. package/dist/executor/fileRoleLaunchPlanner.js +16 -11
  23. package/dist/integration/gitIntegrationService.js +50 -2
  24. package/dist/integration/integrationCheckEvidenceReuse.js +53 -0
  25. package/dist/observability/executionAudit.js +47 -1
  26. package/dist/observability/faultClassification.js +6 -4
  27. package/dist/observability/orchestrationMetrics.js +196 -0
  28. package/dist/operator/operatorSessionHistory.js +36 -0
  29. package/dist/release/releaseHandover.js +7 -5
  30. package/dist/release/runtimeRelease.js +15 -0
  31. package/dist/repository/gitWorkspace.js +7 -4
  32. package/dist/repository/taskBaseFreshness.js +4 -2
  33. package/dist/repository/taskWorkspaceCoordinator.js +13 -10
  34. package/dist/review/deltaRecheck.js +3 -2
  35. package/dist/review/reviewFindingLedger.js +5 -4
  36. package/dist/review/reviewOutcomeClassifier.js +252 -54
  37. package/dist/review/taskFinalReviewContractEvent.js +1 -0
  38. package/dist/review/taskFinalReviewContractRebind.js +350 -0
  39. package/dist/run/agentRun.js +2 -2
  40. package/dist/run/runIdentity.js +10 -70
  41. package/dist/runtime/agentHost.js +3 -4
  42. package/dist/runtime/codexAppServerRuntime.js +6 -0
  43. package/dist/runtime/firstProgressStopLoss.js +52 -0
  44. package/dist/runtime/launchBroker.js +10 -2
  45. package/dist/runtime/runtimeDeadlines.js +14 -0
  46. package/dist/runtime/sessionTitle.js +24 -12
  47. package/dist/runtime/structuredProviderHost.js +7 -1
  48. package/dist/runtime/tmuxAdapters.js +10 -3
  49. package/dist/scheduler/activeRoleRunDelivery.js +20 -18
  50. package/dist/scheduler/leaderWakeupProcessor.js +33 -2
  51. package/dist/scheduler/wakeReason.js +2 -0
  52. package/dist/storage/sqliteStore.js +10 -1
  53. package/dist/storage/taskStore.js +12 -1
  54. package/dist/task/completionReadiness.js +91 -19
  55. package/dist/task/deliveryGuard.js +3 -1
  56. package/dist/task/nextAction.js +146 -51
  57. package/dist/task/publicationReference.js +1 -0
  58. package/dist/task/repairWave.js +14 -1
  59. package/dist/task/task.js +10 -0
  60. package/dist/web/webSnapshot.js +7 -1
  61. package/dist/workItem/workItem.js +12 -0
  62. package/dist/workspace/workItemChangeSetManager.js +2 -1
  63. package/i18n/README.zh-CN.md +28 -8
  64. package/package.json +1 -1
  65. package/skills/yui-leader/SKILL.md +79 -32
  66. package/skills/yui-operator/SKILL.md +51 -10
  67. package/skills/yui-reviewer/SKILL.md +23 -0
  68. package/skills/yui-runtime/SKILL.md +7 -2
package/ARCHITECTURE.md CHANGED
@@ -5,13 +5,20 @@ runtimes. The user talks to one Operator. The Operator routes each request to
5
5
  the right Project and Task; that Task's Leader owns decomposition, execution
6
6
  choice, review, integration, and completion.
7
7
 
8
- ## One work model
8
+ ## One outcome model, two delivery paths
9
9
 
10
- `WorkItem` is the only bounded unit of work. It holds the objective, acceptance
11
- criteria, dependencies, assigned Task Role when applicable, lifecycle, and a
12
- compact reviewed result.
10
+ `Task` is the bounded user outcome. Its delivery path is derived from existing
11
+ fields rather than stored as another state machine: no Project bindings means
12
+ `no-project`; a Project-backed Task without `requireIntegration` is `direct`;
13
+ and `requireIntegration=true` is `integrated`.
13
14
 
14
- A Leader chooses one of three execution paths for each WorkItem:
15
+ Direct delivery lets the Leader implement and verify a low-risk result in the
16
+ managed Task main without creating a WorkItem. Integrated delivery uses
17
+ `WorkItem` as its only bounded execution unit; it holds the objective,
18
+ acceptance criteria, dependencies, assigned Task Role when applicable,
19
+ lifecycle, and compact reviewed result.
20
+
21
+ For each integrated WorkItem, a Leader chooses one of three execution paths:
15
22
 
16
23
  1. **Direct**: the Leader executes a roleless WorkItem.
17
24
  2. **Native subagent**: the Leader creates a child through its current Agent
@@ -19,8 +26,9 @@ A Leader chooses one of three execution paths for each WorkItem:
19
26
  3. **Task Role AgentRun**: Yui dispatches a Role-bound WorkItem to a
20
27
  Task-managed native Agent Session.
21
28
 
22
- There is no Yui subagent launcher, child-session record, or second bounded-work
23
- model. Direct work and native subagents use the WorkItem lifecycle. Managed
29
+ There is no Yui subagent launcher or child-session record. A native child on
30
+ direct delivery remains inside the Leader Session and Task-main boundary; a
31
+ native child implementing integrated work uses the WorkItem lifecycle. Managed
24
32
  independent execution additionally records an AgentRun.
25
33
 
26
34
  ## Profiles, Roles, and Agents
@@ -57,7 +65,7 @@ effort, round, result, and checks.
57
65
 
58
66
  ## Lifecycle and acceptance
59
67
 
60
- Direct and native-subagent work follows:
68
+ Integrated Leader-direct and native-subagent WorkItem execution follows:
61
69
 
62
70
  ```text
63
71
  todo -> running -> done | failed
@@ -78,16 +86,22 @@ then accepts or rejects with bounded feedback. A rejected isolated WorkItem
78
86
  keeps its workspace so the next Run can repair the same result.
79
87
 
80
88
  An optional global review rule names one existing Global Role and chooses
81
- `always`, `leader`, or `final`. It is a live default for every Task; each
89
+ `always`, `leader`, or `final`. Candidate rules remain live defaults; each
82
90
  WorkItem Candidate snapshots the effective legacy rule when submitted.
83
91
  Every result awaiting acceptance is stored as an explicit WorkItem candidate.
84
92
  `always` dispatches a review AgentRun for every candidate, whether it comes
85
93
  from a yielded execution Run or a Leader-managed direct result; `leader`
86
94
  leaves every candidate for the Leader to accept directly or review explicitly.
87
- `final` keeps WorkItem acceptance and Integration independent, then `task
88
- complete` queues one fresh Task-scoped ReviewRound over the frozen committed
89
- heads of every bound Project. A changed integrated head queues a new round;
90
- the previous report remains evidence. This final Reviewer evaluates the whole
95
+ `final` applies automatically only to integrated delivery: it keeps WorkItem
96
+ acceptance and Integration independent, then `task complete` queues one fresh
97
+ Task-scoped ReviewRound over the frozen committed heads of every bound Project.
98
+ A direct Task may use a bounded native review. When a managed final Review is
99
+ required, it must be promoted before Task main advances; promotion fails after
100
+ a commit or delivery evidence exists so earlier work cannot lose ChangeSet
101
+ provenance.
102
+ Any established immutable Task-final contract or Round remains an obligation.
103
+ A changed integrated head queues a new round; the previous report remains
104
+ evidence. This final Reviewer evaluates the whole
91
105
  Task, so normal delivery does not pay for a complete review of every WorkItem.
92
106
  Review Runs complete only their exact ReviewRound, leave the WorkItem awaiting
93
107
  acceptance, and never trigger another review or append a Candidate. Successful
@@ -133,8 +147,9 @@ Projects and Task-main context for the rest. The managed dispatch and
133
147
  writable set. Provider permission is binding configuration: every managed Role
134
148
  defaults to `bypass`, while `default` and `configured` preserve provider-native
135
149
  behavior. Provider permission and Profile access intent do not grant Project
136
- writes. A normal source write requires an exact WorkItem write scope and
137
- matching managed workspace; a review write instead
150
+ writes. A direct source write requires the exact Leader Task-main owner. An
151
+ integrated source write requires an exact WorkItem write scope and matching
152
+ managed workspace; a review write instead
138
153
  requires an exact ReviewRound owner and frozen Candidate base. Profiles and
139
154
  Skills constrain behavior even when provider prompts are bypassed. Provider
140
155
  permissions remain Session-wide rather than Project-specific, so the durable
@@ -152,8 +167,8 @@ An isolated result is handled in this order:
152
167
  5. configured checks run;
153
168
  6. compare-and-swap advances the target only if its HEAD is unchanged;
154
169
  7. the Leader accepts the WorkItem;
155
- 8. clean Integration, ReviewRound, and WorkItem resources are explicitly
156
- removed.
170
+ 8. terminal Integration, ReviewRound, and WorkItem resources become cleanup
171
+ advisories and are explicitly removed before archive.
157
172
 
158
173
  The context contract is layered: Yui Core owns durable identity, lifecycle,
159
174
  access, and workspace safety; generic role Skills own portable orchestration;
@@ -162,15 +177,18 @@ project-specific engineering rules; and the Task Contract owns the requested
162
177
  outcome. Yui injects only its own generic Role Skills. It never scans or copies
163
178
  Project Skills into managed context; the selected Agent discovers them through
164
179
  its native project mechanism. Execution and review select their generic Skill
165
- by durable Run purpose. A Reviewer finding routes to the original
166
- Worker while open, a small Repair WorkItem when closed, Leader/Integration for
180
+ by durable Run purpose. A Reviewer finding routes to the original Worker while
181
+ open, one consolidated Repair WorkItem when closed, Leader/Integration for
167
182
  merge or local fixes, and an architecture WorkItem only for a genuinely
168
- cross-cutting design change.
183
+ cross-cutting design change. Parallel repair is explicit and requires
184
+ independently acceptable ownership.
169
185
 
170
186
  Capture at the same HEAD reuses the existing ChangeSet. A repaired HEAD creates
171
187
  a new candidate; only the latest reviewed candidate may satisfy acceptance.
172
- An isolated WorkItem cannot be accepted or a Task completed while any writable
173
- Project's latest result is uncaptured or unintegrated. Workspace roots are
188
+ An isolated WorkItem cannot be accepted, or an integrated Task completed, while
189
+ any writable Project's latest result is uncaptured or unintegrated. Direct
190
+ completion instead requires a clean committed exact Task-main snapshot.
191
+ Workspace roots are
174
192
  multi-Project; ChangeSets and Integration Attempts remain single-Project Git
175
193
  boundaries.
176
194
 
package/README.md CHANGED
@@ -250,7 +250,8 @@ yui project update app --alias app-cli
250
250
  yui project refresh app
251
251
  yui project list
252
252
 
253
- yui task create "Ship CSV export" --project app
253
+ yui task create "Fix CSV escaping" --project app --delivery direct
254
+ yui task create "Ship CSV export" --project app --delivery integrated
254
255
  yui task update <task-id> --priority high --tags release,csv --due-at 2026-08-01T00:00:00Z
255
256
  yui task update <task-id> --clear-priority --clear-tags --clear-due-at
256
257
  yui task show <task-id>
@@ -258,6 +259,19 @@ yui task context <task-id>
258
259
  yui task activate <task-id>
259
260
  ```
260
261
 
262
+ Project delivery is explicit but uses the existing Task schema. `direct` means
263
+ the Leader implements and verifies one low-risk result on clean committed Task
264
+ main; it needs no WorkItem, IntegrationAttempt, or policy-created final
265
+ ReviewRound. `integrated` requires WorkItem, ChangeSet, and committed Integration
266
+ evidence and remains the path for guarded, cross-Project, migration,
267
+ authorization, concurrency/recovery, destructive, and release changes. Global
268
+ final-review policy applies automatically only to integrated delivery. A direct
269
+ Task can use a bounded native review. If an independently managed final Review
270
+ is required, promote before Task main advances; promotion fails closed after a
271
+ commit or delivery evidence exists so earlier work cannot lose ChangeSet
272
+ provenance. Legacy `--require-integration` is an alias for
273
+ `--delivery integrated`, and integrated delivery cannot be downgraded.
274
+
261
275
  `project refresh` is the explicit network operation for a stable Project checkout. It fetches the
262
276
  configured stable branch directly from the Project remote URL and advances only through a clean,
263
277
  verified fast-forward. Refresh requires matching stable and development branches, treats untracked
@@ -370,7 +384,8 @@ expands:
370
384
  ```sh
371
385
  yui task create "Update authentication" \
372
386
  --project backend --project frontend \
373
- --base backend=develop --base frontend=main
387
+ --base backend=develop --base frontend=main \
388
+ --delivery integrated
374
389
  yui task project add <task-id> shared-sdk --base main
375
390
  ```
376
391
 
@@ -444,6 +459,7 @@ Submit information through Operator:
444
459
  ```sh
445
460
  yui operator submit "Compare CSV and JSON compatibility" --task <task-id>
446
461
  yui operator submit "Investigate a smaller cache design"
462
+ yui operator status
447
463
  yui operator list
448
464
  yui operator resume
449
465
  yui operator resume --last
@@ -472,13 +488,15 @@ bounded outcome stay in that Task even when they involve multiple Projects.
472
488
  A distinct outcome, ownership boundary, or lifecycle creates a separate Task.
473
489
  Features, bugs, and questions use the same
474
490
  Task/WorkItem model rather than separate workflow types.
475
- `operator list` shows recent conversations in fixed most-recently-updated order using
491
+ `operator status` shows exactly one GlobalRole-selected writer separately from
492
+ retained historical conversations. `operator list` shows recent conversations in fixed most-recently-updated order using
476
493
  their Agent and readable title or preview; native provider session IDs remain
477
494
  internal. Until an adapter supplies that metadata, Yui shows the provider plus
478
495
  a stable short Yui reference so untitled conversations remain distinguishable.
479
- `operator resume` opens the same lightweight numbered list, while
480
- `--last` resumes the newest entry directly. `operator new` starts a clean
481
- conversation and preserves the previous one in history.
496
+ `operator resume` opens the lightweight numbered history list, while `--last`
497
+ resumes the newest entry directly. Starting a conversation is never a resume
498
+ choice: the explicit `operator new` command starts a clean conversation and
499
+ preserves the previous one in history.
482
500
 
483
501
  Create a Task-bound Worker instance from the configured global Worker, apply a
484
502
  Profile, and dispatch a WorkItem:
@@ -547,8 +565,10 @@ bounded next options. Yield records immutable Run/Candidate or Review evidence
547
565
  only; it does not imply acceptance, WorkItem completion, ChangeSet capture,
548
566
  Integration, or Task completion.
549
567
 
550
- For bounded work, the Leader owns a roleless WorkItem and may execute it
551
- directly or create a native subagent through the current Agent conversation:
568
+ For integrated bounded work, the Leader owns one roleless WorkItem and may
569
+ execute it directly or create a native subagent through the current Agent
570
+ conversation. Direct delivery operates on Task main without creating this
571
+ WorkItem:
552
572
 
553
573
  ```sh
554
574
  yui task work create <task-id> "Review the implementation" \
@@ -659,7 +679,39 @@ yui task complete <task-id> --summary-file delivery.txt --refresh-remote
659
679
  yui task reopen <task-id>
660
680
  ```
661
681
 
662
- Completed Tasks reject messages, dispatch, Provider authority changes, retry, and late yields until explicitly reopened, while retaining Task main for inspection or integration. Every isolated WorkItem worktree must be explicitly cleaned as integrated or abandoned before archive; that cleanup also removes its managed branch. Archive requires `--integrated` or `--abandon` to state the Task main outcome and is allowed only after Task main is clean. It removes managed worktrees but retains Task and WorkItem records. The Task main branch is retained as a recovery artifact instead of being silently deleted.
682
+ When a verified squash-merge Publication records a remote commit that is
683
+ ancestry-divergent from the unchanged local Task head, a user or global Operator
684
+ may explicitly authorize completion against its identical Git tree:
685
+
686
+ ```sh
687
+ yui task complete <task-id> --summary-file delivery.txt \
688
+ --accept-published-tree <publication-id>
689
+ ```
690
+
691
+ This does not weaken normal freshness checks. Yui requires the current,
692
+ unsuperseded Publication to be merged and verified, its local commit to equal
693
+ the physical Task head, its remote commit to be ancestry-divergent, and both
694
+ commits to resolve to the same exact tree. Integrated delivery also requires
695
+ the latest completed Task-final Review; direct delivery does not invent one.
696
+ `--refresh-remote` fetches
697
+ the remote object graph before resolving that Publication commit. For a Task
698
+ governed by a durable exact final-review contract, the user/Operator command
699
+ persists the exact authorization tuple and wakes the Task Leader; only that
700
+ contract-capable Leader may consume it and complete the Task. Tasks without
701
+ that contract retain the one-step explicit completion path. The Task event
702
+ audit records the authorization and, on completion, the accepted Project,
703
+ Publication, optional ReviewRound, both commits, and tree.
704
+
705
+ Completed Tasks reject messages, dispatch, Provider authority changes, retry,
706
+ and late yields until explicitly reopened, while retaining Task main for
707
+ inspection or integration. Terminal WorkItem, Review, Integration, and Lane
708
+ worktrees are non-blocking completion advisories, but they must be settled
709
+ before archive. Every isolated WorkItem worktree is explicitly cleaned as
710
+ integrated or abandoned; that cleanup also removes its managed branch. Archive
711
+ requires `--integrated` or `--abandon` to state the Task main outcome and is
712
+ allowed only after Task main is clean. It removes managed worktrees but retains
713
+ Task and WorkItem records. The Task main branch is retained as a recovery
714
+ artifact instead of being silently deleted.
663
715
  Task lifecycle completion/selection only suggests valid source states: Draft for activate, active for complete, and completed for reopen.
664
716
 
665
717
  ## Sessions and tmux
@@ -241,8 +241,9 @@ const taskChildren = [
241
241
  {
242
242
  name: "create",
243
243
  summary: "Create a Draft Task.",
244
- usage: "yui task create <title> [--project <project> ...] [--base <project>=<ref> ...] [--require-integration]",
245
- options: ["--project", "--base", "--require-integration"]
244
+ usage: "yui task create <title> [--project <project> ...] [--base <project>=<ref> ...] [--delivery <direct|integrated>] [--require-integration]",
245
+ options: ["--project", "--base", "--delivery", "--require-integration"],
246
+ optionValues: { "--delivery": ["direct", "integrated"] }
246
247
  },
247
248
  {
248
249
  name: "project",
@@ -265,20 +266,23 @@ const taskChildren = [
265
266
  {
266
267
  name: "update",
267
268
  summary: "Update Task metadata.",
268
- usage: "yui task update <id> [--title <text>] [--description <text>|--clear-description] [--priority <low|medium|high|urgent>|--clear-priority] [--tags <comma-separated>|--clear-tags] [--due-at <RFC3339>|--clear-due-at] [--require-integration]",
269
+ usage: "yui task update <id> [--title <text>] [--description <text>|--clear-description] [--priority <low|medium|high|urgent>|--clear-priority] [--tags <comma-separated>|--clear-tags] [--due-at <RFC3339>|--clear-due-at] [--delivery <direct|integrated>] [--require-integration]",
269
270
  options: [
270
271
  "--title", "--description", "--priority", "--tags", "--due-at",
271
272
  "--clear-description", "--clear-priority", "--clear-tags", "--clear-due-at",
272
- "--require-integration"
273
+ "--delivery", "--require-integration"
273
274
  ],
274
- optionValues: { "--priority": ["low", "medium", "high", "urgent"] }
275
+ optionValues: {
276
+ "--priority": ["low", "medium", "high", "urgent"],
277
+ "--delivery": ["direct", "integrated"]
278
+ }
275
279
  },
276
280
  { name: "activate", summary: "Activate a Draft Task.", usage: "yui task activate <id>" },
277
281
  {
278
282
  name: "complete",
279
283
  summary: "Complete an active Task and stop automatic wakeups.",
280
- usage: "yui task complete <id> (--summary <text>|--summary-file <path|->) [--refresh-remote]",
281
- options: ["--summary", "--summary-file", "--refresh-remote"],
284
+ usage: "yui task complete <id> (--summary <text>|--summary-file <path|->) [--refresh-remote] [--accept-published-tree <publication-id>]",
285
+ options: ["--summary", "--summary-file", "--refresh-remote", "--accept-published-tree"],
282
286
  fileOptions: ["--summary-file"]
283
287
  },
284
288
  {
@@ -727,8 +731,8 @@ const taskChildren = [
727
731
  {
728
732
  name: "expand",
729
733
  summary: "Expand one authorized Run context reference.",
730
- usage: "yui task run context expand <task>/<run> <ref-id> [--mode full]",
731
- options: ["--mode"]
734
+ usage: "yui task run context expand <task>/<run> <ref-id> [--store <store>] [--mode full]",
735
+ options: ["--store", "--mode"]
732
736
  },
733
737
  {
734
738
  name: "delta",
@@ -751,7 +755,7 @@ const taskChildren = [
751
755
  {
752
756
  name: "review",
753
757
  summary: "Control Task-final ReviewRounds.",
754
- sections: [{ id: "manage", title: "Commands", entries: ["request", "group", "retry", "finding"] }],
758
+ sections: [{ id: "manage", title: "Commands", entries: ["request", "rebind", "force-fresh", "group", "retry", "finding"] }],
755
759
  children: [
756
760
  {
757
761
  name: "request",
@@ -759,6 +763,17 @@ const taskChildren = [
759
763
  usage: "yui task review request <task> --role <global-role> [--strategy fixed:<count>|adaptive:<max>] [--lane-role <role> ...] [--delta-recheck]",
760
764
  options: ["--role", "--strategy", "--lane-role", "--delta-recheck"]
761
765
  },
766
+ {
767
+ name: "rebind",
768
+ summary: "Explicitly rebind a frozen Task-final contract after a verified immutable release handover.",
769
+ usage: "yui task review rebind <task> --from-control <digest> --to-control <digest> --from-release <release-id> --to-release <release-id>",
770
+ options: ["--from-control", "--to-control", "--from-release", "--to-release"]
771
+ },
772
+ {
773
+ name: "force-fresh",
774
+ summary: "Replace one exact terminal non-semantic Task-final Review with a distinct full Round.",
775
+ usage: "yui task review force-fresh <task>/<review-round>"
776
+ },
762
777
  {
763
778
  name: "group",
764
779
  summary: "Resolve a Reviewer ExecutionGroup after its Lanes finish.",
@@ -799,9 +814,10 @@ const taskChildren = [
799
814
  },
800
815
  {
801
816
  name: "repair-wave",
802
- summary: "Group open P1/P2 findings into parallel repair groups by overlap.",
803
- usage: "yui task review finding repair-wave <task> [--create]",
804
- options: ["--create"]
817
+ summary: "Consolidate open P1/P2 findings, or explicitly plan parallel repair groups.",
818
+ usage: "yui task review finding repair-wave <task> [--strategy <consolidated|parallel>] [--create]",
819
+ options: ["--strategy", "--create"],
820
+ optionValues: { "--strategy": ["consolidated", "parallel"] }
805
821
  },
806
822
  {
807
823
  name: "extract",
@@ -1180,10 +1196,11 @@ export const ROOT_COMMAND = buildNode({
1180
1196
  sections: [{
1181
1197
  id: "workflow",
1182
1198
  title: "Commands",
1183
- entries: ["enter", "new", "list", "resume", "submit"]
1199
+ entries: ["enter", "status", "new", "list", "resume", "submit"]
1184
1200
  }],
1185
1201
  children: [
1186
1202
  { name: "enter", summary: "Enter the Operator's native session." },
1203
+ { name: "status", summary: "Show the unique active writer and retained conversation history." },
1187
1204
  {
1188
1205
  name: "new",
1189
1206
  summary: "Start a new Operator session.",
@@ -28,30 +28,20 @@ export async function resolveOperatorWizardArguments(commandArgs, role, sessions
28
28
  : { kind: "resolved", args: [...args, "--agent", selected] };
29
29
  }
30
30
  if (args[1] === "resume" && args.length === 2) {
31
- const newSession = "__operator_new_session__";
32
- const selected = await choose("Resume an Operator session", [
33
- ...sessions.map((session) => ({
34
- value: session.ref,
35
- cells: [
36
- formatRelativeTimestamp(session.updatedAt, now),
37
- adapterLabel(session.adapterId),
38
- session.displayTitle,
39
- session.state
40
- ]
41
- })),
42
- {
43
- value: newSession,
44
- cells: ["", "", "Start a new session", "new"]
45
- }
46
- ], [
31
+ const selected = await choose("Resume an Operator session", sessions.map((session) => ({
32
+ value: session.ref,
33
+ cells: [
34
+ formatRelativeTimestamp(session.updatedAt, now),
35
+ adapterLabel(session.adapterId),
36
+ session.displayTitle,
37
+ session.state
38
+ ]
39
+ })), [
47
40
  { header: "Updated", minWidth: 7, maxWidth: 12 },
48
41
  { header: "Agent", minWidth: 6, maxWidth: 12 },
49
42
  { header: "Conversation", minWidth: 20, maxWidth: 64 },
50
43
  { header: "State", minWidth: 7, maxWidth: 10 }
51
- ], io, sessions[0]?.ref ?? newSession, "session");
52
- if (selected === newSession) {
53
- return resolveOperatorWizardArguments(["operator", "new"], role, sessions, io, now);
54
- }
44
+ ], io, sessions[0]?.ref, "session");
55
45
  return selected === undefined
56
46
  ? { kind: "cancelled", args }
57
47
  : { kind: "resolved", args: [...args, selected] };