ghostykit 0.6.4 → 0.6.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.
@@ -70,6 +70,15 @@ export interface PilotoProps extends UsePilotOptions {
70
70
  text: string;
71
71
  key?: string | number;
72
72
  } | null;
73
+ /**
74
+ * Trabajo que sigue FUERA del run (ayudantes en segundo plano, una tarea larga): con el run ya
75
+ * cerrado, el hilo enseña `label` y cuenta desde `since` (ms) para que no parezca terminado.
76
+ * Con un run vivo manda su propia espera. `null` = nada pendiente.
77
+ */
78
+ background?: {
79
+ label: string;
80
+ since: number;
81
+ } | null;
73
82
  /** Referencias controladas (si no, Piloto las guarda; agrégalas con `ref.addReference`). */
74
83
  references?: Reference[];
75
84
  onReferencesChange?: (refs: Reference[]) => void;
@@ -1,6 +1,8 @@
1
1
  /** Los tres puntitos de «escribiendo» (color y animación en CSS: `gc-typing`). */
2
2
  export declare function TypingDots(): import("react").JSX.Element;
3
- export declare function WaitLabel({ since, showDuration, step, }: {
3
+ export declare function WaitLabel({ since, showDuration, step, text, }: {
4
+ /** Frase fija que gana a las del turno (p. ej. «2 ayudantes trabajando» con el run ya cerrado). */
5
+ text?: string | null;
4
6
  /** El paso con nombre en curso (`STEP_STARTED`): si `strings.steps` lo nombra, esa es la frase. */
5
7
  step?: string | null;
6
8
  /** Desde que se MANDÓ el mensaje (no desde que se montó la etiqueta). */
@@ -2285,7 +2285,8 @@ function TypingDots() {
2285
2285
  function WaitLabel({
2286
2286
  since,
2287
2287
  showDuration = true,
2288
- step
2288
+ step,
2289
+ text
2289
2290
  }) {
2290
2291
  const { strings: t } = usePiloto();
2291
2292
  const [mounted] = useState7(() => Date.now());
@@ -2297,7 +2298,7 @@ function WaitLabel({
2297
2298
  const seconds = Math.max(0, Math.floor((now - (since || mounted)) / 1e3));
2298
2299
  const phrases = t.thinkingPhrases;
2299
2300
  const stepText = step ? t.steps?.[step] : void 0;
2300
- const what = stepText ? stepText : phrases?.length ? seconds >= STILL_WORKING_S ? t.stillWorking : phrases[Math.floor(seconds / 4) % phrases.length] : t.howItGoes(seconds);
2301
+ const what = text ? text : stepText ? stepText : phrases?.length ? seconds >= STILL_WORKING_S ? t.stillWorking : phrases[Math.floor(seconds / 4) % phrases.length] : t.howItGoes(seconds);
2301
2302
  return /* @__PURE__ */ jsx9("div", { className: "flex flex-col gap-0.5 text-sm text-text-secondary", children: /* @__PURE__ */ jsxs7("p", { className: "flex items-center", children: [
2302
2303
  /* @__PURE__ */ jsx9(AnimatePresence2, { mode: "wait", initial: false, children: /* @__PURE__ */ jsx9(
2303
2304
  motion2.span,
@@ -2912,6 +2913,10 @@ var Piloto = forwardRef3(function Piloto2(props, handle) {
2912
2913
  /* @__PURE__ */ jsx10(TypingDots, {}),
2913
2914
  /* @__PURE__ */ jsx10(WaitLabel, { since: state.turnStartedAt, step: state.step, showDuration: features.duration !== false })
2914
2915
  ] }),
2916
+ !busy && props.background && /* @__PURE__ */ jsxs8("div", { "data-background": true, className: "flex flex-col gap-1.5", children: [
2917
+ /* @__PURE__ */ jsx10(TypingDots, {}),
2918
+ /* @__PURE__ */ jsx10(WaitLabel, { text: props.background.label, since: props.background.since, showDuration: features.duration !== false })
2919
+ ] }),
2915
2920
  notice && /* @__PURE__ */ jsx10("p", { className: "text-sm text-text-tertiary", children: notice }),
2916
2921
  error && /* @__PURE__ */ jsx10("p", { className: "text-sm text-text-danger", children: error })
2917
2922
  ] }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ghostykit",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
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",