@skaile/workspaces 5.16.0 → 5.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/dist/app-sdk/index.js +1 -1
- package/dist/{asset-feeds-BELBSJEE.js → asset-feeds-MALYFZUM.js} +4 -4
- package/dist/{asset-feeds-BELBSJEE.js.map → asset-feeds-MALYFZUM.js.map} +1 -1
- package/dist/asset-manager/index.js +1 -1
- package/dist/bridge/drivers/claude-sdk.js +279 -96
- package/dist/bridge/drivers/claude-sdk.js.map +1 -1
- package/dist/bridge/drivers/codex.js +4 -4
- package/dist/bridge/drivers/continue.js +4 -4
- package/dist/bridge/drivers/echo.js +4 -4
- package/dist/bridge/drivers/gemini.js +6 -6
- package/dist/bridge/drivers/goose.js +4 -4
- package/dist/bridge/drivers/omp.js +6 -6
- package/dist/bridge/drivers/opencode.js +4 -4
- package/dist/bridge/drivers/qwen.js +6 -6
- package/dist/bridge/index.js +8 -8
- package/dist/bridge/src/drivers/claude-sdk.d.ts +74 -20
- package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
- package/dist/bridge/src/drivers/claude-self-turns.d.ts +25 -6
- package/dist/bridge/src/drivers/claude-self-turns.d.ts.map +1 -1
- package/dist/bridge/src/drivers/sanitize-assistant-text.d.ts +10 -0
- package/dist/bridge/src/drivers/sanitize-assistant-text.d.ts.map +1 -1
- package/dist/bridge/src/drivers/scrub-transcript.d.ts +20 -0
- package/dist/bridge/src/drivers/scrub-transcript.d.ts.map +1 -1
- package/dist/{chunk-NSNM2ZXF.js → chunk-3OYOBTY4.js} +44 -4
- package/dist/chunk-3OYOBTY4.js.map +1 -0
- package/dist/{chunk-6RTEUWXX.js → chunk-5SWED2LW.js} +3 -3
- package/dist/{chunk-6RTEUWXX.js.map → chunk-5SWED2LW.js.map} +1 -1
- package/dist/{chunk-PW3TYWOI.js → chunk-AJ7EGIFR.js} +3 -3
- package/dist/{chunk-PW3TYWOI.js.map → chunk-AJ7EGIFR.js.map} +1 -1
- package/dist/{chunk-E634MBP6.js → chunk-BBRMS4IC.js} +3 -3
- package/dist/{chunk-E634MBP6.js.map → chunk-BBRMS4IC.js.map} +1 -1
- package/dist/{chunk-SMUIYYCH.js → chunk-BVXXBZWA.js} +7 -7
- package/dist/{chunk-SMUIYYCH.js.map → chunk-BVXXBZWA.js.map} +1 -1
- package/dist/{chunk-ISSYT5AZ.js → chunk-CWAWYXD5.js} +3 -3
- package/dist/{chunk-ISSYT5AZ.js.map → chunk-CWAWYXD5.js.map} +1 -1
- package/dist/{chunk-OHNNCXMB.js → chunk-DR5ZOEYI.js} +7 -7
- package/dist/{chunk-OHNNCXMB.js.map → chunk-DR5ZOEYI.js.map} +1 -1
- package/dist/{chunk-YIDZJHY6.js → chunk-EFLKSMCO.js} +3 -3
- package/dist/{chunk-YIDZJHY6.js.map → chunk-EFLKSMCO.js.map} +1 -1
- package/dist/{chunk-CQFVKN6S.js → chunk-EOKWTN4N.js} +207 -66
- package/dist/chunk-EOKWTN4N.js.map +1 -0
- package/dist/{chunk-Y25V2MW2.js → chunk-EYDRONKO.js} +3 -3
- package/dist/{chunk-Y25V2MW2.js.map → chunk-EYDRONKO.js.map} +1 -1
- package/dist/{chunk-DQOAPR4M.js → chunk-FACRITOL.js} +2 -2
- package/dist/{chunk-DQOAPR4M.js.map → chunk-FACRITOL.js.map} +1 -1
- package/dist/{chunk-TXGVG7VH.js → chunk-GYZJKZPJ.js} +3 -3
- package/dist/{chunk-TXGVG7VH.js.map → chunk-GYZJKZPJ.js.map} +1 -1
- package/dist/{chunk-TADJCATD.js → chunk-HLETG3CX.js} +3 -3
- package/dist/{chunk-TADJCATD.js.map → chunk-HLETG3CX.js.map} +1 -1
- package/dist/{chunk-FWAJUWXQ.js → chunk-KZWZRNIY.js} +4 -4
- package/dist/{chunk-FWAJUWXQ.js.map → chunk-KZWZRNIY.js.map} +1 -1
- package/dist/{chunk-X5O56UO4.js → chunk-L2AMXONH.js} +3 -3
- package/dist/chunk-L2AMXONH.js.map +1 -0
- package/dist/{chunk-6Q7NKTDG.js → chunk-LQT2IKYY.js} +2 -2
- package/dist/{chunk-6Q7NKTDG.js.map → chunk-LQT2IKYY.js.map} +1 -1
- package/dist/{chunk-A7AZ3RL5.js → chunk-MMARPEV7.js} +4 -4
- package/dist/{chunk-A7AZ3RL5.js.map → chunk-MMARPEV7.js.map} +1 -1
- package/dist/{chunk-J4RRH2NP.js → chunk-OQN7PCI4.js} +3 -3
- package/dist/{chunk-J4RRH2NP.js.map → chunk-OQN7PCI4.js.map} +1 -1
- package/dist/{chunk-5CE6J4DB.js → chunk-OXUCYHL5.js} +5 -5
- package/dist/{chunk-5CE6J4DB.js.map → chunk-OXUCYHL5.js.map} +1 -1
- package/dist/{chunk-A26MUUN7.js → chunk-QBY74UBH.js} +7 -7
- package/dist/{chunk-A26MUUN7.js.map → chunk-QBY74UBH.js.map} +1 -1
- package/dist/{chunk-VJ2DZLDM.js → chunk-QEX75L77.js} +3 -3
- package/dist/{chunk-VJ2DZLDM.js.map → chunk-QEX75L77.js.map} +1 -1
- package/dist/{chunk-HG52NGAV.js → chunk-QSLXB44M.js} +3 -3
- package/dist/{chunk-HG52NGAV.js.map → chunk-QSLXB44M.js.map} +1 -1
- package/dist/{chunk-TKI7YDWE.js → chunk-QW534EZB.js} +6 -6
- package/dist/{chunk-TKI7YDWE.js.map → chunk-QW534EZB.js.map} +1 -1
- package/dist/{chunk-XGR7IDTY.js → chunk-QXA2W6UB.js} +3 -3
- package/dist/{chunk-XGR7IDTY.js.map → chunk-QXA2W6UB.js.map} +1 -1
- package/dist/{chunk-OJHPG6HK.js → chunk-V5CDPKDA.js} +7 -7
- package/dist/{chunk-OJHPG6HK.js.map → chunk-V5CDPKDA.js.map} +1 -1
- package/dist/{chunk-DADAZLFW.js → chunk-W44KA24A.js} +2 -2
- package/dist/{chunk-DADAZLFW.js.map → chunk-W44KA24A.js.map} +1 -1
- package/dist/{chunk-SAGBVBY2.js → chunk-WY22FMZF.js} +4 -4
- package/dist/{chunk-SAGBVBY2.js.map → chunk-WY22FMZF.js.map} +1 -1
- package/dist/{chunk-D5WTOVLG.js → chunk-Y56YIT6J.js} +2 -2
- package/dist/chunk-Y56YIT6J.js.map +1 -0
- package/dist/{chunk-ZIW34FGO.js → chunk-YIF2IJUA.js} +3 -3
- package/dist/{chunk-ZIW34FGO.js.map → chunk-YIF2IJUA.js.map} +1 -1
- package/dist/{chunk-RTNWU2UD.js → chunk-ZPCABSSW.js} +3 -3
- package/dist/{chunk-RTNWU2UD.js.map → chunk-ZPCABSSW.js.map} +1 -1
- package/dist/{chunk-72KZJE3G.js → chunk-ZWUJ22RF.js} +4 -4
- package/dist/{chunk-72KZJE3G.js.map → chunk-ZWUJ22RF.js.map} +1 -1
- package/dist/cli/index.js +47 -47
- package/dist/connectors/index.js +10 -10
- package/dist/{connectors-44RE2QEM.js → connectors-CIEIMJY2.js} +13 -13
- package/dist/{connectors-44RE2QEM.js.map → connectors-CIEIMJY2.js.map} +1 -1
- package/dist/connectors-shared/index.js +2 -2
- package/dist/{ensure-sources-R6AHZ7RV.js → ensure-sources-I62QMZZP.js} +4 -4
- package/dist/{ensure-sources-R6AHZ7RV.js.map → ensure-sources-I62QMZZP.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +10 -10
- package/dist/factory-assets/connectors/deploy.js +10 -10
- package/dist/factory-assets/connectors/devserver.js +10 -10
- package/dist/factory-assets/connectors/flow/adapter.js +10 -10
- package/dist/factory-assets/connectors/flow/run-flow.js +11 -11
- package/dist/factory-assets/connectors/flow.js +10 -10
- package/dist/factory-assets/connectors/git.js +10 -10
- package/dist/factory-assets/connectors/gmail.js +10 -10
- package/dist/factory-assets/connectors/googledrive.js +10 -10
- package/dist/factory-assets/connectors/local.js +10 -10
- package/dist/factory-assets/connectors/mattermost.js +10 -10
- package/dist/factory-assets/connectors/memory.js +10 -10
- package/dist/factory-assets/connectors/minio.js +10 -10
- package/dist/factory-assets/connectors/postgres.js +10 -10
- package/dist/factory-assets/connectors/s3.js +10 -10
- package/dist/factory-assets/connectors/sharepoint.js +10 -10
- package/dist/factory-assets/connectors/sqlite.js +10 -10
- package/dist/factory-assets/connectors/static-server.js +10 -10
- package/dist/factory-assets/connectors/tunnel.js +10 -10
- package/dist/factory-assets/connectors/webdav.js +10 -10
- package/dist/factory-assets/connectors/xstate-store.js +10 -10
- package/dist/factory-assets/connectors/xstate.js +10 -10
- package/dist/{helpers-FNQL5PI7.js → helpers-3FOM37BO.js} +4 -4
- package/dist/{helpers-FNQL5PI7.js.map → helpers-3FOM37BO.js.map} +1 -1
- package/dist/{library-publish-GHPVY42Y.js → library-publish-EFKITCGE.js} +26 -26
- package/dist/{library-publish-GHPVY42Y.js.map → library-publish-EFKITCGE.js.map} +1 -1
- package/dist/model-endpoint/index.js +3 -3
- package/dist/{open-library-YSUGNP36.js → open-library-NZUI4XGF.js} +5 -5
- package/dist/{open-library-YSUGNP36.js.map → open-library-NZUI4XGF.js.map} +1 -1
- package/dist/{project-NDSLXERO.js → project-2BNFZ2CR.js} +22 -22
- package/dist/{project-NDSLXERO.js.map → project-2BNFZ2CR.js.map} +1 -1
- package/dist/runner/index.js +17 -17
- package/dist/runner/src/coalesced-restart.d.ts +41 -0
- package/dist/runner/src/coalesced-restart.d.ts.map +1 -0
- package/dist/runner/src/compaction/prompt.d.ts.map +1 -1
- package/dist/runner/src/mcp-runtime-handlers.d.ts +27 -0
- package/dist/runner/src/mcp-runtime-handlers.d.ts.map +1 -1
- package/dist/runner/src/runner-capabilities.d.ts +7 -0
- package/dist/runner/src/runner-capabilities.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-capability-wiring.d.ts +2 -0
- package/dist/runner/src/session-capability-wiring.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +1 -1
- package/dist/sdk/bridge.js +8 -8
- package/dist/sdk/index.js +17 -17
- package/dist/sdk/runner.js +17 -17
- package/dist/sdk/session.js +2 -2
- package/dist/sdk/types.js +1 -1
- package/dist/{serve-preflight-ON2LS3SD.js → serve-preflight-V5GM33T3.js} +2 -2
- package/dist/{serve-preflight-ON2LS3SD.js.map → serve-preflight-V5GM33T3.js.map} +1 -1
- package/dist/session/index.js +2 -2
- package/dist/{setup-MFPEQS2I.js → setup-ZMAPTKJW.js} +13 -13
- package/dist/{setup-MFPEQS2I.js.map → setup-ZMAPTKJW.js.map} +1 -1
- package/dist/{source-4QVRD5NV.js → source-6BZA34F5.js} +24 -24
- package/dist/{source-4QVRD5NV.js.map → source-6BZA34F5.js.map} +1 -1
- package/dist/{source-manifest-publish-ZIO24GUM.js → source-manifest-publish-MJXCSUKT.js} +26 -26
- package/dist/{source-manifest-publish-ZIO24GUM.js.map → source-manifest-publish-MJXCSUKT.js.map} +1 -1
- package/dist/tui/index.js +17 -17
- package/dist/types/index.js +1 -1
- package/dist/types/src/events.d.ts +7 -4
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +12 -12
- package/dist/workspace-plugin/adapters/omp.js +7 -7
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-CQFVKN6S.js.map +0 -1
- package/dist/chunk-D5WTOVLG.js.map +0 -1
- package/dist/chunk-NSNM2ZXF.js.map +0 -1
- package/dist/chunk-X5O56UO4.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { CodexAppServerClient } from '../../chunk-K4O6L3WH.js';
|
|
2
2
|
import { freshBudget, decide, spend } from '../../chunk-IZCR27MU.js';
|
|
3
3
|
import { managedCodexRegistryViolation, parseCodexCredential, prepareNativePolicy, prepareCodexInstance, codexInstanceEnvironment, isNativeApprovalPolicyActive, activateNativeApprovalPolicy, parseCodexRefreshResult, allowsNativeApprovalPath } from '../../chunk-PHRNUTSG.js';
|
|
4
|
-
import { codexSessionHome, buildCodexConfigDocument, writeCodexConfigToml, codexProviderTableId } from '../../chunk-
|
|
4
|
+
import { codexSessionHome, buildCodexConfigDocument, writeCodexConfigToml, codexProviderTableId } from '../../chunk-5SWED2LW.js';
|
|
5
5
|
import { CodexNativeStateUnavailable } from '../../chunk-LOO5CB5M.js';
|
|
6
|
-
import { fetchProviderModels } from '../../chunk-
|
|
6
|
+
import { fetchProviderModels } from '../../chunk-ZPCABSSW.js';
|
|
7
7
|
import { ReconfigureLedger, stripRunnerPrivateEnv, classifyGenericErrorMessage } from '../../chunk-B4X2N7JQ.js';
|
|
8
8
|
import '../../chunk-YROR332M.js';
|
|
9
|
-
import { AgentDriver, TOOL_ALLOWLIST_UNSUPPORTED, getBridgeLogger, registryDriverConfig } from '../../chunk-
|
|
10
|
-
import { BUILTIN_DRIVER_CATALOG, registryCredentialEnv, entryCredentialValue } from '../../chunk-
|
|
9
|
+
import { AgentDriver, TOOL_ALLOWLIST_UNSUPPORTED, getBridgeLogger, registryDriverConfig } from '../../chunk-QSLXB44M.js';
|
|
10
|
+
import { BUILTIN_DRIVER_CATALOG, registryCredentialEnv, entryCredentialValue } from '../../chunk-LQT2IKYY.js';
|
|
11
11
|
import '../../chunk-6E6PKKAD.js';
|
|
12
12
|
import '../../chunk-YK3XLEQJ.js';
|
|
13
13
|
import { loadDriverSdk } from '../../chunk-PIC23DDE.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { driverSessionConfigHome, removeSessionConfigFile, writeSessionConfigFile } from '../../chunk-EAZECHPM.js';
|
|
2
|
-
import { SubprocessCliDriver, extractText, extractCost, extractTokens } from '../../chunk-
|
|
3
|
-
import { resolveEnvDriverSession, continueRoleBinding, credentialsForEveryProvider, registryModelEntries, selectableEntries, entrySurface, harnessProviderName, entryBaseUrl, versionedAnthropicBaseUrl } from '../../chunk-
|
|
2
|
+
import { SubprocessCliDriver, extractText, extractCost, extractTokens } from '../../chunk-QXA2W6UB.js';
|
|
3
|
+
import { resolveEnvDriverSession, continueRoleBinding, credentialsForEveryProvider, registryModelEntries, selectableEntries, entrySurface, harnessProviderName, entryBaseUrl, versionedAnthropicBaseUrl } from '../../chunk-GYZJKZPJ.js';
|
|
4
4
|
import '../../chunk-B4X2N7JQ.js';
|
|
5
5
|
import '../../chunk-YROR332M.js';
|
|
6
|
-
import { getBridgeLogger, registryDriverConfig } from '../../chunk-
|
|
7
|
-
import { BUILTIN_DRIVER_CATALOG, entryCredentialValue, providerCredentialEnvName } from '../../chunk-
|
|
6
|
+
import { getBridgeLogger, registryDriverConfig } from '../../chunk-QSLXB44M.js';
|
|
7
|
+
import { BUILTIN_DRIVER_CATALOG, entryCredentialValue, providerCredentialEnvName } from '../../chunk-LQT2IKYY.js';
|
|
8
8
|
import '../../chunk-6E6PKKAD.js';
|
|
9
9
|
import '../../chunk-PIC23DDE.js';
|
|
10
10
|
import '../../chunk-4GY63JU6.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { dispatchCapability } from '../../chunk-
|
|
2
|
-
import { AgentDriver, getBridgeLogger, registryDriverConfig } from '../../chunk-
|
|
3
|
-
import { BUILTIN_DRIVER_CATALOG } from '../../chunk-
|
|
1
|
+
import { dispatchCapability } from '../../chunk-AJ7EGIFR.js';
|
|
2
|
+
import { AgentDriver, getBridgeLogger, registryDriverConfig } from '../../chunk-QSLXB44M.js';
|
|
3
|
+
import { BUILTIN_DRIVER_CATALOG } from '../../chunk-LQT2IKYY.js';
|
|
4
4
|
import '../../chunk-6E6PKKAD.js';
|
|
5
|
-
import '../../chunk-
|
|
5
|
+
import '../../chunk-Y56YIT6J.js';
|
|
6
6
|
import '../../chunk-ICSCSM5D.js';
|
|
7
7
|
import '../../chunk-DKXNKFKP.js';
|
|
8
8
|
import '../../chunk-MJHSLODD.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { GeminiDriver, GeminiFamilyDriver, geminiDriverTarget } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
1
|
+
export { GeminiDriver, GeminiFamilyDriver, geminiDriverTarget } from '../../chunk-QBY74UBH.js';
|
|
2
|
+
import '../../chunk-QXA2W6UB.js';
|
|
3
|
+
import '../../chunk-GYZJKZPJ.js';
|
|
4
|
+
import '../../chunk-ZPCABSSW.js';
|
|
5
5
|
import '../../chunk-B4X2N7JQ.js';
|
|
6
6
|
import '../../chunk-YROR332M.js';
|
|
7
|
-
import '../../chunk-
|
|
8
|
-
import '../../chunk-
|
|
7
|
+
import '../../chunk-QSLXB44M.js';
|
|
8
|
+
import '../../chunk-LQT2IKYY.js';
|
|
9
9
|
import '../../chunk-6E6PKKAD.js';
|
|
10
10
|
import '../../chunk-YK3XLEQJ.js';
|
|
11
11
|
import '../../chunk-ICSCSM5D.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { driverSessionConfigHome, pruneSessionConfigDir, writeSessionConfigFile } from '../../chunk-EAZECHPM.js';
|
|
2
|
-
import { SubprocessCliDriver, extractText, extractCost, extractTokens } from '../../chunk-
|
|
3
|
-
import { resolveEnvDriverSession, resolveRegistryBinding, credentialsForEveryProvider, registryModelEntries, selectableEntries, isStockCatalogEndpoint, entrySurface, entryBaseUrl, entryModelIds } from '../../chunk-
|
|
2
|
+
import { SubprocessCliDriver, extractText, extractCost, extractTokens } from '../../chunk-QXA2W6UB.js';
|
|
3
|
+
import { resolveEnvDriverSession, resolveRegistryBinding, credentialsForEveryProvider, registryModelEntries, selectableEntries, isStockCatalogEndpoint, entrySurface, entryBaseUrl, entryModelIds } from '../../chunk-GYZJKZPJ.js';
|
|
4
4
|
import '../../chunk-B4X2N7JQ.js';
|
|
5
5
|
import '../../chunk-YROR332M.js';
|
|
6
|
-
import { getBridgeLogger, registryDriverConfig } from '../../chunk-
|
|
7
|
-
import { BUILTIN_DRIVER_CATALOG, providerCredentialEnvName } from '../../chunk-
|
|
6
|
+
import { getBridgeLogger, registryDriverConfig } from '../../chunk-QSLXB44M.js';
|
|
7
|
+
import { BUILTIN_DRIVER_CATALOG, providerCredentialEnvName } from '../../chunk-LQT2IKYY.js';
|
|
8
8
|
import '../../chunk-6E6PKKAD.js';
|
|
9
9
|
import '../../chunk-PIC23DDE.js';
|
|
10
10
|
import '../../chunk-4GY63JU6.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { checkToolInputSchema } from '../../chunk-
|
|
2
|
-
import { entrySurface } from '../../chunk-
|
|
3
|
-
import { dispatchCapability } from '../../chunk-
|
|
1
|
+
import { checkToolInputSchema } from '../../chunk-L2AMXONH.js';
|
|
2
|
+
import { entrySurface } from '../../chunk-GYZJKZPJ.js';
|
|
3
|
+
import { dispatchCapability } from '../../chunk-AJ7EGIFR.js';
|
|
4
4
|
import { ReconfigureLedger, stripRunnerPrivateEnv, classifyGenericErrorMessage } from '../../chunk-B4X2N7JQ.js';
|
|
5
5
|
import { wrapAgentCommand, resolveAgentExec } from '../../chunk-YROR332M.js';
|
|
6
|
-
import { AgentDriver, getBridgeLogger, TOOL_ALLOWLIST_UNSUPPORTED, registryDriverConfig } from '../../chunk-
|
|
7
|
-
import { BUILTIN_DRIVER_CATALOG, unresolvedProviderCredentials, entryCredentialValue, providerCredentialEnvName } from '../../chunk-
|
|
6
|
+
import { AgentDriver, getBridgeLogger, TOOL_ALLOWLIST_UNSUPPORTED, registryDriverConfig } from '../../chunk-QSLXB44M.js';
|
|
7
|
+
import { BUILTIN_DRIVER_CATALOG, unresolvedProviderCredentials, entryCredentialValue, providerCredentialEnvName } from '../../chunk-LQT2IKYY.js';
|
|
8
8
|
import '../../chunk-6E6PKKAD.js';
|
|
9
|
-
import { withActivityLabelJsonSchema } from '../../chunk-
|
|
9
|
+
import { withActivityLabelJsonSchema } from '../../chunk-Y56YIT6J.js';
|
|
10
10
|
import '../../chunk-ICSCSM5D.js';
|
|
11
11
|
import '../../chunk-DKXNKFKP.js';
|
|
12
12
|
import { AI_PROVIDER_SURFACES, registryEntries, isEntryEnabled, parseModelRef, normalizeEntryBaseUrl, resolveEntryBaseUrl } from '../../chunk-MJHSLODD.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { driverSessionConfigHome, removeSessionConfigFile, writeSessionConfigFile } from '../../chunk-EAZECHPM.js';
|
|
2
|
-
import { SubprocessCliDriver, extractText } from '../../chunk-
|
|
3
|
-
import { resolveEnvDriverSession, resolveRegistryBinding, harnessModelSelector, credentialsForEveryProvider, registryModelEntries, selectableEntries, isStockCatalogEndpoint, entrySurface, entryBaseUrl, entryModelIds, versionedAnthropicBaseUrl } from '../../chunk-
|
|
2
|
+
import { SubprocessCliDriver, extractText } from '../../chunk-QXA2W6UB.js';
|
|
3
|
+
import { resolveEnvDriverSession, resolveRegistryBinding, harnessModelSelector, credentialsForEveryProvider, registryModelEntries, selectableEntries, isStockCatalogEndpoint, entrySurface, entryBaseUrl, entryModelIds, versionedAnthropicBaseUrl } from '../../chunk-GYZJKZPJ.js';
|
|
4
4
|
import '../../chunk-B4X2N7JQ.js';
|
|
5
5
|
import '../../chunk-YROR332M.js';
|
|
6
|
-
import { getBridgeLogger, registryDriverConfig } from '../../chunk-
|
|
7
|
-
import { BUILTIN_DRIVER_CATALOG, providerCredentialEnvName } from '../../chunk-
|
|
6
|
+
import { getBridgeLogger, registryDriverConfig } from '../../chunk-QSLXB44M.js';
|
|
7
|
+
import { BUILTIN_DRIVER_CATALOG, providerCredentialEnvName } from '../../chunk-LQT2IKYY.js';
|
|
8
8
|
import '../../chunk-6E6PKKAD.js';
|
|
9
9
|
import '../../chunk-PIC23DDE.js';
|
|
10
10
|
import '../../chunk-4GY63JU6.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { GeminiFamilyDriver } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import { resolveRegistryBinding } from '../../chunk-
|
|
4
|
-
import { fetchProviderModels } from '../../chunk-
|
|
1
|
+
import { GeminiFamilyDriver } from '../../chunk-QBY74UBH.js';
|
|
2
|
+
import '../../chunk-QXA2W6UB.js';
|
|
3
|
+
import { resolveRegistryBinding } from '../../chunk-GYZJKZPJ.js';
|
|
4
|
+
import { fetchProviderModels } from '../../chunk-ZPCABSSW.js';
|
|
5
5
|
import '../../chunk-B4X2N7JQ.js';
|
|
6
6
|
import '../../chunk-YROR332M.js';
|
|
7
|
-
import { getBridgeLogger, registryDriverConfig } from '../../chunk-
|
|
8
|
-
import { BUILTIN_DRIVER_CATALOG, entryCredentialValue } from '../../chunk-
|
|
7
|
+
import { getBridgeLogger, registryDriverConfig } from '../../chunk-QSLXB44M.js';
|
|
8
|
+
import { BUILTIN_DRIVER_CATALOG, entryCredentialValue } from '../../chunk-LQT2IKYY.js';
|
|
9
9
|
import '../../chunk-6E6PKKAD.js';
|
|
10
10
|
import '../../chunk-YK3XLEQJ.js';
|
|
11
11
|
import '../../chunk-ICSCSM5D.js';
|
package/dist/bridge/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export { BridgeRuntime, EventNormalizer, checkDriverModel, createRuntime, detectFileChange, detectFileChanges, labelToolCall, summarizeToolCall, summarizeToolResult, validateApiKey } from '../chunk-
|
|
2
|
-
export { ANTHROPIC_DEFAULT_BASE_URL, APPROVE_ONCE, DENY, agentTranscriptStore, approvalCardOf, buildClaudeEndpointEnv, claudeEndpointMode, localTranscriptStore, probeResumeTranscript, resolveClaudeConfigDir, transcriptStoreForRuntime } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { BridgeRuntime, EventNormalizer, checkDriverModel, createRuntime, detectFileChange, detectFileChanges, labelToolCall, summarizeToolCall, summarizeToolResult, validateApiKey } from '../chunk-QW534EZB.js';
|
|
2
|
+
export { ANTHROPIC_DEFAULT_BASE_URL, APPROVE_ONCE, DENY, agentTranscriptStore, approvalCardOf, buildClaudeEndpointEnv, claudeEndpointMode, localTranscriptStore, probeResumeTranscript, resolveClaudeConfigDir, transcriptStoreForRuntime } from '../chunk-3OYOBTY4.js';
|
|
3
|
+
import '../chunk-5SWED2LW.js';
|
|
4
4
|
export { CODEX_NATIVE_STATE_FORMAT, CodexNativeStateUnavailable } from '../chunk-LOO5CB5M.js';
|
|
5
|
-
export { dispatchCapability, filterRenderCapabilities, renderFallback } from '../chunk-
|
|
6
|
-
export { ModelTierResolutionError, PROVIDER_MODEL_TIERS, STATIC_MODELS, fetchProviderModels, getModels, getStaticModels, modelIdTargetForEntry, resolveManifestModel, resolveModelCapabilities, resolveModelTier } from '../chunk-
|
|
5
|
+
export { dispatchCapability, filterRenderCapabilities, renderFallback } from '../chunk-AJ7EGIFR.js';
|
|
6
|
+
export { ModelTierResolutionError, PROVIDER_MODEL_TIERS, STATIC_MODELS, fetchProviderModels, getModels, getStaticModels, modelIdTargetForEntry, resolveManifestModel, resolveModelCapabilities, resolveModelTier } from '../chunk-ZPCABSSW.js';
|
|
7
7
|
export { AccountUnavailableError, AuthError, RUNNER_PRIVATE_ENV_KEYS, ReconfigureLedger, classifyClaudeSdkError, reclassifyAuthAsAccountUnavailable, scopeReconfigureModel, stripRunnerPrivateEnv } from '../chunk-B4X2N7JQ.js';
|
|
8
8
|
export { AGENT_EXEC_ENV, agentExecRequested, resolveAgentExec, wrapAgentCommand } from '../chunk-YROR332M.js';
|
|
9
|
-
export { AGENT_EFFORT_LEVELS, AgentDriver, TOOL_ALLOWLIST_UNSUPPORTED, getBridgeLogger, registryDriverConfig, toAgentEffort, toMergedRegistry } from '../chunk-
|
|
10
|
-
export { AI_PROVIDER_PRESETS, BUILTIN_DRIVER_CATALOG, DRIVER_CATALOG, PROVIDER_CREDENTIAL_ENV_PREFIX, PROVIDER_CREDENTIAL_ENV_SUFFIX, buildCredentialHeaders, catalogLayer, conventionalCredentialEnvName, createDriver, driverCapabilities, entryCredentialEnv, entryCredentialValue, expandPreset, getProviderPreset, listDrivers, listModelsForDriver, listProviderPresets, presetBaseUrl, probeProviderEntry, providerCredentialEnvName, registerBuiltinDrivers, registryCredentialEnv, resolveEntryCredential, resolvePresetBaseUrl, resolveProbeUrl, supportsLiveToolUpdates, unresolvedProviderCredentials } from '../chunk-
|
|
9
|
+
export { AGENT_EFFORT_LEVELS, AgentDriver, TOOL_ALLOWLIST_UNSUPPORTED, getBridgeLogger, registryDriverConfig, toAgentEffort, toMergedRegistry } from '../chunk-QSLXB44M.js';
|
|
10
|
+
export { AI_PROVIDER_PRESETS, BUILTIN_DRIVER_CATALOG, DRIVER_CATALOG, PROVIDER_CREDENTIAL_ENV_PREFIX, PROVIDER_CREDENTIAL_ENV_SUFFIX, buildCredentialHeaders, catalogLayer, conventionalCredentialEnvName, createDriver, driverCapabilities, entryCredentialEnv, entryCredentialValue, expandPreset, getProviderPreset, listDrivers, listModelsForDriver, listProviderPresets, presetBaseUrl, probeProviderEntry, providerCredentialEnvName, registerBuiltinDrivers, registryCredentialEnv, resolveEntryCredential, resolvePresetBaseUrl, resolveProbeUrl, supportsLiveToolUpdates, unresolvedProviderCredentials } from '../chunk-LQT2IKYY.js';
|
|
11
11
|
import '../chunk-6E6PKKAD.js';
|
|
12
|
-
import '../chunk-
|
|
12
|
+
import '../chunk-Y56YIT6J.js';
|
|
13
13
|
import '../chunk-YK3XLEQJ.js';
|
|
14
14
|
import '../chunk-PIC23DDE.js';
|
|
15
15
|
import '../chunk-4GY63JU6.js';
|
|
@@ -43,11 +43,14 @@ export declare class ClaudeSdkDriver extends AgentDriver {
|
|
|
43
43
|
private toolIdToName;
|
|
44
44
|
private prevText;
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
47
|
-
* Lets {@link handleStreamEvent} emit only the
|
|
48
|
-
*
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
* The sanitized text already streamed for the current message, exactly as the
|
|
47
|
+
* `_textDelta`s carried it. Lets {@link handleStreamEvent} emit only the
|
|
48
|
+
* newly-stable sanitized suffix, so a leaked marker that spans deltas is never
|
|
49
|
+
* half-sent, and lets {@link flushHeldBackText} send what was held back.
|
|
50
|
+
*/
|
|
51
|
+
private emittedSanitizedText;
|
|
52
|
+
/** Set once this message's sanitized text stopped extending what was streamed (logged once). */
|
|
53
|
+
private streamDiverged;
|
|
51
54
|
/** Set once the streaming text of the current message classifies as a self-healable auth render. */
|
|
52
55
|
private suppressingAuthStream;
|
|
53
56
|
/**
|
|
@@ -144,6 +147,11 @@ export declare class ClaudeSdkDriver extends AgentDriver {
|
|
|
144
147
|
private readonly subagentToolAllowlists;
|
|
145
148
|
/** Guards against duplicate agent_end emissions per turn. */
|
|
146
149
|
private turnCompleted;
|
|
150
|
+
/**
|
|
151
|
+
* The last `result` ended a self-started turn while a prompt pushed during it
|
|
152
|
+
* was still queued: the prompted turn ends on the result of the turn that answers it.
|
|
153
|
+
*/
|
|
154
|
+
private resultEndedWakeOnly;
|
|
147
155
|
/** Announces the turns the CLI starts by itself and the background tasks they continue. */
|
|
148
156
|
private readonly selfTurns;
|
|
149
157
|
/** Set by {@link kill}: no turn may start or replay on this driver again. */
|
|
@@ -267,15 +275,17 @@ export declare class ClaudeSdkDriver extends AgentDriver {
|
|
|
267
275
|
/** Per-model usage of the most recent completed turn, derived in `captureResultUsage`. */
|
|
268
276
|
private _lastModelUsage;
|
|
269
277
|
/**
|
|
270
|
-
* The raw `modelUsage` map from the most recently seen result message
|
|
278
|
+
* The raw `modelUsage` map from the most recently seen result message, or the
|
|
279
|
+
* map a resumed spawn restored (see {@link seedCostBaseline}). Like
|
|
271
280
|
* `total_cost_usd` it is cumulative over the whole SDK run, so a turn's share
|
|
272
281
|
* is the per-model difference against this snapshot.
|
|
273
282
|
*/
|
|
274
283
|
private _lastCumulativeModelUsage;
|
|
275
284
|
/**
|
|
276
|
-
* The SDK's `total_cost_usd` from the most recently seen result message
|
|
277
|
-
* cumulative over the whole SDK
|
|
278
|
-
* the next result's total to
|
|
285
|
+
* The SDK's `total_cost_usd` from the most recently seen result message, or
|
|
286
|
+
* the total a resumed spawn restored — cumulative over the whole SDK
|
|
287
|
+
* run/session, not per-turn. Diffed against the next result's total to
|
|
288
|
+
* derive the per-turn delta.
|
|
279
289
|
*/
|
|
280
290
|
private _lastCumulativeCostUsd;
|
|
281
291
|
/** Per-turn cost delta derived from `total_cost_usd`, emitted as the `result` event's `costUsd`. */
|
|
@@ -283,13 +293,19 @@ export declare class ClaudeSdkDriver extends AgentDriver {
|
|
|
283
293
|
/** Whether the last result carried `total_cost_usd`; 0 alone cannot tell a free turn from an unreported one. */
|
|
284
294
|
private _lastCostReported;
|
|
285
295
|
/**
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
*
|
|
296
|
+
* SDK session the cumulative baseline (`_lastCumulativeCostUsd`,
|
|
297
|
+
* `_lastCumulativeModelUsage`) belongs to. A spawn that resumes this session
|
|
298
|
+
* keeps the baseline, because the CLI restores the same totals; any other
|
|
299
|
+
* spawn re-seeds it in {@link seedCostBaseline}.
|
|
289
300
|
*/
|
|
290
|
-
private
|
|
291
|
-
/**
|
|
292
|
-
|
|
301
|
+
private _costBaselineSessionId;
|
|
302
|
+
/**
|
|
303
|
+
* The transcript's `cost-state` when a spawn kept the in-memory baseline.
|
|
304
|
+
* Consulted by the spawn's first result only: the CLI stamps `cost-state` at
|
|
305
|
+
* exit, so a hard-killed or still-exiting old process can leave it restoring
|
|
306
|
+
* less than was booked.
|
|
307
|
+
*/
|
|
308
|
+
private _staleRestoreFallback;
|
|
293
309
|
/**
|
|
294
310
|
* `true` when the active credential is a Claude Code OAuth subscription
|
|
295
311
|
* (no API key in config) rather than a raw `ANTHROPIC_API_KEY`. Set on
|
|
@@ -546,6 +562,27 @@ export declare class ClaudeSdkDriver extends AgentDriver {
|
|
|
546
562
|
* the safety net for poison introduced mid-turn within the current lifetime.
|
|
547
563
|
*/
|
|
548
564
|
private preventivelyScrubTranscript;
|
|
565
|
+
/**
|
|
566
|
+
* Set the cumulative baseline a new spawn's results are diffed against.
|
|
567
|
+
*
|
|
568
|
+
* `total_cost_usd` and `modelUsage` are run-cumulative, and on `--resume` the
|
|
569
|
+
* CLI restores both from the transcript's last `cost-state` entry, so the
|
|
570
|
+
* first result of a resumed spawn restates everything booked before it. The
|
|
571
|
+
* restored totals are therefore the baseline, not new spend:
|
|
572
|
+
* - resuming the session the in-memory baseline belongs to (a recycle or a
|
|
573
|
+
* replay in this driver lifetime) keeps that baseline. It is what was
|
|
574
|
+
* booked, so spend the old process made without a result still counts;
|
|
575
|
+
* - resuming any other session (a wake: a new driver) takes the transcript's
|
|
576
|
+
* `cost-state`, read in the same pass as the scrub;
|
|
577
|
+
* - a fresh session, or a transcript without a `cost-state`, starts at zero.
|
|
578
|
+
* A first total below the kept baseline means the CLI restored an older
|
|
579
|
+
* stamp; {@link captureResultUsage} then diffs against the transcript's
|
|
580
|
+
* `cost-state` when it fits, else books the total (it never goes negative).
|
|
581
|
+
* A stale stamp whose first total still reaches the kept baseline cannot be
|
|
582
|
+
* told apart from a correct restore, so that case under-books by the gap
|
|
583
|
+
* rather than double-counting; it is logged at info.
|
|
584
|
+
*/
|
|
585
|
+
private seedCostBaseline;
|
|
549
586
|
/**
|
|
550
587
|
* Resolve the AI provider registry entry this session addresses, plus
|
|
551
588
|
* everything derived from it: the child env, the credential, the
|
|
@@ -628,10 +665,11 @@ export declare class ClaudeSdkDriver extends AgentDriver {
|
|
|
628
665
|
*
|
|
629
666
|
* A tool whose declared schema has a property key the API rejects
|
|
630
667
|
* ({@link checkToolPropertyKeys}) is left out and reported in `dropped`.
|
|
631
|
-
* Only the key rule applies here: `jsonSchemaToZodLoose` copies
|
|
632
|
-
* verbatim
|
|
633
|
-
* array/record/any,
|
|
634
|
-
*
|
|
668
|
+
* Only the key rule applies here: `jsonSchemaToZodLoose` copies top-level
|
|
669
|
+
* keys verbatim (nested ones only when they pass the key rule) and flattens
|
|
670
|
+
* every other construct to string/number/boolean/array/object/record/any,
|
|
671
|
+
* so the wire schema is always valid draft 2020-12 and a declared-schema
|
|
672
|
+
* meta check would drop tools that work.
|
|
635
673
|
*/
|
|
636
674
|
private buildCapabilityMcpServer;
|
|
637
675
|
/** Fetch and cache slash commands from the SDK query. */
|
|
@@ -804,6 +842,19 @@ export declare class ClaudeSdkDriver extends AgentDriver {
|
|
|
804
842
|
private assistantTextOf;
|
|
805
843
|
private textIsAuthRender;
|
|
806
844
|
private handleStreamEvent;
|
|
845
|
+
/**
|
|
846
|
+
* Stream the part of `safe` (the sanitized text so far) not yet sent. Only a
|
|
847
|
+
* strict extension of what was sent is streamed: deltas cannot be taken back.
|
|
848
|
+
*/
|
|
849
|
+
private emitSanitizedDelta;
|
|
850
|
+
/**
|
|
851
|
+
* Send the tail {@link streamingSafeSanitize} held back while the message
|
|
852
|
+
* streamed. Once the message is complete nothing more can arrive, so only an
|
|
853
|
+
* unclosed leaked block stays cut ({@link finalizeStreamedText}). Without this
|
|
854
|
+
* a held-back tail (e.g. after an unclosed `[`) is lost: the consumer keeps
|
|
855
|
+
* only the deltas.
|
|
856
|
+
*/
|
|
857
|
+
private flushHeldBackText;
|
|
807
858
|
private handleUserMessage;
|
|
808
859
|
private handleResultMessage;
|
|
809
860
|
/**
|
|
@@ -845,7 +896,10 @@ export declare class ClaudeSdkDriver extends AgentDriver {
|
|
|
845
896
|
* the render path already recognised on the same text.
|
|
846
897
|
*/
|
|
847
898
|
private handleResultErrorPayload;
|
|
848
|
-
/**
|
|
899
|
+
/**
|
|
900
|
+
* Build an SDKUserMessage for the persistent prompt stream. The uuid comes back
|
|
901
|
+
* stamped on the assistant messages of the turn that takes the prompt.
|
|
902
|
+
*/
|
|
849
903
|
private buildUserMessage;
|
|
850
904
|
private mapAssistantMessage;
|
|
851
905
|
private mapToolResults;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-sdk.d.ts","sourceRoot":"","sources":["../../../../bridge/src/drivers/claude-sdk.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EAExB,KAAK,eAAe,EACpB,KAAK,UAAU,EAEhB,MAAM,0BAA0B,CAAC;AAmBlC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
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A0BlD,gEAAgE;IACvD,cAAc,IAAI,MAAM,GAAG,IAAI;IAI/B,aAAa,IAAI,UAAU,GAAG,IAAI;IAIlC,gBAAgB,IAAI,MAAM,GAAG,IAAI;IAIjC,gBAAgB,IAAI,MAAM,GAAG,IAAI;IAI1C;;;;;;OAMG;IACY,qBAAqB,CAClC,IAAI,GAAE;QAAE,MAAM,CAAC,EAAE,kBAAkB,CAAA;KAAO,GACzC,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAWhC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAiCnC;;;;;;;;OAQG;IACH,OAAO,CAAC,qBAAqB;IAgC7B;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAazB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,gBAAgB;CAezB;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,WAAW,CAc3D,CAAC"}
|
|
@@ -12,6 +12,9 @@ export type TurnOriginMessage = {
|
|
|
12
12
|
is_backgrounded?: boolean;
|
|
13
13
|
status?: string;
|
|
14
14
|
};
|
|
15
|
+
/** The CLI stamps the prompts a turn has consumed on that turn's assistant messages. */
|
|
16
|
+
user_message_uuid?: string;
|
|
17
|
+
user_message_uuids?: string[];
|
|
15
18
|
};
|
|
16
19
|
/**
|
|
17
20
|
* Tells the turns the CLI starts by itself from the ones the driver prompted,
|
|
@@ -27,17 +30,24 @@ export type TurnOriginMessage = {
|
|
|
27
30
|
*
|
|
28
31
|
* A wake it cannot tie to a task (a schedule the CLI keeps, a notification that
|
|
29
32
|
* arrived while a turn was running) is reported with no task ids, which a host
|
|
30
|
-
* must read as "origin unknown".
|
|
33
|
+
* must read as "origin unknown". A wake lists only tasks it reported started:
|
|
34
|
+
* any other id would make the host distrust the whole wake.
|
|
31
35
|
*/
|
|
32
36
|
export declare class SelfTurnTracker {
|
|
33
37
|
private readonly emit;
|
|
34
38
|
private active;
|
|
35
|
-
/**
|
|
39
|
+
/** The self-started turn took a prompt pushed while it ran: its result answers that prompt too. */
|
|
36
40
|
private joined;
|
|
37
|
-
/**
|
|
41
|
+
/** A prompt pushed during the self-started turn that the CLI has not taken yet. */
|
|
42
|
+
private queuedPrompt;
|
|
43
|
+
/** This CLI stamps consumed prompts' uuids on assistant messages, so taking one is observable. */
|
|
44
|
+
private stampsPrompts;
|
|
45
|
+
/** Tasks reported settled since the last turn ended, oldest first; only ones reported started. */
|
|
38
46
|
private readonly settled;
|
|
39
47
|
/** Tasks registered in the foreground: reported only if they move to the background. */
|
|
40
48
|
private readonly foreground;
|
|
49
|
+
/** Tasks announced with `background_task_started`, the only ids a host can tie to a turn. */
|
|
50
|
+
private readonly reported;
|
|
41
51
|
constructor(emit: (event: AgentEvent) => void);
|
|
42
52
|
/** Whether the turn running now is one the driver did not prompt. */
|
|
43
53
|
get selfTurnActive(): boolean;
|
|
@@ -53,10 +63,18 @@ export declare class SelfTurnTracker {
|
|
|
53
63
|
*/
|
|
54
64
|
get stampsTerminal(): boolean;
|
|
55
65
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
66
|
+
* Whether the next `result` ends the self-started turn alone: a prompt pushed
|
|
67
|
+
* during it is still queued, so the CLI answers it in a turn of its own, and
|
|
68
|
+
* the prompted turn must wait for that turn's result.
|
|
58
69
|
*/
|
|
59
|
-
|
|
70
|
+
get resultEndsWakeOnly(): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* The driver pushed a prompt (`uuid`) into the live CLI. During a self-started
|
|
73
|
+
* turn the CLI may fold it into that turn or answer it in a turn of its own;
|
|
74
|
+
* the prompt joins the wake only once the CLI stamps its uuid on the wake's
|
|
75
|
+
* output. A CLI not seen to stamp uuids is assumed to fold it in.
|
|
76
|
+
*/
|
|
77
|
+
onPromptPushed(uuid?: string): void;
|
|
60
78
|
/** The running turn's `result` was handled. */
|
|
61
79
|
onResult(): void;
|
|
62
80
|
/**
|
|
@@ -66,6 +84,7 @@ export declare class SelfTurnTracker {
|
|
|
66
84
|
onPromptedTurnEnd(): void;
|
|
67
85
|
/** The CLI process is gone: its tasks will never report again. */
|
|
68
86
|
reset(): void;
|
|
87
|
+
private observeConsumedPrompts;
|
|
69
88
|
private observeTask;
|
|
70
89
|
private reportStarted;
|
|
71
90
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-self-turns.d.ts","sourceRoot":"","sources":["../../../../bridge/src/drivers/claude-self-turns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C,mGAAmG;AACnG,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"claude-self-turns.d.ts","sourceRoot":"","sources":["../../../../bridge/src/drivers/claude-self-turns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C,mGAAmG;AACnG,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACn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}
|
|
@@ -37,6 +37,16 @@
|
|
|
37
37
|
* when it contains none.
|
|
38
38
|
*/
|
|
39
39
|
export declare function sanitizeAssistantText(text: string): string;
|
|
40
|
+
/**
|
|
41
|
+
* The text to keep once a streamed message is complete: {@link sanitizeAssistantText}
|
|
42
|
+
* plus the cut before an unclosed `[function_calls]` / `[invoke` opener, since a
|
|
43
|
+
* reply that stops inside a leaked block (e.g. at `max_tokens`) never closes it.
|
|
44
|
+
* Unlike {@link streamingSafeSanitize} it releases the tails held back only
|
|
45
|
+
* because more text might follow (a partial marker, a role label, whitespace).
|
|
46
|
+
*
|
|
47
|
+
* @param text - The complete assistant text of the message.
|
|
48
|
+
*/
|
|
49
|
+
export declare function finalizeStreamedText(text: string): string;
|
|
40
50
|
/**
|
|
41
51
|
* Streaming-safe variant of {@link sanitizeAssistantText}.
|
|
42
52
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize-assistant-text.d.ts","sourceRoot":"","sources":["../../../../bridge/src/drivers/sanitize-assistant-text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AA0CH;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAiC1D;
|
|
1
|
+
{"version":3,"file":"sanitize-assistant-text.d.ts","sourceRoot":"","sources":["../../../../bridge/src/drivers/sanitize-assistant-text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AA0CH;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAiC1D;AAwFD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIzD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAmB1D"}
|
|
@@ -120,6 +120,26 @@ export interface ScrubTranscriptResult {
|
|
|
120
120
|
* file was not found) — the caller should not retry the resume.
|
|
121
121
|
*/
|
|
122
122
|
changed: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* The last valid `cost-state` entry of this session, read during the same
|
|
125
|
+
* pass. The CLI restores its run totals from it on `--resume`, so it is the
|
|
126
|
+
* baseline of the resumed spawn's first `total_cost_usd` and `modelUsage`.
|
|
127
|
+
* `null` when the transcript holds none (the CLI then starts from zero) or
|
|
128
|
+
* could not be read.
|
|
129
|
+
*/
|
|
130
|
+
costState: TranscriptCostState | null;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The run totals the Claude Code CLI saves into a transcript as a
|
|
134
|
+
* `{"type":"cost-state"}` entry and restores on `--resume`.
|
|
135
|
+
*
|
|
136
|
+
* @category Transcript repair
|
|
137
|
+
*/
|
|
138
|
+
export interface TranscriptCostState {
|
|
139
|
+
/** The CLI's run-cumulative `total_cost_usd` at the time of the save. */
|
|
140
|
+
totalCostUSD: number;
|
|
141
|
+
/** The CLI's run-cumulative per-model usage, keyed by model id, in SDK field names. */
|
|
142
|
+
modelUsage: Record<string, Record<string, number>>;
|
|
123
143
|
}
|
|
124
144
|
/**
|
|
125
145
|
* Identify an image's media type from the leading bytes of its base64 payload.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrub-transcript.d.ts","sourceRoot":"","sources":["../../../../bridge/src/drivers/scrub-transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAQH;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC5D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE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EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;;OAMG;IACH,SAAS,EAAE,mBAAmB,GAAG,IAAI,CAAC;CACvC;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,yEAAyE;IACzE,YAAY,EAAE,MAAM,CAAC;IACrB,uFAAuF;IACvF,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACpD;AAeD;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAwCjE;AA6FD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,GAAE,MAAuB,GACjC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAoBxB;AA+BD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,eAoBlC,CAAC;AA8EF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,sBAAsB,GAC3B,OAAO,CAAC,qBAAqB,CAAC,CAsGhC"}
|
|
@@ -221,6 +221,40 @@ var localTranscriptStore = {
|
|
|
221
221
|
await tryWithFsDeadline(`unlink ${tmpPath}`, () => unlink(tmpPath), void 0, fsDeadlineMs());
|
|
222
222
|
}
|
|
223
223
|
};
|
|
224
|
+
var COST_STATE_MODEL_FIELDS = [
|
|
225
|
+
"inputTokens",
|
|
226
|
+
"outputTokens",
|
|
227
|
+
"cacheReadInputTokens",
|
|
228
|
+
"cacheCreationInputTokens",
|
|
229
|
+
"webSearchRequests",
|
|
230
|
+
"costUSD"
|
|
231
|
+
];
|
|
232
|
+
function isCount(value) {
|
|
233
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0;
|
|
234
|
+
}
|
|
235
|
+
function readCostState(line, sessionId) {
|
|
236
|
+
if (!line.includes('"cost-state"')) return null;
|
|
237
|
+
let entry;
|
|
238
|
+
try {
|
|
239
|
+
entry = JSON.parse(line.replace(/^\0+/, ""));
|
|
240
|
+
} catch {
|
|
241
|
+
return null;
|
|
242
|
+
}
|
|
243
|
+
if (entry.type !== "cost-state" || entry.sessionId !== sessionId) return null;
|
|
244
|
+
const total = entry.totalCostUSD;
|
|
245
|
+
if (!isCount(total)) return null;
|
|
246
|
+
const usage = entry.modelUsage;
|
|
247
|
+
if (!usage || typeof usage !== "object" || Array.isArray(usage)) return null;
|
|
248
|
+
for (const model of Object.values(usage)) {
|
|
249
|
+
if (!model || typeof model !== "object") return null;
|
|
250
|
+
const counters = model;
|
|
251
|
+
if (!COST_STATE_MODEL_FIELDS.every((field) => isCount(counters[field]))) return null;
|
|
252
|
+
}
|
|
253
|
+
return {
|
|
254
|
+
totalCostUSD: total,
|
|
255
|
+
modelUsage: usage
|
|
256
|
+
};
|
|
257
|
+
}
|
|
224
258
|
function repairLine(line, counters) {
|
|
225
259
|
if (line.trim() === "") return line;
|
|
226
260
|
const eol = line.endsWith("\r") ? "\r" : "";
|
|
@@ -247,7 +281,8 @@ async function scrubPoisonedTranscript(opts) {
|
|
|
247
281
|
corrected: 0,
|
|
248
282
|
stubbed: 0,
|
|
249
283
|
cacheStripped: 0,
|
|
250
|
-
changed: false
|
|
284
|
+
changed: false,
|
|
285
|
+
costState: null
|
|
251
286
|
};
|
|
252
287
|
let filePath;
|
|
253
288
|
try {
|
|
@@ -266,11 +301,15 @@ async function scrubPoisonedTranscript(opts) {
|
|
|
266
301
|
}
|
|
267
302
|
result.filePath = filePath;
|
|
268
303
|
const counters = { corrected: 0, stubbed: 0, cacheStripped: 0 };
|
|
304
|
+
let costState = null;
|
|
269
305
|
try {
|
|
270
306
|
await withFsDeadline(
|
|
271
307
|
`scan transcript ${filePath}`,
|
|
272
308
|
async () => {
|
|
273
|
-
for await (const line of streamLines(store.read(filePath)))
|
|
309
|
+
for await (const line of streamLines(store.read(filePath))) {
|
|
310
|
+
repairLine(line, counters);
|
|
311
|
+
costState = readCostState(line, sessionId) ?? costState;
|
|
312
|
+
}
|
|
274
313
|
},
|
|
275
314
|
timeoutMs
|
|
276
315
|
);
|
|
@@ -284,6 +323,7 @@ async function scrubPoisonedTranscript(opts) {
|
|
|
284
323
|
result.corrected = counters.corrected;
|
|
285
324
|
result.stubbed = counters.stubbed;
|
|
286
325
|
result.cacheStripped = counters.cacheStripped;
|
|
326
|
+
result.costState = costState;
|
|
287
327
|
if (totalChanges(counters) === 0) {
|
|
288
328
|
return result;
|
|
289
329
|
}
|
|
@@ -512,5 +552,5 @@ async function probeResumeTranscript(sessionId, opts) {
|
|
|
512
552
|
}
|
|
513
553
|
|
|
514
554
|
export { ANTHROPIC_DEFAULT_BASE_URL, APPROVE_ONCE, DENY, agentTranscriptStore, approvalCardOf, buildClaudeEndpointEnv, claudeEndpointMode, localTranscriptStore, probeResumeTranscript, resolveClaudeConfigDir, scrubPoisonedTranscript, transcriptStoreForRuntime };
|
|
515
|
-
//# sourceMappingURL=chunk-
|
|
516
|
-
//# sourceMappingURL=chunk-
|
|
555
|
+
//# sourceMappingURL=chunk-3OYOBTY4.js.map
|
|
556
|
+
//# sourceMappingURL=chunk-3OYOBTY4.js.map
|