@orion-agents/orion-code 0.4.8 → 0.5.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/CHANGELOG.md +13 -0
- package/README.md +5 -5
- package/README.zh-CN.md +5 -5
- package/dist/acp/sessions.js +1 -1
- package/dist/acp/stdio.js +17 -2
- package/dist/cli.js +45 -4
- package/dist/commands/session-command-handlers.js +8 -3
- package/dist/commands/system-commands.js +3 -3
- package/dist/commands/types.d.ts +3 -0
- package/dist/framework/loop-progress.js +3 -1
- package/dist/framework/query.d.ts +3 -1
- package/dist/framework/query.js +18 -3
- package/dist/framework/tool-serializer.d.ts +12 -0
- package/dist/framework/tool-serializer.js +35 -0
- package/dist/framework/tool.d.ts +2 -0
- package/dist/harness/ledger.js +2 -1
- package/dist/print-ui/delivery.d.ts +15 -0
- package/dist/print-ui/delivery.js +131 -0
- package/dist/print-ui/event-stream.d.ts +6 -1
- package/dist/print-ui/event-stream.js +56 -10
- package/dist/print-ui/launch.d.ts +5 -0
- package/dist/print-ui/launch.js +66 -9
- package/dist/runtime/agent-loop.d.ts +3 -1
- package/dist/runtime/agent-loop.js +20 -8
- package/dist/runtime/agent-runtime-controller.d.ts +4 -1
- package/dist/runtime/agent-runtime-controller.js +36 -22
- package/dist/runtime/agent-runtime-runner.d.ts +4 -0
- package/dist/runtime/agent-runtime-runner.js +9 -0
- package/dist/runtime/builtin-tool-provider.js +6 -5
- package/dist/runtime/composer/layout.d.ts +1 -1
- package/dist/runtime/composer/layout.js +5 -5
- package/dist/runtime/core-tools/descriptors.d.ts +1 -1
- package/dist/runtime/core-tools/descriptors.js +39 -1
- package/dist/runtime/first-party-core-provider.js +1 -0
- package/dist/runtime/first-party-tool-services.js +10 -0
- package/dist/runtime/goals/evidence.js +2 -0
- package/dist/runtime/legacy-thread-materializer.d.ts +7 -0
- package/dist/runtime/legacy-thread-materializer.js +32 -6
- package/dist/runtime/orion-runtime-v1.d.ts +2 -1
- package/dist/runtime/orion-runtime-v1.js +1 -0
- package/dist/runtime/product-bootstrap.d.ts +2 -0
- package/dist/runtime/product-bootstrap.js +1 -0
- package/dist/runtime/product-orion-runtime.d.ts +2 -1
- package/dist/runtime/product-orion-runtime.js +1 -0
- package/dist/runtime/release-receipts.d.ts +0 -1
- package/dist/runtime/release-receipts.js +8 -3
- package/dist/runtime/rich-text/layout.d.ts +3 -1
- package/dist/runtime/rich-text/layout.js +37 -22
- package/dist/runtime/shell-process-sessions.d.ts +41 -0
- package/dist/runtime/shell-process-sessions.js +258 -0
- package/dist/runtime/step-snapshot.js +4 -1
- package/dist/runtime/subagents/presets.d.ts +1 -1
- package/dist/runtime/subagents/presets.js +1 -0
- package/dist/runtime/task-context-recovery.js +7 -0
- package/dist/runtime/thread-event-store.d.ts +3 -0
- package/dist/runtime/thread-event-store.js +35 -22
- package/dist/runtime/thread-session-index.d.ts +15 -3
- package/dist/runtime/thread-session-index.js +152 -45
- package/dist/runtime/thread-session-view.js +1 -1
- package/dist/runtime/thread-ui-adapter.d.ts +1 -1
- package/dist/runtime/thread-ui-adapter.js +14 -8
- package/dist/runtime/tool-gateway.d.ts +1 -0
- package/dist/runtime/tool-gateway.js +1 -0
- package/dist/runtime/tool-transcript-entry.d.ts +8 -1
- package/dist/runtime/tool-transcript-entry.js +35 -7
- package/dist/runtime/ui-events.d.ts +7 -0
- package/dist/services/global-config.d.ts +1 -1
- package/dist/services/global-config.js +2 -0
- package/dist/services/llm.d.ts +3 -0
- package/dist/services/llm.js +48 -4
- package/dist/terminal-ui/raw-editor.js +2 -1
- package/dist/tools/core/exec-command.js +51 -42
- package/dist/tools/core/index.d.ts +2 -1
- package/dist/tools/core/index.js +4 -1
- package/dist/tools/core/process-session.d.ts +2 -0
- package/dist/tools/core/process-session.js +54 -0
- package/dist/tui-core/frame.d.ts +2 -0
- package/dist/tui-core/frame.js +19 -0
- package/dist/tui-core/input-parser.d.ts +4 -1
- package/dist/tui-core/input-parser.js +22 -0
- package/dist/tui-ui/chrome-view-model.d.ts +0 -2
- package/dist/tui-ui/chrome-view-model.js +54 -56
- package/dist/tui-ui/launch.js +133 -202
- package/dist/tui-ui/layout.d.ts +16 -41
- package/dist/tui-ui/layout.js +408 -295
- package/dist/tui-ui/render-scheduler.d.ts +2 -5
- package/dist/tui-ui/render-scheduler.js +10 -10
- package/dist/tui-ui/response-clipboard.d.ts +17 -0
- package/dist/tui-ui/response-clipboard.js +201 -0
- package/dist/tui-ui/runner.d.ts +65 -80
- package/dist/tui-ui/runner.js +545 -738
- package/dist/tui-ui/session-picker-preview.d.ts +8 -0
- package/dist/tui-ui/session-picker-preview.js +119 -0
- package/dist/tui-ui/session-picker.d.ts +20 -0
- package/dist/tui-ui/session-picker.js +42 -0
- package/dist/tui-ui/state.d.ts +34 -81
- package/dist/tui-ui/state.js +155 -288
- package/dist/tui-ui/terminal-image.d.ts +3 -7
- package/dist/tui-ui/terminal-image.js +18 -47
- package/dist/tui-ui/terminal-viewport.d.ts +55 -0
- package/dist/tui-ui/terminal-viewport.js +221 -0
- package/dist/tui-ui/transcript-layout.d.ts +5 -0
- package/dist/tui-ui/transcript-layout.js +43 -28
- package/dist/tui-ui/transcript-pager.d.ts +39 -0
- package/dist/tui-ui/transcript-pager.js +278 -0
- package/dist/tui-ui/transcript-tool-output.d.ts +16 -0
- package/dist/tui-ui/transcript-tool-output.js +102 -0
- package/dist/utils/bounded-file.d.ts +4 -0
- package/dist/utils/bounded-file.js +30 -0
- package/dist/utils/command-process.d.ts +4 -0
- package/dist/utils/command-process.js +23 -0
- package/docs/cli-guide.md +50 -6
- package/npm-shrinkwrap.json +115 -15
- package/package.json +4 -1
- package/dist/tui-ui/inline-surface.d.ts +0 -191
- package/dist/tui-ui/inline-surface.js +0 -644
- package/dist/tui-ui/input-ownership.d.ts +0 -46
- package/dist/tui-ui/input-ownership.js +0 -74
- package/dist/tui-ui/transcript-inspector-layout.d.ts +0 -9
- package/dist/tui-ui/transcript-inspector-layout.js +0 -107
- package/dist/tui-ui/transcript-inspector-surface.d.ts +0 -18
- package/dist/tui-ui/transcript-inspector-surface.js +0 -91
- package/dist/tui-ui/transcript-inspector.d.ts +0 -36
- package/dist/tui-ui/transcript-inspector.js +0 -129
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SessionMeta } from '../services/session-storage';
|
|
2
|
+
export interface SessionPickerPreviewMessage {
|
|
3
|
+
readonly role: 'user' | 'assistant';
|
|
4
|
+
readonly text: string;
|
|
5
|
+
}
|
|
6
|
+
/** Read a bounded preview without activating a session or repairing its derived index. */
|
|
7
|
+
export declare function loadSessionPickerPreview(session: SessionMeta): Promise<readonly SessionPickerPreviewMessage[]>;
|
|
8
|
+
//# sourceMappingURL=session-picker-preview.d.ts.map
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadSessionPickerPreview = loadSessionPickerPreview;
|
|
4
|
+
const promises_1 = require("fs/promises");
|
|
5
|
+
const paths_1 = require("../product/paths");
|
|
6
|
+
const legacy_thread_materializer_1 = require("../runtime/legacy-thread-materializer");
|
|
7
|
+
const thread_session_index_1 = require("../runtime/thread-session-index");
|
|
8
|
+
const redaction_1 = require("../services/redaction");
|
|
9
|
+
const bounded_file_1 = require("../utils/bounded-file");
|
|
10
|
+
const terminal_text_1 = require("../utils/terminal-text");
|
|
11
|
+
const MAX_INDEX_FILE_BYTES = 2 * 1024 * 1024;
|
|
12
|
+
const MAX_LEGACY_TAIL_BYTES = 64 * 1024;
|
|
13
|
+
const MAX_INDEX_MESSAGES = 40;
|
|
14
|
+
const MAX_PREVIEW_MESSAGES = 4;
|
|
15
|
+
const MAX_PREVIEW_TEXT_BYTES = 480;
|
|
16
|
+
/** Read a bounded preview without activating a session or repairing its derived index. */
|
|
17
|
+
async function loadSessionPickerPreview(session) {
|
|
18
|
+
const { projectPath, id } = session;
|
|
19
|
+
if (!id || /[/\\\0]/u.test(id))
|
|
20
|
+
return [];
|
|
21
|
+
try {
|
|
22
|
+
const binding = (0, legacy_thread_materializer_1.peekSessionCheckpointStorageV1)(projectPath, id, MAX_INDEX_FILE_BYTES);
|
|
23
|
+
if (binding.kind === 'thread') {
|
|
24
|
+
const { checkpoint } = binding;
|
|
25
|
+
if (!checkpoint)
|
|
26
|
+
return [];
|
|
27
|
+
const page = (0, thread_session_index_1.loadThreadSessionIndexedPageV1)({
|
|
28
|
+
rootDir: checkpoint.store.rootDir,
|
|
29
|
+
threadId: checkpoint.store.threadId,
|
|
30
|
+
head: checkpoint.head,
|
|
31
|
+
pageSize: MAX_INDEX_MESSAGES,
|
|
32
|
+
maxFileBytes: MAX_INDEX_FILE_BYTES,
|
|
33
|
+
});
|
|
34
|
+
return projectRecentMessages(page?.items ?? []);
|
|
35
|
+
}
|
|
36
|
+
if (session.threadReadModel)
|
|
37
|
+
return [];
|
|
38
|
+
const records = await readLegacyTail((0, paths_1.getProjectSessionMessagesPath)(projectPath, id));
|
|
39
|
+
// The async read may overlap a cutover by another process. Its former
|
|
40
|
+
// transcript is no longer the authority once the binding changes.
|
|
41
|
+
return (0, legacy_thread_materializer_1.peekSessionCheckpointStorageV1)(projectPath, id, MAX_INDEX_FILE_BYTES).kind === 'legacy'
|
|
42
|
+
? projectRecentMessages(records)
|
|
43
|
+
: [];
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
async function readLegacyTail(path) {
|
|
50
|
+
const handle = await (0, promises_1.open)(path, bounded_file_1.READ_REGULAR_FILE_FLAGS);
|
|
51
|
+
try {
|
|
52
|
+
const stats = await handle.stat();
|
|
53
|
+
if (!stats.isFile() || !stats.size)
|
|
54
|
+
return [];
|
|
55
|
+
const buffer = Buffer.allocUnsafe(Math.min(stats.size, MAX_LEGACY_TAIL_BYTES));
|
|
56
|
+
const start = stats.size - buffer.length;
|
|
57
|
+
let read = 0;
|
|
58
|
+
while (read < buffer.length) {
|
|
59
|
+
const { bytesRead } = await handle.read(buffer, read, buffer.length - read, start + read);
|
|
60
|
+
if (!bytesRead)
|
|
61
|
+
break;
|
|
62
|
+
read += bytesRead;
|
|
63
|
+
}
|
|
64
|
+
const tail = buffer.subarray(0, read);
|
|
65
|
+
const firstNewline = start > 0 ? tail.indexOf(0x0a) : -1;
|
|
66
|
+
if (start > 0 && firstNewline === -1)
|
|
67
|
+
return [];
|
|
68
|
+
return tail
|
|
69
|
+
.subarray(firstNewline + 1)
|
|
70
|
+
.toString('utf8')
|
|
71
|
+
.split('\n')
|
|
72
|
+
.filter(Boolean)
|
|
73
|
+
.flatMap(line => {
|
|
74
|
+
try {
|
|
75
|
+
return [JSON.parse(line)];
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
return [];
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
finally {
|
|
83
|
+
await handle.close();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function projectRecentMessages(records) {
|
|
87
|
+
const recent = [];
|
|
88
|
+
for (let index = records.length - 1; index >= 0 && recent.length < MAX_PREVIEW_MESSAGES; index--) {
|
|
89
|
+
const record = records[index];
|
|
90
|
+
if (!record || typeof record !== 'object')
|
|
91
|
+
continue;
|
|
92
|
+
const { role, content, kind, tool_calls: toolCalls } = record;
|
|
93
|
+
if ((role !== 'user' && role !== 'assistant') || typeof content !== 'string')
|
|
94
|
+
continue;
|
|
95
|
+
if (kind === 'reasoning' || (Array.isArray(toolCalls) && toolCalls.length > 0))
|
|
96
|
+
continue;
|
|
97
|
+
const text = (0, redaction_1.redactTraceText)((0, terminal_text_1.sanitizeTerminalText)(content)).replace(/\s+/gu, ' ').trim();
|
|
98
|
+
if (!/[^\s\p{Default_Ignorable_Code_Point}]/u.test(text))
|
|
99
|
+
continue;
|
|
100
|
+
recent.push({ role, text: clipPreviewText(text) });
|
|
101
|
+
}
|
|
102
|
+
return recent.reverse();
|
|
103
|
+
}
|
|
104
|
+
function clipPreviewText(text) {
|
|
105
|
+
if (Buffer.byteLength(text, 'utf8') <= MAX_PREVIEW_TEXT_BYTES)
|
|
106
|
+
return text;
|
|
107
|
+
const ellipsis = '…';
|
|
108
|
+
const max = MAX_PREVIEW_TEXT_BYTES - Buffer.byteLength(ellipsis, 'utf8');
|
|
109
|
+
let bytes = 0;
|
|
110
|
+
let end = 0;
|
|
111
|
+
for (const point of text) {
|
|
112
|
+
bytes += Buffer.byteLength(point, 'utf8');
|
|
113
|
+
if (bytes > max)
|
|
114
|
+
break;
|
|
115
|
+
end += point.length;
|
|
116
|
+
}
|
|
117
|
+
return text.slice(0, end) + ellipsis;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=session-picker-preview.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SessionPickerRequest } from '../runtime/ui-events';
|
|
2
|
+
import type { SessionMeta } from '../services/session-storage';
|
|
3
|
+
import type { SessionPickerPreviewMessage } from './session-picker-preview';
|
|
4
|
+
import type { TuiPromptState } from './state';
|
|
5
|
+
export interface SessionPickerOverlay {
|
|
6
|
+
type: 'sessions';
|
|
7
|
+
request: SessionPickerRequest;
|
|
8
|
+
query: TuiPromptState;
|
|
9
|
+
candidates: readonly {
|
|
10
|
+
session: SessionMeta;
|
|
11
|
+
searchText: string;
|
|
12
|
+
}[];
|
|
13
|
+
matches: readonly SessionMeta[];
|
|
14
|
+
selectedIndex: number;
|
|
15
|
+
/** Undefined while the selected Session's read-only preview is pending. */
|
|
16
|
+
preview?: readonly SessionPickerPreviewMessage[];
|
|
17
|
+
}
|
|
18
|
+
export declare function openSessionPicker(request: SessionPickerRequest): SessionPickerOverlay;
|
|
19
|
+
export declare function searchSessionPicker(overlay: SessionPickerOverlay, query: TuiPromptState): SessionPickerOverlay;
|
|
20
|
+
//# sourceMappingURL=session-picker.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.openSessionPicker = openSessionPicker;
|
|
4
|
+
exports.searchSessionPicker = searchSessionPicker;
|
|
5
|
+
function openSessionPicker(request) {
|
|
6
|
+
return {
|
|
7
|
+
type: 'sessions',
|
|
8
|
+
request,
|
|
9
|
+
query: { value: '', cursor: 0 },
|
|
10
|
+
candidates: request.sessions.map(session => ({
|
|
11
|
+
session,
|
|
12
|
+
searchText: [session.name, session.taskSummary, session.id, session.projectPath]
|
|
13
|
+
.map(field => foldSearchText(field ?? ''))
|
|
14
|
+
.join('\n'),
|
|
15
|
+
})),
|
|
16
|
+
matches: request.sessions,
|
|
17
|
+
selectedIndex: 0,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function searchSessionPicker(overlay, query) {
|
|
21
|
+
if (query.value === overlay.query.value)
|
|
22
|
+
return { ...overlay, query };
|
|
23
|
+
const search = foldSearchText(query.value);
|
|
24
|
+
const matches = search
|
|
25
|
+
? overlay.candidates
|
|
26
|
+
.filter(candidate => candidate.searchText.includes(search))
|
|
27
|
+
.map(candidate => candidate.session)
|
|
28
|
+
: overlay.request.sessions;
|
|
29
|
+
const previous = overlay.matches[overlay.selectedIndex];
|
|
30
|
+
const selectedIndex = Math.max(0, matches.findIndex(session => session === previous));
|
|
31
|
+
return {
|
|
32
|
+
...overlay,
|
|
33
|
+
query,
|
|
34
|
+
matches,
|
|
35
|
+
selectedIndex,
|
|
36
|
+
preview: matches[selectedIndex] === previous ? overlay.preview : undefined,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function foldSearchText(value) {
|
|
40
|
+
return value.normalize('NFKC').toLowerCase().trim().replace(/\s+/gu, ' ');
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=session-picker.js.map
|
package/dist/tui-ui/state.d.ts
CHANGED
|
@@ -4,10 +4,13 @@ import type { ResearchLifecycleEvent } from '../runtime/subagents/research-rende
|
|
|
4
4
|
import { type PromptState, type ResearchStatusProjection, type StatusSnapshot, type SubtaskTimelineEntry } from '../runtime/ui-view-model';
|
|
5
5
|
import type { TuiPickerItem } from './pickers';
|
|
6
6
|
import type { AgentModeSnapshot } from '../framework/agent-mode';
|
|
7
|
+
import { type SessionPickerOverlay } from './session-picker';
|
|
8
|
+
import type { SessionPickerPreviewMessage } from './session-picker-preview';
|
|
7
9
|
export type TuiPromptState = Pick<PromptState, 'value' | 'cursor'>;
|
|
8
10
|
export interface TuiTranscriptRecord extends TranscriptEntry {
|
|
9
11
|
finalized: boolean;
|
|
10
12
|
revision: number;
|
|
13
|
+
completedOrder?: number;
|
|
11
14
|
}
|
|
12
15
|
/** Structured status state (replaces renderer-local string concatenation). */
|
|
13
16
|
export interface TuiStatusState {
|
|
@@ -16,18 +19,23 @@ export interface TuiStatusState {
|
|
|
16
19
|
message?: string;
|
|
17
20
|
activeTools: number;
|
|
18
21
|
activeSubtasks: number;
|
|
19
|
-
committedTranscriptEntries: number;
|
|
20
22
|
}
|
|
21
23
|
export type TuiRuntimeToolEvent = ({
|
|
22
24
|
type: 'started';
|
|
23
25
|
} & RuntimeToolStartedEvent) | ({
|
|
24
26
|
type: 'finished';
|
|
25
27
|
} & RuntimeToolFinishedEvent);
|
|
26
|
-
export
|
|
27
|
-
type: '
|
|
28
|
-
request: SessionPickerRequest;
|
|
28
|
+
export interface FollowupQueueOverlay {
|
|
29
|
+
type: 'queue';
|
|
29
30
|
selectedIndex: number;
|
|
30
|
-
|
|
31
|
+
editor?: {
|
|
32
|
+
itemId: string;
|
|
33
|
+
revision: number;
|
|
34
|
+
draft: TuiPromptState;
|
|
35
|
+
};
|
|
36
|
+
notice?: string;
|
|
37
|
+
}
|
|
38
|
+
export type TuiOverlayState = SessionPickerOverlay | FollowupQueueOverlay | {
|
|
31
39
|
type: 'model';
|
|
32
40
|
request: ModelPickerRequest;
|
|
33
41
|
selectedIndex: number;
|
|
@@ -39,6 +47,7 @@ export type TuiOverlayState = {
|
|
|
39
47
|
type: 'permission';
|
|
40
48
|
request: ToolPermissionRequest;
|
|
41
49
|
selectedIndex: number;
|
|
50
|
+
resumeQueue?: FollowupQueueOverlay;
|
|
42
51
|
} | {
|
|
43
52
|
type: 'commands';
|
|
44
53
|
query: string;
|
|
@@ -53,16 +62,6 @@ export type TuiOverlayState = {
|
|
|
53
62
|
} | {
|
|
54
63
|
type: 'shortcuts';
|
|
55
64
|
} | null;
|
|
56
|
-
export interface ToolInspectorState {
|
|
57
|
-
selectedIndex: number;
|
|
58
|
-
expandedCallIds: string[];
|
|
59
|
-
listOffset: number;
|
|
60
|
-
detailOffset: number;
|
|
61
|
-
searchQuery: string;
|
|
62
|
-
searchDirection: 1 | -1;
|
|
63
|
-
loadingCallIds: string[];
|
|
64
|
-
error?: string;
|
|
65
|
-
}
|
|
66
65
|
export interface TuiUiState {
|
|
67
66
|
transcript: TuiTranscriptRecord[];
|
|
68
67
|
runtimeToolEvents: TuiRuntimeToolEvent[];
|
|
@@ -72,9 +71,9 @@ export interface TuiUiState {
|
|
|
72
71
|
researchEvents: ResearchLifecycleEvent[];
|
|
73
72
|
/** Renderer-neutral projection of the latest research packet. */
|
|
74
73
|
research: ResearchStatusProjection | null;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
/** The finalized prefix; records after this index can still change or finish out of order. */
|
|
75
|
+
completedTranscriptCount: number;
|
|
76
|
+
latestCompletionOrder: number;
|
|
78
77
|
transcriptGeneration: number;
|
|
79
78
|
prompt: TuiPromptState;
|
|
80
79
|
statusMessage: string;
|
|
@@ -86,24 +85,11 @@ export interface TuiUiState {
|
|
|
86
85
|
agentMode: AgentModeSnapshot;
|
|
87
86
|
/** v0.2.23: Tool output view mode for adaptive collapse. */
|
|
88
87
|
toolOutputViewMode: 'adaptive' | 'collapsed' | 'full';
|
|
89
|
-
/** v0.2.23: Bounded recent tool detail summaries (max 512). */
|
|
90
|
-
recentToolDetails: TuiToolDetailSummary[];
|
|
91
|
-
/** v0.2.23: Inspector state (null when closed). */
|
|
92
|
-
inspector: ToolInspectorState | null;
|
|
93
88
|
/** Shared runtime Goal projection. Null when the session has no goal. */
|
|
94
89
|
goal: RuntimeGoalSnapshot | null;
|
|
95
90
|
effort: import('../runtime/ui-events').RuntimeEffortEvent | null;
|
|
96
91
|
followupQueue: FollowupQueueSnapshot;
|
|
97
92
|
}
|
|
98
|
-
export interface TuiToolDetailSummary {
|
|
99
|
-
callId: string;
|
|
100
|
-
sequence: number;
|
|
101
|
-
toolName: string;
|
|
102
|
-
outputBytes: number;
|
|
103
|
-
state: 'success' | 'error' | 'skipped';
|
|
104
|
-
summary?: string;
|
|
105
|
-
artifactId?: string;
|
|
106
|
-
}
|
|
107
93
|
export type TuiUiAction = {
|
|
108
94
|
type: 'appendTranscript';
|
|
109
95
|
entry: TranscriptAppendEntry & {
|
|
@@ -147,6 +133,23 @@ export type TuiUiAction = {
|
|
|
147
133
|
} | {
|
|
148
134
|
type: 'showSessionPicker';
|
|
149
135
|
request: SessionPickerRequest;
|
|
136
|
+
} | {
|
|
137
|
+
type: 'setSessionPreview';
|
|
138
|
+
sessionId: string;
|
|
139
|
+
messages: readonly SessionPickerPreviewMessage[];
|
|
140
|
+
} | {
|
|
141
|
+
type: 'setModalPrompt';
|
|
142
|
+
prompt: TuiPromptState;
|
|
143
|
+
} | {
|
|
144
|
+
type: 'showFollowupQueue';
|
|
145
|
+
selectedIndex?: number;
|
|
146
|
+
} | {
|
|
147
|
+
type: 'beginFollowupEdit';
|
|
148
|
+
} | {
|
|
149
|
+
type: 'endFollowupEdit';
|
|
150
|
+
} | {
|
|
151
|
+
type: 'setFollowupNotice';
|
|
152
|
+
message: string;
|
|
150
153
|
} | {
|
|
151
154
|
type: 'showModelPicker';
|
|
152
155
|
request: ModelPickerRequest;
|
|
@@ -199,59 +202,9 @@ export type TuiUiAction = {
|
|
|
199
202
|
} | {
|
|
200
203
|
type: 'setToolOutputViewMode';
|
|
201
204
|
mode: 'adaptive' | 'collapsed' | 'full';
|
|
202
|
-
} | {
|
|
203
|
-
type: 'openToolInspector';
|
|
204
|
-
} | {
|
|
205
|
-
type: 'closeToolInspector';
|
|
206
|
-
} | {
|
|
207
|
-
type: 'moveToolInspectorSelection';
|
|
208
|
-
delta: number;
|
|
209
|
-
} | {
|
|
210
|
-
type: 'setToolInspectorSelection';
|
|
211
|
-
index: number;
|
|
212
|
-
} | {
|
|
213
|
-
type: 'toggleToolInspectorEntry';
|
|
214
|
-
callId: string;
|
|
215
|
-
} | {
|
|
216
|
-
type: 'toggleAllToolInspectorEntries';
|
|
217
|
-
} | {
|
|
218
|
-
type: 'scrollToolInspector';
|
|
219
|
-
delta: number;
|
|
220
|
-
} | {
|
|
221
|
-
type: 'setToolInspectorSearch';
|
|
222
|
-
query: string;
|
|
223
|
-
} | {
|
|
224
|
-
type: 'toolDetailLoaded';
|
|
225
|
-
callId: string;
|
|
226
|
-
} | {
|
|
227
|
-
type: 'toolDetailLoadFailed';
|
|
228
|
-
callId: string;
|
|
229
|
-
error: string;
|
|
230
205
|
};
|
|
231
206
|
export declare const initialTuiUiState: TuiUiState;
|
|
232
207
|
export declare function tuiUiReducer(state: TuiUiState, action: TuiUiAction): TuiUiState;
|
|
233
|
-
export declare function staticTuiTranscriptEntries(state: TuiUiState): TranscriptEntry[];
|
|
234
|
-
export declare function liveTuiTranscriptEntries(state: TuiUiState): TranscriptEntry[];
|
|
235
|
-
/** Entries ready to commit (committable but not yet queued). */
|
|
236
|
-
export declare function pendingCommitEntries(state: TuiUiState): TranscriptEntry[];
|
|
237
|
-
/** Renderer-local records retain revision/finalized metadata for styled layout and caching. */
|
|
238
|
-
export declare function staticTuiTranscriptRecords(state: TuiUiState): TuiTranscriptRecord[];
|
|
239
|
-
export declare function liveTuiTranscriptRecords(state: TuiUiState): TuiTranscriptRecord[];
|
|
240
|
-
/** Renderer-local records ready to commit (committable but not yet queued). */
|
|
241
|
-
export declare function pendingCommitRecords(state: TuiUiState): TuiTranscriptRecord[];
|
|
242
|
-
/** Advance the queued boundary after enqueueing a commit batch. */
|
|
243
|
-
export declare function markTranscriptQueued(state: TuiUiState, count: number): TuiUiState;
|
|
244
|
-
/** Advance the committed boundary after successful surface write. */
|
|
245
|
-
export declare function markTranscriptCommitted(state: TuiUiState, count: number): TuiUiState;
|
|
246
|
-
export interface TranscriptCommitAcknowledgement {
|
|
247
|
-
generation: number;
|
|
248
|
-
recordIds: string[];
|
|
249
|
-
}
|
|
250
|
-
/** Release only the exact finalized prefix confirmed by the surface write. */
|
|
251
|
-
export declare function acknowledgeTranscriptCommit(state: TuiUiState, acknowledgement: TranscriptCommitAcknowledgement): {
|
|
252
|
-
state: TuiUiState;
|
|
253
|
-
accepted: boolean;
|
|
254
|
-
};
|
|
255
208
|
export declare function createTuiUiEventSink(dispatch: (action: TuiUiAction) => void, options?: {
|
|
256
209
|
idFactory?: () => string;
|
|
257
210
|
}): UiEventSink;
|