@codexview/react 0.2.3 → 0.3.1
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 +7 -1
- package/dist/components/CodexTranscript.d.ts +2 -0
- package/dist/components/ToolGroup.d.ts +20 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +199 -102
- package/dist/index.js.map +1 -1
- package/dist/styles.css +31 -0
- package/docs/api.md +43 -5
- package/docs/changelog.md +45 -0
- package/docs/integration-agentweb.md +200 -48
- package/docs/styling.md +49 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -50,9 +50,15 @@ CodexView itself only renders `ChatStreamEvent[]`. Hosts convert their raw logs
|
|
|
50
50
|
|
|
51
51
|
Session-level status (`idle | working | completed | stopped | failed`) is inferred automatically. Override via the `status` prop (e.g. when SSE drops, set `status="stopped"`).
|
|
52
52
|
|
|
53
|
+
## Reading layout
|
|
54
|
+
|
|
55
|
+
Consecutive tool-like items inside a turn (`tool_call`, `exec`, `search`, `patch`, `todo_list`) are wrapped automatically in a single collapsible `<ToolGroup>` titled by aggregated counts — e.g. `更新待办、执行 9 个命令、调用 4 个工具`. The transcript reads as narrative: text, a one-line summary of operations in between, more text. Messages, reasoning, and errors stay rendered standalone. See [docs/api.md#toolgroup](docs/api.md) for the API.
|
|
56
|
+
|
|
57
|
+
The default light palette is a "warm paper" look (ivory page, deep ink-brown text, peach user bubble, warm-ink code blocks). To restore the previous cool palette, drop in the override snippet in [docs/styling.md](docs/styling.md#restoring-the-pre-021-cool-palette).
|
|
58
|
+
|
|
53
59
|
## Customizing
|
|
54
60
|
|
|
55
|
-
- Swap any block via `components` prop: `<CodexTranscript components={{ ToolCallBlock: MyToolUI }} />`
|
|
61
|
+
- Swap any block via `components` prop: `<CodexTranscript components={{ ToolCallBlock: MyToolUI, ToolGroup: MyGroupUI }} />`
|
|
56
62
|
- Theme via CSS variables — see [docs/styling.md](docs/styling.md) for the full list.
|
|
57
63
|
|
|
58
64
|
## More docs
|
|
@@ -11,6 +11,7 @@ import { TodoListBlockProps } from './TodoListBlock.js';
|
|
|
11
11
|
import { ErrorBlockProps } from './ErrorBlock.js';
|
|
12
12
|
import { RawEventBlockProps } from './RawEventBlock.js';
|
|
13
13
|
import { StatusBarProps } from './StatusBar.js';
|
|
14
|
+
import { ToolGroupProps } from './ToolGroup.js';
|
|
14
15
|
export interface CodexTranscriptComponents {
|
|
15
16
|
StatusBar: ComponentType<StatusBarProps>;
|
|
16
17
|
MessageBubble: ComponentType<MessageBubbleProps>;
|
|
@@ -22,6 +23,7 @@ export interface CodexTranscriptComponents {
|
|
|
22
23
|
TodoListBlock: ComponentType<TodoListBlockProps>;
|
|
23
24
|
ErrorBlock: ComponentType<ErrorBlockProps>;
|
|
24
25
|
RawEventBlock: ComponentType<RawEventBlockProps>;
|
|
26
|
+
ToolGroup: ComponentType<ToolGroupProps>;
|
|
25
27
|
}
|
|
26
28
|
export interface CodexTranscriptProps {
|
|
27
29
|
events: ChatStreamEvent[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ItemView } from '../types/model.js';
|
|
3
|
+
export interface ToolGroupProps {
|
|
4
|
+
items: ItemView[];
|
|
5
|
+
/** Pre-rendered child blocks, one per item, in the same order as `items`. */
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/** Default to false (collapsed). Auto-expands while any item is pending/running. */
|
|
8
|
+
defaultOpen?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function isGroupableKind(kind: ItemView['kind']): boolean;
|
|
11
|
+
export type Slice = {
|
|
12
|
+
kind: 'single';
|
|
13
|
+
item: ItemView;
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'group';
|
|
16
|
+
items: ItemView[];
|
|
17
|
+
};
|
|
18
|
+
export declare function partitionForGrouping(items: ItemView[]): Slice[];
|
|
19
|
+
export declare function summarize(items: ItemView[]): string;
|
|
20
|
+
export declare function ToolGroup({ items, children, defaultOpen }: ToolGroupProps): JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -31,8 +31,10 @@ export { ErrorBlock } from './components/ErrorBlock.js';
|
|
|
31
31
|
export type { ErrorBlockProps } from './components/ErrorBlock.js';
|
|
32
32
|
export { RawEventBlock } from './components/RawEventBlock.js';
|
|
33
33
|
export type { RawEventBlockProps } from './components/RawEventBlock.js';
|
|
34
|
+
export { ToolGroup, partitionForGrouping, summarize as summarizeToolGroup, isGroupableKind } from './components/ToolGroup.js';
|
|
35
|
+
export type { ToolGroupProps, Slice as ToolGroupSlice } from './components/ToolGroup.js';
|
|
34
36
|
export { ItemErrorBoundary } from './components/ItemErrorBoundary.js';
|
|
35
37
|
export type { ItemErrorBoundaryProps } from './components/ItemErrorBoundary.js';
|
|
36
38
|
export { Markdown } from './components/Markdown.js';
|
|
37
39
|
export type { MarkdownProps } from './components/Markdown.js';
|
|
38
|
-
export declare const VERSION = "0.1
|
|
40
|
+
export declare const VERSION = "0.3.1";
|