@dsmm/dsmm 0.2.2 → 0.3.1
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 +26 -42
- package/cordis.patch.yml +1 -0
- package/docs/agent-presets.md +26 -14
- package/docs/compatibility.md +20 -79
- package/docs/deferred-native-approval-risk.md +8 -12
- package/docs/design.md +25 -254
- package/docs/lsp.md +2 -2
- package/docs/migration-from-ocmm.md +38 -51
- package/docs/model-routing.md +21 -21
- package/docs/native-permissions.md +17 -7
- package/docs/profiles.md +13 -9
- package/docs/releasing.md +34 -240
- package/docs/roadmap.md +23 -254
- package/docs/runtime-recovery.md +29 -91
- package/docs/safety-guards.md +19 -16
- package/docs/settings-status.md +23 -11
- package/docs/skill-sync.md +17 -17
- package/docs/web-fetch-fakeip.md +82 -0
- package/lib/child-capture.d.ts +16 -2
- package/lib/child-capture.js +29 -10
- package/lib/client/ChildrenPanel.d.ts +1 -4
- package/lib/client/ChildrenPanel.js +4 -16
- package/lib/client/DeploymentFields.d.ts +28 -0
- package/lib/client/DeploymentFields.js +68 -0
- package/lib/client/DeploymentPage.d.ts +17 -5
- package/lib/client/DeploymentPage.js +79 -112
- package/lib/client/NativeCommandEntries.d.ts +17 -0
- package/lib/client/NativeCommandEntries.js +68 -0
- package/lib/client/PermissionsPanel.d.ts +1 -1
- package/lib/client/PermissionsPanel.js +8 -8
- package/lib/client/ProfilesSection.js +7 -5
- package/lib/client/RoleToolView-data.d.ts +35 -0
- package/lib/client/RoleToolView-data.js +52 -0
- package/lib/client/RoleToolView-locales.d.ts +36 -0
- package/lib/client/RoleToolView-locales.js +20 -0
- package/lib/client/RoleToolView.d.ts +10 -0
- package/lib/client/RoleToolView.js +47 -0
- package/lib/client/SessionProfiles.js +39 -15
- package/lib/client/children-controller.d.ts +2 -8
- package/lib/client/children-controller.js +1 -26
- package/lib/client/children-locales.d.ts +26 -51
- package/lib/client/children-locales.js +8 -12
- package/lib/client/configuration-display.d.ts +5 -0
- package/lib/client/configuration-display.js +11 -0
- package/lib/client/controller.d.ts +1 -0
- package/lib/client/controller.js +20 -13
- package/lib/client/deployment-controller.d.ts +13 -1
- package/lib/client/deployment-controller.js +85 -25
- package/lib/client/deployment-data.d.ts +1 -0
- package/lib/client/deployment-data.js +4 -1
- package/lib/client/deployment-locales.d.ts +43 -0
- package/lib/client/deployment-locales.js +35 -9
- package/lib/client/deployment-modules.d.ts +9 -0
- package/lib/client/deployment-modules.js +24 -0
- package/lib/client/deployment-workspace.d.ts +48 -0
- package/lib/client/deployment-workspace.js +123 -0
- package/lib/client/index.js +11 -74
- package/lib/client/locales.d.ts +7 -0
- package/lib/client/locales.js +12 -6
- package/lib/client/permission-controller.d.ts +1 -0
- package/lib/client/permission-controller.js +3 -2
- package/lib/client/permission-locales.d.ts +25 -0
- package/lib/client/permission-locales.js +24 -4
- package/lib/client/session-labels.js +4 -3
- package/lib/client/styles.d.ts +1 -1
- package/lib/client/styles.js +9 -8
- package/lib/client.js +2716 -2364
- package/lib/commands.js +2 -0
- package/lib/config-file-store.d.ts +3 -0
- package/lib/config-file-store.js +4 -2
- package/lib/config-revision.d.ts +5 -0
- package/lib/config-revision.js +11 -0
- package/lib/core-permission-authority.js +11 -41
- package/lib/deployment-config.d.ts +9 -2
- package/lib/deployment-config.js +35 -8
- package/lib/deployment-permission-rules.js +19 -7
- package/lib/dsh-types.d.ts +1 -1
- package/lib/host-llm-startup.js +3 -3
- package/lib/host-llm.d.ts +9 -3
- package/lib/host-llm.js +48 -8
- package/lib/index.d.ts +17 -21
- package/lib/index.js +131 -430
- package/lib/lifetime.d.ts +4 -0
- package/lib/lifetime.js +22 -0
- package/lib/live-pi-ai-owner.d.ts +1 -0
- package/lib/live-pi-ai-owner.js +8 -4
- package/lib/mode.d.ts +3 -2
- package/lib/mode.js +28 -41
- package/lib/model-routing.d.ts +2 -8
- package/lib/model-routing.js +59 -175
- package/lib/native-admission.d.ts +56 -0
- package/lib/native-admission.js +313 -0
- package/lib/native-pi-ai-wire.d.ts +3 -1
- package/lib/native-pi-ai-wire.js +47 -13
- package/lib/permission-control.d.ts +0 -3
- package/lib/permission-rpc.js +3 -3
- package/lib/preset-registry.js +3 -2
- package/lib/preset-skills.d.ts +3 -12
- package/lib/preset-skills.js +28 -58
- package/lib/profile-diagnostics.d.ts +1 -1
- package/lib/profile-diagnostics.js +2 -2
- package/lib/profile-remote.js +61 -22
- package/lib/profile-rpc.d.ts +4 -3
- package/lib/profile-rpc.js +39 -41
- package/lib/profile-runtime.d.ts +31 -74
- package/lib/profile-runtime.js +224 -639
- package/lib/profile-store.d.ts +18 -6
- package/lib/profile-store.js +106 -64
- package/lib/profile-types.d.ts +18 -4
- package/lib/profiles.d.ts +3 -1
- package/lib/profiles.js +9 -7
- package/lib/prompt-content.d.ts +1 -0
- package/lib/prompt-content.js +4 -1
- package/lib/prompts.d.ts +2 -12
- package/lib/prompts.js +11 -66
- package/lib/role-control-remote.d.ts +1 -4
- package/lib/role-control-remote.js +8 -36
- package/lib/role-control-rpc.d.ts +10 -36
- package/lib/role-control-rpc.js +112 -265
- package/lib/role-control-types.d.ts +3 -26
- package/lib/role-control-types.js +3 -4
- package/lib/role-identity.d.ts +5 -0
- package/lib/role-identity.js +10 -0
- package/lib/role-invocation.d.ts +2 -2
- package/lib/role-llm-runtime.js +5 -11
- package/lib/role-policy.d.ts +19 -53
- package/lib/role-policy.js +136 -525
- package/lib/role-providers.d.ts +5 -8
- package/lib/role-providers.js +20 -126
- package/lib/role-routing.d.ts +1 -3
- package/lib/role-routing.js +24 -34
- package/lib/role-subagents.d.ts +5 -14
- package/lib/role-subagents.js +149 -97
- package/lib/runtime-integration.d.ts +5 -109
- package/lib/runtime-integration.js +11 -779
- package/lib/session-metadata.d.ts +13 -12
- package/lib/session-metadata.js +6 -31
- package/lib/session-scope.js +6 -2
- package/lib/settings.d.ts +5 -18
- package/lib/settings.js +19 -43
- package/lib/state.d.ts +3 -2
- package/lib/state.js +26 -10
- package/lib/status.d.ts +1 -9
- package/lib/status.js +3 -55
- package/lib/web-fetch-address-policy.d.ts +24 -0
- package/lib/web-fetch-address-policy.js +189 -0
- package/lib/web-fetch-fakeip.d.ts +25 -0
- package/lib/web-fetch-fakeip.js +107 -0
- package/package.json +133 -113
- package/docs/research/deepseek-v4-pro.md +0 -74
- package/docs/research/oh-dsh.md +0 -96
- package/lib/child-admission.d.ts +0 -42
- package/lib/child-admission.js +0 -162
- package/lib/delivery-authority.d.ts +0 -68
- package/lib/delivery-authority.js +0 -260
- 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/lib/native-child-evidence.d.ts +0 -42
- package/lib/native-child-evidence.js +0 -133
- package/lib/role-runs.d.ts +0 -135
- package/lib/role-runs.js +0 -304
- package/lib/session-persistence.d.ts +0 -35
- package/lib/session-persistence.js +0 -304
- package/lib/subagent-runtime.d.ts +0 -45
- package/lib/subagent-runtime.js +0 -131
- package/prompts/deepseek-flash.md +0 -11
- package/prompts/deepseek-v4-pro.md +0 -14
- 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/docs/settings-status.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Deepwork settings and status
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
DSMM 0.3.1 targets exactly DSH `0.2.1-rc.2`. Named policy is covered in [profiles](profiles.md), routing in [model routing](model-routing.md), and child authority in [Agent presets](agent-presets.md).
|
|
4
4
|
|
|
5
5
|
## Deployment layers and native editors
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ Effective settings resolve from **defaults → sparse global base → explicit n
|
|
|
8
8
|
|
|
9
9
|
<a id="native-plugins-configuration-d"></a>
|
|
10
10
|
|
|
11
|
-
**Plugins → DSMM**
|
|
11
|
+
**Plugins → DSMM bundle config** is the single deployment configuration surface, registered as `plugins.bundle.config` for `@dsmm/dsmm`. The scope selector chooses Global or current native-profile overrides; module buttons open in-area drawers. Global edits use fixed `remote.dsmmConfig`. Profile edits use the public native form resolved from the authenticated snapshot's actual namespace. Runtime entry ID, package ID, row ID and form namespace aren't interchangeable. A profile write requires the actual descriptor revision and matching raw base/user provenance. Missing or mismatched identity leaves the profile scope unavailable or read-only, never falling back to Global. Named Profiles retains its separate Settings/header entries; no duplicate permission page or Conversation configuration tabs are registered.
|
|
12
12
|
|
|
13
13
|
Global and native-profile controls have independent Save, Refresh and Discard actions and revisions. There's no Save all or cross-layer transaction. Missing keys inherit, explicit same-default values pin, and Unset removes only the edited layer's key, not a higher Host pin. Plain objects merge recursively and arrays replace. Full merged validation follows sparse-layer validation; unknown/prototype keys, non-JSON values and raw volatile refs refuse.
|
|
14
14
|
|
|
@@ -20,7 +20,7 @@ LSP isn't an applicable UI setting in this version. Its implementation, interfac
|
|
|
20
20
|
|
|
21
21
|
`dsmmConfig.describe`, `describeModules`, `describeSettings` and `save` use the existing local writable operator boundary. The native invocation peer must equal `connection.operator`, public `webServer.host` must be exactly `127.0.0.1`, and `settings.writable` must be true. A client loopback assertion, tunnel or reverse proxy isn't authority. These aren't model-visible tools and accept no arbitrary file, root or entry arguments.
|
|
22
22
|
|
|
23
|
-
Global saves use expected
|
|
23
|
+
Global saves use expected metadata versions, cooperative locking, a final version recheck and same-directory atomic replacement. `stat-v1-<mtimeNs>-<ctimeNs>` is not a content-integrity proof. Authority and lifetime are rechecked before commit. Rename commits the save; a failed final observation returns success with `revision:"unavailable"` and `refreshRequired:true`, requiring refresh before another mutation. Native-entry versions use the actual `settings.describe` descriptor (`native-v1-<revision>`) or report unavailable. Native-profile saves retain the Host's numeric form revision CAS. External editors can still race at rename or change content without a distinguishable stat version. A save acknowledges its layer, not adoption by every live consumer.
|
|
24
24
|
|
|
25
25
|
Native ConfigEditor can emit `loader/partial-dispose` during empty-pending reconciliation without actual fiber or Agent disposal. The signal alone isn't proof of a lifecycle change; consumers must observe actual lifetime and admission boundaries.
|
|
26
26
|
|
|
@@ -32,7 +32,7 @@ Native ConfigEditor can emit `loader/partial-dispose` during empty-pending recon
|
|
|
32
32
|
|
|
33
33
|
On a mounted Host, desired-off affects new roots, not existing parents or their future children. Desired-on after cold-off remains restart-required until an independent Host restart. No hot-mount or restart queue is implied. An idle profile change doesn't absorb newer global deployment. Mode-on can't bypass an admitted off module; mode-off can replace saved on intent without pretending the module was active.
|
|
34
34
|
|
|
35
|
-
The inspector separates merged desired, startup-mounted/captured, next-root preview, and current-session admission. Without an actual session, current admission is unknown. Host bundle enablement also remains unknown when the public interface can't observe it. Sources, capture origins, global
|
|
35
|
+
The inspector separates merged desired, startup-mounted/captured, next-root preview, and current-session admission. Without an actual session, current admission is unknown. Host bundle enablement also remains unknown when the public interface can't observe it. Sources, capture origins, global file version, native descriptor version and named snapshot reference aren't one acknowledgment.
|
|
36
36
|
|
|
37
37
|
`presets.plannerRootEnabled` defaults false and controls only the standing DW Planner root preset, not the default-enabled workflow Planner role or Harness's native plan mode. Like the rest of `presets`, Global/native-entry settings may configure it, named overlays cannot, and desired changes require an independent restart; current Agents are not hot-migrated. See [Planner root admission](agent-presets.md#roles-and-composition) for discovery, forced creation/resume and read-only boundaries.
|
|
38
38
|
|
|
@@ -42,30 +42,42 @@ The rules RPC writes the global DSMM layer. A native override of outside-read, w
|
|
|
42
42
|
|
|
43
43
|
The Host installs `installDeploymentPermissionRules` in its owned Core fiber with `agents` injected, the actual `DsmmDeploymentConfig`, a pure writable-Root check and an awaited notification callback. Its `initial` snapshot, `runtime` sync owner and backend are the collaborators for the permission controller and the single permissions RPC. DSH owns approval: an actual manual approval is final for that call and approved scope, without a DSMM post-approval veto from older rules, epochs or internal gates. DSMM has no independent approval queue, UI, TTL or session permit memory. The ordinary `managed-settings` module retains native SettingsForms and supplies only a scoped `configEditor.edit` façade; the root ConfigEditor and its locks, form CAS and reconciliation remain native-owned. Missing or retired ownership refuses managed saves, not an actually approved call. These source interfaces require the corresponding cold Host composition; configuration alone is not mounting evidence.
|
|
44
44
|
|
|
45
|
-
Permission revisions
|
|
45
|
+
Permission revisions identify the Host profile scope and current global-file/native-descriptor versions, not configuration content integrity or per-rule version maxima. Missing native version authority refuses synchronization. Controlled saves reread storage and publish policy only after notification acknowledges it. A committed global save remains successful with refresh required when postcommit coordination fails; runtime synchronization is a separate state. Notification failure exposes saved/runtime revisions as unsynchronized; recovery rereads authoritative storage. Version, ownership and synchronization checks protect configuration writes and policy adoption, not a second call-approval gate: permission-source changes neither cancel pending native approval nor let DSMM override an actual same-call approval. New calls consume current policy. Conflicts and recovery preserve dirty editor drafts. Native and ordinary JSON rule imports receive `user-import` provenance, while rules RPC provenance comes from the live operator authority. Persistent provenance isn't native approval or a reusable grant. A native once grant doesn't widen session permissions or authorize another call, and a narrower grant isn't full access. Native rejection, caller/native cancellation and original OS failures remain possible; approval doesn't guarantee command success. Only `enabled` remains pinned to the mounted runtime; a desired OFF cannot turn off running controls before restart.
|
|
46
46
|
|
|
47
47
|
Read-only configuration projections redact LSP command/arguments/cwd, preset root and recovery prompt; environment values and names aren't disclosed. Authorized sparse editor input is a separate boundary, not a status DTO. A missing projected field is absent; an unavailable layer is unknown, not an invented default.
|
|
48
48
|
|
|
49
|
+
Only relevant effective permission changes coordinate revocation. Unrelated locale, display or model edits don't turn an old DSMM epoch into a second approval gate. Operator, connection, source and owner lifetime are rechecked after awaits and before irreversible writes. Missing or replaced authority refuses a configuration mutation; it doesn't create a reusable approval or justify replaying an unconfirmed save.
|
|
50
|
+
|
|
49
51
|
## Runtime controls
|
|
50
52
|
|
|
51
|
-
`/deepwork [off|message]` changes the receiving session's mode. Explicit intent, including a same-default choice,
|
|
53
|
+
`/deepwork [off|message]` changes the receiving session's mode. Explicit intent, including a same-default choice, is separate from profile defaults. Official minimal conversations default off; DW presets default on unless explicit intent says otherwise. Off hides common workflow/DSMM skills, not persona, read-only restrictions or host/Git permissions. Busy mutations refuse instead of queuing. Persisted intent doesn't authorize unsupported DSMM cold recovery. Slash commands belong to the native command adapter, not headless task text.
|
|
54
|
+
|
|
55
|
+
`canSelectModel`, `canToggleMode` and `canApplyOverlay` describe independent actions and refusal reasons. Live overlay Apply is unavailable (`new-session-required`); save/select a future default for a new session. This doesn't disable ordinary mode changes or **Use profile model** where their own native service, idle/session identity and manual-intent checks pass. Use profile model selects from admitted immutable configuration, doesn't write a profile pointer, and respects a newer manual choice even when its value is unchanged.
|
|
52
56
|
|
|
53
57
|
`/dsmm-status` reports normalized bounded state; `/dsmm-status json` returns a defensive version-1 snapshot. Status separates admitted profile/revision/epoch, actual route state, effective settings and captured module/runtime binding. Ordinary roots report native-owned effort and keep the native model tab's route, not an applied child-role primary. `profileModel` is advisory for explicit **Use profile model**, never proof that selection already happened.
|
|
54
58
|
|
|
59
|
+
`dsmm-status` is reserved. Setting `modeName` to that exact value normalizes the mode command to `deepwork`, preserving the independent inspection command. Status computation doesn't select a model or contact a provider.
|
|
60
|
+
|
|
55
61
|
`workflow.policy` accepts `risk-based` or `legacy`. Explicit policy wins. Without it, explicitly supplied `strictGates`, `reviewCap` or `finalReviewPolicy` selects legacy; otherwise risk-based is the default. Named role restrictions retain required Orchestrator/Planner/Plan Critic, plus legacy-conditional Reviewer/Oracle. They can't enable a role outside startup/deployment ceilings.
|
|
56
62
|
|
|
57
63
|
`roleRouting[id].levels` accepts only explicit `low`, `high` and `max` overrides; invocation omission means `normal`. These are call resources, not workflow tiers or generated roles. `subagents.toolTopology` defaults `per-role` and may be narrowed/configured in a named overlay. Background, depth and route-override permission remain deployment-only. `subagents.allowRouteOverride` defaults false. See [routing](model-routing.md) for the exact tool and target grammar.
|
|
58
64
|
|
|
59
|
-
`locale` is an optional visible-output preference using the supported locale IDs in [profiles](profiles.md#inheritance-and-ceilings). Omission inherits; the current user's explicit language request wins. It doesn't change UI locale or protocol vocabulary.
|
|
65
|
+
`locale` is an optional visible-output preference using the supported locale IDs in [profiles](profiles.md#inheritance-and-ceilings). Omission inherits; the current user's explicit language request wins. It doesn't change UI locale or protocol vocabulary. Retired brand-calibration/default-effort and MaxReasoningPresets fields reject with `deprecated-field`; there is no automatic migration. See [generic model parameters](model-routing.md#generic-model-parameters). The only nonblocking document warning is `blank-label`, with schema-safe diagnostics and source location where available.
|
|
60
66
|
|
|
61
67
|
## Child runtime composition
|
|
62
68
|
|
|
63
|
-
Default deployment
|
|
69
|
+
Default deployment waits for the native activation result: `enableRunInBackground:false`, and omitted `maxDepth` delegates to the native Host limit. Captured settings and actual native capabilities determine availability. A configured flag isn't execution or completion evidence.
|
|
70
|
+
|
|
71
|
+
Official AgentRegistry, SubagentRuntime and JSONL namespace plugins own execution and storage. DSMM adds scoped admission and policy, not a replacement Registry/Runtime, manual owner selector, companion or separate result queue.
|
|
72
|
+
|
|
73
|
+
The [bundle patch](../cordis.patch.yml) adds DSMM to the native composition. Core configuration/status/permissions don't require active Deepwork or a child task. `runtime.enabled` isn't a current owner selector. Desired source, mounted capability and actual live admission remain separate facts.
|
|
74
|
+
|
|
75
|
+
`subagentRuntime` projects native `binding: stock | unavailable`, DSMM admission readiness (`deliveryFenceReady`), restart requirement and a bounded reason. These names describe observations, not permission to replace an owner or proof that every child operation is supported. Saves retain actual native form revision/authorization and don't remount services.
|
|
64
76
|
|
|
65
|
-
|
|
77
|
+
Enabled background work must choose `run_in_background:true` before `startActivation`, using `delivery:'parent'`; otherwise delivery is to the waiting caller. Accepted child/message IDs aren't completed results. Running waiting calls have no handoff action. Native receipt disposal handles cancellation after publication and waits for cleanup.
|
|
66
78
|
|
|
67
|
-
|
|
79
|
+
Live direct-child Queue/Steer/interrupt require actual capabilities and exact parent/operator/lifetime authority. Read-only descendant inspection grants no control. Readiness loss closes DSMM execution; stale handles don't grant authority. Agent-scoped guards remain fail-closed after owner retirement. Hot replacement isn't a promise of uninterrupted live-session operation.
|
|
68
80
|
|
|
69
|
-
|
|
81
|
+
Cold DSMM recovery without trusted live admission is unavailable. Read-only history inspection doesn't resume Agents, and logs/labels/current settings don't restore execution authority. No cold migration or automatic history rewrite is supplied. See [compatibility](compatibility.md#retired-compatibility-surfaces).
|
|
70
82
|
|
|
71
83
|
*Author's note: For a DSH deployment operator; distinguish a successful configuration save from captured runtime availability before applying policy.*
|
package/docs/skill-sync.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# DSMM source-content synchronization
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
DSMM 0.3.1 targets exactly **DSH 0.2.1-rc.2**. Source synchronization reads the committed **DSMM-owned `source-inputs/` snapshot**, never a live or historical OCMM Root fallback. Explicit maintenance refresh captures raw bytes from the Root worktree. `source-inputs/manifest.json` records the actual full Root baseline commit and the paths whose raw Git blobs differ from that baseline, including uncommitted/untracked worktree content or checkout byte differences. The captured baseline is `3b680211feeb93508b3817546f37bee2291c402b`; raw-byte `overlayPaths` do not by themselves claim uncommitted semantic changes or a new Root commit. Generated `prompts/source/manifest.json` derives `sourceRef` from that captured baseline and retains the overlay provenance. This is full-content adaptation, not short personas. The maintenance inventory lives in `scripts/source-inventory.mjs`; the generated manifest carries the actual source → artifact → consumer, source anchors, adaptation rules, canonical role/skill inventories, attribution and exclusions. Runtime uses package-relative prepared assets only; it never requires the raw snapshot, an OCMM checkout, global SDK path or maintenance compiler. Root AGENTS, Codex bundles and user/provider/model configuration are not synchronization inputs.
|
|
4
4
|
|
|
5
|
-
The raw closure is limited to the two catalog TS files, `src/hooks/config.ts`, prompt-loader/model-family assembly
|
|
5
|
+
The raw closure is limited to the two catalog TS files, `src/hooks/config.ts`, prompt-loader/model-family assembly inputs, shared shell safety, the selected v1 role/category/workflow Markdown, and the fourteen recursive skill resource trees. The input manifest records paths and capture provenance, not content hashes or byte-length requirements. Local source, documentation and generated resources are not locked to recorded bytes. Required resources and safe regular-file paths are still checked. Third-party downloads retain their upstream integrity verification and attribution.
|
|
6
6
|
|
|
7
7
|
## Inventories and assembly
|
|
8
8
|
|
|
9
|
-
Every role/category persona adapts the source default `buildLocaleGuidance` prefix for visible output. `buildDsmmLocaleGuidance` and `buildDsmmAgentGuidance` add the exact Agent's immutable captured `settings.locale`: `en`, `zh-Hans`, `zh-Hant`, `ja`, `ko`, `de`, `fr`, `es`, `pt-BR`, or `ru`. Omission inherits applicable host/user language guidance, otherwise the request/context; it
|
|
9
|
+
Every role/category persona adapts the source default `buildLocaleGuidance` prefix for visible output. `buildDsmmLocaleGuidance` and `buildDsmmAgentGuidance` add the exact Agent's immutable captured `settings.locale`: `en`, `zh-Hans`, `zh-Hant`, `ja`, `ko`, `de`, `fr`, `es`, `pt-BR`, or `ru`. Omission inherits applicable host/user language guidance, otherwise the request/context; it isn't an English default. The current user's explicit output-language request wins. Preserve code, identifiers, paths, commands, protocol fields and exact quotations; child assignments retain explicit language instructions. Later desired saves don't rewrite a child's admitted preference. No Root session preference, private host-config lookup, internal reasoning-language guarantee or host/project locale change is supplied.
|
|
10
10
|
|
|
11
11
|
The 11 base roles come from `src/data/agents.ts`; the 11 categories come from `src/data/categories.ts`. Oracle slots reuse the full reviewer source. Builder/code-search/doc-search/media-reader have no standalone source role Markdown: their actual catalog responsibilities, source workflow and terminal TS policy are consumed, not invented personas. Existing `dsmm-creative` remains the one creative category. All 22 have stable metadata and templates; cross-cutting alone defaults off. File existence is never callable evidence.
|
|
12
12
|
|
|
@@ -20,9 +20,9 @@ The fourteen skills are brainstorming, writing-plans, requesting-code-review, re
|
|
|
20
20
|
|
|
21
21
|
All fourteen share deployment toggles and one Agent-scoped native metadata provider. No skill body is injected, including brainstorming. Ordinary presets require active Deepwork; DW roles default on, but explicit off wins while retaining persona/access. Metadata discovery does zero body I/O. Native `get` alone reads the cancellable SKILL body; relative references/scripts/assets resolve from its directory resourceBase.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Ancestor snapshot precedence, incomplete-observation refusal, invocation policy and cancellation/generation/parent fencing apply within the admitted Agent scope. Incomplete discovery isn't proof that a resource is absent; non-DSMM ancestor winners remain authoritative. rc.2 broadcasts `skills/change` across registries but owns revision/cache per registry; broadcasts fence in-flight work, never permanently invalidate cached locators. No body/ancestor cache, notification reflection or fallback fulltext injection is added. Generated presets compose native skill discovery/loading tools without a standing `preset-skills` provider.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
`preset-skills.ts` is internal: admission installs `registerAgentSkills` for the exact Agent, and that scope owns invalidation and release. It isn't a public package plugin or a separate global lifecycle owner. Mode/preset changes reconcile affected resources only; reading rechecks cancellation, scope and generation before returning a body. Agent scopes remain isolated.
|
|
26
26
|
|
|
27
27
|
## Refresh, reproduce and check
|
|
28
28
|
|
|
@@ -33,18 +33,18 @@ node --experimental-strip-types scripts/source-inputs.mjs --refresh
|
|
|
33
33
|
pnpm run sync:source # adapts the sealed snapshot; never refreshes it implicitly
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
Refresh reads
|
|
36
|
+
Refresh reads the declared inputs and captures a consistent view before writing. It rejects unsafe paths, links, missing inputs and unknown destination content. Publication uses a task-owned candidate and preserves the original snapshot on failure; concurrent edits are not overwritten. Input edits do not require resealing a hash inventory. Explicit synchronization updates prepared outputs, while read-only checks report missing resources without comparing their content against generated bytes.
|
|
37
37
|
|
|
38
38
|
CI and a cold released checkout use the tag's own adapter/generator and committed snapshot by default:
|
|
39
39
|
|
|
40
40
|
```powershell
|
|
41
41
|
pnpm run sync:source # optional rebuild of prepared source targets from sealed inputs
|
|
42
|
-
pnpm run build #
|
|
42
|
+
pnpm run build # offline frontend resource availability check first
|
|
43
43
|
pnpm run generate:roles # coordinated renderer owner, after build
|
|
44
|
-
pnpm run check:source # read-only
|
|
44
|
+
pnpm run check:source # read-only resource availability and path checks
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
`
|
|
47
|
+
`sync-source-assets.mjs --check` and `generate-role-assets.mjs --check` check required output availability without writing or enforcing byte equality. `check:source` combines those results with resource-reference and safe-path checks. Explicit generation still renders current source inputs and writes changed outputs; it is not a content-locking gate.
|
|
48
48
|
|
|
49
49
|
Direct regression checks do not emit shared `lib/` or presets:
|
|
50
50
|
|
|
@@ -52,7 +52,7 @@ Direct regression checks do not emit shared `lib/` or presets:
|
|
|
52
52
|
node --import ./test/prompt-source-loader.mjs --test --experimental-strip-types --test-concurrency=1 test/source-inputs.test.ts test/source-sync.test.ts
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
Regression coverage exercises resource loading, metadata generation, missing-resource errors, unsafe-path refusal, concurrent-edit preservation and publication rollback. It does not freeze source files, generated Markdown, licenses, line endings or local resources with hashes or whole-file comparisons. The resource synchronizer and role renderer remain separate maintenance entry points.
|
|
56
56
|
|
|
57
57
|
Cold rebuild needs the existing approved toolchain/dependencies and the **prepared complete frontend fixed-pin library** as well as the committed raw snapshot. Committing the raw snapshot does not deliver ignored third-party bodies. An authorized release/build owner must preserve their delivery to the cold checkout/staging surface; missing bodies or inventory fail offline with no download or older-Root fallback. Separately authorized `pnpm run sync:frontend` can materialize missing fixed-pin resources, but is never an implicit CI/build/check action. No software installation is authorized by these commands.
|
|
58
58
|
|
|
@@ -60,19 +60,19 @@ Source Markdown is kept in full, with precise anchored changes and an explicit D
|
|
|
60
60
|
|
|
61
61
|
Role IDs remain `dsmm-<name>`. `subagents.toolTopology=per-role` exposes individual `kind=role` underscore tools plus `dsmm_category`; `parameterized` exposes `dsmm_role` and `dsmm_category` with their respective admitted target enums. Empty groups have no tool. Actual arguments are `description`, `prompt`, optional `level`, deployment-authorized/exposed `route`, and capability-exposed `run_in_background`; no template grants them. Omitted/normal preserves the default route; `roleRouting.<id>.levels` contains only configured low/high/max complete routes or effort-only choices requiring exact native preflight. A complete per-call route requires paired provider/model, drops stale effort on model changes and does not silently fall back; an effort-only override must be supported by the selected native model. Route override additionally requires captured deployment `allowRouteOverride=true`. Source tier advice never generates suffix roles or fixed max effort. Target/caller/read-only/depth authority is unchanged by topology or level. Missing required planning/review capability is reported, not bypassed. Read-only planners return complete Markdown for authorized coordinator persistence. Reviewer/Oracle independence requires different observed routes, not names.
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
Role calls wait for the official activation result by default. Enabled background work selects `delivery:'parent'` before start using `run_in_background:true`; an accepted child/message receipt isn't execution/review completion. Running waiting calls have no handoff. Supported live children use actual native message/Queue/Steer/interrupt controls under exact-parent authority. Cold DSMM resume is unavailable without trusted live admission. Later saves don't replace a child's original locale, route or authority. No OpenCode `task_id`, guessed idempotency or automatic message resend is supplied.
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
Official Registry, Runtime and JSONL namespace plugins own execution/storage. No manual-runtime selector or companion is required. The assembler takes observed `SubagentRuntimeAdmissionView` readiness plus actual tools/capabilities; a catalog or responding root isn't proof of every child control. Display metadata and old logs don't restore admission. Agent-lifetime policy remains fail-closed after owner retirement; no hot-replacement guarantee is implied.
|
|
66
66
|
|
|
67
67
|
### Runtime assembler consumer interface
|
|
68
68
|
|
|
69
69
|
`buildDsmmAgentGuidance(capturedSettings, observation: DsmmPromptObservation)` is pure and installs no tools, policy, provider, RPC or locale. The integration owner registers it once in the exact admitted Agent scope, independently of the mode-gated `buildDeepworkPrompt`; do not also inject a second dynamic locale block. Use that root/child's immutable settings, never desired deployment/editor drafts or the ancestor's new admission. Persistent `buildRolePersona` contains only shared language priority, not a configured locale.
|
|
70
70
|
|
|
71
|
-
Pass
|
|
71
|
+
Pass `callableRoleInventory` entries (`name`, `kind`, `targets`, optional `targetParameter`) **after actual admission/provider/tool filtering**, plus current policy-filtered native `ToolSchema[]`. The assembler intersects those schemas and target enums with optional observed role availability, and lists configured levels only when the schema exposes them. A role-availability row is not proof of a tool. Pass observed `DsmmInvocationView` under `invocation: {view, routeKind:'initial'|'actual'}`: initial is a preflighted start route, actual comes from native request/status after fallback; never infer either from raw args or a role name. Runtime admission, invocation (including route), and child evidence are explicitly projected to allowed output fields; structurally compatible objects' extra properties are not serialized. Evidence field/code/effect lists are closed and limitation output is bounded.
|
|
72
72
|
|
|
73
|
-
`capabilities.continuable` observes
|
|
73
|
+
`capabilities.continuable` observes new child creation. `capabilities.nativeChildDelivery` independently observes supported live-child delivery under this Agent's authority; a ready binding alone doesn't prove reuse or a reachable browser surface. Native user Queue/Steer requires an actually wired `nativeBrowserPrompt.surface`. Child-to-parent reporting retains exact-sender/adjacency semantics. No foreground-handoff or cold-recovery capability is advertised. Observations describe availability; exact target, operator/connection/session/lifetime and native permission checks remain execution authority.
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
Request routing uses generic native capabilities and admitted `modelParameters` policy. Omitted effort remains native-owned; DSMM doesn't apply brand-calibration or brand-default-effort settings. Retired fields reject with `deprecated-field`, without automatic migration. Standard supported requests use native prepared calls. The public completions seam supports custom/Pi-AI stop parameters in self-contained literal or explicit model-mapping configurations; catalog-backed raw combinations that can't be reliably reproduced are rejected for both native and DSMM parameter sources. Standard Coding and native effort encoding remain unchanged. Source provenance and fixed-pin resource integrity remain separate from configuration-version metadata, and display records don't restore historical authority.
|
|
76
76
|
|
|
77
77
|
Authored frontend router/tooling text overrides install-by-default/implicit latest behavior: inspect existing capabilities, require separate setup authorization, and report unverified evidence without hiding incomplete declared resources. Verbatim UI/UX README paths/cwd examples are superseded by the authored DSH entry: resolve the absolute native resourceBase script, require the already-active target project context, and supply an explicitly approved project-owned output-dir for persistence. The installed skill tree is never an output target; no tool cwd field or shell cd is invented. Public renderer inputs retain the old object shape with optional source metadata; only the canonical catalog requires those trusted source fields.
|
|
78
78
|
|
|
@@ -88,8 +88,8 @@ OCMM-derived modifications remain under the full package `LICENSE` (LicenseRef-A
|
|
|
88
88
|
|
|
89
89
|
`scripts/frontend-recipe.mjs` maps every actual brand-table path (except project-original aside), all twelve taste resources plus the Stitch example, the UI/UX README/scripts/data and actual Python dependencies. Pins are Open Design `6afe7eae156bfa29251a51fd0636649c257f7444`, taste-skill `06d6028b5c623016c59ce8536f578e5a1127b499`, and UI/UX Pro Max `f32d6a61cdf0bfd57404c45854583fd19ff95088`. It never uses OMO's different pin or modifies a root/submodule checkout. Initial synchronization validates each exact Git-tree path and blob; missing paths fail explicitly. Verbatim core.py also needs app-interface, google-fonts and threejs/angular/laravel stacks: these same-pin dependencies ship alongside the source-declared web-interface mapping. Imports/data references are inspected statically, not executed.
|
|
90
90
|
|
|
91
|
-
Body/data/Python resources and `.frontend-materialized.json` are gitignored.
|
|
91
|
+
Body/data/Python resources and `.frontend-materialized.json` are gitignored. License files, copyright/attribution and the recipe are committed. Frontend `.npmignore` includes the materialized runtime resources in the package. Upstream blob verification applies when downloading missing resources; offline checks do not hash or overwrite existing local files.
|
|
92
92
|
|
|
93
|
-
`node scripts/materialize-frontend.mjs` defaults to read-only/offline
|
|
93
|
+
`node scripts/materialize-frontend.mjs` defaults to read-only/offline checks for required resources, safe paths and referenced dependencies. Build and readiness checks do not enforce local content hashes. Explicit `sync:frontend` fetches missing resources without replacing existing files. Runtime distribution needs package-relative resources, not an upstream checkout or network access.
|
|
94
94
|
|
|
95
95
|
**Distribution handoff:** with the authorized build toolchain and complete fixed-pin resources, run snapshot-backed `sync:source`, then coordinated build/generate/check/pack. Only deliberate Root adoption uses `source-inputs.mjs --refresh`; only separately authorized materialization uses `sync:frontend`. The raw snapshot is committed maintenance input and is not required in the npm runtime package. Prepared prompts/skills and every fixed-pin runtime resource must still be delivered; ignored status does not supply them to a cold checkout. Frozen tarballs must already carry the complete library. Default build/check does not fetch resources. Local compiled/materialized content is not proof of packed delivery. Full packed inventory and missing-resource refusal remain separate evidence from native runtime/UI capability, permission and lifecycle completion.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# 显式选择 Fake-IP HTTP fetch
|
|
2
|
+
|
|
3
|
+
`@dsmm/dsmm/web-fetch-fakeip` 是独立 Cordis 插件,向原生 `ctx.web` 注册唯一 fetch provider ID `dsmm-http-fakeip`。它使用 rc.2 包根公开的 `new HttpFetchProvider(limits, resolver)`,不替换 WebRuntime,不注册 `http`,不改变 Search、工具审批、凭据或系统网络。只有用户主动挂载并选择该 provider 时才应启用;不要将它加入 DSMM 默认插件组合。原生 `http` 和 shell 的网络限制不因此得到修复。
|
|
4
|
+
|
|
5
|
+
## 集成与选择
|
|
6
|
+
|
|
7
|
+
DSMM 包必须具备以下依赖和发布入口,才能使用此插件:
|
|
8
|
+
|
|
9
|
+
- 运行依赖 `@deepseek-ai/dsh-web-fetch-http: 0.2.1-rc.2` 和 `ipaddr.js: ^2.5.0`。
|
|
10
|
+
- Host seam `@deepseek-ai/dsh-web: 0.2.1-rc.2`、`@deepseek-ai/dsh-http-proxy: 0.2.1-rc.2` 作为 peer 和开发依赖。保留现有 Cordis/timeout peers;不要另装一套 Host service。DSMM 与原生 HTTP provider 必须解析到 Host 实际使用的同一个 `dsh-http-proxy` 实例,否则预检读不到已安装的进程路由。
|
|
11
|
+
- 包 export `./web-fetch-fakeip`,types 指向 `./lib/web-fetch-fakeip.d.ts`,default 指向 `./lib/web-fetch-fakeip.js`。构建也需包含其内部 `web-fetch-address-policy.js`。包的 `files` 应包含本说明和来源许可证。
|
|
12
|
+
|
|
13
|
+
在用户所选原生 profile 的 patch 中显式挂载该入口,并修改原有 web service 的 `fetchProvider`(保留其真实 entry ID 和其他配置):
|
|
14
|
+
|
|
15
|
+
```yaml
|
|
16
|
+
- id: web
|
|
17
|
+
config:
|
|
18
|
+
fetchProvider: dsmm-http-fakeip
|
|
19
|
+
- insert:
|
|
20
|
+
- id: dsmm-http-fakeip
|
|
21
|
+
name: '@dsmm/dsmm/web-fetch-fakeip'
|
|
22
|
+
config: {}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
这不是默认 bundle patch。若实际 web entry 不叫 `web`,使用该 profile 的实际 entry ID,不要新增第二个 web service。也可以通过原生 `DSH_WEB_FETCH_PROVIDER=dsmm-http-fakeip` 选择,但仍须显式挂载插件,并考虑原生 profile 配置的优先级。仅挂载而不选择是不安全的配置习惯:原生 WebRuntime 在只有一个可用 provider 时会自动选择它;存在多个 provider 且未选择时会报歧义。卸载插件会由原生 registry 撤销注册。
|
|
26
|
+
|
|
27
|
+
配置项为 `maxResponseBytes`(默认 5,000,000)、`maxBodyChars`(100,000)、`timeoutMs`(30,000)、`maxRedirects`(5)、`userAgent`(原生默认值)和 `denyCidrs`(空数组)。字节/字符/超时限制必须为正有限数,超时不超过 Node timer 范围;重定向上限必须为非负整数。
|
|
28
|
+
|
|
29
|
+
`denyCidrs` 只增加本地拒绝,例如 `['198.18.0.1/16', '8.8.8.0/24']`;主机位不扩大 CIDR,前一项等价于拒绝固定 `198.18.0.0/16`。mapped IPv6 和对应 IPv4 的拒绝相互覆盖。没有任意 allow-CIDR 配置:唯一例外固定为 `198.18.0.0/16`,不是 `/15`,不是其他私网。
|
|
30
|
+
|
|
31
|
+
## 地址与代理边界
|
|
32
|
+
|
|
33
|
+
- 系统 DNS 使用 `all: true, order: 'verbatim'`。完整答案必须非空,每项 family 和地址须有效;任一地址被拒绝即拒绝整个请求,不筛掉坏答案继续连接。
|
|
34
|
+
- 允许公网 unicast 和精确 Fake-IP `/16`;mapped IPv6 按内嵌 IPv4 判断。显式 deny 优先,loopback、私网、链路本地、`198.19.*` 及原生 transition/NAT64 特殊地址继续拒绝。
|
|
35
|
+
- IPv6 答案使用 RFC 7050 的 `ipv4only.arpa` 识别 RFC 6052 `/32 /40 /48 /56 /64 /96` 前缀,校验内嵌目的地址。发现失败、空答案或不能识别的发现答案均不放宽。内嵌 IPv4 不继承 Fake-IP 例外,显式 deny 同样生效。
|
|
36
|
+
- DNS 等待可以被取消;OS 中已经启动的 lookup 可能自行结束,但其结果不会被已取消请求使用。原生 provider 保持 deadline 的 timeout/caller-abort 分类。
|
|
37
|
+
- 入口通过公开 `proxyRouteFor()` 读取原生实际路由,不自行解释环境变量,不安装或修改代理。应走代理的 Fake-IP 或 mapped Fake-IP literal 在调用原生 provider **之前**拒绝(`WEB_FAKEIP_PROXY_UNSUPPORTED`),因为 rc.2 自带 literal 分类器会让它们跳过代理、意外直连。每次原生 resolver 调用再次预检;跳过 resolver 的代理分支不受该预检保护。
|
|
38
|
+
- 未配置额外 deny 的代理域名仍交给原生代理分支,由代理解析 DNS;本地 resolver 不会执行,**不承诺代理远端 DNS 满足本地地址策略**。这不是完整本地 SSRF/DNS 校验路径。需要这项保证时必须使用可控的代理策略或原生明确直连路由,不能把此插件视为修复远端 DNS。
|
|
39
|
+
- 配置 `denyCidrs` 时,域名若走代理就 fail closed,不隐式改直连。已知允许的 IPv4 literal 可走原生代理;其地址 deny 在入口执行。代理 IPv6 literal 保守拒绝(mapped 公网 IPv4 除外),避免代理分支跳过本地 NAT64 检查。
|
|
40
|
+
- 存在本地 deny,或请求目标是非 mapped IPv6 literal 时,重定向一律由原生零 hop 上限拒绝(`WEB_REDIRECT_BLOCKED`)。公开 resolver seam 不能检查后续跳转的代理分支,且进程路由可能在 DNS64 发现或响应期间变化;零跳限制确保本地 deny 和 IPv6 literal NAT64 检查不被跳过。无额外 deny 的域名、IPv4 和 mapped IPv4 literal 保留配置的原生同源重定向上限。
|
|
41
|
+
|
|
42
|
+
## 原生传输与验证范围
|
|
43
|
+
|
|
44
|
+
验证后的地址集合直接交给原生 transport,不伪造公网 DNS 答案,也不重写 URL。原生负责 pinned lookup、HTTP Host、TLS SNI、每次直连同源跳转的重新解析、跨 origin 拒绝、URL scheme/credentials、响应类型/字符集、字节/字符上限、非 2xx 结果、取消和 body/dispatcher 释放。此插件不另造 Undici transport。
|
|
45
|
+
|
|
46
|
+
定向检查(从 `dsmm` 目录,依赖集成后执行):
|
|
47
|
+
|
|
48
|
+
```powershell
|
|
49
|
+
node --test --experimental-strip-types --import ./test/prompt-source-loader.mjs --test-concurrency=1 test/web-fetch-address-policy.test.ts test/web-fetch-fakeip.test.ts
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
地址测试注入 DNS,保护精确网段两端、混合答案、mapped IPv6、NAT64、deny 和取消。注册/预检测试通过原生 WebRuntime 和真实公开代理策略检查消费链,其中替换 native `fetch` 的用例仅证明委托/调用前拒绝,不证明网络连通。
|
|
53
|
+
|
|
54
|
+
动态路由回归使用已安装原生 provider、公开进程代理策略和禁止网络连接的 Undici MockAgent,检查 DNS64 期间切换代理后 IPv6 literal 重定向没有第二跳 dispatch,并检查其他允许目标保留同源重定向。该证据是路由/dispatch 行为验证,不是代理或 Fake-IP wire 连通证据。
|
|
55
|
+
|
|
56
|
+
原生 HTTP 集成用例使用**刻意注入 loopback 答案**连接任务自有本地服务器,检查 pinned hostname/Host、同源重解析、跨源拒绝、大小上限和非 2xx。该测试不是生产策略,不证明 Fake-IP 网段的真实路由。TLS SNI 和真实 `198.18/16` wire 连通需要已有隔离网络/TLS 能力的另行验收;没有这种证据时只能说明 resolver/委托实现,不能宣称 Fake-IP wire 或整个网络需求完成。不改系统路由、Clash、凭据或未知 shell 拒绝层来取得测试通过。
|
|
57
|
+
|
|
58
|
+
## 来源与许可
|
|
59
|
+
|
|
60
|
+
地址分类及 RFC 6052/7050 提取逻辑改编自 DeepSeek 官方 tag `dsh-v0.2.1-rc.2` 的 [`packages/web/web-fetch-http/src/network.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.1-rc.2/packages/web/web-fetch-http/src/network.ts),通过公开 `ipaddr.js` 使用,不导入 SDK 私有路径。
|
|
61
|
+
|
|
62
|
+
MIT License
|
|
63
|
+
|
|
64
|
+
Copyright (c) 2026 DeepSeek
|
|
65
|
+
|
|
66
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
67
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
68
|
+
in the Software without restriction, including without limitation the rights
|
|
69
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
70
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
71
|
+
furnished to do so, subject to the following conditions:
|
|
72
|
+
|
|
73
|
+
The above copyright notice and this permission notice shall be included in all
|
|
74
|
+
copies or substantial portions of the Software.
|
|
75
|
+
|
|
76
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
77
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
78
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
79
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
80
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
81
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
82
|
+
SOFTWARE.
|
package/lib/child-capture.d.ts
CHANGED
|
@@ -18,9 +18,15 @@ export interface ChildAuthorityCeiling {
|
|
|
18
18
|
allowRouteOverride: boolean;
|
|
19
19
|
maxDepth: number;
|
|
20
20
|
}
|
|
21
|
-
export type ChildRuntimePolicyCapture = Pick<DsmmSettings, "modules" | "roleRouting" | "runtimePolicy" | "workflow" | "guards" | "runtimeRecovery" | "defaultActive" | "
|
|
21
|
+
export type ChildRuntimePolicyCapture = Pick<DsmmSettings, "modules" | "roleRouting" | "runtimePolicy" | "workflow" | "guards" | "runtimeRecovery" | "defaultActive" | "skills"> & {
|
|
22
22
|
subagents: Pick<DsmmSettings["subagents"], "enableRunInBackground" | "backgroundMode">;
|
|
23
23
|
};
|
|
24
|
+
export type HistoricalChildRuntimePolicyCapture = ChildRuntimePolicyCapture & {
|
|
25
|
+
deepseekV4ProCalibration: "off" | "auto" | "strict";
|
|
26
|
+
deepseekFlashCalibration: "off" | "auto" | "strict";
|
|
27
|
+
deepseekV4ProDefaultReasoningEffort: "off" | "low" | "high";
|
|
28
|
+
deepseekFlashDefaultReasoningEffort: "off" | "low" | "high";
|
|
29
|
+
};
|
|
24
30
|
interface ChildAdmissionCaptureBase {
|
|
25
31
|
childSessionId: string;
|
|
26
32
|
parentSessionId: string;
|
|
@@ -42,16 +48,24 @@ interface ChildAdmissionCaptureBase {
|
|
|
42
48
|
}
|
|
43
49
|
export interface ChildAdmissionCaptureV1 extends ChildAdmissionCaptureBase {
|
|
44
50
|
version: 1;
|
|
51
|
+
runtimePolicyCapture: HistoricalChildRuntimePolicyCapture;
|
|
45
52
|
}
|
|
46
53
|
export interface ChildAdmissionCaptureV2 extends ChildAdmissionCaptureBase {
|
|
47
54
|
version: 2;
|
|
55
|
+
runtimePolicyCapture: HistoricalChildRuntimePolicyCapture;
|
|
48
56
|
modelParameterPolicy: ResolvedModelParameterPolicy;
|
|
49
57
|
invocation: ChildAdmissionCaptureBase["invocation"] & {
|
|
50
58
|
requestedRoute: DsmmModelRoute;
|
|
51
59
|
effortSource: "native" | "dsmm-config";
|
|
52
60
|
};
|
|
53
61
|
}
|
|
54
|
-
export
|
|
62
|
+
export interface ChildAdmissionCaptureV3 extends ChildAdmissionCaptureBase {
|
|
63
|
+
version: 3;
|
|
64
|
+
delegationMode: "one-shot" | "continuable";
|
|
65
|
+
modelParameterPolicy: ResolvedModelParameterPolicy;
|
|
66
|
+
invocation: ChildAdmissionCaptureV2["invocation"];
|
|
67
|
+
}
|
|
68
|
+
export type ChildAdmissionCapture = ChildAdmissionCaptureV1 | ChildAdmissionCaptureV2 | ChildAdmissionCaptureV3;
|
|
55
69
|
/** Trusted native folds only; never synthesized from the current parent's settings. */
|
|
56
70
|
export interface LegacyChildEvidence {
|
|
57
71
|
version: 1;
|
package/lib/child-capture.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { copyJson, freezeSettings, resolveConfig, validateSparseConfig } from "./settings.js";
|
|
2
2
|
import { parseModelParameterPolicy } from "./model-parameter-policy.js";
|
|
3
3
|
import { validateProfileOverlay } from "./profiles.js";
|
|
4
|
+
import { isProfileReference } from "./config-revision.js";
|
|
4
5
|
import { DSMM_ROLE_IDS } from "./roles.js";
|
|
5
6
|
import { CHILD_EVIDENCE_FIELDS } from "./child-evidence.js";
|
|
6
7
|
export { CHILD_EVIDENCE_FIELDS, parseChildAdmissionEvidenceView } from "./child-evidence.js";
|
|
@@ -88,11 +89,13 @@ export function parseLegacyChildEvidence(input) {
|
|
|
88
89
|
export function parseChildAdmissionCapture(input) {
|
|
89
90
|
const plain = copyJson(input);
|
|
90
91
|
const version = plain?.version;
|
|
91
|
-
if (version !== 1 && version !== 2)
|
|
92
|
+
if (version !== 1 && version !== 2 && version !== 3)
|
|
92
93
|
fail();
|
|
93
|
-
const row = object(plain, ["version", "childSessionId", "parentSessionId", "role", "profilePin", "originalAdmissionEpoch", "invocation", "runtimePolicyCapture", "authorityCeiling", "toolTopology", ...version
|
|
94
|
-
if (version
|
|
94
|
+
const row = object(plain, ["version", "childSessionId", "parentSessionId", "role", "profilePin", "originalAdmissionEpoch", "invocation", "runtimePolicyCapture", "authorityCeiling", "toolTopology", ...version !== 1 ? ["modelParameterPolicy"] : [], ...version === 3 ? ["delegationMode"] : []], ["locale"]);
|
|
95
|
+
if (version !== 1)
|
|
95
96
|
parseModelParameterPolicy(row.modelParameterPolicy);
|
|
97
|
+
if (version === 3 && row.delegationMode !== "one-shot" && row.delegationMode !== "continuable")
|
|
98
|
+
fail();
|
|
96
99
|
text(row.childSessionId, 256);
|
|
97
100
|
text(row.parentSessionId, 256);
|
|
98
101
|
role(row.role);
|
|
@@ -103,22 +106,34 @@ export function parseChildAdmissionCapture(input) {
|
|
|
103
106
|
const pin = object(row.profilePin, ["id", "revision"]);
|
|
104
107
|
if (typeof pin.id !== "string" || !/^[a-z0-9][a-z0-9_-]{0,63}$/u.test(pin.id) || /^(?:con|prn|aux|nul|com[0-9]|lpt[0-9])$/iu.test(pin.id))
|
|
105
108
|
fail();
|
|
106
|
-
|
|
109
|
+
if (version === 3) {
|
|
110
|
+
if (!isProfileReference(pin.revision))
|
|
111
|
+
fail();
|
|
112
|
+
}
|
|
113
|
+
else
|
|
114
|
+
epoch(pin.revision);
|
|
107
115
|
}
|
|
108
|
-
const invocation = object(row.invocation, ["level", "initialRoute", "routeSource", ...version
|
|
116
|
+
const invocation = object(row.invocation, ["level", "initialRoute", "routeSource", ...version !== 1 ? ["requestedRoute", "effortSource"] : []]);
|
|
109
117
|
if (typeof invocation.level !== "string" || !["normal", "low", "high", "max"].includes(invocation.level) || !DSMM_ROUTE_SOURCES.includes(invocation.routeSource))
|
|
110
118
|
fail();
|
|
111
119
|
(version === 1 ? legacyRoute : route)(invocation.initialRoute);
|
|
112
|
-
if (version
|
|
120
|
+
if (version !== 1) {
|
|
113
121
|
route(invocation.requestedRoute);
|
|
114
122
|
if (invocation.effortSource !== "native" && invocation.effortSource !== "dsmm-config")
|
|
115
123
|
fail();
|
|
116
124
|
}
|
|
117
|
-
const policyKeys = ["modules", "roleRouting", "runtimePolicy", "workflow", "guards", "runtimeRecovery", "defaultActive", "
|
|
125
|
+
const policyKeys = ["modules", "roleRouting", "runtimePolicy", "workflow", "guards", "runtimeRecovery", "defaultActive", "skills", "subagents", ...version === 3 ? [] : HISTORICAL_POLICY_FIELDS];
|
|
118
126
|
const policy = object(row.runtimePolicyCapture, policyKeys);
|
|
127
|
+
if (version !== 3)
|
|
128
|
+
for (const key of HISTORICAL_POLICY_FIELDS) {
|
|
129
|
+
const choices = key.endsWith("Calibration") ? ["off", "auto", "strict"] : ["off", "low", "high"];
|
|
130
|
+
if (typeof policy[key] !== "string" || !choices.includes(policy[key]))
|
|
131
|
+
fail();
|
|
132
|
+
}
|
|
119
133
|
if (version === 1)
|
|
120
134
|
validateLegacyRoutes(policy);
|
|
121
|
-
const
|
|
135
|
+
const execution = executionPolicy(policy);
|
|
136
|
+
const { modules, skills, subagents, ...overlay } = execution;
|
|
122
137
|
validateProfileOverlay(overlay);
|
|
123
138
|
object(modules, ["deepwork"]);
|
|
124
139
|
boolean(object(modules.deepwork, ["enabled"]).enabled);
|
|
@@ -140,12 +155,16 @@ export function parseChildAdmissionCapture(input) {
|
|
|
140
155
|
fail();
|
|
141
156
|
if (typeof row.toolTopology !== "string" || !["per-role", "parameterized"].includes(row.toolTopology))
|
|
142
157
|
fail();
|
|
143
|
-
validateSparseConfig({ ...
|
|
158
|
+
validateSparseConfig({ ...execution, ...(Object.hasOwn(row, "locale") ? { locale: row.locale } : {}), subagents: { ...background, toolTopology: row.toolTopology, allowRouteOverride: ceiling.allowRouteOverride, maxDepth: ceiling.maxDepth } }, true);
|
|
144
159
|
for (const key of ["modules", "runtimePolicy", "workflow", "guards", "runtimeRecovery"])
|
|
145
160
|
completeResolvedObject(policy[key], CAPTURE_POLICY_SHAPE[key]);
|
|
146
161
|
return freezeSettings(row);
|
|
147
162
|
}
|
|
148
163
|
// Persisted protocol completeness is independent of current configuration defaults.
|
|
164
|
+
const HISTORICAL_POLICY_FIELDS = ["deepseekV4ProCalibration", "deepseekV4ProDefaultReasoningEffort", "deepseekFlashCalibration", "deepseekFlashDefaultReasoningEffort"];
|
|
165
|
+
function executionPolicy(policy) {
|
|
166
|
+
return Object.fromEntries(Object.entries(policy).filter(([key]) => !HISTORICAL_POLICY_FIELDS.includes(key)));
|
|
167
|
+
}
|
|
149
168
|
const CAPTURE_SKILLS = ["brainstorming", "writing-plans", "requesting-code-review", "receiving-code-review", "subagent-driven-development", "dispatching-parallel-agents", "remove-ai-slops", "debugging", "frontend", "git-master", "ast-grep", "coding-agent-sessions", "init-deep", "using-git-worktrees"];
|
|
150
169
|
const CAPTURE_POLICY_SHAPE = {
|
|
151
170
|
modules: { deepwork: { enabled: null } },
|
|
@@ -192,7 +211,7 @@ function completeResolvedObject(input, template) {
|
|
|
192
211
|
export function admissionFromChildCapture(input, nativeSubstrate) {
|
|
193
212
|
const capture = parseChildAdmissionCapture(input);
|
|
194
213
|
const { locale: _locale, ...substrate } = nativeSubstrate;
|
|
195
|
-
const settings = resolveConfig({ ...substrate, ...capture.runtimePolicyCapture,
|
|
214
|
+
const settings = resolveConfig({ ...substrate, ...executionPolicy(capture.runtimePolicyCapture),
|
|
196
215
|
modelParameters: { passthrough: capture.version === 1 || capture.modelParameterPolicy.mode !== "native-defaults" },
|
|
197
216
|
roles: Object.fromEntries(DSMM_ROLE_IDS.map(role => [role, capture.authorityCeiling.roles.includes(role)])),
|
|
198
217
|
...(capture.locale === undefined ? {} : { locale: capture.locale }), subagents: { ...capture.runtimePolicyCapture.subagents,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InjectFace, PropsLocale } from "@deepseek-ai/dsh-client-ui-slots";
|
|
2
|
-
import type {
|
|
2
|
+
import type { DsmmInvocationView, RoleControlAvailability, RoleControlChildView } from "../role-control-types.js";
|
|
3
3
|
import type { DsmmRoleRouteComparison } from "../profile-types.js";
|
|
4
4
|
import type { ChildrenActions, ChildrenController, ChildrenSnapshot } from "./children-controller.js";
|
|
5
5
|
import type { ChildrenLocaleKey } from "./children-locales.js";
|
|
@@ -23,9 +23,6 @@ export declare function InvocationDetails({ value, t, showComparison }: Locale &
|
|
|
23
23
|
value?: DsmmInvocationView;
|
|
24
24
|
showComparison?: boolean;
|
|
25
25
|
}): import("react").JSX.Element;
|
|
26
|
-
export declare function EvidenceDetails({ value, t }: Locale & {
|
|
27
|
-
value?: ChildAdmissionEvidenceView;
|
|
28
|
-
}): import("react").JSX.Element;
|
|
29
26
|
export declare function ChildComposer({ child, state, actions, t }: Locale & {
|
|
30
27
|
child: RoleControlChildView;
|
|
31
28
|
state: ChildrenSnapshot;
|