sliccy 5.32.3 → 5.32.4

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 (123) hide show
  1. package/dist/node-server/_shared/bridge-protocol.d.ts +28 -0
  2. package/dist/node-server/_shared/bridge-protocol.d.ts.map +1 -0
  3. package/dist/node-server/_shared/bridge-protocol.js +28 -0
  4. package/dist/node-server/_shared/bridge-protocol.js.map +1 -0
  5. package/dist/node-server/_shared/index.d.ts +2 -0
  6. package/dist/node-server/_shared/index.d.ts.map +1 -1
  7. package/dist/node-server/_shared/index.js +2 -0
  8. package/dist/node-server/_shared/index.js.map +1 -1
  9. package/dist/node-server/_shared/tray-signaling.d.ts +272 -0
  10. package/dist/node-server/_shared/tray-signaling.d.ts.map +1 -0
  11. package/dist/node-server/_shared/tray-signaling.js +22 -0
  12. package/dist/node-server/_shared/tray-signaling.js.map +1 -0
  13. package/dist/node-server/bridge-security.d.ts +5 -19
  14. package/dist/node-server/bridge-security.js +10 -21
  15. package/dist/ui/assets/{account-store-BJErkI81.js → account-store-BfOHnqUX.js} +2 -2
  16. package/dist/ui/assets/{account-store-EwRNmL1u.js → account-store-BokqeKBj.js} +3 -3
  17. package/dist/ui/assets/{adobe-9AAz-I6V.js → adobe-B6BLrKyZ.js} +1 -1
  18. package/dist/ui/assets/{adobe-DoCdNthg.js → adobe-DCTZeeCG.js} +2 -2
  19. package/dist/ui/assets/{adobe-oauth-state-Ge2y0PGt.js → adobe-oauth-state-DiSnFEyL.js} +1 -1
  20. package/dist/ui/assets/adobe-oauth-state-DyWfCpd9.js +1 -0
  21. package/dist/ui/assets/{agent-message-to-chat-CqPJXy50.js → agent-message-to-chat-BGOt7zdt.js} +1 -1
  22. package/dist/ui/assets/{apps-aIVmhwH6.js → apps-So20aUVP.js} +1 -1
  23. package/dist/ui/assets/{azure-openai-BY-MvTKc.js → azure-openai-Dg7P7-zc.js} +1 -1
  24. package/dist/ui/assets/{azure-openai-CA5gDRRS.js → azure-openai-DkXl6rL7.js} +1 -1
  25. package/dist/ui/assets/{cdp-D7cRI5-J.js → cdp-wAooorxs.js} +1 -1
  26. package/dist/ui/assets/{cerebras-D_4_9kjS.js → cerebras-BHEfKUqA.js} +1 -1
  27. package/dist/ui/assets/{cerebras-DMWfi09T.js → cerebras-CqjkCBXf.js} +1 -1
  28. package/dist/ui/assets/{composer-speech-C8TRsqUk.js → composer-speech-B9xMPyhK.js} +1 -1
  29. package/dist/ui/assets/{connect-surface-DP3SAkit.js → connect-surface-BKaKXs1I.js} +1 -1
  30. package/dist/ui/assets/dip-DDOAr0-_.js +1 -0
  31. package/dist/ui/assets/{dist-DRA8tlrT.js → dist-CQDi-98s.js} +1 -1
  32. package/dist/ui/assets/{dist-C6zsKK85.js → dist-D_z6cCg2.js} +1 -1
  33. package/dist/ui/assets/{ensure-speech-assets-CeBeERjl.js → ensure-speech-assets-CQm9qv40.js} +1 -1
  34. package/dist/ui/assets/esp8266-XUxBx9Cp.js +1 -0
  35. package/dist/ui/assets/{esptool-operations-DlqryPKq.js → esptool-operations-DX2M1lrH.js} +2 -2
  36. package/dist/ui/assets/{fs-DIgKD4U_.js → fs-8G6exssT.js} +1 -1
  37. package/dist/ui/assets/{fs-BdRKolQa.js → fs-Y501gVp6.js} +2 -2
  38. package/dist/ui/assets/{github-yCvFcPNZ.js → github-Bb4Uk3zm.js} +1 -1
  39. package/dist/ui/assets/{github-DJNLaYq_.js → github-CmzugZyZ.js} +2 -2
  40. package/dist/ui/assets/{github-copilot-B2QL8Bea.js → github-copilot-BC3lA6pG.js} +1 -1
  41. package/dist/ui/assets/{github-copilot-S7bajfQf.js → github-copilot-CEMcvKxO.js} +1 -1
  42. package/dist/ui/assets/{hear-ChrSbr8J.js → hear-BgLO8_ZV.js} +1 -1
  43. package/dist/ui/assets/{hear-DEv4kmVy.js → hear-CsPhwvRU.js} +1 -1
  44. package/dist/ui/assets/{kernel-worker-B_ZQN1Zz.js → kernel-worker-cOMb9dW0.js} +40 -40
  45. package/dist/ui/assets/{kokoro-engine-COfpTP9l.js → kokoro-engine-8SK1XhNo.js} +1 -1
  46. package/dist/ui/assets/{lick-ws-bridge-C2-_QI6e.js → lick-ws-bridge-DUpfw5Cw.js} +1 -1
  47. package/dist/ui/assets/{lick-ws-bridge-LSyJtp9y.js → lick-ws-bridge-ZICrYFIq.js} +1 -1
  48. package/dist/ui/assets/{local-llm-czSXc1Ry.js → local-llm-DjSsoqBK.js} +1 -1
  49. package/dist/ui/assets/main-BwjqRukt.js +24 -0
  50. package/dist/ui/assets/{main-cherry-CqL2Gwv5.js → main-cherry-D01ARITG.js} +1 -1
  51. package/dist/ui/assets/mount-DqnZMKpT.js +1 -0
  52. package/dist/ui/assets/{mount-B_bTs545.js → mount-SC46VzJl.js} +2 -2
  53. package/dist/ui/assets/{mount-bridge-client-DHpxu7lQ.js → mount-bridge-client-VA_GLWNL.js} +1 -1
  54. package/dist/ui/assets/{new-session-DR6Xod7b.js → new-session-B6B6YSVJ.js} +2 -2
  55. package/dist/ui/assets/{oauth-bootstrap-DtCb9W37.js → oauth-bootstrap-8oaNo14A.js} +2 -2
  56. package/dist/ui/assets/{oauth-service-CPJvHYuO.js → oauth-service-DALcoLdp.js} +1 -1
  57. package/dist/ui/assets/{oauth-service-BSqTYvb6.js → oauth-service-DdejFjWa.js} +1 -1
  58. package/dist/ui/assets/{openai-codex-zpkienMe.js → openai-codex-BIjw8lvz.js} +1 -1
  59. package/dist/ui/assets/{openai-codex-Qr4G8oyT.js → openai-codex-C5L90K9s.js} +1 -1
  60. package/dist/ui/assets/page-follower-tray-BJ1UHMvQ.js +5 -0
  61. package/dist/ui/assets/{panel-rpc-handlers-BDgRdx1T.js → panel-rpc-handlers-DWnPCtqS.js} +2 -2
  62. package/dist/ui/assets/{port-bridge-client-BJ5rcoKH.js → port-bridge-client-CbHZI-MK.js} +1 -1
  63. package/dist/ui/assets/{port-bridge-client-vT8ubtB-.js → port-bridge-client-HYsuFrMw.js} +1 -1
  64. package/dist/ui/assets/{provider-Dt5OOr2Q.js → provider-DCEZLF1W.js} +1 -1
  65. package/dist/ui/assets/{provider-D6XRUPSq.js → provider-DtBT8r4B.js} +2 -2
  66. package/dist/ui/assets/provider-store-access-0MbnfMwG.js +1 -0
  67. package/dist/ui/assets/provider-store-access-Bwpbtc8J.js +1 -0
  68. package/dist/ui/assets/{providers-Cdwf7d8F.js → providers-CvYMDqCL.js} +1 -1
  69. package/dist/ui/assets/{providers-B4TofkZa.js → providers-DhaH6zef.js} +2 -2
  70. package/dist/ui/assets/proxied-fetch-BG3drLHR.js +1 -0
  71. package/dist/ui/assets/{proxied-fetch-iGqLvoxh.js → proxied-fetch-CaWoNw-n.js} +1 -1
  72. package/dist/ui/assets/{quick-llm-CcgA0kK7.js → quick-llm-Dq21hPK2.js} +1 -1
  73. package/dist/ui/assets/remote-cdp-transport-DDt3F4ID.js +1 -0
  74. package/dist/ui/assets/{secret-env-kbusPsVw.js → secret-env-zIJToV_E.js} +1 -1
  75. package/dist/ui/assets/{secret-topology-DnYeyyJY.js → secret-topology-k6-rjoyS.js} +1 -1
  76. package/dist/ui/assets/{secrets-bridge-client-x_puVSDN.js → secrets-bridge-client-2HszvKw8.js} +1 -1
  77. package/dist/ui/assets/session-freezer-B59WuEaJ.js +1 -0
  78. package/dist/ui/assets/{speak-DnUM0f7v.js → speak-BDVSzMcc.js} +1 -1
  79. package/dist/ui/assets/{speak-CgAI2KYl.js → speak-CClITCPK.js} +1 -1
  80. package/dist/ui/assets/{sprinkle-manager-DYaInmV_.js → sprinkle-manager-gfD7_n13.js} +1 -1
  81. package/dist/ui/assets/src-YN73WJ67.js +1 -0
  82. package/dist/ui/assets/{store-BaJ2eBe1.js → store-DrCJeBNd.js} +1 -1
  83. package/dist/ui/assets/{sudo-xhi2Ak8E.js → sudo-DgiMHb5o.js} +1 -1
  84. package/dist/ui/assets/{transformers-env-D4CptrRJ.js → transformers-env-DKNE7GpB.js} +1 -1
  85. package/dist/ui/assets/{transformers-env-CjH48rcA.js → transformers-env-lVvkNQQe.js} +1 -1
  86. package/dist/ui/assets/{tray-leader-9ocvAws8.js → tray-leader-Lqisrfbv.js} +1 -1
  87. package/dist/ui/assets/{tray-leave-runtime-CbCActT-.js → tray-leave-runtime-C2MoDf-1.js} +1 -1
  88. package/dist/ui/assets/{upgrade-detection-Cx62OrqD.js → upgrade-detection-CbBla6hH.js} +1 -1
  89. package/dist/ui/assets/{voice-reply-DgZHUwla.js → voice-reply-CJuWFQPX.js} +1 -1
  90. package/dist/ui/assets/{wc-attach-Cewj934x.js → wc-attach-jZdZHKD1.js} +3 -3
  91. package/dist/ui/assets/{wc-extension-DMUORWkk.js → wc-extension-Cs88BUjq.js} +2 -2
  92. package/dist/ui/assets/{wc-float-label-Dh8xz8qh.js → wc-float-label-DXWATTwk.js} +1 -1
  93. package/dist/ui/assets/{wc-follower-BpvDkz0d.js → wc-follower-C3__8PFa.js} +3 -3
  94. package/dist/ui/assets/{wc-live-CtTS9Xjt.js → wc-live-DR6tvItT.js} +5 -5
  95. package/dist/ui/assets/{wc-nav-kJc8A9Dl.js → wc-nav-DtsNnJ6v.js} +2 -2
  96. package/dist/ui/assets/{wc-onboarding-BvM6jsMO.js → wc-onboarding-D0yx-jSj.js} +2 -2
  97. package/dist/ui/assets/{wc-placeholder-CEigSCz5.js → wc-placeholder-BbSTS-RA.js} +3 -3
  98. package/dist/ui/assets/{wc-settings-8lhJTwtt.js → wc-settings-CPEfugAj.js} +2 -2
  99. package/dist/ui/assets/{wc-shell-L6a8pjqt.js → wc-shell-Dk6AF6cB.js} +4 -4
  100. package/dist/ui/assets/wc-sprinkles-BIGx9RF3.js +2 -0
  101. package/dist/ui/assets/wc-tray-CkhSEgan.js +2 -0
  102. package/dist/ui/assets/{whisper-engine-XLDWE9HZ.js → whisper-engine-CRsuayPy.js} +1 -1
  103. package/dist/ui/assets/{whisper-session-Duou3zwG.js → whisper-session-DHXbD0fp.js} +2 -2
  104. package/dist/ui/assets/{xai-grok-B7oC-8Q2.js → xai-grok-B-MyCxjN.js} +1 -1
  105. package/dist/ui/assets/{xai-grok-DvHOajhB.js → xai-grok-Bb_OnCv9.js} +1 -1
  106. package/dist/ui/index.html +8 -8
  107. package/dist/ui/llm-proxy-sw.js +1 -1
  108. package/dist/ui/packages/webapp/index.html +8 -8
  109. package/package.json +1 -1
  110. package/dist/ui/assets/adobe-oauth-state-Dah4Wgo9.js +0 -1
  111. package/dist/ui/assets/dip-DGHR5IkK.js +0 -1
  112. package/dist/ui/assets/esp8266-BhaHAxCt.js +0 -1
  113. package/dist/ui/assets/main-P9i9sHcy.js +0 -24
  114. package/dist/ui/assets/mount-n9WyRpQU.js +0 -1
  115. package/dist/ui/assets/page-follower-tray-C0NyNvG3.js +0 -5
  116. package/dist/ui/assets/provider-store-access-Bhd5H4ix.js +0 -1
  117. package/dist/ui/assets/provider-store-access-DOLsybeX.js +0 -1
  118. package/dist/ui/assets/proxied-fetch-BVw2cmL4.js +0 -1
  119. package/dist/ui/assets/remote-cdp-transport-DTCu2BgA.js +0 -1
  120. package/dist/ui/assets/session-freezer-D-aMuxJ5.js +0 -1
  121. package/dist/ui/assets/src-BdPw21ST.js +0 -1
  122. package/dist/ui/assets/wc-sprinkles-Bwe19fV-.js +0 -2
  123. package/dist/ui/assets/wc-tray-DJClZJWY.js +0 -2
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Standalone/Electron thin-bridge launch contract — single source of truth.
3
+ *
4
+ * The node-server (and swift-server) appends `?bridge=<ws-url>&bridgeToken=…`
5
+ * to the hosted leader launch URL; the leader dials the local `/cdp`
6
+ * WebSocket offering `Sec-WebSocket-Protocol: slicc.bridge.v1.<token>` and
7
+ * sends the raw token on cross-origin `/api/*` calls as `X-Bridge-Token`.
8
+ *
9
+ * Consumers: `packages/node-server/src/bridge-security.ts` (server gate),
10
+ * `packages/webapp/src/ui/boot/bridge-launch-params.ts` (leader boot),
11
+ * `packages/chrome-extension/src/bridge-sw.ts` (SW port allowlist),
12
+ * `packages/webapp/src/ui/llm-proxy-sw.ts` (header pass-through).
13
+ * Swift mirror: `packages/swift-server/Sources/Server/BridgeSecurity.swift`
14
+ * — update it when these values change.
15
+ */
16
+ /** Production hosted-UI origin every bridge allowlist starts from. */
17
+ export declare const SLICC_HOSTED_ORIGIN = "https://www.sliccy.ai";
18
+ /** Staging tray-hub origin (allowlisted by the node-server bridge only). */
19
+ export declare const SLICC_STAGING_HUB_ORIGIN = "https://slicc-tray-hub-staging.minivelos.workers.dev";
20
+ /** Subprotocol prefix the leader sends; servers validate `<prefix><token>`. */
21
+ export declare const BRIDGE_SUBPROTOCOL_PREFIX = "slicc.bridge.v1.";
22
+ /** Query-param name carrying the per-process bridge token. */
23
+ export declare const BRIDGE_TOKEN_QUERY_PARAM = "bridgeToken";
24
+ /** Query-param name carrying the local `/cdp` WebSocket URL. */
25
+ export declare const BRIDGE_WS_QUERY_PARAM = "bridge";
26
+ /** Header carrying the raw bridge token on cross-origin `/api/*` calls. */
27
+ export declare const BRIDGE_TOKEN_HEADER = "X-Bridge-Token";
28
+ //# sourceMappingURL=bridge-protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge-protocol.d.ts","sourceRoot":"","sources":["../src/bridge-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,sEAAsE;AACtE,eAAO,MAAM,mBAAmB,0BAA0B,CAAC;AAE3D,4EAA4E;AAC5E,eAAO,MAAM,wBAAwB,yDAAyD,CAAC;AAE/F,+EAA+E;AAC/E,eAAO,MAAM,yBAAyB,qBAAqB,CAAC;AAE5D,8DAA8D;AAC9D,eAAO,MAAM,wBAAwB,gBAAgB,CAAC;AAEtD,gEAAgE;AAChE,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAE9C,2EAA2E;AAC3E,eAAO,MAAM,mBAAmB,mBAAmB,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Standalone/Electron thin-bridge launch contract — single source of truth.
3
+ *
4
+ * The node-server (and swift-server) appends `?bridge=<ws-url>&bridgeToken=…`
5
+ * to the hosted leader launch URL; the leader dials the local `/cdp`
6
+ * WebSocket offering `Sec-WebSocket-Protocol: slicc.bridge.v1.<token>` and
7
+ * sends the raw token on cross-origin `/api/*` calls as `X-Bridge-Token`.
8
+ *
9
+ * Consumers: `packages/node-server/src/bridge-security.ts` (server gate),
10
+ * `packages/webapp/src/ui/boot/bridge-launch-params.ts` (leader boot),
11
+ * `packages/chrome-extension/src/bridge-sw.ts` (SW port allowlist),
12
+ * `packages/webapp/src/ui/llm-proxy-sw.ts` (header pass-through).
13
+ * Swift mirror: `packages/swift-server/Sources/Server/BridgeSecurity.swift`
14
+ * — update it when these values change.
15
+ */
16
+ /** Production hosted-UI origin every bridge allowlist starts from. */
17
+ export const SLICC_HOSTED_ORIGIN = 'https://www.sliccy.ai';
18
+ /** Staging tray-hub origin (allowlisted by the node-server bridge only). */
19
+ export const SLICC_STAGING_HUB_ORIGIN = 'https://slicc-tray-hub-staging.minivelos.workers.dev';
20
+ /** Subprotocol prefix the leader sends; servers validate `<prefix><token>`. */
21
+ export const BRIDGE_SUBPROTOCOL_PREFIX = 'slicc.bridge.v1.';
22
+ /** Query-param name carrying the per-process bridge token. */
23
+ export const BRIDGE_TOKEN_QUERY_PARAM = 'bridgeToken';
24
+ /** Query-param name carrying the local `/cdp` WebSocket URL. */
25
+ export const BRIDGE_WS_QUERY_PARAM = 'bridge';
26
+ /** Header carrying the raw bridge token on cross-origin `/api/*` calls. */
27
+ export const BRIDGE_TOKEN_HEADER = 'X-Bridge-Token';
28
+ //# sourceMappingURL=bridge-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge-protocol.js","sourceRoot":"","sources":["../src/bridge-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,sEAAsE;AACtE,MAAM,CAAC,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAE3D,4EAA4E;AAC5E,MAAM,CAAC,MAAM,wBAAwB,GAAG,sDAAsD,CAAC;AAE/F,+EAA+E;AAC/E,MAAM,CAAC,MAAM,yBAAyB,GAAG,kBAAkB,CAAC;AAE5D,8DAA8D;AAC9D,MAAM,CAAC,MAAM,wBAAwB,GAAG,aAAa,CAAC;AAEtD,gEAAgE;AAChE,MAAM,CAAC,MAAM,qBAAqB,GAAG,QAAQ,CAAC;AAE9C,2EAA2E;AAC3E,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAgB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from './base64.js';
2
+ export * from './bridge-protocol.js';
2
3
  export * from './cdp-frame-unmask.js';
3
4
  export * from './electron-overlay-route.js';
4
5
  export * from './oauth-extra-domains-storage.js';
@@ -8,4 +9,5 @@ export * from './secrets-pipeline.js';
8
9
  export * from './session-secret-store.js';
9
10
  export * from './sign-and-forward.js';
10
11
  export * from './sigv4.js';
12
+ export * from './tray-signaling.js';
11
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  // Re-exports added in Task 1.2 (secret-masking) and Task 1.3 (secrets-pipeline).
2
2
  export * from './base64.js';
3
+ export * from './bridge-protocol.js';
3
4
  export * from './cdp-frame-unmask.js';
4
5
  export * from './electron-overlay-route.js';
5
6
  export * from './oauth-extra-domains-storage.js';
@@ -9,4 +10,5 @@ export * from './secrets-pipeline.js';
9
10
  export * from './session-secret-store.js';
10
11
  export * from './sign-and-forward.js';
11
12
  export * from './sigv4.js';
13
+ export * from './tray-signaling.js';
12
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iFAAiF;AAEjF,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iFAAiF;AAEjF,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,272 @@
1
+ /**
2
+ * Tray signaling wire contract — single source of truth.
3
+ *
4
+ * Spoken on two wires:
5
+ * 1. The leader's control WebSocket to the tray-hub worker
6
+ * (`LeaderToWorkerControlMessage` / `WorkerToLeaderControlMessage`).
7
+ * 2. The follower's HTTP bootstrap API on the worker
8
+ * (`FollowerBootstrapRequest` → `FollowerAttachResponse` /
9
+ * `FollowerBootstrapResponse`).
10
+ *
11
+ * Consumed by `packages/webapp` (leader + TS follower) and
12
+ * `packages/cloudflare-worker` (SessionTray Durable Object). The iOS follower
13
+ * mirrors a subset in `packages/ios-app/SliccFollower/Models/TrayTypes.swift`
14
+ * — update that mirror when this file changes.
15
+ *
16
+ * Worker-internal persisted state (`TrayBootstrapRecord`, `TrayRecord`) is NOT
17
+ * wire contract and lives in `packages/cloudflare-worker/src/shared.ts`.
18
+ */
19
+ export declare const TRAY_BOOTSTRAP_TIMEOUT_MS = 20000;
20
+ export declare const TRAY_BOOTSTRAP_MAX_RETRIES = 3;
21
+ export declare const TRAY_BOOTSTRAP_RETRY_AFTER_MS = 1000;
22
+ export type TrayBootstrapState = 'pending' | 'offered' | 'connected' | 'failed';
23
+ export interface TraySessionDescription {
24
+ type: 'offer' | 'answer';
25
+ sdp: string;
26
+ }
27
+ export interface TrayIceCandidate {
28
+ candidate: string;
29
+ sdpMid?: string | null;
30
+ sdpMLineIndex?: number | null;
31
+ usernameFragment?: string | null;
32
+ }
33
+ export interface TrayBootstrapFailure {
34
+ code: string;
35
+ message: string;
36
+ retryable: boolean;
37
+ retryAfterMs: number | null;
38
+ failedAt: string;
39
+ }
40
+ export type TrayBootstrapEvent = {
41
+ sequence: number;
42
+ sentAt: string;
43
+ type: 'bootstrap.offer';
44
+ offer: TraySessionDescription;
45
+ } | {
46
+ sequence: number;
47
+ sentAt: string;
48
+ type: 'bootstrap.ice_candidate';
49
+ candidate: TrayIceCandidate;
50
+ } | {
51
+ sequence: number;
52
+ sentAt: string;
53
+ type: 'bootstrap.failed';
54
+ failure: TrayBootstrapFailure;
55
+ };
56
+ export interface TrayBootstrapStatus {
57
+ controllerId: string;
58
+ bootstrapId: string;
59
+ attempt: number;
60
+ state: TrayBootstrapState;
61
+ expiresAt: string;
62
+ cursor: number;
63
+ maxRetries: number;
64
+ retriesRemaining: number;
65
+ retryAfterMs: number | null;
66
+ failure: TrayBootstrapFailure | null;
67
+ }
68
+ export interface TurnIceServer {
69
+ urls: string[];
70
+ username: string;
71
+ credential: string;
72
+ }
73
+ export interface FollowerJoinRequestedMessage {
74
+ type: 'follower.join_requested';
75
+ trayId: string;
76
+ controllerId: string;
77
+ runtime?: string;
78
+ bootstrapId: string;
79
+ attempt: number;
80
+ expiresAt: string;
81
+ iceServers?: TurnIceServer[];
82
+ }
83
+ export interface BootstrapAnswerMessage {
84
+ type: 'bootstrap.answer';
85
+ trayId: string;
86
+ controllerId: string;
87
+ bootstrapId: string;
88
+ answer: TraySessionDescription;
89
+ }
90
+ export interface BootstrapIceCandidateMessage {
91
+ type: 'bootstrap.ice_candidate';
92
+ trayId: string;
93
+ controllerId: string;
94
+ bootstrapId: string;
95
+ candidate: TrayIceCandidate;
96
+ }
97
+ export interface WebhookEventMessage {
98
+ type: 'webhook.event';
99
+ webhookId: string;
100
+ headers: Record<string, string>;
101
+ body: unknown;
102
+ timestamp: string;
103
+ }
104
+ export interface WorkerPreviewRequest {
105
+ type: 'preview.request';
106
+ reqId: string;
107
+ servedRoot: string;
108
+ vfsPath: string;
109
+ asText: boolean;
110
+ }
111
+ export interface WorkerPreviewRevoked {
112
+ type: 'preview.revoked';
113
+ previewToken: string;
114
+ }
115
+ export interface WorkerBridgeConnected {
116
+ type: 'bridge.connected';
117
+ connId: string;
118
+ previewToken: string;
119
+ origin: string;
120
+ userAgent: string;
121
+ connectedAt: string;
122
+ }
123
+ export interface WorkerBridgeDisconnected {
124
+ type: 'bridge.disconnected';
125
+ connId: string;
126
+ reason?: string;
127
+ }
128
+ export interface WorkerBridgeCdpResponse {
129
+ type: 'bridge.cdp.response';
130
+ connId: string;
131
+ id: number;
132
+ result?: Record<string, unknown>;
133
+ error?: {
134
+ code: number;
135
+ message: string;
136
+ };
137
+ }
138
+ export type WorkerToLeaderControlMessage = {
139
+ type: 'leader.connected';
140
+ trayId: string;
141
+ controllerId: string;
142
+ } | {
143
+ type: 'pong';
144
+ trayId: string;
145
+ } | FollowerJoinRequestedMessage | BootstrapAnswerMessage | BootstrapIceCandidateMessage | WebhookEventMessage | WorkerPreviewRequest | WorkerPreviewRevoked | WorkerBridgeConnected | WorkerBridgeDisconnected | WorkerBridgeCdpResponse;
146
+ export interface LeaderBootstrapOfferMessage {
147
+ type: 'bootstrap.offer';
148
+ controllerId: string;
149
+ bootstrapId: string;
150
+ offer: TraySessionDescription;
151
+ }
152
+ export interface LeaderBootstrapIceCandidateMessage {
153
+ type: 'bootstrap.ice_candidate';
154
+ controllerId: string;
155
+ bootstrapId: string;
156
+ candidate: TrayIceCandidate;
157
+ }
158
+ export interface LeaderBootstrapFailedMessage {
159
+ type: 'bootstrap.failed';
160
+ controllerId: string;
161
+ bootstrapId: string;
162
+ code: string;
163
+ message: string;
164
+ retryable?: boolean;
165
+ retryAfterMs?: number | null;
166
+ }
167
+ export interface LeaderPreviewResponseOk {
168
+ type: 'preview.response';
169
+ reqId: string;
170
+ ok: true;
171
+ mime: string;
172
+ chunkIndex: number;
173
+ totalChunks: number;
174
+ /** utf-8 text OR base64-encoded binary, per `encoding`. */
175
+ content: string;
176
+ encoding: 'utf-8' | 'base64';
177
+ }
178
+ export interface LeaderPreviewResponseError {
179
+ type: 'preview.response';
180
+ reqId: string;
181
+ ok: false;
182
+ status: 404 | 403 | 500;
183
+ reason?: string;
184
+ }
185
+ export interface LeaderPreviewPurge {
186
+ type: 'preview.purge';
187
+ previewToken: string;
188
+ }
189
+ export interface LeaderBridgeCdpRequest {
190
+ type: 'bridge.cdp.request';
191
+ connId: string;
192
+ id: number;
193
+ method: string;
194
+ params?: Record<string, unknown>;
195
+ sessionId?: string;
196
+ }
197
+ /** Leader → worker: close a bridged preview visitor tab's connection (from
198
+ * `Target.closeTarget` on a `preview:<token>:<connId>` target). */
199
+ export interface LeaderBridgeClose {
200
+ type: 'bridge.close';
201
+ connId: string;
202
+ }
203
+ export type LeaderToWorkerControlMessage = {
204
+ type: 'ping';
205
+ } | LeaderBootstrapOfferMessage | LeaderBootstrapIceCandidateMessage | LeaderBootstrapFailedMessage | LeaderPreviewResponseOk | LeaderPreviewResponseError | LeaderPreviewPurge | LeaderBridgeCdpRequest | LeaderBridgeClose;
206
+ export interface BootstrapPollRequest {
207
+ action: 'poll';
208
+ controllerId?: string;
209
+ bootstrapId?: string;
210
+ cursor?: number;
211
+ }
212
+ export interface BootstrapAnswerRequest {
213
+ action: 'answer';
214
+ controllerId?: string;
215
+ bootstrapId?: string;
216
+ answer?: TraySessionDescription;
217
+ }
218
+ export interface BootstrapIceCandidateRequest {
219
+ action: 'ice-candidate';
220
+ controllerId?: string;
221
+ bootstrapId?: string;
222
+ candidate?: TrayIceCandidate;
223
+ }
224
+ export interface BootstrapRetryRequest {
225
+ action: 'retry';
226
+ controllerId?: string;
227
+ bootstrapId?: string;
228
+ runtime?: string;
229
+ }
230
+ export type FollowerBootstrapRequest = BootstrapPollRequest | BootstrapAnswerRequest | BootstrapIceCandidateRequest | BootstrapRetryRequest;
231
+ export interface TrayLeaderSummary {
232
+ controllerId: string;
233
+ connected: boolean;
234
+ reconnectDeadline: string | null;
235
+ }
236
+ export interface FollowerJoinRequest {
237
+ controllerId?: string;
238
+ runtime?: string;
239
+ }
240
+ export type FollowerAttachResult = {
241
+ action: 'wait';
242
+ code: 'LEADER_NOT_ELECTED' | 'LEADER_NOT_CONNECTED';
243
+ retryAfterMs: number;
244
+ } | {
245
+ action: 'signal';
246
+ code: 'LEADER_CONNECTED';
247
+ bootstrap: TrayBootstrapStatus;
248
+ } | {
249
+ action: 'fail';
250
+ code: 'INVALID_JOIN_CAPABILITY' | 'TRAY_EXPIRED';
251
+ error: string;
252
+ };
253
+ export interface FollowerAttachResponse {
254
+ trayId: string;
255
+ controllerId: string;
256
+ role: 'follower';
257
+ leader: TrayLeaderSummary | null;
258
+ participantCount: number;
259
+ result: FollowerAttachResult;
260
+ iceServers?: TurnIceServer[];
261
+ }
262
+ export interface FollowerBootstrapResponse {
263
+ trayId: string;
264
+ controllerId: string;
265
+ role: 'follower';
266
+ leader: TrayLeaderSummary | null;
267
+ participantCount: number;
268
+ bootstrap: TrayBootstrapStatus;
269
+ events: TrayBootstrapEvent[];
270
+ iceServers?: TurnIceServer[];
271
+ }
272
+ //# sourceMappingURL=tray-signaling.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tray-signaling.d.ts","sourceRoot":"","sources":["../src/tray-signaling.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAChD,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAC5C,eAAO,MAAM,6BAA6B,OAAQ,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEhF,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,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;CACf,CAAC;AAEN,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,oBAAoB,CAAC;IAC7B,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,mBAAmB,CAAC;IAC/B,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;CAC9B"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Tray signaling wire contract — single source of truth.
3
+ *
4
+ * Spoken on two wires:
5
+ * 1. The leader's control WebSocket to the tray-hub worker
6
+ * (`LeaderToWorkerControlMessage` / `WorkerToLeaderControlMessage`).
7
+ * 2. The follower's HTTP bootstrap API on the worker
8
+ * (`FollowerBootstrapRequest` → `FollowerAttachResponse` /
9
+ * `FollowerBootstrapResponse`).
10
+ *
11
+ * Consumed by `packages/webapp` (leader + TS follower) and
12
+ * `packages/cloudflare-worker` (SessionTray Durable Object). The iOS follower
13
+ * mirrors a subset in `packages/ios-app/SliccFollower/Models/TrayTypes.swift`
14
+ * — update that mirror when this file changes.
15
+ *
16
+ * Worker-internal persisted state (`TrayBootstrapRecord`, `TrayRecord`) is NOT
17
+ * wire contract and lives in `packages/cloudflare-worker/src/shared.ts`.
18
+ */
19
+ export const TRAY_BOOTSTRAP_TIMEOUT_MS = 20_000;
20
+ export const TRAY_BOOTSTRAP_MAX_RETRIES = 3;
21
+ export const TRAY_BOOTSTRAP_RETRY_AFTER_MS = 1_000;
22
+ //# sourceMappingURL=tray-signaling.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tray-signaling.js","sourceRoot":"","sources":["../src/tray-signaling.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC;AAChD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAC5C,MAAM,CAAC,MAAM,6BAA6B,GAAG,KAAK,CAAC"}
@@ -18,11 +18,12 @@
18
18
  * Pure module (no node-only imports) so the WS gate is trivially unit
19
19
  * testable from `tests/bridge-security.test.ts`.
20
20
  */
21
+ import { BRIDGE_SUBPROTOCOL_PREFIX, BRIDGE_TOKEN_HEADER, BRIDGE_TOKEN_QUERY_PARAM, BRIDGE_WS_QUERY_PARAM } from './_shared/index.js';
22
+ export { BRIDGE_SUBPROTOCOL_PREFIX, BRIDGE_TOKEN_HEADER, BRIDGE_TOKEN_QUERY_PARAM, BRIDGE_WS_QUERY_PARAM, };
21
23
  /**
22
- * Origin allowlist. Production + staging worker plus the dev-mode loopback
23
- * origins (parallel to chrome-extension's `BRIDGE_DEV_ORIGINS`). Add a new
24
- * origin here and in the extension allowlist together they MUST stay in
25
- * sync, otherwise extension and standalone disagree on what's a leader.
24
+ * Origin allowlist. The hosted origins come from `@slicc/shared-ts`
25
+ * (`bridge-protocol.ts`) the same constants the extension allowlist
26
+ * composes from plus this server's own dev-mode loopback origins.
26
27
  *
27
28
  * Dev-only extra origins can be added at process start via the
28
29
  * `BRIDGE_DEV_ALLOWED_ORIGINS` env var (comma-separated). Used by the
@@ -31,21 +32,6 @@
31
32
  * allowlist is byte-identical to this frozen base — prod is unaffected.
32
33
  */
33
34
  export declare const BRIDGE_ALLOWED_ORIGINS: readonly string[];
34
- /** Subprotocol prefix advertised by the leader; the per-process token is appended. */
35
- export declare const BRIDGE_SUBPROTOCOL_PREFIX = "slicc.bridge.v1.";
36
- /** Query-param name the launch URL uses to forward the subprotocol token to the leader. */
37
- export declare const BRIDGE_TOKEN_QUERY_PARAM = "bridgeToken";
38
- /** Query-param name the launch URL uses to forward the local /cdp WebSocket URL. */
39
- export declare const BRIDGE_WS_QUERY_PARAM = "bridge";
40
- /**
41
- * Request header carrying the per-process bridge token on cross-origin
42
- * /api/* calls from a remote allowlisted leader (e.g. sliccy.ai). The
43
- * webapp's `proxied-fetch.ts` attaches it whenever a local API base
44
- * origin is set; the thin-bridge CORS middleware validates it. Header
45
- * is included in `CORS_BASE_ALLOW_HEADERS` so browsers don't strip it
46
- * on the preflight.
47
- */
48
- export declare const BRIDGE_TOKEN_HEADER = "X-Bridge-Token";
49
35
  /**
50
36
  * True iff `origin` is in the bridge allowlist. The frozen prod base
51
37
  * (`BRIDGE_ALLOWED_ORIGINS`) is matched case-sensitively against the
@@ -19,11 +19,15 @@
19
19
  * testable from `tests/bridge-security.test.ts`.
20
20
  */
21
21
  import { randomUUID, timingSafeEqual } from 'node:crypto';
22
+ import { BRIDGE_SUBPROTOCOL_PREFIX, BRIDGE_TOKEN_HEADER, BRIDGE_TOKEN_QUERY_PARAM, BRIDGE_WS_QUERY_PARAM, SLICC_HOSTED_ORIGIN, SLICC_STAGING_HUB_ORIGIN, } from './_shared/index.js';
23
+ // Re-exported so the many existing bridge-security importers (index.ts,
24
+ // launch-url.ts, electron-controller.ts, tests) keep their import surface.
25
+ // Canonical definitions: packages/shared-ts/src/bridge-protocol.ts.
26
+ export { BRIDGE_SUBPROTOCOL_PREFIX, BRIDGE_TOKEN_HEADER, BRIDGE_TOKEN_QUERY_PARAM, BRIDGE_WS_QUERY_PARAM, };
22
27
  /**
23
- * Origin allowlist. Production + staging worker plus the dev-mode loopback
24
- * origins (parallel to chrome-extension's `BRIDGE_DEV_ORIGINS`). Add a new
25
- * origin here and in the extension allowlist together they MUST stay in
26
- * sync, otherwise extension and standalone disagree on what's a leader.
28
+ * Origin allowlist. The hosted origins come from `@slicc/shared-ts`
29
+ * (`bridge-protocol.ts`) the same constants the extension allowlist
30
+ * composes from plus this server's own dev-mode loopback origins.
27
31
  *
28
32
  * Dev-only extra origins can be added at process start via the
29
33
  * `BRIDGE_DEV_ALLOWED_ORIGINS` env var (comma-separated). Used by the
@@ -32,8 +36,8 @@ import { randomUUID, timingSafeEqual } from 'node:crypto';
32
36
  * allowlist is byte-identical to this frozen base — prod is unaffected.
33
37
  */
34
38
  export const BRIDGE_ALLOWED_ORIGINS = Object.freeze([
35
- 'https://www.sliccy.ai',
36
- 'https://slicc-tray-hub-staging.minivelos.workers.dev',
39
+ SLICC_HOSTED_ORIGIN,
40
+ SLICC_STAGING_HUB_ORIGIN,
37
41
  'http://localhost:5710',
38
42
  'http://127.0.0.1:5710',
39
43
  ]);
@@ -81,21 +85,6 @@ const BRIDGE_DEV_ALLOWED_ORIGINS = (() => {
81
85
  }
82
86
  return set;
83
87
  })();
84
- /** Subprotocol prefix advertised by the leader; the per-process token is appended. */
85
- export const BRIDGE_SUBPROTOCOL_PREFIX = 'slicc.bridge.v1.';
86
- /** Query-param name the launch URL uses to forward the subprotocol token to the leader. */
87
- export const BRIDGE_TOKEN_QUERY_PARAM = 'bridgeToken';
88
- /** Query-param name the launch URL uses to forward the local /cdp WebSocket URL. */
89
- export const BRIDGE_WS_QUERY_PARAM = 'bridge';
90
- /**
91
- * Request header carrying the per-process bridge token on cross-origin
92
- * /api/* calls from a remote allowlisted leader (e.g. sliccy.ai). The
93
- * webapp's `proxied-fetch.ts` attaches it whenever a local API base
94
- * origin is set; the thin-bridge CORS middleware validates it. Header
95
- * is included in `CORS_BASE_ALLOW_HEADERS` so browsers don't strip it
96
- * on the preflight.
97
- */
98
- export const BRIDGE_TOKEN_HEADER = 'X-Bridge-Token';
99
88
  /**
100
89
  * Headers we allow on cross-origin /api requests from the hosted leader.
101
90
  * Includes the `/api/fetch-proxy` transport headers (`X-Target-URL`, the