@dsh-workbench/core 0.3.2 → 0.3.4

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 (68) hide show
  1. package/client.js +689 -149
  2. package/cordis.patch.yml +32 -0
  3. package/dist/client/client.body.js +689 -149
  4. package/dist/client/index.js +689 -149
  5. package/dist/host/index.js +3638 -2104
  6. package/dist/types/app/client.d.ts +120 -3
  7. package/dist/types/app/layouts/approval-detail.d.ts +13 -0
  8. package/dist/types/app/layouts/panel-hint.d.ts +3 -0
  9. package/dist/types/app/layouts/rightbar/market-hint.d.ts +16 -0
  10. package/dist/types/app/layouts/rightbar/market-rows.d.ts +2 -3
  11. package/dist/types/app/layouts/sidebar/RecordFooterAction.d.ts +16 -0
  12. package/dist/types/app/layouts/sidebar/record-footer.d.ts +4 -0
  13. package/dist/types/modules/panels/client.d.ts +1 -0
  14. package/dist/types/modules/panels/model/diy-browser-act.d.ts +2 -39
  15. package/dist/types/modules/panels/model/diy-browser-tools.d.ts +39 -0
  16. package/dist/types/modules/panels/model/diy-browser.d.ts +1 -14
  17. package/dist/types/modules/panels/model/diy-components.d.ts +3 -0
  18. package/dist/types/modules/panels/model/diy-components.test.d.ts +1 -0
  19. package/dist/types/modules/panels/model/diy-observers.d.ts +11 -0
  20. package/dist/types/modules/panels/model/diy-observers.test.d.ts +1 -0
  21. package/dist/types/modules/panels/model/diy-page.d.ts +1 -0
  22. package/dist/types/modules/panels/model/diy-record-bar.test.d.ts +1 -0
  23. package/dist/types/modules/panels/model/diy-record-capture.d.ts +27 -0
  24. package/dist/types/modules/panels/model/diy-record-capture.test.d.ts +1 -0
  25. package/dist/types/modules/panels/model/diy-record-failure.test.d.ts +1 -0
  26. package/dist/types/modules/panels/model/diy-record-routes.d.ts +2 -0
  27. package/dist/types/modules/panels/model/diy-record-routes.test.d.ts +1 -0
  28. package/dist/types/modules/panels/model/diy-record-scripts.d.ts +6 -0
  29. package/dist/types/modules/panels/model/diy-record-text.d.ts +89 -0
  30. package/dist/types/modules/panels/model/diy-record-text.test.d.ts +1 -0
  31. package/dist/types/modules/panels/model/diy-record-tools.d.ts +2 -0
  32. package/dist/types/modules/panels/model/diy-record.d.ts +76 -0
  33. package/dist/types/modules/panels/model/diy-record.test.d.ts +1 -0
  34. package/dist/types/modules/panels/model/diy-scripts.d.ts +0 -63
  35. package/dist/types/modules/panels/model/diy-spec.d.ts +5 -0
  36. package/dist/types/modules/panels/model/diy-spec.test.d.ts +1 -0
  37. package/dist/types/modules/panels/model/handoff.d.ts +1 -0
  38. package/dist/types/modules/panels/unit.d.ts +20 -12
  39. package/dist/types/shared/api/host/diy-acts.d.ts +4 -0
  40. package/dist/types/shared/api/host/diy-components.d.ts +54 -0
  41. package/dist/types/shared/api/host/diy-debug-act.d.ts +24 -7
  42. package/dist/types/shared/api/host/diy-recon.d.ts +10 -0
  43. package/dist/types/shared/api/host/diy-record-act.d.ts +19 -0
  44. package/dist/types/shared/api/host/diy-workshop.d.ts +1 -0
  45. package/dist/types/shared/api/host/mount-units.d.ts +4 -0
  46. package/dist/types/shared/hooks/use-diy-record.d.ts +8 -0
  47. package/package.json +3 -3
  48. package/scripts/seed-workshop.sh +42 -2
  49. package/skills/workbench-module-diy/BUILD.md +39 -17
  50. package/skills/workbench-module-diy/DATASOURCE.md +4 -1
  51. package/skills/workbench-module-diy/DESIGN.md +40 -8
  52. package/skills/workbench-module-diy/FAMILY.md +55 -0
  53. package/skills/workbench-module-diy/HOOKS.md +95 -0
  54. package/skills/workbench-module-diy/KIT.md +18 -6
  55. package/skills/workbench-module-diy/PANEL.md +9 -5
  56. package/skills/workbench-module-diy/REVIEW.md +117 -49
  57. package/skills/workbench-module-diy/SKILL.md +42 -9
  58. package/skills/workbench-module-diy/STEPS.md +1 -1
  59. package/skills/workbench-module-diy/TOOLING.md +10 -4
  60. package/skills/workbench-module-diy/TOOLS.md +56 -204
  61. package/skills/workbench-module-diy/WIRING.md +17 -8
  62. package/skills/workbench-module-diy/WRITES.md +131 -0
  63. package/dist/types/modules/panels/model/diy-act.d.ts +0 -4
  64. package/dist/types/modules/panels/model/diy-look.d.ts +0 -15
  65. package/dist/types/modules/panels/model/diy-net.d.ts +0 -3
  66. /package/dist/types/modules/panels/model/{diy-act.test.d.ts → diy-browser-act.test.d.ts} +0 -0
  67. /package/dist/types/modules/panels/model/{diy-look.test.d.ts → diy-browser-tools-shot.test.d.ts} +0 -0
  68. /package/dist/types/modules/panels/model/{diy-net.test.d.ts → diy-browser-tools.test.d.ts} +0 -0
@@ -0,0 +1,16 @@
1
+ import type { RecordIntent, RecordState, Translate } from '@dsh-workbench/shared';
2
+ export interface RecordFooterActionProps {
3
+ readonly wide?: boolean | undefined;
4
+ readonly t: Translate;
5
+ }
6
+ export interface RecordActView {
7
+ readonly intent: RecordIntent;
8
+ readonly label: string;
9
+ }
10
+ export interface RecordFooterView {
11
+ readonly label: string;
12
+ readonly note: string;
13
+ readonly acts: readonly RecordActView[];
14
+ }
15
+ export declare function recordFooterView(state: RecordState, t: Translate): RecordFooterView;
16
+ export declare function RecordFooterAction({ wide, t }: RecordFooterActionProps): JSX.Element | null;
@@ -0,0 +1,4 @@
1
+ import type { DshClientContext } from '@dsh-workbench/shared';
2
+ export declare const RECORD_FOOTER_ID = "workbench-record";
3
+ export declare const RECORD_FOOTER_ORDER = 11;
4
+ export declare function registerRecordFooter(ctx: DshClientContext): void;
@@ -0,0 +1 @@
1
+ export { ALL_TOOLS, DIY_RECORD_PREPARE_TOOL, DIY_RECORD_READ_TOOL } from './unit';
@@ -1,47 +1,10 @@
1
1
  import type { DshShell } from '@dsh-workbench/shared';
2
2
  import { type BrowserStep } from './diy-browser';
3
3
  export declare const ACT_TIMEOUT_MS = 15000;
4
- export interface ActTarget {
5
- readonly selector: string;
6
- readonly role: string;
7
- readonly name: string;
8
- readonly testid: string;
9
- readonly nth: number | null;
10
- readonly page: boolean;
11
- }
12
- export declare function actTargetOf(raw: Record<string, unknown>): ActTarget;
13
- export declare function scopedSelectorOf(unit: string, target: ActTarget): string;
14
- export declare const SCOPE_ATTR = "data-diy-scope";
15
- export declare function semanticOptionsOf(target: ActTarget): readonly string[];
16
- export declare function targetOptionsOf(target: ActTarget): readonly string[];
17
- export declare function refsOf(payload: Record<string, unknown> | undefined): readonly number[];
18
- export declare function totalMatchesOf(payload: Record<string, unknown> | undefined): number;
19
- export declare function scopeMarkScriptOf(unit: string, refs: readonly number[], nth: number, token: string): string;
20
- export declare function scopeClearScriptOf(token: string): string;
21
- export declare function scopedMarkerSelectorOf(unit: string, token: string): string;
22
4
  export interface ActStep extends BrowserStep {
23
5
  readonly payload: Record<string, unknown> | undefined;
24
6
  }
25
7
  export declare function actBrowser(shell: DshShell, command: string, session: string, argv: readonly string[], timeoutMs?: number): Promise<ActStep>;
26
8
  export declare function actErrorOf(step: ActStep): string;
27
- export declare function matchesOf(step: ActStep): number;
28
- export declare function scrollIntoView(shell: DshShell, command: string, session: string, unit: string, selector: string): Promise<ActStep>;
29
- export declare function reloadPage(shell: DshShell, command: string, session: string): Promise<ActStep>;
30
- export interface WidthShot {
31
- readonly ok: boolean;
32
- readonly file: string;
33
- readonly width: number;
34
- readonly height: number;
35
- readonly reason: string;
36
- }
37
- export declare function shootAtWidth(shell: DshShell, command: string, session: string, file: string, width?: number, height?: number): Promise<WidthShot>;
38
- export interface NetworkArm {
39
- readonly ok: boolean;
40
- readonly pid: string;
41
- readonly reason: string;
42
- }
43
- export declare const NET_CAP_LINES = 2000;
44
- export declare const NET_CAP_SECONDS = 900;
45
- export declare function armNetwork(shell: DshShell, command: string, session: string, file: string): Promise<NetworkArm>;
46
- export declare function stopNetwork(shell: DshShell, session: string, file: string): Promise<boolean>;
47
- export declare function readNetwork(shell: DshShell, file: string, lines: number): Promise<readonly Record<string, unknown>[]>;
9
+ export declare const SWEEP_TIMEOUT_MS = 4000;
10
+ export declare function stopNetworkExact(shell: DshShell, file: string, timeoutMs?: number): Promise<boolean>;
@@ -0,0 +1,39 @@
1
+ import type { DshHostContext, DshToolRegistry } from '@dsh-workbench/shared';
2
+ import { type PngRect } from '../../../shared/api/host/png-crop';
3
+ import { type PanelsToolName } from '../unit';
4
+ export declare const CARD_TOKEN = "$card";
5
+ export interface PngClip {
6
+ readonly x: number;
7
+ readonly y: number;
8
+ readonly width: number;
9
+ readonly height: number;
10
+ }
11
+ export type CssTarget = {
12
+ readonly kind: 'positional';
13
+ readonly at: number;
14
+ readonly onlyWhenFirst?: string | undefined;
15
+ } | {
16
+ readonly kind: 'flag';
17
+ readonly flag: string;
18
+ };
19
+ export interface BrowserToolRow {
20
+ readonly tool: PanelsToolName;
21
+ readonly verb: readonly string[];
22
+ readonly description: string;
23
+ readonly argsHelp: string;
24
+ readonly css?: CssTarget | undefined;
25
+ readonly evalInCard?: boolean | undefined;
26
+ readonly clip?: boolean | undefined;
27
+ }
28
+ export declare function cardSelectorIn(unit: string): string;
29
+ export declare function evalWrapped(script: string, card: string): string;
30
+ export declare function argvOf(row: BrowserToolRow, raw: Record<string, unknown>, unit: string): string[];
31
+ export declare function clipOf(value: unknown): PngClip | undefined;
32
+ export declare function deviceClipRect(clip: PngClip, dpr: number): PngRect;
33
+ export declare function clipNote(clip: PngClip, viewport: {
34
+ readonly width: number;
35
+ readonly height: number;
36
+ }): string;
37
+ export declare function defaultShotPath(packagesDir: string, unit: string, stamp: number): string;
38
+ export declare const BROWSER_TOOLS: readonly BrowserToolRow[];
39
+ export declare function registerBrowserTools(ctx: DshHostContext, tools: DshToolRegistry): readonly (() => void)[];
@@ -1,6 +1,4 @@
1
1
  import type { DshShell } from '@dsh-workbench/shared';
2
- import { type PngRect } from '../../../shared/api/host/png-crop';
3
- import { type CardView, type PickRequest } from './diy-scripts';
4
2
  export declare const LOOK_TIMEOUT_MS = 30000;
5
3
  export interface BrowserStep {
6
4
  readonly ok: boolean;
@@ -8,6 +6,7 @@ export interface BrowserStep {
8
6
  readonly stderr: string;
9
7
  readonly exitCode: number | null;
10
8
  readonly timedOut: boolean;
9
+ readonly truncated: boolean;
11
10
  }
12
11
  export declare function runBrowserStep(shell: DshShell, command: string, argv: readonly string[], timeoutMs?: number): Promise<BrowserStep>;
13
12
  export declare function jsonOf(raw: string): Record<string, unknown> | undefined;
@@ -37,15 +36,3 @@ export interface PageHandshake {
37
36
  readonly reason: string;
38
37
  }
39
38
  export declare function readyPageOf(shell: DshShell, command: string, session: string): Promise<PageHandshake>;
40
- export declare function measureCard(shell: DshShell, command: string, session: string, unit: string, pick: PickRequest): Promise<CardView>;
41
- export interface Shot {
42
- readonly ok: boolean;
43
- readonly file: string;
44
- readonly width: number;
45
- readonly height: number;
46
- readonly cropped: boolean;
47
- readonly reason: string;
48
- }
49
- export declare function insideViewportOf(view: CardView): boolean;
50
- export declare function deviceRectOf(view: CardView): PngRect;
51
- export declare function shootCard(shell: DshShell, command: string, session: string, unit: string, file: string, view: CardView): Promise<Shot>;
@@ -0,0 +1,3 @@
1
+ import type { DshHostContext, DshToolDefinition, DshToolRegistry } from '@dsh-workbench/shared';
2
+ export declare function componentsTool(ctx: DshHostContext): DshToolDefinition;
3
+ export declare function registerComponentsTool(ctx: DshHostContext, tools: DshToolRegistry): readonly (() => void)[];
@@ -0,0 +1,11 @@
1
+ import type { DshHostContext } from '@dsh-workbench/shared';
2
+ import type { DebugStore } from '@dsh-workbench/shared/host';
3
+ export interface ObserverCleanup {
4
+ readonly net: boolean;
5
+ readonly logs: boolean;
6
+ }
7
+ export interface CleanupLog {
8
+ warn?(message: string): void;
9
+ }
10
+ export declare function stopObservers(ctx: DshHostContext, session?: string): Promise<ObserverCleanup>;
11
+ export declare function withObserverCleanup(store: DebugStore, cleanup: () => Promise<ObserverCleanup>, logger?: CleanupLog | undefined): DebugStore;
@@ -21,6 +21,7 @@ export interface PageOptions {
21
21
  readonly requirePact?: boolean | undefined;
22
22
  }
23
23
  export declare function debugPausedText(held: DebugState): string;
24
+ export declare function debugMissingPactText(): string;
24
25
  export declare function debugForeignPactText(held: DebugState): string;
25
26
  export declare function debugOffBoardText(held: DebugState, situation?: BoardSituation): string;
26
27
  export declare function boardProbeOf(page: WorkbenchPage): BoardProbe;
@@ -0,0 +1,27 @@
1
+ import type { RecordCall } from './diy-record-text';
2
+ export declare const SEGMENT_SLACK_MS = 1500;
3
+ export interface CaptureEntry {
4
+ readonly key: string;
5
+ readonly at: number;
6
+ readonly method: string;
7
+ readonly url: string;
8
+ readonly status: number;
9
+ readonly ct: string;
10
+ readonly size: number;
11
+ readonly request: string;
12
+ readonly response: string;
13
+ readonly requestFullSize: number;
14
+ readonly responseFullSize: number;
15
+ readonly requestSizeExact: boolean;
16
+ readonly responseSizeExact: boolean;
17
+ readonly headers: string;
18
+ }
19
+ export declare function captureEntriesOf(text: string): readonly CaptureEntry[];
20
+ export declare function segmentOf(entries: readonly CaptureEntry[], t0: number | null, t1: number | null): {
21
+ readonly inside: readonly CaptureEntry[];
22
+ readonly outside: number;
23
+ };
24
+ export declare function captureCallsOf(entries: readonly CaptureEntry[]): readonly RecordCall[];
25
+ export declare function mergeCalls(hook: readonly RecordCall[], captured: readonly RecordCall[]): readonly RecordCall[];
26
+ export declare function pickAllOf(entries: readonly CaptureEntry[], key: string): readonly CaptureEntry[];
27
+ export declare function pickOf(entries: readonly CaptureEntry[], key: string, at?: number | null): CaptureEntry | null;
@@ -0,0 +1,2 @@
1
+ import type { RecordStore, RouteTable } from '@dsh-workbench/shared/host';
2
+ export declare function diyRecordRoutes(store: RecordStore): RouteTable;
@@ -0,0 +1,6 @@
1
+ export declare const RECORD_KEY = "__dshDiyRecord";
2
+ export declare const RECORD_KEEP_KEY = "__dshDiyRecordKeep";
3
+ export declare const RECORD_OFF_KEY = "__dshDiyRecordOff";
4
+ export declare const RECORD_ARM_SCRIPT: string;
5
+ export declare const RECORD_READ_SCRIPT: string;
6
+ export declare const RECORD_STOP_SCRIPT: string;
@@ -0,0 +1,89 @@
1
+ import type { RecordExpect, RecordMove, RecordRefusal, RecordState } from '@dsh-workbench/shared';
2
+ export interface RecordCall {
3
+ readonly key: string;
4
+ readonly method: string;
5
+ readonly url: string;
6
+ readonly body: string;
7
+ readonly status: number;
8
+ readonly ct: string;
9
+ readonly response: string;
10
+ readonly at: number;
11
+ readonly source: 'hook' | 'capture';
12
+ }
13
+ export interface RecordPageRead {
14
+ readonly ok: boolean;
15
+ readonly code: string;
16
+ readonly phase: string;
17
+ readonly t0: number | null;
18
+ readonly t1: number | null;
19
+ readonly href: string;
20
+ readonly here: string;
21
+ readonly dropped: number;
22
+ readonly unhooked: boolean;
23
+ readonly calls: readonly RecordCall[];
24
+ }
25
+ export declare function recordPageOf(payload: Record<string, unknown> | undefined): RecordPageRead;
26
+ export declare function filterTextOf(expect: RecordExpect | null): string;
27
+ export declare function probeCommandOf(calls: readonly RecordCall[]): string;
28
+ export declare function bodyMissingOf(calls: readonly RecordCall[]): boolean;
29
+ export declare function recordRefusalText(code: RecordRefusal, held?: RecordState): string;
30
+ export declare function recordMissingText(): string;
31
+ export declare function recordTalkOf(): string;
32
+ export interface RecordListRow {
33
+ readonly index: number;
34
+ readonly key: string;
35
+ readonly at: number;
36
+ readonly method: string;
37
+ readonly url: string;
38
+ readonly status: number;
39
+ readonly ct: string;
40
+ readonly size: number;
41
+ readonly source: 'hook' | 'capture';
42
+ readonly hasRequest: boolean;
43
+ readonly hasResponse: boolean;
44
+ readonly likelyWrite: boolean;
45
+ readonly marked: boolean;
46
+ }
47
+ export declare function listRowsOf(calls: readonly RecordCall[], expect: RecordExpect | null): readonly RecordListRow[];
48
+ export interface RecordReadFacts {
49
+ readonly phase: string;
50
+ readonly armed: boolean;
51
+ readonly hookCaught: number;
52
+ readonly rows: readonly RecordListRow[];
53
+ readonly merged: number;
54
+ readonly capturedLines: number;
55
+ readonly capturedInSegment: number;
56
+ readonly capturedOutside: number;
57
+ readonly capturedTotalLines: number;
58
+ readonly capturedTruncated: boolean;
59
+ readonly capturedTailLimit: number;
60
+ readonly dropped: number;
61
+ readonly nav: boolean;
62
+ readonly filter: string;
63
+ readonly captureRound: string;
64
+ }
65
+ export declare function renderRecordRead(input: RecordReadFacts): string;
66
+ export interface RecordDetailFacts {
67
+ readonly found: boolean;
68
+ readonly where: string;
69
+ readonly method: string;
70
+ readonly url: string;
71
+ readonly status: number;
72
+ readonly ct: string;
73
+ readonly at: number;
74
+ readonly request: string;
75
+ readonly response: string;
76
+ readonly headers: string;
77
+ readonly requestFullSize: number;
78
+ readonly responseFullSize: number;
79
+ readonly requestSizeExact: boolean;
80
+ readonly responseSizeExact: boolean;
81
+ readonly ambiguous: number;
82
+ readonly source: string;
83
+ readonly maxBytes: number;
84
+ readonly note: string;
85
+ }
86
+ export declare function renderRecordDetail(input: RecordDetailFacts): string;
87
+ export declare function moveOrThrow(move: RecordMove, held: RecordState | null): RecordState;
88
+ export declare function domainOf(url: string): string;
89
+ export declare function readDomainsOf(design: unknown): readonly string[];
@@ -0,0 +1,2 @@
1
+ import type { DshHostContext, RecordStore } from '@dsh-workbench/shared';
2
+ export declare function registerRecordTools(ctx: DshHostContext, store: RecordStore): readonly (() => void)[];
@@ -0,0 +1,76 @@
1
+ import type { DshHostContext, DshShell, RecordState, RecordStore } from '@dsh-workbench/shared';
2
+ import type { CaptureEntry } from './diy-record-capture';
3
+ import type { RecordCall, RecordListRow, RecordPageRead } from './diy-record-text';
4
+ export declare const OPEN_TIMEOUT_MS = 30000;
5
+ export declare const SETTLE_MS = 2000;
6
+ export declare const WAIT_CAP_MS: number;
7
+ export declare const POLL_MS = 1000;
8
+ export declare const DETAIL_MAX_BYTES = 60000;
9
+ export declare const pauseFor: (ms: number) => Promise<void>;
10
+ export declare function waitOf(value: unknown): number;
11
+ export declare function foreignDomainText(design: unknown, url: string): string;
12
+ export declare function captureFileOf(packagesDir: string, unit: string): string;
13
+ export declare function lastCaptureFileOf(file: string): string;
14
+ export declare function startRecordCapture(shell: DshShell, command: string, session: string, file: string): Promise<boolean>;
15
+ export interface WatchFinishDeps {
16
+ readonly ctx: DshHostContext;
17
+ readonly shell: DshShell;
18
+ readonly command: string;
19
+ readonly sessionId: string;
20
+ readonly store: RecordStore;
21
+ readonly url: string;
22
+ readonly captureFile: string;
23
+ }
24
+ export declare function watchFinishStepOf(input: WatchFinishDeps): Promise<{
25
+ readonly stop: boolean;
26
+ readonly delivered: boolean;
27
+ }>;
28
+ export declare function watchRecordFinish(input: WatchFinishDeps): void;
29
+ export interface CaptureRead {
30
+ readonly text: string;
31
+ readonly totalLines: number;
32
+ readonly tailLimit: number;
33
+ readonly truncated: boolean;
34
+ readonly round: string;
35
+ }
36
+ export declare function captureLinesOf(shell: DshShell, file: string, timeoutMs?: number): Promise<number>;
37
+ export declare function captureRoundOf(shell: DshShell, file: string, timeoutMs?: number): Promise<string>;
38
+ export declare function captureTextOf(shell: DshShell, file: string, timeoutMs?: number): Promise<{
39
+ readonly text: string;
40
+ readonly truncated: boolean;
41
+ }>;
42
+ export declare function captureReadOf(shell: DshShell, file: string, timeoutMs?: number): Promise<CaptureRead>;
43
+ export declare function keepCaptureOf(shell: DshShell, file: string, timeoutMs?: number): Promise<boolean>;
44
+ export declare function captureLinesWithKeyOf(shell: DshShell, file: string, key: string, timeoutMs?: number): Promise<string>;
45
+ export interface SegmentBundle {
46
+ readonly capture: CaptureRead;
47
+ readonly entries: readonly CaptureEntry[];
48
+ readonly inside: readonly CaptureEntry[];
49
+ readonly outside: number;
50
+ readonly merged: readonly RecordCall[];
51
+ readonly rows: readonly RecordListRow[];
52
+ }
53
+ export declare function bundleOf(capture: CaptureRead, page: RecordPageRead, state: RecordState): SegmentBundle;
54
+ export declare function hookCallOf(page: RecordPageRead, key: string): RecordCall | null;
55
+ export declare function detailOfEntry(entry: CaptureEntry, maxBytes: number, ambiguous?: number): Record<string, unknown>;
56
+ export declare function detailOfCall(call: RecordCall, maxBytes: number): Record<string, unknown>;
57
+ export declare function releaseRecord(input: {
58
+ readonly shell: DshShell;
59
+ readonly command: string;
60
+ readonly session: string;
61
+ readonly url: string;
62
+ readonly captureFile: string;
63
+ }): Promise<{
64
+ readonly tab: boolean;
65
+ readonly capture: boolean;
66
+ }>;
67
+ export declare function releaseQuietly(input: {
68
+ readonly shell: DshShell;
69
+ readonly command: string;
70
+ readonly session: string;
71
+ readonly url: string;
72
+ readonly captureFile: string;
73
+ }): Promise<{
74
+ readonly tab: boolean;
75
+ readonly capture: boolean;
76
+ }>;
@@ -1,65 +1,2 @@
1
1
  export declare const PAGE_PROBE = "(async () => {\n const answer = await fetch('/workbench/api/health').then((one) => one.json()).catch(() => null);\n const root = document.querySelector('.wb-root');\n const where = root === null ? '' : (root.getAttribute('data-wb-where') ?? '');\n const bar = document.querySelector('.wb-rightbar');\n const board = bar === null ? '' : (bar.getAttribute('data-wb-board') ?? '');\n const open = bar === null ? null : bar.hasAttribute('data-wb-open');\n const style = bar === null ? null : getComputedStyle(bar);\n const box = bar === null ? null : bar.getBoundingClientRect();\n const drawn =\n bar !== null &&\n style.visibility !== 'hidden' &&\n style.display !== 'none' &&\n box.width > 0 &&\n box.height > 0;\n return JSON.stringify({\n plugin: answer === null ? null : answer.plugin,\n pid: answer === null ? null : answer.pid,\n url: location.href,\n title: document.title,\n where,\n board,\n open,\n shown: drawn,\n });\n})()";
2
2
  export declare function cardSelectorOf(unit: string): string;
3
- export type DomMode = 'none' | 'outline' | 'html';
4
- export interface PickRequest {
5
- readonly props: readonly string[];
6
- readonly parts: readonly string[];
7
- readonly dom: DomMode;
8
- }
9
- export declare const DOM_MODES: readonly DomMode[];
10
- export interface PickFacts {
11
- readonly card: Readonly<Record<string, string>>;
12
- readonly parts: Readonly<Record<string, Readonly<Record<string, string>>>>;
13
- }
14
- export declare const DEFAULT_PROPS: readonly ["display", "flexDirection", "gap", "padding", "width", "height", "overflow", "backgroundColor", "color", "borderRadius", "fontSize", "lineHeight", "fontFamily", "boxSizing", "--dsw-radius-xl", "--dsw-alias-bg-layer-1", "--dsw-alias-label-primary"];
15
- export declare const DEFAULT_PARTS: readonly [".wb-cardHead", ".wb-cardBody"];
16
- export declare function cleanNames(value: unknown, cap: number): readonly string[];
17
- export declare function pickOf(raw: Record<string, unknown>): PickRequest;
18
- export interface CardView {
19
- readonly ok: boolean;
20
- readonly anchored: boolean;
21
- readonly visible: boolean;
22
- readonly width: number;
23
- readonly height: number;
24
- readonly head: string;
25
- readonly text: string;
26
- readonly clipped: boolean;
27
- readonly cards: number;
28
- readonly rect: {
29
- readonly x: number;
30
- readonly y: number;
31
- readonly width: number;
32
- readonly height: number;
33
- };
34
- readonly dpr: number;
35
- readonly viewport: {
36
- readonly width: number;
37
- readonly height: number;
38
- };
39
- readonly pick: PickFacts;
40
- readonly slot: SlotFacts;
41
- readonly outline: readonly CardNode[];
42
- readonly html: string;
43
- }
44
- export interface SlotFacts {
45
- readonly parentWidth: number;
46
- readonly parentDisplay: string;
47
- readonly columns: string;
48
- readonly index: number;
49
- readonly cards: number;
50
- readonly viewportHeight: number;
51
- readonly scrollHeight: number;
52
- }
53
- export interface CardNode {
54
- readonly depth: number;
55
- readonly tag: string;
56
- readonly cls: string;
57
- readonly role: string;
58
- readonly name: string;
59
- readonly text: string;
60
- }
61
- export declare const EMPTY_CARD: CardView;
62
- export declare function measureScriptOf(unit: string, pick: PickRequest): string;
63
- export declare function nodesOf(value: unknown): readonly CardNode[];
64
- export declare function slotOf(value: unknown): SlotFacts;
65
- export declare function pickFactsOf(value: unknown): PickFacts;
@@ -0,0 +1,5 @@
1
+ import type { DshHostContext, DshToolDefinition, DshToolRegistry } from '@dsh-workbench/shared';
2
+ export declare const SPEC_TIMEOUT_MS = 20000;
3
+ export declare function specArgvOf(command: string): readonly string[];
4
+ export declare function specTool(ctx: DshHostContext): DshToolDefinition;
5
+ export declare function registerSpecTool(ctx: DshHostContext, tools: DshToolRegistry): readonly (() => void)[];
@@ -0,0 +1 @@
1
+ export {};
@@ -3,6 +3,7 @@ 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
5
  export declare const DIY_DEBUG_FACT = "diy-debug";
6
+ export declare const DIY_RECORD_FACT = "diy-record";
6
7
  export declare function panelsHandoffEntry(target?: {
7
8
  readonly path?: string | undefined;
8
9
  }): HandoffEntry | undefined;
@@ -17,34 +17,42 @@ export declare const MODULES_UPDATE_WORKBENCH_TOOL = "workbench_modules_update_w
17
17
  export declare const DIY_LIST_TOOL = "workbench_diy_list";
18
18
  export declare const DIY_STATUS_TOOL = "workbench_diy_status";
19
19
  export declare const DIY_PANEL_TOOL = "workbench_diy_panel";
20
+ export declare const DIY_COMPONENTS_TOOL = "workbench_diy_components";
20
21
  export declare const DIY_RECON_TOOL = "workbench_diy_recon";
22
+ export declare const DIY_SPEC_TOOL = "workbench_diy_spec";
21
23
  export declare const DIY_PROBE_TOOL = "workbench_diy_probe";
22
- export declare const DIY_LOOK_TOOL = "workbench_diy_look";
23
24
  export declare const DIY_INSTALL_TOOL = "workbench_diy_install";
24
25
  export declare const DIY_SHOW_TOOL = "workbench_diy_show";
26
+ export declare const DIY_STATE_TOOL = "workbench_diy_state";
27
+ export declare const DIY_HTML_TOOL = "workbench_diy_html";
28
+ export declare const DIY_FIND_TOOL = "workbench_diy_find";
25
29
  export declare const DIY_CLICK_TOOL = "workbench_diy_click";
30
+ export declare const DIY_HOVER_TOOL = "workbench_diy_hover";
26
31
  export declare const DIY_TYPE_TOOL = "workbench_diy_type";
27
32
  export declare const DIY_FILL_TOOL = "workbench_diy_fill";
28
33
  export declare const DIY_KEYS_TOOL = "workbench_diy_keys";
29
- export declare const DIY_HOVER_TOOL = "workbench_diy_hover";
30
- export declare const DIY_SELECT_TOOL = "workbench_diy_select";
31
34
  export declare const DIY_SCROLL_TOOL = "workbench_diy_scroll";
32
- export declare const DIY_RELOAD_TOOL = "workbench_diy_reload";
33
- export declare const DIY_VIEWPORT_TOOL = "workbench_diy_viewport";
34
- export declare const DIY_NET_WATCH_TOOL = "workbench_diy_net_watch";
35
- export declare const DIY_NET_READ_TOOL = "workbench_diy_net_read";
36
- export declare const DIY_NET_STOP_TOOL = "workbench_diy_net_stop";
35
+ export declare const DIY_WAIT_TOOL = "workbench_diy_wait";
36
+ export declare const DIY_EVAL_TOOL = "workbench_diy_eval";
37
+ export declare const DIY_SCREENSHOT_TOOL = "workbench_diy_screenshot";
38
+ export declare const DIY_NETWORK_TOOL = "workbench_diy_network";
39
+ export declare const DIY_DIALOG_TOOL = "workbench_diy_dialog";
37
40
  export declare const DIY_LOGS_WATCH_TOOL = "workbench_diy_logs_watch";
38
41
  export declare const DIY_LOGS_READ_TOOL = "workbench_diy_logs_read";
39
42
  export declare const DIY_LOGS_STOP_TOOL = "workbench_diy_logs_stop";
43
+ export declare const DIY_RECORD_PREPARE_TOOL = "workbench_diy_record_prepare";
44
+ export declare const DIY_RECORD_READ_TOOL = "workbench_diy_record_read";
45
+ export declare const DIY_RECORD_DETAIL_TOOL = "workbench_diy_record_detail";
46
+ export declare const DIY_RECORD_STOP_TOOL = "workbench_diy_record_stop";
40
47
  export declare const DIY_DEBUG_START_TOOL = "workbench_diy_debug_start";
41
48
  export declare const DIY_DEBUG_PAUSE_TOOL = "workbench_diy_debug_pause";
42
49
  export declare const DIY_DEBUG_RESUME_TOOL = "workbench_diy_debug_resume";
43
50
  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"];
51
+ 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_components", "workbench_diy_recon", "workbench_diy_spec", "workbench_diy_probe", "workbench_diy_install", "workbench_diy_show", "workbench_diy_state", "workbench_diy_html", "workbench_diy_find", "workbench_diy_click", "workbench_diy_hover", "workbench_diy_type", "workbench_diy_fill", "workbench_diy_keys", "workbench_diy_scroll", "workbench_diy_wait", "workbench_diy_eval", "workbench_diy_screenshot", "workbench_diy_network", "workbench_diy_dialog", "workbench_diy_logs_watch", "workbench_diy_logs_read", "workbench_diy_logs_stop", "workbench_diy_record_prepare", "workbench_diy_record_read", "workbench_diy_record_detail", "workbench_diy_record_stop", "workbench_diy_debug_start", "workbench_diy_debug_pause", "workbench_diy_debug_resume", "workbench_diy_debug_stop"];
45
52
  export type PanelsToolName = (typeof ALL_TOOLS)[number];
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"];
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"];
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"];
53
+ export declare const READ_TOOLS: readonly ["workbench_panels_list", "workbench_modules_list", "workbench_diy_list", "workbench_diy_status", "workbench_diy_panel", "workbench_diy_components", "workbench_diy_recon", "workbench_diy_spec", "workbench_diy_probe", "workbench_diy_state", "workbench_diy_html", "workbench_diy_find", "workbench_diy_click", "workbench_diy_hover", "workbench_diy_type", "workbench_diy_fill", "workbench_diy_keys", "workbench_diy_scroll", "workbench_diy_wait", "workbench_diy_eval", "workbench_diy_screenshot", "workbench_diy_network", "workbench_diy_dialog", "workbench_diy_logs_watch", "workbench_diy_logs_read", "workbench_diy_logs_stop", "workbench_diy_record_read", "workbench_diy_record_detail", "workbench_diy_record_stop"];
54
+ 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_record_prepare", "workbench_diy_debug_start", "workbench_diy_debug_pause", "workbench_diy_debug_resume", "workbench_diy_debug_stop"];
55
+ export declare const DIY_TOOLS: readonly ["workbench_diy_list", "workbench_diy_status", "workbench_diy_panel", "workbench_diy_components", "workbench_diy_recon", "workbench_diy_spec", "workbench_diy_probe", "workbench_diy_install", "workbench_diy_show", "workbench_diy_state", "workbench_diy_html", "workbench_diy_find", "workbench_diy_click", "workbench_diy_hover", "workbench_diy_type", "workbench_diy_fill", "workbench_diy_keys", "workbench_diy_scroll", "workbench_diy_wait", "workbench_diy_eval", "workbench_diy_screenshot", "workbench_diy_network", "workbench_diy_dialog", "workbench_diy_logs_watch", "workbench_diy_logs_read", "workbench_diy_logs_stop"];
56
+ export declare const DIY_RECORD_TOOLS: readonly ["workbench_diy_record_prepare", "workbench_diy_record_read", "workbench_diy_record_detail", "workbench_diy_record_stop"];
49
57
  export declare const DIY_DEBUG_TOOLS: readonly ["workbench_diy_debug_start", "workbench_diy_debug_pause", "workbench_diy_debug_resume", "workbench_diy_debug_stop"];
50
58
  export declare const panelsUnit: UnitManifest;
@@ -0,0 +1,4 @@
1
+ import type { DshHostContext } from '@dsh-workbench/shared';
2
+ export declare function registerDiyActs(ctx: DshHostContext, facts: {
3
+ bump(names: readonly string[]): unknown;
4
+ }): () => void;
@@ -0,0 +1,54 @@
1
+ import type { DshShell } from '@dsh-workbench/shared';
2
+ export declare const SURFACE_TIMEOUT_MS = 30000;
3
+ export declare const EXCERPT_LINES = 60;
4
+ export declare const SUMMARY_PER_BUCKET = 12;
5
+ export declare const NEAR_LIMIT = 8;
6
+ export declare const PRUNE_CHARS = 8192;
7
+ export declare const PRIMITIVES_PKG = "@deepseek-ai/dsh-client-ui-primitives";
8
+ export declare const MANIFEST_TAIL = "//# sourceMappingURL=";
9
+ export type SurfaceScope = 'all' | 'primitives' | 'kit';
10
+ export interface SurfacePayload {
11
+ readonly [key: string]: unknown;
12
+ }
13
+ export interface SurfaceQuery {
14
+ readonly primitives?: SurfacePayload;
15
+ readonly kit?: SurfacePayload;
16
+ }
17
+ export declare function scopeOf(raw: string): SurfaceScope;
18
+ export declare function wantsPrimitives(scope: SurfaceScope): boolean;
19
+ export declare function wantsKit(scope: SurfaceScope): boolean;
20
+ export declare function toolchainBinOf(root: string): string | null;
21
+ export declare function queryCommandOf(bin: string, only: 'kit' | 'primitives'): string;
22
+ export declare function runSurfaceQuery(shell: DshShell, bin: string, only: 'kit' | 'primitives', root: string): Promise<SurfacePayload>;
23
+ export declare function filesOf(payload: SurfacePayload | undefined): Record<string, string>;
24
+ export declare function rootsOf(payload: SurfacePayload | undefined): Record<string, string>;
25
+ export declare function countsOf(payload: SurfacePayload | undefined): Record<string, number>;
26
+ export declare function installedVersionOf(payload: SurfacePayload | undefined): string | null;
27
+ export declare function nearNamesOf(name: string, names: readonly string[], limit?: number): readonly string[];
28
+ export declare function findFileOf(name: string, query: SurfaceQuery): {
29
+ readonly file: string;
30
+ readonly from: 'kit' | 'primitives';
31
+ } | null;
32
+ export declare function excerptOf(text: string, maxLines?: number): string;
33
+ export declare function excerptAt(file: string, maxLines?: number): string;
34
+ export declare function skillDirOf(from: string): string | null;
35
+ export declare function symbolsIn(heading: string): readonly string[];
36
+ export declare function docSectionOf(name: string, dir: string | null): {
37
+ readonly file: string;
38
+ readonly lines: string;
39
+ } | null;
40
+ export declare function byLocationOf(payload: SurfacePayload): readonly {
41
+ readonly where: string;
42
+ readonly names: readonly string[];
43
+ }[];
44
+ export declare function renderSurfaceText(query: SurfaceQuery, options: {
45
+ scope: SurfaceScope;
46
+ all: boolean;
47
+ }): string;
48
+ export declare function listedNamesOf(query: SurfaceQuery): readonly string[];
49
+ export type FaceState = 'not-queried' | 'ok' | 'unreadable';
50
+ export declare function faceStateOf(query: SurfaceQuery, face: 'kit' | 'primitives'): FaceState;
51
+ export declare function renderNameText(name: string, found: {
52
+ readonly file: string;
53
+ readonly from: 'kit' | 'primitives';
54
+ } | null, query: SurfaceQuery): string;