@deepseek-ai/dsh-client-ui-trajectory 0.1.1-rc.2 → 0.1.2-alpha.3
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/README.i18n.yaml +2 -2
- package/README.md +83 -2
- package/README.zh.md +85 -4
- package/lib/client.js +1425 -604
- package/lib/types/client/TrajectoryCell.d.ts +4 -1
- package/lib/types/client/TrajectoryTable.d.ts +12 -4
- package/lib/types/client/TrajectoryTimeline.d.ts +3 -1
- package/lib/types/client/TrajectoryTurn.d.ts +4 -1
- package/lib/types/client/TrajectoryTurnHeader.d.ts +4 -1
- package/lib/types/client/TrajectoryView.d.ts +5 -4
- package/lib/types/client/copy-codes.d.ts +4 -0
- package/lib/types/client/duration-store.d.ts +1 -1
- package/lib/types/client/index.d.ts +2 -0
- package/lib/types/client/layout.d.ts +10 -6
- package/lib/types/client/locales.d.ts +185 -8
- package/lib/types/client/timeline.d.ts +3 -1
- package/lib/types/client/trajectory-contract.d.ts +25 -2
- package/lib/types/client/trajectory-definition-common.d.ts +1 -1
- package/lib/types/client/trajectory-event-projection.d.ts +51 -0
- package/lib/types/client/trajectory-record.d.ts +8 -5
- package/lib/types/client/trajectory-snapshot-builder.d.ts +1 -1
- package/package.json +24 -22
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { formatElapsedSeconds, type TrajectoryCellProps } from './trajectory-record.ts';
|
|
2
|
+
import type { TrajectoryTranslate } from './locales.ts';
|
|
2
3
|
export { formatElapsedSeconds };
|
|
3
4
|
export type { AssistantMetricDetail, TrajectoryCellKind, TrajectoryCellProps, } from './trajectory-record.ts';
|
|
4
5
|
/**
|
|
@@ -6,5 +7,7 @@ export type { AssistantMetricDetail, TrajectoryCellKind, TrajectoryCellProps, }
|
|
|
6
7
|
* @param props - index, kind, text, time, and optional Message metrics.
|
|
7
8
|
* @returns the cell element.
|
|
8
9
|
*/
|
|
9
|
-
export declare function TrajectoryCell({ 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, isError: _isError, timeSeconds, startedAt: _startedAt, input, output, think, selected, className, ...rest }: TrajectoryCellProps
|
|
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, isError: _isError, timeSeconds, startedAt: _startedAt, input, output, think, selected, className, ...rest }: TrajectoryCellProps & {
|
|
11
|
+
t: TrajectoryTranslate;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
10
13
|
//# sourceMappingURL=TrajectoryCell.d.ts.map
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
/** Turn-aware trajectory event ledger with a local record inspector. */
|
|
2
|
-
import type { AssistantRequestConfig } from '@deepseek-ai/dsh-client-
|
|
2
|
+
import type { AssistantRequestConfig, RenderMessageImages } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
3
3
|
import type { TrajectoryCellProps } from './trajectory-record.ts';
|
|
4
4
|
import type { TrajectoryTurnModel } from './layout.ts';
|
|
5
|
+
import type { TrajectoryTranslate } from './locales.ts';
|
|
5
6
|
/** Props for the trajectory ledger. */
|
|
6
7
|
export interface TrajectoryTableProps {
|
|
8
|
+
/** Trajectory locale seat. */
|
|
9
|
+
t: TrajectoryTranslate;
|
|
10
|
+
/** Slot-backed durable image renderer shared with the Chat gallery. */
|
|
11
|
+
renderImages: RenderMessageImages;
|
|
7
12
|
/** Session-global request numbers for the request groups visible in this context. */
|
|
8
13
|
requestNumbers?: readonly TrajectoryRequestNumber[];
|
|
9
14
|
/** Grouped records in display order. */
|
|
@@ -53,14 +58,13 @@ export interface TrajectoryTableProps {
|
|
|
53
58
|
}
|
|
54
59
|
/** Request-inspector fields shared by ordinary generation and compaction. */
|
|
55
60
|
interface TrajectoryRequestNumberBase {
|
|
56
|
-
/** Request anchor event sequence; absent for the currently streaming ordinary request. */
|
|
57
|
-
seq?: number;
|
|
58
61
|
group: string;
|
|
59
62
|
number: number;
|
|
60
63
|
status?: 'complete' | 'running' | 'error';
|
|
61
64
|
startedAt?: number;
|
|
62
65
|
completedAt?: number | null;
|
|
63
66
|
error?: string;
|
|
67
|
+
errorCode?: string;
|
|
64
68
|
retry?: number;
|
|
65
69
|
maxRetries?: number;
|
|
66
70
|
retryDelayMs?: number;
|
|
@@ -74,10 +78,14 @@ interface TrajectoryRequestNumberBase {
|
|
|
74
78
|
/** One purpose-discriminated request identity paired with its session-global number. */
|
|
75
79
|
export type TrajectoryRequestNumber = TrajectoryRequestNumberBase & ({
|
|
76
80
|
purpose?: 'assistant';
|
|
81
|
+
/** Request anchor event sequence; absent for the currently streaming request. */
|
|
82
|
+
seq?: number;
|
|
77
83
|
turn: number;
|
|
78
84
|
step: number;
|
|
79
85
|
} | {
|
|
80
86
|
purpose: 'compaction';
|
|
87
|
+
/** Request anchor event sequence and stable compaction identity. */
|
|
88
|
+
seq: number;
|
|
81
89
|
turn: number | null;
|
|
82
90
|
step: 0;
|
|
83
91
|
});
|
|
@@ -95,6 +103,6 @@ export interface TrajectoryUsage {
|
|
|
95
103
|
* @param props - Grouped trajectory data and whole-ledger fold state.
|
|
96
104
|
* @returns The ledger and an optional local record inspector.
|
|
97
105
|
*/
|
|
98
|
-
export declare function TrajectoryTable({ 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;
|
|
106
|
+
export declare function TrajectoryTable({ t, 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;
|
|
99
107
|
export {};
|
|
100
108
|
//# sourceMappingURL=TrajectoryTable.d.ts.map
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/** Chrome-Network-style overview timeline for focusing the trajectory ledger. */
|
|
2
2
|
import type { TrajectoryTurnModel } from './layout.ts';
|
|
3
|
+
import type { TrajectoryTranslate } from './locales.ts';
|
|
3
4
|
import { type TrajectoryTimelineMode, type TrajectoryTimeRange } from './timeline.ts';
|
|
4
5
|
/** Props for the fixed full-domain overview above the trajectory ledger. */
|
|
5
6
|
export interface TrajectoryTimelineProps {
|
|
7
|
+
t: TrajectoryTranslate;
|
|
6
8
|
turns: readonly TrajectoryTurnModel[];
|
|
7
9
|
mode: TrajectoryTimelineMode;
|
|
8
10
|
range: TrajectoryTimeRange | null;
|
|
@@ -20,5 +22,5 @@ export interface TrajectoryTimelineProps {
|
|
|
20
22
|
onRecordFocus?: (index: number) => void;
|
|
21
23
|
}
|
|
22
24
|
/** Overview renderer with drag ranges, click-sized focus, and Escape reset. */
|
|
23
|
-
export declare const TrajectoryTimeline: import("react").MemoExoticComponent<({ turns, mode, range, hasEarlierRecords, onLoadEarlier, selectedIndex, searchMatchIndexes, onRangeChange, onRecordSelect, onRecordFocus, }: TrajectoryTimelineProps) => import("react").JSX.Element>;
|
|
25
|
+
export declare const TrajectoryTimeline: import("react").MemoExoticComponent<({ t, turns, mode, range, hasEarlierRecords, onLoadEarlier, selectedIndex, searchMatchIndexes, onRangeChange, onRecordSelect, onRecordFocus, }: TrajectoryTimelineProps) => import("react").JSX.Element>;
|
|
24
26
|
//# sourceMappingURL=TrajectoryTimeline.d.ts.map
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { TrajectoryTranslate } from './locales.ts';
|
|
2
3
|
export interface TrajectoryTurnProps {
|
|
3
4
|
/** 1-based turn index for the sticky header. */
|
|
4
5
|
turn: number;
|
|
5
6
|
/** Message / Step headers and TrajectoryCell rows. */
|
|
6
7
|
children?: ReactNode;
|
|
8
|
+
/** Trajectory locale seat. */
|
|
9
|
+
t: TrajectoryTranslate;
|
|
7
10
|
}
|
|
8
11
|
/**
|
|
9
12
|
* Render one turn section (sticky header + body).
|
|
10
13
|
* @param props - turn index and body children.
|
|
11
14
|
* @returns the turn section element.
|
|
12
15
|
*/
|
|
13
|
-
export declare function TrajectoryTurn({ turn, children }: TrajectoryTurnProps): import("react").JSX.Element;
|
|
16
|
+
export declare function TrajectoryTurn({ turn, children, t }: TrajectoryTurnProps): import("react").JSX.Element;
|
|
14
17
|
//# sourceMappingURL=TrajectoryTurn.d.ts.map
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import type { TrajectoryTranslate } from './locales.ts';
|
|
1
2
|
export interface TrajectoryTurnHeaderProps {
|
|
2
3
|
/** 1-based turn index shown as `Turn N`. */
|
|
3
4
|
turn: number;
|
|
5
|
+
/** Trajectory locale seat. */
|
|
6
|
+
t: TrajectoryTranslate;
|
|
4
7
|
}
|
|
5
8
|
/**
|
|
6
9
|
* Render the sticky turn header row.
|
|
7
10
|
* @param props.turn - turn index.
|
|
8
11
|
* @returns the sticky header element.
|
|
9
12
|
*/
|
|
10
|
-
export declare function TrajectoryTurnHeader({ turn }: TrajectoryTurnHeaderProps): import("react").JSX.Element;
|
|
13
|
+
export declare function TrajectoryTurnHeader({ turn, t }: TrajectoryTurnHeaderProps): import("react").JSX.Element;
|
|
11
14
|
//# sourceMappingURL=TrajectoryTurnHeader.d.ts.map
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/** Trajectory view: compact summary over a turn-aware event ledger. */
|
|
2
|
-
import type { ConvViewProps } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
3
|
-
import type { InjectFace, PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
4
|
-
import type { SnapshotStore } from '@deepseek-ai/dsh-client-
|
|
2
|
+
import type { ConvViewProps, MessageImageLoader } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
3
|
+
import type { InjectFace, PropsLocale, PropsRenderSlots } from '@deepseek-ai/dsh-client-ui-slots';
|
|
4
|
+
import type { SnapshotStore } from '@deepseek-ai/dsh-client-store';
|
|
5
5
|
/** Session-bound controls not already supplied by the conversation view slot. */
|
|
6
6
|
export interface TrajectoryViewInjected {
|
|
7
7
|
hooks: {
|
|
8
8
|
duration: SnapshotStore<boolean>;
|
|
9
9
|
};
|
|
10
10
|
loadOlder: () => Promise<boolean>;
|
|
11
|
+
loadImage: MessageImageLoader;
|
|
11
12
|
setActualDuration: (actualDuration: boolean) => void;
|
|
12
13
|
}
|
|
13
|
-
export declare function TrajectoryView({ useSession, useDuration, loadOlder, setActualDuration,
|
|
14
|
+
export declare function TrajectoryView({ useSession, useTrajectory, useDuration, loadOlder, loadImage, setActualDuration, viewRequest, completeViewRequest, renderSlot, t, }: ConvViewProps & PropsRenderSlots<'conversation.trajectory.images'> & InjectFace<TrajectoryViewInjected> & PropsLocale<'trajectory'>): import("react").JSX.Element;
|
|
14
15
|
//# sourceMappingURL=TrajectoryView.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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type SnapshotStore } from '@deepseek-ai/dsh-client-
|
|
1
|
+
import { type SnapshotStore } from '@deepseek-ai/dsh-client-store';
|
|
2
2
|
/**
|
|
3
3
|
* Create the browser-wide trajectory duration preference source.
|
|
4
4
|
* @returns a persisted source shared by every session view in one plugin lifecycle.
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* slot without defining a service.
|
|
4
4
|
*/
|
|
5
5
|
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
+
export type { TrajectoryKey } from './locales.ts';
|
|
7
|
+
export type { TrajectoryContribution, TrajectoryConversationViewNode, TrajectoryRequestHeaderState, TrajectorySnapshot, UseTrajectory, } from './trajectory-contract.ts';
|
|
6
8
|
/** Required services: the conversation slot, registries, ordinary Session paging, and the locale service. */
|
|
7
9
|
export declare const inject: string[];
|
|
8
10
|
/**
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
* Trajectory list fold: expand assistant blocks, attach usage to Message,
|
|
3
3
|
* own-duration times, in-flight partial/runningCalls, and group descriptions.
|
|
4
4
|
*/
|
|
5
|
-
import type { ConversationLocation,
|
|
5
|
+
import type { ConversationLocation, RequestInspectionSnapshot, RequestView } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
6
6
|
import type { TrajectoryCellProps } from './trajectory-record.ts';
|
|
7
|
+
import type { TrajectorySnapshot } from './trajectory-contract.ts';
|
|
8
|
+
import type { TrajectoryTranslate } from './locales.ts';
|
|
7
9
|
/** One Message or Step group inside a turn. */
|
|
8
10
|
export interface TrajectoryGroupModel {
|
|
9
11
|
title: string;
|
|
@@ -17,25 +19,27 @@ export interface TrajectoryTurnModel {
|
|
|
17
19
|
}
|
|
18
20
|
/** Snapshot slice the trajectory view folds. */
|
|
19
21
|
export interface TrajectoryLayoutInput {
|
|
20
|
-
nodes:
|
|
22
|
+
nodes: TrajectorySnapshot['eventNodes'];
|
|
21
23
|
eventLocations?: ReadonlyMap<number, ConversationLocation>;
|
|
22
|
-
partial:
|
|
23
|
-
runningCalls:
|
|
24
|
+
partial: TrajectorySnapshot['partial'];
|
|
25
|
+
runningCalls: TrajectorySnapshot['runningCalls'];
|
|
24
26
|
requests?: readonly RequestView[];
|
|
25
27
|
callSchemas?: RequestInspectionSnapshot['callSchemas'];
|
|
26
28
|
}
|
|
27
29
|
/**
|
|
28
30
|
* Fold a snapshot into turn → Message/Step groups with expanded cells.
|
|
29
31
|
* @param input - nodes plus in-flight partial/runningCalls.
|
|
32
|
+
* @param t - Trajectory locale translator.
|
|
30
33
|
* @returns turns ordered by first appearance.
|
|
31
34
|
*/
|
|
32
|
-
export declare function deriveTrajectoryLayout(input: TrajectoryLayoutInput): readonly TrajectoryTurnModel[];
|
|
35
|
+
export declare function deriveTrajectoryLayout(input: TrajectoryLayoutInput, t: TrajectoryTranslate): readonly TrajectoryTurnModel[];
|
|
33
36
|
/**
|
|
34
37
|
* Append the changing in-flight assistant cells to a stable finalized layout.
|
|
35
38
|
* @param turns - Finalized layout derived with an empty-block partial anchor.
|
|
36
39
|
* @param partial - Current in-flight assistant projection.
|
|
37
40
|
* @param lastIndex - Highest cell index in the finalized layout.
|
|
41
|
+
* @param t - Trajectory locale translator.
|
|
38
42
|
* @returns The original layout without a partial, otherwise a layout sharing every unaffected turn.
|
|
39
43
|
*/
|
|
40
|
-
export declare function appendTrajectoryPartialLayout(turns: readonly TrajectoryTurnModel[], partial:
|
|
44
|
+
export declare function appendTrajectoryPartialLayout(turns: readonly TrajectoryTurnModel[], partial: TrajectorySnapshot['partial'], lastIndex: number, t: TrajectoryTranslate): readonly TrajectoryTurnModel[];
|
|
41
45
|
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -1,16 +1,193 @@
|
|
|
1
|
-
/** `trajectory` namespace dictionaries
|
|
1
|
+
/** `trajectory` namespace dictionaries for the complete trajectory surface. */
|
|
2
2
|
/** Dictionary namespace owned by this plugin. */
|
|
3
3
|
export declare const NS = "trajectory";
|
|
4
|
-
/**
|
|
5
|
-
export
|
|
4
|
+
/** Simplified Chinese dictionary (the key-set source of truth). */
|
|
5
|
+
export declare const zh: {
|
|
6
|
+
readonly 'view.trajectory': "轨迹";
|
|
7
|
+
readonly 'toolbar.aria': "轨迹工具栏";
|
|
8
|
+
readonly 'toolbar.duration': "时长";
|
|
9
|
+
readonly 'toolbar.useActualDuration': "使用实际时长";
|
|
10
|
+
readonly 'toolbar.useEqualWidth': "使用等宽操作";
|
|
11
|
+
readonly 'toolbar.actualTime': "实际时间";
|
|
12
|
+
readonly 'toolbar.turns': "轮次";
|
|
13
|
+
readonly 'toolbar.expandTurns': "展开所有轮次";
|
|
14
|
+
readonly 'toolbar.collapseTurns': "收起所有轮次";
|
|
15
|
+
readonly 'toolbar.calls': "调用";
|
|
16
|
+
readonly 'toolbar.expandCalls': "展开所有调用";
|
|
17
|
+
readonly 'toolbar.collapseCalls': "收起所有调用";
|
|
18
|
+
readonly 'toolbar.search': "搜索轨迹";
|
|
19
|
+
readonly 'toolbar.searchPlaceholder': "搜索";
|
|
20
|
+
readonly 'kind.system': "系统";
|
|
21
|
+
readonly 'kind.user': "用户";
|
|
22
|
+
readonly 'kind.context': "上下文";
|
|
23
|
+
readonly 'kind.compacted': "已压缩";
|
|
24
|
+
readonly 'kind.message': "消息";
|
|
25
|
+
readonly 'kind.assistant': "助手";
|
|
26
|
+
readonly 'kind.tool': "工具";
|
|
27
|
+
readonly 'kind.subtool': "子工具";
|
|
28
|
+
readonly 'kind.sub': "子项";
|
|
29
|
+
readonly 'column.input': "输入";
|
|
30
|
+
readonly 'column.output': "输出";
|
|
31
|
+
readonly 'column.think': "思考";
|
|
32
|
+
readonly 'column.time': "时间";
|
|
33
|
+
readonly 'column.model': "模型";
|
|
34
|
+
readonly 'column.tools': "工具";
|
|
35
|
+
readonly 'turn.label': "第 {turn} 轮";
|
|
36
|
+
readonly 'section.betweenTurns': "轮次之间";
|
|
37
|
+
readonly 'group.message': "消息";
|
|
38
|
+
readonly 'group.step': "步骤 {step}";
|
|
39
|
+
readonly 'group.compaction': "压缩 {seq}";
|
|
40
|
+
readonly 'status.failed': "失败";
|
|
41
|
+
readonly 'status.pending': "等待中";
|
|
42
|
+
readonly 'status.completed': "已完成";
|
|
43
|
+
readonly 'timing.notAvailable': "不可用";
|
|
44
|
+
readonly 'timing.notRecorded': "未记录";
|
|
45
|
+
readonly 'timing.stepStartUnavailable': "步骤开始时间不可用";
|
|
46
|
+
readonly 'timing.firstTokenUnavailable': "首 token 时间不可用";
|
|
47
|
+
readonly 'timing.usageUnavailable': "用量不可用";
|
|
48
|
+
readonly 'timing.outputTokensUnavailable': "输出 token 数不可用";
|
|
49
|
+
readonly 'timing.durationTooShort': "时长过短";
|
|
50
|
+
readonly 'timing.showLocalTime': "显示本地时间";
|
|
51
|
+
readonly 'timing.showUnixTimestamp': "显示 Unix 时间戳";
|
|
52
|
+
readonly 'timing.started': "开始时间";
|
|
53
|
+
readonly 'timing.totalDuration': "总时长";
|
|
54
|
+
readonly 'timing.ttft': "首 token 延迟";
|
|
55
|
+
readonly 'timing.generation': "生成";
|
|
56
|
+
readonly 'timing.throughput': "吞吐量";
|
|
57
|
+
readonly 'timing.duration': "时长";
|
|
58
|
+
readonly 'timing.source': "计时来源";
|
|
59
|
+
readonly 'timing.sessionTimestamps': "会话时间戳";
|
|
60
|
+
readonly 'timing.sessionTimestampsRunning': "会话时间戳(运行中)";
|
|
61
|
+
readonly 'timing.request': "请求计时";
|
|
62
|
+
readonly 'unit.milliseconds': "{value} 毫秒";
|
|
63
|
+
readonly 'unit.seconds': "{value} 秒";
|
|
64
|
+
readonly 'unit.tokens': "{value} tok";
|
|
65
|
+
readonly 'unit.tokensPerSecond': "{value} tok/s";
|
|
66
|
+
readonly 'usage.tokens': "Token";
|
|
67
|
+
readonly 'usage.reasoning': "推理";
|
|
68
|
+
readonly 'usage.content': "内容";
|
|
69
|
+
readonly 'usage.notReported': "未报告用量";
|
|
70
|
+
readonly 'usage.input': "输入";
|
|
71
|
+
readonly 'usage.cached': "缓存读取";
|
|
72
|
+
readonly 'usage.cacheCreated': "缓存写入";
|
|
73
|
+
readonly 'usage.other': "其他";
|
|
74
|
+
readonly 'usage.output': "输出";
|
|
75
|
+
readonly 'usage.thisRequest': "本次请求";
|
|
76
|
+
readonly 'usage.sessionCumulative': "会话累计";
|
|
77
|
+
readonly 'options.notRecorded': "未记录选项";
|
|
78
|
+
readonly 'options.json': "请求选项 JSON";
|
|
79
|
+
readonly 'source.unknown': "未知";
|
|
80
|
+
readonly 'source.user': "用户";
|
|
81
|
+
readonly 'source.plugin': "插件";
|
|
82
|
+
readonly 'source.pluginNamed': "插件 · {plugin}";
|
|
83
|
+
readonly 'source.goal': "目标";
|
|
84
|
+
readonly 'source.goalRound': "目标 · Round {round}";
|
|
85
|
+
readonly 'source.notRecorded': "未记录来源";
|
|
86
|
+
readonly 'source.messageJson': "消息来源 JSON";
|
|
87
|
+
readonly 'tab.summary': "概述";
|
|
88
|
+
readonly 'tab.rawOutput': "原始输出";
|
|
89
|
+
readonly 'tab.preview': "预览";
|
|
90
|
+
readonly 'tab.raw': "原始内容";
|
|
91
|
+
readonly 'tab.source': "来源";
|
|
92
|
+
readonly 'tab.payload': "参数";
|
|
93
|
+
readonly 'tab.result': "结果";
|
|
94
|
+
readonly 'tab.schema': "Schema";
|
|
95
|
+
readonly 'tab.timing': "计时";
|
|
96
|
+
readonly 'tab.diff': "差异";
|
|
97
|
+
readonly 'tab.systemPrompt': "系统提示词";
|
|
98
|
+
readonly 'tab.tools': "工具";
|
|
99
|
+
readonly 'tab.options': "选项";
|
|
100
|
+
readonly 'tab.usage': "用量";
|
|
101
|
+
readonly 'record.toolCallOnly': "(仅工具调用)";
|
|
102
|
+
readonly 'record.noContent': "无内容";
|
|
103
|
+
readonly 'record.noPayload': "未捕获参数";
|
|
104
|
+
readonly 'record.noResult': "未捕获结果";
|
|
105
|
+
readonly 'record.noOutput': "无输出";
|
|
106
|
+
readonly 'record.schemaUnavailable': "Schema 不可用";
|
|
107
|
+
readonly 'record.parameters': "参数";
|
|
108
|
+
readonly 'record.resultJson': "结果 JSON";
|
|
109
|
+
readonly 'record.json': "JSON";
|
|
110
|
+
readonly 'record.parametersJson': "参数 JSON";
|
|
111
|
+
readonly 'record.namedParametersJson': "{name} 参数 JSON";
|
|
112
|
+
readonly 'record.payloadJson': "参数 JSON";
|
|
113
|
+
readonly 'record.outputJson': "结果 JSON";
|
|
114
|
+
readonly 'record.thinking': "思考";
|
|
115
|
+
readonly 'record.systemPromptMissing': "本次请求没有系统提示词";
|
|
116
|
+
readonly 'record.toolsMissing': "本次请求没有工具";
|
|
117
|
+
readonly 'record.systemPrompt': "系统提示词";
|
|
118
|
+
readonly 'record.tools': "工具";
|
|
119
|
+
readonly 'block.openSummary': "打开第 {index} 个块的工具调用概述";
|
|
120
|
+
readonly 'block.openSummaryTitle': "打开工具调用概述";
|
|
121
|
+
readonly 'block.label': "块 #{index} {type}";
|
|
122
|
+
readonly 'history.loadingTrajectory': "正在加载轨迹…";
|
|
123
|
+
readonly 'history.loadingEarlier': "正在加载更早的历史…";
|
|
124
|
+
readonly 'history.loadingEarlierAria': "正在加载更早的历史…";
|
|
125
|
+
readonly 'history.loadEarlier': "加载更早的历史";
|
|
126
|
+
readonly 'history.clickToLoadEarlier': "点击加载更早的历史";
|
|
127
|
+
readonly 'request.label': "请求 #{request}";
|
|
128
|
+
readonly 'request.labelCompaction': "请求 #{request} · 压缩";
|
|
129
|
+
readonly 'request.compaction': "压缩 · {section}";
|
|
130
|
+
readonly 'request.compactionPurpose': "压缩";
|
|
131
|
+
readonly 'request.retryProgress': "{retry}/{maximum}";
|
|
132
|
+
readonly 'request.collapsedSummary': "已收起的{kind}概述,{summary}";
|
|
133
|
+
readonly 'request.collapsedTurn': "轮次";
|
|
134
|
+
readonly 'request.collapsedAssistant': "助手";
|
|
135
|
+
readonly 'request.rowAria': "{request}{kind},{content}";
|
|
136
|
+
readonly 'request.rowPrefix': "请求 {request},";
|
|
137
|
+
readonly 'request.rowAriaCompaction': "请求 {request},压缩";
|
|
138
|
+
readonly 'request.noContent': "无内容";
|
|
139
|
+
readonly 'summary.toolCalls.one': "{count} 个工具调用";
|
|
140
|
+
readonly 'summary.toolCalls.other': "{count} 个工具调用";
|
|
141
|
+
readonly 'summary.steps.one': "{count} 个步骤";
|
|
142
|
+
readonly 'summary.steps.other': "{count} 个步骤";
|
|
143
|
+
readonly 'details.event': "事件详情";
|
|
144
|
+
readonly 'details.resize': "调整事件详情宽度";
|
|
145
|
+
readonly 'details.resizeTitle': "拖动调整大小;双击恢复默认值。";
|
|
146
|
+
readonly 'details.close': "关闭详情";
|
|
147
|
+
readonly 'details.status': "状态";
|
|
148
|
+
readonly 'details.purpose': "用途";
|
|
149
|
+
readonly 'details.provider': "提供方";
|
|
150
|
+
readonly 'details.model': "模型";
|
|
151
|
+
readonly 'details.toolCalls': "工具调用";
|
|
152
|
+
readonly 'details.subtoolCalls': "子工具调用";
|
|
153
|
+
readonly 'details.error': "错误";
|
|
154
|
+
readonly 'details.failure.auth': "API 密钥无效";
|
|
155
|
+
readonly 'details.retry': "重试";
|
|
156
|
+
readonly 'details.scheduled': "已计划";
|
|
157
|
+
readonly 'details.retryDelay': "重试延迟";
|
|
158
|
+
readonly 'details.result': "结果";
|
|
159
|
+
readonly 'details.compacted': "已压缩";
|
|
160
|
+
readonly 'details.assistantMessage': "助手消息";
|
|
161
|
+
readonly 'details.source': "来源";
|
|
162
|
+
readonly 'details.hierarchy': "层级";
|
|
163
|
+
readonly 'details.toolCall': "工具调用";
|
|
164
|
+
readonly 'timeline.aria': "轨迹时间线";
|
|
165
|
+
readonly 'timeline.overviewAria': "时间线概览;水平拖动可聚焦事件";
|
|
166
|
+
readonly 'timeline.noTimingData': "无计时数据";
|
|
167
|
+
readonly 'timeline.total': "总计 {duration}";
|
|
168
|
+
readonly 'timeline.started': "开始于 {time}";
|
|
169
|
+
readonly 'timeline.ttftDecoding': "首 token {ttft} · 解码 {decoding}";
|
|
170
|
+
readonly 'layout.compacting': "正在压缩上下文…";
|
|
171
|
+
readonly 'layout.compactionFailed': "上下文压缩失败";
|
|
172
|
+
readonly 'layout.compacted': "上下文已压缩";
|
|
173
|
+
readonly 'layout.toolCallOnly': "仅工具调用";
|
|
174
|
+
readonly 'layout.imageOnly': "图片 ×{count}";
|
|
175
|
+
readonly 'layout.initialSystemPrompt': "初始系统提示词";
|
|
176
|
+
readonly 'layout.systemPromptUpdated': "系统提示词已更新";
|
|
177
|
+
readonly 'layout.toolsUpdated': "工具已更新";
|
|
178
|
+
readonly 'layout.systemPromptAndToolsUpdated': "系统提示词和工具已更新";
|
|
179
|
+
readonly 'layout.compactionInterrupted': "上下文压缩在完成前被中断。";
|
|
180
|
+
};
|
|
181
|
+
/** The trajectory dictionary key union. */
|
|
182
|
+
export type TrajectoryKey = keyof typeof zh;
|
|
6
183
|
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
7
184
|
interface LocaleNamespaceMap {
|
|
8
|
-
/** The trajectory
|
|
9
|
-
|
|
185
|
+
/** The complete trajectory ledger, timeline, inspector, and toolbar copy. */
|
|
186
|
+
trajectory: TrajectoryKey;
|
|
10
187
|
}
|
|
11
188
|
}
|
|
12
|
-
/**
|
|
13
|
-
export
|
|
14
|
-
/** English dictionary. */
|
|
189
|
+
/** Namespace-bound translator threaded through trajectory presentation code. */
|
|
190
|
+
export type TrajectoryTranslate = import('@deepseek-ai/dsh-client-ui-slots').TranslateNS<typeof NS>;
|
|
191
|
+
/** English dictionary, checked complete against the Chinese source of truth. */
|
|
15
192
|
export declare const en: Record<TrajectoryKey, string>;
|
|
16
193
|
//# sourceMappingURL=locales.d.ts.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Operation-sequence and recorded-time projections for the trajectory overview. */
|
|
2
2
|
import type { TrajectoryTurnModel } from './layout.ts';
|
|
3
|
+
import type { TrajectoryTranslate } from './locales.ts';
|
|
3
4
|
import type { TrajectoryCellKind } from './trajectory-record.ts';
|
|
4
5
|
/** Horizontal projection used by the trajectory timeline. */
|
|
5
6
|
export type TrajectoryTimelineMode = 'sequence' | 'duration' | 'time' | 'actual';
|
|
@@ -29,9 +30,10 @@ export interface TrajectoryTimelineModel extends TrajectoryTimeRange {
|
|
|
29
30
|
/**
|
|
30
31
|
* Format a timeline duration as an integer-millisecond label.
|
|
31
32
|
* @param milliseconds - Non-negative duration in milliseconds.
|
|
33
|
+
* @param t - Trajectory locale translator.
|
|
32
34
|
* @returns Millisecond label with thousands separators.
|
|
33
35
|
*/
|
|
34
|
-
export declare function formatTimelineOffset(milliseconds: number): string;
|
|
36
|
+
export declare function formatTimelineOffset(milliseconds: number, t: TrajectoryTranslate): string;
|
|
35
37
|
/**
|
|
36
38
|
* Project every visible record into a stable three-lane timeline.
|
|
37
39
|
* @param turns - Unfiltered trajectory layout.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { AssistantMessageNode, ConversationLocation, ConversationNode, ConversationPromptSnapshot, ConversationViewNode, PartialAssistant, RequestPromptChange, RequestView, RunningToolCall, ToolCallBlock } from '@deepseek-ai/dsh-client-
|
|
1
|
+
import type { AssistantMessageNode, ConversationLocation, ConversationNode, ConversationPromptSnapshot, ConversationViewNode, MessageImagesOwnerProps, PartialAssistant, RequestPromptChange, RequestView, RunningToolCall, ToolCallBlock } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
2
|
+
import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-ui-slots';
|
|
2
3
|
/** Request-header facts retained by the Trajectory target. */
|
|
3
4
|
export interface TrajectoryRequestHeaderState {
|
|
4
5
|
readonly seq: number;
|
|
@@ -38,6 +39,7 @@ export type TrajectoryContribution = {
|
|
|
38
39
|
readonly turn: number;
|
|
39
40
|
readonly time: number;
|
|
40
41
|
readonly error?: string;
|
|
42
|
+
readonly errorCode?: string;
|
|
41
43
|
};
|
|
42
44
|
/** Target envelope consumed by the Trajectory snapshot builder. */
|
|
43
45
|
export interface TrajectoryConversationViewNode extends ConversationViewNode {
|
|
@@ -55,10 +57,31 @@ export interface TrajectorySnapshot {
|
|
|
55
57
|
readonly partial: PartialAssistant | null;
|
|
56
58
|
readonly runningCalls: readonly RunningToolCall[];
|
|
57
59
|
}
|
|
58
|
-
|
|
60
|
+
/** Selector hook over the current Conversation binding's Trajectory target. */
|
|
61
|
+
export type UseTrajectory = SnapshotSelectorHook<TrajectorySnapshot>;
|
|
62
|
+
declare module '@deepseek-ai/dsh-client-ui-conversation/client' {
|
|
59
63
|
interface ConversationViewSnapshotMap {
|
|
60
64
|
/** Independently assembled data consumed by the Trajectory view. */
|
|
61
65
|
trajectory: TrajectorySnapshot;
|
|
62
66
|
}
|
|
63
67
|
}
|
|
68
|
+
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
69
|
+
interface SessionStandardProps {
|
|
70
|
+
/** Selector hook over the current Conversation binding's Trajectory target. */
|
|
71
|
+
useTrajectory: UseTrajectory;
|
|
72
|
+
}
|
|
73
|
+
interface SlotMap {
|
|
74
|
+
/**
|
|
75
|
+
* Renderer for one group of durable record images in the Trajectory
|
|
76
|
+
* ledger. The owner supplies image references, an authorized loader, and
|
|
77
|
+
* alignment. A registration replaces the shipped gallery; without one,
|
|
78
|
+
* images are omitted.
|
|
79
|
+
*/
|
|
80
|
+
'conversation.trajectory.images': {
|
|
81
|
+
kind: 'single';
|
|
82
|
+
scope: 'session';
|
|
83
|
+
owner: MessageImagesOwnerProps;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
64
87
|
//# sourceMappingURL=trajectory-contract.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConversationNodeContext } from '@deepseek-ai/dsh-client-
|
|
1
|
+
import type { ConversationNodeContext } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
2
2
|
import type { TrajectoryContribution, TrajectoryConversationViewNode } from './trajectory-contract.ts';
|
|
3
3
|
/**
|
|
4
4
|
* Wrap one contribution in the Engine-owned target envelope.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** Trajectory-owned conversion from durable Session events to ledger view data. */
|
|
2
|
+
import type { ContentBlock, StreamChunk } from '@deepseek-ai/dsh-llm/types';
|
|
3
|
+
import type { AssistantBlock, ContextProvenanceView, KnownContextForm } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
4
|
+
/**
|
|
5
|
+
* Read the target-supported presentation form from a durable message source.
|
|
6
|
+
* @param source - Logged `user/message` source.
|
|
7
|
+
* @returns Supported form, or null for the opaque presentation.
|
|
8
|
+
*/
|
|
9
|
+
export declare function contextForm(source: unknown): KnownContextForm | null;
|
|
10
|
+
/**
|
|
11
|
+
* Project a durable message source to the Trajectory row's role and producer label.
|
|
12
|
+
* @param source - Logged `user/message` source.
|
|
13
|
+
* @returns Role and label rendered by Trajectory.
|
|
14
|
+
*/
|
|
15
|
+
export declare function contextProvenance(source: unknown): ContextProvenanceView;
|
|
16
|
+
/**
|
|
17
|
+
* Classify finalized Assistant content for Trajectory rendering.
|
|
18
|
+
* @param content - Core content blocks.
|
|
19
|
+
* @returns Trajectory blocks in source order.
|
|
20
|
+
*/
|
|
21
|
+
export declare function toAssistantBlocks(content: readonly ContentBlock[]): AssistantBlock[];
|
|
22
|
+
/**
|
|
23
|
+
* Classify one finalized Assistant block for Trajectory rendering.
|
|
24
|
+
* @param block - Core content block.
|
|
25
|
+
* @returns Trajectory block.
|
|
26
|
+
*/
|
|
27
|
+
export declare function toAssistantBlock(block: ContentBlock): AssistantBlock;
|
|
28
|
+
/**
|
|
29
|
+
* Create the initial Trajectory block for one streamed Assistant block kind.
|
|
30
|
+
* @param blockType - Wire block kind.
|
|
31
|
+
* @returns Empty block ready to receive deltas.
|
|
32
|
+
*/
|
|
33
|
+
export declare function emptyAssistantBlock(blockType: string): AssistantBlock;
|
|
34
|
+
/** Display-safe failure fields retained by Trajectory projections. */
|
|
35
|
+
export interface DisplayFailure {
|
|
36
|
+
readonly code?: string;
|
|
37
|
+
readonly message: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Convert a durable failure to locale-independent fields safe for Trajectory.
|
|
41
|
+
* @param failure - Failure preserved by a Session event.
|
|
42
|
+
* @returns Sanitized message and optional stable provider code.
|
|
43
|
+
*/
|
|
44
|
+
export declare function displayFailure(failure: unknown): DisplayFailure;
|
|
45
|
+
/**
|
|
46
|
+
* Whether a stream chunk carries visible model output for Trajectory timing.
|
|
47
|
+
* @param chunk - Stream chunk to inspect.
|
|
48
|
+
* @returns true for a non-empty text, reasoning, or Tool-call delta.
|
|
49
|
+
*/
|
|
50
|
+
export declare function isTokenDelta(chunk: StreamChunk): boolean;
|
|
51
|
+
//# sourceMappingURL=trajectory-event-projection.d.ts.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/** Shared trajectory record data and formatting contracts. */
|
|
2
2
|
import type { HTMLAttributes } from 'react';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment';
|
|
4
|
+
import type { ConversationPromptSnapshot } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
5
|
+
import type { TrajectoryTranslate } from './locales.ts';
|
|
4
6
|
/** Closed set of trajectory record kinds. */
|
|
5
7
|
export type TrajectoryCellKind = 'system' | 'user' | 'context' | 'compacted' | 'message' | 'tool' | 'subtool';
|
|
6
8
|
/** Recorded inputs needed to derive assistant TTFT and decode throughput. */
|
|
@@ -16,8 +18,7 @@ export interface AssistantMetricDetail {
|
|
|
16
18
|
export interface TrajectorySourceBlock {
|
|
17
19
|
type: string;
|
|
18
20
|
content: string;
|
|
19
|
-
|
|
20
|
-
imageAlt?: string;
|
|
21
|
+
attachment?: ImageAttachmentRef;
|
|
21
22
|
callId?: string;
|
|
22
23
|
toolName?: string;
|
|
23
24
|
}
|
|
@@ -93,13 +94,15 @@ export declare function trajectoryRecordId(cell: TrajectoryCellProps): string;
|
|
|
93
94
|
/**
|
|
94
95
|
* Format a duration in milliseconds with thousands separators.
|
|
95
96
|
* @param milliseconds - Duration in milliseconds, or `null` when absent.
|
|
97
|
+
* @param t - Trajectory locale translator.
|
|
96
98
|
* @returns `—` when unknown, otherwise an integer-millisecond label.
|
|
97
99
|
*/
|
|
98
|
-
export declare function formatDurationMillis(milliseconds: number | null): string;
|
|
100
|
+
export declare function formatDurationMillis(milliseconds: number | null, t: TrajectoryTranslate): string;
|
|
99
101
|
/**
|
|
100
102
|
* Format an elapsed duration given in seconds as a millisecond label.
|
|
101
103
|
* @param seconds - Duration seconds, or `null` when absent.
|
|
104
|
+
* @param t - Trajectory locale translator.
|
|
102
105
|
* @returns `—` when unknown, otherwise an integer-millisecond label.
|
|
103
106
|
*/
|
|
104
|
-
export declare function formatElapsedSeconds(seconds: number | null): string;
|
|
107
|
+
export declare function formatElapsedSeconds(seconds: number | null, t: TrajectoryTranslate): string;
|
|
105
108
|
//# sourceMappingURL=trajectory-record.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
-
import type { ConversationViewBuilder, ConversationViewDefinition } from '@deepseek-ai/dsh-client-
|
|
2
|
+
import type { ConversationViewBuilder, ConversationViewDefinition } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
3
3
|
import type { TrajectoryConversationViewNode, TrajectorySnapshot } from './trajectory-contract.ts';
|
|
4
4
|
/** Stable empty target used until a Session has assembled Trajectory records. */
|
|
5
5
|
export declare const EMPTY_TRAJECTORY_SNAPSHOT: TrajectorySnapshot;
|