@ai-workbench/remote-agent 0.9.0-toolbridge.13 → 0.9.0-toolbridge.15
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 +8 -3
- package/dist/acp.d.ts +5 -0
- package/dist/acp.js +52 -3
- package/dist/broker-runtime.d.ts +2 -0
- package/dist/broker-runtime.js +46 -3
- package/dist/broker.d.ts +41 -1
- package/dist/broker.js +237 -9
- package/dist/claude-local.js +26 -5
- package/dist/cold-protocol.d.ts +14 -0
- package/dist/cold-protocol.js +285 -0
- package/dist/cold-recovery.d.ts +53 -0
- package/dist/cold-recovery.js +427 -0
- package/dist/cold-store.d.ts +91 -0
- package/dist/cold-store.js +29 -0
- package/dist/employee-endpoint.js +15 -1
- package/dist/employee-provider.js +26 -6
- package/dist/index.d.ts +11 -2
- package/dist/index.js +178 -30
- package/dist/live-steering.d.ts +46 -0
- package/dist/live-steering.js +45 -0
- package/dist/provider.d.ts +11 -0
- package/dist/rpc-namespace.js +16 -2
- package/dist/session-source.d.ts +3 -1
- package/dist/session-source.js +2 -1
- package/dist/toolbridge-loop.d.ts +3 -2
- package/dist/toolbridge-loop.js +4 -2
- package/package.json +11 -10
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import * as acp from '@agentclientprotocol/sdk/unstable';
|
|
3
|
+
import { BrokerTransport, brokerCommand, controlJson } from "./broker.js";
|
|
4
|
+
import { coldNeed } from "./cold-store.js";
|
|
5
|
+
import { StreamMapper } from "./mapping.js";
|
|
6
|
+
import { LlmError } from '@deepseek-ai/dsh-llm';
|
|
7
|
+
import { NeedError } from "./remote.js";
|
|
8
|
+
/** Read-only reconstruction, with block kinds and exact content checked against the durable transcript. */
|
|
9
|
+
class Prefix {
|
|
10
|
+
index = 0;
|
|
11
|
+
offset = 0;
|
|
12
|
+
blocks = [];
|
|
13
|
+
constructor(saved) { for (const block of saved.blocks) {
|
|
14
|
+
if (block.type === 'tool-call')
|
|
15
|
+
continue;
|
|
16
|
+
if (block.type !== 'text' && block.type !== 'reasoning')
|
|
17
|
+
throw coldNeed('SESSION_CONTEXT_MISMATCH');
|
|
18
|
+
if (block.text.length === 0)
|
|
19
|
+
continue;
|
|
20
|
+
const prior = this.blocks.at(-1);
|
|
21
|
+
if (prior?.type === block.type)
|
|
22
|
+
prior.text += block.text;
|
|
23
|
+
else
|
|
24
|
+
this.blocks.push({ type: block.type, text: block.text });
|
|
25
|
+
} }
|
|
26
|
+
take(type, text) { let used = 0; while (used < text.length && this.index < this.blocks.length) {
|
|
27
|
+
const b = this.blocks[this.index];
|
|
28
|
+
if (!b.text.length) {
|
|
29
|
+
this.index++;
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (b.type !== type)
|
|
33
|
+
throw coldNeed('SESSION_CONTEXT_MISMATCH');
|
|
34
|
+
const count = Math.min(text.length - used, b.text.length - this.offset);
|
|
35
|
+
if (text.slice(used, used + count) !== b.text.slice(this.offset, this.offset + count))
|
|
36
|
+
throw coldNeed('SESSION_CONTEXT_MISMATCH');
|
|
37
|
+
used += count;
|
|
38
|
+
this.offset += count;
|
|
39
|
+
if (this.offset === b.text.length) {
|
|
40
|
+
this.index++;
|
|
41
|
+
this.offset = 0;
|
|
42
|
+
}
|
|
43
|
+
} return text.slice(used); }
|
|
44
|
+
finish() { if (this.index !== this.blocks.length)
|
|
45
|
+
throw coldNeed('SESSION_CONTEXT_MISMATCH'); }
|
|
46
|
+
}
|
|
47
|
+
export async function* recoverColdProtocol(record, store, prefix, options) {
|
|
48
|
+
options.signal?.throwIfAborted();
|
|
49
|
+
if (!record.meta || !record.nativeId || !record.promptId)
|
|
50
|
+
throw coldNeed();
|
|
51
|
+
const command = (args) => brokerCommand(record.target, args), owner = ['--dsh-session-id', record.sessionId, '--provider', record.brand, '--remote-session-id', record.nativeId];
|
|
52
|
+
const bound = controlJson(await options.io.run(command(['bind-round', record.brokerId, '--if-instance', record.instanceId, ...owner, '--round-id', record.id, '--prompt-id', record.promptId, '--prompt-sha256', record.promptSha256, '--prompt-bytes', String(record.promptBytes)]), options.signal));
|
|
53
|
+
if (!Number.isSafeInteger(bound.round?.outputStartSequence))
|
|
54
|
+
throw coldNeed();
|
|
55
|
+
if (record.outputStart === undefined)
|
|
56
|
+
record = await store.update(record.sessionId, record.provider, record.id, row => { row.outputStart = bound.round.outputStartSequence; });
|
|
57
|
+
else if (bound.round.outputStartSequence !== record.outputStart)
|
|
58
|
+
throw coldNeed('SESSION_CONTEXT_MISMATCH');
|
|
59
|
+
let broker;
|
|
60
|
+
const beforeMessage = async (bytes, m) => { const rpc = JSON.parse(Buffer.from(bytes).toString()); await store.update(record.sessionId, record.provider, record.id, row => { row.pending = { id: m.id, sha256: m.sha256, wire: Buffer.from(bytes).toString('base64'), baseSequence: m.baseSequence, chunkBytes: m.chunkBytes, chunks: Math.ceil(bytes.length / m.chunkBytes), ...(rpc.method ? { method: rpc.method } : {}), ...(Object.hasOwn(rpc, 'id') ? { rpcId: rpc.id } : {}) }; }); };
|
|
61
|
+
const afterMessage = async (sequence) => { record = await store.update(record.sessionId, record.provider, record.id, row => { if (row.pending && !row.pending.method && row.pending.rpcId !== undefined && !row.answered.includes(row.pending.rpcId))
|
|
62
|
+
row.answered.push(row.pending.rpcId); row.inputSequence = sequence; delete row.pending; }); broker.completeRestoredInput(); };
|
|
63
|
+
broker = new BrokerTransport({ maxFrameBytes: options.maxFrameBytes, controlMaxBytes: record.controlMaxBytes, leased: true, inputProtocolVersion: 2, messageInput: true, recoverDisconnect: true, instanceId: record.instanceId, initialSequence: record.outputStart, restoreInput: { sequence: record.inputSequence, pending: record.pending }, beforeMessage, afterMessage, attach: (after = 0) => options.io.attach(command(['attach', record.brokerId, '--after', String(after), '--framed', '--leased', '--input-protocol', '2', '--message-input', '--if-instance', record.instanceId, '--cold-round', record.id, '--prompt-id', record.promptId, ...owner])) });
|
|
64
|
+
const raw = acp.ndJsonStream(broker.writable, broker.readable, { maxMessageBytes: options.maxMessageBytes }), reader = raw.readable.getReader(), writer = raw.writable.getWriter();
|
|
65
|
+
const mapper = new StreamMapper(record.meta.baseline), output = new StreamMapper(), trim = new Prefix(prefix);
|
|
66
|
+
let terminal = false, replayed = false;
|
|
67
|
+
const pendingRequests = new Map();
|
|
68
|
+
let outboundTail = Promise.resolve();
|
|
69
|
+
const enqueue = (work) => { outboundTail = outboundTail.then(work); void outboundTail.catch(error => broker.fail(error instanceof NeedError ? error : coldNeed())); };
|
|
70
|
+
const replayOff = broker.onChange(() => { if (!broker.online)
|
|
71
|
+
replayed = false; });
|
|
72
|
+
const send = async (message) => { await writer.write(message); };
|
|
73
|
+
const cancel = () => { if (options.signal?.reason?.kind === 'disposed') {
|
|
74
|
+
broker.close();
|
|
75
|
+
return;
|
|
76
|
+
} enqueue(async () => { await send({ jsonrpc: '2.0', method: 'session/cancel', params: { sessionId: record.nativeId } }); broker.close(); }); };
|
|
77
|
+
options.signal?.addEventListener('abort', cancel, { once: true });
|
|
78
|
+
const projection = function* (chunks) { for (const chunk of chunks) {
|
|
79
|
+
if (chunk.type === 'text-delta' || chunk.type === 'reasoning-delta') {
|
|
80
|
+
const type = chunk.type === 'text-delta' ? 'text' : 'reasoning';
|
|
81
|
+
yield* output.text(trim.take(type, chunk.text), type === 'reasoning');
|
|
82
|
+
}
|
|
83
|
+
else if (chunk.type === 'usage') {
|
|
84
|
+
const usage = { ...chunk.usage };
|
|
85
|
+
for (const key of Object.keys(usage)) {
|
|
86
|
+
const actual = usage[key], previous = prefix.usage?.[key];
|
|
87
|
+
if (typeof actual === 'number' && typeof previous === 'number') {
|
|
88
|
+
if (actual < previous)
|
|
89
|
+
throw coldNeed('USAGE_BASELINE_INVALID');
|
|
90
|
+
usage[key] = actual - previous;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (Object.values(usage).some(x => typeof x === 'number' && x !== 0))
|
|
94
|
+
yield { type: 'usage', usage };
|
|
95
|
+
}
|
|
96
|
+
} };
|
|
97
|
+
let activePump, releasePump, terminalWaiting = false;
|
|
98
|
+
try {
|
|
99
|
+
for (;;) {
|
|
100
|
+
options.signal?.throwIfAborted();
|
|
101
|
+
try {
|
|
102
|
+
await broker.connect();
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
if (!(error instanceof NeedError) || !['ATTACH_BUSY', 'BROKER_ATTACH_FAILED'].includes(error.code))
|
|
107
|
+
throw error;
|
|
108
|
+
await new Promise((resolve, reject) => { const timer = setTimeout(resolve, record.heartbeatIntervalMs); const abort = () => { clearTimeout(timer); reject(options.signal?.reason); }; options.signal?.addEventListener('abort', abort, { once: true }); });
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
const saved = record.pending;
|
|
112
|
+
let pendingAction = false;
|
|
113
|
+
const settleOrphans = async () => { for (const [key, m] of pendingRequests) {
|
|
114
|
+
if (record.answered.some(id => JSON.stringify(id) === key)) {
|
|
115
|
+
pendingRequests.delete(key);
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
await send(m.method === 'session/request_permission' ? { jsonrpc: '2.0', id: m.id, result: { outcome: { outcome: 'cancelled' } } } : { jsonrpc: '2.0', id: m.id, error: { code: -32603, message: 'EMPLOYEE_EXEC_UNKNOWN' } });
|
|
119
|
+
pendingRequests.delete(key);
|
|
120
|
+
} };
|
|
121
|
+
const restorePending = async () => {
|
|
122
|
+
if (!saved)
|
|
123
|
+
return;
|
|
124
|
+
const final = saved.baseSequence + saved.chunks;
|
|
125
|
+
let receipt = broker.inputReceipt;
|
|
126
|
+
if (receipt.pendingSequence === final) {
|
|
127
|
+
receipt = await broker.observeMessage(saved.id);
|
|
128
|
+
}
|
|
129
|
+
if (receipt.committedSequence === final && receipt.deliveredSequence >= final && receipt.lastMessage?.id === saved.id && receipt.lastMessage?.sha256 === saved.sha256 && receipt.lastMessage?.state === 'delivered') {
|
|
130
|
+
await afterMessage(final);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
const rpc = JSON.parse(Buffer.from(saved.wire, 'base64').toString());
|
|
134
|
+
const permittedCancel = saved.method === 'session/cancel' && rpc.params?.sessionId === record.nativeId || saved.method === '$/cancel_request' && String(rpc.params?.requestId) === record.promptId;
|
|
135
|
+
if (saved.method === 'session/prompt' || permittedCancel) {
|
|
136
|
+
await broker.resumeMessage(saved);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
// Old approvals/executions are never replayed. Only their unsent staging may be discarded.
|
|
140
|
+
if (receipt.stagedMessageId === saved.id || receipt.lastMessage?.id === saved.id && receipt.lastMessage?.state === 'discarded')
|
|
141
|
+
receipt = await broker.discardMessage(saved.id);
|
|
142
|
+
else if (receipt.committedSequence !== saved.baseSequence)
|
|
143
|
+
throw coldNeed();
|
|
144
|
+
record = await store.update(record.sessionId, record.provider, record.id, row => { row.inputSequence = receipt.committedSequence; delete row.pending; });
|
|
145
|
+
broker.completeRestoredInput();
|
|
146
|
+
};
|
|
147
|
+
const incoming = [];
|
|
148
|
+
let readDone = false, readFailure, wake;
|
|
149
|
+
const notify = () => { wake?.(); wake = undefined; };
|
|
150
|
+
const pump = (async () => {
|
|
151
|
+
try {
|
|
152
|
+
for (;;) {
|
|
153
|
+
const item = await reader.read();
|
|
154
|
+
if (item.done)
|
|
155
|
+
break;
|
|
156
|
+
const m = item.value;
|
|
157
|
+
if (m.method === '_aw/broker-replay-complete') {
|
|
158
|
+
broker.confirmReplay(m.params?.generation);
|
|
159
|
+
replayed = true;
|
|
160
|
+
if (Array.isArray(m.params?.pendingClientRequests)) {
|
|
161
|
+
const ids = new Set(m.params.pendingClientRequests.map((r) => JSON.stringify(r.id)));
|
|
162
|
+
for (const key of pendingRequests.keys())
|
|
163
|
+
if (!ids.has(key))
|
|
164
|
+
pendingRequests.delete(key);
|
|
165
|
+
}
|
|
166
|
+
if (saved && !pendingAction) {
|
|
167
|
+
pendingAction = true;
|
|
168
|
+
enqueue(restorePending);
|
|
169
|
+
}
|
|
170
|
+
enqueue(settleOrphans);
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
if (m.method && Object.hasOwn(m, 'id')) {
|
|
174
|
+
pendingRequests.set(JSON.stringify(m.id), m);
|
|
175
|
+
if (replayed)
|
|
176
|
+
enqueue(settleOrphans);
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
if (terminalWaiting)
|
|
180
|
+
continue;
|
|
181
|
+
const consumed = Promise.withResolvers();
|
|
182
|
+
releasePump = consumed.resolve;
|
|
183
|
+
incoming.push(m);
|
|
184
|
+
notify();
|
|
185
|
+
await consumed.promise;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
catch (error) {
|
|
189
|
+
readFailure = error;
|
|
190
|
+
}
|
|
191
|
+
finally {
|
|
192
|
+
readDone = true;
|
|
193
|
+
notify();
|
|
194
|
+
}
|
|
195
|
+
})();
|
|
196
|
+
// Keep the reader alive independently while outgoing controls await a new replay barrier.
|
|
197
|
+
activePump = pump;
|
|
198
|
+
for await (const chunk of projection(mapper.text(record.meta.prelude ?? '')))
|
|
199
|
+
yield chunk;
|
|
200
|
+
mapper.flush();
|
|
201
|
+
let nativeUpdates = 0, noticeIndex = 0;
|
|
202
|
+
const notices = function* () { while (record.localNotices?.[noticeIndex]?.beforeUpdate === nativeUpdates) {
|
|
203
|
+
yield* projection(mapper.text(record.localNotices[noticeIndex++].text));
|
|
204
|
+
} };
|
|
205
|
+
yield* notices();
|
|
206
|
+
for (;;) {
|
|
207
|
+
options.signal?.throwIfAborted();
|
|
208
|
+
if (!incoming.length) {
|
|
209
|
+
if (readFailure)
|
|
210
|
+
throw readFailure;
|
|
211
|
+
if (readDone)
|
|
212
|
+
break;
|
|
213
|
+
await new Promise(resolve => { wake = resolve; });
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
const m = incoming.shift();
|
|
217
|
+
releasePump?.();
|
|
218
|
+
releasePump = undefined;
|
|
219
|
+
if (m.method === 'session/update') {
|
|
220
|
+
if (m.params?.sessionId !== record.nativeId)
|
|
221
|
+
throw coldNeed('SESSION_CONTEXT_MISMATCH');
|
|
222
|
+
yield* projection(mapper.acp(m.params.update));
|
|
223
|
+
nativeUpdates++;
|
|
224
|
+
yield* notices();
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
if (!m.method && Object.hasOwn(m, 'id')) {
|
|
228
|
+
if (String(m.id) !== record.promptId) {
|
|
229
|
+
if (!record.rpcIds.includes(m.id))
|
|
230
|
+
throw coldNeed('ACP_FOREIGN_RESPONSE');
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
terminalWaiting = true;
|
|
234
|
+
await outboundTail;
|
|
235
|
+
if (readFailure)
|
|
236
|
+
throw readFailure;
|
|
237
|
+
terminal = true;
|
|
238
|
+
await store.update(record.sessionId, record.provider, record.id, row => { row.terminal = { kind: m.error ? 'error' : 'result', value: m.error ?? m.result }; row.phase = 'terminal'; row.terminalAfter = broker.lastSequence; });
|
|
239
|
+
if (m.error) {
|
|
240
|
+
trim.finish();
|
|
241
|
+
await store.update(record.sessionId, record.provider, record.id, row => { row.finalUsage = mapper.usageSnapshot?.kind === 'cumulative' ? { ...mapper.usageSnapshot, gap: true } : null; });
|
|
242
|
+
if (!options.markerId)
|
|
243
|
+
throw new NeedError('ACP_FAILED', '原轮返回错误,没有另开模型轮或重放输入', '原RPC错误码 ' + String(m.error.code));
|
|
244
|
+
const token = randomUUID(), message = '原轮返回错误(' + String(m.error.code) + '),没有重新发送原任务;恢复回执 ' + token;
|
|
245
|
+
await store.update(record.sessionId, record.provider, record.id, row => { row.errorDelivery = { markerId: options.markerId, promptId: record.promptId, code: 'ACP_FAILED', token, message }; });
|
|
246
|
+
throw new LlmError(message, 'ACP_FAILED', { cause: m.error });
|
|
247
|
+
}
|
|
248
|
+
if (!m.result || typeof m.result.stopReason !== 'string')
|
|
249
|
+
throw coldNeed();
|
|
250
|
+
yield* projection(mapper.acpResponse(m.result));
|
|
251
|
+
await store.update(record.sessionId, record.provider, record.id, row => { row.finalUsage = mapper.usageSnapshot; });
|
|
252
|
+
if (m.result.stopReason === 'cancelled') {
|
|
253
|
+
trim.finish();
|
|
254
|
+
if (!options.markerId)
|
|
255
|
+
throw new NeedError('ABORTED', '原模型轮已取消,没有另开轮次', '原会话取消结果');
|
|
256
|
+
const token = randomUUID(), message = '原模型轮已取消,没有另开轮次;恢复回执 ' + token;
|
|
257
|
+
await store.update(record.sessionId, record.provider, record.id, row => { row.errorDelivery = { markerId: options.markerId, promptId: record.promptId, code: 'ABORTED', token, message }; });
|
|
258
|
+
throw new LlmError(message, 'ABORTED');
|
|
259
|
+
}
|
|
260
|
+
if (m.result.stopReason === 'refusal')
|
|
261
|
+
yield* projection(mapper.text('\n[远端拒绝] 此请求未执行。\n'));
|
|
262
|
+
trim.finish();
|
|
263
|
+
yield* output.flush();
|
|
264
|
+
const snapshot = record.meta;
|
|
265
|
+
const pointer = { ...(snapshot.hostSource ? { hostSource: snapshot.hostSource } : {}), ...(snapshot.modelConfiguration ? { modelConfiguration: snapshot.modelConfiguration } : {}), version: 2, agent: record.provider, contextSha256: snapshot.contextSha256, usageSnapshot: mapper.usageSnapshot, dshSessionId: record.sessionId, identity: snapshot.identity, cwd: snapshot.cwd, sessionId: record.nativeId, ...(snapshot.binding ? { bindingId: snapshot.binding.bindingId, workspaceId: snapshot.binding.workspaceId } : {}), coldRoundId: record.id, coldPromptId: record.promptId, coldRoundTerminal: true, coldOutputAfter: broker.lastSequence };
|
|
266
|
+
yield { type: 'finish', reason: { kind: ['max_tokens', 'max_turn_requests'].includes(m.result.stopReason) ? 'max-tokens' : 'stop' }, replayState: { response: pointer } };
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
if (!terminal)
|
|
271
|
+
throw coldNeed('CONNECTION_LOST');
|
|
272
|
+
}
|
|
273
|
+
finally {
|
|
274
|
+
options.signal?.removeEventListener('abort', cancel);
|
|
275
|
+
replayOff();
|
|
276
|
+
if (options.signal?.aborted && options.signal.reason?.kind !== 'disposed')
|
|
277
|
+
await outboundTail.catch(() => { });
|
|
278
|
+
broker.close({ layer: 'broker', initiator: 'cold.detach', reason: 'SESSION_DETACHED', action: 'detach' });
|
|
279
|
+
releasePump?.();
|
|
280
|
+
await outboundTail.catch(() => { });
|
|
281
|
+
await activePump;
|
|
282
|
+
reader.releaseLock();
|
|
283
|
+
writer.releaseLock();
|
|
284
|
+
}
|
|
285
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type HostModel } from './model-catalog.ts';
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
import { type SessionEvent, type SessionHeader } from '@deepseek-ai/dsh-session';
|
|
4
|
+
import { type GenerateOptions, type StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
5
|
+
import { type ColdRound, type ColdStore } from './cold-store.ts';
|
|
6
|
+
import { type Runtime, type ConnectApi } from './provider.ts';
|
|
7
|
+
import { type BrokerIo, type SshArgv } from './broker.ts';
|
|
8
|
+
declare module '@deepseek-ai/dsh-llm' {
|
|
9
|
+
interface MessageSourceMap {
|
|
10
|
+
'ai-workbench-cold-recovery': {
|
|
11
|
+
kind: 'ai-workbench-cold-recovery';
|
|
12
|
+
roundId: string;
|
|
13
|
+
form: 'notice';
|
|
14
|
+
summary: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export declare const recoveryMarker: (message: any) => string | undefined;
|
|
19
|
+
export declare class ColdRecovery {
|
|
20
|
+
private ctx;
|
|
21
|
+
private getConnect;
|
|
22
|
+
private config;
|
|
23
|
+
private provided?;
|
|
24
|
+
readonly store: ColdStore;
|
|
25
|
+
private queues;
|
|
26
|
+
private scheduled;
|
|
27
|
+
private live;
|
|
28
|
+
private steps;
|
|
29
|
+
constructor(ctx: Context, getConnect: () => ConnectApi | undefined, config: () => {
|
|
30
|
+
acpMaxMessageBytes?: number;
|
|
31
|
+
brokerMaxFrameBytes?: number;
|
|
32
|
+
brokerControlMaxBytes?: number;
|
|
33
|
+
}, provided?: {
|
|
34
|
+
store?: ColdStore;
|
|
35
|
+
readSource?: (id: string) => Promise<unknown>;
|
|
36
|
+
io?: (r: ColdRound) => BrokerIo;
|
|
37
|
+
argv?: SshArgv;
|
|
38
|
+
} | undefined);
|
|
39
|
+
events(sessionId: string, header?: SessionHeader): Promise<readonly SessionEvent[]>;
|
|
40
|
+
capture(runtime: Runtime, options: GenerateOptions, nativeId: string, meta: Omit<NonNullable<ColdRound['meta']>, 'header' | 'inputDigests'>): Promise<void>;
|
|
41
|
+
private reconcile;
|
|
42
|
+
private queueSnapshot;
|
|
43
|
+
private schedule;
|
|
44
|
+
install(): void;
|
|
45
|
+
previousPointer(options: GenerateOptions): Promise<any>;
|
|
46
|
+
release(sessionId: string, id: string): void;
|
|
47
|
+
recoveryModel(provider: string, model: string, signal?: AbortSignal): (import("@deepseek-ai/dsh-llm").LlmResolvedModelInfo & {
|
|
48
|
+
catalog: HostModel;
|
|
49
|
+
}) | undefined;
|
|
50
|
+
canRecover(options: GenerateOptions): boolean;
|
|
51
|
+
private connection;
|
|
52
|
+
stream(options: GenerateOptions): AsyncGenerator<StreamChunk>;
|
|
53
|
+
}
|