@myagentroam/node 0.9.9 → 0.9.10
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/dist/capabilities.js +2 -92
- package/dist/claude-agent-sdk.js +2 -330
- package/dist/claude-channel.js +2 -44
- package/dist/codex-app-server.js +2 -503
- package/dist/config.js +2 -56
- package/dist/connector/node-connector-options.js +2 -1
- package/dist/connector/node-operation-router.js +2 -22
- package/dist/connector.js +2 -845
- package/dist/control-outbound-scheduler.js +2 -154
- package/dist/database.js +2 -1418
- package/dist/event-buffer.js +2 -19
- package/dist/fake-runner.js +2 -129
- package/dist/health.js +2 -3
- package/dist/main.js +2 -54
- package/dist/migrations/v001.js +3 -144
- package/dist/migrations/v002.js +2 -143
- package/dist/migrations/v003.js +2 -44
- package/dist/migrations/v004.js +34 -30
- package/dist/native-jsonl-reader.js +2 -186
- package/dist/native-session-history.js +2 -1119
- package/dist/opencode-runtime.js +2 -80
- package/dist/opencode-server.js +2 -263
- package/dist/operational.js +2 -122
- package/dist/process-tree.js +2 -18
- package/dist/rotating-log.js +2 -67
- package/dist/runner/abstract-runner.js +2 -232
- package/dist/runner/claude/managed-run-controller.js +2 -345
- package/dist/runner/claude-code-runner.js +2 -303
- package/dist/runner/codex/composer-image-markers.js +2 -0
- package/dist/runner/codex/conversation-parser.js +2 -861
- package/dist/runner/codex/managed-run-controller.js +2 -460
- package/dist/runner/codex-runner.js +2 -628
- package/dist/runner/fake-test-runner.js +2 -47
- package/dist/runner/opencode/conversation-parser.js +2 -221
- package/dist/runner/opencode/managed-run-controller.js +2 -537
- package/dist/runner/opencode-runner.js +2 -448
- package/dist/runner/runner-registry.js +2 -90
- package/dist/runner-command-engine.js +2 -70
- package/dist/runner-profiles.js +2 -215
- package/dist/runner-usage.js +2 -190
- package/dist/runtime-command-detector.js +2 -73
- package/dist/runtime-state.js +2 -982
- package/dist/service/attachment-domain-state.js +2 -7
- package/dist/service/conversation-history-service.js +2 -457
- package/dist/service/conversation-segment-service.js +2 -162
- package/dist/service/external-session-resume-service.js +2 -118
- package/dist/service/fake-managed-run-service.js +2 -60
- package/dist/service/managed-runner-session-service.js +2 -35
- package/dist/service/mcp-installation-verifier.js +2 -87
- package/dist/service/mcp-node-operation-service.js +2 -90
- package/dist/service/mcp-package-installer.js +2 -136
- package/dist/service/native-session-projection-service.js +2 -280
- package/dist/service/native-session-watch-service.js +2 -383
- package/dist/service/node-connection-lifecycle-service.js +2 -84
- package/dist/service/node-control-channel.js +2 -85
- package/dist/service/node-control-message-service.js +2 -107
- package/dist/service/node-request-service.js +2 -52
- package/dist/service/node-run-event-bridge.js +2 -83
- package/dist/service/node-terminal-channel.js +2 -182
- package/dist/service/node-upgrade-coordinator.js +2 -137
- package/dist/service/node-workspace-coordinator.js +2 -70
- package/dist/service/recent-run-projection-service.js +2 -78
- package/dist/service/run-attachment-service.js +2 -194
- package/dist/service/run-domain-state.js +2 -4
- package/dist/service/run-event-service.js +2 -193
- package/dist/service/run-workbench-service.js +2 -104
- package/dist/service/runner-channel-message-service.js +2 -20
- package/dist/service/runner-interaction-service.js +2 -243
- package/dist/service/runner-service.js +2 -71
- package/dist/service/session-catalog-service.js +2 -224
- package/dist/service/session-command-service.js +2 -76
- package/dist/service/session-context-service.js +2 -101
- package/dist/service/session-domain-state.js +2 -9
- package/dist/service/session-identity-service.js +2 -86
- package/dist/service/session-lifecycle-service.js +2 -240
- package/dist/service/session-message-service.js +2 -173
- package/dist/service/session-presentation-service.js +2 -43
- package/dist/service/session-query-service.js +2 -82
- package/dist/service/skill-directory-service.js +2 -238
- package/dist/service/skill-install-service.js +2 -434
- package/dist/service/skill-node-operation-service.js +2 -206
- package/dist/service/terminal-relay-state.js +2 -3
- package/dist/service/terminal-service.js +2 -52
- package/dist/service/workbench-event-service.js +2 -19
- package/dist/service/workbench-manifest-service.js +2 -69
- package/dist/service/workspace-change-service.js +2 -86
- package/dist/service/workspace-content-search-service.js +2 -477
- package/dist/service/workspace-domain-state.js +2 -41
- package/dist/service/workspace-file-service.js +2 -122
- package/dist/service/workspace-git-exclude-service.js +2 -119
- package/dist/service/workspace-queue-workbench-service.js +2 -304
- package/dist/service/workspace-service.js +2 -69
- package/dist/service/workspace-session-service.js +2 -139
- package/dist/service/workspace-upload-service.js +2 -262
- package/dist/service/workspace-watch-service.js +2 -146
- package/dist/service/workspace-workbench-service.js +2 -405
- package/dist/service.js +2 -38
- package/dist/storage.js +2 -32
- package/dist/supervisor.js +2 -136
- package/dist/terminal.js +2 -416
- package/dist/util/node-operation-parsers.js +2 -382
- package/dist/util/personal-instructions.js +2 -31
- package/dist/util/runner-error.js +2 -52
- package/dist/util/runner-native-session-parsers.js +2 -490
- package/dist/util/safe-error.js +2 -5
- package/dist/util/secret-environment.js +2 -25
- package/dist/workspace.js +2 -1519
- package/package.json +3 -3
- package/dist/capabilities.d.ts +0 -12
- package/dist/claude-agent-sdk.d.ts +0 -92
- package/dist/claude-channel.d.ts +0 -28
- package/dist/codex-app-server.d.ts +0 -133
- package/dist/config.d.ts +0 -18
- package/dist/connector/node-connector-options.d.ts +0 -27
- package/dist/connector/node-operation-router.d.ts +0 -9
- package/dist/connector.d.ts +0 -94
- package/dist/control-outbound-scheduler.d.ts +0 -29
- package/dist/database.d.ts +0 -305
- package/dist/event-buffer.d.ts +0 -9
- package/dist/fake-runner.d.ts +0 -42
- package/dist/health.d.ts +0 -4
- package/dist/main.d.ts +0 -2
- package/dist/migrations/v001.d.ts +0 -3
- package/dist/migrations/v002.d.ts +0 -4
- package/dist/migrations/v003.d.ts +0 -4
- package/dist/migrations/v004.d.ts +0 -4
- package/dist/native-jsonl-reader.d.ts +0 -35
- package/dist/native-session-history.d.ts +0 -126
- package/dist/opencode-runtime.d.ts +0 -33
- package/dist/opencode-server.d.ts +0 -49
- package/dist/operational.d.ts +0 -39
- package/dist/process-tree.d.ts +0 -9
- package/dist/rotating-log.d.ts +0 -17
- package/dist/runner/abstract-runner.d.ts +0 -172
- package/dist/runner/claude/managed-run-controller.d.ts +0 -51
- package/dist/runner/claude-code-runner.d.ts +0 -72
- package/dist/runner/codex/conversation-parser.d.ts +0 -59
- package/dist/runner/codex/managed-run-controller.d.ts +0 -90
- package/dist/runner/codex-runner.d.ts +0 -103
- package/dist/runner/fake-test-runner.d.ts +0 -26
- package/dist/runner/opencode/conversation-parser.d.ts +0 -31
- package/dist/runner/opencode/managed-run-controller.d.ts +0 -82
- package/dist/runner/opencode-runner.d.ts +0 -71
- package/dist/runner/runner-registry.d.ts +0 -19
- package/dist/runner-command-engine.d.ts +0 -28
- package/dist/runner-profiles.d.ts +0 -15
- package/dist/runner-usage.d.ts +0 -33
- package/dist/runtime-command-detector.d.ts +0 -3
- package/dist/runtime-state.d.ts +0 -171
- package/dist/service/attachment-domain-state.d.ts +0 -7
- package/dist/service/conversation-history-service.d.ts +0 -43
- package/dist/service/conversation-segment-service.d.ts +0 -20
- package/dist/service/external-session-resume-service.d.ts +0 -34
- package/dist/service/fake-managed-run-service.d.ts +0 -28
- package/dist/service/managed-runner-session-service.d.ts +0 -12
- package/dist/service/mcp-installation-verifier.d.ts +0 -9
- package/dist/service/mcp-node-operation-service.d.ts +0 -11
- package/dist/service/mcp-package-installer.d.ts +0 -8
- package/dist/service/native-session-projection-service.d.ts +0 -52
- package/dist/service/native-session-watch-service.d.ts +0 -62
- package/dist/service/node-connection-lifecycle-service.d.ts +0 -36
- package/dist/service/node-control-channel.d.ts +0 -32
- package/dist/service/node-control-message-service.d.ts +0 -27
- package/dist/service/node-request-service.d.ts +0 -14
- package/dist/service/node-run-event-bridge.d.ts +0 -40
- package/dist/service/node-terminal-channel.d.ts +0 -29
- package/dist/service/node-upgrade-coordinator.d.ts +0 -29
- package/dist/service/node-workspace-coordinator.d.ts +0 -29
- package/dist/service/recent-run-projection-service.d.ts +0 -14
- package/dist/service/run-attachment-service.d.ts +0 -38
- package/dist/service/run-domain-state.d.ts +0 -4
- package/dist/service/run-event-service.d.ts +0 -33
- package/dist/service/run-workbench-service.d.ts +0 -25
- package/dist/service/runner-channel-message-service.d.ts +0 -13
- package/dist/service/runner-interaction-service.d.ts +0 -39
- package/dist/service/runner-service.d.ts +0 -46
- package/dist/service/session-catalog-service.d.ts +0 -45
- package/dist/service/session-command-service.d.ts +0 -24
- package/dist/service/session-context-service.d.ts +0 -35
- package/dist/service/session-domain-state.d.ts +0 -9
- package/dist/service/session-identity-service.d.ts +0 -24
- package/dist/service/session-lifecycle-service.d.ts +0 -31
- package/dist/service/session-message-service.d.ts +0 -33
- package/dist/service/session-presentation-service.d.ts +0 -34
- package/dist/service/session-query-service.d.ts +0 -35
- package/dist/service/skill-directory-service.d.ts +0 -20
- package/dist/service/skill-install-service.d.ts +0 -21
- package/dist/service/skill-node-operation-service.d.ts +0 -44
- package/dist/service/terminal-relay-state.d.ts +0 -6
- package/dist/service/terminal-service.d.ts +0 -12
- package/dist/service/workbench-event-service.d.ts +0 -9
- package/dist/service/workbench-manifest-service.d.ts +0 -90
- package/dist/service/workspace-change-service.d.ts +0 -9
- package/dist/service/workspace-content-search-service.d.ts +0 -14
- package/dist/service/workspace-domain-state.d.ts +0 -79
- package/dist/service/workspace-file-service.d.ts +0 -18
- package/dist/service/workspace-git-exclude-service.d.ts +0 -4
- package/dist/service/workspace-queue-workbench-service.d.ts +0 -86
- package/dist/service/workspace-service.d.ts +0 -15
- package/dist/service/workspace-session-service.d.ts +0 -23
- package/dist/service/workspace-upload-service.d.ts +0 -39
- package/dist/service/workspace-watch-service.d.ts +0 -23
- package/dist/service/workspace-workbench-service.d.ts +0 -58
- package/dist/service.d.ts +0 -4
- package/dist/storage.d.ts +0 -2
- package/dist/supervisor.d.ts +0 -1
- package/dist/terminal.d.ts +0 -133
- package/dist/util/node-operation-parsers.d.ts +0 -92
- package/dist/util/personal-instructions.d.ts +0 -2
- package/dist/util/runner-error.d.ts +0 -6
- package/dist/util/runner-native-session-parsers.d.ts +0 -74
- package/dist/util/safe-error.d.ts +0 -2
- package/dist/util/secret-environment.d.ts +0 -1
- package/dist/workspace.d.ts +0 -217
package/dist/process-tree.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export type ProcessTreeCommand = (file: string, args: readonly string[], options: {
|
|
2
|
-
readonly windowsHide: boolean;
|
|
3
|
-
}) => Promise<unknown>;
|
|
4
|
-
export interface ManagedProcess {
|
|
5
|
-
readonly pid?: number;
|
|
6
|
-
kill(signal?: NodeJS.Signals | number): boolean;
|
|
7
|
-
}
|
|
8
|
-
/** Kills the process group on Unix and the complete task tree on Windows. */
|
|
9
|
-
export declare function terminateProcessTree(child: ManagedProcess, platform?: NodeJS.Platform, runCommand?: ProcessTreeCommand): Promise<void>;
|
package/dist/rotating-log.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare function configureNodeLog(dataDirectory: string): void;
|
|
2
|
-
export declare function writeNodeLog(content: string): void;
|
|
3
|
-
export declare class RotatingNodeLog {
|
|
4
|
-
private readonly maxBytes;
|
|
5
|
-
private readonly retentionMs;
|
|
6
|
-
private readonly now;
|
|
7
|
-
private readonly activePath;
|
|
8
|
-
private bytes;
|
|
9
|
-
private day;
|
|
10
|
-
private rotation;
|
|
11
|
-
private lastCleanup;
|
|
12
|
-
constructor(directory: string, maxBytes?: number, retentionMs?: number, now?: () => number);
|
|
13
|
-
write(content: string): void;
|
|
14
|
-
private currentDay;
|
|
15
|
-
private rotate;
|
|
16
|
-
private cleanup;
|
|
17
|
-
}
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import type { NodeCapabilities, RunnerDefaultConfiguration, RunnerCommandDescriptor, NodeEnvelope, RunnerName, RunnerProfile, RunnerCommandState, SessionActivityState } from '@myagentroam/protocol';
|
|
2
|
-
import type { NodeAgentSession, NodeConversationTurn, NodeDatabase, NodeWorkspace } from '../database.js';
|
|
3
|
-
import type { ChannelDelivery } from '../claude-channel.js';
|
|
4
|
-
import type { CodexSessionControl } from '../codex-app-server.js';
|
|
5
|
-
export type RegisteredRunnerName = RunnerName | 'fake';
|
|
6
|
-
/**
|
|
7
|
-
* Stable lifecycle boundary for every Node Runner implementation.
|
|
8
|
-
*
|
|
9
|
-
* Vendor clients and payload decoders stay behind subclasses. Domain services
|
|
10
|
-
* depend on this boundary (or a capability interface implemented by it), never
|
|
11
|
-
* on an SDK/App Server client directly.
|
|
12
|
-
*/
|
|
13
|
-
export declare abstract class AbstractRunner<TName extends RegisteredRunnerName = RegisteredRunnerName> {
|
|
14
|
-
private control;
|
|
15
|
-
private commandControl;
|
|
16
|
-
abstract readonly name: TName;
|
|
17
|
-
/** Test-only runners are registered explicitly but never advertised. */
|
|
18
|
-
readonly advertised: boolean;
|
|
19
|
-
readonly interceptsRuns: boolean;
|
|
20
|
-
abstract readonly discoveryScope: 'ALL_WORKSPACES' | 'WORKSPACE_REQUIRED';
|
|
21
|
-
abstract profile(capabilities: NodeCapabilities): RunnerProfile | undefined;
|
|
22
|
-
refreshProfile(capabilities: NodeCapabilities, workspace?: NodeWorkspace, environment?: Readonly<Record<string, string>>): Promise<RunnerProfile | undefined>;
|
|
23
|
-
abstract available(capabilities: NodeCapabilities): boolean;
|
|
24
|
-
abstract defaultConfiguration(workspace?: NodeWorkspace, environment?: Readonly<Record<string, string>>): RunnerDefaultConfiguration;
|
|
25
|
-
supportsConfiguration(configuration: RunnerDefaultConfiguration, workspace?: NodeWorkspace, environment?: Readonly<Record<string, string>>): boolean;
|
|
26
|
-
protected abstract profileForValidation(): RunnerProfile;
|
|
27
|
-
abstract resumeExternal(session: NodeAgentSession, context: ExternalResumeContext, force?: boolean): Promise<ExternalResumeResult>;
|
|
28
|
-
abstract discoverSessions(context: RunnerDiscoveryContext, workspace?: NodeWorkspace): Promise<readonly NodeAgentSession[]>;
|
|
29
|
-
abstract readContextUsage(session: NodeAgentSession): Promise<RunnerContextUsage | undefined>;
|
|
30
|
-
presentSession(session: NodeAgentSession, capabilities: NodeCapabilities, context: RunnerSessionPresentationContext): RunnerSessionPresentation;
|
|
31
|
-
prepareMessageInput(input: string, collaborationMode: 'default' | 'plan'): string;
|
|
32
|
-
mcpConfiguration(rawInstallations: unknown, secretEnvironment: Readonly<Record<string, string>>): unknown;
|
|
33
|
-
channelToken(sessionId: string): string | undefined;
|
|
34
|
-
deliverChannel(sessionId: string, messageId: string, senderId: string, token: string, content: string, notify: (runId: string, messageId: string, delivery: ChannelDelivery) => void): ChannelDelivery;
|
|
35
|
-
executeGlobalCommand(commandId: string, input: string): unknown;
|
|
36
|
-
serviceTier(): 'fast' | undefined;
|
|
37
|
-
usesRunnerTitleForRename(): boolean;
|
|
38
|
-
renameNative(session: NodeAgentSession, input: {
|
|
39
|
-
readonly title?: string | null;
|
|
40
|
-
readonly pinned?: boolean;
|
|
41
|
-
}, database: NodeDatabase): Promise<void>;
|
|
42
|
-
removeNative(session: NodeAgentSession, nativeSessionId: string): Promise<boolean>;
|
|
43
|
-
forkNative(session: NodeAgentSession, boundary: string | null, title: string): Promise<string | null>;
|
|
44
|
-
projectedRunnerTitle(metadata: ReturnType<NodeDatabase['getNativeSessionMetadata']>, input: RunnerProjectionTitleInput, database: NodeDatabase | undefined): string | null;
|
|
45
|
-
managedAliasId(nativeSessionId: string): string | undefined;
|
|
46
|
-
nativeAliasesFor(managedSessionId: string): readonly string[];
|
|
47
|
-
forgetNativeAlias(nativeSessionId: string): void;
|
|
48
|
-
rememberManagedNative(session: NodeAgentSession, nativeSessionId: string): void;
|
|
49
|
-
readManagedRunnerTitle(session: NodeAgentSession, nativeSessionId: string): Promise<string | undefined>;
|
|
50
|
-
readOfficialConversation(session: NodeAgentSession, input: {
|
|
51
|
-
readonly cursor?: string;
|
|
52
|
-
readonly limit?: number;
|
|
53
|
-
}, managedTurn: (nativeTurnId: string) => NodeConversationTurn | undefined): Promise<RunnerConversationPage | undefined>;
|
|
54
|
-
readConversationHistory(readers: RunnerConversationHistoryReaders): Promise<RunnerConversationHistoryPage | undefined>;
|
|
55
|
-
readExternalActivity(session: NodeAgentSession): Promise<SessionActivityState | undefined>;
|
|
56
|
-
acceptsTruncatedNativeHistory(): boolean;
|
|
57
|
-
nativeImageRoots(session: NodeAgentSession): readonly string[];
|
|
58
|
-
managedRunForNativeTurn(nativeTurnId: string): string | undefined;
|
|
59
|
-
abstract stop(): void | Promise<void>;
|
|
60
|
-
bindControl(control: RunnerControl): void;
|
|
61
|
-
acceptsRun(runner: unknown): boolean;
|
|
62
|
-
startManagedRun(envelope: NodeEnvelope): void;
|
|
63
|
-
cancelManagedRun(runId: string, intent: RunnerCancellationIntent): boolean;
|
|
64
|
-
decideApproval(input: RunnerApprovalDecision): boolean;
|
|
65
|
-
respondUserInput(runId: string, requestId: string, answers: Record<string, unknown>): boolean;
|
|
66
|
-
bindCommandControl(control: RunnerCommandControl): void;
|
|
67
|
-
executeCommand(session: NodeAgentSession, command: RunnerCommandDescriptor, input: string, context: {
|
|
68
|
-
readonly secretEnvironment: Readonly<Record<string, string>>;
|
|
69
|
-
}): Promise<unknown>;
|
|
70
|
-
}
|
|
71
|
-
export interface ResolvedMcpServer {
|
|
72
|
-
readonly name: string;
|
|
73
|
-
readonly transport: 'STDIO' | 'HTTP';
|
|
74
|
-
readonly command?: string;
|
|
75
|
-
readonly args?: readonly string[];
|
|
76
|
-
readonly environment?: Readonly<Record<string, string>>;
|
|
77
|
-
readonly url?: string;
|
|
78
|
-
readonly headers?: Readonly<Record<string, string>>;
|
|
79
|
-
}
|
|
80
|
-
export type RunnerCancellationIntent = 'CANCEL' | 'INTERRUPT';
|
|
81
|
-
export interface RunnerControl {
|
|
82
|
-
start(envelope: NodeEnvelope): void;
|
|
83
|
-
cancel(runId: string, intent: RunnerCancellationIntent): boolean;
|
|
84
|
-
decideApproval?(input: RunnerApprovalDecision): boolean;
|
|
85
|
-
respondUserInput?(runId: string, requestId: string, answers: Record<string, unknown>): boolean;
|
|
86
|
-
}
|
|
87
|
-
export interface RunnerCommandControl {
|
|
88
|
-
execute(session: NodeAgentSession, command: RunnerCommandDescriptor, input: string, context: {
|
|
89
|
-
readonly secretEnvironment: Readonly<Record<string, string>>;
|
|
90
|
-
}): Promise<unknown>;
|
|
91
|
-
}
|
|
92
|
-
export interface RunnerApprovalDecision {
|
|
93
|
-
readonly runId: string;
|
|
94
|
-
readonly approvalId: string;
|
|
95
|
-
readonly decision: 'APPROVED' | 'REJECTED';
|
|
96
|
-
}
|
|
97
|
-
export interface RunnerDiscoveryContext {
|
|
98
|
-
readonly workspaces: readonly NodeWorkspace[];
|
|
99
|
-
createProjection(input: {
|
|
100
|
-
readonly workspace: NodeWorkspace;
|
|
101
|
-
readonly runner: RunnerName;
|
|
102
|
-
readonly externalSessionId: string;
|
|
103
|
-
readonly cwd: string;
|
|
104
|
-
readonly title?: string;
|
|
105
|
-
readonly titleOrigin?: 'OFFICIAL' | 'NATIVE';
|
|
106
|
-
readonly lastActivityAt?: number;
|
|
107
|
-
}): NodeAgentSession;
|
|
108
|
-
}
|
|
109
|
-
export interface ExternalResumeContext {
|
|
110
|
-
readonly available: boolean;
|
|
111
|
-
projectionFor(session: NodeAgentSession): NodeAgentSession | undefined;
|
|
112
|
-
managedAliasFor(session: NodeAgentSession): NodeAgentSession | undefined;
|
|
113
|
-
currentResumed(sessionId: string): NodeAgentSession | undefined;
|
|
114
|
-
promote(sessionId: string): NodeAgentSession | undefined;
|
|
115
|
-
ensureConfiguration(session: NodeAgentSession): NodeAgentSession;
|
|
116
|
-
create(session: NodeAgentSession): NodeAgentSession;
|
|
117
|
-
workspacePath(workspaceId: string): string | undefined;
|
|
118
|
-
rememberManagedNative(nativeSessionId: string, sessionId: string): void;
|
|
119
|
-
}
|
|
120
|
-
export interface ExternalResumeResult {
|
|
121
|
-
readonly session?: NodeAgentSession;
|
|
122
|
-
readonly activity?: 'IDLE' | 'EXTERNAL_ACTIVE' | 'UNAVAILABLE';
|
|
123
|
-
readonly failureCode?: string;
|
|
124
|
-
readonly failureDetail?: string;
|
|
125
|
-
readonly messageFailureCode?: string;
|
|
126
|
-
}
|
|
127
|
-
export interface RunnerContextUsage {
|
|
128
|
-
readonly model?: string | null;
|
|
129
|
-
readonly usedTokens: number;
|
|
130
|
-
readonly maxTokens: number;
|
|
131
|
-
}
|
|
132
|
-
export interface RunnerProjectionTitleInput {
|
|
133
|
-
readonly externalSessionId: string;
|
|
134
|
-
readonly workspaceId: string;
|
|
135
|
-
readonly title?: string;
|
|
136
|
-
readonly titleOrigin?: 'OFFICIAL' | 'NATIVE';
|
|
137
|
-
}
|
|
138
|
-
export interface RunnerConversationPage {
|
|
139
|
-
readonly turns: readonly NodeConversationTurn[];
|
|
140
|
-
readonly nextCursor: string | null;
|
|
141
|
-
}
|
|
142
|
-
export type RunnerConversationHistorySource = 'native' | 'official';
|
|
143
|
-
export interface RunnerConversationHistoryReaders {
|
|
144
|
-
readonly native: () => Promise<RunnerConversationPage | undefined>;
|
|
145
|
-
readonly official: () => Promise<RunnerConversationPage | undefined>;
|
|
146
|
-
}
|
|
147
|
-
export interface RunnerConversationHistoryPage extends RunnerConversationPage {
|
|
148
|
-
readonly source: RunnerConversationHistorySource;
|
|
149
|
-
}
|
|
150
|
-
export interface RunnerSessionPresentationContext {
|
|
151
|
-
readonly managedActive: boolean;
|
|
152
|
-
readonly externalActivity: SessionActivityState | undefined;
|
|
153
|
-
readonly commandStates: readonly RunnerCommandState[];
|
|
154
|
-
}
|
|
155
|
-
export interface RunnerSessionPresentation {
|
|
156
|
-
readonly activity: SessionActivityState;
|
|
157
|
-
readonly control: {
|
|
158
|
-
readonly level: CodexSessionControl['level'];
|
|
159
|
-
readonly capabilities: CodexSessionControl['capabilities'];
|
|
160
|
-
};
|
|
161
|
-
readonly runtime: {
|
|
162
|
-
readonly level: CodexSessionControl['level'];
|
|
163
|
-
readonly capabilities: readonly string[];
|
|
164
|
-
readonly reasonCode: string | null;
|
|
165
|
-
};
|
|
166
|
-
readonly commandStates: readonly RunnerCommandState[];
|
|
167
|
-
}
|
|
168
|
-
export declare class RunnerCapabilityError extends Error {
|
|
169
|
-
readonly runner: RegisteredRunnerName;
|
|
170
|
-
readonly capability: string;
|
|
171
|
-
constructor(runner: RegisteredRunnerName, capability: string);
|
|
172
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { NodeEnvelope, RunnerCommandDescriptor, RunnerCommandState } from '@myagentroam/protocol';
|
|
2
|
-
import { denyPermission } from '../../claude-agent-sdk.js';
|
|
3
|
-
import type { NodeAgentSession } from '../../database.js';
|
|
4
|
-
import type { FakeRunnerStatus } from '../../fake-runner.js';
|
|
5
|
-
import { type PublicConversationItem } from '../codex/conversation-parser.js';
|
|
6
|
-
import { ClaudeCodeRunner } from '../claude-code-runner.js';
|
|
7
|
-
export interface ClaudeRunnerImageAttachment {
|
|
8
|
-
readonly mime: 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp';
|
|
9
|
-
readonly dataBase64: string;
|
|
10
|
-
}
|
|
11
|
-
export interface ClaudeManagedRunHost<TAttachment extends ClaudeRunnerImageAttachment> {
|
|
12
|
-
intercepted(): boolean;
|
|
13
|
-
readonly active: Set<string>;
|
|
14
|
-
parseAttachments(value: unknown): readonly TAttachment[];
|
|
15
|
-
emit(runId: string, eventType: string, payload: unknown, status?: FakeRunnerStatus): void;
|
|
16
|
-
adopt(input: {
|
|
17
|
-
runId: string;
|
|
18
|
-
sessionId: string;
|
|
19
|
-
runner: 'claude-code';
|
|
20
|
-
cwd: string;
|
|
21
|
-
externalSessionId?: string;
|
|
22
|
-
}): void;
|
|
23
|
-
run(runId: string): {
|
|
24
|
-
readonly status: string;
|
|
25
|
-
} | undefined;
|
|
26
|
-
hasActiveSessionLease(sessionId: string): boolean;
|
|
27
|
-
session(sessionId: string): NodeAgentSession | undefined;
|
|
28
|
-
completeCancelled(runId: string, cwd: string): boolean;
|
|
29
|
-
requestUserInput(runId: string, input: Record<string, unknown>, toolUseId: string): Promise<ReturnType<typeof denyPermission>>;
|
|
30
|
-
requestApproval(runId: string, toolName: string, input: Record<string, unknown>): Promise<ReturnType<typeof denyPermission>>;
|
|
31
|
-
rememberNative(nativeSessionId: string, sessionId: string): void;
|
|
32
|
-
promote(sessionId: string, nativeSessionId: string): void;
|
|
33
|
-
send(type: string, payload: unknown): void;
|
|
34
|
-
emitItem(runId: string, item: PublicConversationItem): void;
|
|
35
|
-
syncTitle(sessionId: string, nativeSessionId: string, cwd: string): Promise<void>;
|
|
36
|
-
setChannelToken(sessionId: string, token: string): void;
|
|
37
|
-
commandState(sessionId: string, commandId: string): RunnerCommandState | undefined;
|
|
38
|
-
setCommandState(sessionId: string, state: RunnerCommandState): void;
|
|
39
|
-
clearCommandState(sessionId: string, commandId: string): void;
|
|
40
|
-
commandStates(sessionId: string): readonly RunnerCommandState[];
|
|
41
|
-
}
|
|
42
|
-
export declare class ClaudeManagedRunController<TAttachment extends ClaudeRunnerImageAttachment> {
|
|
43
|
-
private readonly runner;
|
|
44
|
-
private readonly host;
|
|
45
|
-
constructor(runner: ClaudeCodeRunner, host: ClaudeManagedRunHost<TAttachment>);
|
|
46
|
-
executeCommand(session: NodeAgentSession, command: RunnerCommandDescriptor, input: string, context: {
|
|
47
|
-
readonly secretEnvironment: Readonly<Record<string, string>>;
|
|
48
|
-
}): Promise<unknown>;
|
|
49
|
-
private compact;
|
|
50
|
-
start(envelope: NodeEnvelope): void;
|
|
51
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { ClaudeAgentSdkAdapter, type ClaudeChannelRunHandle, type ClaudeQueryInput, type ClaudeRunHandle } from '../claude-agent-sdk.js';
|
|
2
|
-
import { AbstractRunner, type ExternalResumeContext, type ExternalResumeResult, type RunnerDiscoveryContext, type RunnerConversationHistoryPage, type RunnerConversationHistoryReaders, type RunnerSessionPresentationContext, type RunnerSessionPresentation } from './abstract-runner.js';
|
|
3
|
-
import type { NodeCapabilities, RunnerDefaultConfiguration, RunnerProfile } from '@myagentroam/protocol';
|
|
4
|
-
import { ClaudeChannelGate } from '../claude-channel.js';
|
|
5
|
-
import type { ChannelDelivery } from '../claude-channel.js';
|
|
6
|
-
import { claudeUserInputQuestions } from '../util/runner-native-session-parsers.js';
|
|
7
|
-
import type { NodeAgentSession, NodeWorkspace } from '../database.js';
|
|
8
|
-
import { type NativeSessionHistory } from '../native-session-history.js';
|
|
9
|
-
export declare class ClaudeCodeRunner extends AbstractRunner<'claude-code'> {
|
|
10
|
-
private readonly client;
|
|
11
|
-
private readonly environment;
|
|
12
|
-
readonly name: "claude-code";
|
|
13
|
-
readonly discoveryScope: "WORKSPACE_REQUIRED";
|
|
14
|
-
readonly execution: ClaudeExecutionState;
|
|
15
|
-
constructor(client?: ClaudeAgentSdkAdapter, environment?: NodeJS.ProcessEnv);
|
|
16
|
-
profile(capabilities: NodeCapabilities): RunnerProfile;
|
|
17
|
-
available(capabilities: NodeCapabilities): boolean;
|
|
18
|
-
protected profileForValidation(): RunnerProfile;
|
|
19
|
-
defaultConfiguration(): RunnerDefaultConfiguration;
|
|
20
|
-
mcpConfiguration(raw: unknown, secrets: Readonly<Record<string, string>>): unknown;
|
|
21
|
-
resumeExternal(external: NodeAgentSession, context: ExternalResumeContext): Promise<ExternalResumeResult>;
|
|
22
|
-
discoverSessions(context: RunnerDiscoveryContext, workspace?: NodeWorkspace): Promise<readonly NodeAgentSession[]>;
|
|
23
|
-
readContextUsage(session: NodeAgentSession): Promise<import("../native-session-history.js").NativeClaudeContextUsage | undefined>;
|
|
24
|
-
readConversationHistory(readers: RunnerConversationHistoryReaders): Promise<RunnerConversationHistoryPage | undefined>;
|
|
25
|
-
forkNative(session: NodeAgentSession, boundary: string | null, title: string): Promise<string | null>;
|
|
26
|
-
presentSession(session: NodeAgentSession, capabilities: NodeCapabilities, context: RunnerSessionPresentationContext): RunnerSessionPresentation;
|
|
27
|
-
prepareMessageInput(input: string, collaborationMode: 'default' | 'plan'): string;
|
|
28
|
-
channelToken(sessionId: string): string | undefined;
|
|
29
|
-
deliverChannel(sessionId: string, messageId: string, senderId: string, token: string, content: string, notify: (runId: string, messageId: string, delivery: ChannelDelivery) => void): ChannelDelivery;
|
|
30
|
-
managedAliasId(nativeSessionId: string): string | undefined;
|
|
31
|
-
nativeAliasesFor(managedSessionId: string): readonly string[];
|
|
32
|
-
forgetNativeAlias(nativeSessionId: string): void;
|
|
33
|
-
rememberManagedNative(session: NodeAgentSession, nativeSessionId: string): void;
|
|
34
|
-
readManagedRunnerTitle(session: NodeAgentSession, nativeSessionId: string): Promise<string | undefined>;
|
|
35
|
-
projectDiscoveredSessions(context: RunnerDiscoveryContext, workspace: NodeWorkspace, discovered: readonly ClaudeDiscoveredSession[]): readonly NodeAgentSession[];
|
|
36
|
-
stop(): void;
|
|
37
|
-
start(input: ClaudeQueryInput): ClaudeRunHandle;
|
|
38
|
-
startChannel(input: ClaudeQueryInput): ClaudeChannelRunHandle;
|
|
39
|
-
listSessions(cwd: string): ReturnType<ClaudeAgentSdkAdapter['listSessions']>;
|
|
40
|
-
sessionInfo(sessionId: string, cwd: string): ReturnType<ClaudeAgentSdkAdapter['sessionInfo']>;
|
|
41
|
-
}
|
|
42
|
-
export declare class ClaudeExecutionState {
|
|
43
|
-
readonly runs: Map<string, {
|
|
44
|
-
marSessionId: string;
|
|
45
|
-
nativeSessionId?: string;
|
|
46
|
-
cwd: string;
|
|
47
|
-
handle: ClaudeChannelRunHandle;
|
|
48
|
-
gate: ClaudeChannelGate;
|
|
49
|
-
}>;
|
|
50
|
-
readonly managedNativeIds: Set<string>;
|
|
51
|
-
readonly managedSessionByNativeId: Map<string, string>;
|
|
52
|
-
readonly approvals: Map<string, {
|
|
53
|
-
readonly runId: string;
|
|
54
|
-
readonly resolve: (decision: "APPROVED" | "REJECTED") => void;
|
|
55
|
-
readonly timer: NodeJS.Timeout;
|
|
56
|
-
}>;
|
|
57
|
-
readonly userInputs: Map<string, {
|
|
58
|
-
readonly runId: string;
|
|
59
|
-
readonly requestId: string;
|
|
60
|
-
readonly questions: ReturnType<typeof claudeUserInputQuestions>;
|
|
61
|
-
readonly input: Record<string, unknown>;
|
|
62
|
-
readonly resolve: (answers: Record<string, string>) => void;
|
|
63
|
-
readonly reject: (message?: string) => void;
|
|
64
|
-
readonly timer: NodeJS.Timeout;
|
|
65
|
-
}>;
|
|
66
|
-
}
|
|
67
|
-
type ClaudeDiscoveredSession = NativeSessionHistory | {
|
|
68
|
-
readonly externalSessionId: string;
|
|
69
|
-
readonly cwd: string;
|
|
70
|
-
readonly title?: string;
|
|
71
|
-
};
|
|
72
|
-
export {};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { NodeAgentSession, NodeConversationItem, NodeConversationTurn, NodeMessageAttachmentInput } from '../../database.js';
|
|
2
|
-
export type PublicConversationItem = {
|
|
3
|
-
readonly itemId: string;
|
|
4
|
-
readonly kind: 'assistant_message' | 'reasoning_summary' | 'tool_call' | 'command_execution' | 'user_input_request' | 'plan' | 'context_compaction' | 'file_change' | 'error' | 'unknown';
|
|
5
|
-
readonly status: 'PENDING' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED' | 'DECLINED';
|
|
6
|
-
readonly payload: Record<string, unknown>;
|
|
7
|
-
readonly merge?: boolean;
|
|
8
|
-
readonly append?: 'sections' | 'outputPreview' | 'outputSummary';
|
|
9
|
-
};
|
|
10
|
-
export * from '../../util/runner-native-session-parsers.js';
|
|
11
|
-
export declare function codexOfficialConversationPage(session: NodeAgentSession, result: unknown, input: {
|
|
12
|
-
readonly cursor?: string;
|
|
13
|
-
readonly limit?: number;
|
|
14
|
-
}, managedTurnForNative: (nativeTurnId: string) => NodeConversationTurn | undefined): {
|
|
15
|
-
readonly turns: readonly NodeConversationTurn[];
|
|
16
|
-
readonly nextCursor: string | null;
|
|
17
|
-
} | undefined;
|
|
18
|
-
export declare function codexOfficialTurn(session: NodeAgentSession, value: unknown, sequence: number, managedTurn: NodeConversationTurn | undefined): NodeConversationTurn | undefined;
|
|
19
|
-
/**
|
|
20
|
-
* Codex's authoritative thread records omit MAR's Node-local generated-image
|
|
21
|
-
* references. Preserve those references like user-image metadata: cache expiry
|
|
22
|
-
* only makes the bytes unavailable, while the conversation still renders its
|
|
23
|
-
* image placeholder.
|
|
24
|
-
*/
|
|
25
|
-
export declare function retainManagedImageAttachments(managedTurn: NodeConversationTurn, nativeTurnId: string, officialItems: readonly NodeConversationItem[]): readonly NodeConversationItem[];
|
|
26
|
-
export declare function codexNativeItemIds(values: readonly unknown[]): ReadonlySet<string>;
|
|
27
|
-
export declare function conversationItemNativeId(itemId: string): string | undefined;
|
|
28
|
-
/** Keep a custom tool invocation and its output in one Workbench card. */
|
|
29
|
-
export declare function codexOfficialItems(session: NodeAgentSession, nativeTurnId: string, values: readonly unknown[], turnSequence: number, startedAt: number | null, completedAt: number | null): NodeConversationItem[];
|
|
30
|
-
export declare function codexPairedToolCallId(value: unknown): string | undefined;
|
|
31
|
-
export declare function mergeCodexCustomToolItems(invocation: NodeConversationItem, result: NodeConversationItem): NodeConversationItem;
|
|
32
|
-
export declare function coalesceImageGenerationItems(items: readonly NodeConversationItem[]): readonly NodeConversationItem[];
|
|
33
|
-
export declare function codexPlanText(value: Record<string, unknown>): string | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* A final Claude tagged Plan Mode plan is fully wrapped in `<proposed_plan>` tags;
|
|
36
|
-
* text with missing or unclosed tags remains a regular assistant message.
|
|
37
|
-
*/
|
|
38
|
-
export declare function codexOfficialItem(session: NodeAgentSession, nativeTurnId: string, value: unknown, turnSequence: number, itemSequence: number, startedAt: number | null, completedAt: number | null): NodeConversationItem | undefined;
|
|
39
|
-
export declare function codexLiveConversationItem(value: Record<string, unknown>, completed: boolean, imageAttachments?: readonly Record<string, unknown>[]): PublicConversationItem | undefined;
|
|
40
|
-
export declare function codexImageAttachments(value: unknown): readonly NodeMessageAttachmentInput[];
|
|
41
|
-
export declare function codexUserInputQuestions(value: unknown): readonly {
|
|
42
|
-
readonly id: string;
|
|
43
|
-
readonly prompt: string;
|
|
44
|
-
readonly options: readonly {
|
|
45
|
-
readonly value: string;
|
|
46
|
-
readonly label: string;
|
|
47
|
-
readonly description: string | null;
|
|
48
|
-
}[];
|
|
49
|
-
readonly allowOther: boolean;
|
|
50
|
-
}[];
|
|
51
|
-
export declare function codexItemStatus(value: unknown, completed: boolean): PublicConversationItem['status'];
|
|
52
|
-
export declare function codexContentText(value: unknown): string;
|
|
53
|
-
export declare function codexCompactJson(value: unknown): string;
|
|
54
|
-
export declare function codexToolOutputSummary(value: unknown): string;
|
|
55
|
-
/** App Server custom output is an array of text blocks, not JSON to show verbatim. */
|
|
56
|
-
export declare function codexToolOutput(value: unknown): unknown;
|
|
57
|
-
export declare function codexVisibleToolText(value: string): string;
|
|
58
|
-
export declare function isCodexImageBlock(value: unknown): boolean;
|
|
59
|
-
export * from '../../util/node-operation-parsers.js';
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import type { NodeEnvelope, RunnerCommandDescriptor, RunnerCommandState } from '@myagentroam/protocol';
|
|
2
|
-
import type { NodeAgentSession, NodeMessageAttachmentInput } from '../../database.js';
|
|
3
|
-
import type { CodexComposerInput } from '../../codex-app-server.js';
|
|
4
|
-
import type { FakeRunnerStatus } from '../../fake-runner.js';
|
|
5
|
-
import { CodexRunner } from '../codex-runner.js';
|
|
6
|
-
type CodexImageInput = Extract<CodexComposerInput, {
|
|
7
|
-
readonly type: 'localImage';
|
|
8
|
-
}>;
|
|
9
|
-
interface CodexNotificationRun {
|
|
10
|
-
readonly threadId: string;
|
|
11
|
-
readonly turnId?: string;
|
|
12
|
-
}
|
|
13
|
-
export declare function resolveCodexNotificationRun<T extends CodexNotificationRun>(runs: ReadonlyMap<string, T>, input: {
|
|
14
|
-
readonly threadId?: string;
|
|
15
|
-
readonly turnId?: string;
|
|
16
|
-
readonly allowUnboundFallback?: boolean;
|
|
17
|
-
}): readonly [string, T] | undefined;
|
|
18
|
-
export interface CodexManagedRunHost<TAttachment> {
|
|
19
|
-
readonly available: () => boolean;
|
|
20
|
-
readonly intercepted: () => boolean;
|
|
21
|
-
readonly active: ReadonlySet<string>;
|
|
22
|
-
addActive(runId: string): void;
|
|
23
|
-
removeActive(runId: string): void;
|
|
24
|
-
adopt(input: {
|
|
25
|
-
runId: string;
|
|
26
|
-
sessionId: string;
|
|
27
|
-
runner: 'codex';
|
|
28
|
-
cwd: string;
|
|
29
|
-
externalSessionId?: string;
|
|
30
|
-
}): void;
|
|
31
|
-
session(sessionId: string): NodeAgentSession | undefined;
|
|
32
|
-
runStatus(runId: string): string | undefined;
|
|
33
|
-
run(runId: string): unknown;
|
|
34
|
-
interrupted(runId: string): boolean;
|
|
35
|
-
parseAttachments(value: unknown): readonly TAttachment[];
|
|
36
|
-
materialize(runId: string, attachments: readonly TAttachment[]): Promise<readonly CodexImageInput[]>;
|
|
37
|
-
completeCancelled(runId: string, cwd: string): boolean;
|
|
38
|
-
promoteSession(sessionId: string, nativeSessionId: string): void;
|
|
39
|
-
send(type: string, payload: unknown): void;
|
|
40
|
-
emit(runId: string, eventType: string, payload: unknown, status?: FakeRunnerStatus): void;
|
|
41
|
-
cancel(runId: string, threadId: string, turnId: string, cwd: string, status: 'INTERRUPTED' | 'CANCELLED'): Promise<void>;
|
|
42
|
-
createApproval(input: {
|
|
43
|
-
runId: string;
|
|
44
|
-
approvalId: string;
|
|
45
|
-
payload: unknown;
|
|
46
|
-
expiresAt: number;
|
|
47
|
-
}): void;
|
|
48
|
-
publishApproval(input: {
|
|
49
|
-
runId: string;
|
|
50
|
-
approvalId: string;
|
|
51
|
-
payload: unknown;
|
|
52
|
-
expiresAt: number;
|
|
53
|
-
}): void;
|
|
54
|
-
emitItem(runId: string, item: {
|
|
55
|
-
readonly itemId: string;
|
|
56
|
-
readonly kind: 'reasoning_summary' | 'tool_call' | 'command_execution' | 'user_input_request' | 'assistant_message' | 'plan' | 'context_compaction' | 'file_change' | 'error' | 'unknown';
|
|
57
|
-
readonly status: 'PENDING' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED' | 'DECLINED';
|
|
58
|
-
readonly payload: Record<string, unknown>;
|
|
59
|
-
readonly merge?: boolean;
|
|
60
|
-
readonly append?: 'sections' | 'outputPreview' | 'outputSummary';
|
|
61
|
-
}): void;
|
|
62
|
-
appendImages(runId: string, images: readonly NodeMessageAttachmentInput[]): readonly Record<string, unknown>[];
|
|
63
|
-
syncTitle(sessionId: string, nativeSessionId: string, cwd: string): Promise<void>;
|
|
64
|
-
commandState(sessionId: string, commandId: string): RunnerCommandState | undefined;
|
|
65
|
-
setCommandState(sessionId: string, state: RunnerCommandState): void;
|
|
66
|
-
clearCommandState(sessionId: string, commandId: string): void;
|
|
67
|
-
commandStates(sessionId: string): readonly RunnerCommandState[];
|
|
68
|
-
hasActiveSessionLease(sessionId: string): boolean;
|
|
69
|
-
fast(input: string): Promise<unknown>;
|
|
70
|
-
}
|
|
71
|
-
export declare class CodexManagedRunController<TAttachment> {
|
|
72
|
-
private readonly runner;
|
|
73
|
-
private readonly host;
|
|
74
|
-
constructor(runner: CodexRunner, host: CodexManagedRunHost<TAttachment>);
|
|
75
|
-
executeCommand(session: NodeAgentSession, command: RunnerCommandDescriptor, input: string, context: {
|
|
76
|
-
readonly secretEnvironment: Readonly<Record<string, string>>;
|
|
77
|
-
}): Promise<unknown>;
|
|
78
|
-
private compact;
|
|
79
|
-
handleNotification(notification: {
|
|
80
|
-
readonly method: string;
|
|
81
|
-
readonly params: unknown;
|
|
82
|
-
readonly requestId?: string | number;
|
|
83
|
-
}): void;
|
|
84
|
-
private requestApproval;
|
|
85
|
-
private requestUserInput;
|
|
86
|
-
start(envelope: NodeEnvelope): void;
|
|
87
|
-
private run;
|
|
88
|
-
private emitError;
|
|
89
|
-
}
|
|
90
|
-
export {};
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { CodexAppServerClient, type CodexComposerInput, type CodexRunConfiguration, type JsonRpcNotification } from '../codex-app-server.js';
|
|
2
|
-
import { AbstractRunner, type ExternalResumeContext, type ExternalResumeResult, type RunnerDiscoveryContext, type RunnerConversationHistoryPage, type RunnerConversationHistoryReaders, type RunnerSessionPresentationContext, type RunnerSessionPresentation, type RunnerProjectionTitleInput } from './abstract-runner.js';
|
|
3
|
-
import type { NodeCapabilities, RunnerDefaultConfiguration, RunnerProfile } from '@myagentroam/protocol';
|
|
4
|
-
import type { NodeAgentSession, NodeDatabase } from '../database.js';
|
|
5
|
-
import type { NodeWorkspace } from '../database.js';
|
|
6
|
-
export declare class CodexRunner extends AbstractRunner<'codex'> {
|
|
7
|
-
private readonly client;
|
|
8
|
-
private readonly profileClientFactory;
|
|
9
|
-
readonly name: "codex";
|
|
10
|
-
readonly discoveryScope: "ALL_WORKSPACES";
|
|
11
|
-
readonly execution: CodexExecutionState;
|
|
12
|
-
private fastEnabled;
|
|
13
|
-
private environmentFingerprint;
|
|
14
|
-
private readonly environmentRuns;
|
|
15
|
-
private readonly profileCache;
|
|
16
|
-
private readonly profileCacheTimers;
|
|
17
|
-
private readonly profileRefreshes;
|
|
18
|
-
private readonly profileClients;
|
|
19
|
-
private readonly profileKeyByEnvironment;
|
|
20
|
-
private latestProfileCache;
|
|
21
|
-
private selectedProfileKey;
|
|
22
|
-
constructor(client?: CodexAppServerClient, profileClientFactory?: () => CodexAppServerClient);
|
|
23
|
-
profile(capabilities: NodeCapabilities): RunnerProfile;
|
|
24
|
-
refreshProfile(capabilities: NodeCapabilities, workspace?: NodeWorkspace, environment?: Readonly<Record<string, string>>): Promise<RunnerProfile>;
|
|
25
|
-
private refreshCodexProfile;
|
|
26
|
-
private selectCachedProfile;
|
|
27
|
-
private cacheProfile;
|
|
28
|
-
private fetchCodexProfile;
|
|
29
|
-
available(capabilities: NodeCapabilities): boolean;
|
|
30
|
-
executeGlobalCommand(commandId: string, input: string): unknown;
|
|
31
|
-
serviceTier(): 'fast' | undefined;
|
|
32
|
-
mcpConfiguration(raw: unknown, secrets: Readonly<Record<string, string>>): unknown;
|
|
33
|
-
usesRunnerTitleForRename(): boolean;
|
|
34
|
-
renameNative(session: NodeAgentSession, input: {
|
|
35
|
-
readonly title?: string | null;
|
|
36
|
-
readonly pinned?: boolean;
|
|
37
|
-
}, database: NodeDatabase): Promise<void>;
|
|
38
|
-
projectedRunnerTitle(metadata: ReturnType<NodeDatabase['getNativeSessionMetadata']>, input: RunnerProjectionTitleInput, database: NodeDatabase | undefined): string | null;
|
|
39
|
-
readOfficialConversation(session: NodeAgentSession, input: {
|
|
40
|
-
readonly cursor?: string;
|
|
41
|
-
readonly limit?: number;
|
|
42
|
-
}, managedTurn: (nativeTurnId: string) => import('../database.js').NodeConversationTurn | undefined): Promise<{
|
|
43
|
-
readonly turns: readonly import("../database.js").NodeConversationTurn[];
|
|
44
|
-
readonly nextCursor: string | null;
|
|
45
|
-
} | undefined>;
|
|
46
|
-
readConversationHistory(readers: RunnerConversationHistoryReaders): Promise<RunnerConversationHistoryPage | undefined>;
|
|
47
|
-
readExternalActivity(session: NodeAgentSession): Promise<"UNAVAILABLE" | "MANAGED_ACTIVE" | "EXTERNAL_ACTIVE" | "IDLE" | undefined>;
|
|
48
|
-
acceptsTruncatedNativeHistory(): boolean;
|
|
49
|
-
readManagedRunnerTitle(session: NodeAgentSession, nativeSessionId: string): Promise<string | undefined>;
|
|
50
|
-
nativeImageRoots(session: NodeAgentSession): readonly string[];
|
|
51
|
-
managedRunForNativeTurn(nativeTurnId: string): string | undefined;
|
|
52
|
-
protected profileForValidation(): RunnerProfile;
|
|
53
|
-
defaultConfiguration(_workspace?: NodeWorkspace, environment?: Readonly<Record<string, string>>): RunnerDefaultConfiguration;
|
|
54
|
-
supportsConfiguration(configuration: RunnerDefaultConfiguration, _workspace?: NodeWorkspace, environment?: Readonly<Record<string, string>>): boolean;
|
|
55
|
-
private profileCacheForEnvironment;
|
|
56
|
-
resumeExternal(external: NodeAgentSession, context: ExternalResumeContext, force?: boolean): Promise<ExternalResumeResult>;
|
|
57
|
-
discoverSessions(context: RunnerDiscoveryContext, workspace?: NodeWorkspace): Promise<readonly NodeAgentSession[]>;
|
|
58
|
-
readContextUsage(session: NodeAgentSession): Promise<import("../native-session-history.js").NativeCodexContextUsage | undefined>;
|
|
59
|
-
presentSession(session: NodeAgentSession, capabilities: NodeCapabilities, context: RunnerSessionPresentationContext): RunnerSessionPresentation;
|
|
60
|
-
onNotification(listener: (notification: JsonRpcNotification) => void): () => void;
|
|
61
|
-
start(): Promise<void>;
|
|
62
|
-
recoverMissingRollout(runId: string, error: unknown): Promise<boolean>;
|
|
63
|
-
prepareEnvironment(environment: Readonly<Record<string, string>>, runId: string): void;
|
|
64
|
-
releaseEnvironment(runId: string): void;
|
|
65
|
-
stop(): void;
|
|
66
|
-
request(method: string, params: unknown): Promise<unknown>;
|
|
67
|
-
respond(requestId: string | number, result: unknown): void;
|
|
68
|
-
listThreads(): Promise<unknown>;
|
|
69
|
-
readThread(threadId: string, includeTurns?: boolean): Promise<unknown>;
|
|
70
|
-
startThread(cwd: string, configuration?: CodexRunConfiguration): Promise<unknown>;
|
|
71
|
-
forkThread(threadId: string, cwd: string, lastTurnId: string, configuration?: CodexRunConfiguration): Promise<unknown>;
|
|
72
|
-
forkNative(session: NodeAgentSession, boundary: string | null, title: string): Promise<string>;
|
|
73
|
-
resumeThread(threadId: string, cwd: string, configuration?: CodexRunConfiguration): Promise<unknown>;
|
|
74
|
-
startTurn(threadId: string, text: string, cwd: string, configuration?: CodexRunConfiguration, attachments?: readonly Extract<CodexComposerInput, {
|
|
75
|
-
readonly type: 'localImage';
|
|
76
|
-
}>[]): Promise<unknown>;
|
|
77
|
-
interruptTurn(threadId: string, turnId: string): Promise<unknown>;
|
|
78
|
-
setThreadName(threadId: string, name: string): Promise<unknown>;
|
|
79
|
-
listCollaborationModes(): Promise<unknown>;
|
|
80
|
-
}
|
|
81
|
-
export declare class CodexExecutionState {
|
|
82
|
-
readonly runs: Map<string, {
|
|
83
|
-
sessionId: string;
|
|
84
|
-
threadId: string;
|
|
85
|
-
turnId?: string;
|
|
86
|
-
cwd: string;
|
|
87
|
-
refreshTitle?: boolean;
|
|
88
|
-
}>;
|
|
89
|
-
readonly managedTurns: Map<string, {
|
|
90
|
-
sessionId: string;
|
|
91
|
-
runId: string;
|
|
92
|
-
}>;
|
|
93
|
-
readonly approvals: Map<string, string | number>;
|
|
94
|
-
readonly userInputs: Map<string, {
|
|
95
|
-
readonly runId: string;
|
|
96
|
-
readonly requestId: string | number;
|
|
97
|
-
readonly questions: readonly {
|
|
98
|
-
readonly id: string;
|
|
99
|
-
readonly options: readonly string[];
|
|
100
|
-
readonly allowOther: boolean;
|
|
101
|
-
}[];
|
|
102
|
-
}>;
|
|
103
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { FakeRunner, type FakeRunnerCallbacks, type FakeRunnerStep } from '../fake-runner.js';
|
|
2
|
-
import { AbstractRunner } from './abstract-runner.js';
|
|
3
|
-
import type { RunnerDefaultConfiguration, RunnerProfile } from '@myagentroam/protocol';
|
|
4
|
-
import type { NodeAgentSession } from '../database.js';
|
|
5
|
-
import type { ExternalResumeResult } from './abstract-runner.js';
|
|
6
|
-
/** Registered only by tests; never contributes a production Runner Profile. */
|
|
7
|
-
export declare class FakeTestRunner extends AbstractRunner<'fake'> {
|
|
8
|
-
private readonly runner;
|
|
9
|
-
readonly name: "fake";
|
|
10
|
-
readonly discoveryScope: "WORKSPACE_REQUIRED";
|
|
11
|
-
readonly advertised = false;
|
|
12
|
-
readonly interceptsRuns = true;
|
|
13
|
-
constructor(runner: FakeRunner);
|
|
14
|
-
stop(): void;
|
|
15
|
-
profile(): undefined;
|
|
16
|
-
available(): boolean;
|
|
17
|
-
protected profileForValidation(): RunnerProfile;
|
|
18
|
-
defaultConfiguration(): RunnerDefaultConfiguration;
|
|
19
|
-
resumeExternal(): Promise<ExternalResumeResult>;
|
|
20
|
-
discoverSessions(): Promise<readonly NodeAgentSession[]>;
|
|
21
|
-
readContextUsage(): Promise<undefined>;
|
|
22
|
-
start(runId: string, script: readonly FakeRunnerStep[], callbacks: FakeRunnerCallbacks): Promise<void>;
|
|
23
|
-
decide(runId: string, approvalId: string, decision: 'APPROVED' | 'REJECTED'): boolean;
|
|
24
|
-
interrupt(runId: string): boolean;
|
|
25
|
-
cancel(runId: string): boolean;
|
|
26
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { NodeAgentSession, NodeConversationTurn } from '../../database.js';
|
|
2
|
-
export declare function openCodeConversationPage(session: NodeAgentSession, messages: readonly unknown[], input: {
|
|
3
|
-
readonly cursor?: string;
|
|
4
|
-
readonly limit?: number;
|
|
5
|
-
}, managedTurn: (nativeTurnId: string) => NodeConversationTurn | undefined): {
|
|
6
|
-
readonly turns: readonly NodeConversationTurn[];
|
|
7
|
-
readonly nextCursor: string | null;
|
|
8
|
-
} | undefined;
|
|
9
|
-
export declare function openCodeQuestions(value: unknown): {
|
|
10
|
-
id: string;
|
|
11
|
-
prompt: string;
|
|
12
|
-
input: string;
|
|
13
|
-
options: {
|
|
14
|
-
value: string;
|
|
15
|
-
label: string;
|
|
16
|
-
description: string | null;
|
|
17
|
-
}[];
|
|
18
|
-
allowOther: boolean;
|
|
19
|
-
multiSelect: boolean;
|
|
20
|
-
}[];
|
|
21
|
-
export declare function openCodePatchToolPayload(): {
|
|
22
|
-
namespace: string;
|
|
23
|
-
toolName: string;
|
|
24
|
-
title: string;
|
|
25
|
-
inputSummary: null;
|
|
26
|
-
outputSummary: string;
|
|
27
|
-
outputSummaryCode: string;
|
|
28
|
-
progressLabel: null;
|
|
29
|
-
errorCode: null;
|
|
30
|
-
truncated: boolean;
|
|
31
|
-
};
|