@cellarnode/ui 0.201.0 → 0.202.0
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/agent/composer.d.ts +6 -1
- package/dist/agent/composer.d.ts.map +1 -1
- package/dist/agent/composer.js +43 -9
- package/dist/agent/composer.js.map +1 -1
- package/dist/agent/conversation.d.ts +20 -2
- package/dist/agent/conversation.d.ts.map +1 -1
- package/dist/agent/conversation.js +37 -5
- package/dist/agent/conversation.js.map +1 -1
- package/dist/agent/copy.d.ts +7 -0
- package/dist/agent/copy.d.ts.map +1 -1
- package/dist/agent/copy.js +9 -0
- package/dist/agent/copy.js.map +1 -1
- package/dist/agent/fixtures.d.ts +34 -0
- package/dist/agent/fixtures.d.ts.map +1 -1
- package/dist/agent/fixtures.js +77 -0
- package/dist/agent/fixtures.js.map +1 -1
- package/dist/agent/index.d.ts +18 -1
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +18 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/markdown.d.ts +64 -0
- package/dist/agent/markdown.d.ts.map +1 -0
- package/dist/agent/markdown.js +220 -0
- package/dist/agent/markdown.js.map +1 -0
- package/dist/agent/masked-value.d.ts +1 -0
- package/dist/agent/masked-value.d.ts.map +1 -1
- package/dist/agent/masked-value.js +4 -1
- package/dist/agent/masked-value.js.map +1 -1
- package/dist/agent/message.d.ts +26 -6
- package/dist/agent/message.d.ts.map +1 -1
- package/dist/agent/message.js +47 -11
- package/dist/agent/message.js.map +1 -1
- package/dist/agent/panel-frame.js +1 -1
- package/dist/agent/panel-frame.js.map +1 -1
- package/dist/agent/role-cards/card-kit.d.ts +111 -0
- package/dist/agent/role-cards/card-kit.d.ts.map +1 -0
- package/dist/agent/role-cards/card-kit.js +68 -0
- package/dist/agent/role-cards/card-kit.js.map +1 -0
- package/dist/agent/role-cards/data-table-card.d.ts +80 -0
- package/dist/agent/role-cards/data-table-card.d.ts.map +1 -0
- package/dist/agent/role-cards/data-table-card.js +214 -0
- package/dist/agent/role-cards/data-table-card.js.map +1 -0
- package/dist/agent/role-cards/fixtures.d.ts +124 -0
- package/dist/agent/role-cards/fixtures.d.ts.map +1 -0
- package/dist/agent/role-cards/fixtures.js +401 -0
- package/dist/agent/role-cards/fixtures.js.map +1 -0
- package/dist/agent/role-cards/host-contract.d.ts +214 -0
- package/dist/agent/role-cards/host-contract.d.ts.map +1 -0
- package/dist/agent/role-cards/host-contract.js +348 -0
- package/dist/agent/role-cards/host-contract.js.map +1 -0
- package/dist/agent/role-cards/inspector-drawer.d.ts +42 -0
- package/dist/agent/role-cards/inspector-drawer.d.ts.map +1 -0
- package/dist/agent/role-cards/inspector-drawer.js +68 -0
- package/dist/agent/role-cards/inspector-drawer.js.map +1 -0
- package/dist/agent/role-cards/inspector-fixtures.d.ts +84 -0
- package/dist/agent/role-cards/inspector-fixtures.d.ts.map +1 -0
- package/dist/agent/role-cards/inspector-fixtures.js +162 -0
- package/dist/agent/role-cards/inspector-fixtures.js.map +1 -0
- package/dist/agent/role-cards/inspector-record.d.ts +109 -0
- package/dist/agent/role-cards/inspector-record.d.ts.map +1 -0
- package/dist/agent/role-cards/inspector-record.js +346 -0
- package/dist/agent/role-cards/inspector-record.js.map +1 -0
- package/dist/agent/role-cards/inspector-view.d.ts +137 -0
- package/dist/agent/role-cards/inspector-view.d.ts.map +1 -0
- package/dist/agent/role-cards/inspector-view.js +261 -0
- package/dist/agent/role-cards/inspector-view.js.map +1 -0
- package/dist/agent/role-cards/match-card.d.ts +21 -0
- package/dist/agent/role-cards/match-card.d.ts.map +1 -0
- package/dist/agent/role-cards/match-card.js +30 -0
- package/dist/agent/role-cards/match-card.js.map +1 -0
- package/dist/agent/role-cards/offer-card.d.ts +27 -0
- package/dist/agent/role-cards/offer-card.d.ts.map +1 -0
- package/dist/agent/role-cards/offer-card.js +68 -0
- package/dist/agent/role-cards/offer-card.js.map +1 -0
- package/dist/agent/role-cards/opportunity-card.d.ts +26 -0
- package/dist/agent/role-cards/opportunity-card.d.ts.map +1 -0
- package/dist/agent/role-cards/opportunity-card.js +50 -0
- package/dist/agent/role-cards/opportunity-card.js.map +1 -0
- package/dist/agent/role-cards/product-card.d.ts +32 -0
- package/dist/agent/role-cards/product-card.d.ts.map +1 -0
- package/dist/agent/role-cards/product-card.js +50 -0
- package/dist/agent/role-cards/product-card.js.map +1 -0
- package/dist/agent/role-cards/proposal-diff.d.ts +38 -0
- package/dist/agent/role-cards/proposal-diff.d.ts.map +1 -0
- package/dist/agent/role-cards/proposal-diff.js +74 -0
- package/dist/agent/role-cards/proposal-diff.js.map +1 -0
- package/dist/agent/role-cards/registry.d.ts +43 -0
- package/dist/agent/role-cards/registry.d.ts.map +1 -0
- package/dist/agent/role-cards/registry.js +46 -0
- package/dist/agent/role-cards/registry.js.map +1 -0
- package/dist/agent/role-cards/score-meter.d.ts +12 -0
- package/dist/agent/role-cards/score-meter.d.ts.map +1 -0
- package/dist/agent/role-cards/score-meter.js +17 -0
- package/dist/agent/role-cards/score-meter.js.map +1 -0
- package/dist/agent/role-cards/surface-links.d.ts +54 -0
- package/dist/agent/role-cards/surface-links.d.ts.map +1 -0
- package/dist/agent/role-cards/surface-links.js +149 -0
- package/dist/agent/role-cards/surface-links.js.map +1 -0
- package/dist/agent/role-cards/text-safety.d.ts +24 -0
- package/dist/agent/role-cards/text-safety.d.ts.map +1 -0
- package/dist/agent/role-cards/text-safety.js +61 -0
- package/dist/agent/role-cards/text-safety.js.map +1 -0
- package/dist/agent/schema.d.ts +7 -0
- package/dist/agent/schema.d.ts.map +1 -1
- package/dist/agent/schema.js +25 -2
- package/dist/agent/schema.js.map +1 -1
- package/dist/agent/states.d.ts +1 -0
- package/dist/agent/states.d.ts.map +1 -1
- package/dist/agent/states.js +1 -1
- package/dist/agent/states.js.map +1 -1
- package/dist/agent/thinking.d.ts +13 -4
- package/dist/agent/thinking.d.ts.map +1 -1
- package/dist/agent/thinking.js +15 -6
- package/dist/agent/thinking.js.map +1 -1
- package/dist/agent/thread-list.d.ts +33 -2
- package/dist/agent/thread-list.d.ts.map +1 -1
- package/dist/agent/thread-list.js +158 -8
- package/dist/agent/thread-list.js.map +1 -1
- package/dist/agent/tool-activity-model.d.ts +136 -0
- package/dist/agent/tool-activity-model.d.ts.map +1 -0
- package/dist/agent/tool-activity-model.js +288 -0
- package/dist/agent/tool-activity-model.js.map +1 -0
- package/dist/agent/tool-activity.d.ts +55 -0
- package/dist/agent/tool-activity.d.ts.map +1 -0
- package/dist/agent/tool-activity.js +159 -0
- package/dist/agent/tool-activity.js.map +1 -0
- package/dist/agent/tool-call-card.d.ts +9 -1
- package/dist/agent/tool-call-card.d.ts.map +1 -1
- package/dist/agent/tool-call-card.js +7 -1
- package/dist/agent/tool-call-card.js.map +1 -1
- package/dist/agent/ui.js +1 -1
- package/dist/agent/ui.js.map +1 -1
- package/dist/agent/use-motion.d.ts +15 -0
- package/dist/agent/use-motion.d.ts.map +1 -0
- package/dist/agent/use-motion.js +52 -0
- package/dist/agent/use-motion.js.map +1 -0
- package/dist/chat/chat-composer.d.ts.map +1 -1
- package/dist/chat/chat-composer.js +1 -1
- package/dist/chat/chat-composer.js.map +1 -1
- package/dist/chat/use-stick-to-bottom.d.ts +5 -0
- package/dist/chat/use-stick-to-bottom.d.ts.map +1 -1
- package/dist/chat/use-stick-to-bottom.js +11 -1
- package/dist/chat/use-stick-to-bottom.js.map +1 -1
- package/dist/components/sheet.d.ts +3 -1
- package/dist/components/sheet.d.ts.map +1 -1
- package/dist/components/sheet.js +2 -2
- package/dist/components/sheet.js.map +1 -1
- package/dist/portfolio-import/import-job-panels.d.ts +6 -0
- package/dist/portfolio-import/import-job-panels.d.ts.map +1 -1
- package/dist/portfolio-import/import-job-panels.js +11 -4
- package/dist/portfolio-import/import-job-panels.js.map +1 -1
- package/dist/portfolio-import/job-error-copy.d.ts +62 -0
- package/dist/portfolio-import/job-error-copy.d.ts.map +1 -0
- package/dist/portfolio-import/job-error-copy.js +78 -0
- package/dist/portfolio-import/job-error-copy.js.map +1 -0
- package/dist/realtime/organisation-events/schemas.d.ts +2 -2
- package/package.json +4 -1
- package/src/theme/tokens.css +66 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal Text from a record or a card is untrusted: it may carry bidi overrides, zero-width characters or control characters
|
|
3
|
+
* that reorder, hide or split what a person reads, and it may be arbitrarily long. These are the one place that cleans and
|
|
4
|
+
* bounds it (CEL-2445 host contract, CEL-2487).
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Code points that may reorder, hide or split what a person reads: C0/DEL controls, line/paragraph separators, the Arabic letter
|
|
8
|
+
* mark (U+061C), zero-width and direction marks (U+200B-200F), bidi embeddings and overrides (U+202A-202E), word joiner,
|
|
9
|
+
* invisible operators, bidi isolates and the deprecated format characters (U+2060-206F), interlinear annotation marks
|
|
10
|
+
* (U+FFF9-FFFB), the BOM, and the invisible "tag" characters (U+E0000-E007F) that can carry a hidden message through a copy and paste.
|
|
11
|
+
*/
|
|
12
|
+
export const isUnsafeChar = (code) => code < 32 ||
|
|
13
|
+
code === 127 ||
|
|
14
|
+
code === 0x061c ||
|
|
15
|
+
(code >= 0x200b && code <= 0x200f) ||
|
|
16
|
+
code === 0x2028 ||
|
|
17
|
+
code === 0x2029 ||
|
|
18
|
+
(code >= 0x202a && code <= 0x202e) ||
|
|
19
|
+
(code >= 0x2060 && code <= 0x206f) ||
|
|
20
|
+
code === 0xfeff ||
|
|
21
|
+
(code >= 0xfff9 && code <= 0xfffb) ||
|
|
22
|
+
(code >= 0xe0000 && code <= 0xe007f);
|
|
23
|
+
/** Every unsafe character becomes a space (so nothing is silently joined into a different word). Walks by code point. */
|
|
24
|
+
export function replaceUnsafe(raw) {
|
|
25
|
+
return Array.from(raw, (ch) => (isUnsafeChar(ch.codePointAt(0) ?? 0) ? " " : ch)).join("");
|
|
26
|
+
}
|
|
27
|
+
/** The first `max` code points of `text`, never splitting a surrogate pair; `ellipsis` marks a cut. Linear in `max`, not in the text. */
|
|
28
|
+
export function clipCodePoints(text, max, ellipsis = false) {
|
|
29
|
+
if (text.length <= max)
|
|
30
|
+
return text;
|
|
31
|
+
let units = 0;
|
|
32
|
+
let count = 0;
|
|
33
|
+
for (const ch of text) {
|
|
34
|
+
if (count === max)
|
|
35
|
+
break;
|
|
36
|
+
units += ch.length;
|
|
37
|
+
count += 1;
|
|
38
|
+
}
|
|
39
|
+
if (units >= text.length)
|
|
40
|
+
return text;
|
|
41
|
+
return ellipsis ? `${text.slice(0, units)}…` : text.slice(0, units);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Short, single-line text (a label, a title): unsafe characters out, whitespace collapsed, clipped to `max` code points.
|
|
45
|
+
* `undefined` when nothing readable is left.
|
|
46
|
+
*/
|
|
47
|
+
export function cleanInline(raw, max, ellipsis = false) {
|
|
48
|
+
if (typeof raw !== "string")
|
|
49
|
+
return undefined;
|
|
50
|
+
// Bound the work first: a megabyte of text must not cost a megabyte of cleaning to show 80 characters of it.
|
|
51
|
+
const clean = replaceUnsafe(clipCodePoints(raw, max * 4))
|
|
52
|
+
.replace(/\s+/g, " ")
|
|
53
|
+
.trim();
|
|
54
|
+
return clean === "" ? undefined : clipCodePoints(clean, max, ellipsis);
|
|
55
|
+
}
|
|
56
|
+
/** A value shown as body text: unsafe characters out, clipped to `max` code points with an ellipsis. */
|
|
57
|
+
export function cleanValue(raw, max) {
|
|
58
|
+
const clipped = clipCodePoints(raw, max, true);
|
|
59
|
+
return replaceUnsafe(clipped);
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=text-safety.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-safety.js","sourceRoot":"","sources":["../../../src/agent/role-cards/text-safety.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAY,EAAW,EAAE,CACpD,IAAI,GA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C,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AACtE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,GAAY,EAAE,GAAW,EAAE,QAAQ,GAAG,KAAK;IACrE,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC9C,6GAA6G;IAC7G,MAAM,KAAK,GAAG,aAAa,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;SACtD,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,IAAI,EAAE,CAAC;IACV,OAAO,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;AACzE,CAAC;AAED,wGAAwG;AACxG,MAAM,UAAU,UAAU,CAAC,GAAW,EAAE,GAAW;IACjD,MAAM,OAAO,GAAG,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IAC/C,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC"}
|
package/dist/agent/schema.d.ts
CHANGED
|
@@ -134,6 +134,7 @@ export declare const ToolCallSchema: z.ZodObject<{
|
|
|
134
134
|
}, z.core.$strip>]>>>;
|
|
135
135
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
136
136
|
resultSummary: z.ZodOptional<z.ZodString>;
|
|
137
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
137
138
|
error: z.ZodOptional<z.ZodString>;
|
|
138
139
|
}, z.core.$strip>;
|
|
139
140
|
export type AgentToolCall = z.infer<typeof ToolCallSchema>;
|
|
@@ -161,6 +162,7 @@ export declare const MessagePartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
161
162
|
}, z.core.$strip>]>>>;
|
|
162
163
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
163
164
|
resultSummary: z.ZodOptional<z.ZodString>;
|
|
165
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
164
166
|
error: z.ZodOptional<z.ZodString>;
|
|
165
167
|
}, z.core.$strip>;
|
|
166
168
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -222,6 +224,7 @@ export declare const MessagePartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
222
224
|
type: z.ZodLiteral<"card">;
|
|
223
225
|
cardType: z.ZodString;
|
|
224
226
|
data: z.ZodUnknown;
|
|
227
|
+
forCallId: z.ZodOptional<z.ZodString>;
|
|
225
228
|
}, z.core.$strip>], "type">;
|
|
226
229
|
export type AgentMessagePart = z.infer<typeof MessagePartSchema>;
|
|
227
230
|
export declare const MessageSchema: z.ZodObject<{
|
|
@@ -254,6 +257,7 @@ export declare const MessageSchema: z.ZodObject<{
|
|
|
254
257
|
}, z.core.$strip>]>>>;
|
|
255
258
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
256
259
|
resultSummary: z.ZodOptional<z.ZodString>;
|
|
260
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
257
261
|
error: z.ZodOptional<z.ZodString>;
|
|
258
262
|
}, z.core.$strip>;
|
|
259
263
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -315,6 +319,7 @@ export declare const MessageSchema: z.ZodObject<{
|
|
|
315
319
|
type: z.ZodLiteral<"card">;
|
|
316
320
|
cardType: z.ZodString;
|
|
317
321
|
data: z.ZodUnknown;
|
|
322
|
+
forCallId: z.ZodOptional<z.ZodString>;
|
|
318
323
|
}, z.core.$strip>], "type">>;
|
|
319
324
|
streaming: z.ZodOptional<z.ZodBoolean>;
|
|
320
325
|
stopped: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -337,6 +342,8 @@ export declare const ThreadSchema: z.ZodObject<{
|
|
|
337
342
|
title: z.ZodString;
|
|
338
343
|
updatedAt: z.ZodString;
|
|
339
344
|
preview: z.ZodOptional<z.ZodString>;
|
|
345
|
+
firstMessage: z.ZodOptional<z.ZodString>;
|
|
346
|
+
titlePending: z.ZodOptional<z.ZodBoolean>;
|
|
340
347
|
}, z.core.$strip>;
|
|
341
348
|
export type AgentThread = z.infer<typeof ThreadSchema>;
|
|
342
349
|
export declare const ReadinessGapSchema: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/agent/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AAEH,yGAAyG;AACzG,eAAO,MAAM,YAAY;;;iBAA6D,CAAC;AACvF,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD,eAAO,MAAM,eAAe;;;mBAM1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,QAAQ,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,MAA2C,CAAC;AAEvF,eAAO,MAAM,UAAU;;;;;EAA0D,CAAC;AAClF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEnD,eAAO,MAAM,eAAe;;;;;;;;;;iBAI1B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE7D,eAAO,MAAM,oBAAoB;;;;;;;;;;EAU/B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEvE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQ1B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
package/dist/agent/schema.js
CHANGED
|
@@ -82,6 +82,15 @@ export const ToolCallSchema = z.object({
|
|
|
82
82
|
args: z.record(z.string(), CellValueSchema).optional(),
|
|
83
83
|
durationMs: z.number().optional(),
|
|
84
84
|
resultSummary: z.string().optional(),
|
|
85
|
+
/**
|
|
86
|
+
* The call's result for the activity row's preview: parsed JSON, or text. Shown as given (at most 20,000 characters), so the
|
|
87
|
+
* host REDACTS it exactly as it redacts `args`: a masked cell is `{ masked: true, display }`, never the raw value. The
|
|
88
|
+
* model-facing envelope (`{"untrusted":true,"source":"...","data":...}`) is unwrapped before display (only when it says
|
|
89
|
+
* `untrusted: true`), so the host can pass the tool output as it received it, once redacted. Bounded by the host: the row shows
|
|
90
|
+
* 20 lines and a "show all". When absent the preview falls back to `resultSummary`, which hosts usually truncate, so a long
|
|
91
|
+
* result is only readable with `result`.
|
|
92
|
+
*/
|
|
93
|
+
result: z.unknown().optional(),
|
|
85
94
|
error: z.string().optional(),
|
|
86
95
|
});
|
|
87
96
|
export const MessagePartSchema = z.discriminatedUnion("type", [
|
|
@@ -89,8 +98,17 @@ export const MessagePartSchema = z.discriminatedUnion("type", [
|
|
|
89
98
|
z.object({ type: z.literal("thinking"), summary: z.string() }),
|
|
90
99
|
z.object({ type: z.literal("toolCall"), call: ToolCallSchema }),
|
|
91
100
|
z.object({ type: z.literal("approval"), approval: ApprovalSchema }),
|
|
92
|
-
/**
|
|
93
|
-
|
|
101
|
+
/**
|
|
102
|
+
* A host-rendered domain card (admin OrgCard etc.). The host owns `cardType`. `forCallId` names the tool call whose
|
|
103
|
+
* data the card shows; the activity row then marks that step "shown below" and collapses its preview. Without it the
|
|
104
|
+
* row assumes a card shows the successful calls before it in the same message (`cardCoversCall` overrides).
|
|
105
|
+
*/
|
|
106
|
+
z.object({
|
|
107
|
+
type: z.literal("card"),
|
|
108
|
+
cardType: z.string(),
|
|
109
|
+
data: z.unknown(),
|
|
110
|
+
forCallId: z.string().optional(),
|
|
111
|
+
}),
|
|
94
112
|
]);
|
|
95
113
|
export const MessageSchema = z.object({
|
|
96
114
|
id: z.string(),
|
|
@@ -112,9 +130,14 @@ export const ConversationStatusSchema = z.enum([
|
|
|
112
130
|
]);
|
|
113
131
|
export const ThreadSchema = z.object({
|
|
114
132
|
id: z.string(),
|
|
133
|
+
/** May be empty: a conversation is named by the service after its first reply, or by the user. */
|
|
115
134
|
title: z.string(),
|
|
116
135
|
updatedAt: z.string(),
|
|
117
136
|
preview: z.string().optional(),
|
|
137
|
+
/** The first thing the user asked. With no `title` the list shows its first words as the conversation's name. */
|
|
138
|
+
firstMessage: z.string().optional(),
|
|
139
|
+
/** The first run just finished and the service is still choosing a title: the row shows a "Naming…" placeholder. */
|
|
140
|
+
titlePending: z.boolean().optional(),
|
|
118
141
|
});
|
|
119
142
|
export const ReadinessGapSchema = z.object({
|
|
120
143
|
path: z.string(),
|
package/dist/agent/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/agent/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AAEH,yGAAyG;AACzG,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAGvF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC;IACrC,CAAC,CAAC,MAAM,EAAE;IACV,CAAC,CAAC,MAAM,EAAE;IACV,CAAC,CAAC,OAAO,EAAE;IACX,CAA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CAAC,CAAC,MAAM,EAAE;IACrB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE;IAClB,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAC7C,QAAQ,EAAE,CAAC,CAAC,KAAK,CACf,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE,CAAC,CACnF;CACF,CAAC,CAAC"}
|
package/dist/agent/states.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export interface AgentErrorCopy {
|
|
|
32
32
|
refetch: string;
|
|
33
33
|
signIn: string;
|
|
34
34
|
}
|
|
35
|
+
export declare const ERROR_COPY: AgentErrorCopy;
|
|
35
36
|
export interface AgentErrorProps {
|
|
36
37
|
kind: AgentErrorKind;
|
|
37
38
|
/** Action for the kind: retry (generic/unavailable), refetch (interrupted), sign in (authExpired). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"states.d.ts","sourceRoot":"","sources":["../../src/agent/states.tsx"],"names":[],"mappings":"AAcA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AASD,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,WAAW,GAAG,YAAY,CAAC;IACrC,kCAAkC;IAClC,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAA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], onSug
|
|
|
17
17
|
const noThreads = variant === "no-threads";
|
|
18
18
|
return (_jsx(EmptyState, { tone: "brand", icon: _jsx(MessageSquareText, { "aria-hidden": true, className: "size-5" }), headline: noThreads ? c.noThreadsHeadline : c.headline, description: noThreads ? c.noThreadsDescription : c.description, entranceMotion: false, actions: !noThreads && suggestions.length > 0 ? (_jsx("div", { role: "group", "aria-label": c.suggestionsLabel, className: "flex flex-wrap justify-center gap-2", children: suggestions.map((s) => (_jsx("button", { type: "button", onClick: () => onSuggestion?.(s), className: cn("rounded-full bg-muted px-3 py-1.5 text-sm/5 text-foreground transition-colors duration-[var(--duration-micro)] hover:bg-muted/70", focusRing), children: s }, s))) })) : undefined }));
|
|
19
19
|
}
|
|
20
|
-
const ERROR_COPY = {
|
|
20
|
+
export const ERROR_COPY = {
|
|
21
21
|
genericTitle: "Something went wrong",
|
|
22
22
|
genericBody: "The request did not complete. Nothing was changed.",
|
|
23
23
|
interruptedTitle: "Run interrupted",
|
package/dist/agent/states.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"states.js","sourceRoot":"","sources":["../../src/agent/states.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,aAAa,EACb,UAAU,EACV,KAAK,EACL,iBAAiB,EACjB,OAAO,EACP,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAS9C,MAAM,UAAU,GAAwB;IACtC,QAAQ,EAAE,wBAAwB;IAClC,WAAW,EAAE,6DAA6D;IAC1E,gBAAgB,EAAE,YAAY;IAC9B,iBAAiB,EAAE,sBAAsB;IACzC,oBAAoB,EAAE,qEAAqE;CAC5F,CAAC;AAUF,kFAAkF;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YAC9E,WAAW,GACL,CACV,IACG,IACF,CACP,CAAC;AACJ,CAAC"}
|
package/dist/agent/thinking.d.ts
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
|
+
import { type AgentToolNaming } from "./tool-activity-model.js";
|
|
1
2
|
export interface AgentThinkingCopy {
|
|
2
3
|
working: string;
|
|
4
|
+
/** The seconds so far, with its separator: `{seconds}` ("· 3s"). Hidden from assistive tech. */
|
|
3
5
|
elapsed: string;
|
|
4
6
|
}
|
|
5
|
-
export interface AgentThinkingProps {
|
|
6
|
-
/**
|
|
7
|
+
export interface AgentThinkingProps extends AgentToolNaming {
|
|
8
|
+
/**
|
|
9
|
+
* One-line summary of what the agent is doing. Raw model reasoning is never shown. A tool name
|
|
10
|
+
* (`admin_get_mcp_overview`) is shown in words ("Checking MCP overview").
|
|
11
|
+
*/
|
|
7
12
|
label?: string;
|
|
13
|
+
/** Host clock. Without it the indicator counts the seconds itself, from when it appeared. */
|
|
8
14
|
elapsedMs?: number;
|
|
9
15
|
copy?: Partial<AgentThinkingCopy>;
|
|
10
16
|
className?: string;
|
|
11
17
|
}
|
|
12
|
-
/**
|
|
13
|
-
|
|
18
|
+
/**
|
|
19
|
+
* @internal Status line: the orb as the single ambient mark, a one-line summary and the seconds so far ("Thinking · 3s"). The
|
|
20
|
+
* count is hidden from assistive tech, so the live region says the label once rather than every second.
|
|
21
|
+
*/
|
|
22
|
+
export declare function AgentThinking({ label, elapsedMs, toolLabels, formatToolLabel, cardLabels, toolWording, copy, className, }: AgentThinkingProps): import("react/jsx-runtime").JSX.Element;
|
|
14
23
|
//# sourceMappingURL=thinking.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thinking.d.ts","sourceRoot":"","sources":["../../src/agent/thinking.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAGD,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"thinking.d.ts","sourceRoot":"","sources":["../../src/agent/thinking.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG9E,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,gGAAgG;IAChG,OAAO,EAAE,MAAM,CAAC;CACjB;AAGD,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACzD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6FAA6F;IAC7F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,SAAS,EACT,UAAU,EACV,eAAe,EACf,UAAU,EACV,WAAW,EACX,IAAI,EACJ,SAAS,GACV,EAAE,kBAAkB,2CAuBpB"}
|
package/dist/agent/thinking.js
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
2
3
|
import { AgenticOrb } from "../agentic-orb/index.js";
|
|
3
4
|
import { cn } from "../lib/utils.js";
|
|
4
|
-
import { useCopy } from "./copy.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { fmt, useCopy } from "./copy.js";
|
|
6
|
+
import { createToolNamer } from "./tool-activity-model.js";
|
|
7
|
+
import { useElapsedSeconds } from "./use-motion.js";
|
|
8
|
+
const DEFAULT_COPY = { working: "Thinking", elapsed: "· {seconds}s" };
|
|
9
|
+
/**
|
|
10
|
+
* @internal Status line: the orb as the single ambient mark, a one-line summary and the seconds so far ("Thinking · 3s"). The
|
|
11
|
+
* count is hidden from assistive tech, so the live region says the label once rather than every second.
|
|
12
|
+
*/
|
|
13
|
+
export function AgentThinking({ label, elapsedMs, toolLabels, formatToolLabel, cardLabels, toolWording, copy, className, }) {
|
|
8
14
|
const c = useCopy(DEFAULT_COPY, copy);
|
|
9
|
-
const
|
|
10
|
-
|
|
15
|
+
const namer = useMemo(() => createToolNamer({ toolLabels, formatToolLabel, cardLabels, toolWording }), [toolLabels, formatToolLabel, cardLabels, toolWording]);
|
|
16
|
+
const ticked = useElapsedSeconds(elapsedMs === undefined);
|
|
17
|
+
const seconds = elapsedMs === undefined ? ticked : Math.floor(elapsedMs / 1000);
|
|
18
|
+
const text = label ? namer.tool(label, "active") : c.working;
|
|
19
|
+
return (_jsxs("div", { role: "status", className: cn("flex items-center gap-2 text-sm/5 text-muted-foreground", className), children: [_jsx(AgenticOrb, { state: "thinking", size: 28, label: "" }), _jsx("span", { children: text }), seconds > 0 && (_jsx("span", { "aria-hidden": true, className: "text-xs/4 tabular-nums", children: fmt(c.elapsed, { seconds }) }))] }));
|
|
11
20
|
}
|
|
12
21
|
//# sourceMappingURL=thinking.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thinking.js","sourceRoot":"","sources":["../../src/agent/thinking.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"thinking.js","sourceRoot":"","sources":["../../src/agent/thinking.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,eAAe,EAAwB,MAAM,uBAAu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AAO,EAAE,CAAC,GACvB,CACR,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -9,17 +9,48 @@ export interface AgentThreadListCopy {
|
|
|
9
9
|
cancel: string;
|
|
10
10
|
retention: string;
|
|
11
11
|
list: string;
|
|
12
|
+
/** Name of a conversation that has no title and no first message to take one from. */
|
|
13
|
+
newConversation: string;
|
|
14
|
+
/** Placeholder while the service chooses a title for a conversation that has none yet. */
|
|
15
|
+
naming: string;
|
|
16
|
+
/** Rename button; `{title}` is the conversation's name. */
|
|
17
|
+
rename: string;
|
|
18
|
+
/** Accessible name of the title field while renaming. */
|
|
19
|
+
renameInput: string;
|
|
20
|
+
renameHint: string;
|
|
21
|
+
renameSaving: string;
|
|
22
|
+
/** Announced after a rename was saved. */
|
|
23
|
+
renamed: string;
|
|
24
|
+
/** The host's save failed. */
|
|
25
|
+
renameError: string;
|
|
26
|
+
titleRequired: string;
|
|
27
|
+
/** `{max}` is the longest title allowed. */
|
|
28
|
+
titleTooLong: string;
|
|
12
29
|
}
|
|
30
|
+
/** The longest title a person can give a conversation. */
|
|
31
|
+
export declare const THREAD_TITLE_MAX = 80;
|
|
32
|
+
/**
|
|
33
|
+
* A title taken from the first thing the user asked: whitespace collapsed, cut at a word boundary near `max`
|
|
34
|
+
* characters with an ellipsis. `undefined` for nothing to take a title from.
|
|
35
|
+
*/
|
|
36
|
+
export declare function deriveThreadTitle(firstMessage: string | undefined, max?: number): string | undefined;
|
|
37
|
+
/** What the list calls a conversation: its title, else the first words of its first message, else `fallback`. */
|
|
38
|
+
export declare function threadDisplayTitle(thread: AgentThread, fallback: string): string;
|
|
13
39
|
export interface AgentThreadListProps {
|
|
14
40
|
threads: readonly AgentThread[];
|
|
15
41
|
activeId?: string;
|
|
16
42
|
onSelect: (id: string) => void;
|
|
17
43
|
onDelete: (id: string) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Saves a new title (already trimmed, 1 to {@link THREAD_TITLE_MAX} characters). Without it a row has no rename
|
|
46
|
+
* button. A rejected promise shows the rename error and keeps the field open with what was typed.
|
|
47
|
+
*/
|
|
48
|
+
onRename?: (id: string, title: string) => Promise<void>;
|
|
18
49
|
retentionDays?: number;
|
|
19
50
|
formatTime?: (iso: string) => string;
|
|
20
51
|
copy?: Partial<AgentThreadListCopy>;
|
|
21
52
|
className?: string;
|
|
22
53
|
}
|
|
23
|
-
/** @internal Thread list with search, select and confirm-first delete. */
|
|
24
|
-
export declare function AgentThreadList({ threads, activeId, onSelect, onDelete, retentionDays, formatTime, copy, className, }: AgentThreadListProps): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
/** @internal Thread list with search, select, rename and confirm-first delete. */
|
|
55
|
+
export declare function AgentThreadList({ threads, activeId, onSelect, onDelete, onRename, retentionDays, formatTime, copy, className, }: AgentThreadListProps): import("react/jsx-runtime").JSX.Element;
|
|
25
56
|
//# sourceMappingURL=thread-list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thread-list.d.ts","sourceRoot":"","sources":["../../src/agent/thread-list.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"thread-list.d.ts","sourceRoot":"","sources":["../../src/agent/thread-list.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAK5C,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,sFAAsF;IACtF,eAAe,EAAE,MAAM,CAAC;IACxB,0FAA0F;IAC1F,MAAM,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,MAAM,EAAE,MAAM,C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ACR,aAAkB,EAClB,UAAqB,EACrB,IAAI,EACJ,SAAS,GACV,EAAE,oBAAoB,2CAsItB"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo, useState } from "react";
|
|
3
|
-
import { Trash2 } from "lucide-react";
|
|
2
|
+
import { useEffect, useId, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { LoaderCircle, Pencil, Trash2 } from "lucide-react";
|
|
4
4
|
import { ConfirmationDialog } from "../components/confirmation-dialog.js";
|
|
5
|
+
import { LiveRegion, useAnnounce } from "../components/live-region/index.js";
|
|
5
6
|
import { cn } from "../lib/utils.js";
|
|
6
7
|
import { fmt, useCopy } from "./copy.js";
|
|
7
8
|
import { AgentEmptyState } from "./states.js";
|
|
8
9
|
import { focusRing } from "./ui.js";
|
|
10
|
+
import { useChanged } from "./use-motion.js";
|
|
9
11
|
const DEFAULT_COPY = {
|
|
10
12
|
search: "Search conversations",
|
|
11
13
|
noResults: "No conversations match.",
|
|
@@ -16,24 +18,172 @@ const DEFAULT_COPY = {
|
|
|
16
18
|
cancel: "Cancel",
|
|
17
19
|
retention: "Conversations are kept for {days} days.",
|
|
18
20
|
list: "Conversations",
|
|
21
|
+
newConversation: "New conversation",
|
|
22
|
+
naming: "Naming…",
|
|
23
|
+
rename: "Rename conversation: {title}",
|
|
24
|
+
renameInput: "Conversation title",
|
|
25
|
+
renameHint: "Enter to save, Escape to cancel",
|
|
26
|
+
renameSaving: "Saving",
|
|
27
|
+
renamed: "Conversation renamed",
|
|
28
|
+
renameError: "Could not rename the conversation. Try again.",
|
|
29
|
+
titleRequired: "Enter a title.",
|
|
30
|
+
titleTooLong: "Use {max} characters or fewer.",
|
|
19
31
|
};
|
|
20
|
-
/**
|
|
21
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Default-ignorable code points draw nothing (zero-width spaces and joiners, left-to-right and right-to-left marks, the soft
|
|
34
|
+
* hyphen, word joiner and invisible math operators, the Hangul fillers, bidi embedding controls, variation selectors), so a
|
|
35
|
+
* title made only of them is empty. Used for that check ONLY: the title that is saved keeps them (an emoji joined by U+200D,
|
|
36
|
+
* a Persian word with U+200C), trimmed of whitespace.
|
|
37
|
+
*/
|
|
38
|
+
const clean = (s) => s.replace(/\p{Default_Ignorable_Code_Point}/gu, "").trim();
|
|
39
|
+
/** The longest title a person can give a conversation. */
|
|
40
|
+
export const THREAD_TITLE_MAX = 80;
|
|
41
|
+
const DERIVED_TITLE_MAX = 48;
|
|
42
|
+
/**
|
|
43
|
+
* A title taken from the first thing the user asked: whitespace collapsed, cut at a word boundary near `max`
|
|
44
|
+
* characters with an ellipsis. `undefined` for nothing to take a title from.
|
|
45
|
+
*/
|
|
46
|
+
export function deriveThreadTitle(firstMessage, max = DERIVED_TITLE_MAX) {
|
|
47
|
+
const text = (firstMessage ?? "").replace(/\s+/g, " ").trim();
|
|
48
|
+
if (clean(text) === "")
|
|
49
|
+
return undefined;
|
|
50
|
+
const chars = [...text];
|
|
51
|
+
if (chars.length <= max)
|
|
52
|
+
return chars.join("");
|
|
53
|
+
const head = chars.slice(0, max - 1);
|
|
54
|
+
const at = head.lastIndexOf(" ");
|
|
55
|
+
return `${(at > max / 2 ? head.slice(0, at) : head).join("").trimEnd()}…`;
|
|
56
|
+
}
|
|
57
|
+
/** What the list calls a conversation: its title, else the first words of its first message, else `fallback`. */
|
|
58
|
+
export function threadDisplayTitle(thread, fallback) {
|
|
59
|
+
const title = thread.title.trim();
|
|
60
|
+
return clean(title) === "" ? deriveThreadTitle(thread.firstMessage) || fallback : title;
|
|
61
|
+
}
|
|
62
|
+
function RenameField({ initial, c, onSave, onClose, }) {
|
|
63
|
+
const [value, setValue] = useState(initial);
|
|
64
|
+
const [status, setStatus] = useState("idle");
|
|
65
|
+
const [problem, setProblem] = useState(null);
|
|
66
|
+
const inputRef = useRef(null);
|
|
67
|
+
const finishedRef = useRef(false);
|
|
68
|
+
const hintId = useId();
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
inputRef.current?.focus();
|
|
71
|
+
inputRef.current?.select();
|
|
72
|
+
}, []);
|
|
73
|
+
const validate = (title) => clean(title) === ""
|
|
74
|
+
? c.titleRequired
|
|
75
|
+
: [...title].length > THREAD_TITLE_MAX
|
|
76
|
+
? fmt(c.titleTooLong, { max: THREAD_TITLE_MAX })
|
|
77
|
+
: null;
|
|
78
|
+
const finish = (via, saved) => {
|
|
79
|
+
finishedRef.current = true;
|
|
80
|
+
onClose(via, saved);
|
|
81
|
+
};
|
|
82
|
+
const submit = async (via) => {
|
|
83
|
+
if (finishedRef.current || status === "saving")
|
|
84
|
+
return;
|
|
85
|
+
const title = value.trim();
|
|
86
|
+
const invalid = validate(title);
|
|
87
|
+
if (invalid) {
|
|
88
|
+
// Enter says what is wrong and waits; clicking away from a field that cannot be saved just puts the old name back.
|
|
89
|
+
if (via === "blur")
|
|
90
|
+
finish("blur", false);
|
|
91
|
+
else
|
|
92
|
+
setProblem(invalid);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (title === initial.trim()) {
|
|
96
|
+
finish(via, false);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
setStatus("saving");
|
|
100
|
+
setProblem(null);
|
|
101
|
+
try {
|
|
102
|
+
await onSave(title);
|
|
103
|
+
finish(via, true);
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
setStatus("error");
|
|
107
|
+
setProblem(c.renameError);
|
|
108
|
+
if (via === "keyboard")
|
|
109
|
+
inputRef.current?.focus();
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
const onKeyDown = (e) => {
|
|
113
|
+
if (e.key === "Enter") {
|
|
114
|
+
// Enter that picks an IME candidate is not a save.
|
|
115
|
+
if (e.nativeEvent.isComposing)
|
|
116
|
+
return;
|
|
117
|
+
e.preventDefault();
|
|
118
|
+
void submit("keyboard");
|
|
119
|
+
}
|
|
120
|
+
else if (e.key === "Escape") {
|
|
121
|
+
e.preventDefault();
|
|
122
|
+
e.stopPropagation();
|
|
123
|
+
if (status !== "saving")
|
|
124
|
+
finish("keyboard", false);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
const saving = status === "saving";
|
|
128
|
+
return (_jsxs("div", { className: "flex flex-col gap-1 rounded-xl bg-muted px-2 py-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("input", { ref: inputRef, type: "text", "aria-label": c.renameInput, "aria-invalid": problem ? true : undefined, "aria-describedby": problem ? `${hintId}-problem` : hintId, "aria-busy": saving || undefined, autoComplete: "off", spellCheck: false, readOnly: saving, value: value, onChange: (e) => {
|
|
129
|
+
setValue(e.target.value);
|
|
130
|
+
if (status === "error" || problem) {
|
|
131
|
+
setStatus("idle");
|
|
132
|
+
setProblem(null);
|
|
133
|
+
}
|
|
134
|
+
}, onKeyDown: onKeyDown, onBlur: () => void submit("blur"), className: cn("min-w-0 flex-1 rounded-lg border bg-background px-2.5 py-1 text-sm/5 text-foreground pointer-coarse:min-h-11", problem ? "border-[var(--tone-danger-fg)]" : "border-input", saving && "text-muted-foreground", focusRing) }), saving && (_jsxs("span", { className: "inline-flex shrink-0 items-center text-muted-foreground", children: [_jsx(LoaderCircle, { "aria-hidden": true, className: "size-4 animate-spin motion-reduce:animate-none" }), _jsx("span", { className: "sr-only", children: c.renameSaving })] }))] }), problem ? (_jsx("p", { id: `${hintId}-problem`, role: "alert", className: "text-xs/4 break-words text-[var(--tone-danger-fg)]", children: problem }, "problem")) : (_jsx("p", { id: hintId, className: "text-xs/4 text-muted-foreground", children: c.renameHint }, "hint"))] }));
|
|
135
|
+
}
|
|
136
|
+
function ThreadTitle({ thread, c }) {
|
|
137
|
+
const naming = Boolean(thread.titlePending) && thread.title.trim() === "";
|
|
138
|
+
const display = threadDisplayTitle(thread, c.newConversation);
|
|
139
|
+
const fallback = !naming && thread.title.trim() === "" && display === c.newConversation;
|
|
140
|
+
const shown = naming ? "\u0000naming" : display;
|
|
141
|
+
// A title that arrives or changes fades in. The first one shown does not animate.
|
|
142
|
+
const swapped = useChanged(shown);
|
|
143
|
+
return (_jsx("span", { "data-naming": naming ? "true" : undefined, className: cn("block truncate text-sm/5 font-medium text-foreground", (naming || fallback) && "text-muted-foreground", naming && "agent-pulse", swapped && "agent-swap-in"), children: naming ? c.naming : display }, shown));
|
|
144
|
+
}
|
|
145
|
+
/** @internal Thread list with search, select, rename and confirm-first delete. */
|
|
146
|
+
export function AgentThreadList({ threads, activeId, onSelect, onDelete, onRename, retentionDays = 30, formatTime = (s) => s, copy, className, }) {
|
|
22
147
|
const c = useCopy(DEFAULT_COPY, copy);
|
|
23
148
|
const [q, setQ] = useState("");
|
|
24
149
|
const [pendingDelete, setPendingDelete] = useState(null);
|
|
150
|
+
const [renamingId, setRenamingId] = useState(null);
|
|
151
|
+
const { message, seq, announce } = useAnnounce();
|
|
152
|
+
const selectButtonsRef = useRef(new Map());
|
|
25
153
|
const shown = useMemo(() => {
|
|
26
154
|
const needle = q.trim().toLowerCase();
|
|
27
155
|
return needle
|
|
28
|
-
? threads.filter((t) => `${t.
|
|
156
|
+
? threads.filter((t) => `${threadDisplayTitle(t, c.newConversation)} ${t.preview ?? ""}`
|
|
157
|
+
.toLowerCase()
|
|
158
|
+
.includes(needle))
|
|
29
159
|
: threads;
|
|
30
|
-
}, [threads, q]);
|
|
160
|
+
}, [threads, q, c.newConversation]);
|
|
31
161
|
if (threads.length === 0)
|
|
32
162
|
return _jsx(AgentEmptyState, { variant: "no-threads" });
|
|
33
|
-
return (_jsxs("div", { className: cn("flex flex-col gap-3", className), children: [_jsx("input", { type: "search", "aria-label": c.search, placeholder: c.search, value: q, onChange: (e) => setQ(e.target.value), className: cn("w-full rounded-lg border border-input bg-background px-3 py-1.5 text-sm/5", focusRing) }), shown.length === 0 ? (_jsx("p", { className: "py-6 text-center text-sm/5 text-muted-foreground", children: c.noResults })) : (_jsx("ul", { "aria-label": c.list, className: "flex flex-col gap-1", children: shown.map((t) =>
|
|
163
|
+
return (_jsxs("div", { className: cn("flex flex-col gap-3 px-4 pt-4 pb-3", className), children: [_jsx(LiveRegion, { message: message, seq: seq }), _jsx("input", { type: "search", "aria-label": c.search, placeholder: c.search, value: q, onChange: (e) => setQ(e.target.value), className: cn("w-full rounded-lg border border-input bg-background px-3 py-1.5 text-sm/5", focusRing) }), shown.length === 0 ? (_jsx("p", { className: "py-6 text-center text-sm/5 text-muted-foreground", children: c.noResults })) : (_jsx("ul", { "aria-label": c.list, className: "-mx-2 flex flex-col gap-1", children: shown.map((t) => {
|
|
164
|
+
const name = threadDisplayTitle(t, c.newConversation);
|
|
165
|
+
if (renamingId === t.id && onRename) {
|
|
166
|
+
return (_jsx("li", { children: _jsx(RenameField, { initial: t.title.trim() || name, c: c, onSave: (title) => onRename(t.id, title), onClose: (via, saved) => {
|
|
167
|
+
setRenamingId(null);
|
|
168
|
+
if (saved)
|
|
169
|
+
announce(c.renamed);
|
|
170
|
+
// Back to the row after Enter or Escape; not after a click elsewhere, which already moved focus.
|
|
171
|
+
if (via === "keyboard")
|
|
172
|
+
window.setTimeout(() => selectButtonsRef.current.get(t.id)?.focus(), 0);
|
|
173
|
+
} }) }, t.id));
|
|
174
|
+
}
|
|
175
|
+
return (_jsxs("li", { "aria-busy": t.titlePending && t.title.trim() === "" ? true : undefined, className: "group flex items-center gap-1 rounded-xl hover:bg-muted", children: [_jsxs("button", { type: "button", ref: (el) => {
|
|
176
|
+
if (el)
|
|
177
|
+
selectButtonsRef.current.set(t.id, el);
|
|
178
|
+
else
|
|
179
|
+
selectButtonsRef.current.delete(t.id);
|
|
180
|
+
}, "aria-current": t.id === activeId ? "true" : undefined, onClick: () => onSelect(t.id), className: cn("min-w-0 flex-1 rounded-xl px-2 py-2 text-left", focusRing, t.id === activeId && "bg-muted"), children: [_jsx(ThreadTitle, { thread: t, c: c }), _jsxs("span", { className: "block truncate text-xs/4 text-muted-foreground", children: [formatTime(t.updatedAt), t.preview ? ` · ${t.preview}` : ""] })] }), onRename && (_jsx("button", { type: "button", "aria-label": fmt(c.rename, { title: name }), onClick: () => setRenamingId(t.id), className: cn("inline-flex size-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground pointer-coarse:size-11 transition-opacity duration-[var(--duration-micro)] hover:text-foreground motion-reduce:transition-none", "pointer-fine:opacity-0 pointer-fine:group-hover:opacity-100 pointer-fine:group-focus-within:opacity-100", focusRing), children: _jsx(Pencil, { "aria-hidden": true, className: "size-4" }) })), _jsx("button", { type: "button", "aria-label": fmt(c.delete, { title: name }), onClick: () => setPendingDelete(t), className: cn("mr-1 inline-flex size-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground pointer-coarse:size-11 hover:text-[var(--tone-danger-fg)]", focusRing), children: _jsx(Trash2, { "aria-hidden": true, className: "size-4" }) })] }, t.id));
|
|
181
|
+
}) })), _jsx("p", { className: "text-xs/4 text-muted-foreground", children: fmt(c.retention, { days: retentionDays }) }), _jsx(ConfirmationDialog, { open: pendingDelete !== null, onClose: () => setPendingDelete(null), onConfirm: () => {
|
|
34
182
|
if (pendingDelete)
|
|
35
183
|
onDelete(pendingDelete.id);
|
|
36
184
|
setPendingDelete(null);
|
|
37
|
-
}, title: c.deleteTitle, description: pendingDelete
|
|
185
|
+
}, title: c.deleteTitle, description: pendingDelete
|
|
186
|
+
? `${threadDisplayTitle(pendingDelete, c.newConversation)}. ${c.deleteBody}`
|
|
187
|
+
: c.deleteBody, confirmLabel: c.deleteConfirm, cancelLabel: c.cancel, tone: "danger" })] }));
|
|
38
188
|
}
|
|
39
189
|
//# sourceMappingURL=thread-list.js.map
|