@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
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PendingFollowupChangedError = void 0;
|
|
4
|
+
/** The queue changed before this selection crossed the durable admission boundary. */
|
|
5
|
+
class PendingFollowupChangedError extends Error {
|
|
6
|
+
constructor() {
|
|
7
|
+
super('Pending follow-up changed before admission.');
|
|
8
|
+
this.name = 'PendingFollowupChangedError';
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.PendingFollowupChangedError = PendingFollowupChangedError;
|
|
3
12
|
//# sourceMappingURL=agent-runtime-runner.js.map
|
|
@@ -9,6 +9,7 @@ const CORE = new Set([
|
|
|
9
9
|
'glob',
|
|
10
10
|
'grep',
|
|
11
11
|
'list_files',
|
|
12
|
+
'process_session',
|
|
12
13
|
'read_file',
|
|
13
14
|
'subtask',
|
|
14
15
|
'todo_write',
|
|
@@ -17,7 +18,8 @@ const CORE = new Set([
|
|
|
17
18
|
const LONG_TAIL = new Set(['web_fetch', 'web_search']);
|
|
18
19
|
const EXCLUDED_LEGACY_TOOLS = new Set(['mcp_call', 'mcp_list']);
|
|
19
20
|
const NETWORK_READ = new Set(['web_fetch', 'web_search']);
|
|
20
|
-
const
|
|
21
|
+
const EXTERNAL_WRITES = new Set(['git_push']);
|
|
22
|
+
const NETWORK_WRITE = new Set([...EXTERNAL_WRITES, 'exec_command', 'process_session']);
|
|
21
23
|
const WORKSPACE_WRITES = new Set([
|
|
22
24
|
'edit_file',
|
|
23
25
|
'exec_command',
|
|
@@ -25,6 +27,7 @@ const WORKSPACE_WRITES = new Set([
|
|
|
25
27
|
'git_commit',
|
|
26
28
|
'memory_forget',
|
|
27
29
|
'memory_save',
|
|
30
|
+
'process_session',
|
|
28
31
|
'write_file',
|
|
29
32
|
]);
|
|
30
33
|
const FILE_EDITS = new Set(['edit_file', 'write_file']);
|
|
@@ -175,10 +178,8 @@ function policyFor(name) {
|
|
|
175
178
|
? 'write'
|
|
176
179
|
: NETWORK_READ.has(name)
|
|
177
180
|
? 'read'
|
|
178
|
-
:
|
|
179
|
-
|
|
180
|
-
: 'none';
|
|
181
|
-
const effect = NETWORK_WRITE.has(name)
|
|
181
|
+
: 'none';
|
|
182
|
+
const effect = EXTERNAL_WRITES.has(name)
|
|
182
183
|
? 'external_write'
|
|
183
184
|
: WORKSPACE_WRITES.has(name)
|
|
184
185
|
? 'workspace_write'
|
|
@@ -25,7 +25,7 @@ export declare const PROMPT_CURSOR_GLYPH = "\u258C";
|
|
|
25
25
|
export declare function promptContentWidth(width: number): number;
|
|
26
26
|
export declare function promptTextWidth(width: number): number;
|
|
27
27
|
export declare function splitByVisualWidth(text: string, maxWidth: number): string[];
|
|
28
|
-
export declare function getPromptVisualLines(value: string, width: number): PromptVisualLine[];
|
|
28
|
+
export declare function getPromptVisualLines(value: string, width: number, reservedColumns?: number): PromptVisualLine[];
|
|
29
29
|
export declare function getVisiblePromptVisualLines(value: string, width: number, maxRows: number): {
|
|
30
30
|
lines: PromptVisualLine[];
|
|
31
31
|
hiddenRows: number;
|
|
@@ -66,8 +66,9 @@ function splitByVisualWidthWithOffsets(text, maxWidth) {
|
|
|
66
66
|
chunks.push({ content: current, start: currentStart, end: text.length });
|
|
67
67
|
return chunks;
|
|
68
68
|
}
|
|
69
|
-
function getPromptVisualLines(value, width) {
|
|
70
|
-
|
|
69
|
+
function getPromptVisualLines(value, width, reservedColumns) {
|
|
70
|
+
const textWidth = reservedColumns === undefined ? promptTextWidth(width) : Math.max(1, width - reservedColumns);
|
|
71
|
+
return buildPromptVisualLines(value, textWidth).lines;
|
|
71
72
|
}
|
|
72
73
|
function getVisiblePromptVisualLines(value, width, maxRows) {
|
|
73
74
|
const lines = getPromptVisualLines(value, width);
|
|
@@ -81,7 +82,7 @@ function getVisiblePromptVisualLines(value, width, maxRows) {
|
|
|
81
82
|
};
|
|
82
83
|
}
|
|
83
84
|
function getPromptInputViewport(value, width, maxRows, cursor = value.length) {
|
|
84
|
-
const layout = buildPromptVisualLines(value, width, cursor);
|
|
85
|
+
const layout = buildPromptVisualLines(value, promptTextWidth(width), cursor);
|
|
85
86
|
const allLines = layout.lines;
|
|
86
87
|
const rowLimit = Math.max(1, maxRows);
|
|
87
88
|
const showHiddenIndicator = allLines.length > rowLimit && rowLimit > 1;
|
|
@@ -102,9 +103,8 @@ function getPromptInputViewport(value, width, maxRows, cursor = value.length) {
|
|
|
102
103
|
rowsUpFromPromptBottom: Math.max(1, contentRows - cursorLineIndex + 1),
|
|
103
104
|
};
|
|
104
105
|
}
|
|
105
|
-
function buildPromptVisualLines(value,
|
|
106
|
+
function buildPromptVisualLines(value, maxTextWidth, cursor = value.length) {
|
|
106
107
|
const logicalLines = value.length > 0 ? value.split('\n') : [''];
|
|
107
|
-
const maxTextWidth = promptTextWidth(width);
|
|
108
108
|
const clampedCursor = Math.min(Math.max(0, cursor), value.length);
|
|
109
109
|
const visualLines = [];
|
|
110
110
|
let cursorLineIndex = 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ToolInputJSONSchema } from '../../framework/tool';
|
|
2
|
-
export type FirstPartyCoreToolNameV1 = 'edit_file' | 'exec_command' | 'glob' | 'grep' | 'list_files' | 'read_file' | 'write_file';
|
|
2
|
+
export type FirstPartyCoreToolNameV1 = 'edit_file' | 'exec_command' | 'glob' | 'grep' | 'list_files' | 'process_session' | 'read_file' | 'write_file';
|
|
3
3
|
export interface CoreToolDescriptorSpecV1 {
|
|
4
4
|
readonly name: FirstPartyCoreToolNameV1;
|
|
5
5
|
readonly aliases: readonly string[];
|
|
@@ -70,7 +70,7 @@ exports.CORE_TOOL_DESCRIPTORS = deepFreeze([
|
|
|
70
70
|
{
|
|
71
71
|
name: 'exec_command',
|
|
72
72
|
aliases: [],
|
|
73
|
-
description: '执行一个 shell
|
|
73
|
+
description: '执行一个 shell 命令并返回输出。默认关闭 stdin 并等待退出。设置 interactive: true 可提前返回仍在运行的 processId,再用 process_session 读取输出、写 stdin 或取消。',
|
|
74
74
|
parameters: {
|
|
75
75
|
type: 'object',
|
|
76
76
|
properties: {
|
|
@@ -88,6 +88,16 @@ exports.CORE_TOOL_DESCRIPTORS = deepFreeze([
|
|
|
88
88
|
minimum: 1024,
|
|
89
89
|
maximum: 10485760,
|
|
90
90
|
},
|
|
91
|
+
interactive: {
|
|
92
|
+
type: 'boolean',
|
|
93
|
+
description: '保留 stdin 并允许同一回合内继续交互(默认 false)',
|
|
94
|
+
},
|
|
95
|
+
yieldMs: {
|
|
96
|
+
type: 'number',
|
|
97
|
+
description: '仅交互模式,首次等输出或退出的时长 ms(默认 500)',
|
|
98
|
+
minimum: 0,
|
|
99
|
+
maximum: 5000,
|
|
100
|
+
},
|
|
91
101
|
},
|
|
92
102
|
required: ['command'],
|
|
93
103
|
},
|
|
@@ -98,6 +108,34 @@ exports.CORE_TOOL_DESCRIPTORS = deepFreeze([
|
|
|
98
108
|
destructive: true,
|
|
99
109
|
fileEdit: false,
|
|
100
110
|
},
|
|
111
|
+
{
|
|
112
|
+
name: 'process_session',
|
|
113
|
+
aliases: [],
|
|
114
|
+
description: '操作本回合由 exec_command 启动的交互进程。poll 读取新增输出,write 发送原样输入,cancel 终止进程。最后一段输出和退出状态可读取一次。此工具不用于交付验证通过的证据。',
|
|
115
|
+
parameters: {
|
|
116
|
+
type: 'object',
|
|
117
|
+
properties: {
|
|
118
|
+
processId: { type: 'string', description: 'exec_command 返回的 metadata.processId' },
|
|
119
|
+
action: { type: 'string', enum: ['poll', 'write', 'cancel'] },
|
|
120
|
+
input: {
|
|
121
|
+
type: 'string',
|
|
122
|
+
description: 'write 时必填,不自动追加换行,最多 65536 UTF-8 字节',
|
|
123
|
+
},
|
|
124
|
+
yieldMs: {
|
|
125
|
+
type: 'number',
|
|
126
|
+
description: '等新增输出或退出的最长时长 ms(默认 500)',
|
|
127
|
+
minimum: 0,
|
|
128
|
+
maximum: 5000,
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
required: ['processId', 'action'],
|
|
132
|
+
},
|
|
133
|
+
permission: 'allow',
|
|
134
|
+
readOnly: false,
|
|
135
|
+
concurrencySafe: false,
|
|
136
|
+
destructive: false,
|
|
137
|
+
fileEdit: false,
|
|
138
|
+
},
|
|
101
139
|
{
|
|
102
140
|
name: 'edit_file',
|
|
103
141
|
aliases: [],
|
|
@@ -180,6 +180,7 @@ const DEFAULT_CORE_TOOL_IMPORTERS = Object.freeze({
|
|
|
180
180
|
glob: () => Promise.resolve().then(() => __importStar(require('../tools/core/glob'))),
|
|
181
181
|
grep: () => Promise.resolve().then(() => __importStar(require('../tools/core/grep'))),
|
|
182
182
|
list_files: () => Promise.resolve().then(() => __importStar(require('../tools/core/list-files'))),
|
|
183
|
+
process_session: () => Promise.resolve().then(() => __importStar(require('../tools/core/process-session'))),
|
|
183
184
|
read_file: () => Promise.resolve().then(() => __importStar(require('../tools/core/read-file'))),
|
|
184
185
|
write_file: () => Promise.resolve().then(() => __importStar(require('../tools/core/write-file'))),
|
|
185
186
|
});
|
|
@@ -113,6 +113,13 @@ class FirstPartySandboxServiceV1 {
|
|
|
113
113
|
const descriptor = input.descriptor;
|
|
114
114
|
if (descriptor.name === 'exec_command')
|
|
115
115
|
return this.prepareCommand(input);
|
|
116
|
+
if (descriptor.name === 'process_session') {
|
|
117
|
+
const id = typeof input.args.processId === 'string' ? input.args.processId : '';
|
|
118
|
+
const backend = input.context?.shellProcesses?.backendFor(id, input.snapshot.authority.projectRoot);
|
|
119
|
+
return backend && backend !== 'none'
|
|
120
|
+
? sandbox(backend, 'full', 'Process I/O inherits the sandbox of its authorized launch.')
|
|
121
|
+
: sandbox('unavailable', 'partial', 'No sandboxed process is bound to this handle.');
|
|
122
|
+
}
|
|
116
123
|
if (descriptor.risk.network === 'none' &&
|
|
117
124
|
(descriptor.risk.effect === 'none' ||
|
|
118
125
|
descriptor.risk.effect === 'workspace_read' ||
|
|
@@ -139,6 +146,9 @@ class FirstPartySandboxServiceV1 {
|
|
|
139
146
|
});
|
|
140
147
|
if (!plan.ok)
|
|
141
148
|
return sandbox('unavailable', 'partial', plan.reason);
|
|
149
|
+
if (plan.backend === 'docker' && input.args.interactive === true) {
|
|
150
|
+
return sandbox('docker', 'partial', 'The Docker sandbox does not support interactive process sessions.');
|
|
151
|
+
}
|
|
142
152
|
if (plan.backend === 'none') {
|
|
143
153
|
return sandbox('none', 'none', 'Configured shell execution has no sandbox backend.');
|
|
144
154
|
}
|
|
@@ -285,6 +285,8 @@ function classifyGoalEvidenceKind(name, args) {
|
|
|
285
285
|
if (normalizedName === 'get_goal' || normalizedName === 'update_goal_plan')
|
|
286
286
|
return 'runtime';
|
|
287
287
|
if (normalizedName === 'exec_command') {
|
|
288
|
+
if (args.interactive === true)
|
|
289
|
+
return null;
|
|
288
290
|
const command = typeof args.command === 'string' ? args.command : '';
|
|
289
291
|
if (hasStatusMaskingControlFlow(command))
|
|
290
292
|
return null;
|
|
@@ -94,6 +94,13 @@ export declare function resolveSessionStorageV1(projectPathInput: string, sessio
|
|
|
94
94
|
* authoritative open once and rebuild the derived checkpoint.
|
|
95
95
|
*/
|
|
96
96
|
export declare function openSessionCheckpointStorageV1(projectPathInput: string, sessionId: string): OpenedSessionCheckpointStorageV1 | undefined;
|
|
97
|
+
/** Classify the storage binding even when its cached checkpoint is unavailable. */
|
|
98
|
+
export declare function peekSessionCheckpointStorageV1(projectPathInput: string, sessionId: string, maxBytes: number): {
|
|
99
|
+
readonly kind: 'legacy';
|
|
100
|
+
} | {
|
|
101
|
+
readonly kind: 'thread';
|
|
102
|
+
readonly checkpoint: OpenedSessionCheckpointStorageV1 | undefined;
|
|
103
|
+
};
|
|
97
104
|
/**
|
|
98
105
|
* Resolve and verify one storage generation while retaining the verified
|
|
99
106
|
* ThreadEventStore. Read-side projections can then capture transcript and
|
|
@@ -5,6 +5,7 @@ exports.planLegacyThreadMaterializationV1 = planLegacyThreadMaterializationV1;
|
|
|
5
5
|
exports.materializeLegacyThreadV1 = materializeLegacyThreadV1;
|
|
6
6
|
exports.resolveSessionStorageV1 = resolveSessionStorageV1;
|
|
7
7
|
exports.openSessionCheckpointStorageV1 = openSessionCheckpointStorageV1;
|
|
8
|
+
exports.peekSessionCheckpointStorageV1 = peekSessionCheckpointStorageV1;
|
|
8
9
|
exports.openSessionStorageV1 = openSessionStorageV1;
|
|
9
10
|
exports.loadThreadCutoverIndexV1 = loadThreadCutoverIndexV1;
|
|
10
11
|
exports.deleteSessionThreadRecordsV1 = deleteSessionThreadRecordsV1;
|
|
@@ -12,6 +13,7 @@ const fs_1 = require("fs");
|
|
|
12
13
|
const path_1 = require("path");
|
|
13
14
|
const atomic_write_1 = require("../services/atomic-write");
|
|
14
15
|
const file_lock_1 = require("../services/file-lock");
|
|
16
|
+
const bounded_file_1 = require("../utils/bounded-file");
|
|
15
17
|
const paths_1 = require("../product/paths");
|
|
16
18
|
const canonical_1 = require("./protocol/canonical");
|
|
17
19
|
const legacy_session_importer_1 = require("./legacy-session-importer");
|
|
@@ -124,10 +126,26 @@ function openSessionCheckpointStorageV1(projectPathInput, sessionId) {
|
|
|
124
126
|
const entry = index.sessions[sessionId];
|
|
125
127
|
if (!entry)
|
|
126
128
|
return undefined;
|
|
129
|
+
return openBoundSessionCheckpoint(projectPath, sessionId, entry, index.generation);
|
|
130
|
+
}
|
|
131
|
+
/** Classify the storage binding even when its cached checkpoint is unavailable. */
|
|
132
|
+
function peekSessionCheckpointStorageV1(projectPathInput, sessionId, maxBytes) {
|
|
133
|
+
const projectPath = (0, path_1.resolve)(projectPathInput);
|
|
134
|
+
const index = readThreadCutoverIndex((0, paths_1.getProjectThreadsV2IndexPath)(projectPath), maxBytes);
|
|
135
|
+
if (!Object.prototype.hasOwnProperty.call(index.sessions, sessionId))
|
|
136
|
+
return { kind: 'legacy' };
|
|
137
|
+
return {
|
|
138
|
+
kind: 'thread',
|
|
139
|
+
checkpoint: openBoundSessionCheckpoint(projectPath, sessionId, index.sessions[sessionId], index.generation, maxBytes),
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
function openBoundSessionCheckpoint(projectPath, sessionId, entry, generation, maxBytes) {
|
|
127
143
|
const store = new thread_event_store_1.ThreadEventStore((0, paths_1.getProjectThreadsV2Dir)(projectPath), entry.threadId, {
|
|
128
144
|
maxReplayEvents: Math.max(10000, entry.cursor),
|
|
129
145
|
});
|
|
130
|
-
const head =
|
|
146
|
+
const head = maxBytes === undefined
|
|
147
|
+
? store.capturePersistedCheckpointHead()
|
|
148
|
+
: store.peekPersistedCheckpointHead(maxBytes);
|
|
131
149
|
if (!head ||
|
|
132
150
|
head.cursor < entry.cursor ||
|
|
133
151
|
!head.verifiedPrefixes.some(prefix => prefix.cursor === entry.cursor &&
|
|
@@ -145,7 +163,7 @@ function openSessionCheckpointStorageV1(projectPathInput, sessionId) {
|
|
|
145
163
|
threadId: entry.threadId,
|
|
146
164
|
cursor: head.cursor,
|
|
147
165
|
projectionDigest: head.projectionDigest,
|
|
148
|
-
generation
|
|
166
|
+
generation,
|
|
149
167
|
}),
|
|
150
168
|
store,
|
|
151
169
|
head,
|
|
@@ -620,14 +638,22 @@ function assertSourceUnchanged(projectPath, sessionId, expectedImportDigest) {
|
|
|
620
638
|
throw sourceChanged('Legacy source changed after v2 facts were materialized');
|
|
621
639
|
}
|
|
622
640
|
}
|
|
623
|
-
function readThreadCutoverIndex(path) {
|
|
624
|
-
if (!(0, fs_1.existsSync)(path))
|
|
641
|
+
function readThreadCutoverIndex(path, maxBytes) {
|
|
642
|
+
if (maxBytes === undefined && !(0, fs_1.existsSync)(path))
|
|
625
643
|
return emptyIndex();
|
|
626
644
|
let index;
|
|
627
645
|
try {
|
|
628
|
-
|
|
646
|
+
const contentText = maxBytes === undefined
|
|
647
|
+
? (0, fs_1.readFileSync)(path, 'utf8')
|
|
648
|
+
: (0, bounded_file_1.readBoundedRegularFileSync)(path, maxBytes)?.toString('utf8');
|
|
649
|
+
if (contentText === undefined)
|
|
650
|
+
throw new Error('Thread cutover index exceeds preview limits');
|
|
651
|
+
index = JSON.parse(contentText);
|
|
629
652
|
}
|
|
630
|
-
catch {
|
|
653
|
+
catch (error) {
|
|
654
|
+
if (maxBytes !== undefined && error.code === 'ENOENT') {
|
|
655
|
+
return emptyIndex();
|
|
656
|
+
}
|
|
631
657
|
throw indexCorrupt(`Thread cutover index is unreadable: ${path}`);
|
|
632
658
|
}
|
|
633
659
|
const { digest: _digest, ...content } = index;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ToolContext } from '../framework/tool';
|
|
2
2
|
import type { StopDecision } from '../framework/stop-decision';
|
|
3
|
-
import type { LLMService, Message, StreamCallbacks } from '../services/llm';
|
|
3
|
+
import type { LLMService, Message, StreamCallbacks, StructuredOutputSchema } from '../services/llm';
|
|
4
4
|
import { AgentLoopV1 } from './agent-loop';
|
|
5
5
|
import { type BuiltinToolCatalogV1 } from './builtin-tool-provider';
|
|
6
6
|
import type { CapabilityToolCandidateV1 } from './capabilities';
|
|
@@ -78,6 +78,7 @@ export interface OrionSubagentCompositionV1 extends RuntimeServicePort {
|
|
|
78
78
|
}
|
|
79
79
|
export interface OrionRuntimeLoopOptionsV1 {
|
|
80
80
|
readonly streamCallbacks?: StreamCallbacks;
|
|
81
|
+
readonly outputSchema?: StructuredOutputSchema;
|
|
81
82
|
readonly loopBudget?: ConstructorParameters<typeof AgentLoopV1>[0]['loopBudget'];
|
|
82
83
|
/** Resolve each turn from trusted product input, not a model-authored continuation prompt. */
|
|
83
84
|
readonly resolveLoopBudget?: (context: ThreadTurnExecutionContextV1, goal: GoalRuntimeCoordinatorV2) => ConstructorParameters<typeof AgentLoopV1>[0]['loopBudget'];
|
|
@@ -536,6 +536,7 @@ class OrionRuntimeV1 {
|
|
|
536
536
|
const loopOptions = this.options.loop;
|
|
537
537
|
const agentLoop = new agent_loop_1.AgentLoopV1({
|
|
538
538
|
llm: this.options.modelExecutor,
|
|
539
|
+
outputSchema: loopOptions?.outputSchema,
|
|
539
540
|
taskContext,
|
|
540
541
|
steps: stepFactory,
|
|
541
542
|
gateway,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type UIRenderer } from '../services/config';
|
|
2
|
+
import { type StructuredOutputSchema } from '../services/llm';
|
|
2
3
|
import { type SettingsInvalidationV1 } from '../services/settings-coordinator';
|
|
3
4
|
import { type SessionMeta } from '../services/session-storage';
|
|
4
5
|
import { type FirstPartyMcpServerConfigV1 } from './mcp';
|
|
@@ -24,6 +25,7 @@ export declare function createWorkspaceRuntimeKernelV1(options: CreateWorkspaceR
|
|
|
24
25
|
export interface ProductUiRuntimeBootstrapOptions {
|
|
25
26
|
readonly cwd: string;
|
|
26
27
|
readonly uiRenderer?: UIRenderer;
|
|
28
|
+
readonly outputSchema?: StructuredOutputSchema;
|
|
27
29
|
readonly sessionSource?: SessionMeta['source'];
|
|
28
30
|
readonly sessionMcpServers?: Readonly<Record<string, FirstPartyMcpServerConfigV1>>;
|
|
29
31
|
/** Renderer-specific shutdown label used in durable diagnostics. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Store } from '../framework/store';
|
|
2
2
|
import type { OrionCodeCLIConfig } from '../services/config';
|
|
3
3
|
import type { CompactCoordinator } from '../services/compact/coordinator';
|
|
4
|
-
import { LLMService } from '../services/llm';
|
|
4
|
+
import { LLMService, type StructuredOutputSchema } from '../services/llm';
|
|
5
5
|
import type { ProviderRequestGate } from '../services/provider-resilience/request-gate';
|
|
6
6
|
import { type BuiltinToolCatalogV1 } from './builtin-tool-provider';
|
|
7
7
|
import type { McpConnectorV1, McpServerDescriptorInputV1 } from './mcp';
|
|
@@ -17,6 +17,7 @@ export interface ProductOrionRuntimeOptionsV1 {
|
|
|
17
17
|
readonly config: OrionCodeCLIConfig;
|
|
18
18
|
readonly store: Store;
|
|
19
19
|
readonly llm: LLMService;
|
|
20
|
+
readonly outputSchema?: StructuredOutputSchema;
|
|
20
21
|
/** Runtime-owned coordinator used by automatic and explicit maintenance compaction. */
|
|
21
22
|
readonly compactCoordinator?: CompactCoordinator;
|
|
22
23
|
readonly toolCatalog: BuiltinToolCatalogV1;
|
|
@@ -142,6 +142,7 @@ function createProductOrionRuntimeV1(options, sessionId, activation) {
|
|
|
142
142
|
return assembled.messages;
|
|
143
143
|
},
|
|
144
144
|
loop: {
|
|
145
|
+
outputSchema: options.outputSchema,
|
|
145
146
|
resolveLoopBudget: (context, goal) => (0, loop_budget_1.resolveRuntimeLoopBudget)(context.mode === 'goal' ? (goal.state?.objective ?? '') : context.input, options.config),
|
|
146
147
|
...(options.compactCoordinator ? { compactCoordinator: options.compactCoordinator } : {}),
|
|
147
148
|
onContextUsage: usage => options.store.setContextUsage(usage),
|
|
@@ -4,7 +4,6 @@ export type SupportedReleaseNodeMajorV1 = (typeof SUPPORTED_RELEASE_NODE_MAJORS_
|
|
|
4
4
|
export declare const SUPPORTED_RELEASE_NODE_FLOORS_V1: Readonly<Record<SupportedReleaseNodeMajorV1, readonly [number, number, number]>>;
|
|
5
5
|
/** CLI-only V2 intentionally rejects retired browser/runtime receipt envelopes. */
|
|
6
6
|
export declare const CLI_RELEASE_RECEIPT_VERSION_V2: 2;
|
|
7
|
-
export declare const SUPPORTED_RELEASE_VERSION_LINE_V2: "0.4.x";
|
|
8
7
|
export declare const CLI_RUNTIME_PROBE_IDS_V2: readonly ["clean_install", "package_identity", "version", "help", "public_exports", "builtin_skill_assets", "native_sqlite", "tui_journey", "terminal_journey", "print_journey", "goal_journey", "subagent_journey", "skill_journey", "mcp_journey", "compact_resume_journey"];
|
|
9
8
|
export type ReleaseGateDecisionV1 = 'GO' | 'NO_GO';
|
|
10
9
|
export interface TarballArtifactReceiptV1 {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CLI_RUNTIME_PROBE_IDS_V2 = exports.
|
|
3
|
+
exports.CLI_RUNTIME_PROBE_IDS_V2 = exports.CLI_RELEASE_RECEIPT_VERSION_V2 = exports.SUPPORTED_RELEASE_NODE_FLOORS_V1 = exports.SUPPORTED_RELEASE_NODE_MAJORS_V1 = exports.RELEASE_RECEIPT_VERSION_V1 = void 0;
|
|
4
4
|
exports.createTarballArtifactReceiptV1 = createTarballArtifactReceiptV1;
|
|
5
5
|
exports.verifyTarballArtifactReceiptV1 = verifyTarballArtifactReceiptV1;
|
|
6
6
|
exports.createRuntimeMatrixReceiptV2 = createRuntimeMatrixReceiptV2;
|
|
@@ -20,7 +20,7 @@ exports.SUPPORTED_RELEASE_NODE_FLOORS_V1 = Object.freeze({
|
|
|
20
20
|
});
|
|
21
21
|
/** CLI-only V2 intentionally rejects retired browser/runtime receipt envelopes. */
|
|
22
22
|
exports.CLI_RELEASE_RECEIPT_VERSION_V2 = 2;
|
|
23
|
-
|
|
23
|
+
const STABLE_RELEASE_VERSION = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/u;
|
|
24
24
|
exports.CLI_RUNTIME_PROBE_IDS_V2 = Object.freeze([
|
|
25
25
|
'clean_install',
|
|
26
26
|
'package_identity',
|
|
@@ -203,7 +203,12 @@ function createReleaseReceiptV2(input) {
|
|
|
203
203
|
const majors = runtimeMatrix.map(receipt => receipt.environment.nodeMajor);
|
|
204
204
|
check('source_clean', !artifact.source.dirty, 'candidate source must be clean');
|
|
205
205
|
check('package_identity', artifact.package.name === '@orion-agents/orion-code', 'candidate must be the Orion Code CLI package');
|
|
206
|
-
|
|
206
|
+
const version = artifact.package.version;
|
|
207
|
+
const stable = STABLE_RELEASE_VERSION.exec(version);
|
|
208
|
+
const supported = stable !== null && (stable[1] !== '0' || Number(stable[2]) >= 4);
|
|
209
|
+
// Preserve published 0.4.x receipt digests when verifying archived releases.
|
|
210
|
+
const expectedVersion = stable?.[1] === '0' && stable[2] === '4' ? '0.4.x' : 'stable >=0.4.0';
|
|
211
|
+
check('release_version', supported, `expected=${expectedVersion} observed=${version}`);
|
|
207
212
|
check('runtime_matrix_complete', majors.length === 3 &&
|
|
208
213
|
exports.SUPPORTED_RELEASE_NODE_MAJORS_V1.every((major, index) => majors[index] === major), `required=22,24,26 observed=${majors.join(',')}`);
|
|
209
214
|
check('runtime_floor_versions', runtimeMatrix.length === 3 &&
|
|
@@ -6,7 +6,9 @@ export interface RichTextLayoutOptions {
|
|
|
6
6
|
theme: RichTextThemeResolver;
|
|
7
7
|
/** Left indentation for the content (continuation alignment). */
|
|
8
8
|
indent?: number;
|
|
9
|
+
/** Preserve logical lines for native soft wrapping in terminal scrollback. */
|
|
10
|
+
nativeWrap?: boolean;
|
|
9
11
|
}
|
|
10
|
-
/**
|
|
12
|
+
/** Fit visual rows to the width unless the terminal owns wrapping. */
|
|
11
13
|
export declare function layoutRichText(doc: RichTextDocument, options: RichTextLayoutOptions): StyledRow[];
|
|
12
14
|
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -8,13 +8,13 @@ exports.layoutRichText = layoutRichText;
|
|
|
8
8
|
const string_width_1 = __importDefault(require("string-width"));
|
|
9
9
|
const grapheme_1 = require("../composer/grapheme");
|
|
10
10
|
const style_1 = require("../../tui-core/style");
|
|
11
|
-
/**
|
|
11
|
+
/** Fit visual rows to the width unless the terminal owns wrapping. */
|
|
12
12
|
function layoutRichText(doc, options) {
|
|
13
13
|
const width = normalizeWidth(options.width);
|
|
14
14
|
const indent = normalizeIndent(options.indent ?? 0, width);
|
|
15
15
|
const rows = [];
|
|
16
16
|
for (const block of doc.blocks) {
|
|
17
|
-
const blockRows = layoutBlock(block, width, options.theme, indent);
|
|
17
|
+
const blockRows = layoutBlock(block, width, options.theme, indent, options.nativeWrap ?? false);
|
|
18
18
|
if (blockRows.length === 0)
|
|
19
19
|
continue;
|
|
20
20
|
if (rows.length > 0)
|
|
@@ -24,20 +24,20 @@ function layoutRichText(doc, options) {
|
|
|
24
24
|
}
|
|
25
25
|
return rows;
|
|
26
26
|
}
|
|
27
|
-
function layoutBlock(block, width, theme, indent) {
|
|
27
|
+
function layoutBlock(block, width, theme, indent, nativeWrap) {
|
|
28
28
|
switch (block.type) {
|
|
29
29
|
case 'paragraph':
|
|
30
|
-
return layoutInline(block.spans, width, theme, theme('assistantText'), indent);
|
|
30
|
+
return layoutInline(block.spans, width, theme, theme('assistantText'), indent, nativeWrap);
|
|
31
31
|
case 'heading':
|
|
32
|
-
return layoutInline(block.spans, width, theme, theme('heading'), indent);
|
|
32
|
+
return layoutInline(block.spans, width, theme, theme('heading'), indent, nativeWrap);
|
|
33
33
|
case 'list':
|
|
34
|
-
return layoutList(block, width, theme, indent);
|
|
34
|
+
return layoutList(block, width, theme, indent, nativeWrap);
|
|
35
35
|
case 'quote':
|
|
36
|
-
return layoutQuote(block, width, theme, indent);
|
|
36
|
+
return layoutQuote(block, width, theme, indent, nativeWrap);
|
|
37
37
|
case 'code':
|
|
38
|
-
return layoutCode(block.lines, width, theme, indent, block.language);
|
|
38
|
+
return layoutCode(block.lines, width, theme, indent, nativeWrap, block.language);
|
|
39
39
|
case 'diff':
|
|
40
|
-
return layoutDiff(block.lines, width, theme, indent);
|
|
40
|
+
return layoutDiff(block.lines, width, theme, indent, nativeWrap);
|
|
41
41
|
case 'table':
|
|
42
42
|
return layoutTable(block, width, theme, indent);
|
|
43
43
|
case 'rule': {
|
|
@@ -51,15 +51,15 @@ function layoutBlock(block, width, theme, indent) {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
function layoutInline(spans, width, theme, baseStyle, indent) {
|
|
54
|
+
function layoutInline(spans, width, theme, baseStyle, indent, nativeWrap = false) {
|
|
55
55
|
const prefix = indent > 0 ? [{ text: ' '.repeat(indent), style: baseStyle }] : [];
|
|
56
56
|
const styled = spans.map(span => ({
|
|
57
57
|
text: span.text,
|
|
58
58
|
style: resolveSpanStyle(span, baseStyle, theme),
|
|
59
59
|
}));
|
|
60
|
-
return layoutPrefixedSpans(styled, width, prefix, prefix, 'word');
|
|
60
|
+
return layoutPrefixedSpans(styled, width, prefix, prefix, 'word', nativeWrap);
|
|
61
61
|
}
|
|
62
|
-
function layoutList(block, width, theme, indent) {
|
|
62
|
+
function layoutList(block, width, theme, indent, nativeWrap) {
|
|
63
63
|
const rows = [];
|
|
64
64
|
block.items.forEach((item, itemIndex) => {
|
|
65
65
|
const marker = block.ordered ? `${itemIndex + 1}. ` : '- ';
|
|
@@ -79,19 +79,19 @@ function layoutList(block, width, theme, indent) {
|
|
|
79
79
|
text: span.text,
|
|
80
80
|
style: resolveSpanStyle(span, base, theme),
|
|
81
81
|
}));
|
|
82
|
-
rows.push(...layoutPrefixedSpans(styled, width, firstPrefix, continuationPrefix, 'word'));
|
|
82
|
+
rows.push(...layoutPrefixedSpans(styled, width, firstPrefix, continuationPrefix, 'word', nativeWrap));
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
85
|
if (blockIndex === 0) {
|
|
86
86
|
rows.push(clampRow(firstPrefix, width));
|
|
87
87
|
}
|
|
88
88
|
const childIndent = normalizeIndent(markerIndent + (0, string_width_1.default)(marker), width);
|
|
89
|
-
rows.push(...layoutBlock(subBlock, width, theme, childIndent));
|
|
89
|
+
rows.push(...layoutBlock(subBlock, width, theme, childIndent, nativeWrap));
|
|
90
90
|
});
|
|
91
91
|
});
|
|
92
92
|
return rows;
|
|
93
93
|
}
|
|
94
|
-
function layoutQuote(block, width, theme, indent) {
|
|
94
|
+
function layoutQuote(block, width, theme, indent, nativeWrap) {
|
|
95
95
|
const prefix = [
|
|
96
96
|
{
|
|
97
97
|
text: `${' '.repeat(normalizeIndent(indent, width))}> `,
|
|
@@ -102,16 +102,17 @@ function layoutQuote(block, width, theme, indent) {
|
|
|
102
102
|
const childWidth = Math.max(1, width - prefixWidth);
|
|
103
103
|
const rows = [];
|
|
104
104
|
for (const child of block.blocks) {
|
|
105
|
-
const childRows = layoutBlock(child, childWidth, theme, 0);
|
|
105
|
+
const childRows = layoutBlock(child, childWidth, theme, 0, nativeWrap);
|
|
106
106
|
if (childRows.length === 0)
|
|
107
107
|
rows.push(clampRow(prefix, width));
|
|
108
108
|
for (const childRow of childRows) {
|
|
109
|
-
|
|
109
|
+
const row = [...prefix, ...childRow];
|
|
110
|
+
rows.push(nativeWrap ? row : clampRow(row, width));
|
|
110
111
|
}
|
|
111
112
|
}
|
|
112
113
|
return rows;
|
|
113
114
|
}
|
|
114
|
-
function layoutCode(lines, width, theme, indent, language) {
|
|
115
|
+
function layoutCode(lines, width, theme, indent, nativeWrap, language) {
|
|
115
116
|
const safeIndent = normalizeIndent(indent, width);
|
|
116
117
|
const available = Math.max(1, width - safeIndent);
|
|
117
118
|
const style = theme('code');
|
|
@@ -121,9 +122,17 @@ function layoutCode(lines, width, theme, indent, language) {
|
|
|
121
122
|
const labelStyle = mergeStyles(style, theme('muted'));
|
|
122
123
|
const labelPrefix = safeIndent > 0 ? [{ text: ' '.repeat(safeIndent), style: labelStyle }] : [];
|
|
123
124
|
const label = truncateToWidth(language, available);
|
|
124
|
-
|
|
125
|
+
const labelRow = [{ text: label, style: labelStyle }];
|
|
126
|
+
rows.push([
|
|
127
|
+
...labelPrefix,
|
|
128
|
+
...(nativeWrap ? labelRow : padRow(labelRow, available, labelStyle)),
|
|
129
|
+
]);
|
|
125
130
|
}
|
|
126
131
|
for (const line of lines.length > 0 ? lines : ['']) {
|
|
132
|
+
if (nativeWrap) {
|
|
133
|
+
rows.push([...prefix, { text: line, style }]);
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
127
136
|
const gutter = available >= 6 && (0, string_width_1.default)(line) > available ? 2 : 0;
|
|
128
137
|
const wrapped = wrapStyledSpans([{ text: line, style }], available - gutter, 'code');
|
|
129
138
|
wrapped.forEach((row, index) => {
|
|
@@ -135,7 +144,7 @@ function layoutCode(lines, width, theme, indent, language) {
|
|
|
135
144
|
}
|
|
136
145
|
return rows;
|
|
137
146
|
}
|
|
138
|
-
function layoutDiff(lines, width, theme, indent) {
|
|
147
|
+
function layoutDiff(lines, width, theme, indent, nativeWrap) {
|
|
139
148
|
const rows = [];
|
|
140
149
|
const safeIndent = normalizeIndent(indent, width);
|
|
141
150
|
for (const line of lines) {
|
|
@@ -143,7 +152,7 @@ function layoutDiff(lines, width, theme, indent) {
|
|
|
143
152
|
const style = diffLineStyle(line.kind, theme);
|
|
144
153
|
const firstPrefix = [{ text: `${' '.repeat(safeIndent)}${prefix}`, style }];
|
|
145
154
|
const continuationPrefix = [{ text: `${' '.repeat(safeIndent)}↳`, style }];
|
|
146
|
-
rows.push(...layoutPrefixedSpans([{ text: line.content, style }], width, firstPrefix, continuationPrefix, 'hard'));
|
|
155
|
+
rows.push(...layoutPrefixedSpans([{ text: line.content, style }], width, firstPrefix, continuationPrefix, 'hard', nativeWrap));
|
|
147
156
|
}
|
|
148
157
|
return rows;
|
|
149
158
|
}
|
|
@@ -245,7 +254,13 @@ function layoutTableAsKeyValue(block, width, theme, indent) {
|
|
|
245
254
|
}
|
|
246
255
|
return rows;
|
|
247
256
|
}
|
|
248
|
-
function layoutPrefixedSpans(spans, width, firstPrefix, continuationPrefix, mode) {
|
|
257
|
+
function layoutPrefixedSpans(spans, width, firstPrefix, continuationPrefix, mode, nativeWrap = false) {
|
|
258
|
+
if (nativeWrap) {
|
|
259
|
+
return splitStyledUnitsIntoLines(spans).map((line, index) => [
|
|
260
|
+
...(index === 0 ? firstPrefix : continuationPrefix),
|
|
261
|
+
...unitsToRow(line),
|
|
262
|
+
]);
|
|
263
|
+
}
|
|
249
264
|
const prefixWidth = Math.max(rowWidth(firstPrefix), rowWidth(continuationPrefix));
|
|
250
265
|
if (prefixWidth >= width) {
|
|
251
266
|
const prefixRow = clampRow(firstPrefix, width);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ToolResult } from '../framework/tool';
|
|
2
|
+
export declare const DEFAULT_PROCESS_YIELD_MS = 500;
|
|
3
|
+
export declare const MAX_PROCESS_YIELD_MS = 5000;
|
|
4
|
+
export declare const MAX_PROCESS_INPUT_BYTES = 65536;
|
|
5
|
+
type ProcessAction = 'poll' | 'write' | 'cancel';
|
|
6
|
+
type ProcessBackend = 'none' | 'seatbelt' | 'bubblewrap';
|
|
7
|
+
interface ProcessLaunch {
|
|
8
|
+
file: string;
|
|
9
|
+
args: string[];
|
|
10
|
+
cwd: string;
|
|
11
|
+
projectRoot: string;
|
|
12
|
+
backend: ProcessBackend;
|
|
13
|
+
timeoutMs: number;
|
|
14
|
+
maxOutputBytes: number;
|
|
15
|
+
yieldMs: number;
|
|
16
|
+
signal?: AbortSignal;
|
|
17
|
+
}
|
|
18
|
+
interface ProcessRequest {
|
|
19
|
+
processId: string;
|
|
20
|
+
projectRoot: string;
|
|
21
|
+
action: ProcessAction;
|
|
22
|
+
input?: string;
|
|
23
|
+
yieldMs: number;
|
|
24
|
+
signal?: AbortSignal;
|
|
25
|
+
}
|
|
26
|
+
/** Retained commands belong to one running Thread/Turn and are never restored from storage. */
|
|
27
|
+
export declare class TurnShellProcesses {
|
|
28
|
+
private readonly turnSignal?;
|
|
29
|
+
private readonly sessions;
|
|
30
|
+
private closing?;
|
|
31
|
+
private readonly abort;
|
|
32
|
+
constructor(turnSignal?: AbortSignal | undefined);
|
|
33
|
+
start(options: ProcessLaunch): Promise<ToolResult>;
|
|
34
|
+
backendFor(processId: string, projectRoot: string): ProcessBackend | undefined;
|
|
35
|
+
operate(request: ProcessRequest): Promise<ToolResult>;
|
|
36
|
+
close(): Promise<void>;
|
|
37
|
+
private get;
|
|
38
|
+
private read;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=shell-process-sessions.d.ts.map
|