neoctl 0.2.29 → 0.2.31
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 +40 -4
- package/dist/context/compaction.d.ts +20 -4
- package/dist/context/compaction.js +377 -186
- package/dist/context/compaction.js.map +1 -1
- package/dist/context/context-manager.d.ts +7 -1
- package/dist/context/context-manager.js +15 -11
- package/dist/context/context-manager.js.map +1 -1
- package/dist/context/prompts.js +2 -0
- package/dist/context/prompts.js.map +1 -1
- package/dist/context/smoke-context.js +266 -17
- package/dist/context/smoke-context.js.map +1 -1
- package/dist/core/assistant-output-filter.d.ts +1 -0
- package/dist/core/assistant-output-filter.js +54 -2
- package/dist/core/assistant-output-filter.js.map +1 -1
- package/dist/core/context-metrics.d.ts +1 -0
- package/dist/core/context-metrics.js +18 -12
- package/dist/core/context-metrics.js.map +1 -1
- package/dist/core/image-registry.d.ts +16 -3
- package/dist/core/image-registry.js +65 -30
- package/dist/core/image-registry.js.map +1 -1
- package/dist/core/image-storage.d.ts +15 -1
- package/dist/core/image-storage.js +140 -17
- package/dist/core/image-storage.js.map +1 -1
- package/dist/core/message-pipeline.js +18 -4
- package/dist/core/message-pipeline.js.map +1 -1
- package/dist/core/query-engine.d.ts +12 -2
- package/dist/core/query-engine.js +57 -8
- package/dist/core/query-engine.js.map +1 -1
- package/dist/core/query.d.ts +13 -2
- package/dist/core/query.js +56 -21
- package/dist/core/query.js.map +1 -1
- package/dist/core/smoke-core-loop.js +68 -3
- package/dist/core/smoke-core-loop.js.map +1 -1
- package/dist/core/smoke-image-integrity.d.ts +1 -0
- package/dist/core/smoke-image-integrity.js +67 -0
- package/dist/core/smoke-image-integrity.js.map +1 -0
- package/dist/core/state.d.ts +1 -1
- package/dist/core/state.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/model/model-metadata.json +4 -4
- package/dist/plugins/plugin-system.d.ts +61 -0
- package/dist/plugins/plugin-system.js +189 -0
- package/dist/plugins/plugin-system.js.map +1 -0
- package/dist/plugins/smoke-plugin-system.d.ts +1 -0
- package/dist/plugins/smoke-plugin-system.js +63 -0
- package/dist/plugins/smoke-plugin-system.js.map +1 -0
- package/dist/repl/index.js +8 -3
- package/dist/repl/index.js.map +1 -1
- package/dist/session/session-export.d.ts +2 -0
- package/dist/session/session-export.js +10 -0
- package/dist/session/session-export.js.map +1 -1
- package/dist/session/session-store.d.ts +41 -0
- package/dist/session/session-store.js +292 -59
- package/dist/session/session-store.js.map +1 -1
- package/dist/session/smoke-session.js +127 -7
- package/dist/session/smoke-session.js.map +1 -1
- package/dist/tools/builtins/exec-process-manager.d.ts +16 -2
- package/dist/tools/builtins/exec-process-manager.js +119 -25
- package/dist/tools/builtins/exec-process-manager.js.map +1 -1
- package/dist/tools/builtins/exec-tool.js +11 -2
- package/dist/tools/builtins/exec-tool.js.map +1 -1
- package/dist/tools/builtins/image-generation-tool.js +32 -42
- package/dist/tools/builtins/image-generation-tool.js.map +1 -1
- package/dist/tools/builtins/image-loader-tool.js +10 -4
- package/dist/tools/builtins/image-loader-tool.js.map +1 -1
- package/dist/tools/builtins/image-note-tool.js +8 -3
- package/dist/tools/builtins/image-note-tool.js.map +1 -1
- package/dist/tools/registry.d.ts +8 -1
- package/dist/tools/registry.js +37 -13
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/smoke-exec-process.js +88 -4
- package/dist/tools/smoke-exec-process.js.map +1 -1
- package/dist/tools/smoke-tool-system.js +24 -6
- package/dist/tools/smoke-tool-system.js.map +1 -1
- package/dist/types/events.d.ts +5 -1
- package/dist/types/messages.d.ts +13 -5
- package/dist/types/messages.js +4 -0
- package/dist/types/messages.js.map +1 -1
- package/dist/ui/display-message.d.ts +10 -2
- package/dist/ui/display-message.js +18 -9
- package/dist/ui/display-message.js.map +1 -1
- package/dist/web/index.d.ts +176 -11
- package/dist/web/index.js +986 -106
- package/dist/web/index.js.map +1 -1
- package/dist/web/runtime-context-protocol.d.ts +12 -1
- package/dist/web/runtime-context-protocol.js +16 -1
- package/dist/web/runtime-context-protocol.js.map +1 -1
- package/dist/web/smoke-runtime-context-protocol.js +3 -0
- package/dist/web/smoke-runtime-context-protocol.js.map +1 -1
- package/dist/web/smoke-web-history.d.ts +1 -0
- package/dist/web/smoke-web-history.js +121 -0
- package/dist/web/smoke-web-history.js.map +1 -0
- package/dist/web/smoke-web-terminal-tasks.d.ts +1 -0
- package/dist/web/smoke-web-terminal-tasks.js +90 -0
- package/dist/web/smoke-web-terminal-tasks.js.map +1 -0
- package/package.json +5 -1
|
@@ -43,8 +43,13 @@ export type DisplayMessageBlock = {
|
|
|
43
43
|
};
|
|
44
44
|
export interface DisplayImageBlock {
|
|
45
45
|
type: "image";
|
|
46
|
+
imageId?: string;
|
|
46
47
|
label?: string;
|
|
47
48
|
mimeType: string;
|
|
49
|
+
available: boolean;
|
|
50
|
+
error?: string;
|
|
51
|
+
/** Index in the source message block array; stable even when display-only blocks are omitted. */
|
|
52
|
+
blockIndex?: number;
|
|
48
53
|
/** Approximate original payload size decoded from base64, when available. */
|
|
49
54
|
sizeBytes?: number;
|
|
50
55
|
storagePath?: string;
|
|
@@ -79,8 +84,11 @@ export interface DisplayImageAttachment {
|
|
|
79
84
|
role: DisplayMessage["role"];
|
|
80
85
|
createdAt: string;
|
|
81
86
|
index: number;
|
|
87
|
+
imageId?: string;
|
|
82
88
|
label?: string;
|
|
83
89
|
mimeType: string;
|
|
90
|
+
available: boolean;
|
|
91
|
+
error?: string;
|
|
84
92
|
sizeBytes?: number;
|
|
85
93
|
storagePath?: string;
|
|
86
94
|
src?: string;
|
|
@@ -94,10 +102,10 @@ export declare function toDisplayAgentEvent(event: AgentEvent, options?: Display
|
|
|
94
102
|
export declare function toDisplayAgentEvents(events: readonly AgentEvent[], options?: DisplayMessageOptions): DisplayAgentEvent[];
|
|
95
103
|
export declare function toDisplayMessages(messages: readonly Message[], options?: DisplayMessageOptions): DisplayMessage[];
|
|
96
104
|
export declare function toDisplayMessage(message: Message, options?: DisplayMessageOptions): DisplayMessage;
|
|
97
|
-
export declare function toDisplayMessageBlock(block: MessageBlock, options?: DisplayMessageOptions): DisplayMessageBlock | undefined;
|
|
105
|
+
export declare function toDisplayMessageBlock(block: MessageBlock, options?: DisplayMessageOptions, blockIndex?: number): DisplayMessageBlock | undefined;
|
|
98
106
|
export declare function toDisplayImageBlock(block: Extract<MessageBlock, {
|
|
99
107
|
type: "image";
|
|
100
|
-
}>, options?: DisplayMessageOptions): DisplayImageBlock | undefined;
|
|
108
|
+
}>, options?: DisplayMessageOptions, blockIndex?: number): DisplayImageBlock | undefined;
|
|
101
109
|
export declare function extractDisplayImages(messages: readonly DisplayMessage[]): DisplayImageAttachment[];
|
|
102
110
|
export declare function extractMessageImages(messages: readonly Message[], options?: DisplayMessageOptions): DisplayImageAttachment[];
|
|
103
111
|
export declare function estimateBase64DecodedBytes(data: string): number | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { resolveImageBlockDataSync } from "../core/image-storage.js";
|
|
1
|
+
import { resolveImageBlockDataResultSync, resolveImageBlockDataSync } from "../core/image-storage.js";
|
|
2
2
|
export function imageBlockToDataUrl(block) {
|
|
3
3
|
const data = resolveImageBlockDataSync(block);
|
|
4
4
|
if (!data)
|
|
@@ -20,7 +20,7 @@ export function toDisplayMessages(messages, options = {}) {
|
|
|
20
20
|
}
|
|
21
21
|
export function toDisplayMessage(message, options = {}) {
|
|
22
22
|
const blocks = message.blocks
|
|
23
|
-
.map((block) => toDisplayMessageBlock(block, options))
|
|
23
|
+
.map((block, blockIndex) => toDisplayMessageBlock(block, options, blockIndex))
|
|
24
24
|
.filter((block) => block !== undefined);
|
|
25
25
|
return {
|
|
26
26
|
id: message.id,
|
|
@@ -35,7 +35,7 @@ export function toDisplayMessage(message, options = {}) {
|
|
|
35
35
|
metadata: message.metadata,
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
export function toDisplayMessageBlock(block, options = {}) {
|
|
38
|
+
export function toDisplayMessageBlock(block, options = {}, blockIndex) {
|
|
39
39
|
if (block.type === "text")
|
|
40
40
|
return { type: "text", text: block.text };
|
|
41
41
|
if (block.type === "thinking") {
|
|
@@ -54,23 +54,29 @@ export function toDisplayMessageBlock(block, options = {}) {
|
|
|
54
54
|
return { type: "tool_result", toolUseId: block.toolUseId, name: block.name, ok: block.ok, output: block.output };
|
|
55
55
|
}
|
|
56
56
|
if (block.type === "image")
|
|
57
|
-
return toDisplayImageBlock(block, options);
|
|
57
|
+
return toDisplayImageBlock(block, options, blockIndex);
|
|
58
58
|
return undefined;
|
|
59
59
|
}
|
|
60
|
-
export function toDisplayImageBlock(block, options = {}) {
|
|
60
|
+
export function toDisplayImageBlock(block, options = {}, blockIndex) {
|
|
61
61
|
const imageMode = options.imageMode ?? "data-url";
|
|
62
62
|
if (imageMode === "omit")
|
|
63
63
|
return undefined;
|
|
64
|
+
const resolution = resolveImageBlockDataResultSync(block);
|
|
65
|
+
const data = resolution.available ? resolution.data : "";
|
|
64
66
|
const base = {
|
|
65
67
|
type: "image",
|
|
68
|
+
imageId: block.imageId,
|
|
66
69
|
label: block.label,
|
|
67
70
|
mimeType: block.mimeType,
|
|
68
|
-
|
|
71
|
+
available: resolution.available,
|
|
72
|
+
error: resolution.available ? undefined : resolution.error,
|
|
73
|
+
blockIndex,
|
|
74
|
+
sizeBytes: resolution.available ? estimateBase64DecodedBytes(normalizeBase64ImageData(data)) : undefined,
|
|
69
75
|
storagePath: block.storage?.path,
|
|
70
76
|
};
|
|
71
|
-
if (imageMode === "metadata-only")
|
|
77
|
+
if (imageMode === "metadata-only" || !resolution.available)
|
|
72
78
|
return base;
|
|
73
|
-
const src =
|
|
79
|
+
const src = data.startsWith("data:") ? data : `data:${block.mimeType};base64,${data}`;
|
|
74
80
|
return {
|
|
75
81
|
...base,
|
|
76
82
|
thumbnail: { src, mimeType: block.mimeType },
|
|
@@ -87,9 +93,12 @@ export function extractDisplayImages(messages) {
|
|
|
87
93
|
messageId: message.id,
|
|
88
94
|
role: message.role,
|
|
89
95
|
createdAt: message.createdAt,
|
|
90
|
-
index,
|
|
96
|
+
index: block.blockIndex ?? index,
|
|
97
|
+
imageId: block.imageId,
|
|
91
98
|
label: block.label,
|
|
92
99
|
mimeType: block.mimeType,
|
|
100
|
+
available: block.available,
|
|
101
|
+
error: block.error,
|
|
93
102
|
sizeBytes: block.sizeBytes,
|
|
94
103
|
storagePath: block.storagePath,
|
|
95
104
|
src: block.original?.src ?? block.thumbnail?.src,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display-message.js","sourceRoot":"","sources":["../../src/ui/display-message.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"display-message.js","sourceRoot":"","sources":["../../src/ui/display-message.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,+BAA+B,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAyFtG,MAAM,UAAU,mBAAmB,CAAC,KAA+C;IACjF,MAAM,IAAI,GAAG,yBAAyB,CAAC,KAAK,CAAC,CAAC;IAC9C,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC;IAC1C,OAAO,QAAQ,KAAK,CAAC,QAAQ,WAAW,IAAI,EAAE,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,KAAiB,EAAE,UAAiC,EAAE;IACxF,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAC3C,OAAO,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,gBAAgB,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,MAA6B,EAAE,UAAiC,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MAAM,GAAG,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAChG,MAAM,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjF,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC;AAC5D,CAAC;AAED,SAAS,wBAAwB,CAAC,IAAY;IAC5C,MAAM,KAAK,GAAG,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAC5D,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;AAC5B,CAAC"}
|
package/dist/web/index.d.ts
CHANGED
|
@@ -10,7 +10,9 @@ import type { Tool } from "../tools/tool.js";
|
|
|
10
10
|
import { ExecProcessManager } from "../tools/builtins/exec-process-manager.js";
|
|
11
11
|
import { type AgentToolRuntime } from "../agents/agent-tool.js";
|
|
12
12
|
import { TaskStore } from "../tasks/task-store.js";
|
|
13
|
+
import type { CompactionReport } from "../context/compaction.js";
|
|
13
14
|
import type { PromptSection } from "../context/prompts.js";
|
|
15
|
+
import type { NeoPluginResource } from "../plugins/plugin-system.js";
|
|
14
16
|
import type { ContextMetrics } from "../types/events.js";
|
|
15
17
|
import { type WebRuntimeContextPayload } from "./runtime-context-protocol.js";
|
|
16
18
|
export interface WebRuntime {
|
|
@@ -28,14 +30,12 @@ export interface WebRuntime {
|
|
|
28
30
|
envPath: string;
|
|
29
31
|
envNotice?: string;
|
|
30
32
|
pluginSupport?: WebRuntimePluginSupport;
|
|
33
|
+
toolSupport?: WebRuntimeToolSupport;
|
|
31
34
|
}
|
|
32
|
-
export interface WebRuntimePluginDefinition {
|
|
33
|
-
id: string;
|
|
34
|
-
name: string;
|
|
35
|
-
version: string;
|
|
35
|
+
export interface WebRuntimePluginDefinition extends Pick<NeoPluginResource, "id" | "name" | "version" | "tools"> {
|
|
36
36
|
globallyEnabled: boolean;
|
|
37
|
-
tools: readonly Tool[];
|
|
38
37
|
promptSections?: readonly PromptSection[];
|
|
38
|
+
presentToolResult?: NeoPluginResource["presentToolResult"];
|
|
39
39
|
}
|
|
40
40
|
interface WebRuntimePluginSupport {
|
|
41
41
|
catalog: WebRuntimePluginDefinition[];
|
|
@@ -45,6 +45,20 @@ interface WebRuntimePluginSupport {
|
|
|
45
45
|
persist?: (sessionId: string, overrides: Record<string, boolean>) => Promise<void>;
|
|
46
46
|
resolve?: (sessionId: string) => Promise<Record<string, boolean>> | Record<string, boolean>;
|
|
47
47
|
}
|
|
48
|
+
interface WebRuntimeToolCatalogItem {
|
|
49
|
+
name: string;
|
|
50
|
+
source: "builtin" | "external" | "plugin";
|
|
51
|
+
pluginId?: string;
|
|
52
|
+
pluginName?: string;
|
|
53
|
+
}
|
|
54
|
+
interface WebRuntimeToolSupport {
|
|
55
|
+
catalog: WebRuntimeToolCatalogItem[];
|
|
56
|
+
globalOverrides: Record<string, boolean>;
|
|
57
|
+
sessionOverrides: Record<string, boolean>;
|
|
58
|
+
persistGlobal?: (overrides: Record<string, boolean>) => Promise<void>;
|
|
59
|
+
persistSession?: (sessionId: string, overrides: Record<string, boolean>) => Promise<void>;
|
|
60
|
+
resolveSession?: (sessionId: string) => Promise<Record<string, boolean>> | Record<string, boolean>;
|
|
61
|
+
}
|
|
48
62
|
export interface UsageTotals {
|
|
49
63
|
inputTokens: number;
|
|
50
64
|
outputTokens: number;
|
|
@@ -62,9 +76,45 @@ export declare class SessionUsageTracker {
|
|
|
62
76
|
snapshot(): UsageTotals;
|
|
63
77
|
}
|
|
64
78
|
interface UiLineImage {
|
|
65
|
-
src
|
|
79
|
+
src?: string;
|
|
80
|
+
imageId?: string;
|
|
66
81
|
label?: string;
|
|
67
82
|
mimeType: string;
|
|
83
|
+
available: boolean;
|
|
84
|
+
error?: string;
|
|
85
|
+
blockIndex: number;
|
|
86
|
+
}
|
|
87
|
+
interface UiCompactionReport extends CompactionReport {
|
|
88
|
+
createdAt?: string;
|
|
89
|
+
current?: boolean;
|
|
90
|
+
}
|
|
91
|
+
interface UiResource {
|
|
92
|
+
kind: string;
|
|
93
|
+
url: string;
|
|
94
|
+
reference?: string;
|
|
95
|
+
label?: string;
|
|
96
|
+
downloadName?: string;
|
|
97
|
+
sizeBytes?: number;
|
|
98
|
+
expiresAt?: number;
|
|
99
|
+
mimeType?: string;
|
|
100
|
+
height?: number;
|
|
101
|
+
}
|
|
102
|
+
interface UiToolFact {
|
|
103
|
+
label: string;
|
|
104
|
+
value: string;
|
|
105
|
+
code?: boolean;
|
|
106
|
+
tone?: "neutral" | "success" | "warning" | "danger";
|
|
107
|
+
}
|
|
108
|
+
interface UiToolPreview {
|
|
109
|
+
label?: string;
|
|
110
|
+
kind: "text" | "code" | "diff" | "list";
|
|
111
|
+
content: string;
|
|
112
|
+
}
|
|
113
|
+
interface UiToolDisplay {
|
|
114
|
+
subject?: string;
|
|
115
|
+
purpose?: string;
|
|
116
|
+
facts: UiToolFact[];
|
|
117
|
+
previews: UiToolPreview[];
|
|
68
118
|
}
|
|
69
119
|
interface UiLine {
|
|
70
120
|
id: number;
|
|
@@ -78,12 +128,16 @@ interface UiLine {
|
|
|
78
128
|
title?: string;
|
|
79
129
|
bodyTitle?: string;
|
|
80
130
|
titleStatus?: "success" | "failure";
|
|
131
|
+
toolDisplay?: UiToolDisplay;
|
|
81
132
|
format?: "markdown" | "ansi" | "plain" | "diff";
|
|
82
133
|
previewStyle?: "summary";
|
|
83
134
|
summaryMaxLines?: number;
|
|
135
|
+
presentationLevel?: "primary" | "process";
|
|
136
|
+
resources?: UiResource[];
|
|
84
137
|
live?: boolean;
|
|
85
138
|
collapsible?: boolean;
|
|
86
139
|
image?: UiLineImage;
|
|
140
|
+
compaction?: UiCompactionReport;
|
|
87
141
|
}
|
|
88
142
|
type WebActionFailure = {
|
|
89
143
|
ok: false;
|
|
@@ -127,6 +181,9 @@ export interface CreateWebRuntimeOptions {
|
|
|
127
181
|
agentId?: string;
|
|
128
182
|
/** Workspace root used by context, tools, and session storage. */
|
|
129
183
|
cwd?: string;
|
|
184
|
+
/** Persisted CWD transition chain shown to the model on the next request only. */
|
|
185
|
+
cwdTransitionPaths?: readonly string[];
|
|
186
|
+
onCwdTransitionConsumed?: () => void | Promise<void>;
|
|
130
187
|
/** Additional tools to register in the web runtime. */
|
|
131
188
|
externalTools?: readonly Tool[];
|
|
132
189
|
/** Stable or dynamic prompt sections supplied by the embedding application. */
|
|
@@ -139,6 +196,13 @@ export interface CreateWebRuntimeOptions {
|
|
|
139
196
|
sessionPluginOverrides?: Readonly<Record<string, boolean>>;
|
|
140
197
|
persistSessionPluginOverrides?: WebRuntimePluginSupport["persist"];
|
|
141
198
|
resolveSessionPluginOverrides?: WebRuntimePluginSupport["resolve"];
|
|
199
|
+
/** Global tool defaults. Missing names default to enabled. */
|
|
200
|
+
globalToolOverrides?: Readonly<Record<string, boolean>>;
|
|
201
|
+
/** Per-session tool overrides. Missing names inherit their global default. */
|
|
202
|
+
sessionToolOverrides?: Readonly<Record<string, boolean>>;
|
|
203
|
+
persistGlobalToolOverrides?: WebRuntimeToolSupport["persistGlobal"];
|
|
204
|
+
persistSessionToolOverrides?: WebRuntimeToolSupport["persistSession"];
|
|
205
|
+
resolveSessionToolOverrides?: WebRuntimeToolSupport["resolveSession"];
|
|
142
206
|
}
|
|
143
207
|
export interface WebRuntimeScope {
|
|
144
208
|
/** Browser-tab or client-instance identifier. Omit for the legacy singleton runtime. */
|
|
@@ -170,6 +234,7 @@ interface LoginFormPayload {
|
|
|
170
234
|
}
|
|
171
235
|
interface WebImageAttachmentPayload {
|
|
172
236
|
kind: "image";
|
|
237
|
+
imageId: string;
|
|
173
238
|
label: string;
|
|
174
239
|
mimeType: string;
|
|
175
240
|
data: string;
|
|
@@ -208,10 +273,29 @@ export declare class WebRuntimeRouter {
|
|
|
208
273
|
private readonly repls;
|
|
209
274
|
private readonly createRuntime;
|
|
210
275
|
private readonly createRepl;
|
|
276
|
+
private readonly clientRevision;
|
|
277
|
+
private readonly coreVersion;
|
|
211
278
|
constructor(options?: WebRuntimeRouterOptions);
|
|
212
279
|
get(scope?: WebRuntimeScope): Promise<WebRepl>;
|
|
213
280
|
snapshot(scope?: WebRuntimeScope, includeCatalog?: boolean): Promise<ReturnType<WebRepl["snapshot"]>>;
|
|
214
281
|
activeScopes(): string[];
|
|
282
|
+
clientInfo(): WebClientInfoPayload;
|
|
283
|
+
requestClientReload(options?: {
|
|
284
|
+
clearCache?: boolean;
|
|
285
|
+
reason?: string;
|
|
286
|
+
}): Promise<WebClientReloadPayload & {
|
|
287
|
+
clients: number;
|
|
288
|
+
}>;
|
|
289
|
+
}
|
|
290
|
+
interface WebClientInfoPayload {
|
|
291
|
+
protocolVersion: 1;
|
|
292
|
+
revision: string;
|
|
293
|
+
coreVersion: string;
|
|
294
|
+
}
|
|
295
|
+
interface WebClientReloadPayload extends WebClientInfoPayload {
|
|
296
|
+
requestId: string;
|
|
297
|
+
clearCache: boolean;
|
|
298
|
+
reason: string;
|
|
215
299
|
}
|
|
216
300
|
export declare function createWebRuntimeRouter(options?: WebRuntimeRouterOptions): Promise<WebRuntimeRouter>;
|
|
217
301
|
export declare class WebRepl {
|
|
@@ -221,6 +305,8 @@ export declare class WebRepl {
|
|
|
221
305
|
private pendingDeltaOperations;
|
|
222
306
|
private pendingDeltaStatus;
|
|
223
307
|
private pendingDeltaTimer;
|
|
308
|
+
private readonly pendingTerminalOutput;
|
|
309
|
+
private terminalOutputTimer;
|
|
224
310
|
private lineId;
|
|
225
311
|
private assistantLineId;
|
|
226
312
|
private thinkingLineId;
|
|
@@ -235,29 +321,60 @@ export declare class WebRepl {
|
|
|
235
321
|
private queuedAttachments;
|
|
236
322
|
private foregroundRun;
|
|
237
323
|
private foregroundRunToken;
|
|
238
|
-
private
|
|
324
|
+
private pendingUserImageEchoIds;
|
|
239
325
|
private pendingUserImageEchoMessageId;
|
|
240
326
|
private runtimeContextRevision;
|
|
241
327
|
private runtimeContextPublishQueue;
|
|
242
328
|
private readonly backgroundSessionRuns;
|
|
243
329
|
private readonly suppressReattachedStreaming;
|
|
244
|
-
private backgroundTaskCount;
|
|
245
330
|
constructor(runtime: WebRuntime);
|
|
246
|
-
subscribe(res: ServerResponse): void;
|
|
331
|
+
subscribe(res: ServerResponse, clientInfo?: WebClientInfoPayload): void;
|
|
332
|
+
get backgroundTaskCount(): number;
|
|
333
|
+
requestClientReload(payload: WebClientReloadPayload): number;
|
|
247
334
|
snapshot(includeCatalog?: boolean): {
|
|
248
335
|
lines: UiLine[];
|
|
249
336
|
status: UiStatus;
|
|
250
337
|
busy: boolean;
|
|
251
338
|
queuedInput: string | undefined;
|
|
252
339
|
backgroundTaskCount: number;
|
|
253
|
-
backgroundTasks: {
|
|
340
|
+
backgroundTasks: ({
|
|
341
|
+
kind: "agent";
|
|
254
342
|
taskId: string;
|
|
255
343
|
agentId: string;
|
|
344
|
+
agentType: string | undefined;
|
|
256
345
|
type: import("../index.js").LocalAgentTaskType;
|
|
257
346
|
status: import("../index.js").LocalAgentTaskStatus;
|
|
258
347
|
description: string;
|
|
348
|
+
prompt: string;
|
|
349
|
+
progress: import("../index.js").AgentProgressSnapshot;
|
|
350
|
+
outputFile: string;
|
|
259
351
|
createdAt: string;
|
|
260
|
-
|
|
352
|
+
updatedAt: string;
|
|
353
|
+
} | {
|
|
354
|
+
kind: "terminal";
|
|
355
|
+
taskId: string;
|
|
356
|
+
type: string;
|
|
357
|
+
status: import("../tools/builtins/exec-process-manager.js").ExecProcessStatus;
|
|
358
|
+
description: string;
|
|
359
|
+
createdAt: number;
|
|
360
|
+
sessionId: string;
|
|
361
|
+
processId: number | null;
|
|
362
|
+
command: string;
|
|
363
|
+
cwd: string;
|
|
364
|
+
shell: string;
|
|
365
|
+
tty: boolean;
|
|
366
|
+
durationMs: number;
|
|
367
|
+
output: string;
|
|
368
|
+
outputEnd: number;
|
|
369
|
+
} | {
|
|
370
|
+
kind: "session";
|
|
371
|
+
taskId: string;
|
|
372
|
+
type: string;
|
|
373
|
+
status: "running";
|
|
374
|
+
description: string;
|
|
375
|
+
createdAt: number;
|
|
376
|
+
sessionId: string;
|
|
377
|
+
})[];
|
|
261
378
|
backgroundSessionRunCount: number;
|
|
262
379
|
runningSessionIds: string[];
|
|
263
380
|
session: import("../index.js").SessionStoreSnapshot | undefined;
|
|
@@ -289,10 +406,45 @@ export declare class WebRepl {
|
|
|
289
406
|
promptSections: number;
|
|
290
407
|
}[];
|
|
291
408
|
};
|
|
409
|
+
globalTools(): {
|
|
410
|
+
items: {
|
|
411
|
+
configuredEnabled: boolean;
|
|
412
|
+
name: string;
|
|
413
|
+
source: "builtin" | "external" | "plugin";
|
|
414
|
+
pluginId?: string;
|
|
415
|
+
pluginName?: string;
|
|
416
|
+
}[];
|
|
417
|
+
};
|
|
418
|
+
sessionTools(): {
|
|
419
|
+
sessionId: string | undefined;
|
|
420
|
+
busy: boolean;
|
|
421
|
+
items: {
|
|
422
|
+
available: boolean;
|
|
423
|
+
globallyEnabled: boolean;
|
|
424
|
+
mode: string;
|
|
425
|
+
effectiveEnabled: boolean;
|
|
426
|
+
name: string;
|
|
427
|
+
source: "builtin" | "external" | "plugin";
|
|
428
|
+
pluginId?: string;
|
|
429
|
+
pluginName?: string;
|
|
430
|
+
}[];
|
|
431
|
+
};
|
|
432
|
+
setGlobalTools(value: unknown): Promise<WebActionResult<{
|
|
433
|
+
state: ReturnType<WebRepl["globalTools"]>;
|
|
434
|
+
}>>;
|
|
435
|
+
setSessionTools(value: unknown): Promise<WebActionResult<{
|
|
436
|
+
state: ReturnType<WebRepl["sessionTools"]>;
|
|
437
|
+
}>>;
|
|
438
|
+
loadSessionTools(sessionId: string): Promise<void>;
|
|
292
439
|
setSessionPlugins(value: unknown): Promise<WebActionResult<{
|
|
293
440
|
state: ReturnType<WebRepl["sessionPlugins"]>;
|
|
294
441
|
}>>;
|
|
295
442
|
loadSessionPlugins(sessionId: string): Promise<void>;
|
|
443
|
+
private parseToolOverrides;
|
|
444
|
+
private parseToolModes;
|
|
445
|
+
private applySessionToolOverrides;
|
|
446
|
+
private syncPluginToolRegistration;
|
|
447
|
+
private refreshToolConfiguration;
|
|
296
448
|
private applySessionPluginOverrides;
|
|
297
449
|
submit(text: string, attachments?: WebAttachmentPayload[]): Promise<{
|
|
298
450
|
ok: true;
|
|
@@ -326,9 +478,17 @@ export declare class WebRepl {
|
|
|
326
478
|
body: Buffer;
|
|
327
479
|
mimeType: string;
|
|
328
480
|
} | undefined;
|
|
481
|
+
imagePayloadById(imageId: string): {
|
|
482
|
+
body: Buffer;
|
|
483
|
+
mimeType: string;
|
|
484
|
+
} | undefined;
|
|
329
485
|
setFastMode(enabled: boolean): Promise<WebActionResult<{
|
|
330
486
|
fastMode: boolean;
|
|
331
487
|
}>>;
|
|
488
|
+
setContextWindowK(value: unknown): Promise<WebActionResult<{
|
|
489
|
+
contextWindowK: number;
|
|
490
|
+
contextWindowTokens: number;
|
|
491
|
+
}>>;
|
|
332
492
|
loginForm(providerValue?: string): LoginFormPayload;
|
|
333
493
|
saveLogin(providerValue: string, values: Record<string, string>): Promise<WebActionResult>;
|
|
334
494
|
interrupt(): {
|
|
@@ -340,6 +500,7 @@ export declare class WebRepl {
|
|
|
340
500
|
cancelled: boolean;
|
|
341
501
|
};
|
|
342
502
|
private append;
|
|
503
|
+
private appendCompaction;
|
|
343
504
|
private appendLineText;
|
|
344
505
|
private replaceLineText;
|
|
345
506
|
private replaceLine;
|
|
@@ -367,8 +528,12 @@ export declare class WebRepl {
|
|
|
367
528
|
private scheduleDeltaFlush;
|
|
368
529
|
private flushDeltaOperations;
|
|
369
530
|
private discardPendingDeltaOperations;
|
|
531
|
+
private dropInactiveTerminalOutput;
|
|
532
|
+
private queueTerminalOutput;
|
|
533
|
+
private flushTerminalOutput;
|
|
370
534
|
private broadcastSync;
|
|
371
535
|
}
|
|
372
536
|
export declare function compactLineOperations(operations: WebLineOperation[]): WebLineOperation[];
|
|
537
|
+
export declare function restoreWebHistoryLines(runtime: Pick<WebRuntime, "engine">): Array<Record<string, unknown>>;
|
|
373
538
|
export declare function mergeWebQueuedInput(current: string | undefined, next: string): string;
|
|
374
539
|
export {};
|