holycodex 0.7.0-dev.29548214169.1 → 0.7.0-dev.29548804255.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.
Files changed (2) hide show
  1. package/dist/cli.js +34 -4
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -7,7 +7,7 @@ import { existsSync } from "node:fs";
7
7
  import { pluginRoot } from "@holycodex/plugin";
8
8
  import { Buffer } from "node:buffer";
9
9
  //#region packages/cli/src/catalog.ts
10
- var VERSION = "0.7.0-dev.29548214169.1";
10
+ var VERSION = "0.7.0-dev.29548804255.1";
11
11
  var SKILLS = [
12
12
  "ast-grep",
13
13
  "caveman",
@@ -463,6 +463,11 @@ var START = "# >>> holycodex managed >>>";
463
463
  var END = "# <<< holycodex managed <<<";
464
464
  var ORIGINAL_ROOT = "# holycodex original root: ";
465
465
  var ORIGINAL_TABLE_KEY = "# holycodex original table key: ";
466
+ var ROOT_PREFERENCES = [
467
+ ["model", `model = "${ROOT_MODEL.model}"`],
468
+ ["model_reasoning_effort", `model_reasoning_effort = "${ROOT_MODEL.reasoningEffort}"`],
469
+ ["model_verbosity", "model_verbosity = \"low\""]
470
+ ];
466
471
  var OLD_NAMESPACES = [
467
472
  "marketplaces.sisyphuslabs",
468
473
  "plugins.\"omo@sisyphuslabs\"",
@@ -533,14 +538,35 @@ function rootValue(input, key) {
533
538
  function removeRootValue(input, value) {
534
539
  return value === void 0 ? input : input.replace(value, "");
535
540
  }
541
+ function preserveManagedRootPreferences(input, base) {
542
+ const managedRoot = new RegExp(`^${START}\\r?\\n([\\s\\S]*?)^${END}\\r?$`, "m").exec(input)?.[1];
543
+ if (managedRoot === void 0) return base;
544
+ const firstTable = base.search(/^\s*\[/m);
545
+ const root = firstTable < 0 ? base : base.slice(0, firstTable);
546
+ const tables = firstTable < 0 ? "" : base.slice(firstTable);
547
+ let updatedRoot = root.trim();
548
+ for (const [key, fallback] of ROOT_PREFERENCES) {
549
+ const live = rootValue(managedRoot, key)?.trim();
550
+ if (live === void 0 || live === (rootValue(root, key)?.trim() ?? fallback)) continue;
551
+ updatedRoot = removeRootValue(updatedRoot, rootValue(updatedRoot, key)).trim();
552
+ updatedRoot = `${updatedRoot}${updatedRoot ? "\n" : ""}${live}`;
553
+ }
554
+ if (updatedRoot === root.trim()) return base;
555
+ return `${updatedRoot}${tables ? `\n${tables.trimStart()}` : ""}`;
556
+ }
536
557
  function mergedStatusLine(original) {
537
558
  if (original === void 0) return "[\"model-with-reasoning\", \"context-remaining\", \"current-dir\"]";
538
- const items = [...original.slice(original.indexOf("=") + 1).matchAll(/"((?:\\.|[^"\\])*)"/g)].map((match) => JSON.parse(`"${match[1]}"`));
559
+ const items = [...original.slice(original.indexOf("=") + 1).matchAll(/"((?:\\.|[^"\\])*)"|'([^']*)'/g)].map((match) => {
560
+ if (match[1] === void 0) return match[2] ?? "";
561
+ const parsed = JSON.parse(`"${match[1]}"`);
562
+ if (typeof parsed !== "string") throw new Error("Invalid status-line string");
563
+ return parsed;
564
+ });
539
565
  if (!items.includes("context-remaining")) items.push("context-remaining");
540
566
  return `[${items.map((item) => JSON.stringify(item)).join(", ")}]`;
541
567
  }
542
568
  function installConfig(input, mode, _platform) {
543
- const base = removeLegacyOmo(removeManaged(input));
569
+ const base = preserveManagedRootPreferences(input, removeLegacyOmo(removeManaged(input)));
544
570
  const firstTable = base.search(/^\s*\[/m);
545
571
  const root = firstTable < 0 ? base : base.slice(0, firstTable);
546
572
  const tables = firstTable < 0 ? "" : base.slice(firstTable);
@@ -818,7 +844,11 @@ async function main() {
818
844
  "--no-codex-autonomous",
819
845
  "--dangerous-codex-autonomous"
820
846
  ].includes(arg));
821
- if (autonomyFlags.length > 1) throw new Error(`Conflicting autonomy flags: ${autonomyFlags.join(", ")}`);
847
+ if (autonomyFlags.length > 1) {
848
+ process$1.stderr.write(renderError(`Conflicting autonomy flags: ${autonomyFlags.join(", ")}`, stderrColor));
849
+ process$1.exitCode = 1;
850
+ return;
851
+ }
822
852
  const options = {
823
853
  autonomy: args.includes("--dangerous-codex-autonomous") ? "dangerous" : args.includes("--codex-autonomous") ? "autonomous" : "default",
824
854
  json: args.includes("--json")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "holycodex",
3
- "version": "0.7.0-dev.29548214169.1",
3
+ "version": "0.7.0-dev.29548804255.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.7.0-dev.29548214169.1"
42
+ "@holycodex/plugin": "0.7.0-dev.29548804255.1"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=20"