@meistrari/chat-nuxt 4.5.0-rc.4 → 4.5.0-rc.5

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.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
3
  "configKey": "chatNuxt",
4
- "version": "4.5.0-rc.4",
4
+ "version": "4.5.0-rc.5",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -629,7 +629,7 @@ async function dispatchMessage(outbound, files, resolvedAgentInputs) {
629
629
  agentWake?.consume();
630
630
  return sent;
631
631
  }
632
- if (agentWake) {
632
+ if (agentWake && !chatApi.conversationV2Enabled) {
633
633
  watch(
634
634
  [outboundOccupied, agentWake.state],
635
635
  async ([occupied, wakeState]) => {
@@ -677,7 +677,7 @@ async function handleRetry(messageId) {
677
677
  selectedModel.value,
678
678
  (value) => persistConversationModel(conversation, value, false)
679
679
  );
680
- if (!agentWake)
680
+ if (!agentWake || chatApi.conversationV2Enabled)
681
681
  return;
682
682
  if (conversation.threadSessionId) {
683
683
  const wake = await agentWake.ensureReady(conversation.threadSessionId, selectedModel.value);
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { resolveToolDisplay, resolveToolMeta, resolveToolTitle } from "../../tool-registry";
2
+ import { resolveToolDisplay, resolveToolMeta, resolveToolTitle, withReportedToolInput } from "../../tool-registry";
3
3
  import ChatBashWidget from "../widgets/chat-bash-widget.vue";
4
4
  import ChatDocSdkWidget from "../widgets/chat-doc-sdk-widget.vue";
5
5
  import ChatGenericToolWidget from "../widgets/chat-generic-tool-widget.vue";
@@ -27,6 +27,7 @@ const TOOL_WIDGETS = {
27
27
  "grep": ChatGrepWidget,
28
28
  "generic": ChatGenericToolWidget
29
29
  };
30
+ const displayToolUse = computed(() => typeof props.step === "string" ? null : withReportedToolInput(props.step.toolUse, props.step.toolResult));
30
31
  const toolDisplay = computed(() => {
31
32
  if (typeof props.step === "string")
32
33
  return null;
@@ -38,7 +39,7 @@ const stepWasExecuted = computed(
38
39
  const stepMeta = computed(() => {
39
40
  if (typeof props.step === "string")
40
41
  return null;
41
- return resolveToolMeta(props.step.toolUse);
42
+ return resolveToolMeta(displayToolUse.value);
42
43
  });
43
44
  const stepTitle = computed(() => {
44
45
  if (typeof props.step === "string")
@@ -72,7 +73,7 @@ const stepTitle = computed(() => {
72
73
  :is="TOOL_WIDGETS[toolDisplay.widgetId]"
73
74
  v-if="step.type === 'tool_group' && toolDisplay"
74
75
  class="chat-reasoning-tool-detail"
75
- :tool-use="step.toolUse"
76
+ :tool-use="displayToolUse"
76
77
  :tool-result="step.toolResult"
77
78
  :is-active="isActive"
78
79
  v-bind="toolDisplay.widgetProps"
@@ -1,4 +1,4 @@
1
- import type { ToolUse } from './reasoning.js';
1
+ import type { ToolUse, ToolResult } from './reasoning.js';
2
2
  export type ToolWidgetId = 'web-search' | 'doc-sdk' | 'workstation-query' | 'tela-skill' | 'bash' | 'write' | 'read' | 'grep' | 'generic';
3
3
  export interface ToolLabels {
4
4
  active: string;
@@ -14,3 +14,8 @@ export declare const TOOL_ICON_SAFELIST: string[];
14
14
  export declare function resolveToolDisplay(toolUse: ToolUse): ToolDisplay;
15
15
  export declare function resolveToolTitle(toolUse: ToolUse, wasExecuted: boolean): string;
16
16
  export declare function resolveToolMeta(toolUse: ToolUse): string | null;
17
+ /**
18
+ * Responses providers report the executed search action in output, not call input.
19
+ * Project it for display only; keep persisted inputs and provider replay untouched.
20
+ */
21
+ export declare function withReportedToolInput(toolUse: ToolUse, toolResult?: ToolResult): ToolUse;
@@ -4,6 +4,11 @@ const TOOL_REGISTRY = {
4
4
  widgetId: "web-search",
5
5
  labels: { active: "Pesquisando na web", executed: "Pesquisou na web" }
6
6
  },
7
+ "web_search": {
8
+ icon: "i-ph-globe",
9
+ widgetId: "generic",
10
+ labels: { active: "Pesquisando na web", executed: "Pesquisou na web" }
11
+ },
7
12
  "WebFetch": {
8
13
  icon: "i-ph-browser",
9
14
  widgetId: "generic",
@@ -120,6 +125,8 @@ export const TOOL_ICON_SAFELIST = [.../* @__PURE__ */ new Set([
120
125
  "i-ph-wrench"
121
126
  ])];
122
127
  export function resolveToolDisplay(toolUse) {
128
+ if (toolUse.name === "Execute")
129
+ return resolveToolDisplay({ ...toolUse, name: "Bash" });
123
130
  const qualifier = toolQualifier(toolUse);
124
131
  if (qualifier) {
125
132
  const qualified = TOOL_REGISTRY[`${toolUse.name}:${qualifier}`];
@@ -155,11 +162,25 @@ export function resolveToolMeta(toolUse) {
155
162
  }
156
163
  if (toolUse.name === "Grep")
157
164
  return stringInput(toolUse, "pattern", "query");
158
- if (toolUse.name === "WebSearch" || toolUse.name === "WebFetch")
165
+ if (["WebSearch", "WebFetch", "web_search"].includes(toolUse.name))
159
166
  return stringInput(toolUse, "query", "url");
160
- if (toolUse.name === "Bash")
167
+ if (toolUse.name === "Bash" || toolUse.name === "Execute")
161
168
  return stringInput(toolUse, "description", "command");
162
169
  if (toolUse.name === "Skill")
163
170
  return stringInput(toolUse, "skill");
164
171
  return toolUse.description?.trim() || null;
165
172
  }
173
+ export function withReportedToolInput(toolUse, toolResult) {
174
+ if (toolUse.name !== "web_search" || Object.keys(toolUse.input ?? {}).length || !toolResult || toolResult.isError)
175
+ return toolUse;
176
+ try {
177
+ const output = JSON.parse(toolResult.output);
178
+ if (!output || typeof output !== "object" || !("action" in output))
179
+ return toolUse;
180
+ const action = output.action;
181
+ if (action && typeof action === "object" && !Array.isArray(action))
182
+ return { ...toolUse, input: action };
183
+ } catch {
184
+ }
185
+ return toolUse;
186
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
- "version": "4.5.0-rc.4",
3
+ "version": "4.5.0-rc.5",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {