@ai-workbench/remote-agent 0.9.0-toolbridge.3 → 0.9.0-toolbridge.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 +36 -7
- package/dist/acp.d.ts +23 -3
- package/dist/acp.js +106 -21
- package/dist/broker-runtime.d.ts +2 -0
- package/dist/broker-runtime.js +60 -3
- package/dist/broker.d.ts +56 -1
- package/dist/broker.js +310 -11
- package/dist/claude-local.js +26 -5
- package/dist/client.js +1 -1
- package/dist/close-diagnostics.d.ts +1 -1
- package/dist/close-diagnostics.js +1 -1
- package/dist/cold-protocol.d.ts +17 -0
- package/dist/cold-protocol.js +399 -0
- package/dist/cold-recovery.d.ts +62 -0
- package/dist/cold-recovery.js +595 -0
- package/dist/cold-store.d.ts +99 -0
- package/dist/cold-store.js +29 -0
- package/dist/conversation-details.js +21 -8
- package/dist/employee-endpoint.js +15 -1
- package/dist/employee-mcp.js +1 -1
- package/dist/employee-native.js +7 -1
- package/dist/employee-provider.d.ts +2 -0
- package/dist/employee-provider.js +46 -11
- package/dist/employee-relay.js +148 -1
- package/dist/employee-shell.d.ts +2 -0
- package/dist/employee-shell.js +22 -19
- package/dist/employee-startup.d.ts +18 -0
- package/dist/employee-startup.js +95 -0
- package/dist/employee-tools.js +2 -2
- package/dist/employee-workspace.d.ts +20 -4
- package/dist/employee-workspace.js +26 -5
- package/dist/index.d.ts +12 -3
- package/dist/index.js +223 -51
- package/dist/input.js +4 -1
- package/dist/live-steering.d.ts +46 -0
- package/dist/live-steering.js +45 -0
- package/dist/mapping.d.ts +4 -24
- package/dist/mapping.js +11 -65
- package/dist/model-catalog.d.ts +2 -0
- package/dist/model-catalog.js +5 -1
- package/dist/preflight-diagnostic.js +1 -1
- package/dist/presentation.js +1 -0
- package/dist/provider.d.ts +16 -0
- package/dist/provider.js +66 -33
- package/dist/rpc-namespace.js +16 -2
- package/dist/session-source.d.ts +3 -1
- package/dist/session-source.js +2 -1
- package/dist/startup-timing.d.ts +14 -0
- package/dist/startup-timing.js +34 -0
- package/dist/toolbridge-loop.d.ts +3 -2
- package/dist/toolbridge-loop.js +4 -2
- package/dist/toolbridge-table.d.ts +4 -3
- package/dist/toolbridge-table.js +14 -5
- package/dist/toolbridge.d.ts +1 -1
- package/dist/toolbridge.js +23 -4
- package/package.json +23 -16
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { NetworkApi } from '@ai-workbench/network/api';
|
|
2
|
+
import type { LocalWorkspaceContext } from '@ai-workbench/connect/api';
|
|
3
|
+
import type { EmployeeProviderOptions } from './employee-provider.ts';
|
|
4
|
+
import { type ConnectApi, type ConnectTarget, type ConnectionState, type RuntimeRequest } from './provider.ts';
|
|
5
|
+
import { admitEmployeeLocation } from './employee-location.ts';
|
|
6
|
+
type Location = Awaited<ReturnType<typeof admitEmployeeLocation>>;
|
|
7
|
+
/** 只拥有本次请求的等待和围栏,不拥有、关闭或缓存N的共享设备服务。 */
|
|
8
|
+
export interface EmployeeStartup {
|
|
9
|
+
ready: Promise<void>;
|
|
10
|
+
confirm(target: ConnectTarget, connection: ConnectionState): void;
|
|
11
|
+
location(network: NetworkApi, context: Readonly<LocalWorkspaceContext>): Promise<Location>;
|
|
12
|
+
native(): Promise<{
|
|
13
|
+
path: string;
|
|
14
|
+
}>;
|
|
15
|
+
cancel(): void;
|
|
16
|
+
}
|
|
17
|
+
export declare function beginEmployeeStartup(get: () => ConnectApi | undefined, employee: EmployeeProviderOptions, api: ConnectApi, request: RuntimeRequest): EmployeeStartup | undefined;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { isDeepStrictEqual } from 'node:util';
|
|
2
|
+
import { awaitL, sameTarget, validateTarget } from "./provider.js";
|
|
3
|
+
import { admitEmployeeLocation } from "./employee-location.js";
|
|
4
|
+
import { connectNeedError } from "./connect-need.js";
|
|
5
|
+
import { NeedError } from "./remote.js";
|
|
6
|
+
const failure = (code) => new NeedError(code, '员工电脑的工作区或执行连接已变化,本轮没有继续执行。', '当前工作区绑定与员工端执行器');
|
|
7
|
+
export function beginEmployeeStartup(get, employee, api, request) {
|
|
8
|
+
const context = request.localContext ? structuredClone(request.localContext) : undefined, connection = api.getConnectionState();
|
|
9
|
+
// 只在原context已接纳且已有执行用途可信target的路径重叠;首次未连接仍按原顺序开通。
|
|
10
|
+
if (!context || connection.phase !== 'connected' || typeof api.getSshTarget !== 'function')
|
|
11
|
+
return;
|
|
12
|
+
const network = employee.getNetwork(), lifetime = new AbortController(), offs = [];
|
|
13
|
+
const signal = AbortSignal.any([lifetime.signal, ...request.signal ? [request.signal] : []]);
|
|
14
|
+
let closed = false, target, location, native;
|
|
15
|
+
const nativeMetadata = () => native ??= (request.startupTiming?.run('native-metadata', () => employee.native()) ?? Promise.resolve().then(() => employee.native()));
|
|
16
|
+
const close = () => { if (closed)
|
|
17
|
+
return; closed = true; for (const off of offs.splice(0))
|
|
18
|
+
off(); };
|
|
19
|
+
const cancel = () => { lifetime.abort(failure('ABORTED')); close(); };
|
|
20
|
+
const check = () => {
|
|
21
|
+
signal.throwIfAborted();
|
|
22
|
+
request.localAdmissionCheck?.();
|
|
23
|
+
if (get() !== api || employee.getNetwork() !== network)
|
|
24
|
+
throw failure('EMPLOYEE_CONTEXT_CHANGED');
|
|
25
|
+
const now = api.getConnectionState();
|
|
26
|
+
if (now.phase !== 'connected' || now.instanceId !== connection.instanceId || now.epoch !== connection.epoch)
|
|
27
|
+
throw failure('CONNECTION_LOST');
|
|
28
|
+
if (!network || network.getState().phase !== 'online')
|
|
29
|
+
throw failure('CONNECTION_LOST');
|
|
30
|
+
};
|
|
31
|
+
const changed = () => { try {
|
|
32
|
+
check();
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
lifetime.abort(error);
|
|
36
|
+
close();
|
|
37
|
+
} };
|
|
38
|
+
const revokeNetwork = (event) => { if (event.kind === 'lost') {
|
|
39
|
+
lifetime.abort(failure('CONNECTION_LOST'));
|
|
40
|
+
close();
|
|
41
|
+
}
|
|
42
|
+
else
|
|
43
|
+
changed(); };
|
|
44
|
+
const aborted = () => close();
|
|
45
|
+
signal.addEventListener('abort', aborted, { once: true });
|
|
46
|
+
offs.push(() => signal.removeEventListener('abort', aborted));
|
|
47
|
+
const pending = (async () => {
|
|
48
|
+
if (typeof api.onConnectionState !== 'function' || typeof api.onWorkspaceLocationState !== 'function' || !network || typeof network.onState !== 'function' || typeof network.prepareEmployeeEndpoint !== 'function')
|
|
49
|
+
throw failure('DEPENDENCY_REQUIRED');
|
|
50
|
+
const watch = (off) => { if (closed)
|
|
51
|
+
off();
|
|
52
|
+
else
|
|
53
|
+
offs.push(off); };
|
|
54
|
+
watch(api.onConnectionState(changed));
|
|
55
|
+
watch(api.onWorkspaceLocationState(changed));
|
|
56
|
+
watch(network.onState(revokeNetwork));
|
|
57
|
+
if (network.getState().phase !== 'online')
|
|
58
|
+
throw failure('EMPLOYEE_ENDPOINT_UNAVAILABLE');
|
|
59
|
+
check();
|
|
60
|
+
const current = await awaitL(() => api.getSshTarget(), signal);
|
|
61
|
+
if (!current.ok)
|
|
62
|
+
throw connectNeedError(current.error);
|
|
63
|
+
target = structuredClone(current.value);
|
|
64
|
+
validateTarget(target);
|
|
65
|
+
check();
|
|
66
|
+
// 保留O1既有的纯静态解析重叠;实际执行与broker仍须等待两道门及静态结果。
|
|
67
|
+
void nativeMetadata().catch(() => { });
|
|
68
|
+
const prepare = () => admitEmployeeLocation({ api: api, network, workspace: { id: context.workspaceId, path: context.directory.path }, connection, expectedLocal: { instanceId: context.instanceId, epoch: context.epoch, workspaceId: context.workspaceId, bindingId: context.bindingId, directory: { ...context.directory } }, settingsPath: target.session.settingsPath, signal });
|
|
69
|
+
location = await awaitL(() => request.startupTiming?.run('endpoint-prepare', prepare) ?? prepare(), signal);
|
|
70
|
+
check();
|
|
71
|
+
})();
|
|
72
|
+
// 登录失败始终优先;端点提前失败也先被观察,不能产生未处理拒绝或抢先改变失败语义。
|
|
73
|
+
void pending.catch(() => { });
|
|
74
|
+
const confirm = (current, ready) => { check(); if (!target || !sameTarget(target, current) || ready.instanceId !== connection.instanceId || ready.epoch !== connection.epoch)
|
|
75
|
+
throw failure('EMPLOYEE_CONTEXT_CHANGED'); };
|
|
76
|
+
return { ready: pending, confirm, cancel, native: nativeMetadata, async location(currentNetwork, currentContext) {
|
|
77
|
+
await pending;
|
|
78
|
+
check();
|
|
79
|
+
if (currentNetwork !== network || !isDeepStrictEqual(currentContext, context))
|
|
80
|
+
throw failure('EMPLOYEE_CONTEXT_CHANGED');
|
|
81
|
+
// 准备完成至登录结束之间仍可能替换物理目录;只重读L的只读context,不再prepare第二次。
|
|
82
|
+
const [current, physical] = await Promise.all([
|
|
83
|
+
awaitL(() => api.getSshTarget(), signal),
|
|
84
|
+
awaitL(() => api.getLocalWorkspaceContext({ instanceId: context.instanceId, epoch: context.epoch, workspaceId: context.workspaceId, expectedBindingId: context.bindingId }), signal),
|
|
85
|
+
]);
|
|
86
|
+
check();
|
|
87
|
+
if (!current.ok)
|
|
88
|
+
throw connectNeedError(current.error);
|
|
89
|
+
if (!physical.ok)
|
|
90
|
+
throw connectNeedError(physical.error);
|
|
91
|
+
if (!target || !sameTarget(target, current.value) || !isDeepStrictEqual(physical.value, context))
|
|
92
|
+
throw failure('EMPLOYEE_CONTEXT_CHANGED');
|
|
93
|
+
return location;
|
|
94
|
+
} };
|
|
95
|
+
}
|
package/dist/employee-tools.js
CHANGED
|
@@ -94,7 +94,7 @@ export function createEmployeeTools(options) {
|
|
|
94
94
|
throw failure('EMPLOYEE_OUTPUT_TOO_LARGE'); };
|
|
95
95
|
async function run(command, args, signal, detail, timeout) {
|
|
96
96
|
signal.throwIfAborted();
|
|
97
|
-
const diagnostics = options.closeDiagnostics?.child(detail);
|
|
97
|
+
const diagnostics = options.closeDiagnostics?.child(detail, true);
|
|
98
98
|
const operation = new Promise((yes, no) => {
|
|
99
99
|
const child = spawn(command, args, { cwd: options.cwd, env: process.env, stdio: ['pipe', 'pipe', 'pipe'] });
|
|
100
100
|
child.stdin.end();
|
|
@@ -118,7 +118,7 @@ export function createEmployeeTools(options) {
|
|
|
118
118
|
} if (signal.aborted)
|
|
119
119
|
aborted(); });
|
|
120
120
|
child.on('error', e => { diagnostics?.record({ layer: 'executor', initiator: 'tools.process-error', reason: e.code === 'ENOENT' ? 'EMPLOYEE_COMMAND_UNAVAILABLE' : 'EMPLOYEE_PROCESS_FAILED', action: 'failure' }); failed ??= failure(e.code === 'ENOENT' ? 'EMPLOYEE_COMMAND_UNAVAILABLE' : 'EMPLOYEE_PROCESS_FAILED'); });
|
|
121
|
-
child.on('close', (exitCode, exitSignal) => { diagnostics?.record({ layer: 'executor', initiator: 'tools.process-close', reason: failed?.code ?? 'PROCESS_EXIT', action: 'exit', exitCode, signal: exitSignal }); signal.removeEventListener('abort', aborted); if (killTimer)
|
|
121
|
+
child.on('close', (exitCode, exitSignal) => { diagnostics?.record({ layer: 'executor', initiator: 'tools.process-close', reason: failed?.code ?? 'PROCESS_EXIT', ...!failed && !exitSignal && exitCode !== null ? { operation: 'completed' } : {}, action: 'exit', exitCode, signal: exitSignal }); signal.removeEventListener('abort', aborted); if (killTimer)
|
|
122
122
|
clearTimeout(killTimer); if (timeoutTimer)
|
|
123
123
|
clearTimeout(timeoutTimer); failed ? no(failed) : yes({ stdout: Buffer.concat(stdout).toString('utf8'), stderr: Buffer.concat(stderr).toString('utf8'), exitCode, signal: exitSignal }); });
|
|
124
124
|
signal.addEventListener('abort', aborted, { once: true });
|
|
@@ -4,6 +4,25 @@ interface Services {
|
|
|
4
4
|
get(name: string): unknown;
|
|
5
5
|
inject: Context['inject'];
|
|
6
6
|
}
|
|
7
|
+
interface LiveSessions {
|
|
8
|
+
get(id: string): {
|
|
9
|
+
header: {
|
|
10
|
+
id: string;
|
|
11
|
+
cwd?: string;
|
|
12
|
+
parentSession?: string;
|
|
13
|
+
};
|
|
14
|
+
} | undefined;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* DSH subagent/workflow child sessions are never workspaceRegistry members; they work in the
|
|
18
|
+
* workspace of their nearest registered ancestor along the live parentSession chain. The
|
|
19
|
+
* child's own header.cwd still has to equal that workspace path at each caller.
|
|
20
|
+
*/
|
|
21
|
+
export declare function registeredSessionId(sessionId: string, registry: {
|
|
22
|
+
list(): readonly {
|
|
23
|
+
sessionIds: readonly string[];
|
|
24
|
+
}[];
|
|
25
|
+
}, sessions: LiveSessions | undefined): string;
|
|
7
26
|
/** Session headers do not have workspaceId. Resolve only the official registry relationship. */
|
|
8
27
|
export declare function readEmployeeWorkspace(ctx: Services, sessionId: string): Promise<EmployeeWorkspace>;
|
|
9
28
|
interface RegisteredWorkspace {
|
|
@@ -16,10 +35,7 @@ interface OfficialRegistry {
|
|
|
16
35
|
get(id: string): RegisteredWorkspace | undefined;
|
|
17
36
|
}
|
|
18
37
|
/** Same official membership/header boundary as L. No basename or first-workspace inference. */
|
|
19
|
-
export declare function officialEmployeeWorkspace(sessionId: string, registry: OfficialRegistry | undefined,
|
|
20
|
-
id: string;
|
|
21
|
-
cwd?: string;
|
|
22
|
-
} | undefined): {
|
|
38
|
+
export declare function officialEmployeeWorkspace(sessionId: string, registry: OfficialRegistry | undefined, sessions: LiveSessions | undefined): {
|
|
23
39
|
id: string;
|
|
24
40
|
path: string;
|
|
25
41
|
};
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import { lstat, realpath } from 'node:fs/promises';
|
|
2
2
|
import { isAbsolute } from 'node:path';
|
|
3
3
|
import { NeedError } from "./remote.js";
|
|
4
|
+
/**
|
|
5
|
+
* DSH subagent/workflow child sessions are never workspaceRegistry members; they work in the
|
|
6
|
+
* workspace of their nearest registered ancestor along the live parentSession chain. The
|
|
7
|
+
* child's own header.cwd still has to equal that workspace path at each caller.
|
|
8
|
+
*/
|
|
9
|
+
export function registeredSessionId(sessionId, registry, sessions) {
|
|
10
|
+
const member = (id) => registry.list().some(row => Array.isArray(row.sessionIds) && row.sessionIds.includes(id));
|
|
11
|
+
const seen = new Set();
|
|
12
|
+
let id = sessionId;
|
|
13
|
+
while (!member(id)) {
|
|
14
|
+
seen.add(id);
|
|
15
|
+
const parent = sessions?.get(id)?.header.parentSession;
|
|
16
|
+
if (!parent || seen.has(parent) || !sessions?.get(parent))
|
|
17
|
+
return sessionId;
|
|
18
|
+
id = parent;
|
|
19
|
+
}
|
|
20
|
+
return id;
|
|
21
|
+
}
|
|
4
22
|
const invalid = () => new NeedError('EMPLOYEE_WORKSPACE_INVALID', '无法核对当前会话的本机文件夹,本轮未执行。', '官方工作区唯一会话关系与当前原生cwd');
|
|
5
23
|
/** Session headers do not have workspaceId. Resolve only the official registry relationship. */
|
|
6
24
|
export async function readEmployeeWorkspace(ctx, sessionId) {
|
|
@@ -32,11 +50,12 @@ async function readWorkspace(ctx, sessionId, fence) {
|
|
|
32
50
|
// Service proxies are caller-scoped; injection owns the lifecycle fence.
|
|
33
51
|
if (!currentRegistry || ctx.get('sessions')?.get(sessionId) !== live)
|
|
34
52
|
throw invalid();
|
|
35
|
-
const
|
|
53
|
+
const member = registeredSessionId(sessionId, currentRegistry, sessions);
|
|
54
|
+
const matches = currentRegistry.list().filter(row => Array.isArray(row.sessionIds) && row.sessionIds.includes(member));
|
|
36
55
|
if (matches.length !== 1)
|
|
37
56
|
throw invalid();
|
|
38
57
|
const row = matches[0], entry = currentRegistry.get(row.id), header = sessions.get(sessionId)?.header;
|
|
39
|
-
if (!entry || row.id !== entry.id || row.path !== entry.path || !entry.sessionIds.includes(
|
|
58
|
+
if (!entry || row.id !== entry.id || row.path !== entry.path || !entry.sessionIds.includes(member) || !isAbsolute(row.path) || !header || header.id !== sessionId || !isAbsolute(header.cwd))
|
|
40
59
|
throw invalid();
|
|
41
60
|
return { workspaceId: row.id, path: row.path, cwd: header.cwd };
|
|
42
61
|
};
|
|
@@ -47,15 +66,17 @@ async function readWorkspace(ctx, sessionId, fence) {
|
|
|
47
66
|
return { workspaceId: first.workspaceId, directory: { path, device: info.dev, inode: info.ino } };
|
|
48
67
|
}
|
|
49
68
|
/** Same official membership/header boundary as L. No basename or first-workspace inference. */
|
|
50
|
-
export function officialEmployeeWorkspace(sessionId, registry,
|
|
69
|
+
export function officialEmployeeWorkspace(sessionId, registry, sessions) {
|
|
51
70
|
const fail = () => new NeedError('EMPLOYEE_WORKSPACE_UNAVAILABLE', '无法确认这次会话的本机工作区,本轮没有执行;请从原生工作区打开会话。', '官方workspaceRegistry成员关系与会话header.cwd');
|
|
71
|
+
const header = sessionId ? sessions?.get(sessionId)?.header : undefined;
|
|
52
72
|
if (!sessionId || !registry || !header || header.id !== sessionId || typeof header.cwd !== 'string')
|
|
53
73
|
throw fail();
|
|
54
|
-
const
|
|
74
|
+
const member = registeredSessionId(sessionId, registry, sessions);
|
|
75
|
+
const matches = registry.list().filter(w => Array.isArray(w.sessionIds) && w.sessionIds.includes(member));
|
|
55
76
|
if (matches.length !== 1)
|
|
56
77
|
throw fail();
|
|
57
78
|
const item = matches[0], current = registry.get(item.id);
|
|
58
|
-
if (!current || current.id !== item.id || current.path !== item.path || !current.sessionIds.includes(
|
|
79
|
+
if (!current || current.id !== item.id || current.path !== item.path || !current.sessionIds.includes(member) || !item.path.startsWith('/') || item.path.includes('\0') || header.cwd !== item.path)
|
|
59
80
|
throw fail();
|
|
60
81
|
return { id: item.id, path: item.path };
|
|
61
82
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ColdRecovery } from './cold-recovery.ts';
|
|
2
|
+
import { type SteeringReceipts } from './live-steering.ts';
|
|
1
3
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
4
|
import Schema from '@deepseek-ai/schemastery';
|
|
3
5
|
import { LlmAdapter, type GenerateOptions, type StreamChunk, type LlmResolvedModelInfo } from '@deepseek-ai/dsh-llm';
|
|
@@ -15,7 +17,7 @@ export declare const settingsNamespace = "ai-workbench-codex";
|
|
|
15
17
|
export declare const inject: string[];
|
|
16
18
|
/** Owner-approved defaults; administrators may override through the existing settings. */
|
|
17
19
|
export declare const DEFAULT_CONFIG: Readonly<{
|
|
18
|
-
readonly acpMaxMessageBytes:
|
|
20
|
+
readonly acpMaxMessageBytes: 512000000;
|
|
19
21
|
readonly brokerMaxFrameBytes: 2097152;
|
|
20
22
|
readonly brokerControlMaxBytes: 1048576;
|
|
21
23
|
readonly employeeShellKillGraceMs: 1000;
|
|
@@ -57,9 +59,12 @@ export declare class CodexRemoteAdapter extends LlmAdapter {
|
|
|
57
59
|
private readonly directory?;
|
|
58
60
|
private readonly preflightDiagnostics?;
|
|
59
61
|
private readonly permissions?;
|
|
62
|
+
private readonly steeringReceipts?;
|
|
63
|
+
private readonly coldRecovery?;
|
|
60
64
|
private bridgeLoop;
|
|
61
65
|
private config;
|
|
62
66
|
private sessions;
|
|
67
|
+
private injectedInputs;
|
|
63
68
|
private turns;
|
|
64
69
|
private lifetime;
|
|
65
70
|
private shuttingDown;
|
|
@@ -67,11 +72,13 @@ export declare class CodexRemoteAdapter extends LlmAdapter {
|
|
|
67
72
|
private modelPresentation;
|
|
68
73
|
private employeeNoticeSessions;
|
|
69
74
|
private pendingEmployeeNotices;
|
|
70
|
-
constructor(config: PluginConfig | (() => PluginConfig), resolveRuntime: RuntimeProvider, approve?: InvocationApproval | undefined, providerName?: () => string, agent?: AgentDefinition, readImage?: ImageReader | undefined, reportLoginFailure?: LoginFailureReporter | undefined, directory?: ModelDirectory | undefined, preflightDiagnostics?: PreflightDiagnostics | undefined, permissions?: PermissionSource | undefined, bridgeStopped?: (sessionId: string, notice: string) => void);
|
|
75
|
+
constructor(config: PluginConfig | (() => PluginConfig), resolveRuntime: RuntimeProvider, approve?: InvocationApproval | undefined, providerName?: () => string, agent?: AgentDefinition, readImage?: ImageReader | undefined, reportLoginFailure?: LoginFailureReporter | undefined, directory?: ModelDirectory | undefined, preflightDiagnostics?: PreflightDiagnostics | undefined, permissions?: PermissionSource | undefined, bridgeStopped?: (sessionId: string, notice: string) => void, steeringReceipts?: SteeringReceipts | undefined, coldRecovery?: ColdRecovery | undefined);
|
|
71
76
|
providerInfo(provider: string): {
|
|
72
77
|
id: string;
|
|
73
78
|
name: string;
|
|
74
79
|
};
|
|
80
|
+
canSteer(sessionId: string): boolean;
|
|
81
|
+
steer(sessionId: string, message: import('@deepseek-ai/dsh-llm').UserMessage, isCurrent?: () => boolean): Promise<void>;
|
|
75
82
|
private catalog;
|
|
76
83
|
listModels(provider: string): Promise<(LlmResolvedModelInfo & {
|
|
77
84
|
catalog: HostModel;
|
|
@@ -101,7 +108,7 @@ export declare class CodexRemoteAdapter extends LlmAdapter {
|
|
|
101
108
|
/** One official registration owns both routes, preserving opaque replay ownership. */
|
|
102
109
|
export declare class RemoteAgentsAdapter extends LlmAdapter {
|
|
103
110
|
private adapters;
|
|
104
|
-
constructor(config: () => PluginConfig, makeRuntime: (agent: AgentDefinition) => RuntimeProvider, approve: InvocationApproval, nameFor: (agent: AgentDefinition) => string, readImage?: ImageReader, reportLoginFailure?: LoginFailureReporter, directory?: ModelDirectory, preflightDiagnostics?: PreflightDiagnostics, permissions?: PermissionSource, bridgeStopped?: (sessionId: string, notice: string) => void);
|
|
111
|
+
constructor(config: () => PluginConfig, makeRuntime: (agent: AgentDefinition) => RuntimeProvider, approve: InvocationApproval, nameFor: (agent: AgentDefinition) => string, readImage?: ImageReader, reportLoginFailure?: LoginFailureReporter, directory?: ModelDirectory, preflightDiagnostics?: PreflightDiagnostics, permissions?: PermissionSource, bridgeStopped?: (sessionId: string, notice: string) => void, steeringReceipts?: SteeringReceipts, coldRecovery?: ColdRecovery);
|
|
105
112
|
private adapter;
|
|
106
113
|
providerInfo(provider: string): {
|
|
107
114
|
id: string;
|
|
@@ -124,6 +131,8 @@ export declare class RemoteAgentsAdapter extends LlmAdapter {
|
|
|
124
131
|
jitterRatio: number;
|
|
125
132
|
};
|
|
126
133
|
stream(options: GenerateOptions): AsyncGenerator<StreamChunk, any, any>;
|
|
134
|
+
canSteer(provider: string, sessionId: string): boolean;
|
|
135
|
+
steer(provider: string, sessionId: string, message: import('@deepseek-ai/dsh-llm').UserMessage, isCurrent?: () => boolean): Promise<void>;
|
|
127
136
|
completeDshTurn(sessionId: string, messages: GenerateOptions['messages']): Promise<void>;
|
|
128
137
|
disposeSession(sessionId: string): Promise<void>;
|
|
129
138
|
detachSession(sessionId: string): Promise<void>;
|