@liyuera/dsh-dev-dock 0.0.0-stage → 1.0.3

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 +42 -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,34 @@
1
+ /**
2
+ * devDock projects page: the registered project list with per-project
3
+ * actions (open in terminal / IDE via the agent, remove from registry).
4
+ */
5
+ import type { InjectFace, PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
6
+ import type { DevDockActions, DevDockData } from '../api.ts';
7
+ import { NS } from '../locales.ts';
8
+ import type { DevDockPage } from '../stores.ts';
9
+ /** Registration-side inject face (same shape as the drawer's). */
10
+ export interface ProjectListInjected {
11
+ hooks: {
12
+ /** Settings snapshot bound by the renderer as useDevDockData. */
13
+ devDockData: {
14
+ getSnapshot(): DevDockData;
15
+ subscribe(fn: () => void): () => void;
16
+ };
17
+ };
18
+ /** Data mutation actions. */
19
+ actions: DevDockActions;
20
+ /** Prompt the current session to run a dev-dock action tool. */
21
+ promptAgent: (text: string) => Promise<boolean>;
22
+ }
23
+ /** Full component props. */
24
+ export type ProjectListPageProps = PropsLocale<typeof NS> & InjectFace<ProjectListInjected> & {
25
+ /** Navigate to another drawer page. */
26
+ onNavigate: (page: DevDockPage) => void;
27
+ };
28
+ /**
29
+ * Render the projects page.
30
+ * @param props - data hook, actions, navigator, translator.
31
+ * @returns the project list.
32
+ */
33
+ export declare function ProjectListPage({ useDevDockData, actions, promptAgent, onNavigate, t }: ProjectListPageProps): import("react").JSX.Element;
34
+ //# sourceMappingURL=ProjectListPage.d.ts.map
@@ -0,0 +1,26 @@
1
+ import type { InjectFace, PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
2
+ import type { DevDockActions, DevDockData } from '../api.ts';
3
+ import { NS } from '../locales.ts';
4
+ /** Registration-side inject face (same shape as the drawer's). */
5
+ export interface QuickStartInjected {
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 actions. */
14
+ actions: DevDockActions;
15
+ /** Prompt the current session to run a dev-dock action tool. */
16
+ promptAgent: (text: string) => Promise<boolean>;
17
+ }
18
+ /** Full component props. */
19
+ export type QuickStartPageProps = PropsLocale<typeof NS> & InjectFace<QuickStartInjected>;
20
+ /**
21
+ * Render the quick-start page.
22
+ * @param props - view store, data hook, actions, translator.
23
+ * @returns the quick-start editor.
24
+ */
25
+ export declare function QuickStartPage({ useDevDockData, actions, promptAgent, t }: QuickStartPageProps): import("react").JSX.Element;
26
+ //# sourceMappingURL=QuickStartPage.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client';
2
+ export declare function probe(ctx: ClientContext): void;
3
+ //# sourceMappingURL=probe.d.ts.map
@@ -0,0 +1,22 @@
1
+ /**
2
+ * devDock panel viewing store: the start-work dialog open state. Shared by
3
+ * the sidebar footer button and entry row so the dialog opens from either
4
+ * and survives entry/overlay remounts.
5
+ * @module @liyuera/dsh-dev-dock/client/stores
6
+ */
7
+ import { type EngineStoreHandle } from '@deepseek-ai/dsh-client-store';
8
+ /** Panel viewing state. */
9
+ export type DevDockViewState = {
10
+ /** Whether the start-work dialog is open. */
11
+ open: boolean;
12
+ };
13
+ /** Annotation twin of the actions literal (see defineStore contract). */
14
+ export type DevDockViewActions = {
15
+ setOpen: (draft: DevDockViewState, open: boolean) => void;
16
+ };
17
+ /**
18
+ * Create the devDock viewing store.
19
+ * @returns the store handle (spec + type + identity + factory in one).
20
+ */
21
+ export declare function createDevDockStore(): EngineStoreHandle<DevDockViewState, DevDockViewActions>;
22
+ //# sourceMappingURL=stores.d.ts.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The whole document rides the domain's global slot: devDock has exactly one
3
+ * settings document, and a `single` layout stores it as one readable file
4
+ * under `$DSH_HOME/storages`. A stored document that fails the schema makes
5
+ * `open` reject — this is authoritative user preference, not disposable cache,
6
+ * so it must fail loud rather than silently reset.
7
+ */
8
+ export declare const devDockDomain: {
9
+ name: string;
10
+ version: number;
11
+ global: {
12
+ schema: import("zod").ZodType<import("./schema.ts").DevDockSettings, unknown, import("zod/v4/core").$ZodTypeInternals<import("./schema.ts").DevDockSettings, unknown>>;
13
+ initial: import("./schema.ts").DevDockSettings;
14
+ };
15
+ tables: {};
16
+ };
17
+ //# sourceMappingURL=domain.d.ts.map
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Editor detection service: merges live auto-detection with user-configured
3
+ * paths from settings. The detection routines themselves live in the
4
+ * platform directory.
5
+ * @module @liyuera/dsh-dev-dock/editors
6
+ */
7
+ import type { EditorRecord } from './schema.ts';
8
+ import type { PlatformFacts } from './platform/runner.ts';
9
+ /** Known editor names across platforms (union for stable UI display). */
10
+ export declare const KNOWN_EDITORS: readonly ["WebStorm", "VS Code", "IntelliJ IDEA", "Cursor", "Sublime Text", "HBuilderX"];
11
+ /** Preferable non-uni-app editors, in preference order. */
12
+ export declare const PREFERRED_EDITORS: readonly ["WebStorm", "VS Code", "Cursor", "IntelliJ IDEA", "Sublime Text"];
13
+ /**
14
+ * Run platform editor detection.
15
+ * @param facts - platform facts.
16
+ * @returns detected paths keyed by editor name.
17
+ */
18
+ export declare function detectEditors(facts: PlatformFacts): Promise<Record<string, string>>;
19
+ /**
20
+ * Merge detected paths with manual configuration: manual overrides detection
21
+ * for the same editor; detected paths refresh the cache.
22
+ * @param detected - live detection result.
23
+ * @param stored - editors from settings.
24
+ * @returns merged editor records; empty entries are dropped.
25
+ */
26
+ export declare function mergeEditors(detected: Record<string, string>, stored: readonly EditorRecord[]): EditorRecord[];
27
+ //# sourceMappingURL=editors.d.ts.map
@@ -0,0 +1,31 @@
1
+ /**
2
+ * devDock plugin v2, node half. Projects are dsh workspaces; this half
3
+ * registers the `dev-dock` settings namespace and the desktop-action HTTP
4
+ * route (`POST /dev-dock/action`) that the browser half calls for editor
5
+ * detection and the desktop actions (open editor / system terminal /
6
+ * start-work). Deterministic execution: no agent, no tools, no approval
7
+ * prompt — the button click is the user's authorization. The only guard is
8
+ * the sandbox mode: `read-only` denies desktop side effects.
9
+ *
10
+ * Transport note: static client bundles have no package-private RPC channel
11
+ * (host.call is a dynamic-plugin builtin), so the browser half reaches the
12
+ * host through a same-origin route on the loopback web server.
13
+ * @module @liyuera/dsh-dev-dock
14
+ */
15
+ import type { Context } from '@deepseek-ai/cordis';
16
+ /** Plugin identity. */
17
+ export declare const name = "dev-dock";
18
+ /**
19
+ * Services required by the host half. `webServer` and `storageDomain` mount
20
+ * later in the tree than this row, so they must be declared here: reading them
21
+ * through `ctx.get` in `apply` would find an empty context and silently leave
22
+ * every route and the document unregistered.
23
+ */
24
+ export declare const inject: string[];
25
+ /**
26
+ * Register the document domain, the state route, and the desktop-action routes.
27
+ * @param ctx - Cordis context carrying the web server, the storage facility, the
28
+ * workspace registry, and the sandbox policy.
29
+ */
30
+ export declare function apply(ctx: Context): void;
31
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Package-owned invariant companion for `@liyuera/dsh-dev-dock`.
3
+ * @module @liyuera/dsh-dev-dock/invariant
4
+ */
5
+ import type { Context } from '@deepseek-ai/cordis';
6
+ /** Cordis companion plugin name. */
7
+ export declare const name = "dev-dock-invariant";
8
+ /** Service required before the companion can reserve package ownership. */
9
+ export declare const inject: string[];
10
+ /**
11
+ * Register this package's invariant companion.
12
+ * @param ctx - Cordis context carrying the invariant service.
13
+ * @returns the installed registration's disposer after setup succeeds.
14
+ */
15
+ export declare const apply: (ctx: Context) => Promise<() => void>;
16
+ //# sourceMappingURL=invariant.d.ts.map
@@ -0,0 +1,25 @@
1
+ /**
2
+ * macOS editor detection: Spotlight (mdfind) with a filesystem fallback
3
+ * under /Applications and ~/Applications.
4
+ * @module @liyuera/dsh-dev-dock/platform/editors-darwin
5
+ */
6
+ import type { PlatformFacts } from './runner.ts';
7
+ /** Known macOS editor app bundles. */
8
+ export declare const DARWIN_EDITOR_APPS: ReadonlyArray<{
9
+ name: string;
10
+ app: string;
11
+ }>;
12
+ /**
13
+ * Resolve one app bundle path via Spotlight, then the filesystem fallback.
14
+ * @param facts - platform facts with an injectable runner.
15
+ * @param app - app bundle name (e.g. "WebStorm.app").
16
+ * @returns the app path or undefined when not installed.
17
+ */
18
+ export declare function detectDarwinApp(facts: PlatformFacts, app: string): Promise<string | undefined>;
19
+ /**
20
+ * Detect every known macOS editor.
21
+ * @param facts - platform facts.
22
+ * @returns detected editor paths keyed by editor name.
23
+ */
24
+ export declare function detectDarwinEditors(facts: PlatformFacts): Promise<Record<string, string>>;
25
+ //# sourceMappingURL=editors-darwin.d.ts.map
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Windows editor detection: registry App Paths (HKCU then HKLM) with a
3
+ * `where` PATH fallback.
4
+ * @module @liyuera/dsh-dev-dock/platform/editors-win32
5
+ */
6
+ import type { PlatformFacts } from './runner.ts';
7
+ /** Known Windows editor executables. */
8
+ export declare const WIN32_EDITOR_EXES: ReadonlyArray<{
9
+ name: string;
10
+ exe: string;
11
+ }>;
12
+ /**
13
+ * Locate one editor executable via registry then `where`.
14
+ * @param facts - platform facts.
15
+ * @param exe - executable name.
16
+ * @returns the executable path or undefined when not installed.
17
+ */
18
+ export declare function detectWin32Editor(facts: PlatformFacts, exe: string): Promise<string | undefined>;
19
+ /**
20
+ * Detect every known Windows editor.
21
+ * @param facts - platform facts.
22
+ * @returns detected editor paths keyed by editor name.
23
+ */
24
+ export declare function detectWin32Editors(facts: PlatformFacts): Promise<Record<string, string>>;
25
+ //# sourceMappingURL=editors-win32.d.ts.map
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Cross-platform "open project in IDE" actions. Every command goes through
3
+ * the no-shell runner with an argv array; no shell string is ever built.
4
+ * @module @liyuera/dsh-dev-dock/platform/open-ide
5
+ */
6
+ import type { PlatformFacts } from './runner.ts';
7
+ /** IDE display name → macOS app bundle name. */
8
+ export declare const DARWIN_APP_NAMES: Record<string, string>;
9
+ /**
10
+ * Open one project with an IDE.
11
+ * @param facts - platform facts with an injectable runner.
12
+ * @param projectPath - absolute project path.
13
+ * @param editorName - canonical editor name.
14
+ * @param editorPath - resolved editor executable/app path (detected or manual).
15
+ * @returns ok, or an error message when the open failed.
16
+ */
17
+ export declare function openProjectInIde(facts: PlatformFacts, projectPath: string, editorName: string, editorPath: string): Promise<{
18
+ ok: true;
19
+ } | {
20
+ ok: false;
21
+ error: string;
22
+ }>;
23
+ //# sourceMappingURL=open-ide.d.ts.map
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Cross-platform "open a system terminal window" actions. macOS drives
3
+ * Terminal.app through osascript (iTerm fallback when the config asks for it
4
+ * or Terminal fails); Windows prefers Windows Terminal and falls back to a
5
+ * plain cmd window. Every command goes through the no-shell runner.
6
+ * @module @liyuera/dsh-dev-dock/platform/open-terminal
7
+ */
8
+ import type { PlatformFacts } from './runner.ts';
9
+ /** Build the shell command executed inside the terminal window. */
10
+ export declare function terminalCommand(projectPath: string, command?: string): string;
11
+ /**
12
+ * Open a system terminal window at a project directory.
13
+ * @param facts - platform facts.
14
+ * @param projectPath - absolute project path.
15
+ * @param command - optional command to run after cd.
16
+ * @param preferIterm - macOS: prefer iTerm over Terminal.app.
17
+ * @returns ok, or an error message.
18
+ */
19
+ export declare function openProjectTerminal(facts: PlatformFacts, projectPath: string, command?: string, preferIterm?: boolean): Promise<{
20
+ ok: true;
21
+ } | {
22
+ ok: false;
23
+ error: string;
24
+ }>;
25
+ //# sourceMappingURL=open-terminal.d.ts.map
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Host command runner facade: wraps `runNativeCommand` behind an injectable
3
+ * platform seam so platform logic is deterministically testable.
4
+ * @module @liyuera/dsh-dev-dock/platform/runner
5
+ */
6
+ import { type NativeCommandRunner } from '@deepseek-ai/dsh-native-command';
7
+ /** Command boundary signature mirrored from native-command. */
8
+ export type CommandRunner = NativeCommandRunner;
9
+ /** Default runner: no-shell execFile with utf8 capture. */
10
+ export declare const defaultRunner: CommandRunner;
11
+ /** Injectable platform facts for deterministic adapter tests. */
12
+ export interface PlatformFacts {
13
+ /** Node platform string. */
14
+ platform: NodeJS.Platform;
15
+ /** Executable runner (defaults to the real one). */
16
+ run: CommandRunner;
17
+ /** HOME directory used by macOS app detection. */
18
+ home: string;
19
+ }
20
+ /** Build the live platform facts. */
21
+ export declare function liveFacts(): PlatformFacts;
22
+ //# sourceMappingURL=runner.d.ts.map
@@ -0,0 +1,52 @@
1
+ /**
2
+ * devDock document v2: per-workspace IDE preferences, editor manual paths,
3
+ * terminal preference, and the start-work selection memory. Projects are dsh
4
+ * workspaces, so no separate project registry exists. Persisted through the
5
+ * storage capability (`$DSH_HOME/storages/dev_dock.json`, domain `dev_dock`).
6
+ * @module @liyuera/dsh-dev-dock/schema
7
+ */
8
+ import { z } from 'zod';
9
+ /** Workspace id (dsh workspace registry id) one IDE preference is keyed by. */
10
+ export type WorkspacePrefKey = string;
11
+ /** One known editor: auto-detected path and/or user-configured path. */
12
+ export interface EditorRecord {
13
+ /** Canonical editor name (WebStorm, VS Code, IntelliJ IDEA, Cursor, Sublime Text, HBuilderX). */
14
+ name: string;
15
+ /** Auto-detected executable/app path (empty when not installed). */
16
+ detectedPath?: string | undefined;
17
+ /** User-configured executable/app path (HBuilderX relies on this). */
18
+ manualPath?: string | undefined;
19
+ }
20
+ /** Whole devDock document. */
21
+ export interface DevDockSettings {
22
+ /** Per-workspace IDE preference (falls back to auto-detection defaults). */
23
+ workspacePrefs: Array<{
24
+ workspaceId: WorkspacePrefKey;
25
+ editor: string;
26
+ }>;
27
+ /** Editor detection cache plus user-configured paths. */
28
+ editors: EditorRecord[];
29
+ /** macOS terminal preference; 'default' uses Terminal.app, 'iterm' iTerm. */
30
+ terminalApp: 'default' | 'iterm';
31
+ /** Workspace ids of the last start-work selection (dialog prefill). */
32
+ startWork: string[];
33
+ }
34
+ /**
35
+ * Storage domain holding the document. `UNIT_NAME_RE` forbids hyphens, so the
36
+ * domain name is underscored while the HTTP paths keep the hyphenated form.
37
+ */
38
+ export declare const DEV_DOCK_DOMAIN = "dev_dock";
39
+ /** The four fields the browser half may write, one at a time. */
40
+ export declare const DEV_DOCK_FIELDS: readonly ["workspacePrefs", "editors", "terminalApp", "startWork"];
41
+ /** One field name the browser half may write. */
42
+ export type DevDockField = (typeof DEV_DOCK_FIELDS)[number];
43
+ /**
44
+ * Document schema. Doubles as the storage domain's global schema (validated at
45
+ * the durable read boundary) and as the write guard for the browser route: a
46
+ * patch that would store a document this schema rejects is refused before it
47
+ * reaches the medium.
48
+ */
49
+ export declare const DevDockDocumentSchema: z.ZodType<DevDockSettings>;
50
+ /** Document served before the first write. */
51
+ export declare const EMPTY_DEV_DOCK_SETTINGS: DevDockSettings;
52
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Desktop action tools: open a project in an IDE, open a system terminal at
3
+ * a project (optionally running one script), and run a quick-start plan.
4
+ * All three are user-visible desktop side effects and follow the approval
5
+ * pipeline: `never` policy executes directly, `ask` goes through
6
+ * `ctx.approval.request` with one consolidated question per tool call.
7
+ * @module @liyuera/dsh-dev-dock/tools/actions
8
+ */
9
+ import type { ToolRunContext } from '@deepseek-ai/dsh-tools';
10
+ import type { ApprovalService } from '@deepseek-ai/dsh-user-approval';
11
+ import type { DevDockScope } from './project.ts';
12
+ import type { PlatformFacts } from '../platform/runner.ts';
13
+ /**
14
+ * Decide whether one desktop action may run: the session's effective
15
+ * approval policy, asking through the approval service when the policy is
16
+ * `ask`. The `never` policy never asks — full access executes directly.
17
+ * @param approval - the approval service.
18
+ * @param exec - the live tool execution carrying the agent.
19
+ * @param toolName - tool identity for the audit pair.
20
+ * @param reason - user-facing explanation of the action.
21
+ * @returns true when the action is allowed.
22
+ */
23
+ export declare function requireApproval(approval: ApprovalService, exec: ToolRunContext, toolName: string, reason: string): Promise<{
24
+ allowed: true;
25
+ } | {
26
+ allowed: false;
27
+ error: string;
28
+ }>;
29
+ /** Tool: open one project in an IDE. */
30
+ export declare function openIdeTool(scope: DevDockScope, facts: PlatformFacts, approval: ApprovalService): import("@deepseek-ai/dsh-tools").ToolDefinition;
31
+ /** Tool: open a system terminal at a project, optionally running one script. */
32
+ export declare function openTerminalTool(scope: DevDockScope, facts: PlatformFacts, approval: ApprovalService): import("@deepseek-ai/dsh-tools").ToolDefinition;
33
+ /** Tool: run one quick-start plan (batch open IDEs + start scripts). */
34
+ export declare function quickStartTool(scope: DevDockScope, facts: PlatformFacts, approval: ApprovalService): import("@deepseek-ai/dsh-tools").ToolDefinition;
35
+ //# sourceMappingURL=actions.d.ts.map
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Editor detection tool: merges live auto-detection with user-configured
3
+ * paths from settings, and persists detected paths back for the UI.
4
+ * @module @liyuera/dsh-dev-dock/tools/editors
5
+ */
6
+ import type { DevDockScope } from './project.ts';
7
+ import type { EditorRecord } from '../schema.ts';
8
+ import type { PlatformFacts } from '../platform/runner.ts';
9
+ /** Known editor names across platforms (union for stable UI display). */
10
+ export declare const KNOWN_EDITORS: readonly ["WebStorm", "VS Code", "IntelliJ IDEA", "Cursor", "Sublime Text", "HBuilderX"];
11
+ /**
12
+ * Run platform editor detection.
13
+ * @param facts - platform facts.
14
+ * @returns detected paths keyed by editor name.
15
+ */
16
+ export declare function detectEditors(facts: PlatformFacts): Promise<Record<string, string>>;
17
+ /**
18
+ * Merge detected paths with manual configuration: detected wins unless a
19
+ * manual path exists (manual overrides detection for the same editor).
20
+ * @param detected - live detection result.
21
+ * @param stored - editors from settings.
22
+ * @returns merged editor records, persisted order kept, new names appended.
23
+ */
24
+ export declare function mergeEditors(detected: Record<string, string>, stored: readonly EditorRecord[]): EditorRecord[];
25
+ /** Tool: detect installed editors and merge user configuration. */
26
+ export declare function listEditorsTool(scope: DevDockScope, facts: PlatformFacts): import("@deepseek-ai/dsh-tools").ToolDefinition;
27
+ //# sourceMappingURL=editors.d.ts.map
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Project registry tools: save (upsert), list, remove. All mutations go
3
+ * through the plugin's settings namespace scope.
4
+ * @module @liyuera/dsh-dev-dock/tools/project
5
+ */
6
+ import type { SettingsScope } from '@deepseek-ai/dsh-settings';
7
+ import type { DevDockSettings, ProjectId, ProjectRecord } from '../schema.ts';
8
+ /** Scope facade the tools read and mutate. */
9
+ export interface DevDockScope {
10
+ /** Read the current settings document. */
11
+ get(): DevDockSettings;
12
+ /** Merge a partial patch into the document. */
13
+ update(patch: Partial<DevDockSettings>): void;
14
+ }
15
+ /** Wrap a live settings scope behind the tool facade. */
16
+ export declare function scopeOf(scope: SettingsScope<DevDockSettings>): DevDockScope;
17
+ /**
18
+ * Mint the next project id (max numeric id + 1, or "1").
19
+ * @param projects - current project list.
20
+ * @returns the next id.
21
+ */
22
+ export declare function nextProjectId(projects: readonly ProjectRecord[]): ProjectId;
23
+ /**
24
+ * Upsert one project: same path keeps its id and createdAt (update overwrite).
25
+ * @param current - current document.
26
+ * @param project - candidate project record (id may be empty on insert).
27
+ * @returns the new document and the stored record.
28
+ */
29
+ export declare function upsertProject(current: DevDockSettings, project: Omit<ProjectRecord, 'id' | 'createdAt'> & {
30
+ id?: ProjectId;
31
+ }): {
32
+ next: DevDockSettings;
33
+ stored: ProjectRecord;
34
+ };
35
+ /**
36
+ * Remove one project and cascade-clean its quick-start references.
37
+ * @param current - current document.
38
+ * @param projectId - project id to remove.
39
+ * @returns the new document; false when the id did not exist.
40
+ */
41
+ export declare function removeProject(current: DevDockSettings, projectId: ProjectId): {
42
+ next: DevDockSettings;
43
+ } | null;
44
+ /** Tool: save one analyzed project (insert or update overwrite). */
45
+ export declare function saveProjectTool(scope: DevDockScope): import("@deepseek-ai/dsh-tools").ToolDefinition;
46
+ /** Tool: list all registered projects. */
47
+ export declare function listProjectsTool(scope: DevDockScope): import("@deepseek-ai/dsh-tools").ToolDefinition;
48
+ /** Tool: remove one project from the registry (cascades quick-start references). */
49
+ export declare function removeProjectTool(scope: DevDockScope): import("@deepseek-ai/dsh-tools").ToolDefinition;
50
+ //# sourceMappingURL=project.d.ts.map
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Deterministic directory scan for frontend project candidates. The tool
3
+ * returns raw signals only — the AI decides which candidates are frontend
4
+ * projects and what their environment is.
5
+ * @module @liyuera/dsh-dev-dock/tools/scan
6
+ */
7
+ /** Signals one candidate directory exposes for AI judgment. */
8
+ export interface CandidateSignals {
9
+ /** Absolute candidate path. */
10
+ path: string;
11
+ /** Directory basename. */
12
+ name: string;
13
+ /** Has package.json (Node project marker). */
14
+ hasPackageJson: boolean;
15
+ /** Has manifest.json or src/manifest.json (uni-app marker). */
16
+ hasManifest: boolean;
17
+ /** Has project.config.json or miniprogramRoot (miniapp marker). */
18
+ hasMiniappConfig: boolean;
19
+ /** Lock file name when present. */
20
+ lockFile?: string;
21
+ /** Has .nvmrc or .node-version. */
22
+ hasNodeVersionFile: boolean;
23
+ /** Top-level dependencies present in package.json (vue/react/taro/uni-app etc.). */
24
+ dependencies: string[];
25
+ /** script names from package.json. */
26
+ scriptNames: string[];
27
+ /** package.json description when present. */
28
+ description?: string;
29
+ }
30
+ /**
31
+ * Collect signals for one candidate directory.
32
+ * @param dir - absolute candidate directory.
33
+ * @returns candidate signals.
34
+ */
35
+ export declare function collectSignals(dir: string): CandidateSignals;
36
+ /**
37
+ * Scan one directory: the directory itself plus its direct children.
38
+ * @param root - absolute directory to scan.
39
+ * @returns candidate signals for the root and each direct subdirectory.
40
+ */
41
+ export declare function scanCandidates(root: string): CandidateSignals[];
42
+ /** Model-facing tool: scan one directory for frontend project candidates. */
43
+ export declare const scanCandidatesTool: import("@deepseek-ai/dsh-tools").ToolDefinition;
44
+ //# sourceMappingURL=scan.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,87 @@
1
1
  {
2
2
  "name": "@liyuera/dsh-dev-dock",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "description": "Frontend project engineering management for dsh: project registry, editor detection, quick-start, open project in IDE or system terminal",
4
+ "version": "1.0.3",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "types": "lib/types/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./lib/types/index.d.ts",
11
+ "default": "./lib/index.js"
12
+ },
13
+ "./invariant": {
14
+ "types": "./lib/types/invariant.d.ts",
15
+ "default": "./lib/invariant.js"
16
+ },
17
+ "./client": {
18
+ "types": "./lib/types/client/index.d.ts",
19
+ "default": "./lib/client.js"
20
+ },
21
+ "./src/*": "./src/*",
22
+ "./package.json": "./package.json"
23
+ },
24
+ "dsh": {
25
+ "bundle": {
26
+ "patch": "./cordis.patch.yml"
27
+ },
28
+ "client": {
29
+ "inject": [
30
+ "@deepseek-ai/dsh-client-locale",
31
+ "@deepseek-ai/dsh-client-ui-layout",
32
+ "@deepseek-ai/dsh-client-ui-renderer",
33
+ "@deepseek-ai/dsh-client-ui-settings"
34
+ ],
35
+ "platform": "web"
36
+ }
37
+ },
38
+ "scripts": {
39
+ "bundle": "tsdown --config-loader tsx",
40
+ "watch": "tsdown --watch --config-loader tsx"
41
+ },
42
+ "license": "UNLICENSED",
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "git+https://github.com/liyuera/deepseek-harness-plugin.git",
46
+ "directory": "dev-dock"
47
+ },
48
+ "publishConfig": {
49
+ "access": "public"
50
+ },
51
+ "dependencies": {
52
+ "clsx": "^2.0.0"
53
+ },
54
+ "peerDependencies": {
55
+ "@deepseek-ai/cordis": "^4.0.2"
56
+ },
57
+ "devDependencies": {
58
+ "@deepseek-ai/cordis": "^4.0.2",
59
+ "@deepseek-ai/dsh-client-locale": "^0.1.2-alpha.4",
60
+ "@deepseek-ai/dsh-client-store": "^0.1.2-alpha.4",
61
+ "@deepseek-ai/dsh-client-ui-conversation": "^0.1.2-alpha.4",
62
+ "@deepseek-ai/dsh-client-ui-layout": "^0.1.2-alpha.4",
63
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.0-rc.2",
64
+ "@deepseek-ai/dsh-client-ui-renderer": "^0.1.2-alpha.4",
65
+ "@deepseek-ai/dsh-client-ui-settings": "^0.1.2-alpha.4",
66
+ "@deepseek-ai/dsh-client-ui-sidebar": "^0.1.2-alpha.4",
67
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.2-alpha.4",
68
+ "@deepseek-ai/dsh-invariants": "^0.1.2-alpha.4",
69
+ "@deepseek-ai/dsh-native-command": "^0.1.2-alpha.4",
70
+ "@deepseek-ai/dsh-session": "^0.1.2-alpha.4",
71
+ "@deepseek-ai/dsh-storage-domain": "^0.1.6-alpha.2",
72
+ "@deepseek-ai/schemastery": "^3.18.2",
73
+ "@testing-library/react": "^16.3.2",
74
+ "@types/react": "~18.3.1",
75
+ "@types/react-dom": "~18.3.1",
76
+ "react": "^18.2.0",
77
+ "react-dom": "^18.3.1",
78
+ "zod": "^4.4.3"
79
+ },
80
+ "files": [
81
+ "lib/index.js",
82
+ "lib/invariant.js",
83
+ "lib/client.js",
84
+ "lib/types/**/*.d.ts",
85
+ "cordis.patch.yml"
86
+ ]
87
+ }