deepline 0.3.396 → 0.3.397

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  2. package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +2 -2
  3. package/dist/cli/{auth-3LTD62VL.mjs → auth-AZJFXGKP.mjs} +5 -4
  4. package/dist/cli/auth-CZJQU7B5.js +40 -0
  5. package/dist/cli/{billing-PA5OXEM5.js → billing-MQV5AGDJ.js} +76 -75
  6. package/dist/cli/{billing-DP7ZAJBO.mjs → billing-MZAAUHGH.mjs} +5 -4
  7. package/dist/cli/{chunk-VE3U3SQC.mjs → chunk-2LDADJNO.mjs} +7 -107
  8. package/dist/cli/{chunk-772W2SAU.js → chunk-3VP34TAU.js} +8 -8
  9. package/dist/cli/{chunk-QHGPA362.mjs → chunk-4D745XZO.mjs} +6 -108
  10. package/dist/cli/chunk-7DRPTGCK.js +930 -0
  11. package/dist/cli/{chunk-NSOTASOP.js → chunk-BQR6UN3C.js} +1 -83
  12. package/dist/cli/{chunk-RTO5QZWT.js → chunk-DQ65ZVHN.js} +6 -6
  13. package/dist/cli/{chunk-3T4MCB5R.mjs → chunk-F3BUFYKE.mjs} +89 -969
  14. package/dist/cli/chunk-FIVKWNMT.mjs +210 -0
  15. package/dist/cli/{describe-6O2ENKTP.mjs → chunk-HFYQBC2D.mjs} +22 -160
  16. package/dist/cli/chunk-HGFFYVXN.js +210 -0
  17. package/dist/cli/{chunk-5WNJF2T3.mjs → chunk-IHG7UAHD.mjs} +1 -83
  18. package/dist/cli/{chunk-GNN4MY5X.js → chunk-IZ74ABSX.js} +1 -1
  19. package/dist/cli/{chunk-MR6XCBQJ.mjs → chunk-J7ABTQQ7.mjs} +4 -2
  20. package/dist/cli/{chunk-2VOLOWYZ.js → chunk-K33MXVXQ.js} +293 -1173
  21. package/dist/cli/chunk-LJ5747UC.mjs +107 -0
  22. package/dist/cli/{chunk-NHB5YUCS.mjs → chunk-MRXMMERY.mjs} +1 -1
  23. package/dist/cli/{chunk-TLQ3FZOC.mjs → chunk-MV7QRALK.mjs} +3 -3
  24. package/dist/cli/{chunk-AUYXWELC.mjs → chunk-MYPH2LUU.mjs} +2 -2
  25. package/dist/cli/{chunk-LWERJUKN.js → chunk-NA4T3B62.js} +7 -215
  26. package/dist/cli/{chunk-23GAA3YO.mjs → chunk-NOX2TCBP.mjs} +1 -1
  27. package/dist/cli/chunk-OSDXE27V.mjs +88 -0
  28. package/dist/cli/{chunk-KAEZNPUM.js → chunk-PSGEDGLT.js} +13 -115
  29. package/dist/cli/chunk-Q2E4E4FJ.js +112 -0
  30. package/dist/cli/{describe-EFWNECHI.js → chunk-RFG3MRAC.js} +37 -175
  31. package/dist/cli/{chunk-XKZXO7D3.mjs → chunk-RNSWDKBM.mjs} +1 -1
  32. package/dist/cli/{chunk-V7UP2F4U.js → chunk-RYW4HPSM.js} +21 -121
  33. package/dist/cli/{chunk-7Z66NHUC.js → chunk-SO7RUVTY.js} +26 -26
  34. package/dist/cli/{chunk-H5KLUGY7.mjs → chunk-TXZVVBQZ.mjs} +1 -209
  35. package/dist/cli/{chunk-WQJJNIMQ.js → chunk-UVXBVUZQ.js} +11 -9
  36. package/dist/cli/{chunk-AVHLATII.js → chunk-VTF4RRWJ.js} +50 -50
  37. package/dist/cli/{chunk-LOGGNW4H.mjs → chunk-W3HMGKMI.mjs} +2 -2
  38. package/dist/cli/{chunk-JCN4DHF7.mjs → chunk-WM2QEHZL.mjs} +2 -2
  39. package/dist/cli/chunk-YHPYUZZX.mjs +112 -0
  40. package/dist/cli/chunk-YHZUZO3U.mjs +930 -0
  41. package/dist/cli/{chunk-ME6XRFLY.js → chunk-YLRME7MK.js} +15 -15
  42. package/dist/cli/{chunk-DC6LTULT.js → chunk-YSVORIEW.js} +2 -2
  43. package/dist/cli/{chunk-I4T4XAA2.mjs → chunk-YUDKBQUD.mjs} +4 -4
  44. package/dist/cli/chunk-ZAAKSJAS.js +88 -0
  45. package/dist/cli/{chunk-RMTASUAK.js → chunk-ZHUMDMOS.js} +65 -65
  46. package/dist/cli/chunk-ZM2YPJQJ.js +107 -0
  47. package/dist/cli/{csv-TF576S77.js → csv-AQBQ5O3I.js} +13 -12
  48. package/dist/cli/{csv-RLRR74RQ.mjs → csv-MB7PJMYQ.mjs} +4 -3
  49. package/dist/cli/{db-FDBJUTFO.js → db-JPUYC5RB.js} +30 -29
  50. package/dist/cli/{db-XORGNBIC.mjs → db-L5IEI2AU.mjs} +5 -4
  51. package/dist/cli/describe-6WT74AOR.js +164 -0
  52. package/dist/cli/describe-S6BFANVI.mjs +164 -0
  53. package/dist/cli/describe-core.d.mts +100 -0
  54. package/dist/cli/describe-core.d.ts +100 -0
  55. package/dist/cli/describe-core.js +18 -0
  56. package/dist/cli/describe-core.mjs +18 -0
  57. package/dist/cli/{executions-SFYAXPF4.js → executions-6TMQTFP4.js} +7 -6
  58. package/dist/cli/{executions-YPP7WR77.mjs → executions-L7I2ZW4Z.mjs} +5 -4
  59. package/dist/cli/{feedback-RBGA5ARU.mjs → feedback-DSJ63HK6.mjs} +4 -3
  60. package/dist/cli/{feedback-5UZFYMGB.js → feedback-XF7CQGMD.js} +8 -7
  61. package/dist/cli/{git-IRSAJEK2.mjs → git-C3ENM67D.mjs} +5 -4
  62. package/dist/cli/git-HYDZK2QR.js +24 -0
  63. package/dist/cli/index.js +93 -91
  64. package/dist/cli/index.mjs +35 -33
  65. package/dist/cli/{legacy-noops-CVAOQY2F.js → legacy-noops-B2NHWIVD.js} +8 -7
  66. package/dist/cli/{legacy-noops-NA7N6ZOU.mjs → legacy-noops-VFG2K6HK.mjs} +5 -4
  67. package/dist/cli/{monitors-4OMRXCXP.js → monitors-ORFWOVZB.js} +86 -85
  68. package/dist/cli/{monitors-ILZ2XHYG.mjs → monitors-TCEDBDGY.mjs} +5 -4
  69. package/dist/cli/{org-QDDXAE3J.mjs → org-45KREIKZ.mjs} +5 -4
  70. package/dist/cli/{org-YGNJDD2X.js → org-T74CJESN.js} +65 -64
  71. package/dist/cli/{play-VT6OHB2D.mjs → play-MU7MYBIM.mjs} +19 -15
  72. package/dist/cli/{play-L535H26U.js → play-XHK2LPON.js} +251 -247
  73. package/dist/cli/{providers-GPZ6PQAL.js → providers-4MGQKYFD.js} +8 -7
  74. package/dist/cli/{providers-KG4W5MPK.mjs → providers-VYCXIJT5.mjs} +5 -4
  75. package/dist/cli/{quickstart-UI27S5LO.js → quickstart-47G3VEOT.js} +6 -5
  76. package/dist/cli/{quickstart-2JDGTXIG.mjs → quickstart-H724EFM2.mjs} +4 -3
  77. package/dist/cli/search-3356ENLD.js +30 -0
  78. package/dist/cli/{search-PW3RAUX7.mjs → search-VQHXEFQ4.mjs} +7 -5
  79. package/dist/cli/{secrets-WFAXOUZE.js → secrets-ALLKCU35.js} +14 -13
  80. package/dist/cli/{secrets-HNOMK5A2.mjs → secrets-CPBNGA44.mjs} +5 -4
  81. package/dist/cli/{sessions-XLX3E5UO.mjs → sessions-7RSQB7IX.mjs} +5 -4
  82. package/dist/cli/sessions-FKGAY7WQ.js +16 -0
  83. package/dist/cli/{settings-YNZ4YKCH.mjs → settings-UYSGV4IC.mjs} +8 -7
  84. package/dist/cli/{settings-GADAG2UK.js → settings-Y5BI42P7.js} +75 -74
  85. package/dist/cli/{setup-PSEHIUXO.mjs → setup-L3ZBBTS4.mjs} +7 -6
  86. package/dist/cli/{setup-R5YO7GT6.js → setup-VXQPEU3E.js} +42 -41
  87. package/dist/cli/skills-DUZQTDTE.js +29 -0
  88. package/dist/cli/{skills-LTQBP6CZ.mjs → skills-QHVDLSFE.mjs} +5 -4
  89. package/dist/cli/{tools-UAXDWU63.mjs → tools-LSCEK4K2.mjs} +13 -8
  90. package/dist/cli/tools-YWU5QOQ5.js +39 -0
  91. package/dist/cli/update-5LYQAI55.js +29 -0
  92. package/dist/cli/{update-SMNIBIMS.mjs → update-CU22OTBM.mjs} +7 -6
  93. package/dist/cli/{workflow-AOQVZHMD.js → workflow-ERFLTRNX.js} +16 -15
  94. package/dist/cli/{workflow-IKGMBGF6.mjs → workflow-KQARK5BZ.mjs} +6 -5
  95. package/dist/{client-DiGl8ska.d.mts → client-D0j-_aaa.d.mts} +1 -1
  96. package/dist/{client-Bgis7F6-.d.ts → client-DflfVyj6.d.ts} +1 -1
  97. package/dist/index.d.mts +2 -2
  98. package/dist/index.d.ts +2 -2
  99. package/dist/index.js +14 -10
  100. package/dist/index.mjs +19 -15
  101. package/dist/install-integrity.json +92 -76
  102. package/dist/plays/play-description.d.mts +1 -1
  103. package/dist/plays/play-description.d.ts +1 -1
  104. package/dist/plays/run-request.d.mts +1 -1
  105. package/dist/plays/run-request.d.ts +1 -1
  106. package/dist/release.d.mts +1 -1
  107. package/dist/release.d.ts +1 -1
  108. package/dist/release.js +2 -2
  109. package/dist/release.mjs +1 -1
  110. package/package.json +6 -1
  111. package/dist/cli/auth-562JPKOM.js +0 -39
  112. package/dist/cli/git-5LDY5ZID.js +0 -23
  113. package/dist/cli/search-MGWROZ33.js +0 -28
  114. package/dist/cli/sessions-366KROUA.js +0 -15
  115. package/dist/cli/skills-JF2LPEGM.js +0 -28
  116. package/dist/cli/tools-CP2PEFRN.js +0 -34
  117. package/dist/cli/update-HZHZOU6C.js +0 -28
@@ -24,8 +24,10 @@ var _chunkKXMNM4AQjs = require('./chunk-KXMNM4AQ.js');
24
24
 
25
25
 
26
26
 
27
+ var _chunkRYW4HPSMjs = require('./chunk-RYW4HPSM.js');
27
28
 
28
- var _chunkV7UP2F4Ujs = require('./chunk-V7UP2F4U.js');
29
+
30
+ var _chunkQ2E4E4FJjs = require('./chunk-Q2E4E4FJ.js');
29
31
 
30
32
 
31
33
 
@@ -138,7 +140,7 @@ async function queryCustomerDatabase(http, input) {
138
140
  if (error instanceof _chunk7P5AA3SNjs.DeeplineError && (_optionalChain([error, 'access', _ => _.code, 'optionalAccess', _2 => _2.startsWith, 'call', _3 => _3("NETWORK_")]) || // Older API readers return PostgreSQL errors as HTTP 400, including
139
141
  // lost connections and explicitly unknown transaction resolution.
140
142
  /^08[A-Z0-9]{3}$/.test(_nullishCoalesce(error.code, () => ( ""))) || ["57P01", "57P02", "57P03"].includes(_nullishCoalesce(error.code, () => ( ""))) || error.statusCode === 408 || (_nullishCoalesce(error.statusCode, () => ( 0))) >= 500)) {
141
- throw new (0, _chunkV7UP2F4Ujs.CustomerDbQueryOutcomeUnknownError)(
143
+ throw new (0, _chunkQ2E4E4FJjs.CustomerDbQueryOutcomeUnknownError)(
142
144
  error,
143
145
  plan.request.body.operation_key
144
146
  );
@@ -146,7 +148,7 @@ async function queryCustomerDatabase(http, input) {
146
148
  throw error;
147
149
  }
148
150
  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) {
149
- throw new (0, _chunkV7UP2F4Ujs.CustomerDbQueryOutcomeUnknownError)(
151
+ throw new (0, _chunkQ2E4E4FJjs.CustomerDbQueryOutcomeUnknownError)(
150
152
  new (0, _chunk7P5AA3SNjs.DeeplineError)(
151
153
  "The SQL response did not contain a valid result.",
152
154
  200,
@@ -157,7 +159,7 @@ async function queryCustomerDatabase(http, input) {
157
159
  }
158
160
  const operation = result.operation;
159
161
  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))) {
160
- throw new (0, _chunkV7UP2F4Ujs.CustomerDbQueryOutcomeUnknownError)(
162
+ throw new (0, _chunkQ2E4E4FJjs.CustomerDbQueryOutcomeUnknownError)(
161
163
  new (0, _chunk7P5AA3SNjs.DeeplineError)(
162
164
  "The server did not confirm the original atomic SQL operation.",
163
165
  200,
@@ -2887,8 +2889,8 @@ function runtimeSelectionHeaders(runtime, env) {
2887
2889
  }
2888
2890
  const receivers = _optionalChain([env, 'access', _97 => _97.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _98 => _98.trim, 'call', _99 => _99()]);
2889
2891
  return {
2890
- [_chunkV7UP2F4Ujs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
2891
- ...receivers ? { [_chunkV7UP2F4Ujs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
2892
+ [_chunkRYW4HPSMjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
2893
+ ...receivers ? { [_chunkRYW4HPSMjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
2892
2894
  };
2893
2895
  }
2894
2896
  function isolatedCiRuntimeEventReadHeaders(env) {
@@ -2904,7 +2906,7 @@ function isolatedCiRuntimeEventReadHeaders(env) {
2904
2906
  "RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
2905
2907
  );
2906
2908
  }
2907
- return { [_chunkV7UP2F4Ujs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
2909
+ return { [_chunkRYW4HPSMjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
2908
2910
  }
2909
2911
  function normalizeTestPolicyOverrides(value, source) {
2910
2912
  if (value && typeof value === "object" && !Array.isArray(value)) {
@@ -3195,9 +3197,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
3195
3197
  * @throws {@link ConfigError} if no API key can be resolved from any source.
3196
3198
  */
3197
3199
  constructor(options) {
3198
- this.config = _chunkV7UP2F4Ujs.resolveConfig.call(void 0, options);
3200
+ this.config = _chunkRYW4HPSMjs.resolveConfig.call(void 0, options);
3199
3201
  this.environment = _nullishCoalesce(this.config.environment, () => ( process.env));
3200
- this.http = new (0, _chunkV7UP2F4Ujs.HttpClient)(this.config);
3202
+ this.http = new (0, _chunkRYW4HPSMjs.HttpClient)(this.config);
3201
3203
  this.toolCalls = new ToolCalls(
3202
3204
  this.http,
3203
3205
  this.config.timeout,
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkRTO5QZWTjs = require('./chunk-RTO5QZWT.js');
5
+ var _chunkDQ65ZVHNjs = require('./chunk-DQ65ZVHN.js');
6
6
 
7
7
 
8
8
 
@@ -25,7 +25,7 @@ var _chunkRTO5QZWTjs = require('./chunk-RTO5QZWT.js');
25
25
 
26
26
 
27
27
 
28
- var _chunkV7UP2F4Ujs = require('./chunk-V7UP2F4U.js');
28
+ var _chunkRYW4HPSMjs = require('./chunk-RYW4HPSM.js');
29
29
 
30
30
  // src/cli/commands/auth.ts
31
31
 
@@ -52,7 +52,7 @@ function statusBannerLine(value) {
52
52
  return `Service notice: ${banner.message}`;
53
53
  }
54
54
  function envFilePath(baseUrl) {
55
- return _chunkV7UP2F4Ujs.hostEnvFilePath.call(void 0, baseUrl);
55
+ return _chunkRYW4HPSMjs.hostEnvFilePath.call(void 0, baseUrl);
56
56
  }
57
57
  function normalizeAuthScope(value) {
58
58
  if (!value || value === "global") return "global";
@@ -65,7 +65,7 @@ function parseAuthScope(args) {
65
65
  }
66
66
  function pendingClaimPath(baseUrl, scope) {
67
67
  if (scope === "folder") {
68
- const target = _chunkV7UP2F4Ujs.resolveProjectPinTarget.call(void 0, );
68
+ const target = _chunkRYW4HPSMjs.resolveProjectPinTarget.call(void 0, );
69
69
  if (!target.ok) {
70
70
  throw new Error(
71
71
  `Cowork project folder is ambiguous. Candidate folders: ${target.candidates.join(
@@ -75,10 +75,10 @@ function pendingClaimPath(baseUrl, scope) {
75
75
  }
76
76
  return _path.join.call(void 0, target.dir, ".deepline", "setup", "pending-auth.json");
77
77
  }
78
- return `${_chunkV7UP2F4Ujs.hostConfigDirPath.call(void 0, baseUrl)}/pending-auth.json`;
78
+ return `${_chunkRYW4HPSMjs.hostConfigDirPath.call(void 0, baseUrl)}/pending-auth.json`;
79
79
  }
80
80
  function legacyPendingClaimTokenPath(baseUrl) {
81
- return `${_chunkV7UP2F4Ujs.hostConfigDirPath.call(void 0, baseUrl)}/pending-claim-token`;
81
+ return `${_chunkRYW4HPSMjs.hostConfigDirPath.call(void 0, baseUrl)}/pending-claim-token`;
82
82
  }
83
83
  function savePendingClaim(baseUrl, claim) {
84
84
  const filePath = pendingClaimPath(baseUrl, claim.scope);
@@ -180,21 +180,21 @@ function parseRegisterWaitMode(args) {
180
180
  function shouldWaitForRegisterClaim(mode) {
181
181
  if (mode === "yes") return true;
182
182
  if (mode === "no") return false;
183
- return _chunkV7UP2F4Ujs.detectAgentRuntime.call(void 0, ) !== "claude_cowork";
183
+ return _chunkRYW4HPSMjs.detectAgentRuntime.call(void 0, ) !== "claude_cowork";
184
184
  }
185
185
  function saveEnvValues(values, baseUrl, scope) {
186
186
  const filtered = {
187
- ...values[_chunkV7UP2F4Ujs.HOST_URL_ENV] ? { [_chunkV7UP2F4Ujs.HOST_URL_ENV]: values[_chunkV7UP2F4Ujs.HOST_URL_ENV] } : {},
188
- ...values[_chunkV7UP2F4Ujs.API_KEY_ENV] ? { [_chunkV7UP2F4Ujs.API_KEY_ENV]: values[_chunkV7UP2F4Ujs.API_KEY_ENV] } : {},
189
- ...values[_chunkV7UP2F4Ujs.ACTIVE_ORG_ID_ENV] ? { [_chunkV7UP2F4Ujs.ACTIVE_ORG_ID_ENV]: values[_chunkV7UP2F4Ujs.ACTIVE_ORG_ID_ENV] } : {},
190
- ...Object.prototype.hasOwnProperty.call(values, _chunkV7UP2F4Ujs.ACTIVE_ORG_NAME_ENV) ? { [_chunkV7UP2F4Ujs.ACTIVE_ORG_NAME_ENV]: values[_chunkV7UP2F4Ujs.ACTIVE_ORG_NAME_ENV] } : {},
187
+ ...values[_chunkRYW4HPSMjs.HOST_URL_ENV] ? { [_chunkRYW4HPSMjs.HOST_URL_ENV]: values[_chunkRYW4HPSMjs.HOST_URL_ENV] } : {},
188
+ ...values[_chunkRYW4HPSMjs.API_KEY_ENV] ? { [_chunkRYW4HPSMjs.API_KEY_ENV]: values[_chunkRYW4HPSMjs.API_KEY_ENV] } : {},
189
+ ...values[_chunkRYW4HPSMjs.ACTIVE_ORG_ID_ENV] ? { [_chunkRYW4HPSMjs.ACTIVE_ORG_ID_ENV]: values[_chunkRYW4HPSMjs.ACTIVE_ORG_ID_ENV] } : {},
190
+ ...Object.prototype.hasOwnProperty.call(values, _chunkRYW4HPSMjs.ACTIVE_ORG_NAME_ENV) ? { [_chunkRYW4HPSMjs.ACTIVE_ORG_NAME_ENV]: values[_chunkRYW4HPSMjs.ACTIVE_ORG_NAME_ENV] } : {},
191
191
  // An explicit empty list must reach the store: it clears a stale line.
192
- ...Object.prototype.hasOwnProperty.call(values, _chunkV7UP2F4Ujs.FEATURES_ENV) ? { [_chunkV7UP2F4Ujs.FEATURES_ENV]: values[_chunkV7UP2F4Ujs.FEATURES_ENV] } : {}
192
+ ...Object.prototype.hasOwnProperty.call(values, _chunkRYW4HPSMjs.FEATURES_ENV) ? { [_chunkRYW4HPSMjs.FEATURES_ENV]: values[_chunkRYW4HPSMjs.FEATURES_ENV] } : {}
193
193
  };
194
194
  if (scope === "folder") {
195
- _chunkV7UP2F4Ujs.saveProjectDeeplineEnvValues.call(void 0, filtered);
195
+ _chunkRYW4HPSMjs.saveProjectDeeplineEnvValues.call(void 0, filtered);
196
196
  } else {
197
- _chunkV7UP2F4Ujs.saveHostEnvValues.call(void 0, baseUrl, filtered);
197
+ _chunkRYW4HPSMjs.saveHostEnvValues.call(void 0, baseUrl, filtered);
198
198
  }
199
199
  }
200
200
  function activeOrgEnvValues(data) {
@@ -202,21 +202,21 @@ function activeOrgEnvValues(data) {
202
202
  if (!orgId) return {};
203
203
  const orgName = typeof data.org_name === "string" ? data.org_name.trim() : "";
204
204
  return {
205
- [_chunkV7UP2F4Ujs.ACTIVE_ORG_ID_ENV]: orgId,
206
- [_chunkV7UP2F4Ujs.ACTIVE_ORG_NAME_ENV]: orgName,
207
- ..._chunkV7UP2F4Ujs.featureEnvValues.call(void 0, data)
205
+ [_chunkRYW4HPSMjs.ACTIVE_ORG_ID_ENV]: orgId,
206
+ [_chunkRYW4HPSMjs.ACTIVE_ORG_NAME_ENV]: orgName,
207
+ ..._chunkRYW4HPSMjs.featureEnvValues.call(void 0, data)
208
208
  };
209
209
  }
210
210
  async function httpJson(method, url, apiKey, body, timeoutMs = AUTH_HTTP_TIMEOUT_MS) {
211
211
  const headers = {
212
212
  "Content-Type": "application/json",
213
- "User-Agent": `deepline-ts-sdk/${_chunkV7UP2F4Ujs.SDK_VERSION}`,
213
+ "User-Agent": `deepline-ts-sdk/${_chunkRYW4HPSMjs.SDK_VERSION}`,
214
214
  "X-Deepline-Client-Family": "sdk",
215
215
  "X-Deepline-CLI-Family": "sdk",
216
- "X-Deepline-Agent-Runtime": _chunkV7UP2F4Ujs.detectAgentRuntime.call(void 0, ),
217
- "X-Deepline-CLI-Version": _chunkV7UP2F4Ujs.SDK_VERSION,
218
- "X-Deepline-SDK-Version": _chunkV7UP2F4Ujs.SDK_VERSION,
219
- "X-Deepline-API-Contract": _chunkV7UP2F4Ujs.SDK_API_CONTRACT
216
+ "X-Deepline-Agent-Runtime": _chunkRYW4HPSMjs.detectAgentRuntime.call(void 0, ),
217
+ "X-Deepline-CLI-Version": _chunkRYW4HPSMjs.SDK_VERSION,
218
+ "X-Deepline-SDK-Version": _chunkRYW4HPSMjs.SDK_VERSION,
219
+ "X-Deepline-API-Contract": _chunkRYW4HPSMjs.SDK_API_CONTRACT
220
220
  };
221
221
  if (apiKey) headers["Authorization"] = `Bearer ${apiKey}`;
222
222
  const bypassToken = _optionalChain([process, 'access', _7 => _7.env, 'access', _8 => _8.VERCEL_PROTECTION_BYPASS_TOKEN, 'optionalAccess', _9 => _9.trim, 'call', _10 => _10()]);
@@ -262,7 +262,7 @@ async function readStatusBanner(baseUrl) {
262
262
  return _optionalChain([response, 'optionalAccess', _11 => _11.status]) === 200 ? _nullishCoalesce(response.data.banner, () => ( null)) : null;
263
263
  }
264
264
  async function reportSetupCompleted(input) {
265
- const apiKey = input.authScope === "folder" ? _chunkV7UP2F4Ujs.resolveProjectApiKeyForBaseUrl.call(void 0, input.baseUrl) : _chunkV7UP2F4Ujs.resolveGlobalApiKeyForBaseUrl.call(void 0, input.baseUrl);
265
+ const apiKey = input.authScope === "folder" ? _chunkRYW4HPSMjs.resolveProjectApiKeyForBaseUrl.call(void 0, input.baseUrl) : _chunkRYW4HPSMjs.resolveGlobalApiKeyForBaseUrl.call(void 0, input.baseUrl);
266
266
  if (!apiKey) return;
267
267
  try {
268
268
  await httpJson(
@@ -359,7 +359,7 @@ async function printClaimSuccessBanner(baseUrl, apiKey, statusData) {
359
359
  }
360
360
  }
361
361
  async function handleRegister(args) {
362
- const baseUrl = _chunkV7UP2F4Ujs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
362
+ const baseUrl = _chunkRYW4HPSMjs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
363
363
  let orgName = "";
364
364
  let orgId = "";
365
365
  let agentName = "";
@@ -414,19 +414,19 @@ async function handleRegister(args) {
414
414
  });
415
415
  saveEnvValues(
416
416
  {
417
- [_chunkV7UP2F4Ujs.HOST_URL_ENV]: baseUrl
417
+ [_chunkRYW4HPSMjs.HOST_URL_ENV]: baseUrl
418
418
  },
419
419
  baseUrl,
420
420
  authScope
421
421
  );
422
422
  }
423
423
  if (claimUrl) {
424
- const shouldOpen = waitMode !== "no" && _chunkV7UP2F4Ujs.detectAgentRuntime.call(void 0, ) !== "claude_cowork";
424
+ const shouldOpen = waitMode !== "no" && _chunkRYW4HPSMjs.detectAgentRuntime.call(void 0, ) !== "claude_cowork";
425
425
  console.log(
426
426
  shouldOpen ? " Opening approval page in your browser." : " Open this approval page in your browser:"
427
427
  );
428
428
  console.log(` ${claimUrl}`);
429
- if (shouldOpen) _chunkRTO5QZWTjs.openInBrowser.call(void 0, claimUrl);
429
+ if (shouldOpen) _chunkDQ65ZVHNjs.openInBrowser.call(void 0, claimUrl);
430
430
  }
431
431
  if (data.cli_message) {
432
432
  console.log(String(data.cli_message));
@@ -469,8 +469,8 @@ async function handleRegister(args) {
469
469
  if (apiKey) {
470
470
  saveEnvValues(
471
471
  {
472
- [_chunkV7UP2F4Ujs.HOST_URL_ENV]: baseUrl,
473
- [_chunkV7UP2F4Ujs.API_KEY_ENV]: apiKey,
472
+ [_chunkRYW4HPSMjs.HOST_URL_ENV]: baseUrl,
473
+ [_chunkRYW4HPSMjs.API_KEY_ENV]: apiKey,
474
474
  ...activeOrgEnvValues(statusData)
475
475
  },
476
476
  baseUrl,
@@ -492,7 +492,7 @@ async function handleRegister(args) {
492
492
  }
493
493
  }
494
494
  async function handleWait(args) {
495
- const baseUrl = _chunkV7UP2F4Ujs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
495
+ const baseUrl = _chunkRYW4HPSMjs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
496
496
  let timeoutSeconds = 300;
497
497
  let requestedScope;
498
498
  if (args.includes("--auth-scope")) {
@@ -516,7 +516,7 @@ async function handleWait(args) {
516
516
  const authScope = resumed.scope;
517
517
  const claimToken = _nullishCoalesce(_optionalChain([pendingClaim, 'optionalAccess', _12 => _12.claimToken]), () => ( ""));
518
518
  if (!pendingClaim) {
519
- const scopedApiKey = authScope === "folder" ? _chunkV7UP2F4Ujs.resolveProjectApiKeyForBaseUrl.call(void 0, baseUrl) : _chunkV7UP2F4Ujs.resolveGlobalApiKeyForBaseUrl.call(void 0, baseUrl);
519
+ const scopedApiKey = authScope === "folder" ? _chunkRYW4HPSMjs.resolveProjectApiKeyForBaseUrl.call(void 0, baseUrl) : _chunkRYW4HPSMjs.resolveGlobalApiKeyForBaseUrl.call(void 0, baseUrl);
520
520
  if (scopedApiKey) {
521
521
  console.log("Already connected.");
522
522
  return EXIT_OK;
@@ -559,8 +559,8 @@ async function handleWait(args) {
559
559
  if (apiKey) {
560
560
  saveEnvValues(
561
561
  {
562
- [_chunkV7UP2F4Ujs.HOST_URL_ENV]: baseUrl,
563
- [_chunkV7UP2F4Ujs.API_KEY_ENV]: apiKey,
562
+ [_chunkRYW4HPSMjs.HOST_URL_ENV]: baseUrl,
563
+ [_chunkRYW4HPSMjs.API_KEY_ENV]: apiKey,
564
564
  ...activeOrgEnvValues(data)
565
565
  },
566
566
  baseUrl,
@@ -584,8 +584,8 @@ async function handleWait(args) {
584
584
  return EXIT_AUTH;
585
585
  }
586
586
  async function authStatusLine(timeoutMs = 3e3) {
587
- const baseUrl = _chunkV7UP2F4Ujs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
588
- const apiKey = _chunkV7UP2F4Ujs.resolveApiKeyForBaseUrl.call(void 0, baseUrl);
587
+ const baseUrl = _chunkRYW4HPSMjs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
588
+ const apiKey = _chunkRYW4HPSMjs.resolveApiKeyForBaseUrl.call(void 0, baseUrl);
589
589
  if (!apiKey) return `Auth: not connected (${baseUrl})`;
590
590
  try {
591
591
  const { status, data } = await httpJson(
@@ -608,9 +608,9 @@ async function authStatusLine(timeoutMs = 3e3) {
608
608
  }
609
609
  }
610
610
  async function handleStatus(args) {
611
- const baseUrl = _chunkV7UP2F4Ujs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
611
+ const baseUrl = _chunkRYW4HPSMjs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
612
612
  const reveal = args.includes("--reveal");
613
- const jsonOutput = _chunkRTO5QZWTjs.argsWantJson.call(void 0, args);
613
+ const jsonOutput = _chunkDQ65ZVHNjs.argsWantJson.call(void 0, args);
614
614
  const hasExplicitAuthScope = args.includes("--auth-scope");
615
615
  let authScope = null;
616
616
  if (hasExplicitAuthScope) {
@@ -651,14 +651,14 @@ async function handleStatus(args) {
651
651
  };
652
652
  hostLines.push(`Host: ${baseUrl} (unreachable)`);
653
653
  }
654
- const apiKey = authScope === "folder" ? _chunkV7UP2F4Ujs.resolveProjectApiKeyForBaseUrl.call(void 0, baseUrl) : authScope === "global" ? _chunkV7UP2F4Ujs.resolveGlobalApiKeyForBaseUrl.call(void 0, baseUrl) : _chunkV7UP2F4Ujs.resolveApiKeyForBaseUrl.call(void 0, baseUrl);
654
+ const apiKey = authScope === "folder" ? _chunkRYW4HPSMjs.resolveProjectApiKeyForBaseUrl.call(void 0, baseUrl) : authScope === "global" ? _chunkRYW4HPSMjs.resolveGlobalApiKeyForBaseUrl.call(void 0, baseUrl) : _chunkRYW4HPSMjs.resolveApiKeyForBaseUrl.call(void 0, baseUrl);
655
655
  if (!apiKey) {
656
656
  const { claim: pendingClaim } = resolvePendingAuthClaimForResume(
657
657
  baseUrl,
658
658
  _nullishCoalesce(authScope, () => ( void 0))
659
659
  );
660
660
  if (pendingClaim) {
661
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
661
+ _chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0,
662
662
  {
663
663
  ..._nullishCoalesce(hostStatusPayload, () => ( { host: baseUrl })),
664
664
  status: "pending",
@@ -679,7 +679,7 @@ async function handleStatus(args) {
679
679
  );
680
680
  return EXIT_OK;
681
681
  }
682
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
682
+ _chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0,
683
683
  {
684
684
  ..._nullishCoalesce(hostStatusPayload, () => ( { host: baseUrl })),
685
685
  status: "not connected",
@@ -712,7 +712,7 @@ async function handleStatus(args) {
712
712
  }
713
713
  );
714
714
  if (status === 401 || status === 403) {
715
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
715
+ _chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0,
716
716
  {
717
717
  ..._nullishCoalesce(hostStatusPayload, () => ( { host: baseUrl })),
718
718
  status: "unauthorized",
@@ -739,7 +739,7 @@ async function handleStatus(args) {
739
739
  console.error(`Auth status error (status ${status}).`);
740
740
  return EXIT_SERVER;
741
741
  }
742
- const resolvedAuthScope = _nullishCoalesce(authScope, () => ( (_chunkV7UP2F4Ujs.getResolvedProjectAuthSource.call(void 0, baseUrl, apiKey) ? "folder" : "global")));
742
+ const resolvedAuthScope = _nullishCoalesce(authScope, () => ( (_chunkRYW4HPSMjs.getResolvedProjectAuthSource.call(void 0, baseUrl, apiKey) ? "folder" : "global")));
743
743
  clearSatisfiedPendingClaim(
744
744
  baseUrl,
745
745
  resolvedAuthScope,
@@ -767,28 +767,28 @@ async function handleStatus(args) {
767
767
  if (apiKeyResp) {
768
768
  saveEnvValues(
769
769
  {
770
- [_chunkV7UP2F4Ujs.HOST_URL_ENV]: baseUrl,
771
- [_chunkV7UP2F4Ujs.API_KEY_ENV]: apiKeyResp,
770
+ [_chunkRYW4HPSMjs.HOST_URL_ENV]: baseUrl,
771
+ [_chunkRYW4HPSMjs.API_KEY_ENV]: apiKeyResp,
772
772
  ...activeOrgEnvValues(data)
773
773
  },
774
774
  baseUrl,
775
775
  resolvedAuthScope
776
776
  );
777
777
  if (resolvedAuthScope === "folder") {
778
- const target = _chunkV7UP2F4Ujs.resolveProjectPinTarget.call(void 0, );
778
+ const target = _chunkRYW4HPSMjs.resolveProjectPinTarget.call(void 0, );
779
779
  savedApiKeyPath = target.ok ? _path.join.call(void 0, target.dir, ".env.deepline") : null;
780
780
  } else {
781
781
  savedApiKeyPath = envFilePath(baseUrl);
782
782
  }
783
783
  }
784
- } else if (resolvedAuthScope === "folder" || _chunkV7UP2F4Ujs.storedHostApiKey.call(void 0, baseUrl) === apiKey) {
785
- saveEnvValues(_chunkV7UP2F4Ujs.featureEnvValues.call(void 0, data), baseUrl, resolvedAuthScope);
784
+ } else if (resolvedAuthScope === "folder" || _chunkRYW4HPSMjs.storedHostApiKey.call(void 0, baseUrl) === apiKey) {
785
+ saveEnvValues(_chunkRYW4HPSMjs.featureEnvValues.call(void 0, data), baseUrl, resolvedAuthScope);
786
786
  }
787
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
787
+ _chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0,
788
788
  {
789
789
  ...payload,
790
- ..._chunkV7UP2F4Ujs.detectAgentRuntime.call(void 0, ) !== "unknown" ? {
791
- command_context: _chunkV7UP2F4Ujs.resolveCliCommandContext.call(void 0,
790
+ ..._chunkRYW4HPSMjs.detectAgentRuntime.call(void 0, ) !== "unknown" ? {
791
+ command_context: _chunkRYW4HPSMjs.resolveCliCommandContext.call(void 0,
792
792
  { baseUrl, apiKey },
793
793
  resolvedAuthScope
794
794
  )
@@ -2,10 +2,10 @@ import {
2
2
  getAuthedHttpClient,
3
3
  openInBrowser,
4
4
  printCommandEnvelope
5
- } from "./chunk-XKZXO7D3.mjs";
5
+ } from "./chunk-RNSWDKBM.mjs";
6
6
  import {
7
7
  resolveBaseUrlOnly
8
- } from "./chunk-VE3U3SQC.mjs";
8
+ } from "./chunk-2LDADJNO.mjs";
9
9
 
10
10
  // src/cli/commands/git.ts
11
11
  function shellQuote(value) {
@@ -2,7 +2,7 @@ import {
2
2
  argsWantJson,
3
3
  openInBrowser,
4
4
  printCommandEnvelope
5
- } from "./chunk-XKZXO7D3.mjs";
5
+ } from "./chunk-RNSWDKBM.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-VE3U3SQC.mjs";
28
+ } from "./chunk-2LDADJNO.mjs";
29
29
 
30
30
  // src/cli/commands/auth.ts
31
31
  import {
@@ -0,0 +1,112 @@
1
+ import {
2
+ DeeplineError,
3
+ brandAsProviderTransientError,
4
+ brandAsToolExecutionError,
5
+ isProviderTransientFailure
6
+ } from "./chunk-NXGCO4JB.mjs";
7
+
8
+ // src/errors.ts
9
+ var CustomerDbQueryOutcomeUnknownError = class extends DeeplineError {
10
+ outcome = "unknown";
11
+ operationKey;
12
+ retryable;
13
+ constructor(cause, operationKey, options = {}) {
14
+ const recoveryAvailable = operationKey !== void 0 && options.recoveryAvailable !== false;
15
+ super(
16
+ operationKey === void 0 ? "SQL outcome is unknown. The unkeyed request was attempted once; inspect the database before issuing another write. An operation key added afterwards cannot recover this request." : recoveryAvailable ? "SQL outcome is unknown. Recover by submitting the same SQL and options with the original operation key; do not use a new key." : "SQL outcome is unknown. The server did not confirm atomic recovery support. Do not resubmit this write; inspect the database and confirm reader support before recovering with the original operation key.",
17
+ cause.statusCode,
18
+ "CUSTOMER_DB_QUERY_OUTCOME_UNKNOWN",
19
+ {
20
+ outcome: "unknown",
21
+ recovery: recoveryAvailable ? "original_operation_key" : "unavailable",
22
+ causeCode: cause.code
23
+ }
24
+ );
25
+ this.name = "CustomerDbQueryOutcomeUnknownError";
26
+ this.operationKey = operationKey;
27
+ this.retryable = recoveryAvailable;
28
+ Object.defineProperty(this, "cause", { value: cause, configurable: true });
29
+ }
30
+ };
31
+ var AuthError = class extends DeeplineError {
32
+ /** Constructed by the SDK when Deepline rejects the caller's credentials. */
33
+ constructor(message = "Authentication failed. Check your DEEPLINE_API_KEY.") {
34
+ super(message, 401, "AUTH_ERROR");
35
+ this.name = "AuthError";
36
+ }
37
+ };
38
+ var RateLimitError = class extends DeeplineError {
39
+ /** Milliseconds to wait before retrying, from the `Retry-After` response header. Defaults to 5000. */
40
+ retryAfterMs;
41
+ /** Constructed by the SDK after exhausting HTTP-level rate-limit retries. */
42
+ constructor(retryAfterMs = 5e3, message) {
43
+ super(
44
+ message ?? `Rate limited. Retry after ${retryAfterMs}ms.`,
45
+ 429,
46
+ "RATE_LIMIT"
47
+ );
48
+ this.name = "RateLimitError";
49
+ this.retryAfterMs = retryAfterMs;
50
+ }
51
+ };
52
+ var ToolRateLimitError = class extends RateLimitError {
53
+ /** Public tool id passed to `tools.execute`. */
54
+ toolId;
55
+ /** Provider responsible for the operation, or `null`. */
56
+ provider;
57
+ /** Provider operation name, or `null`. */
58
+ operation;
59
+ /** Stable machine-readable failure code when one exists. */
60
+ code;
61
+ /** Boundary responsible for the failure. */
62
+ origin;
63
+ /** Stable reason family for policy and diagnostics. */
64
+ category;
65
+ /** Whether repeating the same semantic call is delivery-safe. */
66
+ retryable;
67
+ /** Provider or Deepline request id, or `null`. */
68
+ requestId;
69
+ /** Network failure kind, or `null` for non-network failures. */
70
+ networkKind;
71
+ /** Network boundary that failed, or `null` for non-network failures. */
72
+ networkScope;
73
+ /** Explicitly allowlisted diagnostics safe for SDK callers. */
74
+ publicDetails;
75
+ /** Constructed by the SDK after a structured tool HTTP 429. */
76
+ constructor(message, options) {
77
+ super(options.retryAfterMs ?? 5e3, message);
78
+ this.name = "ToolRateLimitError";
79
+ this.statusCode = options.statusCode ?? 429;
80
+ this.code = options.code ?? void 0;
81
+ this.toolId = options.toolId;
82
+ this.provider = options.provider;
83
+ this.operation = options.operation;
84
+ this.origin = options.origin;
85
+ this.category = options.category;
86
+ this.retryable = options.retryable;
87
+ this.requestId = options.requestId;
88
+ this.networkKind = options.networkKind;
89
+ this.networkScope = options.networkScope;
90
+ this.publicDetails = options.publicDetails ?? null;
91
+ this.details = options.details;
92
+ brandAsToolExecutionError(this);
93
+ if (isProviderTransientFailure(this)) {
94
+ brandAsProviderTransientError(this);
95
+ }
96
+ }
97
+ };
98
+ var ConfigError = class extends DeeplineError {
99
+ /** Construct a local SDK configuration failure. */
100
+ constructor(message) {
101
+ super(message, void 0, "CONFIG_ERROR");
102
+ this.name = "ConfigError";
103
+ }
104
+ };
105
+
106
+ export {
107
+ CustomerDbQueryOutcomeUnknownError,
108
+ AuthError,
109
+ RateLimitError,
110
+ ToolRateLimitError,
111
+ ConfigError
112
+ };