@capybara-hq/kernel 0.1.0-rc.97 → 0.1.0-rc.99
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/bootstrap.json +17 -17
- package/dist/catalog/git-source.d.ts +5 -0
- package/dist/catalog/git-source.js +9 -5
- package/dist/catalog/marketplace-fetch.d.ts +9 -0
- package/dist/catalog/marketplace-fetch.js +9 -5
- package/dist/catalog/marketplaces.service.d.ts +1 -1
- package/dist/channels/channels.schemas.d.ts +10 -0
- package/dist/channels/channels.schemas.js +7 -0
- package/dist/channels/connections.service.d.ts +7 -0
- package/dist/channels/connections.service.js +4 -0
- package/dist/channels/features.d.ts +18 -1
- package/dist/channels/features.js +22 -0
- package/dist/channels/outbound.d.ts +19 -0
- package/dist/channels/outbound.js +531 -18
- package/dist/channels/phrases.d.ts +10 -0
- package/dist/channels/phrases.js +4 -0
- package/dist/channels/progress.d.ts +75 -0
- package/dist/channels/progress.js +216 -0
- package/dist/conversations/event-log.d.ts +8 -2
- package/dist/conversations/events.d.ts +6 -0
- package/dist/conversations/events.js +7 -1
- package/dist/conversations/prompt-suggestions.js +2 -2
- package/dist/db/kernel-schema.d.ts +16 -0
- package/dist/evals/run-replay.js +2 -2
- package/dist/evals/step-replay.js +2 -2
- package/dist/evals/worker.js +3 -1
- package/dist/extensions/plugin-icons.d.ts +7 -0
- package/dist/extensions/plugin-icons.js +8 -0
- package/dist/models/purposes.js +2 -2
- package/dist/net/safe-fetch.d.ts +22 -4
- package/dist/net/safe-fetch.js +74 -0
- package/dist/platform/file-ref.d.ts +2 -0
- package/dist/platform/file-ref.js +1 -3
- package/dist/platform/ops/channels.ops.js +24 -5
- package/dist/runtime/model-call.d.ts +23 -2
- package/dist/runtime/model-call.js +64 -9
- package/dist/runtime/run-drafts.d.ts +46 -4
- package/dist/runtime/run-drafts.js +110 -9
- package/dist/runtime/run-steps.d.ts +2 -1
- package/dist/runtime/run-steps.js +6 -2
- package/dist/runtime/runtime.module.js +3 -0
- package/dist/runtime/stream.controller.d.ts +7 -5
- package/dist/runtime/stream.controller.js +10 -6
- package/dist/runtime/stream.js +9 -1
- package/dist/runtime/write-base.d.ts +95 -0
- package/dist/runtime/write-base.js +281 -0
- package/dist/runtime/write-base.service.d.ts +68 -0
- package/dist/runtime/write-base.service.js +184 -0
- package/dist/sandbox/kernel-read.d.ts +39 -9
- package/dist/sandbox/kernel-read.js +33 -3
- package/dist/sandbox/operation-authority.d.ts +16 -12
- package/dist/sandbox/operation-authority.js +33 -20
- package/dist/sandbox/operation-intents.d.ts +10 -4
- package/dist/sandbox/operation-intents.js +31 -11
- package/dist/sandbox/sandbox.service.d.ts +30 -7
- package/dist/sandbox/sandbox.service.js +47 -13
- package/dist/tools/builtins/agent.js +4 -0
- package/dist/tools/builtins/image/generate.js +1 -0
- package/dist/tools/builtins/platform.js +4 -3
- package/dist/tools/builtins/sandbox/bash.d.ts +3 -1
- package/dist/tools/builtins/sandbox/bash.js +23 -11
- package/dist/tools/builtins/sandbox/common.d.ts +4 -1
- package/dist/tools/builtins/sandbox/common.js +5 -2
- package/dist/tools/builtins/sandbox/edit.js +1 -0
- package/dist/tools/builtins/sandbox/glob.js +2 -1
- package/dist/tools/builtins/sandbox/grep.js +2 -1
- package/dist/tools/builtins/sandbox/search-command.d.ts +4 -3
- package/dist/tools/builtins/sandbox/search-command.js +11 -3
- package/dist/tools/builtins/sandbox/write.js +1 -0
- package/dist/tools/builtins/send-message.js +1 -0
- package/dist/tools/info.d.ts +21 -2
- package/dist/tools/info.js +55 -12
- package/dist/tools/network-asks.d.ts +23 -0
- package/dist/tools/network-asks.js +24 -5
- package/dist/tools/pipeline.d.ts +3 -1
- package/dist/tools/pipeline.js +76 -12
- package/dist/tools/registry.d.ts +12 -11
- package/dist/tools/registry.js +6 -5
- package/package.json +3 -3
- package/src/migrations/0185_channel_process_display.sql +13 -0
|
@@ -14,7 +14,6 @@ import sharp from "sharp";
|
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
import { AttachmentsService, normalizeContentType, sniffMatches, } from "../conversations/attachments.service.js";
|
|
16
16
|
import { KernelDb } from "../infra/database/kernel-db.js";
|
|
17
|
-
import { rootConversationOf } from "../runtime/subagents/child.js";
|
|
18
17
|
import { StorageService } from "../storage/storage.service.js";
|
|
19
18
|
import { findConversationFile } from "../tools/builtins/conversation-files.js";
|
|
20
19
|
/** Model-visible: a device path where a file reference is expected. */
|
|
@@ -120,11 +119,10 @@ let FileRefs = class FileRefs {
|
|
|
120
119
|
}
|
|
121
120
|
async conversationFile(id, limits, ctx) {
|
|
122
121
|
const db = this.db.db;
|
|
123
|
-
const rootConversationId = await rootConversationOf(db, ctx.conversationId);
|
|
124
122
|
const file = await findConversationFile({ db, attachments: this.attachments, storage: this.storage }, {
|
|
125
123
|
orgId: ctx.orgId,
|
|
126
124
|
conversationId: ctx.conversationId,
|
|
127
|
-
rootConversationId,
|
|
125
|
+
rootConversationId: ctx.rootConversationId,
|
|
128
126
|
id,
|
|
129
127
|
// one byte past the limit tells a file that grew from one that fits
|
|
130
128
|
maxBytes: limits.maxBytes + 1,
|
|
@@ -23,6 +23,12 @@ import { nestedConfig, withPersonInputs } from "./person-inputs.js";
|
|
|
23
23
|
import { roleOf } from "./role.js";
|
|
24
24
|
import { named, orElse } from "./summary.js";
|
|
25
25
|
const PAGE = 50;
|
|
26
|
+
/** A process display setting as the confirmation summary names it; null is the default. */
|
|
27
|
+
const PROCESS_DISPLAY_LABELS = {
|
|
28
|
+
zh: { detailed: "详细", brief: "简洁", off: "关闭", default: "默认" },
|
|
29
|
+
en: { detailed: "Detailed", brief: "Brief", off: "Off", default: "Default" },
|
|
30
|
+
};
|
|
31
|
+
const processLabel = (v, lang) => PROCESS_DISPLAY_LABELS[lang][v ?? "default"];
|
|
26
32
|
/**
|
|
27
33
|
* A connection as the tool shows it: the settings an admin sees on the channels page. The
|
|
28
34
|
* non-secret config and whether each secret is set, never a secret value (the service view holds
|
|
@@ -36,6 +42,7 @@ const detail = (c) => ({
|
|
|
36
42
|
status: c.status,
|
|
37
43
|
unboundPolicy: c.unboundPolicy,
|
|
38
44
|
inboundMode: c.inboundMode,
|
|
45
|
+
processDisplay: c.processDisplay,
|
|
39
46
|
webhookSupported: c.webhookSupported,
|
|
40
47
|
webhookUrl: c.webhookUrl,
|
|
41
48
|
lastError: c.lastError,
|
|
@@ -139,7 +146,7 @@ let ChannelsOperations = class ChannelsOperations {
|
|
|
139
146
|
}),
|
|
140
147
|
defineOperation({
|
|
141
148
|
id: "channels.create",
|
|
142
|
-
description: "Create a channel connection (IM bot) in the org (org admins): plugin, name, the agent that answers (agentId) and values, the non-secret connection config (read the fields with channels.schema). Secret fields (app secrets, tokens) are never in values: list them in askPerson and the person types them in a secure input request (on the web); required secrets are asked even when not listed. The plugin verifies the credentials before anything is saved. Turn on webhook inbound with inboundMode webhook (only where supported);
|
|
149
|
+
description: "Create a channel connection (IM bot) in the org (org admins): plugin, name, the agent that answers (agentId) and values, the non-secret connection config (read the fields with channels.schema). Secret fields (app secrets, tokens) are never in values: list them in askPerson and the person types them in a secure input request (on the web); required secrets are asked even when not listed. The plugin verifies the credentials before anything is saved. Turn on webhook inbound with inboundMode webhook (only where supported). processDisplay sets how runs show their process in the chat (detailed, brief or off; omit for the default: detailed in direct chats, brief in groups). A setup guide, if any, is in channels.schema.",
|
|
143
150
|
input: z
|
|
144
151
|
.object({
|
|
145
152
|
plugin: ChannelCreateSchema.shape.plugin,
|
|
@@ -148,6 +155,7 @@ let ChannelsOperations = class ChannelsOperations {
|
|
|
148
155
|
values: ChannelCreateSchema.shape.config,
|
|
149
156
|
unboundPolicy: ChannelCreateSchema.shape.unboundPolicy,
|
|
150
157
|
inboundMode: ChannelCreateSchema.shape.inboundMode,
|
|
158
|
+
processDisplay: ChannelCreateSchema.shape.processDisplay,
|
|
151
159
|
askPerson: personFieldParams.askPerson,
|
|
152
160
|
})
|
|
153
161
|
.strict(),
|
|
@@ -215,12 +223,16 @@ let ChannelsOperations = class ChannelsOperations {
|
|
|
215
223
|
keys.length > 0 && `设置 ${keys.join("、")}`,
|
|
216
224
|
ask.length > 0 && `由本人填写 ${ask.map(named).join("、")}`,
|
|
217
225
|
i.inboundMode === "webhook" && "入站方式:webhook",
|
|
226
|
+
typeof i.processDisplay === "string" &&
|
|
227
|
+
`过程显示:${processLabel(i.processDisplay, "zh")}`,
|
|
218
228
|
].filter((p) => typeof p === "string");
|
|
219
229
|
const en = [
|
|
220
230
|
`Create channel connection "${named(i.name)}" with plugin ${named(i.plugin)}, answered by agent ${named(i.agentId)}`,
|
|
221
231
|
keys.length > 0 && `sets ${keys.join(", ")}`,
|
|
222
232
|
ask.length > 0 && `the person enters ${ask.map(named).join(", ")}`,
|
|
223
233
|
i.inboundMode === "webhook" && "inbound mode: webhook",
|
|
234
|
+
typeof i.processDisplay === "string" &&
|
|
235
|
+
`process display: ${processLabel(i.processDisplay, "en")}`,
|
|
224
236
|
].filter((p) => typeof p === "string");
|
|
225
237
|
return { zh: zh.join(";"), en: en.join("; ") };
|
|
226
238
|
},
|
|
@@ -232,6 +244,7 @@ let ChannelsOperations = class ChannelsOperations {
|
|
|
232
244
|
config: nestedConfig(input.values, entered, []),
|
|
233
245
|
unboundPolicy: input.unboundPolicy,
|
|
234
246
|
inboundMode: input.inboundMode,
|
|
247
|
+
processDisplay: input.processDisplay,
|
|
235
248
|
}, ctx.actorAccountId, undefined, detail));
|
|
236
249
|
const webhook = input.inboundMode === "webhook";
|
|
237
250
|
return {
|
|
@@ -311,7 +324,7 @@ let ChannelsOperations = class ChannelsOperations {
|
|
|
311
324
|
}),
|
|
312
325
|
defineOperation({
|
|
313
326
|
id: "channels.update",
|
|
314
|
-
description: "Change a channel connection's binding (org admins): its name, the agent that answers (agentId), what happens to people not yet bound to an account (unboundPolicy: bind or anonymous), active or disabled, and the
|
|
327
|
+
description: "Change a channel connection's binding (org admins): its name, the agent that answers (agentId), what happens to people not yet bound to an account (unboundPolicy: bind or anonymous), active or disabled, the inbound mode, and how runs show their process in the chat (processDisplay: detailed, brief or off; null for the default, detailed in direct chats and brief in groups). Give only what changes. Credentials and config are changed on the web.",
|
|
315
328
|
input: ChannelPatchSchema.omit({ config: true })
|
|
316
329
|
.extend(ChannelPathParams.shape)
|
|
317
330
|
.strict()
|
|
@@ -319,7 +332,10 @@ let ChannelsOperations = class ChannelsOperations {
|
|
|
319
332
|
i.agentId !== undefined ||
|
|
320
333
|
i.unboundPolicy !== undefined ||
|
|
321
334
|
i.status !== undefined ||
|
|
322
|
-
i.inboundMode !== undefined
|
|
335
|
+
i.inboundMode !== undefined ||
|
|
336
|
+
i.processDisplay !== undefined, {
|
|
337
|
+
message: "give name, agentId, unboundPolicy, status, inboundMode or processDisplay",
|
|
338
|
+
}),
|
|
323
339
|
example: { connectionId: "00000000-0000-4000-8000-000000000000", status: "disabled" },
|
|
324
340
|
authz: { orgAction: "channels.manage" },
|
|
325
341
|
mirrors: ["PATCH /api/v1/orgs/:orgId/channels/:connectionId"],
|
|
@@ -354,9 +370,12 @@ let ChannelsOperations = class ChannelsOperations {
|
|
|
354
370
|
i.status !== undefined && `status → ${i.status}`,
|
|
355
371
|
i.inboundMode !== undefined && `inbound mode → ${i.inboundMode}`,
|
|
356
372
|
].filter((p) => typeof p === "string");
|
|
373
|
+
const pd = i.processDisplay;
|
|
374
|
+
const zh = pd === undefined ? parts : [...parts, `过程显示 → ${processLabel(pd, "zh")}`];
|
|
375
|
+
const en = pd === undefined ? parts : [...parts, `process display → ${processLabel(pd, "en")}`];
|
|
357
376
|
return {
|
|
358
|
-
zh: `修改渠道连接「${name}」:${
|
|
359
|
-
en: `Update channel connection "${name}": ${
|
|
377
|
+
zh: `修改渠道连接「${name}」:${zh.join(",")}`,
|
|
378
|
+
en: `Update channel connection "${name}": ${en.join(", ")}`,
|
|
360
379
|
};
|
|
361
380
|
},
|
|
362
381
|
run: async (input, ctx) => {
|
|
@@ -16,6 +16,7 @@ import { MediaCache } from "./media-cache.js";
|
|
|
16
16
|
import { type PermissionContextFailureKind } from "./permission-context-errors.js";
|
|
17
17
|
import { type BoundProvider, type ProviderRegistry } from "./providers.js";
|
|
18
18
|
import type { StepLog } from "./step-log.js";
|
|
19
|
+
import { type WriteBaseReader } from "./write-base.js";
|
|
19
20
|
/** 单轮收尾的尾部提醒(模型可见,英文;spec 6 轮次额度收尾)。 */
|
|
20
21
|
export declare const WRAP_UP_REMINDER = "Step limit reached. Do not call tools. Summarize what you found and what remains for the user.";
|
|
21
22
|
/**
|
|
@@ -48,13 +49,19 @@ export declare const contextTooLargeText: (model: ModelInfo, target: number, est
|
|
|
48
49
|
* 流式增量的出口(推给前端等订阅方);`step_reset` 表示丢弃本步已推出的增量、重新开始。
|
|
49
50
|
* `stream_end` (the step's model stream completed) and `step_end` (the step's `assistant_message`
|
|
50
51
|
* is logged) carry no delta: the run worker's sink writes and then clears the step's live draft on
|
|
51
|
-
* them (spec 2026-11-07 §3.2) and publishes neither.
|
|
52
|
+
* them (spec 2026-11-07 §3.2) and publishes neither. `tool_start` (`callId`, `name`), `tool_input`
|
|
53
|
+
* (`callId`, `text`: a fragment of the call's JSON input) and `tool_base` (`callId`, `text`,
|
|
54
|
+
* `sha256`: the file a streaming `Write` replaces) are display only (streaming tool input spec §4):
|
|
55
|
+
* nothing streamed reaches the log, the model or a hook.
|
|
52
56
|
*/
|
|
53
57
|
export type StreamSink = (delta: {
|
|
54
|
-
kind: "text" | "thinking" | "step_reset" | "stream_end" | "step_end";
|
|
58
|
+
kind: "text" | "thinking" | "tool_start" | "tool_input" | "tool_base" | "step_reset" | "stream_end" | "step_end";
|
|
55
59
|
runId: string;
|
|
56
60
|
step: number;
|
|
57
61
|
text?: string;
|
|
62
|
+
callId?: string;
|
|
63
|
+
name?: string;
|
|
64
|
+
sha256?: string;
|
|
58
65
|
}) => void;
|
|
59
66
|
export interface ModelStepDeps {
|
|
60
67
|
db: KernelSchemaDb;
|
|
@@ -101,6 +108,16 @@ export interface ModelStepDeps {
|
|
|
101
108
|
* install only the recorded feeder (`evals/recorded-permission-context.ts`).
|
|
102
109
|
*/
|
|
103
110
|
permissionContext?: PermissionContextPort;
|
|
111
|
+
/**
|
|
112
|
+
* Reads the display-only base of a streaming `Write` (streaming tool input spec §4.1), published
|
|
113
|
+
* as `tool_base`. Only chat and sub-agent runs use it (never an eval replay); absent, no base.
|
|
114
|
+
*/
|
|
115
|
+
writeBase?: WriteBaseReader;
|
|
116
|
+
/**
|
|
117
|
+
* How long an attempt waits for its aborted base reads (default `WRITE_BASE_SETTLE_MS`); tests
|
|
118
|
+
* shorten it.
|
|
119
|
+
*/
|
|
120
|
+
writeBaseSettleMs?: number;
|
|
104
121
|
}
|
|
105
122
|
/** What the request boundary passes to {@link PermissionContextPort.beforeRequest}. */
|
|
106
123
|
export type PermissionContextRequestInput = Pick<ModelStepInput, "orgId" | "conversationId" | "runId" | "step" | "signal"> & {
|
|
@@ -373,6 +390,10 @@ export interface CompactionOutcome {
|
|
|
373
390
|
* manual compact run through `CompactionService.force`.
|
|
374
391
|
*/
|
|
375
392
|
export declare function runCompaction(deps: ModelStepDeps, input: ModelStepInput, events: ConversationEvent[], runtime: Runtime, compaction: CompactionSettings, tools: StepTools, opts?: CompactOptions): Promise<CompactionOutcome>;
|
|
393
|
+
/** Characters one streamed delta carries, for the idle and size accounting of a stream. */
|
|
394
|
+
export declare function deltaChars(ev: Exclude<ModelStreamEvent, {
|
|
395
|
+
type: "message_complete";
|
|
396
|
+
}>): number;
|
|
376
397
|
/**
|
|
377
398
|
* 消费一次模型流,带空闲看门狗:两次事件之间超过 `idleMs` → 本地中止并按 `ModelError("timeout")` 抛出。
|
|
378
399
|
* 外部 `signal` 触发 → `StepAborted`。每次 `next()` 都与停止信号竞速,供应商不响应 signal 也不会卡住。
|
|
@@ -18,6 +18,7 @@ import { PERMISSION_CONTEXT_RUN_ERRORS, permissionContextFailureKind, permission
|
|
|
18
18
|
import { ProviderListError } from "./providers.js";
|
|
19
19
|
import { ExecutionRevoked } from "./run-execution.js";
|
|
20
20
|
import { budgetRunOf, subagentBudgetUsedUp } from "./subagents/limits.js";
|
|
21
|
+
import { writeBaseViewOf, writeBaseWatcher } from "./write-base.js";
|
|
21
22
|
/** 单轮收尾的尾部提醒(模型可见,英文;spec 6 轮次额度收尾)。 */
|
|
22
23
|
export const WRAP_UP_REMINDER = "Step limit reached. Do not call tools. Summarize what you found and what remains for the user.";
|
|
23
24
|
/**
|
|
@@ -1392,15 +1393,35 @@ async function ladder(deps, input, events, runtime, compaction, tools, wrapUpRea
|
|
|
1392
1393
|
]);
|
|
1393
1394
|
await deps.eventLog.notify(conversationId, Math.max(...written.map((e) => e.seq)));
|
|
1394
1395
|
sentAt = Date.now();
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1396
|
+
// this attempt's pending base reads end with its stream (a reset, the end, an abort)
|
|
1397
|
+
const baseStop = new AbortController();
|
|
1398
|
+
const bases = baseWatcher(deps, input, tools, baseStop.signal);
|
|
1399
|
+
let outcome;
|
|
1400
|
+
try {
|
|
1401
|
+
outcome = await consumeModelStream(provider, sentRequest, info.streamIdleTimeoutMs ?? runtime.streamIdleMs, signal, (ev) => {
|
|
1402
|
+
if (ev.type === "text_delta") {
|
|
1403
|
+
streamed.text += ev.text;
|
|
1404
|
+
sink({ kind: "text", runId, step, text: ev.text });
|
|
1405
|
+
}
|
|
1406
|
+
else if (ev.type === "thinking_delta") {
|
|
1407
|
+
sink({ kind: "thinking", runId, step, text: ev.text });
|
|
1408
|
+
}
|
|
1409
|
+
else if (ev.type === "tool_call_start") {
|
|
1410
|
+
sink({ kind: "tool_start", runId, step, callId: ev.id, name: ev.name });
|
|
1411
|
+
bases?.onStart(ev.id, ev.name);
|
|
1412
|
+
}
|
|
1413
|
+
else {
|
|
1414
|
+
sink({ kind: "tool_input", runId, step, callId: ev.id, text: ev.input });
|
|
1415
|
+
bases?.onInput(ev.id, ev.input);
|
|
1416
|
+
}
|
|
1417
|
+
});
|
|
1418
|
+
}
|
|
1419
|
+
finally {
|
|
1420
|
+
// the attempt's base reads end with it: aborted, then waited for (the abort reaches
|
|
1421
|
+
// the lease and provider waits, so this is short), at most WRITE_BASE_SETTLE_MS
|
|
1422
|
+
baseStop.abort();
|
|
1423
|
+
await bases?.settle();
|
|
1424
|
+
}
|
|
1404
1425
|
// the draft's last write, before the assistant_message is logged
|
|
1405
1426
|
sink({ kind: "stream_end", runId, step });
|
|
1406
1427
|
if (scope && deps.hooks) {
|
|
@@ -1642,6 +1663,28 @@ function classify(err) {
|
|
|
1642
1663
|
retryAfterMs: undefined,
|
|
1643
1664
|
};
|
|
1644
1665
|
}
|
|
1666
|
+
/**
|
|
1667
|
+
* The `Write` base watcher of one stream attempt (streaming tool input spec §4.1), or none: only a
|
|
1668
|
+
* chat or sub-agent run with a reader gets one (an eval replay never reads a device). Its reads
|
|
1669
|
+
* stop when `stop` fires or the run aborts; a base found in time goes out as `tool_base`.
|
|
1670
|
+
*/
|
|
1671
|
+
function baseWatcher(deps, input, tools, stop) {
|
|
1672
|
+
const reader = deps.writeBase;
|
|
1673
|
+
const kind = input.conversationKind;
|
|
1674
|
+
if (reader === undefined || (kind !== "chat" && kind !== "subagent"))
|
|
1675
|
+
return undefined;
|
|
1676
|
+
const { conversationId, runId, step, sink } = input;
|
|
1677
|
+
return writeBaseWatcher({
|
|
1678
|
+
reader,
|
|
1679
|
+
// the resolved tools carry their source (`ResolvedTool`): only the builtin Write reads
|
|
1680
|
+
inputViewOf: (name) => writeBaseViewOf(tools.list, name),
|
|
1681
|
+
emit: (callId, base) => sink({ kind: "tool_base", runId, step, callId, text: base.text, sha256: base.sha256 }),
|
|
1682
|
+
conversationId,
|
|
1683
|
+
signal: AbortSignal.any([input.signal, stop]),
|
|
1684
|
+
log: deps.log,
|
|
1685
|
+
...(deps.writeBaseSettleMs !== undefined && { settleMs: deps.writeBaseSettleMs }),
|
|
1686
|
+
});
|
|
1687
|
+
}
|
|
1645
1688
|
/** 可被中止的等待(本进程发起的模型调用自己的计时器,结束即清除);中止 → StepAborted。 */
|
|
1646
1689
|
function abortableSleep(ms, signal) {
|
|
1647
1690
|
return new Promise((resolve, reject) => {
|
|
@@ -1658,6 +1701,18 @@ function abortableSleep(ms, signal) {
|
|
|
1658
1701
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
1659
1702
|
});
|
|
1660
1703
|
}
|
|
1704
|
+
/** Characters one streamed delta carries, for the idle and size accounting of a stream. */
|
|
1705
|
+
export function deltaChars(ev) {
|
|
1706
|
+
switch (ev.type) {
|
|
1707
|
+
case "text_delta":
|
|
1708
|
+
case "thinking_delta":
|
|
1709
|
+
return ev.text.length;
|
|
1710
|
+
case "tool_call_delta":
|
|
1711
|
+
return ev.input.length;
|
|
1712
|
+
case "tool_call_start":
|
|
1713
|
+
return 0;
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1661
1716
|
/**
|
|
1662
1717
|
* 消费一次模型流,带空闲看门狗:两次事件之间超过 `idleMs` → 本地中止并按 `ModelError("timeout")` 抛出。
|
|
1663
1718
|
* 外部 `signal` 触发 → `StepAborted`。每次 `next()` 都与停止信号竞速,供应商不响应 signal 也不会卡住。
|
|
@@ -7,13 +7,33 @@ import { type StreamSink } from "./model-call.js";
|
|
|
7
7
|
export declare const DRAFT_TTL_SECONDS = 600;
|
|
8
8
|
/** At most one write per step per window, plus the one at the end of the model stream. */
|
|
9
9
|
export declare const DRAFT_FLUSH_MS = 200;
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* UTF-8 bytes of tool input plus bases one step's draft keeps (streaming tool input spec §4); past
|
|
12
|
+
* it a call is marked `inputTruncated` and its later fragments are only published.
|
|
13
|
+
*/
|
|
14
|
+
export declare const DRAFT_TOOL_INPUT_MAX: number;
|
|
15
|
+
/** One step's draft: `{ text, thinking, tools }` as JSON (spec 2026-11-07 §3.2). */
|
|
11
16
|
export declare const draftKey: (runId: string, step: number) => string;
|
|
17
|
+
/** A tool call a step streams (display only: the logged `assistant_message` is what runs). */
|
|
18
|
+
export interface DraftTool {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
/** The head of the call's JSON input as streamed (not parseable until it is complete). */
|
|
22
|
+
input: string;
|
|
23
|
+
/** The step's {@link DRAFT_TOOL_INPUT_MAX} was reached: later fragments are not in the draft. */
|
|
24
|
+
inputTruncated?: true;
|
|
25
|
+
/** The file a streaming `Write` replaces (streaming tool input spec §4.1). */
|
|
26
|
+
base?: {
|
|
27
|
+
text: string;
|
|
28
|
+
sha256: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
12
31
|
/** What one step of a run has streamed so far. */
|
|
13
32
|
export interface RunDraft {
|
|
14
33
|
step: number;
|
|
15
34
|
text: string;
|
|
16
35
|
thinking: string;
|
|
36
|
+
tools: DraftTool[];
|
|
17
37
|
}
|
|
18
38
|
/** A draft of a conversation's active run (the `event: draft` frame's data). */
|
|
19
39
|
export interface LiveDraft extends RunDraft {
|
|
@@ -45,6 +65,26 @@ export declare class RunDrafts {
|
|
|
45
65
|
private get db();
|
|
46
66
|
/** Adds a delta to the step's draft; writes it when the last write is a window old. */
|
|
47
67
|
append(runId: string, step: number, channel: "text" | "thinking", text: string): void;
|
|
68
|
+
/** A tool call the step starts streaming (a call id seen again keeps what it has). */
|
|
69
|
+
startTool(runId: string, step: number, callId: string, name: string): void;
|
|
70
|
+
/**
|
|
71
|
+
* Adds a fragment of a call's input. Past {@link DRAFT_TOOL_INPUT_MAX} for the step the call is
|
|
72
|
+
* marked `inputTruncated` and keeps its head: later fragments are only published.
|
|
73
|
+
*/
|
|
74
|
+
appendToolInput(runId: string, step: number, callId: string, text: string): void;
|
|
75
|
+
/**
|
|
76
|
+
* The file a streaming `Write` replaces; kept only within {@link DRAFT_TOOL_INPUT_MAX}, which the
|
|
77
|
+
* base shares with the input (spec: "input plus base"). Like {@link appendToolInput}, it ignores
|
|
78
|
+
* a call never started.
|
|
79
|
+
*/
|
|
80
|
+
setToolBase(runId: string, step: number, callId: string, base: {
|
|
81
|
+
text: string;
|
|
82
|
+
sha256: string;
|
|
83
|
+
}): void;
|
|
84
|
+
/** The step's held draft, a fresh one when the run moved to another step. */
|
|
85
|
+
private heldFor;
|
|
86
|
+
/** The held draft changed: written now when the last write is a window old, else held. */
|
|
87
|
+
private changed;
|
|
48
88
|
/** The end of the step's model stream: writes what the window still holds. */
|
|
49
89
|
flush(runId: string, step: number): void;
|
|
50
90
|
/** Deletes the step's draft (its `assistant_message` is logged, or the step starts over). */
|
|
@@ -71,15 +111,17 @@ export declare class RunDrafts {
|
|
|
71
111
|
/** What {@link streamSink} uses. */
|
|
72
112
|
export interface StreamSinkDeps {
|
|
73
113
|
bus: Pick<ExtensionContext["bus"], "publish">;
|
|
74
|
-
drafts: Pick<RunDrafts, "append" | "flush" | "clear">;
|
|
114
|
+
drafts: Pick<RunDrafts, "append" | "flush" | "clear" | "startTool" | "appendToolInput" | "setToolBase">;
|
|
75
115
|
log: Pick<Logger, "warn">;
|
|
76
116
|
}
|
|
77
117
|
/**
|
|
78
118
|
* The run's stream sink (one per execution of a run): publishes deltas on the conversation's topic
|
|
79
119
|
* (`conv.<id>`, shared with `{ kind: "events" }`, so a subscriber on any replica gets them) with
|
|
80
120
|
* `offset`, the characters of that channel (text or thinking) this attempt of the step streamed
|
|
81
|
-
* before the delta, and keeps the step's live draft.
|
|
82
|
-
*
|
|
121
|
+
* before the delta, and keeps the step's live draft. Tool calls (streaming tool input spec §4):
|
|
122
|
+
* `tool_start` and `tool_base` carry no offset, `tool_input`'s `offset` is the characters of that
|
|
123
|
+
* call's input this attempt streamed before the delta. `step_reset` clears the draft and every
|
|
124
|
+
* offset; `stream_end` / `step_end` only flush / clear the draft and are not published. A failed
|
|
83
125
|
* publish is only logged: deltas are drafts, the `assistant_message` in the log is the truth.
|
|
84
126
|
*/
|
|
85
127
|
export declare function streamSink(conversationId: string, deps: StreamSinkDeps): StreamSink;
|
|
@@ -16,10 +16,32 @@ import { assistantIdemKey } from "./model-call.js";
|
|
|
16
16
|
export const DRAFT_TTL_SECONDS = 600;
|
|
17
17
|
/** At most one write per step per window, plus the one at the end of the model stream. */
|
|
18
18
|
export const DRAFT_FLUSH_MS = 200;
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* UTF-8 bytes of tool input plus bases one step's draft keeps (streaming tool input spec §4); past
|
|
21
|
+
* it a call is marked `inputTruncated` and its later fragments are only published.
|
|
22
|
+
*/
|
|
23
|
+
export const DRAFT_TOOL_INPUT_MAX = 512 * 1024;
|
|
24
|
+
/** One step's draft: `{ text, thinking, tools }` as JSON (spec 2026-11-07 §3.2). */
|
|
20
25
|
export const draftKey = (runId, step) => `capk:run-draft:${runId}:${step}`;
|
|
21
26
|
/** The steps of a run that have a draft (a set, so a reader finds them without a key scan). */
|
|
22
27
|
const stepsKey = (runId) => `capk:run-draft-steps:${runId}`;
|
|
28
|
+
const isRecord = (x) => typeof x === "object" && x !== null && !Array.isArray(x);
|
|
29
|
+
const parseTool = (x) => {
|
|
30
|
+
if (!isRecord(x) || typeof x.id !== "string" || typeof x.name !== "string")
|
|
31
|
+
return [];
|
|
32
|
+
const t = {
|
|
33
|
+
id: x.id,
|
|
34
|
+
name: x.name,
|
|
35
|
+
input: typeof x.input === "string" ? x.input : "",
|
|
36
|
+
};
|
|
37
|
+
if (x.inputTruncated === true)
|
|
38
|
+
t.inputTruncated = true;
|
|
39
|
+
const b = x.base;
|
|
40
|
+
if (isRecord(b) && typeof b.text === "string" && typeof b.sha256 === "string") {
|
|
41
|
+
t.base = { text: b.text, sha256: b.sha256 };
|
|
42
|
+
}
|
|
43
|
+
return [t];
|
|
44
|
+
};
|
|
23
45
|
const parse = (step, v) => {
|
|
24
46
|
if (v === null)
|
|
25
47
|
return null;
|
|
@@ -29,6 +51,7 @@ const parse = (step, v) => {
|
|
|
29
51
|
step,
|
|
30
52
|
text: typeof d.text === "string" ? d.text : "",
|
|
31
53
|
thinking: typeof d.thinking === "string" ? d.thinking : "",
|
|
54
|
+
tools: Array.isArray(d.tools) ? d.tools.flatMap(parseTool) : [],
|
|
32
55
|
};
|
|
33
56
|
}
|
|
34
57
|
catch {
|
|
@@ -68,6 +91,55 @@ let RunDrafts = class RunDrafts {
|
|
|
68
91
|
}
|
|
69
92
|
/** Adds a delta to the step's draft; writes it when the last write is a window old. */
|
|
70
93
|
append(runId, step, channel, text) {
|
|
94
|
+
const h = this.heldFor(runId, step);
|
|
95
|
+
h[channel] += text;
|
|
96
|
+
this.changed(runId, h);
|
|
97
|
+
}
|
|
98
|
+
/** A tool call the step starts streaming (a call id seen again keeps what it has). */
|
|
99
|
+
startTool(runId, step, callId, name) {
|
|
100
|
+
const h = this.heldFor(runId, step);
|
|
101
|
+
if (h.tools.some((t) => t.id === callId))
|
|
102
|
+
return;
|
|
103
|
+
h.tools.push({ id: callId, name, input: "" });
|
|
104
|
+
this.changed(runId, h);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Adds a fragment of a call's input. Past {@link DRAFT_TOOL_INPUT_MAX} for the step the call is
|
|
108
|
+
* marked `inputTruncated` and keeps its head: later fragments are only published.
|
|
109
|
+
*/
|
|
110
|
+
appendToolInput(runId, step, callId, text) {
|
|
111
|
+
const h = this.heldFor(runId, step);
|
|
112
|
+
const t = h.tools.find((x) => x.id === callId);
|
|
113
|
+
if (t === undefined || t.inputTruncated)
|
|
114
|
+
return;
|
|
115
|
+
const bytes = Buffer.byteLength(text);
|
|
116
|
+
if (h.toolBytes + bytes > DRAFT_TOOL_INPUT_MAX)
|
|
117
|
+
t.inputTruncated = true;
|
|
118
|
+
else {
|
|
119
|
+
t.input += text;
|
|
120
|
+
h.toolBytes += bytes;
|
|
121
|
+
}
|
|
122
|
+
this.changed(runId, h);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* The file a streaming `Write` replaces; kept only within {@link DRAFT_TOOL_INPUT_MAX}, which the
|
|
126
|
+
* base shares with the input (spec: "input plus base"). Like {@link appendToolInput}, it ignores
|
|
127
|
+
* a call never started.
|
|
128
|
+
*/
|
|
129
|
+
setToolBase(runId, step, callId, base) {
|
|
130
|
+
const h = this.heldFor(runId, step);
|
|
131
|
+
const t = h.tools.find((x) => x.id === callId);
|
|
132
|
+
if (t === undefined || t.base !== undefined)
|
|
133
|
+
return;
|
|
134
|
+
const bytes = Buffer.byteLength(base.text);
|
|
135
|
+
if (h.toolBytes + bytes > DRAFT_TOOL_INPUT_MAX)
|
|
136
|
+
return;
|
|
137
|
+
t.base = { text: base.text, sha256: base.sha256 };
|
|
138
|
+
h.toolBytes += bytes;
|
|
139
|
+
this.changed(runId, h);
|
|
140
|
+
}
|
|
141
|
+
/** The step's held draft, a fresh one when the run moved to another step. */
|
|
142
|
+
heldFor(runId, step) {
|
|
71
143
|
let h = this.held.get(runId);
|
|
72
144
|
if (h?.step !== step) {
|
|
73
145
|
if (h)
|
|
@@ -76,13 +148,19 @@ let RunDrafts = class RunDrafts {
|
|
|
76
148
|
step,
|
|
77
149
|
text: "",
|
|
78
150
|
thinking: "",
|
|
151
|
+
tools: [],
|
|
152
|
+
toolBytes: 0,
|
|
79
153
|
writtenAt: Number.NEGATIVE_INFINITY,
|
|
80
154
|
dirty: false,
|
|
81
155
|
timer: undefined,
|
|
82
156
|
};
|
|
83
157
|
this.held.set(runId, h);
|
|
84
158
|
}
|
|
85
|
-
h
|
|
159
|
+
return h;
|
|
160
|
+
}
|
|
161
|
+
/** The held draft changed: written now when the last write is a window old, else held. */
|
|
162
|
+
changed(runId, h) {
|
|
163
|
+
const { step } = h;
|
|
86
164
|
h.dirty = true;
|
|
87
165
|
const elapsed = Date.now() - h.writtenAt;
|
|
88
166
|
if (elapsed >= DRAFT_FLUSH_MS)
|
|
@@ -180,7 +258,7 @@ let RunDrafts = class RunDrafts {
|
|
|
180
258
|
const { step } = h;
|
|
181
259
|
this.redis
|
|
182
260
|
.multi()
|
|
183
|
-
.set(draftKey(runId, step), JSON.stringify({ text: h.text, thinking: h.thinking }), "EX", DRAFT_TTL_SECONDS)
|
|
261
|
+
.set(draftKey(runId, step), JSON.stringify({ text: h.text, thinking: h.thinking, tools: h.tools }), "EX", DRAFT_TTL_SECONDS)
|
|
184
262
|
.sadd(stepsKey(runId), String(step))
|
|
185
263
|
.expire(stepsKey(runId), DRAFT_TTL_SECONDS)
|
|
186
264
|
.exec()
|
|
@@ -199,12 +277,14 @@ export { RunDrafts };
|
|
|
199
277
|
* The run's stream sink (one per execution of a run): publishes deltas on the conversation's topic
|
|
200
278
|
* (`conv.<id>`, shared with `{ kind: "events" }`, so a subscriber on any replica gets them) with
|
|
201
279
|
* `offset`, the characters of that channel (text or thinking) this attempt of the step streamed
|
|
202
|
-
* before the delta, and keeps the step's live draft.
|
|
203
|
-
*
|
|
280
|
+
* before the delta, and keeps the step's live draft. Tool calls (streaming tool input spec §4):
|
|
281
|
+
* `tool_start` and `tool_base` carry no offset, `tool_input`'s `offset` is the characters of that
|
|
282
|
+
* call's input this attempt streamed before the delta. `step_reset` clears the draft and every
|
|
283
|
+
* offset; `stream_end` / `step_end` only flush / clear the draft and are not published. A failed
|
|
204
284
|
* publish is only logged: deltas are drafts, the `assistant_message` in the log is the truth.
|
|
205
285
|
*/
|
|
206
286
|
export function streamSink(conversationId, deps) {
|
|
207
|
-
let at = { runId: "", step: -1, text: 0, thinking: 0 };
|
|
287
|
+
let at = { runId: "", step: -1, text: 0, thinking: 0, tools: new Map() };
|
|
208
288
|
const publish = (msg) => deps.bus
|
|
209
289
|
.publish(conversationTopic(conversationId), msg)
|
|
210
290
|
.catch((err) => deps.log.warn("stream delta publish failed", { conversationId, err }));
|
|
@@ -214,17 +294,38 @@ export function streamSink(conversationId, deps) {
|
|
|
214
294
|
if (d.kind === "step_end")
|
|
215
295
|
return deps.drafts.clear(d.runId, d.step);
|
|
216
296
|
if (at.runId !== d.runId || at.step !== d.step || d.kind === "step_reset") {
|
|
217
|
-
at = { runId: d.runId, step: d.step, text: 0, thinking: 0 };
|
|
297
|
+
at = { runId: d.runId, step: d.step, text: 0, thinking: 0, tools: new Map() };
|
|
218
298
|
}
|
|
219
299
|
if (d.kind === "step_reset") {
|
|
220
300
|
deps.drafts.clear(d.runId, d.step);
|
|
221
301
|
void publish({ kind: "delta", runId: d.runId, step: d.step, delta: "step_reset" });
|
|
222
302
|
return;
|
|
223
303
|
}
|
|
304
|
+
const { runId, step } = d;
|
|
224
305
|
const text = d.text ?? "";
|
|
306
|
+
if (d.kind === "tool_start" || d.kind === "tool_input" || d.kind === "tool_base") {
|
|
307
|
+
const callId = d.callId ?? "";
|
|
308
|
+
if (d.kind === "tool_start") {
|
|
309
|
+
const name = d.name ?? "";
|
|
310
|
+
deps.drafts.startTool(runId, step, callId, name);
|
|
311
|
+
void publish({ kind: "delta", runId, step, delta: "tool_start", callId, name });
|
|
312
|
+
}
|
|
313
|
+
else if (d.kind === "tool_input") {
|
|
314
|
+
const offset = at.tools.get(callId) ?? 0;
|
|
315
|
+
at.tools.set(callId, offset + text.length);
|
|
316
|
+
deps.drafts.appendToolInput(runId, step, callId, text);
|
|
317
|
+
void publish({ kind: "delta", runId, step, delta: "tool_input", callId, text, offset });
|
|
318
|
+
}
|
|
319
|
+
else {
|
|
320
|
+
const sha256 = d.sha256 ?? "";
|
|
321
|
+
deps.drafts.setToolBase(runId, step, callId, { text, sha256 });
|
|
322
|
+
void publish({ kind: "delta", runId, step, delta: "tool_base", callId, text, sha256 });
|
|
323
|
+
}
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
225
326
|
const offset = at[d.kind];
|
|
226
327
|
at[d.kind] += text.length;
|
|
227
|
-
deps.drafts.append(
|
|
228
|
-
void publish({ kind: "delta", runId
|
|
328
|
+
deps.drafts.append(runId, step, d.kind, text);
|
|
329
|
+
void publish({ kind: "delta", runId, step, delta: d.kind, text, offset });
|
|
229
330
|
};
|
|
230
331
|
}
|
|
@@ -15,6 +15,7 @@ import { PermissionContextRecorder } from "./permission-context.service.js";
|
|
|
15
15
|
import { ProviderRegistry } from "./providers.js";
|
|
16
16
|
import { StepLog } from "./step-log.js";
|
|
17
17
|
import { SubagentsService } from "./subagents/subagents.service.js";
|
|
18
|
+
import { WriteBaseService } from "./write-base.service.js";
|
|
18
19
|
/**
|
|
19
20
|
* Builds the agent loop a run executes (default {@link LangGraphLoop}: its checkpoints live in the
|
|
20
21
|
* kernel's {@link KyselyCheckpointSaver}, so another replica resumes a crashed worker's run).
|
|
@@ -37,7 +38,7 @@ export declare class AgentLoops {
|
|
|
37
38
|
*/
|
|
38
39
|
export declare class RunSteps {
|
|
39
40
|
readonly deps: LoopDeps;
|
|
40
|
-
constructor(kdb: KernelDb, eventLog: EventLog, stepLog: StepLog, registry: ProviderRegistry, tools: ToolRegistry, config: KernelConfigService, log: KernelLogger, toolPipeline: ToolPipeline, host: ExtensionHost, subagents: SubagentsService, attachments: AttachmentsService, compactionSettings: CompactionSettingsService, compactionProgress: CompactionProgressService, permissionContext: PermissionContextRecorder);
|
|
41
|
+
constructor(kdb: KernelDb, eventLog: EventLog, stepLog: StepLog, registry: ProviderRegistry, tools: ToolRegistry, config: KernelConfigService, log: KernelLogger, toolPipeline: ToolPipeline, host: ExtensionHost, subagents: SubagentsService, attachments: AttachmentsService, compactionSettings: CompactionSettingsService, compactionProgress: CompactionProgressService, permissionContext: PermissionContextRecorder, writeBase: WriteBaseService);
|
|
41
42
|
}
|
|
42
43
|
/**
|
|
43
44
|
* The live request boundary of a run's steps (spec B2): every agent-history request construction
|
|
@@ -24,6 +24,7 @@ import { PermissionContextRecorder } from "./permission-context.service.js";
|
|
|
24
24
|
import { ProviderRegistry } from "./providers.js";
|
|
25
25
|
import { StepLog } from "./step-log.js";
|
|
26
26
|
import { SubagentsService } from "./subagents/subagents.service.js";
|
|
27
|
+
import { WriteBaseService } from "./write-base.service.js";
|
|
27
28
|
/** Optional provider: the {@link AgentLoopFactory} runs use instead of the default (tests). */
|
|
28
29
|
export const AGENT_LOOP_FACTORY = Symbol("AGENT_LOOP_FACTORY");
|
|
29
30
|
/** The agent loops of chat runs and of eval full-run replays (one factory, one checkpoint store). */
|
|
@@ -54,7 +55,7 @@ export { AgentLoops };
|
|
|
54
55
|
*/
|
|
55
56
|
let RunSteps = class RunSteps {
|
|
56
57
|
deps;
|
|
57
|
-
constructor(kdb, eventLog, stepLog, registry, tools, config, log, toolPipeline, host, subagents, attachments, compactionSettings, compactionProgress, permissionContext) {
|
|
58
|
+
constructor(kdb, eventLog, stepLog, registry, tools, config, log, toolPipeline, host, subagents, attachments, compactionSettings, compactionProgress, permissionContext, writeBase) {
|
|
58
59
|
this.deps = {
|
|
59
60
|
get db() {
|
|
60
61
|
return kdb.db;
|
|
@@ -81,6 +82,8 @@ let RunSteps = class RunSteps {
|
|
|
81
82
|
},
|
|
82
83
|
// the request boundary of the recorded permission context (spec B2)
|
|
83
84
|
...livePermissionContext(permissionContext),
|
|
85
|
+
// the display-only base of a streaming Write (streaming tool input spec §4.1)
|
|
86
|
+
writeBase,
|
|
84
87
|
};
|
|
85
88
|
}
|
|
86
89
|
};
|
|
@@ -99,7 +102,8 @@ RunSteps = __decorate([
|
|
|
99
102
|
__param(10, Inject(AttachmentsService)),
|
|
100
103
|
__param(11, Inject(CompactionSettingsService)),
|
|
101
104
|
__param(12, Inject(CompactionProgressService)),
|
|
102
|
-
__param(13, Inject(PermissionContextRecorder))
|
|
105
|
+
__param(13, Inject(PermissionContextRecorder)),
|
|
106
|
+
__param(14, Inject(WriteBaseService))
|
|
103
107
|
], RunSteps);
|
|
104
108
|
export { RunSteps };
|
|
105
109
|
/**
|
|
@@ -54,6 +54,7 @@ import { ConversationStreams } from "./stream.js";
|
|
|
54
54
|
import { SubagentsModule } from "./subagents/subagents.service.js";
|
|
55
55
|
import { UsageReportModule } from "./usage-report.js";
|
|
56
56
|
import { Waits } from "./waits.js";
|
|
57
|
+
import { WriteBaseService } from "./write-base.service.js";
|
|
57
58
|
/**
|
|
58
59
|
* The run runtime: the conversation run lock, this process's event streams, the run queue and its
|
|
59
60
|
* worker (consumed through `RuntimeWorkersModule`'s processors), the waits (a run nobody runs is
|
|
@@ -116,6 +117,8 @@ RuntimeModule = __decorate([
|
|
|
116
117
|
PermissionContextRecorder,
|
|
117
118
|
PluginContextService,
|
|
118
119
|
ProjectKnowledgeService,
|
|
120
|
+
// the display-only base of a streaming Write (streaming tool input spec §4.1)
|
|
121
|
+
WriteBaseService,
|
|
119
122
|
RunWorker,
|
|
120
123
|
// the org's effective compaction settings, one read per model step
|
|
121
124
|
CompactionSettingsService,
|