@dsh-workbench/shared 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 +97 -0
- package/dist/api/blocker-table.d.ts +3 -3
- package/dist/api/blocker-table.js +47 -23
- package/dist/api/dsh.d.ts +19 -1
- package/dist/api/host-write.d.ts +0 -15
- package/dist/api/host-write.js +1 -35
- package/dist/api/workbench-client.js +2 -1
- package/dist/components/Activity.css +0 -1
- package/dist/components/ApprovalDetail.css +1 -2
- package/dist/components/ApprovalDetail.d.ts +1 -1
- package/dist/components/ApprovalPlan.css +0 -1
- package/dist/components/Card.css +0 -1
- package/dist/components/Card.d.ts +1 -1
- package/dist/components/CardBoundary.d.ts +1 -1
- package/dist/components/CardHead.css +0 -1
- package/dist/components/CardHead.d.ts +1 -1
- package/dist/components/ChoiceGroup.css +1 -2
- package/dist/components/ConfirmBar.d.ts +1 -1
- package/dist/components/ConfirmBar.js +1 -1
- package/dist/components/Form.css +1 -1
- package/dist/components/FormActions.js +1 -1
- package/dist/components/LongTaskRow.css +1 -2
- package/dist/components/LongTaskRow.d.ts +1 -1
- package/dist/components/LongTaskRow.js +1 -1
- package/dist/components/Note.css +0 -1
- package/dist/components/ResourceStates.css +0 -1
- package/dist/components/SettingsSection.css +0 -1
- package/dist/components/Spinner.css +0 -1
- package/dist/components/Stack.css +0 -1
- package/dist/components/StateBlock.css +0 -1
- package/dist/components/board-module.d.ts +3 -3
- package/dist/components/icons.d.ts +1 -7
- package/dist/components/icons.js +11 -16
- package/dist/config/constants.d.ts +2 -2
- package/dist/config/constants.js +2 -2
- package/dist/config/storage.d.ts +0 -4
- package/dist/config/storage.js +0 -11
- package/dist/contract/adapters.d.ts +10 -0
- package/dist/contract/cli.d.ts +3 -0
- package/dist/contract/data.d.ts +126 -0
- package/dist/{api → contract}/facts.d.ts +12 -3
- package/dist/{api → contract}/facts.js +19 -1
- package/dist/contract/needs.d.ts +132 -0
- package/dist/contract/needs.js +232 -0
- package/dist/contract/plugin-source.d.ts +1 -0
- package/dist/contract/plugin-source.js +1 -0
- package/dist/contract/protocol/bundle-install.d.ts +136 -0
- package/dist/contract/protocol/bundle-install.js +12 -0
- package/dist/contract/protocol/config-sync.d.ts +55 -0
- package/dist/contract/protocol/config-sync.js +2 -0
- package/dist/contract/protocol/diy.d.ts +4 -0
- package/dist/contract/protocol/diy.js +4 -0
- package/dist/contract/protocol/dsh-plugins.d.ts +11 -0
- package/dist/contract/protocol/dsh-plugins.js +1 -0
- package/dist/contract/protocol/long-tasks.d.ts +13 -0
- package/dist/contract/protocol/long-tasks.js +1 -0
- package/dist/contract/protocol/market-index.d.ts +195 -0
- package/dist/contract/protocol/market-index.js +7 -0
- package/dist/contract/protocol/platform.d.ts +44 -0
- package/dist/contract/protocol/platform.js +1 -0
- package/dist/contract/protocol/preflight-wake.d.ts +7 -0
- package/dist/contract/protocol/preflight-wake.js +1 -0
- package/dist/contract/protocol/profile-create.d.ts +30 -0
- package/dist/contract/protocol/profile-create.js +2 -0
- package/dist/contract/protocol/sidebar-edition.d.ts +14 -0
- package/dist/contract/protocol/sidebar-edition.js +2 -0
- package/dist/contract/protocol/unit-manifests.d.ts +6 -0
- package/dist/contract/protocol/unit-manifests.js +1 -0
- package/dist/contract/unit-board.d.ts +18 -0
- package/dist/contract/unit-board.js +1 -0
- package/dist/contract/unit-capability.d.ts +34 -0
- package/dist/contract/unit-capability.js +1 -0
- package/dist/{api → contract}/unit-declaration.d.ts +7 -5
- package/dist/{api → contract}/unit-declaration.js +19 -13
- package/dist/contract/unit.d.ts +57 -0
- package/dist/contract/unit.js +24 -0
- package/dist/contract/workbench-contract.d.ts +15 -0
- package/dist/contract/workbench-contract.js +1 -0
- package/dist/host/adapter-set.d.ts +26 -0
- package/dist/host/adapter-set.js +243 -0
- package/dist/host/adapter-types.d.ts +79 -0
- package/dist/host/adapter-types.js +23 -0
- package/dist/host/adapters.d.ts +22 -0
- package/dist/host/adapters.js +9 -0
- package/dist/host/browser.d.ts +3 -0
- package/dist/host/browser.js +3 -0
- package/dist/host/changelog.d.ts +21 -0
- package/dist/host/changelog.js +188 -0
- package/dist/host/channel-plugin.d.ts +15 -0
- package/dist/host/channel-plugin.js +42 -0
- package/dist/host/cli.d.ts +4 -0
- package/dist/host/cli.js +7 -0
- package/dist/host/command-name.d.ts +1 -0
- package/dist/host/command-name.js +14 -0
- package/dist/host/data-error.d.ts +13 -0
- package/dist/host/data-error.js +20 -0
- package/dist/host/data-root.js +3 -0
- package/dist/host/diy-debug.js +2 -1
- package/dist/host/diy-record.js +2 -1
- package/dist/host/facts.d.ts +1 -1
- package/dist/host/facts.js +3 -2
- package/dist/host/git.js +2 -2
- package/dist/host/http.js +1 -1
- package/dist/host/lib-capabilities.d.ts +22 -0
- package/dist/host/lib-capabilities.js +37 -0
- package/dist/host/lib-install.d.ts +9 -0
- package/dist/host/lib-install.js +10 -0
- package/dist/host/long-task.d.ts +1 -1
- package/dist/host/long-task.js +4 -3
- package/dist/host/market-index.d.ts +22 -0
- package/dist/host/market-index.js +420 -0
- package/dist/host/needs.d.ts +4 -0
- package/dist/host/needs.js +2 -0
- package/dist/host/patch.d.ts +9 -0
- package/dist/host/patch.js +78 -0
- package/dist/host/paths.d.ts +12 -0
- package/dist/host/paths.js +28 -0
- package/dist/host/platform.d.ts +14 -0
- package/dist/host/platform.js +40 -0
- package/dist/host/plugin-source.d.ts +8 -6
- package/dist/host/plugin-source.js +43 -33
- package/dist/host/plugin.d.ts +4 -0
- package/dist/host/plugin.js +39 -0
- package/dist/host/port-types.d.ts +191 -0
- package/dist/host/port-types.js +1 -0
- package/dist/host/preflight.d.ts +28 -0
- package/dist/host/preflight.js +1 -0
- package/dist/host/profile-port.d.ts +4 -0
- package/dist/host/profile-port.js +4 -0
- package/dist/host/provision.d.ts +2 -2
- package/dist/host/provision.js +5 -3
- package/dist/host/recipe-rules.d.ts +5 -0
- package/dist/host/recipe-rules.js +382 -0
- package/dist/host/recipe.d.ts +14 -0
- package/dist/host/recipe.js +283 -0
- package/dist/host/shell-text.d.ts +9 -2
- package/dist/host/shell-text.js +15 -3
- package/dist/host/shell.d.ts +2 -0
- package/dist/host/shell.js +7 -0
- package/dist/host/spec.d.ts +8 -0
- package/dist/host/spec.js +24 -0
- package/dist/host/supply-index.d.ts +34 -0
- package/dist/host/supply-index.js +202 -0
- package/dist/host/supply-port.d.ts +5 -0
- package/dist/host/supply-port.js +39 -0
- package/dist/host/time.d.ts +12 -0
- package/dist/host/time.js +19 -0
- package/dist/host/tokens.d.ts +26 -0
- package/dist/host/tokens.js +154 -0
- package/dist/host/tool-approval.d.ts +12 -0
- package/dist/host/tool-approval.js +4 -0
- package/dist/host/tool-kit.js +1 -1
- package/dist/host/unit-face.d.ts +5 -4
- package/dist/host/version-range.d.ts +2 -0
- package/dist/host/version-range.js +73 -0
- package/dist/host/version.d.ts +3 -0
- package/dist/host/version.js +29 -0
- package/dist/host.d.ts +47 -16
- package/dist/host.js +47 -16
- package/dist/i18n/en.js +259 -86
- package/dist/i18n/index.d.ts +333 -88
- package/dist/i18n/merge.js +1 -1
- package/dist/i18n/need-text.d.ts +26 -0
- package/dist/i18n/need-text.js +26 -0
- package/dist/i18n/settings.d.ts +70 -0
- package/dist/i18n/settings.js +136 -0
- package/dist/i18n/zh.d.ts +332 -87
- package/dist/i18n/zh.js +260 -87
- package/dist/index.d.ts +24 -8
- package/dist/index.js +24 -8
- package/dist/lib/blocker-action.d.ts +0 -15
- package/dist/lib/blocker-action.js +1 -25
- package/dist/{api → lib}/dsh-client.d.ts +12 -1
- package/dist/lib/dsh-client.js +1 -0
- package/dist/lib/market-index.d.ts +7 -0
- package/dist/lib/market-index.js +25 -0
- package/dist/lib/react-types.d.ts +5 -0
- package/dist/lib/react-types.js +1 -0
- package/dist/lib/react.d.ts +1 -40
- package/dist/lib/react.js +0 -36
- package/dist/lib/ui.js +3 -9
- package/dist/testing/data.d.ts +13 -0
- package/dist/testing/data.js +46 -0
- package/dist/testing/declaration.d.ts +1 -1
- package/dist/testing/declaration.js +1 -1
- package/dist/testing/host-fakes.d.ts +0 -13
- package/dist/testing/host-fakes.js +0 -24
- package/dist/testing/needs.d.ts +16 -0
- package/dist/testing/needs.js +46 -0
- package/dist/testing.d.ts +2 -0
- package/dist/testing.js +2 -0
- package/package.json +18 -2
- package/src/api/__tests__/blocker-table.test.ts +135 -86
- package/src/api/blocker-table.ts +52 -26
- package/src/api/dsh.ts +17 -1
- package/src/api/host-write.ts +0 -43
- package/src/api/workbench-client.test.ts +2 -2
- package/src/api/workbench-client.ts +2 -1
- package/src/components/Activity.css +0 -1
- package/src/components/ApprovalDetail.css +1 -2
- package/src/components/ApprovalDetail.tsx +1 -1
- package/src/components/ApprovalPlan.css +0 -1
- package/src/components/Card.css +0 -1
- package/src/components/Card.tsx +1 -1
- package/src/components/CardAnchor.test.tsx +1 -1
- package/src/components/CardBoundary.tsx +1 -1
- package/src/components/CardHead.css +0 -1
- package/src/components/CardHead.tsx +1 -1
- package/src/components/ChoiceGroup.css +1 -2
- package/src/components/ConfirmBar.tsx +1 -1
- package/src/components/Form.css +1 -1
- package/src/components/Form.tsx +1 -1
- package/src/components/FormActions.tsx +1 -1
- package/src/components/LongTaskRow.css +1 -2
- package/src/components/LongTaskRow.tsx +1 -1
- package/src/components/Note.css +0 -1
- package/src/components/ResourceStates.css +0 -1
- package/src/components/SelectFieldNodes.tsx +0 -1
- package/src/components/SettingsSection.css +0 -1
- package/src/components/Spinner.css +0 -1
- package/src/components/Stack.css +0 -1
- package/src/components/StateBlock.css +0 -1
- package/src/components/__tests__/long-task-row.test.ts +1 -1
- package/src/components/board-module.ts +3 -3
- package/src/components/icons.tsx +16 -24
- package/src/config/constants.ts +2 -2
- package/src/config/storage.test.ts +1 -25
- package/src/config/storage.ts +0 -12
- package/src/{api → contract}/__tests__/facts.test.ts +73 -25
- package/src/{api → contract}/__tests__/long-task.test.ts +3 -3
- package/src/contract/__tests__/needs.test.ts +74 -0
- package/src/{host → contract}/__tests__/unit-declaration.test.ts +1 -1
- package/src/contract/__tests__/unit.test.ts +43 -0
- package/src/contract/adapters.ts +9 -0
- package/src/contract/cli.ts +3 -0
- package/src/contract/data.ts +145 -0
- package/src/{api → contract}/facts.ts +34 -4
- package/src/contract/needs.ts +331 -0
- package/src/contract/plugin-source.ts +1 -0
- package/src/contract/protocol/bundle-install.ts +198 -0
- package/src/contract/protocol/config-sync.ts +65 -0
- package/src/contract/protocol/diy.ts +4 -0
- package/src/contract/protocol/dsh-plugins.ts +13 -0
- package/src/contract/protocol/long-tasks.ts +16 -0
- package/src/contract/protocol/market-index.ts +246 -0
- package/src/contract/protocol/platform.ts +47 -0
- package/src/contract/protocol/preflight-wake.ts +17 -0
- package/src/contract/protocol/profile-create.ts +36 -0
- package/src/contract/protocol/sidebar-edition.ts +19 -0
- package/src/contract/protocol/unit-manifests.ts +8 -0
- package/src/contract/unit-board.ts +23 -0
- package/src/contract/unit-capability.ts +37 -0
- package/src/{host → contract}/unit-declaration.ts +22 -18
- package/src/contract/unit.ts +76 -0
- package/src/contract/workbench-contract.ts +30 -0
- package/src/host/__tests__/adapter-set.test.ts +228 -0
- package/src/host/__tests__/adapters.test.ts +27 -0
- package/src/host/__tests__/changelog.test.ts +102 -0
- package/src/host/__tests__/command-name.test.ts +16 -0
- package/src/host/__tests__/diy-record.test.ts +3 -3
- package/src/host/__tests__/facts.test.ts +5 -5
- package/src/host/__tests__/long-task.test.ts +1 -1
- package/src/host/__tests__/market-index.test.ts +179 -0
- package/src/host/__tests__/plugin-ledger.test.ts +10 -10
- package/src/host/__tests__/provision.test.ts +7 -6
- package/src/host/__tests__/shell-text.test.ts +16 -1
- package/src/host/__tests__/supply-index.test.ts +137 -0
- package/src/host/__tests__/tokens.test.ts +110 -0
- package/src/host/__tests__/version-range.test.ts +21 -0
- package/src/host/adapter-set.ts +298 -0
- package/src/host/adapter-types.ts +105 -0
- package/src/host/adapters.ts +44 -0
- package/src/host/browser.ts +3 -0
- package/src/host/changelog.ts +212 -0
- package/src/host/channel-plugin.ts +55 -0
- package/src/host/cli.ts +11 -0
- package/src/host/command-name.ts +15 -0
- package/src/host/data-error.ts +21 -0
- package/src/host/data-root.ts +2 -0
- package/src/host/diy-debug.ts +2 -1
- package/src/host/diy-record.ts +2 -1
- package/src/host/facts.ts +4 -3
- package/src/host/git.ts +2 -2
- package/src/host/http.ts +1 -1
- package/src/host/lib-capabilities.ts +52 -0
- package/src/host/lib-install.ts +18 -0
- package/src/host/long-task.ts +4 -3
- package/src/host/market-index.ts +413 -0
- package/src/host/needs.ts +6 -0
- package/src/host/patch.ts +93 -0
- package/src/host/paths.ts +37 -0
- package/src/host/platform.ts +48 -0
- package/src/host/plugin-source.ts +48 -56
- package/src/host/plugin.ts +39 -0
- package/src/host/port-types.ts +222 -0
- package/src/host/preflight.ts +31 -0
- package/src/host/profile-port.ts +9 -0
- package/src/host/provision.ts +7 -4
- package/src/host/recipe-rules.ts +330 -0
- package/src/host/recipe.test.ts +334 -0
- package/src/host/recipe.ts +323 -0
- package/src/host/shell-text.ts +15 -3
- package/src/host/shell.ts +9 -0
- package/src/host/spec.ts +32 -0
- package/src/host/supply-index.ts +256 -0
- package/src/host/supply-port.ts +45 -0
- package/src/host/time.ts +22 -0
- package/src/host/tokens.ts +186 -0
- package/src/host/tool-approval.ts +17 -0
- package/src/host/tool-kit.ts +1 -1
- package/src/host/unit-face.ts +5 -4
- package/src/host/version-range.ts +71 -0
- package/src/host/version.ts +30 -0
- package/src/host.ts +47 -16
- package/src/i18n/en.ts +261 -86
- package/src/i18n/merge.test.ts +6 -6
- package/src/i18n/merge.ts +1 -1
- package/src/i18n/need-text.ts +27 -0
- package/src/i18n/settings.ts +141 -0
- package/src/i18n/zh.ts +263 -87
- package/src/index.ts +24 -8
- package/src/lib/blocker-action.ts +0 -28
- package/src/{api → lib}/dsh-client.ts +16 -2
- package/src/lib/market-index.ts +36 -0
- package/src/lib/react-types.ts +5 -0
- package/src/lib/react.ts +1 -40
- package/src/lib/text.test.ts +2 -2
- package/src/lib/ui.test.ts +6 -5
- package/src/lib/ui.ts +3 -9
- package/src/testing/__tests__/declaration.test.ts +1 -1
- package/src/testing/data.ts +66 -0
- package/src/testing/declaration.ts +2 -2
- package/src/testing/host-fakes.ts +0 -38
- package/src/testing/needs.ts +80 -0
- package/src/testing.ts +2 -0
- package/dist/api/unit-board.d.ts +0 -39
- package/dist/api/unit-board.js +0 -45
- package/dist/api/unit.d.ts +0 -85
- package/dist/api/unit.js +0 -8
- package/dist/api/workbench-contract.d.ts +0 -44
- package/dist/components/MockStrip.css +0 -39
- package/dist/components/MockStrip.d.ts +0 -15
- package/dist/components/MockStrip.js +0 -8
- package/dist/components/SaveBar.css +0 -7
- package/dist/host/browser-find.d.ts +0 -38
- package/dist/host/browser-find.js +0 -242
- package/dist/host/browser-read.d.ts +0 -28
- package/dist/host/browser-read.js +0 -243
- package/dist/host/opencli-runtime.d.ts +0 -25
- package/dist/host/opencli-runtime.js +0 -56
- package/dist/host/opencli-window.d.ts +0 -2
- package/dist/host/opencli-window.js +0 -8
- package/dist/host/opencli.d.ts +0 -37
- package/dist/host/opencli.js +0 -155
- package/dist/host/unit-declaration.d.ts +0 -65
- package/dist/host/unit-declaration.js +0 -213
- package/dist/host/unit-libs.d.ts +0 -37
- package/dist/lib/diy-debug.d.ts +0 -80
- package/dist/lib/diy-debug.js +0 -88
- package/dist/lib/diy-record.d.ts +0 -135
- package/dist/lib/diy-record.js +0 -162
- package/dist/lib/lint-probe.d.ts +0 -1
- package/dist/lib/lint-probe.js +0 -6
- package/dist/lib/panel-state.d.ts +0 -120
- package/dist/lib/panel-state.js +0 -176
- package/src/api/__tests__/host-write.test.ts +0 -75
- package/src/api/__tests__/unit-board.test.ts +0 -76
- package/src/api/__tests__/unit.test.ts +0 -38
- package/src/api/unit-board.ts +0 -69
- package/src/api/unit.ts +0 -93
- package/src/api/workbench-contract.ts +0 -59
- package/src/host/__tests__/browser-find.test.ts +0 -330
- package/src/host/__tests__/browser-read.test.ts +0 -228
- package/src/host/__tests__/opencli-runtime.test.ts +0 -46
- package/src/host/browser-find.ts +0 -311
- package/src/host/browser-read.ts +0 -311
- package/src/host/opencli-runtime.ts +0 -79
- package/src/host/opencli-window.ts +0 -11
- package/src/host/opencli.ts +0 -213
- package/src/host/unit-libs.ts +0 -41
- package/src/lib/blocker-action.test.ts +0 -40
- /package/dist/{api/blocker.js → contract/adapters.js} +0 -0
- /package/dist/{api → contract}/blocker.d.ts +0 -0
- /package/dist/{api/dsh-client.js → contract/blocker.js} +0 -0
- /package/dist/{api/workbench-contract.js → contract/cli.js} +0 -0
- /package/dist/{host/unit-libs.js → contract/data.js} +0 -0
- /package/dist/{api → contract}/long-task.d.ts +0 -0
- /package/dist/{api → contract}/long-task.js +0 -0
- /package/src/{api → contract}/blocker.ts +0 -0
- /package/src/{api → contract}/long-task.ts +0 -0
|
@@ -18,18 +18,3 @@ export interface BlockerLabelState {
|
|
|
18
18
|
readonly running: string | null;
|
|
19
19
|
readonly copied: string | null;
|
|
20
20
|
}
|
|
21
|
-
/**
|
|
22
|
-
* 这颗钮此刻该不该按成等待态:这一轮忙还没收,或有一支正在跑。
|
|
23
|
-
* @param busy - 这一轮忙是不是还在。
|
|
24
|
-
* @param running - 正在跑的那一支的 label;没有就给 `null`。
|
|
25
|
-
* @returns 该等待给 `true`,否则 `false`。
|
|
26
|
-
*/
|
|
27
|
-
export declare function blockerPending(busy: boolean, running: string | null): boolean;
|
|
28
|
-
/**
|
|
29
|
-
* 这颗钮此刻该显示什么字:正在重试说「重试中…」,正在跑的那一支说「修复中…」,刚复制过的说「已复制」,其余原样。
|
|
30
|
-
* @param action - 这颗钮的形状(行为 + 平时文案)。
|
|
31
|
-
* @param state - 此刻的运行态。
|
|
32
|
-
* @param t - i18n 取词函数。
|
|
33
|
-
* @returns 要显示的文案;三种临时态都不成立时就是 `action.label`。
|
|
34
|
-
*/
|
|
35
|
-
export declare function blockerActionLabel(action: BlockerActionShape, state: BlockerLabelState, t: BlockerLabelTranslate): string;
|
|
@@ -1,25 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* 这颗钮此刻该不该按成等待态:这一轮忙还没收,或有一支正在跑。
|
|
3
|
-
* @param busy - 这一轮忙是不是还在。
|
|
4
|
-
* @param running - 正在跑的那一支的 label;没有就给 `null`。
|
|
5
|
-
* @returns 该等待给 `true`,否则 `false`。
|
|
6
|
-
*/
|
|
7
|
-
export function blockerPending(busy, running) {
|
|
8
|
-
return busy || running !== null;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* 这颗钮此刻该显示什么字:正在重试说「重试中…」,正在跑的那一支说「修复中…」,刚复制过的说「已复制」,其余原样。
|
|
12
|
-
* @param action - 这颗钮的形状(行为 + 平时文案)。
|
|
13
|
-
* @param state - 此刻的运行态。
|
|
14
|
-
* @param t - i18n 取词函数。
|
|
15
|
-
* @returns 要显示的文案;三种临时态都不成立时就是 `action.label`。
|
|
16
|
-
*/
|
|
17
|
-
export function blockerActionLabel(action, state, t) {
|
|
18
|
-
if (action.kind === 'retry' && state.retrying)
|
|
19
|
-
return t('blocker.retry.running');
|
|
20
|
-
if (state.running === action.label)
|
|
21
|
-
return t('blocker.fix.running');
|
|
22
|
-
if (action.kind === 'copy' && state.copied === action.text)
|
|
23
|
-
return t('env.copied');
|
|
24
|
-
return action.label;
|
|
25
|
-
}
|
|
1
|
+
export {};
|
|
@@ -20,6 +20,7 @@ export interface WorkspaceSnapshot {
|
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* 会话一行的来源(标题、空会话、在跑与否、被谁留住);retainedBy 按视图名记留住它的份数,mainView 大于 0 即正被主视图占着。
|
|
23
|
+
* projectionValues 是 dsh 的会话投影,外壳只读 `agentPreset` 一位(没选过模式时没有这一位)。
|
|
23
24
|
*/
|
|
24
25
|
export interface SessionSummary {
|
|
25
26
|
readonly id: string;
|
|
@@ -29,6 +30,7 @@ export interface SessionSummary {
|
|
|
29
30
|
readonly updatedAt: number;
|
|
30
31
|
readonly origin?: string;
|
|
31
32
|
readonly retainedBy: Readonly<Partial<Record<string, number>>>;
|
|
33
|
+
readonly projectionValues?: Readonly<Record<string, unknown>>;
|
|
32
34
|
}
|
|
33
35
|
/**
|
|
34
36
|
* 会话投影里的一条子代理目录项;外壳只认 id,其余字段随 dsh 变。
|
|
@@ -245,6 +247,7 @@ export interface DshConversationService {
|
|
|
245
247
|
export interface DshSessionsService {
|
|
246
248
|
readonly list: {
|
|
247
249
|
getSnapshot(): SessionsSnapshot;
|
|
250
|
+
subscribe?(listener: () => void): () => void;
|
|
248
251
|
};
|
|
249
252
|
scope(sessionId: string): unknown | undefined;
|
|
250
253
|
create?(request: {
|
|
@@ -284,10 +287,18 @@ export interface DshSessionsRemote {
|
|
|
284
287
|
}>;
|
|
285
288
|
}
|
|
286
289
|
/**
|
|
287
|
-
*
|
|
290
|
+
* remote.agentPresets 写口:给还没开跑的会话挑模式(同一件事就是模式选择器点一下);
|
|
291
|
+
* 会话发出第一条消息后 dsh 会拒(模式已锁)。
|
|
292
|
+
*/
|
|
293
|
+
export interface DshAgentPresetsRemote {
|
|
294
|
+
select(sessionId: string, presetId: string): Promise<unknown>;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* dsh 客户端的远端写口集合;会话与模式两家。
|
|
288
298
|
*/
|
|
289
299
|
export interface DshClientRemote {
|
|
290
300
|
readonly sessions: DshSessionsRemote;
|
|
301
|
+
readonly agentPresets?: DshAgentPresetsRemote;
|
|
291
302
|
}
|
|
292
303
|
/**
|
|
293
304
|
* 客户端插件拿到的上下文:所有服务从它取,effect 注册的清理随插件卸载跑。
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MarketIndexSource, MarketLocalizedText } from '../contract/protocol/market-index.js';
|
|
2
|
+
export declare function marketBranchOk(value: string): boolean;
|
|
3
|
+
export declare function marketText(value: MarketLocalizedText | undefined, locale: string): string;
|
|
4
|
+
export declare function marketInstallTarget(name: string, version: string, source: MarketIndexSource): {
|
|
5
|
+
readonly spec: string;
|
|
6
|
+
readonly registry?: string;
|
|
7
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const BRANCH = /^[A-Za-z0-9][A-Za-z0-9._/-]*$/;
|
|
2
|
+
export function marketBranchOk(value) {
|
|
3
|
+
const branch = value.trim();
|
|
4
|
+
return (BRANCH.test(branch) &&
|
|
5
|
+
!branch.includes('..') &&
|
|
6
|
+
!branch.endsWith('/') &&
|
|
7
|
+
!branch.endsWith('.') &&
|
|
8
|
+
!branch.includes('@{'));
|
|
9
|
+
}
|
|
10
|
+
export function marketText(value, locale) {
|
|
11
|
+
if (value === undefined)
|
|
12
|
+
return '';
|
|
13
|
+
const zh = value.zh ?? '';
|
|
14
|
+
const en = value.en ?? '';
|
|
15
|
+
return locale.toLowerCase().startsWith('zh') ? zh || en : en || zh;
|
|
16
|
+
}
|
|
17
|
+
export function marketInstallTarget(name, version, source) {
|
|
18
|
+
if (source.type === 'npm') {
|
|
19
|
+
const registry = (source.registry ?? '').trim();
|
|
20
|
+
return { spec: `${name}@${version}`, ...(registry === '' ? {} : { registry }) };
|
|
21
|
+
}
|
|
22
|
+
const base = `git+${source.url.trim().replace(/^git\+/, '')}#${source.commit}`;
|
|
23
|
+
const path = (source.path ?? '').trim().replace(/^\/+/, '');
|
|
24
|
+
return { spec: path === '' ? base : `${base}&path:/${path}` };
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/lib/react.d.ts
CHANGED
|
@@ -1,53 +1,14 @@
|
|
|
1
1
|
import type * as ReactTypes from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* React 的 `createElement` 换个短名字再导出 —— 这套代码用 `h(...)` 写元素。
|
|
4
|
-
*/
|
|
5
2
|
export declare const h: typeof ReactTypes.createElement;
|
|
6
|
-
/**
|
|
7
|
-
* React 的 `Fragment` 原样再导出 —— 模块从这里拿,就不必自己直接依赖 react。
|
|
8
|
-
*/
|
|
9
3
|
export declare const Fragment: ReactTypes.ExoticComponent<ReactTypes.FragmentProps>;
|
|
10
|
-
/**
|
|
11
|
-
* React 的 `Component` 原样再导出 —— 模块从这里拿,就不必自己直接依赖 react。
|
|
12
|
-
*/
|
|
13
4
|
export declare const Component: typeof ReactTypes.Component;
|
|
14
|
-
/**
|
|
15
|
-
* React 的 `createContext` 原样再导出 —— 模块从这里拿,就不必自己直接依赖 react。
|
|
16
|
-
*/
|
|
17
5
|
export declare const createContext: typeof ReactTypes.createContext;
|
|
18
|
-
/**
|
|
19
|
-
* React 的 `useContext` 原样再导出 —— 模块从这里拿,就不必自己直接依赖 react。
|
|
20
|
-
*/
|
|
21
6
|
export declare const useContext: typeof ReactTypes.useContext;
|
|
22
|
-
/**
|
|
23
|
-
* React 的 `useState` 原样再导出 —— 模块从这里拿,就不必自己直接依赖 react。
|
|
24
|
-
*/
|
|
25
7
|
export declare const useState: typeof ReactTypes.useState;
|
|
26
|
-
/**
|
|
27
|
-
* React 的 `useEffect` 原样再导出 —— 模块从这里拿,就不必自己直接依赖 react。
|
|
28
|
-
*/
|
|
29
8
|
export declare const useEffect: typeof ReactTypes.useEffect;
|
|
30
|
-
/**
|
|
31
|
-
* React 的 `useLayoutEffect` 原样再导出 —— 模块从这里拿,就不必自己直接依赖 react。
|
|
32
|
-
*/
|
|
33
9
|
export declare const useLayoutEffect: typeof ReactTypes.useLayoutEffect;
|
|
34
|
-
/**
|
|
35
|
-
* React 的 `useMemo` 原样再导出 —— 模块从这里拿,就不必自己直接依赖 react。
|
|
36
|
-
*/
|
|
37
10
|
export declare const useMemo: typeof ReactTypes.useMemo;
|
|
38
|
-
/**
|
|
39
|
-
* React 的 `useCallback` 原样再导出 —— 模块从这里拿,就不必自己直接依赖 react。
|
|
40
|
-
*/
|
|
41
11
|
export declare const useCallback: typeof ReactTypes.useCallback;
|
|
42
|
-
/**
|
|
43
|
-
* React 的 `useRef` 原样再导出 —— 模块从这里拿,就不必自己直接依赖 react。
|
|
44
|
-
*/
|
|
45
12
|
export declare const useRef: typeof ReactTypes.useRef;
|
|
46
|
-
/**
|
|
47
|
-
* React 的 `useSyncExternalStore` 原样再导出 —— 模块从这里拿,就不必自己直接依赖 react。
|
|
48
|
-
*/
|
|
49
13
|
export declare const useSyncExternalStore: typeof ReactTypes.useSyncExternalStore;
|
|
50
|
-
|
|
51
|
-
* 从 react 借来的三个类型(`ReactNode` / `CSSProperties` / `ChangeEvent`)—— 模块从这里拿,就不必自己直接依赖 react。
|
|
52
|
-
*/
|
|
53
|
-
export type { ReactNode, CSSProperties, ChangeEvent } from 'react';
|
|
14
|
+
export type { ReactNode, CSSProperties, ChangeEvent } from './react-types.js';
|
package/dist/lib/react.js
CHANGED
|
@@ -1,49 +1,13 @@
|
|
|
1
1
|
const react = require('react');
|
|
2
|
-
/**
|
|
3
|
-
* React 的 `createElement` 换个短名字再导出 —— 这套代码用 `h(...)` 写元素。
|
|
4
|
-
*/
|
|
5
2
|
export const h = react.createElement;
|
|
6
|
-
/**
|
|
7
|
-
* React 的 `Fragment` 原样再导出 —— 模块从这里拿,就不必自己直接依赖 react。
|
|
8
|
-
*/
|
|
9
3
|
export const Fragment = react.Fragment;
|
|
10
|
-
/**
|
|
11
|
-
* React 的 `Component` 原样再导出 —— 模块从这里拿,就不必自己直接依赖 react。
|
|
12
|
-
*/
|
|
13
4
|
export const Component = react.Component;
|
|
14
|
-
/**
|
|
15
|
-
* React 的 `createContext` 原样再导出 —— 模块从这里拿,就不必自己直接依赖 react。
|
|
16
|
-
*/
|
|
17
5
|
export const createContext = react.createContext;
|
|
18
|
-
/**
|
|
19
|
-
* React 的 `useContext` 原样再导出 —— 模块从这里拿,就不必自己直接依赖 react。
|
|
20
|
-
*/
|
|
21
6
|
export const useContext = react.useContext;
|
|
22
|
-
/**
|
|
23
|
-
* React 的 `useState` 原样再导出 —— 模块从这里拿,就不必自己直接依赖 react。
|
|
24
|
-
*/
|
|
25
7
|
export const useState = react.useState;
|
|
26
|
-
/**
|
|
27
|
-
* React 的 `useEffect` 原样再导出 —— 模块从这里拿,就不必自己直接依赖 react。
|
|
28
|
-
*/
|
|
29
8
|
export const useEffect = react.useEffect;
|
|
30
|
-
/**
|
|
31
|
-
* React 的 `useLayoutEffect` 原样再导出 —— 模块从这里拿,就不必自己直接依赖 react。
|
|
32
|
-
*/
|
|
33
9
|
export const useLayoutEffect = react.useLayoutEffect;
|
|
34
|
-
/**
|
|
35
|
-
* React 的 `useMemo` 原样再导出 —— 模块从这里拿,就不必自己直接依赖 react。
|
|
36
|
-
*/
|
|
37
10
|
export const useMemo = react.useMemo;
|
|
38
|
-
/**
|
|
39
|
-
* React 的 `useCallback` 原样再导出 —— 模块从这里拿,就不必自己直接依赖 react。
|
|
40
|
-
*/
|
|
41
11
|
export const useCallback = react.useCallback;
|
|
42
|
-
/**
|
|
43
|
-
* React 的 `useRef` 原样再导出 —— 模块从这里拿,就不必自己直接依赖 react。
|
|
44
|
-
*/
|
|
45
12
|
export const useRef = react.useRef;
|
|
46
|
-
/**
|
|
47
|
-
* React 的 `useSyncExternalStore` 原样再导出 —— 模块从这里拿,就不必自己直接依赖 react。
|
|
48
|
-
*/
|
|
49
13
|
export const useSyncExternalStore = react.useSyncExternalStore;
|
package/dist/lib/ui.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
1
2
|
/**
|
|
2
3
|
* 拼类名:只留真值、用空格连接(`false` / `null` / `undefined` / 空串都丢掉)。
|
|
3
4
|
* @param parts - 若干类名或条件值。
|
|
@@ -79,14 +80,7 @@ export function relativeTime(epochMs, t) {
|
|
|
79
80
|
return t('time.hours', { n: Math.floor(diff / (60 * MINUTE)) });
|
|
80
81
|
if (diff < 7 * 24 * 60 * MINUTE)
|
|
81
82
|
return t('time.days', { n: Math.floor(diff / (24 * 60 * MINUTE)) });
|
|
82
|
-
return
|
|
83
|
-
year: 'numeric',
|
|
84
|
-
month: 'numeric',
|
|
85
|
-
day: 'numeric',
|
|
86
|
-
hour: '2-digit',
|
|
87
|
-
minute: '2-digit',
|
|
88
|
-
second: '2-digit',
|
|
89
|
-
});
|
|
83
|
+
return dayjs(epochMs).format('YYYY/M/D HH:mm:ss');
|
|
90
84
|
}
|
|
91
85
|
/**
|
|
92
86
|
* 把 `/Users/<用户名>/…` 缩成 `~/…`,免得会话行里全是一样的长前缀。
|
|
@@ -109,5 +103,5 @@ export function parseLocalTimestamp(text) {
|
|
|
109
103
|
const raw = String(text ?? '').trim();
|
|
110
104
|
if (!LOCAL_TIMESTAMP.test(raw))
|
|
111
105
|
return Number.NaN;
|
|
112
|
-
return
|
|
106
|
+
return dayjs(raw.replace(' ', 'T')).valueOf();
|
|
113
107
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CallOverrides, DataReader, DataRequest, RecipeCalls, RequestRecipe } from '../contract/data.js';
|
|
2
|
+
export interface RecipeCall {
|
|
3
|
+
readonly kind: 'request' | 'submit' | 'many';
|
|
4
|
+
readonly recipe: RequestRecipe;
|
|
5
|
+
readonly overrides?: CallOverrides | undefined;
|
|
6
|
+
readonly calls?: RecipeCalls | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare function createNoopDataReader(): DataReader;
|
|
9
|
+
export declare function createFakeDataReader(reply?: unknown | ((request: DataRequest, index: number) => unknown), recipeReply?: unknown | ((call: RecipeCall, index: number) => unknown)): DataReader & {
|
|
10
|
+
readonly requests: readonly DataRequest[];
|
|
11
|
+
readonly calls: readonly RecipeCall[];
|
|
12
|
+
};
|
|
13
|
+
export declare const fakeDataReader: typeof createFakeDataReader;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const NO_DATA = {
|
|
2
|
+
ok: false,
|
|
3
|
+
error: { code: 'invalid-request', message: '测试没有注入 DataReader' },
|
|
4
|
+
};
|
|
5
|
+
function filled(names, value) {
|
|
6
|
+
const out = {};
|
|
7
|
+
for (const name of names)
|
|
8
|
+
out[name] = value;
|
|
9
|
+
return out;
|
|
10
|
+
}
|
|
11
|
+
export function createNoopDataReader() {
|
|
12
|
+
return {
|
|
13
|
+
read: async () => NO_DATA,
|
|
14
|
+
request: async () => NO_DATA,
|
|
15
|
+
requestMany: async (_recipe, calls) => filled(Object.keys(calls), NO_DATA),
|
|
16
|
+
submit: async () => NO_DATA,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export function createFakeDataReader(reply = { ok: true, data: null }, recipeReply = { ok: true, data: null }) {
|
|
20
|
+
const requests = [];
|
|
21
|
+
const calls = [];
|
|
22
|
+
const answer = (call) => typeof recipeReply === 'function' ? recipeReply(call, calls.length - 1) : recipeReply;
|
|
23
|
+
const reader = {
|
|
24
|
+
async read(request) {
|
|
25
|
+
requests.push(request);
|
|
26
|
+
return typeof reply === 'function' ? reply(request, requests.length - 1) : reply;
|
|
27
|
+
},
|
|
28
|
+
async request(recipe, overrides) {
|
|
29
|
+
calls.push({ kind: 'request', recipe, overrides });
|
|
30
|
+
return answer(calls[calls.length - 1]);
|
|
31
|
+
},
|
|
32
|
+
async requestMany(recipe, plan) {
|
|
33
|
+
calls.push({ kind: 'many', recipe, calls: plan });
|
|
34
|
+
const answered = answer(calls[calls.length - 1]);
|
|
35
|
+
return typeof answered === 'object' && answered !== null && !('ok' in answered)
|
|
36
|
+
? answered
|
|
37
|
+
: filled(Object.keys(plan), answered);
|
|
38
|
+
},
|
|
39
|
+
async submit(recipe, overrides) {
|
|
40
|
+
calls.push({ kind: 'submit', recipe, overrides });
|
|
41
|
+
return answer(calls[calls.length - 1]);
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
return Object.assign(reader, { requests, calls });
|
|
45
|
+
}
|
|
46
|
+
export const fakeDataReader = createFakeDataReader;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { UnitManifest } from '../
|
|
1
|
+
import type { UnitManifest } from '../contract/unit.js';
|
|
2
2
|
export declare function declarationOfPackage(pkg: string, packageJson: URL | string): UnitManifest;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
|
-
import { readDeclaration } from '../
|
|
3
|
+
import { readDeclaration } from '../contract/unit-declaration.js';
|
|
4
4
|
export function declarationOfPackage(pkg, packageJson) {
|
|
5
5
|
const at = typeof packageJson === 'string' ? packageJson : fileURLToPath(packageJson);
|
|
6
6
|
let parsed;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { DshShell } from '../api/dsh.js';
|
|
2
|
-
import type { Opencli } from '../host/opencli.js';
|
|
3
2
|
export interface ShellCall {
|
|
4
3
|
command: string;
|
|
5
4
|
workdir?: string;
|
|
@@ -21,18 +20,6 @@ export declare function createFakeShell(replies?: ShellReply[] | ((call: ShellCa
|
|
|
21
20
|
peak: () => number;
|
|
22
21
|
commands: () => string[];
|
|
23
22
|
};
|
|
24
|
-
export interface OpencliCall {
|
|
25
|
-
args: readonly string[];
|
|
26
|
-
key?: string;
|
|
27
|
-
workdir?: string;
|
|
28
|
-
session?: string;
|
|
29
|
-
refresh?: boolean;
|
|
30
|
-
}
|
|
31
|
-
export declare function createFakeOpencli(replies?: Array<unknown | Error> | ((call: OpencliCall, index: number) => unknown | Error)): {
|
|
32
|
-
opencli: Opencli;
|
|
33
|
-
calls: OpencliCall[];
|
|
34
|
-
keys: () => (string | undefined)[];
|
|
35
|
-
};
|
|
36
23
|
export declare function createFakeLogger(): {
|
|
37
24
|
logger: {
|
|
38
25
|
info: () => void;
|
|
@@ -39,30 +39,6 @@ export function createFakeShell(replies = []) {
|
|
|
39
39
|
commands: () => calls.map((call) => call.command),
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
export function createFakeOpencli(replies = []) {
|
|
43
|
-
const calls = [];
|
|
44
|
-
const opencli = {
|
|
45
|
-
async json(args, options = {}) {
|
|
46
|
-
const call = {
|
|
47
|
-
args,
|
|
48
|
-
...(options.key === undefined ? {} : { key: options.key }),
|
|
49
|
-
...(options.workdir === undefined ? {} : { workdir: options.workdir }),
|
|
50
|
-
...(options.session === undefined ? {} : { session: options.session }),
|
|
51
|
-
};
|
|
52
|
-
calls.push(call);
|
|
53
|
-
const index = calls.length - 1;
|
|
54
|
-
const reply = typeof replies === 'function' ? replies(call, index) : (replies[index] ?? []);
|
|
55
|
-
if (reply instanceof Error)
|
|
56
|
-
throw reply;
|
|
57
|
-
return { value: reply, at: Date.now() };
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
return {
|
|
61
|
-
opencli,
|
|
62
|
-
calls,
|
|
63
|
-
keys: () => calls.map((call) => call.key),
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
42
|
export function createFakeLogger() {
|
|
67
43
|
const warnings = [];
|
|
68
44
|
return {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { BinNeed, EnvNeed, ExtensionNeed, LibNeed, Need, SupplySource } from '../contract/needs.js';
|
|
2
|
+
import type { NeedState } from '../contract/unit-capability.js';
|
|
3
|
+
import type { UnitCapability } from '../contract/unit-capability.js';
|
|
4
|
+
import type { UnitManifest } from '../contract/unit.js';
|
|
5
|
+
export declare const fakeNpmSource: SupplySource;
|
|
6
|
+
export declare function extensionNeedOf(name: string, extra?: Partial<ExtensionNeed>): ExtensionNeed;
|
|
7
|
+
export declare function libNeedOf(name: string, extra?: Partial<LibNeed>): LibNeed;
|
|
8
|
+
export declare function binNeedOf(name: string, extra?: Partial<BinNeed>): BinNeed;
|
|
9
|
+
export declare function envNeedOf(name: string, extra?: Partial<EnvNeed>): EnvNeed;
|
|
10
|
+
export declare function manifestOf(options?: {
|
|
11
|
+
readonly id?: string | undefined;
|
|
12
|
+
readonly needs?: readonly Need[] | undefined;
|
|
13
|
+
readonly card?: UnitManifest['card'];
|
|
14
|
+
}): UnitManifest;
|
|
15
|
+
export declare function needStateOf(need: Need, status?: NeedState['status'], extra?: Partial<NeedState>): NeedState;
|
|
16
|
+
export declare function capabilityOf(unit: string, needs?: readonly NeedState[], extra?: Partial<UnitCapability>): UnitCapability;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export const fakeNpmSource = {
|
|
2
|
+
kind: 'npm',
|
|
3
|
+
registryEnv: 'WB_TEST_REGISTRY',
|
|
4
|
+
registryDefault: 'https://registry.invalid/',
|
|
5
|
+
};
|
|
6
|
+
export function extensionNeedOf(name, extra = {}) {
|
|
7
|
+
return {
|
|
8
|
+
kind: 'extension',
|
|
9
|
+
runtime: 'opencli',
|
|
10
|
+
name,
|
|
11
|
+
commands: [`${name}-read`],
|
|
12
|
+
purpose: '测试',
|
|
13
|
+
...extra,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function libNeedOf(name, extra = {}) {
|
|
17
|
+
return { kind: 'lib', name, purpose: '测试', ...extra };
|
|
18
|
+
}
|
|
19
|
+
export function binNeedOf(name, extra = {}) {
|
|
20
|
+
return { kind: 'bin', name, purpose: '测试', ...extra };
|
|
21
|
+
}
|
|
22
|
+
export function envNeedOf(name, extra = {}) {
|
|
23
|
+
return { kind: 'env', name, purpose: '测试', ...extra };
|
|
24
|
+
}
|
|
25
|
+
export function manifestOf(options = {}) {
|
|
26
|
+
return {
|
|
27
|
+
id: options.id ?? 'fixture',
|
|
28
|
+
card: options.card === undefined ? { titleKey: `${options.id ?? 'fixture'}.mine`, order: 10 } : options.card,
|
|
29
|
+
tools: [],
|
|
30
|
+
host: { inject: [] },
|
|
31
|
+
...(options.needs === undefined ? {} : { needs: options.needs }),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function needStateOf(need, status = 'ok', extra = {}) {
|
|
35
|
+
return {
|
|
36
|
+
id: need.id ?? `${need.kind}:${need.name}`,
|
|
37
|
+
kind: need.kind,
|
|
38
|
+
name: need.name,
|
|
39
|
+
status,
|
|
40
|
+
detail: `测试:${need.name}`,
|
|
41
|
+
...extra,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export function capabilityOf(unit, needs = [], extra = {}) {
|
|
45
|
+
return { unit, status: needs.some((need) => need.status !== 'ok') ? 'missing' : 'ok', needs, ...extra };
|
|
46
|
+
}
|
package/dist/testing.d.ts
CHANGED
package/dist/testing.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-workbench/shared",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-beta.0",
|
|
4
4
|
"description": "工作台与模块共享的纯代码与契约类型:类型、纯逻辑、哑组件、平台解析。宿主侧的东西从 /host 进(不影响浏览器产物)。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
"./testing": {
|
|
17
17
|
"types": "./dist/testing.d.ts",
|
|
18
18
|
"default": "./dist/testing.js"
|
|
19
|
+
},
|
|
20
|
+
"./contract/*": {
|
|
21
|
+
"types": "./dist/contract/*.d.ts",
|
|
22
|
+
"default": "./dist/contract/*.js"
|
|
19
23
|
}
|
|
20
24
|
},
|
|
21
25
|
"files": [
|
|
@@ -29,7 +33,7 @@
|
|
|
29
33
|
"react": "*"
|
|
30
34
|
},
|
|
31
35
|
"devDependencies": {
|
|
32
|
-
"@arch-guard/core": "^0.11.
|
|
36
|
+
"@arch-guard/core": "^0.11.1",
|
|
33
37
|
"@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.2",
|
|
34
38
|
"@types/node": "^24.19.0",
|
|
35
39
|
"@types/react": "^19.0.0",
|
|
@@ -38,6 +42,18 @@
|
|
|
38
42
|
"typescript": "5.9",
|
|
39
43
|
"vitest": "^5.0.2"
|
|
40
44
|
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"dayjs": "^1.11.23"
|
|
47
|
+
},
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "git+https://github.com/novaeth/dsh-workbench.git",
|
|
51
|
+
"directory": "packages/shared"
|
|
52
|
+
},
|
|
53
|
+
"homepage": "https://github.com/novaeth/dsh-workbench#readme",
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "https://github.com/novaeth/dsh-workbench/issues"
|
|
56
|
+
},
|
|
41
57
|
"scripts": {
|
|
42
58
|
"build": "tsc -p tsconfig.build.json && node scripts/copy-css.mjs",
|
|
43
59
|
"typecheck": "tsc --noEmit --incremental --tsBuildInfoFile node_modules/.cache/tsconfig.tsbuildinfo",
|