ghostykit 0.6.3 → 0.6.4
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.
|
@@ -193,7 +193,7 @@ function toolLabel(t, v) {
|
|
|
193
193
|
if (str(x.title)) patch.label = str(x.title);
|
|
194
194
|
if (str(x.kind)) patch.kind = str(x.kind);
|
|
195
195
|
if (str(x.path)) patch.path = str(x.path);
|
|
196
|
-
if (str(x.detail)) patch
|
|
196
|
+
if (str(x.detail)) Object.assign(patch, { detail: str(x.detail), detailFromServer: true });
|
|
197
197
|
t.tools = (t.tools ?? []).map((y) => y.id === x.toolCallId ? { ...y, ...patch } : y);
|
|
198
198
|
}
|
|
199
199
|
function applyStoredCustom(t, m) {
|
|
@@ -259,7 +259,8 @@ function applySnapshot(s, messages) {
|
|
|
259
259
|
const tools = t.tools?.map((x) => {
|
|
260
260
|
const prev = o?.role === t.role ? o.tools?.find((y) => y.id === x.id) : void 0;
|
|
261
261
|
const status = x.status === "pending" && (prev?.status ?? (live ? "in_progress" : void 0));
|
|
262
|
-
|
|
262
|
+
const keepDetail = prev?.detailFromServer && !x.detailFromServer ? { detail: prev.detail, detailFromServer: true } : {};
|
|
263
|
+
return { ...prev, ...x, ...status ? { status } : {}, ...keepDetail };
|
|
263
264
|
});
|
|
264
265
|
const base = tools ? { ...t, tools } : t;
|
|
265
266
|
if (!o || o.role !== t.role) return base;
|
|
@@ -325,6 +326,7 @@ function reduceAgUiEvent(prev, e, now = Date.now()) {
|
|
|
325
326
|
}
|
|
326
327
|
case "TOOL_CALL_END": {
|
|
327
328
|
const known = s.turns[s.turns.length - 1]?.tools?.find((x) => x.id === e.toolCallId);
|
|
329
|
+
if (known?.detailFromServer) return s;
|
|
328
330
|
return upsertTool(s, e.toolCallId, { detail: argsDetail(known?.args) });
|
|
329
331
|
}
|
|
330
332
|
case "TOOL_CALL_RESULT": {
|
|
@@ -369,7 +371,7 @@ function reduceAgUiEvent(prev, e, now = Date.now()) {
|
|
|
369
371
|
if (str(v.title)) patch.label = str(v.title);
|
|
370
372
|
if (str(v.kind)) patch.kind = str(v.kind);
|
|
371
373
|
if (str(v.path)) patch.path = str(v.path);
|
|
372
|
-
if (str(v.detail)) patch
|
|
374
|
+
if (str(v.detail)) Object.assign(patch, { detail: str(v.detail), detailFromServer: true });
|
|
373
375
|
return upsertTool(s, v.toolCallId, patch);
|
|
374
376
|
}
|
|
375
377
|
if (e.name === "ghosty.replace") {
|
package/dist/core/index.js
CHANGED
package/dist/core/types.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ export interface ToolEntry {
|
|
|
23
23
|
path?: string;
|
|
24
24
|
/** Los argumentos, en corto («job: purge-notifications»). */
|
|
25
25
|
detail?: string;
|
|
26
|
+
/** `detail` lo puso el servidor (`ghosty.tool`): ya no se deriva de los argumentos. */
|
|
27
|
+
detailFromServer?: boolean;
|
|
26
28
|
/** Los argumentos en JSON tal como llegaron (TOOL_CALL_ARGS). */
|
|
27
29
|
args?: string;
|
|
28
30
|
}
|
package/dist/react/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ghostykit",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "Ghosty Autopilot \u2014 the autopilot chat for your React app, on AG-UI: works with LangGraph, Mastra, CrewAI or any AG-UI agent. Streaming text, agent steps, human approval cards (interrupt/resume), attachments and voice.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/core/index.js",
|