deepline 0.3.551 → 0.3.553
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 +130 -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 +124 -10
- 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 +66 -30
- 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 +11 -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-monitor-upstream-identity.ts +80 -13
- 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/tamradar-countries.ts +285 -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 +312 -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 +568 -26
- 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-runs-rollout.ts +14 -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 +92 -16
- 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 +300 -57
- 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 +298 -46
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +13 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-constants.ts +39 -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-rate-state.ts +32 -10
- 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/tool-result.ts +37 -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-E7BH4GMJ.mjs → auth-I3QAU4RV.mjs} +8 -7
- package/dist/cli/auth-MQCN7WGZ.js +44 -0
- package/dist/cli/{billing-OXKU462W.mjs → billing-3IC54OQQ.mjs} +202 -59
- package/dist/cli/{billing-DNQAZGX7.js → billing-YGFFVAIC.js} +302 -159
- package/dist/cli/{chunk-COGREZAO.js → chunk-2B5B5KAW.js} +210 -128
- package/dist/cli/{chunk-UBKA33KY.mjs → chunk-2MGZAI54.mjs} +17 -0
- package/dist/cli/{chunk-T2B5BVZE.js → chunk-3NTP2OSG.js} +13 -13
- package/dist/cli/{chunk-FOTGUFVK.mjs → chunk-45OAVGU6.mjs} +5 -5
- package/dist/cli/{chunk-54EEYLTF.js → chunk-4747TPLV.js} +3 -3
- package/dist/cli/{chunk-CLRAANWH.mjs → chunk-4BFTDNHU.mjs} +1 -1
- package/dist/cli/{chunk-BGBJV26E.mjs → chunk-4HYNMXXF.mjs} +4 -4
- package/dist/cli/{chunk-5S6PHKRV.mjs → chunk-4SMCFQ23.mjs} +1 -1
- package/dist/cli/{chunk-VWLHRZFG.mjs → chunk-55F6HNOY.mjs} +5 -5
- package/dist/cli/{chunk-LX35AXTN.mjs → chunk-5TYLSS4Q.mjs} +6 -6
- package/dist/cli/{chunk-VTGG2RT3.js → chunk-6NE3RRRY.js} +1 -1
- package/dist/cli/{chunk-EITMD3A5.js → chunk-6VLFQZK6.js} +8 -8
- package/dist/cli/{chunk-MNSTCJMX.mjs → chunk-72V4PDH5.mjs} +18 -18
- package/dist/cli/{chunk-ZCDKE4UH.js → chunk-74RES4DS.js} +5 -5
- package/dist/cli/{chunk-WKBHUB6R.js → chunk-7GEMELKI.js} +366 -320
- package/dist/cli/{chunk-C4CUZH57.js → chunk-7O6J6A7P.js} +1871 -92
- package/dist/cli/{chunk-7RSIFA72.js → chunk-7SERLBNR.js} +161 -53
- package/dist/cli/{chunk-3G6QZACZ.js → chunk-7YRJ5UC4.js} +21 -21
- package/dist/cli/{chunk-I4VKGNAQ.mjs → chunk-A7DLBE5K.mjs} +136 -54
- package/dist/cli/{chunk-GGB3JYCW.mjs → chunk-AGICYWGN.mjs} +299 -69
- package/dist/cli/{chunk-44KSACJW.mjs → chunk-AGIQDA2T.mjs} +12 -12
- package/dist/cli/{chunk-PACD5DGC.js → chunk-AGLR6QVN.js} +255 -109
- package/dist/cli/{chunk-NURW5XH4.mjs → chunk-ASB47RXJ.mjs} +1 -1
- package/dist/cli/{chunk-4OMAGJ6U.js → chunk-BVDKFS2T.js} +2 -2
- package/dist/cli/{chunk-LPJPCGT3.js → chunk-CACFJODG.js} +190 -134
- package/dist/cli/{chunk-GVYLCCKN.mjs → chunk-CAEBJOYU.mjs} +1 -1
- package/dist/cli/{chunk-XDVT3GOM.js → chunk-CFJFUVX2.js} +18 -1
- package/dist/cli/{chunk-POLUE7D5.js → chunk-DP2VH7CO.js} +12 -12
- package/dist/cli/{chunk-D6M5HFBB.mjs → chunk-DP64MD6U.mjs} +1 -1
- package/dist/cli/{chunk-W425ERWN.mjs → chunk-DZA7RFGL.mjs} +5 -5
- package/dist/cli/{chunk-R7J7CJPZ.js → chunk-E2G2DNAB.js} +4 -1
- package/dist/cli/{chunk-GGGAEVCX.mjs → chunk-E7WZOX2A.mjs} +22 -18
- package/dist/cli/{chunk-44I675YK.js → chunk-FM7LPUPA.js} +41 -41
- package/dist/cli/{chunk-2UXDHFSF.mjs → chunk-GAVZ4EOD.mjs} +1 -1
- package/dist/cli/{chunk-Z2FIOG3V.js → chunk-HEBO3XNZ.js} +27 -31
- package/dist/cli/{chunk-6PWJKMFQ.mjs → chunk-HSJ6X2AQ.mjs} +4 -4
- package/dist/cli/{chunk-UPMRIVZB.js → chunk-HVI55MTK.js} +61 -10
- package/dist/cli/{chunk-KWSH5T7K.js → chunk-IH6GDNKW.js} +21 -21
- package/dist/cli/{chunk-3KYBDAR3.js → chunk-IMX7J4DU.js} +8 -8
- package/dist/cli/{chunk-HEHVGEZV.mjs → chunk-INEMTYMT.mjs} +8 -8
- package/dist/cli/{chunk-5VVSEU67.js → chunk-IUOGII7D.js} +6 -7
- package/dist/cli/{chunk-MXGA6JFI.mjs → chunk-JJGWHITQ.mjs} +5 -5
- package/dist/cli/{chunk-QM6Y6S4E.js → chunk-JLGP5XAJ.js} +5 -5
- package/dist/cli/{chunk-V6SCP4B7.mjs → chunk-LFOERUQY.mjs} +69 -3
- package/dist/cli/{chunk-BBTKAASQ.js → chunk-LFQJW4S2.js} +42 -1
- package/dist/cli/{chunk-ZMNGZ6XS.mjs → chunk-LH5PZKER.mjs} +80 -24
- package/dist/cli/{chunk-MR5LTVHD.js → chunk-LRDHPOZW.js} +69 -69
- package/dist/cli/{chunk-5LUF4LAR.mjs → chunk-LRZGS6RZ.mjs} +3 -0
- package/dist/cli/{chunk-SL6MYJYM.js → chunk-MJTVX4QK.js} +35 -35
- package/dist/cli/{chunk-UDXULACQ.js → chunk-MLABYI4M.js} +90 -24
- package/dist/cli/{chunk-S7IZWGUA.mjs → chunk-NDNHYONK.mjs} +17 -21
- package/dist/cli/{chunk-4D3WIZST.mjs → chunk-OTV2UUKW.mjs} +164 -18
- package/dist/cli/{chunk-XYE5XPGF.js → chunk-Q6Z6N3A7.js} +18 -18
- package/dist/cli/{chunk-7WQNWJQW.mjs → chunk-QG6JIWUL.mjs} +151 -43
- package/dist/cli/{chunk-3T65J5RG.mjs → chunk-QI5S5HWB.mjs} +2 -2
- package/dist/cli/{chunk-CBV7AKWM.js → chunk-R6DZ6NQ2.js} +5 -5
- package/dist/cli/{chunk-PM7MO62Y.mjs → chunk-RMNOZKRI.mjs} +3 -3
- package/dist/cli/{chunk-NMWGZD6Y.js → chunk-RTV4RF7N.js} +36 -36
- package/dist/cli/{chunk-CQ6JYQSW.js → chunk-SBH4CKPN.js} +11 -11
- package/dist/cli/{chunk-BIIJATTX.mjs → chunk-SG3LUONJ.mjs} +3 -3
- package/dist/cli/{chunk-2WFPHBR4.js → chunk-TFEXSHPM.js} +22 -18
- package/dist/cli/{chunk-5IL7SC45.mjs → chunk-TN4TY6TT.mjs} +6 -7
- package/dist/cli/{chunk-WEHCBH5R.mjs → chunk-UEVKMZLR.mjs} +54 -3
- package/dist/cli/{chunk-RE5MJBEV.mjs → chunk-UVQJYV76.mjs} +2 -2
- package/dist/cli/{chunk-FSIVF2SI.mjs → chunk-VZGLIK5U.mjs} +1 -1
- package/dist/cli/{chunk-W2ZWQUHT.js → chunk-WOCHZCUJ.js} +2 -2
- package/dist/cli/{chunk-ZDQFBJPO.js → chunk-XLIHTJVM.js} +348 -118
- package/dist/cli/{chunk-2ZYRBMQM.js → chunk-Y6SP3JMI.js} +22 -22
- package/dist/cli/{chunk-PPSDCN6C.js → chunk-YUA6HA6D.js} +2 -2
- package/dist/cli/{chunk-JL2OTMSG.mjs → chunk-Z3A2S3QM.mjs} +41 -0
- package/dist/cli/{chunk-E64HFB4L.mjs → chunk-Z6XPSHKM.mjs} +87 -41
- package/dist/cli/{chunk-7DOQ3OEX.mjs → chunk-Z7AOIHFE.mjs} +1870 -91
- package/dist/cli/command-docs.js +3 -3
- package/dist/cli/command-docs.mjs +2 -2
- package/dist/cli/concurrent-runs-help-CFJH4KXV.js +22 -0
- package/dist/cli/{concurrent-runs-help-C6L6I5OR.mjs → concurrent-runs-help-DNV2X5AZ.mjs} +9 -8
- package/dist/cli/{csv-QMF4FWE7.js → csv-SA6ELJY6.js} +16 -15
- package/dist/cli/{csv-SYSDXFEM.mjs → csv-ZXZGHWOM.mjs} +7 -6
- package/dist/cli/{db-Q7HURWRZ.mjs → db-A54SP6AD.mjs} +16 -16
- package/dist/cli/{db-YSHPPA4H.js → db-JHFEIQBU.js} +43 -43
- package/dist/cli/describe-PHQ33AGS.mjs +50 -0
- package/dist/cli/describe-RHJ4XRFI.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 +6 -6
- package/dist/cli/describe-core.mjs +5 -5
- package/dist/cli/{executions-G7U3VUXN.mjs → executions-HL2M2DFU.mjs} +10 -10
- package/dist/cli/{executions-MWBC5TAW.js → executions-TLFZRHBJ.js} +12 -12
- package/dist/cli/{feedback-SD55OY6H.js → feedback-5UEX5UZK.js} +17 -16
- package/dist/cli/{feedback-GMHIFLBJ.mjs → feedback-QMBTNXVG.mjs} +9 -8
- package/dist/cli/git-4JWOOHBG.js +26 -0
- package/dist/cli/{git-HPE45OPD.mjs → git-LKGXVIVC.mjs} +8 -7
- package/dist/cli/index.js +170 -158
- package/dist/cli/index.mjs +60 -48
- package/dist/cli/{integrations-HFKVBY6G.js → integrations-6RUTLMN7.js} +23 -27
- package/dist/cli/{integrations-2W4MGIQR.mjs → integrations-FGGRVUJ7.mjs} +15 -19
- package/dist/cli/{legacy-noops-SXVNDEXN.js → legacy-noops-J3Z7QRWZ.js} +12 -11
- package/dist/cli/{legacy-noops-GZYKNU2Z.mjs → legacy-noops-YIPRMVXZ.mjs} +9 -8
- package/dist/cli/{mcp-PJRHQHHU.js → mcp-6LWFP7RW.js} +121 -48
- package/dist/cli/{mcp-BWA6KULG.mjs → mcp-CHDYFO7F.mjs} +100 -27
- package/dist/cli/{monitors-K2WSI6CR.js → monitors-STM6A7OU.js} +221 -186
- package/dist/cli/{monitors-SYQKCATO.mjs → monitors-UGRY2BXI.mjs} +58 -23
- package/dist/cli/org-3SYOUQCX.mjs +2289 -0
- package/dist/cli/org-ZOBSNSIB.js +2289 -0
- package/dist/cli/outcomes-H4YYAT5X.js +2865 -0
- package/dist/cli/outcomes-Z3P2JE67.mjs +2865 -0
- package/dist/cli/{play-SZXY2F2S.js → play-SM4CW2GS.js} +1116 -846
- package/dist/cli/{play-TTMABJEI.mjs → play-SN5YWLS7.mjs} +375 -105
- package/dist/cli/{providers-GQIOMRQO.mjs → providers-WZ4YBR5Y.mjs} +10 -10
- package/dist/cli/{providers-YDHCTZAF.js → providers-WZARYMCF.js} +13 -13
- package/dist/cli/{quickstart-PHSSMKCA.mjs → quickstart-2575BNKA.mjs} +7 -6
- package/dist/cli/{quickstart-BNYOXQXG.js → quickstart-PS4YHQJ6.js} +9 -8
- package/dist/cli/{run-GFIAZXVL.js → run-FLZ6OTM7.js} +51 -51
- package/dist/cli/{run-74C3C75C.mjs → run-ZUHCZOJS.mjs} +31 -31
- 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-3SWUB7KX.mjs → search-HLPPKQEO.mjs} +11 -11
- package/dist/cli/search-JJWVHR3N.js +32 -0
- package/dist/cli/{search-output-K2SWHVHQ.mjs → search-output-PDAXNOGP.mjs} +9 -8
- package/dist/cli/{search-output-6JF3S4TP.js → search-output-RXJLU36B.js} +12 -11
- package/dist/cli/{secrets-2M4XWEKE.mjs → secrets-CGELYQ3H.mjs} +11 -11
- package/dist/cli/{secrets-2SAKLH2H.js → secrets-QJNG7G2Y.js} +20 -20
- package/dist/cli/sessions-DHTBT2GN.js +23 -0
- package/dist/cli/{sessions-A64BCXTO.mjs → sessions-ELMWVR4M.mjs} +9 -8
- package/dist/cli/{settings-HV64WIJF.js → settings-44I44P5F.js} +89 -89
- package/dist/cli/{settings-SVGEC3FI.mjs → settings-RR3LZXL7.mjs} +16 -16
- package/dist/cli/{setup-EDC3NEJ3.mjs → setup-KGWRWH4B.mjs} +20 -19
- package/dist/cli/{setup-FHXOLQGQ.js → setup-KTEYOCJO.js} +60 -59
- package/dist/cli/skills-EPZPEXI2.js +37 -0
- package/dist/cli/{skills-3HGHZMXB.mjs → skills-FPRID2I5.mjs} +10 -9
- package/dist/cli/tools-IGQQ5TML.js +57 -0
- package/dist/cli/{tools-P2QS6A6Q.mjs → tools-PI4WMDLY.mjs} +23 -23
- package/dist/cli/update-4RNCVYGE.js +37 -0
- package/dist/cli/{update-552BYQM4.mjs → update-VJOJAZ7B.mjs} +14 -11
- package/dist/cli/{views-PA25NAE3.js → views-NTUOLNQU.js} +62 -64
- package/dist/cli/{views-LD5HXJYY.mjs → views-OVPSINZO.mjs} +47 -49
- package/dist/cli/{workflow-FIDBUQV6.js → workflow-2UDYDM6F.js} +23 -23
- package/dist/cli/{workflow-LDYFGBYP.mjs → workflow-7OEFNXZC.mjs} +13 -13
- package/dist/{client-DuDFiJDU.d.mts → client-B8f7RNF8.d.mts} +1 -1
- package/dist/{client-t9HZAkFD.d.ts → client-C5TgXmJQ.d.ts} +1 -1
- package/dist/{client-core-DydMQOft.d.mts → client-core-SLLGBTht.d.mts} +285 -23
- package/dist/{client-core-CJRzLanv.d.ts → client-core-p0sOxnkl.d.ts} +285 -23
- package/dist/{compiler-manifest-BqwVrOri.d.mts → compiler-manifest-D_zZEh9Q.d.mts} +70 -5
- package/dist/{compiler-manifest-BqwVrOri.d.ts → 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 +162 -142
- 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-B4PI7GVY.js +0 -43
- package/dist/cli/concurrent-runs-help-JEFQZTJI.js +0 -21
- package/dist/cli/describe-PXTSBJTL.js +0 -50
- package/dist/cli/describe-YGMQBV44.mjs +0 -50
- package/dist/cli/git-I3JV7IGH.js +0 -25
- package/dist/cli/org-5KD7X7IA.mjs +0 -1282
- package/dist/cli/org-YQ2CR32B.js +0 -1282
- package/dist/cli/run-identity-G257GQED.js +0 -25
- package/dist/cli/search-2RRRF4LW.js +0 -32
- package/dist/cli/sessions-SBH27JNW.js +0 -22
- package/dist/cli/skills-Y3SRLOYD.js +0 -36
- package/dist/cli/tools-OFYPUPUV.js +0 -57
- package/dist/cli/update-SOUSCLB7.js +0 -34
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
var _chunk6VLFQZK6js = require('./chunk-6VLFQZK6.js');
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|
|
@@ -14,15 +15,18 @@ var _chunkXNYIZMNQjs = require('./chunk-XNYIZMNQ.js');
|
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
|
|
17
|
-
var
|
|
18
|
+
var _chunkLFQJW4S2js = require('./chunk-LFQJW4S2.js');
|
|
19
|
+
|
|
18
20
|
|
|
21
|
+
var _chunkCFJFUVX2js = require('./chunk-CFJFUVX2.js');
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
|
|
24
|
+
var _chunk6NE3RRRYjs = require('./chunk-6NE3RRRY.js');
|
|
21
25
|
|
|
22
26
|
// src/version.ts
|
|
23
|
-
var SDK_VERSION =
|
|
24
|
-
var SDK_API_MAJOR =
|
|
25
|
-
var SDK_API_CONTRACT = _nullishCoalesce(
|
|
27
|
+
var SDK_VERSION = _chunk6NE3RRRYjs.SDK_RELEASE.version;
|
|
28
|
+
var SDK_API_MAJOR = _chunk6NE3RRRYjs.SDK_RELEASE.contracts.api.currentMajor;
|
|
29
|
+
var SDK_API_CONTRACT = _nullishCoalesce(_chunk6NE3RRRYjs.SDK_RELEASE.contracts.api.legacyWireIds[0], () => ( `api-v${SDK_API_MAJOR}`));
|
|
26
30
|
|
|
27
31
|
// src/agent-runtime.ts
|
|
28
32
|
var _fs = require('fs');
|
|
@@ -156,6 +160,71 @@ function detectAgentRuntime(options = {}) {
|
|
|
156
160
|
return _nullishCoalesce(options.defaultRuntime, () => ( "unknown"));
|
|
157
161
|
}
|
|
158
162
|
|
|
163
|
+
// src/tool-failure-hint.ts
|
|
164
|
+
var FAILURE_HINT = Symbol.for("deepline.sdk.toolFailureHint");
|
|
165
|
+
var MAX_HINT_CHARS = 1e3;
|
|
166
|
+
var MAX_FIELDS = 8;
|
|
167
|
+
var MAX_FIELD_CHARS = 120;
|
|
168
|
+
function record(value) {
|
|
169
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
170
|
+
}
|
|
171
|
+
function boundedText(value, max) {
|
|
172
|
+
if (typeof value !== "string") return null;
|
|
173
|
+
const trimmed = value.trim();
|
|
174
|
+
return trimmed && trimmed.length <= max ? trimmed : null;
|
|
175
|
+
}
|
|
176
|
+
function clippedText(value, max) {
|
|
177
|
+
if (typeof value !== "string") return null;
|
|
178
|
+
const trimmed = value.trim();
|
|
179
|
+
if (!trimmed) return null;
|
|
180
|
+
return trimmed.length <= max ? trimmed : `${trimmed.slice(0, max - 1)}\u2026`;
|
|
181
|
+
}
|
|
182
|
+
function fieldNames(envelope) {
|
|
183
|
+
const fields = [];
|
|
184
|
+
const add = (value) => {
|
|
185
|
+
const name = boundedText(value, MAX_FIELD_CHARS);
|
|
186
|
+
if (name && !fields.includes(name) && fields.length < MAX_FIELDS) {
|
|
187
|
+
fields.push(name);
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
const issues = Array.isArray(envelope.validation_issues) ? envelope.validation_issues : [];
|
|
191
|
+
for (const issue of issues) {
|
|
192
|
+
const path = _optionalChain([record, 'call', _87 => _87(issue), 'optionalAccess', _88 => _88.path]);
|
|
193
|
+
const name = Array.isArray(path) ? path.map(String).join(".") : path;
|
|
194
|
+
if (name !== "(root)") add(name);
|
|
195
|
+
}
|
|
196
|
+
const mappings = Array.isArray(envelope.adapter_field_mappings) ? envelope.adapter_field_mappings : [];
|
|
197
|
+
for (const mapping of mappings) add(_optionalChain([record, 'call', _89 => _89(mapping), 'optionalAccess', _90 => _90.deepline_field]));
|
|
198
|
+
return fields;
|
|
199
|
+
}
|
|
200
|
+
function readToolFailureHintFromEnvelope(body) {
|
|
201
|
+
const envelope = record(body);
|
|
202
|
+
if (!envelope) return null;
|
|
203
|
+
const hint = {};
|
|
204
|
+
const operatorHint = clippedText(envelope.operator_hint, MAX_HINT_CHARS);
|
|
205
|
+
if (operatorHint) hint.operator_hint = operatorHint;
|
|
206
|
+
const fields = fieldNames(envelope);
|
|
207
|
+
if (fields.length) hint.fields = fields;
|
|
208
|
+
const billing = record(envelope.billing);
|
|
209
|
+
const billingUrl = _nullishCoalesce(boundedText(envelope.billing_url, MAX_HINT_CHARS), () => ( boundedText(_optionalChain([billing, 'optionalAccess', _91 => _91.billing_url]), MAX_HINT_CHARS)));
|
|
210
|
+
if (_optionalChain([billingUrl, 'optionalAccess', _92 => _92.startsWith, 'call', _93 => _93("https://")])) hint.billing_url = billingUrl;
|
|
211
|
+
return Object.keys(hint).length ? hint : null;
|
|
212
|
+
}
|
|
213
|
+
function attachToolFailureHint(error, body) {
|
|
214
|
+
const hint = readToolFailureHintFromEnvelope(body);
|
|
215
|
+
if (hint) {
|
|
216
|
+
Object.defineProperty(error, FAILURE_HINT, {
|
|
217
|
+
value: hint,
|
|
218
|
+
configurable: true
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
return error;
|
|
222
|
+
}
|
|
223
|
+
function readToolFailureHint(error) {
|
|
224
|
+
if (error === null || typeof error !== "object") return null;
|
|
225
|
+
return _nullishCoalesce(error[FAILURE_HINT], () => ( null));
|
|
226
|
+
}
|
|
227
|
+
|
|
159
228
|
// src/deployment-protection.ts
|
|
160
229
|
function deploymentProtectionHeaders(env = typeof process !== "undefined" ? process.env : {}) {
|
|
161
230
|
const token = env.VERCEL_PROTECTION_BYPASS_TOKEN;
|
|
@@ -165,7 +234,7 @@ var fetchWithDeploymentProtection = (input, init) => {
|
|
|
165
234
|
const headers = new Headers(
|
|
166
235
|
input instanceof Request ? input.headers : void 0
|
|
167
236
|
);
|
|
168
|
-
new Headers(_optionalChain([init, 'optionalAccess',
|
|
237
|
+
new Headers(_optionalChain([init, 'optionalAccess', _94 => _94.headers])).forEach((value, name) => headers.set(name, value));
|
|
169
238
|
for (const [name, value] of Object.entries(deploymentProtectionHeaders())) {
|
|
170
239
|
headers.set(name, value);
|
|
171
240
|
}
|
|
@@ -260,7 +329,7 @@ function withErrorCause(error, cause) {
|
|
|
260
329
|
}
|
|
261
330
|
function mapNetworkError(baseUrl, error, targetLabel) {
|
|
262
331
|
const tagged = error;
|
|
263
|
-
const timeoutMs = _optionalChain([tagged, 'optionalAccess',
|
|
332
|
+
const timeoutMs = _optionalChain([tagged, 'optionalAccess', _95 => _95[REQUEST_TIMEOUT_MARKER]]);
|
|
264
333
|
if (typeof timeoutMs === "number") {
|
|
265
334
|
return {
|
|
266
335
|
message: `Request to ${targetLabel} timed out after ${timeoutMs}ms while waiting for a response.`,
|
|
@@ -268,7 +337,7 @@ function mapNetworkError(baseUrl, error, targetLabel) {
|
|
|
268
337
|
details: { timeoutMs, target: targetLabel }
|
|
269
338
|
};
|
|
270
339
|
}
|
|
271
|
-
if (_optionalChain([tagged, 'optionalAccess',
|
|
340
|
+
if (_optionalChain([tagged, 'optionalAccess', _96 => _96[REQUEST_ABORT_MARKER]])) {
|
|
272
341
|
return {
|
|
273
342
|
message: `Request to ${targetLabel} was aborted before it completed.`,
|
|
274
343
|
code: "NETWORK_ABORTED"
|
|
@@ -298,11 +367,11 @@ function networkCauseCode(error) {
|
|
|
298
367
|
const current = queue.shift();
|
|
299
368
|
if (!current || typeof current !== "object" || seen.has(current)) continue;
|
|
300
369
|
seen.add(current);
|
|
301
|
-
const
|
|
302
|
-
if (typeof
|
|
303
|
-
return
|
|
304
|
-
queue.push(
|
|
305
|
-
if (Array.isArray(
|
|
370
|
+
const record2 = current;
|
|
371
|
+
if (typeof record2.code === "string" && /^[A-Z][A-Z0-9_]+$/.test(record2.code))
|
|
372
|
+
return record2.code;
|
|
373
|
+
queue.push(record2.cause);
|
|
374
|
+
if (Array.isArray(record2.errors)) queue.push(...record2.errors);
|
|
306
375
|
}
|
|
307
376
|
return void 0;
|
|
308
377
|
}
|
|
@@ -310,7 +379,7 @@ function isLoopbackHost(hostname) {
|
|
|
310
379
|
return hostname === "localhost" || hostname === "[::1]" || hostname.startsWith("127.") || hostname.endsWith(".localhost");
|
|
311
380
|
}
|
|
312
381
|
function connectionFailureMessage(baseUrl, error) {
|
|
313
|
-
if (!_optionalChain([error, 'optionalAccess',
|
|
382
|
+
if (!_optionalChain([error, 'optionalAccess', _97 => _97.message])) {
|
|
314
383
|
return `Unable to connect to ${baseUrl}. Is the computer able to access the url?`;
|
|
315
384
|
}
|
|
316
385
|
const causeCode = networkCauseCode(error);
|
|
@@ -355,11 +424,29 @@ function providerLabelFromToolId(toolId) {
|
|
|
355
424
|
function isRecord(value) {
|
|
356
425
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
357
426
|
}
|
|
358
|
-
var
|
|
359
|
-
|
|
427
|
+
var PLAY_RUN_ID_IN_PATH = /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;
|
|
428
|
+
function runIdsToLookUp(path) {
|
|
429
|
+
const found = /* @__PURE__ */ new Map();
|
|
430
|
+
if (path.startsWith("/api/v2/runs/resolve")) return found;
|
|
431
|
+
for (const raw of _nullishCoalesce(path.match(PLAY_RUN_ID_IN_PATH), () => ( []))) {
|
|
432
|
+
let decoded;
|
|
433
|
+
try {
|
|
434
|
+
decoded = decodeURIComponent(raw);
|
|
435
|
+
} catch (e5) {
|
|
436
|
+
continue;
|
|
437
|
+
}
|
|
438
|
+
const lookup = _chunkCFJFUVX2js.playRunIdLookupPrefix.call(void 0, decoded);
|
|
439
|
+
if (lookup) found.set(raw, lookup);
|
|
440
|
+
}
|
|
441
|
+
return found;
|
|
442
|
+
}
|
|
443
|
+
var HttpClient = (_class = class {
|
|
444
|
+
constructor(config, readLocalSkillsVersion) {;_class.prototype.__init.call(this);
|
|
360
445
|
this.config = config;
|
|
361
446
|
this.readLocalSkillsVersion = readLocalSkillsVersion;
|
|
362
447
|
}
|
|
448
|
+
/** Full run ids by the short id that named them, for this client's life. */
|
|
449
|
+
__init() {this.resolvedRunIds = /* @__PURE__ */ new Map()}
|
|
363
450
|
cleanDiagnosticHeader(value) {
|
|
364
451
|
const normalized = String(_nullishCoalesce(value, () => ( ""))).replace(/[\u0000-\u001f\u007f]/g, " ").trim().slice(0, MAX_DIAGNOSTIC_HEADER_LENGTH);
|
|
365
452
|
return normalized || null;
|
|
@@ -374,9 +461,9 @@ var HttpClient = class {
|
|
|
374
461
|
if (explicit) return explicit;
|
|
375
462
|
try {
|
|
376
463
|
return this.cleanDiagnosticHeader(
|
|
377
|
-
_optionalChain([this, 'access',
|
|
464
|
+
_optionalChain([this, 'access', _98 => _98.readLocalSkillsVersion, 'optionalCall', _99 => _99(this.config.baseUrl)])
|
|
378
465
|
);
|
|
379
|
-
} catch (
|
|
466
|
+
} catch (e6) {
|
|
380
467
|
return null;
|
|
381
468
|
}
|
|
382
469
|
}
|
|
@@ -400,6 +487,10 @@ var HttpClient = class {
|
|
|
400
487
|
if (skillsVersion) {
|
|
401
488
|
headers["X-Deepline-Skills-Version"] = skillsVersion;
|
|
402
489
|
}
|
|
490
|
+
const workspace = _nullishCoalesce(this.config.workspace, () => ( _optionalChain([env, 'access', _100 => _100.DEEPLINE_WORKSPACE_ID, 'optionalAccess', _101 => _101.trim, 'call', _102 => _102()])));
|
|
491
|
+
if (workspace) {
|
|
492
|
+
headers["x-deepline-org-workspace-id"] = workspace;
|
|
493
|
+
}
|
|
403
494
|
const agentSessionId = agentSessionIdFromEnvironment(env);
|
|
404
495
|
if (agentSessionId) {
|
|
405
496
|
headers["X-Deepline-Agent-Session-Id"] = agentSessionId;
|
|
@@ -412,15 +503,15 @@ var HttpClient = class {
|
|
|
412
503
|
const coordinatorInternalToken = env.DEEPLINE_INTERNAL_TOKEN;
|
|
413
504
|
const absurdReleaseOverride = env.DEEPLINE_ABSURD_RELEASE;
|
|
414
505
|
const preferredReceiptGatewayMachineId = env.DEEPLINE_PREFERRED_RECEIPT_GATEWAY_MACHINE_ID;
|
|
415
|
-
if (_optionalChain([coordinatorUrl, 'optionalAccess',
|
|
506
|
+
if (_optionalChain([coordinatorUrl, 'optionalAccess', _103 => _103.trim, 'call', _104 => _104()])) {
|
|
416
507
|
headers[COORDINATOR_URL_OVERRIDE_HEADER] = coordinatorUrl.trim();
|
|
417
508
|
}
|
|
418
509
|
const workerCallbackUrl = env.DEEPLINE_WORKER_CALLBACK_URL;
|
|
419
|
-
if (_optionalChain([workerCallbackUrl, 'optionalAccess',
|
|
510
|
+
if (_optionalChain([workerCallbackUrl, 'optionalAccess', _105 => _105.trim, 'call', _106 => _106()])) {
|
|
420
511
|
headers[WORKER_CALLBACK_URL_OVERRIDE_HEADER] = workerCallbackUrl.trim();
|
|
421
512
|
}
|
|
422
513
|
const runtimeSchedulerSchema = env.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA;
|
|
423
|
-
if (_optionalChain([runtimeSchedulerSchema, 'optionalAccess',
|
|
514
|
+
if (_optionalChain([runtimeSchedulerSchema, 'optionalAccess', _107 => _107.trim, 'call', _108 => _108()])) {
|
|
424
515
|
headers[RUNTIME_SCHEDULER_SCHEMA_OVERRIDE_HEADER] = runtimeSchedulerSchema.trim();
|
|
425
516
|
}
|
|
426
517
|
const syntheticRun = env.DEEPLINE_SYNTHETIC_RUN;
|
|
@@ -428,21 +519,21 @@ var HttpClient = class {
|
|
|
428
519
|
headers[SYNTHETIC_RUN_HEADER] = "1";
|
|
429
520
|
}
|
|
430
521
|
const runtimeTestFault = env.DEEPLINE_TEST_RUNTIME_FAULT;
|
|
431
|
-
if (_optionalChain([runtimeTestFault, 'optionalAccess',
|
|
522
|
+
if (_optionalChain([runtimeTestFault, 'optionalAccess', _109 => _109.trim, 'call', _110 => _110()])) {
|
|
432
523
|
headers[PLAY_RUNTIME_TEST_FAULT_HEADER] = runtimeTestFault.trim();
|
|
433
524
|
}
|
|
434
|
-
const retainedReceivers = _optionalChain([env, 'access',
|
|
435
|
-
if (retainedReceivers && _optionalChain([coordinatorInternalToken, 'optionalAccess',
|
|
525
|
+
const retainedReceivers = _optionalChain([env, 'access', _111 => _111.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _112 => _112.trim, 'call', _113 => _113()]);
|
|
526
|
+
if (retainedReceivers && _optionalChain([coordinatorInternalToken, 'optionalAccess', _114 => _114.trim, 'call', _115 => _115()])) {
|
|
436
527
|
headers[RETAINED_PIPELINE_RECEIVERS_HEADER] = retainedReceivers;
|
|
437
528
|
headers[COORDINATOR_INTERNAL_TOKEN_HEADER] = coordinatorInternalToken.trim();
|
|
438
529
|
}
|
|
439
|
-
if (_optionalChain([absurdReleaseOverride, 'optionalAccess',
|
|
530
|
+
if (_optionalChain([absurdReleaseOverride, 'optionalAccess', _116 => _116.trim, 'call', _117 => _117()]) && _optionalChain([coordinatorInternalToken, 'optionalAccess', _118 => _118.trim, 'call', _119 => _119()])) {
|
|
440
531
|
headers[ABSURD_RELEASE_OVERRIDE_HEADER] = absurdReleaseOverride.trim();
|
|
441
532
|
}
|
|
442
|
-
if (_optionalChain([preferredReceiptGatewayMachineId, 'optionalAccess',
|
|
533
|
+
if (_optionalChain([preferredReceiptGatewayMachineId, 'optionalAccess', _120 => _120.trim, 'call', _121 => _121()]) && _optionalChain([coordinatorInternalToken, 'optionalAccess', _122 => _122.trim, 'call', _123 => _123()])) {
|
|
443
534
|
headers[PREFERRED_RECEIPT_GATEWAY_MACHINE_ID_HEADER] = preferredReceiptGatewayMachineId.trim();
|
|
444
535
|
}
|
|
445
|
-
if (_optionalChain([coordinatorInternalToken, 'optionalAccess',
|
|
536
|
+
if (_optionalChain([coordinatorInternalToken, 'optionalAccess', _124 => _124.trim, 'call', _125 => _125()]) && (_optionalChain([coordinatorUrl, 'optionalAccess', _126 => _126.trim, 'call', _127 => _127()]) || _optionalChain([workerCallbackUrl, 'optionalAccess', _128 => _128.trim, 'call', _129 => _129()]) || _optionalChain([runtimeTestFault, 'optionalAccess', _130 => _130.trim, 'call', _131 => _131()]) || _optionalChain([absurdReleaseOverride, 'optionalAccess', _132 => _132.trim, 'call', _133 => _133()]) || _optionalChain([preferredReceiptGatewayMachineId, 'optionalAccess', _134 => _134.trim, 'call', _135 => _135()]))) {
|
|
446
537
|
headers[COORDINATOR_INTERNAL_TOKEN_HEADER] = coordinatorInternalToken.trim();
|
|
447
538
|
}
|
|
448
539
|
return applyExplicitHeaders(
|
|
@@ -453,6 +544,37 @@ var HttpClient = class {
|
|
|
453
544
|
this.config.headers
|
|
454
545
|
);
|
|
455
546
|
}
|
|
547
|
+
/**
|
|
548
|
+
* Swap each run id in `path` that cannot be read as written for the full
|
|
549
|
+
* one: a short id, or a caller id with a damaged hash tail. Every run
|
|
550
|
+
* endpoint takes the full id. A run the lookup cannot find keeps its id, so
|
|
551
|
+
* the endpoint answers with its own error.
|
|
552
|
+
*/
|
|
553
|
+
async expandRunIds(path, lookups) {
|
|
554
|
+
const replacements = /* @__PURE__ */ new Map();
|
|
555
|
+
for (const [raw, short] of lookups) {
|
|
556
|
+
let full = this.resolvedRunIds.get(short);
|
|
557
|
+
if (!full) {
|
|
558
|
+
try {
|
|
559
|
+
const resolved = await this.request(
|
|
560
|
+
`/api/v2/runs/resolve?id=${encodeURIComponent(short)}`
|
|
561
|
+
);
|
|
562
|
+
full = resolved.runId;
|
|
563
|
+
} catch (error) {
|
|
564
|
+
if (error instanceof _chunkLFQJW4S2js.DeeplineError && error.statusCode === 404) {
|
|
565
|
+
continue;
|
|
566
|
+
}
|
|
567
|
+
throw error;
|
|
568
|
+
}
|
|
569
|
+
this.resolvedRunIds.set(short, full);
|
|
570
|
+
}
|
|
571
|
+
replacements.set(raw, /%2f/i.test(raw) ? encodeURIComponent(full) : full);
|
|
572
|
+
}
|
|
573
|
+
return replacements.size === 0 ? path : path.replace(
|
|
574
|
+
PLAY_RUN_ID_IN_PATH,
|
|
575
|
+
(raw) => _nullishCoalesce(replacements.get(raw), () => ( raw))
|
|
576
|
+
);
|
|
577
|
+
}
|
|
456
578
|
/**
|
|
457
579
|
* Send an HTTP request with automatic retries and error handling.
|
|
458
580
|
*
|
|
@@ -464,26 +586,28 @@ var HttpClient = class {
|
|
|
464
586
|
* @throws {@link RateLimitError} on HTTP 429 after all retries exhausted
|
|
465
587
|
* @throws {@link DeeplineError} on other API errors or connection failures
|
|
466
588
|
*/
|
|
467
|
-
async request(
|
|
589
|
+
async request(rawPath, options) {
|
|
590
|
+
const lookups = runIdsToLookUp(rawPath);
|
|
591
|
+
const path = lookups.size > 0 ? await this.expandRunIds(rawPath, lookups) : rawPath;
|
|
468
592
|
const baseUrl = this.config.baseUrl;
|
|
469
593
|
const url = `${baseUrl}${path}`;
|
|
470
|
-
const method = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
594
|
+
const method = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _136 => _136.method]), () => ( "GET"));
|
|
471
595
|
const requestStartedAt = Date.now();
|
|
472
596
|
let fetchAttempts = 0;
|
|
473
597
|
let lastRequestUrl = url;
|
|
474
598
|
let networkFailedAt;
|
|
475
599
|
let networkPhase = "before_request";
|
|
476
|
-
const headers = this.authHeaders(_optionalChain([options, 'optionalAccess',
|
|
477
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
600
|
+
const headers = this.authHeaders(_optionalChain([options, 'optionalAccess', _137 => _137.headers]));
|
|
601
|
+
if (_optionalChain([options, 'optionalAccess', _138 => _138.body]) !== void 0) {
|
|
478
602
|
applyExplicitHeaders(headers, { "Content-Type": "application/json" });
|
|
479
603
|
}
|
|
480
604
|
let lastError = null;
|
|
481
|
-
const candidateUrls = _optionalChain([options, 'optionalAccess',
|
|
605
|
+
const candidateUrls = _optionalChain([options, 'optionalAccess', _139 => _139.exactUrlOnly]) ? [url] : buildCandidateUrls(url);
|
|
482
606
|
let retryAfterHint = null;
|
|
483
607
|
let totalRetryWaitMs = 0;
|
|
484
|
-
let maxRetries = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
608
|
+
let maxRetries = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _140 => _140.maxRetries]), () => ( this.config.maxRetries));
|
|
485
609
|
requestAttempts: for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
486
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
610
|
+
if (_optionalChain([options, 'optionalAccess', _141 => _141.signal, 'optionalAccess', _142 => _142.aborted])) {
|
|
487
611
|
lastError = requestCancelledError(options.signal);
|
|
488
612
|
networkFailedAt = Date.now();
|
|
489
613
|
break;
|
|
@@ -498,7 +622,7 @@ var HttpClient = class {
|
|
|
498
622
|
totalRetryWaitMs += delayMs;
|
|
499
623
|
networkPhase = "retry_wait";
|
|
500
624
|
try {
|
|
501
|
-
await sleep(delayMs, _optionalChain([options, 'optionalAccess',
|
|
625
|
+
await sleep(delayMs, _optionalChain([options, 'optionalAccess', _143 => _143.signal]));
|
|
502
626
|
} catch (error) {
|
|
503
627
|
lastError = error instanceof Error ? error : new Error(String(error));
|
|
504
628
|
networkFailedAt = Date.now();
|
|
@@ -506,25 +630,25 @@ var HttpClient = class {
|
|
|
506
630
|
}
|
|
507
631
|
}
|
|
508
632
|
for (const candidateUrl of candidateUrls) {
|
|
509
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
633
|
+
if (_optionalChain([options, 'optionalAccess', _144 => _144.signal, 'optionalAccess', _145 => _145.aborted])) {
|
|
510
634
|
lastError = requestCancelledError(options.signal);
|
|
511
635
|
networkFailedAt = Date.now();
|
|
512
636
|
break requestAttempts;
|
|
513
637
|
}
|
|
514
638
|
const controller = new AbortController();
|
|
515
|
-
const timeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
639
|
+
const timeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _146 => _146.timeout]), () => ( this.config.timeout));
|
|
516
640
|
let requestTimedOut = false;
|
|
517
641
|
const timeoutId = setTimeout(() => {
|
|
518
642
|
requestTimedOut = true;
|
|
519
643
|
controller.abort();
|
|
520
644
|
}, timeoutMs);
|
|
521
645
|
const abortRequest = () => controller.abort();
|
|
522
|
-
_optionalChain([options, 'optionalAccess',
|
|
646
|
+
_optionalChain([options, 'optionalAccess', _147 => _147.signal, 'optionalAccess', _148 => _148.addEventListener, 'call', _149 => _149("abort", abortRequest, {
|
|
523
647
|
once: true
|
|
524
648
|
})]);
|
|
525
649
|
networkPhase = "before_request";
|
|
526
650
|
try {
|
|
527
|
-
const requestBody = _optionalChain([options, 'optionalAccess',
|
|
651
|
+
const requestBody = _optionalChain([options, 'optionalAccess', _150 => _150.formData]) !== void 0 ? typeof options.formData === "function" ? options.formData() : options.formData : _optionalChain([options, 'optionalAccess', _151 => _151.body]) !== void 0 ? JSON.stringify(options.body) : void 0;
|
|
528
652
|
fetchAttempts += 1;
|
|
529
653
|
lastRequestUrl = candidateUrl;
|
|
530
654
|
networkPhase = "awaiting_headers";
|
|
@@ -536,36 +660,36 @@ var HttpClient = class {
|
|
|
536
660
|
redirect: deploymentProtectionRedirect(headers)
|
|
537
661
|
});
|
|
538
662
|
networkPhase = "reading_body";
|
|
539
|
-
_optionalChain([options, 'optionalAccess',
|
|
540
|
-
if (response.status === 404 && _optionalChain([options, 'optionalAccess', _144 => _144.allowNotFound])) {
|
|
541
|
-
clearTimeout(timeoutId);
|
|
542
|
-
return null;
|
|
543
|
-
}
|
|
663
|
+
_optionalChain([options, 'optionalAccess', _152 => _152.onResponse, 'optionalCall', _153 => _153(response)]);
|
|
544
664
|
const body = await response.text();
|
|
545
665
|
const receivedAtMs = Date.now();
|
|
546
666
|
clearTimeout(timeoutId);
|
|
547
667
|
const parsed = parseResponseBody(body);
|
|
548
|
-
|
|
668
|
+
throwIfTeamNotFound(response.status, parsed);
|
|
669
|
+
if (response.status === 404 && _optionalChain([options, 'optionalAccess', _154 => _154.allowNotFound])) {
|
|
670
|
+
return null;
|
|
671
|
+
}
|
|
672
|
+
_optionalChain([options, 'optionalAccess', _155 => _155.onResponseBody, 'optionalCall', _156 => _156({
|
|
549
673
|
receivedAtMs,
|
|
550
674
|
httpStatus: response.status,
|
|
551
675
|
body: parsed
|
|
552
676
|
})]);
|
|
553
|
-
const responseRetryAllowed = _optionalChain([options, 'optionalAccess',
|
|
677
|
+
const responseRetryAllowed = _optionalChain([options, 'optionalAccess', _157 => _157.retryFromExecutePolicy]) !== true || parseExecuteRetryPolicy(
|
|
554
678
|
response.headers.get(EXECUTE_RETRY_POLICY_HEADER)
|
|
555
679
|
) === "transient-http-safe";
|
|
556
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
680
|
+
if (_optionalChain([options, 'optionalAccess', _158 => _158.retryFromExecutePolicy]) === true && responseRetryAllowed && options.executePolicyMaxRetries !== void 0) {
|
|
557
681
|
maxRetries = options.executePolicyMaxRetries;
|
|
558
682
|
}
|
|
559
|
-
const structuredToolError = _optionalChain([options, 'optionalAccess',
|
|
683
|
+
const structuredToolError = _optionalChain([options, 'optionalAccess', _159 => _159.toolId]) && !response.ok ? _chunkLFQJW4S2js.deserializeToolExecutionFailure.call(void 0,
|
|
560
684
|
_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status),
|
|
561
685
|
isRecord(parsed) ? parsed.tool_error : null,
|
|
562
|
-
|
|
686
|
+
_chunkLFQJW4S2js.TOOL_EXECUTION_ERROR_SCHEMA_VERSION
|
|
563
687
|
) : null;
|
|
564
688
|
if (structuredToolError) {
|
|
565
689
|
if (response.status === 429) {
|
|
566
690
|
const retryAfter = parseRetryAfter(response);
|
|
567
|
-
const failure =
|
|
568
|
-
lastError = failure === null ? structuredToolError : new (0,
|
|
691
|
+
const failure = _chunkLFQJW4S2js.serializeToolExecutionFailure.call(void 0, structuredToolError);
|
|
692
|
+
lastError = failure === null ? structuredToolError : new (0, _chunk6VLFQZK6js.ToolRateLimitError)(structuredToolError.message, {
|
|
569
693
|
...failure,
|
|
570
694
|
retryAfterMs: _nullishCoalesce(failure.retryAfterMs, () => ( Math.max(0, retryAfter)))
|
|
571
695
|
});
|
|
@@ -576,13 +700,19 @@ var HttpClient = class {
|
|
|
576
700
|
}));
|
|
577
701
|
break;
|
|
578
702
|
}
|
|
579
|
-
throw
|
|
703
|
+
throw attachToolFailureHint(
|
|
704
|
+
_chunkLFQJW4S2js.attachToolUpstreamResponse.call(void 0, lastError, parsed),
|
|
705
|
+
parsed
|
|
706
|
+
);
|
|
580
707
|
}
|
|
581
|
-
throw
|
|
708
|
+
throw attachToolFailureHint(
|
|
709
|
+
_chunkLFQJW4S2js.attachToolUpstreamResponse.call(void 0, structuredToolError, parsed),
|
|
710
|
+
parsed
|
|
711
|
+
);
|
|
582
712
|
}
|
|
583
713
|
if (response.status === 429) {
|
|
584
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
585
|
-
throw new (0,
|
|
714
|
+
if (_optionalChain([options, 'optionalAccess', _160 => _160.preserveRateLimitResponse]) && isMonitorRateLimitEnvelope(parsed)) {
|
|
715
|
+
throw new (0, _chunkLFQJW4S2js.DeeplineError)(
|
|
586
716
|
_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status),
|
|
587
717
|
response.status,
|
|
588
718
|
_chunkXNYIZMNQjs.apiErrorCodeFromResponse.call(void 0, parsed),
|
|
@@ -590,7 +720,7 @@ var HttpClient = class {
|
|
|
590
720
|
);
|
|
591
721
|
}
|
|
592
722
|
const retryAfter = parseRetryAfter(response);
|
|
593
|
-
lastError = new (0,
|
|
723
|
+
lastError = new (0, _chunk6VLFQZK6js.RateLimitError)(retryAfter);
|
|
594
724
|
if (responseRetryAllowed && attempt < maxRetries) {
|
|
595
725
|
retryAfterHint = _nullishCoalesce(parseRetryAfterHint(response), () => ( {
|
|
596
726
|
delayMs: retryAfter,
|
|
@@ -598,19 +728,19 @@ var HttpClient = class {
|
|
|
598
728
|
}));
|
|
599
729
|
break;
|
|
600
730
|
}
|
|
601
|
-
throw _optionalChain([options, 'optionalAccess',
|
|
731
|
+
throw _optionalChain([options, 'optionalAccess', _161 => _161.toolId]) ? _chunkLFQJW4S2js.attachToolUpstreamResponse.call(void 0, lastError, parsed) : lastError;
|
|
602
732
|
}
|
|
603
733
|
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
604
|
-
throw new (0,
|
|
734
|
+
throw new (0, _chunk6VLFQZK6js.AuthError)(_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status));
|
|
605
735
|
}
|
|
606
736
|
if (!response.ok) {
|
|
607
|
-
const retryableApiError = _optionalChain([options, 'optionalAccess',
|
|
737
|
+
const retryableApiError = _optionalChain([options, 'optionalAccess', _162 => _162.retryApiErrors]) === true && responseRetryAllowed && isRetryableApiErrorResponse(response.status);
|
|
608
738
|
const htmlError = detectHtmlErrorBody(
|
|
609
739
|
body,
|
|
610
740
|
response.headers.get("content-type")
|
|
611
741
|
);
|
|
612
742
|
if (htmlError) {
|
|
613
|
-
lastError = new (0,
|
|
743
|
+
lastError = new (0, _chunkLFQJW4S2js.DeeplineError)(
|
|
614
744
|
htmlError.message(response.status),
|
|
615
745
|
response.status,
|
|
616
746
|
"API_ERROR",
|
|
@@ -629,14 +759,14 @@ var HttpClient = class {
|
|
|
629
759
|
const errorValue = typeof parsed === "object" && parsed && "error" in parsed ? parsed.error : void 0;
|
|
630
760
|
const msg = typeof errorValue === "string" ? errorValue : errorValue && typeof errorValue === "object" && "message" in errorValue && typeof errorValue.message === "string" ? errorValue.message : typeof parsed === "object" && parsed && "message" in parsed && typeof parsed.message === "string" ? parsed.message : `HTTP ${response.status}`;
|
|
631
761
|
const apiErrorCode = _chunkXNYIZMNQjs.apiErrorCodeFromResponse.call(void 0, parsed);
|
|
632
|
-
lastError = new (0,
|
|
762
|
+
lastError = new (0, _chunkLFQJW4S2js.DeeplineError)(msg, response.status, apiErrorCode, {
|
|
633
763
|
response: parsed
|
|
634
764
|
});
|
|
635
765
|
if (retryableApiError && attempt < maxRetries) {
|
|
636
766
|
retryAfterHint = parseRetryAfterHint(response);
|
|
637
767
|
break;
|
|
638
768
|
}
|
|
639
|
-
throw _optionalChain([options, 'optionalAccess',
|
|
769
|
+
throw _optionalChain([options, 'optionalAccess', _163 => _163.toolId]) ? _chunkLFQJW4S2js.attachToolUpstreamResponse.call(void 0, lastError, parsed) : lastError;
|
|
640
770
|
}
|
|
641
771
|
if (typeof parsed === "string") {
|
|
642
772
|
const interstitial = detectHtmlErrorBody(
|
|
@@ -644,7 +774,7 @@ var HttpClient = class {
|
|
|
644
774
|
response.headers.get("content-type")
|
|
645
775
|
);
|
|
646
776
|
if (interstitial) {
|
|
647
|
-
throw new (0,
|
|
777
|
+
throw new (0, _chunkLFQJW4S2js.DeeplineError)(
|
|
648
778
|
`${this.config.baseUrl} returned a deployment-protection page instead of JSON. Set VERCEL_PROTECTION_BYPASS_TOKEN, or run \`vercel login\` if the CLI session expired.`,
|
|
649
779
|
response.status,
|
|
650
780
|
"DEPLOYMENT_PROTECTED",
|
|
@@ -656,14 +786,14 @@ var HttpClient = class {
|
|
|
656
786
|
} catch (error) {
|
|
657
787
|
clearTimeout(timeoutId);
|
|
658
788
|
networkFailedAt = Date.now();
|
|
659
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
789
|
+
if (_optionalChain([options, 'optionalAccess', _164 => _164.signal, 'optionalAccess', _165 => _165.aborted])) {
|
|
660
790
|
lastError = requestCancelledError(options.signal);
|
|
661
791
|
break requestAttempts;
|
|
662
792
|
}
|
|
663
|
-
if (error instanceof
|
|
793
|
+
if (error instanceof _chunk6VLFQZK6js.AuthError || error instanceof _chunkLFQJW4S2js.DeeplineError) {
|
|
664
794
|
throw error;
|
|
665
795
|
}
|
|
666
|
-
if (error instanceof
|
|
796
|
+
if (error instanceof _chunk6VLFQZK6js.RateLimitError) {
|
|
667
797
|
lastError = error;
|
|
668
798
|
break;
|
|
669
799
|
}
|
|
@@ -671,17 +801,17 @@ var HttpClient = class {
|
|
|
671
801
|
timeoutMs,
|
|
672
802
|
timedOut: requestTimedOut
|
|
673
803
|
});
|
|
674
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
804
|
+
if (_optionalChain([options, 'optionalAccess', _166 => _166.retryFromExecutePolicy]) && options.retryAmbiguousDelivery !== true) {
|
|
675
805
|
break requestAttempts;
|
|
676
806
|
}
|
|
677
807
|
} finally {
|
|
678
808
|
clearTimeout(timeoutId);
|
|
679
|
-
_optionalChain([options, 'optionalAccess',
|
|
809
|
+
_optionalChain([options, 'optionalAccess', _167 => _167.signal, 'optionalAccess', _168 => _168.removeEventListener, 'call', _169 => _169("abort", abortRequest)]);
|
|
680
810
|
}
|
|
681
811
|
}
|
|
682
812
|
if (attempt < maxRetries) continue;
|
|
683
813
|
}
|
|
684
|
-
if (lastError instanceof
|
|
814
|
+
if (lastError instanceof _chunkLFQJW4S2js.DeeplineError) {
|
|
685
815
|
throw lastError;
|
|
686
816
|
}
|
|
687
817
|
const mappedNetworkError = mapNetworkError(
|
|
@@ -703,10 +833,10 @@ var HttpClient = class {
|
|
|
703
833
|
phase: networkPhase
|
|
704
834
|
}
|
|
705
835
|
};
|
|
706
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
836
|
+
if (_optionalChain([options, 'optionalAccess', _170 => _170.toolId])) {
|
|
707
837
|
const code = mappedNetworkError.code;
|
|
708
838
|
throw withErrorCause(
|
|
709
|
-
new (0,
|
|
839
|
+
new (0, _chunkLFQJW4S2js.ToolExecutionError)(
|
|
710
840
|
withCoworkNetworkHint(mappedNetworkError.message),
|
|
711
841
|
{
|
|
712
842
|
toolId: options.toolId,
|
|
@@ -731,7 +861,7 @@ var HttpClient = class {
|
|
|
731
861
|
);
|
|
732
862
|
}
|
|
733
863
|
throw withErrorCause(
|
|
734
|
-
new (0,
|
|
864
|
+
new (0, _chunkLFQJW4S2js.DeeplineError)(
|
|
735
865
|
withCoworkNetworkHint(mappedNetworkError.message),
|
|
736
866
|
void 0,
|
|
737
867
|
mappedNetworkError.code,
|
|
@@ -753,40 +883,43 @@ var HttpClient = class {
|
|
|
753
883
|
...options
|
|
754
884
|
});
|
|
755
885
|
}
|
|
756
|
-
async *streamSse(
|
|
886
|
+
async *streamSse(rawPath, options) {
|
|
887
|
+
const lookups = runIdsToLookUp(rawPath);
|
|
888
|
+
const path = lookups.size > 0 ? await this.expandRunIds(rawPath, lookups) : rawPath;
|
|
757
889
|
const url = `${this.config.baseUrl}${path}`;
|
|
758
|
-
const method = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
890
|
+
const method = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _171 => _171.method]), () => ( "GET"));
|
|
759
891
|
const headers = this.authHeaders({
|
|
760
892
|
Accept: "text/event-stream",
|
|
761
|
-
..._optionalChain([options, 'optionalAccess',
|
|
893
|
+
..._optionalChain([options, 'optionalAccess', _172 => _172.headers])
|
|
762
894
|
});
|
|
763
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
895
|
+
if (_optionalChain([options, 'optionalAccess', _173 => _173.body]) !== void 0) {
|
|
764
896
|
applyExplicitHeaders(headers, { "Content-Type": "application/json" });
|
|
765
897
|
}
|
|
766
898
|
let lastError = null;
|
|
767
|
-
const candidateUrls = _optionalChain([options, 'optionalAccess',
|
|
899
|
+
const candidateUrls = _optionalChain([options, 'optionalAccess', _174 => _174.exactUrlOnly]) ? [url] : buildCandidateUrls(url);
|
|
768
900
|
for (const candidateUrl of candidateUrls) {
|
|
769
901
|
try {
|
|
770
902
|
const response = await fetch(candidateUrl, {
|
|
771
903
|
method,
|
|
772
904
|
headers,
|
|
773
|
-
body: _optionalChain([options, 'optionalAccess',
|
|
774
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
905
|
+
body: _optionalChain([options, 'optionalAccess', _175 => _175.body]) !== void 0 ? JSON.stringify(options.body) : void 0,
|
|
906
|
+
signal: _optionalChain([options, 'optionalAccess', _176 => _176.signal]),
|
|
775
907
|
redirect: deploymentProtectionRedirect(headers)
|
|
776
908
|
});
|
|
777
|
-
_optionalChain([options, 'optionalAccess',
|
|
909
|
+
_optionalChain([options, 'optionalAccess', _177 => _177.onResponse, 'optionalCall', _178 => _178(response)]);
|
|
778
910
|
if (!response.ok) {
|
|
779
911
|
const body = await response.text();
|
|
780
912
|
const parsed = parseResponseBody(body);
|
|
913
|
+
throwIfTeamNotFound(response.status, parsed);
|
|
781
914
|
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
782
|
-
throw new (0,
|
|
915
|
+
throw new (0, _chunk6VLFQZK6js.AuthError)(_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status));
|
|
783
916
|
}
|
|
784
917
|
const htmlError = detectHtmlErrorBody(
|
|
785
918
|
body,
|
|
786
919
|
response.headers.get("content-type")
|
|
787
920
|
);
|
|
788
921
|
if (htmlError) {
|
|
789
|
-
throw new (0,
|
|
922
|
+
throw new (0, _chunkLFQJW4S2js.DeeplineError)(
|
|
790
923
|
htmlError.message(response.status),
|
|
791
924
|
response.status,
|
|
792
925
|
"API_ERROR",
|
|
@@ -797,7 +930,7 @@ var HttpClient = class {
|
|
|
797
930
|
}
|
|
798
931
|
);
|
|
799
932
|
}
|
|
800
|
-
throw new (0,
|
|
933
|
+
throw new (0, _chunkLFQJW4S2js.DeeplineError)(
|
|
801
934
|
_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status),
|
|
802
935
|
response.status,
|
|
803
936
|
_chunkXNYIZMNQjs.apiErrorCodeFromResponse.call(void 0, parsed),
|
|
@@ -805,17 +938,17 @@ var HttpClient = class {
|
|
|
805
938
|
);
|
|
806
939
|
}
|
|
807
940
|
if (!response.body) {
|
|
808
|
-
throw new (0,
|
|
941
|
+
throw new (0, _chunkLFQJW4S2js.DeeplineError)("SSE response did not include a body.");
|
|
809
942
|
}
|
|
810
943
|
yield* decodeSseStream(response.body);
|
|
811
944
|
return;
|
|
812
945
|
} catch (error) {
|
|
813
|
-
if (error instanceof
|
|
946
|
+
if (error instanceof _chunk6VLFQZK6js.AuthError || error instanceof _chunkLFQJW4S2js.DeeplineError) {
|
|
814
947
|
throw error;
|
|
815
948
|
}
|
|
816
949
|
const normalized = error instanceof Error ? error : new Error(String(error));
|
|
817
|
-
if (isAbortLikeError(normalized) && _optionalChain([options, 'optionalAccess',
|
|
818
|
-
throw new (0,
|
|
950
|
+
if (isAbortLikeError(normalized) && _optionalChain([options, 'optionalAccess', _179 => _179.signal, 'optionalAccess', _180 => _180.aborted])) {
|
|
951
|
+
throw new (0, _chunkLFQJW4S2js.DeeplineError)(
|
|
819
952
|
`Stream from ${this.config.baseUrl} was aborted by the caller.`,
|
|
820
953
|
void 0,
|
|
821
954
|
"ABORTED"
|
|
@@ -825,7 +958,7 @@ var HttpClient = class {
|
|
|
825
958
|
}
|
|
826
959
|
}
|
|
827
960
|
if (lastError && isAbortLikeError(lastError)) {
|
|
828
|
-
throw new (0,
|
|
961
|
+
throw new (0, _chunkLFQJW4S2js.DeeplineError)(
|
|
829
962
|
withCoworkNetworkHint(
|
|
830
963
|
`Unable to stream from ${this.config.baseUrl}. The remote stream was interrupted.`
|
|
831
964
|
),
|
|
@@ -833,9 +966,9 @@ var HttpClient = class {
|
|
|
833
966
|
"PLAY_STREAM_NETWORK_ABORTED"
|
|
834
967
|
);
|
|
835
968
|
}
|
|
836
|
-
throw new (0,
|
|
969
|
+
throw new (0, _chunkLFQJW4S2js.DeeplineError)(
|
|
837
970
|
withCoworkNetworkHint(
|
|
838
|
-
_optionalChain([lastError, 'optionalAccess',
|
|
971
|
+
_optionalChain([lastError, 'optionalAccess', _181 => _181.message]) ? `Unable to stream from ${this.config.baseUrl}. ${lastError.message}` : `Unable to stream from ${this.config.baseUrl}.`
|
|
839
972
|
)
|
|
840
973
|
);
|
|
841
974
|
}
|
|
@@ -887,25 +1020,33 @@ var HttpClient = class {
|
|
|
887
1020
|
async delete(path) {
|
|
888
1021
|
return this.request(path, { method: "DELETE" });
|
|
889
1022
|
}
|
|
890
|
-
};
|
|
1023
|
+
}, _class);
|
|
1024
|
+
function throwIfTeamNotFound(status, parsed) {
|
|
1025
|
+
if (status !== 404 || _chunkXNYIZMNQjs.apiErrorCodeFromResponse.call(void 0, parsed) !== "TEAM_NOT_FOUND") {
|
|
1026
|
+
return;
|
|
1027
|
+
}
|
|
1028
|
+
throw new (0, _chunk6VLFQZK6js.ConfigError)(
|
|
1029
|
+
`${_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, status)} Check --workspace or DEEPLINE_WORKSPACE_ID; unset it to use the default workspace.`
|
|
1030
|
+
);
|
|
1031
|
+
}
|
|
891
1032
|
function parseResponseBody(body) {
|
|
892
1033
|
try {
|
|
893
1034
|
return JSON.parse(body);
|
|
894
|
-
} catch (
|
|
1035
|
+
} catch (e7) {
|
|
895
1036
|
return body;
|
|
896
1037
|
}
|
|
897
1038
|
}
|
|
898
1039
|
function isProviderOriginatedHttpError(parsed) {
|
|
899
1040
|
const response = asRecord(parsed);
|
|
900
|
-
const error = asRecord(_optionalChain([response, 'optionalAccess',
|
|
901
|
-
const failureOrigin = _nullishCoalesce(_optionalChain([error, 'optionalAccess',
|
|
902
|
-
const code = _nullishCoalesce(_optionalChain([error, 'optionalAccess',
|
|
1041
|
+
const error = asRecord(_optionalChain([response, 'optionalAccess', _182 => _182.error]));
|
|
1042
|
+
const failureOrigin = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _183 => _183.failure_origin]), () => ( _optionalChain([response, 'optionalAccess', _184 => _184.failure_origin])));
|
|
1043
|
+
const code = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _185 => _185.code]), () => ( _optionalChain([response, 'optionalAccess', _186 => _186.code])));
|
|
903
1044
|
return failureOrigin === "provider" || code === "UPSTREAM_BLOCKED";
|
|
904
1045
|
}
|
|
905
1046
|
function isMonitorRateLimitEnvelope(parsed) {
|
|
906
1047
|
const response = asRecord(parsed);
|
|
907
|
-
const error = asRecord(_optionalChain([response, 'optionalAccess',
|
|
908
|
-
return (_optionalChain([error, 'optionalAccess',
|
|
1048
|
+
const error = asRecord(_optionalChain([response, 'optionalAccess', _187 => _187.error]));
|
|
1049
|
+
return (_optionalChain([error, 'optionalAccess', _188 => _188.code]) === "monitor_upstream_rate_limited" || _optionalChain([error, 'optionalAccess', _189 => _189.code]) === "monitor_preview_rate_limited") && typeof error.message === "string";
|
|
909
1050
|
}
|
|
910
1051
|
function asRecord(value) {
|
|
911
1052
|
return typeof value === "object" && value !== null ? value : null;
|
|
@@ -921,7 +1062,7 @@ function detectHtmlErrorBody(body, contentType) {
|
|
|
921
1062
|
return null;
|
|
922
1063
|
}
|
|
923
1064
|
const titleMatch = trimmed.match(/<title[^>]*>([\s\S]*?)<\/title>/i);
|
|
924
|
-
const title = _optionalChain([titleMatch, 'optionalAccess',
|
|
1065
|
+
const title = _optionalChain([titleMatch, 'optionalAccess', _190 => _190[1], 'optionalAccess', _191 => _191.replace, 'call', _192 => _192(/\s+/g, " "), 'access', _193 => _193.trim, 'call', _194 => _194()]) || void 0;
|
|
925
1066
|
const workerThrewException = /worker threw exception/i.test(trimmed);
|
|
926
1067
|
return {
|
|
927
1068
|
title,
|
|
@@ -939,7 +1080,7 @@ function detectHtmlErrorBody(body, contentType) {
|
|
|
939
1080
|
};
|
|
940
1081
|
}
|
|
941
1082
|
function parseRetryAfter(response) {
|
|
942
|
-
return _nullishCoalesce(_optionalChain([parseRetryAfterHint, 'call',
|
|
1083
|
+
return _nullishCoalesce(_optionalChain([parseRetryAfterHint, 'call', _195 => _195(response), 'optionalAccess', _196 => _196.delayMs]), () => ( 5e3));
|
|
943
1084
|
}
|
|
944
1085
|
function parseRetryAfterHint(response) {
|
|
945
1086
|
const exactMs = Number(_nullishCoalesce(response.headers.get("retry-after-ms"), () => ( "")));
|
|
@@ -949,8 +1090,12 @@ function parseRetryAfterHint(response) {
|
|
|
949
1090
|
const header = response.headers.get("retry-after");
|
|
950
1091
|
if (header) {
|
|
951
1092
|
const seconds = Number(header);
|
|
952
|
-
if (Number.isFinite(seconds)
|
|
953
|
-
return { delayMs: seconds * 1e3, exact: false };
|
|
1093
|
+
if (Number.isFinite(seconds)) {
|
|
1094
|
+
return seconds > 0 ? { delayMs: seconds * 1e3, exact: false } : null;
|
|
1095
|
+
}
|
|
1096
|
+
const retryAtMs = Date.parse(header);
|
|
1097
|
+
if (Number.isFinite(retryAtMs)) {
|
|
1098
|
+
return { delayMs: Math.max(0, retryAtMs - Date.now()), exact: false };
|
|
954
1099
|
}
|
|
955
1100
|
}
|
|
956
1101
|
return null;
|
|
@@ -965,7 +1110,7 @@ function buildCandidateUrls(url) {
|
|
|
965
1110
|
candidates.push(loopback.toString());
|
|
966
1111
|
}
|
|
967
1112
|
return [...new Set(candidates)];
|
|
968
|
-
} catch (
|
|
1113
|
+
} catch (e8) {
|
|
969
1114
|
return [url];
|
|
970
1115
|
}
|
|
971
1116
|
}
|
|
@@ -1009,20 +1154,20 @@ function decodeSseFrame(frame) {
|
|
|
1009
1154
|
}
|
|
1010
1155
|
function sleep(ms, signal) {
|
|
1011
1156
|
return new Promise((resolve, reject) => {
|
|
1012
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
1157
|
+
if (_optionalChain([signal, 'optionalAccess', _197 => _197.aborted])) {
|
|
1013
1158
|
reject(requestCancelledError(signal));
|
|
1014
1159
|
return;
|
|
1015
1160
|
}
|
|
1016
1161
|
const timeoutId = setTimeout(() => {
|
|
1017
|
-
_optionalChain([signal, 'optionalAccess',
|
|
1162
|
+
_optionalChain([signal, 'optionalAccess', _198 => _198.removeEventListener, 'call', _199 => _199("abort", abort)]);
|
|
1018
1163
|
resolve();
|
|
1019
1164
|
}, ms);
|
|
1020
1165
|
const abort = () => {
|
|
1021
1166
|
clearTimeout(timeoutId);
|
|
1022
|
-
_optionalChain([signal, 'optionalAccess',
|
|
1167
|
+
_optionalChain([signal, 'optionalAccess', _200 => _200.removeEventListener, 'call', _201 => _201("abort", abort)]);
|
|
1023
1168
|
reject(requestCancelledError(signal));
|
|
1024
1169
|
};
|
|
1025
|
-
_optionalChain([signal, 'optionalAccess',
|
|
1170
|
+
_optionalChain([signal, 'optionalAccess', _202 => _202.addEventListener, 'call', _203 => _203("abort", abort, { once: true })]);
|
|
1026
1171
|
});
|
|
1027
1172
|
}
|
|
1028
1173
|
function withCoworkNetworkHint(message) {
|
|
@@ -1052,4 +1197,5 @@ ${COWORK_NETWORK_HINT}`;
|
|
|
1052
1197
|
|
|
1053
1198
|
|
|
1054
1199
|
|
|
1055
|
-
|
|
1200
|
+
|
|
1201
|
+
exports.ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER = ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER; exports.SDK_VERSION = SDK_VERSION; exports.SDK_API_MAJOR = SDK_API_MAJOR; exports.SDK_API_CONTRACT = SDK_API_CONTRACT; exports.COORDINATOR_INTERNAL_TOKEN_HEADER = COORDINATOR_INTERNAL_TOKEN_HEADER; exports.RUNTIME_ENVIRONMENT_TOKEN_HEADER = RUNTIME_ENVIRONMENT_TOKEN_HEADER; exports.RETAINED_PIPELINE_RECEIVERS_HEADER = RETAINED_PIPELINE_RECEIVERS_HEADER; exports.EXPERIMENT_SWITCHES_HEADER = EXPERIMENT_SWITCHES_HEADER; exports.readToolFailureHint = readToolFailureHint; exports.agentSessionIdFromEnvironment = agentSessionIdFromEnvironment; exports.isAgentSessionId = isAgentSessionId; exports.claudeProjectsRoots = claudeProjectsRoots; exports.coworkTranscriptFromEnvironment = coworkTranscriptFromEnvironment; exports.detectAgentRuntime = detectAgentRuntime; exports.deploymentProtectionHeaders = deploymentProtectionHeaders; exports.fetchWithDeploymentProtection = fetchWithDeploymentProtection; exports.networkCauseCode = networkCauseCode; exports.connectionFailureMessage = connectionFailureMessage; exports.HttpClient = HttpClient;
|