orkestrator 2.32.0-beta → 2.33.0-beta
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/client.js +1 -1
- package/dist/main.js +121341 -119611
- package/package.json +3 -3
- package/resources/claude-bridge/dist/index.js +1154 -806
- package/resources/codex-bridge/dist/index.js +189 -24
|
@@ -331,7 +331,7 @@ function createBridgeDiagnostics(bridge, state, metrics) {
|
|
|
331
331
|
import { execFile as execFileCallback2 } from "node:child_process";
|
|
332
332
|
import { randomBytes, timingSafeEqual } from "node:crypto";
|
|
333
333
|
import { appendFile as appendFile5, mkdir as mkdir8, readFile as readFile7, writeFile as writeFile6 } from "node:fs/promises";
|
|
334
|
-
import { join as
|
|
334
|
+
import { join as join18 } from "node:path";
|
|
335
335
|
import { promisify as promisify2 } from "node:util";
|
|
336
336
|
|
|
337
337
|
// ../../node_modules/.bun/@hono+node-server@2.1.5+c539cad7f494f5c9/node_modules/@hono/node-server/dist/constants-BLSFu_RU.mjs
|
|
@@ -8861,6 +8861,58 @@ function toBridgeModel(model) {
|
|
|
8861
8861
|
defaultReasoningEffort: fallbackReasoningId(model.supportedReasoningEfforts.map((entry) => entry.effort), model.defaultReasoningEffort) ?? model.defaultReasoningEffort
|
|
8862
8862
|
};
|
|
8863
8863
|
}
|
|
8864
|
+
// ../protocol/src/human-prompts.ts
|
|
8865
|
+
var HUMAN_PROMPT_SCAN_BYTES = 16 * 1024;
|
|
8866
|
+
function humanPromptObservation(messages, tasks) {
|
|
8867
|
+
const object = (value) => !!value && typeof value === "object" && !Array.isArray(value);
|
|
8868
|
+
const parts = [];
|
|
8869
|
+
let remaining = 64 * 1024;
|
|
8870
|
+
let visited = 0;
|
|
8871
|
+
const walk = (value, depth = 0) => {
|
|
8872
|
+
if (!Array.isArray(value) || depth > 8)
|
|
8873
|
+
return;
|
|
8874
|
+
for (const part of value) {
|
|
8875
|
+
if (++visited > 2048 || remaining <= 0 || parts.length >= 32)
|
|
8876
|
+
return;
|
|
8877
|
+
if (!object(part))
|
|
8878
|
+
continue;
|
|
8879
|
+
if (typeof part.toolOutput === "string" && (part.toolState === "pending" || part.toolOutput.includes("Output is being written to:"))) {
|
|
8880
|
+
const output = part.toolOutput.slice(-Math.min(HUMAN_PROMPT_SCAN_BYTES, remaining));
|
|
8881
|
+
remaining -= output.length;
|
|
8882
|
+
const args = object(part.toolArgs) ? part.toolArgs : {};
|
|
8883
|
+
const command = args.command ?? args.cmd;
|
|
8884
|
+
parts.push({
|
|
8885
|
+
toolUseId: String(part.toolUseId ?? part.id ?? "").slice(0, 200),
|
|
8886
|
+
toolName: String(part.toolName ?? "").slice(0, 100),
|
|
8887
|
+
toolState: part.toolState,
|
|
8888
|
+
toolOutput: output,
|
|
8889
|
+
...typeof command === "string" ? { toolArgs: { command: command.slice(0, 500) } } : {}
|
|
8890
|
+
});
|
|
8891
|
+
}
|
|
8892
|
+
walk(part.parts, depth + 1);
|
|
8893
|
+
walk(part.childTools, depth + 1);
|
|
8894
|
+
if (object(part.task))
|
|
8895
|
+
walk([part.task], depth + 1);
|
|
8896
|
+
}
|
|
8897
|
+
};
|
|
8898
|
+
if (Array.isArray(messages)) {
|
|
8899
|
+
for (let i = messages.length - 1;i >= Math.max(0, messages.length - 64); i--) {
|
|
8900
|
+
const message = messages[i];
|
|
8901
|
+
if (object(message))
|
|
8902
|
+
walk(message.parts);
|
|
8903
|
+
}
|
|
8904
|
+
}
|
|
8905
|
+
const taskList = Array.isArray(tasks) ? tasks : object(tasks) ? Object.values(tasks) : [];
|
|
8906
|
+
const backgroundTasks = taskList.filter(object).filter((task) => task.status === "running" || task.status === "pending").slice(-64).map((task) => ({
|
|
8907
|
+
id: String(task.id ?? "").slice(0, 200),
|
|
8908
|
+
status: task.status,
|
|
8909
|
+
kind: task.kind,
|
|
8910
|
+
...typeof task.outputFile === "string" ? { outputFile: task.outputFile.slice(0, 2048) } : {},
|
|
8911
|
+
...typeof task.toolUseId === "string" ? { toolUseId: task.toolUseId.slice(0, 200) } : {}
|
|
8912
|
+
}));
|
|
8913
|
+
return { messages: [{ parts }], backgroundTasks };
|
|
8914
|
+
}
|
|
8915
|
+
|
|
8864
8916
|
// ../../bridges/codex-bridge/src/codex-collaboration.ts
|
|
8865
8917
|
var CODEX_TIMELINE_ITEM_PREFIX = "item:";
|
|
8866
8918
|
var CODEX_TIMELINE_SUBAGENT_PREFIX = "subagent:";
|
|
@@ -12500,6 +12552,7 @@ function codeModeMcpCallPart(call, toolUseId) {
|
|
|
12500
12552
|
}
|
|
12501
12553
|
|
|
12502
12554
|
// ../protocol/src/coordinator.ts
|
|
12555
|
+
var COORDINATOR_CODEX_USER_SKILLS_DIR_ENV = "ORKESTRATOR_COORDINATOR_CODEX_USER_SKILLS_DIR";
|
|
12503
12556
|
var COORDINATOR_CONTROL_TOOL_NAMES = Object.freeze([
|
|
12504
12557
|
"ack_message",
|
|
12505
12558
|
"add_ticket_comment",
|
|
@@ -14372,7 +14425,7 @@ var ORKESTRATOR_ARTIFACT_MCP_PATH = "/artifact-mcp";
|
|
|
14372
14425
|
// ../../bridges/codex-bridge/src/engine/app-server-engine.ts
|
|
14373
14426
|
import { open as open6 } from "node:fs/promises";
|
|
14374
14427
|
import { createHash as createHash9 } from "node:crypto";
|
|
14375
|
-
import { isAbsolute as isAbsolute8, join as
|
|
14428
|
+
import { isAbsolute as isAbsolute8, join as join16 } from "node:path";
|
|
14376
14429
|
|
|
14377
14430
|
// ../../bridges/codex-bridge/src/app-server/process-supervisor.ts
|
|
14378
14431
|
import { execFile as execFile3, spawn as spawn3 } from "node:child_process";
|
|
@@ -18425,8 +18478,9 @@ function coordinatorCapabilityPolicy(mode) {
|
|
|
18425
18478
|
}
|
|
18426
18479
|
|
|
18427
18480
|
// ../../bridges/codex-bridge/src/codex-config.ts
|
|
18428
|
-
import { realpathSync } from "node:fs";
|
|
18429
|
-
import {
|
|
18481
|
+
import { existsSync as existsSync3, readdirSync as readdirSync3, realpathSync, statSync as statSync2 } from "node:fs";
|
|
18482
|
+
import { homedir as homedir2 } from "node:os";
|
|
18483
|
+
import { isAbsolute as isAbsolute7, join as join15, relative as relative2, sep } from "node:path";
|
|
18430
18484
|
var CODEX_MAX_CONCURRENT_THREADS_ENV = "CODEX_MAX_CONCURRENT_THREADS_PER_SESSION";
|
|
18431
18485
|
var DEFAULT_CODEX_MAX_CONCURRENT_THREADS = 5;
|
|
18432
18486
|
var ORKESTRATOR_AGENT_MCP_URL_ENV = "ORKESTRATOR_AGENT_MCP_URL";
|
|
@@ -18461,6 +18515,76 @@ function codexRequestUserInputConfig(policy) {
|
|
|
18461
18515
|
return {};
|
|
18462
18516
|
return { "features.default_mode_request_user_input": true };
|
|
18463
18517
|
}
|
|
18518
|
+
function codexLoadsProjectSkills(policy, env = process.env) {
|
|
18519
|
+
if (policy?.projectResources !== false)
|
|
18520
|
+
return true;
|
|
18521
|
+
return policy.id === "coordinator-read-only" && isCoordinatorReadOnlyEnvironment(env);
|
|
18522
|
+
}
|
|
18523
|
+
function codexCoordinatorSkillExtraRoots(env = process.env, cwd = env.CWD?.trim()) {
|
|
18524
|
+
if (!isCoordinatorReadOnlyEnvironment(env))
|
|
18525
|
+
return [];
|
|
18526
|
+
const userDir = env[COORDINATOR_CODEX_USER_SKILLS_DIR_ENV]?.trim();
|
|
18527
|
+
return [
|
|
18528
|
+
...userDir && isAbsolute7(userDir) ? [userDir] : [],
|
|
18529
|
+
...cwd && isAbsolute7(cwd) ? [join15(cwd, ".claude", "skills")] : []
|
|
18530
|
+
].filter((dir) => existsSync3(dir));
|
|
18531
|
+
}
|
|
18532
|
+
var MAX_SKILL_READ_GRANTS = 256;
|
|
18533
|
+
function isWithin(parent, child) {
|
|
18534
|
+
const path = relative2(parent, child);
|
|
18535
|
+
return path === "" || !path.startsWith(`..${sep}`) && path !== ".." && !isAbsolute7(path);
|
|
18536
|
+
}
|
|
18537
|
+
function codexCoordinatorSkillReadRoots(env = process.env, home = env.HOME?.trim() || homedir2()) {
|
|
18538
|
+
const userDir = env[COORDINATOR_CODEX_USER_SKILLS_DIR_ENV]?.trim();
|
|
18539
|
+
const roots = [
|
|
18540
|
+
...userDir && isAbsolute7(userDir) ? [userDir] : [],
|
|
18541
|
+
join15(home, ".agents", "skills")
|
|
18542
|
+
];
|
|
18543
|
+
const homeReal = (() => {
|
|
18544
|
+
try {
|
|
18545
|
+
return realpathSync(home);
|
|
18546
|
+
} catch {
|
|
18547
|
+
return home;
|
|
18548
|
+
}
|
|
18549
|
+
})();
|
|
18550
|
+
const grants = new Set;
|
|
18551
|
+
const grantable = (path) => path !== sep && !isWithin(path, homeReal) && !isWithin(path, home);
|
|
18552
|
+
for (const root of roots) {
|
|
18553
|
+
let real;
|
|
18554
|
+
try {
|
|
18555
|
+
real = realpathSync(root);
|
|
18556
|
+
if (!statSync2(real).isDirectory())
|
|
18557
|
+
continue;
|
|
18558
|
+
} catch {
|
|
18559
|
+
continue;
|
|
18560
|
+
}
|
|
18561
|
+
if (!grantable(real))
|
|
18562
|
+
continue;
|
|
18563
|
+
grants.add(real);
|
|
18564
|
+
let entries;
|
|
18565
|
+
try {
|
|
18566
|
+
entries = readdirSync3(real).filter((name) => !name.startsWith("."));
|
|
18567
|
+
} catch {
|
|
18568
|
+
continue;
|
|
18569
|
+
}
|
|
18570
|
+
for (const entry of entries) {
|
|
18571
|
+
if (grants.size >= MAX_SKILL_READ_GRANTS)
|
|
18572
|
+
break;
|
|
18573
|
+
let target;
|
|
18574
|
+
try {
|
|
18575
|
+
target = realpathSync(join15(real, entry));
|
|
18576
|
+
if (!statSync2(target).isDirectory() || !existsSync3(join15(target, "SKILL.md")))
|
|
18577
|
+
continue;
|
|
18578
|
+
} catch {
|
|
18579
|
+
continue;
|
|
18580
|
+
}
|
|
18581
|
+
if (isWithin(real, target) || !grantable(target))
|
|
18582
|
+
continue;
|
|
18583
|
+
grants.add(target);
|
|
18584
|
+
}
|
|
18585
|
+
}
|
|
18586
|
+
return [...grants].slice(0, MAX_SKILL_READ_GRANTS);
|
|
18587
|
+
}
|
|
18464
18588
|
var MAX_CODEX_DISABLED_SKILLS = 1024;
|
|
18465
18589
|
var KEPT_SKILL_SCOPES = new Set(["user", "system", "admin"]);
|
|
18466
18590
|
function codexProjectSkillsConfig(listed) {
|
|
@@ -18563,7 +18687,7 @@ function codexAppServerConfigOverrides(env = process.env) {
|
|
|
18563
18687
|
throw new Error("Coordinator Codex permission profile configuration is invalid");
|
|
18564
18688
|
}
|
|
18565
18689
|
overrides.default_permissions = JSON.stringify(permissionProfile);
|
|
18566
|
-
overrides[`permissions.${permissionProfile}.filesystem`] = `{ ":root" = "deny", ":minimal" = "read", ":tmpdir" = "deny", ` + `":slash_tmp" = "deny", ${JSON.stringify(readableRuntimeRoot)} = "read", ` + (attachmentRoot && isAbsolute7(attachmentRoot) ? `${JSON.stringify(attachmentRoot)} = "read", ` : "") + `":workspace_roots" = { "." = "read" } }`;
|
|
18690
|
+
overrides[`permissions.${permissionProfile}.filesystem`] = `{ ":root" = "deny", ":minimal" = "read", ":tmpdir" = "deny", ` + `":slash_tmp" = "deny", ${JSON.stringify(readableRuntimeRoot)} = "read", ` + (attachmentRoot && isAbsolute7(attachmentRoot) ? `${JSON.stringify(attachmentRoot)} = "read", ` : "") + codexCoordinatorSkillReadRoots(env).map((root) => `${JSON.stringify(root)} = "read", `).join("") + `":workspace_roots" = { "." = "read" } }`;
|
|
18567
18691
|
overrides[`permissions.${permissionProfile}.network.enabled`] = "false";
|
|
18568
18692
|
overrides.web_search = JSON.stringify(codexNetworkDeniedSearchMode(codexCoordinatorPolicy(env)));
|
|
18569
18693
|
overrides["features.standalone_web_search"] = "false";
|
|
@@ -18588,6 +18712,7 @@ function codexAppServerConfigOverrides(env = process.env) {
|
|
|
18588
18712
|
"plugins",
|
|
18589
18713
|
"remote_plugin",
|
|
18590
18714
|
"skill_mcp_dependency_install",
|
|
18715
|
+
"skill_env_var_dependency_prompt",
|
|
18591
18716
|
"tool_call_mcp_elicitation",
|
|
18592
18717
|
"tool_suggest",
|
|
18593
18718
|
"workspace_dependencies"
|
|
@@ -19149,7 +19274,7 @@ function signedOutAccountRead(error) {
|
|
|
19149
19274
|
}
|
|
19150
19275
|
async function readStoredLoginFingerprint(codexHome) {
|
|
19151
19276
|
try {
|
|
19152
|
-
const file = await open6(
|
|
19277
|
+
const file = await open6(join16(codexHome, "auth.json"), "r");
|
|
19153
19278
|
let raw;
|
|
19154
19279
|
try {
|
|
19155
19280
|
const bytes = Buffer.alloc(65537);
|
|
@@ -19229,6 +19354,7 @@ class AppServerEngine {
|
|
|
19229
19354
|
accountProofInvalidatedSequence = 0;
|
|
19230
19355
|
accountProofTurns = new Map;
|
|
19231
19356
|
hostedNetworkLockVerifiedGeneration = null;
|
|
19357
|
+
skillExtraRootsGeneration = null;
|
|
19232
19358
|
toolHistoryLockVerifiedGeneration = null;
|
|
19233
19359
|
accountReloadFingerprint;
|
|
19234
19360
|
pendingAccountReloadFingerprint;
|
|
@@ -19270,6 +19396,7 @@ class AppServerEngine {
|
|
|
19270
19396
|
this.forgetSignIn();
|
|
19271
19397
|
this.loginSequence++;
|
|
19272
19398
|
this.hostedNetworkLockVerifiedGeneration = null;
|
|
19399
|
+
this.skillExtraRootsGeneration = null;
|
|
19273
19400
|
this.toolHistoryLockVerifiedGeneration = null;
|
|
19274
19401
|
this.rejectAllWaiters();
|
|
19275
19402
|
this.router.abandonGeneration(generation);
|
|
@@ -19636,8 +19763,28 @@ class AppServerEngine {
|
|
|
19636
19763
|
}
|
|
19637
19764
|
throw new Error("Codex model catalogue exceeded its page limit");
|
|
19638
19765
|
}
|
|
19766
|
+
async ensureSkillExtraRoots(generation) {
|
|
19767
|
+
const extraRoots = this.options.skillExtraRoots ?? [];
|
|
19768
|
+
if (extraRoots.length === 0)
|
|
19769
|
+
return;
|
|
19770
|
+
if (this.skillExtraRootsGeneration?.id !== generation) {
|
|
19771
|
+
const set = this.supervisor.requestOnGeneration(generation, "skills/extraRoots/set", {
|
|
19772
|
+
extraRoots: [...extraRoots]
|
|
19773
|
+
}).then(() => {
|
|
19774
|
+
return;
|
|
19775
|
+
});
|
|
19776
|
+
const entry = { id: generation, set };
|
|
19777
|
+
this.skillExtraRootsGeneration = entry;
|
|
19778
|
+
set.catch(() => {
|
|
19779
|
+
if (this.skillExtraRootsGeneration === entry)
|
|
19780
|
+
this.skillExtraRootsGeneration = null;
|
|
19781
|
+
});
|
|
19782
|
+
}
|
|
19783
|
+
await this.skillExtraRootsGeneration.set;
|
|
19784
|
+
}
|
|
19639
19785
|
async projectResourceThreadConfig(generation, config) {
|
|
19640
|
-
|
|
19786
|
+
await this.ensureSkillExtraRoots(generation);
|
|
19787
|
+
if (!config.policy || codexLoadsProjectSkills(config.policy))
|
|
19641
19788
|
return {};
|
|
19642
19789
|
let listed;
|
|
19643
19790
|
try {
|
|
@@ -19828,6 +19975,14 @@ class AppServerEngine {
|
|
|
19828
19975
|
cwds: [options.cwd],
|
|
19829
19976
|
...options.forceReload ? { forceReload: true } : {}
|
|
19830
19977
|
};
|
|
19978
|
+
if ((this.options.skillExtraRoots ?? []).length > 0) {
|
|
19979
|
+
const { id: generation } = await this.supervisor.ensureReady();
|
|
19980
|
+
await this.ensureSkillExtraRoots(generation);
|
|
19981
|
+
return {
|
|
19982
|
+
result: await this.supervisor.requestOnGeneration(generation, "skills/list", params),
|
|
19983
|
+
generation
|
|
19984
|
+
};
|
|
19985
|
+
}
|
|
19831
19986
|
return this.supervisor.requestWithGeneration("skills/list", params);
|
|
19832
19987
|
}
|
|
19833
19988
|
async getRuntimeHealth(threadId) {
|
|
@@ -21576,6 +21731,9 @@ class CodexRuntimeSessions {
|
|
|
21576
21731
|
return "idle";
|
|
21577
21732
|
return this.hasParkedInput(session) ? "waiting" : "working";
|
|
21578
21733
|
}
|
|
21734
|
+
humanPromptOutput(sessionId) {
|
|
21735
|
+
return humanPromptObservation(this.ctx.registry.getThreadForSession(sessionId)?.messages);
|
|
21736
|
+
}
|
|
21579
21737
|
getActivitySnapshot(sessionId) {
|
|
21580
21738
|
const activity = this.getActivity(sessionId);
|
|
21581
21739
|
if (activity === "missing")
|
|
@@ -22078,7 +22236,7 @@ function parseCommandToken(text, sigils = ["/"]) {
|
|
|
22078
22236
|
// ../../bridges/codex-bridge/src/prompts/template-discovery.ts
|
|
22079
22237
|
import { createHash as createHash11 } from "node:crypto";
|
|
22080
22238
|
import { open as open7, readdir as readdir3, stat as stat7 } from "node:fs/promises";
|
|
22081
|
-
import { join as
|
|
22239
|
+
import { join as join17 } from "node:path";
|
|
22082
22240
|
|
|
22083
22241
|
// ../../bridges/codex-bridge/src/prompts/template-format.ts
|
|
22084
22242
|
var TEMPLATE_DESCRIPTION_MAX_BYTES = 1000;
|
|
@@ -22206,8 +22364,8 @@ var RESERVED_TEMPLATE_PREFIXES = ["/skill:", "/prompts:"];
|
|
|
22206
22364
|
var TEMPLATE_ID_PREFIX = "codex-template:";
|
|
22207
22365
|
function templateRoots(cwd, codexHome = getCodexHomeDir()) {
|
|
22208
22366
|
return [
|
|
22209
|
-
{ origin: "project", dir:
|
|
22210
|
-
{ origin: "user", dir:
|
|
22367
|
+
{ origin: "project", dir: join17(cwd, ".codex", "prompts") },
|
|
22368
|
+
{ origin: "user", dir: join17(codexHome, "prompts") }
|
|
22211
22369
|
];
|
|
22212
22370
|
}
|
|
22213
22371
|
function templateCommandId(origin, relativePath) {
|
|
@@ -22312,7 +22470,7 @@ async function scanPromptTemplates(roots, limits = TEMPLATE_LIMITS) {
|
|
|
22312
22470
|
return;
|
|
22313
22471
|
}
|
|
22314
22472
|
visited += 1;
|
|
22315
|
-
const absolutePath =
|
|
22473
|
+
const absolutePath = join17(dir, entry.name);
|
|
22316
22474
|
const relativePath = relative ? `${relative}/${entry.name}` : entry.name;
|
|
22317
22475
|
if (entry.isDirectory()) {
|
|
22318
22476
|
if (depth + 1 > limits.maxDepth) {
|
|
@@ -25149,7 +25307,7 @@ class CodexRuntimePrompt {
|
|
|
25149
25307
|
const interpretCommands = input.allowProviderCommands !== false;
|
|
25150
25308
|
let plan;
|
|
25151
25309
|
if (input.command) {
|
|
25152
|
-
plan = await this.ctx.commandCatalogue.resolveSelected(input.command, session.config.policy
|
|
25310
|
+
plan = await this.ctx.commandCatalogue.resolveSelected(input.command, codexLoadsProjectSkills(session.config.policy));
|
|
25153
25311
|
if (plan.kind === "refused")
|
|
25154
25312
|
return commandRefusal(plan.message);
|
|
25155
25313
|
if (plan.kind === "builtin" && input.outputSchema) {
|
|
@@ -25185,9 +25343,9 @@ class CodexRuntimePrompt {
|
|
|
25185
25343
|
context = await this.ctx.callbacks.ensureAttached(session.id);
|
|
25186
25344
|
this.ctx.registry.assertNoActiveTurn(context);
|
|
25187
25345
|
if (!plan) {
|
|
25188
|
-
plan = interpretCommands && !input.outputSchema ? await this.ctx.commandCatalogue.resolveTyped(input.prompt, session.config.policy
|
|
25346
|
+
plan = interpretCommands && !input.outputSchema ? await this.ctx.commandCatalogue.resolveTyped(input.prompt, codexLoadsProjectSkills(session.config.policy)) : { kind: "text" };
|
|
25189
25347
|
} else if (plan.kind === "skill") {
|
|
25190
|
-
const revalidated = await this.ctx.commandCatalogue.resolveSelected(input.command, session.config.policy
|
|
25348
|
+
const revalidated = await this.ctx.commandCatalogue.resolveSelected(input.command, codexLoadsProjectSkills(session.config.policy));
|
|
25191
25349
|
if (revalidated.kind === "refused")
|
|
25192
25350
|
return commandRefusal(revalidated.message);
|
|
25193
25351
|
plan = revalidated;
|
|
@@ -25197,7 +25355,7 @@ class CodexRuntimePrompt {
|
|
|
25197
25355
|
return { ok: true, result: { status: "processing", requestId } };
|
|
25198
25356
|
}
|
|
25199
25357
|
if (plan.kind === "builtin") {
|
|
25200
|
-
const response = plan.builtin === "help" ? await this.ctx.commandCatalogue.helpText(session.config.policy
|
|
25358
|
+
const response = plan.builtin === "help" ? await this.ctx.commandCatalogue.helpText(codexLoadsProjectSkills(session.config.policy)) : await this.modelsListText(session);
|
|
25201
25359
|
this.emitLocalResponse(session, input.prompt, response);
|
|
25202
25360
|
return { ok: true, result: { status: "processing", requestId } };
|
|
25203
25361
|
}
|
|
@@ -25217,7 +25375,7 @@ class CodexRuntimePrompt {
|
|
|
25217
25375
|
skillInput = { name: plan.binding.name, path: plan.binding.path };
|
|
25218
25376
|
}
|
|
25219
25377
|
if (plan.kind === "skill") {
|
|
25220
|
-
const unavailable = skillUnavailability(plan.binding, session.config.policy
|
|
25378
|
+
const unavailable = skillUnavailability(plan.binding, codexLoadsProjectSkills(session.config.policy));
|
|
25221
25379
|
if (unavailable)
|
|
25222
25380
|
return commandRefusal(unavailable.message);
|
|
25223
25381
|
}
|
|
@@ -25235,7 +25393,7 @@ class CodexRuntimePrompt {
|
|
|
25235
25393
|
...input.workflowResultTool ? { workflowResultTool: input.workflowResultTool } : {}
|
|
25236
25394
|
});
|
|
25237
25395
|
let projectSkillsRevision = this.ctx.projectSkillsRevision;
|
|
25238
|
-
const needsThreadReload = (config) => Boolean(input.workflowResultTool) || context?.promptThreadConfig !== promptThreadConfig(config) || config.policy
|
|
25396
|
+
const needsThreadReload = (config) => Boolean(input.workflowResultTool) || context?.promptThreadConfig !== promptThreadConfig(config) || !codexLoadsProjectSkills(config.policy) && context?.projectSkillsRevision !== projectSkillsRevision;
|
|
25239
25397
|
if (context && !context.materialized && needsThreadReload(promptConfig())) {
|
|
25240
25398
|
await this.lifecycle.detachThread(context);
|
|
25241
25399
|
context = undefined;
|
|
@@ -25269,7 +25427,7 @@ class CodexRuntimePrompt {
|
|
|
25269
25427
|
if (hadAttachedContext && needsThreadReload(turnConfig)) {
|
|
25270
25428
|
context = await this.resumeThreadForPrompt(session.id, context, turnConfig);
|
|
25271
25429
|
}
|
|
25272
|
-
for (let attempt = 0
|
|
25430
|
+
for (let attempt = 0;!codexLoadsProjectSkills(turnConfig.policy) && projectSkillsRevision !== this.ctx.projectSkillsRevision; attempt += 1) {
|
|
25273
25431
|
if (attempt >= 3) {
|
|
25274
25432
|
context.promptThreadConfig = undefined;
|
|
25275
25433
|
return {
|
|
@@ -25867,7 +26025,7 @@ class CodexRuntimePrompt {
|
|
|
25867
26025
|
commands: []
|
|
25868
26026
|
};
|
|
25869
26027
|
}
|
|
25870
|
-
return this.ctx.commandCatalogue.list(this.ctx.registry.getSession(sessionId)?.config.policy
|
|
26028
|
+
return this.ctx.commandCatalogue.list(codexLoadsProjectSkills(this.ctx.registry.getSession(sessionId)?.config.policy));
|
|
25871
26029
|
}
|
|
25872
26030
|
async refreshCommandCatalogue(sessionId) {
|
|
25873
26031
|
if (!this.ctx.registry.getSession(sessionId)) {
|
|
@@ -26391,6 +26549,9 @@ class AppServerRuntime {
|
|
|
26391
26549
|
getActivity(...args) {
|
|
26392
26550
|
return this.sessions.getActivity(...args);
|
|
26393
26551
|
}
|
|
26552
|
+
humanPromptOutput(sessionId) {
|
|
26553
|
+
return this.sessions.humanPromptOutput(sessionId);
|
|
26554
|
+
}
|
|
26394
26555
|
getActivitySnapshot(...args) {
|
|
26395
26556
|
return this.sessions.getActivitySnapshot(...args);
|
|
26396
26557
|
}
|
|
@@ -27022,7 +27183,7 @@ async function writeCodexRawLog(sessionId, entry, logDir = codexRawLogDir) {
|
|
|
27022
27183
|
try {
|
|
27023
27184
|
await mkdir8(logDir, { recursive: true });
|
|
27024
27185
|
const filename = `${sanitizeLogFileComponent(sessionId)}.jsonl`;
|
|
27025
|
-
await appendFile5(
|
|
27186
|
+
await appendFile5(join18(logDir, filename), `${JSON.stringify({
|
|
27026
27187
|
timestamp: new Date().toISOString(),
|
|
27027
27188
|
sessionId,
|
|
27028
27189
|
...entry
|
|
@@ -27219,10 +27380,10 @@ function emit(event) {
|
|
|
27219
27380
|
}
|
|
27220
27381
|
}
|
|
27221
27382
|
function bridgeCacheDir() {
|
|
27222
|
-
return
|
|
27383
|
+
return join18(getCodexHomeDir(), "orkestrator-bridge");
|
|
27223
27384
|
}
|
|
27224
27385
|
function bridgeCachePath() {
|
|
27225
|
-
return
|
|
27386
|
+
return join18(bridgeCacheDir(), "models-cache.json");
|
|
27226
27387
|
}
|
|
27227
27388
|
var BRIDGE_MODEL_CACHE_VERSION = 2;
|
|
27228
27389
|
async function readPersistedBridgeCache() {
|
|
@@ -27246,7 +27407,7 @@ async function writePersistedBridgeCache(models) {
|
|
|
27246
27407
|
}
|
|
27247
27408
|
async function readCodexCliModelCache() {
|
|
27248
27409
|
try {
|
|
27249
|
-
const raw = await readFile7(
|
|
27410
|
+
const raw = await readFile7(join18(getCodexHomeDir(), "models_cache.json"), "utf8");
|
|
27250
27411
|
const models = parseModelCatalog(raw);
|
|
27251
27412
|
return models.length > 0 ? models : null;
|
|
27252
27413
|
} catch {
|
|
@@ -27284,7 +27445,8 @@ function createCodexEngine(env = process.env, createEngine = (options) => new Ap
|
|
|
27284
27445
|
title: "Orkestrator",
|
|
27285
27446
|
version: env.ORKESTRATOR_VERSION || "0.0.0"
|
|
27286
27447
|
},
|
|
27287
|
-
configOverrides: codexAppServerConfigOverrides(env)
|
|
27448
|
+
configOverrides: codexAppServerConfigOverrides(env),
|
|
27449
|
+
skillExtraRoots: codexCoordinatorSkillExtraRoots(env, getWorkingDirectory())
|
|
27288
27450
|
});
|
|
27289
27451
|
}
|
|
27290
27452
|
var codexEngine = createCodexEngine();
|
|
@@ -27669,6 +27831,9 @@ app.get("/session/:id/usage", async (c) => {
|
|
|
27669
27831
|
return c.json({ error: "Account usage is temporarily unavailable" }, 503);
|
|
27670
27832
|
}
|
|
27671
27833
|
});
|
|
27834
|
+
app.get("/session/:id/human-prompts", (c) => {
|
|
27835
|
+
return c.json(appServerRuntime.humanPromptOutput(c.req.param("id")));
|
|
27836
|
+
});
|
|
27672
27837
|
app.get("/session/:id/activity", (c) => {
|
|
27673
27838
|
return c.json(appServerRuntime.getActivitySnapshot(c.req.param("id")));
|
|
27674
27839
|
});
|