@ngosangns/ns-bridge 0.1.26 → 0.1.29

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 (38) hide show
  1. package/dist/agents.d.ts +28 -0
  2. package/dist/agents.js +168 -0
  3. package/dist/agents.js.map +1 -0
  4. package/dist/catalog.d.ts +2 -0
  5. package/dist/catalog.js +5 -1
  6. package/dist/catalog.js.map +1 -1
  7. package/dist/cli.d.ts +2 -0
  8. package/dist/cli.js +17 -12
  9. package/dist/cli.js.map +1 -1
  10. package/dist/dsh-patch.d.ts +19 -5
  11. package/dist/dsh-patch.js +76 -29
  12. package/dist/dsh-patch.js.map +1 -1
  13. package/dist/hosts/dsh/arnict/dist/index.js +1 -1
  14. package/dist/hosts/dsh/arnict/vendor/qoder-auth.wasm +0 -0
  15. package/dist/hosts/dsh/devin/dist/index.js +1 -1
  16. package/dist/hosts/dsh/devin/vendor/qoder-auth.wasm +0 -0
  17. package/dist/hosts/dsh/grok/dist/index.js +1 -1
  18. package/dist/hosts/dsh/grok/vendor/qoder-auth.wasm +0 -0
  19. package/dist/hosts/dsh/kiro/dist/index.js +1 -1
  20. package/dist/hosts/dsh/kiro/vendor/qoder-auth.wasm +0 -0
  21. package/dist/hosts/dsh/qoder/dist/index.js +912 -19421
  22. package/dist/hosts/dsh/qoder/vendor/qoder-auth.wasm +0 -0
  23. package/dist/hosts/omp/dist/index.js +1339 -19779
  24. package/dist/hosts/omp/package.json +1 -1
  25. package/dist/hosts/omp/vendor/qoder-auth.wasm +0 -0
  26. package/dist/hosts/pi/dist/index.js +1604 -20044
  27. package/dist/hosts/pi/package.json +1 -1
  28. package/dist/hosts/pi/vendor/qoder-auth.wasm +0 -0
  29. package/dist/hosts.d.ts +17 -5
  30. package/dist/hosts.js +134 -25
  31. package/dist/hosts.js.map +1 -1
  32. package/dist/providers.d.ts +12 -3
  33. package/dist/providers.js +75 -44
  34. package/dist/providers.js.map +1 -1
  35. package/dist/refresh-entry.js +932 -622
  36. package/dist/serve-entry.js +1 -1
  37. package/dist/vendor/qoder-auth.wasm +0 -0
  38. package/package.json +1 -2
@@ -1,4 +1,4 @@
1
- // @ngosangns/ns-bridge 0.1.26 — bundled entries (catalog refresh, serve).
1
+ // @ngosangns/ns-bridge 0.1.29 — bundled entries (catalog refresh, serve).
2
2
  import { createRequire as __nsBridgeCreateRequire } from 'node:module';
3
3
  const require = __nsBridgeCreateRequire(import.meta.url);
4
4
  var __create = Object.create;
@@ -1122,8 +1122,8 @@ var init_stringify = __esm({
1122
1122
  });
1123
1123
 
1124
1124
  // ../../node_modules/.pnpm/@anthropic-ai+sdk@0.129.0_zod@4.5.4/node_modules/@anthropic-ai/sdk/internal/utils/query.mjs
1125
- function stringifyQuery(query3) {
1126
- return stringify(query3, { arrayFormat: "brackets" });
1125
+ function stringifyQuery(query) {
1126
+ return stringify(query, { arrayFormat: "brackets" });
1127
1127
  }
1128
1128
  var init_query = __esm({
1129
1129
  "../../node_modules/.pnpm/@anthropic-ai+sdk@0.129.0_zod@4.5.4/node_modules/@anthropic-ai/sdk/internal/utils/query.mjs"() {
@@ -1351,21 +1351,21 @@ var init_token_cache = __esm({
1351
1351
  async getToken() {
1352
1352
  const force = this.nextForce;
1353
1353
  this.nextForce = false;
1354
- const cached = this.cached;
1355
- if (force || cached == null) {
1354
+ const cached2 = this.cached;
1355
+ if (force || cached2 == null) {
1356
1356
  const token2 = await this.refresh(force);
1357
1357
  return token2.token;
1358
1358
  }
1359
- if (cached.expiresAt == null) {
1360
- return cached.token;
1359
+ if (cached2.expiresAt == null) {
1360
+ return cached2.token;
1361
1361
  }
1362
- const remaining = cached.expiresAt - nowAsSeconds();
1362
+ const remaining = cached2.expiresAt - nowAsSeconds();
1363
1363
  if (remaining > ADVISORY_REFRESH_THRESHOLD_IN_SECONDS) {
1364
- return cached.token;
1364
+ return cached2.token;
1365
1365
  }
1366
1366
  if (remaining > MANDATORY_REFRESH_THRESHOLD_IN_SECONDS) {
1367
1367
  this.backgroundRefresh();
1368
- return cached.token;
1368
+ return cached2.token;
1369
1369
  }
1370
1370
  const token = await this.refresh();
1371
1371
  return token.token;
@@ -2871,9 +2871,9 @@ function getName(value, stripPath) {
2871
2871
  }
2872
2872
  function supportsFormData(fetchObject) {
2873
2873
  const fetch3 = typeof fetchObject === "function" ? fetchObject : fetchObject.fetch;
2874
- const cached = supportsFormDataMap.get(fetch3);
2875
- if (cached)
2876
- return cached;
2874
+ const cached2 = supportsFormDataMap.get(fetch3);
2875
+ if (cached2)
2876
+ return cached2;
2877
2877
  const promise = (async () => {
2878
2878
  try {
2879
2879
  const FetchResponse = "Response" in fetch3 ? fetch3.Response : (await fetch3("data:,")).constructor;
@@ -3236,9 +3236,9 @@ var init_deployment_runs = __esm({
3236
3236
  * ```
3237
3237
  */
3238
3238
  list(params = {}, options) {
3239
- const { betas, workspace_id, ...query3 } = params ?? {};
3239
+ const { betas, workspace_id, ...query } = params ?? {};
3240
3240
  return this._client.getAPIList("/v1/deployment_runs?beta=true", PageCursor, {
3241
- query: query3,
3241
+ query,
3242
3242
  ...options,
3243
3243
  headers: buildHeaders([
3244
3244
  {
@@ -3361,9 +3361,9 @@ var init_deployments = __esm({
3361
3361
  * ```
3362
3362
  */
3363
3363
  list(params = {}, options) {
3364
- const { betas, workspace_id, ...query3 } = params ?? {};
3364
+ const { betas, workspace_id, ...query } = params ?? {};
3365
3365
  return this._client.getAPIList("/v1/deployments?beta=true", PageCursor, {
3366
- query: query3,
3366
+ query,
3367
3367
  ...options,
3368
3368
  headers: buildHeaders([
3369
3369
  {
@@ -3565,9 +3565,9 @@ var init_dreams = __esm({
3565
3565
  * ```
3566
3566
  */
3567
3567
  list(params = {}, options) {
3568
- const { betas, workspace_id, ...query3 } = params ?? {};
3568
+ const { betas, workspace_id, ...query } = params ?? {};
3569
3569
  return this._client.getAPIList("/v1/dreams?beta=true", PageCursor, {
3570
- query: query3,
3570
+ query,
3571
3571
  ...options,
3572
3572
  headers: buildHeaders([
3573
3573
  {
@@ -3656,9 +3656,9 @@ function wasCreatedByStainlessHelper(value) {
3656
3656
  function collectStainlessHelpers(tools, messages) {
3657
3657
  const helpers = /* @__PURE__ */ new Set();
3658
3658
  if (tools) {
3659
- for (const tool2 of tools) {
3660
- if (wasCreatedByStainlessHelper(tool2)) {
3661
- helpers.add(tool2[SDK_HELPER_SYMBOL]);
3659
+ for (const tool of tools) {
3660
+ if (wasCreatedByStainlessHelper(tool)) {
3661
+ helpers.add(tool[SDK_HELPER_SYMBOL]);
3662
3662
  }
3663
3663
  }
3664
3664
  }
@@ -3727,9 +3727,9 @@ var init_files = __esm({
3727
3727
  * ```
3728
3728
  */
3729
3729
  list(params = {}, options) {
3730
- const { betas, workspace_id, ...query3 } = params ?? {};
3730
+ const { betas, workspace_id, ...query } = params ?? {};
3731
3731
  return this._client.getAPIList("/v1/files?beta=true", PageCursor, {
3732
- query: query3,
3732
+ query,
3733
3733
  ...options,
3734
3734
  headers: buildHeaders([
3735
3735
  {
@@ -3892,9 +3892,9 @@ var init_models = __esm({
3892
3892
  * ```
3893
3893
  */
3894
3894
  list(params = {}, options) {
3895
- const { betas, workspace_id, ...query3 } = params ?? {};
3895
+ const { betas, workspace_id, ...query } = params ?? {};
3896
3896
  return this._client.getAPIList("/v1/models?beta=true", Page, {
3897
- query: query3,
3897
+ query,
3898
3898
  ...options,
3899
3899
  headers: buildHeaders([
3900
3900
  {
@@ -4002,9 +4002,9 @@ var init_user_profiles = __esm({
4002
4002
  * ```
4003
4003
  */
4004
4004
  list(params = {}, options) {
4005
- const { betas, workspace_id, ...query3 } = params ?? {};
4005
+ const { betas, workspace_id, ...query } = params ?? {};
4006
4006
  return this._client.getAPIList("/v1/user_profiles?beta=true", PageCursor, {
4007
- query: query3,
4007
+ query,
4008
4008
  ...options,
4009
4009
  headers: buildHeaders([
4010
4010
  {
@@ -4888,9 +4888,9 @@ var init_versions = __esm({
4888
4888
  * ```
4889
4889
  */
4890
4890
  list(agentID, params = {}, options) {
4891
- const { betas, workspace_id, ...query3 } = params ?? {};
4891
+ const { betas, workspace_id, ...query } = params ?? {};
4892
4892
  return this._client.getAPIList(path2`/v1/agents/${agentID}/versions?beta=true`, PageCursor, {
4893
- query: query3,
4893
+ query,
4894
4894
  ...options,
4895
4895
  headers: buildHeaders([
4896
4896
  {
@@ -4959,9 +4959,9 @@ var init_agents = __esm({
4959
4959
  * ```
4960
4960
  */
4961
4961
  retrieve(agentID, params = {}, options) {
4962
- const { betas, workspace_id, ...query3 } = params ?? {};
4962
+ const { betas, workspace_id, ...query } = params ?? {};
4963
4963
  return this._client.get(path2`/v1/agents/${agentID}?beta=true`, {
4964
- query: query3,
4964
+ query,
4965
4965
  ...options,
4966
4966
  headers: buildHeaders([
4967
4967
  {
@@ -5010,9 +5010,9 @@ var init_agents = __esm({
5010
5010
  * ```
5011
5011
  */
5012
5012
  list(params = {}, options) {
5013
- const { betas, workspace_id, ...query3 } = params ?? {};
5013
+ const { betas, workspace_id, ...query } = params ?? {};
5014
5014
  return this._client.getAPIList("/v1/agents?beta=true", PageCursor, {
5015
- query: query3,
5015
+ query,
5016
5016
  ...options,
5017
5017
  headers: buildHeaders([
5018
5018
  {
@@ -5395,16 +5395,16 @@ var init_ToolError = __esm({
5395
5395
  });
5396
5396
 
5397
5397
  // ../../node_modules/.pnpm/@anthropic-ai+sdk@0.129.0_zod@4.5.4/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.mjs
5398
- function toolName(tool2) {
5399
- return "name" in tool2 ? tool2.name : "mcp_server_name" in tool2 ? tool2.mcp_server_name : tool2.type;
5398
+ function toolName(tool) {
5399
+ return "name" in tool ? tool.name : "mcp_server_name" in tool ? tool.mcp_server_name : tool.type;
5400
5400
  }
5401
5401
  function toolErrorContent(e2) {
5402
5402
  return e2 instanceof ToolError ? e2.content : `Error: ${e2 instanceof Error ? e2.message : String(e2)}`;
5403
5403
  }
5404
- async function runRunnableTool(tool2, rawInput, context) {
5404
+ async function runRunnableTool(tool, rawInput, context) {
5405
5405
  try {
5406
- const input = tool2.parse ? tool2.parse(rawInput) : rawInput;
5407
- const content = await tool2.run(input, context);
5406
+ const input = tool.parse ? tool.parse(rawInput) : rawInput;
5407
+ const content = await tool.run(input, context);
5408
5408
  return { content, isError: false };
5409
5409
  } catch (e2) {
5410
5410
  return { content: toolErrorContent(e2), isError: true };
@@ -5853,8 +5853,8 @@ var init_SessionToolRunner = __esm({
5853
5853
  });
5854
5854
  __classPrivateFieldSet(this, _SessionToolRunner_inFlightCount, (_a7 = __classPrivateFieldGet(this, _SessionToolRunner_inFlightCount, "f"), _a7++, _a7), "f");
5855
5855
  try {
5856
- const tool2 = __classPrivateFieldGet(this, _SessionToolRunner_toolByName, "f").get(ev.name);
5857
- if (!tool2) {
5856
+ const tool = __classPrivateFieldGet(this, _SessionToolRunner_toolByName, "f").get(ev.name);
5857
+ if (!tool) {
5858
5858
  __classPrivateFieldGet(this, _SessionToolRunner_logger, "f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner", {
5859
5859
  component: "session-tool-runner",
5860
5860
  session_id: this.sessionId,
@@ -5877,7 +5877,7 @@ var init_SessionToolRunner = __esm({
5877
5877
  const detachTool = linkAbort(__classPrivateFieldGet(this, _SessionToolRunner_controller, "f").signal, toolCtrl);
5878
5878
  const timer = setTimeout(() => toolCtrl.abort(), TOOL_TIMEOUT_MS);
5879
5879
  try {
5880
- const outcome = await runRunnableTool(tool2, ev.input, {
5880
+ const outcome = await runRunnableTool(tool, ev.input, {
5881
5881
  toolUse: ev,
5882
5882
  toolUseBlock: ev,
5883
5883
  signal: toolCtrl.signal
@@ -6503,8 +6503,8 @@ async function walk(base, visit) {
6503
6503
  }
6504
6504
  }
6505
6505
  }
6506
- function unchangedSinceHashed(cached, st) {
6507
- return st.mtimeNs === cached.mtimeNs && st.ctimeNs === cached.ctimeNs && st.size === cached.size;
6506
+ function unchangedSinceHashed(cached2, st) {
6507
+ return st.mtimeNs === cached2.mtimeNs && st.ctimeNs === cached2.ctimeNs && st.size === cached2.size;
6508
6508
  }
6509
6509
  function oldEnoughToCache(st, walkStartNs) {
6510
6510
  const newestNs = st.mtimeNs > st.ctimeNs ? st.mtimeNs : st.ctimeNs;
@@ -6735,10 +6735,10 @@ var init_file_store = __esm({
6735
6735
  }
6736
6736
  if (!st.isFile())
6737
6737
  return null;
6738
- const cached = this.hashes.get(rel);
6738
+ const cached2 = this.hashes.get(rel);
6739
6739
  let sha;
6740
- if (cached !== void 0 && unchangedSinceHashed(cached, st)) {
6741
- sha = cached.sha;
6740
+ if (cached2 !== void 0 && unchangedSinceHashed(cached2, st)) {
6741
+ sha = cached2.sha;
6742
6742
  } else {
6743
6743
  try {
6744
6744
  sha = await _internals.hashFile(full);
@@ -8724,9 +8724,9 @@ var init_work = __esm({
8724
8724
  * ```
8725
8725
  */
8726
8726
  list(environmentID, params = {}, options) {
8727
- const { betas, ...query3 } = params ?? {};
8727
+ const { betas, ...query } = params ?? {};
8728
8728
  return this._client.getAPIList(path2`/v1/environments/${environmentID}/work?beta=true`, PageCursor, {
8729
- query: query3,
8729
+ query,
8730
8730
  ...options,
8731
8731
  headers: buildHeaders([
8732
8732
  { "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() },
@@ -8805,9 +8805,9 @@ var init_work = __esm({
8805
8805
  * ```
8806
8806
  */
8807
8807
  poll(environmentID, params = {}, options) {
8808
- const { betas, "Anthropic-Worker-ID": anthropicWorkerID, ...query3 } = params ?? {};
8808
+ const { betas, "Anthropic-Worker-ID": anthropicWorkerID, ...query } = params ?? {};
8809
8809
  return this._client.get(path2`/v1/environments/${environmentID}/work/poll?beta=true`, {
8810
- query: query3,
8810
+ query,
8811
8811
  ...options,
8812
8812
  headers: buildHeaders([
8813
8813
  {
@@ -9004,9 +9004,9 @@ var init_environments = __esm({
9004
9004
  * ```
9005
9005
  */
9006
9006
  list(params = {}, options) {
9007
- const { betas, workspace_id, ...query3 } = params ?? {};
9007
+ const { betas, workspace_id, ...query } = params ?? {};
9008
9008
  return this._client.getAPIList("/v1/environments?beta=true", PageCursor, {
9009
- query: query3,
9009
+ query,
9010
9010
  ...options,
9011
9011
  headers: buildHeaders([
9012
9012
  {
@@ -9122,9 +9122,9 @@ var init_memories2 = __esm({
9122
9122
  * ```
9123
9123
  */
9124
9124
  retrieve(memoryID, params, options) {
9125
- const { memory_store_id, betas, workspace_id, ...query3 } = params;
9125
+ const { memory_store_id, betas, workspace_id, ...query } = params;
9126
9126
  return this._client.get(path2`/v1/memory_stores/${memory_store_id}/memories/${memoryID}?beta=true`, {
9127
- query: query3,
9127
+ query,
9128
9128
  ...options,
9129
9129
  headers: buildHeaders([
9130
9130
  {
@@ -9176,9 +9176,9 @@ var init_memories2 = __esm({
9176
9176
  * ```
9177
9177
  */
9178
9178
  list(memoryStoreID, params = {}, options) {
9179
- const { betas, workspace_id, ...query3 } = params ?? {};
9179
+ const { betas, workspace_id, ...query } = params ?? {};
9180
9180
  return this._client.getAPIList(path2`/v1/memory_stores/${memoryStoreID}/memories?beta=true`, PageCursor, {
9181
- query: query3,
9181
+ query,
9182
9182
  ...options,
9183
9183
  headers: buildHeaders([
9184
9184
  {
@@ -9241,9 +9241,9 @@ var init_memory_versions = __esm({
9241
9241
  * ```
9242
9242
  */
9243
9243
  retrieve(memoryVersionID, params, options) {
9244
- const { memory_store_id, betas, workspace_id, ...query3 } = params;
9244
+ const { memory_store_id, betas, workspace_id, ...query } = params;
9245
9245
  return this._client.get(path2`/v1/memory_stores/${memory_store_id}/memory_versions/${memoryVersionID}?beta=true`, {
9246
- query: query3,
9246
+ query,
9247
9247
  ...options,
9248
9248
  headers: buildHeaders([
9249
9249
  {
@@ -9268,9 +9268,9 @@ var init_memory_versions = __esm({
9268
9268
  * ```
9269
9269
  */
9270
9270
  list(memoryStoreID, params = {}, options) {
9271
- const { betas, workspace_id, ...query3 } = params ?? {};
9271
+ const { betas, workspace_id, ...query } = params ?? {};
9272
9272
  return this._client.getAPIList(path2`/v1/memory_stores/${memoryStoreID}/memory_versions?beta=true`, PageCursor, {
9273
- query: query3,
9273
+ query,
9274
9274
  ...options,
9275
9275
  headers: buildHeaders([
9276
9276
  {
@@ -9411,9 +9411,9 @@ var init_memory_stores = __esm({
9411
9411
  * ```
9412
9412
  */
9413
9413
  list(params = {}, options) {
9414
- const { betas, workspace_id, ...query3 } = params ?? {};
9414
+ const { betas, workspace_id, ...query } = params ?? {};
9415
9415
  return this._client.getAPIList("/v1/memory_stores?beta=true", PageCursor, {
9416
- query: query3,
9416
+ query,
9417
9417
  ...options,
9418
9418
  headers: buildHeaders([
9419
9419
  {
@@ -9626,9 +9626,9 @@ var init_batches = __esm({
9626
9626
  * ```
9627
9627
  */
9628
9628
  list(params = {}, options) {
9629
- const { betas, workspace_id, ...query3 } = params ?? {};
9629
+ const { betas, workspace_id, ...query } = params ?? {};
9630
9630
  return this._client.getAPIList("/v1/messages/batches?beta=true", Page, {
9631
- query: query3,
9631
+ query,
9632
9632
  ...options,
9633
9633
  headers: buildHeaders([
9634
9634
  {
@@ -10928,16 +10928,16 @@ async function generateToolResponse(runnable, available, lastMessage, requestOpt
10928
10928
  };
10929
10929
  }
10930
10930
  async function runToolCall(runnable, available, toolUse, requestOptions) {
10931
- const tool2 = available.has(toolUse.name) ? runnable.get(toolUse.name) : void 0;
10932
- if (!tool2) {
10931
+ const tool = available.has(toolUse.name) ? runnable.get(toolUse.name) : void 0;
10932
+ if (!tool) {
10933
10933
  return toolNotFoundResult(toolUse);
10934
10934
  }
10935
10935
  try {
10936
10936
  let input = toolUse.input;
10937
- if ("parse" in tool2 && tool2.parse) {
10938
- input = tool2.parse(input);
10937
+ if ("parse" in tool && tool.parse) {
10938
+ input = tool.parse(input);
10939
10939
  }
10940
- const result = await tool2.run(input, {
10940
+ const result = await tool.run(input, {
10941
10941
  toolUse,
10942
10942
  toolUseBlock: toolUse,
10943
10943
  signal: requestOptions?.signal
@@ -10985,12 +10985,12 @@ function applyToolReference(block, available) {
10985
10985
  available.add(name);
10986
10986
  }
10987
10987
  }
10988
- function changedToolName(tool2) {
10989
- switch (tool2.type) {
10988
+ function changedToolName(tool) {
10989
+ switch (tool.type) {
10990
10990
  case "tool_reference":
10991
- return tool2.name;
10991
+ return tool.name;
10992
10992
  case "tool_definition":
10993
- return "name" in tool2.definition ? tool2.definition.name : void 0;
10993
+ return "name" in tool.definition ? tool.definition.name : void 0;
10994
10994
  default:
10995
10995
  return void 0;
10996
10996
  }
@@ -11362,11 +11362,11 @@ var init_BetaToolRunner = __esm({
11362
11362
  * runner.addTools(queryDatabaseTool);
11363
11363
  */
11364
11364
  addTools(...tools) {
11365
- for (const tool2 of tools) {
11366
- if ("name" in tool2) {
11367
- __classPrivateFieldGet(this, _BetaToolRunner_toolOverrides, "f").set(tool2.name, "run" in tool2 ? tool2 : null);
11365
+ for (const tool of tools) {
11366
+ if ("name" in tool) {
11367
+ __classPrivateFieldGet(this, _BetaToolRunner_toolOverrides, "f").set(tool.name, "run" in tool ? tool : null);
11368
11368
  }
11369
- __classPrivateFieldGet(this, _BetaToolRunner_pendingToolChanges, "f").push({ type: "addition", tool: tool2 });
11369
+ __classPrivateFieldGet(this, _BetaToolRunner_pendingToolChanges, "f").push({ type: "addition", tool });
11370
11370
  }
11371
11371
  }
11372
11372
  /**
@@ -11384,8 +11384,8 @@ var init_BetaToolRunner = __esm({
11384
11384
  * runner.removeTools('query_database');
11385
11385
  */
11386
11386
  removeTools(...tools) {
11387
- for (const tool2 of tools) {
11388
- const name = typeof tool2 === "string" ? tool2 : tool2.name;
11387
+ for (const tool of tools) {
11388
+ const name = typeof tool === "string" ? tool : tool.name;
11389
11389
  __classPrivateFieldGet(this, _BetaToolRunner_toolOverrides, "f").set(name, null);
11390
11390
  __classPrivateFieldGet(this, _BetaToolRunner_pendingToolChanges, "f").push({ type: "removal", name });
11391
11391
  }
@@ -11454,14 +11454,14 @@ var init_BetaToolRunner = __esm({
11454
11454
  }
11455
11455
  }, _BetaToolRunner_runnableTools = function _BetaToolRunner_runnableTools2() {
11456
11456
  const runnable = /* @__PURE__ */ new Map();
11457
- for (const tool2 of __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.tools) {
11458
- if ("run" in tool2) {
11459
- runnable.set(tool2.name, tool2);
11457
+ for (const tool of __classPrivateFieldGet(this, _BetaToolRunner_state, "f").params.tools) {
11458
+ if ("run" in tool) {
11459
+ runnable.set(tool.name, tool);
11460
11460
  }
11461
11461
  }
11462
- for (const [name, tool2] of __classPrivateFieldGet(this, _BetaToolRunner_toolOverrides, "f")) {
11463
- if (tool2) {
11464
- runnable.set(name, tool2);
11462
+ for (const [name, tool] of __classPrivateFieldGet(this, _BetaToolRunner_toolOverrides, "f")) {
11463
+ if (tool) {
11464
+ runnable.set(name, tool);
11465
11465
  } else {
11466
11466
  runnable.delete(name);
11467
11467
  }
@@ -11731,9 +11731,9 @@ var init_api_keys = __esm({
11731
11731
  * }
11732
11732
  * ```
11733
11733
  */
11734
- list(query3 = {}, options) {
11734
+ list(query = {}, options) {
11735
11735
  return this._client.getAPIList("/v1/organizations/api_keys?beta=true", Page, {
11736
- query: query3,
11736
+ query,
11737
11737
  ...options
11738
11738
  });
11739
11739
  }
@@ -11869,9 +11869,9 @@ var init_external_keys = __esm({
11869
11869
  * }
11870
11870
  * ```
11871
11871
  */
11872
- list(query3 = {}, options) {
11872
+ list(query = {}, options) {
11873
11873
  return this._client.getAPIList("/v1/organizations/external_keys?beta=true", PageCursor, {
11874
- query: query3,
11874
+ query,
11875
11875
  ...options
11876
11876
  });
11877
11877
  }
@@ -11967,9 +11967,9 @@ var init_invites = __esm({
11967
11967
  * }
11968
11968
  * ```
11969
11969
  */
11970
- list(query3 = {}, options) {
11970
+ list(query = {}, options) {
11971
11971
  return this._client.getAPIList("/v1/organizations/invites?beta=true", Page, {
11972
- query: query3,
11972
+ query,
11973
11973
  ...options
11974
11974
  });
11975
11975
  }
@@ -12016,8 +12016,8 @@ var init_rate_limits = __esm({
12016
12016
  * }
12017
12017
  * ```
12018
12018
  */
12019
- list(query3 = {}, options) {
12020
- return this._client.getAPIList("/v1/organizations/rate_limits?beta=true", PageCursor, { query: query3, ...options });
12019
+ list(query = {}, options) {
12020
+ return this._client.getAPIList("/v1/organizations/rate_limits?beta=true", PageCursor, { query, ...options });
12021
12021
  }
12022
12022
  };
12023
12023
  }
@@ -12068,9 +12068,9 @@ var init_users = __esm({
12068
12068
  * }
12069
12069
  * ```
12070
12070
  */
12071
- list(query3 = {}, options) {
12071
+ list(query = {}, options) {
12072
12072
  return this._client.getAPIList("/v1/organizations/users?beta=true", Page, {
12073
- query: query3,
12073
+ query,
12074
12074
  ...options
12075
12075
  });
12076
12076
  }
@@ -12216,9 +12216,9 @@ var init_issuers = __esm({
12216
12216
  * ```
12217
12217
  */
12218
12218
  list(params = {}, options) {
12219
- const { betas, ...query3 } = params ?? {};
12219
+ const { betas, ...query } = params ?? {};
12220
12220
  return this._client.getAPIList("/v1/organizations/federation_issuers?beta=true", PageCursor, {
12221
- query: query3,
12221
+ query,
12222
12222
  ...options,
12223
12223
  headers: buildHeaders([
12224
12224
  { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 },
@@ -12295,9 +12295,9 @@ var init_workspaces = __esm({
12295
12295
  * ```
12296
12296
  */
12297
12297
  list(federationRuleID, params = {}, options) {
12298
- const { betas, ...query3 } = params ?? {};
12298
+ const { betas, ...query } = params ?? {};
12299
12299
  return this._client.getAPIList(path2`/v1/organizations/federation_rules/${federationRuleID}/workspaces?beta=true`, PageCursor, {
12300
- query: query3,
12300
+ query,
12301
12301
  ...options,
12302
12302
  headers: buildHeaders([
12303
12303
  { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 },
@@ -12527,9 +12527,9 @@ var init_rules = __esm({
12527
12527
  * ```
12528
12528
  */
12529
12529
  list(params = {}, options) {
12530
- const { betas, ...query3 } = params ?? {};
12530
+ const { betas, ...query } = params ?? {};
12531
12531
  return this._client.getAPIList("/v1/organizations/federation_rules?beta=true", PageCursor, {
12532
- query: query3,
12532
+ query,
12533
12533
  ...options,
12534
12534
  headers: buildHeaders([
12535
12535
  { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 },
@@ -12641,9 +12641,9 @@ var init_workspaces2 = __esm({
12641
12641
  * ```
12642
12642
  */
12643
12643
  list(serviceAccountID, params = {}, options) {
12644
- const { betas, ...query3 } = params ?? {};
12644
+ const { betas, ...query } = params ?? {};
12645
12645
  return this._client.getAPIList(path2`/v1/organizations/service_accounts/${serviceAccountID}/workspaces?beta=true`, PageCursor, {
12646
- query: query3,
12646
+ query,
12647
12647
  ...options,
12648
12648
  headers: buildHeaders([
12649
12649
  { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 },
@@ -12856,9 +12856,9 @@ var init_service_accounts = __esm({
12856
12856
  * ```
12857
12857
  */
12858
12858
  list(params = {}, options) {
12859
- const { betas, ...query3 } = params ?? {};
12859
+ const { betas, ...query } = params ?? {};
12860
12860
  return this._client.getAPIList("/v1/organizations/service_accounts?beta=true", PageCursor, {
12861
- query: query3,
12861
+ query,
12862
12862
  ...options,
12863
12863
  headers: buildHeaders([
12864
12864
  { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 },
@@ -12963,8 +12963,8 @@ var init_members = __esm({
12963
12963
  * }
12964
12964
  * ```
12965
12965
  */
12966
- list(workspaceID, query3 = {}, options) {
12967
- return this._client.getAPIList(path2`/v1/organizations/workspaces/${workspaceID}/members?beta=true`, Page, { query: query3, ...options });
12966
+ list(workspaceID, query = {}, options) {
12967
+ return this._client.getAPIList(path2`/v1/organizations/workspaces/${workspaceID}/members?beta=true`, Page, { query, ...options });
12968
12968
  }
12969
12969
  /**
12970
12970
  * Create Workspace Member
@@ -13037,8 +13037,8 @@ var init_rate_limits2 = __esm({
13037
13037
  * }
13038
13038
  * ```
13039
13039
  */
13040
- list(workspaceID, query3 = {}, options) {
13041
- return this._client.getAPIList(path2`/v1/organizations/workspaces/${workspaceID}/rate_limits?beta=true`, PageCursor, { query: query3, ...options });
13040
+ list(workspaceID, query = {}, options) {
13041
+ return this._client.getAPIList(path2`/v1/organizations/workspaces/${workspaceID}/rate_limits?beta=true`, PageCursor, { query, ...options });
13042
13042
  }
13043
13043
  };
13044
13044
  }
@@ -13148,9 +13148,9 @@ var init_service_accounts2 = __esm({
13148
13148
  * ```
13149
13149
  */
13150
13150
  list(workspaceID, params = {}, options) {
13151
- const { betas, ...query3 } = params ?? {};
13151
+ const { betas, ...query } = params ?? {};
13152
13152
  return this._client.getAPIList(path2`/v1/organizations/workspaces/${workspaceID}/service_accounts?beta=true`, PageCursor, {
13153
- query: query3,
13153
+ query,
13154
13154
  ...options,
13155
13155
  headers: buildHeaders([
13156
13156
  { ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 },
@@ -13320,9 +13320,9 @@ var init_workspaces3 = __esm({
13320
13320
  * }
13321
13321
  * ```
13322
13322
  */
13323
- list(query3 = {}, options) {
13323
+ list(query = {}, options) {
13324
13324
  return this._client.getAPIList("/v1/organizations/workspaces?beta=true", Page, {
13325
- query: query3,
13325
+ query,
13326
13326
  ...options
13327
13327
  });
13328
13328
  }
@@ -13439,9 +13439,9 @@ var init_events = __esm({
13439
13439
  * ```
13440
13440
  */
13441
13441
  list(sessionID, params = {}, options) {
13442
- const { betas, workspace_id, ...query3 } = params ?? {};
13442
+ const { betas, workspace_id, ...query } = params ?? {};
13443
13443
  return this._client.getAPIList(path2`/v1/sessions/${sessionID}/events?beta=true`, PageCursor, {
13444
- query: query3,
13444
+ query,
13445
13445
  ...options,
13446
13446
  headers: buildHeaders([
13447
13447
  {
@@ -13502,9 +13502,9 @@ var init_events = __esm({
13502
13502
  * ```
13503
13503
  */
13504
13504
  stream(sessionID, params = {}, options) {
13505
- const { betas, workspace_id, ...query3 } = params ?? {};
13505
+ const { betas, workspace_id, ...query } = params ?? {};
13506
13506
  return this._client.get(path2`/v1/sessions/${sessionID}/events/stream?beta=true`, {
13507
- query: query3,
13507
+ query,
13508
13508
  ...options,
13509
13509
  headers: buildHeaders([
13510
13510
  {
@@ -13622,9 +13622,9 @@ var init_resources = __esm({
13622
13622
  * ```
13623
13623
  */
13624
13624
  list(sessionID, params = {}, options) {
13625
- const { betas, workspace_id, ...query3 } = params ?? {};
13625
+ const { betas, workspace_id, ...query } = params ?? {};
13626
13626
  return this._client.getAPIList(path2`/v1/sessions/${sessionID}/resources?beta=true`, PageCursor, {
13627
- query: query3,
13627
+ query,
13628
13628
  ...options,
13629
13629
  headers: buildHeaders([
13630
13630
  {
@@ -13717,9 +13717,9 @@ var init_events2 = __esm({
13717
13717
  * ```
13718
13718
  */
13719
13719
  list(threadID, params, options) {
13720
- const { session_id, betas, workspace_id, ...query3 } = params;
13720
+ const { session_id, betas, workspace_id, ...query } = params;
13721
13721
  return this._client.getAPIList(path2`/v1/sessions/${session_id}/threads/${threadID}/events?beta=true`, PageCursor, {
13722
- query: query3,
13722
+ query,
13723
13723
  ...options,
13724
13724
  headers: buildHeaders([
13725
13725
  {
@@ -13743,9 +13743,9 @@ var init_events2 = __esm({
13743
13743
  * ```
13744
13744
  */
13745
13745
  stream(threadID, params, options) {
13746
- const { session_id, betas, workspace_id, ...query3 } = params;
13746
+ const { session_id, betas, workspace_id, ...query } = params;
13747
13747
  return this._client.get(path2`/v1/sessions/${session_id}/threads/${threadID}/stream?beta=true`, {
13748
- query: query3,
13748
+ query,
13749
13749
  ...options,
13750
13750
  headers: buildHeaders([
13751
13751
  {
@@ -13816,9 +13816,9 @@ var init_threads = __esm({
13816
13816
  * ```
13817
13817
  */
13818
13818
  list(sessionID, params = {}, options) {
13819
- const { betas, workspace_id, ...query3 } = params ?? {};
13819
+ const { betas, workspace_id, ...query } = params ?? {};
13820
13820
  return this._client.getAPIList(path2`/v1/sessions/${sessionID}/threads?beta=true`, PageCursor, {
13821
- query: query3,
13821
+ query,
13822
13822
  ...options,
13823
13823
  headers: buildHeaders([
13824
13824
  {
@@ -13970,9 +13970,9 @@ var init_sessions = __esm({
13970
13970
  * ```
13971
13971
  */
13972
13972
  list(params = {}, options) {
13973
- const { betas, workspace_id, ...query3 } = params ?? {};
13973
+ const { betas, workspace_id, ...query } = params ?? {};
13974
13974
  return this._client.getAPIList("/v1/sessions?beta=true", BidirectionalPageCursor, {
13975
- query: query3,
13975
+ query,
13976
13976
  ...options,
13977
13977
  headers: buildHeaders([
13978
13978
  {
@@ -14113,9 +14113,9 @@ var init_versions2 = __esm({
14113
14113
  * ```
14114
14114
  */
14115
14115
  list(skillID, params = {}, options) {
14116
- const { betas, workspace_id, ...query3 } = params ?? {};
14116
+ const { betas, workspace_id, ...query } = params ?? {};
14117
14117
  return this._client.getAPIList(path2`/v1/skills/${skillID}/versions?beta=true`, PageCursor, {
14118
- query: query3,
14118
+ query,
14119
14119
  ...options,
14120
14120
  headers: buildHeaders([
14121
14121
  {
@@ -14259,9 +14259,9 @@ var init_skills2 = __esm({
14259
14259
  * ```
14260
14260
  */
14261
14261
  list(params = {}, options) {
14262
- const { betas, workspace_id, ...query3 } = params ?? {};
14262
+ const { betas, workspace_id, ...query } = params ?? {};
14263
14263
  return this._client.getAPIList("/v1/skills?beta=true", PageCursor, {
14264
- query: query3,
14264
+ query,
14265
14265
  ...options,
14266
14266
  headers: buildHeaders([
14267
14267
  {
@@ -14394,9 +14394,9 @@ var init_certificates = __esm({
14394
14394
  * ```
14395
14395
  */
14396
14396
  list(tunnelID, params = {}, options) {
14397
- const { betas, workspace_id, ...query3 } = params ?? {};
14397
+ const { betas, workspace_id, ...query } = params ?? {};
14398
14398
  return this._client.getAPIList(path2`/v1/tunnels/${tunnelID}/certificates?beta=true`, PageCursor, {
14399
- query: query3,
14399
+ query,
14400
14400
  ...options,
14401
14401
  headers: buildHeaders([
14402
14402
  {
@@ -14535,9 +14535,9 @@ var init_tunnels = __esm({
14535
14535
  * ```
14536
14536
  */
14537
14537
  list(params = {}, options) {
14538
- const { betas, workspace_id, ...query3 } = params ?? {};
14538
+ const { betas, workspace_id, ...query } = params ?? {};
14539
14539
  return this._client.getAPIList("/v1/tunnels?beta=true", PageCursor, {
14540
- query: query3,
14540
+ query,
14541
14541
  ...options,
14542
14542
  headers: buildHeaders([
14543
14543
  {
@@ -14753,9 +14753,9 @@ var init_credentials2 = __esm({
14753
14753
  * ```
14754
14754
  */
14755
14755
  list(vaultID, params = {}, options) {
14756
- const { betas, workspace_id, ...query3 } = params ?? {};
14756
+ const { betas, workspace_id, ...query } = params ?? {};
14757
14757
  return this._client.getAPIList(path2`/v1/vaults/${vaultID}/credentials?beta=true`, PageCursor, {
14758
- query: query3,
14758
+ query,
14759
14759
  ...options,
14760
14760
  headers: buildHeaders([
14761
14761
  {
@@ -14947,9 +14947,9 @@ var init_vaults = __esm({
14947
14947
  * ```
14948
14948
  */
14949
14949
  list(params = {}, options) {
14950
- const { betas, workspace_id, ...query3 } = params ?? {};
14950
+ const { betas, workspace_id, ...query } = params ?? {};
14951
14951
  return this._client.getAPIList("/v1/vaults?beta=true", PageCursor, {
14952
- query: query3,
14952
+ query,
14953
14953
  ...options,
14954
14954
  headers: buildHeaders([
14955
14955
  {
@@ -15145,9 +15145,9 @@ var init_files2 = __esm({
15145
15145
  * ```
15146
15146
  */
15147
15147
  list(params = {}, options) {
15148
- const { workspace_id, ...query3 } = params ?? {};
15148
+ const { workspace_id, ...query } = params ?? {};
15149
15149
  return this._client.getAPIList("/v1/files", PageCursor, {
15150
- query: query3,
15150
+ query,
15151
15151
  ...options,
15152
15152
  headers: buildHeaders([
15153
15153
  { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 },
@@ -15996,9 +15996,9 @@ var init_batches2 = __esm({
15996
15996
  * ```
15997
15997
  */
15998
15998
  list(params = {}, options) {
15999
- const { workspace_id, ...query3 } = params ?? {};
15999
+ const { workspace_id, ...query } = params ?? {};
16000
16000
  return this._client.getAPIList("/v1/messages/batches", Page, {
16001
- query: query3,
16001
+ query,
16002
16002
  ...options,
16003
16003
  headers: buildHeaders([
16004
16004
  { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 },
@@ -16283,9 +16283,9 @@ var init_models2 = __esm({
16283
16283
  * ```
16284
16284
  */
16285
16285
  list(params = {}, options) {
16286
- const { betas, workspace_id, ...query3 } = params ?? {};
16286
+ const { betas, workspace_id, ...query } = params ?? {};
16287
16287
  return this._client.getAPIList("/v1/models", Page, {
16288
- query: query3,
16288
+ query,
16289
16289
  ...options,
16290
16290
  headers: buildHeaders([
16291
16291
  {
@@ -16367,9 +16367,9 @@ var init_versions3 = __esm({
16367
16367
  * ```
16368
16368
  */
16369
16369
  list(skillID, params = {}, options) {
16370
- const { workspace_id, ...query3 } = params ?? {};
16370
+ const { workspace_id, ...query } = params ?? {};
16371
16371
  return this._client.getAPIList(path2`/v1/skills/${skillID}/versions`, PageCursor, {
16372
- query: query3,
16372
+ query,
16373
16373
  ...options,
16374
16374
  headers: buildHeaders([
16375
16375
  { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 },
@@ -16470,9 +16470,9 @@ var init_skills3 = __esm({
16470
16470
  * ```
16471
16471
  */
16472
16472
  list(params = {}, options) {
16473
- const { workspace_id, ...query3 } = params ?? {};
16473
+ const { workspace_id, ...query } = params ?? {};
16474
16474
  return this._client.getAPIList("/v1/skills", PageCursor, {
16475
- query: query3,
16475
+ query,
16476
16476
  ...options,
16477
16477
  headers: buildHeaders([
16478
16478
  { ...workspace_id != null ? { "anthropic-workspace-id": workspace_id } : void 0 },
@@ -16856,8 +16856,8 @@ var init_client = __esm({
16856
16856
  }
16857
16857
  return buildHeaders([{ Authorization: `Bearer ${this.authToken}` }]);
16858
16858
  }
16859
- stringifyQuery(query3) {
16860
- return stringifyQuery(query3);
16859
+ stringifyQuery(query) {
16860
+ return stringifyQuery(query);
16861
16861
  }
16862
16862
  getUserAgent() {
16863
16863
  return `Anthropic/JS ${VERSION}`;
@@ -16865,16 +16865,16 @@ var init_client = __esm({
16865
16865
  makeStatusError(status, error, message, headers) {
16866
16866
  return APIError.generate(status, error, message, headers);
16867
16867
  }
16868
- buildURL(path6, query3, defaultBaseURL) {
16868
+ buildURL(path6, query, defaultBaseURL) {
16869
16869
  const baseURL = !__classPrivateFieldGet(this, _BaseAnthropic_instances, "m", _BaseAnthropic_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL;
16870
16870
  const url = isAbsoluteURL(path6) ? new URL(path6) : new URL(baseURL + (baseURL.endsWith("/") && path6.startsWith("/") ? path6.slice(1) : path6));
16871
16871
  const defaultQuery = this.defaultQuery();
16872
16872
  const pathQuery = Object.fromEntries(url.searchParams);
16873
16873
  if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
16874
- query3 = { ...pathQuery, ...defaultQuery, ...query3 };
16874
+ query = { ...pathQuery, ...defaultQuery, ...query };
16875
16875
  }
16876
- if (typeof query3 === "object" && query3 && !Array.isArray(query3)) {
16877
- url.search = this.stringifyQuery(query3);
16876
+ if (typeof query === "object" && query && !Array.isArray(query)) {
16877
+ url.search = this.stringifyQuery(query);
16878
16878
  }
16879
16879
  return url.toString();
16880
16880
  }
@@ -17196,14 +17196,14 @@ var init_client = __esm({
17196
17196
  }
17197
17197
  async buildRequest(inputOptions, { retryCount = 0 } = {}) {
17198
17198
  const options = { ...inputOptions };
17199
- const { method, path: path6, query: query3, defaultBaseURL } = options;
17199
+ const { method, path: path6, query, defaultBaseURL } = options;
17200
17200
  if (this._authState.resolution) {
17201
17201
  await this._authState.resolution;
17202
17202
  }
17203
17203
  if (!this._baseURLIsExplicit && this._authState.baseURL && this.baseURL !== this._authState.baseURL) {
17204
17204
  this.baseURL = this._authState.baseURL;
17205
17205
  }
17206
- const url = this.buildURL(path6, query3, defaultBaseURL);
17206
+ const url = this.buildURL(path6, query, defaultBaseURL);
17207
17207
  if ("timeout" in options)
17208
17208
  validatePositiveInteger("timeout", options.timeout);
17209
17209
  options.timeout = options.timeout ?? this.timeout;
@@ -17346,8 +17346,8 @@ function getBunSandboxEnvValue(name) {
17346
17346
  if (procEnvCache === null) {
17347
17347
  procEnvCache = /* @__PURE__ */ new Map();
17348
17348
  try {
17349
- const { readFileSync: readFileSync9 } = __require("node:fs");
17350
- const data = readFileSync9("/proc/self/environ", "utf-8");
17349
+ const { readFileSync: readFileSync11 } = __require("node:fs");
17350
+ const data = readFileSync11("/proc/self/environ", "utf-8");
17351
17351
  for (const entry of data.split("\0")) {
17352
17352
  const idx = entry.indexOf("=");
17353
17353
  if (idx > 0) {
@@ -17861,10 +17861,10 @@ function getCurrentTools(messages) {
17861
17861
  for (const message of messages) {
17862
17862
  if (!isSystemMessage(message))
17863
17863
  continue;
17864
- for (const tool2 of message.toolsRemoved ?? [])
17865
- tools.delete(tool2.name);
17866
- for (const tool2 of message.toolsAdded ?? [])
17867
- tools.set(tool2.name, tool2);
17864
+ for (const tool of message.toolsRemoved ?? [])
17865
+ tools.delete(tool.name);
17866
+ for (const tool of message.toolsAdded ?? [])
17867
+ tools.set(tool.name, tool);
17868
17868
  }
17869
17869
  return [...tools.values()];
17870
17870
  }
@@ -17910,8 +17910,8 @@ function getDeclaredTools(messages) {
17910
17910
  for (const message of messages) {
17911
17911
  if (!isSystemMessage(message))
17912
17912
  continue;
17913
- for (const tool2 of message.toolsAdded ?? [])
17914
- definitions.set(tool2.name, tool2);
17913
+ for (const tool of message.toolsAdded ?? [])
17914
+ definitions.set(tool.name, tool);
17915
17915
  }
17916
17916
  return [...definitions.values()];
17917
17917
  }
@@ -17922,10 +17922,10 @@ function hasNonAdditiveToolChanges(messages) {
17922
17922
  continue;
17923
17923
  if ((message.toolsRemoved?.length ?? 0) > 0)
17924
17924
  return true;
17925
- for (const tool2 of message.toolsAdded ?? []) {
17926
- if (declared.has(tool2.name))
17925
+ for (const tool of message.toolsAdded ?? []) {
17926
+ if (declared.has(tool.name))
17927
17927
  return true;
17928
- declared.add(tool2.name);
17928
+ declared.add(tool.name);
17929
17929
  }
17930
17930
  }
17931
17931
  return false;
@@ -19175,8 +19175,8 @@ function makeStrictJsonSchema(schema, isUnsupportedKeyword) {
19175
19175
  }
19176
19176
  return cloned;
19177
19177
  }
19178
- function getJsonSchemaToolParameters(tool2, strict) {
19179
- return strict === true ? makeStrictJsonSchema(tool2.parameters) : tool2.parameters;
19178
+ function getJsonSchemaToolParameters(tool, strict) {
19179
+ return strict === true ? makeStrictJsonSchema(tool.parameters) : tool.parameters;
19180
19180
  }
19181
19181
  function getGrammarToolInput(toolName2, arguments_, inputProperty) {
19182
19182
  const input = arguments_[inputProperty];
@@ -19210,8 +19210,8 @@ function appendGrammarToolInputJsonDelta(buffer, inputProperty, nextInput, close
19210
19210
  }
19211
19211
  return delta;
19212
19212
  }
19213
- function inferGrammarInputProperty(tool2) {
19214
- const schema = tool2.parameters;
19213
+ function inferGrammarInputProperty(tool) {
19214
+ const schema = tool.parameters;
19215
19215
  if (schema.type !== "object") {
19216
19216
  throw new Error("grammar constrained sampling requires an object parameter schema");
19217
19217
  }
@@ -19227,29 +19227,29 @@ function inferGrammarInputProperty(tool2) {
19227
19227
  }
19228
19228
  return inputProperty;
19229
19229
  }
19230
- function resolveJsonSchemaStrictSampling(tool2, supportsStrictMode, isUnsupportedKeyword) {
19231
- const config = tool2.constrainedSampling;
19230
+ function resolveJsonSchemaStrictSampling(tool, supportsStrictMode, isUnsupportedKeyword) {
19231
+ const config = tool.constrainedSampling;
19232
19232
  if (!config || config.type !== "json_schema")
19233
19233
  return void 0;
19234
19234
  if (supportsStrictMode) {
19235
19235
  try {
19236
- makeStrictJsonSchema(tool2.parameters, isUnsupportedKeyword);
19236
+ makeStrictJsonSchema(tool.parameters, isUnsupportedKeyword);
19237
19237
  return true;
19238
19238
  } catch (error) {
19239
19239
  if (!(error instanceof UnsupportedStrictJsonSchemaError))
19240
19240
  throw error;
19241
19241
  if (config.strict !== "require")
19242
19242
  return void 0;
19243
- throw new Error(`Tool "${tool2.name}" requires JSON-schema constrained sampling, but ${error.message}.`);
19243
+ throw new Error(`Tool "${tool.name}" requires JSON-schema constrained sampling, but ${error.message}.`);
19244
19244
  }
19245
19245
  }
19246
19246
  if (config.strict === "require") {
19247
- throw new Error(`Tool "${tool2.name}" requires JSON-schema constrained sampling, but strict tools are unsupported.`);
19247
+ throw new Error(`Tool "${tool.name}" requires JSON-schema constrained sampling, but strict tools are unsupported.`);
19248
19248
  }
19249
19249
  return void 0;
19250
19250
  }
19251
- function resolveGrammarConstrainedSampling(tool2, supportsOpenAIGrammarTools) {
19252
- const config = tool2.constrainedSampling;
19251
+ function resolveGrammarConstrainedSampling(tool, supportsOpenAIGrammarTools) {
19252
+ const config = tool.constrainedSampling;
19253
19253
  if (!config || config.type !== "grammar") {
19254
19254
  return void 0;
19255
19255
  }
@@ -19261,25 +19261,25 @@ function resolveGrammarConstrainedSampling(tool2, supportsOpenAIGrammarTools) {
19261
19261
  const hasLarkDefinition = typeof larkDefinition === "string" && larkDefinition.trim().length > 0;
19262
19262
  const hasRegexDefinition = typeof regexDefinition === "string" && regexDefinition.trim().length > 0;
19263
19263
  if (!hasLarkDefinition && !hasRegexDefinition) {
19264
- throw new Error(`Tool "${tool2.name}" cannot use grammar constrained sampling: no supported grammar variant was provided.`);
19264
+ throw new Error(`Tool "${tool.name}" cannot use grammar constrained sampling: no supported grammar variant was provided.`);
19265
19265
  }
19266
19266
  try {
19267
19267
  return {
19268
19268
  format: hasLarkDefinition ? "lark" : "regex",
19269
19269
  definition: hasLarkDefinition ? larkDefinition : regexDefinition,
19270
- inputProperty: inferGrammarInputProperty(tool2)
19270
+ inputProperty: inferGrammarInputProperty(tool)
19271
19271
  };
19272
19272
  } catch (error) {
19273
19273
  const message = error instanceof Error ? error.message : String(error);
19274
- throw new Error(`Tool "${tool2.name}" cannot use grammar constrained sampling: ${message}.`);
19274
+ throw new Error(`Tool "${tool.name}" cannot use grammar constrained sampling: ${message}.`);
19275
19275
  }
19276
19276
  }
19277
19277
  function createGrammarToolInputProperties(tools, supportsOpenAIGrammarTools) {
19278
19278
  const properties = /* @__PURE__ */ new Map();
19279
- for (const tool2 of tools ?? []) {
19280
- const grammar = resolveGrammarConstrainedSampling(tool2, supportsOpenAIGrammarTools);
19279
+ for (const tool of tools ?? []) {
19280
+ const grammar = resolveGrammarConstrainedSampling(tool, supportsOpenAIGrammarTools);
19281
19281
  if (grammar) {
19282
- properties.set(tool2.name, grammar.inputProperty);
19282
+ properties.set(tool.name, grammar.inputProperty);
19283
19283
  }
19284
19284
  }
19285
19285
  return properties;
@@ -20183,13 +20183,13 @@ function convertMessages(transformedMessages, isOAuthToken2, cacheControl, allow
20183
20183
  blocks.push({ type: "text", text: sanitizeSurrogates(text) });
20184
20184
  if (convertToolDefinitions) {
20185
20185
  const added = msg.toolsAdded ?? [];
20186
- const redefined = new Set(added.map((tool2) => tool2.name));
20187
- for (const tool2 of msg.toolsRemoved ?? []) {
20188
- if (redefined.has(tool2.name))
20186
+ const redefined = new Set(added.map((tool) => tool.name));
20187
+ for (const tool of msg.toolsRemoved ?? []) {
20188
+ if (redefined.has(tool.name))
20189
20189
  continue;
20190
20190
  blocks.push({
20191
20191
  type: "tool_removal",
20192
- tool: { type: "tool_reference", name: isOAuthToken2 ? toClaudeCodeName(tool2.name) : tool2.name }
20192
+ tool: { type: "tool_reference", name: isOAuthToken2 ? toClaudeCodeName(tool.name) : tool.name }
20193
20193
  });
20194
20194
  }
20195
20195
  for (const definition of convertToolDefinitions(added)) {
@@ -20352,9 +20352,9 @@ function shouldUseFineGrainedToolStreamingBeta(model, context) {
20352
20352
  function convertTools(tools, isOAuthToken2, supportsEagerToolInputStreaming, supportsStrictTools, cacheControl) {
20353
20353
  if (!tools)
20354
20354
  return [];
20355
- return tools.map((tool2, index) => {
20356
- const strict = resolveJsonSchemaStrictSampling(tool2, supportsStrictTools, isAnthropicStrictUnsupportedKeyword);
20357
- const parameters = getJsonSchemaToolParameters(tool2, strict);
20355
+ return tools.map((tool, index) => {
20356
+ const strict = resolveJsonSchemaStrictSampling(tool, supportsStrictTools, isAnthropicStrictUnsupportedKeyword);
20357
+ const parameters = getJsonSchemaToolParameters(tool, strict);
20358
20358
  const schema = parameters;
20359
20359
  const legacyInputSchema = {
20360
20360
  type: "object",
@@ -20366,8 +20366,8 @@ function convertTools(tools, isOAuthToken2, supportsEagerToolInputStreaming, sup
20366
20366
  ...legacyInputSchema
20367
20367
  } : legacyInputSchema;
20368
20368
  return {
20369
- name: isOAuthToken2 ? toClaudeCodeName(tool2.name) : tool2.name,
20370
- description: tool2.description,
20369
+ name: isOAuthToken2 ? toClaudeCodeName(tool.name) : tool.name,
20370
+ description: tool.description,
20371
20371
  ...supportsEagerToolInputStreaming ? { eager_input_streaming: true } : {},
20372
20372
  ...strict === true ? { strict: true } : {},
20373
20373
  input_schema: inputSchema,
@@ -20444,7 +20444,7 @@ var init_anthropic_messages = __esm({
20444
20444
  fromClaudeCodeName = (name, tools) => {
20445
20445
  if (tools && tools.length > 0) {
20446
20446
  const lowerName = name.toLowerCase();
20447
- const matchedTool = tools.find((tool2) => tool2.name.toLowerCase() === lowerName);
20447
+ const matchedTool = tools.find((tool) => tool.name.toLowerCase() === lowerName);
20448
20448
  if (matchedTool)
20449
20449
  return matchedTool.name;
20450
20450
  }
@@ -22894,8 +22894,8 @@ var init_stringify2 = __esm({
22894
22894
  });
22895
22895
 
22896
22896
  // ../../node_modules/.pnpm/openai@7.19.0_@aws-sdk+credential-provider-node@3.972.84_@smithy+signature-v4@5.7.4_undici@8.10.2_ws@8.21.3_zod@4.5.4/node_modules/openai/internal/utils/query.mjs
22897
- function stringifyQuery2(query3) {
22898
- return stringify2(query3, { arrayFormat: "brackets" });
22897
+ function stringifyQuery2(query) {
22898
+ return stringify2(query, { arrayFormat: "brackets" });
22899
22899
  }
22900
22900
  var init_query2 = __esm({
22901
22901
  "../../node_modules/.pnpm/openai@7.19.0_@aws-sdk+credential-provider-node@3.972.84_@smithy+signature-v4@5.7.4_undici@8.10.2_ws@8.21.3_zod@4.5.4/node_modules/openai/internal/utils/query.mjs"() {
@@ -24093,9 +24093,9 @@ var init_x509_workload_identity_auth = __esm({
24093
24093
  }
24094
24094
  __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_preflight).call(this, context);
24095
24095
  const scope = options ? __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_scope).call(this) : void 0;
24096
- const cached = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_cachedToken, "f");
24097
- if (cached && performance.now() < cached.refreshAt && Date.now() < cached.wallRefreshAt) {
24098
- return __classPrivateFieldGet2(_a2, _a2, "m", _X509WorkloadIdentityAuth_assignToken).call(_a2, scope, cached);
24096
+ const cached2 = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_cachedToken, "f");
24097
+ if (cached2 && performance.now() < cached2.refreshAt && Date.now() < cached2.wallRefreshAt) {
24098
+ return __classPrivateFieldGet2(_a2, _a2, "m", _X509WorkloadIdentityAuth_assignToken).call(_a2, scope, cached2);
24099
24099
  }
24100
24100
  const remaining = context && options ? this.remainingTimeout(options, context.timeout) : context?.timeout;
24101
24101
  const { signal, dispose } = exchangeDeadline(remaining, callerSignal);
@@ -24114,7 +24114,7 @@ var init_x509_workload_identity_auth = __esm({
24114
24114
  }
24115
24115
  return __classPrivateFieldGet2(_a2, _a2, "m", _X509WorkloadIdentityAuth_assignToken).call(_a2, scope, refreshed);
24116
24116
  } catch (error) {
24117
- return await __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_recoverRefreshFailure).call(this, error, attempt, cached, scope, options, context);
24117
+ return await __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_recoverRefreshFailure).call(this, error, attempt, cached2, scope, options, context);
24118
24118
  } finally {
24119
24119
  waiter.dispose();
24120
24120
  dispose();
@@ -24207,7 +24207,7 @@ var init_x509_workload_identity_auth = __esm({
24207
24207
  scope.tokenGeneration = token.generation;
24208
24208
  }
24209
24209
  return token.accessToken;
24210
- }, _X509WorkloadIdentityAuth_recoverRefreshFailure = async function _X509WorkloadIdentityAuth_recoverRefreshFailure2(error, attempt, cached, scope, options, context) {
24210
+ }, _X509WorkloadIdentityAuth_recoverRefreshFailure = async function _X509WorkloadIdentityAuth_recoverRefreshFailure2(error, attempt, cached2, scope, options, context) {
24211
24211
  const callerSignal = context ? context.signal : options?.signal;
24212
24212
  if (callerSignal?.aborted) {
24213
24213
  throw userAbortError(callerSignal);
@@ -24215,7 +24215,7 @@ var init_x509_workload_identity_auth = __esm({
24215
24215
  if (attempt.controller.signal.aborted && attempt.generation !== __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_tokenGeneration, "f")) {
24216
24216
  return await this.getToken(options, context);
24217
24217
  }
24218
- const fallback = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_fallbackToken).call(this, error, cached, scope);
24218
+ const fallback = __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_instances, "m", _X509WorkloadIdentityAuth_fallbackToken).call(this, error, cached2, scope);
24219
24219
  if (fallback !== void 0) {
24220
24220
  return fallback;
24221
24221
  }
@@ -24226,8 +24226,8 @@ var init_x509_workload_identity_auth = __esm({
24226
24226
  }
24227
24227
  }
24228
24228
  throw error;
24229
- }, _X509WorkloadIdentityAuth_fallbackToken = function _X509WorkloadIdentityAuth_fallbackToken2(error, cached, scope) {
24230
- if (!cached || cached !== __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_cachedToken, "f") || performance.now() >= cached.expiresAt || Date.now() >= cached.wallExpiresAt || !_a2.isRetryableFailure(error)) {
24229
+ }, _X509WorkloadIdentityAuth_fallbackToken = function _X509WorkloadIdentityAuth_fallbackToken2(error, cached2, scope) {
24230
+ if (!cached2 || cached2 !== __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_cachedToken, "f") || performance.now() >= cached2.expiresAt || Date.now() >= cached2.wallExpiresAt || !_a2.isRetryableFailure(error)) {
24231
24231
  return void 0;
24232
24232
  }
24233
24233
  const headers = _a2.retryHeaders(error);
@@ -24239,9 +24239,9 @@ var init_x509_workload_identity_auth = __esm({
24239
24239
  requested = Number.isNaN(seconds) ? Date.parse(retryAfter) - Date.now() : seconds * 1e3;
24240
24240
  }
24241
24241
  const cooldown = requested !== void 0 && Number.isFinite(requested) && requested >= 0 && requested <= 6e4 ? Math.max(FAILED_REFRESH_COOLDOWN_MS, requested) : FAILED_REFRESH_COOLDOWN_MS;
24242
- cached.refreshAt = Math.min(cached.expiresAt, performance.now() + cooldown);
24243
- cached.wallRefreshAt = Math.min(cached.wallExpiresAt, Date.now() + cooldown);
24244
- return __classPrivateFieldGet2(_a2, _a2, "m", _X509WorkloadIdentityAuth_assignToken).call(_a2, scope, cached);
24242
+ cached2.refreshAt = Math.min(cached2.expiresAt, performance.now() + cooldown);
24243
+ cached2.wallRefreshAt = Math.min(cached2.wallExpiresAt, Date.now() + cooldown);
24244
+ return __classPrivateFieldGet2(_a2, _a2, "m", _X509WorkloadIdentityAuth_assignToken).call(_a2, scope, cached2);
24245
24245
  }, _X509WorkloadIdentityAuth_retireRefresh = function _X509WorkloadIdentityAuth_retireRefresh2(attempt) {
24246
24246
  if (attempt.waiters !== 0 || __classPrivateFieldGet2(this, _X509WorkloadIdentityAuth_refresh, "f") !== attempt) {
24247
24247
  return;
@@ -24501,9 +24501,9 @@ function isArrayBuffer(value) {
24501
24501
  }
24502
24502
  function supportsFormData2(fetchObject) {
24503
24503
  const fetch3 = typeof fetchObject === "function" ? fetchObject : fetchObject.fetch;
24504
- const cached = supportsFormDataMap2.get(fetch3);
24505
- if (cached) {
24506
- return cached;
24504
+ const cached2 = supportsFormDataMap2.get(fetch3);
24505
+ if (cached2) {
24506
+ return cached2;
24507
24507
  }
24508
24508
  const promise = (async () => {
24509
24509
  try {
@@ -24972,8 +24972,8 @@ var init_messages3 = __esm({
24972
24972
  * }
24973
24973
  * ```
24974
24974
  */
24975
- list(completionID, query3 = {}, options) {
24976
- return this._client.getAPIList(path4`/chat/completions/${completionID}/messages`, CursorPage, { query: query3, ...options, __security: { bearerAuth: true } });
24975
+ list(completionID, query = {}, options) {
24976
+ return this._client.getAPIList(path4`/chat/completions/${completionID}/messages`, CursorPage, { query, ...options, __security: { bearerAuth: true } });
24977
24977
  }
24978
24978
  };
24979
24979
  }
@@ -24987,8 +24987,8 @@ var init_error4 = __esm({
24987
24987
  });
24988
24988
 
24989
24989
  // ../../node_modules/.pnpm/openai@7.19.0_@aws-sdk+credential-provider-node@3.972.84_@smithy+signature-v4@5.7.4_undici@8.10.2_ws@8.21.3_zod@4.5.4/node_modules/openai/lib/parser.mjs
24990
- function isChatCompletionFunctionTool(tool2) {
24991
- return tool2 !== void 0 && "function" in tool2 && tool2.function !== void 0;
24990
+ function isChatCompletionFunctionTool(tool) {
24991
+ return tool !== void 0 && "function" in tool && tool.function !== void 0;
24992
24992
  }
24993
24993
  function isAutoParsableResponseFormat(response_format) {
24994
24994
  return response_format?.["$brand"] === "auto-parseable-response-format";
@@ -25012,8 +25012,8 @@ function parseResponseFormatContent(format, content) {
25012
25012
  throw error;
25013
25013
  }
25014
25014
  }
25015
- function isAutoParsableTool(tool2) {
25016
- return tool2?.["$brand"] === "auto-parseable-tool";
25015
+ function isAutoParsableTool(tool) {
25016
+ return tool?.["$brand"] === "auto-parseable-tool";
25017
25017
  }
25018
25018
  function maybeParseChatCompletion(completion, params) {
25019
25019
  if (!params || !hasAutoParseableInput(params)) {
@@ -25094,16 +25094,16 @@ function hasAutoParseableInput(params) {
25094
25094
  return params.tools?.some((t2) => isAutoParsableTool(t2) || t2.type === "function" && t2.function.strict === true) ?? false;
25095
25095
  }
25096
25096
  function validateInputTools(tools) {
25097
- for (const tool2 of tools ?? []) {
25098
- if (tool2.type === "custom") {
25097
+ for (const tool of tools ?? []) {
25098
+ if (tool.type === "custom") {
25099
25099
  continue;
25100
25100
  }
25101
- if (tool2.type !== "function") {
25102
- const unsupportedType = tool2.type;
25101
+ if (tool.type !== "function") {
25102
+ const unsupportedType = tool.type;
25103
25103
  throw new OpenAIError(`Currently only \`function\` and \`custom\` tool types are supported; Received \`${unsupportedType}\``);
25104
25104
  }
25105
- if (tool2.function.strict !== true) {
25106
- throw new OpenAIError(`The \`${tool2.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`);
25105
+ if (tool.function.strict !== true) {
25106
+ throw new OpenAIError(`The \`${tool.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`);
25107
25107
  }
25108
25108
  }
25109
25109
  }
@@ -26806,24 +26806,24 @@ var init_AbstractChatCompletionRunner = __esm({
26806
26806
  await afterCompletion(completion, runner);
26807
26807
  __classPrivateFieldGet2(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_throwIfAborted).call(this);
26808
26808
  };
26809
- const inputTools = params.tools.map((tool2) => {
26810
- if (isAutoParsableTool(tool2)) {
26811
- if (!tool2.$callback) {
26809
+ const inputTools = params.tools.map((tool) => {
26810
+ if (isAutoParsableTool(tool)) {
26811
+ if (!tool.$callback) {
26812
26812
  throw new OpenAIError("Tool given to `.runTools()` that does not have an associated function");
26813
26813
  }
26814
26814
  return {
26815
26815
  type: "function",
26816
26816
  function: {
26817
- function: tool2.$callback,
26818
- name: tool2.function.name,
26819
- description: tool2.function.description || "",
26820
- parameters: tool2.function.parameters,
26821
- parse: tool2.$parseRaw,
26817
+ function: tool.$callback,
26818
+ name: tool.function.name,
26819
+ description: tool.function.description || "",
26820
+ parameters: tool.function.parameters,
26821
+ parse: tool.$parseRaw,
26822
26822
  strict: true
26823
26823
  }
26824
26824
  };
26825
26825
  }
26826
- return tool2;
26826
+ return tool;
26827
26827
  });
26828
26828
  const functionsByName = /* @__PURE__ */ Object.create(null);
26829
26829
  for (const f3 of inputTools) {
@@ -27579,8 +27579,8 @@ function snapshotChatCompletionParserParams(params) {
27579
27579
  stableTools.length = index + 1;
27580
27580
  continue;
27581
27581
  }
27582
- const tool2 = item.value;
27583
- const stableTool = cloneParserConfigObject(tool2, [
27582
+ const tool = item.value;
27583
+ const stableTool = cloneParserConfigObject(tool, [
27584
27584
  "type",
27585
27585
  "$brand",
27586
27586
  "$parseRaw",
@@ -27595,7 +27595,7 @@ function snapshotChatCompletionParserParams(params) {
27595
27595
  value: cloneParserConfigObject(stableTool.function, ["name", "strict"])
27596
27596
  };
27597
27597
  }
27598
- stableTools[index] = Object.create(Object.getPrototypeOf(tool2), descriptors);
27598
+ stableTools[index] = Object.create(Object.getPrototypeOf(tool), descriptors);
27599
27599
  }
27600
27600
  snapshot.tools = stableTools;
27601
27601
  }
@@ -27902,13 +27902,13 @@ function observeSerializedChatCompletionParserParams(body, initial, update) {
27902
27902
  toolFrames.set(value, frame);
27903
27903
  return;
27904
27904
  }
27905
- const tool2 = toolFrames.get(holder);
27906
- if (tool2) {
27905
+ const tool = toolFrames.get(holder);
27906
+ if (tool) {
27907
27907
  if (key === "type" && typeof value === "string") {
27908
- tool2.type = value;
27908
+ tool.type = value;
27909
27909
  } else if (key === "function" && typeof value === "object" && value !== null) {
27910
- const fn2 = { source: tool2.source, schemaMatches: false };
27911
- tool2.function = fn2;
27910
+ const fn2 = { source: tool.source, schemaMatches: false };
27911
+ tool.function = fn2;
27912
27912
  functionFrames.set(value, fn2);
27913
27913
  }
27914
27914
  return;
@@ -28187,8 +28187,8 @@ var init_ChatCompletionStream = __esm({
28187
28187
  if (!descriptor || !("value" in descriptor)) {
28188
28188
  continue;
28189
28189
  }
28190
- const tool2 = descriptor.value;
28191
- if (isChatCompletionFunctionTool(tool2) && (isAutoParsableTool(tool2) || tool2.function.strict === true)) {
28190
+ const tool = descriptor.value;
28191
+ if (isChatCompletionFunctionTool(tool) && (isAutoParsableTool(tool) || tool.function.strict === true)) {
28192
28192
  __classPrivateFieldSet2(this, _ChatCompletionStream_hasAutoParseableTool, true, "f");
28193
28193
  break;
28194
28194
  }
@@ -28230,10 +28230,10 @@ var init_ChatCompletionStream = __esm({
28230
28230
  __classPrivateFieldGet2(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_beginRequest).call(this);
28231
28231
  const parserParams = snapshotChatCompletionParserParams(requestParams);
28232
28232
  __classPrivateFieldSet2(this, _ChatCompletionStream_params, parserParams, "f");
28233
- __classPrivateFieldSet2(this, _ChatCompletionStream_hasAutoParseableTool, parserParams.tools?.some((tool2) => isChatCompletionFunctionTool(tool2) && (isAutoParsableTool(tool2) || tool2.function.strict === true)) ?? false, "f");
28233
+ __classPrivateFieldSet2(this, _ChatCompletionStream_hasAutoParseableTool, parserParams.tools?.some((tool) => isChatCompletionFunctionTool(tool) && (isAutoParsableTool(tool) || tool.function.strict === true)) ?? false, "f");
28234
28234
  const stopObserving = requestParams.tools || requestParams.response_format ? observeSerializedChatCompletionParserParams(requestParams, parserParams, (serialized) => {
28235
28235
  __classPrivateFieldSet2(this, _ChatCompletionStream_params, serialized, "f");
28236
- __classPrivateFieldSet2(this, _ChatCompletionStream_hasAutoParseableTool, serialized.tools?.some((tool2) => isChatCompletionFunctionTool(tool2) && (isAutoParsableTool(tool2) || tool2.function.strict === true)) ?? false, "f");
28236
+ __classPrivateFieldSet2(this, _ChatCompletionStream_hasAutoParseableTool, serialized.tools?.some((tool) => isChatCompletionFunctionTool(tool) && (isAutoParsableTool(tool) || tool.function.strict === true)) ?? false, "f");
28237
28237
  }) : void 0;
28238
28238
  const stream11 = await client.chat.completions.create(requestParams, {
28239
28239
  ...options,
@@ -28428,7 +28428,7 @@ var init_ChatCompletionStream = __esm({
28428
28428
  throw new Error("tool call snapshot missing `type`");
28429
28429
  }
28430
28430
  if (toolCallSnapshot.type === "function") {
28431
- const inputTool = __classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")?.tools?.find((tool2) => isChatCompletionFunctionTool(tool2) && tool2.function.name === toolCallSnapshot.function.name);
28431
+ const inputTool = __classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")?.tools?.find((tool) => isChatCompletionFunctionTool(tool) && tool.function.name === toolCallSnapshot.function.name);
28432
28432
  let parsedArguments = null;
28433
28433
  const parseable = isAutoParsableTool(inputTool) || inputTool?.function.strict === true;
28434
28434
  let argumentsSnapshot;
@@ -28769,7 +28769,7 @@ var init_ChatCompletionStream = __esm({
28769
28769
  }
28770
28770
  if (eventState && !boundIdentity) {
28771
28771
  const identity = ownFunctionToolIdentity(tool_call);
28772
- const configuredTool = identity && __classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")?.tools?.find((tool2) => isChatCompletionFunctionTool(tool2) && tool2.function.name === identity.name);
28772
+ const configuredTool = identity && __classPrivateFieldGet2(this, _ChatCompletionStream_params, "f")?.tools?.find((tool) => isChatCompletionFunctionTool(tool) && tool.function.name === identity.name);
28773
28773
  if (identity) {
28774
28774
  boundIdentity = {
28775
28775
  ...identity,
@@ -28980,9 +28980,9 @@ var init_completions2 = __esm({
28980
28980
  * }
28981
28981
  * ```
28982
28982
  */
28983
- list(query3 = {}, options) {
28983
+ list(query = {}, options) {
28984
28984
  return this._client.getAPIList("/chat/completions", CursorPage, {
28985
- query: query3,
28985
+ query,
28986
28986
  ...options,
28987
28987
  __security: { bearerAuth: true }
28988
28988
  });
@@ -29121,9 +29121,9 @@ var init_admin_api_keys = __esm({
29121
29121
  * }
29122
29122
  * ```
29123
29123
  */
29124
- list(query3 = {}, options) {
29124
+ list(query = {}, options) {
29125
29125
  return this._client.getAPIList("/organization/admin_api_keys", CursorPage, {
29126
- query: query3,
29126
+ query,
29127
29127
  ...options,
29128
29128
  __security: { adminAPIKeyAuth: true }
29129
29129
  });
@@ -29167,9 +29167,9 @@ var init_audit_logs = __esm({
29167
29167
  * }
29168
29168
  * ```
29169
29169
  */
29170
- list(query3 = {}, options) {
29170
+ list(query = {}, options) {
29171
29171
  return this._client.getAPIList("/organization/audit_logs", ConversationCursorPage, {
29172
- query: query3,
29172
+ query,
29173
29173
  ...options,
29174
29174
  __security: { adminAPIKeyAuth: true }
29175
29175
  });
@@ -29220,9 +29220,9 @@ var init_certificates2 = __esm({
29220
29220
  * );
29221
29221
  * ```
29222
29222
  */
29223
- retrieve(certificateID, query3 = {}, options) {
29223
+ retrieve(certificateID, query = {}, options) {
29224
29224
  return this._client.get(path4`/organization/certificates/${certificateID}`, {
29225
- query: query3,
29225
+ query,
29226
29226
  ...options,
29227
29227
  __security: { adminAPIKeyAuth: true }
29228
29228
  });
@@ -29256,8 +29256,8 @@ var init_certificates2 = __esm({
29256
29256
  * }
29257
29257
  * ```
29258
29258
  */
29259
- list(query3 = {}, options) {
29260
- return this._client.getAPIList("/organization/certificates", ConversationCursorPage, { query: query3, ...options, __security: { adminAPIKeyAuth: true } });
29259
+ list(query = {}, options) {
29260
+ return this._client.getAPIList("/organization/certificates", ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } });
29261
29261
  }
29262
29262
  /**
29263
29263
  * Delete a certificate from the organization.
@@ -29422,9 +29422,9 @@ var init_invites2 = __esm({
29422
29422
  * }
29423
29423
  * ```
29424
29424
  */
29425
- list(query3 = {}, options) {
29425
+ list(query = {}, options) {
29426
29426
  return this._client.getAPIList("/organization/invites", ConversationCursorPage, {
29427
- query: query3,
29427
+ query,
29428
29428
  ...options,
29429
29429
  __security: { adminAPIKeyAuth: true }
29430
29430
  });
@@ -29520,9 +29520,9 @@ var init_roles = __esm({
29520
29520
  * }
29521
29521
  * ```
29522
29522
  */
29523
- list(query3 = {}, options) {
29523
+ list(query = {}, options) {
29524
29524
  return this._client.getAPIList("/organization/roles", NextCursorPage, {
29525
- query: query3,
29525
+ query,
29526
29526
  ...options,
29527
29527
  __security: { adminAPIKeyAuth: true }
29528
29528
  });
@@ -29634,8 +29634,8 @@ var init_spend_alerts = __esm({
29634
29634
  * }
29635
29635
  * ```
29636
29636
  */
29637
- list(query3 = {}, options) {
29638
- return this._client.getAPIList("/organization/spend_alerts", ConversationCursorPage, { query: query3, ...options, __security: { adminAPIKeyAuth: true } });
29637
+ list(query = {}, options) {
29638
+ return this._client.getAPIList("/organization/spend_alerts", ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } });
29639
29639
  }
29640
29640
  /**
29641
29641
  * Deletes an organization spend alert.
@@ -29735,9 +29735,9 @@ var init_usage = __esm({
29735
29735
  * });
29736
29736
  * ```
29737
29737
  */
29738
- audioSpeeches(query3, options) {
29738
+ audioSpeeches(query, options) {
29739
29739
  return this._client.get("/organization/usage/audio_speeches", {
29740
- query: query3,
29740
+ query,
29741
29741
  ...options,
29742
29742
  __security: { adminAPIKeyAuth: true }
29743
29743
  });
@@ -29753,9 +29753,9 @@ var init_usage = __esm({
29753
29753
  * );
29754
29754
  * ```
29755
29755
  */
29756
- audioTranscriptions(query3, options) {
29756
+ audioTranscriptions(query, options) {
29757
29757
  return this._client.get("/organization/usage/audio_transcriptions", {
29758
- query: query3,
29758
+ query,
29759
29759
  ...options,
29760
29760
  __security: { adminAPIKeyAuth: true }
29761
29761
  });
@@ -29771,9 +29771,9 @@ var init_usage = __esm({
29771
29771
  * );
29772
29772
  * ```
29773
29773
  */
29774
- codeInterpreterSessions(query3, options) {
29774
+ codeInterpreterSessions(query, options) {
29775
29775
  return this._client.get("/organization/usage/code_interpreter_sessions", {
29776
- query: query3,
29776
+ query,
29777
29777
  ...options,
29778
29778
  __security: { adminAPIKeyAuth: true }
29779
29779
  });
@@ -29789,9 +29789,9 @@ var init_usage = __esm({
29789
29789
  * });
29790
29790
  * ```
29791
29791
  */
29792
- completions(query3, options) {
29792
+ completions(query, options) {
29793
29793
  return this._client.get("/organization/usage/completions", {
29794
- query: query3,
29794
+ query,
29795
29795
  ...options,
29796
29796
  __security: { adminAPIKeyAuth: true }
29797
29797
  });
@@ -29807,9 +29807,9 @@ var init_usage = __esm({
29807
29807
  * });
29808
29808
  * ```
29809
29809
  */
29810
- costs(query3, options) {
29810
+ costs(query, options) {
29811
29811
  return this._client.get("/organization/costs", {
29812
- query: query3,
29812
+ query,
29813
29813
  ...options,
29814
29814
  __security: { adminAPIKeyAuth: true }
29815
29815
  });
@@ -29825,9 +29825,9 @@ var init_usage = __esm({
29825
29825
  * });
29826
29826
  * ```
29827
29827
  */
29828
- embeddings(query3, options) {
29828
+ embeddings(query, options) {
29829
29829
  return this._client.get("/organization/usage/embeddings", {
29830
- query: query3,
29830
+ query,
29831
29831
  ...options,
29832
29832
  __security: { adminAPIKeyAuth: true }
29833
29833
  });
@@ -29843,9 +29843,9 @@ var init_usage = __esm({
29843
29843
  * });
29844
29844
  * ```
29845
29845
  */
29846
- fileSearchCalls(query3, options) {
29846
+ fileSearchCalls(query, options) {
29847
29847
  return this._client.get("/organization/usage/file_search_calls", {
29848
- query: query3,
29848
+ query,
29849
29849
  ...options,
29850
29850
  __security: { adminAPIKeyAuth: true }
29851
29851
  });
@@ -29861,9 +29861,9 @@ var init_usage = __esm({
29861
29861
  * });
29862
29862
  * ```
29863
29863
  */
29864
- images(query3, options) {
29864
+ images(query, options) {
29865
29865
  return this._client.get("/organization/usage/images", {
29866
- query: query3,
29866
+ query,
29867
29867
  ...options,
29868
29868
  __security: { adminAPIKeyAuth: true }
29869
29869
  });
@@ -29879,9 +29879,9 @@ var init_usage = __esm({
29879
29879
  * });
29880
29880
  * ```
29881
29881
  */
29882
- moderations(query3, options) {
29882
+ moderations(query, options) {
29883
29883
  return this._client.get("/organization/usage/moderations", {
29884
- query: query3,
29884
+ query,
29885
29885
  ...options,
29886
29886
  __security: { adminAPIKeyAuth: true }
29887
29887
  });
@@ -29897,9 +29897,9 @@ var init_usage = __esm({
29897
29897
  * });
29898
29898
  * ```
29899
29899
  */
29900
- vectorStores(query3, options) {
29900
+ vectorStores(query, options) {
29901
29901
  return this._client.get("/organization/usage/vector_stores", {
29902
- query: query3,
29902
+ query,
29903
29903
  ...options,
29904
29904
  __security: { adminAPIKeyAuth: true }
29905
29905
  });
@@ -29915,9 +29915,9 @@ var init_usage = __esm({
29915
29915
  * });
29916
29916
  * ```
29917
29917
  */
29918
- webSearchCalls(query3, options) {
29918
+ webSearchCalls(query, options) {
29919
29919
  return this._client.get("/organization/usage/web_search_calls", {
29920
- query: query3,
29920
+ query,
29921
29921
  ...options,
29922
29922
  __security: { adminAPIKeyAuth: true }
29923
29923
  });
@@ -29985,8 +29985,8 @@ var init_roles2 = __esm({
29985
29985
  * }
29986
29986
  * ```
29987
29987
  */
29988
- list(groupID, query3 = {}, options) {
29989
- return this._client.getAPIList(path4`/organization/groups/${groupID}/roles`, NextCursorPage, { query: query3, ...options, __security: { adminAPIKeyAuth: true } });
29988
+ list(groupID, query = {}, options) {
29989
+ return this._client.getAPIList(path4`/organization/groups/${groupID}/roles`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } });
29990
29990
  }
29991
29991
  /**
29992
29992
  * Unassigns an organization role from a group within the organization.
@@ -30070,8 +30070,8 @@ var init_users2 = __esm({
30070
30070
  * }
30071
30071
  * ```
30072
30072
  */
30073
- list(groupID, query3 = {}, options) {
30074
- return this._client.getAPIList(path4`/organization/groups/${groupID}/users`, NextCursorPage, { query: query3, ...options, __security: { adminAPIKeyAuth: true } });
30073
+ list(groupID, query = {}, options) {
30074
+ return this._client.getAPIList(path4`/organization/groups/${groupID}/users`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } });
30075
30075
  }
30076
30076
  /**
30077
30077
  * Removes a user from a group.
@@ -30176,9 +30176,9 @@ var init_groups = __esm({
30176
30176
  * }
30177
30177
  * ```
30178
30178
  */
30179
- list(query3 = {}, options) {
30179
+ list(query = {}, options) {
30180
30180
  return this._client.getAPIList("/organization/groups", NextCursorPage, {
30181
- query: query3,
30181
+ query,
30182
30182
  ...options,
30183
30183
  __security: { adminAPIKeyAuth: true }
30184
30184
  });
@@ -30245,8 +30245,8 @@ var init_api_keys2 = __esm({
30245
30245
  * }
30246
30246
  * ```
30247
30247
  */
30248
- list(projectID, query3 = {}, options) {
30249
- return this._client.getAPIList(path4`/organization/projects/${projectID}/api_keys`, ConversationCursorPage, { query: query3, ...options, __security: { adminAPIKeyAuth: true } });
30248
+ list(projectID, query = {}, options) {
30249
+ return this._client.getAPIList(path4`/organization/projects/${projectID}/api_keys`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } });
30250
30250
  }
30251
30251
  /**
30252
30252
  * Deletes an API key from the project.
@@ -30295,8 +30295,8 @@ var init_certificates3 = __esm({
30295
30295
  * }
30296
30296
  * ```
30297
30297
  */
30298
- list(projectID, query3 = {}, options) {
30299
- return this._client.getAPIList(path4`/organization/projects/${projectID}/certificates`, ConversationCursorPage, { query: query3, ...options, __security: { adminAPIKeyAuth: true } });
30298
+ list(projectID, query = {}, options) {
30299
+ return this._client.getAPIList(path4`/organization/projects/${projectID}/certificates`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } });
30300
30300
  }
30301
30301
  /**
30302
30302
  * Activate certificates at the project level.
@@ -30517,8 +30517,8 @@ var init_rate_limits3 = __esm({
30517
30517
  * }
30518
30518
  * ```
30519
30519
  */
30520
- listRateLimits(projectID, query3 = {}, options) {
30521
- return this._client.getAPIList(path4`/organization/projects/${projectID}/rate_limits`, ConversationCursorPage, { query: query3, ...options, __security: { adminAPIKeyAuth: true } });
30520
+ listRateLimits(projectID, query = {}, options) {
30521
+ return this._client.getAPIList(path4`/organization/projects/${projectID}/rate_limits`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } });
30522
30522
  }
30523
30523
  /**
30524
30524
  * Updates a project rate limit.
@@ -30623,9 +30623,9 @@ var init_roles3 = __esm({
30623
30623
  * }
30624
30624
  * ```
30625
30625
  */
30626
- list(projectID, query3 = {}, options) {
30626
+ list(projectID, query = {}, options) {
30627
30627
  return this._client.getAPIList(path4`/projects/${projectID}/roles`, NextCursorPage, {
30628
- query: query3,
30628
+ query,
30629
30629
  ...options,
30630
30630
  __security: { adminAPIKeyAuth: true }
30631
30631
  });
@@ -30749,8 +30749,8 @@ var init_spend_alerts2 = __esm({
30749
30749
  * }
30750
30750
  * ```
30751
30751
  */
30752
- list(projectID, query3 = {}, options) {
30753
- return this._client.getAPIList(path4`/organization/projects/${projectID}/spend_alerts`, ConversationCursorPage, { query: query3, ...options, __security: { adminAPIKeyAuth: true } });
30752
+ list(projectID, query = {}, options) {
30753
+ return this._client.getAPIList(path4`/organization/projects/${projectID}/spend_alerts`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } });
30754
30754
  }
30755
30755
  /**
30756
30756
  * Deletes a project spend alert.
@@ -30905,8 +30905,8 @@ var init_roles4 = __esm({
30905
30905
  * ```
30906
30906
  */
30907
30907
  list(groupID, params, options) {
30908
- const { project_id, ...query3 } = params;
30909
- return this._client.getAPIList(path4`/projects/${project_id}/groups/${groupID}/roles`, NextCursorPage, { query: query3, ...options, __security: { adminAPIKeyAuth: true } });
30908
+ const { project_id, ...query } = params;
30909
+ return this._client.getAPIList(path4`/projects/${project_id}/groups/${groupID}/roles`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } });
30910
30910
  }
30911
30911
  /**
30912
30912
  * Unassigns a project role from a group within a project.
@@ -30977,9 +30977,9 @@ var init_groups2 = __esm({
30977
30977
  * ```
30978
30978
  */
30979
30979
  retrieve(groupID, params, options) {
30980
- const { project_id, ...query3 } = params;
30980
+ const { project_id, ...query } = params;
30981
30981
  return this._client.get(path4`/organization/projects/${project_id}/groups/${groupID}`, {
30982
- query: query3,
30982
+ query,
30983
30983
  ...options,
30984
30984
  __security: { adminAPIKeyAuth: true }
30985
30985
  });
@@ -30997,8 +30997,8 @@ var init_groups2 = __esm({
30997
30997
  * }
30998
30998
  * ```
30999
30999
  */
31000
- list(projectID, query3 = {}, options) {
31001
- return this._client.getAPIList(path4`/organization/projects/${projectID}/groups`, NextCursorPage, { query: query3, ...options, __security: { adminAPIKeyAuth: true } });
31000
+ list(projectID, query = {}, options) {
31001
+ return this._client.getAPIList(path4`/organization/projects/${projectID}/groups`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } });
31002
31002
  }
31003
31003
  /**
31004
31004
  * Revokes a group's access to a project.
@@ -31133,8 +31133,8 @@ var init_service_accounts3 = __esm({
31133
31133
  * }
31134
31134
  * ```
31135
31135
  */
31136
- list(projectID, query3 = {}, options) {
31137
- return this._client.getAPIList(path4`/organization/projects/${projectID}/service_accounts`, ConversationCursorPage, { query: query3, ...options, __security: { adminAPIKeyAuth: true } });
31136
+ list(projectID, query = {}, options) {
31137
+ return this._client.getAPIList(path4`/organization/projects/${projectID}/service_accounts`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } });
31138
31138
  }
31139
31139
  /**
31140
31140
  * Deletes a service account from the project.
@@ -31222,8 +31222,8 @@ var init_roles5 = __esm({
31222
31222
  * ```
31223
31223
  */
31224
31224
  list(userID, params, options) {
31225
- const { project_id, ...query3 } = params;
31226
- return this._client.getAPIList(path4`/projects/${project_id}/users/${userID}/roles`, NextCursorPage, { query: query3, ...options, __security: { adminAPIKeyAuth: true } });
31225
+ const { project_id, ...query } = params;
31226
+ return this._client.getAPIList(path4`/projects/${project_id}/users/${userID}/roles`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } });
31227
31227
  }
31228
31228
  /**
31229
31229
  * Unassigns a project role from a user within a project.
@@ -31334,8 +31334,8 @@ var init_users3 = __esm({
31334
31334
  * }
31335
31335
  * ```
31336
31336
  */
31337
- list(projectID, query3 = {}, options) {
31338
- return this._client.getAPIList(path4`/organization/projects/${projectID}/users`, ConversationCursorPage, { query: query3, ...options, __security: { adminAPIKeyAuth: true } });
31337
+ list(projectID, query = {}, options) {
31338
+ return this._client.getAPIList(path4`/organization/projects/${projectID}/users`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } });
31339
31339
  }
31340
31340
  /**
31341
31341
  * Deletes a user from the project.
@@ -31476,9 +31476,9 @@ var init_projects = __esm({
31476
31476
  * }
31477
31477
  * ```
31478
31478
  */
31479
- list(query3 = {}, options) {
31479
+ list(query = {}, options) {
31480
31480
  return this._client.getAPIList("/organization/projects", ConversationCursorPage, {
31481
- query: query3,
31481
+ query,
31482
31482
  ...options,
31483
31483
  __security: { adminAPIKeyAuth: true }
31484
31484
  });
@@ -31576,8 +31576,8 @@ var init_roles6 = __esm({
31576
31576
  * }
31577
31577
  * ```
31578
31578
  */
31579
- list(userID, query3 = {}, options) {
31580
- return this._client.getAPIList(path4`/organization/users/${userID}/roles`, NextCursorPage, { query: query3, ...options, __security: { adminAPIKeyAuth: true } });
31579
+ list(userID, query = {}, options) {
31580
+ return this._client.getAPIList(path4`/organization/users/${userID}/roles`, NextCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } });
31581
31581
  }
31582
31582
  /**
31583
31583
  * Unassigns an organization role from a user within the organization.
@@ -31658,9 +31658,9 @@ var init_users4 = __esm({
31658
31658
  * }
31659
31659
  * ```
31660
31660
  */
31661
- list(query3 = {}, options) {
31661
+ list(query = {}, options) {
31662
31662
  return this._client.getAPIList("/organization/users", ConversationCursorPage, {
31663
- query: query3,
31663
+ query,
31664
31664
  ...options,
31665
31665
  __security: { adminAPIKeyAuth: true }
31666
31666
  });
@@ -31883,9 +31883,9 @@ var init_batches3 = __esm({
31883
31883
  /**
31884
31884
  * List your organization's batches.
31885
31885
  */
31886
- list(query3 = {}, options) {
31886
+ list(query = {}, options) {
31887
31887
  return this._client.getAPIList("/batches", CursorPage, {
31888
- query: query3,
31888
+ query,
31889
31889
  ...options,
31890
31890
  __security: { bearerAuth: true }
31891
31891
  });
@@ -31957,9 +31957,9 @@ var init_assistants = __esm({
31957
31957
  *
31958
31958
  * @deprecated
31959
31959
  */
31960
- list(query3 = {}, options) {
31960
+ list(query = {}, options) {
31961
31961
  return this._client.getAPIList("/assistants", CursorPage, {
31962
- query: query3,
31962
+ query,
31963
31963
  ...options,
31964
31964
  headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]),
31965
31965
  __security: { bearerAuth: true }
@@ -32120,9 +32120,9 @@ var init_files3 = __esm({
32120
32120
  * }
32121
32121
  * ```
32122
32122
  */
32123
- list(environmentID, query3 = {}, options) {
32123
+ list(environmentID, query = {}, options) {
32124
32124
  return this._client.getAPIList(path4`/agents/environments/${environmentID}/files`, TokenPage, {
32125
- query: query3,
32125
+ query,
32126
32126
  ...options,
32127
32127
  headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]),
32128
32128
  __security: { bearerAuth: true }
@@ -32213,9 +32213,9 @@ var init_templates = __esm({
32213
32213
  * }
32214
32214
  * ```
32215
32215
  */
32216
- list(query3 = {}, options) {
32216
+ list(query = {}, options) {
32217
32217
  return this._client.getAPIList("/agents/environments/templates", CursorPage, {
32218
- query: query3,
32218
+ query,
32219
32219
  ...options,
32220
32220
  headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]),
32221
32221
  __security: { bearerAuth: true }
@@ -32620,9 +32620,9 @@ var init_artifacts = __esm({
32620
32620
  * }
32621
32621
  * ```
32622
32622
  */
32623
- list(sessionID, query3 = {}, options) {
32623
+ list(sessionID, query = {}, options) {
32624
32624
  return this._client.getAPIList(path4`/agents/sessions/${sessionID}/artifacts`, CursorPage, {
32625
- query: query3,
32625
+ query,
32626
32626
  ...options,
32627
32627
  headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]),
32628
32628
  __security: { bearerAuth: true }
@@ -32783,9 +32783,9 @@ var init_items = __esm({
32783
32783
  * }
32784
32784
  * ```
32785
32785
  */
32786
- list(sessionID, query3 = {}, options) {
32786
+ list(sessionID, query = {}, options) {
32787
32787
  return this._client.getAPIList(path4`/agents/sessions/${sessionID}/items`, CursorPage, {
32788
- query: query3,
32788
+ query,
32789
32789
  ...options,
32790
32790
  headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]),
32791
32791
  __security: { bearerAuth: true }
@@ -32841,9 +32841,9 @@ var init_turns = __esm({
32841
32841
  * }
32842
32842
  * ```
32843
32843
  */
32844
- list(sessionID, query3 = {}, options) {
32844
+ list(sessionID, query = {}, options) {
32845
32845
  return this._client.getAPIList(path4`/agents/sessions/${sessionID}/turns`, CursorPage, {
32846
- query: query3,
32846
+ query,
32847
32847
  ...options,
32848
32848
  headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]),
32849
32849
  __security: { bearerAuth: true }
@@ -32878,9 +32878,9 @@ var init_items2 = __esm({
32878
32878
  * ```
32879
32879
  */
32880
32880
  list(subagentID, params, options) {
32881
- const { session_id, ...query3 } = params;
32881
+ const { session_id, ...query } = params;
32882
32882
  return this._client.getAPIList(path4`/agents/sessions/${session_id}/subagents/${subagentID}/items`, CursorPage, {
32883
- query: query3,
32883
+ query,
32884
32884
  ...options,
32885
32885
  headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]),
32886
32886
  __security: { bearerAuth: true }
@@ -32915,9 +32915,9 @@ var init_items3 = __esm({
32915
32915
  * ```
32916
32916
  */
32917
32917
  list(turnID, params, options) {
32918
- const { session_id, subagent_id, ...query3 } = params;
32918
+ const { session_id, subagent_id, ...query } = params;
32919
32919
  return this._client.getAPIList(path4`/agents/sessions/${session_id}/subagents/${subagent_id}/turns/${turnID}/items`, CursorPage, {
32920
- query: query3,
32920
+ query,
32921
32921
  ...options,
32922
32922
  headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]),
32923
32923
  __security: { bearerAuth: true }
@@ -32982,9 +32982,9 @@ var init_turns2 = __esm({
32982
32982
  * ```
32983
32983
  */
32984
32984
  list(subagentID, params, options) {
32985
- const { session_id, ...query3 } = params;
32985
+ const { session_id, ...query } = params;
32986
32986
  return this._client.getAPIList(path4`/agents/sessions/${session_id}/subagents/${subagentID}/turns`, CursorPage, {
32987
- query: query3,
32987
+ query,
32988
32988
  ...options,
32989
32989
  headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]),
32990
32990
  __security: { bearerAuth: true }
@@ -33048,9 +33048,9 @@ var init_subagents = __esm({
33048
33048
  * }
33049
33049
  * ```
33050
33050
  */
33051
- list(sessionID, query3 = {}, options) {
33051
+ list(sessionID, query = {}, options) {
33052
33052
  return this._client.getAPIList(path4`/agents/sessions/${sessionID}/subagents`, CursorPage, {
33053
- query: query3,
33053
+ query,
33054
33054
  ...options,
33055
33055
  headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]),
33056
33056
  __security: { bearerAuth: true }
@@ -33152,9 +33152,9 @@ var init_sessions3 = __esm({
33152
33152
  * }
33153
33153
  * ```
33154
33154
  */
33155
- list(query3 = {}, options) {
33155
+ list(query = {}, options) {
33156
33156
  return this._client.getAPIList("/agents/sessions", CursorPage, {
33157
- query: query3,
33157
+ query,
33158
33158
  ...options,
33159
33159
  headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]),
33160
33160
  __security: { bearerAuth: true }
@@ -33289,9 +33289,9 @@ var init_credentials3 = __esm({
33289
33289
  * }
33290
33290
  * ```
33291
33291
  */
33292
- list(vaultID, query3 = {}, options) {
33292
+ list(vaultID, query = {}, options) {
33293
33293
  return this._client.getAPIList(path4`/vaults/${vaultID}/credentials`, CursorPage, {
33294
- query: query3,
33294
+ query,
33295
33295
  ...options,
33296
33296
  headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]),
33297
33297
  __security: { bearerAuth: true }
@@ -33384,9 +33384,9 @@ var init_vaults2 = __esm({
33384
33384
  * }
33385
33385
  * ```
33386
33386
  */
33387
- list(query3 = {}, options) {
33387
+ list(query = {}, options) {
33388
33388
  return this._client.getAPIList("/vaults", CursorPage, {
33389
- query: query3,
33389
+ query,
33390
33390
  ...options,
33391
33391
  headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]),
33392
33392
  __security: { bearerAuth: true }
@@ -33500,9 +33500,9 @@ var init_agents2 = __esm({
33500
33500
  * }
33501
33501
  * ```
33502
33502
  */
33503
- list(query3 = {}, options) {
33503
+ list(query = {}, options) {
33504
33504
  return this._client.getAPIList("/agents", CursorPage, {
33505
- query: query3,
33505
+ query,
33506
33506
  ...options,
33507
33507
  headers: buildHeaders2([{ "OpenAI-Beta": "agents=v1" }, options?.headers]),
33508
33508
  __security: { bearerAuth: true }
@@ -33619,9 +33619,9 @@ var init_threads2 = __esm({
33619
33619
  * }
33620
33620
  * ```
33621
33621
  */
33622
- list(query3 = {}, options) {
33622
+ list(query = {}, options) {
33623
33623
  return this._client.getAPIList("/chatkit/threads", ConversationCursorPage, {
33624
- query: query3,
33624
+ query,
33625
33625
  ...options,
33626
33626
  headers: buildHeaders2([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]),
33627
33627
  __security: { bearerAuth: true }
@@ -33657,9 +33657,9 @@ var init_threads2 = __esm({
33657
33657
  * }
33658
33658
  * ```
33659
33659
  */
33660
- listItems(threadID, query3 = {}, options) {
33660
+ listItems(threadID, query = {}, options) {
33661
33661
  return this._client.getAPIList(path4`/chatkit/threads/${threadID}/items`, ConversationCursorPage, {
33662
- query: query3,
33662
+ query,
33663
33663
  ...options,
33664
33664
  headers: buildHeaders2([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]),
33665
33665
  __security: { bearerAuth: true }
@@ -33713,9 +33713,9 @@ var init_input_items = __esm({
33713
33713
  * ```
33714
33714
  */
33715
33715
  list(responseID, params = {}, options) {
33716
- const { betas, ...query3 } = params ?? {};
33716
+ const { betas, ...query } = params ?? {};
33717
33717
  return this._client.getAPIList(path4`/responses/${responseID}/input_items?beta=true`, CursorPage, {
33718
- query: query3,
33718
+ query,
33719
33719
  ...options,
33720
33720
  headers: buildHeaders2([
33721
33721
  { ...betas?.toString() != null ? { "openai-beta": betas?.toString() } : void 0 },
@@ -33794,9 +33794,9 @@ var init_responses = __esm({
33794
33794
  });
33795
33795
  }
33796
33796
  retrieve(responseID, params = {}, options) {
33797
- const { betas, ...query3 } = params ?? {};
33797
+ const { betas, ...query } = params ?? {};
33798
33798
  return this._client.get(path4`/responses/${responseID}?beta=true`, {
33799
- query: query3,
33799
+ query,
33800
33800
  ...options,
33801
33801
  headers: buildHeaders2([
33802
33802
  { ...betas?.toString() != null ? { "openai-beta": betas?.toString() } : void 0 },
@@ -33938,9 +33938,9 @@ var init_messages4 = __esm({
33938
33938
  *
33939
33939
  * @deprecated The Assistants API is deprecated in favor of the Responses API
33940
33940
  */
33941
- list(threadID, query3 = {}, options) {
33941
+ list(threadID, query = {}, options) {
33942
33942
  return this._client.getAPIList(path4`/threads/${threadID}/messages`, CursorPage, {
33943
- query: query3,
33943
+ query,
33944
33944
  ...options,
33945
33945
  headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]),
33946
33946
  __security: { bearerAuth: true }
@@ -33978,9 +33978,9 @@ var init_steps = __esm({
33978
33978
  * @deprecated The Assistants API is deprecated in favor of the Responses API
33979
33979
  */
33980
33980
  retrieve(stepID, params, options) {
33981
- const { thread_id, run_id, ...query3 } = params;
33981
+ const { thread_id, run_id, ...query } = params;
33982
33982
  return this._client.get(path4`/threads/${thread_id}/runs/${run_id}/steps/${stepID}`, {
33983
- query: query3,
33983
+ query,
33984
33984
  ...options,
33985
33985
  headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]),
33986
33986
  __security: { bearerAuth: true }
@@ -33992,9 +33992,9 @@ var init_steps = __esm({
33992
33992
  * @deprecated The Assistants API is deprecated in favor of the Responses API
33993
33993
  */
33994
33994
  list(runID, params, options) {
33995
- const { thread_id, ...query3 } = params;
33995
+ const { thread_id, ...query } = params;
33996
33996
  return this._client.getAPIList(path4`/threads/${thread_id}/runs/${runID}/steps`, CursorPage, {
33997
- query: query3,
33997
+ query,
33998
33998
  ...options,
33999
33999
  headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]),
34000
34000
  __security: { bearerAuth: true }
@@ -35229,9 +35229,9 @@ var init_runs = __esm({
35229
35229
  *
35230
35230
  * @deprecated The Assistants API is deprecated in favor of the Responses API
35231
35231
  */
35232
- list(threadID, query3 = {}, options) {
35232
+ list(threadID, query = {}, options) {
35233
35233
  return this._client.getAPIList(path4`/threads/${threadID}/runs`, CursorPage, {
35234
- query: query3,
35234
+ query,
35235
35235
  ...options,
35236
35236
  headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]),
35237
35237
  __security: { bearerAuth: true }
@@ -35530,9 +35530,9 @@ var init_files4 = __esm({
35530
35530
  /**
35531
35531
  * List Container files
35532
35532
  */
35533
- list(containerID, query3 = {}, options) {
35533
+ list(containerID, query = {}, options) {
35534
35534
  return this._client.getAPIList(path4`/containers/${containerID}/files`, CursorPage, {
35535
- query: query3,
35535
+ query,
35536
35536
  ...options,
35537
35537
  __security: { bearerAuth: true }
35538
35538
  });
@@ -35586,9 +35586,9 @@ var init_containers = __esm({
35586
35586
  /**
35587
35587
  * List Containers
35588
35588
  */
35589
- list(query3 = {}, options) {
35589
+ list(query = {}, options) {
35590
35590
  return this._client.getAPIList("/containers", CursorPage, {
35591
- query: query3,
35591
+ query,
35592
35592
  ...options,
35593
35593
  __security: { bearerAuth: true }
35594
35594
  });
@@ -35657,9 +35657,9 @@ var init_items4 = __esm({
35657
35657
  * Get a single item from a conversation with the given IDs.
35658
35658
  */
35659
35659
  retrieve(itemID, params, options) {
35660
- const { conversation_id, ...query3 } = params;
35660
+ const { conversation_id, ...query } = params;
35661
35661
  return this._client.get(path4`/conversations/${conversation_id}/items/${itemID}`, {
35662
- query: query3,
35662
+ query,
35663
35663
  ...options,
35664
35664
  __security: { bearerAuth: true }
35665
35665
  });
@@ -35667,8 +35667,8 @@ var init_items4 = __esm({
35667
35667
  /**
35668
35668
  * List all items for a conversation with the given ID.
35669
35669
  */
35670
- list(conversationID, query3 = {}, options) {
35671
- return this._client.getAPIList(path4`/conversations/${conversationID}/items`, ConversationCursorPage, { query: query3, ...options, __security: { bearerAuth: true } });
35670
+ list(conversationID, query = {}, options) {
35671
+ return this._client.getAPIList(path4`/conversations/${conversationID}/items`, ConversationCursorPage, { query, ...options, __security: { bearerAuth: true } });
35672
35672
  }
35673
35673
  /**
35674
35674
  * Delete an item from a conversation with the given IDs.
@@ -35817,8 +35817,8 @@ var init_output_items = __esm({
35817
35817
  * Get a list of output items for an evaluation run.
35818
35818
  */
35819
35819
  list(runID, params, options) {
35820
- const { eval_id, ...query3 } = params;
35821
- return this._client.getAPIList(path4`/evals/${eval_id}/runs/${runID}/output_items`, CursorPage, { query: query3, ...options, __security: { bearerAuth: true } });
35820
+ const { eval_id, ...query } = params;
35821
+ return this._client.getAPIList(path4`/evals/${eval_id}/runs/${runID}/output_items`, CursorPage, { query, ...options, __security: { bearerAuth: true } });
35822
35822
  }
35823
35823
  };
35824
35824
  }
@@ -35863,9 +35863,9 @@ var init_runs2 = __esm({
35863
35863
  /**
35864
35864
  * Get a list of runs for an evaluation.
35865
35865
  */
35866
- list(evalID, query3 = {}, options) {
35866
+ list(evalID, query = {}, options) {
35867
35867
  return this._client.getAPIList(path4`/evals/${evalID}/runs`, CursorPage, {
35868
- query: query3,
35868
+ query,
35869
35869
  ...options,
35870
35870
  __security: { bearerAuth: true }
35871
35871
  });
@@ -35935,9 +35935,9 @@ var init_evals = __esm({
35935
35935
  /**
35936
35936
  * List evaluations for a project.
35937
35937
  */
35938
- list(query3 = {}, options) {
35938
+ list(query = {}, options) {
35939
35939
  return this._client.getAPIList("/evals", CursorPage, {
35940
- query: query3,
35940
+ query,
35941
35941
  ...options,
35942
35942
  __security: { bearerAuth: true }
35943
35943
  });
@@ -36028,9 +36028,9 @@ var init_files5 = __esm({
36028
36028
  /**
36029
36029
  * Returns a list of files.
36030
36030
  */
36031
- list(query3 = {}, options) {
36031
+ list(query = {}, options) {
36032
36032
  return this._client.getAPIList("/files", CursorPage, {
36033
- query: query3,
36033
+ query,
36034
36034
  ...options,
36035
36035
  __security: { bearerAuth: true }
36036
36036
  });
@@ -36185,9 +36185,9 @@ var init_permissions = __esm({
36185
36185
  *
36186
36186
  * @deprecated Retrieve is deprecated. Please swap to the paginated list method instead.
36187
36187
  */
36188
- retrieve(fineTunedModelCheckpoint, query3 = {}, options) {
36188
+ retrieve(fineTunedModelCheckpoint, query = {}, options) {
36189
36189
  return this._client.get(path4`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, {
36190
- query: query3,
36190
+ query,
36191
36191
  ...options,
36192
36192
  __security: { adminAPIKeyAuth: true }
36193
36193
  });
@@ -36209,8 +36209,8 @@ var init_permissions = __esm({
36209
36209
  * }
36210
36210
  * ```
36211
36211
  */
36212
- list(fineTunedModelCheckpoint, query3 = {}, options) {
36213
- return this._client.getAPIList(path4`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, ConversationCursorPage, { query: query3, ...options, __security: { adminAPIKeyAuth: true } });
36212
+ list(fineTunedModelCheckpoint, query = {}, options) {
36213
+ return this._client.getAPIList(path4`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } });
36214
36214
  }
36215
36215
  /**
36216
36216
  * **NOTE:** This endpoint requires an
@@ -36277,8 +36277,8 @@ var init_checkpoints2 = __esm({
36277
36277
  * }
36278
36278
  * ```
36279
36279
  */
36280
- list(fineTuningJobID, query3 = {}, options) {
36281
- return this._client.getAPIList(path4`/fine_tuning/jobs/${fineTuningJobID}/checkpoints`, CursorPage, { query: query3, ...options, __security: { bearerAuth: true } });
36280
+ list(fineTuningJobID, query = {}, options) {
36281
+ return this._client.getAPIList(path4`/fine_tuning/jobs/${fineTuningJobID}/checkpoints`, CursorPage, { query, ...options, __security: { bearerAuth: true } });
36282
36282
  }
36283
36283
  };
36284
36284
  }
@@ -36347,9 +36347,9 @@ var init_jobs = __esm({
36347
36347
  * }
36348
36348
  * ```
36349
36349
  */
36350
- list(query3 = {}, options) {
36350
+ list(query = {}, options) {
36351
36351
  return this._client.getAPIList("/fine_tuning/jobs", CursorPage, {
36352
- query: query3,
36352
+ query,
36353
36353
  ...options,
36354
36354
  __security: { bearerAuth: true }
36355
36355
  });
@@ -36383,8 +36383,8 @@ var init_jobs = __esm({
36383
36383
  * }
36384
36384
  * ```
36385
36385
  */
36386
- listEvents(fineTuningJobID, query3 = {}, options) {
36387
- return this._client.getAPIList(path4`/fine_tuning/jobs/${fineTuningJobID}/events`, CursorPage, { query: query3, ...options, __security: { bearerAuth: true } });
36386
+ listEvents(fineTuningJobID, query = {}, options) {
36387
+ return this._client.getAPIList(path4`/fine_tuning/jobs/${fineTuningJobID}/events`, CursorPage, { query, ...options, __security: { bearerAuth: true } });
36388
36388
  }
36389
36389
  /**
36390
36390
  * Pause a fine-tune job.
@@ -37053,19 +37053,19 @@ function hasAutoParseableInput2(params) {
37053
37053
  if (isParseableResponseFormat(params.text?.format)) {
37054
37054
  return true;
37055
37055
  }
37056
- return Array.isArray(params.tools) && params.tools.some((tool2) => isAutoParsableTool2(tool2) || tool2.type === "function" && tool2.strict === true || tool2.type === "namespace" && tool2.tools.some((nested) => nested.type === "function" && (isAutoParsableTool2(nested) || nested.strict === true)));
37056
+ return Array.isArray(params.tools) && params.tools.some((tool) => isAutoParsableTool2(tool) || tool.type === "function" && tool.strict === true || tool.type === "namespace" && tool.tools.some((nested) => nested.type === "function" && (isAutoParsableTool2(nested) || nested.strict === true)));
37057
37057
  }
37058
- function isAutoParsableTool2(tool2) {
37059
- return tool2?.["$brand"] === "auto-parseable-tool";
37058
+ function isAutoParsableTool2(tool) {
37059
+ return tool?.["$brand"] === "auto-parseable-tool";
37060
37060
  }
37061
37061
  function getInputToolByName(input_tools, name, namespace) {
37062
- for (const tool2 of input_tools) {
37062
+ for (const tool of input_tools) {
37063
37063
  if (namespace == null) {
37064
- if (tool2.type === "function" && tool2.name === name) {
37065
- return tool2;
37064
+ if (tool.type === "function" && tool.name === name) {
37065
+ return tool;
37066
37066
  }
37067
- } else if (tool2.type === "namespace" && tool2.name === namespace) {
37068
- return tool2.tools.find((nested) => nested.type === "function" && nested.name === name);
37067
+ } else if (tool.type === "namespace" && tool.name === namespace) {
37068
+ return tool.tools.find((nested) => nested.type === "function" && nested.name === name);
37069
37069
  }
37070
37070
  }
37071
37071
  return void 0;
@@ -37361,9 +37361,9 @@ function createResponseOutputIdentityIndex(snapshot) {
37361
37361
  return identityIndex;
37362
37362
  }
37363
37363
  function getResponseOutputIdentityIndex(context, snapshot) {
37364
- const cached = responseOutputIdentityIndexes.get(context);
37365
- if (cached && cached.snapshot === snapshot && cached.output === snapshot.output && cached.length === snapshot.output.length) {
37366
- return cached;
37364
+ const cached2 = responseOutputIdentityIndexes.get(context);
37365
+ if (cached2 && cached2.snapshot === snapshot && cached2.output === snapshot.output && cached2.length === snapshot.output.length) {
37366
+ return cached2;
37367
37367
  }
37368
37368
  const identityIndex = createResponseOutputIdentityIndex(snapshot);
37369
37369
  responseOutputIdentityIndexes.set(context, identityIndex);
@@ -38395,8 +38395,8 @@ var init_input_items2 = __esm({
38395
38395
  * }
38396
38396
  * ```
38397
38397
  */
38398
- list(responseID, query3 = {}, options) {
38399
- return this._client.getAPIList(path4`/responses/${responseID}/input_items`, CursorPage, { query: query3, ...options, __security: { bearerAuth: true } });
38398
+ list(responseID, query = {}, options) {
38399
+ return this._client.getAPIList(path4`/responses/${responseID}/input_items`, CursorPage, { query, ...options, __security: { bearerAuth: true } });
38400
38400
  }
38401
38401
  };
38402
38402
  }
@@ -38462,11 +38462,11 @@ var init_responses2 = __esm({
38462
38462
  return rsp;
38463
38463
  });
38464
38464
  }
38465
- retrieve(responseID, query3 = {}, options) {
38465
+ retrieve(responseID, query = {}, options) {
38466
38466
  return this._client.get(path4`/responses/${responseID}`, {
38467
- query: query3,
38467
+ query,
38468
38468
  ...options,
38469
- stream: query3?.stream ?? false,
38469
+ stream: query?.stream ?? false,
38470
38470
  __security: { bearerAuth: true }
38471
38471
  })._thenUnwrap((rsp) => {
38472
38472
  if ("object" in rsp && rsp.object === "response") {
@@ -38660,9 +38660,9 @@ var init_versions4 = __esm({
38660
38660
  /**
38661
38661
  * List skill versions for a skill.
38662
38662
  */
38663
- list(skillID, query3 = {}, options) {
38663
+ list(skillID, query = {}, options) {
38664
38664
  return this._client.getAPIList(path4`/skills/${skillID}/versions`, CursorPage, {
38665
- query: query3,
38665
+ query,
38666
38666
  ...options,
38667
38667
  __security: { bearerAuth: true }
38668
38668
  });
@@ -38727,9 +38727,9 @@ var init_skills4 = __esm({
38727
38727
  /**
38728
38728
  * List all skills for the current project.
38729
38729
  */
38730
- list(query3 = {}, options) {
38730
+ list(query = {}, options) {
38731
38731
  return this._client.getAPIList("/skills", CursorPage, {
38732
- query: query3,
38732
+ query,
38733
38733
  ...options,
38734
38734
  __security: { bearerAuth: true }
38735
38735
  });
@@ -38980,9 +38980,9 @@ var init_file_batches = __esm({
38980
38980
  * Returns a list of vector store files in a batch.
38981
38981
  */
38982
38982
  listFiles(batchID, params, options) {
38983
- const { vector_store_id, ...query3 } = params;
38983
+ const { vector_store_id, ...query } = params;
38984
38984
  return this._client.getAPIList(path4`/vector_stores/${vector_store_id}/file_batches/${batchID}/files`, CursorPage, {
38985
- query: query3,
38985
+ query,
38986
38986
  ...options,
38987
38987
  headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]),
38988
38988
  __security: { bearerAuth: true }
@@ -39058,9 +39058,9 @@ var init_files6 = __esm({
39058
39058
  /**
39059
39059
  * Returns a list of vector store files.
39060
39060
  */
39061
- list(vectorStoreID, query3 = {}, options) {
39061
+ list(vectorStoreID, query = {}, options) {
39062
39062
  return this._client.getAPIList(path4`/vector_stores/${vectorStoreID}/files`, CursorPage, {
39063
- query: query3,
39063
+ query,
39064
39064
  ...options,
39065
39065
  headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]),
39066
39066
  __security: { bearerAuth: true }
@@ -39181,9 +39181,9 @@ var init_vector_stores = __esm({
39181
39181
  /**
39182
39182
  * Returns a list of vector stores.
39183
39183
  */
39184
- list(query3 = {}, options) {
39184
+ list(query = {}, options) {
39185
39185
  return this._client.getAPIList("/vector_stores", CursorPage, {
39186
- query: query3,
39186
+ query,
39187
39187
  ...options,
39188
39188
  headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]),
39189
39189
  __security: { bearerAuth: true }
@@ -39249,9 +39249,9 @@ var init_videos = __esm({
39249
39249
  *
39250
39250
  * @deprecated The Sora API is scheduled to permanently shut down on September 24, 2026.
39251
39251
  */
39252
- list(query3 = {}, options) {
39252
+ list(query = {}, options) {
39253
39253
  return this._client.getAPIList("/videos", ConversationCursorPage, {
39254
- query: query3,
39254
+ query,
39255
39255
  ...options,
39256
39256
  __security: { bearerAuth: true }
39257
39257
  });
@@ -39279,9 +39279,9 @@ var init_videos = __esm({
39279
39279
  *
39280
39280
  * @deprecated The Sora API is scheduled to permanently shut down on September 24, 2026.
39281
39281
  */
39282
- downloadContent(videoID, query3 = {}, options) {
39282
+ downloadContent(videoID, query = {}, options) {
39283
39283
  return this._client.get(path4`/videos/${videoID}/content`, {
39284
- query: query3,
39284
+ query,
39285
39285
  ...options,
39286
39286
  headers: buildHeaders2([{ Accept: "application/binary" }, options?.headers]),
39287
39287
  __security: { bearerAuth: true },
@@ -39531,9 +39531,9 @@ var init_webhooks2 = __esm({
39531
39531
  * }
39532
39532
  * ```
39533
39533
  */
39534
- list(query3 = {}, options) {
39534
+ list(query = {}, options) {
39535
39535
  return this._client.getAPIList("/webhook_endpoints", CursorPage, {
39536
- query: query3,
39536
+ query,
39537
39537
  ...options,
39538
39538
  __security: { bearerAuth: true }
39539
39539
  });
@@ -40087,8 +40087,8 @@ var init_client2 = __esm({
40087
40087
  }
40088
40088
  return buildHeaders2([{ Authorization: `Bearer ${this.adminAPIKey}` }]);
40089
40089
  }
40090
- stringifyQuery(query3) {
40091
- return stringifyQuery2(query3);
40090
+ stringifyQuery(query) {
40091
+ return stringifyQuery2(query);
40092
40092
  }
40093
40093
  getUserAgent() {
40094
40094
  return `${this.constructor.name}/JS ${VERSION2}`;
@@ -40140,16 +40140,16 @@ var init_client2 = __esm({
40140
40140
  capture?.(this.apiKey);
40141
40141
  return true;
40142
40142
  }
40143
- buildURL(path6, query3, defaultBaseURL) {
40143
+ buildURL(path6, query, defaultBaseURL) {
40144
40144
  const baseURL = !__classPrivateFieldGet2(this, _OpenAI_instances, "m", _OpenAI_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL;
40145
40145
  const url = isAbsoluteURL2(path6) ? new URL(path6) : new URL(baseURL + (baseURL.endsWith("/") && path6.startsWith("/") ? path6.slice(1) : path6));
40146
40146
  const defaultQuery = this.defaultQuery();
40147
40147
  const pathQuery = Object.fromEntries(url.searchParams);
40148
40148
  if (!isEmptyObj2(defaultQuery) || !isEmptyObj2(pathQuery)) {
40149
- query3 = { ...pathQuery, ...defaultQuery, ...query3 };
40149
+ query = { ...pathQuery, ...defaultQuery, ...query };
40150
40150
  }
40151
- if (typeof query3 === "object" && query3 && !Array.isArray(query3)) {
40152
- url.search = this.stringifyQuery(query3);
40151
+ if (typeof query === "object" && query && !Array.isArray(query)) {
40152
+ url.search = this.stringifyQuery(query);
40153
40153
  }
40154
40154
  return url.toString();
40155
40155
  }
@@ -40696,8 +40696,8 @@ var init_client2 = __esm({
40696
40696
  }
40697
40697
  const x509ClientFetchOptions = x509Authentication ? snapshotX509RequestOptions(this.fetchOptions) : void 0;
40698
40698
  const x509RequestFetchOptions = x509Authentication ? snapshotX509RequestOptions(options.fetchOptions) : void 0;
40699
- const { method, path: path6, query: query3, defaultBaseURL } = options;
40700
- const url = this.buildURL(path6, query3, defaultBaseURL);
40699
+ const { method, path: path6, query, defaultBaseURL } = options;
40700
+ const url = this.buildURL(path6, query, defaultBaseURL);
40701
40701
  x509Authentication?.snapshotAPIURL(url);
40702
40702
  const explicitTimeout = "timeout" in options;
40703
40703
  if (explicitTimeout)
@@ -41331,7 +41331,7 @@ function convertResponsesMessages(model, context, allowedToolCallProviders, opti
41331
41331
  }
41332
41332
  if (!options?.supportsToolSearch)
41333
41333
  return;
41334
- const names = tools.map((tool2) => tool2.name);
41334
+ const names = tools.map((tool) => tool.name);
41335
41335
  const callId = `pi_tool_load_${shortHash(`${seed}:${names.join(",")}`)}`;
41336
41336
  messages.push({
41337
41337
  type: "tool_search_call",
@@ -41482,13 +41482,13 @@ function convertResponsesTools(tools, options) {
41482
41482
  const defaultStrict = options?.strict === void 0 ? false : options.strict;
41483
41483
  const supportsStrictMode = options?.supportsStrictMode ?? true;
41484
41484
  const supportsOpenAIGrammarTools = options?.supportsOpenAIGrammarTools ?? false;
41485
- return tools.map((tool2) => {
41486
- const grammar = resolveGrammarConstrainedSampling(tool2, supportsOpenAIGrammarTools);
41485
+ return tools.map((tool) => {
41486
+ const grammar = resolveGrammarConstrainedSampling(tool, supportsOpenAIGrammarTools);
41487
41487
  if (grammar) {
41488
41488
  return {
41489
41489
  type: "custom",
41490
- name: tool2.name,
41491
- description: tool2.description,
41490
+ name: tool.name,
41491
+ description: tool.description,
41492
41492
  format: {
41493
41493
  type: "grammar",
41494
41494
  syntax: grammar.format,
@@ -41497,13 +41497,13 @@ function convertResponsesTools(tools, options) {
41497
41497
  ...options?.toolSearchResult ? { defer_loading: true } : {}
41498
41498
  };
41499
41499
  }
41500
- const constrainedStrict = resolveJsonSchemaStrictSampling(tool2, supportsStrictMode);
41500
+ const constrainedStrict = resolveJsonSchemaStrictSampling(tool, supportsStrictMode);
41501
41501
  const strict = constrainedStrict ?? defaultStrict;
41502
41502
  const functionTool = {
41503
41503
  type: "function",
41504
- name: tool2.name,
41505
- description: tool2.description,
41506
- parameters: getJsonSchemaToolParameters(tool2, strict === true),
41504
+ name: tool.name,
41505
+ description: tool.description,
41506
+ parameters: getJsonSchemaToolParameters(tool, strict === true),
41507
41507
  ...options?.toolSearchResult ? { defer_loading: true } : {}
41508
41508
  };
41509
41509
  if (supportsStrictMode) {
@@ -65333,9 +65333,9 @@ function tLiveSpeechConfig(speechConfig) {
65333
65333
  }
65334
65334
  return speechConfig;
65335
65335
  }
65336
- function tTool(tool2) {
65337
- if (tool2.functionDeclarations) {
65338
- for (const functionDeclaration of tool2.functionDeclarations) {
65336
+ function tTool(tool) {
65337
+ if (tool.functionDeclarations) {
65338
+ for (const functionDeclaration of tool.functionDeclarations) {
65339
65339
  if (functionDeclaration.parameters) {
65340
65340
  if (!Object.keys(functionDeclaration.parameters).includes("$schema")) {
65341
65341
  functionDeclaration.parameters = processJsonSchema(functionDeclaration.parameters);
@@ -65358,7 +65358,7 @@ function tTool(tool2) {
65358
65358
  }
65359
65359
  }
65360
65360
  }
65361
- return tool2;
65361
+ return tool;
65362
65362
  }
65363
65363
  function tTools(tools) {
65364
65364
  if (tools === void 0 || tools === null) {
@@ -65368,8 +65368,8 @@ function tTools(tools) {
65368
65368
  throw new Error("tools is required and must be an array of Tools");
65369
65369
  }
65370
65370
  const result = [];
65371
- for (const tool2 of tools) {
65372
- result.push(tool2);
65371
+ for (const tool of tools) {
65372
+ result.push(tool);
65373
65373
  }
65374
65374
  return result;
65375
65375
  }
@@ -73409,11 +73409,11 @@ function includeExtraBodyToRequestInit(requestInit, extraBody) {
73409
73409
  requestInit.body = JSON.stringify(mergedBody);
73410
73410
  }
73411
73411
  function hasMcpToolUsage(tools) {
73412
- for (const tool2 of tools) {
73413
- if (isMcpCallableTool(tool2)) {
73412
+ for (const tool of tools) {
73413
+ if (isMcpCallableTool(tool)) {
73414
73414
  return true;
73415
73415
  }
73416
- if (typeof tool2 === "object" && "inputSchema" in tool2) {
73416
+ if (typeof tool === "object" && "inputSchema" in tool) {
73417
73417
  return true;
73418
73418
  }
73419
73419
  }
@@ -73433,8 +73433,8 @@ function listAllTools(mcpClient_1) {
73433
73433
  let numTools = 0;
73434
73434
  while (numTools < maxTools) {
73435
73435
  const t2 = yield __await(mcpClient.listTools({ cursor }));
73436
- for (const tool2 of t2.tools) {
73437
- yield yield __await(tool2);
73436
+ for (const tool of t2.tools) {
73437
+ yield yield __await(tool);
73438
73438
  numTools++;
73439
73439
  }
73440
73440
  if (!t2.nextCursor) {
@@ -73509,8 +73509,8 @@ function shouldDisableAfc(config) {
73509
73509
  return true;
73510
73510
  }
73511
73511
  let callableToolsPresent = false;
73512
- for (const tool2 of (_b = config === null || config === void 0 ? void 0 : config.tools) !== null && _b !== void 0 ? _b : []) {
73513
- if (isCallableTool(tool2)) {
73512
+ for (const tool of (_b = config === null || config === void 0 ? void 0 : config.tools) !== null && _b !== void 0 ? _b : []) {
73513
+ if (isCallableTool(tool)) {
73514
73514
  callableToolsPresent = true;
73515
73515
  break;
73516
73516
  }
@@ -73525,12 +73525,12 @@ function shouldDisableAfc(config) {
73525
73525
  }
73526
73526
  return false;
73527
73527
  }
73528
- function isCallableTool(tool2) {
73529
- return "callTool" in tool2 && typeof tool2.callTool === "function";
73528
+ function isCallableTool(tool) {
73529
+ return "callTool" in tool && typeof tool.callTool === "function";
73530
73530
  }
73531
73531
  function hasCallableTools(params) {
73532
73532
  var _a7, _b, _c;
73533
- return (_c = (_b = (_a7 = params.config) === null || _a7 === void 0 ? void 0 : _a7.tools) === null || _b === void 0 ? void 0 : _b.some((tool2) => isCallableTool(tool2))) !== null && _c !== void 0 ? _c : false;
73533
+ return (_c = (_b = (_a7 = params.config) === null || _a7 === void 0 ? void 0 : _a7.tools) === null || _b === void 0 ? void 0 : _b.some((tool) => isCallableTool(tool))) !== null && _c !== void 0 ? _c : false;
73534
73534
  }
73535
73535
  function findAfcIncompatibleToolIndexes(params) {
73536
73536
  var _a7;
@@ -73538,11 +73538,11 @@ function findAfcIncompatibleToolIndexes(params) {
73538
73538
  if (!((_a7 = params === null || params === void 0 ? void 0 : params.config) === null || _a7 === void 0 ? void 0 : _a7.tools)) {
73539
73539
  return afcIncompatibleToolIndexes;
73540
73540
  }
73541
- params.config.tools.forEach((tool2, index) => {
73542
- if (isCallableTool(tool2)) {
73541
+ params.config.tools.forEach((tool, index) => {
73542
+ if (isCallableTool(tool)) {
73543
73543
  return;
73544
73544
  }
73545
- const geminiTool = tool2;
73545
+ const geminiTool = tool;
73546
73546
  if (geminiTool.functionDeclarations && geminiTool.functionDeclarations.length > 0) {
73547
73547
  afcIncompatibleToolIndexes.push(index);
73548
73548
  }
@@ -75544,7 +75544,7 @@ async function $do$n(client, api_version, page_size, page_token, parent, options
75544
75544
  api_version: encodeSimple("api_version", (_a7 = payload === null || payload === void 0 ? void 0 : payload.api_version) !== null && _a7 !== void 0 ? _a7 : client._options.api_version, { explode: false, charEncoding: "percent" })
75545
75545
  };
75546
75546
  const path6 = pathToFunc("/{api_version}/agents")(pathParams);
75547
- const query3 = encodeFormQuery({
75547
+ const query = encodeFormQuery({
75548
75548
  "page_size": payload === null || payload === void 0 ? void 0 : payload.page_size,
75549
75549
  "page_token": payload === null || payload === void 0 ? void 0 : payload.page_token,
75550
75550
  "parent": payload === null || payload === void 0 ? void 0 : payload.parent
@@ -75580,7 +75580,7 @@ async function $do$n(client, api_version, page_size, page_token, parent, options
75580
75580
  baseURL: options === null || options === void 0 ? void 0 : options.server_url,
75581
75581
  path: path6,
75582
75582
  headers,
75583
- query: query3,
75583
+ query,
75584
75584
  body,
75585
75585
  userAgent: client._options.user_agent,
75586
75586
  timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1
@@ -75840,7 +75840,7 @@ async function $do$j(client, api_version, page_size, page_token, options) {
75840
75840
  api_version: encodeSimple("api_version", (_a7 = payload === null || payload === void 0 ? void 0 : payload.api_version) !== null && _a7 !== void 0 ? _a7 : client._options.api_version, { explode: false, charEncoding: "percent" })
75841
75841
  };
75842
75842
  const path6 = pathToFunc("/{api_version}/environments")(pathParams);
75843
- const query3 = encodeFormQuery({
75843
+ const query = encodeFormQuery({
75844
75844
  "page_size": payload === null || payload === void 0 ? void 0 : payload.page_size,
75845
75845
  "page_token": payload === null || payload === void 0 ? void 0 : payload.page_token
75846
75846
  });
@@ -75875,7 +75875,7 @@ async function $do$j(client, api_version, page_size, page_token, options) {
75875
75875
  baseURL: options === null || options === void 0 ? void 0 : options.server_url,
75876
75876
  path: path6,
75877
75877
  headers,
75878
- query: query3,
75878
+ query,
75879
75879
  body,
75880
75880
  userAgent: client._options.user_agent,
75881
75881
  timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1
@@ -75927,7 +75927,7 @@ async function $do$i(client, environment, path6, api_version, page_size, page_to
75927
75927
  })
75928
75928
  };
75929
75929
  const path$ = pathToFunc("/{api_version}/environments/{environment}/files/{path}")(pathParams);
75930
- const query3 = encodeFormQuery({
75930
+ const query = encodeFormQuery({
75931
75931
  "page_size": payload.page_size,
75932
75932
  "page_token": payload.page_token,
75933
75933
  "recursive": payload.recursive
@@ -75963,7 +75963,7 @@ async function $do$i(client, environment, path6, api_version, page_size, page_to
75963
75963
  baseURL: options === null || options === void 0 ? void 0 : options.server_url,
75964
75964
  path: path$,
75965
75965
  headers,
75966
- query: query3,
75966
+ query,
75967
75967
  body,
75968
75968
  userAgent: client._options.user_agent,
75969
75969
  timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1
@@ -76241,7 +76241,7 @@ async function $do$e(client, id, api_version, include_input, last_event_id, stre
76241
76241
  })
76242
76242
  };
76243
76243
  const path6 = pathToFunc("/{api_version}/interactions/{id}")(pathParams);
76244
- const query3 = encodeFormQuery({
76244
+ const query = encodeFormQuery({
76245
76245
  "include_input": payload.include_input,
76246
76246
  "last_event_id": payload.last_event_id,
76247
76247
  "stream": payload.stream
@@ -76277,7 +76277,7 @@ async function $do$e(client, id, api_version, include_input, last_event_id, stre
76277
76277
  baseURL: options === null || options === void 0 ? void 0 : options.server_url,
76278
76278
  path: path6,
76279
76279
  headers,
76280
- query: query3,
76280
+ query,
76281
76281
  body,
76282
76282
  userAgent: client._options.user_agent,
76283
76283
  timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1
@@ -76548,7 +76548,7 @@ async function $do$a(client, trigger_id, api_version, page_size, page_token, opt
76548
76548
  })
76549
76549
  };
76550
76550
  const path6 = pathToFunc("/{api_version}/triggers/{trigger_id}/executions")(pathParams);
76551
- const query3 = encodeFormQuery({
76551
+ const query = encodeFormQuery({
76552
76552
  "page_size": payload.page_size,
76553
76553
  "page_token": payload.page_token
76554
76554
  });
@@ -76583,7 +76583,7 @@ async function $do$a(client, trigger_id, api_version, page_size, page_token, opt
76583
76583
  baseURL: options === null || options === void 0 ? void 0 : options.server_url,
76584
76584
  path: path6,
76585
76585
  headers,
76586
- query: query3,
76586
+ query,
76587
76587
  body,
76588
76588
  userAgent: client._options.user_agent,
76589
76589
  timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1
@@ -76625,7 +76625,7 @@ async function $do$9(client, api_version, filter, page_size, page_token, options
76625
76625
  api_version: encodeSimple("api_version", (_a7 = payload === null || payload === void 0 ? void 0 : payload.api_version) !== null && _a7 !== void 0 ? _a7 : client._options.api_version, { explode: false, charEncoding: "percent" })
76626
76626
  };
76627
76627
  const path6 = pathToFunc("/{api_version}/triggers")(pathParams);
76628
- const query3 = encodeFormQuery({
76628
+ const query = encodeFormQuery({
76629
76629
  "filter": payload === null || payload === void 0 ? void 0 : payload.filter,
76630
76630
  "page_size": payload === null || payload === void 0 ? void 0 : payload.page_size,
76631
76631
  "page_token": payload === null || payload === void 0 ? void 0 : payload.page_token
@@ -76661,7 +76661,7 @@ async function $do$9(client, api_version, filter, page_size, page_token, options
76661
76661
  baseURL: options === null || options === void 0 ? void 0 : options.server_url,
76662
76662
  path: path6,
76663
76663
  headers,
76664
- query: query3,
76664
+ query,
76665
76665
  body,
76666
76666
  userAgent: client._options.user_agent,
76667
76667
  timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1
@@ -77071,7 +77071,7 @@ async function $do$3(client, api_version, page_size, page_token, options) {
77071
77071
  api_version: encodeSimple("api_version", (_a7 = payload === null || payload === void 0 ? void 0 : payload.api_version) !== null && _a7 !== void 0 ? _a7 : client._options.api_version, { explode: false, charEncoding: "percent" })
77072
77072
  };
77073
77073
  const path6 = pathToFunc("/{api_version}/webhooks")(pathParams);
77074
- const query3 = encodeFormQuery({
77074
+ const query = encodeFormQuery({
77075
77075
  "page_size": payload === null || payload === void 0 ? void 0 : payload.page_size,
77076
77076
  "page_token": payload === null || payload === void 0 ? void 0 : payload.page_token
77077
77077
  });
@@ -77106,7 +77106,7 @@ async function $do$3(client, api_version, page_size, page_token, options) {
77106
77106
  baseURL: options === null || options === void 0 ? void 0 : options.server_url,
77107
77107
  path: path6,
77108
77108
  headers,
77109
- query: query3,
77109
+ query,
77110
77110
  body,
77111
77111
  userAgent: client._options.user_agent,
77112
77112
  timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1
@@ -77304,7 +77304,7 @@ async function $do(client, id, api_version, update_mask, body, options) {
77304
77304
  })
77305
77305
  };
77306
77306
  const path6 = pathToFunc("/{api_version}/webhooks/{id}")(pathParams);
77307
- const query3 = encodeFormQuery({
77307
+ const query = encodeFormQuery({
77308
77308
  "update_mask": payload.update_mask
77309
77309
  });
77310
77310
  const headers = new Headers(compactMap({
@@ -77339,7 +77339,7 @@ async function $do(client, id, api_version, update_mask, body, options) {
77339
77339
  baseURL: options === null || options === void 0 ? void 0 : options.server_url,
77340
77340
  path: path6,
77341
77341
  headers,
77342
- query: query3,
77342
+ query,
77343
77343
  body: body$,
77344
77344
  userAgent: client._options.user_agent,
77345
77345
  timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1
@@ -77396,12 +77396,12 @@ function toGoogleGenAIRequestOptions(options, streaming = false) {
77396
77396
  if (!options && !streaming) {
77397
77397
  return void 0;
77398
77398
  }
77399
- const _e = options !== null && options !== void 0 ? options : {}, { timeout, maxRetries, defaultBaseURL, query: query3, body, fetchOptions } = _e, rest = __rest(_e, ["timeout", "maxRetries", "defaultBaseURL", "query", "body", "fetchOptions"]);
77399
+ const _e = options !== null && options !== void 0 ? options : {}, { timeout, maxRetries, defaultBaseURL, query, body, fetchOptions } = _e, rest = __rest(_e, ["timeout", "maxRetries", "defaultBaseURL", "query", "body", "fetchOptions"]);
77400
77400
  const nextOptions = Object.assign({}, rest);
77401
- if (isPlainObject(query3)) {
77402
- nextOptions.extra_query = query3;
77401
+ if (isPlainObject(query)) {
77402
+ nextOptions.extra_query = query;
77403
77403
  } else {
77404
- warnIgnoredOption("query", query3);
77404
+ warnIgnoredOption("query", query);
77405
77405
  }
77406
77406
  if (isPlainObject(body)) {
77407
77407
  nextOptions.extra_body = body;
@@ -82477,12 +82477,12 @@ var init_node3 = __esm({
82477
82477
  }
82478
82478
  const inputTools = (_f = (_e = params.config) === null || _e === void 0 ? void 0 : _e.tools) !== null && _f !== void 0 ? _f : [];
82479
82479
  const convertedTools = [];
82480
- for (const tool2 of inputTools) {
82481
- if (this.isCallableTool(tool2)) {
82482
- const callableTool = tool2;
82480
+ for (const tool of inputTools) {
82481
+ if (this.isCallableTool(tool)) {
82482
+ const callableTool = tool;
82483
82483
  convertedTools.push(await callableTool.tool());
82484
82484
  } else {
82485
- convertedTools.push(tool2);
82485
+ convertedTools.push(tool);
82486
82486
  }
82487
82487
  }
82488
82488
  if (convertedTools.length > 0) {
@@ -82509,8 +82509,8 @@ var init_node3 = __esm({
82509
82509
  return session;
82510
82510
  }
82511
82511
  // TODO: b/416041229 - Abstract this method to a common place.
82512
- isCallableTool(tool2) {
82513
- return "callTool" in tool2 && typeof tool2.callTool === "function";
82512
+ isCallableTool(tool) {
82513
+ return "callTool" in tool && typeof tool.callTool === "function";
82514
82514
  }
82515
82515
  };
82516
82516
  defaultLiveSendClientContentParamerters = {
@@ -82753,9 +82753,9 @@ var init_node3 = __esm({
82753
82753
  }
82754
82754
  const responseContent = response.candidates[0].content;
82755
82755
  const functionResponseParts = [];
82756
- for (const tool2 of (_e = (_d = params.config) === null || _d === void 0 ? void 0 : _d.tools) !== null && _e !== void 0 ? _e : []) {
82757
- if (isCallableTool(tool2)) {
82758
- const callableTool = tool2;
82756
+ for (const tool of (_e = (_d = params.config) === null || _d === void 0 ? void 0 : _d.tools) !== null && _e !== void 0 ? _e : []) {
82757
+ if (isCallableTool(tool)) {
82758
+ const callableTool = tool;
82759
82759
  const parts = await callableTool.callTool(response.functionCalls);
82760
82760
  functionResponseParts.push(...parts);
82761
82761
  }
@@ -82942,12 +82942,12 @@ var init_node3 = __esm({
82942
82942
  if (!tools) {
82943
82943
  return params;
82944
82944
  }
82945
- const transformedTools = await Promise.all(tools.map(async (tool2) => {
82946
- if (isCallableTool(tool2)) {
82947
- const callableTool = tool2;
82945
+ const transformedTools = await Promise.all(tools.map(async (tool) => {
82946
+ if (isCallableTool(tool)) {
82947
+ const callableTool = tool;
82948
82948
  return await callableTool.tool();
82949
82949
  }
82950
- return tool2;
82950
+ return tool;
82951
82951
  }));
82952
82952
  const newParams = {
82953
82953
  model: params.model,
@@ -82969,9 +82969,9 @@ var init_node3 = __esm({
82969
82969
  async initAfcToolsMap(params) {
82970
82970
  var _a7, _b, _c;
82971
82971
  const afcTools = /* @__PURE__ */ new Map();
82972
- for (const tool2 of (_b = (_a7 = params.config) === null || _a7 === void 0 ? void 0 : _a7.tools) !== null && _b !== void 0 ? _b : []) {
82973
- if (isCallableTool(tool2)) {
82974
- const callableTool = tool2;
82972
+ for (const tool of (_b = (_a7 = params.config) === null || _a7 === void 0 ? void 0 : _a7.tools) !== null && _b !== void 0 ? _b : []) {
82973
+ if (isCallableTool(tool)) {
82974
+ const callableTool = tool;
82975
82975
  const toolDeclaration = await callableTool.tool();
82976
82976
  for (const declaration of (_c = toolDeclaration.functionDeclarations) !== null && _c !== void 0 ? _c : []) {
82977
82977
  if (!declaration.name) {
@@ -85059,7 +85059,7 @@ var init_node3 = __esm({
85059
85059
  }
85060
85060
  _createRequest(context, conf, options) {
85061
85061
  var _a7, _b, _c, _d, _e;
85062
- const { method, path: path6, query: query3, headers: opHeaders, security } = conf;
85062
+ const { method, path: path6, query, headers: opHeaders, security } = conf;
85063
85063
  const base = (_a7 = conf.baseURL) !== null && _a7 !== void 0 ? _a7 : this._baseURL;
85064
85064
  if (!base) {
85065
85065
  return ERR(new InvalidRequestError("No base URL provided for operation"));
@@ -85103,7 +85103,7 @@ var init_node3 = __esm({
85103
85103
  }).filter((pair) => typeof pair !== "undefined").join("&");
85104
85104
  };
85105
85105
  const finalQuery = [
85106
- query3 || "",
85106
+ query || "",
85107
85107
  encodeQueryRecord((options === null || options === void 0 ? void 0 : options.extra_query) || {}),
85108
85108
  encodeQueryRecord((security === null || security === void 0 ? void 0 : security.queryParams) || {})
85109
85109
  ].reduce(mergeQuery, reqURL.search.slice(1));
@@ -86931,12 +86931,12 @@ function convertTools2(tools, useParameters = false, supportsStrictMode = true)
86931
86931
  return void 0;
86932
86932
  return [
86933
86933
  {
86934
- functionDeclarations: tools.map((tool2) => {
86935
- const strict = resolveJsonSchemaStrictSampling(tool2, supportsStrictMode);
86936
- const parameters = getJsonSchemaToolParameters(tool2, strict);
86934
+ functionDeclarations: tools.map((tool) => {
86935
+ const strict = resolveJsonSchemaStrictSampling(tool, supportsStrictMode);
86936
+ const parameters = getJsonSchemaToolParameters(tool, strict);
86937
86937
  return {
86938
- name: tool2.name,
86939
- description: tool2.description,
86938
+ name: tool.name,
86939
+ description: tool.description,
86940
86940
  ...useParameters ? { parameters: sanitizeForOpenApi(parameters) } : { parametersJsonSchema: parameters }
86941
86941
  };
86942
86942
  })
@@ -86960,7 +86960,7 @@ function mapToolChoice(choice) {
86960
86960
  }
86961
86961
  }
86962
86962
  function resolveGoogleFunctionCallingMode(tools, toolChoice, supportsStrictMode) {
86963
- const useStrictMode = tools.some((tool2) => resolveJsonSchemaStrictSampling(tool2, supportsStrictMode) === true);
86963
+ const useStrictMode = tools.some((tool) => resolveJsonSchemaStrictSampling(tool, supportsStrictMode) === true);
86964
86964
  if (toolChoice === "none" || toolChoice === "any") {
86965
86965
  return mapToolChoice(toolChoice);
86966
86966
  }
@@ -88283,14 +88283,14 @@ async function consumeChatStream(model, output, stream11, mistralStream, onProvi
88283
88283
  }
88284
88284
  }
88285
88285
  function toFunctionTools(tools) {
88286
- return tools.map((tool2) => {
88287
- const strict = resolveJsonSchemaStrictSampling(tool2, true);
88286
+ return tools.map((tool) => {
88287
+ const strict = resolveJsonSchemaStrictSampling(tool, true);
88288
88288
  return {
88289
88289
  type: "function",
88290
88290
  function: {
88291
- name: tool2.name,
88292
- description: tool2.description,
88293
- parameters: stripSymbolKeys(getJsonSchemaToolParameters(tool2, strict)),
88291
+ name: tool.name,
88292
+ description: tool.description,
88293
+ parameters: stripSymbolKeys(getJsonSchemaToolParameters(tool, strict)),
88294
88294
  strict: strict ?? false
88295
88295
  }
88296
88296
  };
@@ -89282,39 +89282,39 @@ async function acquireWebSocket(url, headers, sessionId, accountId, signal, conn
89282
89282
  };
89283
89283
  }
89284
89284
  let accountEntries = websocketSessionCache.get(sessionId);
89285
- const cached = accountEntries?.get(accountId);
89286
- if (cached) {
89287
- if (cached.idleTimer) {
89288
- clearTimeout(cached.idleTimer);
89289
- cached.idleTimer = void 0;
89290
- }
89291
- if (!cached.busy && isWebSocketSessionExpired(cached)) {
89292
- closeWebSocketSilently(cached.socket, 1e3, "connection_age_limit");
89285
+ const cached2 = accountEntries?.get(accountId);
89286
+ if (cached2) {
89287
+ if (cached2.idleTimer) {
89288
+ clearTimeout(cached2.idleTimer);
89289
+ cached2.idleTimer = void 0;
89290
+ }
89291
+ if (!cached2.busy && isWebSocketSessionExpired(cached2)) {
89292
+ closeWebSocketSilently(cached2.socket, 1e3, "connection_age_limit");
89293
89293
  accountEntries?.delete(accountId);
89294
89294
  if (accountEntries?.size === 0)
89295
89295
  websocketSessionCache.delete(sessionId);
89296
- } else if (!cached.busy && isWebSocketReusable(cached.socket)) {
89297
- cached.busy = true;
89296
+ } else if (!cached2.busy && isWebSocketReusable(cached2.socket)) {
89297
+ cached2.busy = true;
89298
89298
  return {
89299
- socket: cached.socket,
89300
- entry: cached,
89299
+ socket: cached2.socket,
89300
+ entry: cached2,
89301
89301
  reused: true,
89302
89302
  release: ({ keep } = {}) => {
89303
- if (!keep || !isWebSocketReusable(cached.socket)) {
89304
- closeWebSocketSilently(cached.socket);
89303
+ if (!keep || !isWebSocketReusable(cached2.socket)) {
89304
+ closeWebSocketSilently(cached2.socket);
89305
89305
  const currentEntries = websocketSessionCache.get(sessionId);
89306
- if (currentEntries?.get(accountId) === cached)
89306
+ if (currentEntries?.get(accountId) === cached2)
89307
89307
  currentEntries.delete(accountId);
89308
89308
  if (currentEntries?.size === 0)
89309
89309
  websocketSessionCache.delete(sessionId);
89310
89310
  return;
89311
89311
  }
89312
- cached.busy = false;
89313
- scheduleSessionWebSocketExpiry(sessionId, accountId, cached);
89312
+ cached2.busy = false;
89313
+ scheduleSessionWebSocketExpiry(sessionId, accountId, cached2);
89314
89314
  }
89315
89315
  };
89316
89316
  }
89317
- if (cached.busy) {
89317
+ if (cached2.busy) {
89318
89318
  const socket2 = await connectWebSocket(url, headers, signal, connectTimeoutMs, env3);
89319
89319
  return {
89320
89320
  socket: socket2,
@@ -89324,8 +89324,8 @@ async function acquireWebSocket(url, headers, sessionId, accountId, signal, conn
89324
89324
  }
89325
89325
  };
89326
89326
  }
89327
- if (!isWebSocketReusable(cached.socket)) {
89328
- closeWebSocketSilently(cached.socket);
89327
+ if (!isWebSocketReusable(cached2.socket)) {
89328
+ closeWebSocketSilently(cached2.socket);
89329
89329
  accountEntries?.delete(accountId);
89330
89330
  if (accountEntries?.size === 0)
89331
89331
  websocketSessionCache.delete(sessionId);
@@ -90639,14 +90639,14 @@ function convertMessages3(model, context, compat, options) {
90639
90639
  return params;
90640
90640
  }
90641
90641
  function convertTools3(tools, compat) {
90642
- return tools.map((tool2) => {
90643
- const grammar = resolveGrammarConstrainedSampling(tool2, compat.supportsOpenAIGrammarTools);
90642
+ return tools.map((tool) => {
90643
+ const grammar = resolveGrammarConstrainedSampling(tool, compat.supportsOpenAIGrammarTools);
90644
90644
  if (grammar) {
90645
90645
  return {
90646
90646
  type: "custom",
90647
90647
  custom: {
90648
- name: tool2.name,
90649
- description: tool2.description,
90648
+ name: tool.name,
90649
+ description: tool.description,
90650
90650
  format: {
90651
90651
  type: "grammar",
90652
90652
  grammar: {
@@ -90657,13 +90657,13 @@ function convertTools3(tools, compat) {
90657
90657
  }
90658
90658
  };
90659
90659
  }
90660
- const strict = resolveJsonSchemaStrictSampling(tool2, compat.supportsStrictMode !== false);
90660
+ const strict = resolveJsonSchemaStrictSampling(tool, compat.supportsStrictMode !== false);
90661
90661
  return {
90662
90662
  type: "function",
90663
90663
  function: {
90664
- name: tool2.name,
90665
- description: tool2.description,
90666
- parameters: getJsonSchemaToolParameters(tool2, strict),
90664
+ name: tool.name,
90665
+ description: tool.description,
90666
+ parameters: getJsonSchemaToolParameters(tool, strict),
90667
90667
  // Only include strict if provider supports it. Some reject unknown fields.
90668
90668
  ...compat.supportsStrictMode !== false && { strict: strict ?? false }
90669
90669
  }
@@ -96146,11 +96146,11 @@ function scalar(wireType, defaultValue, validate, write, read, toJson2, isDefaul
96146
96146
  };
96147
96147
  }
96148
96148
  function messageValue(factory) {
96149
- let cached;
96149
+ let cached2;
96150
96150
  function getCodec() {
96151
- if (!cached)
96152
- cached = factory();
96153
- return cached;
96151
+ if (!cached2)
96152
+ cached2 = factory();
96153
+ return cached2;
96154
96154
  }
96155
96155
  return {
96156
96156
  wireType: 2,
@@ -99892,27 +99892,246 @@ async function refreshKiroModels(options = {}) {
99892
99892
  }
99893
99893
 
99894
99894
  // ../qoder-core/dist/auth.js
99895
- import { existsSync as existsSync6, readdirSync } from "node:fs";
99895
+ import { existsSync as existsSync7, readdirSync } from "node:fs";
99896
99896
  import { homedir as homedir13 } from "node:os";
99897
99897
  import { join as join14 } from "node:path";
99898
- import { accessTokenFromEnv, qodercliAuth } from "@qoder-ai/qoder-agent-sdk";
99899
99898
 
99900
- // ../qoder-core/dist/errors.js
99901
- var QODER_LOGIN_MESSAGE = "No Qoder session found. Run `qodercli login`, or set QODER_PERSONAL_ACCESS_TOKEN.";
99902
- var QoderAuthError = class extends Error {
99903
- constructor(message = QODER_LOGIN_MESSAGE) {
99904
- super(message);
99905
- this.name = "QoderAuthError";
99899
+ // ../qoder-core/dist/store.js
99900
+ import { existsSync as existsSync6, readFileSync as readFileSync9 } from "node:fs";
99901
+ import { createRequire as createRequire4 } from "node:module";
99902
+ import { fileURLToPath, pathToFileURL } from "node:url";
99903
+ var nodeRequire = createRequire4(import.meta.url);
99904
+ var ENCODER = new TextEncoder();
99905
+ var DECODER = new TextDecoder();
99906
+ var wasmGlobal = globalThis;
99907
+ var HEAP_RESERVED = 1028;
99908
+ var HEAP = new Array(1024).fill(void 0);
99909
+ HEAP.push(void 0, null, true, false);
99910
+ var heapNext = HEAP.length;
99911
+ function addHeapObject(obj) {
99912
+ if (heapNext === HEAP.length)
99913
+ HEAP.push(HEAP.length + 1);
99914
+ const idx = heapNext;
99915
+ heapNext = HEAP[idx];
99916
+ HEAP[idx] = obj;
99917
+ return idx;
99918
+ }
99919
+ function takeObject(idx) {
99920
+ const value = HEAP[idx];
99921
+ if (idx >= HEAP_RESERVED) {
99922
+ HEAP[idx] = heapNext;
99923
+ heapNext = idx;
99906
99924
  }
99907
- };
99908
- var QoderApiError = class extends Error {
99909
- code;
99910
- constructor(message, code) {
99911
- super(message);
99912
- this.name = "QoderApiError";
99913
- this.code = code;
99925
+ return value;
99926
+ }
99927
+ function heapOrZero(value) {
99928
+ return value === void 0 || value === null ? 0 : addHeapObject(value);
99929
+ }
99930
+ var cached;
99931
+ function loadExports() {
99932
+ if (cached)
99933
+ return cached;
99934
+ const bytes = readQoderAuthWasm();
99935
+ const module = new wasmGlobal.WebAssembly.Module(bytes);
99936
+ let exports;
99937
+ const instance = new wasmGlobal.WebAssembly.Instance(module, {
99938
+ "./qoder_auth_wasm_bg.js": {
99939
+ __wbindgen_object_drop_ref(i2) {
99940
+ takeObject(i2);
99941
+ },
99942
+ __wbindgen_object_clone_ref(i2) {
99943
+ return addHeapObject(HEAP[i2]);
99944
+ },
99945
+ __wbg___wbindgen_throw_81fc77679af83bc6(p, l) {
99946
+ throw new Error(DECODER.decode(new Uint8Array(exports.memory.buffer, p, l)));
99947
+ },
99948
+ __wbg___wbindgen_is_object_40c5a80572e8f9d3(i2) {
99949
+ const v = HEAP[i2];
99950
+ return typeof v === "object" && v !== null ? 1 : 0;
99951
+ },
99952
+ __wbg___wbindgen_is_string_b29b5c5a8065ba1a(i2) {
99953
+ return typeof HEAP[i2] === "string" ? 1 : 0;
99954
+ },
99955
+ __wbg___wbindgen_is_function_49868bde5eb1e745(i2) {
99956
+ return typeof HEAP[i2] === "function" ? 1 : 0;
99957
+ },
99958
+ __wbg___wbindgen_is_undefined_c0cca72b82b86f4d(i2) {
99959
+ return HEAP[i2] === void 0 ? 1 : 0;
99960
+ },
99961
+ __wbg_Error_2e59b1b37a9a34c3(p, l) {
99962
+ return addHeapObject(new Error(DECODER.decode(new Uint8Array(exports.memory.buffer, p, l))));
99963
+ },
99964
+ __wbg_set_08463b1df38a7e29(map, key, value) {
99965
+ return addHeapObject(HEAP[map].set(HEAP[key], HEAP[value]));
99966
+ },
99967
+ __wbg_getRandomValues_d49329ff89a07af1(ptr, len) {
99968
+ globalThis.crypto.getRandomValues(new Uint8Array(exports.memory.buffer, ptr >>> 0, len >>> 0));
99969
+ },
99970
+ __wbg_getRandomValues_c44a50d8cfdaebeb(a, b) {
99971
+ HEAP[a].getRandomValues(HEAP[b]);
99972
+ },
99973
+ __wbg_crypto_38df2bab126b63dc(i2) {
99974
+ return addHeapObject(HEAP[i2].crypto);
99975
+ },
99976
+ __wbg_process_44c7a14e11e9f69e(i2) {
99977
+ return addHeapObject(HEAP[i2].process);
99978
+ },
99979
+ __wbg_versions_276b2795b1c6a219(i2) {
99980
+ return addHeapObject(HEAP[i2].versions);
99981
+ },
99982
+ __wbg_node_84ea875411254db1(i2) {
99983
+ return addHeapObject(HEAP[i2].node);
99984
+ },
99985
+ __wbg_require_b4edbdcf3e2a1ef0() {
99986
+ return addHeapObject(nodeRequire);
99987
+ },
99988
+ __wbg_msCrypto_bd5a034af96bcba6(i2) {
99989
+ return addHeapObject(HEAP[i2].msCrypto);
99990
+ },
99991
+ __wbg_randomFillSync_6c25eac9869eb53c(a, b) {
99992
+ HEAP[a].randomFillSync(takeObject(b));
99993
+ },
99994
+ __wbg_call_d578befcc3145dee(fn, recv, arg) {
99995
+ return addHeapObject(HEAP[fn].call(HEAP[recv], HEAP[arg]));
99996
+ },
99997
+ __wbg_new_with_length_9cedd08484b73942(len) {
99998
+ return addHeapObject(new Uint8Array(len >>> 0));
99999
+ },
100000
+ __wbg_length_0c32cb8543c8e4c8(i2) {
100001
+ return HEAP[i2].length;
100002
+ },
100003
+ __wbg_prototypesetcall_3e05eb9545565046(ptr, len, src) {
100004
+ Uint8Array.prototype.set.call(new Uint8Array(exports.memory.buffer, ptr >>> 0, len >>> 0), HEAP[src]);
100005
+ },
100006
+ __wbg_subarray_0f98d3fb634508ad(a, b, c) {
100007
+ return addHeapObject(HEAP[a].subarray(b >>> 0, c >>> 0));
100008
+ },
100009
+ __wbg_new_99cabae501c0a8a0() {
100010
+ return addHeapObject(/* @__PURE__ */ new Map());
100011
+ },
100012
+ __wbg_now_88621c9c9a4f3ffc() {
100013
+ return Date.now();
100014
+ },
100015
+ __wbg_static_accessor_GLOBAL_THIS_a1248013d790bf5f() {
100016
+ return heapOrZero(globalThis);
100017
+ },
100018
+ __wbg_static_accessor_SELF_24f78b6d23f286ea() {
100019
+ return heapOrZero(globalThis.self);
100020
+ },
100021
+ __wbg_static_accessor_GLOBAL_f2e0f995a21329ff() {
100022
+ return heapOrZero(globalThis.global);
100023
+ },
100024
+ __wbg_static_accessor_WINDOW_59fd959c540fe405() {
100025
+ return heapOrZero(globalThis.window);
100026
+ },
100027
+ __wbindgen_cast_0000000000000001(ptr, len) {
100028
+ return addHeapObject(new Uint8Array(exports.memory.buffer, ptr >>> 0, len >>> 0));
100029
+ },
100030
+ __wbindgen_cast_0000000000000002(ptr, len) {
100031
+ return addHeapObject(DECODER.decode(new Uint8Array(exports.memory.buffer, ptr >>> 0, len >>> 0)));
100032
+ }
100033
+ }
100034
+ });
100035
+ exports = instance.exports;
100036
+ for (const name of [
100037
+ "memory",
100038
+ "credential_storage_decrypt",
100039
+ "credential_storage_encrypt",
100040
+ "model_cache_decrypt",
100041
+ "qodercontext_new",
100042
+ "qodercontext_prepareInferRequest",
100043
+ "requestresult_url",
100044
+ "requestresult_body",
100045
+ "requestresult_headers",
100046
+ "__wbg_qodercontext_free",
100047
+ "__wbg_requestresult_free",
100048
+ "__wbindgen_export2",
100049
+ "__wbindgen_export3",
100050
+ "__wbindgen_export4",
100051
+ "__wbindgen_add_to_stack_pointer"
100052
+ ]) {
100053
+ if (!exports[name])
100054
+ throw new Error(`qoder auth wasm is missing export ${name}`);
99914
100055
  }
99915
- };
100056
+ cached = exports;
100057
+ return exports;
100058
+ }
100059
+ function readQoderAuthWasm() {
100060
+ const override = process.env.NS_QODER_AUTH_WASM?.trim();
100061
+ if (override)
100062
+ return readFileSync9(pathToFileURL(override));
100063
+ const here = new URL(".", import.meta.url);
100064
+ for (const relative of ["../vendor/qoder-auth.wasm", "./vendor/qoder-auth.wasm", "./qoder-auth.wasm"]) {
100065
+ const url = new URL(relative, here);
100066
+ const file = fileURLToPath(url);
100067
+ if (existsSync6(file))
100068
+ return readFileSync9(file);
100069
+ }
100070
+ throw new Error("qoder auth wasm not found next to the bundle. Set NS_QODER_AUTH_WASM to the qoder-auth.wasm path.");
100071
+ }
100072
+ function passStringToWasm(exports, str) {
100073
+ const bytes = ENCODER.encode(str);
100074
+ const ptr = exports.__wbindgen_export2(bytes.length, 1) >>> 0;
100075
+ new Uint8Array(exports.memory.buffer).set(bytes, ptr);
100076
+ return [ptr, bytes.length];
100077
+ }
100078
+ function callStringString(exports, fn, a, b) {
100079
+ const retptr = exports.__wbindgen_add_to_stack_pointer(-16);
100080
+ try {
100081
+ const [pa, la] = passStringToWasm(exports, a);
100082
+ const [pb2, lb] = passStringToWasm(exports, b);
100083
+ fn(retptr, pa, la, pb2, lb);
100084
+ const view = new Int32Array(exports.memory.buffer, retptr, 4);
100085
+ const [ptr, len, errIdx, hasErr] = [view[0], view[1], view[2], view[3]];
100086
+ if (hasErr !== 0)
100087
+ throw takeObject(errIdx);
100088
+ return DECODER.decode(new Uint8Array(exports.memory.buffer, ptr, len));
100089
+ } finally {
100090
+ exports.__wbindgen_add_to_stack_pointer(16);
100091
+ }
100092
+ }
100093
+ function decryptQoderStore(encrypted, key) {
100094
+ return callStringString(loadExports(), loadExports().credential_storage_decrypt, encrypted, key);
100095
+ }
100096
+ function decryptQoderModelCache(encrypted, uid) {
100097
+ return callStringString(loadExports(), loadExports().model_cache_decrypt, encrypted, uid);
100098
+ }
100099
+ var QODER_SIGNING_EXTRAS = JSON.stringify({
100100
+ client_type: "5",
100101
+ business_product: "cli",
100102
+ business_type: "agent",
100103
+ scene: "assistant"
100104
+ });
100105
+ function storedString(record, field) {
100106
+ const value = record[field];
100107
+ return typeof value === "string" && value.length > 0 ? value : void 0;
100108
+ }
100109
+ function storedNumber(record, field) {
100110
+ const value = record[field];
100111
+ return typeof value === "number" && Number.isFinite(value) ? value : void 0;
100112
+ }
100113
+ function readStoreRecord(configDir) {
100114
+ const encrypted = readFileSync9(`${configDir}/.auth/user`, "utf8");
100115
+ const machineId = readFileSync9(`${configDir}/.auth/machine_id`, "utf8").trim();
100116
+ const plain = decryptQoderStore(encrypted, machineId.slice(0, 16));
100117
+ const parsed = JSON.parse(plain);
100118
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
100119
+ throw new Error("qodercli credential store is not an object");
100120
+ }
100121
+ return { machineId, record: parsed };
100122
+ }
100123
+ function readQoderStore(configDir) {
100124
+ const { record } = readStoreRecord(configDir);
100125
+ return {
100126
+ ...storedString(record, "access_token") ? { accessToken: storedString(record, "access_token") } : {},
100127
+ ...storedString(record, "security_oauth_token") ? { securityOauthToken: storedString(record, "security_oauth_token") } : {},
100128
+ ...storedString(record, "refresh_token") ? { refreshToken: storedString(record, "refresh_token") } : {},
100129
+ ...storedNumber(record, "expire_time") ? { expireTime: storedNumber(record, "expire_time") } : {},
100130
+ ...storedNumber(record, "refresh_token_expire_time") ? { refreshExpireTime: storedNumber(record, "refresh_token_expire_time") } : {},
100131
+ ...storedString(record, "uid") ? { uid: storedString(record, "uid") } : {},
100132
+ ...storedString(record, "email") ? { email: storedString(record, "email") } : {}
100133
+ };
100134
+ }
99916
100135
 
99917
100136
  // ../qoder-core/dist/auth.js
99918
100137
  var QODER_PAT_ENV = "QODER_PERSONAL_ACCESS_TOKEN";
@@ -99925,7 +100144,7 @@ function qoderConfigDir(env3 = process.env, home = homedir13()) {
99925
100144
  }
99926
100145
  function qodercliSessionPresent(env3 = process.env, home = homedir13()) {
99927
100146
  const dir = join14(qoderConfigDir(env3, home), ".auth");
99928
- if (!existsSync6(dir))
100147
+ if (!existsSync7(dir))
99929
100148
  return false;
99930
100149
  try {
99931
100150
  return readdirSync(dir).some((name) => name !== ".lock" && !name.endsWith(".lock"));
@@ -99935,27 +100154,28 @@ function qodercliSessionPresent(env3 = process.env, home = homedir13()) {
99935
100154
  }
99936
100155
  function resolveQoderAuth(env3 = process.env, home = homedir13()) {
99937
100156
  const pat = env3[QODER_PAT_ENV]?.trim();
99938
- if (pat) {
99939
- return { mode: "pat", options: accessTokenFromEnv(QODER_PAT_ENV) };
99940
- }
100157
+ if (pat)
100158
+ return { mode: "pat", token: pat };
99941
100159
  if (env3.QODER_SKIP_QODERCLI_AUTH === "1")
99942
100160
  return void 0;
99943
100161
  if (!qodercliSessionPresent(env3, home))
99944
100162
  return void 0;
99945
- return { mode: "qodercli", options: qodercliAuth() };
99946
- }
99947
- function requireQoderAuth(env3 = process.env, home = homedir13()) {
99948
- const auth = resolveQoderAuth(env3, home);
99949
- if (!auth)
99950
- throw new QoderAuthError(QODER_LOGIN_MESSAGE);
99951
- return auth;
100163
+ try {
100164
+ const store = readQoderStore(qoderConfigDir(env3, home));
100165
+ const token = store.securityOauthToken ?? store.accessToken;
100166
+ return token ? { mode: "qodercli", token } : void 0;
100167
+ } catch {
100168
+ return void 0;
100169
+ }
99952
100170
  }
99953
100171
 
99954
100172
  // ../qoder-core/dist/catalog.js
99955
100173
  var QODER_CATALOG_PROVIDER_ID = "qoder";
99956
100174
  var QODER_CATALOG_FILE = `${QODER_CATALOG_PROVIDER_ID}.models.json`;
99957
- var QODER_DEFAULT_CONTEXT_WINDOW = 2e5;
99958
100175
  var QODER_DEFAULT_MAX_TOKENS = 16384;
100176
+ var QODER_WIRE_BODY_LIMIT_BYTES = 262144;
100177
+ var QODER_WIRE_CONTEXT_WINDOW = QODER_WIRE_BODY_LIMIT_BYTES / 4;
100178
+ var QODER_DEFAULT_CONTEXT_WINDOW = QODER_WIRE_CONTEXT_WINDOW;
99959
100179
  var BOOTSTRAP_IDS = [
99960
100180
  "auto",
99961
100181
  "ultimate",
@@ -99973,6 +100193,29 @@ var BOOTSTRAP_IDS = [
99973
100193
  "dfmodel",
99974
100194
  "mmodel"
99975
100195
  ];
100196
+ var QODER_MODEL_DISPLAY_NAMES = {
100197
+ auto: "Auto",
100198
+ ultimate: "Ultimate",
100199
+ fast: "Fast",
100200
+ efficient: "Efficient",
100201
+ smodel: "Sonus",
100202
+ cmodel: "Cantus",
100203
+ qmodel: "Qwen3.7-Plus",
100204
+ qmodel_38max: "Qwen3.8-Max",
100205
+ qmodel_latest: "Qwen3.7-Max",
100206
+ qmodel_preview: "Qwen3.8-Max-Preview",
100207
+ q35model: "Qwen3.5-Plus",
100208
+ q35model_preview: "Qwen3.7-Max-DogFooding",
100209
+ qfmodel: "Qwen3.8-Flash",
100210
+ kmodel: "Kimi-K2.8-Preview",
100211
+ kmodel_latest: "Kimi-K3.1-Pro",
100212
+ gmodel: "GLM-5.3",
100213
+ gfmodel: "GLM-5.3-Flash",
100214
+ gm51model: "GLM-5.2",
100215
+ dmodel: "DeepSeek-V4-Pro",
100216
+ dfmodel: "DeepSeek-Flash",
100217
+ mmodel: "MiniMax-M3.1-Flash"
100218
+ };
99976
100219
  function qoderBootstrapModels() {
99977
100220
  return BOOTSTRAP_IDS.map((value) => qoderModelFromInfo({ value, isEnabled: true }));
99978
100221
  }
@@ -99990,12 +100233,13 @@ function qoderModelFromInfo(info) {
99990
100233
  });
99991
100234
  const tier = positive(info.defaultContextWindow) ? info.defaultContextWindow : void 0;
99992
100235
  const maxInput = positive(info.maxInputTokens) ? info.maxInputTokens : void 0;
100236
+ const declared = tier !== void 0 && maxInput !== void 0 ? Math.min(tier, maxInput) : tier ?? maxInput ?? QODER_DEFAULT_CONTEXT_WINDOW;
99993
100237
  const base = {
99994
100238
  id: info.value,
99995
- name: info.displayName || info.value,
100239
+ name: info.displayName ?? QODER_MODEL_DISPLAY_NAMES[info.value] ?? info.value,
99996
100240
  reasoning: info.isReasoning === true || efforts.length > 0,
99997
100241
  input: info.isVl === true ? ["text", "image"] : ["text"],
99998
- contextWindow: tier !== void 0 && maxInput !== void 0 ? Math.min(tier, maxInput) : tier ?? maxInput ?? QODER_DEFAULT_CONTEXT_WINDOW,
100242
+ contextWindow: Math.min(declared, QODER_WIRE_CONTEXT_WINDOW),
99999
100243
  maxTokens: positive(info.maxOutputTokens) ? info.maxOutputTokens : QODER_DEFAULT_MAX_TOKENS,
100000
100244
  ...efforts.length > 0 ? { efforts } : {}
100001
100245
  };
@@ -100006,69 +100250,135 @@ function qoderModelsFromModelInfos(models) {
100006
100250
  const out = models.filter((model) => model.isEnabled).map(qoderModelFromInfo);
100007
100251
  return out.length > 0 ? out : qoderBootstrapModels();
100008
100252
  }
100253
+ function asRecord(value) {
100254
+ return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
100255
+ }
100256
+ function nonEmptyString(value) {
100257
+ return typeof value === "string" && value.length > 0 ? value : void 0;
100258
+ }
100259
+ function defaultTierTokens(contextConfig) {
100260
+ const tiers = asRecord(contextConfig);
100261
+ if (!tiers)
100262
+ return void 0;
100263
+ for (const tier of Object.values(tiers)) {
100264
+ const record = asRecord(tier);
100265
+ if (record?.is_default === true && positive(record.token_count))
100266
+ return record.token_count;
100267
+ }
100268
+ return void 0;
100269
+ }
100270
+ function effortNames(thinkingConfig) {
100271
+ const efforts = asRecord(asRecord(asRecord(thinkingConfig)?.enabled)?.efforts);
100272
+ return efforts ? Object.keys(efforts) : [];
100273
+ }
100274
+ function infoFromVendorEntry(entry) {
100275
+ const record = asRecord(entry);
100276
+ const value = nonEmptyString(record?.key);
100277
+ if (!record || !value)
100278
+ return void 0;
100279
+ const maxInput = positive(record.max_input_tokens) ? record.max_input_tokens : void 0;
100280
+ const tier = defaultTierTokens(record.context_config);
100281
+ const efforts = effortNames(record.thinking_config);
100282
+ const displayName = nonEmptyString(record.display_name);
100283
+ return {
100284
+ value,
100285
+ ...displayName ? { displayName } : {},
100286
+ // Missing `enable` is treated as on: an entry the catalog bothered to list is served.
100287
+ isEnabled: record.enable !== false,
100288
+ isReasoning: record.is_reasoning === true,
100289
+ isVl: record.is_vl === true,
100290
+ ...maxInput !== void 0 ? { maxInputTokens: maxInput } : {},
100291
+ ...tier !== void 0 ? { defaultContextWindow: tier } : {},
100292
+ ...efforts.length > 0 ? { efforts } : {}
100293
+ };
100294
+ }
100295
+ function qoderModelInfosFromVendorCatalog(raw, scene) {
100296
+ const root = asRecord(JSON.parse(raw));
100297
+ if (!root)
100298
+ return [];
100299
+ const chosen = [scene, "assistant", "chat"].find((name) => typeof name === "string" && Array.isArray(root[name]));
100300
+ const entries = chosen ? root[chosen] : [];
100301
+ return entries.flatMap((entry) => {
100302
+ const info = infoFromVendorEntry(entry);
100303
+ return info ? [info] : [];
100304
+ });
100305
+ }
100009
100306
 
100010
100307
  // ../qoder-core/dist/models-api.js
100011
- import { query } from "@qoder-ai/qoder-agent-sdk";
100012
- async function fetchQoderModels(options = {}) {
100013
- const auth = options.auth ?? requireQoderAuth();
100014
- const idle = new AbortController();
100015
- if (options.signal?.aborted)
100016
- idle.abort();
100017
- else
100018
- options.signal?.addEventListener("abort", () => idle.abort(), { once: true });
100019
- const q = query({
100020
- prompt: idlePrompt(idle.signal),
100021
- options: {
100022
- auth: auth.options,
100023
- maxTurns: 1,
100024
- permissionMode: "dontAsk",
100025
- tools: [],
100026
- skills: [],
100027
- includePartialMessages: false,
100028
- persistSession: false,
100029
- ...options.signal ? { abortController: abortFromSignal(options.signal) } : {}
100030
- }
100031
- });
100308
+ import { readdirSync as readdirSync2, readFileSync as readFileSync10, statSync as statSync3 } from "node:fs";
100309
+ import { join as join15 } from "node:path";
100310
+ function newestCatalogDirectory(root) {
100032
100311
  try {
100033
- return qoderModelsFromModelInfos(await q.getAvailableModels());
100034
- } catch (error) {
100035
- throw new QoderApiError(error instanceof Error ? error.message : "Failed to list Qoder models");
100036
- } finally {
100037
- idle.abort();
100038
- try {
100039
- await q.interrupt();
100040
- } catch {
100312
+ const dirs = readdirSync2(root, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => join15(root, entry.name)).flatMap((dir) => {
100313
+ try {
100314
+ return [{ dir, mtime: statSync3(dir).mtimeMs }];
100315
+ } catch {
100316
+ return [];
100317
+ }
100318
+ });
100319
+ dirs.sort((a, b) => b.mtime - a.mtime);
100320
+ for (const { dir } of dirs) {
100321
+ const file = newestCatalog(dir);
100322
+ if (file)
100323
+ return { dir, file };
100041
100324
  }
100325
+ return void 0;
100326
+ } catch {
100327
+ return void 0;
100042
100328
  }
100043
100329
  }
100044
- async function* idlePrompt(signal) {
100045
- const { promise, resolve: resolve2 } = Promise.withResolvers();
100046
- const timer = setTimeout(resolve2, 3e4);
100047
- if (signal.aborted) {
100048
- clearTimeout(timer);
100049
- resolve2();
100050
- } else {
100051
- signal.addEventListener("abort", () => {
100052
- clearTimeout(timer);
100053
- resolve2();
100054
- }, { once: true });
100330
+ function newestCatalog(dir) {
100331
+ try {
100332
+ const files = readdirSync2(dir).flatMap((name) => {
100333
+ const match2 = /^catalog-v(\d+)$/.exec(name);
100334
+ return match2 ? [{ file: join15(dir, name), version: Number(match2[1]) }] : [];
100335
+ }).sort((a, b) => b.version - a.version);
100336
+ return files[0]?.file;
100337
+ } catch {
100338
+ return void 0;
100055
100339
  }
100056
- await promise;
100057
100340
  }
100058
- function abortFromSignal(signal) {
100059
- const controller = new AbortController();
100060
- if (signal.aborted)
100061
- controller.abort();
100062
- else
100063
- signal.addEventListener("abort", () => controller.abort(), { once: true });
100064
- return controller;
100341
+ function qoderVendorCatalogFile(configDir) {
100342
+ const root = join15(configDir, ".models");
100343
+ let uid;
100344
+ let scene;
100345
+ try {
100346
+ const pointer = JSON.parse(readFileSync10(join15(root, "default"), "utf8"));
100347
+ if (typeof pointer.uid === "string" && pointer.uid)
100348
+ uid = pointer.uid;
100349
+ if (typeof pointer.scene === "string" && pointer.scene)
100350
+ scene = pointer.scene;
100351
+ } catch {
100352
+ }
100353
+ let dir = uid ? join15(root, uid) : void 0;
100354
+ let file = dir ? newestCatalog(dir) : void 0;
100355
+ if (!file) {
100356
+ const found = newestCatalogDirectory(root);
100357
+ dir = found?.dir;
100358
+ file = found?.file;
100359
+ }
100360
+ if (!dir || !file)
100361
+ return void 0;
100362
+ return { file, uid: dir.slice(root.length + 1), ...scene ? { scene } : {} };
100363
+ }
100364
+ async function fetchQoderModels(_options = {}) {
100365
+ try {
100366
+ const target = qoderVendorCatalogFile(qoderConfigDir());
100367
+ if (!target)
100368
+ return qoderBootstrapModels();
100369
+ const plain = decryptQoderModelCache(readFileSync10(target.file, "utf8"), target.uid);
100370
+ return qoderModelsFromModelInfos(qoderModelInfosFromVendorCatalog(plain, target.scene));
100371
+ } catch {
100372
+ return qoderBootstrapModels();
100373
+ }
100065
100374
  }
100066
100375
 
100067
100376
  // ../qoder-core/dist/stream.js
100068
- import { ProcessTransport, query as query2 } from "@qoder-ai/qoder-agent-sdk";
100069
-
100070
- // ../qoder-core/dist/tools.js
100071
- import { createSdkMcpServer, tool } from "@qoder-ai/qoder-agent-sdk";
100377
+ var ANONYMOUS_SIGNING_IDENTITY = {
100378
+ machineId: "00000000-0000-0000-0000-000000000000",
100379
+ userInfoJson: JSON.stringify({ uid: "", encrypt_user_info: "", key: "" })
100380
+ };
100381
+ var RAW_CONTROL_CHARS = new RegExp("\\p{Cc}", "gu");
100072
100382
 
100073
100383
  // ../pi-provider/src/qoder/register.ts
100074
100384
  var QODER_PROVIDER_ID = "qoder";