@zq-silk/yui 0.7.1 → 0.8.2
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/ARCHITECTURE.md +27 -28
- package/README.md +79 -71
- package/dist/cli/commandCatalog.js +283 -136
- package/dist/cli/completion.js +3 -3
- package/dist/cli/helpRenderer.js +3 -0
- package/dist/cli/interactionPolicy.js +48 -33
- package/dist/cli/interactiveSelection.js +1 -1
- package/dist/cli/invocationRouter.js +3 -2
- package/dist/cli/roleWizard.js +8 -8
- package/dist/cli.js +189 -93
- package/dist/commands/agentCommands.js +5 -5
- package/dist/commands/configCommands.js +351 -104
- package/dist/commands/configOverview.js +60 -0
- package/dist/commands/deliveryGuardPreflight.js +2 -2
- package/dist/commands/globalRoleCommands.js +9 -9
- package/dist/commands/profileCommands.js +8 -8
- package/dist/commands/resourcesCommands.js +6 -5
- package/dist/commands/taskCommands.js +111 -59
- package/dist/commands/taskRoleRuntimeStatus.js +3 -1
- package/dist/commands/telemetryCommands.js +11 -6
- package/dist/config/configCatalog.js +42 -0
- package/dist/config/yuiConfig.js +80 -35
- package/dist/context/sessionBootstrapManifest.js +1 -1
- package/dist/controller/clientRuntime.js +0 -2
- package/dist/controller/controller.js +21 -9
- package/dist/controller/fileSchedulerStoreAdapter.js +409 -79
- package/dist/controller/resourceInventory.js +9 -5
- package/dist/controller/runtime.js +112 -25
- package/dist/controller/runtimeLaunchCoordinator.js +18 -78
- package/dist/controller/structuredProviderObservation.js +273 -0
- package/dist/doctor/doctor.js +2 -2
- package/dist/executor/agentAdapter.js +40 -0
- package/dist/executor/agentExecutor.js +31 -7
- package/dist/executor/executorRegistry.js +11 -49
- package/dist/executor/fileRoleLaunchPlanner.js +115 -37
- package/dist/lifecycle/canonicalLifecycleEvent.js +5 -2
- package/dist/resources/autoResourceGc.js +3 -1
- package/dist/review/reviewConfig.js +0 -2
- package/dist/run/agentRun.js +2 -2
- package/dist/run/providerRetry.js +29 -16
- package/dist/run/providerRetryConfig.js +5 -3
- package/dist/runtime/agentHost.js +767 -158
- package/dist/runtime/builtinAgentDrivers.js +1 -5
- package/dist/runtime/codexAppServerRuntime.js +67 -60
- package/dist/runtime/exactControlPlane.js +7 -2
- package/dist/runtime/index.js +6 -2
- package/dist/runtime/launchBroker.js +30 -8
- package/dist/runtime/launchDiagnostics.js +1 -1
- package/dist/runtime/providerAuthorityFence.js +24 -0
- package/dist/runtime/providerControl.js +63 -0
- package/dist/runtime/providerRecoveryDecision.js +55 -0
- package/dist/runtime/providerRuntimeIdentity.js +269 -19
- package/dist/runtime/runtimeBinding.js +20 -11
- package/dist/runtime/structuredProviderHost.js +476 -0
- package/dist/runtime/tmuxAdapters.js +143 -42
- package/dist/scheduler/activeRoleRunDelivery.js +206 -120
- package/dist/scheduler/leaderWakeupProcessor.js +141 -16
- package/dist/scheduler/roleRunStall.js +12 -9
- package/dist/setup/setupCommand.js +153 -492
- package/dist/storage/compatibleTaskStore.js +9 -5
- package/dist/storage/migration/productionRegistry.js +169 -0
- package/dist/storage/taskStore.js +22 -3
- package/dist/telemetry/sqliteTelemetryStore.js +9 -1
- package/dist/telemetry/telemetryConfig.js +1 -18
- package/dist/telemetry/telemetryStore.js +2 -2
- package/dist/telemetry/telemetryWiring.js +6 -5
- package/dist/tmux/tmuxManager.js +1 -1
- package/dist/web/webSnapshot.js +5 -3
- package/i18n/README.zh-CN.md +48 -40
- package/package.json +1 -1
- package/skills/yui-leader/SKILL.md +12 -5
- package/skills/yui-operator/SKILL.md +44 -6
- package/skills/yui-runtime/SKILL.md +1 -1
package/ARCHITECTURE.md
CHANGED
|
@@ -201,34 +201,33 @@ context.
|
|
|
201
201
|
|
|
202
202
|
## Runtime ownership
|
|
203
203
|
|
|
204
|
-
tmux owns Agent
|
|
205
|
-
mailbox delivery, wakeups, Role liveness,
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
is
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
the
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
bindings.
|
|
204
|
+
tmux owns the persistent Agent Host lifetime and observable output. The
|
|
205
|
+
Controller owns mailbox delivery, wakeups, Role liveness, recovery decisions,
|
|
206
|
+
and a durable single-writer authority epoch. The Agent Host owns one structured
|
|
207
|
+
Provider child process and mirrors its output to the pane. Managed prompts are
|
|
208
|
+
never terminal bytes: both Controller and human takeover input become fenced
|
|
209
|
+
Provider-native Turn requests.
|
|
210
|
+
|
|
211
|
+
Run, Conversation, Activation, and Turn identities are independent. A
|
|
212
|
+
Conversation can span Runs and Provider processes; one Activation identifies
|
|
213
|
+
one live process; one Turn identifies one pre-recorded input attempt. A live
|
|
214
|
+
Activation is retained when a later Run reuses the Conversation. Process exit
|
|
215
|
+
ends that Activation, and a resumed process receives a new Activation and a
|
|
216
|
+
higher authority epoch.
|
|
217
|
+
|
|
218
|
+
Task observation uses `task role view`. Explicit takeover requires a live
|
|
219
|
+
managed Run, atomically transfers authority to a human holder, synchronizes the
|
|
220
|
+
same fence to the Host, and only then exposes the PTY input gateway. Detach
|
|
221
|
+
releases authority; `task role release` is an idempotent repair path even after
|
|
222
|
+
the Run has ended. Global interactive entry remains a native session-lifecycle
|
|
223
|
+
operation outside this managed Provider contract.
|
|
224
|
+
|
|
225
|
+
Codex uses a persistent App Server JSON-RPC transport. Claude uses a persistent
|
|
226
|
+
stream-json transport with exact user-message replay acknowledgement. In both
|
|
227
|
+
cases, Yui records Turn intent before writing, accepts only exact Provider
|
|
228
|
+
evidence, and maps an uncertain write to `delivery-unknown` without automatic
|
|
229
|
+
resubmission. Conversation replacement requires exact missing evidence and no
|
|
230
|
+
unsettled input, Turn, Activation, or writer authority.
|
|
232
231
|
|
|
233
232
|
Role desired revisions and Run/Session effective snapshots keep configuration
|
|
234
233
|
history explicit. Resume compares the complete effective snapshot and
|
package/README.md
CHANGED
|
@@ -21,21 +21,37 @@ yui setup
|
|
|
21
21
|
yui doctor
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
`setup` is
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
`setup` is intentionally minimal. It verifies tmux, reuses or creates one
|
|
25
|
+
available Agent, creates the default workspace outside Yui home, and configures
|
|
26
|
+
both Operator and Leader so the user can start Yui and execute Tasks. It does
|
|
27
|
+
not create Worker, Reviewer, Profile, or review-policy configuration, and does
|
|
28
|
+
not ask for model/effort, permission, or shell completion. The required
|
|
29
|
+
Operator and Leader bindings use Yui's adapter default permission strategy
|
|
30
|
+
(`bypass`); further changes belong under `config role`. Running setup again
|
|
31
|
+
preserves already usable Operator and Leader Roles. A successful setup starts
|
|
32
|
+
the current Home's detached Controller before it returns.
|
|
33
|
+
|
|
34
|
+
All persistent configuration is under `yui config`. `config show` reports the
|
|
35
|
+
complete effective state, while `config --help` introduces each domain and
|
|
36
|
+
shows examples. The Operator can read the same structured catalog with
|
|
37
|
+
`config describe`, explain current values, effects, choices, and activation
|
|
38
|
+
behavior, then apply only changes the user confirms.
|
|
39
|
+
|
|
40
|
+
Durable settings are grouped by responsibility: `config system` for Home
|
|
41
|
+
defaults and presentation, `config runtime` for Controller health, concurrency,
|
|
42
|
+
launch, delivery, and Provider retry, `config workflow` for Leader/context/review
|
|
43
|
+
policy, `config resources` for quarantine and GC, and `config tools` for tmux
|
|
44
|
+
and diagnostic telemetry. Configured Agents, global Roles, Profiles, and shell
|
|
45
|
+
completion remain the sibling `config agent|role|profile|completion` domains.
|
|
46
|
+
Use `show`, `set`, and `clear` consistently within each durable-settings domain.
|
|
47
|
+
|
|
48
|
+
Runtime catalogs are refreshed per command and cached under Yui home. If a live probe times out or fails, Yui shows the last cache for the same Agent launch context and clearly marks it as potentially stale; without a matching cache, it offers CLI defaults and custom values. `yui config agent capabilities <id>` exposes the same one-pass catalog, including models, model-specific efforts, and other runtime choices such as permissions, search availability, profiles, settings sources, and service tiers.
|
|
33
49
|
|
|
34
50
|
`completion` is also interactive, with or without an explicit shell:
|
|
35
51
|
|
|
36
52
|
```sh
|
|
37
|
-
yui completion
|
|
38
|
-
yui completion zsh
|
|
53
|
+
yui config completion
|
|
54
|
+
yui config completion zsh
|
|
39
55
|
```
|
|
40
56
|
|
|
41
57
|
Both forms confirm the generated script, installation path, and shell startup-file change. The installed completion is generated from the command catalog, including nested subcommands.
|
|
@@ -214,7 +230,8 @@ record-schema change, the integrating branch must supply the complete adjacent
|
|
|
214
230
|
path (including an explicit `0->1` introduction for a new family) and re-test to
|
|
215
231
|
convergence.
|
|
216
232
|
|
|
217
|
-
|
|
233
|
+
Yui provides four reusable Worker Profile definitions through
|
|
234
|
+
`yui config profile reset`; minimum setup leaves them unconfigured:
|
|
218
235
|
|
|
219
236
|
```text
|
|
220
237
|
worker explorer implementer reviewer
|
|
@@ -270,16 +287,16 @@ timezone with:
|
|
|
270
287
|
|
|
271
288
|
```sh
|
|
272
289
|
yui config show
|
|
273
|
-
yui config set time-zone Europe/London
|
|
290
|
+
yui config system set time-zone Europe/London
|
|
274
291
|
```
|
|
275
292
|
|
|
276
293
|
WorkItem review is one global, optional rule that reuses an existing Global
|
|
277
294
|
Role's Agent, model, permissions, prompt, and Skills:
|
|
278
295
|
|
|
279
296
|
```sh
|
|
280
|
-
yui config set review --role reviewer --trigger always
|
|
297
|
+
yui config workflow set review --role reviewer --trigger always
|
|
281
298
|
yui config show
|
|
282
|
-
yui config clear review
|
|
299
|
+
yui config workflow clear review
|
|
283
300
|
```
|
|
284
301
|
|
|
285
302
|
For Project-backed software delivery, use `--trigger final` to keep WorkItem
|
|
@@ -287,7 +304,7 @@ acceptance and Integration independent and run one fresh ReviewRound over the
|
|
|
287
304
|
complete frozen integrated Task candidate before completion:
|
|
288
305
|
|
|
289
306
|
```sh
|
|
290
|
-
yui config set review --role reviewer --trigger final
|
|
307
|
+
yui config workflow set review --role reviewer --trigger final
|
|
291
308
|
```
|
|
292
309
|
|
|
293
310
|
Every result entering Leader acceptance is one explicit candidate on its
|
|
@@ -467,7 +484,7 @@ Create a Task-bound Worker instance from the configured global Worker, apply a
|
|
|
467
484
|
Profile, and dispatch a WorkItem:
|
|
468
485
|
|
|
469
486
|
```sh
|
|
470
|
-
yui role show worker
|
|
487
|
+
yui config role show worker
|
|
471
488
|
yui task role add <task-id> implementer --profile implementer
|
|
472
489
|
yui task role show <task-id> implementer
|
|
473
490
|
|
|
@@ -538,7 +555,7 @@ yui task work create <task-id> "Review the implementation" \
|
|
|
538
555
|
--objective "Return source-backed findings" \
|
|
539
556
|
--accept "Every finding identifies an affected path"
|
|
540
557
|
yui task work update <task-id>/<work-item-id> running
|
|
541
|
-
yui profile show reviewer
|
|
558
|
+
yui config profile show reviewer
|
|
542
559
|
```
|
|
543
560
|
|
|
544
561
|
Subagent creation and result delivery happen inside the Leader's native Agent
|
|
@@ -642,55 +659,46 @@ yui task complete <task-id> --summary-file delivery.txt --refresh-remote
|
|
|
642
659
|
yui task reopen <task-id>
|
|
643
660
|
```
|
|
644
661
|
|
|
645
|
-
Completed Tasks reject messages, dispatch,
|
|
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.
|
|
646
663
|
Task lifecycle completion/selection only suggests valid source states: Draft for activate, active for complete, and completed for reopen.
|
|
647
664
|
|
|
648
665
|
## Sessions and tmux
|
|
649
666
|
|
|
650
|
-
|
|
651
|
-
and
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
paused without consuming its bounded delivery retries; detach releases the
|
|
668
|
-
lease and signals only already-durable Role work for reconsideration. Other
|
|
669
|
-
Roles in the same Task continue independently. Before any attach Yui closes
|
|
670
|
-
readline, leaves raw mode, pauses its stdin, and synchronously hands the terminal
|
|
671
|
-
to tmux. The attach uses the real outer terminal capabilities and a clean alternate
|
|
672
|
-
screen; mouse scrolling stays in the Agent pane's
|
|
673
|
-
100,000-line tmux history instead of mixing with earlier shell or IDE terminal
|
|
674
|
-
history. A read-write attachment exposes whatever native interaction the
|
|
675
|
-
existing pane supports, but it is never part of managed startup or delivery.
|
|
676
|
-
|
|
677
|
-
tmux fixes a pane's history capacity when that pane is created. Roles created
|
|
678
|
-
before this limit was configured keep their earlier capacity; Yui warns on
|
|
679
|
-
Terminal attach and in Web so the user can exit and re-enter that Role once to
|
|
680
|
-
create a 100,000-line pane while retaining the native Agent conversation.
|
|
681
|
-
|
|
682
|
-
Global interactive entry remains writable when no writer exists and
|
|
683
|
-
automatically downgrades to read-only when another writer is present; global
|
|
684
|
-
Web keeps one writer per tmux session. Task Web is always read-only. Task CLI
|
|
685
|
-
entry is read-only unless `--read-write` is requested, preventing observation
|
|
686
|
-
from changing Agent execution.
|
|
687
|
-
|
|
688
|
-
```sh
|
|
689
|
-
yui role enter <global-role>
|
|
690
|
-
yui task enter <task-id> [role] [--read-only | --read-write]
|
|
691
|
-
yui task role enter <task-id> <role> [--read-only | --read-write]
|
|
667
|
+
Managed Task Agents use the [hybrid Provider runtime](docs/provider-runtime.md).
|
|
668
|
+
The Controller and Agent Host send Provider-native structured requests; tmux
|
|
669
|
+
and PTY keep the Host alive, show output, and provide an explicit human input
|
|
670
|
+
gateway. Managed prompts are never delivered as terminal bytes.
|
|
671
|
+
|
|
672
|
+
Codex uses a persistent App Server JSON-RPC process. Claude Code uses a
|
|
673
|
+
persistent stream-json process with exact user-message replay acknowledgement.
|
|
674
|
+
Both follow the same Conversation, Activation, Turn, and authority-epoch
|
|
675
|
+
contract. A timeout or uncertain write becomes `delivery-unknown` and is never
|
|
676
|
+
automatically retried.
|
|
677
|
+
|
|
678
|
+
Task Role observation and takeover are explicit:
|
|
679
|
+
|
|
680
|
+
```sh
|
|
681
|
+
yui task role view <task-id> <role>
|
|
682
|
+
yui task role takeover <task-id> <role>
|
|
683
|
+
yui task role release <task-id> <role>
|
|
692
684
|
```
|
|
693
685
|
|
|
686
|
+
`view` is read-only. `takeover` transfers the durable writer authority to the
|
|
687
|
+
human before enabling the Host PTY gateway and requires a live managed Run;
|
|
688
|
+
detach returns it to the Controller. `release` remains available without a live
|
|
689
|
+
Run and idempotently repairs a stranded or partially synchronized takeover.
|
|
690
|
+
Authority cannot transfer while a Provider Turn or input delivery is unsettled.
|
|
691
|
+
|
|
692
|
+
Global Operator and global Role sessions remain native interactive CLIs:
|
|
693
|
+
|
|
694
|
+
```sh
|
|
695
|
+
yui session enter <global-role>
|
|
696
|
+
```
|
|
697
|
+
|
|
698
|
+
tmux fixes a pane's history capacity when that pane is created. Existing panes
|
|
699
|
+
retain their configured capacity; managed runtime output remains observable in
|
|
700
|
+
the Agent Host pane without becoming lifecycle or acknowledgement evidence.
|
|
701
|
+
|
|
694
702
|
Each Role, including a Task-bound Worker instance, can bind multiple configured Agents, has one active Agent, and keeps
|
|
695
703
|
a separate native session per Agent binding. Operator narrows this to at most
|
|
696
704
|
one Agent per adapter—for example, one Codex and one Claude—so its bindings are
|
|
@@ -710,14 +718,12 @@ the terminal Session's immutable effective snapshot in history. Until that
|
|
|
710
718
|
process terminates, exact control-plane wakes continue through its actual
|
|
711
719
|
snapshot instead of applying desired drift as a hot change.
|
|
712
720
|
|
|
713
|
-
Use `yui role unbind <global-role> <agent-id>` or `yui task role unbind <task-id> <role> <agent-id>` to retire a dormant binding. The active binding and any non-stopped native session are rejected; a stopped session record is removed atomically with the binding.
|
|
721
|
+
Use `yui config role unbind <global-role> <agent-id>` or `yui task role unbind <task-id> <role> <agent-id>` to retire a dormant binding. The active binding and any non-stopped native session are rejected; a stopped session record is removed atomically with the binding.
|
|
714
722
|
|
|
715
|
-
Claude session IDs are preallocated at launch.
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
Agent Driver Hook ingress for both CLIs. Global interactive Codex sessions may
|
|
720
|
-
still use its structured `notify` callback for conversation presentation.
|
|
723
|
+
Claude session IDs are preallocated at launch. Codex discovers its native
|
|
724
|
+
thread identity from App Server responses. Managed Task Runs use structured
|
|
725
|
+
Provider observations for both CLIs. Global interactive Codex sessions may
|
|
726
|
+
still use its `notify` callback for conversation presentation.
|
|
721
727
|
|
|
722
728
|
Automated lifecycle and delivery decisions use structured Hook payloads,
|
|
723
729
|
persisted identities, usage snapshots, tmux process state, receipts, and pane
|
|
@@ -847,9 +853,11 @@ The restored management surface includes:
|
|
|
847
853
|
```sh
|
|
848
854
|
yui update
|
|
849
855
|
yui upgrade [--dry-run]
|
|
850
|
-
yui agent add|list|show|capabilities|update|remove
|
|
851
|
-
yui role add|list|show|update|remove|bind|
|
|
852
|
-
yui
|
|
856
|
+
yui config agent add|list|show|capabilities|update|remove
|
|
857
|
+
yui config role add|list|show|update|remove|bind|unbind
|
|
858
|
+
yui config profile add|list|show|update|remove|reset
|
|
859
|
+
yui config completion [bash|zsh|fish]
|
|
860
|
+
yui session enter|record|replace|reconcile
|
|
853
861
|
yui project add|clone|refresh|update|discover|list|show|knowledge
|
|
854
862
|
```
|
|
855
863
|
|