@junctionpanel/server 0.1.31 → 0.1.33
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/server/client/daemon-client.d.ts +5 -1
- package/dist/server/client/daemon-client.d.ts.map +1 -1
- package/dist/server/client/daemon-client.js +42 -0
- package/dist/server/client/daemon-client.js.map +1 -1
- package/dist/server/server/agent/agent-manager.d.ts +3 -0
- package/dist/server/server/agent/agent-manager.d.ts.map +1 -1
- package/dist/server/server/agent/agent-manager.js +88 -5
- package/dist/server/server/agent/agent-manager.js.map +1 -1
- package/dist/server/server/agent/agent-projections.d.ts.map +1 -1
- package/dist/server/server/agent/agent-projections.js +9 -2
- package/dist/server/server/agent/agent-projections.js.map +1 -1
- package/dist/server/server/agent/agent-sdk-types.d.ts +19 -3
- package/dist/server/server/agent/agent-sdk-types.d.ts.map +1 -1
- package/dist/server/server/agent/agent-sdk-types.js.map +1 -1
- package/dist/server/server/agent/agent-storage.d.ts +30 -30
- package/dist/server/server/agent/agent-storage.d.ts.map +1 -1
- package/dist/server/server/agent/agent-storage.js +33 -1
- package/dist/server/server/agent/agent-storage.js.map +1 -1
- package/dist/server/server/agent/codex-config.d.ts +12 -0
- package/dist/server/server/agent/codex-config.d.ts.map +1 -0
- package/dist/server/server/agent/codex-config.js +42 -0
- package/dist/server/server/agent/codex-config.js.map +1 -0
- package/dist/server/server/agent/mcp-server.js +8 -8
- package/dist/server/server/agent/mcp-server.js.map +1 -1
- package/dist/server/server/agent/provider-launch-config.d.ts +2 -2
- package/dist/server/server/agent/provider-launch-config.d.ts.map +1 -1
- package/dist/server/server/agent/provider-launch-config.js +32 -5
- package/dist/server/server/agent/provider-launch-config.js.map +1 -1
- package/dist/server/server/agent/provider-manifest.js +10 -10
- package/dist/server/server/agent/provider-manifest.js.map +1 -1
- package/dist/server/server/agent/providers/claude/model-catalog.d.ts +17 -25
- package/dist/server/server/agent/providers/claude/model-catalog.d.ts.map +1 -1
- package/dist/server/server/agent/providers/claude/model-catalog.js +228 -40
- package/dist/server/server/agent/providers/claude/model-catalog.js.map +1 -1
- package/dist/server/server/agent/providers/claude-agent.d.ts +2 -1
- package/dist/server/server/agent/providers/claude-agent.d.ts.map +1 -1
- package/dist/server/server/agent/providers/claude-agent.js +201 -36
- package/dist/server/server/agent/providers/claude-agent.js.map +1 -1
- package/dist/server/server/agent/providers/codex-app-server-agent.d.ts +30 -1
- package/dist/server/server/agent/providers/codex-app-server-agent.d.ts.map +1 -1
- package/dist/server/server/agent/providers/codex-app-server-agent.js +309 -49
- package/dist/server/server/agent/providers/codex-app-server-agent.js.map +1 -1
- package/dist/server/server/agent/providers/gemini-agent.d.ts +17 -5
- package/dist/server/server/agent/providers/gemini-agent.d.ts.map +1 -1
- package/dist/server/server/agent/providers/gemini-agent.js +1040 -482
- package/dist/server/server/agent/providers/gemini-agent.js.map +1 -1
- package/dist/server/server/agent/providers/opencode-agent.d.ts.map +1 -1
- package/dist/server/server/agent/providers/opencode-agent.js +1 -1
- package/dist/server/server/agent/providers/opencode-agent.js.map +1 -1
- package/dist/server/server/agent/providers/tool-call-detail-primitives.d.ts.map +1 -1
- package/dist/server/server/bootstrap.d.ts.map +1 -1
- package/dist/server/server/bootstrap.js +2 -1
- package/dist/server/server/bootstrap.js.map +1 -1
- package/dist/server/server/cli-runtime-exports.d.ts +2 -0
- package/dist/server/server/cli-runtime-exports.d.ts.map +1 -1
- package/dist/server/server/cli-runtime-exports.js +2 -0
- package/dist/server/server/cli-runtime-exports.js.map +1 -1
- package/dist/server/server/daemon-doctor.d.ts +4 -0
- package/dist/server/server/daemon-doctor.d.ts.map +1 -1
- package/dist/server/server/daemon-doctor.js +33 -12
- package/dist/server/server/daemon-doctor.js.map +1 -1
- package/dist/server/server/daemon-package-context.d.ts +10 -0
- package/dist/server/server/daemon-package-context.d.ts.map +1 -0
- package/dist/server/server/daemon-package-context.js +31 -0
- package/dist/server/server/daemon-package-context.js.map +1 -0
- package/dist/server/server/package-update.d.ts +32 -0
- package/dist/server/server/package-update.d.ts.map +1 -0
- package/dist/server/server/package-update.js +196 -0
- package/dist/server/server/package-update.js.map +1 -0
- package/dist/server/server/session.d.ts +1 -0
- package/dist/server/server/session.d.ts.map +1 -1
- package/dist/server/server/session.js +49 -16
- package/dist/server/server/session.js.map +1 -1
- package/dist/server/shared/messages.d.ts +2150 -1786
- package/dist/server/shared/messages.d.ts.map +1 -1
- package/dist/server/shared/messages.js +36 -1
- package/dist/server/shared/messages.js.map +1 -1
- package/package.json +3 -2
|
@@ -1,6 +1,30 @@
|
|
|
1
|
-
import type { AgentCapabilityFlags, AgentClient, AgentModelDefinition, AgentPromptInput, AgentSession, AgentSessionConfig, ToolCallTimelineItem, ListModelsOptions, ListPersistedAgentsOptions, PersistedAgentDescriptor } from "../agent-sdk-types.js";
|
|
1
|
+
import type { AgentCapabilityFlags, AgentClient, AgentModelDefinition, AgentPermissionResponse, AgentPromptInput, AgentSession, AgentSessionConfig, ToolCallTimelineItem, ListModelsOptions, ListPersistedAgentsOptions, PersistedAgentDescriptor } from "../agent-sdk-types.js";
|
|
2
2
|
import type { Logger } from "pino";
|
|
3
3
|
import { type ProviderRuntimeSettings } from "../provider-launch-config.js";
|
|
4
|
+
declare function parseUpdatedQuestionAnswers(updatedInput: unknown): Record<string, string[]>;
|
|
5
|
+
type CodexQuestionOption = {
|
|
6
|
+
label?: string;
|
|
7
|
+
value?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
};
|
|
10
|
+
type CodexQuestionDescriptor = {
|
|
11
|
+
id: string;
|
|
12
|
+
header?: string;
|
|
13
|
+
question?: string;
|
|
14
|
+
isOther?: boolean;
|
|
15
|
+
isSecret?: boolean;
|
|
16
|
+
options?: CodexQuestionOption[];
|
|
17
|
+
};
|
|
18
|
+
declare function normalizeCodexQuestionDescriptors(value: unknown): CodexQuestionDescriptor[];
|
|
19
|
+
declare function buildCodexPermissionsResponse(response: AgentPermissionResponse, requestedPermissions: unknown): {
|
|
20
|
+
permissions: Record<string, unknown>;
|
|
21
|
+
scope: "turn" | "session";
|
|
22
|
+
};
|
|
23
|
+
declare function buildCodexElicitationResponse(response: AgentPermissionResponse): {
|
|
24
|
+
action: "accept" | "decline" | "cancel";
|
|
25
|
+
content: unknown | null;
|
|
26
|
+
_meta: unknown | null;
|
|
27
|
+
};
|
|
4
28
|
declare function formatProposedPlanBlock(text: string): string;
|
|
5
29
|
declare function supportsPlanCollaborationMode(response: unknown): boolean;
|
|
6
30
|
declare function shouldRetryInitializeWithoutExperimentalApi(error: unknown): boolean;
|
|
@@ -21,6 +45,11 @@ export declare const __codexAppServerInternals: {
|
|
|
21
45
|
shouldRetryInitializeWithoutExperimentalApi: typeof shouldRetryInitializeWithoutExperimentalApi;
|
|
22
46
|
shouldRetryTurnStartWithoutCollaborationMode: typeof shouldRetryTurnStartWithoutCollaborationMode;
|
|
23
47
|
formatProposedPlanBlock: typeof formatProposedPlanBlock;
|
|
48
|
+
normalizeCodexQuestionDescriptors: typeof normalizeCodexQuestionDescriptors;
|
|
49
|
+
parseUpdatedQuestionAnswers: typeof parseUpdatedQuestionAnswers;
|
|
50
|
+
buildCodexPermissionsResponse: typeof buildCodexPermissionsResponse;
|
|
51
|
+
buildCodexElicitationResponse: typeof buildCodexElicitationResponse;
|
|
52
|
+
supportedRequestMethods: readonly ["item/commandExecution/requestApproval", "item/fileChange/requestApproval", "tool/requestUserInput", "item/tool/requestUserInput", "item/permissions/requestApproval", "mcpServer/elicitation/request"];
|
|
24
53
|
};
|
|
25
54
|
export declare class CodexAppServerAgentClient implements AgentClient {
|
|
26
55
|
private readonly logger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-app-server-agent.d.ts","sourceRoot":"","sources":["../../../../../src/server/agent/providers/codex-app-server-agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,WAAW,EAEX,oBAAoB,
|
|
1
|
+
{"version":3,"file":"codex-app-server-agent.d.ts","sourceRoot":"","sources":["../../../../../src/server/agent/providers/codex-app-server-agent.ts"],"names":[],"mappings":"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"}
|
|
@@ -7,6 +7,7 @@ import { z } from "zod";
|
|
|
7
7
|
import { loadCodexPersistedTimeline } from "./codex-rollout-timeline.js";
|
|
8
8
|
import { mapCodexRolloutToolCall, mapCodexToolCallFromThreadItem, } from "./codex/tool-call-mapper.js";
|
|
9
9
|
import { applyProviderEnv, isProviderCommandAvailable, resolveProviderCommandPrefix, } from "../provider-launch-config.js";
|
|
10
|
+
import { buildCodexRuntimeExtra, DEFAULT_CODEX_MODE_ID, isCodexPlanModeEnabled, normalizeCodexModeId, setCodexPlanModeEnabled, } from "../codex-config.js";
|
|
10
11
|
import { writeImageAttachment } from "./image-attachments.js";
|
|
11
12
|
const DEFAULT_TIMEOUT_MS = 14 * 24 * 60 * 60 * 1000;
|
|
12
13
|
const TURN_START_TIMEOUT_MS = 90 * 1000;
|
|
@@ -21,39 +22,39 @@ const CODEX_APP_SERVER_CAPABILITIES = {
|
|
|
21
22
|
};
|
|
22
23
|
const CODEX_MODES = [
|
|
23
24
|
{
|
|
24
|
-
id: "
|
|
25
|
-
label: "
|
|
26
|
-
description: "
|
|
25
|
+
id: "default",
|
|
26
|
+
label: "Ask",
|
|
27
|
+
description: "Trusted commands run automatically; untrusted commands and edits require approval.",
|
|
27
28
|
},
|
|
28
29
|
{
|
|
29
|
-
id: "
|
|
30
|
-
label: "Auto",
|
|
31
|
-
description: "
|
|
30
|
+
id: "acceptEdits",
|
|
31
|
+
label: "Auto Edit",
|
|
32
|
+
description: "Workspace edits and commands run automatically without approval.",
|
|
32
33
|
},
|
|
33
34
|
{
|
|
34
|
-
id: "
|
|
35
|
-
label: "
|
|
36
|
-
description: "
|
|
35
|
+
id: "bypassPermissions",
|
|
36
|
+
label: "Bypass",
|
|
37
|
+
description: "Full disk and network access with no approval prompts.",
|
|
37
38
|
},
|
|
38
39
|
];
|
|
39
|
-
const DEFAULT_CODEX_MODE_ID = "auto";
|
|
40
40
|
const MODE_PRESETS = {
|
|
41
|
-
|
|
42
|
-
approvalPolicy: "
|
|
43
|
-
sandbox: "
|
|
41
|
+
default: {
|
|
42
|
+
approvalPolicy: "untrusted",
|
|
43
|
+
sandbox: "workspace-write",
|
|
44
44
|
},
|
|
45
|
-
|
|
46
|
-
approvalPolicy: "
|
|
45
|
+
acceptEdits: {
|
|
46
|
+
approvalPolicy: "never",
|
|
47
47
|
sandbox: "workspace-write",
|
|
48
48
|
},
|
|
49
|
-
|
|
49
|
+
bypassPermissions: {
|
|
50
50
|
approvalPolicy: "never",
|
|
51
51
|
sandbox: "danger-full-access",
|
|
52
52
|
networkAccess: true,
|
|
53
53
|
},
|
|
54
54
|
};
|
|
55
55
|
function validateCodexMode(modeId) {
|
|
56
|
-
|
|
56
|
+
const normalizedModeId = normalizeCodexModeId(modeId);
|
|
57
|
+
if (typeof normalizedModeId !== "string" || !(normalizedModeId in MODE_PRESETS)) {
|
|
57
58
|
const validModes = Object.keys(MODE_PRESETS).join(", ");
|
|
58
59
|
throw new Error(`Invalid Codex mode "${modeId}". Valid modes are: ${validModes}`);
|
|
59
60
|
}
|
|
@@ -184,6 +185,13 @@ function toRecord(value) {
|
|
|
184
185
|
}
|
|
185
186
|
return value;
|
|
186
187
|
}
|
|
188
|
+
function toNonEmptyString(value) {
|
|
189
|
+
if (typeof value !== "string") {
|
|
190
|
+
return null;
|
|
191
|
+
}
|
|
192
|
+
const trimmed = value.trim();
|
|
193
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
194
|
+
}
|
|
187
195
|
function parseUpdatedQuestionAnswers(updatedInput) {
|
|
188
196
|
const parsed = {};
|
|
189
197
|
const root = toRecord(updatedInput);
|
|
@@ -218,6 +226,95 @@ function parseUpdatedQuestionAnswers(updatedInput) {
|
|
|
218
226
|
}
|
|
219
227
|
return parsed;
|
|
220
228
|
}
|
|
229
|
+
function normalizeCodexQuestionOption(value) {
|
|
230
|
+
if (typeof value === "string") {
|
|
231
|
+
const label = value.trim();
|
|
232
|
+
return label ? { label, value: label } : null;
|
|
233
|
+
}
|
|
234
|
+
const record = toRecord(value);
|
|
235
|
+
if (!record) {
|
|
236
|
+
return null;
|
|
237
|
+
}
|
|
238
|
+
const label = toNonEmptyString(record.label) ?? toNonEmptyString(record.value);
|
|
239
|
+
if (!label) {
|
|
240
|
+
return null;
|
|
241
|
+
}
|
|
242
|
+
return {
|
|
243
|
+
label,
|
|
244
|
+
value: toNonEmptyString(record.value) ?? label,
|
|
245
|
+
description: toNonEmptyString(record.description) ?? undefined,
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
function normalizeCodexQuestionDescriptor(value, fallbackIndex) {
|
|
249
|
+
const record = toRecord(value);
|
|
250
|
+
if (!record) {
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
const id = toNonEmptyString(record.id) ??
|
|
254
|
+
toNonEmptyString(record.key) ??
|
|
255
|
+
`question_${fallbackIndex + 1}`;
|
|
256
|
+
const options = Array.isArray(record.options)
|
|
257
|
+
? record.options
|
|
258
|
+
.map((option) => normalizeCodexQuestionOption(option))
|
|
259
|
+
.filter((option) => option !== null)
|
|
260
|
+
: [];
|
|
261
|
+
return {
|
|
262
|
+
id,
|
|
263
|
+
header: toNonEmptyString(record.header) ?? undefined,
|
|
264
|
+
question: toNonEmptyString(record.question) ??
|
|
265
|
+
toNonEmptyString(record.prompt) ??
|
|
266
|
+
toNonEmptyString(record.text) ??
|
|
267
|
+
undefined,
|
|
268
|
+
isOther: Boolean(record.isOther ?? record.is_other),
|
|
269
|
+
isSecret: Boolean(record.isSecret ?? record.is_secret),
|
|
270
|
+
options,
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
function normalizeCodexQuestionDescriptors(value) {
|
|
274
|
+
if (!Array.isArray(value)) {
|
|
275
|
+
return [];
|
|
276
|
+
}
|
|
277
|
+
return value
|
|
278
|
+
.map((question, index) => normalizeCodexQuestionDescriptor(question, index))
|
|
279
|
+
.filter((question) => question !== null);
|
|
280
|
+
}
|
|
281
|
+
function extractExplicitDecision(updatedInput) {
|
|
282
|
+
const root = toRecord(updatedInput);
|
|
283
|
+
if (!root || !Object.prototype.hasOwnProperty.call(root, "decision")) {
|
|
284
|
+
return null;
|
|
285
|
+
}
|
|
286
|
+
return root.decision ?? null;
|
|
287
|
+
}
|
|
288
|
+
function buildCodexPermissionsResponse(response, requestedPermissions) {
|
|
289
|
+
const root = toRecord(response.updatedInput);
|
|
290
|
+
const permissions = toRecord(root?.permissions);
|
|
291
|
+
const scope = root?.scope === "session" ? "session" : "turn";
|
|
292
|
+
if (permissions) {
|
|
293
|
+
return { permissions, scope };
|
|
294
|
+
}
|
|
295
|
+
if (response.behavior === "allow") {
|
|
296
|
+
return { permissions: toRecord(requestedPermissions) ?? {}, scope };
|
|
297
|
+
}
|
|
298
|
+
return { permissions: {}, scope };
|
|
299
|
+
}
|
|
300
|
+
function buildCodexElicitationResponse(response) {
|
|
301
|
+
const root = toRecord(response.updatedInput);
|
|
302
|
+
const explicitAction = root?.action === "accept" || root?.action === "decline" || root?.action === "cancel"
|
|
303
|
+
? root.action
|
|
304
|
+
: null;
|
|
305
|
+
if (response.behavior === "allow") {
|
|
306
|
+
return {
|
|
307
|
+
action: explicitAction ?? "accept",
|
|
308
|
+
content: root?.content ?? null,
|
|
309
|
+
_meta: root?._meta ?? null,
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
return {
|
|
313
|
+
action: explicitAction ?? (response.interrupt ? "cancel" : "decline"),
|
|
314
|
+
content: null,
|
|
315
|
+
_meta: root?._meta ?? null,
|
|
316
|
+
};
|
|
317
|
+
}
|
|
221
318
|
function toPendingPermissionId(requestId) {
|
|
222
319
|
return `permission-${String(requestId)}`;
|
|
223
320
|
}
|
|
@@ -1395,6 +1492,18 @@ export const __codexAppServerInternals = {
|
|
|
1395
1492
|
shouldRetryInitializeWithoutExperimentalApi,
|
|
1396
1493
|
shouldRetryTurnStartWithoutCollaborationMode,
|
|
1397
1494
|
formatProposedPlanBlock,
|
|
1495
|
+
normalizeCodexQuestionDescriptors,
|
|
1496
|
+
parseUpdatedQuestionAnswers,
|
|
1497
|
+
buildCodexPermissionsResponse,
|
|
1498
|
+
buildCodexElicitationResponse,
|
|
1499
|
+
supportedRequestMethods: [
|
|
1500
|
+
"item/commandExecution/requestApproval",
|
|
1501
|
+
"item/fileChange/requestApproval",
|
|
1502
|
+
"tool/requestUserInput",
|
|
1503
|
+
"item/tool/requestUserInput",
|
|
1504
|
+
"item/permissions/requestApproval",
|
|
1505
|
+
"mcpServer/elicitation/request",
|
|
1506
|
+
],
|
|
1398
1507
|
};
|
|
1399
1508
|
class CodexAppServerAgentSession {
|
|
1400
1509
|
constructor(config, resumeHandle, logger, spawnAppServer) {
|
|
@@ -1431,9 +1540,14 @@ class CodexAppServerAgentSession {
|
|
|
1431
1540
|
if (config.modeId === undefined) {
|
|
1432
1541
|
throw new Error("Codex agent requires modeId to be specified");
|
|
1433
1542
|
}
|
|
1434
|
-
validateCodexMode(config.modeId);
|
|
1435
|
-
this.currentMode = config.modeId;
|
|
1436
1543
|
this.config = config;
|
|
1544
|
+
const normalizedModeId = normalizeCodexModeId(config.modeId);
|
|
1545
|
+
if (typeof normalizedModeId !== "string") {
|
|
1546
|
+
throw new Error("Codex agent requires a valid modeId");
|
|
1547
|
+
}
|
|
1548
|
+
validateCodexMode(normalizedModeId);
|
|
1549
|
+
this.currentMode = normalizedModeId;
|
|
1550
|
+
this.config.modeId = normalizedModeId;
|
|
1437
1551
|
this.config.thinkingOptionId = normalizeCodexThinkingOptionId(this.config.thinkingOptionId);
|
|
1438
1552
|
if (this.resumeHandle?.sessionId) {
|
|
1439
1553
|
this.currentThreadId = this.resumeHandle.sessionId;
|
|
@@ -1469,6 +1583,7 @@ class CodexAppServerAgentSession {
|
|
|
1469
1583
|
}
|
|
1470
1584
|
await this.client.request("initialize", { clientInfo });
|
|
1471
1585
|
this.nativePlanModeSupported = false;
|
|
1586
|
+
setCodexPlanModeEnabled(this.config, false);
|
|
1472
1587
|
}
|
|
1473
1588
|
this.client.notify("initialized", {});
|
|
1474
1589
|
await this.loadCollaborationModes();
|
|
@@ -1483,15 +1598,20 @@ class CodexAppServerAgentSession {
|
|
|
1483
1598
|
if (!this.client)
|
|
1484
1599
|
return;
|
|
1485
1600
|
if (this.nativePlanModeSupported === false) {
|
|
1601
|
+
setCodexPlanModeEnabled(this.config, false);
|
|
1486
1602
|
return;
|
|
1487
1603
|
}
|
|
1488
1604
|
try {
|
|
1489
1605
|
const response = await this.client.request("collaborationMode/list", {});
|
|
1490
1606
|
this.nativePlanModeSupported = supportsPlanCollaborationMode(response);
|
|
1607
|
+
if (this.nativePlanModeSupported === false) {
|
|
1608
|
+
setCodexPlanModeEnabled(this.config, false);
|
|
1609
|
+
}
|
|
1491
1610
|
}
|
|
1492
1611
|
catch (error) {
|
|
1493
1612
|
this.logger.trace({ error }, "Failed to load collaboration modes");
|
|
1494
1613
|
this.nativePlanModeSupported = false;
|
|
1614
|
+
setCodexPlanModeEnabled(this.config, false);
|
|
1495
1615
|
}
|
|
1496
1616
|
}
|
|
1497
1617
|
async loadSkills() {
|
|
@@ -1525,9 +1645,12 @@ class CodexAppServerAgentSession {
|
|
|
1525
1645
|
registerRequestHandlers() {
|
|
1526
1646
|
if (!this.client)
|
|
1527
1647
|
return;
|
|
1528
|
-
this.client.setRequestHandler("item/commandExecution/requestApproval", (params, requestId) => this.handleCommandApprovalRequest(params, requestId));
|
|
1529
|
-
this.client.setRequestHandler("item/fileChange/requestApproval", (params, requestId) => this.handleFileChangeApprovalRequest(params, requestId));
|
|
1530
|
-
this.client.setRequestHandler("tool/requestUserInput", (params, requestId) => this.handleToolApprovalRequest(params, requestId));
|
|
1648
|
+
this.client.setRequestHandler("item/commandExecution/requestApproval", (params, requestId) => this.handleCommandApprovalRequest("item/commandExecution/requestApproval", params, requestId));
|
|
1649
|
+
this.client.setRequestHandler("item/fileChange/requestApproval", (params, requestId) => this.handleFileChangeApprovalRequest("item/fileChange/requestApproval", params, requestId));
|
|
1650
|
+
this.client.setRequestHandler("tool/requestUserInput", (params, requestId) => this.handleToolApprovalRequest("tool/requestUserInput", params, requestId));
|
|
1651
|
+
this.client.setRequestHandler("item/tool/requestUserInput", (params, requestId) => this.handleToolApprovalRequest("item/tool/requestUserInput", params, requestId));
|
|
1652
|
+
this.client.setRequestHandler("item/permissions/requestApproval", (params, requestId) => this.handlePermissionsApprovalRequest("item/permissions/requestApproval", params, requestId));
|
|
1653
|
+
this.client.setRequestHandler("mcpServer/elicitation/request", (params, requestId) => this.handleMcpElicitationRequest("mcpServer/elicitation/request", params, requestId));
|
|
1531
1654
|
}
|
|
1532
1655
|
async loadPersistedHistory() {
|
|
1533
1656
|
if (!this.client || !this.currentThreadId)
|
|
@@ -1725,7 +1848,10 @@ class CodexAppServerAgentSession {
|
|
|
1725
1848
|
const preset = MODE_PRESETS[this.currentMode] ?? MODE_PRESETS[DEFAULT_CODEX_MODE_ID];
|
|
1726
1849
|
const approvalPolicy = this.config.approvalPolicy ?? preset.approvalPolicy;
|
|
1727
1850
|
const sandboxPolicyType = this.config.sandboxMode ?? preset.sandbox;
|
|
1728
|
-
const
|
|
1851
|
+
const explicitPlanMode = options?.extra?.codex?.planMode;
|
|
1852
|
+
const planModeRequested = explicitPlanMode === undefined
|
|
1853
|
+
? isCodexPlanModeEnabled(this.config)
|
|
1854
|
+
: explicitPlanMode === true;
|
|
1729
1855
|
const thinkingOptionId = normalizeCodexThinkingOptionId(this.config.thinkingOptionId);
|
|
1730
1856
|
const params = {
|
|
1731
1857
|
threadId: this.currentThreadId,
|
|
@@ -1772,6 +1898,7 @@ class CodexAppServerAgentSession {
|
|
|
1772
1898
|
}
|
|
1773
1899
|
delete params.collaborationMode;
|
|
1774
1900
|
this.nativePlanModeSupported = false;
|
|
1901
|
+
setCodexPlanModeEnabled(this.config, false);
|
|
1775
1902
|
this.cachedRuntimeInfo = null;
|
|
1776
1903
|
downgradedFromPlanMode = planModeRequested;
|
|
1777
1904
|
await this.client.request("turn/start", params, TURN_START_TIMEOUT_MS);
|
|
@@ -1842,9 +1969,10 @@ class CodexAppServerAgentSession {
|
|
|
1842
1969
|
model: this.config.model ?? null,
|
|
1843
1970
|
thinkingOptionId: normalizeCodexThinkingOptionId(this.config.thinkingOptionId) ?? null,
|
|
1844
1971
|
modeId: this.currentMode ?? null,
|
|
1845
|
-
extra:
|
|
1846
|
-
|
|
1847
|
-
:
|
|
1972
|
+
extra: buildCodexRuntimeExtra({
|
|
1973
|
+
planModeSupported: this.nativePlanModeSupported,
|
|
1974
|
+
planModeEnabled: isCodexPlanModeEnabled(this.config),
|
|
1975
|
+
}),
|
|
1848
1976
|
};
|
|
1849
1977
|
this.cachedRuntimeInfo = info;
|
|
1850
1978
|
return { ...info };
|
|
@@ -1856,8 +1984,13 @@ class CodexAppServerAgentSession {
|
|
|
1856
1984
|
return this.currentMode ?? null;
|
|
1857
1985
|
}
|
|
1858
1986
|
async setMode(modeId) {
|
|
1859
|
-
|
|
1860
|
-
|
|
1987
|
+
const normalizedModeId = normalizeCodexModeId(modeId);
|
|
1988
|
+
if (typeof normalizedModeId !== "string") {
|
|
1989
|
+
throw new Error(`Invalid Codex mode "${modeId}"`);
|
|
1990
|
+
}
|
|
1991
|
+
validateCodexMode(normalizedModeId);
|
|
1992
|
+
this.currentMode = normalizedModeId;
|
|
1993
|
+
this.config.modeId = normalizedModeId;
|
|
1861
1994
|
this.cachedRuntimeInfo = null;
|
|
1862
1995
|
}
|
|
1863
1996
|
async setModel(modelId) {
|
|
@@ -1914,23 +2047,33 @@ class CodexAppServerAgentSession {
|
|
|
1914
2047
|
resolution: response,
|
|
1915
2048
|
});
|
|
1916
2049
|
if (pending.kind === "command") {
|
|
1917
|
-
const decision = response.
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
2050
|
+
const decision = extractExplicitDecision(response.updatedInput) ??
|
|
2051
|
+
(response.behavior === "allow"
|
|
2052
|
+
? "accept"
|
|
2053
|
+
: response.interrupt
|
|
2054
|
+
? "cancel"
|
|
2055
|
+
: "decline");
|
|
1922
2056
|
pending.resolve({ decision });
|
|
1923
2057
|
return;
|
|
1924
2058
|
}
|
|
1925
2059
|
if (pending.kind === "file") {
|
|
1926
|
-
const decision = response.
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
2060
|
+
const decision = extractExplicitDecision(response.updatedInput) ??
|
|
2061
|
+
(response.behavior === "allow"
|
|
2062
|
+
? "accept"
|
|
2063
|
+
: response.interrupt
|
|
2064
|
+
? "cancel"
|
|
2065
|
+
: "decline");
|
|
1931
2066
|
pending.resolve({ decision });
|
|
1932
2067
|
return;
|
|
1933
2068
|
}
|
|
2069
|
+
if (pending.kind === "permissions") {
|
|
2070
|
+
pending.resolve(buildCodexPermissionsResponse(response, pending.permissions));
|
|
2071
|
+
return;
|
|
2072
|
+
}
|
|
2073
|
+
if (pending.kind === "elicitation") {
|
|
2074
|
+
pending.resolve(buildCodexElicitationResponse(response));
|
|
2075
|
+
return;
|
|
2076
|
+
}
|
|
1934
2077
|
// tool/requestUserInput
|
|
1935
2078
|
const answers = {};
|
|
1936
2079
|
const questions = pending.questions ?? [];
|
|
@@ -2091,7 +2234,8 @@ class CodexAppServerAgentSession {
|
|
|
2091
2234
|
innerConfig.mcp_servers = mcpServers;
|
|
2092
2235
|
}
|
|
2093
2236
|
if (this.config.extra?.codex) {
|
|
2094
|
-
|
|
2237
|
+
const { planModeEnabled: _planModeEnabled, ...codexExtra } = this.config.extra.codex;
|
|
2238
|
+
Object.assign(innerConfig, codexExtra);
|
|
2095
2239
|
}
|
|
2096
2240
|
return Object.keys(innerConfig).length > 0 ? innerConfig : null;
|
|
2097
2241
|
}
|
|
@@ -2480,7 +2624,7 @@ class CodexAppServerAgentSession {
|
|
|
2480
2624
|
payload,
|
|
2481
2625
|
}, "Codex edit tool call is missing diff/content fields");
|
|
2482
2626
|
}
|
|
2483
|
-
handleCommandApprovalRequest(params, rawRequestId) {
|
|
2627
|
+
handleCommandApprovalRequest(requestMethod, params, rawRequestId) {
|
|
2484
2628
|
const parsed = params;
|
|
2485
2629
|
const commandPreview = mapCodexExecNotificationToToolCall({
|
|
2486
2630
|
callId: parsed.itemId,
|
|
@@ -2488,8 +2632,12 @@ class CodexAppServerAgentSession {
|
|
|
2488
2632
|
cwd: parsed.cwd ?? this.config.cwd ?? null,
|
|
2489
2633
|
running: true,
|
|
2490
2634
|
});
|
|
2491
|
-
const requestId = toPendingPermissionId(rawRequestId ?? parsed.itemId);
|
|
2492
|
-
const title = parsed.command
|
|
2635
|
+
const requestId = toPendingPermissionId(rawRequestId ?? parsed.approvalId ?? parsed.itemId);
|
|
2636
|
+
const title = parsed.command
|
|
2637
|
+
? `Run command: ${parsed.command}`
|
|
2638
|
+
: parsed.networkApprovalContext
|
|
2639
|
+
? "Allow network access"
|
|
2640
|
+
: "Run command";
|
|
2493
2641
|
const request = {
|
|
2494
2642
|
id: requestId,
|
|
2495
2643
|
provider: CODEX_PROVIDER,
|
|
@@ -2510,9 +2658,18 @@ class CodexAppServerAgentSession {
|
|
|
2510
2658
|
output: null,
|
|
2511
2659
|
},
|
|
2512
2660
|
metadata: {
|
|
2661
|
+
requestMethod,
|
|
2513
2662
|
itemId: parsed.itemId,
|
|
2663
|
+
approvalId: parsed.approvalId ?? null,
|
|
2514
2664
|
threadId: parsed.threadId,
|
|
2515
2665
|
turnId: parsed.turnId,
|
|
2666
|
+
commandActions: parsed.commandActions ?? null,
|
|
2667
|
+
availableDecisions: parsed.availableDecisions ?? null,
|
|
2668
|
+
additionalPermissions: parsed.additionalPermissions ?? null,
|
|
2669
|
+
proposedExecpolicyAmendment: parsed.proposedExecpolicyAmendment ?? null,
|
|
2670
|
+
proposedNetworkPolicyAmendments: parsed.proposedNetworkPolicyAmendments ?? null,
|
|
2671
|
+
networkApprovalContext: parsed.networkApprovalContext ?? null,
|
|
2672
|
+
skillMetadata: parsed.skillMetadata ?? null,
|
|
2516
2673
|
},
|
|
2517
2674
|
};
|
|
2518
2675
|
this.pendingPermissions.set(requestId, request);
|
|
@@ -2521,7 +2678,7 @@ class CodexAppServerAgentSession {
|
|
|
2521
2678
|
this.pendingPermissionHandlers.set(requestId, { resolve, kind: "command" });
|
|
2522
2679
|
});
|
|
2523
2680
|
}
|
|
2524
|
-
handleFileChangeApprovalRequest(params, rawRequestId) {
|
|
2681
|
+
handleFileChangeApprovalRequest(requestMethod, params, rawRequestId) {
|
|
2525
2682
|
const parsed = params;
|
|
2526
2683
|
const requestId = toPendingPermissionId(rawRequestId ?? parsed.itemId);
|
|
2527
2684
|
const request = {
|
|
@@ -2535,13 +2692,16 @@ class CodexAppServerAgentSession {
|
|
|
2535
2692
|
type: "unknown",
|
|
2536
2693
|
input: {
|
|
2537
2694
|
reason: parsed.reason ?? null,
|
|
2695
|
+
grantRoot: parsed.grantRoot ?? null,
|
|
2538
2696
|
},
|
|
2539
2697
|
output: null,
|
|
2540
2698
|
},
|
|
2541
2699
|
metadata: {
|
|
2700
|
+
requestMethod,
|
|
2542
2701
|
itemId: parsed.itemId,
|
|
2543
2702
|
threadId: parsed.threadId,
|
|
2544
2703
|
turnId: parsed.turnId,
|
|
2704
|
+
grantRoot: parsed.grantRoot ?? null,
|
|
2545
2705
|
},
|
|
2546
2706
|
};
|
|
2547
2707
|
this.pendingPermissions.set(requestId, request);
|
|
@@ -2550,9 +2710,10 @@ class CodexAppServerAgentSession {
|
|
|
2550
2710
|
this.pendingPermissionHandlers.set(requestId, { resolve, kind: "file" });
|
|
2551
2711
|
});
|
|
2552
2712
|
}
|
|
2553
|
-
handleToolApprovalRequest(params, rawRequestId) {
|
|
2713
|
+
handleToolApprovalRequest(requestMethod, params, rawRequestId) {
|
|
2554
2714
|
const parsed = params;
|
|
2555
2715
|
const requestId = toPendingPermissionId(rawRequestId ?? parsed.itemId);
|
|
2716
|
+
const questions = normalizeCodexQuestionDescriptors(parsed.questions);
|
|
2556
2717
|
const request = {
|
|
2557
2718
|
id: requestId,
|
|
2558
2719
|
provider: CODEX_PROVIDER,
|
|
@@ -2561,20 +2722,21 @@ class CodexAppServerAgentSession {
|
|
|
2561
2722
|
title: "Answer question",
|
|
2562
2723
|
description: undefined,
|
|
2563
2724
|
input: {
|
|
2564
|
-
questions
|
|
2725
|
+
questions,
|
|
2565
2726
|
},
|
|
2566
2727
|
detail: {
|
|
2567
2728
|
type: "unknown",
|
|
2568
2729
|
input: {
|
|
2569
|
-
questions
|
|
2730
|
+
questions,
|
|
2570
2731
|
},
|
|
2571
2732
|
output: null,
|
|
2572
2733
|
},
|
|
2573
2734
|
metadata: {
|
|
2735
|
+
requestMethod,
|
|
2574
2736
|
itemId: parsed.itemId,
|
|
2575
2737
|
threadId: parsed.threadId,
|
|
2576
2738
|
turnId: parsed.turnId,
|
|
2577
|
-
questions
|
|
2739
|
+
questions,
|
|
2578
2740
|
},
|
|
2579
2741
|
};
|
|
2580
2742
|
this.pendingPermissions.set(requestId, request);
|
|
@@ -2583,7 +2745,105 @@ class CodexAppServerAgentSession {
|
|
|
2583
2745
|
this.pendingPermissionHandlers.set(requestId, {
|
|
2584
2746
|
resolve,
|
|
2585
2747
|
kind: "question",
|
|
2586
|
-
questions
|
|
2748
|
+
questions,
|
|
2749
|
+
});
|
|
2750
|
+
});
|
|
2751
|
+
}
|
|
2752
|
+
handlePermissionsApprovalRequest(requestMethod, params, rawRequestId) {
|
|
2753
|
+
const parsed = params;
|
|
2754
|
+
const requestId = toPendingPermissionId(rawRequestId ?? parsed.itemId);
|
|
2755
|
+
const request = {
|
|
2756
|
+
id: requestId,
|
|
2757
|
+
provider: CODEX_PROVIDER,
|
|
2758
|
+
name: "CodexPermissionProfile",
|
|
2759
|
+
kind: "tool",
|
|
2760
|
+
title: "Grant additional permissions",
|
|
2761
|
+
description: parsed.reason ?? undefined,
|
|
2762
|
+
input: {
|
|
2763
|
+
permissions: parsed.permissions ?? null,
|
|
2764
|
+
},
|
|
2765
|
+
detail: {
|
|
2766
|
+
type: "unknown",
|
|
2767
|
+
input: {
|
|
2768
|
+
reason: parsed.reason ?? null,
|
|
2769
|
+
permissions: parsed.permissions ?? null,
|
|
2770
|
+
},
|
|
2771
|
+
output: null,
|
|
2772
|
+
},
|
|
2773
|
+
metadata: {
|
|
2774
|
+
requestMethod,
|
|
2775
|
+
itemId: parsed.itemId,
|
|
2776
|
+
threadId: parsed.threadId,
|
|
2777
|
+
turnId: parsed.turnId,
|
|
2778
|
+
permissions: parsed.permissions ?? null,
|
|
2779
|
+
},
|
|
2780
|
+
};
|
|
2781
|
+
this.pendingPermissions.set(requestId, request);
|
|
2782
|
+
this.emitEvent({ type: "permission_requested", provider: CODEX_PROVIDER, request });
|
|
2783
|
+
return new Promise((resolve) => {
|
|
2784
|
+
this.pendingPermissionHandlers.set(requestId, {
|
|
2785
|
+
resolve,
|
|
2786
|
+
kind: "permissions",
|
|
2787
|
+
permissions: parsed.permissions ?? null,
|
|
2788
|
+
});
|
|
2789
|
+
});
|
|
2790
|
+
}
|
|
2791
|
+
handleMcpElicitationRequest(requestMethod, params, rawRequestId) {
|
|
2792
|
+
const parsed = params;
|
|
2793
|
+
const baseRequestId = rawRequestId ??
|
|
2794
|
+
parsed.elicitationId ??
|
|
2795
|
+
`${parsed.threadId}:${parsed.turnId ?? "none"}:${parsed.serverName ?? "mcp"}`;
|
|
2796
|
+
const requestId = toPendingPermissionId(baseRequestId);
|
|
2797
|
+
const title = parsed.mode === "url"
|
|
2798
|
+
? "Open MCP authorization link"
|
|
2799
|
+
: parsed.serverName
|
|
2800
|
+
? `Respond to ${parsed.serverName}`
|
|
2801
|
+
: "Respond to MCP server";
|
|
2802
|
+
const request = {
|
|
2803
|
+
id: requestId,
|
|
2804
|
+
provider: CODEX_PROVIDER,
|
|
2805
|
+
name: "CodexMcpElicitation",
|
|
2806
|
+
kind: "other",
|
|
2807
|
+
title,
|
|
2808
|
+
description: parsed.message ?? undefined,
|
|
2809
|
+
input: {
|
|
2810
|
+
mode: parsed.mode ?? null,
|
|
2811
|
+
requestedSchema: parsed.requestedSchema ?? null,
|
|
2812
|
+
url: parsed.url ?? null,
|
|
2813
|
+
},
|
|
2814
|
+
detail: {
|
|
2815
|
+
type: "unknown",
|
|
2816
|
+
input: {
|
|
2817
|
+
requestMethod,
|
|
2818
|
+
serverName: parsed.serverName ?? null,
|
|
2819
|
+
mode: parsed.mode ?? null,
|
|
2820
|
+
message: parsed.message ?? null,
|
|
2821
|
+
requestedSchema: parsed.requestedSchema ?? null,
|
|
2822
|
+
url: parsed.url ?? null,
|
|
2823
|
+
elicitationId: parsed.elicitationId ?? null,
|
|
2824
|
+
_meta: parsed._meta ?? null,
|
|
2825
|
+
},
|
|
2826
|
+
output: null,
|
|
2827
|
+
},
|
|
2828
|
+
metadata: {
|
|
2829
|
+
requestMethod,
|
|
2830
|
+
threadId: parsed.threadId,
|
|
2831
|
+
turnId: parsed.turnId ?? null,
|
|
2832
|
+
serverName: parsed.serverName ?? null,
|
|
2833
|
+
mode: parsed.mode ?? null,
|
|
2834
|
+
message: parsed.message ?? null,
|
|
2835
|
+
requestedSchema: parsed.requestedSchema ?? null,
|
|
2836
|
+
url: parsed.url ?? null,
|
|
2837
|
+
elicitationId: parsed.elicitationId ?? null,
|
|
2838
|
+
_meta: parsed._meta ?? null,
|
|
2839
|
+
},
|
|
2840
|
+
};
|
|
2841
|
+
this.pendingPermissions.set(requestId, request);
|
|
2842
|
+
this.emitEvent({ type: "permission_requested", provider: CODEX_PROVIDER, request });
|
|
2843
|
+
return new Promise((resolve) => {
|
|
2844
|
+
this.pendingPermissionHandlers.set(requestId, {
|
|
2845
|
+
resolve,
|
|
2846
|
+
kind: "elicitation",
|
|
2587
2847
|
});
|
|
2588
2848
|
});
|
|
2589
2849
|
}
|
|
@@ -2763,7 +3023,7 @@ export class CodexAppServerAgentClient {
|
|
|
2763
3023
|
}
|
|
2764
3024
|
}
|
|
2765
3025
|
async isAvailable() {
|
|
2766
|
-
return isProviderCommandAvailable(this.runtimeSettings?.command, resolveCodexBinary);
|
|
3026
|
+
return isProviderCommandAvailable(this.runtimeSettings?.command, resolveCodexBinary, applyProviderEnv(process.env, this.runtimeSettings));
|
|
2767
3027
|
}
|
|
2768
3028
|
}
|
|
2769
3029
|
//# sourceMappingURL=codex-app-server-agent.js.map
|