shadow-claw 1.59.6 → 1.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.well-known/mcp/server-card.json +1 -1
- package/.well-known/mcp.json +1 -1
- package/README.md +6 -2
- package/dist/cli/build/build.js +1 -1
- package/dist/cli/chunk-3C5izdQW.js +1 -0
- package/dist/cli/chunk-B-75h9gX.js +1 -0
- package/dist/cli/{chunk-C9o6lXP3.js → chunk-B7Kn-otm.js} +1 -1
- package/dist/cli/{chunk-YX32FcN7.js → chunk-BBczgswQ.js} +1 -1
- package/dist/cli/{chunk-DcNxjqH6.js → chunk-BE-lYWcn.js} +1 -1
- package/dist/cli/{chunk-DJqHK-qS.js → chunk-BECr0WxI.js} +11 -11
- package/dist/cli/chunk-BEz1PD1_.js +1 -0
- package/dist/cli/chunk-BLzI1Fp2.js +1 -0
- package/dist/cli/{chunk-yiVdvGCJ.js → chunk-BVSC1MNQ.js} +11 -11
- package/dist/cli/{chunk-CX2itile.js → chunk-BdWcep6o.js} +1 -1
- package/dist/cli/{chunk-DLde6nuO.js → chunk-BfTpnSS4.js} +1 -1
- package/dist/cli/{chunk-D2_eAO83.js → chunk-BgvqTf7w.js} +1 -1
- package/dist/cli/chunk-BwsJfUT3.js +1 -0
- package/dist/cli/{chunk--PFY91kE.js → chunk-C9b4b7c_.js} +1 -1
- package/dist/cli/{chunk-D3y7h9Xe.js → chunk-CAw9XYFe.js} +1 -1
- package/dist/cli/chunk-CFCcbFs2.js +396 -0
- package/dist/cli/{chunk-Cnjb8Usu.js → chunk-CTarF4FC.js} +1 -1
- package/dist/cli/{chunk-DM4xsTry.js → chunk-Cbq5hpjb.js} +4 -4
- package/dist/cli/chunk-CjTjKy_v.js +310 -0
- package/dist/cli/chunk-Cjyu4cr_.js +36 -0
- package/dist/cli/{chunk-DUGZPka_.js → chunk-ClMKygjZ.js} +1 -1
- package/dist/cli/chunk-Cppnq1KF.js +1 -0
- package/dist/cli/{chunk-DvemF16v.js → chunk-D9QCNFMO.js} +1 -1
- package/dist/cli/chunk-DB21BMqt.js +7 -0
- package/dist/cli/{chunk-_Vo-o_e3.js → chunk-DHoIWvCc.js} +1 -1
- package/dist/cli/chunk-DZEN9T5y.js +1 -0
- package/dist/cli/{chunk-5rLO4DWS.js → chunk-Dl14OyYO.js} +9 -9
- package/dist/cli/chunk-Dl_vv0dI.js +1 -0
- package/dist/cli/chunk-Dpmfhlyl.js +1 -0
- package/dist/cli/{chunk-BrR1DOBS.js → chunk-Du7Xtucq.js} +1 -1
- package/dist/cli/{chunk-Bc_weULz.js → chunk-DxcDFUi_.js} +1 -1
- package/dist/cli/{chunk-Dt7-hzJU.js → chunk-DyyEWbV7.js} +1 -1
- package/dist/cli/chunk-N0x3mXU0.js +1 -0
- package/dist/cli/{chunk-CGoE4llV.js → chunk-V-w0Bata.js} +1 -1
- package/dist/cli/{chunk-C8DBACtx.js → chunk-ZxDxSSn-.js} +1 -1
- package/dist/cli/chunk-lPvFUkd5.js +7 -0
- package/dist/cli/{chunk-Ctg5L55n.js → chunk-n5s-sCdU.js} +1 -1
- package/dist/cli/{chunk-Dw8GndPD.js → chunk-nD9VPVMq.js} +1 -1
- package/dist/cli/{chunk-Cq_kQohv.js → chunk-rFuy8aS_.js} +1 -1
- package/dist/cli/{chunk-Bq38OubR.js → chunk-wjM6JXWa.js} +1 -1
- package/dist/cli/{chunk-3wTukVof.js → chunk-zcES9rut.js} +1 -1
- package/dist/cli/cli.js +3 -3
- package/dist/headless-agent.js +2 -2
- package/dist/lib/{app-routes-DJdIjp2V.js → app-routes-BXiRvlNl.js} +7 -25
- package/dist/lib/{app-routes-DJdIjp2V.js.map → app-routes-BXiRvlNl.js.map} +1 -1
- package/dist/lib/{attachment-capabilities-Dbb-4ZP5.js → attachment-capabilities-BjkEPip8.js} +2 -2
- package/dist/lib/{attachment-capabilities-Dbb-4ZP5.js.map → attachment-capabilities-BjkEPip8.js.map} +1 -1
- package/dist/lib/{channel-Dlru5ofR.js → channel-DB77spML.js} +3 -3
- package/dist/lib/{channel-Dlru5ofR.js.map → channel-DB77spML.js.map} +1 -1
- package/dist/lib/{chat-template-BuuLY8l7.js → chat-template-DPEKGJhB.js} +2 -2
- package/dist/lib/{chat-template-BuuLY8l7.js.map → chat-template-DPEKGJhB.js.map} +1 -1
- package/dist/lib/{compact-context-BtR55YPU.js → compact-context-Q9t9aL1e.js} +19 -19
- package/dist/lib/{compact-context-BtR55YPU.js.map → compact-context-Q9t9aL1e.js.map} +1 -1
- package/dist/lib/components/common/shadow-claw-provider-model-picker.js +1 -1
- package/dist/lib/components/index.js +27 -27
- package/dist/lib/components/settings/shadow-claw-accounts.js +1 -1
- package/dist/lib/components/settings/shadow-claw-channel-config.js +1 -1
- package/dist/lib/components/settings/shadow-claw-control-plane.js +1 -1
- package/dist/lib/components/settings/shadow-claw-git.js +1 -1
- package/dist/lib/components/settings/shadow-claw-integrations.js +1 -1
- package/dist/lib/components/settings/shadow-claw-llm.js +1 -1
- package/dist/lib/components/settings/shadow-claw-mcp-remote.js +1 -1
- package/dist/lib/components/settings/shadow-claw-networking.js +1 -1
- package/dist/lib/components/settings/shadow-claw-notifications.js +1 -1
- package/dist/lib/components/settings/shadow-claw-peerjs.js +1 -1
- package/dist/lib/components/settings/shadow-claw-storage.js +1 -1
- package/dist/lib/components/settings/shadow-claw-task-server.js +1 -1
- package/dist/lib/components/settings/shadow-claw-webvm.js +1 -1
- package/dist/lib/components/shadow-claw-a2ui.js +1 -1
- package/dist/lib/components/shadow-claw-accounts.js +1 -1
- package/dist/lib/components/shadow-claw-channel-config.js +1 -1
- package/dist/lib/components/shadow-claw-channels.js +1 -1
- package/dist/lib/components/shadow-claw-chat.js +1 -1
- package/dist/lib/components/shadow-claw-control-plane.js +1 -1
- package/dist/lib/components/shadow-claw-conversations.js +1 -1
- package/dist/lib/components/shadow-claw-file-viewer.js +1 -1
- package/dist/lib/components/shadow-claw-files.js +1 -1
- package/dist/lib/components/shadow-claw-git.js +1 -1
- package/dist/lib/components/shadow-claw-integrations.js +1 -1
- package/dist/lib/components/shadow-claw-llm.js +1 -1
- package/dist/lib/components/shadow-claw-mcp-remote.js +1 -1
- package/dist/lib/components/shadow-claw-networking.js +1 -1
- package/dist/lib/components/shadow-claw-notifications.js +1 -1
- package/dist/lib/components/shadow-claw-page-header.js +1 -1
- package/dist/lib/components/shadow-claw-pages.js +1 -1
- package/dist/lib/components/shadow-claw-peerjs.js +1 -1
- package/dist/lib/components/shadow-claw-provider-model-picker.js +1 -1
- package/dist/lib/components/shadow-claw-settings.js +1 -1
- package/dist/lib/components/shadow-claw-storage.js +1 -1
- package/dist/lib/components/shadow-claw-task-server.js +1 -1
- package/dist/lib/components/shadow-claw-tasks.js +1 -1
- package/dist/lib/components/shadow-claw-terminal.js +1 -1
- package/dist/lib/components/shadow-claw-tools.js +1 -1
- package/dist/lib/components/shadow-claw-webvm.js +1 -1
- package/dist/lib/components/shadow-claw.js +1 -1
- package/dist/lib/{config-DxNI3TlW.js → config-BrHR97zt.js} +2 -2
- package/dist/lib/{config-DxNI3TlW.js.map → config-BrHR97zt.js.map} +1 -1
- package/dist/lib/{configure-peer-js-ChDhOZU4.js → configure-peer-js-CgFiwoxY.js} +3 -3
- package/dist/lib/{configure-peer-js-ChDhOZU4.js.map → configure-peer-js-CgFiwoxY.js.map} +1 -1
- package/dist/lib/{connections-DC4NZkJE.js → connections-C1FWsBsE.js} +2 -2
- package/dist/lib/{connections-DC4NZkJE.js.map → connections-C1FWsBsE.js.map} +1 -1
- package/dist/lib/content/build-attachment-content-blocks.d.ts +2 -0
- package/dist/lib/{credentials-5vpz0XPk.js → credentials-CZbngHXW.js} +2 -2
- package/dist/lib/{credentials-5vpz0XPk.js.map → credentials-CZbngHXW.js.map} +1 -1
- package/dist/lib/{discover-skills-CD0sKvAI.js → discover-skills-CXyaWHKi.js} +13 -13
- package/dist/lib/{discover-skills-CD0sKvAI.js.map → discover-skills-CXyaWHKi.js.map} +1 -1
- package/dist/lib/{download-group-file-Dk3qaxhJ.js → download-group-file-D0wgg10Q.js} +2 -2
- package/dist/lib/{download-group-file-Dk3qaxhJ.js.map → download-group-file-D0wgg10Q.js.map} +1 -1
- package/dist/lib/{file-viewer-B4pRW-_G.js → file-viewer-DOfvX6yy.js} +5 -5
- package/dist/lib/{file-viewer-B4pRW-_G.js.map → file-viewer-DOfvX6yy.js.map} +1 -1
- package/dist/lib/{get-or-create-subscriber-id-HCcgDEPz.js → get-or-create-subscriber-id-wyzaML7Z.js} +2 -2
- package/dist/lib/{get-or-create-subscriber-id-HCcgDEPz.js.map → get-or-create-subscriber-id-wyzaML7Z.js.map} +1 -1
- package/dist/lib/{git-B3Q1euc5.js → git-CogDRlEz.js} +5 -5
- package/dist/lib/{git-B3Q1euc5.js.map → git-CogDRlEz.js.map} +1 -1
- package/dist/lib/{iframe-bridge-scripts-D8iuFhUk.js → iframe-bridge-scripts-Dx825LLG.js} +2 -2
- package/dist/lib/{iframe-bridge-scripts-D8iuFhUk.js.map → iframe-bridge-scripts-Dx825LLG.js.map} +1 -1
- package/dist/lib/index.js +28 -28
- package/dist/lib/{init-chat-split-resize-B0ODULx9.js → init-chat-split-resize-Cc0bd2z9.js} +2 -2
- package/dist/lib/{init-chat-split-resize-B0ODULx9.js.map → init-chat-split-resize-Cc0bd2z9.js.map} +1 -1
- package/dist/lib/{init-control-plane-C1FRRmjC.js → init-control-plane-CEGdzgWX.js} +15 -15
- package/dist/lib/{init-control-plane-C1FRRmjC.js.map → init-control-plane-CEGdzgWX.js.map} +1 -1
- package/dist/lib/{invoke-agent-CzN7sVh-.js → invoke-agent-cac3gCsj.js} +11 -11
- package/dist/lib/{invoke-agent-CzN7sVh-.js.map → invoke-agent-cac3gCsj.js.map} +1 -1
- package/dist/lib/{markdown-mbNo7cV3.js → markdown--6vTAPEH.js} +2 -2
- package/dist/lib/{markdown-mbNo7cV3.js.map → markdown--6vTAPEH.js.map} +1 -1
- package/dist/lib/{mcp-reconnect-3T7yWGEY.js → mcp-reconnect-BeqQvNWO.js} +3 -3
- package/dist/lib/{mcp-reconnect-3T7yWGEY.js.map → mcp-reconnect-BeqQvNWO.js.map} +1 -1
- package/dist/lib/{model-ranking-DGNSWYwN.js → model-ranking-BhsJV7vb.js} +2 -2
- package/dist/lib/{model-ranking-DGNSWYwN.js.map → model-ranking-BhsJV7vb.js.map} +1 -1
- package/dist/lib/{move-group-entry-NMTJ59M9.js → move-group-entry-D8dptMg0.js} +5 -5
- package/dist/lib/{move-group-entry-NMTJ59M9.js.map → move-group-entry-D8dptMg0.js.map} +1 -1
- package/dist/lib/{orchestrator-B8FV1V7x.js → orchestrator-BBAwy9Nm.js} +24 -24
- package/dist/lib/{orchestrator-B8FV1V7x.js.map → orchestrator-BBAwy9Nm.js.map} +1 -1
- package/dist/lib/{orchestrator-i_QJ-o22.js → orchestrator-cRBe3lhq.js} +11 -11
- package/dist/lib/orchestrator-cRBe3lhq.js.map +1 -0
- package/dist/lib/{parse-path-DPCn-HwI.js → parse-path-BOHQP_IQ.js} +3 -3
- package/dist/lib/{parse-path-DPCn-HwI.js.map → parse-path-BOHQP_IQ.js.map} +1 -1
- package/dist/lib/{peerjs-z5zeioPV.js → peerjs-BLg8aGUj.js} +8 -8
- package/dist/lib/{peerjs-z5zeioPV.js.map → peerjs-BLg8aGUj.js.map} +1 -1
- package/dist/lib/{process-peer-query-param-CJp7w7AU.js → process-peer-query-param-BnsVnxzH.js} +5 -5
- package/dist/lib/{process-peer-query-param-CJp7w7AU.js.map → process-peer-query-param-BnsVnxzH.js.map} +1 -1
- package/dist/lib/{process-pending-shared-payloads-B6_TlBFA.js → process-pending-shared-payloads-DBZfZOOa.js} +4 -4
- package/dist/lib/{process-pending-shared-payloads-B6_TlBFA.js.map → process-pending-shared-payloads-DBZfZOOa.js.map} +1 -1
- package/dist/lib/{process-room-query-param-C3FFGGn6.js → process-room-query-param-B8EYg_-r.js} +4 -4
- package/dist/lib/{process-room-query-param-C3FFGGn6.js.map → process-room-query-param-B8EYg_-r.js.map} +1 -1
- package/dist/lib/{provider-DcQZypu5.js → provider-BC9KPI14.js} +3 -3
- package/dist/lib/{provider-DcQZypu5.js.map → provider-BC9KPI14.js.map} +1 -1
- package/dist/lib/{push-client-Cx5rMs6J.js → push-client-CAm6UMvE.js} +5 -5
- package/dist/lib/{push-client-Cx5rMs6J.js.map → push-client-CAm6UMvE.js.map} +1 -1
- package/dist/lib/{read-group-file-bytes-CXOG_YyM.js → read-group-file-bytes-UQIk1eJG.js} +2 -2
- package/dist/lib/{read-group-file-bytes-CXOG_YyM.js.map → read-group-file-bytes-UQIk1eJG.js.map} +1 -1
- package/dist/lib/{rooms-CwlkYLDU.js → rooms-Dzphx3rK.js} +2 -2
- package/dist/lib/{rooms-CwlkYLDU.js.map → rooms-Dzphx3rK.js.map} +1 -1
- package/dist/lib/{shadow-claw-DoQ7fgl5.js → shadow-claw-CGl8tXtG.js} +17 -20
- package/dist/lib/shadow-claw-CGl8tXtG.js.map +1 -0
- package/dist/lib/{shadow-claw-a2ui-Br6qJMs1.js → shadow-claw-a2ui-lG0vQbW8.js} +2 -2
- package/dist/lib/{shadow-claw-a2ui-Br6qJMs1.js.map → shadow-claw-a2ui-lG0vQbW8.js.map} +1 -1
- package/dist/lib/{shadow-claw-accounts-BTDILfWw.js → shadow-claw-accounts-CkqyCxwp.js} +3 -3
- package/dist/lib/{shadow-claw-accounts-BTDILfWw.js.map → shadow-claw-accounts-CkqyCxwp.js.map} +1 -1
- package/dist/lib/{shadow-claw-channel-config-IKiL34tI.js → shadow-claw-channel-config-BNIWCdsL.js} +4 -4
- package/dist/lib/{shadow-claw-channel-config-IKiL34tI.js.map → shadow-claw-channel-config-BNIWCdsL.js.map} +1 -1
- package/dist/lib/{shadow-claw-channels-JgEzuHWK.js → shadow-claw-channels-C2QSn4Ew.js} +3 -3
- package/dist/lib/{shadow-claw-channels-JgEzuHWK.js.map → shadow-claw-channels-C2QSn4Ew.js.map} +1 -1
- package/dist/lib/{shadow-claw-chat-SGUDT31r.js → shadow-claw-chat-Wx3y9y6c.js} +15 -15
- package/dist/lib/{shadow-claw-chat-SGUDT31r.js.map → shadow-claw-chat-Wx3y9y6c.js.map} +1 -1
- package/dist/lib/{shadow-claw-control-plane-CRWFZ3vD.js → shadow-claw-control-plane-D5E4cFGu.js} +7 -7
- package/dist/lib/{shadow-claw-control-plane-CRWFZ3vD.js.map → shadow-claw-control-plane-D5E4cFGu.js.map} +1 -1
- package/dist/lib/{shadow-claw-conversations-D23GJ7qo.js → shadow-claw-conversations-BtDv7GRW.js} +7 -7
- package/dist/lib/{shadow-claw-conversations-D23GJ7qo.js.map → shadow-claw-conversations-BtDv7GRW.js.map} +1 -1
- package/dist/lib/{shadow-claw-file-viewer-C1V8WTiU.js → shadow-claw-file-viewer-CG40kwWV.js} +10 -10
- package/dist/lib/{shadow-claw-file-viewer-C1V8WTiU.js.map → shadow-claw-file-viewer-CG40kwWV.js.map} +1 -1
- package/dist/lib/{shadow-claw-files-DN7irmE1.js → shadow-claw-files-BOUULrlX.js} +11 -11
- package/dist/lib/{shadow-claw-files-DN7irmE1.js.map → shadow-claw-files-BOUULrlX.js.map} +1 -1
- package/dist/lib/{shadow-claw-git-D-1oIh65.js → shadow-claw-git-BeHV73_9.js} +6 -6
- package/dist/lib/{shadow-claw-git-D-1oIh65.js.map → shadow-claw-git-BeHV73_9.js.map} +1 -1
- package/dist/lib/{shadow-claw-integrations-CZjnm7cM.js → shadow-claw-integrations-RZZ-m-Id.js} +4 -4
- package/dist/lib/{shadow-claw-integrations-CZjnm7cM.js.map → shadow-claw-integrations-RZZ-m-Id.js.map} +1 -1
- package/dist/lib/{shadow-claw-llm-4Gefh5FN.js → shadow-claw-llm-KONyWKZM.js} +9 -9
- package/dist/lib/{shadow-claw-llm-4Gefh5FN.js.map → shadow-claw-llm-KONyWKZM.js.map} +1 -1
- package/dist/lib/{shadow-claw-mcp-remote-B9ssb3YV.js → shadow-claw-mcp-remote-BKFROurv.js} +4 -4
- package/dist/lib/{shadow-claw-mcp-remote-B9ssb3YV.js.map → shadow-claw-mcp-remote-BKFROurv.js.map} +1 -1
- package/dist/lib/{shadow-claw-networking-BN5BB4hb.js → shadow-claw-networking-Diy3JJkc.js} +2 -2
- package/dist/lib/{shadow-claw-networking-BN5BB4hb.js.map → shadow-claw-networking-Diy3JJkc.js.map} +1 -1
- package/dist/lib/{shadow-claw-notifications-71KARtkY.js → shadow-claw-notifications-C-upPa-4.js} +3 -3
- package/dist/lib/{shadow-claw-notifications-71KARtkY.js.map → shadow-claw-notifications-C-upPa-4.js.map} +1 -1
- package/dist/lib/{shadow-claw-page-header-DMGO-TSe.js → shadow-claw-page-header-C_Qr3xZM.js} +2 -2
- package/dist/lib/{shadow-claw-page-header-DMGO-TSe.js.map → shadow-claw-page-header-C_Qr3xZM.js.map} +1 -1
- package/dist/lib/{shadow-claw-pages-BiRM6qiA.js → shadow-claw-pages-CfAjUKgd.js} +11 -11
- package/dist/lib/{shadow-claw-pages-BiRM6qiA.js.map → shadow-claw-pages-CfAjUKgd.js.map} +1 -1
- package/dist/lib/{shadow-claw-peerjs-BZu7jNSe.js → shadow-claw-peerjs-t4YibS9s.js} +6 -6
- package/dist/lib/{shadow-claw-peerjs-BZu7jNSe.js.map → shadow-claw-peerjs-t4YibS9s.js.map} +1 -1
- package/dist/lib/{shadow-claw-provider-model-picker-BXYXEobD.js → shadow-claw-provider-model-picker-B-Ct4yW-.js} +2 -2
- package/dist/lib/{shadow-claw-provider-model-picker-BXYXEobD.js.map → shadow-claw-provider-model-picker-B-Ct4yW-.js.map} +1 -1
- package/dist/lib/{shadow-claw-settings-CcT5EK08.js → shadow-claw-settings-Cg5V0e9g.js} +7 -7
- package/dist/lib/{shadow-claw-settings-CcT5EK08.js.map → shadow-claw-settings-Cg5V0e9g.js.map} +1 -1
- package/dist/lib/{shadow-claw-storage-eTOpbvpi.js → shadow-claw-storage-C7tCnsSG.js} +5 -5
- package/dist/lib/{shadow-claw-storage-eTOpbvpi.js.map → shadow-claw-storage-C7tCnsSG.js.map} +1 -1
- package/dist/lib/{shadow-claw-task-server-DFImTUbw.js → shadow-claw-task-server-BObsRdf8.js} +2 -2
- package/dist/lib/{shadow-claw-task-server-DFImTUbw.js.map → shadow-claw-task-server-BObsRdf8.js.map} +1 -1
- package/dist/lib/{shadow-claw-tasks-BjaxsmUx.js → shadow-claw-tasks-B2EEqrcY.js} +9 -9
- package/dist/lib/{shadow-claw-tasks-BjaxsmUx.js.map → shadow-claw-tasks-B2EEqrcY.js.map} +1 -1
- package/dist/lib/{shadow-claw-terminal-C-4wreFe.js → shadow-claw-terminal-DSHfO2b9.js} +2 -2
- package/dist/lib/{shadow-claw-terminal-C-4wreFe.js.map → shadow-claw-terminal-DSHfO2b9.js.map} +1 -1
- package/dist/lib/{shadow-claw-tools-COdrGZJk.js → shadow-claw-tools-DwPBADua.js} +7 -7
- package/dist/lib/{shadow-claw-tools-COdrGZJk.js.map → shadow-claw-tools-DwPBADua.js.map} +1 -1
- package/dist/lib/{shadow-claw-webvm-sxqVjO0L.js → shadow-claw-webvm-CY4qGaMB.js} +3 -3
- package/dist/lib/{shadow-claw-webvm-sxqVjO0L.js.map → shadow-claw-webvm-CY4qGaMB.js.map} +1 -1
- package/dist/lib/{sync-web-mcp-registration-D4hdUwtv.js → sync-web-mcp-registration-BiOZvW-R.js} +6 -6
- package/dist/lib/{sync-web-mcp-registration-D4hdUwtv.js.map → sync-web-mcp-registration-BiOZvW-R.js.map} +1 -1
- package/dist/lib/{system-prompt-DT_KeYaL.js → system-prompt-CxJ3Nx4c.js} +9 -8
- package/dist/lib/system-prompt-CxJ3Nx4c.js.map +1 -0
- package/dist/lib/{tools-Beuyh8y1.js → tools-B8OJ4sMF.js} +4 -4
- package/dist/lib/{tools-Beuyh8y1.js.map → tools-B8OJ4sMF.js.map} +1 -1
- package/dist/lib/{transformers-DydnReu4.js → transformers-BMURofG6.js} +2 -2
- package/dist/lib/{transformers-DydnReu4.js.map → transformers-BMURofG6.js.map} +1 -1
- package/dist/lib/{trusted-types-CfwZl_rr.js → trusted-types-HwsGS5Nj.js} +19 -17
- package/dist/lib/{trusted-types-CfwZl_rr.js.map → trusted-types-HwsGS5Nj.js.map} +1 -1
- package/dist/lib/{upload-group-file-BbBzjTcN.js → upload-group-file-CJpoNjEb.js} +3 -3
- package/dist/lib/{upload-group-file-BbBzjTcN.js.map → upload-group-file-CJpoNjEb.js.map} +1 -1
- package/dist/lib/utils/index.js +1 -1
- package/dist/lib/utils/namespaced-storage.js +1 -1
- package/dist/lib/utils/runtime-assets.js +1 -1
- package/dist/lib/utils/utils.js +1 -1
- package/dist/lib/{webmcp-DCfAFiIO.js → webmcp-BoMTvgmX.js} +3 -3
- package/dist/lib/{webmcp-DCfAFiIO.js.map → webmcp-BoMTvgmX.js.map} +1 -1
- package/dist/lib/{write-group-file-bytes-Ccn-VFUU.js → write-group-file-bytes-CNT7DqOZ.js} +3 -3
- package/dist/lib/{write-group-file-bytes-Ccn-VFUU.js.map → write-group-file-bytes-CNT7DqOZ.js.map} +1 -1
- package/dist/public/.well-known/mcp/server-card.json +1 -1
- package/dist/public/.well-known/mcp.json +1 -1
- package/dist/public/AGENTS.md +3 -1
- package/dist/public/README.md +6 -2
- package/dist/public/agent.worker.js +1 -1
- package/dist/public/attachment-capabilities-AdwXt3--.js +1 -0
- package/dist/public/{channel-BylT3rJC.js → channel-DIpDQekL.js} +1 -1
- package/dist/public/{chat-template-DPHJy7tr.js → chat-template-CXKs8lFR.js} +1 -1
- package/dist/public/compact-context-BQ2ZXoAc.js +5 -0
- package/dist/public/{compact-context-BINQh64w.js → compact-context-dHitmPsV.js} +2 -2
- package/dist/public/config-C16fFWtP.js +1 -0
- package/dist/public/{configure-peer-js-DChhcOfe.js → configure-peer-js-DV1rqvFX.js} +1 -1
- package/dist/public/{connections-CHaw0VqP.js → connections-Dxwj8yK_.js} +1 -1
- package/dist/public/{create-model-cache-fetch-DQebkoPL.js → create-model-cache-fetch-B0mSCEk6.js} +1 -1
- package/dist/public/{credentials-CgVqS119.js → credentials-CJUQ5Ep2.js} +1 -1
- package/dist/public/{custom-element-security-kiDhPfb8.js → custom-element-security-B2daIE5r.js} +2 -2
- package/dist/public/{discover-skills-Cvmx5I9V.js → discover-skills-BWJB8HUA.js} +6 -6
- package/dist/public/docs/architecture/overview.md +1 -1
- package/dist/public/docs/example/article/index.html +29 -30
- package/dist/public/docs/example/article.html +29 -30
- package/dist/public/docs/publishing/index.html +29 -30
- package/dist/public/docs/publishing.html +29 -30
- package/dist/public/docs/skill-creator/index.html +29 -30
- package/dist/public/docs/skill-creator.html +29 -30
- package/dist/public/docs/subsystems/attachment-capabilities.md +14 -1
- package/dist/public/docs/subsystems/cli.md +95 -51
- package/dist/public/docs/subsystems/pages.md +5 -0
- package/dist/public/{download-group-file-BapoRgfU.js → download-group-file-BkMH-JKi.js} +1 -1
- package/dist/public/e2e/README.md +1 -1
- package/dist/public/{e2e-bridge-C0g8vZKr.js → e2e-bridge-lP2qqiv3.js} +1 -1
- package/dist/public/get-group-dir-D--BiEyk.js +1 -0
- package/dist/public/{get-or-create-subscriber-id-GvRZYXwA.js → get-or-create-subscriber-id-jVHnQfbr.js} +1 -1
- package/dist/public/{git-CaAAZfVd.js → git-DjmQ16rm.js} +2 -2
- package/dist/public/{iframe-bridge-scripts-BnqtKhE4.js → iframe-bridge-scripts-CO0izGjW.js} +1 -1
- package/dist/public/index.html +29 -30
- package/dist/public/index.js +1 -1
- package/dist/public/{init-chat-split-resize-Btonoy8u.js → init-chat-split-resize-C8AqCCiK.js} +1 -1
- package/dist/public/init-control-plane-Ctz7FI8M.js +1 -0
- package/dist/public/{invoke-agent-B3Osw6K7.js → invoke-agent-C_geruwq.js} +1 -1
- package/dist/public/llms.txt +1 -1
- package/dist/public/main/index.html +29 -30
- package/dist/public/main/memory/index.html +29 -30
- package/dist/public/main/memory.html +29 -30
- package/dist/public/main.html +29 -30
- package/dist/public/{markdown-CPbU4r1U.js → markdown-CDSb5Hrl.js} +1 -1
- package/dist/public/{mcp-reconnect-CzROVsXG.js → mcp-reconnect-iPZPihwX.js} +1 -1
- package/dist/public/{memory-storage-BkoMlxOr.js → memory-storage-2m7KZ-aP.js} +1 -1
- package/dist/public/{model-ranking-CK0iBo3Z.js → model-ranking-BgOSaNIy.js} +1 -1
- package/dist/public/{move-group-entry-CTxoq7lw.js → move-group-entry-QQ9Hkk54.js} +1 -1
- package/dist/public/{orchestrator-BrDjQbGf.js → orchestrator-C1kaTltu.js} +2 -2
- package/dist/public/orchestrator-Li1UAsv7.js +63 -0
- package/dist/public/{peerjs-CgF4Iz5W.js → peerjs-DbBryE-9.js} +1 -1
- package/dist/public/{process-peer-query-param-BL2k0Hu-.js → process-peer-query-param-DQIgr3KL.js} +1 -1
- package/dist/public/{process-pending-shared-payloads-C1AgGvn8.js → process-pending-shared-payloads-Ctb-TFqB.js} +1 -1
- package/dist/public/{process-room-query-param-DM0QCq3_.js → process-room-query-param-F-XnIVoZ.js} +1 -1
- package/dist/public/provider-YPZmsuHR.js +1 -0
- package/dist/public/{push-client-DJEOz7bi.js → push-client-DRx9Eggz.js} +1 -1
- package/dist/public/{rooms-C6LXIJl4.js → rooms-BurBI7is.js} +1 -1
- package/dist/public/service-worker/init.js +1 -1
- package/dist/public/service-worker.js +1 -1
- package/dist/public/shadow-claw-Bg9AQ5x_.js +1176 -0
- package/dist/public/{shadow-claw-accounts--4hd_oCz.js → shadow-claw-accounts-B3mjYI0M.js} +1 -1
- package/dist/public/{shadow-claw-card-IbNlZAdK.js → shadow-claw-card-tcXRS1GF.js} +1 -1
- package/dist/public/{shadow-claw-channels-Vq_pPGa2.js → shadow-claw-channels-BiSfLvWv.js} +1 -1
- package/dist/public/{shadow-claw-chat-D7_GS25e.js → shadow-claw-chat-N5jMsXZZ.js} +3 -3
- package/dist/public/{shadow-claw-control-plane-WTMEV8_p.js → shadow-claw-control-plane-DFVe_Xdq.js} +2 -2
- package/dist/public/{shadow-claw-conversations-CLQgU1IT.js → shadow-claw-conversations-wAR06_ya.js} +1 -1
- package/dist/public/{shadow-claw-empty-state-D4CrFGsN.js → shadow-claw-empty-state-CnPm3NVM.js} +1 -1
- package/dist/public/{shadow-claw-file-viewer-BhqiqLWQ.js → shadow-claw-file-viewer-sZN_FCDW.js} +4 -4
- package/dist/public/{shadow-claw-files-senDiG9l.js → shadow-claw-files-CnvkCbd4.js} +2 -2
- package/dist/public/{shadow-claw-git-DOOCqY23.js → shadow-claw-git-BBHfClGk.js} +2 -2
- package/dist/public/{shadow-claw-integrations-Bsvc3Agq.js → shadow-claw-integrations-DvdBqzRJ.js} +1 -1
- package/dist/public/{shadow-claw-llm-actYICAk.js → shadow-claw-llm-YfohG519.js} +2 -2
- package/dist/public/{shadow-claw-mcp-remote-BYUgrK3v.js → shadow-claw-mcp-remote-BAVbf5pi.js} +1 -1
- package/dist/public/{shadow-claw-networking-Dk3p5Ny_.js → shadow-claw-networking-CZ4LWPW7.js} +1 -1
- package/dist/public/{shadow-claw-notifications-CzPAlay8.js → shadow-claw-notifications-BHwyREkG.js} +1 -1
- package/dist/public/{shadow-claw-page-header-CjJpVkyL.js → shadow-claw-page-header-De6Qf6eY.js} +1 -1
- package/dist/public/{shadow-claw-page-header-action-button-2DH5O1TD.js → shadow-claw-page-header-action-button-FSOhTc9z.js} +1 -1
- package/dist/public/{shadow-claw-pages-3r5I-wI8.js → shadow-claw-pages-D_oPyDca.js} +6 -6
- package/dist/public/{shadow-claw-pdf-viewer-BiCEwsoY.js → shadow-claw-pdf-viewer-CrU4wqRq.js} +1 -1
- package/dist/public/{shadow-claw-settings-DgB9RSZN.js → shadow-claw-settings-DkUhvxVr.js} +2 -2
- package/dist/public/{shadow-claw-storage-JB_43nd8.js → shadow-claw-storage-D0o56Tjw.js} +1 -1
- package/dist/public/{shadow-claw-task-server-oi5UIxdA.js → shadow-claw-task-server-4rkroO9K.js} +1 -1
- package/dist/public/{shadow-claw-tasks-CnyiOt81.js → shadow-claw-tasks-BdP7lmvu.js} +3 -3
- package/dist/public/{shadow-claw-terminal-BC3RynHt.js → shadow-claw-terminal-DVHX7Fsu.js} +1 -1
- package/dist/public/{shadow-claw-toast-YjG--2Za.js → shadow-claw-toast-B9Y9tSkW.js} +1 -1
- package/dist/public/{shadow-claw-tools-Bbwk4vlT.js → shadow-claw-tools-BwwY53Lr.js} +1 -1
- package/dist/public/{shadow-claw-webvm-HZqzl2H5.js → shadow-claw-webvm-CXGdkCNM.js} +1 -1
- package/dist/public/{sync-web-mcp-registration-BaH2nAP0.js → sync-web-mcp-registration-DVK_IhXZ.js} +1 -1
- package/dist/public/{system-prompt-Dck3N8T0.js → system-prompt-BmswoQwF.js} +2 -2
- package/dist/public/{tools-DHA1dK2I.js → tools-D-52Zmfc.js} +1 -1
- package/dist/public/{transformers-C-DuTM2K.js → transformers-CQ9ss9rD.js} +1 -1
- package/dist/public/{upload-group-file-Cejr3zo1.js → upload-group-file-A8kB7lvO.js} +1 -1
- package/dist/public/{webmcp-CMRtu57-.js → webmcp-DIUZjVF5.js} +1 -1
- package/dist/public/{workbox-92eae37e.js → workbox-e4022e15.js} +1 -1
- package/dist/public/{write-group-file-CmJuVQNO.js → write-group-file-R67DjJ-q.js} +1 -1
- package/dist/public/{write-group-file-bytes-Cejr3zo1.js → write-group-file-bytes-A8kB7lvO.js} +1 -1
- package/dist/public/{zip-reader-CuQ13eLe.js → zip-reader-JHoTbATw.js} +1 -1
- package/dist/server.js +6 -6
- package/package.json +1 -1
- package/dist/cli/chunk-2gZFafgY.js +0 -1
- package/dist/cli/chunk-BFziiMKt.js +0 -7
- package/dist/cli/chunk-BM3llsxb.js +0 -1
- package/dist/cli/chunk-BUNoeMKY.js +0 -36
- package/dist/cli/chunk-Bj5qFsDi.js +0 -7
- package/dist/cli/chunk-Bj95zm-y.js +0 -1
- package/dist/cli/chunk-BpyP-esT.js +0 -1
- package/dist/cli/chunk-CX696s3_.js +0 -1
- package/dist/cli/chunk-DRxCrCAA.js +0 -139
- package/dist/cli/chunk-DjbCHa0h.js +0 -1
- package/dist/cli/chunk-Ds5-K-9o.js +0 -1
- package/dist/cli/chunk-DsQhAF31.js +0 -1
- package/dist/cli/chunk-VM-dECyG.js +0 -1
- package/dist/cli/chunk-gvNsvav0.js +0 -225
- package/dist/cli/chunk-heu2xRw1.js +0 -1
- package/dist/lib/orchestrator-i_QJ-o22.js.map +0 -1
- package/dist/lib/shadow-claw-DoQ7fgl5.js.map +0 -1
- package/dist/lib/system-prompt-DT_KeYaL.js.map +0 -1
- package/dist/public/app-routes-V_-URXc5.js +0 -1
- package/dist/public/attachment-capabilities-B6ibLwQB.js +0 -1
- package/dist/public/compact-context-CX4H8V57.js +0 -5
- package/dist/public/config-C-YdSFZB.js +0 -1
- package/dist/public/get-group-dir-DL44kvqW.js +0 -1
- package/dist/public/init-control-plane-BoJijVtf.js +0 -1
- package/dist/public/orchestrator-CaUpEVkQ.js +0 -63
- package/dist/public/provider-DNIL4-Hw.js +0 -1
- package/dist/public/shadow-claw-DdgeYPg5.js +0 -1176
package/dist/headless-agent.js
CHANGED
|
@@ -138,7 +138,7 @@ As=Object.defineProperty,js=(e,t,n)=>t in e?As(e,t,{enumerable:!0,configurable:!
|
|
|
138
138
|
(id, groupId, enabled, schedule, prompt, tools, lastRun, createdAt, type, freshContext, subagent, name, task_order, pushNotifications)
|
|
139
139
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`);for(let e of i)a.run(cc(),n,+!!e.enabled,e.schedule??null,e.prompt??``,e.tools??null,e.lastRun??null,e.createdAt,e.type??null,e.freshContext?1:null,e.subagent?1:null,e.name??null,e.task_order??null,e.pushNotifications?1:null);return Promise.resolve(i.length)}return new Promise((r,i)=>{let a=e?.transaction(`tasks`,`readwrite`);if(!a)throw Error(`failed to get transaction, cannot clone tasks.`);let o=a.objectStore(`tasks`),s=o.index(`by-group`).openCursor(t),c=0;s.onsuccess=()=>{let e=s.result;if(e){let t={...e.value,id:cc(),groupId:n};o.put(t),c++,e.continue()}else r(c)},s.onerror=()=>i(s.error)})}var Eee=k((()=>{hc(),zt()}));function gc(e,t){return Ht(e,`messages`,`readwrite`,e=>e.delete(t)).then(()=>void 0)}var _c=k((()=>{Ut()}));function vc(e,t){return t?Ht(e,`tasks`,`readwrite`,e=>e.delete(t)).then(()=>void 0):Promise.reject(/* @__PURE__ */ Error(`Task ID is required for deletion.`))}var yc=k((()=>{Ut()}));function bc(e){return Ht(e,`tasks`,`readonly`,e=>e.getAll()).then(e=>e.map(e=>({...e,enabled:!!e.enabled})))}var xc=k((()=>{Ut()}));function Sc(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`sub-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}async function Cc(e){if(!e)return Sc();let t=await R(e,L.SUBSCRIBER_ID);if(typeof t==`string`&&t.trim().length>0)return t;let n=Sc();return await B(e,L.SUBSCRIBER_ID,n),n}var wc=k((()=>{Ot(),Gt(),Wo()}));function Tc(e,t,n){let r=null,i,a;return typeof e==`string`?(i=e,a=t):(r=e,i=t,a=n??50),r&&Lt(r)?Promise.resolve().then(()=>(r.db.prepare(`SELECT * FROM messages WHERE groupId = ? ORDER BY timestamp DESC LIMIT ?`).all(i,a)??[]).reverse().map(Ec)):new Promise(async(e,t)=>{try{let n=r??await At();if(!n)return t(/* @__PURE__ */ Error(`failed to get transaction, cannot get recent messages.`));let o=n.transaction(`messages`,`readonly`);if(!o)return t(/* @__PURE__ */ Error(`failed to get transaction`));let s=o.objectStore(`messages`).index(`by-group-time`),c=IDBKeyRange.bound([i,0],[i,1/0]),l=s.openCursor(c,`prev`),u=[];l.onsuccess=()=>{let t=l.result;t&&u.length<a?(u.push(t.value),t.continue()):e(u.reverse())},l.onerror=()=>t(l.error)}catch(e){t(e)}})}function Ec(e){return{...e,isFromMe:!!e.isFromMe,isTrigger:!!e.isTrigger,attachments:e.attachments?JSON.parse(e.attachments):void 0,a2uiAction:e.a2uiAction?JSON.parse(e.a2uiAction):void 0,a2uiEnvelopes:e.a2uiEnvelopes?JSON.parse(e.a2uiEnvelopes):void 0}}var Dc=k((()=>{It(),zt()}));async function Oc(e){let t=await R(e,Bc);if(!t)return[];try{return JSON.parse(t)}catch{return[]}}async function kc(e,t){await B(e,Bc,JSON.stringify(t))}async function Ac(e,t,n=`br:`,r){let i=await Oc(e),a={groupId:`${n}${r??cc()}`,name:t,createdAt:Date.now()};return i.push(a),await kc(e,i),a}async function jc(e,t,n){let r=await Oc(e),i=r.find(e=>e.groupId===t);i&&(i.name=n),await kc(e,r)}async function Mc(e,t,n){let r=await Oc(e),i=r.find(e=>e.groupId===t);i&&(n&&n.length>0?i.toolTags=n:delete i.toolTags),await kc(e,r)}async function Nc(e,t){await kc(e,(await Oc(e)).filter(e=>e.groupId!==t))}async function Pc(e){let t=await Oc(e);if(t.length===0){let t={groupId:dt,name:`Main`,createdAt:0};return await kc(e,[t]),[t]}return t}async function Fc(e,t){let n=await Oc(e),r=new Map(n.map(e=>[e.groupId,e])),i=[];for(let e of t){let t=r.get(e);t&&(i.push(t),r.delete(e))}for(let e of n)r.has(e.groupId)&&i.push(e);await kc(e,i)}async function Ic(e,t){let n=await Oc(e),r=n.find(e=>e.groupId===t);if(!r)return null;let i=t.indexOf(`:`),a={groupId:`${i>=0?t.slice(0,i+1):`br:`}${cc()}`,name:`${r.name} (copy)`,createdAt:Date.now(),pinnedMaxTokens:r.pinnedMaxTokens,providerRuntimeOverrides:r.providerRuntimeOverrides?JSON.parse(JSON.stringify(r.providerRuntimeOverrides)):void 0,subagentModelSelectionMode:r.subagentModelSelectionMode,subagentMaxTokens:r.subagentMaxTokens,subagentPinnedProvider:r.subagentPinnedProvider,subagentPinnedModel:r.subagentPinnedModel,subagentFastProvider:r.subagentFastProvider,subagentFastModel:r.subagentFastModel,subagentSmartProvider:r.subagentSmartProvider,subagentSmartModel:r.subagentSmartModel,subagentPowerfulProvider:r.subagentPowerfulProvider,subagentPowerfulModel:r.subagentPowerfulModel,toolTags:r.toolTags?[...r.toolTags]:void 0};return n.push(a),await kc(e,n),a}async function Lc(e,t,n,r,i){let a=await Oc(e),o=a.find(e=>e.groupId===t);o&&(n?o.pinnedProvider=n:delete o.pinnedProvider,r?o.pinnedModel=r:delete o.pinnedModel,typeof i==`number`&&Number.isFinite(i)&&i>0?o.pinnedMaxTokens=Math.floor(i):delete o.pinnedMaxTokens),await kc(e,a)}async function Rc(e,t,n,r,i,a){let o=await Oc(e),s=o.find(e=>e.groupId===t);s&&(s.subagentModelSelectionMode=n,n===`manual`?(r?s.subagentPinnedProvider=r:delete s.subagentPinnedProvider,i?s.subagentPinnedModel=i:delete s.subagentPinnedModel):(delete s.subagentPinnedProvider,delete s.subagentPinnedModel),typeof a==`number`&&Number.isFinite(a)&&a>0?s.subagentMaxTokens=Math.floor(a):delete s.subagentMaxTokens),await kc(e,o)}async function zc(e,t,n){let r=await Oc(e),i=r.find(e=>e.groupId===t);i&&(n&&Object.keys(n).length>0?i.providerRuntimeOverrides=JSON.parse(JSON.stringify(n)):delete i.providerRuntimeOverrides),await kc(e,r)}var Bc,Vc=k((()=>{Ot(),Gt(),Wo(),hc(),Bc=`group_metadata`}));function Hc(e,t){return Ht(e,`messages`,`readwrite`,e=>e.put(t)).then(()=>void 0)}var Uc=k((()=>{Ut()}));function Wc(e,t){let n={...t,enabled:+!!t.enabled};return Ht(e,`tasks`,`readwrite`,e=>e.put(n)).then(()=>void 0)}var Gc=k((()=>{Ut()}));function Kc(e,t,n){let r=null,i,a;return typeof e==`string`?(i=e,a=t):(r=e,i=t,a=n),r&&Lt(r)?Promise.resolve().then(()=>{r.db.prepare(`UPDATE tasks SET lastRun = ? WHERE id = ?`).run(a,i)}):new Promise(async(e,t)=>{try{let n=r??await At();if(!n)return t(/* @__PURE__ */ Error(`failed to get transaction, cannot update task last run.`));let o=n.transaction(`tasks`,`readwrite`);if(!o)return t(/* @__PURE__ */ Error(`failed to get transaction`));let s=o.objectStore(`tasks`),c=s.get(i);c.onsuccess=()=>{let n=c.result;if(!n){e();return}n.lastRun=a;let r=s.put(n);r.onsuccess=()=>e(),r.onerror=()=>t(r.error)},c.onerror=()=>t(c.error)}catch(e){t(e)}})}var Dee=k((()=>{It(),zt()}));async function Oee(e,t,n){let r=(await bc(e)).filter(e=>e.groupId===t),i=new Map(r.map(e=>[e.id,e])),a=[],o=0;for(let t of n){let n=i.get(t);n&&(n.order=o++,await Wc(e,n),a.push(n),i.delete(t))}let s=Array.from(i.values()).sort((e,t)=>{let n=e.order??0,r=t.order??0;return n===r?e.createdAt-t.createdAt:n-r});for(let t of s)t.order=o++,await Wc(e,t),a.push(t);return a}var kee=k((()=>{xc(),Gc()}));async function Aee(e,t,n,r){let i=await En(e,t),a=await En(e,n),o=r.replace(/\\/g,`/`).replace(/^\/+/,``).split(`/`).filter(Boolean),s=i,c=a;for(let e of o)s=await s.getDirectoryHandle(e),c=await c.getDirectoryHandle(e,{create:!0});let l=n.replace(/:/g,`-`),u=[gn(),`groups`,l,...o];try{await qc(e,n,s,c,u)}catch(e){throw o.length>0&&await a.removeEntry(o[0],{recursive:!0}).catch(()=>void 0),e}}async function qc(e,t,n,r,i){for await(let[a,o]of n.entries()){if(o.kind===`directory`){await qc(e,t,o,await r.getDirectoryHandle(a,{create:!0}),[...i,a]);continue}let n=await o.getFile(),s=await r.getFileHandle(a,{create:!0});try{await Ro(s,n)}catch(t){if(!((t instanceof Error?t.message:String(t)).includes(`Writable file streams are not supported`)&&(await Cn(e)).type===`opfs`))throw t;await zo([...i,a],n)}}}var jee=k((()=>{Dn(),Tn(),Vo()}));async function Jc(e,t,n=`.`){for(let r=0;r<2;r++)try{let r=await En(e,t);if(n&&n!==`.`){let e=n.replace(/\\/g,`/`).replace(/^\/home\/user\//,`/`).replace(/^\/+/,``).split(`/`).filter(Boolean);for(let t of e){let e=await r.getDirectoryHandle(t);if(typeof r.isSameEntry==`function`&&await r.isSameEntry(e))throw Error(`Directory navigation stuck at "${r.name}" for segment "${t}" — the stored directory handle may be stale.`);r=e}}let i=[];for await(let[e,t]of r.entries())i.push(t.kind===`directory`?`${e}/`:e);return i.sort()}catch(e){if(r===0&&Sn(e)){xn();continue}throw e}return[]}var Yc=k((()=>{Dn(),Tn()}));function Mee(e){if(!e||typeof e!=`object`)return!1;let t=globalThis.FileSystemDirectoryHandle;return t!==void 0&&e instanceof t||typeof e.getDirectoryHandle==`function`&&typeof e.getFileHandle==`function`&&typeof e.requestPermission==`function`}async function Nee(e){let t=await R(e,L.STORAGE_HANDLE);return!Mee(t)||await t.requestPermission({mode:`readwrite`})===`granted`}var Pee=k((()=>{Ot(),Gt()}));function Xc(e){let t=j();return t?`shadowclaw:${t}:${e}`:e}function Fee(e){if(typeof localStorage>`u`)return null;let t=Xc(e);try{let n=localStorage.getItem(t);if(n!==null)return n;if(t===e)return null;let r=localStorage.getItem(e);if(r!==null)return localStorage.setItem(t,r),r}catch(e){console.warn(`Unable to read from localStorage:`,e)}return null}function Zc(e,t){if(typeof localStorage>`u`)return;let n=Xc(e);try{localStorage.setItem(n,t)}catch(e){console.warn(`Unable to write to localStorage:`,e)}}var Iee=k((()=>{Ye()}));async function Qc(e,t){let n=await En(e,t);for await(let[e]of n.entries())await n.removeEntry(e,{recursive:!0})}var Lee=k((()=>{Dn()}));async function $c(e,t,n){let r=await En(e,t),{dirs:i,filename:a}=ii(n.replace(/\/$/,``)),o=r;for(let e of i)o=await o.getDirectoryHandle(e);await o.removeEntry(a,{recursive:!0})}var el=k((()=>{Dn(),ai()}));function tl(e,t){return`${e}:${t}`}async function nl(e){let t=await R(e,L.SUPPRESSED_PAGES_LIST);if(!t||typeof t!=`string`)return[];try{let e=JSON.parse(t);if(Array.isArray(e))return e}catch{}return[]}async function rl(e,t,n){let r=await nl(e),i=tl(t,n);return r.some(e=>tl(e.groupId,e.path)===i)}async function il(e,t,n){let r=await nl(e),i=tl(t,n);if(!r.some(e=>tl(e.groupId,e.path)===i)){let i=[...r,{groupId:t,path:n}];await B(e,L.SUPPRESSED_PAGES_LIST,JSON.stringify(i))}}async function al(e,t,n){let r=await nl(e),i=tl(t,n),a=r.filter(e=>tl(e.groupId,e.path)!==i);a.length!==r.length&&await B(e,L.SUPPRESSED_PAGES_LIST,JSON.stringify(a))}var ol=k((()=>{Ot(),Gt(),Wo()}));function sl(e){return Array.from(new Set(e.map(e=>e.trim()).filter(Boolean)))}var cl=k((()=>{}));function ll(e){let t=e.trim().replace(/\\/g,`/`);return t===`/`||/^\/+$/.test(t)?`/`:t.replace(/^\/+/,``).replace(/\/+$/,``)}function ul(e){return e===`/`?`/`:e.replace(vl,``)}function dl(e){let t=e.trim().replace(/\\/g,`/`);return t===`/`||/^\/+$/.test(t)?`/`:t.replace(/^\/+/,``).replace(/\/+$/,``)}function fl(e){return e?e.replace(/^br:/i,``).replace(/^br-/i,``).trim():`main`}function pl(e,t){let n=dl(t);if(!n)return;e.add(n);let r=ul(n);r&&r!==n&&e.add(r)}function ml(e,t,n){let r=/* @__PURE__ */ new Set;if(!e)return r;let i=fl(t);if(e===`/`){if(r.add(`/`),pl(r,`index.html`),n){let e=ll(n);e&&e!==`/`&&pl(r,`${e}/index.html`)}return pl(r,`pages/index.html`),pl(r,`pages/${i}/index.html`),pl(r,`${i}/index.html`),r}if(pl(r,e),n){let t=ll(n);t&&t!==`/`&&pl(r,`${t}/${e}`)}if(e.startsWith(`pages/`)){let t=e.slice(6);pl(r,t),t.startsWith(`${i}/`)?pl(r,t.slice(`${i}/`.length)):pl(r,t.replace(/^[^/]+\//,``))}else pl(r,`pages/${e}`),pl(r,`pages/${i}/${e}`),pl(r,`${i}/${e}`);for(let e of Array.from(r)){let t=ul(e);if(e===`index.html`||t===`index`){r.add(`/`);break}}return r}function hl(e,t){let n=t.toLowerCase(),r=ul(t).toLowerCase(),i=n===r?[n]:[n,r];for(let t of e){let e=t.toLowerCase(),n=ul(e);for(let t of i)if(t&&(e===t||n===t||t!==`/`&&(e.startsWith(`${t}/`)||n.startsWith(`${t}/`)||e.endsWith(`/${t}`)||n.endsWith(`/${t}`)||e.includes(`/${t}/`)||n.includes(`/${t}/`))))return!0}return!1}function gl(e,t){for(let n of t){let t=ll(n);if(t&&hl(e,t))return!0}return!1}function _l(e,t,n,r){if(!e||typeof e!=`string`)return!1;let i=dl(e);if(!i)return!1;let a=[],o=[],s,c;if(t&&typeof t==`object`&&!Array.isArray(t)){let e=t,n=e.allowList??e.allowlist??[],r=e.denyList??e.denylist??[];a=sl(Array.from(n||[])),o=sl(Array.from(r||[])),s=e.groupId,c=e.basePathPrefix}else a=sl(Array.from(t||[])),o=sl(Array.from(n||[])),s=r?.groupId,c=r?.basePathPrefix;let l=ml(i,s,c);return o.length>0&&gl(l,o)?!1:a.length>0?gl(l,a):!0}var vl,yl=k((()=>{cl(),vl=/\.(md|markdown|html|xhtml|txt)$/i}));function bl(e){if(!e)return``;let t=e.match(/^\r?\n([ \t]+)/);if(t){let n=t[1],r=RegExp(`^[ \\t]{1,${n.length}}`,`gm`);return e.replace(/^\r?\n/,``).replace(r,``).replace(/\r?\n[ \t]*$/,`
|
|
140
140
|
`)}if(/^(?:\r?\n)+[ \t]*---/.test(e))return e.replace(/^(?:\r?\n)+/,``);if(/^[ \t]+---/.test(e)){let t=e.match(/^[ \t]+/);if(t){let n=t[0],r=RegExp(`^[ \\t]{1,${n.length}}`,`gm`);return e.replace(r,``)}}return e}var xl=k((()=>{}));function Sl(e=dt){return e===`br:main`?L.STATIC_MAIN_SITE_SEEDED:`${L.STATIC_MAIN_SITE_SEEDED}:${e}`}async function Cl(e,t=dt){let n=await R(e,Sl(t));return n===!0||n===`true`}async function wl(e,t=dt,n=!0){await B(e,Sl(t),n)}function Tl(){let e=Ge(`/${Hl}`);if(typeof window<`u`&&window.location?.origin)try{return new URL(e,window.location.origin).toString()}catch{return e}return e}function El(e){let t=e.replace(/^\/+/,``),n=Ul;if(typeof document<`u`)try{let e=document.getElementById(`shadow-claw-site-config`);if(e?.textContent){let t=JSON.parse(e.textContent);typeof t?.pages?.baseUrl==`string`&&(n=t.pages.baseUrl.replace(/^\/+/,``).replace(/\/+$/,``))}}catch{}let r=Ge(n?`/${n}/${t}`:`/${t}`);if(typeof window<`u`&&window.location?.origin)try{return new URL(r,window.location.origin).toString()}catch{return r}return r}async function Dl(){if(typeof fetch!=`function`)return null;try{let e=Tl(),t=await fetch(e);if(t.ok){if((t.headers?.get?.(`content-type`)||``).includes(`text/html`))return null;let e=await t.json();if(e&&Array.isArray(e.pages))return e}}catch{}return null}async function Ol(e){if(typeof fetch!=`function`)return null;try{let t=El(e),n=await fetch(t);if(n.ok){let t=n.headers?.get?.(`content-type`)||``;if((e.endsWith(`.md`)||e.endsWith(`.markdown`)||e.endsWith(`.json`))&&t.includes(`text/html`))return null;let r=await n.text();return r.includes(`<shadow-claw`)||r.includes(`data-shadow-claw-dsd`)?null:r}}catch{}return null}function kl(e){if(typeof document>`u`)return null;let t=t=>{if(!t||!(t instanceof HTMLElement))return!1;if(!e)return!0;let n=t.getAttribute(`data-initial-path`)?.trim();return!n||n===e},n=document.querySelector(e?`[data-pages-rendered][data-initial-path="${e}"]`:`[data-pages-rendered]`);if(t(n))return n;let r=document.querySelector(`shadow-claw`)?.shadowRoot,i=(r?.querySelector(`shadow-claw-pages`)?.shadowRoot)?.querySelector(e?`[data-pages-rendered][data-initial-path="${e}"]`:`[data-pages-rendered]`)||r?.querySelector(e?`[data-pages-rendered][data-initial-path="${e}"]`:`[data-pages-rendered]`);if(t(i))return i;let a=document.querySelectorAll(`template`);for(let n of Array.from(a)){let r=n.content?.querySelector(e?`[data-pages-rendered][data-initial-path="${e}"]`:`[data-pages-rendered]`);if(t(r))return r;let i=n.content?.querySelectorAll(`template`);if(i)for(let n of Array.from(i)){let r=n.content?.querySelector(e?`[data-pages-rendered][data-initial-path="${e}"]`:`[data-pages-rendered]`);if(t(r))return r}}return null}function Al(e=`index.html`){let t=kl(e);if(!t)return null;let n=t.getAttribute(`data-initial-path`)?.trim();if(n&&n!==e)return null;let r=t.querySelector(`[data-markdown-frontmatter]`),i=null;if(r){let e=r.getAttribute(`data-frontmatter`);if(e)try{i=JSON.parse(e)}catch{}}let a=t.cloneNode(!0),o=a.querySelector(`[data-markdown-frontmatter]`);o&&o.remove();let s=a.innerHTML.trim();if(!s&&!i)return null;if(i&&Object.keys(i).length>0){let e=[`---`];for(let[t,n]of Object.entries(i))typeof n==`string`?e.push(`${t}: ${JSON.stringify(n)}`):typeof n==`number`||typeof n==`boolean`?e.push(`${t}: ${n}`):e.push(`${t}: ${JSON.stringify(n)}`);return e.push(`---`,``),`${e.join(`
|
|
141
|
-
`)}\n${s}`}return s}async function jl(e={}){let t=()=>{let e=null;if(typeof document<`u`){let t=document.getElementById(`shadow-claw-static-manifest`);if(t&&t.textContent)try{let n=JSON.parse(t.textContent);n&&Array.isArray(n.pages)&&(e={...n,pages:[...n.pages]})}catch(e){console.warn(`Failed to parse embedded static main manifest:`,e)}let n=document.querySelectorAll(`script[type="text/markdown"][data-shadow-claw-page]`);if(n.length>0){e||={pages:[]};for(let t of Array.from(n)){let n=t.getAttribute(`data-shadow-claw-page`)?.trim();if(n){let r=t.textContent||``;r=bl(r),!r.trim()&&/^memory\.(md|markdown)$/iu.test(n)&&(r=Go),!r.trim()&&(n===`index.html`||/^index\.(html?|xhtml)$/iu.test(n))&&(r=Al(n)??is);let i=e.pages.findIndex(e=>e.displayPath===n);i>=0?e.pages[i].content=r:e.pages.push({displayPath:n,content:r})}}}let r=document.getElementById(`shadow-claw-site-config`);if(r?.textContent)try{let t=JSON.parse(r.textContent);if(Array.isArray(t?.pages?.files)){e||={pages:[]};for(let n of t.pages.files)if(typeof n==`string`&&n.trim()){let t=n.trim(),r=``;/^memory\.(md|markdown)$/iu.test(t)?r=Go:(t===`index.html`||/^index\.(html?|xhtml)$/iu.test(t))&&(r=Al(t)??is),e.pages.some(e=>e.displayPath===t)||e.pages.push({displayPath:t,content:r})}}}catch{}let i=kl();if(i){e||={pages:[]};let t=i.getAttribute(`data-initial-path`)?.trim()||`index.html`;if(!e.pages.some(e=>e.displayPath===t)){let n=Al(t)??is;e.pages.push({displayPath:t,content:n})}e.pages.some(e=>/^memory\.(md|markdown)$/iu.test(e.displayPath))||e.pages.push({displayPath:`MEMORY.md`,content:Go})}}return e};if(e.preferEmbedded!==!1){let e=t();if(e)return e}if(e.fetchFallback!==!1){let e=await Dl();if(e)return e}if(e.preferEmbedded===!1){let e=t();if(e)return e}return{pages:[{displayPath:`index.html`,content:is},{displayPath:`MEMORY.md`,content:Go}]}}async function Ml(e,t,n=[]){for(let[r,i]of Object.entries(t))if(r===`purgePreRenderedStaticPages`&&i===!0){if(n.length>0){let t=n[0],r=n.slice(1).join(`/`);try{r?await $c(e,t,r):await Qc(e,t)}catch(e){console.warn(`Failed to purge pre-rendered static pages for ${t}/${r}:`,e)}}}else typeof i==`object`&&i&&await Ml(e,i,[...n,r])}function Nl(){if(typeof document<`u`)try{let e=document.getElementById(`shadow-claw-site-config`);if(e?.textContent){let t=JSON.parse(e.textContent);if(t?.pages?.sortOrder===`desc`)return`desc`;if(t?.pages?.sortOrder===`asc`)return`asc`}}catch{}return`desc`}function Pl(){if(typeof document<`u`)try{let e=document.getElementById(`shadow-claw-site-config`);if(e?.textContent){let t=JSON.parse(e.textContent)?.pages?.defaultPinnedPage;if(typeof t==`string`&&t.trim().length>0)return t.trim()}}catch{}return null}function Fl(){if(typeof document<`u`)try{let e=document.getElementById(`shadow-claw-site-config`);if(e?.textContent){let t=JSON.parse(e.textContent);return{allowList:sl(t?.pages?.allowList??t?.pages?.allowlist??t?.allowList??t?.allowlist??[]),denyList:sl(t?.pages?.denyList??t?.pages?.denylist??t?.denyList??t?.denylist??[])}}}catch{}return{allowList:[],denyList:[]}}function Il(e,t){let n=t??Nl();return[...e].sort((e,t)=>{let r=e.path,i=t.path,a=r.split(`/`).pop()||``,o=i.split(`/`).pop()||``,s=/^index\.(html?|xhtml)$/iu.test(a),c=/^index\.(html?|xhtml)$/iu.test(o);if(s&&!c)return-1;if(!s&&c)return 1;let l=/^memory\.(md|markdown)$/iu.test(a),u=/^memory\.(md|markdown)$/iu.test(o);return l&&!u?1:!l&&u?-1:n===`asc`?r.localeCompare(i,void 0,{numeric:!0,sensitivity:`base`}):i.localeCompare(r,void 0,{numeric:!0,sensitivity:`base`})})}async function Ll(e,t,n=zl,r=Bl){let i=t??Vl;try{if(Fee(n)===i)return!0}catch{}try{if(await R(e,r)===i){try{Zc(n,i)}catch{}return!0}await B(e,r,i);try{Zc(n,i)}catch{}}catch{try{Zc(n,i)}catch{}}return!1}async function Rl(e,t=dt,n=[],r={}){await ls(e,t);let i=await jl(r),a=!1;i.preRenderedStaticPages&&(await Ll(e,i.purgeId)||(a=!0,await Ml(e,i.preRenderedStaticPages)));let o=!1;if(t===`br:main`&&i.skillsPurgeId!==void 0&&!await Ll(e,i.skillsPurgeId,`sc:skills-purge-id`,`static_main_skills_purge_id`)){o=!0;try{await $c(e,t,`.agents/skills/main`)}catch(e){if(!(e&&typeof e==`object`&&`name`in e&&e.name===`NotFoundError`))throw e}try{await $c(e,t,`.agents/tools/main`)}catch(e){if(!(e&&typeof e==`object`&&`name`in e&&e.name===`NotFoundError`))throw e}}for(let n of i.pages)if(n.content?.includes(`slug: "shadow-claw--purge-pages"`)){!a&&!await Ll(e,i.purgeId)&&(a=!0,await Qc(e,t));break}let s=t===`br:main`&&await Qo(e),c=new Set(i.pages.map(e=>tl(t,e.displayPath))),l=a?n.filter(e=>e.groupId!==t||c.has(tl(e.groupId,e.path))):[...n],{allowList:u,denyList:d}=Fl(),f=0;for(let n of i.pages)if(f++,f%5==0&&await new Promise(e=>setTimeout(e,0)),!n.content?.includes(`slug: "shadow-claw--purge-pages"`)&&_l(n.displayPath,{allowList:u,denyList:d,groupId:t})){if(/^memory\.(md|markdown)$/iu.test(n.displayPath)){if(s)continue;let r=typeof n.content==`string`&&n.content.trim().length>0&&n.content!==Go?n.content:void 0;if(r===void 0?await es(e,t):await es(e,t,r)){let e=tl(t,n.displayPath);l.some(t=>tl(t.groupId,t.path)===e)||l.push({groupId:t,path:n.displayPath})}}else if(!await rl(e,t,n.displayPath))try{if(!await Yo(e,t,n.displayPath)){let r=n.content;(typeof r!=`string`||!r.trim())&&(r=n.displayPath===`index.html`?Al(`index.html`)??is:await Ol(n.displayPath)??``),await Ho(e,t,n.displayPath,r)}let r=tl(t,n.displayPath);l.some(e=>tl(e.groupId,e.path)===r)||l.push({groupId:t,path:n.displayPath})}catch(e){console.warn(`Failed to seed static page file ${n.displayPath}:`,e)}}if(t===`br:main`){for(let n of i.skills||[]){let r=`.agents/skills/main/${n.displayPath}`;try{await Yo(e,t,r)||await Ho(e,t,r,n.content)}catch(e){console.warn(`Failed to seed skill file ${r}:`,e)}}for(let n of i.tools||[]){let r=`.agents/tools/main/${n.displayPath}`;try{(o||!await Yo(e,t,r))&&await Ho(e,t,r,n.content)}catch(e){console.warn(`Failed to seed tool file ${r}:`,e)}}}let p=typeof document<`u`&&(document.getElementById(`shadow-claw-static-manifest`)!==null||document.querySelector(`script[type="text/markdown"][data-shadow-claw-page]`)!==null||kl()!==null);r.preferEmbedded!==!1&&p||await wl(e,t,!0);let m=l.filter(e=>_l(e.path,{allowList:u,denyList:d,groupId:e.groupId}));return Object.defineProperty(m,"didPurge",{value:a,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(m,"didPurgeSkills",{value:o,enumerable:!1,writable:!0,configurable:!0}),Il(m)}var zl,Bl,Vl,Hl,Ul,Wl=k((()=>{Ot(),Iee(),as(),Ko(),Ye(),Gt(),Wo(),Lee(),el(),ds(),rs(),Xo(),ol(),Uo(),yl(),cl(),xl(),zl=`sc:purge-id`,Bl=`static_main_site_purge_id`,Vl=`__legacy_purge_pages__`,Hl=`static-main-manifest.json`,Ul=`static-main`})),Gl,Ree=k((()=>{hc(),Gl=class{_events;_handlers=[];_runs=/* @__PURE__ */ new Map;constructor(e){this._events=e}start(){this._listen(`streaming-start`,this._onStreamingStart),this._listen(`streaming-chunk`,this._onStreamingChunk),this._listen(`streaming-end`,this._onStreamingEnd),this._listen(`streaming-done`,this._onStreamingDone),this._listen(`streaming-error`,this._onStreamingError),this._listen(`tool-activity`,this._onToolActivity)}stop(){for(let{event:e,handler:t}of this._handlers)this._events.off(e,t);this._handlers=[],this._runs.clear()}_emit(e,t){window.dispatchEvent(new CustomEvent(`shadow-claw-agui-event`,{detail:{groupId:e,event:t}}))}_listen(e,t){this._events.on(e,t),this._handlers.push({event:e,handler:t})}_onStreamingChunk=({groupId:e,text:t})=>{let n=this._runs.get(e);n&&n.messageId&&this._emit(e,{type:`TEXT_MESSAGE_CONTENT`,messageId:n.messageId,delta:t,timestamp:Date.now()})};_onStreamingDone=({groupId:e})=>{let t=this._runs.get(e);t&&(t.messageId&&this._emit(e,{type:`TEXT_MESSAGE_END`,messageId:t.messageId,timestamp:Date.now()}),this._emit(e,{type:`RUN_FINISHED`,threadId:t.threadId,runId:t.runId,timestamp:Date.now()}),this._runs.delete(e))};_onStreamingEnd=({groupId:e})=>{let t=this._runs.get(e);t&&t.messageId&&(this._emit(e,{type:`TEXT_MESSAGE_END`,messageId:t.messageId,timestamp:Date.now()}),t.messageId=null)};_onStreamingError=({groupId:e,error:t})=>{let n=this._runs.get(e);n&&(n.messageId&&this._emit(e,{type:`TEXT_MESSAGE_END`,messageId:n.messageId,timestamp:Date.now()}),this._emit(e,{type:`RUN_ERROR`,message:t||`Unknown streaming error`,timestamp:Date.now()}),this._runs.delete(e))};_onStreamingStart=({groupId:e})=>{let t=cc(),n=e,r=cc();this._runs.set(e,{runId:t,threadId:n,messageId:r,activeToolCallIds:/* @__PURE__ */ new Set}),this._emit(e,{type:`RUN_STARTED`,threadId:n,runId:t,timestamp:Date.now()}),this._emit(e,{type:`TEXT_MESSAGE_START`,messageId:r,role:`assistant`,timestamp:Date.now()})};_onToolActivity=({groupId:e,tool:t,status:n})=>{let r=this._runs.get(e);if(r){if(n===`running`){let n=cc();r.activeToolCallIds.add(n),this._emit(e,{type:`TOOL_CALL_START`,toolCallId:n,toolCallName:t,timestamp:Date.now()}),r._lastToolCallId=n}else if(n===`done`||n===`error`){let t=r._lastToolCallId;t&&(r.activeToolCallIds.delete(t),this._emit(e,{type:`TOOL_CALL_END`,toolCallId:t,timestamp:Date.now()}))}}}}})),Kl,ql,Jl,zee=k((()=>{Xs(),Kl=5,ql=class{#e=new Ys.State(0);#t=/* @__PURE__ */ new Map;#n=new Ys.State([]);clear(){this.#t.forEach((e,t)=>this.clearTimer(t)),this.#t.clear(),this.#n.set([])}clearTimer(e){let t=this.#t.get(e);t?.timeoutId&&clearTimeout(t.timeoutId),this.#t.delete(e)}dismiss(e){this.clearTimer(e),this.#n.set(this.#n.get().filter(t=>t.id!==e))}pause(e){let t=this.#t.get(e);t&&t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0,t.remaining=Math.max(0,t.remaining-(Date.now()-t.startedAt)),this.#t.set(e,t))}resolveAction(e){if(e&&typeof e.label==`string`&&typeof e.onClick==`function`)return e}resolveDuration(e){return typeof e!=`number`||Number.isNaN(e)||e<0?4e3:e}resolveType(e){return e&&[`success`,`warning`,`error`,`info`].includes(e)?e:`info`}resume(e){let t=this.#t.get(e);!t||t.timeoutId||t.remaining<=0||this.scheduleDismiss(e,t.remaining)}scheduleDismiss(e,t){this.clearTimer(e);let n=globalThis.setTimeout(()=>{this.dismiss(e)},t);this.#t.set(e,{timeoutId:n,remaining:t,startedAt:Date.now()})}show(e,t={}){let n=this.#e.get()+1;this.#e.set(n);let r={id:n,message:e,type:this.resolveType(t.type),duration:this.resolveDuration(t.duration),action:this.resolveAction(t.action),createdAt:Date.now()},i=[...this.#n.get(),r];if(i.length>Kl){let e=i[0];this.clearTimer(e.id),this.#n.set(i.slice(1))}else this.#n.set(i);return r.duration>0&&this.scheduleDismiss(r.id,r.duration),r.id}get toasts(){return this.#n.get()}async runAction(e){let t=this.#n.get().find(t=>t.id===e);t?.action&&await t.action.onClick()}},Jl=new ql}));function Yl(e,t={}){return Jl.show(e,t)}function Bee(e,t=4e3){return Jl.show(e,{type:`success`,duration:t})}function Xl(e,t=5e3){return Jl.show(e,{type:`error`,duration:t})}var Zl=k((()=>{zee()}));function Vee(e,t){if(!e||typeof e!=`object`)return e;let n=JSON.parse(JSON.stringify(e));for(let e of t)Hee(n,e);return n}function Hee(e,t){let{op:n,path:r,value:i}=t;if(!r||!r.startsWith(`/`))return;let a=r.split(`/`).slice(1).map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`)),o=a.pop();if(o===void 0)return;let s=e;for(let e of a){if(typeof s!=`object`||!s)return;s=s[e]}typeof s==`object`&&s&&(Array.isArray(s)?Uee(s,o,n,i):Wee(s,o,n,i))}function Uee(e,t,n,r){if(n===`add`){if(t===`-`)e.push(r);else{let n=parseInt(t,10);!isNaN(n)&&n>=0&&n<=e.length&&e.splice(n,0,r)}}else if(n===`replace`){let n=parseInt(t,10);!isNaN(n)&&n>=0&&n<e.length&&(e[n]=r)}else if(n===`remove`){let n=parseInt(t,10);!isNaN(n)&&n>=0&&n<e.length&&e.splice(n,1)}}function Wee(e,t,n,r){n===`add`||n===`replace`?e[t]=r:n===`remove`&&delete e[t]}var Gee=k((()=>{}));function Kee(e){if(e==null)return null;let t=String(e).trim().toLowerCase();return[`1`,`true`,`yes`,`on`].includes(t)?!0:![`0`,`false`,`no`,`off`].includes(t)&&null}function Ql(e,t=!1){if(e==null)return t;if(typeof e==`boolean`)return e;if(typeof e==`number`)return e===1;if(typeof e==`string`){let t=e.trim().toLowerCase();return t===`true`||t===`1`}return!1}var $l=k((()=>{}));function eu(e){if(!e)return[];try{let t=JSON.parse(e);if(Array.isArray(t))return sl(t.map(e=>String(e)))}catch{}return sl(e.split(`,`))}var qee=k((()=>{cl()}));function tu(e){if(typeof document>`u`)return null;let t=`shadow-claw-site-config`;if(e){let n=e.getAttribute(`config`)?.trim();n&&(t=n.replace(/^#/,``))}let n=document.getElementById(t);if(!n?.textContent)return nu.delete(t),null;let r=nu.get(t);if(r&&r.rawText===n.textContent)return r.config;try{let e=JSON.parse(n.textContent);if(!e||typeof e!=`object`)return nu.delete(t),null;let r={...e};return nu.set(t,{rawText:n.textContent,config:r}),r}catch(e){return console.warn(`[ShadowClaw] Failed to parse site configuration from #${t}:`,e),null}}var nu,Jee=k((()=>{nu=/* @__PURE__ */ new Map})),ru,Yee=k((()=>{ru={name:`bash`,description:`Execute a shell command. When WebVM is available, runs in a full Alpine Linux VM (x86) with all standard Linux commands. When WebVM is disabled or unavailable, falls back to a lightweight JavaScript shell emulator with 83 commands: alias, awk, base64, basename, bash, cat, cd, chmod, clear, column, comm, command, cp, curl, cut, date, diff, dirname, du, echo, egrep, env, expand, export, expr, false, fgrep, file, find, fold, grep, gunzip, gzip, head, help, html-to-markdown, join, jq, ln, ls, md5sum, mkdir, mv, nl, od, paste, printenv, printf, pwd, readlink, realpath, rev, rg, rm, rmdir, sed, seq, sh, sha1sum, sha256sum, sha384sum, sha512sum, sleep, sort, split, stat, strings, tac, tail, tar, tee, test, timeout, touch, tr, tree, true, unalias, uniq, wc, which, xargs, yes, zcat. Commands NOT available in fallback mode: node, npm, npx, git, apk, python, wget.Supports pipes (|), redirects (> >>), operators (&& || ;), newlines, and # comments. Prefer read_file/write_file for file inspection and edits — they are faster and more reliable than shell commands for that purpose.`,input_schema:{type:`object`,properties:{command:{type:`string`,description:`The bash command to execute`},stdin:{type:`string`,description:`Optional standard input (stdin) to pass to the command`},timeout:{type:`number`,description:`Timeout in seconds (default from Settings, initially 120; max: 1800)`}},required:[`command`]}}})),iu,au,Xee=k((()=>{iu={name:`clear_chat`,description:`Clear the current chat history and start a new session. Useful for scheduled tasks to prevent context from growing indefinitely.`,input_schema:{type:`object`,properties:{}}},au={name:`ask_user`,description:`Pause execution to ask the user a question or request confirmation. This halts the agent's work until the user provides an answer. Use this for human-in-the-loop checkpoints before taking destructive actions or when you need clarification to proceed.`,input_schema:{type:`object`,properties:{question:{type:`string`,description:`The question or confirmation message to present to the user.`},options:{type:`array`,items:{type:`string`},description:`Optional list of predefined choices for the user to select from.`}},required:[`question`]}}})),ou,su,cu,Zee=k((()=>{ou={name:`manage_email`,description:`Manage email connection settings for IMAP/SMTP workflows. Supports status, connect/configure, enable/disable, delete, read_messages, send_message, mark_as_read, mark_as_unread, delete_messages, download_attachments, list available connection types, and lightweight test actions.`,input_schema:{type:`object`,properties:{action:{type:`string`,enum:[`status`,`list_plugins`,`list_connections`,`connect`,`configure`,`enable`,`disable`,`delete`,`test`,`read_messages`,`send_message`,`mark_as_read`,`mark_as_unread`,`delete_messages`,`download_attachments`],description:`Email management action to perform.`},plugin_id:{type:`string`,description:`Optional connection type ID for connect operations (default: imap).`},connection_id:{type:`string`,description:`Connection ID or label for configure, enable, disable, delete, and test actions. For read_messages/send_message, it may be omitted when there is exactly one enabled IMAP connection.`},label:{type:`string`,description:`Human-readable connection label for new connections.`},enabled:{type:`boolean`,description:`Optional enabled flag used during connect/configure actions.`},config:{type:`object`,properties:{},description:`Email config object (host, port, secure, mailboxPath, smtpHost, smtpPort, smtpSecure, etc.).`},mailbox_path:{type:`string`,description:`Optional mailbox path override for read_messages (default: INBOX).`},limit:{type:`number`,description:`Optional max messages to fetch for read_messages (default 10, range 1-50).`},unread_only:{type:`boolean`,description:`If true, read_messages returns only unread messages.`},message_uids:{type:`array`,items:{type:`number`},description:`Message UIDs for mark_as_read, mark_as_unread, and delete_messages actions.`},message_uid:{type:`number`,description:`Single message UID used by download_attachments action.`},attachment_parts:{type:`array`,items:{type:`string`},description:`Optional IMAP MIME part IDs to download (for example: 2, 3.1). If omitted, all attachments in the message are downloaded.`},save_directory:{type:`string`,description:`Optional workspace directory for downloaded attachments (default: downloads/email).`},attachments:{type:`array`,items:{anyOf:[{type:`string`},{type:`object`,properties:{path:{type:`string`},filename:{type:`string`},content_type:{type:`string`}},required:[`path`]}]},description:`Optional workspace file attachments for send_message. Provide paths or objects with path/filename/content_type.`},to:{type:`array`,items:{type:`string`},description:`Recipient email addresses for send_message.`},cc:{type:`array`,items:{type:`string`},description:`Optional CC recipient addresses for send_message.`},bcc:{type:`array`,items:{type:`string`},description:`Optional BCC recipient addresses for send_message.`},subject:{type:`string`,description:`Message subject for send_message.`},body:{type:`string`,description:`Plaintext message body for send_message.`},html:{type:`string`,description:`Optional HTML body for send_message.`},from:{type:`string`,description:`Optional from address override for send_message.`},reply_to:{type:`string`,description:`Optional reply-to address for send_message.`},username:{type:`string`,description:`Optional username override for connect/configure/read_messages/send_message.`},password:{type:`string`,description:`Optional password override for connect/configure/read_messages/send_message.`}},required:[`action`]}},su={name:`email_read_messages`,description:`Read recent messages from a configured email connection (IMAP). Use this to check inbox mail from an agent workflow. Results include attachment metadata when available.`,input_schema:{type:`object`,properties:{connection_id:{type:`string`,description:`Email connection ID or label.`},mailbox_path:{type:`string`,description:`Optional mailbox path override (default: INBOX).`},limit:{type:`number`,description:`Optional max messages to fetch (default 10, range 1-50).`},unread_only:{type:`boolean`,description:`If true, only unread messages are returned.`}},required:[`connection_id`]}},cu={name:`email_send_message`,description:`Send an email message through a configured email connection (SMTP).`,input_schema:{type:`object`,properties:{connection_id:{type:`string`,description:`Email connection ID or label.`},to:{type:`array`,items:{type:`string`},description:`Recipient email addresses.`},cc:{type:`array`,items:{type:`string`},description:`Optional CC recipient addresses.`},bcc:{type:`array`,items:{type:`string`},description:`Optional BCC recipient addresses.`},subject:{type:`string`,description:`Message subject.`},body:{type:`string`,description:`Plaintext message body.`},html:{type:`string`,description:`Optional HTML message body.`},from:{type:`string`,description:`Optional from address override.`},reply_to:{type:`string`,description:`Optional reply-to address.`}},required:[`connection_id`,`to`,`subject`]}}})),lu,uu,du,Qee=k((()=>{lu={name:`fetch_url`,description:`Fetch a URL via HTTP and return the response body. Subject to browser CORS restrictions — works with most public APIs. Response is truncated to 100KB. Set use_git_auth to true to automatically inject the saved Git PAT as an Authorization header (supports GitHub, Azure DevOps, GitLab, and other providers — auth format is auto-detected from the URL's host). If include_headers is true, the response will include both request and response headers.`,input_schema:{type:`object`,properties:{url:{type:`string`,description:`The URL to fetch`},method:{type:`string`,description:`HTTP method (default: GET)`},headers:{type:`object`,properties:{},description:`Request headers as key-value pairs`},body:{type:`string`,description:`Request body (for POST/PUT/PATCH)`},use_git_auth:{type:`boolean`,description:`If true, inject the saved Git credentials as an Authorization header. Auth format is auto-detected from the URL host: GitHub (token), Azure DevOps (Basic), GitLab (Bearer), or generic Bearer.`},git_account_id:{type:`string`,description:`Optional explicit Git account ID to use when use_git_auth is true. If omitted, account resolution uses hostPattern/default matching.`},use_account_auth:{type:`boolean`,description:`If true, inject a saved service account PAT as a Bearer Authorization header. The account is matched by hostPattern against the URL (longest match wins), then falls back to the default service account. Use this for non-Git services like Figma, Notion, or any other service whose PAT is stored under Settings → Accounts.`},account_id:{type:`string`,description:`Optional explicit service account ID to use when use_account_auth is true. If omitted, account resolution uses hostPattern/default matching.`},auth_mode:{type:`string`,enum:[`pat`,`oauth`],description:`Optional preferred credential mode when multiple accounts match. Valid values: pat or oauth.`},include_headers:{type:`boolean`,description:`If true, include request and response headers in the output.`}},required:[`url`]}},uu={name:`fetch_file`,description:`Fetch a URL and save the response body directly to the workspace in one step. Equivalent to fetch_url + write_file but atomic. Text responses are saved as UTF-8; binary responses (images, PDFs, audio, video, zip, application/octet-stream) are saved as raw bytes. The destination path within the workspace is required. Supports the same authentication options as fetch_url (use_git_auth, use_account_auth, etc.). Returns the workspace path the file was saved to and the number of bytes written.`,input_schema:{type:`object`,properties:{url:{type:`string`,description:`The URL to fetch`},path:{type:`string`,description:`Destination path within the workspace (e.g. 'data/response.json'). Parent directories are created automatically. Must not contain '..' segments.`},method:{type:`string`,description:`HTTP method (default: GET)`},headers:{type:`object`,properties:{},description:`Request headers as key-value pairs`},body:{type:`string`,description:`Request body (for POST/PUT/PATCH)`},use_git_auth:{type:`boolean`,description:`If true, inject the saved Git credentials as an Authorization header. Auth format is auto-detected from the URL host: GitHub (token), Azure DevOps (Basic), GitLab (Bearer), or generic Bearer.`},git_account_id:{type:`string`,description:`Optional explicit Git account ID to use when use_git_auth is true. If omitted, account resolution uses hostPattern/default matching.`},use_account_auth:{type:`boolean`,description:`If true, inject a saved service account PAT as a Bearer Authorization header. The account is matched by hostPattern against the URL (longest match wins), then falls back to the default service account.`},account_id:{type:`string`,description:`Optional explicit service account ID to use when use_account_auth is true. If omitted, account resolution uses hostPattern/default matching.`},auth_mode:{type:`string`,enum:[`pat`,`oauth`],description:`Optional preferred credential mode when multiple accounts match. Valid values: pat or oauth.`}},required:[`url`,`path`]}},du={name:`web_search`,description:`Perform a web search using a search engine to discover information. Returns a plain-text summary of the top search results including titles, URLs, and snippets. Use this when you need to find information but don't know the exact URL to fetch.`,input_schema:{type:`object`,properties:{query:{type:`string`,description:`The search query to look up.`}},required:[`query`]}}})),fu,$ee=k((()=>{fu={name:`javascript`,description:`Execute JavaScript code in a sandboxed Worker and return the result. Lighter than bash — no VM boot required. Use for calculations, data transformations, JSON processing, string analysis, etc. Runs in strict mode. No access to DOM, eval(), Function(), self, postMessage, importScripts, navigator, or indexedDB — these are all undefined. fetch availability is controlled by Tool Configuration -> Internet Access (shared with bash). setTimeout is available but setInterval is blocked. IMPORTANT: You CANNOT call other agent tools (like read_file, write_file, or bash) from inside this sandbox. If you need to process file contents or tool outputs, you must fetch them in a previous turn and pass the data into this tool via the $PIPE_DATA variable. Write plain JavaScript expressions and statements — the return value of the last expression is captured as the result.`,input_schema:{type:`object`,properties:{code:{type:`string`,description:`JavaScript code to execute. The return value of the last expression is captured.`},data:{type:`string`,description:"Optional input data string. Accessible inside the code sandbox via the global constant `$PIPE_DATA`."}},required:[`code`]}}})),pu,mu,ete=k((()=>{pu={name:`remote_mcp_list_tools`,description:`List available tools from a configured Remote MCP connection by connection ID or label.`,input_schema:{type:`object`,properties:{connection_id:{type:`string`,description:`Remote MCP connection ID or label`}},required:[`connection_id`]}},mu={name:`remote_mcp_call_tool`,description:`Call a tool exposed by a configured Remote MCP connection.`,input_schema:{type:`object`,properties:{connection_id:{type:`string`,description:`Remote MCP connection ID or label`},tool_name:{type:`string`,description:`Remote MCP tool name`},arguments:{type:`object`,properties:{},description:`Arguments object passed to the remote MCP tool`}},required:[`connection_id`,`tool_name`]}}})),hu,gu,tte=k((()=>{hu={name:`manage_tools`,description:`Enable or disable specific tools, or activate a predefined tool profile. Use list_tool_profiles to see available profiles before activating one. This helps optimize the context window and focus capabilities. Changes take effect on the NEXT turn, not immediately within the current tool-use loop.`,input_schema:{type:`object`,properties:{action:{type:`string`,enum:[`enable`,`disable`,`activate_profile`],description:`The management action to perform.`},tool_names:{type:`array`,items:{type:`string`},description:`List of tool names to enable or disable. Required for 'enable' and 'disable' actions.`},profile_id:{type:`string`,description:`The unique ID of the tool profile to activate. Required for 'activate_profile' action.`}},required:[`action`]}},gu={name:`list_tool_profiles`,description:`List all available tool profiles that can be activated using manage_tools. Returns a list of profiles with their IDs, names, and the tools they contain.`,input_schema:{type:`object`,properties:{}}}})),_u,vu=k((()=>{_u={name:`update_memory`,description:`Update the MEMORY.md memory file for this group. Use this to persist important context, user preferences, project state, and anything the agent should remember across conversations. This file is loaded as system context on every invocation.`,input_schema:{type:`object`,properties:{content:{type:`string`,description:`New content for the MEMORY.md memory file`}},required:[`content`]}}})),yu,bu,xu=k((()=>{yu={name:`show_toast`,description:`Show a toast notification to the user. Toasts are non-blocking, auto-dismissing notifications that appear in the bottom-right corner. Use for: operation status (success/failure), warnings, informational messages, progress updates. Avoid for: critical errors requiring acknowledgment (use clear error messages instead), lengthy content (keep messages concise).`,input_schema:{type:`object`,properties:{message:{type:`string`,description:`The message to display in the toast (keep concise)`},type:{type:`string`,description:`Type of toast: 'success', 'error', 'warning', or 'info' (default: 'info')`,enum:[`success`,`error`,`warning`,`info`]},duration:{type:`number`,description:`Auto-dismiss duration in milliseconds (default: 5000 for info/success, 8000 for warning/error). Set to 0 to disable auto-dismiss.`}},required:[`message`]}},bu={name:`send_notification`,description:`Send an OS-level push notification to the user via Web Push. Unlike toasts (in-app only), push notifications appear even when the app is not focused or the tab is in the background. Use for: important alerts, long-running task completion, time-sensitive information. Requires the user to have enabled push notifications in Settings.`,input_schema:{type:`object`,properties:{title:{type:`string`,description:`Notification title (default: 'ShadowClaw')`},body:{type:`string`,description:`The notification body text`}},required:[`body`]}}})),Su,Cu,wu=k((()=>{Su=`https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json`,Cu=`A2UI Basic Catalog — Component & Function Reference
|
|
141
|
+
`)}\n${s}`}return s}async function jl(e={}){let t=()=>{let e=null;if(typeof document<`u`){let t=document.getElementById(`shadow-claw-static-manifest`);if(t&&t.textContent)try{let n=JSON.parse(t.textContent);n&&Array.isArray(n.pages)&&(e={...n,pages:[...n.pages]})}catch(e){console.warn(`Failed to parse embedded static main manifest:`,e)}let n=document.querySelectorAll(`script[type="text/markdown"][data-shadow-claw-page]`);if(n.length>0){e||={pages:[]};for(let t of Array.from(n)){let n=t.getAttribute(`data-shadow-claw-page`)?.trim();if(n){let r=t.textContent||``;r=bl(r),!r.trim()&&/^memory\.(md|markdown)$/iu.test(n)&&(r=Go),!r.trim()&&(n===`index.html`||/^index\.(html?|xhtml)$/iu.test(n))&&(r=Al(n)??is);let i=e.pages.findIndex(e=>e.displayPath===n);i>=0?e.pages[i].content=r:e.pages.push({displayPath:n,content:r})}}}let r=document.getElementById(`shadow-claw-site-config`);if(r?.textContent)try{let t=JSON.parse(r.textContent);if(Array.isArray(t?.pages?.files)){e||={pages:[]};for(let n of t.pages.files)if(typeof n==`string`&&n.trim()){let t=n.trim(),r=``;/^memory\.(md|markdown)$/iu.test(t)?r=Go:(t===`index.html`||/^index\.(html?|xhtml)$/iu.test(t))&&(r=Al(t)??is),e.pages.some(e=>e.displayPath===t)||e.pages.push({displayPath:t,content:r})}}}catch{}let i=kl();if(i){e||={pages:[]};let t=i.getAttribute(`data-initial-path`)?.trim()||`index.html`;if(!e.pages.some(e=>e.displayPath===t)){let n=Al(t)??is;e.pages.push({displayPath:t,content:n})}e.pages.some(e=>/^memory\.(md|markdown)$/iu.test(e.displayPath))||e.pages.push({displayPath:`MEMORY.md`,content:Go})}}return e};if(e.preferEmbedded!==!1){let e=t();if(e&&e.pages.length>0)return e}if(e.fetchFallback!==!1){let e=await Dl();if(e&&e.pages.length>0)return e}if(e.preferEmbedded===!1){let e=t();if(e&&e.pages.length>0)return e}return{pages:[{displayPath:`index.html`,content:is},{displayPath:`MEMORY.md`,content:Go}]}}async function Ml(e,t,n=[]){for(let[r,i]of Object.entries(t))if(r===`purgePreRenderedStaticPages`&&i===!0){if(n.length>0){let t=n[0],r=n.slice(1).join(`/`);try{r?await $c(e,t,r):await Qc(e,t)}catch(e){console.warn(`Failed to purge pre-rendered static pages for ${t}/${r}:`,e)}}}else typeof i==`object`&&i&&await Ml(e,i,[...n,r])}function Nl(){if(typeof document<`u`)try{let e=document.getElementById(`shadow-claw-site-config`);if(e?.textContent){let t=JSON.parse(e.textContent);if(t?.pages?.sortOrder===`desc`)return`desc`;if(t?.pages?.sortOrder===`asc`)return`asc`}}catch{}return`desc`}function Pl(){if(typeof document<`u`)try{let e=document.getElementById(`shadow-claw-site-config`);if(e?.textContent){let t=JSON.parse(e.textContent)?.pages?.defaultPinnedPage;if(typeof t==`string`&&t.trim().length>0)return t.trim()}}catch{}return null}function Fl(){if(typeof document<`u`)try{let e=document.getElementById(`shadow-claw-site-config`);if(e?.textContent){let t=JSON.parse(e.textContent);return{allowList:sl(t?.pages?.allowList??t?.pages?.allowlist??t?.allowList??t?.allowlist??[]),denyList:sl(t?.pages?.denyList??t?.pages?.denylist??t?.denyList??t?.denylist??[])}}}catch{}return{allowList:[],denyList:[]}}function Il(e,t){let n=t??Nl();return[...e].sort((e,t)=>{let r=e.path,i=t.path,a=r.split(`/`).pop()||``,o=i.split(`/`).pop()||``,s=/^index\.(html?|xhtml)$/iu.test(a),c=/^index\.(html?|xhtml)$/iu.test(o);if(s&&!c)return-1;if(!s&&c)return 1;let l=/^memory\.(md|markdown)$/iu.test(a),u=/^memory\.(md|markdown)$/iu.test(o);return l&&!u?1:!l&&u?-1:n===`asc`?r.localeCompare(i,void 0,{numeric:!0,sensitivity:`base`}):i.localeCompare(r,void 0,{numeric:!0,sensitivity:`base`})})}async function Ll(e,t,n=zl,r=Bl){let i=t??Vl;try{if(Fee(n)===i)return!0}catch{}try{if(await R(e,r)===i){try{Zc(n,i)}catch{}return!0}await B(e,r,i);try{Zc(n,i)}catch{}}catch{try{Zc(n,i)}catch{}}return!1}async function Rl(e,t=dt,n=[],r={}){await ls(e,t);let i=await jl(r),a=!1;i.preRenderedStaticPages&&(await Ll(e,i.purgeId)||(a=!0,await Ml(e,i.preRenderedStaticPages)));let o=!1;if(t===`br:main`&&i.skillsPurgeId!==void 0&&!await Ll(e,i.skillsPurgeId,`sc:skills-purge-id`,`static_main_skills_purge_id`)){o=!0;try{await $c(e,t,`.agents/skills/main`)}catch(e){if(!(e&&typeof e==`object`&&`name`in e&&e.name===`NotFoundError`))throw e}try{await $c(e,t,`.agents/tools/main`)}catch(e){if(!(e&&typeof e==`object`&&`name`in e&&e.name===`NotFoundError`))throw e}}for(let n of i.pages)if(n.content?.includes(`slug: "shadow-claw--purge-pages"`)){!a&&!await Ll(e,i.purgeId)&&(a=!0,await Qc(e,t));break}let s=t===`br:main`&&await Qo(e),c=new Set(i.pages.map(e=>tl(t,e.displayPath))),l=a?n.filter(e=>e.groupId!==t||c.has(tl(e.groupId,e.path))):[...n],{allowList:u,denyList:d}=Fl(),f=0;for(let n of i.pages)if(f++,f%5==0&&await new Promise(e=>setTimeout(e,0)),!n.content?.includes(`slug: "shadow-claw--purge-pages"`)&&_l(n.displayPath,{allowList:u,denyList:d,groupId:t})){if(/^memory\.(md|markdown)$/iu.test(n.displayPath)){if(s)continue;let r=typeof n.content==`string`&&n.content.trim().length>0&&n.content!==Go?n.content:void 0;if(r===void 0?await es(e,t):await es(e,t,r)){let e=tl(t,n.displayPath);l.some(t=>tl(t.groupId,t.path)===e)||l.push({groupId:t,path:n.displayPath})}}else if(!await rl(e,t,n.displayPath))try{if(!await Yo(e,t,n.displayPath)){let r=n.content;(typeof r!=`string`||!r.trim())&&(r=n.displayPath===`index.html`?Al(`index.html`)??is:await Ol(n.displayPath)??``),await Ho(e,t,n.displayPath,r)}let r=tl(t,n.displayPath);l.some(e=>tl(e.groupId,e.path)===r)||l.push({groupId:t,path:n.displayPath})}catch(e){console.warn(`Failed to seed static page file ${n.displayPath}:`,e)}}if(t===`br:main`){for(let n of i.skills||[]){let r=`.agents/skills/main/${n.displayPath}`;try{await Yo(e,t,r)||await Ho(e,t,r,n.content)}catch(e){console.warn(`Failed to seed skill file ${r}:`,e)}}for(let n of i.tools||[]){let r=`.agents/tools/main/${n.displayPath}`;try{(o||!await Yo(e,t,r))&&await Ho(e,t,r,n.content)}catch(e){console.warn(`Failed to seed tool file ${r}:`,e)}}}let p=typeof document<`u`&&(document.getElementById(`shadow-claw-static-manifest`)!==null||document.querySelector(`script[type="text/markdown"][data-shadow-claw-page]`)!==null||kl()!==null);r.preferEmbedded!==!1&&p||await wl(e,t,!0);let m=l.filter(e=>_l(e.path,{allowList:u,denyList:d,groupId:e.groupId}));return Object.defineProperty(m,"didPurge",{value:a,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(m,"didPurgeSkills",{value:o,enumerable:!1,writable:!0,configurable:!0}),Il(m)}var zl,Bl,Vl,Hl,Ul,Wl=k((()=>{Ot(),Iee(),as(),Ko(),Ye(),Gt(),Wo(),Lee(),el(),ds(),rs(),Xo(),ol(),Uo(),yl(),cl(),xl(),zl=`sc:purge-id`,Bl=`static_main_site_purge_id`,Vl=`__legacy_purge_pages__`,Hl=`static-main-manifest.json`,Ul=`static-main`})),Gl,Ree=k((()=>{hc(),Gl=class{_events;_handlers=[];_runs=/* @__PURE__ */ new Map;constructor(e){this._events=e}start(){this._listen(`streaming-start`,this._onStreamingStart),this._listen(`streaming-chunk`,this._onStreamingChunk),this._listen(`streaming-end`,this._onStreamingEnd),this._listen(`streaming-done`,this._onStreamingDone),this._listen(`streaming-error`,this._onStreamingError),this._listen(`tool-activity`,this._onToolActivity)}stop(){for(let{event:e,handler:t}of this._handlers)this._events.off(e,t);this._handlers=[],this._runs.clear()}_emit(e,t){window.dispatchEvent(new CustomEvent(`shadow-claw-agui-event`,{detail:{groupId:e,event:t}}))}_listen(e,t){this._events.on(e,t),this._handlers.push({event:e,handler:t})}_onStreamingChunk=({groupId:e,text:t})=>{let n=this._runs.get(e);n&&n.messageId&&this._emit(e,{type:`TEXT_MESSAGE_CONTENT`,messageId:n.messageId,delta:t,timestamp:Date.now()})};_onStreamingDone=({groupId:e})=>{let t=this._runs.get(e);t&&(t.messageId&&this._emit(e,{type:`TEXT_MESSAGE_END`,messageId:t.messageId,timestamp:Date.now()}),this._emit(e,{type:`RUN_FINISHED`,threadId:t.threadId,runId:t.runId,timestamp:Date.now()}),this._runs.delete(e))};_onStreamingEnd=({groupId:e})=>{let t=this._runs.get(e);t&&t.messageId&&(this._emit(e,{type:`TEXT_MESSAGE_END`,messageId:t.messageId,timestamp:Date.now()}),t.messageId=null)};_onStreamingError=({groupId:e,error:t})=>{let n=this._runs.get(e);n&&(n.messageId&&this._emit(e,{type:`TEXT_MESSAGE_END`,messageId:n.messageId,timestamp:Date.now()}),this._emit(e,{type:`RUN_ERROR`,message:t||`Unknown streaming error`,timestamp:Date.now()}),this._runs.delete(e))};_onStreamingStart=({groupId:e})=>{let t=cc(),n=e,r=cc();this._runs.set(e,{runId:t,threadId:n,messageId:r,activeToolCallIds:/* @__PURE__ */ new Set}),this._emit(e,{type:`RUN_STARTED`,threadId:n,runId:t,timestamp:Date.now()}),this._emit(e,{type:`TEXT_MESSAGE_START`,messageId:r,role:`assistant`,timestamp:Date.now()})};_onToolActivity=({groupId:e,tool:t,status:n})=>{let r=this._runs.get(e);if(r){if(n===`running`){let n=cc();r.activeToolCallIds.add(n),this._emit(e,{type:`TOOL_CALL_START`,toolCallId:n,toolCallName:t,timestamp:Date.now()}),r._lastToolCallId=n}else if(n===`done`||n===`error`){let t=r._lastToolCallId;t&&(r.activeToolCallIds.delete(t),this._emit(e,{type:`TOOL_CALL_END`,toolCallId:t,timestamp:Date.now()}))}}}}})),Kl,ql,Jl,zee=k((()=>{Xs(),Kl=5,ql=class{#e=new Ys.State(0);#t=/* @__PURE__ */ new Map;#n=new Ys.State([]);clear(){this.#t.forEach((e,t)=>this.clearTimer(t)),this.#t.clear(),this.#n.set([])}clearTimer(e){let t=this.#t.get(e);t?.timeoutId&&clearTimeout(t.timeoutId),this.#t.delete(e)}dismiss(e){this.clearTimer(e),this.#n.set(this.#n.get().filter(t=>t.id!==e))}pause(e){let t=this.#t.get(e);t&&t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0,t.remaining=Math.max(0,t.remaining-(Date.now()-t.startedAt)),this.#t.set(e,t))}resolveAction(e){if(e&&typeof e.label==`string`&&typeof e.onClick==`function`)return e}resolveDuration(e){return typeof e!=`number`||Number.isNaN(e)||e<0?4e3:e}resolveType(e){return e&&[`success`,`warning`,`error`,`info`].includes(e)?e:`info`}resume(e){let t=this.#t.get(e);!t||t.timeoutId||t.remaining<=0||this.scheduleDismiss(e,t.remaining)}scheduleDismiss(e,t){this.clearTimer(e);let n=globalThis.setTimeout(()=>{this.dismiss(e)},t);this.#t.set(e,{timeoutId:n,remaining:t,startedAt:Date.now()})}show(e,t={}){let n=this.#e.get()+1;this.#e.set(n);let r={id:n,message:e,type:this.resolveType(t.type),duration:this.resolveDuration(t.duration),action:this.resolveAction(t.action),createdAt:Date.now()},i=[...this.#n.get(),r];if(i.length>Kl){let e=i[0];this.clearTimer(e.id),this.#n.set(i.slice(1))}else this.#n.set(i);return r.duration>0&&this.scheduleDismiss(r.id,r.duration),r.id}get toasts(){return this.#n.get()}async runAction(e){let t=this.#n.get().find(t=>t.id===e);t?.action&&await t.action.onClick()}},Jl=new ql}));function Yl(e,t={}){return Jl.show(e,t)}function Bee(e,t=4e3){return Jl.show(e,{type:`success`,duration:t})}function Xl(e,t=5e3){return Jl.show(e,{type:`error`,duration:t})}var Zl=k((()=>{zee()}));function Vee(e,t){if(!e||typeof e!=`object`)return e;let n=JSON.parse(JSON.stringify(e));for(let e of t)Hee(n,e);return n}function Hee(e,t){let{op:n,path:r,value:i}=t;if(!r||!r.startsWith(`/`))return;let a=r.split(`/`).slice(1).map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`)),o=a.pop();if(o===void 0)return;let s=e;for(let e of a){if(typeof s!=`object`||!s)return;s=s[e]}typeof s==`object`&&s&&(Array.isArray(s)?Uee(s,o,n,i):Wee(s,o,n,i))}function Uee(e,t,n,r){if(n===`add`){if(t===`-`)e.push(r);else{let n=parseInt(t,10);!isNaN(n)&&n>=0&&n<=e.length&&e.splice(n,0,r)}}else if(n===`replace`){let n=parseInt(t,10);!isNaN(n)&&n>=0&&n<e.length&&(e[n]=r)}else if(n===`remove`){let n=parseInt(t,10);!isNaN(n)&&n>=0&&n<e.length&&e.splice(n,1)}}function Wee(e,t,n,r){n===`add`||n===`replace`?e[t]=r:n===`remove`&&delete e[t]}var Gee=k((()=>{}));function Kee(e){if(e==null)return null;let t=String(e).trim().toLowerCase();return[`1`,`true`,`yes`,`on`].includes(t)?!0:![`0`,`false`,`no`,`off`].includes(t)&&null}function Ql(e,t=!1){if(e==null)return t;if(typeof e==`boolean`)return e;if(typeof e==`number`)return e===1;if(typeof e==`string`){let t=e.trim().toLowerCase();return t===`true`||t===`1`}return!1}var $l=k((()=>{}));function eu(e){if(!e)return[];try{let t=JSON.parse(e);if(Array.isArray(t))return sl(t.map(e=>String(e)))}catch{}return sl(e.split(`,`))}var qee=k((()=>{cl()}));function tu(e){if(typeof document>`u`)return null;let t=`shadow-claw-site-config`;if(e){let n=e.getAttribute(`config`)?.trim();n&&(t=n.replace(/^#/,``))}let n=document.getElementById(t);if(!n?.textContent)return nu.delete(t),null;let r=nu.get(t);if(r&&r.rawText===n.textContent)return r.config;try{let e=JSON.parse(n.textContent);if(!e||typeof e!=`object`)return nu.delete(t),null;let r={...e};return nu.set(t,{rawText:n.textContent,config:r}),r}catch(e){return console.warn(`[ShadowClaw] Failed to parse site configuration from #${t}:`,e),null}}var nu,Jee=k((()=>{nu=/* @__PURE__ */ new Map})),ru,Yee=k((()=>{ru={name:`bash`,description:`Execute a shell command. When WebVM is available, runs in a full Alpine Linux VM (x86) with all standard Linux commands. When WebVM is disabled or unavailable, falls back to a lightweight JavaScript shell emulator with 83 commands: alias, awk, base64, basename, bash, cat, cd, chmod, clear, column, comm, command, cp, curl, cut, date, diff, dirname, du, echo, egrep, env, expand, export, expr, false, fgrep, file, find, fold, grep, gunzip, gzip, head, help, html-to-markdown, join, jq, ln, ls, md5sum, mkdir, mv, nl, od, paste, printenv, printf, pwd, readlink, realpath, rev, rg, rm, rmdir, sed, seq, sh, sha1sum, sha256sum, sha384sum, sha512sum, sleep, sort, split, stat, strings, tac, tail, tar, tee, test, timeout, touch, tr, tree, true, unalias, uniq, wc, which, xargs, yes, zcat. Commands NOT available in fallback mode: node, npm, npx, git, apk, python, wget.Supports pipes (|), redirects (> >>), operators (&& || ;), newlines, and # comments. Prefer read_file/write_file for file inspection and edits — they are faster and more reliable than shell commands for that purpose.`,input_schema:{type:`object`,properties:{command:{type:`string`,description:`The bash command to execute`},stdin:{type:`string`,description:`Optional standard input (stdin) to pass to the command`},timeout:{type:`number`,description:`Timeout in seconds (default from Settings, initially 120; max: 1800)`}},required:[`command`]}}})),iu,au,Xee=k((()=>{iu={name:`clear_chat`,description:`Clear the current chat history and start a new session. Useful for scheduled tasks to prevent context from growing indefinitely.`,input_schema:{type:`object`,properties:{}}},au={name:`ask_user`,description:`Pause execution to ask the user a question or request confirmation. This halts the agent's work until the user provides an answer. Use this for human-in-the-loop checkpoints before taking destructive actions or when you need clarification to proceed.`,input_schema:{type:`object`,properties:{question:{type:`string`,description:`The question or confirmation message to present to the user.`},options:{type:`array`,items:{type:`string`},description:`Optional list of predefined choices for the user to select from.`}},required:[`question`]}}})),ou,su,cu,Zee=k((()=>{ou={name:`manage_email`,description:`Manage email connection settings for IMAP/SMTP workflows. Supports status, connect/configure, enable/disable, delete, read_messages, send_message, mark_as_read, mark_as_unread, delete_messages, download_attachments, list available connection types, and lightweight test actions.`,input_schema:{type:`object`,properties:{action:{type:`string`,enum:[`status`,`list_plugins`,`list_connections`,`connect`,`configure`,`enable`,`disable`,`delete`,`test`,`read_messages`,`send_message`,`mark_as_read`,`mark_as_unread`,`delete_messages`,`download_attachments`],description:`Email management action to perform.`},plugin_id:{type:`string`,description:`Optional connection type ID for connect operations (default: imap).`},connection_id:{type:`string`,description:`Connection ID or label for configure, enable, disable, delete, and test actions. For read_messages/send_message, it may be omitted when there is exactly one enabled IMAP connection.`},label:{type:`string`,description:`Human-readable connection label for new connections.`},enabled:{type:`boolean`,description:`Optional enabled flag used during connect/configure actions.`},config:{type:`object`,properties:{},description:`Email config object (host, port, secure, mailboxPath, smtpHost, smtpPort, smtpSecure, etc.).`},mailbox_path:{type:`string`,description:`Optional mailbox path override for read_messages (default: INBOX).`},limit:{type:`number`,description:`Optional max messages to fetch for read_messages (default 10, range 1-50).`},unread_only:{type:`boolean`,description:`If true, read_messages returns only unread messages.`},message_uids:{type:`array`,items:{type:`number`},description:`Message UIDs for mark_as_read, mark_as_unread, and delete_messages actions.`},message_uid:{type:`number`,description:`Single message UID used by download_attachments action.`},attachment_parts:{type:`array`,items:{type:`string`},description:`Optional IMAP MIME part IDs to download (for example: 2, 3.1). If omitted, all attachments in the message are downloaded.`},save_directory:{type:`string`,description:`Optional workspace directory for downloaded attachments (default: downloads/email).`},attachments:{type:`array`,items:{anyOf:[{type:`string`},{type:`object`,properties:{path:{type:`string`},filename:{type:`string`},content_type:{type:`string`}},required:[`path`]}]},description:`Optional workspace file attachments for send_message. Provide paths or objects with path/filename/content_type.`},to:{type:`array`,items:{type:`string`},description:`Recipient email addresses for send_message.`},cc:{type:`array`,items:{type:`string`},description:`Optional CC recipient addresses for send_message.`},bcc:{type:`array`,items:{type:`string`},description:`Optional BCC recipient addresses for send_message.`},subject:{type:`string`,description:`Message subject for send_message.`},body:{type:`string`,description:`Plaintext message body for send_message.`},html:{type:`string`,description:`Optional HTML body for send_message.`},from:{type:`string`,description:`Optional from address override for send_message.`},reply_to:{type:`string`,description:`Optional reply-to address for send_message.`},username:{type:`string`,description:`Optional username override for connect/configure/read_messages/send_message.`},password:{type:`string`,description:`Optional password override for connect/configure/read_messages/send_message.`}},required:[`action`]}},su={name:`email_read_messages`,description:`Read recent messages from a configured email connection (IMAP). Use this to check inbox mail from an agent workflow. Results include attachment metadata when available.`,input_schema:{type:`object`,properties:{connection_id:{type:`string`,description:`Email connection ID or label.`},mailbox_path:{type:`string`,description:`Optional mailbox path override (default: INBOX).`},limit:{type:`number`,description:`Optional max messages to fetch (default 10, range 1-50).`},unread_only:{type:`boolean`,description:`If true, only unread messages are returned.`}},required:[`connection_id`]}},cu={name:`email_send_message`,description:`Send an email message through a configured email connection (SMTP).`,input_schema:{type:`object`,properties:{connection_id:{type:`string`,description:`Email connection ID or label.`},to:{type:`array`,items:{type:`string`},description:`Recipient email addresses.`},cc:{type:`array`,items:{type:`string`},description:`Optional CC recipient addresses.`},bcc:{type:`array`,items:{type:`string`},description:`Optional BCC recipient addresses.`},subject:{type:`string`,description:`Message subject.`},body:{type:`string`,description:`Plaintext message body.`},html:{type:`string`,description:`Optional HTML message body.`},from:{type:`string`,description:`Optional from address override.`},reply_to:{type:`string`,description:`Optional reply-to address.`}},required:[`connection_id`,`to`,`subject`]}}})),lu,uu,du,Qee=k((()=>{lu={name:`fetch_url`,description:`Fetch a URL via HTTP and return the response body. Subject to browser CORS restrictions — works with most public APIs. Response is truncated to 100KB. Set use_git_auth to true to automatically inject the saved Git PAT as an Authorization header (supports GitHub, Azure DevOps, GitLab, and other providers — auth format is auto-detected from the URL's host). If include_headers is true, the response will include both request and response headers.`,input_schema:{type:`object`,properties:{url:{type:`string`,description:`The URL to fetch`},method:{type:`string`,description:`HTTP method (default: GET)`},headers:{type:`object`,properties:{},description:`Request headers as key-value pairs`},body:{type:`string`,description:`Request body (for POST/PUT/PATCH)`},use_git_auth:{type:`boolean`,description:`If true, inject the saved Git credentials as an Authorization header. Auth format is auto-detected from the URL host: GitHub (token), Azure DevOps (Basic), GitLab (Bearer), or generic Bearer.`},git_account_id:{type:`string`,description:`Optional explicit Git account ID to use when use_git_auth is true. If omitted, account resolution uses hostPattern/default matching.`},use_account_auth:{type:`boolean`,description:`If true, inject a saved service account PAT as a Bearer Authorization header. The account is matched by hostPattern against the URL (longest match wins), then falls back to the default service account. Use this for non-Git services like Figma, Notion, or any other service whose PAT is stored under Settings → Accounts.`},account_id:{type:`string`,description:`Optional explicit service account ID to use when use_account_auth is true. If omitted, account resolution uses hostPattern/default matching.`},auth_mode:{type:`string`,enum:[`pat`,`oauth`],description:`Optional preferred credential mode when multiple accounts match. Valid values: pat or oauth.`},include_headers:{type:`boolean`,description:`If true, include request and response headers in the output.`}},required:[`url`]}},uu={name:`fetch_file`,description:`Fetch a URL and save the response body directly to the workspace in one step. Equivalent to fetch_url + write_file but atomic. Text responses are saved as UTF-8; binary responses (images, PDFs, audio, video, zip, application/octet-stream) are saved as raw bytes. The destination path within the workspace is required. Supports the same authentication options as fetch_url (use_git_auth, use_account_auth, etc.). Returns the workspace path the file was saved to and the number of bytes written.`,input_schema:{type:`object`,properties:{url:{type:`string`,description:`The URL to fetch`},path:{type:`string`,description:`Destination path within the workspace (e.g. 'data/response.json'). Parent directories are created automatically. Must not contain '..' segments.`},method:{type:`string`,description:`HTTP method (default: GET)`},headers:{type:`object`,properties:{},description:`Request headers as key-value pairs`},body:{type:`string`,description:`Request body (for POST/PUT/PATCH)`},use_git_auth:{type:`boolean`,description:`If true, inject the saved Git credentials as an Authorization header. Auth format is auto-detected from the URL host: GitHub (token), Azure DevOps (Basic), GitLab (Bearer), or generic Bearer.`},git_account_id:{type:`string`,description:`Optional explicit Git account ID to use when use_git_auth is true. If omitted, account resolution uses hostPattern/default matching.`},use_account_auth:{type:`boolean`,description:`If true, inject a saved service account PAT as a Bearer Authorization header. The account is matched by hostPattern against the URL (longest match wins), then falls back to the default service account.`},account_id:{type:`string`,description:`Optional explicit service account ID to use when use_account_auth is true. If omitted, account resolution uses hostPattern/default matching.`},auth_mode:{type:`string`,enum:[`pat`,`oauth`],description:`Optional preferred credential mode when multiple accounts match. Valid values: pat or oauth.`}},required:[`url`,`path`]}},du={name:`web_search`,description:`Perform a web search using a search engine to discover information. Returns a plain-text summary of the top search results including titles, URLs, and snippets. Use this when you need to find information but don't know the exact URL to fetch.`,input_schema:{type:`object`,properties:{query:{type:`string`,description:`The search query to look up.`}},required:[`query`]}}})),fu,$ee=k((()=>{fu={name:`javascript`,description:`Execute JavaScript code in a sandboxed Worker and return the result. Lighter than bash — no VM boot required. Use for calculations, data transformations, JSON processing, string analysis, etc. Runs in strict mode. No access to DOM, eval(), Function(), self, postMessage, importScripts, navigator, or indexedDB — these are all undefined. fetch availability is controlled by Tool Configuration -> Internet Access (shared with bash). setTimeout is available but setInterval is blocked. IMPORTANT: You CANNOT call other agent tools (like read_file, write_file, or bash) from inside this sandbox. If you need to process file contents or tool outputs, you must fetch them in a previous turn and pass the data into this tool via the $PIPE_DATA variable. Write plain JavaScript expressions and statements — the return value of the last expression is captured as the result.`,input_schema:{type:`object`,properties:{code:{type:`string`,description:`JavaScript code to execute. The return value of the last expression is captured.`},data:{type:`string`,description:"Optional input data string. Accessible inside the code sandbox via the global constant `$PIPE_DATA`."}},required:[`code`]}}})),pu,mu,ete=k((()=>{pu={name:`remote_mcp_list_tools`,description:`List available tools from a configured Remote MCP connection by connection ID or label.`,input_schema:{type:`object`,properties:{connection_id:{type:`string`,description:`Remote MCP connection ID or label`}},required:[`connection_id`]}},mu={name:`remote_mcp_call_tool`,description:`Call a tool exposed by a configured Remote MCP connection.`,input_schema:{type:`object`,properties:{connection_id:{type:`string`,description:`Remote MCP connection ID or label`},tool_name:{type:`string`,description:`Remote MCP tool name`},arguments:{type:`object`,properties:{},description:`Arguments object passed to the remote MCP tool`}},required:[`connection_id`,`tool_name`]}}})),hu,gu,tte=k((()=>{hu={name:`manage_tools`,description:`Enable or disable specific tools, or activate a predefined tool profile. Use list_tool_profiles to see available profiles before activating one. This helps optimize the context window and focus capabilities. Changes take effect on the NEXT turn, not immediately within the current tool-use loop.`,input_schema:{type:`object`,properties:{action:{type:`string`,enum:[`enable`,`disable`,`activate_profile`],description:`The management action to perform.`},tool_names:{type:`array`,items:{type:`string`},description:`List of tool names to enable or disable. Required for 'enable' and 'disable' actions.`},profile_id:{type:`string`,description:`The unique ID of the tool profile to activate. Required for 'activate_profile' action.`}},required:[`action`]}},gu={name:`list_tool_profiles`,description:`List all available tool profiles that can be activated using manage_tools. Returns a list of profiles with their IDs, names, and the tools they contain.`,input_schema:{type:`object`,properties:{}}}})),_u,vu=k((()=>{_u={name:`update_memory`,description:`Update the MEMORY.md memory file for this group. Use this to persist important context, user preferences, project state, and anything the agent should remember across conversations. This file is loaded as system context on every invocation.`,input_schema:{type:`object`,properties:{content:{type:`string`,description:`New content for the MEMORY.md memory file`}},required:[`content`]}}})),yu,bu,xu=k((()=>{yu={name:`show_toast`,description:`Show a toast notification to the user. Toasts are non-blocking, auto-dismissing notifications that appear in the bottom-right corner. Use for: operation status (success/failure), warnings, informational messages, progress updates. Avoid for: critical errors requiring acknowledgment (use clear error messages instead), lengthy content (keep messages concise).`,input_schema:{type:`object`,properties:{message:{type:`string`,description:`The message to display in the toast (keep concise)`},type:{type:`string`,description:`Type of toast: 'success', 'error', 'warning', or 'info' (default: 'info')`,enum:[`success`,`error`,`warning`,`info`]},duration:{type:`number`,description:`Auto-dismiss duration in milliseconds (default: 5000 for info/success, 8000 for warning/error). Set to 0 to disable auto-dismiss.`}},required:[`message`]}},bu={name:`send_notification`,description:`Send an OS-level push notification to the user via Web Push. Unlike toasts (in-app only), push notifications appear even when the app is not focused or the tab is in the background. Use for: important alerts, long-running task completion, time-sensitive information. Requires the user to have enabled push notifications in Settings.`,input_schema:{type:`object`,properties:{title:{type:`string`,description:`Notification title (default: 'ShadowClaw')`},body:{type:`string`,description:`The notification body text`}},required:[`body`]}}})),Su,Cu,wu=k((()=>{Su=`https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json`,Cu=`A2UI Basic Catalog — Component & Function Reference
|
|
142
142
|
=====================================================
|
|
143
143
|
|
|
144
144
|
Catalog ID: ${Su}
|
|
@@ -247,7 +247,7 @@ actions:
|
|
|
247
247
|
updateDataModel — update a single path in the data model (re-renders bound components)
|
|
248
248
|
deleteSurface — remove the surface from the chat`,input_schema:{type:`object`,properties:{action:{type:`string`,enum:[`createSurface`,`updateComponents`,`updateDataModel`,`deleteSurface`],description:`The A2UI operation to perform`},surfaceId:{type:`string`,description:`Unique identifier for this surface. Use a stable ID so you can update it later.`},components:{type:`array`,description:`Flat array of component objects (required for createSurface/updateComponents). Each object MUST have an 'id' field and a 'component' field. The component with id 'root' is the tree root (required for createSurface). Component field values: Text | Row | Column | Button | TextField | Image | Icon | Video | AudioPlayer | List | Card | Tabs | Modal | Divider | CheckBox | ChoicePicker | Slider | DateTimeInput. Put all properties at the TOP LEVEL alongside 'component' and 'id'. DO NOT nest properties under a 'properties' key. Children arrays contain other component ID strings, not nested objects.`,items:{type:`object`,additionalProperties:!0}},dataModel:{type:`object`,description:`Initial data model for the surface (used with createSurface). Components can reference values via { "path": "/key" }.`,properties:{},additionalProperties:!0},path:{type:`string`,description:`JSON Pointer path to update (required for updateDataModel). Examples: "/result", "/user/name", "/count". Use "/" to replace the entire data model.`},value:{type:`string`,description:`New value to set at the specified path (used with updateDataModel). Omit to delete the key at the given path.`},surfaceProperties:{type:`object`,description:`Optional display/branding properties for this surface (e.g. agentDisplayName).`,properties:{},additionalProperties:!0}},required:[`action`,`surfaceId`]}}})),Ou,ku=k((()=>{Ou={name:`spawn_subagent`,description:`Spawn one or more independent agent loops to work on subtasks in parallel and collect their results. Each subagent has its own tool-use loop, inherits the current API key, and can optionally override provider/model. and runs concurrently with other subagents via Promise.all. Use spawn_subagent when a task has independent parallel workstreams — for example: researching multiple topics simultaneously, processing a list of items in parallel, or delegating isolated subtasks to specialized agents. Do NOT use spawn_subagent for sequential tasks where step 2 depends on step 1's output — just do those steps directly. Do NOT use spawn_subagent for simple single-step work that takes one tool call. Use the parallel_agents field to fan out multiple subagents in a single call.`,input_schema:{type:`object`,properties:{prompt:{type:`string`,description:`The task prompt for a single subagent. Required unless using parallel_agents for multi-agent fan-out.`},tools:{type:`array`,description:`Optional list of tool names to allow in the subagent. If omitted, the subagent inherits the current tool set (minus spawn_subagent to prevent recursion). If provided, only these tools are available to the subagent.`,items:{type:`string`}},profile:{type:`string`,enum:[`current`,`fast`,`smart`,`powerful`],description:`Optional model profile to run the subagent on. Use 'fast' for simple/cheap subtasks (e.g., text formatting, basic search), 'smart' for moderate reasoning, 'powerful' for deep thinking or complex coding, and 'current' to inherit the parent model. Defaults to 'current'.`},workspace_group_id:{type:`string`,description:`Optional workspace group id override for subagent file/tool scope. Use 'parent' to reuse the parent workspace in automatic mode. When omitted, subagents use an isolated workspace by default.`},system_prompt:{type:`string`,description:`Optional system prompt override for the subagent. Defaults to the current system prompt.`},parallel_agents:{type:`array`,description:`Optional list of subagent specifications to run in parallel. When provided, all agents are launched concurrently and their results are combined. Note: There is a configurable maximum limit on parallel subagents (default 5). Each entry can specify a prompt, optional tools list, optional profile, and optional system_prompt.`,items:{type:`object`,properties:{prompt:{type:`string`,description:`The task prompt for this subagent.`},tools:{type:`array`,description:`Optional tool names for this subagent.`,items:{type:`string`}},profile:{type:`string`,enum:[`current`,`fast`,`smart`,`powerful`],description:`Optional model profile for this subagent. Defaults to 'current'.`},workspace_group_id:{type:`string`,description:`Optional workspace group id for this subagent. Use 'parent' for parent workspace in automatic mode.`},system_prompt:{type:`string`,description:`Optional system prompt override for this subagent.`}},required:[`prompt`]}}},required:[`prompt`]}}})),Au,ju=k((()=>{Au={name:`get_current_time`,description:`Get the current date and time. Returns an ISO 8601 string representing the current date and time. Use this tool whenever you need to know the current time, instead of relying on shell tools which may be unavailable.`,input_schema:{type:`object`,properties:{timezone:{type:`string`,description:`Optional timezone to format the time in (e.g. 'America/New_York'). If omitted, returns UTC.`}}}}})),Mu,Nu,Pu,Fu,Iu,Lu,Ru,zu,Bu,Vu,Hu,Uu,Wu,Gu=k((()=>{Mu={name:`attach_file_to_chat`,description:`Prepare a workspace file for chat delivery by generating an exact markdown attachment snippet. Validates the file path and returns markdown that works for inline image rendering in ShadowClaw and attachment upload in external channels like Telegram/iMessage.`,input_schema:{type:`object`,properties:{path:{type:`string`,description:`File path relative to the group workspace root`},alt:{type:`string`,description:`Optional alt/caption text to use in the generated markdown`}},required:[`path`]}},Nu={name:`copy_file`,description:`Copy a file or directory in the group workspace to a new destination path. Supports copying single files or nested directories. Optionally supports copying between different conversation workspaces via source_group_id or target_group_id.`,input_schema:{type:`object`,properties:{source_path:{type:`string`,description:`Source file or directory path relative to workspace root`},target_path:{type:`string`,description:`Destination file or directory path relative to workspace root`},source_group_id:{type:`string`,description:`Optional source conversation group ID (defaults to current workspace)`},target_group_id:{type:`string`,description:`Optional target conversation group ID (defaults to current workspace)`}},required:[`source_path`,`target_path`]}},Pu={name:`create_directory`,description:`Create a new directory (and any missing parent directories) in the group workspace.`,input_schema:{type:`object`,properties:{path:{type:`string`,description:`Directory path relative to the group workspace root`}},required:[`path`]}},Fu={name:`delete_file`,description:`Delete a file or directory from the group workspace. If the target path is a directory, it will be recursively deleted.`,input_schema:{type:`object`,properties:{path:{type:`string`,description:`File or directory path relative to the group workspace root`}},required:[`path`]}},Iu={name:`diff_files`,description:`Compare two files in the workspace and output the differences. Useful for comparing generated code, checking before patching, or finding changes outside of git repositories.`,input_schema:{type:`object`,properties:{path_a:{type:`string`,description:`Path to the first file relative to the group workspace root.`},path_b:{type:`string`,description:`Path to the second file relative to the group workspace root.`}},required:[`path_a`,`path_b`]}},Lu={name:`list_files`,description:`List files and directories in the group workspace. Directory names end with /. Returns sorted entries.`,input_schema:{type:`object`,properties:{path:{type:`string`,description:`Directory path relative to workspace root (default: root)`}}}},Ru={name:`move_file`,description:`Move or rename a file or directory in the group workspace to a target path. Supports moving single files or nested directories. Optionally supports moving between different conversation workspaces via source_group_id or target_group_id.`,input_schema:{type:`object`,properties:{source_path:{type:`string`,description:`Source file or directory path relative to workspace root`},target_path:{type:`string`,description:`Destination file or directory path relative to workspace root`},source_group_id:{type:`string`,description:`Optional source conversation group ID (defaults to current workspace)`},target_group_id:{type:`string`,description:`Optional target conversation group ID (defaults to current workspace)`}},required:[`source_path`,`target_path`]}},zu={name:`open_file`,description:`Open a file from the group workspace in the UI file viewer dialog. Use this only when the user explicitly asks to inspect a file visually with preview support. Do not use this tool to send or attach files in chat responses.`,input_schema:{type:`object`,properties:{path:{type:`string`,description:`File path relative to the group workspace root`}},required:[`path`]}},Bu={name:`patch_file`,description:`Make a targeted text replacement in a file. Finds the single occurrence of old_string and replaces it with new_string. Fails if old_string is not found or matches more than once. Use this instead of write_file when you only need to change part of a file — it is safer and works well with large files. Include enough surrounding context in old_string to make the match unique. IMPORTANT: You must provide 'path', 'old_string', and 'new_string' parameters.`,input_schema:{type:`object`,properties:{path:{type:`string`,description:`File path relative to the group workspace root`},old_string:{type:`string`,description:`The exact text to find in the file. Must match exactly once. Include 2-3 lines of surrounding context to ensure a unique match.`},new_string:{type:`string`,description:`The replacement text. Can be empty to delete old_string.`}},required:[`path`,`old_string`,`new_string`]}},Vu={name:`read_file`,description:`Read the contents of one or more files from the group workspace. IMPORTANT: You must specify either the 'path' parameter (for a single file) or the 'paths' parameter (an array of file paths for multiple files). When paths is provided, returns all file contents concatenated with --- filename --- headers. Prefer paths to batch reads in a single call. Image files (png, jpg, gif, webp, etc.) are returned as native image content that the model can see directly. Other binary files will be detected and an error returned suggesting alternative tools.`,input_schema:{type:`object`,properties:{path:{type:`string`,description:`Single file path relative to the group workspace root`},paths:{type:`array`,items:{type:`string`},description:`Array of file paths relative to the group workspace root. Use this to read multiple files in a single tool call.`}}}},Hu={name:`search_files`,description:`Search for a pattern (regex or exact text) in files across the workspace. Useful for finding code references, function definitions, or specific content without needing to rely on a shell environment.`,input_schema:{type:`object`,properties:{pattern:{type:`string`,description:`The text or regular expression to search for.`},path:{type:`string`,description:`Optional directory path to restrict the search to (e.g. 'src/'). Defaults to workspace root.`},file_glob:{type:`string`,description:`Optional simple glob to filter files (e.g. '*.ts'). Supports * as wildcard.`},is_regex:{type:`boolean`,description:`Set to true to parse the pattern as a regular expression.`}},required:[`pattern`]}},Uu={name:`send_file`,description:`Send a workspace file directly to connected peer(s) over the P2P (PeerJS/WebRTC) data channel. Use this when the user is in a peer conversation or room, or specify peer_id to send to a remote peer directly. The file is read from the current workspace and transferred over WebRTC in binary chunks so there is no size limit.`,input_schema:{type:`object`,properties:{path:{type:`string`,description:`File path relative to the group workspace root`},peer_id:{type:`string`,description:`Optional target PeerJS peer ID (or peer: groupId). If omitted, sends to the current peer/room conversation.`}},required:[`path`]}},Wu={name:`write_file`,description:`Write content to a file in the group workspace. Creates the file and any intermediate directories if they don't exist. Overwrites the file if it already exists. IMPORTANT: You must provide both the 'path' and 'content' parameters when calling this tool.`,input_schema:{type:`object`,properties:{path:{type:`string`,description:`File path relative to the group workspace root`},content:{type:`string`,description:`Content to write to the file`}},required:[`path`,`content`]}}})),Ku,qu,Ju,Yu,Xu,Zu,Qu,$u,ed,td,nd,rd,id,ad,od,sd,cd,ld,ud,dd,fd,pd,md,hd,gd=k((()=>{Ku={name:`git_add`,description:`Stage files in a cloned repo. Accepts an array of filepaths. If omitted or empty, stages the repo root.`,input_schema:{type:`object`,properties:{repo:{type:`string`,description:`Short repo name`},filepaths:{type:`array`,items:{type:`string`},description:`Array of file paths to stage (relative to repo root). Pass a single item for one file.`}},required:[`repo`]}},qu={name:`git_branch`,description:`Create a new branch in a cloned repo. Optionally switch to it immediately (like git checkout -b).`,input_schema:{type:`object`,properties:{repo:{type:`string`,description:`Short repo name (returned by git_clone)`},name:{type:`string`,description:`Name for the new branch`},checkout:{type:`boolean`,description:`Switch to the new branch after creating it (default: false)`},start_point:{type:`string`,description:`Branch, tag, or commit SHA to branch from (default: HEAD)`}},required:[`repo`,`name`]}},Ju={name:`git_branches`,description:`List branches in a cloned repo. Current branch is marked with *.`,input_schema:{type:`object`,properties:{repo:{type:`string`,description:`Short repo name`},remote:{type:`boolean`,description:`List remote-tracking branches instead (default: false)`}},required:[`repo`]}},Yu={name:`git_checkout`,description:`Checkout a branch, tag, or commit SHA in a cloned repo.`,input_schema:{type:`object`,properties:{repo:{type:`string`,description:`Short repo name (returned by git_clone)`},ref:{type:`string`,description:`Branch name, tag, or commit SHA to checkout`}},required:[`repo`,`ref`]}},Xu={name:`git_clone`,description:`Clone a git repository into browser-persistent OPFS storage. Files are stored directly under repos/<repo-name>/ in the workspace and are immediately accessible to other git_* tools without any extra sync step. Works with public and private repos (GitHub, GitLab, GitHub Enterprise, etc.). If a Git PAT is configured in Settings, it is used automatically for authentication. Uses a CORS proxy. Returns the short repo name used for subsequent git_* operations.`,input_schema:{type:`object`,properties:{url:{type:`string`,description:`Full HTTPS repo URL (e.g. https://github.com/user/repo)`},name:{type:`string`,description:`Optional short repo name to use for the clone directory; defaults to the repository name parsed from the URL.`},branch:{type:`string`,description:`Branch to clone (default: default branch)`},depth:{type:`number`,description:`Shallow clone depth (default: 20)`}},required:[`url`]}},Zu={name:`git_commit`,description:`Stage all changes and create a commit in a cloned repo. Uses configured git author name/email or defaults.`,input_schema:{type:`object`,properties:{repo:{type:`string`,description:`Short repo name`},message:{type:`string`,description:`Commit message`},author_name:{type:`string`,description:`Author name (optional, uses configured default)`},author_email:{type:`string`,description:`Author email (optional, uses configured default)`}},required:[`repo`,`message`]}},Qu={name:`git_config`,description:`Get or set a git config value for a repo (e.g. user.name, user.email). Persistent per-repo identity avoids specifying author on every commit.`,input_schema:{type:`object`,properties:{repo:{type:`string`,description:`Short repo name`},command:{type:`string`,enum:[`get`,`set`],description:`Operation: get or set a config value`},key:{type:`string`,description:`Config key path (e.g. user.name, user.email, core.autocrlf)`},value:{type:`string`,description:`Value to set — required when command is set`}},required:[`repo`,`command`,`key`]}},$u={name:`git_delete_branch`,description:`Delete a local branch from a cloned repo.`,input_schema:{type:`object`,properties:{repo:{type:`string`,description:`Short repo name`},name:{type:`string`,description:`Name of the branch to delete`}},required:[`repo`,`name`]}},ed={name:`git_delete_repo`,description:"Delete the git metadata for a cloned repository while leaving the working tree files in place. Use this to clean up corrupted or stale repos that fail to re-clone. The repo directory remains under repos/<repo>, but the `.git/` metadata is removed.",input_schema:{type:`object`,properties:{repo:{type:`string`,description:`Short repo name (as returned by git_clone or git_list_repos)`}},required:[`repo`]}},td={name:`git_diff`,description:`Show changed files between HEAD and working tree, or between two refs.`,input_schema:{type:`object`,properties:{repo:{type:`string`,description:`Short repo name`},ref1:{type:`string`,description:`First ref (default: HEAD)`},ref2:{type:`string`,description:`Second ref (if omitted, diffs HEAD vs workdir)`}},required:[`repo`]}},nd={name:`git_fetch`,description:`Fetch commits from the remote without merging. Safe for inspecting remote state before deciding to merge or rebase.`,input_schema:{type:`object`,properties:{repo:{type:`string`,description:`Short repo name`},branch:{type:`string`,description:`Remote branch to fetch (default: default branch)`},remote:{type:`string`,description:`Remote name (default: origin)`}},required:[`repo`]}},rd={name:`git_init`,description:`Initialize a new empty git repository in browser storage. Use this to create a new project from scratch before using git_push to push to a remote.`,input_schema:{type:`object`,properties:{repo:{type:`string`,description:`Short name for the new repo (used for all subsequent git_ operations)`}},required:[`repo`]}},id={name:`git_list_repos`,description:`List all git repositories currently cloned in browser storage.`,input_schema:{type:`object`,properties:{}}},ad={name:`git_log`,description:`Show the commit log for a cloned repo. Returns commit SHA, date, author, and message.`,input_schema:{type:`object`,properties:{repo:{type:`string`,description:`Short repo name`},ref:{type:`string`,description:`Ref to log from (default: HEAD)`},depth:{type:`number`,description:`Number of commits to show (default: 10)`}},required:[`repo`]}},od={name:`git_merge`,description:`Merge a branch or ref into the current branch. Supports fast-forward and three-way merges. If the merge has conflicts, a detailed report is returned with the conflicted files and their conflict regions inline. To resolve: use read_file on each conflicted file, then write_file with the complete resolved content (no conflict markers). After all files are resolved, use git_add for each, then git_commit. Do NOT use bash/sed for conflict resolution.`,input_schema:{type:`object`,properties:{repo:{type:`string`,description:`Short repo name`},theirs:{type:`string`,description:`Branch name, tag, or commit SHA to merge into the current branch`},author_name:{type:`string`,description:`Author name (optional, uses configured default)`},author_email:{type:`string`,description:`Author email (optional, uses configured default)`}},required:[`repo`,`theirs`]}},sd={name:`git_pull`,description:`Fetch and merge commits from the remote repository. Uses configured git author name/email for merge commits if needed.`,input_schema:{type:`object`,properties:{repo:{type:`string`,description:`Short repo name`},branch:{type:`string`,description:`Branch to pull (default: current branch)`},author_name:{type:`string`,description:`Author name (optional, uses configured default)`},author_email:{type:`string`,description:`Author email (optional, uses configured default)`}},required:[`repo`]}},cd={name:`git_push`,description:`Push commits to the remote repository. Requires a GitHub personal access token (PAT) to be configured. The token is loaded from the encrypted credential store.`,input_schema:{type:`object`,properties:{repo:{type:`string`,description:`Short repo name`},branch:{type:`string`,description:`Local branch to push (default: current branch)`},remote_ref:{type:`string`,description:`Remote branch name to push to, if different from local branch. Example: push local 'feature-rebased' to remote 'feature/original'.`},force:{type:`boolean`,description:`Force push (default: false)`},tags:{type:`boolean`,description:`Also push all local tags to the remote (default: false)`}},required:[`repo`]}},ld={name:`git_read_file_at_ref`,description:`Read a file's contents at a specific ref (branch, tag, or commit SHA) without checking it out. Useful for code review across branches.`,input_schema:{type:`object`,properties:{repo:{type:`string`,description:`Short repo name`},ref:{type:`string`,description:`Branch name, tag, or commit SHA`},filepath:{type:`string`,description:`File path relative to the repo root`}},required:[`repo`,`ref`,`filepath`]}},ud={name:`git_remote`,description:`Manage git remotes: list, add, or remove a remote in a cloned repo.`,input_schema:{type:`object`,properties:{repo:{type:`string`,description:`Short repo name`},command:{type:`string`,enum:[`list`,`add`,`remove`],description:`Operation to perform`},remote:{type:`string`,description:`Remote name (e.g. origin, upstream) — required for add/remove`},url:{type:`string`,description:`Remote URL — required for add`}},required:[`repo`,`command`]}},dd={name:`git_reset`,description:`Reset the current branch HEAD to a specific ref or commit SHA. Updates the branch pointer and checks out the target, discarding local changes. Equivalent to 'git reset --hard <ref>'.`,input_schema:{type:`object`,properties:{repo:{type:`string`,description:`Short repo name`},ref:{type:`string`,description:`Branch name, tag, or commit SHA to reset to`}},required:[`repo`,`ref`]}},fd={name:`git_show`,description:`Show the metadata and diff of a specific commit. Returns author, date, message, and a unified diff against the parent commit.`,input_schema:{type:`object`,properties:{repo:{type:`string`,description:`Short repo name`},ref:{type:`string`,description:`Commit SHA, branch, or tag to inspect (default: HEAD)`}},required:[`repo`,`ref`]}},pd={name:`git_status`,description:`Show the working tree status of a cloned repo. Reports modified, added, deleted, and unstaged files.`,input_schema:{type:`object`,properties:{repo:{type:`string`,description:`Short repo name`}},required:[`repo`]}},md={name:`git_tag`,description:`Create a lightweight or annotated tag at HEAD. Use git_push with tags=true to push tags to the remote.`,input_schema:{type:`object`,properties:{repo:{type:`string`,description:`Short repo name`},tag:{type:`string`,description:`Tag name (e.g. v1.2.3)`},message:{type:`string`,description:`Annotation message — if provided, creates an annotated tag; otherwise lightweight`},author_name:{type:`string`,description:`Tagger name (optional, uses configured default)`},author_email:{type:`string`,description:`Tagger email (optional, uses configured default)`}},required:[`repo`,`tag`]}},hd={name:`git_unstage`,description:`Remove one or more staged files from the index without touching the working tree. The inverse of git_add — use to undo accidental staging.`,input_schema:{type:`object`,properties:{repo:{type:`string`,description:`Short repo name`},filepath:{type:`string`,description:`File path or array of file paths to unstage (relative to repo root)`}},required:[`repo`,`filepath`]}}})),_d,vd,yd,bd,xd,Sd,Cd,wd=k((()=>{_d={name:`create_task`,description:`Create a scheduled recurring task. The task will run automatically on the specified schedule and send the result back to this group. Uses cron expressions (minute hour day-of-month month day-of-week).`,input_schema:{type:`object`,properties:{schedule:{type:`string`,description:`Cron expression, e.g. "0 9 * * 1-5" for 9am weekdays`},prompt:{type:`string`,description:`The prompt/instruction to execute on each run (used if type is 'prompt')`},type:{type:`string`,enum:[`prompt`,`tools`],description:`The type of task to create. Defaults to 'prompt'.`},tools:{type:`array`,description:`A list of tools to execute sequentially (used if type is 'tools')`,items:{type:`object`,properties:{name:{type:`string`},input:{type:`object`}},required:[`name`,`input`]}},name:{type:`string`,description:`The optional title/name for the task, helping to identify its purpose.`}},required:[`prompt`,`type`]}},vd={name:`list_tasks`,description:`List all scheduled recurring tasks for this group. Returns a list of tasks with their IDs, schedules, and prompts.`,input_schema:{type:`object`,properties:{}}},yd={name:`update_task`,description:`Update an existing scheduled task's schedule or prompt.`,input_schema:{type:`object`,properties:{id:{type:`string`,description:`The unique ID of the task to update`},schedule:{type:`string`,description:`Standard cron expression (e.g. '0 9 * * *'). Leave empty for an unscheduled task.`},prompt:{type:`string`,description:`New prompt/instruction (optional)`},type:{type:`string`,enum:[`prompt`,`tools`],description:`New task type (optional)`},tools:{type:`array`,description:`New list of tools (optional)`,items:{type:`object`,properties:{name:{type:`string`},input:{type:`object`}},required:[`name`,`input`]}},enabled:{type:`boolean`,description:`Whether the task is enabled (optional)`},name:{type:`string`,description:`New name/title for the task (optional).`}},required:[`id`]}},bd={name:`delete_task`,description:`Delete a scheduled task by its ID.`,input_schema:{type:`object`,properties:{id:{type:`string`,description:`The unique ID of the task to delete`}},required:[`id`]}},xd={name:`enable_task`,description:`Enable a scheduled task so it runs on its schedule.`,input_schema:{type:`object`,properties:{id:{type:`string`,description:`The unique ID of the task to enable`}},required:[`id`]}},Sd={name:`disable_task`,description:`Disable a scheduled task so it stops running.`,input_schema:{type:`object`,properties:{id:{type:`string`,description:`The unique ID of the task to disable`}},required:[`id`]}},Cd={name:`run_task`,description:`Immediately trigger a scheduled task by its ID, outside of its normal cron schedule. Use this to manually fire a task on demand. Use list_tasks to find the task ID first.`,input_schema:{type:`object`,properties:{id:{type:`string`,description:`The unique ID of the task to run immediately`}},required:[`id`]}}})),Td,Ed,Dd,Od,kd=k((()=>{Td={name:`create_room`,description:`Create a new multi-party room (a shared PeerJS conversation) hosted by this device. Other agents or humans can then be invited to participate. Returns the room so you can share or invite peers into it.`,input_schema:{type:`object`,properties:{name:{type:`string`,description:`A human-readable name for the room.`}},required:[`name`]}},Ed={name:`invite_to_room`,description:`Invite a peer (another agent or human, identified by their PeerJS peer ID) into a room so they can join the shared conversation. If room_id is omitted and the current conversation is a room, that room is used.`,input_schema:{type:`object`,properties:{peer_id:{type:`string`,description:`The PeerJS peer ID of the participant to invite.`},room_id:{type:`string`,description:`The room id to invite into. Defaults to the current room conversation.`}},required:[`peer_id`]}},Dd={name:`leave_room`,description:`Leave a room. If you are the host, the room is disbanded for all members. If room_id is omitted and the current conversation is a room, that room is used.`,input_schema:{type:`object`,properties:{room_id:{type:`string`,description:`The room id to leave. Defaults to the current room conversation.`}}}},Od={name:`list_room_members`,description:`List the participants (humans and agents) currently in a room. If room_id is omitted and the current conversation is a room, that room is used.`,input_schema:{type:`object`,properties:{room_id:{type:`string`,description:`The room id to inspect. Defaults to the current room conversation.`}}}}})),Ad,jd,Md,Nd,Pd,Fd,Id=k((()=>{Ad={name:`summarize_text`,description:`Summarize text using Web Platform's Summarizer API (or polyfill fallback). Produces key points, TLDR, teaser, or headline.`,input_schema:{type:`object`,properties:{text:{type:`string`,description:`The text content to summarize.`},type:{type:`string`,enum:[`key-points`,`tldr`,`teaser`,`headline`],description:`The summary type (default: key-points).`},format:{type:`string`,enum:[`plain-text`,`markdown`],description:`Output format (default: markdown).`},length:{type:`string`,enum:[`short`,`medium`,`long`],description:`Summary length (default: short).`},preference:{type:`string`,enum:[`capability`,`speed`,`auto`],description:`Summarizer performance preference (default: auto).`},context:{type:`string`,description:`Optional background context for summarization.`},outputLanguage:{type:`string`,description:`Optional target language code (e.g. 'en', 'es').`},sharedContext:{type:`string`,description:`Optional shared context passed to the underlying model.`},overridePrompt:{type:`string`,description:`Optional custom system prompt overriding default summarization instructions.`}},required:[`text`]}},jd={name:`write_text`,description:`Generate or draft text using Web Platform's Writer API (or polyfill fallback).`,input_schema:{type:`object`,properties:{prompt:{type:`string`,description:`The prompt or writing instructions.`},tone:{type:`string`,enum:[`formal`,`neutral`,`casual`],description:`Tone for drafting (default: neutral).`},format:{type:`string`,enum:[`plain-text`,`markdown`],description:`Output format (default: plain-text).`},length:{type:`string`,enum:[`short`,`medium`,`long`],description:`Target length (default: short).`},context:{type:`string`,description:`Optional background context for writing.`},outputLanguage:{type:`string`,description:`Optional target language code (e.g. 'en', 'es').`},sharedContext:{type:`string`,description:`Optional shared context passed to the underlying model.`}},required:[`prompt`]}},Md={name:`rewrite_text`,description:`Rewrite or rephrase text using Web Platform's Rewriter API (or polyfill fallback). Can adjust tone or length.`,input_schema:{type:`object`,properties:{text:{type:`string`,description:`The text to rewrite.`},tone:{type:`string`,enum:[`as-is`,`more-formal`,`more-casual`],description:`Tone adjustment (default: as-is).`},format:{type:`string`,enum:[`as-is`,`plain-text`,`markdown`],description:`Format adjustment (default: as-is).`},length:{type:`string`,enum:[`as-is`,`shorter`,`longer`],description:`Length adjustment (default: as-is).`},context:{type:`string`,description:`Optional background context for rewriting.`},outputLanguage:{type:`string`,description:`Optional target language code (e.g. 'en', 'es').`},sharedContext:{type:`string`,description:`Optional shared context passed to the underlying model.`}},required:[`text`]}},Nd={name:`proofread_text`,description:`Proofread and correct grammar, spelling, and phrasing errors using Web Platform's Proofreader API (or polyfill fallback).`,input_schema:{type:`object`,properties:{text:{type:`string`,description:`The text to proofread.`},context:{type:`string`,description:`Optional background context for proofreading.`}},required:[`text`]}},Pd={name:`detect_language`,description:`Detect the language of input text using Web Platform's Language Detector API (or polyfill fallback).`,input_schema:{type:`object`,properties:{text:{type:`string`,description:`The text to analyze for language detection.`}},required:[`text`]}},Fd={name:`translate_text`,description:`Translate text using Web Platform's Translator API (or polyfill fallback).`,input_schema:{type:`object`,properties:{text:{type:`string`,description:`The text to translate.`},sourceLanguage:{type:`string`,description:`Source language BCP 47 code (e.g. 'en', 'es', 'ja').`},targetLanguage:{type:`string`,description:`Target language BCP 47 code (e.g. 'en', 'es', 'ja').`}},required:[`text`,`sourceLanguage`,`targetLanguage`]}}})),Ld,Rd,zd=k((()=>{Ld={name:`prompt_peer`,description:`Send a prompt or message directly to another connected ShadowClaw peer or agent over WebRTC, triggering their orchestration loop and returning their answer. Use this to ask another agent to perform a task, answer a question, or analyze data.`,input_schema:{type:`object`,properties:{peer_id:{type:`string`,description:`The PeerJS peer ID or client ID of the target agent to prompt.`},prompt:{type:`string`,description:`The prompt, question, or instruction for the peer agent.`},timeout_seconds:{type:`number`,description:`Optional timeout in seconds to wait for the peer agent's response (default: 120).`}},required:[`peer_id`,`prompt`]}},Rd={name:`list_peers`,description:`List the currently connected peers or clients available over WebRTC and the control plane. Returns peer IDs and device labels so you know which peers you can prompt or collaborate with.`,input_schema:{type:`object`,properties:{}}}})),Bd,Vd=k((()=>{Yee(),Xee(),Zee(),Qee(),$ee(),ete(),tte(),vu(),xu(),Du(),ku(),ju(),Gu(),gd(),wd(),kd(),Id(),zd(),Bd=[au,Mu,ru,iu,Nu,Pu,Td,_d,Fu,bd,Pd,Iu,Sd,su,cu,xd,uu,lu,Au,Ku,qu,Ju,Yu,Xu,Zu,Qu,$u,ed,td,nd,rd,id,ad,od,sd,cd,ld,ud,dd,fd,pd,md,hd,Ed,fu,Dd,Tu,Lu,Rd,Od,vd,gu,ou,hu,Ru,zu,Bu,Ld,Nd,Vu,mu,pu,Eu,Md,Cd,Hu,Uu,bu,yu,Ou,Ad,Fd,_u,yd,du,Wu,jd]})),Hd=k((()=>{Vd()})),Ud,Wd=k((()=>{Ud={id:`__builtin_default`,name:`Default`,providerId:`prompt_api`,enabledToolNames:[`javascript`,`list_files`,`open_file`,`read_file`,`write_file`],customTools:[],systemPromptOverride:"You are a helpful coding assistant.\nContent intended to be rendered as a `Page` (HTML or Markdown) SHOULD include frontmatter (title, created, updated, and slug).\nHTML content intended to be rendered as a `Page` SHOULD USE `<article><h2>${subTitle}</h2>...</article>` for its main body content."}}));function Gd(e,t){if(!t||typeof t!=`object`)throw Error(`Tool at ${e} must be a JSON object`);let n=t,r=typeof n.name==`string`?n.name.trim():``,i=typeof n.description==`string`?n.description.trim():``,a=n.input_schema??n.parameters,o=n.execution??n.evaluation;if(!Jd.test(r))throw Error(`Tool name is invalid: ${r||`(missing)`}`);if(!i)throw Error(`Tool ${r} requires a description`);if(!a||typeof a!=`object`)throw Error(`Tool ${r} requires input_schema`);if(!o||typeof o!=`object`)throw Error(`Tool ${r} requires execution`);let s=o,c=s.type;if(c!==`bash`&&c!==`javascript`&&c!==`tool`)throw Error(`Tool ${r} execution type must be bash, javascript, or tool`);if(c===`tool`){if(typeof s.name!=`string`||!Jd.test(s.name))throw Error(`Tool ${r} execution requires a valid tool name`);return{name:r,description:i,input_schema:a,execution:{type:c,name:s.name,...s.input&&typeof s.input==`object`?{input:s.input}:{}},path:e}}let l=c===`bash`?`command`:`code`,u=s[l]??s.expression;if(typeof u!=`string`||u.trim()===``)throw Error(`Tool ${r} execution requires ${l}`);return{name:r,description:i,input_schema:a,execution:{type:c,[l]:u},path:e}}async function Kd(e,t=dt){let n=[],r=[],i=Jt()||t===`br:main`?[t]:[t,dt];for(let t of i)try{let i=await En(e,t),a=[];async function o(e,t){for await(let[n,r]of e.entries()){let e=`${t}/${n}`;r.kind===`directory`?await o(r,e):n.endsWith(`.json`)&&e.startsWith(`.agents/tools/`)&&a.push(e)}}try{await o(await(await i.getDirectoryHandle(`.agents`)).getDirectoryHandle(`tools`),`.agents/tools`)}catch{continue}let s=a.sort((e,t)=>{let n=!e.startsWith(`.agents/tools/main/`);return n===!t.startsWith(`.agents/tools/main/`)?e.localeCompare(t):n?-1:1});for(let i of s)try{let r=Gd(i,JSON.parse(await qo(e,t,i)));n.some(e=>e.name===r.name)||n.push(r)}catch(e){r.push(e instanceof Error?e.message:String(e))}}catch{}return{tools:n,diagnostics:r}}async function qd(e,t=dt,n){try{let{tools:r}=await Kd(e,t),i=r.find(e=>e.name===n)||null;if(!i)return null;let a=await R(e,L.DECLARATIVE_TOOLS_ENABLED);return Array.isArray(a)&&!a.includes(n)?null:i}catch{return null}}var Jd,Yd=k((()=>{Ot(),Qt(),Gt(),Dn(),Jo(),Jd=/^[a-z][a-z0-9_]{0,63}$/}));async function Xd(e){if(typeof e==`string`)return new TextEncoder().encode(e).buffer;if(typeof Blob<`u`&&e instanceof Blob)return e.arrayBuffer();if(e instanceof ArrayBuffer)return e.slice(0);if(ArrayBuffer.isView(e)){let{buffer:t,byteOffset:n,byteLength:r}=e;return t.slice(n,n+r)}return/* @__PURE__ */ new ArrayBuffer(0)}function Zd(e){return Array.from(new Uint8Array(e)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function Qd(e){let t=await Xd(e),r=globalThis.crypto?.subtle??globalThis.window?.crypto?.subtle??(n===void 0?void 0:(await import(`node:crypto`)).webcrypto?.subtle);if(!r)throw Error(`crypto.subtle is not available in current environment`);return Zd(await r.digest(`SHA-256`,t))}var $d=k((()=>{}));function ef(e){try{let t=a(e);return{data:t.data&&typeof t.data==`object`?t.data:{},content:t.content||``}}catch{let t=e.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);if(t){let e=t[1],n=t[2]||``,r=e.split(/\r?\n/).map(e=>{let t=e.match(/^([a-zA-Z0-9_-]+):\s*(.+)$/);if(t){let[,e,n]=t,r=n.trim();if(r&&r!==`true`&&r!==`false`&&r!==`null`&&!r.startsWith(`"`)&&!r.startsWith(`'`)&&!r.startsWith(`[`)&&!r.startsWith(`{`)&&r!==`>`&&r!==`|`&&r!==`>-`&&r!==`|-`&&!/^-?\d+(?:\.\d+)?$/.test(r))return`${e}: ${JSON.stringify(r)}`}return e});try{let e=`---\n${r.join(`
|
|
249
249
|
`)}\n---\n${n}`,t=a(e);return{data:t.data&&typeof t.data==`object`?t.data:{},content:t.content||``}}catch{}let i={},o=e.match(/^name:\s*["']?([^"'\r\n]+)["']?/m);o&&(i.name=o[1].trim());let s=e.match(/^description:\s*(.+)$/m);if(s){let e=s[1].trim();(e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`))&&(e=e.slice(1,-1)),i.description=e}let c=e.match(/^user-invocable:\s*(true|false)/im);c&&(i[`user-invocable`]=c[1].toLowerCase()===`true`);let l=e.match(/^disable-model-invocation:\s*(true|false)/im);l&&(i[`disable-model-invocation`]=l[1].toLowerCase()===`true`);let u=e.match(/^allowed-tools:\s*["']?([^"'\r\n]+)["']?/m);u&&(i[`allowed-tools`]=u[1].trim());let d=e.match(/allowed-tools:\s*\n((?:\s*-\s*[^\r\n]+\r?\n?)+)/m);if(d){let e=d[1].split(/\r?\n/).map(e=>e.replace(/^\s*-\s*/,``).trim()).filter(Boolean);e.length>0&&(i[`allowed-tools`]=e)}return{data:i,content:n}}return{data:{},content:e}}}function tf(e){if(typeof e==`string`){let t=e.trim();return t.length>0?t:void 0}if(Array.isArray(e)){let t=e.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(e=>e.length>0);return t.length>0?t.join(` `):void 0}}function nf(e,t){let n=ef(t),r=n.data,i=typeof r.name==`string`?r.name.trim():``,a=typeof r.description==`string`?r.description.trim():``;if(!i)throw Error(`Skill at ${e} requires a name`);if(!a)throw Error(`Skill ${i} requires a description`);if(i.length>64||!rf.test(i))throw Error(`Skill name must be 1-64 lowercase characters and hyphens: ${i}`);if(a.length>1024)throw Error(`Skill ${i} description must be 1024 characters or fewer`);let o=e.replace(/\/SKILL\.md$/u,``),s=r.metadata&&typeof r.metadata==`object`?r.metadata:void 0,c=tf(s?.[`allowed-tools`])||tf(s?.allowedTools)||tf(r[`allowed-tools`])||tf(r.allowedTools),l=[];if(s){for(let[e,t]of Object.entries(s))if(e!==`execution`&&t!=null){if(e===`allowed-tools`||e===`allowedTools`)c&&l.push([e,c]);else if(typeof t==`string`||typeof t==`number`||typeof t==`boolean`)l.push([e,String(t)]);else if(Array.isArray(t)){let n=t.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(Boolean);n.length>0&&l.push([e,n.join(` `)])}}}let u=l.length>0?Object.fromEntries(l):void 0,d=s?.execution,f;if(d!==void 0){if(!d||typeof d!=`object`||d.type!==`tools`||!Array.isArray(d.tools))throw Error(`Skill ${i} has invalid tools execution`);let e=d,t=typeof e.suppressToast==`boolean`?e.suppressToast:void 0,n=typeof e.suppressOutput==`boolean`?e.suppressOutput:void 0,r=e.tools.map(e=>({...e,...t!==void 0&&e.suppressToast===void 0?{suppressToast:t}:{},...n!==void 0&&e.suppressOutput===void 0?{suppressOutput:n}:{}}));f={type:`tools`,...t===void 0?{}:{suppressToast:t},...n===void 0?{}:{suppressOutput:n},tools:r}}return{name:i,description:a,...typeof r.license==`string`?{license:r.license}:{},...typeof r.compatibility==`string`?{compatibility:r.compatibility}:{},...u?{metadata:u}:{},...typeof c==`string`?{allowedTools:c}:{},...typeof r[`user-invocable`]==`boolean`?{userInvocable:r[`user-invocable`]}:typeof r[`user-invocable`]==`string`&&(r[`user-invocable`].toLowerCase()===`true`||r[`user-invocable`].toLowerCase()===`false`)?{userInvocable:r[`user-invocable`].toLowerCase()===`true`}:{},...typeof r[`disable-model-invocation`]==`boolean`?{disableModelInvocation:r[`disable-model-invocation`]}:typeof r[`disable-model-invocation`]==`string`&&(r[`disable-model-invocation`].toLowerCase()===`true`||r[`disable-model-invocation`].toLowerCase()===`false`)?{disableModelInvocation:r[`disable-model-invocation`].toLowerCase()===`true`}:{},...f?{execution:f}:{},body:n.content.trim(),path:e,basePath:o}}var rf,af=k((()=>{rf=/^[a-z0-9](?:[a-z0-9]|-(?!-))*[a-z0-9]$|^[a-z0-9]$/}));function of(e){let t=e.trim().replace(/\/+$/,``);if(!t)return null;let n=t.match(/^https?:\/\/github\.com\/([a-zA-Z0-9_.-]+)\/([a-zA-Z0-9_.-]+?)(?:\.git)?(?:\/tree\/([^/]+)(?:\/(.+))?)?(?:@([a-zA-Z0-9_.-]+))?$/i);if(n)return{owner:n[1],repo:n[2],ref:n[3]||`HEAD`,subpath:n[4],skillFilter:n[5]};if(!t.includes(`://`)){let e=t.match(/^([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+?)(?:@([a-zA-Z0-9_.-]+))?$/);if(e&&!e[1].includes(`.`))return{owner:e[1],repo:e[2],ref:`HEAD`,skillFilter:e[3]}}return null}function sf(e){let t=e.trim();if(!t)throw Error(`URL cannot be empty`);let n=t;!n.startsWith(`http://`)&&!n.startsWith(`https://`)&&(n=`https://${n}`),n=n.replace(/\/+$/,``);let r=n.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+)\/blob\/([^/]+)\/(.+\/skill\.md)$/i);if(r&&(n=`https://raw.githubusercontent.com/${r[1]}/${r[2]}/${r[3]}/${r[4]}`),/\/skill\.md$/i.test(n)){let e=n.replace(/\/skill\.md$/i,``);return{baseUrl:e,siteUrl:e,manifestUrl:n}}if(n.endsWith(mf)){let e=n.slice(0,-35).replace(/\/+$/,``);return{baseUrl:e,siteUrl:e,manifestUrl:n}}return{baseUrl:n,siteUrl:n,manifestUrl:`${n}/${mf}`}}function cf(e,t){if(!e)return``;try{return new URL(e,t).href}catch{return e}}function lf(e,t){let n=JSON.parse(JSON.stringify(e));return Array.isArray(n.tools)&&(n.tools=n.tools.map(e=>({...e,url:cf(e.url,t)}))),Array.isArray(n.scripts)&&(n.scripts=n.scripts.map(e=>({...e,url:cf(e.url,t)}))),Array.isArray(n.skills)&&(n.skills=n.skills.map(e=>({...e,url:cf(e.url,t),tools:Array.isArray(e.tools)?e.tools.map(e=>({...e,url:e.url?cf(e.url,t):void 0})):void 0,scripts:Array.isArray(e.scripts)?e.scripts.map(e=>({...e,url:e.url?cf(e.url,t):void 0})):void 0}))),n}async function uf(e,t){if(!t||!t.startsWith(`sha256:`))return!0;let n=t.slice(7).trim().toLowerCase();return!n||(await Qd(typeof e==`string`?new TextEncoder().encode(e):e)).toLowerCase()===n}async function df(e,t,n,r){let i=nf(e,n),a={name:i.name,type:`skill-md`,description:i.description,url:e,...r&&r.length>0?{files:r}:{}};return{manifest:{name:i.name,description:i.description,skills:[a]},siteUrl:t,manifestUrl:e}}async function ff(e,t){let n=`https://raw.githubusercontent.com/${e.owner}/${e.repo}/${e.ref}`,r=`https://github.com/${e.owner}/${e.repo}`;if(e.subpath){let r=e.subpath.replace(/^\/+|\/+$/g,``).replace(/\/skill\.md$/i,``),i=`${n}/${r}/SKILL.md`,a=await t(i);if(!a.ok)throw Error(`Failed to fetch discovery manifest: HTTP ${a.status} ${a.statusText||``}`.trim());return df(i,`${n}/${r}`,await a.text())}if(e.skillFilter){let r=[`skills/${e.skillFilter}/SKILL.md`,`.agents/skills/${e.skillFilter}/SKILL.md`,`.agents/skills/main/${e.skillFilter}/SKILL.md`,`${e.skillFilter}/SKILL.md`];for(let e of r){let r=`${n}/${e}`,i=await t(r);if(i.ok)return df(r,r.replace(/\/skill\.md$/i,``),await i.text())}throw Error(`Failed to fetch skill "${e.skillFilter}" from ${e.owner}/${e.repo}`)}let i=`${n}/${mf}`;try{let e=await t(i,{headers:{Accept:`application/json`}});if(e.ok){let t=await e.json();if(t&&typeof t==`object`)return{manifest:lf(t,i),siteUrl:n,manifestUrl:i}}}catch{}let a=`https://api.github.com/repos/${e.owner}/${e.repo}/git/trees/${e.ref}?recursive=1`;try{let i=await t(a,{headers:{Accept:`application/vnd.github+json`}});if(i.ok){let o=((await i.json())?.tree||[]).filter(e=>e?.type===`blob`&&typeof e.path==`string`).map(e=>e.path),s=o.filter(e=>e===`SKILL.md`||e.endsWith(`/SKILL.md`));if(s.length>0){let i=[];for(let e of s){let r=e===`SKILL.md`?``:e.slice(0,-9),a=r?`${r}/`:``,s=o.filter(t=>(r?t.startsWith(a):!t.includes(`/`))&&t!==e).map(e=>r?e.slice(a.length):e),c=`${n}/${e}`,l=await t(c);if(!l.ok)continue;let u=await l.text();try{let t=nf(e,u);i.push({name:t.name,type:`skill-md`,description:t.description,url:c,...s.length>0?{files:[`SKILL.md`,...s]}:{}})}catch{}}if(i.length>0)return{manifest:{name:`${e.owner}/${e.repo}`,description:`Agent skills from ${e.owner}/${e.repo}`,skills:i},siteUrl:r,manifestUrl:a}}}}catch{}let o=`${n}/SKILL.md`,s=await t(o);if(s.ok)return df(o,n,await s.text());throw Error(`Failed to fetch discovery manifest from GitHub repository ${e.owner}/${e.repo}`)}async function pf(e,t=globalThis.fetch){let n=of(e);if(n)return ff(n,t);let{baseUrl:r,manifestUrl:i}=sf(e);if(/\/skill\.md$/i.test(i)){let e=await t(i);if(!e.ok)throw Error(`Failed to fetch discovery manifest: HTTP ${e.status} ${e.statusText}`.trim());return df(i,r,await e.text())}let a=await t(i,{headers:{Accept:`application/json`}});if(!a.ok)throw Error(`Failed to fetch discovery manifest: HTTP ${a.status} ${a.statusText}`.trim());let o=await a.json();if(!o||typeof o!=`object`)throw Error(`Invalid discovery manifest: expected a JSON object`);return{manifest:lf(o,i),siteUrl:r,manifestUrl:i}}var mf,hf=k((()=>{$d(),af(),mf=`.well-known/agent-skills/index.json`}));function gf(e,t){return t?.targetSubdir?`.agents/${e}/${t.targetSubdir}`:t?.siteSlug?`.agents/${e}/imported/${t.siteSlug}`:`.agents/${e}`}async function _f(e,t=dt,n,r){let i=(n.name||``).trim();if(xf.has(i))return{name:i,path:``,status:`failed`,error:`Cannot shadow built-in tool: ${i}`};if(!Sf.test(i))return{name:i,path:``,status:`failed`,error:`Invalid tool name: ${i}`};let a=`${gf(`tools`,r)}/${i}.json`;try{if(await Yo(e,t,a)&&!r?.overwrite)return{name:i,path:a,status:`skipped`};let o=await(r?.fetchFn||globalThis.fetch)(n.url);if(!o.ok)return{name:i,path:a,status:`failed`,error:`HTTP ${o.status} ${o.statusText}`};let s=await o.text();if(n.digest&&!await uf(s,n.digest))return{name:i,path:a,status:`failed`,error:`Integrity verification failed for tool definition`};let c;try{c=JSON.parse(s)}catch{return{name:i,path:a,status:`failed`,error:`Downloaded tool definition is not valid JSON`}}if(Gd(a,c),await Ho(e,t,a,JSON.stringify(c,null,2)),r?.autoEnable){let t=await R(e,L.DECLARATIVE_TOOLS_ENABLED),n=new Set(Array.isArray(t)?t:[]);n.add(i),await B(e,L.DECLARATIVE_TOOLS_ENABLED,Array.from(n))}return{name:i,path:a,status:`imported`}}catch(e){return{name:i,path:a,status:`failed`,error:e instanceof Error?e.message:String(e)}}}async function vf(e,t=dt,n,r){let i=(n.name||``).trim(),a=i.endsWith(`.js`)||i.endsWith(`.mjs`)?i:`${i}.js`,o=`${gf(`scripts`,r)}/${a}`;try{if(await Yo(e,t,o)&&!r?.overwrite)return{name:i,path:o,status:`skipped`};let a=await(r?.fetchFn||globalThis.fetch)(n.url);if(!a.ok)return{name:i,path:o,status:`failed`,error:`HTTP ${a.status} ${a.statusText}`};let s=await a.text();return n.digest&&!await uf(s,n.digest)?{name:i,path:o,status:`failed`,error:`Integrity verification failed for script`}:(await Ho(e,t,o,s),{name:i,path:o,status:`imported`})}catch(e){return{name:i,path:o,status:`failed`,error:e instanceof Error?e.message:String(e)}}}async function yf(e,t=dt,n,r){let i=(n.name||``).trim(),a=`${gf(`skills`,r)}/${i}`,o=`${a}/SKILL.md`;try{if(await Yo(e,t,o)&&!r?.overwrite)return{name:i,path:o,status:`skipped`};let s=r?.fetchFn||globalThis.fetch,c=await s(n.url);if(!c.ok)return{name:i,path:o,status:`failed`,error:`HTTP ${c.status} ${c.statusText}`};let l=await c.text();if(n.digest&&!await uf(l,n.digest))return{name:i,path:o,status:`failed`,error:`Integrity verification failed for skill`};if(nf(o,l),await Ho(e,t,o,l),Array.isArray(n.files)&&n.files.length>0){let r=n.url.replace(/\/skill\.md$/i,`/`);for(let i of n.files){if(typeof i!=`string`)continue;let n=i.replace(/^\/+/,``).replace(/\\/g,`/`);if(n&&n.toLowerCase()!==`skill.md`&&!n.split(`/`).some(e=>e===`..`||e===`.`))try{let i=new URL(n,r.endsWith(`/`)?r:`${r}/`).href,o=await s(i);if(o.ok){let r=await o.text();await Ho(e,t,`${a}/${n}`,r)}}catch{}}}return{name:i,path:o,status:`imported`}}catch(e){return{name:i,path:o,status:`failed`,error:e instanceof Error?e.message:String(e)}}}async function bf(e,t=dt,n,r,i){let a={tools:[],skills:[],scripts:[],diagnostics:[]},o=new Set(r.toolNames||[]),s=new Set(r.skillNames||[]),c=new Set(r.scriptNames||[]),l=n.tools||[],u=n.skills||[],d=n.scripts||[];for(let e of u)if(s.has(e.name)){if(Array.isArray(e.tools))for(let t of e.tools)o.add(t.name);if(Array.isArray(e.scripts))for(let t of e.scripts)c.add(t.name)}for(let n of d)if(c.has(n.name)){let r=await vf(e,t,n,i);a.scripts.push(r),r.status===`failed`&&r.error&&a.diagnostics.push(`Script ${n.name}: ${r.error}`)}for(let n of l)if(o.has(n.name)){let r=await _f(e,t,n,i);a.tools.push(r),r.status===`failed`&&r.error&&a.diagnostics.push(`Tool ${n.name}: ${r.error}`)}for(let n of u)if(s.has(n.name)){let r=await yf(e,t,n,i);a.skills.push(r),r.status===`failed`&&r.error&&a.diagnostics.push(`Skill ${n.name}: ${r.error}`)}return a}var xf,Sf,Cf=k((()=>{Ot(),Gt(),Wo(),Uo(),Xo(),Yd(),Hd(),af(),hf(),xf=new Set(Bd.map(e=>e.name)),Sf=/^[a-z][a-z0-9_]{0,63}$/})),wf,Tf,Ef=k((()=>{Xs(),Ot(),Gt(),Wo(),Hd(),Wd(),Yd(),hf(),Cf(),wf=class{_activeProfile;_activeProfileId;_allTools;_customTools;_declarativeTools;_declarativeToolNamesEnabled;_enabledDeclarativeTools;_enabledToolNames;_enabledTools;_profiles;_systemPromptOverride;_webSearchProxyUrl;_webSearchUrl;_webSearchUseProxy;_searchFilesMaxFileBytes;_searchFilesMaxFilesVisited;_searchFilesSkipDirs;constructor(){this._enabledToolNames=new Ys.State(new Set(Ud.enabledToolNames)),this._customTools=new Ys.State([]),this._declarativeTools=new Ys.State([]),this._declarativeToolNamesEnabled=new Ys.State(null),this._systemPromptOverride=new Ys.State(``),this._profiles=new Ys.State([]),this._activeProfileId=new Ys.State(Ud.id),this._webSearchUseProxy=new Ys.State(!1),this._webSearchProxyUrl=new Ys.State(`/proxy`),this._webSearchUrl=new Ys.State(`https://html.duckduckgo.com/html/?q={query}`),this._searchFilesMaxFileBytes=new Ys.State(524288),this._searchFilesMaxFilesVisited=new Ys.State(1e3),this._searchFilesSkipDirs=new Ys.State(`.git,node_modules,dist,dist-electron,.cache,.nx,.turbo,__pycache__,.venv,venv`),this._allTools=new Ys.Computed(()=>[...Bd,...this._customTools.get()]),this._enabledTools=new Ys.Computed(()=>{let e=this._enabledToolNames.get();return this._allTools.get().filter(t=>e.has(t.name))}),this._enabledDeclarativeTools=new Ys.Computed(()=>{let e=this._declarativeTools.get(),t=this._declarativeToolNamesEnabled.get();return!t||t.size===0?[]:e.filter(e=>t.has(e.name))}),this._activeProfile=new Ys.Computed(()=>{let e=this._activeProfileId.get();return e?Ud.id===e?Ud:this._profiles.get().find(t=>t.id===e)||null:null})}get activeProfile(){return this._activeProfile.get()}get activeProfileId(){return this._activeProfileId.get()}get allTools(){return this._allTools.get()}get customTools(){return this._customTools.get()}get declarativeTools(){return this._declarativeTools.get()}get declarativeToolNamesEnabled(){return this._declarativeToolNamesEnabled.get()}get enabledDeclarativeTools(){return this._enabledDeclarativeTools.get()}get enabledToolNames(){return this._enabledToolNames.get()}get enabledTools(){return this._enabledTools.get()}isDeclarativeToolEnabled(e){let t=this._declarativeToolNamesEnabled.get();return t?t.has(e):!1}async refreshDeclarativeTools(e,t){try{let n=await Kd(e,t||`br:main`),r=this.allTools,i=(n?.tools||[]).filter(e=>!r.some(t=>t.name===e.name)),a=this._declarativeTools.get();return a.length===i.length&&a.every((e,t)=>e.name===i[t].name&&e.description===i[t].description&&JSON.stringify(e.execution)===JSON.stringify(i[t].execution))||this._declarativeTools.set(i),i}catch{return this._declarativeTools.get().length>0&&this._declarativeTools.set([]),[]}}async setDeclarativeToolEnabled(e,t,n){let r=this._declarativeToolNamesEnabled.get(),i=new Set(r===null?[]:r);n?i.add(t):i.delete(t),this._declarativeToolNamesEnabled.set(i),await B(e,L.DECLARATIVE_TOOLS_ENABLED,Array.from(i))}async setAllDeclarativeEnabled(e,t){let n=new Set(t);this._declarativeToolNamesEnabled.set(n),await B(e,L.DECLARATIVE_TOOLS_ENABLED,t)}async fetchRemoteDiscoveryManifest(e){return await pf(e)}async importFromRemoteSite(e,t,n,r){let i=r?.groupId||`br:main`,a=await bf(e,i,t,n,r);return await this.refreshDeclarativeTools(e,i),a}exportBackup(){return JSON.stringify({enabledTools:[...this._enabledToolNames.get()],customTools:this._customTools.get(),declarativeToolsEnabled:this._declarativeToolNamesEnabled.get()?Array.from(this._declarativeToolNamesEnabled.get()):null,systemPromptOverride:this._systemPromptOverride.get(),profiles:this._profiles.get(),activeProfileId:this._activeProfileId.get(),webSearchUseProxy:this._webSearchUseProxy.get(),webSearchProxyUrl:this._webSearchProxyUrl.get(),webSearchUrl:this._webSearchUrl.get(),searchFilesMaxFileBytes:this._searchFilesMaxFileBytes.get(),searchFilesMaxFilesVisited:this._searchFilesMaxFilesVisited.get(),searchFilesSkipDirs:this._searchFilesSkipDirs.get()},null,2)}findProfilesForProvider(e,t){return this.profiles.filter(n=>!(n.providerId&&n.providerId!==e||n.model&&n.model!==t))}get profiles(){return[Ud,...this._profiles.get()]}get systemPromptOverride(){return this._systemPromptOverride.get()}get webSearchProxyUrl(){return this._webSearchProxyUrl.get()}get webSearchUrl(){return this._webSearchUrl.get()}get webSearchUseProxy(){return this._webSearchUseProxy.get()}get searchFilesMaxFileBytes(){return this._searchFilesMaxFileBytes.get()}get searchFilesMaxFilesVisited(){return this._searchFilesMaxFilesVisited.get()}get searchFilesSkipDirs(){return this._searchFilesSkipDirs.get()}get searchFilesSkipDirsSet(){return new Set(this._searchFilesSkipDirs.get().split(`,`).map(e=>e.trim()).filter(Boolean))}async activateProfile(e,t){let n=this.profiles.find(e=>e.id===t);n&&(this._activeProfileId.set(t),this._enabledToolNames.set(new Set(n.enabledToolNames)),this._customTools.set(n.customTools),this._systemPromptOverride.set(n.systemPromptOverride||``),await Promise.all([B(e,L.ACTIVE_TOOL_PROFILE,t),B(e,L.ENABLED_TOOLS,n.enabledToolNames),B(e,L.CUSTOM_TOOLS,n.customTools),B(e,L.SYSTEM_PROMPT_OVERRIDE,n.systemPromptOverride||``)]))}async addCustomTool(e,t){let n=[...this._customTools.get(),t];this._customTools.set(n);let r=new Set(this._enabledToolNames.get());r.add(t.name),this._enabledToolNames.set(r),await Promise.all([B(e,L.CUSTOM_TOOLS,n),B(e,L.ENABLED_TOOLS,[...r])])}async addProfile(e,t){let n=[...this._profiles.get(),t];this._profiles.set(n),await B(e,L.TOOL_PROFILES,n)}async cloneTool(e,t,n,r){let i=this.allTools.find(e=>e.name===t);if(!i||this.allTools.some(e=>e.name===n))return!1;let a={name:n,description:r||i.description,input_schema:JSON.parse(JSON.stringify(i.input_schema))};return await this.addCustomTool(e,a),!0}async deactivateProfile(e){this._activeProfileId.set(null),await B(e,L.ACTIVE_TOOL_PROFILE,null)}async deleteProfile(e,t){if(t===Ud.id)return;let n=this._profiles.get().filter(e=>e.id!==t);this._profiles.set(n),this._activeProfileId.get()===t&&(this._activeProfileId.set(null),await B(e,L.ACTIVE_TOOL_PROFILE,null)),await B(e,L.TOOL_PROFILES,n)}async importBackup(e,t){let n=JSON.parse(t);Array.isArray(n.enabledTools)&&(this._enabledToolNames.set(new Set(n.enabledTools)),await B(e,L.ENABLED_TOOLS,n.enabledTools)),Array.isArray(n.customTools)&&(this._customTools.set(n.customTools),await B(e,L.CUSTOM_TOOLS,n.customTools)),typeof n.systemPromptOverride==`string`&&(this._systemPromptOverride.set(n.systemPromptOverride),await B(e,L.SYSTEM_PROMPT_OVERRIDE,n.systemPromptOverride)),Array.isArray(n.profiles)&&(this._profiles.set(n.profiles),await B(e,L.TOOL_PROFILES,n.profiles)),(typeof n.activeProfileId==`string`||n.activeProfileId===null)&&(this._activeProfileId.set(n.activeProfileId),await B(e,L.ACTIVE_TOOL_PROFILE,n.activeProfileId)),typeof n.webSearchUseProxy==`boolean`&&(this._webSearchUseProxy.set(n.webSearchUseProxy),await B(e,L.WEB_SEARCH_USE_PROXY,n.webSearchUseProxy?`true`:`false`)),typeof n.webSearchProxyUrl==`string`&&(this._webSearchProxyUrl.set(n.webSearchProxyUrl),await B(e,L.WEB_SEARCH_PROXY_URL,n.webSearchProxyUrl)),typeof n.webSearchUrl==`string`&&(this._webSearchUrl.set(n.webSearchUrl),await B(e,L.WEB_SEARCH_URL,n.webSearchUrl)),typeof n.searchFilesMaxFileBytes==`number`&&n.searchFilesMaxFileBytes>0&&(this._searchFilesMaxFileBytes.set(n.searchFilesMaxFileBytes),await B(e,L.SEARCH_FILES_MAX_FILE_BYTES,String(n.searchFilesMaxFileBytes))),typeof n.searchFilesMaxFilesVisited==`number`&&n.searchFilesMaxFilesVisited>0&&(this._searchFilesMaxFilesVisited.set(n.searchFilesMaxFilesVisited),await B(e,L.SEARCH_FILES_MAX_FILES_VISITED,String(n.searchFilesMaxFilesVisited))),typeof n.searchFilesSkipDirs==`string`&&(this._searchFilesSkipDirs.set(n.searchFilesSkipDirs),await B(e,L.SEARCH_FILES_SKIP_DIRS,n.searchFilesSkipDirs)),Array.isArray(n.declarativeToolsEnabled)?(this._declarativeToolNamesEnabled.set(new Set(n.declarativeToolsEnabled)),await B(e,L.DECLARATIVE_TOOLS_ENABLED,n.declarativeToolsEnabled)):n.declarativeToolsEnabled===null&&(this._declarativeToolNamesEnabled.set(null),await B(e,L.DECLARATIVE_TOOLS_ENABLED,null))}async load(e){let[t,n,r,i,a,o,s,c,l,u,d,f]=await Promise.all([R(e,L.ENABLED_TOOLS),R(e,L.CUSTOM_TOOLS),R(e,L.SYSTEM_PROMPT_OVERRIDE),R(e,L.TOOL_PROFILES),R(e,L.ACTIVE_TOOL_PROFILE),R(e,L.WEB_SEARCH_USE_PROXY),R(e,L.WEB_SEARCH_PROXY_URL),R(e,L.WEB_SEARCH_URL),R(e,L.SEARCH_FILES_MAX_FILE_BYTES),R(e,L.SEARCH_FILES_MAX_FILES_VISITED),R(e,L.SEARCH_FILES_SKIP_DIRS),R(e,L.DECLARATIVE_TOOLS_ENABLED)]);if(Array.isArray(t)&&this._enabledToolNames.set(new Set(t)),Array.isArray(n)&&this._customTools.set(n),Array.isArray(f)&&this._declarativeToolNamesEnabled.set(new Set(f)),typeof r==`string`&&this._systemPromptOverride.set(r),Array.isArray(i)&&this._profiles.set(i),typeof a==`string`&&this._activeProfileId.set(a),o!=null){let e=String(o).toLowerCase();this._webSearchUseProxy.set(e===`true`||e===`1`)}if(typeof s==`string`&&s.trim().length>0&&this._webSearchProxyUrl.set(s.trim()),typeof c==`string`&&c.trim().length>0&&this._webSearchUrl.set(c.trim()),l!=null){let e=Number(l);Number.isFinite(e)&&e>0&&this._searchFilesMaxFileBytes.set(e)}if(u!=null){let e=Number(u);Number.isFinite(e)&&e>0&&this._searchFilesMaxFilesVisited.set(e)}typeof d==`string`&&d.trim().length>0&&this._searchFilesSkipDirs.set(d.trim())}async setWebSearchProxyUrl(e,t){let n=t.trim()||`/proxy`;this._webSearchProxyUrl.set(n),await B(e,L.WEB_SEARCH_PROXY_URL,n)}async setWebSearchUrl(e,t){let n=t.trim()||`https://html.duckduckgo.com/html/?q={query}`;this._webSearchUrl.set(n),await B(e,L.WEB_SEARCH_URL,n)}async setWebSearchUseProxy(e,t){let n=!!t;this._webSearchUseProxy.set(n),await B(e,L.WEB_SEARCH_USE_PROXY,n?`true`:`false`)}async setSearchFilesMaxFileBytes(e,t){let n=Math.max(1,Math.round(t));this._searchFilesMaxFileBytes.set(n),await B(e,L.SEARCH_FILES_MAX_FILE_BYTES,String(n))}async setSearchFilesMaxFilesVisited(e,t){let n=Math.max(1,Math.round(t));this._searchFilesMaxFilesVisited.set(n),await B(e,L.SEARCH_FILES_MAX_FILES_VISITED,String(n))}async setSearchFilesSkipDirs(e,t){let n=t.trim();this._searchFilesSkipDirs.set(n),await B(e,L.SEARCH_FILES_SKIP_DIRS,n)}async removeCustomTool(e,t){let n=this._customTools.get().filter(e=>e.name!==t);this._customTools.set(n);let r=new Set(this._enabledToolNames.get());r.delete(t),this._enabledToolNames.set(r),await Promise.all([B(e,L.CUSTOM_TOOLS,n),B(e,L.ENABLED_TOOLS,[...r])])}async saveToActiveProfile(e){let t=this._activeProfileId.get();if(!t)return;let n=this._profiles.get().find(e=>e.id===t);if(!n)return;let r={...n,enabledToolNames:[...this._enabledToolNames.get()],customTools:[...this._customTools.get()],systemPromptOverride:this._systemPromptOverride.get()};await this.updateProfile(e,r)}async setAllEnabled(e,t){this._enabledToolNames.set(new Set(t));let n=[B(e,L.ENABLED_TOOLS,t)];this._activeProfileId.get()&&(this._activeProfileId.set(null),n.push(B(e,L.ACTIVE_TOOL_PROFILE,null))),await Promise.all(n)}async setSystemPromptOverride(e,t){this._systemPromptOverride.set(t),await B(e,L.SYSTEM_PROMPT_OVERRIDE,t)}async setToolEnabled(e,t,n){let r=new Set(this._enabledToolNames.get());n?r.add(t):r.delete(t),this._enabledToolNames.set(r);let i=[B(e,L.ENABLED_TOOLS,[...r])];this._activeProfileId.get()&&(this._activeProfileId.set(null),i.push(B(e,L.ACTIVE_TOOL_PROFILE,null))),await Promise.all(i)}async updateProfile(e,t){let n=this._profiles.get().map(e=>e.id===t.id?t:e);this._profiles.set(n),await B(e,L.TOOL_PROFILES,n)}},Tf=new wf}));function Df(e,t,n){let r=(t||``).toLowerCase();return r?n&&(r.includes(`api key not configured`)||r.includes(`go to settings to add your api key`)||r.includes(`missing api key`)||r.includes(`no api key`))?`api-key-missing`:n&&(r.includes(`invalid api key`)||r.includes(`incorrect api key`)||r.includes(`authentication failed`)||r.includes(`401`)||r.includes(`403`)||r.includes(`unauthorized`)||r.includes(`forbidden`))?`api-key-invalid`:r.includes(`429`)||r.includes(`rate limit`)||r.includes(`too many requests`)?`rate-limited`:r.includes(`failed to fetch`)||r.includes(`networkerror`)||r.includes(`network error`)||r.includes(`econnrefused`)||r.includes(`connection refused`)||r.includes(`enotfound`)||r.includes(`timed out`)||r.includes(`timeout`)||r.includes(`503`)||r.includes(`502`)?`provider-unreachable`:null:null}var Of=k((()=>{Ot()}));function nte(e){if(typeof e.size==`number`&&e.size>0)return e.size;if(typeof e.data==`string`&&e.data.length>0){let t=e.data.endsWith(`==`)?2:+!!e.data.endsWith(`=`);return Math.max(0,Math.floor(e.data.length*3/4)-t)}return 0}function rte(e){return e?e.startsWith(`text/`)||e===`json`||e===`xml`||e===`javascript`||e===`csv`||e===`markdown`:!1}function ite(e){let t=nte(e);if(t===0)return 0;switch(e.mediaType){case`image`:return Nf;case`audio`:return Pf;case`video`:return Ff;default:return rte(e.mimeType)?Math.ceil(t/jf):Math.ceil(t/If)}}function kf(e){return e?Math.ceil(e.length/jf):0}function Af(e){let t=0;if(typeof e.content==`string`)t=kf(e.content);else if(Array.isArray(e.content))for(let n of e.content)if(n.type===`text`&&n.text)t+=kf(n.text);else if(n.type===`tool_use`)t+=kf(n.name),t+=kf(JSON.stringify(n.input));else if(n.type===`tool_result`){let e=n.content;t+=kf(typeof e==`string`?e:JSON.stringify(e))}else n.type===`attachment`&&(t+=kf(n.fileName),t+=kf(n.mimeType),t+=kf(n.path),t+=ite(n));return t+Mf}var jf,Mf,Nf,Pf,Ff,If,Lf=k((()=>{jf=4,Mf=4,Nf=1500,Pf=1500,Ff=2500,If=16}));function ate(e,t){if(!e)return``;if(e.length<=t)return e;let n=e.slice(0,t).lastIndexOf(`
|
|
250
|
-
`),r=n>t*.5?n:t;return`${e.slice(0,r)}\n[...truncated ${e.length-r} chars]`}var ote=k((()=>{}));function Rf(e,t){let{contextLimit:n,systemPromptTokens:r,maxOutputTokens:i,skimTop:a=!1}=t;if(e.length===0)return{messages:[],estimatedTokens:0,truncatedCount:0,contextLimit:n,usagePercent:0};let o=Math.max(0,n-r-i),s=Math.min(zf,Math.max(1e3,Math.floor(o*.6*4))),c=e.map(e=>ste(e,s)),l=0,u=c.length,d=null,f=0;if(a&&c.length>0){let e=c[0];(e.role===`user`||e.role===`system`)&&(f=Af(e),f<=o&&(d=e))}let p=o-f;for(let e=c.length-1;e>=+!!d;e--){let t=Af(c[e]),n=c[e],r=!1;if(n.role===`user`&&Array.isArray(n.content)&&n.content.some(e=>e.type===`tool_result`)){let n=c[e-1];n&&n.role===`assistant`&&Array.isArray(n.content)&&n.content.some(e=>e.type===`tool_use`)&&(r=!0,t+=Af(n))}if(l+t>p&&e<c.length-1)break;l+=t,r?(u=e-1,e--):u=e}let m=c.slice(u),h=u;d&&u>0&&(m=[d,...m],h=Math.max(0,u-1));let g=l+f,_=g+r,v=n>0?Math.round(_/n*100*10)/10:0;return{messages:m,estimatedTokens:g,truncatedCount:h,contextLimit:n,usagePercent:v}}function ste(e,t){if(!Array.isArray(e.content))return e;let n=e.content.map(e=>e.type===`tool_result`&&typeof e.content==`string`?{...e,content:ate(e.content,t)}:e);return{...e,content:n}}var zf,Bf=k((()=>{Lf(),ote(),zf=25e3}));function Vf(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n){let i=e.subarray(r,r+n);t+=String.fromCharCode(...i)}return btoa(t)}function cte(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var Hf=k((()=>{}));function Uf(e){return e&&(e.split(/[?#]/,1)[0].replace(/\\/g,`/`).split(`/`).pop()||``).toLowerCase().split(`.`).pop()||``}function Wf(e,t){let n=Uf(e);return qf[n]??t}function Gf(e){let t=Uf(e);return Kf[t]||null}function lte(e){return Gf(e)!==null}function ute(e){let t=Uf(e);if(t===`md`||t===`markdown`||t===`txt`)return`text/plain`;if(t===`pdf`)return`application/pdf`;if(Kf[t])return Kf[t]}var Kf,qf,Jf=k((()=>{Kf={apng:`image/apng`,avif:`image/avif`,bmp:`image/bmp`,gif:`image/gif`,heic:`image/heic`,heif:`image/heif`,ico:`image/x-icon`,jpeg:`image/jpeg`,jpg:`image/jpeg`,png:`image/png`,svg:`image/svg+xml`,tif:`image/tiff`,tiff:`image/tiff`,webp:`image/webp`},qf={...Kf,"3gp":`video/3gpp`,aac:`audio/aac`,avi:`video/x-msvideo`,bin:`application/octet-stream`,css:`text/css`,csv:`text/csv`,db:`application/vnd.sqlite3`,dll:`application/octet-stream`,dmg:`application/octet-stream`,dylib:`application/octet-stream`,exe:`application/vnd.microsoft.portable-executable`,flac:`audio/flac`,flv:`video/x-flv`,gz:`application/gzip`,htm:`text/html`,html:`text/html`,iso:`application/octet-stream`,js:`text/javascript`,json:`application/json`,m4a:`audio/mp4`,m4v:`video/mp4`,markdown:`text/markdown`,md:`text/markdown`,mjs:`text/javascript`,mkv:`video/x-matroska`,mov:`video/mp4`,mp3:`audio/mpeg`,mp4:`video/mp4`,oga:`audio/ogg`,ogg:`audio/ogg`,ogv:`video/ogg`,pdf:`application/pdf`,rar:`application/vnd.rar`,so:`application/octet-stream`,sqlite:`application/vnd.sqlite3`,sqlite3:`application/vnd.sqlite3`,tar:`application/x-tar`,ts:`text/typescript`,tsx:`text/typescript`,txt:`text/plain`,wasm:`application/wasm`,wav:`audio/wav`,weba:`audio/webm`,webm:`video/webm`,wmv:`video/x-ms-wmv`,xml:`application/xml`,yaml:`text/yaml`,yml:`text/yaml`,zip:`application/zip`}}));function dte(e=``,t=``){let n=(e&&e!==`application/octet-stream`?e:Wf(t)||e).toLowerCase(),r=t.toLowerCase();return n.startsWith(`text/`)||n.includes(`json`)||n.includes(`xml`)||r.endsWith(`.md`)||r.endsWith(`.txt`)?`text`:n.startsWith(`image/`)?`image`:n.startsWith(`audio/`)?`audio`:n.startsWith(`video/`)?`video`:n===`application/pdf`||r.endsWith(`.pdf`)?`document`:`file`}function Yf(e){let t=(e||``).toLowerCase(),n=je.getModelInfo(t);if(n){let e=n.supportsImageInput===!0||n.routesByRequestFeatures===!0,t=n.supportsAudioInput===!0||n.routesByRequestFeatures===!0,r=n.supportsVideoInput===!0||n.routesByRequestFeatures===!0,i=n.supportsDocumentInput===!0||n.routesByRequestFeatures===!0;if(n.supportsImageInput!==void 0||n.supportsAudioInput!==void 0||n.supportsVideoInput!==void 0||n.supportsDocumentInput!==void 0||n.routesByRequestFeatures)return{images:e,audio:t,video:r,documents:i,routerByFeatures:!!n.routesByRequestFeatures,source:`metadata`}}let r=t.includes(`no-vision`)||t.includes(`non-vision`)||t.includes(`text-only`),i=t===`openrouter/free`||t===`openrouter/auto`,a=!r&&[`gpt-4o`,`gpt-4.1`,`gpt-5`,`gpt-6`,`astra`,`claude-3`,`claude-4`,`claude-5`,`claude-sonnet`,`claude-haiku`,`claude-opus`,`claude-fable`,`claude-mythos`,`gemini`,`omni`,`llava`,`qwen-vl`,`-vl`,`vision`,`pixtral`].some(e=>t.includes(e)),o=!r&&(t.includes(`claude-3-5`)||t.includes(`claude-3.5`)||t.includes(`claude-3-7`)||t.includes(`claude-3.7`)||t.includes(`claude-4`)||t.includes(`claude-5`)||t.includes(`claude-fable`)||t.includes(`claude-mythos`)||t.includes(`gemini`)||t.includes(`gpt-4.1`)||t.includes(`gpt-5`)||t.includes(`gpt-6`)||t.includes(`astra`)||/claude-(?:sonnet|haiku|opus|fable|mythos)-\d/.test(t));return a?{images:!0,audio:t.includes(`omni`)||t.includes(`audio`),video:t.includes(`omni`)||t.includes(`video`)||t.includes(`gemini`),documents:o,routerByFeatures:i,source:`heuristic`}:{images:!1,audio:!1,video:!1,documents:!1,routerByFeatures:i,source:`unknown`}}var Xf=k((()=>{Me(),Jf()}));async function fte(e=[],t,n={}){let r=n.maxInlineTextBytes??102400,i=[];for(let n of e){let e=n.mimeType||`application/octet-stream`,
|
|
250
|
+
`),r=n>t*.5?n:t;return`${e.slice(0,r)}\n[...truncated ${e.length-r} chars]`}var ote=k((()=>{}));function Rf(e,t){let{contextLimit:n,systemPromptTokens:r,maxOutputTokens:i,skimTop:a=!1}=t;if(e.length===0)return{messages:[],estimatedTokens:0,truncatedCount:0,contextLimit:n,usagePercent:0};let o=Math.max(0,n-r-i),s=Math.min(zf,Math.max(1e3,Math.floor(o*.6*4))),c=e.map(e=>ste(e,s)),l=0,u=c.length,d=null,f=0;if(a&&c.length>0){let e=c[0];(e.role===`user`||e.role===`system`)&&(f=Af(e),f<=o&&(d=e))}let p=o-f;for(let e=c.length-1;e>=+!!d;e--){let t=Af(c[e]),n=c[e],r=!1;if(n.role===`user`&&Array.isArray(n.content)&&n.content.some(e=>e.type===`tool_result`)){let n=c[e-1];n&&n.role===`assistant`&&Array.isArray(n.content)&&n.content.some(e=>e.type===`tool_use`)&&(r=!0,t+=Af(n))}if(l+t>p&&e<c.length-1)break;l+=t,r?(u=e-1,e--):u=e}let m=c.slice(u),h=u;d&&u>0&&(m=[d,...m],h=Math.max(0,u-1));let g=l+f,_=g+r,v=n>0?Math.round(_/n*100*10)/10:0;return{messages:m,estimatedTokens:g,truncatedCount:h,contextLimit:n,usagePercent:v}}function ste(e,t){if(!Array.isArray(e.content))return e;let n=e.content.map(e=>e.type===`tool_result`&&typeof e.content==`string`?{...e,content:ate(e.content,t)}:e);return{...e,content:n}}var zf,Bf=k((()=>{Lf(),ote(),zf=25e3}));function Vf(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n){let i=e.subarray(r,r+n);t+=String.fromCharCode(...i)}return btoa(t)}function cte(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var Hf=k((()=>{}));function Uf(e){return e&&(e.split(/[?#]/,1)[0].replace(/\\/g,`/`).split(`/`).pop()||``).toLowerCase().split(`.`).pop()||``}function Wf(e,t){let n=Uf(e);return qf[n]??t}function Gf(e){let t=Uf(e);return Kf[t]||null}function lte(e){return Gf(e)!==null}function ute(e){let t=Uf(e);if(t===`md`||t===`markdown`||t===`txt`)return`text/plain`;if(t===`pdf`)return`application/pdf`;if(Kf[t])return Kf[t]}var Kf,qf,Jf=k((()=>{Kf={apng:`image/apng`,avif:`image/avif`,bmp:`image/bmp`,gif:`image/gif`,heic:`image/heic`,heif:`image/heif`,ico:`image/x-icon`,jpeg:`image/jpeg`,jpg:`image/jpeg`,png:`image/png`,svg:`image/svg+xml`,tif:`image/tiff`,tiff:`image/tiff`,webp:`image/webp`},qf={...Kf,"3gp":`video/3gpp`,aac:`audio/aac`,avi:`video/x-msvideo`,bin:`application/octet-stream`,css:`text/css`,csv:`text/csv`,db:`application/vnd.sqlite3`,dll:`application/octet-stream`,dmg:`application/octet-stream`,dylib:`application/octet-stream`,exe:`application/vnd.microsoft.portable-executable`,flac:`audio/flac`,flv:`video/x-flv`,gz:`application/gzip`,htm:`text/html`,html:`text/html`,iso:`application/octet-stream`,js:`text/javascript`,json:`application/json`,m4a:`audio/mp4`,m4v:`video/mp4`,markdown:`text/markdown`,md:`text/markdown`,mjs:`text/javascript`,mkv:`video/x-matroska`,mov:`video/mp4`,mp3:`audio/mpeg`,mp4:`video/mp4`,oga:`audio/ogg`,ogg:`audio/ogg`,ogv:`video/ogg`,pdf:`application/pdf`,rar:`application/vnd.rar`,so:`application/octet-stream`,sqlite:`application/vnd.sqlite3`,sqlite3:`application/vnd.sqlite3`,tar:`application/x-tar`,ts:`text/typescript`,tsx:`text/typescript`,txt:`text/plain`,wasm:`application/wasm`,wav:`audio/wav`,weba:`audio/webm`,webm:`video/webm`,wmv:`video/x-ms-wmv`,xml:`application/xml`,yaml:`text/yaml`,yml:`text/yaml`,zip:`application/zip`}}));function dte(e=``,t=``){let n=(e&&e!==`application/octet-stream`?e:Wf(t)||e).toLowerCase(),r=t.toLowerCase();return n.startsWith(`text/`)||n.includes(`json`)||n.includes(`xml`)||r.endsWith(`.md`)||r.endsWith(`.txt`)?`text`:n.startsWith(`image/`)?`image`:n.startsWith(`audio/`)?`audio`:n.startsWith(`video/`)?`video`:n===`application/pdf`||r.endsWith(`.pdf`)?`document`:`file`}function Yf(e){let t=(e||``).toLowerCase(),n=je.getModelInfo(t);if(n){let e=n.supportsImageInput===!0||n.routesByRequestFeatures===!0,t=n.supportsAudioInput===!0||n.routesByRequestFeatures===!0,r=n.supportsVideoInput===!0||n.routesByRequestFeatures===!0,i=n.supportsDocumentInput===!0||n.routesByRequestFeatures===!0;if(n.supportsImageInput!==void 0||n.supportsAudioInput!==void 0||n.supportsVideoInput!==void 0||n.supportsDocumentInput!==void 0||n.routesByRequestFeatures)return{images:e,audio:t,video:r,documents:i,routerByFeatures:!!n.routesByRequestFeatures,source:`metadata`}}let r=t.includes(`no-vision`)||t.includes(`non-vision`)||t.includes(`text-only`),i=t===`openrouter/free`||t===`openrouter/auto`,a=!r&&[`gpt-4o`,`gpt-4.1`,`gpt-5`,`gpt-6`,`astra`,`claude-3`,`claude-4`,`claude-5`,`claude-sonnet`,`claude-haiku`,`claude-opus`,`claude-fable`,`claude-mythos`,`gemini`,`omni`,`llava`,`qwen-vl`,`-vl`,`vision`,`pixtral`].some(e=>t.includes(e)),o=!r&&(t.includes(`claude-3-5`)||t.includes(`claude-3.5`)||t.includes(`claude-3-7`)||t.includes(`claude-3.7`)||t.includes(`claude-4`)||t.includes(`claude-5`)||t.includes(`claude-fable`)||t.includes(`claude-mythos`)||t.includes(`gemini`)||t.includes(`gpt-4.1`)||t.includes(`gpt-5`)||t.includes(`gpt-6`)||t.includes(`astra`)||/claude-(?:sonnet|haiku|opus|fable|mythos)-\d/.test(t));return a?{images:!0,audio:t.includes(`omni`)||t.includes(`audio`),video:t.includes(`omni`)||t.includes(`video`)||t.includes(`gemini`),documents:o,routerByFeatures:i,source:`heuristic`}:{images:!1,audio:!1,video:!1,documents:!1,routerByFeatures:i,source:`unknown`}}var Xf=k((()=>{Me(),Jf()}));async function fte(e=[],t,n={}){let r=n.maxInlineTextBytes??102400,i=n.maxImageBytes??3145728,a=[];for(let n of e){let e=n.mimeType||`application/octet-stream`,o=dte(e,n.fileName),s=o===`text`?`file`:o===`document`?`document`:o,c=null;try{c=await t(n)}catch{c=null}let l=c?.length??(typeof n.size==`number`?n.size:0);if(o===`text`&&c&&l<=r)try{let e=new TextDecoder(`utf-8`).decode(c),t=e.includes("```")?`~~~~`:"```";a.push({type:`text`,text:`Attachment: ${n.fileName}\n${t}\n${e}\n${t}`});continue}catch{}let u={type:`attachment`,mediaType:s,fileName:n.fileName,mimeType:e,size:n.size,path:n.path};c&&(s===`image`&&l<=i||s===`audio`&&l<=5242880||s===`document`&&l<=20971520)&&(u.data=Vf(c)),a.push(u)}return a}var pte=k((()=>{Hf(),Xf()}));async function mte(e,t){let n=await Tc(e,t),r=await At();return await Promise.all(n.map(async t=>{if(t.isFromMe)return{role:`assistant`,content:t.content};let n=`${t.sender}: ${t.content}`,i=t.attachments||[];if(i.length===0)return{role:`user`,content:n};let a=await fte(i,async t=>!r||!t.path?null:oi(r,e,t.path));return a.length===0?{role:`user`,content:n}:{role:`user`,content:[{type:`text`,text:n},...a]}}))}var hte=k((()=>{pte(),si(),It(),Dc()}));function gte(e){for(let t of Qf)if(t.test(e))return!0;return!1}function _te(e){let t=String(e||``),n=t;for(let e of Qf)t=t.replace(e,``);return t!==n&&(t=t.replace(/^[ \t]+$/gm,``),t=t.replace(/\n{3,}/g,`
|
|
251
251
|
|
|
252
252
|
`)),t}function Zf(e,t){let n=_te(e);return n!==e&>e(e)&&console.info(`[ShadowClaw] Chat-template control token(s) detected and stripped from "${t}" output. The provider or model may not be applying its chat template correctly. Original length: ${e.length}, cleaned length: ${n.length}.`),n}var Qf,$f=k((()=>{Qf=[/<\|start_header_id\|>\s*(?:system|user|assistant|tool)\s*<\|end_header_id\|>/gi,/<\|(?:begin_of_text|end_of_text|eot_id|im_start|im_end|end_of_message)\|>/gi,/<\|(?:startofturn|endofturn|start_of_turn|end_of_turn)\|>/gi,/<\|(?:image|audio|video|tool_call|tool_response|tool_result|function_call)\|>|<\|\/function_call\|>/gi,/<|(?:system|user|assistant|im_start|im_end)|>/g,/\[\s*INST\s*\]|\[\s*\/INST\s*\]|<<\s*SYS\s*>>|<<\s*\/SYS\s*>>/gi,/<\/?s>|<\/?bos>|<\/?eos>|<\|(?:bos|eos|pad|unk)\|>/gi,/<\|(?:START_OF_TURN_TOKEN|END_OF_TURN_TOKEN|CHATBOT_TOKEN|USER_TOKEN|SYSTEM_TOKEN)\|>/gi,/<\|(?:system|user|assistant|end|endoftext|placeholder\d*)\|>/gi,/<|(?:begin▁of▁sentence|end▁of▁sentence)|>/g,/<\|start\|>\s*(?:system|user|assistant|tool)\s*<\|message\|>/gi]}));function ep(e,t,n,r){return{type:`thinking-log`,payload:{groupId:e,level:t,timestamp:Date.now(),label:n,message:r||``}}}var tp=k((()=>{}));function np(e,t,n){return{type:`tool-activity`,payload:{groupId:e,tool:t,status:n}}}var rp=k((()=>{}));async function ip(e,t,n,r){let{dirs:i,filename:a}=ii(n);for(let n=0;n<2;n++)try{let n=await En(e,t);for(let e of i)n=await n.getDirectoryHandle(e,{create:!0});let o=await n.getFileHandle(a,{create:!0});try{await Ro(o,r);return}catch(t){if(!((t instanceof Error?t.message:String(t)).includes(`Writable file streams are not supported`)&&(await Cn(e)).type===`opfs`))throw t}let s=t.replace(/:/g,`-`);await zo([gn(),`groups`,s,...i,a],r);return}catch(e){if(n===0&&Sn(e)){xn();continue}throw e}}var vte=k((()=>{Dn(),ai(),Tn(),Vo()}));function yte(){return new Promise((e,t)=>{let n=indexedDB.open(cp,1);n.onupgradeneeded=()=>{n.result.createObjectStore(lp)},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}async function ap(){let e=await yte();if(!e)return null;let t=await new Promise((t,n)=>{let r=e.transaction(lp,`readonly`).objectStore(lp).get(up);r.onsuccess=()=>t(r.result),r.onerror=()=>n(r.error)});if(t)return e.close(),t;let n=await crypto.subtle.generateKey({name:`AES-GCM`,length:256},!1,[`encrypt`,`decrypt`]);try{await new Promise((t,r)=>{let i=e.transaction(lp,`readwrite`);i.objectStore(lp).put(n,up),i.oncomplete=()=>t(),i.onerror=()=>r(i.error)})}finally{e.close()}return n}async function op(e){let t=await ap();if(!t)return null;let n=crypto.getRandomValues(new Uint8Array(dp)),r=await crypto.subtle.encrypt({name:`AES-GCM`,iv:n},t,new TextEncoder().encode(e)),i=new Uint8Array(n.length+new Uint8Array(r).length);return i.set(n),i.set(new Uint8Array(r),n.length),btoa(String.fromCharCode(...i))}async function sp(e){let t=await ap();if(!t)return null;let n=Uint8Array.from(atob(e),e=>e.charCodeAt(0)),r=n.slice(0,dp),i=n.slice(dp),a=await crypto.subtle.decrypt({name:`AES-GCM`,iv:r},t,i);return new TextDecoder().decode(a)}var cp,lp,up,dp,fp=k((()=>{cp=`shadowclaw-keystore`,lp=`keys`,up=`api-key-encryption`,dp=12}));function pp(e){return!e||e.authMode===`token`||e.authMode===`pat`?`token`:e.authMode===`basic`?`basic`:e.authMode===`oauth`||e.oauthProviderId||e.oauthClientId||e.oauthClientSecret||e.refreshToken||e.accessTokenExpiresAt||e.tokenType||e.oauthReauthRequired?`oauth`:`token`}var mp=k((()=>{}));function hp(e){return pp(e)}function bte(e,t){return hp(e)!==`oauth`||e.oauthReauthRequired||!e.refreshToken||!e.oauthProviderId||!e.oauthClientId?!1:t.forceRefresh?!0:e.accessTokenExpiresAt?e.accessTokenExpiresAt<=Date.now()+yp:!1}async function xte(e,t,n){if(!n.refreshToken||!n.oauthProviderId||!n.oauthClientId)return n;let r=await sp(n.refreshToken);if(!r)return n;let i=n.oauthClientSecret?await sp(n.oauthClientSecret):void 0,a=async r=>{let i=t.findIndex(e=>e.id===n.id);i!==-1&&(t[i]=r,await B(e,L.SERVICE_ACCOUNTS,t))},o=async()=>{let e=(n.oauthRefreshFailureCount||0)+1,t=e>=bp,r={...n,oauthRefreshFailureCount:e,oauthReauthRequired:t,oauthReauthRequiredAt:t?n.oauthReauthRequiredAt||Date.now():void 0};return await a(r),r};try{let e=await fetch(`/oauth/refresh`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({providerId:n.oauthProviderId,clientId:n.oauthClientId,clientSecret:i,refreshToken:r,scope:n.scopes,tokenUrl:n.oauthCustomTokenUrl})});if(!e.ok)return o();let t=await e.json();if(!t.accessToken)return o();let s=await op(t.accessToken);if(!s)return o();let c=n.refreshToken;if(t.refreshToken){let e=await op(t.refreshToken);e&&(c=e)}let l={...n,token:s,refreshToken:c,accessTokenExpiresAt:t.expiresIn?Date.now()+t.expiresIn*1e3:n.accessTokenExpiresAt,tokenType:t.tokenType||n.tokenType,scopes:t.scope?t.scope.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean):n.scopes,oauthRefreshFailureCount:0,oauthReauthRequired:!1,oauthReauthRequiredAt:void 0};return await a(l),l}catch{return o()}}function gp(e,t){if(e.oauthProviderId){let t=nt(e.oauthProviderId);if(t)return t}let n=[e.service,e.hostPattern,t].filter(e=>!!e).map(e=>e.toLowerCase());for(let e of Object.values(I))if([e.providerId,...e.aliases||[]].map(e=>e.toLowerCase()).some(e=>n.some(t=>t.includes(e))))return e;return null}function Ste(e,t){let n=hp(e),r=gp(e,t);if(r){let e;return e=n===`oauth`?r.tokenAuth.oauth:n===`basic`&&r.tokenAuth.basic?r.tokenAuth.basic:r.tokenAuth.token,{headerName:e.headerName,headerPrefix:e.headerPrefix||``}}return{headerName:`Authorization`,headerPrefix:n===`basic`?`Basic `:`Bearer `}}function Cte(e,t){let n=[],r=-1,i=t.toLowerCase();for(let t of e){if(!t.hostPattern)continue;let e=t.hostPattern.toLowerCase();i.includes(e)&&(e.length>r?(r=e.length,n.length=0,n.push(t)):e.length===r&&n.push(t))}return n}function _p(e,t){return e.length?t&&e.find(e=>hp(e)===t)||e[0]:void 0}async function vp(e,t,n={}){let r=await R(e,L.SERVICE_ACCOUNTS),i=Array.isArray(r)?r:[];if(i.length===0)return;let a;if(n.accountId&&(a=i.find(e=>e.id===n.accountId)),!a&&t){let e=Cte(i,t);a=n.authMode?_p(e,n.authMode):_p(e,e[0]?gp(e[0],t)?.defaultMode:void 0)}if(!a){let t=await R(e,L.SERVICE_DEFAULT_ACCOUNT);t&&(a=i.find(e=>e.id===t))}if(!a&&n.authMode&&(a=_p(i,n.authMode)),a||=i[0],!a)return;if(bte(a,n)&&(a=await xte(e,i,a)),hp(a)===`oauth`&&a.oauthReauthRequired)return{token:``,service:a.service,hostPattern:a.hostPattern,headerName:`Authorization`,headerValue:``,accountId:a.id,authMode:`oauth`,reauthRequired:!0};let o=``;a.token&&(o=await sp(a.token)??``);let{headerName:s,headerPrefix:c}=Ste(a,t),l=o;hp(a)===`basic`&&a.basicUsername&&(l=btoa(`${a.basicUsername}:${o}`));let u=c?`${c}${l}`:l;return{token:o,service:a.service,hostPattern:a.hostPattern,headerName:s,headerValue:u,accountId:a.id,authMode:hp(a)}}var yp,bp,xp=k((()=>{Ot(),Gt(),Wo(),fp(),mp(),yp=6e4,bp=3}));function Sp(e){return pp(e)}function wte(e){switch(e){case`azure-devops`:return`azure_devops`;default:return e}}function Cp(e){if(!e)return`generic`;let t=e.toLowerCase();return t.includes(`github`)?`github`:t.includes(`dev.azure.com`)||t.includes(`visualstudio.com`)?`azure-devops`:t.includes(`gitlab`)?`gitlab`:`generic`}function wp(e){if(e.reauthRequired)return{};let t=e.provider||Cp(e.hostPattern||``),n=wte(t),r=e.authMode||`token`;if(e.token&&n===`azure_devops`&&rt(n,r,`git_remote`)?.headerPrefix===`Basic `)return{Authorization:`Basic ${btoa(`:`+e.token)}`};if(t===`azure-devops`&&e.username&&e.password)return{Authorization:`Basic ${btoa(e.username+`:`+e.password)}`};if(e.token){let t=rt(n,r,`git_remote`);return t?.headerName?{[t.headerName]:`${t.headerPrefix||``}${e.token}`}:{Authorization:`Bearer ${e.token}`}}return{}}function Tp(e){try{let t=new URL(e),n=t.pathname.replace(/\/+$/,``);return n?t.hostname+n:t.hostname}catch{return}}function Tte(e,t){let n=t.toLowerCase(),r=[],i=-1;for(let t of e){if(!t.hostPattern)continue;let e=t.hostPattern.toLowerCase();n.includes(e)&&(e.length>i?(i=e.length,r.length=0,r.push(t)):e.length===i&&r.push(t))}return r}function Ep(e,t){if(!e.length)return;if(!t)return e[0];let n=e.find(e=>Sp(e)===t);if(n)return n;if(t===`token`){let t=e.find(e=>Sp(e)===`token`&&!e.authMode);if(t)return t}return e[0]}async function Dp(e){if(e)return await sp(e)??void 0}function Ete(e,t){return Sp(e)!==`oauth`||e.oauthReauthRequired||!e.refreshToken||!e.oauthProviderId||!e.oauthClientId?!1:t.forceRefresh?!0:e.accessTokenExpiresAt?e.accessTokenExpiresAt<=Date.now()+kp:!1}async function Dte(e,t,n){if(!n.refreshToken||!n.oauthProviderId||!n.oauthClientId)return n;let r=await Dp(n.refreshToken);if(!r)return n;let i=n.oauthClientSecret?await Dp(n.oauthClientSecret):void 0,a=async r=>{let i=t.findIndex(e=>e.id===n.id);i!==-1&&(t[i]=r,await B(e,L.GIT_ACCOUNTS,t))},o=async()=>{let e=(n.oauthRefreshFailureCount||0)+1,t=e>=Ap,r={...n,oauthRefreshFailureCount:e,oauthReauthRequired:t,oauthReauthRequiredAt:t?n.oauthReauthRequiredAt||Date.now():void 0};return await a(r),r};try{let e=await fetch(`/oauth/refresh`,{body:JSON.stringify({clientId:n.oauthClientId,clientSecret:i,providerId:n.oauthProviderId,refreshToken:r,scope:n.scopes}),headers:{"content-type":`application/json`},method:`POST`});if(!e.ok)return o();let t=await e.json();if(!t.accessToken)return o();let s=await op(t.accessToken);if(!s)return o();let c=n.refreshToken;if(t.refreshToken){let e=await op(t.refreshToken);e&&(c=e)}let l={...n,token:s,refreshToken:c,accessTokenExpiresAt:t.expiresIn?Date.now()+t.expiresIn*1e3:n.accessTokenExpiresAt,tokenType:t.tokenType||n.tokenType,scopes:t.scope?t.scope.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean):n.scopes,oauthRefreshFailureCount:0,oauthReauthRequired:!1,oauthReauthRequiredAt:void 0};return await a(l),l}catch{return o()}}async function Op(e,t,n={}){let r=await R(e,L.GIT_ACCOUNTS);return Array.isArray(r)&&r.length>0?Ote(e,r,t,n):kte(e)}async function Ote(e,t,n,r={}){let i;if(r.accountId&&(i=t.find(e=>e.id===r.accountId)),!i&&n){let e=Tp(n);e&&(i=Ep(Tte(t,e),r.authMode))}if(!i){let r=await R(e,L.GIT_DEFAULT_ACCOUNT);if(r){let e=t.find(e=>e.id===r);if(e){if(!n)i=e;else{let t=Tp(n);if(t&&e.hostPattern){let n=t?.toLowerCase(),r=e.hostPattern.toLowerCase();n?.includes(r)&&(i=e)}}}}}if(!i&&!n&&r.authMode&&(i=Ep(t,r.authMode)),!i&&!n&&(i=t[0]),!i)return{authMode:`token`,authorEmail:void 0,authorName:void 0,password:void 0,provider:`generic`,token:void 0,username:void 0};Ete(i,r)&&(i=await Dte(e,t,i));let a=i.provider||Cp(i.hostPattern||``);return Sp(i)===`oauth`&&i.oauthReauthRequired?{accountId:i.id,authMode:`oauth`,authorEmail:i.authorEmail||void 0,authorName:i.authorName||void 0,hostPattern:i.hostPattern||void 0,password:void 0,provider:a,reauthRequired:!0,token:void 0,username:i.username||void 0}:{accountId:i.id,authMode:Sp(i),authorEmail:i.authorEmail||void 0,authorName:i.authorName||void 0,hostPattern:i.hostPattern||void 0,password:await Dp(i.password),provider:a,token:await Dp(i.token),username:i.username||void 0}}async function kte(e){let t=await R(e,L.GIT_TOKEN),n=await R(e,L.GIT_PASSWORD);return{authMode:`token`,authorEmail:await R(e,L.GIT_AUTHOR_EMAIL)||void 0,authorName:await R(e,L.GIT_AUTHOR_NAME)||void 0,password:n?await Dp(n):void 0,provider:`generic`,token:t?await Dp(t):void 0,username:await R(e,L.GIT_USERNAME)||void 0}}var kp,Ap,jp=k((()=>{Ot(),mp(),fp(),Gt(),Wo(),kp=6e4,Ap=3}));function Ate(e){if(typeof e!=`string`||!e.trim())return!1;try{let t=new URL(e);return t.protocol===`https:`||t.protocol===`http:`}catch{return!1}}function jte(e,t){if(!e||typeof e!=`object`)return null;let n=e;if(!n.serviceType||!n.authType)return null;if(n.serviceType!==t)throw Error(`Credential ref serviceType must match connection serviceType`);return{serviceType:n.serviceType,authType:n.authType,providerId:n.providerId||void 0,accountId:n.accountId||void 0,gitAccountId:n.gitAccountId||void 0,headerName:n.headerName||void 0,encryptedValue:n.encryptedValue||void 0}}function Mte(e){if(!e||typeof e!=`object`)return null;let t=e;return!t.id||!t.label||!t.serviceType||!t.transport||typeof t.enabled!=`boolean`||typeof t.createdAt!=`number`||typeof t.updatedAt!=`number`||!Ate(t.serverUrl)||t.serviceType!==`mcp_remote`&&t.serviceType!==`webmcp_local`||t.transport!==`streamable_http`&&t.transport!==`sse`&&t.transport!==`websocket`?null:{id:t.id,label:t.label,serviceType:t.serviceType,serverUrl:t.serverUrl,transport:t.transport,enabled:t.enabled,autoReconnectOAuth:t.autoReconnectOAuth===!0,createdAt:t.createdAt,updatedAt:t.updatedAt,credentialRef:jte(t.credentialRef,t.serviceType)}}async function Mp(e){let t=await R(e,L.REMOTE_MCP_CONNECTIONS);if(!Array.isArray(t))return[];let n=[];for(let e of t){let t=Mte(e);t&&n.push(t)}return n}async function Nte(e){return Mp(e)}async function Np(e,t){if(!t)return null;let n=await Mp(e);return n.find(e=>e.id===t)||n.find(e=>e.label.toLowerCase()===t.toLowerCase())||null}var Pp=k((()=>{Ot(),Gt(),Wo()}));function Pte(e){return e===`oauth`?`oauth`:`token`}async function Fp(e,t,n={}){let r=await Np(e,t);if(!r)return null;let i=r.credentialRef;if(!i||i.authType===`none`)return{connection:r,authType:`none`,headers:{}};if(i.authType===`custom_header`){if(!i.headerName||!i.encryptedValue)return{connection:r,authType:`custom_header`,headers:{}};let e=await sp(i.encryptedValue);return{connection:r,authType:`custom_header`,headers:e?{[i.headerName]:e}:{}}}let a=Pte(i.authType);if(i.accountId){let t=await vp(e,r.serverUrl,{accountId:i.accountId,authMode:a,forceRefresh:n.forceRefresh});return t?t.reauthRequired?{connection:r,authType:i.authType,headers:{},reauthRequired:!0}:{connection:r,authType:i.authType,headers:t.headerValue?{[t.headerName]:t.headerValue}:{}}:{connection:r,authType:i.authType,headers:{}}}if(i.gitAccountId){let t=await Op(e,r.serverUrl,{accountId:i.gitAccountId,authMode:a,forceRefresh:n.forceRefresh});return t.reauthRequired?{connection:r,authType:i.authType,headers:{},reauthRequired:!0}:{connection:r,authType:i.authType,headers:wp(t)}}return{connection:r,authType:i.authType,headers:{}}}var Fte=k((()=>{fp(),Pp(),xp(),jp()}));function Ip(e){return typeof e==`object`&&!!e&&`method`in e&&`id`in e&&!(`result`in e)&&!(`error`in e)}function Ite(e){let t=(e.requestedSchema||{}).properties||{},n={};for(let[e,r]of Object.entries(t))`default`in r?n[e]=r.default:r.type===`boolean`&&(n[e]=!0);return n}function Lp(e,t){return!e.headers||typeof e.headers.get!=`function`?null:e.headers.get(t)}function Rp(e){return/no valid session id provided/i.test(e)}function zp(e,t){let n=t&&`error`in t?t.error.message||`Remote MCP JSON-RPC error`:``;return Rp(n)?new Zp(n):e.ok?Error(n||`Remote MCP JSON-RPC error`):new Qp(e.status,n?`Remote MCP HTTP error: ${e.status} (${n})`:`Remote MCP HTTP error: ${e.status}`)}function Bp(e){if(!e)return null;let t=null,n=e.split(/\r?\n/);for(let e of n){let n=e.trim();if(!n.startsWith(`data:`))continue;let r=n.slice(5).trim();if(r&&r!==`[DONE]`)try{let e=JSON.parse(r);e&&typeof e==`object`&&`jsonrpc`in e&&(t=e)}catch{}}return t}function Vp(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}async function Hp(e,t,n){let r=await fetch(e,{method:`POST`,headers:{"content-type":`application/json`,accept:`application/json, text/event-stream`,...t},body:JSON.stringify(n)}),i=(Lp(r,`content-type`)||``).toLowerCase(),a=null;if(typeof r.text==`function`){let e=await r.text();a=i.includes(`text/event-stream`)?Bp(e):Vp(e)}else try{a=await r.json()}catch{a=null}return{response:r,payload:a}}async function Up(e,t,n){let{response:r,payload:i}=await Hp(e,{...t,"mcp-session-id":n},{jsonrpc:`2.0`,method:`notifications/initialized`,params:{}});if(!r.ok||i&&`error`in i)throw zp(r,i)}async function Wp(e,t,n){let r=Xp.get(e);if(r?.sessionId)return r;let{response:i,payload:a}=await Hp(t,n,{jsonrpc:`2.0`,id:`initialize-${Date.now().toString(36)}`,method:`initialize`,params:{protocolVersion:`2025-03-26`,capabilities:{elicitation:{}},clientInfo:{name:`shadowclaw-remote-mcp-client`,version:`1.0.0`}}});if(!i.ok||a&&`error`in a)throw zp(i,a);let o=Lp(i,`mcp-session-id`)||`local-${Date.now()}-${Math.random().toString(36).slice(2)}`,s={sessionId:o,protocolVersion:Lp(i,`mcp-protocol-version`)||a?.result?.protocolVersion,lastUsedAt:Date.now()};return await Up(t,n,o),Xp.set(e,s),s}async function Gp(e,t,n,r,i){let a=await Wp(e,t,n),o=async e=>{let a={jsonrpc:`2.0`,id:Date.now().toString(),method:r,params:i||{}},o={...n,"mcp-session-id":e},{response:s,payload:c}=await Hp(t,o,a),l=0;for(;Ip(c)&&l<5&&(l++,c.method===`elicitation/create`);){let e=Ite(c.params||{});({response:s,payload:c}=await Hp(t,o,{jsonrpc:`2.0`,id:c.id,result:{action:`accept`,content:e}}))}if(Ip(c))throw Error(`Unsupported server request: ${c.method}`);if(!s.ok||!c||`error`in c)throw zp(s,c);return c.result};try{let t=await o(a.sessionId);return a.lastUsedAt=Date.now(),Xp.set(e,a),t}catch(r){if(!(r instanceof Zp))throw r;Xp.delete(e),a=await Wp(e,t,n);let i=await o(a.sessionId);return a.lastUsedAt=Date.now(),Xp.set(e,a),i}}function Kp(e){e&&Xp.delete(e)}async function qp(e,t,n,r){let i=await Fp(e,t);if(!i)throw Error(`Remote MCP connection not found`);if(i.reauthRequired)throw new $p(t);let{connection:a,authType:o,headers:s}=i;if(a.transport!==`streamable_http`)throw Error(`Unsupported remote MCP transport`);try{return await Gp(t,a.serverUrl,s,n,r)}catch(i){if(!(i instanceof Qp)||i.status!==401||o!==`oauth`)throw i;Kp(t);let a=await Fp(e,t,{forceRefresh:!0});if(!a||a.reauthRequired)throw new $p(t);try{return await Gp(t,a.connection.serverUrl,a.headers,n,r)}catch(e){throw e instanceof Qp&&e.status===401?new $p(t):e}}}async function Jp(e,t){let n=await qp(e,t,`tools/list`);return Array.isArray(n.tools)?n.tools:[]}async function Yp(e,t,n,r={}){return qp(e,t,`tools/call`,{name:n,arguments:r})}var Xp,Zp,Qp,$p,em=k((()=>{Fte(),Xp=/* @__PURE__ */ new Map,Zp=class extends Error{constructor(e){super(e),this.name=`InvalidRemoteMcpSessionError`}},Qp=class extends Error{status;constructor(e,t){super(t),this.name=`HttpRemoteMcpError`,this.status=e}},$p=class extends Error{connectionId;constructor(e){super(`OAuth reconnect required for remote MCP connection`),this.name=`McpReauthRequiredError`,this.connectionId=e}}}));async function tm(e,t,n,r){let{dirs:i,filename:a}=ii(n);for(let n=0;n<2;n++)try{let n=await En(e,t);for(let e of i)n=await n.getDirectoryHandle(e,{create:!0});let o=await n.getFileHandle(a,{create:!0});try{await Ro(o,r);return}catch(t){if(!((t instanceof Error?t.message:String(t)).includes(`Writable file streams are not supported`)&&(await Cn(e)).type===`opfs`))throw t}let s=t.replace(/:/g,`-`);await zo([gn(),`groups`,s,...i,a],r);return}catch(e){if(n===0&&Sn(e)){xn();continue}throw e}}var nm=k((()=>{Dn(),ai(),Tn(),Vo()}));function rm(){return[...am].sort((e,t)=>e.id.localeCompare(t.id))}function im(e){return e&&am.find(t=>t.id===e)||null}var am,om=k((()=>{am=[{id:`imap`,name:`IMAP Mail`,protocol:`imap`,description:`Read mailboxes and fetch message metadata/content.`,version:`0.1.0`,actions:[`messages.read`,`messages.send`],authTypes:[`basic_userpass`,`oauth`],serviceTypes:[`http_api`],configurableFields:[`host`,`port`,`secure`,`mailboxPath`,`smtpHost`,`smtpPort`,`smtpSecure`,`fromAddress`,`executionMode`,`pollIntervalSec`]}]}));function sm(e){if(!e||typeof e!=`object`)return null;let t=e;return!t.serviceType||!t.authType?null:{serviceType:t.serviceType,authType:t.authType,providerId:t.providerId||void 0,accountId:t.accountId||void 0,username:t.username||void 0,headerName:t.headerName||void 0,encryptedSecret:t.encryptedSecret||void 0}}function cm(e){if(!e||typeof e!=`object`)return null;let t=e;return!t.id||!t.label||!t.pluginId||typeof t.enabled!=`boolean`||typeof t.createdAt!=`number`||typeof t.updatedAt!=`number`||!im(t.pluginId)?null:{id:t.id,label:t.label,pluginId:t.pluginId,enabled:t.enabled,config:t.config&&typeof t.config==`object`?{...t.config}:{},credentialRef:sm(t.credentialRef),createdAt:t.createdAt,updatedAt:t.updatedAt}}async function lm(e){let t=await R(e,L.INTEGRATION_CONNECTIONS);if(!Array.isArray(t))return[];let n=[];for(let e of t){let t=cm(e);t&&n.push(t)}return n}async function um(e,t){await B(e,L.INTEGRATION_CONNECTIONS,t)}async function dm(e){return lm(e)}async function fm(e,t){if(!t)return null;let n=await lm(e);return n.find(e=>e.id===t)||n.find(e=>e.label.toLowerCase()===t.toLowerCase())||null}async function pm(e,t){if(!t.label?.trim())throw Error(`Email connection label is required`);let n=im(t.pluginId);if(!n)throw Error(`Unknown email plugin: ${t.pluginId}`);let r=await lm(e),i=Date.now();if(t.id){let a=r.findIndex(e=>e.id===t.id);if(a!==-1){let o=r[a],s={...o,label:t.label.trim(),pluginId:n.id,enabled:t.enabled??o.enabled,config:t.config?{...t.config}:o.config,updatedAt:i};return r[a]=s,await um(e,r),s}}let a={id:t.id||cc(),label:t.label.trim(),pluginId:n.id,enabled:t.enabled??!0,config:t.config?{...t.config}:{},credentialRef:null,createdAt:i,updatedAt:i};return r.push(a),await um(e,r),a}async function mm(e,t,n){if(!t)return null;let r=await lm(e),i=r.findIndex(e=>e.id===t);if(i===-1)return null;let a={...r[i],credentialRef:n?sm(n):null,updatedAt:Date.now()};return r[i]=a,await um(e,r),a}async function hm(e,t){if(!t)return!1;let n=await lm(e),r=n.filter(e=>e.id!==t);return r.length!==n.length&&(await um(e,r),!0)}var gm=k((()=>{Ot(),Gt(),Wo(),hc(),om()}));function _m(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(typeof n==`string`){let e=n.trim();e&&t.push({path:e});continue}if(!n||typeof n!=`object`)continue;let e=typeof n.path==`string`?n.path.trim():``;if(!e)continue;let r=typeof n.filename==`string`?n.filename.trim():``,i=typeof n.content_type==`string`?n.content_type.trim():``;t.push({path:e,filename:r||void 0,contentType:i||void 0})}return t}var vm=k((()=>{}));function ym(e,t,n){if(e==null||e===``||typeof e==`boolean`)return t;let r=typeof e==`number`?e:Number(e);if(!Number.isFinite(r))return t;let i=r;return typeof n?.min==`number`&&(i=Math.max(n.min,i)),typeof n?.max==`number`&&(i=Math.min(n.max,i)),i}function bm(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(Boolean):[]}function xm(e){if(!Array.isArray(e))return[];let t=e.map(e=>typeof e==`number`?e:Number(e)).filter(e=>Number.isFinite(e)&&e>0).map(e=>Math.floor(e));return Array.from(new Set(t))}var Sm,Cm,wm,Tm=k((()=>{Sm=ym,Cm=bm,wm=xm}));function Em(e,t=`attachment.bin`){if(!e)return t;let n=e.replace(/\\/g,`/`).split(`/`).filter(Boolean);return n[n.length-1]||t}function Dm(e,t={}){let n=t.replacement??`_`,r=t.fallback??`attachment.bin`,i=e.trim();t.stripControlChars&&(i=i.replace(/[\u0000-\u001f\u007f]+/g,``)),t.stripLeadingDots&&(i=i.replace(/^\.+/,``));let a=t.stripControlChars?/[\\/:*?"<>|]/g:/[\\/:*?"<>|\x00-\x1f\u007f]/g;if(t.collapseReplacement&&n){let e=n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);i=i.replace(t.stripControlChars?/[\\/:*?"<>|]+/g:/[\\/:*?"<>|\x00-\x1f\u007f]+/g,n),i=i.replace(RegExp(`${e}+`,`g`),n)}else i=i.replace(a,n);return i=i.trim(),t.stripLeadingDots&&(i=i.replace(/^\.+/,``).trim()),i||r}var Om=k((()=>{}));async function km(e,t,n,r=!1){let i=(typeof n.username==`string`?n.username.trim():``)||t.credentialRef?.username||(typeof t.config.username==`string`?t.config.username:``);if(!i)return`Error: Integration connection ${t.id} is missing username credentials.`;if(t.credentialRef?.authType===`oauth`){let n=t.credentialRef.accountId;if(!n)return`Error: Integration connection ${t.id} is missing linked OAuth account.`;let a=await vp(e,void 0,{accountId:n,authMode:`oauth`,forceRefresh:r});if(!a||a.reauthRequired||!a.token){let e=t.credentialRef?.providerId||`the configured`;return`Error: OAuth account reconnect required for integration ${t.id}.\nOpen Settings -> Integrations, edit this email connection, and click Connect OAuth for ${e} to re-authorize.`}return{authType:`oauth`,username:i,accessToken:a.token}}let a=(typeof n.password==`string`?n.password.trim():``)||t.credentialRef?.encryptedSecret&&await sp(t.credentialRef.encryptedSecret)||``;return a?{authType:`basic_userpass`,username:i,password:a}:`Error: Integration connection ${t.id} is missing password credentials.`}var Am=k((()=>{fp(),xp()}));async function jm(e,t,n,r){let i=Dm(r),a=i.lastIndexOf(`.`),o=a>0?i.slice(0,a):i,s=a>0?i.slice(a):``,c=n.trim().replace(/^\/+|\/+$/g,``);for(let n=0;n<1e3;n++){let r=n===0?i:`${o}-${n+1}${s}`,a=c?`${c}/${r}`:r;if(!await Yo(e,t,a))return a}return c?`${c}/${cc()}-${i}`:`${cc()}-${i}`}var Mm=k((()=>{Xo(),hc(),Om()}));async function Nm(e,t,n){let r=typeof t.action==`string`?t.action.trim():``;if(!r)return`Error: manage_email requires action.`;if(r===`list_plugins`){let e=rm();return e.length?e.map(e=>`- ${e.id} (${e.protocol})\n Name: ${e.name}\n Actions: ${e.actions.join(`, `)}\n Auth: ${e.authTypes.join(`, `)}\n Fields: ${e.configurableFields.join(`, `)||`(none)`}`).join(`
|
|
253
253
|
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { n as __exportAll } from "./rolldown-runtime-DwyhSnWe.js";
|
|
2
|
-
|
|
3
1
|
//#region src/storage/static-routing.ts
|
|
4
2
|
const DEFAULT_GROUP_ID = "br:main";
|
|
5
3
|
const STATIC_ROUTING_SCRIPT_ID = "shadow-claw-static-routing";
|
|
@@ -267,26 +265,6 @@ function resolveDefaultPinnedPageRef(value) {
|
|
|
267
265
|
|
|
268
266
|
//#endregion
|
|
269
267
|
//#region src/core/app-routes.ts
|
|
270
|
-
var app_routes_exports = /* @__PURE__ */ __exportAll({
|
|
271
|
-
PAGE_EXTENSIONS: () => PAGE_EXTENSIONS,
|
|
272
|
-
applyBasePath: () => applyBasePath,
|
|
273
|
-
buildRoutePath: () => buildRoutePath,
|
|
274
|
-
decodePathSegment: () => decodePathSegment,
|
|
275
|
-
getAppBasePath: () => getAppBasePath,
|
|
276
|
-
getDeploymentNamespace: () => getDeploymentNamespace,
|
|
277
|
-
getFileRouteDirPath: () => getFileRouteDirPath,
|
|
278
|
-
getWorkspaceRouteRequestPath: () => getWorkspaceRouteRequestPath,
|
|
279
|
-
isFeedRoute: () => isFeedRoute,
|
|
280
|
-
isNonPageFilePath: () => isNonPageFilePath,
|
|
281
|
-
isPossibleAppRoute: () => isPossibleAppRoute,
|
|
282
|
-
parseRouteFromUrl: () => parseRouteFromUrl,
|
|
283
|
-
parseRouteFromUrlAsync: () => parseRouteFromUrlAsync,
|
|
284
|
-
resetAppBasePathCache: () => resetAppBasePathCache,
|
|
285
|
-
resolveHrefAgainstRoute: () => resolveHrefAgainstRoute,
|
|
286
|
-
resolvePrettyPathToRoute: () => resolvePrettyPathToRoute,
|
|
287
|
-
resolvePrettyPathToRouteAsync: () => resolvePrettyPathToRouteAsync,
|
|
288
|
-
resolveRouteToPrettyPath: () => resolveRouteToPrettyPath
|
|
289
|
-
});
|
|
290
268
|
let cachedBasePath = null;
|
|
291
269
|
function encodePathSegment(value) {
|
|
292
270
|
if (value === "br:main") return "main";
|
|
@@ -482,7 +460,11 @@ function parseRouteFromUrl(url, fallbackGroupId) {
|
|
|
482
460
|
}
|
|
483
461
|
const parts = pathname.split("/").filter(Boolean).map((part) => decodePathSegment(part));
|
|
484
462
|
const anchor = url.hash ? url.hash.replace(/^#/, "") : void 0;
|
|
485
|
-
if (parts.length === 0) return
|
|
463
|
+
if (parts.length === 0 || parts.length === 1 && parts[0] === "index.html") return {
|
|
464
|
+
page: "pages",
|
|
465
|
+
groupId: normalizeRouteGroupId(fallbackGroupId),
|
|
466
|
+
anchor
|
|
467
|
+
};
|
|
486
468
|
const page = parts[0].toLowerCase();
|
|
487
469
|
if (page === "chat") return {
|
|
488
470
|
page: "chat",
|
|
@@ -626,5 +608,5 @@ function getWorkspaceRouteRequestPath(pathname) {
|
|
|
626
608
|
}
|
|
627
609
|
|
|
628
610
|
//#endregion
|
|
629
|
-
export {
|
|
630
|
-
//# sourceMappingURL=app-routes-
|
|
611
|
+
export { getDeploymentNamespace as a, isFeedRoute as c, parseRouteFromUrlAsync as d, resolveHrefAgainstRoute as f, resolveRouteToPrettyPathAsync as h, getAppBasePath as i, isPossibleAppRoute as l, resolveDefaultPinnedPageRef as m, buildRoutePath as n, getFileRouteDirPath as o, STATIC_ROUTING_SCRIPT_ID as p, decodePathSegment as r, getWorkspaceRouteRequestPath as s, applyBasePath as t, parseRouteFromUrl as u };
|
|
612
|
+
//# sourceMappingURL=app-routes-BXiRvlNl.js.map
|