@adecore/agents-react 0.51.0 → 0.53.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/agents/AgentIcon.js +25 -17
- package/dist/agents/ProviderLogo.js +26 -16
- package/dist/agents/agent-marks.d.ts +1 -0
- package/dist/agents/provider-paths.d.ts +2 -1
- package/dist/agents/provider-paths.js +11 -2
- package/dist/chat/index.d.ts +2 -1
- package/dist/chat/index.js +2 -1
- package/dist/chat/logic/command-looks.d.ts +17 -5
- package/dist/chat/logic/command-looks.js +35 -7
- package/dist/chat/logic/timeline.d.ts +6 -4
- package/dist/chat/logic/timeline.js +32 -25
- package/dist/chat/logic/tool-looks.d.ts +16 -0
- package/dist/chat/logic/tool-looks.js +188 -0
- package/dist/chat/logic/tools.d.ts +5 -0
- package/dist/chat/logic/tools.js +17 -2
- package/dist/chat/ui/ShellCommand.d.ts +2 -1
- package/dist/chat/ui/ShellCommand.js +73 -22
- package/dist/chat/ui/SubagentTimeline.js +5 -2
- package/dist/chat/ui/Timeline.js +2 -1
- package/dist/chat/ui/diff/EditorEditDiff.d.ts +3 -2
- package/dist/chat/ui/diff/EditorEditDiff.js +93 -79
- package/dist/chat/ui/diff/LegacyEditDiff.d.ts +1 -1
- package/dist/chat/ui/diff/LegacyEditDiff.js +64 -48
- package/dist/chat/ui/rows/RowContainer.js +26 -23
- package/dist/chat/ui/rows/WorkRows.d.ts +3 -4
- package/dist/chat/ui/rows/WorkRows.js +592 -519
- package/dist/chat/ui/rows/row-rhythm.d.ts +2 -2
- package/dist/chat/ui/rows/row-rhythm.js +9 -6
- package/dist/chat/ui/thread-references.d.ts +1 -0
- package/dist/chat/ui/thread-references.js +4 -3
- package/dist/host.d.ts +28 -0
- package/dist/index.d.ts +1 -1
- package/dist/locales/en/agent-chat.d.ts +4 -0
- package/dist/locales/en/agent-chat.js +4 -0
- package/dist/locales/nl/agent-chat.d.ts +4 -0
- package/dist/locales/nl/agent-chat.js +4 -0
- package/package.json +8 -8
- package/src/agents/AgentIcon.tsx +2 -1
- package/src/agents/ProviderLogo.tsx +2 -2
- package/src/agents/agent-marks.ts +2 -0
- package/src/agents/provider-paths.ts +15 -3
- package/src/chat/index.ts +2 -1
- package/src/chat/logic/command-looks.ts +51 -10
- package/src/chat/logic/timeline.ts +46 -27
- package/src/chat/logic/tool-looks.ts +228 -0
- package/src/chat/logic/tools.ts +13 -2
- package/src/chat/ui/ShellCommand.tsx +33 -6
- package/src/chat/ui/SubagentTimeline.tsx +3 -2
- package/src/chat/ui/Timeline.tsx +2 -1
- package/src/chat/ui/diff/EditorEditDiff.tsx +31 -5
- package/src/chat/ui/diff/LegacyEditDiff.tsx +5 -3
- package/src/chat/ui/rows/RowContainer.tsx +4 -2
- package/src/chat/ui/rows/WorkRows.tsx +46 -33
- package/src/chat/ui/rows/row-rhythm.ts +9 -6
- package/src/chat/ui/thread-references.ts +5 -1
- package/src/host.ts +51 -0
- package/src/index.ts +3 -0
- package/src/locales/en/agent-chat.ts +4 -0
- package/src/locales/nl/agent-chat.ts +4 -0
|
@@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
5
5
|
import { ChevronRight, FileDiff, X } from 'lucide-react';
|
|
6
6
|
import type { ChatCheckpointDiff, ChatCheckpointFile, ChatFileChange, ChatToolItem, ChatTurnItem } from '@adecore/agent-contracts';
|
|
7
7
|
import type { BaseMoved } from '../../logic/timeline';
|
|
8
|
-
import {
|
|
8
|
+
import { lookKey, lookRunOf, type Look, type LookRun } from '../../logic/command-looks';
|
|
9
9
|
import {
|
|
10
10
|
exitCodeOf,
|
|
11
11
|
fileChanges,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
type FileChange
|
|
23
23
|
} from '../../logic/tools';
|
|
24
24
|
import { useOpenForFind } from '../find-reveal';
|
|
25
|
-
import { useChatHost, type CommandLook } from '../../../host';
|
|
25
|
+
import { useChatHost, type CommandLook, type ToolLook } from '../../../host';
|
|
26
26
|
import { useCommandNames } from '../../../host-hooks';
|
|
27
27
|
import { lazyNamed } from '../../../lazy';
|
|
28
28
|
import { useChatActions } from '../../actions';
|
|
@@ -34,8 +34,10 @@ import { formatClockDuration, formatElapsedShort } from '@adecore/ui/format';
|
|
|
34
34
|
import { Button, Icon, LazyBoundary, MiddleTruncate, Spinner, useTickingText } from '@adecore/ui';
|
|
35
35
|
import { ROW_GUTTER, toolIcon } from '../icons';
|
|
36
36
|
import { AnsiOutput } from '../AnsiOutput';
|
|
37
|
+
import { ReferenceLookupContext } from '../reference-lookup';
|
|
37
38
|
import { RowTime } from '../RowTime';
|
|
38
39
|
import { ShellCommand, type NamedWord } from '../ShellCommand';
|
|
40
|
+
import { useReferenceLookupIn } from '../thread-references';
|
|
39
41
|
import { DiffStack, ReviewStackView } from '../diff/DiffStack';
|
|
40
42
|
import { reviewEntries, type ReviewEntry } from '../diff/review-plan';
|
|
41
43
|
import { useReviewStack } from '../diff/use-review-stack';
|
|
@@ -75,14 +77,15 @@ function withBrand(text: string, brands: readonly string[]): ReactNode {
|
|
|
75
77
|
return text;
|
|
76
78
|
}
|
|
77
79
|
|
|
78
|
-
function hasNames(look:
|
|
80
|
+
function hasNames(look: Look): look is Look & Required<Pick<Look, 'useNames'>> {
|
|
79
81
|
return look.useNames !== undefined;
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
/* The detail of a look's run, with the words its host names drawn as those names. */
|
|
83
|
-
function NamedLookDetail({ run, chatId, look }: { run:
|
|
85
|
+
function NamedLookDetail({ run, chatId, look }: { run: LookRun; chatId: string; look: Required<Pick<Look, 'useNames'>> }) {
|
|
84
86
|
const scope = useContext(ChatScopeContext);
|
|
85
87
|
const nameOf = useCommandNames(look, scope?.id ?? '', chatId);
|
|
88
|
+
const lookup = useReferenceLookupIn(scope?.id ?? '', chatId);
|
|
86
89
|
|
|
87
90
|
const names = run.words.flatMap((word): NamedWord[] => {
|
|
88
91
|
const name = nameOf(word.text, word.option);
|
|
@@ -90,24 +93,28 @@ function NamedLookDetail({ run, chatId, look }: { run: CommandLookRun; chatId: s
|
|
|
90
93
|
return name === null ? [] : [{ start: word.start, end: word.end, word: word.text, name }];
|
|
91
94
|
});
|
|
92
95
|
|
|
93
|
-
return
|
|
96
|
+
return (
|
|
97
|
+
<ReferenceLookupContext value={lookup}>
|
|
98
|
+
<ShellCommand command={run.detail} code={run.code} names={names} plain={!run.shell} />
|
|
99
|
+
</ReferenceLookupContext>
|
|
100
|
+
);
|
|
94
101
|
}
|
|
95
102
|
|
|
96
|
-
function LookDetail({ run, chatId }: { run:
|
|
103
|
+
function LookDetail({ run, chatId }: { run: LookRun; chatId: string }) {
|
|
97
104
|
const { look } = run;
|
|
98
105
|
|
|
99
106
|
if (!hasNames(look)) {
|
|
100
|
-
return <ShellCommand command={run.detail} code={run.code} />;
|
|
107
|
+
return <ShellCommand command={run.detail} code={run.code} plain={!run.shell} />;
|
|
101
108
|
}
|
|
102
109
|
|
|
103
110
|
// Keyed by the look, so a row whose command turns into another look's starts its hooks again.
|
|
104
|
-
return <NamedLookDetail key={look
|
|
111
|
+
return <NamedLookDetail key={lookKey(look)} run={run} chatId={chatId} look={look} />;
|
|
105
112
|
}
|
|
106
113
|
|
|
107
114
|
const TAG = 'shrink-0 rounded bg-surface-hover px-1.5 text-text-faint';
|
|
108
115
|
|
|
109
116
|
/* What else the line ran, in quiet tags: the other programs and a heredoc, and how many more runs of a look. */
|
|
110
|
-
function LookTags({ run }: { run:
|
|
117
|
+
function LookTags({ run }: { run: LookRun }) {
|
|
111
118
|
const { t } = useTranslation('agent-chat');
|
|
112
119
|
const also = run.heredoc ? [...run.others, t('work.heredoc')] : run.others;
|
|
113
120
|
|
|
@@ -146,23 +153,24 @@ export function ToggleLine({
|
|
|
146
153
|
detail?: string;
|
|
147
154
|
/* Draws `detail` as a shell command, in the colors of the code theme. */
|
|
148
155
|
command?: boolean;
|
|
149
|
-
/* A
|
|
150
|
-
look?: { run:
|
|
156
|
+
/* A call read as a look's tool, whose detail and tags take the place of `detail`. */
|
|
157
|
+
look?: { run: LookRun; chatId: string };
|
|
151
158
|
/* `detail` is the path of a file, cut in the middle so its name stays in sight. */
|
|
152
159
|
path?: boolean;
|
|
153
160
|
open?: boolean;
|
|
154
161
|
onToggle?(): void;
|
|
162
|
+
/* Marks the line with a cross in the error tone; the label and the detail keep their own. */
|
|
155
163
|
failed?: boolean;
|
|
156
164
|
live?: boolean;
|
|
157
165
|
trailing?: ReactNode;
|
|
158
166
|
time?: number;
|
|
159
167
|
className?: string;
|
|
160
168
|
}) {
|
|
169
|
+
const { t } = useTranslation('agent-chat');
|
|
161
170
|
const classes = clsx(
|
|
162
171
|
// Fix the width so long commands reach the truncation inside the negative margins.
|
|
163
|
-
'group/line -mx-1 mb-0.5 flex h-7 w-[calc(100%+8px)] items-center gap-2 rounded-md px-1 text-left text-xs',
|
|
172
|
+
'group/line -mx-1 mb-0.5 flex h-7 w-[calc(100%+8px)] items-center gap-2 rounded-md px-1 text-left text-xs text-text-muted',
|
|
164
173
|
onToggle !== undefined && 'hover:bg-surface-hover',
|
|
165
|
-
failed ? 'text-status-error' : 'text-text-muted',
|
|
166
174
|
className
|
|
167
175
|
);
|
|
168
176
|
|
|
@@ -196,7 +204,12 @@ export function ToggleLine({
|
|
|
196
204
|
<span className="grow" />
|
|
197
205
|
{trailing}
|
|
198
206
|
{time !== undefined && <RowTime at={time} />}
|
|
199
|
-
{failed &&
|
|
207
|
+
{failed && (
|
|
208
|
+
<span className="shrink-0 text-status-error">
|
|
209
|
+
<Icon icon={X} size={12} />
|
|
210
|
+
<span className="sr-only">{t('work.failed')}</span>
|
|
211
|
+
</span>
|
|
212
|
+
)}
|
|
200
213
|
{onToggle !== undefined && (
|
|
201
214
|
<Icon icon={ChevronRight} size={12} className={clsx('shrink-0 text-text-faint transition-transform', open && 'rotate-90')} />
|
|
202
215
|
)}
|
|
@@ -458,13 +471,13 @@ export function WorkRow({
|
|
|
458
471
|
const summary = detail ?? toolSummary(tool.name, tool.input);
|
|
459
472
|
const opens = hasToolBody(tool);
|
|
460
473
|
const shell = shellCommand(tool.name, tool.input);
|
|
461
|
-
const run = detail === undefined && icon === undefined && label === undefined
|
|
474
|
+
const run = detail === undefined && icon === undefined && label === undefined ? lookRunOf(tool, host.commandLooks, host.toolLooks) : null;
|
|
462
475
|
|
|
463
476
|
return (
|
|
464
477
|
<div data-find-item={tool.id} className={nested ? 'ml-6' : undefined}>
|
|
465
478
|
<ToggleLine
|
|
466
479
|
icon={run === null ? (icon ?? toolIcon(tool.name)) : <run.look.Mark size={12} />}
|
|
467
|
-
label={run === null ? (label ?? tool.name) : run.
|
|
480
|
+
label={run === null ? (label ?? tool.name) : run.label}
|
|
468
481
|
brand={run?.look.brand}
|
|
469
482
|
detail={summary}
|
|
470
483
|
look={run === null ? undefined : { run, chatId: chatId ?? '' }}
|
|
@@ -489,10 +502,9 @@ export function RunningFor({ startedAt }: { startedAt: number }) {
|
|
|
489
502
|
return <span ref={ref} className="shrink-0 text-xs text-text-faint tabular-nums" />;
|
|
490
503
|
}
|
|
491
504
|
|
|
492
|
-
/* The mark of one call: the look
|
|
493
|
-
function callIcon(tool: ChatToolItem, commandLooks: readonly CommandLook[] | undefined): ReactNode {
|
|
494
|
-
const
|
|
495
|
-
const run = shell === null ? null : matchCommandLook(shell, commandLooks);
|
|
505
|
+
/* The mark of one call: the look it runs under, else what the tool is about. */
|
|
506
|
+
function callIcon(tool: ChatToolItem, commandLooks: readonly CommandLook[] | undefined, toolLooks: readonly ToolLook[] | undefined): ReactNode {
|
|
507
|
+
const run = lookRunOf(tool, commandLooks, toolLooks);
|
|
496
508
|
|
|
497
509
|
return run === null ? toolIcon(tool.name) : <run.look.Mark size={12} />;
|
|
498
510
|
}
|
|
@@ -504,9 +516,8 @@ export function WorkLiveRow({ chatId, tool: derived }: { chatId: string; tool: C
|
|
|
504
516
|
const tail = liveOutput(tool);
|
|
505
517
|
const summary = toolSummary(tool.name, tool.input);
|
|
506
518
|
const opens = hasToolBody(tool);
|
|
507
|
-
const
|
|
508
|
-
const
|
|
509
|
-
const run = shell === null ? null : matchCommandLook(shell, commandLooks);
|
|
519
|
+
const { commandLooks, toolLooks } = useChatHost();
|
|
520
|
+
const run = lookRunOf(tool, commandLooks, toolLooks);
|
|
510
521
|
const awaiting = useAwaitsApproval(chatId, tool.toolUseId);
|
|
511
522
|
const { t } = useTranslation('agent-chat');
|
|
512
523
|
|
|
@@ -514,7 +525,7 @@ export function WorkLiveRow({ chatId, tool: derived }: { chatId: string; tool: C
|
|
|
514
525
|
<div>
|
|
515
526
|
<ToggleLine
|
|
516
527
|
icon={run === null ? toolIcon(tool.name) : <run.look.Mark size={12} />}
|
|
517
|
-
label={run === null ? tool.name : run.
|
|
528
|
+
label={run === null ? tool.name : run.label}
|
|
518
529
|
brand={run?.look.brand}
|
|
519
530
|
look={run === null ? undefined : { run, chatId }}
|
|
520
531
|
detail={summary || tool.progress?.description || ''}
|
|
@@ -551,28 +562,30 @@ export function WorkGroupRow({
|
|
|
551
562
|
}: {
|
|
552
563
|
tools: ChatToolItem[];
|
|
553
564
|
summary: string;
|
|
554
|
-
look?:
|
|
565
|
+
look?: Look;
|
|
555
566
|
expanded: boolean;
|
|
556
567
|
onToggle(): void;
|
|
557
568
|
}) {
|
|
558
569
|
const { t } = useTranslation('agent-chat');
|
|
559
|
-
const { commandLooks } = useChatHost();
|
|
570
|
+
const { commandLooks, toolLooks } = useChatHost();
|
|
560
571
|
const running = tools.filter((tool) => tool.state === 'running').length;
|
|
561
|
-
const failed = tools.
|
|
572
|
+
const failed = tools.filter((tool) => tool.state === 'error').length;
|
|
562
573
|
const latest = tools.findLast((tool) => tool.state === 'running');
|
|
563
574
|
|
|
564
575
|
return (
|
|
565
576
|
<div>
|
|
566
577
|
<ToggleLine
|
|
567
|
-
icon={
|
|
578
|
+
icon={
|
|
579
|
+
latest !== undefined ? callIcon(latest, commandLooks, toolLooks) : look === undefined ? toolIcon(tools[0]!.name) : <look.Mark size={12} />
|
|
580
|
+
}
|
|
568
581
|
label={
|
|
569
582
|
<span className="tabular-nums">
|
|
570
583
|
{running > 0 ? t('group.toolCalls', { count: tools.length }) : look?.brand === undefined ? summary : withBrand(summary, [look.brand])}
|
|
584
|
+
{failed > 0 && <span className="text-status-error">{` · ${t('group.failed', { count: failed })}`}</span>}
|
|
571
585
|
</span>
|
|
572
586
|
}
|
|
573
587
|
open={expanded}
|
|
574
588
|
onToggle={onToggle}
|
|
575
|
-
failed={failed}
|
|
576
589
|
live={latest !== undefined}
|
|
577
590
|
trailing={running > 0 && <span className="shrink-0 text-text-faint tabular-nums">{t('group.running', { count: running })}</span>}
|
|
578
591
|
time={tools[0]!.createdAt}
|
|
@@ -601,8 +614,8 @@ export function TurnFoldRow({
|
|
|
601
614
|
expandable: boolean;
|
|
602
615
|
onToggle(): void;
|
|
603
616
|
}) {
|
|
604
|
-
const { commandLooks } = useChatHost();
|
|
605
|
-
const brands = commandLooks
|
|
617
|
+
const { commandLooks = [], toolLooks = [] } = useChatHost();
|
|
618
|
+
const brands = [...commandLooks, ...toolLooks].flatMap(({ brand }) => (brand === undefined ? [] : [brand]));
|
|
606
619
|
const className = clsx(
|
|
607
620
|
'group group/line -mx-1 mb-2 flex h-7 w-[calc(100%+8px)] min-w-0 items-center gap-2 rounded-md px-1 text-left text-xs text-text-muted',
|
|
608
621
|
expandable && 'hover:bg-surface-hover',
|
|
@@ -906,13 +919,13 @@ function ProviderChangedFiles({
|
|
|
906
919
|
/* "Working for 00:14", under the mark of the call running last; between calls, a spinner. */
|
|
907
920
|
export function WorkingRow({ startedAt, tool }: { startedAt: number; tool?: ChatToolItem }) {
|
|
908
921
|
const { t } = useTranslation('agent-chat');
|
|
909
|
-
const { commandLooks } = useChatHost();
|
|
922
|
+
const { commandLooks, toolLooks } = useChatHost();
|
|
910
923
|
const ref = useTickingText(() => formatClockDuration(Date.now() - startedAt));
|
|
911
924
|
|
|
912
925
|
return (
|
|
913
926
|
<div className="-mx-1 mb-0.5 flex h-7 items-center gap-2 px-1 text-xs text-text-muted">
|
|
914
927
|
<span className={clsx(ROW_GUTTER, tool === undefined ? 'text-status-running' : 'text-accent')}>
|
|
915
|
-
{tool === undefined ? <Spinner size={12} /> : callIcon(tool, commandLooks)}
|
|
928
|
+
{tool === undefined ? <Spinner size={12} /> : callIcon(tool, commandLooks, toolLooks)}
|
|
916
929
|
</span>
|
|
917
930
|
<span className="chat-live-text">{t('work.workingFor')}</span>
|
|
918
931
|
<span ref={ref} className="tabular-nums" />
|
|
@@ -10,18 +10,21 @@ export const FOLLOW_THRESHOLD_PX = 40;
|
|
|
10
10
|
* card, which have no margin of their own, and each end of a run of sent messages, which sit as tight as
|
|
11
11
|
* work lines so a fan-out reads as one stretch. A question and the answer after it never take a seam.
|
|
12
12
|
*/
|
|
13
|
-
/*
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
/*
|
|
14
|
+
* A person's message, or one another node sent: both are said to the chat and drawn the same way. So is a note
|
|
15
|
+
* the host said, where `hostSpeaks` says the host draws it as a message (`ChatHost.saidBy`).
|
|
16
|
+
*/
|
|
17
|
+
export function saidToChat(row: TimelineRow, hostSpeaks = false): boolean {
|
|
18
|
+
return row.kind === 'user' || row.kind === 'message' || (hostSpeaks && row.kind === 'note' && row.said === true);
|
|
16
19
|
}
|
|
17
20
|
|
|
18
|
-
export function rowRhythm(row: TimelineRow, previous: TimelineRow | null): string {
|
|
19
|
-
const question = saidToChat(row);
|
|
21
|
+
export function rowRhythm(row: TimelineRow, previous: TimelineRow | null, hostSpeaks = false): string {
|
|
22
|
+
const question = saidToChat(row, hostSpeaks);
|
|
20
23
|
const bare = previous?.kind === 'visual' || previous?.kind === 'app-card';
|
|
21
24
|
const seam =
|
|
22
25
|
!question &&
|
|
23
26
|
previous !== null &&
|
|
24
|
-
!saidToChat(previous) &&
|
|
27
|
+
!saidToChat(previous, hostSpeaks) &&
|
|
25
28
|
(isBlock(row) !== isBlock(previous) || bare || (row.kind === 'sent') !== (previous.kind === 'sent'));
|
|
26
29
|
|
|
27
30
|
return clsx(question && 'pb-(--chat-answer-gap)', seam && 'pt-(--chat-block-gap)');
|
|
@@ -41,7 +41,11 @@ export function threadReferencedKey(structure: Record<string, ChatItem> | undefi
|
|
|
41
41
|
|
|
42
42
|
/* What the views, nodes and chats of a thread stand for now, and how one opens, for the rows that draw chips. */
|
|
43
43
|
export function useReferenceLookup(chatId: string): ReferenceLookup {
|
|
44
|
-
|
|
44
|
+
return useReferenceLookupIn(useChatScope().id, chatId);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* The same for a row that may stand outside a scope. */
|
|
48
|
+
export function useReferenceLookupIn(scopeId: string, chatId: string): ReferenceLookup {
|
|
45
49
|
const { openReference } = useChatHost();
|
|
46
50
|
const referables = useHostReferables(scopeId, chatId);
|
|
47
51
|
const key = useChatRow(chatId, (chat) => threadReferencedKey(chat?.structure));
|
package/src/host.ts
CHANGED
|
@@ -262,6 +262,11 @@ export interface CommandName {
|
|
|
262
262
|
name: string;
|
|
263
263
|
/* Drawn before the name, at the size of the detail. */
|
|
264
264
|
icon?: ReactNode;
|
|
265
|
+
/*
|
|
266
|
+
* The id of the view, node or chat the word stands for, drawn as the `#` chip a message draws for it and
|
|
267
|
+
* opened as that chip opens; `name` is then what the chip says once what it stood for is gone.
|
|
268
|
+
*/
|
|
269
|
+
reference?: string;
|
|
265
270
|
}
|
|
266
271
|
|
|
267
272
|
/* What one run of a program is about, as its look reads it from the words. */
|
|
@@ -327,6 +332,50 @@ export interface CommandLook {
|
|
|
327
332
|
sent?(call: CommandLookCall): CommandLookSent | null;
|
|
328
333
|
}
|
|
329
334
|
|
|
335
|
+
/* What one call of a look's MCP server is about, as its look reads it from the tool and its input. */
|
|
336
|
+
export interface ToolLookMatch {
|
|
337
|
+
/* Drawn where the tool name is, after the brand; empty draws the brand alone. */
|
|
338
|
+
label: string;
|
|
339
|
+
/* Words before the input, such as what the tool does. */
|
|
340
|
+
lead?: string;
|
|
341
|
+
/* The fields of the input drawn after the lead as `field=value`, in this order; left out, every field in the input's own order. */
|
|
342
|
+
fields?: readonly string[];
|
|
343
|
+
/* Calls with the same key read as one sentence in a group or a folded turn. */
|
|
344
|
+
group?: { key: string; sentence(count: number): string };
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/* A call of a look's MCP server that may be a message, as `ToolLook.sent` gets it. */
|
|
348
|
+
export interface ToolLookCall {
|
|
349
|
+
/* The tool's name on its server, without the server. */
|
|
350
|
+
readonly tool: string;
|
|
351
|
+
readonly input: Readonly<Record<string, unknown>>;
|
|
352
|
+
readonly state: 'running' | 'done' | 'error';
|
|
353
|
+
/* What the tool answered, out of any envelope the CLI wraps it in. */
|
|
354
|
+
readonly output: string | null;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/*
|
|
358
|
+
* An MCP server the app recognizes in a thread and draws as a tool of its own. A call of one of its tools
|
|
359
|
+
* matches whichever shape the CLI gives it: `mcp__<server>__<tool>`, `<server>/<tool>`, or a generic ACP
|
|
360
|
+
* call titled `<server>__<tool>`, `<server>_<tool>` or `<server>-<tool>` (`mcpCallOf`).
|
|
361
|
+
*/
|
|
362
|
+
export interface ToolLook {
|
|
363
|
+
/* The server's name, as the app registers it with the CLIs. */
|
|
364
|
+
server: string;
|
|
365
|
+
/* Drawn in semibold before every label of this look, such as a product name. */
|
|
366
|
+
brand?: string;
|
|
367
|
+
/* The mark in the gutter, drawn in `currentColor` at the size of a tool icon. */
|
|
368
|
+
Mark: ComponentType<{ size: number }>;
|
|
369
|
+
/* What one call is about, from the tool's name on its server and its input; null leaves it the CLI's own tool line. */
|
|
370
|
+
describe(tool: string, input: Readonly<Record<string, unknown>>): ToolLookMatch | null;
|
|
371
|
+
/* Calls of this look under different group keys, as one sentence; left out, such a run reads as tool calls. */
|
|
372
|
+
sentence?(count: number): string;
|
|
373
|
+
/* Names for values in the detail, as `CommandLook.useNames` names words; `option` is the field the value is of. */
|
|
374
|
+
useNames?(scopeId: string, chatId: string): (word: string, option: string | null) => CommandName | null;
|
|
375
|
+
/* The message a call sent; null leaves it a tool line. Asked again as the call goes on. */
|
|
376
|
+
sent?(call: ToolLookCall): CommandLookSent | null;
|
|
377
|
+
}
|
|
378
|
+
|
|
330
379
|
/*
|
|
331
380
|
* Where the tiles of a Map come from. The host owns the service and whatever admits a request to it, so
|
|
332
381
|
* a chat never knows an address, a key or a vendor: it asks for the style of the theme and lets the host
|
|
@@ -575,6 +624,8 @@ export interface ChatHost {
|
|
|
575
624
|
visuals: VisualHost | null;
|
|
576
625
|
/* Programs drawn as tools of their own; left out, every shell call reads as itself. */
|
|
577
626
|
commandLooks?: readonly CommandLook[];
|
|
627
|
+
/* MCP servers whose tools are drawn as tools of their own; left out, every MCP call reads as the CLI names it. */
|
|
628
|
+
toolLooks?: readonly ToolLook[];
|
|
578
629
|
}
|
|
579
630
|
|
|
580
631
|
const NO_PROMPTS: readonly HostPrompt[] = [];
|
package/src/index.ts
CHANGED
|
@@ -213,6 +213,7 @@ export default {
|
|
|
213
213
|
loadingDiff: 'Loading diff',
|
|
214
214
|
diffUnavailable: 'Could not load this diff',
|
|
215
215
|
runningFor: 'running for {{elapsed}}',
|
|
216
|
+
failed: 'Failed',
|
|
216
217
|
awaitingApproval: 'waiting for you',
|
|
217
218
|
forksAfter_one: 'Forked after this turn',
|
|
218
219
|
forksAfter_other: '{{count}} forks after this turn',
|
|
@@ -273,6 +274,8 @@ export default {
|
|
|
273
274
|
group: {
|
|
274
275
|
running_one: '{{count}} running',
|
|
275
276
|
running_other: '{{count}} running',
|
|
277
|
+
failed_one: '{{count}} failed',
|
|
278
|
+
failed_other: '{{count}} failed',
|
|
276
279
|
tools: {
|
|
277
280
|
Read_one: 'Read {{count}} file',
|
|
278
281
|
Read_other: 'Read {{count}} files',
|
|
@@ -317,6 +320,7 @@ export default {
|
|
|
317
320
|
wokenByMessage_one: 'Woken by a message',
|
|
318
321
|
wokenByMessage_other: 'Woken by {{count}} messages',
|
|
319
322
|
subagentFinished: 'Sub-agent finished: {{label}}',
|
|
323
|
+
backgroundFinished: 'Background task finished: {{label}}',
|
|
320
324
|
continued: 'Continued on its own',
|
|
321
325
|
stopped: 'Stopped after {{duration}}',
|
|
322
326
|
youStopped: 'You stopped after {{duration}}',
|
|
@@ -213,6 +213,7 @@ export default {
|
|
|
213
213
|
loadingDiff: 'Diff laden',
|
|
214
214
|
diffUnavailable: 'Kon deze diff niet laden',
|
|
215
215
|
runningFor: 'loopt al {{elapsed}}',
|
|
216
|
+
failed: 'Mislukt',
|
|
216
217
|
awaitingApproval: 'wacht op jou',
|
|
217
218
|
forksAfter_one: 'Fork na deze turn',
|
|
218
219
|
forksAfter_other: '{{count}} forks na deze turn',
|
|
@@ -273,6 +274,8 @@ export default {
|
|
|
273
274
|
group: {
|
|
274
275
|
running_one: '{{count}} actief',
|
|
275
276
|
running_other: '{{count}} actief',
|
|
277
|
+
failed_one: '{{count}} mislukt',
|
|
278
|
+
failed_other: '{{count}} mislukt',
|
|
276
279
|
tools: {
|
|
277
280
|
Read_one: '{{count}} bestand gelezen',
|
|
278
281
|
Read_other: '{{count}} bestanden gelezen',
|
|
@@ -317,6 +320,7 @@ export default {
|
|
|
317
320
|
wokenByMessage_one: 'Gewekt door een bericht',
|
|
318
321
|
wokenByMessage_other: 'Gewekt door {{count}} berichten',
|
|
319
322
|
subagentFinished: 'Sub-agent klaar: {{label}}',
|
|
323
|
+
backgroundFinished: 'Achtergrondtaak klaar: {{label}}',
|
|
320
324
|
continued: 'Zelf verdergegaan',
|
|
321
325
|
stopped: 'Gestopt na {{duration}}',
|
|
322
326
|
youStopped: 'Jij stopte na {{duration}}',
|