oh-my-opencode 5.1.75 → 5.1.77
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/cli/index.js +35367 -24312
- package/dist/cli/service-auth/commands.d.ts +1 -0
- package/dist/cli/service-auth/device-flow.d.ts +15 -3
- package/dist/cli/service-auth/device-name.d.ts +6 -0
- package/dist/cli/service-auth/keychain-helper/client.d.ts +9 -1
- package/dist/cli/service-auth/keychain-helper/darwin-backend.d.ts +7 -0
- package/dist/cli/service-auth/keychain-helper/darwin-read.d.ts +3 -1
- package/dist/cli/service-auth/keychain-helper/darwin-store.d.ts +3 -0
- package/dist/cli/service-auth/keychain-helper/dedicated-fake.test-support.d.ts +101 -0
- package/dist/cli/service-auth/keychain-helper/dedicated-store.d.ts +9 -0
- package/dist/cli/service-auth/keychain-helper/dedicated-switch.d.ts +35 -0
- package/dist/cli/service-auth/keychain-helper/pin.d.ts +3 -3
- package/dist/cli/service-auth/keystore.d.ts +6 -0
- package/dist/cli/service-auth/login-routes.d.ts +12 -0
- package/dist/cli/service-auth/machine-reconcile.d.ts +34 -0
- package/dist/cli/service-auth/protocol.d.ts +39 -1
- package/dist/cli/service-auth/replace-device.d.ts +11 -0
- package/dist/cli/service-auth/session.d.ts +5 -0
- package/dist/cli/service-auth/test-support.d.ts +2 -0
- package/dist/cli-node/index.js +35367 -24312
- package/dist/index.js +350 -232
- package/dist/skills/browser/runtime/omowright/manifest.json +1 -1
- package/dist/skills/data-scientist/references/visualization.md +1 -1
- package/dist/skills/frontend/SKILL.md +1 -1
- package/dist/skills/frontend/references/design/_INDEX.md +2 -0
- package/dist/skills/ulw-plan/references/full-workflow.md +3 -3
- package/dist/skills/ulw-plan/scripts/plan-templates.mjs +3 -3
- package/dist/skills/ulw-research/SKILL.md +1 -1
- package/dist/skills/visual-qa/SKILL.md +1 -1
- package/dist/tui.js +72 -24
- package/package.json +14 -14
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +158 -174
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +5 -6
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/scripts/plan-templates.mjs +3 -3
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +12 -12
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +1 -1
- package/packages/omo-codex/plugin/skills/data-scientist/references/visualization.md +1 -1
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +2 -0
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +2 -2
- package/packages/omo-codex/plugin/skills/ulw-plan/scripts/plan-templates.mjs +3 -3
- package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +1 -1
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +16 -35
- package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +1 -1
- package/packages/shared-skills/skills/data-scientist/references/visualization.md +1 -1
- package/packages/shared-skills/skills/frontend/SKILL.md +1 -1
- package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +2 -0
- package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +3 -3
- package/packages/shared-skills/skills/ulw-plan/scripts/plan-templates.mjs +3 -3
- package/packages/shared-skills/skills/ulw-research/SKILL.md +1 -1
- package/packages/shared-skills/skills/visual-qa/SKILL.md +1 -1
|
@@ -9581,16 +9581,16 @@ function recordAt(value, key) {
|
|
|
9581
9581
|
}
|
|
9582
9582
|
|
|
9583
9583
|
// ../src/install/link-cached-plugin-agents.ts
|
|
9584
|
-
import { copyFile, lstat as lstat6, mkdir as mkdir4, readdir as readdir2, readFile as
|
|
9585
|
-
import { basename as basename4, join as
|
|
9584
|
+
import { copyFile, lstat as lstat6, mkdir as mkdir4, readdir as readdir2, readFile as readFile9, rm as rm8, writeFile as writeFile6 } from "node:fs/promises";
|
|
9585
|
+
import { basename as basename4, join as join15 } from "node:path";
|
|
9586
9586
|
|
|
9587
9587
|
// ../src/install/agent-model-overrides.ts
|
|
9588
|
-
import { readFile as
|
|
9589
|
-
import { join as
|
|
9588
|
+
import { readFile as readFile6, rm as rm5, writeFile as writeFile4 } from "node:fs/promises";
|
|
9589
|
+
import { join as join11 } from "node:path";
|
|
9590
9590
|
|
|
9591
9591
|
// ../src/install/preserved-agent-settings.ts
|
|
9592
|
-
import { lstat as lstat2, readFile as
|
|
9593
|
-
import { join as
|
|
9592
|
+
import { lstat as lstat2, readFile as readFile5, readdir, writeFile as writeFile3 } from "node:fs/promises";
|
|
9593
|
+
import { join as join10 } from "node:path";
|
|
9594
9594
|
|
|
9595
9595
|
// ../src/install/toml-section-editor.ts
|
|
9596
9596
|
function findTomlSection(config, header) {
|
|
@@ -10136,22 +10136,90 @@ function stripTomlLineComment(line) {
|
|
|
10136
10136
|
return line;
|
|
10137
10137
|
}
|
|
10138
10138
|
|
|
10139
|
-
//
|
|
10140
|
-
|
|
10141
|
-
|
|
10142
|
-
|
|
10143
|
-
|
|
10144
|
-
|
|
10145
|
-
|
|
10146
|
-
|
|
10147
|
-
|
|
10148
|
-
|
|
10149
|
-
|
|
10150
|
-
|
|
10151
|
-
|
|
10152
|
-
|
|
10153
|
-
|
|
10139
|
+
// ../src/install/codex-model-catalog.ts
|
|
10140
|
+
import { readFile as readFile4 } from "node:fs/promises";
|
|
10141
|
+
import { join as join9 } from "node:path";
|
|
10142
|
+
var CODEX_ASTRA_MODEL = "gpt-6-astra";
|
|
10143
|
+
var FALLBACK_CODEX_MODEL_CATALOG = {
|
|
10144
|
+
current: {
|
|
10145
|
+
model: CODEX_ASTRA_MODEL,
|
|
10146
|
+
modelContextWindow: 600000,
|
|
10147
|
+
modelReasoningEffort: "high",
|
|
10148
|
+
planModeReasoningEffort: "xhigh"
|
|
10149
|
+
},
|
|
10150
|
+
managedProfiles: [
|
|
10151
|
+
{
|
|
10152
|
+
model: "gpt-5.5",
|
|
10153
|
+
modelContextWindow: 400000,
|
|
10154
|
+
modelReasoningEffort: "high",
|
|
10155
|
+
planModeReasoningEffort: "xhigh"
|
|
10156
|
+
},
|
|
10157
|
+
{
|
|
10158
|
+
model: "gpt-5.5",
|
|
10159
|
+
modelContextWindow: 1e6,
|
|
10160
|
+
modelReasoningEffort: "high",
|
|
10161
|
+
planModeReasoningEffort: "xhigh"
|
|
10162
|
+
},
|
|
10163
|
+
{ model: "gpt-5.5", modelContextWindow: 272000 },
|
|
10164
|
+
{
|
|
10165
|
+
model: "gpt-5.6-sol",
|
|
10166
|
+
modelContextWindow: 650000,
|
|
10167
|
+
modelReasoningEffort: "high",
|
|
10168
|
+
planModeReasoningEffort: "xhigh"
|
|
10169
|
+
}
|
|
10170
|
+
]
|
|
10154
10171
|
};
|
|
10172
|
+
async function readCodexModelCatalog(codexPackageRoot) {
|
|
10173
|
+
const catalogPath = join9(codexPackageRoot, "plugin", "model-catalog.json");
|
|
10174
|
+
try {
|
|
10175
|
+
const parsed = JSON.parse(await readFile4(catalogPath, "utf8"));
|
|
10176
|
+
return parseCodexModelCatalog(parsed) ?? FALLBACK_CODEX_MODEL_CATALOG;
|
|
10177
|
+
} catch (error) {
|
|
10178
|
+
if (error instanceof Error)
|
|
10179
|
+
return FALLBACK_CODEX_MODEL_CATALOG;
|
|
10180
|
+
throw error;
|
|
10181
|
+
}
|
|
10182
|
+
}
|
|
10183
|
+
function parseCodexModelCatalog(value) {
|
|
10184
|
+
if (!isPlainRecord(value))
|
|
10185
|
+
return null;
|
|
10186
|
+
const current = value["current"];
|
|
10187
|
+
const managedProfiles = value["managedProfiles"];
|
|
10188
|
+
if (!isPlainRecord(current) || !Array.isArray(managedProfiles))
|
|
10189
|
+
return null;
|
|
10190
|
+
const model = current["model"];
|
|
10191
|
+
const modelContextWindow = current["model_context_window"];
|
|
10192
|
+
const modelReasoningEffort = current["model_reasoning_effort"];
|
|
10193
|
+
const planModeReasoningEffort = current["plan_mode_reasoning_effort"];
|
|
10194
|
+
if (typeof model !== "string" || typeof modelContextWindow !== "number" || typeof modelReasoningEffort !== "string" || typeof planModeReasoningEffort !== "string") {
|
|
10195
|
+
return null;
|
|
10196
|
+
}
|
|
10197
|
+
const parsedManagedProfiles = [];
|
|
10198
|
+
for (const profile of managedProfiles) {
|
|
10199
|
+
if (!isPlainRecord(profile))
|
|
10200
|
+
return null;
|
|
10201
|
+
const match = profile["match"];
|
|
10202
|
+
if (!isPlainRecord(match))
|
|
10203
|
+
return null;
|
|
10204
|
+
parsedManagedProfiles.push(parseProfileMatch(match));
|
|
10205
|
+
}
|
|
10206
|
+
return {
|
|
10207
|
+
current: { model, modelContextWindow, modelReasoningEffort, planModeReasoningEffort },
|
|
10208
|
+
managedProfiles: parsedManagedProfiles
|
|
10209
|
+
};
|
|
10210
|
+
}
|
|
10211
|
+
function parseProfileMatch(match) {
|
|
10212
|
+
const profile = {};
|
|
10213
|
+
if (typeof match["model"] === "string")
|
|
10214
|
+
profile.model = match["model"];
|
|
10215
|
+
if (typeof match["model_context_window"] === "number")
|
|
10216
|
+
profile.modelContextWindow = match["model_context_window"];
|
|
10217
|
+
if (typeof match["model_reasoning_effort"] === "string")
|
|
10218
|
+
profile.modelReasoningEffort = match["model_reasoning_effort"];
|
|
10219
|
+
if (typeof match["plan_mode_reasoning_effort"] === "string")
|
|
10220
|
+
profile.planModeReasoningEffort = match["plan_mode_reasoning_effort"];
|
|
10221
|
+
return profile;
|
|
10222
|
+
}
|
|
10155
10223
|
|
|
10156
10224
|
// ../src/install/managed-agent-reasoning-defaults.ts
|
|
10157
10225
|
var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
|
|
@@ -10168,7 +10236,7 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
|
|
|
10168
10236
|
},
|
|
10169
10237
|
{
|
|
10170
10238
|
previous: { model: "gpt-5.6-luna", effort: "low" },
|
|
10171
|
-
current: { model:
|
|
10239
|
+
current: { model: CODEX_ASTRA_MODEL, effort: "low" }
|
|
10172
10240
|
}
|
|
10173
10241
|
]
|
|
10174
10242
|
],
|
|
@@ -10185,7 +10253,7 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
|
|
|
10185
10253
|
},
|
|
10186
10254
|
{
|
|
10187
10255
|
previous: { model: "gpt-5.6-luna", effort: "low" },
|
|
10188
|
-
current: { model:
|
|
10256
|
+
current: { model: CODEX_ASTRA_MODEL, effort: "low" }
|
|
10189
10257
|
}
|
|
10190
10258
|
]
|
|
10191
10259
|
],
|
|
@@ -10194,7 +10262,7 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
|
|
|
10194
10262
|
[
|
|
10195
10263
|
{
|
|
10196
10264
|
previous: { model: "gpt-5.6-sol", effort: "high" },
|
|
10197
|
-
current: { model:
|
|
10265
|
+
current: { model: CODEX_ASTRA_MODEL, effort: "high" }
|
|
10198
10266
|
}
|
|
10199
10267
|
]
|
|
10200
10268
|
],
|
|
@@ -10203,7 +10271,7 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
|
|
|
10203
10271
|
[
|
|
10204
10272
|
{
|
|
10205
10273
|
previous: { model: "gpt-5.6-luna", effort: "high" },
|
|
10206
|
-
current: { model:
|
|
10274
|
+
current: { model: CODEX_ASTRA_MODEL, effort: "high" }
|
|
10207
10275
|
}
|
|
10208
10276
|
]
|
|
10209
10277
|
],
|
|
@@ -10220,7 +10288,7 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
|
|
|
10220
10288
|
},
|
|
10221
10289
|
{
|
|
10222
10290
|
previous: { model: "gpt-5.6-terra", effort: "high" },
|
|
10223
|
-
current: { model:
|
|
10291
|
+
current: { model: CODEX_ASTRA_MODEL, effort: "high" }
|
|
10224
10292
|
}
|
|
10225
10293
|
]
|
|
10226
10294
|
],
|
|
@@ -10237,7 +10305,7 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
|
|
|
10237
10305
|
},
|
|
10238
10306
|
{
|
|
10239
10307
|
previous: { model: "gpt-5.6-sol", effort: "high" },
|
|
10240
|
-
current: { model:
|
|
10308
|
+
current: { model: CODEX_ASTRA_MODEL, effort: "high" }
|
|
10241
10309
|
}
|
|
10242
10310
|
]
|
|
10243
10311
|
],
|
|
@@ -10254,7 +10322,7 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
|
|
|
10254
10322
|
},
|
|
10255
10323
|
{
|
|
10256
10324
|
previous: { model: "gpt-5.6-terra", effort: "high" },
|
|
10257
|
-
current: { model:
|
|
10325
|
+
current: { model: CODEX_ASTRA_MODEL, effort: "high" }
|
|
10258
10326
|
}
|
|
10259
10327
|
]
|
|
10260
10328
|
],
|
|
@@ -10267,7 +10335,7 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
|
|
|
10267
10335
|
},
|
|
10268
10336
|
{
|
|
10269
10337
|
previous: { model: "gpt-5.6-sol", effort: "medium" },
|
|
10270
|
-
current: { model:
|
|
10338
|
+
current: { model: CODEX_ASTRA_MODEL, effort: "medium" }
|
|
10271
10339
|
}
|
|
10272
10340
|
]
|
|
10273
10341
|
],
|
|
@@ -10280,7 +10348,7 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
|
|
|
10280
10348
|
},
|
|
10281
10349
|
{
|
|
10282
10350
|
previous: { model: "gpt-5.6-terra", effort: "medium" },
|
|
10283
|
-
current: { model:
|
|
10351
|
+
current: { model: CODEX_ASTRA_MODEL, effort: "medium" }
|
|
10284
10352
|
}
|
|
10285
10353
|
]
|
|
10286
10354
|
],
|
|
@@ -10293,7 +10361,7 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
|
|
|
10293
10361
|
},
|
|
10294
10362
|
{
|
|
10295
10363
|
previous: { model: "gpt-5.6-terra", effort: "high" },
|
|
10296
|
-
current: { model:
|
|
10364
|
+
current: { model: CODEX_ASTRA_MODEL, effort: "high" }
|
|
10297
10365
|
}
|
|
10298
10366
|
]
|
|
10299
10367
|
],
|
|
@@ -10306,7 +10374,7 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
|
|
|
10306
10374
|
},
|
|
10307
10375
|
{
|
|
10308
10376
|
previous: { model: "gpt-5.6-luna", effort: "high" },
|
|
10309
|
-
current: { model:
|
|
10377
|
+
current: { model: CODEX_ASTRA_MODEL, effort: "high" }
|
|
10310
10378
|
}
|
|
10311
10379
|
]
|
|
10312
10380
|
],
|
|
@@ -10323,7 +10391,7 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
|
|
|
10323
10391
|
},
|
|
10324
10392
|
{
|
|
10325
10393
|
previous: { model: "gpt-5.6-sol", effort: "low" },
|
|
10326
|
-
current: { model:
|
|
10394
|
+
current: { model: CODEX_ASTRA_MODEL, effort: "low" }
|
|
10327
10395
|
}
|
|
10328
10396
|
]
|
|
10329
10397
|
]
|
|
@@ -10344,7 +10412,7 @@ function resolveManagedAgentReasoning(input) {
|
|
|
10344
10412
|
|
|
10345
10413
|
// ../src/install/preserved-agent-settings.ts
|
|
10346
10414
|
async function capturePreservedAgentReasoning(input) {
|
|
10347
|
-
const agentsDir =
|
|
10415
|
+
const agentsDir = join10(input.codexHome, "agents");
|
|
10348
10416
|
if (!await exists(agentsDir))
|
|
10349
10417
|
return new Map;
|
|
10350
10418
|
const preserved = new Map;
|
|
@@ -10352,7 +10420,7 @@ async function capturePreservedAgentReasoning(input) {
|
|
|
10352
10420
|
for (const entry of agentEntries) {
|
|
10353
10421
|
if (!entry.name.endsWith(".toml"))
|
|
10354
10422
|
continue;
|
|
10355
|
-
const content = await readTextIfExists(
|
|
10423
|
+
const content = await readTextIfExists(join10(agentsDir, entry.name));
|
|
10356
10424
|
if (content === null)
|
|
10357
10425
|
continue;
|
|
10358
10426
|
const effort = extractReasoningEffort(content);
|
|
@@ -10366,7 +10434,7 @@ async function capturePreservedAgentReasoning(input) {
|
|
|
10366
10434
|
return preserved;
|
|
10367
10435
|
}
|
|
10368
10436
|
async function capturePreservedAgentServiceTier(input) {
|
|
10369
|
-
const agentsDir =
|
|
10437
|
+
const agentsDir = join10(input.codexHome, "agents");
|
|
10370
10438
|
if (!await exists(agentsDir))
|
|
10371
10439
|
return new Map;
|
|
10372
10440
|
const preserved = new Map;
|
|
@@ -10374,7 +10442,7 @@ async function capturePreservedAgentServiceTier(input) {
|
|
|
10374
10442
|
for (const entry of agentEntries) {
|
|
10375
10443
|
if (!entry.name.endsWith(".toml"))
|
|
10376
10444
|
continue;
|
|
10377
|
-
const content = await readTextIfExists(
|
|
10445
|
+
const content = await readTextIfExists(join10(agentsDir, entry.name));
|
|
10378
10446
|
if (content === null)
|
|
10379
10447
|
continue;
|
|
10380
10448
|
preserved.set(agentNameFromToml(entry.name), extractServiceTier(content));
|
|
@@ -10384,7 +10452,7 @@ async function capturePreservedAgentServiceTier(input) {
|
|
|
10384
10452
|
async function restorePreservedReasoning(input) {
|
|
10385
10453
|
if (input.value === undefined)
|
|
10386
10454
|
return;
|
|
10387
|
-
const content = await
|
|
10455
|
+
const content = await readFile5(input.target, "utf8");
|
|
10388
10456
|
const bundledEffort = extractReasoningEffort(content);
|
|
10389
10457
|
const effort = resolveManagedAgentReasoning({
|
|
10390
10458
|
agentName: input.agentName,
|
|
@@ -10404,7 +10472,7 @@ async function restorePreservedReasoning(input) {
|
|
|
10404
10472
|
async function restorePreservedServiceTier(input) {
|
|
10405
10473
|
if (!input.preserved)
|
|
10406
10474
|
return;
|
|
10407
|
-
const content = await
|
|
10475
|
+
const content = await readFile5(input.linkPath, "utf8");
|
|
10408
10476
|
if (extractServiceTier(content) === input.value)
|
|
10409
10477
|
return;
|
|
10410
10478
|
const replacement = replaceTopLevelStringSetting(content, "service_tier", input.value, { insertIfMissing: true });
|
|
@@ -10415,7 +10483,7 @@ async function restorePreservedServiceTier(input) {
|
|
|
10415
10483
|
async function restorePreservedModel(input) {
|
|
10416
10484
|
if (input.value === null)
|
|
10417
10485
|
return;
|
|
10418
|
-
const content = await
|
|
10486
|
+
const content = await readFile5(input.linkPath, "utf8");
|
|
10419
10487
|
if (extractModel(content) === input.value)
|
|
10420
10488
|
return;
|
|
10421
10489
|
const replacement = replaceTopLevelStringSetting(content, "model", input.value, { insertIfMissing: true });
|
|
@@ -10425,7 +10493,7 @@ async function restorePreservedModel(input) {
|
|
|
10425
10493
|
}
|
|
10426
10494
|
async function readTextIfExists(path) {
|
|
10427
10495
|
try {
|
|
10428
|
-
return await
|
|
10496
|
+
return await readFile5(path, "utf8");
|
|
10429
10497
|
} catch (error) {
|
|
10430
10498
|
if (nodeErrorCode(error) === "ENOENT")
|
|
10431
10499
|
return null;
|
|
@@ -10553,7 +10621,7 @@ async function writeAgentModelReceipts(codexHome, receipts) {
|
|
|
10553
10621
|
async function applyAgentOverride(input) {
|
|
10554
10622
|
if (input.override === undefined)
|
|
10555
10623
|
return;
|
|
10556
|
-
let content = await
|
|
10624
|
+
let content = await readFile6(input.linkPath, "utf8");
|
|
10557
10625
|
if (input.override.model !== undefined) {
|
|
10558
10626
|
content = replaceTopLevelStringSetting(content, "model", input.override.model, { insertIfMissing: true }).content;
|
|
10559
10627
|
}
|
|
@@ -10565,7 +10633,7 @@ async function applyAgentOverride(input) {
|
|
|
10565
10633
|
await writeFile4(input.linkPath, content);
|
|
10566
10634
|
}
|
|
10567
10635
|
function receiptPath(codexHome) {
|
|
10568
|
-
return
|
|
10636
|
+
return join11(codexHome, "agents", RECEIPT_FILE);
|
|
10569
10637
|
}
|
|
10570
10638
|
function parseJson(content) {
|
|
10571
10639
|
try {
|
|
@@ -10597,8 +10665,8 @@ function handEditedAgentModel(installedModel, receipt) {
|
|
|
10597
10665
|
}
|
|
10598
10666
|
|
|
10599
10667
|
// ../src/install/retired-managed-agent-purge.ts
|
|
10600
|
-
import { lstat as lstat3, readFile as
|
|
10601
|
-
import { join as
|
|
10668
|
+
import { lstat as lstat3, readFile as readFile7, rm as rm6 } from "node:fs/promises";
|
|
10669
|
+
import { join as join12 } from "node:path";
|
|
10602
10670
|
var RETIRED_MANAGED_AGENT_FILES = [
|
|
10603
10671
|
{
|
|
10604
10672
|
fileName: "codex-ultrawork-reviewer.toml",
|
|
@@ -10610,11 +10678,11 @@ var RETIRED_MANAGED_AGENT_FILES = [
|
|
|
10610
10678
|
}
|
|
10611
10679
|
];
|
|
10612
10680
|
async function purgeRetiredManagedAgentFiles(input) {
|
|
10613
|
-
const agentsDir =
|
|
10681
|
+
const agentsDir = join12(input.codexHome, "agents");
|
|
10614
10682
|
if (!await exists2(agentsDir))
|
|
10615
10683
|
return;
|
|
10616
10684
|
for (const retiredAgent of RETIRED_MANAGED_AGENT_FILES) {
|
|
10617
|
-
const agentPath =
|
|
10685
|
+
const agentPath = join12(agentsDir, retiredAgent.fileName);
|
|
10618
10686
|
if (!await exists2(agentPath))
|
|
10619
10687
|
continue;
|
|
10620
10688
|
const agentStat = await lstat3(agentPath);
|
|
@@ -10631,7 +10699,7 @@ function hasRequiredMarkers(content, markers) {
|
|
|
10631
10699
|
}
|
|
10632
10700
|
async function readTextIfExists2(path) {
|
|
10633
10701
|
try {
|
|
10634
|
-
return await
|
|
10702
|
+
return await readFile7(path, "utf8");
|
|
10635
10703
|
} catch (error) {
|
|
10636
10704
|
if (nodeErrorCode2(error) === "ENOENT")
|
|
10637
10705
|
return null;
|
|
@@ -10656,17 +10724,17 @@ function nodeErrorCode2(error) {
|
|
|
10656
10724
|
|
|
10657
10725
|
// ../src/install/default-agent-role.ts
|
|
10658
10726
|
import { createHash as createHash4 } from "node:crypto";
|
|
10659
|
-
import { lstat as lstat5, readFile as
|
|
10660
|
-
import { join as
|
|
10727
|
+
import { lstat as lstat5, readFile as readFile8, rm as rm7 } from "node:fs/promises";
|
|
10728
|
+
import { join as join14 } from "node:path";
|
|
10661
10729
|
|
|
10662
10730
|
// ../src/install/codex-config-atomic-write.ts
|
|
10663
10731
|
import { lstat as lstat4, readlink, realpath, rename as rename3, unlink, writeFile as writeFile5 } from "node:fs/promises";
|
|
10664
|
-
import { basename as basename3, dirname as dirname6, isAbsolute as isAbsolute2, join as
|
|
10732
|
+
import { basename as basename3, dirname as dirname6, isAbsolute as isAbsolute2, join as join13, resolve as resolve4 } from "node:path";
|
|
10665
10733
|
var RENAME_RETRY_DELAYS_MS = [10, 25, 50];
|
|
10666
10734
|
var RETRIABLE_RENAME_CODES = new Set(["EPERM", "EBUSY"]);
|
|
10667
10735
|
async function writeFileAtomic(targetPath, data) {
|
|
10668
10736
|
const writeTarget = await resolveSymlinkTarget(targetPath);
|
|
10669
|
-
const temporaryPath =
|
|
10737
|
+
const temporaryPath = join13(dirname6(writeTarget), `.tmp-${basename3(writeTarget)}-${process.pid}-${Date.now()}`);
|
|
10670
10738
|
await writeFile5(temporaryPath, data);
|
|
10671
10739
|
try {
|
|
10672
10740
|
await renameWithRetry(temporaryPath, writeTarget);
|
|
@@ -10772,9 +10840,9 @@ function tomlKeySegment(value) {
|
|
|
10772
10840
|
// ../src/install/default-agent-role.ts
|
|
10773
10841
|
var REGISTRATION = { name: "default", configFile: "./agents/default.toml" };
|
|
10774
10842
|
async function installDefaultAgentRole(input) {
|
|
10775
|
-
const target =
|
|
10776
|
-
const receipt =
|
|
10777
|
-
const configPath =
|
|
10843
|
+
const target = join14(input.codexHome, "agents", "default.toml");
|
|
10844
|
+
const receipt = join14(input.codexHome, "agents", ".lazycodex-default.sha256");
|
|
10845
|
+
const configPath = join14(input.codexHome, "config.toml");
|
|
10778
10846
|
const config = await readIfPresent(configPath);
|
|
10779
10847
|
const entry = await lstat5(target).catch((error) => {
|
|
10780
10848
|
if (error instanceof Error && "code" in error && error.code === "ENOENT")
|
|
@@ -10805,7 +10873,7 @@ async function installDefaultAgentRole(input) {
|
|
|
10805
10873
|
if (foreign || existing !== null && !owned) {
|
|
10806
10874
|
throw new Error("Preserved user-owned agents.default / agents/default.toml. Move it aside to install the LazyCodex fallback, or set [codex].agents.default.disable = true in omo.jsonc. Explicit LazyCodex roles remain required.");
|
|
10807
10875
|
}
|
|
10808
|
-
const worker = await
|
|
10876
|
+
const worker = await readFile8(input.worker.path, "utf8");
|
|
10809
10877
|
const content = worker.replace(/^name\s*=\s*["']lazycodex-worker-medium["']\s*$/m, 'name = "default"');
|
|
10810
10878
|
if (content === worker)
|
|
10811
10879
|
throw new Error("Cannot derive default: medium worker has no matching internal name");
|
|
@@ -10815,7 +10883,7 @@ async function installDefaultAgentRole(input) {
|
|
|
10815
10883
|
}
|
|
10816
10884
|
async function readIfPresent(path) {
|
|
10817
10885
|
try {
|
|
10818
|
-
return await
|
|
10886
|
+
return await readFile8(path, "utf8");
|
|
10819
10887
|
} catch (error) {
|
|
10820
10888
|
if (error instanceof Error && "code" in error && error.code === "ENOENT")
|
|
10821
10889
|
return null;
|
|
@@ -10835,7 +10903,7 @@ async function linkCachedPluginAgents(input) {
|
|
|
10835
10903
|
await writeManifest(input.pluginRoot, []);
|
|
10836
10904
|
return [];
|
|
10837
10905
|
}
|
|
10838
|
-
const agentsDir =
|
|
10906
|
+
const agentsDir = join15(input.codexHome, "agents");
|
|
10839
10907
|
await mkdir4(agentsDir, { recursive: true });
|
|
10840
10908
|
const previousReceipts = await readAgentModelReceipts(input.codexHome);
|
|
10841
10909
|
const receipts = new Map;
|
|
@@ -10843,7 +10911,7 @@ async function linkCachedPluginAgents(input) {
|
|
|
10843
10911
|
for (const agentPath of bundledAgents) {
|
|
10844
10912
|
const agentFileName = basename4(agentPath);
|
|
10845
10913
|
const agentName = agentNameFromToml2(agentFileName);
|
|
10846
|
-
const linkPath =
|
|
10914
|
+
const linkPath = join15(agentsDir, agentFileName);
|
|
10847
10915
|
receipts.set(agentName, await syncAgentFile({
|
|
10848
10916
|
...input,
|
|
10849
10917
|
agentName,
|
|
@@ -10889,14 +10957,14 @@ async function syncAgentFile(input) {
|
|
|
10889
10957
|
value: input.preservedServiceTier?.get(input.agentName) ?? null
|
|
10890
10958
|
});
|
|
10891
10959
|
await applyAgentOverride({ linkPath: input.linkPath, override });
|
|
10892
|
-
const model = override?.model ?? extractModel(await
|
|
10960
|
+
const model = override?.model ?? extractModel(await readFile9(input.agentPath, "utf8"));
|
|
10893
10961
|
return {
|
|
10894
10962
|
...model === null ? {} : { model },
|
|
10895
10963
|
...override?.reasoningEffort === undefined ? {} : { reasoningEffort: override.reasoningEffort }
|
|
10896
10964
|
};
|
|
10897
10965
|
}
|
|
10898
10966
|
async function discoverBundledAgents(pluginRoot) {
|
|
10899
|
-
const componentsRoot =
|
|
10967
|
+
const componentsRoot = join15(pluginRoot, "components");
|
|
10900
10968
|
if (!await exists3(componentsRoot))
|
|
10901
10969
|
return [];
|
|
10902
10970
|
const componentEntries = await readdir2(componentsRoot, { withFileTypes: true });
|
|
@@ -10904,14 +10972,14 @@ async function discoverBundledAgents(pluginRoot) {
|
|
|
10904
10972
|
for (const entry of componentEntries) {
|
|
10905
10973
|
if (!entry.isDirectory())
|
|
10906
10974
|
continue;
|
|
10907
|
-
const agentsRoot =
|
|
10975
|
+
const agentsRoot = join15(componentsRoot, entry.name, "agents");
|
|
10908
10976
|
if (!await exists3(agentsRoot))
|
|
10909
10977
|
continue;
|
|
10910
10978
|
const agentEntries = await readdir2(agentsRoot, { withFileTypes: true });
|
|
10911
10979
|
for (const file of agentEntries) {
|
|
10912
10980
|
if (!file.isFile() || !file.name.endsWith(".toml"))
|
|
10913
10981
|
continue;
|
|
10914
|
-
agents.push(
|
|
10982
|
+
agents.push(join15(agentsRoot, file.name));
|
|
10915
10983
|
}
|
|
10916
10984
|
}
|
|
10917
10985
|
agents.sort();
|
|
@@ -10931,7 +10999,7 @@ async function prepareReplacement(linkPath) {
|
|
|
10931
10999
|
await rm8(linkPath, { force: true });
|
|
10932
11000
|
}
|
|
10933
11001
|
async function writeManifest(pluginRoot, agentPaths) {
|
|
10934
|
-
const manifestPath =
|
|
11002
|
+
const manifestPath = join15(pluginRoot, MANIFEST_FILE);
|
|
10935
11003
|
const payload = { agents: [...agentPaths].sort() };
|
|
10936
11004
|
await writeFile6(manifestPath, `${JSON.stringify(payload, null, "\t")}
|
|
10937
11005
|
`);
|
|
@@ -10956,8 +11024,8 @@ function nodeErrorCode3(error) {
|
|
|
10956
11024
|
}
|
|
10957
11025
|
|
|
10958
11026
|
// ../src/install/codex-cache-bins.ts
|
|
10959
|
-
import { chmod as chmod2, lstat as lstat9, mkdir as mkdir5, readFile as
|
|
10960
|
-
import { basename as basename5, isAbsolute as isAbsolute4, join as
|
|
11027
|
+
import { chmod as chmod2, lstat as lstat9, mkdir as mkdir5, readFile as readFile12, readdir as readdir4, readlink as readlink4, rm as rm11, stat as stat4, symlink, writeFile as writeFile7 } from "node:fs/promises";
|
|
11028
|
+
import { basename as basename5, isAbsolute as isAbsolute4, join as join19, relative as relative2, resolve as resolve6, sep } from "node:path";
|
|
10961
11029
|
|
|
10962
11030
|
// ../src/install/codex-cache-command-shim.ts
|
|
10963
11031
|
var COMMAND_SHIM_MARKER = ":: generated by oh-my-openagent Codex installer";
|
|
@@ -11000,15 +11068,15 @@ function windowsCommandShim(targetPath) {
|
|
|
11000
11068
|
}
|
|
11001
11069
|
|
|
11002
11070
|
// ../src/install/codex-cache-dangling-bins.ts
|
|
11003
|
-
import { lstat as lstat7, readFile as
|
|
11004
|
-
import { dirname as dirname7, isAbsolute as isAbsolute3, join as
|
|
11071
|
+
import { lstat as lstat7, readFile as readFile10, readdir as readdir3, readlink as readlink2, rm as rm9, stat as stat3 } from "node:fs/promises";
|
|
11072
|
+
import { dirname as dirname7, isAbsolute as isAbsolute3, join as join16, resolve as resolve5 } from "node:path";
|
|
11005
11073
|
async function removeDanglingManagedComponentBins(binDir, platform, managedBinNames) {
|
|
11006
11074
|
const entries = await readdir3(binDir, { withFileTypes: true });
|
|
11007
11075
|
for (const entry of entries) {
|
|
11008
11076
|
const binName = managedBinNameForEntry(entry.name, platform);
|
|
11009
11077
|
if (binName === null || !managedBinNames.has(binName))
|
|
11010
11078
|
continue;
|
|
11011
|
-
const linkPath =
|
|
11079
|
+
const linkPath = join16(binDir, entry.name);
|
|
11012
11080
|
if (platform === "win32") {
|
|
11013
11081
|
await removeDanglingGeneratedCommandShim(linkPath);
|
|
11014
11082
|
continue;
|
|
@@ -11041,7 +11109,7 @@ async function removeDanglingGeneratedCommandShim(linkPath) {
|
|
|
11041
11109
|
const linkStat = await lstat7(linkPath);
|
|
11042
11110
|
if (!linkStat.isFile())
|
|
11043
11111
|
return;
|
|
11044
|
-
const content = await
|
|
11112
|
+
const content = await readFile10(linkPath, "utf8");
|
|
11045
11113
|
if (!content.includes(COMMAND_SHIM_MARKER))
|
|
11046
11114
|
return;
|
|
11047
11115
|
const target = extractCommandShimTarget(content);
|
|
@@ -11089,8 +11157,8 @@ function hasOmoCodexPluginPrefix(parts, endExclusive) {
|
|
|
11089
11157
|
}
|
|
11090
11158
|
|
|
11091
11159
|
// ../src/install/codex-cache-legacy-bins.ts
|
|
11092
|
-
import { lstat as lstat8, readFile as
|
|
11093
|
-
import { join as
|
|
11160
|
+
import { lstat as lstat8, readFile as readFile11, readlink as readlink3, rm as rm10 } from "node:fs/promises";
|
|
11161
|
+
import { join as join17 } from "node:path";
|
|
11094
11162
|
var LEGACY_CODEX_COMPONENT_BINS = [
|
|
11095
11163
|
{ name: "omo", component: "ulw-loop" },
|
|
11096
11164
|
{ name: "codex-comment-checker", component: "comment-checker" },
|
|
@@ -11103,7 +11171,7 @@ var LEGACY_CODEX_COMPONENT_BINS = [
|
|
|
11103
11171
|
var LEGACY_CODEX_COMPONENT_BIN_NAMES = LEGACY_CODEX_COMPONENT_BINS.map((entry) => entry.name);
|
|
11104
11172
|
async function removeLegacyCodexComponentBins(binDir, platform) {
|
|
11105
11173
|
for (const entry of LEGACY_CODEX_COMPONENT_BINS) {
|
|
11106
|
-
const linkPath =
|
|
11174
|
+
const linkPath = join17(binDir, platform === "win32" ? `${entry.name}.cmd` : entry.name);
|
|
11107
11175
|
await removeLegacyCodexComponentBin(linkPath, entry.component, platform);
|
|
11108
11176
|
}
|
|
11109
11177
|
}
|
|
@@ -11120,7 +11188,7 @@ async function removeLegacyCodexComponentBin(linkPath, component, platform) {
|
|
|
11120
11188
|
}
|
|
11121
11189
|
if (!stat.isFile())
|
|
11122
11190
|
return;
|
|
11123
|
-
const content = await
|
|
11191
|
+
const content = await readFile11(linkPath, "utf8");
|
|
11124
11192
|
if (content.includes(COMMAND_SHIM_MARKER))
|
|
11125
11193
|
await rm10(linkPath, { force: true });
|
|
11126
11194
|
} catch (error) {
|
|
@@ -11154,10 +11222,10 @@ function isNodeErrorWithCode2(error) {
|
|
|
11154
11222
|
}
|
|
11155
11223
|
|
|
11156
11224
|
// ../src/install/codex-cache-runtime-wrapper.ts
|
|
11157
|
-
import { join as
|
|
11225
|
+
import { join as join18 } from "node:path";
|
|
11158
11226
|
var RUNTIME_WRAPPER_MARKER = "OMO_GENERATED_RUNTIME_WRAPPER";
|
|
11159
11227
|
function posixRuntimeWrapper(binName, cliPath, codexHome, binDir, nodeCliPath) {
|
|
11160
|
-
const ulwLoopBin = toPosixPath2(
|
|
11228
|
+
const ulwLoopBin = toPosixPath2(join18(binDir, "omo-ulw-loop"));
|
|
11161
11229
|
const nodeCli = escapePosixDoubleQuoted(toPosixPath2(nodeCliPath));
|
|
11162
11230
|
const escapedCliPath = escapePosixDoubleQuoted(toPosixPath2(cliPath));
|
|
11163
11231
|
const escapedCodexHome = escapePosixDoubleQuoted(toPosixPath2(codexHome));
|
|
@@ -11204,7 +11272,7 @@ function posixRuntimeWrapper(binName, cliPath, codexHome, binDir, nodeCliPath) {
|
|
|
11204
11272
|
`);
|
|
11205
11273
|
}
|
|
11206
11274
|
function windowsRuntimeWrapper(binName, cliPath, codexHome, binDir, nodeCliPath) {
|
|
11207
|
-
const ulwLoopBin =
|
|
11275
|
+
const ulwLoopBin = join18(binDir, "omo-ulw-loop.cmd");
|
|
11208
11276
|
return [
|
|
11209
11277
|
"@echo off",
|
|
11210
11278
|
`rem ${RUNTIME_WRAPPER_MARKER}`,
|
|
@@ -11270,23 +11338,23 @@ async function linkCachedPluginBins(input) {
|
|
|
11270
11338
|
return linked;
|
|
11271
11339
|
}
|
|
11272
11340
|
async function linkRootRuntimeBin(input) {
|
|
11273
|
-
const cliPath =
|
|
11341
|
+
const cliPath = join19(input.repoRoot, "dist", "cli", "index.js");
|
|
11274
11342
|
const platform = input.platform ?? process.platform;
|
|
11275
|
-
const legacyPath =
|
|
11343
|
+
const legacyPath = join19(input.binDir, platform === "win32" ? "omo.cmd" : "omo");
|
|
11276
11344
|
if (!await isFile2(cliPath)) {
|
|
11277
11345
|
await removeGeneratedRuntimeWrapper(legacyPath);
|
|
11278
11346
|
return null;
|
|
11279
11347
|
}
|
|
11280
11348
|
const binName = "omo-agent-toolkit";
|
|
11281
|
-
const nodeCliPath =
|
|
11349
|
+
const nodeCliPath = join19(input.repoRoot, "dist", "cli-node", "index.js");
|
|
11282
11350
|
await mkdir5(input.binDir, { recursive: true });
|
|
11283
11351
|
if (platform === "win32") {
|
|
11284
|
-
const linkPath =
|
|
11352
|
+
const linkPath = join19(input.binDir, `${binName}.cmd`);
|
|
11285
11353
|
await replaceRuntimeWrapper(linkPath, windowsRuntimeWrapper(binName, cliPath, input.codexHome, input.binDir, nodeCliPath));
|
|
11286
11354
|
await removeGeneratedRuntimeWrapper(legacyPath);
|
|
11287
11355
|
return { name: binName, path: linkPath, target: cliPath };
|
|
11288
11356
|
}
|
|
11289
|
-
const linkPath =
|
|
11357
|
+
const linkPath = join19(input.binDir, binName);
|
|
11290
11358
|
await replaceRuntimeWrapper(linkPath, posixRuntimeWrapper(binName, cliPath, input.codexHome, input.binDir, nodeCliPath));
|
|
11291
11359
|
await chmod2(linkPath, 493);
|
|
11292
11360
|
await removeGeneratedRuntimeWrapper(legacyPath);
|
|
@@ -11294,11 +11362,11 @@ async function linkRootRuntimeBin(input) {
|
|
|
11294
11362
|
}
|
|
11295
11363
|
async function linkCachedPluginBin(binDir, link, platform) {
|
|
11296
11364
|
if (platform === "win32") {
|
|
11297
|
-
const linkPath =
|
|
11365
|
+
const linkPath = join19(binDir, `${link.name}.cmd`);
|
|
11298
11366
|
await replaceCommandShim(linkPath, link.target);
|
|
11299
11367
|
return linkPath;
|
|
11300
11368
|
}
|
|
11301
|
-
const linkPath =
|
|
11369
|
+
const linkPath = join19(binDir, link.name);
|
|
11302
11370
|
await replaceSymlink(linkPath, link.target);
|
|
11303
11371
|
return linkPath;
|
|
11304
11372
|
}
|
|
@@ -11319,21 +11387,21 @@ async function discoverPackageBins(root) {
|
|
|
11319
11387
|
async function collectPackageBins(directory, root, links) {
|
|
11320
11388
|
const entries = await readdir4(directory, { withFileTypes: true });
|
|
11321
11389
|
if (entries.some((entry) => entry.isFile() && entry.name === "package.json")) {
|
|
11322
|
-
await appendPackageBinLinks(
|
|
11390
|
+
await appendPackageBinLinks(join19(directory, "package.json"), directory, root, links);
|
|
11323
11391
|
}
|
|
11324
11392
|
for (const entry of entries) {
|
|
11325
11393
|
if (!entry.isDirectory())
|
|
11326
11394
|
continue;
|
|
11327
11395
|
if (entry.name === "node_modules" || entry.name === ".git" || entry.name === "dist")
|
|
11328
11396
|
continue;
|
|
11329
|
-
const childPath =
|
|
11397
|
+
const childPath = join19(directory, entry.name);
|
|
11330
11398
|
if (!childPath.startsWith(root))
|
|
11331
11399
|
continue;
|
|
11332
11400
|
await collectPackageBins(childPath, root, links);
|
|
11333
11401
|
}
|
|
11334
11402
|
}
|
|
11335
11403
|
async function appendPackageBinLinks(packageJsonPath, packageRoot, root, links) {
|
|
11336
|
-
const packageJson = JSON.parse(await
|
|
11404
|
+
const packageJson = JSON.parse(await readFile12(packageJsonPath, "utf8"));
|
|
11337
11405
|
if (!isPlainRecord(packageJson))
|
|
11338
11406
|
return;
|
|
11339
11407
|
const packageName = packageJson.name;
|
|
@@ -11409,7 +11477,7 @@ async function removeGeneratedRuntimeWrapper(path) {
|
|
|
11409
11477
|
}
|
|
11410
11478
|
async function readGeneratedWrapperContent(path) {
|
|
11411
11479
|
try {
|
|
11412
|
-
return await
|
|
11480
|
+
return await readFile12(path, "utf8");
|
|
11413
11481
|
} catch (error) {
|
|
11414
11482
|
if (isNodeErrorWithCode(error) && (error.code === "ENOENT" || error.code === "EISDIR"))
|
|
11415
11483
|
return "";
|
|
@@ -11423,7 +11491,7 @@ async function existingNonRuntimeWrapper(path) {
|
|
|
11423
11491
|
return false;
|
|
11424
11492
|
if (!stat.isFile())
|
|
11425
11493
|
return true;
|
|
11426
|
-
const content = await
|
|
11494
|
+
const content = await readFile12(path, "utf8");
|
|
11427
11495
|
return !content.includes(RUNTIME_WRAPPER_MARKER);
|
|
11428
11496
|
} catch (error) {
|
|
11429
11497
|
if (isNodeErrorWithCode(error) && error.code === "ENOENT")
|
|
@@ -11436,7 +11504,7 @@ async function existingNonShim(path) {
|
|
|
11436
11504
|
const stat = await lstat9(path);
|
|
11437
11505
|
if (!stat.isFile())
|
|
11438
11506
|
return true;
|
|
11439
|
-
const content = await
|
|
11507
|
+
const content = await readFile12(path, "utf8");
|
|
11440
11508
|
if (content.includes(COMMAND_SHIM_MARKER))
|
|
11441
11509
|
return false;
|
|
11442
11510
|
throw new Error(`${path} already exists and is not a generated command shim`);
|
|
@@ -11908,90 +11976,6 @@ function isRootSetting(line, key) {
|
|
|
11908
11976
|
return match?.[1] === key;
|
|
11909
11977
|
}
|
|
11910
11978
|
|
|
11911
|
-
// ../src/install/codex-model-catalog.ts
|
|
11912
|
-
import { readFile as readFile12 } from "node:fs/promises";
|
|
11913
|
-
import { join as join19 } from "node:path";
|
|
11914
|
-
var FALLBACK_CODEX_MODEL_CATALOG = {
|
|
11915
|
-
current: {
|
|
11916
|
-
model: LATEST_MODEL_BY_FAMILY.gptAstra,
|
|
11917
|
-
modelContextWindow: 600000,
|
|
11918
|
-
modelReasoningEffort: "high",
|
|
11919
|
-
planModeReasoningEffort: "xhigh"
|
|
11920
|
-
},
|
|
11921
|
-
managedProfiles: [
|
|
11922
|
-
{
|
|
11923
|
-
model: "gpt-5.5",
|
|
11924
|
-
modelContextWindow: 400000,
|
|
11925
|
-
modelReasoningEffort: "high",
|
|
11926
|
-
planModeReasoningEffort: "xhigh"
|
|
11927
|
-
},
|
|
11928
|
-
{
|
|
11929
|
-
model: "gpt-5.5",
|
|
11930
|
-
modelContextWindow: 1e6,
|
|
11931
|
-
modelReasoningEffort: "high",
|
|
11932
|
-
planModeReasoningEffort: "xhigh"
|
|
11933
|
-
},
|
|
11934
|
-
{ model: "gpt-5.5", modelContextWindow: 272000 },
|
|
11935
|
-
{
|
|
11936
|
-
model: "gpt-5.6-sol",
|
|
11937
|
-
modelContextWindow: 650000,
|
|
11938
|
-
modelReasoningEffort: "high",
|
|
11939
|
-
planModeReasoningEffort: "xhigh"
|
|
11940
|
-
}
|
|
11941
|
-
]
|
|
11942
|
-
};
|
|
11943
|
-
async function readCodexModelCatalog(codexPackageRoot) {
|
|
11944
|
-
const catalogPath = join19(codexPackageRoot, "plugin", "model-catalog.json");
|
|
11945
|
-
try {
|
|
11946
|
-
const parsed = JSON.parse(await readFile12(catalogPath, "utf8"));
|
|
11947
|
-
return parseCodexModelCatalog(parsed) ?? FALLBACK_CODEX_MODEL_CATALOG;
|
|
11948
|
-
} catch (error) {
|
|
11949
|
-
if (error instanceof Error)
|
|
11950
|
-
return FALLBACK_CODEX_MODEL_CATALOG;
|
|
11951
|
-
throw error;
|
|
11952
|
-
}
|
|
11953
|
-
}
|
|
11954
|
-
function parseCodexModelCatalog(value) {
|
|
11955
|
-
if (!isPlainRecord(value))
|
|
11956
|
-
return null;
|
|
11957
|
-
const current = value["current"];
|
|
11958
|
-
const managedProfiles = value["managedProfiles"];
|
|
11959
|
-
if (!isPlainRecord(current) || !Array.isArray(managedProfiles))
|
|
11960
|
-
return null;
|
|
11961
|
-
const model = current["model"];
|
|
11962
|
-
const modelContextWindow = current["model_context_window"];
|
|
11963
|
-
const modelReasoningEffort = current["model_reasoning_effort"];
|
|
11964
|
-
const planModeReasoningEffort = current["plan_mode_reasoning_effort"];
|
|
11965
|
-
if (typeof model !== "string" || typeof modelContextWindow !== "number" || typeof modelReasoningEffort !== "string" || typeof planModeReasoningEffort !== "string") {
|
|
11966
|
-
return null;
|
|
11967
|
-
}
|
|
11968
|
-
const parsedManagedProfiles = [];
|
|
11969
|
-
for (const profile of managedProfiles) {
|
|
11970
|
-
if (!isPlainRecord(profile))
|
|
11971
|
-
return null;
|
|
11972
|
-
const match = profile["match"];
|
|
11973
|
-
if (!isPlainRecord(match))
|
|
11974
|
-
return null;
|
|
11975
|
-
parsedManagedProfiles.push(parseProfileMatch(match));
|
|
11976
|
-
}
|
|
11977
|
-
return {
|
|
11978
|
-
current: { model, modelContextWindow, modelReasoningEffort, planModeReasoningEffort },
|
|
11979
|
-
managedProfiles: parsedManagedProfiles
|
|
11980
|
-
};
|
|
11981
|
-
}
|
|
11982
|
-
function parseProfileMatch(match) {
|
|
11983
|
-
const profile = {};
|
|
11984
|
-
if (typeof match["model"] === "string")
|
|
11985
|
-
profile.model = match["model"];
|
|
11986
|
-
if (typeof match["model_context_window"] === "number")
|
|
11987
|
-
profile.modelContextWindow = match["model_context_window"];
|
|
11988
|
-
if (typeof match["model_reasoning_effort"] === "string")
|
|
11989
|
-
profile.modelReasoningEffort = match["model_reasoning_effort"];
|
|
11990
|
-
if (typeof match["plan_mode_reasoning_effort"] === "string")
|
|
11991
|
-
profile.planModeReasoningEffort = match["plan_mode_reasoning_effort"];
|
|
11992
|
-
return profile;
|
|
11993
|
-
}
|
|
11994
|
-
|
|
11995
11979
|
// ../src/install/codex-multi-agent-mode-config.ts
|
|
11996
11980
|
var CODEX_MULTI_AGENT_MODE_KEY = "multi_agent_mode";
|
|
11997
11981
|
function removeUnsupportedCodexMultiAgentModeConfig(config) {
|