deepline 0.3.395 → 0.3.397

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 (126) hide show
  1. package/dist/bundling-sources/sdk/src/plays/play-description.ts +1 -1
  2. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  3. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +1 -1
  4. package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +2 -2
  5. package/dist/cli/{auth-NMQXZRS7.mjs → auth-AZJFXGKP.mjs} +5 -4
  6. package/dist/cli/auth-CZJQU7B5.js +40 -0
  7. package/dist/cli/{billing-Z4JTGUU3.js → billing-MQV5AGDJ.js} +77 -76
  8. package/dist/cli/{billing-5MVXZRS6.mjs → billing-MZAAUHGH.mjs} +6 -5
  9. package/dist/cli/{chunk-6D7A2FSL.mjs → chunk-2LDADJNO.mjs} +7 -107
  10. package/dist/cli/{chunk-UKU6JM3S.js → chunk-3VP34TAU.js} +8 -8
  11. package/dist/cli/{chunk-7XAM7KDW.mjs → chunk-4D745XZO.mjs} +21 -108
  12. package/dist/cli/chunk-7DRPTGCK.js +930 -0
  13. package/dist/cli/{chunk-ZMVJSS6N.js → chunk-BQR6UN3C.js} +62 -78
  14. package/dist/cli/{chunk-HRWUQJ4K.js → chunk-DQ65ZVHN.js} +6 -6
  15. package/dist/cli/{chunk-5VCZ3WRH.mjs → chunk-EIMG75BT.mjs} +1 -0
  16. package/dist/cli/{chunk-EFLQHJZ6.mjs → chunk-F3BUFYKE.mjs} +182 -1031
  17. package/dist/cli/chunk-FIVKWNMT.mjs +210 -0
  18. package/dist/cli/{describe-DBRY5BNK.mjs → chunk-HFYQBC2D.mjs} +51 -171
  19. package/dist/cli/chunk-HGFFYVXN.js +210 -0
  20. package/dist/cli/{chunk-VB6KECLU.mjs → chunk-IHG7UAHD.mjs} +63 -79
  21. package/dist/cli/{chunk-TO2MWPGR.js → chunk-IZ74ABSX.js} +1 -1
  22. package/dist/cli/{chunk-G4IWGRMK.mjs → chunk-J7ABTQQ7.mjs} +5 -3
  23. package/dist/cli/{chunk-LZLBR2SF.js → chunk-K33MXVXQ.js} +323 -1172
  24. package/dist/cli/{chunk-DRM3CMHL.js → chunk-KXMNM4AQ.js} +2 -1
  25. package/dist/cli/chunk-LJ5747UC.mjs +107 -0
  26. package/dist/cli/{chunk-BON3DRC6.mjs → chunk-MRXMMERY.mjs} +1 -1
  27. package/dist/cli/{chunk-7MVWUXOD.mjs → chunk-MV7QRALK.mjs} +3 -3
  28. package/dist/cli/{chunk-WCCKMLHL.mjs → chunk-MYPH2LUU.mjs} +2 -2
  29. package/dist/cli/{chunk-RDXFGPJU.js → chunk-NA4T3B62.js} +64 -272
  30. package/dist/cli/{chunk-BLYL3KOC.mjs → chunk-NOX2TCBP.mjs} +1 -1
  31. package/dist/cli/chunk-OSDXE27V.mjs +88 -0
  32. package/dist/cli/{chunk-R4XZO6Z5.js → chunk-PSGEDGLT.js} +28 -115
  33. package/dist/cli/chunk-Q2E4E4FJ.js +112 -0
  34. package/dist/cli/chunk-RFG3MRAC.js +286 -0
  35. package/dist/cli/{chunk-47M6HPGP.mjs → chunk-RNSWDKBM.mjs} +1 -1
  36. package/dist/cli/{chunk-56IFFVIB.js → chunk-RYW4HPSM.js} +21 -121
  37. package/dist/cli/{chunk-K5T3EN6D.js → chunk-SO7RUVTY.js} +26 -26
  38. package/dist/cli/{chunk-KZZC33PY.mjs → chunk-TXZVVBQZ.mjs} +63 -271
  39. package/dist/cli/{chunk-36ML3YKA.js → chunk-UVXBVUZQ.js} +15 -13
  40. package/dist/cli/{chunk-PZ5BZ76S.js → chunk-VTF4RRWJ.js} +50 -50
  41. package/dist/cli/{chunk-3TRY7KAC.mjs → chunk-W3HMGKMI.mjs} +2 -2
  42. package/dist/cli/{chunk-ZWH2TFA7.mjs → chunk-WM2QEHZL.mjs} +2 -2
  43. package/dist/cli/chunk-YHPYUZZX.mjs +112 -0
  44. package/dist/cli/chunk-YHZUZO3U.mjs +930 -0
  45. package/dist/cli/{chunk-UCXK2DS4.js → chunk-YLRME7MK.js} +15 -15
  46. package/dist/cli/{chunk-MYIBHORT.js → chunk-YSVORIEW.js} +2 -2
  47. package/dist/cli/{chunk-OCSG6X67.mjs → chunk-YUDKBQUD.mjs} +4 -4
  48. package/dist/cli/chunk-ZAAKSJAS.js +88 -0
  49. package/dist/cli/{chunk-VYLJJQ7Y.js → chunk-ZHUMDMOS.js} +65 -65
  50. package/dist/cli/chunk-ZM2YPJQJ.js +107 -0
  51. package/dist/cli/{csv-HTS5ZYQ4.js → csv-AQBQ5O3I.js} +13 -12
  52. package/dist/cli/{csv-SVOD5UBH.mjs → csv-MB7PJMYQ.mjs} +4 -3
  53. package/dist/cli/{db-7AP4P52N.js → db-JPUYC5RB.js} +31 -30
  54. package/dist/cli/{db-7QLNI3Q4.mjs → db-L5IEI2AU.mjs} +6 -5
  55. package/dist/cli/describe-6WT74AOR.js +164 -0
  56. package/dist/cli/describe-S6BFANVI.mjs +164 -0
  57. package/dist/cli/describe-core.d.mts +100 -0
  58. package/dist/cli/describe-core.d.ts +100 -0
  59. package/dist/cli/describe-core.js +18 -0
  60. package/dist/cli/describe-core.mjs +18 -0
  61. package/dist/cli/{executions-GRQXTB2P.js → executions-6TMQTFP4.js} +8 -7
  62. package/dist/cli/{executions-QNZTPNG4.mjs → executions-L7I2ZW4Z.mjs} +6 -5
  63. package/dist/cli/{feedback-JMCSR624.mjs → feedback-DSJ63HK6.mjs} +4 -3
  64. package/dist/cli/{feedback-ZOLA2KY7.js → feedback-XF7CQGMD.js} +8 -7
  65. package/dist/cli/{git-LJGL2IHS.mjs → git-C3ENM67D.mjs} +5 -4
  66. package/dist/cli/git-HYDZK2QR.js +24 -0
  67. package/dist/cli/index.js +96 -94
  68. package/dist/cli/index.mjs +41 -39
  69. package/dist/cli/{legacy-noops-YSCIR2SD.js → legacy-noops-B2NHWIVD.js} +8 -7
  70. package/dist/cli/{legacy-noops-F23PKVBN.mjs → legacy-noops-VFG2K6HK.mjs} +5 -4
  71. package/dist/cli/{monitors-WMZ6HJZX.js → monitors-ORFWOVZB.js} +87 -86
  72. package/dist/cli/{monitors-S4LOEL7W.mjs → monitors-TCEDBDGY.mjs} +6 -5
  73. package/dist/cli/{org-U3WA2NQM.mjs → org-45KREIKZ.mjs} +6 -5
  74. package/dist/cli/{org-PFHM5ZLY.js → org-T74CJESN.js} +66 -65
  75. package/dist/cli/{chunk-XMAPE2KH.mjs → play-MU7MYBIM.mjs} +78 -131
  76. package/dist/cli/{chunk-4KLCLLTO.js → play-XHK2LPON.js} +273 -326
  77. package/dist/cli/{providers-XYMHLKCA.js → providers-4MGQKYFD.js} +9 -8
  78. package/dist/cli/{providers-QBBRFBOH.mjs → providers-VYCXIJT5.mjs} +6 -5
  79. package/dist/cli/{quickstart-IYGD6ZY3.js → quickstart-47G3VEOT.js} +6 -5
  80. package/dist/cli/{quickstart-5JTDGISY.mjs → quickstart-H724EFM2.mjs} +4 -3
  81. package/dist/cli/search-3356ENLD.js +30 -0
  82. package/dist/cli/{search-X6W6GRHS.mjs → search-VQHXEFQ4.mjs} +8 -6
  83. package/dist/cli/{secrets-UHG6OQFD.js → secrets-ALLKCU35.js} +15 -14
  84. package/dist/cli/{secrets-N55B67H6.mjs → secrets-CPBNGA44.mjs} +6 -5
  85. package/dist/cli/{sessions-JTRSTDSS.mjs → sessions-7RSQB7IX.mjs} +5 -4
  86. package/dist/cli/sessions-FKGAY7WQ.js +16 -0
  87. package/dist/cli/{settings-Q24HRAQI.mjs → settings-UYSGV4IC.mjs} +9 -8
  88. package/dist/cli/{settings-ATX4U5AS.js → settings-Y5BI42P7.js} +76 -75
  89. package/dist/cli/{setup-77ZWLVHT.mjs → setup-L3ZBBTS4.mjs} +7 -6
  90. package/dist/cli/{setup-EJCNOUCE.js → setup-VXQPEU3E.js} +42 -41
  91. package/dist/cli/skills-DUZQTDTE.js +29 -0
  92. package/dist/cli/{skills-XIS5AWQI.mjs → skills-QHVDLSFE.mjs} +5 -4
  93. package/dist/cli/{tools-WCKLYEGQ.mjs → tools-LSCEK4K2.mjs} +16 -19
  94. package/dist/cli/tools-YWU5QOQ5.js +39 -0
  95. package/dist/cli/update-5LYQAI55.js +29 -0
  96. package/dist/cli/{update-UT5WANMV.mjs → update-CU22OTBM.mjs} +7 -6
  97. package/dist/cli/{workflow-226QYUN2.js → workflow-ERFLTRNX.js} +17 -16
  98. package/dist/cli/{workflow-ZMX3L4ML.mjs → workflow-KQARK5BZ.mjs} +7 -6
  99. package/dist/{client-hdFtwhTm.d.mts → client-D0j-_aaa.d.mts} +2 -1
  100. package/dist/{client-CivP-PAI.d.ts → client-DflfVyj6.d.ts} +2 -1
  101. package/dist/index.d.mts +2 -2
  102. package/dist/index.d.ts +2 -2
  103. package/dist/index.js +15 -11
  104. package/dist/index.mjs +19 -15
  105. package/dist/install-integrity.json +94 -80
  106. package/dist/plays/play-description.d.mts +1 -1
  107. package/dist/plays/play-description.d.ts +1 -1
  108. package/dist/plays/play-description.js +4 -2
  109. package/dist/plays/play-description.mjs +3 -1
  110. package/dist/plays/run-request.d.mts +1 -1
  111. package/dist/plays/run-request.d.ts +1 -1
  112. package/dist/release.d.mts +1 -1
  113. package/dist/release.d.ts +1 -1
  114. package/dist/release.js +2 -2
  115. package/dist/release.mjs +1 -1
  116. package/package.json +6 -1
  117. package/dist/cli/auth-UYCOBAL5.js +0 -39
  118. package/dist/cli/describe-YKOE54ZO.js +0 -406
  119. package/dist/cli/git-EJQLRK27.js +0 -23
  120. package/dist/cli/play-AGSECQFN.mjs +0 -159
  121. package/dist/cli/play-BR2LWGXK.js +0 -159
  122. package/dist/cli/search-ZVSYH5GY.js +0 -28
  123. package/dist/cli/sessions-57L5MGHN.js +0 -15
  124. package/dist/cli/skills-SPXUBLII.js +0 -28
  125. package/dist/cli/tools-DBHUUZJX.js +0 -42
  126. package/dist/cli/update-VSNFXRHJ.js +0 -28
@@ -126,4 +126,5 @@ function describePlayDetail(detail, options = {}) {
126
126
 
127
127
 
128
128
 
129
- exports.CSV_HEADER_MATCHING_NOTE = CSV_HEADER_MATCHING_NOTE; exports.playInputExampleArgs = playInputExampleArgs; exports.describePlayListItem = describePlayListItem; exports.describePlayDetail = describePlayDetail;
129
+
130
+ exports.CSV_HEADER_MATCHING_NOTE = CSV_HEADER_MATCHING_NOTE; exports.playInputExampleArgs = playInputExampleArgs; exports.cloneEditStarter = cloneEditStarter; exports.describePlayListItem = describePlayListItem; exports.describePlayDetail = describePlayDetail;
@@ -0,0 +1,107 @@
1
+ // src/cli/tool-description.ts
2
+ function observedMaxText(pricing) {
3
+ const max = recordValue(recordValue(pricing).observedMax);
4
+ return typeof max.creditsPerCall === "number" && max.creditsPerCall > 0 ? `max observed ${max.creditsPerCall} credits/call (last ${String(max.windowDays)} days)` : "";
5
+ }
6
+ var Capability = class _Capability {
7
+ #catalogEntry;
8
+ constructor(catalogEntry) {
9
+ this.#catalogEntry = catalogEntry;
10
+ }
11
+ static fromCatalogEntry(catalogEntry) {
12
+ return new _Capability(catalogEntry);
13
+ }
14
+ describe() {
15
+ return CapabilityDescription.fromCatalogEntry(this.#catalogEntry);
16
+ }
17
+ };
18
+ var CapabilityDescription = class _CapabilityDescription {
19
+ #catalogEntry;
20
+ constructor(catalogEntry) {
21
+ this.#catalogEntry = catalogEntry;
22
+ }
23
+ static fromCatalogEntry(catalogEntry) {
24
+ return new _CapabilityDescription(catalogEntry);
25
+ }
26
+ /**
27
+ * The customer price already resolved by the catalog. This intentionally
28
+ * omits provider-price fields, even when a catalog Adapter carried them.
29
+ */
30
+ customerCost() {
31
+ const legacyCost = recordValue(this.#catalogEntry.cost);
32
+ const pricing = recordValue(this.#catalogEntry.pricing);
33
+ const unit = stringValue(pricing.unit);
34
+ const legacyPricingModel = stringValue(
35
+ legacyCost.pricingModel ?? legacyCost.pricing_model
36
+ );
37
+ const pricingModel = unit === "call" ? "fixed" : unit === "result" || unit === "page" ? `per_${unit}` : unit === "usage" ? "provider_usage" : legacyPricingModel;
38
+ const canonicalCredits = pricingNumber(
39
+ pricing,
40
+ "creditsPerUnit",
41
+ "credits_per_unit",
42
+ this.#catalogEntry.deeplineCreditsPerPricingUnit ?? this.#catalogEntry.deepline_credits_per_pricing_unit
43
+ );
44
+ const canonicalUsd = pricingNumber(
45
+ pricing,
46
+ "usdPerUnit",
47
+ "usd_per_unit",
48
+ this.#catalogEntry.deeplineUsdPerPricingUnit ?? this.#catalogEntry.deepline_usd_per_pricing_unit
49
+ );
50
+ const billingSource = stringValue(
51
+ this.#catalogEntry.billingSource ?? this.#catalogEntry.billing_source
52
+ );
53
+ const billingSourceLabel = stringValue(
54
+ this.#catalogEntry.billingSourceLabel ?? this.#catalogEntry.billing_source_label
55
+ );
56
+ const isFree = billingSource === "free";
57
+ return {
58
+ pricingModel: pricingModel || null,
59
+ unit: unit || null,
60
+ displayText: isFree ? "Free" : stringValue(pricing.displayText ?? pricing.display_text),
61
+ summary: isFree ? null : stringValue(pricing.summary),
62
+ billingMode: stringValue(
63
+ legacyCost.billingMode ?? legacyCost.billing_mode
64
+ ),
65
+ billingSource,
66
+ billingSourceLabel,
67
+ deeplineCreditsPerPricingUnit: isFree ? 0 : canonicalCredits,
68
+ deeplineUsdPerPricingUnit: isFree ? 0 : canonicalUsd,
69
+ ...pricing.estimatedRange && !isFree && billingSource !== "own_provider_credentials" ? {
70
+ estimatedRange: pricing.estimatedRange,
71
+ details: Array.isArray(pricing.details) ? pricing.details.filter(
72
+ (value) => typeof value === "string"
73
+ ) : []
74
+ } : {},
75
+ ...pricing.observedReference && !isFree && billingSource !== "own_provider_credentials" ? {
76
+ observedReference: pricing.observedReference,
77
+ details: Array.isArray(pricing.details) ? pricing.details.filter(
78
+ (value) => typeof value === "string"
79
+ ) : []
80
+ } : {},
81
+ ...pricing.observedMax && !isFree && billingSource !== "own_provider_credentials" ? {
82
+ observedMax: pricing.observedMax
83
+ } : {}
84
+ };
85
+ }
86
+ };
87
+ function recordValue(value) {
88
+ return value && typeof value === "object" && !Array.isArray(value) ? value : {};
89
+ }
90
+ function stringValue(value) {
91
+ return typeof value === "string" && value.trim() ? value : null;
92
+ }
93
+ function numberValue(value) {
94
+ return typeof value === "number" && Number.isFinite(value) ? value : null;
95
+ }
96
+ function pricingNumber(pricing, canonicalKey, aliasKey, legacyValue) {
97
+ for (const key of [canonicalKey, aliasKey]) {
98
+ if (Object.prototype.hasOwnProperty.call(pricing, key))
99
+ return numberValue(pricing[key]);
100
+ }
101
+ return numberValue(legacyValue);
102
+ }
103
+
104
+ export {
105
+ observedMaxText,
106
+ Capability
107
+ };
@@ -49,7 +49,7 @@ var SDK_RELEASE = {
49
49
  // getters keep their established compatibility behavior.
50
50
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
51
51
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
52
- version: "0.3.395",
52
+ version: "0.3.397",
53
53
  updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
54
54
  packageCapabilities: {
55
55
  updatePreferences: 1,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-GAMFK2ZP.mjs";
4
4
  import {
5
5
  printCommandEnvelope
6
- } from "./chunk-47M6HPGP.mjs";
6
+ } from "./chunk-RNSWDKBM.mjs";
7
7
  import {
8
8
  DEFAULT_SKILL_AGENTS,
9
9
  KNOWN_SKILL_AGENTS,
@@ -22,13 +22,13 @@ import {
22
22
  sdkCliStateDirPath,
23
23
  skillsAgentPathSegment,
24
24
  writeSdkSkillsLocalVersion
25
- } from "./chunk-6D7A2FSL.mjs";
25
+ } from "./chunk-2LDADJNO.mjs";
26
26
  import {
27
27
  DeeplineError
28
28
  } from "./chunk-NXGCO4JB.mjs";
29
29
  import {
30
30
  SDK_RELEASE
31
- } from "./chunk-BON3DRC6.mjs";
31
+ } from "./chunk-MRXMMERY.mjs";
32
32
 
33
33
  // src/cli/commands/skills.ts
34
34
  import { spawn as spawn2 } from "child_process";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  getAuthedHttpClient,
3
3
  printCommandEnvelope
4
- } from "./chunk-47M6HPGP.mjs";
4
+ } from "./chunk-RNSWDKBM.mjs";
5
5
  import {
6
6
  agentSessionIdFromEnvironment
7
- } from "./chunk-6D7A2FSL.mjs";
7
+ } from "./chunk-2LDADJNO.mjs";
8
8
 
9
9
  // src/cli/commands/sessions.ts
10
10
  import {
@@ -1,4 +1,66 @@
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; }// ../plays/email-status.ts
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; }// ../plays/extractor-targets.ts
2
+ var JOB_CHANGE_STATUS_VALUES = [
3
+ "moved",
4
+ "no_change",
5
+ "left_company",
6
+ "unknown",
7
+ "profile_unavailable",
8
+ "no_new_company"
9
+ ];
10
+ var JOB_CHANGE_JSON_SCHEMA = {
11
+ type: "object",
12
+ required: ["status", "date", "new_company", "new_title"],
13
+ properties: {
14
+ status: { type: "string", enum: JOB_CHANGE_STATUS_VALUES },
15
+ date: { type: ["string", "null"] },
16
+ new_company: { type: ["string", "null"] },
17
+ new_title: { type: ["string", "null"] }
18
+ }
19
+ };
20
+ var PHONE_STATUS_VALUES = ["valid", "invalid", "unknown"];
21
+ var DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS = {
22
+ id: { identity: true, valueKind: "string" },
23
+ name: { identity: true, valueKind: "string" },
24
+ email: { identity: true, valueKind: "string" },
25
+ personal_email: { identity: true, valueKind: "string" },
26
+ phone: { identity: true, valueKind: "string" },
27
+ linkedin: { identity: true, valueKind: "string" },
28
+ linkedin_url: { identity: true, valueKind: "string" },
29
+ domain: { identity: true, valueKind: "string" },
30
+ website: { identity: true, valueKind: "string" },
31
+ first_name: { identity: true, valueKind: "string" },
32
+ last_name: { identity: true, valueKind: "string" },
33
+ full_name: { identity: true, valueKind: "string" },
34
+ company: { identity: true, valueKind: "string" },
35
+ company_name: { identity: true, valueKind: "string" },
36
+ organization_name: { identity: true, valueKind: "string" },
37
+ company_domain: { identity: true, valueKind: "string" },
38
+ company_website: { identity: true, valueKind: "string" },
39
+ company_linkedin_url: { identity: true, valueKind: "string" },
40
+ title: { identity: false, valueKind: "string" },
41
+ industry: { identity: false, valueKind: "string" },
42
+ status: { identity: false, valueKind: "string" },
43
+ job_change: { identity: false, valueKind: "job_change" },
44
+ job_change_status: {
45
+ identity: false,
46
+ valueKind: "job_change_status",
47
+ enum: JOB_CHANGE_STATUS_VALUES
48
+ },
49
+ email_status: { identity: false, valueKind: "email_status" },
50
+ phone_status: {
51
+ identity: false,
52
+ valueKind: "phone_status",
53
+ enum: PHONE_STATUS_VALUES
54
+ }
55
+ };
56
+ var DEEPLINE_EXTRACTOR_TARGETS = Object.keys(
57
+ DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS
58
+ );
59
+ function isDeeplineExtractorTarget(value) {
60
+ return value in DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS;
61
+ }
62
+
63
+ // ../plays/email-status.ts
2
64
  var nullable = (type) => ({ type: [type, "null"] });
3
65
  var oneOf = (values) => ({ type: "string", enum: values });
4
66
  var EMAIL_STATUS_JSON_SCHEMA = {
@@ -212,276 +274,6 @@ function buildEmailStatus({
212
274
  };
213
275
  }
214
276
 
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
-
277
- // src/tool-output.ts
278
-
279
-
280
-
281
-
282
-
283
-
284
- var _fs = require('fs');
285
- var _os = require('os');
286
- var _path = require('path');
287
- function isPlainObject(value) {
288
- return Boolean(value) && typeof value === "object" && !Array.isArray(value);
289
- }
290
- function getByDottedPath(root, dottedPath) {
291
- let current = root;
292
- for (const segment of String(dottedPath || "").split(".").filter(Boolean)) {
293
- if (!isPlainObject(current) || !(segment in current)) {
294
- return null;
295
- }
296
- current = current[segment];
297
- }
298
- return current;
299
- }
300
- function normalizeRows(value) {
301
- if (!Array.isArray(value)) return null;
302
- return value.map((entry) => {
303
- if (isPlainObject(entry)) return entry;
304
- return { value: entry };
305
- });
306
- }
307
- function columnsForRows(rows) {
308
- const seen = /* @__PURE__ */ new Set();
309
- const columns = [];
310
- for (const row of rows) {
311
- for (const key of Object.keys(row)) {
312
- if (!seen.has(key)) {
313
- seen.add(key);
314
- columns.push(key);
315
- }
316
- }
317
- }
318
- return columns;
319
- }
320
- function candidateRoots(payload) {
321
- const roots = [
322
- { path: null, value: payload }
323
- ];
324
- if (isPlainObject(payload) && isPlainObject(payload.toolResponse)) {
325
- roots.push({ path: "toolResponse", value: payload.toolResponse });
326
- if (Object.prototype.hasOwnProperty.call(payload.toolResponse, "raw")) {
327
- roots.push({
328
- path: "toolResponse.raw",
329
- value: payload.toolResponse.raw
330
- });
331
- }
332
- }
333
- if (isPlainObject(payload) && isPlainObject(payload.output)) {
334
- roots.push({ path: "output", value: payload.output });
335
- if (Object.prototype.hasOwnProperty.call(payload.output, "body")) {
336
- roots.push({ path: "output.body", value: payload.output.body });
337
- }
338
- }
339
- if (isPlainObject(payload) && isPlainObject(payload.result)) {
340
- roots.push({ path: "result", value: payload.result });
341
- if (isPlainObject(payload.result.data)) {
342
- roots.push({ path: "result.data", value: payload.result.data });
343
- }
344
- }
345
- return roots;
346
- }
347
- function findBestArrayCandidate(value, pathPrefix = "", depth = 0) {
348
- if (depth > 5) return null;
349
- const directRows = normalizeRows(value);
350
- const hasObjectRow = _nullishCoalesce(_optionalChain([directRows, 'optionalAccess', _9 => _9.some, 'call', _10 => _10(
351
- (row) => Object.keys(row).some((key) => key !== "value")
352
- )]), () => ( false));
353
- let best = directRows && directRows.length > 0 && hasObjectRow ? { path: pathPrefix, rows: directRows } : null;
354
- if (!isPlainObject(value)) {
355
- return best;
356
- }
357
- for (const [key, child] of Object.entries(value)) {
358
- const childPath = pathPrefix ? `${pathPrefix}.${key}` : key;
359
- const candidate = findBestArrayCandidate(child, childPath, depth + 1);
360
- if (!candidate) continue;
361
- if (!best || candidate.rows.length > best.rows.length) {
362
- best = candidate;
363
- }
364
- }
365
- return best;
366
- }
367
- function tryConvertToList(payload, options) {
368
- const listExtractorPaths = Array.isArray(_optionalChain([options, 'optionalAccess', _11 => _11.listExtractorPaths])) ? _optionalChain([options, 'optionalAccess', _12 => _12.listExtractorPaths, 'access', _13 => _13.filter, 'call', _14 => _14(
369
- (entry) => typeof entry === "string" && entry.trim().length > 0
370
- )]) : [];
371
- if (listExtractorPaths.length > 0) {
372
- let emptyMatch = null;
373
- for (const root of candidateRoots(payload)) {
374
- for (const extractorPath of listExtractorPaths) {
375
- const resolved = getByDottedPath(root.value, extractorPath);
376
- const rows = normalizeRows(resolved);
377
- if (!rows) {
378
- continue;
379
- }
380
- const sourcePath = root.path ? `${root.path}.${extractorPath}` : extractorPath;
381
- if (rows.length > 0) {
382
- return { rows, strategy: "configured_paths", sourcePath };
383
- }
384
- emptyMatch ??= { rows, strategy: "configured_paths", sourcePath };
385
- }
386
- }
387
- if (emptyMatch) {
388
- return emptyMatch;
389
- }
390
- }
391
- const roots = candidateRoots(payload);
392
- const v2Raw = roots.find((root) => root.path === "toolResponse.raw");
393
- for (const root of v2Raw ? [v2Raw] : roots) {
394
- const candidate = findBestArrayCandidate(root.value, _nullishCoalesce(root.path, () => ( "")));
395
- if (!candidate || candidate.rows.length === 0) continue;
396
- return {
397
- rows: candidate.rows,
398
- strategy: "auto_detected",
399
- sourcePath: candidate.path || root.path
400
- };
401
- }
402
- return null;
403
- }
404
- function projectRowOutput(conversion) {
405
- return {
406
- rows: conversion.rows,
407
- rowCount: conversion.rows.length,
408
- columns: columnsForRows(conversion.rows),
409
- previewRows: conversion.rows.slice(0, 5),
410
- strategy: conversion.strategy,
411
- sourcePath: conversion.sourcePath
412
- };
413
- }
414
- function ensureOutputDir() {
415
- const outputDir = _path.join.call(void 0, _os.homedir.call(void 0, ), ".local", "share", "deepline", "data");
416
- _fs.mkdirSync.call(void 0, outputDir, { recursive: true });
417
- return outputDir;
418
- }
419
- function writeJsonOutputFile(payload, stem) {
420
- const outputDir = ensureOutputDir();
421
- const outputPath = _path.join.call(void 0, outputDir, `${stem}_${Date.now()}.json`);
422
- _fs.writeFileSync.call(void 0, outputPath, JSON.stringify(payload, null, 2), "utf-8");
423
- return outputPath;
424
- }
425
- function writeCsvOutputFile(rows, stem, options) {
426
- const outputPath = _optionalChain([options, 'optionalAccess', _15 => _15.outPath]) ? options.outPath : _path.join.call(void 0, ensureOutputDir(), `${stem}_${Date.now()}.csv`);
427
- _fs.mkdirSync.call(void 0, _path.dirname.call(void 0, outputPath), { recursive: true });
428
- const columns = columnsForRows(rows);
429
- const escapeCell = (value) => {
430
- const normalized = value == null ? "" : typeof value === "string" || typeof value === "number" || typeof value === "boolean" ? String(value) : JSON.stringify(value);
431
- if (/[",\n]/.test(normalized)) {
432
- return `"${normalized.replace(/"/g, '""')}"`;
433
- }
434
- return normalized;
435
- };
436
- const fd = _fs.openSync.call(void 0, outputPath, "w");
437
- try {
438
- _fs.writeSync.call(void 0, fd, `${columns.map(escapeCell).join(",")}
439
- `);
440
- for (const row of rows) {
441
- _fs.writeSync.call(void 0,
442
- fd,
443
- `${columns.map((column) => escapeCell(row[column])).join(",")}
444
- `
445
- );
446
- }
447
- } finally {
448
- _fs.closeSync.call(void 0, fd);
449
- }
450
- const previewRows = rows.slice(0, 5);
451
- const previewColumns = columns.slice(0, 5);
452
- const preview = [
453
- previewColumns.join(","),
454
- ...previewRows.map(
455
- (row) => previewColumns.map((column) => escapeCell(row[column])).join(",")
456
- )
457
- ].join("\n");
458
- return {
459
- path: outputPath,
460
- rowCount: rows.length,
461
- columns,
462
- preview
463
- };
464
- }
465
- function extractSummaryFields(payload) {
466
- const candidates = candidateRoots(payload);
467
- for (const candidate of candidates) {
468
- if (!isPlainObject(candidate.value)) continue;
469
- const summaryEntries = Object.entries(candidate.value).filter(
470
- ([, value]) => {
471
- return value == null || typeof value === "string" || typeof value === "number" || typeof value === "boolean";
472
- }
473
- );
474
- if (summaryEntries.length === 0) continue;
475
- return Object.fromEntries(summaryEntries);
476
- }
477
- return {};
478
- }
479
-
480
-
481
-
482
-
483
-
484
-
485
277
 
486
278
 
487
279
 
@@ -491,4 +283,4 @@ function extractSummaryFields(payload) {
491
283
 
492
284
 
493
285
 
494
- exports.EMAIL_STATUS_JSON_SCHEMA = EMAIL_STATUS_JSON_SCHEMA; exports.buildEmailStatus = buildEmailStatus; exports.JOB_CHANGE_STATUS_VALUES = JOB_CHANGE_STATUS_VALUES; exports.JOB_CHANGE_JSON_SCHEMA = JOB_CHANGE_JSON_SCHEMA; exports.PHONE_STATUS_VALUES = PHONE_STATUS_VALUES; exports.DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS = DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS; exports.DEEPLINE_EXTRACTOR_TARGETS = DEEPLINE_EXTRACTOR_TARGETS; exports.isDeeplineExtractorTarget = isDeeplineExtractorTarget; exports.tryConvertToList = tryConvertToList; exports.projectRowOutput = projectRowOutput; exports.writeJsonOutputFile = writeJsonOutputFile; exports.writeCsvOutputFile = writeCsvOutputFile; exports.extractSummaryFields = extractSummaryFields;
286
+ exports.EMAIL_STATUS_JSON_SCHEMA = EMAIL_STATUS_JSON_SCHEMA; exports.buildEmailStatus = buildEmailStatus; exports.JOB_CHANGE_STATUS_VALUES = JOB_CHANGE_STATUS_VALUES; exports.JOB_CHANGE_JSON_SCHEMA = JOB_CHANGE_JSON_SCHEMA; exports.PHONE_STATUS_VALUES = PHONE_STATUS_VALUES; exports.DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS = DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS; exports.DEEPLINE_EXTRACTOR_TARGETS = DEEPLINE_EXTRACTOR_TARGETS; exports.isDeeplineExtractorTarget = isDeeplineExtractorTarget;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveShellSpawn
3
- } from "./chunk-7MVWUXOD.mjs";
3
+ } from "./chunk-MV7QRALK.mjs";
4
4
 
5
5
  // src/cli/npm-script-policy.ts
6
6
  import { spawnSync } from "child_process";
@@ -0,0 +1,88 @@
1
+ import {
2
+ SCHEMA_LINE_LIMIT
3
+ } from "./chunk-IHG7UAHD.mjs";
4
+
5
+ // src/cli/describe-options.ts
6
+ function addDescribeOptions(command, options = {}) {
7
+ command.option(
8
+ "--prebuilt",
9
+ "Show the Deepline tool or play, not a play your workspace created under the same name"
10
+ ).option("--tool", "Same as --prebuilt").option(
11
+ "--verbose",
12
+ "Show secondary fields, and fill in every input and read every output in the examples"
13
+ ).option(
14
+ "--cli-example",
15
+ "Show only the CLI example, and explain how it takes inputs and returns outputs"
16
+ ).option(
17
+ "--play-example",
18
+ "Show only the in-play example, and explain how it takes inputs and returns outputs"
19
+ ).option("--no-example", "Hide the run examples").option(
20
+ "--full-schema",
21
+ `Print every field: a long schema unfolded (over ${SCHEMA_LINE_LIMIT} lines), list rows, and a tool's raw response`
22
+ ).option(
23
+ "--fields <names>",
24
+ "Show only these fields, comma-separated, plus every required input"
25
+ ).option(
26
+ "--feature <name[=value]>",
27
+ "Describe one feature of a tool, such as a model: --feature model=openai/gpt-5.6-luna. A tool lists its features."
28
+ ).option(
29
+ "-o, --out <path>",
30
+ "Save the output to this file instead of printing it"
31
+ );
32
+ if (options.schemaOnly !== false) {
33
+ command.option(
34
+ "--schema-only",
35
+ "Print only the schema, with every field, and nothing else"
36
+ );
37
+ }
38
+ if (options.json !== false) {
39
+ command.option(
40
+ "--json",
41
+ "Print JSON instead of text; with --schema-only, only the input and output JSON Schemas"
42
+ );
43
+ }
44
+ return command;
45
+ }
46
+
47
+ // src/cli/execution-observation.ts
48
+ import { writeFileSync, renameSync } from "fs";
49
+ function writeObservation(observation) {
50
+ const path = process.env.DEEPLINE_EXECUTION_OBSERVATION_PATH;
51
+ const invocationId = process.env.DEEPLINE_EXECUTION_OBSERVATION_ID;
52
+ if (!path || !invocationId) return;
53
+ const pending = `${path}.pending`;
54
+ writeFileSync(
55
+ pending,
56
+ JSON.stringify({
57
+ schema_version: 1,
58
+ invocation_id: invocationId,
59
+ ...observation
60
+ }),
61
+ { mode: 384 }
62
+ );
63
+ renameSync(pending, path);
64
+ }
65
+ function recordApiResponse(observation) {
66
+ writeObservation({
67
+ kind: "api_response",
68
+ received_at_ms: observation.receivedAtMs,
69
+ state: observation.state,
70
+ http_status: observation.httpStatus
71
+ });
72
+ }
73
+ function recordPlayTermination(run) {
74
+ if (typeof run.id !== "string" || !["completed", "failed", "cancelled", "canceled"].includes(
75
+ String(run.status)
76
+ ) || typeof run.finishedAt !== "number" || !Number.isSafeInteger(run.finishedAt) || run.finishedAt <= 0)
77
+ return;
78
+ writeObservation({
79
+ kind: "play_terminal",
80
+ run: { id: run.id, status: run.status, finishedAt: run.finishedAt }
81
+ });
82
+ }
83
+
84
+ export {
85
+ addDescribeOptions,
86
+ recordApiResponse,
87
+ recordPlayTermination
88
+ };