@agentconnect.md/codex-acp 2.6.0-agentconnect.4 → 2.6.0-agentconnect.5
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/index.js +23 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -41951,7 +41951,7 @@ var package_default = {
|
|
|
41951
41951
|
publishConfig: {
|
|
41952
41952
|
access: "public"
|
|
41953
41953
|
},
|
|
41954
|
-
version: "2.6.0-agentconnect.
|
|
41954
|
+
version: "2.6.0-agentconnect.5",
|
|
41955
41955
|
description: "",
|
|
41956
41956
|
main: "dist/index.js",
|
|
41957
41957
|
bin: {
|
|
@@ -42576,6 +42576,17 @@ var permissionProfileConfigSchema = external_exports.object({
|
|
|
42576
42576
|
"agent-full-access": external_exports.string().min(1)
|
|
42577
42577
|
})
|
|
42578
42578
|
});
|
|
42579
|
+
function sessionPermissionProfiles(meta3, launcher) {
|
|
42580
|
+
const raw = external_exports.object({ codex: external_exports.object({ permissionProfiles: external_exports.unknown().optional() }).optional() }).passthrough().safeParse(meta3 ?? {});
|
|
42581
|
+
const profiles = raw.success ? raw.data.codex?.permissionProfiles : void 0;
|
|
42582
|
+
if (profiles == null) return void 0;
|
|
42583
|
+
const parsed = external_exports.record(external_exports.string(), external_exports.record(external_exports.string(), external_exports.json())).safeParse(profiles);
|
|
42584
|
+
const allowed = new Set(Object.values(launcher?.modeProfiles ?? {}));
|
|
42585
|
+
if (!parsed.success || Object.keys(parsed.data).some((id) => !allowed.has(id))) {
|
|
42586
|
+
throw RequestError.invalidParams(void 0, "Session permission profiles must name launcher-owned profiles");
|
|
42587
|
+
}
|
|
42588
|
+
return parsed.data;
|
|
42589
|
+
}
|
|
42579
42590
|
function readPermissionProfileConfig(env = process.env) {
|
|
42580
42591
|
const raw = env[PERMISSION_PROFILE_CONFIG_ENV];
|
|
42581
42592
|
if (!raw) return void 0;
|
|
@@ -43069,7 +43080,7 @@ var CodexAcpClient = class _CodexAcpClient {
|
|
|
43069
43080
|
const additionalDirectories = readAdditionalDirectories(request.cwd, request.additionalDirectories, request._meta);
|
|
43070
43081
|
const initialAgentMode = AgentMode.getInitialAgentMode();
|
|
43071
43082
|
await this.refreshSkills(request.cwd, additionalDirectories);
|
|
43072
|
-
const sessionConfig = await this.createSessionConfig(request.cwd, additionalDirectories, request.mcpServers ?? []);
|
|
43083
|
+
const sessionConfig = await this.createSessionConfig(request.cwd, additionalDirectories, request.mcpServers ?? [], request._meta);
|
|
43073
43084
|
const { config: config2, skippedMcpServers, defaultPermissionProfileId, ...permissionProfileMetadata } = sessionConfig;
|
|
43074
43085
|
await this.restrictResumedMcpServers(request.sessionId, sessionConfig);
|
|
43075
43086
|
const response = await this.resumeThreadWithInstructions({
|
|
@@ -43109,7 +43120,7 @@ var CodexAcpClient = class _CodexAcpClient {
|
|
|
43109
43120
|
return await forkSession(request, additionalDirectories, {
|
|
43110
43121
|
codexClient: this.codexClient,
|
|
43111
43122
|
refreshSkills: (cwd, directories) => this.refreshSkills(cwd, directories),
|
|
43112
|
-
createSessionConfig: (cwd, directories, mcpServers) => this.createSessionConfig(cwd, directories, mcpServers),
|
|
43123
|
+
createSessionConfig: (cwd, directories, mcpServers) => this.createSessionConfig(cwd, directories, mcpServers, request._meta),
|
|
43113
43124
|
getResumeModelProvider: () => this.getResumeModelProvider(),
|
|
43114
43125
|
fetchAvailableModels: () => this.fetchAvailableModels(),
|
|
43115
43126
|
createCurrentModelId: (models, model, reasoningEffort) => this.createModelId(models, model, reasoningEffort).toString(),
|
|
@@ -43123,7 +43134,7 @@ var CodexAcpClient = class _CodexAcpClient {
|
|
|
43123
43134
|
const additionalDirectories = readAdditionalDirectories(request.cwd, request.additionalDirectories, request._meta);
|
|
43124
43135
|
const initialAgentMode = AgentMode.getInitialAgentMode();
|
|
43125
43136
|
await this.refreshSkills(request.cwd, additionalDirectories);
|
|
43126
|
-
const sessionConfig = await this.createSessionConfig(request.cwd, additionalDirectories, request.mcpServers ?? []);
|
|
43137
|
+
const sessionConfig = await this.createSessionConfig(request.cwd, additionalDirectories, request.mcpServers ?? [], request._meta);
|
|
43127
43138
|
const { config: config2, skippedMcpServers, defaultPermissionProfileId, ...permissionProfileMetadata } = sessionConfig;
|
|
43128
43139
|
await this.restrictResumedMcpServers(request.sessionId, sessionConfig);
|
|
43129
43140
|
const response = await this.resumeThreadWithInstructions({
|
|
@@ -43227,7 +43238,7 @@ var CodexAcpClient = class _CodexAcpClient {
|
|
|
43227
43238
|
const developerInstructions = instructions?.developerInstructions;
|
|
43228
43239
|
const initialAgentMode = AgentMode.getInitialAgentMode();
|
|
43229
43240
|
await this.refreshSkills(request.cwd, additionalDirectories);
|
|
43230
|
-
const sessionConfig = await this.createSessionConfig(request.cwd, additionalDirectories, request.mcpServers ?? []);
|
|
43241
|
+
const sessionConfig = await this.createSessionConfig(request.cwd, additionalDirectories, request.mcpServers ?? [], request._meta);
|
|
43231
43242
|
const { config: config2, skippedMcpServers, defaultPermissionProfileId: _defaultPermissionProfileId, ...permissionProfileMetadata } = sessionConfig;
|
|
43232
43243
|
const response = await this.codexClient.threadStart({
|
|
43233
43244
|
config: config2,
|
|
@@ -43370,6 +43381,9 @@ var CodexAcpClient = class _CodexAcpClient {
|
|
|
43370
43381
|
isProtectedFullAccess(agentMode) {
|
|
43371
43382
|
return this.permissionProfileConfig !== void 0 && agentMode.kind === "full_access";
|
|
43372
43383
|
}
|
|
43384
|
+
supportsSessionPermissionProfiles() {
|
|
43385
|
+
return this.permissionProfileConfig !== void 0;
|
|
43386
|
+
}
|
|
43373
43387
|
approvalPolicyForMode(agentMode) {
|
|
43374
43388
|
if (!this.isProtectedFullAccess(agentMode)) return agentMode.approvalPolicy;
|
|
43375
43389
|
return { granular: { sandbox_approval: false, rules: false, skill_approval: false, request_permissions: false, mcp_elicitations: false } };
|
|
@@ -43450,7 +43464,7 @@ var CodexAcpClient = class _CodexAcpClient {
|
|
|
43450
43464
|
getMcpServerStartupVersion() {
|
|
43451
43465
|
return this.codexClient.mcpStartup.version();
|
|
43452
43466
|
}
|
|
43453
|
-
async createSessionConfig(projectPath, additionalDirectories, mcpServers) {
|
|
43467
|
+
async createSessionConfig(projectPath, additionalDirectories, mcpServers, meta3) {
|
|
43454
43468
|
const sessionRoots2 = [projectPath, ...additionalDirectories];
|
|
43455
43469
|
const activeProvider = this.gatewayConfig ? {
|
|
43456
43470
|
apiType: gatewayApiTypeFromConfig(this.gatewayConfig),
|
|
@@ -43463,8 +43477,10 @@ var CodexAcpClient = class _CodexAcpClient {
|
|
|
43463
43477
|
apiType: activeProvider.apiType,
|
|
43464
43478
|
baseUrl: activeProvider.baseUrl
|
|
43465
43479
|
});
|
|
43480
|
+
const permissionProfilesOverride = sessionPermissionProfiles(meta3, this.permissionProfileConfig);
|
|
43466
43481
|
const mergedConfig = {
|
|
43467
43482
|
...disableUnsupportedSkills(forceGitRootTurnDiffPaths(mergeGatewayConfig(this.config, this.gatewayConfig))),
|
|
43483
|
+
...permissionProfilesOverride ? { permissions: permissionProfilesOverride } : {},
|
|
43468
43484
|
projects: Object.fromEntries(sessionRoots2.map((root) => [root, {
|
|
43469
43485
|
trust_level: "trusted"
|
|
43470
43486
|
}]))
|
|
@@ -51257,6 +51273,7 @@ var CodexAcpServer = class {
|
|
|
51257
51273
|
...this.sessionIndex.agentCapabilities()
|
|
51258
51274
|
];
|
|
51259
51275
|
return {
|
|
51276
|
+
...this.codexAcpClient.supportsSessionPermissionProfiles() ? { codex: { sessionPermissionProfiles: true } } : {},
|
|
51260
51277
|
steering: {
|
|
51261
51278
|
supported: true
|
|
51262
51279
|
},
|