dsh-plugin-pinsight 0.0.0-stage → 0.1.0

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.
@@ -0,0 +1,373 @@
1
+ import { z } from 'zod';
2
+ import { HarnessSessionSummary, HarnessWsMessage, HarnessClientMode } from '@pinsight/shared';
3
+
4
+ /**
5
+ * Structural TypeScript definitions matching the Phase 0 verified DeepSeek Harness
6
+ * (@deepseek-ai/dsh@0.2.2-rc.3 / @deepseek-ai/cordis@4.1.0) host APIs.
7
+ *
8
+ * Kept dependency-free so core workspace builds and tests run without bundling
9
+ * internal @deepseek-ai/* host packages.
10
+ */
11
+ type Disposer = () => void;
12
+ type CordisEffectHandle = Disposer | {
13
+ dispose: () => unknown;
14
+ } | void;
15
+ interface DshLogger {
16
+ info?: (...args: unknown[]) => void;
17
+ warn: (...args: unknown[]) => void;
18
+ error?: (...args: unknown[]) => void;
19
+ debug?: (...args: unknown[]) => void;
20
+ }
21
+ interface DshSessionHeader {
22
+ id: string;
23
+ cwd?: string;
24
+ title?: string;
25
+ origin?: string;
26
+ createdAt?: number;
27
+ updatedAt?: number;
28
+ }
29
+ interface DshSession {
30
+ id: string;
31
+ header: DshSessionHeader;
32
+ updatedAt?: number;
33
+ }
34
+ interface DshUserMessage {
35
+ id: string;
36
+ role: 'user';
37
+ content: Array<{
38
+ type: 'text';
39
+ text: string;
40
+ }>;
41
+ source: {
42
+ kind: string;
43
+ [key: string]: unknown;
44
+ };
45
+ createdAt?: number;
46
+ }
47
+ interface DshAgent {
48
+ id: string;
49
+ status: 'idle' | 'running' | string;
50
+ session: DshSession;
51
+ followup: (message: DshUserMessage) => void;
52
+ whenIdle?: () => Promise<void>;
53
+ }
54
+ interface DshAgentsService {
55
+ list: () => DshAgent[];
56
+ get: (sessionId: string) => DshAgent | undefined;
57
+ }
58
+ interface DshSessionsService {
59
+ get?: (sessionId: string) => DshSession | undefined;
60
+ flush: (session: DshSession) => Promise<boolean>;
61
+ }
62
+ interface DshWorkingDirectoryService {
63
+ get: (session: DshSession) => string | undefined;
64
+ }
65
+ interface DshSessionControllerService {
66
+ resolveAgent?: (sessionId: string) => Promise<{
67
+ agent: DshAgent;
68
+ } | {
69
+ error: unknown;
70
+ } | undefined>;
71
+ createSession?: (request: {
72
+ cwd: string;
73
+ sessionId?: string;
74
+ agentPreset?: string;
75
+ }) => Promise<{
76
+ session?: DshSession;
77
+ sessionId?: string;
78
+ id?: string;
79
+ agent?: DshAgent;
80
+ }>;
81
+ }
82
+ interface DshToolExecContext {
83
+ callId?: string;
84
+ name?: string;
85
+ agent?: DshAgent;
86
+ signal?: AbortSignal;
87
+ }
88
+ interface DshToolDefinition<TArgs = Record<string, unknown>, TOutput = unknown> {
89
+ name: string;
90
+ description: string;
91
+ parameters: Record<string, unknown>;
92
+ output: {
93
+ schema: Record<string, unknown>;
94
+ render: (args: TArgs, value: TOutput) => Array<{
95
+ type: 'text';
96
+ text: string;
97
+ }>;
98
+ };
99
+ execute: (args: TArgs, exec: DshToolExecContext) => Promise<TOutput>;
100
+ }
101
+ interface DshToolsService {
102
+ register: (definition: DshToolDefinition<any, any>, options?: Record<string, unknown>) => Disposer;
103
+ }
104
+ interface DshSkillsService {
105
+ register: (skill: {
106
+ name: string;
107
+ description: string;
108
+ content: string;
109
+ source: string;
110
+ whenToUse?: string;
111
+ invocation?: {
112
+ modelInvocable: boolean;
113
+ userInvocable: boolean;
114
+ };
115
+ }) => Disposer;
116
+ }
117
+ interface DshPeer {
118
+ id?: string;
119
+ principal: {
120
+ kind: string;
121
+ [key: string]: unknown;
122
+ };
123
+ }
124
+ type DshRpcResult = {
125
+ ok: true;
126
+ value: unknown;
127
+ } | {
128
+ ok: false;
129
+ error: {
130
+ code: string;
131
+ message: string;
132
+ details: Record<string, unknown>;
133
+ };
134
+ };
135
+ interface DshConnectionService {
136
+ allowsRemoteAuthorities?: boolean;
137
+ rpc?: {
138
+ handle: (channel: string, handler: (endpoint: string, payload: unknown, signal: AbortSignal, peer: DshPeer) => Promise<DshRpcResult> | DshRpcResult) => Disposer;
139
+ };
140
+ fetch?: {
141
+ register: (route: {
142
+ path: string;
143
+ methods: string[];
144
+ requestBody: 'buffered' | 'streaming';
145
+ fetch: (request: Request) => Promise<Response> | Response;
146
+ }) => Disposer;
147
+ };
148
+ }
149
+ interface DshLoaderEntry {
150
+ id?: string;
151
+ disabled?: boolean;
152
+ options?: {
153
+ name?: string;
154
+ config?: unknown;
155
+ };
156
+ }
157
+ interface DshLoaderService {
158
+ entries: () => Iterable<DshLoaderEntry>;
159
+ }
160
+ interface DshContext {
161
+ logger: DshLogger;
162
+ tools: DshToolsService;
163
+ agents?: DshAgentsService;
164
+ sessions?: DshSessionsService;
165
+ workingDirectory?: DshWorkingDirectoryService;
166
+ sessionController?: DshSessionControllerService;
167
+ skills?: DshSkillsService;
168
+ connection?: DshConnectionService;
169
+ webServer?: unknown;
170
+ loader?: DshLoaderService;
171
+ get: <T = unknown>(name: string) => T | undefined;
172
+ inject: (services: string[], callback: (subCtx: DshContext) => void | Disposer) => CordisEffectHandle;
173
+ on: (event: string, listener: (...args: any[]) => unknown) => Disposer;
174
+ effect?: (callback: () => void | Disposer, label?: string) => Disposer;
175
+ }
176
+
177
+ type PathRelation = 'exact' | 'descendant' | 'ancestor';
178
+ /**
179
+ * Canonicalize a filesystem path using fs.realpath when it exists, falling back
180
+ * to path.resolve (handles macOS /tmp -> /private/tmp symlinks consistently).
181
+ */
182
+ declare function canonicalizePath(targetPath: string): Promise<string>;
183
+ /**
184
+ * Strict directory containment check (never matches sibling directories by
185
+ * common prefix such as /Users/dev/a vs /Users/dev/b).
186
+ */
187
+ declare function isPathContained(child: string, parent: string): boolean;
188
+ /**
189
+ * Determine whether sessionCwd and workspaceRoot have an exact or parent/child
190
+ * directory relationship. Both inputs should be canonicalized first.
191
+ */
192
+ declare function matchPathRelation(sessionCwd: string, workspaceRoot: string): PathRelation | null;
193
+ /**
194
+ * Filter and rank candidate sessions for a specific workspaceRoot using strict
195
+ * realpath directory containment.
196
+ *
197
+ * Priority:
198
+ * 1. Exact path match
199
+ * 2. session.cwd inside workspaceRoot (most specific / deepest path first)
200
+ * 3. workspaceRoot inside session.cwd (monorepo root, closest / deepest ancestor first)
201
+ * 4. Tie-breaker: highest lastActiveAt
202
+ */
203
+ declare function rankSessionsForWorkspace(sessions: readonly HarnessSessionSummary[], workspaceRoot: string): Promise<HarnessSessionSummary[]>;
204
+ declare function selectBestSessionForWorkspace(sessions: readonly HarnessSessionSummary[], workspaceRoot: string): Promise<HarnessSessionSummary | null>;
205
+
206
+ declare const UI_EXPLORE_SKILL_NAME = "ui-explore";
207
+ declare const UI_EXPLORE_SKILL_DESCRIPTION = "\u5728 Vite + React \u524D\u7AEF\u9879\u76EE\u4E2D\u901A\u8FC7 pinsight \u753B\u5E03\u5E76\u884C\u751F\u6210 2\u20133 \u5957\u6B63\u4EA4\u5DEE\u5F02\u5316\u7684 UI \u63A2\u7D22\u65B9\u6848\uFF0C\u590D\u7528\u9879\u76EE\u771F\u5B9E\u7EC4\u4EF6\u5E93\u4E0E\u6837\u5F0F\uFF0C\u5E76\u5728\u5B9A\u7A3F\u540E\u5E73\u6ED1\u79FB\u4EA4\u843D\u5165 src/ \u771F\u5B9E\u5DE5\u7A0B\u3002";
208
+ declare const UI_EXPLORE_SKILL_CONTENT = "# `ui-explore` Design Skill\n\n\u5F53\u7528\u6237\u8981\u6C42\u201C\u63A2\u7D22\u51E0\u79CD\u65B9\u6848 / \u6BD4\u7A3F / \u8BBE\u8BA1\u4E00\u4E2A\u65B0\u9875\u9762\u6216\u6539\u7248\u65B9\u6848\u201D\u65F6\uFF0C\u4E25\u683C\u6309\u4EE5\u4E0B 4 \u4E2A\u6B65\u9AA4\u6267\u884C\uFF1A\n\n## Step 0\uFF1A\u73AF\u5883\u51C6\u5907 \u2014 \u68C0\u67E5\u5E76\u751F\u6210 `.pinsight/preview.tsx`\n\n1. \u68C0\u67E5 `<workspaceRoot>/.pinsight/preview.tsx` \u662F\u5426\u5B58\u5728\uFF1B\u82E5\u5DF2\u5B58\u5728\u5219\u8DF3\u8FC7\u3002\n2. \u82E5\u4E0D\u5B58\u5728\uFF0C\u9605\u8BFB\u9879\u76EE `package.json`\u3001`src/main.tsx`\uFF08\u6216 `src/App.tsx`\uFF09\uFF0C\u63D0\u53D6\uFF1A\n * \u5168\u5C40\u6837\u5F0F\u5BFC\u5165\uFF08\u5982 `import '../src/index.css'`\uFF09\uFF1B\n * UI \u7EC4\u4EF6\u5E93 Provider\uFF08\u5982 AntD `ConfigProvider`\u3001MUI `ThemeProvider`\u3001shadcn Tooltip/Theme Provider\uFF09\uFF1B\n * \u6570\u636E/\u72B6\u6001/\u56FD\u9645\u5316 Provider\uFF08\u5982 `QueryClientProvider`\u3001Store Provider\u3001`I18nextProvider`\uFF09\u3002\n3. \u6309\u4EE5\u4E0B\u7B7E\u540D\u751F\u6210 `.pinsight/preview.tsx`\uFF1A\n ```tsx\n import React from 'react';\n import '../src/index.css';\n\n export default function Preview({ children }: { children: React.ReactNode }) {\n // \u5982\u9879\u76EE\u4F7F\u7528 react-router\uFF0C\u4EC5\u4F7F\u7528 MemoryRouter\uFF1A\n // return <MemoryRouter initialEntries={['/']}>{children}</MemoryRouter>;\n return <>{children}</>;\n }\n ```\n4. **\u786C\u6027\u7981\u4EE4**\uFF1A`preview.tsx` **\u4E25\u7981**\u5F15\u5165\u5BBF\u4E3B\u7684 `<BrowserRouter>`\u3001`<RouterProvider>`\u3001\u4E1A\u52A1\u8DEF\u7531\u8868\u6216\u767B\u5F55\u9274\u6743\u5B88\u536B\uFF01\u9700\u8981\u8DEF\u7531\u4E0A\u4E0B\u6587\u65F6\u4E00\u5F8B\u6539\u7528 `<MemoryRouter initialEntries={['/']}>`\u3002\n\n## Step 1\uFF1A\u6B63\u4EA4\u5DEE\u5F02\u77E9\u9635\u5148\u884C\uFF08`.pinsight/<topic>/plan.json`\uFF09\n\n\u7F16\u5199\u4EFB\u4F55\u7EC4\u4EF6\u4EE3\u7801\u524D\uFF0C**\u5FC5\u987B\u5148\u5199\u5165** `.pinsight/<topic>/plan.json`\uFF08\u9ED8\u8BA4 3 \u5957\u65B9\u6848 `v1`\u3001`v2`\u3001`v3`\uFF09\uFF0C\u4E14\u4EFB\u610F\u4E24\u5957\u65B9\u6848\u5728 `layout`\u3001`interaction`\u3001`density` \u4E09\u4E2A\u7EF4\u5EA6\u4E2D\u5FC5\u987B\u81F3\u5C11\u6709 **2 \u4E2A\u7EF4\u5EA6\u5B9E\u8D28\u4E92\u65A5**\u3002\n\n## Step 2\uFF1A\u4E25\u683C\u987A\u5E8F\u843D\u76D8\u751F\u6210\u5404\u65B9\u6848\n\n\u5BF9\u6BCF\u4E2A `<variant>` \u76EE\u5F55 `.pinsight/<topic>/<variant>/`\uFF1A\n1. **\u590D\u7528\u771F\u5B9E\u8D44\u4EA7**\uFF1A\u4F18\u5148\u5BFC\u5165\u5BBF\u4E3B `src/components/` \u4E0E\u9879\u76EE\u5DF2\u5B89\u88C5\u7684 UI \u7EC4\u4EF6\u5E93\u53CA Design Tokens\uFF1B\n2. **\u7981\u6B62\u771F\u5B9E\u5199\u8BF7\u6C42**\uFF1A\u6240\u6709\u793A\u4F8B\u6570\u636E\u7EDF\u4E00\u5199\u5728 `<variant>/mock.ts`\uFF0C\u4E0D\u5F97\u8C03\u7528\u751F\u4EA7/\u540E\u7AEF\u5199\u63A5\u53E3\uFF1B\n3. **\u4E25\u683C\u5199\u5165\u987A\u5E8F\uFF08\u9632\u534A\u6210\u54C1\u6302\u8F7D\uFF09**\uFF1A\u5148\u5199\u5165 `mock.ts`\u3001`index.tsx`\uFF08\u9ED8\u8BA4\u5BFC\u51FA `export default function Variant()`\uFF09\u53CA\u5176\u4ED6\u5B50\u7EC4\u4EF6\uFF0C**\u6700\u540E\u4E00\u6B65**\u518D\u5199\u5165 `meta.json`\uFF1B\n4. \u4E25\u7981\u76F4\u63A5\u4FEE\u6539 `.pinsight/canvas.json` \u6216 `.pinsight/pins.json`\uFF08\u7531\u753B\u5E03\u670D\u52A1\u5355\u5199\u8005\u7EF4\u62A4\uFF09\u3002\n\n## Step 3\uFF1A\u7F16\u8BD1\u4E0E\u89C6\u89C9\u81EA\u68C0\u6536\u5C3E\n\n1. \u5168\u90E8\u65B9\u6848\u5199\u5165\u5B8C\u6210\u540E\uFF0C\u8C03\u7528\u539F\u751F\u5DE5\u5177 `pinsight_get_overview` \u4E0E `pinsight_get_errors`\uFF0C\u786E\u8BA4 `compileErrors` \u4E3A\u7A7A\uFF1B\n2. \u5411\u7528\u6237\u8F93\u51FA\u5E26 Token \u7684 `canvasUrl` \u94FE\u63A5\u53CA\u5404\u65B9\u6848\u6838\u5FC3\u5DEE\u5F02\u6458\u8981\uFF1B\n3. \u5F53\u7528\u6237\u9009\u5B9A\u65B9\u6848\u5E76\u89E6\u53D1\u300C\u79FB\u4EA4\u843D\u5165\u771F\u5B9E\u5DE5\u7A0B\u300D\u540E\uFF0C\u6309\u5BBF\u4E3B `src/` \u8DEF\u7531\u4E0E API Service \u89C4\u8303\u843D\u5730\u4EE3\u7801\uFF0C\u5B8C\u6210\u540E\u660E\u786E\u544A\u77E5\u65B0\u6CE8\u518C\u7684\u672C\u5730\u8DEF\u7531\u8DEF\u5F84\uFF08\u5982 `/orders/new`\uFF09\uFF0C\u4FBF\u4E8E\u7EE7\u7EED\u4F7F\u7528 DOM \u56FE\u9489\u505A 1\u2192100 \u7CBE\u4FEE\u3002\n";
209
+
210
+ interface PinsightToolsHost {
211
+ getSessionCwd: (agent?: DshAgent) => string | undefined;
212
+ }
213
+ interface PinsightToolsOptions {
214
+ defaultWorkspace?: string;
215
+ overrideHome?: string;
216
+ }
217
+ declare function createPinsightToolDefinitions(host: PinsightToolsHost, options?: PinsightToolsOptions): DshToolDefinition<Record<string, unknown>, Record<string, unknown>>[];
218
+ declare function registerPinsightTools(ctx: DshContext, host: PinsightToolsHost, options?: PinsightToolsOptions): Disposer;
219
+
220
+ type HarnessDispatchMessage = Extract<HarnessWsMessage, {
221
+ type: 'harness:dispatch';
222
+ }>;
223
+ interface DispatchOutcome {
224
+ ok: boolean;
225
+ sessionId?: string;
226
+ queued?: boolean;
227
+ deduplicated?: boolean;
228
+ error?: string;
229
+ }
230
+ interface WorkspaceHarnessState {
231
+ dispatchable: boolean;
232
+ canCreateSession: boolean;
233
+ activeSession?: HarnessSessionSummary;
234
+ sessions: HarnessSessionSummary[];
235
+ }
236
+ interface WorkspaceStateSnapshot {
237
+ workspaceRoot: string;
238
+ canvasUrl: string;
239
+ viteOrigin: string;
240
+ openPinCount: number;
241
+ fixedPinCount: number;
242
+ isCanvasOnline: boolean;
243
+ updatedAt: number;
244
+ }
245
+ interface PinsightBridgeClientOptions {
246
+ clientId: string;
247
+ mode: HarnessClientMode;
248
+ defaultWorkspace?: string;
249
+ overrideHome?: string;
250
+ pollIntervalMs?: number;
251
+ reconnectBaseMs?: number;
252
+ reconnectMaxMs?: number;
253
+ dedupTtlMs?: number;
254
+ getWorkspaceHarnessState: (workspaceRoot: string) => Promise<WorkspaceHarnessState>;
255
+ onDispatch: (msg: HarnessDispatchMessage) => Promise<DispatchOutcome>;
256
+ onWorkspaceStatePush?: (state: WorkspaceStateSnapshot) => void;
257
+ onLogWarn?: (message: string) => void;
258
+ }
259
+ declare class PinsightBridgeClient {
260
+ private readonly options;
261
+ private readonly connections;
262
+ private readonly workspaceStates;
263
+ private readonly dispatchDedup;
264
+ private running;
265
+ private syncing;
266
+ private pollTimer;
267
+ private fsWatcher;
268
+ private watchDebounceTimer;
269
+ private agentsAvailable;
270
+ private agentsCanCreateSession;
271
+ private readonly pollIntervalMs;
272
+ private readonly reconnectBaseMs;
273
+ private readonly reconnectMaxMs;
274
+ private readonly dedupTtlMs;
275
+ constructor(options: PinsightBridgeClientOptions);
276
+ get clientId(): string;
277
+ getWorkspaceStates(): WorkspaceStateSnapshot[];
278
+ getConnectedWorkspaces(): string[];
279
+ setAgentsAvailable(dispatchable: boolean, canCreateSession: boolean): void;
280
+ start(): Promise<void>;
281
+ stop(): void;
282
+ private setupGlobalDirWatcher;
283
+ syncNow(): Promise<void>;
284
+ private teardownConnection;
285
+ private connectWorkspace;
286
+ private scheduleReconnect;
287
+ private handleWorkspaceState;
288
+ private pruneDedupCache;
289
+ private handleDispatch;
290
+ private computeHarnessState;
291
+ refreshAllHarnessStates(): Promise<void>;
292
+ }
293
+
294
+ type DetectedRuntimeMode = HarnessClientMode | 'headless';
295
+ interface PinsightDispatchPolicyConfig {
296
+ dispatchWhenBusy: 'queue' | 'new_session' | 'reject';
297
+ dispatchWhenNoSession: 'create' | 'reject';
298
+ }
299
+ interface DshHostAdapter {
300
+ detectRuntimeMode: () => DetectedRuntimeMode;
301
+ warnIfLegacyMcpDetected: () => boolean;
302
+ getSessionCwd: (agent?: DshAgent) => string | undefined;
303
+ canCreateSession: (subCtx?: DshContext) => boolean;
304
+ getWorkspaceSessionState: (workspaceRoot: string) => Promise<WorkspaceHarnessState>;
305
+ attachAgentServices: (subCtx: DshContext, callbacks: {
306
+ onReady: () => void;
307
+ onChange: () => void;
308
+ }) => Disposer;
309
+ dispatchToSession: (msg: HarnessDispatchMessage, config: PinsightDispatchPolicyConfig) => Promise<DispatchOutcome>;
310
+ registerBundledSkill: (subCtx: DshContext) => Disposer;
311
+ mountClientRpcChannel: (subCtx: DshContext, bridge: PinsightBridgeClient) => Disposer;
312
+ }
313
+ declare function isLoopbackHostHeader(hostHeader: string | null | undefined): boolean;
314
+ declare function createDshHostAdapter(ctx: DshContext): DshHostAdapter;
315
+
316
+ declare const name = "pinsight";
317
+ /**
318
+ * Cordis 4.1 `inject` accepts an array of required service names; optional services
319
+ * (`skills`, `agents`, `sessions`, `connection`, `webServer`) are bound dynamically
320
+ * via `ctx.inject([...], ...)` inside `apply()`.
321
+ */
322
+ declare const inject: string[];
323
+ declare const PinsightConfigObjectSchema: z.ZodObject<{
324
+ workspace: z.ZodOptional<z.ZodString>;
325
+ autoRegisterSkill: z.ZodDefault<z.ZodBoolean>;
326
+ dispatchWhenBusy: z.ZodDefault<z.ZodEnum<["queue", "new_session", "reject"]>>;
327
+ dispatchWhenNoSession: z.ZodDefault<z.ZodEnum<["create", "reject"]>>;
328
+ autoStartStandalone: z.ZodDefault<z.ZodBoolean>;
329
+ }, "strip", z.ZodTypeAny, {
330
+ autoRegisterSkill: boolean;
331
+ dispatchWhenBusy: "queue" | "new_session" | "reject";
332
+ dispatchWhenNoSession: "reject" | "create";
333
+ autoStartStandalone: boolean;
334
+ workspace?: string | undefined;
335
+ }, {
336
+ workspace?: string | undefined;
337
+ autoRegisterSkill?: boolean | undefined;
338
+ dispatchWhenBusy?: "queue" | "new_session" | "reject" | undefined;
339
+ dispatchWhenNoSession?: "reject" | "create" | undefined;
340
+ autoStartStandalone?: boolean | undefined;
341
+ }>;
342
+ /**
343
+ * Cordis 4.1 validates plugin Config via @standard-schema/spec (`Config["~standard"].validate`).
344
+ * Zod ^3.24 implements Standard Schema v1 natively while keeping zero hard runtime dependency
345
+ * on internal @deepseek-ai/schemastery outside the DSH host.
346
+ */
347
+ declare const Config: z.ZodDefault<z.ZodObject<{
348
+ workspace: z.ZodOptional<z.ZodString>;
349
+ autoRegisterSkill: z.ZodDefault<z.ZodBoolean>;
350
+ dispatchWhenBusy: z.ZodDefault<z.ZodEnum<["queue", "new_session", "reject"]>>;
351
+ dispatchWhenNoSession: z.ZodDefault<z.ZodEnum<["create", "reject"]>>;
352
+ autoStartStandalone: z.ZodDefault<z.ZodBoolean>;
353
+ }, "strip", z.ZodTypeAny, {
354
+ autoRegisterSkill: boolean;
355
+ dispatchWhenBusy: "queue" | "new_session" | "reject";
356
+ dispatchWhenNoSession: "reject" | "create";
357
+ autoStartStandalone: boolean;
358
+ workspace?: string | undefined;
359
+ }, {
360
+ workspace?: string | undefined;
361
+ autoRegisterSkill?: boolean | undefined;
362
+ dispatchWhenBusy?: "queue" | "new_session" | "reject" | undefined;
363
+ dispatchWhenNoSession?: "reject" | "create" | undefined;
364
+ autoStartStandalone?: boolean | undefined;
365
+ }>>;
366
+ type Config = z.infer<typeof PinsightConfigObjectSchema>;
367
+ interface ApplyRuntimeHooks {
368
+ overrideHome?: string;
369
+ pollIntervalMs?: number;
370
+ }
371
+ declare const apply: (ctx: DshContext, rawConfig?: Partial<Config>, hooks?: ApplyRuntimeHooks) => Disposer;
372
+
373
+ export { type ApplyRuntimeHooks, Config, type CordisEffectHandle, type DetectedRuntimeMode, type DispatchOutcome, type Disposer, type DshAgent, type DshAgentsService, type DshConnectionService, type DshContext, type DshHostAdapter, type DshLoaderEntry, type DshLoaderService, type DshLogger, type DshPeer, type DshRpcResult, type DshSession, type DshSessionControllerService, type DshSessionHeader, type DshSessionsService, type DshSkillsService, type DshToolDefinition, type DshToolExecContext, type DshToolsService, type DshUserMessage, type DshWorkingDirectoryService, type HarnessDispatchMessage, type PathRelation, PinsightBridgeClient, type PinsightBridgeClientOptions, PinsightConfigObjectSchema, type PinsightDispatchPolicyConfig, type PinsightToolsHost, type PinsightToolsOptions, UI_EXPLORE_SKILL_CONTENT, UI_EXPLORE_SKILL_DESCRIPTION, UI_EXPLORE_SKILL_NAME, type WorkspaceHarnessState, type WorkspaceStateSnapshot, apply, canonicalizePath, createDshHostAdapter, createPinsightToolDefinitions, inject, isLoopbackHostHeader, isPathContained, matchPathRelation, name, rankSessionsForWorkspace, registerPinsightTools, selectBestSessionForWorkspace };