@dsh-workbench/core 0.2.14 → 0.2.15

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 (29) hide show
  1. package/client.js +431 -114
  2. package/dist/client/client.body.js +431 -114
  3. package/dist/client/index.js +432 -115
  4. package/dist/host/index.js +387 -22
  5. package/dist/types/app/client.d.ts +67 -6
  6. package/dist/types/app/layouts/rightbar/DebugStrip.d.ts +11 -0
  7. package/dist/types/app/layouts/sidebar/DebugFooterAction.d.ts +13 -0
  8. package/dist/types/app/layouts/sidebar/ProjectSwitcher.d.ts +2 -1
  9. package/dist/types/app/layouts/sidebar/__tests__/debug-ui.test.d.ts +1 -0
  10. package/dist/types/app/layouts/sidebar/debug-footer.d.ts +4 -0
  11. package/dist/types/app/layouts/sidebar/session-pick.d.ts +2 -1
  12. package/dist/types/modules/panels/__tests__/diy-harness.d.ts +6 -3
  13. package/dist/types/modules/panels/model/diy-browser.d.ts +3 -0
  14. package/dist/types/modules/panels/model/diy-debug-routes.d.ts +2 -0
  15. package/dist/types/modules/panels/model/diy-debug-routes.test.d.ts +1 -0
  16. package/dist/types/modules/panels/model/diy-debug-tools.d.ts +8 -0
  17. package/dist/types/modules/panels/model/diy-debug-tools.test.d.ts +1 -0
  18. package/dist/types/modules/panels/model/diy-look.d.ts +2 -1
  19. package/dist/types/modules/panels/model/diy-page.d.ts +12 -0
  20. package/dist/types/modules/panels/model/diy-scripts.d.ts +2 -1
  21. package/dist/types/modules/panels/model/diy-tools.d.ts +2 -1
  22. package/dist/types/modules/panels/model/handoff.d.ts +1 -0
  23. package/dist/types/modules/panels/unit.d.ts +7 -2
  24. package/dist/types/modules/sessions/index.d.ts +1 -1
  25. package/dist/types/modules/sessions/model/attention.d.ts +7 -0
  26. package/dist/types/shared/hooks/use-api-resource.d.ts +1 -0
  27. package/dist/types/shared/hooks/use-diy-debug.d.ts +4 -0
  28. package/package.json +2 -2
  29. package/skills/workbench-module-diy/KIT.md +18 -3
@@ -2,6 +2,7 @@ import type { UnitCall } from '@dsh-workbench/shared/host';
2
2
  import type { HandoffEntry } from '@dsh-workbench/shared/host';
3
3
  import type { UnitManifest } from '@dsh-workbench/shared/host';
4
4
  export declare const PANELS_FACT = "panels";
5
+ export declare const DIY_DEBUG_FACT = "diy-debug";
5
6
  export declare function panelsHandoffEntry(target?: {
6
7
  readonly path?: string | undefined;
7
8
  }): HandoffEntry | undefined;
@@ -37,9 +37,14 @@ export declare const DIY_NET_STOP_TOOL = "workbench_diy_net_stop";
37
37
  export declare const DIY_LOGS_WATCH_TOOL = "workbench_diy_logs_watch";
38
38
  export declare const DIY_LOGS_READ_TOOL = "workbench_diy_logs_read";
39
39
  export declare const DIY_LOGS_STOP_TOOL = "workbench_diy_logs_stop";
40
- export declare const ALL_TOOLS: readonly ["workbench_panels_list", "workbench_panels_show", "workbench_panels_hide", "workbench_panels_move", "workbench_panels_reset", "workbench_panels_follow", "workbench_modules_list", "workbench_modules_install", "workbench_modules_update", "workbench_modules_uninstall", "workbench_modules_install_bundle", "workbench_modules_update_dependency", "workbench_modules_update_plugin", "workbench_modules_uninstall_plugin", "workbench_modules_update_workbench", "workbench_diy_list", "workbench_diy_status", "workbench_diy_panel", "workbench_diy_recon", "workbench_diy_probe", "workbench_diy_look", "workbench_diy_install", "workbench_diy_show", "workbench_diy_click", "workbench_diy_type", "workbench_diy_fill", "workbench_diy_keys", "workbench_diy_hover", "workbench_diy_select", "workbench_diy_scroll", "workbench_diy_reload", "workbench_diy_viewport", "workbench_diy_net_watch", "workbench_diy_net_read", "workbench_diy_net_stop", "workbench_diy_logs_watch", "workbench_diy_logs_read", "workbench_diy_logs_stop"];
40
+ export declare const DIY_DEBUG_START_TOOL = "workbench_diy_debug_start";
41
+ export declare const DIY_DEBUG_PAUSE_TOOL = "workbench_diy_debug_pause";
42
+ export declare const DIY_DEBUG_RESUME_TOOL = "workbench_diy_debug_resume";
43
+ export declare const DIY_DEBUG_STOP_TOOL = "workbench_diy_debug_stop";
44
+ export declare const ALL_TOOLS: readonly ["workbench_panels_list", "workbench_panels_show", "workbench_panels_hide", "workbench_panels_move", "workbench_panels_reset", "workbench_panels_follow", "workbench_modules_list", "workbench_modules_install", "workbench_modules_update", "workbench_modules_uninstall", "workbench_modules_install_bundle", "workbench_modules_update_dependency", "workbench_modules_update_plugin", "workbench_modules_uninstall_plugin", "workbench_modules_update_workbench", "workbench_diy_list", "workbench_diy_status", "workbench_diy_panel", "workbench_diy_recon", "workbench_diy_probe", "workbench_diy_look", "workbench_diy_install", "workbench_diy_show", "workbench_diy_click", "workbench_diy_type", "workbench_diy_fill", "workbench_diy_keys", "workbench_diy_hover", "workbench_diy_select", "workbench_diy_scroll", "workbench_diy_reload", "workbench_diy_viewport", "workbench_diy_net_watch", "workbench_diy_net_read", "workbench_diy_net_stop", "workbench_diy_logs_watch", "workbench_diy_logs_read", "workbench_diy_logs_stop", "workbench_diy_debug_start", "workbench_diy_debug_pause", "workbench_diy_debug_resume", "workbench_diy_debug_stop"];
41
45
  export type PanelsToolName = (typeof ALL_TOOLS)[number];
42
46
  export declare const READ_TOOLS: readonly ["workbench_panels_list", "workbench_modules_list", "workbench_diy_list", "workbench_diy_status", "workbench_diy_panel", "workbench_diy_recon", "workbench_diy_probe", "workbench_diy_look", "workbench_diy_click", "workbench_diy_type", "workbench_diy_fill", "workbench_diy_keys", "workbench_diy_hover", "workbench_diy_select", "workbench_diy_scroll", "workbench_diy_reload", "workbench_diy_viewport", "workbench_diy_net_watch", "workbench_diy_net_read", "workbench_diy_net_stop", "workbench_diy_logs_watch", "workbench_diy_logs_read", "workbench_diy_logs_stop"];
43
- export declare const WRITE_TOOLS: readonly ["workbench_panels_show", "workbench_panels_hide", "workbench_panels_move", "workbench_panels_reset", "workbench_panels_follow", "workbench_modules_install", "workbench_modules_update", "workbench_modules_uninstall", "workbench_modules_install_bundle", "workbench_modules_update_dependency", "workbench_modules_update_plugin", "workbench_modules_uninstall_plugin", "workbench_modules_update_workbench", "workbench_diy_install", "workbench_diy_show"];
47
+ export declare const WRITE_TOOLS: readonly ["workbench_panels_show", "workbench_panels_hide", "workbench_panels_move", "workbench_panels_reset", "workbench_panels_follow", "workbench_modules_install", "workbench_modules_update", "workbench_modules_uninstall", "workbench_modules_install_bundle", "workbench_modules_update_dependency", "workbench_modules_update_plugin", "workbench_modules_uninstall_plugin", "workbench_modules_update_workbench", "workbench_diy_install", "workbench_diy_show", "workbench_diy_debug_start", "workbench_diy_debug_pause", "workbench_diy_debug_resume", "workbench_diy_debug_stop"];
44
48
  export declare const DIY_TOOLS: readonly ["workbench_diy_list", "workbench_diy_status", "workbench_diy_panel", "workbench_diy_recon", "workbench_diy_probe", "workbench_diy_look", "workbench_diy_install", "workbench_diy_show", "workbench_diy_click", "workbench_diy_type", "workbench_diy_fill", "workbench_diy_keys", "workbench_diy_hover", "workbench_diy_select", "workbench_diy_scroll", "workbench_diy_reload", "workbench_diy_viewport", "workbench_diy_net_watch", "workbench_diy_net_read", "workbench_diy_net_stop", "workbench_diy_logs_watch", "workbench_diy_logs_read", "workbench_diy_logs_stop"];
49
+ export declare const DIY_DEBUG_TOOLS: readonly ["workbench_diy_debug_start", "workbench_diy_debug_pause", "workbench_diy_debug_resume", "workbench_diy_debug_stop"];
45
50
  export declare const panelsUnit: UnitManifest;
@@ -1,3 +1,3 @@
1
1
  export { currentSessionId, orderByRecency, sessionNode, orderSessionRows, sessionRows, workspaceOfSession, sessionStatuses, visiblePendingKind, type SessionNode, type SessionStatusDot, } from './model/session-node';
2
2
  export { scrollEdgesOf, type ScrollEdges } from './model/scroll-edges';
3
- export { attentionLabel, attentionOf, attentionOfSession, attentionWordLabel, type Attention, type AttentionInput, type AttentionSeverity, type WorkspaceAttention, } from './model/attention';
3
+ export { attentionLabel, attentionOf, attentionOfSession, attentionSessionIdOf, attentionWordLabel, type Attention, type AttentionInput, type AttentionSeverity, type WorkspaceAttention, } from './model/attention';
@@ -17,6 +17,13 @@ export interface AttentionInput {
17
17
  readonly currentWorkspaceId: string | null;
18
18
  }
19
19
  export declare function attentionOfSession(summary: SessionSummary, statusById: SessionStatusSnapshot, sessions: SessionsSnapshot): AttentionSeverity | undefined;
20
+ export interface AttentionPickInput {
21
+ readonly workspace: WorkspaceView | null;
22
+ readonly sessions: SessionsSnapshot;
23
+ readonly statusById: SessionStatusSnapshot;
24
+ readonly archivedIds: ReadonlySet<string>;
25
+ }
26
+ export declare function attentionSessionIdOf(input: AttentionPickInput): string | null;
20
27
  export declare function attentionOf(input: AttentionInput): Attention;
21
28
  export declare function attentionLabel(attention: WorkspaceAttention, t: Translate): string;
22
29
  export declare function attentionWordLabel(attention: WorkspaceAttention, t: Translate): string;
@@ -15,4 +15,5 @@ export declare function useApiResource<T>(route: string, query: Query, refreshTo
15
15
  enabled?: boolean;
16
16
  key?: string;
17
17
  fact?: string;
18
+ report?: boolean;
18
19
  }): ResourceState<T>;
@@ -0,0 +1,4 @@
1
+ import type { DebugState } from '@dsh-workbench/shared';
2
+ export declare const DIY_DEBUG_ROUTE = "panels/diy-debug";
3
+ export declare const DIY_DEBUG_FACT = "diy-debug";
4
+ export declare function useDiyDebugState(): DebugState | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-workbench/core",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "description": "个人工作台:Agent 工作台外壳(左栏 + 常驻对话 + 自研右侧数据面板)。",
5
5
  "type": "module",
6
6
  "icon": "./icon.svg",
@@ -87,7 +87,7 @@
87
87
  "access": "public"
88
88
  },
89
89
  "dependencies": {
90
- "@dsh-workbench/shared": "0.2.14"
90
+ "@dsh-workbench/shared": "0.2.15"
91
91
  },
92
92
  "scripts": {
93
93
  "build": "node scripts/build.mjs && node scripts/build-types.mjs",
@@ -86,6 +86,20 @@ h(Field, { label: t('myunit.mode'), hint: t('myunit.modeHint') },
86
86
  **`SelectField`** —— 下拉:默认是**常规下拉框**(跟 `TextField` 一套),无边框那种给 `variant: 'ghost'`;
87
87
  搜索、分组、禁用项、加载态、空态、页脚都是它的 prop。
88
88
  **`SaveBar`** —— 设置面底下那条"取消 / 保存"(`busy` / `disabled` / `labels` / `onCancel` / `onSave`)。
89
+ **`FormActions`** —— **操作区**(一组按钮):`actions: { key, label, kind?: 'default' | 'danger' | 'primary', onClick, disabled?, busy? }[]`。
90
+ **顺序 / 间距 / 换行都归它** —— `primary` 永远在右、`danger` 紧挨它左侧、一个区只许一颗 `primary`、
91
+ 窄了自动折行且 `primary` 落在右下角;`busy` 自带 `Spinner`。调用点只给"有哪些动作、哪个是主要、点了做什么":
92
+ **别自己写 `gap` / `margin` / 顺序,也别借 `.wb-formActions` 槽类手摆**(`check:style` 的 F3 会红,没有豁免)。
93
+
94
+ ```tsx
95
+ h(FormActions, { actions: [
96
+ { key: 'retry', label: t('myunit.retry'), onClick: onRetry, disabled: busy },
97
+ { key: 'confirm', label: t('myunit.confirm'), kind: 'primary', onClick: submit, disabled: busy },
98
+ ] })
99
+ ```
100
+
101
+ `danger` 只标"这是破坏性的"(渲成描边 + 危险色,**永远不当填充的 `primary`**);**二次确认那半归调用点**
102
+ (先问一句或弹窗都行),口径见 [ADR-0054](../../../../docs/adr/0054-the-action-area-is-one-component.md) §2 规则三。
89
103
 
90
104
  **别手写 `<button>` / `<input>` / `<select>`**:dsh 有 `Button`(`variant` / `size`),
91
105
  kit 有上面这几件;手写的会拿到浏览器默认样式,而且**判据会红**(`check:style`)。
@@ -136,12 +150,13 @@ h('div', { className: styles.form }, …) // ← .form { gap:
136
150
  ```
137
151
 
138
152
  `<span className={styles.label}>` 紧邻控件、或给表单容器自己写 `gap` —— 这正是 `check:style` 那条
139
- 棘轮(F1 手写行 / F2 自己管行距)盯的东西;`FORM_ROW_EXEMPT` 是**等外壳发版后要清空的历史账**
140
- ("迁一处删一行"),**不是"可以继续这么写"的许可**。
153
+ 棘轮(F1 手写行 / F2 自己管行距)盯的东西;`FORM_ROW_EXEMPT` 是这张表的历史账,**2026-10-17 已经清空**
154
+ (外壳 0.2.13 之后按"迁一处删一行"迁完,ADR-0052 §10)—— 表空了仍然**不是"可以继续这么写"的许可**:
155
+ 现在再这么写直接红,没有豁免那一层。
141
156
 
142
157
  **时点**:这一层随外壳**发版**后模块才能用 —— 模块的 `peerDependencies` 下限得先有它
143
158
  (`check:kit` 拿 peer 下限那份外壳比,不抬必红);迁移步骤见
144
- [ADR-0052](../../../../docs/adr/0052-the-form-row-is-one-component.md) §10。
159
+ [ADR-0052](../../../../docs/adr/0052-the-form-row-is-one-component.md) §10。已迁完的包下限在 `^0.2.14`。
145
160
 
146
161
  ## 6 别的
147
162