ghostykit 0.5.0 → 0.5.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.
@@ -114,7 +114,7 @@ function createPilotState(turns = []) {
114
114
  effects: []
115
115
  };
116
116
  }
117
- var PROTOCOL_CUSTOM = /* @__PURE__ */ new Set(["ghosty.title", "ghosty.injected", "ghosty.history"]);
117
+ var PROTOCOL_CUSTOM = /* @__PURE__ */ new Set(["ghosty.title", "ghosty.injected", "ghosty.history", "ghosty.tool"]);
118
118
  function patchAssistant(s, patch) {
119
119
  const turns = [...s.turns];
120
120
  const last = turns[turns.length - 1];
@@ -321,6 +321,17 @@ function reduceAgUiEvent(prev, e, now = Date.now()) {
321
321
  case "CUSTOM":
322
322
  if (e.name === "ghosty.title") return { ...s, effects: [{ type: "title", title: e.value?.title }] };
323
323
  if (e.name === "ghosty.history") return { ...s, historyNext: toHistory(e.value) };
324
+ if (e.name === "ghosty.tool") {
325
+ const v = e.value ?? {};
326
+ if (typeof v.toolCallId !== "string") return s;
327
+ const str = (x) => typeof x === "string" && x ? x : void 0;
328
+ const patch = {};
329
+ if (str(v.title)) patch.label = str(v.title);
330
+ if (str(v.kind)) patch.kind = str(v.kind);
331
+ if (str(v.path)) patch.path = str(v.path);
332
+ if (str(v.detail)) patch.detail = str(v.detail);
333
+ return upsertTool(s, v.toolCallId, patch);
334
+ }
324
335
  if (typeof e.name !== "string" || PROTOCOL_CUSTOM.has(e.name)) return s;
325
336
  return patchAssistant(s, (t) => ({ ...t, custom: [...t.custom ?? [], { name: e.name, value: e.value, ...typeof e.timestamp === "number" ? { timestamp: e.timestamp } : {} }] }));
326
337
  default:
@@ -504,6 +515,7 @@ function namedVerb(t, verbs) {
504
515
  return null;
505
516
  }
506
517
  function stepLabel(t, verbs, fallback = "Paso") {
518
+ if (t.label) return t.label;
507
519
  const named = namedVerb(t, verbs);
508
520
  if (named) return isRunning(t) && named.verb.running ? named.verb.running : named.verb.one;
509
521
  return t.title ?? t.kind ?? fallback;
@@ -27,7 +27,7 @@ import {
27
27
  toPermission,
28
28
  toolName,
29
29
  toolNames
30
- } from "../chunks/chunk-VK54J63C.js";
30
+ } from "../chunks/chunk-ULNSZHZV.js";
31
31
  import {
32
32
  applyReferences,
33
33
  cleanUserText,
@@ -14,6 +14,8 @@ export interface ToolEntry {
14
14
  id: string;
15
15
  /** El nombre de la herramienta (`toolCallName`): es la llave de los verbos de la app. */
16
16
  title?: string;
17
+ /** El rótulo que puso el servidor (`CUSTOM ghosty.tool`): gana sobre los verbos de la app. */
18
+ label?: string;
17
19
  kind?: string;
18
20
  /** `in_progress` mientras corre; `completed` | `failed` con su resultado; `pending` = espera
19
21
  * aprobación; `cancelled` = el run se detuvo antes de que terminara. */
@@ -27,7 +27,7 @@ import {
27
27
  toPermission,
28
28
  toolName,
29
29
  toolNames
30
- } from "../chunks/chunk-VK54J63C.js";
30
+ } from "../chunks/chunk-ULNSZHZV.js";
31
31
  import {
32
32
  PilotHttpError,
33
33
  createAgUiTransport,
@@ -887,7 +887,7 @@ var STRINGS_ES = {
887
887
  linkOpen: "Abrir",
888
888
  close: "Cerrar",
889
889
  goToLatest: "Ir al \xFAltimo mensaje",
890
- steps: { waking: "Despertando al agente\u2026", session: "Preparando la sesi\xF3n\u2026" },
890
+ steps: { waking: "Despertando al agente\u2026", session: "Preparando la sesi\xF3n\u2026", compacting: "Resumiendo la conversaci\xF3n\u2026" },
891
891
  loadOlder: "Cargar mensajes anteriores",
892
892
  loadingOlder: "Cargando\u2026",
893
893
  confirmTitle: "Necesito tu permiso para",
@@ -955,7 +955,7 @@ var STRINGS_EN = {
955
955
  linkOpen: "Open",
956
956
  close: "Close",
957
957
  goToLatest: "Go to latest message",
958
- steps: { waking: "Waking the agent\u2026", session: "Starting the session\u2026" },
958
+ steps: { waking: "Waking the agent\u2026", session: "Starting the session\u2026", compacting: "Compacting the conversation\u2026" },
959
959
  loadOlder: "Load earlier messages",
960
960
  loadingOlder: "Loading\u2026",
961
961
  confirmTitle: "I need your permission to",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ghostykit",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
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",