@adecore/agents-react 0.65.2 → 0.66.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/chat/activity.d.ts +5 -2
- package/dist/chat/activity.js +13 -2
- package/dist/chat/logic/bookmarks.d.ts +3 -2
- package/dist/chat/logic/continue-after-stop.d.ts +2 -2
- package/dist/chat/logic/fork.d.ts +7 -6
- package/dist/chat/logic/goal.d.ts +8 -3
- package/dist/chat/logic/goal.js +7 -1
- package/dist/chat/logic/handback.d.ts +2 -2
- package/dist/chat/logic/limit.d.ts +2 -2
- package/dist/chat/logic/limit.js +8 -0
- package/dist/chat/logic/resume-compaction.d.ts +4 -3
- package/dist/chat/logic/scrubber.d.ts +3 -2
- package/dist/chat/logic/timeline-target.d.ts +4 -3
- package/dist/chat/logic/timeline.d.ts +5 -4
- package/dist/chat/logic/timeline.js +9 -0
- package/dist/chat/recent-messages.d.ts +3 -3
- package/dist/chat/runtime-modes.d.ts +2 -1
- package/dist/chat/runtime-modes.js +5 -1
- package/dist/chat/subagent-conversation.d.ts +5 -4
- package/dist/chat/subagent-conversation.js +3 -2
- package/dist/chat/subagent-list.d.ts +4 -3
- package/dist/chat/subagent-view.d.ts +4 -3
- package/dist/chat/ui/ChatActivity.js +19 -15
- package/dist/chat/ui/Composer.d.ts +3 -2
- package/dist/chat/ui/GoalDock.d.ts +3 -2
- package/dist/chat/ui/GoalDock.js +19 -28
- package/dist/chat/ui/LimitState.d.ts +2 -2
- package/dist/chat/ui/RunSettings.d.ts +3 -2
- package/dist/chat/ui/RunSettings.js +318 -298
- package/dist/chat/ui/composer/ComposerControls.d.ts +2 -2
- package/dist/chat/ui/composer/use-chat-controls.d.ts +3 -2
- package/dist/chat/ui/composer/use-compaction-offer.d.ts +3 -2
- package/dist/chat/ui/composer/use-composer-menus.d.ts +3 -2
- package/dist/chat/ui/composer/use-continuable-turn.d.ts +2 -2
- package/dist/chat/ui/composer/use-effort-stepper.d.ts +3 -2
- package/dist/chat/ui/reply-context.d.ts +2 -2
- package/dist/chat/ui/rows/MessageRows.d.ts +4 -0
- package/dist/chat/ui/rows/MessageRows.js +61 -1
- package/dist/chat/ui/rows/Rows.js +42 -26
- package/dist/chat/ui/rows/SubagentRow.d.ts +3 -2
- package/dist/chat/ui/rows/WorkRows.d.ts +3 -2
- package/dist/chat/waiting-on.d.ts +5 -4
- package/dist/chat/waiting-on.js +2 -1
- package/dist/chat/workflow-list.d.ts +3 -2
- package/dist/chat-client.d.ts +2 -1
- package/dist/chat-sink.d.ts +16 -9
- package/dist/host/host-hooks.d.ts +2 -1
- package/dist/host/host-hooks.js +5 -0
- package/dist/host/host.d.ts +8 -2
- package/dist/host/timeline-row.d.ts +10 -4
- package/dist/index.d.ts +2 -2
- package/dist/locales/en/agent-chat.d.ts +16 -0
- package/dist/locales/en/agent-chat.js +17 -1
- package/dist/locales/nl/agent-chat.d.ts +16 -0
- package/dist/locales/nl/agent-chat.js +17 -1
- package/dist/port-transport.d.ts +10 -1
- package/dist/port-transport.js +14 -3
- package/dist/state/chats.d.ts +17 -15
- package/dist/state/chats.js +7 -0
- package/dist/state/index.d.ts +1 -1
- package/dist/state/usage.d.ts +3 -2
- package/dist/state/usage.js +34 -3
- package/dist/transport.d.ts +3 -2
- package/package.json +9 -9
- package/src/chat/activity.ts +19 -6
- package/src/chat/forks.ts +3 -3
- package/src/chat/logic/bookmarks.ts +3 -2
- package/src/chat/logic/continue-after-stop.ts +3 -2
- package/src/chat/logic/fork.ts +8 -7
- package/src/chat/logic/goal.ts +13 -4
- package/src/chat/logic/handback.ts +2 -3
- package/src/chat/logic/limit.ts +7 -2
- package/src/chat/logic/resume-compaction.ts +7 -6
- package/src/chat/logic/scrubber.ts +4 -3
- package/src/chat/logic/timeline-target.ts +4 -3
- package/src/chat/logic/timeline.ts +22 -16
- package/src/chat/pending-prompts.ts +3 -2
- package/src/chat/recent-messages.ts +5 -6
- package/src/chat/runtime-modes.ts +7 -2
- package/src/chat/subagent-conversation.ts +12 -9
- package/src/chat/subagent-list.ts +4 -3
- package/src/chat/subagent-view.ts +4 -3
- package/src/chat/ui/ChatActivity.tsx +11 -7
- package/src/chat/ui/Composer.tsx +3 -2
- package/src/chat/ui/GoalDock.tsx +6 -5
- package/src/chat/ui/LimitState.tsx +5 -5
- package/src/chat/ui/RunSettings.tsx +17 -9
- package/src/chat/ui/composer/ComposerControls.tsx +3 -2
- package/src/chat/ui/composer/use-chat-controls.ts +3 -2
- package/src/chat/ui/composer/use-compaction-offer.ts +4 -3
- package/src/chat/ui/composer/use-composer-menus.ts +3 -2
- package/src/chat/ui/composer/use-continuable-turn.ts +3 -3
- package/src/chat/ui/composer/use-effort-stepper.ts +3 -2
- package/src/chat/ui/reply-context.ts +2 -2
- package/src/chat/ui/rows/MessageRows.tsx +17 -1
- package/src/chat/ui/rows/Rows.tsx +3 -0
- package/src/chat/ui/rows/SubagentRow.tsx +5 -4
- package/src/chat/ui/rows/WorkRows.tsx +3 -2
- package/src/chat/ui/thread-references.ts +3 -3
- package/src/chat/waiting-on.ts +8 -7
- package/src/chat/workflow-list.ts +3 -2
- package/src/chat-client.ts +3 -2
- package/src/chat-sink.ts +21 -9
- package/src/host/host-hooks.ts +9 -1
- package/src/host/host.ts +13 -2
- package/src/host/timeline-row.ts +7 -5
- package/src/index.ts +2 -1
- package/src/locales/en/agent-chat.ts +17 -1
- package/src/locales/nl/agent-chat.ts +17 -1
- package/src/port-transport.ts +20 -3
- package/src/state/chats.ts +34 -35
- package/src/state/index.ts +1 -1
- package/src/state/usage.ts +45 -5
- package/src/transport.ts +4 -2
package/dist/chat/activity.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export
|
|
1
|
+
import type { ChatThreadInfo } from '../chat-sink.js';
|
|
2
|
+
export type ChatThreadBackgroundTask = NonNullable<ChatThreadInfo['background']>[number];
|
|
3
|
+
export declare function backgroundTaskName(task: ChatThreadBackgroundTask): string;
|
|
4
|
+
export declare function backgroundCounts(tasks: readonly ChatThreadBackgroundTask[]): {
|
|
3
5
|
shells: number;
|
|
4
6
|
monitors: number;
|
|
7
|
+
others: number;
|
|
5
8
|
};
|
package/dist/chat/activity.js
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
|
+
import i18next from 'i18next';
|
|
2
|
+
/* What a person reads for a task: what it does, else the command, else its kind. */
|
|
3
|
+
export function backgroundTaskName(task) {
|
|
4
|
+
if (task.description || task.command) {
|
|
5
|
+
return task.description || task.command || '';
|
|
6
|
+
}
|
|
7
|
+
return task.kind === 'shell' || task.kind === 'monitor' ? i18next.t(`agent-chat:activity.${task.kind}`) : i18next.t('agent-chat:activity.other');
|
|
8
|
+
}
|
|
1
9
|
export function backgroundCounts(tasks) {
|
|
10
|
+
const shells = tasks.filter(task => task.kind === 'shell').length;
|
|
11
|
+
const monitors = tasks.filter(task => task.kind === 'monitor').length;
|
|
2
12
|
return {
|
|
3
|
-
shells
|
|
4
|
-
monitors
|
|
13
|
+
shells,
|
|
14
|
+
monitors,
|
|
15
|
+
others: tasks.length - shells - monitors
|
|
5
16
|
};
|
|
6
17
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { ChatBookmark
|
|
1
|
+
import type { ChatBookmark } from '@adecore/agent-contracts';
|
|
2
|
+
import type { ChatThreadItem } from '../../chat-sink.js';
|
|
2
3
|
import type { TimelineRow } from '../../host/timeline-row.js';
|
|
3
4
|
export declare function bookmarkLabel(bookmark: ChatBookmark): string;
|
|
4
5
|
export declare function bookmarksInThreadOrder(bookmarks: readonly ChatBookmark[], order: readonly string[]): ChatBookmark[];
|
|
5
|
-
export declare function bookmarkRows(rows: readonly TimelineRow[], bookmarks: readonly ChatBookmark[], items: Readonly<Record<string,
|
|
6
|
+
export declare function bookmarkRows(rows: readonly TimelineRow[], bookmarks: readonly ChatBookmark[], items: Readonly<Record<string, ChatThreadItem>>): Map<string, ChatBookmark>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ChatThreadInfo, ChatThreadItem } from '../../chat-sink.js';
|
|
2
2
|
export declare const CONTINUE_PROMPT = "Continue.";
|
|
3
|
-
export declare function continuableTurn(info:
|
|
3
|
+
export declare function continuableTurn(info: ChatThreadInfo, items: readonly ChatThreadItem[]): string | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { AgentKind, ChatForkPayload,
|
|
1
|
+
import type { AgentKind, ChatForkPayload, ModelSelection, ProviderInfo } from '@adecore/agent-contracts';
|
|
2
|
+
import type { ChatThreadInfo, ChatThreadItem } from '../../chat-sink.js';
|
|
2
3
|
import type { TimelineRow } from '../../host/timeline-row.js';
|
|
3
4
|
interface HostProviders {
|
|
4
5
|
readonly providers: readonly ProviderInfo[];
|
|
@@ -13,15 +14,15 @@ interface ForkPoint {
|
|
|
13
14
|
last: boolean;
|
|
14
15
|
prompt: string | null;
|
|
15
16
|
}
|
|
16
|
-
export declare function forkRefusal(info:
|
|
17
|
+
export declare function forkRefusal(info: ChatThreadInfo | null, turn: ChatThreadItem | undefined, host: HostProviders): string | null;
|
|
17
18
|
export declare function summaryRefusal(state: {
|
|
18
19
|
busy: boolean;
|
|
19
20
|
originalPresent: boolean;
|
|
20
21
|
}): string | null;
|
|
21
|
-
export declare function forkIdsAfter(infos: Iterable<
|
|
22
|
-
export declare function forkedTurnIds(infos: Iterable<
|
|
23
|
-
export declare function lastSettledTurn(items: Record<string,
|
|
24
|
-
export declare function forkPointOf(items: Record<string,
|
|
22
|
+
export declare function forkIdsAfter(infos: Iterable<ChatThreadInfo>, chatId: string, turnId: string): string[];
|
|
23
|
+
export declare function forkedTurnIds(infos: Iterable<ChatThreadInfo>, chatId: string): Set<string>;
|
|
24
|
+
export declare function lastSettledTurn(items: Record<string, ChatThreadItem>, order: readonly string[]): string | null;
|
|
25
|
+
export declare function forkPointOf(items: Record<string, ChatThreadItem>, order: readonly string[], turnId: string, whole: boolean): ForkPoint | null;
|
|
25
26
|
export declare function forkPointLabel(point: ForkPoint, maxPrompt?: number): string;
|
|
26
27
|
export declare function turnIdOfRow(row: TimelineRow): string | null;
|
|
27
28
|
export type ForkShape = 'node' | 'view';
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ChatGoalAction, type ChatGoalStatus, type ProviderCapabilities } from '@adecore/agent-contracts';
|
|
2
|
+
import type { ChatThreadInfo } from '../../chat-sink.js';
|
|
3
|
+
type Goal = NonNullable<ChatThreadInfo['goal']>;
|
|
4
|
+
export declare function knownGoalStatus(goal: Goal): goal is Goal & {
|
|
5
|
+
status: ChatGoalStatus;
|
|
6
|
+
};
|
|
2
7
|
interface GoalView {
|
|
3
|
-
goal:
|
|
8
|
+
goal: Goal;
|
|
4
9
|
actions: ChatGoalAction[];
|
|
5
10
|
}
|
|
6
|
-
export declare function goalView(info: Pick<
|
|
11
|
+
export declare function goalView(info: Pick<ChatThreadInfo, 'goal' | 'activeTurnId'>, goals: ProviderCapabilities['goals'], canAct: boolean): GoalView | null;
|
|
7
12
|
export {};
|
package/dist/chat/logic/goal.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { ChatGoalStatusSchema } from '@adecore/agent-contracts';
|
|
2
|
+
/* Whether this version knows the goal's state, so it can word it and say what may be done to it. */
|
|
3
|
+
export function knownGoalStatus(goal) {
|
|
4
|
+
return ChatGoalStatusSchema.options.includes(goal.status);
|
|
5
|
+
}
|
|
1
6
|
/*
|
|
2
7
|
* The row above the composer while the chat has a goal. A CLI with calls for goals pauses, resumes and
|
|
3
8
|
* clears it at any time; one that only reads `/goal` clears it with a turn of its own, so only between
|
|
@@ -21,9 +26,10 @@ export function goalView(info, goals, canAct) {
|
|
|
21
26
|
};
|
|
22
27
|
}
|
|
23
28
|
const actions = [];
|
|
29
|
+
// A state of a newer host may mean either, so only a clear is offered for it.
|
|
24
30
|
if (goal.status === 'active') {
|
|
25
31
|
actions.push('pause');
|
|
26
|
-
} else if (goal.status !== 'complete') {
|
|
32
|
+
} else if (knownGoalStatus(goal) && goal.status !== 'complete') {
|
|
27
33
|
actions.push('resume');
|
|
28
34
|
}
|
|
29
35
|
actions.push('clear');
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export declare function handbackReportOf(item: ChatThreadItem): string | null;
|
|
2
|
+
import type { ChatThreadItem } from '../../chat-sink.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChatThreadInfo } from '../../chat-sink.js';
|
|
2
2
|
interface LimitView {
|
|
3
3
|
pill: string;
|
|
4
4
|
title: string;
|
|
5
5
|
detail: string | null;
|
|
6
6
|
}
|
|
7
|
-
export declare function limitView(info: Pick<
|
|
7
|
+
export declare function limitView(info: Pick<ChatThreadInfo, 'limit' | 'resumeAt' | 'activeTurnId'>, now: number): LimitView | null;
|
|
8
8
|
export {};
|
package/dist/chat/logic/limit.js
CHANGED
|
@@ -21,6 +21,14 @@ export function limitView(info, now) {
|
|
|
21
21
|
})
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
+
// A kind of a newer host says only that the turn stopped, never which limit it was.
|
|
25
|
+
if (limit.kind !== 'usage') {
|
|
26
|
+
return {
|
|
27
|
+
pill: i18next.t('agent-chat:limit.other.pill'),
|
|
28
|
+
title: i18next.t('agent-chat:limit.other.title'),
|
|
29
|
+
detail: null
|
|
30
|
+
};
|
|
31
|
+
}
|
|
24
32
|
const title = i18next.t('agent-chat:limit.usage.title');
|
|
25
33
|
if (resumes !== null) {
|
|
26
34
|
return {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ProviderCapabilities } from '@adecore/agent-contracts';
|
|
2
|
+
import type { ChatThreadInfo, ChatThreadItem } from '../../chat-sink.js';
|
|
2
3
|
export declare const RESUME_COMPACTION_TOKENS = 100000;
|
|
3
4
|
export declare const RESUME_COMPACTION_IDLE_MS: number;
|
|
4
5
|
export type ResumeCompactionReason = 'cache-expired' | 'idle';
|
|
@@ -8,9 +9,9 @@ export interface ResumeCompactionOffer {
|
|
|
8
9
|
reason: ResumeCompactionReason;
|
|
9
10
|
}
|
|
10
11
|
interface OfferInput {
|
|
11
|
-
info:
|
|
12
|
+
info: ChatThreadInfo;
|
|
12
13
|
compaction: ProviderCapabilities['compaction'] | undefined;
|
|
13
|
-
items: readonly
|
|
14
|
+
items: readonly ChatThreadItem[];
|
|
14
15
|
dismissedTurnId: string | null;
|
|
15
16
|
}
|
|
16
17
|
export declare function resumeCompactionDueAt(input: OfferInput): number | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { ChatBookmark
|
|
1
|
+
import type { ChatBookmark } from '@adecore/agent-contracts';
|
|
2
|
+
import type { ChatThreadItem } from '../../chat-sink.js';
|
|
2
3
|
import { type TimelineRow } from '../../host/timeline-row.js';
|
|
3
4
|
export type TickKind = 'person' | 'wake' | 'bookmark';
|
|
4
5
|
export interface ScrubberTick {
|
|
@@ -16,7 +17,7 @@ export declare const STRIP_WIDTH_PX = 24;
|
|
|
16
17
|
export declare const STRIP_INSET_PX = 8;
|
|
17
18
|
export declare const STRIP_CLEARANCE_PX: number;
|
|
18
19
|
export declare const EARLIER_ROW = -1;
|
|
19
|
-
export declare function ticksOf(rows: readonly TimelineRow[], marks?: ReadonlyMap<string, ChatBookmark>, earlier?: readonly
|
|
20
|
+
export declare function ticksOf(rows: readonly TimelineRow[], marks?: ReadonlyMap<string, ChatBookmark>, earlier?: readonly ChatThreadItem[], bookmarks?: readonly ChatBookmark[]): ScrubberTick[];
|
|
20
21
|
interface TickSlot {
|
|
21
22
|
first: number;
|
|
22
23
|
last: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChatUiChoiceOrigin } from '@adecore/agent-contracts';
|
|
2
|
+
import type { ChatThreadItem } from '../../chat-sink.js';
|
|
2
3
|
import type { FileRef } from '../../host/host.js';
|
|
3
4
|
import type { TimelineRow } from '../../host/timeline-row.js';
|
|
4
5
|
export interface TimelineTarget {
|
|
@@ -14,7 +15,7 @@ export interface TimelineTarget {
|
|
|
14
15
|
} | null;
|
|
15
16
|
}
|
|
16
17
|
export declare const EMPTY_TARGET: TimelineTarget;
|
|
17
|
-
export declare function withCurrentText(rows: TimelineRow[], items: Record<string,
|
|
18
|
+
export declare function withCurrentText(rows: TimelineRow[], items: Record<string, ChatThreadItem> | undefined): TimelineRow[];
|
|
18
19
|
export declare function readTimelineTarget(element: HTMLElement, scroller: HTMLElement | null, rows: TimelineRow[]): TimelineTarget;
|
|
19
20
|
export type UiReplyTarget = Pick<ChatUiChoiceOrigin, 'itemId' | 'blockId' | 'revision'>;
|
|
20
21
|
type UiReplyJump = {
|
|
@@ -26,6 +27,6 @@ type UiReplyJump = {
|
|
|
26
27
|
kind: 'row';
|
|
27
28
|
index: number;
|
|
28
29
|
};
|
|
29
|
-
export declare function uiReplyJump(target: UiReplyTarget, rows: readonly TimelineRow[], items: Record<string,
|
|
30
|
+
export declare function uiReplyJump(target: UiReplyTarget, rows: readonly TimelineRow[], items: Record<string, ChatThreadItem> | undefined, expandedTurns: ReadonlySet<string>, hasEarlier: boolean): UiReplyJump;
|
|
30
31
|
export declare function revealUiReplyBlock(scroller: HTMLElement, target: UiReplyTarget): boolean;
|
|
31
32
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChatToolItem } from '@adecore/agent-contracts';
|
|
2
|
+
import type { ChatThreadItem, ChatThreadTurn } from '../../chat-sink.js';
|
|
2
3
|
import type { CommandLook, ToolLook } from '../../host/host.js';
|
|
3
4
|
import type { SubagentBranch, TimelineRow } from '../../host/timeline-row.js';
|
|
4
5
|
interface TimelineOptions {
|
|
@@ -14,11 +15,11 @@ interface TimelineOptions {
|
|
|
14
15
|
export declare function isBlock(row: TimelineRow): boolean;
|
|
15
16
|
export declare function summarizeGroup(tools: ChatToolItem[], looks?: readonly CommandLook[], toolLooks?: readonly ToolLook[]): string;
|
|
16
17
|
export declare function summarizeTurn(tools: readonly ChatToolItem[], looks?: readonly CommandLook[], toolLooks?: readonly ToolLook[]): string[];
|
|
17
|
-
export declare function agentTurnLabel(turn:
|
|
18
|
-
export declare function turnLabel(turn:
|
|
18
|
+
export declare function agentTurnLabel(turn: ChatThreadTurn): string;
|
|
19
|
+
export declare function turnLabel(turn: ChatThreadTurn, items?: readonly ChatThreadItem[]): string;
|
|
19
20
|
export declare function findSubagentBranch(rows: readonly TimelineRow[], toolUseId: string): {
|
|
20
21
|
index: number;
|
|
21
22
|
branch: SubagentBranch;
|
|
22
23
|
} | null;
|
|
23
|
-
export declare function deriveTimelineRows(items:
|
|
24
|
+
export declare function deriveTimelineRows(items: ChatThreadItem[], options: TimelineOptions): TimelineRow[];
|
|
24
25
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { abortedByMachine } from '@adecore/agent-contracts';
|
|
2
2
|
import { formatElapsedShort } from '@adecore/ui/format';
|
|
3
3
|
import i18next from 'i18next';
|
|
4
|
+
import { waitsOnTheHost } from '../../state/chats.js';
|
|
4
5
|
import { lookKey, lookRunOf, sentMessageOf } from './command-looks.js';
|
|
5
6
|
import { isImageGeneration } from './generated-image.js';
|
|
6
7
|
import { handbackReportOf } from './handback.js';
|
|
@@ -434,6 +435,14 @@ function rowsForItems(items, options, children) {
|
|
|
434
435
|
})
|
|
435
436
|
});
|
|
436
437
|
break;
|
|
438
|
+
case 'unknown':
|
|
439
|
+
rows.push({
|
|
440
|
+
kind: 'unknown',
|
|
441
|
+
id: item.id,
|
|
442
|
+
item,
|
|
443
|
+
waits: waitsOnTheHost(item)
|
|
444
|
+
});
|
|
445
|
+
break;
|
|
437
446
|
case 'turn':
|
|
438
447
|
break;
|
|
439
448
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ChatItem } from '@adecore/agent-contracts';
|
|
2
1
|
interface RecentChatMessage {
|
|
3
2
|
role: 'user' | 'assistant';
|
|
4
3
|
text: string;
|
|
@@ -8,6 +7,7 @@ interface RecentChatMessages {
|
|
|
8
7
|
messages: RecentChatMessage[];
|
|
9
8
|
truncated: boolean;
|
|
10
9
|
}
|
|
11
|
-
export declare function recentChatMessages(items: Record<string,
|
|
12
|
-
export declare function recentSubagentMessages(items: readonly
|
|
10
|
+
export declare function recentChatMessages(items: Record<string, ChatThreadItem>, order: readonly string[], limit: number): RecentChatMessages;
|
|
11
|
+
export declare function recentSubagentMessages(items: readonly ChatThreadItem[], limit: number): RecentChatMessages;
|
|
12
|
+
import type { ChatThreadItem } from '../chat-sink.js';
|
|
13
13
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type RuntimeMode } from '@adecore/agent-contracts';
|
|
2
2
|
export declare const RUNTIME_MODES: readonly RuntimeMode[];
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function isKnownRuntimeMode(mode: string): mode is RuntimeMode;
|
|
4
|
+
export declare function runtimeModeLabel(mode: string): string;
|
|
4
5
|
export declare function runtimeModeHint(mode: RuntimeMode): string;
|
|
@@ -5,8 +5,12 @@ import i18next from 'i18next';
|
|
|
5
5
|
* from narrowest to widest. Their words are read when a view draws one, not when this module loads.
|
|
6
6
|
*/
|
|
7
7
|
export const RUNTIME_MODES = RuntimeModeSchema.options;
|
|
8
|
+
/* Whether this version knows a mode a host reports; a newer host's mode is shown as set there and never sent back as another. */
|
|
9
|
+
export function isKnownRuntimeMode(mode) {
|
|
10
|
+
return RUNTIME_MODES.includes(mode);
|
|
11
|
+
}
|
|
8
12
|
export function runtimeModeLabel(mode) {
|
|
9
|
-
return i18next.t(`agent-chat:modes.${mode}.label`);
|
|
13
|
+
return isKnownRuntimeMode(mode) ? i18next.t(`agent-chat:modes.${mode}.label`) : i18next.t('agent-chat:modes.unknown.label');
|
|
10
14
|
}
|
|
11
15
|
export function runtimeModeHint(mode) {
|
|
12
16
|
return i18next.t(`agent-chat:modes.${mode}.hint`);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { ChatApprovalItem,
|
|
1
|
+
import type { ChatApprovalItem, ChatQuestionItem, ChatSubagentResult } from '@adecore/agent-contracts';
|
|
2
|
+
import type { ChatThreadItem } from '../chat-sink.js';
|
|
2
3
|
import { type ChatTransport } from '../transport.js';
|
|
3
4
|
export interface SubagentConversationState {
|
|
4
5
|
status: 'loading' | 'ready' | 'failed';
|
|
5
|
-
items:
|
|
6
|
+
items: ChatThreadItem[];
|
|
6
7
|
pending: Array<ChatApprovalItem | ChatQuestionItem>;
|
|
7
8
|
source: ChatSubagentResult['source'] | null;
|
|
8
9
|
context: NonNullable<ChatSubagentResult['context']> | null;
|
|
@@ -13,8 +14,8 @@ export interface SubagentConversationState {
|
|
|
13
14
|
unsupported: boolean;
|
|
14
15
|
}
|
|
15
16
|
export declare const INITIAL_CONVERSATION: SubagentConversationState;
|
|
16
|
-
export declare function mergeNewest(current:
|
|
17
|
-
items:
|
|
17
|
+
export declare function mergeNewest(current: ChatThreadItem[], currentCursor: string | null, page: ChatThreadItem[], pageCursor: string | null): {
|
|
18
|
+
items: ChatThreadItem[];
|
|
18
19
|
cursor: string | null;
|
|
19
20
|
};
|
|
20
21
|
export declare class SubagentConversation {
|
|
@@ -116,7 +116,7 @@ export class SubagentConversation {
|
|
|
116
116
|
const items = [...page.items, ...this.state.items];
|
|
117
117
|
this.set({
|
|
118
118
|
items,
|
|
119
|
-
pending: page.pending ??
|
|
119
|
+
pending: pendingOf(page.pending ?? items),
|
|
120
120
|
cursor: page.history.cursor,
|
|
121
121
|
live: page.live,
|
|
122
122
|
loadingEarlier: false
|
|
@@ -171,7 +171,8 @@ export class SubagentConversation {
|
|
|
171
171
|
this.set({
|
|
172
172
|
status: 'ready',
|
|
173
173
|
items: merged.items,
|
|
174
|
-
|
|
174
|
+
// A request this version cannot read is never answered from here; its row in the thread says where to.
|
|
175
|
+
pending: pendingOf(page.pending ?? merged.items),
|
|
175
176
|
cursor: merged.cursor,
|
|
176
177
|
live: page.live,
|
|
177
178
|
source: page.source,
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ChatSubagentItem } from '@adecore/agent-contracts';
|
|
2
2
|
import type { StatusWord } from '../agents/status-look.js';
|
|
3
|
+
import type { ChatThreadInfo, ChatThreadItem } from '../chat-sink.js';
|
|
3
4
|
import type { SubagentTask } from '../host/host.js';
|
|
4
5
|
export declare function subagentTitle(item: ChatSubagentItem): string;
|
|
5
6
|
export declare function statusWordOf(item: ChatSubagentItem, task: SubagentTask | null): StatusWord;
|
|
6
7
|
export type TaskRowState = StatusWord | 'waiting';
|
|
7
|
-
export declare function taskRowStateOf(item: ChatSubagentItem, task: SubagentTask | null, child:
|
|
8
|
+
export declare function taskRowStateOf(item: ChatSubagentItem, task: SubagentTask | null, child: ChatThreadInfo | undefined): TaskRowState;
|
|
8
9
|
export declare function progressOf(states: readonly TaskRowState[]): {
|
|
9
10
|
done: number;
|
|
10
11
|
total: number;
|
|
11
12
|
waiting: number;
|
|
12
13
|
active: number;
|
|
13
14
|
};
|
|
14
|
-
export declare function flyoutSubagents(order: readonly string[], structure: Readonly<Record<string,
|
|
15
|
+
export declare function flyoutSubagents(order: readonly string[], structure: Readonly<Record<string, ChatThreadItem>>): ChatSubagentItem[];
|
|
15
16
|
export declare function summaryWordOf(words: readonly StatusWord[]): StatusWord;
|
|
16
17
|
export declare function badgeCountOf(words: readonly StatusWord[]): number;
|
|
17
18
|
export declare function entryTimeOf(item: ChatSubagentItem, task: SubagentTask | null, now: number): string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChatSubagentItem } from '@adecore/agent-contracts';
|
|
2
|
+
import type { ChatThreadItem } from '../chat-sink.js';
|
|
2
3
|
export interface SubagentStep {
|
|
3
4
|
toolUseId: string;
|
|
4
5
|
description: string;
|
|
@@ -18,8 +19,8 @@ export declare function stepBack(trail: SubagentTrail): SubagentTrail;
|
|
|
18
19
|
export declare function composerWrites(trail: SubagentTrail): boolean;
|
|
19
20
|
export declare function breadcrumbOf(trail: SubagentTrail): BreadcrumbStep[];
|
|
20
21
|
export declare function canOpenSubagent(item: ChatSubagentItem, machineRefused: boolean): boolean;
|
|
21
|
-
export declare function subagentOf(structure: Readonly<Record<string,
|
|
22
|
-
export declare function openableSubagents(order: readonly string[], structure: Record<string,
|
|
22
|
+
export declare function subagentOf(structure: Readonly<Record<string, ChatThreadItem>>, toolUseId: string): ChatSubagentItem | null;
|
|
23
|
+
export declare function openableSubagents(order: readonly string[], structure: Record<string, ChatThreadItem>, machineRefused: boolean): ChatSubagentItem[];
|
|
23
24
|
interface SubagentViewStore {
|
|
24
25
|
trails: Record<string, SubagentTrail>;
|
|
25
26
|
show(key: string, trail: SubagentTrail): void;
|
|
@@ -13,7 +13,7 @@ import { useHostTask, useHostTasks } from '../../host/host-hooks.js';
|
|
|
13
13
|
import { useChatScope } from '../../scope.js';
|
|
14
14
|
import { useChatRow, useChats } from '../../state/chats.js';
|
|
15
15
|
import { useChatActions } from '../actions.js';
|
|
16
|
-
import { backgroundCounts } from '../activity.js';
|
|
16
|
+
import { backgroundCounts, backgroundTaskName } from '../activity.js';
|
|
17
17
|
import { badgeCountOf, entryTimeOf, flyoutSubagents, progressOf, statusWordOf, subagentTitle, summaryWordOf, taskRowStateOf } from '../subagent-list.js';
|
|
18
18
|
import { useSubagentSupport } from '../subagent-support.js';
|
|
19
19
|
import { canOpenSubagent, crumbOf, openFromMain, useSubagentTrail } from '../subagent-view.js';
|
|
@@ -29,7 +29,7 @@ const ROW_BODY = 'flex min-h-9 min-w-0 grow items-center gap-2.5 rounded-md px-2
|
|
|
29
29
|
* its workflows and what runs in the background. Without `workflows` an app shows them somewhere else.
|
|
30
30
|
*/
|
|
31
31
|
export function ChatActivity(t0) {
|
|
32
|
-
const $ = _c(
|
|
32
|
+
const $ = _c(30);
|
|
33
33
|
const {
|
|
34
34
|
chatId,
|
|
35
35
|
workflows: t1
|
|
@@ -111,7 +111,8 @@ export function ChatActivity(t0) {
|
|
|
111
111
|
}
|
|
112
112
|
const {
|
|
113
113
|
shells,
|
|
114
|
-
monitors
|
|
114
|
+
monitors,
|
|
115
|
+
others
|
|
115
116
|
} = t6;
|
|
116
117
|
const Slot = host.SubagentSlot;
|
|
117
118
|
const counting = progress.active > 0 && progress.total > 1;
|
|
@@ -157,7 +158,7 @@ export function ChatActivity(t0) {
|
|
|
157
158
|
t9 = $[18];
|
|
158
159
|
}
|
|
159
160
|
let t10;
|
|
160
|
-
if ($[19] !== background || $[20] !== chatId || $[21] !== monitors || $[22] !==
|
|
161
|
+
if ($[19] !== background || $[20] !== chatId || $[21] !== monitors || $[22] !== others || $[23] !== shells || $[24] !== t) {
|
|
161
162
|
t10 = background.length > 0 && /*#__PURE__*/_jsx(Flyout, {
|
|
162
163
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
163
164
|
icon: shells > 0 ? SquareTerminal : Activity,
|
|
@@ -167,6 +168,8 @@ export function ChatActivity(t0) {
|
|
|
167
168
|
count: shells
|
|
168
169
|
}), monitors > 0 && t("activity.monitors", {
|
|
169
170
|
count: monitors
|
|
171
|
+
}), others > 0 && t("activity.others", {
|
|
172
|
+
count: others
|
|
170
173
|
})].filter(Boolean).join(" \xB7 "),
|
|
171
174
|
children: /*#__PURE__*/_jsx(BackgroundTaskRows, {
|
|
172
175
|
chatId: chatId,
|
|
@@ -176,24 +179,25 @@ export function ChatActivity(t0) {
|
|
|
176
179
|
$[19] = background;
|
|
177
180
|
$[20] = chatId;
|
|
178
181
|
$[21] = monitors;
|
|
179
|
-
$[22] =
|
|
180
|
-
$[23] =
|
|
181
|
-
$[24] =
|
|
182
|
+
$[22] = others;
|
|
183
|
+
$[23] = shells;
|
|
184
|
+
$[24] = t;
|
|
185
|
+
$[25] = t10;
|
|
182
186
|
} else {
|
|
183
|
-
t10 = $[
|
|
187
|
+
t10 = $[25];
|
|
184
188
|
}
|
|
185
189
|
let t11;
|
|
186
|
-
if ($[
|
|
190
|
+
if ($[26] !== t10 || $[27] !== t8 || $[28] !== t9) {
|
|
187
191
|
t11 = /*#__PURE__*/_jsxs("div", {
|
|
188
192
|
className: t7,
|
|
189
193
|
children: [t8, t9, t10]
|
|
190
194
|
});
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
193
|
-
$[
|
|
194
|
-
$[
|
|
195
|
+
$[26] = t10;
|
|
196
|
+
$[27] = t8;
|
|
197
|
+
$[28] = t9;
|
|
198
|
+
$[29] = t11;
|
|
195
199
|
} else {
|
|
196
|
-
t11 = $[
|
|
200
|
+
t11 = $[29];
|
|
197
201
|
}
|
|
198
202
|
return t11;
|
|
199
203
|
}
|
|
@@ -887,7 +891,7 @@ function BackgroundTaskRows(t0) {
|
|
|
887
891
|
size: 14,
|
|
888
892
|
className: "shrink-0 text-text-faint"
|
|
889
893
|
}),
|
|
890
|
-
title:
|
|
894
|
+
title: backgroundTaskName(task),
|
|
891
895
|
detail: task.description ? task.command : null,
|
|
892
896
|
time: formatElapsedShort(now - task.startedAt),
|
|
893
897
|
children: /*#__PURE__*/_jsx(IconButton, {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { AgentKind,
|
|
1
|
+
import type { AgentKind, ModelSelection } from '@adecore/agent-contracts';
|
|
2
2
|
import type { ChatSendExtras } from '../../chat-client.js';
|
|
3
|
+
import type { ChatThreadInfo } from '../../chat-sink.js';
|
|
3
4
|
interface ComposerProps {
|
|
4
5
|
chatId: string;
|
|
5
|
-
info:
|
|
6
|
+
info: ChatThreadInfo;
|
|
6
7
|
focused: boolean;
|
|
7
8
|
answerPromptsElsewhere?: () => void;
|
|
8
9
|
disabled: boolean;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ProviderCapabilities } from '@adecore/agent-contracts';
|
|
2
|
+
import type { ChatThreadInfo } from '../../chat-sink.js';
|
|
2
3
|
export declare function GoalDock({ chatId, info, goals }: {
|
|
3
4
|
chatId: string;
|
|
4
|
-
info:
|
|
5
|
+
info: ChatThreadInfo;
|
|
5
6
|
goals: ProviderCapabilities['goals'];
|
|
6
7
|
}): import("react").JSX.Element | null;
|
|
7
8
|
export declare function GoalPill({ chatId }: {
|
package/dist/chat/ui/GoalDock.js
CHANGED
|
@@ -10,7 +10,7 @@ import { useChatScope } from '../../scope.js';
|
|
|
10
10
|
import { useChats } from '../../state/chats.js';
|
|
11
11
|
import { errorMessage } from '../../transport.js';
|
|
12
12
|
import { useChatActions } from '../actions.js';
|
|
13
|
-
import { goalView } from '../logic/goal.js';
|
|
13
|
+
import { goalView, knownGoalStatus } from '../logic/goal.js';
|
|
14
14
|
/* How far the goal got, in what its CLI counts: the checks that sent the agent on, or the tokens it spent. */
|
|
15
15
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
function progressOf(goal, t) {
|
|
@@ -35,7 +35,7 @@ function progressOf(goal, t) {
|
|
|
35
35
|
* and what a person may do to it. The whole objective and what the last check said are in the tooltip.
|
|
36
36
|
*/
|
|
37
37
|
export function GoalDock(t0) {
|
|
38
|
-
const $ = _c(
|
|
38
|
+
const $ = _c(24);
|
|
39
39
|
const {
|
|
40
40
|
chatId,
|
|
41
41
|
info,
|
|
@@ -105,47 +105,38 @@ export function GoalDock(t0) {
|
|
|
105
105
|
} else {
|
|
106
106
|
t6 = $[17];
|
|
107
107
|
}
|
|
108
|
-
const t7 = `goal.status.${goal.status}
|
|
108
|
+
const t7 = knownGoalStatus(goal) ? t(`goal.status.${goal.status}`) : t("goal.status.unknown");
|
|
109
109
|
let t8;
|
|
110
|
-
if ($[18] !==
|
|
111
|
-
t8 =
|
|
112
|
-
$[18] = t;
|
|
113
|
-
$[19] = t7;
|
|
114
|
-
$[20] = t8;
|
|
115
|
-
} else {
|
|
116
|
-
t8 = $[20];
|
|
117
|
-
}
|
|
118
|
-
let t9;
|
|
119
|
-
if ($[21] !== t8) {
|
|
120
|
-
t9 = /*#__PURE__*/_jsx("span", {
|
|
110
|
+
if ($[18] !== t7) {
|
|
111
|
+
t8 = /*#__PURE__*/_jsx("span", {
|
|
121
112
|
className: "truncate text-sm text-text",
|
|
122
|
-
children:
|
|
113
|
+
children: t7
|
|
123
114
|
});
|
|
124
|
-
$[
|
|
125
|
-
$[
|
|
115
|
+
$[18] = t7;
|
|
116
|
+
$[19] = t8;
|
|
126
117
|
} else {
|
|
127
|
-
|
|
118
|
+
t8 = $[19];
|
|
128
119
|
}
|
|
129
|
-
let
|
|
130
|
-
if ($[
|
|
131
|
-
|
|
120
|
+
let t9;
|
|
121
|
+
if ($[20] !== act || $[21] !== changing || $[22] !== t) {
|
|
122
|
+
t9 = action_0 => /*#__PURE__*/_jsx(Button, {
|
|
132
123
|
size: "sm",
|
|
133
124
|
disabled: changing,
|
|
134
125
|
onClick: () => act(action_0),
|
|
135
126
|
children: t(`goal.${action_0}`)
|
|
136
127
|
}, action_0);
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
128
|
+
$[20] = act;
|
|
129
|
+
$[21] = changing;
|
|
130
|
+
$[22] = t;
|
|
131
|
+
$[23] = t9;
|
|
141
132
|
} else {
|
|
142
|
-
|
|
133
|
+
t9 = $[23];
|
|
143
134
|
}
|
|
144
135
|
t1 = /*#__PURE__*/_jsxs("div", {
|
|
145
136
|
className: "flex items-center gap-2 border-b border-border px-3.5 py-2.5",
|
|
146
137
|
children: [t6, /*#__PURE__*/_jsxs("span", {
|
|
147
138
|
className: "flex min-w-0 grow flex-col",
|
|
148
|
-
children: [
|
|
139
|
+
children: [t8, /*#__PURE__*/_jsx(Tooltip, {
|
|
149
140
|
label: goal.lastCheck === undefined ? goal.objective : /*#__PURE__*/_jsxs(_Fragment, {
|
|
150
141
|
children: [goal.objective, /*#__PURE__*/_jsx("br", {}), t("goal.lastCheck", {
|
|
151
142
|
check: goal.lastCheck
|
|
@@ -156,7 +147,7 @@ export function GoalDock(t0) {
|
|
|
156
147
|
children: progress === null ? goal.objective : `${goal.objective} · ${progress}`
|
|
157
148
|
})
|
|
158
149
|
})]
|
|
159
|
-
}), view.actions.map(
|
|
150
|
+
}), view.actions.map(t9)]
|
|
160
151
|
});
|
|
161
152
|
}
|
|
162
153
|
$[0] = actions;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChatThreadInfo } from '../../chat-sink.js';
|
|
2
2
|
export declare function LimitDock({ chatId, info }: {
|
|
3
3
|
chatId: string;
|
|
4
|
-
info:
|
|
4
|
+
info: ChatThreadInfo;
|
|
5
5
|
}): import("react").JSX.Element | null;
|
|
6
6
|
export declare function LimitPill({ chatId }: {
|
|
7
7
|
chatId: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type AgentKind, type ChatUsage, type ModelInfo, type ModelSelection, type ProviderInfo, type RuntimeMode } from '@adecore/agent-contracts';
|
|
2
|
+
import type { ChatThreadInfo } from '../../chat-sink.js';
|
|
2
3
|
import type { AccountChoice } from '../account-choice.js';
|
|
3
4
|
interface RunSettingsProps {
|
|
4
5
|
disabled?: boolean;
|
|
@@ -6,8 +7,8 @@ interface RunSettingsProps {
|
|
|
6
7
|
provider: AgentKind;
|
|
7
8
|
selection: ModelSelection;
|
|
8
9
|
model: ModelInfo | undefined;
|
|
9
|
-
runtimeMode:
|
|
10
|
-
effectiveRuntimeMode?:
|
|
10
|
+
runtimeMode: ChatThreadInfo['runtimeMode'];
|
|
11
|
+
effectiveRuntimeMode?: ChatThreadInfo['effectiveRuntimeMode'];
|
|
11
12
|
permissionMode?: string;
|
|
12
13
|
open: boolean;
|
|
13
14
|
onOpenChange(open: boolean): void;
|