deepline 0.3.304 → 0.3.306

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 (103) hide show
  1. package/dist/bundling-sources/sdk/src/cli-invocation-id.ts +14 -0
  2. package/dist/bundling-sources/sdk/src/client.ts +24 -1
  3. package/dist/bundling-sources/sdk/src/http.ts +11 -0
  4. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  5. package/dist/bundling-sources/sdk/src/tool-calls.ts +19 -1
  6. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-pool.ts +1 -1
  7. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +51 -25
  8. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +10 -0
  9. package/dist/bundling-sources/shared_libs/product-notifications/billing-sales.ts +13 -0
  10. package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +69 -0
  11. package/dist/bundling-sources/shared_libs/product-notifications/default-policy.ts +26 -1
  12. package/dist/bundling-sources/shared_libs/product-notifications/events.ts +9 -1
  13. package/dist/cli/{auth-YKJHKHIQ.mjs → auth-WTC7LCQ6.mjs} +4 -4
  14. package/dist/cli/auth-ZT3UF33R.js +31 -0
  15. package/dist/cli/{billing-EOIKAZES.js → billing-3DYTHO32.js} +70 -70
  16. package/dist/cli/{billing-XEEW5SV2.mjs → billing-VQM65LVP.mjs} +4 -4
  17. package/dist/cli/chunk-2IKIG333.js +65 -0
  18. package/dist/cli/{chunk-NC4JXVVS.js → chunk-2KR56MPF.js} +2 -2
  19. package/dist/cli/{chunk-7QV545D7.mjs → chunk-4PSSDZQB.mjs} +7 -1
  20. package/dist/cli/{chunk-NW7I3LDU.mjs → chunk-5HS5EEFE.mjs} +3 -3
  21. package/dist/cli/{chunk-35SCWK4Y.mjs → chunk-5V56XCQN.mjs} +1 -1
  22. package/dist/cli/{chunk-JKY2QANB.mjs → chunk-6CRUYVU7.mjs} +4 -4
  23. package/dist/cli/{chunk-IHT6XITB.mjs → chunk-7XORS6WQ.mjs} +2 -2
  24. package/dist/cli/{chunk-7HYH533G.mjs → chunk-FJ3DANI4.mjs} +1 -1
  25. package/dist/cli/{chunk-KP5TOAI4.js → chunk-FZNO6B4W.js} +6 -6
  26. package/dist/cli/{chunk-JZWC4ES6.mjs → chunk-LLGF6V6I.mjs} +44 -8
  27. package/dist/cli/{chunk-DOCDA2YP.js → chunk-M6HCRRV2.js} +10 -4
  28. package/dist/cli/{chunk-BBXO7APG.js → chunk-MMNZ6GBT.js} +6 -6
  29. package/dist/cli/{chunk-INOSSTSG.js → chunk-OF7QP2XX.js} +15 -15
  30. package/dist/cli/{chunk-ZQSQCHG3.js → chunk-OZIFVQRY.js} +1 -1
  31. package/dist/cli/{chunk-FDEU7UY7.js → chunk-PHNAFCSB.js} +275 -239
  32. package/dist/cli/{chunk-TABL2Q6H.mjs → chunk-QDC4XTO3.mjs} +2 -2
  33. package/dist/cli/{chunk-DNBJRKVE.js → chunk-RODIZCGU.js} +60 -60
  34. package/dist/cli/{chunk-NJS3RHQO.js → chunk-SZQPJW2L.js} +6 -6
  35. package/dist/cli/{chunk-7NQJDQPH.js → chunk-U37SW6IK.js} +48 -48
  36. package/dist/cli/chunk-UABLQKTZ.mjs +65 -0
  37. package/dist/cli/{chunk-AOUGAM72.mjs → chunk-UT3VLSLM.mjs} +5 -5
  38. package/dist/cli/{chunk-USJBSNRI.js → chunk-W7ELTWDM.js} +26 -26
  39. package/dist/cli/{chunk-YJ2QYYB5.mjs → chunk-WV64SNDV.mjs} +1 -1
  40. package/dist/cli/{chunk-7OXXCRGZ.mjs → chunk-WWPI4GJI.mjs} +1 -1
  41. package/dist/cli/{client-FZPHVNWV.mjs → client-DCEK34D5.mjs} +3 -3
  42. package/dist/cli/client-UQXVU2T6.js +20 -0
  43. package/dist/cli/{csv-ANJ4KSHF.js → csv-H42JDJ6G.js} +12 -12
  44. package/dist/cli/{csv-CCHVZPRD.mjs → csv-LXBF5UIV.mjs} +3 -3
  45. package/dist/cli/{db-JFVR6STL.mjs → db-3O5CFLNP.mjs} +4 -4
  46. package/dist/cli/{db-AE3MLMRF.js → db-DP5GU4MU.js} +20 -20
  47. package/dist/cli/{executions-DGX53UEW.js → executions-5FFTPHEX.js} +6 -6
  48. package/dist/cli/{executions-WNXCURLN.mjs → executions-QC2UZKIP.mjs} +4 -4
  49. package/dist/cli/{feedback-L4A66OA2.mjs → feedback-JCGE6JFW.mjs} +3 -3
  50. package/dist/cli/{feedback-DGEFG6JI.js → feedback-XAU3FI5S.js} +6 -6
  51. package/dist/cli/git-CNO2UFZE.js +23 -0
  52. package/dist/cli/{git-LIZ3FGVR.mjs → git-S3Y3E2NL.mjs} +4 -4
  53. package/dist/cli/index.js +155 -121
  54. package/dist/cli/index.mjs +121 -87
  55. package/dist/cli/{legacy-noops-UCKGOSJA.mjs → legacy-noops-FQF2IRVS.mjs} +4 -4
  56. package/dist/cli/{legacy-noops-L7GGGAOR.js → legacy-noops-TXOUX4FX.js} +7 -7
  57. package/dist/cli/{monitors-NGACMMWV.js → monitors-4BQCO6B7.js} +85 -85
  58. package/dist/cli/{monitors-NLMFDD4C.mjs → monitors-F3PELPSH.mjs} +4 -4
  59. package/dist/cli/{org-2OW6TPHF.mjs → org-ER5J3ATG.mjs} +4 -4
  60. package/dist/cli/{org-FJSCZ6S3.js → org-VQM6OOLK.js} +60 -60
  61. package/dist/cli/{play-ZZ4AQLL5.mjs → play-B5H2RN4N.mjs} +6 -6
  62. package/dist/cli/{play-GJC4AIAX.js → play-WKZPAOW3.js} +200 -200
  63. package/dist/cli/{providers-D7KLXB4S.js → providers-5TEA2FJG.js} +7 -7
  64. package/dist/cli/{providers-6BJNJUSG.mjs → providers-6ODEAYC2.mjs} +4 -4
  65. package/dist/cli/{quickstart-FH4NGHEJ.mjs → quickstart-BCYT7BCY.mjs} +3 -3
  66. package/dist/cli/{quickstart-6WYRYZJZ.js → quickstart-GJYCNMFC.js} +5 -5
  67. package/dist/cli/{search-KOSJMN3U.js → search-KKJ535OX.js} +6 -6
  68. package/dist/cli/{search-SUT5XFI6.mjs → search-RY547KOT.mjs} +5 -5
  69. package/dist/cli/{secrets-Y2OI2P7O.js → secrets-RFGDXSEW.js} +13 -13
  70. package/dist/cli/{secrets-QK5QP4YU.mjs → secrets-U42ZEYIU.mjs} +4 -4
  71. package/dist/cli/{sessions-VQKZHOQJ.mjs → sessions-YWEFB62D.mjs} +4 -4
  72. package/dist/cli/{sessions-MLDROWXY.js → sessions-ZRTWHMIH.js} +5 -5
  73. package/dist/cli/{settings-SPUINZYG.mjs → settings-AS4U6NVP.mjs} +7 -7
  74. package/dist/cli/{settings-6WOSPHBC.js → settings-XUWFXIL7.js} +74 -74
  75. package/dist/cli/{setup-ZE2SDMC4.mjs → setup-2GUIV2EW.mjs} +6 -6
  76. package/dist/cli/{setup-E2UJV6PW.js → setup-2QPWP2FI.js} +41 -41
  77. package/dist/cli/skills-4E5KYW2Y.js +28 -0
  78. package/dist/cli/{skills-OJYRPY2N.mjs → skills-5QS7ERVF.mjs} +4 -4
  79. package/dist/cli/{tools-BNHRVKLA.js → tools-J47LIO2H.js} +120 -87
  80. package/dist/cli/{tools-O6EIDEKW.mjs → tools-PVWSGCZD.mjs} +76 -43
  81. package/dist/cli/update-GZKGOMKD.js +28 -0
  82. package/dist/cli/{update-NWESWMYF.mjs → update-KS4TRSZI.mjs} +6 -6
  83. package/dist/cli/{workflow-SAJAOPYE.js → workflow-HQRUUTTL.js} +15 -15
  84. package/dist/cli/{workflow-YJHXDD57.mjs → workflow-QCLR7GVC.mjs} +5 -5
  85. package/dist/{client-Me88eH3z.d.mts → client-Dj8MAkDc.d.mts} +91 -1
  86. package/dist/{client-DjJfoW8r.d.ts → client-DsrFGXJf.d.ts} +91 -1
  87. package/dist/index.d.mts +2 -2
  88. package/dist/index.d.ts +2 -2
  89. package/dist/index.js +6 -6
  90. package/dist/index.mjs +3 -3
  91. package/dist/install-integrity.json +74 -70
  92. package/dist/plays/run-request.d.mts +1 -1
  93. package/dist/plays/run-request.d.ts +1 -1
  94. package/dist/release.d.mts +1 -1
  95. package/dist/release.d.ts +1 -1
  96. package/dist/release.js +2 -2
  97. package/dist/release.mjs +1 -1
  98. package/package.json +1 -1
  99. package/dist/cli/auth-UBWZC26A.js +0 -31
  100. package/dist/cli/client-IMFLPCD7.js +0 -20
  101. package/dist/cli/git-6QWUB6CR.js +0 -23
  102. package/dist/cli/skills-J3QIHO5L.js +0 -28
  103. package/dist/cli/update-TDOIF3C4.js +0 -28
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  DeeplineClient
3
- } from "./chunk-JZWC4ES6.mjs";
3
+ } from "./chunk-LLGF6V6I.mjs";
4
4
  import {
5
5
  printCommandEnvelope
6
- } from "./chunk-35SCWK4Y.mjs";
6
+ } from "./chunk-5V56XCQN.mjs";
7
7
  import {
8
8
  resolveConfig,
9
9
  sdkCliStateDirPath
10
- } from "./chunk-7QV545D7.mjs";
10
+ } from "./chunk-4PSSDZQB.mjs";
11
11
 
12
12
  // src/cli/search-ref.ts
13
13
  import { mkdirSync, readFileSync, writeFileSync } from "fs";
@@ -3,7 +3,7 @@ import {
3
3
  detectAgentRuntime,
4
4
  resolveCliCommandContext,
5
5
  resolveConfig
6
- } from "./chunk-7QV545D7.mjs";
6
+ } from "./chunk-4PSSDZQB.mjs";
7
7
  import {
8
8
  DeeplineError
9
9
  } from "./chunk-NXGCO4JB.mjs";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  npmSupportsAllowScripts,
3
3
  readNpmVersion
4
- } from "./chunk-7HYH533G.mjs";
4
+ } from "./chunk-FJ3DANI4.mjs";
5
5
  import {
6
6
  resolveShellSpawn,
7
7
  runSkillsCommand
8
- } from "./chunk-AOUGAM72.mjs";
8
+ } from "./chunk-UT3VLSLM.mjs";
9
9
  import {
10
10
  printCommandEnvelope
11
- } from "./chunk-35SCWK4Y.mjs";
11
+ } from "./chunk-5V56XCQN.mjs";
12
12
  import {
13
13
  autoDetectBaseUrl
14
- } from "./chunk-7QV545D7.mjs";
14
+ } from "./chunk-4PSSDZQB.mjs";
15
15
 
16
16
  // src/cli/commands/update.ts
17
17
  import { spawn, spawnSync } from "child_process";
@@ -2,7 +2,7 @@ import {
2
2
  argsWantJson,
3
3
  openInBrowser,
4
4
  printCommandEnvelope
5
- } from "./chunk-35SCWK4Y.mjs";
5
+ } from "./chunk-5V56XCQN.mjs";
6
6
  import {
7
7
  ACTIVE_ORG_ID_ENV,
8
8
  ACTIVE_ORG_NAME_ENV,
@@ -25,7 +25,7 @@ import {
25
25
  saveHostEnvValues,
26
26
  saveProjectDeeplineEnvValues,
27
27
  storedHostApiKey
28
- } from "./chunk-7QV545D7.mjs";
28
+ } from "./chunk-4PSSDZQB.mjs";
29
29
 
30
30
  // src/cli/commands/auth.ts
31
31
  import {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveShellSpawn
3
- } from "./chunk-AOUGAM72.mjs";
3
+ } from "./chunk-UT3VLSLM.mjs";
4
4
 
5
5
  // src/cli/npm-script-policy.ts
6
6
  import { spawnSync } from "child_process";
@@ -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 _chunkBBXO7APGjs = require('./chunk-BBXO7APG.js');
4
+ var _chunkMMNZ6GBTjs = require('./chunk-MMNZ6GBT.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 } = _chunkBBXO7APGjs.getAuthedHttpClient.call(void 0, );
423
+ const { http } = _chunkMMNZ6GBTjs.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
- _chunkBBXO7APGjs.printCommandEnvelope.call(void 0,
455
+ _chunkMMNZ6GBTjs.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
- _chunkBBXO7APGjs.printCommandEnvelope.call(void 0,
484
+ _chunkMMNZ6GBTjs.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
- _chunkBBXO7APGjs.printCommandEnvelope.call(void 0,
533
+ _chunkMMNZ6GBTjs.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
- _chunkBBXO7APGjs.printCommandEnvelope.call(void 0,
638
+ _chunkMMNZ6GBTjs.printCommandEnvelope.call(void 0,
639
639
  {
640
640
  ok: true,
641
641
  file: outputPath,
@@ -14,7 +14,7 @@ import {
14
14
  RETAINED_PIPELINE_RECEIVERS_HEADER,
15
15
  RUNTIME_ENVIRONMENT_TOKEN_HEADER,
16
16
  resolveConfig
17
- } from "./chunk-7QV545D7.mjs";
17
+ } from "./chunk-4PSSDZQB.mjs";
18
18
  import {
19
19
  PLAY_RUNTIME_BACKENDS,
20
20
  RAW_V2_TOOL_RESPONSE_CONTRACT,
@@ -172,6 +172,18 @@ function usesExtendedBetterContactLauncherBudget(toolId) {
172
172
  return BETTERCONTACT_LAUNCHER_TOOL_IDS.has(toolId.trim().toLowerCase());
173
173
  }
174
174
 
175
+ // src/cli-invocation-id.ts
176
+ var CLI_INVOCATION_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
177
+ function validateCliInvocationId(value) {
178
+ if (!CLI_INVOCATION_ID_PATTERN.test(value)) {
179
+ throw new DeeplineError(
180
+ "CLI invocation IDs must be UUID v4 values.",
181
+ void 0,
182
+ "CLI_INVOCATION_ID_INVALID"
183
+ );
184
+ }
185
+ }
186
+
175
187
  // src/tool-calls.ts
176
188
  var INCLUDE_TOOL_METADATA_HEADER = "x-deepline-include-tool-metadata";
177
189
  var EXECUTE_RESPONSE_CONTRACT_HEADER = "x-deepline-execute-response-contract";
@@ -305,6 +317,9 @@ var ToolCalls = class {
305
317
  this.configuredRequestTimeoutMs = configuredRequestTimeoutMs;
306
318
  }
307
319
  async call(toolId, input, options) {
320
+ if (options?.cliInvocationId !== void 0) {
321
+ validateCliInvocationId(options.cliInvocationId);
322
+ }
308
323
  const inputSnapshot = JSON.parse(JSON.stringify(input));
309
324
  const metadataSnapshot = options?.metadata ? JSON.parse(JSON.stringify(options.metadata)) : void 0;
310
325
  const idempotencyKey = options?.idempotencyKey ?? (options?.recover ? crypto.randomUUID() : void 0);
@@ -325,7 +340,11 @@ var ToolCalls = class {
325
340
  this.configuredRequestTimeoutMs
326
341
  );
327
342
  if (idempotencyKey !== void 0) {
328
- await this.lookupExecutionByKey(idempotencyKey, timeoutMs);
343
+ await this.lookupExecutionByKey(
344
+ idempotencyKey,
345
+ timeoutMs,
346
+ options?.cliInvocationId
347
+ );
329
348
  }
330
349
  const isApifySync = toolId.trim().toLowerCase() === "apify_run_actor_sync";
331
350
  const headers = {
@@ -337,7 +356,8 @@ var ToolCalls = class {
337
356
  ...options?.includeToolMetadata ? { [INCLUDE_TOOL_METADATA_HEADER]: "true" } : {},
338
357
  [EXECUTE_RESPONSE_INTENT_HEADER]: options?.responseIntent ?? "raw",
339
358
  ...idempotencyKey ? { "Idempotency-Key": idempotencyKey } : {},
340
- ...options?.searchRef ? { "x-deepline-search-ref": options.searchRef } : {}
359
+ ...options?.searchRef ? { "x-deepline-search-ref": options.searchRef } : {},
360
+ ...options?.cliInvocationId !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
341
361
  };
342
362
  const request = (requestTimeoutMs) => this.http.post(
343
363
  `/api/v2/integrations/${encodeURIComponent(toolId)}/execute`,
@@ -384,7 +404,8 @@ var ToolCalls = class {
384
404
  timeoutMs,
385
405
  this.defaultRequestTimeoutMs,
386
406
  remainingMs
387
- )
407
+ ),
408
+ options?.cliInvocationId
388
409
  );
389
410
  } catch (error) {
390
411
  if (!isRecoverableExecutionLookupError(error)) throw error;
@@ -464,7 +485,7 @@ var ToolCalls = class {
464
485
  }
465
486
  return result;
466
487
  }
467
- async lookupExecutionByKey(idempotencyKey, timeoutMs) {
488
+ async lookupExecutionByKey(idempotencyKey, timeoutMs, cliInvocationId) {
468
489
  validateExecutionIdempotencyKey(idempotencyKey);
469
490
  let supported = false;
470
491
  const result = await this.http.get(
@@ -475,6 +496,7 @@ var ToolCalls = class {
475
496
  timeout: timeoutMs,
476
497
  idempotencyKey,
477
498
  allowNotFound: true,
499
+ ...cliInvocationId !== void 0 ? { headers: { "x-deepline-cli-invocation-id": cliInvocationId } } : {},
478
500
  onResponse: (response) => {
479
501
  supported = response.headers.get("X-Deepline-Idempotency-Supported") === "true";
480
502
  }
@@ -2870,7 +2892,10 @@ var DeeplineClient = class _DeeplineClient {
2870
2892
  * console.log(`Input schema:`, meta.inputSchema);
2871
2893
  * ```
2872
2894
  */
2873
- async getTool(toolId) {
2895
+ async getTool(toolId, options) {
2896
+ if (options?.cliInvocationId !== void 0) {
2897
+ validateCliInvocationId(options.cliInvocationId);
2898
+ }
2874
2899
  return this.http.request(
2875
2900
  `/api/v2/integrations/${encodeURIComponent(toolId)}/get`,
2876
2901
  {
@@ -2880,7 +2905,8 @@ var DeeplineClient = class _DeeplineClient {
2880
2905
  // other GET catalog methods such as searchTools().
2881
2906
  retryApiErrors: true,
2882
2907
  headers: {
2883
- "x-deepline-tool-meta-only": "1"
2908
+ "x-deepline-tool-meta-only": "1",
2909
+ ...options?.cliInvocationId !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
2884
2910
  }
2885
2911
  }
2886
2912
  );
@@ -4456,6 +4482,9 @@ var DeeplineClient = class _DeeplineClient {
4456
4482
  * contracts and stable run behavior.
4457
4483
  */
4458
4484
  async searchPlays(options) {
4485
+ if (options.cliInvocationId !== void 0) {
4486
+ validateCliInvocationId(options.cliInvocationId);
4487
+ }
4459
4488
  const params = new URLSearchParams();
4460
4489
  params.set("search", options.query.trim());
4461
4490
  const scope = options.scope ?? "prebuilt";
@@ -4463,7 +4492,14 @@ var DeeplineClient = class _DeeplineClient {
4463
4492
  params.set("origin", scope);
4464
4493
  }
4465
4494
  const response = await this.http.get(
4466
- `/api/v2/plays?${params.toString()}`
4495
+ `/api/v2/plays?${params.toString()}`,
4496
+ {
4497
+ ...options.cliInvocationId !== void 0 ? {
4498
+ headers: {
4499
+ "x-deepline-cli-invocation-id": options.cliInvocationId
4500
+ }
4501
+ } : {}
4502
+ }
4467
4503
  );
4468
4504
  const plays = (response.plays ?? []).map(
4469
4505
  (play) => this.summarizePlayListItem(play, options)
@@ -4,7 +4,7 @@
4
4
  var _chunkXNYIZMNQjs = require('./chunk-XNYIZMNQ.js');
5
5
 
6
6
 
7
- var _chunkZQSQCHG3js = require('./chunk-ZQSQCHG3.js');
7
+ var _chunkOZIFVQRYjs = require('./chunk-OZIFVQRY.js');
8
8
 
9
9
 
10
10
 
@@ -721,9 +721,9 @@ function resolveCliCommandContext(inputConfig, requestedScope) {
721
721
  }
722
722
 
723
723
  // src/version.ts
724
- var SDK_VERSION = _chunkZQSQCHG3js.SDK_RELEASE.version;
725
- var SDK_API_MAJOR = _chunkZQSQCHG3js.SDK_RELEASE.contracts.api.currentMajor;
726
- var SDK_API_CONTRACT = _nullishCoalesce(_chunkZQSQCHG3js.SDK_RELEASE.contracts.api.legacyWireIds[0], () => ( `api-v${SDK_API_MAJOR}`));
724
+ var SDK_VERSION = _chunkOZIFVQRYjs.SDK_RELEASE.version;
725
+ var SDK_API_MAJOR = _chunkOZIFVQRYjs.SDK_RELEASE.contracts.api.currentMajor;
726
+ var SDK_API_CONTRACT = _nullishCoalesce(_chunkOZIFVQRYjs.SDK_RELEASE.contracts.api.legacyWireIds[0], () => ( `api-v${SDK_API_MAJOR}`));
727
727
 
728
728
  // src/agent-runtime.ts
729
729
 
@@ -1221,6 +1221,7 @@ var MAX_DIAGNOSTIC_HEADER_LENGTH = 120;
1221
1221
  var COWORK_NETWORK_HINT = "Claude Cowork appears to be running Deepline in a network-restricted sandbox. In Claude Desktop, open Settings > Capabilities, turn on Allow network egress, and set Domain allowlist to All domains for the Cowork session.";
1222
1222
  var REQUEST_TIMEOUT_MARKER = Symbol("deeplineRequestTimeout");
1223
1223
  var REQUEST_ABORT_MARKER = Symbol("deeplineRequestAbort");
1224
+ var MAX_AUTOMATIC_RETRY_WAIT_MS = 3e4;
1224
1225
  function requestCancelledError(signal) {
1225
1226
  const error = withErrorCause(new Error("Request aborted"), signal.reason);
1226
1227
  error[REQUEST_ABORT_MARKER] = true;
@@ -1424,6 +1425,7 @@ var HttpClient = class {
1424
1425
  let lastError = null;
1425
1426
  const candidateUrls = _optionalChain([options, 'optionalAccess', _211 => _211.exactUrlOnly]) ? [url] : buildCandidateUrls(url);
1426
1427
  let retryAfterDelayMs = null;
1428
+ let totalRetryWaitMs = 0;
1427
1429
  const maxRetries = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _212 => _212.maxRetries]), () => ( this.config.maxRetries));
1428
1430
  requestAttempts: for (let attempt = 0; attempt <= maxRetries; attempt++) {
1429
1431
  if (_optionalChain([options, 'optionalAccess', _213 => _213.signal, 'optionalAccess', _214 => _214.aborted])) {
@@ -1435,6 +1437,10 @@ var HttpClient = class {
1435
1437
  const backoffMs = Math.min(1e3 * Math.pow(2, attempt - 1), 3e4);
1436
1438
  const delayMs = retryAfterDelayMs === null ? backoffMs : Math.max(backoffMs, retryAfterDelayMs);
1437
1439
  retryAfterDelayMs = null;
1440
+ if (totalRetryWaitMs + delayMs > MAX_AUTOMATIC_RETRY_WAIT_MS) {
1441
+ break requestAttempts;
1442
+ }
1443
+ totalRetryWaitMs += delayMs;
1438
1444
  networkPhase = "retry_wait";
1439
1445
  try {
1440
1446
  await sleep(delayMs, _optionalChain([options, 'optionalAccess', _215 => _215.signal]));
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkDOCDA2YPjs = require('./chunk-DOCDA2YP.js');
6
+ var _chunkM6HCRRV2js = require('./chunk-M6HCRRV2.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 = _chunkDOCDA2YPjs.resolveConfig.call(void 0, );
140
- return { config, http: new (0, _chunkDOCDA2YPjs.HttpClient)(config) };
139
+ const config = _chunkM6HCRRV2js.resolveConfig.call(void 0, );
140
+ return { config, http: new (0, _chunkM6HCRRV2js.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: _chunkDOCDA2YPjs.detectAgentRuntime.call(void 0, )
480
+ agent_runtime: _chunkM6HCRRV2js.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 _chunkDOCDA2YPjs.detectAgentRuntime.call(void 0, ) !== "unknown" && valueRecord && !Object.prototype.hasOwnProperty.call(valueRecord, "command_context") ? {
728
+ return _chunkM6HCRRV2js.detectAgentRuntime.call(void 0, ) !== "unknown" && valueRecord && !Object.prototype.hasOwnProperty.call(valueRecord, "command_context") ? {
729
729
  ...valueRecord,
730
- command_context: _chunkDOCDA2YPjs.resolveCliCommandContext.call(void 0, )
730
+ command_context: _chunkM6HCRRV2js.resolveCliCommandContext.call(void 0, )
731
731
  } : value;
732
732
  }
733
733
  function printJson(value, fields) {
@@ -1,17 +1,17 @@
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 _chunkNC4JXVVSjs = require('./chunk-NC4JXVVS.js');
4
+ var _chunk2KR56MPFjs = require('./chunk-2KR56MPF.js');
5
5
 
6
6
 
7
7
 
8
- var _chunkDNBJRKVEjs = require('./chunk-DNBJRKVE.js');
8
+ var _chunkRODIZCGUjs = require('./chunk-RODIZCGU.js');
9
9
 
10
10
 
11
- var _chunkBBXO7APGjs = require('./chunk-BBXO7APG.js');
11
+ var _chunkMMNZ6GBTjs = require('./chunk-MMNZ6GBT.js');
12
12
 
13
13
 
14
- var _chunkDOCDA2YPjs = require('./chunk-DOCDA2YP.js');
14
+ var _chunkM6HCRRV2js = require('./chunk-M6HCRRV2.js');
15
15
 
16
16
  // src/cli/commands/update.ts
17
17
  var _child_process = require('child_process');
@@ -504,7 +504,7 @@ function normalizedNpmPrefix(value) {
504
504
  }
505
505
  function resolveNpmGlobalPrefix(env) {
506
506
  try {
507
- const plan = _chunkDNBJRKVEjs.resolveShellSpawn.call(void 0, "npm", ["prefix", "-g"]);
507
+ const plan = _chunkRODIZCGUjs.resolveShellSpawn.call(void 0, "npm", ["prefix", "-g"]);
508
508
  const result = _child_process.spawnSync.call(void 0, plan.command, plan.args, {
509
509
  encoding: "utf8",
510
510
  env,
@@ -560,8 +560,8 @@ function resolveUpdatePlan(options = {}) {
560
560
  const npmGlobalPrefix = options.npmGlobalPrefix !== void 0 ? options.npmGlobalPrefix : resolveNpmGlobalPrefix(env);
561
561
  const hasVerifiedNpmOwnership = inferredInstallPrefix !== null && normalizedNpmPrefix(inferredInstallPrefix) === normalizedNpmPrefix(npmGlobalPrefix);
562
562
  const installPrefix = options.requireVerifiedNpmOwnership ? hasVerifiedNpmOwnership ? inferredInstallPrefix : null : inferredInstallPrefix;
563
- const npmVersion = options.npmVersion === void 0 ? _chunkNC4JXVVSjs.readNpmVersion.call(void 0, env) : options.npmVersion;
564
- const npmGlobalInstallFlags = _chunkNC4JXVVSjs.npmSupportsAllowScripts.call(void 0, npmVersion) ? [...NPM_SDK_INSTALL_COMMON_FLAGS, "--allow-scripts=esbuild"] : NPM_SDK_INSTALL_COMMON_FLAGS;
563
+ const npmVersion = options.npmVersion === void 0 ? _chunk2KR56MPFjs.readNpmVersion.call(void 0, env) : options.npmVersion;
564
+ const npmGlobalInstallFlags = _chunk2KR56MPFjs.npmSupportsAllowScripts.call(void 0, npmVersion) ? [...NPM_SDK_INSTALL_COMMON_FLAGS, "--allow-scripts=esbuild"] : NPM_SDK_INSTALL_COMMON_FLAGS;
565
565
  const args = installPrefix ? [
566
566
  "install",
567
567
  "-g",
@@ -571,7 +571,7 @@ function resolveUpdatePlan(options = {}) {
571
571
  packageSpec
572
572
  ] : ["install", "-g", ...npmGlobalInstallFlags, packageSpec];
573
573
  const fallbackRegistryUrl = options.npmFallbackRegistryUrl !== void 0 ? options.npmFallbackRegistryUrl : publicNpmFallbackRegistryUrl(
574
- _optionalChain([env, 'access', _18 => _18.DEEPLINE_HOST_URL, 'optionalAccess', _19 => _19.trim, 'call', _20 => _20()]) || _chunkDOCDA2YPjs.autoDetectBaseUrl.call(void 0, )
574
+ _optionalChain([env, 'access', _18 => _18.DEEPLINE_HOST_URL, 'optionalAccess', _19 => _19.trim, 'call', _20 => _20()]) || _chunkM6HCRRV2js.autoDetectBaseUrl.call(void 0, )
575
575
  );
576
576
  return {
577
577
  kind: "npm-global",
@@ -718,7 +718,7 @@ function sidecarInstallFailure(versionDir) {
718
718
  function runCommand(command, args, env = process.env) {
719
719
  return new Promise((resolveResult) => {
720
720
  let output = "";
721
- const plan = _chunkDNBJRKVEjs.resolveShellSpawn.call(void 0, command, args);
721
+ const plan = _chunkRODIZCGUjs.resolveShellSpawn.call(void 0, command, args);
722
722
  const child = _child_process.spawn.call(void 0, plan.command, plan.args, {
723
723
  stdio: ["inherit", "pipe", "pipe"],
724
724
  shell: plan.shell,
@@ -1094,14 +1094,14 @@ async function publishedVersionSupportsPin(version, fallbackRegistryUrl) {
1094
1094
  throw _nullishCoalesce(lastError, () => ( new Error("No npm registry was available")));
1095
1095
  }
1096
1096
  async function runUpdateCommand(options, dependencies = {}) {
1097
- const detectBaseUrl = _nullishCoalesce(dependencies.detectBaseUrl, () => ( _chunkDOCDA2YPjs.autoDetectBaseUrl));
1097
+ const detectBaseUrl = _nullishCoalesce(dependencies.detectBaseUrl, () => ( _chunkM6HCRRV2js.autoDetectBaseUrl));
1098
1098
  const resolvePlan = _nullishCoalesce(dependencies.resolvePlan, () => ( resolveUpdatePlan));
1099
1099
  const runPlan = _nullishCoalesce(dependencies.runPlan, () => ( runUpdatePlan));
1100
1100
  const syncSkills = _nullishCoalesce(dependencies.syncSkillsIfNeeded, () => ( (async () => {
1101
1101
  const originalWrite = process.stdout.write.bind(process.stdout);
1102
1102
  process.stdout.write = (() => true);
1103
1103
  try {
1104
- const exitCode = await _chunkDNBJRKVEjs.runSkillsCommand.call(void 0, { json: true });
1104
+ const exitCode = await _chunkRODIZCGUjs.runSkillsCommand.call(void 0, { json: true });
1105
1105
  if (exitCode !== 0) {
1106
1106
  throw new Error(
1107
1107
  `Deepline skills update failed with exit ${exitCode}.`
@@ -1172,11 +1172,11 @@ async function runUpdateCommand(options, dependencies = {}) {
1172
1172
  ]
1173
1173
  };
1174
1174
  if (options.json && !options.executeWithJson) {
1175
- _chunkBBXO7APGjs.printCommandEnvelope.call(void 0, { ...plan, render }, { json: true });
1175
+ _chunkMMNZ6GBTjs.printCommandEnvelope.call(void 0, { ...plan, render }, { json: true });
1176
1176
  return 0;
1177
1177
  }
1178
1178
  if (options.printCommand) {
1179
- _chunkBBXO7APGjs.printCommandEnvelope.call(void 0,
1179
+ _chunkMMNZ6GBTjs.printCommandEnvelope.call(void 0,
1180
1180
  {
1181
1181
  ...plan,
1182
1182
  render: {
@@ -1189,7 +1189,7 @@ async function runUpdateCommand(options, dependencies = {}) {
1189
1189
  return 0;
1190
1190
  }
1191
1191
  if (plan.kind === "source" || plan.kind === "homebrew") {
1192
- _chunkBBXO7APGjs.printCommandEnvelope.call(void 0, { ...plan, render }, { json: false });
1192
+ _chunkMMNZ6GBTjs.printCommandEnvelope.call(void 0, { ...plan, render }, { json: false });
1193
1193
  return 0;
1194
1194
  }
1195
1195
  stderr.write(`Updating Deepline SDK/CLI with: ${plan.manualCommand}
@@ -1219,7 +1219,7 @@ To retry with full installer output, run: deepline skills --json
1219
1219
  );
1220
1220
  }
1221
1221
  if (options.executeWithJson && options.json) {
1222
- _chunkBBXO7APGjs.printCommandEnvelope.call(void 0,
1222
+ _chunkMMNZ6GBTjs.printCommandEnvelope.call(void 0,
1223
1223
  {
1224
1224
  ok: true,
1225
1225
  pinnedVersion
@@ -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.304",
52
+ version: "0.3.306",
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