@dotobokuri/fleet-console 1.58.0 → 1.58.1

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.
@@ -23142,7 +23142,7 @@ function forChatGptBackend(request) {
23142
23142
  for (const field of CHATGPT_UNSUPPORTED_FIELDS) {
23143
23143
  delete copy[field];
23144
23144
  }
23145
- if (isClaudeCodeSuggestionMode(request)) {
23145
+ if (request.tool_choice === "none" || isClaudeCodeSuggestionMode(request)) {
23146
23146
  delete copy.tools;
23147
23147
  delete copy.tool_choice;
23148
23148
  delete copy.native_tools;
@@ -23989,7 +23989,7 @@ var OpenAIChatCompletionsAdapter = class {
23989
23989
  const controller = new AbortController();
23990
23990
  const unlinkAbort = linkAbortSignal(options.signal, controller);
23991
23991
  const supportsImageInput = imageInputPolicy.get(this)?.(request.model) ?? true;
23992
- const omitTools = suggestionModeToolOmissionPolicy.has(this) && isClaudeCodeSuggestionMode2(request);
23992
+ const omitTools = toolOmissionPolicy.has(this) && shouldOmitTools(request);
23993
23993
  const payload = forChatCompletionsBackend(request, supportsImageInput, omitTools);
23994
23994
  wireLog("openai-chat.wire.request", { url: this.url, payload });
23995
23995
  let response;
@@ -24036,7 +24036,7 @@ var OpenAIChatCompletionsAdapter = class {
24036
24036
  };
24037
24037
  var imageInputPolicy = /* @__PURE__ */ new WeakMap();
24038
24038
  var argumentPruningPolicy = /* @__PURE__ */ new WeakMap();
24039
- var suggestionModeToolOmissionPolicy = /* @__PURE__ */ new WeakMap();
24039
+ var toolOmissionPolicy = /* @__PURE__ */ new WeakMap();
24040
24040
  var CLAUDE_CODE_SUGGESTION_MODE_PREFIX2 = "[SUGGESTION MODE: Suggest what the user might naturally type next into Claude Code.]";
24041
24041
  var CLAUDE_CODE_SUGGESTION_MODE_SUFFIXES = [
24042
24042
  "Reply with ONLY the suggestion.",
@@ -24054,9 +24054,19 @@ var OpencodeGoChatCompletionsAdapter = class extends OpenAIChatCompletionsAdapte
24054
24054
  });
24055
24055
  imageInputPolicy.set(this, (model) => !model.startsWith("deepseek-v4-"));
24056
24056
  argumentPruningPolicy.set(this, true);
24057
- suggestionModeToolOmissionPolicy.set(this, true);
24057
+ toolOmissionPolicy.set(this, true);
24058
+ }
24059
+ /**
24060
+ * preflight sizing은 wire에 실릴 catalog로 세야 한다. no-tools 조건에서는 실제 wire에
24061
+ * 도구가 없는데 전체 catalog를 청구하면 발생하지 않는 비용이 잡힌다.
24062
+ */
24063
+ wireTools(request) {
24064
+ return shouldOmitTools(request) ? [] : request.tools ?? [];
24058
24065
  }
24059
24066
  };
24067
+ function shouldOmitTools(request) {
24068
+ return request.tool_choice === "none" || isClaudeCodeSuggestionMode2(request);
24069
+ }
24060
24070
  function isClaudeCodeSuggestionMode2(request) {
24061
24071
  if (request.tool_choice === "required" || typeof request.tool_choice === "object") return false;
24062
24072
  const last = request.input.at(-1);
@@ -25259,7 +25269,7 @@ var XaiResponsesAdapter = class {
25259
25269
  }
25260
25270
  const controller = new AbortController();
25261
25271
  const unlinkAbort = linkAbortSignal(options.signal, controller);
25262
- const payload = forXaiResponsesBackend(request);
25272
+ const payload = forXaiResponsesBackend(request, xaiWireTools(request));
25263
25273
  wireLog("xai-responses.wire.request", { url: this.url, payload });
25264
25274
  let response;
25265
25275
  try {
@@ -25314,8 +25324,11 @@ var XaiResponsesAdapter = class {
25314
25324
  }, this.functionCallTimeoutMs)
25315
25325
  };
25316
25326
  }
25327
+ wireTools(request) {
25328
+ return xaiWireTools(request) ?? [];
25329
+ }
25317
25330
  };
25318
- function forXaiResponsesBackend(request) {
25331
+ function forXaiResponsesBackend(request, tools = xaiWireTools(request)) {
25319
25332
  const { metadata: _metadata, native_tools: _nativeTools, ...rest } = request;
25320
25333
  return {
25321
25334
  ...rest,
@@ -25327,9 +25340,29 @@ function forXaiResponsesBackend(request) {
25327
25340
  const { reasoning_content: _reasoningContent, ...wireItem } = item;
25328
25341
  return wireItem;
25329
25342
  }),
25330
- ...request.tools === void 0 ? {} : { tools: request.tools.map(({ defer_loading: _deferLoading, ...tool }) => tool) }
25343
+ ...tools === void 0 ? {} : { tools: [...tools] }
25331
25344
  };
25332
25345
  }
25346
+ function xaiWireTools(request) {
25347
+ if (request.tools === void 0) return void 0;
25348
+ const tools = request.tools;
25349
+ const toolSearchActive = tools.some((tool) => isToolSearchName(tool.name));
25350
+ const selectedName = request.tool_choice && typeof request.tool_choice === "object" ? request.tool_choice.name : void 0;
25351
+ const referencedNames = new Set(
25352
+ request.input.flatMap((item) => item.type === "function_call_output" ? item.tool_references ?? [] : [])
25353
+ );
25354
+ return tools.filter((tool) => !toolSearchActive || tool.defer_loading !== true || isToolSearchName(tool.name) || selectedName !== void 0 && toolNameMatches(tool.name, selectedName) || referencedNames.has(tool.name)).map(({ defer_loading: _deferLoading, ...tool }) => tool);
25355
+ }
25356
+ function toolLeafName(name) {
25357
+ const separator = name.lastIndexOf("__");
25358
+ return separator === -1 ? name : name.slice(separator + 2);
25359
+ }
25360
+ function isToolSearchName(name) {
25361
+ return toolLeafName(name).replace(/[_-]/g, "").toLowerCase() === "toolsearch";
25362
+ }
25363
+ function toolNameMatches(declaredName, selectedName) {
25364
+ return declaredName === selectedName || toolLeafName(declaredName) === toolLeafName(selectedName);
25365
+ }
25333
25366
  function parseXaiEventStream(body, options, functionCallTimeoutMs) {
25334
25367
  return assembleXaiFunctionCalls(
25335
25368
  parseUpstreamSseStream(
@@ -25820,7 +25853,7 @@ function retryMessage(clientTools, candidates) {
25820
25853
  const clientToolName = typeof clientTool === "string" ? clientTool : clientTool.clientName;
25821
25854
  const wireName = typeof clientTool === "string" ? clientTool : clientTool.wireName;
25822
25855
  if (seen.has(wireName)) continue;
25823
- if (toolLeafName(clientToolName).toLowerCase() !== candidate.toLowerCase()) continue;
25856
+ if (toolLeafName2(clientToolName).toLowerCase() !== candidate.toLowerCase()) continue;
25824
25857
  seen.add(wireName);
25825
25858
  matches.push(wireName);
25826
25859
  }
@@ -25840,12 +25873,12 @@ function retryMessage(clientTools, candidates) {
25840
25873
  function toolSearchWireName(clientTools) {
25841
25874
  for (const clientTool of clientTools) {
25842
25875
  const clientToolName = typeof clientTool === "string" ? clientTool : clientTool.clientName;
25843
- if (toolLeafName(clientToolName).replace(/[_-]/g, "").toLowerCase() !== "toolsearch") continue;
25876
+ if (toolLeafName2(clientToolName).replace(/[_-]/g, "").toLowerCase() !== "toolsearch") continue;
25844
25877
  return typeof clientTool === "string" ? clientTool : clientTool.wireName;
25845
25878
  }
25846
25879
  return void 0;
25847
25880
  }
25848
- function toolLeafName(name) {
25881
+ function toolLeafName2(name) {
25849
25882
  return name.split("__").at(-1) ?? name;
25850
25883
  }
25851
25884
  function numberValue(value) {
@@ -25996,11 +26029,11 @@ var CURSOR_HOT_PATH_TOOL_LEAVES = [
25996
26029
  "toolsearch"
25997
26030
  ];
25998
26031
  function isCursorHotPathToolName(name) {
25999
- const leaf = toolLeafName2(name).replace(/[_-]/g, "").toLowerCase();
26032
+ const leaf = toolLeafName3(name).replace(/[_-]/g, "").toLowerCase();
26000
26033
  return CURSOR_HOT_PATH_TOOL_LEAVES.includes(leaf);
26001
26034
  }
26002
26035
  function isCursorNativeRedirectToolName(name) {
26003
- const leaf = toolLeafName2(name).replace(/[_-]/g, "").toLowerCase();
26036
+ const leaf = toolLeafName3(name).replace(/[_-]/g, "").toLowerCase();
26004
26037
  return ["read", "grep", "bash", "shellcommand", "execcommand"].includes(leaf);
26005
26038
  }
26006
26039
  function cursorNativeExecRedirect(exec2, tools, providerIdentifier) {
@@ -26585,7 +26618,7 @@ function matchesLeaf(tool, candidates) {
26585
26618
  return candidates.some((candidate) => normalizedLeaf(tool.clientName) === normalizedLeaf(candidate));
26586
26619
  }
26587
26620
  function normalizedLeaf(name) {
26588
- return toolLeafName2(name).replace(/[_-]/g, "").toLowerCase();
26621
+ return toolLeafName3(name).replace(/[_-]/g, "").toLowerCase();
26589
26622
  }
26590
26623
  function normalizedGrepOutputMode(value) {
26591
26624
  if (!value || value === "content") return "content";
@@ -26607,7 +26640,7 @@ function execReply2(exec2, resultName, result) {
26607
26640
  }
26608
26641
  };
26609
26642
  }
26610
- function toolLeafName2(name) {
26643
+ function toolLeafName3(name) {
26611
26644
  return name.split("__").at(-1) ?? name;
26612
26645
  }
26613
26646
  function numberValue2(value) {
package/dist/fleet.mjs CHANGED
@@ -24495,7 +24495,7 @@ function forChatGptBackend(request) {
24495
24495
  for (const field of CHATGPT_UNSUPPORTED_FIELDS) {
24496
24496
  delete copy[field];
24497
24497
  }
24498
- if (isClaudeCodeSuggestionMode(request)) {
24498
+ if (request.tool_choice === "none" || isClaudeCodeSuggestionMode(request)) {
24499
24499
  delete copy.tools;
24500
24500
  delete copy.tool_choice;
24501
24501
  delete copy.native_tools;
@@ -26069,7 +26069,7 @@ var OpenAIChatCompletionsAdapter = class {
26069
26069
  const controller = new AbortController();
26070
26070
  const unlinkAbort = linkAbortSignal(options.signal, controller);
26071
26071
  const supportsImageInput = imageInputPolicy.get(this)?.(request.model) ?? true;
26072
- const omitTools = suggestionModeToolOmissionPolicy.has(this) && isClaudeCodeSuggestionMode2(request);
26072
+ const omitTools = toolOmissionPolicy.has(this) && shouldOmitTools(request);
26073
26073
  const payload = forChatCompletionsBackend(request, supportsImageInput, omitTools);
26074
26074
  wireLog("openai-chat.wire.request", { url: this.url, payload });
26075
26075
  let response;
@@ -26116,7 +26116,7 @@ var OpenAIChatCompletionsAdapter = class {
26116
26116
  };
26117
26117
  var imageInputPolicy = /* @__PURE__ */ new WeakMap();
26118
26118
  var argumentPruningPolicy = /* @__PURE__ */ new WeakMap();
26119
- var suggestionModeToolOmissionPolicy = /* @__PURE__ */ new WeakMap();
26119
+ var toolOmissionPolicy = /* @__PURE__ */ new WeakMap();
26120
26120
  var CLAUDE_CODE_SUGGESTION_MODE_PREFIX2 = "[SUGGESTION MODE: Suggest what the user might naturally type next into Claude Code.]";
26121
26121
  var CLAUDE_CODE_SUGGESTION_MODE_SUFFIXES = [
26122
26122
  "Reply with ONLY the suggestion.",
@@ -26134,9 +26134,19 @@ var OpencodeGoChatCompletionsAdapter = class extends OpenAIChatCompletionsAdapte
26134
26134
  });
26135
26135
  imageInputPolicy.set(this, (model) => !model.startsWith("deepseek-v4-"));
26136
26136
  argumentPruningPolicy.set(this, true);
26137
- suggestionModeToolOmissionPolicy.set(this, true);
26137
+ toolOmissionPolicy.set(this, true);
26138
+ }
26139
+ /**
26140
+ * preflight sizing은 wire에 실릴 catalog로 세야 한다. no-tools 조건에서는 실제 wire에
26141
+ * 도구가 없는데 전체 catalog를 청구하면 발생하지 않는 비용이 잡힌다.
26142
+ */
26143
+ wireTools(request) {
26144
+ return shouldOmitTools(request) ? [] : request.tools ?? [];
26138
26145
  }
26139
26146
  };
26147
+ function shouldOmitTools(request) {
26148
+ return request.tool_choice === "none" || isClaudeCodeSuggestionMode2(request);
26149
+ }
26140
26150
  function isClaudeCodeSuggestionMode2(request) {
26141
26151
  if (request.tool_choice === "required" || typeof request.tool_choice === "object") return false;
26142
26152
  const last = request.input.at(-1);
@@ -27549,7 +27559,7 @@ var XaiResponsesAdapter = class {
27549
27559
  }
27550
27560
  const controller = new AbortController();
27551
27561
  const unlinkAbort = linkAbortSignal(options.signal, controller);
27552
- const payload = forXaiResponsesBackend(request);
27562
+ const payload = forXaiResponsesBackend(request, xaiWireTools(request));
27553
27563
  wireLog("xai-responses.wire.request", { url: this.url, payload });
27554
27564
  let response;
27555
27565
  try {
@@ -27604,8 +27614,11 @@ var XaiResponsesAdapter = class {
27604
27614
  }, this.functionCallTimeoutMs)
27605
27615
  };
27606
27616
  }
27617
+ wireTools(request) {
27618
+ return xaiWireTools(request) ?? [];
27619
+ }
27607
27620
  };
27608
- function forXaiResponsesBackend(request) {
27621
+ function forXaiResponsesBackend(request, tools = xaiWireTools(request)) {
27609
27622
  const { metadata: _metadata, native_tools: _nativeTools, ...rest } = request;
27610
27623
  return {
27611
27624
  ...rest,
@@ -27617,9 +27630,29 @@ function forXaiResponsesBackend(request) {
27617
27630
  const { reasoning_content: _reasoningContent, ...wireItem } = item;
27618
27631
  return wireItem;
27619
27632
  }),
27620
- ...request.tools === void 0 ? {} : { tools: request.tools.map(({ defer_loading: _deferLoading, ...tool }) => tool) }
27633
+ ...tools === void 0 ? {} : { tools: [...tools] }
27621
27634
  };
27622
27635
  }
27636
+ function xaiWireTools(request) {
27637
+ if (request.tools === void 0) return void 0;
27638
+ const tools = request.tools;
27639
+ const toolSearchActive = tools.some((tool) => isToolSearchName(tool.name));
27640
+ const selectedName = request.tool_choice && typeof request.tool_choice === "object" ? request.tool_choice.name : void 0;
27641
+ const referencedNames = new Set(
27642
+ request.input.flatMap((item) => item.type === "function_call_output" ? item.tool_references ?? [] : [])
27643
+ );
27644
+ return tools.filter((tool) => !toolSearchActive || tool.defer_loading !== true || isToolSearchName(tool.name) || selectedName !== void 0 && toolNameMatches(tool.name, selectedName) || referencedNames.has(tool.name)).map(({ defer_loading: _deferLoading, ...tool }) => tool);
27645
+ }
27646
+ function toolLeafName(name) {
27647
+ const separator = name.lastIndexOf("__");
27648
+ return separator === -1 ? name : name.slice(separator + 2);
27649
+ }
27650
+ function isToolSearchName(name) {
27651
+ return toolLeafName(name).replace(/[_-]/g, "").toLowerCase() === "toolsearch";
27652
+ }
27653
+ function toolNameMatches(declaredName, selectedName) {
27654
+ return declaredName === selectedName || toolLeafName(declaredName) === toolLeafName(selectedName);
27655
+ }
27623
27656
  function parseXaiEventStream(body2, options, functionCallTimeoutMs) {
27624
27657
  return assembleXaiFunctionCalls(
27625
27658
  parseUpstreamSseStream(
@@ -28110,7 +28143,7 @@ function retryMessage(clientTools, candidates) {
28110
28143
  const clientToolName = typeof clientTool === "string" ? clientTool : clientTool.clientName;
28111
28144
  const wireName = typeof clientTool === "string" ? clientTool : clientTool.wireName;
28112
28145
  if (seen.has(wireName)) continue;
28113
- if (toolLeafName(clientToolName).toLowerCase() !== candidate.toLowerCase()) continue;
28146
+ if (toolLeafName2(clientToolName).toLowerCase() !== candidate.toLowerCase()) continue;
28114
28147
  seen.add(wireName);
28115
28148
  matches.push(wireName);
28116
28149
  }
@@ -28130,12 +28163,12 @@ function retryMessage(clientTools, candidates) {
28130
28163
  function toolSearchWireName(clientTools) {
28131
28164
  for (const clientTool of clientTools) {
28132
28165
  const clientToolName = typeof clientTool === "string" ? clientTool : clientTool.clientName;
28133
- if (toolLeafName(clientToolName).replace(/[_-]/g, "").toLowerCase() !== "toolsearch") continue;
28166
+ if (toolLeafName2(clientToolName).replace(/[_-]/g, "").toLowerCase() !== "toolsearch") continue;
28134
28167
  return typeof clientTool === "string" ? clientTool : clientTool.wireName;
28135
28168
  }
28136
28169
  return void 0;
28137
28170
  }
28138
- function toolLeafName(name) {
28171
+ function toolLeafName2(name) {
28139
28172
  return name.split("__").at(-1) ?? name;
28140
28173
  }
28141
28174
  function numberValue(value) {
@@ -28286,11 +28319,11 @@ var CURSOR_HOT_PATH_TOOL_LEAVES = [
28286
28319
  "toolsearch"
28287
28320
  ];
28288
28321
  function isCursorHotPathToolName(name) {
28289
- const leaf = toolLeafName2(name).replace(/[_-]/g, "").toLowerCase();
28322
+ const leaf = toolLeafName3(name).replace(/[_-]/g, "").toLowerCase();
28290
28323
  return CURSOR_HOT_PATH_TOOL_LEAVES.includes(leaf);
28291
28324
  }
28292
28325
  function isCursorNativeRedirectToolName(name) {
28293
- const leaf = toolLeafName2(name).replace(/[_-]/g, "").toLowerCase();
28326
+ const leaf = toolLeafName3(name).replace(/[_-]/g, "").toLowerCase();
28294
28327
  return ["read", "grep", "bash", "shellcommand", "execcommand"].includes(leaf);
28295
28328
  }
28296
28329
  function cursorNativeExecRedirect(exec2, tools, providerIdentifier) {
@@ -28875,7 +28908,7 @@ function matchesLeaf(tool, candidates) {
28875
28908
  return candidates.some((candidate) => normalizedLeaf(tool.clientName) === normalizedLeaf(candidate));
28876
28909
  }
28877
28910
  function normalizedLeaf(name) {
28878
- return toolLeafName2(name).replace(/[_-]/g, "").toLowerCase();
28911
+ return toolLeafName3(name).replace(/[_-]/g, "").toLowerCase();
28879
28912
  }
28880
28913
  function normalizedGrepOutputMode(value) {
28881
28914
  if (!value || value === "content") return "content";
@@ -28897,7 +28930,7 @@ function execReply2(exec2, resultName, result) {
28897
28930
  }
28898
28931
  };
28899
28932
  }
28900
- function toolLeafName2(name) {
28933
+ function toolLeafName3(name) {
28901
28934
  return name.split("__").at(-1) ?? name;
28902
28935
  }
28903
28936
  function numberValue2(value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotobokuri/fleet-console",
3
- "version": "1.58.0",
3
+ "version": "1.58.1",
4
4
  "description": "Fleet Console — sole owner of the fleet and fleet-console bins, Console web surface, and thin Claude Code launcher.",
5
5
  "repository": {
6
6
  "type": "git",