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
|
@@ -5,6 +5,8 @@ export declare const MAX_NATIVE_AUDIO_BYTES: number;
|
|
|
5
5
|
export declare const MAX_NATIVE_DOCUMENT_BYTES: number;
|
|
6
6
|
export interface BuildAttachmentContentBlocksOptions {
|
|
7
7
|
maxInlineTextBytes?: number;
|
|
8
|
+
/** Max image size in bytes for inline base64 encoding (default: MAX_NATIVE_IMAGE_BYTES = 3 MB). */
|
|
9
|
+
maxImageBytes?: number;
|
|
8
10
|
}
|
|
9
11
|
/**
|
|
10
12
|
* Converts stored message attachments into model-ready ContentBlocks.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as getConfig } from "./get-config-BWhs5HFF.js";
|
|
2
|
-
import { L as getProviderTokenAuthScheme, r as CONFIG_KEYS } from "./config-
|
|
2
|
+
import { L as getProviderTokenAuthScheme, r as CONFIG_KEYS } from "./config-BrHR97zt.js";
|
|
3
3
|
import { t as setConfig } from "./set-config-CUadvYZ1.js";
|
|
4
4
|
import { n as decryptValue, r as encryptValue } from "./crypto-Bikgpqfe.js";
|
|
5
5
|
|
|
@@ -275,4 +275,4 @@ async function resolveFromLegacy(db) {
|
|
|
275
275
|
|
|
276
276
|
//#endregion
|
|
277
277
|
export { resolveStoredCredentialAuthMode as i, detectProvider as n, resolveGitCredentials as r, buildAuthHeaders as t };
|
|
278
|
-
//# sourceMappingURL=credentials-
|
|
278
|
+
//# sourceMappingURL=credentials-CZbngHXW.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials-5vpz0XPk.js","names":[],"sources":["../../src/subsystems/accounts/stored-credentials.ts","../../src/subsystems/git/credentials.ts"],"sourcesContent":["export type StoredCredentialAuthMode = \"token\" | \"basic\" | \"oauth\";\n\nexport interface StoredCredentialBase {\n id: string;\n label: string;\n hostPattern: string;\n token: string;\n basicUsername?: string;\n authMode?: StoredCredentialAuthMode;\n}\n\nexport interface StoredCredentialOAuthFields {\n oauthProviderId?: string;\n oauthClientId?: string;\n oauthClientSecret?: string;\n accessTokenExpiresAt?: number;\n refreshToken?: string;\n scopes?: string[];\n tokenType?: string;\n oauthRefreshFailureCount?: number;\n oauthReauthRequired?: boolean;\n oauthReauthRequiredAt?: number;\n /** Custom authorize URL (used when oauthProviderId is \"custom_mcp\"). */\n oauthCustomAuthorizeUrl?: string;\n /** Custom token URL (used when oauthProviderId is \"custom_mcp\"). */\n oauthCustomTokenUrl?: string;\n /** Custom PKCE preference (used when oauthProviderId is \"custom_mcp\"). */\n oauthCustomUsePkce?: boolean;\n /** Custom redirect URI (used when oauthProviderId is \"custom_mcp\"). */\n oauthCustomRedirectUri?: string;\n}\n\nexport interface PendingOAuthResult {\n providerId: string;\n accessToken: string;\n refreshToken?: string;\n expiresAt?: number;\n scope?: string;\n tokenType?: string;\n}\n\ntype OAuthCapableStoredCredential = {\n authMode?: StoredCredentialAuthMode;\n} & StoredCredentialOAuthFields;\n\nexport function resolveStoredCredentialAuthMode(\n credential: OAuthCapableStoredCredential | null | undefined,\n): StoredCredentialAuthMode {\n if (!credential) {\n return \"token\";\n }\n\n // Treat legacy \"pat\" string identically to \"token\" mode\n if (\n credential.authMode === \"token\" ||\n (credential.authMode as string) === \"pat\"\n ) {\n return \"token\";\n }\n\n if (credential.authMode === \"basic\") {\n return \"basic\";\n }\n\n if (credential.authMode === \"oauth\") {\n return \"oauth\";\n }\n\n if (\n credential.oauthProviderId ||\n credential.oauthClientId ||\n credential.oauthClientSecret ||\n credential.refreshToken ||\n credential.accessTokenExpiresAt ||\n credential.tokenType ||\n credential.oauthReauthRequired\n ) {\n return \"oauth\";\n }\n\n return \"token\";\n}\n","import {\n CONFIG_KEYS,\n getProviderTokenAuthScheme,\n} from \"../../config/config.js\";\n\nimport { resolveStoredCredentialAuthMode } from \"../accounts/stored-credentials.js\";\nimport { decryptValue, encryptValue } from \"../../security/crypto.js\";\n\nimport { getConfig } from \"../../db/get-config.js\";\nimport { setConfig } from \"../../db/set-config.js\";\n\nimport type {\n GitAccount,\n GitAuthMode,\n GitProvider,\n ResolveGitCredentialsOptions,\n ResolvedGitCredentials,\n} from \"./types.js\";\nimport type { ShadowClawDatabase } from \"../../db/types.js\";\n\nconst OAUTH_REFRESH_WINDOW_MS = 60_000;\nconst OAUTH_REFRESH_FAILURE_THRESHOLD = 3;\n\nfunction resolveGitAuthMode(account: GitAccount): GitAuthMode {\n return resolveStoredCredentialAuthMode(account);\n}\n\nfunction mapGitProviderToGeneralProviderId(provider: GitProvider): string {\n switch (provider) {\n case \"azure-devops\":\n return \"azure_devops\";\n default:\n return provider;\n }\n}\n\n/**\n * Detect the git provider type from a hostname or host pattern.\n */\nexport function detectProvider(hostPattern: string): GitProvider {\n if (!hostPattern) {\n return \"generic\";\n }\n\n const lower = hostPattern.toLowerCase();\n if (lower.includes(\"github\")) {\n return \"github\";\n }\n\n if (lower.includes(\"dev.azure.com\") || lower.includes(\"visualstudio.com\")) {\n return \"azure-devops\";\n }\n\n if (lower.includes(\"gitlab\")) {\n return \"gitlab\";\n }\n\n return \"generic\";\n}\n\n/**\n * Build HTTP Authorization headers for a resolved credential set.\n */\nexport function buildAuthHeaders(\n creds: Partial<ResolvedGitCredentials> & {\n hostPattern?: string;\n provider?: GitProvider;\n },\n): Record<string, string> {\n if (creds.reauthRequired) {\n return {};\n }\n\n const provider = creds.provider || detectProvider(creds.hostPattern || \"\");\n const mappedProviderId = mapGitProviderToGeneralProviderId(provider);\n const authMode = creds.authMode || \"token\";\n\n // Some git providers (Azure DevOps) need Basic auth for PAT/OAuth over git HTTP.\n if (\n creds.token &&\n mappedProviderId === \"azure_devops\" &&\n getProviderTokenAuthScheme(mappedProviderId, authMode, \"git_remote\")\n ?.headerPrefix === \"Basic \"\n ) {\n return { Authorization: `Basic ${btoa(\":\" + creds.token)}` };\n }\n\n switch (provider) {\n case \"azure-devops\": {\n if (creds.username && creds.password) {\n return {\n Authorization: `Basic ${btoa(creds.username + \":\" + creds.password)}`,\n };\n }\n\n break;\n }\n\n default:\n break;\n }\n\n if (creds.token) {\n const scheme = getProviderTokenAuthScheme(\n mappedProviderId,\n authMode,\n \"git_remote\",\n );\n\n if (scheme?.headerName) {\n return {\n [scheme.headerName]: `${scheme.headerPrefix || \"\"}${creds.token}`,\n };\n }\n\n return { Authorization: `Bearer ${creds.token}` };\n }\n\n return {};\n}\n\n/**\n * Extract hostname + pathname from a git remote URL.\n * Returns e.g. \"dev.azure.com/exampleOrg2/project/_git/repo\" so that\n * path-based host patterns like \"dev.azure.com/exampleOrg2\" can match.\n */\nfunction extractHostAndPath(url: string): string | undefined {\n try {\n const parsed = new URL(url);\n const path = parsed.pathname.replace(/\\/+$/, \"\");\n\n return path ? parsed.hostname + path : parsed.hostname;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Find the best matching account for a URL by host (and optional path prefix).\n * When multiple accounts match, the longest (most specific) pattern wins.\n */\nfunction matchAccountsByHost(\n accounts: GitAccount[],\n hostAndPath: string,\n): GitAccount[] {\n const lower = hostAndPath.toLowerCase();\n const matches: GitAccount[] = [];\n\n let bestLen = -1;\n for (const a of accounts) {\n if (!a.hostPattern) {\n continue;\n }\n\n const pattern = a.hostPattern.toLowerCase();\n if (lower.includes(pattern)) {\n if (pattern.length > bestLen) {\n bestLen = pattern.length;\n\n matches.length = 0;\n matches.push(a);\n } else if (pattern.length === bestLen) {\n matches.push(a);\n }\n }\n }\n\n return matches;\n}\n\nfunction pickAccountByAuthMode(\n accounts: GitAccount[],\n authMode?: GitAuthMode,\n): GitAccount | undefined {\n if (!accounts.length) {\n return undefined;\n }\n\n if (!authMode) {\n return accounts[0];\n }\n\n const modeMatch = accounts.find(\n (acct) => resolveGitAuthMode(acct) === authMode,\n );\n if (modeMatch) {\n return modeMatch;\n }\n\n // Legacy accounts without explicit mode should behave as PAT accounts.\n if (authMode === \"token\") {\n const legacyPat = accounts.find(\n (acct) => resolveGitAuthMode(acct) === \"token\" && !acct.authMode,\n );\n\n if (legacyPat) {\n return legacyPat;\n }\n }\n\n return accounts[0];\n}\n\n/**\n * Decrypt a stored encrypted value, returning undefined for empty/missing.\n */\nasync function decryptIfPresent(\n encrypted: string | null | undefined,\n): Promise<string | undefined> {\n if (!encrypted) {\n return undefined;\n }\n\n const result = await decryptValue(encrypted);\n\n return result ?? undefined;\n}\n\nfunction shouldRefreshOAuthToken(\n account: GitAccount,\n options: ResolveGitCredentialsOptions,\n): boolean {\n if (resolveGitAuthMode(account) !== \"oauth\") {\n return false;\n }\n\n if (account.oauthReauthRequired) {\n return false;\n }\n\n if (\n !account.refreshToken ||\n !account.oauthProviderId ||\n !account.oauthClientId\n ) {\n return false;\n }\n\n if (options.forceRefresh) {\n return true;\n }\n\n if (!account.accessTokenExpiresAt) {\n return false;\n }\n\n return account.accessTokenExpiresAt <= Date.now() + OAUTH_REFRESH_WINDOW_MS;\n}\n\nasync function tryRefreshOAuthAccount(\n db: ShadowClawDatabase,\n accounts: GitAccount[],\n account: GitAccount,\n): Promise<GitAccount> {\n if (\n !account.refreshToken ||\n !account.oauthProviderId ||\n !account.oauthClientId\n ) {\n return account;\n }\n\n const decryptedRefreshToken = await decryptIfPresent(account.refreshToken);\n if (!decryptedRefreshToken) {\n return account;\n }\n\n const oauthClientSecret = account.oauthClientSecret\n ? await decryptIfPresent(account.oauthClientSecret)\n : undefined;\n\n const persistAccount = async (updatedAccount: GitAccount) => {\n const idx = accounts.findIndex((candidate) => candidate.id === account.id);\n if (idx !== -1) {\n accounts[idx] = updatedAccount;\n await setConfig(db, CONFIG_KEYS.GIT_ACCOUNTS, accounts);\n }\n };\n\n const markRefreshFailure = async (): Promise<GitAccount> => {\n const failureCount = (account.oauthRefreshFailureCount || 0) + 1;\n const reauthRequired = failureCount >= OAUTH_REFRESH_FAILURE_THRESHOLD;\n const updatedAccount: GitAccount = {\n ...account,\n oauthRefreshFailureCount: failureCount,\n oauthReauthRequired: reauthRequired,\n oauthReauthRequiredAt: reauthRequired\n ? account.oauthReauthRequiredAt || Date.now()\n : undefined,\n };\n\n await persistAccount(updatedAccount);\n\n return updatedAccount;\n };\n\n try {\n const response = await fetch(\"/oauth/refresh\", {\n body: JSON.stringify({\n clientId: account.oauthClientId,\n clientSecret: oauthClientSecret,\n providerId: account.oauthProviderId,\n refreshToken: decryptedRefreshToken,\n scope: account.scopes,\n }),\n headers: {\n \"content-type\": \"application/json\",\n },\n method: \"POST\",\n });\n\n if (!response.ok) {\n return markRefreshFailure();\n }\n\n const payload = (await response.json()) as {\n accessToken?: string;\n expiresIn?: number;\n refreshToken?: string;\n scope?: string;\n tokenType?: string;\n };\n\n if (!payload.accessToken) {\n return markRefreshFailure();\n }\n\n const encryptedAccessToken = await encryptValue(payload.accessToken);\n if (!encryptedAccessToken) {\n return markRefreshFailure();\n }\n\n let encryptedRefreshToken = account.refreshToken;\n if (payload.refreshToken) {\n const maybeEncryptedRefreshToken = await encryptValue(\n payload.refreshToken,\n );\n\n if (maybeEncryptedRefreshToken) {\n encryptedRefreshToken = maybeEncryptedRefreshToken;\n }\n }\n\n const updatedAccount: GitAccount = {\n ...account,\n token: encryptedAccessToken,\n refreshToken: encryptedRefreshToken,\n accessTokenExpiresAt: payload.expiresIn\n ? Date.now() + payload.expiresIn * 1000\n : account.accessTokenExpiresAt,\n tokenType: payload.tokenType || account.tokenType,\n scopes: payload.scope\n ? payload.scope\n .split(/[\\s,]+/)\n .map((scope) => scope.trim())\n .filter(Boolean)\n : account.scopes,\n oauthRefreshFailureCount: 0,\n oauthReauthRequired: false,\n oauthReauthRequiredAt: undefined,\n };\n\n await persistAccount(updatedAccount);\n\n return updatedAccount;\n } catch {\n return markRefreshFailure();\n }\n}\n\n/**\n * Resolve git credentials for a given operation.\n *\n * Resolution order:\n * 1. If GIT_ACCOUNTS exist, match by URL hostname → default account → first account\n * 2. Fall back to legacy single-key config (GIT_TOKEN, GIT_USERNAME, etc.)\n */\nexport async function resolveGitCredentials(\n db: ShadowClawDatabase,\n url?: string,\n options: ResolveGitCredentialsOptions = {},\n): Promise<ResolvedGitCredentials> {\n const accounts = (await getConfig(db, CONFIG_KEYS.GIT_ACCOUNTS)) as\n GitAccount[] | undefined;\n\n if (Array.isArray(accounts) && accounts.length > 0) {\n return resolveFromAccounts(db, accounts, url, options);\n }\n\n return resolveFromLegacy(db);\n}\n\n/**\n * Resolve credentials from the multi-account list.\n */\nasync function resolveFromAccounts(\n db: ShadowClawDatabase,\n accounts: GitAccount[],\n url?: string,\n options: ResolveGitCredentialsOptions = {},\n): Promise<ResolvedGitCredentials> {\n let account: GitAccount | undefined;\n\n if (options.accountId) {\n account = accounts.find((a) => a.id === options.accountId);\n }\n\n // Match by URL host (+ path prefix when the pattern includes a path)\n if (!account && url) {\n const hostAndPath = extractHostAndPath(url);\n if (hostAndPath) {\n const hostMatches = matchAccountsByHost(accounts, hostAndPath);\n account = pickAccountByAuthMode(hostMatches, options.authMode);\n }\n }\n\n // Fall back to default account (only when no URL was provided, or the\n // default account's host matches the URL). Sending unrelated credentials\n // to a public repo host causes a 401 even though the repo is public.\n if (!account) {\n const defaultId = await getConfig(db, CONFIG_KEYS.GIT_DEFAULT_ACCOUNT);\n if (defaultId) {\n const defaultAccount = accounts.find((a) => a.id === defaultId);\n if (defaultAccount) {\n if (!url) {\n account = defaultAccount;\n } else {\n const hostAndPath = extractHostAndPath(url);\n if (hostAndPath && defaultAccount.hostPattern) {\n const lower = hostAndPath?.toLowerCase();\n const pattern = defaultAccount.hostPattern.toLowerCase();\n if (lower?.includes(pattern)) {\n account = defaultAccount;\n }\n }\n }\n }\n }\n }\n\n // Fall back to first account matching requested mode\n if (!account && !url && options.authMode) {\n account = pickAccountByAuthMode(accounts, options.authMode);\n }\n\n // Fall back to first account\n if (!account && !url) {\n account = accounts[0];\n }\n\n if (!account) {\n return {\n authMode: \"token\",\n authorEmail: undefined,\n authorName: undefined,\n password: undefined,\n provider: \"generic\",\n token: undefined,\n username: undefined,\n };\n }\n\n if (shouldRefreshOAuthToken(account, options)) {\n account = await tryRefreshOAuthAccount(db, accounts, account);\n }\n\n const provider =\n account.provider || detectProvider(account.hostPattern || \"\");\n\n if (resolveGitAuthMode(account) === \"oauth\" && account.oauthReauthRequired) {\n return {\n accountId: account.id,\n authMode: \"oauth\",\n authorEmail: account.authorEmail || undefined,\n authorName: account.authorName || undefined,\n hostPattern: account.hostPattern || undefined,\n password: undefined,\n provider,\n reauthRequired: true,\n token: undefined,\n username: account.username || undefined,\n };\n }\n\n return {\n accountId: account.id,\n authMode: resolveGitAuthMode(account),\n authorEmail: account.authorEmail || undefined,\n authorName: account.authorName || undefined,\n hostPattern: account.hostPattern || undefined,\n password: await decryptIfPresent(account.password),\n provider,\n token: await decryptIfPresent(account.token),\n username: account.username || undefined,\n };\n}\n\n/**\n * Resolve credentials from legacy single-key config.\n */\nasync function resolveFromLegacy(\n db: ShadowClawDatabase,\n): Promise<ResolvedGitCredentials> {\n const encToken = await getConfig(db, CONFIG_KEYS.GIT_TOKEN);\n const encPassword = await getConfig(db, CONFIG_KEYS.GIT_PASSWORD);\n\n return {\n authMode: \"token\",\n authorEmail:\n (await getConfig(db, CONFIG_KEYS.GIT_AUTHOR_EMAIL)) || undefined,\n authorName: (await getConfig(db, CONFIG_KEYS.GIT_AUTHOR_NAME)) || undefined,\n password: encPassword ? await decryptIfPresent(encPassword) : undefined,\n provider: \"generic\" as GitProvider,\n token: encToken ? await decryptIfPresent(encToken) : undefined,\n username: (await getConfig(db, CONFIG_KEYS.GIT_USERNAME)) || undefined,\n };\n}\n"],"mappings":";;;;;;AA6CA,SAAgB,gCACd,YAC0B;CAC1B,IAAI,CAAC,YACH,OAAO;CAIT,IACE,WAAW,aAAa,WACvB,WAAW,aAAwB,OAEpC,OAAO;CAGT,IAAI,WAAW,aAAa,SAC1B,OAAO;CAGT,IAAI,WAAW,aAAa,SAC1B,OAAO;CAGT,IACE,WAAW,mBACX,WAAW,iBACX,WAAW,qBACX,WAAW,gBACX,WAAW,wBACX,WAAW,aACX,WAAW,qBAEX,OAAO;CAGT,OAAO;AACT;;;;AC7DA,MAAM,0BAA0B;AAChC,MAAM,kCAAkC;AAExC,SAAS,mBAAmB,SAAkC;CAC5D,OAAO,gCAAgC,OAAO;AAChD;AAEA,SAAS,kCAAkC,UAA+B;CACxE,QAAQ,UAAR;EACE,KAAK,gBACH,OAAO;EACT,SACE,OAAO;CACX;AACF;;;;AAKA,SAAgB,eAAe,aAAkC;CAC/D,IAAI,CAAC,aACH,OAAO;CAGT,MAAM,QAAQ,YAAY,YAAY;CACtC,IAAI,MAAM,SAAS,QAAQ,GACzB,OAAO;CAGT,IAAI,MAAM,SAAS,eAAe,KAAK,MAAM,SAAS,kBAAkB,GACtE,OAAO;CAGT,IAAI,MAAM,SAAS,QAAQ,GACzB,OAAO;CAGT,OAAO;AACT;;;;AAKA,SAAgB,iBACd,OAIwB;CACxB,IAAI,MAAM,gBACR,OAAO,CAAC;CAGV,MAAM,WAAW,MAAM,YAAY,eAAe,MAAM,eAAe,EAAE;CACzE,MAAM,mBAAmB,kCAAkC,QAAQ;CACnE,MAAM,WAAW,MAAM,Y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rD,OAAO;EACL,WAAW,QAAQ;EACnB,UAAU;EACV,aAAa,QAAQ,eAAe;EACpC,YAAY,QAAQ,cAAc;EAClC,aAAa,QAAQ,eAAe;EACpC,UAAU;EACV;EACA,gBAAgB;EAChB,OAAO;EACP,UAAU,QAAQ,YAAY;CAChC;CAGF,OAAO;EACL,WAAW,QAAQ;EACnB,UAAU,mBAAmB,OAAO;EACpC,aAAa,QAAQ,eAAe;EACpC,YAAY,QAAQ,cAAc;EAClC,aAAa,QAAQ,eAAe;EACpC,UAAU,MAAM,iBAAiB,QAAQ,QAAQ;EACjD;EACA,OAAO,MAAM,iBAAiB,QAAQ,KAAK;EAC3C,UAAU,QAAQ,YAAY;CAChC;AACF;;;;AAKA,eAAe,kBACb,IACiC;CACjC,MAAM,WAAW,MAAM,UAAU,IAAI,YAAY,SAAS;CAC1D,MAAM,cAAc,MAAM,UAAU,IAAI,YAAY,YAAY;CAEhE,OAAO;EACL,UAAU;EACV,aACG,MAAM,UAAU,IAAI,YAAY,gBAAgB,KAAM;EACzD,YAAa,MAAM,UAAU,IAAI,YAAY,eAAe,KAAM;EAClE,UAAU,cAAc,MAAM,iBAAiB,WAAW,IAAI;EAC9D,UAAU;EACV,OAAO,WAAW,MAAM,iBAAiB,QAAQ,IAAI;EACrD,UAAW,MAAM,UAAU,IAAI,YAAY,YAAY,KAAM;CAC/D;AACF"}
|
|
1
|
+
{"version":3,"file":"credentials-CZbngHXW.js","names":[],"sources":["../../src/subsystems/accounts/stored-credentials.ts","../../src/subsystems/git/credentials.ts"],"sourcesContent":["export type StoredCredentialAuthMode = \"token\" | \"basic\" | \"oauth\";\n\nexport interface StoredCredentialBase {\n id: string;\n label: string;\n hostPattern: string;\n token: string;\n basicUsername?: string;\n authMode?: StoredCredentialAuthMode;\n}\n\nexport interface StoredCredentialOAuthFields {\n oauthProviderId?: string;\n oauthClientId?: string;\n oauthClientSecret?: string;\n accessTokenExpiresAt?: number;\n refreshToken?: string;\n scopes?: string[];\n tokenType?: string;\n oauthRefreshFailureCount?: number;\n oauthReauthRequired?: boolean;\n oauthReauthRequiredAt?: number;\n /** Custom authorize URL (used when oauthProviderId is \"custom_mcp\"). */\n oauthCustomAuthorizeUrl?: string;\n /** Custom token URL (used when oauthProviderId is \"custom_mcp\"). */\n oauthCustomTokenUrl?: string;\n /** Custom PKCE preference (used when oauthProviderId is \"custom_mcp\"). */\n oauthCustomUsePkce?: boolean;\n /** Custom redirect URI (used when oauthProviderId is \"custom_mcp\"). */\n oauthCustomRedirectUri?: string;\n}\n\nexport interface PendingOAuthResult {\n providerId: string;\n accessToken: string;\n refreshToken?: string;\n expiresAt?: number;\n scope?: string;\n tokenType?: string;\n}\n\ntype OAuthCapableStoredCredential = {\n authMode?: StoredCredentialAuthMode;\n} & StoredCredentialOAuthFields;\n\nexport function resolveStoredCredentialAuthMode(\n credential: OAuthCapableStoredCredential | null | undefined,\n): StoredCredentialAuthMode {\n if (!credential) {\n return \"token\";\n }\n\n // Treat legacy \"pat\" string identically to \"token\" mode\n if (\n credential.authMode === \"token\" ||\n (credential.authMode as string) === \"pat\"\n ) {\n return \"token\";\n }\n\n if (credential.authMode === \"basic\") {\n return \"basic\";\n }\n\n if (credential.authMode === \"oauth\") {\n return \"oauth\";\n }\n\n if (\n credential.oauthProviderId ||\n credential.oauthClientId ||\n credential.oauthClientSecret ||\n credential.refreshToken ||\n credential.accessTokenExpiresAt ||\n credential.tokenType ||\n credential.oauthReauthRequired\n ) {\n return \"oauth\";\n }\n\n return \"token\";\n}\n","import {\n CONFIG_KEYS,\n getProviderTokenAuthScheme,\n} from \"../../config/config.js\";\n\nimport { resolveStoredCredentialAuthMode } from \"../accounts/stored-credentials.js\";\nimport { decryptValue, encryptValue } from \"../../security/crypto.js\";\n\nimport { getConfig } from \"../../db/get-config.js\";\nimport { setConfig } from \"../../db/set-config.js\";\n\nimport type {\n GitAccount,\n GitAuthMode,\n GitProvider,\n ResolveGitCredentialsOptions,\n ResolvedGitCredentials,\n} from \"./types.js\";\nimport type { ShadowClawDatabase } from \"../../db/types.js\";\n\nconst OAUTH_REFRESH_WINDOW_MS = 60_000;\nconst OAUTH_REFRESH_FAILURE_THRESHOLD = 3;\n\nfunction resolveGitAuthMode(account: GitAccount): GitAuthMode {\n return resolveStoredCredentialAuthMode(account);\n}\n\nfunction mapGitProviderToGeneralProviderId(provider: GitProvider): string {\n switch (provider) {\n case \"azure-devops\":\n return \"azure_devops\";\n default:\n return provider;\n }\n}\n\n/**\n * Detect the git provider type from a hostname or host pattern.\n */\nexport function detectProvider(hostPattern: string): GitProvider {\n if (!hostPattern) {\n return \"generic\";\n }\n\n const lower = hostPattern.toLowerCase();\n if (lower.includes(\"github\")) {\n return \"github\";\n }\n\n if (lower.includes(\"dev.azure.com\") || lower.includes(\"visualstudio.com\")) {\n return \"azure-devops\";\n }\n\n if (lower.includes(\"gitlab\")) {\n return \"gitlab\";\n }\n\n return \"generic\";\n}\n\n/**\n * Build HTTP Authorization headers for a resolved credential set.\n */\nexport function buildAuthHeaders(\n creds: Partial<ResolvedGitCredentials> & {\n hostPattern?: string;\n provider?: GitProvider;\n },\n): Record<string, string> {\n if (creds.reauthRequired) {\n return {};\n }\n\n const provider = creds.provider || detectProvider(creds.hostPattern || \"\");\n const mappedProviderId = mapGitProviderToGeneralProviderId(provider);\n const authMode = creds.authMode || \"token\";\n\n // Some git providers (Azure DevOps) need Basic auth for PAT/OAuth over git HTTP.\n if (\n creds.token &&\n mappedProviderId === \"azure_devops\" &&\n getProviderTokenAuthScheme(mappedProviderId, authMode, \"git_remote\")\n ?.headerPrefix === \"Basic \"\n ) {\n return { Authorization: `Basic ${btoa(\":\" + creds.token)}` };\n }\n\n switch (provider) {\n case \"azure-devops\": {\n if (creds.username && creds.password) {\n return {\n Authorization: `Basic ${btoa(creds.username + \":\" + creds.password)}`,\n };\n }\n\n break;\n }\n\n default:\n break;\n }\n\n if (creds.token) {\n const scheme = getProviderTokenAuthScheme(\n mappedProviderId,\n authMode,\n \"git_remote\",\n );\n\n if (scheme?.headerName) {\n return {\n [scheme.headerName]: `${scheme.headerPrefix || \"\"}${creds.token}`,\n };\n }\n\n return { Authorization: `Bearer ${creds.token}` };\n }\n\n return {};\n}\n\n/**\n * Extract hostname + pathname from a git remote URL.\n * Returns e.g. \"dev.azure.com/exampleOrg2/project/_git/repo\" so that\n * path-based host patterns like \"dev.azure.com/exampleOrg2\" can match.\n */\nfunction extractHostAndPath(url: string): string | undefined {\n try {\n const parsed = new URL(url);\n const path = parsed.pathname.replace(/\\/+$/, \"\");\n\n return path ? parsed.hostname + path : parsed.hostname;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Find the best matching account for a URL by host (and optional path prefix).\n * When multiple accounts match, the longest (most specific) pattern wins.\n */\nfunction matchAccountsByHost(\n accounts: GitAccount[],\n hostAndPath: string,\n): GitAccount[] {\n const lower = hostAndPath.toLowerCase();\n const matches: GitAccount[] = [];\n\n let bestLen = -1;\n for (const a of accounts) {\n if (!a.hostPattern) {\n continue;\n }\n\n const pattern = a.hostPattern.toLowerCase();\n if (lower.includes(pattern)) {\n if (pattern.length > bestLen) {\n bestLen = pattern.length;\n\n matches.length = 0;\n matches.push(a);\n } else if (pattern.length === bestLen) {\n matches.push(a);\n }\n }\n }\n\n return matches;\n}\n\nfunction pickAccountByAuthMode(\n accounts: GitAccount[],\n authMode?: GitAuthMode,\n): GitAccount | undefined {\n if (!accounts.length) {\n return undefined;\n }\n\n if (!authMode) {\n return accounts[0];\n }\n\n const modeMatch = accounts.find(\n (acct) => resolveGitAuthMode(acct) === authMode,\n );\n if (modeMatch) {\n return modeMatch;\n }\n\n // Legacy accounts without explicit mode should behave as PAT accounts.\n if (authMode === \"token\") {\n const legacyPat = accounts.find(\n (acct) => resolveGitAuthMode(acct) === \"token\" && !acct.authMode,\n );\n\n if (legacyPat) {\n return legacyPat;\n }\n }\n\n return accounts[0];\n}\n\n/**\n * Decrypt a stored encrypted value, returning undefined for empty/missing.\n */\nasync function decryptIfPresent(\n encrypted: string | null | undefined,\n): Promise<string | undefined> {\n if (!encrypted) {\n return undefined;\n }\n\n const result = await decryptValue(encrypted);\n\n return result ?? undefined;\n}\n\nfunction shouldRefreshOAuthToken(\n account: GitAccount,\n options: ResolveGitCredentialsOptions,\n): boolean {\n if (resolveGitAuthMode(account) !== \"oauth\") {\n return false;\n }\n\n if (account.oauthReauthRequired) {\n return false;\n }\n\n if (\n !account.refreshToken ||\n !account.oauthProviderId ||\n !account.oauthClientId\n ) {\n return false;\n }\n\n if (options.forceRefresh) {\n return true;\n }\n\n if (!account.accessTokenExpiresAt) {\n return false;\n }\n\n return account.accessTokenExpiresAt <= Date.now() + OAUTH_REFRESH_WINDOW_MS;\n}\n\nasync function tryRefreshOAuthAccount(\n db: ShadowClawDatabase,\n accounts: GitAccount[],\n account: GitAccount,\n): Promise<GitAccount> {\n if (\n !account.refreshToken ||\n !account.oauthProviderId ||\n !account.oauthClientId\n ) {\n return account;\n }\n\n const decryptedRefreshToken = await decryptIfPresent(account.refreshToken);\n if (!decryptedRefreshToken) {\n return account;\n }\n\n const oauthClientSecret = account.oauthClientSecret\n ? await decryptIfPresent(account.oauthClientSecret)\n : undefined;\n\n const persistAccount = async (updatedAccount: GitAccount) => {\n const idx = accounts.findIndex((candidate) => candidate.id === account.id);\n if (idx !== -1) {\n accounts[idx] = updatedAccount;\n await setConfig(db, CONFIG_KEYS.GIT_ACCOUNTS, accounts);\n }\n };\n\n const markRefreshFailure = async (): Promise<GitAccount> => {\n const failureCount = (account.oauthRefreshFailureCount || 0) + 1;\n const reauthRequired = failureCount >= OAUTH_REFRESH_FAILURE_THRESHOLD;\n const updatedAccount: GitAccount = {\n ...account,\n oauthRefreshFailureCount: failureCount,\n oauthReauthRequired: reauthRequired,\n oauthReauthRequiredAt: reauthRequired\n ? account.oauthReauthRequiredAt || Date.now()\n : undefined,\n };\n\n await persistAccount(updatedAccount);\n\n return updatedAccount;\n };\n\n try {\n const response = await fetch(\"/oauth/refresh\", {\n body: JSON.stringify({\n clientId: account.oauthClientId,\n clientSecret: oauthClientSecret,\n providerId: account.oauthProviderId,\n refreshToken: decryptedRefreshToken,\n scope: account.scopes,\n }),\n headers: {\n \"content-type\": \"application/json\",\n },\n method: \"POST\",\n });\n\n if (!response.ok) {\n return markRefreshFailure();\n }\n\n const payload = (await response.json()) as {\n accessToken?: string;\n expiresIn?: number;\n refreshToken?: string;\n scope?: string;\n tokenType?: string;\n };\n\n if (!payload.accessToken) {\n return markRefreshFailure();\n }\n\n const encryptedAccessToken = await encryptValue(payload.accessToken);\n if (!encryptedAccessToken) {\n return markRefreshFailure();\n }\n\n let encryptedRefreshToken = account.refreshToken;\n if (payload.refreshToken) {\n const maybeEncryptedRefreshToken = await encryptValue(\n payload.refreshToken,\n );\n\n if (maybeEncryptedRefreshToken) {\n encryptedRefreshToken = maybeEncryptedRefreshToken;\n }\n }\n\n const updatedAccount: GitAccount = {\n ...account,\n token: encryptedAccessToken,\n refreshToken: encryptedRefreshToken,\n accessTokenExpiresAt: payload.expiresIn\n ? Date.now() + payload.expiresIn * 1000\n : account.accessTokenExpiresAt,\n tokenType: payload.tokenType || account.tokenType,\n scopes: payload.scope\n ? payload.scope\n .split(/[\\s,]+/)\n .map((scope) => scope.trim())\n .filter(Boolean)\n : account.scopes,\n oauthRefreshFailureCount: 0,\n oauthReauthRequired: false,\n oauthReauthRequiredAt: undefined,\n };\n\n await persistAccount(updatedAccount);\n\n return updatedAccount;\n } catch {\n return markRefreshFailure();\n }\n}\n\n/**\n * Resolve git credentials for a given operation.\n *\n * Resolution order:\n * 1. If GIT_ACCOUNTS exist, match by URL hostname → default account → first account\n * 2. Fall back to legacy single-key config (GIT_TOKEN, GIT_USERNAME, etc.)\n */\nexport async function resolveGitCredentials(\n db: ShadowClawDatabase,\n url?: string,\n options: ResolveGitCredentialsOptions = {},\n): Promise<ResolvedGitCredentials> {\n const accounts = (await getConfig(db, CONFIG_KEYS.GIT_ACCOUNTS)) as\n GitAccount[] | undefined;\n\n if (Array.isArray(accounts) && accounts.length > 0) {\n return resolveFromAccounts(db, accounts, url, options);\n }\n\n return resolveFromLegacy(db);\n}\n\n/**\n * Resolve credentials from the multi-account list.\n */\nasync function resolveFromAccounts(\n db: ShadowClawDatabase,\n accounts: GitAccount[],\n url?: string,\n options: ResolveGitCredentialsOptions = {},\n): Promise<ResolvedGitCredentials> {\n let account: GitAccount | undefined;\n\n if (options.accountId) {\n account = accounts.find((a) => a.id === options.accountId);\n }\n\n // Match by URL host (+ path prefix when the pattern includes a path)\n if (!account && url) {\n const hostAndPath = extractHostAndPath(url);\n if (hostAndPath) {\n const hostMatches = matchAccountsByHost(accounts, hostAndPath);\n account = pickAccountByAuthMode(hostMatches, options.authMode);\n }\n }\n\n // Fall back to default account (only when no URL was provided, or the\n // default account's host matches the URL). Sending unrelated credentials\n // to a public repo host causes a 401 even though the repo is public.\n if (!account) {\n const defaultId = await getConfig(db, CONFIG_KEYS.GIT_DEFAULT_ACCOUNT);\n if (defaultId) {\n const defaultAccount = accounts.find((a) => a.id === defaultId);\n if (defaultAccount) {\n if (!url) {\n account = defaultAccount;\n } else {\n const hostAndPath = extractHostAndPath(url);\n if (hostAndPath && defaultAccount.hostPattern) {\n const lower = hostAndPath?.toLowerCase();\n const pattern = defaultAccount.hostPattern.toLowerCase();\n if (lower?.includes(pattern)) {\n account = defaultAccount;\n }\n }\n }\n }\n }\n }\n\n // Fall back to first account matching requested mode\n if (!account && !url && options.authMode) {\n account = pickAccountByAuthMode(accounts, options.authMode);\n }\n\n // Fall back to first account\n if (!account && !url) {\n account = accounts[0];\n }\n\n if (!account) {\n return {\n authMode: \"token\",\n authorEmail: undefined,\n authorName: undefined,\n password: undefined,\n provider: \"generic\",\n token: undefined,\n username: undefined,\n };\n }\n\n if (shouldRefreshOAuthToken(account, options)) {\n account = await tryRefreshOAuthAccount(db, accounts, account);\n }\n\n const provider =\n account.provider || detectProvider(account.hostPattern || \"\");\n\n if (resolveGitAuthMode(account) === \"oauth\" && account.oauthReauthRequired) {\n return {\n accountId: account.id,\n authMode: \"oauth\",\n authorEmail: account.authorEmail || undefined,\n authorName: account.authorName || undefined,\n hostPattern: account.hostPattern || undefined,\n password: undefined,\n provider,\n reauthRequired: true,\n token: undefined,\n username: account.username || undefined,\n };\n }\n\n return {\n accountId: account.id,\n authMode: resolveGitAuthMode(account),\n authorEmail: account.authorEmail || undefined,\n authorName: account.authorName || undefined,\n hostPattern: account.hostPattern || undefined,\n password: await decryptIfPresent(account.password),\n provider,\n token: await decryptIfPresent(account.token),\n username: account.username || undefined,\n };\n}\n\n/**\n * Resolve credentials from legacy single-key config.\n */\nasync function resolveFromLegacy(\n db: ShadowClawDatabase,\n): Promise<ResolvedGitCredentials> {\n const encToken = await getConfig(db, CONFIG_KEYS.GIT_TOKEN);\n const encPassword = await getConfig(db, CONFIG_KEYS.GIT_PASSWORD);\n\n return {\n authMode: \"token\",\n authorEmail:\n (await getConfig(db, CONFIG_KEYS.GIT_AUTHOR_EMAIL)) || undefined,\n authorName: (await getConfig(db, CONFIG_KEYS.GIT_AUTHOR_NAME)) || undefined,\n password: encPassword ? await decryptIfPresent(encPassword) : undefined,\n provider: \"generic\" as GitProvider,\n token: encToken ? await decryptIfPresent(encToken) : undefined,\n username: (await getConfig(db, CONFIG_KEYS.GIT_USERNAME)) || undefined,\n };\n}\n"],"mappings":";;;;;;AA6CA,SAAgB,gCACd,YAC0B;CAC1B,IAAI,CAAC,YACH,OAAO;CAIT,IACE,WAAW,aAAa,WACvB,WAAW,aAAwB,OAEpC,OAAO;CAGT,IAAI,WAAW,aAAa,SAC1B,OAAO;CAGT,IAAI,WAAW,aAAa,SAC1B,OAAO;CAGT,IACE,WAAW,mBACX,WAAW,iBACX,WAAW,qBACX,WAAW,gBACX,WAAW,wBACX,WAAW,aACX,WAAW,qBAEX,OAAO;CAGT,OAAO;AACT;;;;AC7DA,MAAM,0BAA0B;AAChC,MAAM,kCAAkC;AAExC,SAAS,mBAAmB,SAAkC;CAC5D,OAAO,gCAAgC,OAA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AM;EAClE,UAAU,cAAc,MAAM,iBAAiB,WAAW,IAAI;EAC9D,UAAU;EACV,OAAO,WAAW,MAAM,iBAAiB,QAAQ,IAAI;EACrD,UAAW,MAAM,UAAU,IAAI,YAAY,YAAY,KAAM;CAC/D;AACF"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { i as __toESM } from "./rolldown-runtime-DwyhSnWe.js";
|
|
2
2
|
import { o as getDb, t as getConfig } from "./get-config-BWhs5HFF.js";
|
|
3
|
-
import { m as isHeadlessMode, n as getGroupDir } from "./parse-path-
|
|
3
|
+
import { m as isHeadlessMode, n as getGroupDir } from "./parse-path-BOHQP_IQ.js";
|
|
4
4
|
import { t as require_browser } from "./browser-sqa-Vhnx.js";
|
|
5
|
-
import { F as getProvider, R as modelRegistry, c as DEFAULT_PROMPT_API_FALLBACK_MODEL, o as DEFAULT_GROUP_ID, r as CONFIG_KEYS } from "./config-
|
|
6
|
-
import { d as readGroupFile, n as parseSkill, t as toolsStore, u as getAllTasks } from "./tools-
|
|
7
|
-
import { g as saveMessage, h as saveTask, t as orchestratorStore, x as deleteTask } from "./orchestrator-
|
|
5
|
+
import { F as getProvider, R as modelRegistry, c as DEFAULT_PROMPT_API_FALLBACK_MODEL, o as DEFAULT_GROUP_ID, r as CONFIG_KEYS } from "./config-BrHR97zt.js";
|
|
6
|
+
import { d as readGroupFile, n as parseSkill, t as toolsStore, u as getAllTasks } from "./tools-B8OJ4sMF.js";
|
|
7
|
+
import { g as saveMessage, h as saveTask, t as orchestratorStore, x as deleteTask } from "./orchestrator-cRBe3lhq.js";
|
|
8
8
|
import { ulid } from "./utils/ulid.js";
|
|
9
|
-
import { t as getOrCreateSubscriberId } from "./get-or-create-subscriber-id-
|
|
9
|
+
import { t as getOrCreateSubscriberId } from "./get-or-create-subscriber-id-wyzaML7Z.js";
|
|
10
10
|
import { o as showToast } from "./toast-Ck7OIKDf.js";
|
|
11
11
|
import { r as isLlamafileResolutionError } from "./llamafile-Ccnf5VwR.js";
|
|
12
|
-
import { i as detectProviderHelpType, n as isTransformersJsResolutionError } from "./transformers-
|
|
12
|
+
import { i as detectProviderHelpType, n as isTransformersJsResolutionError } from "./transformers-BMURofG6.js";
|
|
13
13
|
import { a as leaveRoom, r as inviteToRoom, t as createRoom } from "./room-QujMjoxG.js";
|
|
14
|
-
import { a as getApiKeyForRequest, b as stopTransformersProgressPolling, l as getProviderRuntimeHeaders } from "./provider-
|
|
15
|
-
import { r as getModelAttachmentCapabilities } from "./attachment-capabilities-
|
|
16
|
-
import { r as getPushUrl } from "./push-client-
|
|
17
|
-
import { o as getChannelTypeForGroup } from "./channel-
|
|
18
|
-
import { a as roomIdFromGroupId } from "./rooms-
|
|
19
|
-
import { l as getRemoteMcpConnection, t as reconnectMcpOAuth } from "./mcp-reconnect-
|
|
14
|
+
import { a as getApiKeyForRequest, b as stopTransformersProgressPolling, l as getProviderRuntimeHeaders } from "./provider-BC9KPI14.js";
|
|
15
|
+
import { r as getModelAttachmentCapabilities } from "./attachment-capabilities-BjkEPip8.js";
|
|
16
|
+
import { r as getPushUrl } from "./push-client-CAm6UMvE.js";
|
|
17
|
+
import { o as getChannelTypeForGroup } from "./channel-DB77spML.js";
|
|
18
|
+
import { a as roomIdFromGroupId } from "./rooms-Dzphx3rK.js";
|
|
19
|
+
import { l as getRemoteMcpConnection, t as reconnectMcpOAuth } from "./mcp-reconnect-BeqQvNWO.js";
|
|
20
20
|
import { n as createModelCacheFetch } from "./create-model-cache-fetch-D7Pm4xNT.js";
|
|
21
21
|
|
|
22
22
|
//#region src/ui/audio.ts
|
|
@@ -2535,4 +2535,4 @@ async function listSkillResources(db, groupId, basePath) {
|
|
|
2535
2535
|
|
|
2536
2536
|
//#endregion
|
|
2537
2537
|
export { deliverResponse as _, shouldDeferTaskToServer as a, ensureBuiltinAiPolyfills as c, buildHeaders as d, formatRequest as f, sanitizeModelOutput as g, parseResponse as h, runTaskAsScheduled as i, getPromptApiFallbackModel as l, normalizeMeshLlmResult as m, loadSkill as n, executeNativeAiTask as o, getContextLimit as p, handleWorkerMessage as r, createTaskInstanceWithFallback as s, discoverSkills as t, summarizeText as u };
|
|
2538
|
-
//# sourceMappingURL=discover-skills-
|
|
2538
|
+
//# sourceMappingURL=discover-skills-CXyaWHKi.js.map
|