deepline 0.3.552 → 0.3.554
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/dist/bundling-sources/sdk/src/client-core.ts +107 -12
- package/dist/bundling-sources/sdk/src/compat.ts +239 -87
- package/dist/bundling-sources/sdk/src/config.ts +113 -2
- package/dist/bundling-sources/sdk/src/errors.ts +2 -0
- package/dist/bundling-sources/sdk/src/http-core.ts +118 -8
- package/dist/bundling-sources/sdk/src/index.ts +2 -0
- package/dist/bundling-sources/sdk/src/integrations.ts +6 -4
- package/dist/bundling-sources/sdk/src/play.ts +3 -0
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +1 -1
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +8 -1
- package/dist/bundling-sources/sdk/src/tool-calls.ts +2 -1
- package/dist/bundling-sources/sdk/src/tool-failure-hint.ts +104 -0
- package/dist/bundling-sources/sdk/src/types.ts +9 -1
- package/dist/bundling-sources/shared_libs/integration-contracts/billing-entitlements.ts +4 -2
- package/dist/bundling-sources/shared_libs/integration-contracts/billing-plan-skus.ts +25 -0
- package/dist/bundling-sources/shared_libs/monitors/action-actor.ts +2 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/credit-recovery.ts +58 -4
- package/dist/bundling-sources/shared_libs/monitors/billing/policy-builders.ts +8 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/pricing.ts +11 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/types.ts +13 -0
- package/dist/bundling-sources/shared_libs/monitors/deactivation-reasons.ts +103 -5
- package/dist/bundling-sources/shared_libs/monitors/fleets/converge-admission.ts +133 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/fence-attention.ts +165 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/fence-release.ts +726 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/fence-walk.ts +274 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/issues.ts +1 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +28 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/provider-bulk-wait.ts +126 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/shared-payload.ts +189 -0
- package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +28 -0
- package/dist/bundling-sources/shared_libs/monitors/inbound-publish-key.ts +4 -0
- package/dist/bundling-sources/shared_libs/monitors/inventory-counter-errors.ts +25 -0
- package/dist/bundling-sources/shared_libs/monitors/org-monitor-limits.ts +65 -0
- package/dist/bundling-sources/shared_libs/monitors/package.json +9 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-callback-verification.ts +152 -1
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +6 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-capability.ts +390 -10
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-errors.ts +34 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-identity-claims.ts +66 -30
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-state.ts +30 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-resource-failure.ts +26 -3
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +41 -13
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/raw-receipt-causes.ts +219 -0
- package/dist/bundling-sources/shared_libs/monitors/snitcher-ip2company.ts +21 -10
- package/dist/bundling-sources/shared_libs/monitors/starter-templates.ts +13 -0
- package/dist/bundling-sources/shared_libs/monitors/tracking-provider-guidance.ts +6 -0
- package/dist/bundling-sources/shared_libs/monitors/tracking-provider-integrations.ts +13 -0
- package/dist/bundling-sources/shared_libs/observability/dlq.ts +1 -1
- package/dist/bundling-sources/shared_libs/observability/log-metadata.ts +5 -3
- package/dist/bundling-sources/shared_libs/observability/queue-health.ts +10 -1
- package/dist/bundling-sources/shared_libs/observability/queue-item-connectors.ts +1 -0
- package/dist/bundling-sources/shared_libs/observability/redaction.ts +24 -1
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +168 -41
- package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +1 -2
- package/dist/bundling-sources/shared_libs/play-data-plane/preview-r2-oidc.ts +188 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +170 -16
- package/dist/bundling-sources/shared_libs/play-data-plane/runtime-sheet-storage-contract.ts +5 -0
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +68 -2
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +444 -39
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-fetch-caller-deadline.ts +200 -0
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/runtime-topology.ts +21 -1
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +3 -2
- package/dist/bundling-sources/shared_libs/play-runtime/durable-summary-events.ts +70 -2
- package/dist/bundling-sources/shared_libs/play-runtime/durable-tool-identity.ts +3 -3
- package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +16 -0
- package/dist/bundling-sources/shared_libs/play-runtime/experiment-switches.ts +72 -0
- package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +7 -1
- package/dist/bundling-sources/shared_libs/play-runtime/internal-bootstrap-token.ts +62 -0
- package/dist/bundling-sources/shared_libs/play-runtime/map-memory-limits.ts +74 -3
- package/dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts +31 -3
- package/dist/bundling-sources/shared_libs/play-runtime/play-http-request.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +8 -0
- package/dist/bundling-sources/shared_libs/play-runtime/query-result-dataset.ts +19 -0
- package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +39 -2
- package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +9 -1
- package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +33 -0
- package/dist/bundling-sources/shared_libs/play-runtime/run-ledger-projection-contract.ts +24 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +254 -44
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +87 -6
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +241 -10
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox-egress.ts +161 -14
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox.ts +16 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api-compression.ts +37 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api-paths.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +259 -52
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +13 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-constants.ts +30 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +62 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-scheduler-topology.ts +36 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sheet-row-transition.ts +36 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-speed-profile.ts +206 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +42 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +185 -64
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-slot-ledger.ts +157 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts +110 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-listener-hint.ts +323 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/executor-attempt-standing.ts +72 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/integration-operation-value-storage.ts +23 -4
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-workspace-purge.ts +199 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +632 -66
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +517 -16
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-api-origin.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-receipt-value-storage.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +599 -2
- package/dist/bundling-sources/shared_libs/play-runtime/secret-resolution-retry-policy.ts +26 -1
- package/dist/bundling-sources/shared_libs/play-runtime/startup-read-tool-ids.ts +60 -0
- package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +51 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-call-retry-facts.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +113 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +5 -7
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-storage-contract.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/workflow-executor-auth.ts +3 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +40 -5
- package/dist/bundling-sources/shared_libs/plays/deploy/api-client.ts +3 -0
- package/dist/bundling-sources/shared_libs/plays/deploy/control-plane-types.ts +16 -0
- package/dist/bundling-sources/shared_libs/plays/deploy/run-deployment.ts +10 -41
- package/dist/bundling-sources/shared_libs/plays/extension-bridge.ts +33 -0
- package/dist/bundling-sources/shared_libs/plays/row-identity.ts +18 -1
- package/dist/bundling-sources/shared_libs/plays/tool-execution-error.ts +108 -0
- package/dist/bundling-sources/shared_libs/plays/trigger-config-contract.ts +14 -0
- package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +171 -0
- package/dist/bundling-sources/shared_libs/product-notifications/events.ts +27 -1
- package/dist/bundling-sources/shared_libs/security/email-blacklist.ts +9 -24
- package/dist/bundling-sources/shared_libs/security/secret-redaction.ts +178 -5
- package/dist/bundling-sources/shared_libs/security/signup-email-dns-screen.ts +148 -0
- package/dist/bundling-sources/shared_libs/tool-execution-error.ts +108 -0
- package/dist/cli/{auth-KVSBJZOX.mjs → auth-HJUNW7T2.mjs} +8 -7
- package/dist/cli/auth-SP6SKZJZ.js +44 -0
- package/dist/cli/{billing-FQREA7UA.js → billing-4TSA5HEC.js} +297 -161
- package/dist/cli/{billing-54RHFEBI.mjs → billing-SJYRJAQ2.mjs} +197 -61
- package/dist/cli/{chunk-4MK42735.js → chunk-2HMN5H54.js} +215 -130
- package/dist/cli/{chunk-UBKA33KY.mjs → chunk-2MGZAI54.mjs} +17 -0
- package/dist/cli/{chunk-EOPEYCY7.mjs → chunk-2ORPFQUA.mjs} +18 -18
- package/dist/cli/{chunk-RQZQVFCJ.js → chunk-2OVHNHCF.js} +2 -2
- package/dist/cli/{chunk-QX7LFGJR.mjs → chunk-33WRQSQ2.mjs} +1874 -91
- package/dist/cli/{chunk-UPMRIVZB.js → chunk-3IKGZ4CG.js} +74 -13
- package/dist/cli/{chunk-EUPVF4SU.mjs → chunk-3Z4VFCXO.mjs} +8 -8
- package/dist/cli/{chunk-GKYAYLRI.js → chunk-4DOFGIEJ.js} +27 -31
- package/dist/cli/{chunk-4TALT2M3.mjs → chunk-52Q5KETX.mjs} +69 -3
- package/dist/cli/{chunk-RBEUVDZF.js → chunk-5CYZHOKI.js} +249 -107
- package/dist/cli/{chunk-LX35AXTN.mjs → chunk-5TYLSS4Q.mjs} +6 -6
- package/dist/cli/{chunk-IYSTRCLX.mjs → chunk-62AUAWQV.mjs} +4 -4
- package/dist/cli/{chunk-ZIAXDBXX.mjs → chunk-62HWJXST.mjs} +17 -21
- package/dist/cli/{chunk-QY3ZNU6Z.mjs → chunk-6EXOAT6T.mjs} +2 -2
- package/dist/cli/{chunk-EITMD3A5.js → chunk-6VLFQZK6.js} +8 -8
- package/dist/cli/{chunk-ADRC5I3R.js → chunk-7OWI736E.js} +30 -30
- package/dist/cli/{chunk-NURW5XH4.mjs → chunk-ASB47RXJ.mjs} +1 -1
- package/dist/cli/{chunk-PTVD2GVQ.mjs → chunk-B6HO2XWH.mjs} +13 -13
- package/dist/cli/{chunk-YJHE3O5M.mjs → chunk-BOZAP2EM.mjs} +141 -56
- package/dist/cli/chunk-BVXIGOBZ.js +32 -0
- package/dist/cli/{chunk-XDVT3GOM.js → chunk-CFJFUVX2.js} +18 -1
- package/dist/cli/{chunk-WE5HES3H.mjs → chunk-D6Z6POKE.mjs} +151 -43
- package/dist/cli/{chunk-AZQ264ID.mjs → chunk-DSKSFFK2.mjs} +1 -1
- package/dist/cli/{chunk-SHLFOPD6.js → chunk-DUBXUAAO.js} +5 -5
- package/dist/cli/{chunk-V436Z54K.js → chunk-E2G2DNAB.js} +3 -1
- package/dist/cli/{chunk-HO3XK3R7.js → chunk-E74KGKFZ.js} +8 -8
- package/dist/cli/{chunk-77AAAGVB.js → chunk-ECHKAC7M.js} +2 -2
- package/dist/cli/{chunk-KWSH5T7K.js → chunk-EN5NHCCQ.js} +21 -21
- package/dist/cli/{chunk-6RZOWL2V.mjs → chunk-F7CMRKSK.mjs} +1 -1
- package/dist/cli/{chunk-JWUAX6OP.js → chunk-FBAFX43W.js} +11 -11
- package/dist/cli/{chunk-AQWQ2BFX.mjs → chunk-FXQ3JKE3.mjs} +1 -1
- package/dist/cli/{chunk-QPKH23EC.mjs → chunk-GA2M3G3Y.mjs} +5 -5
- package/dist/cli/{chunk-G4O75EXF.js → chunk-GHT2NDL7.js} +18 -18
- package/dist/cli/{chunk-MF2GHZDO.js → chunk-GRZENGNE.js} +2 -2
- package/dist/cli/{chunk-4UUR4TCH.js → chunk-IVZKMJUK.js} +1875 -92
- package/dist/cli/{chunk-FTJLJCE5.mjs → chunk-KVBQY4ST.mjs} +3 -3
- package/dist/cli/{chunk-S5S355UY.mjs → chunk-KZHBDMGF.mjs} +12 -12
- package/dist/cli/{chunk-BBTKAASQ.js → chunk-LFQJW4S2.js} +42 -1
- package/dist/cli/{chunk-6ZORHRKB.mjs → chunk-LRZGS6RZ.mjs} +2 -0
- package/dist/cli/{chunk-2WFPHBR4.js → chunk-LY5MMXFF.js} +47 -29
- package/dist/cli/{chunk-BAIST2BR.js → chunk-M7STM3MZ.js} +36 -36
- package/dist/cli/{chunk-SL6MYJYM.js → chunk-MJTVX4QK.js} +35 -35
- package/dist/cli/{chunk-45PVGZST.js → chunk-OPTV7D2V.js} +508 -361
- package/dist/cli/{chunk-PFO3ISXA.js → chunk-OVEYWO4H.js} +174 -129
- package/dist/cli/{chunk-BGBJV26E.mjs → chunk-PC2FTUCP.mjs} +4 -4
- package/dist/cli/{chunk-WLN3SUIA.js → chunk-PQQMPUCZ.js} +3 -3
- package/dist/cli/{chunk-HYC4MKGK.mjs → chunk-Q7ACILL2.mjs} +5 -5
- package/dist/cli/{chunk-CBV7AKWM.js → chunk-R6DZ6NQ2.js} +5 -5
- package/dist/cli/{chunk-57VZVF5D.mjs → chunk-RBBTCYQB.mjs} +3 -3
- package/dist/cli/{chunk-F2LH7TGF.js → chunk-RTHMGSZX.js} +21 -21
- package/dist/cli/{chunk-YLTMXJFC.mjs → chunk-S6W6SJ6E.mjs} +158 -16
- package/dist/cli/chunk-STXDSVQZ.mjs +32 -0
- package/dist/cli/{chunk-WEHCBH5R.mjs → chunk-TGUQET3O.mjs} +67 -6
- package/dist/cli/{chunk-IHRKLXZN.js → chunk-TJ6HLN56.js} +5 -5
- package/dist/cli/{chunk-3FD5EQ62.js → chunk-TOO3YM5N.js} +6 -7
- package/dist/cli/{chunk-QILKGXYF.mjs → chunk-UBBYHB2B.mjs} +2 -2
- package/dist/cli/{chunk-6PRW5UBA.mjs → chunk-UC4BDZKI.mjs} +299 -69
- package/dist/cli/{chunk-634ZDA3F.js → chunk-UNNOZKRT.js} +1 -1
- package/dist/cli/{chunk-IDVVIXPJ.js → chunk-UOT7HPBH.js} +41 -41
- package/dist/cli/{chunk-6YCA5NKJ.js → chunk-UYCZFQYQ.js} +12 -12
- package/dist/cli/{chunk-7IKQKKNX.js → chunk-VIUUTEHY.js} +90 -24
- package/dist/cli/{chunk-Z5TSLLOW.mjs → chunk-VLO5NFH2.mjs} +63 -18
- package/dist/cli/{chunk-U7QRMBIY.mjs → chunk-VQ75KX7G.mjs} +5 -5
- package/dist/cli/{chunk-4NQF6KJ3.js → chunk-VV4XGZ24.js} +13 -13
- package/dist/cli/{chunk-FSIVF2SI.mjs → chunk-VZGLIK5U.mjs} +1 -1
- package/dist/cli/{chunk-S46HWQKO.js → chunk-W6CZDTIR.js} +69 -69
- package/dist/cli/{chunk-XVB7V4N7.js → chunk-WL7P32PI.js} +161 -53
- package/dist/cli/{chunk-DJ2JDK4O.mjs → chunk-XD3MFTHA.mjs} +1 -1
- package/dist/cli/{chunk-GGGAEVCX.mjs → chunk-XFZX6FNM.mjs} +40 -22
- package/dist/cli/{chunk-AWJPDPMA.mjs → chunk-XU6QNM4D.mjs} +1 -1
- package/dist/cli/{chunk-QAORXEY3.mjs → chunk-YCOGPOUX.mjs} +6 -7
- package/dist/cli/{chunk-VQALXEXO.js → chunk-YQKCH4R7.js} +348 -118
- package/dist/cli/{chunk-6O5HOODW.mjs → chunk-YY55NYAH.mjs} +207 -60
- package/dist/cli/{chunk-JL2OTMSG.mjs → chunk-Z3A2S3QM.mjs} +41 -0
- package/dist/cli/command-docs.js +3 -3
- package/dist/cli/command-docs.mjs +2 -2
- package/dist/cli/{concurrent-runs-help-Q4KPAUJX.mjs → concurrent-runs-help-O3Q5IPLF.mjs} +9 -8
- package/dist/cli/concurrent-runs-help-ZFRZWX5V.js +22 -0
- package/dist/cli/{csv-F5VAGX4K.js → csv-4ZQ2RATI.js} +16 -15
- package/dist/cli/{csv-2PTVDNO6.mjs → csv-Y3BFPEM6.mjs} +7 -6
- package/dist/cli/{db-IEDXAUF7.mjs → db-3JYY4JNN.mjs} +17 -17
- package/dist/cli/{db-Z3OIUFMM.js → db-VEIFS4M7.js} +45 -45
- package/dist/cli/describe-EVJ4MFVU.mjs +50 -0
- package/dist/cli/describe-FG625QPF.js +50 -0
- package/dist/cli/describe-core.d.mts +3 -3
- package/dist/cli/describe-core.d.ts +3 -3
- package/dist/cli/describe-core.js +7 -7
- package/dist/cli/describe-core.mjs +6 -6
- package/dist/cli/{executions-H6H5655J.js → executions-HPZXOOVX.js} +12 -12
- package/dist/cli/{executions-R3LP74QN.mjs → executions-PCXZKEHM.mjs} +10 -10
- package/dist/cli/{feedback-WL3MRVT5.mjs → feedback-Y6VKZNY6.mjs} +9 -8
- package/dist/cli/{feedback-VFOUR66B.js → feedback-ZKFHFVL6.js} +17 -16
- package/dist/cli/git-RUBMALLH.js +26 -0
- package/dist/cli/{git-YX2J4GCI.mjs → git-UMPR2QYC.mjs} +8 -7
- package/dist/cli/index.js +170 -158
- package/dist/cli/index.mjs +60 -48
- package/dist/cli/{integrations-E2JZYKHS.js → integrations-3GQCTRTF.js} +23 -27
- package/dist/cli/{integrations-5ZK5KLVP.mjs → integrations-V3TM6XAB.mjs} +15 -19
- package/dist/cli/{legacy-noops-SMN3GSXY.mjs → legacy-noops-JZBUD7ZE.mjs} +9 -8
- package/dist/cli/{legacy-noops-3VW4IJTH.js → legacy-noops-VYCO7NGW.js} +12 -11
- package/dist/cli/{mcp-UQV2K4EW.js → mcp-4OIWTCE6.js} +121 -48
- package/dist/cli/{mcp-V6MGCYAG.mjs → mcp-PH4KZ76P.mjs} +100 -27
- package/dist/cli/{monitors-R3BBDCRC.js → monitors-E2A6VPBY.js} +221 -186
- package/dist/cli/{monitors-GGKS5W6M.mjs → monitors-SSMGIDGX.mjs} +58 -23
- package/dist/cli/org-SFDKSK5D.mjs +2289 -0
- package/dist/cli/org-WUDZGWBT.js +2289 -0
- package/dist/cli/outcomes-QT7LQBPK.mjs +2865 -0
- package/dist/cli/outcomes-Y7SZTLSL.js +2865 -0
- package/dist/cli/{play-MDWPR4XG.mjs → play-EK7KSFPL.mjs} +376 -106
- package/dist/cli/{play-2MVO27VO.js → play-GDNHCRRR.js} +1150 -880
- package/dist/cli/{providers-AKDYFZJZ.mjs → providers-FVZLRXAU.mjs} +10 -10
- package/dist/cli/{providers-2AACRUZH.js → providers-ZKOSECLV.js} +13 -13
- package/dist/cli/{quickstart-H6IV3PV3.js → quickstart-KSDKIXYD.js} +9 -8
- package/dist/cli/{quickstart-QDGRJFZY.mjs → quickstart-UJZ6PIQV.mjs} +7 -6
- package/dist/cli/{run-RTSQNGRD.mjs → run-E7MZ7P35.mjs} +35 -33
- package/dist/cli/{run-2634REDK.js → run-PD2BBG6S.js} +55 -53
- package/dist/cli/run-identity-LMLFMACS.js +31 -0
- package/dist/cli/{run-identity-MRNCEGV2.mjs → run-identity-MAZ7ANH5.mjs} +9 -3
- package/dist/cli/search-TKSPTPHA.js +32 -0
- package/dist/cli/{search-6AOJ4XPP.mjs → search-VTFUFTOY.mjs} +11 -11
- package/dist/cli/{search-output-S5ODBL5E.js → search-output-G2AGDCOY.js} +13 -12
- package/dist/cli/{search-output-6ADMTOU5.mjs → search-output-PFVXQCWA.mjs} +10 -9
- package/dist/cli/{secrets-TFIFBFB3.mjs → secrets-7CIMEMX7.mjs} +11 -11
- package/dist/cli/{secrets-LHCIIHMT.js → secrets-BCOQ4U7U.js} +20 -20
- package/dist/cli/sessions-4CO556VD.js +23 -0
- package/dist/cli/{sessions-WHBVUHVW.mjs → sessions-IUCQZEF7.mjs} +9 -8
- package/dist/cli/{settings-EBONWL5C.mjs → settings-KZN62UQK.mjs} +16 -16
- package/dist/cli/{settings-CP4FVK2W.js → settings-REL4736M.js} +89 -89
- package/dist/cli/{setup-I5AZE3IU.mjs → setup-2P7OG3OU.mjs} +22 -24
- package/dist/cli/{setup-LFGHTNLQ.js → setup-2XIVBBCS.js} +62 -64
- package/dist/cli/skills-JYT5DEY6.js +37 -0
- package/dist/cli/{skills-W76AO5XE.mjs → skills-VIGNDJKI.mjs} +10 -9
- package/dist/cli/tools-NTVUQ2TG.js +57 -0
- package/dist/cli/{tools-7IJHGF6W.mjs → tools-W3QT5EJY.mjs} +24 -24
- package/dist/cli/{update-GFOPZTHY.mjs → update-GZVBVMY3.mjs} +14 -11
- package/dist/cli/update-TWJZPUZM.js +37 -0
- package/dist/cli/{views-D4NX4SBG.mjs → views-BOGEH424.mjs} +47 -49
- package/dist/cli/{views-BPL2TQJ4.js → views-TOLJNLSV.js} +62 -64
- package/dist/cli/{workflow-ZYNAUCKC.js → workflow-ENWFRK5M.js} +23 -23
- package/dist/cli/{workflow-YXP42FUI.mjs → workflow-VDG2FDQV.mjs} +13 -13
- package/dist/{client-CyXGrO4D.d.mts → client-B8f7RNF8.d.mts} +1 -1
- package/dist/{client-Bf3IpUKN.d.ts → client-C5TgXmJQ.d.ts} +1 -1
- package/dist/{client-core-BxsLnXlm.d.mts → client-core-SLLGBTht.d.mts} +268 -23
- package/dist/{client-core-BWd0lX0Z.d.ts → client-core-p0sOxnkl.d.ts} +268 -23
- package/dist/{compiler-manifest-BqwVrOri.d.ts → compiler-manifest-D_zZEh9Q.d.mts} +70 -5
- package/dist/{compiler-manifest-BqwVrOri.d.mts → compiler-manifest-D_zZEh9Q.d.ts} +70 -5
- package/dist/{errors-BU8FB99X.d.mts → errors-CZCrBFrQ.d.mts} +1 -1
- package/dist/{errors-DfVN_FUG.d.ts → errors-DsUkLrdZ.d.ts} +1 -1
- package/dist/{index-BGnvtYGc.d.ts → index-B6RTOZGC.d.ts} +1 -1
- package/dist/{index-DjZgwpGw.d.mts → index-DeOVrEmX.d.mts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +66 -55
- package/dist/index.mjs +25 -14
- package/dist/install-integrity.json +163 -144
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/bundle-play-file.mjs +23 -4
- package/dist/plays/csv-data-input.js +3 -3
- package/dist/plays/csv-data-input.mjs +2 -2
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/plays/run-request.js +4 -4
- package/dist/plays/run-request.mjs +3 -3
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +15 -13
- package/dist/server.mjs +9 -7
- package/package.json +1 -1
- package/dist/cli/auth-MMNVWATX.js +0 -43
- package/dist/cli/chunk-AID3OYVJ.js +0 -8
- package/dist/cli/chunk-OVDNJAJN.mjs +0 -8
- package/dist/cli/concurrent-runs-help-FQAIHKKC.js +0 -21
- package/dist/cli/describe-QDANCTS3.mjs +0 -50
- package/dist/cli/describe-VUTT5ZKU.js +0 -50
- package/dist/cli/git-ETB3GH3K.js +0 -25
- package/dist/cli/org-GRYVMNSW.js +0 -1282
- package/dist/cli/org-Z37NGJV4.mjs +0 -1282
- package/dist/cli/run-identity-G257GQED.js +0 -25
- package/dist/cli/search-VTW2YNBS.js +0 -32
- package/dist/cli/sessions-CJ4FJ2WB.js +0 -22
- package/dist/cli/skills-R7EBXREW.js +0 -36
- package/dist/cli/tools-V7U2BDXM.js +0 -57
- package/dist/cli/update-4COPZETK.js +0 -34
|
@@ -55,15 +55,35 @@ export const ACTIVE_ORG_NAME_ENV = 'DEEPLINE_ACTIVE_ORG_NAME';
|
|
|
55
55
|
* retained for older CLIs that hide command groups whose key is absent.
|
|
56
56
|
*/
|
|
57
57
|
export const FEATURES_ENV = 'DEEPLINE_FEATURES';
|
|
58
|
+
/**
|
|
59
|
+
* The workspace this CLI acts in (org-teams-scim, Phase 4b). In a process
|
|
60
|
+
* environment it is a one-off choice; saved by `deepline org workspace set` it sits
|
|
61
|
+
* in the same file as the credential it belongs to. Absent: the org's default
|
|
62
|
+
* workspace.
|
|
63
|
+
*/
|
|
64
|
+
export const WORKSPACE_ID_ENV = 'DEEPLINE_WORKSPACE_ID';
|
|
58
65
|
|
|
59
66
|
/** Production API base URL. */
|
|
60
67
|
const PROD_URL = 'https://code.deepline.com';
|
|
61
68
|
|
|
62
69
|
/** Default request timeout: 60 seconds. */
|
|
63
|
-
const DEFAULT_TIMEOUT = 60_000;
|
|
70
|
+
export const DEFAULT_TIMEOUT = 60_000;
|
|
64
71
|
|
|
65
72
|
/** Default retry count for transient failures. */
|
|
66
|
-
const DEFAULT_MAX_RETRIES = 3;
|
|
73
|
+
export const DEFAULT_MAX_RETRIES = 3;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Gateway, overload and rate-limit statuses that carry no answer yet: a
|
|
77
|
+
* required request retries them like a transport failure.
|
|
78
|
+
*/
|
|
79
|
+
export const TRANSIENT_HTTP_STATUSES: ReadonlySet<number> = new Set([
|
|
80
|
+
408, 425, 429, 502, 503, 504,
|
|
81
|
+
]);
|
|
82
|
+
|
|
83
|
+
/** Backoff before automatic retry `retry` (1-based): 1 s doubling, capped at 30 s. */
|
|
84
|
+
export function defaultRetryBackoffMs(retry: number): number {
|
|
85
|
+
return Math.min(1000 * 2 ** (retry - 1), 30_000);
|
|
86
|
+
}
|
|
67
87
|
|
|
68
88
|
const PROJECT_DEEPLINE_ENV_FILE = '.env.deepline';
|
|
69
89
|
const COWORK_IGNORED_WORKSPACE_DIRS = new Set([
|
|
@@ -90,6 +110,7 @@ const CLI_ENV_ALLOWED_KEYS = new Set([
|
|
|
90
110
|
ACTIVE_ORG_ID_ENV,
|
|
91
111
|
ACTIVE_ORG_NAME_ENV,
|
|
92
112
|
FEATURES_ENV,
|
|
113
|
+
WORKSPACE_ID_ENV,
|
|
93
114
|
]);
|
|
94
115
|
|
|
95
116
|
/** Env line for a server-reported `features` list; absent input writes nothing. */
|
|
@@ -471,6 +492,16 @@ function mergePersistedEnvValues(
|
|
|
471
492
|
delete merged[ACTIVE_ORG_ID_ENV];
|
|
472
493
|
delete merged[ACTIVE_ORG_NAME_ENV];
|
|
473
494
|
delete merged[FEATURES_ENV];
|
|
495
|
+
delete merged[WORKSPACE_ID_ENV];
|
|
496
|
+
}
|
|
497
|
+
// A saved workspace belongs to one org: choosing another org (or a new key for
|
|
498
|
+
// an unknown one) returns this credential to the new org's default workspace.
|
|
499
|
+
if (
|
|
500
|
+
values[WORKSPACE_ID_ENV] === undefined &&
|
|
501
|
+
values[ACTIVE_ORG_ID_ENV] !== undefined &&
|
|
502
|
+
values[ACTIVE_ORG_ID_ENV] !== existing[ACTIVE_ORG_ID_ENV]
|
|
503
|
+
) {
|
|
504
|
+
delete merged[WORKSPACE_ID_ENV];
|
|
474
505
|
}
|
|
475
506
|
// An explicit empty features list means "none": drop the stale line
|
|
476
507
|
// rather than keeping the previous workspace's features around.
|
|
@@ -633,6 +664,85 @@ export function resolveBaseUrlOnly(options?: DeeplineClientOptions): string {
|
|
|
633
664
|
return baseUrl;
|
|
634
665
|
}
|
|
635
666
|
|
|
667
|
+
/** Where the workspace a CLI request acts in comes from. */
|
|
668
|
+
export type CliWorkspaceSource = 'option' | 'env' | 'saved' | 'default';
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* The file that holds the credential this process uses, or null when the key
|
|
672
|
+
* comes from the process environment or an explicit option (nothing to save
|
|
673
|
+
* a workspace next to).
|
|
674
|
+
*/
|
|
675
|
+
export function resolveCredentialEnvFile(
|
|
676
|
+
config: Pick<ResolvedConfig, 'baseUrl' | 'apiKey'>,
|
|
677
|
+
startDir: string = process.cwd(),
|
|
678
|
+
): { scope: 'folder' | 'global'; filePath: string; env: EnvValues } | null {
|
|
679
|
+
const apiKey = config.apiKey.trim();
|
|
680
|
+
if (!apiKey || process.env[API_KEY_ENV]?.trim()) return null;
|
|
681
|
+
const folder = getResolvedProjectAuthSource(config.baseUrl, apiKey, startDir);
|
|
682
|
+
if (folder) {
|
|
683
|
+
return { scope: 'folder', filePath: folder.filePath, env: folder.env };
|
|
684
|
+
}
|
|
685
|
+
const filePath = sdkCliEnvFilePath(config.baseUrl);
|
|
686
|
+
const env = parseEnvFile(filePath);
|
|
687
|
+
return (env[API_KEY_ENV] ?? '').trim() === apiKey
|
|
688
|
+
? { scope: 'global', filePath, env }
|
|
689
|
+
: null;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* The workspace for this process: an explicit option, then `DEEPLINE_WORKSPACE_ID` in
|
|
694
|
+
* the process environment, then the workspace saved next to the credential in
|
|
695
|
+
* use, else the org's default workspace (null).
|
|
696
|
+
*/
|
|
697
|
+
export function resolveCliWorkspace(
|
|
698
|
+
config: Pick<ResolvedConfig, 'baseUrl' | 'apiKey'>,
|
|
699
|
+
explicitWorkspace?: string | null,
|
|
700
|
+
): { workspaceId: string | null; source: CliWorkspaceSource } {
|
|
701
|
+
const option = explicitWorkspace?.trim();
|
|
702
|
+
if (option) return { workspaceId: option, source: 'option' };
|
|
703
|
+
const env = process.env[WORKSPACE_ID_ENV]?.trim();
|
|
704
|
+
if (env) return { workspaceId: env, source: 'env' };
|
|
705
|
+
const saved = resolveCredentialEnvFile(config)?.env[WORKSPACE_ID_ENV]?.trim();
|
|
706
|
+
if (saved) return { workspaceId: saved, source: 'saved' };
|
|
707
|
+
return { workspaceId: null, source: 'default' };
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* Saves (or, with null, clears) the workspace next to the credential in use, in
|
|
712
|
+
* the same file `deepline org set` wrote. Refuses when the key comes from the
|
|
713
|
+
* process environment: there is no file to save it in.
|
|
714
|
+
*/
|
|
715
|
+
export function saveCliWorkspace(
|
|
716
|
+
config: Pick<ResolvedConfig, 'baseUrl' | 'apiKey'>,
|
|
717
|
+
workspaceId: string | null,
|
|
718
|
+
): { scope: 'folder' | 'global'; filePath: string } {
|
|
719
|
+
const target = resolveCredentialEnvFile(config);
|
|
720
|
+
if (!target) {
|
|
721
|
+
throw new ConfigError(
|
|
722
|
+
`${API_KEY_ENV} comes from the environment, so there is no saved auth to add a workspace to. Set ${WORKSPACE_ID_ENV} for that invocation instead.`,
|
|
723
|
+
);
|
|
724
|
+
}
|
|
725
|
+
const values = { [WORKSPACE_ID_ENV]: workspaceId ?? '' };
|
|
726
|
+
if (target.scope === 'folder') {
|
|
727
|
+
mergeProjectEnvFile(target.filePath, values);
|
|
728
|
+
} else {
|
|
729
|
+
saveHostEnvValues(config.baseUrl, values);
|
|
730
|
+
}
|
|
731
|
+
return { scope: target.scope, filePath: target.filePath };
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
function workspaceConfig(
|
|
735
|
+
baseUrl: string,
|
|
736
|
+
apiKey: string,
|
|
737
|
+
explicitWorkspace: string | undefined,
|
|
738
|
+
): { workspace?: string } {
|
|
739
|
+
const { workspaceId } = resolveCliWorkspace(
|
|
740
|
+
{ baseUrl, apiKey },
|
|
741
|
+
explicitWorkspace,
|
|
742
|
+
);
|
|
743
|
+
return workspaceId ? { workspace: workspaceId } : {};
|
|
744
|
+
}
|
|
745
|
+
|
|
636
746
|
export function resolveConfig(options?: DeeplineClientOptions): ResolvedConfig {
|
|
637
747
|
const baseUrl = normalizeBaseUrl(
|
|
638
748
|
options?.baseUrl?.trim() || autoDetectBaseUrl(),
|
|
@@ -656,6 +766,7 @@ export function resolveConfig(options?: DeeplineClientOptions): ResolvedConfig {
|
|
|
656
766
|
baseUrl,
|
|
657
767
|
timeout: options?.timeout ?? DEFAULT_TIMEOUT,
|
|
658
768
|
maxRetries: options?.maxRetries ?? DEFAULT_MAX_RETRIES,
|
|
769
|
+
...workspaceConfig(baseUrl, apiKey, options?.workspace),
|
|
659
770
|
// Pass through untouched: the transport owns case-insensitive merging so
|
|
660
771
|
// there is exactly one place that decides which header wins.
|
|
661
772
|
...(options?.headers ? { headers: { ...options.headers } } : {}),
|
|
@@ -55,11 +55,13 @@ export class CustomerDbQueryOutcomeUnknownError extends DeeplineError {
|
|
|
55
55
|
|
|
56
56
|
export {
|
|
57
57
|
DeeplineError,
|
|
58
|
+
ProviderRejectedError,
|
|
58
59
|
ProviderTransientError,
|
|
59
60
|
ToolExecutionError,
|
|
60
61
|
getProviderUnavailableReason,
|
|
61
62
|
isProviderUnavailable,
|
|
62
63
|
isProviderWaterfallUnavailableError,
|
|
64
|
+
type ProviderRejectionCode,
|
|
63
65
|
type ProviderTransientErrorCategory,
|
|
64
66
|
type ProviderUnavailableError,
|
|
65
67
|
type ProviderUnavailableReason,
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
import type { ResolvedConfig } from './types';
|
|
24
24
|
import {
|
|
25
25
|
AuthError,
|
|
26
|
+
ConfigError,
|
|
26
27
|
DeeplineError,
|
|
27
28
|
RateLimitError,
|
|
28
29
|
ToolExecutionError,
|
|
@@ -34,8 +35,10 @@ import {
|
|
|
34
35
|
serializeToolExecutionFailure,
|
|
35
36
|
TOOL_EXECUTION_ERROR_SCHEMA_VERSION,
|
|
36
37
|
} from '../../shared_libs/plays/tool-execution-error';
|
|
38
|
+
import { playRunIdLookupPrefix } from '../../shared_libs/play-runtime/run-identity';
|
|
37
39
|
import { SDK_API_CONTRACT, SDK_VERSION } from './version';
|
|
38
40
|
import { apiErrorCodeFromResponse, apiErrorMessage } from './api-error';
|
|
41
|
+
import { attachToolFailureHint } from './tool-failure-hint';
|
|
39
42
|
import type { LiveEventEnvelope } from './types';
|
|
40
43
|
import {
|
|
41
44
|
agentSessionIdFromEnvironment,
|
|
@@ -367,7 +370,35 @@ function isRecord(value: unknown): value is Record<string, unknown> {
|
|
|
367
370
|
* const result = await http.post('/api/v2/integrations/apollo/execute', { payload: input });
|
|
368
371
|
* ```
|
|
369
372
|
*/
|
|
373
|
+
/**
|
|
374
|
+
* A Play run id inside a request path or query, raw or percent-encoded: the
|
|
375
|
+
* short form, optionally followed by its caller hash tail. Only ids that
|
|
376
|
+
* cannot be read as written (`playRunIdLookupPrefix`) are looked up.
|
|
377
|
+
*/
|
|
378
|
+
const PLAY_RUN_ID_IN_PATH =
|
|
379
|
+
/play(?:\/|%2F)(?:[a-z0-9-]+(?:\/|%2F))+run(?:\/|%2F)\d{8}t\d{6}-\d{3}-[a-z0-9]{8}(?:-caller-[a-f0-9]*)?(?![A-Za-z0-9-])/gi;
|
|
380
|
+
|
|
381
|
+
/** Each run id in `path` to look up, with the short id it is looked up by. */
|
|
382
|
+
function runIdsToLookUp(path: string): Map<string, string> {
|
|
383
|
+
const found = new Map<string, string>();
|
|
384
|
+
if (path.startsWith('/api/v2/runs/resolve')) return found;
|
|
385
|
+
for (const raw of path.match(PLAY_RUN_ID_IN_PATH) ?? []) {
|
|
386
|
+
let decoded: string;
|
|
387
|
+
try {
|
|
388
|
+
decoded = decodeURIComponent(raw);
|
|
389
|
+
} catch {
|
|
390
|
+
continue;
|
|
391
|
+
}
|
|
392
|
+
const lookup = playRunIdLookupPrefix(decoded);
|
|
393
|
+
if (lookup) found.set(raw, lookup);
|
|
394
|
+
}
|
|
395
|
+
return found;
|
|
396
|
+
}
|
|
397
|
+
|
|
370
398
|
export class HttpClient {
|
|
399
|
+
/** Full run ids by the short id that named them, for this client's life. */
|
|
400
|
+
private readonly resolvedRunIds = new Map<string, string>();
|
|
401
|
+
|
|
371
402
|
constructor(
|
|
372
403
|
private config: ResolvedConfig,
|
|
373
404
|
private readonly readLocalSkillsVersion?: (
|
|
@@ -426,6 +457,15 @@ export class HttpClient {
|
|
|
426
457
|
if (skillsVersion) {
|
|
427
458
|
headers['X-Deepline-Skills-Version'] = skillsVersion;
|
|
428
459
|
}
|
|
460
|
+
// The server checks workspace access on every request; no workspace is
|
|
461
|
+
// the org's default workspace. The header is TEAM_HEADER in
|
|
462
|
+
// @deepline/auth; `x-deepline-workspace-id` is a shipped header that
|
|
463
|
+
// names the org, so the workspace uses its own name.
|
|
464
|
+
const workspace =
|
|
465
|
+
this.config.workspace ?? env.DEEPLINE_WORKSPACE_ID?.trim();
|
|
466
|
+
if (workspace) {
|
|
467
|
+
headers['x-deepline-org-workspace-id'] = workspace;
|
|
468
|
+
}
|
|
429
469
|
const agentSessionId = agentSessionIdFromEnvironment(env);
|
|
430
470
|
if (agentSessionId) {
|
|
431
471
|
headers['X-Deepline-Agent-Session-Id'] = agentSessionId;
|
|
@@ -508,6 +548,43 @@ export class HttpClient {
|
|
|
508
548
|
);
|
|
509
549
|
}
|
|
510
550
|
|
|
551
|
+
/**
|
|
552
|
+
* Swap each run id in `path` that cannot be read as written for the full
|
|
553
|
+
* one: a short id, or a caller id with a damaged hash tail. Every run
|
|
554
|
+
* endpoint takes the full id. A run the lookup cannot find keeps its id, so
|
|
555
|
+
* the endpoint answers with its own error.
|
|
556
|
+
*/
|
|
557
|
+
private async expandRunIds(
|
|
558
|
+
path: string,
|
|
559
|
+
lookups: Map<string, string>,
|
|
560
|
+
): Promise<string> {
|
|
561
|
+
const replacements = new Map<string, string>();
|
|
562
|
+
for (const [raw, short] of lookups) {
|
|
563
|
+
let full = this.resolvedRunIds.get(short);
|
|
564
|
+
if (!full) {
|
|
565
|
+
try {
|
|
566
|
+
const resolved = await this.request<{ runId: string }>(
|
|
567
|
+
`/api/v2/runs/resolve?id=${encodeURIComponent(short)}`,
|
|
568
|
+
);
|
|
569
|
+
full = resolved.runId;
|
|
570
|
+
} catch (error) {
|
|
571
|
+
if (error instanceof DeeplineError && error.statusCode === 404) {
|
|
572
|
+
continue;
|
|
573
|
+
}
|
|
574
|
+
throw error;
|
|
575
|
+
}
|
|
576
|
+
this.resolvedRunIds.set(short, full);
|
|
577
|
+
}
|
|
578
|
+
replacements.set(raw, /%2f/i.test(raw) ? encodeURIComponent(full) : full);
|
|
579
|
+
}
|
|
580
|
+
return replacements.size === 0
|
|
581
|
+
? path
|
|
582
|
+
: path.replace(
|
|
583
|
+
PLAY_RUN_ID_IN_PATH,
|
|
584
|
+
(raw) => replacements.get(raw) ?? raw,
|
|
585
|
+
);
|
|
586
|
+
}
|
|
587
|
+
|
|
511
588
|
/**
|
|
512
589
|
* Send an HTTP request with automatic retries and error handling.
|
|
513
590
|
*
|
|
@@ -520,9 +597,14 @@ export class HttpClient {
|
|
|
520
597
|
* @throws {@link DeeplineError} on other API errors or connection failures
|
|
521
598
|
*/
|
|
522
599
|
async request<T = unknown>(
|
|
523
|
-
|
|
600
|
+
rawPath: string,
|
|
524
601
|
options?: RequestOptions,
|
|
525
602
|
): Promise<T> {
|
|
603
|
+
// Requests that name no unreadable run id must not gain an `await`,
|
|
604
|
+
// which would shift their timing.
|
|
605
|
+
const lookups = runIdsToLookUp(rawPath);
|
|
606
|
+
const path =
|
|
607
|
+
lookups.size > 0 ? await this.expandRunIds(rawPath, lookups) : rawPath;
|
|
526
608
|
const baseUrl = this.config.baseUrl;
|
|
527
609
|
const url = `${baseUrl}${path}`;
|
|
528
610
|
const method = options?.method ?? 'GET';
|
|
@@ -630,10 +712,6 @@ export class HttpClient {
|
|
|
630
712
|
|
|
631
713
|
networkPhase = 'reading_body';
|
|
632
714
|
options?.onResponse?.(response);
|
|
633
|
-
if (response.status === 404 && options?.allowNotFound) {
|
|
634
|
-
clearTimeout(timeoutId);
|
|
635
|
-
return null as T;
|
|
636
|
-
}
|
|
637
715
|
|
|
638
716
|
// Receiving headers is not completion: a stalled response body must
|
|
639
717
|
// remain inside the same request deadline and abort its connection.
|
|
@@ -641,6 +719,10 @@ export class HttpClient {
|
|
|
641
719
|
const receivedAtMs = Date.now();
|
|
642
720
|
clearTimeout(timeoutId);
|
|
643
721
|
const parsed = parseResponseBody(body);
|
|
722
|
+
throwIfTeamNotFound(response.status, parsed);
|
|
723
|
+
if (response.status === 404 && options?.allowNotFound) {
|
|
724
|
+
return null as T;
|
|
725
|
+
}
|
|
644
726
|
options?.onResponseBody?.({
|
|
645
727
|
receivedAtMs,
|
|
646
728
|
httpStatus: response.status,
|
|
@@ -689,9 +771,15 @@ export class HttpClient {
|
|
|
689
771
|
};
|
|
690
772
|
break;
|
|
691
773
|
}
|
|
692
|
-
throw
|
|
774
|
+
throw attachToolFailureHint(
|
|
775
|
+
attachToolUpstreamResponse(lastError, parsed),
|
|
776
|
+
parsed,
|
|
777
|
+
);
|
|
693
778
|
}
|
|
694
|
-
throw
|
|
779
|
+
throw attachToolFailureHint(
|
|
780
|
+
attachToolUpstreamResponse(structuredToolError, parsed),
|
|
781
|
+
parsed,
|
|
782
|
+
);
|
|
695
783
|
}
|
|
696
784
|
|
|
697
785
|
if (response.status === 429) {
|
|
@@ -946,9 +1034,14 @@ export class HttpClient {
|
|
|
946
1034
|
}
|
|
947
1035
|
|
|
948
1036
|
async *streamSse<TEvent extends LiveEventEnvelope = LiveEventEnvelope>(
|
|
949
|
-
|
|
1037
|
+
rawPath: string,
|
|
950
1038
|
options?: StreamOptions,
|
|
951
1039
|
): AsyncGenerator<TEvent> {
|
|
1040
|
+
// Requests that name no unreadable run id must not gain an `await`,
|
|
1041
|
+
// which would shift their timing.
|
|
1042
|
+
const lookups = runIdsToLookUp(rawPath);
|
|
1043
|
+
const path =
|
|
1044
|
+
lookups.size > 0 ? await this.expandRunIds(rawPath, lookups) : rawPath;
|
|
952
1045
|
const url = `${this.config.baseUrl}${path}`;
|
|
953
1046
|
const method = options?.method ?? 'GET';
|
|
954
1047
|
const headers = this.authHeaders({
|
|
@@ -980,6 +1073,7 @@ export class HttpClient {
|
|
|
980
1073
|
if (!response.ok) {
|
|
981
1074
|
const body = await response.text();
|
|
982
1075
|
const parsed = parseResponseBody(body);
|
|
1076
|
+
throwIfTeamNotFound(response.status, parsed);
|
|
983
1077
|
if (
|
|
984
1078
|
response.status === 401 &&
|
|
985
1079
|
!isProviderOriginatedHttpError(parsed)
|
|
@@ -1138,6 +1232,22 @@ export class HttpClient {
|
|
|
1138
1232
|
}
|
|
1139
1233
|
}
|
|
1140
1234
|
|
|
1235
|
+
/**
|
|
1236
|
+
* An unknown selected workspace answers 404 `TEAM_NOT_FOUND` on any route.
|
|
1237
|
+
* Callers read a bare 404 as "endpoint or resource missing" (unsupported
|
|
1238
|
+
* server, play not found, legacy fallback), so surface it as a configuration
|
|
1239
|
+
* error with no 404 status that names the workspace setting instead.
|
|
1240
|
+
*/
|
|
1241
|
+
function throwIfTeamNotFound(status: number, parsed: unknown): void {
|
|
1242
|
+
if (status !== 404 || apiErrorCodeFromResponse(parsed) !== 'TEAM_NOT_FOUND') {
|
|
1243
|
+
return;
|
|
1244
|
+
}
|
|
1245
|
+
throw new ConfigError(
|
|
1246
|
+
`${apiErrorMessage(parsed, status)} Check --workspace or ` +
|
|
1247
|
+
'DEEPLINE_WORKSPACE_ID; unset it to use the default workspace.',
|
|
1248
|
+
);
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1141
1251
|
function parseResponseBody(body: string): unknown {
|
|
1142
1252
|
try {
|
|
1143
1253
|
return JSON.parse(body);
|
|
@@ -272,6 +272,7 @@ export { DEEPLINE_TOOL_CATEGORIES } from '../../shared_libs/plays/tool-categorie
|
|
|
272
272
|
export {
|
|
273
273
|
DeeplineError,
|
|
274
274
|
CustomerDbQueryOutcomeUnknownError,
|
|
275
|
+
ProviderRejectedError,
|
|
275
276
|
ProviderTransientError,
|
|
276
277
|
ToolExecutionError,
|
|
277
278
|
getProviderUnavailableReason,
|
|
@@ -283,6 +284,7 @@ export {
|
|
|
283
284
|
ConfigError,
|
|
284
285
|
} from './errors';
|
|
285
286
|
export type {
|
|
287
|
+
ProviderRejectionCode,
|
|
286
288
|
ProviderTransientErrorCategory,
|
|
287
289
|
ProviderUnavailableError,
|
|
288
290
|
ProviderUnavailableReason,
|
|
@@ -48,7 +48,7 @@ async function findConnection(
|
|
|
48
48
|
);
|
|
49
49
|
if (matches.length === 0)
|
|
50
50
|
throw new DeeplineError(
|
|
51
|
-
`No
|
|
51
|
+
`No org connection named ${JSON.stringify(name)}. Run deepline integrations list --json.`,
|
|
52
52
|
404,
|
|
53
53
|
'NOT_FOUND',
|
|
54
54
|
);
|
|
@@ -76,9 +76,11 @@ async function changeConnection(
|
|
|
76
76
|
invalid('Use --list-calendars with Google Workspace verify or reconnect.');
|
|
77
77
|
if (row.type === 'workspace_delegation') {
|
|
78
78
|
if (row.provider !== CALENDAR_PROVIDER || !row.domain)
|
|
79
|
-
invalid(
|
|
79
|
+
invalid(
|
|
80
|
+
'The Google Workspace approval is missing its provider or domain.',
|
|
81
|
+
);
|
|
80
82
|
if (row.authorizationVersion === undefined)
|
|
81
|
-
invalid('The API did not return a
|
|
83
|
+
invalid('The API did not return a Google Workspace approval revision.');
|
|
82
84
|
if (action === 'reconnect') {
|
|
83
85
|
return verifyWorkspace(client, row.domain, options, row);
|
|
84
86
|
}
|
|
@@ -152,7 +154,7 @@ async function verifyWorkspace(
|
|
|
152
154
|
}
|
|
153
155
|
: await client.getCalendarDelegation(undefined, undefined, domain);
|
|
154
156
|
if (settings.grantRevision === undefined)
|
|
155
|
-
invalid('The API did not return a
|
|
157
|
+
invalid('The API did not return a Google Workspace approval revision.');
|
|
156
158
|
const requestedScopes = [
|
|
157
159
|
...new Set([
|
|
158
160
|
GOOGLE_WORKSPACE_AVAILABILITY_SCOPE,
|
|
@@ -68,6 +68,7 @@ import {
|
|
|
68
68
|
QUERY_RESULT_DATASET_PAGE_SIZE,
|
|
69
69
|
isCustomerDbDatasetTool,
|
|
70
70
|
isQueryResultDatasetTool,
|
|
71
|
+
readQueryResultDatasetResultRef,
|
|
71
72
|
} from '../../shared_libs/play-runtime/query-result-dataset.js';
|
|
72
73
|
import type {
|
|
73
74
|
PlayDataset,
|
|
@@ -1652,6 +1653,7 @@ function attachSdkQueryResultDatasetResult(
|
|
|
1652
1653
|
const datasetLimit =
|
|
1653
1654
|
finitePositiveInteger(dataset.returned_limit) ?? totalRows;
|
|
1654
1655
|
const effectiveCount = Math.min(totalRows, datasetLimit);
|
|
1656
|
+
const storedResultRef = readQueryResultDatasetResultRef(dataset);
|
|
1655
1657
|
const rawRows = rowsFromUnknown(raw?.rows);
|
|
1656
1658
|
const previewRows = rawRows.slice(0, 25);
|
|
1657
1659
|
const fetchPage = async (
|
|
@@ -1668,6 +1670,7 @@ function attachSdkQueryResultDatasetResult(
|
|
|
1668
1670
|
offset,
|
|
1669
1671
|
page_size: Math.min(limit, QUERY_RESULT_DATASET_PAGE_SIZE),
|
|
1670
1672
|
total_rows: totalRows,
|
|
1673
|
+
...(storedResultRef ? { result_ref: storedResultRef } : {}),
|
|
1671
1674
|
},
|
|
1672
1675
|
...(isCustomerDbDatasetTool(toolId)
|
|
1673
1676
|
? {
|
|
@@ -300,7 +300,7 @@ export async function preparePlayRunAdmission(
|
|
|
300
300
|
(request.admissionOrgId && request.admissionOrgId !== capability.orgId))
|
|
301
301
|
) {
|
|
302
302
|
throw new DeeplineError(
|
|
303
|
-
'The admission
|
|
303
|
+
'The admission org could not be pinned to this request; execution was not submitted.',
|
|
304
304
|
409,
|
|
305
305
|
'PLAY_RUN_ADMISSION_TENANT_CONFLICT',
|
|
306
306
|
);
|
|
@@ -205,7 +205,7 @@ export const SDK_RELEASE = {
|
|
|
205
205
|
// getters keep their established compatibility behavior.
|
|
206
206
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
207
207
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
208
|
-
version: '0.3.
|
|
208
|
+
version: '0.3.554',
|
|
209
209
|
updateSummary: {
|
|
210
210
|
introducedIn: '0.3.90',
|
|
211
211
|
summary:
|
|
@@ -43,6 +43,12 @@ export const RUN_WATCH_SERVER_WAIT_FROM_START = true;
|
|
|
43
43
|
/** Response header in which the run route reports whether it held a request. */
|
|
44
44
|
export const RUN_WATCH_HOLD_HEADER = 'x-deepline-run-watch-hold';
|
|
45
45
|
export const TERMINAL_LOG_PROJECTION_RETRY_LIMIT = 3;
|
|
46
|
+
/**
|
|
47
|
+
* Wait between those retries. The run is already terminal; only its final
|
|
48
|
+
* log projection is catching up, so a short fixed wait (not the poll cadence,
|
|
49
|
+
* up to 2 s) bounds the extra time to under a second.
|
|
50
|
+
*/
|
|
51
|
+
export const TERMINAL_LOG_PROJECTION_RETRY_INTERVAL_MS = 250;
|
|
46
52
|
|
|
47
53
|
type WatchHttp = {
|
|
48
54
|
get<T = unknown>(
|
|
@@ -383,7 +389,8 @@ export async function* watchRunEvents(
|
|
|
383
389
|
terminalLogProjectionRetries += 1;
|
|
384
390
|
const remaining = Math.max(
|
|
385
391
|
0,
|
|
386
|
-
pollIntervalMs
|
|
392
|
+
Math.min(pollIntervalMs, TERMINAL_LOG_PROJECTION_RETRY_INTERVAL_MS) -
|
|
393
|
+
(Date.now() - pollStartedAt),
|
|
387
394
|
);
|
|
388
395
|
if (!(await waitForNextPoll(remaining, signal))) return;
|
|
389
396
|
continue;
|
|
@@ -243,6 +243,7 @@ function resolveToolExecuteTimeoutMs(
|
|
|
243
243
|
normalized === 'deeplineagent_ai_inference' ||
|
|
244
244
|
normalized === 'ai_evaluate' ||
|
|
245
245
|
normalized === 'deeplineagent_ai_evaluate' ||
|
|
246
|
+
normalized === 'ai_decision' ||
|
|
246
247
|
normalized === 'aiinference'
|
|
247
248
|
? DEEPLINEAGENT_EXECUTE_TIMEOUT_MS
|
|
248
249
|
: undefined;
|
|
@@ -362,7 +363,7 @@ export class ToolCalls {
|
|
|
362
363
|
options?.recover)
|
|
363
364
|
) {
|
|
364
365
|
throw new DeeplineError(
|
|
365
|
-
'Use a valid
|
|
366
|
+
'Use a valid org connection name without execution recovery.',
|
|
366
367
|
400,
|
|
367
368
|
'NAMED_CONNECTION_INVALID',
|
|
368
369
|
);
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The recovery facts a failed tool call's response envelope carries next to
|
|
3
|
+
* `tool_error`: the server's fix (`operator_hint`), the input fields it named,
|
|
4
|
+
* and the billing page. A typed tool error keeps only `tool_error`, so the SDK
|
|
5
|
+
* reads these off the envelope and keeps them on the error for the CLI's
|
|
6
|
+
* `Retry:` guidance. Nothing else of the envelope is kept.
|
|
7
|
+
*/
|
|
8
|
+
export type ToolFailureHint = {
|
|
9
|
+
operator_hint?: string;
|
|
10
|
+
fields?: string[];
|
|
11
|
+
billing_url?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const FAILURE_HINT = Symbol.for('deepline.sdk.toolFailureHint');
|
|
15
|
+
const MAX_HINT_CHARS = 1_000;
|
|
16
|
+
const MAX_FIELDS = 8;
|
|
17
|
+
const MAX_FIELD_CHARS = 120;
|
|
18
|
+
|
|
19
|
+
function record(value: unknown): Record<string, unknown> | null {
|
|
20
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value)
|
|
21
|
+
? (value as Record<string, unknown>)
|
|
22
|
+
: null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function boundedText(value: unknown, max: number): string | null {
|
|
26
|
+
if (typeof value !== 'string') return null;
|
|
27
|
+
const trimmed = value.trim();
|
|
28
|
+
return trimmed && trimmed.length <= max ? trimmed : null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Long prose is clipped, not dropped: the start of a fix still helps. */
|
|
32
|
+
function clippedText(value: unknown, max: number): string | null {
|
|
33
|
+
if (typeof value !== 'string') return null;
|
|
34
|
+
const trimmed = value.trim();
|
|
35
|
+
if (!trimmed) return null;
|
|
36
|
+
return trimmed.length <= max ? trimmed : `${trimmed.slice(0, max - 1)}…`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function fieldNames(envelope: Record<string, unknown>): string[] {
|
|
40
|
+
const fields: string[] = [];
|
|
41
|
+
const add = (value: unknown) => {
|
|
42
|
+
const name = boundedText(value, MAX_FIELD_CHARS);
|
|
43
|
+
if (name && !fields.includes(name) && fields.length < MAX_FIELDS) {
|
|
44
|
+
fields.push(name);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const issues = Array.isArray(envelope.validation_issues)
|
|
48
|
+
? envelope.validation_issues
|
|
49
|
+
: [];
|
|
50
|
+
for (const issue of issues) {
|
|
51
|
+
// The execute route sends a joined string ("contact.email", "(root)");
|
|
52
|
+
// older validators send the path array.
|
|
53
|
+
const path = record(issue)?.path;
|
|
54
|
+
const name = Array.isArray(path) ? path.map(String).join('.') : path;
|
|
55
|
+
if (name !== '(root)') add(name);
|
|
56
|
+
}
|
|
57
|
+
const mappings = Array.isArray(envelope.adapter_field_mappings)
|
|
58
|
+
? envelope.adapter_field_mappings
|
|
59
|
+
: [];
|
|
60
|
+
for (const mapping of mappings) add(record(mapping)?.deepline_field);
|
|
61
|
+
return fields;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function readToolFailureHintFromEnvelope(
|
|
65
|
+
body: unknown,
|
|
66
|
+
): ToolFailureHint | null {
|
|
67
|
+
const envelope = record(body);
|
|
68
|
+
if (!envelope) return null;
|
|
69
|
+
const hint: ToolFailureHint = {};
|
|
70
|
+
const operatorHint = clippedText(envelope.operator_hint, MAX_HINT_CHARS);
|
|
71
|
+
if (operatorHint) hint.operator_hint = operatorHint;
|
|
72
|
+
const fields = fieldNames(envelope);
|
|
73
|
+
if (fields.length) hint.fields = fields;
|
|
74
|
+
const billing = record(envelope.billing);
|
|
75
|
+
const billingUrl =
|
|
76
|
+
boundedText(envelope.billing_url, MAX_HINT_CHARS) ??
|
|
77
|
+
boundedText(billing?.billing_url, MAX_HINT_CHARS);
|
|
78
|
+
if (billingUrl?.startsWith('https://')) hint.billing_url = billingUrl;
|
|
79
|
+
return Object.keys(hint).length ? hint : null;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** Keep the envelope's recovery facts on a typed tool error. */
|
|
83
|
+
export function attachToolFailureHint<T extends Error>(
|
|
84
|
+
error: T,
|
|
85
|
+
body: unknown,
|
|
86
|
+
): T {
|
|
87
|
+
const hint = readToolFailureHintFromEnvelope(body);
|
|
88
|
+
if (hint) {
|
|
89
|
+
Object.defineProperty(error, FAILURE_HINT, {
|
|
90
|
+
value: hint,
|
|
91
|
+
configurable: true,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return error;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function readToolFailureHint(error: unknown): ToolFailureHint | null {
|
|
98
|
+
if (error === null || typeof error !== 'object') return null;
|
|
99
|
+
return (
|
|
100
|
+
((error as Record<symbol, unknown>)[FAILURE_HINT] as
|
|
101
|
+
| ToolFailureHint
|
|
102
|
+
| undefined) ?? null
|
|
103
|
+
);
|
|
104
|
+
}
|
|
@@ -80,6 +80,12 @@ export interface DeeplineClientOptions {
|
|
|
80
80
|
timeout?: number;
|
|
81
81
|
/** Maximum retry attempts for transient failures (network errors, 429s). Default: `3`. */
|
|
82
82
|
maxRetries?: number;
|
|
83
|
+
/**
|
|
84
|
+
* The workspace to act in, by workspace id. Overrides
|
|
85
|
+
* `DEEPLINE_WORKSPACE_ID`. Omit it for the org's default workspace, which
|
|
86
|
+
* every member can use.
|
|
87
|
+
*/
|
|
88
|
+
workspace?: string;
|
|
83
89
|
/**
|
|
84
90
|
* Extra request headers attached to every request this client sends.
|
|
85
91
|
*
|
|
@@ -114,6 +120,8 @@ export interface ResolvedConfig {
|
|
|
114
120
|
timeout: number;
|
|
115
121
|
/** Max retry count for transient failures. */
|
|
116
122
|
maxRetries: number;
|
|
123
|
+
/** {@link DeeplineClientOptions.workspace}; absent means the env or the default workspace. */
|
|
124
|
+
workspace?: string;
|
|
117
125
|
/**
|
|
118
126
|
* Caller-supplied headers merged over the env-derived headers on every
|
|
119
127
|
* request. Absent unless the caller passed
|
|
@@ -213,7 +221,7 @@ export interface ProviderDefinition {
|
|
|
213
221
|
displayName: string;
|
|
214
222
|
toolCount: number;
|
|
215
223
|
categories: string[];
|
|
216
|
-
/** Present when the provider is
|
|
224
|
+
/** Present when the provider is in beta, admitted by an organization rollout. */
|
|
217
225
|
beta?: true;
|
|
218
226
|
/** Present for providers in the recent-additions ledger. */
|
|
219
227
|
version?: string;
|
|
@@ -87,6 +87,8 @@ export type IncludedCompute = {
|
|
|
87
87
|
/** Credits per standard-equivalent sandbox minute; null at provider cost. */
|
|
88
88
|
credits_per_minute: number | null;
|
|
89
89
|
included_minutes: number;
|
|
90
|
+
/** Database pricing is independent of sandbox opt-in; its charges share the allowance. */
|
|
91
|
+
database?: { enabled: boolean; credits_per_cu_hour: number };
|
|
90
92
|
/** What turning included compute on gives this workspace's plan. */
|
|
91
93
|
plan: { included_minutes: number; credits_per_minute: number };
|
|
92
94
|
period_start_at: string;
|
|
@@ -95,7 +97,7 @@ export type IncludedCompute = {
|
|
|
95
97
|
included_minutes_used: number;
|
|
96
98
|
/** Exact Deepline credits consumed from included compute; older servers may omit it. */
|
|
97
99
|
included_credits_used?: number;
|
|
98
|
-
/** Settled
|
|
100
|
+
/** Settled sandbox and database credits paid beyond included compute this period. */
|
|
99
101
|
overage_credits?: number;
|
|
100
102
|
minutes_used: number;
|
|
101
103
|
days: Array<{ day: string; minutes: number }>;
|
|
@@ -108,6 +110,6 @@ export type IncludedCompute = {
|
|
|
108
110
|
opt_in_credits: number;
|
|
109
111
|
has_plan_rate_charges: boolean;
|
|
110
112
|
};
|
|
111
|
-
/**
|
|
113
|
+
/** Compute charges for the same period on Growth and Team, for Pay As You Go workspaces. */
|
|
112
114
|
plan_cost_comparison?: { growth_credits: number; team_credits: number };
|
|
113
115
|
};
|