deepline 0.3.394 → 0.3.395

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 (106) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +30 -162
  2. package/dist/bundling-sources/sdk/src/index.ts +1 -0
  3. package/dist/bundling-sources/sdk/src/plays/play-description.ts +167 -0
  4. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  5. package/dist/bundling-sources/sdk/src/types.ts +1 -0
  6. package/dist/cli/{auth-OSXDAVCF.mjs → auth-NMQXZRS7.mjs} +4 -4
  7. package/dist/cli/auth-UYCOBAL5.js +39 -0
  8. package/dist/cli/{billing-ZNNKX3UR.mjs → billing-5MVXZRS6.mjs} +5 -4
  9. package/dist/cli/{billing-EKLYOXUY.js → billing-Z4JTGUU3.js} +76 -75
  10. package/dist/cli/{chunk-E23BQ5SC.js → chunk-36ML3YKA.js} +241 -349
  11. package/dist/cli/{chunk-XRQ2AQL7.mjs → chunk-3TRY7KAC.mjs} +2 -2
  12. package/dist/cli/{chunk-NR3DFKNF.mjs → chunk-47M6HPGP.mjs} +1 -1
  13. package/dist/cli/{chunk-RBJYWRCF.js → chunk-4KLCLLTO.js} +239 -237
  14. package/dist/cli/{chunk-CS6RAIVY.js → chunk-56IFFVIB.js} +4 -4
  15. package/dist/cli/chunk-5VCZ3WRH.mjs +129 -0
  16. package/dist/cli/{chunk-FJGW5GXU.mjs → chunk-6D7A2FSL.mjs} +1 -1
  17. package/dist/cli/{chunk-X63FDZJZ.mjs → chunk-7MVWUXOD.mjs} +3 -3
  18. package/dist/cli/{chunk-ZYBGA4AR.mjs → chunk-7XAM7KDW.mjs} +3 -3
  19. package/dist/cli/{chunk-BP33SIZF.mjs → chunk-BLYL3KOC.mjs} +1 -1
  20. package/dist/cli/{chunk-TJI2EN6K.mjs → chunk-BON3DRC6.mjs} +1 -1
  21. package/dist/cli/chunk-DRM3CMHL.js +129 -0
  22. package/dist/cli/{chunk-XXUDVEXK.mjs → chunk-EFLQHJZ6.mjs} +5 -5
  23. package/dist/cli/{chunk-JHIJIHFB.mjs → chunk-G4IWGRMK.mjs} +23 -131
  24. package/dist/cli/{chunk-KGNTKMRG.js → chunk-HRWUQJ4K.js} +6 -6
  25. package/dist/cli/{chunk-2MDDA7A4.js → chunk-K5T3EN6D.js} +26 -26
  26. package/dist/cli/{chunk-KI635JN4.js → chunk-LZLBR2SF.js} +50 -50
  27. package/dist/cli/{chunk-MLPU5SMZ.js → chunk-MYIBHORT.js} +2 -2
  28. package/dist/cli/{chunk-UXFSWG3Q.mjs → chunk-OCSG6X67.mjs} +4 -4
  29. package/dist/cli/{chunk-354JCXA2.js → chunk-PZ5BZ76S.js} +50 -50
  30. package/dist/cli/{chunk-VK6FYZLP.js → chunk-R4XZO6Z5.js} +8 -8
  31. package/dist/cli/{chunk-6YAUMG27.js → chunk-TO2MWPGR.js} +1 -1
  32. package/dist/cli/{chunk-QIQBYKLB.js → chunk-UCXK2DS4.js} +15 -15
  33. package/dist/cli/{chunk-KIUMEOM5.js → chunk-UKU6JM3S.js} +8 -8
  34. package/dist/cli/{chunk-4P27AXEA.js → chunk-VYLJJQ7Y.js} +65 -65
  35. package/dist/cli/{chunk-M57J2SK4.mjs → chunk-WCCKMLHL.mjs} +2 -2
  36. package/dist/cli/{chunk-5BB2RGAX.mjs → chunk-XMAPE2KH.mjs} +15 -13
  37. package/dist/cli/{chunk-MFB2VKBO.mjs → chunk-ZWH2TFA7.mjs} +2 -2
  38. package/dist/cli/{csv-LU7O75WE.js → csv-HTS5ZYQ4.js} +12 -12
  39. package/dist/cli/{csv-5AXRB35H.mjs → csv-SVOD5UBH.mjs} +3 -3
  40. package/dist/cli/{db-F7YTFKVM.js → db-7AP4P52N.js} +30 -29
  41. package/dist/cli/{db-7XP5UWEW.mjs → db-7QLNI3Q4.mjs} +5 -4
  42. package/dist/cli/{describe-K4ES5LIL.mjs → describe-DBRY5BNK.mjs} +10 -9
  43. package/dist/cli/{describe-FRH32RDV.js → describe-YKOE54ZO.js} +20 -19
  44. package/dist/cli/{executions-RZV5XPT2.js → executions-GRQXTB2P.js} +7 -6
  45. package/dist/cli/{executions-IEHEHJUO.mjs → executions-QNZTPNG4.mjs} +5 -4
  46. package/dist/cli/{feedback-FPUVZBAN.mjs → feedback-JMCSR624.mjs} +3 -3
  47. package/dist/cli/{feedback-3P65QTX3.js → feedback-ZOLA2KY7.js} +7 -7
  48. package/dist/cli/git-EJQLRK27.js +23 -0
  49. package/dist/cli/{git-GLVVP7TY.mjs → git-LJGL2IHS.mjs} +4 -4
  50. package/dist/cli/index.js +94 -94
  51. package/dist/cli/index.mjs +42 -42
  52. package/dist/cli/{legacy-noops-3MOI6NBM.mjs → legacy-noops-F23PKVBN.mjs} +4 -4
  53. package/dist/cli/{legacy-noops-XKSGZR7Q.js → legacy-noops-YSCIR2SD.js} +7 -7
  54. package/dist/cli/{monitors-FTBGNEFG.mjs → monitors-S4LOEL7W.mjs} +5 -4
  55. package/dist/cli/{monitors-NZ2DYNST.js → monitors-WMZ6HJZX.js} +86 -85
  56. package/dist/cli/{org-MCKDQXIV.js → org-PFHM5ZLY.js} +65 -64
  57. package/dist/cli/{org-V2J5RBCN.mjs → org-U3WA2NQM.mjs} +5 -4
  58. package/dist/cli/{play-AJFGME3B.mjs → play-AGSECQFN.mjs} +8 -7
  59. package/dist/cli/play-BR2LWGXK.js +159 -0
  60. package/dist/cli/{providers-I6RQJZFZ.mjs → providers-QBBRFBOH.mjs} +5 -4
  61. package/dist/cli/{providers-2JEZ2264.js → providers-XYMHLKCA.js} +8 -7
  62. package/dist/cli/{quickstart-BIDQDMO4.mjs → quickstart-5JTDGISY.mjs} +3 -3
  63. package/dist/cli/{quickstart-GJ2RPDU3.js → quickstart-IYGD6ZY3.js} +5 -5
  64. package/dist/cli/{search-ELRXFWG5.mjs → search-X6W6GRHS.mjs} +6 -5
  65. package/dist/cli/search-ZVSYH5GY.js +28 -0
  66. package/dist/cli/{secrets-SQXGZXIC.mjs → secrets-N55B67H6.mjs} +5 -4
  67. package/dist/cli/{secrets-53IT6VXD.js → secrets-UHG6OQFD.js} +14 -13
  68. package/dist/cli/{sessions-CAV5M77Y.js → sessions-57L5MGHN.js} +5 -5
  69. package/dist/cli/{sessions-2X5QF7SL.mjs → sessions-JTRSTDSS.mjs} +4 -4
  70. package/dist/cli/{settings-532WNAZO.js → settings-ATX4U5AS.js} +75 -74
  71. package/dist/cli/{settings-7P67VGCJ.mjs → settings-Q24HRAQI.mjs} +8 -7
  72. package/dist/cli/{setup-QGGBV2LE.mjs → setup-77ZWLVHT.mjs} +6 -6
  73. package/dist/cli/{setup-6L2VSUWJ.js → setup-EJCNOUCE.js} +41 -41
  74. package/dist/cli/skills-SPXUBLII.js +28 -0
  75. package/dist/cli/{skills-3FE62WBG.mjs → skills-XIS5AWQI.mjs} +4 -4
  76. package/dist/cli/tools-DBHUUZJX.js +42 -0
  77. package/dist/cli/{tools-DMR25DEF.mjs → tools-WCKLYEGQ.mjs} +7 -6
  78. package/dist/cli/{update-6RZMHJZP.mjs → update-UT5WANMV.mjs} +6 -6
  79. package/dist/cli/update-VSNFXRHJ.js +28 -0
  80. package/dist/cli/{workflow-TX4F2PIX.js → workflow-226QYUN2.js} +16 -15
  81. package/dist/cli/{workflow-L2DQRE6R.mjs → workflow-ZMX3L4ML.mjs} +6 -5
  82. package/dist/{client-C3O1Ipf3.d.ts → client-CivP-PAI.d.ts} +21 -12
  83. package/dist/{client-BktIPdIj.d.mts → client-hdFtwhTm.d.mts} +21 -12
  84. package/dist/index.d.mts +2 -2
  85. package/dist/index.d.ts +2 -2
  86. package/dist/index.js +7 -6
  87. package/dist/index.mjs +4 -3
  88. package/dist/install-integrity.json +81 -74
  89. package/dist/plays/play-description.d.mts +6 -0
  90. package/dist/plays/play-description.d.ts +6 -0
  91. package/dist/plays/play-description.js +9 -0
  92. package/dist/plays/play-description.mjs +9 -0
  93. package/dist/plays/run-request.d.mts +1 -1
  94. package/dist/plays/run-request.d.ts +1 -1
  95. package/dist/release.d.mts +1 -1
  96. package/dist/release.d.ts +1 -1
  97. package/dist/release.js +2 -2
  98. package/dist/release.mjs +1 -1
  99. package/package.json +6 -1
  100. package/dist/cli/auth-IHKISLJQ.js +0 -39
  101. package/dist/cli/git-MFFAWVVX.js +0 -23
  102. package/dist/cli/play-WLSN2EO2.js +0 -158
  103. package/dist/cli/search-5VN4YD4I.js +0 -27
  104. package/dist/cli/skills-S6NPZAN7.js +0 -28
  105. package/dist/cli/tools-647RLXQS.js +0 -41
  106. package/dist/cli/update-WVTSC3EM.js +0 -28
@@ -14,7 +14,7 @@ var _chunkXNYIZMNQjs = require('./chunk-XNYIZMNQ.js');
14
14
  var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
15
15
 
16
16
 
17
- var _chunk6YAUMG27js = require('./chunk-6YAUMG27.js');
17
+ var _chunkTO2MWPGRjs = require('./chunk-TO2MWPGR.js');
18
18
 
19
19
  // src/errors.ts
20
20
  var CustomerDbQueryOutcomeUnknownError = (_class = class extends _chunk7P5AA3SNjs.DeeplineError {
@@ -744,9 +744,9 @@ function resolveCliCommandContext(inputConfig, requestedScope) {
744
744
  }
745
745
 
746
746
  // src/version.ts
747
- var SDK_VERSION = _chunk6YAUMG27js.SDK_RELEASE.version;
748
- var SDK_API_MAJOR = _chunk6YAUMG27js.SDK_RELEASE.contracts.api.currentMajor;
749
- var SDK_API_CONTRACT = _nullishCoalesce(_chunk6YAUMG27js.SDK_RELEASE.contracts.api.legacyWireIds[0], () => ( `api-v${SDK_API_MAJOR}`));
747
+ var SDK_VERSION = _chunkTO2MWPGRjs.SDK_RELEASE.version;
748
+ var SDK_API_MAJOR = _chunkTO2MWPGRjs.SDK_RELEASE.contracts.api.currentMajor;
749
+ var SDK_API_CONTRACT = _nullishCoalesce(_chunkTO2MWPGRjs.SDK_RELEASE.contracts.api.legacyWireIds[0], () => ( `api-v${SDK_API_MAJOR}`));
750
750
 
751
751
  // src/agent-runtime.ts
752
752
 
@@ -0,0 +1,129 @@
1
+ // src/csv-header-matching.ts
2
+ var CSV_HEADER_MATCHING_NOTE = 'A header matches a column when it equals the column name or its default header, ignoring case, spaces and punctuation: LINKEDIN_URL, linkedin-url and "Linkedin Url" all match linkedin_url. A capital inside a word starts a new word, so "LinkedIn URL" reads as linked_in_url and does not match. Map any other header in the input: {"csv":"<path>","columns":{"<column>":"<your header>"}}.';
3
+
4
+ // src/plays/input-example.ts
5
+ function playInputExampleArgs(schema) {
6
+ if (!schema) return " --input '@<input.json>'";
7
+ if (schema.$ref || schema.allOf) return " --input '@<input.json>'";
8
+ const csv = schema.csvInput;
9
+ const csvField = typeof csv?.inputField === "string" ? csv.inputField : null;
10
+ const required = Array.isArray(schema.required) ? schema.required : [];
11
+ const csvOnlyRequired = required.every((key) => key === csvField);
12
+ const alternatives = schema.oneOf ?? schema.anyOf;
13
+ const hasCsvAlternative = Array.isArray(alternatives) && alternatives.some((branch) => {
14
+ if (!branch || typeof branch !== "object") return false;
15
+ const keys = branch.required;
16
+ return Array.isArray(keys) && keys.includes(csvField) && keys.every((key) => key === csvField);
17
+ });
18
+ if (csvField && csvOnlyRequired && (!alternatives || hasCsvAlternative)) {
19
+ if (csvField === "csv") return " --csv '<contacts.csv>'";
20
+ const value = JSON.stringify({ [csvField]: "<contacts.csv>" });
21
+ return ` --input '${value.replace(/'/g, "'\\''")}'`;
22
+ }
23
+ if (Array.isArray(schema.required) && !required.length && !csv && !alternatives) {
24
+ return "";
25
+ }
26
+ return " --input '@<input.json>'";
27
+ }
28
+
29
+ // src/plays/play-description.ts
30
+ function isRecord(value) {
31
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
32
+ }
33
+ function compactSchema(schema) {
34
+ if (!schema) return null;
35
+ const fields = Array.isArray(schema.fields) ? schema.fields.map(
36
+ (field) => isRecord(field) ? {
37
+ name: String(field.name ?? ""),
38
+ type: field.type ?? void 0,
39
+ required: field.required ?? void 0
40
+ } : null
41
+ ).filter((field) => Boolean(field?.name)) : [];
42
+ return fields.length > 0 ? { fields } : schema;
43
+ }
44
+ function schemaMetadata(schema, key) {
45
+ const value = isRecord(schema) ? schema[key] : null;
46
+ return isRecord(value) ? value : null;
47
+ }
48
+ function starterPlayPath(play) {
49
+ const target = play.reference || play.name;
50
+ const unqualifiedName = target.split("/").pop() || play.name;
51
+ const safeName = unqualifiedName.trim().toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
52
+ return `./${safeName || "play"}.play.ts`;
53
+ }
54
+ function cloneEditStarter(play) {
55
+ const readonlyPrebuilt = (play.origin === "prebuilt" || play.ownerType === "deepline") && !play.canEdit;
56
+ if (!play.canClone && !readonlyPrebuilt) return void 0;
57
+ const target = play.reference || play.name;
58
+ const path = starterPlayPath(play);
59
+ return {
60
+ path,
61
+ command: `deepline plays get ${target} --source --out ${path}`,
62
+ checkCommand: `deepline plays check ${path}`
63
+ };
64
+ }
65
+ function staticPipeline(play) {
66
+ return isRecord(play.staticPipeline) ? play.staticPipeline : isRecord(play.currentRevision?.staticPipeline) ? play.currentRevision.staticPipeline : isRecord(play.liveRevision?.staticPipeline) ? play.liveRevision.staticPipeline : null;
67
+ }
68
+ function describePlayListItem(play, options = {}) {
69
+ const aliases = play.aliases?.length ? play.aliases : [play.name];
70
+ const csvInput = schemaMetadata(play.inputSchema, "csvInput");
71
+ const rowOutputSchema = schemaMetadata(play.outputSchema, "rowOutputSchema");
72
+ const description = play.description?.trim() || play.currentRevision?.description?.trim() || play.liveRevision?.description?.trim() || null;
73
+ const runCommand = `deepline plays run ${play.reference || play.name}${playInputExampleArgs(play.inputSchema)}`;
74
+ const starter = cloneEditStarter(play);
75
+ return {
76
+ name: play.name,
77
+ // playKey and triggerStatus were projected away here, so `describe`
78
+ // was strictly less informative than `plays list` for the same play — no
79
+ // stable key, and no way to see that a cron was armed.
80
+ ...play.playKey ? { playKey: play.playKey } : {},
81
+ ...play.reference ? { reference: play.reference } : {},
82
+ ...play.displayName ? { displayName: play.displayName } : {},
83
+ ...description ? { description } : {},
84
+ ...play.guidance ? { guidance: play.guidance } : {},
85
+ pinned: Boolean(play.pinned),
86
+ toolCategories: play.toolCategories ?? [],
87
+ origin: play.origin,
88
+ ownerType: play.ownerType,
89
+ canEdit: play.canEdit,
90
+ canClone: play.canClone,
91
+ aliases,
92
+ inputSchema: options.compact ? compactSchema(play.inputSchema) : play.inputSchema ?? null,
93
+ outputSchema: options.compact ? compactSchema(play.outputSchema) : play.outputSchema ?? null,
94
+ ...options.pipeline ? { staticPipeline: staticPipeline(play) } : {},
95
+ ...csvInput ? {
96
+ csvInput: { ...csvInput, headerMatching: CSV_HEADER_MATCHING_NOTE }
97
+ } : {},
98
+ ...rowOutputSchema ? { rowOutputSchema } : {},
99
+ runCommand,
100
+ examples: [runCommand],
101
+ ...starter ? { cloneEditStarter: starter } : {},
102
+ currentPublishedVersion: play.currentPublishedVersion ?? null,
103
+ // Read the live version off the live revision. It was previously only
104
+ // ever written by the publish/live routes, so every list and describe
105
+ // payload reported liveVersion: null even for an actively serving play.
106
+ liveVersion: play.liveRevision?.version ?? null,
107
+ ...play.triggerStatus ? { triggerStatus: play.triggerStatus } : {},
108
+ isDraftDirty: play.isDraftDirty
109
+ };
110
+ }
111
+ function describePlayDetail(detail, options = {}) {
112
+ const play = detail.play;
113
+ return {
114
+ ...describePlayListItem(play, options),
115
+ currentPublishedVersion: play.currentPublishedVersion ?? play.liveRevision?.version ?? null,
116
+ latestRunId: play.latestRunId ?? detail.latestRuns[0]?.workflowId ?? null,
117
+ ...play.triggerMetadata ? { triggerMetadata: play.triggerMetadata } : {},
118
+ ...play.runtimeLimit ? { runtimeLimit: play.runtimeLimit } : {},
119
+ ...play.activeScheduledPlays ? { activeScheduledPlays: play.activeScheduledPlays } : {},
120
+ ...play.observedCost ? { observedCost: play.observedCost } : {}
121
+ };
122
+ }
123
+
124
+ export {
125
+ CSV_HEADER_MATCHING_NOTE,
126
+ playInputExampleArgs,
127
+ describePlayListItem,
128
+ describePlayDetail
129
+ };
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-NXGCO4JB.mjs";
15
15
  import {
16
16
  SDK_RELEASE
17
- } from "./chunk-TJI2EN6K.mjs";
17
+ } from "./chunk-BON3DRC6.mjs";
18
18
 
19
19
  // src/errors.ts
20
20
  var CustomerDbQueryOutcomeUnknownError = class extends DeeplineError {
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-GAMFK2ZP.mjs";
4
4
  import {
5
5
  printCommandEnvelope
6
- } from "./chunk-NR3DFKNF.mjs";
6
+ } from "./chunk-47M6HPGP.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-FJGW5GXU.mjs";
25
+ } from "./chunk-6D7A2FSL.mjs";
26
26
  import {
27
27
  DeeplineError
28
28
  } from "./chunk-NXGCO4JB.mjs";
29
29
  import {
30
30
  SDK_RELEASE
31
- } from "./chunk-TJI2EN6K.mjs";
31
+ } from "./chunk-BON3DRC6.mjs";
32
32
 
33
33
  // src/cli/commands/skills.ts
34
34
  import { spawn as spawn2 } from "child_process";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  DeeplineClient
3
- } from "./chunk-JHIJIHFB.mjs";
3
+ } from "./chunk-G4IWGRMK.mjs";
4
4
  import {
5
5
  printCommandEnvelope,
6
6
  renderCommandEnvelopeText
7
- } from "./chunk-NR3DFKNF.mjs";
7
+ } from "./chunk-47M6HPGP.mjs";
8
8
  import {
9
9
  resolveConfig,
10
10
  sdkCliStateDirPath
11
- } from "./chunk-FJGW5GXU.mjs";
11
+ } from "./chunk-6D7A2FSL.mjs";
12
12
 
13
13
  // src/cli/commands/search.ts
14
14
  import { Option } from "commander";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveShellSpawn
3
- } from "./chunk-X63FDZJZ.mjs";
3
+ } from "./chunk-7MVWUXOD.mjs";
4
4
 
5
5
  // src/cli/npm-script-policy.ts
6
6
  import { spawnSync } from "child_process";
@@ -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.394",
52
+ version: "0.3.395",
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,
@@ -0,0 +1,129 @@
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; }// src/csv-header-matching.ts
2
+ var CSV_HEADER_MATCHING_NOTE = 'A header matches a column when it equals the column name or its default header, ignoring case, spaces and punctuation: LINKEDIN_URL, linkedin-url and "Linkedin Url" all match linkedin_url. A capital inside a word starts a new word, so "LinkedIn URL" reads as linked_in_url and does not match. Map any other header in the input: {"csv":"<path>","columns":{"<column>":"<your header>"}}.';
3
+
4
+ // src/plays/input-example.ts
5
+ function playInputExampleArgs(schema) {
6
+ if (!schema) return " --input '@<input.json>'";
7
+ if (schema.$ref || schema.allOf) return " --input '@<input.json>'";
8
+ const csv = schema.csvInput;
9
+ const csvField = typeof _optionalChain([csv, 'optionalAccess', _ => _.inputField]) === "string" ? csv.inputField : null;
10
+ const required = Array.isArray(schema.required) ? schema.required : [];
11
+ const csvOnlyRequired = required.every((key) => key === csvField);
12
+ const alternatives = _nullishCoalesce(schema.oneOf, () => ( schema.anyOf));
13
+ const hasCsvAlternative = Array.isArray(alternatives) && alternatives.some((branch) => {
14
+ if (!branch || typeof branch !== "object") return false;
15
+ const keys = branch.required;
16
+ return Array.isArray(keys) && keys.includes(csvField) && keys.every((key) => key === csvField);
17
+ });
18
+ if (csvField && csvOnlyRequired && (!alternatives || hasCsvAlternative)) {
19
+ if (csvField === "csv") return " --csv '<contacts.csv>'";
20
+ const value = JSON.stringify({ [csvField]: "<contacts.csv>" });
21
+ return ` --input '${value.replace(/'/g, "'\\''")}'`;
22
+ }
23
+ if (Array.isArray(schema.required) && !required.length && !csv && !alternatives) {
24
+ return "";
25
+ }
26
+ return " --input '@<input.json>'";
27
+ }
28
+
29
+ // src/plays/play-description.ts
30
+ function isRecord(value) {
31
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
32
+ }
33
+ function compactSchema(schema) {
34
+ if (!schema) return null;
35
+ const fields = Array.isArray(schema.fields) ? schema.fields.map(
36
+ (field) => isRecord(field) ? {
37
+ name: String(_nullishCoalesce(field.name, () => ( ""))),
38
+ type: _nullishCoalesce(field.type, () => ( void 0)),
39
+ required: _nullishCoalesce(field.required, () => ( void 0))
40
+ } : null
41
+ ).filter((field) => Boolean(_optionalChain([field, 'optionalAccess', _2 => _2.name]))) : [];
42
+ return fields.length > 0 ? { fields } : schema;
43
+ }
44
+ function schemaMetadata(schema, key) {
45
+ const value = isRecord(schema) ? schema[key] : null;
46
+ return isRecord(value) ? value : null;
47
+ }
48
+ function starterPlayPath(play) {
49
+ const target = play.reference || play.name;
50
+ const unqualifiedName = target.split("/").pop() || play.name;
51
+ const safeName = unqualifiedName.trim().toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
52
+ return `./${safeName || "play"}.play.ts`;
53
+ }
54
+ function cloneEditStarter(play) {
55
+ const readonlyPrebuilt = (play.origin === "prebuilt" || play.ownerType === "deepline") && !play.canEdit;
56
+ if (!play.canClone && !readonlyPrebuilt) return void 0;
57
+ const target = play.reference || play.name;
58
+ const path = starterPlayPath(play);
59
+ return {
60
+ path,
61
+ command: `deepline plays get ${target} --source --out ${path}`,
62
+ checkCommand: `deepline plays check ${path}`
63
+ };
64
+ }
65
+ function staticPipeline(play) {
66
+ return isRecord(play.staticPipeline) ? play.staticPipeline : isRecord(_optionalChain([play, 'access', _3 => _3.currentRevision, 'optionalAccess', _4 => _4.staticPipeline])) ? play.currentRevision.staticPipeline : isRecord(_optionalChain([play, 'access', _5 => _5.liveRevision, 'optionalAccess', _6 => _6.staticPipeline])) ? play.liveRevision.staticPipeline : null;
67
+ }
68
+ function describePlayListItem(play, options = {}) {
69
+ const aliases = _optionalChain([play, 'access', _7 => _7.aliases, 'optionalAccess', _8 => _8.length]) ? play.aliases : [play.name];
70
+ const csvInput = schemaMetadata(play.inputSchema, "csvInput");
71
+ const rowOutputSchema = schemaMetadata(play.outputSchema, "rowOutputSchema");
72
+ const description = _optionalChain([play, 'access', _9 => _9.description, 'optionalAccess', _10 => _10.trim, 'call', _11 => _11()]) || _optionalChain([play, 'access', _12 => _12.currentRevision, 'optionalAccess', _13 => _13.description, 'optionalAccess', _14 => _14.trim, 'call', _15 => _15()]) || _optionalChain([play, 'access', _16 => _16.liveRevision, 'optionalAccess', _17 => _17.description, 'optionalAccess', _18 => _18.trim, 'call', _19 => _19()]) || null;
73
+ const runCommand = `deepline plays run ${play.reference || play.name}${playInputExampleArgs(play.inputSchema)}`;
74
+ const starter = cloneEditStarter(play);
75
+ return {
76
+ name: play.name,
77
+ // playKey and triggerStatus were projected away here, so `describe`
78
+ // was strictly less informative than `plays list` for the same play — no
79
+ // stable key, and no way to see that a cron was armed.
80
+ ...play.playKey ? { playKey: play.playKey } : {},
81
+ ...play.reference ? { reference: play.reference } : {},
82
+ ...play.displayName ? { displayName: play.displayName } : {},
83
+ ...description ? { description } : {},
84
+ ...play.guidance ? { guidance: play.guidance } : {},
85
+ pinned: Boolean(play.pinned),
86
+ toolCategories: _nullishCoalesce(play.toolCategories, () => ( [])),
87
+ origin: play.origin,
88
+ ownerType: play.ownerType,
89
+ canEdit: play.canEdit,
90
+ canClone: play.canClone,
91
+ aliases,
92
+ inputSchema: options.compact ? compactSchema(play.inputSchema) : _nullishCoalesce(play.inputSchema, () => ( null)),
93
+ outputSchema: options.compact ? compactSchema(play.outputSchema) : _nullishCoalesce(play.outputSchema, () => ( null)),
94
+ ...options.pipeline ? { staticPipeline: staticPipeline(play) } : {},
95
+ ...csvInput ? {
96
+ csvInput: { ...csvInput, headerMatching: CSV_HEADER_MATCHING_NOTE }
97
+ } : {},
98
+ ...rowOutputSchema ? { rowOutputSchema } : {},
99
+ runCommand,
100
+ examples: [runCommand],
101
+ ...starter ? { cloneEditStarter: starter } : {},
102
+ currentPublishedVersion: _nullishCoalesce(play.currentPublishedVersion, () => ( null)),
103
+ // Read the live version off the live revision. It was previously only
104
+ // ever written by the publish/live routes, so every list and describe
105
+ // payload reported liveVersion: null even for an actively serving play.
106
+ liveVersion: _nullishCoalesce(_optionalChain([play, 'access', _20 => _20.liveRevision, 'optionalAccess', _21 => _21.version]), () => ( null)),
107
+ ...play.triggerStatus ? { triggerStatus: play.triggerStatus } : {},
108
+ isDraftDirty: play.isDraftDirty
109
+ };
110
+ }
111
+ function describePlayDetail(detail, options = {}) {
112
+ const play = detail.play;
113
+ return {
114
+ ...describePlayListItem(play, options),
115
+ currentPublishedVersion: _nullishCoalesce(_nullishCoalesce(play.currentPublishedVersion, () => ( _optionalChain([play, 'access', _22 => _22.liveRevision, 'optionalAccess', _23 => _23.version]))), () => ( null)),
116
+ latestRunId: _nullishCoalesce(_nullishCoalesce(play.latestRunId, () => ( _optionalChain([detail, 'access', _24 => _24.latestRuns, 'access', _25 => _25[0], 'optionalAccess', _26 => _26.workflowId]))), () => ( null)),
117
+ ...play.triggerMetadata ? { triggerMetadata: play.triggerMetadata } : {},
118
+ ...play.runtimeLimit ? { runtimeLimit: play.runtimeLimit } : {},
119
+ ...play.activeScheduledPlays ? { activeScheduledPlays: play.activeScheduledPlays } : {},
120
+ ...play.observedCost ? { observedCost: play.observedCost } : {}
121
+ };
122
+ }
123
+
124
+
125
+
126
+
127
+
128
+
129
+ exports.CSV_HEADER_MATCHING_NOTE = CSV_HEADER_MATCHING_NOTE; exports.playInputExampleArgs = playInputExampleArgs; exports.describePlayListItem = describePlayListItem; exports.describePlayDetail = describePlayDetail;
@@ -13,7 +13,7 @@ import {
13
13
  observedMaxText,
14
14
  recentSearchRef,
15
15
  registerDeprecatedSearchCommand
16
- } from "./chunk-ZYBGA4AR.mjs";
16
+ } from "./chunk-7XAM7KDW.mjs";
17
17
  import {
18
18
  DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS,
19
19
  EMAIL_STATUS_JSON_SCHEMA,
@@ -31,7 +31,7 @@ import {
31
31
  import {
32
32
  DeeplineClient,
33
33
  validateExecutionIdempotencyKey
34
- } from "./chunk-JHIJIHFB.mjs";
34
+ } from "./chunk-G4IWGRMK.mjs";
35
35
  import {
36
36
  stableStringify
37
37
  } from "./chunk-UBKA33KY.mjs";
@@ -48,11 +48,11 @@ import {
48
48
  printJsonError,
49
49
  renderCommandEnvelopeText,
50
50
  shouldEmitJson
51
- } from "./chunk-NR3DFKNF.mjs";
51
+ } from "./chunk-47M6HPGP.mjs";
52
52
  import {
53
53
  resolveConfig,
54
54
  sdkCliStateDirPath
55
- } from "./chunk-FJGW5GXU.mjs";
55
+ } from "./chunk-6D7A2FSL.mjs";
56
56
  import {
57
57
  DeeplineError
58
58
  } from "./chunk-NXGCO4JB.mjs";
@@ -1188,7 +1188,7 @@ Examples:
1188
1188
  process.exitCode = await narrowView();
1189
1189
  return;
1190
1190
  }
1191
- const { describeAnything } = await import("./describe-K4ES5LIL.mjs");
1191
+ const { describeAnything } = await import("./describe-DBRY5BNK.mjs");
1192
1192
  process.exitCode = await describeAnything(
1193
1193
  toolId,
1194
1194
  {
@@ -14,6 +14,10 @@ import {
14
14
  stagePlayFiles,
15
15
  startPlayRun
16
16
  } from "./chunk-JI2B4RZP.mjs";
17
+ import {
18
+ describePlayDetail,
19
+ describePlayListItem
20
+ } from "./chunk-5VCZ3WRH.mjs";
17
21
  import {
18
22
  COORDINATOR_INTERNAL_TOKEN_HEADER,
19
23
  CustomerDbQueryOutcomeUnknownError,
@@ -21,7 +25,7 @@ import {
21
25
  RETAINED_PIPELINE_RECEIVERS_HEADER,
22
26
  RUNTIME_ENVIRONMENT_TOKEN_HEADER,
23
27
  resolveConfig
24
- } from "./chunk-FJGW5GXU.mjs";
28
+ } from "./chunk-6D7A2FSL.mjs";
25
29
  import {
26
30
  DeeplineError,
27
31
  TOOL_EXECUTION_ERROR_SCHEMA_HEADER,
@@ -29,9 +33,6 @@ import {
29
33
  ToolExecutionError
30
34
  } from "./chunk-NXGCO4JB.mjs";
31
35
 
32
- // src/csv-header-matching.ts
33
- var CSV_HEADER_MATCHING_NOTE = 'A header matches a column when it equals the column name or its default header, ignoring case, spaces and punctuation: LINKEDIN_URL, linkedin-url and "Linkedin Url" all match linkedin_url. A capital inside a word starts a new word, so "LinkedIn URL" reads as linked_in_url and does not match. Map any other header in the input: {"csv":"<path>","columns":{"<column>":"<your header>"}}.';
34
-
35
36
  // src/pagination.ts
36
37
  async function* iterateCursorPages(fetchPage) {
37
38
  let cursor = null;
@@ -1835,31 +1836,6 @@ function playTriggerConfigPath(playName) {
1835
1836
  return `/api/v2/plays/${encodeURIComponent(playName)}/triggers`;
1836
1837
  }
1837
1838
 
1838
- // src/plays/input-example.ts
1839
- function playInputExampleArgs(schema) {
1840
- if (!schema) return " --input '@<input.json>'";
1841
- if (schema.$ref || schema.allOf) return " --input '@<input.json>'";
1842
- const csv = schema.csvInput;
1843
- const csvField = typeof csv?.inputField === "string" ? csv.inputField : null;
1844
- const required = Array.isArray(schema.required) ? schema.required : [];
1845
- const csvOnlyRequired = required.every((key) => key === csvField);
1846
- const alternatives = schema.oneOf ?? schema.anyOf;
1847
- const hasCsvAlternative = Array.isArray(alternatives) && alternatives.some((branch) => {
1848
- if (!branch || typeof branch !== "object") return false;
1849
- const keys = branch.required;
1850
- return Array.isArray(keys) && keys.includes(csvField) && keys.every((key) => key === csvField);
1851
- });
1852
- if (csvField && csvOnlyRequired && (!alternatives || hasCsvAlternative)) {
1853
- if (csvField === "csv") return " --csv '<contacts.csv>'";
1854
- const value = JSON.stringify({ [csvField]: "<contacts.csv>" });
1855
- return ` --input '${value.replace(/'/g, "'\\''")}'`;
1856
- }
1857
- if (Array.isArray(schema.required) && !required.length && !csv && !alternatives) {
1858
- return "";
1859
- }
1860
- return " --input '@<input.json>'";
1861
- }
1862
-
1863
1839
  // ../product-notifications/configuration.ts
1864
1840
  var PRODUCT_NOTIFICATION_EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
1865
1841
  function normalizeProductNotificationEmail(value) {
@@ -3365,101 +3341,6 @@ var DeeplineClient = class _DeeplineClient {
3365
3341
  get baseUrl() {
3366
3342
  return this.config.baseUrl;
3367
3343
  }
3368
- compactSchema(schema) {
3369
- if (!schema) return null;
3370
- const fields = Array.isArray(schema.fields) ? schema.fields.map(
3371
- (field) => field && typeof field === "object" ? {
3372
- name: String(field.name ?? ""),
3373
- type: field.type ?? void 0,
3374
- required: field.required ?? void 0
3375
- } : null
3376
- ).filter((field) => Boolean(field?.name)) : [];
3377
- return fields.length > 0 ? { fields } : schema;
3378
- }
3379
- schemaMetadata(schema, key) {
3380
- if (!isRecord2(schema)) return null;
3381
- const value = schema[key];
3382
- return isRecord2(value) ? value : null;
3383
- }
3384
- playRunCommand(play) {
3385
- const target = play.reference || play.name;
3386
- return `deepline plays run ${target}${playInputExampleArgs(play.inputSchema)}`;
3387
- }
3388
- starterPlayPath(play) {
3389
- const target = play.reference || play.name;
3390
- const unqualifiedName = target.split("/").pop() || play.name;
3391
- const safeName = unqualifiedName.trim().toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
3392
- return `./${safeName || "play"}.play.ts`;
3393
- }
3394
- playCloneEditStarter(play) {
3395
- const readonlyPrebuilt = (play.origin === "prebuilt" || play.ownerType === "deepline") && !play.canEdit;
3396
- if (!play.canClone && !readonlyPrebuilt) return void 0;
3397
- const target = play.reference || play.name;
3398
- const path = this.starterPlayPath(play);
3399
- return {
3400
- path,
3401
- command: `deepline plays get ${target} --source --out ${path}`,
3402
- checkCommand: `deepline plays check ${path}`
3403
- };
3404
- }
3405
- summarizePlayListItem(play, options) {
3406
- const aliases = play.aliases?.length ? play.aliases : [play.name];
3407
- const csvInput = this.schemaMetadata(play.inputSchema, "csvInput");
3408
- const rowOutputSchema = this.schemaMetadata(
3409
- play.outputSchema,
3410
- "rowOutputSchema"
3411
- );
3412
- const description = play.description?.trim() || play.currentRevision?.description?.trim() || play.liveRevision?.description?.trim() || null;
3413
- const runCommand = this.playRunCommand(play);
3414
- const cloneEditStarter = this.playCloneEditStarter(play);
3415
- return {
3416
- name: play.name,
3417
- // playKey and triggerStatus were projected away here, so `describe`
3418
- // was strictly less informative than `plays list` for the same play — no
3419
- // stable key, and no way to see that a cron was armed.
3420
- ...play.playKey ? { playKey: play.playKey } : {},
3421
- ...play.reference ? { reference: play.reference } : {},
3422
- ...play.displayName ? { displayName: play.displayName } : {},
3423
- ...description ? { description } : {},
3424
- ...play.guidance ? { guidance: play.guidance } : {},
3425
- pinned: Boolean(play.pinned),
3426
- toolCategories: play.toolCategories ?? [],
3427
- origin: play.origin,
3428
- ownerType: play.ownerType,
3429
- canEdit: play.canEdit,
3430
- canClone: play.canClone,
3431
- aliases,
3432
- inputSchema: options?.compact ? this.compactSchema(play.inputSchema) : play.inputSchema ?? null,
3433
- outputSchema: options?.compact ? this.compactSchema(play.outputSchema) : play.outputSchema ?? null,
3434
- staticPipeline: isRecord2(play.staticPipeline) ? play.staticPipeline : isRecord2(play.currentRevision?.staticPipeline) ? play.currentRevision.staticPipeline : isRecord2(play.liveRevision?.staticPipeline) ? play.liveRevision.staticPipeline : null,
3435
- ...csvInput ? {
3436
- csvInput: { ...csvInput, headerMatching: CSV_HEADER_MATCHING_NOTE }
3437
- } : {},
3438
- ...rowOutputSchema ? { rowOutputSchema } : {},
3439
- runCommand,
3440
- examples: [runCommand],
3441
- ...cloneEditStarter ? { cloneEditStarter } : {},
3442
- currentPublishedVersion: play.currentPublishedVersion ?? null,
3443
- // Read the live version off the live revision. It was previously only
3444
- // ever written by the publish/live routes, so every list and describe
3445
- // payload reported liveVersion: null even for an actively serving play.
3446
- liveVersion: play.liveRevision?.version ?? null,
3447
- ...play.triggerStatus ? { triggerStatus: play.triggerStatus } : {},
3448
- isDraftDirty: play.isDraftDirty
3449
- };
3450
- }
3451
- summarizePlayDetail(detail, options) {
3452
- const play = detail.play;
3453
- return {
3454
- ...this.summarizePlayListItem(play, options),
3455
- currentPublishedVersion: play.currentPublishedVersion ?? play.liveRevision?.version ?? null,
3456
- latestRunId: play.latestRunId ?? detail.latestRuns[0]?.workflowId ?? null,
3457
- ...play.triggerMetadata ? { triggerMetadata: play.triggerMetadata } : {},
3458
- ...play.runtimeLimit ? { runtimeLimit: play.runtimeLimit } : {},
3459
- ...play.activeScheduledPlays ? { activeScheduledPlays: play.activeScheduledPlays } : {},
3460
- ...play.observedCost ? { observedCost: play.observedCost } : {}
3461
- };
3462
- }
3463
3344
  // ——————————————————————————————————————————————————————————
3464
3345
  // Secrets
3465
3346
  // ——————————————————————————————————————————————————————————
@@ -5369,7 +5250,7 @@ var DeeplineClient = class _DeeplineClient {
5369
5250
  }
5370
5251
  );
5371
5252
  const plays = (response.plays ?? []).map(
5372
- (play) => this.summarizePlayListItem(play, options)
5253
+ (play) => describePlayListItem(play, { ...options, pipeline: true })
5373
5254
  );
5374
5255
  if (scope === "prebuilt") {
5375
5256
  return plays.filter(isPrebuiltPlayDescription);
@@ -5421,11 +5302,24 @@ var DeeplineClient = class _DeeplineClient {
5421
5302
  * Get a normalized play description suitable for agents and CLIs.
5422
5303
  *
5423
5304
  * The description includes runnable examples, input/output summaries, clone
5424
- * guidance, revision state, and latest run metadata when available.
5305
+ * guidance, revision state, and latest run metadata when available. Pass
5306
+ * `{ pipeline: true }` to include the compiled pipeline, which can be
5307
+ * hundreds of kilobytes and is otherwise left out.
5425
5308
  */
5426
- async describePlay(name, options) {
5427
- const detail = await this.getPlay(name, { guidance: true });
5428
- return this.summarizePlayDetail(detail, options);
5309
+ async describePlay(name, options = {}) {
5310
+ if (options.pipeline) {
5311
+ return describePlayDetail(
5312
+ await this.getPlay(name, { guidance: true }),
5313
+ options
5314
+ );
5315
+ }
5316
+ const params = new URLSearchParams({
5317
+ include: "guidance",
5318
+ view: "description",
5319
+ ...options.compact ? { compact: "1" } : {}
5320
+ });
5321
+ const body = await this.http.get(`/api/v2/plays/${encodeURIComponent(name)}?${params.toString()}`);
5322
+ return "description" in body ? body.description : describePlayDetail(body, options);
5429
5323
  }
5430
5324
  /**
5431
5325
  * Clear run history and durable sheet/result data for a play without deleting
@@ -6596,9 +6490,7 @@ var DeeplineClient = class _DeeplineClient {
6596
6490
  };
6597
6491
 
6598
6492
  export {
6599
- CSV_HEADER_MATCHING_NOTE,
6600
6493
  iterateCursorPages,
6601
- playInputExampleArgs,
6602
6494
  requireBillingIdempotencyKey,
6603
6495
  planCustomerDbQuery,
6604
6496
  validateExecutionIdempotencyKey,
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkCS6RAIVYjs = require('./chunk-CS6RAIVY.js');
6
+ var _chunk56IFFVIBjs = require('./chunk-56IFFVIB.js');
7
7
 
8
8
 
9
9
 
@@ -226,8 +226,8 @@ var BROWSER_OPEN_COOLDOWN_MS = 3e4;
226
226
  var SAME_URL_BROWSER_OPEN_COOLDOWN_MS = 5 * 6e4;
227
227
  var defaultBrowserCommandRunner = childProcess;
228
228
  function getAuthedHttpClient() {
229
- const config = _chunkCS6RAIVYjs.resolveConfig.call(void 0, );
230
- return { config, http: new (0, _chunkCS6RAIVYjs.HttpClient)(config) };
229
+ const config = _chunk56IFFVIBjs.resolveConfig.call(void 0, );
230
+ return { config, http: new (0, _chunk56IFFVIBjs.HttpClient)(config) };
231
231
  }
232
232
  function stableOsUserId() {
233
233
  try {
@@ -567,7 +567,7 @@ function collectLocalEnvInfo() {
567
567
  os: `${process.platform} ${process.arch}`,
568
568
  node_version: process.version,
569
569
  home_dir: homeDir,
570
- agent_runtime: _chunkCS6RAIVYjs.detectAgentRuntime.call(void 0, )
570
+ agent_runtime: _chunk56IFFVIBjs.detectAgentRuntime.call(void 0, )
571
571
  };
572
572
  const env = process.env;
573
573
  const optional = {
@@ -814,9 +814,9 @@ function markdownTableFromRows(rows, preferredColumns = []) {
814
814
  }
815
815
  function withAgentCommandContext(value) {
816
816
  const valueRecord = value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
817
- return _chunkCS6RAIVYjs.detectAgentRuntime.call(void 0, ) !== "unknown" && valueRecord && !Object.prototype.hasOwnProperty.call(valueRecord, "command_context") ? {
817
+ return _chunk56IFFVIBjs.detectAgentRuntime.call(void 0, ) !== "unknown" && valueRecord && !Object.prototype.hasOwnProperty.call(valueRecord, "command_context") ? {
818
818
  ...valueRecord,
819
- command_context: _chunkCS6RAIVYjs.resolveCliCommandContext.call(void 0, )
819
+ command_context: _chunk56IFFVIBjs.resolveCliCommandContext.call(void 0, )
820
820
  } : value;
821
821
  }
822
822
  function printJson(value, fields) {