@skaile/workspaces 4.34.0 → 4.36.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/{asset-feeds-EIHLRBUG.js → asset-feeds-SJELMLNK.js} +10 -10
- package/dist/{asset-feeds-EIHLRBUG.js.map → asset-feeds-SJELMLNK.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 +12 -9
- 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 +1 -1
- package/dist/bridge/drivers/gemini.js +6 -6
- package/dist/bridge/drivers/goose.js +8 -8
- package/dist/bridge/drivers/omp.js +7 -4
- 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 +9 -9
- 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-JRSCSYRF.js → chunk-3CLUU45N.js} +7 -7
- package/dist/{chunk-JRSCSYRF.js.map → chunk-3CLUU45N.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-NVQLE4MK.js → chunk-3VUHHDZW.js} +3 -3
- package/dist/{chunk-NVQLE4MK.js.map → chunk-3VUHHDZW.js.map} +1 -1
- package/dist/{chunk-LA7DCX2U.js → chunk-422WJ2QC.js} +4 -4
- package/dist/{chunk-LA7DCX2U.js.map → chunk-422WJ2QC.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-ENV5DDQ7.js → chunk-5JJ5KQUM.js} +6 -6
- package/dist/{chunk-ENV5DDQ7.js.map → chunk-5JJ5KQUM.js.map} +1 -1
- package/dist/{chunk-AKBPLLFB.js → chunk-5L55HNNA.js} +5 -5
- package/dist/{chunk-AKBPLLFB.js.map → chunk-5L55HNNA.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-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-JR2QQLAQ.js → chunk-FQE2NBUH.js} +7 -7
- package/dist/{chunk-JR2QQLAQ.js.map → chunk-FQE2NBUH.js.map} +1 -1
- package/dist/{chunk-OWN2W2IW.js → chunk-FWZTKSYI.js} +284 -19
- package/dist/chunk-FWZTKSYI.js.map +1 -0
- 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-7LZJRVKJ.js → chunk-JRSLMZOT.js} +59 -11
- package/dist/chunk-JRSLMZOT.js.map +1 -0
- package/dist/{chunk-OS6256B2.js → chunk-KVDXSEQH.js} +317 -30
- package/dist/chunk-KVDXSEQH.js.map +1 -0
- package/dist/{chunk-FDZL5QVZ.js → chunk-L22WTIIC.js} +3 -3
- package/dist/{chunk-FDZL5QVZ.js.map → chunk-L22WTIIC.js.map} +1 -1
- package/dist/{chunk-N2UGG6WV.js → chunk-LIS5KT2X.js} +4 -4
- package/dist/{chunk-N2UGG6WV.js.map → chunk-LIS5KT2X.js.map} +1 -1
- package/dist/{chunk-Z2QI42YH.js → chunk-LVRKJW53.js} +22 -8
- package/dist/chunk-LVRKJW53.js.map +1 -0
- 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-MTWZ7KHZ.js → chunk-MQU632EK.js} +11 -2
- package/dist/chunk-MQU632EK.js.map +1 -0
- 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-GKTFGCQZ.js → chunk-NKYNDLCB.js} +3 -3
- package/dist/{chunk-GKTFGCQZ.js.map → chunk-NKYNDLCB.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-WFRVQ2RY.js → chunk-NVNKPWL4.js} +10 -10
- package/dist/{chunk-WFRVQ2RY.js.map → chunk-NVNKPWL4.js.map} +1 -1
- package/dist/{chunk-75LXFKQR.js → chunk-O63QZ6XX.js} +4 -4
- package/dist/{chunk-75LXFKQR.js.map → chunk-O63QZ6XX.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-RR4PJZLK.js → chunk-PKGI5QG7.js} +64 -8
- package/dist/chunk-PKGI5QG7.js.map +1 -0
- package/dist/{chunk-TGJIX77V.js → chunk-Q7SIVPM2.js} +3 -3
- package/dist/{chunk-TGJIX77V.js.map → chunk-Q7SIVPM2.js.map} +1 -1
- 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-DHLE66FV.js → chunk-S63H4HDH.js} +8 -4
- package/dist/chunk-S63H4HDH.js.map +1 -0
- package/dist/{chunk-2FBPAR2V.js → chunk-SQ7IN7KR.js} +3 -2
- package/dist/chunk-SQ7IN7KR.js.map +1 -0
- package/dist/{chunk-2EUW6NZD.js → chunk-TILISP6X.js} +2 -2
- package/dist/{chunk-2EUW6NZD.js.map → chunk-TILISP6X.js.map} +1 -1
- 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-7ERHZQ7O.js → chunk-XN7DAZB7.js} +3 -3
- package/dist/{chunk-7ERHZQ7O.js.map → chunk-XN7DAZB7.js.map} +1 -1
- package/dist/{chunk-RHESVS7V.js → chunk-YOIENZHA.js} +6 -6
- package/dist/{chunk-RHESVS7V.js.map → chunk-YOIENZHA.js.map} +1 -1
- package/dist/cli/index.js +69 -61
- 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 +12 -12
- package/dist/connectors/src/config.d.ts.map +1 -1
- package/dist/connectors/src/connect-failure-carry-over.d.ts +38 -0
- package/dist/connectors/src/connect-failure-carry-over.d.ts.map +1 -0
- package/dist/connectors/src/connector-manager.d.ts +15 -0
- package/dist/connectors/src/connector-manager.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/index.d.ts +1 -0
- package/dist/connectors/src/index.d.ts.map +1 -1
- package/dist/connectors/src/materialized-connectors.d.ts.map +1 -1
- 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-JR4QI2MY.js → ensure-sources-SYZO2HNP.js} +13 -13
- package/dist/{ensure-sources-JR4QI2MY.js.map → ensure-sources-SYZO2HNP.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +12 -12
- package/dist/factory-assets/connectors/deploy.js +12 -12
- package/dist/factory-assets/connectors/devserver.js +12 -12
- package/dist/factory-assets/connectors/flow/adapter.js +12 -12
- package/dist/factory-assets/connectors/flow/engine.js +5 -5
- package/dist/factory-assets/connectors/flow/run-flow.js +14 -14
- package/dist/factory-assets/connectors/flow.js +12 -12
- 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 +12 -12
- package/dist/factory-assets/connectors/gmail.js +12 -12
- package/dist/factory-assets/connectors/googledrive.js +12 -12
- package/dist/factory-assets/connectors/local.js +12 -12
- package/dist/factory-assets/connectors/mattermost.js +12 -12
- package/dist/factory-assets/connectors/memory.js +12 -12
- package/dist/factory-assets/connectors/minio.js +12 -12
- package/dist/factory-assets/connectors/postgres.js +12 -12
- package/dist/factory-assets/connectors/s3.js +12 -12
- package/dist/factory-assets/connectors/sharepoint.js +12 -12
- package/dist/factory-assets/connectors/sqlite.js +12 -12
- package/dist/factory-assets/connectors/static-server.js +12 -12
- package/dist/factory-assets/connectors/tunnel.js +12 -12
- package/dist/factory-assets/connectors/webdav.js +12 -12
- package/dist/factory-assets/connectors/xstate-store.js +12 -12
- package/dist/factory-assets/connectors/xstate.js +12 -12
- 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-HTET53KB.js → helpers-IMUCDNME.js} +13 -13
- package/dist/{helpers-HTET53KB.js.map → helpers-IMUCDNME.js.map} +1 -1
- package/dist/library/index.js +7 -7
- package/dist/{library-publish-T6KHQ3TE.js → library-publish-XAIAHKRL.js} +17 -17
- package/dist/{library-publish-T6KHQ3TE.js.map → library-publish-XAIAHKRL.js.map} +1 -1
- package/dist/{open-library-O5I2DAEK.js → open-library-6N3XZ2XL.js} +15 -15
- package/dist/{open-library-O5I2DAEK.js.map → open-library-6N3XZ2XL.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-QIOXU2NS.js → project-HESTMGPU.js} +14 -14
- package/dist/{project-QIOXU2NS.js.map → project-HESTMGPU.js.map} +1 -1
- package/dist/resolver/index.js +5 -5
- package/dist/runner/index.js +21 -21
- 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 +28 -0
- package/dist/runner/src/prompt-turn-queue.d.ts.map +1 -0
- package/dist/runner/src/resources.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts +46 -0
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-stimulus.d.ts +5 -0
- package/dist/runner/src/session-stimulus.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +10 -10
- package/dist/sdk/bridge.js +9 -9
- package/dist/sdk/core.js +4 -4
- package/dist/sdk/flow.js +5 -5
- package/dist/sdk/index.js +21 -21
- package/dist/sdk/resolver.js +5 -5
- package/dist/sdk/runner.js +21 -21
- package/dist/sdk/session.js +1 -1
- package/dist/sdk/store.js +1 -1
- package/dist/session/index.js +1 -1
- 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-SSGPDDWL.js → setup-PQG5DH5Z.js} +18 -18
- package/dist/{setup-SSGPDDWL.js.map → setup-PQG5DH5Z.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-NPU7ZWID.js → source-PNYNVVPM.js} +16 -16
- package/dist/{source-NPU7ZWID.js.map → source-PNYNVVPM.js.map} +1 -1
- package/dist/{source-manifest-publish-4EYDVPR3.js → source-manifest-publish-6O6H4T2P.js} +18 -18
- package/dist/{source-manifest-publish-4EYDVPR3.js.map → source-manifest-publish-6O6H4T2P.js.map} +1 -1
- package/dist/store/index.js +1 -1
- package/dist/store/src/store.d.ts +21 -1
- package/dist/store/src/store.d.ts.map +1 -1
- package/dist/tui/index.js +21 -21
- package/dist/types/manifests.js +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/workspace-plugin/adapters/mcp.js +10 -10
- 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-7LZJRVKJ.js.map +0 -1
- package/dist/chunk-DHLE66FV.js.map +0 -1
- package/dist/chunk-LRCSWOZO.js.map +0 -1
- package/dist/chunk-MTWZ7KHZ.js.map +0 -1
- package/dist/chunk-OS6256B2.js.map +0 -1
- package/dist/chunk-OWN2W2IW.js.map +0 -1
- package/dist/chunk-RR4PJZLK.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-TILISP6X.js';
|
|
2
|
+
import { buildWorkspaceToolDefs } from './chunk-LIS5KT2X.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 { 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-3CLUU45N.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-FWZTKSYI.js';
|
|
10
|
+
import { loadYamlConnectorDeclarations, withMaterializedConnectorDeclarations, SecretProviderChain, ConnectorStartupError, isKnownSecretRef, EnvSecretProvider, PreMintedSecretProvider, InMemorySecretProvider, resolvedConfigToDeclarations, deriveSingleMaterializedConnectorDeclaration } from './chunk-S63H4HDH.js';
|
|
11
|
+
import { EventNormalizer } from './chunk-3VUHHDZW.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
15
|
import { dispatchCapability } from './chunk-TTITGVXV.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-MQU632EK.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
22
|
import { withActivityLabelJsonSchema, TOOL_ACTIVITY_PROMPT_SECTION, SESSION_ROOT_CONNECTOR_ID, PROTOCOL_VERSION } from './chunk-JS7DCCDA.js';
|
|
23
|
-
import { resolveSettings, loadProviderRegistry } from './chunk-
|
|
24
|
-
import { resolveRuntimeAssets } from './chunk-
|
|
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);
|
|
@@ -2447,6 +2525,7 @@ function logConnectorReport(results, resLog) {
|
|
|
2447
2525
|
}
|
|
2448
2526
|
}
|
|
2449
2527
|
}
|
|
2528
|
+
var connectFailureCarryOver = new ConnectFailureCarryOver();
|
|
2450
2529
|
async function connectAllConnectors(connectorDeclarations, projectDir, runtimeAssets, secretProvider, tokenMediator, preMintedSecrets, deferFilesystemMounts, watch, resLog, capabilityRegistry, s3Presigner) {
|
|
2451
2530
|
const presigner = s3Presigner ?? (capabilityRegistry ? buildS3Presigner({
|
|
2452
2531
|
invokeRemote: (name, input) => capabilityRegistry.invokeRemote(name, input),
|
|
@@ -2458,7 +2537,8 @@ async function connectAllConnectors(connectorDeclarations, projectDir, runtimeAs
|
|
|
2458
2537
|
tokenMediator,
|
|
2459
2538
|
...presigner ? { s3Presigner: presigner } : {},
|
|
2460
2539
|
preMintedSecrets,
|
|
2461
|
-
onStatusChange: watch?.onConnectorStatus
|
|
2540
|
+
onStatusChange: watch?.onConnectorStatus,
|
|
2541
|
+
failureCarryOver: connectFailureCarryOver
|
|
2462
2542
|
});
|
|
2463
2543
|
try {
|
|
2464
2544
|
const report = await resourceManager.connectAll(connectorDeclarations, {
|
|
@@ -2562,6 +2642,15 @@ function wireExternalMcpServersForSdk(mcpServers, resolvedDecls, secretProvider,
|
|
|
2562
2642
|
instance: sessionMeta?.sessionId ?? "no-session"
|
|
2563
2643
|
});
|
|
2564
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
|
+
}
|
|
2565
2654
|
const serverConfig = toSdkMcpServerConfig(
|
|
2566
2655
|
decl,
|
|
2567
2656
|
secretProvider
|
|
@@ -3522,13 +3611,19 @@ var CapabilityRegistry = class {
|
|
|
3522
3611
|
}
|
|
3523
3612
|
};
|
|
3524
3613
|
function computeCapabilitySignature(caps) {
|
|
3525
|
-
const canonical2 = caps.
|
|
3614
|
+
const canonical2 = caps.filter((c) => !isConnectionScopedAppCapability(c)).sort((a, b) => a.name.localeCompare(b.name)).map((c) => ({
|
|
3526
3615
|
name: c.name,
|
|
3527
3616
|
origin: c.origin.kind,
|
|
3528
3617
|
schemaSha256: sha256(JSON.stringify(c.inputSchema ?? {}))
|
|
3529
3618
|
}));
|
|
3530
3619
|
return sha256(JSON.stringify(canonical2));
|
|
3531
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
|
+
}
|
|
3532
3627
|
function sha256(input) {
|
|
3533
3628
|
return createHash("sha256").update(input).digest("hex");
|
|
3534
3629
|
}
|
|
@@ -4803,6 +4898,41 @@ function compactionGateTimeoutMs() {
|
|
|
4803
4898
|
const raw = Number(process.env.SKAILE_COMPACTION_GATE_TIMEOUT_MS);
|
|
4804
4899
|
return Number.isFinite(raw) && raw > 0 ? raw : DEFAULT_COMPACTION_GATE_TIMEOUT_MS;
|
|
4805
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
|
+
}
|
|
4806
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.";
|
|
4807
4937
|
async function guardTurnAgainstCompaction(deps) {
|
|
4808
4938
|
const outcome = await deps.gate.awaitIdle(deps.timeoutMs ?? compactionGateTimeoutMs());
|
|
@@ -4814,6 +4944,7 @@ async function guardTurnAgainstCompaction(deps) {
|
|
|
4814
4944
|
}
|
|
4815
4945
|
|
|
4816
4946
|
// runner/src/driver-swap-gate.ts
|
|
4947
|
+
var TURN_BIND_ATTEMPTS = 3;
|
|
4817
4948
|
var DriverSwapGate = class {
|
|
4818
4949
|
/** Resolves when the in-flight driver recreate settles (resolve or reject). */
|
|
4819
4950
|
activeDriverSwap = null;
|
|
@@ -4859,6 +4990,25 @@ var DriverSwapGate = class {
|
|
|
4859
4990
|
}
|
|
4860
4991
|
return endTurn;
|
|
4861
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
|
+
}
|
|
4862
5012
|
/** Whether a driver swap is registered and has not settled yet. */
|
|
4863
5013
|
isSwapping() {
|
|
4864
5014
|
return this.activeDriverSwap !== null;
|
|
@@ -5041,6 +5191,38 @@ var PendingTurns = class {
|
|
|
5041
5191
|
}
|
|
5042
5192
|
};
|
|
5043
5193
|
|
|
5194
|
+
// runner/src/prompt-turn-queue.ts
|
|
5195
|
+
var PromptTurnQueue = class {
|
|
5196
|
+
tail = Promise.resolve();
|
|
5197
|
+
held = 0;
|
|
5198
|
+
/** Take the next place. Call before the first `await` of the prompt's handler. */
|
|
5199
|
+
join() {
|
|
5200
|
+
const queued = this.held > 0;
|
|
5201
|
+
this.held += 1;
|
|
5202
|
+
const ready = this.tail;
|
|
5203
|
+
let open4;
|
|
5204
|
+
const done = new Promise((resolve4) => {
|
|
5205
|
+
open4 = resolve4;
|
|
5206
|
+
});
|
|
5207
|
+
this.tail = ready.then(() => done);
|
|
5208
|
+
let left = false;
|
|
5209
|
+
return {
|
|
5210
|
+
queued,
|
|
5211
|
+
ready,
|
|
5212
|
+
leave: () => {
|
|
5213
|
+
if (left) return;
|
|
5214
|
+
left = true;
|
|
5215
|
+
this.held -= 1;
|
|
5216
|
+
open4();
|
|
5217
|
+
}
|
|
5218
|
+
};
|
|
5219
|
+
}
|
|
5220
|
+
/** Prompts that joined and have not left yet; for diagnostics and tests. */
|
|
5221
|
+
get size() {
|
|
5222
|
+
return this.held;
|
|
5223
|
+
}
|
|
5224
|
+
};
|
|
5225
|
+
|
|
5044
5226
|
// runner/src/serial-lock.ts
|
|
5045
5227
|
function createSerialLock() {
|
|
5046
5228
|
let tail = Promise.resolve();
|
|
@@ -5739,7 +5921,12 @@ var CompactionOrchestrator = class {
|
|
|
5739
5921
|
this._isCompacting = true;
|
|
5740
5922
|
this._startFired = false;
|
|
5741
5923
|
this._endFired = false;
|
|
5924
|
+
let releaseDriver = null;
|
|
5742
5925
|
try {
|
|
5926
|
+
if (this.opts.claimDriver) {
|
|
5927
|
+
releaseDriver = await this.opts.claimDriver(trigger);
|
|
5928
|
+
if (!releaseDriver) return null;
|
|
5929
|
+
}
|
|
5743
5930
|
return await this._doCompact(trigger, focus);
|
|
5744
5931
|
} finally {
|
|
5745
5932
|
this._isCompacting = false;
|
|
@@ -5750,7 +5937,11 @@ var CompactionOrchestrator = class {
|
|
|
5750
5937
|
`[compaction] onCompactionEnd threw while unwinding: ${err instanceof Error ? err.message : String(err)}`
|
|
5751
5938
|
);
|
|
5752
5939
|
} finally {
|
|
5753
|
-
|
|
5940
|
+
try {
|
|
5941
|
+
this.opts.onCompactionSettled?.();
|
|
5942
|
+
} finally {
|
|
5943
|
+
releaseDriver?.();
|
|
5944
|
+
}
|
|
5754
5945
|
}
|
|
5755
5946
|
}
|
|
5756
5947
|
}
|
|
@@ -7623,6 +7814,10 @@ function createSessionStimulusBus(opts) {
|
|
|
7623
7814
|
}
|
|
7624
7815
|
}
|
|
7625
7816
|
return {
|
|
7817
|
+
hasTurn(connectorId) {
|
|
7818
|
+
const q = queues.get(connectorId);
|
|
7819
|
+
return q !== void 0 && (q.inFlight || q.pending.length > 0);
|
|
7820
|
+
},
|
|
7626
7821
|
signal(connectorId, sig) {
|
|
7627
7822
|
const coalesceMs = sig.coalesceMs ?? defaultCoalesceMs;
|
|
7628
7823
|
log?.debug("stimulus signaled", {
|
|
@@ -8053,7 +8248,7 @@ async function recreateKeepingLiveFlows(flows, deps) {
|
|
|
8053
8248
|
try {
|
|
8054
8249
|
const run = await deps.reconnect(snapshot);
|
|
8055
8250
|
reconnected.push(snapshot.runId);
|
|
8056
|
-
if (restoredRunHasWorkToResume(run)) deps.resume(run);
|
|
8251
|
+
if (restoredRunHasWorkToResume(run) || deps.needsAgentTurn?.(run)) deps.resume(run);
|
|
8057
8252
|
} catch (err) {
|
|
8058
8253
|
deps.warn("flow run could not be reconnected after the driver recreate", {
|
|
8059
8254
|
runId: snapshot.runId,
|
|
@@ -8063,6 +8258,19 @@ async function recreateKeepingLiveFlows(flows, deps) {
|
|
|
8063
8258
|
}
|
|
8064
8259
|
return reconnected;
|
|
8065
8260
|
}
|
|
8261
|
+
function reconnectedRunNeedsAgentTurn(state) {
|
|
8262
|
+
return state.cutDriverWork && state.wantsAgentTurn && !state.busHasTurn && !state.promptQueuedForRun;
|
|
8263
|
+
}
|
|
8264
|
+
var DRIVER_ACTIVITY_EVENTS = /* @__PURE__ */ new Set([
|
|
8265
|
+
"message_start",
|
|
8266
|
+
"message_update",
|
|
8267
|
+
"tool_call"
|
|
8268
|
+
]);
|
|
8269
|
+
function driverActiveAfterTurnEnd(active, event) {
|
|
8270
|
+
const type = event?.type;
|
|
8271
|
+
if (type === "agent_end" || type === "result") return false;
|
|
8272
|
+
return typeof type === "string" && DRIVER_ACTIVITY_EVENTS.has(type) ? true : active;
|
|
8273
|
+
}
|
|
8066
8274
|
async function buildStoreSnapshotReplay(manager, activeFlows) {
|
|
8067
8275
|
const events = [];
|
|
8068
8276
|
for (const { runId, adapter, handle } of activeFlows) {
|
|
@@ -9437,7 +9645,9 @@ async function startAgentServer(opts) {
|
|
|
9437
9645
|
const pendingTurns = new PendingTurns(() => {
|
|
9438
9646
|
if (!compacting) sendEvent({ type: "status", phase: "idle" });
|
|
9439
9647
|
});
|
|
9648
|
+
const promptTurns = new PromptTurnQueue();
|
|
9440
9649
|
let driverRestartChain = Promise.resolve();
|
|
9650
|
+
let liveDriverActiveAfterTurn = false;
|
|
9441
9651
|
let driver = secretsMode === "env" ? agentSession.driver : void 0;
|
|
9442
9652
|
let secretsProvisioned = secretsMode === "env";
|
|
9443
9653
|
function swapDriver() {
|
|
@@ -9456,6 +9666,7 @@ async function startAgentServer(opts) {
|
|
|
9456
9666
|
driver = incoming;
|
|
9457
9667
|
normalizer.reset();
|
|
9458
9668
|
driverStarted = false;
|
|
9669
|
+
liveDriverActiveAfterTurn = false;
|
|
9459
9670
|
driverStartInFlight = null;
|
|
9460
9671
|
}
|
|
9461
9672
|
let eventSeq = 0;
|
|
@@ -9506,6 +9717,15 @@ async function startAgentServer(opts) {
|
|
|
9506
9717
|
compactionGate.settle(gateHold);
|
|
9507
9718
|
gateHold = null;
|
|
9508
9719
|
},
|
|
9720
|
+
// A user turn that already holds a slot keeps the driver; the compaction
|
|
9721
|
+
// waits for it rather than prompting the driver under it. A platform call
|
|
9722
|
+
// waits briefly: a turn paused on a question can hold its slot for hours.
|
|
9723
|
+
claimDriver: (trigger) => claimDriverForCompaction({
|
|
9724
|
+
gate: compactionGate,
|
|
9725
|
+
awaitClaimedTurns: () => driverSwapGate.awaitActiveTurn(),
|
|
9726
|
+
log,
|
|
9727
|
+
timeoutMs: compactionTurnWaitFor(trigger)
|
|
9728
|
+
}),
|
|
9509
9729
|
onLog: (line) => log(`[serve] ${line}`),
|
|
9510
9730
|
// Phase 3: stamp every CompactionAttemptEvent with the registry's
|
|
9511
9731
|
// current signature so wake-time tier-1 selection has the input it
|
|
@@ -9548,6 +9768,7 @@ async function startAgentServer(opts) {
|
|
|
9548
9768
|
await starting.start();
|
|
9549
9769
|
if (driver !== starting) return;
|
|
9550
9770
|
starting.on("agent-event", (event) => {
|
|
9771
|
+
liveDriverActiveAfterTurn = driverActiveAfterTurnEnd(liveDriverActiveAfterTurn, event);
|
|
9551
9772
|
const normalized = normalizer.normalize(event);
|
|
9552
9773
|
const turnEnded = event.type === "agent_end";
|
|
9553
9774
|
for (const e of normalized) {
|
|
@@ -9621,6 +9842,12 @@ async function startAgentServer(opts) {
|
|
|
9621
9842
|
)
|
|
9622
9843
|
);
|
|
9623
9844
|
}
|
|
9845
|
+
function activeFlowWantsAgentTurn(runId) {
|
|
9846
|
+
const entry = activeFlows.get(runId);
|
|
9847
|
+
if (!entry) return false;
|
|
9848
|
+
if (!flowRunDrivesTurns(entry.adapter.getExecution(entry.handle))) return false;
|
|
9849
|
+
return entry.adapter.shouldDriveAgentTurn(entry.handle, { kind: "resumed_after_hibernation" });
|
|
9850
|
+
}
|
|
9624
9851
|
async function countPendingTurn(run) {
|
|
9625
9852
|
const end = pendingTurns.begin();
|
|
9626
9853
|
try {
|
|
@@ -10067,6 +10294,8 @@ async function startAgentServer(opts) {
|
|
|
10067
10294
|
});
|
|
10068
10295
|
}
|
|
10069
10296
|
async function recreateAgentSessionInner(overrides) {
|
|
10297
|
+
const cutDriverWork = driverStarted && liveDriverActiveAfterTurn;
|
|
10298
|
+
const redriven = [];
|
|
10070
10299
|
const reconnected = await recreateKeepingLiveFlows(activeFlows.values(), {
|
|
10071
10300
|
recreate: () => rebuildAgentSession(overrides),
|
|
10072
10301
|
hasConnector: (id) => resourceManager?.has(id) ?? false,
|
|
@@ -10078,11 +10307,25 @@ async function startAgentServer(opts) {
|
|
|
10078
10307
|
)
|
|
10079
10308
|
),
|
|
10080
10309
|
resume: (run) => kickFlowTurn(run, { kind: "resumed_after_hibernation" }),
|
|
10310
|
+
needsAgentTurn: (run) => {
|
|
10311
|
+
const needed = reconnectedRunNeedsAgentTurn({
|
|
10312
|
+
cutDriverWork,
|
|
10313
|
+
wantsAgentTurn: activeFlowWantsAgentTurn(run.runId),
|
|
10314
|
+
busHasTurn: stimulusBus?.hasTurn(run.connectorId) ?? false,
|
|
10315
|
+
// Approximate: a waiting reply counts too. A prompt reaches one run only.
|
|
10316
|
+
promptQueuedForRun: pendingTurns.size > 0 && pickChatFlowTarget(activeFlows.values())?.runId === run.runId
|
|
10317
|
+
});
|
|
10318
|
+
if (needed) redriven.push(run.runId);
|
|
10319
|
+
return needed;
|
|
10320
|
+
},
|
|
10081
10321
|
warn: (message, fields) => serverLog.warn(message, fields)
|
|
10082
10322
|
});
|
|
10083
10323
|
if (reconnected.length > 0) {
|
|
10084
10324
|
serverLog.info("flow runs reconnected after the driver recreate", { runIds: reconnected });
|
|
10085
10325
|
}
|
|
10326
|
+
if (redriven.length > 0) {
|
|
10327
|
+
serverLog.warn("flow turn re-driven after the driver recreate", { runIds: redriven });
|
|
10328
|
+
}
|
|
10086
10329
|
emitAvailability();
|
|
10087
10330
|
}
|
|
10088
10331
|
async function rebuildAgentSession(overrides) {
|
|
@@ -10596,6 +10839,9 @@ async function startAgentServer(opts) {
|
|
|
10596
10839
|
log(
|
|
10597
10840
|
`[serve] tier-1 resume rejected: signature mismatch (expected=${cfgExpectedSig.slice(0, 12)} current=${currentSig.slice(0, 12)})`
|
|
10598
10841
|
);
|
|
10842
|
+
log(
|
|
10843
|
+
`[serve] tier-1 resume signed set: ${capabilitySignatureInputs(capabilityRegistry.list()).join(",")}`
|
|
10844
|
+
);
|
|
10599
10845
|
sendEvent({
|
|
10600
10846
|
type: "resume_failed",
|
|
10601
10847
|
resumeSessionId: cfgResumeSessionId,
|
|
@@ -10701,6 +10947,20 @@ async function startAgentServer(opts) {
|
|
|
10701
10947
|
const awaitCompactionIdle = (what) => guardTurnAgainstCompaction({ gate: compactionGate, what, log, sendEvent });
|
|
10702
10948
|
async function handlePrompt(cmd) {
|
|
10703
10949
|
if (cmd.messageId) sendEvent({ type: "prompt_ack", messageId: cmd.messageId });
|
|
10950
|
+
const place = promptTurns.join();
|
|
10951
|
+
try {
|
|
10952
|
+
if (place.queued) {
|
|
10953
|
+
driver?.supersedePendingQuestion?.();
|
|
10954
|
+
const queuedAt = Date.now();
|
|
10955
|
+
await place.ready;
|
|
10956
|
+
logPhase("prompt_queue_wait", queuedAt);
|
|
10957
|
+
}
|
|
10958
|
+
await runPromptTurn(cmd, place.leave);
|
|
10959
|
+
} finally {
|
|
10960
|
+
place.leave();
|
|
10961
|
+
}
|
|
10962
|
+
}
|
|
10963
|
+
async function runPromptTurn(cmd, leaveQueue) {
|
|
10704
10964
|
const promptReceivedAt = Date.now();
|
|
10705
10965
|
const sessionIsReady = await awaitSessionReadyOrFail();
|
|
10706
10966
|
logPhase("prompt_gate_wait", promptReceivedAt, { ready: sessionIsReady });
|
|
@@ -10721,6 +10981,7 @@ async function startAgentServer(opts) {
|
|
|
10721
10981
|
await restageMaterializedSkills(true);
|
|
10722
10982
|
const activeFlow = pickChatFlowTarget(activeFlows.values());
|
|
10723
10983
|
if (activeFlow) {
|
|
10984
|
+
leaveQueue();
|
|
10724
10985
|
sendEvent({ type: "status", phase: "thinking" });
|
|
10725
10986
|
try {
|
|
10726
10987
|
const bus = getOrCreateStimulusBus();
|
|
@@ -10749,19 +11010,31 @@ async function startAgentServer(opts) {
|
|
|
10749
11010
|
}
|
|
10750
11011
|
const driverStartStartedAt = Date.now();
|
|
10751
11012
|
let driverStartOk = false;
|
|
11013
|
+
let driverStartAttempts = 0;
|
|
11014
|
+
let endTurn;
|
|
10752
11015
|
try {
|
|
10753
|
-
await
|
|
10754
|
-
|
|
11016
|
+
endTurn = await beginTurnClearOfCompaction({
|
|
11017
|
+
gate: compactionGate,
|
|
11018
|
+
awaitIdle: () => awaitCompactionIdle("prompt"),
|
|
11019
|
+
claimTurn: () => driverSwapGate.beginTurnOnLiveDriver(() => {
|
|
11020
|
+
driverStartAttempts += 1;
|
|
11021
|
+
return ensureDriverStarted();
|
|
11022
|
+
})
|
|
11023
|
+
});
|
|
11024
|
+
driverStartOk = endTurn !== null;
|
|
10755
11025
|
} catch (err) {
|
|
10756
11026
|
const errMsg = err instanceof Error ? err.message : String(err);
|
|
10757
11027
|
log(`[serve] driver start failed: ${errMsg}`);
|
|
10758
11028
|
sendEvent({ type: "error", message: `Driver start failed: ${errMsg}`, fatal: true });
|
|
10759
11029
|
return;
|
|
10760
11030
|
} finally {
|
|
10761
|
-
logPhase("driver_start", driverStartStartedAt, {
|
|
11031
|
+
logPhase("driver_start", driverStartStartedAt, {
|
|
11032
|
+
ok: driverStartOk,
|
|
11033
|
+
attempts: driverStartAttempts
|
|
11034
|
+
});
|
|
10762
11035
|
}
|
|
11036
|
+
if (!endTurn) return;
|
|
10763
11037
|
sendEvent({ type: "status", phase: "thinking" });
|
|
10764
|
-
const endTurn = driverSwapGate.beginTurn();
|
|
10765
11038
|
try {
|
|
10766
11039
|
await driver.promptInput({ text: cmd.prompt, attachments: cmd.attachments });
|
|
10767
11040
|
} catch (err) {
|
|
@@ -10792,8 +11065,22 @@ async function startAgentServer(opts) {
|
|
|
10792
11065
|
});
|
|
10793
11066
|
if (routed === "answered") return;
|
|
10794
11067
|
if (!driver.acceptsReplyAsPrompt) return;
|
|
10795
|
-
|
|
10796
|
-
|
|
11068
|
+
let endTurn;
|
|
11069
|
+
try {
|
|
11070
|
+
endTurn = await beginTurnClearOfCompaction({
|
|
11071
|
+
gate: compactionGate,
|
|
11072
|
+
awaitIdle: () => awaitCompactionIdle("reply"),
|
|
11073
|
+
claimTurn: () => driverSwapGate.beginTurnOnLiveDriver(ensureDriverStarted)
|
|
11074
|
+
});
|
|
11075
|
+
} catch (err) {
|
|
11076
|
+
sendEvent({
|
|
11077
|
+
type: "error",
|
|
11078
|
+
message: `Reply failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
11079
|
+
fatal: false
|
|
11080
|
+
});
|
|
11081
|
+
return;
|
|
11082
|
+
}
|
|
11083
|
+
if (!endTurn) return;
|
|
10797
11084
|
try {
|
|
10798
11085
|
await driver.prompt(cmd.answer);
|
|
10799
11086
|
} catch (err) {
|
|
@@ -11382,6 +11669,6 @@ function touchSession(state) {
|
|
|
11382
11669
|
return { ...state, updatedAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
11383
11670
|
}
|
|
11384
11671
|
|
|
11385
|
-
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, 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, 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 };
|
|
11386
|
-
//# sourceMappingURL=chunk-
|
|
11387
|
-
//# sourceMappingURL=chunk-
|
|
11672
|
+
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 };
|
|
11673
|
+
//# sourceMappingURL=chunk-KVDXSEQH.js.map
|
|
11674
|
+
//# sourceMappingURL=chunk-KVDXSEQH.js.map
|