@ran-sh/dsh-crew 0.5.6 → 1.0.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.
Files changed (47) hide show
  1. package/README.md +20 -7
  2. package/README.zh.md +18 -7
  3. package/docs/installation.md +1 -1
  4. package/docs/ui-surfaces.md +65 -46
  5. package/lib/client.js +565 -28
  6. package/official-web-bridge/lib/client.js +565 -28
  7. package/package.json +1 -1
  8. package/src/client/collapsible-sections.mjs +3 -2
  9. package/src/client/host-readiness.mjs +16 -3
  10. package/src/client/index.tsx +331 -54
  11. package/src/config-readiness.mjs +66 -5
  12. package/src/credential-lifecycle.mjs +73 -0
  13. package/src/credential-purge-adapters.mjs +127 -0
  14. package/src/credential-purge-state.mjs +59 -0
  15. package/src/credential-reference-inventory.mjs +78 -0
  16. package/src/dsh-cli-runtime.mjs +36 -9
  17. package/src/extension-contract.mjs +16 -10
  18. package/src/hub/index.mjs +1004 -438
  19. package/src/hub-client.mjs +25 -5
  20. package/src/hub-compatibility.mjs +23 -7
  21. package/src/install/install.mjs +4 -4
  22. package/src/install/npx-lifecycle.mjs +495 -134
  23. package/src/job-contracts.mjs +27 -6
  24. package/src/jobs.mjs +2 -4
  25. package/src/local-request-guard.mjs +60 -0
  26. package/src/mcp-runtime.mjs +7 -5
  27. package/src/model-routing.mjs +141 -49
  28. package/src/multimodal.mjs +0 -0
  29. package/src/official-web-bridge.mjs +248 -95
  30. package/src/policy.mjs +62 -31
  31. package/src/provider-config-scrub.mjs +71 -0
  32. package/src/provider-delete-adapters.mjs +451 -0
  33. package/src/provider-desired-state.mjs +37 -0
  34. package/src/provider-health.mjs +124 -0
  35. package/src/provider-inventory.mjs +132 -0
  36. package/src/provider-lifecycle-state.mjs +95 -0
  37. package/src/provider-lifecycle.mjs +214 -0
  38. package/src/provider-profile-store.mjs +171 -0
  39. package/src/readiness-matrix.mjs +11 -5
  40. package/src/removable-waiter.mjs +29 -0
  41. package/src/runtime-identity.mjs +66 -21
  42. package/src/runtime-readiness-snapshot.mjs +87 -0
  43. package/src/server.mjs +64 -21
  44. package/src/status-shard.mjs +13 -2
  45. package/src/workflow-runtime.mjs +44 -10
  46. package/windows/start-dsh-crew.cmd +3 -3
  47. package/windows/start-dsh-crew.ps1 +49 -5
package/README.md CHANGED
@@ -17,8 +17,9 @@ dsh-crew integrate
17
17
  dsh-crew status
18
18
  ```
19
19
 
20
- Open <http://127.0.0.1:3080> for the daily console. On Windows, installation
21
- also registers login startup for the two local services.
20
+ Open <http://127.0.0.1:3080> for the daily console. On Windows, installation
21
+ also registers login startup for the 3080 console; its official bridge starts
22
+ and owns the isolated 3210 Harness backend.
22
23
 
23
24
  | Surface | Purpose |
24
25
  | --- | --- |
@@ -41,14 +42,26 @@ silently falling back.
41
42
  ## Useful commands
42
43
 
43
44
  ```bash
44
- dsh-crew inspect # live capabilities and readiness
45
- dsh-crew jobs list # jobs and Result Contracts
46
- dsh-crew update # update and repair enabled integrations
45
+ dsh-crew inspect # live capabilities and readiness
46
+ dsh-crew jobs list # jobs and Result Contracts
47
+ dsh-crew providers list # 3210 Harness provider inventory (secret-free)
48
+ dsh-crew providers probe <provider-id>
49
+ curl http://127.0.0.1:3210/_dsh/dsh-crew/credential-references # references/orphans only
50
+ dsh-crew credentials list # secret-free reference inventory
51
+ dsh-crew credentials purge-plan env:NAME
52
+ dsh-crew credentials purge env:NAME --plan <plan-id> --expected-revision <sha256> --confirm
53
+ dsh-crew providers delete-plan <provider-id> --replacement-default <provider-id>
54
+ dsh-crew providers delete <provider-id> --plan <plan-id> --expected-revision <sha256> --confirm
55
+ dsh-crew releases list # retained validated payloads
56
+ dsh-crew rollback <version> # switch payload and verify the 3210 runtime
57
+ dsh-crew update # update and repair enabled integrations
47
58
  dsh-crew uninstall # remove managed files, keep backups/config
48
59
  ```
49
60
 
50
- The runtime is isolated under `~/.config/dsh-crew/harness` with `profile: dsh-crew`;
51
- the official `web` profile receives only the 3080 bridge.
61
+ The runtime is isolated under `~/.config/dsh-crew/harness` with `profile: dsh-crew`;
62
+ the official `web` profile receives only the 3080 bridge.
63
+ All production Worker/Reviewer model calls are executed by the isolated 3210
64
+ Crew Harness; 3080 is a control-plane bridge only.
52
65
 
53
66
  ## Legacy launcher migration
54
67
 
package/README.zh.md CHANGED
@@ -16,8 +16,8 @@ dsh-crew integrate
16
16
  dsh-crew status
17
17
  ```
18
18
 
19
- 打开 <http://127.0.0.1:3080> 进入日常控制台。Windows 安装会注册当前用户的
20
- 登录启动项,自动启动两个本地服务。
19
+ 打开 <http://127.0.0.1:3080> 进入日常控制台。Windows 安装会注册当前用户的
20
+ 登录启动项,先启动 3080 控制台,再由官方桥接启动并监管隔离的 3210 Harness。
21
21
 
22
22
  | 界面 | 用途 |
23
23
  | --- | --- |
@@ -38,14 +38,25 @@ dsh-crew status
38
38
  ## 常用命令
39
39
 
40
40
  ```bash
41
- dsh-crew inspect # 实时能力与就绪度
42
- dsh-crew jobs list # 任务与 Result Contract
43
- dsh-crew update # 更新并修复已启用集成
41
+ dsh-crew inspect # 实时能力与就绪度
42
+ dsh-crew jobs list # 任务与 Result Contract
43
+ dsh-crew providers list # 3210 Harness Provider 清单(不含密钥)
44
+ dsh-crew providers probe <provider-id>
45
+ curl http://127.0.0.1:3210/_dsh/dsh-crew/credential-references # 仅查看引用/孤儿报告
46
+ dsh-crew credentials list # 不含密钥值的引用清单
47
+ dsh-crew credentials purge-plan env:NAME
48
+ dsh-crew credentials purge env:NAME --plan <plan-id> --expected-revision <sha256> --confirm
49
+ dsh-crew providers delete-plan <provider-id> --replacement-default <provider-id>
50
+ dsh-crew providers delete <provider-id> --plan <plan-id> --expected-revision <sha256> --confirm
51
+ dsh-crew releases list # 查看保留且已验证的版本
52
+ dsh-crew rollback <version> # 切换版本并验证 3210 runtime
53
+ dsh-crew update # 更新并修复已启用集成
44
54
  dsh-crew uninstall # 移除受管文件,保留配置/备份
45
55
  ```
46
56
 
47
- 运行时隔离在 `~/.config/dsh-crew/harness`,使用 `profile: dsh-crew`;官方 `web` profile
48
- 只接收 3080 轻量桥接。
57
+ 运行时隔离在 `~/.config/dsh-crew/harness`,使用 `profile: dsh-crew`;官方 `web` profile
58
+ 只接收 3080 轻量桥接。
59
+ 生产 Worker/Reviewer 的模型调用全部由隔离的 3210 Crew Harness 执行,3080 仅作为控制面桥接。
49
60
 
50
61
  ## 旧启动器迁移
51
62
 
@@ -31,7 +31,7 @@ node scripts/setup.mjs status
31
31
  | Windows login startup | `DSH Crew.vbs`, `start-dsh-crew.cmd`, and `start-dsh-crew.ps1` | Only DSH Crew-owned files are removed; foreign pre-existing content at those exact paths is preserved or fails closed |
32
32
  | Official 3080 UI | Optional lightweight bridge after `integrate` | `detach` removes the bridge; a backup is kept |
33
33
 
34
- The Windows login launcher starts the official UI on 3080 and the isolated Crew backend on 3210. It does not open a browser and does not store credentials.
34
+ The Windows login launcher starts the official UI on 3080. The 3080 bridge then starts and owns the isolated Crew backend on 3210, so provider restart/rollback operations have one verifiable supervisor. It does not open a browser and does not store credentials.
35
35
 
36
36
  ZCode uses `~/.zcode/cli/config.json` when it already has native MCP servers. If
37
37
  that native list is empty, the installer uses `~/.agents/mcp.json`; unrelated
@@ -1,46 +1,65 @@
1
- # 3080 and 3210 UI responsibilities
2
-
3
- DSH Crew deliberately presents two different user experiences from one shared
4
- client build.
5
-
6
- ## 3080: daily Crew control plane
7
-
8
- The official Harness `web` profile on `127.0.0.1:3080` owns day-to-day Crew
9
- management:
10
-
11
- - Crew workflow and global enablement
12
- - Worker and Reviewer policy
13
- - model priority, fallback, review, and adaptive routing
14
- - runtime and activation-boundary information
15
- - Codex, Claude, and ZCode installation actions and structured readiness
16
- - task status and bounded model-invocation summaries
17
- - the link to the underlying 3210 Crew Harness
18
-
19
- The lightweight official-web bridge keeps these requests same-origin and
20
- proxies only the `/_dsh/dsh-crew/*` contract to the isolated backend.
21
-
22
- ## 3210: isolated native Harness
23
-
24
- The Crew-owned `dsh-crew` profile on `127.0.0.1:3210` owns model execution and
25
- low-level Harness configuration. Its native Harness menus remain the place for
26
- Providers, Harness Models, Agent presets, and native runtime settings.
27
-
28
- The DSH Crew settings entry on this surface is intentionally diagnostics-only:
29
- it shows bounded runtime identity and a link back to 3080. It does not duplicate
30
- Worker/Reviewer policy, host integrations, tasks, or orchestration controls.
31
-
32
- ## Surface detection and failure behavior
33
-
34
- The client does not infer responsibility from a hard-coded browser port. It
35
- uses two same-origin, structured signals:
36
-
37
- 1. `/_dsh/dsh-crew/bridge-status` identifies the official bridge control plane.
38
- 2. `/_dsh/dsh-crew/runtime` identifies the native Crew-owned runtime.
39
-
40
- The bridge signal wins on 3080 because the proxied runtime response correctly
41
- describes the 3210 backend. If neither contract can be verified, the client
42
- fails closed to the minimal diagnostics view. Missing evidence never enables
43
- the full control plane and never becomes `READY`.
44
-
45
- The split changes presentation only. Crew state, credentials, routing policy,
46
- and model execution remain isolated under the Crew-owned home and profile.
1
+ # 3080 and 3210 UI responsibilities
2
+
3
+ DSH Crew deliberately presents two different user experiences from one shared
4
+ client build.
5
+
6
+ ## 3080: daily Crew control plane
7
+
8
+ The official Harness `web` profile on `127.0.0.1:3080` owns day-to-day Crew
9
+ management:
10
+
11
+ - Crew workflow and global enablement
12
+ - Worker and Reviewer policy
13
+ - model priority, fallback, review, and adaptive routing
14
+ - runtime and activation-boundary information
15
+ - Codex, Claude, and ZCode installation actions and structured readiness
16
+ - task status and bounded model-invocation summaries
17
+ - the link to the underlying 3210 Crew Harness
18
+
19
+ The lightweight official-web bridge keeps these requests same-origin and
20
+ proxies only the `/_dsh/dsh-crew/*` contract to the isolated backend.
21
+
22
+ ## 3210: isolated native Harness
23
+
24
+ The Crew-owned `dsh-crew` profile on `127.0.0.1:3210` owns model execution and
25
+ low-level Harness configuration. Its native Harness menus remain the place for
26
+ Providers, Harness Models, Agent presets, and native runtime settings.
27
+
28
+ The DSH Crew settings entry on this surface is intentionally diagnostics-only:
29
+ it shows bounded runtime identity and a link back to 3080. It does not duplicate
30
+ Worker/Reviewer policy, host integrations, tasks, or orchestration controls.
31
+
32
+ ## Surface detection and failure behavior
33
+
34
+ The client does not infer responsibility from a hard-coded browser port. It
35
+ uses two same-origin, structured signals:
36
+
37
+ 1. `/_dsh/dsh-crew/bridge-status` identifies the official bridge control plane.
38
+ 2. `/_dsh/dsh-crew/runtime` identifies the native Crew-owned runtime.
39
+
40
+ The bridge signal wins on 3080 because the proxied runtime response correctly
41
+ describes the 3210 backend. If neither contract can be verified, the client
42
+ fails closed to the minimal diagnostics view. Missing evidence never enables
43
+ the full control plane and never becomes `READY`.
44
+
45
+ The split changes presentation only. Crew state, credentials, routing policy,
46
+ and model execution remain isolated under the Crew-owned home and profile.
47
+
48
+ ## Local trust model
49
+
50
+ Both surfaces listen on loopback only and share one request guard
51
+ (`src/local-request-guard.mjs`). A request is trusted when it proves, in
52
+ order: (1) the TCP peer is a loopback address, (2) the `Host` header names a
53
+ loopback host, (3) browser fetch-metadata (`Sec-Fetch-Site`) is `same-origin`
54
+ or absent/`none`, and (4) when an `Origin` header is present it names a
55
+ loopback host — on the 3080 bridge the `Origin` authority must additionally
56
+ equal the request authority, while the 3210 hub accepts any loopback origin
57
+ because the 3080 panel calls it cross-port.
58
+
59
+ There is deliberately no bearer token: every process running as the local
60
+ user is inside the trust boundary and may control Crew. The guards keep
61
+ off-machine browsers, DNS-rebinding pages, and cross-machine proxies out;
62
+ they do not authenticate local users. If a deployment ever needs to separate
63
+ local principals, add a per-install random token to state-changing calls and
64
+ inject it server-side in the bridge — do not use browser `Origin` as
65
+ authentication.