dsh-deeppilot 0.2.2 → 0.4.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/lib/index.d.ts CHANGED
@@ -66,7 +66,7 @@ interface PendingSnapshotPayload {
66
66
  questions: PendingQuestionPayload[];
67
67
  }
68
68
  //#endregion
69
- //#region src/host-bridge.d.ts
69
+ //#region src/host-api.d.ts
70
70
  interface RpcOk<T> {
71
71
  ok: true;
72
72
  value: T;
@@ -250,7 +250,9 @@ interface PhoneSessionRow {
250
250
  sessionId: string;
251
251
  updatedAt: number;
252
252
  running: boolean;
253
- blank: boolean;
253
+ /** Host marks never-prompted sessions as blank; informational only — the
254
+ * summary projects them as idle (see toSummary) so phones can send. */
255
+ blank?: boolean;
254
256
  cwd?: string;
255
257
  origin?: string;
256
258
  parentSessionId?: string;
@@ -355,6 +357,8 @@ interface PushOutlet {
355
357
  */
356
358
  isAvailable(): boolean;
357
359
  }
360
+ //#endregion
361
+ //#region src/host-bridge.d.ts
358
362
  declare class HostBridge {
359
363
  private readonly apiProxy;
360
364
  private readonly historyBufferMax;
@@ -367,7 +371,10 @@ declare class HostBridge {
367
371
  private sinks;
368
372
  private ring;
369
373
  private cursor;
374
+ private userReceiptSeq;
370
375
  private abort;
376
+ private started;
377
+ private disposed;
371
378
  constructor(apiProxy: ApiProxyLike, historyBufferMax?: number);
372
379
  private pushOutlet;
373
380
  /**
@@ -381,6 +388,7 @@ declare class HostBridge {
381
388
  approvals: boolean;
382
389
  questions: boolean;
383
390
  pendingSnapshot: boolean;
391
+ notifyAllCategories: boolean;
384
392
  models: boolean;
385
393
  sessionManagement: boolean;
386
394
  projectSelection: boolean;
@@ -399,6 +407,12 @@ declare class HostBridge {
399
407
  markSinkClosed(sink: BridgeSink, sessionId: string): void;
400
408
  dropSinkSessions(sink: BridgeSink): void;
401
409
  private isViewedBy;
410
+ /** F-9: when a notification-worthy event fires, mirror it to every
411
+ * online device that is not currently viewing the session (the s2c.notify
412
+ * frame counts toward the seq cursor and joins the replay ring per
413
+ * PROTOCOL §6 + §7), then fan the same payload out to offline devices
414
+ * holding an APNs token. */
415
+ private emitNotify;
402
416
  /** F-9: when a turn completes, notify every device not viewing the session. */
403
417
  private emitTurnCompletedNotify;
404
418
  /**
@@ -480,23 +494,7 @@ declare class HostBridge {
480
494
  respondQuestion(requestId: string, answers: unknown): Promise<PendingResponseOutcome>;
481
495
  }
482
496
  //#endregion
483
- //#region src/index.d.ts
484
- /**
485
- * dsh-deeppilot — data bridge between the DSH host and DeepPilot
486
- * clients. Registers exactly one WebSocket upgrade route (/phone) plus an
487
- * optional health probe (/phone/health) on the existing web server. The web
488
- * UI is never touched.
489
- *
490
- * Data plane: an in-process HostBridge consumes apiProxy.events.mux()/host()
491
- * streams, mirrors session summaries, tracks pending approvals/questions,
492
- * and fans projected protocol-v1 pushes out to every connected device.
493
- *
494
- * Protocol: src/protocol.ts, v1. The private app repository carries the
495
- * matching normative document and Swift models.
496
- */
497
- declare const name = "deeppilot";
498
- /** No eager service requirement: profiles without a web stack simply skip. */
499
- declare const inject: string[];
497
+ //#region src/config.d.ts
500
498
  interface Config {
501
499
  /** Master switch; when false the plugin activates and does nothing. */
502
500
  enabled?: boolean;
@@ -511,35 +509,30 @@ interface Config {
511
509
  /** Optional embedded remote transport. Reconciled when settings change. */
512
510
  remote?: {
513
511
  enabled?: boolean;
514
- provider?: string;
512
+ provider?: 'tailscale-funnel';
515
513
  hostname?: string;
516
514
  statePath?: string;
517
515
  helperPath?: string;
518
- funnelPort?: number;
516
+ funnelPort?: 443 | 8443 | 10000;
519
517
  };
520
518
  /**
521
- * Offline push (F-9). provider 'apns' sends direct Apple Push Notification
522
- * deliveries from this Mac outbound-only, no relay server, requires the
523
- * user's own Apple developer credentials. provider 'relay' forwards notify
524
- * projections to an operator-run relay (relay/server.js) holding the
525
- * distributor's key — used when the App ships via TestFlight/App Store.
526
- *
527
- * Deliberately NO environment knob here: each device reports its own
528
- * environment when registering (derived from its build kind), and
529
- * deliveries route per device — mixed dev/TestFlight phones coexist.
519
+ * Offline push (F-9). `apns` sends directly from the Mac with the user's
520
+ * Apple credentials. `relay` sends notify projections to an operator-run
521
+ * relay for distributed builds. The device reports its own APNs environment,
522
+ * so development and TestFlight/App Store devices may coexist.
530
523
  */
531
524
  push?: {
532
- /** 'none' (default) | 'apns' | 'relay'. */
533
- provider?: string;
525
+ /** `none` (default), `apns`, or `relay`. */
526
+ provider?: 'none' | 'apns' | 'relay';
534
527
  /** Apple Developer team id (JWT iss claim). */
535
528
  teamId?: string;
536
529
  /** APNs auth key id (JWT kid header). */
537
530
  keyId?: string;
538
- /** .p8 private key path; generated keys live under the bridge data dir. */
531
+ /** `.p8` private key path. */
539
532
  keyPath?: string;
540
533
  /** App bundle id — the apns-topic header. */
541
534
  bundleId?: string;
542
- /** Relay base URL (https). See relay/README.md. */
535
+ /** Relay base URL. */
543
536
  relayUrl?: string;
544
537
  /** Per-user bearer token issued by the relay operator. */
545
538
  relayToken?: string;
@@ -553,21 +546,21 @@ declare const Config: z<Schemastery.ObjectS<{
553
546
  debug: z<boolean, boolean>;
554
547
  remote: z<Schemastery.ObjectS<{
555
548
  enabled: z<boolean, boolean>;
556
- provider: z<string, string>;
549
+ provider: z<"tailscale-funnel", "tailscale-funnel">;
557
550
  hostname: z<string, string>;
558
551
  statePath: z<string, string>;
559
552
  helperPath: z<string, string>;
560
- funnelPort: z<number, number>;
553
+ funnelPort: z<443 | 8443 | 10000, 443 | 8443 | 10000>;
561
554
  }>, Schemastery.ObjectT<{
562
555
  enabled: z<boolean, boolean>;
563
- provider: z<string, string>;
556
+ provider: z<"tailscale-funnel", "tailscale-funnel">;
564
557
  hostname: z<string, string>;
565
558
  statePath: z<string, string>;
566
559
  helperPath: z<string, string>;
567
- funnelPort: z<number, number>;
560
+ funnelPort: z<443 | 8443 | 10000, 443 | 8443 | 10000>;
568
561
  }>>;
569
562
  push: z<Schemastery.ObjectS<{
570
- provider: z<string, string>;
563
+ provider: z<"none" | "apns" | "relay", "none" | "apns" | "relay">;
571
564
  teamId: z<string, string>;
572
565
  keyId: z<string, string>;
573
566
  keyPath: z<string, string>;
@@ -575,7 +568,7 @@ declare const Config: z<Schemastery.ObjectS<{
575
568
  relayUrl: z<string, string>;
576
569
  relayToken: z<string, string>;
577
570
  }>, Schemastery.ObjectT<{
578
- provider: z<string, string>;
571
+ provider: z<"none" | "apns" | "relay", "none" | "apns" | "relay">;
579
572
  teamId: z<string, string>;
580
573
  keyId: z<string, string>;
581
574
  keyPath: z<string, string>;
@@ -591,21 +584,21 @@ declare const Config: z<Schemastery.ObjectS<{
591
584
  debug: z<boolean, boolean>;
592
585
  remote: z<Schemastery.ObjectS<{
593
586
  enabled: z<boolean, boolean>;
594
- provider: z<string, string>;
587
+ provider: z<"tailscale-funnel", "tailscale-funnel">;
595
588
  hostname: z<string, string>;
596
589
  statePath: z<string, string>;
597
590
  helperPath: z<string, string>;
598
- funnelPort: z<number, number>;
591
+ funnelPort: z<443 | 8443 | 10000, 443 | 8443 | 10000>;
599
592
  }>, Schemastery.ObjectT<{
600
593
  enabled: z<boolean, boolean>;
601
- provider: z<string, string>;
594
+ provider: z<"tailscale-funnel", "tailscale-funnel">;
602
595
  hostname: z<string, string>;
603
596
  statePath: z<string, string>;
604
597
  helperPath: z<string, string>;
605
- funnelPort: z<number, number>;
598
+ funnelPort: z<443 | 8443 | 10000, 443 | 8443 | 10000>;
606
599
  }>>;
607
600
  push: z<Schemastery.ObjectS<{
608
- provider: z<string, string>;
601
+ provider: z<"none" | "apns" | "relay", "none" | "apns" | "relay">;
609
602
  teamId: z<string, string>;
610
603
  keyId: z<string, string>;
611
604
  keyPath: z<string, string>;
@@ -613,7 +606,7 @@ declare const Config: z<Schemastery.ObjectS<{
613
606
  relayUrl: z<string, string>;
614
607
  relayToken: z<string, string>;
615
608
  }>, Schemastery.ObjectT<{
616
- provider: z<string, string>;
609
+ provider: z<"none" | "apns" | "relay", "none" | "apns" | "relay">;
617
610
  teamId: z<string, string>;
618
611
  keyId: z<string, string>;
619
612
  keyPath: z<string, string>;
@@ -622,9 +615,44 @@ declare const Config: z<Schemastery.ObjectS<{
622
615
  relayToken: z<string, string>;
623
616
  }>>;
624
617
  }>>;
618
+ //#endregion
619
+ //#region src/phone-http.d.ts
625
620
  /** Authorization is preferred; the query form remains for older app builds. */
626
621
  declare function requestToken(req: Pick<IncomingMessage, 'url' | 'headers'>): string | null;
622
+ //#endregion
623
+ //#region src/push-policy.d.ts
624
+ /** Prune only when the provider supplies an authoritative token-lifecycle verdict. */
625
+ declare function shouldPrunePushToken(outcome: 'sent' | 'invalid-token' | 'failed', reason?: string): boolean;
626
+ /**
627
+ * Zero-touch relay self-heal: HTTP 401 means the relay no longer honors the
628
+ * cached credential. Only auto-enrolled cells with a still-current token may
629
+ * re-derive it; an explicitly configured relay token remains user-owned
630
+ * configuration and is never silently rewritten.
631
+ */
632
+ declare function shouldReEnrollRelayToken(transport: 'apns' | 'relay', outcome: 'sent' | 'invalid-token' | 'failed', reason: string | undefined, opts: {
633
+ usedCellToken: boolean;
634
+ hasEnrollKey: boolean;
635
+ tokenStillCurrent: boolean;
636
+ }): boolean;
637
+ //#endregion
638
+ //#region src/index.d.ts
639
+ /**
640
+ * dsh-deeppilot — data bridge between the DSH host and DeepPilot
641
+ * clients. Registers exactly one WebSocket upgrade route (/phone) plus an
642
+ * optional health probe (/phone/health) on the existing web server. The web
643
+ * UI is never touched.
644
+ *
645
+ * Data plane: an in-process HostBridge consumes apiProxy.events.mux()/host()
646
+ * streams, mirrors session summaries, tracks pending approvals/questions,
647
+ * and fans projected protocol-v1 pushes out to every connected device.
648
+ *
649
+ * Protocol: PROTOCOL.md is normative; src/protocol.ts and the private app's
650
+ * Swift models mirror that v1 contract.
651
+ */
652
+ declare const name = "deeppilot";
653
+ /** No eager service requirement: profiles without a web stack simply skip. */
654
+ declare const inject: string[];
627
655
  declare function apply(ctx: Context, options: unknown): void;
628
656
  //#endregion
629
- export { Config, HostBridge, apply, inject, name, requestToken };
657
+ export { Config, HostBridge, apply, inject, name, requestToken, shouldPrunePushToken, shouldReEnrollRelayToken };
630
658
  //# sourceMappingURL=index.d.ts.map