@liyuera/dsh-dev-dock 0.0.0-stage → 1.0.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 (39) hide show
  1. package/LICENSE +24 -0
  2. package/README.md +43 -2
  3. package/cordis.patch.yml +4 -0
  4. package/lib/client.js +1131 -0
  5. package/lib/index.js +5770 -0
  6. package/lib/invariant.js +24 -0
  7. package/lib/types/actions.d.ts +124 -0
  8. package/lib/types/client/ComposerActions.d.ts +25 -0
  9. package/lib/types/client/DevDockDrawer.d.ts +29 -0
  10. package/lib/types/client/DevDockEntry.d.ts +28 -0
  11. package/lib/types/client/DevDockSettingsPage.d.ts +24 -0
  12. package/lib/types/client/StartTile.d.ts +25 -0
  13. package/lib/types/client/StartWorkButton.d.ts +28 -0
  14. package/lib/types/client/StartWorkModal.d.ts +25 -0
  15. package/lib/types/client/api.d.ts +56 -0
  16. package/lib/types/client/data.d.ts +75 -0
  17. package/lib/types/client/icons.d.ts +40 -0
  18. package/lib/types/client/index.d.ts +27 -0
  19. package/lib/types/client/locales.d.ts +65 -0
  20. package/lib/types/client/pages/ImportPage.d.ts +26 -0
  21. package/lib/types/client/pages/ProjectListPage.d.ts +34 -0
  22. package/lib/types/client/pages/QuickStartPage.d.ts +26 -0
  23. package/lib/types/client/probe.d.ts +3 -0
  24. package/lib/types/client/stores.d.ts +22 -0
  25. package/lib/types/domain.d.ts +17 -0
  26. package/lib/types/editors.d.ts +27 -0
  27. package/lib/types/index.d.ts +31 -0
  28. package/lib/types/invariant.d.ts +16 -0
  29. package/lib/types/platform/editors-darwin.d.ts +25 -0
  30. package/lib/types/platform/editors-win32.d.ts +25 -0
  31. package/lib/types/platform/open-ide.d.ts +23 -0
  32. package/lib/types/platform/open-terminal.d.ts +25 -0
  33. package/lib/types/platform/runner.d.ts +22 -0
  34. package/lib/types/schema.d.ts +52 -0
  35. package/lib/types/tools/actions.d.ts +35 -0
  36. package/lib/types/tools/editors.d.ts +27 -0
  37. package/lib/types/tools/project.d.ts +50 -0
  38. package/lib/types/tools/scan.d.ts +44 -0
  39. package/package.json +85 -4
@@ -0,0 +1,24 @@
1
+ //#region lib/types/invariant.js
2
+ /**
3
+ * Package-owned invariant companion for `@liyuera/dsh-dev-dock`.
4
+ * @module @liyuera/dsh-dev-dock/invariant
5
+ */
6
+ const PACKAGE_NAME = "@liyuera/dsh-dev-dock";
7
+ /** Cordis companion plugin name. */
8
+ const name = "dev-dock-invariant";
9
+ /** Service required before the companion can reserve package ownership. */
10
+ const inject = ["invariants"];
11
+ /**
12
+ * No runtime invariant: the plugin owns no cross-plugin event stream. The
13
+ * HMR-safety specs prove tool/slot registration disposal, and the settings
14
+ * namespace relation is asserted by the schema specs.
15
+ */
16
+ const install = () => {};
17
+ /**
18
+ * Register this package's invariant companion.
19
+ * @param ctx - Cordis context carrying the invariant service.
20
+ * @returns the installed registration's disposer after setup succeeds.
21
+ */
22
+ const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
23
+ //#endregion
24
+ export { apply, inject, name };
@@ -0,0 +1,124 @@
1
+ /**
2
+ * Host desktop actions: resolve the workspace IDE, open it, open a system
3
+ * terminal at the workspace directory, and run the batch start-work flow.
4
+ * All actions are deterministic (no agent, no approval prompt — the button
5
+ * click is the user's authorization); the only guard is the sandbox mode:
6
+ * `read-only` denies desktop side effects.
7
+ * @module @liyuera/dsh-dev-dock/actions
8
+ */
9
+ import type { DevDockSettings } from './schema.ts';
10
+ import type { PlatformFacts } from './platform/runner.ts';
11
+ /** Settings scope facade the desktop actions read and mutate. */
12
+ export interface DesktopScope {
13
+ /** Read the current settings document. */
14
+ get(): DevDockSettings;
15
+ /** Merge a partial patch into the document. */
16
+ update(patch: Partial<DevDockSettings>): void;
17
+ }
18
+ /** Minimal workspace record the actions need (live registry face). */
19
+ export interface DesktopWorkspace {
20
+ /** Stable workspace registry id. */
21
+ id: string;
22
+ /** Canonical directory path. */
23
+ path: string;
24
+ /** Display title. */
25
+ title: string;
26
+ }
27
+ /** Unary result of one desktop action. */
28
+ export type DesktopActionResult = {
29
+ ok: true;
30
+ } | {
31
+ ok: false;
32
+ error: string;
33
+ };
34
+ /**
35
+ * Whether a directory shows uni-app/miniapp traits (manifest.json markers).
36
+ * @param workspacePath - canonical workspace directory.
37
+ * @returns true when the traits are present.
38
+ */
39
+ export declare function hasUniAppTraits(workspacePath: string): boolean;
40
+ /**
41
+ * Default editor for one workspace: uni-app traits prefer HBuilderX, other
42
+ * projects prefer WebStorm, then the remaining installed editors in order.
43
+ * @param workspacePath - canonical workspace directory.
44
+ * @param installed - detected editor names.
45
+ * @returns the default editor name, or undefined when nothing is installed.
46
+ */
47
+ export declare function defaultEditorFor(workspacePath: string, installed: readonly string[]): string | undefined;
48
+ /**
49
+ * Resolve the executable path for one editor: manual path wins, then the
50
+ * cached detected path, then a live detection pass.
51
+ * @param scope - settings scope.
52
+ * @param facts - platform facts.
53
+ * @param editorName - canonical editor name.
54
+ * @returns the resolved path or an error message.
55
+ */
56
+ export declare function editorExecutablePath(scope: DesktopScope, facts: PlatformFacts, editorName: string): Promise<{
57
+ ok: true;
58
+ path: string;
59
+ } | {
60
+ ok: false;
61
+ error: string;
62
+ }>;
63
+ /**
64
+ * Resolve which editor opens one workspace: the stored preference wins;
65
+ * otherwise a default is derived from the content traits and installed
66
+ * editors. The executable path is resolved from the same entry.
67
+ * @param scope - settings scope.
68
+ * @param facts - platform facts.
69
+ * @param workspace - target workspace.
70
+ * @returns editor name and executable path, or an error message.
71
+ */
72
+ export declare function resolveWorkspaceEditor(scope: DesktopScope, facts: PlatformFacts, workspace: DesktopWorkspace): Promise<{
73
+ ok: true;
74
+ editor: string;
75
+ path: string;
76
+ } | {
77
+ ok: false;
78
+ error: string;
79
+ }>;
80
+ /**
81
+ * Open one workspace in its default editor.
82
+ * @param scope - settings scope.
83
+ * @param facts - platform facts.
84
+ * @param workspace - target workspace.
85
+ * @returns ok, or an error message.
86
+ */
87
+ export declare function openIdeFor(scope: DesktopScope, facts: PlatformFacts, workspace: DesktopWorkspace): Promise<DesktopActionResult>;
88
+ /**
89
+ * Open one workspace directory in a system terminal window.
90
+ * @param scope - settings scope.
91
+ * @param facts - platform facts.
92
+ * @param workspace - target workspace.
93
+ * @returns ok, or an error message.
94
+ */
95
+ export declare function openTerminalFor(scope: DesktopScope, facts: PlatformFacts, workspace: DesktopWorkspace): Promise<DesktopActionResult>;
96
+ /**
97
+ * Run the full start action for one workspace: editor first, then terminal.
98
+ * @param scope - settings scope.
99
+ * @param facts - platform facts.
100
+ * @param workspace - target workspace.
101
+ * @returns ok, or the first error (the other half is still attempted).
102
+ */
103
+ export declare function startFor(scope: DesktopScope, facts: PlatformFacts, workspace: DesktopWorkspace): Promise<DesktopActionResult>;
104
+ /**
105
+ * Run the start-work batch: for each selected workspace, open its editor and
106
+ * a system terminal, with a gap between consecutive editor launches.
107
+ * @param scope - settings scope.
108
+ * @param facts - platform facts.
109
+ * @param workspaces - selected workspaces in selection order.
110
+ * @returns per-workspace results plus totals.
111
+ */
112
+ export declare function startWorkFor(scope: DesktopScope, facts: PlatformFacts, workspaces: readonly DesktopWorkspace[]): Promise<{
113
+ ok: boolean;
114
+ opened: number;
115
+ started: number;
116
+ items: Array<{
117
+ workspaceId: string;
118
+ ok: boolean;
119
+ error?: string;
120
+ }>;
121
+ }>;
122
+ /** Whether an editor name is one of the known canonical names. */
123
+ export declare function isKnownEditor(name: string): boolean;
124
+ //# sourceMappingURL=actions.d.ts.map
@@ -0,0 +1,25 @@
1
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
2
+ import type { DevDockActions, DevDockData } from './data.ts';
3
+ import { NS } from './locales.ts';
4
+ /** Registration-side inject face for the composer action group. */
5
+ export interface ComposerActionsInjected {
6
+ /** Data mutation and desktop actions. */
7
+ dataActions: DevDockActions;
8
+ hooks: {
9
+ /** Settings snapshot bound by the renderer as useDevDockData. */
10
+ devDockData: {
11
+ getSnapshot(): DevDockData;
12
+ subscribe(fn: () => void): () => void;
13
+ };
14
+ };
15
+ }
16
+ /** Full component props for the composer action group (left/right seats
17
+ * carry the same InputZone standard props, so both registrations accept it). */
18
+ export type ComposerActionsProps = PropsRuntime<'conversation.input.left'> & PropsRuntime<'conversation.input.right'> & PropsLocale<typeof NS> & InjectFace<ComposerActionsInjected>;
19
+ /**
20
+ * The composer tool-row action group.
21
+ * @param props - input-zone runtime, settings mirror, actions, translator.
22
+ * @returns the three buttons, or null when the session has no workspace.
23
+ */
24
+ export declare function ComposerActions({ sessionId, useWorkspaces, useDevDockData, dataActions, t }: ComposerActionsProps): import("react").JSX.Element | null;
25
+ //# sourceMappingURL=ComposerActions.d.ts.map
@@ -0,0 +1,29 @@
1
+ import type { InjectFace, PropsLocale, PropsRuntime, PropsStore } from '@deepseek-ai/dsh-client-ui-slots';
2
+ import type { DevDockActions, DevDockData } from './api.ts';
3
+ import { NS } from './locales.ts';
4
+ import type { createDevDockStore } from './stores.ts';
5
+ /** Registration-side inject face for the drawer. */
6
+ export interface DevDockDrawerInjected {
7
+ hooks: {
8
+ /** Settings snapshot bound by the renderer as useDevDockData. */
9
+ devDockData: {
10
+ getSnapshot(): DevDockData;
11
+ subscribe(fn: () => void): () => void;
12
+ };
13
+ };
14
+ /** Data mutation actions (named distinctly from the store actions prop). */
15
+ dataActions: DevDockActions;
16
+ /** Prompt the current session to run a dev-dock action tool. */
17
+ promptAgent: (text: string) => Promise<boolean>;
18
+ /** Open the host's native single-directory chooser; null when cancelled. */
19
+ pickDirectory: () => Promise<string | null>;
20
+ }
21
+ /** Full component props for the drawer. */
22
+ export type DevDockDrawerProps = PropsRuntime<'shell.overlay'> & PropsStore<ReturnType<typeof createDevDockStore>> & PropsLocale<typeof NS> & InjectFace<DevDockDrawerInjected>;
23
+ /**
24
+ * The devDock overlay drawer.
25
+ * @param props - overlay runtime, view store, data hook, actions, translator.
26
+ * @returns the drawer panel, or null when closed.
27
+ */
28
+ export declare function DevDockDrawer({ useStore, actions: view, useDevDockData, dataActions, promptAgent, pickDirectory, t }: DevDockDrawerProps): import("react").JSX.Element | null;
29
+ //# sourceMappingURL=DevDockDrawer.d.ts.map
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Sidebar footer entry: a full-width row above Settings showing the devDock
3
+ * title and the workspace-project count; clicking opens the start-work
4
+ * dialog. Renders a compact icon on the 56px rail.
5
+ */
6
+ import type { InjectFace, PropsLocale, PropsRuntime, PropsStore } from '@deepseek-ai/dsh-client-ui-slots';
7
+ import type { DevDockData } from './data.ts';
8
+ import { NS } from './locales.ts';
9
+ import type { createDevDockStore } from './stores.ts';
10
+ /** Registration-side inject face: the settings mirror bound as useDevDockData. */
11
+ export interface DevDockEntryInjected {
12
+ hooks: {
13
+ /** Settings snapshot bound by the renderer as useDevDockData. */
14
+ devDockData: {
15
+ getSnapshot(): DevDockData;
16
+ subscribe(fn: () => void): () => void;
17
+ };
18
+ };
19
+ }
20
+ /** Full component props for the footer entry. */
21
+ export type DevDockEntryProps = PropsRuntime<'sidebar.footer.action'> & PropsStore<ReturnType<typeof createDevDockStore>> & PropsLocale<typeof NS> & InjectFace<DevDockEntryInjected>;
22
+ /**
23
+ * The sidebar footer entry row.
24
+ * @param props - footer owner state, view store, workspace list, translator.
25
+ * @returns the entry button.
26
+ */
27
+ export declare function DevDockEntry({ wide, useWorkspaces, actions, t }: DevDockEntryProps): import("react").JSX.Element;
28
+ //# sourceMappingURL=DevDockEntry.d.ts.map
@@ -0,0 +1,24 @@
1
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
2
+ import { type DevDockActions, type DevDockData } from './data.ts';
3
+ import { NS } from './locales.ts';
4
+ /** Registration-side inject face for the settings page. */
5
+ export interface DevDockSettingsInjected {
6
+ hooks: {
7
+ /** Settings snapshot bound by the renderer as useDevDockData. */
8
+ devDockData: {
9
+ getSnapshot(): DevDockData;
10
+ subscribe(fn: () => void): () => void;
11
+ };
12
+ };
13
+ /** Data mutation and desktop actions. */
14
+ dataActions: DevDockActions;
15
+ }
16
+ /** Full component props for the settings page. */
17
+ export type DevDockSettingsPageProps = PropsRuntime<'settings.section'> & PropsLocale<typeof NS> & InjectFace<DevDockSettingsInjected>;
18
+ /**
19
+ * Render the devDock settings page.
20
+ * @param props - settings runtime, data hook, actions, translator.
21
+ * @returns the settings sections.
22
+ */
23
+ export declare function DevDockSettingsPage({ useWorkspaces, useDevDockData, dataActions, t }: DevDockSettingsPageProps): import("react").JSX.Element;
24
+ //# sourceMappingURL=DevDockSettingsPage.d.ts.map
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Start-work tile: a 16px rounded square split from top-right to
3
+ * bottom-left — the terminal icon in the upper-left half, the editor icon in
4
+ * the lower-right half, no border or padding, with a soft diagonal seam
5
+ * blending the two halves. Used by the session-header start button and the
6
+ * sidebar start-work button, with app icons when resolvable and
7
+ * app-icon-style fallbacks otherwise.
8
+ * @module @liyuera/dsh-dev-dock/client/StartTile
9
+ */
10
+ /** Tile props: one app-icon URL per half; missing URLs fall back to art. */
11
+ export interface StartTileProps {
12
+ /** Editor app icon URL (the IDE half). */
13
+ ideSrc?: string | undefined;
14
+ /** Terminal app icon URL (the terminal half). */
15
+ termSrc?: string | undefined;
16
+ /** Tile edge in pixels (default 16). */
17
+ size?: number;
18
+ }
19
+ /**
20
+ * Render the combined start-work tile.
21
+ * @param props - optional app-icon URLs per half and the tile edge.
22
+ * @returns the split tile.
23
+ */
24
+ export declare function StartTile({ ideSrc, termSrc, size }: StartTileProps): import("react").JSX.Element;
25
+ //# sourceMappingURL=StartTile.d.ts.map
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Sidebar footer start-work button: the "开始上班" row that opens the
3
+ * workspace-selection dialog. Follows the sidebar footer action style —
4
+ * ghost row, icon + label on the wide sidebar, icon-only on the 56px rail.
5
+ */
6
+ import type { InjectFace, PropsLocale, PropsRuntime, PropsStore } from '@deepseek-ai/dsh-client-ui-slots';
7
+ import type { DevDockData } from './data.ts';
8
+ import { NS } from './locales.ts';
9
+ import type { createDevDockStore } from './stores.ts';
10
+ /** Registration-side inject face: the settings mirror bound as useDevDockData. */
11
+ export interface StartWorkButtonInjected {
12
+ hooks: {
13
+ /** Settings snapshot bound by the renderer as useDevDockData. */
14
+ devDockData: {
15
+ getSnapshot(): DevDockData;
16
+ subscribe(fn: () => void): () => void;
17
+ };
18
+ };
19
+ }
20
+ /** Full component props for the start-work footer button. */
21
+ export type StartWorkButtonProps = PropsRuntime<'sidebar.footer.action'> & PropsStore<ReturnType<typeof createDevDockStore>> & PropsLocale<typeof NS> & InjectFace<StartWorkButtonInjected>;
22
+ /**
23
+ * The sidebar footer start-work button.
24
+ * @param props - footer owner state, view store, settings mirror, translator.
25
+ * @returns the button row.
26
+ */
27
+ export declare function StartWorkButton({ wide, useWorkspaces, useDevDockData, actions, t }: StartWorkButtonProps): import("react").JSX.Element;
28
+ //# sourceMappingURL=StartWorkButton.d.ts.map
@@ -0,0 +1,25 @@
1
+ import type { InjectFace, PropsLocale, PropsRuntime, PropsStore } from '@deepseek-ai/dsh-client-ui-slots';
2
+ import type { DevDockActions, DevDockData } from './data.ts';
3
+ import { NS } from './locales.ts';
4
+ import type { createDevDockStore } from './stores.ts';
5
+ /** Registration-side inject face for the dialog. */
6
+ export interface StartWorkModalInjected {
7
+ hooks: {
8
+ /** Settings snapshot bound by the renderer as useDevDockData. */
9
+ devDockData: {
10
+ getSnapshot(): DevDockData;
11
+ subscribe(fn: () => void): () => void;
12
+ };
13
+ };
14
+ /** Data mutation and desktop actions. */
15
+ dataActions: DevDockActions;
16
+ }
17
+ /** Full component props for the start-work dialog. */
18
+ export type StartWorkModalProps = PropsRuntime<'shell.overlay'> & PropsStore<ReturnType<typeof createDevDockStore>> & PropsLocale<typeof NS> & InjectFace<StartWorkModalInjected>;
19
+ /**
20
+ * The start-work dialog.
21
+ * @param props - overlay runtime, view store, data hook, actions, translator.
22
+ * @returns the modal, or null when closed.
23
+ */
24
+ export declare function StartWorkModal({ useStore, actions, useWorkspaces, useDevDockData, dataActions, t }: StartWorkModalProps): import("react").JSX.Element | null;
25
+ //# sourceMappingURL=StartWorkModal.d.ts.map
@@ -0,0 +1,56 @@
1
+ /**
2
+ * devDock browser data layer: binds the plugin's settings namespace through
3
+ * the settingsScope service and exposes a snapshot store plus mutation
4
+ * actions to the UI. Agent-facing actions (open IDE / terminal / quick-start)
5
+ * are routed through the current session's prompt so the approval pipeline
6
+ * and tool cards apply.
7
+ * @module @liyuera/dsh-dev-dock/client/api
8
+ */
9
+ import { type SnapshotStore } from '@deepseek-ai/dsh-client-runtime/client';
10
+ import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client';
11
+ import type { SettingsScope } from '@deepseek-ai/dsh-client-runtime/client';
12
+ import type { DevDockSettings, EditorRecord, ProjectRecord, QuickStartPlan } from '../schema.ts';
13
+ declare module '@deepseek-ai/cordis' {
14
+ interface Context {
15
+ /** The ui-settings settingsScope service (declared locally: the package
16
+ * root's own augmentation is not pulled by type-only imports). */
17
+ settingsScope: {
18
+ bind<T>(spec: {
19
+ namespace: string;
20
+ decode?: (section: unknown) => T | undefined;
21
+ }): SettingsScope<T>;
22
+ };
23
+ }
24
+ }
25
+ /** Client-visible data snapshot: settings document plus readiness. */
26
+ export interface DevDockData {
27
+ /** Loading until the first accepted settings section. */
28
+ ready: boolean;
29
+ /** The settings document; undefined before readiness. */
30
+ settings: DevDockSettings | undefined;
31
+ }
32
+ /** Actions the UI may invoke on the data layer. */
33
+ export interface DevDockActions {
34
+ /** Upsert one project record (id minted host-side on insert). */
35
+ saveProject(project: Omit<ProjectRecord, 'id' | 'createdAt'>): Promise<void>;
36
+ /** Remove one project; cascades quick-start references host-side. */
37
+ removeProject(projectId: string): Promise<void>;
38
+ /** Replace the editor records. */
39
+ setEditors(editors: EditorRecord[]): Promise<void>;
40
+ /** Replace the quick-start plans. */
41
+ setQuickStarts(plans: QuickStartPlan[]): Promise<void>;
42
+ /** Replace one quick-start plan. */
43
+ setQuickStartPlan(plan: QuickStartPlan): Promise<void>;
44
+ /** Prompt the current session to run a devDock action tool. */
45
+ promptAgent(text: string): Promise<boolean>;
46
+ }
47
+ /**
48
+ * Create the devDock data layer for one client plugin fiber.
49
+ * @param ctx - client root context (needs settingsScope, remote, connection).
50
+ * @returns the data store and action facade.
51
+ */
52
+ export declare function createDevDockData(ctx: ClientContext): {
53
+ store: SnapshotStore<DevDockData>;
54
+ actions: DevDockActions;
55
+ };
56
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1,75 @@
1
+ /**
2
+ * devDock browser data layer v2: mirrors the plugin's document from the host
3
+ * through the same-origin `/dev-dock/state` route and exposes the
4
+ * desktop-action bridge. Both are plain HTTP because static client bundles
5
+ * have no package-private RPC channel (host.call is a dynamic-plugin
6
+ * builtin); the host half owns the storage domain behind that route and runs
7
+ * the deterministic desktop actions.
8
+ * @module @liyuera/dsh-dev-dock/client/data
9
+ */
10
+ import { type SnapshotStore } from '@deepseek-ai/dsh-client-store';
11
+ import type { Context as ClientContext } from '@deepseek-ai/cordis';
12
+ import type { DevDockSettings } from '../schema.ts';
13
+ /** Client-visible data snapshot: document plus readiness. */
14
+ export interface DevDockData {
15
+ /** Loading until the first accepted state read. */
16
+ ready: boolean;
17
+ /** The document; undefined before readiness. */
18
+ settings: DevDockSettings | undefined;
19
+ }
20
+ /** One desktop-action request the browser half sends to the host route. */
21
+ export interface ActionRequest {
22
+ action: 'list-editors' | 'open-ide' | 'open-terminal' | 'start' | 'start-work';
23
+ workspaceId?: string;
24
+ workspaceIds?: string[];
25
+ }
26
+ /** Unary host answer (list-editors rides editors on ok). */
27
+ export interface ActionResult {
28
+ ok: boolean;
29
+ error?: string;
30
+ }
31
+ /** Start-work answer shape from the host. */
32
+ export interface StartWorkResult {
33
+ ok: boolean;
34
+ opened: number;
35
+ started: number;
36
+ error?: string;
37
+ items: Array<{
38
+ workspaceId: string;
39
+ ok: boolean;
40
+ error?: string;
41
+ }>;
42
+ }
43
+ /** Actions the UI may invoke on the data layer. */
44
+ export interface DevDockActions {
45
+ /** Record one workspace's IDE preference (upsert by workspaceId). */
46
+ setWorkspacePref(workspaceId: string, editor: string): Promise<void>;
47
+ /** Record one editor's manual path (upsert by name). */
48
+ setEditorManualPath(name: string, manualPath: string): Promise<void>;
49
+ /** Record the terminal preference. */
50
+ setTerminalApp(app: 'default' | 'iterm'): Promise<void>;
51
+ /** Record the start-work selection memory. */
52
+ setStartWork(workspaceIds: string[]): Promise<void>;
53
+ /** Detect installed editors host-side and refresh the cache. */
54
+ listEditors(): Promise<ActionResult>;
55
+ /** Open the workspace in its default editor. */
56
+ openIde(workspaceId: string): Promise<ActionResult>;
57
+ /** Open a system terminal at the workspace. */
58
+ openTerminal(workspaceId: string): Promise<ActionResult>;
59
+ /** Open editor + terminal for one workspace. */
60
+ start(workspaceId: string): Promise<ActionResult>;
61
+ /** Open editor + terminal for the selected workspaces. */
62
+ startWork(workspaceIds: string[]): Promise<StartWorkResult>;
63
+ }
64
+ /** Canonical editor names across platforms (union for stable UI display). */
65
+ export declare const EDITOR_NAMES: readonly ["WebStorm", "VS Code", "IntelliJ IDEA", "Cursor", "Sublime Text", "HBuilderX"];
66
+ /**
67
+ * Create the devDock data layer for one client plugin fiber.
68
+ * @param ctx - client root context, used to own the mirror's effects.
69
+ * @returns the document mirror and the action facade.
70
+ */
71
+ export declare function createDevDockData(ctx: ClientContext): {
72
+ store: SnapshotStore<DevDockData>;
73
+ actions: DevDockActions;
74
+ };
75
+ //# sourceMappingURL=data.d.ts.map
@@ -0,0 +1,40 @@
1
+ /**
2
+ * devDock proprietary action glyphs. The product icon set has no
3
+ * IDE/terminal glyphs (IconCodeOutline16 is a hash), so these three are
4
+ * drawn locally in the set's own vocabulary: single color (`currentColor`),
5
+ * 16px viewBox, ~1.4px stroke, the same density as IconPlayOutline16.
6
+ * @module @liyuera/dsh-dev-dock/client/icons
7
+ */
8
+ /** Marker props shared by every action glyph. */
9
+ export interface ActionIconProps {
10
+ size?: number;
11
+ className?: string | undefined;
12
+ }
13
+ /**
14
+ * IDE glyph: `</>` code brackets.
15
+ * @param props - icon size and optional class.
16
+ * @returns the 16px editor svg.
17
+ */
18
+ export declare function DevIdeIcon({ size, className }: ActionIconProps): import("react").JSX.Element;
19
+ /**
20
+ * Terminal glyph: `>_` prompt.
21
+ * @param props - icon size and optional class.
22
+ * @returns the 16px terminal svg.
23
+ */
24
+ export declare function DevTerminalIcon({ size, className }: ActionIconProps): import("react").JSX.Element;
25
+ /**
26
+ * App-icon-style terminal fallback: a dark rounded square with a light `>_`
27
+ * prompt, used where the real app icon is unavailable (Assets.car-only
28
+ * bundles, other platforms).
29
+ * @param props - icon size and optional class.
30
+ * @returns the 16px filled terminal svg.
31
+ */
32
+ export declare function DevTerminalAppIcon({ size, className }: ActionIconProps): import("react").JSX.Element;
33
+ /**
34
+ * App-icon-style editor fallback: a blue rounded square with a white `</>`
35
+ * mark, used where the real app icon is unavailable.
36
+ * @param props - icon size and optional class.
37
+ * @returns the 16px filled editor svg.
38
+ */
39
+ export declare function DevIdeAppIcon({ size, className }: ActionIconProps): import("react").JSX.Element;
40
+ //# sourceMappingURL=icons.d.ts.map
@@ -0,0 +1,27 @@
1
+ /**
2
+ * devDock plugin v2, browser half: registers the locale dictionary, the
3
+ * sidebar footer start-work button, the three session-header action buttons
4
+ * (IDE / terminal / start), the start-work dialog, and the devDock settings
5
+ * page. All entries share one viewing store and the settings data mirror.
6
+ */
7
+ import type { Context as ClientContext } from '@deepseek-ai/cordis';
8
+ import { type DevDockKey } from './locales.ts';
9
+ declare module '@deepseek-ai/dsh-client-ui-slots' {
10
+ interface LocaleNamespaceMap {
11
+ /** devDock panel copy. */
12
+ devDock: DevDockKey;
13
+ }
14
+ }
15
+ export type { StartWorkButtonProps, StartWorkButtonInjected } from './StartWorkButton.tsx';
16
+ export type { StartWorkModalProps, StartWorkModalInjected } from './StartWorkModal.tsx';
17
+ export type { ComposerActionsProps, ComposerActionsInjected } from './ComposerActions.tsx';
18
+ export type { DevDockSettingsPageProps, DevDockSettingsInjected } from './DevDockSettingsPage.tsx';
19
+ export type { DevDockData, DevDockActions } from './data.ts';
20
+ /** Required services for data binding and slot contributions. */
21
+ export declare const inject: string[];
22
+ /**
23
+ * Client plugin body: register dictionaries and every surface entry.
24
+ * @param ctx - client root context.
25
+ */
26
+ export declare function apply(ctx: ClientContext): void;
27
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,65 @@
1
+ /**
2
+ * devDock v2 browser copy: entry row, start-work dialog, per-session header
3
+ * actions (IDE / terminal / start), and the settings page. Simplified from
4
+ * v1: projects are dsh workspaces; desktop actions are deterministic.
5
+ * @module @liyuera/dsh-dev-dock/client/locales
6
+ */
7
+ /** devDock dictionary keys. */
8
+ export declare const NS: "devDock";
9
+ /** zh dict. */
10
+ export declare const zh: {
11
+ readonly 'start.button': "开始上班";
12
+ readonly 'start.notice': "选择要启动的工作区项目(记住上次选择)";
13
+ readonly 'start.confirm': "启动";
14
+ readonly 'start.cancel': "取消";
15
+ readonly 'start.running': "正在启动…";
16
+ readonly 'start.done': "已打开 {opened} 个编辑器、{started} 个终端窗口";
17
+ readonly 'start.empty': "没有可用的工作区项目";
18
+ readonly 'start.noWorkspace': "请先在工作区添加项目";
19
+ readonly 'header.ide': "用 IDE 打开";
20
+ readonly 'header.terminal': "打开系统终端";
21
+ readonly 'header.start': "启动(IDE + 终端)";
22
+ readonly 'header.noWorkspace': "当前会话没有关联工作区";
23
+ readonly 'header.error': "操作失败:{error}";
24
+ readonly 'settings.title': "devDock";
25
+ readonly 'settings.workspacePref.title': "工作区编辑器偏好";
26
+ readonly 'settings.workspacePref.hint': "给每个工作区选择打开用的 IDE;不选则按内容自动检测(uni-app → HBuilderX,其它 → WebStorm)。";
27
+ readonly 'settings.editors.title': "编辑器";
28
+ readonly 'settings.editors.refresh': "重新检测";
29
+ readonly 'settings.editors.manual': "手动路径";
30
+ readonly 'settings.editors.save': "保存";
31
+ readonly 'settings.editors.hint': "检测不到或需要指定时,可手动填写(如 HBuilderX)。";
32
+ readonly 'settings.terminal.title': "终端";
33
+ readonly 'settings.terminal.default': "Terminal.app(默认)";
34
+ readonly 'settings.terminal.iterm': "iTerm2";
35
+ };
36
+ /** en dict. */
37
+ export declare const en: {
38
+ readonly 'start.button': "Start Work";
39
+ readonly 'start.notice': "Select workspace projects to start (last selection remembered)";
40
+ readonly 'start.confirm': "Start";
41
+ readonly 'start.cancel': "Cancel";
42
+ readonly 'start.running': "Starting…";
43
+ readonly 'start.done': "Opened {opened} editor(s) and {started} terminal(s)";
44
+ readonly 'start.empty': "No workspace projects available";
45
+ readonly 'start.noWorkspace': "Add projects in the workspace area first";
46
+ readonly 'header.ide': "Open in IDE";
47
+ readonly 'header.terminal': "Open system terminal";
48
+ readonly 'header.start': "Start (IDE + terminal)";
49
+ readonly 'header.noWorkspace': "This session has no associated workspace";
50
+ readonly 'header.error': "Action failed: {error}";
51
+ readonly 'settings.title': "devDock";
52
+ readonly 'settings.workspacePref.title': "Workspace editor preference";
53
+ readonly 'settings.workspacePref.hint': "Pick the IDE each workspace opens with; auto-detected when unset (uni-app → HBuilderX, other → WebStorm).";
54
+ readonly 'settings.editors.title': "Editors";
55
+ readonly 'settings.editors.refresh': "Re-detect";
56
+ readonly 'settings.editors.manual': "Manual path";
57
+ readonly 'settings.editors.save': "Save";
58
+ readonly 'settings.editors.hint': "Set a manual path when detection misses (e.g. HBuilderX).";
59
+ readonly 'settings.terminal.title': "Terminal";
60
+ readonly 'settings.terminal.default': "Terminal.app (default)";
61
+ readonly 'settings.terminal.iterm': "iTerm2";
62
+ };
63
+ /** Full key type of the devDock dictionary. */
64
+ export type DevDockKey = keyof typeof zh;
65
+ //# sourceMappingURL=locales.d.ts.map
@@ -0,0 +1,26 @@
1
+ import type { InjectFace, PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
2
+ import type { DevDockData } from '../api.ts';
3
+ import { NS } from '../locales.ts';
4
+ /** Registration-side inject face (same shape as the drawer's). */
5
+ export interface ImportInjected {
6
+ hooks: {
7
+ /** Settings snapshot bound by the renderer as useDevDockData. */
8
+ devDockData: {
9
+ getSnapshot(): DevDockData;
10
+ subscribe(fn: () => void): () => void;
11
+ };
12
+ };
13
+ /** Prompt the current session to run a dev-dock action tool. */
14
+ promptAgent: (text: string) => Promise<boolean>;
15
+ /** Open the host's native single-directory chooser; null when cancelled. */
16
+ pickDirectory: () => Promise<string | null>;
17
+ }
18
+ /** Full component props. */
19
+ export type ImportPageProps = PropsLocale<typeof NS> & InjectFace<ImportInjected>;
20
+ /**
21
+ * Render the import page.
22
+ * @param props - prompt channel, directory picker, data hook, translator.
23
+ * @returns the import form.
24
+ */
25
+ export declare function ImportPage({ useDevDockData, promptAgent, pickDirectory, t }: ImportPageProps): import("react").JSX.Element;
26
+ //# sourceMappingURL=ImportPage.d.ts.map