deepline 0.3.372 → 0.3.373

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 (113) hide show
  1. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  2. package/dist/bundling-sources/shared_libs/plays/email-status.ts +95 -0
  3. package/dist/bundling-sources/shared_libs/plays/extractor-targets.ts +14 -0
  4. package/dist/bundling-sources/shared_libs/plays/field-catalog.ts +253 -0
  5. package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +2 -0
  6. package/dist/cli/{auth-ODSACXLF.mjs → auth-7BMCDCRH.mjs} +4 -4
  7. package/dist/cli/auth-BWCNRUG3.js +33 -0
  8. package/dist/cli/{billing-4ERXY2DZ.js → billing-GKI7B4JF.js} +73 -73
  9. package/dist/cli/{billing-OPIOZLAN.mjs → billing-RZEHHMPU.mjs} +4 -4
  10. package/dist/cli/{chunk-E5UD3JDQ.js → chunk-3VN4FTE3.js} +289 -5
  11. package/dist/cli/{chunk-BVUGPOU3.mjs → chunk-6JCVL7CE.mjs} +2 -2
  12. package/dist/cli/{chunk-RJ7JJMQO.js → chunk-BM47AKUZ.js} +266 -254
  13. package/dist/cli/{chunk-DM5QUZJR.js → chunk-CLEB5KUZ.js} +1 -1
  14. package/dist/cli/{chunk-AQFA7HMN.js → chunk-D2CZ4Y5G.js} +15 -15
  15. package/dist/cli/{chunk-3GK3SH3G.mjs → chunk-E6BZWURC.mjs} +200 -13
  16. package/dist/cli/{chunk-RUYZAREB.js → chunk-E7MGPPM5.js} +9 -9
  17. package/dist/cli/{chunk-DONL233W.mjs → chunk-ECA6NQYL.mjs} +4 -4
  18. package/dist/cli/{chunk-GZQKUFM5.js → chunk-EYXSAB7O.js} +26 -26
  19. package/dist/cli/{chunk-MIMV5LTU.mjs → chunk-HNLXC5BP.mjs} +1 -1
  20. package/dist/cli/{chunk-6MDAGRZP.js → chunk-IHQQNWU4.js} +2 -2
  21. package/dist/cli/{chunk-FGHRRJ3D.mjs → chunk-IUYKSTWB.mjs} +1 -1
  22. package/dist/cli/{chunk-VVFH745L.js → chunk-JHUMUIU6.js} +6 -6
  23. package/dist/cli/{chunk-BFLPCGOR.mjs → chunk-JP2YA3AV.mjs} +1 -1
  24. package/dist/cli/{chunk-ML2ZY7YD.js → chunk-ND4BVWWZ.js} +4 -4
  25. package/dist/cli/{chunk-EFJL5FCU.js → chunk-NVZAZGHA.js} +8 -8
  26. package/dist/cli/{chunk-IUWPC5K6.js → chunk-ORBVXCTL.js} +50 -50
  27. package/dist/cli/{chunk-JAERLCMH.mjs → chunk-P5JPGZNI.mjs} +1 -1
  28. package/dist/cli/{chunk-KC2YOJTU.mjs → chunk-PZ26EKNC.mjs} +319 -115
  29. package/dist/cli/{chunk-U3W7E5WT.mjs → chunk-QSV76EMO.mjs} +27 -15
  30. package/dist/cli/{chunk-4LIUZ4QR.mjs → chunk-R6TPSZLN.mjs} +2 -2
  31. package/dist/cli/{chunk-N5TPMNTT.js → chunk-S5OTS6H5.js} +8 -8
  32. package/dist/cli/{chunk-XSPAI6MF.mjs → chunk-TB73PXE3.mjs} +2 -2
  33. package/dist/cli/{chunk-D6O3NJHX.js → chunk-W3H422KP.js} +60 -60
  34. package/dist/cli/{chunk-WJWO74MM.js → chunk-XJYUQBHY.js} +390 -186
  35. package/dist/cli/{chunk-3CTB7V5F.mjs → chunk-XMME4SCK.mjs} +2 -2
  36. package/dist/cli/{chunk-2RC5JQ3C.mjs → chunk-Y32GUTEN.mjs} +1 -1
  37. package/dist/cli/{chunk-JB6ERQUV.mjs → chunk-Y6VOGHF2.mjs} +284 -0
  38. package/dist/cli/{chunk-5HYD3GMS.mjs → chunk-YHHY2YHK.mjs} +3 -3
  39. package/dist/cli/{chunk-2JRRXXTA.js → chunk-YPVTQRUM.js} +201 -14
  40. package/dist/cli/{client-KF2J754U.mjs → client-FO6LMHT4.mjs} +3 -3
  41. package/dist/cli/client-KAWK7FJR.js +20 -0
  42. package/dist/cli/{csv-UL3MCD5D.mjs → csv-3FNCVMWA.mjs} +3 -3
  43. package/dist/cli/{csv-UJ3M7NFP.js → csv-NFQYQWWO.js} +12 -12
  44. package/dist/cli/{db-444XYOTV.js → db-CTLGRV3X.js} +29 -29
  45. package/dist/cli/{db-SIOWA63T.mjs → db-VA7HULGR.mjs} +4 -4
  46. package/dist/cli/{describe-GI5GHAKO.mjs → describe-GXGRMP2M.mjs} +46 -17
  47. package/dist/cli/{describe-RRBESS3S.js → describe-IUHOEPKY.js} +61 -32
  48. package/dist/cli/{executions-ERXZUOL5.js → executions-DSK3HRPU.js} +6 -6
  49. package/dist/cli/{executions-4YDP6BXI.mjs → executions-OZQDZQIK.mjs} +4 -4
  50. package/dist/cli/{feedback-3M7D7DZQ.js → feedback-KTMLMWKV.js} +7 -7
  51. package/dist/cli/{feedback-CPWQL5LU.mjs → feedback-ZOY7R4JD.mjs} +3 -3
  52. package/dist/cli/git-5P5FLEUC.js +23 -0
  53. package/dist/cli/{git-XN6C3TJZ.mjs → git-FIOI4IA2.mjs} +4 -4
  54. package/dist/cli/index.js +81 -81
  55. package/dist/cli/index.mjs +32 -32
  56. package/dist/cli/{legacy-noops-KXQ6TFFL.mjs → legacy-noops-KQZWSABN.mjs} +4 -4
  57. package/dist/cli/{legacy-noops-5XDGOFWH.js → legacy-noops-WXAYRQMQ.js} +7 -7
  58. package/dist/cli/{monitors-KH22PDOC.js → monitors-LPUCHRNJ.js} +85 -85
  59. package/dist/cli/{monitors-33IU5JR6.mjs → monitors-VHNWIF4V.mjs} +4 -4
  60. package/dist/cli/{org-X4NSLQG5.js → org-GWHWBCMD.js} +64 -64
  61. package/dist/cli/{org-MHYMWUEP.mjs → org-UW7NPGEY.mjs} +4 -4
  62. package/dist/cli/play-EVBIC7Z5.js +155 -0
  63. package/dist/cli/{play-LCZKHKW2.mjs → play-FNM2E66T.mjs} +8 -8
  64. package/dist/cli/{providers-J6LWCF5R.js → providers-6D6R3PWX.js} +7 -7
  65. package/dist/cli/{providers-L5FJTSEA.mjs → providers-XAZMYDWS.mjs} +4 -4
  66. package/dist/cli/{quickstart-OOPFA4MX.js → quickstart-HBUWBVH6.js} +5 -5
  67. package/dist/cli/{quickstart-NE3BTWGL.mjs → quickstart-OK65PGZL.mjs} +3 -3
  68. package/dist/cli/search-6ZY2XWP2.js +26 -0
  69. package/dist/cli/{search-DBXOEOIE.mjs → search-XY6JOTS2.mjs} +5 -5
  70. package/dist/cli/{secrets-WPMU7UBD.js → secrets-6CYCPK7T.js} +13 -13
  71. package/dist/cli/{secrets-U2MLWZH2.mjs → secrets-W2LDLU2W.mjs} +4 -4
  72. package/dist/cli/{sessions-YYZ3UJDS.js → sessions-GOYEKNTJ.js} +5 -5
  73. package/dist/cli/{sessions-WYNC4AUE.mjs → sessions-JAX7PGXU.mjs} +4 -4
  74. package/dist/cli/{settings-FQZSHFC6.mjs → settings-OACUQOCM.mjs} +7 -7
  75. package/dist/cli/{settings-WQDFX3X6.js → settings-QMFYFCT7.js} +74 -74
  76. package/dist/cli/{setup-JKYJT35S.mjs → setup-2KA5TZBZ.mjs} +6 -6
  77. package/dist/cli/{setup-DKYVNDTM.js → setup-36VOOGVA.js} +41 -41
  78. package/dist/cli/skills-6GPIEPTP.js +28 -0
  79. package/dist/cli/{skills-VHVCJJJY.mjs → skills-QY4BX5ZX.mjs} +4 -4
  80. package/dist/cli/tools-RTECP4WT.js +40 -0
  81. package/dist/cli/{tools-E23PU7KM.mjs → tools-UCB2QRVC.mjs} +8 -8
  82. package/dist/cli/{update-4A4VU6CW.mjs → update-327MHUO4.mjs} +6 -6
  83. package/dist/cli/update-WR65EHBN.js +28 -0
  84. package/dist/cli/{workflow-WB2USWAA.js → workflow-G7BU54KW.js} +15 -15
  85. package/dist/cli/{workflow-2ZR2ECTG.mjs → workflow-HJN4GA5A.mjs} +5 -5
  86. package/dist/{client-Cw0e2Uec.d.mts → client-Cn-txrXv.d.mts} +1 -1
  87. package/dist/{client-CwdiawoG.d.ts → client-fPoIN-3V.d.ts} +1 -1
  88. package/dist/{compiler-manifest-DgdW0q0b.d.mts → compiler-manifest-CY2v8ab0.d.mts} +2 -0
  89. package/dist/{compiler-manifest-DgdW0q0b.d.ts → compiler-manifest-CY2v8ab0.d.ts} +2 -0
  90. package/dist/{index-C3nQQTI-.d.mts → index-B9fBZH1g.d.mts} +1 -1
  91. package/dist/{index-CEYQAfS0.d.ts → index-BZ6uzZJl.d.ts} +1 -1
  92. package/dist/index.d.mts +5 -5
  93. package/dist/index.d.ts +5 -5
  94. package/dist/index.js +79 -249
  95. package/dist/index.mjs +10 -180
  96. package/dist/install-integrity.json +85 -84
  97. package/dist/plays/bundle-play-file.d.mts +3 -3
  98. package/dist/plays/bundle-play-file.d.ts +3 -3
  99. package/dist/plays/run-request.d.mts +2 -2
  100. package/dist/plays/run-request.d.ts +2 -2
  101. package/dist/release.d.mts +1 -1
  102. package/dist/release.d.ts +1 -1
  103. package/dist/release.js +2 -2
  104. package/dist/release.mjs +1 -1
  105. package/package.json +1 -1
  106. package/dist/cli/auth-4SXMV3CD.js +0 -33
  107. package/dist/cli/client-UUNLXOHF.js +0 -20
  108. package/dist/cli/git-ITSCNUVB.js +0 -23
  109. package/dist/cli/play-4QRPOBWW.js +0 -155
  110. package/dist/cli/search-UGQDBP76.js +0 -26
  111. package/dist/cli/skills-VBQMXDAX.js +0 -28
  112. package/dist/cli/tools-ACEJZMJD.js +0 -40
  113. package/dist/cli/update-V5KMYHVE.js +0 -28
@@ -2,7 +2,7 @@ import {
2
2
  argsWantJson,
3
3
  openInBrowser,
4
4
  printCommandEnvelope
5
- } from "./chunk-MIMV5LTU.mjs";
5
+ } from "./chunk-HNLXC5BP.mjs";
6
6
  import {
7
7
  ACTIVE_ORG_ID_ENV,
8
8
  ACTIVE_ORG_NAME_ENV,
@@ -25,7 +25,7 @@ import {
25
25
  saveHostEnvValues,
26
26
  saveProjectDeeplineEnvValues,
27
27
  storedHostApiKey
28
- } from "./chunk-FGHRRJ3D.mjs";
28
+ } from "./chunk-IUYKSTWB.mjs";
29
29
 
30
30
  // src/cli/commands/auth.ts
31
31
  import {
@@ -21,7 +21,7 @@ import {
21
21
  RETAINED_PIPELINE_RECEIVERS_HEADER,
22
22
  RUNTIME_ENVIRONMENT_TOKEN_HEADER,
23
23
  resolveConfig
24
- } from "./chunk-FGHRRJ3D.mjs";
24
+ } from "./chunk-IUYKSTWB.mjs";
25
25
  import {
26
26
  DeeplineError,
27
27
  TOOL_EXECUTION_ERROR_SCHEMA_HEADER,
@@ -1,3 +1,279 @@
1
+ // ../plays/email-status.ts
2
+ var nullable = (type) => ({ type: [type, "null"] });
3
+ var oneOf = (values) => ({ type: "string", enum: values });
4
+ var EMAIL_STATUS_JSON_SCHEMA = {
5
+ type: "object",
6
+ required: [
7
+ "verdict",
8
+ "status",
9
+ "verified",
10
+ "confidence",
11
+ "reasons",
12
+ "signals",
13
+ "provider"
14
+ ],
15
+ properties: {
16
+ verdict: oneOf([
17
+ "send",
18
+ "send_with_caution",
19
+ "verify_next",
20
+ "hold",
21
+ "drop"
22
+ ]),
23
+ status: oneOf([
24
+ "valid",
25
+ "invalid",
26
+ "catch_all",
27
+ "valid_catch_all",
28
+ "unknown",
29
+ "do_not_mail",
30
+ "spamtrap",
31
+ "abuse",
32
+ "disposable"
33
+ ]),
34
+ verified: { type: "boolean" },
35
+ confidence: nullable("number"),
36
+ reasons: { type: "array", items: { type: "string" } },
37
+ signals: {
38
+ type: "object",
39
+ required: [
40
+ "catch_all",
41
+ "deliverability",
42
+ "mx_class",
43
+ "mx_provider",
44
+ "mx_record",
45
+ "fraud_score",
46
+ "disposable",
47
+ "role_based",
48
+ "free_email",
49
+ "abuse",
50
+ "spamtrap",
51
+ "suspect",
52
+ "valid"
53
+ ],
54
+ properties: {
55
+ catch_all: nullable("boolean"),
56
+ deliverability: oneOf([
57
+ "high",
58
+ "medium",
59
+ "low",
60
+ "unknown"
61
+ ]),
62
+ mx_class: oneOf([
63
+ "consumer_mailbox",
64
+ "workspace_mailbox",
65
+ "security_gateway",
66
+ "on_prem",
67
+ "unknown"
68
+ ]),
69
+ mx_provider: nullable("string"),
70
+ mx_record: nullable("string"),
71
+ fraud_score: nullable("number"),
72
+ disposable: nullable("boolean"),
73
+ role_based: nullable("boolean"),
74
+ free_email: nullable("boolean"),
75
+ abuse: nullable("boolean"),
76
+ spamtrap: nullable("boolean"),
77
+ suspect: nullable("boolean"),
78
+ valid: nullable("boolean")
79
+ }
80
+ },
81
+ provider: {
82
+ type: "object",
83
+ required: ["name", "raw_status", "raw_score"],
84
+ properties: {
85
+ name: { type: "string" },
86
+ raw_status: { type: ["string", "boolean", "number", "null"] },
87
+ raw_score: nullable("number")
88
+ }
89
+ }
90
+ }
91
+ };
92
+ function normalizeKey(value) {
93
+ if (value == null) return null;
94
+ if (typeof value === "boolean") return String(value);
95
+ const normalized = String(value).trim().toLowerCase().replace(/\s+/g, "_");
96
+ return normalized || null;
97
+ }
98
+ function boolish(value) {
99
+ if (typeof value === "boolean") return value;
100
+ if (typeof value === "number")
101
+ return value === 1 ? true : value === 0 ? false : null;
102
+ if (typeof value !== "string") return null;
103
+ const normalized = value.trim().toLowerCase();
104
+ if (["true", "yes", "y", "1"].includes(normalized)) return true;
105
+ if (["false", "no", "n", "0"].includes(normalized)) return false;
106
+ return null;
107
+ }
108
+ function numberish(value) {
109
+ if (typeof value === "number" && Number.isFinite(value)) return value;
110
+ if (typeof value !== "string" || value.trim() === "") return null;
111
+ const parsed = Number(value);
112
+ return Number.isFinite(parsed) ? parsed : null;
113
+ }
114
+ function stringish(value) {
115
+ return typeof value === "string" && value.trim() ? value.trim() : null;
116
+ }
117
+ function deliverability(value) {
118
+ const normalized = normalizeKey(value);
119
+ return normalized === "high" || normalized === "medium" || normalized === "low" ? normalized : "unknown";
120
+ }
121
+ function mxClass(mxProvider, mxRecord) {
122
+ const haystack = `${stringish(mxProvider) ?? ""} ${stringish(mxRecord) ?? ""}`.toLowerCase();
123
+ if (!haystack.trim()) return "unknown";
124
+ if (/proofpoint|pphosted|mimecast|barracuda|ess\.barracudanetworks|ironport|cisco|iphmx|messagelabs|symantec/.test(
125
+ haystack
126
+ )) {
127
+ return "security_gateway";
128
+ }
129
+ if (/aspmx\.l\.google|google|g-suite|google workspace/.test(haystack)) {
130
+ return "workspace_mailbox";
131
+ }
132
+ if (/protection\.outlook|office365|microsoft|outlook|exchange online/.test(
133
+ haystack
134
+ )) {
135
+ return "workspace_mailbox";
136
+ }
137
+ if (/gmail|yahoo|icloud|aol|hotmail/.test(haystack))
138
+ return "consumer_mailbox";
139
+ if (/postfix|exim|sendmail|zimbra|plesk|cpanel|mail\./.test(haystack))
140
+ return "on_prem";
141
+ return "unknown";
142
+ }
143
+ function entryForStatus(key, map) {
144
+ if (!key) return null;
145
+ return map?.[key] ?? null;
146
+ }
147
+ function read(values, name) {
148
+ return values[name];
149
+ }
150
+ function matchesRule(rule, values) {
151
+ return Object.entries(rule.when).every(([key, expected]) => {
152
+ const actual = read(values, key);
153
+ if (key.endsWith("Lt")) {
154
+ const source = numberish(read(values, key.slice(0, -2)));
155
+ return typeof expected === "number" && source != null && source < expected;
156
+ }
157
+ if (typeof expected === "boolean") return boolish(actual) === expected;
158
+ if (typeof expected === "number") return numberish(actual) === expected;
159
+ return normalizeKey(actual) === normalizeKey(expected);
160
+ });
161
+ }
162
+ function buildEmailStatus({
163
+ config,
164
+ values
165
+ }) {
166
+ const rawStatus = read(values, "rawStatus");
167
+ const rawScore = numberish(read(values, "rawScore"));
168
+ const valid = boolish(read(values, "valid"));
169
+ const catchAll = boolish(read(values, "catchAll"));
170
+ const disposable = boolish(read(values, "disposable"));
171
+ const abuse = boolish(read(values, "abuse"));
172
+ const spamtrap = boolish(read(values, "spamtrap"));
173
+ const suspect = boolish(read(values, "suspect"));
174
+ const rawKey = normalizeKey(rawStatus);
175
+ const mapped = config.rules?.find((rule) => matchesRule(rule, values)) ?? entryForStatus(rawKey, config.statusMap) ?? entryForStatus(valid == null ? null : String(valid), config.statusMap);
176
+ const status = mapped?.status ?? (disposable ? "disposable" : abuse ? "abuse" : spamtrap ? "spamtrap" : catchAll ? "catch_all" : valid === true ? "valid" : valid === false ? "invalid" : "unknown");
177
+ const defaultVerdict = status === "valid" ? "send" : status === "valid_catch_all" ? "send_with_caution" : status === "catch_all" ? "verify_next" : status === "unknown" ? "hold" : "drop";
178
+ const verdict = mapped?.verdict ?? defaultVerdict;
179
+ const verified = mapped?.verified ?? (status === "valid" || status === "valid_catch_all" || verdict === "send");
180
+ const reasons = [
181
+ mapped?.reason,
182
+ catchAll ? "catch_all_domain" : null,
183
+ mxClass(read(values, "mxProvider"), read(values, "mxRecord")) === "security_gateway" ? "security_gateway_mx" : null,
184
+ suspect ? "provider_marked_suspect" : null
185
+ ].filter((reason) => typeof reason === "string");
186
+ return {
187
+ verdict,
188
+ status,
189
+ verified,
190
+ confidence: rawScore,
191
+ reasons,
192
+ signals: {
193
+ catch_all: catchAll,
194
+ deliverability: deliverability(read(values, "deliverability")),
195
+ mx_class: mxClass(read(values, "mxProvider"), read(values, "mxRecord")),
196
+ mx_provider: stringish(read(values, "mxProvider")),
197
+ mx_record: stringish(read(values, "mxRecord")),
198
+ fraud_score: numberish(read(values, "fraudScore")),
199
+ disposable,
200
+ role_based: boolish(read(values, "roleBased")),
201
+ free_email: boolish(read(values, "freeEmail")),
202
+ abuse,
203
+ spamtrap,
204
+ suspect,
205
+ valid
206
+ },
207
+ provider: {
208
+ name: config.provider,
209
+ raw_status: typeof rawStatus === "string" || typeof rawStatus === "boolean" || typeof rawStatus === "number" ? rawStatus : null,
210
+ raw_score: rawScore
211
+ }
212
+ };
213
+ }
214
+
215
+ // ../plays/extractor-targets.ts
216
+ var JOB_CHANGE_STATUS_VALUES = [
217
+ "moved",
218
+ "no_change",
219
+ "left_company",
220
+ "unknown",
221
+ "profile_unavailable",
222
+ "no_new_company"
223
+ ];
224
+ var JOB_CHANGE_JSON_SCHEMA = {
225
+ type: "object",
226
+ required: ["status", "date", "new_company", "new_title"],
227
+ properties: {
228
+ status: { type: "string", enum: JOB_CHANGE_STATUS_VALUES },
229
+ date: { type: ["string", "null"] },
230
+ new_company: { type: ["string", "null"] },
231
+ new_title: { type: ["string", "null"] }
232
+ }
233
+ };
234
+ var PHONE_STATUS_VALUES = ["valid", "invalid", "unknown"];
235
+ var DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS = {
236
+ id: { identity: true, valueKind: "string" },
237
+ name: { identity: true, valueKind: "string" },
238
+ email: { identity: true, valueKind: "string" },
239
+ personal_email: { identity: true, valueKind: "string" },
240
+ phone: { identity: true, valueKind: "string" },
241
+ linkedin: { identity: true, valueKind: "string" },
242
+ linkedin_url: { identity: true, valueKind: "string" },
243
+ domain: { identity: true, valueKind: "string" },
244
+ website: { identity: true, valueKind: "string" },
245
+ first_name: { identity: true, valueKind: "string" },
246
+ last_name: { identity: true, valueKind: "string" },
247
+ full_name: { identity: true, valueKind: "string" },
248
+ company: { identity: true, valueKind: "string" },
249
+ company_name: { identity: true, valueKind: "string" },
250
+ organization_name: { identity: true, valueKind: "string" },
251
+ company_domain: { identity: true, valueKind: "string" },
252
+ company_website: { identity: true, valueKind: "string" },
253
+ company_linkedin_url: { identity: true, valueKind: "string" },
254
+ title: { identity: false, valueKind: "string" },
255
+ industry: { identity: false, valueKind: "string" },
256
+ status: { identity: false, valueKind: "string" },
257
+ job_change: { identity: false, valueKind: "job_change" },
258
+ job_change_status: {
259
+ identity: false,
260
+ valueKind: "job_change_status",
261
+ enum: JOB_CHANGE_STATUS_VALUES
262
+ },
263
+ email_status: { identity: false, valueKind: "email_status" },
264
+ phone_status: {
265
+ identity: false,
266
+ valueKind: "phone_status",
267
+ enum: PHONE_STATUS_VALUES
268
+ }
269
+ };
270
+ var DEEPLINE_EXTRACTOR_TARGETS = Object.keys(
271
+ DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS
272
+ );
273
+ function isDeeplineExtractorTarget(value) {
274
+ return value in DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS;
275
+ }
276
+
1
277
  // src/tool-output.ts
2
278
  import {
3
279
  closeSync,
@@ -380,6 +656,14 @@ function normalizeTableNamespace(value) {
380
656
  }
381
657
 
382
658
  export {
659
+ EMAIL_STATUS_JSON_SCHEMA,
660
+ buildEmailStatus,
661
+ JOB_CHANGE_STATUS_VALUES,
662
+ JOB_CHANGE_JSON_SCHEMA,
663
+ PHONE_STATUS_VALUES,
664
+ DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS,
665
+ DEEPLINE_EXTRACTOR_TARGETS,
666
+ isDeeplineExtractorTarget,
383
667
  stableStringify,
384
668
  sha256Hex,
385
669
  normalizeTableNamespace,
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  DeeplineClient
3
- } from "./chunk-2RC5JQ3C.mjs";
3
+ } from "./chunk-Y32GUTEN.mjs";
4
4
  import {
5
5
  printCommandEnvelope,
6
6
  renderCommandEnvelopeText
7
- } from "./chunk-MIMV5LTU.mjs";
7
+ } from "./chunk-HNLXC5BP.mjs";
8
8
  import {
9
9
  resolveConfig,
10
10
  sdkCliStateDirPath
11
- } from "./chunk-FGHRRJ3D.mjs";
11
+ } from "./chunk-IUYKSTWB.mjs";
12
12
 
13
13
  // src/cli/commands/search.ts
14
14
  import { Option } from "commander";
@@ -4,6 +4,21 @@ var _chunkAID3OYVJjs = require('./chunk-AID3OYVJ.js');
4
4
 
5
5
  // src/cli/described.ts
6
6
  var SHAPE = "{}";
7
+ function byokLines(byok) {
8
+ if (typeof byok.supported !== "boolean") {
9
+ return ["BYOK: unknown (this server does not report it)"];
10
+ }
11
+ if (!byok.supported) {
12
+ return [
13
+ "BYOK: not supported. Deepline runs this tool with its own credentials."
14
+ ];
15
+ }
16
+ return [
17
+ byok.required === true ? "BYOK: required. This tool runs only on your own provider credentials." : "BYOK: supported (optional).",
18
+ ...byok.setup ? [`Setup: ${byok.setup}`] : [],
19
+ ...byok.setupUrl ? [`Connect: ${byok.setupUrl}`] : []
20
+ ];
21
+ }
7
22
  var SCHEMA_LINE_LIMIT = 100;
8
23
  function isRecord(value) {
9
24
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -69,7 +84,9 @@ function schemaField(name, node, required) {
69
84
  required,
70
85
  ...example !== void 0 ? { example } : {},
71
86
  ...typeof schema.description === "string" && schema.description ? { description: schema.description } : {},
72
- ...fields ? { fields } : {}
87
+ ...fields ? { fields } : {},
88
+ ...schema.secondary === true ? { secondary: true } : {},
89
+ ...typeof schema.means === "string" ? { means: schema.means } : {}
73
90
  };
74
91
  }
75
92
  function withoutRefs(node, root, depth = 0) {
@@ -167,6 +184,7 @@ function namedShapes(roots) {
167
184
  under: field.name
168
185
  }));
169
186
  entry.count += 1;
187
+ entry.shape ??= field.shape;
170
188
  entry.descriptions.add(_nullishCoalesce(field.description, () => ( "")));
171
189
  seen.set(key, entry);
172
190
  field.fields.forEach(visit);
@@ -175,12 +193,12 @@ function namedShapes(roots) {
175
193
  const taken = /* @__PURE__ */ new Set();
176
194
  const named = /* @__PURE__ */ new Map();
177
195
  for (const [key, entry] of seen) {
178
- if (entry.count < 2) continue;
196
+ if (entry.count < 2 && !entry.shape) continue;
179
197
  const [description] = entry.descriptions.size === 1 ? [...entry.descriptions] : [""];
180
198
  const title = (_nullishCoalesce(description, () => ( ""))).split(/[.:]/)[0].trim();
181
- const base = pascalCase(
199
+ const base = _nullishCoalesce(entry.shape, () => ( (pascalCase(
182
200
  title && title.split(/\s+/).length <= 3 ? title : entry.fields.length <= 3 ? entry.fields.map((field) => field.name).join(" ") : entry.under
183
- ) || "Shape";
201
+ ) || "Shape")));
184
202
  let name = base;
185
203
  for (let n = 2; taken.has(name); n += 1) name = `${base}${n}`;
186
204
  taken.add(name);
@@ -213,23 +231,27 @@ function schemaBlocks(described, maxDepth, everyField = false) {
213
231
  const example = field.example === void 0 ? void 0 : JSON.stringify(field.example);
214
232
  const start = `${indent}${JSON.stringify(field.name)}${field.required ? "" : "?"}: `;
215
233
  if (!field.fields) {
216
- return [`${start}${field.type},${comment([example, field.description])}`];
234
+ return [
235
+ `${start}${field.type},${comment([field.means, example, field.description])}`
236
+ ];
217
237
  }
218
238
  const [before, after] = field.type.split(SHAPE);
219
239
  const shape = shapes.get(shapeKey(field.fields));
220
240
  if (shape) {
221
241
  if (!used.includes(shape)) used.push(shape);
222
242
  const own = field.description === shape.description ? void 0 : field.description;
223
- return [`${start}${before}${shape.name}${after},${comment([own])}`];
243
+ return [
244
+ `${start}${before}${shape.name}${after},${comment([field.means, own])}`
245
+ ];
224
246
  }
225
247
  if (depth >= maxDepth || field.summarized && !everyField) {
226
248
  const names = field.fields.map((child) => child.name).join(", ");
227
249
  return [
228
- `${start}${before}{ ${names} }${after},${comment([field.description])}`
250
+ `${start}${before}{ ${names} }${after},${comment([field.means, field.description])}`
229
251
  ];
230
252
  }
231
253
  return [
232
- `${start}${before}{${comment([field.description])}`,
254
+ `${start}${before}{${comment([field.means, field.description])}`,
233
255
  ...field.fields.flatMap(
234
256
  (child) => fieldLines(child, `${indent} `, depth + 1)
235
257
  ),
@@ -255,8 +277,70 @@ function schemaBlocks(described, maxDepth, everyField = false) {
255
277
  }
256
278
  return [...lines, ...types.length ? ["", "Types:", ...types] : []];
257
279
  }
258
- function schemaLines(described, options) {
259
- if (options.full) return schemaBlocks(described, Infinity, true);
280
+ function selectFields(described, wanted) {
281
+ const hidden = [];
282
+ const keep = (fields, isInput, path = []) => fields.flatMap((field) => {
283
+ const name = [...path, field.name];
284
+ if (!(isInput && field.required) && !wanted(field, path.length)) {
285
+ hidden.push(name.join("."));
286
+ return [];
287
+ }
288
+ return [
289
+ field.fields ? { ...field, fields: keep(field.fields, isInput, name) } : field
290
+ ];
291
+ });
292
+ const inputs = keep(described.inputs, true);
293
+ const rowInputs = described.rowInputs && keep(described.rowInputs, true);
294
+ const outputs = keep(described.outputs, false);
295
+ const rowOutputs = described.rowOutputs && keep(described.rowOutputs, false);
296
+ return {
297
+ selected: {
298
+ ...described,
299
+ inputs,
300
+ outputs,
301
+ ...rowInputs ? { rowInputs } : {},
302
+ ...rowOutputs ? { rowOutputs } : {}
303
+ },
304
+ hidden
305
+ };
306
+ }
307
+ function schemaLines(described, view) {
308
+ const count = (names) => `${names.length} ${names.length === 1 ? "field" : "fields"}`;
309
+ if (view.fields) {
310
+ const names = view.fields;
311
+ const { selected, hidden } = selectFields(
312
+ described,
313
+ (field, depth) => depth > 0 || names.includes(field.name)
314
+ );
315
+ const known = new Set(
316
+ [
317
+ described.inputs,
318
+ described.outputs,
319
+ _nullishCoalesce(described.rowInputs, () => ( [])),
320
+ _nullishCoalesce(described.rowOutputs, () => ( []))
321
+ ].flatMap((fields) => fields.map((field) => field.name))
322
+ );
323
+ const unknown = names.filter((name) => !known.has(name));
324
+ return [
325
+ ...schemaLines(selected, { full: true, secondary: true }),
326
+ ...unknown.length ? ["", `No field named: ${unknown.join(", ")}.`] : [],
327
+ ...hidden.length ? ["", `${count(hidden)} not shown: ${hidden.join(", ")}.`] : []
328
+ ];
329
+ }
330
+ if (!view.full && !view.secondary) {
331
+ const { selected, hidden } = selectFields(
332
+ described,
333
+ (field) => !field.secondary
334
+ );
335
+ return [
336
+ ...schemaLines(selected, { ...view, secondary: true }),
337
+ ...hidden.length ? [
338
+ "",
339
+ `${count(hidden).replace(" ", " secondary ")} hidden: ${hidden.join(", ")}. --verbose shows ${hidden.length === 1 ? "it" : "them"}.`
340
+ ] : []
341
+ ];
342
+ }
343
+ if (view.full) return schemaBlocks(described, Infinity, true);
260
344
  const raw = _optionalChain([described, 'access', _ => _.rawResponse, 'optionalAccess', _2 => _2.length]) ? [
261
345
  "",
262
346
  `Other response fields (${described.rawResponse.map((field) => field.name).join(", ")}) are in result.toolResponse.rawV2. --full-schema lists them.`
@@ -284,7 +368,7 @@ function examples(described, options) {
284
368
  const input = JSON.stringify(
285
369
  Object.fromEntries(shown.map((field) => [field.name, exampleValue(field)]))
286
370
  );
287
- const read = options.verbose ? described.outputs : described.outputs.slice(0, 1);
371
+ const read = options.verbose ? described.outputs : described.outputs.filter((field) => !field.secondary).slice(0, 1);
288
372
  const reads = (expression) => read.flatMap((field) => {
289
373
  const source = expression(field);
290
374
  return source ? [`const ${safeIdentifier(field.name)} = ${source};`] : [];
@@ -338,7 +422,17 @@ function describedLines(described, view) {
338
422
  ...described.cost ? [`Cost: ${described.cost}`] : [],
339
423
  ...described.guidance.map((line) => `Guidance: ${line}`),
340
424
  ...described.rateLimit ? [`Rate limit: ${described.rateLimit}`] : [],
341
- ...schemaLines(described, { full: view.fullSchema }),
425
+ ...described.byok ? byokLines(described.byok) : [],
426
+ ...schemaLines(described, {
427
+ full: view.fullSchema,
428
+ secondary: view.verbose,
429
+ ...view.fields ? { fields: view.fields } : {}
430
+ }),
431
+ ...section(
432
+ described.exclusive ? [
433
+ `Give "${described.exclusive.field}" or ${described.exclusive.with.map((name) => `"${name}"`).join(", ")}, not both: per-row values go in the CSV.`
434
+ ] : []
435
+ ),
342
436
  ...section(
343
437
  view.cli ? [
344
438
  "Run from the CLI:",
@@ -361,6 +455,88 @@ function describedLines(described, view) {
361
455
  function topLevelField({ fields: _fields, ...field }) {
362
456
  return { ...field, type: field.type.replace(SHAPE, "object") };
363
457
  }
458
+ function jsonFields(fields, options) {
459
+ return Object.fromEntries(
460
+ fields.filter(
461
+ (field) => options.secondary || !field.secondary || options.input && field.required
462
+ ).map((field) => {
463
+ const shape = field.fields && options.shapes.get(shapeKey(field.fields));
464
+ if (shape) options.used.add(shape);
465
+ return [
466
+ field.name,
467
+ {
468
+ type: field.type.replace(SHAPE, _nullishCoalesce(_optionalChain([shape, 'optionalAccess', _3 => _3.name]), () => ( "object"))),
469
+ ...options.input ? { required: field.required } : {},
470
+ ...field.means ? { means: field.means } : {},
471
+ ...field.example !== void 0 ? { example: field.example } : {},
472
+ ...field.description && field.description !== _optionalChain([shape, 'optionalAccess', _4 => _4.description]) ? { description: field.description } : {},
473
+ ...field.secondary ? { secondary: true } : {},
474
+ ...field.read ? { read: field.read } : {},
475
+ ...field.in ? { in: field.in } : {},
476
+ ..._optionalChain([field, 'access', _5 => _5.paths, 'optionalAccess', _6 => _6.length]) ? { paths: field.paths } : {},
477
+ ...field.fields && !shape ? { fields: jsonFields(field.fields, options) } : {}
478
+ }
479
+ ];
480
+ })
481
+ );
482
+ }
483
+ function describedJson(described, view) {
484
+ const sections = [
485
+ ["inputs", described.inputs, true],
486
+ ["rowInputs", described.rowInputs, true],
487
+ ["outputs", described.outputs, false],
488
+ ["rowOutputs", described.rowOutputs, false]
489
+ ];
490
+ const hidden = view.secondary ? [] : sections.flatMap(
491
+ ([, fields, input]) => (_nullishCoalesce(fields, () => ( []))).filter((field) => field.secondary && !(input && field.required)).map((field) => field.name)
492
+ );
493
+ const shapes = namedShapes(sections.flatMap(([, fields]) => _nullishCoalesce(fields, () => ( []))));
494
+ const used = /* @__PURE__ */ new Set();
495
+ const blocks = Object.fromEntries(
496
+ sections.flatMap(
497
+ ([key, fields, input]) => _optionalChain([fields, 'optionalAccess', _7 => _7.length]) ? [
498
+ [
499
+ key,
500
+ jsonFields(fields, {
501
+ input,
502
+ secondary: view.secondary,
503
+ shapes,
504
+ used
505
+ })
506
+ ]
507
+ ] : []
508
+ )
509
+ );
510
+ const types = {};
511
+ for (const shape of used) {
512
+ types[shape.name] = {
513
+ ...shape.description ? { description: shape.description } : {},
514
+ fields: jsonFields(shape.fields, {
515
+ input: false,
516
+ secondary: true,
517
+ shapes,
518
+ used
519
+ })
520
+ };
521
+ }
522
+ const { cli, play } = examples(described, { verbose: view.verbose });
523
+ return {
524
+ kind: described.kind,
525
+ id: described.id,
526
+ ...described.displayName ? { displayName: described.displayName } : {},
527
+ ...described.description ? { description: described.description } : {},
528
+ ...described.cost ? { cost: described.cost } : {},
529
+ ...described.rateLimit ? { rateLimit: described.rateLimit } : {},
530
+ ...described.byok ? { byok: described.byok } : {},
531
+ ...described.guidance.length ? { guidance: described.guidance } : {},
532
+ ...blocks,
533
+ ...used.size ? { types } : {},
534
+ ...described.exclusive ? { exclusive: described.exclusive } : {},
535
+ run: { cli, ...play ? { play } : {} },
536
+ ...described.source ? { source: described.source } : {},
537
+ ...hidden.length ? { hidden } : {}
538
+ };
539
+ }
364
540
 
365
541
  // src/cli/execution-observation.ts
366
542
  var _fs = require('fs');
@@ -406,7 +582,7 @@ function addDescribeOptions(command, options = {}) {
406
582
  "Show the Deepline tool or play, not a play your workspace created under the same name"
407
583
  ).option("--tool", "Same as --prebuilt").option(
408
584
  "--verbose",
409
- "Examples fill in every input and read every output, not only required ones"
585
+ "Show secondary fields, and fill in every input and read every output in the examples"
410
586
  ).option(
411
587
  "--cli-example",
412
588
  "Show only the CLI example, and explain how it takes inputs and returns outputs"
@@ -416,6 +592,9 @@ function addDescribeOptions(command, options = {}) {
416
592
  ).option("--no-example", "Hide the run examples").option(
417
593
  "--full-schema",
418
594
  `Print every field: a long schema unfolded (over ${SCHEMA_LINE_LIMIT} lines), list rows, and a tool's raw response`
595
+ ).option(
596
+ "--fields <names>",
597
+ "Show only these fields, comma-separated, plus every required input"
419
598
  ).option(
420
599
  "-o, --out <path>",
421
600
  "Save the output to this file instead of printing it"
@@ -426,6 +605,12 @@ function addDescribeOptions(command, options = {}) {
426
605
  "Print only the schema, with every field, and nothing else"
427
606
  );
428
607
  }
608
+ if (options.byok !== false) {
609
+ command.option(
610
+ "--byok",
611
+ "For a tool, also show whether it can run on your own provider credentials, and how to connect them (always shown when it must)"
612
+ );
613
+ }
429
614
  if (options.json !== false) {
430
615
  command.option(
431
616
  "--json",
@@ -447,4 +632,6 @@ function addDescribeOptions(command, options = {}) {
447
632
 
448
633
 
449
634
 
450
- exports.SCHEMA_LINE_LIMIT = SCHEMA_LINE_LIMIT; exports.schemaField = schemaField; exports.schemaFields = schemaFields; exports.rateLimitSummary = rateLimitSummary; exports.schemaLines = schemaLines; exports.examples = examples; exports.describedLines = describedLines; exports.topLevelField = topLevelField; exports.recordApiResponse = recordApiResponse; exports.recordPlayTermination = recordPlayTermination; exports.addDescribeOptions = addDescribeOptions;
635
+
636
+
637
+ exports.byokLines = byokLines; exports.SCHEMA_LINE_LIMIT = SCHEMA_LINE_LIMIT; exports.schemaField = schemaField; exports.schemaFields = schemaFields; exports.rateLimitSummary = rateLimitSummary; exports.schemaLines = schemaLines; exports.examples = examples; exports.describedLines = describedLines; exports.topLevelField = topLevelField; exports.describedJson = describedJson; exports.recordApiResponse = recordApiResponse; exports.recordPlayTermination = recordPlayTermination; exports.addDescribeOptions = addDescribeOptions;
@@ -3,13 +3,13 @@ import {
3
3
  MONITOR_JOB_PHASES,
4
4
  MONITOR_JOB_RECONCILIATION_STATES,
5
5
  MONITOR_JOB_STATES
6
- } from "./chunk-2RC5JQ3C.mjs";
6
+ } from "./chunk-Y32GUTEN.mjs";
7
7
  import "./chunk-6IKARAYD.mjs";
8
8
  import "./chunk-CBVIJSHF.mjs";
9
- import "./chunk-FGHRRJ3D.mjs";
9
+ import "./chunk-IUYKSTWB.mjs";
10
10
  import "./chunk-DLIRSHV6.mjs";
11
11
  import "./chunk-NXGCO4JB.mjs";
12
- import "./chunk-JAERLCMH.mjs";
12
+ import "./chunk-P5JPGZNI.mjs";
13
13
  import "./chunk-WZYKRD7T.mjs";
14
14
  import "./chunk-KRD6H754.mjs";
15
15
  export {