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
|
@@ -65,19 +65,31 @@ graph TD
|
|
|
65
65
|
|
|
66
66
|
Builds a static site bundle into `./dist/public`.
|
|
67
67
|
|
|
68
|
-
| Option | Type | Description
|
|
69
|
-
| :------------------------- | :------ |
|
|
70
|
-
| `--prod, --production` | boolean | Build in production mode (minification, base path rewriting, revision stamping)
|
|
71
|
-
| `--origin <url>` | string | Canonical site origin URL (overrides `PAGES_ORIGIN`)
|
|
72
|
-
| `--base-path <path>` | string | Base path prefix (e.g. `/my-site/`, overrides `PAGES_BASE_PATH`)
|
|
73
|
-
| `--out-dir <dir>` | string | Output directory relative to content root
|
|
74
|
-
| `--content-root <dir>` | string | Working directory containing site content
|
|
75
|
-
| `--prerender-pages <mode>` | string | Prerender mode: `all`, `auto`, `none`
|
|
76
|
-
| `--copy-all-assets` | boolean | Copy entire `assets/` directory into output
|
|
77
|
-
| `--single-file` | boolean | Bundle static pages, configuration, and theme into a standalone single-file `index.html`
|
|
68
|
+
| Option | Type | Description | Default |
|
|
69
|
+
| :------------------------- | :------ | :------------------------------------------------------------------------------------------ | :--------------------------------------------------- |
|
|
70
|
+
| `--prod, --production` | boolean | Build in production mode (minification, base path rewriting, revision stamping) | `false` |
|
|
71
|
+
| `--origin <url>` | string | Canonical site origin URL (overrides `PAGES_ORIGIN`) | `""` |
|
|
72
|
+
| `--base-path <path>` | string | Base path prefix (e.g. `/my-site/`, overrides `PAGES_BASE_PATH`) | `"/shadow-claw/"` |
|
|
73
|
+
| `--out-dir <dir>` | string | Output directory relative to content root | `"dist/public"` |
|
|
74
|
+
| `--content-root <dir>` | string | Working directory containing site content | `process.cwd()` |
|
|
75
|
+
| `--prerender-pages <mode>` | string | Prerender mode: `all`, `auto`, `none` | `"auto"` |
|
|
76
|
+
| `--copy-all-assets` | boolean | Copy entire `assets/` directory into output | `false` |
|
|
77
|
+
| `--single-file` | boolean | Bundle static pages, configuration, and theme into a standalone single-file `index.html` | `false` |
|
|
78
|
+
| `--cdn <url>` | string | Base CDN URL to load runtime assets from for single-file builds | `https://cdn.jsdelivr.net/npm/shadow-claw@<version>` |
|
|
79
|
+
| `--service-worker` | boolean | With `--single-file`, also emit `service-worker.js` that caches `index.html` and CDN assets | `false` |
|
|
78
80
|
|
|
79
81
|
When `--single-file` is specified, the build engine automatically bundles workspace pages (discovered from `pages/main/*.md`), theme styling (`pages/main/theme.css` or `theme.css`), and site configuration directly into `dist/public/index.html`. Markdown pages are injected as inline `<script type="text/markdown" data-shadow-claw-page="...">` elements and themes as `<style id="shadow-claw-theme">`, producing a completely self-contained, zero-shim single HTML file for embedding or simple static hosting.
|
|
80
82
|
|
|
83
|
+
When `--service-worker` is combined with `--single-file`:
|
|
84
|
+
|
|
85
|
+
- A standalone `service-worker.js` is generated into the output directory alongside `index.html`. It implements a network-first strategy for navigation requests (`index.html`) and stale-while-revalidate for CDN runtime assets, enabling offline PWA functionality for single-file deployments.
|
|
86
|
+
- Each build stamps `service-worker.js` with a unique content hash comment (`// build: <sha256>`), ensuring the browser detects byte-level changes and triggers worker updates.
|
|
87
|
+
- An inline registration script (`data-shadow-claw-sw="true"`) is injected into `index.html`. It registers the service worker with `updateViaCache: "none"`, integrates with Trusted Types policies, and surfaces update modals via `shadow-claw`'s UI dialog bridge (`requestDialog`):
|
|
88
|
+
- **Periodic Checks**: Periodically checks for new service worker versions (default: `SW_UPDATE_CHECK_INTERVAL_MS = 3600000`, 1 hour).
|
|
89
|
+
- **Focus & Visibility Checks**: Triggers update checks when the window regains focus or becomes visible (`SW_UPDATE_CHECK_ON_FOCUS = true`), with a debounce gap (`SW_UPDATE_CHECK_MIN_GAP_MS = 30000`, 30 seconds).
|
|
90
|
+
- **Update Available Dialog**: When a new service worker installs, users are prompted with "Update Available" (Reload now / Later). Choosing "Later" re-prompts after `SW_UPDATE_REPROMPT_INTERVAL_MS = 900000` (15 minutes).
|
|
91
|
+
- **Multi-Tab Sync**: When another tab applies the update, remaining tabs receive an "Update Installed" reload prompt on `controllerchange`.
|
|
92
|
+
|
|
81
93
|
When pretty paths are prerendered (`--prerender-pages`), the build resolves the site `<base href="...">` via `resolveSiteBasePath` (from `--base-path` / `PAGES_BASE_PATH`, `--origin` / `PAGES_ORIGIN` pathname, or `branding.siteUrl` pathname) and patches it across `dist/public/index.html` and all generated pretty-path `index.html` files (`patchBaseHref`), alongside Yoast-style SEO metadata (page titles formatted via `formatSeoTitle`, meta descriptions via `extractMarkdownDescription`, canonical URLs via `resolveCanonicalUrl`, and Open Graph/Twitter tags via `patchHtmlHeadMetadata`). When the content project has no configured or existing sitemap, the build generates `sitemap.xml` from `routes.json` if a canonical origin is set with `--origin` / `PAGES_ORIGIN` or `branding.siteUrl`. The generated sitemap includes the site root and unique pretty paths. See [Pages System](pages.md#pre-rendered-content-routing--pretty-paths) for sitemap precedence, routing details, and SEO metadata configuration.
|
|
82
94
|
|
|
83
95
|
Pre-rendered HTML and Markdown pages automatically run through the image optimization pipeline (`optimizeImgTags`), which reads image file headers to inject explicit `width` and `height` attributes to prevent Cumulative Layout Shift (CLS), assigns `loading="eager" fetchpriority="high" decoding="async"` to the above-the-fold hero image, and sets `loading="lazy" decoding="async"` on subsequent images.
|
|
@@ -217,40 +229,41 @@ npx shadow-claw agent import vercel-labs/agent-skills --skills react-best-practi
|
|
|
217
229
|
| `skill` | `<name>` | Executes a skill's declarative tool pipeline (`execution.type: "tools"`) or runs the skill body as an LLM prompt. |
|
|
218
230
|
| `import` | `<source>` | Imports tools, skills (including multi-file companion `files` manifests), and companion scripts from a remote RFC v0.2.0 discovery endpoint, direct `SKILL.md` URL, GitHub `owner/repo` / `owner/repo@skill` shorthand (`npx skills` delegation with native HTTP fallback), or local directory. |
|
|
219
231
|
|
|
220
|
-
#### Options
|
|
221
|
-
|
|
222
|
-
| Option | Type | Description
|
|
223
|
-
| :----------------------------------- | :------ |
|
|
224
|
-
| `--workspace <dir>` | string | Workspace directory for file I/O and configuration
|
|
225
|
-
| `--database-dir <dir>` | string | Directory where SQLite databases (`shadow-claw.db`) are stored
|
|
226
|
-
| `--cache-dir <dir>` | string | Custom cache directory for databases, models, and logs
|
|
227
|
-
| `--tmp, --temp` | boolean | Store cache, token, and databases in OS temporary directory (`tmpdir()`)
|
|
228
|
-
| `-y, --yes` | boolean | Skip interactive prompts and accept defaults
|
|
229
|
-
| `--group <groupId>` | string | Conversation group identifier for chat history isolation (`agent run`, `clear`, etc.)
|
|
230
|
-
| `--provider <provider>` | string | LLM provider ID (`transformers_js_local`, `openrouter`, `llamafile`, `gemini`, etc.)
|
|
231
|
-
| `--model <model>` | string | Model identifier (e.g. `onnx-community/gemma-4-E2B-it-ONNX`)
|
|
232
|
-
| `--download` | boolean | Prewarm and download the model during agent init or before execution
|
|
233
|
-
| `--api-key <key>` | string | API key for cloud providers
|
|
234
|
-
| `--stream` / `--no-stream` | boolean | Stream response tokens to stdout as they arrive
|
|
235
|
-
| `--no-history` | boolean | Do not load prior conversation history for `agent run`
|
|
236
|
-
| `--progress` / `--no-progress` | boolean | Show terminal progress bar during model downloads
|
|
237
|
-
| `--system-prompt <text>` | string | Override system prompt with inline text (pass `""` or `"none"` to disable)
|
|
238
|
-
| `--no-system-prompt` | boolean | Disable system prompt completely for pure text completion
|
|
239
|
-
| `--system-prompt-file <file>` | string | Load system prompt from a text or markdown file
|
|
240
|
-
| `--tools <tools>` | string | Comma-separated list of tools to enable or import (e.g. `bash,read_file`)
|
|
241
|
-
| `--no-tools` | boolean | Disable all tools for pure text completion / zero tool-call overhead
|
|
242
|
-
| `--skills <skills>` | string | Comma-separated list of skills to filter or import
|
|
243
|
-
| `--scripts <scripts>` | string | Comma-separated list of companion scripts to import
|
|
244
|
-
| `--all` | boolean | Import all tools, skills, and scripts from discovery manifest
|
|
245
|
-
| `--overwrite` | boolean | Overwrite existing skills, tools, or scripts during import
|
|
246
|
-
| `--auto-enable` / `--no-auto-enable` | boolean | Automatically enable imported declarative tools in database
|
|
247
|
-
| `--tools-profile <name>` | string | Tools profile to activate (e.g. `__builtin_default`)
|
|
248
|
-
| `-r, --remote`, `--hf` | boolean | List or search available models from Hugging Face `onnx-community` repository
|
|
249
|
-
| `--query <query>` | string | Filter remote or local models by search query
|
|
250
|
-
| `-v, --verbose` | boolean | Enable verbose tool activity and diagnostic logging
|
|
251
|
-
| `-o, --output <file>` | string | Write command output to a file instead of stdout
|
|
252
|
-
| `-f, --file <path>` | string | Attach a local file to `agent run`
|
|
253
|
-
|
|
|
232
|
+
#### Agent Options
|
|
233
|
+
|
|
234
|
+
| Option | Type | Description | Default |
|
|
235
|
+
| :----------------------------------- | :------ | :---------------------------------------------------------------------------------------------------------- | :---------------------------------------- |
|
|
236
|
+
| `--workspace <dir>` | string | Workspace directory for file I/O and configuration | isolated sandbox in `tmpdir()` |
|
|
237
|
+
| `--database-dir <dir>` | string | Directory where SQLite databases (`shadow-claw.db`) are stored | `<workspace>/database` |
|
|
238
|
+
| `--cache-dir <dir>` | string | Custom cache directory for databases, models, and logs | `undefined` |
|
|
239
|
+
| `--tmp, --temp` | boolean | Store cache, token, and databases in OS temporary directory (`tmpdir()`) | `false` |
|
|
240
|
+
| `-y, --yes` | boolean | Skip interactive prompts and accept defaults | `false` |
|
|
241
|
+
| `--group <groupId>` | string | Conversation group identifier for chat history isolation (`agent run`, `clear`, etc.) | `"server:main"` |
|
|
242
|
+
| `--provider <provider>` | string | LLM provider ID (`transformers_js_local`, `openrouter`, `llamafile`, `gemini`, etc.) | auto-resolved (`"transformers_js_local"`) |
|
|
243
|
+
| `--model <model>` | string | Model identifier (e.g. `onnx-community/gemma-4-E2B-it-ONNX`) | auto-resolved (curated local default) |
|
|
244
|
+
| `--download` | boolean | Prewarm and download the model during agent init or before execution | `false` |
|
|
245
|
+
| `--api-key <key>` | string | API key for cloud providers | auto-resolved from env |
|
|
246
|
+
| `--stream` / `--no-stream` | boolean | Stream response tokens to stdout as they arrive | `true` |
|
|
247
|
+
| `--no-history` | boolean | Do not load prior conversation history for `agent run` | history loaded |
|
|
248
|
+
| `--progress` / `--no-progress` | boolean | Show terminal progress bar during model downloads | `true` |
|
|
249
|
+
| `--system-prompt <text>` | string | Override system prompt with inline text (pass `""` or `"none"` to disable) | `undefined` |
|
|
250
|
+
| `--no-system-prompt` | boolean | Disable system prompt completely for pure text completion | `false` |
|
|
251
|
+
| `--system-prompt-file <file>` | string | Load system prompt from a text or markdown file | `undefined` |
|
|
252
|
+
| `--tools <tools>` | string | Comma-separated list of tools to enable or import (e.g. `bash,read_file`) | `undefined` |
|
|
253
|
+
| `--no-tools` | boolean | Disable all tools for pure text completion / zero tool-call overhead | `false` |
|
|
254
|
+
| `--skills <skills>` | string | Comma-separated list of skills to filter or import | `undefined` |
|
|
255
|
+
| `--scripts <scripts>` | string | Comma-separated list of companion scripts to import | `undefined` |
|
|
256
|
+
| `--all` | boolean | Import all tools, skills, and scripts from discovery manifest | `false` |
|
|
257
|
+
| `--overwrite` | boolean | Overwrite existing skills, tools, or scripts during import | `false` |
|
|
258
|
+
| `--auto-enable` / `--no-auto-enable` | boolean | Automatically enable imported declarative tools in database | `true` |
|
|
259
|
+
| `--tools-profile <name>` | string | Tools profile to activate (e.g. `__builtin_default`) | `undefined` |
|
|
260
|
+
| `-r, --remote`, `--hf` | boolean | List or search available models from Hugging Face `onnx-community` repository | `false` |
|
|
261
|
+
| `--query <query>` | string | Filter remote or local models by search query | `undefined` |
|
|
262
|
+
| `-v, --verbose` | boolean | Enable verbose tool activity and diagnostic logging | `false` |
|
|
263
|
+
| `-o, --output <file>` | string | Write command output to a file instead of stdout | `undefined` |
|
|
264
|
+
| `-f, --file <path>` | string | Attach a local file to `agent run` (repeatable for multiple files) | `undefined` |
|
|
265
|
+
| `--max-image-size <MB>` | number | Max size in MB for inline base64 (default: `3`). Larger fall back to a text ref. Raise for high-res. photos | `3` |
|
|
266
|
+
| `-q, --quiet` | boolean | Suppress all non-error output | `false` |
|
|
254
267
|
|
|
255
268
|
> **First-Run Cache Directory Wizard:** When running the agent without an explicit `--workspace`, `--cache-dir`, or `--tmp` in a directory where no `.cache` or database exists, ShadowClaw prompts interactively (identical to `dev` and `serve`) to let you choose between the current directory (`.cache`), system temporary storage (`tmpdir()`), or a custom path. Pass `-y`, `--yes`, `--tmp`, or `--workspace <dir>` to skip the prompt.
|
|
256
269
|
|
|
@@ -335,16 +348,47 @@ echo "Summarize: ..." | npx shadow-claw agent run -o summary.txt
|
|
|
335
348
|
|
|
336
349
|
#### Attaching files to `agent run`
|
|
337
350
|
|
|
338
|
-
Use `-f, --file <path>` to attach local files
|
|
339
|
-
|
|
351
|
+
Use `-f, --file <path>` to attach local files to a prompt. The flag is **repeatable** — pass it multiple times to attach several files at once.
|
|
352
|
+
|
|
353
|
+
```bash
|
|
354
|
+
# Attach images, PDFs, audio, or text files (repeatable)
|
|
355
|
+
npx shadow-claw agent run "Compare these" --no-tools -f a.png -f b.png
|
|
356
|
+
|
|
357
|
+
# Attach a document alongside a piped prompt
|
|
358
|
+
cat brief.txt | npx shadow-claw agent run "Summarize" -f appendix.pdf -o summary.txt
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
> [!TIP]
|
|
362
|
+
> Pass `--no-tools` (or `--tools none`) when attaching image files. Without it, the default tool set includes filesystem tools like `list_files` that can distract some models away from examining the attached images.
|
|
363
|
+
|
|
364
|
+
##### Size limits & `--max-image-size`
|
|
365
|
+
|
|
366
|
+
To prevent oversized requests, inline base64 encoding is subject to the following per-type limits:
|
|
367
|
+
|
|
368
|
+
| Type | Default limit |
|
|
369
|
+
| :------- | :------------ |
|
|
370
|
+
| Image | 3 MB |
|
|
371
|
+
| Audio | 5 MB |
|
|
372
|
+
| Document | 20 MB |
|
|
373
|
+
|
|
374
|
+
Files that exceed the limit are **not silently dropped** — they fall back to a metadata text reference and a warning is printed to `stderr`:
|
|
375
|
+
|
|
376
|
+
```text
|
|
377
|
+
[Agent] Warning: "photo.png" is 7.9 MB — exceeds the 3 MB image limit and will be passed as a text reference only. Resize or compress the image before attaching.
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
Use `--max-image-size <MB>` to raise the image limit when working with high-resolution photos or large screenshots:
|
|
340
381
|
|
|
341
382
|
```bash
|
|
342
|
-
|
|
383
|
+
# Raise the limit to 10 MB so both images are sent inline
|
|
384
|
+
npx shadow-claw agent run "Compare these" --no-tools --max-image-size 10 -f photo-a.png -f photo-b.png
|
|
343
385
|
```
|
|
344
386
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
-
|
|
387
|
+
##### Other attachment behaviour
|
|
388
|
+
|
|
389
|
+
- Each file is read from disk and copied into the conversation group's `attachments/` folder inside the workspace.
|
|
390
|
+
- Attachments are persisted on the user message and delivered through the same pipeline as browser attachments.
|
|
391
|
+
- Images, audio, and documents are sent as native content blocks when the model supports them; unsupported types fall back to descriptive metadata text.
|
|
348
392
|
- A missing or unreadable file prints an error to `stderr` and exits with code `1` before the model is called.
|
|
349
393
|
- Combines with the prompt argument and piped stdin.
|
|
350
394
|
|
|
@@ -741,7 +785,7 @@ npx shadow-claw skills remove my-new-skill
|
|
|
741
785
|
npx shadow-claw skills restore
|
|
742
786
|
```
|
|
743
787
|
|
|
744
|
-
#### Options
|
|
788
|
+
#### Skills Options
|
|
745
789
|
|
|
746
790
|
| Option | Type | Description | Default |
|
|
747
791
|
| :------------------ | :------ | :---------------------------------------------- | :-------------- |
|
|
@@ -63,6 +63,7 @@ To support zero-shim single-file applications and static hosting without directo
|
|
|
63
63
|
- Markdown documents can be embedded directly in the HTML document using `<script type="text/markdown" data-shadow-claw-page="path/to/page.md">` tags.
|
|
64
64
|
- `getStaticMainManifest()` automatically discovers these script elements on initial load and inserts them into the runtime pages manifest without requiring separate files or JSON escaping.
|
|
65
65
|
- Example:
|
|
66
|
+
|
|
66
67
|
```html
|
|
67
68
|
<script type="text/markdown" data-shadow-claw-page="guide.md">
|
|
68
69
|
# User Guide
|
|
@@ -73,6 +74,7 @@ To support zero-shim single-file applications and static hosting without directo
|
|
|
73
74
|
|
|
74
75
|
2. **Tier 2: Sidecar `pages/` Directory via Configuration**
|
|
75
76
|
- Static file hosts and object stores cannot list directory contents via HTTP. To deploy static sidecar markdown files alongside a single HTML file without pre-compiling an embedded manifest, declare the files in `shadow-claw-site-config`:
|
|
77
|
+
|
|
76
78
|
```json
|
|
77
79
|
{
|
|
78
80
|
"pages": {
|
|
@@ -81,12 +83,15 @@ To support zero-shim single-file applications and static hosting without directo
|
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
```
|
|
86
|
+
|
|
84
87
|
- `getStaticMainManifest()` seeds page references from `pages.files`, and `resolveStaticMainFileUrl()` lazy-fetches content using the configurable `pages.baseUrl`.
|
|
85
88
|
|
|
86
89
|
3. **Tier 3: Folder Authoring with Single-File Compilation (`shadow-claw build --single-file`)**
|
|
87
90
|
- Author site content using standard folder structures (`pages/main/*.md`, `theme.css`, `shadow-claw.config.json`).
|
|
88
91
|
- Run `shadow-claw build --single-file` to compile all pages, theme stylesheets, and configuration into a single standalone `index.html`.
|
|
89
92
|
- The compiler automatically inlines markdown pages as `<script type="text/markdown" data-shadow-claw-page="...">` elements and theme stylesheets as `<style id="shadow-claw-theme">`.
|
|
93
|
+
- Use `--cdn <url>` to target a custom CDN base (defaults to `https://cdn.jsdelivr.net/npm/shadow-claw@<version>`).
|
|
94
|
+
- Pass `--service-worker` to generate a companion `service-worker.js` with offline caching (network-first for `index.html` and stale-while-revalidate for CDN runtime assets) and an interactive update dialog flow.
|
|
90
95
|
|
|
91
96
|
### Page Suppression (`src/storage/suppressed-pages.ts`)
|
|
92
97
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./get-group-dir-
|
|
1
|
+
import{t as e}from"./get-group-dir-D--BiEyk.js";import{n as t}from"./write-group-file-R67DjJ-q.js";async function n(n,r,i){let a=await e(n,r),{dirs:o,filename:s}=t(i),c=a;for(let e of o)c=await c.getDirectoryHandle(e);let l=await(await c.getFileHandle(s)).getFile(),u=URL.createObjectURL(l),d=document.createElement(`a`);d.href=u,d.download=s,document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(u)}export{n as t};
|
|
@@ -473,7 +473,7 @@ npm run e2e -- --reporter=html
|
|
|
473
473
|
The build, CLI, prerender, and headless agent test suites live under `src/cli/` and `src/` and run through the project Jest configuration. Coverage includes:
|
|
474
474
|
|
|
475
475
|
- **CLI Commands & Utilities**: `build`, `dev`, `run`, `serve`, `server`, `init`, `clients`, `send` (`src/cli/commands/send.test.ts` covering prompts, file attachments, and remote replies), `send-file` (`src/cli/commands/send-file.test.ts` covering direct P2P transfers and prompt execution), `backup`, `tasks`, `mcp`, `skills` / `agent skills` (`src/cli/utils/migrate-skills.test.ts` and `src/cli/commands/agent.test.ts` covering Open Agent Skills `npx skills` delegation, `skills.sh` registry searching, `skills-lock.json` provenance, local skill imports, `sync`, `init`, `remove`, and graceful native fallback), `skills:index` (`src/cli/commands/skills-index.test.ts` covering RFC v0.2.0 manifest generation, symlinked skill traversal, dual-layout deduplication, and companion `files` arrays), `webrtc` / `webrtc listen` (`src/cli/commands/webrtc-listen.test.ts` covering orchestration loop dispatch, transfer handling, and ping), `peer-id`, `--version`, `agent` (`src/cli/commands/agent.test.ts` covering init, models, tools, skills, tool execution, system prompt overrides and disabling (`--no-system-prompt`, `--system-prompt none`), uncached model download confirmation guards, remote RFC v0.2.0 / GitHub shorthand / local directory imports, SIGINT signal handling, and `agent listen`), `agent model` (`src/cli/commands/agent-models.test.ts`), and native AI tasks (`src/cli/commands/native-ai-task-handler.test.ts`).
|
|
476
|
-
- **Agent File Attachments (`agent run -f`)**: Repeatable `-f, --file` loading and MIME inference (`src/cli/utils/load-cli-attachments.test.ts`), missing-file errors (`src/cli/commands/agent.test.ts`), and attachment persistence on the saved user message (`src/cli/commands/agent-file-attachments.test.ts`).
|
|
476
|
+
- **Agent File Attachments (`agent run -f`)**: Repeatable `-f, --file` loading and MIME inference (`src/cli/utils/load-cli-attachments.test.ts`), missing-file errors (`src/cli/commands/agent.test.ts`), and attachment persistence on the saved user message (`src/cli/commands/agent-file-attachments.test.ts`). Additional coverage in `src/cli/commands/agent.test.ts`: single image encoded as base64 content block, two images both delivered as inline blocks (multi-file `-f` flag), oversized image (>3 MB default) triggering a `stderr` warning and falling back to a text reference, `--max-image-size` raising the per-image byte limit so larger images are sent inline, and `streaming-error` events from the provider surfaced as `{ success: false }` instead of being silently swallowed.
|
|
477
477
|
- **Model Download, Browsing & Progress Bar Utilities**: Hugging Face ONNX and Llamafile model querying, interactive paginated and searchable model browsing with in-memory session caching, downloading, write stream lifecycle cleanup, and recursive local caching inspection with partial download detection (`src/cli/utils/local-models.test.ts`), terminal progress bar (`src/cli/utils/progress-bar.test.ts`), and cache directory resolution (`src/cli/utils/resolve-cache-dir.test.ts`).
|
|
478
478
|
- **Headless Agent Subsystems**: SQLite database implementation (`src/db/sqlite/*.test.ts`), Node.js filesystem directory handle polyfill (`src/storage/node-fs-handle.test.ts`), custom element security guards (`src/security/custom-element-guard.test.ts`), headless tool execution, guards, and capability matrix (`src/worker/utils/execute-tool.headless.test.ts`, `src/worker/utils/declarative-tool-executor.test.ts`, `src/worker/utils/guards.test.ts`, `src/worker/tools/builtin-ai/builtin-ai.headless.test.ts`), peer collaboration tools (`src/worker/tools/peer/prompt-peer.test.ts`, `src/worker/tools/workspace/send-file.test.ts`), shared cross-cutting utilities (`src/utils/*.test.ts` including `src/utils/seo.test.ts`), and default provider/model configuration (`src/config/headless.test.ts`).
|
|
479
479
|
- **Host-Native Offline Model Executors & Local Binary Drivers**: In-process Node.js Transformers.js execution (`src/worker/tools/node-transformers-executor.test.ts`, `src/server/services/transformers-runtime.test.ts`), Llamafile and Agentfile manager & executor with LocalBinaryDriver architecture and built-in tool schema catalogs (`src/worker/tools/node-llamafile-executor.test.ts`, `src/server/services/llamafile-manager.test.ts`, `src/server/routes/llamafile.test.ts`), and agent invocation loop with system prompt forwarding in headless mode (`src/worker/utils/handle-invoke.test.ts`).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e,j as t}from"./config-
|
|
1
|
+
import{F as e,j as t}from"./config-C16fFWtP.js";import{L as n}from"./orchestrator-Li1UAsv7.js";import{h as r,i,v as a}from"./provider-YPZmsuHR.js";function o(o,s){globalThis.__SHADOWCLAW_E2E__={isReady(){return o.ready},getDb(){return s.db},getActiveGroupId(){return o.activeGroupId},getDbName(){return s.db&&`name`in s.db&&typeof s.db.name==`string`?s.db.name:t()},getOpfsRootName(){return e()},async createConversation(e){let t=s.db;if(!t)throw Error(`[E2E Bridge] DB not ready`);return o.createConversation(t,e)},async switchConversation(e){let t=s.db;if(!t)throw Error(`[E2E Bridge] DB not ready`);await o.switchConversation(t,e)},async loadTasks(){let e=s.db;if(!e)throw Error(`[E2E Bridge] DB not ready`);await o.loadTasks(e)},async configureProvider(e,t,c,l){let u=o.orchestrator,d=s.db;if(!u||!d)throw Error(`[E2E Bridge] Orchestrator or DB not ready`);await a(u,d,e,{loadApiKeyForProvider:u.loadApiKeyForProvider.bind(u),getApiKeyForHeaders:()=>i(u)}),await u.setApiKey(d,t),await r(u,d,c),await n(u,d,l)}}}function s(){return globalThis.__SHADOWCLAW_E2E_ENABLE__===!0}export{s as n,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DBVvNlSN.js";import{U as t,r as n,x as r}from"./config-C16fFWtP.js";import{t as i}from"./tx-promise-DNVEN3Wa.js";import{t as a}from"./get-config-Bkvl__ZS.js";import{r as o}from"./headless-D6caaop6.js";import{t as s}from"./memory-storage-2m7KZ-aP.js";async function c(e,...t){let n=e;for(let e of t){let t=await n.getDirectoryHandle(e,{create:!0});if(typeof n.isSameEntry==`function`&&await n.isSameEntry(t))throw Error(`Directory navigation failed: "${e}" resolved to the same directory as its parent. The stored directory handle may be stale — try re-selecting the storage folder.`);n=t}return n}function l(e,t){return i(e,`config`,`readwrite`,e=>e.delete(t)).then(()=>void 0)}let u=null;async function d(e,t){try{return await e.entries().next(),`granted`}catch{return t}}function f(){let e=t();return e?`${r}-${e}`:r}async function p(){try{if(typeof navigator<`u`&&navigator.storage&&typeof navigator.storage.getDirectory==`function`){let e=await navigator.storage.getDirectory(),t=f();return await e.getDirectoryHandle(t,{create:!0})}}catch(e){console.warn(`OPFS is unavailable (e.g. Firefox Private Browsing). Using in-memory storage fallback:`,e)}return s()}function m(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`}async function h(e){if(u)return u;try{let t=await a(e,n.STORAGE_HANDLE);if(m(t)){let e=t;if(typeof e.queryPermission==`function`&&await e.queryPermission({mode:`readwrite`})!==`granted`&&typeof e.requestPermission==`function`)try{await e.requestPermission({mode:`readwrite`})}catch{}return e}}catch(e){console.warn(`Failed to retrieve local storage handle from DB:`,e)}return p()}function g(e){u=e}function _(){u=null}function v(e){return e instanceof DOMException&&e.name===`InvalidStateError`}async function y(e){await l(e,n.STORAGE_HANDLE),u=null}async function b(e){if(u)try{let e=await u.queryPermission({mode:`readwrite`});return{type:`local`,permission:e===`granted`?`granted`:await d(u,e),name:u.name}}catch{console.warn(`Getting storage status failed for explicit storage root.`)}try{let t=await a(e,n.STORAGE_HANDLE);if(m(t)){let e=t,n=await e.queryPermission({mode:`readwrite`});return{type:`local`,permission:n===`granted`?`granted`:await d(e,n),name:e.name}}}catch(e){console.warn(`Failed to check storage status:`,e)}return{type:`opfs`,permission:`granted`,name:`OPFS`}}var x=/* @__PURE__ */ e({getGroupDir:()=>S});async function S(e,t){let n=await h(e);return o()?n:c(n,`groups`,t.replace(/:/g,`-`))}export{b as a,y as c,h as i,g as l,x as n,_ as o,f as r,v as s,S as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./config-
|
|
1
|
+
import{r as e}from"./config-C16fFWtP.js";import{t}from"./get-config-Bkvl__ZS.js";import{t as n}from"./set-config-DSiuMe0k.js";function r(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`sub-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}async function i(i){if(!i)return r();let a=await t(i,e.SUBSCRIBER_ID);if(typeof a==`string`&&a.trim().length>0)return a;let o=r();return await n(i,e.SUBSCRIBER_ID,o),o}export{i as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,t}from"./rolldown-runtime-DBVvNlSN.js";import{t as n}from"./browser-B1SoUj6D.js";import{a as r,i}from"./config-
|
|
1
|
+
import{i as e,t}from"./rolldown-runtime-DBVvNlSN.js";import{t as n}from"./browser-B1SoUj6D.js";import{a as r,i}from"./config-C16fFWtP.js";import{r as a}from"./headless-D6caaop6.js";import{t as o}from"./buffer-B98mcmH0.js";import{t as s}from"./sha1--mbw-ArX.js";import{a as c,c as l,l as u,o as d,s as f,u as p}from"./compact-context-dHitmPsV.js";var m=/* @__PURE__ */ t(((t,r)=>{var i=/* @__PURE__ */ e(n()),a=function(e){if(e||={},this.Promise=e.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=e.domainReentrant||!1,this.domainReentrant){if(i.default===void 0||i.default.domain===void 0)throw Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=e.timeout||a.DEFAULT_TIMEOUT,this.maxOccupationTime=e.maxOccupationTime||a.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=e.maxExecutionTime||a.DEFAULT_MAX_EXECUTION_TIME,this.maxPending=e.maxPending===1/0||Number.isInteger(e.maxPending)&&e.maxPending>=0?e.maxPending:a.DEFAULT_MAX_PENDING};a.DEFAULT_TIMEOUT=0,a.DEFAULT_MAX_OCCUPATION_TIME=0,a.DEFAULT_MAX_EXECUTION_TIME=0,a.DEFAULT_MAX_PENDING=1e3,a.prototype.acquire=function(e,t,n,r){if(Array.isArray(e))return this._acquireBatch(e,t,n,r);if(typeof t!=`function`)throw Error(`You must pass a function to execute`);var a=null,o=null,s=null;typeof n!=`function`&&(r=n,n=null,s=new this.Promise(function(e,t){a=e,o=t})),r||={};var c=!1,l=null,u=null,d=null,f=this,p=function(t,r,i){u&&=(clearTimeout(u),null),d&&=(clearTimeout(d),null),t&&(f.queues[e]&&f.queues[e].length===0&&delete f.queues[e],f.domainReentrant&&delete f.domains[e]),c||=(s?r?o(r):a(i):typeof n==`function`&&n(r,i),!0),t&&f.queues[e]&&f.queues[e].length>0&&f.queues[e].shift()()},m=function(n){if(c)return p(n);l&&=(clearTimeout(l),null),f.domainReentrant&&n&&(f.domains[e]=i.default.domain);var a=r.maxExecutionTime||f.maxExecutionTime;if(a&&(d=setTimeout(function(){f.queues[e]&&p(n,/* @__PURE__ */ Error(`Maximum execution time is exceeded `+e))},a)),t.length===1){var o=!1;try{t(function(e,t){o||(o=!0,p(n,e,t))})}catch(e){o||(o=!0,p(n,e))}}else f._promiseTry(function(){return t()}).then(function(e){p(n,void 0,e)},function(e){p(n,e)})};f.domainReentrant&&i.default.domain&&(m=i.default.domain.bind(m));var h=r.maxPending||f.maxPending;if(!f.queues[e])f.queues[e]=[],m(!0);else if(f.domainReentrant&&i.default.domain&&i.default.domain===f.domains[e])m(!1);else if(f.queues[e].length>=h)p(!1,/* @__PURE__ */ Error(`Too many pending tasks in queue `+e));else{var g=function(){m(!0)};r.skipQueue?f.queues[e].unshift(g):f.queues[e].push(g);var _=r.timeout||f.timeout;_&&(l=setTimeout(function(){l=null,p(!1,/* @__PURE__ */ Error(`async-lock timed out in queue `+e))},_))}var v=r.maxOccupationTime||f.maxOccupationTime;if(v&&(u=setTimeout(function(){f.queues[e]&&p(!1,/* @__PURE__ */ Error(`Maximum occupation time is exceeded in queue `+e))},v)),s)return s},a.prototype._acquireBatch=function(e,t,n,r){typeof n!=`function`&&(r=n,n=null);var i=this,a=function(e,t){return function(n){i.acquire(e,t,n,r)}},o=e.reduceRight(function(e,t){return a(t,e)},t);if(typeof n==`function`)o(n);else return new this.Promise(function(e,t){o.length===1?o(function(n,r){n?t(n):e(r)}):e(o())})},a.prototype.isBusy=function(e){return e?!!this.queues[e]:Object.keys(this.queues).length>0},a.prototype._promiseTry=function(e){try{return this.Promise.resolve(e())}catch(e){return this.Promise.reject(e)}},r.exports=a})),h=/* @__PURE__ */ t(((e,t)=>{t.exports=m()})),g=/* @__PURE__ */ t(((e,t)=>{function n(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function r(e,t,r){return t=t instanceof RegExp?t:new RegExp(n(t),`g`),e.replace(t,r)}t.exports={clean:function(e){if(typeof e!=`string`)throw Error(`Expected a string, received: `+e);return e=r(e,`./`,`/`),e=r(e,`..`,`.`),e=r(e,` `,`-`),e=r(e,/^[~^:?*\\\-]/g,``),e=r(e,/[~^:?*\\]/g,`-`),e=r(e,/[~^:?*\\\-]$/g,``),e=r(e,`@{`,`-`),e=r(e,/\.$/g,``),e=r(e,/\/$/g,``),e=r(e,/\.lock$/g,``),e}}})),_=/* @__PURE__ */ t((e=>{
|
|
2
2
|
/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */
|
|
3
3
|
(function(t){typeof DO_NOT_EXPORT_CRC>`u`?typeof e==`object`?t(e):typeof define==`function`&&define.amd?define(function(){var e={};return t(e),e}):t({}):t({})})(function(e){e.version=`1.2.2`;function t(){for(var e=0,t=Array(256),n=0;n!=256;++n)e=n,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,t[n]=e;return typeof Int32Array<`u`?new Int32Array(t):t}var n=t();function r(e){var t=0,n=0,r=0,i=typeof Int32Array<`u`?/* @__PURE__ */ new Int32Array(4096):Array(4096);for(r=0;r!=256;++r)i[r]=e[r];for(r=0;r!=256;++r)for(n=e[r],t=256+r;t<4096;t+=256)n=i[t]=n>>>8^e[n&255];var a=[];for(r=1;r!=16;++r)a[r-1]=typeof Int32Array<`u`?i.subarray(r*256,r*256+256):i.slice(r*256,r*256+256);return a}var i=r(n),a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],_=i[12],v=i[13],y=i[14];function b(e,t){for(var r=t^-1,i=0,a=e.length;i<a;)r=r>>>8^n[(r^e.charCodeAt(i++))&255];return~r}function x(e,t){for(var r=t^-1,i=e.length-15,b=0;b<i;)r=y[e[b++]^r&255]^v[e[b++]^r>>8&255]^_[e[b++]^r>>16&255]^g[e[b++]^r>>>24]^h[e[b++]]^m[e[b++]]^p[e[b++]]^f[e[b++]]^d[e[b++]]^u[e[b++]]^l[e[b++]]^c[e[b++]]^s[e[b++]]^o[e[b++]]^a[e[b++]]^n[e[b++]];for(i+=15;b<i;)r=r>>>8^n[(r^e[b++])&255];return~r}function S(e,t){for(var r=t^-1,i=0,a=e.length,o=0,s=0;i<a;)o=e.charCodeAt(i++),o<128?r=r>>>8^n[(r^o)&255]:o<2048?(r=r>>>8^n[(r^(192|o>>6&31))&255],r=r>>>8^n[(r^(128|o&63))&255]):o>=55296&&o<57344?(o=(o&1023)+64,s=e.charCodeAt(i++)&1023,r=r>>>8^n[(r^(240|o>>8&7))&255],r=r>>>8^n[(r^(128|o>>2&63))&255],r=r>>>8^n[(r^(128|s>>6&15|(o&3)<<4))&255],r=r>>>8^n[(r^(128|s&63))&255]):(r=r>>>8^n[(r^(224|o>>12&15))&255],r=r>>>8^n[(r^(128|o>>6&63))&255],r=r>>>8^n[(r^(128|o&63))&255]);return~r}e.table=n,e.bstr=b,e.buf=x,e.str=S})})),v=/* @__PURE__ */ t((e=>{var t=u(),n=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch{n=!1}try{String.fromCharCode.apply(null,/* @__PURE__ */ new Uint8Array(1))}catch{r=!1}for(var i=new t.Buf8(256),a=0;a<256;a++)i[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;i[254]=i[254]=1,e.string2buf=function(e){var n,r,i,a,o,s=e.length,c=0;for(a=0;a<s;a++)r=e.charCodeAt(a),(r&64512)==55296&&a+1<s&&(i=e.charCodeAt(a+1),(i&64512)==56320&&(r=65536+(r-55296<<10)+(i-56320),a++)),c+=r<128?1:r<2048?2:r<65536?3:4;for(n=new t.Buf8(c),o=0,a=0;o<c;a++)r=e.charCodeAt(a),(r&64512)==55296&&a+1<s&&(i=e.charCodeAt(a+1),(i&64512)==56320&&(r=65536+(r-55296<<10)+(i-56320),a++)),r<128?n[o++]=r:r<2048?(n[o++]=192|r>>>6,n[o++]=128|r&63):r<65536?(n[o++]=224|r>>>12,n[o++]=128|r>>>6&63,n[o++]=128|r&63):(n[o++]=240|r>>>18,n[o++]=128|r>>>12&63,n[o++]=128|r>>>6&63,n[o++]=128|r&63);return n};function o(e,i){if(i<65534&&(e.subarray&&r||!e.subarray&&n))return String.fromCharCode.apply(null,t.shrinkBuf(e,i));for(var a=``,o=0;o<i;o++)a+=String.fromCharCode(e[o]);return a}e.buf2binstring=function(e){return o(e,e.length)},e.binstring2buf=function(e){for(var n=new t.Buf8(e.length),r=0,i=n.length;r<i;r++)n[r]=e.charCodeAt(r);return n},e.buf2string=function(e,t){var n,r,a,s,c=t||e.length,l=Array(c*2);for(r=0,n=0;n<c;)if(a=e[n++],a<128)l[r++]=a;else if(s=i[a],s>4)l[r++]=65533,n+=s-1;else{for(a&=s===2?31:s===3?15:7;s>1&&n<c;)a=a<<6|e[n++]&63,s--;s>1?l[r++]=65533:a<65536?l[r++]=a:(a-=65536,l[r++]=55296|a>>10&1023,l[r++]=56320|a&1023)}return o(l,r)},e.utf8border=function(e,t){var n;for(t||=e.length,t>e.length&&(t=e.length),n=t-1;n>=0&&(e[n]&192)==128;)n--;return n<0||n===0?t:n+i[e[n]]>t?n:t}})),y=/* @__PURE__ */ t((e=>{var t=f(),n=u(),r=v(),i=l(),a=p(),o=Object.prototype.toString,s=0,c=4,d=0,m=1,h=2,g=-1,_=0,y=8;function b(e){if(!(this instanceof b))return new b(e);this.options=n.assign({level:g,method:y,chunkSize:16384,windowBits:15,memLevel:8,strategy:_,to:``},e||{});var s=this.options;s.raw&&s.windowBits>0?s.windowBits=-s.windowBits:s.gzip&&s.windowBits>0&&s.windowBits<16&&(s.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var c=t.deflateInit2(this.strm,s.level,s.method,s.windowBits,s.memLevel,s.strategy);if(c!==d)throw Error(i[c]);if(s.header&&t.deflateSetHeader(this.strm,s.header),s.dictionary){var l=typeof s.dictionary==`string`?r.string2buf(s.dictionary):o.call(s.dictionary)===`[object ArrayBuffer]`?new Uint8Array(s.dictionary):s.dictionary;if(c=t.deflateSetDictionary(this.strm,l),c!==d)throw Error(i[c]);this._dict_set=!0}}b.prototype.push=function(e,i){var a=this.strm,l=this.options.chunkSize,u,f;if(this.ended)return!1;f=i===~~i?i:i===!0?c:s,a.input=typeof e==`string`?r.string2buf(e):o.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,a.next_in=0,a.avail_in=a.input.length;do{if(a.avail_out===0&&(a.output=new n.Buf8(l),a.next_out=0,a.avail_out=l),u=t.deflate(a,f),u!==m&&u!==d)return this.onEnd(u),this.ended=!0,!1;(a.avail_out===0||a.avail_in===0&&(f===c||f===h))&&(this.options.to===`string`?this.onData(r.buf2binstring(n.shrinkBuf(a.output,a.next_out))):this.onData(n.shrinkBuf(a.output,a.next_out)))}while((a.avail_in>0||a.avail_out===0)&&u!==m);return f===c?(u=t.deflateEnd(this.strm),this.onEnd(u),this.ended=!0,u===d):(f===h&&(this.onEnd(d),a.avail_out=0),!0)},b.prototype.onData=function(e){this.chunks.push(e)},b.prototype.onEnd=function(e){e===d&&(this.result=this.options.to===`string`?this.chunks.join(``):n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function x(e,t){var n=new b(t);if(n.push(e,!0),n.err)throw n.msg||i[n.err];return n.result}function S(e,t){return t||={},t.raw=!0,x(e,t)}function C(e,t){return t||={},t.gzip=!0,x(e,t)}e.Deflate=b,e.deflate=x,e.deflateRaw=S,e.gzip=C})),b=/* @__PURE__ */ t(((e,t)=>{function n(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=``,this.comment=``,this.hcrc=0,this.done=!1}t.exports=n})),x=/* @__PURE__ */ t((e=>{var t=d(),n=u(),r=v(),i=c(),a=l(),o=p(),s=b(),f=Object.prototype.toString;function m(e){if(!(this instanceof m))return new m(e);this.options=n.assign({chunkSize:16384,windowBits:0,to:``},e||{});var c=this.options;c.raw&&c.windowBits>=0&&c.windowBits<16&&(c.windowBits=-c.windowBits,c.windowBits===0&&(c.windowBits=-15)),c.windowBits>=0&&c.windowBits<16&&!(e&&e.windowBits)&&(c.windowBits+=32),c.windowBits>15&&c.windowBits<48&&(c.windowBits&15||(c.windowBits|=15)),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var l=t.inflateInit2(this.strm,c.windowBits);if(l!==i.Z_OK||(this.header=new s,t.inflateGetHeader(this.strm,this.header),c.dictionary&&(typeof c.dictionary==`string`?c.dictionary=r.string2buf(c.dictionary):f.call(c.dictionary)===`[object ArrayBuffer]`&&(c.dictionary=new Uint8Array(c.dictionary)),c.raw&&(l=t.inflateSetDictionary(this.strm,c.dictionary),l!==i.Z_OK))))throw Error(a[l])}m.prototype.push=function(e,a){var o=this.strm,s=this.options.chunkSize,c=this.options.dictionary,l,u,d,p,m,h=!1;if(this.ended)return!1;u=a===~~a?a:a===!0?i.Z_FINISH:i.Z_NO_FLUSH,o.input=typeof e==`string`?r.binstring2buf(e):f.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,o.next_in=0,o.avail_in=o.input.length;do{if(o.avail_out===0&&(o.output=new n.Buf8(s),o.next_out=0,o.avail_out=s),l=t.inflate(o,i.Z_NO_FLUSH),l===i.Z_NEED_DICT&&c&&(l=t.inflateSetDictionary(this.strm,c)),l===i.Z_BUF_ERROR&&h===!0&&(l=i.Z_OK,h=!1),l!==i.Z_STREAM_END&&l!==i.Z_OK)return this.onEnd(l),this.ended=!0,!1;o.next_out&&(o.avail_out===0||l===i.Z_STREAM_END||o.avail_in===0&&(u===i.Z_FINISH||u===i.Z_SYNC_FLUSH))&&(this.options.to===`string`?(d=r.utf8border(o.output,o.next_out),p=o.next_out-d,m=r.buf2string(o.output,d),o.next_out=p,o.avail_out=s-p,p&&n.arraySet(o.output,o.output,d,p,0),this.onData(m)):this.onData(n.shrinkBuf(o.output,o.next_out))),o.avail_in===0&&o.avail_out===0&&(h=!0)}while((o.avail_in>0||o.avail_out===0)&&l!==i.Z_STREAM_END);return l===i.Z_STREAM_END&&(u=i.Z_FINISH),u===i.Z_FINISH?(l=t.inflateEnd(this.strm),this.onEnd(l),this.ended=!0,l===i.Z_OK):(u===i.Z_SYNC_FLUSH&&(this.onEnd(i.Z_OK),o.avail_out=0),!0)},m.prototype.onData=function(e){this.chunks.push(e)},m.prototype.onEnd=function(e){e===i.Z_OK&&(this.result=this.options.to===`string`?this.chunks.join(``):n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function h(e,t){var n=new m(t);if(n.push(e,!0),n.err)throw n.msg||a[n.err];return n.result}function g(e,t){return t||={},t.raw=!0,h(e,t)}e.Inflate=m,e.inflate=h,e.inflateRaw=g,e.ungzip=h})),S=/* @__PURE__ */ t(((e,t)=>{var n=u().assign,r=y(),i=x(),a=c(),o={};n(o,r,i,a),t.exports=o})),C=/* @__PURE__ */ t(((e,t)=>{let n=(e,t)=>function(...n){let r=t.promiseModule;return new r((r,i)=>{t.multiArgs?n.push((...e)=>{t.errorFirst?e[0]?i(e):(e.shift(),r(e)):r(e)}):t.errorFirst?n.push((e,t)=>{e?i(e):r(t)}):n.push(r),e.apply(this,n)})};t.exports=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);let r=typeof e;if(e===null||r!==`object`&&r!==`function`)throw TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?`null`:r}\``);let i=e=>{let n=t=>typeof t==`string`?e===t:t.test(e);return t.include?t.include.some(n):!t.exclude.some(n)},a;a=r===`function`?function(...r){return t.excludeMain?e(...r):n(e,t).apply(this,r)}:Object.create(Object.getPrototypeOf(e));for(let r in e){let o=e[r];a[r]=typeof o==`function`&&i(r)?n(o,t):o}return a}})),w=/* @__PURE__ */ t(((t,r)=>{var i=/* @__PURE__ */ e(n());function a(e){return Array.isArray(e)?e:[e]}let o=/^\s+$/,s=/(?:[^\\]|^)\\$/,c=/^\\!/,l=/^\\#/,u=/\r?\n/g,d=/^\.*\/|^\.+$/,f=`node-ignore`;
|
|
4
4
|
/* istanbul ignore else */
|
|
@@ -90,7 +90,7 @@ gpgsig`+kn(o)+`
|
|
|
90
90
|
`,author:o,committer:s,signingKey:c})}async function co({fs:e,onSign:t,dir:n,gitdir:r=z(n,`.git`),ref:i=`refs/notes/commits`,oid:a,author:o,committer:s,signingKey:c,cache:l={}}){try{Y(`fs`,e),Y(`gitdir`,r),Y(`oid`,a);let n=new J(e),u=await X({fsp:n,dotgit:r}),d=await pr({fs:n,gitdir:u,author:o});if(!d)throw new W(`author`);let f=await mr({fs:n,gitdir:u,author:d,committer:s});if(!f)throw new W(`committer`);return await so({fs:n,cache:l,onSign:t,gitdir:u,ref:i,oid:a,author:d,committer:f,signingKey:c})}catch(e){throw e.caller=`git.removeNote`,e}}async function lo({fs:e,gitdir:t,oldref:n,ref:r,checkout:i=!1}){if(!Ke(r,!0))throw new ze(r,A.default.clean(r));if(!Ke(n,!0))throw new ze(n,A.default.clean(n));let a=`refs/heads/${n}`,o=`refs/heads/${r}`;if(await V.exists({fs:e,gitdir:t,ref:o}))throw new qt(`branch`,r,!1);let s=await V.resolve({fs:e,gitdir:t,ref:a,depth:1});await V.writeRef({fs:e,gitdir:t,ref:o,value:s}),await V.deleteRef({fs:e,gitdir:t,ref:a});let c=await ei({fs:e,gitdir:t,fullname:!0})===a;(i||c)&&await V.writeSymbolicRef({fs:e,gitdir:t,ref:`HEAD`,value:o})}async function uo({fs:e,dir:t,gitdir:n=z(t,`.git`),ref:r,oldref:i,checkout:a=!1}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`ref`,r),Y(`oldref`,i);let t=new J(e);return await lo({fs:t,gitdir:await X({fsp:t,dotgit:n}),ref:r,oldref:i,checkout:a})}catch(e){throw e.caller=`git.renameBranch`,e}}async function fo({gitdir:e,type:t,object:n}){return _e(Ct.wrap({type:t,object:n}))}async function po({fs:e,dir:t,gitdir:n=z(t,`.git`),filepath:r,ref:i,cache:a={}}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`filepath`,r);let o=new J(e),s=await X({fsp:o,dotgit:n}),c,l;try{c=await V.resolve({fs:o,gitdir:s,ref:i||`HEAD`})}catch(e){if(i)throw e}if(c)try{c=await yr({fs:o,cache:a,gitdir:s,oid:c,filepath:r})}catch{c=null}let u={ctime:/* @__PURE__ */ new Date(0),mtime:/* @__PURE__ */ new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0},d=t&&await o.read(z(t,r));d&&(l=await fo({gitdir:s,type:`blob`,object:d}),c===l&&(u=await o.lstat(z(t,r)))),await I.acquire({fs:o,gitdir:s,cache:a},async function(e){e.delete({filepath:r}),c&&e.insert({filepath:r,stats:u,oid:c})})}catch(e){throw e.caller=`git.reset`,e}}async function mo({fs:e,dir:t,gitdir:n=z(t,`.git`),ref:r,depth:i}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`ref`,r);let t=new J(e),a=await X({fsp:t,dotgit:n});return await V.resolve({fs:t,gitdir:a,ref:r,depth:i})}catch(e){throw e.caller=`git.resolveRef`,e}}async function ho({fs:e,dir:t,gitdir:n=z(t,`.git`),path:r,value:i,append:a=!1}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`path`,r);let t=new J(e),o=await X({fsp:t,dotgit:n}),s=await B.get({fs:t,gitdir:o});a?await s.append(r,i):await s.set(r,i),await B.save({fs:t,gitdir:o,config:s})}catch(e){throw e.caller=`git.setConfig`,e}}async function go({fs:e,gitdir:t,commit:n}){return await Z({fs:e,gitdir:t,type:`commit`,object:jn.from(n).toObject(),format:`content`})}var _o=class e{static get timezoneOffsetForRefLogEntry(){let e=(/* @__PURE__ */ new Date()).getTimezoneOffset(),t=Math.abs(Math.floor(e/60)),n=Math.abs(e%60).toString().padStart(2,`0`);return`${e>0?`-`:`+`}${t.toString().padStart(2,`0`)}${n}`}static createStashReflogEntry(t,n,r){let i=t.name.replace(/\s/g,``),a=Math.floor(Date.now()/1e3),o=e.timezoneOffsetForRefLogEntry;return`0000000000000000000000000000000000000000 ${n} ${i} ${t.email} ${a} ${o}\t${r}\n`}static getStashReflogEntry(e,t=!1){return e.split(`
|
|
91
91
|
`).filter(e=>e).reverse().map((e,n)=>t?`stash@{${n}}: ${e.split(` `)[1]}`:e)}},vo=class e{constructor({fs:e,dir:t,gitdir:n=z(t,`.git`)}){Object.assign(this,{fs:e,dir:t,gitdir:n,_author:null})}static get refStash(){return`refs/stash`}static get refLogsStash(){return`logs/refs/stash`}get refStashPath(){return z(this.gitdir,e.refStash)}get refLogsStashPath(){return z(this.gitdir,e.refLogsStash)}async getAuthor(){if(!this._author&&(this._author=await pr({fs:this.fs,gitdir:this.gitdir,author:{}}),!this._author))throw new W(`author`);return this._author}async getStashSHA(e,t){return await this.fs.exists(this.refStashPath)?(t||await this.readStashReflogs({parsed:!1}))[e].split(` `)[1]:null}async writeStashCommit({message:e,tree:t,parent:n}){return go({fs:this.fs,gitdir:this.gitdir,commit:{message:e,tree:t,parent:n,author:await this.getAuthor(),committer:await this.getAuthor()}})}async readStashCommit(e){let t=await this.readStashReflogs({parsed:!1});if(e!==0&&(e<0||e>t.length-1))throw new ze(`stash@${e}`,`number that is in range of [0, num of stash pushed]`);let n=await this.getStashSHA(e,t);return n?gr({fs:this.fs,cache:{},gitdir:this.gitdir,oid:n}):{}}async writeStashRef(t){return V.writeRef({fs:this.fs,gitdir:this.gitdir,ref:e.refStash,value:t})}async writeStashReflogEntry({stashCommit:e,message:t}){let n=await this.getAuthor(),r=_o.createStashReflogEntry(n,e,t),i=this.refLogsStashPath;await F(i,async()=>{let e=await this.fs.exists(i)?await this.fs.read(i,`utf8`):``;await this.fs.write(i,e+r,`utf8`)})}async readStashReflogs({parsed:e=!1}){if(!await this.fs.exists(this.refLogsStashPath))return[];let t=await this.fs.read(this.refLogsStashPath,`utf8`);return _o.getStashReflogEntry(t,e)}};async function yo({fs:e,dir:t,gitdir:n,message:r=``}){let i=new vo({fs:e,dir:t,gitdir:n});await i.getAuthor();let a=await ei({fs:e,gitdir:n,fullname:!1}),o=await V.resolve({fs:e,gitdir:n,ref:`HEAD`}),s=(await $a({fs:e,dir:t,gitdir:n,oid:o})).commit.message,c=[o],l=null,u=q({ref:`HEAD`}),d=await qr({fs:e,dir:t,gitdir:n,treePair:[q({ref:`HEAD`}),`stage`]});if(d){let e=await i.writeStashCommit({message:`stash-Index: WIP on ${a} - ${(/* @__PURE__ */ new Date()).toISOString()}`,tree:d,parent:c});c.push(e),l=d,u=Le()}let f=await qr({fs:e,dir:t,gitdir:n,treePair:[u,`workdir`]});if(f){let e=await i.writeStashCommit({message:`stash-WorkDir: WIP on ${a} - ${(/* @__PURE__ */ new Date()).toISOString()}`,tree:f,parent:[c[c.length-1]]});c.push(e),l=f}if(!l||!d&&!f)throw new L(`changes, nothing to stash`);let p=(r.trim()||`WIP on ${a}`)+`: ${o.substring(0,7)} ${s}`;return{stashCommit:await i.writeStashCommit({message:p,tree:l,parent:c}),stashMsg:p,branch:a,stashMgr:i}}async function bo({fs:e,dir:t,gitdir:n,message:r=``}){let{stashCommit:i,stashMsg:a,branch:o,stashMgr:s}=await yo({fs:e,dir:t,gitdir:n,message:r});return await s.writeStashRef(i),await s.writeStashReflogEntry({stashCommit:i,message:a}),await zr({fs:e,dir:t,gitdir:n,ref:o,track:!1,force:!0}),i}async function xo({fs:e,dir:t,gitdir:n,message:r=``}){let{stashCommit:i}=await yo({fs:e,dir:t,gitdir:n,message:r});return i}async function So({fs:e,dir:t,gitdir:n,refIdx:r=0}){let i=await new vo({fs:e,dir:t,gitdir:n}).readStashCommit(r),{parent:a=null}=i.commit?i.commit:{};if(a&&Array.isArray(a))for(let r=0;r<a.length-1;r++){let i=(await gr({fs:e,cache:{},gitdir:n,oid:a[r+1]})).commit.message.startsWith(`stash-Index`);await Jr({fs:e,dir:t,gitdir:n,stashCommit:a[r+1],parentCommit:a[r],wasStaged:i})}}async function Co({fs:e,dir:t,gitdir:n,refIdx:r=0}){let i=new vo({fs:e,dir:t,gitdir:n});if(!(await i.readStashCommit(r)).commit)return;let a=i.refStashPath;await F(a,async()=>{await e.exists(a)&&await e.rm(a)});let o=await i.readStashReflogs({parsed:!1});if(!o.length)return;o.splice(r,1);let s=i.refLogsStashPath;await F(s,async()=>{if(o.length){await e.write(s,o.reverse().join(`
|
|
92
92
|
`)+`
|
|
93
|
-
`,`utf8`);let t=o[o.length-1].split(` `)[1];await i.writeStashRef(t)}else await e.rm(s)})}async function wo({fs:e,dir:t,gitdir:n}){return new vo({fs:e,dir:t,gitdir:n}).readStashReflogs({parsed:!0})}async function To({fs:e,dir:t,gitdir:n}){let r=new vo({fs:e,dir:t,gitdir:n}),i=[r.refStashPath,r.refLogsStashPath];await F(i,async()=>{await Promise.all(i.map(async t=>{if(await e.exists(t))return e.rm(t)}))})}async function Eo({fs:e,dir:t,gitdir:n,refIdx:r=0}){await So({fs:e,dir:t,gitdir:n,refIdx:r}),await Co({fs:e,dir:t,gitdir:n,refIdx:r})}async function Do({fs:e,dir:t,gitdir:n=z(t,`.git`),op:r=`push`,message:i=``,refIdx:a=0}){Y(`fs`,e),Y(`dir`,t),Y(`gitdir`,n),Y(`op`,r);let o={push:bo,apply:So,drop:Co,list:wo,clear:To,pop:Eo,create:xo},s=[`apply`,`drop`,`pop`];try{let c=new J(e),l=await X({fsp:c,dotgit:n});[`refs`,`logs`,`logs/refs`].map(e=>z(l,e)).forEach(async e=>{await c.exists(e)||await c.mkdir(e)});let u=o[r];if(u){if(s.includes(r)&&a<0)throw new ze(`stash@${a}`,`number that is in range of [0, num of stash pushed]`);return await u({fs:c,dir:t,gitdir:l,message:i,refIdx:a})}throw Error(`To be implemented: ${r}`)}catch(e){throw e.caller=`git.stash`,e}}async function Oo({fs:e,dir:t,gitdir:n=z(t,`.git`),filepath:r,cache:i={},refresh:a=!0}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`filepath`,r);let o=new J(e),s=await X({fsp:o,dotgit:n}),c=await ko({fs:o,cache:i,gitdir:s,tree:await Ao({fs:o,cache:i,gitdir:s}),path:r}),l=await I.acquire({fs:o,gitdir:s,cache:i},async function(e){for(let t of e)if(t.path===r)return t;return null});if(c===null&&l===null&&await Qn.isIgnored({fs:o,gitdir:s,dir:t,filepath:r}))return`ignored`;let u=await o.lstat(z(t,r)),d=c!==null,f=l!==null,p=u!==null,m=async()=>{if(f&&!we(l,u))return l.oid;{let e=await(await B.get({fs:o,gitdir:s})).get(`core.autocrlf`),n=await o.read(z(t,r),{autocrlf:e}),c=await fo({gitdir:s,type:`blob`,object:n});return a&&f&&l.oid===c&&u.size!==-1&&I.acquire({fs:o,gitdir:s,cache:i},async function(e){e.insert({filepath:r,stats:u,oid:c})}),c}};if(!d&&!p&&!f)return`absent`;if(!d&&!p&&f)return`*absent`;if(!d&&p&&!f)return`*added`;if(!d&&p&&f)return await m()===l.oid?`added`:`*added`;if(d&&!p&&!f)return`deleted`;if(d&&!p&&f)return l.oid,`*deleted`;if(d&&p&&!f)return await m()===c?`*undeleted`:`*undeletemodified`;if(d&&p&&f){let e=await m();return e===c?e===l.oid?`unmodified`:`*unmodified`:e===l.oid?`modified`:`*modified`}}catch(e){throw e.caller=`git.status`,e}}async function ko({fs:e,cache:t,gitdir:n,tree:r,path:i}){typeof i==`string`&&(i=i.split(`/`));let a=i.shift();for(let o of r)if(o.path===a){if(i.length===0)return o.oid;let{type:r,object:a}=await U({fs:e,cache:t,gitdir:n,oid:o.oid});if(r===`tree`)return ko({fs:e,cache:t,gitdir:n,tree:H.from(a),path:i});if(r===`blob`)throw new R(o.oid,r,`blob`,i.join(`/`))}return null}async function Ao({fs:e,cache:t,gitdir:n}){let r;try{r=await V.resolve({fs:e,gitdir:n,ref:`HEAD`})}catch(e){if(e instanceof L)return[]}let{tree:i}=await Sr({fs:e,cache:t,gitdir:n,oid:r});return i}async function jo({fs:e,dir:t,gitdir:n=z(t,`.git`),ref:r=`HEAD`,filepaths:i=[`.`],filter:a,cache:o={},ignored:s=!1,refresh:c=!0}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`ref`,r);let l=new J(e);return await Bn({fs:l,cache:o,dir:t,gitdir:await X({fsp:l,dotgit:n}),trees:[q({ref:r}),Fn({refresh:c}),Le()],map:async function(e,[n,r,o]){if(!n&&!o&&r&&!s&&await Qn.isIgnored({fs:l,dir:t,filepath:e})||!i.some(t=>Nr(e,t)))return null;if(a&&!a(e))return;let[c,u,d]=await Promise.all([n&&n.type(),r&&r.type(),o&&o.type()]),f=[c,u,d].includes(`blob`);if((c===`tree`||c===`special`)&&!f)return;if(c===`commit`)return null;if((u===`tree`||u===`special`)&&!f)return;if(d===`commit`)return null;if((d===`tree`||d===`special`)&&!f)return;let p=c===`blob`?await n.oid():void 0,m=d===`blob`?await o.oid():void 0,h;c!==`blob`&&u===`blob`&&d!==`blob`?h=`42`:u===`blob`&&(h=await r.oid());let g=[void 0,p,h,m],_=g.map(e=>g.indexOf(e));return _.shift(),[e,..._]}})}catch(e){throw e.caller=`git.statusMatrix`,e}}async function Mo({fs:e,dir:t,gitdir:n=z(t,`.git`),ref:r,object:i,force:a=!1}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`ref`,r);let t=new J(e);if(r===void 0)throw new G(`ref`);r=r.startsWith(`refs/tags/`)?r:`refs/tags/${r}`;let o=await X({fsp:t,dotgit:n}),s=await V.resolve({fs:t,gitdir:o,ref:i||`HEAD`});if(!a&&await V.exists({fs:t,gitdir:o,ref:r}))throw new qt(`tag`,r);await V.writeRef({fs:t,gitdir:o,ref:r,value:s})}catch(e){throw e.caller=`git.tag`,e}}async function No({fs:e,dir:t,gitdir:n=z(t,`.git`),cache:r={},filepath:i,oid:a,mode:o,add:s,remove:c,force:l}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`filepath`,i);let u=new J(e),d=await X({fsp:u,dotgit:n});if(c)return await I.acquire({fs:u,gitdir:d,cache:r},async function(e){if(!l){let e=await u.lstat(z(t,i));if(e){if(e.isDirectory())throw new on(`directory`);return}}e.has({filepath:i})&&e.delete({filepath:i})});let f;if(!a){if(f=await u.lstat(z(t,i)),!f)throw new L(`file at "${i}" on disk and "remove" not set`);if(f.isDirectory())throw new on(`directory`)}return await I.acquire({fs:u,gitdir:d,cache:r},async function(e){if(!s&&!e.has({filepath:i}))throw new L(`file at "${i}" in index and "add" not set`);let n;if(a)n={ctime:/* @__PURE__ */ new Date(0),mtime:/* @__PURE__ */ new Date(0),dev:0,ino:0,mode:o,uid:0,gid:0,size:0};else{n=f;let e=n.isSymbolicLink()?await u.readlink(z(t,i)):await u.read(z(t,i));a=await Z({fs:u,gitdir:d,type:`blob`,format:`content`,object:e})}return e.insert({filepath:i,oid:a,stats:n}),a})}catch(e){throw e.caller=`git.updateIndex`,e}}function Po(){try{return Ti.version}catch(e){throw e.caller=`git.version`,e}}async function Fo({fs:e,dir:t,gitdir:n=z(t,`.git`),trees:r,map:i,reduce:a,iterate:o,cache:s={}}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`trees`,r);let c=new J(e);return await Bn({fs:c,cache:s,dir:t,gitdir:await X({fsp:c,dotgit:n}),trees:r,map:i,reduce:a,iterate:o})}catch(e){throw e.caller=`git.walk`,e}}async function Io({fs:e,dir:t,gitdir:n=z(t,`.git`),blob:r}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`blob`,r);let t=new J(e);return await Z({fs:t,gitdir:await X({fsp:t,dotgit:n}),type:`blob`,object:r,format:`content`})}catch(e){throw e.caller=`git.writeBlob`,e}}async function Lo({fs:e,dir:t,gitdir:n=z(t,`.git`),commit:r}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`commit`,r);let t=new J(e);return await go({fs:t,gitdir:await X({fsp:t,dotgit:n}),commit:r})}catch(e){throw e.caller=`git.writeCommit`,e}}async function Ro({fs:e,dir:t,gitdir:n=z(t,`.git`),type:r,object:i,format:a=`parsed`,oid:o,encoding:s=void 0}){try{let t=new J(e),c=await X({fsp:t,dotgit:n});if(a===`parsed`){switch(r){case`commit`:i=jn.from(i).toObject();break;case`tree`:i=H.from(i).toObject();break;case`blob`:i=D.Buffer.from(i,s);break;case`tag`:i=K.from(i).toObject();break;default:throw new R(o||``,r,`blob|commit|tag|tree`)}a=`content`}return o=await Z({fs:t,gitdir:c,type:r,object:i,oid:o,format:a}),o}catch(e){throw e.caller=`git.writeObject`,e}}async function zo({fs:e,dir:t,gitdir:n=z(t,`.git`),ref:r,value:i,force:a=!1,symbolic:o=!1}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`ref`,r),Y(`value`,i);let t=new J(e);if(!Ke(r,!0))throw new ze(r,A.default.clean(r));let s=await X({fsp:t,dotgit:n});if(!a&&await V.exists({fs:t,gitdir:s,ref:r}))throw new qt(`ref`,r);o?await V.writeSymbolicRef({fs:t,gitdir:s,ref:r,value:i}):(i=await V.resolve({fs:t,gitdir:s,ref:i}),await V.writeRef({fs:t,gitdir:s,ref:r,value:i}))}catch(e){throw e.caller=`git.writeRef`,e}}async function Bo({fs:e,gitdir:t,tag:n}){return await Z({fs:e,gitdir:t,type:`tag`,object:K.from(n).toObject(),format:`content`})}async function Vo({fs:e,dir:t,gitdir:n=z(t,`.git`),tag:r}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`tag`,r);let t=new J(e);return await Bo({fs:t,gitdir:await X({fsp:t,dotgit:n}),tag:r})}catch(e){throw e.caller=`git.writeTag`,e}}async function Ho({fs:e,dir:t,gitdir:n=z(t,`.git`),tree:r}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`tree`,r);let t=new J(e);return await Cr({fs:t,gitdir:await X({fsp:t,dotgit:n}),tree:r})}catch(e){throw e.caller=`git.writeTree`,e}}var Uo={Errors:bn,STAGE:Le,TREE:q,WORKDIR:Fn,add:ar,abortMerge:Zn,addNote:Tr,addRemote:Dr,annotatedTag:kr,branch:jr,cherryPick:Zr,checkout:zr,clone:Fi,commit:Ii,getConfig:ia,getConfigAll:oa,setConfig:ho,currentBranch:Li,deleteBranch:zi,deleteRef:Bi,deleteRemote:Hi,deleteTag:Wi,expandOid:Ji,expandRef:Yi,fastForward:$i,fetch:ea,findMergeBase:ta,findRoot:ra,getRemoteInfo:ca,getRemoteInfo2:ua,hashBlob:fa,indexPack:ma,init:ha,isDescendent:_a,isIgnored:va,listBranches:ya,listFiles:Sa,listNotes:wa,listRefs:Ta,listRemotes:Da,listServerRefs:Aa,listTags:ja,log:La,merge:Ra,packObjects:Ha,pull:Ua,push:Ya,readBlob:Qa,readCommit:$a,readNote:to,readObject:no,readTag:io,readTree:ao,remove:oo,removeNote:co,renameBranch:uo,resetIndex:po,updateIndex:No,resolveRef:mo,status:Oo,statusMatrix:jo,tag:Mo,version:Po,walk:Fo,writeBlob:Io,writeCommit:Lo,writeObject:Ro,writeRef:zo,writeTag:Vo,writeTree:Ho,stash:Do};globalThis.Buffer||(globalThis.Buffer=D.Buffer);function Wo(e){try{let t=typeof location<`u`&&location.origin?location.origin:typeof globalThis<`u`&&globalThis.location?.origin?globalThis.location.origin:`http://127.0.0.1:8888`,n=new URL(e,t).hostname.toLowerCase();if(n===`localhost`||n===`127.0.0.1`||n===`::1`||n===`[::1]`)return`loopback`;if(/^(10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.)/.test(n)||!n.includes(`.`)||n.endsWith(`.local`)||n.endsWith(`.lan`)||n.endsWith(`.home`)||n.endsWith(`.internal`))return`private`}catch{}}const Go={async request({url:e,method:t=`GET`,headers:n={},body:r}){r&&=await Ko(r);let i=Wo(e),a={method:t,headers:n,body:r,credentials:`omit`};i&&(a.targetAddressSpace=i);let o=await fetch(e,a),s=o.body&&typeof o.body.getReader==`function`?qo(o.body):[new Uint8Array(await o.arrayBuffer())],c={};for(let[e,t]of o.headers.entries())c[e]=t;return{url:o.url,method:t,statusCode:o.status,statusMessage:o.statusText,body:s,headers:c}}};async function Ko(e){let t=[];if(e[Symbol.asyncIterator])for await(let n of e)t.push(n);else if(e[Symbol.iterator])for(let n of e)t.push(n);else if(e.next){let n=await e.nexT();for(;!n.done;)t.push(n.value),n=await e.nexT()}else return e;let n=t.reduce((e,t)=>e+t.length,0),r=new Uint8Array(n),i=0;for(let e of t)r.set(e,i),i+=e.length;return r}function qo(e){let t=e.getReader();return{next(){return t.read()},return(){return t.releaseLock(),{}},[Symbol.asyncIterator](){return this}}}let Jo=null,Yo=null,Xo=null,Zo=null,Qo=null;function $o(e){return e.trim().replace(/^[\\/]+/,``).replace(/[\\/]+$/,``).split(/[\\/]+/).filter(e=>e!==`.`&&e!==``).join(`/`)}const es=new class{_map=/* @__PURE__ */ new Map;_maxSize;constructor(e=2048){this._maxSize=e}clear(){this._map.clear()}get(e){let t=this._map.get(e);return t!==void 0&&(this._map.delete(e),this._map.set(e,t)),t}invalidate(e){let t=e.endsWith(`/`)?e:e+`/`;for(let n of this._map.keys())(n===e||n.startsWith(t))&&this._map.delete(n)}set(e,t){if(this._map.size>=this._maxSize){let e=this._map.keys().next().value;e!==void 0&&this._map.delete(e)}this._map.set(e,t)}};async function ts(e,t,n={},r=``){let i=e,a=r;for(let e of t){a=a?`${a}/${e}`:e;let t=es.get(a);t&&!n.create?i=t:(i=await i.getDirectoryHandle(e,{create:n.create??!1}),es.set(a,i))}return i}async function ns(e,t,n={}){let r=$o(t),i=r.split(`/`).filter(Boolean);if(i.length===0)return e;let a=await ts(e,i.slice(0,-1),n),o=i[i.length-1];if(n.forceFile||o.includes(`.`))try{return await a.getFileHandle(o,{create:n.create??!1})}catch{}try{let e=await a.getDirectoryHandle(o,{create:n.create??!1}),t=r;return es.set(t,e),e}catch{return await a.getFileHandle(o,{create:n.create??!1})}}async function rs(e,t,n={}){let r=$o(t).split(`/`).filter(Boolean);return r.length===0?e:ts(e,r,n)}async function is(e,t,n={}){let r=$o(t).split(`/`).filter(Boolean);if(r.length===0)throw Error(`Cannot resolve '.' as file`);return(await ts(e,r.slice(0,-1),n)).getFileHandle(r[r.length-1],{create:n.create??!1})}async function as(e,t){let n=$o(t).split(`/`).filter(Boolean);if(n.length===0)throw Error(`Cannot get parent of root`);let r=n[n.length-1];return[await ts(e,n.slice(0,-1)),r]}function os(e){return e.trim().replace(/\\/g,`/`).replace(/^\/+/,``).replace(/^\.\//,``)}function ss(e){let t=/* @__PURE__ */ new Map,n=`repos/.git-modes`;function r(e){return e.replace(/\\/g,`/`.replace(/^\/+/,``))}async function i(){try{let r=await(await(await is(e,n)).getFile()).text(),i=JSON.parse(r);for(let[e,n]of i)t.set(e,n)}catch{}}let a=null;function o(){a===null&&(a=setTimeout(async()=>{a=null;try{let r=await(await is(e,n,{create:!0})).createWritable(),i=JSON.stringify([...t.entries()]);await r.write(new TextEncoder().encode(i)),await r.close()}catch{}},500))}let s=i(),c={async readFile(t,n){let r=await(await(await is(e,t)).getFile()).arrayBuffer(),i=typeof n==`string`?n:n?.encoding;return i===`utf8`||i===`utf-8`?new TextDecoder().decode(r):new Uint8Array(r)},async writeFile(n,i,a){let s=await(await is(e,n,{create:!0})).createWritable();typeof i==`string`&&(i=new TextEncoder().encode(i)),await s.write(i),await s.close();let c=typeof a==`object`&&a?a.mode:void 0,l=r(n);if(c!=null){let e=!!(c&73);t.set(l,e?33261:33188),o()}else t.has(l)||t.set(l,33188)},async mkdir(t){await rs(e,t,{create:!0})},async rmdir(n){let[i,a]=await as(e,n);await i.removeEntry(a,{recursive:!0});let o=r(n)+`/`;for(let e of t.keys())(e===r(n)||e.startsWith(o))&&t.delete(e);es.invalidate($o(n))},async readdir(t){let n=await rs(e,t),r=[];for await(let[e]of n.entries())r.push(e);return r},async stat(n){await s;let i;try{i=await ns(e,n)}catch{let e=/* @__PURE__ */ Error(`ENOENT: no such file or directory, stat '${n}'`);throw e.code=`ENOENT`,e}if(i.kind===`directory`){let e=/* @__PURE__ */ new Date;return{isDirectory:()=>!0,isFile:()=>!1,isSymbolicLink:()=>!1,size:0,mtimeMs:Date.now(),mode:16877,ino:0,dev:0,nlink:1,uid:0,gid:0,ctime:e,mtime:e}}{let e=await i.getFile(),a=new Date(e.lastModified),o=r(n),s=t.get(o)??33188;return{isDirectory:()=>!1,isFile:()=>!0,isSymbolicLink:()=>!1,size:e.size,mtimeMs:e.lastModified,mode:s,ino:0,dev:0,nlink:1,uid:0,gid:0,ctime:a,mtime:a}}},async lstat(e){return c.stat(e)},async unlink(n){let[i,a]=await as(e,n);await i.removeEntry(a),t.delete(r(n))},async symlink(e,t){throw Error(`OPFS does not support symlinks`)},async readlink(e){return await c.readFile(e,`utf8`)}};return{promises:c}}const cs=ss,ls=`repos`;function us(e,t,n){if(e===`custom`&&t)return t;if(e===`public`)return`https://www.cors-anywhere.com`;let a=n||(typeof globalThis<`u`&&globalThis.location?globalThis.location:typeof self<`u`&&self.location?self.location:typeof window<`u`&&window.location?window.location:null),o=a?.protocol||``,s=o===`https:`||o===`https`||typeof a?.origin==`string`&&a.origin.startsWith(`https:`)||typeof a?.href==`string`&&a.href.startsWith(`https://`)?`https:`:`http:`,c=a?.host||``,l=a?.hostname||``,u=l===`localhost`||l===`127.0.0.1`||l===`::1`||l===`[::1]`||l===`0.0.0.0`||c.startsWith(`localhost:`)||c.startsWith(`127.0.0.1:`)||c.startsWith(`[::1]:`),d=a&&(a.protocol===`file:`||l&&(l.endsWith(`.github.io`)||l.endsWith(`.pages.dev`)));return c&&(u||!d)?`${s}//${c}/git-proxy`:`${s}//${i}:${r}/git-proxy`}async function ds(){return Qo||=(async()=>{if(Jo=Uo,Yo=Go,!Xo){let e=null;if(typeof navigator<`u`&&typeof navigator.storage?.getDirectory==`function`)try{e=await navigator.storage.getDirectory()}catch(e){console.warn(`OPFS is unavailable for git root, falling back to memory:`,e)}if(!e){let{getMemoryOpfsRoot:t}=await import(`./memory-storage-BkoMlxOr.js`).then(e=>e.n);e=t()}Xo=ss(e),Zo=Xo.promises}})(),await Qo,{git:Jo,http:Yo,fs:Xo,pfs:Zo}}async function $(e){let t=await ds();if(e){let n=ss(e);return{git:t.git,http:t.http,fs:n,pfs:n.promises,repoDirFn:e=>`repos/${e}`}}return{...t,repoDirFn:ps}}function fs(e){return(e.replace(/\/+$/,``).split(`/`).pop()||`repo`).replace(/\.git$/,``)}function ps(e){return`${ls}/${e}`}async function ms(e,t,n){try{await e.getConfig({fs:t,dir:n,path:`core.filemode`})!==!1&&await e.setConfig({fs:t,dir:n,path:`core.filemode`,value:!1})}catch(e){console.error(`Failed to set core.filemode=false:`,e)}}async function hs(e,t){try{await e.mkdir(t)}catch{}}function gs({token:e,username:t,password:n}={}){if(!e&&!t)return{};let r;e?r={Authorization:`Basic ${btoa(`${e}:x-oauth-basic`)}`}:t&&(r={Authorization:`Basic ${btoa(`${t}:${n||``}`)}`});let i=()=>e?{username:e,password:`x-oauth-basic`}:t?{username:t,password:n||``}:{cancel:!0},a=()=>({cancel:!0});return{...r?{headers:r}:{},onAuth:i,onAuthFailure:a}}async function _s({url:e,branch:t,depth:n=20,corsProxy:r,name:i,token:o,username:s,password:c,groupRoot:l}){let{git:u,http:d,fs:f,pfs:p,repoDirFn:m}=await $(l),h=i||fs(e),g=m(h);!r&&!a()&&(r=us(`local`)),await hs(p,ls),await hs(p,g);let _=gs({token:o,username:s,password:c});try{let i={fs:f,http:d,dir:g,url:e,singleBranch:!0,depth:n,corsProxy:r,..._};t&&(i.ref=t),await u.clone(i)}catch{try{let i={fs:f,http:d,dir:g,url:e,singleBranch:!0,depth:n,corsProxy:r,..._};t&&(i.ref=t),await u.fetch(i)}catch{try{await Rs(p,g),await hs(p,g);let i={fs:f,http:d,dir:g,url:e,singleBranch:!0,depth:n,corsProxy:r,..._};t&&(i.ref=t),await u.clone(i)}catch(t){throw Error(`Failed to clone/fetch ${e}: ${t instanceof Error?t.message:String(t)}`)}}}return await ms(u,f,g),h}async function vs({repo:e,ref:t,groupRoot:n}){let{git:r,fs:i,repoDirFn:a}=await $(n),o=a(e);return await r.checkout({fs:i,dir:o,ref:t,force:!0}),`Checked out ${t} in ${e}`}async function ys({repo:e,name:t,checkout:n=!1,startPoint:r,groupRoot:i}){let{git:a,fs:o,repoDirFn:s}=await $(i),c=s(e),l={fs:o,dir:c,ref:t};return r&&(l.object=r),await a.branch(l),n?(await a.checkout({fs:o,dir:c,ref:t}),`Created and switched to branch ${t} in ${e}`):`Created branch ${t} in ${e}`}async function bs({repo:e,groupRoot:t}){let{git:n,fs:r,repoDirFn:i}=await $(t),a=i(e);await ms(n,r,a);let o=await n.statusMatrix({fs:r,dir:a});if(o.length===0)return`Empty repository.`;let s=[];for(let[e,t,n,r]of o){let i=``;if(t===0&&n===2&&r===2)i=`added`;else if(t===0&&n===2&&r===0)i=`new (unstaged)`;else if(t===1&&n===2&&r===2)i=`modified (staged)`;else if(t===1&&n===2&&r===1)i=`modified`;else if(t===1&&n===0&&r===0)i=`deleted`;else if(t===1&&n===1&&r===1)continue;else i=`[${t},${n},${r}]`;s.push(`${i}: ${e}`)}return s.length===0?`On branch ${await n.currentBranch({fs:r,dir:a})||`(detached HEAD)`}\nNothing to commit, working tree clean.`:`On branch ${await n.currentBranch({fs:r,dir:a})||`(detached HEAD)`}\n${s.join(`
|
|
93
|
+
`,`utf8`);let t=o[o.length-1].split(` `)[1];await i.writeStashRef(t)}else await e.rm(s)})}async function wo({fs:e,dir:t,gitdir:n}){return new vo({fs:e,dir:t,gitdir:n}).readStashReflogs({parsed:!0})}async function To({fs:e,dir:t,gitdir:n}){let r=new vo({fs:e,dir:t,gitdir:n}),i=[r.refStashPath,r.refLogsStashPath];await F(i,async()=>{await Promise.all(i.map(async t=>{if(await e.exists(t))return e.rm(t)}))})}async function Eo({fs:e,dir:t,gitdir:n,refIdx:r=0}){await So({fs:e,dir:t,gitdir:n,refIdx:r}),await Co({fs:e,dir:t,gitdir:n,refIdx:r})}async function Do({fs:e,dir:t,gitdir:n=z(t,`.git`),op:r=`push`,message:i=``,refIdx:a=0}){Y(`fs`,e),Y(`dir`,t),Y(`gitdir`,n),Y(`op`,r);let o={push:bo,apply:So,drop:Co,list:wo,clear:To,pop:Eo,create:xo},s=[`apply`,`drop`,`pop`];try{let c=new J(e),l=await X({fsp:c,dotgit:n});[`refs`,`logs`,`logs/refs`].map(e=>z(l,e)).forEach(async e=>{await c.exists(e)||await c.mkdir(e)});let u=o[r];if(u){if(s.includes(r)&&a<0)throw new ze(`stash@${a}`,`number that is in range of [0, num of stash pushed]`);return await u({fs:c,dir:t,gitdir:l,message:i,refIdx:a})}throw Error(`To be implemented: ${r}`)}catch(e){throw e.caller=`git.stash`,e}}async function Oo({fs:e,dir:t,gitdir:n=z(t,`.git`),filepath:r,cache:i={},refresh:a=!0}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`filepath`,r);let o=new J(e),s=await X({fsp:o,dotgit:n}),c=await ko({fs:o,cache:i,gitdir:s,tree:await Ao({fs:o,cache:i,gitdir:s}),path:r}),l=await I.acquire({fs:o,gitdir:s,cache:i},async function(e){for(let t of e)if(t.path===r)return t;return null});if(c===null&&l===null&&await Qn.isIgnored({fs:o,gitdir:s,dir:t,filepath:r}))return`ignored`;let u=await o.lstat(z(t,r)),d=c!==null,f=l!==null,p=u!==null,m=async()=>{if(f&&!we(l,u))return l.oid;{let e=await(await B.get({fs:o,gitdir:s})).get(`core.autocrlf`),n=await o.read(z(t,r),{autocrlf:e}),c=await fo({gitdir:s,type:`blob`,object:n});return a&&f&&l.oid===c&&u.size!==-1&&I.acquire({fs:o,gitdir:s,cache:i},async function(e){e.insert({filepath:r,stats:u,oid:c})}),c}};if(!d&&!p&&!f)return`absent`;if(!d&&!p&&f)return`*absent`;if(!d&&p&&!f)return`*added`;if(!d&&p&&f)return await m()===l.oid?`added`:`*added`;if(d&&!p&&!f)return`deleted`;if(d&&!p&&f)return l.oid,`*deleted`;if(d&&p&&!f)return await m()===c?`*undeleted`:`*undeletemodified`;if(d&&p&&f){let e=await m();return e===c?e===l.oid?`unmodified`:`*unmodified`:e===l.oid?`modified`:`*modified`}}catch(e){throw e.caller=`git.status`,e}}async function ko({fs:e,cache:t,gitdir:n,tree:r,path:i}){typeof i==`string`&&(i=i.split(`/`));let a=i.shift();for(let o of r)if(o.path===a){if(i.length===0)return o.oid;let{type:r,object:a}=await U({fs:e,cache:t,gitdir:n,oid:o.oid});if(r===`tree`)return ko({fs:e,cache:t,gitdir:n,tree:H.from(a),path:i});if(r===`blob`)throw new R(o.oid,r,`blob`,i.join(`/`))}return null}async function Ao({fs:e,cache:t,gitdir:n}){let r;try{r=await V.resolve({fs:e,gitdir:n,ref:`HEAD`})}catch(e){if(e instanceof L)return[]}let{tree:i}=await Sr({fs:e,cache:t,gitdir:n,oid:r});return i}async function jo({fs:e,dir:t,gitdir:n=z(t,`.git`),ref:r=`HEAD`,filepaths:i=[`.`],filter:a,cache:o={},ignored:s=!1,refresh:c=!0}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`ref`,r);let l=new J(e);return await Bn({fs:l,cache:o,dir:t,gitdir:await X({fsp:l,dotgit:n}),trees:[q({ref:r}),Fn({refresh:c}),Le()],map:async function(e,[n,r,o]){if(!n&&!o&&r&&!s&&await Qn.isIgnored({fs:l,dir:t,filepath:e})||!i.some(t=>Nr(e,t)))return null;if(a&&!a(e))return;let[c,u,d]=await Promise.all([n&&n.type(),r&&r.type(),o&&o.type()]),f=[c,u,d].includes(`blob`);if((c===`tree`||c===`special`)&&!f)return;if(c===`commit`)return null;if((u===`tree`||u===`special`)&&!f)return;if(d===`commit`)return null;if((d===`tree`||d===`special`)&&!f)return;let p=c===`blob`?await n.oid():void 0,m=d===`blob`?await o.oid():void 0,h;c!==`blob`&&u===`blob`&&d!==`blob`?h=`42`:u===`blob`&&(h=await r.oid());let g=[void 0,p,h,m],_=g.map(e=>g.indexOf(e));return _.shift(),[e,..._]}})}catch(e){throw e.caller=`git.statusMatrix`,e}}async function Mo({fs:e,dir:t,gitdir:n=z(t,`.git`),ref:r,object:i,force:a=!1}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`ref`,r);let t=new J(e);if(r===void 0)throw new G(`ref`);r=r.startsWith(`refs/tags/`)?r:`refs/tags/${r}`;let o=await X({fsp:t,dotgit:n}),s=await V.resolve({fs:t,gitdir:o,ref:i||`HEAD`});if(!a&&await V.exists({fs:t,gitdir:o,ref:r}))throw new qt(`tag`,r);await V.writeRef({fs:t,gitdir:o,ref:r,value:s})}catch(e){throw e.caller=`git.tag`,e}}async function No({fs:e,dir:t,gitdir:n=z(t,`.git`),cache:r={},filepath:i,oid:a,mode:o,add:s,remove:c,force:l}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`filepath`,i);let u=new J(e),d=await X({fsp:u,dotgit:n});if(c)return await I.acquire({fs:u,gitdir:d,cache:r},async function(e){if(!l){let e=await u.lstat(z(t,i));if(e){if(e.isDirectory())throw new on(`directory`);return}}e.has({filepath:i})&&e.delete({filepath:i})});let f;if(!a){if(f=await u.lstat(z(t,i)),!f)throw new L(`file at "${i}" on disk and "remove" not set`);if(f.isDirectory())throw new on(`directory`)}return await I.acquire({fs:u,gitdir:d,cache:r},async function(e){if(!s&&!e.has({filepath:i}))throw new L(`file at "${i}" in index and "add" not set`);let n;if(a)n={ctime:/* @__PURE__ */ new Date(0),mtime:/* @__PURE__ */ new Date(0),dev:0,ino:0,mode:o,uid:0,gid:0,size:0};else{n=f;let e=n.isSymbolicLink()?await u.readlink(z(t,i)):await u.read(z(t,i));a=await Z({fs:u,gitdir:d,type:`blob`,format:`content`,object:e})}return e.insert({filepath:i,oid:a,stats:n}),a})}catch(e){throw e.caller=`git.updateIndex`,e}}function Po(){try{return Ti.version}catch(e){throw e.caller=`git.version`,e}}async function Fo({fs:e,dir:t,gitdir:n=z(t,`.git`),trees:r,map:i,reduce:a,iterate:o,cache:s={}}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`trees`,r);let c=new J(e);return await Bn({fs:c,cache:s,dir:t,gitdir:await X({fsp:c,dotgit:n}),trees:r,map:i,reduce:a,iterate:o})}catch(e){throw e.caller=`git.walk`,e}}async function Io({fs:e,dir:t,gitdir:n=z(t,`.git`),blob:r}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`blob`,r);let t=new J(e);return await Z({fs:t,gitdir:await X({fsp:t,dotgit:n}),type:`blob`,object:r,format:`content`})}catch(e){throw e.caller=`git.writeBlob`,e}}async function Lo({fs:e,dir:t,gitdir:n=z(t,`.git`),commit:r}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`commit`,r);let t=new J(e);return await go({fs:t,gitdir:await X({fsp:t,dotgit:n}),commit:r})}catch(e){throw e.caller=`git.writeCommit`,e}}async function Ro({fs:e,dir:t,gitdir:n=z(t,`.git`),type:r,object:i,format:a=`parsed`,oid:o,encoding:s=void 0}){try{let t=new J(e),c=await X({fsp:t,dotgit:n});if(a===`parsed`){switch(r){case`commit`:i=jn.from(i).toObject();break;case`tree`:i=H.from(i).toObject();break;case`blob`:i=D.Buffer.from(i,s);break;case`tag`:i=K.from(i).toObject();break;default:throw new R(o||``,r,`blob|commit|tag|tree`)}a=`content`}return o=await Z({fs:t,gitdir:c,type:r,object:i,oid:o,format:a}),o}catch(e){throw e.caller=`git.writeObject`,e}}async function zo({fs:e,dir:t,gitdir:n=z(t,`.git`),ref:r,value:i,force:a=!1,symbolic:o=!1}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`ref`,r),Y(`value`,i);let t=new J(e);if(!Ke(r,!0))throw new ze(r,A.default.clean(r));let s=await X({fsp:t,dotgit:n});if(!a&&await V.exists({fs:t,gitdir:s,ref:r}))throw new qt(`ref`,r);o?await V.writeSymbolicRef({fs:t,gitdir:s,ref:r,value:i}):(i=await V.resolve({fs:t,gitdir:s,ref:i}),await V.writeRef({fs:t,gitdir:s,ref:r,value:i}))}catch(e){throw e.caller=`git.writeRef`,e}}async function Bo({fs:e,gitdir:t,tag:n}){return await Z({fs:e,gitdir:t,type:`tag`,object:K.from(n).toObject(),format:`content`})}async function Vo({fs:e,dir:t,gitdir:n=z(t,`.git`),tag:r}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`tag`,r);let t=new J(e);return await Bo({fs:t,gitdir:await X({fsp:t,dotgit:n}),tag:r})}catch(e){throw e.caller=`git.writeTag`,e}}async function Ho({fs:e,dir:t,gitdir:n=z(t,`.git`),tree:r}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`tree`,r);let t=new J(e);return await Cr({fs:t,gitdir:await X({fsp:t,dotgit:n}),tree:r})}catch(e){throw e.caller=`git.writeTree`,e}}var Uo={Errors:bn,STAGE:Le,TREE:q,WORKDIR:Fn,add:ar,abortMerge:Zn,addNote:Tr,addRemote:Dr,annotatedTag:kr,branch:jr,cherryPick:Zr,checkout:zr,clone:Fi,commit:Ii,getConfig:ia,getConfigAll:oa,setConfig:ho,currentBranch:Li,deleteBranch:zi,deleteRef:Bi,deleteRemote:Hi,deleteTag:Wi,expandOid:Ji,expandRef:Yi,fastForward:$i,fetch:ea,findMergeBase:ta,findRoot:ra,getRemoteInfo:ca,getRemoteInfo2:ua,hashBlob:fa,indexPack:ma,init:ha,isDescendent:_a,isIgnored:va,listBranches:ya,listFiles:Sa,listNotes:wa,listRefs:Ta,listRemotes:Da,listServerRefs:Aa,listTags:ja,log:La,merge:Ra,packObjects:Ha,pull:Ua,push:Ya,readBlob:Qa,readCommit:$a,readNote:to,readObject:no,readTag:io,readTree:ao,remove:oo,removeNote:co,renameBranch:uo,resetIndex:po,updateIndex:No,resolveRef:mo,status:Oo,statusMatrix:jo,tag:Mo,version:Po,walk:Fo,writeBlob:Io,writeCommit:Lo,writeObject:Ro,writeRef:zo,writeTag:Vo,writeTree:Ho,stash:Do};globalThis.Buffer||(globalThis.Buffer=D.Buffer);function Wo(e){try{let t=typeof location<`u`&&location.origin?location.origin:typeof globalThis<`u`&&globalThis.location?.origin?globalThis.location.origin:`http://127.0.0.1:8888`,n=new URL(e,t).hostname.toLowerCase();if(n===`localhost`||n===`127.0.0.1`||n===`::1`||n===`[::1]`)return`loopback`;if(/^(10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.)/.test(n)||!n.includes(`.`)||n.endsWith(`.local`)||n.endsWith(`.lan`)||n.endsWith(`.home`)||n.endsWith(`.internal`))return`private`}catch{}}const Go={async request({url:e,method:t=`GET`,headers:n={},body:r}){r&&=await Ko(r);let i=Wo(e),a={method:t,headers:n,body:r,credentials:`omit`};i&&(a.targetAddressSpace=i);let o=await fetch(e,a),s=o.body&&typeof o.body.getReader==`function`?qo(o.body):[new Uint8Array(await o.arrayBuffer())],c={};for(let[e,t]of o.headers.entries())c[e]=t;return{url:o.url,method:t,statusCode:o.status,statusMessage:o.statusText,body:s,headers:c}}};async function Ko(e){let t=[];if(e[Symbol.asyncIterator])for await(let n of e)t.push(n);else if(e[Symbol.iterator])for(let n of e)t.push(n);else if(e.next){let n=await e.nexT();for(;!n.done;)t.push(n.value),n=await e.nexT()}else return e;let n=t.reduce((e,t)=>e+t.length,0),r=new Uint8Array(n),i=0;for(let e of t)r.set(e,i),i+=e.length;return r}function qo(e){let t=e.getReader();return{next(){return t.read()},return(){return t.releaseLock(),{}},[Symbol.asyncIterator](){return this}}}let Jo=null,Yo=null,Xo=null,Zo=null,Qo=null;function $o(e){return e.trim().replace(/^[\\/]+/,``).replace(/[\\/]+$/,``).split(/[\\/]+/).filter(e=>e!==`.`&&e!==``).join(`/`)}const es=new class{_map=/* @__PURE__ */ new Map;_maxSize;constructor(e=2048){this._maxSize=e}clear(){this._map.clear()}get(e){let t=this._map.get(e);return t!==void 0&&(this._map.delete(e),this._map.set(e,t)),t}invalidate(e){let t=e.endsWith(`/`)?e:e+`/`;for(let n of this._map.keys())(n===e||n.startsWith(t))&&this._map.delete(n)}set(e,t){if(this._map.size>=this._maxSize){let e=this._map.keys().next().value;e!==void 0&&this._map.delete(e)}this._map.set(e,t)}};async function ts(e,t,n={},r=``){let i=e,a=r;for(let e of t){a=a?`${a}/${e}`:e;let t=es.get(a);t&&!n.create?i=t:(i=await i.getDirectoryHandle(e,{create:n.create??!1}),es.set(a,i))}return i}async function ns(e,t,n={}){let r=$o(t),i=r.split(`/`).filter(Boolean);if(i.length===0)return e;let a=await ts(e,i.slice(0,-1),n),o=i[i.length-1];if(n.forceFile||o.includes(`.`))try{return await a.getFileHandle(o,{create:n.create??!1})}catch{}try{let e=await a.getDirectoryHandle(o,{create:n.create??!1}),t=r;return es.set(t,e),e}catch{return await a.getFileHandle(o,{create:n.create??!1})}}async function rs(e,t,n={}){let r=$o(t).split(`/`).filter(Boolean);return r.length===0?e:ts(e,r,n)}async function is(e,t,n={}){let r=$o(t).split(`/`).filter(Boolean);if(r.length===0)throw Error(`Cannot resolve '.' as file`);return(await ts(e,r.slice(0,-1),n)).getFileHandle(r[r.length-1],{create:n.create??!1})}async function as(e,t){let n=$o(t).split(`/`).filter(Boolean);if(n.length===0)throw Error(`Cannot get parent of root`);let r=n[n.length-1];return[await ts(e,n.slice(0,-1)),r]}function os(e){return e.trim().replace(/\\/g,`/`).replace(/^\/+/,``).replace(/^\.\//,``)}function ss(e){let t=/* @__PURE__ */ new Map,n=`repos/.git-modes`;function r(e){return e.replace(/\\/g,`/`.replace(/^\/+/,``))}async function i(){try{let r=await(await(await is(e,n)).getFile()).text(),i=JSON.parse(r);for(let[e,n]of i)t.set(e,n)}catch{}}let a=null;function o(){a===null&&(a=setTimeout(async()=>{a=null;try{let r=await(await is(e,n,{create:!0})).createWritable(),i=JSON.stringify([...t.entries()]);await r.write(new TextEncoder().encode(i)),await r.close()}catch{}},500))}let s=i(),c={async readFile(t,n){let r=await(await(await is(e,t)).getFile()).arrayBuffer(),i=typeof n==`string`?n:n?.encoding;return i===`utf8`||i===`utf-8`?new TextDecoder().decode(r):new Uint8Array(r)},async writeFile(n,i,a){let s=await(await is(e,n,{create:!0})).createWritable();typeof i==`string`&&(i=new TextEncoder().encode(i)),await s.write(i),await s.close();let c=typeof a==`object`&&a?a.mode:void 0,l=r(n);if(c!=null){let e=!!(c&73);t.set(l,e?33261:33188),o()}else t.has(l)||t.set(l,33188)},async mkdir(t){await rs(e,t,{create:!0})},async rmdir(n){let[i,a]=await as(e,n);await i.removeEntry(a,{recursive:!0});let o=r(n)+`/`;for(let e of t.keys())(e===r(n)||e.startsWith(o))&&t.delete(e);es.invalidate($o(n))},async readdir(t){let n=await rs(e,t),r=[];for await(let[e]of n.entries())r.push(e);return r},async stat(n){await s;let i;try{i=await ns(e,n)}catch{let e=/* @__PURE__ */ Error(`ENOENT: no such file or directory, stat '${n}'`);throw e.code=`ENOENT`,e}if(i.kind===`directory`){let e=/* @__PURE__ */ new Date;return{isDirectory:()=>!0,isFile:()=>!1,isSymbolicLink:()=>!1,size:0,mtimeMs:Date.now(),mode:16877,ino:0,dev:0,nlink:1,uid:0,gid:0,ctime:e,mtime:e}}{let e=await i.getFile(),a=new Date(e.lastModified),o=r(n),s=t.get(o)??33188;return{isDirectory:()=>!1,isFile:()=>!0,isSymbolicLink:()=>!1,size:e.size,mtimeMs:e.lastModified,mode:s,ino:0,dev:0,nlink:1,uid:0,gid:0,ctime:a,mtime:a}}},async lstat(e){return c.stat(e)},async unlink(n){let[i,a]=await as(e,n);await i.removeEntry(a),t.delete(r(n))},async symlink(e,t){throw Error(`OPFS does not support symlinks`)},async readlink(e){return await c.readFile(e,`utf8`)}};return{promises:c}}const cs=ss,ls=`repos`;function us(e,t,n){if(e===`custom`&&t)return t;if(e===`public`)return`https://www.cors-anywhere.com`;let a=n||(typeof globalThis<`u`&&globalThis.location?globalThis.location:typeof self<`u`&&self.location?self.location:typeof window<`u`&&window.location?window.location:null),o=a?.protocol||``,s=o===`https:`||o===`https`||typeof a?.origin==`string`&&a.origin.startsWith(`https:`)||typeof a?.href==`string`&&a.href.startsWith(`https://`)?`https:`:`http:`,c=a?.host||``,l=a?.hostname||``,u=l===`localhost`||l===`127.0.0.1`||l===`::1`||l===`[::1]`||l===`0.0.0.0`||c.startsWith(`localhost:`)||c.startsWith(`127.0.0.1:`)||c.startsWith(`[::1]:`),d=a&&(a.protocol===`file:`||l&&(l.endsWith(`.github.io`)||l.endsWith(`.pages.dev`)));return c&&(u||!d)?`${s}//${c}/git-proxy`:`${s}//${i}:${r}/git-proxy`}async function ds(){return Qo||=(async()=>{if(Jo=Uo,Yo=Go,!Xo){let e=null;if(typeof navigator<`u`&&typeof navigator.storage?.getDirectory==`function`)try{e=await navigator.storage.getDirectory()}catch(e){console.warn(`OPFS is unavailable for git root, falling back to memory:`,e)}if(!e){let{getMemoryOpfsRoot:t}=await import(`./memory-storage-2m7KZ-aP.js`).then(e=>e.n);e=t()}Xo=ss(e),Zo=Xo.promises}})(),await Qo,{git:Jo,http:Yo,fs:Xo,pfs:Zo}}async function $(e){let t=await ds();if(e){let n=ss(e);return{git:t.git,http:t.http,fs:n,pfs:n.promises,repoDirFn:e=>`repos/${e}`}}return{...t,repoDirFn:ps}}function fs(e){return(e.replace(/\/+$/,``).split(`/`).pop()||`repo`).replace(/\.git$/,``)}function ps(e){return`${ls}/${e}`}async function ms(e,t,n){try{await e.getConfig({fs:t,dir:n,path:`core.filemode`})!==!1&&await e.setConfig({fs:t,dir:n,path:`core.filemode`,value:!1})}catch(e){console.error(`Failed to set core.filemode=false:`,e)}}async function hs(e,t){try{await e.mkdir(t)}catch{}}function gs({token:e,username:t,password:n}={}){if(!e&&!t)return{};let r;e?r={Authorization:`Basic ${btoa(`${e}:x-oauth-basic`)}`}:t&&(r={Authorization:`Basic ${btoa(`${t}:${n||``}`)}`});let i=()=>e?{username:e,password:`x-oauth-basic`}:t?{username:t,password:n||``}:{cancel:!0},a=()=>({cancel:!0});return{...r?{headers:r}:{},onAuth:i,onAuthFailure:a}}async function _s({url:e,branch:t,depth:n=20,corsProxy:r,name:i,token:o,username:s,password:c,groupRoot:l}){let{git:u,http:d,fs:f,pfs:p,repoDirFn:m}=await $(l),h=i||fs(e),g=m(h);!r&&!a()&&(r=us(`local`)),await hs(p,ls),await hs(p,g);let _=gs({token:o,username:s,password:c});try{let i={fs:f,http:d,dir:g,url:e,singleBranch:!0,depth:n,corsProxy:r,..._};t&&(i.ref=t),await u.clone(i)}catch{try{let i={fs:f,http:d,dir:g,url:e,singleBranch:!0,depth:n,corsProxy:r,..._};t&&(i.ref=t),await u.fetch(i)}catch{try{await Rs(p,g),await hs(p,g);let i={fs:f,http:d,dir:g,url:e,singleBranch:!0,depth:n,corsProxy:r,..._};t&&(i.ref=t),await u.clone(i)}catch(t){throw Error(`Failed to clone/fetch ${e}: ${t instanceof Error?t.message:String(t)}`)}}}return await ms(u,f,g),h}async function vs({repo:e,ref:t,groupRoot:n}){let{git:r,fs:i,repoDirFn:a}=await $(n),o=a(e);return await r.checkout({fs:i,dir:o,ref:t,force:!0}),`Checked out ${t} in ${e}`}async function ys({repo:e,name:t,checkout:n=!1,startPoint:r,groupRoot:i}){let{git:a,fs:o,repoDirFn:s}=await $(i),c=s(e),l={fs:o,dir:c,ref:t};return r&&(l.object=r),await a.branch(l),n?(await a.checkout({fs:o,dir:c,ref:t}),`Created and switched to branch ${t} in ${e}`):`Created branch ${t} in ${e}`}async function bs({repo:e,groupRoot:t}){let{git:n,fs:r,repoDirFn:i}=await $(t),a=i(e);await ms(n,r,a);let o=await n.statusMatrix({fs:r,dir:a});if(o.length===0)return`Empty repository.`;let s=[];for(let[e,t,n,r]of o){let i=``;if(t===0&&n===2&&r===2)i=`added`;else if(t===0&&n===2&&r===0)i=`new (unstaged)`;else if(t===1&&n===2&&r===2)i=`modified (staged)`;else if(t===1&&n===2&&r===1)i=`modified`;else if(t===1&&n===0&&r===0)i=`deleted`;else if(t===1&&n===1&&r===1)continue;else i=`[${t},${n},${r}]`;s.push(`${i}: ${e}`)}return s.length===0?`On branch ${await n.currentBranch({fs:r,dir:a})||`(detached HEAD)`}\nNothing to commit, working tree clean.`:`On branch ${await n.currentBranch({fs:r,dir:a})||`(detached HEAD)`}\n${s.join(`
|
|
94
94
|
`)}`}async function xs({repo:e,ref:t,depth:n=10,groupRoot:r}){let{git:i,fs:a,repoDirFn:o}=await $(r),s={fs:a,dir:o(e),depth:n};t&&(s.ref=t);let c=await i.log(s);return c.length===0?`No commits found.`:c.map(e=>{let t=e.commit,n=(/* @__PURE__ */ new Date(t.author.timestamp*1e3)).toISOString();return`${e.oid} ${n} ${t.author.name} — ${t.message.trim().split(`
|
|
95
95
|
`)[0]}`}).join(`
|
|
96
96
|
`)}async function Ss({repo:e,ref1:t,ref2:n,groupRoot:r}){let{git:i,fs:a,repoDirFn:o}=await $(r),s=o(e),c=a.promises;if(await ms(i,a,s),!t&&!n){let e=(await i.statusMatrix({fs:a,dir:s})).filter(([,e,t])=>e!==1||t!==1);if(e.length===0)return`No differences.`;let t=[];for(let[n,r,o]of e)try{if(r===0&&o===2){let e=(await ws(c,s,n)).split(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{z as e}from"./config-C16fFWtP.js";import{r as t}from"./orchestrator-Li1UAsv7.js";const n=[`pages/resources/`,`pages/deps/`,`resources/`,`deps/`,`pages/assets/`,`pages/main/assets/`];function r(e){for(let t of n)if(e.startsWith(t))return e.slice(t.length).replace(/^\/+/,``);return e.replace(/^\/+/,``)}function i(n){let i=n;!i&&typeof document<`u`&&(i=t());let a;if(typeof document<`u`){let e=`shadow-claw-theme`;if(i&&typeof i==`object`){let t=i.theme?.styleElement;typeof t==`string`&&t.trim()&&(e=t.trim())}let t=document.getElementById(e)||document.querySelector(`style[data-shadow-claw-theme]`);t?.textContent&&(a=t.textContent)}let o;if(i&&typeof i==`object`){let e=i.theme;typeof e?.stylesheet==`string`&&e.stylesheet.trim()&&(o=e.stylesheet.trim())}let s=``;if(a&&(s+=`<style data-theme-style="true">${a}</style>`),!o)return s;if(o.startsWith(`http://`)||o.startsWith(`https://`)||o.startsWith(`//`))return`${s}<link rel="stylesheet" href="${o}">`;let c=r(o).replace(/^\/+/,``);return`${s}<link rel="stylesheet" href="${e(`/${c}`)}">`}function a(){let e=typeof document<`u`&&document.documentElement.classList.contains(`dark-mode`),t=[];if(typeof document<`u`){let e=getComputedStyle(document.documentElement);for(let n=0;n<e.length;n++){let r=e[n];r.startsWith(`--`)&&t.push(`${r}: ${e.getPropertyValue(r)};`)}}return[`<style>`,` :root {`,` color-scheme: ${e?`dark`:`light`};`,` overflow: hidden;`,` line-height: 1.5;`,` ${t.join(`
|
|
2
2
|
`)}`,` }`,` * {`,` scrollbar-width: thin;`,` scrollbar-color: var(--shadow-claw-border-color) transparent;`,` }`,` ::-webkit-scrollbar {`,` height: 0.5rem;`,` width: 0.5rem;`,` }`,` ::-webkit-scrollbar-track {`,` background: transparent;`,` }`,` ::-webkit-scrollbar-thumb {`,` background: var(--shadow-claw-border-color);`,` border-radius: 0.25rem;`,` }`,` ::-webkit-scrollbar-thumb:hover {`,` background: var(--shadow-claw-text-tertiary);`,` }`,` body {`,` color: var(--shadow-claw-text-primary);`,` background-color: var(--shadow-claw-bg-primary);`,` font-family: var(--shadow-claw-font-sans);`,` margin: 0;`,` }`,` pre, code, kbd, samp {`,` font-family: var(--shadow-claw-font-mono);`,` }`,` a {`,` color: var(--shadow-claw-link);`,` text-decoration: underline;`,` text-underline-offset: 0.125rem;`,` }`,` a:hover {`,` color: var(--shadow-claw-link-hover);`,` }`,` img {`,` max-width: 100%;`,` height: auto;`,` }`,` ul {`,` line-height: 1.5;`,` }`,` article {`,` padding: 1rem 1.5rem 1rem 1rem;`,` }`,` article > h1, article > h2 {`,` margin-top: 0;`,` }`,`</style>`].join(`
|
|
3
3
|
`)}function o(){return typeof document<`u`&&document.documentElement.classList.contains(`dark-mode`)?`dark-mode`:`light-mode`}var s=class{getTargetWindow;commandChannels=/* @__PURE__ */ new Map;originalBroadcastChannel=null;constructor(e){this.getTargetWindow=e,typeof BroadcastChannel<`u`&&this.patchParentBroadcastChannel()}patchParentBroadcastChannel(){if(globalThis._shadowClawParentBcPatched)return;globalThis._shadowClawParentBcPatched=!0;let e=this,t=globalThis.BroadcastChannel;this.originalBroadcastChannel=t;let n=function(n){let r=new t(n);return e.registerChannel(n),r};n.prototype=t.prototype,globalThis.BroadcastChannel=n}registerChannelsFromTools(e){if(!Array.isArray(e))return;let t=/new\s+BroadcastChannel\s*\(\s*['"`]([^'"`]+)['"`]\s*\)/g;for(let n of e){let e=n.execution?.code||n.code||``;if(!e)continue;let r;for(t.lastIndex=0;(r=t.exec(e))!==null;)r[1]&&this.registerChannel(r[1])}}registerChannel(e){typeof BroadcastChannel>`u`||!e||e.endsWith(`-results`)||this.commandChannels.has(e)||this.listenOnCommandChannel(e)}listenOnCommandChannel(e){try{let t=new(this.originalBroadcastChannel||globalThis.BroadcastChannel)(e);t.onmessage=t=>{let n=this.getTargetWindow();n&&n.postMessage({type:`shadow-claw-broadcast-command`,channel:e,payload:t.data},`*`)},this.commandChannels.set(e,t)}catch(t){console.warn(`[IframeBroadcastProxy] Failed to listen on channel ${e}:`,t)}}handleResultFromIframe(e,t,n){let r=this.getTargetWindow();if(r&&e!==r)return!1;if(t)try{let e=new(this.originalBroadcastChannel||globalThis.BroadcastChannel)(t);return e.postMessage(n),e.close(),!0}catch(e){console.warn(`[IframeBroadcastProxy] Failed to relay result for channel ${t}:`,e)}return!1}dispose(){for(let e of this.commandChannels.values())try{e.close()}catch{}this.commandChannels.clear()}};let c=null;function l(){return c||(c=new Promise((e,t)=>{let n=indexedDB.open(`shadow-claw-iframe-storage`,1);n.onupgradeneeded=()=>{let e=n.result;e.objectStoreNames.contains(`kv`)||e.createObjectStore(`kv`)},n.onsuccess=()=>e(n.result),n.onerror=()=>{c=null,t(n.error)}}),c)}function u(e,t){return`${e}\0${t}`}async function d(e,t,n){let r=await l();return new Promise((i,a)=>{let o=r.transaction(`kv`,`readwrite`);o.objectStore(`kv`).put(n,u(e,t)),o.oncomplete=()=>i(),o.onerror=()=>a(o.error)})}async function f(e,t){let n=await l();return new Promise((r,i)=>{let a=n.transaction(`kv`,`readonly`).objectStore(`kv`).get(u(e,t));a.onsuccess=()=>r(a.result),a.onerror=()=>i(a.error)})}async function p(e){let t=await l();return new Promise((n,r)=>{let i=t.transaction(`kv`,`readonly`).objectStore(`kv`),a={},o=`${e}\0`,s=i.openCursor();s.onsuccess=()=>{let e=s.result;if(!e){n(a);return}let t=typeof e.key==`string`?e.key:String(e.key);t.startsWith(o)&&(a[t.slice(o.length)]=e.value),e.continue()},s.onerror=()=>r(s.error)})}async function m(e,t){let n=await l();return new Promise((r,i)=>{let a=n.transaction(`kv`,`readwrite`);a.objectStore(`kv`).delete(u(e,t)),a.oncomplete=()=>r(),a.onerror=()=>i(a.error)})}async function h(e){let t=await l();return new Promise((n,r)=>{let i=t.transaction(`kv`,`readwrite`).objectStore(`kv`),a=`${e}\0`,o=i.openCursor();o.onsuccess=()=>{let e=o.result;e?((typeof e.key==`string`?e.key:String(e.key)).startsWith(a)&&e.delete(),e.continue()):n()},o.onerror=()=>r(o.error)})}const g=`/**
|
|
4
4
|
* iframe-storage-bridge.js
|