@cellarnode/ui 0.202.0 → 0.203.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/conversation.d.ts.map +1 -1
- package/dist/agent/conversation.js +3 -1
- package/dist/agent/conversation.js.map +1 -1
- package/dist/agent/fixtures.d.ts.map +1 -1
- package/dist/agent/fixtures.js +6 -0
- package/dist/agent/fixtures.js.map +1 -1
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/markdown.d.ts.map +1 -1
- package/dist/agent/markdown.js +127 -9
- package/dist/agent/markdown.js.map +1 -1
- package/dist/agent/role-cards/text-safety.d.ts +3 -0
- package/dist/agent/role-cards/text-safety.d.ts.map +1 -1
- package/dist/agent/role-cards/text-safety.js +16 -0
- package/dist/agent/role-cards/text-safety.js.map +1 -1
- package/dist/agent/schema.d.ts +3 -0
- package/dist/agent/schema.d.ts.map +1 -1
- package/dist/agent/schema.js +6 -1
- package/dist/agent/schema.js.map +1 -1
- package/dist/agent/thread-list.d.ts +16 -4
- package/dist/agent/thread-list.d.ts.map +1 -1
- package/dist/agent/thread-list.js +43 -26
- package/dist/agent/thread-list.js.map +1 -1
- package/dist/agent/thread-title.d.ts +46 -0
- package/dist/agent/thread-title.d.ts.map +1 -0
- package/dist/agent/thread-title.js +99 -0
- package/dist/agent/thread-title.js.map +1 -0
- package/dist/agent/tool-activity.d.ts +6 -0
- package/dist/agent/tool-activity.d.ts.map +1 -1
- package/dist/agent/tool-activity.js +48 -8
- package/dist/agent/tool-activity.js.map +1 -1
- package/dist/agent/tool-call-card.d.ts +2 -0
- package/dist/agent/tool-call-card.d.ts.map +1 -1
- package/dist/agent/tool-call-card.js +12 -3
- package/dist/agent/tool-call-card.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AgentThread } from "./schema.js";
|
|
2
|
+
import { THREAD_TITLE_MAX } from "./thread-title.js";
|
|
2
3
|
export interface AgentThreadListCopy {
|
|
3
4
|
search: string;
|
|
4
5
|
noResults: string;
|
|
@@ -27,8 +28,17 @@ export interface AgentThreadListCopy {
|
|
|
27
28
|
/** `{max}` is the longest title allowed. */
|
|
28
29
|
titleTooLong: string;
|
|
29
30
|
}
|
|
30
|
-
/**
|
|
31
|
-
|
|
31
|
+
/**
|
|
32
|
+
* What `onRename` rejects with when the service refused the title and said why ("Use 80 characters or fewer."): the list
|
|
33
|
+
* shows that reason, in the service's own words, instead of the generic `renameError`. Any other rejection (a network error,
|
|
34
|
+
* a 500) shows the generic copy, so an internal message never reaches the screen. Matched by `name`, so a copy of this class
|
|
35
|
+
* from a second bundle of the package still counts.
|
|
36
|
+
*/
|
|
37
|
+
export declare class AgentThreadRenameError extends Error {
|
|
38
|
+
constructor(reason: string);
|
|
39
|
+
}
|
|
40
|
+
/** The longest title a person can give a conversation, in code points (see `thread-title.ts`); the service counts the same way. */
|
|
41
|
+
export { THREAD_TITLE_MAX };
|
|
32
42
|
/**
|
|
33
43
|
* A title taken from the first thing the user asked: whitespace collapsed, cut at a word boundary near `max`
|
|
34
44
|
* characters with an ellipsis. `undefined` for nothing to take a title from.
|
|
@@ -42,8 +52,10 @@ export interface AgentThreadListProps {
|
|
|
42
52
|
onSelect: (id: string) => void;
|
|
43
53
|
onDelete: (id: string) => void;
|
|
44
54
|
/**
|
|
45
|
-
* Saves a new title (
|
|
46
|
-
*
|
|
55
|
+
* Saves a new title (the one the service will store: cleaned of control, format and blank characters and of extra whitespace,
|
|
56
|
+
* 1 to {@link THREAD_TITLE_MAX} code points, with a letter, number, symbol or punctuation in it). Without it a row has no rename
|
|
57
|
+
* button. A rejected promise shows the rename error and keeps the field open with what was typed; reject with an
|
|
58
|
+
* {@link AgentThreadRenameError} to show the service's reason instead of the generic one.
|
|
47
59
|
*/
|
|
48
60
|
onRename?: (id: string, title: string) => Promise<void>;
|
|
49
61
|
retentionDays?: number;
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAG5C,OAAO,EAIL,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AAIxB,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,CAAC;IACf,yDAAyD;IACzD,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC;CACtB;AAgCD;;;;;GAKG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;gBACnC,MAAM,EAAE,MAAM;CAI3B;AAWD,mIAAmI;AACnI,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAG5B;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,GAAG,GAAE,MAA0B,GAC9B,MAAM,GAAG,SAAS,CAQpB;AAED,iHAAiH;AACjH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEhF;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IACrC,IAAI,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA8JD,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,aAAkB,EAClB,UAAqB,EACrB,IAAI,EACJ,SAAS,GACV,EAAE,oBAAoB,2CAsItB"}
|
|
@@ -5,7 +5,9 @@ import { ConfirmationDialog } from "../components/confirmation-dialog.js";
|
|
|
5
5
|
import { LiveRegion, useAnnounce } from "../components/live-region/index.js";
|
|
6
6
|
import { cn } from "../lib/utils.js";
|
|
7
7
|
import { fmt, useCopy } from "./copy.js";
|
|
8
|
+
import { cleanInline } from "./role-cards/text-safety.js";
|
|
8
9
|
import { AgentEmptyState } from "./states.js";
|
|
10
|
+
import { cleanTitleText, isBlankTitle, normalizeThreadTitle, THREAD_TITLE_MAX, } from "./thread-title.js";
|
|
9
11
|
import { focusRing } from "./ui.js";
|
|
10
12
|
import { useChanged } from "./use-motion.js";
|
|
11
13
|
const DEFAULT_COPY = {
|
|
@@ -30,14 +32,32 @@ const DEFAULT_COPY = {
|
|
|
30
32
|
titleTooLong: "Use {max} characters or fewer.",
|
|
31
33
|
};
|
|
32
34
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
35
|
+
* The title a thread carries, trimmed; "" when it has none. A title that draws nothing is no title: one with no letter, number,
|
|
36
|
+
* symbol or punctuation once cleaned (`thread-title.ts`: whitespace, control and format characters, the Hangul fillers, the Braille
|
|
37
|
+
* blank, combining marks, private-use and unassigned code points alone). That is a test only: the title shown is the one the
|
|
38
|
+
* service stored.
|
|
37
39
|
*/
|
|
38
|
-
const
|
|
39
|
-
/**
|
|
40
|
-
|
|
40
|
+
const titleOf = (thread) => isBlankTitle(thread.title) ? "" : thread.title.trim();
|
|
41
|
+
/**
|
|
42
|
+
* What `onRename` rejects with when the service refused the title and said why ("Use 80 characters or fewer."): the list
|
|
43
|
+
* shows that reason, in the service's own words, instead of the generic `renameError`. Any other rejection (a network error,
|
|
44
|
+
* a 500) shows the generic copy, so an internal message never reaches the screen. Matched by `name`, so a copy of this class
|
|
45
|
+
* from a second bundle of the package still counts.
|
|
46
|
+
*/
|
|
47
|
+
export class AgentThreadRenameError extends Error {
|
|
48
|
+
constructor(reason) {
|
|
49
|
+
super(reason);
|
|
50
|
+
this.name = "AgentThreadRenameError";
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** Longest reason shown, in code points. */
|
|
54
|
+
const RENAME_REASON_MAX = 200;
|
|
55
|
+
/** The reason a refused rename carries, cleaned of control and bidi characters, or `undefined` for any other failure. */
|
|
56
|
+
const renameReason = (e) => e instanceof Error && e.name === "AgentThreadRenameError"
|
|
57
|
+
? cleanInline(e.message, RENAME_REASON_MAX, true)
|
|
58
|
+
: undefined;
|
|
59
|
+
/** The longest title a person can give a conversation, in code points (see `thread-title.ts`); the service counts the same way. */
|
|
60
|
+
export { THREAD_TITLE_MAX };
|
|
41
61
|
const DERIVED_TITLE_MAX = 48;
|
|
42
62
|
/**
|
|
43
63
|
* A title taken from the first thing the user asked: whitespace collapsed, cut at a word boundary near `max`
|
|
@@ -45,7 +65,7 @@ const DERIVED_TITLE_MAX = 48;
|
|
|
45
65
|
*/
|
|
46
66
|
export function deriveThreadTitle(firstMessage, max = DERIVED_TITLE_MAX) {
|
|
47
67
|
const text = (firstMessage ?? "").replace(/\s+/g, " ").trim();
|
|
48
|
-
if (
|
|
68
|
+
if (isBlankTitle(text))
|
|
49
69
|
return undefined;
|
|
50
70
|
const chars = [...text];
|
|
51
71
|
if (chars.length <= max)
|
|
@@ -56,8 +76,7 @@ export function deriveThreadTitle(firstMessage, max = DERIVED_TITLE_MAX) {
|
|
|
56
76
|
}
|
|
57
77
|
/** What the list calls a conversation: its title, else the first words of its first message, else `fallback`. */
|
|
58
78
|
export function threadDisplayTitle(thread, fallback) {
|
|
59
|
-
|
|
60
|
-
return clean(title) === "" ? deriveThreadTitle(thread.firstMessage) || fallback : title;
|
|
79
|
+
return titleOf(thread) || deriveThreadTitle(thread.firstMessage) || fallback;
|
|
61
80
|
}
|
|
62
81
|
function RenameField({ initial, c, onSave, onClose, }) {
|
|
63
82
|
const [value, setValue] = useState(initial);
|
|
@@ -70,11 +89,6 @@ function RenameField({ initial, c, onSave, onClose, }) {
|
|
|
70
89
|
inputRef.current?.focus();
|
|
71
90
|
inputRef.current?.select();
|
|
72
91
|
}, []);
|
|
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
92
|
const finish = (via, saved) => {
|
|
79
93
|
finishedRef.current = true;
|
|
80
94
|
onClose(via, saved);
|
|
@@ -82,17 +96,20 @@ function RenameField({ initial, c, onSave, onClose, }) {
|
|
|
82
96
|
const submit = async (via) => {
|
|
83
97
|
if (finishedRef.current || status === "saving")
|
|
84
98
|
return;
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
99
|
+
// The title the service will store (cleaned, then counted): what is checked here is what it checks, what is sent is what it keeps.
|
|
100
|
+
const normalized = normalizeThreadTitle(value);
|
|
101
|
+
if (!normalized.ok) {
|
|
88
102
|
// Enter says what is wrong and waits; clicking away from a field that cannot be saved just puts the old name back.
|
|
89
103
|
if (via === "blur")
|
|
90
104
|
finish("blur", false);
|
|
91
105
|
else
|
|
92
|
-
setProblem(
|
|
106
|
+
setProblem(normalized.reason === "empty"
|
|
107
|
+
? c.titleRequired
|
|
108
|
+
: fmt(c.titleTooLong, { max: THREAD_TITLE_MAX }));
|
|
93
109
|
return;
|
|
94
110
|
}
|
|
95
|
-
|
|
111
|
+
const title = normalized.title;
|
|
112
|
+
if (title === cleanTitleText(initial)) {
|
|
96
113
|
finish(via, false);
|
|
97
114
|
return;
|
|
98
115
|
}
|
|
@@ -102,9 +119,9 @@ function RenameField({ initial, c, onSave, onClose, }) {
|
|
|
102
119
|
await onSave(title);
|
|
103
120
|
finish(via, true);
|
|
104
121
|
}
|
|
105
|
-
catch {
|
|
122
|
+
catch (e) {
|
|
106
123
|
setStatus("error");
|
|
107
|
-
setProblem(c.renameError);
|
|
124
|
+
setProblem(renameReason(e) ?? c.renameError);
|
|
108
125
|
if (via === "keyboard")
|
|
109
126
|
inputRef.current?.focus();
|
|
110
127
|
}
|
|
@@ -134,9 +151,9 @@ function RenameField({ initial, c, onSave, onClose, }) {
|
|
|
134
151
|
}, 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
152
|
}
|
|
136
153
|
function ThreadTitle({ thread, c }) {
|
|
137
|
-
const naming = Boolean(thread.titlePending) && thread
|
|
154
|
+
const naming = Boolean(thread.titlePending) && titleOf(thread) === "";
|
|
138
155
|
const display = threadDisplayTitle(thread, c.newConversation);
|
|
139
|
-
const fallback = !naming && thread
|
|
156
|
+
const fallback = !naming && titleOf(thread) === "" && display === c.newConversation;
|
|
140
157
|
const shown = naming ? "\u0000naming" : display;
|
|
141
158
|
// A title that arrives or changes fades in. The first one shown does not animate.
|
|
142
159
|
const swapped = useChanged(shown);
|
|
@@ -163,7 +180,7 @@ export function AgentThreadList({ threads, activeId, onSelect, onDelete, onRenam
|
|
|
163
180
|
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
181
|
const name = threadDisplayTitle(t, c.newConversation);
|
|
165
182
|
if (renamingId === t.id && onRename) {
|
|
166
|
-
return (_jsx("li", { children: _jsx(RenameField, { initial: t
|
|
183
|
+
return (_jsx("li", { children: _jsx(RenameField, { initial: titleOf(t) || name, c: c, onSave: (title) => onRename(t.id, title), onClose: (via, saved) => {
|
|
167
184
|
setRenamingId(null);
|
|
168
185
|
if (saved)
|
|
169
186
|
announce(c.renamed);
|
|
@@ -172,7 +189,7 @@ export function AgentThreadList({ threads, activeId, onSelect, onDelete, onRenam
|
|
|
172
189
|
window.setTimeout(() => selectButtonsRef.current.get(t.id)?.focus(), 0);
|
|
173
190
|
} }) }, t.id));
|
|
174
191
|
}
|
|
175
|
-
return (_jsxs("li", { "aria-busy": t.titlePending && t
|
|
192
|
+
return (_jsxs("li", { "aria-busy": t.titlePending && titleOf(t) === "" ? true : undefined, className: "group flex items-center gap-1 rounded-xl hover:bg-muted", children: [_jsxs("button", { type: "button", ref: (el) => {
|
|
176
193
|
if (el)
|
|
177
194
|
selectButtonsRef.current.set(t.id, el);
|
|
178
195
|
else
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thread-list.js","sourceRoot":"","sources":["../../src/agent/thread-list.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAsB,MAAM,OAAO,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA8B1C,MAAM,YAAY,G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AC,UAAU,EAElB,YAAY,EAAE,CAAC,CAAC,aAAa,EAC7B,WAAW,EAAE,CAAC,CAAC,MAAM,EACrB,IAAI,EAAC,QAAQ,GACb,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal CEL-2530 - the conversation title rules, the SAME ones the service applies when a title is saved, so the rename field
|
|
3
|
+
* refuses exactly what the service would (a 422 is then only version skew) and sends what it will store.
|
|
4
|
+
*
|
|
5
|
+
* MIRRORS the backend BFF (cellarnode-backend-v2 `features/agent-threads/rename-thread.ts`, `normalizeThreadTitle`) and the agents
|
|
6
|
+
* service (cellarnode-mcp `agents/src/thread-title.ts`, `parseUserTitle`). All three run the same vectors
|
|
7
|
+
* (`title-vectors.test.fixture.ts` here, `title-vectors.ts` in the others; byte-identical copies): change the rules in all three.
|
|
8
|
+
* Written as code points and property classes, never as literal characters, so this source carries no invisible text.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The longest title a person can give a conversation, in code points: an emoji is one whatever its UTF-16 length, so 80 emoji
|
|
12
|
+
* fit and 81 do not. Counted AFTER cleaning (see {@link cleanTitleText}), as the service does.
|
|
13
|
+
*/
|
|
14
|
+
export declare const THREAD_TITLE_MAX = 80;
|
|
15
|
+
/**
|
|
16
|
+
* Collapses every whitespace run (newlines, tabs, line and paragraph separators and the Braille blank included) to one space, strips
|
|
17
|
+
* unsafe and blank-looking characters (a stripped character is simply gone: it does not make a space), and trims. The byte order
|
|
18
|
+
* mark is a format character that JavaScript also calls whitespace; it is stripped, not turned into a space.
|
|
19
|
+
*/
|
|
20
|
+
export declare function cleanTitleText(raw: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Every run of whitespace and blank or invisible code points (the Braille blank, the Hangul fillers, no-break and other spaces, zero-width
|
|
23
|
+
* and other format characters, the soft hyphen...; the joiners ZWJ and ZWNJ excepted) becomes ONE space. For text that is drawn rather than stored (a link's words): 700 blank glyphs would otherwise push
|
|
24
|
+
* whatever follows them hundreds of pixels away.
|
|
25
|
+
*/
|
|
26
|
+
export declare function collapseBlankRuns(raw: string): string;
|
|
27
|
+
export type NormalizedTitle = {
|
|
28
|
+
ok: true;
|
|
29
|
+
title: string;
|
|
30
|
+
} | {
|
|
31
|
+
ok: false;
|
|
32
|
+
reason: "empty";
|
|
33
|
+
} | {
|
|
34
|
+
ok: false;
|
|
35
|
+
reason: "too_long";
|
|
36
|
+
length: number;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The title as it is stored: cleaned as above, with at least one visible character (a letter, number, symbol or punctuation: a
|
|
40
|
+
* title of combining marks, private-use or unassigned code points alone has none), and 1 to {@link THREAD_TITLE_MAX} code points
|
|
41
|
+
* counted after cleaning. Never silently shortened. `length` on a refusal is the CLEANED length.
|
|
42
|
+
*/
|
|
43
|
+
export declare function normalizeThreadTitle(raw: string): NormalizedTitle;
|
|
44
|
+
/** Whether `text` shows nothing as a title (see {@link normalizeThreadTitle}): no letter, number, symbol or punctuation once cleaned. */
|
|
45
|
+
export declare const isBlankTitle: (text: string) => boolean;
|
|
46
|
+
//# sourceMappingURL=thread-title.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thread-title.d.ts","sourceRoot":"","sources":["../../src/agent/thread-title.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AA2BnC;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAclD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAarD;AAKD,MAAM,MAAM,eAAe,GACvB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC3B;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAC9B;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAMjE;AAED,yIAAyI;AACzI,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,KAAG,OAA8C,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal CEL-2530 - the conversation title rules, the SAME ones the service applies when a title is saved, so the rename field
|
|
3
|
+
* refuses exactly what the service would (a 422 is then only version skew) and sends what it will store.
|
|
4
|
+
*
|
|
5
|
+
* MIRRORS the backend BFF (cellarnode-backend-v2 `features/agent-threads/rename-thread.ts`, `normalizeThreadTitle`) and the agents
|
|
6
|
+
* service (cellarnode-mcp `agents/src/thread-title.ts`, `parseUserTitle`). All three run the same vectors
|
|
7
|
+
* (`title-vectors.test.fixture.ts` here, `title-vectors.ts` in the others; byte-identical copies): change the rules in all three.
|
|
8
|
+
* Written as code points and property classes, never as literal characters, so this source carries no invisible text.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The longest title a person can give a conversation, in code points: an emoji is one whatever its UTF-16 length, so 80 emoji
|
|
12
|
+
* fit and 81 do not. Counted AFTER cleaning (see {@link cleanTitleText}), as the service does.
|
|
13
|
+
*/
|
|
14
|
+
export const THREAD_TITLE_MAX = 80;
|
|
15
|
+
/** Control, format (bidi controls, zero-width, soft hyphen, tag characters), lone surrogate, line and paragraph separator characters. */
|
|
16
|
+
const STRIPPED_CLASSES = /^[\p{Cc}\p{Cf}\p{Cs}\p{Zl}\p{Zp}]$/u;
|
|
17
|
+
/** ZWNJ and ZWJ are format characters that emoji sequences and several scripts need, so they stay. */
|
|
18
|
+
const KEPT_JOINERS = new Set([0x200c, 0x200d]);
|
|
19
|
+
/** Blank-looking letters and separators that are not in the classes above: Hangul fillers, soft hyphen, Mongolian vowel separator. */
|
|
20
|
+
const BLANK_LOOKING = new Set([0x115f, 0x1160, 0x3164, 0xffa0, 0x00ad, 0x180e]);
|
|
21
|
+
/** The Braille pattern blank is a symbol (category So, so it would count as visible) that draws nothing: it is the Braille space. */
|
|
22
|
+
const BRAILLE_BLANK = 0x2800;
|
|
23
|
+
/** A title needs at least one real character: a letter, a number, a symbol (emoji) or punctuation. */
|
|
24
|
+
const VISIBLE = /[\p{L}\p{N}\p{S}\p{P}]/u;
|
|
25
|
+
const WHITESPACE = /^\s$/u;
|
|
26
|
+
const BYTE_ORDER_MARK = 0xfeff;
|
|
27
|
+
/** Whitespace as far as a title goes: what JavaScript calls whitespace, except the byte order mark, plus the Braille blank. */
|
|
28
|
+
const isSpace = (ch) => {
|
|
29
|
+
const c = ch.codePointAt(0) ?? 0;
|
|
30
|
+
return c === BRAILLE_BLANK || (c !== BYTE_ORDER_MARK && WHITESPACE.test(ch));
|
|
31
|
+
};
|
|
32
|
+
function isStripped(ch) {
|
|
33
|
+
const c = ch.codePointAt(0) ?? 0;
|
|
34
|
+
if (KEPT_JOINERS.has(c))
|
|
35
|
+
return false;
|
|
36
|
+
return BLANK_LOOKING.has(c) || (c >= 0xe0000 && c <= 0xe007f) || STRIPPED_CLASSES.test(ch);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Collapses every whitespace run (newlines, tabs, line and paragraph separators and the Braille blank included) to one space, strips
|
|
40
|
+
* unsafe and blank-looking characters (a stripped character is simply gone: it does not make a space), and trims. The byte order
|
|
41
|
+
* mark is a format character that JavaScript also calls whitespace; it is stripped, not turned into a space.
|
|
42
|
+
*/
|
|
43
|
+
export function cleanTitleText(raw) {
|
|
44
|
+
let out = "";
|
|
45
|
+
let space = false;
|
|
46
|
+
for (const ch of raw) {
|
|
47
|
+
if (isSpace(ch)) {
|
|
48
|
+
space = true;
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
if (isStripped(ch))
|
|
52
|
+
continue;
|
|
53
|
+
if (space && out !== "")
|
|
54
|
+
out += " ";
|
|
55
|
+
space = false;
|
|
56
|
+
out += ch;
|
|
57
|
+
}
|
|
58
|
+
return out;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Every run of whitespace and blank or invisible code points (the Braille blank, the Hangul fillers, no-break and other spaces, zero-width
|
|
62
|
+
* and other format characters, the soft hyphen...; the joiners ZWJ and ZWNJ excepted) becomes ONE space. For text that is drawn rather than stored (a link's words): 700 blank glyphs would otherwise push
|
|
63
|
+
* whatever follows them hundreds of pixels away.
|
|
64
|
+
*/
|
|
65
|
+
export function collapseBlankRuns(raw) {
|
|
66
|
+
let out = "";
|
|
67
|
+
let run = false;
|
|
68
|
+
for (const ch of raw) {
|
|
69
|
+
if (isSpace(ch) || isStripped(ch)) {
|
|
70
|
+
if (!run)
|
|
71
|
+
out += " ";
|
|
72
|
+
run = true;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
out += ch;
|
|
76
|
+
run = false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return out;
|
|
80
|
+
}
|
|
81
|
+
/** The number of code points in `s` (what a person counts: U+1F600 is one character, though `.length` says two). */
|
|
82
|
+
const codePointLength = (s) => [...s].length;
|
|
83
|
+
/**
|
|
84
|
+
* The title as it is stored: cleaned as above, with at least one visible character (a letter, number, symbol or punctuation: a
|
|
85
|
+
* title of combining marks, private-use or unassigned code points alone has none), and 1 to {@link THREAD_TITLE_MAX} code points
|
|
86
|
+
* counted after cleaning. Never silently shortened. `length` on a refusal is the CLEANED length.
|
|
87
|
+
*/
|
|
88
|
+
export function normalizeThreadTitle(raw) {
|
|
89
|
+
const title = cleanTitleText(raw);
|
|
90
|
+
if (!VISIBLE.test(title))
|
|
91
|
+
return { ok: false, reason: "empty" };
|
|
92
|
+
const length = codePointLength(title);
|
|
93
|
+
if (length > THREAD_TITLE_MAX)
|
|
94
|
+
return { ok: false, reason: "too_long", length };
|
|
95
|
+
return { ok: true, title };
|
|
96
|
+
}
|
|
97
|
+
/** Whether `text` shows nothing as a title (see {@link normalizeThreadTitle}): no letter, number, symbol or punctuation once cleaned. */
|
|
98
|
+
export const isBlankTitle = (text) => !VISIBLE.test(cleanTitleText(text));
|
|
99
|
+
//# sourceMappingURL=thread-title.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thread-title.js","sourceRoot":"","sources":["../../src/agent/thread-title.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAEnC,yIAAyI;AACzI,MAAM,gBAAgB,GAAG,qCAAqC,CAAC;AAC/D,sGAAsG;AACtG,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAC/C,sIAAsI;AACtI,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAChF,qIAAqI;AACrI,MAAM,aAAa,GAAG,MAAM,CAAC;AAC7B,sGAAsG;AACtG,MAAM,OAAO,GAAG,yBAAyB,CAAC;AAC1C,MAAM,UAAU,GAAG,OAAO,CAAC;AAC3B,MAAM,eAAe,GAAG,MAAM,CAAC;AAE/B,+HAA+H;AAC/H,MAAM,OAAO,GAAG,CAAC,EAAU,EAAW,EAAE;IACtC,MAAM,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACjC,OAAO,CAAC,KAAK,aAAa,IAAI,CAAC,CAAC,KAAK,eAAe,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/E,CAAC,CAAC;AAEF,SAAS,UAAU,CAAC,EAAU;IAC5B,MAAM,CAAC,GAAG,EAAE,CAAC,WAAW,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C;AACb,CAAC;AAED,oHAAoH;AACpH,MAAM,eAAe,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;AAO7D;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAW;IAC9C,MAAM,KAAK,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;IAClC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAChE,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACtC,IAAI,MAAM,GAAG,gBAAgB;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;IAChF,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AAC7B,CAAC;AAED,yIAAyI;AACzI,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC"}
|
|
@@ -5,6 +5,10 @@ export interface AgentToolActivityCopy {
|
|
|
5
5
|
succeeded: string;
|
|
6
6
|
failed: string;
|
|
7
7
|
retrying: string;
|
|
8
|
+
/** A step the user stopped (only that; anything else unfinished is `failed`): its status word, read by assistive tech. */
|
|
9
|
+
cancelled: string;
|
|
10
|
+
/** The line under a stopped step. It says what happened, never "failed": nothing went wrong. */
|
|
11
|
+
cancelledDetail: string;
|
|
8
12
|
/** Accessible name of the list of steps. */
|
|
9
13
|
list: string;
|
|
10
14
|
/** A finished thought, and one in progress. */
|
|
@@ -28,6 +32,8 @@ export interface AgentToolActivityCopy {
|
|
|
28
32
|
took: string;
|
|
29
33
|
/** The one line a long, finished trail folds into; `{count}` steps. */
|
|
30
34
|
steps: string;
|
|
35
|
+
/** The same line when some of the steps were stopped; `{count}` steps, `{stopped}` of them stopped. */
|
|
36
|
+
stepsStopped: string;
|
|
31
37
|
}
|
|
32
38
|
export interface AgentToolActivityProps extends AgentToolNaming {
|
|
33
39
|
steps: readonly AgentActivityStep[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-activity.d.ts","sourceRoot":"","sources":["../../src/agent/tool-activity.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tool-activity.d.ts","sourceRoot":"","sources":["../../src/agent/tool-activity.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAOL,KAAK,iBAAiB,EACtB,KAAK,eAAe,EAIrB,MAAM,uBAAuB,CAAC;AAI/B,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,0HAA0H;IAC1H,SAAS,EAAE,MAAM,CAAC;IAClB,gGAAgG;IAChG,eAAe,EAAE,MAAM,CAAC;IACxB,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,UAAU,EAAE,MAAM,CAAC;IACnB,+GAA+G;IAC/G,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC;IACd,uGAAuG;IACvG,YAAY,EAAE,MAAM,CAAC;CACtB;AA6XD,MAAM,WAAW,sBAAuB,SAAQ,eAAe;IAC7D,KAAK,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACpC,qFAAqF;IACrF,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,uDAAuD;IACvD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,uHAAuH;IACvH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,UAAU,EACV,eAAe,EACf,UAAU,EACV,WAAW,EACX,OAAO,EACP,WAAmB,EACnB,MAAM,EACN,IAAI,EACJ,SAAS,GACV,EAAE,sBAAsB,2CAyGxB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useId, useMemo, useState } from "react";
|
|
3
|
-
import { ArrowDown, Check, ChevronRight, CircleDashed, Lightbulb, LoaderCircle, RotateCw, TriangleAlert, } from "lucide-react";
|
|
2
|
+
import { useCallback, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { ArrowDown, Check, ChevronRight, CircleDashed, CircleStop, Lightbulb, LoaderCircle, RotateCw, TriangleAlert, } from "lucide-react";
|
|
4
4
|
import { cn } from "../lib/utils.js";
|
|
5
5
|
import { fmt, useCopy } from "./copy.js";
|
|
6
6
|
import { MaskedValue } from "./masked-value.js";
|
|
@@ -13,6 +13,8 @@ const DEFAULT_COPY = {
|
|
|
13
13
|
succeeded: "Done",
|
|
14
14
|
failed: "Failed",
|
|
15
15
|
retrying: "Retrying",
|
|
16
|
+
cancelled: "Stopped",
|
|
17
|
+
cancelledDetail: "Stopped before it finished",
|
|
16
18
|
list: "Steps",
|
|
17
19
|
thought: "Thought",
|
|
18
20
|
thinking: "Thinking",
|
|
@@ -28,6 +30,7 @@ const DEFAULT_COPY = {
|
|
|
28
30
|
retry: "Retry",
|
|
29
31
|
took: "Took {seconds}s",
|
|
30
32
|
steps: "{count} steps",
|
|
33
|
+
stepsStopped: "{count} steps, {stopped} stopped",
|
|
31
34
|
};
|
|
32
35
|
const STATUS = {
|
|
33
36
|
pending: { icon: CircleDashed, tone: "text-muted-foreground" },
|
|
@@ -35,7 +38,11 @@ const STATUS = {
|
|
|
35
38
|
succeeded: { icon: Check, tone: "text-muted-foreground" },
|
|
36
39
|
failed: { icon: TriangleAlert, tone: "text-[var(--tone-danger-fg)]" },
|
|
37
40
|
retrying: { icon: RotateCw, spin: true, tone: "text-muted-foreground" },
|
|
41
|
+
// Stopped is not an error: the same quiet tone as every other step, with its own mark.
|
|
42
|
+
cancelled: { icon: CircleStop, tone: "text-muted-foreground" },
|
|
38
43
|
};
|
|
44
|
+
/** A status this version does not know (a newer host): quiet, not a crash. */
|
|
45
|
+
const NEUTRAL_STATUS = { icon: CircleDashed, tone: "text-muted-foreground" };
|
|
39
46
|
/** Past this many steps, a trail that was already finished when it appeared folds into one line. */
|
|
40
47
|
const FOLD_AFTER = 4;
|
|
41
48
|
const PREVIEW_LINES = 20;
|
|
@@ -46,7 +53,7 @@ const MAX_LINES = 400;
|
|
|
46
53
|
* spinning icon must keep its own animation, and two animations on one element would replace each other.
|
|
47
54
|
*/
|
|
48
55
|
function StatusIcon({ status, kind, changed, }) {
|
|
49
|
-
const s = STATUS[status];
|
|
56
|
+
const s = STATUS[status] ?? NEUTRAL_STATUS;
|
|
50
57
|
const Icon = kind === "thought" && status === "succeeded" ? Lightbulb : s.icon;
|
|
51
58
|
return (_jsx("span", { className: cn("inline-flex shrink-0", changed && "agent-pop"), children: _jsx(Icon, { "aria-hidden": true, className: cn("size-3.5", s.tone, s.spin && "animate-spin motion-reduce:animate-none") }) }, status));
|
|
52
59
|
}
|
|
@@ -109,7 +116,16 @@ function StepRow({ step, namer, defaultOpen, onRetry, locale, c, }) {
|
|
|
109
116
|
const inFlight = stepInFlight(step);
|
|
110
117
|
const status = step.kind === "thought" ? (step.running ? "running" : "succeeded") : step.call.status;
|
|
111
118
|
const failedCall = step.kind === "tool" && step.call.status === "failed" ? step.call : undefined;
|
|
112
|
-
const
|
|
119
|
+
const stopped = step.kind === "tool" && step.call.status === "cancelled";
|
|
120
|
+
// A status this version does not know says neither done nor failed: the active tense, and no status word.
|
|
121
|
+
const unknown = !(status in STATUS);
|
|
122
|
+
// A stopped step names the work it was doing ("Checking organization"), without the in-progress suffix: it neither finished
|
|
123
|
+
// ("Checked") nor failed ("Couldn't check").
|
|
124
|
+
const tense = failedCall
|
|
125
|
+
? "failed"
|
|
126
|
+
: inFlight || stopped || unknown
|
|
127
|
+
? "active"
|
|
128
|
+
: "done";
|
|
113
129
|
const label = step.kind === "thought"
|
|
114
130
|
? step.running
|
|
115
131
|
? c.thinking
|
|
@@ -121,9 +137,10 @@ function StepRow({ step, namer, defaultOpen, onRetry, locale, c, }) {
|
|
|
121
137
|
const statusChanged = useChanged(status);
|
|
122
138
|
const text = (_jsxs("span", { title: title, className: cn("min-w-0 truncate", swapped && "agent-swap-in", failedCall && "text-[var(--tone-danger-fg)]"), children: [label, inFlight ? c.inProgress : ""] }, tense));
|
|
123
139
|
const chip = step.kind === "tool" && step.shownBelow ? (_jsxs("span", { className: cn("inline-flex shrink-0 items-center gap-1 rounded-full px-2 py-0.5 text-xs/4", toneChip.neutral), children: [_jsx(ArrowDown, { "aria-hidden": true, className: "size-3" }), _jsxs("span", { className: "sr-only", children: [c.shownBelow, c.srCardSeparator] }), step.cardTitle || c.shownBelow] })) : null;
|
|
124
|
-
|
|
140
|
+
// A stopped step's detail line already says "Stopped before it finished": the status word would be read twice.
|
|
141
|
+
const statusSr = stopped || unknown ? null : (_jsxs("span", { className: "sr-only", children: [c.srStatusSeparator, c[status]] }));
|
|
125
142
|
const rowClass = "inline-flex min-h-6 max-w-full items-center gap-2 text-left text-xs/5 text-muted-foreground";
|
|
126
|
-
return (_jsxs("li", { "data-status": status, "data-kind": step.kind, className: "flex flex-col", children: [expandable ? (_jsxs("button", { type: "button", "aria-expanded": open, "aria-controls": panelId, onClick: () => setOpen((v) => !v), className: cn(rowClass, "-ml-1 self-start rounded-md px-1 transition-colors duration-[var(--duration-micro)] hover:text-foreground motion-reduce:transition-none pointer-coarse:min-h-11", focusRing), children: [_jsx(StatusIcon, { status: status, kind: step.kind, changed: statusChanged }), text, chip, statusSr, _jsx(ChevronRight, { "aria-hidden": true, className: cn("size-3.5 shrink-0 transition-transform duration-[var(--duration-micro)] motion-reduce:transition-none", open && "rotate-90") })] })) : (_jsxs("div", { className: cn(rowClass, "self-start"), children: [_jsx(StatusIcon, { status: status, kind: step.kind, changed: statusChanged }), text, chip, statusSr] })), failedCall && (_jsxs("div", { className: "mt-0.5 flex items-start justify-between gap-2 pl-5.5", children: [_jsx("p", { className: "min-w-0 text-xs/5 break-words text-[var(--tone-danger-fg)]", children: failedCall.error }), onRetry && (_jsx("button", { type: "button", className: agentButton.quiet, onClick: () => onRetry(failedCall.id), children: c.retry }))] })), expandable && open && (_jsx("div", { id: panelId, className: "pl-5.5 text-xs/5", children: step.kind === "thought" ? (_jsx("p", { className: "agent-fade-in py-1 whitespace-pre-wrap text-muted-foreground", children: step.summary })) : (_jsx(ToolDetails, { step: step, c: c, locale: locale })) }))] }));
|
|
143
|
+
return (_jsxs("li", { "data-status": status, "data-kind": step.kind, className: "flex flex-col", children: [expandable ? (_jsxs("button", { type: "button", "aria-expanded": open, "aria-controls": panelId, onClick: () => setOpen((v) => !v), className: cn(rowClass, "-ml-1 self-start rounded-md px-1 transition-colors duration-[var(--duration-micro)] hover:text-foreground motion-reduce:transition-none pointer-coarse:min-h-11", focusRing), children: [_jsx(StatusIcon, { status: status, kind: step.kind, changed: statusChanged }), text, chip, statusSr, _jsx(ChevronRight, { "aria-hidden": true, className: cn("size-3.5 shrink-0 transition-transform duration-[var(--duration-micro)] motion-reduce:transition-none", open && "rotate-90") })] })) : (_jsxs("div", { className: cn(rowClass, "self-start"), children: [_jsx(StatusIcon, { status: status, kind: step.kind, changed: statusChanged }), text, chip, statusSr] })), stopped && (_jsx("p", { className: "mt-0.5 pl-5.5 text-xs/5 break-words text-muted-foreground", children: c.cancelledDetail })), failedCall && (_jsxs("div", { className: "mt-0.5 flex items-start justify-between gap-2 pl-5.5", children: [_jsx("p", { className: "min-w-0 text-xs/5 break-words text-[var(--tone-danger-fg)]", children: failedCall.error }), onRetry && (_jsx("button", { type: "button", className: agentButton.quiet, onClick: () => onRetry(failedCall.id), children: c.retry }))] })), expandable && open && (_jsx("div", { id: panelId, className: "pl-5.5 text-xs/5", children: step.kind === "thought" ? (_jsx("p", { className: "agent-fade-in py-1 whitespace-pre-wrap text-muted-foreground", children: step.summary })) : (_jsx(ToolDetails, { step: step, c: c, locale: locale })) }))] }));
|
|
127
144
|
}
|
|
128
145
|
/**
|
|
129
146
|
* @internal The agent's work in a turn as a quiet vertical trail: one muted line per step ("Thought ›", "Checked MCP overview",
|
|
@@ -141,6 +158,8 @@ export function AgentToolActivity({ steps, toolLabels, formatToolLabel, cardLabe
|
|
|
141
158
|
const namer = useMemo(() => createToolNamer({ toolLabels, formatToolLabel, cardLabels, toolWording }), [toolLabels, formatToolLabel, cardLabels, toolWording]);
|
|
142
159
|
const working = steps.some(stepInFlight);
|
|
143
160
|
const failed = steps.some((s) => s.kind === "tool" && s.call.status === "failed");
|
|
161
|
+
// Stopped steps are counted apart from failed ones: they never hold a trail open and the summary says "stopped", not "failed".
|
|
162
|
+
const stopped = steps.filter((s) => s.kind === "tool" && s.call.status === "cancelled").length;
|
|
144
163
|
// Decided once, when the trail appears: a trail that is already finished and long is history and folds; one that was
|
|
145
164
|
// live (or has a failure, whose error and Retry stay visible) never does.
|
|
146
165
|
const [foldable] = useState(() => !working && !failed && steps.length > FOLD_AFTER);
|
|
@@ -153,7 +172,28 @@ export function AgentToolActivity({ steps, toolLabels, formatToolLabel, cardLabe
|
|
|
153
172
|
// claimed otherwise (and a toggle that cannot toggle) would be wrong: it is hidden until the trail settles.
|
|
154
173
|
const showFold = foldable && !working && !failed;
|
|
155
174
|
const listId = useId();
|
|
156
|
-
|
|
157
|
-
|
|
175
|
+
// The fold line leaves when a step goes live or fails. A keyboard user who is on it would be dropped on <body> and start over
|
|
176
|
+
// from the top of the page, so focus moves to the list of steps it belonged to. The line is still in the document when its
|
|
177
|
+
// ref is detached (the only moment that tells whether it has focus), the list may not be yet (a folded trail opens in the
|
|
178
|
+
// same commit), so the move happens in the layout effect below.
|
|
179
|
+
const listRef = useRef(null);
|
|
180
|
+
const foldLeftWithFocusRef = useRef(false);
|
|
181
|
+
const foldRef = useCallback((button) => {
|
|
182
|
+
if (!button)
|
|
183
|
+
return;
|
|
184
|
+
return () => {
|
|
185
|
+
foldLeftWithFocusRef.current = document.activeElement === button;
|
|
186
|
+
};
|
|
187
|
+
}, []);
|
|
188
|
+
useLayoutEffect(() => {
|
|
189
|
+
if (!foldLeftWithFocusRef.current)
|
|
190
|
+
return;
|
|
191
|
+
foldLeftWithFocusRef.current = false;
|
|
192
|
+
listRef.current?.focus({ preventScroll: true });
|
|
193
|
+
});
|
|
194
|
+
const list = (_jsx("ul", { ref: listRef, id: listId, "aria-label": c.list, tabIndex: -1, className: cn("flex flex-col gap-0.5 rounded-md", focusRing), children: steps.map((s) => (_jsx(StepRow, { step: s, namer: namer, defaultOpen: defaultOpen, onRetry: onRetry, locale: locale, c: c }, stepId(s)))) }));
|
|
195
|
+
return (_jsxs("div", { "data-status": working ? "running" : failed ? "failed" : stopped > 0 ? "cancelled" : "succeeded", className: cn("flex flex-col gap-0.5", className), children: [showFold && (_jsxs("button", { ref: foldRef, type: "button", "aria-expanded": !folded, "aria-controls": listId, onClick: () => setFolded((v) => !v), className: cn("-ml-1 inline-flex min-h-6 items-center gap-2 self-start rounded-md px-1 text-xs/5 text-muted-foreground transition-colors duration-[var(--duration-micro)] hover:text-foreground motion-reduce:transition-none pointer-coarse:min-h-11", focusRing), children: [stopped > 0 ? (_jsx(CircleStop, { "aria-hidden": true, className: "size-3.5" })) : (_jsx(Check, { "aria-hidden": true, className: "size-3.5" })), _jsx("span", { className: "tabular-nums", children: stopped > 0
|
|
196
|
+
? fmt(c.stepsStopped, { count: steps.length, stopped })
|
|
197
|
+
: fmt(c.steps, { count: steps.length }) }), _jsx(ChevronRight, { "aria-hidden": true, className: cn("size-3.5 transition-transform duration-[var(--duration-micro)] motion-reduce:transition-none", !folded && "rotate-90") })] })), (!foldable || !folded) && (_jsx("div", { className: foldable ? "agent-fade-in pl-1" : undefined, children: list }))] }));
|
|
158
198
|
}
|
|
159
199
|
//# sourceMappingURL=tool-activity.js.map
|