deepline 0.3.563 → 0.3.565

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 (161) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +51 -0
  2. package/dist/bundling-sources/sdk/src/connector-sync.ts +241 -0
  3. package/dist/bundling-sources/sdk/src/index.ts +10 -0
  4. package/dist/bundling-sources/sdk/src/integrations.ts +7 -0
  5. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  6. package/dist/bundling-sources/shared_libs/plays/extension-bridge.ts +8 -0
  7. package/dist/cli/auth-AN2KCWG2.js +44 -0
  8. package/dist/cli/{auth-3YES4ACM.mjs → auth-YKIUCQ2Q.mjs} +5 -5
  9. package/dist/cli/{billing-NZ2NCOQS.mjs → billing-HK23QHAA.mjs} +9 -9
  10. package/dist/cli/{billing-L2GDKBXK.js → billing-NIGAUQJF.js} +102 -102
  11. package/dist/cli/{chunk-UMJWODG7.mjs → chunk-2US3VJXX.mjs} +1 -1
  12. package/dist/cli/{chunk-HST5XA3B.mjs → chunk-4ENCU2BI.mjs} +2 -2
  13. package/dist/cli/{chunk-T2RNEBV7.js → chunk-4VKDPTHF.js} +4 -4
  14. package/dist/cli/{chunk-TX5PQ7KP.js → chunk-5HV2CNXA.js} +10 -10
  15. package/dist/cli/{chunk-V4KKZGLT.js → chunk-6HCJQ23O.js} +23 -23
  16. package/dist/cli/{chunk-JVXHVEWX.mjs → chunk-A3EI3A3Q.mjs} +5 -5
  17. package/dist/cli/{chunk-YDXFVE4V.mjs → chunk-AAOXS3XM.mjs} +152 -2
  18. package/dist/cli/{chunk-L5QJRMFJ.mjs → chunk-AH2CBDQJ.mjs} +2 -2
  19. package/dist/cli/{chunk-NCGDBNNF.mjs → chunk-B2FQZ7P4.mjs} +2 -2
  20. package/dist/cli/{chunk-QGIHGITM.js → chunk-B4FBMREO.js} +3 -3
  21. package/dist/cli/{chunk-UUEVGLGO.mjs → chunk-BCEXSQPK.mjs} +1 -1
  22. package/dist/cli/{chunk-VYY6HNOC.js → chunk-BDNVUPDX.js} +2 -2
  23. package/dist/cli/{search-output-FRRT574G.js → chunk-C5IA2OYE.js} +2 -199
  24. package/dist/cli/{chunk-K77ANXGU.js → chunk-E73BRM5N.js} +13 -13
  25. package/dist/cli/{chunk-MGOCWY7J.js → chunk-EPQIA32E.js} +100 -100
  26. package/dist/cli/{chunk-XWGWVLQQ.mjs → chunk-EXOC3TLA.mjs} +4 -4
  27. package/dist/cli/{chunk-BP2XRVBA.mjs → chunk-F4ZLUDKW.mjs} +5 -5
  28. package/dist/cli/{chunk-QOLFZD6Q.js → chunk-FEWBYUUF.js} +2 -2
  29. package/dist/cli/{chunk-ERT4ZMZT.js → chunk-FWH6QYTE.js} +5 -5
  30. package/dist/cli/{chunk-LIO7CPM3.js → chunk-FXRSHBRP.js} +159 -9
  31. package/dist/cli/{chunk-DA24O3ZV.js → chunk-GE62FFN6.js} +3 -3
  32. package/dist/cli/{chunk-RP2LCS7G.mjs → chunk-GTX2RMQG.mjs} +11 -11
  33. package/dist/cli/{chunk-G5CY6KI2.js → chunk-H3NH5RJ6.js} +41 -41
  34. package/dist/cli/{chunk-AYNDNXBJ.mjs → chunk-H4LHB6ES.mjs} +1 -1
  35. package/dist/cli/{chunk-XTSQ3ZV5.mjs → chunk-IFZA4IGI.mjs} +2 -2
  36. package/dist/cli/{chunk-NTRTFEI4.js → chunk-IKA37N6Y.js} +26 -26
  37. package/dist/cli/{chunk-U77PK5R3.js → chunk-J5QAOURJ.js} +20 -20
  38. package/dist/cli/{chunk-GVRVZQBY.mjs → chunk-JLXLCD6F.mjs} +2 -2
  39. package/dist/cli/{chunk-O3NLECXL.mjs → chunk-K6RPKBD7.mjs} +1 -1
  40. package/dist/cli/{chunk-VACBPVIR.mjs → chunk-KOMEYB7H.mjs} +104 -0
  41. package/dist/cli/{chunk-2MAP42AM.mjs → chunk-LHL6VWJE.mjs} +1 -1
  42. package/dist/cli/{chunk-XDZZCRUG.mjs → chunk-LKVWMLWI.mjs} +1 -1
  43. package/dist/cli/{chunk-K5FNC4VL.mjs → chunk-LOV5JGWO.mjs} +2 -2
  44. package/dist/cli/{search-output-O7FYSGYQ.mjs → chunk-MI5Q5FOD.mjs} +1 -198
  45. package/dist/cli/{chunk-IICHFEFE.js → chunk-NH3LVGVR.js} +5 -5
  46. package/dist/cli/{chunk-ZX3UZCWC.mjs → chunk-NOSGGCJ3.mjs} +1 -1
  47. package/dist/cli/{chunk-5CNHEUGJ.js → chunk-OEVCKW2M.js} +104 -0
  48. package/dist/cli/{chunk-SJ2LY4V5.js → chunk-OIDETCX2.js} +20 -20
  49. package/dist/cli/{chunk-H3UIWEXF.js → chunk-P6BVT2OW.js} +2 -2
  50. package/dist/cli/{chunk-QGNITJYC.js → chunk-PQEWFVJ3.js} +15 -15
  51. package/dist/cli/{chunk-L5O7MWRZ.mjs → chunk-RULYYQB4.mjs} +5 -5
  52. package/dist/cli/{chunk-6LPMQPSQ.mjs → chunk-SEWLXJHM.mjs} +2 -2
  53. package/dist/cli/{chunk-2UW5A57I.js → chunk-SL3IRGAW.js} +9 -9
  54. package/dist/cli/{chunk-FCRBXLIJ.js → chunk-TCJZQRX6.js} +12 -12
  55. package/dist/cli/{chunk-POGS26GF.mjs → chunk-U7F4ODVQ.mjs} +1 -1
  56. package/dist/cli/{chunk-6UHRBEDV.mjs → chunk-UTQ6LQWG.mjs} +3 -3
  57. package/dist/cli/{chunk-NS56OQUQ.js → chunk-UWMK5DLS.js} +1 -1
  58. package/dist/cli/{chunk-6U7CIG3C.mjs → chunk-V2TC2ARE.mjs} +4 -4
  59. package/dist/cli/{chunk-OZC6SSOB.js → chunk-WPVJV23H.js} +7 -7
  60. package/dist/cli/{chunk-DVWFK676.js → chunk-XNOUOO6G.js} +6 -6
  61. package/dist/cli/{chunk-XY5DE4TK.mjs → chunk-YD5BBYS2.mjs} +5 -5
  62. package/dist/cli/{chunk-H2N324LF.mjs → chunk-YGVLCJNY.mjs} +3 -3
  63. package/dist/cli/{chunk-DFCBNTVQ.mjs → chunk-YIKEVZUQ.mjs} +2 -2
  64. package/dist/cli/{chunk-4MPLA5RD.js → chunk-ZEKRYFMN.js} +48 -48
  65. package/dist/cli/{chunk-CH7OVBBJ.js → chunk-ZIKVPGYC.js} +5 -5
  66. package/dist/cli/{chunk-4KHRPJOW.js → chunk-ZTHMJ4SK.js} +53 -53
  67. package/dist/cli/command-docs.js +2 -2
  68. package/dist/cli/command-docs.mjs +1 -1
  69. package/dist/cli/concurrent-runs-help-SKAAESKY.js +22 -0
  70. package/dist/cli/{concurrent-runs-help-VEZX3RK4.mjs → concurrent-runs-help-WD2EUKO7.mjs} +6 -6
  71. package/dist/cli/{csv-RJBNLD23.mjs → csv-RM3FOTS5.mjs} +4 -4
  72. package/dist/cli/{csv-W5C4JCYL.js → csv-UI63ZOMD.js} +13 -13
  73. package/dist/cli/{db-VVGP2KCM.mjs → db-RIJBJCT7.mjs} +6 -6
  74. package/dist/cli/{db-GYCRUH4V.js → db-V5SWE3WN.js} +27 -27
  75. package/dist/cli/{describe-HZW272Y6.mjs → describe-HZC4GOLO.mjs} +18 -18
  76. package/dist/cli/describe-RRWLYUQS.js +50 -0
  77. package/dist/cli/describe-core.d.mts +2 -2
  78. package/dist/cli/describe-core.d.ts +2 -2
  79. package/dist/cli/{executions-D37NX6CD.js → executions-2Q23JJSI.js} +8 -8
  80. package/dist/cli/{executions-N4ZA4ZD5.mjs → executions-XRH267DY.mjs} +6 -6
  81. package/dist/cli/{feedback-W6CY6UBA.js → feedback-BEHH4KGB.js} +14 -14
  82. package/dist/cli/{feedback-4PB4ACBV.mjs → feedback-Y5MWMTQ2.mjs} +6 -6
  83. package/dist/cli/{git-WHIEYIVM.mjs → git-644DZQKA.mjs} +5 -5
  84. package/dist/cli/git-OEHB7UQH.js +26 -0
  85. package/dist/cli/index.js +147 -147
  86. package/dist/cli/index.mjs +46 -46
  87. package/dist/cli/integrations-ILXWYGTO.js +284 -0
  88. package/dist/cli/integrations-PMXZ7V6Y.mjs +284 -0
  89. package/dist/cli/{legacy-noops-PJNDUOWG.js → legacy-noops-USLUHQWW.js} +9 -9
  90. package/dist/cli/{legacy-noops-YYX2W2WX.mjs → legacy-noops-YUG2HVGQ.mjs} +6 -6
  91. package/dist/cli/{mcp-APKPI24N.js → mcp-DFLBEEWG.js} +24 -24
  92. package/dist/cli/{mcp-T32DPP4D.mjs → mcp-X63UPZS7.mjs} +4 -4
  93. package/dist/cli/{monitors-BY4DJFCF.js → monitors-POG6YUZ4.js} +100 -100
  94. package/dist/cli/{monitors-DTJD3IUI.mjs → monitors-QGI7QH4K.mjs} +7 -7
  95. package/dist/cli/{org-2GMHKAQK.js → org-E3NIDN32.js} +121 -121
  96. package/dist/cli/{org-GQYIJBKO.mjs → org-VAJL4BCS.mjs} +6 -6
  97. package/dist/cli/{outcomes-3ASEQLIF.mjs → outcomes-FOE35FHM.mjs} +6 -6
  98. package/dist/cli/{outcomes-4XY4F57P.js → outcomes-SCQFFBXS.js} +14 -14
  99. package/dist/cli/{play-EX7PB6CI.mjs → play-7N4Z2LEH.mjs} +19 -19
  100. package/dist/cli/{play-2LDJMIG2.js → play-BGK7PDXO.js} +324 -324
  101. package/dist/cli/{providers-GAERKWYW.mjs → providers-KDI3B22S.mjs} +6 -6
  102. package/dist/cli/{providers-IDIFP5PU.js → providers-OK2ES375.js} +9 -9
  103. package/dist/cli/{quickstart-7NL5YAJF.js → quickstart-HOHFIFVW.js} +6 -6
  104. package/dist/cli/{quickstart-E2GCIGR4.mjs → quickstart-LHJF7YCP.mjs} +4 -4
  105. package/dist/cli/{run-2EPOAEJ5.mjs → run-BQIDPU5J.mjs} +23 -23
  106. package/dist/cli/{run-3CEY5JF3.js → run-K45RGJP4.js} +44 -44
  107. package/dist/cli/{search-TYRKGVKB.mjs → search-PD3OAWO3.mjs} +7 -7
  108. package/dist/cli/search-QCFLRPCX.js +32 -0
  109. package/dist/cli/search-output-FVT2FPUN.mjs +205 -0
  110. package/dist/cli/search-output-P2JVWNCK.js +205 -0
  111. package/dist/cli/{secrets-5YL7RU2B.mjs → secrets-4MCBJUGL.mjs} +6 -6
  112. package/dist/cli/{secrets-5W2ZF2JB.js → secrets-LDCXYN33.js} +15 -15
  113. package/dist/cli/{sessions-VWENSY3G.mjs → sessions-36VI33IL.mjs} +6 -6
  114. package/dist/cli/sessions-WTQ6QNAU.js +23 -0
  115. package/dist/cli/{settings-JQOMJTOC.js → settings-3J4FUQPF.js} +85 -85
  116. package/dist/cli/{settings-W6FCYDJC.mjs → settings-D6L7S4ZC.mjs} +12 -12
  117. package/dist/cli/{setup-DJIVQUBT.js → setup-L6VH3OR4.js} +49 -49
  118. package/dist/cli/{setup-3JUQWZTS.mjs → setup-PBQ773AV.mjs} +9 -9
  119. package/dist/cli/skills-PENWR7KI.js +37 -0
  120. package/dist/cli/{skills-7JTWCFL3.mjs → skills-ZRTREJY2.mjs} +7 -7
  121. package/dist/cli/{tools-DRR3KDV2.mjs → tools-OAHCQUQB.mjs} +17 -17
  122. package/dist/cli/tools-TIN7MRLX.js +57 -0
  123. package/dist/cli/update-4TIZS6WV.js +37 -0
  124. package/dist/cli/{update-KL43AZPW.mjs → update-ZM4LSW5L.mjs} +9 -9
  125. package/dist/cli/{views-HX4GM53H.js → views-F4MEME43.js} +21 -21
  126. package/dist/cli/{views-FFTXTJ7U.mjs → views-W6PVUSE3.mjs} +6 -6
  127. package/dist/cli/{workflow-R2K6CH2X.js → workflow-37V7F5I4.js} +17 -17
  128. package/dist/cli/{workflow-QO7BRZLM.mjs → workflow-7E2QYAIY.mjs} +7 -7
  129. package/dist/{client-CnphYDTe.d.mts → client-B5cSKEi4.d.mts} +1 -1
  130. package/dist/{client-core-DQOTt3yV.d.mts → client-core-BP19BoBb.d.mts} +107 -2
  131. package/dist/{client-core-Yad6-K7-.d.ts → client-core-Deqov12F.d.ts} +107 -2
  132. package/dist/{client-BSxuaObS.d.ts → client-vUZGmXT9.d.ts} +1 -1
  133. package/dist/index.d.mts +3 -3
  134. package/dist/index.d.ts +3 -3
  135. package/dist/index.js +9 -9
  136. package/dist/index.mjs +6 -6
  137. package/dist/install-integrity.json +121 -118
  138. package/dist/plays/play-description.d.mts +1 -1
  139. package/dist/plays/play-description.d.ts +1 -1
  140. package/dist/plays/run-request.d.mts +1 -1
  141. package/dist/plays/run-request.d.ts +1 -1
  142. package/dist/release.d.mts +1 -1
  143. package/dist/release.d.ts +1 -1
  144. package/dist/release.js +2 -2
  145. package/dist/release.mjs +1 -1
  146. package/dist/server.d.mts +2 -2
  147. package/dist/server.d.ts +2 -2
  148. package/dist/server.js +5 -5
  149. package/dist/server.mjs +3 -3
  150. package/package.json +1 -1
  151. package/dist/cli/auth-UC22BJN2.js +0 -44
  152. package/dist/cli/concurrent-runs-help-NMNGH7QN.js +0 -22
  153. package/dist/cli/describe-HJ564FPP.js +0 -50
  154. package/dist/cli/git-LMRN2YR5.js +0 -26
  155. package/dist/cli/integrations-ASNRHKLO.mjs +0 -129
  156. package/dist/cli/integrations-HXY5DR6D.js +0 -129
  157. package/dist/cli/search-ILJXFKNF.js +0 -32
  158. package/dist/cli/sessions-YMXBFVB3.js +0 -23
  159. package/dist/cli/skills-T36PD3IA.js +0 -37
  160. package/dist/cli/tools-X53FZHIC.js +0 -57
  161. package/dist/cli/update-BISEE3LC.js +0 -37
@@ -0,0 +1,284 @@
1
+ import {
2
+ formatTextTable
3
+ } from "./chunk-MI5Q5FOD.mjs";
4
+ import {
5
+ printIntegrationResult,
6
+ registerIntegrationBalanceCommand,
7
+ registerIntegrationConnectCommand,
8
+ registerWorkspaceConnectionListCommand
9
+ } from "./chunk-AH2CBDQJ.mjs";
10
+ import {
11
+ DeeplineClient
12
+ } from "./chunk-IFZA4IGI.mjs";
13
+ import {
14
+ AD_ACCOUNT_DISCOVERY_PROVIDERS,
15
+ planAdAccountDiscovery
16
+ } from "./chunk-AAOXS3XM.mjs";
17
+ import "./chunk-FZHMNK6F.mjs";
18
+ import "./chunk-5TYLSS4Q.mjs";
19
+ import "./chunk-PSX3WHIH.mjs";
20
+ import "./chunk-JLXLCD6F.mjs";
21
+ import "./chunk-2US3VJXX.mjs";
22
+ import "./chunk-LKVWMLWI.mjs";
23
+ import {
24
+ AuthError
25
+ } from "./chunk-ASB47RXJ.mjs";
26
+ import "./chunk-DLIRSHV6.mjs";
27
+ import {
28
+ DeeplineError
29
+ } from "./chunk-Z3A2S3QM.mjs";
30
+ import "./chunk-2MGZAI54.mjs";
31
+ import "./chunk-H4LHB6ES.mjs";
32
+ import "./chunk-WZYKRD7T.mjs";
33
+ import "./chunk-KRD6H754.mjs";
34
+
35
+ // src/cli/commands/integrations.ts
36
+ import { Argument } from "commander";
37
+
38
+ // src/cli/commands/connector-sync.ts
39
+ function summaryLine(summary) {
40
+ const synced = summary.last_success_at ? ` \xB7 last synced ${summary.last_success_at}` : "";
41
+ return `${summary.provider}: ${summary.label}${synced} (${summary.state})`;
42
+ }
43
+ function printChange(result, json) {
44
+ printIntegrationResult(result, json, [
45
+ ...Object.entries(result.change).filter(([key]) => key !== "provider").map(([key, value]) => `${key}: ${String(value)}`),
46
+ result.status ? summaryLine(result.status) : `Change applied; the resulting sync state could not be read (${result.status_error ?? "unknown error"}). Run deepline integrations sync status.`
47
+ ]);
48
+ }
49
+ function connectorSyncExitCode(error) {
50
+ if (error instanceof AuthError) return 3;
51
+ if (!(error instanceof DeeplineError)) return 5;
52
+ const status = error.statusCode;
53
+ if (status === 400) return 2;
54
+ if (status === 401 || status === 403) return 3;
55
+ if (status === 404) return 4;
56
+ if (status === 409 || status === 422) return 7;
57
+ return 5;
58
+ }
59
+ function withExitCode(action) {
60
+ return async (...args) => {
61
+ try {
62
+ await action(...args);
63
+ } catch (error) {
64
+ if (error && typeof error === "object")
65
+ Object.assign(error, { exitCode: connectorSyncExitCode(error) });
66
+ throw error;
67
+ }
68
+ };
69
+ }
70
+ function registerConnectorSyncCommands(integrations) {
71
+ const sync = integrations.command("sync").description(
72
+ "Show and control CRM syncs into the Customer DB (HubSpot, Salesforce, Attio)."
73
+ );
74
+ sync.command("status [provider]").description(
75
+ "Show each CRM sync\u2019s state, or one provider\u2019s, as the Integrations list shows it."
76
+ ).option("--json", "Print the sync state as JSON").action(
77
+ withExitCode(
78
+ async (provider, options) => {
79
+ const client = new DeeplineClient().integrations.sync;
80
+ if (provider) {
81
+ const summary = await client.get(provider);
82
+ printIntegrationResult(summary, options.json, [
83
+ summaryLine(summary),
84
+ `Connector: ${summary.connector_status ?? "unknown"}`,
85
+ `Objects: deepline integrations sync objects ${provider}`
86
+ ]);
87
+ return;
88
+ }
89
+ const statuses = await client.status();
90
+ printIntegrationResult(statuses, options.json, [
91
+ formatTextTable(statuses.providers, [
92
+ { header: "PROVIDER", value: (row) => row.provider },
93
+ { header: "STATE", value: (row) => row.state },
94
+ { header: "STATUS", value: (row) => row.label },
95
+ {
96
+ header: "LAST SYNCED",
97
+ value: (row) => row.last_success_at ?? "-"
98
+ }
99
+ ]),
100
+ ...statuses.customer_db === "active" ? [] : ["Customer DB unavailable: syncs cannot run."]
101
+ ]);
102
+ }
103
+ )
104
+ );
105
+ sync.command("objects <provider>").description(
106
+ "List one provider\u2019s synced objects and each one\u2019s health, as the sync page does."
107
+ ).option("--json", "Print the state and every object as JSON").action(
108
+ withExitCode(async (provider, options) => {
109
+ const detail = await new DeeplineClient().integrations.sync.objects(
110
+ provider
111
+ );
112
+ printIntegrationResult(detail, options.json, [
113
+ summaryLine(detail.summary),
114
+ ...detail.objects.length ? [
115
+ formatTextTable(detail.objects, [
116
+ { header: "OBJECT", value: (row) => row.object_type },
117
+ { header: "STATUS", value: (row) => row.status },
118
+ { header: "HEALTH", value: (row) => row.health },
119
+ {
120
+ header: "LAST SUCCESS",
121
+ value: (row) => row.last_success_at ?? "-"
122
+ },
123
+ {
124
+ header: "NEXT RUN",
125
+ value: (row) => row.next_run_at ?? "-"
126
+ }
127
+ ])
128
+ ] : [
129
+ detail.customer_db === "active" ? "No synced objects." : "Customer DB unavailable: objects are not shown."
130
+ ]
131
+ ]);
132
+ })
133
+ );
134
+ for (const [name, enabled] of [
135
+ ["on", true],
136
+ ["off", false]
137
+ ]) {
138
+ sync.command(`${name} <provider>`).description(
139
+ enabled ? "Turn a provider\u2019s sync on; the first time, it sets up its objects." : "Turn a provider\u2019s sync off; synced data stays in the Customer DB."
140
+ ).option("--json", "Print the change and the resulting state as JSON").action(
141
+ withExitCode(async (provider, options) => {
142
+ printChange(
143
+ await new DeeplineClient().integrations.sync.set(provider, enabled),
144
+ options.json
145
+ );
146
+ })
147
+ );
148
+ }
149
+ for (const name of ["pause", "resume"]) {
150
+ sync.command(`${name} <provider> <objects...>`).description(
151
+ name === "pause" ? "Pause syncing the named objects, e.g. tickets; the rest keep syncing." : "Resume syncing the named paused objects."
152
+ ).option("--json", "Print the change and the resulting state as JSON").action(
153
+ withExitCode(
154
+ async (provider, objects, options) => {
155
+ printChange(
156
+ await new DeeplineClient().integrations.sync[name](
157
+ provider,
158
+ objects
159
+ ),
160
+ options.json
161
+ );
162
+ }
163
+ )
164
+ );
165
+ }
166
+ sync.command("run <provider> [objects...]").description(
167
+ "Sync now: every synced object (paused ones run once), or only the named ones. The sync must be on."
168
+ ).option("--json", "Print the change and the resulting state as JSON").action(
169
+ withExitCode(
170
+ async (provider, objects, options) => {
171
+ printChange(
172
+ await new DeeplineClient().integrations.sync.run(
173
+ provider,
174
+ objects ?? []
175
+ ),
176
+ options.json
177
+ );
178
+ }
179
+ )
180
+ );
181
+ }
182
+
183
+ // src/cli/commands/integrations.ts
184
+ function printChangeResult(result, json) {
185
+ const text = "action" in result ? Object.entries(result).map(([key, value]) => `${key}: ${String(value)}`).join("\n") : "url" in result && result.url ? result.url : `Org authorization ${result.status ?? "updated"}.`;
186
+ printIntegrationResult(result, json, [text]);
187
+ if ("status" in result && result.status === "validation_failed")
188
+ process.exitCode = 7;
189
+ }
190
+ function registerIntegrationsCommands(program) {
191
+ const integrations = program.command("integrations").description("Connect providers and manage named org authorizations.");
192
+ registerWorkspaceConnectionListCommand(integrations, "list");
193
+ registerIntegrationBalanceCommand(integrations);
194
+ registerIntegrationConnectCommand(integrations, true);
195
+ registerConnectorSyncCommands(integrations);
196
+ integrations.command("discover-ad-accounts").description("Discover and save Google Ads or LinkedIn ad accounts.").addArgument(
197
+ new Argument("<provider>", "Connected ads provider").choices([
198
+ ...AD_ACCOUNT_DISCOVERY_PROVIDERS
199
+ ])
200
+ ).option("--dry-run", "Print the request without contacting the provider").option("--json", "Print the discovery result as JSON").action(
201
+ async (provider, options) => {
202
+ if (options.dryRun) {
203
+ const request = planAdAccountDiscovery(provider);
204
+ printIntegrationResult(request, options.json, [
205
+ `Would discover and save accounts in the selected workspace using ${request.method} ${request.path}.`
206
+ ]);
207
+ return;
208
+ }
209
+ const result = await new DeeplineClient().integrations.discoverAdAccounts(provider);
210
+ printIntegrationResult(result, options.json, [
211
+ result.accounts.length ? `Ad accounts in the selected workspace (${result.accounts.length})` : "No accessible ad accounts found.",
212
+ ...result.accounts.map((account) => {
213
+ const name = "descriptiveName" in account ? account.descriptiveName : account.name;
214
+ return [
215
+ name && name !== account.accountId ? name : void 0,
216
+ account.accountId,
217
+ account.enabled ? "enabled" : "disabled",
218
+ "manager" in account && account.manager ? "manager" : void 0,
219
+ account.accountId === result.default_account_id ? "default" : void 0
220
+ ].filter(Boolean).join(" ");
221
+ })
222
+ ]);
223
+ }
224
+ );
225
+ integrations.command("get <name>").description("Show a named org authorization, including granted scopes.").option("--provider <provider>", "Disambiguate the provider for this name").option("--json", "Print the authorization record as JSON").action(async (name, options) => {
226
+ const row = await new DeeplineClient().integrations.get(name, options);
227
+ printIntegrationResult(row, options.json, [
228
+ `${row.name} ${row.provider} ${row.status}`,
229
+ row.label,
230
+ ...(row.scopes ?? []).map((scope) => `Scope: ${scope}`)
231
+ ]);
232
+ });
233
+ for (const action of ["reconnect", "disconnect", "delete"]) {
234
+ const command = integrations.command(`${action} <name>`).description(
235
+ `${action[0].toUpperCase()}${action.slice(1)} a named org authorization.`
236
+ ).option(
237
+ "--provider <provider>",
238
+ "Disambiguate the provider for this name"
239
+ ).option(
240
+ "--dry-run",
241
+ "Read current state and print the change without saving or contacting the provider"
242
+ ).option("--json", "Print the result as JSON");
243
+ if (action === "reconnect")
244
+ command.option(
245
+ "--verification-email <email>",
246
+ "Work email used to verify a Google Workspace approval"
247
+ );
248
+ if (action === "reconnect")
249
+ command.option(
250
+ "--booking",
251
+ "Verify Calendar availability and event booking permissions"
252
+ );
253
+ if (action === "reconnect")
254
+ command.option("--list-calendars", "Verify calendar listing permission");
255
+ command.action(async (name, options) => {
256
+ const result = await new DeeplineClient().integrations[action](
257
+ name,
258
+ options
259
+ );
260
+ printChangeResult(result, options.json);
261
+ });
262
+ }
263
+ integrations.command("verify <domain>").description("Verify and enable a Google Workspace Calendar approval.").requiredOption(
264
+ "--verification-email <email>",
265
+ "Work email in the approved domain"
266
+ ).option(
267
+ "--dry-run",
268
+ "Read current state and print the change without saving or contacting Google"
269
+ ).option("--json", "Print the verification result as JSON").option(
270
+ "--booking",
271
+ "Verify Calendar availability and event booking permissions"
272
+ ).option("--list-calendars", "Verify calendar listing permission").action(
273
+ async (domain, options) => {
274
+ const result = await new DeeplineClient().integrations.verify(
275
+ domain,
276
+ options
277
+ );
278
+ printChangeResult(result, options.json);
279
+ }
280
+ );
281
+ }
282
+ export {
283
+ registerIntegrationsCommands
284
+ };
@@ -1,20 +1,20 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkK77ANXGUjs = require('./chunk-K77ANXGU.js');
3
+ var _chunkE73BRM5Njs = require('./chunk-E73BRM5N.js');
4
4
 
5
5
 
6
6
  var _chunk3XX5TEA4js = require('./chunk-3XX5TEA4.js');
7
- require('./chunk-QOLFZD6Q.js');
7
+ require('./chunk-FEWBYUUF.js');
8
8
 
9
9
 
10
- var _chunkU77PK5R3js = require('./chunk-U77PK5R3.js');
11
- require('./chunk-DA24O3ZV.js');
12
- require('./chunk-T2RNEBV7.js');
10
+ var _chunkJ5QAOURJjs = require('./chunk-J5QAOURJ.js');
11
+ require('./chunk-GE62FFN6.js');
12
+ require('./chunk-4VKDPTHF.js');
13
13
  require('./chunk-6VLFQZK6.js');
14
14
  require('./chunk-XNYIZMNQ.js');
15
15
  require('./chunk-LFQJW4S2.js');
16
16
  require('./chunk-CFJFUVX2.js');
17
- require('./chunk-NS56OQUQ.js');
17
+ require('./chunk-UWMK5DLS.js');
18
18
  require('./chunk-OG64RBAC.js');
19
19
  require('./chunk-COGTRVWW.js');
20
20
 
@@ -55,7 +55,7 @@ function deprecatedCommandEnvelope(input) {
55
55
  };
56
56
  }
57
57
  function printDeprecatedCommand(input) {
58
- _chunkU77PK5R3js.printCommandEnvelope.call(void 0, deprecatedCommandEnvelope(input), {
58
+ _chunkJ5QAOURJjs.printCommandEnvelope.call(void 0, deprecatedCommandEnvelope(input), {
59
59
  json: input.options.json
60
60
  });
61
61
  process.exitCode = 2;
@@ -75,7 +75,7 @@ function registerDeprecatedCommands(program) {
75
75
  program.command("enrich", { hidden: true }).description("Deprecated CSV enrichment command.").allowUnknownOption(true).allowExcessArguments(true).option("--json", "Emit JSON output").argument("[args...]").addHelpText("after", `
76
76
  ${_chunk3XX5TEA4js.ENRICH_COMMAND_DEPRECATION_MESSAGE}
77
77
  `).action((_args, options) => {
78
- _chunkU77PK5R3js.printCommandEnvelope.call(void 0,
78
+ _chunkJ5QAOURJjs.printCommandEnvelope.call(void 0,
79
79
  {
80
80
  ok: false,
81
81
  command: "deepline enrich",
@@ -118,7 +118,7 @@ Examples:
118
118
  options
119
119
  });
120
120
  });
121
- _chunkK77ANXGUjs.registerSessionSendRenderCommands.call(void 0, session, "session");
121
+ _chunkE73BRM5Njs.registerSessionSendRenderCommands.call(void 0, session, "session");
122
122
  for (const subcommand of SESSION_SUBCOMMANDS) {
123
123
  addDeprecatedSubcommand(
124
124
  session,
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  registerSessionSendRenderCommands
3
- } from "./chunk-6UHRBEDV.mjs";
3
+ } from "./chunk-UTQ6LQWG.mjs";
4
4
  import {
5
5
  ENRICH_COMMAND_DEPRECATION_MESSAGE
6
6
  } from "./chunk-ITOFSXIU.mjs";
7
- import "./chunk-UUEVGLGO.mjs";
7
+ import "./chunk-BCEXSQPK.mjs";
8
8
  import {
9
9
  printCommandEnvelope
10
- } from "./chunk-GVRVZQBY.mjs";
11
- import "./chunk-UMJWODG7.mjs";
12
- import "./chunk-XDZZCRUG.mjs";
10
+ } from "./chunk-JLXLCD6F.mjs";
11
+ import "./chunk-2US3VJXX.mjs";
12
+ import "./chunk-LKVWMLWI.mjs";
13
13
  import "./chunk-ASB47RXJ.mjs";
14
14
  import "./chunk-DLIRSHV6.mjs";
15
15
  import "./chunk-Z3A2S3QM.mjs";
16
16
  import "./chunk-2MGZAI54.mjs";
17
- import "./chunk-AYNDNXBJ.mjs";
17
+ import "./chunk-H4LHB6ES.mjs";
18
18
  import "./chunk-WZYKRD7T.mjs";
19
19
  import "./chunk-KRD6H754.mjs";
20
20
 
@@ -2,16 +2,16 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkU77PK5R3js = require('./chunk-U77PK5R3.js');
5
+ var _chunkJ5QAOURJjs = require('./chunk-J5QAOURJ.js');
6
6
 
7
7
 
8
- var _chunkDA24O3ZVjs = require('./chunk-DA24O3ZV.js');
9
- require('./chunk-T2RNEBV7.js');
8
+ var _chunkGE62FFN6js = require('./chunk-GE62FFN6.js');
9
+ require('./chunk-4VKDPTHF.js');
10
10
  require('./chunk-6VLFQZK6.js');
11
11
  require('./chunk-XNYIZMNQ.js');
12
12
  require('./chunk-LFQJW4S2.js');
13
13
  require('./chunk-CFJFUVX2.js');
14
- require('./chunk-NS56OQUQ.js');
14
+ require('./chunk-UWMK5DLS.js');
15
15
  require('./chunk-OG64RBAC.js');
16
16
  require('./chunk-COGTRVWW.js');
17
17
 
@@ -114,7 +114,7 @@ async function handleConnect(name, url, forbidden, options) {
114
114
  throw new Error("OAuth connections do not take headers.");
115
115
  }
116
116
  const scope = _nullishCoalesce(parseScope(options.scope), () => ( "user"));
117
- const { http } = _chunkU77PK5R3js.getAuthedHttpClient.call(void 0, );
117
+ const { http } = _chunkJ5QAOURJjs.getAuthedHttpClient.call(void 0, );
118
118
  const response = await http.post("/api/v2/mcp-connections", {
119
119
  name,
120
120
  url,
@@ -137,7 +137,7 @@ async function handleConnect(name, url, forbidden, options) {
137
137
  return;
138
138
  }
139
139
  const scopeFlag = scopeFlagFor(connection.scope, overrides.length > 0);
140
- _chunkU77PK5R3js.printCommandEnvelope.call(void 0,
140
+ _chunkJ5QAOURJjs.printCommandEnvelope.call(void 0,
141
141
  {
142
142
  connection,
143
143
  overrides,
@@ -165,8 +165,8 @@ function scopeFlagFor(scope, collides) {
165
165
  return collides ? ` --scope ${scope}` : "";
166
166
  }
167
167
  function printAuthorization(slug, authorizationUrl, connection, options, notes = []) {
168
- const opened = options.open !== false && !options.json ? _chunkU77PK5R3js.openInBrowser.call(void 0, authorizationUrl) === "opened" : false;
169
- _chunkU77PK5R3js.printCommandEnvelope.call(void 0,
168
+ const opened = options.open !== false && !options.json ? _chunkJ5QAOURJjs.openInBrowser.call(void 0, authorizationUrl) === "opened" : false;
169
+ _chunkJ5QAOURJjs.printCommandEnvelope.call(void 0,
170
170
  {
171
171
  ...connection ? { connection } : {},
172
172
  authorization_url: authorizationUrl,
@@ -190,7 +190,7 @@ function printAuthorization(slug, authorizationUrl, connection, options, notes =
190
190
  );
191
191
  }
192
192
  async function handleReauth(slug, options) {
193
- const { http } = _chunkU77PK5R3js.getAuthedHttpClient.call(void 0, );
193
+ const { http } = _chunkJ5QAOURJjs.getAuthedHttpClient.call(void 0, );
194
194
  const { authorization_url } = await http.post(
195
195
  base(slug, options, "/oauth"),
196
196
  {}
@@ -198,11 +198,11 @@ async function handleReauth(slug, options) {
198
198
  printAuthorization(slug, authorization_url, void 0, options);
199
199
  }
200
200
  async function handleList(options) {
201
- const { http } = _chunkU77PK5R3js.getAuthedHttpClient.call(void 0, );
201
+ const { http } = _chunkJ5QAOURJjs.getAuthedHttpClient.call(void 0, );
202
202
  const { connections } = await http.get(
203
203
  "/api/v2/mcp-connections"
204
204
  );
205
- _chunkU77PK5R3js.printCommandEnvelope.call(void 0,
205
+ _chunkJ5QAOURJjs.printCommandEnvelope.call(void 0,
206
206
  {
207
207
  connections,
208
208
  count: connections.length,
@@ -221,11 +221,11 @@ async function handleList(options) {
221
221
  );
222
222
  }
223
223
  async function handleServers(options) {
224
- const { http } = _chunkU77PK5R3js.getAuthedHttpClient.call(void 0, );
224
+ const { http } = _chunkJ5QAOURJjs.getAuthedHttpClient.call(void 0, );
225
225
  const { servers } = await http.get(
226
226
  "/api/v2/mcp-connections/servers"
227
227
  );
228
- _chunkU77PK5R3js.printCommandEnvelope.call(void 0,
228
+ _chunkJ5QAOURJjs.printCommandEnvelope.call(void 0,
229
229
  {
230
230
  servers,
231
231
  render: {
@@ -243,7 +243,7 @@ async function handleServers(options) {
243
243
  );
244
244
  }
245
245
  async function handleTools(slug, options) {
246
- const { http } = _chunkU77PK5R3js.getAuthedHttpClient.call(void 0, );
246
+ const { http } = _chunkJ5QAOURJjs.getAuthedHttpClient.call(void 0, );
247
247
  const query = new URLSearchParams();
248
248
  if (options.cursor) query.set("cursor", options.cursor);
249
249
  if (options.limit) query.set("limit", options.limit);
@@ -251,7 +251,7 @@ async function handleTools(slug, options) {
251
251
  if (scope) query.set("scope", scope);
252
252
  const suffix = query.size > 0 ? `?${query.toString()}` : "";
253
253
  const page = await http.get(`/api/v2/mcp-connections/${encodeURIComponent(slug)}/tools${suffix}`);
254
- _chunkU77PK5R3js.printCommandEnvelope.call(void 0,
254
+ _chunkJ5QAOURJjs.printCommandEnvelope.call(void 0,
255
255
  {
256
256
  connection: page.connection,
257
257
  tools: page.tools,
@@ -275,7 +275,7 @@ async function handleTools(slug, options) {
275
275
  }
276
276
  async function handleSetEnabled(slug, tools, enabled, options) {
277
277
  if (tools.length === 0) throw new Error("Name at least one tool.");
278
- const { http } = _chunkU77PK5R3js.getAuthedHttpClient.call(void 0, );
278
+ const { http } = _chunkJ5QAOURJjs.getAuthedHttpClient.call(void 0, );
279
279
  const result = await http.patch(
280
280
  base(slug, options, "/tools"),
281
281
  {
@@ -283,7 +283,7 @@ async function handleSetEnabled(slug, tools, enabled, options) {
283
283
  enabled
284
284
  }
285
285
  );
286
- _chunkU77PK5R3js.printCommandEnvelope.call(void 0,
286
+ _chunkJ5QAOURJjs.printCommandEnvelope.call(void 0,
287
287
  {
288
288
  updated: result.updated,
289
289
  enabled,
@@ -300,9 +300,9 @@ async function handleSetEnabled(slug, tools, enabled, options) {
300
300
  );
301
301
  }
302
302
  async function handleRefresh(slug, options) {
303
- const { http } = _chunkU77PK5R3js.getAuthedHttpClient.call(void 0, );
303
+ const { http } = _chunkJ5QAOURJjs.getAuthedHttpClient.call(void 0, );
304
304
  const result = await http.post(base(slug, options, "/refresh"), {});
305
- _chunkU77PK5R3js.printCommandEnvelope.call(void 0,
305
+ _chunkJ5QAOURJjs.printCommandEnvelope.call(void 0,
306
306
  {
307
307
  ...result,
308
308
  render: {
@@ -332,12 +332,12 @@ async function handleSetHeaders(slug, forbidden, options) {
332
332
  "Pass headers with --header-env Name=ENV_VAR or --headers-stdin."
333
333
  );
334
334
  }
335
- const { http } = _chunkU77PK5R3js.getAuthedHttpClient.call(void 0, );
335
+ const { http } = _chunkJ5QAOURJjs.getAuthedHttpClient.call(void 0, );
336
336
  const { connection } = await http.put(
337
337
  base(slug, options, "/headers"),
338
338
  { headers }
339
339
  );
340
- _chunkU77PK5R3js.printCommandEnvelope.call(void 0,
340
+ _chunkJ5QAOURJjs.printCommandEnvelope.call(void 0,
341
341
  {
342
342
  connection,
343
343
  render: {
@@ -350,12 +350,12 @@ async function handleSetHeaders(slug, forbidden, options) {
350
350
  );
351
351
  }
352
352
  async function handleRemove(slug, options) {
353
- const { http } = _chunkU77PK5R3js.getAuthedHttpClient.call(void 0, );
353
+ const { http } = _chunkJ5QAOURJjs.getAuthedHttpClient.call(void 0, );
354
354
  const result = await http.delete(
355
355
  base(slug, options)
356
356
  );
357
357
  const removed = _optionalChain([result, 'optionalAccess', _ => _.scope]) ? `Removed the ${SCOPE_LABELS[result.scope]} connection ${slug}.` : `Removed ${slug}.`;
358
- _chunkU77PK5R3js.printCommandEnvelope.call(void 0,
358
+ _chunkJ5QAOURJjs.printCommandEnvelope.call(void 0,
359
359
  {
360
360
  deleted: slug,
361
361
  ..._optionalChain([result, 'optionalAccess', _2 => _2.scope]) ? { scope: result.scope } : {},
@@ -368,7 +368,7 @@ async function handleRemove(slug, options) {
368
368
  }
369
369
  var MCP_CONNECTIONS_FEATURE = "mcp-connections";
370
370
  function registerMcpCommands(program) {
371
- const mcp = program.command("mcp", { hidden: !_chunkDA24O3ZVjs.cliFeatureEnabled.call(void 0, MCP_CONNECTIONS_FEATURE) }).description(
371
+ const mcp = program.command("mcp", { hidden: !_chunkGE62FFN6js.cliFeatureEnabled.call(void 0, MCP_CONNECTIONS_FEATURE) }).description(
372
372
  "Connect remote MCP servers for yourself, your workspace or your org, and call their tools."
373
373
  ).addHelpText(
374
374
  "after",
@@ -2,16 +2,16 @@ import {
2
2
  getAuthedHttpClient,
3
3
  openInBrowser,
4
4
  printCommandEnvelope
5
- } from "./chunk-GVRVZQBY.mjs";
5
+ } from "./chunk-JLXLCD6F.mjs";
6
6
  import {
7
7
  cliFeatureEnabled
8
- } from "./chunk-UMJWODG7.mjs";
9
- import "./chunk-XDZZCRUG.mjs";
8
+ } from "./chunk-2US3VJXX.mjs";
9
+ import "./chunk-LKVWMLWI.mjs";
10
10
  import "./chunk-ASB47RXJ.mjs";
11
11
  import "./chunk-DLIRSHV6.mjs";
12
12
  import "./chunk-Z3A2S3QM.mjs";
13
13
  import "./chunk-2MGZAI54.mjs";
14
- import "./chunk-AYNDNXBJ.mjs";
14
+ import "./chunk-H4LHB6ES.mjs";
15
15
  import "./chunk-WZYKRD7T.mjs";
16
16
  import "./chunk-KRD6H754.mjs";
17
17