@qilin-agent/client-ui-trajectory 0.0.0-stage → 3.1.4
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/LICENSE +21 -0
- package/README.i18n.yaml +55 -0
- package/README.md +120 -2
- package/README.zh.md +121 -0
- package/lib/client.js +11846 -0
- package/lib/index.js +6 -0
- package/lib/types/client/TrajectoryCell.d.ts +13 -0
- package/lib/types/client/TrajectoryGraphView.d.ts +37 -0
- package/lib/types/client/TrajectoryGroupHeader.d.ts +13 -0
- package/lib/types/client/TrajectoryTable.d.ts +111 -0
- package/lib/types/client/TrajectoryTimeline.d.ts +26 -0
- package/lib/types/client/TrajectoryToolbar.d.ts +34 -0
- package/lib/types/client/TrajectoryTurn.d.ts +17 -0
- package/lib/types/client/TrajectoryTurnHeader.d.ts +14 -0
- package/lib/types/client/TrajectoryView.d.ts +20 -0
- package/lib/types/client/code-program.d.ts +19 -0
- package/lib/types/client/copy-codes.d.ts +4 -0
- package/lib/types/client/duration-store.d.ts +7 -0
- package/lib/types/client/index.d.ts +20 -0
- package/lib/types/client/layout.d.ts +46 -0
- package/lib/types/client/locales.d.ts +293 -0
- package/lib/types/client/string-wrapping-store.d.ts +7 -0
- package/lib/types/client/timeline.d.ts +52 -0
- package/lib/types/client/trajectory-assistant-definition.d.ts +8 -0
- package/lib/types/client/trajectory-compaction-definition.d.ts +8 -0
- package/lib/types/client/trajectory-contract.d.ts +96 -0
- package/lib/types/client/trajectory-definition-common.d.ts +12 -0
- package/lib/types/client/trajectory-event-projection.d.ts +51 -0
- package/lib/types/client/trajectory-graph-canvas.d.ts +64 -0
- package/lib/types/client/trajectory-graph-inspector.d.ts +30 -0
- package/lib/types/client/trajectory-graph-layout.d.ts +98 -0
- package/lib/types/client/trajectory-graph-tab-definition.d.ts +19 -0
- package/lib/types/client/trajectory-graph.d.ts +239 -0
- package/lib/types/client/trajectory-message-definitions.d.ts +8 -0
- package/lib/types/client/trajectory-preview.d.ts +8 -0
- package/lib/types/client/trajectory-record.d.ts +114 -0
- package/lib/types/client/trajectory-request-header-definition.d.ts +18 -0
- package/lib/types/client/trajectory-search-index.d.ts +20 -0
- package/lib/types/client/trajectory-snapshot-builder.d.ts +29 -0
- package/lib/types/client/trajectory-tab-definition.d.ts +32 -0
- package/lib/types/client/trajectory-tool-definition.d.ts +8 -0
- package/lib/types/client/trajectory-virtual-rows.d.ts +34 -0
- package/lib/types/index.d.ts +4 -0
- package/package.json +81 -3
package/lib/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { formatElapsedSeconds, type TrajectoryCellProps } from './trajectory-record.ts';
|
|
2
|
+
import type { TrajectoryTranslate } from './locales.ts';
|
|
3
|
+
export { formatElapsedSeconds };
|
|
4
|
+
export type { AssistantMetricDetail, TrajectoryCellKind, TrajectoryCellProps, } from './trajectory-record.ts';
|
|
5
|
+
/**
|
|
6
|
+
* Render one trajectory step cell.
|
|
7
|
+
* @param props - index, kind, text, time, and optional Message metrics.
|
|
8
|
+
* @returns the cell element.
|
|
9
|
+
*/
|
|
10
|
+
export declare function TrajectoryCell({ t, index, kind, text, inputDetail: _inputDetail, promptDetail: _promptDetail, previousPromptDetail: _previousPromptDetail, outputDetail: _outputDetail, thinkingDetail: _thinkingDetail, sourceBlocks: _sourceBlocks, outputBlocks: _outputBlocks, schemaDetail: _schemaDetail, assistantMetrics: _assistantMetrics, result: _result, callId: _callId, toolName: _toolName, isError: _isError, timeSeconds, startedAt: _startedAt, input, output, think, selected, className, ...rest }: TrajectoryCellProps & {
|
|
11
|
+
t: TrajectoryTranslate;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=TrajectoryCell.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trajectory graph view: the ledger drawn as a live node and edge flow, with
|
|
3
|
+
* the ledger-order replay, record search, the edge-kind legend, canvas zoom
|
|
4
|
+
* and pan, and the structured record inspector.
|
|
5
|
+
*
|
|
6
|
+
* Motion is data-driven, not decorative: a record that is still moving pulses
|
|
7
|
+
* and every edge that delivers data into it carries a dashed flow, while the
|
|
8
|
+
* replay control walks the ledger in the order the events actually happened —
|
|
9
|
+
* pacing each hop by the recorded timestamps (clamped, so a 30-second tool
|
|
10
|
+
* call does not freeze the replay), dimming the records the cursor has not
|
|
11
|
+
* reached, and flying one packet per hop along the hop's real edge path
|
|
12
|
+
* (`<animateMotion path>`).
|
|
13
|
+
*
|
|
14
|
+
* The canvas adapts to its pane: a ResizeObserver feeds the measured canvas
|
|
15
|
+
* width into the layout, so the graph spreads its swimlanes across a wide pane
|
|
16
|
+
* and the canvas centers the sheet whenever it fits no more.
|
|
17
|
+
*/
|
|
18
|
+
import { type ReactNode } from 'react';
|
|
19
|
+
import type { MessageImageLoader } from '@qilin-agent/client-ui-conversation/client';
|
|
20
|
+
import type { InjectFace, PropsLocale, PropsRuntime } from '@qilin-agent/client-ui-slots';
|
|
21
|
+
/** Session-bound image loader injected beside the trajectory locale seat. */
|
|
22
|
+
export interface TrajectoryGraphViewInjected {
|
|
23
|
+
/** Session-authorized image URL loader with its synchronous cache read. */
|
|
24
|
+
loadImage: MessageImageLoader;
|
|
25
|
+
/** Reveal the ledger page this graph draws, in the same pane. */
|
|
26
|
+
openLedger: () => void;
|
|
27
|
+
}
|
|
28
|
+
/** The graph body's composed props: the Sidebar tab seat, its image loader, the ledger control, and the trajectory locale. */
|
|
29
|
+
export type TrajectoryGraphViewProps = PropsRuntime<'sidebar.right.pane.tab'> & InjectFace<TrajectoryGraphViewInjected> & PropsLocale<'trajectory'>;
|
|
30
|
+
/**
|
|
31
|
+
* Render one session's trajectory ledger as a node and edge graph.
|
|
32
|
+
* @param props - the Sidebar tab seat's runtime share, the authorized image
|
|
33
|
+
* loader, the ledger control, and the trajectory locale.
|
|
34
|
+
* @returns The graph body, or its empty and hint states.
|
|
35
|
+
*/
|
|
36
|
+
export declare function TrajectoryGraphView({ useTrajectory, loadImage, openLedger, t }: TrajectoryGraphViewProps): ReactNode;
|
|
37
|
+
//# sourceMappingURL=TrajectoryGraphView.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface TrajectoryGroupHeaderProps {
|
|
2
|
+
/** Group title (`Message`, `Step 1`, …). */
|
|
3
|
+
title: string;
|
|
4
|
+
/** Secondary summary (`49 s`, `2.2 s skill`, …). */
|
|
5
|
+
description?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Render a Message/Step group header inside a turn body.
|
|
9
|
+
* @param props - title and optional description.
|
|
10
|
+
* @returns the group header element.
|
|
11
|
+
*/
|
|
12
|
+
export declare function TrajectoryGroupHeader({ title, description }: TrajectoryGroupHeaderProps): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=TrajectoryGroupHeader.d.ts.map
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/** Turn-aware trajectory event ledger with a local record inspector. */
|
|
2
|
+
import type { JsonTreeProps } from '@qilin-agent/client-ui-primitives';
|
|
3
|
+
import type { AssistantRequestConfig, RenderMessageImages } from '@qilin-agent/client-ui-conversation/client';
|
|
4
|
+
import type { TrajectoryCellProps } from './trajectory-record.ts';
|
|
5
|
+
import type { TrajectoryTurnModel } from './layout.ts';
|
|
6
|
+
import type { TrajectoryTranslate } from './locales.ts';
|
|
7
|
+
/** Props for the trajectory ledger. */
|
|
8
|
+
export interface TrajectoryTableProps {
|
|
9
|
+
/** Wrapping control shared by all JSON inspectors. */
|
|
10
|
+
stringWrapping?: JsonTreeProps['stringWrapping'];
|
|
11
|
+
/** Trajectory locale seat. */
|
|
12
|
+
t: TrajectoryTranslate;
|
|
13
|
+
/** Slot-backed durable image renderer shared with the Chat gallery. */
|
|
14
|
+
renderImages: RenderMessageImages;
|
|
15
|
+
/** Session-global request numbers for the request groups visible in this context. */
|
|
16
|
+
requestNumbers?: readonly TrajectoryRequestNumber[];
|
|
17
|
+
/** Grouped records in display order. */
|
|
18
|
+
turns: readonly TrajectoryTurnModel[];
|
|
19
|
+
/** In-flight cells whose content replaces the matching structural record index. */
|
|
20
|
+
streamingCells?: readonly TrajectoryCellProps[];
|
|
21
|
+
/** Record indexes emphasized by the active timeline focus. */
|
|
22
|
+
timelineFocusIndexes?: ReadonlySet<number> | null;
|
|
23
|
+
/** Record indexes retained by the active live search, or null without a query. */
|
|
24
|
+
searchMatchIndexes?: ReadonlySet<number> | null;
|
|
25
|
+
/** Report the record currently selected in the local inspector. */
|
|
26
|
+
onSelectedIndexChange?: (index: number | null) => void;
|
|
27
|
+
/** Report a direct user selection from a ledger row. */
|
|
28
|
+
onRecordSelect?: (index: number) => void;
|
|
29
|
+
/** One externally requested record selection; a new object repeats the request. */
|
|
30
|
+
recordSelection?: {
|
|
31
|
+
readonly index: number;
|
|
32
|
+
} | null;
|
|
33
|
+
/** One externally requested record focus without changing inspector selection. */
|
|
34
|
+
recordFocus?: {
|
|
35
|
+
readonly index: number;
|
|
36
|
+
} | null;
|
|
37
|
+
/** Whether the initial history tail is still loading. */
|
|
38
|
+
historyLoading?: boolean;
|
|
39
|
+
/** Whether one older history page request is pending anywhere. */
|
|
40
|
+
olderHistoryLoading?: boolean;
|
|
41
|
+
/** First loaded raw event, used to preserve scroll position after prepending a page. */
|
|
42
|
+
historyStartSeq?: number | undefined;
|
|
43
|
+
/** Whether one older history page can be requested. */
|
|
44
|
+
hasOlderRecords?: boolean;
|
|
45
|
+
/** Load one older history page. */
|
|
46
|
+
onLoadOlder?: () => Promise<boolean>;
|
|
47
|
+
/** Clear selection state owned by the ledger host. */
|
|
48
|
+
onClearSelection?: () => void;
|
|
49
|
+
/** Turn ids whose rows after the first are folded into a summary. */
|
|
50
|
+
collapsedTurns: ReadonlySet<number>;
|
|
51
|
+
/** Toggle one turn between folded and expanded. */
|
|
52
|
+
onToggleTurn: (turn: number) => void;
|
|
53
|
+
/** Stable Assistant record ids whose tool calls are folded. */
|
|
54
|
+
collapsedAssistants: ReadonlySet<string>;
|
|
55
|
+
/** Toggle tool calls under one assistant record. */
|
|
56
|
+
onToggleAssistant: (id: string) => void;
|
|
57
|
+
/** One-shot cross-view inspect: open and scroll to this call's record. */
|
|
58
|
+
inspectCallId?: string | null;
|
|
59
|
+
/** Acknowledge a consumed (or unresolvable) inspect request. */
|
|
60
|
+
onInspectApplied?: (() => void) | undefined;
|
|
61
|
+
}
|
|
62
|
+
/** Request-inspector fields shared by ordinary generation and compaction. */
|
|
63
|
+
interface TrajectoryRequestNumberBase {
|
|
64
|
+
group: string;
|
|
65
|
+
number: number;
|
|
66
|
+
status?: 'complete' | 'running' | 'error';
|
|
67
|
+
startedAt?: number;
|
|
68
|
+
completedAt?: number | null;
|
|
69
|
+
error?: string;
|
|
70
|
+
errorCode?: string;
|
|
71
|
+
retry?: number;
|
|
72
|
+
maxRetries?: number;
|
|
73
|
+
retryDelayMs?: number;
|
|
74
|
+
resultSeq?: number;
|
|
75
|
+
provider?: string;
|
|
76
|
+
model?: string;
|
|
77
|
+
requestConfig?: AssistantRequestConfig;
|
|
78
|
+
usage?: TrajectoryUsage;
|
|
79
|
+
cumulativeUsage?: TrajectoryUsage;
|
|
80
|
+
}
|
|
81
|
+
/** One purpose-discriminated request identity paired with its session-global number. */
|
|
82
|
+
export type TrajectoryRequestNumber = TrajectoryRequestNumberBase & ({
|
|
83
|
+
purpose?: 'assistant';
|
|
84
|
+
/** Request anchor event sequence; absent for the currently streaming request. */
|
|
85
|
+
seq?: number;
|
|
86
|
+
turn: number;
|
|
87
|
+
step: number;
|
|
88
|
+
} | {
|
|
89
|
+
purpose: 'compaction';
|
|
90
|
+
/** Request anchor event sequence and stable compaction identity. */
|
|
91
|
+
seq: number;
|
|
92
|
+
turn: number | null;
|
|
93
|
+
step: 0;
|
|
94
|
+
});
|
|
95
|
+
/** Disjoint provider token buckets for one request or a session prefix. */
|
|
96
|
+
export interface TrajectoryUsage {
|
|
97
|
+
input?: number;
|
|
98
|
+
cacheRead?: number;
|
|
99
|
+
cacheWrite?: number;
|
|
100
|
+
output?: number;
|
|
101
|
+
reasoning?: number;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Render trajectory events as a dense ledger with turn and step separators.
|
|
105
|
+
* Clicking ledger whitespace clears the active record or request selection.
|
|
106
|
+
* @param props - Grouped trajectory data and whole-ledger fold state.
|
|
107
|
+
* @returns The ledger and an optional local record inspector.
|
|
108
|
+
*/
|
|
109
|
+
export declare function TrajectoryTable({ t, stringWrapping, renderImages, requestNumbers: sessionRequestNumbers, turns, streamingCells, timelineFocusIndexes, searchMatchIndexes, onSelectedIndexChange, onRecordSelect, recordSelection, recordFocus, historyLoading, olderHistoryLoading, historyStartSeq, hasOlderRecords, onLoadOlder, onClearSelection, collapsedTurns, onToggleTurn, collapsedAssistants, onToggleAssistant, inspectCallId, onInspectApplied, }: TrajectoryTableProps): import("react").JSX.Element;
|
|
110
|
+
export {};
|
|
111
|
+
//# sourceMappingURL=TrajectoryTable.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Chrome-Network-style overview timeline for focusing the trajectory ledger. */
|
|
2
|
+
import type { TrajectoryTurnModel } from './layout.ts';
|
|
3
|
+
import type { TrajectoryTranslate } from './locales.ts';
|
|
4
|
+
import { type TrajectoryTimelineMode, type TrajectoryTimeRange } from './timeline.ts';
|
|
5
|
+
/** Props for the fixed full-domain overview above the trajectory ledger. */
|
|
6
|
+
export interface TrajectoryTimelineProps {
|
|
7
|
+
t: TrajectoryTranslate;
|
|
8
|
+
turns: readonly TrajectoryTurnModel[];
|
|
9
|
+
mode: TrajectoryTimelineMode;
|
|
10
|
+
range: TrajectoryTimeRange | null;
|
|
11
|
+
/** Whether the loaded timeline omits an earlier history prefix. */
|
|
12
|
+
hasEarlierRecords?: boolean;
|
|
13
|
+
/** Load one earlier history page from the truncation control. */
|
|
14
|
+
onLoadEarlier?: () => Promise<boolean>;
|
|
15
|
+
selectedIndex?: number | null;
|
|
16
|
+
/** Record indexes matching the active ledger search, or null without a query. */
|
|
17
|
+
searchMatchIndexes?: ReadonlySet<number> | null;
|
|
18
|
+
onRangeChange: (range: TrajectoryTimeRange | null) => void;
|
|
19
|
+
/** Select a directly clicked timeline block. */
|
|
20
|
+
onRecordSelect?: (index: number) => void;
|
|
21
|
+
/** Bring the nearest record into view after clicking timeline whitespace. */
|
|
22
|
+
onRecordFocus?: (index: number) => void;
|
|
23
|
+
}
|
|
24
|
+
/** Overview renderer with drag ranges, click-sized focus, and Escape reset. */
|
|
25
|
+
export declare const TrajectoryTimeline: import("react").MemoExoticComponent<({ t, turns, mode, range, hasEarlierRecords, onLoadEarlier, selectedIndex, searchMatchIndexes, onRangeChange, onRecordSelect, onRecordFocus, }: TrajectoryTimelineProps) => import("react").JSX.Element>;
|
|
26
|
+
//# sourceMappingURL=TrajectoryTimeline.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Trajectory toolbar: timeline and ledger fold controls. */
|
|
2
|
+
import type { TranslateNS } from '@qilin-agent/client-ui-slots';
|
|
3
|
+
import type { NS } from './locales.ts';
|
|
4
|
+
export interface TrajectoryToolbarProps {
|
|
5
|
+
/** Whether timeline blocks use recorded durations instead of equal widths. */
|
|
6
|
+
actualDuration: boolean;
|
|
7
|
+
/** Select recorded-duration or equal-width blocks. */
|
|
8
|
+
onActualDurationChange: (actualDuration: boolean) => void;
|
|
9
|
+
/** Whether recorded timing retains idle gaps between operations. */
|
|
10
|
+
actualTime: boolean;
|
|
11
|
+
/** Select complete wall-clock timing or idle-compressed timing. */
|
|
12
|
+
onActualTimeChange: (actualTime: boolean) => void;
|
|
13
|
+
/** Whether every collapsible turn is currently folded. */
|
|
14
|
+
allTurnsCollapsed: boolean;
|
|
15
|
+
/** Fold or expand every collapsible turn. */
|
|
16
|
+
onToggleAllTurns: () => void;
|
|
17
|
+
/** Whether every collapsible assistant's tool calls are currently folded. */
|
|
18
|
+
allAssistantsCollapsed: boolean;
|
|
19
|
+
/** Fold or expand tool calls under every collapsible assistant. */
|
|
20
|
+
onToggleAllAssistants: () => void;
|
|
21
|
+
/** Current live ledger search query. */
|
|
22
|
+
searchQuery: string;
|
|
23
|
+
/** Update the live ledger search query. */
|
|
24
|
+
onSearchQueryChange: (query: string) => void;
|
|
25
|
+
/** Translate a toolbar dictionary key. */
|
|
26
|
+
t: TranslateNS<typeof NS>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Render the sticky trajectory toolbar.
|
|
30
|
+
* @param props - rendered counts and whole-list fold state.
|
|
31
|
+
* @returns the toolbar element.
|
|
32
|
+
*/
|
|
33
|
+
export declare function TrajectoryToolbar({ actualDuration, onActualDurationChange, actualTime, onActualTimeChange, allTurnsCollapsed, onToggleAllTurns, allAssistantsCollapsed, onToggleAllAssistants, searchQuery, onSearchQueryChange, t, }: TrajectoryToolbarProps): import("react").JSX.Element;
|
|
34
|
+
//# sourceMappingURL=TrajectoryToolbar.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { TrajectoryTranslate } from './locales.ts';
|
|
3
|
+
export interface TrajectoryTurnProps {
|
|
4
|
+
/** 1-based turn index for the sticky header. */
|
|
5
|
+
turn: number;
|
|
6
|
+
/** Message / Step headers and TrajectoryCell rows. */
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
/** Trajectory locale seat. */
|
|
9
|
+
t: TrajectoryTranslate;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Render one turn section (sticky header + body).
|
|
13
|
+
* @param props - turn index and body children.
|
|
14
|
+
* @returns the turn section element.
|
|
15
|
+
*/
|
|
16
|
+
export declare function TrajectoryTurn({ turn, children, t }: TrajectoryTurnProps): import("react").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=TrajectoryTurn.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TrajectoryTranslate } from './locales.ts';
|
|
2
|
+
export interface TrajectoryTurnHeaderProps {
|
|
3
|
+
/** 1-based turn index shown as `Turn N`. */
|
|
4
|
+
turn: number;
|
|
5
|
+
/** Trajectory locale seat. */
|
|
6
|
+
t: TrajectoryTranslate;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Render the sticky turn header row.
|
|
10
|
+
* @param props.turn - turn index.
|
|
11
|
+
* @returns the sticky header element.
|
|
12
|
+
*/
|
|
13
|
+
export declare function TrajectoryTurnHeader({ turn, t }: TrajectoryTurnHeaderProps): import("react").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=TrajectoryTurnHeader.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Trajectory view: compact summary over a turn-aware event ledger. */
|
|
2
|
+
import type { MessageImageLoader } from '@qilin-agent/client-ui-conversation/client';
|
|
3
|
+
import type { InjectFace, PropsLocale, PropsRenderSlots, PropsRuntime } from '@qilin-agent/client-ui-slots';
|
|
4
|
+
import type { SnapshotStore } from '@qilin-agent/client-store';
|
|
5
|
+
import type { JsonTreeProps } from '@qilin-agent/client-ui-primitives';
|
|
6
|
+
/** Session-bound controls not already supplied by the Sidebar tab seat. */
|
|
7
|
+
export interface TrajectoryViewInjected {
|
|
8
|
+
/** Shared wrapping preference read by expansion handlers. */
|
|
9
|
+
jsonStringWrapping?: Omit<NonNullable<JsonTreeProps['stringWrapping']>, 'label'>;
|
|
10
|
+
hooks: {
|
|
11
|
+
duration: SnapshotStore<boolean>;
|
|
12
|
+
};
|
|
13
|
+
loadOlder: () => Promise<boolean>;
|
|
14
|
+
loadImage: MessageImageLoader;
|
|
15
|
+
setActualDuration: (actualDuration: boolean) => void;
|
|
16
|
+
}
|
|
17
|
+
/** The ledger body's composed props: the Sidebar tab seat, its images child, and its controls. */
|
|
18
|
+
export type TrajectoryViewProps = PropsRuntime<'sidebar.right.pane.tab'> & PropsRenderSlots<'conversation.trajectory.images'> & InjectFace<TrajectoryViewInjected> & PropsLocale<'trajectory'>;
|
|
19
|
+
export declare function TrajectoryView({ useSession, useTrajectory, useDuration, useTabInfo, loadOlder, loadImage, setActualDuration, renderSlot, t, jsonStringWrapping, }: TrajectoryViewProps): import("react").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=TrajectoryView.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Read replayable PTC source and language hints from recorded tool arguments and schemas. */
|
|
2
|
+
import type { TrajectoryCellProps } from './trajectory-record.ts';
|
|
3
|
+
/** Recorded name of the programmatic tool-calling entry point. */
|
|
4
|
+
export declare const PTC_TOOL_NAME = "run_code";
|
|
5
|
+
/** Validated source and original arguments for one recorded run_code call. */
|
|
6
|
+
export interface CodeProgram {
|
|
7
|
+
rawInput: string;
|
|
8
|
+
source: string;
|
|
9
|
+
description: string;
|
|
10
|
+
arguments: Record<string, unknown>;
|
|
11
|
+
language: 'typescript' | 'python' | undefined;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Resolve a PTC program without guessing its language from source or current runtime settings.
|
|
15
|
+
* @param cell - Recorded tool arguments and the schema visible at call time.
|
|
16
|
+
* @returns The program, or undefined for another tool or unsupported arguments.
|
|
17
|
+
*/
|
|
18
|
+
export declare function codeProgram(cell: TrajectoryCellProps): CodeProgram | undefined;
|
|
19
|
+
//# sourceMappingURL=code-program.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Stable non-display markers for client-synthesized trajectory copy. */
|
|
2
|
+
/** Error marker localized only when the trajectory renders it. */
|
|
3
|
+
export declare const COMPACTION_INTERRUPTED_ERROR = "trajectory.compaction-interrupted";
|
|
4
|
+
//# sourceMappingURL=copy-codes.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type SnapshotStore } from '@qilin-agent/client-store';
|
|
2
|
+
/**
|
|
3
|
+
* Create the browser-wide trajectory duration preference source.
|
|
4
|
+
* @returns a persisted source shared by every session view in one plugin lifecycle.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createTrajectoryDurationStore(): SnapshotStore<boolean>;
|
|
7
|
+
//# sourceMappingURL=duration-store.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser trajectory plugin: two right-Sidebar page types over the same
|
|
3
|
+
* Trajectory target — the event ledger, and the graph view that draws it as a
|
|
4
|
+
* node and edge flow — without defining a service.
|
|
5
|
+
*/
|
|
6
|
+
import type { Context } from '@qilin-agent/kylin';
|
|
7
|
+
export type { TrajectoryKey } from './locales.ts';
|
|
8
|
+
export type { TrajectoryContribution, TrajectoryConversationViewNode, TrajectoryRequestHeaderState, TrajectorySnapshot, UseTrajectory, } from './trajectory-contract.ts';
|
|
9
|
+
export type { TrajectoryTabParams } from './trajectory-tab-definition.ts';
|
|
10
|
+
export { TRAJECTORY_ID, TRAJECTORY_KIND } from './trajectory-tab-definition.ts';
|
|
11
|
+
/** Required services: the Sidebar controller and tab registry, the slot registry, Session paging, and the locale service. */
|
|
12
|
+
export declare const inject: string[];
|
|
13
|
+
/**
|
|
14
|
+
* Client plugin body: register the Sidebar tab type, its body, and its data
|
|
15
|
+
* contributions. Each registration rides an effect wrapper, so plugin unload
|
|
16
|
+
* removes the type and its seats together.
|
|
17
|
+
* @param ctx - client root context.
|
|
18
|
+
*/
|
|
19
|
+
export declare function apply(ctx: Context): void;
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trajectory list fold: expand assistant blocks, attach usage to Message,
|
|
3
|
+
* own-duration times, in-flight partial/runningCalls, and group descriptions.
|
|
4
|
+
*/
|
|
5
|
+
import type { ConversationLocation, RequestInspectionSnapshot, RequestView } from '@qilin-agent/client-ui-conversation/client';
|
|
6
|
+
import type { TrajectoryCellProps } from './trajectory-record.ts';
|
|
7
|
+
import type { TrajectorySnapshot } from './trajectory-contract.ts';
|
|
8
|
+
import type { TrajectoryTranslate } from './locales.ts';
|
|
9
|
+
/** One Message or Step group inside a turn. */
|
|
10
|
+
export interface TrajectoryGroupModel {
|
|
11
|
+
title: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
cells: readonly TrajectoryCellProps[];
|
|
14
|
+
}
|
|
15
|
+
/** One sticky turn, or a standalone compaction section between turns. */
|
|
16
|
+
export interface TrajectoryTurnModel {
|
|
17
|
+
turn: number | null;
|
|
18
|
+
groups: readonly TrajectoryGroupModel[];
|
|
19
|
+
}
|
|
20
|
+
/** Snapshot slice the trajectory view folds. */
|
|
21
|
+
export interface TrajectoryLayoutInput {
|
|
22
|
+
systemPrompts?: TrajectorySnapshot['systemPrompts'];
|
|
23
|
+
nodes: TrajectorySnapshot['eventNodes'];
|
|
24
|
+
eventLocations?: ReadonlyMap<number, ConversationLocation>;
|
|
25
|
+
partial: TrajectorySnapshot['partial'];
|
|
26
|
+
runningCalls: TrajectorySnapshot['runningCalls'];
|
|
27
|
+
requests?: readonly RequestView[];
|
|
28
|
+
callSchemas?: RequestInspectionSnapshot['callSchemas'];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Fold a snapshot into turn → Message/Step groups with expanded cells.
|
|
32
|
+
* @param input - nodes plus in-flight partial/runningCalls.
|
|
33
|
+
* @param t - Trajectory locale translator.
|
|
34
|
+
* @returns turns ordered by first appearance.
|
|
35
|
+
*/
|
|
36
|
+
export declare function deriveTrajectoryLayout(input: TrajectoryLayoutInput, t: TrajectoryTranslate): readonly TrajectoryTurnModel[];
|
|
37
|
+
/**
|
|
38
|
+
* Append the changing in-flight assistant cells to a stable finalized layout.
|
|
39
|
+
* @param turns - Finalized layout derived with an empty-block partial anchor.
|
|
40
|
+
* @param partial - Current in-flight assistant projection.
|
|
41
|
+
* @param lastIndex - Highest cell index in the finalized layout.
|
|
42
|
+
* @param t - Trajectory locale translator.
|
|
43
|
+
* @returns The original layout without a partial, otherwise a layout sharing every unaffected turn.
|
|
44
|
+
*/
|
|
45
|
+
export declare function appendTrajectoryPartialLayout(turns: readonly TrajectoryTurnModel[], partial: TrajectorySnapshot['partial'], lastIndex: number, t: TrajectoryTranslate): readonly TrajectoryTurnModel[];
|
|
46
|
+
//# sourceMappingURL=layout.d.ts.map
|