@dsh-workbench/shared 0.1.6 → 0.1.8

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 (96) hide show
  1. package/dist/api/dsh-client.d.ts +11 -0
  2. package/dist/components/Activity.css +69 -0
  3. package/dist/components/Activity.d.ts +23 -0
  4. package/dist/components/Activity.js +23 -0
  5. package/dist/components/ApprovalPlan.css +41 -0
  6. package/dist/components/ApprovalPlan.d.ts +13 -0
  7. package/dist/components/ApprovalPlan.js +11 -0
  8. package/dist/components/Card.css +20 -0
  9. package/dist/components/Card.d.ts +13 -0
  10. package/dist/components/Card.js +8 -0
  11. package/dist/components/LongTaskRow.css +10 -0
  12. package/dist/components/Note.css +14 -0
  13. package/dist/components/Note.d.ts +8 -0
  14. package/dist/components/Note.js +6 -0
  15. package/dist/components/ResourceStates.css +5 -1
  16. package/dist/components/Rows.css +30 -0
  17. package/dist/components/Rows.d.ts +11 -0
  18. package/dist/components/Rows.js +10 -0
  19. package/dist/components/SettingsSection.css +26 -0
  20. package/dist/components/SettingsSection.d.ts +9 -0
  21. package/dist/components/SettingsSection.js +9 -0
  22. package/dist/components/Stack.css +7 -0
  23. package/dist/components/Stack.d.ts +6 -0
  24. package/dist/components/Stack.js +5 -0
  25. package/dist/components/StateBlock.css +36 -0
  26. package/dist/components/StateBlock.d.ts +11 -0
  27. package/dist/components/StateBlock.js +12 -0
  28. package/dist/components/StateDot.d.ts +5 -0
  29. package/dist/components/StateDot.js +10 -0
  30. package/dist/components/icons.d.ts +1 -0
  31. package/dist/components/icons.js +4 -0
  32. package/dist/config/constants.d.ts +2 -0
  33. package/dist/config/constants.js +2 -0
  34. package/dist/host/__tests__/fakes.d.ts +41 -0
  35. package/dist/host/__tests__/fakes.js +76 -0
  36. package/dist/host/__tests__/preflight-fixtures.d.ts +19 -0
  37. package/dist/host/__tests__/preflight-fixtures.js +47 -0
  38. package/dist/host/context-inject.d.ts +24 -0
  39. package/dist/host/context-inject.js +74 -0
  40. package/dist/host/events.d.ts +9 -0
  41. package/dist/host/events.js +70 -0
  42. package/dist/host/mount-units.d.ts +52 -0
  43. package/dist/host/mount-units.js +186 -0
  44. package/dist/host/preflight.d.ts +58 -0
  45. package/dist/host/preflight.js +233 -0
  46. package/dist/host/probe-cache.d.ts +6 -0
  47. package/dist/host/probe-cache.js +19 -0
  48. package/dist/host/probe-libs.d.ts +45 -0
  49. package/dist/host/probe-libs.js +61 -0
  50. package/dist/host/probe-units.d.ts +17 -0
  51. package/dist/host/probe-units.js +102 -0
  52. package/dist/host/probe-verdict.d.ts +7 -0
  53. package/dist/host/probe-verdict.js +143 -0
  54. package/dist/host/tool-scope.d.ts +32 -0
  55. package/dist/host/tool-scope.js +84 -0
  56. package/dist/host/unit-readiness.d.ts +7 -0
  57. package/dist/host/unit-readiness.js +5 -0
  58. package/dist/host/unit-registry.d.ts +9 -0
  59. package/dist/host/unit-registry.js +33 -0
  60. package/dist/host/version-range.d.ts +2 -0
  61. package/dist/host/version-range.js +73 -0
  62. package/dist/i18n/en.js +4 -1
  63. package/dist/i18n/index.d.ts +5 -2
  64. package/dist/i18n/zh.d.ts +4 -1
  65. package/dist/i18n/zh.js +4 -1
  66. package/dist/index.d.ts +8 -0
  67. package/dist/index.js +8 -0
  68. package/dist/lib/react.d.ts +1 -0
  69. package/dist/lib/react.js +1 -0
  70. package/package.json +1 -1
  71. package/src/api/dsh-client.ts +13 -0
  72. package/src/components/Activity.css +69 -0
  73. package/src/components/Activity.tsx +76 -0
  74. package/src/components/ApprovalPlan.css +41 -0
  75. package/src/components/ApprovalPlan.tsx +33 -0
  76. package/src/components/Card.css +20 -0
  77. package/src/components/Card.tsx +28 -0
  78. package/src/components/LongTaskRow.css +10 -0
  79. package/src/components/Note.css +14 -0
  80. package/src/components/Note.tsx +14 -0
  81. package/src/components/ResourceStates.css +5 -1
  82. package/src/components/Rows.css +30 -0
  83. package/src/components/Rows.tsx +25 -0
  84. package/src/components/SettingsSection.css +26 -0
  85. package/src/components/SettingsSection.tsx +22 -0
  86. package/src/components/Stack.css +7 -0
  87. package/src/components/Stack.tsx +11 -0
  88. package/src/components/StateBlock.css +36 -0
  89. package/src/components/StateBlock.tsx +29 -0
  90. package/src/components/icons.tsx +16 -0
  91. package/src/config/constants.ts +4 -0
  92. package/src/i18n/en.ts +4 -1
  93. package/src/i18n/zh.ts +4 -1
  94. package/src/index.ts +8 -0
  95. package/src/lib/react.test.ts +2 -1
  96. package/src/lib/react.ts +1 -0
@@ -157,6 +157,17 @@ export interface DshSessionsService {
157
157
  };
158
158
  scope(sessionId: string): unknown | undefined;
159
159
  }
160
+ export interface DshObservable<T> {
161
+ getSnapshot(): T;
162
+ subscribe(listener: () => void): () => void;
163
+ }
164
+ export interface DshSidebarRight {
165
+ readonly mounted: DshObservable<string | undefined>;
166
+ isExpanded(): boolean;
167
+ toggleExpanded(): void;
168
+ openResource(address: string, options?: unknown): void;
169
+ openTab(kind: string, options?: unknown): void;
170
+ }
160
171
  export interface DshClientContext {
161
172
  get<T = unknown>(name: string): T | undefined;
162
173
  provide(name: string, value: unknown): void;
@@ -0,0 +1,69 @@
1
+
2
+ .wb-activityBlock {
3
+ display: flex;
4
+ flex-direction: column;
5
+ gap: var(--wb-len-6);
6
+ padding-top: var(--wb-len-10);
7
+ border-top: 0.5px solid var(--dsw-alias-border-l2);
8
+ }
9
+
10
+ .wb-activityBlock:first-child {
11
+ border-top: none;
12
+ }
13
+
14
+ .wb-activityBlockHead {
15
+ display: flex;
16
+ align-items: center;
17
+ justify-content: space-between;
18
+ gap: var(--wb-len-8);
19
+ }
20
+
21
+ .wb-activityLine {
22
+ display: flex;
23
+ align-items: center;
24
+ gap: var(--wb-len-6);
25
+ margin: 0;
26
+ font-size: var(--dsw-font-xxs-12-font-size);
27
+ line-height: var(--wb-line-18);
28
+ color: var(--dsw-alias-label-secondary);
29
+ }
30
+
31
+ .wb-activityLineText {
32
+ flex: none;
33
+ min-width: 0;
34
+ font-size: var(--dsw-font-xxs-12-font-size);
35
+ line-height: var(--wb-line-18);
36
+ overflow-wrap: anywhere;
37
+ white-space: pre-wrap;
38
+ max-height: var(--wb-len-72);
39
+ overflow-y: auto;
40
+ }
41
+
42
+ .wb-activityLineAt {
43
+ flex: none;
44
+ margin-left: auto;
45
+ font-size: var(--wb-font-10);
46
+ line-height: var(--wb-line-16);
47
+ font-variant-numeric: tabular-nums;
48
+ color: var(--dsw-alias-label-tertiary);
49
+ }
50
+
51
+ .wb-activityLine > .wb-activityLineAt,
52
+ .wb-activityLine > .wb-activityLineActions {
53
+ margin-left: auto;
54
+ }
55
+
56
+ .wb-activityLine > .wb-activityLineAt + .wb-activityLineActions {
57
+ margin-left: 0;
58
+ }
59
+
60
+ .wb-activityLineActions {
61
+ flex: none;
62
+ display: inline-flex;
63
+ align-items: center;
64
+ gap: var(--wb-len-6);
65
+ }
66
+
67
+ .wb-activityActionFailed {
68
+ color: var(--dsw-alias-state-error-primary);
69
+ }
@@ -0,0 +1,23 @@
1
+ import type { ReactNode } from '../lib/react.js';
2
+ import './Activity.css';
3
+ export interface ActivityBlockProps {
4
+ readonly head?: ReactNode | undefined;
5
+ readonly children?: ReactNode | undefined;
6
+ }
7
+ export declare function ActivityBlock({ head, children }: ActivityBlockProps): JSX.Element;
8
+ export interface ActivityLineProps {
9
+ readonly dot?: ReactNode | undefined;
10
+ readonly text: ReactNode;
11
+ readonly at?: ReactNode | undefined;
12
+ readonly actions?: ReactNode | undefined;
13
+ }
14
+ export declare function ActivityLine({ dot, text, at, actions }: ActivityLineProps): JSX.Element;
15
+ export interface ActivityActionProps {
16
+ readonly label: string;
17
+ readonly hint?: string | undefined;
18
+ readonly icon: ReactNode;
19
+ readonly href?: string | undefined;
20
+ readonly onClick?: (() => void) | undefined;
21
+ readonly failed?: boolean | undefined;
22
+ }
23
+ export declare function ActivityAction({ label, hint, icon, href, onClick, failed }: ActivityActionProps): JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { Button, Tooltip } from '@deepseek-ai/dsh-client-ui-primitives';
2
+ import { h } from '../lib/react.js';
3
+ import './Activity.css';
4
+ export function ActivityBlock({ head, children }) {
5
+ return (h("div", { className: "wb-activityBlock" },
6
+ head === undefined ? null : h("div", { className: "wb-activityBlockHead" }, head),
7
+ children));
8
+ }
9
+ export function ActivityLine({ dot, text, at, actions }) {
10
+ return (h("div", { className: "wb-activityLine" },
11
+ dot,
12
+ h("span", { className: "wb-activityLineText" }, text),
13
+ at === undefined ? null : h("span", { className: "wb-activityLineAt" }, at),
14
+ actions === undefined ? null : h("span", { className: "wb-activityLineActions" }, actions)));
15
+ }
16
+ export function ActivityAction({ label, hint, icon, href, onClick, failed }) {
17
+ const tip = hint ?? label;
18
+ if (href !== undefined) {
19
+ return (h("a", { className: "wb-iconButton", href: href, target: "_blank", rel: "noreferrer noopener", title: tip, "aria-label": label }, icon));
20
+ }
21
+ return (h(Tooltip, { side: "bottom", align: "end", gap: 6, portal: true, label: tip },
22
+ h(Button, { type: "button", variant: "ghost", size: "sm", className: failed === true ? 'wb-iconButton wb-activityActionFailed' : 'wb-iconButton', "aria-label": label, icon: icon, onClick: onClick })));
23
+ }
@@ -0,0 +1,41 @@
1
+
2
+ .wb-approvalPlan {
3
+ display: flex;
4
+ flex-direction: column;
5
+ gap: var(--wb-len-6);
6
+ }
7
+ .wb-approvalHint {
8
+ margin: 0;
9
+ font-size: var(--dsw-font-xxs-12-font-size);
10
+ line-height: var(--wb-line-18);
11
+ color: var(--dsw-alias-label-secondary);
12
+ }
13
+ .wb-approvalRows {
14
+ display: flex;
15
+ flex-direction: column;
16
+ gap: var(--wb-len-2);
17
+ margin: 0;
18
+ }
19
+ .wb-approvalRow {
20
+ display: flex;
21
+ align-items: baseline;
22
+ gap: var(--wb-len-8);
23
+ }
24
+ .wb-approvalLabel {
25
+ flex: none;
26
+ width: var(--wb-len-56);
27
+ font-size: var(--dsw-font-xxs-12-font-size);
28
+ line-height: var(--wb-line-18);
29
+ color: var(--dsw-alias-label-tertiary);
30
+ }
31
+ .wb-approvalValue {
32
+ margin: 0;
33
+ font-size: var(--dsw-font-xs-13-font-size);
34
+ line-height: var(--wb-line-18);
35
+ font-weight: 500;
36
+ color: var(--dsw-alias-label-primary);
37
+ overflow-wrap: anywhere;
38
+ }
39
+ .wb-approvalWarn {
40
+ color: var(--dsw-alias-label-secondary);
41
+ }
@@ -0,0 +1,13 @@
1
+ import type { ReactNode } from '../lib/react.js';
2
+ import './ApprovalPlan.css';
3
+ export interface ApprovalPlanRow {
4
+ readonly label: ReactNode;
5
+ readonly value: ReactNode;
6
+ }
7
+ export interface ApprovalPlanProps {
8
+ readonly rows: readonly ApprovalPlanRow[];
9
+ readonly hint?: ReactNode | undefined;
10
+ readonly warn?: ReactNode | undefined;
11
+ readonly children?: ReactNode | undefined;
12
+ }
13
+ export declare function ApprovalPlan({ rows, hint, warn, children }: ApprovalPlanProps): JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { h } from '../lib/react.js';
2
+ import './ApprovalPlan.css';
3
+ export function ApprovalPlan({ rows, hint, warn, children }) {
4
+ return (h("div", { className: "wb-approvalPlan" },
5
+ hint === undefined ? null : h("p", { className: "wb-approvalHint" }, hint),
6
+ h("dl", { className: "wb-approvalRows" }, rows.map((row, index) => (h("div", { className: "wb-approvalRow", key: String(index) },
7
+ h("dt", { className: "wb-approvalLabel" }, row.label),
8
+ h("dd", { className: "wb-approvalValue" }, row.value))))),
9
+ children,
10
+ warn === undefined ? null : h("p", { className: "wb-approvalWarn" }, warn)));
11
+ }
@@ -0,0 +1,20 @@
1
+
2
+ .wb-card {
3
+ border: 0.5px solid var(--dsw-alias-border-l3);
4
+ border-radius: var(--dsw-radius-xl);
5
+ background: var(--dsw-alias-bg-layer-1);
6
+ overflow: hidden;
7
+ display: flex;
8
+ flex-direction: column;
9
+ flex: none;
10
+ }
11
+ .wb-cardBody {
12
+ display: flex;
13
+ flex-direction: column;
14
+ gap: var(--wb-len-12);
15
+ padding: var(--wb-len-12);
16
+ }
17
+ .wb-cardBody > :not([data-wb-bleed]) {
18
+ padding-left: var(--wb-len-8);
19
+ padding-right: var(--wb-len-8);
20
+ }
@@ -0,0 +1,13 @@
1
+ import type { ReactNode } from '../lib/react.js';
2
+ import type { Translate } from '../api/dsh-client.js';
3
+ import './Card.css';
4
+ export interface CardProps {
5
+ readonly t: Translate;
6
+ readonly title: string;
7
+ readonly refreshing: boolean;
8
+ readonly onRefresh: () => void;
9
+ readonly meta?: ReactNode | undefined;
10
+ readonly head?: ReactNode | undefined;
11
+ readonly children?: ReactNode | undefined;
12
+ }
13
+ export declare function Card({ t, title, refreshing, onRefresh, meta, head, children }: CardProps): JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { h } from '../lib/react.js';
2
+ import { CardHead } from './CardHead.js';
3
+ import './Card.css';
4
+ export function Card({ t, title, refreshing, onRefresh, meta, head, children }) {
5
+ return (h("section", { className: "wb-card" },
6
+ head === undefined ? (h(CardHead, { t: t, title: title, refreshing: refreshing, onRefresh: onRefresh, meta: meta })) : (head),
7
+ h("div", { className: "wb-cardBody" }, children)));
8
+ }
@@ -19,9 +19,19 @@
19
19
  display: inline-flex;
20
20
  align-items: center;
21
21
  gap: var(--wb-len-2);
22
+ color: var(--dsw-alias-label-secondary);
22
23
  text-decoration: none;
23
24
  white-space: nowrap;
24
25
  }
26
+ .wb-longTaskLink:hover,
27
+ .wb-longTaskLink:focus-visible {
28
+ color: var(--dsw-alias-label-primary);
29
+ text-decoration: none;
30
+ }
31
+ .wb-longTaskLink:focus-visible {
32
+ outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
33
+ outline-offset: -2px;
34
+ }
25
35
 
26
36
  .wb-longTaskHeadline {
27
37
  margin: 0;
@@ -0,0 +1,14 @@
1
+
2
+ .wb-note {
3
+ margin: 0;
4
+ font-size: var(--dsw-font-xxxs-11-font-size);
5
+ line-height: var(--wb-line-16);
6
+ color: var(--dsw-alias-label-tertiary);
7
+ }
8
+ .wb-problem {
9
+ margin: 0;
10
+ font-size: var(--dsw-font-xxxs-11-font-size);
11
+ line-height: var(--wb-line-16);
12
+ color: var(--dsw-alias-state-error-primary);
13
+ overflow-wrap: anywhere;
14
+ }
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from '../lib/react.js';
2
+ import './Note.css';
3
+ export interface NoteProps {
4
+ readonly tone?: 'muted' | 'problem';
5
+ readonly as?: 'p' | 'span';
6
+ readonly children?: ReactNode | undefined;
7
+ }
8
+ export declare function Note({ tone, as, children }: NoteProps): JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { h } from '../lib/react.js';
2
+ import './Note.css';
3
+ export function Note({ tone = 'muted', as, children }) {
4
+ const className = tone === 'problem' ? 'wb-problem' : 'wb-note';
5
+ return as === 'span' ? h("span", { className: className }, children) : h("p", { className: className }, children);
6
+ }
@@ -108,4 +108,8 @@
108
108
  justify-content: center;
109
109
  gap: var(--wb-len-8);
110
110
  margin-top: var(--wb-len-2);
111
- }
111
+ }
112
+ @media (prefers-reduced-motion: reduce) {
113
+ .wb-skeletonBar {
114
+ animation: none;
115
+ }}
@@ -0,0 +1,30 @@
1
+
2
+ .wb-row:has(> [data-wb-dot]) {
3
+ grid-template-columns: 84px minmax(0, 1fr);
4
+ }
5
+ .wb-rows {
6
+ display: flex;
7
+ flex-direction: column;
8
+ }
9
+ .wb-row {
10
+ display: grid;
11
+ grid-template-columns: 56px minmax(0, 1fr);
12
+ align-items: baseline;
13
+ gap: var(--wb-len-8);
14
+ padding: var(--wb-len-4) 0;
15
+ }
16
+ .wb-row + .wb-row {
17
+ border-top: 0.5px solid var(--dsw-alias-border-l2);
18
+ }
19
+ .wb-rowKey {
20
+ font-size: var(--dsw-font-xxxs-11-font-size);
21
+ line-height: var(--wb-line-16);
22
+ color: var(--dsw-alias-label-tertiary);
23
+ }
24
+ .wb-rowValue {
25
+ min-width: 0;
26
+ font-size: var(--dsw-font-xxs-12-font-size);
27
+ line-height: var(--wb-line-18);
28
+ color: var(--dsw-alias-label-primary);
29
+ overflow-wrap: anywhere;
30
+ }
@@ -0,0 +1,11 @@
1
+ import type { ReactNode } from '../lib/react.js';
2
+ import './Rows.css';
3
+ export interface RowsProps {
4
+ readonly children?: ReactNode | undefined;
5
+ }
6
+ export declare function Rows({ children }: RowsProps): JSX.Element;
7
+ export interface RowProps {
8
+ readonly label: ReactNode;
9
+ readonly value: ReactNode;
10
+ }
11
+ export declare function Row({ label, value }: RowProps): JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { h } from '../lib/react.js';
2
+ import './Rows.css';
3
+ export function Rows({ children }) {
4
+ return h("div", { className: "wb-rows" }, children);
5
+ }
6
+ export function Row({ label, value }) {
7
+ return (h("div", { className: "wb-row" },
8
+ h("span", { className: "wb-rowKey" }, label),
9
+ h("span", { className: "wb-rowValue" }, value)));
10
+ }
@@ -0,0 +1,26 @@
1
+
2
+ .wb-settings {
3
+ display: flex;
4
+ flex-direction: column;
5
+ gap: var(--wb-len-8);
6
+ padding: var(--wb-len-10);
7
+ border: 0.5px solid var(--dsw-alias-border-l2);
8
+ border-radius: var(--dsw-radius-md);
9
+ background: var(--dsw-alias-bg-layer-1);
10
+ }
11
+ .wb-settingsHead {
12
+ display: flex;
13
+ align-items: center;
14
+ gap: var(--wb-len-8);
15
+ }
16
+ .wb-settingsTitle {
17
+ flex: 1 1 auto;
18
+ min-width: 0;
19
+ overflow: hidden;
20
+ text-overflow: ellipsis;
21
+ white-space: nowrap;
22
+ font-size: var(--dsw-font-xxs-12-font-size);
23
+ line-height: var(--wb-line-18);
24
+ font-weight: 500;
25
+ color: var(--dsw-alias-label-primary);
26
+ }
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from '../lib/react.js';
2
+ import './SettingsSection.css';
3
+ export interface SettingsSectionProps {
4
+ readonly label: string;
5
+ readonly title: ReactNode;
6
+ readonly action?: ReactNode | undefined;
7
+ readonly children?: ReactNode | undefined;
8
+ }
9
+ export declare function SettingsSection({ label, title, action, children }: SettingsSectionProps): JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { h } from '../lib/react.js';
2
+ import './SettingsSection.css';
3
+ export function SettingsSection({ label, title, action, children }) {
4
+ return (h("section", { className: "wb-settings", role: "group", "aria-label": label },
5
+ h("header", { className: "wb-settingsHead" },
6
+ h("span", { className: "wb-settingsTitle" }, title),
7
+ action),
8
+ children));
9
+ }
@@ -0,0 +1,7 @@
1
+
2
+ .wb-stack {
3
+ display: flex;
4
+ flex-direction: column;
5
+ gap: var(--wb-len-10);
6
+ min-height: 0;
7
+ }
@@ -0,0 +1,6 @@
1
+ import type { ReactNode } from '../lib/react.js';
2
+ import './Stack.css';
3
+ export interface StackProps {
4
+ readonly children?: ReactNode | undefined;
5
+ }
6
+ export declare function Stack({ children }: StackProps): JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { h } from '../lib/react.js';
2
+ import './Stack.css';
3
+ export function Stack({ children }) {
4
+ return h("div", { className: "wb-stack" }, children);
5
+ }
@@ -0,0 +1,36 @@
1
+
2
+ .wb-stateBlock {
3
+ display: flex;
4
+ flex-direction: column;
5
+ gap: var(--wb-len-6);
6
+ }
7
+ .wb-stateBlockTitle {
8
+ margin: 0;
9
+ display: flex;
10
+ align-items: center;
11
+ gap: var(--wb-len-6);
12
+ font-size: var(--dsw-font-xxs-12-font-size);
13
+ line-height: var(--wb-line-18);
14
+ color: var(--dsw-alias-label-primary);
15
+ }
16
+ .wb-stateBlockHint {
17
+ margin: 0;
18
+ font-size: var(--dsw-font-xxxs-11-font-size);
19
+ line-height: var(--wb-line-16);
20
+ color: var(--dsw-alias-label-tertiary);
21
+ }
22
+ .wb-stateBlockActions {
23
+ display: flex;
24
+ align-items: center;
25
+ gap: var(--wb-len-8);
26
+ margin-top: var(--wb-len-2);
27
+ }
28
+ .wb-stateBlockResolving {
29
+ display: flex;
30
+ align-items: center;
31
+ gap: var(--wb-len-8);
32
+ margin: 0;
33
+ font-size: var(--dsw-font-xxs-12-font-size);
34
+ line-height: var(--wb-line-18);
35
+ color: var(--dsw-alias-label-secondary);
36
+ }
@@ -0,0 +1,11 @@
1
+ import type { ReactNode } from '../lib/react.js';
2
+ import './StateBlock.css';
3
+ export interface StateBlockProps {
4
+ readonly title?: ReactNode | undefined;
5
+ readonly dot?: ReactNode | undefined;
6
+ readonly hint?: ReactNode | undefined;
7
+ readonly actions?: ReactNode | undefined;
8
+ readonly resolving?: ReactNode | undefined;
9
+ readonly children?: ReactNode | undefined;
10
+ }
11
+ export declare function StateBlock({ title, dot, hint, actions, resolving, children }: StateBlockProps): JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { h } from '../lib/react.js';
2
+ import './StateBlock.css';
3
+ export function StateBlock({ title, dot, hint, actions, resolving, children }) {
4
+ return (h("div", { className: "wb-stateBlock" },
5
+ title === undefined && dot === undefined ? null : (h("p", { className: "wb-stateBlockTitle" },
6
+ dot,
7
+ title)),
8
+ resolving === undefined ? null : h("p", { className: "wb-stateBlockResolving" }, resolving),
9
+ hint === undefined ? null : h("p", { className: "wb-stateBlockHint" }, hint),
10
+ children,
11
+ actions === undefined ? null : h("div", { className: "wb-stateBlockActions" }, actions)));
12
+ }
@@ -0,0 +1,5 @@
1
+ export type DotState = 'ongoing' | 'warning' | 'done' | 'idle' | string;
2
+ export declare function StateDot({ state, size }: {
3
+ state: DotState;
4
+ size: number;
5
+ }): JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { h } from '../lib/react.js';
2
+ export function StateDot({ state, size }) {
3
+ if (state === 'ongoing') {
4
+ return (h("svg", { className: "wb-loading", viewBox: "0 0 24 24", width: size, height: size, "aria-hidden": "true", style: { display: 'block' } },
5
+ h("g", { className: "wb-loadingMotion" },
6
+ h("circle", { className: "wb-loadingTrack", cx: 12, cy: 12, r: 9.5 }),
7
+ h("circle", { className: "wb-loadingArc", cx: 12, cy: 12, r: 9.5 }))));
8
+ }
9
+ return (h("span", { className: "wb-stateDot", "data-state": state, style: { width: size, height: size }, "aria-hidden": "true" }));
10
+ }
@@ -4,3 +4,4 @@ export interface IconProps {
4
4
  export declare function IconConversation({ size }: IconProps): JSX.Element;
5
5
  export declare function IconBrandMark({ size }: IconProps): JSX.Element;
6
6
  export declare function IconModules({ size }: IconProps): JSX.Element;
7
+ export declare function IconPanelScreen({ size }: IconProps): JSX.Element;
@@ -18,3 +18,7 @@ export function IconModules({ size = 16 }) {
18
18
  h("rect", { x: "2.5", y: "8.9", width: "4.6", height: "4.6", rx: "1.2", stroke: "currentColor", strokeWidth: "1.2" }),
19
19
  h("rect", { x: "8.9", y: "8.9", width: "4.6", height: "4.6", rx: "1.2", stroke: "currentColor", strokeWidth: "1.2" })));
20
20
  }
21
+ export function IconPanelScreen({ size = 16 }) {
22
+ return (h("svg", { width: size, height: size, viewBox: "0 0 1024 1024", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", style: { display: 'block', overflow: 'hidden' } },
23
+ h("path", { d: "M939 112c17.673 0 32 14.327 32 32v554.667c0 17.673-14.327 32-32 32l-394.5-0.001v96c0 3.74-0.642 7.331-1.82 10.668H768.4c17.673 0 32 14.326 32 32 0 17.496-14.042 31.712-31.47 31.995l-0.53 0.004H256.6c-17.673 0-32-14.327-32-32 0-17.496 14.042-31.713 31.47-31.995l0.53-0.005h225.721a31.923 31.923 0 0 1-1.817-10.137l-0.004-0.53v-96H86c-17.496 0-31.713-14.041-31.996-31.47l-0.004-0.53V144c0-17.673 14.327-32 32-32z m-32 64H118v490.666h789V176zM341.9 432c17.496 0 31.713 14.042 31.996 31.47l0.004 0.53v85.333c0 17.673-14.327 32-32 32-17.496 0-31.713-14.041-31.996-31.47l-0.004-0.53V464c0-17.673 14.327-32 32-32z m170.6-85.333c17.496 0 31.713 14.041 31.996 31.47l0.004 0.53v170.666c0 17.673-14.327 32-32 32-17.496 0-31.713-14.041-31.996-31.47l-0.004-0.53V378.667c0-17.673 14.327-32 32-32z m170.6-85.334c17.496 0 31.713 14.042 31.996 31.471l0.004 0.53v256c0 17.672-14.327 32-32 32-17.496 0-31.713-14.042-31.996-31.471l-0.004-0.53v-256c0-17.673 14.327-32 32-32z" })));
24
+ }
@@ -23,5 +23,7 @@ export declare const PANEL_POLL_MS = 2000;
23
23
  export declare const DEFAULT_WORKSPACE_TITLE = "default-workspace";
24
24
  export declare const STORAGE_KEY_PROJECT = "dsh-workbench.project";
25
25
  export declare const STORAGE_KEY_RIGHTBAR = "dsh-workbench.rightbar.expanded";
26
+ export declare const STORAGE_KEY_RIGHTBAR_COLUMN = "dsh-workbench.rightbar.column";
27
+ export declare const RIGHTBAR_FULLSCREEN_WIDTH = 768;
26
28
  export declare const LOCALE_NS = "workbench";
27
29
  export declare const LOCALES: readonly ["zh", "en"];
@@ -23,5 +23,7 @@ export const PANEL_POLL_MS = 2000;
23
23
  export const DEFAULT_WORKSPACE_TITLE = "default-workspace";
24
24
  export const STORAGE_KEY_PROJECT = "dsh-workbench.project";
25
25
  export const STORAGE_KEY_RIGHTBAR = "dsh-workbench.rightbar.expanded";
26
+ export const STORAGE_KEY_RIGHTBAR_COLUMN = "dsh-workbench.rightbar.column";
27
+ export const RIGHTBAR_FULLSCREEN_WIDTH = 768;
26
28
  export const LOCALE_NS = "workbench";
27
29
  export const LOCALES = ["zh", "en"];
@@ -0,0 +1,41 @@
1
+ import type { DshShell } from '../../api/dsh.js';
2
+ import type { Opencli } from '../../host/opencli.js';
3
+ export interface ShellCall {
4
+ command: string;
5
+ workdir?: string;
6
+ timeoutMs?: number;
7
+ onExpiry?: string;
8
+ stdoutMaxBytes?: number;
9
+ }
10
+ export interface ShellReply {
11
+ stdout?: string;
12
+ stderr?: string;
13
+ exitCode?: number | null;
14
+ timedOut?: boolean;
15
+ aborted?: boolean;
16
+ failWith?: Error;
17
+ }
18
+ export declare function createFakeShell(replies?: ShellReply[] | ((call: ShellCall, index: number) => ShellReply)): {
19
+ shell: DshShell;
20
+ calls: ShellCall[];
21
+ peak: () => number;
22
+ commands: () => string[];
23
+ };
24
+ export interface OpencliCall {
25
+ args: readonly string[];
26
+ key?: string;
27
+ workdir?: string;
28
+ refresh?: boolean;
29
+ }
30
+ export declare function createFakeOpencli(replies?: Array<unknown | Error> | ((call: OpencliCall, index: number) => unknown | Error)): {
31
+ opencli: Opencli;
32
+ calls: OpencliCall[];
33
+ keys: () => (string | undefined)[];
34
+ };
35
+ export declare function createFakeLogger(): {
36
+ logger: {
37
+ info: () => void;
38
+ warn: (message: string) => void;
39
+ };
40
+ warnings: string[];
41
+ };