@yankeguo/dsh-devlead 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -6
- package/lib/index.js +1651 -101
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -2,9 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
Core Host service of the DevLead suite (`ctx.devLead`): the durable mode switch, damage-recovery
|
|
4
4
|
`reset()`, Workspace and Session orchestration (including `useWorkspace(agent, request, signal?)`
|
|
5
|
-
with directory creation opt-in), the watched-session notification hub with cold-lead rehydration,
|
|
5
|
+
with directory creation opt-in), the watched-session notification hub with cold-lead rehydration, the mid-turn report channel for watched Sessions,
|
|
6
6
|
and the `devLead` / `devLeadMode` Session projections.
|
|
7
7
|
|
|
8
|
+
DevLead mode is **globally single-active**: at most one Session (across every Workspace) may be
|
|
9
|
+
enabled. `setEnabled(agent, true)` throws `DEVLEAD_ALREADY_ACTIVE` naming the occupant when another
|
|
10
|
+
Session holds it; `off`/`reset` release immediately, archiving or deleting the holder makes it
|
|
11
|
+
releasable, and a restart/rehydration reconciles historical duplicates and keeps one Session.
|
|
12
|
+
Admission is serialized in-process and scans live projections plus the durable corpus.
|
|
13
|
+
|
|
14
|
+
`reportProgress(agent, { message, kind?, summary? }, signal?)` lets a watched, non-DevLead Session
|
|
15
|
+
send a one-way report to its unique active lead. It resolves the supervisor through the hub's
|
|
16
|
+
reverse index, validates size/kind, deduplicates identical messages within a turn, enforces four
|
|
17
|
+
distinct reports per turn (`DEVLEAD_REPORT_RATE_LIMITED`), and otherwise refuses with
|
|
18
|
+
`DEVLEAD_NOT_SUPERVISED`. The receipt is `{ report, durable, queued, warning? }`.
|
|
19
|
+
|
|
20
|
+
The report is first written to a durable outbox (`devlead_report_outbox` over the optional
|
|
21
|
+
`storageDomain` KV facility), then a `plugin:devlead/report` receipt is appended to the lead's
|
|
22
|
+
Session log. The outbox row is removed only after the lead log flush succeeds; a cold/archived/
|
|
23
|
+
unattached lead leaves it for replay on the next boot/lead activation. Rows are pruned after seven
|
|
24
|
+
days, and `/devlead reset` drops that lead's pending rows. A Host without storage-domain returns
|
|
25
|
+
`durable: false` with an explicit warning. `supervisorOf(agent)` / `isSupervised(agent)` are
|
|
26
|
+
synchronous tool-gating queries; `reports(agent, { limit? })` reads the lead digest.
|
|
27
|
+
|
|
28
|
+
Archived holders are not active leads: admission ignores them, writes a durable tombstone when the
|
|
29
|
+
mode-off cannot be written, and `/devlead status` exposes them with the unarchive/off/delete
|
|
30
|
+
recovery path. Opening an unarchived holder reconciles it back to one active lead.
|
|
31
|
+
|
|
8
32
|
Normally installed as part of the bundle:
|
|
9
33
|
|
|
10
34
|
```sh
|
|
@@ -13,13 +37,15 @@ dsh plugin --profile desktop add @yankeguo/dsh-devlead-bundle
|
|
|
13
37
|
|
|
14
38
|
## Requirements
|
|
15
39
|
|
|
16
|
-
- DSH
|
|
40
|
+
- DSH `0.2.2-rc.1`–`0.2.2-rc.4` (the package declares `engines.dsh: >=0.2.2-rc.1 <0.3.0`; this checkout's devDependencies pin rc.1 for the oldest-API typecheck).
|
|
17
41
|
- Peer services `agents`, `sessions`, `sessionProjections` (provided by the default `dsh-base`
|
|
18
42
|
composition).
|
|
19
43
|
- Optional, probed at call time: `workspaceRegistry`, `sessionController`, `sessionTitle`,
|
|
20
|
-
`
|
|
21
|
-
(
|
|
22
|
-
|
|
44
|
+
`agentPresets` (read-only preset roster discovery), `sessionQuery`, `sessionProjectionCache`
|
|
45
|
+
(cold-lead rehydration pre-filter), `sessionPersistence` (durable-corpus readiness barrier),
|
|
46
|
+
`storageDomain` (durable report outbox and archived-holder tombstones), and the experimental
|
|
47
|
+
`worktrees` capability. Missing optional services degrade to fewer features or
|
|
48
|
+
structured domain errors; no experimental package is imported, injected, or declared.
|
|
23
49
|
- Cold-lead rehydration: at plugin load the hub rebuilds its watch index from durable state
|
|
24
50
|
(`sessionQuery` listing → projection-cache pre-filter → exact fold; unclassified rows are capped
|
|
25
51
|
at 64 full-log reads). Without a projection cache only live lead Sessions are recovered. A
|
|
@@ -29,7 +55,8 @@ dsh plugin --profile desktop add @yankeguo/dsh-devlead-bundle
|
|
|
29
55
|
## Configuration
|
|
30
56
|
|
|
31
57
|
The Loader row id `devlead` accepts `notificationBatchMs`, `maxWatchedSessions`,
|
|
32
|
-
`maxListedSessions`, `wakeColdSession` (default `true` since 0.2.0), and `defaultAgentPreset
|
|
58
|
+
`maxListedSessions`, `wakeColdSession` (default `true` since 0.2.0), and `defaultAgentPreset`
|
|
59
|
+
(used when a created Session names no preset; an invalid id fails creation). See the
|
|
33
60
|
[configuration section](https://github.com/yankeguo/dsh-devlead/blob/main/README.md#configuration) for defaults and ranges; all limits are
|
|
34
61
|
validated at both the Loader and direct-construction boundaries.
|
|
35
62
|
|