holycodex 0.8.1-dev.29751792539.1 → 0.8.1
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.js +25 -57
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -4087,7 +4087,7 @@ async function installCodexSlimEdit(input, env = process.env) {
|
|
|
4087
4087
|
}
|
|
4088
4088
|
//#endregion
|
|
4089
4089
|
//#region packages/cli/src/catalog.ts
|
|
4090
|
-
var VERSION = "0.8.1
|
|
4090
|
+
var VERSION = "0.8.1";
|
|
4091
4091
|
var SKILLS = [
|
|
4092
4092
|
"ast-grep",
|
|
4093
4093
|
"caveman",
|
|
@@ -4161,12 +4161,7 @@ var RoutingPresetSchema = strictObject({
|
|
|
4161
4161
|
worker: ModelRouteSchema
|
|
4162
4162
|
}),
|
|
4163
4163
|
usage: strictObject({
|
|
4164
|
-
|
|
4165
|
-
literal(0),
|
|
4166
|
-
literal(1),
|
|
4167
|
-
literal(2),
|
|
4168
|
-
literal(3)
|
|
4169
|
-
]),
|
|
4164
|
+
maxThreads: union([literal(1), literal(2)]),
|
|
4170
4165
|
maxDepth: literal(1)
|
|
4171
4166
|
})
|
|
4172
4167
|
});
|
|
@@ -4200,7 +4195,7 @@ var MODEL_ROUTING_PLANS = ModelRoutingPlansSchema.parse({
|
|
|
4200
4195
|
}
|
|
4201
4196
|
},
|
|
4202
4197
|
usage: {
|
|
4203
|
-
|
|
4198
|
+
maxThreads: 1,
|
|
4204
4199
|
maxDepth: 1
|
|
4205
4200
|
}
|
|
4206
4201
|
},
|
|
@@ -4224,14 +4219,14 @@ var MODEL_ROUTING_PLANS = ModelRoutingPlansSchema.parse({
|
|
|
4224
4219
|
}
|
|
4225
4220
|
},
|
|
4226
4221
|
usage: {
|
|
4227
|
-
|
|
4222
|
+
maxThreads: 2,
|
|
4228
4223
|
maxDepth: 1
|
|
4229
4224
|
}
|
|
4230
4225
|
},
|
|
4231
4226
|
plus: {
|
|
4232
4227
|
root: {
|
|
4233
4228
|
model: "gpt-5.6-sol",
|
|
4234
|
-
reasoningEffort: "
|
|
4229
|
+
reasoningEffort: "medium"
|
|
4235
4230
|
},
|
|
4236
4231
|
agents: {
|
|
4237
4232
|
explorer: {
|
|
@@ -4248,7 +4243,7 @@ var MODEL_ROUTING_PLANS = ModelRoutingPlansSchema.parse({
|
|
|
4248
4243
|
}
|
|
4249
4244
|
},
|
|
4250
4245
|
usage: {
|
|
4251
|
-
|
|
4246
|
+
maxThreads: 2,
|
|
4252
4247
|
maxDepth: 1
|
|
4253
4248
|
}
|
|
4254
4249
|
},
|
|
@@ -4272,7 +4267,7 @@ var MODEL_ROUTING_PLANS = ModelRoutingPlansSchema.parse({
|
|
|
4272
4267
|
}
|
|
4273
4268
|
},
|
|
4274
4269
|
usage: {
|
|
4275
|
-
|
|
4270
|
+
maxThreads: 2,
|
|
4276
4271
|
maxDepth: 1
|
|
4277
4272
|
}
|
|
4278
4273
|
},
|
|
@@ -4296,7 +4291,7 @@ var MODEL_ROUTING_PLANS = ModelRoutingPlansSchema.parse({
|
|
|
4296
4291
|
}
|
|
4297
4292
|
},
|
|
4298
4293
|
usage: {
|
|
4299
|
-
|
|
4294
|
+
maxThreads: 2,
|
|
4300
4295
|
maxDepth: 1
|
|
4301
4296
|
}
|
|
4302
4297
|
},
|
|
@@ -4320,7 +4315,7 @@ var MODEL_ROUTING_PLANS = ModelRoutingPlansSchema.parse({
|
|
|
4320
4315
|
}
|
|
4321
4316
|
},
|
|
4322
4317
|
usage: {
|
|
4323
|
-
|
|
4318
|
+
maxThreads: 2,
|
|
4324
4319
|
maxDepth: 1
|
|
4325
4320
|
}
|
|
4326
4321
|
}
|
|
@@ -4671,7 +4666,6 @@ var END = "# <<< holycodex managed <<<";
|
|
|
4671
4666
|
var ORIGINAL_ROOT = "# holycodex original root: ";
|
|
4672
4667
|
var ORIGINAL_TABLE_KEY = "# holycodex original table key: ";
|
|
4673
4668
|
var PLAN_PREFIX = "# holycodex plan: ";
|
|
4674
|
-
var MAX_SUBAGENTS_PREFIX = "# holycodex max-subagents: ";
|
|
4675
4669
|
var OLD_NAMESPACES = [
|
|
4676
4670
|
"marketplaces.sisyphuslabs",
|
|
4677
4671
|
"plugins.\"omo@sisyphuslabs\"",
|
|
@@ -4749,16 +4743,6 @@ function readManagedPlan(input) {
|
|
|
4749
4743
|
const value = new RegExp(`^${PLAN_PREFIX}(.+)$`, "m").exec(input)?.[1]?.trim();
|
|
4750
4744
|
return PLAN_NAMES.find((plan) => plan === value);
|
|
4751
4745
|
}
|
|
4752
|
-
/** Reads an explicit managed direct-subagent override. */
|
|
4753
|
-
function readManagedMaxSubagents(input) {
|
|
4754
|
-
const raw = new RegExp(`^${MAX_SUBAGENTS_PREFIX}(.*)$`, "m").exec(input)?.[1]?.trim();
|
|
4755
|
-
if (raw === void 0) return { configured: false };
|
|
4756
|
-
if (!/^[0-3]$/.test(raw)) return { configured: true };
|
|
4757
|
-
return {
|
|
4758
|
-
configured: true,
|
|
4759
|
-
value: Number(raw)
|
|
4760
|
-
};
|
|
4761
|
-
}
|
|
4762
4746
|
/** Identifies explicit Root route overrides preserved from active managed configuration. */
|
|
4763
4747
|
function readPreservedRootOverrides(input) {
|
|
4764
4748
|
const managedRoot = new RegExp(`^${START}\\r?\\n([\\s\\S]*?)^${END}\\r?$`, "m").exec(input)?.[1];
|
|
@@ -4813,7 +4797,7 @@ function mergedStatusLine(original) {
|
|
|
4813
4797
|
return `[${items.map((item) => JSON.stringify(item)).join(", ")}]`;
|
|
4814
4798
|
}
|
|
4815
4799
|
/** Installs config. */
|
|
4816
|
-
function installConfig(input, mode, _platform, plan = DEFAULT_PLAN
|
|
4800
|
+
function installConfig(input, mode, _platform, plan = DEFAULT_PLAN) {
|
|
4817
4801
|
const base = preserveManagedRootPreferences(input, removeLegacyOmo(removeManaged(input)));
|
|
4818
4802
|
const firstTable = base.search(/^\s*\[/m);
|
|
4819
4803
|
const root = firstTable < 0 ? base : base.slice(0, firstTable);
|
|
@@ -4830,20 +4814,17 @@ function installConfig(input, mode, _platform, plan = DEFAULT_PLAN, maxSubagents
|
|
|
4830
4814
|
const hasEffort = /^\s*model_reasoning_effort\s*=/m.test(preservedRoot);
|
|
4831
4815
|
const hasVerbosity = /^\s*model_verbosity\s*=/m.test(preservedRoot);
|
|
4832
4816
|
const rootRoute = MODEL_ROUTING_PLANS[plan].root;
|
|
4833
|
-
const effectiveMaxSubagents = maxSubagents ?? MODEL_ROUTING_PLANS[plan].usage.maxSubagents;
|
|
4834
4817
|
const model = hasModel ? "" : `model = "${rootRoute.model}"\n`;
|
|
4835
4818
|
const effort = hasEffort ? "" : `model_reasoning_effort = "${rootRoute.reasoningEffort}"\n`;
|
|
4836
4819
|
const verbosity = hasVerbosity ? "" : "model_verbosity = \"low\"\n";
|
|
4837
4820
|
const approval = mode === "default" ? "on-request" : "never";
|
|
4838
4821
|
const sandbox = mode === "dangerous" ? "danger-full-access" : "workspace-write";
|
|
4839
|
-
|
|
4840
|
-
const preserved = preservedRoot ? `${preservedRoot}\n` : "";
|
|
4841
|
-
let configured = `${`${START}\n${PLAN_PREFIX}${plan}\n${maxSubagents === void 0 ? "" : `${MAX_SUBAGENTS_PREFIX}${maxSubagents}\n`}${original}${model}${effort}${verbosity}${preserved}approval_policy = "${approval}"\nsandbox_mode = "${sandbox}"\nstatus_line = ${mergedStatusLine(controlled[3])}\n${END}`}${tables ? `\n\n${tables}` : ""}`;
|
|
4822
|
+
let configured = `${`${START}\n${PLAN_PREFIX}${plan}\n${originalRoot ? `${ORIGINAL_ROOT}${Buffer.from(originalRoot).toString("base64")}\n` : ""}${model}${effort}${verbosity}${preservedRoot ? `${preservedRoot}\n` : ""}approval_policy = "${approval}"\nsandbox_mode = "${sandbox}"\nstatus_line = ${mergedStatusLine(controlled[3])}\n${END}`}${tables ? `\n\n${tables}` : ""}`;
|
|
4842
4823
|
configured = injectTableKey(configured, "features", "default_mode_request_user_input", "true");
|
|
4843
4824
|
configured = injectTableKey(configured, "features", "multi_agent", "true");
|
|
4844
4825
|
configured = injectTableKey(configured, "features", "multi_agent_v2", "true");
|
|
4845
4826
|
const usage = MODEL_ROUTING_PLANS[plan].usage;
|
|
4846
|
-
configured = injectTableKey(configured, "agents", "max_threads", String(
|
|
4827
|
+
configured = injectTableKey(configured, "agents", "max_threads", String(usage.maxThreads));
|
|
4847
4828
|
configured = injectTableKey(configured, "agents", "max_depth", String(usage.maxDepth));
|
|
4848
4829
|
if (mode !== "dangerous") configured = injectTableKey(configured, "sandbox_workspace_write", "network_access", "true");
|
|
4849
4830
|
for (const agent of AGENTS) configured = injectTableKey(configured, `agents.${agent}`, "config_file", `"holycodex/agents/${agent}.toml"`);
|
|
@@ -4956,13 +4937,6 @@ async function doctor(home = process.env.CODEX_HOME ?? join(homedir(), ".codex")
|
|
|
4956
4937
|
const pluginRoot = join(home, "plugins", "cache", "holycodex", "holycodex", VERSION);
|
|
4957
4938
|
const agentRoot = join(home, "holycodex", "agents");
|
|
4958
4939
|
const configPath = join(home, "config.toml");
|
|
4959
|
-
let config = "";
|
|
4960
|
-
let configAvailable = true;
|
|
4961
|
-
try {
|
|
4962
|
-
config = await readFile(configPath, "utf8");
|
|
4963
|
-
} catch {
|
|
4964
|
-
configAvailable = false;
|
|
4965
|
-
}
|
|
4966
4940
|
const missing = await missingFiles(pluginRoot, [
|
|
4967
4941
|
".codex-plugin/plugin.json",
|
|
4968
4942
|
".mcp.json",
|
|
@@ -5023,16 +4997,19 @@ async function doctor(home = process.env.CODEX_HOME ?? join(homedir(), ".codex")
|
|
|
5023
4997
|
const gitBash = runtime.gitBash();
|
|
5024
4998
|
checks.push(gitBash.found ? check("git-bash", "ok", "git-bash-ready", `Git Bash: ${gitBash.path ?? "configured"}.`) : check("git-bash", "error", "missing-git-bash", "Git Bash is required on Windows but unavailable.", gitBash.installHint));
|
|
5025
4999
|
} else checks.push(check("git-bash", "ok", "git-bash-not-applicable", "Git Bash is not applicable on this platform."));
|
|
5026
|
-
|
|
5000
|
+
let config = "";
|
|
5001
|
+
try {
|
|
5002
|
+
config = await readFile(configPath, "utf8");
|
|
5003
|
+
} catch {
|
|
5004
|
+
checks.push(check("codex-config", "error", "missing-codex-config", `Missing ${configPath}.`, "Run holycodex install."));
|
|
5005
|
+
}
|
|
5027
5006
|
const mode = autonomy(config);
|
|
5028
5007
|
const plan = readManagedPlan(config);
|
|
5029
5008
|
checks.push(plan === void 0 ? check("routing-plan", "error", "routing-plan-missing", "No managed model routing plan is recorded.", "Rerun holycodex install.") : check("routing-plan", "ok", "routing-plan-ready", `Model routing plan ${plan} is active.`));
|
|
5030
5009
|
const preset = plan === void 0 ? void 0 : MODEL_ROUTING_PLANS[plan];
|
|
5031
|
-
const managedMaxSubagents = readManagedMaxSubagents(config);
|
|
5032
|
-
const expectedMaxSubagents = managedMaxSubagents.configured ? managedMaxSubagents.value : preset?.usage.maxSubagents;
|
|
5033
5010
|
const rootOverrides = readPreservedRootOverrides(config);
|
|
5034
5011
|
checks.push(preset !== void 0 && rootTomlString(config, "model") === preset.root.model && rootTomlString(config, "model_reasoning_effort") === preset.root.reasoningEffort ? check("root-model", "ok", "root-model-ready", "Root model matches the selected routing plan.") : rootOverrides.model || rootOverrides.reasoningEffort ? check("root-model", "ok", "root-model-override", "Root model uses an intentionally preserved explicit override.") : check("root-model", "error", "root-model-stale", "Root model configuration does not match the selected routing plan.", "Reinstall HolyCodex."));
|
|
5035
|
-
checks.push(preset === void 0 ||
|
|
5012
|
+
checks.push(preset === void 0 || tableInteger(config, "agents", "max_threads") !== preset.usage.maxThreads || tableInteger(config, "agents", "max_depth") !== preset.usage.maxDepth ? check("agent-usage", "error", "agent-usage-stale", "Agent concurrency configuration does not match the selected routing plan.", "Reinstall HolyCodex.") : check("agent-usage", "ok", "agent-usage-ready", "Agent concurrency matches the selected routing plan."));
|
|
5036
5013
|
checks.push(mode === "unknown" ? check("autonomy", "error", "invalid-autonomy-config", "Approval, sandbox, and network settings do not match a supported mode.", "Rerun install with the intended autonomy flag.") : mode === "dangerous" ? check("autonomy", "warning", "dangerous-autonomy", "Explicit dangerous autonomy is active; workspace containment is removed.") : check("autonomy", "ok", `${mode}-ready`, mode === "safe-workspace" ? "Safe workspace autonomy is active." : "Approval-free workspace autonomy is active."));
|
|
5037
5014
|
checks.push(tableBoolean(config, "features", "default_mode_request_user_input") === true ? check("user-input", "ok", "user-input-ready", "default_mode_request_user_input is enabled.") : check("user-input", "error", "user-input-disabled", "default_mode_request_user_input is not enabled.", "Rerun holycodex install."));
|
|
5038
5015
|
checks.push(rootTomlStringArray(config, "status_line")?.includes("context-remaining") === true ? check("context-visibility", "warning", "context-visible-support-unverified", "status_line includes context-remaining. Current official Codex config documents this item, but publishes no minimum compatible Codex version.") : check("context-visibility", "error", "context-hidden", "status_line does not include context-remaining.", "Rerun holycodex install."));
|
|
@@ -5149,8 +5126,7 @@ async function install(options, runtime = defaultRuntime) {
|
|
|
5149
5126
|
].filter((path) => path !== void 0);
|
|
5150
5127
|
const existingConfig = await readText(target.config);
|
|
5151
5128
|
const previousPlan = readManagedPlan(existingConfig);
|
|
5152
|
-
const
|
|
5153
|
-
const config = installConfig(existingConfig, options.autonomy, runtime.platform, plan, options.maxSubagents);
|
|
5129
|
+
const config = installConfig(existingConfig, options.autonomy, runtime.platform, plan);
|
|
5154
5130
|
await atomicWrite(target.config, config);
|
|
5155
5131
|
await rm(target.marketplaceCache, {
|
|
5156
5132
|
recursive: true,
|
|
@@ -5182,8 +5158,7 @@ async function install(options, runtime = defaultRuntime) {
|
|
|
5182
5158
|
...removedLegacy
|
|
5183
5159
|
],
|
|
5184
5160
|
backups,
|
|
5185
|
-
plan
|
|
5186
|
-
maxSubagents
|
|
5161
|
+
plan
|
|
5187
5162
|
};
|
|
5188
5163
|
}
|
|
5189
5164
|
async function readAgentPreferences(root, previousPlan) {
|
|
@@ -5295,13 +5270,13 @@ function renderHelp(version, color) {
|
|
|
5295
5270
|
const title = paint(color, `${BOLD}${CYAN}`, `HOLYCODEX ${version}`);
|
|
5296
5271
|
const section = (text) => paint(color, BOLD, text);
|
|
5297
5272
|
const muted = (text) => paint(color, DIM, text);
|
|
5298
|
-
return `${title}\n${muted("Lean Codex toolkit installer and doctor")}\n\n${section("USAGE")}\n holycodex <command> [options]\n\n${section("COMMANDS")}\n install Install or update HolyCodex\n cleanup Remove HolyCodex-owned state\n doctor Diagnose installation and runtime\n\n${section("OPTIONS")}\n --plan <plan> Model routing plan for install: ${PLAN_HELP}\n Default: ${DEFAULT_PLAN}\n
|
|
5273
|
+
return `${title}\n${muted("Lean Codex toolkit installer and doctor")}\n\n${section("USAGE")}\n holycodex <command> [options]\n\n${section("COMMANDS")}\n install Install or update HolyCodex\n cleanup Remove HolyCodex-owned state\n doctor Diagnose installation and runtime\n\n${section("OPTIONS")}\n --plan <plan> Model routing plan for install: ${PLAN_HELP}\n Default: ${DEFAULT_PLAN}\n -h, --help Show help\n -v, --version Show version\n --no-tui Accepted; commands remain noninteractive\n --codex-autonomous Never ask; keep workspace sandbox\n --no-codex-autonomous Safe interactive defaults\n --dangerous-codex-autonomous Never ask; disable filesystem sandbox\n --json Print machine-readable output\n`;
|
|
5299
5274
|
}
|
|
5300
5275
|
/** Renders install-specific model plan and option help. */
|
|
5301
5276
|
function renderInstallHelp(version, color) {
|
|
5302
5277
|
const title = paint(color, `${BOLD}${CYAN}`, `HOLYCODEX ${version}`);
|
|
5303
5278
|
const section = (text) => paint(color, BOLD, text);
|
|
5304
|
-
return `${title}\n\n${section("Usage:")}\n holycodex install [options]\n\n${section("Options:")}\n --plan <plan> Model routing plan: ${PLAN_HELP}\n Default: ${DEFAULT_PLAN}\n --
|
|
5279
|
+
return `${title}\n\n${section("Usage:")}\n holycodex install [options]\n\n${section("Options:")}\n --plan <plan> Model routing plan: ${PLAN_HELP}\n Default: ${DEFAULT_PLAN}\n --json Print machine-readable output\n --no-tui Accepted; install remains noninteractive\n --codex-autonomous Never ask; keep workspace sandbox\n --no-codex-autonomous Safe interactive defaults\n --dangerous-codex-autonomous Never ask; disable filesystem sandbox\n -h, --help Show help\n\nPlans provide increasing expected model usage and capability.\n\n${section("Examples:")}\n bunx holycodex install\n bunx holycodex install --plan go\n bunx holycodex install --plan plus-low\n bunx holycodex install --plan plus-high\n bunx holycodex install --plan pro-5x\n bunx holycodex install --plan pro-20x\n`;
|
|
5305
5280
|
}
|
|
5306
5281
|
/** Renders error. */
|
|
5307
5282
|
function renderError(message, color) {
|
|
@@ -5329,7 +5304,7 @@ async function main() {
|
|
|
5329
5304
|
const args = process$1.argv.slice(2);
|
|
5330
5305
|
const stdoutColor = supportsColor(process$1.stdout.isTTY, process$1.env.NO_COLOR);
|
|
5331
5306
|
const stderrColor = supportsColor(process$1.stderr.isTTY, process$1.env.NO_COLOR);
|
|
5332
|
-
const command = args.find((arg, index) => !arg.startsWith("-") && args[index - 1] !== "--plan"
|
|
5307
|
+
const command = args.find((arg, index) => !arg.startsWith("-") && args[index - 1] !== "--plan");
|
|
5333
5308
|
if (args.includes("--help") || args.includes("-h") || args.length === 0) {
|
|
5334
5309
|
process$1.stdout.write(command === "install" ? renderInstallHelp(VERSION, stdoutColor) : renderHelp(VERSION, stdoutColor));
|
|
5335
5310
|
return;
|
|
@@ -5345,12 +5320,6 @@ async function main() {
|
|
|
5345
5320
|
const parsedPlan = PlanNameSchema.safeParse(planValue);
|
|
5346
5321
|
if (!parsedPlan.success) throw new Error(`Unknown plan: ${planValue}. Valid plans: ${PLAN_NAMES.join(", ")}.`);
|
|
5347
5322
|
const plan = parsedPlan.data;
|
|
5348
|
-
if (args.flatMap((arg, index) => arg === "--max-subagents" ? [index] : []).length > 1) throw new Error("--max-subagents may be specified only once.");
|
|
5349
|
-
const maxSubagentsIndex = args.indexOf("--max-subagents");
|
|
5350
|
-
const maxSubagentsValue = maxSubagentsIndex < 0 ? void 0 : args[maxSubagentsIndex + 1];
|
|
5351
|
-
if (maxSubagentsIndex >= 0 && (maxSubagentsValue === void 0 || maxSubagentsValue.startsWith("-") || maxSubagentsValue === command)) throw new Error("Missing --max-subagents value. Valid range: 0-3.");
|
|
5352
|
-
if (maxSubagentsValue !== void 0 && !/^[0-3]$/.test(maxSubagentsValue)) throw new Error(`Invalid --max-subagents value: ${maxSubagentsValue}. Valid range: 0-3.`);
|
|
5353
|
-
const maxSubagents = maxSubagentsValue === void 0 ? void 0 : Number(maxSubagentsValue);
|
|
5354
5323
|
const autonomyFlags = args.filter((arg) => [
|
|
5355
5324
|
"--codex-autonomous",
|
|
5356
5325
|
"--no-codex-autonomous",
|
|
@@ -5364,8 +5333,7 @@ async function main() {
|
|
|
5364
5333
|
const options = {
|
|
5365
5334
|
autonomy: args.includes("--dangerous-codex-autonomous") ? "dangerous" : args.includes("--codex-autonomous") ? "autonomous" : "default",
|
|
5366
5335
|
json: args.includes("--json"),
|
|
5367
|
-
plan
|
|
5368
|
-
...maxSubagents === void 0 ? {} : { maxSubagents }
|
|
5336
|
+
plan
|
|
5369
5337
|
};
|
|
5370
5338
|
if (command === "doctor") {
|
|
5371
5339
|
const result = await doctor();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "holycodex",
|
|
3
|
-
"version": "0.8.1
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Lean Codex-only agent toolkit installer and doctor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agents",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"prepack": "vp run --workspace-root build"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@holycodex/plugin": "0.8.1
|
|
42
|
+
"@holycodex/plugin": "0.8.1",
|
|
43
43
|
"zod": "^4.4.3"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|