dsh-deeppilot 0.2.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.
- package/COMPATIBILITY.md +36 -0
- package/LICENSE +21 -0
- package/PRIVACY.md +64 -0
- package/README.md +97 -0
- package/README.zh-CN.md +91 -0
- package/SECURITY.md +44 -0
- package/THIRD_PARTY_NOTICES.md +20 -0
- package/bin/SHA256SUMS +1 -0
- package/bin/darwin-arm64/dsh-deeppilot-tunnel +0 -0
- package/cordis.patch.yml +20 -0
- package/lib/client.js +3398 -0
- package/lib/client.js.map +1 -0
- package/lib/index.d.ts +586 -0
- package/lib/index.js +3654 -0
- package/lib/index.js.map +1 -0
- package/package.json +102 -0
- package/third_party/licenses/filippo.io/edwards25519/LICENSE +27 -0
- package/third_party/licenses/github.com/Mars-Sea/dsh-deeppilot/helper/LICENSE +21 -0
- package/third_party/licenses/github.com/coder/websocket/LICENSE.txt +13 -0
- package/third_party/licenses/github.com/creachadair/msync/trigger/LICENSE +26 -0
- package/third_party/licenses/github.com/fxamacker/cbor/v2/LICENSE +21 -0
- package/third_party/licenses/github.com/gaissmai/bart/LICENSE +21 -0
- package/third_party/licenses/github.com/go-json-experiment/json/LICENSE +27 -0
- package/third_party/licenses/github.com/golang/groupcache/lru/LICENSE +191 -0
- package/third_party/licenses/github.com/google/btree/LICENSE +202 -0
- package/third_party/licenses/github.com/hdevalence/ed25519consensus/LICENSE +28 -0
- package/third_party/licenses/github.com/huin/goupnp/LICENSE +23 -0
- package/third_party/licenses/github.com/klauspost/compress/LICENSE +304 -0
- package/third_party/licenses/github.com/klauspost/compress/internal/snapref/LICENSE +27 -0
- package/third_party/licenses/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt +22 -0
- package/third_party/licenses/github.com/mitchellh/go-ps/LICENSE.md +21 -0
- package/third_party/licenses/github.com/pires/go-proxyproto/LICENSE +201 -0
- package/third_party/licenses/github.com/tailscale/certstore/LICENSE.md +21 -0
- package/third_party/licenses/github.com/tailscale/hujson/LICENSE +27 -0
- package/third_party/licenses/github.com/tailscale/peercred/LICENSE +29 -0
- package/third_party/licenses/github.com/tailscale/web-client-prebuilt/LICENSE +28 -0
- package/third_party/licenses/github.com/tailscale/wireguard-go/LICENSE +17 -0
- package/third_party/licenses/github.com/x448/float16/LICENSE +22 -0
- package/third_party/licenses/go4.org/mem/LICENSE +202 -0
- package/third_party/licenses/go4.org/netipx/LICENSE +27 -0
- package/third_party/licenses/golang.org/x/crypto/LICENSE +27 -0
- package/third_party/licenses/golang.org/x/exp/LICENSE +27 -0
- package/third_party/licenses/golang.org/x/net/LICENSE +27 -0
- package/third_party/licenses/golang.org/x/oauth2/LICENSE +27 -0
- package/third_party/licenses/golang.org/x/sync/errgroup/LICENSE +27 -0
- package/third_party/licenses/golang.org/x/sys/LICENSE +27 -0
- package/third_party/licenses/golang.org/x/term/LICENSE +27 -0
- package/third_party/licenses/golang.org/x/text/LICENSE +27 -0
- package/third_party/licenses/golang.org/x/time/rate/LICENSE +27 -0
- package/third_party/licenses/gvisor.dev/gvisor/pkg/LICENSE +254 -0
- package/third_party/licenses/npm/dijkstrajs/LICENSE +17 -0
- package/third_party/licenses/npm/qrcode/LICENSE +21 -0
- package/third_party/licenses/tailscale.com/LICENSE +28 -0
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,586 @@
|
|
|
1
|
+
import { IncomingMessage } from "node:http";
|
|
2
|
+
import z from "@deepseek-ai/schemastery";
|
|
3
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
4
|
+
//#region src/protocol.d.ts
|
|
5
|
+
type SessionStatus = "running" | "idle" | "error" | "unknown";
|
|
6
|
+
type SessionTodoStatus = "pending" | "in_progress" | "completed";
|
|
7
|
+
/** One checklist entry of the session todo projection. */
|
|
8
|
+
interface SessionTodoItem {
|
|
9
|
+
content: string;
|
|
10
|
+
status: SessionTodoStatus;
|
|
11
|
+
}
|
|
12
|
+
interface SessionSummary {
|
|
13
|
+
id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
status: SessionStatus;
|
|
16
|
+
lastActivityTs: number;
|
|
17
|
+
todos: {
|
|
18
|
+
done: number;
|
|
19
|
+
total: number;
|
|
20
|
+
} | null;
|
|
21
|
+
/** Full checklist so a conversation view can render progress, not just counts. Absent/null when the session has none. */
|
|
22
|
+
todoItems?: SessionTodoItem[] | null;
|
|
23
|
+
pendingApproval: boolean;
|
|
24
|
+
pendingQuestion: boolean;
|
|
25
|
+
workspaceLabel: string | null;
|
|
26
|
+
workspaceId?: string | null;
|
|
27
|
+
workspacePath?: string | null;
|
|
28
|
+
}
|
|
29
|
+
type NotifyCategory = 'turn.completed' | 'approval.required' | 'question.asked' | 'session.error';
|
|
30
|
+
/**
|
|
31
|
+
* One offline-push-worthy event (same facts as s2c.notify / pending frames,
|
|
32
|
+
* projected for APNs). The bridge fans these out to paired devices that hold
|
|
33
|
+
* an APNs token and no live WebSocket.
|
|
34
|
+
*/
|
|
35
|
+
interface PushNotification {
|
|
36
|
+
notificationId: string;
|
|
37
|
+
category: NotifyCategory;
|
|
38
|
+
sessionId: string;
|
|
39
|
+
title: string;
|
|
40
|
+
body: string;
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/host-bridge.d.ts
|
|
44
|
+
interface RpcOk<T> {
|
|
45
|
+
ok: true;
|
|
46
|
+
value: T;
|
|
47
|
+
}
|
|
48
|
+
interface RpcErr {
|
|
49
|
+
ok: false;
|
|
50
|
+
error: {
|
|
51
|
+
code: string;
|
|
52
|
+
message?: string;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
type RpcResult<T> = RpcOk<T> | RpcErr;
|
|
56
|
+
interface RpcRequestLike<T> {
|
|
57
|
+
rpcId?: string;
|
|
58
|
+
payload?: T;
|
|
59
|
+
}
|
|
60
|
+
interface RpcResponseLike<T> {
|
|
61
|
+
result?: RpcResult<T>;
|
|
62
|
+
}
|
|
63
|
+
interface SessionsApiLike {
|
|
64
|
+
list(req?: RpcRequestLike<{
|
|
65
|
+
cursor?: string;
|
|
66
|
+
}>): Promise<RpcResponseLike<{
|
|
67
|
+
items: PhoneSessionRow[];
|
|
68
|
+
}>>;
|
|
69
|
+
history(req: RpcRequestLike<{
|
|
70
|
+
sessionId: string;
|
|
71
|
+
beforeSeq?: number;
|
|
72
|
+
maxMessages?: number;
|
|
73
|
+
}>): Promise<RpcResponseLike<HistoryResult>>;
|
|
74
|
+
prompt(req: RpcRequestLike<PromptArgs>): Promise<RpcResponseLike<{
|
|
75
|
+
accepted: true;
|
|
76
|
+
}>>;
|
|
77
|
+
create(req: RpcRequestLike<{
|
|
78
|
+
workspaceId?: string;
|
|
79
|
+
cwd?: string;
|
|
80
|
+
agentPreset?: string;
|
|
81
|
+
}>): Promise<RpcResponseLike<{
|
|
82
|
+
sessionId: string;
|
|
83
|
+
agentPreset?: string;
|
|
84
|
+
}>>;
|
|
85
|
+
models?(req: RpcRequestLike<{
|
|
86
|
+
sessionId: string;
|
|
87
|
+
}>): Promise<RpcResponseLike<HostSessionModels>>;
|
|
88
|
+
selectModel?(req: RpcRequestLike<{
|
|
89
|
+
sessionId: string;
|
|
90
|
+
provider: string;
|
|
91
|
+
model: string;
|
|
92
|
+
reasoningEffort?: string;
|
|
93
|
+
}>): Promise<RpcResponseLike<{
|
|
94
|
+
selected: HostModelSelection;
|
|
95
|
+
}>>;
|
|
96
|
+
rename?(req: RpcRequestLike<{
|
|
97
|
+
sessionId: string;
|
|
98
|
+
title: string;
|
|
99
|
+
}>): Promise<RpcResponseLike<{
|
|
100
|
+
title: string;
|
|
101
|
+
seq: number;
|
|
102
|
+
}>>;
|
|
103
|
+
cancel?(req: RpcRequestLike<{
|
|
104
|
+
sessionId: string;
|
|
105
|
+
}>): Promise<RpcResponseLike<Record<string, unknown> | undefined>>;
|
|
106
|
+
/** Reads one durable image back after the host verifies the session log references its id. */
|
|
107
|
+
attachment?(req: RpcRequestLike<{
|
|
108
|
+
sessionId: string;
|
|
109
|
+
attachmentId: string;
|
|
110
|
+
}>): Promise<RpcResponseLike<{
|
|
111
|
+
attachment: {
|
|
112
|
+
mediaType?: string;
|
|
113
|
+
};
|
|
114
|
+
data: string;
|
|
115
|
+
}>>;
|
|
116
|
+
}
|
|
117
|
+
interface WorkspaceApiLike {
|
|
118
|
+
list?(req: RpcRequestLike<Record<string, never>>): Promise<RpcResponseLike<{
|
|
119
|
+
items: WorkspaceViewLike[];
|
|
120
|
+
archivedSessionIds: string[];
|
|
121
|
+
}>>;
|
|
122
|
+
create?(req: RpcRequestLike<{
|
|
123
|
+
path: string;
|
|
124
|
+
}>): Promise<RpcResponseLike<{
|
|
125
|
+
workspace: WorkspaceViewLike;
|
|
126
|
+
created: boolean;
|
|
127
|
+
}>>;
|
|
128
|
+
archiveSession?(req: RpcRequestLike<{
|
|
129
|
+
sessionId: string;
|
|
130
|
+
}>): Promise<RpcResponseLike<{
|
|
131
|
+
archivedSessionIds: string[];
|
|
132
|
+
}>>;
|
|
133
|
+
}
|
|
134
|
+
interface HostApiLike {
|
|
135
|
+
listDirectory?(req: RpcRequestLike<{
|
|
136
|
+
path?: string;
|
|
137
|
+
}>, signal?: AbortSignal): Promise<RpcResponseLike<DirectoryListingLike>>;
|
|
138
|
+
pickDirectory?(req: RpcRequestLike<Record<string, never>>, signal?: AbortSignal): Promise<RpcResponseLike<{
|
|
139
|
+
path: string | null;
|
|
140
|
+
}>>;
|
|
141
|
+
}
|
|
142
|
+
interface WorkspaceViewLike {
|
|
143
|
+
workspaceId: string;
|
|
144
|
+
path: string;
|
|
145
|
+
title: string;
|
|
146
|
+
sessionIds: string[];
|
|
147
|
+
createdAt?: string;
|
|
148
|
+
updatedAt?: string;
|
|
149
|
+
}
|
|
150
|
+
interface DirectoryEntryLike {
|
|
151
|
+
name: string;
|
|
152
|
+
path: string;
|
|
153
|
+
hidden: boolean;
|
|
154
|
+
}
|
|
155
|
+
interface DirectoryListingLike {
|
|
156
|
+
path: string;
|
|
157
|
+
home: string;
|
|
158
|
+
crumbs: DirectoryEntryLike[];
|
|
159
|
+
entries: DirectoryEntryLike[];
|
|
160
|
+
truncated: boolean;
|
|
161
|
+
}
|
|
162
|
+
interface HostModelSelection {
|
|
163
|
+
provider: string;
|
|
164
|
+
model: string;
|
|
165
|
+
reasoningEffort?: string;
|
|
166
|
+
}
|
|
167
|
+
interface HostSessionModels {
|
|
168
|
+
current: HostModelSelection;
|
|
169
|
+
routable: boolean;
|
|
170
|
+
groups: Array<{
|
|
171
|
+
id: string;
|
|
172
|
+
name: string;
|
|
173
|
+
models: Array<{
|
|
174
|
+
id: string;
|
|
175
|
+
name: string;
|
|
176
|
+
description?: string;
|
|
177
|
+
reasoning?: {
|
|
178
|
+
efforts: Array<{
|
|
179
|
+
id: string;
|
|
180
|
+
name: string;
|
|
181
|
+
description?: string;
|
|
182
|
+
}>;
|
|
183
|
+
defaultEffort?: string;
|
|
184
|
+
};
|
|
185
|
+
}>;
|
|
186
|
+
}>;
|
|
187
|
+
failures: Array<{
|
|
188
|
+
id: string;
|
|
189
|
+
name: string;
|
|
190
|
+
message: string;
|
|
191
|
+
}>;
|
|
192
|
+
}
|
|
193
|
+
type ModelBridgeResult<T> = {
|
|
194
|
+
ok: true;
|
|
195
|
+
value: T;
|
|
196
|
+
} | {
|
|
197
|
+
ok: false;
|
|
198
|
+
kind: 'unsupported' | 'not-found' | 'busy' | 'unavailable' | 'internal';
|
|
199
|
+
message: string;
|
|
200
|
+
};
|
|
201
|
+
type SessionManagementResult<T> = {
|
|
202
|
+
ok: true;
|
|
203
|
+
value: T;
|
|
204
|
+
} | {
|
|
205
|
+
ok: false;
|
|
206
|
+
kind: 'unsupported' | 'not-found' | 'busy' | 'invalid' | 'internal';
|
|
207
|
+
message: string;
|
|
208
|
+
};
|
|
209
|
+
interface PromptArgs {
|
|
210
|
+
sessionId: string;
|
|
211
|
+
mode: 'queue' | 'steer';
|
|
212
|
+
content: Array<{
|
|
213
|
+
type: 'text';
|
|
214
|
+
text: string;
|
|
215
|
+
} | {
|
|
216
|
+
type: 'image';
|
|
217
|
+
mediaType: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif';
|
|
218
|
+
data: string;
|
|
219
|
+
name?: string;
|
|
220
|
+
}>;
|
|
221
|
+
clientTimeZone?: string;
|
|
222
|
+
}
|
|
223
|
+
interface PhoneSessionRow {
|
|
224
|
+
sessionId: string;
|
|
225
|
+
updatedAt: number;
|
|
226
|
+
running: boolean;
|
|
227
|
+
blank: boolean;
|
|
228
|
+
cwd?: string;
|
|
229
|
+
origin?: string;
|
|
230
|
+
parentSessionId?: string;
|
|
231
|
+
projections?: {
|
|
232
|
+
asOfSeq?: number;
|
|
233
|
+
values?: Record<string, unknown>;
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
interface HistoryResult {
|
|
237
|
+
events: Array<{
|
|
238
|
+
event: SessionEventLike;
|
|
239
|
+
view?: unknown;
|
|
240
|
+
}>;
|
|
241
|
+
hasMore: boolean;
|
|
242
|
+
projections?: {
|
|
243
|
+
values?: Record<string, unknown>;
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
interface SessionEventLike {
|
|
247
|
+
type: string;
|
|
248
|
+
seq: number;
|
|
249
|
+
time?: number;
|
|
250
|
+
data?: unknown;
|
|
251
|
+
}
|
|
252
|
+
interface MuxFrameLike {
|
|
253
|
+
type: string;
|
|
254
|
+
rpcId?: string;
|
|
255
|
+
payload?: any;
|
|
256
|
+
sessionId?: string;
|
|
257
|
+
event?: SessionEventLike;
|
|
258
|
+
key?: string;
|
|
259
|
+
value?: unknown;
|
|
260
|
+
approvalId?: string;
|
|
261
|
+
toolName?: string;
|
|
262
|
+
reason?: string;
|
|
263
|
+
questions?: unknown;
|
|
264
|
+
questionRpcId?: string;
|
|
265
|
+
running?: boolean;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* apiProxy stream items are server-request envelopes: the frame lives in
|
|
269
|
+
* `payload`, while the stable request id used to answer approval/question
|
|
270
|
+
* waits lives beside it. Flattening only `payload` loses that id and makes
|
|
271
|
+
* both interactions silently disappear.
|
|
272
|
+
*/
|
|
273
|
+
interface ApiStreamItemLike {
|
|
274
|
+
rpcId?: string;
|
|
275
|
+
payload: MuxFrameLike;
|
|
276
|
+
}
|
|
277
|
+
interface ApiProxyLike {
|
|
278
|
+
sessions: SessionsApiLike;
|
|
279
|
+
workspace?: WorkspaceApiLike;
|
|
280
|
+
host?: HostApiLike;
|
|
281
|
+
respond(message: {
|
|
282
|
+
type: 'client-response';
|
|
283
|
+
rpcId: string;
|
|
284
|
+
result: RpcResult<unknown>;
|
|
285
|
+
}): Promise<{
|
|
286
|
+
accepted: boolean;
|
|
287
|
+
reason?: string;
|
|
288
|
+
}>;
|
|
289
|
+
events: {
|
|
290
|
+
mux(req: RpcRequestLike<Record<string, never>>, signal: AbortSignal): AsyncIterable<MuxFrameLike | ApiStreamItemLike>;
|
|
291
|
+
host(req: RpcRequestLike<Record<string, never>>, signal: AbortSignal): AsyncIterable<MuxFrameLike | ApiStreamItemLike>;
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
/** Downward sink every connected phone registers (one per WebSocket). */
|
|
295
|
+
interface BridgeSink {
|
|
296
|
+
push(type: string, payload: unknown, seq?: number): void;
|
|
297
|
+
lastCursor(): number;
|
|
298
|
+
replay(entries: Array<{
|
|
299
|
+
seq: number;
|
|
300
|
+
type: string;
|
|
301
|
+
payload: unknown;
|
|
302
|
+
}>): void;
|
|
303
|
+
replayDone(): void;
|
|
304
|
+
resync(): void;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Offline push fan-out (F-9 离线推送). The bridge forwards every
|
|
308
|
+
* notification-worthy event here; the outlet decides which paired devices
|
|
309
|
+
* (token holders without a live socket) receive an APNs delivery.
|
|
310
|
+
*/
|
|
311
|
+
interface PushOutlet {
|
|
312
|
+
fanOut(notification: PushNotification): void;
|
|
313
|
+
/**
|
|
314
|
+
* Whether offline push is currently configured and usable. Drives the
|
|
315
|
+
* welcome capability bit: advertising push while no APNs credentials are
|
|
316
|
+
* loaded would make clients suppress their own local banners and lose
|
|
317
|
+
* notifications entirely.
|
|
318
|
+
*/
|
|
319
|
+
isAvailable(): boolean;
|
|
320
|
+
}
|
|
321
|
+
declare class HostBridge {
|
|
322
|
+
private readonly apiProxy;
|
|
323
|
+
private readonly historyBufferMax;
|
|
324
|
+
readonly id: number;
|
|
325
|
+
private summaries;
|
|
326
|
+
private approvals;
|
|
327
|
+
private questions;
|
|
328
|
+
private archivedSessionIds;
|
|
329
|
+
private subagentSessionIds;
|
|
330
|
+
private sinks;
|
|
331
|
+
private ring;
|
|
332
|
+
private cursor;
|
|
333
|
+
private abort;
|
|
334
|
+
constructor(apiProxy: ApiProxyLike, historyBufferMax?: number);
|
|
335
|
+
private pushOutlet;
|
|
336
|
+
/**
|
|
337
|
+
* Wire the offline-push fan-out. Present ⇒ welcome advertises the `push`
|
|
338
|
+
* capability and notify-worthy events are mirrored to APNs.
|
|
339
|
+
*/
|
|
340
|
+
setPushOutlet(outlet: PushOutlet | undefined): void;
|
|
341
|
+
get capabilities(): {
|
|
342
|
+
historyPaging: boolean;
|
|
343
|
+
replay: boolean;
|
|
344
|
+
approvals: boolean;
|
|
345
|
+
questions: boolean;
|
|
346
|
+
models: boolean;
|
|
347
|
+
sessionManagement: boolean;
|
|
348
|
+
projectSelection: boolean;
|
|
349
|
+
push: boolean;
|
|
350
|
+
};
|
|
351
|
+
diagnostic(message: string): void;
|
|
352
|
+
currentCursor(): number;
|
|
353
|
+
addSink(sink: BridgeSink): void;
|
|
354
|
+
removeSink(sink: BridgeSink): void;
|
|
355
|
+
/** Whether the ring still holds everything after the cursor. */
|
|
356
|
+
canResumeFrom(cursor: number): boolean;
|
|
357
|
+
private sinkSessions;
|
|
358
|
+
private lastAssistantText;
|
|
359
|
+
/** Mark a sink as actively viewing a session (suppresses its turn notifications). */
|
|
360
|
+
markSinkOpen(sink: BridgeSink, sessionId: string): void;
|
|
361
|
+
markSinkClosed(sink: BridgeSink, sessionId: string): void;
|
|
362
|
+
dropSinkSessions(sink: BridgeSink): void;
|
|
363
|
+
private isViewedBy;
|
|
364
|
+
/** F-9: when a turn completes, notify every device not viewing the session. */
|
|
365
|
+
private emitTurnCompletedNotify;
|
|
366
|
+
/**
|
|
367
|
+
* Mirror one notification-worthy event to offline devices. Fire-and-forget:
|
|
368
|
+
* push failures must never block or break the WS data plane.
|
|
369
|
+
*/
|
|
370
|
+
private fanOutPush;
|
|
371
|
+
/** Remember the latest assistant text so notifications can quote it. */
|
|
372
|
+
private captureAssistantText;
|
|
373
|
+
/**
|
|
374
|
+
* Replay buffered pushes after the given cursor; false when the gap is
|
|
375
|
+
* unrecoverable. Frames go to `target` only — replaying into every sink
|
|
376
|
+
* duplicated the whole window onto devices that never asked for it.
|
|
377
|
+
*/
|
|
378
|
+
resumeFrom(cursor: number, target?: BridgeSink): boolean;
|
|
379
|
+
private record;
|
|
380
|
+
/** Start consuming host + mux streams. Idempotent; aborts on dispose(). */
|
|
381
|
+
start(): void;
|
|
382
|
+
dispose(): void;
|
|
383
|
+
private runHostStream;
|
|
384
|
+
private runMuxStream;
|
|
385
|
+
private onHostFrame;
|
|
386
|
+
private onMuxFrame;
|
|
387
|
+
refreshSummaries(): Promise<void>;
|
|
388
|
+
/** Cold sessions may lack a title projection; fall back to first user text. */
|
|
389
|
+
private deriveTitleFallback;
|
|
390
|
+
private noteActivity;
|
|
391
|
+
private applyProjection;
|
|
392
|
+
private bumpPendingFlags;
|
|
393
|
+
private pushSummary;
|
|
394
|
+
listSessions(): SessionSummary[];
|
|
395
|
+
/** Tail history for an opened session; pushes s2c.session.tail to the sink. */
|
|
396
|
+
openSession(sink: BridgeSink, sessionId: string, tailCount: number): Promise<boolean>;
|
|
397
|
+
historyPage(sink: BridgeSink, sessionId: string, beforeSeq: number, limit: number): Promise<boolean>;
|
|
398
|
+
/** Result of one attachment read-back for the phone. */
|
|
399
|
+
attachmentData(sessionId: string, attachmentId: string): Promise<{
|
|
400
|
+
mediaType?: string;
|
|
401
|
+
data: string;
|
|
402
|
+
} | null>;
|
|
403
|
+
sessionModels(sessionId: string): Promise<ModelBridgeResult<HostSessionModels>>;
|
|
404
|
+
selectSessionModel(sessionId: string, selection: HostModelSelection): Promise<ModelBridgeResult<HostModelSelection>>;
|
|
405
|
+
renameSession(sessionId: string, title: string): Promise<SessionManagementResult<string>>;
|
|
406
|
+
archiveSession(sessionId: string): Promise<SessionManagementResult<true>>;
|
|
407
|
+
cancelSession(sessionId: string): Promise<SessionManagementResult<true>>;
|
|
408
|
+
listWorkspaces(): Promise<SessionManagementResult<Array<{
|
|
409
|
+
id: string;
|
|
410
|
+
title: string;
|
|
411
|
+
path: string;
|
|
412
|
+
sessionIds: string[];
|
|
413
|
+
}>>>;
|
|
414
|
+
createWorkspace(path: string): Promise<SessionManagementResult<{
|
|
415
|
+
workspace: {
|
|
416
|
+
id: string;
|
|
417
|
+
title: string;
|
|
418
|
+
path: string;
|
|
419
|
+
sessionIds: string[];
|
|
420
|
+
};
|
|
421
|
+
created: boolean;
|
|
422
|
+
}>>;
|
|
423
|
+
listDirectory(path?: string): Promise<SessionManagementResult<DirectoryListingLike>>;
|
|
424
|
+
pickDirectory(): Promise<SessionManagementResult<string | null>>;
|
|
425
|
+
/** Create a fresh blank session in an existing workspace or legacy cwd. */
|
|
426
|
+
createSession(destination?: {
|
|
427
|
+
workspaceId?: string;
|
|
428
|
+
cwd?: string;
|
|
429
|
+
}): Promise<string | null>;
|
|
430
|
+
sendPrompt(sessionId: string, text: string, images?: Array<{
|
|
431
|
+
mediaType: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif';
|
|
432
|
+
data: string;
|
|
433
|
+
name?: string;
|
|
434
|
+
}>): Promise<number | null>;
|
|
435
|
+
respondApproval(requestId: string, decision: 'allow' | 'deny'): Promise<boolean>;
|
|
436
|
+
respondQuestion(requestId: string, answers: unknown): Promise<boolean>;
|
|
437
|
+
}
|
|
438
|
+
//#endregion
|
|
439
|
+
//#region src/index.d.ts
|
|
440
|
+
/**
|
|
441
|
+
* dsh-deeppilot — data bridge between the DSH host and DeepPilot
|
|
442
|
+
* clients. Registers exactly one WebSocket upgrade route (/phone) plus an
|
|
443
|
+
* optional health probe (/phone/health) on the existing web server. The web
|
|
444
|
+
* UI is never touched.
|
|
445
|
+
*
|
|
446
|
+
* Data plane: an in-process HostBridge consumes apiProxy.events.mux()/host()
|
|
447
|
+
* streams, mirrors session summaries, tracks pending approvals/questions,
|
|
448
|
+
* and fans projected protocol-v1 pushes out to every connected device.
|
|
449
|
+
*
|
|
450
|
+
* Protocol: src/protocol.ts, v1. The private app repository carries the
|
|
451
|
+
* matching normative document and Swift models.
|
|
452
|
+
*/
|
|
453
|
+
declare const name = "deeppilot";
|
|
454
|
+
/** No eager service requirement: profiles without a web stack simply skip. */
|
|
455
|
+
declare const inject: string[];
|
|
456
|
+
interface Config {
|
|
457
|
+
/** Master switch; when false the plugin activates and does nothing. */
|
|
458
|
+
enabled?: boolean;
|
|
459
|
+
/** Pairing token file (0600); generated on first boot when missing. */
|
|
460
|
+
authTokenPath?: string;
|
|
461
|
+
/** Paired-device registry JSON path. */
|
|
462
|
+
devicesPath?: string;
|
|
463
|
+
/** Replay ring buffer bound (frames) per deployment. */
|
|
464
|
+
historyBufferMax?: number;
|
|
465
|
+
/** Verbose per-frame diagnostics (never prints token or message bodies). */
|
|
466
|
+
debug?: boolean;
|
|
467
|
+
/** Optional embedded remote transport. Reconciled when settings change. */
|
|
468
|
+
remote?: {
|
|
469
|
+
enabled?: boolean;
|
|
470
|
+
provider?: string;
|
|
471
|
+
hostname?: string;
|
|
472
|
+
statePath?: string;
|
|
473
|
+
helperPath?: string;
|
|
474
|
+
funnelPort?: number;
|
|
475
|
+
};
|
|
476
|
+
/**
|
|
477
|
+
* Offline push (F-9). provider 'apns' sends direct Apple Push Notification
|
|
478
|
+
* deliveries from this Mac — outbound-only, no relay server, requires the
|
|
479
|
+
* user's own Apple developer credentials. provider 'relay' forwards notify
|
|
480
|
+
* projections to an operator-run relay (relay/server.js) holding the
|
|
481
|
+
* distributor's key — used when the App ships via TestFlight/App Store.
|
|
482
|
+
*
|
|
483
|
+
* Deliberately NO environment knob here: each device reports its own
|
|
484
|
+
* environment when registering (derived from its build kind), and
|
|
485
|
+
* deliveries route per device — mixed dev/TestFlight phones coexist.
|
|
486
|
+
*/
|
|
487
|
+
push?: {
|
|
488
|
+
/** 'none' (default) | 'apns' | 'relay'. */
|
|
489
|
+
provider?: string;
|
|
490
|
+
/** Apple Developer team id (JWT iss claim). */
|
|
491
|
+
teamId?: string;
|
|
492
|
+
/** APNs auth key id (JWT kid header). */
|
|
493
|
+
keyId?: string;
|
|
494
|
+
/** .p8 private key path; generated keys live under the bridge data dir. */
|
|
495
|
+
keyPath?: string;
|
|
496
|
+
/** App bundle id — the apns-topic header. */
|
|
497
|
+
bundleId?: string;
|
|
498
|
+
/** Relay base URL (https). See relay/README.md. */
|
|
499
|
+
relayUrl?: string;
|
|
500
|
+
/** Per-user bearer token issued by the relay operator. */
|
|
501
|
+
relayToken?: string;
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
declare const Config: z<Schemastery.ObjectS<{
|
|
505
|
+
enabled: z<boolean, boolean>;
|
|
506
|
+
authTokenPath: z<string, string>;
|
|
507
|
+
devicesPath: z<string, string>;
|
|
508
|
+
historyBufferMax: z<number, number>;
|
|
509
|
+
debug: z<boolean, boolean>;
|
|
510
|
+
remote: z<Schemastery.ObjectS<{
|
|
511
|
+
enabled: z<boolean, boolean>;
|
|
512
|
+
provider: z<string, string>;
|
|
513
|
+
hostname: z<string, string>;
|
|
514
|
+
statePath: z<string, string>;
|
|
515
|
+
helperPath: z<string, string>;
|
|
516
|
+
funnelPort: z<number, number>;
|
|
517
|
+
}>, Schemastery.ObjectT<{
|
|
518
|
+
enabled: z<boolean, boolean>;
|
|
519
|
+
provider: z<string, string>;
|
|
520
|
+
hostname: z<string, string>;
|
|
521
|
+
statePath: z<string, string>;
|
|
522
|
+
helperPath: z<string, string>;
|
|
523
|
+
funnelPort: z<number, number>;
|
|
524
|
+
}>>;
|
|
525
|
+
push: z<Schemastery.ObjectS<{
|
|
526
|
+
provider: z<string, string>;
|
|
527
|
+
teamId: z<string, string>;
|
|
528
|
+
keyId: z<string, string>;
|
|
529
|
+
keyPath: z<string, string>;
|
|
530
|
+
bundleId: z<string, string>;
|
|
531
|
+
relayUrl: z<string, string>;
|
|
532
|
+
relayToken: z<string, string>;
|
|
533
|
+
}>, Schemastery.ObjectT<{
|
|
534
|
+
provider: z<string, string>;
|
|
535
|
+
teamId: z<string, string>;
|
|
536
|
+
keyId: z<string, string>;
|
|
537
|
+
keyPath: z<string, string>;
|
|
538
|
+
bundleId: z<string, string>;
|
|
539
|
+
relayUrl: z<string, string>;
|
|
540
|
+
relayToken: z<string, string>;
|
|
541
|
+
}>>;
|
|
542
|
+
}>, Schemastery.ObjectT<{
|
|
543
|
+
enabled: z<boolean, boolean>;
|
|
544
|
+
authTokenPath: z<string, string>;
|
|
545
|
+
devicesPath: z<string, string>;
|
|
546
|
+
historyBufferMax: z<number, number>;
|
|
547
|
+
debug: z<boolean, boolean>;
|
|
548
|
+
remote: z<Schemastery.ObjectS<{
|
|
549
|
+
enabled: z<boolean, boolean>;
|
|
550
|
+
provider: z<string, string>;
|
|
551
|
+
hostname: z<string, string>;
|
|
552
|
+
statePath: z<string, string>;
|
|
553
|
+
helperPath: z<string, string>;
|
|
554
|
+
funnelPort: z<number, number>;
|
|
555
|
+
}>, Schemastery.ObjectT<{
|
|
556
|
+
enabled: z<boolean, boolean>;
|
|
557
|
+
provider: z<string, string>;
|
|
558
|
+
hostname: z<string, string>;
|
|
559
|
+
statePath: z<string, string>;
|
|
560
|
+
helperPath: z<string, string>;
|
|
561
|
+
funnelPort: z<number, number>;
|
|
562
|
+
}>>;
|
|
563
|
+
push: z<Schemastery.ObjectS<{
|
|
564
|
+
provider: z<string, string>;
|
|
565
|
+
teamId: z<string, string>;
|
|
566
|
+
keyId: z<string, string>;
|
|
567
|
+
keyPath: z<string, string>;
|
|
568
|
+
bundleId: z<string, string>;
|
|
569
|
+
relayUrl: z<string, string>;
|
|
570
|
+
relayToken: z<string, string>;
|
|
571
|
+
}>, Schemastery.ObjectT<{
|
|
572
|
+
provider: z<string, string>;
|
|
573
|
+
teamId: z<string, string>;
|
|
574
|
+
keyId: z<string, string>;
|
|
575
|
+
keyPath: z<string, string>;
|
|
576
|
+
bundleId: z<string, string>;
|
|
577
|
+
relayUrl: z<string, string>;
|
|
578
|
+
relayToken: z<string, string>;
|
|
579
|
+
}>>;
|
|
580
|
+
}>>;
|
|
581
|
+
/** Authorization is preferred; the query form remains for older app builds. */
|
|
582
|
+
declare function requestToken(req: Pick<IncomingMessage, 'url' | 'headers'>): string | null;
|
|
583
|
+
declare function apply(ctx: Context, options: unknown): void;
|
|
584
|
+
//#endregion
|
|
585
|
+
export { Config, HostBridge, apply, inject, name, requestToken };
|
|
586
|
+
//# sourceMappingURL=index.d.ts.map
|