@skaile/workspaces 4.35.0 → 4.37.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 +42 -0
- package/dist/app-sdk/index.js +1 -1
- package/dist/{asset-feeds-NL3526ZV.js → asset-feeds-KTRFFJYM.js} +10 -10
- package/dist/{asset-feeds-NL3526ZV.js.map → asset-feeds-KTRFFJYM.js.map} +1 -1
- package/dist/asset-manager/catalog-deployer.js +5 -5
- package/dist/asset-manager/index.js +10 -10
- package/dist/asset-manager/installer.js +7 -7
- package/dist/asset-manager/renderers.js +2 -2
- package/dist/asset-manager/src/index.d.ts +18 -0
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/asset-manager/src/mcp-config.d.ts.map +1 -1
- package/dist/bridge/drivers/claude-sdk.js +14 -11
- package/dist/bridge/drivers/claude-sdk.js.map +1 -1
- package/dist/bridge/drivers/codex.js +7 -7
- package/dist/bridge/drivers/continue.js +8 -8
- package/dist/bridge/drivers/echo.js +3 -3
- package/dist/bridge/drivers/gemini.js +6 -6
- package/dist/bridge/drivers/goose.js +8 -8
- package/dist/bridge/drivers/omp.js +9 -6
- package/dist/bridge/drivers/omp.js.map +1 -1
- package/dist/bridge/drivers/opencode.js +8 -8
- package/dist/bridge/drivers/qwen.js +6 -6
- package/dist/bridge/index.js +11 -11
- package/dist/bridge/src/drivers/claude-sdk.d.ts +1 -0
- package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
- package/dist/bridge/src/drivers/omp.d.ts +3 -2
- package/dist/bridge/src/drivers/omp.d.ts.map +1 -1
- package/dist/bridge/src/types.d.ts +8 -0
- package/dist/bridge/src/types.d.ts.map +1 -1
- package/dist/{chunk-TGE33MKN.js → chunk-2D3C4AJP.js} +4 -2
- package/dist/chunk-2D3C4AJP.js.map +1 -0
- package/dist/{chunk-ZWTCXL3H.js → chunk-2QYQOJ2F.js} +3 -3
- package/dist/{chunk-ZWTCXL3H.js.map → chunk-2QYQOJ2F.js.map} +1 -1
- package/dist/{chunk-T3YUSWVK.js → chunk-3SUWLY3H.js} +3 -3
- package/dist/{chunk-T3YUSWVK.js.map → chunk-3SUWLY3H.js.map} +1 -1
- package/dist/{chunk-Q6NDQ6BH.js → chunk-5JAO4MXA.js} +3 -3
- package/dist/{chunk-Q6NDQ6BH.js.map → chunk-5JAO4MXA.js.map} +1 -1
- package/dist/{chunk-NVQLE4MK.js → chunk-5SGS5SN2.js} +4 -4
- package/dist/{chunk-NVQLE4MK.js.map → chunk-5SGS5SN2.js.map} +1 -1
- package/dist/{chunk-RHESVS7V.js → chunk-7YCPY6NC.js} +6 -6
- package/dist/{chunk-RHESVS7V.js.map → chunk-7YCPY6NC.js.map} +1 -1
- package/dist/{chunk-N2UGG6WV.js → chunk-A5RRXBLI.js} +5 -5
- package/dist/{chunk-N2UGG6WV.js.map → chunk-A5RRXBLI.js.map} +1 -1
- package/dist/{chunk-DOF77WEV.js → chunk-BSIHJZKN.js} +6 -6
- package/dist/{chunk-DOF77WEV.js.map → chunk-BSIHJZKN.js.map} +1 -1
- package/dist/{chunk-VOXFI3XS.js → chunk-DFZDL62S.js} +4 -4
- package/dist/{chunk-VOXFI3XS.js.map → chunk-DFZDL62S.js.map} +1 -1
- package/dist/{chunk-XTOTP7MJ.js → chunk-ENXE4BKS.js} +2 -2
- package/dist/{chunk-XTOTP7MJ.js.map → chunk-ENXE4BKS.js.map} +1 -1
- package/dist/{chunk-3ELIPWCH.js → chunk-FJYOQMXT.js} +4 -4
- package/dist/{chunk-3ELIPWCH.js.map → chunk-FJYOQMXT.js.map} +1 -1
- package/dist/{chunk-7HJ6SFFF.js → chunk-FLGLODDF.js} +3 -3
- package/dist/{chunk-7HJ6SFFF.js.map → chunk-FLGLODDF.js.map} +1 -1
- package/dist/{chunk-TGJIX77V.js → chunk-FZFCOQTI.js} +3 -3
- package/dist/{chunk-TGJIX77V.js.map → chunk-FZFCOQTI.js.map} +1 -1
- package/dist/{chunk-P2DLXBZK.js → chunk-H3KXUUYQ.js} +4 -4
- package/dist/{chunk-P2DLXBZK.js.map → chunk-H3KXUUYQ.js.map} +1 -1
- package/dist/{chunk-AKO6XHGV.js → chunk-KN5Y5BXK.js} +5 -5
- package/dist/{chunk-AKO6XHGV.js.map → chunk-KN5Y5BXK.js.map} +1 -1
- package/dist/{chunk-QJOOD3OV.js → chunk-L7R52OOV.js} +3 -3
- package/dist/{chunk-QJOOD3OV.js.map → chunk-L7R52OOV.js.map} +1 -1
- package/dist/{chunk-TB3LJ6NA.js → chunk-MDBAEEY5.js} +3 -3
- package/dist/{chunk-TB3LJ6NA.js.map → chunk-MDBAEEY5.js.map} +1 -1
- package/dist/{chunk-TUTVTGMG.js → chunk-MIRWAK5C.js} +4 -4
- package/dist/{chunk-TUTVTGMG.js.map → chunk-MIRWAK5C.js.map} +1 -1
- package/dist/{chunk-C3256F2F.js → chunk-MRS5YHPI.js} +3 -3
- package/dist/{chunk-C3256F2F.js.map → chunk-MRS5YHPI.js.map} +1 -1
- package/dist/{chunk-7LBPHRRP.js → chunk-NFECHLV6.js} +3 -3
- package/dist/{chunk-7LBPHRRP.js.map → chunk-NFECHLV6.js.map} +1 -1
- package/dist/{chunk-LX3FKVLL.js → chunk-NTASYPDN.js} +3 -3
- package/dist/{chunk-LX3FKVLL.js.map → chunk-NTASYPDN.js.map} +1 -1
- package/dist/{chunk-7IH3RKKK.js → chunk-OEBAXTQ4.js} +3 -3
- package/dist/{chunk-7IH3RKKK.js.map → chunk-OEBAXTQ4.js.map} +1 -1
- package/dist/{chunk-7LZJRVKJ.js → chunk-OKGUDNDT.js} +94 -16
- package/dist/chunk-OKGUDNDT.js.map +1 -0
- package/dist/{chunk-Z2QI42YH.js → chunk-OPBGV4DX.js} +30 -9
- package/dist/chunk-OPBGV4DX.js.map +1 -0
- package/dist/{chunk-T762W5CI.js → chunk-QABZZROM.js} +3 -3
- package/dist/{chunk-T762W5CI.js.map → chunk-QABZZROM.js.map} +1 -1
- package/dist/{chunk-LRCSWOZO.js → chunk-QKXDRBLL.js} +5 -3
- package/dist/chunk-QKXDRBLL.js.map +1 -0
- package/dist/{chunk-66A35U4V.js → chunk-R2SYODNK.js} +64 -8
- package/dist/chunk-R2SYODNK.js.map +1 -0
- package/dist/{chunk-TTITGVXV.js → chunk-RZXP5ZER.js} +3 -3
- package/dist/{chunk-TTITGVXV.js.map → chunk-RZXP5ZER.js.map} +1 -1
- package/dist/{chunk-DHLE66FV.js → chunk-S63H4HDH.js} +8 -4
- package/dist/chunk-S63H4HDH.js.map +1 -0
- package/dist/{chunk-J4ANCOQ4.js → chunk-SGMCSVTO.js} +7 -7
- package/dist/{chunk-J4ANCOQ4.js.map → chunk-SGMCSVTO.js.map} +1 -1
- package/dist/{chunk-IGNY4C6K.js → chunk-SOFPA4S4.js} +7 -7
- package/dist/{chunk-IGNY4C6K.js.map → chunk-SOFPA4S4.js.map} +1 -1
- package/dist/{chunk-2FBPAR2V.js → chunk-SQ7IN7KR.js} +3 -2
- package/dist/chunk-SQ7IN7KR.js.map +1 -0
- package/dist/{chunk-GORUF3YZ.js → chunk-U4CNCL7Q.js} +10 -10
- package/dist/{chunk-GORUF3YZ.js.map → chunk-U4CNCL7Q.js.map} +1 -1
- package/dist/{chunk-75LXFKQR.js → chunk-UFBURH6K.js} +4 -4
- package/dist/{chunk-75LXFKQR.js.map → chunk-UFBURH6K.js.map} +1 -1
- package/dist/{chunk-AO7TCPOS.js → chunk-USJWXEXS.js} +311 -32
- package/dist/chunk-USJWXEXS.js.map +1 -0
- package/dist/{chunk-GKTFGCQZ.js → chunk-UTZEHXYT.js} +3 -3
- package/dist/{chunk-GKTFGCQZ.js.map → chunk-UTZEHXYT.js.map} +1 -1
- package/dist/{chunk-JS7DCCDA.js → chunk-V2OQ3BI6.js} +4 -4
- package/dist/chunk-V2OQ3BI6.js.map +1 -0
- package/dist/{chunk-5YXKEM7Q.js → chunk-VCLN2IUM.js} +5 -5
- package/dist/{chunk-5YXKEM7Q.js.map → chunk-VCLN2IUM.js.map} +1 -1
- package/dist/{chunk-JRIU5GA7.js → chunk-VRFKCF3R.js} +4 -4
- package/dist/{chunk-JRIU5GA7.js.map → chunk-VRFKCF3R.js.map} +1 -1
- package/dist/{chunk-MTWZ7KHZ.js → chunk-WQULDAH2.js} +11 -2
- package/dist/chunk-WQULDAH2.js.map +1 -0
- package/dist/{chunk-IFUQ6XBQ.js → chunk-WTBXGJCD.js} +207 -19
- package/dist/chunk-WTBXGJCD.js.map +1 -0
- package/dist/{chunk-7ERHZQ7O.js → chunk-XN7DAZB7.js} +3 -3
- package/dist/{chunk-7ERHZQ7O.js.map → chunk-XN7DAZB7.js.map} +1 -1
- package/dist/{chunk-24X2GGSC.js → chunk-YU433JEL.js} +6 -6
- package/dist/{chunk-24X2GGSC.js.map → chunk-YU433JEL.js.map} +1 -1
- package/dist/cli/index.js +72 -64
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/catalog.d.ts +7 -0
- package/dist/cli/src/commands/catalog.d.ts.map +1 -1
- package/dist/cli/src/commands/connector.d.ts.map +1 -1
- package/dist/connectors/config.js +3 -3
- package/dist/connectors/index.js +15 -15
- package/dist/connectors/src/config.d.ts.map +1 -1
- package/dist/connectors/src/connector-types.d.ts +7 -0
- package/dist/connectors/src/connector-types.d.ts.map +1 -1
- package/dist/connectors/src/materialized-connectors.d.ts.map +1 -1
- package/dist/connectors-shared/index.js +2 -2
- package/dist/core/index.js +4 -4
- package/dist/core/manifest.js +1 -1
- package/dist/core/runtime-assets.js +3 -3
- package/dist/core/src/manifest.d.ts.map +1 -1
- package/dist/core/src/workspace-config.d.ts +7 -0
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/workspace-config.js +2 -2
- package/dist/deploy/index.js +4 -4
- package/dist/discovery/index.js +3 -3
- package/dist/{ensure-sources-DVPPPCBS.js → ensure-sources-IGU65O72.js} +13 -13
- package/dist/{ensure-sources-DVPPPCBS.js.map → ensure-sources-IGU65O72.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +15 -15
- package/dist/factory-assets/connectors/deploy.js +15 -15
- package/dist/factory-assets/connectors/devserver.js +15 -15
- package/dist/factory-assets/connectors/flow/adapter.js +15 -15
- package/dist/factory-assets/connectors/flow/engine.js +5 -5
- package/dist/factory-assets/connectors/flow/run-flow.js +17 -17
- package/dist/factory-assets/connectors/flow.js +15 -15
- package/dist/factory-assets/connectors/git/CONNECTOR.md +1 -0
- package/dist/factory-assets/connectors/git/driver.d.ts +29 -0
- package/dist/factory-assets/connectors/git/driver.d.ts.map +1 -1
- package/dist/factory-assets/connectors/git.js +15 -15
- package/dist/factory-assets/connectors/gmail.js +15 -15
- package/dist/factory-assets/connectors/googledrive.js +15 -15
- package/dist/factory-assets/connectors/local.js +15 -15
- package/dist/factory-assets/connectors/mattermost.js +15 -15
- package/dist/factory-assets/connectors/memory.js +15 -15
- package/dist/factory-assets/connectors/minio.js +15 -15
- package/dist/factory-assets/connectors/postgres.js +15 -15
- package/dist/factory-assets/connectors/s3.js +15 -15
- package/dist/factory-assets/connectors/sharepoint.js +15 -15
- package/dist/factory-assets/connectors/sqlite.js +15 -15
- package/dist/factory-assets/connectors/static-server.js +15 -15
- package/dist/factory-assets/connectors/tunnel.js +15 -15
- package/dist/factory-assets/connectors/webdav.js +15 -15
- package/dist/factory-assets/connectors/xstate-store.js +15 -15
- package/dist/factory-assets/connectors/xstate.js +15 -15
- package/dist/{flows-X7JFAVRR.js → flows-6MDMBQUZ.js} +9 -9
- package/dist/{flows-X7JFAVRR.js.map → flows-6MDMBQUZ.js.map} +1 -1
- package/dist/{helpers-KLO5VUVZ.js → helpers-IELIL4YR.js} +13 -13
- package/dist/{helpers-KLO5VUVZ.js.map → helpers-IELIL4YR.js.map} +1 -1
- package/dist/library/index.js +7 -7
- package/dist/{library-publish-X6JGR7K3.js → library-publish-YKBYHZ43.js} +17 -17
- package/dist/{library-publish-X6JGR7K3.js.map → library-publish-YKBYHZ43.js.map} +1 -1
- package/dist/{open-library-S2ZFKJUK.js → open-library-ULRYWTEA.js} +15 -15
- package/dist/{open-library-S2ZFKJUK.js.map → open-library-ULRYWTEA.js.map} +1 -1
- package/dist/{paths-OI5IIS22.js → paths-4MTICP3T.js} +7 -7
- package/dist/{paths-OI5IIS22.js.map → paths-4MTICP3T.js.map} +1 -1
- package/dist/{plugin-store-C67RLSPD.js → plugin-store-GQ4WQZJ2.js} +6 -6
- package/dist/{plugin-store-C67RLSPD.js.map → plugin-store-GQ4WQZJ2.js.map} +1 -1
- package/dist/{project-7VOTYB7O.js → project-VKYNDEB6.js} +14 -14
- package/dist/{project-7VOTYB7O.js.map → project-VKYNDEB6.js.map} +1 -1
- package/dist/resolver/index.js +5 -5
- package/dist/runner/index.js +24 -24
- package/dist/runner/src/capability-registry.d.ts +13 -0
- package/dist/runner/src/capability-registry.d.ts.map +1 -1
- package/dist/runner/src/compaction/orchestrator.d.ts +8 -0
- package/dist/runner/src/compaction/orchestrator.d.ts.map +1 -1
- package/dist/runner/src/compaction-gate.d.ts +64 -1
- package/dist/runner/src/compaction-gate.d.ts.map +1 -1
- package/dist/runner/src/driver-swap-gate.d.ts +17 -0
- package/dist/runner/src/driver-swap-gate.d.ts.map +1 -1
- package/dist/runner/src/external-mcp.d.ts +6 -0
- package/dist/runner/src/external-mcp.d.ts.map +1 -1
- package/dist/runner/src/mcp-pinned-ca.d.ts +8 -0
- package/dist/runner/src/mcp-pinned-ca.d.ts.map +1 -0
- package/dist/runner/src/prompt-turn-queue.d.ts +51 -0
- package/dist/runner/src/prompt-turn-queue.d.ts.map +1 -0
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +10 -10
- package/dist/sdk/bridge.js +11 -11
- package/dist/sdk/core.js +4 -4
- package/dist/sdk/flow.js +5 -5
- package/dist/sdk/index.js +24 -24
- package/dist/sdk/resolver.js +5 -5
- package/dist/sdk/runner.js +24 -24
- package/dist/sdk/session.js +2 -2
- package/dist/sdk/store.js +1 -1
- package/dist/sdk/types.js +1 -1
- package/dist/session/index.js +2 -2
- package/dist/session/src/bounded-subscriber-transport.d.ts +11 -4
- package/dist/session/src/bounded-subscriber-transport.d.ts.map +1 -1
- package/dist/session/src/dispatcher.d.ts +5 -0
- package/dist/session/src/dispatcher.d.ts.map +1 -1
- package/dist/session/src/index.d.ts +1 -1
- package/dist/session/src/index.d.ts.map +1 -1
- package/dist/session/src/types.d.ts +20 -1
- package/dist/session/src/types.d.ts.map +1 -1
- package/dist/{setup-RO3PGJYS.js → setup-INJFK3VJ.js} +20 -20
- package/dist/{setup-RO3PGJYS.js.map → setup-INJFK3VJ.js.map} +1 -1
- package/dist/{skills-4YTVHMOH.js → skills-JHUY4DFE.js} +10 -10
- package/dist/{skills-4YTVHMOH.js.map → skills-JHUY4DFE.js.map} +1 -1
- package/dist/{source-ZZLLOP2U.js → source-IZXICUBU.js} +16 -16
- package/dist/{source-ZZLLOP2U.js.map → source-IZXICUBU.js.map} +1 -1
- package/dist/{source-manifest-publish-7WRQDIXO.js → source-manifest-publish-4JHOT4PA.js} +18 -18
- package/dist/{source-manifest-publish-7WRQDIXO.js.map → source-manifest-publish-4JHOT4PA.js.map} +1 -1
- package/dist/store/index.js +1 -1
- package/dist/store/src/store.d.ts +30 -1
- package/dist/store/src/store.d.ts.map +1 -1
- package/dist/store/src/types.d.ts +17 -0
- package/dist/store/src/types.d.ts.map +1 -1
- package/dist/tui/index.js +24 -24
- package/dist/types/index.js +1 -1
- package/dist/types/manifests.js +1 -1
- package/dist/types/src/events.d.ts +24 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/manifests/mcp-server.d.ts +1 -0
- package/dist/types/src/manifests/mcp-server.d.ts.map +1 -1
- package/dist/types/src/protocol.d.ts +2 -0
- package/dist/types/src/protocol.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +12 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +11 -11
- package/dist/workspace-plugin/adapters/omp.js +7 -7
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-2FBPAR2V.js.map +0 -1
- package/dist/chunk-66A35U4V.js.map +0 -1
- package/dist/chunk-7LZJRVKJ.js.map +0 -1
- package/dist/chunk-AO7TCPOS.js.map +0 -1
- package/dist/chunk-DHLE66FV.js.map +0 -1
- package/dist/chunk-IFUQ6XBQ.js.map +0 -1
- package/dist/chunk-JS7DCCDA.js.map +0 -1
- package/dist/chunk-LRCSWOZO.js.map +0 -1
- package/dist/chunk-MTWZ7KHZ.js.map +0 -1
- package/dist/chunk-TGE33MKN.js.map +0 -1
- package/dist/chunk-Z2QI42YH.js.map +0 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { WorkspacePlugin } from './chunk-
|
|
2
|
-
import { buildWorkspaceToolDefs } from './chunk-
|
|
3
|
-
import { findAiAssetsRoot } from './chunk-
|
|
1
|
+
import { WorkspacePlugin } from './chunk-ENXE4BKS.js';
|
|
2
|
+
import { buildWorkspaceToolDefs } from './chunk-A5RRXBLI.js';
|
|
3
|
+
import { findAiAssetsRoot } from './chunk-OEBAXTQ4.js';
|
|
4
4
|
import { WebSocketServerTransport } from './chunk-5LKOAX7I.js';
|
|
5
5
|
import { assembleSystemPrompt, buildCapabilitiesPromptSection } from './chunk-W3UDISS2.js';
|
|
6
6
|
import { prepareNativePolicy, codexInstanceEnvironment, parseCodexCredential, parseCodexRefreshInput, parseCodexRefreshResult } from './chunk-HCYS7GFP.js';
|
|
7
|
-
import { resolveFlowPath } from './chunk-
|
|
8
|
-
import { findAiAssetsRoot as findAiAssetsRoot$1, deployCatalogEntry, undeployCatalogEntry } from './chunk-
|
|
9
|
-
import { ConnectFailureCarryOver, registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, buildSdkConnectorTools, buildLazySdkFlowTools, describeFlowOperations, buildConnectorToolDefs, buildFlowToolDefs, SessionNodeExecutor, SessionSubpromptRunner, ClassifierSubpromptRunner, SessionInlineSubFlowRunner, driveOrchestratorTurn, buildSdkFlowTools } from './chunk-
|
|
10
|
-
import { loadYamlConnectorDeclarations, withMaterializedConnectorDeclarations, SecretProviderChain, ConnectorStartupError, isKnownSecretRef, EnvSecretProvider, PreMintedSecretProvider, InMemorySecretProvider, resolvedConfigToDeclarations, deriveSingleMaterializedConnectorDeclaration } from './chunk-
|
|
11
|
-
import { EventNormalizer } from './chunk-
|
|
12
|
-
import { probeResumeTranscript, transcriptStoreForRuntime } from './chunk-
|
|
7
|
+
import { resolveFlowPath } from './chunk-SGMCSVTO.js';
|
|
8
|
+
import { findAiAssetsRoot as findAiAssetsRoot$1, deployCatalogEntry, undeployCatalogEntry } from './chunk-5JAO4MXA.js';
|
|
9
|
+
import { ConnectFailureCarryOver, registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, buildSdkConnectorTools, buildLazySdkFlowTools, describeFlowOperations, buildConnectorToolDefs, buildFlowToolDefs, SessionNodeExecutor, SessionSubpromptRunner, ClassifierSubpromptRunner, SessionInlineSubFlowRunner, driveOrchestratorTurn, buildSdkFlowTools } from './chunk-WTBXGJCD.js';
|
|
10
|
+
import { loadYamlConnectorDeclarations, withMaterializedConnectorDeclarations, SecretProviderChain, ConnectorStartupError, isKnownSecretRef, EnvSecretProvider, PreMintedSecretProvider, InMemorySecretProvider, resolvedConfigToDeclarations, deriveSingleMaterializedConnectorDeclaration } from './chunk-S63H4HDH.js';
|
|
11
|
+
import { EventNormalizer } from './chunk-5SGS5SN2.js';
|
|
12
|
+
import { probeResumeTranscript, transcriptStoreForRuntime } from './chunk-NTASYPDN.js';
|
|
13
13
|
import { scopeReconfigureModel } from './chunk-EINLFFP6.js';
|
|
14
14
|
import { CodexNativeStateUnavailable } from './chunk-LOO5CB5M.js';
|
|
15
|
-
import { dispatchCapability } from './chunk-
|
|
15
|
+
import { dispatchCapability } from './chunk-RZXP5ZER.js';
|
|
16
16
|
import { classifyClaudeSdkError } from './chunk-XBSQ4KMC.js';
|
|
17
17
|
import { agentExecRequested } from './chunk-YROR332M.js';
|
|
18
|
-
import { toAgentEffort, createDriver, catalogLayer, providerCredentialEnvName, toMergedRegistry, registryCredentialEnv, AI_PROVIDER_PRESETS, AgentDriver } from './chunk-
|
|
19
|
-
import { loadFlow } from './chunk-
|
|
18
|
+
import { toAgentEffort, createDriver, catalogLayer, providerCredentialEnvName, toMergedRegistry, registryCredentialEnv, AI_PROVIDER_PRESETS, AgentDriver } from './chunk-WQULDAH2.js';
|
|
19
|
+
import { loadFlow } from './chunk-FLGLODDF.js';
|
|
20
20
|
import { parseFlowDefinition } from './chunk-DIQDYNXZ.js';
|
|
21
21
|
import { renderStimulusPrompt } from './chunk-K3IBZ2UZ.js';
|
|
22
|
-
import { withActivityLabelJsonSchema, TOOL_ACTIVITY_PROMPT_SECTION, SESSION_ROOT_CONNECTOR_ID, PROTOCOL_VERSION } from './chunk-
|
|
23
|
-
import { resolveSettings, loadProviderRegistry } from './chunk-
|
|
24
|
-
import { resolveRuntimeAssets } from './chunk-
|
|
22
|
+
import { withActivityLabelJsonSchema, TOOL_ACTIVITY_PROMPT_SECTION, SESSION_ROOT_CONNECTOR_ID, PROTOCOL_VERSION } from './chunk-V2OQ3BI6.js';
|
|
23
|
+
import { resolveSettings, loadProviderRegistry } from './chunk-FJYOQMXT.js';
|
|
24
|
+
import { resolveRuntimeAssets } from './chunk-VRFKCF3R.js';
|
|
25
25
|
import { resolveDriverPaths } from './chunk-K5GBV4SA.js';
|
|
26
|
-
import { resolveSkWorkspaceConfig, resolveAgentDir, loadMcpServerDeclarations, COMPACTION_DEFAULTS, resolveCompactionThresholdPercent, validateAssetRecipeAttr, deriveSingleMaterializedMcpDeclaration, stageMaterializedSkills, readSkillAllowList, isStagedSkillMarkerFor, unstageSkill, STAGED_SKILL_MARKER } from './chunk-
|
|
27
|
-
import { withFsDeadline, FsDeadlineError, fsDeadlineMs, parseFrontmatter, tryWithFsDeadline } from './chunk-
|
|
26
|
+
import { resolveSkWorkspaceConfig, resolveAgentDir, loadMcpServerDeclarations, COMPACTION_DEFAULTS, resolveCompactionThresholdPercent, validateAssetRecipeAttr, deriveSingleMaterializedMcpDeclaration, stageMaterializedSkills, readSkillAllowList, isStagedSkillMarkerFor, unstageSkill, STAGED_SKILL_MARKER } from './chunk-QKXDRBLL.js';
|
|
27
|
+
import { withFsDeadline, FsDeadlineError, fsDeadlineMs, parseFrontmatter, tryWithFsDeadline } from './chunk-SQ7IN7KR.js';
|
|
28
28
|
import { parseAssetRef } from './chunk-GEEW6SY2.js';
|
|
29
29
|
import { resolveLogStoreConfig, createLogStoreFromConfig, OnLogBridgeSink, WsLogSink, resolveLogsRetention, enforceLogsRetention } from './chunk-JMKB7IB4.js';
|
|
30
30
|
import { pickRegistryEntries, registryEntries, resolveEntryBaseUrl, parseModelRef, isEntryEnabled, parseCredentialRef } from './chunk-MJHSLODD.js';
|
|
@@ -51,6 +51,8 @@ import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
|
51
51
|
import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
|
|
52
52
|
import { getDefaultEnvironment, StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
|
|
53
53
|
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
54
|
+
import { Agent, request } from 'https';
|
|
55
|
+
import { Readable } from 'stream';
|
|
54
56
|
import mime from 'mime';
|
|
55
57
|
import { Worker } from 'worker_threads';
|
|
56
58
|
|
|
@@ -1517,6 +1519,58 @@ var FileChangedCoalescer = class {
|
|
|
1517
1519
|
state.dirCapHit = false;
|
|
1518
1520
|
}
|
|
1519
1521
|
};
|
|
1522
|
+
var isBun = typeof globalThis.Bun !== "undefined";
|
|
1523
|
+
var NULL_BODY_STATUSES = /* @__PURE__ */ new Set([204, 205, 304]);
|
|
1524
|
+
function createPinnedCaFetch(ca) {
|
|
1525
|
+
if (isBun) {
|
|
1526
|
+
return (url, init) => {
|
|
1527
|
+
assertHttps(url);
|
|
1528
|
+
return fetch(url, { ...init, keepalive: false, tls: { ca } });
|
|
1529
|
+
};
|
|
1530
|
+
}
|
|
1531
|
+
const agent = new Agent({ ca });
|
|
1532
|
+
return (url, init) => {
|
|
1533
|
+
assertHttps(url);
|
|
1534
|
+
return nodeHttpsFetch(new URL(String(url)), init, agent);
|
|
1535
|
+
};
|
|
1536
|
+
}
|
|
1537
|
+
function assertHttps(url) {
|
|
1538
|
+
if (new URL(String(url)).protocol !== "https:") {
|
|
1539
|
+
throw new Error("an MCP server with a pinned CA must use an https URL");
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
async function nodeHttpsFetch(url, init, agent) {
|
|
1543
|
+
const headers = {};
|
|
1544
|
+
new Headers(init?.headers).forEach((value, key) => {
|
|
1545
|
+
headers[key] = value;
|
|
1546
|
+
});
|
|
1547
|
+
const body = init?.body == null ? void 0 : Buffer.from(await new Response(init.body).arrayBuffer());
|
|
1548
|
+
return new Promise((resolve4, reject) => {
|
|
1549
|
+
const req = request(
|
|
1550
|
+
url,
|
|
1551
|
+
{ method: init?.method ?? "GET", headers, agent, signal: init?.signal ?? void 0 },
|
|
1552
|
+
(res) => {
|
|
1553
|
+
const responseHeaders = new Headers();
|
|
1554
|
+
for (const [key, value] of Object.entries(res.headers)) {
|
|
1555
|
+
if (value === void 0) continue;
|
|
1556
|
+
for (const v of Array.isArray(value) ? value : [value]) responseHeaders.append(key, v);
|
|
1557
|
+
}
|
|
1558
|
+
const status = res.statusCode ?? 0;
|
|
1559
|
+
const responseBody = NULL_BODY_STATUSES.has(status) ? null : Readable.toWeb(res);
|
|
1560
|
+
if (responseBody === null) res.resume();
|
|
1561
|
+
resolve4(
|
|
1562
|
+
new Response(responseBody, {
|
|
1563
|
+
status,
|
|
1564
|
+
statusText: res.statusMessage,
|
|
1565
|
+
headers: responseHeaders
|
|
1566
|
+
})
|
|
1567
|
+
);
|
|
1568
|
+
}
|
|
1569
|
+
);
|
|
1570
|
+
req.on("error", reject);
|
|
1571
|
+
req.end(body);
|
|
1572
|
+
});
|
|
1573
|
+
}
|
|
1520
1574
|
var execFileAsync2 = promisify(execFile);
|
|
1521
1575
|
var DEFAULT_NIX_TIMEOUT_MS = 3e4;
|
|
1522
1576
|
var NIX_TIMEOUT_ENV_VAR = "SKAILE_NIX_TIMEOUT_MS";
|
|
@@ -1753,6 +1807,20 @@ function resolveMcpUrl(decl, secrets) {
|
|
|
1753
1807
|
throw new Error(`resolved url for MCP server '${decl.id}' is not a valid URL`);
|
|
1754
1808
|
}
|
|
1755
1809
|
}
|
|
1810
|
+
function resolveMcpCa(decl, secrets) {
|
|
1811
|
+
const raw = decl.ca;
|
|
1812
|
+
if (raw === void 0 || raw === "") return void 0;
|
|
1813
|
+
const value = isKnownSecretRef(raw) ? secrets?.resolve(raw) : raw;
|
|
1814
|
+
if (value === void 0) {
|
|
1815
|
+
throw new Error(
|
|
1816
|
+
`CA for MCP server '${decl.id}' unavailable \u2014 unresolved secret ref '${raw}' in ca`
|
|
1817
|
+
);
|
|
1818
|
+
}
|
|
1819
|
+
if (!value.includes("-----BEGIN CERTIFICATE-----")) {
|
|
1820
|
+
throw new Error(`ca for MCP server '${decl.id}' is not a PEM certificate`);
|
|
1821
|
+
}
|
|
1822
|
+
return value;
|
|
1823
|
+
}
|
|
1756
1824
|
var RESERVED_MCP_SERVER_IDS = /* @__PURE__ */ new Set([
|
|
1757
1825
|
"skaile-connectors",
|
|
1758
1826
|
"skaile-workspace",
|
|
@@ -1887,7 +1955,11 @@ function buildTransport(decl, secrets) {
|
|
|
1887
1955
|
serverId: decl.id,
|
|
1888
1956
|
kind: "header"
|
|
1889
1957
|
});
|
|
1890
|
-
|
|
1958
|
+
const pinned = pinnedFetch(decl, secrets);
|
|
1959
|
+
return new SSEClientTransport(resolveMcpUrl(decl, secrets), {
|
|
1960
|
+
requestInit: { headers },
|
|
1961
|
+
...pinned ? { fetch: pinned } : {}
|
|
1962
|
+
});
|
|
1891
1963
|
}
|
|
1892
1964
|
if (transport === "http") {
|
|
1893
1965
|
if (!decl.url) throw new Error(`http MCP server '${decl.id}' is missing 'url'`);
|
|
@@ -1895,12 +1967,18 @@ function buildTransport(decl, secrets) {
|
|
|
1895
1967
|
serverId: decl.id,
|
|
1896
1968
|
kind: "header"
|
|
1897
1969
|
});
|
|
1970
|
+
const pinned = pinnedFetch(decl, secrets);
|
|
1898
1971
|
return new StreamableHTTPClientTransport(resolveMcpUrl(decl, secrets), {
|
|
1899
|
-
requestInit: { headers }
|
|
1972
|
+
requestInit: { headers },
|
|
1973
|
+
...pinned ? { fetch: pinned } : {}
|
|
1900
1974
|
});
|
|
1901
1975
|
}
|
|
1902
1976
|
throw new Error(`Unknown MCP transport '${transport}' for server '${decl.id}'`);
|
|
1903
1977
|
}
|
|
1978
|
+
function pinnedFetch(decl, secrets) {
|
|
1979
|
+
const ca = resolveMcpCa(decl, secrets);
|
|
1980
|
+
return ca === void 0 ? void 0 : createPinnedCaFetch(ca);
|
|
1981
|
+
}
|
|
1904
1982
|
function defaultMcpClientConnector(secrets) {
|
|
1905
1983
|
return async (decl) => {
|
|
1906
1984
|
const transport = buildTransport(decl, secrets);
|
|
@@ -2564,6 +2642,15 @@ function wireExternalMcpServersForSdk(mcpServers, resolvedDecls, secretProvider,
|
|
|
2564
2642
|
instance: sessionMeta?.sessionId ?? "no-session"
|
|
2565
2643
|
});
|
|
2566
2644
|
for (const decl of resolvedDecls) {
|
|
2645
|
+
if (decl.ca && decl.transport && decl.transport !== "stdio") {
|
|
2646
|
+
mcpLog.warn(
|
|
2647
|
+
"MCP server skipped: it pins a CA, which the SDK mcpServers config cannot carry",
|
|
2648
|
+
{
|
|
2649
|
+
id: decl.id
|
|
2650
|
+
}
|
|
2651
|
+
);
|
|
2652
|
+
continue;
|
|
2653
|
+
}
|
|
2567
2654
|
const serverConfig = toSdkMcpServerConfig(
|
|
2568
2655
|
decl,
|
|
2569
2656
|
secretProvider
|
|
@@ -3524,13 +3611,19 @@ var CapabilityRegistry = class {
|
|
|
3524
3611
|
}
|
|
3525
3612
|
};
|
|
3526
3613
|
function computeCapabilitySignature(caps) {
|
|
3527
|
-
const canonical2 = caps.
|
|
3614
|
+
const canonical2 = caps.filter((c) => !isConnectionScopedAppCapability(c)).sort((a, b) => a.name.localeCompare(b.name)).map((c) => ({
|
|
3528
3615
|
name: c.name,
|
|
3529
3616
|
origin: c.origin.kind,
|
|
3530
3617
|
schemaSha256: sha256(JSON.stringify(c.inputSchema ?? {}))
|
|
3531
3618
|
}));
|
|
3532
3619
|
return sha256(JSON.stringify(canonical2));
|
|
3533
3620
|
}
|
|
3621
|
+
function capabilitySignatureInputs(caps) {
|
|
3622
|
+
return caps.filter((c) => !isConnectionScopedAppCapability(c)).map((c) => `${c.name}:${c.origin.kind}`).sort();
|
|
3623
|
+
}
|
|
3624
|
+
function isConnectionScopedAppCapability(cap) {
|
|
3625
|
+
return cap.origin.kind === "app" || cap.name.startsWith(APP_CAPABILITY_PREFIX);
|
|
3626
|
+
}
|
|
3534
3627
|
function sha256(input) {
|
|
3535
3628
|
return createHash("sha256").update(input).digest("hex");
|
|
3536
3629
|
}
|
|
@@ -4805,6 +4898,41 @@ function compactionGateTimeoutMs() {
|
|
|
4805
4898
|
const raw = Number(process.env.SKAILE_COMPACTION_GATE_TIMEOUT_MS);
|
|
4806
4899
|
return Number.isFinite(raw) && raw > 0 ? raw : DEFAULT_COMPACTION_GATE_TIMEOUT_MS;
|
|
4807
4900
|
}
|
|
4901
|
+
var DEFAULT_COMPACTION_TURN_WAIT_MS = 10 * 6e4;
|
|
4902
|
+
function compactionTurnWaitMs() {
|
|
4903
|
+
const raw = Number(process.env.SKAILE_COMPACTION_TURN_WAIT_MS);
|
|
4904
|
+
return Number.isFinite(raw) && raw > 0 ? raw : DEFAULT_COMPACTION_TURN_WAIT_MS;
|
|
4905
|
+
}
|
|
4906
|
+
var PLATFORM_COMPACTION_TURN_WAIT_MS = 3e4;
|
|
4907
|
+
function compactionTurnWaitFor(trigger) {
|
|
4908
|
+
return trigger === "threshold" ? compactionTurnWaitMs() : PLATFORM_COMPACTION_TURN_WAIT_MS;
|
|
4909
|
+
}
|
|
4910
|
+
async function claimDriverForCompaction(deps) {
|
|
4911
|
+
const hold = deps.gate.begin();
|
|
4912
|
+
let released = false;
|
|
4913
|
+
const release2 = () => {
|
|
4914
|
+
if (released) return;
|
|
4915
|
+
released = true;
|
|
4916
|
+
deps.gate.settle(hold);
|
|
4917
|
+
};
|
|
4918
|
+
const timeoutMs = deps.timeoutMs ?? compactionTurnWaitMs();
|
|
4919
|
+
if (await raceDeadline(deps.awaitClaimedTurns(), timeoutMs) === "opened") return release2;
|
|
4920
|
+
release2();
|
|
4921
|
+
deps.log(
|
|
4922
|
+
`[serve] compaction skipped: a turn still held the driver after ${Math.round(timeoutMs / 1e3)}s`
|
|
4923
|
+
);
|
|
4924
|
+
return null;
|
|
4925
|
+
}
|
|
4926
|
+
var TURN_COMPACTION_YIELD_ATTEMPTS = 3;
|
|
4927
|
+
async function beginTurnClearOfCompaction(deps, maxAttempts = TURN_COMPACTION_YIELD_ATTEMPTS) {
|
|
4928
|
+
for (let attempt = 0; attempt < maxAttempts; attempt += 1) {
|
|
4929
|
+
if (!await deps.awaitIdle()) return null;
|
|
4930
|
+
const endTurn = await deps.claimTurn();
|
|
4931
|
+
if (deps.gate.isIdle()) return endTurn;
|
|
4932
|
+
endTurn();
|
|
4933
|
+
}
|
|
4934
|
+
throw new Error(`turn overtaken by a compaction ${maxAttempts} times running`);
|
|
4935
|
+
}
|
|
4808
4936
|
var COMPACTION_GATE_TIMEOUT_MESSAGE = "The session is still compacting its history and could not take this message. Send it again in a moment.";
|
|
4809
4937
|
async function guardTurnAgainstCompaction(deps) {
|
|
4810
4938
|
const outcome = await deps.gate.awaitIdle(deps.timeoutMs ?? compactionGateTimeoutMs());
|
|
@@ -4816,6 +4944,7 @@ async function guardTurnAgainstCompaction(deps) {
|
|
|
4816
4944
|
}
|
|
4817
4945
|
|
|
4818
4946
|
// runner/src/driver-swap-gate.ts
|
|
4947
|
+
var TURN_BIND_ATTEMPTS = 3;
|
|
4819
4948
|
var DriverSwapGate = class {
|
|
4820
4949
|
/** Resolves when the in-flight driver recreate settles (resolve or reject). */
|
|
4821
4950
|
activeDriverSwap = null;
|
|
@@ -4861,6 +4990,25 @@ var DriverSwapGate = class {
|
|
|
4861
4990
|
}
|
|
4862
4991
|
return endTurn;
|
|
4863
4992
|
}
|
|
4993
|
+
/**
|
|
4994
|
+
* Claim a turn slot on a driver no swap is about to replace. `prepare` is the
|
|
4995
|
+
* turn's async pre-flight (the driver start); a swap that registers during it
|
|
4996
|
+
* has already passed its turn wait, so the prompt waits that swap out and
|
|
4997
|
+
* prepares again on the fresh driver instead of dispatching onto the one being
|
|
4998
|
+
* killed. The slot is claimed in the same tick as the final check, so any later
|
|
4999
|
+
* swap waits for the turn. A failed swap releases the waiter; a throwing
|
|
5000
|
+
* `prepare` rejects with no slot claimed. Returns `endTurn`, as `beginTurn` does.
|
|
5001
|
+
* Bounded like the driver start: swaps overtaking every attempt is pathological,
|
|
5002
|
+
* and failing loudly beats spinning.
|
|
5003
|
+
*/
|
|
5004
|
+
async beginTurnOnLiveDriver(prepare, maxAttempts = TURN_BIND_ATTEMPTS) {
|
|
5005
|
+
for (let attempt = 0; attempt < maxAttempts; attempt += 1) {
|
|
5006
|
+
await this.awaitSwap();
|
|
5007
|
+
await prepare();
|
|
5008
|
+
if (!this.isSwapping()) return this.beginTurn();
|
|
5009
|
+
}
|
|
5010
|
+
throw new Error(`turn's driver replaced by a swap ${maxAttempts} times running`);
|
|
5011
|
+
}
|
|
4864
5012
|
/** Whether a driver swap is registered and has not settled yet. */
|
|
4865
5013
|
isSwapping() {
|
|
4866
5014
|
return this.activeDriverSwap !== null;
|
|
@@ -5043,6 +5191,61 @@ var PendingTurns = class {
|
|
|
5043
5191
|
}
|
|
5044
5192
|
};
|
|
5045
5193
|
|
|
5194
|
+
// runner/src/prompt-turn-queue.ts
|
|
5195
|
+
var PromptTurnQueue = class {
|
|
5196
|
+
entries = [];
|
|
5197
|
+
/** Take the next place. Call before the first `await` of the prompt's handler. */
|
|
5198
|
+
join(owner = {}) {
|
|
5199
|
+
const queued = this.entries.length > 0;
|
|
5200
|
+
let release2;
|
|
5201
|
+
const ready = new Promise((resolve4) => {
|
|
5202
|
+
release2 = resolve4;
|
|
5203
|
+
});
|
|
5204
|
+
const entry = { owner, active: false, dropped: false, release: release2 };
|
|
5205
|
+
this.entries.push(entry);
|
|
5206
|
+
if (!queued) this.activate(entry);
|
|
5207
|
+
return {
|
|
5208
|
+
queued,
|
|
5209
|
+
ready,
|
|
5210
|
+
get dropped() {
|
|
5211
|
+
return entry.dropped;
|
|
5212
|
+
},
|
|
5213
|
+
leave: () => this.remove(entry)
|
|
5214
|
+
};
|
|
5215
|
+
}
|
|
5216
|
+
/**
|
|
5217
|
+
* Drop every waiting prompt `senderId` sent, in queue order. The head is not
|
|
5218
|
+
* waiting (its turn is the one a cancel aborts), and a prompt with no sender
|
|
5219
|
+
* belongs to nobody a cancel can name, so neither is dropped.
|
|
5220
|
+
*/
|
|
5221
|
+
dropQueuedFrom(senderId) {
|
|
5222
|
+
const dropped = [];
|
|
5223
|
+
for (const entry of [...this.entries]) {
|
|
5224
|
+
if (entry.active || entry.owner.senderId !== senderId) continue;
|
|
5225
|
+
entry.dropped = true;
|
|
5226
|
+
this.remove(entry);
|
|
5227
|
+
entry.release();
|
|
5228
|
+
dropped.push(entry.owner.messageId !== void 0 ? { messageId: entry.owner.messageId } : {});
|
|
5229
|
+
}
|
|
5230
|
+
return dropped;
|
|
5231
|
+
}
|
|
5232
|
+
/** Prompts that joined and have not left yet; for diagnostics and tests. */
|
|
5233
|
+
get size() {
|
|
5234
|
+
return this.entries.length;
|
|
5235
|
+
}
|
|
5236
|
+
activate(entry) {
|
|
5237
|
+
entry.active = true;
|
|
5238
|
+
entry.release();
|
|
5239
|
+
}
|
|
5240
|
+
remove(entry) {
|
|
5241
|
+
const index = this.entries.indexOf(entry);
|
|
5242
|
+
if (index === -1) return;
|
|
5243
|
+
this.entries.splice(index, 1);
|
|
5244
|
+
const head = this.entries[0];
|
|
5245
|
+
if (index === 0 && head && !head.active) this.activate(head);
|
|
5246
|
+
}
|
|
5247
|
+
};
|
|
5248
|
+
|
|
5046
5249
|
// runner/src/serial-lock.ts
|
|
5047
5250
|
function createSerialLock() {
|
|
5048
5251
|
let tail = Promise.resolve();
|
|
@@ -5741,7 +5944,12 @@ var CompactionOrchestrator = class {
|
|
|
5741
5944
|
this._isCompacting = true;
|
|
5742
5945
|
this._startFired = false;
|
|
5743
5946
|
this._endFired = false;
|
|
5947
|
+
let releaseDriver = null;
|
|
5744
5948
|
try {
|
|
5949
|
+
if (this.opts.claimDriver) {
|
|
5950
|
+
releaseDriver = await this.opts.claimDriver(trigger);
|
|
5951
|
+
if (!releaseDriver) return null;
|
|
5952
|
+
}
|
|
5745
5953
|
return await this._doCompact(trigger, focus);
|
|
5746
5954
|
} finally {
|
|
5747
5955
|
this._isCompacting = false;
|
|
@@ -5752,7 +5960,11 @@ var CompactionOrchestrator = class {
|
|
|
5752
5960
|
`[compaction] onCompactionEnd threw while unwinding: ${err instanceof Error ? err.message : String(err)}`
|
|
5753
5961
|
);
|
|
5754
5962
|
} finally {
|
|
5755
|
-
|
|
5963
|
+
try {
|
|
5964
|
+
this.opts.onCompactionSettled?.();
|
|
5965
|
+
} finally {
|
|
5966
|
+
releaseDriver?.();
|
|
5967
|
+
}
|
|
5756
5968
|
}
|
|
5757
5969
|
}
|
|
5758
5970
|
}
|
|
@@ -9456,6 +9668,7 @@ async function startAgentServer(opts) {
|
|
|
9456
9668
|
const pendingTurns = new PendingTurns(() => {
|
|
9457
9669
|
if (!compacting) sendEvent({ type: "status", phase: "idle" });
|
|
9458
9670
|
});
|
|
9671
|
+
const promptTurns = new PromptTurnQueue();
|
|
9459
9672
|
let driverRestartChain = Promise.resolve();
|
|
9460
9673
|
let liveDriverActiveAfterTurn = false;
|
|
9461
9674
|
let driver = secretsMode === "env" ? agentSession.driver : void 0;
|
|
@@ -9527,6 +9740,15 @@ async function startAgentServer(opts) {
|
|
|
9527
9740
|
compactionGate.settle(gateHold);
|
|
9528
9741
|
gateHold = null;
|
|
9529
9742
|
},
|
|
9743
|
+
// A user turn that already holds a slot keeps the driver; the compaction
|
|
9744
|
+
// waits for it rather than prompting the driver under it. A platform call
|
|
9745
|
+
// waits briefly: a turn paused on a question can hold its slot for hours.
|
|
9746
|
+
claimDriver: (trigger) => claimDriverForCompaction({
|
|
9747
|
+
gate: compactionGate,
|
|
9748
|
+
awaitClaimedTurns: () => driverSwapGate.awaitActiveTurn(),
|
|
9749
|
+
log,
|
|
9750
|
+
timeoutMs: compactionTurnWaitFor(trigger)
|
|
9751
|
+
}),
|
|
9530
9752
|
onLog: (line) => log(`[serve] ${line}`),
|
|
9531
9753
|
// Phase 3: stamp every CompactionAttemptEvent with the registry's
|
|
9532
9754
|
// current signature so wake-time tier-1 selection has the input it
|
|
@@ -10640,6 +10862,9 @@ async function startAgentServer(opts) {
|
|
|
10640
10862
|
log(
|
|
10641
10863
|
`[serve] tier-1 resume rejected: signature mismatch (expected=${cfgExpectedSig.slice(0, 12)} current=${currentSig.slice(0, 12)})`
|
|
10642
10864
|
);
|
|
10865
|
+
log(
|
|
10866
|
+
`[serve] tier-1 resume signed set: ${capabilitySignatureInputs(capabilityRegistry.list()).join(",")}`
|
|
10867
|
+
);
|
|
10643
10868
|
sendEvent({
|
|
10644
10869
|
type: "resume_failed",
|
|
10645
10870
|
resumeSessionId: cfgResumeSessionId,
|
|
@@ -10745,6 +10970,21 @@ async function startAgentServer(opts) {
|
|
|
10745
10970
|
const awaitCompactionIdle = (what) => guardTurnAgainstCompaction({ gate: compactionGate, what, log, sendEvent });
|
|
10746
10971
|
async function handlePrompt(cmd) {
|
|
10747
10972
|
if (cmd.messageId) sendEvent({ type: "prompt_ack", messageId: cmd.messageId });
|
|
10973
|
+
const place = promptTurns.join({ senderId: cmd.senderId, messageId: cmd.messageId });
|
|
10974
|
+
try {
|
|
10975
|
+
if (place.queued) {
|
|
10976
|
+
driver?.supersedePendingQuestion?.();
|
|
10977
|
+
const queuedAt = Date.now();
|
|
10978
|
+
await place.ready;
|
|
10979
|
+
logPhase("prompt_queue_wait", queuedAt, { dropped: place.dropped });
|
|
10980
|
+
if (place.dropped) return;
|
|
10981
|
+
}
|
|
10982
|
+
await runPromptTurn(cmd, place.leave);
|
|
10983
|
+
} finally {
|
|
10984
|
+
place.leave();
|
|
10985
|
+
}
|
|
10986
|
+
}
|
|
10987
|
+
async function runPromptTurn(cmd, leaveQueue) {
|
|
10748
10988
|
const promptReceivedAt = Date.now();
|
|
10749
10989
|
const sessionIsReady = await awaitSessionReadyOrFail();
|
|
10750
10990
|
logPhase("prompt_gate_wait", promptReceivedAt, { ready: sessionIsReady });
|
|
@@ -10765,6 +11005,7 @@ async function startAgentServer(opts) {
|
|
|
10765
11005
|
await restageMaterializedSkills(true);
|
|
10766
11006
|
const activeFlow = pickChatFlowTarget(activeFlows.values());
|
|
10767
11007
|
if (activeFlow) {
|
|
11008
|
+
leaveQueue();
|
|
10768
11009
|
sendEvent({ type: "status", phase: "thinking" });
|
|
10769
11010
|
try {
|
|
10770
11011
|
const bus = getOrCreateStimulusBus();
|
|
@@ -10793,19 +11034,31 @@ async function startAgentServer(opts) {
|
|
|
10793
11034
|
}
|
|
10794
11035
|
const driverStartStartedAt = Date.now();
|
|
10795
11036
|
let driverStartOk = false;
|
|
11037
|
+
let driverStartAttempts = 0;
|
|
11038
|
+
let endTurn;
|
|
10796
11039
|
try {
|
|
10797
|
-
await
|
|
10798
|
-
|
|
11040
|
+
endTurn = await beginTurnClearOfCompaction({
|
|
11041
|
+
gate: compactionGate,
|
|
11042
|
+
awaitIdle: () => awaitCompactionIdle("prompt"),
|
|
11043
|
+
claimTurn: () => driverSwapGate.beginTurnOnLiveDriver(() => {
|
|
11044
|
+
driverStartAttempts += 1;
|
|
11045
|
+
return ensureDriverStarted();
|
|
11046
|
+
})
|
|
11047
|
+
});
|
|
11048
|
+
driverStartOk = endTurn !== null;
|
|
10799
11049
|
} catch (err) {
|
|
10800
11050
|
const errMsg = err instanceof Error ? err.message : String(err);
|
|
10801
11051
|
log(`[serve] driver start failed: ${errMsg}`);
|
|
10802
11052
|
sendEvent({ type: "error", message: `Driver start failed: ${errMsg}`, fatal: true });
|
|
10803
11053
|
return;
|
|
10804
11054
|
} finally {
|
|
10805
|
-
logPhase("driver_start", driverStartStartedAt, {
|
|
11055
|
+
logPhase("driver_start", driverStartStartedAt, {
|
|
11056
|
+
ok: driverStartOk,
|
|
11057
|
+
attempts: driverStartAttempts
|
|
11058
|
+
});
|
|
10806
11059
|
}
|
|
11060
|
+
if (!endTurn) return;
|
|
10807
11061
|
sendEvent({ type: "status", phase: "thinking" });
|
|
10808
|
-
const endTurn = driverSwapGate.beginTurn();
|
|
10809
11062
|
try {
|
|
10810
11063
|
await driver.promptInput({ text: cmd.prompt, attachments: cmd.attachments });
|
|
10811
11064
|
} catch (err) {
|
|
@@ -10836,8 +11089,22 @@ async function startAgentServer(opts) {
|
|
|
10836
11089
|
});
|
|
10837
11090
|
if (routed === "answered") return;
|
|
10838
11091
|
if (!driver.acceptsReplyAsPrompt) return;
|
|
10839
|
-
|
|
10840
|
-
|
|
11092
|
+
let endTurn;
|
|
11093
|
+
try {
|
|
11094
|
+
endTurn = await beginTurnClearOfCompaction({
|
|
11095
|
+
gate: compactionGate,
|
|
11096
|
+
awaitIdle: () => awaitCompactionIdle("reply"),
|
|
11097
|
+
claimTurn: () => driverSwapGate.beginTurnOnLiveDriver(ensureDriverStarted)
|
|
11098
|
+
});
|
|
11099
|
+
} catch (err) {
|
|
11100
|
+
sendEvent({
|
|
11101
|
+
type: "error",
|
|
11102
|
+
message: `Reply failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
11103
|
+
fatal: false
|
|
11104
|
+
});
|
|
11105
|
+
return;
|
|
11106
|
+
}
|
|
11107
|
+
if (!endTurn) return;
|
|
10841
11108
|
try {
|
|
10842
11109
|
await driver.prompt(cmd.answer);
|
|
10843
11110
|
} catch (err) {
|
|
@@ -10850,7 +11117,19 @@ async function startAgentServer(opts) {
|
|
|
10850
11117
|
endTurn();
|
|
10851
11118
|
}
|
|
10852
11119
|
}
|
|
10853
|
-
async function handleCancel() {
|
|
11120
|
+
async function handleCancel(cmd) {
|
|
11121
|
+
if (cmd.senderId) {
|
|
11122
|
+
const dropped = promptTurns.dropQueuedFrom(cmd.senderId);
|
|
11123
|
+
if (dropped.length > 0) {
|
|
11124
|
+
log(`[serve] cancel dropped ${dropped.length} queued prompt(s) of the presser`);
|
|
11125
|
+
sendEvent({
|
|
11126
|
+
type: "queued_prompts_dropped",
|
|
11127
|
+
senderId: cmd.senderId,
|
|
11128
|
+
messageIds: dropped.flatMap((p) => p.messageId !== void 0 ? [p.messageId] : []),
|
|
11129
|
+
count: dropped.length
|
|
11130
|
+
});
|
|
11131
|
+
}
|
|
11132
|
+
}
|
|
10854
11133
|
if (!await awaitSessionReadyOrFail()) return;
|
|
10855
11134
|
log("[serve] cancel");
|
|
10856
11135
|
try {
|
|
@@ -11120,7 +11399,7 @@ async function startAgentServer(opts) {
|
|
|
11120
11399
|
await countPendingTurn(() => handleReply(cmd));
|
|
11121
11400
|
break;
|
|
11122
11401
|
case "cancel":
|
|
11123
|
-
await handleCancel();
|
|
11402
|
+
await handleCancel(cmd);
|
|
11124
11403
|
break;
|
|
11125
11404
|
// v3: compact + lifecycle removed — reachable via runner.lifecycle capability
|
|
11126
11405
|
// (the v3 `runner.lifecycle` cap takes `{ phase: 'hibernate' | 'close' | 'compact' }`).
|
|
@@ -11426,6 +11705,6 @@ function touchSession(state) {
|
|
|
11426
11705
|
return { ...state, updatedAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
11427
11706
|
}
|
|
11428
11707
|
|
|
11429
|
-
export { CLAUDE_CODE_CREDENTIALS_KEY, COMPILE_MANIFEST_FILENAME, CONNECTOR_MUTATE_NOT_READY, CapabilityRegistry, DEFAULT_CAPABILITY_CALL_TIMEOUT_MS, DEFAULT_COALESCE_MS, DEFAULT_FLOW_MUTATE_CONNECTOR_WAIT_MS, 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, MarkdownStreamer, PreInitRingSink, ResourceOperationError, SESSION_ROOT_WRITABLE_DIRS, SESSION_ROOT_WRITABLE_FILES, WS_AUTH_TOKEN_ENV, WS_AUTH_TOKEN_FILE_ENV, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildConnectorTokenMediator, buildContextSection, buildEnvironmentSection, buildResourcesAvailablePayload, buildStoreSnapshotReplay, builtinCapabilities, capabilityLogInstance, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, computeDirectoryTotals, connectorRefreshKind, createAgentSession, createFlowConnectorReadiness, createManagedCodexSubpromptDriver, createSessionStimulusBus, defineCapability, deleteSession, dispatchResourceRequest, dispatchRunnerCapabilityInvocation, driverActiveAfterTurnEnd, emitSystemPromptComposed, ensureClaudeSettingsDisablesConnectors, ensureGitConfigInclude, executeConnectorMutate, extractClaudeAiOauthExpiresAt, flowRunDrivesTurns, flowStartNeedsDriverRestart, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, handleSessionRootResourceRequest, hasNonTerminalFlow, hostOpResumeStimulus, installPreInitRingSink, isSessionRootPathAllowed, isTerminalFlowStatus, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadManagedCodexHostConfig, loadSession, loadSessionById, mcpAuthSecretKey, newSession, nulTailPaddingLength, pickChatFlowTarget, pickFlowToolTarget, pickRepointedManager, planFlowMutate, prepareCodexTools, reconcilePendingDecisions, reconnectedRunNeedsAgentTurn, recreateKeepingLiveFlows, registerActiveFlow, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, rejectPendingCapabilityCallsOnDisconnect, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveFlowMutateConnectorWaitMs, resolveMixin, restoredRunHasWorkToResume, runAgentChat, saveSession, setCurrentSession, setUpFlowConnector, startAgentServer, stimulusFromMetas, supportsLiveToolUpdates, takeRunnerWsAuthToken, toActiveFlowTarget, touchSession, validateInputResponse, writeClaudeCodeCredentialsFile };
|
|
11430
|
-
//# sourceMappingURL=chunk-
|
|
11431
|
-
//# sourceMappingURL=chunk-
|
|
11708
|
+
export { CLAUDE_CODE_CREDENTIALS_KEY, COMPILE_MANIFEST_FILENAME, CONNECTOR_MUTATE_NOT_READY, CapabilityRegistry, DEFAULT_CAPABILITY_CALL_TIMEOUT_MS, DEFAULT_COALESCE_MS, DEFAULT_FLOW_MUTATE_CONNECTOR_WAIT_MS, 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, MarkdownStreamer, PreInitRingSink, ResourceOperationError, SESSION_ROOT_WRITABLE_DIRS, SESSION_ROOT_WRITABLE_FILES, WS_AUTH_TOKEN_ENV, WS_AUTH_TOKEN_FILE_ENV, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildConnectorTokenMediator, buildContextSection, buildEnvironmentSection, buildResourcesAvailablePayload, buildStoreSnapshotReplay, builtinCapabilities, capabilityLogInstance, capabilitySignatureInputs, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, computeDirectoryTotals, connectorRefreshKind, createAgentSession, createFlowConnectorReadiness, createManagedCodexSubpromptDriver, createSessionStimulusBus, defineCapability, deleteSession, dispatchResourceRequest, dispatchRunnerCapabilityInvocation, driverActiveAfterTurnEnd, emitSystemPromptComposed, ensureClaudeSettingsDisablesConnectors, ensureGitConfigInclude, executeConnectorMutate, extractClaudeAiOauthExpiresAt, flowRunDrivesTurns, flowStartNeedsDriverRestart, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, handleSessionRootResourceRequest, hasNonTerminalFlow, hostOpResumeStimulus, installPreInitRingSink, isSessionRootPathAllowed, isTerminalFlowStatus, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadManagedCodexHostConfig, loadSession, loadSessionById, mcpAuthSecretKey, newSession, nulTailPaddingLength, pickChatFlowTarget, pickFlowToolTarget, pickRepointedManager, planFlowMutate, prepareCodexTools, reconcilePendingDecisions, reconnectedRunNeedsAgentTurn, recreateKeepingLiveFlows, registerActiveFlow, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, rejectPendingCapabilityCallsOnDisconnect, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveFlowMutateConnectorWaitMs, resolveMixin, restoredRunHasWorkToResume, runAgentChat, saveSession, setCurrentSession, setUpFlowConnector, startAgentServer, stimulusFromMetas, supportsLiveToolUpdates, takeRunnerWsAuthToken, toActiveFlowTarget, touchSession, validateInputResponse, writeClaudeCodeCredentialsFile };
|
|
11709
|
+
//# sourceMappingURL=chunk-USJWXEXS.js.map
|
|
11710
|
+
//# sourceMappingURL=chunk-USJWXEXS.js.map
|