@dsh-workbench/core 0.1.9 → 0.1.10
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 +529 -61
- package/dist/client/client.body.js +529 -61
- package/dist/client/index.js +530 -62
- package/dist/host/index.js +212 -100
- package/dist/types/app/client.d.ts +134 -6
- package/dist/types/app/layouts/rightbar/board-plan.d.ts +2 -0
- package/dist/types/app/layouts/sidebar/ProjectSwitcher.d.ts +2 -2
- package/dist/types/app/layouts/sidebar/Sidebar.d.ts +1 -1
- package/dist/types/app/layouts/sidebar/WorkspaceRenameDialog.d.ts +8 -0
- package/dist/types/app/layouts/sidebar/WorkspaceRowAction.d.ts +7 -0
- package/dist/types/app/layouts/sidebar/WorkspaceRowLabel.d.ts +8 -0
- package/dist/types/app/layouts/sidebar/WorkspaceSearchField.d.ts +9 -0
- package/dist/types/app/layouts/sidebar/__tests__/workspace-name.test.d.ts +1 -0
- package/dist/types/app/layouts/sidebar/workspace-items.d.ts +11 -0
- package/dist/types/app/layouts/sidebar/workspace-name.d.ts +16 -0
- package/dist/types/app/units/__tests__/registry.test.d.ts +1 -0
- package/dist/types/app/units/fixture-unit-mock.d.ts +3 -1
- package/dist/types/shared/api/host/mount-units.d.ts +13 -6
- package/dist/types/shared/hooks/mock-mode.d.ts +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Translate } from '@dsh-workbench/shared';
|
|
2
|
+
export interface WorkspaceSearchFieldProps {
|
|
3
|
+
readonly t: Translate;
|
|
4
|
+
readonly query: string;
|
|
5
|
+
readonly onQuery: (query: string) => void;
|
|
6
|
+
readonly onCursor: (step: 1 | -1) => void;
|
|
7
|
+
readonly onSubmit: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function WorkspaceSearchField({ t, query, onQuery, onCursor, onSubmit, }: WorkspaceSearchFieldProps): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Translate, WorkspaceView } from '@dsh-workbench/shared';
|
|
2
|
+
import type { MenuEntry } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
3
|
+
export interface WorkspaceItemsOptions {
|
|
4
|
+
readonly results: readonly WorkspaceView[];
|
|
5
|
+
readonly currentId: string | null;
|
|
6
|
+
readonly hoverId: string | null;
|
|
7
|
+
readonly t: Translate;
|
|
8
|
+
readonly onHover: (workspaceId: string | null) => void;
|
|
9
|
+
readonly onEdit: (workspace: WorkspaceView) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function workspaceMenuItems(options: WorkspaceItemsOptions): MenuEntry[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const WORKSPACE_NAME_MAX = 20;
|
|
2
|
+
export declare const WORKSPACE_NAME_INPUT_MAX: number;
|
|
3
|
+
export interface WorkspaceDisplayName {
|
|
4
|
+
readonly dir: string;
|
|
5
|
+
readonly name: string;
|
|
6
|
+
}
|
|
7
|
+
interface Named {
|
|
8
|
+
readonly path: string;
|
|
9
|
+
readonly title: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function basenameOf(value: string): string;
|
|
12
|
+
export declare function displayNameOf(workspace: Named): WorkspaceDisplayName;
|
|
13
|
+
export declare function matchWorkspaces<T extends Named>(items: readonly T[], query: string): T[];
|
|
14
|
+
export declare function titleFor(workspace: Named, draft: string): string;
|
|
15
|
+
export declare function nameTooLong(draft: string): boolean;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { BoardModule, UnitClientFace, UnitManifest } from '@dsh-workbench/shared';
|
|
2
2
|
export declare const FIXTURE_UNIT_ID = "wb-fixture";
|
|
3
|
+
export declare const CRASH_UNIT_ID = "wb-fixture-crash";
|
|
3
4
|
export declare const FIXTURE_FACE: UnitClientFace;
|
|
5
|
+
export declare const CRASH_FACE: UnitClientFace;
|
|
4
6
|
export declare function fixtureRoster(roster: readonly UnitManifest[]): readonly UnitManifest[];
|
|
5
|
-
export declare function fixtureSeed(roster: readonly UnitManifest[], all: readonly BoardModule[]): readonly BoardModule[];
|
|
7
|
+
export declare function fixtureSeed(roster: readonly UnitManifest[], all: readonly BoardModule[], crash?: boolean): readonly BoardModule[];
|
|
@@ -3,6 +3,10 @@ import type { UnitManifest } from '@dsh-workbench/shared/host';
|
|
|
3
3
|
import { type RouteTable } from '@dsh-workbench/shared/host';
|
|
4
4
|
import type { ContextRenderer, UnitHostFace, UnitMountDeps, UnitMountResult, UnitCall } from '@dsh-workbench/shared/host';
|
|
5
5
|
import { type UnitReadiness } from './unit-readiness';
|
|
6
|
+
export interface UnitFailure {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly reason: string;
|
|
9
|
+
}
|
|
6
10
|
export interface MountedUnit {
|
|
7
11
|
readonly face: UnitHostFace;
|
|
8
12
|
readonly result: UnitMountResult;
|
|
@@ -12,15 +16,11 @@ export interface UnitsPlan {
|
|
|
12
16
|
readonly mounted: readonly MountedUnit[];
|
|
13
17
|
readonly routes: RouteTable;
|
|
14
18
|
readonly gate: UnitMountResult['gate'];
|
|
15
|
-
readonly prefs: ReadonlyArray<{
|
|
16
|
-
readonly resource: string;
|
|
19
|
+
readonly prefs: ReadonlyArray<NamedEntry & {
|
|
17
20
|
readonly unit: string;
|
|
18
|
-
handle(payload: unknown): unknown;
|
|
19
21
|
}>;
|
|
20
|
-
readonly actions: ReadonlyArray<{
|
|
21
|
-
readonly resource: string;
|
|
22
|
+
readonly actions: ReadonlyArray<NamedEntry & {
|
|
22
23
|
readonly unit: string;
|
|
23
|
-
handle(payload: unknown): unknown;
|
|
24
24
|
}>;
|
|
25
25
|
readonly provision: UnitMountResult['provision'];
|
|
26
26
|
readonly contextRenderers: ReadonlyMap<string, ContextRenderer>;
|
|
@@ -31,9 +31,15 @@ export interface UnitsPlan {
|
|
|
31
31
|
readonly id: string;
|
|
32
32
|
readonly missing: readonly string[];
|
|
33
33
|
}>;
|
|
34
|
+
readonly failed: readonly UnitFailure[];
|
|
34
35
|
readonly warmReads: () => readonly (readonly string[])[];
|
|
35
36
|
readonly disposeLongTasks: () => void;
|
|
36
37
|
}
|
|
38
|
+
interface NamedEntry {
|
|
39
|
+
readonly resource: string;
|
|
40
|
+
handle(payload: unknown): unknown;
|
|
41
|
+
}
|
|
42
|
+
export declare function failureReasonOf(error: unknown): string;
|
|
37
43
|
export declare function mountUnits(faces: readonly UnitHostFace[], deps: {
|
|
38
44
|
ctx: DshHostContext;
|
|
39
45
|
logger?: {
|
|
@@ -50,3 +56,4 @@ export declare function mountUnits(faces: readonly UnitHostFace[], deps: {
|
|
|
50
56
|
readonly bump: (facts: readonly string[]) => void;
|
|
51
57
|
} | undefined;
|
|
52
58
|
}): UnitsPlan;
|
|
59
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-workbench/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "个人工作台:Agent 工作台外壳(左栏 + 常驻对话 + 自研右侧数据面板)。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"icon": "./icon.svg",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@dsh-workbench/shared": "0.1.
|
|
81
|
+
"@dsh-workbench/shared": "0.1.10"
|
|
82
82
|
},
|
|
83
83
|
"scripts": {
|
|
84
84
|
"build": "node scripts/build.mjs && node scripts/build-types.mjs",
|