@dsh-workbench/core 0.3.10 → 1.0.0-beta.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/LICENSE +21 -0
- package/README.md +148 -105
- package/bin/dsh-workbench +132 -31
- package/bin/dsh-workbench.cmd +5 -0
- package/bin/opencli-isolated +3 -2
- package/bin/opencli-isolated.mjs +44 -0
- package/bin/opencli-node-mode.cjs +1 -0
- package/bin/seed-workshop-windows.mjs +307 -0
- package/client.js +8192 -4904
- package/cordis.patch.yml +62 -37
- package/dist/client/client.body.js +8192 -4904
- package/dist/client/index.js +7186 -3898
- package/dist/host/index.js +7277 -6956
- package/dist/types/app/client.d.ts +3 -1
- package/dist/types/app/host.d.ts +2 -1
- package/dist/types/app/layouts/approval-detail.d.ts +3 -0
- package/dist/types/app/layouts/env-gate/boot-gate.d.ts +1 -12
- package/dist/types/app/layouts/env-gate/gate-text.d.ts +2 -1
- package/dist/types/app/layouts/market/DiscoverPanel.d.ts +8 -0
- package/dist/types/app/layouts/market/add-module-text.d.ts +1 -1
- package/dist/types/app/layouts/market/discover-categories.d.ts +8 -0
- package/dist/types/app/layouts/market/discover-confirm.d.ts +14 -0
- package/dist/types/app/layouts/market/discover-detail.d.ts +12 -0
- package/dist/types/app/layouts/market/discover-dialogs.d.ts +7 -0
- package/dist/types/app/layouts/market/discover-doc.d.ts +18 -0
- package/dist/types/app/layouts/market/discover-init-dialog.d.ts +10 -0
- package/dist/types/app/layouts/market/discover-rows.d.ts +24 -0
- package/dist/types/app/layouts/market/discover-sources-dialog.d.ts +16 -0
- package/dist/types/app/layouts/market/discover-states.d.ts +22 -0
- package/dist/types/app/layouts/market/discover-toolbar.d.ts +23 -0
- package/dist/types/app/layouts/market/discover-versions.d.ts +9 -0
- package/dist/types/app/layouts/market/discover-view.d.ts +38 -0
- package/dist/types/app/layouts/market/market-header.d.ts +13 -0
- package/dist/types/app/layouts/market/panel.d.ts +1 -1
- package/dist/types/app/layouts/market/use-add-module.d.ts +1 -1
- package/dist/types/app/layouts/market/use-discover.d.ts +72 -0
- package/dist/types/app/layouts/market/use-module-versions.d.ts +6 -2
- package/dist/types/app/layouts/rightbar/MarketView.d.ts +6 -3
- package/dist/types/app/layouts/rightbar/Rightbar.d.ts +1 -1
- package/dist/types/app/layouts/rightbar/board-shape.d.ts +1 -14
- package/dist/types/app/layouts/rightbar/market-act.d.ts +6 -3
- package/dist/types/app/layouts/rightbar/market-busy.d.ts +0 -22
- package/dist/types/app/layouts/rightbar/market-change.d.ts +1 -1
- package/dist/types/app/layouts/rightbar/market-hint.d.ts +1 -7
- package/dist/types/app/layouts/rightbar/market-plugin-rows.d.ts +0 -7
- package/dist/types/app/layouts/rightbar/market-row-icon.d.ts +1 -1
- package/dist/types/app/layouts/rightbar/market-row-types.d.ts +2 -2
- package/dist/types/app/layouts/rightbar/market-rows.d.ts +1 -1
- package/dist/types/app/layouts/rightbar/market-section-icon.d.ts +1 -1
- package/dist/types/app/layouts/rightbar/market-settle-hold.d.ts +2 -0
- package/dist/types/app/layouts/rightbar/market-settle.d.ts +17 -0
- package/dist/types/app/layouts/rightbar/market-shared-rows.d.ts +1 -1
- package/dist/types/app/layouts/rightbar/market-update-verdict.d.ts +31 -0
- package/dist/types/app/layouts/rightbar/market-view-text.d.ts +8 -1
- package/dist/types/app/layouts/rightbar/market-workbench-row.d.ts +1 -1
- package/dist/types/app/layouts/rightbar/store.d.ts +2 -0
- package/dist/types/app/layouts/sidebar/LongTaskDot.d.ts +6 -0
- package/dist/types/app/layouts/sidebar/LongTaskHover.d.ts +6 -0
- package/dist/types/app/layouts/sidebar/edition-boot.d.ts +6 -0
- package/dist/types/app/layouts/sidebar/edition.d.ts +5 -0
- package/dist/types/app/layouts/sidebar/use-attention.d.ts +0 -4
- package/dist/types/app/layouts/sidebar/workshop-preset.d.ts +2 -0
- package/dist/types/app/layouts/workbench-settings/AdapterSetItem.d.ts +5 -0
- package/dist/types/app/layouts/workbench-settings/ConfigSyncItem.d.ts +5 -0
- package/dist/types/app/layouts/workbench-settings/ConfigSyncRows.d.ts +11 -0
- package/dist/types/app/layouts/workbench-settings/NewWorkbenchItem.d.ts +5 -0
- package/dist/types/app/layouts/workbench-settings/SettingsItem.d.ts +8 -0
- package/dist/types/app/layouts/workbench-settings/SidebarEditionItem.d.ts +5 -0
- package/dist/types/app/layouts/workbench-settings/WorkbenchSettingsSection.d.ts +5 -0
- package/dist/types/app/units/manifests.d.ts +1 -1
- package/dist/types/{app/units → kernel/client}/registry.d.ts +1 -1
- package/dist/types/kernel/contract/bundle-install.d.ts +2 -0
- package/dist/types/kernel/contract/config-sync.d.ts +2 -0
- package/dist/types/kernel/contract/diy.d.ts +1 -0
- package/dist/types/kernel/contract/dsh-plugins.d.ts +2 -0
- package/dist/types/kernel/contract/index.d.ts +4 -0
- package/dist/types/kernel/contract/long-tasks.d.ts +2 -0
- package/dist/types/kernel/contract/market-index.d.ts +2 -0
- package/dist/types/kernel/contract/platform.d.ts +1 -0
- package/dist/types/kernel/contract/preflight-wake.d.ts +2 -0
- package/dist/types/kernel/contract/profile-create.d.ts +2 -0
- package/dist/types/kernel/contract/sidebar-edition.d.ts +2 -0
- package/dist/types/kernel/contract/unit-manifests.d.ts +2 -0
- package/dist/types/{shared/api → kernel}/host/mount-units.d.ts +2 -1
- package/dist/types/modules/panels/client.d.ts +1 -1
- package/dist/types/modules/panels/model/approval.d.ts +4 -8
- package/dist/types/modules/panels/model/diy-browser-tools.d.ts +1 -1
- package/dist/types/modules/panels/model/diy-changelog.d.ts +2 -0
- package/dist/types/modules/panels/model/diy-context.d.ts +20 -18
- package/dist/types/modules/panels/model/diy-page.d.ts +4 -2
- package/dist/types/modules/panels/model/diy-record-open.d.ts +0 -15
- package/dist/types/modules/panels/model/diy-record-text.d.ts +0 -2
- package/dist/types/modules/panels/model/diy-record.d.ts +1 -31
- package/dist/types/modules/panels/model/diy-report.d.ts +6 -7
- package/dist/types/modules/panels/model/diy-tools.d.ts +1 -0
- package/dist/types/modules/panels/model/long-task-tools.d.ts +0 -11
- package/dist/types/modules/panels/model/market-dependency-update.d.ts +15 -0
- package/dist/types/modules/panels/model/market-dependency.d.ts +15 -10
- package/dist/types/modules/panels/model/market-discover-routes.d.ts +3 -0
- package/dist/types/modules/panels/model/market-discover.d.ts +33 -0
- package/dist/types/modules/panels/model/market-dispatch.d.ts +4 -3
- package/dist/types/modules/panels/model/market-env.d.ts +2 -3
- package/dist/types/modules/panels/model/market-registry.d.ts +3 -3
- package/dist/types/modules/panels/model/market-restart.d.ts +1 -1
- package/dist/types/modules/panels/model/market-route.d.ts +5 -3
- package/dist/types/modules/panels/model/market-sources-act.d.ts +9 -0
- package/dist/types/modules/panels/model/market-types.d.ts +7 -13
- package/dist/types/modules/panels/model/market-update-bundle.d.ts +19 -0
- package/dist/types/modules/panels/model/market-verify.d.ts +15 -0
- package/dist/types/modules/panels/model/market-workbench-update.d.ts +3 -2
- package/dist/types/modules/panels/model/market.d.ts +6 -5
- package/dist/types/modules/panels/model/plugin-actions.d.ts +2 -1
- package/dist/types/modules/panels/model/plugin-section.d.ts +3 -1
- package/dist/types/modules/panels/model/publish-preview-routes.d.ts +2 -0
- package/dist/types/modules/panels/unit.d.ts +8 -5
- package/dist/types/modules/sessions/model/attention.d.ts +0 -11
- package/dist/types/modules/sessions/model/session-node.d.ts +0 -10
- package/dist/types/shared/api/diy.d.ts +6 -4
- package/dist/types/shared/api/host/approval-call.d.ts +0 -9
- package/dist/types/shared/api/host/approval-gate.d.ts +26 -0
- package/dist/types/shared/api/host/bundle-routes.d.ts +2 -1
- package/dist/types/shared/api/host/diy-artifacts.d.ts +3 -0
- package/dist/types/shared/api/host/diy-changelog.d.ts +13 -0
- package/dist/types/shared/api/host/diy-components.d.ts +2 -3
- package/dist/types/shared/api/host/diy-modules.d.ts +25 -0
- package/dist/types/shared/api/host/diy-publish-preview.d.ts +4 -0
- package/dist/types/shared/api/host/diy-recon-fs.d.ts +2 -2
- package/dist/types/shared/api/host/diy-tokens.d.ts +8 -0
- package/dist/types/shared/api/host/host-routes.d.ts +10 -0
- package/dist/types/shared/api/host/long-task-notice.d.ts +0 -20
- package/dist/types/shared/api/host/long-tasks.d.ts +1 -8
- package/dist/types/shared/api/host/market-doc.d.ts +21 -0
- package/dist/types/shared/api/host/market-index-fetch.d.ts +37 -0
- package/dist/types/shared/api/host/market-source-init.d.ts +22 -0
- package/dist/types/shared/api/host/market-sources-store.d.ts +15 -0
- package/dist/types/shared/api/host/permission-mode.d.ts +4 -0
- package/dist/types/shared/api/host/post-channels.d.ts +1 -1
- package/dist/types/shared/api/host/sidebar-edition.d.ts +14 -0
- package/dist/types/shared/api/host/unit-roster-facts.d.ts +1 -1
- package/dist/types/shared/api/host/workspace-root.d.ts +6 -0
- package/dist/types/shared/api/platform/client.d.ts +10 -0
- package/dist/types/shared/api/unit-board.d.ts +4 -0
- package/dist/types/shared/api/write-outcome.d.ts +3 -0
- package/dist/types/shared/components/IconModules.d.ts +2 -0
- package/dist/types/shared/components/PanelFoot.d.ts +0 -9
- package/dist/types/shared/components/blocker-action.d.ts +3 -0
- package/dist/types/shared/dev-surface/index.d.ts +5 -0
- package/dist/types/shared/dev-surface/types.d.ts +79 -0
- package/dist/types/shared/hooks/bundle-queries.d.ts +1 -13
- package/dist/types/shared/hooks/fact-transport.d.ts +4 -0
- package/dist/types/shared/hooks/fact-transports.d.ts +0 -4
- package/dist/types/shared/hooks/market-queries.d.ts +11 -0
- package/dist/types/shared/hooks/panel-state-report.d.ts +0 -12
- package/dist/types/shared/hooks/sidebar-edition.d.ts +2 -0
- package/dist/types/shared/hooks/use-blocker-actions.d.ts +0 -8
- package/dist/types/shared/hooks/use-capabilities.d.ts +1 -55
- package/dist/types/shared/hooks/use-capability-gate.d.ts +1 -2
- package/dist/types/shared/hooks/use-diy-debug.d.ts +0 -13
- package/dist/types/shared/hooks/use-diy-record.d.ts +0 -13
- package/dist/types/shared/hooks/use-host-write.d.ts +1 -1
- package/dist/types/shared/hooks/use-shell-long-tasks.d.ts +1 -7
- package/dist/types/shared/hooks/use-unit-board.d.ts +1 -1
- package/icon.svg +17 -28
- package/package.json +33 -13
- package/preset/diy.patch.yml +3 -3
- package/profile/isolation.patch.yml +18 -7
- package/profile/sandbox.patch.yml +2 -2
- package/scripts/clone-profile.mjs +268 -0
- package/scripts/create-workbench.mjs +166 -0
- package/scripts/seed-profile.sh +22 -10
- package/scripts/seed-workshop.sh +17 -19
- package/skills/workbench-module-diy/BUILD.md +57 -133
- package/skills/workbench-module-diy/COPY.md +89 -0
- package/skills/workbench-module-diy/DATASOURCE.md +173 -116
- package/skills/workbench-module-diy/DESIGN.md +76 -109
- package/skills/workbench-module-diy/FAMILY.md +48 -52
- package/skills/workbench-module-diy/KIT.md +78 -133
- package/skills/workbench-module-diy/LINKAGE.md +66 -105
- package/skills/workbench-module-diy/PANEL.md +81 -171
- package/skills/workbench-module-diy/REVIEW.md +67 -81
- package/skills/workbench-module-diy/SKILL.md +66 -96
- package/skills/workbench-module-diy/STEPS.md +66 -69
- package/skills/workbench-module-diy/TOOLS.md +134 -103
- package/skills/workbench-module-diy/WIRING.md +64 -84
- package/skills/workbench-module-diy/WRITES.md +115 -142
- package/dist/types/app/layouts/config-sync/ConfigSyncSection.d.ts +0 -5
- package/dist/types/shared/api/bundle-install.d.ts +0 -123
- package/dist/types/shared/api/config-sync.d.ts +0 -35
- package/dist/types/shared/api/dsh-plugins.d.ts +0 -11
- package/dist/types/shared/api/host/bundle-manager.d.ts +0 -11
- package/dist/types/shared/api/host/config-sync.d.ts +0 -46
- package/dist/types/shared/api/host/diy-preset-health.d.ts +0 -35
- package/dist/types/shared/api/host/diy-workshop.d.ts +0 -23
- package/dist/types/shared/api/host/dsh-plugins.d.ts +0 -5
- package/dist/types/shared/api/host/installed-module.d.ts +0 -54
- package/dist/types/shared/api/host/installed-module.test.d.ts +0 -1
- package/dist/types/shared/api/host/opencli-command.d.ts +0 -10
- package/dist/types/shared/api/host/opencli-command.test.d.ts +0 -1
- package/dist/types/shared/api/host/opencli.test.d.ts +0 -1
- package/dist/types/shared/api/host/package-content.d.ts +0 -6
- package/dist/types/shared/api/host/package-content.test.d.ts +0 -1
- package/dist/types/shared/api/host/package-kind.d.ts +0 -21
- package/dist/types/shared/api/host/package-kind.test.d.ts +0 -1
- package/dist/types/shared/api/host/package-route.d.ts +0 -23
- package/dist/types/shared/api/host/package-route.test.d.ts +0 -1
- package/dist/types/shared/api/host/plugin-catalog.d.ts +0 -65
- package/dist/types/shared/api/host/plugin-login-hint.d.ts +0 -2
- package/dist/types/shared/api/host/plugin-tools.d.ts +0 -14
- package/dist/types/shared/api/host/plugin-units.d.ts +0 -48
- package/dist/types/shared/api/host/preflight-route.d.ts +0 -15
- package/dist/types/shared/api/host/preflight.d.ts +0 -75
- package/dist/types/shared/api/host/probe-cache.d.ts +0 -6
- package/dist/types/shared/api/host/probe-libs.d.ts +0 -11
- package/dist/types/shared/api/host/probe-units.d.ts +0 -17
- package/dist/types/shared/api/host/probe-verdict.d.ts +0 -7
- package/dist/types/shared/api/host/profile-registries.d.ts +0 -21
- package/dist/types/shared/api/host/registry-declaration.d.ts +0 -23
- package/dist/types/shared/api/host/release.d.ts +0 -24
- package/dist/types/shared/api/host/runtime-seed.d.ts +0 -38
- package/dist/types/shared/api/host/self-update.d.ts +0 -45
- package/dist/types/shared/api/host/version-range.d.ts +0 -2
- package/dist/types/shared/api/host/workshop-root.d.ts +0 -16
- package/dist/types/shared/api/long-tasks.d.ts +0 -19
- package/dist/types/shared/api/unit-manifests.d.ts +0 -6
- package/docs/HANDOFF.md +0 -333
- package/docs/OPERATIONS.md +0 -229
- package/skills/workbench-module-diy/TOOLING.md +0 -55
- /package/dist/types/{app/layouts/rightbar/registry.d.ts → kernel/client/board-registry.d.ts} +0 -0
- /package/dist/types/{app/layouts/rightbar/registry.test.d.ts → kernel/contract/contracts.test.d.ts} +0 -0
- /package/dist/types/{shared/api/host/bundle-manager.test.d.ts → kernel/contract/index.test.d.ts} +0 -0
- /package/dist/types/{shared/api → kernel}/host/unit-readiness.d.ts +0 -0
- /package/dist/types/{shared/api → kernel}/host/unit-registry.d.ts +0 -0
- /package/dist/types/shared/{api/host/diy-workshop.test.d.ts → components/blocker-action.test.d.ts} +0 -0
- /package/dist/types/shared/{api/host/dsh-plugins.test.d.ts → dev-surface/install.d.ts} +0 -0
|
@@ -1,148 +1,121 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 写通道:找到写命令、取得原文、确认、回读
|
|
2
2
|
|
|
3
|
-
[
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
[datasource](DATASOURCE.md) 只管读。本文件管写:提交 / 发布 / 建单 / 改配置。
|
|
4
|
+
|
|
5
|
+
判域同 [DESIGN.md](DESIGN.md) §0:复用现有登录、一次调用能改完 → DIY;要新凭据 / 多步长流程 / 新服务或依赖 → 工程域。
|
|
6
6
|
|
|
7
7
|
## 四步
|
|
8
8
|
|
|
9
|
-
1.
|
|
10
|
-
`读` · `写(可预览)` ·
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
##
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
写完拿**同族的读**(或卡片那条投影)把那一格读回来,**别看"命令没报错"就当成功** ——
|
|
103
|
-
平台可能收下了却没生效,也可能失败在"**可能已经写了**"那一档。写进模块时,
|
|
104
|
-
`design.json` 的 `writes[].readback` 就是这一格(哪条读 / 出参哪个字段)。
|
|
105
|
-
|
|
106
|
-
## 边界(如实)
|
|
107
|
-
|
|
108
|
-
- **`browser network --detail` 在工坊会话里拿不到 body**:它依赖一份盘上缓存,默认路径落在会话可写根之外
|
|
109
|
-
(`EPERM …/opencli/home/.opencli/cache/browser-network`,工具只发一个 `cache_warning`)⇒ 跨调用的 `--detail` 取不到。
|
|
110
|
-
**录制族不依赖它**:它自己那份 `shots/rec-<unit>.jsonl` 就是原文(`_record_detail` 按 key 现取)。
|
|
111
|
-
手工取 body 的另一条路是 `workbench_diy_eval` 里的 `fetch` —— 用它自己的登录在页面里读,返回 JSON;
|
|
112
|
-
或把 `OPENCLI_CACHE_DIR` 指到可写处,再让 `--detail <key>` 生效。
|
|
113
|
-
- **两套 opencli 真相**:PATH 上那份、你机器上 `~/.opencli` 那份、工作台**隔离运行时**那份
|
|
114
|
-
可能不是同一代。工坊一律以**隔离运行时**(`$DSH_HOME/workbench/opencli/`)为准;
|
|
115
|
-
核验用工具,别去看错文件。
|
|
116
|
-
- **取值枚举只在 help 文本里**(manifest 没有 `choices`),别指望 recon 的 `args` 带它。
|
|
117
|
-
|
|
118
|
-
## 落进 `design.json`
|
|
119
|
-
|
|
120
|
-
写通道填 `writes[]`(一个动作可以打几条写:先建后发布;只有一条写也可以写成 `write: {}`)。
|
|
121
|
-
字段**七个必填**、一个可空;下表右边是 `design render` 渲染出来的**行名(逐字)**:
|
|
122
|
-
|
|
123
|
-
| 字段 | 渲染出来的行 |
|
|
9
|
+
1. **找现成写命令** —— `workbench_diy_recon`(`keyword=…`)标注每条命令的读写:
|
|
10
|
+
`读` · `写(可预览)` · `写(无预览档,一次就是真的)`,并给入参签名(`--id --yes=false`)。
|
|
11
|
+
命中即复用(自造会绕过登录、XSRF、错误码处理)。
|
|
12
|
+
只命中写命令时,末句提示:先 `--help` 看入参;带 `--dryRun` / `--yes` 的先走预览;**无预览档不许试写**。
|
|
13
|
+
边界:recon 只覆盖 opencli 自带目录;`inventory` / `demo` 等插件只回命令名,参数走第 2 步。
|
|
14
|
+
|
|
15
|
+
2. **查入参 / 出参**(按可信度):
|
|
16
|
+
|
|
17
|
+
- `workbench_diy_spec`(`command='<site> <name>'`,`inventory publish` / `inventory/publish` 均可):
|
|
18
|
+
返回 `opencli <site> <name> --help -f json` 原文;JSON 时另给 `spec`(`access`、`positionals`、
|
|
19
|
+
`command_options[{name, required, help, default}]`、出参列)。不碰屏、不需约定。
|
|
20
|
+
- recon 的 `args`(必填 / 默认值)与 `preview` 标记,仅覆盖自带目录;插件以 `_spec` 为准。
|
|
21
|
+
- adapter 源码:隔离 HOME 的 `.opencli/plugins/<site>` 指向插件包;接口 URL / 方法 / cookie / XSRF 在源码里。
|
|
22
|
+
- `opencli <site> <name> --help`(`-f yaml` 可读性更好):取枚举值(manifest 无 `choices`,枚举只在 help 里)。
|
|
23
|
+
|
|
24
|
+
3. **无现成命令 → 让用户录一次**(你准备,用户执行):
|
|
25
|
+
|
|
26
|
+
- `workbench_diy_record_prepare({ unit, url, doing })`:开窗置前(**需审批一次**:站点、录哪一下、落点、
|
|
27
|
+
录完不切回),装浮条。用户:① 开始录制 ② 做一次动作 ③ 结束录制。不要让用户点第二次。
|
|
28
|
+
`url` 必须与模块读源同域(`design.json` 声明过读源时跨域当场拒)。
|
|
29
|
+
- 表填好、提交前,请用户按浮条「截图」:不额外审批;产出整页图 + 页面快照(控件 `name` / `id`、
|
|
30
|
+
标签、必填痕迹、填值、是否空、是否改过)。提交时会自动再抓一份。
|
|
31
|
+
- `workbench_diy_record_read`:取清单 `rows`(`index` / `key` / `method` / `url` / `status` / `ct` /
|
|
32
|
+
`size` / `source` / `hasRequest` / `hasResponse` / `likelyWrite` / `marked`),不删行、不回体;
|
|
33
|
+
`expect` 只标 ⭐ 并置顶。按 `key`(或 `index`)调 `workbench_diy_record_detail`:
|
|
34
|
+
返回请求体与响应体原文 + 请求头(可能含凭据,不写入 `design.json`)。同 key 跨轮重名,带 `at` 定位。
|
|
35
|
+
未结束时 read 会说"还在录";可带 `waitMs`(上限 15 分钟)。**一场 = 一个周期**;上一场未收工再
|
|
36
|
+
prepare 会当场拒(不弹审批)。
|
|
37
|
+
- `workbench_diy_record_stop`:停捕获、收标签、清状态,原文另存 `shots/rec-<unit>.jsonl.last`。
|
|
38
|
+
**先 read / detail,再 stop**。左栏键只发消息;录完无键。
|
|
39
|
+
- 抓不到:原生 `<form>` 提交 / WebSocket / service worker / 其他标签。页面钩子只认 `fetch` 与 XHR,
|
|
40
|
+
上限 50 条、单条请求体 16 KB。兜底:`opencli browser <会话> bind`(当前聚焦窗活动标签)或
|
|
41
|
+
`open … --window foreground`,先 `network --follow` 再让用户操作;取 body 用 `network --raw`
|
|
42
|
+
(同一调用内);仍无则请用户从 DevTools 复制 curl。
|
|
43
|
+
- 参数与返回细则见 [FAMILY.md](FAMILY.md) §4。
|
|
44
|
+
- 仅测试环境 / 可撤销目标可让 agent 自己点。
|
|
45
|
+
|
|
46
|
+
取证结果落成模块的写能力:`writes: true` + `needsApproval` + `approvalDetail`([TOOLS.md](TOOLS.md) §6)。
|
|
47
|
+
|
|
48
|
+
4. **文档 / 问用户** —— 接口文档、curl 样例都可用于确认需求;问法照 [STEPS.md](STEPS.md),不问技术细节。
|
|
49
|
+
|
|
50
|
+
## 执行体(写工具里那一下)
|
|
51
|
+
|
|
52
|
+
写工具被点头之后,按这个顺序选:
|
|
53
|
+
|
|
54
|
+
1. **有现成 opencli 写命令** → `opencli <site> <name> …`;`--yes` 只在 `confirm === true` 时加,
|
|
55
|
+
没有预览档的写不许试写(见上面四步)。
|
|
56
|
+
2. **没有命令、但能落配方** → `data.submit(recipe, { body })`。预览用
|
|
57
|
+
`describeRecipe(recipe)`(`@dsh-workbench/shared/host`)回 `{ method, url, body }`,
|
|
58
|
+
凭据只回"放在哪";真写才调 `submit`。
|
|
59
|
+
3. **都不行**(签名 / WS / 多步 / 一次性 token)→ 旧的 `data.read({ kind: 'browser', script })`,
|
|
60
|
+
在 `design.json` 里写 `custom: { why }`,脚本留在代码里。
|
|
61
|
+
|
|
62
|
+
三条都不自动重试:失败先回读,再决定。写完的回读用同一份 `DATASOURCE` 里的读配方(或同族命令)。
|
|
63
|
+
|
|
64
|
+
第 2 条走的是哪条传输由壳决定(页面脚本 / 宿主侧的公共通道),模块看不见也不该依赖 ——
|
|
65
|
+
`submit` 的返回形状、错误码、审批、回读全都一样。
|
|
66
|
+
|
|
67
|
+
**录制 → 配方**:`_record_detail` 的原文是取证。method / path / body / contentType 抄进配方;
|
|
68
|
+
`authorization` / `cookie` / `x-csrf-*` 这些头**丢掉**,改写成 `auth.source` + `auth.place`;
|
|
69
|
+
一次性 token / 签名 / 多步 → `custom`。"授权观察一次 ≠ 授权重放":每次 `submit` 都重新审批。
|
|
70
|
+
|
|
71
|
+
## 硬纪律
|
|
72
|
+
|
|
73
|
+
- **预览**:先确认是否有 `yes` / `dryRun` / `confirm` 档;有则先走预览。`opencli inventory publish` / `inventory build`
|
|
74
|
+
无预览开关,调用即真发布 / 真构建。**无预览档不许试写。**
|
|
75
|
+
- 要新凭据 / 多步长流程 / 新依赖 → 工程域。
|
|
76
|
+
|
|
77
|
+
## 写纪律
|
|
78
|
+
|
|
79
|
+
1. 授权观察一次 ≠ 授权重放。已看过也要再次确认(一场录制即一个周期)。
|
|
80
|
+
2. 写后不确定单独报,不自动重试。命令报错可能已写入:停下,先回读,再决定。
|
|
81
|
+
`design.json` 的 `failure` 覆盖这一档。
|
|
82
|
+
3. 写要有配对的撤销 / 反操作(`follow` ↔ `unfollow`、`publish` ↔ `delete`…)。`writes[].undo` 必填;
|
|
83
|
+
没有就写"没有配对,一次就是真的"(空 = 未考虑,`design check` 点名)。
|
|
84
|
+
|
|
85
|
+
## 回读
|
|
86
|
+
|
|
87
|
+
写后用同族读或卡片投影读回该格。不以"命令没报错"判成功。`writes[].readback` 记录哪条读 / 哪个字段。
|
|
88
|
+
|
|
89
|
+
## 边界
|
|
90
|
+
|
|
91
|
+
- `browser network --detail` 在本会话取不到 body(缓存落在可写根之外)。录制族不依赖它;
|
|
92
|
+
手工取 body 用 `workbench_diy_eval` 的 `fetch`,或把 `OPENCLI_CACHE_DIR` 指到可写处。
|
|
93
|
+
- opencli 可能有三份(PATH、`~/.opencli`、隔离运行时);以隔离运行时 `$DSH_HOME/workbench/opencli/` 为准。
|
|
94
|
+
- 枚举值只在 help 文本里。
|
|
95
|
+
|
|
96
|
+
## design.json:writes[]
|
|
97
|
+
|
|
98
|
+
字段七个必填、三个可空(`probeCommand` / `key + recipe` / `custom`):
|
|
99
|
+
|
|
100
|
+
| 字段 | 行名 |
|
|
124
101
|
|---|---|
|
|
125
102
|
| `command` | 哪条写(命令 / URL + 方法) |
|
|
126
|
-
| `params` | 参数(必填 /
|
|
127
|
-
| `credentials` |
|
|
128
|
-
| `preview` |
|
|
129
|
-
| `readback` |
|
|
130
|
-
| `undo` |
|
|
131
|
-
| `failure` |
|
|
132
|
-
| `probeCommand`(可空) |
|
|
133
|
-
|
|
134
|
-
`
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
`
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
判据只咬**来源有没有写出来**:`params` 里出现"必填"时,同一格必须带来源关键词之一
|
|
146
|
-
(`已证` / `声明` / `人证` / `契约` / `未定`),否则 `design check` 点名 `write.params.source`。
|
|
147
|
-
**旧模块**补一个括号就过 —— `(前端已证)` / `(服务端已证)` / `(人证)` / `(契约)` / `(未定)`;别的不用动。
|
|
148
|
-
写成 `非必填` / `不必填` 的不需要来源(那一格是"可选")。这一条**不校验来源是不是真的** —— 它逼你想过,不逼你造假。
|
|
103
|
+
| `params` | 参数(必填 / 枚举 / 上限);写"必填"需带来源 |
|
|
104
|
+
| `credentials` | 凭据来源 |
|
|
105
|
+
| `preview` | 有无预览档(无则"没有,一次就是真的") |
|
|
106
|
+
| `readback` | 回读方式(哪条读 / 哪个字段) |
|
|
107
|
+
| `undo` | 撤销 / 删除;无则"没有配对,一次就是真的" |
|
|
108
|
+
| `failure` | 失败形态(含"可能已经写了") |
|
|
109
|
+
| `probeCommand`(可空) | 探明 / 预览调用原文 |
|
|
110
|
+
| `key` + `recipe`(可空,成对) | 调用形状(配方):写走 `data.submit` 时填,`sync` 把它和读一起生成进 `src/datasource.ts`(`DATASOURCE.<key>`)。`key` 不许和读撞,撞了 `design check` 红 |
|
|
111
|
+
| `custom`(可空) | 只记 `why`:配方盖不住的写(签名 / 多步 / 一次性 token),脚本仍留代码里;与 `recipe` 二选一,`design check` 记 warn |
|
|
112
|
+
|
|
113
|
+
写了 `key + recipe` 的写,预览用 `describeRecipe(DATASOURCE.<key>)`,执行用
|
|
114
|
+
`data.submit(DATASOURCE.<key>, overrides)`;不再把 origin / path 写进代码。
|
|
115
|
+
|
|
116
|
+
`design render` 写入 README 的 `### 写通道探明记录`(位于「数据源探明记录」与「验收」之间)。
|
|
117
|
+
`design check` 点名空格;无写通道的模块不写。
|
|
118
|
+
|
|
119
|
+
`params` 来源:依据 `workbench_diy_record_read` 的截图(必填红星)或契约(`--help -f json` 的 `required`)。
|
|
120
|
+
出现"必填"时须带来源关键词之一:`已证` / `声明` / `人证` / `契约` / `未定`,否则报 `write.params.source`。
|
|
121
|
+
`非必填` / `不必填` 不要求来源。判据只查是否写下来源。
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
export declare const BUNDLE_REGISTRIES_ROUTE = "bundle-registries";
|
|
2
|
-
export declare const BUNDLE_INSPECT_ROUTE = "bundle-inspect";
|
|
3
|
-
export declare const BUNDLE_REGISTRY_DEFAULT = "default";
|
|
4
|
-
export declare const MODULE_VERSIONS_ROUTE = "module-versions";
|
|
5
|
-
export type BundleRegistry = string | null;
|
|
6
|
-
export interface BundleRegistries {
|
|
7
|
-
readonly registry: BundleRegistry;
|
|
8
|
-
readonly fallbackRegistries: readonly BundleRegistry[];
|
|
9
|
-
readonly resolved: string | null;
|
|
10
|
-
}
|
|
11
|
-
export type BundleInspectProblem = 'invalid-spec' | 'already-installed' | 'not-found' | 'not-a-package' | 'not-a-bundle' | 'not-a-workbench-module' | 'not-a-module-or-plugin' | 'network' | 'unknown';
|
|
12
|
-
export type BundleSpecKind = 'registry' | 'path' | 'git' | 'tarball';
|
|
13
|
-
export interface BundleInspectionAccepted {
|
|
14
|
-
readonly status: 'accepted';
|
|
15
|
-
readonly kind: BundleSpecKind;
|
|
16
|
-
readonly name?: string;
|
|
17
|
-
readonly version?: string;
|
|
18
|
-
readonly description?: string;
|
|
19
|
-
readonly bundle: boolean | null;
|
|
20
|
-
readonly registry: BundleRegistry;
|
|
21
|
-
readonly host?: string;
|
|
22
|
-
}
|
|
23
|
-
export interface BundleInspectionRefused {
|
|
24
|
-
readonly status: 'refused';
|
|
25
|
-
readonly problem: BundleInspectProblem;
|
|
26
|
-
readonly reason: string;
|
|
27
|
-
readonly registries?: readonly BundleRegistry[];
|
|
28
|
-
}
|
|
29
|
-
export interface BundleInspectionPlugin {
|
|
30
|
-
readonly status: 'plugin';
|
|
31
|
-
readonly pkg: string;
|
|
32
|
-
readonly registry: BundleRegistry;
|
|
33
|
-
readonly pluginName?: string;
|
|
34
|
-
readonly version?: string;
|
|
35
|
-
}
|
|
36
|
-
export type BundleInspection = BundleInspectionAccepted | BundleInspectionRefused | BundleInspectionPlugin;
|
|
37
|
-
export interface BundleRegistriesPayload {
|
|
38
|
-
readonly available: boolean;
|
|
39
|
-
readonly registries: BundleRegistries | null;
|
|
40
|
-
}
|
|
41
|
-
export interface BundleInspectionPayload {
|
|
42
|
-
readonly inspection: BundleInspection;
|
|
43
|
-
}
|
|
44
|
-
export type BundleApplication = 'applied' | 'restart-required' | 'overridden' | 'failed' | 'cancelled';
|
|
45
|
-
export declare const RESTART_REASONS: readonly ["no-hmr", "package-moved", "host-module", "unmanaged-plugin", "module-comparison"];
|
|
46
|
-
export type RestartReason = (typeof RESTART_REASONS)[number];
|
|
47
|
-
export type BundleChangeStage = 'install' | 'enable' | 'remove';
|
|
48
|
-
export type BundleFailureKind = 'pnpm-missing' | 'timeout' | 'not-found' | 'no-matching-version' | 'network' | 'disk-full' | 'permission' | 'build-blocked' | 'integrity' | 'unknown';
|
|
49
|
-
export interface BundlePackageResult {
|
|
50
|
-
readonly exitCode: number;
|
|
51
|
-
readonly output: string;
|
|
52
|
-
readonly truncated: boolean;
|
|
53
|
-
readonly logPath: string;
|
|
54
|
-
readonly kind?: BundleFailureKind;
|
|
55
|
-
}
|
|
56
|
-
export interface BundleChange {
|
|
57
|
-
readonly application: BundleApplication;
|
|
58
|
-
readonly stage: BundleChangeStage;
|
|
59
|
-
readonly changed: boolean;
|
|
60
|
-
readonly target: string;
|
|
61
|
-
readonly bundle?: string;
|
|
62
|
-
readonly errorCode?: string;
|
|
63
|
-
readonly errorDetail?: string;
|
|
64
|
-
readonly packageResult?: BundlePackageResult;
|
|
65
|
-
readonly pendingBuilds?: readonly string[];
|
|
66
|
-
readonly restartReason?: RestartReason;
|
|
67
|
-
readonly failedAt?: 'registry' | 'spec-host';
|
|
68
|
-
}
|
|
69
|
-
export interface BundleInstallRequest {
|
|
70
|
-
readonly spec: string;
|
|
71
|
-
readonly registry?: BundleRegistry;
|
|
72
|
-
readonly requestId?: string;
|
|
73
|
-
readonly approvedBuilds?: readonly string[];
|
|
74
|
-
}
|
|
75
|
-
export type BundleCancellation = 'cancelled' | 'too-late' | 'not-running';
|
|
76
|
-
export type BundleSupplyState = 'not-a-module' | 'no-needs' | 'installed' | 'failed' | 'pending-restart';
|
|
77
|
-
export interface BundleModulePayload {
|
|
78
|
-
readonly kind: 'module' | 'not-module' | 'unknown';
|
|
79
|
-
readonly pkg: string;
|
|
80
|
-
readonly unit?: string;
|
|
81
|
-
readonly version?: string;
|
|
82
|
-
}
|
|
83
|
-
export interface BundleSupplyPayload {
|
|
84
|
-
readonly state: BundleSupplyState;
|
|
85
|
-
readonly reason?: string;
|
|
86
|
-
}
|
|
87
|
-
export interface BundleInstalledPlugin {
|
|
88
|
-
readonly kind: 'opencli-plugin';
|
|
89
|
-
readonly pkg: string;
|
|
90
|
-
readonly name?: string;
|
|
91
|
-
}
|
|
92
|
-
export interface BundleInstallPayload {
|
|
93
|
-
readonly change: BundleChange;
|
|
94
|
-
readonly module: BundleModulePayload;
|
|
95
|
-
readonly supply: BundleSupplyPayload;
|
|
96
|
-
readonly plugin?: BundleInstalledPlugin;
|
|
97
|
-
}
|
|
98
|
-
export interface BundleRemovePayload {
|
|
99
|
-
readonly change: BundleChange;
|
|
100
|
-
readonly keptFor: readonly string[];
|
|
101
|
-
}
|
|
102
|
-
export interface BundleCancellationPayload {
|
|
103
|
-
readonly cancellation: BundleCancellation | null;
|
|
104
|
-
}
|
|
105
|
-
export interface ModuleVersion {
|
|
106
|
-
readonly unit: string;
|
|
107
|
-
readonly pkg: string;
|
|
108
|
-
readonly installed: string;
|
|
109
|
-
readonly latest?: string;
|
|
110
|
-
readonly local?: boolean;
|
|
111
|
-
readonly refused?: readonly string[];
|
|
112
|
-
}
|
|
113
|
-
export interface WorkbenchVersion {
|
|
114
|
-
readonly pkg: string;
|
|
115
|
-
readonly installed: string;
|
|
116
|
-
readonly latest?: string;
|
|
117
|
-
readonly running?: string;
|
|
118
|
-
readonly local?: boolean;
|
|
119
|
-
}
|
|
120
|
-
export interface ModuleVersionsPayload {
|
|
121
|
-
readonly modules: readonly ModuleVersion[];
|
|
122
|
-
readonly workbench?: WorkbenchVersion;
|
|
123
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export declare const CONFIG_SYNC_ROUTE = "config-sync";
|
|
2
|
-
export declare const CONFIG_SYNC_RESOURCE = "configSync";
|
|
3
|
-
export type ConfigSyncState = 'new' | 'differs';
|
|
4
|
-
export interface ConfigSyncRow {
|
|
5
|
-
readonly key: string;
|
|
6
|
-
readonly id: string;
|
|
7
|
-
readonly insert: boolean;
|
|
8
|
-
readonly state: ConfigSyncState;
|
|
9
|
-
readonly body: string;
|
|
10
|
-
readonly ownBody: string | null;
|
|
11
|
-
readonly missing: readonly string[];
|
|
12
|
-
}
|
|
13
|
-
export interface ConfigSyncProfile {
|
|
14
|
-
readonly name: string;
|
|
15
|
-
readonly readable: boolean;
|
|
16
|
-
readonly candidates: number;
|
|
17
|
-
}
|
|
18
|
-
export interface ConfigSyncSnapshot {
|
|
19
|
-
readonly self: string;
|
|
20
|
-
readonly home: string;
|
|
21
|
-
readonly source: string;
|
|
22
|
-
readonly profiles: readonly ConfigSyncProfile[];
|
|
23
|
-
readonly rows: readonly ConfigSyncRow[];
|
|
24
|
-
readonly emptyProviders: boolean;
|
|
25
|
-
readonly reason?: string;
|
|
26
|
-
}
|
|
27
|
-
export interface ConfigSyncApplied {
|
|
28
|
-
readonly written: readonly string[];
|
|
29
|
-
readonly skipped: readonly string[];
|
|
30
|
-
}
|
|
31
|
-
export interface ConfigSyncRequest {
|
|
32
|
-
readonly source: string;
|
|
33
|
-
readonly keys: readonly string[];
|
|
34
|
-
readonly overwrite: readonly string[];
|
|
35
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const DSH_PLUGINS_ROUTE = "dsh-plugins";
|
|
2
|
-
export interface DshPluginRow {
|
|
3
|
-
readonly name: string;
|
|
4
|
-
readonly version: string;
|
|
5
|
-
readonly enabled: boolean;
|
|
6
|
-
}
|
|
7
|
-
export interface DshPluginsSnapshot {
|
|
8
|
-
readonly available: boolean;
|
|
9
|
-
readonly bundles: readonly DshPluginRow[];
|
|
10
|
-
readonly plugins: readonly DshPluginRow[];
|
|
11
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { DshHostContext } from '@dsh-workbench/shared';
|
|
2
|
-
import type { BundleCancellation, BundleChange, BundleInspection, BundleInstallRequest, BundleRegistries, BundleRegistry } from '../bundle-install.js';
|
|
3
|
-
export interface BundleManager {
|
|
4
|
-
registries(): Promise<BundleRegistries | null>;
|
|
5
|
-
inspect(spec: string, registry?: BundleRegistry): Promise<BundleInspection | null>;
|
|
6
|
-
install(request: BundleInstallRequest): Promise<BundleChange | null>;
|
|
7
|
-
remove(name: string): Promise<BundleChange | null>;
|
|
8
|
-
setEnabled?(name: string, enabled: boolean): Promise<BundleChange | null>;
|
|
9
|
-
cancel(requestId: string): Promise<BundleCancellation | null>;
|
|
10
|
-
}
|
|
11
|
-
export declare function readBundleManager(ctx: DshHostContext): BundleManager | undefined;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { PostResource, RouteHandler } from '@dsh-workbench/shared/host';
|
|
2
|
-
import type { ConfigSyncRow, ConfigSyncSnapshot } from '../config-sync.js';
|
|
3
|
-
export interface PatchBlock {
|
|
4
|
-
readonly key: string;
|
|
5
|
-
readonly id: string;
|
|
6
|
-
readonly insert: boolean;
|
|
7
|
-
readonly body: string;
|
|
8
|
-
readonly names: readonly string[];
|
|
9
|
-
}
|
|
10
|
-
export declare function patchBlocks(text: string): PatchBlock[];
|
|
11
|
-
export declare function normalizeBlock(body: string): string;
|
|
12
|
-
export declare function syncRows(source: readonly PatchBlock[], own: readonly PatchBlock[], missing: (block: PatchBlock) => readonly string[]): ConfigSyncRow[];
|
|
13
|
-
export declare function mergeBlocks(ownText: string, incoming: readonly PatchBlock[], overwrite: ReadonlySet<string>): {
|
|
14
|
-
ok: true;
|
|
15
|
-
text: string;
|
|
16
|
-
written: string[];
|
|
17
|
-
skipped: string[];
|
|
18
|
-
} | {
|
|
19
|
-
ok: false;
|
|
20
|
-
reason: string;
|
|
21
|
-
};
|
|
22
|
-
export declare function readPatchBlocks(path: string): {
|
|
23
|
-
ok: true;
|
|
24
|
-
text: string;
|
|
25
|
-
blocks: PatchBlock[];
|
|
26
|
-
} | {
|
|
27
|
-
ok: false;
|
|
28
|
-
reason: string;
|
|
29
|
-
};
|
|
30
|
-
export declare function writePatchFile(path: string, text: string): void;
|
|
31
|
-
export interface ConfigSyncDeps {
|
|
32
|
-
readonly home: string;
|
|
33
|
-
readonly self: string;
|
|
34
|
-
readonly profileDir: string | null;
|
|
35
|
-
}
|
|
36
|
-
export declare function configSyncHandler(deps: ConfigSyncDeps): RouteHandler;
|
|
37
|
-
export declare function configSyncSnapshot(deps: ConfigSyncDeps, asked?: string): ConfigSyncSnapshot;
|
|
38
|
-
export declare function configSyncApply(deps: ConfigSyncDeps, payload: unknown): {
|
|
39
|
-
ok: true;
|
|
40
|
-
written: string[];
|
|
41
|
-
skipped: string[];
|
|
42
|
-
} | {
|
|
43
|
-
ok: false;
|
|
44
|
-
text: string;
|
|
45
|
-
};
|
|
46
|
-
export declare function configSyncAction(deps: ConfigSyncDeps): PostResource;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { DshAgentPresetRow, DshHostContext } from '@dsh-workbench/shared';
|
|
2
|
-
/**
|
|
3
|
-
* DIY 模式挂不起来时给用户的那条修法:升级 dsh,再重启一次工作台(启动器那道拒绝用的是同一条)。
|
|
4
|
-
*/
|
|
5
|
-
export declare const DIY_UPGRADE_COMMAND = "npm i -g @deepseek-ai/dsh@latest";
|
|
6
|
-
/**
|
|
7
|
-
* 一次 DIY 模式体检的结论:`ok` 为真 = 名册里有那一行且挂着;为假时 `rows` 是挂不起来的行名、`detail` 是 dsh 给的原文。
|
|
8
|
-
*/
|
|
9
|
-
export interface DiyPresetVerdict {
|
|
10
|
-
readonly ok: boolean;
|
|
11
|
-
readonly rows: readonly string[];
|
|
12
|
-
readonly detail: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* 把 dsh 名册里那句 `broken` 原文拆成一项一个行名。
|
|
16
|
-
* @param detail - registry 给的原文,一行一项,形如 `tool-schedule (@deepseek-ai/dsh-tool-schedule): never started`。
|
|
17
|
-
* @returns 每行 `(` 之前那一段;空原文给空数组。
|
|
18
|
-
*/
|
|
19
|
-
export declare function brokenRowsOf(detail: string): readonly string[];
|
|
20
|
-
/**
|
|
21
|
-
* 从 preset 名册判 DIY 模式挂不挂得起来。
|
|
22
|
-
* @param presets - `agentPresets.list()` 的回值。
|
|
23
|
-
* @returns 名册还空着(preset 行还没登记完)给 `undefined` —— 那是"还不知道",不是故障;否则给结论。
|
|
24
|
-
*/
|
|
25
|
-
export declare function diyPresetVerdictOf(presets: readonly DshAgentPresetRow[]): DiyPresetVerdict | undefined;
|
|
26
|
-
/**
|
|
27
|
-
* 造一个读 preset 名册的探针:名册还没登记完就每 `everyMs` 重读,到 `deadlineMs` 还没读到就放弃。
|
|
28
|
-
* @param ctx - 宿主上下文(取 `agentPresets` 服务;那个服务不在时给一个恒回 `undefined` 的探针)。
|
|
29
|
-
* @param options - 两个时间旋钮(测试用):多久放弃、隔多久重读。
|
|
30
|
-
* @returns 探针:调一次读一轮,`undefined` 表示"这次没读到"。
|
|
31
|
-
*/
|
|
32
|
-
export declare function createDiyPresetProbe(ctx: DshHostContext, options?: {
|
|
33
|
-
deadlineMs?: number;
|
|
34
|
-
everyMs?: number;
|
|
35
|
-
}): () => Promise<DiyPresetVerdict | undefined>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export interface WorkshopModule {
|
|
2
|
-
readonly unit: string;
|
|
3
|
-
readonly name: string;
|
|
4
|
-
readonly description: string;
|
|
5
|
-
readonly dir: string;
|
|
6
|
-
readonly installed: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare function insideWorkshop(root: string, target: string): boolean;
|
|
9
|
-
export declare function workshopModules(packagesDir: string, installed?: readonly string[]): readonly WorkshopModule[];
|
|
10
|
-
export declare function readDesignOfModule(dir: string): unknown;
|
|
11
|
-
export interface WorkshopSync {
|
|
12
|
-
readonly state: 'ok' | 'syncing' | 'failed';
|
|
13
|
-
readonly version: string;
|
|
14
|
-
readonly at: string;
|
|
15
|
-
readonly reason?: string;
|
|
16
|
-
}
|
|
17
|
-
export declare function workshopSyncOf(workshopRoot: string): WorkshopSync | undefined;
|
|
18
|
-
export interface WorkshopToolchain {
|
|
19
|
-
readonly core: string;
|
|
20
|
-
readonly moduleTools: string;
|
|
21
|
-
readonly shared: string;
|
|
22
|
-
}
|
|
23
|
-
export declare function workshopToolchainOf(workshopRoot: string): WorkshopToolchain | undefined;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { DshHostContext } from '@dsh-workbench/shared';
|
|
2
|
-
import type { RouteHandler } from '@dsh-workbench/shared/host';
|
|
3
|
-
import type { DshPluginsSnapshot } from '../dsh-plugins.js';
|
|
4
|
-
export declare function readDshPlugins(ctx: DshHostContext): Promise<DshPluginsSnapshot>;
|
|
5
|
-
export declare function dshPluginsHandler(ctx: DshHostContext): RouteHandler;
|