langchain_agentx_stream_ui 0.1.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/README.md +236 -0
- package/dist/AskUserQuestionToolBody-CyuNy_k5.d.ts +33 -0
- package/dist/MarkdownBlock-3iEW0Ubm.d.ts +100 -0
- package/dist/chunk-4RIOBLGB.js +666 -0
- package/dist/chunk-4RIOBLGB.js.map +1 -0
- package/dist/chunk-DP7V33X7.js +13 -0
- package/dist/chunk-DP7V33X7.js.map +1 -0
- package/dist/chunk-G2KYJCMM.js +5171 -0
- package/dist/chunk-G2KYJCMM.js.map +1 -0
- package/dist/chunk-MHK53ZHC.js +972 -0
- package/dist/chunk-MHK53ZHC.js.map +1 -0
- package/dist/chunk-W6QQHTJ4.js +785 -0
- package/dist/chunk-W6QQHTJ4.js.map +1 -0
- package/dist/chunk-WM6Y6APP.js +411 -0
- package/dist/chunk-WM6Y6APP.js.map +1 -0
- package/dist/default.css +1364 -0
- package/dist/index.d.ts +650 -0
- package/dist/index.js +743 -0
- package/dist/index.js.map +1 -0
- package/dist/multi-session-CviqerRl.d.ts +494 -0
- package/dist/multi-session.d.ts +7 -0
- package/dist/multi-session.js +21 -0
- package/dist/multi-session.js.map +1 -0
- package/dist/nodes-DqhaBW7M.d.ts +195 -0
- package/dist/sessionViewOptions-DLSFRQwZ.d.ts +158 -0
- package/dist/tools-presentation.d.ts +14 -0
- package/dist/tools-presentation.js +37 -0
- package/dist/tools-presentation.js.map +1 -0
- package/dist/tools.d.ts +21 -0
- package/dist/tools.js +43 -0
- package/dist/tools.js.map +1 -0
- package/dist/types-aXj5TYSP.d.ts +33 -0
- package/dist/virtual.d.ts +36 -0
- package/dist/virtual.js +19 -0
- package/dist/virtual.js.map +1 -0
- package/package.json +88 -0
package/README.md
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
# langchain_agentx_stream_ui
|
|
2
|
+
|
|
3
|
+
React 组件库:将 `LangchainAgentEvent` 流归并为可渲染的会话时间线。
|
|
4
|
+
|
|
5
|
+
## 快速接入
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install langchain_agentx_stream_ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import 'langchain_agentx_stream_ui/styles/default.css';
|
|
13
|
+
import { AgentSession, createAgentxSseSource } from 'langchain_agentx_stream_ui';
|
|
14
|
+
|
|
15
|
+
export function Chat({ url }: { url: string }) {
|
|
16
|
+
const source = createAgentxSseSource({ url });
|
|
17
|
+
return <AgentSession source={source} />;
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## V2-A API(Phase A)
|
|
22
|
+
|
|
23
|
+
- `classifyEvent` / `resolveEventTier` — 事件分级(main / collapsed / debug / state)
|
|
24
|
+
- `AgentSession` props:`tierOverrides`、`debug`
|
|
25
|
+
- `ToolCallCard` — `summary` → `display` → `blocks`;折叠区 `details`(input 流、progress、steps)
|
|
26
|
+
- `reduceEvents(events, { tierOverrides, collectDebug })`
|
|
27
|
+
|
|
28
|
+
## V2-B API(Phase B · 回放)
|
|
29
|
+
|
|
30
|
+
- `replayEvents(events, options?)` / `replayTree(tree, events, options?)` — 纯函数离线回放
|
|
31
|
+
- `createReplaySource(events, { delayMs?, tierOverrides? })` — 实现 `Source` 接口
|
|
32
|
+
- `useReplayTree(events, options?)` — React hook 只读树
|
|
33
|
+
- `AgentSession` prop `initialEvents` — 挂载时先 replay,再接 live Source 续流
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
import { AgentSession, createReplaySource, replayEvents } from 'langchain_agentx_stream_ui';
|
|
37
|
+
|
|
38
|
+
// 只读历史
|
|
39
|
+
<AgentSession source={createReplaySource(historyEvents)} />
|
|
40
|
+
|
|
41
|
+
// 历史 + 续流
|
|
42
|
+
<AgentSession source={liveSseSource} initialEvents={bufferedEvents} />
|
|
43
|
+
|
|
44
|
+
// 测试 / 调试
|
|
45
|
+
const tree = replayEvents(events);
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
示例见 `examples/replay-from-events.tsx`。
|
|
49
|
+
|
|
50
|
+
## V2-B.x API(Phase B.x · SSE 续传 / M4)
|
|
51
|
+
|
|
52
|
+
- `createAgentxSseSource` 解析 SSE `id:` 行 → `handler(event, { sseEventId })`
|
|
53
|
+
- 网络断开后重连 URL 携带 `last_event_id`(`buildResumeStreamUrl`)
|
|
54
|
+
- `createSessionStore` 对重复 `sseEventId` 幂等跳过;`tree.meta.lastEventId` 记录游标
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
const source = createAgentxSseSource({
|
|
58
|
+
url: '/api/stream',
|
|
59
|
+
onLastEventId: (id) => localStorage.setItem('cursor', id),
|
|
60
|
+
});
|
|
61
|
+
// store 自动 dedupe 重叠帧
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## V2-C API(Phase C · 多会话)
|
|
65
|
+
|
|
66
|
+
- `createMultiSessionStore(options?)` — 多会话 zustand store(LRU 默认 10)
|
|
67
|
+
- `MultiAgentSession` — 每 session 独立 `Source` + `initialEvents`(EventBuffer 快照续流)
|
|
68
|
+
- `useActiveSession()` / `useSessionIds()` — 活跃 session 与 LRU 列表
|
|
69
|
+
- 单会话 `AgentSession` API **向后兼容**不变
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
import { MultiAgentSession, createAgentxSseSource } from 'langchain_agentx_stream_ui';
|
|
73
|
+
|
|
74
|
+
<MultiAgentSession
|
|
75
|
+
activeSessionId={tab}
|
|
76
|
+
onActiveSessionChange={setTab}
|
|
77
|
+
sessions={[
|
|
78
|
+
{ sessionId: 'a', source: sseA, initialEvents: bufferSnapshotA },
|
|
79
|
+
{ sessionId: 'b', source: sseB },
|
|
80
|
+
]}
|
|
81
|
+
/>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## V2-D API(Phase D · 权限 UI)
|
|
85
|
+
|
|
86
|
+
- `permission-request` 事件 → `PermissionNode`(主舞台 `PermissionCard`)
|
|
87
|
+
- `createInteractionBus({ onPermissionResolve })` — 薄层回写;库内不发起 HTTP
|
|
88
|
+
- `AgentSession` / `MultiAgentSession` prop `interactionBus`
|
|
89
|
+
- `useInteractionBus()` — 自定义节点内触发回写
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
import {
|
|
93
|
+
AgentSession,
|
|
94
|
+
createAgentxSseSource,
|
|
95
|
+
createInteractionBus,
|
|
96
|
+
} from 'langchain_agentx_stream_ui';
|
|
97
|
+
|
|
98
|
+
const bus = createInteractionBus({
|
|
99
|
+
onPermissionResolve: async ({ requestId, allow, message }) => {
|
|
100
|
+
await fetch(`/task/${taskId}/permission`, {
|
|
101
|
+
method: 'POST',
|
|
102
|
+
headers: { 'Content-Type': 'application/json' },
|
|
103
|
+
body: JSON.stringify({
|
|
104
|
+
request_id: requestId,
|
|
105
|
+
behavior: allow ? 'allow' : 'deny',
|
|
106
|
+
message,
|
|
107
|
+
}),
|
|
108
|
+
});
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
<AgentSession source={sseSource} interactionBus={bus} />;
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## V2-E API(Phase D · 虚拟滚动)
|
|
116
|
+
|
|
117
|
+
- `VirtualTimeline` — `@tanstack/react-virtual` 按主舞台 `rootChildren` 虚拟化
|
|
118
|
+
- `AgentSession` props:`virtualized`(默认 `false`)、`virtualizeThreshold`(默认 `500`)
|
|
119
|
+
- `virtualized={false}` 时与 MVP 全量 `<Timeline />` 行为一致
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
<AgentSession source={source} virtualized virtualizeThreshold={500} />
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
可选子路径(减小主包依赖,需自行安装 `@tanstack/react-virtual` 若使用 virtual):
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
import { VirtualTimeline } from 'langchain_agentx_stream_ui/virtual';
|
|
129
|
+
import { MultiAgentSession } from 'langchain_agentx_stream_ui/multi-session';
|
|
130
|
+
import { createDefaultToolRegistry } from 'langchain_agentx_stream_ui/tools';
|
|
131
|
+
import { MarkdownBlock } from 'langchain_agentx_stream_ui/tools/presentation';
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## V3-T API(Tool Display 子系统)
|
|
135
|
+
|
|
136
|
+
Per-tool Widget 套件,对齐 AgentX CLI `widgets/tools/*` 与 CC `tools/*/UI.tsx`。
|
|
137
|
+
|
|
138
|
+
### 决策树:NodeRegistry vs ToolDisplayRegistry
|
|
139
|
+
|
|
140
|
+
| 扩展点 | 替换范围 | 典型用途 |
|
|
141
|
+
|--------|----------|----------|
|
|
142
|
+
| `NodeRegistry` | 整卡(含 Shell 外布局) | 完全自定义 tool_call 节点 |
|
|
143
|
+
| `ToolDisplayRegistry` | 仅 Body 组件 | 按工具名定制正文/标题语义 |
|
|
144
|
+
|
|
145
|
+
路由顺序(`resolveToolBody`):registry 精确匹配 CC 工具名 → `display.type` → `DefaultToolBody`(无 alias 表)。
|
|
146
|
+
|
|
147
|
+
工具名 SSOT:`frontend/src/view/tools/toolNames.ts`(对齐 SDK `registry_names.py`)。门禁:`tests/view/tools/toolNameGuard.test.ts`(TN-006)。
|
|
148
|
+
|
|
149
|
+
### 已注册工具(default registry)
|
|
150
|
+
|
|
151
|
+
CC PascalCase 单键:`Read` / `Write` / `Edit` / `Grep` / `Glob` / `Bash` / `Agent` / `Skill` / `WebSearch` / `WebFetch` / `AskUserQuestion`
|
|
152
|
+
|
|
153
|
+
未注册或 legacy 名(如 `read_file`、`batch_edit`)回退 `DefaultToolBody`(summary + 折叠 JSON)。
|
|
154
|
+
|
|
155
|
+
### 接入示例
|
|
156
|
+
|
|
157
|
+
```tsx
|
|
158
|
+
import {
|
|
159
|
+
AgentSession,
|
|
160
|
+
createDefaultToolRegistry,
|
|
161
|
+
createAgentxSseSource,
|
|
162
|
+
} from 'langchain_agentx_stream_ui';
|
|
163
|
+
|
|
164
|
+
const tools = createDefaultToolRegistry();
|
|
165
|
+
// tools.register('my_tool', MyToolBody);
|
|
166
|
+
|
|
167
|
+
<AgentSession
|
|
168
|
+
source={createAgentxSseSource({ url: '/api/stream' })}
|
|
169
|
+
toolDisplayRegistry={tools}
|
|
170
|
+
defaultBodyMode="preview"
|
|
171
|
+
/>;
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
- `defaultBodyMode`:`preview`(默认 3 行截断)或 `full`
|
|
175
|
+
- `ToolCallShell`:空标题工具使用 `--bare` 样式(无 chrome 头)
|
|
176
|
+
- `MarkdownBlock`:`display.type=markdown` 时用于 read 等文本类正文
|
|
177
|
+
|
|
178
|
+
### T4.5 / T4.6(Grouped + 行内 Permission)
|
|
179
|
+
|
|
180
|
+
```tsx
|
|
181
|
+
<AgentSession
|
|
182
|
+
source={source}
|
|
183
|
+
groupParallelTools
|
|
184
|
+
permissionUiMode="inline"
|
|
185
|
+
interactionBus={bus}
|
|
186
|
+
/>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
| Prop | 默认 | 说明 |
|
|
190
|
+
|------|------|------|
|
|
191
|
+
| `groupParallelTools` | `false` | 连续同 `toolName` 的并行 tool_call 合并为 Grouped 行 |
|
|
192
|
+
| `permissionUiMode` | `standalone` | `inline` 隐藏独立 PermissionCard,在 running 工具卡片内显示 Waiting… + Allow/Deny;`both` 双轨 |
|
|
193
|
+
|
|
194
|
+
后台 `permission_mode=bypass` 时通常不会出现 pending;逻辑预置供 `raise` 模式联调。
|
|
195
|
+
|
|
196
|
+
Grouped 与 `virtualized` 互斥:开启 `groupParallelTools` 时强制全量 `Timeline`(legacy;分组已由 projection `GroupedToolUseAccumulator` 承担)。
|
|
197
|
+
|
|
198
|
+
### Renderable Projection(Phase 0–6)
|
|
199
|
+
|
|
200
|
+
Timeline 默认经 `projectTimeline()` 投影:`collapsed_explore` · `grouped_tool_use` · `system_summary`。
|
|
201
|
+
|
|
202
|
+
Phase 6 感官:`shellProgressSuffix`(bash ≥2s)、hint `useMinDisplayTime(700ms)`、git/MCP 摘要前缀。
|
|
203
|
+
|
|
204
|
+
Release notes:`docs/release/frontend-renderable-projection_2026-06-07.md`
|
|
205
|
+
|
|
206
|
+
```tsx
|
|
207
|
+
import {
|
|
208
|
+
AgentSession,
|
|
209
|
+
projectTimeline,
|
|
210
|
+
createProjectionContext,
|
|
211
|
+
SystemSummaryAccumulator,
|
|
212
|
+
formatShellProgressSuffix,
|
|
213
|
+
useMinDisplayTime,
|
|
214
|
+
} from 'langchain_agentx_stream_ui';
|
|
215
|
+
|
|
216
|
+
<AgentSession
|
|
217
|
+
source={source}
|
|
218
|
+
displayMode="normal" // normal | transcript | brief_only
|
|
219
|
+
verbose={false}
|
|
220
|
+
memoryDir="/path/to/memory" // memory 工具折叠(I08–I12)
|
|
221
|
+
workspaceRoot="/repo"
|
|
222
|
+
/>;
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
`hook-finished` / `compact-*` 写入 `SessionTree.systemEvents`,经 `SystemSummaryAccumulator` 渲染为 `system_summary`(I13)。
|
|
226
|
+
|
|
227
|
+
示例见 `examples/custom-tool-display.tsx`(对比 `examples/custom-tool-node.tsx`)。
|
|
228
|
+
|
|
229
|
+
## 测试
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
cd frontend && npm test
|
|
233
|
+
npm run typecheck
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
契约测试消费 `backend/tests/fixtures/sse/*.events.json`(SSOT)。
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { b as ToolDisplayProps, T as ToolBodyComponent } from './types-aXj5TYSP.js';
|
|
3
|
+
import { T as ToolDisplayRegistry } from './sessionViewOptions-DLSFRQwZ.js';
|
|
4
|
+
|
|
5
|
+
declare function DefaultToolBody({ result, bodyMode, onBodyModeChange, }: ToolDisplayProps): react_jsx_runtime.JSX.Element;
|
|
6
|
+
|
|
7
|
+
declare function resolveToolBody(toolName: string, display: unknown, registry: ToolDisplayRegistry): ToolBodyComponent;
|
|
8
|
+
|
|
9
|
+
declare function formatToolTitle(toolName: string, input: unknown, display: unknown, summary?: string | null, meta?: unknown): string;
|
|
10
|
+
|
|
11
|
+
declare function ReadToolBody({ result, bodyMode, onBodyModeChange, }: ToolDisplayProps): react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
declare function GrepToolBody({ result, bodyMode, onBodyModeChange, }: ToolDisplayProps): react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
declare function GlobToolBody({ result, bodyMode, onBodyModeChange, }: ToolDisplayProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
declare function EditToolBody({ input, result, bodyMode, onBodyModeChange, }: ToolDisplayProps): react_jsx_runtime.JSX.Element;
|
|
18
|
+
|
|
19
|
+
declare function WriteToolBody({ input, result, bodyMode, onBodyModeChange, }: ToolDisplayProps): react_jsx_runtime.JSX.Element;
|
|
20
|
+
|
|
21
|
+
declare function BashToolBody({ result, bodyMode, onBodyModeChange, }: ToolDisplayProps): react_jsx_runtime.JSX.Element;
|
|
22
|
+
|
|
23
|
+
declare function AgentToolBody({ result, bodyMode, onBodyModeChange, status, subagentProgress, }: ToolDisplayProps): react_jsx_runtime.JSX.Element;
|
|
24
|
+
|
|
25
|
+
declare function WebSearchToolBody({ result, bodyMode, onBodyModeChange, }: ToolDisplayProps): react_jsx_runtime.JSX.Element;
|
|
26
|
+
|
|
27
|
+
declare function WebFetchToolBody({ result, bodyMode, onBodyModeChange, }: ToolDisplayProps): react_jsx_runtime.JSX.Element;
|
|
28
|
+
|
|
29
|
+
declare function SkillToolBody({ result, bodyMode, onBodyModeChange, }: ToolDisplayProps): react_jsx_runtime.JSX.Element;
|
|
30
|
+
|
|
31
|
+
declare function AskUserQuestionToolBody({ input, result, bodyMode, onBodyModeChange, }: ToolDisplayProps): react_jsx_runtime.JSX.Element;
|
|
32
|
+
|
|
33
|
+
export { AgentToolBody as A, BashToolBody as B, DefaultToolBody as D, EditToolBody as E, GlobToolBody as G, ReadToolBody as R, SkillToolBody as S, WebFetchToolBody as W, AskUserQuestionToolBody as a, GrepToolBody as b, WebSearchToolBody as c, WriteToolBody as d, formatToolTitle as f, resolveToolBody as r };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { a as ToolBodyMode } from './types-aXj5TYSP.js';
|
|
3
|
+
|
|
4
|
+
declare const MAX_PREVIEW_LINES = 3;
|
|
5
|
+
interface TruncatedContentProps {
|
|
6
|
+
text: string;
|
|
7
|
+
mode: ToolBodyMode;
|
|
8
|
+
maxLines?: number;
|
|
9
|
+
onExpand?: () => void;
|
|
10
|
+
}
|
|
11
|
+
declare function TruncatedContent({ text, mode, maxLines, onExpand, }: TruncatedContentProps): react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* BodyBlockList.tsx — ⎿ 多块正文布局
|
|
15
|
+
*
|
|
16
|
+
* 职责:
|
|
17
|
+
* 多块平面文本,支持 normal / error / dim 变体。
|
|
18
|
+
*
|
|
19
|
+
* 链路位置:
|
|
20
|
+
* T3 bash stdout/stderr 分块;DefaultToolBody 可复用。
|
|
21
|
+
*
|
|
22
|
+
* 当前裁剪范围:
|
|
23
|
+
* 块内不做 TruncatedContent(由调用方传入已截断文本)。
|
|
24
|
+
*
|
|
25
|
+
* 对齐参考:
|
|
26
|
+
* CLI presentation/message_layout.py · CC MessageResponse.tsx ⎿ 前缀
|
|
27
|
+
*/
|
|
28
|
+
interface BodyBlock {
|
|
29
|
+
text: string;
|
|
30
|
+
variant?: 'normal' | 'error' | 'dim';
|
|
31
|
+
}
|
|
32
|
+
interface BodyBlockListProps {
|
|
33
|
+
blocks: BodyBlock[];
|
|
34
|
+
}
|
|
35
|
+
declare function BodyBlockList({ blocks }: BodyBlockListProps): react_jsx_runtime.JSX.Element | null;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* paths.ts — 路径展示 helper
|
|
39
|
+
*
|
|
40
|
+
* 职责:
|
|
41
|
+
* 将绝对路径转为较短展示字符串(Web 无 cwd 时仅 normalize 分隔符)。
|
|
42
|
+
*
|
|
43
|
+
* 链路位置:
|
|
44
|
+
* T1+ Read/Edit Widget title。
|
|
45
|
+
*
|
|
46
|
+
* 当前裁剪范围:
|
|
47
|
+
* 不做 relpath(浏览器无 process.cwd);仅 slash 归一化。
|
|
48
|
+
*
|
|
49
|
+
* 对齐参考:
|
|
50
|
+
* CLI widgets/tools/helpers.py display_path
|
|
51
|
+
*/
|
|
52
|
+
declare function displayPath(filePath: string): string;
|
|
53
|
+
|
|
54
|
+
declare function formatPatternTitle(pattern: string, path?: string | null): string;
|
|
55
|
+
declare function truncateLines(text: string, maxLines: number): {
|
|
56
|
+
text: string;
|
|
57
|
+
truncated: boolean;
|
|
58
|
+
};
|
|
59
|
+
declare function formatSearchResultBody(output: string, maxListLines?: number): string;
|
|
60
|
+
|
|
61
|
+
interface DiffViewProps {
|
|
62
|
+
diff: string;
|
|
63
|
+
mode: ToolBodyMode;
|
|
64
|
+
maxPreviewLines?: number;
|
|
65
|
+
onExpand?: () => void;
|
|
66
|
+
}
|
|
67
|
+
declare function DiffView({ diff, mode, maxPreviewLines, onExpand, }: DiffViewProps): react_jsx_runtime.JSX.Element;
|
|
68
|
+
|
|
69
|
+
type DiffLineKind = 'add' | 'remove' | 'context' | 'meta';
|
|
70
|
+
interface ParsedDiffLine {
|
|
71
|
+
kind: DiffLineKind;
|
|
72
|
+
text: string;
|
|
73
|
+
}
|
|
74
|
+
declare function formatDiffFromStrings(oldText: string, newText: string): string;
|
|
75
|
+
declare function parseDiffText(diff: string): ParsedDiffLine[];
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* bashHelpers.ts — bash 命令与输出解析
|
|
79
|
+
*
|
|
80
|
+
* 对齐参考:CLI widgets/tools/helpers.py · bash/widget.py format_body_blocks
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
declare function truncateCommand(command: string, maxChars?: number): string;
|
|
84
|
+
declare function formatTimeoutFooter(timeoutMs: number | null | undefined): string | null;
|
|
85
|
+
declare function buildBashBodyBlocks(display: unknown, summary: string, meta: unknown, mode: ToolBodyMode, isError: boolean): {
|
|
86
|
+
blocks: BodyBlock[];
|
|
87
|
+
truncated: boolean;
|
|
88
|
+
remainingLines: number;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
interface MarkdownBlockProps {
|
|
92
|
+
text: string;
|
|
93
|
+
mode: ToolBodyMode;
|
|
94
|
+
maxLines?: number;
|
|
95
|
+
onExpand?: () => void;
|
|
96
|
+
className?: string;
|
|
97
|
+
}
|
|
98
|
+
declare function MarkdownBlock({ text, mode, maxLines, onExpand, className, }: MarkdownBlockProps): react_jsx_runtime.JSX.Element;
|
|
99
|
+
|
|
100
|
+
export { type BodyBlock as B, DiffView as D, MAX_PREVIEW_LINES as M, TruncatedContent as T, BodyBlockList as a, MarkdownBlock as b, buildBashBodyBlocks as c, displayPath as d, formatPatternTitle as e, formatDiffFromStrings as f, formatSearchResultBody as g, formatTimeoutFooter as h, truncateLines as i, parseDiffText as p, truncateCommand as t };
|