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,25 +1,28 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await 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; }
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunkIMX7J4DUjs = require('./chunk-IMX7J4DU.js');
|
|
4
|
+
require('./chunk-LRDHPOZW.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkJLGP5XAJjs = require('./chunk-JLGP5XAJ.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
var _chunkCACFJODGjs = require('./chunk-CACFJODG.js');
|
|
12
13
|
require('./chunk-4WAM6TLD.js');
|
|
13
|
-
require('./chunk-
|
|
14
|
+
require('./chunk-MJTVX4QK.js');
|
|
14
15
|
require('./chunk-PMH4GLMD.js');
|
|
15
|
-
require('./chunk-XDVT3GOM.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunk7O6J6A7Pjs = require('./chunk-7O6J6A7P.js');
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
var _chunkH4ALLC2Xjs = require('./chunk-H4ALLC2X.js');
|
|
22
|
-
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
var _chunkE2G2DNABjs = require('./chunk-E2G2DNAB.js');
|
|
23
26
|
|
|
24
27
|
|
|
25
28
|
var _chunkYGCKMI5Pjs = require('./chunk-YGCKMI5P.js');
|
|
@@ -29,18 +32,19 @@ var _chunkYGCKMI5Pjs = require('./chunk-YGCKMI5P.js');
|
|
|
29
32
|
|
|
30
33
|
|
|
31
34
|
|
|
32
|
-
var
|
|
33
|
-
require('./chunk-
|
|
34
|
-
require('./chunk-
|
|
35
|
+
var _chunkXLIHTJVMjs = require('./chunk-XLIHTJVM.js');
|
|
36
|
+
require('./chunk-MLABYI4M.js');
|
|
37
|
+
require('./chunk-AGLR6QVN.js');
|
|
35
38
|
|
|
36
39
|
|
|
37
40
|
|
|
38
|
-
var
|
|
41
|
+
var _chunk6VLFQZK6js = require('./chunk-6VLFQZK6.js');
|
|
39
42
|
require('./chunk-XNYIZMNQ.js');
|
|
40
43
|
|
|
41
44
|
|
|
42
|
-
var
|
|
43
|
-
require('./chunk-
|
|
45
|
+
var _chunkLFQJW4S2js = require('./chunk-LFQJW4S2.js');
|
|
46
|
+
require('./chunk-CFJFUVX2.js');
|
|
47
|
+
require('./chunk-6NE3RRRY.js');
|
|
44
48
|
require('./chunk-OG64RBAC.js');
|
|
45
49
|
require('./chunk-COGTRVWW.js');
|
|
46
50
|
|
|
@@ -50,12 +54,59 @@ var _crypto = require('crypto');
|
|
|
50
54
|
var _promises = require('fs/promises');
|
|
51
55
|
var _path = require('path');
|
|
52
56
|
var _sync = require('csv-stringify/sync');
|
|
57
|
+
|
|
58
|
+
// ../billing/credit-pricing.ts
|
|
59
|
+
var DEFAULT_CUSTOMER_CREDITS_PER_USD = 1 / _chunkE2G2DNABjs.DEFAULT_USD_PER_CUSTOMER_CREDIT;
|
|
60
|
+
var CREDIT_PURCHASE_MIN_USD = 10;
|
|
61
|
+
var DEFAULT_CREDIT_PURCHASE_BANDS = [
|
|
62
|
+
{
|
|
63
|
+
minCredits: CREDIT_PURCHASE_MIN_USD * DEFAULT_CUSTOMER_CREDITS_PER_USD,
|
|
64
|
+
maxCredits: null,
|
|
65
|
+
priceUsdPerCredit: 0.1
|
|
66
|
+
}
|
|
67
|
+
];
|
|
68
|
+
var DEFAULT_CREDIT_PRICING = {
|
|
69
|
+
usdPerCredit: _chunkE2G2DNABjs.DEFAULT_USD_PER_CUSTOMER_CREDIT,
|
|
70
|
+
providerMarkupMultiplier: _chunkE2G2DNABjs.DEFAULT_PROVIDER_MARKUP_MULTIPLIER,
|
|
71
|
+
purchaseBands: DEFAULT_CREDIT_PURCHASE_BANDS.map((band) => ({
|
|
72
|
+
minCredits: band.minCredits,
|
|
73
|
+
maxCredits: band.maxCredits,
|
|
74
|
+
usdPerCredit: band.priceUsdPerCredit
|
|
75
|
+
}))
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// ../billing/precision.ts
|
|
79
|
+
var MICROCHARGE_CREDIT_DECIMAL_PLACES = 3;
|
|
80
|
+
var BILLING_CREDIT_DISPLAY_ZERO_THRESHOLD = 1 / (10 ** MICROCHARGE_CREDIT_DECIMAL_PLACES * 2);
|
|
81
|
+
|
|
82
|
+
// ../billing/balance-presentation.ts
|
|
83
|
+
var USD_DECIMAL_PLACES = 4;
|
|
84
|
+
var USD_PRECISION_FACTOR = 10 ** USD_DECIMAL_PLACES;
|
|
85
|
+
var FINALIZING_USAGE_DESCRIPTION = "usage incurred, final price pending";
|
|
86
|
+
function formatFinalizingCallCount(count, truncated) {
|
|
87
|
+
if (typeof count !== "number" || !Number.isFinite(count) || count < 0) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
const n = count.toLocaleString("en-US");
|
|
91
|
+
return `${n}${truncated ? "+" : ""} ${count === 1 && !truncated ? "call" : "calls"}`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// src/cli/commands/billing.ts
|
|
53
95
|
var SUBSCRIPTION_STATUS_NEXT_COMMAND = "deepline billing subscription status";
|
|
54
96
|
var SUBSCRIPTION_CANCEL_PATH = "/api/v2/billing/subscription/cancel";
|
|
55
97
|
var BILLING_TOP_UP_PATH = "/api/v2/billing/top-up";
|
|
56
98
|
var DEFAULT_BALANCE_RECOVERY_CREDITS = 100;
|
|
99
|
+
var COMPATIBLE_PLAN_SKUS = [
|
|
100
|
+
"payg-v1",
|
|
101
|
+
"builder-v1",
|
|
102
|
+
"growth-v1",
|
|
103
|
+
"team-v1",
|
|
104
|
+
"team-v2",
|
|
105
|
+
"legacy-growth-v1",
|
|
106
|
+
"enterprise-v1"
|
|
107
|
+
];
|
|
57
108
|
function billingFailureFromError(error, options) {
|
|
58
|
-
if (error instanceof
|
|
109
|
+
if (error instanceof _chunk6VLFQZK6js.AuthError) {
|
|
59
110
|
return {
|
|
60
111
|
exitCode: 3,
|
|
61
112
|
code: "AUTH_ERROR",
|
|
@@ -63,7 +114,7 @@ function billingFailureFromError(error, options) {
|
|
|
63
114
|
next: "deepline auth status"
|
|
64
115
|
};
|
|
65
116
|
}
|
|
66
|
-
if (!(error instanceof
|
|
117
|
+
if (!(error instanceof _chunkLFQJW4S2js.DeeplineError) || typeof error.statusCode !== "number") {
|
|
67
118
|
return null;
|
|
68
119
|
}
|
|
69
120
|
if (error.statusCode === 404 || error.statusCode === 409) {
|
|
@@ -89,7 +140,7 @@ function reportBillingFailure(failure, options) {
|
|
|
89
140
|
if (failure.next) {
|
|
90
141
|
textLines.push(`Next: ${failure.next}`);
|
|
91
142
|
}
|
|
92
|
-
|
|
143
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
93
144
|
{
|
|
94
145
|
ok: false,
|
|
95
146
|
exitCode: failure.exitCode,
|
|
@@ -110,7 +161,7 @@ function parseTopUpCredits(raw) {
|
|
|
110
161
|
return parsed;
|
|
111
162
|
}
|
|
112
163
|
function topUpIdempotencyKey(raw) {
|
|
113
|
-
return raw === void 0 ? `cli_topup:${Date.now()}:${_crypto.randomUUID.call(void 0, )}` :
|
|
164
|
+
return raw === void 0 ? `cli_topup:${Date.now()}:${_crypto.randomUUID.call(void 0, )}` : _chunkCACFJODGjs.requireBillingIdempotencyKey.call(void 0, raw);
|
|
114
165
|
}
|
|
115
166
|
function targetBillingIdempotencyKey(raw) {
|
|
116
167
|
return typeof raw === "string" ? raw : `cli_target_billing:${Date.now()}:${_crypto.randomUUID.call(void 0, )}`;
|
|
@@ -147,7 +198,7 @@ function apiErrorCode(error) {
|
|
|
147
198
|
return _nullishCoalesce(error.code, () => ( "BILLING_API_ERROR"));
|
|
148
199
|
}
|
|
149
200
|
function billingTopUpFailureFromError(error, input) {
|
|
150
|
-
if (error instanceof
|
|
201
|
+
if (error instanceof _chunk6VLFQZK6js.AuthError || error instanceof _chunk6VLFQZK6js.ConfigError) {
|
|
151
202
|
return {
|
|
152
203
|
exitCode: 3,
|
|
153
204
|
code: "AUTH_ERROR",
|
|
@@ -155,8 +206,8 @@ function billingTopUpFailureFromError(error, input) {
|
|
|
155
206
|
next: "deepline auth status"
|
|
156
207
|
};
|
|
157
208
|
}
|
|
158
|
-
if (!(error instanceof
|
|
159
|
-
if (error instanceof
|
|
209
|
+
if (!(error instanceof _chunkLFQJW4S2js.DeeplineError) || typeof error.statusCode !== "number") {
|
|
210
|
+
if (error instanceof _chunkLFQJW4S2js.DeeplineError) {
|
|
160
211
|
return {
|
|
161
212
|
exitCode: 5,
|
|
162
213
|
code: "TOP_UP_STATUS_UNKNOWN",
|
|
@@ -236,7 +287,7 @@ function recentUsageLines(entries) {
|
|
|
236
287
|
}
|
|
237
288
|
const lines = ["Recent activity:"];
|
|
238
289
|
for (const entry of entries) {
|
|
239
|
-
const op = `${humanize(entry.provider)} ${usageOperationLabel(entry.operation)}`.trim();
|
|
290
|
+
const op = entry.provider === "compute" && entry.operation === "database" ? "Compute - Database" : `${humanize(entry.provider)} ${usageOperationLabel(entry.operation)}`.trim();
|
|
240
291
|
const roughUsd = Number(entry.rough_usd_cost);
|
|
241
292
|
const credits = entry.credits !== null && entry.credits !== void 0 && String(entry.credits).trim().length > 0 && Number.isFinite(Number(entry.credits)) ? Number(entry.credits) : null;
|
|
242
293
|
const temporaryHold = entry.charge_state === "temporary_hold";
|
|
@@ -329,7 +380,7 @@ function defaultLedgerExportPath() {
|
|
|
329
380
|
);
|
|
330
381
|
}
|
|
331
382
|
async function handleBalance(options) {
|
|
332
|
-
const { http } =
|
|
383
|
+
const { http } = _chunkXLIHTJVMjs.getAuthedHttpClient.call(void 0, );
|
|
333
384
|
const payload = await http.get(
|
|
334
385
|
"/api/v2/billing/balance"
|
|
335
386
|
);
|
|
@@ -344,8 +395,14 @@ async function handleBalance(options) {
|
|
|
344
395
|
}
|
|
345
396
|
lines.push(`Spendable: ${spendable} credits.`);
|
|
346
397
|
if (typeof payload.pending_spend_credits === "number") {
|
|
398
|
+
const callCount = payload.finalizing_call_count;
|
|
399
|
+
const callLabel = payload.pending_spend_credits > 0 && typeof callCount === "number" && callCount > 0 ? formatFinalizingCallCount(
|
|
400
|
+
callCount,
|
|
401
|
+
payload.finalizing_call_count_truncated === true
|
|
402
|
+
) : null;
|
|
403
|
+
const calls = callLabel ? ` across ${callLabel}` : "";
|
|
347
404
|
lines.push(
|
|
348
|
-
`
|
|
405
|
+
`Finalizing: ${payload.pending_spend_credits} credits${calls} \u2014 ${FINALIZING_USAGE_DESCRIPTION}.`
|
|
349
406
|
);
|
|
350
407
|
}
|
|
351
408
|
} else if (payload.spendable_balance_status !== void 0 || payload.exposure_status === "partial" || options.verbose) {
|
|
@@ -394,13 +451,13 @@ async function handleBalance(options) {
|
|
|
394
451
|
}
|
|
395
452
|
if (status === "no_billing") {
|
|
396
453
|
lines.push(
|
|
397
|
-
"Billing: No billing account or payment method set up for this
|
|
454
|
+
"Billing: No billing account or payment method set up for this org."
|
|
398
455
|
);
|
|
399
456
|
} else if (status === "zero_balance") {
|
|
400
|
-
lines.push("Billing: This
|
|
457
|
+
lines.push("Billing: This org has no Deepline credits available.");
|
|
401
458
|
} else if (status === "payment_method_only") {
|
|
402
459
|
lines.push(
|
|
403
|
-
"Billing: A payment method is saved, but this
|
|
460
|
+
"Billing: A payment method is saved, but this org has no Deepline credits available."
|
|
404
461
|
);
|
|
405
462
|
}
|
|
406
463
|
if (recovery) {
|
|
@@ -413,7 +470,7 @@ async function handleBalance(options) {
|
|
|
413
470
|
...options.verbose ? detail : [],
|
|
414
471
|
...lines.slice(1)
|
|
415
472
|
];
|
|
416
|
-
|
|
473
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
417
474
|
{
|
|
418
475
|
...payload,
|
|
419
476
|
...recovery ? { recovery } : {},
|
|
@@ -449,7 +506,7 @@ async function handleUsageEvents(options) {
|
|
|
449
506
|
);
|
|
450
507
|
return;
|
|
451
508
|
}
|
|
452
|
-
const client = new (0,
|
|
509
|
+
const client = new (0, _chunkJLGP5XAJjs.DeeplineClient)();
|
|
453
510
|
let payload;
|
|
454
511
|
try {
|
|
455
512
|
payload = await client.billing.usageEvents({
|
|
@@ -458,7 +515,7 @@ async function handleUsageEvents(options) {
|
|
|
458
515
|
...options.runId === void 0 ? {} : { runId: options.runId }
|
|
459
516
|
});
|
|
460
517
|
} catch (error) {
|
|
461
|
-
if (error instanceof
|
|
518
|
+
if (error instanceof _chunkLFQJW4S2js.DeeplineError && error.code === "INVALID_USAGE_EVENTS_OPTIONS") {
|
|
462
519
|
reportBillingFailure(
|
|
463
520
|
{
|
|
464
521
|
exitCode: 2,
|
|
@@ -480,7 +537,7 @@ async function handleUsageEvents(options) {
|
|
|
480
537
|
),
|
|
481
538
|
...nextPage ? [`Next page: ${nextPage}`] : []
|
|
482
539
|
];
|
|
483
|
-
|
|
540
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
484
541
|
{
|
|
485
542
|
...payload,
|
|
486
543
|
next: { page: nextPage },
|
|
@@ -502,7 +559,7 @@ async function handleUsage(options) {
|
|
|
502
559
|
return;
|
|
503
560
|
}
|
|
504
561
|
if (options.events) return handleUsageEvents(options);
|
|
505
|
-
const { http } =
|
|
562
|
+
const { http } = _chunkXLIHTJVMjs.getAuthedHttpClient.call(void 0, );
|
|
506
563
|
const params = new URLSearchParams();
|
|
507
564
|
if (options.requestId !== void 0) {
|
|
508
565
|
const requestId = options.requestId.trim();
|
|
@@ -543,12 +600,12 @@ async function handleUsage(options) {
|
|
|
543
600
|
`/api/v2/billing/usage${suffix}`
|
|
544
601
|
);
|
|
545
602
|
} catch (error) {
|
|
546
|
-
if (options.requestId && error instanceof
|
|
603
|
+
if (options.requestId && error instanceof _chunkLFQJW4S2js.DeeplineError && error.statusCode === 404) {
|
|
547
604
|
reportBillingFailure(
|
|
548
605
|
{
|
|
549
606
|
exitCode: 4,
|
|
550
607
|
code: "USAGE_REQUEST_NOT_FOUND",
|
|
551
|
-
message: `No billing record for request_id ${options.requestId} in the active
|
|
608
|
+
message: `No billing record for request_id ${options.requestId} in the active org.`,
|
|
552
609
|
next: "deepline billing usage"
|
|
553
610
|
},
|
|
554
611
|
options
|
|
@@ -586,7 +643,7 @@ async function handleUsage(options) {
|
|
|
586
643
|
"No continuation is available for this view. Use deepline billing ledger export all for the full ledger."
|
|
587
644
|
] : []
|
|
588
645
|
];
|
|
589
|
-
|
|
646
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
590
647
|
{
|
|
591
648
|
...payload,
|
|
592
649
|
recent: {
|
|
@@ -600,7 +657,7 @@ async function handleUsage(options) {
|
|
|
600
657
|
);
|
|
601
658
|
}
|
|
602
659
|
async function handleLimit(options) {
|
|
603
|
-
const { http } =
|
|
660
|
+
const { http } = _chunkXLIHTJVMjs.getAuthedHttpClient.call(void 0, );
|
|
604
661
|
const payload = await http.get(
|
|
605
662
|
"/api/v2/billing/limit"
|
|
606
663
|
);
|
|
@@ -608,7 +665,7 @@ async function handleLimit(options) {
|
|
|
608
665
|
`Monthly usage cap: ${_nullishCoalesce(payload.monthly_credits_limit, () => ( "(unknown)"))}`,
|
|
609
666
|
"Enforcement: checked before new calls; in-flight work can exceed the cap."
|
|
610
667
|
] : ["Monthly usage cap: off"];
|
|
611
|
-
|
|
668
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
612
669
|
{
|
|
613
670
|
...payload,
|
|
614
671
|
render: { sections: [{ title: "billing limit", lines }] }
|
|
@@ -617,12 +674,12 @@ async function handleLimit(options) {
|
|
|
617
674
|
);
|
|
618
675
|
}
|
|
619
676
|
async function handleSetLimit(credits, options) {
|
|
620
|
-
const { http } =
|
|
677
|
+
const { http } = _chunkXLIHTJVMjs.getAuthedHttpClient.call(void 0, );
|
|
621
678
|
const payload = await http.request("/api/v2/billing/limit", {
|
|
622
679
|
method: "PUT",
|
|
623
680
|
body: { monthly_credits_limit: Number.parseInt(credits, 10) }
|
|
624
681
|
});
|
|
625
|
-
|
|
682
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
626
683
|
{
|
|
627
684
|
...payload,
|
|
628
685
|
render: {
|
|
@@ -638,11 +695,11 @@ async function handleSetLimit(credits, options) {
|
|
|
638
695
|
);
|
|
639
696
|
}
|
|
640
697
|
async function handleLimitOff(options) {
|
|
641
|
-
const { http } =
|
|
698
|
+
const { http } = _chunkXLIHTJVMjs.getAuthedHttpClient.call(void 0, );
|
|
642
699
|
const payload = await http.request("/api/v2/billing/limit", {
|
|
643
700
|
method: "DELETE"
|
|
644
701
|
});
|
|
645
|
-
|
|
702
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
646
703
|
{
|
|
647
704
|
...payload,
|
|
648
705
|
render: {
|
|
@@ -662,7 +719,7 @@ async function exportLedger(http, outputPath, options) {
|
|
|
662
719
|
let initialized = false;
|
|
663
720
|
let pageNumber = 0;
|
|
664
721
|
console.error(`Exporting billing ledger to ${outputPath}`);
|
|
665
|
-
for await (const entries of
|
|
722
|
+
for await (const entries of _chunkCACFJODGjs.iterateCursorPages.call(void 0, async (cursor) => {
|
|
666
723
|
pageNumber += 1;
|
|
667
724
|
console.error(
|
|
668
725
|
`Fetching page ${pageNumber}; ${summary.row_count} rows written.`
|
|
@@ -701,7 +758,7 @@ async function exportLedger(http, outputPath, options) {
|
|
|
701
758
|
return summary;
|
|
702
759
|
}
|
|
703
760
|
async function handleHistory(options) {
|
|
704
|
-
const { http } =
|
|
761
|
+
const { http } = _chunkXLIHTJVMjs.getAuthedHttpClient.call(void 0, );
|
|
705
762
|
const windows = {
|
|
706
763
|
"1d": 86400,
|
|
707
764
|
"1w": 604800,
|
|
@@ -713,10 +770,10 @@ async function handleHistory(options) {
|
|
|
713
770
|
process.cwd(),
|
|
714
771
|
"deepline",
|
|
715
772
|
"data",
|
|
716
|
-
|
|
773
|
+
_chunkXLIHTJVMjs.createTimestampedName.call(void 0, `billing-history-${options.time}`, "csv")
|
|
717
774
|
);
|
|
718
775
|
const summary = await exportLedger(http, outputPath, { sinceAt });
|
|
719
|
-
|
|
776
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
720
777
|
{
|
|
721
778
|
output_path: outputPath,
|
|
722
779
|
row_count: summary.row_count,
|
|
@@ -753,14 +810,14 @@ async function handleLedgerExportAll(options) {
|
|
|
753
810
|
);
|
|
754
811
|
return;
|
|
755
812
|
}
|
|
756
|
-
const { http } =
|
|
813
|
+
const { http } = _chunkXLIHTJVMjs.getAuthedHttpClient.call(void 0, );
|
|
757
814
|
const outputPath = options.output ? _path.resolve.call(void 0, String(options.output)) : defaultLedgerExportPath();
|
|
758
815
|
const summary = await exportLedger(http, outputPath, {
|
|
759
816
|
sinceAt,
|
|
760
817
|
runId: options.runId,
|
|
761
818
|
operation: options.operation
|
|
762
819
|
});
|
|
763
|
-
|
|
820
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
764
821
|
{
|
|
765
822
|
output_path: outputPath,
|
|
766
823
|
row_count: summary.row_count,
|
|
@@ -778,7 +835,7 @@ async function handleLedgerExportAll(options) {
|
|
|
778
835
|
title: "billing ledger",
|
|
779
836
|
lines: [
|
|
780
837
|
`Billing ledger written to ${outputPath}`,
|
|
781
|
-
`${summary.row_count} row(s) exported for the active
|
|
838
|
+
`${summary.row_count} row(s) exported for the active org${options.runId ? ` and run ${options.runId}` : ""}${options.operation ? ` and operation ${options.operation}` : ""}${sinceAt !== null ? ` since ${new Date(sinceAt).toISOString()}` : ""}.`,
|
|
782
839
|
`Net ledger delta: ${summary.net_delta_credits} Deepline Credits`
|
|
783
840
|
]
|
|
784
841
|
}
|
|
@@ -798,31 +855,38 @@ function planPriceText(priceUsd, priceInterval) {
|
|
|
798
855
|
function targetPlanLine(plan) {
|
|
799
856
|
const firstMonth = plan.first_month_price_usd != null ? ` (first month $${plan.first_month_price_usd})` : "";
|
|
800
857
|
const bonus = plan.bonus_credits != null ? ` (+${plan.bonus_credits} bonus credits once paid)` : "";
|
|
801
|
-
|
|
858
|
+
const annual = plan.annual_price_usd != null ? ` (or $${plan.annual_price_usd}/year with --annual${plan.annual_offer_label ? `, ${plan.annual_offer_label}` : ""})` : "";
|
|
859
|
+
return `${_nullishCoalesce(plan.display_name, () => ( plan.name))} (${_nullishCoalesce(plan.public_sku, () => ( plan.sku))}) | ${planPriceText(plan.recurring_price_usd, plan.interval)}${firstMonth}${bonus}${annual} | ${plan.included_credits} included credits/month | $${plan.purchased_credit_price_usd}/purchased credit | ${plan.acquisition_enabled ? "available" : "unavailable"}`;
|
|
802
860
|
}
|
|
803
861
|
async function handlePlans(options) {
|
|
804
|
-
const client = new (0,
|
|
862
|
+
const client = new (0, _chunkJLGP5XAJjs.DeeplineClient)();
|
|
805
863
|
const payload = await client.billing.targetPlans(
|
|
806
864
|
options.promoCode ? { promoCode: options.promoCode } : void 0
|
|
807
865
|
);
|
|
808
866
|
const promo = payload.promo_code;
|
|
867
|
+
const promoPlanSkus = (_nullishCoalesce(_optionalChain([promo, 'optionalAccess', _8 => _8.plan_skus]), () => ( []))).map(
|
|
868
|
+
(sku) => _nullishCoalesce(_optionalChain([payload, 'access', _9 => _9.plans, 'access', _10 => _10.find, 'call', _11 => _11((plan) => plan.sku === sku), 'optionalAccess', _12 => _12.public_sku]), () => ( sku))
|
|
869
|
+
);
|
|
809
870
|
const listedCurrentPlan = payload.plans.find(
|
|
810
871
|
(plan) => plan.sku === payload.current_plan_sku
|
|
811
872
|
);
|
|
812
873
|
const currentPlan = await _asyncNullishCoalesce(listedCurrentPlan, async () => ( (await client.billing.targetStatus()).plan));
|
|
813
|
-
const
|
|
874
|
+
const pendingSku = _nullishCoalesce(payload.pending_plan_public_sku, () => ( payload.pending_plan_sku));
|
|
875
|
+
const pendingPlan = payload.pending_plan_display_name && pendingSku ? `${payload.pending_plan_display_name} (${pendingSku})` : _nullishCoalesce(pendingSku, () => ( "none"));
|
|
876
|
+
const plans = payload.enterprise_plan ? [...payload.plans, payload.enterprise_plan] : payload.plans;
|
|
877
|
+
const changesEnabled = payload.acquisition_enabled || _optionalChain([payload, 'access', _13 => _13.enterprise_plan, 'optionalAccess', _14 => _14.acquisition_enabled]);
|
|
814
878
|
const lines = [
|
|
815
|
-
`Current plan: ${_nullishCoalesce(currentPlan.display_name, () => ( currentPlan.name))} (${currentPlan.sku}) | ${planPriceText(currentPlan.recurring_price_usd, currentPlan.interval)} | ${_nullishCoalesce(currentPlan.included_credits, () => ( "(unknown)"))} included credits/month`,
|
|
879
|
+
`Current plan: ${_nullishCoalesce(currentPlan.display_name, () => ( currentPlan.name))} (${_nullishCoalesce(currentPlan.public_sku, () => ( currentPlan.sku))}) | ${planPriceText(currentPlan.recurring_price_usd, currentPlan.interval)} | ${_nullishCoalesce(currentPlan.included_credits, () => ( "(unknown)"))} included credits/month`,
|
|
816
880
|
`Pending plan: ${pendingPlan}`,
|
|
817
|
-
`Plan changes: ${
|
|
881
|
+
`Plan changes: ${changesEnabled ? "enabled" : "disabled"}`,
|
|
818
882
|
...promo ? [
|
|
819
|
-
promo.status === "applied" ? `Promo code ${promo.code}: applied to ${
|
|
883
|
+
promo.status === "applied" ? `Promo code ${promo.code}: applied to ${promoPlanSkus.join(", ")}${promo.expires_at ? ` (until ${promo.expires_at})` : ""}` : `Promo code ${promo.code}: ${promo.status.replaceAll("_", " ")}`
|
|
820
884
|
] : [],
|
|
821
|
-
...
|
|
822
|
-
_optionalChain([promo, 'optionalAccess',
|
|
885
|
+
...plans.length === 0 ? ["Plans: none available"] : ["Plans:", ...plans.map(targetPlanLine)],
|
|
886
|
+
_optionalChain([promo, 'optionalAccess', _15 => _15.status]) === "applied" ? `Change plan: deepline billing change-plan <plan_sku> --promo-code ${promo.code}` : "Change plan: deepline billing change-plan <plan_sku>"
|
|
823
887
|
];
|
|
824
|
-
const legacyPayload =
|
|
825
|
-
|
|
888
|
+
const legacyPayload = _chunkXLIHTJVMjs.shouldEmitJson.call(void 0, options.json) ? await client.billing.plans() : null;
|
|
889
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
826
890
|
{
|
|
827
891
|
..._nullishCoalesce(legacyPayload, () => ( payload)),
|
|
828
892
|
...legacyPayload ? { target_billing: payload } : {},
|
|
@@ -832,7 +896,7 @@ async function handlePlans(options) {
|
|
|
832
896
|
);
|
|
833
897
|
}
|
|
834
898
|
async function handleSubscribe(planVersionId, options) {
|
|
835
|
-
const { http } =
|
|
899
|
+
const { http } = _chunkXLIHTJVMjs.getAuthedHttpClient.call(void 0, );
|
|
836
900
|
const payload = await http.request(
|
|
837
901
|
"/api/v2/billing/subscription/checkout",
|
|
838
902
|
{
|
|
@@ -841,8 +905,8 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
841
905
|
}
|
|
842
906
|
);
|
|
843
907
|
const url = String(payload.checkout_url || "");
|
|
844
|
-
if (!options.json && options.open !== false && url)
|
|
845
|
-
|
|
908
|
+
if (!options.json && options.open !== false && url) _chunkXLIHTJVMjs.openInBrowser.call(void 0, url);
|
|
909
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
846
910
|
{
|
|
847
911
|
...payload,
|
|
848
912
|
render: {
|
|
@@ -858,7 +922,7 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
858
922
|
);
|
|
859
923
|
}
|
|
860
924
|
async function handleSubscriptionStatus(options) {
|
|
861
|
-
const client = new (0,
|
|
925
|
+
const client = new (0, _chunkJLGP5XAJjs.DeeplineClient)();
|
|
862
926
|
const payload = await client.billing.subscription.status();
|
|
863
927
|
const pools = _nullishCoalesce(payload.credit_pools, () => ( []));
|
|
864
928
|
const lines = [
|
|
@@ -878,7 +942,7 @@ async function handleSubscriptionStatus(options) {
|
|
|
878
942
|
],
|
|
879
943
|
`Assigned by: ${_nullishCoalesce(payload.assigned_by, () => ( "default"))}`
|
|
880
944
|
];
|
|
881
|
-
|
|
945
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
882
946
|
{
|
|
883
947
|
...payload,
|
|
884
948
|
render: { sections: [{ title: "billing subscription", lines }] }
|
|
@@ -887,7 +951,7 @@ async function handleSubscriptionStatus(options) {
|
|
|
887
951
|
);
|
|
888
952
|
}
|
|
889
953
|
async function handleSubscriptionCancel(options) {
|
|
890
|
-
const client = new (0,
|
|
954
|
+
const client = new (0, _chunkJLGP5XAJjs.DeeplineClient)();
|
|
891
955
|
const action = options.undo ? "undo_cancel" : "cancel";
|
|
892
956
|
if (options.dryRun) {
|
|
893
957
|
const status = await client.billing.subscription.status();
|
|
@@ -896,7 +960,7 @@ async function handleSubscriptionCancel(options) {
|
|
|
896
960
|
{
|
|
897
961
|
exitCode: 4,
|
|
898
962
|
code: "NO_ACTIVE_SUBSCRIPTION",
|
|
899
|
-
message: "This
|
|
963
|
+
message: "This org has no active subscription to cancel.",
|
|
900
964
|
next: SUBSCRIPTION_STATUS_NEXT_COMMAND
|
|
901
965
|
},
|
|
902
966
|
options
|
|
@@ -904,7 +968,7 @@ async function handleSubscriptionCancel(options) {
|
|
|
904
968
|
return;
|
|
905
969
|
}
|
|
906
970
|
const consequence = action === "cancel" ? `Would schedule cancellation at period end${status.current_period_end ? ` (${status.current_period_end})` : ""}. The subscription stays active until then and remaining credits are kept.` : "Would reverse the pending cancellation; the subscription would renew normally.";
|
|
907
|
-
|
|
971
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
908
972
|
{
|
|
909
973
|
ok: true,
|
|
910
974
|
dry_run: true,
|
|
@@ -960,7 +1024,7 @@ async function handleSubscriptionCancel(options) {
|
|
|
960
1024
|
"Remaining credits are yours to keep \u2014 cancellation never removes credits.",
|
|
961
1025
|
"Undo with: deepline billing subscription cancel --undo"
|
|
962
1026
|
];
|
|
963
|
-
|
|
1027
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
964
1028
|
{
|
|
965
1029
|
ok: true,
|
|
966
1030
|
...result,
|
|
@@ -1014,7 +1078,7 @@ async function handleInvoices(options) {
|
|
|
1014
1078
|
return;
|
|
1015
1079
|
}
|
|
1016
1080
|
}
|
|
1017
|
-
const client = new (0,
|
|
1081
|
+
const client = new (0, _chunkJLGP5XAJjs.DeeplineClient)();
|
|
1018
1082
|
let payload;
|
|
1019
1083
|
try {
|
|
1020
1084
|
payload = await client.billing.invoices.list(
|
|
@@ -1043,7 +1107,7 @@ async function handleInvoices(options) {
|
|
|
1043
1107
|
url: entry.url
|
|
1044
1108
|
}))
|
|
1045
1109
|
} : { ...payload, count: entries.length };
|
|
1046
|
-
|
|
1110
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1047
1111
|
{
|
|
1048
1112
|
...envelope,
|
|
1049
1113
|
render: { sections: [{ title: "billing invoices", lines }] }
|
|
@@ -1052,7 +1116,7 @@ async function handleInvoices(options) {
|
|
|
1052
1116
|
);
|
|
1053
1117
|
}
|
|
1054
1118
|
async function handleCheckout(options) {
|
|
1055
|
-
const { http } =
|
|
1119
|
+
const { http } = _chunkXLIHTJVMjs.getAuthedHttpClient.call(void 0, );
|
|
1056
1120
|
const payload = await http.post(
|
|
1057
1121
|
"/api/v2/billing/checkout",
|
|
1058
1122
|
{
|
|
@@ -1062,8 +1126,8 @@ async function handleCheckout(options) {
|
|
|
1062
1126
|
}
|
|
1063
1127
|
);
|
|
1064
1128
|
const url = String(payload.url || payload.checkout_url || "");
|
|
1065
|
-
if (!options.json && !options.noOpen && url)
|
|
1066
|
-
|
|
1129
|
+
if (!options.json && !options.noOpen && url) _chunkXLIHTJVMjs.openInBrowser.call(void 0, url);
|
|
1130
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1067
1131
|
{
|
|
1068
1132
|
...payload,
|
|
1069
1133
|
render: {
|
|
@@ -1096,7 +1160,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1096
1160
|
try {
|
|
1097
1161
|
idempotencyKey = topUpIdempotencyKey(options.idempotencyKey);
|
|
1098
1162
|
} catch (error) {
|
|
1099
|
-
if (!(error instanceof
|
|
1163
|
+
if (!(error instanceof _chunkLFQJW4S2js.DeeplineError)) throw error;
|
|
1100
1164
|
reportBillingFailure(
|
|
1101
1165
|
{
|
|
1102
1166
|
exitCode: 2,
|
|
@@ -1108,7 +1172,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1108
1172
|
return;
|
|
1109
1173
|
}
|
|
1110
1174
|
if (options.dryRun) {
|
|
1111
|
-
|
|
1175
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1112
1176
|
{
|
|
1113
1177
|
ok: true,
|
|
1114
1178
|
dry_run: true,
|
|
@@ -1138,7 +1202,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1138
1202
|
);
|
|
1139
1203
|
return;
|
|
1140
1204
|
}
|
|
1141
|
-
const client = new (0,
|
|
1205
|
+
const client = new (0, _chunkJLGP5XAJjs.DeeplineClient)();
|
|
1142
1206
|
let payload;
|
|
1143
1207
|
try {
|
|
1144
1208
|
payload = await client.billing.topUpWithReceipt({
|
|
@@ -1155,7 +1219,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1155
1219
|
return;
|
|
1156
1220
|
}
|
|
1157
1221
|
if (payload.status === "pending") {
|
|
1158
|
-
|
|
1222
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1159
1223
|
{
|
|
1160
1224
|
ok: true,
|
|
1161
1225
|
...payload,
|
|
@@ -1182,9 +1246,9 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1182
1246
|
const amountText = invoiceAmountText(payload.amount_cents, payload.currency);
|
|
1183
1247
|
const appliedCredits = "applied_credits" in payload ? payload.applied_credits : payload.credits;
|
|
1184
1248
|
const paymentMethod = "payment_method" in payload ? payload.payment_method : void 0;
|
|
1185
|
-
const paymentLabel = _nullishCoalesce(_optionalChain([paymentMethod, 'optionalAccess',
|
|
1186
|
-
_optionalChain([paymentMethod, 'optionalAccess',
|
|
1187
|
-
_optionalChain([paymentMethod, 'optionalAccess',
|
|
1249
|
+
const paymentLabel = _nullishCoalesce(_optionalChain([paymentMethod, 'optionalAccess', _16 => _16.label]), () => ( [
|
|
1250
|
+
_optionalChain([paymentMethod, 'optionalAccess', _17 => _17.brand]) ? humanize(paymentMethod.brand) : null,
|
|
1251
|
+
_optionalChain([paymentMethod, 'optionalAccess', _18 => _18.last4]) ? `ending in ${paymentMethod.last4}` : null
|
|
1188
1252
|
].filter(Boolean).join(" ")));
|
|
1189
1253
|
const compactEnvelope = {
|
|
1190
1254
|
ok: true,
|
|
@@ -1219,17 +1283,17 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1219
1283
|
]
|
|
1220
1284
|
}
|
|
1221
1285
|
};
|
|
1222
|
-
|
|
1286
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, options.compact ? compactEnvelope : fullEnvelope, {
|
|
1223
1287
|
json: options.json
|
|
1224
1288
|
});
|
|
1225
1289
|
}
|
|
1226
1290
|
async function handleTargetStatus(options) {
|
|
1227
|
-
const client = new (0,
|
|
1291
|
+
const client = new (0, _chunkJLGP5XAJjs.DeeplineClient)();
|
|
1228
1292
|
const payload = await client.billing.targetStatus();
|
|
1229
1293
|
const balanceCommand = "deepline billing balance";
|
|
1230
1294
|
const recentChargesCommand = "deepline billing usage --limit 5";
|
|
1231
1295
|
const exactChargeCommand = "deepline billing usage --request-id <job_id>";
|
|
1232
|
-
|
|
1296
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1233
1297
|
{
|
|
1234
1298
|
ok: true,
|
|
1235
1299
|
...payload,
|
|
@@ -1243,7 +1307,7 @@ async function handleTargetStatus(options) {
|
|
|
1243
1307
|
{
|
|
1244
1308
|
title: "billing status",
|
|
1245
1309
|
lines: [
|
|
1246
|
-
`Plan: ${_nullishCoalesce(payload.plan.display_name, () => ( payload.plan.name))} (${payload.plan.sku})`,
|
|
1310
|
+
`Plan: ${_nullishCoalesce(payload.plan.display_name, () => ( payload.plan.name))} (${_nullishCoalesce(payload.plan.public_sku, () => ( payload.plan.sku))})`,
|
|
1247
1311
|
`State: ${payload.state}`,
|
|
1248
1312
|
`Payment: ${payload.payment_state}`,
|
|
1249
1313
|
`Automatic recharge: ${payload.recharge_state}`,
|
|
@@ -1267,13 +1331,13 @@ function formatComputeAmount(minutes, credits) {
|
|
|
1267
1331
|
return `${time} ${minutes === 1 ? "minute" : "minutes"} (${cost} ${credits === 1 ? "credit" : "credits"})`;
|
|
1268
1332
|
}
|
|
1269
1333
|
async function handleIncludedCompute(options) {
|
|
1270
|
-
const client = new (0,
|
|
1334
|
+
const client = new (0, _chunkJLGP5XAJjs.DeeplineClient)();
|
|
1271
1335
|
const payload = options.enable ? await client.billing.enableIncludedCompute({ includeOverage: true }) : await client.billing.includedCompute({ includeOverage: true });
|
|
1272
1336
|
const rate = _nullishCoalesce(payload.credits_per_minute, () => ( 0));
|
|
1273
1337
|
const includedCredits = _nullishCoalesce(payload.included_credits_used, () => ( payload.included_minutes_used * rate));
|
|
1274
1338
|
const includedMinutes = payload.included_credits_used !== void 0 && rate > 0 ? includedCredits / rate : payload.included_minutes_used;
|
|
1275
1339
|
const overage = payload.overage_credits;
|
|
1276
|
-
|
|
1340
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1277
1341
|
{
|
|
1278
1342
|
ok: true,
|
|
1279
1343
|
...payload,
|
|
@@ -1282,24 +1346,28 @@ async function handleIncludedCompute(options) {
|
|
|
1282
1346
|
{
|
|
1283
1347
|
title: payload.status === "unavailable" ? "billing compute" : "billing compute (standard-equivalent minutes)",
|
|
1284
1348
|
lines: payload.status === "on" ? [
|
|
1349
|
+
..._optionalChain([payload, 'access', _19 => _19.database, 'optionalAccess', _20 => _20.enabled]) ? [
|
|
1350
|
+
`Database compute: ${payload.database.credits_per_cu_hour} credits/CU-hour; shares the allowance by dollar value.`
|
|
1351
|
+
] : [],
|
|
1285
1352
|
`Allowance used: ${formatComputeAmount(includedMinutes, includedCredits)} of ${formatComputeAmount(payload.included_minutes, payload.included_minutes * rate)}`,
|
|
1286
1353
|
...overage === void 0 || rate <= 0 ? ["Overage: unavailable"] : overage > 0 ? [
|
|
1287
1354
|
`Overage: ${formatComputeAmount(overage / rate, overage)} charged`
|
|
1288
1355
|
] : [],
|
|
1289
1356
|
`Standard sandbox price: ${formatComputeAmount(60, Math.round(rate * 60))}`,
|
|
1290
1357
|
`Allowance resets: ${payload.period_end_at.slice(0, 10)} (UTC)`,
|
|
1291
|
-
|
|
1358
|
+
_chunk7O6J6A7Pjs.PLAY_RUNTIME_PRICING_NOTE,
|
|
1292
1359
|
_chunkH4ALLC2Xjs.PRICING_PAGE_NOTE
|
|
1293
1360
|
] : payload.status === "off" ? [
|
|
1361
|
+
..._optionalChain([payload, 'access', _21 => _21.database, 'optionalAccess', _22 => _22.enabled]) ? [
|
|
1362
|
+
`Database compute: ${payload.database.credits_per_cu_hour} credits/CU-hour; no included allowance until enabled.`
|
|
1363
|
+
] : [],
|
|
1294
1364
|
"Included compute: off; Play compute is billed at provider cost.",
|
|
1295
1365
|
`Allowance if enabled: ${formatComputeAmount(payload.plan.included_minutes, payload.plan.included_minutes * payload.plan.credits_per_minute)} per month`,
|
|
1296
1366
|
`Standard sandbox price if enabled: ${formatComputeAmount(60, Math.round(payload.plan.credits_per_minute * 60))}`,
|
|
1297
|
-
|
|
1367
|
+
_chunk7O6J6A7Pjs.PLAY_RUNTIME_PRICING_NOTE,
|
|
1298
1368
|
"Run deepline billing compute --enable to turn on included compute. It cannot be turned off again.",
|
|
1299
1369
|
_chunkH4ALLC2Xjs.PRICING_PAGE_NOTE
|
|
1300
|
-
] : [
|
|
1301
|
-
"Included compute is not available for this workspace yet."
|
|
1302
|
-
]
|
|
1370
|
+
] : ["Included compute is not available for this org yet."]
|
|
1303
1371
|
}
|
|
1304
1372
|
]
|
|
1305
1373
|
}
|
|
@@ -1308,8 +1376,8 @@ async function handleIncludedCompute(options) {
|
|
|
1308
1376
|
);
|
|
1309
1377
|
}
|
|
1310
1378
|
async function handleEntitlements(options) {
|
|
1311
|
-
const payload = await new (0,
|
|
1312
|
-
|
|
1379
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().billing.entitlements();
|
|
1380
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1313
1381
|
{
|
|
1314
1382
|
ok: true,
|
|
1315
1383
|
...payload,
|
|
@@ -1318,8 +1386,8 @@ async function handleEntitlements(options) {
|
|
|
1318
1386
|
{
|
|
1319
1387
|
title: "billing entitlements",
|
|
1320
1388
|
lines: [
|
|
1321
|
-
`Plan: ${_nullishCoalesce(_optionalChain([payload, 'access',
|
|
1322
|
-
...
|
|
1389
|
+
`Plan: ${_nullishCoalesce(_optionalChain([payload, 'access', _23 => _23.plan, 'optionalAccess', _24 => _24.name]), () => ( "Legacy billing"))}`,
|
|
1390
|
+
..._chunkIMX7J4DUjs.concurrentRunsLine.call(void 0, payload) ? [`Concurrent runs: ${_chunkIMX7J4DUjs.concurrentRunsLine.call(void 0, payload)}`] : [],
|
|
1323
1391
|
...Object.entries(payload.benefits).flatMap(
|
|
1324
1392
|
([key, grant]) => "value" in grant ? [
|
|
1325
1393
|
`${key}: ${grant.status}, ${JSON.stringify(grant.value)}${grant.expiresAt === void 0 ? "" : `, expires ${new Date(grant.expiresAt).toISOString()}`}`
|
|
@@ -1344,7 +1412,7 @@ async function handleEntitlements(options) {
|
|
|
1344
1412
|
);
|
|
1345
1413
|
}
|
|
1346
1414
|
async function handleAutoRechargeStatus(options) {
|
|
1347
|
-
const payload = await new (0,
|
|
1415
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().billing.autoRecharge.get();
|
|
1348
1416
|
const state = payload.available ? payload.enabled ? "on" : "off" : "unavailable";
|
|
1349
1417
|
const lines = [
|
|
1350
1418
|
`State: ${state}`,
|
|
@@ -1354,7 +1422,7 @@ async function handleAutoRechargeStatus(options) {
|
|
|
1354
1422
|
`Automatic credit purchase cap: ${payload.purchase_limit_credits} credits per rolling 30 days`
|
|
1355
1423
|
] : []
|
|
1356
1424
|
];
|
|
1357
|
-
|
|
1425
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1358
1426
|
{
|
|
1359
1427
|
ok: true,
|
|
1360
1428
|
...payload,
|
|
@@ -1403,7 +1471,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1403
1471
|
}
|
|
1404
1472
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1405
1473
|
if (options.dryRun) {
|
|
1406
|
-
|
|
1474
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1407
1475
|
{
|
|
1408
1476
|
ok: true,
|
|
1409
1477
|
dry_run: true,
|
|
@@ -1424,7 +1492,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1424
1492
|
);
|
|
1425
1493
|
return;
|
|
1426
1494
|
}
|
|
1427
|
-
const payload = await new (0,
|
|
1495
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().billing.autoRecharge.update({
|
|
1428
1496
|
enabled: true,
|
|
1429
1497
|
thresholdCredits,
|
|
1430
1498
|
refillToCredits,
|
|
@@ -1432,7 +1500,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1432
1500
|
...rollingLimitCredits !== void 0 ? { purchaseLimitCredits: rollingLimitCredits } : {},
|
|
1433
1501
|
idempotencyKey
|
|
1434
1502
|
});
|
|
1435
|
-
|
|
1503
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1436
1504
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1437
1505
|
{ json: options.json }
|
|
1438
1506
|
);
|
|
@@ -1440,7 +1508,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1440
1508
|
async function handleAutoRechargeOff(options) {
|
|
1441
1509
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1442
1510
|
if (options.dryRun) {
|
|
1443
|
-
|
|
1511
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1444
1512
|
{
|
|
1445
1513
|
ok: true,
|
|
1446
1514
|
dry_run: true,
|
|
@@ -1455,11 +1523,11 @@ async function handleAutoRechargeOff(options) {
|
|
|
1455
1523
|
);
|
|
1456
1524
|
return;
|
|
1457
1525
|
}
|
|
1458
|
-
const payload = await new (0,
|
|
1526
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().billing.autoRecharge.update({
|
|
1459
1527
|
enabled: false,
|
|
1460
1528
|
idempotencyKey
|
|
1461
1529
|
});
|
|
1462
|
-
|
|
1530
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1463
1531
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1464
1532
|
{ json: options.json }
|
|
1465
1533
|
);
|
|
@@ -1485,18 +1553,18 @@ function savedCardLines(cards, hasMore) {
|
|
|
1485
1553
|
async function handleCardsList(options) {
|
|
1486
1554
|
const limit = options.limit === void 0 ? void 0 : Number(options.limit);
|
|
1487
1555
|
if (limit !== void 0 && (!Number.isInteger(limit) || limit < 1 || limit > 100)) {
|
|
1488
|
-
|
|
1556
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1489
1557
|
{ ok: false, error: "--limit must be a whole number from 1 to 100." },
|
|
1490
1558
|
{ json: options.json }
|
|
1491
1559
|
);
|
|
1492
1560
|
process.exitCode = 1;
|
|
1493
1561
|
return;
|
|
1494
1562
|
}
|
|
1495
|
-
const payload = await new (0,
|
|
1563
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().billing.cards.list({
|
|
1496
1564
|
...limit !== void 0 ? { limit } : {},
|
|
1497
1565
|
...options.cursor ? { cursor: options.cursor } : {}
|
|
1498
1566
|
});
|
|
1499
|
-
|
|
1567
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1500
1568
|
{
|
|
1501
1569
|
ok: true,
|
|
1502
1570
|
...payload,
|
|
@@ -1514,8 +1582,8 @@ async function handleCardsList(options) {
|
|
|
1514
1582
|
}
|
|
1515
1583
|
async function handleCardsAdd(options) {
|
|
1516
1584
|
const makeDefault = options.makeDefault === true;
|
|
1517
|
-
const payload = await new (0,
|
|
1518
|
-
|
|
1585
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().billing.cards.add({ makeDefault });
|
|
1586
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1519
1587
|
{
|
|
1520
1588
|
ok: true,
|
|
1521
1589
|
make_default: makeDefault,
|
|
@@ -1540,7 +1608,7 @@ async function handleCardChange(action, cardId, options) {
|
|
|
1540
1608
|
const changeId = _nullishCoalesce(options.changeId, () => ( _crypto.randomUUID.call(void 0, )));
|
|
1541
1609
|
const path = `/api/v2/billing/payment-methods/${action}`;
|
|
1542
1610
|
if (options.dryRun) {
|
|
1543
|
-
|
|
1611
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1544
1612
|
{
|
|
1545
1613
|
ok: true,
|
|
1546
1614
|
dry_run: true,
|
|
@@ -1555,9 +1623,9 @@ async function handleCardChange(action, cardId, options) {
|
|
|
1555
1623
|
);
|
|
1556
1624
|
return;
|
|
1557
1625
|
}
|
|
1558
|
-
const cards = new (0,
|
|
1626
|
+
const cards = new (0, _chunkJLGP5XAJjs.DeeplineClient)().billing.cards;
|
|
1559
1627
|
const payload = action === "default" ? await cards.setDefault({ cardId, changeId }) : await cards.remove({ cardId, changeId });
|
|
1560
|
-
|
|
1628
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1561
1629
|
{
|
|
1562
1630
|
...payload,
|
|
1563
1631
|
render: {
|
|
@@ -1591,11 +1659,11 @@ async function handleBuyCredits(creditsRaw, options) {
|
|
|
1591
1659
|
return;
|
|
1592
1660
|
}
|
|
1593
1661
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1594
|
-
const payload = await new (0,
|
|
1662
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().billing.purchaseCredits({
|
|
1595
1663
|
credits,
|
|
1596
1664
|
idempotencyKey
|
|
1597
1665
|
});
|
|
1598
|
-
|
|
1666
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1599
1667
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1600
1668
|
{ json: options.json }
|
|
1601
1669
|
);
|
|
@@ -1613,9 +1681,9 @@ async function handleTopUpRecover(creditsRaw, options) {
|
|
|
1613
1681
|
);
|
|
1614
1682
|
return;
|
|
1615
1683
|
}
|
|
1616
|
-
const failure = !_optionalChain([options, 'access',
|
|
1684
|
+
const failure = !_optionalChain([options, 'access', _25 => _25.orgId, 'optionalAccess', _26 => _26.trim, 'call', _27 => _27()]) || options.orgId !== options.orgId.trim() ? {
|
|
1617
1685
|
code: "INVALID_ORG_ID",
|
|
1618
|
-
message: "--org-id must be the original
|
|
1686
|
+
message: "--org-id must be the original org ID without surrounding whitespace."
|
|
1619
1687
|
} : !options.idempotencyKey || options.idempotencyKey.length > 200 || options.idempotencyKey !== options.idempotencyKey.trim() ? {
|
|
1620
1688
|
code: "INVALID_BILLING_IDEMPOTENCY_KEY",
|
|
1621
1689
|
message: "--idempotency-key must be the original key (1\u2013200 characters without surrounding whitespace)."
|
|
@@ -1631,7 +1699,7 @@ async function handleTopUpRecover(creditsRaw, options) {
|
|
|
1631
1699
|
return;
|
|
1632
1700
|
}
|
|
1633
1701
|
if (options.dryRun) {
|
|
1634
|
-
|
|
1702
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1635
1703
|
{
|
|
1636
1704
|
ok: true,
|
|
1637
1705
|
dry_run: true,
|
|
@@ -1644,63 +1712,119 @@ async function handleTopUpRecover(creditsRaw, options) {
|
|
|
1644
1712
|
);
|
|
1645
1713
|
return;
|
|
1646
1714
|
}
|
|
1647
|
-
const payload = await new (0,
|
|
1715
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().billing.recoverCreditPurchase({
|
|
1648
1716
|
credits,
|
|
1649
1717
|
orgId: options.orgId,
|
|
1650
1718
|
idempotencyKey: options.idempotencyKey
|
|
1651
1719
|
});
|
|
1652
|
-
|
|
1720
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1653
1721
|
{ ok: true, idempotency_key: options.idempotencyKey, ...payload },
|
|
1654
1722
|
{ json: options.json }
|
|
1655
1723
|
);
|
|
1656
1724
|
}
|
|
1657
1725
|
async function handleTargetPlan(planSku, options) {
|
|
1658
|
-
if (
|
|
1726
|
+
if (options.invoice && !options.billingEmail) {
|
|
1727
|
+
reportBillingFailure(
|
|
1728
|
+
{
|
|
1729
|
+
exitCode: 2,
|
|
1730
|
+
code: "INVALID_REQUEST",
|
|
1731
|
+
message: "--invoice needs --billing-email <email>."
|
|
1732
|
+
},
|
|
1733
|
+
options
|
|
1734
|
+
);
|
|
1735
|
+
return;
|
|
1736
|
+
}
|
|
1737
|
+
const targetPlanSku = _nullishCoalesce([..._chunkCACFJODGjs.PUBLIC_PLAN_SKUS, ...COMPATIBLE_PLAN_SKUS].find(
|
|
1738
|
+
(sku) => sku === planSku
|
|
1739
|
+
), () => ( // Retained Canary requests may replay their original operation. The API
|
|
1659
1740
|
// rejects new acquisition even when a caller supplies an idempotency key.
|
|
1660
|
-
|
|
1741
|
+
(planSku === "growth-canary-v1" && options.idempotencyKey ? planSku : void 0)));
|
|
1742
|
+
if (!targetPlanSku) {
|
|
1661
1743
|
reportBillingFailure(
|
|
1662
1744
|
{
|
|
1663
1745
|
exitCode: 2,
|
|
1664
1746
|
code: "INVALID_PLAN",
|
|
1665
|
-
message:
|
|
1747
|
+
message: `Plan must be one of ${_chunkCACFJODGjs.PUBLIC_PLAN_SKUS.join(", ")}. Run deepline billing plans to see workspace availability.`
|
|
1666
1748
|
},
|
|
1667
1749
|
options
|
|
1668
1750
|
);
|
|
1669
1751
|
return;
|
|
1670
1752
|
}
|
|
1671
1753
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1672
|
-
const payload = await new (0,
|
|
1754
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().billing.transitionPlan({
|
|
1673
1755
|
action: "start_or_change",
|
|
1674
|
-
targetPlanSku
|
|
1756
|
+
targetPlanSku,
|
|
1675
1757
|
...options.billingEmail ? { billingEmail: options.billingEmail } : {},
|
|
1676
1758
|
...options.promoCode ? { promoCode: options.promoCode } : {},
|
|
1759
|
+
...options.annual ? { billingInterval: "year" } : {},
|
|
1760
|
+
...options.invoice ? { paymentMethod: "invoice" } : {},
|
|
1677
1761
|
idempotencyKey
|
|
1678
1762
|
});
|
|
1679
|
-
|
|
1763
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1680
1764
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1681
1765
|
{ json: options.json }
|
|
1682
1766
|
);
|
|
1683
1767
|
}
|
|
1768
|
+
async function handleBillingDetailsShow(options) {
|
|
1769
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().billing.getDetails();
|
|
1770
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, { ok: true, ...payload }, { json: options.json });
|
|
1771
|
+
}
|
|
1772
|
+
async function handleBillingDetailsSet(options) {
|
|
1773
|
+
const separator = _nullishCoalesce(_optionalChain([options, 'access', _28 => _28.taxId, 'optionalAccess', _29 => _29.indexOf, 'call', _30 => _30(":")]), () => ( -1));
|
|
1774
|
+
if (options.taxId !== void 0 && separator <= 0 || options.line1 === void 0 !== (options.country === void 0) || options.line1 === void 0 && [options.line2, options.city, options.state, options.postalCode].some(
|
|
1775
|
+
(value) => value !== void 0
|
|
1776
|
+
) || options.name === void 0 && options.line1 === void 0 && options.taxId === void 0) {
|
|
1777
|
+
reportBillingFailure(
|
|
1778
|
+
{
|
|
1779
|
+
exitCode: 2,
|
|
1780
|
+
code: "INVALID_REQUEST",
|
|
1781
|
+
message: "Pass --name, an address (--line1 with --country), and/or --tax-id type:value."
|
|
1782
|
+
},
|
|
1783
|
+
options
|
|
1784
|
+
);
|
|
1785
|
+
return;
|
|
1786
|
+
}
|
|
1787
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().billing.setDetails({
|
|
1788
|
+
...options.name !== void 0 ? { name: options.name } : {},
|
|
1789
|
+
...options.line1 !== void 0 ? {
|
|
1790
|
+
address: {
|
|
1791
|
+
line1: options.line1,
|
|
1792
|
+
line2: _nullishCoalesce(options.line2, () => ( null)),
|
|
1793
|
+
city: _nullishCoalesce(options.city, () => ( null)),
|
|
1794
|
+
state: _nullishCoalesce(options.state, () => ( null)),
|
|
1795
|
+
postal_code: _nullishCoalesce(options.postalCode, () => ( null)),
|
|
1796
|
+
country: options.country
|
|
1797
|
+
}
|
|
1798
|
+
} : {},
|
|
1799
|
+
...options.taxId !== void 0 ? {
|
|
1800
|
+
tax_id: {
|
|
1801
|
+
type: options.taxId.slice(0, separator),
|
|
1802
|
+
value: options.taxId.slice(separator + 1)
|
|
1803
|
+
}
|
|
1804
|
+
} : {}
|
|
1805
|
+
});
|
|
1806
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, { ok: true, ...payload }, { json: options.json });
|
|
1807
|
+
}
|
|
1684
1808
|
async function handleTargetPlanCancellation(options) {
|
|
1685
1809
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1686
|
-
const payload = await new (0,
|
|
1810
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().billing.transitionPlan({
|
|
1687
1811
|
action: options.undo ? "undo_cancel" : "cancel",
|
|
1688
1812
|
idempotencyKey
|
|
1689
1813
|
});
|
|
1690
|
-
|
|
1814
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1691
1815
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1692
1816
|
{ json: options.json }
|
|
1693
1817
|
);
|
|
1694
1818
|
}
|
|
1695
1819
|
async function handleTargetPortal(options) {
|
|
1696
|
-
const payload = await new (0,
|
|
1820
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().billing.portalSession(
|
|
1697
1821
|
options.billingAddress ? { flow: "customer_update" } : void 0
|
|
1698
1822
|
);
|
|
1699
|
-
if (!options.json && !options.noOpen)
|
|
1700
|
-
|
|
1823
|
+
if (!options.json && !options.noOpen) _chunkXLIHTJVMjs.openInBrowser.call(void 0, payload.url);
|
|
1824
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, { ok: true, ...payload }, { json: options.json });
|
|
1701
1825
|
}
|
|
1702
1826
|
async function handleRedeemCode(code, options) {
|
|
1703
|
-
const { http } =
|
|
1827
|
+
const { http } = _chunkXLIHTJVMjs.getAuthedHttpClient.call(void 0, );
|
|
1704
1828
|
const payload = await http.post(
|
|
1705
1829
|
"/api/v2/billing/checkout",
|
|
1706
1830
|
{
|
|
@@ -1708,8 +1832,8 @@ async function handleRedeemCode(code, options) {
|
|
|
1708
1832
|
}
|
|
1709
1833
|
);
|
|
1710
1834
|
const url = String(payload.url || payload.checkout_url || "");
|
|
1711
|
-
if (!options.json && !options.noOpen && url)
|
|
1712
|
-
|
|
1835
|
+
if (!options.json && !options.noOpen && url) _chunkXLIHTJVMjs.openInBrowser.call(void 0, url);
|
|
1836
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1713
1837
|
{
|
|
1714
1838
|
...payload,
|
|
1715
1839
|
render: {
|
|
@@ -1725,7 +1849,7 @@ function registerBillingCommands(program) {
|
|
|
1725
1849
|
`
|
|
1726
1850
|
Concepts:
|
|
1727
1851
|
Billing commands show Deepline credits, not raw provider spend.
|
|
1728
|
-
Balance is shared by the
|
|
1852
|
+
Balance is shared by the org; concurrent work changes it. Use a job_id
|
|
1729
1853
|
charge lookup to attribute one tool command instead of comparing balances.
|
|
1730
1854
|
checkout/subscribe/redeem-code can open a browser unless --no-open is set.
|
|
1731
1855
|
|
|
@@ -1770,14 +1894,14 @@ Examples:
|
|
|
1770
1894
|
if (!Number.isSafeInteger(quantity) || quantity <= 0) {
|
|
1771
1895
|
throw new Error("--quantity must be a positive safe integer.");
|
|
1772
1896
|
}
|
|
1773
|
-
const quote = await new (0,
|
|
1897
|
+
const quote = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().billing.quote({
|
|
1774
1898
|
quantity,
|
|
1775
1899
|
sandbox_runtime: {
|
|
1776
1900
|
timeout: options.sandboxTimeout,
|
|
1777
1901
|
size: options.sandboxSize
|
|
1778
1902
|
}
|
|
1779
1903
|
});
|
|
1780
|
-
|
|
1904
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, quote, {
|
|
1781
1905
|
json: options.json,
|
|
1782
1906
|
text: `Sandbox session ceiling: ${quote.maximum_credits} Deepline credits (${quote.quantity} session${quote.quantity === 1 ? "" : "s"}).
|
|
1783
1907
|
${quote.explanation}
|
|
@@ -1789,12 +1913,12 @@ ${quote.explanation}
|
|
|
1789
1913
|
"after",
|
|
1790
1914
|
`
|
|
1791
1915
|
Notes:
|
|
1792
|
-
Read-only. Shows the current Deepline credit balance for the active
|
|
1793
|
-
The balance includes concurrent
|
|
1916
|
+
Read-only. Shows the current Deepline credit balance for the active org.
|
|
1917
|
+
The balance includes concurrent org activity, so a before/after difference
|
|
1794
1918
|
cannot isolate one command. Use billing usage --request-id <job_id>.
|
|
1795
1919
|
|
|
1796
1920
|
Prints one line, "Balance: N credits", plus what to do when
|
|
1797
|
-
the
|
|
1921
|
+
the org has no credits. --verbose adds reservations and usage awaiting
|
|
1798
1922
|
settlement. --json returns the full record.
|
|
1799
1923
|
|
|
1800
1924
|
Examples:
|
|
@@ -1804,11 +1928,11 @@ Examples:
|
|
|
1804
1928
|
`
|
|
1805
1929
|
).option("--json", "Emit the full balance record as JSON").option("--verbose", "Add reservations and usage awaiting settlement").action(handleBalance);
|
|
1806
1930
|
billing.command("reuse").description(
|
|
1807
|
-
"Show recorded reused tool results for this
|
|
1808
|
-
).option("--json", "Return the
|
|
1809
|
-
const { http } =
|
|
1931
|
+
"Show recorded reused tool results for this org; no credit estimate."
|
|
1932
|
+
).option("--json", "Return the org reuse summary as JSON").action(async (options) => {
|
|
1933
|
+
const { http } = _chunkXLIHTJVMjs.getAuthedHttpClient.call(void 0, );
|
|
1810
1934
|
const payload = await http.get("/api/v2/usage/reuse");
|
|
1811
|
-
|
|
1935
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1812
1936
|
{
|
|
1813
1937
|
status: "ok",
|
|
1814
1938
|
data: payload,
|
|
@@ -1835,7 +1959,7 @@ Notes:
|
|
|
1835
1959
|
page. Use --limit/--cursor to paginate the recent-call section.
|
|
1836
1960
|
For one tool call, use the billing command in the receipt deepline run printed, or its next.billing
|
|
1837
1961
|
command. Pending charges and temporary holds are not final spend; unknown means
|
|
1838
|
-
final charge evidence is unavailable.
|
|
1962
|
+
final charge evidence is unavailable. Org balance changes include other work.
|
|
1839
1963
|
|
|
1840
1964
|
Examples:
|
|
1841
1965
|
deepline billing usage
|
|
@@ -1866,7 +1990,7 @@ Examples:
|
|
|
1866
1990
|
"after",
|
|
1867
1991
|
`
|
|
1868
1992
|
Notes:
|
|
1869
|
-
Read-only. Shows whether monthly
|
|
1993
|
+
Read-only. Shows whether monthly org usage cap is enabled.
|
|
1870
1994
|
New calls are checked against this usage cap, separately from wallet funding.
|
|
1871
1995
|
|
|
1872
1996
|
Examples:
|
|
@@ -1878,7 +2002,7 @@ Examples:
|
|
|
1878
2002
|
"after",
|
|
1879
2003
|
`
|
|
1880
2004
|
Notes:
|
|
1881
|
-
Mutates
|
|
2005
|
+
Mutates org billing settings. The argument is a Deepline credit amount,
|
|
1882
2006
|
not dollars and not provider credits. New calls are checked against the cap;
|
|
1883
2007
|
in-flight work can still finish and exceed it. Buying credits does not reset it.
|
|
1884
2008
|
|
|
@@ -1891,7 +2015,7 @@ Examples:
|
|
|
1891
2015
|
"after",
|
|
1892
2016
|
`
|
|
1893
2017
|
Notes:
|
|
1894
|
-
Mutates
|
|
2018
|
+
Mutates org billing settings by removing monthly Deepline usage cap.
|
|
1895
2019
|
|
|
1896
2020
|
Examples:
|
|
1897
2021
|
deepline billing off
|
|
@@ -1902,7 +2026,7 @@ Examples:
|
|
|
1902
2026
|
"after",
|
|
1903
2027
|
`
|
|
1904
2028
|
Notes:
|
|
1905
|
-
Read-only. Exports every ledger row for the active
|
|
2029
|
+
Read-only. Exports every ledger row for the active org, including rows
|
|
1906
2030
|
created without an API key.
|
|
1907
2031
|
|
|
1908
2032
|
Examples:
|
|
@@ -1924,7 +2048,7 @@ Examples:
|
|
|
1924
2048
|
"after",
|
|
1925
2049
|
`
|
|
1926
2050
|
Notes:
|
|
1927
|
-
Pages through the
|
|
2051
|
+
Pages through the org ledger, writes CSV locally,
|
|
1928
2052
|
then reports the row count and the net delta computed from delta_credits.
|
|
1929
2053
|
|
|
1930
2054
|
Examples:
|
|
@@ -1970,7 +2094,7 @@ Examples:
|
|
|
1970
2094
|
"after",
|
|
1971
2095
|
`
|
|
1972
2096
|
Notes:
|
|
1973
|
-
Mutates
|
|
2097
|
+
Mutates org billing by charging the saved payment method for the active
|
|
1974
2098
|
workspace, then adding purchased Deepline credits. If no saved payment method
|
|
1975
2099
|
is available, use the checkout command printed in the error response.
|
|
1976
2100
|
--dry-run prints the planned request and idempotency key without charging.
|
|
@@ -1993,25 +2117,25 @@ Examples:
|
|
|
1993
2117
|
"Inspect or retire an original top-up intent without starting a payment."
|
|
1994
2118
|
).argument("<credits>", "Original positive integer Deepline credit amount").requiredOption(
|
|
1995
2119
|
"--org-id <original-org>",
|
|
1996
|
-
"Original
|
|
2120
|
+
"Original org ID (must match the authenticated org)"
|
|
1997
2121
|
).requiredOption(
|
|
1998
2122
|
"--idempotency-key <original-key>",
|
|
1999
2123
|
"Original purchase key; never generates a new key"
|
|
2000
2124
|
).option("--dry-run", "Print the recovery request without changing state").option("--json", "Emit JSON output").addHelpText(
|
|
2001
2125
|
"after",
|
|
2002
|
-
"\nAn absent intent is durably retired; an existing operation is returned unchanged.\nThis command never starts a payment. Use the original amount,
|
|
2126
|
+
"\nAn absent intent is durably retired; an existing operation is returned unchanged.\nThis command never starts a payment. Use the original amount, org, and key.\nExample:\n deepline billing top-up-recover 1000 --org-id org_original --idempotency-key original-purchase-key\n"
|
|
2003
2127
|
).action(handleTopUpRecover);
|
|
2004
2128
|
billing.command("status").description(
|
|
2005
2129
|
"Show plan, payment, and recharge state; use usage for charges."
|
|
2006
2130
|
).option("--json", "Emit JSON output").action(handleTargetStatus);
|
|
2007
2131
|
billing.command("entitlements").description(
|
|
2008
|
-
"Show
|
|
2132
|
+
"Show org benefits, remaining people search profiles, and effective rate limits."
|
|
2009
2133
|
).option("--json", "Emit JSON output").action(handleEntitlements);
|
|
2010
2134
|
billing.command("compute").description(
|
|
2011
2135
|
"Show Play runtime pricing, included compute, and minutes used."
|
|
2012
2136
|
).option(
|
|
2013
2137
|
"--enable",
|
|
2014
|
-
"Turn on included compute for this
|
|
2138
|
+
"Turn on included compute for this org (cannot be undone)"
|
|
2015
2139
|
).option("--json", "Emit JSON output").action(handleIncludedCompute);
|
|
2016
2140
|
billing.command("auto-recharge").description("Inspect and manage automatic Deepline credit recharge.").addHelpText(
|
|
2017
2141
|
"after",
|
|
@@ -2049,8 +2173,8 @@ Examples:
|
|
|
2049
2173
|
new (0, _commander.Command)("trigger").description(
|
|
2050
2174
|
"Evaluate capped automatic recharge and resume any pending purchase."
|
|
2051
2175
|
).option("--json", "Emit JSON output").action(async (options) => {
|
|
2052
|
-
const result = await new (0,
|
|
2053
|
-
|
|
2176
|
+
const result = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().billing.autoRecharge.trigger();
|
|
2177
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, { ok: true, ...result }, { json: options.json });
|
|
2054
2178
|
})
|
|
2055
2179
|
);
|
|
2056
2180
|
billing.command("cards").description("List, add, choose the default of, and remove saved cards.").addHelpText(
|
|
@@ -2084,14 +2208,29 @@ Examples:
|
|
|
2084
2208
|
);
|
|
2085
2209
|
billing.command("change-plan").description("Start or change the target billing plan.").argument(
|
|
2086
2210
|
"<plan_sku>",
|
|
2087
|
-
"
|
|
2211
|
+
`${_chunkCACFJODGjs.PUBLIC_PLAN_SKUS.join(", ")}. Run deepline billing plans to see workspace availability.`
|
|
2088
2212
|
).option(
|
|
2089
2213
|
"--billing-email <email>",
|
|
2090
|
-
"Invoice recipient when the account has no billing email"
|
|
2214
|
+
"Invoice recipient: required with --invoice, otherwise used when the account has no billing email"
|
|
2091
2215
|
).option(
|
|
2092
2216
|
"--promo-code <code>",
|
|
2093
2217
|
"Plan promo code; an unknown, expired, or used code refuses the change"
|
|
2218
|
+
).option(
|
|
2219
|
+
"--annual",
|
|
2220
|
+
"Pay for a year up front where `billing plans` shows an annual price; credits stay monthly and a cancellation takes effect at the end of the paid year"
|
|
2221
|
+
).option(
|
|
2222
|
+
"--invoice",
|
|
2223
|
+
"Email an invoice to --billing-email instead of charging a card (monthly or with --annual, starting from Solo); the plan starts once it is paid (due in 27 days). Set company name, address and tax ID first with `billing details set`"
|
|
2094
2224
|
).option("--idempotency-key <key>", "Stable retry key").option("--json", "Emit JSON output").action(handleTargetPlan);
|
|
2225
|
+
const details = billing.command("details").description(
|
|
2226
|
+
"Show the company name, billing address and tax ID printed on invoices."
|
|
2227
|
+
).option("--json", "Emit JSON output").action(handleBillingDetailsShow);
|
|
2228
|
+
details.command("set").description(
|
|
2229
|
+
"Set invoice billing details. Omitted fields are unchanged; set them before an invoice is sent, since a sent invoice keeps the details it was issued with."
|
|
2230
|
+
).option("--name <name>", "Company or legal name on the invoice").option("--line1 <line1>", "Address line 1 (needs --country)").option("--line2 <line2>", "Address line 2").option("--city <city>", "City").option("--state <state>", "State, province or region").option("--postal-code <code>", "Postal code").option("--country <code>", "Two-letter country code, such as US or DE").option(
|
|
2231
|
+
"--tax-id <type:value>",
|
|
2232
|
+
"Tax ID as type:value, such as eu_vat:DE123456789 or us_ein:12-3456789; replaces the current one"
|
|
2233
|
+
).option("--json", "Emit JSON output").action(handleBillingDetailsSet);
|
|
2095
2234
|
billing.command("cancel-plan").description("Cancel a target subscription at period end, or undo it.").option("--undo", "Undo a pending period-end cancellation").option("--idempotency-key <key>", "Stable retry key").option("--json", "Emit JSON output").action(handleTargetPlanCancellation);
|
|
2096
2235
|
billing.command("portal").description("Open the Stripe-hosted billing recovery portal.").option("--billing-address", "Open the billing address editor directly").option("--no-open", "Print the URL without opening a browser").option("--json", "Emit JSON output").action(handleTargetPortal);
|
|
2097
2236
|
billing.command("plans").description("Show published plans and the plan you are on.").addHelpText(
|
|
@@ -2103,7 +2242,11 @@ Notes:
|
|
|
2103
2242
|
and current acquisition availability. All amounts are Deepline credits and
|
|
2104
2243
|
Deepline-facing USD, never raw provider spend. Change to an available plan
|
|
2105
2244
|
with: deepline billing change-plan <plan_sku>. A first-month price or bonus
|
|
2106
|
-
credits appear on a plan when the
|
|
2245
|
+
credits appear on a plan when the org is offered them. An annual
|
|
2246
|
+
price appears when the org may pay for a year up front; buy it with
|
|
2247
|
+
change-plan <plan_sku> --annual. Where offered, any plan can be invoiced
|
|
2248
|
+
instead of charged: add --invoice --billing-email <email> (billing details set adds the company
|
|
2249
|
+
name, address and tax ID). With
|
|
2107
2250
|
--promo-code, prices are quoted with that code and its outcome is shown;
|
|
2108
2251
|
pass the same code to change-plan.
|
|
2109
2252
|
|
|
@@ -2128,7 +2271,7 @@ Examples:
|
|
|
2128
2271
|
deepline billing subscribe runtime-395-2026-07-v1 --no-open
|
|
2129
2272
|
`
|
|
2130
2273
|
).argument("<plan_version_id>", "Legacy billing plan version id").option("--no-open", "Print the checkout URL without opening a browser").option("--json", "Emit JSON output").action(handleSubscribe);
|
|
2131
|
-
billing.command("subscription").description("Inspect and manage subscription state for the
|
|
2274
|
+
billing.command("subscription").description("Inspect and manage subscription state for the org.").addHelpText(
|
|
2132
2275
|
"after",
|
|
2133
2276
|
`
|
|
2134
2277
|
Examples:
|
|
@@ -2199,7 +2342,7 @@ Examples:
|
|
|
2199
2342
|
"after",
|
|
2200
2343
|
`
|
|
2201
2344
|
Notes:
|
|
2202
|
-
Redeems
|
|
2345
|
+
Redeems an org billing code and may open a browser for completion unless
|
|
2203
2346
|
--no-open is set.
|
|
2204
2347
|
|
|
2205
2348
|
Examples:
|