@dsmm/dsmm 0.2.2 → 0.3.0
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 +8 -10
- package/cordis.patch.yml +14 -0
- package/docs/agent-presets.md +4 -4
- package/docs/compatibility.md +19 -24
- package/docs/deferred-native-approval-risk.md +2 -2
- package/docs/model-routing.md +3 -3
- package/docs/profiles.md +1 -1
- package/docs/releasing.md +46 -6
- package/docs/settings-status.md +2 -2
- package/lib/agent-registry.d.ts +36 -0
- package/lib/agent-registry.js +75 -0
- package/lib/child-admission.d.ts +0 -2
- package/lib/child-admission.js +13 -24
- package/lib/child-capture.d.ts +5 -1
- package/lib/child-capture.js +7 -5
- package/lib/client/children-locales.d.ts +13 -13
- package/lib/client/deployment-controller.js +1 -1
- package/lib/client.js +3 -3
- package/lib/delivery-authority.d.ts +18 -3
- package/lib/delivery-authority.js +149 -12
- package/lib/index.d.ts +2 -2
- package/lib/index.js +13 -26
- package/lib/native-child-evidence.d.ts +1 -3
- package/lib/native-child-evidence.js +0 -29
- package/lib/permission-rpc.js +3 -3
- package/lib/profile-rpc.js +6 -4
- package/lib/profile-store.js +2 -2
- package/lib/role-control-rpc.js +12 -8
- package/lib/role-invocation.d.ts +1 -1
- package/lib/role-policy.d.ts +1 -4
- package/lib/role-policy.js +24 -41
- package/lib/role-providers.d.ts +1 -1
- package/lib/role-providers.js +15 -55
- package/lib/role-runs.d.ts +17 -14
- package/lib/role-runs.js +45 -14
- package/lib/role-subagents.js +16 -6
- package/lib/runtime-integration.d.ts +4 -35
- package/lib/runtime-integration.js +38 -120
- package/lib/session-persistence.d.ts +2 -1
- package/lib/session-persistence.js +1 -1
- package/lib/session-scope.js +4 -1
- package/lib/subagent-runtime.d.ts +19 -7
- package/lib/subagent-runtime.js +141 -15
- package/package.json +110 -100
- package/lib/legacy-child-policy.d.ts +0 -51
- package/lib/legacy-child-policy.js +0 -123
- package/lib/legacy-read-composition.d.ts +0 -20
- package/lib/legacy-read-composition.js +0 -144
- package/lib/legacy-read-contracts.d.ts +0 -157
- package/lib/legacy-read-contracts.js +0 -39
- package/lib/legacy-read-host.d.ts +0 -19
- package/lib/legacy-read-host.js +0 -67
- package/lib/legacy-read-integration.d.ts +0 -121
- package/lib/legacy-read-integration.js +0 -522
- package/lib/legacy-read-proxy.d.ts +0 -26
- package/lib/legacy-read-proxy.js +0 -237
- package/scripts/cold-profile-composition.mjs +0 -329
- package/scripts/cold-profile-sources.mjs +0 -238
- package/scripts/migrate-cold-profile.mjs +0 -315
- package/scripts/repair-session-log.mjs +0 -476
- package/scripts/session-repair-native-verifier.mjs +0 -367
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
DSMM (`@dsmm/dsmm`) adds native configuration, role delegation and child controls to DeepSeek Harness. **DSMM** is the Plugins page and package title; **Deepwork** is its optional workflow module. It isn't an OpenCode compatibility layer.
|
|
4
4
|
|
|
5
|
-
This guide describes the **
|
|
5
|
+
This guide describes the **0.3.0 pure-compatibility source candidate**, targeting exact `@deepseek-ai/dsh@0.2.1-rc.1`, DSH engine range `>=0.2.1-rc.1 <0.3.0-0`, and Node.js 22 or later. Its product surface is the 0.2.2 delivery plus the DSH rc.1 compatibility work and public Agent registry entry; unrelated deployment UI, automatic runtime selection, and release-topology redesign are not part of 0.3.0. A source version is not publication proof: evaluate the exact packed artifact and require terminal release evidence separately.
|
|
6
6
|
|
|
7
7
|
## What the candidate provides
|
|
8
8
|
|
|
@@ -38,7 +38,7 @@ DSMM-managed external LSP isn't enabled in this version. Its implementation, int
|
|
|
38
38
|
|
|
39
39
|
## Use a local artifact
|
|
40
40
|
|
|
41
|
-
Start with the built and packed candidate supplied by
|
|
41
|
+
Start with the exact built and packed 0.3.0 candidate supplied by artifact checks. Do not infer completion from a registry version alone. For a disposable CLI evaluation, the minimal installation step is:
|
|
42
42
|
|
|
43
43
|
```powershell
|
|
44
44
|
$env:DSH_HOME = "<disposable-test-home>"
|
|
@@ -49,13 +49,13 @@ dsh --profile <test-profile> --dump-config
|
|
|
49
49
|
|
|
50
50
|
Use an empty test home and a fresh profile. These are operator-run examples, not permission to install software or touch a real Desktop/TUI profile. Headless needs a separately configured native provider and effective `defaultActive:true` for task execution; it doesn't select Agent presets. Don't copy credentials or account records into a test. `--dump-config` shows native Loader composition, not the full global-aware DSMM admission.
|
|
51
51
|
|
|
52
|
-
For a real installation, authorize the target carrier and profile separately after artifact checks.
|
|
52
|
+
For a real installation, authorize the target DSH `0.2.1-rc.1` carrier and profile separately after artifact checks. Keep the existing provider/account configuration, exact effort, unrelated Loader rows and current history. 0.3.0 supplies no old Desktop/TUI profile migration; a standalone CLI or copied Desktop profile isn't a substitute, and package installation alone doesn't prove Electron activation.
|
|
53
53
|
|
|
54
54
|
### Explicit managed runtime startup
|
|
55
55
|
|
|
56
|
-
The
|
|
56
|
+
The 0.3.0 bundled `cordis.patch.yml` is an explicit cold-start composition. It disables the exact stock `agent` and `subagent` rows, loads one public `@dsmm/dsmm/agent-registry`, one `@dsmm/dsmm/subagent-runtime`, and the main `@dsmm/dsmm` entry in the same Host scope. Missing, duplicate, unready, or wrong service ownership fails closed. Preserve native spawn/fork/model/Gateway services and any deliberate capacity/depth settings. Apply package or patch changes only while the Host is stopped, then restart; running stock services are never hot-replaced or shadowed.
|
|
57
57
|
|
|
58
|
-
`@dsmm/dsmm/subagent-runtime` maps to `lib/runtime-integration.js`;
|
|
58
|
+
`@dsmm/dsmm/agent-registry` maps to the public `DsmmAgentRegistry` entry and `@dsmm/dsmm/subagent-runtime` maps to `lib/runtime-integration.js`; the latter remains the explicit Host-owned startup plugin. 0.3.0 exposes sixteen public exports: it adds Agent registry and retires the legacy-read entry. This composition is not automatic runtime selection or hot replacement. Inspect settled Loader rows, the actual `agents` and `subagents` service owners, `binding`, `deliveryFenceReady`, and `restartRequired`; configuration intent alone is not proof. See [runtime composition](docs/settings-status.md#child-runtime-composition) and [compatibility](docs/compatibility.md).
|
|
59
59
|
|
|
60
60
|
### Configuration and capture boundaries
|
|
61
61
|
|
|
@@ -63,16 +63,14 @@ Resolution is **defaults → sparse global deployment → explicit native entry/
|
|
|
63
63
|
|
|
64
64
|
Startup freezes mounted capabilities. New ordinary roots capture current valid desired deployment; existing roots, including blank ones, and their future children keep their baseline. Explicit idle profile Apply replaces only the permitted overlay on that old baseline. Existing children stay captured. Saves don't remount services or upgrade permissions; absent startup capability requires restart. Global-only `modules.deepwork.enabled` defaults true, while ordinary mode defaults off. Turning the module on from cold-off requires an explicit restart.
|
|
65
65
|
|
|
66
|
-
Global writes retain byte-revision CAS, cooperative locking and final recheck; native profile saves retain their own authorization/CAS. They aren't a cross-layer transaction or protection against every non-cooperating editor. The fixed configuration RPC requires
|
|
66
|
+
Global writes retain byte-revision CAS, cooperative locking and final recheck; native profile saves retain their own authorization/CAS. They aren't a cross-layer transaction or protection against every non-cooperating editor. The fixed configuration RPC requires a real native owner Peer created by Connection, public loopback bind, writable Host and lifetime rechecks. A loopback-looking URL or client assertion doesn't grant access.
|
|
67
67
|
|
|
68
68
|
Durable DSMM metadata needs explicit deployment-only `sessionPersistence` on the main entry, preserving the existing effective root/compression and disabling the exact stock JSONL row at startup. The public `./session-persistence` export is a library building block, not a second Loader entry. See [persistence compatibility](docs/compatibility.md#session-persistence-compatibility).
|
|
69
69
|
|
|
70
70
|
## Upgrade and safety limits
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
Existing exact legacy profile libraries stay read-only with their immutable pins; there is no automatic migration or same-name fallback. Retired `deepseekV4ProMaxReasoningPresets` and `deepseekFlashMaxReasoningPresets` reject with `deprecated-field`; configure explicit levels deliberately, without rewriting old fields automatically. Older auxiliary-root sessions can fail native cold resume. Preserve history and obtain direction rather than substituting a persona or resetting a session.
|
|
72
|
+
0.3.0 does not export the legacy-read host or package repair/cold-migration entrypoints. It accepts current version-3 child captures and current rc.1 persistence only; old captures, old profile libraries and unmarked historical logs refuse without being read, rewritten, copied, or auto-migrated. Retired `deepseekV4ProMaxReasoningPresets` and `deepseekFlashMaxReasoningPresets` reject with `deprecated-field`; configure explicit levels deliberately, without rewriting old fields automatically. Preserve unsupported history and obtain direction rather than substituting a persona or resetting a session. See [compatibility boundaries](docs/compatibility.md#retired-compatibility-surfaces).
|
|
75
73
|
|
|
76
74
|
For earlier ocmm adapters, consult the [historical migration guide](docs/migration-from-ocmm.md). [Source synchronization](docs/skill-sync.md) covers fixed-pin resources and offline readiness. [Release policy](docs/releasing.md) covers publication evidence, which doesn't establish this candidate's Desktop/TUI activation. No user configuration, account, history or installation is automatically changed.
|
|
77
75
|
|
|
78
|
-
*Author's note: For a DSH operator evaluating the local candidate; use an isolated artifact first and authorize each real installation
|
|
76
|
+
*Author's note: For a DSH operator evaluating the local candidate; use an isolated artifact first and authorize each real installation separately. Compatibility repair is not part of 0.3.0.*
|
package/cordis.patch.yml
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
+
- id: agent
|
|
2
|
+
name: '@deepseek-ai/dsh-agent'
|
|
3
|
+
disabled: true
|
|
4
|
+
- id: subagent
|
|
5
|
+
name: '@deepseek-ai/dsh-subagent'
|
|
6
|
+
disabled: true
|
|
1
7
|
- insert:
|
|
8
|
+
- id: dsmm-agent-registry
|
|
9
|
+
name: '@dsmm/dsmm/agent-registry'
|
|
10
|
+
config: {}
|
|
11
|
+
- id: dsmm-subagent-runtime
|
|
12
|
+
name: '@dsmm/dsmm/subagent-runtime'
|
|
13
|
+
inject: [agents]
|
|
14
|
+
config: {}
|
|
2
15
|
- id: dsmm
|
|
3
16
|
name: '@dsmm/dsmm'
|
|
17
|
+
inject: [profileContext, agents]
|
|
4
18
|
config: {}
|
package/docs/agent-presets.md
CHANGED
|
@@ -45,17 +45,17 @@ A running foreground one-shot can be handed to background jobs using the exact p
|
|
|
45
45
|
|
|
46
46
|
The session-scoped Conversation child panel shows actual runs, direct children and a read-only descendant tree. IDs, activity, mode, admitted role/level, route comparison, original evidence and disabled reasons remain separate facts. Corrupt, unsupported or unavailable branches show diagnostics, not fabricated successful results. Descendant inspection doesn't grant control over non-direct children.
|
|
47
47
|
|
|
48
|
-
Route comparison uses
|
|
48
|
+
Route comparison uses the current version-3 `invocation-capture` and the child's latest `own-native-request-header`. Missing, invalid, old-version, or unobserved evidence remains unknown and refuses current resume; it is never inferred from the root route, current profile, role label, or compatibility projection.
|
|
49
49
|
|
|
50
50
|
Human messages target only an admitted direct continuable child with current parent authority and ready delivery fencing. Entries whose observed control projection is read-only remain inspection-only; this isn't the role's tool-level read-only policy. **Queue** accepts a distinct later turn; **Steer** targets the nearest step. Idle/cold continuation keeps the same durable child ID. Native attachment and model admission validate images separately.
|
|
51
51
|
|
|
52
52
|
An inbox receipt means **accepted**, not executed or completed. An interrupt acknowledgment isn't completion and doesn't claim queued work was removed. If transport leaves a send outcome unknown, the draft stays visible and automatic resend is disabled. Inspect the native child conversation before explicitly allowing a new message, which could duplicate an accepted one. Refresh and reconnection never imply automatic retry.
|
|
53
53
|
|
|
54
|
-
## Explicit runtime and
|
|
54
|
+
## Explicit runtime and capture boundaries
|
|
55
55
|
|
|
56
|
-
Managed delivery uses explicit cold-start
|
|
56
|
+
Managed delivery uses the bundled explicit cold-start Agent registry/runtime/Main composition, not automatic replacement by the default bundle. Keep one provider in the same Host scope, preserve native spawn/fork/model/Gateway services, and retain explicit capacity/depth settings. Runtime binding, delivery readiness and restart requirement are observable separately. See [settings](settings-status.md#child-runtime-composition).
|
|
57
57
|
|
|
58
|
-
An old child without
|
|
58
|
+
An old child without a valid version-3 capture is unsupported in 0.3.0 and remains untouched. The legacy-read adapter is not exported or composed; current parent settings cannot be treated as recovered history. See [compatibility](compatibility.md#retired-compatibility-surfaces).
|
|
59
59
|
|
|
60
60
|
Native Host commands, sessions, inbox, permissions, process/cwd/model selection and transports retain ownership. DSMM supplies role admission and bounded controls, not a replacement lifecycle scheduler, generic permission bypass or automatic retry system.
|
|
61
61
|
|
package/docs/compatibility.md
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
# DSMM compatibility and upgrade boundaries
|
|
2
2
|
|
|
3
|
-
This document describes the
|
|
3
|
+
This document describes the **@dsmm/dsmm@0.3.0 source candidate**, not proof of a completed publication. It carries current 0.2.2 behavior onto exact DSH `0.2.1-rc.1` while retiring old DSH, capture/history-format, and Desktop/TUI migration compatibility. Evaluate the exact packed artifact; package checks, native/browser acceptance, registry verification, and terminal completion are distinct evidence.
|
|
4
4
|
|
|
5
5
|
## Supported integration
|
|
6
6
|
|
|
7
7
|
| Surface | Contract | Boundary |
|
|
8
8
|
| --- | --- | --- |
|
|
9
9
|
| Node.js | 22 or later | Required runtime |
|
|
10
|
-
| DSH SDK/component peers | `0.2.0-rc.
|
|
11
|
-
| Cordis / Schemastery | `~4.0.
|
|
10
|
+
| DSH SDK/component peers | exact `0.2.1-rc.1`; engine `>=0.2.1-rc.1 <0.3.0-0` | Trusted 0.3.0 integration target, not a future-version guarantee |
|
|
11
|
+
| Cordis / Schemastery | `~4.0.5` / `~3.18.5` | Declared package contracts |
|
|
12
12
|
| Native Web UI | Plugins item/bundle/row forms, Settings Profiles and Conversation controls | Actual Host identity and capabilities still required |
|
|
13
|
-
| Desktop
|
|
14
|
-
| CLI/headless |
|
|
15
|
-
|
|
|
16
|
-
| Managed child runtime | Explicit cold `./subagent-runtime` composition | Not installed by the default bundle |
|
|
13
|
+
| Desktop/TUI migration | Not supplied by 0.3.0 | Old profiles and carriers are not read, rewritten, copied, or auto-migrated |
|
|
14
|
+
| CLI/headless | DSH `0.2.1-rc.1` native deployment configuration and delegation tools | Current data and permissions only; one-shot headless doesn't select Agent presets |
|
|
15
|
+
| Managed Agent/child runtime | Bundled explicit cold `./agent-registry` + `./subagent-runtime` composition | Restart required; no hot replacement or automatic runtime selection |
|
|
17
16
|
| DSMM-managed external LSP | Not enabled in this version; interfaces and original config retained | Automatic MCP mounting stays off even with `lsp.enabled:true`; DSMM settings UI hides LSP controls |
|
|
18
17
|
|
|
19
18
|
DSMM is the localized package/Core title; Deepwork names its optional module. Deepwork Profiles and `DW …` role labels don't rename package, Loader, command, role, provider or persistence IDs. Native metadata uses exported `locale/en.json` and `locale/zh.json`, not an invented manifest `displayName`.
|
|
@@ -26,11 +25,11 @@ Core settings remain available without a session and with Deepwork cold-off. Nat
|
|
|
26
25
|
|
|
27
26
|
The sparse resolution order is defaults → global deployment → explicit native entry/profile → admitted immutable named overlay. Explicit same-default values remain overrides, objects merge, arrays replace, and unset removes only its own layer's key. Runtime profiles may narrow `roles` and select routing, topology and visible-output locale, but can't grant deployment-only route-override permission, mount services, change accounts or replace persistence. Required-role rules don't create missing startup capability. See [profiles](profiles.md) and [settings/status](settings-status.md).
|
|
28
27
|
|
|
29
|
-
Draft, saved revision, future-default pin and current admission are separate states. Save activates neither scope. Future-default changes leave existing Agents, including blank ones, unchanged. Current-session Apply requires an exact idle ordinary root, selection CAS and admission epoch; it commits only that root's immutable overlay on its existing deployment baseline.
|
|
28
|
+
Draft, saved revision, future-default pin and current admission are separate states. Save activates neither scope. Future-default changes leave existing Agents, including blank ones, unchanged. Current-session Apply requires an exact idle ordinary root, selection CAS and admission epoch; it commits only that root's immutable overlay on its existing deployment baseline. Current-format children retain their original captures, and later children inherit the new parent admission. Busy or stale targets aren't queued.
|
|
30
29
|
|
|
31
30
|
Global CAS uses actual-byte revision, cooperative locking, final recheck and atomic replacement. Native profile saves have separate native authorization/CAS, not a cross-layer transaction. These safeguards don't promise a universal transaction against non-cooperating external editors. Configuration RPC requires native invocation peer equal to the operator, public loopback bind, writable Host and owner/lifetime rechecks. Remote or unknown carriers refuse; a client `isLoopback` claim, tunnel or loopback-looking URL isn't authority.
|
|
32
31
|
|
|
33
|
-
Cold resume creates a new admission using valid deployment and the exact committed sidecar, or the scoped future default when no sidecar exists. Corrupt
|
|
32
|
+
Cold resume creates a new admission using valid current deployment data and the exact committed sidecar, or the scoped future default when no sidecar exists. Corrupt, unavailable, or old-format sidecars and profile libraries refuse without fallback. Clear/compact doesn't transfer choices through inferred lineage. Nothing is automatically copied, rewritten, repaired, or migrated.
|
|
34
33
|
|
|
35
34
|
## Models, roles and native controls
|
|
36
35
|
|
|
@@ -38,7 +37,7 @@ Ordinary roots preserve native provider/model/exact effort across activation, Sa
|
|
|
38
37
|
|
|
39
38
|
Eligible child targets use normal by default; low/high/max require explicit exact-target levels. Unsupported effort refuses without downgrade. Per-role and parameterized topologies preserve canonical target filters, definition/provider identity, role matrix, depth and permission checks at execution. Disabled roles remain diagnosable and routing-editable without becoming callable. Orchestrator isn't a child target. `modelSelectionSettings:false` remains unchanged. See [model routing](model-routing.md).
|
|
40
39
|
|
|
41
|
-
Native child capture records original role, invocation route, locale and authority. Descendants intersect parent allow-lists and accumulate deny-lists. A later parent profile doesn't rewrite child history, lift startup ceilings or recover missing capture. Current exact-parent authority is checked again for delivery, so a retained
|
|
40
|
+
Native child capture version 3 records delegation mode with the original role, invocation route, locale and authority. Descendants intersect parent allow-lists and accumulate deny-lists. A later parent profile doesn't rewrite child history, lift startup ceilings or recover missing or old-format capture. Current exact-parent authority is checked again for delivery, so a retained current capture isn't permission to bypass a newer cutoff. Route comparison uses initial invocation capture and that child's own request header; absent evidence stays unknown.
|
|
42
41
|
|
|
43
42
|
With background explicitly enabled and native jobs available, a published running foreground one-shot can transfer to background as the **same native run**. This doesn't replay a prompt, create a second child or revive settled work. Run receipts distinguish background, already-background, already-settled and cancelled outcomes.
|
|
44
43
|
|
|
@@ -48,25 +47,21 @@ Only an admitted direct continuable child with ready delivery fencing can accept
|
|
|
48
47
|
|
|
49
48
|
## Explicit managed runtime composition
|
|
50
49
|
|
|
51
|
-
The
|
|
50
|
+
The 0.3.0 `cordis.patch.yml` explicitly disables stock ID `agent` / `@deepseek-ai/dsh-agent` and stock ID `subagent` / `@deepseek-ai/dsh-subagent`, then inserts exactly one DSMM Agent registry, one DSMM subagent runtime, and Main. This is a cold-start composition and requires an independent Host restart.
|
|
52
51
|
|
|
53
|
-
|
|
52
|
+
`@dsmm/dsmm/agent-registry` must own the actual `agents` service as `DsmmAgentRegistry`; `@dsmm/dsmm/subagent-runtime` must own `subagents` as `DsmmSubagentRuntime`. Native `name` values assert target identity rather than renaming rows. Check settled Loader state and both live service owners, preserve spawn/fork/model/Gateway services and explicit capacity/depth policy, and keep one owner of each service. Missing or duplicate owners refuse; a running stock service is never hot-shadowed.
|
|
54
53
|
|
|
55
|
-
The public `./
|
|
54
|
+
The public `./agent-registry` export maps to `lib/agent-registry.js`; `./subagent-runtime` maps to `lib/runtime-integration.js`, whose default remains the explicit Host-owned startup plugin. These are two of sixteen public 0.3.0 exports. A resolved module or configured row is not proof of Host ownership. Runtime projection separates `binding: stock | dsmm | unavailable`, `deliveryFenceReady` and `restartRequired`. Missing native history, providers or admission fencing cannot be replaced by an availability flag.
|
|
56
55
|
|
|
57
|
-
##
|
|
56
|
+
## Retired compatibility surfaces
|
|
58
57
|
|
|
59
|
-
|
|
58
|
+
0.3.0 does not export `./legacy-read-host` and does not package session-repair or cold-profile migration scripts. Its current capture reader accepts only version 3. Old captures, old profile libraries, and unmarked historical logs are left untouched and refuse current resume or mutation. A role label, current parent, same-name central document, or serializable assertion cannot reconstruct missing historical authority.
|
|
60
59
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
Cold composition requires actual closed Host callbacks for composition capture, read bindings, call context, audit/retirement fault reporting and revocation. The constructor checks those collaborators; serializable assertions aren't a substitute for real Host operation/approval/audit ownership. Export resolution alone doesn't certify that a carrier supplies them.
|
|
64
|
-
|
|
65
|
-
Cross-process **known-retained-owner cleanup**, **B await/pre-drain ordering** and **published replay** aren't fully verified. This adapter isn't a stable general legacy-execution or cross-process guarantee. An unproven capability remains unavailable, never supplied by a fabricated attestation, inferred approval or permissive fallback. Keep it off for the stable captured-child path; don't weaken existing Core saves, CAS, model intent or permission cutoffs to accommodate it.
|
|
60
|
+
Historical package/tag validators retain their original byte and receipt rules; this release does not reinterpret them or adopt their artifacts. Any separately authorized forensic recovery must use a tool and immutable version chosen for that exact private target, outside the 0.3.0 package and release proof.
|
|
66
61
|
|
|
67
62
|
## Session persistence compatibility
|
|
68
63
|
|
|
69
|
-
DSH `0.2.
|
|
64
|
+
DSH `0.2.1-rc.1`'s stock session compatibility boundary retains the validated DSMM behavior: the public companion delegates to native JSONL in a separate Context and marks only validated `deepwork/mode` and `dsmm/role-policy` records. DSMM-aware readers retain them; stock readers can skip the marked records. Other event types and malformed metadata aren't broadly declared safe.
|
|
70
65
|
|
|
71
66
|
Use the **main** `@dsmm/dsmm` entry's deployment-only `sessionPersistence`. The `./session-persistence` export is a library building block, not a second Loader entry. Set the unchanged effective absolute root and effective `zstd` or `none` compression, disable the exact existing native provider at startup, and wait for the companion to become ready. No root is guessed, migrated or hot-replaced. Incompatible durable providers block custom DSMM appends; ephemeral Hosts without persistence remain allowed.
|
|
72
67
|
|
|
@@ -87,13 +82,13 @@ For a composition using the stock row below, this is a **partial template**, not
|
|
|
87
82
|
|
|
88
83
|
Native patch `config` replaces the whole object. Preserve all existing settings and unrelated rows; another provider ID or a provider-free composition requires its own exact check. Keep one main DSMM Loader source to avoid conflicting native client registrations. Binding, marked durable writes and native/stock read behavior need artifact verification; an export existing isn't proof of persistence ownership.
|
|
89
84
|
|
|
90
|
-
This prevents unsafe future writes but
|
|
85
|
+
This prevents unsafe future writes but does not repair existing unmarked logs. 0.3.0 supplies no repair entrypoint. Don't bypass unknown-event guards, delete history, or silently reset a failed restore.
|
|
91
86
|
|
|
92
87
|
## Installing or upgrading a real Host
|
|
93
88
|
|
|
94
|
-
Use a checked
|
|
89
|
+
Use a checked exact 0.3.0 candidate artifact for evaluation, following the [isolated example](../README.md#use-a-local-artifact). Registry presence is not terminal completion. Publication follows separate [release controls](releasing.md); no automatic Desktop installation is claimed here.
|
|
95
90
|
|
|
96
|
-
|
|
91
|
+
Current CLI/headless evaluation must use a DSH `0.2.1-rc.1` installation-owned carrier, preserve unrelated Loader rows, provider/account catalogs, role policies and UI preferences, and follow explicit startup requirements. 0.3.0 does not supply an old Desktop/TUI migration path, and a renamed or copied profile is not supported activation. Confirm native inventory and actual UI only with authorization; don't use anonymous RPC as a shortcut.
|
|
97
92
|
|
|
98
93
|
Old `deepseekV4ProMaxReasoningPresets` and `deepseekFlashMaxReasoningPresets` fields fail with `deprecated-field`. Don't silently rewrite them; explicit levels need a deliberate configuration edit. Older sessions rooted directly in now-auxiliary roles can fail native cold resume because the root preset isn't registered. Preserve their history and obtain direction rather than substituting another persona. Rollback doesn't authorize credential or history changes.
|
|
99
94
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 原生审批期间切换准入配置:已接受的暂缓风险
|
|
2
2
|
|
|
3
|
-
**状态:风险已接受,暂缓修复;不代表功能已修复。**
|
|
3
|
+
**状态:风险已接受,暂缓修复;不代表功能已修复。** 当前验证目标为 DSH `0.2.1-rc.1`,仅豁免下述场景的阶段性验收,不豁免其他测试失败或发布检查。
|
|
4
4
|
|
|
5
5
|
## 触发条件与影响
|
|
6
6
|
|
|
@@ -14,6 +14,6 @@ DSMM one-shot 委托等待原生审批期间,父 Agent 成功切换 profile
|
|
|
14
14
|
|
|
15
15
|
完整回归保留在 `test/native-core-review-regressions.test.mjs`,默认以明确原因跳过;设置 `DSMM_TEST_DEFERRED_APPROVAL=1` 可重新执行。测试跳过不能计作该场景通过。
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
修复须在当前原生审批与 Activation 接口下建立准确的单次调用关联,并经实际运行验证;不得将一次审批扩展为其他输入或后续调用的授权。
|
|
18
18
|
|
|
19
19
|
解除暂缓须验证:原调用在准入更新后获准并完成;采用原始调用对应的配置;后台延迟执行仍能准确关联;其他输入和后续调用不能继承豁免;取消、owner/realm、工具及 provider 身份、既有请求撤销和历史子 Agent 边界均保持有效。升级、安装、修改外部 SDK 或发布仍需单独授权。
|
package/docs/model-routing.md
CHANGED
|
@@ -89,9 +89,9 @@ Child preparation selects the primary or first resolvable configured candidate i
|
|
|
89
89
|
|
|
90
90
|
Only provider absence established through the public registration directory, or adapter-proven `UNKNOWN_MODEL`, can advance a remaining startup candidate before accepted output/tool fragments. A generic `NO_ADAPTER` from preparation, middleware or an unready registered adapter is not absence proof. Transport, authorization, quota, payment, context and cancelled failures don't authorize model hopping. Partial text, reasoning or tool output forbids automatic retry, including same-route retry. Ordinary roots remain on their native route. See [runtime recovery](runtime-recovery.md).
|
|
91
91
|
|
|
92
|
-
Existing Agents use immutable admitted policy, not a later draft or desired deployment. Idle session Apply creates a new root epoch for future children;
|
|
92
|
+
Existing Agents use immutable admitted policy, not a later draft or desired deployment. Idle session Apply creates a new root epoch for future children; existing current-format children keep their original captures. Cold continuation doesn't reconstruct original settings from the current parent or a role label. Profile storage, native persistence and ownership are separate authorities; see [profiles](profiles.md#storage-and-lifetime) and [compatibility](compatibility.md).
|
|
93
93
|
|
|
94
|
-
New child captures write payload version **
|
|
94
|
+
New child captures write payload version **3**, adding the exact `one-shot` or `continuable` delegation mode to the requested route, effective initial route, effort provenance and resolved parameter policy. The outer envelope/checksum and `.children/v1` storage namespace are unchanged. The 0.3.0 reader accepts only the strict version-3 shape; V1/V2, malformed, unknown-version, or identity-mismatched captures refuse without fallback, rewrite, or migration. A version-3 one-shot child cannot be cold-resumed as live or continuable.
|
|
95
95
|
|
|
96
96
|
## Observed route versus declared route
|
|
97
97
|
|
|
@@ -101,6 +101,6 @@ The child report compares initial route from real `invocation-capture` with live
|
|
|
101
101
|
|
|
102
102
|
Child-only calibration recognizes `deepseek-official/deepseek-v4-pro` and `deepseek-official/deepseek-flash` or `deepseek-account/deepseek-flash`. The Flash model ID is `deepseek-flash`, not a guessed alias. Other providers aren't calibrated by matching model text alone.
|
|
103
103
|
|
|
104
|
-
Each route family retains independent Calibration (`off`, `auto`, `strict`) and DefaultReasoningEffort (`off`, `low`, `high`) settings. Auto preserves explicit effort; strict uses supported policy effort, but neither overwrites an admitted explicit role/child effort. No effort is invented without native reasoning metadata. Ordinary root effort stays native-owned. Parameter passthrough OFF does not run DSMM effort calibration
|
|
104
|
+
Each route family retains independent Calibration (`off`, `auto`, `strict`) and DefaultReasoningEffort (`off`, `low`, `high`) settings. Auto preserves explicit effort; strict uses supported policy effort, but neither overwrites an admitted explicit role/child effort. No effort is invented without native reasoning metadata. Ordinary root effort stays native-owned. Parameter passthrough OFF does not run DSMM effort calibration. The retired `deepseekV4ProMaxReasoningPresets` and `deepseekFlashMaxReasoningPresets` fields reject with `deprecated-field`; explicitly configure levels instead, without automatic migration.
|
|
105
105
|
|
|
106
106
|
*Author's note: For an operator assigning child models; configure exact resources and verify the child's own request route rather than treating role names as model proof.*
|
package/docs/profiles.md
CHANGED
|
@@ -71,7 +71,7 @@ Saves and selections require expected revisions. Cooperative writers share a loc
|
|
|
71
71
|
|
|
72
72
|
The central store is `<resolvedDshHome>/plugins/dsmm/profiles/`, a DSMM convention. Trusted home resolution uses explicit `profileContext.home`, then `DSH_HOME`, then the official `~/.dsh` default. Shared named drafts and immutable revisions are separate from selection/session state scoped to canonical native profile identity and the actual DSMM entry ID. Reads don't create files or locks. Clients and models can't choose arbitrary roots or entry identities.
|
|
73
73
|
|
|
74
|
-
An
|
|
74
|
+
An old `<profileContext.dir>/dsmm-profiles` library is unsupported by 0.3.0. It remains untouched and is not replaced by a same-name central document. Invalid, missing, old-format, linked, unstable, or digest-mismatched references refuse. There is no automatic copy, import, migration, rewrite, or source deletion.
|
|
75
75
|
|
|
76
76
|
Startup freezes deployment and mounted capabilities before consumers install. New ordinary roots capture current valid desired deployment plus the selected immutable overlay. Existing roots, including blank ones, keep their full captures; idle profile Apply replaces only the allowed overlay on that root's old deployment baseline. `getSettings(agent)` is authoritative for an existing Agent. Cold resume creates a new live admission from current valid deployment and its committed sidecar, or the scoped future default when no sidecar exists; it doesn't restore an exited process's memory snapshot.
|
|
77
77
|
|
package/docs/releasing.md
CHANGED
|
@@ -1,8 +1,46 @@
|
|
|
1
1
|
# DSMM Source Readiness, Release and Rollback
|
|
2
2
|
|
|
3
|
-
## 0.
|
|
3
|
+
## 0.3.0 pure compatibility release contract
|
|
4
4
|
|
|
5
|
-
The reviewed
|
|
5
|
+
The reviewed identity is **@dsmm/dsmm@0.3.0**, tag **dsmm-scoped-v0.3.0**, artifact **dsmm-dsmm-0.3.0.tgz**. This release carries the current 0.2.2 product behavior onto exact DSH `0.2.1-rc.1`, with the required public `./agent-registry` entry. It does not support or package old DSH cohorts, old capture/history formats, session-repair entrypoints, or Desktop/TUI cold-profile migration. It never reads, rewrites, or auto-migrates those user resources. Unified deployment/role UI, automatic runtime selection, and the unrelated six-job publication redesign remain outside 0.3.0. Historical tags, packages, assets, receipts, rc.2 SDK/runtime policy, and recovery authority remain immutable.
|
|
6
|
+
|
|
7
|
+
The manifest pins DSH peers and development SDK packages to exact `0.2.1-rc.1` and declares engine range `>=0.2.1-rc.1 <0.3.0-0`. The 0.3.0 release lane builds and packs the source without running test suites, test typechecks, source snapshot comparisons, Docker/browser acceptance, or post-publication native installation tests. Build compilation and resource generation remain required. Historical 0.1.x–0.2.2 receipt validation retains its own native acceptance requirements.
|
|
8
|
+
|
|
9
|
+
The sixteen public exports replace the retired `./legacy-read-host` compatibility entry with `./agent-registry` → `lib/agent-registry.{js,d.ts}`. `COMPILED_NAMES_030` removes the six legacy-read/capture compatibility modules and adds `agent-registry`; the package file policy excludes those compiled compatibility outputs and all repair/cold-migration operator scripts. Release receipts do not claim browser, history, permission, or other runtime tests passed.
|
|
10
|
+
|
|
11
|
+
The packaged startup patch is explicit: disable the exact stock Agent and Subagent rows, load one `DsmmAgentRegistry`, one `DsmmSubagentRuntime`, and Main, then restart the Host. The release neither hot-replaces stock services nor uses `runtime.enabled` or automatic composition.
|
|
12
|
+
|
|
13
|
+
The 0.3.0 transport records `sourceChecks: NOT_RUN_RELEASE_POLICY`, native acceptance and fresh installation as `NOT_RUN_RELEASE_POLICY`, and receipt scope `artifact-integrity-only`. The existing receipt asset filename is retained for transport compatibility; its content is package-integrity evidence, not a Docker test result. Artifact digests, trusted tag/run/attempt identity, registry provenance, and non-overwriting publication remain required. The terminal checker verifies these publication surfaces without executing functional tests or asserting they passed.
|
|
14
|
+
|
|
15
|
+
The workflow retains the existing mutually exclusive ordinary `import-bootstrap` / `prepare` / `publish` lane and `prepare-recovery-022` / `publish-recovery-022` lane, followed by shared `verify` and `github-release`. The completion authority and immutable-failure rules below are unchanged. After the authorized `dsmm-scoped-v0.3.0` run terminates, ordinary completion uses the released checkout and exact run identity:
|
|
16
|
+
|
|
17
|
+
```powershell
|
|
18
|
+
node dsmm/scripts/check-dsmm-release-completion.mjs terminal --run-id <run> --run-attempt <attempt> --control-sha <released-commit> --receipt <new-030-terminal-receipt.json>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Only exit 0 with receipt outcome `COMPLETED` establishes completion. A workflow conclusion, producer boolean, local build, registry visibility, or browser receipt alone does not.
|
|
22
|
+
|
|
23
|
+
## Historical 0.2.2 stable native release contract
|
|
24
|
+
|
|
25
|
+
The reviewed source identity is **@dsmm/dsmm@0.2.2**, tag **dsmm-scoped-v0.2.2**, artifact **dsmm-dsmm-0.2.2.tgz**. The tag is permanently fixed to **dff1ac8ffd58316455256ef1c64c19d6e73e1293**. This is a distinct source and acceptance contract, not a relabelled 0.2.1 or 0.2.0 receipt or an inferred later-version override. Every historical tag, package, asset and receipt remains immutable. A working checkout or local smoke receipt is not release completion or publication authorization.
|
|
26
|
+
|
|
27
|
+
### Restricted unpublished recovery
|
|
28
|
+
|
|
29
|
+
The same trusted `.github/workflows/dsmm-release.yml` accepts only the explicit dispatch selector `recovery=unpublished-0.2.2` on `master` for recovery. An omitted or empty selector retains the frozen 0.1.2 bootstrap entry; unknown selectors or additional inputs fail closed. This is a new run with genuine new workflow/event/control identity, not a rerun of the original source-tag workflow. Only the recovery prepare/publish pair has `contents: write` for authenticated read-only draft-aware Release admission; the ordinary prepare/publish pair retains `contents: read`. OIDC write permission remains confined to the two mutually exclusive publishers.
|
|
30
|
+
|
|
31
|
+
`release-recovery-022.mjs` admits only original workflow ID **374825007**, run **38822000490**, current and fixed attempt **1**, terminal `prepare=failure` and the four other original jobs skipped, with no accepted artifact. At recovery entry and immediately before the sole irreversible publish, it rechecks that history, trusted master ancestry, the unchanged remote tag, exact npm version 404, and authenticated complete paginated absence of public or draft Releases. Network ambiguity, another attempt, an existing package/Release, incomplete pagination or partial publication stops without repair, overwrite or publish retry. Post-publication verification and terminal checks do not require absence.
|
|
32
|
+
|
|
33
|
+
Control is checked out at the actual new `github.workflow_sha`; product source is independently checked out at the fixed original commit. Runtime image context, SDK extraction, dependency installation, source tests, materialization, build, generation and the single pnpm pack all use **source**, not control. `assert-source`, `pack` and recovery `freeze` require `--source-root <independent-source-checkout>` as a per-job CLI argument. Guards bind real independent paths, original source HEAD/tag/version and clean `PACK_INPUTS`, plus the new control HEAD and required control files. Absolute checkout paths and dynamic absence observations are never persisted in cross-job context. Control script fixes and this document must not be copied into the original product package. Any native gate failure requiring product changes must stop and be reported.
|
|
34
|
+
|
|
35
|
+
Automatic OIDC provenance truthfully describes `.github/workflows/dsmm-release.yml@refs/heads/master`, its new control commit, actual `workflow_dispatch`, hosted builder and new run/attempt. The attestation's SHA512 subject must equal the frozen package. The receipt distinguishes `productSourceSha` from `attestedControlSha`; it does not claim that the original source tag is the attested workflow checkout. Fixed policy, source guards, artifact identity and independent remote-tag verification bind that product source. No GitHub environment identity or provenance is synthesized.
|
|
36
|
+
|
|
37
|
+
The parent-owned release invocation, after its integration gates and explicitly authorized Git delivery, is:
|
|
38
|
+
|
|
39
|
+
```powershell
|
|
40
|
+
gh workflow run dsmm-release.yml --repo hugefiver/ocmm --ref master -f recovery=unpublished-0.2.2
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Dispatch is not completion. Preserve the original tag and any partially published package or assets on every failure; any subsequent same-identity rerun needs separate authorization.
|
|
6
44
|
|
|
7
45
|
### Stable delivery boundary
|
|
8
46
|
|
|
@@ -55,7 +93,7 @@ The required dedicated workflow sequence is:
|
|
|
55
93
|
|
|
56
94
|
The real compiled browser gate uses the native Renderer and supported composition-owned operator/Gateway at **1280×900**, with a local deterministic SDK provider and no online account, credentials or quota. Its exact six checks are `publicNativeCapturedChild`, `browserEditSaveWarning`, `browserFutureApplyAndStaleCas`, `browserCurrentApplyAndStaleCas`, `browserChildrenNativeInboxReceipt` and `browserChildrenNativeMessage`. The same receipt also requires a browser-triggered foreground-to-background transition for the exact published native run/child, one idempotent native job, actual job completion/output, read-only child denials and no-event/no-model-call cutoff refusals. Page errors and external requests must be empty; the producer must observe genuine native child message delivery and captured metadata, not merely return completion callbacks. No pre-CI local smoke receipt satisfies this gate: each new frozen CI tarball must exercise these surfaces again.
|
|
57
95
|
|
|
58
|
-
The required read-only hook support set is `profile-ui-harness-{server,browser,native}.mjs`, `native-picker-{harness,browser,proof}.mjs`, `release-contract.mjs`, `stable-native-acceptance.mjs
|
|
96
|
+
The required read-only hook support set is `profile-ui-harness-{server,browser,native}.mjs`, `native-picker-{harness,browser,proof}.mjs`, `release-contract.mjs`, `stable-native-acceptance.mjs`, `profile-ui-harness-stable021{,-native}.mjs` and `native-preset-smoke.mjs`. Both prepare paths call the executable `release-native-gate.mjs` seam, which supplies and validates the complete explicit support set before invoking Docker. The stable021-named files are shared behavior producers, not fixed receipt identities: exact 0.2.2 dispatches to `runStableNativeAcceptance` with `sourceContract: "0.2.2"`, checks the installed manifest and passes that identity into the native browser producer. The historical hook remains available for its own identities. The owned shell renders actual installed Profiles/Children contributions using the native Renderer and native UiSession scope, without replacing vendor bundles or manufacturing a session binding.
|
|
59
97
|
|
|
60
98
|
The owned native root uses the supported `standard` preset composition, including a Jobs controller serving its actual owner scope. Captured child identity binds the native session ID, admission epoch, route and immutable capture; start-count evidence compares the native child catalog. Background request-count evidence binds the original child model and fixture invocation, while native parent completion handling retains the parent's model authority.
|
|
61
99
|
|
|
@@ -63,13 +101,15 @@ The 0.2.2 registry visibility budget is **120,000 ms** by default, with at most
|
|
|
63
101
|
|
|
64
102
|
### Terminal authority and immutable failure handling
|
|
65
103
|
|
|
66
|
-
After the authorized matching workflow terminates, use the
|
|
104
|
+
After the authorized matching workflow terminates, use the exact **new control HEAD** checkout and a new receipt path for recovery:
|
|
67
105
|
|
|
68
106
|
```powershell
|
|
69
|
-
node dsmm/scripts/check-dsmm-release-completion.mjs terminal --run-id <
|
|
107
|
+
node dsmm/scripts/check-dsmm-release-completion.mjs terminal --recovery unpublished-0.2.2 --run-id <new-run> --run-attempt <actual-attempt> --control-sha <new-control-head> --receipt <new-022-terminal-receipt.json>
|
|
70
108
|
```
|
|
71
109
|
|
|
72
|
-
Only exit **0** with receipt outcome **COMPLETED** proves release completion.
|
|
110
|
+
Only exit **0** with receipt outcome **COMPLETED** proves release completion. New controls fix the topology to `split-recovery-022-v1` in a dedicated context field, separate from the standard workflow object. Exactly seven jobs are required: `import-bootstrap`, `prepare`, `publish`, `prepare-recovery-022`, `publish-recovery-022`, `verify`, `github-release`. Recovery requires the first three skipped and the last four successful; ordinary runs require the recovery pair skipped and the original mode-specific conclusions. The terminal checker pins topology from the exact trusted control HEAD, not an artifact's self-description or observed job count. Historical five-job validation and fixed published-continuation identities remain separate and unchanged. Ordinary new-control terminal invocations omit `--recovery`.
|
|
111
|
+
|
|
112
|
+
The product source/tag, genuine new control/event/ref, fixed new run/attempt, fresh complete Docker/native/UI/LSP acceptance, registry bytes/provenance, fresh native install, accepted/proof artifacts bound to `head_sha=<new-control>` and `head_branch=master`, and exactly three public Release assets with checksums must agree. `verify` and `github-release` directly depend on both pairs and explicitly accept only the selected pair's success with the other skipped. Accepted artifact ID selection rejects empty or dual outputs **before** download. Workflow success, source tests, local packed smoke or an installed package alone are insufficient. Exit 1/FAILED or 2/UNRESOLVED preserves partial publication: report it, do not move/delete/recreate the tag, adopt another run's proof, repack, overwrite packages/assets or repair in place. A new version or same-identity rerun needs its applicable separate authorization.
|
|
73
113
|
|
|
74
114
|
Actual production login and Electron/Desktop activation remain unexercised; local installation or global/session migration is not authorized by the release proof. Rollback uses supported carrier operations and reviewed immutable versions with CAS/ownership checks, never credential/session restoration or overwriting later user changes.
|
|
75
115
|
|
package/docs/settings-status.md
CHANGED
|
@@ -62,10 +62,10 @@ Read-only configuration projections redact LSP command/arguments/cwd, preset roo
|
|
|
62
62
|
|
|
63
63
|
Default deployment uses foreground one-shot work: `enableRunInBackground:false`, `backgroundMode:"one-shot"`, and omitted `maxDepth` delegates to the native Host limit. Captured settings and actual startup capabilities determine availability. A configured flag isn't proof that jobs, persistence, continuation or delivery fencing is ready.
|
|
64
64
|
|
|
65
|
-
The
|
|
65
|
+
The 0.3.0 build exports `@dsmm/dsmm/agent-registry` (`./agent-registry`) and `@dsmm/dsmm/subagent-runtime` (`./subagent-runtime`) for explicit cold-start composition. The bundled [patch](../cordis.patch.yml) disables the exact stock Agent and Subagent rows and installs one DSMM owner for each service before Main. Verify settled Loader identities and actual service constructors, preserve spawn/fork/model/Gateway services and explicit capacity/depth configuration, then restart. Missing or duplicate ownership refuses; there is no hot replacement or automatic runtime selection.
|
|
66
66
|
|
|
67
67
|
The public runtime projection reports `binding: stock | dsmm | unavailable`, `deliveryFenceReady`, `restartRequired`, and a bounded reason when applicable. Loading Core, saving settings or seeing a role catalog doesn't prove fenced delivery. Managed continuation requires the explicit ready composition. Native lifecycle, inbox, jobs and storage remain native-owned; DSMM doesn't install a second scheduler or retry controller.
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
0.3.0 accepts only current version-3 child captures. Old or incomplete capture evidence refuses without falling back to current parent settings, role labels, or fabricated approval/durability guarantees. The legacy-read adapter is not exported or composed. See [compatibility](compatibility.md#retired-compatibility-surfaces).
|
|
70
70
|
|
|
71
71
|
*Author's note: For a DSH deployment operator; distinguish a successful configuration save from captured runtime availability before applying policy.*
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
import { AgentRegistry } from "@deepseek-ai/dsh-agent";
|
|
3
|
+
import type { Agent, AgentHandle, CreateAgentOptions, ResumeAgentOptions } from "@deepseek-ai/dsh-agent";
|
|
4
|
+
import type { SessionId } from "@deepseek-ai/dsh-session";
|
|
5
|
+
import { SubagentError } from "@deepseek-ai/dsh-subagent";
|
|
6
|
+
export interface ManagedCreation {
|
|
7
|
+
readonly registry: AgentRegistry;
|
|
8
|
+
readonly parent: Agent;
|
|
9
|
+
readonly childId: SessionId;
|
|
10
|
+
readonly kind: "fresh" | "cold";
|
|
11
|
+
readonly delegationMode?: "one-shot" | "continuable";
|
|
12
|
+
readonly owner: object;
|
|
13
|
+
readonly ownerSignal?: AbortSignal;
|
|
14
|
+
entered(agent: Agent): void;
|
|
15
|
+
claimed: boolean;
|
|
16
|
+
child?: Agent;
|
|
17
|
+
retired: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function managedCancellation(reason: unknown): SubagentError;
|
|
20
|
+
export declare function isManagedCancellation(error: unknown): boolean;
|
|
21
|
+
export declare const exactRegistry: (registry: AgentRegistry) => AgentRegistry;
|
|
22
|
+
export declare function duringManagedCreation<T>(operation: ManagedCreation, run: () => T): T;
|
|
23
|
+
export declare function currentManagedCreation(): ManagedCreation | undefined;
|
|
24
|
+
export declare function duringActivationOwnership<T>(signal: AbortSignal, run: () => T): T;
|
|
25
|
+
export declare function activationOwnerSignal(): AbortSignal | undefined;
|
|
26
|
+
/** Startup-only agents provider. Factory, traced caller, ownership and handles stay native. */
|
|
27
|
+
export declare class DsmmAgentRegistry extends AgentRegistry {
|
|
28
|
+
readonly managedLifetime: AbortController;
|
|
29
|
+
constructor(ctx: Context);
|
|
30
|
+
create(options: CreateAgentOptions): Promise<AgentHandle>;
|
|
31
|
+
resume(options: ResumeAgentOptions): Promise<AgentHandle>;
|
|
32
|
+
enter(agent: Agent, owner: Agent | undefined): () => void;
|
|
33
|
+
private creation;
|
|
34
|
+
}
|
|
35
|
+
export default DsmmAgentRegistry;
|
|
36
|
+
//# sourceMappingURL=agent-registry.d.ts.map
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
import { symbols } from "@deepseek-ai/cordis";
|
|
3
|
+
import { AgentRegistry } from "@deepseek-ai/dsh-agent";
|
|
4
|
+
import { SubagentError } from "@deepseek-ai/dsh-subagent";
|
|
5
|
+
import { scopeLifetime } from "./delivery-authority.js";
|
|
6
|
+
const creations = new AsyncLocalStorage();
|
|
7
|
+
const holders = new AsyncLocalStorage();
|
|
8
|
+
const cancellations = new WeakSet();
|
|
9
|
+
export function managedCancellation(reason) {
|
|
10
|
+
const error = new SubagentError("Managed activation owner cancelled", "ABORTED", { cause: reason });
|
|
11
|
+
cancellations.add(error);
|
|
12
|
+
return error;
|
|
13
|
+
}
|
|
14
|
+
export function isManagedCancellation(error) { return typeof error === "object" && error !== null && cancellations.has(error); }
|
|
15
|
+
export const exactRegistry = (registry) => Reflect.get(registry, symbols.original) ?? registry;
|
|
16
|
+
export function duringManagedCreation(operation, run) { return creations.run(operation, run); }
|
|
17
|
+
export function currentManagedCreation() { return creations.getStore(); }
|
|
18
|
+
export function duringActivationOwnership(signal, run) { return holders.run(signal, run); }
|
|
19
|
+
export function activationOwnerSignal() { return holders.getStore(); }
|
|
20
|
+
/** Startup-only agents provider. Factory, traced caller, ownership and handles stay native. */
|
|
21
|
+
export class DsmmAgentRegistry extends AgentRegistry {
|
|
22
|
+
managedLifetime = new AbortController();
|
|
23
|
+
constructor(ctx) {
|
|
24
|
+
if (ctx.get("agents") !== undefined)
|
|
25
|
+
throw new SubagentError("DSMM agents requires one startup provider; restart to change it.", "DUPLICATE_PROVIDER");
|
|
26
|
+
super(ctx);
|
|
27
|
+
scopeLifetime(ctx, "dsmm.agents: retire managed residency", () => this.managedLifetime.abort());
|
|
28
|
+
}
|
|
29
|
+
create(options) {
|
|
30
|
+
return this.creation("fresh", options.sessionId, options.parentAgent, options.signal, signal => super.create(signal === options.signal ? options : { ...options, signal }));
|
|
31
|
+
}
|
|
32
|
+
resume(options) {
|
|
33
|
+
return this.creation("cold", options.resumeSessionId, options.parentAgent, options.signal, signal => super.resume(signal === options.signal ? options : { ...options, signal }));
|
|
34
|
+
}
|
|
35
|
+
enter(agent, owner) {
|
|
36
|
+
const detach = super.enter(agent, owner);
|
|
37
|
+
const operation = creations.getStore();
|
|
38
|
+
if (operation?.claimed && operation.registry === exactRegistry(this) && operation.parent === owner && operation.childId === agent.id) {
|
|
39
|
+
try {
|
|
40
|
+
operation.entered(agent);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
detach();
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return detach;
|
|
48
|
+
}
|
|
49
|
+
async creation(kind, id, parent, source, run) {
|
|
50
|
+
const operation = creations.getStore();
|
|
51
|
+
if (operation !== undefined && operation.registry === exactRegistry(this) && operation.parent === parent
|
|
52
|
+
&& operation.childId === id && operation.kind === kind) {
|
|
53
|
+
if (operation.claimed || operation.retired || this.managedLifetime.signal.aborted || source === undefined) {
|
|
54
|
+
throw new SubagentError("Managed creation requires its exact unused operation", "UNAUTHORIZED");
|
|
55
|
+
}
|
|
56
|
+
operation.claimed = true;
|
|
57
|
+
}
|
|
58
|
+
if (source === undefined)
|
|
59
|
+
return run(source);
|
|
60
|
+
// Creation-only cancellation must not end an accepted root or native child residency.
|
|
61
|
+
const relay = new AbortController();
|
|
62
|
+
const abort = () => relay.abort(source.reason);
|
|
63
|
+
source.addEventListener("abort", abort, { once: true });
|
|
64
|
+
if (source.aborted)
|
|
65
|
+
abort();
|
|
66
|
+
try {
|
|
67
|
+
return await run(relay.signal);
|
|
68
|
+
}
|
|
69
|
+
finally {
|
|
70
|
+
source.removeEventListener("abort", abort);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
export default DsmmAgentRegistry;
|
|
75
|
+
//# sourceMappingURL=agent-registry.js.map
|
package/lib/child-admission.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import type { ChildAdmissionEvidence, ChildAdmissionEvidenceView, ChildEvidenceF
|
|
|
5
5
|
import type { DeliveryPolicyBinding, DsmmDeliveryAuthority } from "./delivery-authority.js";
|
|
6
6
|
import type { DshAgent } from "./dsh-types.js";
|
|
7
7
|
import type { NativeChildHistory } from "./native-child-evidence.js";
|
|
8
|
-
import type { LegacyCapabilityCollaborators } from "./legacy-child-policy.js";
|
|
9
8
|
import type { DsmmProfileAdmission, DsmmSettings } from "./settings.js";
|
|
10
9
|
export interface ChildAdmissionCollaborators {
|
|
11
10
|
/** A owns resident/durable capture lookup and corruption-vs-absence decisions. */
|
|
@@ -23,7 +22,6 @@ export interface ChildAdmissionBindingOptions {
|
|
|
23
22
|
readonly nativeSubstrate: DsmmSettings;
|
|
24
23
|
/** The exact public Host query service, borrowed in the same scope as the native catalog. */
|
|
25
24
|
readonly nativeHistory: NativeChildHistory;
|
|
26
|
-
readonly legacyCapabilities: LegacyCapabilityCollaborators;
|
|
27
25
|
}
|
|
28
26
|
/** Connects A's structural contract to C1's opaque ticket provenance without manufacturing Agents. */
|
|
29
27
|
export declare function createChildAdmissionBinding(options: ChildAdmissionBindingOptions): {
|