@dsh-workbench/core 0.2.11 → 0.2.13
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/client.js +519 -2781
- package/dist/client/client.body.js +519 -2781
- package/dist/client/index.js +519 -2781
- package/dist/host/index.js +78 -78
- package/dist/types/app/client.d.ts +27 -58
- package/dist/types/app/layouts/__tests__/kit-preview-nav.test.d.ts +1 -0
- package/dist/types/app/layouts/rightbar/board-mock.d.ts +1 -1
- package/dist/types/app/layouts/rightbar/board-plan.d.ts +2 -14
- package/dist/types/app/layouts/rightbar/board-shape.d.ts +14 -0
- package/dist/types/app/layouts/rightbar/kit-preview-frame.d.ts +4 -0
- package/dist/types/app/layouts/rightbar/kit-preview-hash.d.ts +1 -0
- package/dist/types/app/layouts/rightbar/kit-preview-rows.d.ts +1 -0
- package/dist/types/dev/MockStrip.d.ts +15 -0
- package/dist/types/dev/surface-types.d.ts +53 -0
- package/dist/types/dev/surface.d.ts +2 -0
- package/dist/types/dev/surface.stub.d.ts +2 -0
- package/package.json +2 -2
- package/skills/workbench-module-diy/DATASOURCE.md +1 -1
- package/skills/workbench-module-diy/KIT.md +55 -5
- package/skills/workbench-module-diy/PANEL.md +2 -2
- package/skills/workbench-module-diy/REVIEW.md +1 -1
package/dist/host/index.js
CHANGED
|
@@ -435,84 +435,6 @@ function createPanelStateStore() {
|
|
|
435
435
|
};
|
|
436
436
|
}
|
|
437
437
|
//#endregion
|
|
438
|
-
//#region ../shared/dist/host/cli-error.js
|
|
439
|
-
function unquote(raw) {
|
|
440
|
-
const value = raw.trim();
|
|
441
|
-
if (value.length >= 2 && (value.startsWith("\"") && value.endsWith("\"") || value.startsWith("'") && value.endsWith("'"))) return value.slice(1, -1);
|
|
442
|
-
return value;
|
|
443
|
-
}
|
|
444
|
-
function joinBlock(previous, line, fold) {
|
|
445
|
-
if (previous === "") return line;
|
|
446
|
-
return fold ? `${previous} ${line}` : `${previous}\n${line}`;
|
|
447
|
-
}
|
|
448
|
-
function parseCliErrorEnvelope(text) {
|
|
449
|
-
if (text === void 0 || text.trim() === "") return void 0;
|
|
450
|
-
const lines = text.split("\n");
|
|
451
|
-
const start = lines.findIndex((line) => /^error:\s*$/.test(line.trim()) || /^error:\s*\S/.test(line.trim()));
|
|
452
|
-
if (start === -1) return void 0;
|
|
453
|
-
const scalars = {};
|
|
454
|
-
let current;
|
|
455
|
-
let block;
|
|
456
|
-
const errorIndent = lines[start]?.search(/\S/) ?? 0;
|
|
457
|
-
for (const line of lines.slice(start + 1)) {
|
|
458
|
-
if (line.trim() === "") continue;
|
|
459
|
-
const indent = line.search(/\S/);
|
|
460
|
-
if (block !== void 0 && indent > block.indent) {
|
|
461
|
-
scalars[block.key] = joinBlock(scalars[block.key] ?? "", line.trim(), block.fold);
|
|
462
|
-
continue;
|
|
463
|
-
}
|
|
464
|
-
block = void 0;
|
|
465
|
-
if (indent <= errorIndent) break;
|
|
466
|
-
const match = /^\s*(code|message|help|exitCode):\s*(.*)$/.exec(line);
|
|
467
|
-
if (match === null) {
|
|
468
|
-
if (current !== void 0) scalars[current] = `${scalars[current] ?? ""} ${line.trim()}`.trim();
|
|
469
|
-
continue;
|
|
470
|
-
}
|
|
471
|
-
const [, key, value] = match;
|
|
472
|
-
if (key === void 0) continue;
|
|
473
|
-
const raw = (value ?? "").trim();
|
|
474
|
-
const marker = /^([|>])[0-9]*([+-]?)$/.exec(raw);
|
|
475
|
-
if (marker !== null) {
|
|
476
|
-
scalars[key] = "";
|
|
477
|
-
block = {
|
|
478
|
-
key,
|
|
479
|
-
fold: marker[1] === ">",
|
|
480
|
-
indent
|
|
481
|
-
};
|
|
482
|
-
current = key;
|
|
483
|
-
continue;
|
|
484
|
-
}
|
|
485
|
-
scalars[key] = unquote(raw);
|
|
486
|
-
current = key;
|
|
487
|
-
}
|
|
488
|
-
const code = scalars["code"];
|
|
489
|
-
const message = scalars["message"];
|
|
490
|
-
if (code === void 0 || code === "") return void 0;
|
|
491
|
-
const exitCode = scalars["exitCode"];
|
|
492
|
-
return {
|
|
493
|
-
code,
|
|
494
|
-
message: message ?? code,
|
|
495
|
-
...scalars["help"] === void 0 || scalars["help"] === "" ? {} : { help: scalars["help"] },
|
|
496
|
-
...exitCode === void 0 || Number.isNaN(Number(exitCode)) ? {} : { exitCode: Number(exitCode) }
|
|
497
|
-
};
|
|
498
|
-
}
|
|
499
|
-
function helpUrlOf(envelope) {
|
|
500
|
-
return /https?:\/\/[^\s"'`]+/.exec(envelope.help ?? "")?.[0];
|
|
501
|
-
}
|
|
502
|
-
//#endregion
|
|
503
|
-
//#region ../shared/dist/host/data-root.js
|
|
504
|
-
function dshHome() {
|
|
505
|
-
const configured = process.env.DSH_HOME?.trim();
|
|
506
|
-
if (configured !== void 0 && configured !== "") return configured;
|
|
507
|
-
return `${process.env.HOME ?? ""}/.dsh`;
|
|
508
|
-
}
|
|
509
|
-
function workbenchRoot() {
|
|
510
|
-
return `${dshHome()}/workbench`;
|
|
511
|
-
}
|
|
512
|
-
function workspacesRoot() {
|
|
513
|
-
return `${workbenchRoot()}/workspaces`;
|
|
514
|
-
}
|
|
515
|
-
//#endregion
|
|
516
438
|
//#region ../shared/dist/host/opencli-window.js
|
|
517
439
|
var OPENCLI_WINDOW_ENV = "OPENCLI_WINDOW=background";
|
|
518
440
|
function backgroundPrefix() {
|
|
@@ -1023,6 +945,84 @@ async function browserFind(options) {
|
|
|
1023
945
|
};
|
|
1024
946
|
}
|
|
1025
947
|
//#endregion
|
|
948
|
+
//#region ../shared/dist/host/cli-error.js
|
|
949
|
+
function unquote(raw) {
|
|
950
|
+
const value = raw.trim();
|
|
951
|
+
if (value.length >= 2 && (value.startsWith("\"") && value.endsWith("\"") || value.startsWith("'") && value.endsWith("'"))) return value.slice(1, -1);
|
|
952
|
+
return value;
|
|
953
|
+
}
|
|
954
|
+
function joinBlock(previous, line, fold) {
|
|
955
|
+
if (previous === "") return line;
|
|
956
|
+
return fold ? `${previous} ${line}` : `${previous}\n${line}`;
|
|
957
|
+
}
|
|
958
|
+
function parseCliErrorEnvelope(text) {
|
|
959
|
+
if (text === void 0 || text.trim() === "") return void 0;
|
|
960
|
+
const lines = text.split("\n");
|
|
961
|
+
const start = lines.findIndex((line) => /^error:\s*$/.test(line.trim()) || /^error:\s*\S/.test(line.trim()));
|
|
962
|
+
if (start === -1) return void 0;
|
|
963
|
+
const scalars = {};
|
|
964
|
+
let current;
|
|
965
|
+
let block;
|
|
966
|
+
const errorIndent = lines[start]?.search(/\S/) ?? 0;
|
|
967
|
+
for (const line of lines.slice(start + 1)) {
|
|
968
|
+
if (line.trim() === "") continue;
|
|
969
|
+
const indent = line.search(/\S/);
|
|
970
|
+
if (block !== void 0 && indent > block.indent) {
|
|
971
|
+
scalars[block.key] = joinBlock(scalars[block.key] ?? "", line.trim(), block.fold);
|
|
972
|
+
continue;
|
|
973
|
+
}
|
|
974
|
+
block = void 0;
|
|
975
|
+
if (indent <= errorIndent) break;
|
|
976
|
+
const match = /^\s*(code|message|help|exitCode):\s*(.*)$/.exec(line);
|
|
977
|
+
if (match === null) {
|
|
978
|
+
if (current !== void 0) scalars[current] = `${scalars[current] ?? ""} ${line.trim()}`.trim();
|
|
979
|
+
continue;
|
|
980
|
+
}
|
|
981
|
+
const [, key, value] = match;
|
|
982
|
+
if (key === void 0) continue;
|
|
983
|
+
const raw = (value ?? "").trim();
|
|
984
|
+
const marker = /^([|>])[0-9]*([+-]?)$/.exec(raw);
|
|
985
|
+
if (marker !== null) {
|
|
986
|
+
scalars[key] = "";
|
|
987
|
+
block = {
|
|
988
|
+
key,
|
|
989
|
+
fold: marker[1] === ">",
|
|
990
|
+
indent
|
|
991
|
+
};
|
|
992
|
+
current = key;
|
|
993
|
+
continue;
|
|
994
|
+
}
|
|
995
|
+
scalars[key] = unquote(raw);
|
|
996
|
+
current = key;
|
|
997
|
+
}
|
|
998
|
+
const code = scalars["code"];
|
|
999
|
+
const message = scalars["message"];
|
|
1000
|
+
if (code === void 0 || code === "") return void 0;
|
|
1001
|
+
const exitCode = scalars["exitCode"];
|
|
1002
|
+
return {
|
|
1003
|
+
code,
|
|
1004
|
+
message: message ?? code,
|
|
1005
|
+
...scalars["help"] === void 0 || scalars["help"] === "" ? {} : { help: scalars["help"] },
|
|
1006
|
+
...exitCode === void 0 || Number.isNaN(Number(exitCode)) ? {} : { exitCode: Number(exitCode) }
|
|
1007
|
+
};
|
|
1008
|
+
}
|
|
1009
|
+
function helpUrlOf(envelope) {
|
|
1010
|
+
return /https?:\/\/[^\s"'`]+/.exec(envelope.help ?? "")?.[0];
|
|
1011
|
+
}
|
|
1012
|
+
//#endregion
|
|
1013
|
+
//#region ../shared/dist/host/data-root.js
|
|
1014
|
+
function dshHome() {
|
|
1015
|
+
const configured = process.env.DSH_HOME?.trim();
|
|
1016
|
+
if (configured !== void 0 && configured !== "") return configured;
|
|
1017
|
+
return `${process.env.HOME ?? ""}/.dsh`;
|
|
1018
|
+
}
|
|
1019
|
+
function workbenchRoot() {
|
|
1020
|
+
return `${dshHome()}/workbench`;
|
|
1021
|
+
}
|
|
1022
|
+
function workspacesRoot() {
|
|
1023
|
+
return `${workbenchRoot()}/workspaces`;
|
|
1024
|
+
}
|
|
1025
|
+
//#endregion
|
|
1026
1026
|
//#region ../shared/dist/host/facts.js
|
|
1027
1027
|
function createFactLog(options = {}) {
|
|
1028
1028
|
const epoch = options.epoch ?? `e${Date.now().toString(36)}${Math.random().toString(36).slice(2, 8)}`;
|
|
@@ -5,7 +5,6 @@ import * as apiModule from '@dsh-workbench/shared';
|
|
|
5
5
|
import * as chipsModule from '../shared/api/context-chips';
|
|
6
6
|
import * as apiResourceModule from '../shared/hooks/use-api-resource';
|
|
7
7
|
import * as cardSummaryModule from '../shared/hooks/use-card-summary';
|
|
8
|
-
import * as fixturePickModule from '../shared/hooks/use-fixture-pick';
|
|
9
8
|
import * as hostWriteModule from '../shared/hooks/use-host-write';
|
|
10
9
|
import * as longTaskModule from '../shared/hooks/use-long-task';
|
|
11
10
|
import * as capabilityGateModule from '../shared/hooks/use-capability-gate';
|
|
@@ -23,8 +22,6 @@ export declare const kit: {
|
|
|
23
22
|
readonly fixture?: apiModule.CapabilityPayload | undefined;
|
|
24
23
|
}): capabilityGateModule.CapabilityGate;
|
|
25
24
|
useCapabilityMap(refreshToken: number): capabilityGateModule.CapabilityMapView;
|
|
26
|
-
mockModeOn(search: string): boolean;
|
|
27
|
-
crashModeOn(search: string): boolean;
|
|
28
25
|
useLongTask<T extends {
|
|
29
26
|
readonly id: string;
|
|
30
27
|
readonly status: apiModule.LongTaskStatus;
|
|
@@ -39,7 +36,6 @@ export declare const kit: {
|
|
|
39
36
|
useFactRevision(fact: string): number;
|
|
40
37
|
subscribeFactRevision(fact: string, listener: () => void): () => void;
|
|
41
38
|
useFactInvalidate(): (fact?: string) => void;
|
|
42
|
-
useFixturePick<T extends fixturePickModule.PickableFixture>(options: fixturePickModule.FixturePickOptions<T>): fixturePickModule.FixturePick<T>;
|
|
43
39
|
useCardSummary(onSummary: (summary: cardSummaryModule.CardSummary) => void, summary: {
|
|
44
40
|
readonly refreshing: boolean;
|
|
45
41
|
readonly at: number | null | undefined;
|
|
@@ -92,13 +88,13 @@ export declare const kit: {
|
|
|
92
88
|
gateOf(capability: apiModule.CapabilityPayload | null, mode: apiModule.GateMode): apiModule.UnitGate;
|
|
93
89
|
splitBlocker(candidates: readonly (apiModule.ModuleBlocker | undefined)[]): apiModule.UnitBlockers;
|
|
94
90
|
probeKeyOf(error: apiModule.ApiError | undefined): string | null;
|
|
95
|
-
hasEnvSupply(manifest: apiModule.UnitManifest): boolean;
|
|
96
91
|
declarationProblemsOf(subject: string, raw: unknown): readonly string[];
|
|
97
92
|
readDeclaration(subject: string, raw: unknown): apiModule.DeclarationRead;
|
|
98
93
|
WORKBENCH_API_VERSION: 1;
|
|
99
94
|
SUPPORTED_API_VERSIONS: readonly number[];
|
|
100
95
|
DECLARATION_KEYS: readonly string[];
|
|
101
96
|
DECLARATION_REQUIRED_KEYS: readonly string[];
|
|
97
|
+
hasEnvSupply(manifest: apiModule.UnitManifest): boolean;
|
|
102
98
|
apiGet<T>(route: string, query?: apiModule.Query, options?: apiModule.ApiGetOptions): Promise<apiModule.ApiResponse<T>>;
|
|
103
99
|
apiPost<T>(route: string, body: Record<string, unknown>): Promise<apiModule.ApiResponse<T>>;
|
|
104
100
|
ActivityBlock({ head, children }: apiModule.ActivityBlockProps): JSX.Element;
|
|
@@ -113,21 +109,11 @@ export declare const kit: {
|
|
|
113
109
|
CardBoundary: typeof apiModule.CardBoundary;
|
|
114
110
|
CardHead({ t, title, meta, refreshing, onRefresh, gear, gearOpen, onToggleGear, platformHref, platform, platformTitle, }: apiModule.CardHeadProps): JSX.Element;
|
|
115
111
|
ChoiceGroup(props: apiModule.ChoiceGroupProps): JSX.Element;
|
|
112
|
+
Field({ label, hint, children }: apiModule.FieldProps): JSX.Element;
|
|
113
|
+
FormRows({ children }: apiModule.FormRowsProps): JSX.Element;
|
|
114
|
+
FormRow({ label, hint, problem, layout, children }: apiModule.FormRowProps): JSX.Element;
|
|
115
|
+
Link({ href, children, title, external, className }: apiModule.LinkProps): JSX.Element;
|
|
116
116
|
LongTaskRow(props: apiModule.LongTaskRowProps): JSX.Element;
|
|
117
|
-
MockStrip({ mocks, index, onPick, note, real, }: {
|
|
118
|
-
readonly mocks: readonly {
|
|
119
|
-
readonly id: string;
|
|
120
|
-
readonly label: string;
|
|
121
|
-
}[];
|
|
122
|
-
readonly index: number;
|
|
123
|
-
readonly onPick: (next: number) => void;
|
|
124
|
-
readonly note?: string;
|
|
125
|
-
readonly real?: {
|
|
126
|
-
readonly label: string;
|
|
127
|
-
readonly active: boolean;
|
|
128
|
-
readonly onPick: () => void;
|
|
129
|
-
} | undefined;
|
|
130
|
-
}): JSX.Element;
|
|
131
117
|
Note({ tone, as, role, children }: apiModule.NoteProps): JSX.Element;
|
|
132
118
|
SkeletonRows({ rows }: {
|
|
133
119
|
rows?: number;
|
|
@@ -141,7 +127,6 @@ export declare const kit: {
|
|
|
141
127
|
Rows({ children }: apiModule.RowsProps): JSX.Element;
|
|
142
128
|
Row({ label, value }: apiModule.RowProps): JSX.Element;
|
|
143
129
|
SaveBar({ busy, disabled, labels, onCancel, onSave }: apiModule.SaveBarProps): JSX.Element;
|
|
144
|
-
SettingsSection({ label, title, action, children }: apiModule.SettingsSectionProps): JSX.Element;
|
|
145
130
|
searchTextOf(option: apiModule.SelectFieldOption): string;
|
|
146
131
|
defaultSelectFilter(option: apiModule.SelectFieldOption, query: string): boolean;
|
|
147
132
|
filterSelectOptions(options: readonly apiModule.SelectFieldOption[], query: string, filter?: (option: apiModule.SelectFieldOption, query: string) => boolean): readonly apiModule.SelectFieldOption[];
|
|
@@ -149,11 +134,11 @@ export declare const kit: {
|
|
|
149
134
|
stepSelectCursor(shown: readonly apiModule.SelectFieldOption[], cursor: number | null, step: 1 | -1): number | null;
|
|
150
135
|
selectEntries(shown: readonly apiModule.SelectFieldOption[], emptyText: string | undefined): readonly import("@deepseek-ai/dsh-client-ui-primitives").MenuEntry[];
|
|
151
136
|
SelectField(props: apiModule.SelectFieldProps): apiModule.ReactNode;
|
|
137
|
+
SettingsSection({ label, title, action, children }: apiModule.SettingsSectionProps): JSX.Element;
|
|
138
|
+
Spinner({ size, label }: apiModule.SpinnerProps): JSX.Element;
|
|
152
139
|
Stack({ children }: apiModule.StackProps): JSX.Element;
|
|
153
140
|
StateBlock({ title, dot, hint, actions, resolving, children }: apiModule.StateBlockProps): JSX.Element;
|
|
154
141
|
TextField({ invalid, className, ...rest }: apiModule.TextFieldProps): JSX.Element;
|
|
155
|
-
Field({ label, hint, children }: apiModule.FieldProps): JSX.Element;
|
|
156
|
-
Link({ href, children, title, external, className }: apiModule.LinkProps): JSX.Element;
|
|
157
142
|
IconConversation({ size }: apiModule.IconProps): JSX.Element;
|
|
158
143
|
IconBrandMark({ size }: apiModule.IconProps): JSX.Element;
|
|
159
144
|
IconOpencli({ size }: apiModule.IconProps): JSX.Element;
|
|
@@ -1007,6 +992,8 @@ export declare const kit: {
|
|
|
1007
992
|
blockerPending(busy: boolean, running: string | null): boolean;
|
|
1008
993
|
blockerActionLabel(action: apiModule.BlockerActionShape, state: apiModule.BlockerLabelState, t: apiModule.BlockerLabelTranslate): string;
|
|
1009
994
|
holdBusy(since: number | null, now: number, floorMs: number): apiModule.BusyHold;
|
|
995
|
+
firstProblemOf(root: ParentNode): Element | null;
|
|
996
|
+
revealFirstProblem(root: ParentNode): boolean;
|
|
1010
997
|
parseCardsReport(payload: unknown): apiModule.PanelParse<apiModule.PanelCardsReport>;
|
|
1011
998
|
parseCrashReport(payload: unknown): apiModule.PanelParse<apiModule.PanelCrashReport>;
|
|
1012
999
|
createPanelStateStore(): apiModule.PanelStateStore;
|
|
@@ -1079,13 +1066,13 @@ export declare const kit: {
|
|
|
1079
1066
|
gateOf(capability: apiModule.CapabilityPayload | null, mode: apiModule.GateMode): apiModule.UnitGate;
|
|
1080
1067
|
splitBlocker(candidates: readonly (apiModule.ModuleBlocker | undefined)[]): apiModule.UnitBlockers;
|
|
1081
1068
|
probeKeyOf(error: apiModule.ApiError | undefined): string | null;
|
|
1082
|
-
hasEnvSupply(manifest: apiModule.UnitManifest): boolean;
|
|
1083
1069
|
declarationProblemsOf(subject: string, raw: unknown): readonly string[];
|
|
1084
1070
|
readDeclaration(subject: string, raw: unknown): apiModule.DeclarationRead;
|
|
1085
1071
|
WORKBENCH_API_VERSION: 1;
|
|
1086
1072
|
SUPPORTED_API_VERSIONS: readonly number[];
|
|
1087
1073
|
DECLARATION_KEYS: readonly string[];
|
|
1088
1074
|
DECLARATION_REQUIRED_KEYS: readonly string[];
|
|
1075
|
+
hasEnvSupply(manifest: apiModule.UnitManifest): boolean;
|
|
1089
1076
|
apiGet<T>(route: string, query?: apiModule.Query, options?: apiModule.ApiGetOptions): Promise<apiModule.ApiResponse<T>>;
|
|
1090
1077
|
apiPost<T>(route: string, body: Record<string, unknown>): Promise<apiModule.ApiResponse<T>>;
|
|
1091
1078
|
ActivityBlock({ head, children }: apiModule.ActivityBlockProps): JSX.Element;
|
|
@@ -1100,21 +1087,11 @@ export declare const kit: {
|
|
|
1100
1087
|
CardBoundary: typeof apiModule.CardBoundary;
|
|
1101
1088
|
CardHead({ t, title, meta, refreshing, onRefresh, gear, gearOpen, onToggleGear, platformHref, platform, platformTitle, }: apiModule.CardHeadProps): JSX.Element;
|
|
1102
1089
|
ChoiceGroup(props: apiModule.ChoiceGroupProps): JSX.Element;
|
|
1090
|
+
Field({ label, hint, children }: apiModule.FieldProps): JSX.Element;
|
|
1091
|
+
FormRows({ children }: apiModule.FormRowsProps): JSX.Element;
|
|
1092
|
+
FormRow({ label, hint, problem, layout, children }: apiModule.FormRowProps): JSX.Element;
|
|
1093
|
+
Link({ href, children, title, external, className }: apiModule.LinkProps): JSX.Element;
|
|
1103
1094
|
LongTaskRow(props: apiModule.LongTaskRowProps): JSX.Element;
|
|
1104
|
-
MockStrip({ mocks, index, onPick, note, real, }: {
|
|
1105
|
-
readonly mocks: readonly {
|
|
1106
|
-
readonly id: string;
|
|
1107
|
-
readonly label: string;
|
|
1108
|
-
}[];
|
|
1109
|
-
readonly index: number;
|
|
1110
|
-
readonly onPick: (next: number) => void;
|
|
1111
|
-
readonly note?: string;
|
|
1112
|
-
readonly real?: {
|
|
1113
|
-
readonly label: string;
|
|
1114
|
-
readonly active: boolean;
|
|
1115
|
-
readonly onPick: () => void;
|
|
1116
|
-
} | undefined;
|
|
1117
|
-
}): JSX.Element;
|
|
1118
1095
|
Note({ tone, as, role, children }: apiModule.NoteProps): JSX.Element;
|
|
1119
1096
|
SkeletonRows({ rows }: {
|
|
1120
1097
|
rows?: number;
|
|
@@ -1128,7 +1105,6 @@ export declare const kit: {
|
|
|
1128
1105
|
Rows({ children }: apiModule.RowsProps): JSX.Element;
|
|
1129
1106
|
Row({ label, value }: apiModule.RowProps): JSX.Element;
|
|
1130
1107
|
SaveBar({ busy, disabled, labels, onCancel, onSave }: apiModule.SaveBarProps): JSX.Element;
|
|
1131
|
-
SettingsSection({ label, title, action, children }: apiModule.SettingsSectionProps): JSX.Element;
|
|
1132
1108
|
searchTextOf(option: apiModule.SelectFieldOption): string;
|
|
1133
1109
|
defaultSelectFilter(option: apiModule.SelectFieldOption, query: string): boolean;
|
|
1134
1110
|
filterSelectOptions(options: readonly apiModule.SelectFieldOption[], query: string, filter?: (option: apiModule.SelectFieldOption, query: string) => boolean): readonly apiModule.SelectFieldOption[];
|
|
@@ -1136,11 +1112,11 @@ export declare const kit: {
|
|
|
1136
1112
|
stepSelectCursor(shown: readonly apiModule.SelectFieldOption[], cursor: number | null, step: 1 | -1): number | null;
|
|
1137
1113
|
selectEntries(shown: readonly apiModule.SelectFieldOption[], emptyText: string | undefined): readonly import("@deepseek-ai/dsh-client-ui-primitives").MenuEntry[];
|
|
1138
1114
|
SelectField(props: apiModule.SelectFieldProps): apiModule.ReactNode;
|
|
1115
|
+
SettingsSection({ label, title, action, children }: apiModule.SettingsSectionProps): JSX.Element;
|
|
1116
|
+
Spinner({ size, label }: apiModule.SpinnerProps): JSX.Element;
|
|
1139
1117
|
Stack({ children }: apiModule.StackProps): JSX.Element;
|
|
1140
1118
|
StateBlock({ title, dot, hint, actions, resolving, children }: apiModule.StateBlockProps): JSX.Element;
|
|
1141
1119
|
TextField({ invalid, className, ...rest }: apiModule.TextFieldProps): JSX.Element;
|
|
1142
|
-
Field({ label, hint, children }: apiModule.FieldProps): JSX.Element;
|
|
1143
|
-
Link({ href, children, title, external, className }: apiModule.LinkProps): JSX.Element;
|
|
1144
1120
|
IconConversation({ size }: apiModule.IconProps): JSX.Element;
|
|
1145
1121
|
IconBrandMark({ size }: apiModule.IconProps): JSX.Element;
|
|
1146
1122
|
IconOpencli({ size }: apiModule.IconProps): JSX.Element;
|
|
@@ -1994,6 +1970,8 @@ export declare const kit: {
|
|
|
1994
1970
|
blockerPending(busy: boolean, running: string | null): boolean;
|
|
1995
1971
|
blockerActionLabel(action: apiModule.BlockerActionShape, state: apiModule.BlockerLabelState, t: apiModule.BlockerLabelTranslate): string;
|
|
1996
1972
|
holdBusy(since: number | null, now: number, floorMs: number): apiModule.BusyHold;
|
|
1973
|
+
firstProblemOf(root: ParentNode): Element | null;
|
|
1974
|
+
revealFirstProblem(root: ParentNode): boolean;
|
|
1997
1975
|
parseCardsReport(payload: unknown): apiModule.PanelParse<apiModule.PanelCardsReport>;
|
|
1998
1976
|
parseCrashReport(payload: unknown): apiModule.PanelParse<apiModule.PanelCrashReport>;
|
|
1999
1977
|
createPanelStateStore(): apiModule.PanelStateStore;
|
|
@@ -2061,13 +2039,13 @@ export declare const kit: {
|
|
|
2061
2039
|
gateOf(capability: apiModule.CapabilityPayload | null, mode: apiModule.GateMode): apiModule.UnitGate;
|
|
2062
2040
|
splitBlocker(candidates: readonly (apiModule.ModuleBlocker | undefined)[]): apiModule.UnitBlockers;
|
|
2063
2041
|
probeKeyOf(error: apiModule.ApiError | undefined): string | null;
|
|
2064
|
-
hasEnvSupply(manifest: apiModule.UnitManifest): boolean;
|
|
2065
2042
|
declarationProblemsOf(subject: string, raw: unknown): readonly string[];
|
|
2066
2043
|
readDeclaration(subject: string, raw: unknown): apiModule.DeclarationRead;
|
|
2067
2044
|
WORKBENCH_API_VERSION: 1;
|
|
2068
2045
|
SUPPORTED_API_VERSIONS: readonly number[];
|
|
2069
2046
|
DECLARATION_KEYS: readonly string[];
|
|
2070
2047
|
DECLARATION_REQUIRED_KEYS: readonly string[];
|
|
2048
|
+
hasEnvSupply(manifest: apiModule.UnitManifest): boolean;
|
|
2071
2049
|
apiGet<T>(route: string, query?: apiModule.Query, options?: apiModule.ApiGetOptions): Promise<apiModule.ApiResponse<T>>;
|
|
2072
2050
|
apiPost<T>(route: string, body: Record<string, unknown>): Promise<apiModule.ApiResponse<T>>;
|
|
2073
2051
|
ActivityBlock({ head, children }: apiModule.ActivityBlockProps): JSX.Element;
|
|
@@ -2082,21 +2060,11 @@ export declare const kit: {
|
|
|
2082
2060
|
CardBoundary: typeof apiModule.CardBoundary;
|
|
2083
2061
|
CardHead({ t, title, meta, refreshing, onRefresh, gear, gearOpen, onToggleGear, platformHref, platform, platformTitle, }: apiModule.CardHeadProps): JSX.Element;
|
|
2084
2062
|
ChoiceGroup(props: apiModule.ChoiceGroupProps): JSX.Element;
|
|
2063
|
+
Field({ label, hint, children }: apiModule.FieldProps): JSX.Element;
|
|
2064
|
+
FormRows({ children }: apiModule.FormRowsProps): JSX.Element;
|
|
2065
|
+
FormRow({ label, hint, problem, layout, children }: apiModule.FormRowProps): JSX.Element;
|
|
2066
|
+
Link({ href, children, title, external, className }: apiModule.LinkProps): JSX.Element;
|
|
2085
2067
|
LongTaskRow(props: apiModule.LongTaskRowProps): JSX.Element;
|
|
2086
|
-
MockStrip({ mocks, index, onPick, note, real, }: {
|
|
2087
|
-
readonly mocks: readonly {
|
|
2088
|
-
readonly id: string;
|
|
2089
|
-
readonly label: string;
|
|
2090
|
-
}[];
|
|
2091
|
-
readonly index: number;
|
|
2092
|
-
readonly onPick: (next: number) => void;
|
|
2093
|
-
readonly note?: string;
|
|
2094
|
-
readonly real?: {
|
|
2095
|
-
readonly label: string;
|
|
2096
|
-
readonly active: boolean;
|
|
2097
|
-
readonly onPick: () => void;
|
|
2098
|
-
} | undefined;
|
|
2099
|
-
}): JSX.Element;
|
|
2100
2068
|
Note({ tone, as, role, children }: apiModule.NoteProps): JSX.Element;
|
|
2101
2069
|
SkeletonRows({ rows }: {
|
|
2102
2070
|
rows?: number;
|
|
@@ -2110,7 +2078,6 @@ export declare const kit: {
|
|
|
2110
2078
|
Rows({ children }: apiModule.RowsProps): JSX.Element;
|
|
2111
2079
|
Row({ label, value }: apiModule.RowProps): JSX.Element;
|
|
2112
2080
|
SaveBar({ busy, disabled, labels, onCancel, onSave }: apiModule.SaveBarProps): JSX.Element;
|
|
2113
|
-
SettingsSection({ label, title, action, children }: apiModule.SettingsSectionProps): JSX.Element;
|
|
2114
2081
|
searchTextOf(option: apiModule.SelectFieldOption): string;
|
|
2115
2082
|
defaultSelectFilter(option: apiModule.SelectFieldOption, query: string): boolean;
|
|
2116
2083
|
filterSelectOptions(options: readonly apiModule.SelectFieldOption[], query: string, filter?: (option: apiModule.SelectFieldOption, query: string) => boolean): readonly apiModule.SelectFieldOption[];
|
|
@@ -2118,11 +2085,11 @@ export declare const kit: {
|
|
|
2118
2085
|
stepSelectCursor(shown: readonly apiModule.SelectFieldOption[], cursor: number | null, step: 1 | -1): number | null;
|
|
2119
2086
|
selectEntries(shown: readonly apiModule.SelectFieldOption[], emptyText: string | undefined): readonly import("@deepseek-ai/dsh-client-ui-primitives").MenuEntry[];
|
|
2120
2087
|
SelectField(props: apiModule.SelectFieldProps): apiModule.ReactNode;
|
|
2088
|
+
SettingsSection({ label, title, action, children }: apiModule.SettingsSectionProps): JSX.Element;
|
|
2089
|
+
Spinner({ size, label }: apiModule.SpinnerProps): JSX.Element;
|
|
2121
2090
|
Stack({ children }: apiModule.StackProps): JSX.Element;
|
|
2122
2091
|
StateBlock({ title, dot, hint, actions, resolving, children }: apiModule.StateBlockProps): JSX.Element;
|
|
2123
2092
|
TextField({ invalid, className, ...rest }: apiModule.TextFieldProps): JSX.Element;
|
|
2124
|
-
Field({ label, hint, children }: apiModule.FieldProps): JSX.Element;
|
|
2125
|
-
Link({ href, children, title, external, className }: apiModule.LinkProps): JSX.Element;
|
|
2126
2093
|
IconConversation({ size }: apiModule.IconProps): JSX.Element;
|
|
2127
2094
|
IconBrandMark({ size }: apiModule.IconProps): JSX.Element;
|
|
2128
2095
|
IconOpencli({ size }: apiModule.IconProps): JSX.Element;
|
|
@@ -2976,6 +2943,8 @@ export declare const kit: {
|
|
|
2976
2943
|
blockerPending(busy: boolean, running: string | null): boolean;
|
|
2977
2944
|
blockerActionLabel(action: apiModule.BlockerActionShape, state: apiModule.BlockerLabelState, t: apiModule.BlockerLabelTranslate): string;
|
|
2978
2945
|
holdBusy(since: number | null, now: number, floorMs: number): apiModule.BusyHold;
|
|
2946
|
+
firstProblemOf(root: ParentNode): Element | null;
|
|
2947
|
+
revealFirstProblem(root: ParentNode): boolean;
|
|
2979
2948
|
parseCardsReport(payload: unknown): apiModule.PanelParse<apiModule.PanelCardsReport>;
|
|
2980
2949
|
parseCrashReport(payload: unknown): apiModule.PanelParse<apiModule.PanelCrashReport>;
|
|
2981
2950
|
createPanelStateStore(): apiModule.PanelStateStore;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
import type { BoardModule } from '@dsh-workbench/shared';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} | {
|
|
5
|
-
readonly kind: 'empty';
|
|
6
|
-
} | {
|
|
7
|
-
readonly kind: 'unread';
|
|
8
|
-
} | {
|
|
9
|
-
readonly kind: 'kit';
|
|
10
|
-
} | {
|
|
11
|
-
readonly kind: 'all';
|
|
12
|
-
} | {
|
|
13
|
-
readonly kind: 'copies';
|
|
14
|
-
readonly count: number;
|
|
15
|
-
};
|
|
2
|
+
import type { BoardShape } from './board-shape';
|
|
3
|
+
export type { BoardShape };
|
|
16
4
|
export interface RealBoard {
|
|
17
5
|
readonly modules: readonly BoardModule[];
|
|
18
6
|
readonly configRead: boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type BoardShape = {
|
|
2
|
+
readonly kind: 'real';
|
|
3
|
+
} | {
|
|
4
|
+
readonly kind: 'empty';
|
|
5
|
+
} | {
|
|
6
|
+
readonly kind: 'unread';
|
|
7
|
+
} | {
|
|
8
|
+
readonly kind: 'kit';
|
|
9
|
+
} | {
|
|
10
|
+
readonly kind: 'all';
|
|
11
|
+
} | {
|
|
12
|
+
readonly kind: 'copies';
|
|
13
|
+
readonly count: number;
|
|
14
|
+
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { ReactNode } from '@dsh-workbench/shared';
|
|
2
|
+
export declare function KitNavProvider({ children }: {
|
|
3
|
+
readonly children?: ReactNode;
|
|
4
|
+
}): JSX.Element;
|
|
5
|
+
export declare function KitNav(): JSX.Element | null;
|
|
2
6
|
export declare function Section({ title, note, children, }: {
|
|
3
7
|
readonly title: string;
|
|
4
8
|
readonly note?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function hashTargetsSection(anchor: string, hash: string): boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare function RowsSection(): JSX.Element;
|
|
2
|
+
export declare function FormSection(): JSX.Element;
|
|
2
3
|
export declare function ActivitySection(): JSX.Element;
|
|
3
4
|
export declare function LongTaskSection(): JSX.Element;
|
|
4
5
|
export declare function IconSection(): JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import '@/shared/styles/mock-strip.css';
|
|
2
|
+
export declare function MockStrip({ mocks, index, onPick, note, real, }: {
|
|
3
|
+
readonly mocks: readonly {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly label: string;
|
|
6
|
+
}[];
|
|
7
|
+
readonly index: number;
|
|
8
|
+
readonly onPick: (next: number) => void;
|
|
9
|
+
readonly note?: string;
|
|
10
|
+
readonly real?: {
|
|
11
|
+
readonly label: string;
|
|
12
|
+
readonly active: boolean;
|
|
13
|
+
readonly onPick: () => void;
|
|
14
|
+
} | undefined;
|
|
15
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BoardModule, UnitManifest } from '@dsh-workbench/shared';
|
|
3
|
+
import type { PreflightSnapshot } from '../shared/api/host/preflight';
|
|
4
|
+
import type { BoardShape } from '../app/layouts/rightbar/board-shape';
|
|
5
|
+
import type { AddModuleMock } from '../app/layouts/market/add-module-mock';
|
|
6
|
+
import type { AddModuleState } from '../app/layouts/market/use-add-module';
|
|
7
|
+
export interface DevPickable {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly label: string;
|
|
10
|
+
}
|
|
11
|
+
export interface DevPickOptions<T extends DevPickable> {
|
|
12
|
+
readonly fixtures: readonly T[];
|
|
13
|
+
readonly selected?: string | null | undefined;
|
|
14
|
+
readonly onSelect?: ((id: string | null) => void) | undefined;
|
|
15
|
+
readonly enabled?: boolean | undefined;
|
|
16
|
+
readonly initial?: string | null | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface DevPick<T extends DevPickable> {
|
|
19
|
+
readonly enabled: boolean;
|
|
20
|
+
readonly active: string | null;
|
|
21
|
+
readonly current: T | undefined;
|
|
22
|
+
readonly nonce: number;
|
|
23
|
+
readonly index: number;
|
|
24
|
+
pick(id: string | null): void;
|
|
25
|
+
}
|
|
26
|
+
export interface DevStrips<T extends DevPickable> {
|
|
27
|
+
readonly pick: DevPick<T>;
|
|
28
|
+
readonly current: T | undefined;
|
|
29
|
+
readonly enabled: boolean;
|
|
30
|
+
readonly strip: ReactNode;
|
|
31
|
+
}
|
|
32
|
+
export interface DevBoard {
|
|
33
|
+
readonly shape: BoardShape;
|
|
34
|
+
readonly seed: readonly BoardModule[];
|
|
35
|
+
readonly strip: (show: boolean) => ReactNode;
|
|
36
|
+
readonly mode: boolean;
|
|
37
|
+
}
|
|
38
|
+
export type DevStripSite = 'panel' | 'market' | 'addModule';
|
|
39
|
+
export interface DevSurface {
|
|
40
|
+
on(search: string): boolean;
|
|
41
|
+
crash(search: string): boolean;
|
|
42
|
+
useBoard(input: {
|
|
43
|
+
readonly manifests: readonly UnitManifest[];
|
|
44
|
+
readonly all: readonly BoardModule[];
|
|
45
|
+
readonly search: string;
|
|
46
|
+
}): DevBoard;
|
|
47
|
+
useStrips<T extends DevPickable>(site: DevStripSite, manifests: readonly UnitManifest[]): DevStrips<T>;
|
|
48
|
+
addModuleState(base: AddModuleState, mock: AddModuleMock): AddModuleState;
|
|
49
|
+
gateStrip(options: {
|
|
50
|
+
readonly onPick: (snapshot: PreflightSnapshot | null) => void;
|
|
51
|
+
}): HTMLElement | null;
|
|
52
|
+
readonly kitModule: BoardModule | null;
|
|
53
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-workbench/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.13",
|
|
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.
|
|
90
|
+
"@dsh-workbench/shared": "0.2.13"
|
|
91
91
|
},
|
|
92
92
|
"scripts": {
|
|
93
93
|
"build": "node scripts/build.mjs && node scripts/build-types.mjs",
|
|
@@ -119,4 +119,4 @@
|
|
|
119
119
|
|
|
120
120
|
- 数据源写在**宿主半侧**,卡片只消费它的返回;
|
|
121
121
|
- 只读路由出错时回 `{ ok: false, error: { code, message, hint? } }`(HTTP 仍是 200,外壳原样转发);
|
|
122
|
-
- 验收时把「正常 / 空 / 出错」三条路都走一遍 ——
|
|
122
|
+
- 验收时把「正常 / 空 / 出错」三条路都走一遍 —— 真机上造不出来的那几条,写清**怎么才能真看到**(换个空目录、换个不存在的路径那种),别为它写夹具(**2026-10-16 起模板与指引都不带评审夹具**)。
|