holycodex 0.13.6 → 0.13.7

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 +266 -48
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import process$1 from "node:process";
2
2
  import { access, copyFile, cp, lstat, mkdir, mkdtemp, readFile, readdir, readlink, rename, rm, stat, symlink, writeFile } from "node:fs/promises";
3
3
  import { homedir, tmpdir } from "node:os";
4
- import { delimiter, dirname, join, resolve } from "node:path";
4
+ import { delimiter, dirname, join, resolve, sep } from "node:path";
5
5
  import { execFileSync, spawn, spawnSync } from "node:child_process";
6
6
  import { existsSync } from "node:fs";
7
7
  import { Buffer } from "node:buffer";
@@ -4391,11 +4391,12 @@ function superRefine(fn, params) {
4391
4391
  }
4392
4392
  //#endregion
4393
4393
  //#region packages/cli/src/catalog.ts
4394
- var VERSION = "0.13.6";
4394
+ var VERSION = "0.13.7";
4395
4395
  var SKILLS = [
4396
4396
  "ast-grep",
4397
4397
  "babysit-ci",
4398
4398
  "code-review",
4399
+ "commit",
4399
4400
  "compress",
4400
4401
  "context7-cli",
4401
4402
  "debugging",
@@ -4408,7 +4409,8 @@ var SKILLS = [
4408
4409
  "refactor",
4409
4410
  "remove-slop",
4410
4411
  "rules",
4411
- "workflows"
4412
+ "workflows",
4413
+ "writing-for-agents"
4412
4414
  ];
4413
4415
  var AGENTS = _enum([
4414
4416
  "explorer",
@@ -5077,6 +5079,12 @@ var INSTALL_FLAGS = /* @__PURE__ */ new Set([
5077
5079
  "--dangerous-codex-autonomous",
5078
5080
  "--computer-use",
5079
5081
  "--no-computer-use",
5082
+ "--work",
5083
+ "--no-work",
5084
+ "--web",
5085
+ "--no-web",
5086
+ "--security",
5087
+ "--no-security",
5080
5088
  "--no-tui",
5081
5089
  "--fast",
5082
5090
  "--fast-all",
@@ -5139,6 +5147,14 @@ function parseCliArguments(args) {
5139
5147
  if (fastFlags.length > 1) throw new Error(`Conflicting Fast flags: ${fastFlags.join(", ")}`);
5140
5148
  const computerUseFlags = ["--computer-use", "--no-computer-use"].filter((flag) => values.has(flag));
5141
5149
  if (computerUseFlags.length > 1) throw new Error(`Conflicting Computer Use flags: ${computerUseFlags.join(", ")}`);
5150
+ for (const [label, flags] of [
5151
+ ["Work", ["--work", "--no-work"]],
5152
+ ["Web", ["--web", "--no-web"]],
5153
+ ["Security", ["--security", "--no-security"]]
5154
+ ]) {
5155
+ const selected = flags.filter((flag) => values.has(flag));
5156
+ if (selected.length > 1) throw new Error(`Conflicting ${label} flags: ${selected.join(", ")}`);
5157
+ }
5142
5158
  const planValue = values.get("--plan");
5143
5159
  const plan = planValue === void 0 ? void 0 : PlanNameSchema.safeParse(planValue);
5144
5160
  if (plan !== void 0 && !plan.success) throw new Error(`Unknown plan: ${String(planValue)}. Valid plans: ${PLAN_NAMES.join(", ")}.`);
@@ -5156,6 +5172,10 @@ function parseCliArguments(args) {
5156
5172
  } : { requested: false };
5157
5173
  const fast = FastModeSchema.parse(values.has("--fast-all") ? "fast-all" : values.has("--fast") ? "fast" : "standard");
5158
5174
  const computerUse = values.has("--computer-use") ? "enabled" : values.has("--no-computer-use") ? "disabled" : void 0;
5175
+ const choice = (enabled, disabled) => values.has(enabled) ? "enabled" : values.has(disabled) ? "disabled" : void 0;
5176
+ const work = choice("--work", "--no-work");
5177
+ const web = choice("--web", "--no-web");
5178
+ const security = choice("--security", "--no-security");
5159
5179
  return {
5160
5180
  action: "run",
5161
5181
  command,
@@ -5165,6 +5185,9 @@ function parseCliArguments(args) {
5165
5185
  ...maxValue === void 0 ? {} : { maxSubagents: Number(maxValue) },
5166
5186
  autonomy,
5167
5187
  ...computerUse === void 0 ? {} : { computerUse },
5188
+ ...work === void 0 ? {} : { work },
5189
+ ...web === void 0 ? {} : { web },
5190
+ ...security === void 0 ? {} : { security },
5168
5191
  fast,
5169
5192
  verbose: values.has("--verbose")
5170
5193
  };
@@ -5572,19 +5595,83 @@ function deduplicate(candidates) {
5572
5595
  return result;
5573
5596
  }
5574
5597
  //#endregion
5575
- //#region packages/cli/src/codex-security.ts
5576
- var CODEX_SECURITY_PLUGIN = {
5577
- id: "codex-security@openai-curated",
5578
- marketplace: "openai-curated"
5598
+ //#region packages/cli/src/specializations.ts
5599
+ var SPECIALIZATION_NAMES = [
5600
+ "work",
5601
+ "web",
5602
+ "security"
5603
+ ];
5604
+ var SPECIALIZATIONS = {
5605
+ work: {
5606
+ label: "Work",
5607
+ plugins: [
5608
+ {
5609
+ id: "documents@openai-primary-runtime",
5610
+ marketplace: "openai-primary-runtime"
5611
+ },
5612
+ {
5613
+ id: "pdf@openai-primary-runtime",
5614
+ marketplace: "openai-primary-runtime"
5615
+ },
5616
+ {
5617
+ id: "presentations@openai-primary-runtime",
5618
+ marketplace: "openai-primary-runtime"
5619
+ },
5620
+ {
5621
+ id: "spreadsheets@openai-primary-runtime",
5622
+ marketplace: "openai-primary-runtime"
5623
+ },
5624
+ {
5625
+ id: "template-creator@openai-primary-runtime",
5626
+ marketplace: "openai-primary-runtime"
5627
+ }
5628
+ ],
5629
+ sourceDirectory: "profile-skills/work",
5630
+ instruction: "For document, PDF, presentation, spreadsheet, or reusable-template tasks, use the available Work specialization skills and official plugins."
5631
+ },
5632
+ web: {
5633
+ label: "Web",
5634
+ plugins: [{
5635
+ id: "build-web-apps@openai-curated",
5636
+ marketplace: "openai-curated"
5637
+ }],
5638
+ sourceDirectory: "profile-skills/web",
5639
+ instruction: "For frontend applications, dashboards, games, creative websites, or visual UI work, use the available Web specialization skills and official plugins."
5640
+ },
5641
+ security: {
5642
+ label: "Security",
5643
+ plugins: [{
5644
+ id: "codex-security@openai-curated",
5645
+ marketplace: "openai-curated"
5646
+ }],
5647
+ sourceDirectory: "profile-skills/security",
5648
+ instruction: "For authorized security reviews, audits, scans, threat models, vulnerabilities, or attack paths, use the available Security specialization skills and official plugins."
5649
+ }
5650
+ };
5651
+ var FRESH_SPECIALIZATION_STATE = {
5652
+ work: "disabled",
5653
+ web: "disabled",
5654
+ security: "disabled"
5579
5655
  };
5656
+ var LEGACY_SPECIALIZATION_STATE = {
5657
+ work: "disabled",
5658
+ web: "enabled",
5659
+ security: "enabled"
5660
+ };
5661
+ /** Returns the enabled specialization names in registry order. */
5662
+ function enabledSpecializations(state) {
5663
+ return SPECIALIZATION_NAMES.filter((name) => state[name] === "enabled");
5664
+ }
5665
+ /** Returns the instruction fragments for enabled specializations. */
5666
+ function specializationInstructions(names) {
5667
+ return names.map((name) => SPECIALIZATIONS[name].instruction);
5668
+ }
5669
+ ({ ...SPECIALIZATIONS.security.plugins[0] });
5580
5670
  var COMPUTER_USE_PLUGIN = {
5581
5671
  id: "computer-use@openai-bundled",
5582
5672
  marketplace: "openai-bundled"
5583
5673
  };
5584
- var BUILD_WEB_APPS_PLUGIN = {
5585
- id: "build-web-apps@openai-curated",
5586
- marketplace: "openai-curated"
5587
- };
5674
+ ({ ...SPECIALIZATIONS.web.plugins[0] });
5588
5675
  var CODEX_PLUGIN_OPERATIONAL_TIMEOUT_MS = 15e3;
5589
5676
  var CODEX_PACKAGE_BOOTSTRAP_TIMEOUT_MS = 12e4;
5590
5677
  var MAX_CODEX_CATALOG_DIAGNOSTIC_CHARS = 256 * 1024;
@@ -5624,18 +5711,10 @@ var FATAL_POLICY_CODES = /* @__PURE__ */ new Set([
5624
5711
  "PERMISSION_DENIED",
5625
5712
  "POLICY_REJECTED"
5626
5713
  ]);
5627
- /** Installs or enables the official Codex Security plugin without failing HolyCodex installation. */
5628
- async function installCodexSecurity(runProcess = runManagedProcess, platform = process.platform, env = process.env, options = {}) {
5629
- return installOfficialPlugin(CODEX_SECURITY_PLUGIN, runProcess, platform, env, options);
5630
- }
5631
5714
  /** Installs or enables the official Computer Use plugin without failing HolyCodex installation. */
5632
5715
  async function installComputerUse(runProcess = runManagedProcess, platform = process.platform, env = process.env, options = {}) {
5633
5716
  return installOfficialPlugin(COMPUTER_USE_PLUGIN, runProcess, platform, env, options);
5634
5717
  }
5635
- /** Installs or enables the official Build Web Apps plugin without failing HolyCodex installation. */
5636
- async function installBuildWebApps(runProcess = runManagedProcess, platform = process.platform, env = process.env, options = {}) {
5637
- return installOfficialPlugin(BUILD_WEB_APPS_PLUGIN, runProcess, platform, env, options);
5638
- }
5639
5718
  /** Verifies one official plugin without installing or enabling it. */
5640
5719
  async function verifyOfficialPlugin(plugin, runProcess = runManagedProcess, platform = process.platform, env = process.env, options = {}) {
5641
5720
  const runtimeFacts = options.runtimeFacts ?? (runProcess === runManagedProcess ? defaultCodexLauncherRuntimeFacts(platform) : void 0);
@@ -6382,6 +6461,7 @@ var PLAN_PREFIX = "# holycodex plan: ";
6382
6461
  var FAST_MODE_PREFIX = "# holycodex fast: ";
6383
6462
  var WORKFLOW_POLICY_PREFIX = "# holycodex workflow-policy: ";
6384
6463
  var COMPUTER_USE_PREFIX = "# holycodex computer-use: ";
6464
+ var SPECIALIZATION_PREFIX = "# holycodex specialization-";
6385
6465
  var OLD_NAMESPACES = [
6386
6466
  "marketplaces.sisyphuslabs",
6387
6467
  "plugins.\"omo@sisyphuslabs\"",
@@ -6505,6 +6585,24 @@ function readManagedComputerUse(input) {
6505
6585
  const value = new RegExp(`^${COMPUTER_USE_PREFIX}(.+)$`, "m").exec(input)?.[1]?.trim();
6506
6586
  return value === "enabled" || value === "disabled" ? value : void 0;
6507
6587
  }
6588
+ /** Reads the explicit managed choice for one optional specialization. */
6589
+ function readManagedSpecialization(input, name) {
6590
+ const value = new RegExp(`^${SPECIALIZATION_PREFIX}${name}: (enabled|disabled)$`, "m").exec(input)?.[1];
6591
+ return value === "enabled" || value === "disabled" ? value : void 0;
6592
+ }
6593
+ /** Reads all explicitly recorded managed specialization choices. */
6594
+ function readManagedSpecializations(input) {
6595
+ return Object.fromEntries(SPECIALIZATION_NAMES.flatMap((name) => {
6596
+ const choice = readManagedSpecialization(input, name);
6597
+ return choice === void 0 ? [] : [[name, choice]];
6598
+ }));
6599
+ }
6600
+ /** Resolves explicit flags, stored choices, and fresh or legacy defaults. */
6601
+ function resolveSpecializations(input, choices = {}) {
6602
+ const stored = readManagedSpecializations(input);
6603
+ const defaults = input.includes(START) ? LEGACY_SPECIALIZATION_STATE : FRESH_SPECIALIZATION_STATE;
6604
+ return Object.fromEntries(SPECIALIZATION_NAMES.map((name) => [name, choices[name] ?? stored[name] ?? defaults[name]]));
6605
+ }
6508
6606
  /** Reads the plan-authoritative workflow policy metadata from managed configuration. */
6509
6607
  function readManagedWorkflowPolicy(input) {
6510
6608
  const raw = new RegExp(`^${WORKFLOW_POLICY_PREFIX.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(.+)$`, "m").exec(input)?.[1];
@@ -6585,10 +6683,11 @@ function mergedStatusLine(original) {
6585
6683
  return `[${items.map((item) => JSON.stringify(item)).join(", ")}]`;
6586
6684
  }
6587
6685
  /** Installs config. */
6588
- function installConfig(input, mode, _platform, requestedPlan, maxSubagents, fastMode = "standard", computerUse) {
6686
+ function installConfig(input, mode, _platform, requestedPlan, maxSubagents, fastMode = "standard", computerUse, specializations = {}) {
6589
6687
  const request = normalizeRequestedAutonomy(mode);
6590
6688
  const plan = requestedPlan ?? readManagedPlan(input) ?? "plus";
6591
6689
  const effectiveComputerUse = computerUse ?? readManagedComputerUse(input) ?? "disabled";
6690
+ const effectiveSpecializations = resolveSpecializations(input, specializations);
6592
6691
  const priorAutonomy = readAutonomyMetadata(input);
6593
6692
  const previousOriginalRoot = readOriginalRootMetadata(input);
6594
6693
  const legacyGeneratedRoot = readLegacyGeneratedRoot(input);
@@ -6647,7 +6746,7 @@ function installConfig(input, mode, _platform, requestedPlan, maxSubagents, fast
6647
6746
  limits: workflow.limits,
6648
6747
  projectedUsage: workflow.projectedUsage,
6649
6748
  softSizeGuidance: workflow.softSizeGuidance
6650
- })}\n${AUTONOMY_METADATA_PREFIX}${effectiveAutonomy}\n${COMPUTER_USE_PREFIX}${effectiveComputerUse}\n${original}${originalPermissionMetadata(permissionLines)}${model}${effort}web_search = ${JSON.stringify(webSearch)}\nmodel_verbosity = "low"\nservice_tier = "${rootServiceTier}"\n${rootPermissionLines.join("\n")}\n${END}`;
6749
+ })}\n${AUTONOMY_METADATA_PREFIX}${effectiveAutonomy}\n${COMPUTER_USE_PREFIX}${effectiveComputerUse}\n${SPECIALIZATION_NAMES.map((name) => `${SPECIALIZATION_PREFIX}${name}: ${effectiveSpecializations[name]}`).join("\n")}\n${original}${originalPermissionMetadata(permissionLines)}${model}${effort}web_search = ${JSON.stringify(webSearch)}\nmodel_verbosity = "low"\nservice_tier = "${rootServiceTier}"\n${rootPermissionLines.join("\n")}\n${END}`;
6651
6750
  let configured = `${preservedRoot ? `${preservedRoot}\n` : ""}${rootBlock}${tables ? `\n\n${tables}` : ""}`;
6652
6751
  const legacyMultiAgentV2 = /\bmulti_agent_v2\s*=\s*(true|false)/.exec(configured)?.[1];
6653
6752
  configured = injectTableKeys(configured, "features", [
@@ -6755,20 +6854,23 @@ function formatInstalledRuntimeGuidance(pluginRoot) {
6755
6854
  return `Use the installed HolyCodex workflow runtime with an absolute path: node ${quotedPath}. For help, run node ${quotedPath} --help.`;
6756
6855
  }
6757
6856
  /** Shared HolyCodex root instructions. */
6758
- var CORE_INSTRUCTIONS = "HolyCodex: Root is user-facing. Before updates, classify intent and load required skills. Start with \"I detect [intent] intent [action].\" Choose the accurate intent naturally; no fixed intent taxonomy applies. `plan` and `plan-review` instead own their exact heading and intent as the first visible block; no other mode prints a heading. Do not conceal orchestration. Give concise updates naming each specialist type and what it will do, such as \"Explorer maps X\", \"Librarian verifies Y\", or \"Worker implements Z\". Do not disclose Root orchestration mechanics or explain why delegation is running unless asked. Skills govern method only. Root owns interaction, intent, scope, architecture, product choices, ambiguity, integration, external state, and final judgment and verification. Root is not another implementation branch: evaluate specialist output against scope, fixed architecture, user decisions, repository conventions, and proof; reject or repair weak output and integrate only accepted work. On every plan other than Go, use a CLI workflow for substantive discovery, implementation, verification, multi-file work, risky changes, or architecture-sensitive work. Root may work directly for genuinely small bounded operations such as repository synchronization, one quick mechanical edit, or an equivalent one-off change. State when the direct-work exception applies, and never use it to bypass delegation for broader work. Never invoke regular Codex collaboration subagents. If a required workflow is unavailable or cannot perform the operation, report the blocker instead of bypassing delegation. Missing task-child visibility is not a reason to avoid workflows. Go does not support workflows, so Root works directly without specialist subagents. A task may contain multiple sequential workflows. Prefer the smallest useful fan-out, stop discovery when evidence is sufficient, and avoid duplicate investigation. The selected plan is authoritative: enforce its permitted model routes for each agent and stage, low verbosity, Fast as the only service-tier variation, concurrency, soft target calls, hard maximum calls, workflow depth, retries, loop iterations, fan-out, projected usage, and soft-size guidance. Root should remain near target calls and exceed them only when intermediate evidence justifies more work; the hard maximum is only a safety and quota ceiling. Larger plans do not automatically consume larger allowances. Keep explorer, librarian, and worker selectable only where the plan permits. Root owns workflow integration and final proof. After any code or manifest implementation, Root loads `code-review` exactly once before final response; it also loads `code-review` for a user-requested snippet, file, directory, diff, patch, or PR review. That skill owns the final audit, repair, proportional checks and reruns, reinspection, diff, and status. Classify unknowns: delegate facts, ask material decisions, and state and use safe reversible defaults. Whenever Root needs user input or would ask any question, it must use `request_user_input` when that tool is available, in every scenario and mode. Root must never stop or reply with a plain-text question when the tool is available. If the tool is unavailable, use a safe reversible default where possible or report a non-question blocker. Never repeat questions or ask discoverable facts. Root must use `request_user_input` immediately before committing, pushing, creating or moving tags, building or compiling, publishing, deploying, destructive or irreversible actions, permission changes, financial actions, sending, or any other externally visible action. Earlier general authorization does not replace this immediate approval unless the user explicitly authorized that exact action in the current turn. Root controls browser and native desktop UI itself. Explorer is repository-read-only, Librarian research-only, and Worker cannot alter dashboards, accounts, permissions, or external state. Specialists never delegate, broaden, review, or make final judgments.";
6759
- var NATIVE_IO_INSTRUCTIONS = "For `plan` and `plan-review` headings, never print provisionally. Never delegate browser or computer control. For frontend creation, redesign, or visual verification, use installed Build Web Apps `frontend-app-builder` for concept, approval, implementation, and visual verification. For authorized security reviews, audits, scans, threat models, vulnerabilities, or attack paths, use matching installed Codex Security plugin skills. Use these capabilities instead of manual-click instructions, shell-as-GUI, or public research as a substitute for authenticated control. Use Codex native `apply_patch` for workspace file creation, updates, moves, and deletion. Use available native read or shell tools for file inspection and repository search. Do not re-read files only to verify a successful `apply_patch` call.";
6857
+ var CORE_INSTRUCTIONS = "HolyCodex: Root is user-facing. Before updates, classify intent and load required skills. Start with \"I detect [intent] intent - [action].\" Choose the accurate intent naturally; no fixed intent taxonomy applies. `plan` and `plan-review` own their exact heading and intent as the first visible block; other modes do not print a heading. Name each specialist type and its bounded outcome in concise updates. Root owns interaction, scope, architecture, product choices, ambiguity, integration, external state, and final judgment and verification. Root evaluates specialist evidence against user decisions, repository conventions, approved constraints, and proof, then integrates only accepted work. On every plan other than Go, use the CLI workflow for substantive discovery, implementation, verification, multi-file, risky, or architecture-sensitive work; genuinely small bounded operations may remain direct. Go works directly without specialists. Keep the active plan authoritative for routes, effort, verbosity, service tier, concurrency, target calls, hard maximum calls, depth, retries, loops, fan-out, and projected usage. Select only permitted Explorer, Librarian, and Worker capabilities. After code or manifest implementation, load `code-review` exactly once; that skill owns routine final audit mechanics while Root owns the final judgment. Classify unknowns as facts for specialists, material decisions for `request_user_input`, and safe reversible defaults. Use `request_user_input` immediately before commits, pushes, tags, builds, compiles, packages, publication, deployment, destructive changes, permission changes, financial actions, sending, reruns, or other externally visible actions. Explorer is repository-read-only, Librarian is research-only, and Worker cannot alter dashboards, accounts, permissions, or external state. Specialists do not delegate, broaden scope, or make final judgments.";
6858
+ var NATIVE_IO_INSTRUCTIONS = "Use exact `plan` and `plan-review` headings only in those modes. Never delegate browser or computer control. For frontend creation, redesign, or visual verification, use installed Build Web Apps `frontend-app-builder` for concept, approval, implementation, and visual verification. For authorized security reviews, audits, scans, threat models, vulnerabilities, or attack paths, use matching installed Codex Security plugin skills. Use these capabilities instead of manual-click instructions, shell-as-GUI, or public research as a substitute for authenticated control. Use Codex native `apply_patch` for workspace file creation, updates, and deletion. Use native read or shell tools for file inspection and repository search. Do not reread files only to verify a successful `apply_patch` call.";
6760
6859
  var COMPUTER_USE_INSTRUCTIONS = "For native desktop tasks, use the available Computer Use capability.";
6761
- var ROOT_LUNA_POLICY = "Root is the judgment and control plane: own interaction, scope, architecture, product and risk decisions, workflow integration, material ambiguity, external state, and the final decision. Luna specialists are bounded execution context: Explorer maps sufficient repository facts, Librarian verifies assigned current facts, and Worker implements, integrates, inspects diffs, runs checks, performs mechanical repair and retest, routine review, evidence compression, and optional synthesis. Root trusts successful Luna mechanical evidence without rerunning it; for qualifying work, Root still inspects the actual relevant final diff or hunks and minimal ownership or interface context after Luna review. A specialist claim that architecture, taste, or mergeability is good is insufficient. Material architecture, product, scope, risk, or contradictory-evidence decisions return to Root. When retained context is valid, prefer it with compact outcomes, Luna-local loops and synthesis, sufficient discovery, and genuine concurrency without changing plan quotas. Structured substantive outcomes are the branching contract, not prose parsing. Escalate Luna high to xhigh to max only when the evidence justifies it and the active plan permits the route; max insufficiency returns compact evidence to Root and never creates a Sol specialist.";
6762
- var ROOT_DESIGN_GATE_POLICY = "Use the existing shouldUseRootDesignGate decision for both pre-work constraints and post-review final Root inspection. Qualifying work is architecture-sensitive, substantive, or meaningfully multi-file; trivial, one-off mechanical, and genuinely small single-file work remains exempt. Record the owner and seam, data and control flow, stable interfaces, state and policy location, exclusions, duplication seam, errors and recovery, tests, compatibility, and why the chosen shape is preferred when real alternatives exist. After Luna routine review, qualifying work requires Root to inspect actual relevant final diff or hunks with only minimal surrounding ownership or interface context, compare the compact approved design contract with the implementation, and own the complete final judgment: architectural fit, ownership and dependency direction, scope and cohesion, abstraction and API shape, repository-native taste and maintainability, mergeability, and readiness. Root may direct at most one bounded Luna repair within the active plan's existing quotas, followed by affected-diff reinspection. This is a compact constraint gate, not a mandatory extra model call, independent Root review execution, workflow restart, or second plan. Root does not repeatedly narrate unchanged workflow or status snapshots. Repository-native evidence from source, tests, configuration, commands, diff, and status is authoritative for implementation facts. If repository evidence conflicts with the approved constraint, architecture, scope, or another material decision, escalate to Root rather than resolving it silently.";
6763
- var WORKER_BRIEF_POLICY = "Root gives Worker a compact constraint/outcome brief containing a concrete objective and outcome, intended owner and seam, literal scope and exclusions with allowed boundaries, relevant components, existing mechanism to extend, invariants and stable interfaces, required behavior, data and control flow, state and policy location, error and recovery obligations, compatibility, proof obligations and the exact repository-native tests or checks that prove them, the standard structured outcome fields, and stop and escalation conditions when relevant. Valid retained context may avoid repeating unchanged constraints; continuation or repair must identify changed constraints and the exact next action, and workflows must not summarize away required constraints. Worker follows that brief, does not rediscover architecture or make material choices, and returns the unchanged SPECIALIST_OUTCOME_SCHEMA. Luna owns correctness, completeness, regression checks, tests, diagnostics, compatibility, changed-file inspection, bounded repair, local naming, duplication and complexity cleanup, and compact structured evidence. Worker may perform one warranted bounded behavior-preserving diff-level taste pass for clarity, naming, duplication, or avoidable complexity in changed files only; it must preserve behavior, interfaces, ownership, and scope and then stop. Worker routine review and repair stay within that seam. Material architecture, ownership, scope, product, or stable-interface conflicts return needs_root_decision with exact evidence. Root retains final judgment and reports only meaningful lifecycle transitions, errors, decisions, or required user action while suppressing unchanged status narration; existing CLI follow filtering remains unchanged.";
6860
+ var ROOT_LUNA_POLICY = "Root is the judgment and control plane for interaction, scope, architecture, product, risk, workflow integration, ambiguity, external state, and final decisions. Luna is bounded execution: Explorer maps repository facts, Librarian verifies assigned current facts, and Worker implements, integrates, inspects diffs, runs checks, repairs bounded defects, retests, compresses evidence, and synthesizes only when asked. Root accepts successful mechanical evidence without rerunning routine mechanics, then inspects actual relevant final diff or hunks for qualifying work. Material architecture, product, scope, risk, or contradictory evidence returns to Root. Structured outcomes drive branching; retained context is reused only when its owner, scope, permissions, and task class remain valid. Root does not repeatedly narrate unchanged workflow or status snapshots. Escalate Luna effort only when evidence and the active plan permit it; no route creates a Sol specialist.";
6861
+ var ROOT_DESIGN_GATE_POLICY = "Use the existing shouldUseRootDesignGate decision for pre-work constraints and post-review final Root inspection. Qualifying work is architecture-sensitive, substantive, or meaningfully multi-file; trivial, one-off mechanical, and genuinely small single-file work remains exempt. Record owner and seam, data and control flow, stable interfaces, state and policy, exclusions, duplication seam, errors and recovery, tests, compatibility, and the preferred shape when real alternatives exist. After Luna routine review, Root inspects actual relevant final diff or hunks with minimal ownership or interface context and judges architecture, dependency direction, scope, cohesion, abstraction, repository-native taste, mergeability, and readiness. Root may direct at most one bounded Luna repair within active plan quotas followed by affected-diff reinspection. This is a compact constraint gate, not an unconditional model call, independent review, workflow restart, or second plan. Repository-native source, tests, configuration, commands, diff, and status are authoritative. Escalate conflicting evidence or constraints to Root.";
6862
+ var WORKER_BRIEF_POLICY = "Root gives Worker a compact constraint/outcome brief with concrete objective and outcome, intended owner and seam, literal scope and exclusions with allowed boundaries, relevant components, existing mechanism to extend, invariants and stable interfaces, required behavior, data and control flow, state and policy location, error and recovery obligations, compatibility, proof obligations and the exact repository-native tests or checks that prove them, the standard structured outcome fields, and stop and escalation conditions. Retained context may omit unchanged constraints; continuation or repair must identify changed constraints and the exact next action. Worker follows the brief without rediscovering architecture or making material choices. Luna owns correctness, completeness, regression checks, diagnostics, compatibility, changed-file inspection, bounded repair, and compact structured evidence. Worker may make one warranted bounded diff-level taste/simplification pass for clarity, naming, duplication, or avoidable complexity in changed files only; it preserves behavior, interfaces, ownership, and scope, then stops. Material conflicts return `needs_root_decision` with exact evidence. Root retains final judgment and reports meaningful lifecycle changes only.";
6764
6863
  var CODE_REVIEW_ACTIVATION_POLICY = "After loading `code-review`, its first visible line is **CODE REVIEW MODE ACTIVATED**.";
6765
6864
  /** Gets core instructions with platform and active agent-capacity context. */
6766
- function coreInstructions(platform, capacity, computerUseEnabled = false, pluginRoot) {
6865
+ function coreInstructions(platform, capacity, computerUseEnabled = false, pluginRoot, specializations = []) {
6767
6866
  const threads = capacity?.maxThreads;
6768
6867
  const depth = capacity?.maxDepth;
6769
- const capacityInstructions = threads === void 0 || depth === void 0 ? "Before delegation, use active collaboration tool instructions as the authoritative agent-capacity limit." : `Host agent capacity: agents.max_concurrent_threads_per_session=${threads} includes Root. The host nesting limit is ${depth}; the active plan's maxCalls is the hard workflow call ceiling and targetCalls is soft planning guidance. Its lower concurrency, depth, and fan-out limits remain authoritative. Substantive, multi-file, risky, and architecture-sensitive work uses a CLI workflow; genuinely small bounded operations may remain direct. Report a blocker when a required workflow runtime is unavailable. Go does not support workflows, so Root works directly without specialist subagents.`;
6868
+ const capacityInstructions = threads === void 0 || depth === void 0 ? "Before delegation, use active collaboration tool instructions as the authoritative agent-capacity limit." : `Host agent capacity: agents.max_concurrent_threads_per_session=${threads} includes Root. The host nesting limit is ${depth}; the active plan's maxCalls is the hard workflow call ceiling and targetCalls is soft planning guidance. Its lower concurrency, depth, and fan-out limits remain authoritative. Substantive, multi-file, risky, and architecture-sensitive work uses a CLI workflow; genuinely small bounded operations may remain direct. Report a blocker when a required workflow runtime is unavailable. Go works directly without specialists.`;
6770
6869
  const platformInstructions = platform === "win32" ? ` ${WINDOWS_SHELL_POLICY}` : "";
6771
- return `${CORE_INSTRUCTIONS} ${ROOT_LUNA_POLICY} ${ROOT_DESIGN_GATE_POLICY} ${WORKER_BRIEF_POLICY} ${LITE_WRITING_POLICY} ${CONTEXT7_POLICY} ${NATIVE_IO_INSTRUCTIONS}${computerUseEnabled ? ` ${COMPUTER_USE_INSTRUCTIONS}` : ""} ${CODE_REVIEW_ACTIVATION_POLICY} ${capacityInstructions}${platformInstructions}${pluginRoot === void 0 ? "" : ` ${formatInstalledRuntimeGuidance(pluginRoot)}`}`;
6870
+ const computerUseInstructions = computerUseEnabled ? ` ${COMPUTER_USE_INSTRUCTIONS}` : "";
6871
+ const specializationContext = specializationInstructions(specializations).join(" ");
6872
+ const runtimeGuidance = pluginRoot === void 0 ? "" : ` ${formatInstalledRuntimeGuidance(pluginRoot)}`;
6873
+ return `${CORE_INSTRUCTIONS} ${ROOT_LUNA_POLICY} ${ROOT_DESIGN_GATE_POLICY} ${WORKER_BRIEF_POLICY} ${LITE_WRITING_POLICY} ${CONTEXT7_POLICY} ${NATIVE_IO_INSTRUCTIONS}${computerUseInstructions}${specializationContext ? ` ${specializationContext}` : ""} ${CODE_REVIEW_ACTIVATION_POLICY} ${capacityInstructions}${platformInstructions}${runtimeGuidance}`;
6772
6874
  }
6773
6875
  //#endregion
6774
6876
  //#region packages/cli/src/doctor.ts
@@ -6841,14 +6943,16 @@ async function doctor(home = process.env.CODEX_HOME ?? join(homedir(), ".codex")
6841
6943
  } catch {
6842
6944
  checks.push(check("config", "error", "config-missing", `Missing ${configPath}.`, "Run holycodex install."));
6843
6945
  }
6946
+ const specializationState = resolveSpecializations(config);
6844
6947
  const missing = await missingFiles(pluginRoot, [
6845
6948
  ".codex-plugin/plugin.json",
6846
6949
  "hooks/hooks.json",
6847
6950
  ...requiredPackageRuntimes(runtime.platform).map((file) => `runtime/${file}`),
6848
6951
  ...AGENTS.map((name) => `agents/${name}.toml`),
6849
- ...SKILLS.map((name) => `skills/${name}/SKILL.md`)
6952
+ ...SKILLS.map((name) => `skills/${name}/SKILL.md`),
6953
+ ...enabledSpecializations(specializationState).map((name) => `skills/${name}/SKILL.md`)
6850
6954
  ]);
6851
- checks.push(missing.length === 0 ? check("package", "ok", "package-ready", `Plugin ${VERSION}, runtimes, agents, and ${SKILLS.length} skills are present.`) : check("package", "error", "package-incomplete", `Missing ${missing.join(", ")}.`, "Reinstall HolyCodex."));
6955
+ checks.push(missing.length === 0 ? check("package", "ok", "package-ready", `Plugin ${VERSION}, runtimes, agents, and ${SKILLS.length} base skills are present.`) : check("package", "error", "package-incomplete", `Missing ${missing.join(", ")}.`, "Reinstall HolyCodex."));
6852
6956
  const webSearchOverride = readPreservedRootOverrides(config).webSearch;
6853
6957
  checks.push(rootTomlString(config, "web_search") === "live" ? check("web-search", "ok", "live-web-search", "Managed web search defaults to live.") : webSearchOverride ? check("web-search", "ok", "web-search-override", "An intentional user web-search override is preserved.") : check("web-search", "error", "web-search-not-live", "Managed web search is not live.", "Reinstall HolyCodex."));
6854
6958
  const computerUse = readManagedComputerUse(config);
@@ -6859,6 +6963,15 @@ async function doctor(home = process.env.CODEX_HOME ?? join(homedir(), ".codex")
6859
6963
  const verification = instructionsActive ? await verifyComputerUse(runtime) : { status: "missing" };
6860
6964
  checks.push(!instructionsActive ? check("computer-use", "error", "computer-use-instructions-missing", "Computer Use is enabled, but Root-only Computer Use guidance is not active.", "Reinstall HolyCodex.") : verification.status === "verified" ? check("computer-use", "ok", "computer-use-ready", `Computer Use is enabled and the official plugin is installed and enabled via ${verification.launcherSource}.`) : verification.status === "missing" ? check("computer-use", "error", "computer-use-plugin-missing", "Computer Use is enabled, but the official plugin is not installed and enabled.", "Run holycodex install --computer-use.") : verification.reason === "unsupported" ? check("computer-use", "error", "computer-use-incompatible", "Computer Use is enabled, but the official plugin is incompatible with this Codex runtime or platform.", "Upgrade Codex or disable Computer Use with holycodex install --no-computer-use.") : verification.reason === "marketplace-unavailable" || verification.reason === "timeout" ? check("computer-use", "error", "computer-use-plugin-unavailable", `Computer Use is enabled, but the official marketplace could not be reached (${verification.reason}).`, "Restore Codex marketplace access and run holycodex install --computer-use.") : check("computer-use", "error", "computer-use-installation-failed", `Computer Use is enabled, but installation or verification failed (${verification.reason}).`, "Resolve the reported Codex authentication, permission, configuration, or verification failure and run holycodex install --computer-use."));
6861
6965
  }
6966
+ for (const name of SPECIALIZATION_NAMES) {
6967
+ if (specializationState[name] === "disabled") {
6968
+ checks.push(check(`${name}-specialization`, "ok", `${name}-disabled`, `${SPECIALIZATIONS[name].label} specialization is explicitly disabled; no official plugin or profile guidance is required.`));
6969
+ continue;
6970
+ }
6971
+ const instructionsActive = !missing.includes(`skills/${name}/SKILL.md`) && coreInstructions(runtime.platform, void 0, false, void 0, [name]).includes(SPECIALIZATIONS[name].instruction);
6972
+ const verification = instructionsActive ? await verifySpecialization(name, runtime) : { status: "missing" };
6973
+ checks.push(!instructionsActive ? check(`${name}-specialization`, "error", `${name}-instructions-missing`, `${SPECIALIZATIONS[name].label} specialization is enabled, but its guidance is not active.`, `Reinstall HolyCodex with --${name}.`) : verification.status === "verified" ? check(`${name}-specialization`, "ok", `${name}-ready`, `${SPECIALIZATIONS[name].label} specialization is enabled and its official plugin is installed and enabled via ${verification.launcherSource}.`) : check(`${name}-specialization`, "error", `${name}-plugin-missing`, `${SPECIALIZATIONS[name].label} specialization is enabled, but its official plugin is not installed and enabled.`, `Run holycodex install --${name}.`));
6974
+ }
6862
6975
  const status = rootTomlStringArray(config, "status_line") ?? rootTomlStringArray(tableBody(config, "tui") ?? "", "status_line");
6863
6976
  checks.push(status?.includes("context-remaining") ? check("context-visibility", "ok", "context-visible", "Context-window usage remains visible.") : check("context-visibility", "error", "context-hidden", "The status line does not show context remaining.", "Reinstall HolyCodex."));
6864
6977
  checks.push(check("screenshot", "ok", "screenshot-default-preserved", "HolyCodex does not override the enabled Codex screenshot default."));
@@ -6923,6 +7036,29 @@ async function verifyComputerUse(runtime) {
6923
7036
  };
6924
7037
  return verifyOfficialPlugin(COMPUTER_USE_PLUGIN, runProcess, runtime.platform, process.env);
6925
7038
  }
7039
+ async function verifySpecialization(name, runtime) {
7040
+ const runProcess = async (input) => {
7041
+ const result = await runtime.command(input.command, input.args, input.env);
7042
+ return {
7043
+ exitCode: result.ok ? 0 : 1,
7044
+ stdout: result.ok ? result.output : "",
7045
+ stderr: result.ok ? "" : result.output,
7046
+ timedOut: false,
7047
+ matched: false,
7048
+ outputTruncated: false
7049
+ };
7050
+ };
7051
+ let verified;
7052
+ for (const plugin of SPECIALIZATIONS[name].plugins) {
7053
+ const result = await verifyOfficialPlugin(plugin, runProcess, runtime.platform, process.env);
7054
+ if (result.status !== "verified") return result;
7055
+ verified = result;
7056
+ }
7057
+ return verified ?? {
7058
+ status: "missing",
7059
+ attemptedLaunchers: []
7060
+ };
7061
+ }
6926
7062
  //#endregion
6927
7063
  //#region packages/cli/src/files.ts
6928
7064
  /** Provides exists. */
@@ -7080,6 +7216,7 @@ async function installOnce(options, runtime) {
7080
7216
  const existingConfig = await readText(target.config);
7081
7217
  const plan = options.plan ?? readManagedPlan(existingConfig) ?? "plus";
7082
7218
  const computerUseChoice = resolveComputerUseChoice(options, existingConfig);
7219
+ const specializations = resolveSpecializationState(options, existingConfig);
7083
7220
  const root = backupRoot();
7084
7221
  notify(options, "backup", "Backing up existing installation", "running");
7085
7222
  const configBackup = await backup(target.config, root);
@@ -7096,7 +7233,7 @@ async function installOnce(options, runtime) {
7096
7233
  notify(options, "configuration", "Preparing configuration", "running");
7097
7234
  const previousPlan = readManagedPlan(existingConfig);
7098
7235
  const fastMode = options.fast ?? "standard";
7099
- const config = installConfig(existingConfig, options.autonomy, runtime.platform, plan, options.maxSubagents, fastMode, computerUseChoice);
7236
+ const config = installConfig(existingConfig, options.autonomy, runtime.platform, plan, options.maxSubagents, fastMode, computerUseChoice, specializations);
7100
7237
  notify(options, "configuration", "Preparing configuration", "complete", plan);
7101
7238
  notify(options, "staging", "Staging plugin and agent files", "running");
7102
7239
  const existingAgentPreferences = await readAgentPreferences(target.agents, previousPlan);
@@ -7104,19 +7241,25 @@ async function installOnce(options, runtime) {
7104
7241
  const stagedCache = join(staging, "cache");
7105
7242
  const stagedAgents = join(staging, "agents");
7106
7243
  const sourcePluginRoot = runtime.pluginRoot ?? pluginRoot;
7107
- await cp(sourcePluginRoot, stagedCache, { recursive: true });
7108
- await writeInstalledAgents(join(stagedCache, "agents"), runtime.platform, plan, fastMode);
7244
+ const profileRoot = join(sourcePluginRoot, "profile-skills");
7245
+ await cp(sourcePluginRoot, stagedCache, {
7246
+ recursive: true,
7247
+ filter: (source) => source !== profileRoot && !source.startsWith(`${profileRoot}${sep}`)
7248
+ });
7249
+ await stageSpecializationSkills(stagedCache, sourcePluginRoot, specializations);
7250
+ await writeInstalledAgents(join(stagedCache, "agents"), runtime.platform, plan, fastMode, enabledSpecializations(specializations));
7109
7251
  await cp(join(sourcePluginRoot, "agents"), stagedAgents, { recursive: true });
7110
- await writeInstalledAgents(stagedAgents, runtime.platform, plan, fastMode);
7252
+ await writeInstalledAgents(stagedAgents, runtime.platform, plan, fastMode, enabledSpecializations(specializations));
7111
7253
  await preserveAgentPreferences(stagedAgents, existingAgentPreferences, plan, fastMode);
7112
7254
  notify(options, "staging", "Staging plugin and agent files", "complete");
7113
7255
  notify(options, "validation", "Validating staged installation", "running");
7114
- await validateStaging(stagedCache, stagedAgents);
7256
+ await validateStaging(stagedCache, stagedAgents, specializations);
7115
7257
  notify(options, "validation", "Validating staged installation", "complete");
7116
7258
  const removedLegacy = [];
7117
7259
  let codexSecurity;
7118
7260
  let computerUse;
7119
7261
  let buildWebApps;
7262
+ let work;
7120
7263
  try {
7121
7264
  notify(options, "managed-files", "Installing managed files", "running");
7122
7265
  await atomicWrite(target.config, config);
@@ -7138,7 +7281,7 @@ async function installOnce(options, runtime) {
7138
7281
  }
7139
7282
  notify(options, "managed-files", "Installing managed files", "complete");
7140
7283
  notify(options, "codex-security", "Installing Codex Security", "running");
7141
- codexSecurity = await installCodexSecurity(runtime.runProcess, runtime.platform, process.env);
7284
+ codexSecurity = await installSelectedSpecializationPlugin("security", specializations.security, options.security !== void 0, runtime);
7142
7285
  notify(options, "codex-security", "Installing Codex Security", "complete", pluginProgressDetail(codexSecurity));
7143
7286
  notify(options, "computer-use", "Installing Computer Use", "running");
7144
7287
  if (computerUseChoice === "enabled") {
@@ -7151,8 +7294,11 @@ async function installOnce(options, runtime) {
7151
7294
  notify(options, "computer-use", "Computer Use disabled", "complete", "disabled");
7152
7295
  }
7153
7296
  notify(options, "build-web-apps", "Installing Build Web Apps", "running");
7154
- buildWebApps = await installBuildWebApps(runtime.runProcess, runtime.platform, process.env);
7297
+ buildWebApps = await installSelectedSpecializationPlugin("web", specializations.web, options.web !== void 0, runtime);
7155
7298
  notify(options, "build-web-apps", "Installing Build Web Apps", "complete", pluginProgressDetail(buildWebApps));
7299
+ if (specializations.work === "enabled") notify(options, "work", "Installing Work", "running");
7300
+ work = await installWorkSpecialization(specializations.work, options.work !== void 0, runtime);
7301
+ if (specializations.work === "enabled") notify(options, "work", "Installing Work", "complete", work.status === "disabled" ? "disabled" : `${Object.keys(work.plugins).length} plugins`);
7156
7302
  notify(options, "cleanup", "Removing obsolete caches", "running");
7157
7303
  await removeObsoleteVersionCaches(target.cacheRoot);
7158
7304
  notify(options, "cleanup", "Removing obsolete caches", "complete");
@@ -7183,12 +7329,20 @@ async function installOnce(options, runtime) {
7183
7329
  plan,
7184
7330
  codexSecurity,
7185
7331
  computerUse,
7186
- buildWebApps
7332
+ buildWebApps,
7333
+ work
7187
7334
  };
7188
7335
  }
7189
7336
  function resolveComputerUseChoice(options, existingConfig) {
7190
7337
  return options.computerUse ?? readManagedComputerUse(existingConfig) ?? "disabled";
7191
7338
  }
7339
+ function resolveSpecializationState(options, existingConfig) {
7340
+ return resolveSpecializations(existingConfig, {
7341
+ ...options.work === void 0 ? {} : { work: options.work },
7342
+ ...options.web === void 0 ? {} : { web: options.web },
7343
+ ...options.security === void 0 ? {} : { security: options.security }
7344
+ });
7345
+ }
7192
7346
  function computerUseFailure(result) {
7193
7347
  const reason = result.reason.replaceAll("-", " ");
7194
7348
  return /* @__PURE__ */ new Error(`Computer Use is enabled, but the official plugin could not be installed or verified (${reason}). Re-run with --computer-use after resolving the Codex launcher or marketplace issue, or choose --no-computer-use.`);
@@ -7202,23 +7356,64 @@ function notify(options, step, label, status, detail) {
7202
7356
  });
7203
7357
  }
7204
7358
  function pluginProgressDetail(result) {
7359
+ if (result.status === "disabled") return "disabled";
7205
7360
  if (result.status === "skipped") return `skipped: ${result.reason}`;
7206
7361
  return result.launcherSource === void 0 ? result.status : `${result.status} via ${result.launcherSource}`;
7207
7362
  }
7208
- async function validateStaging(cache, agents) {
7363
+ async function validateStaging(cache, agents, specializations) {
7209
7364
  const required = [
7210
7365
  join(cache, ".codex-plugin", "plugin.json"),
7211
7366
  join(cache, "skills", "context7-cli", "SKILL.md"),
7212
7367
  join(cache, "runtime", "lsp.js"),
7213
- ...AGENTS.map((agent) => join(agents, `${agent}.toml`))
7368
+ ...AGENTS.map((agent) => join(agents, `${agent}.toml`)),
7369
+ ...enabledSpecializations(specializations).map((name) => join(cache, "skills", name, "SKILL.md"))
7214
7370
  ];
7215
7371
  const missing = [];
7216
7372
  for (const path of required) if (!await exists(path)) missing.push(path);
7217
7373
  if (missing.length > 0) throw new Error(`Staged HolyCodex installation is incomplete: ${missing.join(", ")}`);
7218
7374
  }
7375
+ async function stageSpecializationSkills(cache, sourcePluginRoot, state) {
7376
+ const skillsRoot = join(cache, "skills");
7377
+ for (const name of enabledSpecializations(state)) {
7378
+ const source = join(sourcePluginRoot, SPECIALIZATIONS[name].sourceDirectory);
7379
+ if (!await exists(source)) continue;
7380
+ for (const entry of await readdir(source, { withFileTypes: true })) await cp(join(source, entry.name), join(skillsRoot, entry.name), { recursive: true });
7381
+ }
7382
+ }
7383
+ async function installSelectedSpecializationPlugin(name, choice, explicitlyRequested, runtime) {
7384
+ if (choice === "disabled") return { status: "disabled" };
7385
+ const plugin = SPECIALIZATIONS[name].plugins[0];
7386
+ const result = await installOfficialPluginSafely(plugin.id, plugin, runtime);
7387
+ if (result.status === "skipped" && explicitlyRequested) throw specializationFailure(SPECIALIZATIONS[name].label, name, result);
7388
+ return result;
7389
+ }
7390
+ async function installWorkSpecialization(choice, explicitlyRequested, runtime) {
7391
+ if (choice === "disabled") return { status: "disabled" };
7392
+ const plugins = {};
7393
+ for (const plugin of SPECIALIZATIONS.work.plugins) {
7394
+ const result = await installOfficialPluginSafely(plugin.id, plugin, runtime);
7395
+ if (result.status === "skipped" && explicitlyRequested) throw specializationFailure(plugin.id, "work", result);
7396
+ plugins[plugin.id] = result;
7397
+ }
7398
+ return {
7399
+ status: "enabled",
7400
+ plugins
7401
+ };
7402
+ }
7403
+ async function installOfficialPluginSafely(pluginName, plugin, runtime) {
7404
+ try {
7405
+ return await installOfficialPlugin(plugin, runtime.runProcess, runtime.platform, process.env);
7406
+ } catch (error) {
7407
+ const detail = error instanceof Error ? error.message : String(error);
7408
+ throw new Error(`Official plugin ${pluginName} could not be installed or verified: ${detail}`);
7409
+ }
7410
+ }
7411
+ function specializationFailure(name, flag, result) {
7412
+ return /* @__PURE__ */ new Error(`${name} specialization is enabled, but the official plugin could not be installed or verified (${result.reason}). Re-run with --no-${flag} after resolving the Codex launcher or marketplace issue.`);
7413
+ }
7219
7414
  async function removeObsoleteVersionCaches(cacheRoot) {
7220
7415
  if (!await exists(cacheRoot)) return;
7221
- for (const entry of await readdir(cacheRoot)) if (entry !== "0.13.6") await rm(join(cacheRoot, entry), {
7416
+ for (const entry of await readdir(cacheRoot)) if (entry !== "0.13.7") await rm(join(cacheRoot, entry), {
7222
7417
  recursive: true,
7223
7418
  force: true
7224
7419
  });
@@ -7303,12 +7498,12 @@ function mergeCustomAgentSettings(input, custom) {
7303
7498
  if (custom.tables !== void 0 && !output.includes(custom.tables)) output = `${output.trimEnd()}\n\n${custom.tables}`;
7304
7499
  return `${output.trimEnd()}\n`;
7305
7500
  }
7306
- async function writeInstalledAgents(root, platform, plan, fastMode) {
7501
+ async function writeInstalledAgents(root, platform, plan, fastMode, specializations) {
7307
7502
  await Promise.all(AGENTS.map(async (agent) => {
7308
7503
  const path = join(root, `${agent}.toml`);
7309
7504
  const route = MODEL_ROUTING_PLANS[plan].agents[agent];
7310
7505
  let source = await readText(path);
7311
- source = composeAgentPolicies(source, platform);
7506
+ source = composeAgentPolicies(source, platform, specializations);
7312
7507
  source = replaceTomlString(source, "model", route.model);
7313
7508
  source = replaceTomlString(source, "model_reasoning_effort", route.reasoningEffort);
7314
7509
  source = replaceTomlString(source, "model_verbosity", "low");
@@ -7316,11 +7511,12 @@ async function writeInstalledAgents(root, platform, plan, fastMode) {
7316
7511
  await atomicWrite(path, source);
7317
7512
  }));
7318
7513
  }
7319
- function composeAgentPolicies(input, platform) {
7514
+ function composeAgentPolicies(input, platform, specializations) {
7320
7515
  const policy = [
7321
7516
  LITE_WRITING_POLICY,
7322
7517
  CONTEXT7_POLICY,
7323
- ...platform === "win32" ? [WINDOWS_SHELL_POLICY] : []
7518
+ ...platform === "win32" ? [WINDOWS_SHELL_POLICY] : [],
7519
+ ...specializationInstructions(specializations)
7324
7520
  ].join("\n\n");
7325
7521
  return input.replace(/(developer_instructions\s*=\s*"""\r?\n)/, `$1${policy}\n\n`);
7326
7522
  }
@@ -7426,12 +7622,18 @@ ${section("OPTIONS")}
7426
7622
  --json Print machine-readable output
7427
7623
  --computer-use Enable and verify the official Computer Use plugin
7428
7624
  --no-computer-use Keep Computer Use disabled
7625
+ --work Enable Work plugins and skills
7626
+ --no-work Keep Work disabled
7627
+ --web Enable Web plugins and skills
7628
+ --no-web Keep Web disabled
7629
+ --security Enable Security plugins and skills
7630
+ --no-security Keep Security disabled
7429
7631
  `;
7430
7632
  }
7431
7633
  /** Renders install-specific model plan and option help. */
7432
7634
  function renderInstallHelp(version, color) {
7433
7635
  const title = paint(color, `${BOLD}${CYAN}`, `HolyCodex ${version}`);
7434
- const section = (text) => `${paint(color, BOLD, text)}${text === "Options:" ? "\n --computer-use Enable and verify the official Computer Use plugin\n --no-computer-use Keep Computer Use disabled" : ""}`;
7636
+ const section = (text) => `${paint(color, BOLD, text)}${text === "Options:" ? "\n --computer-use Enable and verify the official Computer Use plugin\n --no-computer-use Keep Computer Use disabled\n --work Enable Work plugins and skills\n --no-work Keep Work disabled\n --web Enable Web plugins and skills\n --no-web Keep Web disabled\n --security Enable Security plugins and skills\n --no-security Keep Security disabled" : ""}`;
7435
7637
  return `${title}
7436
7638
 
7437
7639
  ${section("Usage:")}
@@ -7450,6 +7652,12 @@ ${section("Options:")}
7450
7652
  --codex-autonomous Never ask; keep workspace sandbox
7451
7653
  --no-codex-autonomous Safe interactive defaults
7452
7654
  --dangerous-codex-autonomous Never ask; disable filesystem sandbox
7655
+ --work Enable Work plugins and skills
7656
+ --no-work Keep Work disabled
7657
+ --web Enable Web plugins and skills
7658
+ --no-web Keep Web disabled
7659
+ --security Enable Security plugins and skills
7660
+ --no-security Keep Security disabled
7453
7661
  -h, --help Show help
7454
7662
 
7455
7663
  Plans provide increasing expected model usage and capability. Fast flags are mutually exclusive.
@@ -7489,15 +7697,22 @@ function renderOfficialPlugins(result) {
7489
7697
  return [
7490
7698
  renderOfficialPlugin("Codex Security", result.codexSecurity),
7491
7699
  renderComputerUse(result.computerUse),
7492
- renderOfficialPlugin("Build Web Apps", result.buildWebApps)
7700
+ renderOfficialPlugin("Build Web Apps", result.buildWebApps),
7701
+ renderWork(result.work)
7493
7702
  ].join("");
7494
7703
  }
7704
+ function renderWork(result) {
7705
+ if (result === void 0) return "";
7706
+ if (result.status === "disabled") return "\n Work is disabled.";
7707
+ return `\n Work is enabled (${Object.keys(result.plugins).length} official plugins selected).`;
7708
+ }
7495
7709
  function renderComputerUse(result) {
7496
7710
  if (result?.status === "disabled") return "\n Computer Use is disabled.";
7497
7711
  return renderOfficialPlugin("Computer Use", result);
7498
7712
  }
7499
7713
  function renderOfficialPlugin(name, plugin) {
7500
7714
  if (plugin === void 0) return "";
7715
+ if (plugin.status === "disabled") return `\n ${name} is disabled.`;
7501
7716
  if (plugin.status === "installed") return `\n Installed official ${name} plugin.`;
7502
7717
  if (plugin.status === "enabled") return `\n Enabled existing official ${name} plugin.`;
7503
7718
  if (plugin.status === "already-installed") return `\n Official ${name} plugin is already installed and enabled.`;
@@ -7545,6 +7760,9 @@ async function main(args = process$1.argv.slice(2)) {
7545
7760
  const options = {
7546
7761
  autonomy: parsed.autonomy,
7547
7762
  ...parsed.computerUse === void 0 ? {} : { computerUse: parsed.computerUse },
7763
+ ...parsed.work === void 0 ? {} : { work: parsed.work },
7764
+ ...parsed.web === void 0 ? {} : { web: parsed.web },
7765
+ ...parsed.security === void 0 ? {} : { security: parsed.security },
7548
7766
  fast: parsed.fast,
7549
7767
  json: parsed.json,
7550
7768
  ...parsed.plan === void 0 ? {} : { plan: parsed.plan },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "holycodex",
3
- "version": "0.13.6",
3
+ "version": "0.13.7",
4
4
  "description": "HolyCodex installer, doctor, and cleanup CLI for durable Codex workflows",
5
5
  "keywords": [
6
6
  "agents",
@@ -42,7 +42,7 @@
42
42
  "prepack": "vp run --workspace-root build"
43
43
  },
44
44
  "dependencies": {
45
- "@holycodex/plugin": "0.13.6",
45
+ "@holycodex/plugin": "0.13.7",
46
46
  "zod": "^4.4.3"
47
47
  },
48
48
  "devDependencies": {