deepline 0.3.346 → 0.3.348

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 (125) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +5 -0
  2. package/dist/bundling-sources/sdk/src/http.ts +14 -0
  3. package/dist/bundling-sources/sdk/src/index.ts +1 -0
  4. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  5. package/dist/bundling-sources/sdk/src/tool-calls.ts +78 -17
  6. package/dist/bundling-sources/shared_libs/integration-contracts/billing-entitlements.ts +29 -0
  7. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +32 -1
  8. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +17 -1
  9. package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +18 -0
  10. package/dist/bundling-sources/shared_libs/play-runtime/internal-bootstrap-token.ts +9 -0
  11. package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +11 -0
  12. package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +6 -0
  13. package/dist/bundling-sources/shared_libs/play-runtime/workflow-executor-auth.ts +3 -0
  14. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +13 -0
  15. package/dist/cli/{auth-HTWHQNMY.mjs → auth-ME53BGXD.mjs} +4 -4
  16. package/dist/cli/auth-YHS2NN4I.js +31 -0
  17. package/dist/cli/{billing-X56CVZWC.mjs → billing-466LUN65.mjs} +31 -4
  18. package/dist/cli/{billing-4DCHVGO5.js → billing-EMRJAWNG.js} +99 -72
  19. package/dist/cli/{chunk-MOVEHSNM.mjs → chunk-2G7KMDDI.mjs} +1 -1
  20. package/dist/cli/{chunk-T7EVEXHS.js → chunk-2JRKH263.js} +15 -15
  21. package/dist/cli/{chunk-KQCTQGUU.mjs → chunk-35PLGSH6.mjs} +52 -16
  22. package/dist/cli/{chunk-EJ2NVO5K.js → chunk-4JJN7BDI.js} +48 -48
  23. package/dist/cli/{chunk-2GRMXCLZ.mjs → chunk-5AZNXX2S.mjs} +1 -1
  24. package/dist/cli/{chunk-L2R72RQJ.js → chunk-5HLM2PGK.js} +8 -8
  25. package/dist/cli/{chunk-5NNSJTJ3.js → chunk-5IYFQJHX.js} +280 -244
  26. package/dist/cli/{chunk-FKKNYKDY.js → chunk-5O4B6AUN.js} +2 -0
  27. package/dist/cli/{chunk-XAM3XOUA.mjs → chunk-5UWZ52IW.mjs} +2 -2
  28. package/dist/cli/{chunk-2RJ7RMRM.js → chunk-6NM2IY4B.js} +8 -8
  29. package/dist/cli/{chunk-NTVTZAVZ.mjs → chunk-7E66A24V.mjs} +2 -0
  30. package/dist/cli/{chunk-3GLIYDIF.mjs → chunk-BAJXRIRP.mjs} +2 -2
  31. package/dist/cli/{chunk-62TKYGY6.mjs → chunk-CA7RR4UD.mjs} +3 -3
  32. package/dist/cli/{chunk-O4SXVVNQ.mjs → chunk-CEC3BXRV.mjs} +1 -1
  33. package/dist/cli/{chunk-IIOBMOMH.mjs → chunk-DSWSEHRX.mjs} +1 -1
  34. package/dist/cli/{chunk-4Q572AVS.js → chunk-EWYHXSV4.js} +6 -6
  35. package/dist/cli/{chunk-22GXXUTB.js → chunk-GVJPI7MB.js} +33 -27
  36. package/dist/cli/{chunk-SGBSQHXS.js → chunk-IICCYB57.js} +64 -62
  37. package/dist/cli/{chunk-5QG2UAYH.js → chunk-KGKPHGDT.js} +2 -2
  38. package/dist/cli/{chunk-GCBLVWDQ.mjs → chunk-L645OZEB.mjs} +17 -8
  39. package/dist/cli/{chunk-ZR4EHO62.mjs → chunk-MM6X5ADB.mjs} +2 -2
  40. package/dist/cli/{chunk-AFNEQ43J.js → chunk-MX53GIOB.js} +40 -1
  41. package/dist/cli/{chunk-YUKZHAFW.js → chunk-NX4WJO5P.js} +26 -26
  42. package/dist/cli/{chunk-GGSLHWTB.js → chunk-PQZURAHR.js} +1 -1
  43. package/dist/cli/{chunk-WKZTHHJI.mjs → chunk-Q37KLZXK.mjs} +10 -8
  44. package/dist/cli/{chunk-OJVAVQLB.js → chunk-QGKPTBRR.js} +3 -3
  45. package/dist/cli/{chunk-ZEUFYRUR.js → chunk-SIE7MILM.js} +257 -248
  46. package/dist/cli/{chunk-YEKAGC52.js → chunk-U5U2DJ3A.js} +60 -60
  47. package/dist/cli/{chunk-NVNHV73C.mjs → chunk-UCVFMPAO.mjs} +2 -2
  48. package/dist/cli/{chunk-VC7M2QR7.mjs → chunk-VWSEZMCR.mjs} +7 -1
  49. package/dist/cli/{chunk-P4IKGWYF.mjs → chunk-XVWOERRO.mjs} +4 -4
  50. package/dist/cli/{chunk-JOA6IKDE.mjs → chunk-Z6B4UPM4.mjs} +39 -0
  51. package/dist/cli/client-F47WSZBF.js +20 -0
  52. package/dist/cli/{client-C2KUT452.mjs → client-K3EFOESB.mjs} +3 -3
  53. package/dist/cli/{csv-3TAA2MTR.js → csv-4UFHUMIR.js} +12 -12
  54. package/dist/cli/{csv-SLACAH4F.mjs → csv-ZFH725GM.mjs} +3 -3
  55. package/dist/cli/{db-BT6Q3FE6.js → db-EJHH7IBM.js} +29 -29
  56. package/dist/cli/{db-IN4I6KJ5.mjs → db-KTJSJ6LJ.mjs} +4 -4
  57. package/dist/cli/{describe-EDXTYMOF.mjs → describe-2GXTRRSJ.mjs} +11 -11
  58. package/dist/cli/{describe-FJZXYKFH.js → describe-ZQXDXWKZ.js} +27 -27
  59. package/dist/cli/{executions-YYQC2TVR.js → executions-FEBZXTAI.js} +6 -6
  60. package/dist/cli/{executions-X36QA5NY.mjs → executions-ZFEW2R3V.mjs} +4 -4
  61. package/dist/cli/{feedback-KTEPHZ4S.mjs → feedback-BYMYIBHU.mjs} +3 -3
  62. package/dist/cli/{feedback-BS3S46O3.js → feedback-F3LKI327.js} +7 -7
  63. package/dist/cli/{git-3ZVYB63W.mjs → git-A3V2AKGA.mjs} +4 -4
  64. package/dist/cli/git-PWHYGNBR.js +23 -0
  65. package/dist/cli/index.js +79 -79
  66. package/dist/cli/index.mjs +31 -31
  67. package/dist/cli/{legacy-noops-VVBJXM2K.mjs → legacy-noops-IMOMP5NH.mjs} +4 -4
  68. package/dist/cli/{legacy-noops-V5R7ITER.js → legacy-noops-TYXWVLSD.js} +7 -7
  69. package/dist/cli/{monitors-J6XDE76B.js → monitors-BG2EP4M2.js} +85 -85
  70. package/dist/cli/{monitors-KYTMBNUQ.mjs → monitors-PJWHKJAG.mjs} +4 -4
  71. package/dist/cli/{org-RGABGQKP.mjs → org-CVCRHGQF.mjs} +4 -4
  72. package/dist/cli/{org-MHF2NGDV.js → org-NM7EROYH.js} +60 -60
  73. package/dist/cli/{play-UII4SSA7.mjs → play-ESB6ZDMP.mjs} +10 -10
  74. package/dist/cli/play-MYWKV6MH.js +153 -0
  75. package/dist/cli/{providers-LQOSKPUH.mjs → providers-BPDX7QBF.mjs} +4 -4
  76. package/dist/cli/{providers-3GDMD7T6.js → providers-EXITLSJG.js} +7 -7
  77. package/dist/cli/{quickstart-R34Z7EMU.js → quickstart-55MBPFRI.js} +5 -5
  78. package/dist/cli/{quickstart-GAMYLCLJ.mjs → quickstart-P5HLSTZB.mjs} +3 -3
  79. package/dist/cli/search-2JFDCWWK.js +26 -0
  80. package/dist/cli/{search-AOOMDVF5.mjs → search-UJ3KOFZV.mjs} +5 -5
  81. package/dist/cli/{secrets-T4XXIASK.js → secrets-TLV2Q4Z5.js} +13 -13
  82. package/dist/cli/{secrets-U7YGLUSX.mjs → secrets-XJCZM2M2.mjs} +4 -4
  83. package/dist/cli/{sessions-VPXR4DSZ.mjs → sessions-4XMG3DEE.mjs} +4 -4
  84. package/dist/cli/{sessions-JQGKWKJS.js → sessions-DJWLUVXM.js} +5 -5
  85. package/dist/cli/{settings-LP55G43L.mjs → settings-3ZGLOANJ.mjs} +7 -7
  86. package/dist/cli/{settings-LXF45R7X.js → settings-KBNCPN3E.js} +74 -74
  87. package/dist/cli/{setup-36QA4JI3.mjs → setup-R3UV4ZXN.mjs} +6 -6
  88. package/dist/cli/{setup-MA2GLU4N.js → setup-WZZXC7H5.js} +41 -41
  89. package/dist/cli/{skills-HB6PARLZ.mjs → skills-44RXNHZH.mjs} +4 -4
  90. package/dist/cli/skills-52WTBX7A.js +28 -0
  91. package/dist/cli/tools-4ESTBMSN.js +40 -0
  92. package/dist/cli/{tools-E7K7R4AO.mjs → tools-NLUPNYR3.mjs} +8 -8
  93. package/dist/cli/{update-IT63P3NV.mjs → update-57GQJRXF.mjs} +6 -6
  94. package/dist/cli/update-V2FZCYNP.js +28 -0
  95. package/dist/cli/{workflow-UO3PMX7R.mjs → workflow-ARCLSKBC.mjs} +5 -5
  96. package/dist/cli/{workflow-SJHASZ5C.js → workflow-XI7LZRTQ.js} +15 -15
  97. package/dist/{client-DW3zASj8.d.ts → client-4DbE-U6e.d.ts} +9 -1
  98. package/dist/{client-BHReRdWK.d.mts → client-DIJpwhl-.d.mts} +9 -1
  99. package/dist/{compiler-manifest-CButyeZ8.d.mts → compiler-manifest-DgdW0q0b.d.mts} +42 -1
  100. package/dist/{compiler-manifest-CButyeZ8.d.ts → compiler-manifest-DgdW0q0b.d.ts} +42 -1
  101. package/dist/{index-BMsNUoL5.d.mts → index-C3nQQTI-.d.mts} +1 -1
  102. package/dist/{index-LDRzwo09.d.ts → index-CEYQAfS0.d.ts} +1 -1
  103. package/dist/index.d.mts +6 -6
  104. package/dist/index.d.ts +6 -6
  105. package/dist/index.js +7 -7
  106. package/dist/index.mjs +4 -4
  107. package/dist/install-integrity.json +87 -86
  108. package/dist/plays/bundle-play-file.d.mts +3 -3
  109. package/dist/plays/bundle-play-file.d.ts +3 -3
  110. package/dist/plays/bundle-play-file.mjs +2 -2
  111. package/dist/plays/run-request.d.mts +2 -2
  112. package/dist/plays/run-request.d.ts +2 -2
  113. package/dist/release.d.mts +1 -1
  114. package/dist/release.d.ts +1 -1
  115. package/dist/release.js +2 -2
  116. package/dist/release.mjs +1 -1
  117. package/package.json +1 -1
  118. package/dist/cli/auth-5YTC2XH2.js +0 -31
  119. package/dist/cli/client-4RKYHB7Z.js +0 -20
  120. package/dist/cli/git-ZHAD5TJN.js +0 -23
  121. package/dist/cli/play-ZWAH3U44.js +0 -153
  122. package/dist/cli/search-FVB7ZNCO.js +0 -26
  123. package/dist/cli/skills-GUWC4FV7.js +0 -28
  124. package/dist/cli/tools-T5WIAD5Z.js +0 -40
  125. package/dist/cli/update-QY6RY3A6.js +0 -28
@@ -1620,7 +1620,9 @@ var PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
1620
1620
  " run(options?: DatasetRunOptions<InputRow>): Promise<PlayDataset<OutputRow>>;",
1621
1621
  "};",
1622
1622
  "export type PlayReferenceLike<TInput extends Record<string, unknown> = Record<string, unknown>> = ({ readonly playName: string; readonly name?: string } | { readonly name: string; readonly playName?: string }) & { readonly __inputType?: TInput };",
1623
+ "export type BillingEntitlements = { org_id: string; as_of: number; plan: { sku: string; name: string; catalog_revision: string | null; included_credits: number; interval: 'month' | 'year' | null } | null; benefits: { quickenrichUnlimited?: { status: 'active' | 'past_due'; value: { enabled: boolean; requestsPerMinute: number }; expiresAt?: number } }; effective_limits: { quickenrichUnlimited?: { baseline: number; effective: number; source: 'plan' | 'override'; override_expires_at?: number } } };",
1623
1624
  "export interface DeeplinePlayRuntimeContext {",
1625
+ " billing: { entitlements(): Promise<BillingEntitlements> };",
1624
1626
  " csv<T = Record<string, unknown>>(path: string | CsvInput<T & object>, options?: CsvOptions): Promise<PlayDataset<T>>;",
1625
1627
  " dataset<TSource extends PlayDatasetInput<object>>(key: string, items: TSource): DatasetBuilder<PlayDatasetRow<TSource> & object, PlayDatasetRow<TSource> & object>;",
1626
1628
  " map<TSource extends PlayDatasetInput<object>>(key: string, items: TSource, options?: DatasetDefinitionOptions<PlayDatasetRow<TSource> & object>): never;",
@@ -2,7 +2,7 @@ import {
2
2
  argsWantJson,
3
3
  openInBrowser,
4
4
  printCommandEnvelope
5
- } from "./chunk-2GRMXCLZ.mjs";
5
+ } from "./chunk-5AZNXX2S.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-VC7M2QR7.mjs";
28
+ } from "./chunk-VWSEZMCR.mjs";
29
29
 
30
30
  // src/cli/commands/auth.ts
31
31
  import {
@@ -1,14 +1,14 @@
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
- var _chunk5NNSJTJ3js = require('./chunk-5NNSJTJ3.js');
3
+ var _chunk5IYFQJHXjs = require('./chunk-5IYFQJHX.js');
4
4
 
5
5
 
6
6
 
7
- var _chunk4Q572AVSjs = require('./chunk-4Q572AVS.js');
7
+ var _chunkEWYHXSV4js = require('./chunk-EWYHXSV4.js');
8
8
 
9
9
 
10
10
 
11
- var _chunk22GXXUTBjs = require('./chunk-22GXXUTB.js');
11
+ var _chunkGVJPI7MBjs = require('./chunk-GVJPI7MB.js');
12
12
 
13
13
  // src/cli/commands/search.ts
14
14
  var _commander = require('commander');
@@ -18,7 +18,7 @@ var _fs = require('fs');
18
18
  var _path = require('path');
19
19
  var SEARCH_REF_TTL_MS = 15 * 6e4;
20
20
  function lastSearchPath() {
21
- return _path.join.call(void 0, _chunk22GXXUTBjs.sdkCliStateDirPath.call(void 0, _chunk22GXXUTBjs.resolveConfig.call(void 0, ).baseUrl), "last-search.json");
21
+ return _path.join.call(void 0, _chunkGVJPI7MBjs.sdkCliStateDirPath.call(void 0, _chunkGVJPI7MBjs.resolveConfig.call(void 0, ).baseUrl), "last-search.json");
22
22
  }
23
23
  function rememberSearchRef(searchRef) {
24
24
  try {
@@ -130,7 +130,7 @@ function searchRow(item) {
130
130
  }
131
131
  function renderSearchResults(result) {
132
132
  if (result.results.length === 0)
133
- return _chunk4Q572AVSjs.renderCommandEnvelopeText.call(void 0, result);
133
+ return _chunkEWYHXSV4js.renderCommandEnvelopeText.call(void 0, result);
134
134
  const rows = result.results.map(searchRow);
135
135
  const kinds = new Set(rows.map((row) => row.kind));
136
136
  const onlyTools = kinds.size === 1 && kinds.has("tool");
@@ -147,7 +147,7 @@ function renderSearchResults(result) {
147
147
  actions: _optionalChain([render, 'optionalAccess', _9 => _9.actions])
148
148
  };
149
149
  const followUps = _optionalChain([remaining, 'access', _10 => _10.sections, 'optionalAccess', _11 => _11.length]) || _optionalChain([remaining, 'access', _12 => _12.actions, 'optionalAccess', _13 => _13.length]) ? `
150
- ${_chunk4Q572AVSjs.renderCommandEnvelopeText.call(void 0, { render: remaining })}` : "";
150
+ ${_chunkEWYHXSV4js.renderCommandEnvelopeText.call(void 0, { render: remaining })}` : "";
151
151
  const notes = rows.flatMap(
152
152
  (row) => row.notes.map((note) => ` ${row.id}: ${note}`)
153
153
  );
@@ -224,7 +224,7 @@ async function runSearch(queryInput, options, types, exclude = []) {
224
224
  console.error(USAGE);
225
225
  return 1;
226
226
  }
227
- const { search_ref: searchRef, ...result } = await new (0, _chunk5NNSJTJ3js.DeeplineClient)().search({
227
+ const { search_ref: searchRef, ...result } = await new (0, _chunk5IYFQJHXjs.DeeplineClient)().search({
228
228
  query,
229
229
  types,
230
230
  exclude,
@@ -238,7 +238,7 @@ async function runSearch(queryInput, options, types, exclude = []) {
238
238
  });
239
239
  if (searchRef) rememberSearchRef(searchRef);
240
240
  pointAtDescribe(result);
241
- _chunk4Q572AVSjs.printCommandEnvelope.call(void 0, result, {
241
+ _chunkEWYHXSV4js.printCommandEnvelope.call(void 0, result, {
242
242
  json: options.json === true,
243
243
  text: renderSearchResults(result)
244
244
  });
@@ -1620,7 +1620,9 @@ var PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
1620
1620
  " run(options?: DatasetRunOptions<InputRow>): Promise<PlayDataset<OutputRow>>;",
1621
1621
  "};",
1622
1622
  "export type PlayReferenceLike<TInput extends Record<string, unknown> = Record<string, unknown>> = ({ readonly playName: string; readonly name?: string } | { readonly name: string; readonly playName?: string }) & { readonly __inputType?: TInput };",
1623
+ "export type BillingEntitlements = { org_id: string; as_of: number; plan: { sku: string; name: string; catalog_revision: string | null; included_credits: number; interval: 'month' | 'year' | null } | null; benefits: { quickenrichUnlimited?: { status: 'active' | 'past_due'; value: { enabled: boolean; requestsPerMinute: number }; expiresAt?: number } }; effective_limits: { quickenrichUnlimited?: { baseline: number; effective: number; source: 'plan' | 'override'; override_expires_at?: number } } };",
1623
1624
  "export interface DeeplinePlayRuntimeContext {",
1625
+ " billing: { entitlements(): Promise<BillingEntitlements> };",
1624
1626
  " csv<T = Record<string, unknown>>(path: string | CsvInput<T & object>, options?: CsvOptions): Promise<PlayDataset<T>>;",
1625
1627
  " dataset<TSource extends PlayDatasetInput<object>>(key: string, items: TSource): DatasetBuilder<PlayDatasetRow<TSource> & object, PlayDatasetRow<TSource> & object>;",
1626
1628
  " map<TSource extends PlayDatasetInput<object>>(key: string, items: TSource, options?: DatasetDefinitionOptions<PlayDatasetRow<TSource> & object>): never;",
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-GAMFK2ZP.mjs";
4
4
  import {
5
5
  printCommandEnvelope
6
- } from "./chunk-2GRMXCLZ.mjs";
6
+ } from "./chunk-5AZNXX2S.mjs";
7
7
  import {
8
8
  DEFAULT_SKILL_AGENTS,
9
9
  KNOWN_SKILL_AGENTS,
@@ -22,7 +22,7 @@ import {
22
22
  sdkCliStateDirPath,
23
23
  skillsAgentPathSegment,
24
24
  writeSdkSkillsLocalVersion
25
- } from "./chunk-VC7M2QR7.mjs";
25
+ } from "./chunk-VWSEZMCR.mjs";
26
26
  import {
27
27
  DeeplineError
28
28
  } from "./chunk-NXGCO4JB.mjs";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  DeeplineClient
3
- } from "./chunk-KQCTQGUU.mjs";
3
+ } from "./chunk-35PLGSH6.mjs";
4
4
  import {
5
5
  printCommandEnvelope,
6
6
  renderCommandEnvelopeText
7
- } from "./chunk-2GRMXCLZ.mjs";
7
+ } from "./chunk-5AZNXX2S.mjs";
8
8
  import {
9
9
  resolveConfig,
10
10
  sdkCliStateDirPath
11
- } from "./chunk-VC7M2QR7.mjs";
11
+ } from "./chunk-VWSEZMCR.mjs";
12
12
 
13
13
  // src/cli/commands/search.ts
14
14
  import { Option } from "commander";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveShellSpawn
3
- } from "./chunk-3GLIYDIF.mjs";
3
+ } from "./chunk-BAJXRIRP.mjs";
4
4
 
5
5
  // src/cli/npm-script-policy.ts
6
6
  import { spawnSync } from "child_process";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-H7HIDGZ7.mjs";
4
4
  import {
5
5
  PLAY_AUTHORING_CONTRACT_EDITION
6
- } from "./chunk-NTVTZAVZ.mjs";
6
+ } from "./chunk-7E66A24V.mjs";
7
7
  import {
8
8
  PLAY_ARTIFACT_KINDS,
9
9
  PLAY_RUNTIME_BACKENDS,
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _chunk22GXXUTBjs = require('./chunk-22GXXUTB.js');
6
+ var _chunkGVJPI7MBjs = require('./chunk-GVJPI7MB.js');
7
7
 
8
8
 
9
9
  var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
@@ -225,8 +225,8 @@ var BROWSER_OPEN_COOLDOWN_MS = 3e4;
225
225
  var SAME_URL_BROWSER_OPEN_COOLDOWN_MS = 5 * 6e4;
226
226
  var defaultBrowserCommandRunner = childProcess;
227
227
  function getAuthedHttpClient() {
228
- const config = _chunk22GXXUTBjs.resolveConfig.call(void 0, );
229
- return { config, http: new (0, _chunk22GXXUTBjs.HttpClient)(config) };
228
+ const config = _chunkGVJPI7MBjs.resolveConfig.call(void 0, );
229
+ return { config, http: new (0, _chunkGVJPI7MBjs.HttpClient)(config) };
230
230
  }
231
231
  function stableOsUserId() {
232
232
  try {
@@ -566,7 +566,7 @@ function collectLocalEnvInfo() {
566
566
  os: `${process.platform} ${process.arch}`,
567
567
  node_version: process.version,
568
568
  home_dir: homeDir,
569
- agent_runtime: _chunk22GXXUTBjs.detectAgentRuntime.call(void 0, )
569
+ agent_runtime: _chunkGVJPI7MBjs.detectAgentRuntime.call(void 0, )
570
570
  };
571
571
  const env = process.env;
572
572
  const optional = {
@@ -813,9 +813,9 @@ function markdownTableFromRows(rows, preferredColumns = []) {
813
813
  }
814
814
  function withAgentCommandContext(value) {
815
815
  const valueRecord = value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
816
- return _chunk22GXXUTBjs.detectAgentRuntime.call(void 0, ) !== "unknown" && valueRecord && !Object.prototype.hasOwnProperty.call(valueRecord, "command_context") ? {
816
+ return _chunkGVJPI7MBjs.detectAgentRuntime.call(void 0, ) !== "unknown" && valueRecord && !Object.prototype.hasOwnProperty.call(valueRecord, "command_context") ? {
817
817
  ...valueRecord,
818
- command_context: _chunk22GXXUTBjs.resolveCliCommandContext.call(void 0, )
818
+ command_context: _chunkGVJPI7MBjs.resolveCliCommandContext.call(void 0, )
819
819
  } : value;
820
820
  }
821
821
  function printJson(value, fields) {
@@ -4,7 +4,7 @@
4
4
  var _chunkXNYIZMNQjs = require('./chunk-XNYIZMNQ.js');
5
5
 
6
6
 
7
- var _chunkGGSLHWTBjs = require('./chunk-GGSLHWTB.js');
7
+ var _chunkPQZURAHRjs = require('./chunk-PQZURAHR.js');
8
8
 
9
9
 
10
10
 
@@ -743,9 +743,9 @@ function resolveCliCommandContext(inputConfig, requestedScope) {
743
743
  }
744
744
 
745
745
  // src/version.ts
746
- var SDK_VERSION = _chunkGGSLHWTBjs.SDK_RELEASE.version;
747
- var SDK_API_MAJOR = _chunkGGSLHWTBjs.SDK_RELEASE.contracts.api.currentMajor;
748
- var SDK_API_CONTRACT = _nullishCoalesce(_chunkGGSLHWTBjs.SDK_RELEASE.contracts.api.legacyWireIds[0], () => ( `api-v${SDK_API_MAJOR}`));
746
+ var SDK_VERSION = _chunkPQZURAHRjs.SDK_RELEASE.version;
747
+ var SDK_API_MAJOR = _chunkPQZURAHRjs.SDK_RELEASE.contracts.api.currentMajor;
748
+ var SDK_API_CONTRACT = _nullishCoalesce(_chunkPQZURAHRjs.SDK_RELEASE.contracts.api.legacyWireIds[0], () => ( `api-v${SDK_API_MAJOR}`));
749
749
 
750
750
  // src/agent-runtime.ts
751
751
 
@@ -1524,9 +1524,15 @@ var HttpClient = class {
1524
1524
  return null;
1525
1525
  }
1526
1526
  const body = await response.text();
1527
+ const receivedAtMs = Date.now();
1527
1528
  clearTimeout(timeoutId);
1528
1529
  const parsed = parseResponseBody(body);
1529
- const structuredToolError = _optionalChain([options, 'optionalAccess', _230 => _230.toolId]) && !response.ok ? _chunk7P5AA3SNjs.deserializeToolExecutionFailure.call(void 0,
1530
+ _optionalChain([options, 'optionalAccess', _230 => _230.onResponseBody, 'optionalCall', _231 => _231({
1531
+ receivedAtMs,
1532
+ httpStatus: response.status,
1533
+ body: parsed
1534
+ })]);
1535
+ const structuredToolError = _optionalChain([options, 'optionalAccess', _232 => _232.toolId]) && !response.ok ? _chunk7P5AA3SNjs.deserializeToolExecutionFailure.call(void 0,
1530
1536
  _chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status),
1531
1537
  isRecord(parsed) ? parsed.tool_error : null,
1532
1538
  _chunk7P5AA3SNjs.TOOL_EXECUTION_ERROR_SCHEMA_VERSION
@@ -1548,7 +1554,7 @@ var HttpClient = class {
1548
1554
  throw structuredToolError;
1549
1555
  }
1550
1556
  if (response.status === 429) {
1551
- if (_optionalChain([options, 'optionalAccess', _231 => _231.preserveRateLimitResponse]) && isMonitorRateLimitEnvelope(parsed)) {
1557
+ if (_optionalChain([options, 'optionalAccess', _233 => _233.preserveRateLimitResponse]) && isMonitorRateLimitEnvelope(parsed)) {
1552
1558
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
1553
1559
  _chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status),
1554
1560
  response.status,
@@ -1568,7 +1574,7 @@ var HttpClient = class {
1568
1574
  throw new AuthError(_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status));
1569
1575
  }
1570
1576
  if (!response.ok) {
1571
- const retryableApiError = _optionalChain([options, 'optionalAccess', _232 => _232.retryApiErrors]) === true && isRetryableApiErrorResponse(response.status);
1577
+ const retryableApiError = _optionalChain([options, 'optionalAccess', _234 => _234.retryApiErrors]) === true && isRetryableApiErrorResponse(response.status);
1572
1578
  const htmlError = detectHtmlErrorBody(
1573
1579
  body,
1574
1580
  response.headers.get("content-type")
@@ -1620,7 +1626,7 @@ var HttpClient = class {
1620
1626
  } catch (error) {
1621
1627
  clearTimeout(timeoutId);
1622
1628
  networkFailedAt = Date.now();
1623
- if (_optionalChain([options, 'optionalAccess', _233 => _233.signal, 'optionalAccess', _234 => _234.aborted])) {
1629
+ if (_optionalChain([options, 'optionalAccess', _235 => _235.signal, 'optionalAccess', _236 => _236.aborted])) {
1624
1630
  lastError = requestCancelledError(options.signal);
1625
1631
  break requestAttempts;
1626
1632
  }
@@ -1637,7 +1643,7 @@ var HttpClient = class {
1637
1643
  });
1638
1644
  } finally {
1639
1645
  clearTimeout(timeoutId);
1640
- _optionalChain([options, 'optionalAccess', _235 => _235.signal, 'optionalAccess', _236 => _236.removeEventListener, 'call', _237 => _237("abort", abortRequest)]);
1646
+ _optionalChain([options, 'optionalAccess', _237 => _237.signal, 'optionalAccess', _238 => _238.removeEventListener, 'call', _239 => _239("abort", abortRequest)]);
1641
1647
  }
1642
1648
  }
1643
1649
  if (attempt < maxRetries) continue;
@@ -1664,7 +1670,7 @@ var HttpClient = class {
1664
1670
  phase: networkPhase
1665
1671
  }
1666
1672
  };
1667
- if (_optionalChain([options, 'optionalAccess', _238 => _238.toolId])) {
1673
+ if (_optionalChain([options, 'optionalAccess', _240 => _240.toolId])) {
1668
1674
  const code = mappedNetworkError.code;
1669
1675
  throw withErrorCause(
1670
1676
  new (0, _chunk7P5AA3SNjs.ToolExecutionError)(
@@ -1716,12 +1722,12 @@ var HttpClient = class {
1716
1722
  }
1717
1723
  async *streamSse(path, options) {
1718
1724
  const url = `${this.config.baseUrl}${path}`;
1719
- const method = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _239 => _239.method]), () => ( "GET"));
1725
+ const method = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _241 => _241.method]), () => ( "GET"));
1720
1726
  const headers = this.authHeaders({
1721
1727
  Accept: "text/event-stream",
1722
- ..._optionalChain([options, 'optionalAccess', _240 => _240.headers])
1728
+ ..._optionalChain([options, 'optionalAccess', _242 => _242.headers])
1723
1729
  });
1724
- if (_optionalChain([options, 'optionalAccess', _241 => _241.body]) !== void 0) {
1730
+ if (_optionalChain([options, 'optionalAccess', _243 => _243.body]) !== void 0) {
1725
1731
  applyExplicitHeaders(headers, { "Content-Type": "application/json" });
1726
1732
  }
1727
1733
  let lastError = null;
@@ -1730,8 +1736,8 @@ var HttpClient = class {
1730
1736
  const response = await fetch(candidateUrl, {
1731
1737
  method,
1732
1738
  headers,
1733
- body: _optionalChain([options, 'optionalAccess', _242 => _242.body]) !== void 0 ? JSON.stringify(options.body) : void 0,
1734
- signal: _optionalChain([options, 'optionalAccess', _243 => _243.signal])
1739
+ body: _optionalChain([options, 'optionalAccess', _244 => _244.body]) !== void 0 ? JSON.stringify(options.body) : void 0,
1740
+ signal: _optionalChain([options, 'optionalAccess', _245 => _245.signal])
1735
1741
  });
1736
1742
  if (!response.ok) {
1737
1743
  const body = await response.text();
@@ -1772,7 +1778,7 @@ var HttpClient = class {
1772
1778
  throw error;
1773
1779
  }
1774
1780
  const normalized = error instanceof Error ? error : new Error(String(error));
1775
- if (isAbortLikeError(normalized) && _optionalChain([options, 'optionalAccess', _244 => _244.signal, 'optionalAccess', _245 => _245.aborted])) {
1781
+ if (isAbortLikeError(normalized) && _optionalChain([options, 'optionalAccess', _246 => _246.signal, 'optionalAccess', _247 => _247.aborted])) {
1776
1782
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
1777
1783
  `Stream from ${this.config.baseUrl} was aborted by the caller.`,
1778
1784
  void 0,
@@ -1793,7 +1799,7 @@ var HttpClient = class {
1793
1799
  }
1794
1800
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
1795
1801
  withCoworkNetworkHint(
1796
- _optionalChain([lastError, 'optionalAccess', _246 => _246.message]) ? `Unable to stream from ${this.config.baseUrl}. ${lastError.message}` : `Unable to stream from ${this.config.baseUrl}.`
1802
+ _optionalChain([lastError, 'optionalAccess', _248 => _248.message]) ? `Unable to stream from ${this.config.baseUrl}. ${lastError.message}` : `Unable to stream from ${this.config.baseUrl}.`
1797
1803
  )
1798
1804
  );
1799
1805
  }
@@ -1855,15 +1861,15 @@ function parseResponseBody(body) {
1855
1861
  }
1856
1862
  function isProviderOriginatedHttpError(parsed) {
1857
1863
  const response = asRecord(parsed);
1858
- const error = asRecord(_optionalChain([response, 'optionalAccess', _247 => _247.error]));
1859
- const failureOrigin = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _248 => _248.failure_origin]), () => ( _optionalChain([response, 'optionalAccess', _249 => _249.failure_origin])));
1860
- const code = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _250 => _250.code]), () => ( _optionalChain([response, 'optionalAccess', _251 => _251.code])));
1864
+ const error = asRecord(_optionalChain([response, 'optionalAccess', _249 => _249.error]));
1865
+ const failureOrigin = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _250 => _250.failure_origin]), () => ( _optionalChain([response, 'optionalAccess', _251 => _251.failure_origin])));
1866
+ const code = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _252 => _252.code]), () => ( _optionalChain([response, 'optionalAccess', _253 => _253.code])));
1861
1867
  return failureOrigin === "provider" || code === "UPSTREAM_BLOCKED";
1862
1868
  }
1863
1869
  function isMonitorRateLimitEnvelope(parsed) {
1864
1870
  const response = asRecord(parsed);
1865
- const error = asRecord(_optionalChain([response, 'optionalAccess', _252 => _252.error]));
1866
- return _optionalChain([error, 'optionalAccess', _253 => _253.code]) === "monitor_upstream_rate_limited" && typeof error.message === "string";
1871
+ const error = asRecord(_optionalChain([response, 'optionalAccess', _254 => _254.error]));
1872
+ return _optionalChain([error, 'optionalAccess', _255 => _255.code]) === "monitor_upstream_rate_limited" && typeof error.message === "string";
1867
1873
  }
1868
1874
  function asRecord(value) {
1869
1875
  return typeof value === "object" && value !== null ? value : null;
@@ -1879,7 +1885,7 @@ function detectHtmlErrorBody(body, contentType) {
1879
1885
  return null;
1880
1886
  }
1881
1887
  const titleMatch = trimmed.match(/<title[^>]*>([\s\S]*?)<\/title>/i);
1882
- const title = _optionalChain([titleMatch, 'optionalAccess', _254 => _254[1], 'optionalAccess', _255 => _255.replace, 'call', _256 => _256(/\s+/g, " "), 'access', _257 => _257.trim, 'call', _258 => _258()]) || void 0;
1888
+ const title = _optionalChain([titleMatch, 'optionalAccess', _256 => _256[1], 'optionalAccess', _257 => _257.replace, 'call', _258 => _258(/\s+/g, " "), 'access', _259 => _259.trim, 'call', _260 => _260()]) || void 0;
1883
1889
  const workerThrewException = /worker threw exception/i.test(trimmed);
1884
1890
  return {
1885
1891
  title,
@@ -1963,20 +1969,20 @@ function decodeSseFrame(frame) {
1963
1969
  }
1964
1970
  function sleep(ms, signal) {
1965
1971
  return new Promise((resolve2, reject) => {
1966
- if (_optionalChain([signal, 'optionalAccess', _259 => _259.aborted])) {
1972
+ if (_optionalChain([signal, 'optionalAccess', _261 => _261.aborted])) {
1967
1973
  reject(requestCancelledError(signal));
1968
1974
  return;
1969
1975
  }
1970
1976
  const timeoutId = setTimeout(() => {
1971
- _optionalChain([signal, 'optionalAccess', _260 => _260.removeEventListener, 'call', _261 => _261("abort", abort)]);
1977
+ _optionalChain([signal, 'optionalAccess', _262 => _262.removeEventListener, 'call', _263 => _263("abort", abort)]);
1972
1978
  resolve2();
1973
1979
  }, ms);
1974
1980
  const abort = () => {
1975
1981
  clearTimeout(timeoutId);
1976
- _optionalChain([signal, 'optionalAccess', _262 => _262.removeEventListener, 'call', _263 => _263("abort", abort)]);
1982
+ _optionalChain([signal, 'optionalAccess', _264 => _264.removeEventListener, 'call', _265 => _265("abort", abort)]);
1977
1983
  reject(requestCancelledError(signal));
1978
1984
  };
1979
- _optionalChain([signal, 'optionalAccess', _264 => _264.addEventListener, 'call', _265 => _265("abort", abort, { once: true })]);
1985
+ _optionalChain([signal, 'optionalAccess', _266 => _266.addEventListener, 'call', _267 => _267("abort", abort, { once: true })]);
1980
1986
  });
1981
1987
  }
1982
1988
  function withCoworkNetworkHint(message) {