deepline 0.3.329 → 0.3.330

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 (95) hide show
  1. package/dist/bundling-sources/sdk/src/billing-idempotency.ts +24 -0
  2. package/dist/bundling-sources/sdk/src/client.ts +22 -22
  3. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  4. package/dist/cli/{auth-MFFVOITR.mjs → auth-A4XQ3KMW.mjs} +4 -4
  5. package/dist/cli/auth-XJJYQESF.js +31 -0
  6. package/dist/cli/{billing-LRBHWLIQ.mjs → billing-634WZLKG.mjs} +36 -14
  7. package/dist/cli/{billing-V4Y4OVQ7.js → billing-WLHXYC5Z.js} +101 -79
  8. package/dist/cli/{chunk-MO2XSC5I.mjs → chunk-3QZ22IZO.mjs} +4 -4
  9. package/dist/cli/{chunk-4FLEXYUC.js → chunk-46IVSO6O.js} +8 -8
  10. package/dist/cli/{chunk-HI7TAWFS.mjs → chunk-56RM5AQF.mjs} +5 -5
  11. package/dist/cli/{chunk-ERU2OR6F.mjs → chunk-5W636CDP.mjs} +2 -2
  12. package/dist/cli/{chunk-U4CTHVN7.js → chunk-63W4744F.js} +533 -532
  13. package/dist/cli/{chunk-YNSCELIJ.mjs → chunk-6VBXS43D.mjs} +2 -2
  14. package/dist/cli/{chunk-EROOAI5G.mjs → chunk-7DGZCMXQ.mjs} +1 -1
  15. package/dist/cli/{chunk-OUTIWGKY.js → chunk-7FWHOKNS.js} +26 -26
  16. package/dist/cli/{chunk-VLDLJZ75.js → chunk-FLIABSY6.js} +48 -48
  17. package/dist/cli/{chunk-VDIHLKGG.js → chunk-GHHLLEZK.js} +4 -4
  18. package/dist/cli/{chunk-J2E5R2VH.js → chunk-GKZZ32EV.js} +60 -60
  19. package/dist/cli/{chunk-75ZOTF3K.js → chunk-GS7GA7PI.js} +15 -15
  20. package/dist/cli/{chunk-OZGU7P2S.mjs → chunk-GTBS6LQH.mjs} +38 -22
  21. package/dist/cli/{chunk-XRYKLK56.js → chunk-LNDGT7NV.js} +45 -45
  22. package/dist/cli/{chunk-MFQQINUY.mjs → chunk-LQ5DD2UF.mjs} +2 -2
  23. package/dist/cli/{chunk-FK7PW6BP.mjs → chunk-MBI3BVSQ.mjs} +1 -1
  24. package/dist/cli/{chunk-KHZQFFOQ.js → chunk-O2L46S3I.js} +2 -2
  25. package/dist/cli/{chunk-SJV5MTOJ.mjs → chunk-PH2N6GC7.mjs} +1 -1
  26. package/dist/cli/{chunk-7T6DX5RK.mjs → chunk-SDSS4OTO.mjs} +62 -61
  27. package/dist/cli/{chunk-GCNER3HV.mjs → chunk-SZCUJ4AL.mjs} +1 -1
  28. package/dist/cli/{chunk-3RZJ3GEG.mjs → chunk-VFC6CZLF.mjs} +3 -3
  29. package/dist/cli/{chunk-U2N4CYT7.js → chunk-WHKTRZ3J.js} +6 -6
  30. package/dist/cli/{chunk-AD23W4S5.js → chunk-XUNMVZOW.js} +1 -1
  31. package/dist/cli/{chunk-ZXGUYTIT.js → chunk-YFP4UH2Y.js} +6 -6
  32. package/dist/cli/{chunk-GY2EEO2Y.js → chunk-YGFQ7YSM.js} +51 -35
  33. package/dist/cli/{chunk-HVPRQGF4.mjs → chunk-ZYPFCBW5.mjs} +1 -1
  34. package/dist/cli/client-3CREIHGC.js +20 -0
  35. package/dist/cli/{client-BNLD775D.mjs → client-WYFGEJOX.mjs} +3 -3
  36. package/dist/cli/{csv-7MVQECWG.mjs → csv-BDZSDXLU.mjs} +3 -3
  37. package/dist/cli/{csv-ZT6ZRQ3Z.js → csv-THMQDXCJ.js} +12 -12
  38. package/dist/cli/{db-C4BMZXJK.js → db-5BQJOZG7.js} +29 -29
  39. package/dist/cli/{db-ABLWLMX5.mjs → db-R2LTNLFM.mjs} +4 -4
  40. package/dist/cli/{describe-YALVN4WH.js → describe-F4G5H3SC.js} +15 -15
  41. package/dist/cli/{describe-XWOWAR32.mjs → describe-WECII7FS.mjs} +8 -8
  42. package/dist/cli/{executions-U4TNRP26.js → executions-HJRVD4M6.js} +6 -6
  43. package/dist/cli/{executions-7IZVKQ3O.mjs → executions-HPRIRB73.mjs} +4 -4
  44. package/dist/cli/{feedback-GO5XPEKY.mjs → feedback-5VVW5WW7.mjs} +3 -3
  45. package/dist/cli/{feedback-NWMRT5W4.js → feedback-GHGDH43D.js} +6 -6
  46. package/dist/cli/{git-R53WS4WA.mjs → git-BBXML2UJ.mjs} +4 -4
  47. package/dist/cli/git-NNEBLRVP.js +23 -0
  48. package/dist/cli/index.js +79 -79
  49. package/dist/cli/index.mjs +31 -31
  50. package/dist/cli/{legacy-noops-6QAZW7WJ.mjs → legacy-noops-IALOUAGL.mjs} +4 -4
  51. package/dist/cli/{legacy-noops-NJWM53DE.js → legacy-noops-VNZZ3VVT.js} +7 -7
  52. package/dist/cli/{monitors-2I2MYAPS.js → monitors-MLP6IA2R.js} +85 -85
  53. package/dist/cli/{monitors-2N4BRU5M.mjs → monitors-VDEB2FKS.mjs} +4 -4
  54. package/dist/cli/{org-XVNAE2JV.js → org-N6ADDGEV.js} +60 -60
  55. package/dist/cli/{org-D3RHK2Q7.mjs → org-SDSSKY42.mjs} +4 -4
  56. package/dist/cli/play-UTIPBVDQ.js +153 -0
  57. package/dist/cli/{play-L7MYJZ65.mjs → play-VSTVY6PM.mjs} +7 -7
  58. package/dist/cli/{providers-5BTDAZHN.js → providers-TJ42O6NN.js} +7 -7
  59. package/dist/cli/{providers-YM4E7WZD.mjs → providers-UKC7KD3W.mjs} +4 -4
  60. package/dist/cli/{quickstart-5A3FHAH3.js → quickstart-7S7NMCMX.js} +5 -5
  61. package/dist/cli/{quickstart-ARPLJOLH.mjs → quickstart-WSKATNHJ.mjs} +3 -3
  62. package/dist/cli/{search-KKJEVV27.mjs → search-6OS6VVCJ.mjs} +5 -5
  63. package/dist/cli/search-Y6UGKL5C.js +26 -0
  64. package/dist/cli/{secrets-DVPVCSZD.js → secrets-GWLYB2KD.js} +13 -13
  65. package/dist/cli/{secrets-DGRJ4DO5.mjs → secrets-QTTR5R5M.mjs} +4 -4
  66. package/dist/cli/{sessions-56EHXLZD.mjs → sessions-Q7MY5YYI.mjs} +4 -4
  67. package/dist/cli/{sessions-VG4ATQ5Y.js → sessions-SUURWTVX.js} +5 -5
  68. package/dist/cli/{settings-4U5XG7QI.mjs → settings-3D5YDD2B.mjs} +7 -7
  69. package/dist/cli/{settings-BLOTIW2G.js → settings-W4DYMYFA.js} +74 -74
  70. package/dist/cli/{setup-RHJAHPOR.mjs → setup-5F5OGYKW.mjs} +6 -6
  71. package/dist/cli/{setup-L7AMAXCH.js → setup-NIUADTDP.js} +41 -41
  72. package/dist/cli/skills-SHUL5UT7.js +28 -0
  73. package/dist/cli/{skills-VU55YFCI.mjs → skills-TV3ORUIG.mjs} +4 -4
  74. package/dist/cli/tools-GNIVV4OF.js +40 -0
  75. package/dist/cli/{tools-JS3YIDOH.mjs → tools-YSZWAFKO.mjs} +6 -6
  76. package/dist/cli/{update-EHI5QUXM.mjs → update-FJAMLGLT.mjs} +6 -6
  77. package/dist/cli/update-U3XGY6IT.js +28 -0
  78. package/dist/cli/{workflow-NE4SYRAT.js → workflow-C6ZCM5S4.js} +15 -15
  79. package/dist/cli/{workflow-BITLTLRF.mjs → workflow-HDHBYC7S.mjs} +5 -5
  80. package/dist/index.js +6 -6
  81. package/dist/index.mjs +3 -3
  82. package/dist/install-integrity.json +75 -74
  83. package/dist/release.d.mts +1 -1
  84. package/dist/release.d.ts +1 -1
  85. package/dist/release.js +2 -2
  86. package/dist/release.mjs +1 -1
  87. package/package.json +1 -1
  88. package/dist/cli/auth-W2MQM6GQ.js +0 -31
  89. package/dist/cli/client-5AIFBLKQ.js +0 -20
  90. package/dist/cli/git-YWRLAOBY.js +0 -23
  91. package/dist/cli/play-OYRHI7G3.js +0 -153
  92. package/dist/cli/search-VE3O3ZEM.js +0 -26
  93. package/dist/cli/skills-QB4OQGGP.js +0 -28
  94. package/dist/cli/tools-2CPFYNK7.js +0 -40
  95. package/dist/cli/update-WXP24GU5.js +0 -28
@@ -10,11 +10,11 @@ import {
10
10
  } from "./chunk-EDWJY6T4.mjs";
11
11
  import {
12
12
  registerDeprecatedSearchCommand
13
- } from "./chunk-3RZJ3GEG.mjs";
13
+ } from "./chunk-VFC6CZLF.mjs";
14
14
  import {
15
15
  handleDeploymentGet,
16
16
  handleDeploymentsList
17
- } from "./chunk-ERU2OR6F.mjs";
17
+ } from "./chunk-5W636CDP.mjs";
18
18
  import {
19
19
  PLAY_BOOTSTRAP_COMPANY_PROVIDER_CATEGORY,
20
20
  PLAY_BOOTSTRAP_OUTPUT_FIELD_BY_FINDER,
@@ -39,7 +39,7 @@ import {
39
39
  normalizeRunEventOperationRequest,
40
40
  parseLogLevel,
41
41
  playInputExampleArgs
42
- } from "./chunk-OZGU7P2S.mjs";
42
+ } from "./chunk-GTBS6LQH.mjs";
43
43
  import {
44
44
  CSV_DATA_INPUT_KEY,
45
45
  buildNamedPlayRunRequest,
@@ -70,11 +70,12 @@ import {
70
70
  printCompactJson,
71
71
  printJson,
72
72
  printJsonError,
73
- renderCommandEnvelopeText
74
- } from "./chunk-EROOAI5G.mjs";
73
+ renderCommandEnvelopeText,
74
+ shouldEmitJson
75
+ } from "./chunk-7DGZCMXQ.mjs";
75
76
  import {
76
77
  fetchWithDeploymentProtection
77
- } from "./chunk-FK7PW6BP.mjs";
78
+ } from "./chunk-MBI3BVSQ.mjs";
78
79
  import {
79
80
  PLAY_DEFAULT_EXPORT,
80
81
  extractDefinedPlayName,
@@ -5860,6 +5861,55 @@ function registerRunHistoryCommand(runs) {
5860
5861
  ).action(handleRunsHistory);
5861
5862
  }
5862
5863
 
5864
+ // src/cli/operations/runs-rerun.ts
5865
+ async function runRunsRerunCommand(runId, options) {
5866
+ const idempotencyKey = options.idempotencyKey?.trim();
5867
+ if (options.idempotencyKey !== void 0 && (!idempotencyKey || options.idempotencyKey.startsWith("--"))) {
5868
+ console.error("--idempotency-key requires a non-empty value.");
5869
+ return 1;
5870
+ }
5871
+ let inputOverrides;
5872
+ if (options.inputOverrides !== void 0) {
5873
+ if (!options.inputOverrides || options.inputOverrides.startsWith("--")) {
5874
+ console.error("--input-overrides requires a JSON object.");
5875
+ return 1;
5876
+ }
5877
+ try {
5878
+ const parsed = JSON.parse(options.inputOverrides);
5879
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed) || Object.values(parsed).some(
5880
+ (entry) => entry !== null && !["string", "number", "boolean"].includes(typeof entry) || typeof entry === "number" && !Number.isFinite(entry)
5881
+ )) {
5882
+ throw new Error("expected scalar values");
5883
+ }
5884
+ inputOverrides = parsed;
5885
+ } catch {
5886
+ console.error(
5887
+ "--input-overrides must be a JSON object of scalar values."
5888
+ );
5889
+ return 1;
5890
+ }
5891
+ }
5892
+ const result = await new DeeplineClient().runs.rerun(runId, {
5893
+ ...idempotencyKey === void 0 ? {} : { idempotencyKey },
5894
+ ...inputOverrides === void 0 ? {} : { inputOverrides }
5895
+ });
5896
+ if (shouldEmitJson(options.json)) {
5897
+ printCommandEnvelope(result, { json: true });
5898
+ } else {
5899
+ console.log(
5900
+ result.deduplicated === true ? `
5901
+ Rerun already exists for ${runId} (matched by idempotency key): ${result.runId}` : `
5902
+ Rerun started from ${runId}${inputOverrides ? " with input overrides" : ""}.`
5903
+ );
5904
+ console.log(` inspect: deepline runs get ${result.runId} --json`);
5905
+ console.log(` original input: deepline runs get ${result.runId} --input`);
5906
+ console.log(
5907
+ result.deduplicated === true ? " No new run was started. Use a different --idempotency-key to start another rerun." : ` This is a fresh run using the original input${inputOverrides ? " with the supplied field overrides" : ""} and pinned revision. Normal tool receipt reuse still applies.`
5908
+ );
5909
+ }
5910
+ return 0;
5911
+ }
5912
+
5863
5913
  // ../play-data-plane/column-names.ts
5864
5914
  var POSTGRES_IDENTIFIER_MAX_BYTES = 63;
5865
5915
  var HASH_SUFFIX_LENGTH = 10;
@@ -15544,59 +15594,15 @@ async function handleRunsRerun(args) {
15544
15594
  console.error(error instanceof Error ? error.message : usage2);
15545
15595
  return 1;
15546
15596
  }
15547
- let idempotencyKey;
15548
- let inputOverrides;
15597
+ const options = { json: argsWantJson(args) };
15549
15598
  for (let index = 0; index < args.length; index += 1) {
15550
15599
  if (args[index] === "--idempotency-key") {
15551
- const value = args[index + 1];
15552
- if (!value || value.startsWith("--") || !value.trim()) {
15553
- console.error("--idempotency-key requires a non-empty value.");
15554
- return 1;
15555
- }
15556
- idempotencyKey = value.trim();
15557
- index += 1;
15600
+ options.idempotencyKey = args[++index] ?? "";
15558
15601
  } else if (args[index] === "--input-overrides") {
15559
- const value = args[index + 1];
15560
- if (!value || value.startsWith("--")) {
15561
- console.error("--input-overrides requires a JSON object.");
15562
- return 1;
15563
- }
15564
- try {
15565
- const parsed = JSON.parse(value);
15566
- if (!parsed || typeof parsed !== "object" || Array.isArray(parsed) || Object.values(parsed).some(
15567
- (entry) => entry !== null && !["string", "number", "boolean"].includes(typeof entry) || typeof entry === "number" && !Number.isFinite(entry)
15568
- )) {
15569
- throw new Error("expected scalar values");
15570
- }
15571
- inputOverrides = parsed;
15572
- } catch {
15573
- console.error(
15574
- "--input-overrides must be a JSON object of scalar values."
15575
- );
15576
- return 1;
15577
- }
15578
- index += 1;
15602
+ options.inputOverrides = args[++index] ?? "";
15579
15603
  }
15580
15604
  }
15581
- const result = await new DeeplineClient().runs.rerun(runId, {
15582
- ...idempotencyKey ? { idempotencyKey } : {},
15583
- ...inputOverrides ? { inputOverrides } : {}
15584
- });
15585
- if (argsWantJson(args)) {
15586
- printCommandEnvelope(result, { json: true });
15587
- } else {
15588
- console.log(
15589
- result.deduplicated === true ? `
15590
- Rerun already exists for ${runId} (matched by idempotency key): ${result.runId}` : `
15591
- Rerun started from ${runId}${inputOverrides ? " with input overrides" : ""}.`
15592
- );
15593
- console.log(` inspect: deepline runs get ${result.runId} --json`);
15594
- console.log(` original input: deepline runs get ${result.runId} --input`);
15595
- console.log(
15596
- result.deduplicated === true ? " No new run was started. Use a different --idempotency-key to start another rerun." : ` This is a fresh run using the original input${inputOverrides ? " with the supplied field overrides" : ""} and pinned revision. Normal tool receipt reuse still applies.`
15597
- );
15598
- }
15599
- return 0;
15605
+ return runRunsRerunCommand(runId, options);
15600
15606
  }
15601
15607
  async function handleRunsList(args) {
15602
15608
  const usage2 = "Usage: deepline runs list [--play <play-name>] [--node <mermaid-node-id>] [--status <status>] [--limit <count>] [--offset <count>] [--json]";
@@ -18150,7 +18156,7 @@ Examples:
18150
18156
  process.exitCode = await ownView();
18151
18157
  return;
18152
18158
  }
18153
- const { describeAnything } = await import("./describe-XWOWAR32.mjs");
18159
+ const { describeAnything } = await import("./describe-WECII7FS.mjs");
18154
18160
  process.exitCode = await describeAnything(
18155
18161
  name,
18156
18162
  {
@@ -18482,12 +18488,7 @@ Examples:
18482
18488
  "--input-overrides <json>",
18483
18489
  "Override existing scalar fields in the retained input for this rerun"
18484
18490
  ).option("--json", "Emit JSON output. Also automatic when stdout is piped").action(async (runId, options) => {
18485
- process.exitCode = await handleRunsRerun([
18486
- runId,
18487
- ...options.idempotencyKey ? ["--idempotency-key", options.idempotencyKey] : [],
18488
- ...options.inputOverrides ? ["--input-overrides", options.inputOverrides] : [],
18489
- ...options.json ? ["--json"] : []
18490
- ]);
18491
+ process.exitCode = await runRunsRerunCommand(runId, options);
18491
18492
  });
18492
18493
  runs.command("list").description("List play runs.").addHelpText(
18493
18494
  "after",
@@ -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.329",
52
+ version: "0.3.330",
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
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  DeeplineClient
3
- } from "./chunk-OZGU7P2S.mjs";
3
+ } from "./chunk-GTBS6LQH.mjs";
4
4
  import {
5
5
  printCommandEnvelope,
6
6
  renderCommandEnvelopeText
7
- } from "./chunk-EROOAI5G.mjs";
7
+ } from "./chunk-7DGZCMXQ.mjs";
8
8
  import {
9
9
  resolveConfig,
10
10
  sdkCliStateDirPath
11
- } from "./chunk-FK7PW6BP.mjs";
11
+ } from "./chunk-MBI3BVSQ.mjs";
12
12
 
13
13
  // src/cli/search-ref.ts
14
14
  import { mkdirSync, readFileSync, writeFileSync } from "fs";
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkVDIHLKGGjs = require('./chunk-VDIHLKGG.js');
6
+ var _chunkGHHLLEZKjs = require('./chunk-GHHLLEZK.js');
7
7
 
8
8
 
9
9
  var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
@@ -136,8 +136,8 @@ var BROWSER_OPEN_COOLDOWN_MS = 3e4;
136
136
  var SAME_URL_BROWSER_OPEN_COOLDOWN_MS = 5 * 6e4;
137
137
  var defaultBrowserCommandRunner = childProcess;
138
138
  function getAuthedHttpClient() {
139
- const config = _chunkVDIHLKGGjs.resolveConfig.call(void 0, );
140
- return { config, http: new (0, _chunkVDIHLKGGjs.HttpClient)(config) };
139
+ const config = _chunkGHHLLEZKjs.resolveConfig.call(void 0, );
140
+ return { config, http: new (0, _chunkGHHLLEZKjs.HttpClient)(config) };
141
141
  }
142
142
  function stableOsUserId() {
143
143
  try {
@@ -477,7 +477,7 @@ function collectLocalEnvInfo() {
477
477
  os: `${process.platform} ${process.arch}`,
478
478
  node_version: process.version,
479
479
  home_dir: homeDir,
480
- agent_runtime: _chunkVDIHLKGGjs.detectAgentRuntime.call(void 0, )
480
+ agent_runtime: _chunkGHHLLEZKjs.detectAgentRuntime.call(void 0, )
481
481
  };
482
482
  const env = process.env;
483
483
  const optional = {
@@ -725,9 +725,9 @@ function markdownTableFromRows(rows, preferredColumns = []) {
725
725
  }
726
726
  function withAgentCommandContext(value) {
727
727
  const valueRecord = value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
728
- return _chunkVDIHLKGGjs.detectAgentRuntime.call(void 0, ) !== "unknown" && valueRecord && !Object.prototype.hasOwnProperty.call(valueRecord, "command_context") ? {
728
+ return _chunkGHHLLEZKjs.detectAgentRuntime.call(void 0, ) !== "unknown" && valueRecord && !Object.prototype.hasOwnProperty.call(valueRecord, "command_context") ? {
729
729
  ...valueRecord,
730
- command_context: _chunkVDIHLKGGjs.resolveCliCommandContext.call(void 0, )
730
+ command_context: _chunkGHHLLEZKjs.resolveCliCommandContext.call(void 0, )
731
731
  } : value;
732
732
  }
733
733
  function printJson(value, fields) {
@@ -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.329",
52
+ version: "0.3.330",
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
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
- var _chunkU2N4CYT7js = require('./chunk-U2N4CYT7.js');
4
+ var _chunkWHKTRZ3Jjs = require('./chunk-WHKTRZ3J.js');
5
5
 
6
6
  // src/cli/commands/sessions.ts
7
7
 
@@ -420,7 +420,7 @@ function buildSessionUploadContent(raw) {
420
420
  return { encodedContent: encoded, needsChunking: true };
421
421
  }
422
422
  async function uploadPayload(path, payload) {
423
- const { http } = _chunkU2N4CYT7js.getAuthedHttpClient.call(void 0, );
423
+ const { http } = _chunkWHKTRZ3Jjs.getAuthedHttpClient.call(void 0, );
424
424
  return await http.post(path, payload);
425
425
  }
426
426
  async function uploadChunkedSessions(sessions, options) {
@@ -452,7 +452,7 @@ async function uploadChunkedSessions(sessions, options) {
452
452
  environments: sessions.map(() => detectShellContext()),
453
453
  ...options.rating ? { rating: options.rating } : {}
454
454
  });
455
- _chunkU2N4CYT7js.printCommandEnvelope.call(void 0,
455
+ _chunkWHKTRZ3Jjs.printCommandEnvelope.call(void 0,
456
456
  {
457
457
  ...response,
458
458
  ok: true,
@@ -481,7 +481,7 @@ async function handleSessionsSend(options) {
481
481
  filename: _path.basename.call(void 0, filePath),
482
482
  ...rating ? { rating } : {}
483
483
  });
484
- _chunkU2N4CYT7js.printCommandEnvelope.call(void 0,
484
+ _chunkWHKTRZ3Jjs.printCommandEnvelope.call(void 0,
485
485
  {
486
486
  ...response2,
487
487
  ok: true,
@@ -530,7 +530,7 @@ async function handleSessionsSend(options) {
530
530
  environment: detectShellContext(),
531
531
  ...rating ? { rating } : {}
532
532
  });
533
- _chunkU2N4CYT7js.printCommandEnvelope.call(void 0,
533
+ _chunkWHKTRZ3Jjs.printCommandEnvelope.call(void 0,
534
534
  {
535
535
  ...response,
536
536
  ok: true,
@@ -635,7 +635,7 @@ ${refreshMeta}
635
635
  </body>
636
636
  </html>`;
637
637
  _fs.writeFileSync.call(void 0, outputPath, html, "utf8");
638
- _chunkU2N4CYT7js.printCommandEnvelope.call(void 0,
638
+ _chunkWHKTRZ3Jjs.printCommandEnvelope.call(void 0,
639
639
  {
640
640
  ok: true,
641
641
  file: outputPath,
@@ -15,7 +15,7 @@ var _chunkLA46MMTLjs = require('./chunk-LA46MMTL.js');
15
15
 
16
16
 
17
17
 
18
- var _chunkVDIHLKGGjs = require('./chunk-VDIHLKGG.js');
18
+ var _chunkGHHLLEZKjs = require('./chunk-GHHLLEZK.js');
19
19
 
20
20
 
21
21
 
@@ -82,6 +82,27 @@ function playInputExampleArgs(schema) {
82
82
  return " --input '@<input.json>'";
83
83
  }
84
84
 
85
+ // src/billing-idempotency.ts
86
+ function requireBillingIdempotencyKey(value) {
87
+ const normalized = value.trim();
88
+ let valid = normalized.length > 0 && normalized.length <= 200 && normalized === value;
89
+ if (valid) {
90
+ try {
91
+ valid = new Headers({ "Idempotency-Key": value }).get("Idempotency-Key") === value;
92
+ } catch (e) {
93
+ valid = false;
94
+ }
95
+ }
96
+ if (!valid) {
97
+ throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
98
+ "Billing idempotencyKey must contain 1\u2013200 characters with no leading or trailing whitespace and be valid HTTP header text.",
99
+ void 0,
100
+ "INVALID_BILLING_IDEMPOTENCY_KEY"
101
+ );
102
+ }
103
+ return value;
104
+ }
105
+
85
106
  // src/db/query.ts
86
107
  function planCustomerDbQuery(input) {
87
108
  if (typeof input.sql !== "string" || !input.sql.trim())
@@ -146,7 +167,7 @@ async function queryCustomerDatabase(http, input) {
146
167
  if (error instanceof _chunk7P5AA3SNjs.DeeplineError && (_optionalChain([error, 'access', _2 => _2.code, 'optionalAccess', _3 => _3.startsWith, 'call', _4 => _4("NETWORK_")]) || // Older API readers return PostgreSQL errors as HTTP 400, including
147
168
  // lost connections and explicitly unknown transaction resolution.
148
169
  /^08[A-Z0-9]{3}$/.test(_nullishCoalesce(error.code, () => ( ""))) || ["57P01", "57P02", "57P03"].includes(_nullishCoalesce(error.code, () => ( ""))) || error.statusCode === 408 || (_nullishCoalesce(error.statusCode, () => ( 0))) >= 500)) {
149
- throw new (0, _chunkVDIHLKGGjs.CustomerDbQueryOutcomeUnknownError)(
170
+ throw new (0, _chunkGHHLLEZKjs.CustomerDbQueryOutcomeUnknownError)(
150
171
  error,
151
172
  plan.request.body.operation_key
152
173
  );
@@ -154,7 +175,7 @@ async function queryCustomerDatabase(http, input) {
154
175
  throw error;
155
176
  }
156
177
  if (!result || typeof result !== "object" || Array.isArray(result) || typeof result.command !== "string" || !Array.isArray(result.columns) || !Array.isArray(result.rows) || typeof result.truncated !== "boolean" || result.row_count !== null && (!Number.isSafeInteger(result.row_count) || result.row_count < 0) || !Number.isSafeInteger(result.row_count_returned) || result.row_count_returned < 0) {
157
- throw new (0, _chunkVDIHLKGGjs.CustomerDbQueryOutcomeUnknownError)(
178
+ throw new (0, _chunkGHHLLEZKjs.CustomerDbQueryOutcomeUnknownError)(
158
179
  new (0, _chunk7P5AA3SNjs.DeeplineError)(
159
180
  "The SQL response did not contain a valid result.",
160
181
  200,
@@ -165,7 +186,7 @@ async function queryCustomerDatabase(http, input) {
165
186
  }
166
187
  const operation = result.operation;
167
188
  if (input.operationKey !== void 0 && (!operation || operation.operation_key !== input.operationKey || !Number.isSafeInteger(operation.completed_at_ms) || operation.completed_at_ms < 0 || !["executed", "operation_recovery"].includes(operation.source))) {
168
- throw new (0, _chunkVDIHLKGGjs.CustomerDbQueryOutcomeUnknownError)(
189
+ throw new (0, _chunkGHHLLEZKjs.CustomerDbQueryOutcomeUnknownError)(
169
190
  new (0, _chunk7P5AA3SNjs.DeeplineError)(
170
191
  "The server did not confirm the original atomic SQL operation.",
171
192
  200,
@@ -861,7 +882,7 @@ function createSecretRedactionContext(initialValues = []) {
861
882
  try {
862
883
  const encoded = encodeURIComponent(secret);
863
884
  if (encoded !== secret) literals.push(encoded);
864
- } catch (e) {
885
+ } catch (e2) {
865
886
  }
866
887
  const built = literals.map((literal) => ({
867
888
  literal,
@@ -882,7 +903,7 @@ function createSecretRedactionContext(initialValues = []) {
882
903
  try {
883
904
  const encoded = encodeURIComponent(secret);
884
905
  if (encoded !== secret && value.includes(encoded)) return true;
885
- } catch (e2) {
906
+ } catch (e3) {
886
907
  }
887
908
  }
888
909
  }
@@ -2172,7 +2193,7 @@ function bounded(value, maxBytes = MAX_BYTES) {
2172
2193
  let encoded;
2173
2194
  try {
2174
2195
  encoded = JSON.stringify(value);
2175
- } catch (e3) {
2196
+ } catch (e4) {
2176
2197
  fail("Run event query must be bounded JSON without cycles.");
2177
2198
  }
2178
2199
  if (!encoded || new TextEncoder().encode(encoded).length > maxBytes)
@@ -2372,7 +2393,7 @@ function parseDsl(input) {
2372
2393
  }
2373
2394
  try {
2374
2395
  return JSON.parse(input.slice(start, position));
2375
- } catch (e4) {
2396
+ } catch (e5) {
2376
2397
  fail("Run event DSL requires valid JSON scalars.");
2377
2398
  }
2378
2399
  };
@@ -2854,8 +2875,8 @@ function runtimeSelectionHeaders(runtime) {
2854
2875
  }
2855
2876
  const receivers = _optionalChain([process, 'access', _102 => _102.env, 'access', _103 => _103.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _104 => _104.trim, 'call', _105 => _105()]);
2856
2877
  return {
2857
- [_chunkVDIHLKGGjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
2858
- ...receivers ? { [_chunkVDIHLKGGjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
2878
+ [_chunkGHHLLEZKjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
2879
+ ...receivers ? { [_chunkGHHLLEZKjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
2859
2880
  };
2860
2881
  }
2861
2882
  function isolatedCiRuntimeEventReadHeaders() {
@@ -2871,7 +2892,7 @@ function isolatedCiRuntimeEventReadHeaders() {
2871
2892
  "RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
2872
2893
  );
2873
2894
  }
2874
- return { [_chunkVDIHLKGGjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
2895
+ return { [_chunkGHHLLEZKjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
2875
2896
  }
2876
2897
  function normalizeTestPolicyOverrides(value, source) {
2877
2898
  if (value && typeof value === "object" && !Array.isArray(value)) {
@@ -3007,17 +3028,6 @@ var MONITOR_JOB_RECONCILIATION_STATES = [
3007
3028
  "partial",
3008
3029
  "mismatched"
3009
3030
  ];
3010
- function requireTargetBillingIdempotencyKey(value) {
3011
- const normalized = value.trim();
3012
- if (normalized.length === 0 || normalized.length > 200 || normalized !== value) {
3013
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
3014
- "Billing idempotencyKey must contain 1\u2013200 characters with no leading or trailing whitespace.",
3015
- void 0,
3016
- "INVALID_BILLING_IDEMPOTENCY_KEY"
3017
- );
3018
- }
3019
- return normalized;
3020
- }
3021
3031
  function isRecord2(value) {
3022
3032
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
3023
3033
  }
@@ -3172,8 +3182,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
3172
3182
  * @throws {@link ConfigError} if no API key can be resolved from any source.
3173
3183
  */
3174
3184
  constructor(options) {
3175
- this.config = _chunkVDIHLKGGjs.resolveConfig.call(void 0, options);
3176
- this.http = new (0, _chunkVDIHLKGGjs.HttpClient)(this.config);
3185
+ this.config = _chunkGHHLLEZKjs.resolveConfig.call(void 0, options);
3186
+ this.http = new (0, _chunkGHHLLEZKjs.HttpClient)(this.config);
3177
3187
  this.toolCalls = new ToolCalls(
3178
3188
  this.http,
3179
3189
  this.config.timeout,
@@ -3236,7 +3246,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3236
3246
  "/api/v2/billing/auto-recharge/trigger",
3237
3247
  {},
3238
3248
  {
3239
- "Idempotency-Key": requireTargetBillingIdempotencyKey(
3249
+ "Idempotency-Key": requireBillingIdempotencyKey(
3240
3250
  _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _145 => _145.idempotencyKey]), () => ( globalThis.crypto.randomUUID()))
3241
3251
  )
3242
3252
  }
@@ -5671,13 +5681,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
5671
5681
  * requires confirmation.
5672
5682
  */
5673
5683
  async topUpBillingBalance(options) {
5684
+ const idempotencyKey = options.idempotencyKey === void 0 ? void 0 : requireBillingIdempotencyKey(options.idempotencyKey);
5674
5685
  return this.http.post(
5675
5686
  "/api/v2/billing/top-up",
5676
5687
  {
5677
5688
  credits: options.credits,
5678
- ...options.idempotencyKey ? { idempotency_key: options.idempotencyKey } : {}
5689
+ ...idempotencyKey !== void 0 ? { idempotency_key: idempotencyKey } : {}
5679
5690
  },
5680
- void 0,
5691
+ idempotencyKey === void 0 ? void 0 : { "Idempotency-Key": idempotencyKey },
5681
5692
  // The idempotency key makes a retry at the product layer safe, but the
5682
5693
  // CLI should not hide ambiguous local delivery failures behind implicit
5683
5694
  // transport retries for a payment mutation.
@@ -5690,13 +5701,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
5690
5701
  * `client.billing.topUpWithReceipt(...)`.
5691
5702
  */
5692
5703
  async topUpBillingBalanceWithReceipt(options) {
5704
+ const idempotencyKey = options.idempotencyKey === void 0 ? void 0 : requireBillingIdempotencyKey(options.idempotencyKey);
5693
5705
  return this.http.post(
5694
5706
  "/api/v2/billing/top-up",
5695
5707
  {
5696
5708
  credits: options.credits,
5697
- ...options.idempotencyKey ? { idempotency_key: options.idempotencyKey } : {}
5709
+ ...idempotencyKey !== void 0 ? { idempotency_key: idempotencyKey } : {}
5710
+ },
5711
+ {
5712
+ "x-deepline-top-up-receipt": "operation-v1",
5713
+ ...idempotencyKey !== void 0 ? { "Idempotency-Key": idempotencyKey } : {}
5698
5714
  },
5699
- { "x-deepline-top-up-receipt": "operation-v1" },
5700
5715
  { maxRetries: 0, exactUrlOnly: true }
5701
5716
  );
5702
5717
  }
@@ -5761,7 +5776,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5761
5776
  }
5762
5777
  /** Update automatic recharge and return the server-verified configuration. */
5763
5778
  async updateTargetAutoRecharge(options) {
5764
- const idempotencyKey = requireTargetBillingIdempotencyKey(
5779
+ const idempotencyKey = requireBillingIdempotencyKey(
5765
5780
  options.idempotencyKey
5766
5781
  );
5767
5782
  const response = await this.http.put(
@@ -5782,7 +5797,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5782
5797
  * flow. The caller supplies an idempotency key for safe retries.
5783
5798
  */
5784
5799
  async purchaseTargetBillingCredits(options) {
5785
- const idempotencyKey = requireTargetBillingIdempotencyKey(
5800
+ const idempotencyKey = requireBillingIdempotencyKey(
5786
5801
  options.idempotencyKey
5787
5802
  );
5788
5803
  return this.http.post(
@@ -5801,7 +5816,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5801
5816
  "INVALID_BILLING_IDEMPOTENCY_KEY"
5802
5817
  );
5803
5818
  }
5804
- const idempotencyKey = requireTargetBillingIdempotencyKey(
5819
+ const idempotencyKey = requireBillingIdempotencyKey(
5805
5820
  options.idempotencyKey
5806
5821
  );
5807
5822
  if (!Number.isSafeInteger(options.credits) || options.credits <= 0) {
@@ -5830,7 +5845,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5830
5845
  * commercial operation.
5831
5846
  */
5832
5847
  async transitionTargetBillingPlan(options) {
5833
- const idempotencyKey = requireTargetBillingIdempotencyKey(
5848
+ const idempotencyKey = requireBillingIdempotencyKey(
5834
5849
  options.idempotencyKey
5835
5850
  );
5836
5851
  return this.http.post(
@@ -5854,7 +5869,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5854
5869
  }
5855
5870
  /** Create an additional workspace through the durable PAYG workflow. */
5856
5871
  async createWorkspace(options) {
5857
- const idempotencyKey = requireTargetBillingIdempotencyKey(
5872
+ const idempotencyKey = requireBillingIdempotencyKey(
5858
5873
  options.idempotencyKey
5859
5874
  );
5860
5875
  const response = await this.http.post(
@@ -6491,4 +6506,5 @@ var DeeplineClient = (_class = class _DeeplineClient {
6491
6506
 
6492
6507
 
6493
6508
 
6494
- exports.CSV_HEADER_MATCHING_NOTE = CSV_HEADER_MATCHING_NOTE; exports.iterateCursorPages = iterateCursorPages; exports.playInputExampleArgs = playInputExampleArgs; exports.planCustomerDbQuery = planCustomerDbQuery; exports.validateExecutionIdempotencyKey = validateExecutionIdempotencyKey; exports.PRODUCT_NOTIFICATION_EVENT_CATALOG = PRODUCT_NOTIFICATION_EVENT_CATALOG; exports.resolveLegacySlackNotification = resolveLegacySlackNotification; exports.RUN_EVENT_SEARCH_KIND_VALUES = RUN_EVENT_SEARCH_KIND_VALUES; exports.logProvenanceReaches = logProvenanceReaches; exports.logLevelReaches = logLevelReaches; exports.parseLogLevel = parseLogLevel; exports.classifyLogLine = classifyLogLine; exports.isTransientPlayRunReadError = isTransientPlayRunReadError; exports.encodeRunLogsCursor = encodeRunLogsCursor; exports.isRunLogsCursor = isRunLogsCursor; exports.RunEventQueryInputError = RunEventQueryInputError; exports.normalizeRunEventOperationRequest = normalizeRunEventOperationRequest; exports.isStopAllPlayRunsDryRunResult = isStopAllPlayRunsDryRunResult; exports.MONITOR_JOB_STATES = MONITOR_JOB_STATES; exports.MONITOR_JOB_PHASES = MONITOR_JOB_PHASES; exports.MONITOR_JOB_RECONCILIATION_STATES = MONITOR_JOB_RECONCILIATION_STATES; exports.DeeplineClient = DeeplineClient;
6509
+
6510
+ exports.CSV_HEADER_MATCHING_NOTE = CSV_HEADER_MATCHING_NOTE; exports.iterateCursorPages = iterateCursorPages; exports.playInputExampleArgs = playInputExampleArgs; exports.requireBillingIdempotencyKey = requireBillingIdempotencyKey; exports.planCustomerDbQuery = planCustomerDbQuery; exports.validateExecutionIdempotencyKey = validateExecutionIdempotencyKey; exports.PRODUCT_NOTIFICATION_EVENT_CATALOG = PRODUCT_NOTIFICATION_EVENT_CATALOG; exports.resolveLegacySlackNotification = resolveLegacySlackNotification; exports.RUN_EVENT_SEARCH_KIND_VALUES = RUN_EVENT_SEARCH_KIND_VALUES; exports.logProvenanceReaches = logProvenanceReaches; exports.logLevelReaches = logLevelReaches; exports.parseLogLevel = parseLogLevel; exports.classifyLogLine = classifyLogLine; exports.isTransientPlayRunReadError = isTransientPlayRunReadError; exports.encodeRunLogsCursor = encodeRunLogsCursor; exports.isRunLogsCursor = isRunLogsCursor; exports.RunEventQueryInputError = RunEventQueryInputError; exports.normalizeRunEventOperationRequest = normalizeRunEventOperationRequest; exports.isStopAllPlayRunsDryRunResult = isStopAllPlayRunsDryRunResult; exports.MONITOR_JOB_STATES = MONITOR_JOB_STATES; exports.MONITOR_JOB_PHASES = MONITOR_JOB_PHASES; exports.MONITOR_JOB_RECONCILIATION_STATES = MONITOR_JOB_RECONCILIATION_STATES; exports.DeeplineClient = DeeplineClient;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveShellSpawn
3
- } from "./chunk-YNSCELIJ.mjs";
3
+ } from "./chunk-6VBXS43D.mjs";
4
4
 
5
5
  // src/cli/npm-script-policy.ts
6
6
  import { spawnSync } from "child_process";
@@ -0,0 +1,20 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+ var _chunkYGFQ7YSMjs = require('./chunk-YGFQ7YSM.js');
7
+ require('./chunk-LA46MMTL.js');
8
+ require('./chunk-GHHLLEZK.js');
9
+ require('./chunk-XNYIZMNQ.js');
10
+ require('./chunk-XUNMVZOW.js');
11
+ require('./chunk-S6R3OX7B.js');
12
+ require('./chunk-7P5AA3SN.js');
13
+ require('./chunk-OG64RBAC.js');
14
+ require('./chunk-COGTRVWW.js');
15
+
16
+
17
+
18
+
19
+
20
+ exports.DeeplineClient = _chunkYGFQ7YSMjs.DeeplineClient; exports.MONITOR_JOB_PHASES = _chunkYGFQ7YSMjs.MONITOR_JOB_PHASES; exports.MONITOR_JOB_RECONCILIATION_STATES = _chunkYGFQ7YSMjs.MONITOR_JOB_RECONCILIATION_STATES; exports.MONITOR_JOB_STATES = _chunkYGFQ7YSMjs.MONITOR_JOB_STATES;
@@ -3,11 +3,11 @@ import {
3
3
  MONITOR_JOB_PHASES,
4
4
  MONITOR_JOB_RECONCILIATION_STATES,
5
5
  MONITOR_JOB_STATES
6
- } from "./chunk-OZGU7P2S.mjs";
6
+ } from "./chunk-GTBS6LQH.mjs";
7
7
  import "./chunk-CBVIJSHF.mjs";
8
- import "./chunk-FK7PW6BP.mjs";
8
+ import "./chunk-MBI3BVSQ.mjs";
9
9
  import "./chunk-DLIRSHV6.mjs";
10
- import "./chunk-GCNER3HV.mjs";
10
+ import "./chunk-SZCUJ4AL.mjs";
11
11
  import "./chunk-6IKARAYD.mjs";
12
12
  import "./chunk-NXGCO4JB.mjs";
13
13
  import "./chunk-WZYKRD7T.mjs";
@@ -4,10 +4,10 @@ import {
4
4
  printCommandEnvelope,
5
5
  printJson,
6
6
  readCsvRows
7
- } from "./chunk-EROOAI5G.mjs";
8
- import "./chunk-FK7PW6BP.mjs";
7
+ } from "./chunk-7DGZCMXQ.mjs";
8
+ import "./chunk-MBI3BVSQ.mjs";
9
9
  import "./chunk-DLIRSHV6.mjs";
10
- import "./chunk-GCNER3HV.mjs";
10
+ import "./chunk-SZCUJ4AL.mjs";
11
11
  import "./chunk-NXGCO4JB.mjs";
12
12
  import "./chunk-WZYKRD7T.mjs";
13
13
  import "./chunk-KRD6H754.mjs";