@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/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 kkutysllb
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.i18n.yaml
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Bilingual-pair consistency record for README.md (docs/i18n/README.md): per heading
|
|
2
|
+
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
|
|
3
|
+
# After editing either side, bring the other along and re-record with:
|
|
4
|
+
# pnpm run verify-translation-pairing --write packages/client/ui-trajectory/README.md
|
|
5
|
+
/:
|
|
6
|
+
en: 9e8cf8f505740df9
|
|
7
|
+
zh: ce5eda3f87570baf
|
|
8
|
+
/qilin-agent-client-ui-trajectory:
|
|
9
|
+
en: 81250b716b1c11d9
|
|
10
|
+
zh: 5cc8452664d26739
|
|
11
|
+
/qilin-agent-client-ui-trajectory/summary:
|
|
12
|
+
en: 44c94ae942ec0e48
|
|
13
|
+
zh: 228a55690253f89f
|
|
14
|
+
/qilin-agent-client-ui-trajectory/table-of-contents:
|
|
15
|
+
en: d152484eb41ac6b4
|
|
16
|
+
zh: 09388d293f9be9cb
|
|
17
|
+
/qilin-agent-client-ui-trajectory/use-this-package:
|
|
18
|
+
en: d8bfe28896432de7
|
|
19
|
+
zh: 27c883954a31f68f
|
|
20
|
+
/qilin-agent-client-ui-trajectory/use-this-package/inspecting-records:
|
|
21
|
+
en: b62f418514e57a53
|
|
22
|
+
zh: 94b532cfb9e6e1d4
|
|
23
|
+
/qilin-agent-client-ui-trajectory/use-this-package/the-timing-overview:
|
|
24
|
+
en: ed6608646aa6f081
|
|
25
|
+
zh: 00755f8b4da6018e
|
|
26
|
+
/qilin-agent-client-ui-trajectory/use-this-package/the-graph-view:
|
|
27
|
+
en: eb406a5bbe187f0c
|
|
28
|
+
zh: 60261fefa130800c
|
|
29
|
+
/qilin-agent-client-ui-trajectory/understand-the-implementation:
|
|
30
|
+
en: 9f2ca8fa5fa608f1
|
|
31
|
+
zh: 893c0c6d9be59b3c
|
|
32
|
+
/qilin-agent-client-ui-trajectory/understand-the-implementation/the-graph-projection:
|
|
33
|
+
en: 06806617ca60efd4
|
|
34
|
+
zh: 5596f32b758ee42f
|
|
35
|
+
/qilin-agent-client-ui-trajectory/understand-the-implementation/virtual-rows:
|
|
36
|
+
en: c85e342bc7eee4e6
|
|
37
|
+
zh: 3120813991ee7b4c
|
|
38
|
+
/qilin-agent-client-ui-trajectory/understand-the-implementation/layout:
|
|
39
|
+
en: d7128b491c4f7d83
|
|
40
|
+
zh: 2b5153f5f8ffc0a5
|
|
41
|
+
/qilin-agent-client-ui-trajectory/further-exploration:
|
|
42
|
+
en: 988b0137733592a2
|
|
43
|
+
zh: 676c63da1da83fe9
|
|
44
|
+
/qilin-agent-client-ui-trajectory/model-experience:
|
|
45
|
+
en: 3120df665299c634
|
|
46
|
+
zh: 1d9f365d091d0d2a
|
|
47
|
+
/qilin-agent-client-ui-trajectory/model-experience/kv-cache-effect:
|
|
48
|
+
en: ca75c51c89c2c9b0
|
|
49
|
+
zh: de54f3467ef3b9be
|
|
50
|
+
/qilin-agent-client-ui-trajectory/known-limitations-and-deferred-work:
|
|
51
|
+
en: 8db16dd7764e28b3
|
|
52
|
+
zh: 1a8ad2cbd3bd9ae1
|
|
53
|
+
/qilin-agent-client-ui-trajectory/known-limitations-and-deferred-work/dev-note:
|
|
54
|
+
en: e67f633dc6fe7773
|
|
55
|
+
zh: 3bb0c20c93f16f98
|
package/README.md
CHANGED
|
@@ -1,3 +1,121 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: "Trajectory pages for the qilin web client right Sidebar: a turn-aware event ledger with an interactive timing overview, and the graph view that draws the same ledger as a live node and edge flow."
|
|
3
|
+
kind: "package-reference"
|
|
4
|
+
---
|
|
2
5
|
|
|
3
|
-
|
|
6
|
+
# @qilin-agent/client-ui-trajectory
|
|
7
|
+
|
|
8
|
+
English | [中文](README.zh.md)
|
|
9
|
+
|
|
10
|
+
## Summary
|
|
11
|
+
|
|
12
|
+
The Trajectory tab in the right Sidebar inspects activity as a turn-aware ledger and timing overview; the Trajectory graph tab draws the records as a live node and edge flow. The ledger groups User, Assistant, Tool, nested Subtool, and compaction records, marks turn and step boundaries, and opens a record inspector for token usage, duration, input, output, timing, images, and attachments. Long histories open at the tail, load older pages on demand, and render visible rows only. While streaming, it follows the tail until you scroll upward, and in-flight records show a start marker without inventing elapsed time.
|
|
13
|
+
|
|
14
|
+
## Table of Contents
|
|
15
|
+
|
|
16
|
+
- [Use this package](#use-this-package)
|
|
17
|
+
- [Understand the implementation](#understand-the-implementation)
|
|
18
|
+
- [Further Exploration](#further-exploration)
|
|
19
|
+
- [Model Experience](#model-experience)
|
|
20
|
+
- [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
|
|
21
|
+
- [Dev Note](#dev-note)
|
|
22
|
+
|
|
23
|
+
-----
|
|
24
|
+
|
|
25
|
+
<a id="use-this-package"></a>
|
|
26
|
+
## Use this package
|
|
27
|
+
|
|
28
|
+
Open the Trajectory ledger from the graph page's Ledger control, or from a Chat tool card's inspect action, which focuses that call — the ledger type itself contributes no guide entry, so the Sidebar's guide lists the graph alone — to inspect agent activity as an event ledger and timeline. The ledger covers records with an explicit loading row until the initial tail is positioned; while an older prefix remains unloaded, a first-row control loads one earlier page on click and shows a disabled loading status while that page is pending.
|
|
29
|
+
|
|
30
|
+
### Inspecting records
|
|
31
|
+
|
|
32
|
+
Calls are identified by their recorded tool name. For `run_code`, the row shows the program description and the inspector opens numbered, highlighted source. The Code tab provides wrapping, a `{}` toggle for the original JSON arguments, and exact source copying, including trailing newlines. Copying the original arguments retains their recorded JSON whitespace. Each newly opened code view takes the last wrapping choice; changing it leaves other open views as they are. Output preserves the recorded text, using a tree for complete JSON objects or arrays. Highlighting uses only an unambiguous TypeScript or Python hint in the recorded tool schema; missing or conflicting hints leave plain source. See the [PTC inspection decision](../../../.agents/notes/implemented/feature/2026-09-09-ptc-trajectory-code-inspection.md) for replay constraints.
|
|
33
|
+
|
|
34
|
+
Selection, timeline navigation, folding, and search cover the React-visible window. Request numbers and cumulative usage cover the complete resident snapshot. Selecting a record opens a local inspector for token usage, duration, Input, Output, Timing, and durable images. Image URLs use the Conversation-owned per-session cache, so Chat and Trajectory share one authorized read per attachment. A user record shows both nonzero image and ordinary-file counts beside its text, including attachment-only records. A standalone compaction request appears chronologically in its own `Between turns` section, while a numbered compaction remains inside its owning turn.
|
|
35
|
+
|
|
36
|
+
Summary and Preview share one ordered attachment list after the message text, preserving repeated references. Each row shows a contained image thumbnail or file-type icon, the recorded filename (a localized numbered label for unnamed images), and recorded size, type, and image dimensions where available. Zero-byte files retain their size, and truncated filenames expose the full name in a tooltip. Images open the existing lightbox. Raw keeps content-block order and unrendered text, with images and files in initially collapsed disclosures containing their complete recorded fields.
|
|
37
|
+
|
|
38
|
+
Requests remain pending while awaiting output, streaming, or retrying. A request without assistant output has no result link; interrupted output remains inspectable and both the request and assistant record show failure, including when the Step start is outside the loaded history. Retry counts and the last attempt error remain available after recovery; they do not change the current request status. A completed model response does not imply that its tools or turn have finished.
|
|
39
|
+
|
|
40
|
+
Streaming replies retain their known start time and TTFT. After settlement, token timestamps provide generation duration, and throughput additionally requires recorded usage.
|
|
41
|
+
|
|
42
|
+
Thinking in the inspector uses compact Markdown at the inspector's fixed 13px size and 20px line height, independent of the content-size setting. Headings add bold weight without increasing size or line height. Assistant output keeps its regular Markdown typography.
|
|
43
|
+
|
|
44
|
+
### The timing overview
|
|
45
|
+
|
|
46
|
+
A fixed Overview above the ledger projects real record start/duration timing from left to right; Assistant spans divide recorded TTFT from decoding, and a 500 ms hover reveals exact clock and duration details. Dragging an interval focuses the ledger on every record active at any point in that inclusive range; wheel gestures zoom the time domain; a right-button click clears the selected interval, and a right-button drag pans an already zoomed viewport. The initial view and streaming updates stay at the tail; scrolling upward suspends following so new records do not interrupt inspection of earlier rows.
|
|
47
|
+
|
|
48
|
+
### The graph view
|
|
49
|
+
|
|
50
|
+
The Trajectory graph page opens from the guide box's `trajectory-graph` entry and takes the same keyed tab-body seat under its own id, seating one graph per surface; its toolbar's Ledger control opens the ledger it draws, which keeps off the guide page, so the graph is the one trajectory page the Sidebar offers. Both pages read the same `useTrajectory` projection of the Trajectory target, so the graph adds no session request of its own: the ledger presents the records as rows, and the graph draws them as chips in the input, model, and tool swimlanes inside numbered turn bands, chained by the edges the ledger itself records — the prompt that fed each request, the result it produced, the calls each assistant dispatched, the sub-calls a tool dispatched, and the loop back to the next request. The streaming prefix and in-flight calls render as live records whose edges animate; the toolbar pauses the flow and toggles tail following; selecting a chip opens an inspector with the record's name, call id, collapsible pretty-printed arguments, and result, with assistant bodies rendered as compact Markdown and attachment records listing their images (thumbnail, lightbox through the authorized loader) and files (icon, name, size). The toolbar also replays the ledger in recorded order — each hop waits out that record's own timestamp gap clamped to 0.09–1.1 s at ×1/×2/×4 speed, one packet flies the hop's real edge path, and records the cursor has not reached stay dim — and controls the canvas: ctrl/⌘-wheel zoom anchored at the pointer, drag to pan, and fit-to-width. The canvas spreads its swimlanes to the pane width — clamped, and centered whenever the sheet fits no more — over dotted lane rails, with an arrowhead in each edge's kind color. The edge-kind legend pins a kind or highlights it on hover; the search box locates records by label, kind, id, or call id and cycles the matches; and the stats line ranks the slowest settled tool records and breaks the token total into its buckets.
|
|
51
|
+
|
|
52
|
+
-----
|
|
53
|
+
|
|
54
|
+
<a id="understand-the-implementation"></a>
|
|
55
|
+
## Understand the implementation
|
|
56
|
+
|
|
57
|
+
<details>
|
|
58
|
+
<summary>Implementation internals — click to expand</summary>
|
|
59
|
+
|
|
60
|
+
The view is a pure projection: Trajectory-owned Definitions assemble business records from the shared Session window — including durable cancellation-finalized prefixes, chunk-only interruption fallbacks, and interrupted Tool records — so Trajectory neither reads nor changes the Chat conversation snapshot. Its steering classifier retains only next-step Inbox IDs through persistent splice state and shares each current claimed batch across later Contexts.
|
|
61
|
+
|
|
62
|
+
Tool records begin at durable tool/call events and use complete arguments. Trajectory retains each native and nested Tool result's event presentation metadata, so historical file and command locations come from the operation itself. Chat's transient preparing stage does not create Trajectory tool rows or alter historical tool timing.
|
|
63
|
+
|
|
64
|
+
A complete appended prompt without a loaded request header appears as a standalone system row; only its known text is available, with no inferred request options or tool catalog. Prepending its request history replaces that standalone presentation without duplicating the prompt. In-history system prompt changes compare against the most recent request state, including earlier prompt updates without a new request header. Each request retains the prompt and change that applied at its own position. Surface replacements, including compaction, restore the last nonempty surviving system prompt even without a new system event; an unloaded prompt remains unavailable until its page arrives.
|
|
65
|
+
|
|
66
|
+
### The graph projection
|
|
67
|
+
|
|
68
|
+
The graph page is a pure projection of the same snapshot: one node per ledger record plus the streaming prefix and every unsettled call, and only the edges the ledger itself records — nothing invented. Each node carries the attachments and the structured tool call extracted from its record, and React-free helpers rank the slowest settled tools and search records by label, kind, id, or call id. A React-free layout module gives ledger order the vertical axis and the actor lane the horizontal one, and the render window keeps the most recent 400 records together with the edges between them.
|
|
69
|
+
|
|
70
|
+
### Virtual rows
|
|
71
|
+
|
|
72
|
+
Long ledgers initially derive React data from 50 target Nodes ending at the mount-time tail. Later Nodes extend that anchored window without evicting its prefix, and the existing load control reveals earlier resident Nodes before requesting another Session page. Virtualization mounts only the visible row window plus a small overscan; request-only separators share the next measurable virtual item, while semantic row keys and ARIA indexes survive prepends. The virtualizer owns bottom following for structural appends; non-virtual ledgers use a direct tail-position write. Content-only stream frames preserve virtual row keys and heights, reuse measurements, and do not issue repeated tail-scroll writes. Completed replies retain assembled blocks, timing, and usage in Trajectory target State, while the shared Session window keeps the raw Events.
|
|
73
|
+
|
|
74
|
+
### Layout
|
|
75
|
+
|
|
76
|
+
The ledger fills its Sidebar pane and owns its own vertical scrollers, with no reserved space for the conversation's floating composer. Scrollable Summary regions keep their scrollbar thumbs transparent until hovered or focused, without changing the scroll geometry. The package provides no service and declares no Context merge.
|
|
77
|
+
|
|
78
|
+
</details>
|
|
79
|
+
|
|
80
|
+
-----
|
|
81
|
+
|
|
82
|
+
<a id="further-exploration"></a>
|
|
83
|
+
## Further Exploration
|
|
84
|
+
|
|
85
|
+
These pages cover the conversation host and the session data this view projects.
|
|
86
|
+
|
|
87
|
+
- [ui-sidebar-right](../ui-sidebar-right/README.md) — the Sidebar whose tab registry and keyed body seat this package registers into.
|
|
88
|
+
- [session-projection](../../session/session-projection/README.md) — the projection registry serving client-facing read models of session state.
|
|
89
|
+
- [session](../../core/session/README.md) — the session seam whose window holds the raw events.
|
|
90
|
+
- [compaction](../../compaction/compaction/README.md) — the compaction seam whose requests appear in the ledger.
|
|
91
|
+
|
|
92
|
+
-----
|
|
93
|
+
|
|
94
|
+
<a id="model-experience"></a>
|
|
95
|
+
## Model Experience
|
|
96
|
+
|
|
97
|
+
None, as the package is a browser-side UI plugin layer that registers nothing model-facing.
|
|
98
|
+
|
|
99
|
+
#### KV Cache effect
|
|
100
|
+
|
|
101
|
+
None; this package neither assembles nor sends a provider request.
|
|
102
|
+
|
|
103
|
+
## Known Limitations and Deferred Work
|
|
104
|
+
|
|
105
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
These limits define what the view can show while work is in flight; they are current package constraints.
|
|
109
|
+
|
|
110
|
+
- **In-flight Time stays blank** — `partial` and `runningCalls` rows show their running state without a fabricated duration, so the Overview renders a start marker rather than inventing a live span. Record and timeline selection are local to Trajectory, with no anchor deep links.
|
|
111
|
+
- **The graph renders a tail window** — the graph page keeps the most recent 400 records and the edges between them and reports the dropped count, so a very long ledger shows its recent flow rather than the complete session.
|
|
112
|
+
|
|
113
|
+
<a id="dev-note"></a>
|
|
114
|
+
### Dev Note
|
|
115
|
+
|
|
116
|
+
<details>
|
|
117
|
+
<summary>Working context for maintainers — click to expand</summary>
|
|
118
|
+
|
|
119
|
+
None.
|
|
120
|
+
|
|
121
|
+
</details>
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "qilin Web 客户端右侧边栏的 Trajectory 页面:按轮次组织的事件记录表加交互式时间概览,以及把同一记录表画成实时节点与边流动图的轨迹图视图。"
|
|
3
|
+
kind: "package-reference"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @qilin-agent/client-ui-trajectory
|
|
7
|
+
|
|
8
|
+
[English](README.md) | 中文
|
|
9
|
+
|
|
10
|
+
## 概述
|
|
11
|
+
|
|
12
|
+
轨迹图标签页把记录画成实时流动的节点与边;打开记录表的两条路径是轨迹图工具栏的账本控件,以及 Chat 工具卡片的查看操作(后者聚焦该调用)——记录表类型自身不提供引导页条目,因此侧边栏的引导页只列轨迹图。记录表以按轮次组织的事件记录表和时间概览检查活动,对用户、助手、工具、嵌套子工具和压缩记录分组,标示轮次与步骤边界,并为所选记录打开检查器,显示 token 用量、耗时、输入、输出、计时、图片和附件。较长历史打开时定位于尾部,按需加载更早页面,并且只渲染可见行。流式输出期间,视图会跟随尾部,直到你向上滚动;进行中的记录只显示开始标记,不会虚构耗时。
|
|
13
|
+
|
|
14
|
+
## 目录
|
|
15
|
+
|
|
16
|
+
- [使用本包](#use-this-package)
|
|
17
|
+
- [理解实现](#understand-the-implementation)
|
|
18
|
+
- [进一步探索](#further-exploration)
|
|
19
|
+
- [模型体验](#model-experience)
|
|
20
|
+
- [已知限制与延期工作](#known-limitations-and-deferred-work)
|
|
21
|
+
- [开发备注](#dev-note)
|
|
22
|
+
|
|
23
|
+
-----
|
|
24
|
+
|
|
25
|
+
<a id="use-this-package"></a>
|
|
26
|
+
## 使用本包
|
|
27
|
+
|
|
28
|
+
从右侧边栏的引导页打开 Trajectory 标签页(或点击 Chat 工具卡片的查看操作,直接聚焦该调用),把 agent 活动作为事件记录表与时间线查看。初始尾部完成定位前,记录表会用明确的加载行遮住真实记录;更早的前缀仍未加载时,首行控件会在点击时加载一页更早的历史,并在该页加载期间显示禁用的加载状态。
|
|
29
|
+
|
|
30
|
+
### 检查记录
|
|
31
|
+
|
|
32
|
+
调用按已记录的工具名识别。对于 `run_code`,记录行展示程序说明,检查器显示带行号和语法高亮的源码。“代码”页提供换行、查看原始 JSON 参数的 `{}` 切换按钮,以及保留末尾换行的源码原样复制。复制原始参数时保留记录中 JSON 的空白。每个新打开的代码视图采用上次选择的换行状态;切换时,其他已打开视图保持原状。输出保留记录中的文本,完整 JSON 对象或数组使用树形展示。高亮只采用已记录工具 Schema 中明确且无冲突的 TypeScript 或 Python 提示;提示缺失或冲突时显示纯文本源码。回放约束见 [PTC 检查决策](../../../.agents/notes/implemented/feature/2026-09-09-ptc-trajectory-code-inspection.zh.md)。
|
|
33
|
+
|
|
34
|
+
选择、时间线导航、折叠与搜索只覆盖 React 可见窗口。请求编号与累计用量覆盖完整的驻留快照。选择记录会打开局部检查器,查看 token 用量、耗时、输入、输出、计时与持久保留的图片。图片 URL 使用 Conversation 拥有的逐会话缓存,因此 Chat 与 Trajectory 对每个附件共享一次已授权读取。用户记录会在文本旁同时显示非零的图片与普通文件数量,仅含附件的记录也显示这些数量。独立运行的压缩请求会按时间顺序显示在自己的 `Between turns` 区段中,而带编号的压缩仍位于其所属轮次内。
|
|
35
|
+
|
|
36
|
+
概述与预览共用正文之后的有序附件列表,保留重复引用。每行展示完整缩放的图片缩略图或文件类型图标、已记录的文件名(未命名图片使用本地化的编号名称),以及可用的已记录大小、类型和图片尺寸。零字节文件保留大小显示,截断的文件名通过提示显示完整名称。图片打开现有灯箱。原始内容保留内容块顺序和未渲染文本,图片与文件使用默认折叠的展开项,包含完整的已记录字段。
|
|
37
|
+
|
|
38
|
+
请求在等待输出、流式生成或重试期间保持等待状态。尚无助手输出的请求不提供结果链接;中断的输出仍可检查,请求和助手记录都显示失败,即使步骤起点位于已加载历史之外。恢复后仍可查看重试次数与上次尝试错误;这些历史信息不改变请求当前的状态。模型回复完成并不表示其工具或轮次已经结束。
|
|
39
|
+
|
|
40
|
+
流式回复保留已知的开始时间与 TTFT。结算后由 token 时间戳给出生成耗时,吞吐量还要求已记录 usage。
|
|
41
|
+
|
|
42
|
+
检查器中的思考内容使用紧凑 Markdown,沿用检查器固定的 13px 字号和 20px 行高,不受内容字号设置影响。标题只加粗,不放大字号或行高。助手输出保留常规 Markdown 排版。
|
|
43
|
+
|
|
44
|
+
### 时间概览
|
|
45
|
+
|
|
46
|
+
固定在记录表上方的 Overview 区域从左到右投影记录的真实开始时间与耗时;助手时间条区分记录到的 TTFT 与解码时间,悬停 500 ms 后可查看精确时刻与耗时详情。拖选区间会把记录表聚焦到该闭区间内任何时刻处于活动的记录;滚轮手势用于缩放时间域;右键单击会清除所选区间,在已放大的视口上按住右键拖动则会平移。初始视图与流式更新都停留在尾部;向上滚动会暂停跟随,因此新记录不会打断对旧记录的检查。
|
|
47
|
+
|
|
48
|
+
### 轨迹图视图
|
|
49
|
+
|
|
50
|
+
轨迹图页面从引导页的 `trajectory-graph` 条目打开,正文以自己的 id 占用同一个键控标签正文座位,每个表面至多一个图;工具栏的账本控件打开它所绘制的记录表,而记录表不提供引导页条目,因此轨迹图是侧边栏提供的唯一轨迹页面。两个页面读取同一个 `useTrajectory` 投影的 Trajectory target,轨迹图自身不新增任何会话请求:记录表把记录呈现为行,轨迹图把记录画成输入、模型、工具三条泳道中的芯片,装在编号的轮次条带里,并用记录表自身记录的事实连成边——喂给每个请求的提示词、请求产出的结果、助手派发的每个调用、工具派发的子调用,以及转回下一个请求的循环。流式前缀与进行中的调用渲染为活动记录,其边带流动动画;工具栏可暂停流动,并切换尾部跟随;选中芯片会打开检查器,查看该记录的名称、调用 id、可折叠的格式化参数与结果,助手正文以紧凑 Markdown 渲染,附件记录会列出其图片(缩略图,经授权加载器打开灯箱)与文件(图标、名称、大小)。工具栏还能按记录顺序回放整个记录表——每一跳等待该记录自身的时间戳间隔(钳制在 0.09–1.1 秒),支持 ×1/×2/×4 速度,每跳沿真实边路径飞行一个数据包,光标未到达的记录保持变暗——并控制画布:以指针为锚点的 ctrl/⌘ 滚轮缩放、拖拽平移与适应宽度。画布会把泳道铺展到面板宽度——设有上限,画布放不下时居中显示——并以点状泳道轨衬底,每条边带一枚按边类型着色的箭头。边类型图例可固定某一类型或在悬停时高亮;搜索框按标签、类型、id 或调用 id 定位记录并循环跳转匹配项;统计行会排名最慢的已落地工具记录,并把令牌总量拆解为各分桶。
|
|
51
|
+
|
|
52
|
+
-----
|
|
53
|
+
|
|
54
|
+
<a id="understand-the-implementation"></a>
|
|
55
|
+
## 理解实现
|
|
56
|
+
|
|
57
|
+
<details>
|
|
58
|
+
<summary>实现细节——点击展开</summary>
|
|
59
|
+
|
|
60
|
+
视图是纯投影:Trajectory 自有的 Definition 从共享 Session 窗口组装业务记录——包括持久化的取消定稿前缀、只能从分片恢复的打断前缀与被打断的工具记录——因此 Trajectory 既不读取也不改变 Chat 会话快照。其 steering 分类器通过持久 splice state 只保留 next-step Inbox ID,并让后续 Context 共享当前 claimed batch。
|
|
61
|
+
|
|
62
|
+
工具记录从持久 tool/call 事件开始,使用完整参数。Trajectory 保留每个原生与嵌套工具结果事件中的展示元数据,因此历史文件与命令位置来自执行本身。Chat 的瞬态 preparing 阶段不创建 Trajectory 工具行,也不改变历史工具计时。
|
|
63
|
+
|
|
64
|
+
完整的追加提示词在请求头未加载时显示为独立系统行;仅提供已知文本,不推断请求选项或工具目录。补入其请求历史后,该独立展示被替代而不重复提示词。历史中的系统提示词变更与最近的请求状态比较,包括没有新请求头的先前提示词更新。每个请求保留其所在位置生效的提示词与变更。包括压缩在内的 surface 替换会恢复最后一个非空的存活系统提示词,即使没有新的系统事件;未加载的提示词在对应分页到达前仍不可用。
|
|
65
|
+
|
|
66
|
+
### 轨迹图投影
|
|
67
|
+
|
|
68
|
+
轨迹图页面是同一 snapshot 的纯投影:每个记录一个节点,外加流式前缀与每个未落定的调用;边只来自记录表自身记录的事实,不做任何虚构。每个节点携带从其记录提取的附件与结构化工具调用,不依赖 React 的辅助函数负责排名最慢的已落地工具、按标签/类型/id/调用 id 搜索记录。一个不依赖 React 的布局模块把记录顺序作为纵轴、把行为者泳道作为横轴;渲染窗口只保留最近 400 条记录及其间的边。
|
|
69
|
+
|
|
70
|
+
### 虚拟行
|
|
71
|
+
|
|
72
|
+
长记录表最初只从挂载时尾部结束的 50 个 target Node 派生 React 数据。后续 Node 会扩展这个固定起点的窗口而不会逐出其前缀;现有加载控件会先显露更早的驻留 Node,再请求下一个 Session 页面。虚拟化只挂载可见行窗口加少量缓冲;仅含请求的分隔行并入下一个具备可测高度的虚拟项,语义行键与 ARIA 索引在向前补页后保持不变。虚拟化器负责结构性追加后的底部跟随;非虚拟记录表会直接写入末尾位置。仅含内容更新的流式帧会保持虚拟行的键与高度、复用测量结果,并且不会重复写入末尾滚动位置。已完成的回复会在 Trajectory target State 中保留组装后的 blocks、计时与用量,共享 Session 窗口则保留原始 Event。
|
|
73
|
+
|
|
74
|
+
### 布局
|
|
75
|
+
|
|
76
|
+
记录表填满所在侧边栏面板并自持纵向滚动容器,不为会话的浮层 composer 预留空间。可滚动的 Summary 区域在悬停或聚焦前保持滚动条滑块透明,同时不改变滚动几何空间。本包不提供 service,也不声明 Context 合并。
|
|
77
|
+
|
|
78
|
+
</details>
|
|
79
|
+
|
|
80
|
+
-----
|
|
81
|
+
|
|
82
|
+
<a id="further-exploration"></a>
|
|
83
|
+
## 进一步探索
|
|
84
|
+
|
|
85
|
+
以下页面覆盖对话宿主与本视图所投影的会话数据。
|
|
86
|
+
|
|
87
|
+
- [ui-sidebar-right](../ui-sidebar-right/README.zh.md)——本包注册标签页类型与键控正文座位的侧边栏。
|
|
88
|
+
- [session-projection](../../session/session-projection/README.zh.md)——为客户端读取模型提供会话状态的服务注册表。
|
|
89
|
+
- [session](../../core/session/README.zh.md)——其窗口持有原始事件的会话 seam。
|
|
90
|
+
- [compaction](../../compaction/compaction/README.zh.md)——其请求出现在记录表中的压缩 seam。
|
|
91
|
+
|
|
92
|
+
-----
|
|
93
|
+
|
|
94
|
+
<a id="model-experience"></a>
|
|
95
|
+
## 模型体验
|
|
96
|
+
|
|
97
|
+
无。该包是浏览器端 UI 插件层,不注册任何面向模型的内容。
|
|
98
|
+
|
|
99
|
+
#### KV Cache 影响
|
|
100
|
+
|
|
101
|
+
无;该包既不组装也不发送提供方请求。
|
|
102
|
+
|
|
103
|
+
## 已知限制与延期工作
|
|
104
|
+
|
|
105
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
这些限制定义工作仍在进行时视图能显示什么;它们是当前包约束。
|
|
109
|
+
|
|
110
|
+
- **进行中时 Time 保持空白**:`partial` 与 `runningCalls` 行会显示运行状态,但不会虚构耗时,因此 Overview 区域只渲染开始标记,而不会杜撰实时跨度。记录选择与时间线选择位于 Trajectory 内部,不提供锚点深链接。
|
|
111
|
+
- **轨迹图渲染尾部窗口**:轨迹图页面只保留最近 400 条记录及其间的边,并显示被裁掉的计数,因此很长的记录表展示的是最近的流动而不是完整会话。
|
|
112
|
+
|
|
113
|
+
<a id="dev-note"></a>
|
|
114
|
+
### 开发备注
|
|
115
|
+
|
|
116
|
+
<details>
|
|
117
|
+
<summary>维护者的工作上下文——点击展开</summary>
|
|
118
|
+
|
|
119
|
+
无。
|
|
120
|
+
|
|
121
|
+
</details>
|