deepline 0.3.567 → 0.3.569

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.
Files changed (155) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +53 -5
  2. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  3. package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +17 -10
  4. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-capability.ts +21 -0
  5. package/dist/cli/auth-77NOPZ6A.js +44 -0
  6. package/dist/cli/{auth-IYYQA4ZO.mjs → auth-VNJLXDGF.mjs} +5 -5
  7. package/dist/cli/{billing-B37Z3HQJ.mjs → billing-6HD5LEI2.mjs} +9 -9
  8. package/dist/cli/{billing-HSUA42W6.js → billing-OTIIK5ZQ.js} +102 -102
  9. package/dist/cli/{chunk-NQ6NYC54.js → chunk-3WZ3X46C.js} +13 -13
  10. package/dist/cli/{chunk-Z75WS3TZ.js → chunk-44HOKKIN.js} +100 -100
  11. package/dist/cli/{chunk-GWKHJ6BN.mjs → chunk-45OTCUAC.mjs} +2 -2
  12. package/dist/cli/{chunk-OUKIU4AE.js → chunk-4CLEOTG6.js} +2 -2
  13. package/dist/cli/{chunk-KOMEYB7H.mjs → chunk-64MOX3SN.mjs} +16 -3
  14. package/dist/cli/{chunk-3GRMC25W.mjs → chunk-6D4WBX7E.mjs} +33 -5
  15. package/dist/cli/{chunk-LZV3AJAX.mjs → chunk-6HEZRKAO.mjs} +2 -2
  16. package/dist/cli/{chunk-KOBUUBOO.mjs → chunk-6SBGYX25.mjs} +2 -2
  17. package/dist/cli/{chunk-LQRWLQAQ.js → chunk-6Z7B3IOW.js} +2 -2
  18. package/dist/cli/{chunk-AC37TMJX.js → chunk-7MZUSBSI.js} +23 -23
  19. package/dist/cli/{chunk-FT7OSIWX.mjs → chunk-7NP7WZV2.mjs} +3 -3
  20. package/dist/cli/{chunk-HYYWZFYF.mjs → chunk-7QH52S3E.mjs} +145 -10
  21. package/dist/cli/{chunk-4FTTLJVV.mjs → chunk-AKNJDDSM.mjs} +1 -1
  22. package/dist/cli/{chunk-A5VWMZY4.js → chunk-ANXJNE2G.js} +3 -3
  23. package/dist/cli/{chunk-RSQ6AVH3.mjs → chunk-CK6U2NH2.mjs} +1 -1
  24. package/dist/cli/{chunk-ZPD6SPP2.mjs → chunk-D3BJ2KZX.mjs} +1 -1
  25. package/dist/cli/{chunk-YDXPAUGF.mjs → chunk-DG6ILAO7.mjs} +2 -2
  26. package/dist/cli/{chunk-6DJHNVGT.mjs → chunk-EDNWMQZQ.mjs} +2 -2
  27. package/dist/cli/{chunk-JBXDWAGB.mjs → chunk-FPRLFIYT.mjs} +4 -4
  28. package/dist/cli/{chunk-LTJQCMEM.js → chunk-FSAOU4HA.js} +20 -20
  29. package/dist/cli/{chunk-MMWD3ZTQ.mjs → chunk-GSUHJUNZ.mjs} +2 -2
  30. package/dist/cli/{chunk-OPGDVTAQ.js → chunk-H3SQMLHO.js} +48 -48
  31. package/dist/cli/{chunk-3E2C6CIE.js → chunk-H7DRZXYF.js} +4 -4
  32. package/dist/cli/{chunk-5D3QECRX.js → chunk-HLRSNCPM.js} +53 -53
  33. package/dist/cli/{chunk-OD4LINNE.mjs → chunk-IEOIGU5A.mjs} +1 -1
  34. package/dist/cli/{chunk-ZNXUAZDK.js → chunk-IGIUAHTR.js} +41 -41
  35. package/dist/cli/{chunk-V5YGEK5Q.js → chunk-IS4NFIQY.js} +136 -108
  36. package/dist/cli/{chunk-4ACBVZ44.mjs → chunk-JXRWSBJZ.mjs} +1 -1
  37. package/dist/cli/{chunk-GFETP5X7.js → chunk-LOF7H5V3.js} +7 -7
  38. package/dist/cli/{chunk-KHZVZOJF.js → chunk-MIGJHZ3P.js} +20 -20
  39. package/dist/cli/{chunk-XG5NEJOK.js → chunk-N5ZOD3LA.js} +10 -10
  40. package/dist/cli/{chunk-OEVCKW2M.js → chunk-N6KF6X3D.js} +16 -3
  41. package/dist/cli/{chunk-64CQF2JL.mjs → chunk-OFBP336D.mjs} +4 -4
  42. package/dist/cli/{chunk-3TJKNRHY.mjs → chunk-P2LVKWU6.mjs} +2 -2
  43. package/dist/cli/{chunk-PFJNZUUK.js → chunk-PAFSVZCZ.js} +155 -20
  44. package/dist/cli/{chunk-P4GUUPIV.js → chunk-QKPKVLTG.js} +2 -2
  45. package/dist/cli/{chunk-35TWSBEO.js → chunk-QLMMNBJW.js} +6 -6
  46. package/dist/cli/{chunk-7RNBGBTS.js → chunk-S3VGWMFX.js} +9 -9
  47. package/dist/cli/{chunk-OOFYQCNU.js → chunk-S4MDYDCF.js} +5 -5
  48. package/dist/cli/{chunk-RIR3YNNB.js → chunk-SMAXLMM3.js} +15 -15
  49. package/dist/cli/{chunk-IPOAJ56O.mjs → chunk-SRMDDVWK.mjs} +5 -5
  50. package/dist/cli/{chunk-L5UB7RF2.js → chunk-SWREMC6J.js} +5 -5
  51. package/dist/cli/{chunk-FRQYUWGF.mjs → chunk-TALKTQK5.mjs} +1 -1
  52. package/dist/cli/{chunk-4FVLQFCF.js → chunk-TH2GHSF6.js} +5 -5
  53. package/dist/cli/{chunk-S72EZ4R5.mjs → chunk-TRE5X6VQ.mjs} +1 -1
  54. package/dist/cli/{chunk-WIKOKQJV.js → chunk-TZVKEUM6.js} +1 -1
  55. package/dist/cli/{chunk-C67KGU5G.mjs → chunk-UOMMXLDU.mjs} +11 -11
  56. package/dist/cli/{chunk-YRRXHWQ2.mjs → chunk-WPCY5PR3.mjs} +5 -5
  57. package/dist/cli/{chunk-CR7U44AW.js → chunk-WVS2ITKP.js} +3 -3
  58. package/dist/cli/{chunk-ASIXRCHD.mjs → chunk-X4WPW5O3.mjs} +3 -3
  59. package/dist/cli/{chunk-6TLCP356.mjs → chunk-YLZ63U7S.mjs} +5 -5
  60. package/dist/cli/{chunk-PH4SALNI.mjs → chunk-YNSVWNRY.mjs} +1 -1
  61. package/dist/cli/{chunk-SDJ5CTZX.js → chunk-YTOILYBU.js} +26 -26
  62. package/dist/cli/{chunk-AUXDJJYK.mjs → chunk-YTYDKSK7.mjs} +5 -5
  63. package/dist/cli/command-docs.js +2 -2
  64. package/dist/cli/command-docs.mjs +1 -1
  65. package/dist/cli/{concurrent-runs-help-P5TBHSRA.mjs → concurrent-runs-help-BVBGDMNV.mjs} +6 -6
  66. package/dist/cli/concurrent-runs-help-QPUTOBFB.js +22 -0
  67. package/dist/cli/{csv-KPYMOFM2.mjs → csv-BUZIP2TV.mjs} +4 -4
  68. package/dist/cli/{csv-2F5LOZUT.js → csv-G25E43QV.js} +13 -13
  69. package/dist/cli/{db-URVQ2LNU.mjs → db-EUN7RRDX.mjs} +6 -6
  70. package/dist/cli/{db-4H4CJFI2.js → db-KYIDDEEE.js} +27 -27
  71. package/dist/cli/{describe-KV6RFX2K.mjs → describe-CTYSKRQB.mjs} +18 -18
  72. package/dist/cli/describe-PJIQSXJ4.js +50 -0
  73. package/dist/cli/describe-core.d.mts +2 -2
  74. package/dist/cli/describe-core.d.ts +2 -2
  75. package/dist/cli/{executions-NFQCGCBK.mjs → executions-BRSOIIV7.mjs} +6 -6
  76. package/dist/cli/{executions-BAAJY5LB.js → executions-LQA34Z76.js} +8 -8
  77. package/dist/cli/{feedback-UF2TRDNI.mjs → feedback-JYL2FTWI.mjs} +6 -6
  78. package/dist/cli/{feedback-Y3WJ5VTT.js → feedback-RVYWQRSZ.js} +14 -14
  79. package/dist/cli/{git-EIURJKMS.mjs → git-2Z2KYPCV.mjs} +5 -5
  80. package/dist/cli/git-MJRG55H7.js +26 -0
  81. package/dist/cli/index.js +147 -147
  82. package/dist/cli/index.mjs +46 -46
  83. package/dist/cli/{integrations-YVBIIULS.js → integrations-JK3OT5BT.js} +29 -29
  84. package/dist/cli/{integrations-TPEILZYO.mjs → integrations-QFS62VWE.mjs} +7 -7
  85. package/dist/cli/{legacy-noops-EVEQ4T2F.mjs → legacy-noops-NBKBFVDO.mjs} +6 -6
  86. package/dist/cli/{legacy-noops-K5YAE7DD.js → legacy-noops-RYP5LN5D.js} +9 -9
  87. package/dist/cli/{mcp-NADIFFBS.js → mcp-KPY7NZPI.js} +24 -24
  88. package/dist/cli/{mcp-7UX5HDKR.mjs → mcp-KVGJK3SM.mjs} +4 -4
  89. package/dist/cli/{monitors-TOWPB2IO.js → monitors-DE5SX3CP.js} +100 -100
  90. package/dist/cli/{monitors-V2XU3WU3.mjs → monitors-H3UWQMMI.mjs} +7 -7
  91. package/dist/cli/{org-S2UZTR74.js → org-CDCSMG3J.js} +121 -121
  92. package/dist/cli/{org-J2FDLRIR.mjs → org-N6I5K56T.mjs} +6 -6
  93. package/dist/cli/{outcomes-ECG7SORM.mjs → outcomes-EPEMTJVB.mjs} +6 -6
  94. package/dist/cli/{outcomes-DIU4I6IA.js → outcomes-UNAOLWWO.js} +14 -14
  95. package/dist/cli/{play-LW5RPGMR.js → play-7TVJ3DFQ.js} +324 -324
  96. package/dist/cli/{play-SIYRTGQF.mjs → play-VVM5XJFT.mjs} +19 -19
  97. package/dist/cli/{providers-5VIQLQGV.mjs → providers-47CT527B.mjs} +6 -6
  98. package/dist/cli/{providers-G4FAPJ6K.js → providers-ANYRJ56K.js} +9 -9
  99. package/dist/cli/{quickstart-6NLZQN2K.js → quickstart-H4MI6LVO.js} +6 -6
  100. package/dist/cli/{quickstart-IPM5YDLX.mjs → quickstart-QHMC5YCM.mjs} +4 -4
  101. package/dist/cli/{run-Z3TL5ZOG.mjs → run-NXC5W5CW.mjs} +23 -23
  102. package/dist/cli/{run-VGIB7CJB.js → run-V4UAYPAX.js} +44 -44
  103. package/dist/cli/{search-2CLGFCVP.mjs → search-BEU4VBY4.mjs} +7 -7
  104. package/dist/cli/search-TUK2STXB.js +32 -0
  105. package/dist/cli/{search-output-O6RCBYN6.mjs → search-output-DUA3WDB7.mjs} +4 -4
  106. package/dist/cli/{search-output-FEB5JLB5.js → search-output-NUGUU7VJ.js} +6 -6
  107. package/dist/cli/{secrets-OVVWC2HX.js → secrets-PFDBC5KO.js} +15 -15
  108. package/dist/cli/{secrets-RBHLBJHA.mjs → secrets-XQOOWTH2.mjs} +6 -6
  109. package/dist/cli/sessions-5333FFSY.js +23 -0
  110. package/dist/cli/{sessions-PFA3PFXV.mjs → sessions-U2ZS5R42.mjs} +6 -6
  111. package/dist/cli/{settings-V5OAQOFP.js → settings-ATYARYCR.js} +85 -85
  112. package/dist/cli/{settings-N54VKHLV.mjs → settings-GPDE7DL2.mjs} +12 -12
  113. package/dist/cli/{setup-XF3KBJ6Y.js → setup-4AYMU7NK.js} +49 -49
  114. package/dist/cli/{setup-2EZ563DR.mjs → setup-UDO6BY5A.mjs} +9 -9
  115. package/dist/cli/skills-LB56HJOY.js +37 -0
  116. package/dist/cli/{skills-7DULCICX.mjs → skills-RACTA7VV.mjs} +7 -7
  117. package/dist/cli/tools-3Y7KCKZX.js +57 -0
  118. package/dist/cli/{tools-NC5IVGAT.mjs → tools-TXI6XFHE.mjs} +17 -17
  119. package/dist/cli/update-EWOLMH3E.js +37 -0
  120. package/dist/cli/{update-4H3GBUVU.mjs → update-VHTKWNXO.mjs} +9 -9
  121. package/dist/cli/{views-CEGJLVO7.js → views-DVBO3L63.js} +21 -21
  122. package/dist/cli/{views-O2V4FIII.mjs → views-GCNEHB7D.mjs} +6 -6
  123. package/dist/cli/{workflow-SGWK2I2Z.mjs → workflow-R3A6EGB5.mjs} +7 -7
  124. package/dist/cli/{workflow-EJNNNQOE.js → workflow-TFRJ5JKX.js} +17 -17
  125. package/dist/{client-B5cSKEi4.d.mts → client-ClJlqkKt.d.mts} +1 -1
  126. package/dist/{client-vUZGmXT9.d.ts → client-DCnExziW.d.ts} +1 -1
  127. package/dist/{client-core-Deqov12F.d.ts → client-core-BKq5ZNAl.d.ts} +33 -2
  128. package/dist/{client-core-BP19BoBb.d.mts → client-core-DAOPQnGD.d.mts} +33 -2
  129. package/dist/index.d.mts +3 -3
  130. package/dist/index.d.ts +3 -3
  131. package/dist/index.js +9 -9
  132. package/dist/index.mjs +6 -6
  133. package/dist/install-integrity.json +118 -118
  134. package/dist/plays/play-description.d.mts +1 -1
  135. package/dist/plays/play-description.d.ts +1 -1
  136. package/dist/plays/run-request.d.mts +1 -1
  137. package/dist/plays/run-request.d.ts +1 -1
  138. package/dist/release.d.mts +1 -1
  139. package/dist/release.d.ts +1 -1
  140. package/dist/release.js +2 -2
  141. package/dist/release.mjs +1 -1
  142. package/dist/server.d.mts +2 -2
  143. package/dist/server.d.ts +2 -2
  144. package/dist/server.js +5 -5
  145. package/dist/server.mjs +3 -3
  146. package/package.json +1 -1
  147. package/dist/cli/auth-KI3KBLRD.js +0 -44
  148. package/dist/cli/concurrent-runs-help-7SA3A2K5.js +0 -22
  149. package/dist/cli/describe-R7QLYW6K.js +0 -50
  150. package/dist/cli/git-TIF77U5E.js +0 -26
  151. package/dist/cli/search-BJFP7VHT.js +0 -32
  152. package/dist/cli/sessions-HCKHUILD.js +0 -23
  153. package/dist/cli/skills-TZC2JNIZ.js +0 -37
  154. package/dist/cli/tools-ECUMBLZB.js +0 -57
  155. package/dist/cli/update-4AAEZJ64.js +0 -37
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  DeeplineClient
3
- } from "./chunk-3GRMC25W.mjs";
3
+ } from "./chunk-6D4WBX7E.mjs";
4
4
  import {
5
5
  HttpClient,
6
6
  resolveConfig
7
- } from "./chunk-ZPD6SPP2.mjs";
7
+ } from "./chunk-D3BJ2KZX.mjs";
8
8
 
9
9
  // src/client.ts
10
10
  var DeeplineClient2 = class extends DeeplineClient {
@@ -1,6 +1,6 @@
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; }
2
2
 
3
- var _chunkOPGDVTAQjs = require('./chunk-OPGDVTAQ.js');
3
+ var _chunkH3SQMLHOjs = require('./chunk-H3SQMLHO.js');
4
4
 
5
5
  // src/cli/npm-script-policy.ts
6
6
  var _child_process = require('child_process');
@@ -13,7 +13,7 @@ function npmSupportsAllowScripts(version) {
13
13
  }
14
14
  function readNpmVersion(env) {
15
15
  try {
16
- const plan = _chunkOPGDVTAQjs.resolveShellSpawn.call(void 0, "npm", ["--version"], process.platform, env);
16
+ const plan = _chunkH3SQMLHOjs.resolveShellSpawn.call(void 0, "npm", ["--version"], process.platform, env);
17
17
  const result = _child_process.spawnSync.call(void 0, plan.command, plan.args, {
18
18
  windowsHide: true,
19
19
  encoding: "utf8",
@@ -1001,6 +1001,13 @@ Input:
1001
1001
  names in the error.
1002
1002
  --oauth prints an authorization URL. Open it in a browser signed into the
1003
1003
  same Deepline org and finish provider consent.
1004
+ Credentials and OAuth write the selected workspace's own connection when a
1005
+ workspace is selected (global --workspace, DEEPLINE_WORKSPACE_ID, or the one
1006
+ saved with deepline org workspace set); other workspaces keep theirs. With
1007
+ no workspace selected they write the org default, which every workspace
1008
+ without its own connection uses. --org-default writes the org default even
1009
+ when a workspace is selected. --managed keys are org-wide, so inside a
1010
+ selected workspace --managed requires --org-default.
1004
1011
  HubSpot: --preset read-crm, update-crm, marketing, sales-sequences, tickets, or all.
1005
1012
  all requests every supported capability, including write and admin access.
1006
1013
  For custom access use comma-separated --scopes and --optional-scopes instead
@@ -1010,9 +1017,12 @@ Input:
1010
1017
  Output:
1011
1018
  Link: dashboard URL, or {provider, connect_url} with --json. Share connect_url
1012
1019
  with the org owner or admin who will finish setup in the browser.
1013
- Credentials: confirmation without secret values.
1014
- OAuth: URL, or {provider, redirect_url} with --json. This does not confirm a
1015
- completed connection. The browser must finish authorization.
1020
+ Credentials: confirmation naming the workspace written, without secret
1021
+ values; {provider, credential_saved, team_id} with --json (team_id null is
1022
+ the org default).
1023
+ OAuth: URL and the workspace it connects, or {provider, redirect_url,
1024
+ team_id} with --json. This does not confirm a completed connection. The
1025
+ browser must finish authorization.
1016
1026
  --dry-run prints the proposed setup without starting OAuth, reading secret
1017
1027
  file contents, or saving credentials.
1018
1028
  Cost:
@@ -1020,7 +1030,10 @@ Cost:
1020
1030
  Examples:
1021
1031
  deepline integrations connect hubspot --link --json
1022
1032
  deepline integrations connect heyreach --credentials-file ./heyreach.json
1033
+ deepline --workspace <workspace-id> integrations connect heyreach --credentials-file ./heyreach.json
1034
+ deepline integrations connect heyreach --credentials-file ./heyreach.json --org-default
1023
1035
  deepline integrations connect hubspot --oauth --preset read-crm
1036
+ deepline integrations connect lusha --managed --accept-terms 2026-05-01 --company-domain acme.com --company-legal-name "Acme Inc." --company-country US
1024
1037
  `
1025
1038
  },
1026
1039
  "tools grep": {
@@ -37,7 +37,7 @@ import {
37
37
  RETAINED_PIPELINE_RECEIVERS_HEADER,
38
38
  RUNTIME_ENVIRONMENT_TOKEN_HEADER,
39
39
  SDK_API_MAJOR
40
- } from "./chunk-OD4LINNE.mjs";
40
+ } from "./chunk-IEOIGU5A.mjs";
41
41
  import {
42
42
  CustomerDbQueryOutcomeUnknownError
43
43
  } from "./chunk-ASB47RXJ.mjs";
@@ -6005,12 +6005,35 @@ var DeeplineClient = class _DeeplineClient {
6005
6005
  const params = new URLSearchParams({ provider });
6006
6006
  return this.http.get(`/api/v2/integrations/connect?${params}`);
6007
6007
  }
6008
- /** Save provider-owned credential fields without starting an OAuth browser flow. */
6008
+ /**
6009
+ * Save provider-owned credential fields without starting an OAuth browser flow.
6010
+ * `teamId` names a workspace whose own connection this saves; absent or null
6011
+ * saves the org default every workspace without its own connection uses.
6012
+ */
6009
6013
  async setIntegrationCredentials(provider, credentials, options) {
6010
6014
  return this.http.post("/api/v2/integrations/connect", {
6011
6015
  provider,
6012
6016
  credentials,
6013
- ...options?.expectedConnectionId ? { expected_connection_id: options.expectedConnectionId } : {}
6017
+ ...options?.expectedConnectionId ? { expected_connection_id: options.expectedConnectionId } : {},
6018
+ ...options?.teamId ? { team_id: options.teamId } : {}
6019
+ });
6020
+ }
6021
+ /**
6022
+ * Connect a provider with a Deepline-managed key (Lusha). Deepline creates
6023
+ * the key and bills usage through Deepline credits; the key is never
6024
+ * returned. `termsVersion` records which provider terms the caller accepted.
6025
+ */
6026
+ async connectManagedIntegration(provider, input) {
6027
+ return this.http.post("/api/v2/integrations/connect", {
6028
+ provider,
6029
+ credential_mode: "partner_managed",
6030
+ accept_terms: input.termsVersion !== void 0,
6031
+ ...input.termsVersion !== void 0 ? { terms_version: input.termsVersion } : {},
6032
+ company: {
6033
+ domain: input.company.domain,
6034
+ legal_name: input.company.legalName,
6035
+ country: input.company.country
6036
+ }
6014
6037
  });
6015
6038
  }
6016
6039
  /** Calendar discovery compatibility method. The managed pilot requires calendar IDs in tool and Play inputs. */
@@ -6021,7 +6044,11 @@ var DeeplineClient = class _DeeplineClient {
6021
6044
  `/api/v2/integrations/calendar-availability/calendars?${params}`
6022
6045
  );
6023
6046
  }
6024
- /** Start provider OAuth and return the URL to open in a browser. */
6047
+ /**
6048
+ * Start provider OAuth and return the URL to open in a browser. `teamId`
6049
+ * names a workspace whose own connection the grant saves; absent or null
6050
+ * connects the org default.
6051
+ */
6025
6052
  async startIntegrationOAuth(provider, options = {}) {
6026
6053
  const scopes = options.scopes?.map((scope) => scope.trim()).filter(Boolean);
6027
6054
  if (scopes !== void 0 && scopes.length === 0) {
@@ -6031,7 +6058,8 @@ var DeeplineClient = class _DeeplineClient {
6031
6058
  provider,
6032
6059
  ...options.preset !== void 0 ? { preset: options.preset } : {},
6033
6060
  ...scopes !== void 0 ? { scopes } : {},
6034
- ...options.optionalScopes !== void 0 ? { optional_scopes: options.optionalScopes } : {}
6061
+ ...options.optionalScopes !== void 0 ? { optional_scopes: options.optionalScopes } : {},
6062
+ ...options.teamId ? { team_id: options.teamId } : {}
6035
6063
  });
6036
6064
  }
6037
6065
  /** Start the Slack OAuth flow required by product notifications. */
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  PlayClient
3
- } from "./chunk-3GRMC25W.mjs";
3
+ } from "./chunk-6D4WBX7E.mjs";
4
4
  import {
5
5
  HttpClient,
6
6
  resolveConfig
7
- } from "./chunk-ZPD6SPP2.mjs";
7
+ } from "./chunk-D3BJ2KZX.mjs";
8
8
 
9
9
  // src/plays/local-play-execution.ts
10
10
  function importedNodes(graph) {
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  traceCliSpan
3
- } from "./chunk-4ACBVZ44.mjs";
3
+ } from "./chunk-JXRWSBJZ.mjs";
4
4
  import {
5
5
  enforceSdkCompatibilityResponse,
6
6
  flushDeferredSkillsSyncNotices,
7
7
  requireSdkCompatibility
8
- } from "./chunk-AUXDJJYK.mjs";
8
+ } from "./chunk-YTYDKSK7.mjs";
9
9
 
10
10
  // src/cli/play-run-admission.ts
11
11
  function usesInlinePlayAdmission(command, args) {
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunkLTJQCMEMjs = require('./chunk-LTJQCMEM.js');
3
+ var _chunkFSAOU4HAjs = require('./chunk-FSAOU4HA.js');
4
4
 
5
5
  // src/cli/maintenance-policy.ts
6
6
  var _commander = require('commander');
@@ -33,7 +33,7 @@ function recordCliTrace(event) {
33
33
  sinceStartMs: now - cliTraceStartedAt,
34
34
  ...event
35
35
  };
36
- _chunkLTJQCMEMjs.writeRawStderr.call(void 0, `[cli-trace] ${JSON.stringify(payload)}
36
+ _chunkFSAOU4HAjs.writeRawStderr.call(void 0, `[cli-trace] ${JSON.stringify(payload)}
37
37
  `);
38
38
  }
39
39
  async function traceCliSpan(phase, fields, run) {
@@ -4,22 +4,22 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkKHZVZOJFjs = require('./chunk-KHZVZOJF.js');
7
+ var _chunkMIGJHZ3Pjs = require('./chunk-MIGJHZ3P.js');
8
8
 
9
9
 
10
10
 
11
11
 
12
- var _chunkOPGDVTAQjs = require('./chunk-OPGDVTAQ.js');
12
+ var _chunkH3SQMLHOjs = require('./chunk-H3SQMLHO.js');
13
13
 
14
14
 
15
15
 
16
- var _chunkLTJQCMEMjs = require('./chunk-LTJQCMEM.js');
16
+ var _chunkFSAOU4HAjs = require('./chunk-FSAOU4HA.js');
17
17
 
18
18
 
19
- var _chunkCR7U44AWjs = require('./chunk-CR7U44AW.js');
19
+ var _chunkWVS2ITKPjs = require('./chunk-WVS2ITKP.js');
20
20
 
21
21
 
22
- var _chunk3E2C6CIEjs = require('./chunk-3E2C6CIE.js');
22
+ var _chunkH7DRZXYFjs = require('./chunk-H7DRZXYF.js');
23
23
 
24
24
  // src/cli/compatibility-catalog.ts
25
25
  var readers = /* @__PURE__ */ new WeakMap();
@@ -46,7 +46,7 @@ function trustedAutoUpdateRegistryUrl(baseUrl) {
46
46
  async function reportAutoUpdateEvent(input) {
47
47
  let apiKey = "";
48
48
  try {
49
- apiKey = _chunkCR7U44AWjs.resolveApiKeyForBaseUrl.call(void 0, input.baseUrl);
49
+ apiKey = _chunkWVS2ITKPjs.resolveApiKeyForBaseUrl.call(void 0, input.baseUrl);
50
50
  } catch (e2) {
51
51
  return;
52
52
  }
@@ -62,15 +62,15 @@ async function reportAutoUpdateEvent(input) {
62
62
  headers: {
63
63
  Authorization: `Bearer ${apiKey}`,
64
64
  "Content-Type": "application/json",
65
- "User-Agent": `deepline-ts-sdk/${_chunk3E2C6CIEjs.SDK_VERSION}`,
65
+ "User-Agent": `deepline-ts-sdk/${_chunkH7DRZXYFjs.SDK_VERSION}`,
66
66
  "X-Deepline-Client-Family": "sdk",
67
67
  "X-Deepline-CLI-Family": "sdk",
68
- "X-Deepline-CLI-Version": _chunk3E2C6CIEjs.SDK_VERSION,
69
- "X-Deepline-SDK-Version": _chunk3E2C6CIEjs.SDK_VERSION
68
+ "X-Deepline-CLI-Version": _chunkH7DRZXYFjs.SDK_VERSION,
69
+ "X-Deepline-SDK-Version": _chunkH7DRZXYFjs.SDK_VERSION
70
70
  },
71
71
  body: JSON.stringify({
72
72
  event: input.event,
73
- current_version: _optionalChain([input, 'access', _4 => _4.response, 'access', _5 => _5.current, 'optionalAccess', _6 => _6.trim, 'call', _7 => _7()]) || _chunk3E2C6CIEjs.SDK_VERSION,
73
+ current_version: _optionalChain([input, 'access', _4 => _4.response, 'access', _5 => _5.current, 'optionalAccess', _6 => _6.trim, 'call', _7 => _7()]) || _chunkH7DRZXYFjs.SDK_VERSION,
74
74
  target_version: input.response.latest,
75
75
  reason: _optionalChain([input, 'access', _8 => _8.response, 'access', _9 => _9.auto_update, 'optionalAccess', _10 => _10.reason]),
76
76
  command: _nullishCoalesce(input.response.command, () => ( null)),
@@ -89,19 +89,19 @@ function envTruthy(name) {
89
89
  return value === "1" || value === "true" || value === "yes";
90
90
  }
91
91
  function shouldSkipSelfUpdate(policy) {
92
- return policy === "off" || envTruthy("DEEPLINE_SKIP_SELF_UPDATE") || envTruthy("DEEPLINE_NO_AUTO_UPDATE") || envTruthy("DEEPLINE_SKIP_SDK_AUTO_UPDATE") || envTruthy("DEEPLINE_DISABLE_AUTO_UPDATE") || !_chunkKHZVZOJFjs.shouldRunCliAutoUpdate.call(void 0, ) || _chunkOPGDVTAQjs.isCiEnvironment.call(void 0, );
92
+ return policy === "off" || envTruthy("DEEPLINE_SKIP_SELF_UPDATE") || envTruthy("DEEPLINE_NO_AUTO_UPDATE") || envTruthy("DEEPLINE_SKIP_SDK_AUTO_UPDATE") || envTruthy("DEEPLINE_DISABLE_AUTO_UPDATE") || !_chunkMIGJHZ3Pjs.shouldRunCliAutoUpdate.call(void 0, ) || _chunkH3SQMLHOjs.isCiEnvironment.call(void 0, );
93
93
  }
94
94
  function isDowngradeAutoUpdateResponse(response) {
95
95
  const target = _optionalChain([response, 'optionalAccess', _17 => _17.latest, 'optionalAccess', _18 => _18.trim, 'call', _19 => _19()]);
96
- const current = _optionalChain([response, 'optionalAccess', _20 => _20.current, 'optionalAccess', _21 => _21.trim, 'call', _22 => _22()]) || _chunk3E2C6CIEjs.SDK_VERSION;
96
+ const current = _optionalChain([response, 'optionalAccess', _20 => _20.current, 'optionalAccess', _21 => _21.trim, 'call', _22 => _22()]) || _chunkH7DRZXYFjs.SDK_VERSION;
97
97
  if (!target) return false;
98
- return _chunkKHZVZOJFjs.compareUpdateVersions.call(void 0, target, current) < 0;
98
+ return _chunkMIGJHZ3Pjs.compareUpdateVersions.call(void 0, target, current) < 0;
99
99
  }
100
100
  function relaunchCurrentCommand(plan, runtime = {}) {
101
101
  return new Promise((resolve) => {
102
102
  const argv = _nullishCoalesce(runtime.argv, () => ( process.argv));
103
103
  const platform = _nullishCoalesce(runtime.platform, () => ( process.platform));
104
- const launch = plan.kind === "python-sidecar" ? _chunkOPGDVTAQjs.resolveShellSpawn.call(void 0, plan.sidecarPath, argv.slice(2), platform) : {
104
+ const launch = plan.kind === "python-sidecar" ? _chunkH3SQMLHOjs.resolveShellSpawn.call(void 0, plan.sidecarPath, argv.slice(2), platform) : {
105
105
  command: _nullishCoalesce(runtime.execPath, () => ( process.execPath)),
106
106
  args: argv.slice(1),
107
107
  shell: false
@@ -148,7 +148,7 @@ async function maybeAutoUpdateAndRelaunch(response, baseUrl, policy = "configure
148
148
  }
149
149
  if (isDowngradeAutoUpdateResponse(response)) {
150
150
  const target = response.latest;
151
- const current = _optionalChain([response, 'access', _26 => _26.current, 'optionalAccess', _27 => _27.trim, 'call', _28 => _28()]) || _chunk3E2C6CIEjs.SDK_VERSION;
151
+ const current = _optionalChain([response, 'access', _26 => _26.current, 'optionalAccess', _27 => _27.trim, 'call', _28 => _28()]) || _chunkH7DRZXYFjs.SDK_VERSION;
152
152
  process.stderr.write(
153
153
  `Deepline SDK/CLI auto-update refused: server advertised older ${target} than current ${current}. Continuing without mutating the CLI.
154
154
  `
@@ -156,21 +156,21 @@ async function maybeAutoUpdateAndRelaunch(response, baseUrl, policy = "configure
156
156
  return false;
157
157
  }
158
158
  const packageSpec = response.latest ? `deepline@${response.latest}` : void 0;
159
- const plan = _chunkKHZVZOJFjs.resolveUpdatePlan.call(void 0, {
159
+ const plan = _chunkMIGJHZ3Pjs.resolveUpdatePlan.call(void 0, {
160
160
  packageSpec,
161
161
  requireVerifiedNpmOwnership: true,
162
162
  npmFallbackRegistryUrl: trustedAutoUpdateRegistryUrl(baseUrl)
163
163
  });
164
- if (!_chunkKHZVZOJFjs.canAutomaticallyApplyUpdatePlan.call(void 0, plan)) {
164
+ if (!_chunkMIGJHZ3Pjs.canAutomaticallyApplyUpdatePlan.call(void 0, plan)) {
165
165
  return false;
166
166
  }
167
167
  if (!autoUpdate.required && autoUpdate.reason !== "rollback_forced") {
168
168
  deferredAutoUpdate = async () => {
169
169
  await applyAutoUpdate(response, baseUrl, plan, "next_command");
170
170
  };
171
- if (_chunkLTJQCMEMjs.isJsonOutputMode.call(void 0, )) {
171
+ if (_chunkFSAOU4HAjs.isJsonOutputMode.call(void 0, )) {
172
172
  const target = _optionalChain([response, 'access', _29 => _29.latest, 'optionalAccess', _30 => _30.trim, 'call', _31 => _31()]);
173
- _chunkLTJQCMEMjs.addJsonNotice.call(void 0, {
173
+ _chunkFSAOU4HAjs.addJsonNotice.call(void 0, {
174
174
  code: "sdk_update_queued",
175
175
  message: `Deepline SDK/CLI update${target ? ` to ${target}` : ""} is queued after this command; the next command will use it if installation succeeds.`
176
176
  });
@@ -183,7 +183,7 @@ async function maybeAutoUpdateAndRelaunch(response, baseUrl, policy = "configure
183
183
  return true;
184
184
  }
185
185
  async function applyAutoUpdate(response, baseUrl, plan, takesEffect) {
186
- if (!_chunkKHZVZOJFjs.canAutomaticallyApplyUpdatePlan.call(void 0, plan)) return false;
186
+ if (!_chunkMIGJHZ3Pjs.canAutomaticallyApplyUpdatePlan.call(void 0, plan)) return false;
187
187
  const autoUpdate = response.auto_update;
188
188
  const label = _optionalChain([autoUpdate, 'optionalAccess', _32 => _32.reason]) === "rollback_forced" ? "has a server rollback pending and needs the latest rollback-aware CLI" : _optionalChain([autoUpdate, 'optionalAccess', _33 => _33.reason]) === "deprecated" ? "is deprecated and will update automatically" : _optionalChain([autoUpdate, 'optionalAccess', _34 => _34.required]) ? "requires an update" : "has an update available and will update automatically";
189
189
  process.stderr.write(
@@ -196,7 +196,7 @@ async function applyAutoUpdate(response, baseUrl, plan, takesEffect) {
196
196
  event: "started",
197
197
  installKind: plan.kind
198
198
  });
199
- const updateResult = await _chunkKHZVZOJFjs.runAutomaticUpdatePlan.call(void 0, plan);
199
+ const updateResult = await _chunkMIGJHZ3Pjs.runAutomaticUpdatePlan.call(void 0, plan);
200
200
  if (updateResult.status === "skipped_previous_failure") {
201
201
  void reportAutoUpdateEvent({
202
202
  baseUrl,
@@ -234,7 +234,7 @@ async function applyAutoUpdate(response, baseUrl, plan, takesEffect) {
234
234
  exitCode: 0
235
235
  });
236
236
  try {
237
- await _chunkOPGDVTAQjs.syncSdkSkillsIfNeeded.call(void 0, baseUrl, {
237
+ await _chunkH3SQMLHOjs.syncSdkSkillsIfNeeded.call(void 0, baseUrl, {
238
238
  mode: "detached",
239
239
  update: _optionalChain([response, 'access', _36 => _36.skills, 'optionalAccess', _37 => _37.requires_cli_update]) ? void 0 : response.skills,
240
240
  afterCliUpdate: {
@@ -261,7 +261,7 @@ var _crypto = require('crypto');
261
261
  var TOOL_EXECUTE_PROGRESS_INTERVAL_MS = 15e3;
262
262
  var activeToolExecuteCommand = null;
263
263
  function progressLine(line) {
264
- if (!_chunkLTJQCMEMjs.isJsonOutputMode.call(void 0, )) console.error(line);
264
+ if (!_chunkFSAOU4HAjs.isJsonOutputMode.call(void 0, )) console.error(line);
265
265
  }
266
266
  function beginToolExecuteCommand() {
267
267
  if (activeToolExecuteCommand) return activeToolExecuteCommand.invocationId;
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  rejectRestrictedFeedback
3
- } from "./chunk-RSQ6AVH3.mjs";
3
+ } from "./chunk-CK6U2NH2.mjs";
4
4
  import {
5
5
  getAuthedHttpClient,
6
6
  printCommandEnvelope
7
- } from "./chunk-3TJKNRHY.mjs";
7
+ } from "./chunk-P2LVKWU6.mjs";
8
8
  import {
9
9
  agentSessionIdFromEnvironment,
10
10
  claudeProjectsRoots,
11
11
  coworkTranscriptFromEnvironment
12
- } from "./chunk-OD4LINNE.mjs";
12
+ } from "./chunk-IEOIGU5A.mjs";
13
13
 
14
14
  // src/cli/commands/sessions.ts
15
15
  import {
@@ -1,9 +1,12 @@
1
1
  import {
2
2
  DeeplineClient
3
- } from "./chunk-GWKHJ6BN.mjs";
3
+ } from "./chunk-45OTCUAC.mjs";
4
4
  import {
5
5
  printCommandEnvelope
6
- } from "./chunk-3TJKNRHY.mjs";
6
+ } from "./chunk-P2LVKWU6.mjs";
7
+ import {
8
+ resolveConfig
9
+ } from "./chunk-D3BJ2KZX.mjs";
7
10
 
8
11
  // src/cli/commands/integration-commands.ts
9
12
  import { Option } from "commander";
@@ -312,12 +315,29 @@ function registerIntegrationConnectCommand(parent, defaultLink = false, hidden =
312
315
  "preset",
313
316
  "scopes",
314
317
  "optionalScopes",
315
- "expectedConnectionId"
318
+ "expectedConnectionId",
319
+ "managed"
316
320
  ])
321
+ ).addOption(
322
+ new Option(
323
+ "--managed",
324
+ "Connect with a Deepline-managed key instead of your own (Lusha)"
325
+ ).conflicts(["credentialsFile", "oauth"])
326
+ ).option(
327
+ "--accept-terms <version>",
328
+ "With --managed: accept this version of the provider's terms"
329
+ ).option("--company-domain <domain>", "With --managed: company domain").option("--company-legal-name <name>", "With --managed: company legal name").option(
330
+ "--company-country <code>",
331
+ "With --managed: two-letter ISO country code"
317
332
  ).option(
318
333
  "--credentials-file <path>",
319
334
  "JSON object of credential field names and string values; keep this file private"
320
- ).option("--oauth", "Return an OAuth authorization URL").addOption(new Option("--expected-connection-id <id>").hideHelp()).option("--preset <id>", "Server-defined access preset (HubSpot only)").option("--scopes <scopes>", "Comma-separated OAuth scopes").option(
335
+ ).option("--oauth", "Return an OAuth authorization URL").addOption(
336
+ new Option(
337
+ "--org-default",
338
+ "Write the org default even when a workspace is selected"
339
+ ).conflicts(["link"])
340
+ ).addOption(new Option("--expected-connection-id <id>").hideHelp()).option("--preset <id>", "Server-defined access preset (HubSpot only)").option("--scopes <scopes>", "Comma-separated OAuth scopes").option(
321
341
  "--optional-scopes <scopes>",
322
342
  "Comma-separated optional OAuth scopes"
323
343
  ).option(
@@ -325,6 +345,60 @@ function registerIntegrationConnectCommand(parent, defaultLink = false, hidden =
325
345
  "Print the proposed setup without saving credentials or starting OAuth"
326
346
  ).option("--json", "Print JSON without credential values").action(
327
347
  async (provider, options) => {
348
+ const managedOnlyOptionSet = options.acceptTerms !== void 0 || options.companyDomain !== void 0 || options.companyLegalName !== void 0 || options.companyCountry !== void 0;
349
+ if (managedOnlyOptionSet && !options.managed) {
350
+ throw new Error(
351
+ "--accept-terms and --company-* options require --managed."
352
+ );
353
+ }
354
+ if (options.managed) {
355
+ if (!options.companyDomain || !options.companyLegalName || !options.companyCountry) {
356
+ throw new Error(
357
+ "--managed requires --company-domain, --company-legal-name and --company-country."
358
+ );
359
+ }
360
+ const teamId2 = connectTeamId(options.orgDefault);
361
+ refuseManagedWorkspaceConnect(provider, teamId2);
362
+ if (options.dryRun) {
363
+ printSetupPlan(
364
+ {
365
+ provider,
366
+ action: "connect_managed",
367
+ team_id: teamId2,
368
+ terms_version: options.acceptTerms ?? "not accepted",
369
+ company_domain: options.companyDomain
370
+ },
371
+ options.json
372
+ );
373
+ return;
374
+ }
375
+ const result2 = await new DeeplineClient().connectManagedIntegration(
376
+ provider,
377
+ {
378
+ termsVersion: options.acceptTerms,
379
+ company: {
380
+ domain: options.companyDomain,
381
+ legalName: options.companyLegalName,
382
+ country: options.companyCountry
383
+ }
384
+ }
385
+ );
386
+ if (!result2.ok || result2.credential_saved !== true) {
387
+ throw new Error(
388
+ "The API did not confirm the managed connection. Inspect the integration before retrying."
389
+ );
390
+ }
391
+ const confirmation2 = {
392
+ provider,
393
+ credential_saved: true,
394
+ credential_mode: "partner_managed",
395
+ team_id: teamId2
396
+ };
397
+ printIntegrationResult(confirmation2, options.json, [
398
+ `${provider} is connected with a Deepline-managed key for ${describeConnectTarget(teamId2)}. Usage is billed in Deepline credits.`
399
+ ]);
400
+ return;
401
+ }
328
402
  if (options.expectedConnectionId !== void 0 && (!options.expectedConnectionId.trim() || provider !== "google_calendar_availability" || !options.credentialsFile || options.oauth)) {
329
403
  throw new Error(
330
404
  "--expected-connection-id requires Calendar availability and a credentials file."
@@ -349,11 +423,14 @@ function registerIntegrationConnectCommand(parent, defaultLink = false, hidden =
349
423
  const splitScopes = (value) => value.split(",").map((scope) => scope.trim()).filter(Boolean);
350
424
  if (options.scopes !== void 0 && splitScopes(options.scopes).length === 0)
351
425
  throw new Error("scopes must contain at least one OAuth scope.");
426
+ const teamId2 = connectTeamId(options.orgDefault);
427
+ refuseMetaWorkspaceConnect(provider, teamId2);
352
428
  if (options.dryRun) {
353
429
  printSetupPlan(
354
430
  {
355
431
  provider,
356
432
  action: "oauth",
433
+ team_id: teamId2,
357
434
  ...options.preset !== void 0 ? { preset: options.preset } : {},
358
435
  ...options.scopes !== void 0 ? { scopes: splitScopes(options.scopes) } : {},
359
436
  ...options.optionalScopes !== void 0 ? { optionalScopes: splitScopes(options.optionalScopes) } : {}
@@ -367,17 +444,26 @@ function registerIntegrationConnectCommand(parent, defaultLink = false, hidden =
367
444
  {
368
445
  ...options.preset !== void 0 ? { preset: options.preset } : {},
369
446
  ...options.scopes !== void 0 ? { scopes: splitScopes(options.scopes) } : {},
370
- ...options.optionalScopes !== void 0 ? { optionalScopes: splitScopes(options.optionalScopes) } : {}
447
+ ...options.optionalScopes !== void 0 ? { optionalScopes: splitScopes(options.optionalScopes) } : {},
448
+ teamId: teamId2
371
449
  }
372
450
  );
451
+ const confirmed2 = assertConnectTarget(result2, teamId2);
373
452
  if (!result2.ok || typeof result2.redirect_url !== "string" || !result2.redirect_url)
374
453
  throw new Error(
375
454
  "The API did not return an OAuth authorization URL."
376
455
  );
377
456
  printIntegrationResult(
378
- { provider, redirect_url: result2.redirect_url },
457
+ { provider, redirect_url: result2.redirect_url, team_id: teamId2 },
379
458
  options.json,
380
- [result2.redirect_url]
459
+ [
460
+ result2.redirect_url,
461
+ connectTargetLine(
462
+ `This connects ${provider} for`,
463
+ teamId2,
464
+ confirmed2
465
+ )
466
+ ]
381
467
  );
382
468
  return;
383
469
  }
@@ -385,11 +471,14 @@ function registerIntegrationConnectCommand(parent, defaultLink = false, hidden =
385
471
  throw new Error(
386
472
  "Use --link for a dashboard link, --credentials-file to save credentials, or --oauth to request access."
387
473
  );
474
+ const teamId = connectTeamId(options.orgDefault);
475
+ refuseMetaWorkspaceConnect(provider, teamId);
388
476
  if (options.dryRun) {
389
477
  printSetupPlan(
390
478
  {
391
479
  provider,
392
480
  action: "save_credentials",
481
+ team_id: teamId,
393
482
  credentials_file: options.credentialsFile,
394
483
  ...options.expectedConnectionId ? { expected_connection_id: options.expectedConnectionId } : {}
395
484
  },
@@ -415,20 +504,66 @@ function registerIntegrationConnectCommand(parent, defaultLink = false, hidden =
415
504
  const result = await new DeeplineClient().setIntegrationCredentials(
416
505
  provider,
417
506
  credentials,
418
- { expectedConnectionId: options.expectedConnectionId }
507
+ { expectedConnectionId: options.expectedConnectionId, teamId }
419
508
  );
420
509
  if (!result.ok || result.credential_saved !== true) {
421
510
  throw new Error(
422
511
  "The API did not confirm that provider credentials were saved. Inspect the integration before retrying."
423
512
  );
424
513
  }
425
- const confirmation = { provider, credential_saved: true };
514
+ const confirmed = assertConnectTarget(result, teamId);
515
+ const confirmation = {
516
+ provider,
517
+ credential_saved: true,
518
+ team_id: teamId
519
+ };
426
520
  printIntegrationResult(confirmation, options.json, [
427
- `Credentials saved for ${provider} in the active org.`
521
+ connectTargetLine(
522
+ `Credentials saved for ${provider} in`,
523
+ teamId,
524
+ confirmed
525
+ )
428
526
  ]);
429
527
  }
430
528
  );
431
529
  }
530
+ function connectTeamId(orgDefault) {
531
+ if (orgDefault) return null;
532
+ try {
533
+ return resolveConfig().workspace ?? null;
534
+ } catch {
535
+ return process.env.DEEPLINE_WORKSPACE_ID?.trim() || null;
536
+ }
537
+ }
538
+ function describeConnectTarget(teamId) {
539
+ return teamId ? `workspace ${teamId} (its own connection; other workspaces are unchanged)` : "the org default (used by every workspace without its own connection)";
540
+ }
541
+ function assertConnectTarget(result, teamId) {
542
+ if (!("team_id" in result)) return false;
543
+ if ((result.team_id ?? null) !== teamId) {
544
+ throw new Error(
545
+ `The API wrote ${describeConnectTarget(result.team_id ?? null)}, not ${describeConnectTarget(teamId)}. Inspect the integration before retrying.`
546
+ );
547
+ }
548
+ return true;
549
+ }
550
+ function connectTargetLine(prefix, teamId, confirmed) {
551
+ if (confirmed) return `${prefix} ${describeConnectTarget(teamId)}.`;
552
+ const requested = teamId ? `workspace ${teamId}` : "the org default";
553
+ return `${prefix} ${requested} (requested; this server did not confirm the target).`;
554
+ }
555
+ function refuseMetaWorkspaceConnect(provider, teamId) {
556
+ if (provider !== "meta_audiences" || !teamId) return;
557
+ throw new Error(
558
+ `Meta Audiences connects workspace ${teamId} with a system user token: run \`deepline org workspaces integrations set ${teamId} meta_audiences --api-key-stdin\`, or pass --org-default to connect the org default.`
559
+ );
560
+ }
561
+ function refuseManagedWorkspaceConnect(provider, teamId) {
562
+ if (!teamId) return;
563
+ throw new Error(
564
+ `A Deepline-managed ${provider} key is set up for the whole org, not workspace ${teamId}. Pass --org-default to connect the org default, or --credentials-file to give this workspace its own key.`
565
+ );
566
+ }
432
567
  function printSetupPlan(plan, json) {
433
568
  printIntegrationResult(
434
569
  plan,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveShellSpawn
3
- } from "./chunk-AUXDJJYK.mjs";
3
+ } from "./chunk-YTYDKSK7.mjs";
4
4
 
5
5
  // src/cli/npm-script-policy.ts
6
6
  import { spawnSync } from "child_process";
@@ -1,6 +1,6 @@
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; } var _class;
2
2
 
3
- var _chunkLTJQCMEMjs = require('./chunk-LTJQCMEM.js');
3
+ var _chunkFSAOU4HAjs = require('./chunk-FSAOU4HA.js');
4
4
 
5
5
  // src/cli/progress.ts
6
6
  var _worker_threads = require('worker_threads');
@@ -19,7 +19,7 @@ var CliProgress = (_class = class {
19
19
  __init9() {this.quiet = false}
20
20
  // --json output is one JSON document: progress never renders under it.
21
21
  constructor(enabled) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);_class.prototype.__init8.call(this);_class.prototype.__init9.call(this);
22
- this.enabled = enabled && !_chunkLTJQCMEMjs.isJsonOutputMode.call(void 0, );
22
+ this.enabled = enabled && !_chunkFSAOU4HAjs.isJsonOutputMode.call(void 0, );
23
23
  }
24
24
  setLogWriter(writer) {
25
25
  this.logWriter = writer;
@@ -59,7 +59,7 @@ var CliProgress = (_class = class {
59
59
  this.logWriter(line);
60
60
  return;
61
61
  }
62
- if (_chunkLTJQCMEMjs.isJsonOutputMode.call(void 0, )) return;
62
+ if (_chunkFSAOU4HAjs.isJsonOutputMode.call(void 0, )) return;
63
63
  if (!this.enabled) {
64
64
  process.stderr.write(`${line}
65
65
  `);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  printCommandEnvelope
3
- } from "./chunk-3TJKNRHY.mjs";
3
+ } from "./chunk-P2LVKWU6.mjs";
4
4
 
5
5
  // src/cli/feedback-preferences.ts
6
6
  import {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  HttpClient,
3
3
  detectAgentRuntime
4
- } from "./chunk-OD4LINNE.mjs";
4
+ } from "./chunk-IEOIGU5A.mjs";
5
5
  import {
6
6
  ConfigError
7
7
  } from "./chunk-ASB47RXJ.mjs";