remote-codex 0.1.9 → 0.11.0
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/apps/supervisor-api/dist/index.js +11942 -6101
- package/apps/supervisor-web/dist/assets/{highlighted-body-OFNGDK62-BFD4Ytvg.js → highlighted-body-OFNGDK62-ChrwAL9u.js} +1 -1
- package/apps/supervisor-web/dist/assets/index-DHf2HOXx.js +381 -0
- package/apps/supervisor-web/dist/assets/index-DpWxXCgt.css +32 -0
- package/apps/supervisor-web/dist/assets/{xterm-CukFWbxr.js → xterm-D4sevve4.js} +1 -1
- package/apps/supervisor-web/dist/index.html +2 -2
- package/config/codex-model-pricing.json +63 -0
- package/package.json +5 -2
- package/packages/agent-runtime/src/index.ts +4 -0
- package/packages/agent-runtime/src/management-errors.ts +11 -0
- package/packages/agent-runtime/src/model-pricing.ts +312 -0
- package/packages/agent-runtime/src/registry.ts +19 -4
- package/packages/agent-runtime/src/runtime-errors.ts +97 -0
- package/packages/agent-runtime/src/types.ts +50 -4
- package/packages/agent-runtime/src/unavailable-runtime.ts +169 -0
- package/packages/claude/src/historyItems.ts +693 -0
- package/packages/claude/src/index.ts +2 -0
- package/packages/claude/src/runtimeAdapter.test.ts +2138 -0
- package/packages/claude/src/runtimeAdapter.ts +2145 -0
- package/packages/codex/src/appServerManager.ts +12 -3
- package/packages/codex/src/historyItems.test.ts +110 -0
- package/packages/codex/src/historyItems.ts +97 -16
- package/packages/codex/src/hookHistory.test.ts +59 -0
- package/packages/codex/src/index.ts +7 -0
- package/packages/codex/src/local-session-store.ts +390 -0
- package/packages/codex/src/management/codex-management-service.ts +454 -0
- package/packages/codex/src/management/codexHostConfig.test.ts +88 -0
- package/packages/codex/src/management/codexHostConfig.ts +188 -0
- package/packages/codex/src/management/errors.ts +20 -0
- package/packages/codex/src/modelPricing.test.ts +184 -0
- package/packages/codex/src/modelPricing.ts +9 -0
- package/packages/codex/src/runtime-errors.test.ts +72 -0
- package/packages/codex/src/runtime-errors.ts +37 -0
- package/packages/codex/src/runtimeAdapter.ts +25 -2
- package/packages/codex/src/thread-title.ts +1 -0
- package/packages/db/src/repositories.ts +30 -0
- package/packages/opencode/src/historyItems.test.ts +504 -0
- package/packages/opencode/src/historyItems.ts +896 -0
- package/packages/opencode/src/index.ts +2 -0
- package/packages/opencode/src/runtimeAdapter.test.ts +1355 -0
- package/packages/opencode/src/runtimeAdapter.ts +1469 -0
- package/packages/shared/src/agent-providers.ts +56 -0
- package/packages/shared/src/index.ts +174 -35
- package/apps/supervisor-web/dist/assets/index-CbIt0KnL.css +0 -32
- package/apps/supervisor-web/dist/assets/index-Rd2EBQac.js +0 -377
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { EventEmitter } from 'node:events';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
agentBackendMetadata,
|
|
5
|
+
} from '../../shared/src/index';
|
|
6
|
+
import type {
|
|
7
|
+
AgentBackendInstallationDto,
|
|
8
|
+
} from '../../shared/src/index';
|
|
9
|
+
import type {
|
|
10
|
+
AgentSessionDetail,
|
|
11
|
+
AgentTurn,
|
|
12
|
+
AgentProviderId,
|
|
13
|
+
AgentProviderCapabilities,
|
|
14
|
+
AgentRuntime,
|
|
15
|
+
AgentRuntimeManagementSchema,
|
|
16
|
+
AgentRuntimeStatus,
|
|
17
|
+
InterruptAgentTurnInput,
|
|
18
|
+
ReadAgentSessionOptions,
|
|
19
|
+
ResumeAgentSessionInput,
|
|
20
|
+
StartAgentSessionInput,
|
|
21
|
+
StartAgentSessionResult,
|
|
22
|
+
StartAgentTurnInput,
|
|
23
|
+
} from './types';
|
|
24
|
+
import { AgentRuntimeError } from './types';
|
|
25
|
+
|
|
26
|
+
const unavailableCapabilities: AgentProviderCapabilities = {
|
|
27
|
+
sessions: {
|
|
28
|
+
list: false,
|
|
29
|
+
read: false,
|
|
30
|
+
resume: false,
|
|
31
|
+
importLocal: false,
|
|
32
|
+
},
|
|
33
|
+
turns: {
|
|
34
|
+
start: false,
|
|
35
|
+
streamInput: false,
|
|
36
|
+
steer: false,
|
|
37
|
+
interrupt: false,
|
|
38
|
+
compact: false,
|
|
39
|
+
},
|
|
40
|
+
branching: {
|
|
41
|
+
fork: false,
|
|
42
|
+
hardRollback: false,
|
|
43
|
+
resumeAt: false,
|
|
44
|
+
rewindFiles: false,
|
|
45
|
+
},
|
|
46
|
+
controls: {
|
|
47
|
+
planMode: false,
|
|
48
|
+
permissionRequests: false,
|
|
49
|
+
sandboxMode: false,
|
|
50
|
+
performanceMode: false,
|
|
51
|
+
goals: false,
|
|
52
|
+
},
|
|
53
|
+
management: {
|
|
54
|
+
models: false,
|
|
55
|
+
mcpStatus: false,
|
|
56
|
+
skills: false,
|
|
57
|
+
hooks: false,
|
|
58
|
+
hookTrust: false,
|
|
59
|
+
hostConfigFiles: false,
|
|
60
|
+
providerSettings: false,
|
|
61
|
+
},
|
|
62
|
+
usage: {
|
|
63
|
+
contextWindow: false,
|
|
64
|
+
tokenUsage: false,
|
|
65
|
+
costUsd: false,
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const unavailableManagementSchema: AgentRuntimeManagementSchema = {
|
|
70
|
+
hostConfigFiles: [],
|
|
71
|
+
toolboxItems: [],
|
|
72
|
+
hookCommandTemplates: [],
|
|
73
|
+
providerConfigFormat: 'none',
|
|
74
|
+
mcpConfigFormat: 'none',
|
|
75
|
+
configArchives: false,
|
|
76
|
+
buildRestart: false,
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export interface UnavailableRuntimeOptions {
|
|
80
|
+
provider: AgentProviderId;
|
|
81
|
+
reason: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export class UnavailableRuntimeAdapter extends EventEmitter implements AgentRuntime {
|
|
85
|
+
readonly provider: AgentProviderId;
|
|
86
|
+
readonly displayName: string;
|
|
87
|
+
readonly description: string;
|
|
88
|
+
readonly capabilities = unavailableCapabilities;
|
|
89
|
+
readonly managementSchema = unavailableManagementSchema;
|
|
90
|
+
readonly installation: AgentBackendInstallationDto;
|
|
91
|
+
|
|
92
|
+
private readonly status: AgentRuntimeStatus;
|
|
93
|
+
|
|
94
|
+
constructor(options: UnavailableRuntimeOptions) {
|
|
95
|
+
super();
|
|
96
|
+
const metadata = agentBackendMetadata[options.provider];
|
|
97
|
+
this.provider = options.provider;
|
|
98
|
+
this.displayName = metadata.displayName;
|
|
99
|
+
this.description = metadata.description;
|
|
100
|
+
this.installation = {
|
|
101
|
+
packageName: null,
|
|
102
|
+
installed: false,
|
|
103
|
+
installedVersion: null,
|
|
104
|
+
latestVersion: null,
|
|
105
|
+
installCommand: null,
|
|
106
|
+
updateCommand: null,
|
|
107
|
+
busy: false,
|
|
108
|
+
lastError: options.reason,
|
|
109
|
+
};
|
|
110
|
+
this.status = {
|
|
111
|
+
state: 'stopped',
|
|
112
|
+
transport: metadata.defaultTransport,
|
|
113
|
+
lastStartedAt: null,
|
|
114
|
+
lastError: options.reason,
|
|
115
|
+
restartCount: 0,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
getStatus(): AgentRuntimeStatus {
|
|
120
|
+
return { ...this.status };
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
async start() {}
|
|
124
|
+
|
|
125
|
+
async stop() {}
|
|
126
|
+
|
|
127
|
+
async listModels() {
|
|
128
|
+
return [];
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
async listSessions() {
|
|
132
|
+
return [];
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
async listLoadedSessions() {
|
|
136
|
+
return [];
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
async readSession(
|
|
140
|
+
_providerSessionId: string,
|
|
141
|
+
_options?: ReadAgentSessionOptions,
|
|
142
|
+
): Promise<AgentSessionDetail> {
|
|
143
|
+
throw this.unavailableError();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
async startSession(_input: StartAgentSessionInput): Promise<StartAgentSessionResult> {
|
|
147
|
+
throw this.unavailableError();
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
async resumeSession(_input: ResumeAgentSessionInput): Promise<StartAgentSessionResult> {
|
|
151
|
+
throw this.unavailableError();
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
async startTurn(_input: StartAgentTurnInput): Promise<AgentTurn> {
|
|
155
|
+
throw this.unavailableError();
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
async interruptTurn(_input: InterruptAgentTurnInput): Promise<AgentTurn | null> {
|
|
159
|
+
throw this.unavailableError();
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
private unavailableError() {
|
|
163
|
+
return new AgentRuntimeError(
|
|
164
|
+
this.status.lastError ?? `${this.displayName} is not available.`,
|
|
165
|
+
this.provider,
|
|
166
|
+
'provider_unavailable',
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
}
|