camouflage-tui 2.2.2-beta.1 → 2.4.0-beta.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.
- package/package.json +1 -1
- package/src/binding.d.ts +2 -0
- package/src/binding.js +2 -0
- package/src/types.d.ts +31 -3
- package/src/types.js +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "camouflage-tui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0-beta.1",
|
|
4
4
|
"description": "High-performance terminal renderer for AI agent applications. A React Ink alternative built for streaming, persistence, and replay.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
package/src/binding.d.ts
CHANGED
|
@@ -212,6 +212,8 @@ export interface CamouflageHandle extends EventEmitter {
|
|
|
212
212
|
on(event: "wizardCancelled", listener: (resp: WizardCancelledEvent) => void): this;
|
|
213
213
|
on(event: "modeChangeRequested", listener: (resp: { direction: "next" | "prev" }) => void): this;
|
|
214
214
|
on(event: "cancelRequested", listener: () => void): this;
|
|
215
|
+
/** The user is typing a path after `@`; answer with MentionCandidatesRegistered { for_query, candidates }. */
|
|
216
|
+
on(event: "mentionQuery", listener: (q: { query: string }) => void): this;
|
|
215
217
|
on(event: "event", listener: (ev: Event) => void): this;
|
|
216
218
|
on(event: "invalid", listener: (info: InvalidEvent) => void): this;
|
|
217
219
|
on(event: "stderr", listener: (chunk: string) => void): this;
|
package/src/binding.js
CHANGED
|
@@ -342,6 +342,8 @@ export async function mount(opts = {}) {
|
|
|
342
342
|
process.stderr.write(`[sdk:esc] CancelRequested line arrived, emitting cancelRequested\n`);
|
|
343
343
|
}
|
|
344
344
|
handle.emit("cancelRequested", {});
|
|
345
|
+
} else if (ev.event_type === "MentionQuery") {
|
|
346
|
+
handle.emit("mentionQuery", { query: ev.payload?.query ?? "" });
|
|
345
347
|
}
|
|
346
348
|
// Always also emit the raw Event for advanced consumers.
|
|
347
349
|
handle.emit("event", ev);
|
package/src/types.d.ts
CHANGED
|
@@ -51,7 +51,9 @@ export type EventType =
|
|
|
51
51
|
| "CancelRequested"
|
|
52
52
|
| "TranscriptCleared"
|
|
53
53
|
| "Splash"
|
|
54
|
-
| "ShowToast"
|
|
54
|
+
| "ShowToast"
|
|
55
|
+
| "MentionQuery"
|
|
56
|
+
| "AssistantReasoningDelta";
|
|
55
57
|
|
|
56
58
|
export type Direction = "inbound" | "outbound";
|
|
57
59
|
|
|
@@ -194,16 +196,32 @@ export type MentionCandidate = {
|
|
|
194
196
|
label?: string;
|
|
195
197
|
kind?: string;
|
|
196
198
|
};
|
|
197
|
-
export type MentionCandidatesRegistered = {
|
|
199
|
+
export type MentionCandidatesRegistered = {
|
|
200
|
+
candidates: MentionCandidate[];
|
|
201
|
+
/** Set when answering a MentionQuery: the directory part these entries are
|
|
202
|
+
* for (e.g. "../"). Without it the list replaces the default candidates. */
|
|
203
|
+
for_query?: string;
|
|
204
|
+
};
|
|
198
205
|
|
|
199
206
|
export type SelectListOption = {
|
|
200
207
|
value: string;
|
|
201
208
|
label: string;
|
|
209
|
+
/** Dim text after the label; also searched. */
|
|
202
210
|
description?: string;
|
|
211
|
+
/** Group header shown above the first option of each group (hidden while searching). */
|
|
212
|
+
section?: string;
|
|
213
|
+
/** Values drawn in aligned columns after the label, e.g. ["256k", "$0.60 / $2.50"]. */
|
|
214
|
+
columns?: string[];
|
|
215
|
+
/** Draws an on/off badge, e.g. for enabled skills. */
|
|
216
|
+
state?: "on" | "off";
|
|
217
|
+
/** Extra text the search matches against. */
|
|
218
|
+
keywords?: string;
|
|
203
219
|
};
|
|
204
220
|
export type ShowSelectList = {
|
|
205
221
|
id: string;
|
|
206
222
|
prompt: string;
|
|
223
|
+
/** A dim line under the prompt. */
|
|
224
|
+
subtitle?: string;
|
|
207
225
|
options: SelectListOption[];
|
|
208
226
|
default?: string;
|
|
209
227
|
allow_filter?: boolean;
|
|
@@ -250,7 +268,7 @@ export type ShowKeyValueView = {
|
|
|
250
268
|
items: KeyValueItem[];
|
|
251
269
|
};
|
|
252
270
|
|
|
253
|
-
export type FormFieldKind = "text" | "password";
|
|
271
|
+
export type FormFieldKind = "text" | "password" | "multiline";
|
|
254
272
|
export type FormField = {
|
|
255
273
|
name: string;
|
|
256
274
|
label: string;
|
|
@@ -325,6 +343,13 @@ export type ShowToast = {
|
|
|
325
343
|
ttl_ms?: number;
|
|
326
344
|
};
|
|
327
345
|
|
|
346
|
+
/**
|
|
347
|
+
* Renderer → host: the user is typing a path after `@` (`./`, `../`, `~`,
|
|
348
|
+
* `/`). Answer with MentionCandidatesRegistered `{ for_query, candidates }`
|
|
349
|
+
* listing that directory; folder tokens end in "/".
|
|
350
|
+
*/
|
|
351
|
+
export type MentionQuery = { query: string };
|
|
352
|
+
|
|
328
353
|
/** A diff to show inline: full before/after text, or a unified diff. */
|
|
329
354
|
export type DiffPayload = {
|
|
330
355
|
path: string;
|
|
@@ -343,6 +368,8 @@ export type Event = EnvelopeMeta &
|
|
|
343
368
|
| { event_type: "UserMessageCreated"; payload: UserMessage }
|
|
344
369
|
| { event_type: "AssistantStreamStarted"; payload: AssistantStreamStarted }
|
|
345
370
|
| { event_type: "AssistantTokenDelta"; payload: AssistantTokenDelta }
|
|
371
|
+
/** v2.4+: the model's reasoning, shown when the user presses Ctrl+R (inline UI). */
|
|
372
|
+
| { event_type: "AssistantReasoningDelta"; payload: AssistantTokenDelta }
|
|
346
373
|
| { event_type: "AssistantMessageCompleted"; payload: AssistantMessageCompleted }
|
|
347
374
|
| { event_type: "ToolExecutionStarted"; payload: ToolStarted }
|
|
348
375
|
| { event_type: "ToolExecutionStdout"; payload: ToolOutput }
|
|
@@ -378,6 +405,7 @@ export type Event = EnvelopeMeta &
|
|
|
378
405
|
| { event_type: "TranscriptCleared"; payload?: Record<string, never> }
|
|
379
406
|
| { event_type: "Splash"; payload: Splash }
|
|
380
407
|
| { event_type: "ShowToast"; payload: ShowToast }
|
|
408
|
+
| { event_type: "MentionQuery"; payload: MentionQuery }
|
|
381
409
|
);
|
|
382
410
|
|
|
383
411
|
/** The payload type for a given event type, e.g. `PayloadOf<"ShowToast">`. */
|
package/src/types.js
CHANGED
|
@@ -22,7 +22,8 @@ const KNOWN_TYPES = new Set([
|
|
|
22
22
|
"ShowForm", "FormResponse",
|
|
23
23
|
"ShowWizard", "WizardCompleted", "WizardCancelled",
|
|
24
24
|
"ModeChangeRequested", "CancelRequested",
|
|
25
|
-
"TranscriptCleared", "Splash", "ShowToast",
|
|
25
|
+
"TranscriptCleared", "Splash", "ShowToast", "MentionQuery",
|
|
26
|
+
"AssistantReasoningDelta",
|
|
26
27
|
]);
|
|
27
28
|
|
|
28
29
|
/**
|