deepline 0.3.541 → 0.3.543
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 +106 -2
- package/dist/bundling-sources/sdk/src/index.ts +7 -0
- package/dist/bundling-sources/sdk/src/integrations.ts +198 -0
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +3 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/tool-calls.ts +35 -11
- package/dist/bundling-sources/sdk/src/types.ts +17 -1
- package/dist/bundling-sources/shared_libs/integration-contracts/calendar-delegation.ts +132 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/tool-connection.ts +13 -0
- package/dist/bundling-sources/shared_libs/monitors/package.json +1 -1
- package/dist/bundling-sources/shared_libs/observability/queue-health.ts +9 -0
- package/dist/bundling-sources/shared_libs/observability/queue-item-connectors.ts +1 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +5 -5
- package/dist/bundling-sources/shared_libs/play-data-plane/sheet-contract.ts +34 -0
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +11 -5
- package/dist/bundling-sources/shared_libs/play-runtime/baked-runner-image.ts +9 -7
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +235 -12
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +20 -1
- package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-janitor.ts +39 -30
- package/dist/bundling-sources/shared_libs/play-runtime/event-wait-tools.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/experiment-switches.ts +10 -4
- package/dist/bundling-sources/shared_libs/play-runtime/fleet-sandbox-sweep.ts +209 -0
- package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +24 -1
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/contracts.ts +2 -1
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +6 -1
- package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +37 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +42 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-tool-hooks.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-modal-fallback.ts +15 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +23 -5
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +320 -836
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/vercel-sandbox.ts +1061 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox.ts +862 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +45 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/sandbox-create-outcome.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +11 -5
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-contract.ts +20 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-placement-policy.ts +71 -34
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-provider-profile.ts +286 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +4 -1
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +12 -3
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +46 -55
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-required-env.ts +127 -5
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +7 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts +214 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/managed-sandbox-resource-sql.ts +118 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +226 -144
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +2 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +11 -13
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-operation.ts +42 -7
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +2 -1
- package/dist/bundling-sources/shared_libs/play-runtime/suspension.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +17 -0
- package/dist/bundling-sources/shared_libs/play-runtime/vercel-sandbox-runtime-config.ts +217 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +23 -0
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +1 -0
- package/dist/bundling-sources/shared_libs/plays/script-entry.ts +76 -6
- package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +1 -0
- package/dist/bundling-sources/shared_libs/security/credential-revision.ts +50 -0
- package/dist/bundling-sources/shared_libs/security/internal-actor.ts +2 -1
- package/dist/bundling-sources/shared_libs/security/receipt-admission-token.ts +37 -0
- package/dist/cli/{auth-WJXA7XGM.mjs → auth-ITAELTOA.mjs} +5 -5
- package/dist/cli/auth-S6B5WUU5.js +43 -0
- package/dist/cli/{billing-34IV5DSV.js → billing-33XVFDUJ.js} +101 -101
- package/dist/cli/{billing-SHS4HMWT.mjs → billing-WZ7RVZW4.mjs} +12 -12
- package/dist/cli/{chunk-UKO6POLZ.js → chunk-23D224GI.js} +37 -17
- package/dist/cli/{chunk-DF7ARQRB.mjs → chunk-274WKLSY.mjs} +2 -2
- package/dist/cli/{chunk-GBAT5NMI.mjs → chunk-2HSZCQMT.mjs} +48 -6
- package/dist/cli/{chunk-VLEVVDWG.js → chunk-2JHYYB3F.js} +3 -3
- package/dist/cli/{chunk-FVZ5Y5L6.js → chunk-2KTGZKRE.js} +18 -18
- package/dist/cli/{chunk-6TZEDCN7.js → chunk-2LNTKICO.js} +3 -3
- package/dist/cli/{chunk-FYQWTENQ.js → chunk-2NCJQEZH.js} +53 -53
- package/dist/cli/{chunk-CNBPATLI.js → chunk-3JZXU5OB.js} +5 -5
- package/dist/cli/{chunk-323I5KQ5.js → chunk-46BEBZ3M.js} +497 -328
- package/dist/cli/{chunk-V4EYJKGJ.js → chunk-4JQEAYN3.js} +156 -17
- package/dist/cli/{chunk-XO2SGONT.mjs → chunk-4SKDSSPU.mjs} +2 -2
- package/dist/cli/{chunk-53QZ24DP.mjs → chunk-52YK3EII.mjs} +2 -2
- package/dist/cli/{chunk-S7NKIEHL.js → chunk-5MN3BKNB.js} +16 -16
- package/dist/cli/{chunk-XTR32PMA.mjs → chunk-5VIPTLRX.mjs} +1 -1
- package/dist/cli/{chunk-OLH2PHMC.mjs → chunk-6P7TGCHQ.mjs} +1 -1
- package/dist/cli/{chunk-QI76LGE3.mjs → chunk-6SJZMMD5.mjs} +37 -190
- package/dist/cli/chunk-7AUQTNLB.mjs +455 -0
- package/dist/cli/{chunk-GLINYHY7.mjs → chunk-AACKPOGA.mjs} +1 -1
- package/dist/cli/{chunk-Q66ADD4O.js → chunk-BGAUADV4.js} +41 -41
- package/dist/cli/{chunk-KQSTV4MW.js → chunk-BLYW6FFB.js} +60 -18
- package/dist/cli/{chunk-F3TLGM2U.js → chunk-C35NLLSA.js} +5 -5
- package/dist/cli/{chunk-LRPFCB2P.mjs → chunk-D6YAU3CF.mjs} +182 -13
- package/dist/cli/{chunk-FRPJSFNL.mjs → chunk-DH43ECTN.mjs} +7 -3
- package/dist/cli/{chunk-IZXMX65M.js → chunk-DI3GL3T6.js} +316 -469
- package/dist/cli/{chunk-OK4JMVTM.js → chunk-DUGTPVT7.js} +7 -7
- package/dist/cli/{chunk-UNDLNT3V.js → chunk-ECWOIXAV.js} +1 -1
- package/dist/cli/{chunk-KIYETQ6K.js → chunk-EHUG6EUT.js} +26 -26
- package/dist/cli/chunk-F6VSQ5LN.js +455 -0
- package/dist/cli/{chunk-JZNKEHXQ.mjs → chunk-FNW2SGPD.mjs} +2 -2
- package/dist/cli/{chunk-M6XIKHBS.js → chunk-GRCFX2EG.js} +4 -4
- package/dist/cli/{chunk-OVX3Q5Q3.mjs → chunk-GWNYLIF7.mjs} +1 -1
- package/dist/cli/{chunk-FTKX7OGB.mjs → chunk-HKJ26NRN.mjs} +5 -5
- package/dist/cli/{chunk-L2VKAASU.mjs → chunk-HXIR3VQL.mjs} +21 -0
- package/dist/cli/{chunk-POZPEDW7.js → chunk-J2F6F5GL.js} +7 -7
- package/dist/cli/{chunk-7AUQSK24.mjs → chunk-JXG7HWBA.mjs} +1 -1
- package/dist/cli/{chunk-Z2XA6YU4.mjs → chunk-LX35AXTN.mjs} +1 -0
- package/dist/cli/{chunk-WIV3E6Y7.js → chunk-MCBUWK5K.js} +22 -22
- package/dist/cli/{chunk-2TAGAPLL.js → chunk-NHKP2NSU.js} +2 -2
- package/dist/cli/{chunk-FANIRW74.mjs → chunk-NIPLY25A.mjs} +0 -2
- package/dist/cli/{chunk-UXXFCOE3.js → chunk-NLENABRU.js} +6 -6
- package/dist/cli/{chunk-DHC7EGI7.mjs → chunk-NR3O56FT.mjs} +5 -5
- package/dist/cli/{chunk-MPYM6TUO.js → chunk-O2KLWUNI.js} +44 -44
- package/dist/cli/{chunk-BMNLD63A.mjs → chunk-OAFKUHN5.mjs} +4 -4
- package/dist/cli/{chunk-RYYGNUNO.mjs → chunk-OELJKQOL.mjs} +24 -4
- package/dist/cli/{chunk-ZD673XAL.js → chunk-PX7XAVUC.js} +24 -20
- package/dist/cli/{chunk-FOCNY4GV.js → chunk-QFRMVI4S.js} +3 -3
- package/dist/cli/{chunk-AU7ZKXW5.mjs → chunk-R57UCXQG.mjs} +1 -1
- package/dist/cli/{chunk-IPVRMYWT.js → chunk-RKF263LR.js} +5 -5
- package/dist/cli/{chunk-CQDQNZGH.js → chunk-SL6MYJYM.js} +1 -0
- package/dist/cli/{chunk-BUCTWJBM.js → chunk-STXG2LFC.js} +2 -2
- package/dist/cli/{chunk-ECPCZVDM.mjs → chunk-SU4K4SUU.mjs} +1 -1
- package/dist/cli/{chunk-ABDXKELH.mjs → chunk-SYOPHFKB.mjs} +6 -6
- package/dist/cli/{chunk-H74CLEMB.mjs → chunk-SZNJENGT.mjs} +3 -3
- package/dist/cli/{chunk-5N4ENMYE.js → chunk-TBCNL2T5.js} +1 -1
- package/dist/cli/{chunk-E4CABWXL.js → chunk-TI6DTURF.js} +22 -1
- package/dist/cli/{chunk-C2LYJ3EX.js → chunk-UJ6GOV7K.js} +13 -13
- package/dist/cli/{chunk-GWHA4DAC.js → chunk-UV4RU2TE.js} +0 -2
- package/dist/cli/{chunk-6PJAC3P5.mjs → chunk-VSJEOSYL.mjs} +1 -1
- package/dist/cli/{chunk-NB4AIXEA.mjs → chunk-W2OPPSAZ.mjs} +3 -3
- package/dist/cli/{chunk-5LNWLEO3.mjs → chunk-XBM3KABD.mjs} +3 -3
- package/dist/cli/{chunk-VMIIUMAN.mjs → chunk-XFPVFWZR.mjs} +1 -1
- package/dist/cli/{chunk-UC5QFQGC.mjs → chunk-XSN6BAZT.mjs} +5 -5
- package/dist/cli/{chunk-IDDKNMFX.mjs → chunk-Y3T5GWYK.mjs} +153 -14
- package/dist/cli/{chunk-S6FF7Q5P.js → chunk-YE3T73BV.js} +10 -10
- package/dist/cli/{chunk-CY5LW6DW.js → chunk-YJYKZ2U3.js} +2 -2
- package/dist/cli/{chunk-F6QV42MC.mjs → chunk-Z7SXGOIQ.mjs} +1 -1
- package/dist/cli/{chunk-ZL2DER5D.mjs → chunk-ZRT2PNYY.mjs} +1 -1
- package/dist/cli/{chunk-WZMG2M65.mjs → chunk-ZSPBJB7I.mjs} +4 -4
- package/dist/cli/command-docs.js +3 -3
- package/dist/cli/command-docs.mjs +2 -2
- package/dist/cli/concurrent-runs-help-E4OYD3DS.js +21 -0
- package/dist/cli/{concurrent-runs-help-ZJ77SAEU.mjs → concurrent-runs-help-Z6ODNL4E.mjs} +7 -7
- package/dist/cli/{csv-PX7F5YJN.mjs → csv-5QW2HPHT.mjs} +4 -4
- package/dist/cli/{csv-MJLIZZOR.js → csv-SSOFTXHU.js} +13 -13
- package/dist/cli/{db-BNCNAY4G.js → db-4LK5AJNO.js} +29 -29
- package/dist/cli/{db-KPKGTHPA.mjs → db-K2JMR6EM.mjs} +8 -8
- package/dist/cli/describe-AC6PLEFP.js +50 -0
- package/dist/cli/describe-AXHQZHTT.mjs +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 +3 -3
- package/dist/cli/describe-core.mjs +2 -2
- package/dist/cli/{executions-YNOFR7T2.js → executions-AATJQQAQ.js} +10 -10
- package/dist/cli/{executions-NMQY4GEY.mjs → executions-FY2XTX2W.mjs} +8 -8
- package/dist/cli/{feedback-LWYEO5LL.mjs → feedback-MKBPRGS6.mjs} +6 -6
- package/dist/cli/{feedback-RCP5DPO6.js → feedback-QPVJER75.js} +14 -14
- package/dist/cli/{git-3O4PFP3Q.mjs → git-AGRFZR3K.mjs} +5 -5
- package/dist/cli/git-RUYFQEJX.js +25 -0
- package/dist/cli/index.js +150 -146
- package/dist/cli/index.mjs +49 -45
- package/dist/cli/integrations-OUQ6U33M.mjs +98 -0
- package/dist/cli/integrations-R6OUFZXI.js +98 -0
- package/dist/cli/{legacy-noops-KFP674JT.mjs → legacy-noops-DVL2RRKL.mjs} +6 -6
- package/dist/cli/{legacy-noops-ZPZRG366.js → legacy-noops-H7INM2QN.js} +9 -9
- package/dist/cli/{mcp-OCYUXQ6L.mjs → mcp-2Z2YVOLK.mjs} +72 -15
- package/dist/cli/{mcp-HCXDW6PL.js → mcp-33F7D7WI.js} +89 -32
- package/dist/cli/{monitors-7Q7YT22Y.js → monitors-KDUJHAKJ.js} +102 -102
- package/dist/cli/{monitors-V5KJIJJE.mjs → monitors-NZD2WIKK.mjs} +9 -9
- package/dist/cli/{org-S37K6QYH.js → org-4PQGHLEB.js} +164 -88
- package/dist/cli/{org-C3QLHX7U.mjs → org-EJW45RUA.mjs} +84 -8
- package/dist/cli/{play-MXQ2DKML.mjs → play-3CM5RT5J.mjs} +44 -25
- package/dist/cli/{play-MLREAYHJ.js → play-MLHMQL4G.js} +374 -355
- package/dist/cli/{providers-FDJ4ZOST.mjs → providers-BHYBJI4R.mjs} +10 -9
- package/dist/cli/{providers-PPDWY7DH.js → providers-YBJG7277.js} +13 -12
- package/dist/cli/{quickstart-2Z57AMB7.mjs → quickstart-LL3MR562.mjs} +4 -4
- package/dist/cli/{quickstart-BOWQM7S7.js → quickstart-O7L2NNGJ.js} +6 -6
- package/dist/cli/{run-66HXNJNV.js → run-HJ2AR6CM.js} +49 -48
- package/dist/cli/{run-5RNJGPQ2.mjs → run-OK545H5Q.mjs} +28 -27
- package/dist/cli/search-UUNS6BCC.js +32 -0
- package/dist/cli/{search-7G4FYQYO.mjs → search-Z5ZKMRTX.mjs} +9 -9
- package/dist/cli/{search-output-6K4FHCVI.mjs → search-output-Q5VHNUWG.mjs} +4 -4
- package/dist/cli/{search-output-L6ICQDBL.js → search-output-SVW4DETG.js} +6 -6
- package/dist/cli/{secrets-PWFJKF7G.js → secrets-ENQWMCB5.js} +17 -17
- package/dist/cli/{secrets-FTQPCU7O.mjs → secrets-QIKIEFWB.mjs} +8 -8
- package/dist/cli/{sessions-YSSAAQVJ.mjs → sessions-AETO22RF.mjs} +6 -6
- package/dist/cli/sessions-FNSUDERA.js +22 -0
- package/dist/cli/{settings-KN7GNZ5J.mjs → settings-G5RGRPFV.mjs} +16 -16
- package/dist/cli/{settings-CZEMF2WD.js → settings-OFLIFTMZ.js} +89 -89
- package/dist/cli/{setup-5WLHGH57.mjs → setup-G4N3X6KG.mjs} +9 -9
- package/dist/cli/{setup-RW4X6DX4.js → setup-QW7Y62XD.js} +49 -49
- package/dist/cli/skills-3IXIY2IV.js +36 -0
- package/dist/cli/{skills-DLVI7IZK.mjs → skills-QRFQGHNA.mjs} +7 -7
- package/dist/cli/{tools-JVYQF7P3.mjs → tools-52BH7UTF.mjs} +20 -19
- package/dist/cli/tools-MYBUMPKH.js +57 -0
- package/dist/cli/update-GT7574UU.js +34 -0
- package/dist/cli/{update-XKLXU7YS.mjs → update-SDGZLAGL.mjs} +9 -9
- package/dist/cli/{views-QRRCWP6B.mjs → views-3BIJFJMQ.mjs} +8 -8
- package/dist/cli/{views-YNUYFS3S.js → views-5QKAWYPI.js} +23 -23
- package/dist/cli/{workflow-YUKADKCJ.js → workflow-G67RPWVY.js} +19 -19
- package/dist/cli/{workflow-KYFMA4LM.mjs → workflow-QAK773FR.mjs} +9 -9
- package/dist/{client-B1fixtK1.d.ts → client-D1ga52xq.d.ts} +1 -1
- package/dist/{client-CE4QBVbp.d.mts → client-bd4QQIXo.d.mts} +1 -1
- package/dist/{client-core-C-3FVlVq.d.ts → client-core-B6eMVx8h.d.ts} +335 -4
- package/dist/{client-core-2BkNBgrx.d.mts → client-core-CqfWNf2Q.d.mts} +335 -4
- package/dist/{compiler-manifest-Cys06iYg.d.ts → compiler-manifest-BWFtsQIC.d.mts} +21 -0
- package/dist/{compiler-manifest-Cys06iYg.d.mts → compiler-manifest-BWFtsQIC.d.ts} +21 -0
- package/dist/{errors-B6eMjKcr.d.mts → errors-CwKXXtuu.d.mts} +1 -1
- package/dist/{errors-rdOUqcU2.d.ts → errors-Lm9_vJHZ.d.ts} +1 -1
- package/dist/{index-ejWadAL5.d.ts → index-3vJ-V9yw.d.ts} +1 -1
- package/dist/{index-CZdYO81A.d.mts → index-DjwsAt82.d.mts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +12 -12
- package/dist/index.mjs +8 -8
- package/dist/install-integrity.json +147 -133
- 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/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 +2 -2
- package/dist/plays/run-request.mjs +1 -1
- 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 +7 -7
- package/dist/server.mjs +5 -5
- package/package.json +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal-resource-usage.ts +0 -222
- package/dist/cli/auth-V76O674K.js +0 -43
- package/dist/cli/concurrent-runs-help-MFEPUP6Y.js +0 -21
- package/dist/cli/describe-5OUJA5TH.mjs +0 -49
- package/dist/cli/describe-7MF5AHIU.js +0 -49
- package/dist/cli/git-WLQ3BS6K.js +0 -25
- package/dist/cli/search-LTUIIV6W.js +0 -32
- package/dist/cli/sessions-2IVFGTPA.js +0 -22
- package/dist/cli/skills-WT42AZVH.js +0 -36
- package/dist/cli/tools-D6STYBQG.js +0 -56
- package/dist/cli/update-XTUKBC3J.js +0 -34
|
@@ -0,0 +1,455 @@
|
|
|
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; }
|
|
2
|
+
|
|
3
|
+
var _chunk3JZXU5OBjs = require('./chunk-3JZXU5OB.js');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkPX7XAVUCjs = require('./chunk-PX7XAVUC.js');
|
|
7
|
+
|
|
8
|
+
// src/cli/commands/integration-commands.ts
|
|
9
|
+
var _commander = require('commander');
|
|
10
|
+
var _fs = require('fs');
|
|
11
|
+
var _path = require('path');
|
|
12
|
+
function printIntegrationResult(value, json, lines, nextCursor) {
|
|
13
|
+
_chunkPX7XAVUCjs.printCommandEnvelope.call(void 0,
|
|
14
|
+
{},
|
|
15
|
+
{
|
|
16
|
+
json: json || void 0,
|
|
17
|
+
legacyJson: { value },
|
|
18
|
+
text: lines.length ? `${lines.join("\n")}
|
|
19
|
+
` : "",
|
|
20
|
+
textStderr: nextCursor ? `Next page cursor: ${nextCursor}
|
|
21
|
+
` : void 0
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
function registerIntegrationBalanceCommand(parent, hidden = false) {
|
|
26
|
+
return parent.command("balance <provider>", { hidden }).description(
|
|
27
|
+
"Read a fresh balance using this workspace\u2019s own provider connection (LeadMagic)."
|
|
28
|
+
).option("--json", "Print the balance and observation timestamp as JSON").action(async (provider, options) => {
|
|
29
|
+
const balance = await new (0, _chunk3JZXU5OBjs.DeeplineClient)().getIntegrationBalance(
|
|
30
|
+
provider
|
|
31
|
+
);
|
|
32
|
+
printIntegrationResult(balance, options.json, [
|
|
33
|
+
`${balance.provider}: ${balance.balance.value} ${balance.unit} (observed ${balance.observedAt})`
|
|
34
|
+
]);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function registerWorkspaceConnectionListCommand(parent, name = "workspace-connections", hidden = false) {
|
|
38
|
+
return parent.command(name, { hidden }).description(
|
|
39
|
+
"List named workspace authorizations and their connection status."
|
|
40
|
+
).option("--json", "Print connection summaries as JSON").option("--inventory", "List workspace connections across credential types").option("--provider <provider>", "List connections for one provider").option(
|
|
41
|
+
"--members",
|
|
42
|
+
"List teammates\u2019 personal connections for this provider"
|
|
43
|
+
).option("--cursor <cursor>", "Read the next page of members").action(
|
|
44
|
+
async (options) => {
|
|
45
|
+
const client = new (0, _chunk3JZXU5OBjs.DeeplineClient)();
|
|
46
|
+
if (name === "list" && options.cursor && !options.members)
|
|
47
|
+
throw new Error(
|
|
48
|
+
"Use --cursor with --members to continue a member page."
|
|
49
|
+
);
|
|
50
|
+
if (name === "list" && options.inventory && options.members)
|
|
51
|
+
throw new Error("Choose --inventory or --members.");
|
|
52
|
+
if (options.members) {
|
|
53
|
+
if (options.provider !== "hubspot" && options.provider !== "google_calendar_availability")
|
|
54
|
+
throw new Error(
|
|
55
|
+
"Pass --provider hubspot or --provider google_calendar_availability."
|
|
56
|
+
);
|
|
57
|
+
const result = await client.listManagedConnectionMembers(
|
|
58
|
+
options.provider,
|
|
59
|
+
options.cursor
|
|
60
|
+
);
|
|
61
|
+
printIntegrationResult(
|
|
62
|
+
result,
|
|
63
|
+
options.json,
|
|
64
|
+
result.members.map(
|
|
65
|
+
(member) => `${member.name || member.email} ${member.status}${member.account ? " " + member.account.label : ""}`
|
|
66
|
+
),
|
|
67
|
+
result.nextCursor
|
|
68
|
+
);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const { connections } = await client.listWorkspaceConnectionInventory(
|
|
72
|
+
options.provider,
|
|
73
|
+
{ authorizationsOnly: !options.inventory }
|
|
74
|
+
);
|
|
75
|
+
printIntegrationResult(
|
|
76
|
+
connections,
|
|
77
|
+
options.json,
|
|
78
|
+
connections.length ? connections.map(
|
|
79
|
+
(row) => `${row.provider} ${row.status} ${row.name ? row.name + " " : ""}${row.label}`
|
|
80
|
+
) : ["No workspace connections."]
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
function registerLegacyHubSpotMembersCommand(parent, hidden = false) {
|
|
86
|
+
return parent.command("hubspot-members", { hidden }).description(
|
|
87
|
+
"List personal HubSpot connection status for workspace members."
|
|
88
|
+
).option("--cursor <cursor>", "Read the next roster page").option("--json", "Print the roster page as JSON").action(async (options) => {
|
|
89
|
+
const page = await new (0, _chunk3JZXU5OBjs.DeeplineClient)().listPersonalHubSpotMembers(
|
|
90
|
+
options.cursor
|
|
91
|
+
);
|
|
92
|
+
const rows = page.members.map((member) => {
|
|
93
|
+
const account = member.account ? ` Portal ${member.account.portalId} User ${member.account.userId}` : "";
|
|
94
|
+
return `${JSON.stringify(member.name || member.email)} ${member.status}${account}`;
|
|
95
|
+
});
|
|
96
|
+
printIntegrationResult(
|
|
97
|
+
page,
|
|
98
|
+
options.json,
|
|
99
|
+
rows.length ? rows : ["No workspace members on this page."],
|
|
100
|
+
page.nextCursor
|
|
101
|
+
);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function registerLegacyWorkspaceConnectionCommand(parent, hidden = false) {
|
|
105
|
+
return parent.command("workspace-connection <provider> <action>", { hidden }).description("Manage a shared workspace account.").option("--json", "Print the result as JSON").option("--name <name>", "Name of a workspace connection").option("--auto-name", "Assign a name when connecting a workspace account").action(
|
|
106
|
+
async (provider, action, options) => {
|
|
107
|
+
if (provider !== "hubspot" && provider !== "google_calendar_availability")
|
|
108
|
+
throw new Error("Choose hubspot or google_calendar_availability.");
|
|
109
|
+
if (action !== "connect" && action !== "reconnect" && action !== "replace" && action !== "disconnect" && action !== "remove")
|
|
110
|
+
throw new Error(
|
|
111
|
+
"Choose connect, reconnect, replace, disconnect, or remove."
|
|
112
|
+
);
|
|
113
|
+
if (options.autoName && (action !== "connect" || options.name !== void 0))
|
|
114
|
+
throw new Error("Use --auto-name with connect and omit --name.");
|
|
115
|
+
const client = new (0, _chunk3JZXU5OBjs.DeeplineClient)();
|
|
116
|
+
const { connections } = action === "connect" ? { connections: [] } : options.name ? await client.listWorkspaceConnectionInventory(provider) : await client.listWorkspaceIntegrationConnections();
|
|
117
|
+
const row = connections.find(
|
|
118
|
+
(connection) => connection.provider === provider && (!("type" in connection) || connection.type === "oauth") && (options.name === void 0 || "name" in connection && connection.name === options.name)
|
|
119
|
+
);
|
|
120
|
+
const result = await client.manageWorkspaceIntegrationConnection({
|
|
121
|
+
provider,
|
|
122
|
+
action,
|
|
123
|
+
name: options.name,
|
|
124
|
+
...options.autoName ? { autoName: true } : {},
|
|
125
|
+
connectionId: _optionalChain([row, 'optionalAccess', _ => _.id]),
|
|
126
|
+
authorizationVersion: _optionalChain([row, 'optionalAccess', _2 => _2.authorizationVersion])
|
|
127
|
+
});
|
|
128
|
+
printIntegrationResult(result, options.json, [
|
|
129
|
+
_nullishCoalesce(result.url, () => ( (action === "remove" ? "Workspace connection removed." : "Workspace connection disconnected.")))
|
|
130
|
+
]);
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
function registerLegacyCalendarDelegationCommand(parent, hidden = false) {
|
|
135
|
+
return parent.command("calendar-delegation <action>", { hidden }).description(
|
|
136
|
+
"Manage Google Workspace approval. Named-team settings are deprecated."
|
|
137
|
+
).option("--name <name>", "Select a named availability connection").option("--domain <domain>", "Select a Google Workspace by domain").option("--label <label>", "Display name for a named connection").option("--everyone", "Include all eligible current and future members").option("--cursor <cursor>", "Read the next page of workspace members").option("--revision <revision>", "Current connection revision from status").option("--connection-id <id>", "Connection ID from status for edits").option(
|
|
138
|
+
"--grant-revision <revision>",
|
|
139
|
+
"Workspace approval revision from list"
|
|
140
|
+
).option("--members <memberIds...>", "Workspace member IDs to approve").option(
|
|
141
|
+
"--verification-email <email>",
|
|
142
|
+
"Verify Workspace approval with a work email"
|
|
143
|
+
).option(
|
|
144
|
+
"--dry-run",
|
|
145
|
+
"Print the proposed change without contacting Google or saving it"
|
|
146
|
+
).option("--json", "Print the result as JSON").action(
|
|
147
|
+
async (action, options) => {
|
|
148
|
+
const client = new (0, _chunk3JZXU5OBjs.DeeplineClient)();
|
|
149
|
+
if (action === "list") {
|
|
150
|
+
const inventory = await client.listCalendarAvailabilityConnections();
|
|
151
|
+
const approvals = _optionalChain([inventory, 'access', _3 => _3.approvals, 'optionalAccess', _4 => _4.length]) ? inventory.approvals.map(
|
|
152
|
+
(approval) => `${approval.domain} ${approval.enabled ? "approved" : "paused"} revision ${approval.revision}`
|
|
153
|
+
) : [
|
|
154
|
+
`Workspace approval ${inventory.grantEnabled ? "connected" : "disconnected"} \xB7 revision ${inventory.grantRevision}`
|
|
155
|
+
];
|
|
156
|
+
printIntegrationResult(inventory, options.json, [
|
|
157
|
+
...approvals,
|
|
158
|
+
...inventory.connections.map(
|
|
159
|
+
(row) => `${row.name} ${row.label} ${row.enabled ? "enabled" : "disabled"}${row.domain ? ` ${row.domain}` : ""}`
|
|
160
|
+
)
|
|
161
|
+
]);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (action === "status") {
|
|
165
|
+
if (options.members || options.revision || options.dryRun)
|
|
166
|
+
throw new Error(
|
|
167
|
+
"Use --members, --revision, and --dry-run with a settings change."
|
|
168
|
+
);
|
|
169
|
+
const settings = await client.getCalendarDelegation(
|
|
170
|
+
options.cursor,
|
|
171
|
+
options.name,
|
|
172
|
+
options.domain
|
|
173
|
+
);
|
|
174
|
+
printIntegrationResult(
|
|
175
|
+
settings,
|
|
176
|
+
options.json,
|
|
177
|
+
[
|
|
178
|
+
`${settings.enabled ? "Enabled" : "Disabled"} \xB7 revision ${settings.revision} \xB7 ${settings.domain}`,
|
|
179
|
+
`Google client ${settings.clientId} \xB7 ${settings.scope}`,
|
|
180
|
+
...settings.members.map((member) => {
|
|
181
|
+
const readiness = settings.selectedMemberIds.includes(
|
|
182
|
+
member.memberId
|
|
183
|
+
) ? "verified at setup" : member.eligible ? "eligible" : "verified work email required";
|
|
184
|
+
return `${member.memberId} ${member.email} ${readiness}`;
|
|
185
|
+
})
|
|
186
|
+
],
|
|
187
|
+
settings.nextCursor
|
|
188
|
+
);
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
const workspaceAction = [
|
|
192
|
+
"enable-workspace",
|
|
193
|
+
"disable-workspace",
|
|
194
|
+
"remove-workspace"
|
|
195
|
+
].includes(action);
|
|
196
|
+
if (action !== "enable" && action !== "disable" && action !== "remove" && !workspaceAction)
|
|
197
|
+
throw new Error(
|
|
198
|
+
"Choose list, status, enable, disable, remove, enable-workspace, disable-workspace, or remove-workspace."
|
|
199
|
+
);
|
|
200
|
+
const revision = Number(options.revision);
|
|
201
|
+
if (!workspaceAction && (!options.revision || !/^\d+$/.test(options.revision) || !Number.isSafeInteger(revision)))
|
|
202
|
+
throw new Error(
|
|
203
|
+
"Pass --revision with the current revision from status."
|
|
204
|
+
);
|
|
205
|
+
if (options.cursor || (action === "enable" || action === "enable-workspace" ? !(_optionalChain([options, 'access', _5 => _5.members, 'optionalAccess', _6 => _6.length]) || action === "enable-workspace" && options.verificationEmail) : options.members || options.verificationEmail) || options.members && options.verificationEmail)
|
|
206
|
+
throw new Error(
|
|
207
|
+
"Use --verification-email for Workspace approval or --members for legacy settings. Use --cursor only with status."
|
|
208
|
+
);
|
|
209
|
+
const grantRevision = Number(options.grantRevision);
|
|
210
|
+
if ((workspaceAction || options.name) && (options.grantRevision === void 0 || !/^\d+$/.test(options.grantRevision) || !Number.isSafeInteger(grantRevision)))
|
|
211
|
+
throw new Error(
|
|
212
|
+
"Pass --grant-revision with the current workspace approval revision."
|
|
213
|
+
);
|
|
214
|
+
let change;
|
|
215
|
+
if (workspaceAction) {
|
|
216
|
+
const selection = {
|
|
217
|
+
grantRevision,
|
|
218
|
+
...options.domain ? { domain: options.domain } : {}
|
|
219
|
+
};
|
|
220
|
+
if (action === "enable-workspace") {
|
|
221
|
+
if (options.verificationEmail) {
|
|
222
|
+
change = {
|
|
223
|
+
...selection,
|
|
224
|
+
action: "enable_workspace",
|
|
225
|
+
verificationEmail: options.verificationEmail
|
|
226
|
+
};
|
|
227
|
+
} else {
|
|
228
|
+
if (_optionalChain([options, 'access', _7 => _7.members, 'optionalAccess', _8 => _8.length]) !== 1)
|
|
229
|
+
throw new Error(
|
|
230
|
+
"Pass --verification-email with an address in the approved domain."
|
|
231
|
+
);
|
|
232
|
+
change = {
|
|
233
|
+
...selection,
|
|
234
|
+
action: "enable_workspace",
|
|
235
|
+
memberIds: options.members
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
} else if (action === "remove-workspace") {
|
|
239
|
+
if (!options.domain)
|
|
240
|
+
throw new Error("Pass --domain with the approval domain.");
|
|
241
|
+
if (!options.connectionId)
|
|
242
|
+
throw new Error(
|
|
243
|
+
"Pass --connection-id with the disconnected approval ID from list."
|
|
244
|
+
);
|
|
245
|
+
change = {
|
|
246
|
+
...selection,
|
|
247
|
+
action: "remove_workspace",
|
|
248
|
+
domain: options.domain,
|
|
249
|
+
connectionId: options.connectionId
|
|
250
|
+
};
|
|
251
|
+
} else {
|
|
252
|
+
change = { ...selection, action: "disable_workspace" };
|
|
253
|
+
}
|
|
254
|
+
} else if (options.name) {
|
|
255
|
+
if (revision !== 0 && !options.connectionId)
|
|
256
|
+
throw new Error("Pass --connection-id from the connection status.");
|
|
257
|
+
const selection = {
|
|
258
|
+
name: options.name,
|
|
259
|
+
revision,
|
|
260
|
+
grantRevision,
|
|
261
|
+
connectionId: options.connectionId,
|
|
262
|
+
...options.domain ? { domain: options.domain } : {}
|
|
263
|
+
};
|
|
264
|
+
change = action === "enable" ? {
|
|
265
|
+
...selection,
|
|
266
|
+
action,
|
|
267
|
+
allMembers: options.everyone === true,
|
|
268
|
+
label: _nullishCoalesce(options.label, () => ( options.name)),
|
|
269
|
+
memberIds: options.members
|
|
270
|
+
} : {
|
|
271
|
+
...selection,
|
|
272
|
+
action: action === "remove" ? "remove" : "disable"
|
|
273
|
+
};
|
|
274
|
+
} else {
|
|
275
|
+
if (action === "remove" || options.domain)
|
|
276
|
+
throw new Error(
|
|
277
|
+
"Pass --name to update a named connection, or use enable-workspace or disable-workspace to change its Google approval."
|
|
278
|
+
);
|
|
279
|
+
change = action === "enable" ? { action, revision, memberIds: options.members } : { action: "disable", revision };
|
|
280
|
+
}
|
|
281
|
+
if (options.dryRun) {
|
|
282
|
+
printIntegrationResult(change, true, []);
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
const result = await client.changeCalendarDelegation(change);
|
|
286
|
+
printIntegrationResult(result, options.json, [
|
|
287
|
+
result.status === "validation_failed" ? "Google calendar verification failed." : `Delegation ${result.status}.`,
|
|
288
|
+
...(_nullishCoalesce(result.checks, () => ( []))).map(
|
|
289
|
+
(check) => `${check.memberId} ${check.readiness}`
|
|
290
|
+
)
|
|
291
|
+
]);
|
|
292
|
+
if (result.status === "validation_failed") process.exitCode = 1;
|
|
293
|
+
}
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
function registerLegacyAvailabilityCalendarsCommand(parent, hidden = false) {
|
|
297
|
+
return parent.command("availability-calendars", { hidden }).description("Calendar discovery compatibility command for the pilot.").option("--cursor <cursor>", "Legacy calendar page cursor").option("--json", "Print the response as JSON").action(async (options) => {
|
|
298
|
+
const page = await new (0, _chunk3JZXU5OBjs.DeeplineClient)().listAvailabilityCalendars(
|
|
299
|
+
options.cursor
|
|
300
|
+
);
|
|
301
|
+
printIntegrationResult(page, options.json, [
|
|
302
|
+
...page.calendars.map(
|
|
303
|
+
(calendar) => `${JSON.stringify(calendar.name)} ${calendar.id}`
|
|
304
|
+
),
|
|
305
|
+
...page.cursor ? [`Next page cursor: ${JSON.stringify(page.cursor)}`] : []
|
|
306
|
+
]);
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
function registerIntegrationConnectCommand(parent, defaultLink = false, hidden = false) {
|
|
310
|
+
return parent.command("connect <provider>", { hidden }).description(
|
|
311
|
+
"Get a dashboard connection link or connect a provider with credentials or OAuth."
|
|
312
|
+
).addOption(
|
|
313
|
+
new (0, _commander.Option)("--link", "Print a shareable dashboard link").conflicts([
|
|
314
|
+
"credentialsFile",
|
|
315
|
+
"oauth",
|
|
316
|
+
"preset",
|
|
317
|
+
"scopes",
|
|
318
|
+
"optionalScopes",
|
|
319
|
+
"expectedConnectionId"
|
|
320
|
+
])
|
|
321
|
+
).option(
|
|
322
|
+
"--credentials-file <path>",
|
|
323
|
+
"JSON object of credential field names and string values; keep this file private"
|
|
324
|
+
).option("--oauth", "Return an OAuth authorization URL").addOption(new (0, _commander.Option)("--expected-connection-id <id>").hideHelp()).option("--preset <id>", "Server-defined access preset (HubSpot only)").option("--scopes <scopes>", "Comma-separated OAuth scopes").option(
|
|
325
|
+
"--optional-scopes <scopes>",
|
|
326
|
+
"Comma-separated optional OAuth scopes"
|
|
327
|
+
).option(
|
|
328
|
+
"--dry-run",
|
|
329
|
+
"Print the proposed setup without saving credentials or starting OAuth"
|
|
330
|
+
).option("--json", "Print JSON without credential values").action(
|
|
331
|
+
async (provider, options) => {
|
|
332
|
+
if (options.expectedConnectionId !== void 0 && (!options.expectedConnectionId.trim() || provider !== "google_calendar_availability" || !options.credentialsFile || options.oauth)) {
|
|
333
|
+
throw new Error(
|
|
334
|
+
"--expected-connection-id requires Calendar availability and a credentials file."
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
if (options.link || defaultLink && !options.oauth && !options.credentialsFile && options.preset === void 0 && options.scopes === void 0 && options.optionalScopes === void 0 && options.expectedConnectionId === void 0) {
|
|
338
|
+
if (options.dryRun) {
|
|
339
|
+
printSetupPlan({ provider, action: "connect_link" }, options.json);
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
const link = await new (0, _chunk3JZXU5OBjs.DeeplineClient)().getIntegrationConnectLink(
|
|
343
|
+
provider
|
|
344
|
+
);
|
|
345
|
+
printIntegrationResult(link, options.json, [link.connect_url]);
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
if (options.oauth) {
|
|
349
|
+
if (options.credentialsFile)
|
|
350
|
+
throw new Error("Use --oauth or --credentials-file, not both.");
|
|
351
|
+
if (options.preset !== void 0 && (options.scopes !== void 0 || options.optionalScopes !== void 0))
|
|
352
|
+
throw new Error("Use --preset or individual scopes, not both.");
|
|
353
|
+
const splitScopes = (value) => value.split(",").map((scope) => scope.trim()).filter(Boolean);
|
|
354
|
+
if (options.scopes !== void 0 && splitScopes(options.scopes).length === 0)
|
|
355
|
+
throw new Error("scopes must contain at least one OAuth scope.");
|
|
356
|
+
if (options.dryRun) {
|
|
357
|
+
printSetupPlan(
|
|
358
|
+
{
|
|
359
|
+
provider,
|
|
360
|
+
action: "oauth",
|
|
361
|
+
...options.preset !== void 0 ? { preset: options.preset } : {},
|
|
362
|
+
...options.scopes !== void 0 ? { scopes: splitScopes(options.scopes) } : {},
|
|
363
|
+
...options.optionalScopes !== void 0 ? { optionalScopes: splitScopes(options.optionalScopes) } : {}
|
|
364
|
+
},
|
|
365
|
+
options.json
|
|
366
|
+
);
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
const result2 = await new (0, _chunk3JZXU5OBjs.DeeplineClient)().startIntegrationOAuth(
|
|
370
|
+
provider,
|
|
371
|
+
{
|
|
372
|
+
...options.preset !== void 0 ? { preset: options.preset } : {},
|
|
373
|
+
...options.scopes !== void 0 ? { scopes: splitScopes(options.scopes) } : {},
|
|
374
|
+
...options.optionalScopes !== void 0 ? { optionalScopes: splitScopes(options.optionalScopes) } : {}
|
|
375
|
+
}
|
|
376
|
+
);
|
|
377
|
+
if (!result2.ok || typeof result2.redirect_url !== "string" || !result2.redirect_url)
|
|
378
|
+
throw new Error(
|
|
379
|
+
"The API did not return an OAuth authorization URL."
|
|
380
|
+
);
|
|
381
|
+
printIntegrationResult(
|
|
382
|
+
{ provider, redirect_url: result2.redirect_url },
|
|
383
|
+
options.json,
|
|
384
|
+
[result2.redirect_url]
|
|
385
|
+
);
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
if (!options.credentialsFile || options.preset !== void 0 || options.scopes !== void 0 || options.optionalScopes !== void 0)
|
|
389
|
+
throw new Error(
|
|
390
|
+
"Use --link for a dashboard link, --credentials-file to save credentials, or --oauth to request access."
|
|
391
|
+
);
|
|
392
|
+
if (options.dryRun) {
|
|
393
|
+
printSetupPlan(
|
|
394
|
+
{
|
|
395
|
+
provider,
|
|
396
|
+
action: "save_credentials",
|
|
397
|
+
credentials_file: options.credentialsFile,
|
|
398
|
+
...options.expectedConnectionId ? { expected_connection_id: options.expectedConnectionId } : {}
|
|
399
|
+
},
|
|
400
|
+
options.json
|
|
401
|
+
);
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
let credentials;
|
|
405
|
+
try {
|
|
406
|
+
credentials = JSON.parse(
|
|
407
|
+
_fs.readFileSync.call(void 0, _path.resolve.call(void 0, options.credentialsFile), "utf8")
|
|
408
|
+
);
|
|
409
|
+
} catch (e) {
|
|
410
|
+
throw new Error(
|
|
411
|
+
"Unable to read --credentials-file as a JSON object."
|
|
412
|
+
);
|
|
413
|
+
}
|
|
414
|
+
if (!credentials || typeof credentials !== "object" || Array.isArray(credentials) || Object.keys(credentials).length === 0 || Object.values(credentials).some((value) => typeof value !== "string")) {
|
|
415
|
+
throw new Error(
|
|
416
|
+
"--credentials-file must contain a nonempty JSON object of string credential values."
|
|
417
|
+
);
|
|
418
|
+
}
|
|
419
|
+
const result = await new (0, _chunk3JZXU5OBjs.DeeplineClient)().setIntegrationCredentials(
|
|
420
|
+
provider,
|
|
421
|
+
credentials,
|
|
422
|
+
{ expectedConnectionId: options.expectedConnectionId }
|
|
423
|
+
);
|
|
424
|
+
if (!result.ok || result.credential_saved !== true) {
|
|
425
|
+
throw new Error(
|
|
426
|
+
"The API did not confirm that provider credentials were saved. Inspect the integration before retrying."
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
const confirmation = { provider, credential_saved: true };
|
|
430
|
+
printIntegrationResult(confirmation, options.json, [
|
|
431
|
+
`Credentials saved for ${provider} in the active workspace.`
|
|
432
|
+
]);
|
|
433
|
+
}
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
function printSetupPlan(plan, json) {
|
|
437
|
+
printIntegrationResult(
|
|
438
|
+
plan,
|
|
439
|
+
json,
|
|
440
|
+
Object.entries(plan).map(
|
|
441
|
+
([field, value]) => `${field}: ${Array.isArray(value) ? value.join(", ") : String(value)}`
|
|
442
|
+
)
|
|
443
|
+
);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
exports.printIntegrationResult = printIntegrationResult; exports.registerIntegrationBalanceCommand = registerIntegrationBalanceCommand; exports.registerWorkspaceConnectionListCommand = registerWorkspaceConnectionListCommand; exports.registerLegacyHubSpotMembersCommand = registerLegacyHubSpotMembersCommand; exports.registerLegacyWorkspaceConnectionCommand = registerLegacyWorkspaceConnectionCommand; exports.registerLegacyCalendarDelegationCommand = registerLegacyCalendarDelegationCommand; exports.registerLegacyAvailabilityCalendarsCommand = registerLegacyAvailabilityCalendarsCommand; exports.registerIntegrationConnectCommand = registerIntegrationConnectCommand;
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
getAuthedHttpClient,
|
|
3
3
|
openInBrowser,
|
|
4
4
|
printCommandEnvelope
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DH43ECTN.mjs";
|
|
6
6
|
import {
|
|
7
7
|
resolveBaseUrlOnly
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-R57UCXQG.mjs";
|
|
9
9
|
|
|
10
10
|
// src/cli/commands/git.ts
|
|
11
11
|
function shellQuote(value) {
|
|
@@ -17,12 +17,12 @@ var _chunkXNYIZMNQjs = require('./chunk-XNYIZMNQ.js');
|
|
|
17
17
|
var _chunkBBTKAASQjs = require('./chunk-BBTKAASQ.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkTBCNL2T5js = require('./chunk-TBCNL2T5.js');
|
|
21
21
|
|
|
22
22
|
// src/version.ts
|
|
23
|
-
var SDK_VERSION =
|
|
24
|
-
var SDK_API_MAJOR =
|
|
25
|
-
var SDK_API_CONTRACT = _nullishCoalesce(
|
|
23
|
+
var SDK_VERSION = _chunkTBCNL2T5js.SDK_RELEASE.version;
|
|
24
|
+
var SDK_API_MAJOR = _chunkTBCNL2T5js.SDK_RELEASE.contracts.api.currentMajor;
|
|
25
|
+
var SDK_API_CONTRACT = _nullishCoalesce(_chunkTBCNL2T5js.SDK_RELEASE.contracts.api.legacyWireIds[0], () => ( `api-v${SDK_API_MAJOR}`));
|
|
26
26
|
|
|
27
27
|
// src/agent-runtime.ts
|
|
28
28
|
var _fs = require('fs');
|
|
@@ -402,7 +402,7 @@ function describedTool(tool, requestedToolId) {
|
|
|
402
402
|
"credential_status"
|
|
403
403
|
);
|
|
404
404
|
const provider = stringField(tool, "provider");
|
|
405
|
-
const connectCommand = credentialStatus === "requires_connection" && (!byok || byok.setupUrl) && /^[a-z0-9][a-z0-9_-]*$/.test(provider) ? `deepline
|
|
405
|
+
const connectCommand = credentialStatus === "requires_connection" && (!byok || byok.setupUrl) && /^[a-z0-9][a-z0-9_-]*$/.test(provider) ? `deepline integrations connect ${provider} --link --json` : void 0;
|
|
406
406
|
return {
|
|
407
407
|
kind: "tool",
|
|
408
408
|
id: String(contract.toolId),
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
npmSupportsAllowScripts,
|
|
3
3
|
readNpmVersion
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AACKPOGA.mjs";
|
|
5
5
|
import {
|
|
6
6
|
runSkillsCommand
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZSPBJB7I.mjs";
|
|
8
8
|
import {
|
|
9
9
|
resolveShellSpawn
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-NR3O56FT.mjs";
|
|
11
11
|
import {
|
|
12
12
|
printCommandEnvelope
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-DH43ECTN.mjs";
|
|
14
14
|
import {
|
|
15
15
|
autoDetectBaseUrl
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-R57UCXQG.mjs";
|
|
17
17
|
|
|
18
18
|
// src/cli/commands/update.ts
|
|
19
19
|
import { spawn, spawnSync } from "child_process";
|
|
@@ -27,6 +27,22 @@ var PLAY_BACKEND_DESCRIPTORS = {
|
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
+
// ../integration-contracts/calendar-delegation.ts
|
|
31
|
+
var GOOGLE_WORKSPACE_AVAILABILITY_SCOPE = "https://www.googleapis.com/auth/calendar.freebusy";
|
|
32
|
+
var GOOGLE_WORKSPACE_BOOKING_SCOPE = "https://www.googleapis.com/auth/calendar.events.owned";
|
|
33
|
+
var GOOGLE_WORKSPACE_BOOKING_SCOPES = [
|
|
34
|
+
GOOGLE_WORKSPACE_AVAILABILITY_SCOPE,
|
|
35
|
+
GOOGLE_WORKSPACE_BOOKING_SCOPE
|
|
36
|
+
];
|
|
37
|
+
var GOOGLE_WORKSPACE_DOMAIN_PATTERN = /^(?=.{1,253}$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$/;
|
|
38
|
+
|
|
39
|
+
// ../integration-contracts/tool-connection.ts
|
|
40
|
+
var workspaceConnectionName = /^[a-z][a-z0-9-]{0,39}$/;
|
|
41
|
+
var TOOL_CONNECTION_NAME_PATTERN = `^(?:${workspaceConnectionName.source.slice(1, -1)}|${GOOGLE_WORKSPACE_DOMAIN_PATTERN.source.slice(1, -1)})$`;
|
|
42
|
+
function isToolConnectionName(value) {
|
|
43
|
+
return typeof value === "string" && (workspaceConnectionName.test(value) || GOOGLE_WORKSPACE_DOMAIN_PATTERN.test(value));
|
|
44
|
+
}
|
|
45
|
+
|
|
30
46
|
// ../plays/tool-response-contract.ts
|
|
31
47
|
var V2_TOOL_RESPONSE_CONTRACT = "v2-tool-response";
|
|
32
48
|
var RAW_V2_TOOL_RESPONSE_CONTRACT = "raw-v2";
|
|
@@ -86,6 +102,11 @@ function providerMetaFromToolResponseRawV2(rawV2, view) {
|
|
|
86
102
|
}
|
|
87
103
|
|
|
88
104
|
export {
|
|
105
|
+
GOOGLE_WORKSPACE_BOOKING_SCOPE,
|
|
106
|
+
GOOGLE_WORKSPACE_BOOKING_SCOPES,
|
|
107
|
+
GOOGLE_WORKSPACE_DOMAIN_PATTERN,
|
|
108
|
+
TOOL_CONNECTION_NAME_PATTERN,
|
|
109
|
+
isToolConnectionName,
|
|
89
110
|
RAW_V2_TOOL_RESPONSE_CONTRACT,
|
|
90
111
|
RAW_V2_TOOL_RESPONSE_RECEIPT_REVISION,
|
|
91
112
|
UnsupportedToolResponseContractError,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk2NCJQEZHjs = require('./chunk-2NCJQEZH.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkUV4RU2TEjs = require('./chunk-UV4RU2TE.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkQFRMVI4Sjs = require('./chunk-QFRMVI4S.js');
|
|
11
11
|
|
|
12
12
|
// src/cli/concurrent-runs-help.ts
|
|
13
13
|
var CONCURRENT_RUNS_HELP_COMMANDS = /* @__PURE__ */ new Set([
|
|
@@ -24,11 +24,11 @@ function concurrentRunsLine(payload) {
|
|
|
24
24
|
return plans ? `${here} Plan limits: ${plans}.` : here;
|
|
25
25
|
}
|
|
26
26
|
async function concurrentRunsHelpStatus(timeoutMs = 2e3) {
|
|
27
|
-
const baseUrl =
|
|
28
|
-
const apiKey =
|
|
27
|
+
const baseUrl = _chunkQFRMVI4Sjs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
|
|
28
|
+
const apiKey = _chunkQFRMVI4Sjs.resolveApiKeyForBaseUrl.call(void 0, baseUrl);
|
|
29
29
|
if (!apiKey) return "";
|
|
30
30
|
try {
|
|
31
|
-
const { status, data } = await
|
|
31
|
+
const { status, data } = await _chunk2NCJQEZHjs.httpJson.call(void 0,
|
|
32
32
|
"GET",
|
|
33
33
|
`${baseUrl}/api/v2/billing/entitlements`,
|
|
34
34
|
apiKey,
|
|
@@ -40,7 +40,7 @@ async function concurrentRunsHelpStatus(timeoutMs = 2e3) {
|
|
|
40
40
|
return line ? `
|
|
41
41
|
Your workspace:
|
|
42
42
|
${line}
|
|
43
|
-
${
|
|
43
|
+
${_chunkUV4RU2TEjs.PRICING_PAGE_NOTE}
|
|
44
44
|
` : "";
|
|
45
45
|
} catch (e) {
|
|
46
46
|
return "";
|
|
@@ -205,6 +205,7 @@ function buildPlayRunStartBody(request) {
|
|
|
205
205
|
...request.packagedFiles?.length ? { packagedFiles: request.packagedFiles } : {},
|
|
206
206
|
...request.force ? { force: true } : {},
|
|
207
207
|
...request.forceToolRefresh === true ? { forceToolRefresh: true } : {},
|
|
208
|
+
...typeof request.cacheReuseWindowSeconds === "number" ? { cacheReuseWindowSeconds: request.cacheReuseWindowSeconds } : {},
|
|
208
209
|
...typeof request.maxConcurrentExternalCalls === "number" ? { maxConcurrentExternalCalls: request.maxConcurrentExternalCalls } : {},
|
|
209
210
|
...typeof request.maxConcurrentRows === "number" ? { maxConcurrentRows: request.maxConcurrentRows } : {},
|
|
210
211
|
...typeof request.maxCredits === "number" ? { maxCredits: request.maxCredits } : {},
|