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,12 +1,11 @@
|
|
|
1
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; var _class2;require('./chunk-I5YZLGMG.js');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var _chunkJLGP5XAJjs = require('./chunk-JLGP5XAJ.js');
|
|
5
|
+
require('./chunk-CACFJODG.js');
|
|
6
6
|
require('./chunk-4WAM6TLD.js');
|
|
7
|
-
require('./chunk-
|
|
7
|
+
require('./chunk-MJTVX4QK.js');
|
|
8
8
|
require('./chunk-PMH4GLMD.js');
|
|
9
|
-
require('./chunk-XDVT3GOM.js');
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
|
|
@@ -18,23 +17,24 @@ require('./chunk-UNEMDKXN.js');
|
|
|
18
17
|
var _chunkU2LVWCTDjs = require('./chunk-U2LVWCTD.js');
|
|
19
18
|
|
|
20
19
|
|
|
21
|
-
var
|
|
20
|
+
var _chunk4747TPLVjs = require('./chunk-4747TPLV.js');
|
|
22
21
|
|
|
23
22
|
|
|
24
23
|
|
|
25
24
|
|
|
26
25
|
|
|
27
|
-
var
|
|
28
|
-
require('./chunk-
|
|
29
|
-
require('./chunk-
|
|
26
|
+
var _chunkXLIHTJVMjs = require('./chunk-XLIHTJVM.js');
|
|
27
|
+
require('./chunk-MLABYI4M.js');
|
|
28
|
+
require('./chunk-AGLR6QVN.js');
|
|
30
29
|
|
|
31
30
|
|
|
32
|
-
var
|
|
31
|
+
var _chunk6VLFQZK6js = require('./chunk-6VLFQZK6.js');
|
|
33
32
|
require('./chunk-XNYIZMNQ.js');
|
|
34
33
|
|
|
35
34
|
|
|
36
|
-
var
|
|
37
|
-
require('./chunk-
|
|
35
|
+
var _chunkLFQJW4S2js = require('./chunk-LFQJW4S2.js');
|
|
36
|
+
require('./chunk-CFJFUVX2.js');
|
|
37
|
+
require('./chunk-6NE3RRRY.js');
|
|
38
38
|
require('./chunk-OG64RBAC.js');
|
|
39
39
|
require('./chunk-COGTRVWW.js');
|
|
40
40
|
|
|
@@ -65,8 +65,8 @@ var MonitorDryRunUnsupportedError = (_class2 = class extends Error {
|
|
|
65
65
|
function monitorsErrorExitCode(error) {
|
|
66
66
|
if (error instanceof MonitorsUsageError) return 2;
|
|
67
67
|
if (error instanceof MonitorFleetStateError) return 6;
|
|
68
|
-
if (error instanceof
|
|
69
|
-
if (error instanceof
|
|
68
|
+
if (error instanceof _chunk6VLFQZK6js.AuthError) return 3;
|
|
69
|
+
if (error instanceof _chunkLFQJW4S2js.DeeplineError) {
|
|
70
70
|
const status = error.statusCode;
|
|
71
71
|
if (status === 401 || status === 403) return 3;
|
|
72
72
|
if (status === 404) return 4;
|
|
@@ -77,16 +77,16 @@ function monitorsErrorExitCode(error) {
|
|
|
77
77
|
}
|
|
78
78
|
function monitorsFailureNextCommand(error, exitCode, options) {
|
|
79
79
|
if (error instanceof MonitorFleetStateError) return error.next;
|
|
80
|
-
if (error instanceof
|
|
80
|
+
if (error instanceof _chunkLFQJW4S2js.DeeplineError) {
|
|
81
81
|
const response = asRecord(_optionalChain([asRecord, 'call', _ => _(error.details), 'optionalAccess', _2 => _2.response]));
|
|
82
82
|
const serverNext = _nullishCoalesce(asString(_optionalChain([response, 'optionalAccess', _3 => _3.next])), () => ( asString(_optionalChain([response, 'optionalAccess', _4 => _4.next_action]))));
|
|
83
83
|
if (serverNext) return serverNext;
|
|
84
84
|
}
|
|
85
85
|
if (exitCode === 5 && _optionalChain([options, 'optionalAccess', _5 => _5.retryCommand])) return options.retryCommand;
|
|
86
|
-
if (error instanceof
|
|
86
|
+
if (error instanceof _chunkLFQJW4S2js.DeeplineError && error.code === "monitor_access_required") {
|
|
87
87
|
return "deepline monitors status";
|
|
88
88
|
}
|
|
89
|
-
if (error instanceof
|
|
89
|
+
if (error instanceof _chunkLFQJW4S2js.DeeplineError && error.code === "monitor_tool_not_found") {
|
|
90
90
|
return "deepline tools list --categories monitors";
|
|
91
91
|
}
|
|
92
92
|
if (exitCode === 3) return "deepline auth status";
|
|
@@ -94,7 +94,7 @@ function monitorsFailureNextCommand(error, exitCode, options) {
|
|
|
94
94
|
return void 0;
|
|
95
95
|
}
|
|
96
96
|
function readValidationIssues(error) {
|
|
97
|
-
if (!(error instanceof
|
|
97
|
+
if (!(error instanceof _chunkLFQJW4S2js.DeeplineError)) return [];
|
|
98
98
|
const response = asRecord(_optionalChain([asRecord, 'call', _6 => _6(error.details), 'optionalAccess', _7 => _7.response]));
|
|
99
99
|
const issues = Array.isArray(_optionalChain([response, 'optionalAccess', _8 => _8.issues])) ? response.issues : [];
|
|
100
100
|
return issues.flatMap((raw) => {
|
|
@@ -112,10 +112,10 @@ function reportMonitorsFailure(error, options) {
|
|
|
112
112
|
const exitCode = monitorsErrorExitCode(error);
|
|
113
113
|
const next = monitorsFailureNextCommand(error, exitCode, options);
|
|
114
114
|
const retrySafe = exitCode === 5 && _optionalChain([options, 'optionalAccess', _9 => _9.retryCommand]) !== void 0;
|
|
115
|
-
const wantsJson =
|
|
115
|
+
const wantsJson = _chunkXLIHTJVMjs.shouldEmitJson.call(void 0, process.argv.includes("--json"));
|
|
116
116
|
if (wantsJson) {
|
|
117
|
-
const payload =
|
|
118
|
-
|
|
117
|
+
const payload = _chunkXLIHTJVMjs.errorToJsonPayload.call(void 0, error);
|
|
118
|
+
_chunkXLIHTJVMjs.printJson.call(void 0, {
|
|
119
119
|
ok: false,
|
|
120
120
|
exitCode,
|
|
121
121
|
...next ? { next } : {},
|
|
@@ -496,6 +496,8 @@ function renderMonitorDeletePlan(payload, fallbackKey) {
|
|
|
496
496
|
`Delete plan for monitor "${key}":`,
|
|
497
497
|
` delete Deepline record: ${yesNo(_optionalChain([plan, 'optionalAccess', _15 => _15.would_delete_record]))}`,
|
|
498
498
|
` deprovision upstream provider resource: ${yesNo(_optionalChain([plan, 'optionalAccess', _16 => _16.would_deprovision_upstream]))}`,
|
|
499
|
+
...plan && typeof plan.would_retire_callback === "boolean" ? [` retire Deepline callback URL: ${yesNo(plan.would_retire_callback)}`] : [],
|
|
500
|
+
...plan && asString(plan.provider_removal_step) ? [` then, in the provider: ${asString(plan.provider_removal_step)}`] : [],
|
|
499
501
|
"",
|
|
500
502
|
`Delete for real: deepline monitors delete ${key} --yes`
|
|
501
503
|
];
|
|
@@ -535,14 +537,14 @@ Preview the plan first with:
|
|
|
535
537
|
);
|
|
536
538
|
}
|
|
537
539
|
async function handleMonitorsStatus(options) {
|
|
538
|
-
const payload = await new (0,
|
|
540
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors.status();
|
|
539
541
|
const hasAccess = payload.has_access === true;
|
|
540
542
|
const reason = typeof payload.reason === "string" && payload.reason.trim() ? payload.reason.trim() : void 0;
|
|
541
543
|
const text = hasAccess ? `\u2713 You have access to Deepline Monitors${reason ? `
|
|
542
544
|
${reason}` : ""}
|
|
543
545
|
` : `\u2717 No access to Deepline Monitors${reason ? ` \u2014 ${reason}` : ""}
|
|
544
546
|
`;
|
|
545
|
-
|
|
547
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
546
548
|
{ has_access: hasAccess, ...reason ? { reason } : {} },
|
|
547
549
|
{ json: options.json, text }
|
|
548
550
|
);
|
|
@@ -586,9 +588,10 @@ function renderAvailableToolsText(payload) {
|
|
|
586
588
|
lines.push(
|
|
587
589
|
"",
|
|
588
590
|
"Next:",
|
|
589
|
-
" Inspect payload fields
|
|
591
|
+
" Inspect payload fields and price (for a radar, this lists the radar",
|
|
592
|
+
" types to describe one by one):",
|
|
590
593
|
" deepline describe <provider.tool>",
|
|
591
|
-
" See monitors already deployed in this
|
|
594
|
+
" See monitors already deployed in this org:",
|
|
592
595
|
" deepline monitors list",
|
|
593
596
|
" Validate a monitor definition before deploying:",
|
|
594
597
|
` deepline monitors check '{"key":"my-monitor","tool":"<provider.tool>","payload":{...}}'`
|
|
@@ -596,9 +599,13 @@ function renderAvailableToolsText(payload) {
|
|
|
596
599
|
return `${lines.join("\n")}
|
|
597
600
|
`;
|
|
598
601
|
}
|
|
599
|
-
async function handleMonitorsAvailable(toolId, options) {
|
|
602
|
+
async function handleMonitorsAvailable(toolId, options, command) {
|
|
603
|
+
const typed = _optionalChain([command, 'optionalAccess', _17 => _17.parent, 'optionalAccess', _18 => _18.args, 'access', _19 => _19[0]]) === "tools" ? "tools" : "available";
|
|
600
604
|
process.stderr.write(
|
|
601
|
-
|
|
605
|
+
`\`deepline monitors ${typed}\` is deprecated.
|
|
606
|
+
Browse types: deepline tools list --categories monitors
|
|
607
|
+
Inspect a type: deepline describe <monitor-type>
|
|
608
|
+
`
|
|
602
609
|
);
|
|
603
610
|
if (toolId !== void 0 && options.tool !== void 0) {
|
|
604
611
|
if (toolId !== options.tool) {
|
|
@@ -608,14 +615,14 @@ async function handleMonitorsAvailable(toolId, options) {
|
|
|
608
615
|
}
|
|
609
616
|
}
|
|
610
617
|
const tool = _nullishCoalesce(toolId, () => ( options.tool));
|
|
611
|
-
const payload = await new (0,
|
|
618
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors.available(tool, {
|
|
612
619
|
...options.provider ? { provider: options.provider } : {},
|
|
613
620
|
...options.search ? { search: options.search } : {},
|
|
614
621
|
...options.limit ? { limit: options.limit } : {},
|
|
615
622
|
...options.full ? { full: true } : {},
|
|
616
623
|
...options.compact ? { compact: true } : {}
|
|
617
624
|
});
|
|
618
|
-
|
|
625
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload, {
|
|
619
626
|
json: options.json,
|
|
620
627
|
// Human list view shows id + name + deployed_count ("deployed: N") so
|
|
621
628
|
// can-deploy vs already-deployed is visible in one view. Describing a
|
|
@@ -667,11 +674,11 @@ function renderDeployedListText(payload, requestedStatus, filterKind = "status")
|
|
|
667
674
|
if (Array.isArray(entry.bound_plays)) {
|
|
668
675
|
for (const rawPlay of entry.bound_plays) {
|
|
669
676
|
const play = asRecord(rawPlay);
|
|
670
|
-
const playName = _nullishCoalesce(asString(_optionalChain([play, 'optionalAccess',
|
|
671
|
-
const health = asRecord(_optionalChain([play, 'optionalAccess',
|
|
677
|
+
const playName = _nullishCoalesce(asString(_optionalChain([play, 'optionalAccess', _20 => _20.name])), () => ( "unnamed Play"));
|
|
678
|
+
const health = asRecord(_optionalChain([play, 'optionalAccess', _21 => _21.consumer_health]));
|
|
672
679
|
const healthRequested = Boolean(play && "consumer_health" in play);
|
|
673
|
-
const state2 = healthRequested ? _nullishCoalesce(asString(_optionalChain([health, 'optionalAccess',
|
|
674
|
-
const lastError = asString(_optionalChain([health, 'optionalAccess',
|
|
680
|
+
const state2 = healthRequested ? _nullishCoalesce(asString(_optionalChain([health, 'optionalAccess', _22 => _22.last_run_status])), () => ( "no delivery yet")) : "health not requested";
|
|
681
|
+
const lastError = asString(_optionalChain([health, 'optionalAccess', _23 => _23.last_error]));
|
|
675
682
|
lines.push(
|
|
676
683
|
` consumer: ${playName} \u2014 ${state2}${lastError ? ` (${lastError})` : ""}`
|
|
677
684
|
);
|
|
@@ -722,14 +729,14 @@ async function handleMonitorsList(options) {
|
|
|
722
729
|
"`--compact` is deprecated and now does nothing; returning the complete monitor records.\n"
|
|
723
730
|
);
|
|
724
731
|
}
|
|
725
|
-
const payload = await new (0,
|
|
732
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors.list({
|
|
726
733
|
...state ? { state } : {},
|
|
727
734
|
...options.status ? { status: options.status } : {},
|
|
728
735
|
...options.limit ? { limit: options.limit } : {},
|
|
729
736
|
...options.cursor ? { cursor: options.cursor } : {},
|
|
730
737
|
...options.includeConsumers ? { includeConsumers: true } : {}
|
|
731
738
|
});
|
|
732
|
-
|
|
739
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload, {
|
|
733
740
|
json: options.json,
|
|
734
741
|
text: renderDeployedListText(
|
|
735
742
|
payload,
|
|
@@ -765,15 +772,15 @@ var LEDGER_WINDOW_LABELS = {
|
|
|
765
772
|
"1y": "1y"
|
|
766
773
|
};
|
|
767
774
|
function ledgerFindingsText(findings, windowLabel) {
|
|
768
|
-
const count = asFiniteNumber(_optionalChain([findings, 'optionalAccess',
|
|
775
|
+
const count = asFiniteNumber(_optionalChain([findings, 'optionalAccess', _24 => _24.count]));
|
|
769
776
|
if (count === void 0) return "findings not counted yet";
|
|
770
|
-
const since = asString(_optionalChain([findings, 'optionalAccess',
|
|
777
|
+
const since = asString(_optionalChain([findings, 'optionalAccess', _25 => _25.counting_since]));
|
|
771
778
|
return `${count.toLocaleString("en-US")} ${count === 1 ? "finding" : "findings"} ${windowLabel}${since ? ` (counting since ${since})` : ""}`;
|
|
772
779
|
}
|
|
773
780
|
function renderMonitorLedgerText(payload) {
|
|
774
781
|
const monitors = Array.isArray(payload.monitors) ? payload.monitors : null;
|
|
775
782
|
if (!monitors) return void 0;
|
|
776
|
-
const window = _nullishCoalesce(asString(_optionalChain([asRecord, 'call',
|
|
783
|
+
const window = _nullishCoalesce(asString(_optionalChain([asRecord, 'call', _26 => _26(payload.applied), 'optionalAccess', _27 => _27.window])), () => ( "30d"));
|
|
777
784
|
const windowLabel = _nullishCoalesce(LEDGER_WINDOW_LABELS[window], () => ( window));
|
|
778
785
|
const lines = [];
|
|
779
786
|
const failing = Array.isArray(payload.failing_plays) ? payload.failing_plays : [];
|
|
@@ -793,6 +800,16 @@ function renderMonitorLedgerText(payload) {
|
|
|
793
800
|
)} \xB7 ${_nullishCoalesce(asFiniteNumber(fleetScope.live), () => ( 0))} of ${_nullishCoalesce(_nullishCoalesce(asFiniteNumber(fleetScope.owned), () => ( asFiniteNumber(fleetScope.expected))), () => ( 0))} live \xB7 ${issues} ${issues === 1 ? "issue" : "issues"}`
|
|
794
801
|
);
|
|
795
802
|
}
|
|
803
|
+
const matchingFleets = Array.isArray(payload.matching_fleets) ? payload.matching_fleets : [];
|
|
804
|
+
for (const raw of matchingFleets) {
|
|
805
|
+
const fleet = asRecord(raw);
|
|
806
|
+
const id = fleet ? asString(fleet.id) : void 0;
|
|
807
|
+
if (!fleet || !id) continue;
|
|
808
|
+
const members = _nullishCoalesce(asFiniteNumber(fleet.member_count), () => ( 0));
|
|
809
|
+
lines.push(
|
|
810
|
+
`Fleet ${id} matches through its shared settings (${members} ${members === 1 ? "monitor" : "monitors"}). Its members: deepline monitors ledger --fleet ${id}`
|
|
811
|
+
);
|
|
812
|
+
}
|
|
796
813
|
const total = asFiniteNumber(payload.total);
|
|
797
814
|
lines.push(
|
|
798
815
|
monitors.length === 0 ? "No monitors matched." : total !== void 0 && total > monitors.length ? `Monitors (${monitors.length} of ${total}):` : `Monitors (${monitors.length}):`
|
|
@@ -805,12 +822,12 @@ function renderMonitorLedgerText(payload) {
|
|
|
805
822
|
const subject = asRecord(entry.subject);
|
|
806
823
|
const status = _nullishCoalesce(asString(entry.ledger_status), () => ( "unknown"));
|
|
807
824
|
const plays = asRecord(entry.plays);
|
|
808
|
-
const shown = Array.isArray(_optionalChain([plays, 'optionalAccess',
|
|
809
|
-
const more = _nullishCoalesce(asFiniteNumber(_optionalChain([plays, 'optionalAccess',
|
|
825
|
+
const shown = Array.isArray(_optionalChain([plays, 'optionalAccess', _28 => _28.shown])) ? plays.shown : [];
|
|
826
|
+
const more = _nullishCoalesce(asFiniteNumber(_optionalChain([plays, 'optionalAccess', _29 => _29.more_count])), () => ( 0));
|
|
810
827
|
const playText = shown.length === 0 ? "No Play" : `${shown.map((play) => ledgerPlayLabel(_nullishCoalesce(asRecord(play), () => ( {})))).join(", ")}${more > 0 ? `, +${more} more` : ""}`;
|
|
811
828
|
lines.push(
|
|
812
|
-
`- ${_nullishCoalesce(asString(entry.name), () => ( key))} [${key}] \xB7 ${_nullishCoalesce(_nullishCoalesce(asString(_optionalChain([signal, 'optionalAccess',
|
|
813
|
-
` ${_nullishCoalesce(LEDGER_STATUS_LABELS[status], () => ( status))} \xB7 ${ledgerFindingsText(asRecord(entry.findings), windowLabel)} \xB7 set up ${_nullishCoalesce(_optionalChain([asString, 'call',
|
|
829
|
+
`- ${_nullishCoalesce(asString(entry.name), () => ( key))} [${key}] \xB7 ${_nullishCoalesce(_nullishCoalesce(asString(_optionalChain([signal, 'optionalAccess', _30 => _30.label])), () => ( asString(entry.type))), () => ( "monitor"))}${asString(_optionalChain([subject, 'optionalAccess', _31 => _31.value])) ? ` \xB7 ${asString(_optionalChain([subject, 'optionalAccess', _32 => _32.value]))}` : ""}`,
|
|
830
|
+
` ${_nullishCoalesce(LEDGER_STATUS_LABELS[status], () => ( status))} \xB7 ${ledgerFindingsText(asRecord(entry.findings), windowLabel)} \xB7 set up ${_nullishCoalesce(_optionalChain([asString, 'call', _33 => _33(entry.installed_at), 'optionalAccess', _34 => _34.slice, 'call', _35 => _35(0, 10)]), () => ( "unknown"))} \xB7 triggers: ${playText}`
|
|
814
831
|
);
|
|
815
832
|
}
|
|
816
833
|
const next = asString(payload.next_cursor);
|
|
@@ -820,7 +837,7 @@ function renderMonitorLedgerText(payload) {
|
|
|
820
837
|
var LEDGER_SORTS = ["recent", "installed", "name", "findings"];
|
|
821
838
|
var LEDGER_WINDOWS = ["1d", "7d", "30d", "90d", "1y"];
|
|
822
839
|
async function handleMonitorsLedger(key, options) {
|
|
823
|
-
const client = new (0,
|
|
840
|
+
const client = new (0, _chunkJLGP5XAJjs.DeeplineClient)();
|
|
824
841
|
if (options.findings) {
|
|
825
842
|
if (!key) {
|
|
826
843
|
throw new MonitorsUsageError(
|
|
@@ -830,12 +847,12 @@ async function handleMonitorsLedger(key, options) {
|
|
|
830
847
|
const payload2 = await client.monitors.ledgerFindings(key, {
|
|
831
848
|
...options.cursor ? { cursor: options.cursor } : {}
|
|
832
849
|
});
|
|
833
|
-
|
|
850
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload2, { json: options.json });
|
|
834
851
|
return;
|
|
835
852
|
}
|
|
836
853
|
if (key) {
|
|
837
854
|
const payload2 = await client.monitors.ledgerGet(key);
|
|
838
|
-
|
|
855
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload2, { json: options.json });
|
|
839
856
|
return;
|
|
840
857
|
}
|
|
841
858
|
if (options.sort !== void 0 && !LEDGER_SORTS.includes(options.sort)) {
|
|
@@ -850,8 +867,8 @@ async function handleMonitorsLedger(key, options) {
|
|
|
850
867
|
}
|
|
851
868
|
const payload = await client.monitors.ledger({
|
|
852
869
|
...options.search ? { search: options.search } : {},
|
|
853
|
-
..._optionalChain([options, 'access',
|
|
854
|
-
..._optionalChain([options, 'access',
|
|
870
|
+
..._optionalChain([options, 'access', _36 => _36.state, 'optionalAccess', _37 => _37.length]) ? { states: options.state } : {},
|
|
871
|
+
..._optionalChain([options, 'access', _38 => _38.signal, 'optionalAccess', _39 => _39.length]) ? { signals: options.signal } : {},
|
|
855
872
|
...options.play ? { play: options.play } : {},
|
|
856
873
|
...options.fleet ? { fleet: options.fleet } : {},
|
|
857
874
|
...options.sort ? { sort: options.sort } : {},
|
|
@@ -859,7 +876,7 @@ async function handleMonitorsLedger(key, options) {
|
|
|
859
876
|
...options.limit ? { limit: options.limit } : {},
|
|
860
877
|
...options.cursor ? { cursor: options.cursor } : {}
|
|
861
878
|
});
|
|
862
|
-
|
|
879
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload, {
|
|
863
880
|
json: options.json,
|
|
864
881
|
text: renderMonitorLedgerText(payload)
|
|
865
882
|
});
|
|
@@ -871,10 +888,10 @@ async function handleMonitorsCheck(definition, options) {
|
|
|
871
888
|
argLabel: "<definition>",
|
|
872
889
|
command: "deepline monitors check"
|
|
873
890
|
});
|
|
874
|
-
const payload = await new (0,
|
|
891
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors.check(
|
|
875
892
|
body
|
|
876
893
|
);
|
|
877
|
-
|
|
894
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload, { json: options.json });
|
|
878
895
|
}
|
|
879
896
|
function previewText(value) {
|
|
880
897
|
return typeof value === "string" && value.trim() ? value.trim() : "-";
|
|
@@ -886,7 +903,7 @@ function renderMonitorPreviewText(payload) {
|
|
|
886
903
|
`Preview of ${previewText(payload.tool)}: ${updates.length} of ${String(_nullishCoalesce(payload.limit, () => ( "?")))} requested matches.`
|
|
887
904
|
];
|
|
888
905
|
for (const item of updates) {
|
|
889
|
-
const content = _nullishCoalesce(asRecord(_optionalChain([asRecord, 'call',
|
|
906
|
+
const content = _nullishCoalesce(asRecord(_optionalChain([asRecord, 'call', _40 => _40(item), 'optionalAccess', _41 => _41.content])), () => ( {}));
|
|
890
907
|
lines.push(
|
|
891
908
|
` ${previewText(content.full_name)} | ${previewText(content.title)} | started ${previewText(content.start_date)} | ${previewText(content.seniority)}`
|
|
892
909
|
);
|
|
@@ -932,22 +949,22 @@ async function handleMonitorsPreview(definition, options) {
|
|
|
932
949
|
if (limit !== void 0 && !Number.isInteger(limit)) {
|
|
933
950
|
throw new MonitorsUsageError("--limit must be a whole number from 1 to 3.");
|
|
934
951
|
}
|
|
935
|
-
const wantsJson =
|
|
952
|
+
const wantsJson = _chunkXLIHTJVMjs.shouldEmitJson.call(void 0, options.json);
|
|
936
953
|
if (options.idempotencyKey === void 0 && wantsJson) {
|
|
937
954
|
throw new MonitorsUsageError(
|
|
938
955
|
"--json requires --idempotency-key <key>. Choose a new key for each new preview and keep it: rerunning with the same key returns the result without paying again."
|
|
939
956
|
);
|
|
940
957
|
}
|
|
941
958
|
const idempotencyKey = _nullishCoalesce(options.idempotencyKey, () => ( `monitor-preview-${_crypto.randomUUID.call(void 0, )}`));
|
|
942
|
-
const progress =
|
|
959
|
+
const progress = _chunk4747TPLVjs.createCliProgress.call(void 0, !wantsJson);
|
|
943
960
|
progress.phase(`Preview key: ${idempotencyKey}`);
|
|
944
961
|
try {
|
|
945
|
-
const payload = await new (0,
|
|
962
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors.preview(
|
|
946
963
|
body,
|
|
947
964
|
{ idempotencyKey, ...limit === void 0 ? {} : { limit } }
|
|
948
965
|
);
|
|
949
966
|
progress.complete();
|
|
950
|
-
|
|
967
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload, {
|
|
951
968
|
json: options.json,
|
|
952
969
|
text: renderMonitorPreviewText(payload)
|
|
953
970
|
});
|
|
@@ -974,7 +991,7 @@ var MONITOR_PREVIEW_NEW_KEY_CODES = /* @__PURE__ */ new Set([
|
|
|
974
991
|
"monitor_preview_outcome_unknown"
|
|
975
992
|
]);
|
|
976
993
|
function previewRetryableWithSameKey(error) {
|
|
977
|
-
if (!(error instanceof
|
|
994
|
+
if (!(error instanceof _chunkLFQJW4S2js.DeeplineError)) return true;
|
|
978
995
|
const code = error.code;
|
|
979
996
|
if (code !== void 0 && MONITOR_PREVIEW_NEW_KEY_CODES.has(code)) {
|
|
980
997
|
return false;
|
|
@@ -992,15 +1009,15 @@ async function handleMonitorsDeploy(definition, options) {
|
|
|
992
1009
|
argLabel: "<definition>",
|
|
993
1010
|
command: "deepline monitors deploy"
|
|
994
1011
|
});
|
|
995
|
-
const client = new (0,
|
|
1012
|
+
const client = new (0, _chunkJLGP5XAJjs.DeeplineClient)();
|
|
996
1013
|
const definitionArg = body;
|
|
997
1014
|
if (options.dryRun) {
|
|
998
1015
|
const payload2 = await client.monitors.deploy(definitionArg, {
|
|
999
1016
|
dryRun: true
|
|
1000
1017
|
});
|
|
1001
1018
|
const valid = payload2.valid !== false;
|
|
1002
|
-
const hasIdentityConflict = Boolean(_optionalChain([asRecord, 'call',
|
|
1003
|
-
|
|
1019
|
+
const hasIdentityConflict = Boolean(_optionalChain([asRecord, 'call', _42 => _42(payload2), 'optionalAccess', _43 => _43.identity_conflict]));
|
|
1020
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1004
1021
|
{ dry_run: true, ...payload2 },
|
|
1005
1022
|
{ json: options.json, text: renderMonitorDeployPlan(payload2) }
|
|
1006
1023
|
);
|
|
@@ -1010,7 +1027,7 @@ async function handleMonitorsDeploy(definition, options) {
|
|
|
1010
1027
|
return;
|
|
1011
1028
|
}
|
|
1012
1029
|
const payload = await client.monitors.deploy(definitionArg);
|
|
1013
|
-
|
|
1030
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload, {
|
|
1014
1031
|
json: options.json,
|
|
1015
1032
|
text: renderMonitorDeployCompletion(payload)
|
|
1016
1033
|
});
|
|
@@ -1022,29 +1039,29 @@ async function handleMonitorsSync(definition, options) {
|
|
|
1022
1039
|
argLabel: "<definition>",
|
|
1023
1040
|
command: "deepline monitors sync"
|
|
1024
1041
|
});
|
|
1025
|
-
const payload = await new (0,
|
|
1042
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors.sync(body, {
|
|
1026
1043
|
...options.dryRun ? { dryRun: true } : {},
|
|
1027
1044
|
idempotencyKey: _nullishCoalesce(options.idempotencyKey, () => ( monitorJobIdempotencyKey("scalar-sync", void 0)))
|
|
1028
1045
|
});
|
|
1029
1046
|
if (options.dryRun) {
|
|
1030
1047
|
const plan = payload;
|
|
1031
|
-
|
|
1048
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1032
1049
|
{ dry_run: true, ...plan },
|
|
1033
1050
|
{ json: options.json, text: renderMonitorDeployPlan(plan) }
|
|
1034
1051
|
);
|
|
1035
1052
|
return;
|
|
1036
1053
|
}
|
|
1037
|
-
|
|
1054
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload, {
|
|
1038
1055
|
json: options.json,
|
|
1039
1056
|
text: renderMonitorJob(payload)
|
|
1040
1057
|
});
|
|
1041
1058
|
}
|
|
1042
1059
|
async function handleScalarMonitorLifecycle(action, key, options) {
|
|
1043
|
-
const payload = await new (0,
|
|
1060
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors[action](key, {
|
|
1044
1061
|
...options.dryRun ? { dryRun: true } : {},
|
|
1045
1062
|
idempotencyKey: _nullishCoalesce(options.idempotencyKey, () => ( monitorJobIdempotencyKey(`${action}-${key}`, void 0)))
|
|
1046
1063
|
});
|
|
1047
|
-
|
|
1064
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload, {
|
|
1048
1065
|
json: options.json,
|
|
1049
1066
|
text: options.dryRun ? void 0 : renderMonitorJob(payload)
|
|
1050
1067
|
});
|
|
@@ -1058,14 +1075,14 @@ function fleetIntegerOption(raw, flag) {
|
|
|
1058
1075
|
return value;
|
|
1059
1076
|
}
|
|
1060
1077
|
function fleetIdempotencyKey(operation, supplied) {
|
|
1061
|
-
const normalized = _optionalChain([supplied, 'optionalAccess',
|
|
1078
|
+
const normalized = _optionalChain([supplied, 'optionalAccess', _44 => _44.trim, 'call', _45 => _45()]);
|
|
1062
1079
|
if (supplied !== void 0 && !normalized) {
|
|
1063
1080
|
throw new MonitorsUsageError("--idempotency-key must not be empty.");
|
|
1064
1081
|
}
|
|
1065
1082
|
return _nullishCoalesce(normalized, () => ( `monitor-fleet-${operation}-${_crypto.randomUUID.call(void 0, )}`));
|
|
1066
1083
|
}
|
|
1067
1084
|
function monitorJobIdempotencyKey(operation, supplied) {
|
|
1068
|
-
const normalized = _optionalChain([supplied, 'optionalAccess',
|
|
1085
|
+
const normalized = _optionalChain([supplied, 'optionalAccess', _46 => _46.trim, 'call', _47 => _47()]);
|
|
1069
1086
|
if (supplied !== void 0 && !normalized) {
|
|
1070
1087
|
throw new MonitorsUsageError("--idempotency-key must not be empty.");
|
|
1071
1088
|
}
|
|
@@ -1133,11 +1150,11 @@ async function handleMonitorJobBatchDeploy(options, idempotencyKey) {
|
|
|
1133
1150
|
lint.issues.filter((issue) => issue.severity === "error").map((issue) => `${issue.path || "batch"}: ${issue.message}`).join("; ")
|
|
1134
1151
|
);
|
|
1135
1152
|
}
|
|
1136
|
-
const payload = await new (0,
|
|
1153
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors.batch.deploy(
|
|
1137
1154
|
lint.normalized.monitors,
|
|
1138
1155
|
{ idempotencyKey }
|
|
1139
1156
|
);
|
|
1140
|
-
|
|
1157
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1141
1158
|
{
|
|
1142
1159
|
...payload,
|
|
1143
1160
|
idempotency_key: idempotencyKey,
|
|
@@ -1147,7 +1164,7 @@ async function handleMonitorJobBatchDeploy(options, idempotencyKey) {
|
|
|
1147
1164
|
);
|
|
1148
1165
|
}
|
|
1149
1166
|
function namedBatchIdempotencyKey(batchId, intent, supplied) {
|
|
1150
|
-
return _optionalChain([supplied, 'optionalAccess',
|
|
1167
|
+
return _optionalChain([supplied, 'optionalAccess', _48 => _48.trim, 'call', _49 => _49()]) || `monitor-batch-${intent}-${batchId}-${_crypto.randomUUID.call(void 0, )}`;
|
|
1151
1168
|
}
|
|
1152
1169
|
async function handleNamedMonitorBatchSync(batchId, options) {
|
|
1153
1170
|
if (!options.file) {
|
|
@@ -1170,7 +1187,7 @@ async function handleNamedMonitorBatchSync(batchId, options) {
|
|
|
1170
1187
|
);
|
|
1171
1188
|
}
|
|
1172
1189
|
if (options.dryRun) {
|
|
1173
|
-
|
|
1190
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1174
1191
|
{
|
|
1175
1192
|
ok: true,
|
|
1176
1193
|
dry_run: true,
|
|
@@ -1187,7 +1204,7 @@ async function handleNamedMonitorBatchSync(batchId, options) {
|
|
|
1187
1204
|
"sync",
|
|
1188
1205
|
options.idempotencyKey
|
|
1189
1206
|
);
|
|
1190
|
-
const payload = await new (0,
|
|
1207
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors.batches.sync(
|
|
1191
1208
|
batchId,
|
|
1192
1209
|
lint.normalized.monitors,
|
|
1193
1210
|
{
|
|
@@ -1195,14 +1212,14 @@ async function handleNamedMonitorBatchSync(batchId, options) {
|
|
|
1195
1212
|
...parsedGeneration === void 0 ? {} : { expectedGeneration: parsedGeneration }
|
|
1196
1213
|
}
|
|
1197
1214
|
);
|
|
1198
|
-
|
|
1215
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1199
1216
|
{ ...payload, idempotency_key: idempotencyKey },
|
|
1200
1217
|
{ json: options.json, text: renderMonitorJob(payload) }
|
|
1201
1218
|
);
|
|
1202
1219
|
}
|
|
1203
1220
|
async function handleNamedMonitorBatchLifecycle(batchId, intent, options) {
|
|
1204
1221
|
if (options.dryRun) {
|
|
1205
|
-
|
|
1222
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1206
1223
|
{
|
|
1207
1224
|
ok: true,
|
|
1208
1225
|
dry_run: true,
|
|
@@ -1218,17 +1235,17 @@ async function handleNamedMonitorBatchLifecycle(batchId, intent, options) {
|
|
|
1218
1235
|
intent,
|
|
1219
1236
|
options.idempotencyKey
|
|
1220
1237
|
);
|
|
1221
|
-
const payload = await new (0,
|
|
1238
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors.batches[intent](batchId, {
|
|
1222
1239
|
idempotencyKey
|
|
1223
1240
|
});
|
|
1224
|
-
|
|
1241
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1225
1242
|
{ ...payload, idempotency_key: idempotencyKey },
|
|
1226
1243
|
{ json: options.json, text: renderMonitorJob(payload) }
|
|
1227
1244
|
);
|
|
1228
1245
|
}
|
|
1229
1246
|
async function handleNamedMonitorBatchGet(batchId, options) {
|
|
1230
|
-
const payload = await new (0,
|
|
1231
|
-
|
|
1247
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors.batches.get(batchId);
|
|
1248
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload, {
|
|
1232
1249
|
json: options.json,
|
|
1233
1250
|
text: renderMonitorJob(payload)
|
|
1234
1251
|
});
|
|
@@ -1242,7 +1259,7 @@ async function handleMonitorBatchLint(options) {
|
|
|
1242
1259
|
const result = _chunkU2LVWCTDjs.lintMonitorBatchInput.call(void 0,
|
|
1243
1260
|
readMonitorDefinitionsJsonFile(options.file)
|
|
1244
1261
|
);
|
|
1245
|
-
|
|
1262
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1246
1263
|
{
|
|
1247
1264
|
ok: !result.issues.some((issue) => issue.severity === "error"),
|
|
1248
1265
|
...result.normalized ? { normalized: result.normalized } : {},
|
|
@@ -1262,7 +1279,7 @@ async function handleMonitorFleetLint(options) {
|
|
|
1262
1279
|
const result = _chunkWOQO3GV4js.lintMonitorFleetInput.call(void 0,
|
|
1263
1280
|
readMonitorDefinitionsJsonFile(options.file)
|
|
1264
1281
|
);
|
|
1265
|
-
|
|
1282
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1266
1283
|
{
|
|
1267
1284
|
ok: !result.issues.some((issue) => issue.severity === "error"),
|
|
1268
1285
|
...result.normalized ? { normalized: result.normalized } : {},
|
|
@@ -1274,32 +1291,32 @@ async function handleMonitorFleetLint(options) {
|
|
|
1274
1291
|
process.exitCode = 2;
|
|
1275
1292
|
}
|
|
1276
1293
|
async function handleMonitorJobGet(jobId, options) {
|
|
1277
|
-
const payload = await new (0,
|
|
1278
|
-
|
|
1294
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors.jobs.get(jobId);
|
|
1295
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload, {
|
|
1279
1296
|
json: options.json,
|
|
1280
1297
|
text: renderMonitorJob(payload)
|
|
1281
1298
|
});
|
|
1282
1299
|
}
|
|
1283
1300
|
async function handleMonitorJobWait(jobId, options) {
|
|
1284
|
-
const payload = await new (0,
|
|
1301
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors.jobs.wait(jobId, {
|
|
1285
1302
|
timeoutMs: fleetTimeoutMs(options.timeout),
|
|
1286
1303
|
pollIntervalMs: FLEET_POLL_INTERVAL_MS
|
|
1287
1304
|
});
|
|
1288
|
-
|
|
1305
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload, {
|
|
1289
1306
|
json: options.json,
|
|
1290
1307
|
text: renderMonitorJob(payload)
|
|
1291
1308
|
});
|
|
1292
1309
|
}
|
|
1293
1310
|
async function handleMonitorJobLogs(jobId, options) {
|
|
1294
1311
|
const limit = options.limit ? fleetIntegerOption(options.limit, "--limit") : void 0;
|
|
1295
|
-
const payload = await new (0,
|
|
1312
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors.jobs.logs(jobId, {
|
|
1296
1313
|
...limit === void 0 ? {} : { limit }
|
|
1297
1314
|
});
|
|
1298
|
-
|
|
1315
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload, { json: options.json });
|
|
1299
1316
|
}
|
|
1300
1317
|
async function handleMonitorJobCancel(jobId, options) {
|
|
1301
|
-
const payload = await new (0,
|
|
1302
|
-
|
|
1318
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors.jobs.cancel(jobId);
|
|
1319
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload, {
|
|
1303
1320
|
json: options.json,
|
|
1304
1321
|
text: renderMonitorJob(payload)
|
|
1305
1322
|
});
|
|
@@ -1373,7 +1390,8 @@ var MONITOR_FLEET_COMMANDS = [
|
|
|
1373
1390
|
var MONITOR_FLEET_AGENT_NOTES = [
|
|
1374
1391
|
"Pass --json only when a program parses the output; stdout is then exactly one JSON object.",
|
|
1375
1392
|
"Every error includes a runnable `next` command \u2014 run it, do not guess.",
|
|
1376
|
-
"Exit 5 = retry the same command; 6 = inspect counts with `get --drift`; 7 = change the request."
|
|
1393
|
+
"Exit 5 = retry the same command; 6 = inspect counts with `get --drift`; 7 = change the request.",
|
|
1394
|
+
"A Fleet can stay converging for hours while the provider finishes its creates. Members whose error says the provider is still creating them are waiting, not failing. Deactivating or redeploying does not speed this up or cancel a create the provider has accepted: a deactivation waits for that create, then deletes it."
|
|
1377
1395
|
];
|
|
1378
1396
|
var MONITOR_FLEET_HELP_EPILOG = `
|
|
1379
1397
|
Agent notes:
|
|
@@ -1591,7 +1609,7 @@ function renderFleetList(payload) {
|
|
|
1591
1609
|
(left, right) => (_nullishCoalesce(asString(left.id), () => ( ""))).localeCompare(_nullishCoalesce(asString(right.id), () => ( "")))
|
|
1592
1610
|
);
|
|
1593
1611
|
if (fleets.length === 0) {
|
|
1594
|
-
return "No Monitor Fleets in this
|
|
1612
|
+
return "No Monitor Fleets in this org.\nNext: deepline monitors fleets init <fleet-id> --help\n";
|
|
1595
1613
|
}
|
|
1596
1614
|
const idWidth = fleets.reduce(
|
|
1597
1615
|
(max, fleet) => Math.max(max, (_nullishCoalesce(asString(fleet.id), () => ( ""))).length),
|
|
@@ -1641,7 +1659,7 @@ function renderFleetDeactivatePlan(payload, fleetId) {
|
|
|
1641
1659
|
`;
|
|
1642
1660
|
}
|
|
1643
1661
|
function reportFleetState(payload, error, options) {
|
|
1644
|
-
|
|
1662
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1645
1663
|
{
|
|
1646
1664
|
...payload,
|
|
1647
1665
|
code: error.code,
|
|
@@ -1658,9 +1676,9 @@ Next: ${error.next}
|
|
|
1658
1676
|
process.exitCode = monitorsErrorExitCode(error);
|
|
1659
1677
|
}
|
|
1660
1678
|
function fleetBillingSuspendedError(fleetId, payload, options) {
|
|
1661
|
-
const reason = asString(_optionalChain([asRecord, 'call',
|
|
1679
|
+
const reason = asString(_optionalChain([asRecord, 'call', _50 => _50(payload.billing_suspension), 'optionalAccess', _51 => _51.reason]));
|
|
1662
1680
|
const suspended = `Fleet ${fleetId} is suspended for billing${reason ? ` (${reason})` : ""}: its monitors are stopped`;
|
|
1663
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1681
|
+
if (_optionalChain([options, 'optionalAccess', _52 => _52.deactivating])) {
|
|
1664
1682
|
const deactivateCommand = `deepline monitors fleets deactivate ${fleetShellArg(fleetId)} --yes --wait`;
|
|
1665
1683
|
return new MonitorFleetStateError({
|
|
1666
1684
|
code: "MONITOR_FLEET_BILLING_SUSPENDED",
|
|
@@ -1670,12 +1688,12 @@ function fleetBillingSuspendedError(fleetId, payload, options) {
|
|
|
1670
1688
|
}
|
|
1671
1689
|
return new MonitorFleetStateError({
|
|
1672
1690
|
code: "MONITOR_FLEET_BILLING_SUSPENDED",
|
|
1673
|
-
message: `${suspended}, and waiting will not restart them. Once the
|
|
1691
|
+
message: `${suspended}, and waiting will not restart them. Once the org can pay again, run: deepline monitors fleets reactivate ${fleetShellArg(fleetId)} --yes --wait`,
|
|
1674
1692
|
next: _nullishCoalesce(fleetServerNext(payload), () => ( "deepline billing balance"))
|
|
1675
1693
|
});
|
|
1676
1694
|
}
|
|
1677
1695
|
function fleetSourceTable(value) {
|
|
1678
|
-
const [schema, table, extra] = _nullishCoalesce(_optionalChain([value, 'optionalAccess',
|
|
1696
|
+
const [schema, table, extra] = _nullishCoalesce(_optionalChain([value, 'optionalAccess', _53 => _53.trim, 'call', _54 => _54(), 'access', _55 => _55.split, 'call', _56 => _56(".")]), () => ( []));
|
|
1679
1697
|
if (!schema || !table || extra || !/^[A-Za-z_][A-Za-z0-9_]*$/.test(schema) || !/^[A-Za-z_][A-Za-z0-9_]*$/.test(table)) {
|
|
1680
1698
|
throw new MonitorsUsageError(
|
|
1681
1699
|
"--source must be a Customer DB table in schema.table form."
|
|
@@ -1684,7 +1702,7 @@ function fleetSourceTable(value) {
|
|
|
1684
1702
|
return { schema, table };
|
|
1685
1703
|
}
|
|
1686
1704
|
function fleetColumnName(value, flag) {
|
|
1687
|
-
const name = _optionalChain([value, 'optionalAccess',
|
|
1705
|
+
const name = _optionalChain([value, 'optionalAccess', _57 => _57.trim, 'call', _58 => _58()]);
|
|
1688
1706
|
if (!name || !/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) {
|
|
1689
1707
|
throw new MonitorsUsageError(`${flag} must be a SQL column identifier.`);
|
|
1690
1708
|
}
|
|
@@ -1731,13 +1749,13 @@ async function handleMonitorFleetsInit(fleetId, options) {
|
|
|
1731
1749
|
}
|
|
1732
1750
|
const source = fleetSourceTable(options.source);
|
|
1733
1751
|
const key = fleetColumnName(options.key, "--key");
|
|
1734
|
-
const keyType = _nullishCoalesce(_optionalChain([options, 'access',
|
|
1752
|
+
const keyType = _nullishCoalesce(_optionalChain([options, 'access', _59 => _59.keyType, 'optionalAccess', _60 => _60.trim, 'call', _61 => _61()]), () => ( "text"));
|
|
1735
1753
|
if (!["text", "uuid", "int4", "int8"].includes(keyType)) {
|
|
1736
1754
|
throw new MonitorsUsageError(
|
|
1737
1755
|
"--key-type must be text, uuid, int4, or int8."
|
|
1738
1756
|
);
|
|
1739
1757
|
}
|
|
1740
|
-
const tool = _optionalChain([options, 'access',
|
|
1758
|
+
const tool = _optionalChain([options, 'access', _62 => _62.tool, 'optionalAccess', _63 => _63.trim, 'call', _64 => _64()]);
|
|
1741
1759
|
if (!tool) throw new MonitorsUsageError("--tool is required.");
|
|
1742
1760
|
if (!options.payload) {
|
|
1743
1761
|
throw new MonitorsUsageError(
|
|
@@ -1746,7 +1764,7 @@ async function handleMonitorFleetsInit(fleetId, options) {
|
|
|
1746
1764
|
}
|
|
1747
1765
|
const payload = parseJsonObjectArg(options.payload, "--payload");
|
|
1748
1766
|
const where = options.where ? parseJsonObjectArg(options.where, "--where") : void 0;
|
|
1749
|
-
const out = _optionalChain([options, 'access',
|
|
1767
|
+
const out = _optionalChain([options, 'access', _65 => _65.out, 'optionalAccess', _66 => _66.trim, 'call', _67 => _67()]);
|
|
1750
1768
|
if (!out) throw new MonitorsUsageError("--out is required.");
|
|
1751
1769
|
const authoredDefinition = {
|
|
1752
1770
|
version: 2,
|
|
@@ -1775,7 +1793,7 @@ async function handleMonitorFleetsInit(fleetId, options) {
|
|
|
1775
1793
|
_fs.writeFileSync.call(void 0, file, `${JSON.stringify(definition, null, 2)}
|
|
1776
1794
|
`, "utf8");
|
|
1777
1795
|
const next = `deepline monitors fleets deploy --file ${fleetShellArg(file)} --dry-run`;
|
|
1778
|
-
|
|
1796
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
1779
1797
|
{ schemaVersion: 2, file, definition, next },
|
|
1780
1798
|
{
|
|
1781
1799
|
json: options.json,
|
|
@@ -1819,8 +1837,8 @@ function fleetSyncCommandLine(target, options) {
|
|
|
1819
1837
|
}
|
|
1820
1838
|
async function handleMonitorFleetsSync(target, options, idempotencyKey) {
|
|
1821
1839
|
const fileDefinitions = options.file ? readMonitorDefinitionsJsonFile(options.file) : void 0;
|
|
1822
|
-
const usesDefinition = options.file !== void 0 || _optionalChain([target, 'optionalAccess',
|
|
1823
|
-
if (!usesDefinition && !_optionalChain([target, 'optionalAccess',
|
|
1840
|
+
const usesDefinition = options.file !== void 0 || _optionalChain([target, 'optionalAccess', _68 => _68.trim, 'call', _69 => _69(), 'access', _70 => _70.startsWith, 'call', _71 => _71("{")]) === true;
|
|
1841
|
+
if (!usesDefinition && !_optionalChain([target, 'optionalAccess', _72 => _72.trim, 'call', _73 => _73()])) {
|
|
1824
1842
|
throw new MonitorsUsageError(
|
|
1825
1843
|
"sync needs a fleet: pass --file fleet.json to apply a definition, or <fleet-id> to re-plan the stored one.\n deepline monitors fleets sync --file fleet.json --dry-run\n deepline monitors fleets sync <fleet-id> --dry-run"
|
|
1826
1844
|
);
|
|
@@ -1841,7 +1859,7 @@ async function handleMonitorFleetsSync(target, options, idempotencyKey) {
|
|
|
1841
1859
|
'The Fleet definition has no id. Add a top-level "id" and re-run.'
|
|
1842
1860
|
);
|
|
1843
1861
|
}
|
|
1844
|
-
const client = new (0,
|
|
1862
|
+
const client = new (0, _chunkJLGP5XAJjs.DeeplineClient)();
|
|
1845
1863
|
const payload = await client.monitors.fleets.sync(
|
|
1846
1864
|
_nullishCoalesce(definition, () => ( fleetId)),
|
|
1847
1865
|
{
|
|
@@ -1879,7 +1897,7 @@ async function handleMonitorFleetsSync(target, options, idempotencyKey) {
|
|
|
1879
1897
|
}
|
|
1880
1898
|
const accepted = { ...payload, idempotency_key: idempotencyKey };
|
|
1881
1899
|
if (!options.wait || options.dryRun) {
|
|
1882
|
-
|
|
1900
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, accepted, {
|
|
1883
1901
|
json: options.json,
|
|
1884
1902
|
text: renderFleetSync(payload, {
|
|
1885
1903
|
fleetId,
|
|
@@ -1905,7 +1923,7 @@ async function handleMonitorFleetsSync(target, options, idempotencyKey) {
|
|
|
1905
1923
|
const status = fleetStatus(final);
|
|
1906
1924
|
const summary = renderFleetGet(final);
|
|
1907
1925
|
if (status === "converged") {
|
|
1908
|
-
|
|
1926
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, envelope, { json: options.json, text: summary });
|
|
1909
1927
|
return;
|
|
1910
1928
|
}
|
|
1911
1929
|
if (status === "billing_suspended") {
|
|
@@ -1932,7 +1950,7 @@ async function handleMonitorFleetsSync(target, options, idempotencyKey) {
|
|
|
1932
1950
|
envelope,
|
|
1933
1951
|
new MonitorFleetStateError({
|
|
1934
1952
|
code: "MONITOR_FLEET_WAIT_TIMEOUT",
|
|
1935
|
-
message: `Stopped waiting after ${timeoutMs}ms. Nothing is broken and nothing was lost \u2014 fleet ${fleetId} is still ${_nullishCoalesce(status, () => ( "working"))} on the server.`,
|
|
1953
|
+
message: `Stopped waiting after ${timeoutMs}ms. Nothing is broken and nothing was lost \u2014 fleet ${fleetId} is still ${_nullishCoalesce(status, () => ( "working"))} on the server. Provider creates can take hours; members marked as still being created are waiting, not failing. Do not deactivate or redeploy to speed it up: neither cancels an accepted create.`,
|
|
1936
1954
|
next: _nullishCoalesce(fleetServerNext(final), () => ( driftCommand))
|
|
1937
1955
|
}),
|
|
1938
1956
|
{ json: options.json, text: summary }
|
|
@@ -1967,14 +1985,14 @@ async function handleMonitorFleetsGet(fleetId, options) {
|
|
|
1967
1985
|
`
|
|
1968
1986
|
);
|
|
1969
1987
|
}
|
|
1970
|
-
const client = new (0,
|
|
1988
|
+
const client = new (0, _chunkJLGP5XAJjs.DeeplineClient)();
|
|
1971
1989
|
const payload = await client.monitors.fleets.get(fleetId, {
|
|
1972
1990
|
...options.drift ? { drift: true } : {},
|
|
1973
1991
|
...limit !== void 0 ? { limit } : {}
|
|
1974
1992
|
});
|
|
1975
1993
|
const text = fleetId ? renderFleetGet(payload) : renderFleetList(payload);
|
|
1976
1994
|
if (!options.check) {
|
|
1977
|
-
|
|
1995
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload, { json: options.json, text });
|
|
1978
1996
|
return;
|
|
1979
1997
|
}
|
|
1980
1998
|
const statuses = fleetId ? [fleetStatus(payload)] : (Array.isArray(payload.fleets) ? payload.fleets : []).map(
|
|
@@ -1982,7 +2000,7 @@ async function handleMonitorFleetsGet(fleetId, options) {
|
|
|
1982
2000
|
);
|
|
1983
2001
|
const unconverged = statuses.filter((status) => status !== "converged");
|
|
1984
2002
|
if (unconverged.length === 0) {
|
|
1985
|
-
|
|
2003
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload, { json: options.json, text });
|
|
1986
2004
|
return;
|
|
1987
2005
|
}
|
|
1988
2006
|
const target = _nullishCoalesce(fleetId, () => ( "<fleet-id>"));
|
|
@@ -2033,7 +2051,7 @@ function fleetChoice(value, allowed, flag) {
|
|
|
2033
2051
|
);
|
|
2034
2052
|
}
|
|
2035
2053
|
function fleetIssueTotal(fleet) {
|
|
2036
|
-
return _nullishCoalesce(asFiniteNumber(_optionalChain([asRecord, 'call',
|
|
2054
|
+
return _nullishCoalesce(asFiniteNumber(_optionalChain([asRecord, 'call', _74 => _74(fleet.issues), 'optionalAccess', _75 => _75.total])), () => ( 0));
|
|
2037
2055
|
}
|
|
2038
2056
|
function fleetFindingsText(fleet, windowLabel) {
|
|
2039
2057
|
return ledgerFindingsText(asRecord(fleet.findings), windowLabel);
|
|
@@ -2045,7 +2063,7 @@ function renderFleetOverviewList(payload) {
|
|
|
2045
2063
|
return fleet ? [fleet] : [];
|
|
2046
2064
|
}
|
|
2047
2065
|
);
|
|
2048
|
-
const window = _nullishCoalesce(asString(_optionalChain([asRecord, 'call',
|
|
2066
|
+
const window = _nullishCoalesce(asString(_optionalChain([asRecord, 'call', _76 => _76(payload.applied), 'optionalAccess', _77 => _77.window])), () => ( "30d"));
|
|
2049
2067
|
const windowLabel = _nullishCoalesce(LEDGER_WINDOW_LABELS[window], () => ( window));
|
|
2050
2068
|
if (fleets.length === 0) {
|
|
2051
2069
|
return "No fleets matched.\nNext: deepline monitors fleets overview --state deactivated\n";
|
|
@@ -2077,7 +2095,7 @@ function renderFleetOverviewList(payload) {
|
|
|
2077
2095
|
`;
|
|
2078
2096
|
}
|
|
2079
2097
|
function fleetIssueCauses(group) {
|
|
2080
|
-
const causes = _nullishCoalesce(asRecord(_optionalChain([group, 'optionalAccess',
|
|
2098
|
+
const causes = _nullishCoalesce(asRecord(_optionalChain([group, 'optionalAccess', _78 => _78.causes])), () => ( {}));
|
|
2081
2099
|
return Object.entries(causes).flatMap(([cause, raw]) => {
|
|
2082
2100
|
const count = _nullishCoalesce(asFiniteNumber(raw), () => ( 0));
|
|
2083
2101
|
return count > 0 ? [[cause, count]] : [];
|
|
@@ -2103,14 +2121,14 @@ function renderFleetOverviewDetail(payload, window) {
|
|
|
2103
2121
|
lines.push("", `Issues (${total}):`);
|
|
2104
2122
|
for (const group of ["failed", "blocked"]) {
|
|
2105
2123
|
const record = asRecord(issues[group]);
|
|
2106
|
-
const count = _nullishCoalesce(asFiniteNumber(_optionalChain([record, 'optionalAccess',
|
|
2124
|
+
const count = _nullishCoalesce(asFiniteNumber(_optionalChain([record, 'optionalAccess', _79 => _79.total])), () => ( 0));
|
|
2107
2125
|
if (count === 0) continue;
|
|
2108
2126
|
lines.push(` ${group} ${count}`);
|
|
2109
2127
|
for (const [cause, causeCount] of fleetIssueCauses(record)) {
|
|
2110
2128
|
lines.push(` ${cause} ${causeCount}`);
|
|
2111
2129
|
}
|
|
2112
2130
|
}
|
|
2113
|
-
const waiting = _nullishCoalesce(asFiniteNumber(_optionalChain([asRecord, 'call',
|
|
2131
|
+
const waiting = _nullishCoalesce(asFiniteNumber(_optionalChain([asRecord, 'call', _80 => _80(issues.waiting), 'optionalAccess', _81 => _81.total])), () => ( 0));
|
|
2114
2132
|
if (waiting > 0) {
|
|
2115
2133
|
lines.push(` waiting ${waiting} (rate limited; retries on its own)`);
|
|
2116
2134
|
}
|
|
@@ -2147,11 +2165,11 @@ function renderFleetIssuePage(payload) {
|
|
|
2147
2165
|
}
|
|
2148
2166
|
async function handleMonitorFleetsOverviewRead(fleetId, options) {
|
|
2149
2167
|
const window = fleetChoice(options.window, LEDGER_WINDOWS, "--window");
|
|
2150
|
-
const client = new (0,
|
|
2168
|
+
const client = new (0, _chunkJLGP5XAJjs.DeeplineClient)();
|
|
2151
2169
|
if (fleetId) {
|
|
2152
2170
|
const listOnly = [
|
|
2153
2171
|
options.q !== void 0 ? "--q" : "",
|
|
2154
|
-
_optionalChain([options, 'access',
|
|
2172
|
+
_optionalChain([options, 'access', _82 => _82.state, 'optionalAccess', _83 => _83.length]) ? "--state" : "",
|
|
2155
2173
|
options.sort !== void 0 ? "--sort" : ""
|
|
2156
2174
|
].filter(Boolean);
|
|
2157
2175
|
if (listOnly.length > 0) {
|
|
@@ -2162,7 +2180,7 @@ async function handleMonitorFleetsOverviewRead(fleetId, options) {
|
|
|
2162
2180
|
const payload2 = await client.monitors.fleets.overview(fleetId, {
|
|
2163
2181
|
...window ? { window } : {}
|
|
2164
2182
|
});
|
|
2165
|
-
|
|
2183
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload2, {
|
|
2166
2184
|
json: options.json,
|
|
2167
2185
|
text: renderFleetOverviewDetail(payload2, window)
|
|
2168
2186
|
});
|
|
@@ -2174,11 +2192,11 @@ async function handleMonitorFleetsOverviewRead(fleetId, options) {
|
|
|
2174
2192
|
const sort = fleetChoice(options.sort, FLEET_OVERVIEW_SORTS, "--sort");
|
|
2175
2193
|
const payload = await client.monitors.fleets.overview(void 0, {
|
|
2176
2194
|
...options.q ? { q: options.q } : {},
|
|
2177
|
-
..._optionalChain([options, 'access',
|
|
2195
|
+
..._optionalChain([options, 'access', _84 => _84.state, 'optionalAccess', _85 => _85.length]) ? { states: options.state } : {},
|
|
2178
2196
|
...sort ? { sort } : {},
|
|
2179
2197
|
...window ? { window } : {}
|
|
2180
2198
|
});
|
|
2181
|
-
|
|
2199
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload, {
|
|
2182
2200
|
json: options.json,
|
|
2183
2201
|
text: renderFleetOverviewList(payload)
|
|
2184
2202
|
});
|
|
@@ -2189,13 +2207,13 @@ async function handleMonitorFleetsIssues(fleetId, options) {
|
|
|
2189
2207
|
if (limit !== void 0 && (limit < 1 || limit > 100)) {
|
|
2190
2208
|
throw new MonitorsUsageError("--limit must be an integer from 1 to 100.");
|
|
2191
2209
|
}
|
|
2192
|
-
const payload = await new (0,
|
|
2210
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors.fleets.issues(fleetId, {
|
|
2193
2211
|
...group ? { group } : {},
|
|
2194
2212
|
...options.cause ? { cause: options.cause } : {},
|
|
2195
2213
|
...options.cursor ? { cursor: options.cursor } : {},
|
|
2196
2214
|
...limit !== void 0 ? { limit } : {}
|
|
2197
2215
|
});
|
|
2198
|
-
|
|
2216
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload, {
|
|
2199
2217
|
json: options.json,
|
|
2200
2218
|
text: renderFleetIssuePage(payload)
|
|
2201
2219
|
});
|
|
@@ -2224,13 +2242,13 @@ async function handleMonitorFleetsReactivate(fleetId, options, idempotencyKey) {
|
|
|
2224
2242
|
${fleetReactivateCommandLine(fleetId, options)}`
|
|
2225
2243
|
);
|
|
2226
2244
|
}
|
|
2227
|
-
const client = new (0,
|
|
2245
|
+
const client = new (0, _chunkJLGP5XAJjs.DeeplineClient)();
|
|
2228
2246
|
const payload = await client.monitors.fleets.reactivate(fleetId, {
|
|
2229
2247
|
idempotencyKey
|
|
2230
2248
|
});
|
|
2231
2249
|
const accepted = { ...payload, idempotency_key: idempotencyKey };
|
|
2232
2250
|
if (!options.wait) {
|
|
2233
|
-
|
|
2251
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, accepted, {
|
|
2234
2252
|
json: options.json,
|
|
2235
2253
|
text: `Fleet ${fleetId} \u2014 ${readMonitorState(payload) ? `state ${readMonitorState(payload)}` : "reactivation accepted"}
|
|
2236
2254
|
idempotency key ${idempotencyKey}
|
|
@@ -2253,7 +2271,7 @@ async function handleMonitorFleetsReactivate(fleetId, options, idempotencyKey) {
|
|
|
2253
2271
|
const envelope = { ...accepted, ...final };
|
|
2254
2272
|
const text = renderFleetGet(final);
|
|
2255
2273
|
if (fleetStatus(final) === "converged") {
|
|
2256
|
-
|
|
2274
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, envelope, { json: options.json, text });
|
|
2257
2275
|
return;
|
|
2258
2276
|
}
|
|
2259
2277
|
if (fleetStatus(final) === "billing_suspended") {
|
|
@@ -2302,7 +2320,7 @@ async function confirmFleetDeactivate(fleetId, plan) {
|
|
|
2302
2320
|
}
|
|
2303
2321
|
}
|
|
2304
2322
|
async function handleMonitorFleetsDeactivate(fleetId, options, idempotencyKey) {
|
|
2305
|
-
const client = new (0,
|
|
2323
|
+
const client = new (0, _chunkJLGP5XAJjs.DeeplineClient)();
|
|
2306
2324
|
if (options.dryRun) {
|
|
2307
2325
|
const plan = await client.monitors.fleets.deactivate(fleetId, {
|
|
2308
2326
|
dryRun: true,
|
|
@@ -2312,7 +2330,7 @@ async function handleMonitorFleetsDeactivate(fleetId, options, idempotencyKey) {
|
|
|
2312
2330
|
command: "deepline monitors fleets deactivate",
|
|
2313
2331
|
mutation: "fleet deactivate"
|
|
2314
2332
|
});
|
|
2315
|
-
|
|
2333
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, plan, {
|
|
2316
2334
|
json: options.json,
|
|
2317
2335
|
text: renderFleetDeactivatePlan(plan, fleetId)
|
|
2318
2336
|
});
|
|
@@ -2350,7 +2368,7 @@ Preview the blast radius first:
|
|
|
2350
2368
|
});
|
|
2351
2369
|
const accepted = { ...payload, idempotency_key: idempotencyKey };
|
|
2352
2370
|
if (payload.already === true) {
|
|
2353
|
-
|
|
2371
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, accepted, {
|
|
2354
2372
|
json: options.json,
|
|
2355
2373
|
text: `Fleet ${fleetId} is already deactivated.
|
|
2356
2374
|
`
|
|
@@ -2362,7 +2380,7 @@ Preview the blast radius first:
|
|
|
2362
2380
|
` + (fleetServerNext(payload) ? `Next: ${fleetServerNext(payload)}
|
|
2363
2381
|
` : "");
|
|
2364
2382
|
if (!options.wait) {
|
|
2365
|
-
|
|
2383
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, accepted, {
|
|
2366
2384
|
json: options.json,
|
|
2367
2385
|
text: acceptedText
|
|
2368
2386
|
});
|
|
@@ -2384,7 +2402,7 @@ Preview the blast radius first:
|
|
|
2384
2402
|
const envelope = { ...accepted, ...final };
|
|
2385
2403
|
const summary = renderFleetGet(final);
|
|
2386
2404
|
if (fleetStatus(final) === "deactivated") {
|
|
2387
|
-
|
|
2405
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, envelope, { json: options.json, text: summary });
|
|
2388
2406
|
return;
|
|
2389
2407
|
}
|
|
2390
2408
|
if (fleetStatus(final) === "billing_suspended") {
|
|
@@ -2423,7 +2441,7 @@ function handleMonitorFleetsOverview(options) {
|
|
|
2423
2441
|
"Agent notes:",
|
|
2424
2442
|
...MONITOR_FLEET_AGENT_NOTES.map((note) => ` ${note}`)
|
|
2425
2443
|
];
|
|
2426
|
-
|
|
2444
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
2427
2445
|
{
|
|
2428
2446
|
schemaVersion: 1,
|
|
2429
2447
|
lifecycle: MONITOR_FLEET_LIFECYCLE,
|
|
@@ -2435,6 +2453,19 @@ function handleMonitorFleetsOverview(options) {
|
|
|
2435
2453
|
` }
|
|
2436
2454
|
);
|
|
2437
2455
|
}
|
|
2456
|
+
function providerWaitMessage(payload) {
|
|
2457
|
+
const wait = asRecord(payload.provider_wait);
|
|
2458
|
+
return wait ? asString(wait.message) : void 0;
|
|
2459
|
+
}
|
|
2460
|
+
function credentialAccountLine(lane) {
|
|
2461
|
+
if (lane === "deepline_managed") {
|
|
2462
|
+
return "Deepline's provider account (runs bill Deepline credits)";
|
|
2463
|
+
}
|
|
2464
|
+
if (lane === "customer_key") {
|
|
2465
|
+
return "this workspace's own provider key (the provider bills you)";
|
|
2466
|
+
}
|
|
2467
|
+
return void 0;
|
|
2468
|
+
}
|
|
2438
2469
|
function renderMonitorGet(payload) {
|
|
2439
2470
|
const key = asString(payload.key);
|
|
2440
2471
|
const tool = asString(payload.tool);
|
|
@@ -2461,7 +2492,9 @@ function renderMonitorGet(payload) {
|
|
|
2461
2492
|
...monitorType ? [`Type: ${monitorType}`] : [],
|
|
2462
2493
|
...state ? [`Status: ${state}`] : [],
|
|
2463
2494
|
...state === "errored" && monitorFailureMessage(payload) ? [`Error: ${monitorFailureMessage(payload)}`] : [],
|
|
2495
|
+
...providerWaitMessage(payload) ? [`Waiting: ${providerWaitMessage(payload)}`] : [],
|
|
2464
2496
|
...hasLastReceivedEvent ? [`Latest inbound event: ${_nullishCoalesce(lastReceivedEvent, () => ( "never"))}`] : [],
|
|
2497
|
+
...credentialAccountLine(payload.credential_lane) ? [`Account: ${credentialAccountLine(payload.credential_lane)}`] : [],
|
|
2465
2498
|
...pricingLine ? [`Pricing: ${pricingLine}`] : [],
|
|
2466
2499
|
...nextRenewalAt ? [`Next renewal: ${nextRenewalAt}`] : []
|
|
2467
2500
|
];
|
|
@@ -2481,8 +2514,8 @@ function renderMonitorGet(payload) {
|
|
|
2481
2514
|
}
|
|
2482
2515
|
for (const raw of Array.isArray(guidance.documentation) ? guidance.documentation : []) {
|
|
2483
2516
|
const doc = asRecord(raw);
|
|
2484
|
-
const label = asString(_optionalChain([doc, 'optionalAccess',
|
|
2485
|
-
const url = asString(_optionalChain([doc, 'optionalAccess',
|
|
2517
|
+
const label = asString(_optionalChain([doc, 'optionalAccess', _86 => _86.label]));
|
|
2518
|
+
const url = asString(_optionalChain([doc, 'optionalAccess', _87 => _87.url]));
|
|
2486
2519
|
if (label && url) lines.push(` Docs: ${label} \u2014 ${url}`);
|
|
2487
2520
|
}
|
|
2488
2521
|
const payloadExample = asRecord(guidance.payload_example);
|
|
@@ -2499,20 +2532,20 @@ function renderMonitorGet(payload) {
|
|
|
2499
2532
|
);
|
|
2500
2533
|
}
|
|
2501
2534
|
const monitorSpec = asRecord(payload.monitor_spec);
|
|
2502
|
-
if (_optionalChain([monitorSpec, 'optionalAccess',
|
|
2535
|
+
if (_optionalChain([monitorSpec, 'optionalAccess', _88 => _88.available]) === false) {
|
|
2503
2536
|
lines.push(
|
|
2504
2537
|
"",
|
|
2505
2538
|
`Monitor spec: unavailable \u2014 ${_nullishCoalesce(asString(monitorSpec.message), () => ( "use the stored definition and check before an update."))}`
|
|
2506
2539
|
);
|
|
2507
2540
|
}
|
|
2508
|
-
const specFields = Array.isArray(_optionalChain([monitorSpec, 'optionalAccess',
|
|
2541
|
+
const specFields = Array.isArray(_optionalChain([monitorSpec, 'optionalAccess', _89 => _89.fields])) ? monitorSpec.fields.flatMap((value) => {
|
|
2509
2542
|
const field = asRecord(value);
|
|
2510
|
-
const path = asString(_optionalChain([field, 'optionalAccess',
|
|
2511
|
-
const description = asString(_optionalChain([field, 'optionalAccess',
|
|
2512
|
-
const semantics = asString(_optionalChain([field, 'optionalAccess',
|
|
2513
|
-
const applicability = asString(_optionalChain([field, 'optionalAccess',
|
|
2514
|
-
const grammar = asRecord(_optionalChain([field, 'optionalAccess',
|
|
2515
|
-
const grammarSyntax = asString(_optionalChain([grammar, 'optionalAccess',
|
|
2543
|
+
const path = asString(_optionalChain([field, 'optionalAccess', _90 => _90.path]));
|
|
2544
|
+
const description = asString(_optionalChain([field, 'optionalAccess', _91 => _91.description]));
|
|
2545
|
+
const semantics = asString(_optionalChain([field, 'optionalAccess', _92 => _92.semantics]));
|
|
2546
|
+
const applicability = asString(_optionalChain([field, 'optionalAccess', _93 => _93.applicability]));
|
|
2547
|
+
const grammar = asRecord(_optionalChain([field, 'optionalAccess', _94 => _94.grammar]));
|
|
2548
|
+
const grammarSyntax = asString(_optionalChain([grammar, 'optionalAccess', _95 => _95.syntax]));
|
|
2516
2549
|
return path ? [
|
|
2517
2550
|
{
|
|
2518
2551
|
path,
|
|
@@ -2548,10 +2581,10 @@ function renderMonitorGet(payload) {
|
|
|
2548
2581
|
const name = _nullishCoalesce(asString(play.name), () => ( "unnamed Play"));
|
|
2549
2582
|
const listener = asString(play.listener_key);
|
|
2550
2583
|
const health = asRecord(play.consumer_health);
|
|
2551
|
-
const runStatus = asString(_optionalChain([health, 'optionalAccess',
|
|
2552
|
-
const lastDelivery = asFiniteNumber(_optionalChain([health, 'optionalAccess',
|
|
2553
|
-
const runId = asString(_optionalChain([health, 'optionalAccess',
|
|
2554
|
-
const error = asString(_optionalChain([health, 'optionalAccess',
|
|
2584
|
+
const runStatus = asString(_optionalChain([health, 'optionalAccess', _96 => _96.last_run_status]));
|
|
2585
|
+
const lastDelivery = asFiniteNumber(_optionalChain([health, 'optionalAccess', _97 => _97.last_delivery_at]));
|
|
2586
|
+
const runId = asString(_optionalChain([health, 'optionalAccess', _98 => _98.last_run_id]));
|
|
2587
|
+
const error = asString(_optionalChain([health, 'optionalAccess', _99 => _99.last_error]));
|
|
2555
2588
|
lines.push(` ${name}${listener ? ` (listener: ${listener})` : ""}:`);
|
|
2556
2589
|
lines.push(
|
|
2557
2590
|
` Latest delivered event: ${lastDelivery !== void 0 ? new Date(lastDelivery).toISOString() : "never"}`,
|
|
@@ -2578,14 +2611,14 @@ function renderMonitorGet(payload) {
|
|
|
2578
2611
|
);
|
|
2579
2612
|
}
|
|
2580
2613
|
}
|
|
2581
|
-
if (_optionalChain([dependents, 'optionalAccess',
|
|
2614
|
+
if (_optionalChain([dependents, 'optionalAccess', _100 => _100.truncated]) === true) {
|
|
2582
2615
|
lines.push(" Results are truncated.");
|
|
2583
2616
|
}
|
|
2584
2617
|
return `${lines.join("\n")}
|
|
2585
2618
|
`;
|
|
2586
2619
|
}
|
|
2587
2620
|
async function handleMonitorsGet(key, options) {
|
|
2588
|
-
const client = new (0,
|
|
2621
|
+
const client = new (0, _chunkJLGP5XAJjs.DeeplineClient)();
|
|
2589
2622
|
const payload = await client.monitors.get(key);
|
|
2590
2623
|
const boundPlays = Array.isArray(payload.bound_plays) ? payload.bound_plays : null;
|
|
2591
2624
|
const dependents = boundPlays ? {
|
|
@@ -2593,24 +2626,24 @@ async function handleMonitorsGet(key, options) {
|
|
|
2593
2626
|
truncated: payload.consumer_health_truncated === true
|
|
2594
2627
|
} : await client.monitors.dependents(key);
|
|
2595
2628
|
const detail = { ...payload, dependents };
|
|
2596
|
-
|
|
2629
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, detail, {
|
|
2597
2630
|
json: options.json,
|
|
2598
2631
|
text: renderMonitorGet(detail)
|
|
2599
2632
|
});
|
|
2600
2633
|
}
|
|
2601
2634
|
async function handleMonitorsTest(key, payload, options) {
|
|
2602
2635
|
const explicitPayload = parseJsonObjectArg(payload, "<payload>");
|
|
2603
|
-
const result = await new (0,
|
|
2636
|
+
const result = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors.test(key, explicitPayload);
|
|
2604
2637
|
const text = `Monitor diagnostic for ${key}: ${result.accepted === true ? "accepted" : "rejected"}
|
|
2605
2638
|
mode: validation_only (no rows written, credits spent, or Plays dispatched)
|
|
2606
2639
|
persisted rows: ${_nullishCoalesce(asFiniteNumber(result.persisted_rows), () => ( 0))}
|
|
2607
2640
|
dispatched bound Plays: ${_nullishCoalesce(asFiniteNumber(result.dispatched_bound_plays), () => ( 0))}
|
|
2608
2641
|
`;
|
|
2609
|
-
|
|
2642
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, result, { json: options.json, text });
|
|
2610
2643
|
}
|
|
2611
2644
|
async function handleMonitorsValidate(key, options) {
|
|
2612
|
-
const result = await new (0,
|
|
2613
|
-
|
|
2645
|
+
const result = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors.validate(key);
|
|
2646
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, result, { json: options.json });
|
|
2614
2647
|
if (result.valid === false) process.exitCode = 7;
|
|
2615
2648
|
}
|
|
2616
2649
|
async function confirmMonitorDelete(key) {
|
|
@@ -2620,7 +2653,7 @@ async function confirmMonitorDelete(key) {
|
|
|
2620
2653
|
});
|
|
2621
2654
|
try {
|
|
2622
2655
|
const answer = await rl.question(
|
|
2623
|
-
`Delete monitor "${key}"? This deprovisions the upstream provider resource. [y/N] `
|
|
2656
|
+
`Delete monitor "${key}"? This deprovisions the upstream provider resource, or retires a pasted webhook's Deepline callback. [y/N] `
|
|
2624
2657
|
);
|
|
2625
2658
|
return /^y(es)?$/i.test(answer.trim());
|
|
2626
2659
|
} finally {
|
|
@@ -2628,14 +2661,14 @@ async function confirmMonitorDelete(key) {
|
|
|
2628
2661
|
}
|
|
2629
2662
|
}
|
|
2630
2663
|
async function handleMonitorsDelete(key, options) {
|
|
2631
|
-
const client = new (0,
|
|
2664
|
+
const client = new (0, _chunkJLGP5XAJjs.DeeplineClient)();
|
|
2632
2665
|
if (options.dryRun) {
|
|
2633
2666
|
const payload2 = await client.monitors.delete(key, { dryRun: true });
|
|
2634
2667
|
assertMonitorDryRunAcknowledged(payload2, {
|
|
2635
2668
|
command: "deepline monitors delete",
|
|
2636
2669
|
mutation: "delete"
|
|
2637
2670
|
});
|
|
2638
|
-
|
|
2671
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload2, {
|
|
2639
2672
|
json: options.json,
|
|
2640
2673
|
text: renderMonitorDeletePlan(payload2, key)
|
|
2641
2674
|
});
|
|
@@ -2655,7 +2688,7 @@ async function handleMonitorsDelete(key, options) {
|
|
|
2655
2688
|
}
|
|
2656
2689
|
}
|
|
2657
2690
|
const payload = await client.monitors.delete(key);
|
|
2658
|
-
|
|
2691
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload, { json: options.json });
|
|
2659
2692
|
}
|
|
2660
2693
|
async function handleMonitorsUpdate(key, patch, options) {
|
|
2661
2694
|
const body = resolveMonitorJsonBody({
|
|
@@ -2664,29 +2697,29 @@ async function handleMonitorsUpdate(key, patch, options) {
|
|
|
2664
2697
|
argLabel: "<patch>",
|
|
2665
2698
|
command: `deepline monitors update ${key}`
|
|
2666
2699
|
});
|
|
2667
|
-
const payload = await new (0,
|
|
2668
|
-
|
|
2700
|
+
const payload = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors.update(key, body);
|
|
2701
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload, { json: options.json });
|
|
2669
2702
|
}
|
|
2670
2703
|
async function handleMonitorsReactivate(key, options) {
|
|
2671
|
-
const client = new (0,
|
|
2704
|
+
const client = new (0, _chunkJLGP5XAJjs.DeeplineClient)();
|
|
2672
2705
|
if (options.dryRun) {
|
|
2673
2706
|
const payload2 = await client.monitors.reactivate(key, { dryRun: true });
|
|
2674
2707
|
assertMonitorDryRunAcknowledged(payload2, {
|
|
2675
2708
|
command: "deepline monitors reactivate",
|
|
2676
2709
|
mutation: "reactivate"
|
|
2677
2710
|
});
|
|
2678
|
-
|
|
2711
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload2, {
|
|
2679
2712
|
json: options.json,
|
|
2680
2713
|
text: renderMonitorReactivatePlan(payload2, key)
|
|
2681
2714
|
});
|
|
2682
2715
|
return;
|
|
2683
2716
|
}
|
|
2684
2717
|
const payload = await client.monitors.reactivate(key);
|
|
2685
|
-
|
|
2718
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, payload, { json: options.json });
|
|
2686
2719
|
}
|
|
2687
2720
|
var MONITOR_VERB_POLL_INTERVAL_MS = 2e3;
|
|
2688
2721
|
function monitorHealthLine(health) {
|
|
2689
|
-
if (_optionalChain([health, 'access',
|
|
2722
|
+
if (_optionalChain([health, 'access', _101 => _101.refresh, 'optionalAccess', _102 => _102.state]) === "running") {
|
|
2690
2723
|
return `refreshing whole scope \xB7 scanned ${health.scanned} so far`;
|
|
2691
2724
|
}
|
|
2692
2725
|
const alignmentRequired = _nullishCoalesce(health.alignment_required, () => ( 0));
|
|
@@ -2731,7 +2764,7 @@ async function watchMonitorHealth(input) {
|
|
|
2731
2764
|
while (Date.now() < deadlineAt) {
|
|
2732
2765
|
const unresolved = last.observed.unknown + last.observed.unset;
|
|
2733
2766
|
const alignmentRequired = _nullishCoalesce(last.alignment_required, () => ( 0));
|
|
2734
|
-
if (_optionalChain([last, 'access',
|
|
2767
|
+
if (_optionalChain([last, 'access', _103 => _103.refresh, 'optionalAccess', _104 => _104.state]) !== "running" && !last.truncated && last.needs_repair === 0 && (unresolved === 0 || alignmentRequired === unresolved)) {
|
|
2735
2768
|
return last;
|
|
2736
2769
|
}
|
|
2737
2770
|
await new Promise(
|
|
@@ -2743,13 +2776,13 @@ async function watchMonitorHealth(input) {
|
|
|
2743
2776
|
return last;
|
|
2744
2777
|
}
|
|
2745
2778
|
function monitorHealthText(health) {
|
|
2746
|
-
const partial = _optionalChain([health, 'access',
|
|
2779
|
+
const partial = _optionalChain([health, 'access', _105 => _105.refresh, 'optionalAccess', _106 => _106.state]) === "running" ? " (refreshing \u2014 counts below are not final)" : health.truncated ? " (partial \u2014 scope larger than one read)" : "";
|
|
2747
2780
|
const unauditedMonitors = _nullishCoalesce(health.unaudited_monitors, () => ( []));
|
|
2748
2781
|
const lines = [
|
|
2749
2782
|
`scope: ${_nullishCoalesce(health.scope.fleet_id, () => ( "workspace"))}${partial}`,
|
|
2750
2783
|
monitorHealthLine(health)
|
|
2751
2784
|
];
|
|
2752
|
-
if ((_nullishCoalesce(_optionalChain([health, 'access',
|
|
2785
|
+
if ((_nullishCoalesce(_optionalChain([health, 'access', _107 => _107.batch_operations, 'optionalAccess', _108 => _108.length]), () => ( 0))) > 0) {
|
|
2753
2786
|
lines.push("");
|
|
2754
2787
|
lines.push("batch work in progress:");
|
|
2755
2788
|
for (const operation of _nullishCoalesce(health.batch_operations, () => ( []))) {
|
|
@@ -2815,8 +2848,8 @@ function monitorHealthText(health) {
|
|
|
2815
2848
|
`;
|
|
2816
2849
|
}
|
|
2817
2850
|
async function handleMonitorsAudit(options) {
|
|
2818
|
-
const client = new (0,
|
|
2819
|
-
const fleetId = _optionalChain([options, 'access',
|
|
2851
|
+
const client = new (0, _chunkJLGP5XAJjs.DeeplineClient)();
|
|
2852
|
+
const fleetId = _optionalChain([options, 'access', _109 => _109.fleet, 'optionalAccess', _110 => _110.trim, 'call', _111 => _111()]) || void 0;
|
|
2820
2853
|
const scope = fleetId ? { fleetId } : {};
|
|
2821
2854
|
let result = await client.monitors.audit(scope);
|
|
2822
2855
|
const passes = [result.audit];
|
|
@@ -2859,7 +2892,7 @@ async function handleMonitorsAudit(options) {
|
|
|
2859
2892
|
"",
|
|
2860
2893
|
monitorHealthText(health)
|
|
2861
2894
|
].join("\n");
|
|
2862
|
-
|
|
2895
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
2863
2896
|
{ ...result, audit: { ...result.audit, totals }, health },
|
|
2864
2897
|
{ json: options.json, text }
|
|
2865
2898
|
);
|
|
@@ -2867,15 +2900,15 @@ async function handleMonitorsAudit(options) {
|
|
|
2867
2900
|
async function handleMonitorsRepair(options) {
|
|
2868
2901
|
return await handleMonitorBatch("repair", {
|
|
2869
2902
|
...options,
|
|
2870
|
-
..._optionalChain([options, 'access',
|
|
2903
|
+
..._optionalChain([options, 'access', _112 => _112.fleet, 'optionalAccess', _113 => _113.trim, 'call', _114 => _114()]) ? {} : { target: "needs-repair" }
|
|
2871
2904
|
});
|
|
2872
2905
|
}
|
|
2873
2906
|
async function handleMonitorsHealth(options) {
|
|
2874
|
-
const fleetId = _optionalChain([options, 'access',
|
|
2875
|
-
const health = await new (0,
|
|
2907
|
+
const fleetId = _optionalChain([options, 'access', _115 => _115.fleet, 'optionalAccess', _116 => _116.trim, 'call', _117 => _117()]) || void 0;
|
|
2908
|
+
const health = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors.health(
|
|
2876
2909
|
fleetId ? { fleetId } : {}
|
|
2877
2910
|
);
|
|
2878
|
-
|
|
2911
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, health, {
|
|
2879
2912
|
json: options.json,
|
|
2880
2913
|
text: monitorHealthText(health)
|
|
2881
2914
|
});
|
|
@@ -2883,8 +2916,8 @@ async function handleMonitorsHealth(options) {
|
|
|
2883
2916
|
function monitorBatchScope(options, kind) {
|
|
2884
2917
|
const selectors = [
|
|
2885
2918
|
options.target ? "target" : null,
|
|
2886
|
-
_optionalChain([options, 'access',
|
|
2887
|
-
_optionalChain([options, 'access',
|
|
2919
|
+
_optionalChain([options, 'access', _118 => _118.fleet, 'optionalAccess', _119 => _119.trim, 'call', _120 => _120()]) ? "fleet" : null,
|
|
2920
|
+
_optionalChain([options, 'access', _121 => _121.keys, 'optionalAccess', _122 => _122.trim, 'call', _123 => _123()]) ? "keys" : null
|
|
2888
2921
|
].filter((value) => value !== null);
|
|
2889
2922
|
if (selectors.length === 0 && kind === "audit") {
|
|
2890
2923
|
return { kind: "target", target: "all" };
|
|
@@ -2895,7 +2928,7 @@ function monitorBatchScope(options, kind) {
|
|
|
2895
2928
|
);
|
|
2896
2929
|
}
|
|
2897
2930
|
if (options.target) return { kind: "target", target: options.target };
|
|
2898
|
-
if (_optionalChain([options, 'access',
|
|
2931
|
+
if (_optionalChain([options, 'access', _124 => _124.fleet, 'optionalAccess', _125 => _125.trim, 'call', _126 => _126()]))
|
|
2899
2932
|
return { kind: "fleet", fleetId: options.fleet.trim() };
|
|
2900
2933
|
const monitorKeys = (_nullishCoalesce(options.keys, () => ( ""))).split(",").map((key) => key.trim()).filter(Boolean);
|
|
2901
2934
|
if (monitorKeys.length === 0) {
|
|
@@ -2906,7 +2939,7 @@ function monitorBatchScope(options, kind) {
|
|
|
2906
2939
|
return { kind: "keys", monitorKeys };
|
|
2907
2940
|
}
|
|
2908
2941
|
function monitorBatchIdempotencyKey(kind, value) {
|
|
2909
|
-
return _optionalChain([value, 'optionalAccess',
|
|
2942
|
+
return _optionalChain([value, 'optionalAccess', _127 => _127.trim, 'call', _128 => _128()]) || `monitor-batch-${kind}-${_crypto.randomUUID.call(void 0, )}`;
|
|
2910
2943
|
}
|
|
2911
2944
|
function isCanonicalBatchJsonDocument(raw) {
|
|
2912
2945
|
try {
|
|
@@ -2919,7 +2952,7 @@ function isCanonicalBatchJsonDocument(raw) {
|
|
|
2919
2952
|
}
|
|
2920
2953
|
}
|
|
2921
2954
|
async function handleMonitorBatchDeploy(options) {
|
|
2922
|
-
if (!_optionalChain([options, 'access',
|
|
2955
|
+
if (!_optionalChain([options, 'access', _129 => _129.file, 'optionalAccess', _130 => _130.trim, 'call', _131 => _131()])) {
|
|
2923
2956
|
throw new MonitorsUsageError(
|
|
2924
2957
|
"monitors batch deploy requires --file <monitors.ndjson>."
|
|
2925
2958
|
);
|
|
@@ -2949,14 +2982,14 @@ async function handleMonitorBatchDeploy(options) {
|
|
|
2949
2982
|
"deploy",
|
|
2950
2983
|
options.idempotencyKey
|
|
2951
2984
|
);
|
|
2952
|
-
const result = await new (0,
|
|
2985
|
+
const result = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors.batch.submit({
|
|
2953
2986
|
kind: "deploy",
|
|
2954
2987
|
manifestNdjson,
|
|
2955
2988
|
dryRun: options.dryRun === true,
|
|
2956
2989
|
idempotencyKey
|
|
2957
2990
|
});
|
|
2958
2991
|
const operation = result.operation;
|
|
2959
|
-
|
|
2992
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
2960
2993
|
{ ...result, idempotency_key: idempotencyKey },
|
|
2961
2994
|
{
|
|
2962
2995
|
json: options.json,
|
|
@@ -2975,7 +3008,7 @@ async function handleMonitorBatch(kind, options) {
|
|
|
2975
3008
|
);
|
|
2976
3009
|
}
|
|
2977
3010
|
const scope = monitorBatchScope(options, kind);
|
|
2978
|
-
if (kind === "deactivate" && scope.kind === "target" && !_optionalChain([options, 'access',
|
|
3011
|
+
if (kind === "deactivate" && scope.kind === "target" && !_optionalChain([options, 'access', _132 => _132.reason, 'optionalAccess', _133 => _133.trim, 'call', _134 => _134()])) {
|
|
2979
3012
|
throw new MonitorsUsageError(
|
|
2980
3013
|
"monitors batch deactivate --target requires --reason (for example insufficient_balance or billing_failure). Omit --reason with --keys for a customer-requested teardown."
|
|
2981
3014
|
);
|
|
@@ -2984,11 +3017,11 @@ async function handleMonitorBatch(kind, options) {
|
|
|
2984
3017
|
kind,
|
|
2985
3018
|
options.idempotencyKey
|
|
2986
3019
|
);
|
|
2987
|
-
const result = await new (0,
|
|
3020
|
+
const result = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors.batch.submit({
|
|
2988
3021
|
kind,
|
|
2989
3022
|
scope,
|
|
2990
3023
|
dryRun: options.dryRun === true,
|
|
2991
|
-
..._optionalChain([options, 'access',
|
|
3024
|
+
..._optionalChain([options, 'access', _135 => _135.reason, 'optionalAccess', _136 => _136.trim, 'call', _137 => _137()]) ? { deactivationReason: options.reason.trim() } : {},
|
|
2992
3025
|
idempotencyKey
|
|
2993
3026
|
});
|
|
2994
3027
|
const operation = result.operation;
|
|
@@ -2997,14 +3030,14 @@ async function handleMonitorBatch(kind, options) {
|
|
|
2997
3030
|
`state ${operation.state} \xB7 retry key ${idempotencyKey}`,
|
|
2998
3031
|
`inspect: deepline monitors batch get ${operation.runId}`
|
|
2999
3032
|
].join("\n");
|
|
3000
|
-
|
|
3033
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0,
|
|
3001
3034
|
{ ...result, idempotency_key: idempotencyKey },
|
|
3002
3035
|
{ json: options.json, text: `${text}
|
|
3003
3036
|
` }
|
|
3004
3037
|
);
|
|
3005
3038
|
}
|
|
3006
3039
|
async function handleMonitorBatchGet(operationId, options) {
|
|
3007
|
-
const result = await new (0,
|
|
3040
|
+
const result = await new (0, _chunkJLGP5XAJjs.DeeplineClient)().monitors.batch.get(operationId, {
|
|
3008
3041
|
...options.cursor ? { cursor: options.cursor } : {}
|
|
3009
3042
|
});
|
|
3010
3043
|
const summary = _nullishCoalesce(result.operation.summary, () => ( {}));
|
|
@@ -3016,7 +3049,7 @@ async function handleMonitorBatchGet(operationId, options) {
|
|
|
3016
3049
|
`results ${result.results.page.length}${result.results.isDone ? "" : " (more; pass --cursor)"}`
|
|
3017
3050
|
] : []
|
|
3018
3051
|
].join("\n");
|
|
3019
|
-
|
|
3052
|
+
_chunkXLIHTJVMjs.printCommandEnvelope.call(void 0, result, { json: options.json, text: `${text}
|
|
3020
3053
|
` });
|
|
3021
3054
|
}
|
|
3022
3055
|
function registerMonitorsCommands(program) {
|
|
@@ -3529,7 +3562,7 @@ Examples:
|
|
|
3529
3562
|
"after",
|
|
3530
3563
|
`
|
|
3531
3564
|
Notes:
|
|
3532
|
-
Mutates
|
|
3565
|
+
Mutates org state and may spend Deepline credits. <definition> is a JSON
|
|
3533
3566
|
object with key, tool, optional name, and payload. Pass it positionally, via
|
|
3534
3567
|
--file <path>, or from stdin with --file -.
|
|
3535
3568
|
--dry-run validates the definition and shows the plan (deploy cost in Deepline
|
|
@@ -3580,7 +3613,7 @@ Examples:
|
|
|
3580
3613
|
"after",
|
|
3581
3614
|
`
|
|
3582
3615
|
Notes:
|
|
3583
|
-
Mutates
|
|
3616
|
+
Mutates org state. <patch> is a JSON object of fields to update. Pass it
|
|
3584
3617
|
positionally, via --file <path>, or from stdin with --file -.
|
|
3585
3618
|
|
|
3586
3619
|
When <patch> includes payload, its top-level fields are merged with the stored
|
|
@@ -3614,6 +3647,8 @@ resource a later audit found still active has not reached that state: delete clo
|
|
|
3614
3647
|
again and proves it inactive, and the monitor stays deleted.
|
|
3615
3648
|
A delete of a provisioning monitor returns delete_pending: true; the monitor
|
|
3616
3649
|
is deleted as soon as its create settles.
|
|
3650
|
+
A webhook you pasted into a provider (Vector, RB2B) is retired: Deepline refuses
|
|
3651
|
+
its deliveries at once, and provider_removal_step says what to remove there.
|
|
3617
3652
|
--dry-run shows the delete plan without deleting anything.
|
|
3618
3653
|
Interactive terminals get a y/N confirmation; non-interactive runs (agents,
|
|
3619
3654
|
scripts, pipes) must pass --yes.
|
|
@@ -3632,7 +3667,7 @@ Examples:
|
|
|
3632
3667
|
"after",
|
|
3633
3668
|
`
|
|
3634
3669
|
Notes:
|
|
3635
|
-
Mutates
|
|
3670
|
+
Mutates org state and may spend Deepline credits.
|
|
3636
3671
|
--dry-run shows the reactivation cost (in Deepline credits) without changing
|
|
3637
3672
|
anything.
|
|
3638
3673
|
Deepline Native radars create a replacement upstream radar from the saved
|