@skaile/workspaces 5.15.1 → 5.17.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/CHANGELOG.md +80 -0
- package/dist/app-sdk/index.js +1 -1
- package/dist/{asset-feeds-FVDNQ2FM.js → asset-feeds-MALYFZUM.js} +18 -18
- package/dist/{asset-feeds-FVDNQ2FM.js.map → asset-feeds-MALYFZUM.js.map} +1 -1
- package/dist/asset-manager/catalog-deployer.js +7 -7
- package/dist/asset-manager/index.js +13 -13
- package/dist/asset-manager/installer.js +9 -9
- package/dist/asset-manager/renderers.js +8 -8
- package/dist/asset-manager/src/index.d.ts +105 -6
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/asset-manager/src/installer.d.ts +11 -2
- package/dist/asset-manager/src/installer.d.ts.map +1 -1
- package/dist/asset-manager/src/mcp-config.d.ts.map +1 -1
- package/dist/bridge/drivers/claude-sdk.js +425 -111
- package/dist/bridge/drivers/claude-sdk.js.map +1 -1
- package/dist/bridge/drivers/codex.js +15 -128
- package/dist/bridge/drivers/codex.js.map +1 -1
- package/dist/bridge/drivers/continue.js +10 -10
- package/dist/bridge/drivers/echo.js +4 -4
- package/dist/bridge/drivers/gemini.js +7 -7
- package/dist/bridge/drivers/goose.js +10 -10
- package/dist/bridge/drivers/omp.js +64 -8
- package/dist/bridge/drivers/omp.js.map +1 -1
- package/dist/bridge/drivers/opencode.js +10 -10
- package/dist/bridge/drivers/qwen.js +7 -7
- package/dist/bridge/index.js +15 -14
- package/dist/bridge/src/approval-card.d.ts +24 -0
- package/dist/bridge/src/approval-card.d.ts.map +1 -0
- package/dist/bridge/src/driver-model-check.d.ts +21 -0
- package/dist/bridge/src/driver-model-check.d.ts.map +1 -0
- package/dist/bridge/src/drivers/claude-sdk.d.ts +95 -19
- package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
- package/dist/bridge/src/drivers/claude-self-turns.d.ts +25 -6
- package/dist/bridge/src/drivers/claude-self-turns.d.ts.map +1 -1
- package/dist/bridge/src/drivers/omp-models-yml.d.ts.map +1 -1
- package/dist/bridge/src/drivers/omp.d.ts.map +1 -1
- package/dist/bridge/src/drivers/sanitize-assistant-text.d.ts +10 -0
- package/dist/bridge/src/drivers/sanitize-assistant-text.d.ts.map +1 -1
- package/dist/bridge/src/drivers/scrub-transcript.d.ts +20 -0
- package/dist/bridge/src/drivers/scrub-transcript.d.ts.map +1 -1
- package/dist/bridge/src/index.d.ts +2 -0
- package/dist/bridge/src/index.d.ts.map +1 -1
- package/dist/bridge/src/types.d.ts +23 -0
- package/dist/bridge/src/types.d.ts.map +1 -1
- package/dist/{chunk-YUURCZWY.js → chunk-2SKPPIV7.js} +5 -5
- package/dist/{chunk-YUURCZWY.js.map → chunk-2SKPPIV7.js.map} +1 -1
- package/dist/{chunk-TCWECSEB.js → chunk-3OYOBTY4.js} +70 -6
- package/dist/chunk-3OYOBTY4.js.map +1 -0
- package/dist/{chunk-PK5XQBOC.js → chunk-46IRZJV4.js} +4 -4
- package/dist/{chunk-PK5XQBOC.js.map → chunk-46IRZJV4.js.map} +1 -1
- package/dist/{chunk-54TVXZP3.js → chunk-5DCOG5B5.js} +3 -3
- package/dist/{chunk-54TVXZP3.js.map → chunk-5DCOG5B5.js.map} +1 -1
- package/dist/{chunk-X7DIT65W.js → chunk-5RDZ5JHH.js} +4 -4
- package/dist/{chunk-X7DIT65W.js.map → chunk-5RDZ5JHH.js.map} +1 -1
- package/dist/chunk-5SWED2LW.js +125 -0
- package/dist/chunk-5SWED2LW.js.map +1 -0
- package/dist/{chunk-BV7NLPI6.js → chunk-6GSE63K2.js} +4 -4
- package/dist/{chunk-BV7NLPI6.js.map → chunk-6GSE63K2.js.map} +1 -1
- package/dist/{chunk-PW3TYWOI.js → chunk-AJ7EGIFR.js} +3 -3
- package/dist/{chunk-PW3TYWOI.js.map → chunk-AJ7EGIFR.js.map} +1 -1
- package/dist/{chunk-LEOXPIC6.js → chunk-AP24HESN.js} +3 -3
- package/dist/{chunk-LEOXPIC6.js.map → chunk-AP24HESN.js.map} +1 -1
- package/dist/{chunk-7Y7UYNGL.js → chunk-BBRMS4IC.js} +12 -9
- package/dist/chunk-BBRMS4IC.js.map +1 -0
- package/dist/{chunk-55VKZUQY.js → chunk-BVXXBZWA.js} +70 -34
- package/dist/chunk-BVXXBZWA.js.map +1 -0
- package/dist/{chunk-JUHDED6J.js → chunk-CWAWYXD5.js} +3 -3
- package/dist/{chunk-JUHDED6J.js.map → chunk-CWAWYXD5.js.map} +1 -1
- package/dist/{chunk-OOQ5Q75W.js → chunk-D3PU3C6F.js} +41 -16
- package/dist/chunk-D3PU3C6F.js.map +1 -0
- package/dist/{chunk-WXKNM2JJ.js → chunk-D5REDKVU.js} +3 -3
- package/dist/{chunk-WXKNM2JJ.js.map → chunk-D5REDKVU.js.map} +1 -1
- package/dist/{chunk-B6I7SF2X.js → chunk-DR5ZOEYI.js} +114 -81
- package/dist/chunk-DR5ZOEYI.js.map +1 -0
- package/dist/{chunk-YIDZJHY6.js → chunk-EFLKSMCO.js} +3 -3
- package/dist/{chunk-YIDZJHY6.js.map → chunk-EFLKSMCO.js.map} +1 -1
- package/dist/{chunk-JJLH4TX4.js → chunk-EOKWTN4N.js} +421 -112
- package/dist/chunk-EOKWTN4N.js.map +1 -0
- package/dist/{chunk-NKDSU4Q7.js → chunk-ES6ARJPQ.js} +21 -7
- package/dist/chunk-ES6ARJPQ.js.map +1 -0
- package/dist/{chunk-VQQCA7BD.js → chunk-EYDRONKO.js} +4 -4
- package/dist/{chunk-VQQCA7BD.js.map → chunk-EYDRONKO.js.map} +1 -1
- package/dist/{chunk-U7YMGW7M.js → chunk-FACRITOL.js} +2 -2
- package/dist/{chunk-U7YMGW7M.js.map → chunk-FACRITOL.js.map} +1 -1
- package/dist/{chunk-WWUWMOX2.js → chunk-FSLVMZXR.js} +37 -17
- package/dist/chunk-FSLVMZXR.js.map +1 -0
- package/dist/{chunk-MKTJZLQM.js → chunk-FSSRBWYL.js} +4 -4
- package/dist/{chunk-MKTJZLQM.js.map → chunk-FSSRBWYL.js.map} +1 -1
- package/dist/{chunk-VY6NTFE7.js → chunk-FT4ZHLYR.js} +3 -2
- package/dist/chunk-FT4ZHLYR.js.map +1 -0
- package/dist/{chunk-O673TBWJ.js → chunk-GYZJKZPJ.js} +3 -3
- package/dist/{chunk-O673TBWJ.js.map → chunk-GYZJKZPJ.js.map} +1 -1
- package/dist/{chunk-ANSZULXH.js → chunk-H7R7R5BN.js} +21 -6
- package/dist/chunk-H7R7R5BN.js.map +1 -0
- package/dist/{chunk-RNFHJUK7.js → chunk-HLETG3CX.js} +3 -3
- package/dist/{chunk-RNFHJUK7.js.map → chunk-HLETG3CX.js.map} +1 -1
- package/dist/{plugin-store-BIITCNOZ.js → chunk-HUKUYWBJ.js} +32 -23
- package/dist/chunk-HUKUYWBJ.js.map +1 -0
- package/dist/chunk-KZWZRNIY.js +1016 -0
- package/dist/chunk-KZWZRNIY.js.map +1 -0
- package/dist/{chunk-X5O56UO4.js → chunk-L2AMXONH.js} +3 -3
- package/dist/chunk-L2AMXONH.js.map +1 -0
- package/dist/{chunk-NOF73BUH.js → chunk-L6UMSKDF.js} +10 -2
- package/dist/chunk-L6UMSKDF.js.map +1 -0
- package/dist/{chunk-GQ5OYFVD.js → chunk-LQT2IKYY.js} +47 -47
- package/dist/chunk-LQT2IKYY.js.map +1 -0
- package/dist/{chunk-NHH3MRSC.js → chunk-MMARPEV7.js} +7 -7
- package/dist/{chunk-NHH3MRSC.js.map → chunk-MMARPEV7.js.map} +1 -1
- package/dist/{chunk-GR7TV4XC.js → chunk-OQN7PCI4.js} +4 -4
- package/dist/{chunk-GR7TV4XC.js.map → chunk-OQN7PCI4.js.map} +1 -1
- package/dist/{chunk-NVBN3YOH.js → chunk-OXUCYHL5.js} +46 -67
- package/dist/chunk-OXUCYHL5.js.map +1 -0
- package/dist/{chunk-SZPE55SB.js → chunk-PGZDSDOB.js} +3 -3
- package/dist/{chunk-SZPE55SB.js.map → chunk-PGZDSDOB.js.map} +1 -1
- package/dist/{chunk-4QINFQ27.js → chunk-PIC23DDE.js} +59 -17
- package/dist/chunk-PIC23DDE.js.map +1 -0
- package/dist/{chunk-SAKVAG23.js → chunk-QBY74UBH.js} +7 -7
- package/dist/{chunk-SAKVAG23.js.map → chunk-QBY74UBH.js.map} +1 -1
- package/dist/{chunk-GV3MFKDV.js → chunk-QEX75L77.js} +62 -6
- package/dist/chunk-QEX75L77.js.map +1 -0
- package/dist/{chunk-4AKR4XPQ.js → chunk-QSLXB44M.js} +3 -3
- package/dist/chunk-QSLXB44M.js.map +1 -0
- package/dist/{chunk-PQF5QHVS.js → chunk-QW534EZB.js} +20 -6
- package/dist/chunk-QW534EZB.js.map +1 -0
- package/dist/{chunk-DPCEQOIZ.js → chunk-QXA2W6UB.js} +3 -3
- package/dist/{chunk-DPCEQOIZ.js.map → chunk-QXA2W6UB.js.map} +1 -1
- package/dist/{chunk-N36S36OZ.js → chunk-SPV2CXJ3.js} +3 -3
- package/dist/{chunk-N36S36OZ.js.map → chunk-SPV2CXJ3.js.map} +1 -1
- package/dist/{chunk-KRRHADE7.js → chunk-SXWGLW23.js} +4 -4
- package/dist/{chunk-KRRHADE7.js.map → chunk-SXWGLW23.js.map} +1 -1
- package/dist/{chunk-MUOSKYI2.js → chunk-V5CDPKDA.js} +12 -12
- package/dist/{chunk-MUOSKYI2.js.map → chunk-V5CDPKDA.js.map} +1 -1
- package/dist/{chunk-R37L4BNR.js → chunk-W44KA24A.js} +648 -76
- package/dist/chunk-W44KA24A.js.map +1 -0
- package/dist/{chunk-PV47EEHD.js → chunk-WKEBNB5S.js} +4 -4
- package/dist/{chunk-PV47EEHD.js.map → chunk-WKEBNB5S.js.map} +1 -1
- package/dist/{chunk-ESXZJP4M.js → chunk-WXWQNJCT.js} +3 -3
- package/dist/{chunk-ESXZJP4M.js.map → chunk-WXWQNJCT.js.map} +1 -1
- package/dist/{chunk-354JIEIE.js → chunk-WY22FMZF.js} +5 -5
- package/dist/{chunk-354JIEIE.js.map → chunk-WY22FMZF.js.map} +1 -1
- package/dist/{chunk-D5WTOVLG.js → chunk-Y56YIT6J.js} +2 -2
- package/dist/chunk-Y56YIT6J.js.map +1 -0
- package/dist/{chunk-ZIW34FGO.js → chunk-YIF2IJUA.js} +3 -3
- package/dist/{chunk-ZIW34FGO.js.map → chunk-YIF2IJUA.js.map} +1 -1
- package/dist/{chunk-MGM5EJQQ.js → chunk-YK3XLEQJ.js} +40 -26
- package/dist/chunk-YK3XLEQJ.js.map +1 -0
- package/dist/{chunk-SP5NGNBV.js → chunk-YW2BNDSE.js} +11 -4
- package/dist/chunk-YW2BNDSE.js.map +1 -0
- package/dist/{chunk-GLMKS6V6.js → chunk-ZPCABSSW.js} +4 -4
- package/dist/{chunk-GLMKS6V6.js.map → chunk-ZPCABSSW.js.map} +1 -1
- package/dist/{chunk-J76LDUDS.js → chunk-ZVZTCDUN.js} +26 -10
- package/dist/chunk-ZVZTCDUN.js.map +1 -0
- package/dist/{chunk-RTYDYSUV.js → chunk-ZWUJ22RF.js} +82 -22
- package/dist/chunk-ZWUJ22RF.js.map +1 -0
- package/dist/cli/index.js +902 -1620
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/agent-checks.d.ts +22 -10
- package/dist/cli/src/agent-checks.d.ts.map +1 -1
- package/dist/cli/src/commands/catalog.d.ts.map +1 -1
- package/dist/cli/src/commands/config.d.ts.map +1 -1
- package/dist/cli/src/commands/integration.d.ts.map +1 -1
- package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/library-index.d.ts +6 -0
- package/dist/cli/src/commands/library-index.d.ts.map +1 -1
- package/dist/cli/src/commands/library-publish.d.ts.map +1 -1
- package/dist/cli/src/commands/outdated.d.ts.map +1 -1
- package/dist/cli/src/commands/plugin/codex.d.ts +10 -0
- package/dist/cli/src/commands/plugin/codex.d.ts.map +1 -1
- package/dist/cli/src/commands/plugin/types.d.ts +5 -2
- package/dist/cli/src/commands/plugin/types.d.ts.map +1 -1
- package/dist/cli/src/commands/preset-export.d.ts.map +1 -1
- package/dist/cli/src/commands/project.d.ts +6 -0
- package/dist/cli/src/commands/project.d.ts.map +1 -1
- package/dist/cli/src/commands/rebuild.d.ts.map +1 -1
- package/dist/cli/src/commands/run.d.ts.map +1 -1
- package/dist/cli/src/commands/serve-preflight.d.ts +13 -0
- package/dist/cli/src/commands/serve-preflight.d.ts.map +1 -1
- package/dist/cli/src/commands/serve.d.ts.map +1 -1
- package/dist/cli/src/commands/show.d.ts.map +1 -1
- package/dist/cli/src/commands/source.d.ts +2 -1
- package/dist/cli/src/commands/source.d.ts.map +1 -1
- package/dist/cli/src/commands/store.d.ts.map +1 -1
- package/dist/cli/src/commands/update.d.ts.map +1 -1
- package/dist/cli/src/commands/validate.d.ts +6 -1
- package/dist/cli/src/commands/validate.d.ts.map +1 -1
- package/dist/cli/src/commands/verify.d.ts.map +1 -1
- package/dist/cli/src/helpers.d.ts +23 -0
- package/dist/cli/src/helpers.d.ts.map +1 -1
- package/dist/cli/src/plugin-store/index.d.ts +8 -0
- package/dist/cli/src/plugin-store/index.d.ts.map +1 -1
- package/dist/cli/src/plugin-store/load.d.ts +1 -0
- package/dist/cli/src/plugin-store/load.d.ts.map +1 -1
- package/dist/cli/src/skill-checks.d.ts +9 -21
- package/dist/cli/src/skill-checks.d.ts.map +1 -1
- package/dist/connectors/config.js +5 -5
- package/dist/connectors/index.js +19 -18
- package/dist/{connectors-TVFFE5H4.js → connectors-CIEIMJY2.js} +22 -21
- package/dist/{connectors-TVFFE5H4.js.map → connectors-CIEIMJY2.js.map} +1 -1
- package/dist/connectors-shared/index.js +2 -2
- package/dist/core/index.js +6 -6
- package/dist/core/manifest.js +2 -2
- package/dist/core/models.js +1 -1
- package/dist/core/publish-manifest.js +3 -3
- package/dist/core/ref.js +1 -1
- package/dist/core/runtime-assets.js +5 -5
- package/dist/core/src/conformance.d.ts.map +1 -1
- package/dist/core/src/driver-sdk.d.ts +12 -2
- package/dist/core/src/driver-sdk.d.ts.map +1 -1
- package/dist/core/src/index.d.ts +4 -4
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/lock.d.ts +7 -0
- package/dist/core/src/lock.d.ts.map +1 -1
- package/dist/core/src/manifest.d.ts +9 -0
- package/dist/core/src/manifest.d.ts.map +1 -1
- package/dist/core/src/models.d.ts.map +1 -1
- package/dist/core/src/publish-manifest.d.ts +5 -2
- package/dist/core/src/publish-manifest.d.ts.map +1 -1
- package/dist/core/src/repo-manager.d.ts +14 -0
- package/dist/core/src/repo-manager.d.ts.map +1 -1
- package/dist/core/workspace-config.js +4 -4
- package/dist/deploy/index.js +6 -6
- package/dist/discovery/index.js +5 -5
- package/dist/discovery/src/index.d.ts +2 -2
- package/dist/discovery/src/index.d.ts.map +1 -1
- package/dist/discovery/src/parse-manifest.d.ts +7 -0
- package/dist/discovery/src/parse-manifest.d.ts.map +1 -1
- package/dist/discovery/src/source-config.d.ts +6 -0
- package/dist/discovery/src/source-config.d.ts.map +1 -1
- package/dist/{ensure-sources-N4E5EDGC.js → ensure-sources-I62QMZZP.js} +16 -16
- package/dist/{ensure-sources-N4E5EDGC.js.map → ensure-sources-I62QMZZP.js.map} +1 -1
- package/dist/factory-assets/README.md +1 -1
- package/dist/factory-assets/connectors/box.js +19 -18
- package/dist/factory-assets/connectors/deploy.js +19 -18
- package/dist/factory-assets/connectors/devserver.js +19 -18
- package/dist/factory-assets/connectors/flow/adapter.js +19 -18
- package/dist/factory-assets/connectors/flow/engine.js +7 -7
- package/dist/factory-assets/connectors/flow/run-flow.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/run-flow.js +21 -20
- package/dist/factory-assets/connectors/flow.js +19 -18
- package/dist/factory-assets/connectors/git.js +19 -18
- package/dist/factory-assets/connectors/gmail.js +19 -18
- package/dist/factory-assets/connectors/googledrive.js +19 -18
- package/dist/factory-assets/connectors/local.js +19 -18
- package/dist/factory-assets/connectors/mattermost.js +19 -18
- package/dist/factory-assets/connectors/memory.js +19 -18
- package/dist/factory-assets/connectors/minio.js +19 -18
- package/dist/factory-assets/connectors/postgres.js +19 -18
- package/dist/factory-assets/connectors/s3.js +19 -18
- package/dist/factory-assets/connectors/sharepoint.js +19 -18
- package/dist/factory-assets/connectors/sqlite.js +19 -18
- package/dist/factory-assets/connectors/static-server.js +19 -18
- package/dist/factory-assets/connectors/tunnel.js +19 -18
- package/dist/factory-assets/connectors/webdav.js +19 -18
- package/dist/factory-assets/connectors/xstate-store.js +19 -18
- package/dist/factory-assets/connectors/xstate.js +19 -18
- package/dist/factory-assets/skills/authoring-skaile-assets/SKILL.md +12 -11
- package/dist/factory-assets/skills/authoring-skaile-manifests/SKILL.md +11 -7
- package/dist/factory-assets/skills/skailify/SKILL.md +3 -3
- package/dist/{flows-CYJI3URW.js → flows-YKC53LDP.js} +11 -11
- package/dist/{flows-CYJI3URW.js.map → flows-YKC53LDP.js.map} +1 -1
- package/dist/{helpers-PPVGVYIZ.js → helpers-3FOM37BO.js} +16 -16
- package/dist/{helpers-PPVGVYIZ.js.map → helpers-3FOM37BO.js.map} +1 -1
- package/dist/library/index.js +10 -10
- package/dist/library/install.js +4 -4
- package/dist/library/src/index.d.ts +1 -1
- package/dist/library/src/index.d.ts.map +1 -1
- package/dist/library/src/local/store-paths.d.ts +8 -0
- package/dist/library/src/local/store-paths.d.ts.map +1 -1
- package/dist/library/src/manifest-writer.d.ts +5 -1
- package/dist/library/src/manifest-writer.d.ts.map +1 -1
- package/dist/library/src/remote/remote-catalog-source.d.ts +3 -2
- package/dist/library/src/remote/remote-catalog-source.d.ts.map +1 -1
- package/dist/{library-publish-EQFYHJ6G.js → library-publish-EFKITCGE.js} +59 -51
- package/dist/library-publish-EFKITCGE.js.map +1 -0
- package/dist/model-endpoint/index.js +19 -3
- package/dist/model-endpoint/src/index.d.ts +1 -1
- package/dist/model-endpoint/src/index.d.ts.map +1 -1
- package/dist/model-endpoint/src/resolve.d.ts +5 -0
- package/dist/model-endpoint/src/resolve.d.ts.map +1 -1
- package/dist/model-endpoint/src/server.d.ts +7 -0
- package/dist/model-endpoint/src/server.d.ts.map +1 -1
- package/dist/model-endpoint/src/types.d.ts +41 -7
- package/dist/model-endpoint/src/types.d.ts.map +1 -1
- package/dist/{open-library-JJGDEYYT.js → open-library-NZUI4XGF.js} +19 -19
- package/dist/{open-library-JJGDEYYT.js.map → open-library-NZUI4XGF.js.map} +1 -1
- package/dist/{open-registry-X6YQVP7V.js → open-registry-YPRQDUMK.js} +14 -14
- package/dist/{open-registry-X6YQVP7V.js.map → open-registry-YPRQDUMK.js.map} +1 -1
- package/dist/{paths-NXWIBZCX.js → paths-P55DTBEK.js} +9 -9
- package/dist/{paths-NXWIBZCX.js.map → paths-P55DTBEK.js.map} +1 -1
- package/dist/plugin-store-IPIBZRBX.js +23 -0
- package/dist/plugin-store-IPIBZRBX.js.map +1 -0
- package/dist/project-2BNFZ2CR.js +83 -0
- package/dist/{project-5HW3XSOE.js.map → project-2BNFZ2CR.js.map} +1 -1
- package/dist/resolver/index.js +7 -7
- package/dist/resolver/src/types.d.ts +1 -0
- package/dist/resolver/src/types.d.ts.map +1 -1
- package/dist/resolver/src/validator.d.ts +1 -1
- package/dist/runner/index.js +35 -34
- package/dist/runner/src/agent.d.ts +9 -1
- package/dist/runner/src/agent.d.ts.map +1 -1
- package/dist/runner/src/agents/in-process-host.d.ts.map +1 -1
- package/dist/runner/src/coalesced-restart.d.ts +41 -0
- package/dist/runner/src/coalesced-restart.d.ts.map +1 -0
- package/dist/runner/src/compaction/prompt.d.ts.map +1 -1
- package/dist/runner/src/composition/content-source.d.ts.map +1 -1
- package/dist/runner/src/composition/index.d.ts +1 -1
- package/dist/runner/src/composition/index.d.ts.map +1 -1
- package/dist/runner/src/composition/resolve-instance.d.ts +20 -0
- package/dist/runner/src/composition/resolve-instance.d.ts.map +1 -1
- package/dist/runner/src/mcp-runtime-handlers.d.ts +27 -0
- package/dist/runner/src/mcp-runtime-handlers.d.ts.map +1 -1
- package/dist/runner/src/model-endpoint-discovery.d.ts.map +1 -1
- package/dist/runner/src/resource-handler.d.ts.map +1 -1
- package/dist/runner/src/runner-capabilities.d.ts +16 -3
- package/dist/runner/src/runner-capabilities.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts +10 -0
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-builder.d.ts +20 -1
- package/dist/runner/src/session-builder.d.ts.map +1 -1
- package/dist/runner/src/session-capability-wiring.d.ts +7 -0
- package/dist/runner/src/session-capability-wiring.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +13 -13
- package/dist/sdk/bridge.js +15 -14
- package/dist/sdk/core.js +6 -6
- package/dist/sdk/flow.js +7 -7
- package/dist/sdk/index.js +35 -34
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/resolver.js +7 -7
- package/dist/sdk/runner.js +35 -34
- package/dist/sdk/session.js +2 -2
- package/dist/sdk/transport/ws/server.js +1 -1
- package/dist/sdk/transport/ws.js +1 -1
- package/dist/sdk/transport.js +1 -1
- package/dist/sdk/types.js +1 -1
- package/dist/{serve-preflight-GD7IQFA3.js → serve-preflight-V5GM33T3.js} +15 -9
- package/dist/serve-preflight-V5GM33T3.js.map +1 -0
- package/dist/session/index.js +2 -2
- package/dist/{setup-52NDDR7C.js → setup-ZMAPTKJW.js} +25 -24
- package/dist/setup-ZMAPTKJW.js.map +1 -0
- package/dist/{skills-XVHOXOOH.js → skills-7G6QCDEM.js} +12 -12
- package/dist/{skills-XVHOXOOH.js.map → skills-7G6QCDEM.js.map} +1 -1
- package/dist/{source-WKV4QFGS.js → source-6BZA34F5.js} +45 -44
- package/dist/{source-WKV4QFGS.js.map → source-6BZA34F5.js.map} +1 -1
- package/dist/{source-manifest-publish-3HAX6DPN.js → source-manifest-publish-MJXCSUKT.js} +47 -46
- package/dist/source-manifest-publish-MJXCSUKT.js.map +1 -0
- package/dist/transport/index.js +1 -1
- package/dist/transport/src/ws/server.d.ts +9 -0
- package/dist/transport/src/ws/server.d.ts.map +1 -1
- package/dist/transport/ws/server.js +1 -1
- package/dist/transport/ws.js +1 -1
- package/dist/tui/index.js +110 -44
- package/dist/tui/index.js.map +1 -1
- package/dist/tui/src/repl-session.d.ts +7 -0
- package/dist/tui/src/repl-session.d.ts.map +1 -1
- package/dist/tui/src/repl.d.ts +16 -0
- package/dist/tui/src/repl.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/manifests.js +1 -1
- package/dist/types/src/events.d.ts +7 -4
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/manifests/index.d.ts +1 -0
- package/dist/types/src/manifests/index.d.ts.map +1 -1
- package/dist/types/src/manifests/scaffold-body.d.ts +8 -0
- package/dist/types/src/manifests/scaffold-body.d.ts.map +1 -0
- package/dist/workspace-plugin/adapters/mcp.js +26 -25
- package/dist/workspace-plugin/adapters/omp.js +14 -14
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-4AKR4XPQ.js.map +0 -1
- package/dist/chunk-4QINFQ27.js.map +0 -1
- package/dist/chunk-55VKZUQY.js.map +0 -1
- package/dist/chunk-7Y7UYNGL.js.map +0 -1
- package/dist/chunk-ANSZULXH.js.map +0 -1
- package/dist/chunk-B6I7SF2X.js.map +0 -1
- package/dist/chunk-D5WTOVLG.js.map +0 -1
- package/dist/chunk-GQ5OYFVD.js.map +0 -1
- package/dist/chunk-GV3MFKDV.js.map +0 -1
- package/dist/chunk-J76LDUDS.js.map +0 -1
- package/dist/chunk-JJLH4TX4.js.map +0 -1
- package/dist/chunk-MGM5EJQQ.js.map +0 -1
- package/dist/chunk-NKDSU4Q7.js.map +0 -1
- package/dist/chunk-NOF73BUH.js.map +0 -1
- package/dist/chunk-NVBN3YOH.js.map +0 -1
- package/dist/chunk-OOQ5Q75W.js.map +0 -1
- package/dist/chunk-PQF5QHVS.js.map +0 -1
- package/dist/chunk-R37L4BNR.js.map +0 -1
- package/dist/chunk-RTYDYSUV.js.map +0 -1
- package/dist/chunk-SP5NGNBV.js.map +0 -1
- package/dist/chunk-TCWECSEB.js.map +0 -1
- package/dist/chunk-VY6NTFE7.js.map +0 -1
- package/dist/chunk-WWUWMOX2.js.map +0 -1
- package/dist/chunk-X5O56UO4.js.map +0 -1
- package/dist/library-publish-EQFYHJ6G.js.map +0 -1
- package/dist/plugin-store-BIITCNOZ.js.map +0 -1
- package/dist/project-5HW3XSOE.js +0 -82
- package/dist/serve-preflight-GD7IQFA3.js.map +0 -1
- package/dist/setup-52NDDR7C.js.map +0 -1
- package/dist/source-manifest-publish-3HAX6DPN.js.map +0 -1
|
@@ -1,41 +1,42 @@
|
|
|
1
|
-
import { WorkspacePlugin } from './chunk-
|
|
2
|
-
import { buildWorkspaceToolDefs } from './chunk-
|
|
3
|
-
import { findAiAssetsRoot } from './chunk-
|
|
4
|
-
import { startModelEndpoint } from './chunk-
|
|
5
|
-
import { WebSocketServerTransport } from './chunk-
|
|
1
|
+
import { WorkspacePlugin } from './chunk-FACRITOL.js';
|
|
2
|
+
import { buildWorkspaceToolDefs } from './chunk-MMARPEV7.js';
|
|
3
|
+
import { findAiAssetsRoot } from './chunk-PGZDSDOB.js';
|
|
4
|
+
import { startModelEndpoint } from './chunk-ZWUJ22RF.js';
|
|
5
|
+
import { WebSocketServerTransport } from './chunk-L6UMSKDF.js';
|
|
6
6
|
import { assembleSystemPrompt, buildCapabilitiesPromptSection } from './chunk-W3UDISS2.js';
|
|
7
7
|
import { prepareNativePolicy, codexInstanceEnvironment, parseCodexCredential, parseCodexRefreshInput, parseCodexRefreshResult } from './chunk-PHRNUTSG.js';
|
|
8
|
-
import { resolveFlowPath } from './chunk-
|
|
9
|
-
import { findAiAssetsRoot as findAiAssetsRoot$1, deployCatalogEntry, undeployCatalogEntry } from './chunk-
|
|
10
|
-
import { ConnectFailureCarryOver, registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, buildSdkConnectorTools, buildLazySdkFlowTools, describeFlowOperations, buildConnectorToolDefs, buildFlowToolDefs, SessionNodeExecutor, SessionSubpromptRunner, ClassifierSubpromptRunner, SessionInlineSubFlowRunner, driveOrchestratorTurn, buildSdkFlowTools } from './chunk-
|
|
11
|
-
import { loadYamlConnectorDeclarations, withMaterializedConnectorDeclarations, SecretProviderChain, ConnectorStartupError, isKnownSecretRef, EnvSecretProvider, PreMintedSecretProvider, InMemorySecretProvider, resolvedConfigToDeclarations, deriveSingleMaterializedConnectorDeclaration } from './chunk-
|
|
12
|
-
import { EventNormalizer } from './chunk-
|
|
13
|
-
import { probeResumeTranscript, transcriptStoreForRuntime } from './chunk-
|
|
8
|
+
import { resolveFlowPath } from './chunk-BBRMS4IC.js';
|
|
9
|
+
import { findAiAssetsRoot as findAiAssetsRoot$1, deployCatalogEntry, undeployCatalogEntry } from './chunk-AP24HESN.js';
|
|
10
|
+
import { ConnectFailureCarryOver, registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, buildSdkConnectorTools, buildLazySdkFlowTools, describeFlowOperations, buildConnectorToolDefs, buildFlowToolDefs, SessionNodeExecutor, SessionSubpromptRunner, ClassifierSubpromptRunner, SessionInlineSubFlowRunner, driveOrchestratorTurn, buildSdkFlowTools } from './chunk-V5CDPKDA.js';
|
|
11
|
+
import { loadYamlConnectorDeclarations, withMaterializedConnectorDeclarations, SecretProviderChain, ConnectorStartupError, isKnownSecretRef, EnvSecretProvider, PreMintedSecretProvider, InMemorySecretProvider, resolvedConfigToDeclarations, deriveSingleMaterializedConnectorDeclaration } from './chunk-FSSRBWYL.js';
|
|
12
|
+
import { EventNormalizer } from './chunk-QW534EZB.js';
|
|
13
|
+
import { approvalCardOf, APPROVE_ONCE, DENY, probeResumeTranscript, transcriptStoreForRuntime } from './chunk-3OYOBTY4.js';
|
|
14
14
|
import { CodexNativeStateUnavailable } from './chunk-LOO5CB5M.js';
|
|
15
|
-
import { dispatchCapability } from './chunk-
|
|
15
|
+
import { dispatchCapability } from './chunk-AJ7EGIFR.js';
|
|
16
16
|
import { classifyClaudeSdkError } from './chunk-B4X2N7JQ.js';
|
|
17
17
|
import { agentExecRequested } from './chunk-YROR332M.js';
|
|
18
|
-
import { toAgentEffort, toMergedRegistry } from './chunk-
|
|
19
|
-
import { unresolvedProviderCredentials, driverCapabilities, createDriver, catalogLayer, providerCredentialEnvName, registryCredentialEnv, AI_PROVIDER_PRESETS, supportsLiveToolUpdates } from './chunk-
|
|
20
|
-
import { loadFlow } from './chunk-
|
|
18
|
+
import { toAgentEffort, toMergedRegistry } from './chunk-QSLXB44M.js';
|
|
19
|
+
import { unresolvedProviderCredentials, driverCapabilities, createDriver, catalogLayer, providerCredentialEnvName, registryCredentialEnv, AI_PROVIDER_PRESETS, supportsLiveToolUpdates } from './chunk-LQT2IKYY.js';
|
|
20
|
+
import { loadFlow } from './chunk-SPV2CXJ3.js';
|
|
21
21
|
import { parseFlowDefinition } from './chunk-X3RMRJNR.js';
|
|
22
22
|
import { renderStimulusPrompt } from './chunk-M3WPBTGJ.js';
|
|
23
|
-
import { TERMINAL_AGENT_RUN_STATUSES, withActivityLabelJsonSchema, TOOL_ACTIVITY_PROMPT_SECTION, SESSION_ROOT_CONNECTOR_ID, PLATFORM_BLOCKS_RUNTIME_FEATURE, PROTOCOL_VERSION, deliveryClassOf } from './chunk-
|
|
24
|
-
import { knowledgeKindProvider, scanLibraryRoot } from './chunk-
|
|
25
|
-
import { createDefaultKindRegistry } from './chunk-
|
|
26
|
-
import { BindingSchema, effectiveComposes, AgentManifestSchema, AgentTriggerSchema } from './chunk-
|
|
27
|
-
import { readLock, buildAgentPromptSections, resolveSettings, loadProviderRegistry, resolveLibraryDir } from './chunk-
|
|
28
|
-
import { resolveRuntimeAssets } from './chunk-
|
|
23
|
+
import { TERMINAL_AGENT_RUN_STATUSES, withActivityLabelJsonSchema, TOOL_ACTIVITY_PROMPT_SECTION, SESSION_ROOT_CONNECTOR_ID, PLATFORM_BLOCKS_RUNTIME_FEATURE, PROTOCOL_VERSION, deliveryClassOf } from './chunk-Y56YIT6J.js';
|
|
24
|
+
import { knowledgeKindProvider, scanLibraryRoot, LocalIndex } from './chunk-D3PU3C6F.js';
|
|
25
|
+
import { createDefaultKindRegistry } from './chunk-ES6ARJPQ.js';
|
|
26
|
+
import { BindingSchema, effectiveComposes, AgentManifestSchema, AgentTriggerSchema, ANTHROPIC_MODEL_ALIASES } from './chunk-YK3XLEQJ.js';
|
|
27
|
+
import { readLock, buildAgentPromptSections, resolveSettings, loadProviderRegistry, resolveLibraryDir } from './chunk-PIC23DDE.js';
|
|
28
|
+
import { resolveRuntimeAssets } from './chunk-5RDZ5JHH.js';
|
|
29
29
|
import { DEFAULT_DRIVER_ID, resolveDriverPaths } from './chunk-5BEFNLOR.js';
|
|
30
|
-
import { matchPin, DEFAULT_AGENT_INSTANCE_ID, effectiveAgentInstances, resolveSkWorkspaceConfig, resolveAgentDir, loadMcpServerDeclarations, COMPACTION_DEFAULTS, resolveCompactionThresholdPercent, getGlobalCacheDir, sourceCacheKey,
|
|
30
|
+
import { matchPin, DEFAULT_AGENT_INSTANCE_ID, effectiveAgentInstances, resolveAgentDefinitionDir, AgentRefResolutionError, resolveSkWorkspaceConfig, resolveAgentDir, loadMcpServerDeclarations, COMPACTION_DEFAULTS, resolveCompactionThresholdPercent, getGlobalCacheDir, sourceCacheKey, validateAssetRecipeAttr, deriveSingleMaterializedMcpDeclaration, stageMaterializedSkills, readSkillAllowList, isStagedSkillMarkerFor, unstageSkill, STAGED_SKILL_MARKER } from './chunk-ZVZTCDUN.js';
|
|
31
31
|
import { globalSkaileDir } from './chunk-L5VSIPQD.js';
|
|
32
32
|
import { driverTargetForDriver, SUPPORTED_DRIVER_TARGETS, DRIVER_TARGETS } from './chunk-IG5LZ3WU.js';
|
|
33
|
-
import { withFsDeadline, FsDeadlineError, fsDeadlineMs, parseFrontmatter, tryWithFsDeadline } from './chunk-
|
|
34
|
-
import { parseAssetRef } from './chunk-
|
|
33
|
+
import { withFsDeadline, FsDeadlineError, fsDeadlineMs, parseFrontmatter, tryWithFsDeadline } from './chunk-YW2BNDSE.js';
|
|
34
|
+
import { parseAssetRef } from './chunk-FT4ZHLYR.js';
|
|
35
35
|
import { resolveLogStoreConfig, createLogStoreFromConfig, OnLogBridgeSink, WsLogSink, resolveLogsRetention, enforceLogsRetention } from './chunk-DKXNKFKP.js';
|
|
36
36
|
import { pickRegistryEntries, registryEntries, resolveEntryBaseUrl, parseModelRef, isEntryEnabled, parseCredentialRef } from './chunk-MJHSLODD.js';
|
|
37
37
|
import { getLogStore, registerLogStore, createLogger, resetLogStore, isUnwritableStreamError, markStreamBroken, isBrokenPipeError, redactCredentials } from './chunk-BOFL7GIF.js';
|
|
38
38
|
import { __require } from './chunk-NSBPE2FW.js';
|
|
39
|
+
import { createInterface } from 'readline';
|
|
39
40
|
import pc from 'picocolors';
|
|
40
41
|
import path3, { resolve, basename, join, dirname, relative, sep, isAbsolute } from 'path';
|
|
41
42
|
import { Marked } from 'marked';
|
|
@@ -43,9 +44,9 @@ import { markedTerminal } from 'marked-terminal';
|
|
|
43
44
|
import { createHash, randomUUID, randomBytes, timingSafeEqual } from 'crypto';
|
|
44
45
|
import * as z5 from 'zod';
|
|
45
46
|
import { z } from 'zod';
|
|
46
|
-
import fs8, { readFile, readdir, lstat, stat, rm, unlink, mkdir, writeFile, realpath, rename, open, readlink, mkdtemp } from 'fs/promises';
|
|
47
|
-
import { parse } from 'yaml';
|
|
48
47
|
import { constants, unlinkSync, readFileSync, readdirSync, statSync, existsSync, lstatSync, realpathSync, mkdirSync, writeFileSync, watch, chmodSync, accessSync, rmSync } from 'fs';
|
|
48
|
+
import fs8, { readFile, readdir, lstat, realpath, rm, unlink, stat, mkdir, writeFile, readlink, rename, open, mkdtemp } from 'fs/promises';
|
|
49
|
+
import { parse } from 'yaml';
|
|
49
50
|
import { Ajv2020 } from 'ajv/dist/2020.js';
|
|
50
51
|
import { execFile } from 'child_process';
|
|
51
52
|
import { promisify } from 'util';
|
|
@@ -368,8 +369,8 @@ async function openLocalIndexIfAvailable(log) {
|
|
|
368
369
|
return STUB_LIBRARY;
|
|
369
370
|
}
|
|
370
371
|
try {
|
|
371
|
-
const { LocalIndex } = await import('./library/index.js');
|
|
372
|
-
return new
|
|
372
|
+
const { LocalIndex: LocalIndex2 } = await import('./library/index.js');
|
|
373
|
+
return new LocalIndex2();
|
|
373
374
|
} catch (err) {
|
|
374
375
|
log?.debug(`Could not open LocalIndex at ${indexPath}: ${err.message}`);
|
|
375
376
|
return STUB_LIBRARY;
|
|
@@ -530,6 +531,10 @@ var CatalogScanner = class {
|
|
|
530
531
|
registry;
|
|
531
532
|
scans = /* @__PURE__ */ new Map();
|
|
532
533
|
roots;
|
|
534
|
+
/** Every discovered asset of `kind` named `name` under one root (any root, declared or not). */
|
|
535
|
+
findIn(root, kind, name) {
|
|
536
|
+
return this.scan(root).filter((hit) => hit.asset.kind === kind && hit.asset.name === name);
|
|
537
|
+
}
|
|
533
538
|
/** Every discovered asset of `kind` named `name`, across all roots. */
|
|
534
539
|
find(kind, name) {
|
|
535
540
|
const out = [];
|
|
@@ -590,6 +595,26 @@ function defaultCatalogRoots(projectDir) {
|
|
|
590
595
|
}
|
|
591
596
|
return [...roots];
|
|
592
597
|
}
|
|
598
|
+
function normalizeRemote(url) {
|
|
599
|
+
return url.trim().replace(/^git@([^:]+):/, "https://$1/").replace(/^[a-z]+:\/\//i, "").replace(/\/+$/, "").replace(/\.git$/i, "").replace(/\/+$/, "").toLowerCase();
|
|
600
|
+
}
|
|
601
|
+
async function registeredLibraryRoots(origin) {
|
|
602
|
+
let index;
|
|
603
|
+
try {
|
|
604
|
+
index = new LocalIndex();
|
|
605
|
+
const libraries = await index.listSources();
|
|
606
|
+
const byName = libraries.filter((l) => l.name === origin.name);
|
|
607
|
+
const byUrl = byName.length === 0 && origin.url ? libraries.filter((l) => {
|
|
608
|
+
const url = l.backendConfig.url;
|
|
609
|
+
return typeof url === "string" && normalizeRemote(url) === normalizeRemote(origin.url ?? "");
|
|
610
|
+
}) : [];
|
|
611
|
+
return [...byName, ...byUrl].map((l) => l.path).filter((dir) => existsSync(dir));
|
|
612
|
+
} catch {
|
|
613
|
+
return [];
|
|
614
|
+
} finally {
|
|
615
|
+
index?.close();
|
|
616
|
+
}
|
|
617
|
+
}
|
|
593
618
|
function createCompositionContentSource(opts) {
|
|
594
619
|
const registry = opts.registry ?? createDefaultKindRegistry([knowledgeKindProvider]);
|
|
595
620
|
const scanner = new CatalogScanner(opts.projectDir, registry, opts.catalogRoots);
|
|
@@ -738,9 +763,14 @@ var DefaultCompositionContentSource = class _DefaultCompositionContentSource {
|
|
|
738
763
|
storeDir
|
|
739
764
|
);
|
|
740
765
|
}
|
|
741
|
-
const
|
|
742
|
-
|
|
743
|
-
)
|
|
766
|
+
const holdsPin = (h) => h.asset.version === pin.version && barePublisher(h.asset.publisher) === pin.publisher;
|
|
767
|
+
let hit = this.scanner.find(kind, pin.name).find(holdsPin);
|
|
768
|
+
if (!hit && entry.library) {
|
|
769
|
+
for (const root of await registeredLibraryRoots(entry.library)) {
|
|
770
|
+
hit = this.scanner.findIn(root, kind, pin.name).find(holdsPin);
|
|
771
|
+
if (hit) break;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
744
774
|
if (!hit) {
|
|
745
775
|
throw new CompositionError(
|
|
746
776
|
"composition_asset_missing",
|
|
@@ -1366,6 +1396,39 @@ function instanceForSession(config, instanceId, agentDir) {
|
|
|
1366
1396
|
const id = instanceId ?? DEFAULT_AGENT_INSTANCE_ID;
|
|
1367
1397
|
return { instanceId: id, instance: effectiveAgentInstances(config)[id] ?? { ref: agentDir } };
|
|
1368
1398
|
}
|
|
1399
|
+
function instanceSessionOverrides(config, instanceId) {
|
|
1400
|
+
const instance = effectiveAgentInstances(config)[instanceId];
|
|
1401
|
+
const model = instance?.model?.preferred;
|
|
1402
|
+
const maxTurns = instance?.budget?.max_turns ?? instance?.permissions?.max_turns;
|
|
1403
|
+
return {
|
|
1404
|
+
...model ? { model } : {},
|
|
1405
|
+
...maxTurns !== void 0 ? { maxTurns } : {}
|
|
1406
|
+
};
|
|
1407
|
+
}
|
|
1408
|
+
function resolveInstanceAgentDir(projectDir, config, instanceId) {
|
|
1409
|
+
const instances = effectiveAgentInstances(config);
|
|
1410
|
+
const instance = instances[instanceId];
|
|
1411
|
+
if (!instance) {
|
|
1412
|
+
const ids = Object.keys(instances);
|
|
1413
|
+
throw new Error(
|
|
1414
|
+
`No agent instance "${instanceId}" in skaile.yaml. ` + (ids.length > 0 ? `Declared: ${ids.join(", ")}.` : "It declares none: add one under `agents:` (or an `agent:` block for `default`).")
|
|
1415
|
+
);
|
|
1416
|
+
}
|
|
1417
|
+
let dir;
|
|
1418
|
+
try {
|
|
1419
|
+
dir = resolveAgentDefinitionDir(projectDir, instance.ref);
|
|
1420
|
+
} catch (error) {
|
|
1421
|
+
if (!(error instanceof AgentRefResolutionError)) throw error;
|
|
1422
|
+
throw new Error(`Agent instance "${instanceId}": ${error.message}`);
|
|
1423
|
+
}
|
|
1424
|
+
if (dir && path3.basename(dir) === "agent.yaml") dir = path3.dirname(dir);
|
|
1425
|
+
if (!dir || !existsSync(path3.join(dir, "agent.yaml"))) {
|
|
1426
|
+
throw new Error(
|
|
1427
|
+
`Agent instance "${instanceId}": "${instance.ref}" does not resolve to an agent directory with agent.yaml${dir ? ` (looked in ${dir})` : ""}`
|
|
1428
|
+
);
|
|
1429
|
+
}
|
|
1430
|
+
return dir;
|
|
1431
|
+
}
|
|
1369
1432
|
async function resolveAgentInstance(opts) {
|
|
1370
1433
|
const { instanceId, instance, asset, projectDir, host, sessionId, resumeSessionId, log } = opts;
|
|
1371
1434
|
const { manifest, dir: agentDir } = asset;
|
|
@@ -3706,6 +3769,8 @@ function nestedRoleSessionConfig(parent) {
|
|
|
3706
3769
|
getExtraMcpDeclarations: _extra,
|
|
3707
3770
|
agentDir: _agentDir,
|
|
3708
3771
|
instanceId: _instance,
|
|
3772
|
+
permissionMode: _permissionMode,
|
|
3773
|
+
unattended: _unattended,
|
|
3709
3774
|
...rest
|
|
3710
3775
|
} = parent;
|
|
3711
3776
|
return rest;
|
|
@@ -3724,6 +3789,10 @@ function nestedLauncher(deps) {
|
|
|
3724
3789
|
instanceId: target.id,
|
|
3725
3790
|
agentDir: target.agentDir,
|
|
3726
3791
|
sessionId: ctx.run.sessionId,
|
|
3792
|
+
// The role's own `permission_mode`; nobody answers a question of a nested session, so a
|
|
3793
|
+
// call that needs approval is refused there.
|
|
3794
|
+
...target.permissionMode ? { permissionMode: target.permissionMode } : {},
|
|
3795
|
+
unattended: true,
|
|
3727
3796
|
...Number.isFinite(maxTurns) ? { maxTurns } : {},
|
|
3728
3797
|
// `model` is what the primary session hands the driver (`--model`); a registry
|
|
3729
3798
|
// session resolves `modelRef` first. Both are set, so the role runs on its own
|
|
@@ -6121,6 +6190,7 @@ async function startRunnerModelEndpoint(options) {
|
|
|
6121
6190
|
token,
|
|
6122
6191
|
host,
|
|
6123
6192
|
port: options.config.port ?? 0,
|
|
6193
|
+
projectDir: options.projectDir,
|
|
6124
6194
|
log: options.log
|
|
6125
6195
|
});
|
|
6126
6196
|
if (!isLoopbackHost(host)) {
|
|
@@ -6320,6 +6390,7 @@ async function createAgentSession(config) {
|
|
|
6320
6390
|
if (config.effort === void 0 && wsEffort !== void 0 && effort === void 0) {
|
|
6321
6391
|
sessionLog.warn("ignoring unknown effort", { effort: wsEffort, source: "skaile.yaml" });
|
|
6322
6392
|
}
|
|
6393
|
+
const permissionMode = config.permissionMode ?? effectiveAgentInstances(wsConfig)[config.instanceId ?? DEFAULT_AGENT_INSTANCE_ID]?.permissions?.permission_mode ?? wsConfig.agent?.permissions?.permission_mode;
|
|
6323
6394
|
const maxTurns = maxTurnsOverride ?? manifest?.runtime?.max_turns;
|
|
6324
6395
|
let driver;
|
|
6325
6396
|
try {
|
|
@@ -6341,7 +6412,8 @@ async function createAgentSession(config) {
|
|
|
6341
6412
|
agentDir,
|
|
6342
6413
|
registry,
|
|
6343
6414
|
modelRef,
|
|
6344
|
-
credentialEnv
|
|
6415
|
+
credentialEnv,
|
|
6416
|
+
permissionMode
|
|
6345
6417
|
});
|
|
6346
6418
|
} catch (error) {
|
|
6347
6419
|
try {
|
|
@@ -6539,6 +6611,11 @@ function logAssembledSystemPrompt(systemPrompt, log) {
|
|
|
6539
6611
|
log.debug("system prompt content", { content: systemPrompt ?? "(empty)" });
|
|
6540
6612
|
}
|
|
6541
6613
|
}
|
|
6614
|
+
function manifestModelForDriver(manifest, driverType) {
|
|
6615
|
+
const preferred = manifest?.model?.preferred;
|
|
6616
|
+
if (!preferred || driverType === "claude-sdk") return preferred;
|
|
6617
|
+
return ANTHROPIC_MODEL_ALIASES.includes(preferred) ? void 0 : preferred;
|
|
6618
|
+
}
|
|
6542
6619
|
function createSessionDriver(args) {
|
|
6543
6620
|
const {
|
|
6544
6621
|
config,
|
|
@@ -6556,7 +6633,8 @@ function createSessionDriver(args) {
|
|
|
6556
6633
|
agentDir,
|
|
6557
6634
|
registry,
|
|
6558
6635
|
modelRef,
|
|
6559
|
-
credentialEnv
|
|
6636
|
+
credentialEnv,
|
|
6637
|
+
permissionMode
|
|
6560
6638
|
} = args;
|
|
6561
6639
|
return createDriver(driverType, {
|
|
6562
6640
|
...config.managedCodex ? {
|
|
@@ -6577,9 +6655,12 @@ function createSessionDriver(args) {
|
|
|
6577
6655
|
}
|
|
6578
6656
|
}
|
|
6579
6657
|
}
|
|
6580
|
-
} :
|
|
6658
|
+
} : (
|
|
6659
|
+
// Standalone codex: `interactive` asks codex for its own approval instead of `never`.
|
|
6660
|
+
permissionMode === "interactive" && driverType === "codex" ? { driverOptions: { codex: { approvalPolicy: "on-request" } } } : {}
|
|
6661
|
+
),
|
|
6581
6662
|
cwd: agentCwd,
|
|
6582
|
-
model: model ?? manifest
|
|
6663
|
+
model: model ?? manifestModelForDriver(manifest, driverType),
|
|
6583
6664
|
maxTurns,
|
|
6584
6665
|
systemPrompt,
|
|
6585
6666
|
tools: manifest?.tools,
|
|
@@ -6592,6 +6673,8 @@ function createSessionDriver(args) {
|
|
|
6592
6673
|
...Object.keys(credentialEnv).length > 0 ? { env: credentialEnv } : {},
|
|
6593
6674
|
...thinking ? { thinking } : {},
|
|
6594
6675
|
...effort ? { effort } : {},
|
|
6676
|
+
...permissionMode ? { permissionMode } : {},
|
|
6677
|
+
...config.unattended ? { unattended: true } : {},
|
|
6595
6678
|
...sessionId ? { sessionId } : {},
|
|
6596
6679
|
...resumeSessionId ? { resumeSessionId } : {},
|
|
6597
6680
|
...mcpServers ? { mcpServers } : {},
|
|
@@ -6632,7 +6715,8 @@ async function runAgentChat(opts) {
|
|
|
6632
6715
|
subkind: "session",
|
|
6633
6716
|
instance: sessionId
|
|
6634
6717
|
});
|
|
6635
|
-
const
|
|
6718
|
+
const attended = opts.unattended === void 0 ? process.stdin.isTTY === true : !opts.unattended;
|
|
6719
|
+
const baseConfig = sessionConfigFor({ ...opts, unattended: !attended });
|
|
6636
6720
|
const surface = await createStandaloneAgentSurface({
|
|
6637
6721
|
config: baseConfig,
|
|
6638
6722
|
// Only `subagent` events come this way; the bridge's event union is a different type.
|
|
@@ -6673,6 +6757,12 @@ async function runAgentChat(opts) {
|
|
|
6673
6757
|
driver.on("agent-event", (event) => {
|
|
6674
6758
|
opts.onEvent?.(event);
|
|
6675
6759
|
printUnstreamed(event);
|
|
6760
|
+
const card = attended ? approvalCardOf(event) : void 0;
|
|
6761
|
+
if (card) {
|
|
6762
|
+
void askApprovalOnTerminal(card.question, card.details).then((approved) => {
|
|
6763
|
+
driver.answerQuestion(approved ? APPROVE_ONCE : DENY, card.question, card.requestId);
|
|
6764
|
+
});
|
|
6765
|
+
}
|
|
6676
6766
|
if (event.type === "message_update") {
|
|
6677
6767
|
const delta = event._textDelta;
|
|
6678
6768
|
if (delta) writeText(delta);
|
|
@@ -6736,13 +6826,33 @@ ${message}`;
|
|
|
6736
6826
|
disposeLogStore();
|
|
6737
6827
|
}
|
|
6738
6828
|
}
|
|
6829
|
+
async function askApprovalOnTerminal(question, details) {
|
|
6830
|
+
const rl = createInterface({ input: process.stdin, output: process.stderr });
|
|
6831
|
+
try {
|
|
6832
|
+
process.stderr.write(`
|
|
6833
|
+
${pc.yellow("?")} ${question}
|
|
6834
|
+
`);
|
|
6835
|
+
for (const line of details) process.stderr.write(` ${pc.dim(line)}
|
|
6836
|
+
`);
|
|
6837
|
+
return await new Promise((resolve4) => {
|
|
6838
|
+
rl.question(" Approve once? [y/N] ", (answer) => resolve4(/^y(es)?$/i.test(answer.trim())));
|
|
6839
|
+
rl.once("close", () => resolve4(false));
|
|
6840
|
+
});
|
|
6841
|
+
} finally {
|
|
6842
|
+
rl.close();
|
|
6843
|
+
}
|
|
6844
|
+
}
|
|
6739
6845
|
function sessionConfigFor(opts) {
|
|
6740
6846
|
const agentDir = opts.agentDir ?? resolveAgentDir(opts.projectDir);
|
|
6741
6847
|
return {
|
|
6742
6848
|
projectDir: opts.projectDir,
|
|
6743
6849
|
agentDir,
|
|
6850
|
+
...opts.instanceId ? { instanceId: opts.instanceId } : {},
|
|
6744
6851
|
driver: opts.driver,
|
|
6745
6852
|
model: opts.model,
|
|
6853
|
+
...opts.modelRef ? { modelRef: opts.modelRef } : {},
|
|
6854
|
+
...opts.maxTurns !== void 0 ? { maxTurns: opts.maxTurns } : {},
|
|
6855
|
+
...opts.unattended ? { unattended: true } : {},
|
|
6746
6856
|
promptsDir: opts.promptsDir,
|
|
6747
6857
|
onLog: opts.onLog
|
|
6748
6858
|
};
|
|
@@ -7321,6 +7431,14 @@ async function handleMountResourceRequest(command, manager, emit) {
|
|
|
7321
7431
|
if (rel === ".." || rel.startsWith(`..${sep}`) || isAbsolute(rel)) {
|
|
7322
7432
|
throw new Error("Path traversal outside mount");
|
|
7323
7433
|
}
|
|
7434
|
+
if (MOUNT_WRITE_OPERATIONS.has(operation) && entry.declaration.access === "read-only") {
|
|
7435
|
+
throw new Error(`Connector "${mountId}" is read-only`);
|
|
7436
|
+
}
|
|
7437
|
+
const realMount = await withFsDeadline(`realpath ${mountPath}`, () => realpath(mountPath));
|
|
7438
|
+
const actPath = operation === "delete" && rel !== "" ? join(await resolveOnDisk(dirname(targetPath)), basename(targetPath)) : await resolveOnDisk(targetPath);
|
|
7439
|
+
if (!isWithin2(realMount, operation === "delete" && rel !== "" ? dirname(actPath) : actPath)) {
|
|
7440
|
+
throw new Error("Path escapes the mount through a symlink");
|
|
7441
|
+
}
|
|
7324
7442
|
let data;
|
|
7325
7443
|
switch (operation) {
|
|
7326
7444
|
case "list": {
|
|
@@ -7346,13 +7464,14 @@ async function handleMountResourceRequest(command, manager, emit) {
|
|
|
7346
7464
|
);
|
|
7347
7465
|
}
|
|
7348
7466
|
const entryRel = relDir ? `${relDir}/${e.name}` : e.name;
|
|
7349
|
-
const
|
|
7467
|
+
const linked = e.isSymbolicLink() ? await resolveMountLink(realMount, join(absDir, e.name)) : null;
|
|
7468
|
+
const isDir = linked ? linked.isDirectory : e.isDirectory();
|
|
7350
7469
|
const result = {
|
|
7351
7470
|
name: e.name,
|
|
7352
7471
|
path: entryRel,
|
|
7353
7472
|
type: isDir ? "directory" : "file"
|
|
7354
7473
|
};
|
|
7355
|
-
if (!isDir) {
|
|
7474
|
+
if (!isDir && !(e.isSymbolicLink() && !linked)) {
|
|
7356
7475
|
try {
|
|
7357
7476
|
const st = await withFsDeadline(
|
|
7358
7477
|
`stat ${join(absDir, e.name)}`,
|
|
@@ -7364,10 +7483,12 @@ async function handleMountResourceRequest(command, manager, emit) {
|
|
|
7364
7483
|
}
|
|
7365
7484
|
}
|
|
7366
7485
|
collected.push(result);
|
|
7367
|
-
if (isDir && recursive
|
|
7486
|
+
if (isDir && recursive && !e.isSymbolicLink()) {
|
|
7487
|
+
await walk(join(absDir, e.name), entryRel, depth + 1);
|
|
7488
|
+
}
|
|
7368
7489
|
}
|
|
7369
7490
|
};
|
|
7370
|
-
await walk(
|
|
7491
|
+
await walk(actPath, reqPath ?? "", 0);
|
|
7371
7492
|
data = collected;
|
|
7372
7493
|
break;
|
|
7373
7494
|
}
|
|
@@ -7377,7 +7498,7 @@ async function handleMountResourceRequest(command, manager, emit) {
|
|
|
7377
7498
|
if (readRange) {
|
|
7378
7499
|
const sizeFn2 = getAuthoritativeSize(entry.handle.state);
|
|
7379
7500
|
const chunk = await readMountRange(
|
|
7380
|
-
|
|
7501
|
+
actPath,
|
|
7381
7502
|
readRange,
|
|
7382
7503
|
sizeFn2 ? () => sizeFn2(reqPath ?? "") : void 0
|
|
7383
7504
|
);
|
|
@@ -7390,8 +7511,8 @@ async function handleMountResourceRequest(command, manager, emit) {
|
|
|
7390
7511
|
break;
|
|
7391
7512
|
}
|
|
7392
7513
|
const buf = await withFsDeadline(
|
|
7393
|
-
`readFile ${
|
|
7394
|
-
() => readFile(
|
|
7514
|
+
`readFile ${actPath}`,
|
|
7515
|
+
() => readFile(actPath),
|
|
7395
7516
|
fsDeadlineMs() * MOUNT_READ_DEADLINE_FACTOR
|
|
7396
7517
|
);
|
|
7397
7518
|
let bytes = buf;
|
|
@@ -7427,28 +7548,28 @@ async function handleMountResourceRequest(command, manager, emit) {
|
|
|
7427
7548
|
break;
|
|
7428
7549
|
}
|
|
7429
7550
|
case "write": {
|
|
7430
|
-
const parentDir = dirname(
|
|
7551
|
+
const parentDir = dirname(actPath);
|
|
7431
7552
|
await withFsDeadline(`mkdir ${parentDir}`, () => mkdir(parentDir, { recursive: true }));
|
|
7432
7553
|
const writeContent = typeof content === "string" ? content : content?.data ?? "";
|
|
7433
7554
|
const encoding = typeof content === "string" ? void 0 : content?.encoding;
|
|
7434
7555
|
await withFsDeadline(
|
|
7435
|
-
`writeFile ${
|
|
7436
|
-
() => encoding === "binary" ? writeFile(
|
|
7556
|
+
`writeFile ${actPath}`,
|
|
7557
|
+
() => encoding === "binary" ? writeFile(actPath, Buffer.from(writeContent, "base64")) : writeFile(actPath, writeContent, "utf-8")
|
|
7437
7558
|
);
|
|
7438
7559
|
data = true;
|
|
7439
7560
|
break;
|
|
7440
7561
|
}
|
|
7441
7562
|
case "write_range": {
|
|
7442
7563
|
if (rel === "") throw new Error("A file path is required");
|
|
7443
|
-
data = await writeRangeChunk(
|
|
7564
|
+
data = await writeRangeChunk(actPath, options, content);
|
|
7444
7565
|
break;
|
|
7445
7566
|
}
|
|
7446
7567
|
case "mkdir": {
|
|
7447
7568
|
if (rel === "") throw new Error("A folder path is required");
|
|
7448
|
-
const parentDir = dirname(
|
|
7569
|
+
const parentDir = dirname(actPath);
|
|
7449
7570
|
await withFsDeadline(`mkdir ${parentDir}`, () => mkdir(parentDir, { recursive: true }));
|
|
7450
7571
|
try {
|
|
7451
|
-
await withFsDeadline(`mkdir ${
|
|
7572
|
+
await withFsDeadline(`mkdir ${actPath}`, () => mkdir(actPath));
|
|
7452
7573
|
} catch (mkdirErr) {
|
|
7453
7574
|
if (mkdirErr.code === "EEXIST") {
|
|
7454
7575
|
throw new ResourceOperationError(
|
|
@@ -7463,7 +7584,7 @@ async function handleMountResourceRequest(command, manager, emit) {
|
|
|
7463
7584
|
}
|
|
7464
7585
|
case "stat": {
|
|
7465
7586
|
const statOptions = options;
|
|
7466
|
-
const st = await withFsDeadline(`stat ${
|
|
7587
|
+
const st = await withFsDeadline(`stat ${actPath}`, () => stat(actPath));
|
|
7467
7588
|
const isDir = st.isDirectory();
|
|
7468
7589
|
const result = {
|
|
7469
7590
|
name: rel === "" ? "" : basename(targetPath),
|
|
@@ -7476,7 +7597,7 @@ async function handleMountResourceRequest(command, manager, emit) {
|
|
|
7476
7597
|
const createdAt = isoTime(st.birthtime);
|
|
7477
7598
|
if (createdAt) result.createdAt = createdAt;
|
|
7478
7599
|
if (isDir && statOptions?.recursive) {
|
|
7479
|
-
result.totals = await computeDirectoryTotals(
|
|
7600
|
+
result.totals = await computeDirectoryTotals(actPath, {
|
|
7480
7601
|
includeHidden: Boolean(statOptions.includeHidden),
|
|
7481
7602
|
maxEntries: lowerCap(statOptions.maxEntries, MOUNT_STAT_MAX_ENTRIES),
|
|
7482
7603
|
budgetMs: lowerCap(statOptions.timeoutMs, MOUNT_STAT_BUDGET_MS),
|
|
@@ -7487,15 +7608,15 @@ async function handleMountResourceRequest(command, manager, emit) {
|
|
|
7487
7608
|
break;
|
|
7488
7609
|
}
|
|
7489
7610
|
case "delete": {
|
|
7490
|
-
const st = await withFsDeadline(`
|
|
7611
|
+
const st = await withFsDeadline(`lstat ${actPath}`, () => lstat(actPath));
|
|
7491
7612
|
if (st.isDirectory()) {
|
|
7492
7613
|
await withFsDeadline(
|
|
7493
|
-
`rm -r ${
|
|
7494
|
-
() => rm(
|
|
7614
|
+
`rm -r ${actPath}`,
|
|
7615
|
+
() => rm(actPath, { recursive: true, force: true }),
|
|
7495
7616
|
fsDeadlineMs() * MOUNT_TREE_OP_DEADLINE_FACTOR
|
|
7496
7617
|
);
|
|
7497
7618
|
} else {
|
|
7498
|
-
await withFsDeadline(`unlink ${
|
|
7619
|
+
await withFsDeadline(`unlink ${actPath}`, () => unlink(actPath));
|
|
7499
7620
|
}
|
|
7500
7621
|
data = true;
|
|
7501
7622
|
break;
|
|
@@ -7562,6 +7683,23 @@ async function readDanglingLink(absPath) {
|
|
|
7562
7683
|
}
|
|
7563
7684
|
return withFsDeadline(`readlink ${absPath}`, () => readlink(absPath));
|
|
7564
7685
|
}
|
|
7686
|
+
var MOUNT_WRITE_OPERATIONS = /* @__PURE__ */ new Set([
|
|
7687
|
+
"write",
|
|
7688
|
+
"write_range",
|
|
7689
|
+
"mkdir",
|
|
7690
|
+
"delete"
|
|
7691
|
+
]);
|
|
7692
|
+
async function resolveMountLink(realMount, linkPath) {
|
|
7693
|
+
try {
|
|
7694
|
+
const real = await withFsDeadline(`realpath ${linkPath}`, () => realpath(linkPath));
|
|
7695
|
+
if (!isWithin2(realMount, real)) return null;
|
|
7696
|
+
const st = await withFsDeadline(`stat ${real}`, () => stat(real));
|
|
7697
|
+
return { isDirectory: st.isDirectory() };
|
|
7698
|
+
} catch (err) {
|
|
7699
|
+
if (err instanceof FsDeadlineError) throw err;
|
|
7700
|
+
return null;
|
|
7701
|
+
}
|
|
7702
|
+
}
|
|
7565
7703
|
async function handleSessionRootResourceRequest(command, rootDir, emit) {
|
|
7566
7704
|
const { requestId, connectorId, operation, path: reqPath, content } = command;
|
|
7567
7705
|
try {
|
|
@@ -8328,6 +8466,46 @@ function createCoalescedTask(lock, fn) {
|
|
|
8328
8466
|
return run;
|
|
8329
8467
|
};
|
|
8330
8468
|
}
|
|
8469
|
+
|
|
8470
|
+
// runner/src/coalesced-restart.ts
|
|
8471
|
+
function createCoalescedRestartScheduler(deps) {
|
|
8472
|
+
const quietMs = deps.quietMs ?? 250;
|
|
8473
|
+
const maxWaitMs = deps.maxWaitMs ?? 2e3;
|
|
8474
|
+
const now = deps.now ?? Date.now;
|
|
8475
|
+
const sleep = deps.sleep ?? ((ms) => new Promise((resolve4) => setTimeout(resolve4, ms)));
|
|
8476
|
+
let open4 = null;
|
|
8477
|
+
return (reason) => {
|
|
8478
|
+
if (open4) {
|
|
8479
|
+
open4.reasons.push(reason);
|
|
8480
|
+
open4.lastJoinedAt = now();
|
|
8481
|
+
return;
|
|
8482
|
+
}
|
|
8483
|
+
const state = { reasons: [reason], lastJoinedAt: now() };
|
|
8484
|
+
open4 = state;
|
|
8485
|
+
const close = () => {
|
|
8486
|
+
if (open4 === state) open4 = null;
|
|
8487
|
+
};
|
|
8488
|
+
const batch = {
|
|
8489
|
+
settle: async () => {
|
|
8490
|
+
const deadline = now() + maxWaitMs;
|
|
8491
|
+
for (; ; ) {
|
|
8492
|
+
const wait = Math.min(state.lastJoinedAt + quietMs, deadline) - now();
|
|
8493
|
+
if (wait <= 0 || open4 !== state) break;
|
|
8494
|
+
await sleep(wait);
|
|
8495
|
+
}
|
|
8496
|
+
close();
|
|
8497
|
+
},
|
|
8498
|
+
reasons: () => state.reasons
|
|
8499
|
+
};
|
|
8500
|
+
let started;
|
|
8501
|
+
try {
|
|
8502
|
+
started = deps.start(batch);
|
|
8503
|
+
} catch (err) {
|
|
8504
|
+
started = Promise.reject(err);
|
|
8505
|
+
}
|
|
8506
|
+
void started.catch((err) => deps.onError(state.reasons, err)).finally(close);
|
|
8507
|
+
};
|
|
8508
|
+
}
|
|
8331
8509
|
async function recordStagedSkills(staged, projectDir, skillsDir, names, timeoutMs) {
|
|
8332
8510
|
for (const name of names) {
|
|
8333
8511
|
const path11 = join(projectDir, skillsDir, name);
|
|
@@ -9425,11 +9603,32 @@ DROP (omit entirely):
|
|
|
9425
9603
|
- Redundant back-and-forth (corrections already applied)
|
|
9426
9604
|
- Transient UI state
|
|
9427
9605
|
|
|
9606
|
+
## Conversation Language
|
|
9607
|
+
|
|
9608
|
+
Write the summary in the language the user writes in, not in English by
|
|
9609
|
+
default. If the user writes German, the whole summary is in German, section
|
|
9610
|
+
headings included. When users write in more than one language, use the
|
|
9611
|
+
language of the most recent message a user wrote before this compaction
|
|
9612
|
+
request (this request itself does not count). Do this even when a previous
|
|
9613
|
+
summary below is in another language: restate it in the conversation's
|
|
9614
|
+
language.
|
|
9615
|
+
|
|
9616
|
+
Keep file paths, code identifiers, commands, error messages and quoted user
|
|
9617
|
+
text exactly as they were -- never translate them.
|
|
9618
|
+
|
|
9619
|
+
Record the language explicitly in the "Conversation Language" section of the
|
|
9620
|
+
summary, so the agent keeps replying in it after the session is restored.
|
|
9621
|
+
|
|
9428
9622
|
## Format
|
|
9429
9623
|
|
|
9430
9624
|
Write a structured summary using these sections. Omit any section that
|
|
9431
9625
|
has no content.
|
|
9432
9626
|
|
|
9627
|
+
### Conversation Language
|
|
9628
|
+
The language the user writes in (for example "German"). Always include this
|
|
9629
|
+
section. If users write in more than one language, name each and say which
|
|
9630
|
+
one to reply in.
|
|
9631
|
+
|
|
9433
9632
|
### Goal
|
|
9434
9633
|
What the user is trying to accomplish.
|
|
9435
9634
|
|
|
@@ -10946,9 +11145,9 @@ function asDeclaration(declaration) {
|
|
|
10946
11145
|
}
|
|
10947
11146
|
return null;
|
|
10948
11147
|
}
|
|
10949
|
-
function isLive(
|
|
11148
|
+
function isLive(rm4, id) {
|
|
10950
11149
|
try {
|
|
10951
|
-
return typeof
|
|
11150
|
+
return typeof rm4.has === "function" && rm4.has(id);
|
|
10952
11151
|
} catch {
|
|
10953
11152
|
return false;
|
|
10954
11153
|
}
|
|
@@ -10959,8 +11158,8 @@ function toPreMinted(token) {
|
|
|
10959
11158
|
function buildSessionResourceHandlers(deps) {
|
|
10960
11159
|
const { getResourceManager, getPreMintedSecrets, emitResourcesAvailable, log, getProjectDir } = deps;
|
|
10961
11160
|
async function add(kind, input) {
|
|
10962
|
-
const
|
|
10963
|
-
if (!
|
|
11161
|
+
const rm4 = getResourceManager();
|
|
11162
|
+
if (!rm4) return { ok: false, code: "no_session", message: "session resources not ready" };
|
|
10964
11163
|
const decl = asDeclaration(input.declaration);
|
|
10965
11164
|
if (!decl) {
|
|
10966
11165
|
return { ok: false, code: "invalid_declaration", message: "declaration missing id/driver" };
|
|
@@ -10973,14 +11172,14 @@ function buildSessionResourceHandlers(deps) {
|
|
|
10973
11172
|
`[session-resource] preMintedToken provided but secret store not ready \u2014 ${kind}:${decl.id}`
|
|
10974
11173
|
);
|
|
10975
11174
|
}
|
|
10976
|
-
const wasLive = isLive(
|
|
11175
|
+
const wasLive = isLive(rm4, decl.id);
|
|
10977
11176
|
try {
|
|
10978
|
-
await
|
|
11177
|
+
await rm4.connect(decl);
|
|
10979
11178
|
} catch (err) {
|
|
10980
11179
|
if (input.preMintedToken) {
|
|
10981
11180
|
getPreMintedSecrets()?.unset(kind, decl.id);
|
|
10982
11181
|
}
|
|
10983
|
-
if (wasLive && !isLive(
|
|
11182
|
+
if (wasLive && !isLive(rm4, decl.id)) emitResourcesAvailable();
|
|
10984
11183
|
const message = err instanceof Error ? err.message : String(err);
|
|
10985
11184
|
log(`[session-resource] runner.add_${kind} failed for ${decl.id}: ${message}`);
|
|
10986
11185
|
return { ok: false, code: "connect_failed", message };
|
|
@@ -11013,8 +11212,8 @@ function buildSessionResourceHandlers(deps) {
|
|
|
11013
11212
|
message: `no materialized connector at ${join(root, name)}`
|
|
11014
11213
|
};
|
|
11015
11214
|
}
|
|
11016
|
-
const
|
|
11017
|
-
if (!
|
|
11215
|
+
const rm4 = getResourceManager();
|
|
11216
|
+
if (!rm4) return { ok: false, code: "no_session", message: "session resources not ready" };
|
|
11018
11217
|
if (preMintedToken) {
|
|
11019
11218
|
const ps = getPreMintedSecrets();
|
|
11020
11219
|
if (ps) ps.set("connector", decl.id, toPreMinted(preMintedToken));
|
|
@@ -11023,14 +11222,14 @@ function buildSessionResourceHandlers(deps) {
|
|
|
11023
11222
|
`[session-resource] preMintedToken provided but secret store not ready \u2014 connector:${decl.id}`
|
|
11024
11223
|
);
|
|
11025
11224
|
}
|
|
11026
|
-
const wasLive = isLive(
|
|
11225
|
+
const wasLive = isLive(rm4, decl.id);
|
|
11027
11226
|
try {
|
|
11028
|
-
await
|
|
11227
|
+
await rm4.connect(decl);
|
|
11029
11228
|
} catch (err) {
|
|
11030
11229
|
if (preMintedToken) {
|
|
11031
11230
|
getPreMintedSecrets()?.unset("connector", decl.id);
|
|
11032
11231
|
}
|
|
11033
|
-
if (wasLive && !isLive(
|
|
11232
|
+
if (wasLive && !isLive(rm4, decl.id)) emitResourcesAvailable();
|
|
11034
11233
|
const message = err instanceof Error ? err.message : String(err);
|
|
11035
11234
|
log(`[session-resource] runner.attach_instance connector failed for ${decl.id}: ${message}`);
|
|
11036
11235
|
return { ok: false, code: "connector_connect_failed", message };
|
|
@@ -11044,13 +11243,13 @@ function buildSessionResourceHandlers(deps) {
|
|
|
11044
11243
|
addMount: (input) => add("mount", input),
|
|
11045
11244
|
attachConnectorInstance,
|
|
11046
11245
|
removeResource: async (input) => {
|
|
11047
|
-
const
|
|
11048
|
-
if (!
|
|
11049
|
-
if (!
|
|
11246
|
+
const rm4 = getResourceManager();
|
|
11247
|
+
if (!rm4) return { ok: false, code: "no_session", message: "session resources not ready" };
|
|
11248
|
+
if (!rm4.has(input.id)) {
|
|
11050
11249
|
return { ok: false, code: "not_found", message: `no resource with id ${input.id}` };
|
|
11051
11250
|
}
|
|
11052
11251
|
try {
|
|
11053
|
-
await
|
|
11252
|
+
await rm4.disconnect(input.id);
|
|
11054
11253
|
} catch (err) {
|
|
11055
11254
|
const message = err instanceof Error ? err.message : String(err);
|
|
11056
11255
|
log(`[session-resource] runner.remove_resource failed for ${input.id}: ${message}`);
|
|
@@ -11066,8 +11265,8 @@ function buildSessionResourceHandlers(deps) {
|
|
|
11066
11265
|
updateCredential: async (input) => {
|
|
11067
11266
|
const ps = getPreMintedSecrets();
|
|
11068
11267
|
if (!ps) return { ok: false, code: "no_session", message: "session resources not ready" };
|
|
11069
|
-
const
|
|
11070
|
-
if (
|
|
11268
|
+
const rm4 = getResourceManager();
|
|
11269
|
+
if (rm4 && !rm4.has(input.id)) {
|
|
11071
11270
|
return { ok: false, code: "not_found", message: `no resource with id ${input.id}` };
|
|
11072
11271
|
}
|
|
11073
11272
|
ps.set(input.kind, input.id, input.mint);
|
|
@@ -11078,6 +11277,13 @@ function buildSessionResourceHandlers(deps) {
|
|
|
11078
11277
|
}
|
|
11079
11278
|
|
|
11080
11279
|
// runner/src/mcp-runtime-handlers.ts
|
|
11280
|
+
function invalidAssetName(name) {
|
|
11281
|
+
if (!name) return "name is required";
|
|
11282
|
+
if (name === "." || name.includes("/") || name.includes("\\") || name.includes("..")) {
|
|
11283
|
+
return "name must not contain path separators or traversal segments";
|
|
11284
|
+
}
|
|
11285
|
+
return null;
|
|
11286
|
+
}
|
|
11081
11287
|
function buildMcpRuntimeHandlers(deps) {
|
|
11082
11288
|
const resolveManager = () => {
|
|
11083
11289
|
try {
|
|
@@ -11136,16 +11342,8 @@ function buildMcpRuntimeHandlers(deps) {
|
|
|
11136
11342
|
message: `attach_instance supports mcp-server only; '${input.kind}' is not yet supported`
|
|
11137
11343
|
};
|
|
11138
11344
|
}
|
|
11139
|
-
|
|
11140
|
-
|
|
11141
|
-
}
|
|
11142
|
-
if (input.name.includes("/") || input.name.includes("\\") || input.name.includes("..")) {
|
|
11143
|
-
return {
|
|
11144
|
-
ok: false,
|
|
11145
|
-
code: "invalid_input",
|
|
11146
|
-
message: "name must not contain path separators or traversal segments"
|
|
11147
|
-
};
|
|
11148
|
-
}
|
|
11345
|
+
const invalidName = invalidAssetName(input.name);
|
|
11346
|
+
if (invalidName) return { ok: false, code: "invalid_input", message: invalidName };
|
|
11149
11347
|
if (!deps.getProjectDir) {
|
|
11150
11348
|
return { ok: false, code: "no_project_dir", message: "getProjectDir not configured" };
|
|
11151
11349
|
}
|
|
@@ -11177,6 +11375,65 @@ function buildMcpRuntimeHandlers(deps) {
|
|
|
11177
11375
|
const code = err instanceof McpServerAlreadyRegisteredError ? "mcp_already_registered" : "mcp_connect_failed";
|
|
11178
11376
|
return { ok: false, code, message };
|
|
11179
11377
|
}
|
|
11378
|
+
},
|
|
11379
|
+
// Order matters: the on-disk asset and the live-attach record go first, so
|
|
11380
|
+
// a session rebuild that starts meanwhile cannot respawn the server.
|
|
11381
|
+
detachInstance: async (input) => {
|
|
11382
|
+
if (input.kind !== "mcp-server") {
|
|
11383
|
+
return {
|
|
11384
|
+
ok: false,
|
|
11385
|
+
code: "unsupported_kind",
|
|
11386
|
+
message: `detach_instance supports mcp-server here; '${input.kind}' is not`
|
|
11387
|
+
};
|
|
11388
|
+
}
|
|
11389
|
+
const invalid = invalidAssetName(input.name);
|
|
11390
|
+
if (invalid) return { ok: false, code: "invalid_input", message: invalid };
|
|
11391
|
+
if (!deps.unregisterLiveAttachedMcp) {
|
|
11392
|
+
return {
|
|
11393
|
+
ok: false,
|
|
11394
|
+
code: "not_implemented",
|
|
11395
|
+
message: "detach_instance for mcp-server is not configured"
|
|
11396
|
+
};
|
|
11397
|
+
}
|
|
11398
|
+
const mgr = resolveManager();
|
|
11399
|
+
if (!mgr) return { ok: false, code: "no_session", message: "session resources not ready" };
|
|
11400
|
+
const id = input.name;
|
|
11401
|
+
if (deps.getProjectDir) {
|
|
11402
|
+
const assetDir = join(deps.getProjectDir(), ".skaile/assets/mcp-server", id);
|
|
11403
|
+
try {
|
|
11404
|
+
await rm(assetDir, { recursive: true, force: true });
|
|
11405
|
+
} catch (err) {
|
|
11406
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
11407
|
+
deps.log(`[mcp-runtime] runner.detach_instance could not remove ${assetDir}: ${message}`);
|
|
11408
|
+
return { ok: false, code: "asset_remove_failed", message };
|
|
11409
|
+
}
|
|
11410
|
+
}
|
|
11411
|
+
deps.unregisterLiveAttachedMcp(id);
|
|
11412
|
+
const wasConnected = mgr.listServers().some((s) => s.id === id);
|
|
11413
|
+
try {
|
|
11414
|
+
await mgr.removeServer(id);
|
|
11415
|
+
} catch (err) {
|
|
11416
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
11417
|
+
deps.log(`[mcp-runtime] runner.detach_instance failed to remove ${id}: ${message}`);
|
|
11418
|
+
return { ok: false, code: "mcp_remove_failed", message };
|
|
11419
|
+
}
|
|
11420
|
+
deps.getPreMintedSecrets()?.unset("mcp", id);
|
|
11421
|
+
let live = true;
|
|
11422
|
+
if (wasConnected && !deps.driverPicksUpToolsLive()) {
|
|
11423
|
+
live = false;
|
|
11424
|
+
try {
|
|
11425
|
+
deps.scheduleDriverRestartForToolChanges(`MCP server '${id}' removal`);
|
|
11426
|
+
} catch (err) {
|
|
11427
|
+
deps.log(
|
|
11428
|
+
`[mcp-runtime] scheduling the restart for ${id} failed: ${err instanceof Error ? err.message : String(err)}`
|
|
11429
|
+
);
|
|
11430
|
+
}
|
|
11431
|
+
}
|
|
11432
|
+
deps.emitResourcesAvailable();
|
|
11433
|
+
deps.log(
|
|
11434
|
+
wasConnected ? `[mcp-runtime] runner.detach_instance removed ${id}${live ? "" : " (driver restart queued)"}` : `[mcp-runtime] runner.detach_instance: ${id} was not connected; records cleared`
|
|
11435
|
+
);
|
|
11436
|
+
return { ok: true, id, removed: wasConnected, live };
|
|
11180
11437
|
}
|
|
11181
11438
|
};
|
|
11182
11439
|
}
|
|
@@ -11286,7 +11543,6 @@ function buildRunnerCapabilities(handlers) {
|
|
|
11286
11543
|
});
|
|
11287
11544
|
}
|
|
11288
11545
|
}),
|
|
11289
|
-
// TODO(mcp-detach): no runner.remove_mcp_server yet — live MCP detach + mcp: credential cleanup deferred with the attach-by-ref rework.
|
|
11290
11546
|
defineCapability({
|
|
11291
11547
|
name: "runner.add_mcp_server",
|
|
11292
11548
|
displayName: "Add MCP server",
|
|
@@ -11325,7 +11581,7 @@ function buildRunnerCapabilities(handlers) {
|
|
|
11325
11581
|
defineCapability({
|
|
11326
11582
|
name: "runner.detach_instance",
|
|
11327
11583
|
displayName: "Detach instance",
|
|
11328
|
-
description: "Unload an instance the platform unassigned from the live session.
|
|
11584
|
+
description: "Unload an instance the platform unassigned from the live session. kind 'skill': removes the runner-staged copy and materialized asset, then restarts the driver without killing an in-flight turn; a same-named dir the runner did not stage is left in place (reason: not_staged). kind 'mcp-server': removes the server's tools, its mcp: credential and its materialized asset; restarts the driver (once per burst of detaches) only when the driver cannot drop tools live.",
|
|
11329
11585
|
side: "agent",
|
|
11330
11586
|
origin: RUNNER_CAP_ORIGIN,
|
|
11331
11587
|
audience: ["runtime"],
|
|
@@ -11398,9 +11654,7 @@ function buildRunnerCapabilities(handlers) {
|
|
|
11398
11654
|
kind: "effect",
|
|
11399
11655
|
input: setStateInput,
|
|
11400
11656
|
handler: async (input) => {
|
|
11401
|
-
if (!handlers.setState)
|
|
11402
|
-
return notImplemented("runner.set_state");
|
|
11403
|
-
}
|
|
11657
|
+
if (!handlers.setState) return notImplemented("runner.set_state");
|
|
11404
11658
|
return handlers.setState({
|
|
11405
11659
|
store: input.store,
|
|
11406
11660
|
key: input.key,
|
|
@@ -11451,6 +11705,7 @@ function wireSessionCapabilities(deps) {
|
|
|
11451
11705
|
capabilityRegistry,
|
|
11452
11706
|
remoteCapabilityInvoker,
|
|
11453
11707
|
getResourceManager,
|
|
11708
|
+
isSharedStateStore,
|
|
11454
11709
|
getPreMintedSecrets,
|
|
11455
11710
|
emitResourcesAvailable,
|
|
11456
11711
|
driverPicksUpToolsLive,
|
|
@@ -11460,6 +11715,7 @@ function wireSessionCapabilities(deps) {
|
|
|
11460
11715
|
attachSkillInstance,
|
|
11461
11716
|
detachSkillInstance,
|
|
11462
11717
|
registerLiveAttachedMcp,
|
|
11718
|
+
unregisterLiveAttachedMcp,
|
|
11463
11719
|
scheduleDriverRestartForToolChanges,
|
|
11464
11720
|
getDriver,
|
|
11465
11721
|
rememberReconfigure,
|
|
@@ -11478,6 +11734,7 @@ function wireSessionCapabilities(deps) {
|
|
|
11478
11734
|
getPreMintedSecrets: () => getPreMintedSecrets() ?? null,
|
|
11479
11735
|
driverPicksUpToolsLive,
|
|
11480
11736
|
registerLiveAttachedMcp,
|
|
11737
|
+
unregisterLiveAttachedMcp,
|
|
11481
11738
|
scheduleDriverRestartForToolChanges,
|
|
11482
11739
|
emitResourcesAvailable,
|
|
11483
11740
|
log,
|
|
@@ -11502,20 +11759,52 @@ function wireSessionCapabilities(deps) {
|
|
|
11502
11759
|
message: "attach_instance handler not configured"
|
|
11503
11760
|
};
|
|
11504
11761
|
},
|
|
11505
|
-
//
|
|
11506
|
-
// through remove_resource
|
|
11762
|
+
// Skills and MCP servers have a live unload path; a connector or mount
|
|
11763
|
+
// detaches through remove_resource.
|
|
11507
11764
|
detachInstance: async (input) => {
|
|
11508
11765
|
if (input.kind === "skill") {
|
|
11509
11766
|
return detachSkillInstance(input.name);
|
|
11510
11767
|
}
|
|
11768
|
+
if (input.kind === "mcp-server" && mcpHandlers.detachInstance) {
|
|
11769
|
+
return mcpHandlers.detachInstance(input);
|
|
11770
|
+
}
|
|
11511
11771
|
return {
|
|
11512
11772
|
ok: false,
|
|
11513
11773
|
code: "unsupported_kind",
|
|
11514
11774
|
message: `detach_instance does not support kind "${input.kind}"`
|
|
11515
11775
|
};
|
|
11516
11776
|
},
|
|
11517
|
-
// setLogLevel left undefined (the cap self-falls-back to getLogStore)
|
|
11518
|
-
|
|
11777
|
+
// setLogLevel left undefined (the cap self-falls-back to getLogStore).
|
|
11778
|
+
setState: async (input) => {
|
|
11779
|
+
const rm4 = getResourceManager();
|
|
11780
|
+
if (!rm4) return { ok: false, code: "no_session", message: "session resources not ready" };
|
|
11781
|
+
if (!isSharedStateStore(input.store) || !rm4.has(input.store)) {
|
|
11782
|
+
return {
|
|
11783
|
+
ok: false,
|
|
11784
|
+
code: "store_not_found",
|
|
11785
|
+
message: `no shared state store "${input.store}" \u2014 declare it in session_init.sharedState`
|
|
11786
|
+
};
|
|
11787
|
+
}
|
|
11788
|
+
const connector = rm4.get(input.store).connector;
|
|
11789
|
+
if (typeof connector.onStoreChange !== "function") {
|
|
11790
|
+
return {
|
|
11791
|
+
ok: false,
|
|
11792
|
+
code: "not_a_state_store",
|
|
11793
|
+
message: `"${input.store}" is not a shared state store`
|
|
11794
|
+
};
|
|
11795
|
+
}
|
|
11796
|
+
try {
|
|
11797
|
+
await rm4.executeOp(input.store, "set", {
|
|
11798
|
+
key: input.key,
|
|
11799
|
+
value: typeof input.value === "string" ? JSON.stringify(input.value) : input.value
|
|
11800
|
+
});
|
|
11801
|
+
} catch (err) {
|
|
11802
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
11803
|
+
log(`[session-state] runner.set_state failed for ${input.store}: ${message}`);
|
|
11804
|
+
return { ok: false, code: "set_failed", message };
|
|
11805
|
+
}
|
|
11806
|
+
return { ok: true };
|
|
11807
|
+
},
|
|
11519
11808
|
lifecycle: buildLifecycleHandler({
|
|
11520
11809
|
getCompactionOrchestrator,
|
|
11521
11810
|
getResourceManager,
|
|
@@ -12777,7 +13066,8 @@ async function startAgentServer(opts) {
|
|
|
12777
13066
|
port,
|
|
12778
13067
|
onLog: log,
|
|
12779
13068
|
...opts.host ? { host: opts.host } : {},
|
|
12780
|
-
...authToken ? { authToken } : {}
|
|
13069
|
+
...authToken ? { authToken } : {},
|
|
13070
|
+
...opts.onListening ? { onListening: opts.onListening } : {}
|
|
12781
13071
|
});
|
|
12782
13072
|
logStore.addSink(
|
|
12783
13073
|
new WsLogSink({
|
|
@@ -13373,6 +13663,12 @@ async function startAgentServer(opts) {
|
|
|
13373
13663
|
liveAttachedMcpDeclarations.set(decl.id, decl);
|
|
13374
13664
|
bakedMcpServerIds = /* @__PURE__ */ new Set([...bakedMcpServerIds, decl.id]);
|
|
13375
13665
|
};
|
|
13666
|
+
const unregisterLiveAttachedMcp = (id) => {
|
|
13667
|
+
liveAttachedMcpDeclarations.delete(id);
|
|
13668
|
+
if (bakedMcpServerIds.has(id)) {
|
|
13669
|
+
bakedMcpServerIds = new Set([...bakedMcpServerIds].filter((baked) => baked !== id));
|
|
13670
|
+
}
|
|
13671
|
+
};
|
|
13376
13672
|
const modelEndpointConfig = {
|
|
13377
13673
|
...wsConfig.model_endpoint,
|
|
13378
13674
|
...opts.modelEndpoint
|
|
@@ -13534,6 +13830,7 @@ async function startAgentServer(opts) {
|
|
|
13534
13830
|
logPhase
|
|
13535
13831
|
});
|
|
13536
13832
|
let driverRestartChain = Promise.resolve();
|
|
13833
|
+
let toolRestartScheduler;
|
|
13537
13834
|
let liveDriverActiveAfterTurn = false;
|
|
13538
13835
|
let driver = secretsMode === "env" ? agentSession.driver : void 0;
|
|
13539
13836
|
let secretsProvisioned = secretsMode === "env";
|
|
@@ -14115,6 +14412,7 @@ async function startAgentServer(opts) {
|
|
|
14115
14412
|
capabilityRegistry,
|
|
14116
14413
|
remoteCapabilityInvoker,
|
|
14117
14414
|
getResourceManager: () => resourceManager,
|
|
14415
|
+
isSharedStateStore: (id) => lastInitSharedState?.some((c) => c.id === id) ?? false,
|
|
14118
14416
|
getPreMintedSecrets: () => preMintedSecrets,
|
|
14119
14417
|
emitResourcesAvailable,
|
|
14120
14418
|
driverPicksUpToolsLive,
|
|
@@ -14124,6 +14422,7 @@ async function startAgentServer(opts) {
|
|
|
14124
14422
|
attachSkillInstance,
|
|
14125
14423
|
detachSkillInstance,
|
|
14126
14424
|
registerLiveAttachedMcp,
|
|
14425
|
+
unregisterLiveAttachedMcp,
|
|
14127
14426
|
scheduleDriverRestartForToolChanges,
|
|
14128
14427
|
getDriver: () => driver ?? null,
|
|
14129
14428
|
rememberReconfigure: (patch) => {
|
|
@@ -14189,8 +14488,9 @@ async function startAgentServer(opts) {
|
|
|
14189
14488
|
}
|
|
14190
14489
|
return { needsWireFallbackRecreate, needsWireAgentConfigRecreate };
|
|
14191
14490
|
}
|
|
14192
|
-
async function recreateAgentSession(overrides) {
|
|
14491
|
+
async function recreateAgentSession(overrides, opts2) {
|
|
14193
14492
|
return turnScheduler.runSwap(async () => {
|
|
14493
|
+
await opts2?.settle?.();
|
|
14194
14494
|
const resolved = typeof overrides === "function" ? overrides() : overrides;
|
|
14195
14495
|
if (!resolved) return false;
|
|
14196
14496
|
await recreateAgentSessionInner(resolved);
|
|
@@ -14503,20 +14803,27 @@ async function startAgentServer(opts) {
|
|
|
14503
14803
|
return detachStagedSkill(skillStagingDeps, name);
|
|
14504
14804
|
}
|
|
14505
14805
|
async function restartDriverForToolChanges(reason) {
|
|
14806
|
+
const batch = typeof reason === "string" ? void 0 : reason;
|
|
14807
|
+
const label = () => batch ? batch.reasons().join(", ") : reason;
|
|
14506
14808
|
if (!driverStarted) {
|
|
14507
|
-
log(`[serve] ${
|
|
14809
|
+
log(`[serve] ${label()} applied before driver start \u2014 picked up on the first prompt`);
|
|
14508
14810
|
return;
|
|
14509
14811
|
}
|
|
14510
|
-
await recreateAgentSession(
|
|
14511
|
-
|
|
14512
|
-
|
|
14513
|
-
|
|
14514
|
-
|
|
14515
|
-
|
|
14516
|
-
|
|
14517
|
-
|
|
14518
|
-
|
|
14519
|
-
|
|
14812
|
+
await recreateAgentSession(
|
|
14813
|
+
() => {
|
|
14814
|
+
if (!driverStarted) {
|
|
14815
|
+
log(
|
|
14816
|
+
`[serve] ${label()} applied after an earlier recreate \u2014 picked up on the first prompt`
|
|
14817
|
+
);
|
|
14818
|
+
return null;
|
|
14819
|
+
}
|
|
14820
|
+
const prevSessionId = driver.runtimeSessionId;
|
|
14821
|
+
log(`[serve] restarting driver to pick up ${label()} (resume=${prevSessionId ?? "none"})`);
|
|
14822
|
+
markPhase(`driver restart: ${label()}`);
|
|
14823
|
+
return { resumeSessionId: prevSessionId };
|
|
14824
|
+
},
|
|
14825
|
+
batch ? { settle: () => batch.settle() } : void 0
|
|
14826
|
+
);
|
|
14520
14827
|
}
|
|
14521
14828
|
function enqueueDriverRestart(reason) {
|
|
14522
14829
|
const next = driverRestartChain.then(() => restartDriverForToolChanges(reason));
|
|
@@ -14525,11 +14832,13 @@ async function startAgentServer(opts) {
|
|
|
14525
14832
|
return next;
|
|
14526
14833
|
}
|
|
14527
14834
|
function scheduleDriverRestartForToolChanges(reason) {
|
|
14528
|
-
|
|
14529
|
-
|
|
14530
|
-
|
|
14531
|
-
|
|
14835
|
+
toolRestartScheduler ??= createCoalescedRestartScheduler({
|
|
14836
|
+
start: (batch) => enqueueDriverRestart(batch),
|
|
14837
|
+
onError: (reasons, err) => log(
|
|
14838
|
+
`[serve] background driver restart for ${reasons.join(", ")} failed: ${err instanceof Error ? err.message : String(err)}`
|
|
14839
|
+
)
|
|
14532
14840
|
});
|
|
14841
|
+
toolRestartScheduler(reason);
|
|
14533
14842
|
}
|
|
14534
14843
|
async function restartDriverForSkillChanges(catalogActions) {
|
|
14535
14844
|
const restarted = driverStarted;
|
|
@@ -15645,6 +15954,6 @@ function touchSession(state) {
|
|
|
15645
15954
|
return { ...state, updatedAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
15646
15955
|
}
|
|
15647
15956
|
|
|
15648
|
-
export { AgentRunError, CLAUDE_CODE_CREDENTIALS_KEY, COMPILE_MANIFEST_FILENAME, CONNECTOR_MUTATE_NOT_READY, CapabilityRegistry, CompileManifestEntrySchema, CompositionError, DEFAULT_CAPABILITY_CALL_TIMEOUT_MS, DEFAULT_COALESCE_MS, DEFAULT_FLOW_MUTATE_CONNECTOR_WAIT_MS, DEFAULT_MAX_FINISHED_TREES, DEFAULT_RUN_LIMITS, MOUNT_LIST_MAX_DEPTH, MOUNT_LIST_MAX_ENTRIES, MOUNT_READ_DEADLINE_FACTOR, MOUNT_READ_MAX_CHUNK_BYTES, MOUNT_STAT_BUDGET_MS, MOUNT_STAT_MAX_ENTRIES, MOUNT_TREE_OP_DEADLINE_FACTOR, MOUNT_WRITE_MAX_CHUNK_BYTES, MarkdownStreamer, PreInitRingSink, ResourceOperationError, SESSION_ROOT_WRITABLE_DIRS, SESSION_ROOT_WRITABLE_FILES, UnknownCompositionKindError, WRITE_RANGE_PARTIAL_TTL_MS, WS_AUTH_TOKEN_ENV, WS_AUTH_TOKEN_FILE_ENV, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildCompositionRunSnapshot, buildConnectorTokenMediator, buildContextSection, buildEnvironmentSection, buildResourcesAvailablePayload, buildRunnerAgentSections, buildStoreSnapshotReplay, builtinCapabilities, canonicalJson, capabilityLogInstance, capabilitySignatureInputs, clearPreInitRingSink, clearSession, compileComposition, compositionRunSnapshotPath, computeCapabilitySignature, computeDirectoryTotals, computeRevisionHash, connectorRefreshKind, createAgentSession, createCompositionContentSource, createFinalTextFallback, createFlowConnectorReadiness, createInMemoryRunStore, createManagedCodexSubpromptDriver, createRunController, createSessionStimulusBus, defineCapability, deleteSession, describeComposition, dispatchResourceRequest, dispatchRunnerCapabilityInvocation, driverActiveAfterTurnEnd, emitSystemPromptComposed, ensureClaudeSettingsDisablesConnectors, ensureGitConfigInclude, executeConnectorMutate, extractClaudeAiOauthExpiresAt, flowStartNeedsDriverRestart, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, handleSessionRootResourceRequest, hasNonTerminalFlow, hashAgentFiles, hashContent, hostOpResumeStimulus, installPreInitRingSink, instanceForSession, isCompositionError, isEmptyKnowledgeIndex, isSessionRootPathAllowed, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadCompositionRunSnapshot, loadKnowledgeDir, loadManagedCodexHostConfig, loadSession, loadSessionById, mcpAuthSecretKey, newSession, nulTailPaddingLength, pickChatFlowTarget, pickFlowToolTarget, pickRepointedManager, planFlowMutate, prepareCodexTools, reconcilePendingDecisions, reconnectedRunNeedsAgentTurn, recreateKeepingLiveFlows, registerActiveFlow, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, rejectPendingCapabilityCallsOnDisconnect, resetRunnerLogStore, resolveAgentInstance, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveFlowMutateConnectorWaitMs, resolveMixin, resolveSessionId, restoredRunHasWorkToResume, runAgentChat, saveCompositionRunSnapshot, saveSession, setCurrentSession, setUpFlowConnector, startAgentServer, stimulusFromMetas, stripFrontmatter, takeRunnerWsAuthToken, toActiveFlowTarget, touchSession, unresolvedCredentialNotices, validateInputResponse, verifyConventionItems, writeClaudeCodeCredentialsFile, writeRangeChunk, writeRangePartialPath };
|
|
15649
|
-
//# sourceMappingURL=chunk-
|
|
15650
|
-
//# sourceMappingURL=chunk-
|
|
15957
|
+
export { AgentRunError, CLAUDE_CODE_CREDENTIALS_KEY, COMPILE_MANIFEST_FILENAME, CONNECTOR_MUTATE_NOT_READY, CapabilityRegistry, CompileManifestEntrySchema, CompositionError, DEFAULT_CAPABILITY_CALL_TIMEOUT_MS, DEFAULT_COALESCE_MS, DEFAULT_FLOW_MUTATE_CONNECTOR_WAIT_MS, DEFAULT_MAX_FINISHED_TREES, DEFAULT_RUN_LIMITS, MOUNT_LIST_MAX_DEPTH, MOUNT_LIST_MAX_ENTRIES, MOUNT_READ_DEADLINE_FACTOR, MOUNT_READ_MAX_CHUNK_BYTES, MOUNT_STAT_BUDGET_MS, MOUNT_STAT_MAX_ENTRIES, MOUNT_TREE_OP_DEADLINE_FACTOR, MOUNT_WRITE_MAX_CHUNK_BYTES, MarkdownStreamer, PreInitRingSink, ResourceOperationError, SESSION_ROOT_WRITABLE_DIRS, SESSION_ROOT_WRITABLE_FILES, UnknownCompositionKindError, WRITE_RANGE_PARTIAL_TTL_MS, WS_AUTH_TOKEN_ENV, WS_AUTH_TOKEN_FILE_ENV, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildCompositionRunSnapshot, buildConnectorTokenMediator, buildContextSection, buildEnvironmentSection, buildResourcesAvailablePayload, buildRunnerAgentSections, buildStoreSnapshotReplay, builtinCapabilities, canonicalJson, capabilityLogInstance, capabilitySignatureInputs, clearPreInitRingSink, clearSession, compileComposition, compositionRunSnapshotPath, computeCapabilitySignature, computeDirectoryTotals, computeRevisionHash, connectorRefreshKind, createAgentSession, createCompositionContentSource, createFinalTextFallback, createFlowConnectorReadiness, createInMemoryRunStore, createManagedCodexSubpromptDriver, createRunController, createSessionStimulusBus, defineCapability, deleteSession, describeComposition, dispatchResourceRequest, dispatchRunnerCapabilityInvocation, driverActiveAfterTurnEnd, emitSystemPromptComposed, ensureClaudeSettingsDisablesConnectors, ensureGitConfigInclude, executeConnectorMutate, extractClaudeAiOauthExpiresAt, flowStartNeedsDriverRestart, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, handleSessionRootResourceRequest, hasNonTerminalFlow, hashAgentFiles, hashContent, hostOpResumeStimulus, installPreInitRingSink, instanceForSession, instanceSessionOverrides, isCompositionError, isEmptyKnowledgeIndex, isSessionRootPathAllowed, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadCompositionRunSnapshot, loadKnowledgeDir, loadManagedCodexHostConfig, loadSession, loadSessionById, manifestModelForDriver, mcpAuthSecretKey, newSession, nulTailPaddingLength, pickChatFlowTarget, pickFlowToolTarget, pickRepointedManager, planFlowMutate, prepareCodexTools, reconcilePendingDecisions, reconnectedRunNeedsAgentTurn, recreateKeepingLiveFlows, registerActiveFlow, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, rejectPendingCapabilityCallsOnDisconnect, resetRunnerLogStore, resolveAgentInstance, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveFlowMutateConnectorWaitMs, resolveInstanceAgentDir, resolveMixin, resolveSessionId, restoredRunHasWorkToResume, runAgentChat, saveCompositionRunSnapshot, saveSession, setCurrentSession, setUpFlowConnector, startAgentServer, stimulusFromMetas, stripFrontmatter, takeRunnerWsAuthToken, toActiveFlowTarget, touchSession, unresolvedCredentialNotices, validateInputResponse, verifyConventionItems, writeClaudeCodeCredentialsFile, writeRangeChunk, writeRangePartialPath };
|
|
15958
|
+
//# sourceMappingURL=chunk-EOKWTN4N.js.map
|
|
15959
|
+
//# sourceMappingURL=chunk-EOKWTN4N.js.map
|