sliccy 6.211.0 → 6.213.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.
Files changed (233) hide show
  1. package/dist/node-server/_shared/index.d.ts +1 -0
  2. package/dist/node-server/_shared/index.d.ts.map +1 -1
  3. package/dist/node-server/_shared/index.js +1 -0
  4. package/dist/node-server/_shared/index.js.map +1 -1
  5. package/dist/node-server/_shared/raw-fetch-protocol.d.ts +241 -0
  6. package/dist/node-server/_shared/raw-fetch-protocol.d.ts.map +1 -0
  7. package/dist/node-server/_shared/raw-fetch-protocol.js +336 -0
  8. package/dist/node-server/_shared/raw-fetch-protocol.js.map +1 -0
  9. package/dist/node-server/fetch-proxy-headers.d.ts +3 -1
  10. package/dist/node-server/fetch-proxy-headers.js +5 -1
  11. package/dist/node-server/index.js +14 -3
  12. package/dist/node-server/routes/fetch-proxy-raw.d.ts +43 -0
  13. package/dist/node-server/routes/fetch-proxy-raw.js +205 -0
  14. package/dist/node-server/routes/fetch-proxy.d.ts +23 -0
  15. package/dist/node-server/routes/fetch-proxy.js +4 -3
  16. package/dist/ui/.vite/manifest.json +307 -273
  17. package/dist/ui/assets/SKILL-CN4LOg1h.js +1 -0
  18. package/dist/ui/assets/__vite-browser-external-BLOvPDKs.js +1 -0
  19. package/dist/ui/assets/{account-store-CwNcf5Wq.js → account-store-fjp6LWs-.js} +1 -1
  20. package/dist/ui/assets/{account-store-nlKbTUhJ.js → account-store-mGK-Vxp3.js} +2 -2
  21. package/dist/ui/assets/{adobe-DBVa9oOG.js → adobe-DPHgLkac.js} +1 -1
  22. package/dist/ui/assets/{adobe-D7sqH2X_.js → adobe-S0t3jWwL.js} +2 -2
  23. package/dist/ui/assets/{agent-panels-B0VuA3mU.js → agent-panels-Bm22J6pS.js} +1 -1
  24. package/dist/ui/assets/{almost-bash-shell-headless-C0x2DyFh.js → almost-bash-shell-headless-C0nOHXYk.js} +170 -165
  25. package/dist/ui/assets/{apply-layout-fciODM2t.js → apply-layout-Br7JVHhr.js} +1 -1
  26. package/dist/ui/assets/{apps-RVxpwEfn.js → apps-BDBgjMBq.js} +1 -1
  27. package/dist/ui/assets/{azure-openai-JxdRj-Iq.js → azure-openai-BI2badpb.js} +1 -1
  28. package/dist/ui/assets/{azure-openai-QS8TU-7m.js → azure-openai-DJE4Sczz.js} +1 -1
  29. package/dist/ui/assets/{backend-hostfs-CITljQVo.js → backend-hostfs-Bz3IrIdK.js} +1 -1
  30. package/dist/ui/assets/{bsh-watchdog-BTB0exmo.js → bsh-watchdog-CQDvJ-W5.js} +1 -1
  31. package/dist/ui/assets/{capability-BgC-ru0t.js → capability-BKiHfH3p.js} +2 -2
  32. package/dist/ui/assets/{cdp-Djm-AVXd.js → cdp-Gtyj4jl-.js} +1 -1
  33. package/dist/ui/assets/{cerebras-DvIFsdoW.js → cerebras-DWha2vde.js} +1 -1
  34. package/dist/ui/assets/{cerebras-Czq0QoYg.js → cerebras-Dm2FQ3GV.js} +1 -1
  35. package/dist/ui/assets/{client-CwxmlQM-.js → client-D6ReV9Ib.js} +1 -1
  36. package/dist/ui/assets/{composer-speech-DgLXFFNQ.js → composer-speech-1q13QUq_.js} +1 -1
  37. package/dist/ui/assets/{connect-surface-YjzKwUub.js → connect-surface-NaWYHUjr.js} +1 -1
  38. package/dist/ui/assets/{core-C7UGykIC.js → core-BcE0crDk.js} +2 -2
  39. package/dist/ui/assets/{core-D8SLLGdB.js → core-CEE10OlM.js} +1 -1
  40. package/dist/ui/assets/{directed-approval-BMnSWjrJ.js → directed-approval-jLsxBIe6.js} +1 -1
  41. package/dist/ui/assets/{discovery-preference-MWZVi-PZ.js → discovery-preference-C0DTxowG.js} +1 -1
  42. package/dist/ui/assets/{emscripten-vfs-hook-CwbQLP-I.js → emscripten-vfs-hook-DISFwioa.js} +1 -1
  43. package/dist/ui/assets/{ensure-speech-assets-Bqf-swhU.js → ensure-speech-assets-fDebrLBj.js} +1 -1
  44. package/dist/ui/assets/{esbuild-wasm-DIcMVR3g.js → esbuild-wasm-DeTghvWH.js} +1 -1
  45. package/dist/ui/assets/{extension-ops-CF2mLDRW.js → extension-ops-CwrukT2W.js} +1 -1
  46. package/dist/ui/assets/ffmpeg-wasm-sx-3yVAE.js +1 -0
  47. package/dist/ui/assets/{float-topology-B0_dG7En.js → float-topology-BSPnDsUv.js} +1 -1
  48. package/dist/ui/assets/{follower-navigate-watcher-DVWQWTGU.js → follower-navigate-watcher-CIVm_wIJ.js} +1 -1
  49. package/dist/ui/assets/{frozen-archive-writer-BV51qDTg.js → frozen-archive-writer-Djqg0xeo.js} +1 -1
  50. package/dist/ui/assets/{fs-ZnsLbva1.js → fs-5ZHASVGZ.js} +1 -1
  51. package/dist/ui/assets/{fs-pBJBtnUm.js → fs-DzdjnG3L.js} +2 -2
  52. package/dist/ui/assets/{gelatiere-store-B-PMFWOJ.js → gelatiere-store-B83pUPef.js} +1 -1
  53. package/dist/ui/assets/{gelatiere-unit-B7YUbTOe.js → gelatiere-unit-C04rrp6y.js} +1 -1
  54. package/dist/ui/assets/{github-CRKKUq6c.js → github-Be9hPdBb.js} +1 -1
  55. package/dist/ui/assets/{github-q7aLpavT.js → github-DuoX7VzM.js} +2 -2
  56. package/dist/ui/assets/{github-auth-DPBopdHy.js → github-auth-DuKz79kI.js} +1 -1
  57. package/dist/ui/assets/{github-copilot-BOqjn_pA.js → github-copilot-CGGz1K3c.js} +1 -1
  58. package/dist/ui/assets/{github-copilot-Cn5WeEVQ.js → github-copilot-DtxwK7LU.js} +1 -1
  59. package/dist/ui/assets/{github-install-Dlx1x9oP.js → github-install-xIoNGcMb.js} +1 -1
  60. package/dist/ui/assets/{github-zip-BKesEE7T.js → github-zip-CvpptbQJ.js} +1 -1
  61. package/dist/ui/assets/{guest-tool-gate-DbuM_BFG.js → guest-tool-gate-CS2rY_Bg.js} +1 -1
  62. package/dist/ui/assets/{hear-BAlAHUln.js → hear-DnRjgaFl.js} +1 -1
  63. package/dist/ui/assets/{help-MPD6QjSi.js → help-ARRi3_FN.js} +1 -1
  64. package/dist/ui/assets/installer-z5ym8JGo.js +2 -0
  65. package/dist/ui/assets/{interrupted-work-recovery-DKlfO3Dk.js → interrupted-work-recovery-B79QjX1q.js} +1 -1
  66. package/dist/ui/assets/{ipk-mamba-B7DsVAHB.js → ipk-mamba-qo7lmAxC.js} +1 -1
  67. package/dist/ui/assets/{js-realm-worker-Dj6E7cem.js → js-realm-worker-Diq6GzVC.js} +2 -2
  68. package/dist/ui/assets/jsh-executor-C1dYte5Y.js +18 -0
  69. package/dist/ui/assets/{kernel-worker-C6evRbt8.js → kernel-worker-DuWvWN7N.js} +10 -10
  70. package/dist/ui/assets/{lick-ws-bridge-cpYoem5_.js → lick-ws-bridge-BkH49XSX.js} +1 -1
  71. package/dist/ui/assets/{lick-ws-bridge-DEO3vHuX.js → lick-ws-bridge-DOd0xX92.js} +1 -1
  72. package/dist/ui/assets/{live-session-curation-BM8tZX-r.js → live-session-curation-Qbwf1NAc.js} +1 -1
  73. package/dist/ui/assets/{live-session-snapshot-C2NMVRMF.js → live-session-snapshot-DD7q7sed.js} +1 -1
  74. package/dist/ui/assets/{local-llm-Cfh9VuPq.js → local-llm-B-GY7LyN.js} +1 -1
  75. package/dist/ui/assets/{local-llm-z-cBJlKf.js → local-llm-BLF5wqTd.js} +1 -1
  76. package/dist/ui/assets/{magick-wasm-agWGi-e0.js → magick-wasm-BbnwhVj1.js} +1 -1
  77. package/dist/ui/assets/main-DEyT144X.js +22 -0
  78. package/dist/ui/assets/{main-cherry-CbQUCau8.js → main-cherry-Cu3CGlGr.js} +1 -1
  79. package/dist/ui/assets/{memory-curation-seam-CjBglHNa.js → memory-curation-seam-w6P3Yio_.js} +1 -1
  80. package/dist/ui/assets/{memory-health-CPzWzT1P.js → memory-health-Dr0w_W51.js} +1 -1
  81. package/dist/ui/assets/{memory-write-execute-DqWqBfwf.js → memory-write-execute-DcBGe0eP.js} +1 -1
  82. package/dist/ui/assets/{merge-folded-cost-into-frozen-DCuPhNTk.js → merge-folded-cost-into-frozen-C4JDM_W2.js} +1 -1
  83. package/dist/ui/assets/{mount-ydk0WHgG.js → mount-BgxvKuUM.js} +3 -3
  84. package/dist/ui/assets/{mount-4dZRjkrQ.js → mount-CmfCpPR2.js} +1 -1
  85. package/dist/ui/assets/{mount-bridge-client-CaHZ1pkb.js → mount-bridge-client-B4k68vSt.js} +1 -1
  86. package/dist/ui/assets/{mount-bridge-client-Dz_UHbPE.js → mount-bridge-client-BEo4cZu9.js} +1 -1
  87. package/dist/ui/assets/{new-session-C5MEP_cK.js → new-session-CwHkP88s.js} +2 -2
  88. package/dist/ui/assets/{oauth-bootstrap-BVUK3GEs.js → oauth-bootstrap-BPuDFH-P.js} +2 -2
  89. package/dist/ui/assets/{oauth-service-DP3Rx6V_.js → oauth-service-BAMAbRZF.js} +1 -1
  90. package/dist/ui/assets/{oauth-service-_PUd0RqU.js → oauth-service-DpYLgogD.js} +1 -1
  91. package/dist/ui/assets/{onboarding-orchestrator-DftSEsKa.js → onboarding-orchestrator-CqxAkzsh.js} +1 -1
  92. package/dist/ui/assets/{openai-codex-Cwz1FT-z.js → openai-codex-C6ENXDPu.js} +1 -1
  93. package/dist/ui/assets/{openai-codex-fJtQGV69.js → openai-codex-C7y3A12y.js} +1 -1
  94. package/dist/ui/assets/{openrouter-rcqoBXaw.js → openrouter-B_QyP0t0.js} +1 -1
  95. package/dist/ui/assets/{openrouter-DmEz5WxK.js → openrouter-OabN5l7D.js} +1 -1
  96. package/dist/ui/assets/{openrouter-free-C5O97xvy.js → openrouter-free-B6nKQRXp.js} +1 -1
  97. package/dist/ui/assets/{openrouter-free-DRw-DHQn.js → openrouter-free-DGKPRs_B.js} +1 -1
  98. package/dist/ui/assets/{openrouter-oauth-Csq32wt2.js → openrouter-oauth-Bk0XxNiC.js} +1 -1
  99. package/dist/ui/assets/{openrouter-oauth-C4uIzDcA.js → openrouter-oauth-CX8kG6KA.js} +1 -1
  100. package/dist/ui/assets/{opfs-mount-C0Lus0Cz.js → opfs-mount-qTgy11zh.js} +1 -1
  101. package/dist/ui/assets/{page-approval-service-DRZEjhrX.js → page-approval-service-CXkQVFLG.js} +1 -1
  102. package/dist/ui/assets/panel-rpc-handlers-CSmX-MAR.js +2 -0
  103. package/dist/ui/assets/{panelize-shell-Dzogbbfc.js → panelize-shell-yB93SE4Y.js} +1 -1
  104. package/dist/ui/assets/{pi-edit-execution-D9D4FDIQ.js → pi-edit-execution-BVXOHFxX.js} +1 -1
  105. package/dist/ui/assets/{port-bridge-client-BiWcfZSc.js → port-bridge-client-CEaNd6r8.js} +1 -1
  106. package/dist/ui/assets/{port-bridge-client-B-l7cQTC.js → port-bridge-client-F6a5_hCP.js} +1 -1
  107. package/dist/ui/assets/{provider-Do-gc4OB.js → provider-B7d79Yfq.js} +2 -2
  108. package/dist/ui/assets/{provider-CTPdODd7.js → provider-CunGsGmq.js} +1 -1
  109. package/dist/ui/assets/{provider-settings-DzDdkFMx.js → provider-settings-DLlJARyA.js} +1 -1
  110. package/dist/ui/assets/provider-store-access-C6ioPJYW.js +1 -0
  111. package/dist/ui/assets/provider-store-access-nlt5NO-S.js +1 -0
  112. package/dist/ui/assets/{providers-1_CCXdq3.js → providers-BwSnx8yc.js} +2 -2
  113. package/dist/ui/assets/{providers-BdG-aC29.js → providers-DLmkSqj2.js} +1 -1
  114. package/dist/ui/assets/proxied-fetch-DeMBWFzI.js +2 -0
  115. package/dist/ui/assets/proxied-fetch-raw-CAiQXSbH.js +2 -0
  116. package/dist/ui/assets/proxied-fetch-raw-C_y9uX3O.js +1 -0
  117. package/dist/ui/assets/proxied-fetch-raw-port-Dldi3vjV.js +1 -0
  118. package/dist/ui/assets/proxied-fetch-raw-types-BapqdEuh.js +1 -0
  119. package/dist/ui/assets/proxied-fetch-s960JxMc.js +1 -0
  120. package/dist/ui/assets/proxy-error-9UvXMpzG.js +1 -0
  121. package/dist/ui/assets/proxy-error-BVzVNPvv.js +1 -0
  122. package/dist/ui/assets/py-realm-worker-COX6g80P.js +259 -0
  123. package/dist/ui/assets/pyodide-BC3toCIx.js +3 -0
  124. package/dist/ui/assets/{quick-llm-B07QXQ0s.js → quick-llm-BX9iB6T2.js} +1 -1
  125. package/dist/ui/assets/{realm-inprocess-wC9VuVQf.js → realm-inprocess-BifRW5BN.js} +2 -2
  126. package/dist/ui/assets/{realm-unhandled-rejections-CEAHL08q.js → realm-unhandled-rejections-VQpAdFFQ.js} +1 -1
  127. package/dist/ui/assets/{realm-unhandled-rejections-CuAh-NpD.js → realm-unhandled-rejections-ur3LJMw_.js} +1 -1
  128. package/dist/ui/assets/{recovery-screen-mPjIBgPH.js → recovery-screen-DBbPdYjm.js} +1 -1
  129. package/dist/ui/assets/{redirect-uri-CBCnYKsl.js → redirect-uri-CaOLxSNL.js} +1 -1
  130. package/dist/ui/assets/{remote-terminal-view-DTmUlQlW.js → remote-terminal-view-xHFMED9Y.js} +2 -2
  131. package/dist/ui/assets/{require-guards-CyhsDWYg.js → require-guards-DKdJuMhY.js} +1 -1
  132. package/dist/ui/assets/{rest-ops-CLliBy-9.js → rest-ops-BuX7fp1f.js} +1 -1
  133. package/dist/ui/assets/rest-ops-CFWZPnkD.js +1 -0
  134. package/dist/ui/assets/{restore-BSMRZD-l.js → restore-BBl-yIaq.js} +1 -1
  135. package/dist/ui/assets/{run-CyMKLTKU.js → run-CfAgiioM.js} +1 -1
  136. package/dist/ui/assets/{run-CJfA-Obt.js → run-CgY-k2R4.js} +1 -1
  137. package/dist/ui/assets/{run-DMO7-CuA.js → run-CogIdMWn.js} +1 -1
  138. package/dist/ui/assets/{run-KLXVoIYy.js → run-CxkexRhE.js} +1 -1
  139. package/dist/ui/assets/{run-CM8a7Cc3.js → run-D54dHUrV.js} +1 -1
  140. package/dist/ui/assets/{run-CjBpwwpL.js → run-D7KFxRYl.js} +1 -1
  141. package/dist/ui/assets/{run-BSt_FVlm.js → run-DZawn4Xa.js} +2 -2
  142. package/dist/ui/assets/{run-BoxCVicT.js → run-MeahL9r7.js} +3 -3
  143. package/dist/ui/assets/{run-C8OfqJcF.js → run-PKN73_w0.js} +2 -2
  144. package/dist/ui/assets/run-pdHKWDkm.js +14 -0
  145. package/dist/ui/assets/{screencapture-run-C3Y7V44Z.js → screencapture-run-DRiSGUJ9.js} +1 -1
  146. package/dist/ui/assets/{secret-env-iwcdxjpw.js → secret-env-BRf8T_Fe.js} +1 -1
  147. package/dist/ui/assets/secret-topology-C2kgQ9r9.js +1 -0
  148. package/dist/ui/assets/{secrets-bridge-client-B_CG-HIg.js → secrets-bridge-client-CGijAHIT.js} +1 -1
  149. package/dist/ui/assets/{secrets-bridge-client-BiJrSKN9.js → secrets-bridge-client-VdZ1bPgH.js} +1 -1
  150. package/dist/ui/assets/{session-command-memory-D9pTlYAY.js → session-command-memory-J2xe49To.js} +2 -2
  151. package/dist/ui/assets/{session-jsonl-CJzYIghQ.js → session-jsonl-5GDXOR_C.js} +1 -1
  152. package/dist/ui/assets/{session-jsonl-AoJrx9pb.js → session-jsonl-C9S1Hp0I.js} +1 -1
  153. package/dist/ui/assets/{session-search-index-qOmoZUJy.js → session-search-index-CHfbRTfZ.js} +1 -1
  154. package/dist/ui/assets/{setup-feature-flags-remote-BKACONdE.js → setup-feature-flags-remote-BTi5UKVi.js} +1 -1
  155. package/dist/ui/assets/{setup-model-catalog-WWCUCy79.js → setup-model-catalog-DQQXcltm.js} +1 -1
  156. package/dist/ui/assets/shared-D-ZRFYou.js +4 -0
  157. package/dist/ui/assets/shared-DSEuryGJ.js +1 -0
  158. package/dist/ui/assets/{signed-fetch-CwZ1-qSJ.js → signed-fetch-Bn2dDzla.js} +1 -1
  159. package/dist/ui/assets/{silent-renew-backoff-L4eA7UKO.js → silent-renew-backoff-BQGn0nY-.js} +1 -1
  160. package/dist/ui/assets/slicc-version-CZlt8AJP.js +1 -0
  161. package/dist/ui/assets/{snapshot-D4DlVVCr.js → snapshot-DEUt_mMw.js} +1 -1
  162. package/dist/ui/assets/{snapshot-features-Cp2XSvVD.js → snapshot-features-BCSovSBw.js} +1 -1
  163. package/dist/ui/assets/{soundscape-CcHroDUu.js → soundscape-B0M5zVa9.js} +1 -1
  164. package/dist/ui/assets/{speak-5UMXEj6t.js → speak-C6tn6O17.js} +1 -1
  165. package/dist/ui/assets/{sprinkle-manager-ByfWs52B.js → sprinkle-manager-D3ABJVZf.js} +1 -1
  166. package/dist/ui/assets/{sprinkle-renderer-Dw0Oo-mB.js → sprinkle-renderer-DTsSBVXs.js} +1 -1
  167. package/dist/ui/assets/{ssh-ChyTtRdf.js → ssh-SLPkQeu_.js} +1 -1
  168. package/dist/ui/assets/{state-BPcLy39T.js → state-CFKdbg_M.js} +1 -1
  169. package/dist/ui/assets/{store-BA5jRQLQ.js → store-Ca0rev9f.js} +1 -1
  170. package/dist/ui/assets/{store-BCOFBOmf.js → store-CtL7qYvZ.js} +1 -1
  171. package/dist/ui/assets/{sudo-CZL3U0lj.js → sudo-HoSK3v1R.js} +1 -1
  172. package/dist/ui/assets/{supervisor-n5AQXVdz.js → supervisor-L8yevEWw.js} +1 -1
  173. package/dist/ui/assets/{sync-dialog-CLv-AjS5.js → sync-dialog-WTBaXGWH.js} +1 -1
  174. package/dist/ui/assets/{transformers-env-DuP48CFD.js → transformers-env-BCxUUI0f.js} +1 -1
  175. package/dist/ui/assets/tray-leader-6By4x6zT.js +1 -0
  176. package/dist/ui/assets/{tray-leave-runtime-BtmhGDJl.js → tray-leave-runtime-vBf3RjbW.js} +1 -1
  177. package/dist/ui/assets/{tray-runtime-config-CTm013-K.js → tray-runtime-config-Di9DBjwS.js} +1 -1
  178. package/dist/ui/assets/{tray-sidecar-x9PQcB2n.js → tray-sidecar-sLKe2Nue.js} +1 -1
  179. package/dist/ui/assets/{turn-journal-CScxev4H.js → turn-journal-CUVDw1Fo.js} +1 -1
  180. package/dist/ui/assets/{upgrade-detection-DS5evAII.js → upgrade-detection-Bd8hXlV7.js} +1 -1
  181. package/dist/ui/assets/{upskill-lick-skip-DsgHyVv5.js → upskill-lick-skip-DDXQrD5P.js} +1 -1
  182. package/dist/ui/assets/{voice-reply-ebSU1_qk.js → voice-reply-BypcVZfN.js} +1 -1
  183. package/dist/ui/assets/{wc-attach-525SvDTY.js → wc-attach-DEaBUBvg.js} +2 -2
  184. package/dist/ui/assets/{wc-browser-BWykEy-8.js → wc-browser-CN9Rl-Aa.js} +1 -1
  185. package/dist/ui/assets/{wc-computers-D3Avqz55.js → wc-computers-Sa__x9p7.js} +1 -1
  186. package/dist/ui/assets/{wc-detached-Cy1E6He4.js → wc-detached-CPdghqGy.js} +1 -1
  187. package/dist/ui/assets/wc-extension-SThl8caQ.js +2 -0
  188. package/dist/ui/assets/{wc-follower-C1kJ0lF_.js → wc-follower-Cmzs84GP.js} +3 -3
  189. package/dist/ui/assets/{wc-follower-oauth-qqfI5zJ5.js → wc-follower-oauth-DX7RG-Kl.js} +1 -1
  190. package/dist/ui/assets/{wc-gelatiere-DFV5mBJW.js → wc-gelatiere--3PZ6Mfa.js} +1 -1
  191. package/dist/ui/assets/{wc-live-Eu6ghZAo.js → wc-live-BlapG4SS.js} +6 -6
  192. package/dist/ui/assets/{wc-nav-BJ1Fg_hB.js → wc-nav-CtkuJ8N6.js} +2 -2
  193. package/dist/ui/assets/{wc-onboarding-D_k6jMGA.js → wc-onboarding-XUm_2nZf.js} +2 -2
  194. package/dist/ui/assets/{wc-permissions-CbwZeya-.js → wc-permissions-Pta5fUjE.js} +2 -2
  195. package/dist/ui/assets/{wc-placeholder-DzHKpyEK.js → wc-placeholder-BjmsbtDa.js} +3 -3
  196. package/dist/ui/assets/{wc-secret-request-bOcP6m9U.js → wc-secret-request-BVJr77Ma.js} +1 -1
  197. package/dist/ui/assets/{wc-settings-BNekAbpv.js → wc-settings-BUlEG77Z.js} +3 -3
  198. package/dist/ui/assets/{wc-shell-DdE40qZj.js → wc-shell-CCAUdRpx.js} +4 -4
  199. package/dist/ui/assets/{wc-shortcut-config-KdvTJp27.js → wc-shortcut-config-rZ7pYd8h.js} +1 -1
  200. package/dist/ui/assets/{wc-sprinkles-Bnnb88mU.js → wc-sprinkles-Df0eVb-L.js} +2 -2
  201. package/dist/ui/assets/{wc-transcript-export-DWOEgP2-.js → wc-transcript-export-UHghgiHV.js} +2 -2
  202. package/dist/ui/assets/{wc-tray-Dpx-EoMd.js → wc-tray-DX21EMkl.js} +4 -4
  203. package/dist/ui/assets/welcome-detection-yaonDq_Y.js +1 -0
  204. package/dist/ui/assets/{whisper-session-CB6rG-eD.js → whisper-session-D1SFA8ZE.js} +2 -2
  205. package/dist/ui/assets/{xai-grok-BGPDFi9z.js → xai-grok-CJFs6bVN.js} +1 -1
  206. package/dist/ui/assets/{xai-grok-CuIlQYpM.js → xai-grok-gk0kuKSE.js} +1 -1
  207. package/dist/ui/index.html +10 -10
  208. package/dist/ui/packages/webapp/index.html +10 -10
  209. package/package.json +1 -1
  210. package/dist/ui/assets/SKILL-lcwLWMKp.js +0 -1
  211. package/dist/ui/assets/__vite-browser-external-Do0Euzvr.js +0 -1
  212. package/dist/ui/assets/fetch-body-1l9I58Vk.js +0 -1
  213. package/dist/ui/assets/ffmpeg-wasm-B5jofhIa.js +0 -1
  214. package/dist/ui/assets/installer-DR7izkMG.js +0 -2
  215. package/dist/ui/assets/jsh-executor-DOTwZy5W.js +0 -18
  216. package/dist/ui/assets/main-tEtVPbXh.js +0 -22
  217. package/dist/ui/assets/panel-rpc-handlers-B9LenTR0.js +0 -2
  218. package/dist/ui/assets/provider-store-access-BbvRUwZT.js +0 -1
  219. package/dist/ui/assets/provider-store-access-CrrW9eCi.js +0 -1
  220. package/dist/ui/assets/proxied-fetch-DXaTHROw.js +0 -1
  221. package/dist/ui/assets/proxied-fetch-DiXk_XGs.js +0 -2
  222. package/dist/ui/assets/py-realm-worker-Dd5csRhS.js +0 -259
  223. package/dist/ui/assets/pyodide-CrWMp4az.js +0 -3
  224. package/dist/ui/assets/resolver-BjX48SSL.js +0 -4
  225. package/dist/ui/assets/rest-ops-DKsDUOxE.js +0 -1
  226. package/dist/ui/assets/run-Y1uUJvV7.js +0 -14
  227. package/dist/ui/assets/secret-topology-CZv6A9HW.js +0 -1
  228. package/dist/ui/assets/shared-BDXQKitm.js +0 -1
  229. package/dist/ui/assets/shared-Crk4gYF8.js +0 -1
  230. package/dist/ui/assets/slicc-version-jRBuHQmT.js +0 -1
  231. package/dist/ui/assets/tray-leader-oK24Tenu.js +0 -1
  232. package/dist/ui/assets/wc-extension-CVhWXV2w.js +0 -2
  233. package/dist/ui/assets/welcome-detection-BdEfH_d7.js +0 -1
@@ -21,6 +21,7 @@ export * from './loopback.js';
21
21
  export * from './oauth-extra-domains-storage.js';
22
22
  export * from './preview-url.js';
23
23
  export * from './proxy-headers.js';
24
+ export * from './raw-fetch-protocol.js';
24
25
  export * from './runtime-env.js';
25
26
  export * from './secret-env-schema.js';
26
27
  export * from './secret-masking.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,kCAAkC,CAAC;AACjD,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,k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,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
@@ -22,6 +22,7 @@ export * from './loopback.js';
22
22
  export * from './oauth-extra-domains-storage.js';
23
23
  export * from './preview-url.js';
24
24
  export * from './proxy-headers.js';
25
+ export * from './raw-fetch-protocol.js';
25
26
  export * from './runtime-env.js';
26
27
  export * from './secret-env-schema.js';
27
28
  export * from './secret-masking.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iFAAiF;AAEjF,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,kCAAkC,CAAC;AACjD,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAA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,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,241 @@
1
+ /**
2
+ * Raw-mode fetch-proxy contract (#3571). The default proxied fetch behaves like
3
+ * a browser (follows redirects, folds Set-Cookie into an out-of-band header,
4
+ * buffers bodies). Raw mode behaves like an HTTP client, so the wasm realm's
5
+ * HTTP proxy can hand each response to curl or git as the origin sent it:
6
+ *
7
+ * - redirects are NOT followed; the 3xx, `Location` and `Set-Cookie` reach
8
+ * the caller;
9
+ * - headers travel as an ordered name/value list, so every `Set-Cookie`
10
+ * stays a separate entry;
11
+ * - the body is always delivered DECODED: `Content-Encoding` is removed
12
+ * whenever a coding was undone, and `Content-Length` survives only when
13
+ * it still counts the delivered bytes (see {@link rawResponseHeaders});
14
+ * - the body streams, and nothing is read from the float's hop until the
15
+ * caller asks. Chrome's own `fetch` still reads a response off the
16
+ * network ahead of the reader (measured on Chrome 146: 400 MiB drained
17
+ * while a page held one chunk), so the upstream itself is not throttled.
18
+ *
19
+ * Every float speaks this contract; each one frames it for its own hop. The
20
+ * CLI/cloud node-server route reads the request head from
21
+ * {@link RAW_FETCH_REQUEST_HEADER} and answers `200` with
22
+ * {@link RAW_FETCH_CONTENT_TYPE}, whose body is one response-head frame
23
+ * ({@link encodeRawResponseFrame}) followed by the upstream body bytes.
24
+ */
25
+ /** Ordered header list. Names keep their case; repeats stay separate. */
26
+ export type RawHeaderList = Array<[string, string]>;
27
+ /** What the caller wants sent upstream. */
28
+ export interface RawFetchRequestHead {
29
+ url: string;
30
+ method: string;
31
+ headers: RawHeaderList;
32
+ }
33
+ /** What the upstream answered, before the body. */
34
+ export interface RawFetchResponseHead {
35
+ status: number;
36
+ statusText: string;
37
+ headers: RawHeaderList;
38
+ /** The URL that answered; with manual redirects always the request URL. */
39
+ url: string;
40
+ }
41
+ /**
42
+ * Request header carrying the JSON {@link RawFetchRequestHead} on the
43
+ * node-server hop. The hop itself is always `POST` so neither the method nor
44
+ * the caller's headers are subject to the browser's forbidden-name filter.
45
+ * Its presence (instead of `X-Target-URL`) is what selects raw mode, so a
46
+ * bridge that predates raw mode answers 400 rather than sending the request
47
+ * the default way.
48
+ */
49
+ export declare const RAW_FETCH_REQUEST_HEADER = "X-Slicc-Raw-Request";
50
+ /**
51
+ * Capability probe on the node-server hop: a `POST /api/fetch-proxy` carrying
52
+ * only this header (no `X-Target-URL`, no request head). A bridge with raw
53
+ * mode answers `200` JSON {@link RawFetchProbeReply}; one without it answers
54
+ * 400 (node-server before raw mode, swift-server) or 404 (no bridge at all),
55
+ * and nothing is fetched upstream either way.
56
+ */
57
+ export declare const RAW_FETCH_PROBE_HEADER = "X-Slicc-Raw-Probe";
58
+ /** Raw-mode protocol revision a bridge reports in its probe reply. */
59
+ export declare const RAW_FETCH_PROTOCOL_VERSION = 1;
60
+ /** What a raw-capable bridge reports about itself. */
61
+ export interface RawFetchProbeReply {
62
+ rawFetch: number;
63
+ requestBodyStreaming: boolean;
64
+ maxRequestBodyBytes: number;
65
+ }
66
+ /** Validate a probe reply; `null` when it is not one. */
67
+ export declare function parseRawFetchProbeReply(value: unknown): RawFetchProbeReply | null;
68
+ /** Content type of a raw-mode answer on the node-server hop. */
69
+ export declare const RAW_FETCH_CONTENT_TYPE = "application/vnd.slicc.raw-fetch";
70
+ /**
71
+ * Request-body ceiling on the node-server hop (CLI and cloud). This hop
72
+ * buffers the upload on both ends for now; past this size the bridge answers
73
+ * 413 and the webapp refuses before sending.
74
+ */
75
+ export declare const RAW_FETCH_BRIDGE_REQUEST_BODY_CAP: number;
76
+ /** Upper bound on one encoded response-head frame. */
77
+ export declare const RAW_FETCH_MAX_HEAD_BYTES: number;
78
+ /** Content codings Node's fetch (undici) decodes on its own: the bridge floats. */
79
+ export declare const NODE_DECODED_CODINGS: ReadonlySet<string>;
80
+ /**
81
+ * Content codings Chrome's fetch decodes on its own: the extension float.
82
+ * Chrome advertises `zstd` itself and cannot be told otherwise.
83
+ */
84
+ export declare const BROWSER_DECODED_CODINGS: ReadonlySet<string>;
85
+ /** `Accept-Encoding` a float sends upstream: exactly the codings it decodes. */
86
+ export declare const RAW_FETCH_ACCEPT_ENCODING = "gzip, deflate, br";
87
+ /**
88
+ * The `Accept-Encoding` a float sets for a request with these (folded,
89
+ * lowercase) headers, or `undefined` to set none. A ranged request (`Range`,
90
+ * `If-Range`) must not offer a compressed coding: a 206 over a compressed
91
+ * representation carries `Content-Range` offsets into the compressed bytes,
92
+ * which no longer describe the body once the float decodes it, so a resumed
93
+ * or ranged download would assemble corrupt data. With no `Accept-Encoding`
94
+ * set, `fetch` itself sends `identity` for a request carrying `Range` (Fetch
95
+ * standard, HTTP-network-or-cache fetch), in Node and in Chrome alike.
96
+ */
97
+ export declare function rawAcceptEncoding(headers: Record<string, string>): string | undefined;
98
+ /**
99
+ * Whether a partial response came back with a coding the float undid
100
+ * (an origin that ignored `Accept-Encoding: identity`). Its `Content-Range`
101
+ * counts encoded bytes the caller never sees, so the float must refuse it
102
+ * rather than deliver it.
103
+ */
104
+ export declare function isDecodedPartialResponse(input: {
105
+ status: number;
106
+ headers: RawHeaderList;
107
+ /** Codings the float's fetch undid; defaults to {@link NODE_DECODED_CODINGS}. */
108
+ decodedCodings?: ReadonlySet<string>;
109
+ }): boolean;
110
+ /** Drop hop-by-hop and float-owned request headers, keeping order. */
111
+ export declare function stripRawRequestHeaders(headers: RawHeaderList): RawHeaderList;
112
+ /**
113
+ * Fold a raw list into the name → value record `fetch` sends. Repeats join
114
+ * with `, ` (RFC 9110 §5.3), except `Cookie`, which joins with `; `. No float
115
+ * can put two lines with one name on the wire: `fetch` folds them the same way.
116
+ */
117
+ export declare function foldRawRequestHeaders(headers: RawHeaderList): Record<string, string>;
118
+ export interface RawResponseHeaderInput {
119
+ method: string;
120
+ status: number;
121
+ headers: RawHeaderList;
122
+ /**
123
+ * The float may rewrite the body (secret scrub, gunzip sniff), so the
124
+ * upstream `Content-Length` would no longer count the delivered bytes.
125
+ */
126
+ bodyRewritten: boolean;
127
+ /** Codings the float's fetch undid; defaults to {@link NODE_DECODED_CODINGS}. */
128
+ decodedCodings?: ReadonlySet<string>;
129
+ }
130
+ /** Whether a response to `method` with `status` carries a body at all. */
131
+ export declare function rawResponseHasBody(method: string, status: number): boolean;
132
+ /**
133
+ * The head a raw caller sees. Hop-by-hop headers go, and so do the fields
134
+ * the response's `Connection` header names (RFC 9110 §7.6.1). A bodiless response
135
+ * (HEAD, 1xx/204/205/304) keeps `Content-Encoding` and `Content-Length` as
136
+ * sent, since they describe the representation, not bytes on this hop.
137
+ * Otherwise a decoded coding drops both headers, and `Content-Length` also
138
+ * goes when the float rewrote the body. An unknown coding stays with its
139
+ * encoded bytes.
140
+ */
141
+ export declare function rawResponseHeaders(input: RawResponseHeaderInput): RawHeaderList;
142
+ /**
143
+ * JSON for {@link RAW_FETCH_REQUEST_HEADER}. Non-ASCII is `\u`-escaped so the
144
+ * value is a valid header ByteString whatever the caller's headers hold.
145
+ */
146
+ export declare function encodeRawRequestHead(head: RawFetchRequestHead): string;
147
+ /** Parse a {@link RAW_FETCH_REQUEST_HEADER} value; `null` when malformed. */
148
+ export declare function decodeRawRequestHead(value: string): RawFetchRequestHead | null;
149
+ /** One response-head frame: a big-endian u32 length, then UTF-8 JSON. */
150
+ export declare function encodeRawResponseFrame(head: RawFetchResponseHead): Uint8Array;
151
+ /**
152
+ * Split a response-head frame off the front of `buffer`. Returns `null` while
153
+ * the frame is still incomplete, and throws when it is malformed or larger
154
+ * than {@link RAW_FETCH_MAX_HEAD_BYTES}.
155
+ */
156
+ export declare function decodeRawResponseFrame(buffer: Uint8Array): {
157
+ head: RawFetchResponseHead;
158
+ rest: Uint8Array;
159
+ } | null;
160
+ /**
161
+ * Why a raw fetch failed without an upstream HTTP response. The accompanying
162
+ * status is the one a proxy should answer its own client with.
163
+ */
164
+ export type RawFetchErrorCode =
165
+ /** The float has no raw mode (a bridge that predates it, or swift-server). */
166
+ 'unsupported'
167
+ /** The request body is past the float's ceiling. */
168
+ | 'request-body-too-large'
169
+ /** A masked secret was used against a domain it is not scoped to. */
170
+ | 'forbidden-secret'
171
+ /** The upstream could not be reached, or the stream broke. */
172
+ | 'upstream'
173
+ /** The float's own transport answered with something raw mode cannot read. */
174
+ | 'bridge';
175
+ /** URL-fragment prefix that tags one raw request for `webRequest` correlation. */
176
+ export declare const RAW_FETCH_TAG_PREFIX = "slicc-raw-";
177
+ /** Largest body chunk one Port message carries. */
178
+ export declare const RAW_FETCH_PORT_CHUNK_BYTES: number;
179
+ /** Chunks a receiver grants up front, in each direction. */
180
+ export declare const RAW_FETCH_PORT_WINDOW = 4;
181
+ /**
182
+ * Uploads a float buffers before sending. Past it the answer is 413. The
183
+ * extension streams large non-text bodies instead (see
184
+ * `RAW_FETCH_STREAM_THRESHOLD_BYTES`), so there the ceiling bounds only the
185
+ * bodies it must hold whole: text bodies (secret unmask) and HMAC-signed ones.
186
+ */
187
+ export declare const RAW_FETCH_BUFFERED_REQUEST_BODY_CAP: number;
188
+ /** Non-text uploads at least this large (or of unknown length) are streamed. */
189
+ export declare const RAW_FETCH_STREAM_THRESHOLD_BYTES: number;
190
+ /** Page → service worker. */
191
+ export type RawPortRequestMsg =
192
+ /**
193
+ * Capability probe, answered with `raw-probe-reply`. A service worker
194
+ * that predates raw mode ignores it, so the page treats silence as
195
+ * unsupported rather than sending a `raw-request` nobody will answer.
196
+ */
197
+ {
198
+ type: 'raw-probe';
199
+ } | {
200
+ type: 'raw-request';
201
+ head: RawFetchRequestHead;
202
+ /** Whether `raw-body-chunk`s follow, ended by `raw-body-end`. */
203
+ hasBody: boolean;
204
+ /** Upload size when the caller knows it. */
205
+ bodyLength?: number;
206
+ /** Response chunks the page grants up front. */
207
+ credits: number;
208
+ } | {
209
+ type: 'raw-body-chunk';
210
+ dataBase64: string;
211
+ } | {
212
+ type: 'raw-body-end';
213
+ } | {
214
+ type: 'raw-credit';
215
+ chunks: number;
216
+ };
217
+ /** Service worker → page. */
218
+ export type RawPortResponseMsg = {
219
+ type: 'raw-probe-reply';
220
+ reply: RawFetchProbeReply;
221
+ } | {
222
+ type: 'raw-body-credit';
223
+ chunks: number;
224
+ } | {
225
+ type: 'raw-response-head';
226
+ head: RawFetchResponseHead;
227
+ hasBody: boolean;
228
+ } | {
229
+ type: 'raw-response-chunk';
230
+ dataBase64: string;
231
+ } | {
232
+ type: 'raw-response-end';
233
+ } | {
234
+ type: 'raw-response-error';
235
+ code: RawFetchErrorCode;
236
+ status: number;
237
+ error: string;
238
+ };
239
+ /** `HTTP/1.1 302 Found` → `Found`; HTTP/2 status lines carry no reason. */
240
+ export declare function reasonFromStatusLine(statusLine: string | undefined): string;
241
+ //# sourceMappingURL=raw-fetch-protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raw-fetch-protocol.d.ts","sourceRoot":"","sources":["../src/raw-fetch-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,yEAAyE;AACzE,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAEpD,2CAA2C;AAC3C,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,mDAAmD;AACnD,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,aAAa,CAAC;IACvB,2EAA2E;IAC3E,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AAE9D;;;;;;GAMG;AACH,eAAO,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E"}
@@ -0,0 +1,336 @@
1
+ /**
2
+ * Raw-mode fetch-proxy contract (#3571). The default proxied fetch behaves like
3
+ * a browser (follows redirects, folds Set-Cookie into an out-of-band header,
4
+ * buffers bodies). Raw mode behaves like an HTTP client, so the wasm realm's
5
+ * HTTP proxy can hand each response to curl or git as the origin sent it:
6
+ *
7
+ * - redirects are NOT followed; the 3xx, `Location` and `Set-Cookie` reach
8
+ * the caller;
9
+ * - headers travel as an ordered name/value list, so every `Set-Cookie`
10
+ * stays a separate entry;
11
+ * - the body is always delivered DECODED: `Content-Encoding` is removed
12
+ * whenever a coding was undone, and `Content-Length` survives only when
13
+ * it still counts the delivered bytes (see {@link rawResponseHeaders});
14
+ * - the body streams, and nothing is read from the float's hop until the
15
+ * caller asks. Chrome's own `fetch` still reads a response off the
16
+ * network ahead of the reader (measured on Chrome 146: 400 MiB drained
17
+ * while a page held one chunk), so the upstream itself is not throttled.
18
+ *
19
+ * Every float speaks this contract; each one frames it for its own hop. The
20
+ * CLI/cloud node-server route reads the request head from
21
+ * {@link RAW_FETCH_REQUEST_HEADER} and answers `200` with
22
+ * {@link RAW_FETCH_CONTENT_TYPE}, whose body is one response-head frame
23
+ * ({@link encodeRawResponseFrame}) followed by the upstream body bytes.
24
+ */
25
+ /**
26
+ * Request header carrying the JSON {@link RawFetchRequestHead} on the
27
+ * node-server hop. The hop itself is always `POST` so neither the method nor
28
+ * the caller's headers are subject to the browser's forbidden-name filter.
29
+ * Its presence (instead of `X-Target-URL`) is what selects raw mode, so a
30
+ * bridge that predates raw mode answers 400 rather than sending the request
31
+ * the default way.
32
+ */
33
+ export const RAW_FETCH_REQUEST_HEADER = 'X-Slicc-Raw-Request';
34
+ /**
35
+ * Capability probe on the node-server hop: a `POST /api/fetch-proxy` carrying
36
+ * only this header (no `X-Target-URL`, no request head). A bridge with raw
37
+ * mode answers `200` JSON {@link RawFetchProbeReply}; one without it answers
38
+ * 400 (node-server before raw mode, swift-server) or 404 (no bridge at all),
39
+ * and nothing is fetched upstream either way.
40
+ */
41
+ export const RAW_FETCH_PROBE_HEADER = 'X-Slicc-Raw-Probe';
42
+ /** Raw-mode protocol revision a bridge reports in its probe reply. */
43
+ export const RAW_FETCH_PROTOCOL_VERSION = 1;
44
+ /** Validate a probe reply; `null` when it is not one. */
45
+ export function parseRawFetchProbeReply(value) {
46
+ if (!value || typeof value !== 'object')
47
+ return null;
48
+ const reply = value;
49
+ if (typeof reply.rawFetch !== 'number' || reply.rawFetch < 1)
50
+ return null;
51
+ if (typeof reply.requestBodyStreaming !== 'boolean')
52
+ return null;
53
+ if (typeof reply.maxRequestBodyBytes !== 'number')
54
+ return null;
55
+ return {
56
+ rawFetch: reply.rawFetch,
57
+ requestBodyStreaming: reply.requestBodyStreaming,
58
+ maxRequestBodyBytes: reply.maxRequestBodyBytes,
59
+ };
60
+ }
61
+ /** Content type of a raw-mode answer on the node-server hop. */
62
+ export const RAW_FETCH_CONTENT_TYPE = 'application/vnd.slicc.raw-fetch';
63
+ /**
64
+ * Request-body ceiling on the node-server hop (CLI and cloud). This hop
65
+ * buffers the upload on both ends for now; past this size the bridge answers
66
+ * 413 and the webapp refuses before sending.
67
+ */
68
+ export const RAW_FETCH_BRIDGE_REQUEST_BODY_CAP = 256 * 1024 * 1024;
69
+ /** Upper bound on one encoded response-head frame. */
70
+ export const RAW_FETCH_MAX_HEAD_BYTES = 1024 * 1024;
71
+ /**
72
+ * Hop-by-hop request headers (RFC 9110 §7.6.1) plus the ones the forwarding
73
+ * fetch owns: `host` and `content-length` are derived from the URL and body,
74
+ * `accept-encoding` is chosen by the float so it can decode what it asked for,
75
+ * and `expect` is answered by the realm proxy, not the origin.
76
+ */
77
+ const RAW_REQUEST_SKIP_HEADERS = new Set([
78
+ 'connection',
79
+ 'keep-alive',
80
+ 'proxy-connection',
81
+ 'te',
82
+ 'trailer',
83
+ 'transfer-encoding',
84
+ 'upgrade',
85
+ 'host',
86
+ 'content-length',
87
+ 'accept-encoding',
88
+ 'expect',
89
+ ]);
90
+ /** Hop-by-hop response headers; never part of the delivered head. */
91
+ const RAW_RESPONSE_SKIP_HEADERS = new Set([
92
+ 'connection',
93
+ 'keep-alive',
94
+ 'proxy-connection',
95
+ 'te',
96
+ 'trailer',
97
+ 'transfer-encoding',
98
+ 'upgrade',
99
+ ]);
100
+ /** Content codings Node's fetch (undici) decodes on its own: the bridge floats. */
101
+ export const NODE_DECODED_CODINGS = new Set([
102
+ 'gzip',
103
+ 'x-gzip',
104
+ 'deflate',
105
+ 'br',
106
+ ]);
107
+ /**
108
+ * Content codings Chrome's fetch decodes on its own: the extension float.
109
+ * Chrome advertises `zstd` itself and cannot be told otherwise.
110
+ */
111
+ export const BROWSER_DECODED_CODINGS = new Set([
112
+ ...NODE_DECODED_CODINGS,
113
+ 'zstd',
114
+ ]);
115
+ /** `Accept-Encoding` a float sends upstream: exactly the codings it decodes. */
116
+ export const RAW_FETCH_ACCEPT_ENCODING = 'gzip, deflate, br';
117
+ /**
118
+ * The `Accept-Encoding` a float sets for a request with these (folded,
119
+ * lowercase) headers, or `undefined` to set none. A ranged request (`Range`,
120
+ * `If-Range`) must not offer a compressed coding: a 206 over a compressed
121
+ * representation carries `Content-Range` offsets into the compressed bytes,
122
+ * which no longer describe the body once the float decodes it, so a resumed
123
+ * or ranged download would assemble corrupt data. With no `Accept-Encoding`
124
+ * set, `fetch` itself sends `identity` for a request carrying `Range` (Fetch
125
+ * standard, HTTP-network-or-cache fetch), in Node and in Chrome alike.
126
+ */
127
+ export function rawAcceptEncoding(headers) {
128
+ return headers.range !== undefined || headers['if-range'] !== undefined
129
+ ? undefined
130
+ : RAW_FETCH_ACCEPT_ENCODING;
131
+ }
132
+ /**
133
+ * Whether a partial response came back with a coding the float undid
134
+ * (an origin that ignored `Accept-Encoding: identity`). Its `Content-Range`
135
+ * counts encoded bytes the caller never sees, so the float must refuse it
136
+ * rather than deliver it.
137
+ */
138
+ export function isDecodedPartialResponse(input) {
139
+ if (input.status !== 206)
140
+ return false;
141
+ const encoding = input.headers
142
+ .filter(([name]) => name.toLowerCase() === 'content-encoding')
143
+ .map(([, value]) => value)
144
+ .join(',');
145
+ return codingsWereDecoded(encoding, input.decodedCodings ?? NODE_DECODED_CODINGS);
146
+ }
147
+ /** Statuses whose responses never carry a body. */
148
+ const NULL_BODY_STATUSES = new Set([101, 103, 204, 205, 304]);
149
+ function isHeaderPair(value) {
150
+ return (Array.isArray(value) &&
151
+ value.length === 2 &&
152
+ typeof value[0] === 'string' &&
153
+ typeof value[1] === 'string');
154
+ }
155
+ /** Tokens a `Connection` header names, lowercased. */
156
+ function connectionTokens(headers) {
157
+ const tokens = new Set();
158
+ for (const [name, value] of headers) {
159
+ if (name.toLowerCase() !== 'connection')
160
+ continue;
161
+ for (const token of value.split(',')) {
162
+ const trimmed = token.trim().toLowerCase();
163
+ if (trimmed)
164
+ tokens.add(trimmed);
165
+ }
166
+ }
167
+ return tokens;
168
+ }
169
+ /** Drop hop-by-hop and float-owned request headers, keeping order. */
170
+ export function stripRawRequestHeaders(headers) {
171
+ const named = connectionTokens(headers);
172
+ return headers.filter(([name]) => {
173
+ const lower = name.toLowerCase();
174
+ return !RAW_REQUEST_SKIP_HEADERS.has(lower) && !named.has(lower);
175
+ });
176
+ }
177
+ /**
178
+ * Fold a raw list into the name → value record `fetch` sends. Repeats join
179
+ * with `, ` (RFC 9110 §5.3), except `Cookie`, which joins with `; `. No float
180
+ * can put two lines with one name on the wire: `fetch` folds them the same way.
181
+ */
182
+ export function foldRawRequestHeaders(headers) {
183
+ const out = {};
184
+ for (const [name, value] of headers) {
185
+ const lower = name.toLowerCase();
186
+ const prior = out[lower];
187
+ if (prior === undefined)
188
+ out[lower] = value;
189
+ else
190
+ out[lower] = `${prior}${lower === 'cookie' ? '; ' : ', '}${value}`;
191
+ }
192
+ return out;
193
+ }
194
+ /** True when every listed coding is one the float's fetch undid. */
195
+ function codingsWereDecoded(contentEncoding, decodedCodings) {
196
+ const codings = contentEncoding
197
+ .split(',')
198
+ .map((c) => c.trim().toLowerCase())
199
+ .filter((c) => c !== '' && c !== 'identity');
200
+ return codings.length > 0 && codings.every((c) => decodedCodings.has(c));
201
+ }
202
+ /** Whether a response to `method` with `status` carries a body at all. */
203
+ export function rawResponseHasBody(method, status) {
204
+ return method.toUpperCase() !== 'HEAD' && !NULL_BODY_STATUSES.has(status);
205
+ }
206
+ /**
207
+ * The head a raw caller sees. Hop-by-hop headers go, and so do the fields
208
+ * the response's `Connection` header names (RFC 9110 §7.6.1). A bodiless response
209
+ * (HEAD, 1xx/204/205/304) keeps `Content-Encoding` and `Content-Length` as
210
+ * sent, since they describe the representation, not bytes on this hop.
211
+ * Otherwise a decoded coding drops both headers, and `Content-Length` also
212
+ * goes when the float rewrote the body. An unknown coding stays with its
213
+ * encoded bytes.
214
+ */
215
+ export function rawResponseHeaders(input) {
216
+ const named = connectionTokens(input.headers);
217
+ const withoutHop = input.headers.filter(([name]) => {
218
+ const lower = name.toLowerCase();
219
+ return !RAW_RESPONSE_SKIP_HEADERS.has(lower) && !named.has(lower);
220
+ });
221
+ if (!rawResponseHasBody(input.method, input.status))
222
+ return withoutHop;
223
+ const encoding = withoutHop
224
+ .filter(([name]) => name.toLowerCase() === 'content-encoding')
225
+ .map(([, value]) => value)
226
+ .join(',');
227
+ const decoded = codingsWereDecoded(encoding, input.decodedCodings ?? NODE_DECODED_CODINGS);
228
+ const dropLength = decoded || input.bodyRewritten;
229
+ return withoutHop.filter(([name]) => {
230
+ const lower = name.toLowerCase();
231
+ if (lower === 'content-length')
232
+ return !dropLength;
233
+ if (lower === 'content-encoding')
234
+ return !decoded && encoding.trim().toLowerCase() !== 'identity';
235
+ return true;
236
+ });
237
+ }
238
+ /**
239
+ * JSON for {@link RAW_FETCH_REQUEST_HEADER}. Non-ASCII is `\u`-escaped so the
240
+ * value is a valid header ByteString whatever the caller's headers hold.
241
+ */
242
+ export function encodeRawRequestHead(head) {
243
+ return JSON.stringify(head).replace(/[\u007f-￿]/g, (c) => `\\u${c.charCodeAt(0).toString(16).padStart(4, '0')}`);
244
+ }
245
+ /** Parse a {@link RAW_FETCH_REQUEST_HEADER} value; `null` when malformed. */
246
+ export function decodeRawRequestHead(value) {
247
+ let parsed;
248
+ try {
249
+ parsed = JSON.parse(value);
250
+ }
251
+ catch {
252
+ return null;
253
+ }
254
+ if (!parsed || typeof parsed !== 'object')
255
+ return null;
256
+ const { url, method, headers } = parsed;
257
+ if (typeof url !== 'string' ||
258
+ typeof method !== 'string' ||
259
+ !/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/.test(method)) {
260
+ return null;
261
+ }
262
+ if (!Array.isArray(headers) || !headers.every(isHeaderPair))
263
+ return null;
264
+ return { url, method, headers };
265
+ }
266
+ /** One response-head frame: a big-endian u32 length, then UTF-8 JSON. */
267
+ export function encodeRawResponseFrame(head) {
268
+ const json = new TextEncoder().encode(JSON.stringify(head));
269
+ const frame = new Uint8Array(4 + json.byteLength);
270
+ new DataView(frame.buffer).setUint32(0, json.byteLength);
271
+ frame.set(json, 4);
272
+ return frame;
273
+ }
274
+ function isRawResponseHead(value) {
275
+ if (!value || typeof value !== 'object')
276
+ return false;
277
+ const head = value;
278
+ return (typeof head.status === 'number' &&
279
+ typeof head.statusText === 'string' &&
280
+ typeof head.url === 'string' &&
281
+ Array.isArray(head.headers) &&
282
+ head.headers.every(isHeaderPair));
283
+ }
284
+ /**
285
+ * Split a response-head frame off the front of `buffer`. Returns `null` while
286
+ * the frame is still incomplete, and throws when it is malformed or larger
287
+ * than {@link RAW_FETCH_MAX_HEAD_BYTES}.
288
+ */
289
+ export function decodeRawResponseFrame(buffer) {
290
+ if (buffer.byteLength < 4)
291
+ return null;
292
+ const length = new DataView(buffer.buffer, buffer.byteOffset, 4).getUint32(0);
293
+ if (length > RAW_FETCH_MAX_HEAD_BYTES) {
294
+ throw new Error(`raw fetch: response head of ${length} bytes exceeds the limit`);
295
+ }
296
+ if (buffer.byteLength < 4 + length)
297
+ return null;
298
+ let head;
299
+ try {
300
+ head = JSON.parse(new TextDecoder().decode(buffer.subarray(4, 4 + length)));
301
+ }
302
+ catch {
303
+ throw new Error('raw fetch: malformed response head');
304
+ }
305
+ if (!isRawResponseHead(head))
306
+ throw new Error('raw fetch: malformed response head');
307
+ return { head, rest: buffer.subarray(4 + length) };
308
+ }
309
+ // ── Extension Port leg ─────────────────────────────────────────────────
310
+ //
311
+ // On the extension float the page talks to the service worker over the
312
+ // pinned `fetch-proxy.fetch` Port; raw mode rides it with the messages
313
+ // below. Port messages are JSON, so bytes travel as base64, and the Port
314
+ // has no backpressure of its own, so each direction is credit-based: a
315
+ // sender may have at most as many chunks outstanding as the receiver granted.
316
+ /** URL-fragment prefix that tags one raw request for `webRequest` correlation. */
317
+ export const RAW_FETCH_TAG_PREFIX = 'slicc-raw-';
318
+ /** Largest body chunk one Port message carries. */
319
+ export const RAW_FETCH_PORT_CHUNK_BYTES = 256 * 1024;
320
+ /** Chunks a receiver grants up front, in each direction. */
321
+ export const RAW_FETCH_PORT_WINDOW = 4;
322
+ /**
323
+ * Uploads a float buffers before sending. Past it the answer is 413. The
324
+ * extension streams large non-text bodies instead (see
325
+ * `RAW_FETCH_STREAM_THRESHOLD_BYTES`), so there the ceiling bounds only the
326
+ * bodies it must hold whole: text bodies (secret unmask) and HMAC-signed ones.
327
+ */
328
+ export const RAW_FETCH_BUFFERED_REQUEST_BODY_CAP = 256 * 1024 * 1024;
329
+ /** Non-text uploads at least this large (or of unknown length) are streamed. */
330
+ export const RAW_FETCH_STREAM_THRESHOLD_BYTES = 8 * 1024 * 1024;
331
+ /** `HTTP/1.1 302 Found` → `Found`; HTTP/2 status lines carry no reason. */
332
+ export function reasonFromStatusLine(statusLine) {
333
+ const match = /^HTTP\/\S+\s+\d{3}\s*(.*)$/.exec(statusLine ?? '');
334
+ return match?.[1]?.trim() ?? '';
335
+ }
336
+ //# sourceMappingURL=raw-fetch-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raw-fetch-protocol.js","sourceRoot":"","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,IAAI,EAAE,CAAC;AAClC,CAAC"}
@@ -68,11 +68,13 @@ export declare const FETCH_PROXY_BASE_EXPOSE_HEADERS: readonly string[];
68
68
  */
69
69
  export declare function buildFetchProxyExposeHeaders(forwardedHeaderNames: Iterable<string>): string;
70
70
  /**
71
- * Which requests the global `express.json()` consumes. Two exclusions:
71
+ * Which requests the global `express.json()` consumes. Three exclusions:
72
72
  *
73
73
  * - `X-Slicc-Raw-Body: 1` — SigV4-signed bodies must reach the
74
74
  * /api/fetch-proxy handler byte-for-byte (the parser would re-serialize
75
75
  * them via JSON.stringify and break the signature);
76
+ * - `X-Slicc-Raw-Request` — raw-mode fetch-proxy uploads, read as a
77
+ * bounded byte stream by `routes/fetch-proxy-raw.ts`;
76
78
  * - the stable hostfs dispatcher — it owns a bounded 1 MiB parser and an
77
79
  * errno error adapter, and this parser is mounted ahead of
78
80
  * `registerHostFsRoutes`, so without the exclusion it would consume the