dsh-deeppilot 0.2.0 → 0.2.2

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/lib/index.d.ts CHANGED
@@ -39,6 +39,32 @@ interface PushNotification {
39
39
  title: string;
40
40
  body: string;
41
41
  }
42
+ interface PendingApprovalPayload {
43
+ requestId: string;
44
+ sessionId: string;
45
+ toolName: string;
46
+ summary: string;
47
+ riskLevel: 'read' | 'write' | 'destructive';
48
+ }
49
+ interface PendingQuestionOption {
50
+ label: string;
51
+ description?: string;
52
+ }
53
+ interface PendingQuestionItem {
54
+ id: string;
55
+ question: string;
56
+ multiSelect?: boolean;
57
+ options?: PendingQuestionOption[];
58
+ }
59
+ interface PendingQuestionPayload {
60
+ requestId: string;
61
+ sessionId: string;
62
+ questions: PendingQuestionItem[];
63
+ }
64
+ interface PendingSnapshotPayload {
65
+ approvals: PendingApprovalPayload[];
66
+ questions: PendingQuestionPayload[];
67
+ }
42
68
  //#endregion
43
69
  //#region src/host-bridge.d.ts
44
70
  interface RpcOk<T> {
@@ -291,6 +317,17 @@ interface ApiProxyLike {
291
317
  host(req: RpcRequestLike<Record<string, never>>, signal: AbortSignal): AsyncIterable<MuxFrameLike | ApiStreamItemLike>;
292
318
  };
293
319
  }
320
+ /**
321
+ * Outcome of answering a pending approval/question. The host distinguishes
322
+ * "never/no longer pending" from "payload rejected", and collapsing both into
323
+ * a boolean made every rejection read as `question not pending` on the phone.
324
+ */
325
+ type PendingResponseOutcome = {
326
+ ok: true;
327
+ } | {
328
+ ok: false;
329
+ reason: 'not-pending' | 'bad-response' | 'transport';
330
+ };
294
331
  /** Downward sink every connected phone registers (one per WebSocket). */
295
332
  interface BridgeSink {
296
333
  push(type: string, payload: unknown, seq?: number): void;
@@ -343,6 +380,7 @@ declare class HostBridge {
343
380
  replay: boolean;
344
381
  approvals: boolean;
345
382
  questions: boolean;
383
+ pendingSnapshot: boolean;
346
384
  models: boolean;
347
385
  sessionManagement: boolean;
348
386
  projectSelection: boolean;
@@ -392,6 +430,12 @@ declare class HostBridge {
392
430
  private bumpPendingFlags;
393
431
  private pushSummary;
394
432
  listSessions(): SessionSummary[];
433
+ /**
434
+ * Complete transient interaction state. Unlike the replay ring, this remains
435
+ * authoritative after a long disconnect and is rehydrated by apiProxy's mux
436
+ * stream when the bridge itself restarts.
437
+ */
438
+ pendingSnapshot(): PendingSnapshotPayload;
395
439
  /** Tail history for an opened session; pushes s2c.session.tail to the sink. */
396
440
  openSession(sink: BridgeSink, sessionId: string, tailCount: number): Promise<boolean>;
397
441
  historyPage(sink: BridgeSink, sessionId: string, beforeSeq: number, limit: number): Promise<boolean>;
@@ -431,9 +475,9 @@ declare class HostBridge {
431
475
  mediaType: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif';
432
476
  data: string;
433
477
  name?: string;
434
- }>): Promise<number | null>;
435
- respondApproval(requestId: string, decision: 'allow' | 'deny'): Promise<boolean>;
436
- respondQuestion(requestId: string, answers: unknown): Promise<boolean>;
478
+ }>): Promise<SessionManagementResult<number>>;
479
+ respondApproval(requestId: string, decision: 'allow' | 'deny', reason?: string): Promise<PendingResponseOutcome>;
480
+ respondQuestion(requestId: string, answers: unknown): Promise<PendingResponseOutcome>;
437
481
  }
438
482
  //#endregion
439
483
  //#region src/index.d.ts