squidclaw 3.0.14 → 3.0.16

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 (304) hide show
  1. package/dist/{accounts-BsypiWiC.js → accounts-BznLC9dH.js} +2 -2
  2. package/dist/{accounts-CojLB8gu.js → accounts-Ci60lQsY.js} +17 -17
  3. package/dist/{accounts-CBMZbUu2.js → accounts-Dw4ivpQU.js} +2 -2
  4. package/dist/{active-listener-eLf5VQ_4.js → active-listener-B5jww01z.js} +2 -2
  5. package/dist/{api-key-rotation-R0EeTSGR.js → api-key-rotation-C1EZFUSy.js} +2 -2
  6. package/dist/{audio-preflight-C2dLsMCR.js → audio-preflight-CG6H_U7W.js} +32 -32
  7. package/dist/{audio-transcription-runner-B7Q9WPbH.js → audio-transcription-runner-D0H4ucWV.js} +12 -12
  8. package/dist/{audit-membership-runtime-w23FnNAN.js → audit-membership-runtime-DyLj-uhz.js} +4 -4
  9. package/dist/build-info.json +3 -3
  10. package/dist/bundled/boot-md/handler.js +51 -51
  11. package/dist/bundled/bootstrap-extra-files/handler.js +6 -6
  12. package/dist/bundled/command-logger/handler.js +2 -2
  13. package/dist/bundled/session-memory/handler.js +51 -51
  14. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  15. package/dist/{channel-activity-B-tyheVe.js → channel-activity-CUT8qw0W.js} +3 -3
  16. package/dist/{chrome-3982B8u4.js → chrome-53mklS3F.js} +18 -18
  17. package/dist/{command-registry-CquAbyqR.js → command-registry-D-zYyZpc.js} +4 -4
  18. package/dist/{commands-registry-i6O3l1QI.js → commands-registry-DmH3aIGN.js} +4 -4
  19. package/dist/{completion-cli-8PdK97J-.js → completion-cli-ClRcwvgc.js} +1 -1
  20. package/dist/{completion-cli-CIM6cyBy.js → completion-cli-DhTAfX_O.js} +2 -2
  21. package/dist/{deliver-BLMHHSPm.js → deliver-DBhlEXOh.js} +21 -21
  22. package/dist/deliver-runtime-BpVWeU13.js +36 -0
  23. package/dist/deps-send-discord.runtime-CL6FlfRz.js +26 -0
  24. package/dist/deps-send-imessage.runtime-DP56C3XB.js +25 -0
  25. package/dist/deps-send-signal.runtime-4WUnsfj1.js +24 -0
  26. package/dist/deps-send-slack.runtime-BM_8OV-V.js +22 -0
  27. package/dist/deps-send-telegram.runtime-CL27zxrX.js +27 -0
  28. package/dist/deps-send-whatsapp.runtime-B0xMiMJX.js +60 -0
  29. package/dist/{diagnostic-CFkF5G3N.js → diagnostic-C2LLQE3X.js} +2 -2
  30. package/dist/{doctor-completion-DWWBwulC.js → doctor-completion-CvbhXcBA.js} +1 -1
  31. package/dist/{doctor-completion-CGmYWy0n.js → doctor-completion-DTHBtueI.js} +1 -1
  32. package/dist/entry.js +2 -2
  33. package/dist/{plugin-sdk/errors-B8oJXuCF.js → errors-kkRuS2Cs.js} +1 -1
  34. package/dist/{fetch-38Yx06gt.js → fetch-CxBkawdM.js} +5 -5
  35. package/dist/{fetch-guard-D4vl4ujr.js → fetch-guard-fb71kZZ8.js} +2 -2
  36. package/dist/{frontmatter-CjKtFduT.js → frontmatter-Cq1TcIQ2.js} +3 -3
  37. package/dist/{fs-safe-CwHbZdFH.js → fs-safe-BoB4X3GD.js} +4 -4
  38. package/dist/{gateway-cli-9UpCzUUR.js → gateway-cli-5rUG2fBn.js} +1 -1
  39. package/dist/{gateway-cli-CUph5Eqo.js → gateway-cli-CF1kp5f9.js} +1 -1
  40. package/dist/{github-copilot-token-Cw3tAXM9.js → github-copilot-token-B5cPlwaz.js} +7 -7
  41. package/dist/{image-UWdNg3AV.js → image-C5cdH_Hn.js} +6 -6
  42. package/dist/{image-ops-MgyUqvIc.js → image-ops-BSjD6uEb.js} +2 -2
  43. package/dist/image-runtime-B1jzvCV9.js +29 -0
  44. package/dist/index.js +1 -1
  45. package/dist/{ir-KtKnWVYv.js → ir-DM4doOj9.js} +8 -8
  46. package/dist/{legacy-names-B0wgIP0Q.js → legacy-names-aGJJuzM_.js} +1 -1
  47. package/dist/llm-slug-generator.js +51 -51
  48. package/dist/{logger-oGKcCLZ5.js → logger-CnTSBL7T.js} +7 -7
  49. package/dist/{login-BJ7RjzPV.js → login--L7xmR80.js} +5 -5
  50. package/dist/{login-qr-C2dv3VjF.js → login-qr-StQBwOgw.js} +10 -10
  51. package/dist/{manager-Cz8NNpPk.js → manager-B5htbo-7.js} +13 -13
  52. package/dist/manager-runtime-CbCJ9KL0.js +18 -0
  53. package/dist/{model-selection-2Xl7Zx-s.js → model-selection-BfuTT3Ie.js} +43 -43
  54. package/dist/{onboard-DLJ_9fJU.js → onboard-BVgRwIeK.js} +1 -1
  55. package/dist/{onboard-aISMp4Kt.js → onboard-Vq9LkQon.js} +1 -1
  56. package/dist/{onboarding-Bl4RDn6W.js → onboarding-BW7AN6GP.js} +1 -1
  57. package/dist/{onboarding-YgRfODPk.js → onboarding-DO1ScRD8.js} +1 -1
  58. package/dist/{onboarding.finalize-Bm7_INHb.js → onboarding.finalize-DyoNGKAv.js} +11 -3
  59. package/dist/{onboarding.finalize-DQcrecUs.js → onboarding.finalize-mpPeXAsn.js} +12 -4
  60. package/dist/{outbound-CZO5ZCAG.js → outbound-Dp8B-7n3.js} +6 -6
  61. package/dist/{outbound-attachment-BBtJNyuW.js → outbound-attachment-BSZq7jTZ.js} +2 -2
  62. package/dist/{path-alias-guards-Cpsiv2KL.js → path-alias-guards-DORgbZ1w.js} +1 -1
  63. package/dist/{paths-CSdAWKDO.js → paths-DA5srn0U.js} +5 -5
  64. package/dist/{paths-CXClY8zC.js → paths-DSd911Oe.js} +4 -4
  65. package/dist/{pi-embedded-DgpQEVa1.js → pi-embedded-CrAWjHKR.js} +162 -162
  66. package/dist/{pi-embedded-helpers-CkCvcpdc.js → pi-embedded-helpers-DM4KAgn-.js} +52 -52
  67. package/dist/{pi-model-discovery-CHdwOZiV.js → pi-model-discovery-DE0XZt9x.js} +7 -7
  68. package/dist/pi-model-discovery-runtime-B5s0PRpY.js +11 -0
  69. package/dist/{pi-tools.before-tool-call.runtime-BlLvl0eL.js → pi-tools.before-tool-call.runtime-DfLoi4qR.js} +9 -9
  70. package/dist/plugin-sdk/{accounts-BW7b9aIf.js → accounts-C9RGqL4T.js} +3 -3
  71. package/dist/plugin-sdk/{accounts-tAi-tfAf.js → accounts-CgiUq3Un.js} +2 -2
  72. package/dist/plugin-sdk/{accounts-De05T3_J.js → accounts-DcDj_weC.js} +2 -2
  73. package/dist/plugin-sdk/{active-listener-DZCohPuZ.js → active-listener-BlJ5RUzB.js} +2 -2
  74. package/dist/plugin-sdk/{api-key-rotation-CrX0fvDj.js → api-key-rotation-Z-Qny376.js} +2 -2
  75. package/dist/plugin-sdk/{audio-preflight-BgPpaXum.js → audio-preflight-DXuewfE7.js} +26 -26
  76. package/dist/plugin-sdk/{audio-transcription-runner-CO4tyQtQ.js → audio-transcription-runner-DSNzBBSH.js} +11 -11
  77. package/dist/plugin-sdk/{audit-membership-runtime-Xl20kCBe.js → audit-membership-runtime-DHQDvH4u.js} +2 -2
  78. package/dist/plugin-sdk/{channel-activity-QlTyjswN.js → channel-activity-D1afTUj8.js} +3 -3
  79. package/dist/plugin-sdk/{channel-web-NzpRnn9f.js → channel-web-IPKOTqU3.js} +18 -18
  80. package/dist/plugin-sdk/{chrome-CVbDHFaE.js → chrome-B1q83rKv.js} +6 -6
  81. package/dist/plugin-sdk/{commands-registry-DSWbTWB2.js → commands-registry-DzySrtKG.js} +4 -4
  82. package/dist/plugin-sdk/{common-BpvaubXW.js → common-D8IL0ajZ.js} +2 -2
  83. package/dist/plugin-sdk/{config-DE6ibnmU.js → config-B5u_IldI.js} +7 -7
  84. package/dist/plugin-sdk/{deliver-86fU1nUC.js → deliver-S0Nnmc4b.js} +10 -10
  85. package/dist/plugin-sdk/deliver-runtime-tAQPm44B.js +32 -0
  86. package/dist/plugin-sdk/deps-send-discord.runtime-DeuyKcxA.js +23 -0
  87. package/dist/plugin-sdk/deps-send-imessage.runtime-D9NRm877.js +22 -0
  88. package/dist/plugin-sdk/deps-send-signal.runtime-DBepwGd9.js +21 -0
  89. package/dist/plugin-sdk/deps-send-slack.runtime-CUWnNsmH.js +19 -0
  90. package/dist/plugin-sdk/deps-send-telegram.runtime-CRI0ptpU.js +24 -0
  91. package/dist/plugin-sdk/deps-send-whatsapp.runtime-CypkchYB.js +57 -0
  92. package/dist/plugin-sdk/{diagnostic-DwTd77di.js → diagnostic-CMOeaeBe.js} +2 -2
  93. package/dist/plugin-sdk/discord.js +6 -6
  94. package/dist/{errors-DfgAh2Ml.js → plugin-sdk/errors-9oVz7reJ.js} +1 -1
  95. package/dist/plugin-sdk/{fetch-guard-dmZ4U9uQ.js → fetch-guard-C_jkJc0N.js} +2 -2
  96. package/dist/plugin-sdk/{fs-safe-DqCO1D4C.js → fs-safe-DFbwq9CS.js} +3 -3
  97. package/dist/plugin-sdk/{image-UG930mNm.js → image-C-YH4Uik.js} +6 -6
  98. package/dist/plugin-sdk/{image-ops-D9cweu_-.js → image-ops-57ipHrBF.js} +2 -2
  99. package/dist/plugin-sdk/image-runtime-BzP3HfiE.js +25 -0
  100. package/dist/plugin-sdk/imessage.js +2 -2
  101. package/dist/plugin-sdk/index.js +50 -50
  102. package/dist/plugin-sdk/{ir-pigw84ir.js → ir-CYDBM_JC.js} +7 -7
  103. package/dist/plugin-sdk/{local-roots-CIhD7Co-.js → local-roots-BfR7HxIa.js} +4 -4
  104. package/dist/plugin-sdk/{logger-DIb2cGHp.js → logger-Bg4vIUJn.js} +2 -2
  105. package/dist/plugin-sdk/{login-DN33Ry8p.js → login-BhBKfrcu.js} +4 -4
  106. package/dist/plugin-sdk/{login-qr-DXZPiiDq.js → login-qr-pZv8YA21.js} +5 -5
  107. package/dist/plugin-sdk/{manager-cBbgCrQ7.js → manager-CNL-O6jb.js} +8 -8
  108. package/dist/plugin-sdk/manager-runtime-B87hYNyb.js +15 -0
  109. package/dist/plugin-sdk/{outbound-attachment-C4f-OcC0.js → outbound-attachment-rsxzcJYF.js} +2 -2
  110. package/dist/plugin-sdk/{outbound-ux3UTEA3.js → outbound-icMF_rUc.js} +5 -5
  111. package/dist/plugin-sdk/{path-alias-guards-TnxupPQC.js → path-alias-guards-DA0MhfkG.js} +1 -1
  112. package/dist/plugin-sdk/{paths-B7_75Pdr.js → paths-CP67O8eN.js} +1 -1
  113. package/dist/plugin-sdk/{pi-embedded-helpers-CBAsAxOB.js → pi-embedded-helpers-8ieRSf-l.js} +16 -16
  114. package/dist/plugin-sdk/{pi-model-discovery-hrhgLkQy.js → pi-model-discovery-DSSANt82.js} +1 -1
  115. package/dist/plugin-sdk/pi-model-discovery-runtime-C2t2kU5s.js +8 -0
  116. package/dist/plugin-sdk/{pi-tools.before-tool-call.runtime-EL-r4x87.js → pi-tools.before-tool-call.runtime-ChLGyK0j.js} +4 -4
  117. package/dist/plugin-sdk/{plugins-NKOOkt_i.js → plugins-BLeJXdd2.js} +4 -4
  118. package/dist/plugin-sdk/{proxy-env-DooJ7AbC.js → proxy-env-CtPm4saU.js} +1 -1
  119. package/dist/plugin-sdk/{proxy-fetch-ZPEvp58f.js → proxy-fetch-Cf3IUSDw.js} +1 -1
  120. package/dist/plugin-sdk/{pw-ai-jALO1jBq.js → pw-ai-CtZSk4at.js} +9 -9
  121. package/dist/plugin-sdk/{qmd-manager-Bei6TaFq.js → qmd-manager-Ov9ElEfG.js} +7 -7
  122. package/dist/plugin-sdk/{query-expansion-POz2za8a.js → query-expansion-CzjwW461.js} +4 -4
  123. package/dist/plugin-sdk/{redact-9WsNyb7S.js → redact-DfACyt0X.js} +1 -1
  124. package/dist/plugin-sdk/{reply-sihF_R23.js → reply-Bl5GGHri.js} +73 -73
  125. package/dist/plugin-sdk/{resolve-outbound-target-qXRaNZi8.js → resolve-outbound-target-D-0B2aK8.js} +2 -2
  126. package/dist/plugin-sdk/{run-with-concurrency-DmTrN5JG.js → run-with-concurrency-kVooFCVo.js} +1 -1
  127. package/dist/plugin-sdk/runtime-whatsapp-login.runtime-B6MdStWm.js +10 -0
  128. package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-DexVGpkn.js +19 -0
  129. package/dist/plugin-sdk/{send-jou-S7lc.js → send-BKQRdkHg.js} +5 -5
  130. package/dist/plugin-sdk/{send-aWQBb6ca.js → send-BkAfzZYd.js} +8 -8
  131. package/dist/plugin-sdk/{send-BMv-WOpW.js → send-C7C3x6hg.js} +7 -7
  132. package/dist/plugin-sdk/{send-Cm6HGK-a.js → send-CGlHhdoZ.js} +6 -6
  133. package/dist/plugin-sdk/{send-DZB0Hlej.js → send-YldTY40c.js} +13 -13
  134. package/dist/plugin-sdk/{session-C98G_V4e.js → session-uS6b35hg.js} +3 -3
  135. package/dist/plugin-sdk/signal.js +2 -2
  136. package/dist/plugin-sdk/{skill-commands-_K2_qYb4.js → skill-commands-c9HTevk5.js} +4 -4
  137. package/dist/plugin-sdk/{skills-D58hSyfJ.js → skills-OK3LublS.js} +6 -6
  138. package/dist/plugin-sdk/slash-commands.runtime-JFUaFK3N.js +13 -0
  139. package/dist/plugin-sdk/slash-dispatch.runtime-BP81ZOIp.js +52 -0
  140. package/dist/plugin-sdk/slash-skill-commands.runtime-KVmn_84j.js +16 -0
  141. package/dist/plugin-sdk/{store-CHxyy2Nq.js → store-BkxOV4wy.js} +2 -2
  142. package/dist/plugin-sdk/subagent-registry-runtime-DZHhsl5N.js +52 -0
  143. package/dist/plugin-sdk/{tables-D2Q-dmPT.js → tables-8_ELoE8R.js} +1 -1
  144. package/dist/plugin-sdk/{thinking-0lRH3Rcl.js → thinking-TLm688bb.js} +7 -7
  145. package/dist/plugin-sdk/{tokens-CTIYTLWu.js → tokens-DAL_5WHL.js} +1 -1
  146. package/dist/plugin-sdk/{tool-images-K2kMTUHK.js → tool-images-CbObuT48.js} +2 -2
  147. package/dist/plugin-sdk/web-DIhuSOD-.js +56 -0
  148. package/dist/plugin-sdk/{whatsapp-actions-DnEN6SNn.js → whatsapp-actions-DVZ223y_.js} +17 -17
  149. package/dist/plugin-sdk/whatsapp.js +50 -50
  150. package/dist/{plugins--Y8ggxrk.js → plugins-Db8j13y8.js} +11 -11
  151. package/dist/{program-BpSOl_1X.js → program-BJO_oaKF.js} +2 -2
  152. package/dist/{program-context-tphS7xu7.js → program-context-CWsWlM9-.js} +6 -6
  153. package/dist/{prompt-select-styled-DL2p1pfi.js → prompt-select-styled-CnWGIwST.js} +1 -1
  154. package/dist/{prompt-select-styled-CqnrivgC.js → prompt-select-styled-R6Iau0zv.js} +1 -1
  155. package/dist/{proxy-env-BAlmOqn_.js → proxy-env-bjBQWAZU.js} +1 -1
  156. package/dist/{plugin-sdk/proxy-fetch-Dt5BedH8.js → proxy-fetch-lH6RsRTE.js} +1 -1
  157. package/dist/{pw-ai-Ci7uZGTd.js → pw-ai-BMx3rnIH.js} +14 -14
  158. package/dist/{qmd-manager-CO-shcLU.js → qmd-manager-BN0siR2Z.js} +10 -10
  159. package/dist/{query-expansion-DlQOkf-g.js → query-expansion-Dzxt6kXo.js} +6 -6
  160. package/dist/{redact-NmPEVjIo.js → redact-DvzicBMu.js} +1 -1
  161. package/dist/{register.maintenance-BUWUvg1o.js → register.maintenance-C0WLFNcv.js} +5 -5
  162. package/dist/{register.maintenance-CMAt3Nl8.js → register.maintenance-c4CZQhHy.js} +4 -4
  163. package/dist/{register.onboard-CbiTdKQX.js → register.onboard-B8LXDCnA.js} +2 -2
  164. package/dist/{register.onboard-1KrFhKgA.js → register.onboard-C8-hGp4-.js} +2 -2
  165. package/dist/{register.setup-KhsHMx2v.js → register.setup-Bw1pnWbM.js} +2 -2
  166. package/dist/{register.setup-Ct7W5KHu.js → register.setup-DiUpJRvj.js} +2 -2
  167. package/dist/{register.subclis-Z1fJCSxh.js → register.subclis-BbFUfhdj.js} +3 -3
  168. package/dist/{run-main-DDsH3MYf.js → run-main-Exefhxet.js} +3 -3
  169. package/dist/{run-with-concurrency-FczpX8ng.js → run-with-concurrency-BFR3ReeF.js} +4 -4
  170. package/dist/runtime-whatsapp-login.runtime-DTnWO4dr.js +13 -0
  171. package/dist/runtime-whatsapp-outbound.runtime-XzfTCc36.js +22 -0
  172. package/dist/{send-BYlxWwez.js → send-0EU-Y3Gn.js} +5 -5
  173. package/dist/{send-Jg_3nT2E.js → send-B92swUj4.js} +26 -26
  174. package/dist/{send-Je58aHGD.js → send-By-oi8SV.js} +6 -6
  175. package/dist/{send-CqgPl09X.js → send-C2v8GsVK.js} +7 -7
  176. package/dist/{send-D2tGdo2t.js → send-CKtUdJpX.js} +8 -8
  177. package/dist/{session-DC1-0Js7.js → session-CZ24KNcj.js} +8 -8
  178. package/dist/{skill-commands-BaKuTMGP.js → skill-commands-BRoRvs2q.js} +9 -9
  179. package/dist/{skills-BeJSK5PY.js → skills-OLKf_9cW.js} +22 -22
  180. package/dist/slash-commands.runtime-jY_-vStu.js +16 -0
  181. package/dist/slash-dispatch.runtime-BxaEpG30.js +56 -0
  182. package/dist/slash-skill-commands.runtime-B6vRGL-p.js +20 -0
  183. package/dist/{store-Ky_egzlA.js → store-Mz6VjFuy.js} +2 -2
  184. package/dist/subagent-registry-runtime-BNE1FIwQ.js +56 -0
  185. package/dist/{subsystem-BaLYRf7D.js → subsystem-6v7sWnAD.js} +14 -14
  186. package/dist/{tables-BlsVH8H4.js → tables-0InE37AN.js} +1 -1
  187. package/dist/{plugin-sdk/target-errors-BVBW25Y3.js → target-errors-B37sVq3w.js} +2 -2
  188. package/dist/{thinking-D9F_aLRB.js → thinking-D4AaB24F.js} +7 -7
  189. package/dist/{tokens-D2XhLqIz.js → tokens-DfbMVF9y.js} +1 -1
  190. package/dist/{tool-images-C2WK6W0J.js → tool-images-Dpl5RgN7.js} +2 -2
  191. package/dist/{update-cli-gLKrP8UQ.js → update-cli-CeMQxSs2.js} +4 -4
  192. package/dist/{update-cli-Fe17E_Xm.js → update-cli-esFXuN7Z.js} +5 -5
  193. package/dist/{web-D4FdtS8P.js → web-gFh8coIz.js} +55 -55
  194. package/dist/{whatsapp-actions-aF5qDSh_.js → whatsapp-actions-B-LXYZ6Z.js} +21 -21
  195. package/dist/{workspace-TqfVSQuO.js → workspace-kVMIaBrV.js} +20 -20
  196. package/package.json +1 -1
  197. package/dist/deliver-runtime-BSg7XU_9.js +0 -36
  198. package/dist/deps-send-discord.runtime-DpEvkdzn.js +0 -26
  199. package/dist/deps-send-imessage.runtime-etYmfsQ1.js +0 -25
  200. package/dist/deps-send-signal.runtime-4HiuvLY4.js +0 -24
  201. package/dist/deps-send-slack.runtime-Y5M5BNt7.js +0 -22
  202. package/dist/deps-send-telegram.runtime-CQ6XgUqx.js +0 -27
  203. package/dist/deps-send-whatsapp.runtime-B1XdeiW1.js +0 -60
  204. package/dist/image-runtime-3Z60UCGO.js +0 -29
  205. package/dist/manager-runtime-By-gmgqz.js +0 -18
  206. package/dist/pi-model-discovery-runtime-DiznhLrZ.js +0 -11
  207. package/dist/plugin-sdk/accounts-B6gye1Jd.js +0 -46
  208. package/dist/plugin-sdk/accounts-C-BT6Po7.js +0 -288
  209. package/dist/plugin-sdk/accounts-DQDXV8eB.js +0 -35
  210. package/dist/plugin-sdk/active-listener-CirjQdCm.js +0 -50
  211. package/dist/plugin-sdk/api-key-rotation-CCoQ5SD_.js +0 -181
  212. package/dist/plugin-sdk/audio-preflight-xnWAFqH-.js +0 -69
  213. package/dist/plugin-sdk/audio-transcription-runner-BDmtq7-q.js +0 -2176
  214. package/dist/plugin-sdk/audit-membership-runtime-B9b-zRwg.js +0 -58
  215. package/dist/plugin-sdk/channel-activity-JjLRpUa_.js +0 -94
  216. package/dist/plugin-sdk/channel-web-DNWsxhYh.js +0 -2256
  217. package/dist/plugin-sdk/chrome-B5PWOUbr.js +0 -2415
  218. package/dist/plugin-sdk/commands-registry-BKeyJUxK.js +0 -1125
  219. package/dist/plugin-sdk/config-FhBFLsNm.js +0 -17911
  220. package/dist/plugin-sdk/deliver-DEbTlzFy.js +0 -1694
  221. package/dist/plugin-sdk/deliver-runtime-BJHbLq-S.js +0 -32
  222. package/dist/plugin-sdk/deliver-runtime-CO2uP-r9.js +0 -32
  223. package/dist/plugin-sdk/deps-send-discord.runtime-CDRnV2G9.js +0 -23
  224. package/dist/plugin-sdk/deps-send-discord.runtime-DIPW0tR4.js +0 -23
  225. package/dist/plugin-sdk/deps-send-imessage.runtime-B6kLsqc2.js +0 -22
  226. package/dist/plugin-sdk/deps-send-imessage.runtime-ByGjRa1H.js +0 -22
  227. package/dist/plugin-sdk/deps-send-signal.runtime-BSQh0bHr.js +0 -21
  228. package/dist/plugin-sdk/deps-send-signal.runtime-Ca1awu4L.js +0 -21
  229. package/dist/plugin-sdk/deps-send-slack.runtime-BFom-0ng.js +0 -19
  230. package/dist/plugin-sdk/deps-send-slack.runtime-CRzWCVkC.js +0 -19
  231. package/dist/plugin-sdk/deps-send-telegram.runtime-BWyavKp9.js +0 -24
  232. package/dist/plugin-sdk/deps-send-telegram.runtime-CpTtZ6JM.js +0 -24
  233. package/dist/plugin-sdk/deps-send-whatsapp.runtime-C0XcOgX1.js +0 -57
  234. package/dist/plugin-sdk/deps-send-whatsapp.runtime-cC_XvHV8.js +0 -57
  235. package/dist/plugin-sdk/diagnostic-Dv9S12vm.js +0 -319
  236. package/dist/plugin-sdk/errors-CgRPdp3o.js +0 -54
  237. package/dist/plugin-sdk/fetch-guard-W_A4uSz2.js +0 -156
  238. package/dist/plugin-sdk/fs-safe-Dqmpk-Fr.js +0 -352
  239. package/dist/plugin-sdk/image-BSFy8d1M.js +0 -2310
  240. package/dist/plugin-sdk/image-ops-DN17S88I.js +0 -584
  241. package/dist/plugin-sdk/image-runtime-5YO31sjU.js +0 -25
  242. package/dist/plugin-sdk/image-runtime-Bu3DSIBB.js +0 -25
  243. package/dist/plugin-sdk/ir-JaPZ0yKH.js +0 -1296
  244. package/dist/plugin-sdk/local-roots-BTW3ifco.js +0 -186
  245. package/dist/plugin-sdk/logger-DDdrdbDu.js +0 -1163
  246. package/dist/plugin-sdk/login-BXGRny-S.js +0 -57
  247. package/dist/plugin-sdk/login-qr-DTs92ap8.js +0 -320
  248. package/dist/plugin-sdk/manager-DzFj9oHX.js +0 -3917
  249. package/dist/plugin-sdk/manager-runtime-Dbz_bpiL.js +0 -15
  250. package/dist/plugin-sdk/manager-runtime-DrpyZvO0.js +0 -15
  251. package/dist/plugin-sdk/outbound-CQ7uBBML.js +0 -212
  252. package/dist/plugin-sdk/outbound-attachment-dTE6EVdX.js +0 -19
  253. package/dist/plugin-sdk/path-alias-guards-gBhrAn14.js +0 -43
  254. package/dist/plugin-sdk/paths-C6W4VHoa.js +0 -166
  255. package/dist/plugin-sdk/pi-embedded-helpers-CfzQPXDC.js +0 -9627
  256. package/dist/plugin-sdk/pi-model-discovery-Bt6B0MAj.js +0 -134
  257. package/dist/plugin-sdk/pi-model-discovery-runtime-BcgXpTmL.js +0 -8
  258. package/dist/plugin-sdk/pi-model-discovery-runtime-SPHihgeR.js +0 -8
  259. package/dist/plugin-sdk/pi-tools.before-tool-call.runtime-DYJQxhuo.js +0 -354
  260. package/dist/plugin-sdk/plugins-6NxPd6TS.js +0 -864
  261. package/dist/plugin-sdk/pw-ai-BFK39pwE.js +0 -1938
  262. package/dist/plugin-sdk/qmd-manager-6bozlfFg.js +0 -1448
  263. package/dist/plugin-sdk/query-expansion-eeVz_aEm.js +0 -1011
  264. package/dist/plugin-sdk/redact-BoNEjbpF.js +0 -319
  265. package/dist/plugin-sdk/reply-DgcrQBKL.js +0 -98828
  266. package/dist/plugin-sdk/resolve-outbound-target-CbaJ-kc2.js +0 -40
  267. package/dist/plugin-sdk/run-with-concurrency-5DMu9szx.js +0 -1994
  268. package/dist/plugin-sdk/runtime-whatsapp-login.runtime-DMNRnMAJ.js +0 -10
  269. package/dist/plugin-sdk/runtime-whatsapp-login.runtime-jkgyeVsN.js +0 -10
  270. package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-DdLJJ1YC.js +0 -19
  271. package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-w9rCES1O.js +0 -19
  272. package/dist/plugin-sdk/send-BSoMbeqA.js +0 -3135
  273. package/dist/plugin-sdk/send-Byyfc20_.js +0 -503
  274. package/dist/plugin-sdk/send-CI-xWEs7.js +0 -2587
  275. package/dist/plugin-sdk/send-DzP9EJqK.js +0 -540
  276. package/dist/plugin-sdk/send-MlSZ82sA.js +0 -414
  277. package/dist/plugin-sdk/session-DFy97tfW.js +0 -169
  278. package/dist/plugin-sdk/skill-commands-yum46YuA.js +0 -342
  279. package/dist/plugin-sdk/skills-DUphJGKn.js +0 -1428
  280. package/dist/plugin-sdk/slash-commands.runtime-5UW5KLyR.js +0 -13
  281. package/dist/plugin-sdk/slash-commands.runtime-CyZybvM0.js +0 -13
  282. package/dist/plugin-sdk/slash-dispatch.runtime-4oQ2P_qo.js +0 -52
  283. package/dist/plugin-sdk/slash-dispatch.runtime-DGI2ovR2.js +0 -52
  284. package/dist/plugin-sdk/slash-skill-commands.runtime-Cb1PFrG4.js +0 -16
  285. package/dist/plugin-sdk/slash-skill-commands.runtime-y_mOLyS7.js +0 -16
  286. package/dist/plugin-sdk/ssrf-B3XRWBsP.js +0 -202
  287. package/dist/plugin-sdk/store-DFvIhzWZ.js +0 -81
  288. package/dist/plugin-sdk/subagent-registry-runtime-DtKXhKtl.js +0 -52
  289. package/dist/plugin-sdk/subagent-registry-runtime-TxOQ-aoU.js +0 -52
  290. package/dist/plugin-sdk/tables-bDM_jlLP.js +0 -55
  291. package/dist/plugin-sdk/thinking-Bu-w5mW5.js +0 -1206
  292. package/dist/plugin-sdk/tokens-CLE20fRI.js +0 -52
  293. package/dist/plugin-sdk/tool-images-D0G_giwP.js +0 -274
  294. package/dist/plugin-sdk/web-DSXk7XCb.js +0 -56
  295. package/dist/plugin-sdk/web-wfXoGaeS.js +0 -56
  296. package/dist/plugin-sdk/whatsapp-actions-BOyA0Uuj.js +0 -80
  297. package/dist/proxy-fetch-C2v-Utgg.js +0 -38
  298. package/dist/runtime-whatsapp-login.runtime-nLoztrHq.js +0 -13
  299. package/dist/runtime-whatsapp-outbound.runtime-ipj7KEHf.js +0 -22
  300. package/dist/slash-commands.runtime-SPLrdY5U.js +0 -16
  301. package/dist/slash-dispatch.runtime-BXF9mgkV.js +0 -56
  302. package/dist/slash-skill-commands.runtime-DbWF-siU.js +0 -20
  303. package/dist/subagent-registry-runtime-CqsLRf4P.js +0 -56
  304. package/dist/target-errors-CiNyvgLy.js +0 -195
@@ -1,584 +0,0 @@
1
- import { O as runExec } from "./run-with-concurrency-5DMu9szx.js";
2
- import { Ct as normalizeChatChannelId, _t as CHANNEL_IDS, wt as getActivePluginRegistry } from "./config-FhBFLsNm.js";
3
- import path from "node:path";
4
- import os from "node:os";
5
- import fs from "node:fs/promises";
6
- import { fileTypeFromBuffer } from "file-type";
7
-
8
- //#region src/gateway/protocol/client-info.ts
9
- const GATEWAY_CLIENT_IDS = {
10
- WEBCHAT_UI: "webchat-ui",
11
- CONTROL_UI: "squidclaw-control-ui",
12
- WEBCHAT: "webchat",
13
- CLI: "cli",
14
- GATEWAY_CLIENT: "gateway-client",
15
- MACOS_APP: "squidclaw-macos",
16
- IOS_APP: "squidclaw-ios",
17
- ANDROID_APP: "squidclaw-android",
18
- NODE_HOST: "node-host",
19
- TEST: "test",
20
- FINGERPRINT: "fingerprint",
21
- PROBE: "squidclaw-probe"
22
- };
23
- const GATEWAY_CLIENT_NAMES = GATEWAY_CLIENT_IDS;
24
- const GATEWAY_CLIENT_MODES = {
25
- WEBCHAT: "webchat",
26
- CLI: "cli",
27
- UI: "ui",
28
- BACKEND: "backend",
29
- NODE: "node",
30
- PROBE: "probe",
31
- TEST: "test"
32
- };
33
- const GATEWAY_CLIENT_ID_SET = new Set(Object.values(GATEWAY_CLIENT_IDS));
34
- const GATEWAY_CLIENT_MODE_SET = new Set(Object.values(GATEWAY_CLIENT_MODES));
35
-
36
- //#endregion
37
- //#region src/utils/message-channel.ts
38
- const INTERNAL_MESSAGE_CHANNEL = "webchat";
39
- const MARKDOWN_CAPABLE_CHANNELS = new Set([
40
- "slack",
41
- "telegram",
42
- "signal",
43
- "discord",
44
- "googlechat",
45
- "tui",
46
- INTERNAL_MESSAGE_CHANNEL
47
- ]);
48
- function isInternalMessageChannel(raw) {
49
- return normalizeMessageChannel(raw) === INTERNAL_MESSAGE_CHANNEL;
50
- }
51
- function normalizeMessageChannel(raw) {
52
- const normalized = raw?.trim().toLowerCase();
53
- if (!normalized) return;
54
- if (normalized === INTERNAL_MESSAGE_CHANNEL) return INTERNAL_MESSAGE_CHANNEL;
55
- const builtIn = normalizeChatChannelId(normalized);
56
- if (builtIn) return builtIn;
57
- return (getActivePluginRegistry()?.channels.find((entry) => {
58
- if (entry.plugin.id.toLowerCase() === normalized) return true;
59
- return (entry.plugin.meta.aliases ?? []).some((alias) => alias.trim().toLowerCase() === normalized);
60
- }))?.plugin.id ?? normalized;
61
- }
62
- const listPluginChannelIds = () => {
63
- const registry = getActivePluginRegistry();
64
- if (!registry) return [];
65
- return registry.channels.map((entry) => entry.plugin.id);
66
- };
67
- const listDeliverableMessageChannels = () => Array.from(new Set([...CHANNEL_IDS, ...listPluginChannelIds()]));
68
- const listGatewayMessageChannels = () => [...listDeliverableMessageChannels(), INTERNAL_MESSAGE_CHANNEL];
69
- function isGatewayMessageChannel(value) {
70
- return listGatewayMessageChannels().includes(value);
71
- }
72
- function isDeliverableMessageChannel(value) {
73
- return listDeliverableMessageChannels().includes(value);
74
- }
75
- function resolveGatewayMessageChannel(raw) {
76
- const normalized = normalizeMessageChannel(raw);
77
- if (!normalized) return;
78
- return isGatewayMessageChannel(normalized) ? normalized : void 0;
79
- }
80
- function resolveMessageChannel(primary, fallback) {
81
- return normalizeMessageChannel(primary) ?? normalizeMessageChannel(fallback);
82
- }
83
- function isMarkdownCapableMessageChannel(raw) {
84
- const channel = normalizeMessageChannel(raw);
85
- if (!channel) return false;
86
- return MARKDOWN_CAPABLE_CHANNELS.has(channel);
87
- }
88
-
89
- //#endregion
90
- //#region src/media/constants.ts
91
- const MAX_IMAGE_BYTES = 6 * 1024 * 1024;
92
- const MAX_AUDIO_BYTES = 16 * 1024 * 1024;
93
- const MAX_VIDEO_BYTES = 16 * 1024 * 1024;
94
- const MAX_DOCUMENT_BYTES = 100 * 1024 * 1024;
95
- function mediaKindFromMime(mime) {
96
- if (!mime) return "unknown";
97
- if (mime.startsWith("image/")) return "image";
98
- if (mime.startsWith("audio/")) return "audio";
99
- if (mime.startsWith("video/")) return "video";
100
- if (mime === "application/pdf") return "document";
101
- if (mime.startsWith("text/")) return "document";
102
- if (mime.startsWith("application/")) return "document";
103
- return "unknown";
104
- }
105
- function maxBytesForKind(kind) {
106
- switch (kind) {
107
- case "image": return MAX_IMAGE_BYTES;
108
- case "audio": return MAX_AUDIO_BYTES;
109
- case "video": return MAX_VIDEO_BYTES;
110
- case "document": return MAX_DOCUMENT_BYTES;
111
- default: return MAX_DOCUMENT_BYTES;
112
- }
113
- }
114
-
115
- //#endregion
116
- //#region src/media/mime.ts
117
- const EXT_BY_MIME = {
118
- "image/heic": ".heic",
119
- "image/heif": ".heif",
120
- "image/jpeg": ".jpg",
121
- "image/png": ".png",
122
- "image/webp": ".webp",
123
- "image/gif": ".gif",
124
- "audio/ogg": ".ogg",
125
- "audio/mpeg": ".mp3",
126
- "audio/x-m4a": ".m4a",
127
- "audio/mp4": ".m4a",
128
- "video/mp4": ".mp4",
129
- "video/quicktime": ".mov",
130
- "application/pdf": ".pdf",
131
- "application/json": ".json",
132
- "application/zip": ".zip",
133
- "application/gzip": ".gz",
134
- "application/x-tar": ".tar",
135
- "application/x-7z-compressed": ".7z",
136
- "application/vnd.rar": ".rar",
137
- "application/msword": ".doc",
138
- "application/vnd.ms-excel": ".xls",
139
- "application/vnd.ms-powerpoint": ".ppt",
140
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ".docx",
141
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ".xlsx",
142
- "application/vnd.openxmlformats-officedocument.presentationml.presentation": ".pptx",
143
- "text/csv": ".csv",
144
- "text/plain": ".txt",
145
- "text/markdown": ".md"
146
- };
147
- const MIME_BY_EXT = {
148
- ...Object.fromEntries(Object.entries(EXT_BY_MIME).map(([mime, ext]) => [ext, mime])),
149
- ".jpeg": "image/jpeg",
150
- ".js": "text/javascript"
151
- };
152
- const AUDIO_FILE_EXTENSIONS = new Set([
153
- ".aac",
154
- ".caf",
155
- ".flac",
156
- ".m4a",
157
- ".mp3",
158
- ".oga",
159
- ".ogg",
160
- ".opus",
161
- ".wav"
162
- ]);
163
- function normalizeMimeType(mime) {
164
- if (!mime) return;
165
- return mime.split(";")[0]?.trim().toLowerCase() || void 0;
166
- }
167
- async function sniffMime(buffer) {
168
- if (!buffer) return;
169
- try {
170
- return (await fileTypeFromBuffer(buffer))?.mime ?? void 0;
171
- } catch {
172
- return;
173
- }
174
- }
175
- function getFileExtension(filePath) {
176
- if (!filePath) return;
177
- try {
178
- if (/^https?:\/\//i.test(filePath)) {
179
- const url = new URL(filePath);
180
- return path.extname(url.pathname).toLowerCase() || void 0;
181
- }
182
- } catch {}
183
- return path.extname(filePath).toLowerCase() || void 0;
184
- }
185
- function isAudioFileName(fileName) {
186
- const ext = getFileExtension(fileName);
187
- if (!ext) return false;
188
- return AUDIO_FILE_EXTENSIONS.has(ext);
189
- }
190
- function detectMime(opts) {
191
- return detectMimeImpl(opts);
192
- }
193
- function isGenericMime(mime) {
194
- if (!mime) return true;
195
- const m = mime.toLowerCase();
196
- return m === "application/octet-stream" || m === "application/zip";
197
- }
198
- async function detectMimeImpl(opts) {
199
- const ext = getFileExtension(opts.filePath);
200
- const extMime = ext ? MIME_BY_EXT[ext] : void 0;
201
- const headerMime = normalizeMimeType(opts.headerMime);
202
- const sniffed = await sniffMime(opts.buffer);
203
- if (sniffed && (!isGenericMime(sniffed) || !extMime)) return sniffed;
204
- if (extMime) return extMime;
205
- if (headerMime && !isGenericMime(headerMime)) return headerMime;
206
- if (sniffed) return sniffed;
207
- if (headerMime) return headerMime;
208
- }
209
- function extensionForMime(mime) {
210
- const normalized = normalizeMimeType(mime);
211
- if (!normalized) return;
212
- return EXT_BY_MIME[normalized];
213
- }
214
- function isGifMedia(opts) {
215
- if (opts.contentType?.toLowerCase() === "image/gif") return true;
216
- return getFileExtension(opts.fileName) === ".gif";
217
- }
218
- function imageMimeFromFormat(format) {
219
- if (!format) return;
220
- switch (format.toLowerCase()) {
221
- case "jpg":
222
- case "jpeg": return "image/jpeg";
223
- case "heic": return "image/heic";
224
- case "heif": return "image/heif";
225
- case "png": return "image/png";
226
- case "webp": return "image/webp";
227
- case "gif": return "image/gif";
228
- default: return;
229
- }
230
- }
231
- function kindFromMime(mime) {
232
- return mediaKindFromMime(normalizeMimeType(mime));
233
- }
234
-
235
- //#endregion
236
- //#region src/media/image-ops.ts
237
- const IMAGE_REDUCE_QUALITY_STEPS = [
238
- 85,
239
- 75,
240
- 65,
241
- 55,
242
- 45,
243
- 35
244
- ];
245
- function buildImageResizeSideGrid(maxSide, sideStart) {
246
- return [
247
- sideStart,
248
- 1800,
249
- 1600,
250
- 1400,
251
- 1200,
252
- 1e3,
253
- 800
254
- ].map((value) => Math.min(maxSide, value)).filter((value, idx, arr) => value > 0 && arr.indexOf(value) === idx).toSorted((a, b) => b - a);
255
- }
256
- function isBun() {
257
- return typeof process.versions.bun === "string";
258
- }
259
- function prefersSips() {
260
- return process.env.SQUIDCLAW_IMAGE_BACKEND === "sips" || process.env.SQUIDCLAW_IMAGE_BACKEND !== "sharp" && isBun() && process.platform === "darwin";
261
- }
262
- async function loadSharp() {
263
- const mod = await import("sharp");
264
- const sharp = mod.default ?? mod;
265
- return (buffer) => sharp(buffer, { failOnError: false });
266
- }
267
- /**
268
- * Reads EXIF orientation from JPEG buffer.
269
- * Returns orientation value 1-8, or null if not found/not JPEG.
270
- *
271
- * EXIF orientation values:
272
- * 1 = Normal, 2 = Flip H, 3 = Rotate 180, 4 = Flip V,
273
- * 5 = Rotate 270 CW + Flip H, 6 = Rotate 90 CW, 7 = Rotate 90 CW + Flip H, 8 = Rotate 270 CW
274
- */
275
- function readJpegExifOrientation(buffer) {
276
- if (buffer.length < 2 || buffer[0] !== 255 || buffer[1] !== 216) return null;
277
- let offset = 2;
278
- while (offset < buffer.length - 4) {
279
- if (buffer[offset] !== 255) {
280
- offset++;
281
- continue;
282
- }
283
- const marker = buffer[offset + 1];
284
- if (marker === 255) {
285
- offset++;
286
- continue;
287
- }
288
- if (marker === 225) {
289
- const exifStart = offset + 4;
290
- if (buffer.length > exifStart + 6 && buffer.toString("ascii", exifStart, exifStart + 4) === "Exif" && buffer[exifStart + 4] === 0 && buffer[exifStart + 5] === 0) {
291
- const tiffStart = exifStart + 6;
292
- if (buffer.length < tiffStart + 8) return null;
293
- const isLittleEndian = buffer.toString("ascii", tiffStart, tiffStart + 2) === "II";
294
- const readU16 = (pos) => isLittleEndian ? buffer.readUInt16LE(pos) : buffer.readUInt16BE(pos);
295
- const readU32 = (pos) => isLittleEndian ? buffer.readUInt32LE(pos) : buffer.readUInt32BE(pos);
296
- const ifd0Start = tiffStart + readU32(tiffStart + 4);
297
- if (buffer.length < ifd0Start + 2) return null;
298
- const numEntries = readU16(ifd0Start);
299
- for (let i = 0; i < numEntries; i++) {
300
- const entryOffset = ifd0Start + 2 + i * 12;
301
- if (buffer.length < entryOffset + 12) break;
302
- if (readU16(entryOffset) === 274) {
303
- const value = readU16(entryOffset + 8);
304
- return value >= 1 && value <= 8 ? value : null;
305
- }
306
- }
307
- }
308
- return null;
309
- }
310
- if (marker >= 224 && marker <= 239) {
311
- const segmentLength = buffer.readUInt16BE(offset + 2);
312
- offset += 2 + segmentLength;
313
- continue;
314
- }
315
- if (marker === 192 || marker === 218) break;
316
- offset++;
317
- }
318
- return null;
319
- }
320
- async function withTempDir(fn) {
321
- const dir = await fs.mkdtemp(path.join(os.tmpdir(), "squidclaw-img-"));
322
- try {
323
- return await fn(dir);
324
- } finally {
325
- await fs.rm(dir, {
326
- recursive: true,
327
- force: true
328
- }).catch(() => {});
329
- }
330
- }
331
- async function sipsMetadataFromBuffer(buffer) {
332
- return await withTempDir(async (dir) => {
333
- const input = path.join(dir, "in.img");
334
- await fs.writeFile(input, buffer);
335
- const { stdout } = await runExec("/usr/bin/sips", [
336
- "-g",
337
- "pixelWidth",
338
- "-g",
339
- "pixelHeight",
340
- input
341
- ], {
342
- timeoutMs: 1e4,
343
- maxBuffer: 512 * 1024
344
- });
345
- const w = stdout.match(/pixelWidth:\s*([0-9]+)/);
346
- const h = stdout.match(/pixelHeight:\s*([0-9]+)/);
347
- if (!w?.[1] || !h?.[1]) return null;
348
- const width = Number.parseInt(w[1], 10);
349
- const height = Number.parseInt(h[1], 10);
350
- if (!Number.isFinite(width) || !Number.isFinite(height)) return null;
351
- if (width <= 0 || height <= 0) return null;
352
- return {
353
- width,
354
- height
355
- };
356
- });
357
- }
358
- async function sipsResizeToJpeg(params) {
359
- return await withTempDir(async (dir) => {
360
- const input = path.join(dir, "in.img");
361
- const output = path.join(dir, "out.jpg");
362
- await fs.writeFile(input, params.buffer);
363
- await runExec("/usr/bin/sips", [
364
- "-Z",
365
- String(Math.max(1, Math.round(params.maxSide))),
366
- "-s",
367
- "format",
368
- "jpeg",
369
- "-s",
370
- "formatOptions",
371
- String(Math.max(1, Math.min(100, Math.round(params.quality)))),
372
- input,
373
- "--out",
374
- output
375
- ], {
376
- timeoutMs: 2e4,
377
- maxBuffer: 1024 * 1024
378
- });
379
- return await fs.readFile(output);
380
- });
381
- }
382
- async function sipsConvertToJpeg(buffer) {
383
- return await withTempDir(async (dir) => {
384
- const input = path.join(dir, "in.heic");
385
- const output = path.join(dir, "out.jpg");
386
- await fs.writeFile(input, buffer);
387
- await runExec("/usr/bin/sips", [
388
- "-s",
389
- "format",
390
- "jpeg",
391
- input,
392
- "--out",
393
- output
394
- ], {
395
- timeoutMs: 2e4,
396
- maxBuffer: 1024 * 1024
397
- });
398
- return await fs.readFile(output);
399
- });
400
- }
401
- async function getImageMetadata(buffer) {
402
- if (prefersSips()) return await sipsMetadataFromBuffer(buffer).catch(() => null);
403
- try {
404
- const meta = await (await loadSharp())(buffer).metadata();
405
- const width = Number(meta.width ?? 0);
406
- const height = Number(meta.height ?? 0);
407
- if (!Number.isFinite(width) || !Number.isFinite(height)) return null;
408
- if (width <= 0 || height <= 0) return null;
409
- return {
410
- width,
411
- height
412
- };
413
- } catch {
414
- return null;
415
- }
416
- }
417
- /**
418
- * Applies rotation/flip to image buffer using sips based on EXIF orientation.
419
- */
420
- async function sipsApplyOrientation(buffer, orientation) {
421
- const ops = [];
422
- switch (orientation) {
423
- case 2:
424
- ops.push("-f", "horizontal");
425
- break;
426
- case 3:
427
- ops.push("-r", "180");
428
- break;
429
- case 4:
430
- ops.push("-f", "vertical");
431
- break;
432
- case 5:
433
- ops.push("-r", "270", "-f", "horizontal");
434
- break;
435
- case 6:
436
- ops.push("-r", "90");
437
- break;
438
- case 7:
439
- ops.push("-r", "90", "-f", "horizontal");
440
- break;
441
- case 8:
442
- ops.push("-r", "270");
443
- break;
444
- default: return buffer;
445
- }
446
- return await withTempDir(async (dir) => {
447
- const input = path.join(dir, "in.jpg");
448
- const output = path.join(dir, "out.jpg");
449
- await fs.writeFile(input, buffer);
450
- await runExec("/usr/bin/sips", [
451
- ...ops,
452
- input,
453
- "--out",
454
- output
455
- ], {
456
- timeoutMs: 2e4,
457
- maxBuffer: 1024 * 1024
458
- });
459
- return await fs.readFile(output);
460
- });
461
- }
462
- async function resizeToJpeg(params) {
463
- if (prefersSips()) {
464
- const normalized = await normalizeExifOrientationSips(params.buffer);
465
- if (params.withoutEnlargement !== false) {
466
- const meta = await getImageMetadata(normalized);
467
- if (meta) {
468
- const maxDim = Math.max(meta.width, meta.height);
469
- if (maxDim > 0 && maxDim <= params.maxSide) return await sipsResizeToJpeg({
470
- buffer: normalized,
471
- maxSide: maxDim,
472
- quality: params.quality
473
- });
474
- }
475
- }
476
- return await sipsResizeToJpeg({
477
- buffer: normalized,
478
- maxSide: params.maxSide,
479
- quality: params.quality
480
- });
481
- }
482
- return await (await loadSharp())(params.buffer).rotate().resize({
483
- width: params.maxSide,
484
- height: params.maxSide,
485
- fit: "inside",
486
- withoutEnlargement: params.withoutEnlargement !== false
487
- }).jpeg({
488
- quality: params.quality,
489
- mozjpeg: true
490
- }).toBuffer();
491
- }
492
- async function convertHeicToJpeg(buffer) {
493
- if (prefersSips()) return await sipsConvertToJpeg(buffer);
494
- return await (await loadSharp())(buffer).jpeg({
495
- quality: 90,
496
- mozjpeg: true
497
- }).toBuffer();
498
- }
499
- /**
500
- * Checks if an image has an alpha channel (transparency).
501
- * Returns true if the image has alpha, false otherwise.
502
- */
503
- async function hasAlphaChannel(buffer) {
504
- try {
505
- const meta = await (await loadSharp())(buffer).metadata();
506
- return meta.hasAlpha || meta.channels === 4;
507
- } catch {
508
- return false;
509
- }
510
- }
511
- /**
512
- * Resizes an image to PNG format, preserving alpha channel (transparency).
513
- * Falls back to sharp only (no sips fallback for PNG with alpha).
514
- */
515
- async function resizeToPng(params) {
516
- const sharp = await loadSharp();
517
- const compressionLevel = params.compressionLevel ?? 6;
518
- return await sharp(params.buffer).rotate().resize({
519
- width: params.maxSide,
520
- height: params.maxSide,
521
- fit: "inside",
522
- withoutEnlargement: params.withoutEnlargement !== false
523
- }).png({ compressionLevel }).toBuffer();
524
- }
525
- async function optimizeImageToPng(buffer, maxBytes) {
526
- const sides = [
527
- 2048,
528
- 1536,
529
- 1280,
530
- 1024,
531
- 800
532
- ];
533
- const compressionLevels = [
534
- 6,
535
- 7,
536
- 8,
537
- 9
538
- ];
539
- let smallest = null;
540
- for (const side of sides) for (const compressionLevel of compressionLevels) try {
541
- const out = await resizeToPng({
542
- buffer,
543
- maxSide: side,
544
- compressionLevel,
545
- withoutEnlargement: true
546
- });
547
- const size = out.length;
548
- if (!smallest || size < smallest.size) smallest = {
549
- buffer: out,
550
- size,
551
- resizeSide: side,
552
- compressionLevel
553
- };
554
- if (size <= maxBytes) return {
555
- buffer: out,
556
- optimizedSize: size,
557
- resizeSide: side,
558
- compressionLevel
559
- };
560
- } catch {}
561
- if (smallest) return {
562
- buffer: smallest.buffer,
563
- optimizedSize: smallest.size,
564
- resizeSide: smallest.resizeSide,
565
- compressionLevel: smallest.compressionLevel
566
- };
567
- throw new Error("Failed to optimize PNG image");
568
- }
569
- /**
570
- * Internal sips-only EXIF normalization (no sharp fallback).
571
- * Used by resizeToJpeg to normalize before sips resize.
572
- */
573
- async function normalizeExifOrientationSips(buffer) {
574
- try {
575
- const orientation = readJpegExifOrientation(buffer);
576
- if (!orientation || orientation === 1) return buffer;
577
- return await sipsApplyOrientation(buffer, orientation);
578
- } catch {
579
- return buffer;
580
- }
581
- }
582
-
583
- //#endregion
584
- export { GATEWAY_CLIENT_NAMES as A, isMarkdownCapableMessageChannel as C, resolveMessageChannel as D, resolveGatewayMessageChannel as E, GATEWAY_CLIENT_IDS as O, isInternalMessageChannel as S, normalizeMessageChannel as T, maxBytesForKind as _, hasAlphaChannel as a, isDeliverableMessageChannel as b, detectMime as c, imageMimeFromFormat as d, isAudioFileName as f, MAX_IMAGE_BYTES as g, normalizeMimeType as h, getImageMetadata as i, GATEWAY_CLIENT_MODES as k, extensionForMime as l, kindFromMime as m, buildImageResizeSideGrid as n, optimizeImageToPng as o, isGifMedia as p, convertHeicToJpeg as r, resizeToJpeg as s, IMAGE_REDUCE_QUALITY_STEPS as t, getFileExtension as u, mediaKindFromMime as v, listDeliverableMessageChannels as w, isGatewayMessageChannel as x, INTERNAL_MESSAGE_CHANNEL as y };
@@ -1,25 +0,0 @@
1
- import "./run-with-concurrency-5DMu9szx.js";
2
- import "./accounts-C-BT6Po7.js";
3
- import "./paths-8xF5kDne.js";
4
- import "./github-copilot-token-Dy-0-Kh3.js";
5
- import "./config-FhBFLsNm.js";
6
- import "./logger-DDdrdbDu.js";
7
- import "./thinking-Bu-w5mW5.js";
8
- import "./image-ops-DN17S88I.js";
9
- import "./pi-embedded-helpers-CfzQPXDC.js";
10
- import "./plugins-6NxPd6TS.js";
11
- import "./accounts-DQDXV8eB.js";
12
- import "./accounts-B6gye1Jd.js";
13
- import "./paths-C6W4VHoa.js";
14
- import "./redact-BoNEjbpF.js";
15
- import "./errors-B8oJXuCF.js";
16
- import "./path-alias-guards-gBhrAn14.js";
17
- import "./fs-safe-Dqmpk-Fr.js";
18
- import "./ssrf-B3XRWBsP.js";
19
- import "./tool-images-D0G_giwP.js";
20
- import "./skills-DUphJGKn.js";
21
- import "./chrome-B5PWOUbr.js";
22
- import "./store-DFvIhzWZ.js";
23
- import { t as describeImageWithModel } from "./image-BSFy8d1M.js";
24
-
25
- export { describeImageWithModel };
@@ -1,25 +0,0 @@
1
- import "./run-with-concurrency-DmTrN5JG.js";
2
- import "./config-DE6ibnmU.js";
3
- import "./logger-DIb2cGHp.js";
4
- import "./paths-Duwviem_.js";
5
- import "./accounts-BW7b9aIf.js";
6
- import "./plugins-NKOOkt_i.js";
7
- import "./thinking-0lRH3Rcl.js";
8
- import "./accounts-De05T3_J.js";
9
- import "./image-ops-D9cweu_-.js";
10
- import "./pi-embedded-helpers-CBAsAxOB.js";
11
- import "./accounts-tAi-tfAf.js";
12
- import "./github-copilot-token-C0y6vp3r.js";
13
- import "./paths-B7_75Pdr.js";
14
- import { t as describeImageWithModel } from "./image-UG930mNm.js";
15
- import "./chrome-CVbDHFaE.js";
16
- import "./skills-D58hSyfJ.js";
17
- import "./path-alias-guards-TnxupPQC.js";
18
- import "./redact-9WsNyb7S.js";
19
- import "./errors-CgRPdp3o.js";
20
- import "./fs-safe-DqCO1D4C.js";
21
- import "./proxy-env-DooJ7AbC.js";
22
- import "./store-CHxyy2Nq.js";
23
- import "./tool-images-K2kMTUHK.js";
24
-
25
- export { describeImageWithModel };