@a-company/paradigm 5.27.0 → 5.27.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/chunk-KYA4TP26.js +2 -0
- package/dist/{enforcement-MKFUH4TE.js → enforcement-46XWPNSA.js} +1 -1
- package/dist/{enforcement-TJOXPSTJ.js → enforcement-BEGPQIUN.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/mcp.js +1 -1
- package/dist/{shift-TDOYQKR4.js → shift-WNP27SPB.js} +7 -7
- package/package.json +1 -1
- package/dist/chunk-27FBCZX6.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import*as i from'fs';import*as u from'path';import*as f from'js-yaml';var s=["purpose-coverage","purpose-exists","portal-gates","aspect-anchors","purpose-freshness","aspect-advisory","lore-required","habits-blocking","purpose-required-patterns","drift-detection","portal-compliance","graduation-tracking","orchestration-required"];var A={"purpose-coverage":"block","purpose-exists":"block","portal-gates":"block","aspect-anchors":"block","purpose-freshness":"warn","aspect-advisory":"warn","lore-required":"block","habits-blocking":"block","purpose-required-patterns":"block","drift-detection":"block","portal-compliance":"block","graduation-tracking":"warn","orchestration-required":"block"},O={"purpose-coverage":"block","purpose-exists":"warn","portal-gates":"warn","aspect-anchors":"warn","purpose-freshness":"warn","aspect-advisory":"off","lore-required":"warn","habits-blocking":"block","purpose-required-patterns":"warn","drift-detection":"warn","portal-compliance":"warn","graduation-tracking":"off","orchestration-required":"warn"},P={"purpose-coverage":"warn","purpose-exists":"off","portal-gates":"off","aspect-anchors":"off","purpose-freshness":"off","aspect-advisory":"off","lore-required":"off","habits-blocking":"warn","purpose-required-patterns":"off","drift-detection":"off","portal-compliance":"off","graduation-tracking":"off","orchestration-required":"off"},x={strict:A,balanced:O,minimal:P};function p(e){return {...x[e]}}function V(e,t){return x[e][t]}function b(e){return s.includes(e)}function E(e){return e==="block"||e==="warn"||e==="off"}function S(e){return e==="strict"||e==="balanced"||e==="minimal"}var L="minimal",j={threshold:3,detection:"git-diff",exempt:["*.md","*.yaml","*.yml",".purpose"]};function T(e){let t=u.join(e,".paradigm","config.yaml");if(!i.existsSync(t))return h();try{let n=i.readFileSync(t,"utf8"),r=f.load(n);if(!r||typeof r!="object")return h();let o=r.enforcement;if(!o||typeof o!="object")return h();let y=o.level,q=typeof y=="string"&&S(y)?y:L,v=o.checks,w={};if(v&&typeof v=="object")for(let[d,C]of Object.entries(v))b(d)&&typeof C=="string"&&E(C)&&(w[d]=C);let c=o.orchestration,l={...j};return c&&typeof c=="object"&&(typeof c.threshold=="number"&&(l.threshold=c.threshold),typeof c.detection=="string"&&(l.detection=c.detection),Array.isArray(c.exempt)&&(l.exempt=c.exempt.filter(d=>typeof d=="string"))),{level:q,checks:w,orchestration:l}}catch{return h()}}function h(){return {level:L,checks:{},orchestration:{...j}}}function _(e,t){let n=e.checks[t];return n!==void 0?n:p(e.level)[t]}function D(e){let t=p(e.level);for(let n of s){let r=e.checks[n];r!==void 0&&(t[n]=r);}return t}function k(e){let t=u.join(e,".paradigm","config.yaml");if(!i.existsSync(t))throw new Error(`Config not found: ${t}`);let n=i.readFileSync(t,"utf8"),r=f.load(n);if(!r||typeof r!="object")throw new Error("Config is not a valid YAML object");return [r,n]}function a(e,t){let n=u.join(e,".paradigm","config.yaml"),r=f.dump(t,{lineWidth:-1,noRefs:true,sortKeys:false,quotingType:"'"});i.writeFileSync(n,r,"utf8");}function g(e){return (!e.enforcement||typeof e.enforcement!="object")&&(e.enforcement={level:"minimal",checks:{}}),e.enforcement}function F(e,t){let[n]=k(e),r=g(n);r.level=t,a(e,n);}function H(e,t,n){let[r]=k(e),o=g(r);(!o.checks||typeof o.checks!="object")&&(o.checks={}),o.checks[t]=n,a(e,r);}function K(e,t){let[n]=k(e),r=g(n);r.checks&&typeof r.checks=="object"&&delete r.checks[t],a(e,n);}function M(e){let[t]=k(e),n=g(t);n.checks={},a(e,t);}function N(e){let t=u.join(e,".paradigm","config.yaml");if(!i.existsSync(t))return false;try{let n=i.readFileSync(t,"utf8"),r=f.load(n);return !r||typeof r!="object"||r.enforcement?!1:(r.enforcement={level:"balanced",checks:{},orchestration:{threshold:3,detection:"git-diff",exempt:["*.md","*.yaml","*.yml",".purpose"]}},a(e,r),!0)}catch{return false}}export{s as a,p as b,V as c,b as d,E as e,S as f,T as g,_ as h,D as i,F as j,H as k,K as l,M as m,N as n};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {g,i,a as a$1,f as f$1,j,d as d$1,e,k,m,l}from'./chunk-
|
|
2
|
+
import {g,i,a as a$1,f as f$1,j,d as d$1,e,k,m,l}from'./chunk-KYA4TP26.js';import {h,f,a,g as g$1,d,b}from'./chunk-WR6D3SC6.js';import'./chunk-5TAVYPOV.js';import t from'chalk';async function M(e){let o=process.cwd(),r=g(o),c=i(r),f$1=Object.keys(r.checks);if(e.json){h({level:r.level,orchestration:r.orchestration,overrides:r.checks,resolved:c});return}f("Enforcement Configuration"),a(""),g$1("Level",$(r.level)),g$1("Orchestration threshold",String(r.orchestration.threshold)+" files"),g$1("Detection",r.orchestration.detection),g$1("Overrides",f$1.length>0?String(f$1.length):t.dim("none")),a("");let i$1=30,m=12,b=12;a(" "+t.dim("Check ID".padEnd(i$1))+t.dim("Severity".padEnd(m))+t.dim("Source")),a(" "+t.dim("\u2500".repeat(i$1+m+b)));for(let v of a$1){let j=c[v],D=r.checks[v]!==void 0?t.cyan("override"):t.dim("preset");a(" "+v.padEnd(i$1)+y(j).padEnd(m+10)+D);}a("");}async function U(e){if(!f$1(e)){d(`Invalid level: ${e}. Must be one of: strict, balanced, minimal`),process.exitCode=1;return}let o=process.cwd();try{j(o,e),b(`Enforcement level set to ${$(e)}`);}catch(r){d(`Failed to set level: ${r.message}`),process.exitCode=1;}}async function H(e$1,o){if(!d$1(e$1)){d(`Unknown check ID: ${e$1}`),a(" Valid IDs: "+a$1.join(", ")),process.exitCode=1;return}if(!e(o)){d(`Invalid severity: ${o}. Must be one of: block, warn, off`),process.exitCode=1;return}let r=process.cwd();try{k(r,e$1,o),b(`Override set: ${e$1} = ${y(o)}`);}catch(c){d(`Failed to set override: ${c.message}`),process.exitCode=1;}}async function P(e){let o=process.cwd();if(!e){try{m(o),b("All enforcement overrides cleared");}catch(r){d(`Failed to reset overrides: ${r.message}`),process.exitCode=1;}return}if(!d$1(e)){d(`Unknown check ID: ${e}`),a(" Valid IDs: "+a$1.join(", ")),process.exitCode=1;return}try{l(o,e),b(`Override removed: ${e} (reverted to preset default)`);}catch(r){d(`Failed to reset override: ${r.message}`),process.exitCode=1;}}async function _(e){let o=process.cwd(),r=g(o),c=i(r);if(e.json){h(c);return}f("Resolved Enforcement Checks"),a("");for(let[f,i]of Object.entries(c))a(" "+f.padEnd(30)+y(i));a("");}function y(e){switch(e){case "block":return t.red("block");case "warn":return t.yellow("warn");case "off":return t.dim("off");default:return String(e)}}function $(e){switch(e){case "strict":return t.red(e);case "balanced":return t.yellow(e);case "minimal":return t.green(e);default:return e}}export{H as enforcementOverrideCommand,P as enforcementResetCommand,_ as enforcementResolveCommand,U as enforcementSetCommand,M as enforcementStatusCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export{a as CHECK_IDS,n as ensureEnforcementDefaults,h as getCheckSeverity,b as getPreset,c as getPresetSeverity,d as isValidCheckId,f as isValidLevel,e as isValidSeverity,g as loadEnforcementConfig,m as resetAllOverrides,l as resetCheckOverride,i as resolveAllChecks,k as setCheckOverride,j as setEnforcementLevel}from'./chunk-
|
|
2
|
+
export{a as CHECK_IDS,n as ensureEnforcementDefaults,h as getCheckSeverity,b as getPreset,c as getPresetSeverity,d as isValidCheckId,f as isValidLevel,e as isValidSeverity,g as loadEnforcementConfig,m as resetAllOverrides,l as resetCheckOverride,i as resolveAllChecks,k as setCheckOverride,j as setEnforcementLevel}from'./chunk-KYA4TP26.js';import'./chunk-5TAVYPOV.js';
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {Command}from'commander';import l from'chalk';import {createRequire}from'
|
|
|
3
3
|
${l.magenta("\u2554\u2550\u2557")}${l.cyan("\u250C\u2500\u2510\u252C\u2500\u2510\u250C\u2500\u2510\u250C\u252C\u2510\u252C \u250C\u2500\u2510\u250C\u252C\u2510")}
|
|
4
4
|
${l.magenta("\u2560\u2550\u255D")}${l.cyan("\u251C\u2500\u2524\u251C\u252C\u2518\u251C\u2500\u2524 \u2502\u2502\u2502 \u251C\u2500\u2510\u2502\u2502\u2502")}
|
|
5
5
|
${l.magenta("\u2569 ")}${l.cyan("\u2534 \u2534\u2534\u2514\u2500\u2534 \u2534\u2500\u2534\u2518\u2534 \u2514\u2500\u2518\u2534 \u2534")} ${l.gray(`v${E}`)}
|
|
6
|
-
`;i.name("paradigm").description("Unified developer tools ecosystem").version(E).addHelpText("before",B);i.command("init").description("Initialize Paradigm in the current project").option("-f, --force","Overwrite existing files").option("--name <name>","Project name").option("--ide <ide>","Target IDE: cursor, copilot, windsurf, claude").option("--stack <stack>","Stack preset (e.g., nextjs, fastapi, swift-ios). Auto-detected if omitted.").option("--migrate","Output migration prompt for existing IDE files").option("--quick","Non-interactive mode with smart defaults").option("--dry-run","Show what would be created without creating").action(async t=>{let{initCommand:o}=await import('./init-24MAQJFM.js');await o(t);});i.command("shift").description("Full project setup in one command (init + team init + scan + sync all IDEs + doctor)").option("-f, --force","Reinitialize even if already setup").option("-q, --quick","Skip slow operations (scan)").option("--verify","Run health checks after setup").option("--ide <ide>","Target specific IDE instead of all").option("--configure-models","Force model configuration prompts for team agents").option("--stack <stack>","Stack preset (e.g., nextjs, fastapi, swift-ios). Auto-detected if omitted.").option("--workspace <name>","Create or join a multi-project workspace with this name (creates ../.paradigm-workspace)").option("--workspace-path <path>","Custom workspace file location (default: ../.paradigm-workspace)").action(async t=>{let{shiftCommand:o}=await import('./shift-
|
|
6
|
+
`;i.name("paradigm").description("Unified developer tools ecosystem").version(E).addHelpText("before",B);i.command("init").description("Initialize Paradigm in the current project").option("-f, --force","Overwrite existing files").option("--name <name>","Project name").option("--ide <ide>","Target IDE: cursor, copilot, windsurf, claude").option("--stack <stack>","Stack preset (e.g., nextjs, fastapi, swift-ios). Auto-detected if omitted.").option("--migrate","Output migration prompt for existing IDE files").option("--quick","Non-interactive mode with smart defaults").option("--dry-run","Show what would be created without creating").action(async t=>{let{initCommand:o}=await import('./init-24MAQJFM.js');await o(t);});i.command("shift").description("Full project setup in one command (init + team init + scan + sync all IDEs + doctor)").option("-f, --force","Reinitialize even if already setup").option("-q, --quick","Skip slow operations (scan)").option("--verify","Run health checks after setup").option("--ide <ide>","Target specific IDE instead of all").option("--configure-models","Force model configuration prompts for team agents").option("--stack <stack>","Stack preset (e.g., nextjs, fastapi, swift-ios). Auto-detected if omitted.").option("--workspace <name>","Create or join a multi-project workspace with this name (creates ../.paradigm-workspace)").option("--workspace-path <path>","Custom workspace file location (default: ../.paradigm-workspace)").action(async t=>{let{shiftCommand:o}=await import('./shift-WNP27SPB.js');await o(t);});i.command("presets").description("List available stack presets for paradigm init/shift").option("-d, --discipline <discipline>","Filter by discipline (e.g., fullstack, api, mobile)").action(async t=>{let{listStackPresets:o}=await import('./discipline-H7LDI6NT.js'),a=(await import('chalk')).default,n=o(t.discipline);if(n.length===0){console.log(a.yellow(`
|
|
7
7
|
No presets found${t.discipline?` for discipline: ${t.discipline}`:""}
|
|
8
8
|
`));return}console.log(a.blue(`
|
|
9
9
|
Available Stack Presets
|
|
@@ -13,4 +13,4 @@ ${l.magenta("\u2569 ")}${l.cyan("\u2534 \u2534\u2534\u2514\u2500\u2534 \u2534\u
|
|
|
13
13
|
Usage: paradigm scan <command>
|
|
14
14
|
`),console.log("Commands:"),console.log(" auto [path] Auto-generate .purpose files from code analysis"),console.log("\nRun `paradigm scan auto --help` for options.\n");});var R=i.command("flow").description("Flow management commands");R.command("diagram <flowId>").description("Generate Mermaid diagram for a flow").option("-o, --output <path>","Output file path").action(async(t,o)=>{let{flowDiagramCommand:a}=await import('./flow-POQP27WA.js');await a(t,o);});R.action(()=>{R.outputHelp();});var s=i.command("team").description("Multi-agent orchestration commands");s.command("init [path]").description("Initialize team configuration with default agents").option("-f, --force","Overwrite existing configuration").option("--configure-models","Force model configuration prompts").option("--no-configure-models","Skip model configuration").option("--json","Output as JSON").action(async(t,o)=>{let{teamInitCommand:a}=await import('./team-MKLPUTW7.js');await a(t,{...o,configureModels:o.configureModels,noConfigureModels:o.configureModels===false});});s.command("status [path]").description("Show current team status").option("--running","Show only running orchestrations").option("--id <id>","Show specific orchestration").option("--json","Output as JSON").action(async(t,o)=>{let{teamStatusCommand:a}=await import('./team-MKLPUTW7.js');await a(t,o);});s.command("handoff [path]").description("Hand off current task to another agent").requiredOption("-t, --to <agent>","Target agent name").option("-s, --summary <text>","Summary of what was done").option("--json","Output as JSON").action(async(t,o)=>{let{teamHandoffCommand:a}=await import('./team-MKLPUTW7.js');await a(t,o);});s.command("accept [handoff-id] [path]").description("Accept a pending handoff").option("-n, --note <text>","Acceptance note").option("--json","Output as JSON").action(async(t,o,a)=>{let{teamAcceptCommand:n}=await import('./team-MKLPUTW7.js');await n(t,o,a);});s.command("check [path]").description("Check for conflicts and team health issues").option("--json","Output as JSON").action(async(t,o)=>{let{teamCheckCommand:a}=await import('./team-MKLPUTW7.js');await a(t,o);});s.command("history [path]").description("Show full activity log").option("-l, --limit <number>","Number of entries to show","50").option("--json","Output as JSON").action(async(t,o)=>{let{teamHistoryCommand:a}=await import('./team-MKLPUTW7.js');await a(t,{...o,limit:parseInt(o.limit)});});s.command("reset [path]").description("Reset team state for fresh start").option("-f, --force","Force reset even with pending work").option("--json","Output as JSON").action(async(t,o)=>{let{teamResetCommand:a}=await import('./team-MKLPUTW7.js');await a(t,o);});s.command("spawn <agent> [path]").description("Spawn an AI agent to work on a task").requiredOption("-t, --task <task>","Task for the agent to perform").option("-m, --model <model>","Model to use: opus, sonnet, haiku").option("-p, --provider <provider>","Provider: auto, claude, claude-code, claude-cli, manual").option("--budget <budget>",'Budget limits (e.g., "tokens=100000,cost=2")').option("--timeout <ms>","Timeout in milliseconds").option("--checkpoint","Pause for approval before writes/deletes").option("-q, --quiet","Suppress output").option("--json","Output as JSON").action(async(t,o,a)=>{let{teamSpawnCommand:n}=await import('./spawn-UH5RENSE.js');await n(t,o,a);});s.command("orchestrate <task> [path]").description("Orchestrate a multi-agent task").option("--solo","Run in solo mode (single Claude)").option("--faceted","Run in faceted mode (multi-agent, default)").option("--compare","Run both modes and compare results").option("--background","Run in background mode (returns immediately)").option("--notify <methods>","Notification methods: bell,desktop,file,webhook (default: bell)").option("-m, --model <model>","Orchestrator model: opus, sonnet, haiku").option("-p, --provider <provider>","Provider: auto, claude, claude-code, claude-cli, manual").option("--budget <budget>",'Budget limits (e.g., "tokens=500000,cost=5")').option("--checkpoint","Pause for approval between agents").option("--live","Stream agent output live").option("--pm","Enable PM governance (compliance checks before/after)").option("-q, --quiet","Suppress output").option("--json","Output as JSON").action(async(t,o,a)=>{let{teamOrchestrateCommand:n}=await import('./orchestrate-4L3NJCV5.js');await n(t,o,a);});s.command("diff <orchestration-id> [path]").description("Show diff of changes from a completed orchestration").option("--full","Show full file contents").option("--json","Output as JSON").action(async(t,o,a)=>{let{teamDiffCommand:n}=await import('./diff-YM6ZV3UI.js');await n(t,o,a);});s.command("accept-orch <orchestration-id> [path]").description("Accept orchestration changes").option("-n, --note <text>","Acceptance note").option("--json","Output as JSON").action(async(t,o,a)=>{let{teamAcceptOrchestrationCommand:n}=await import('./accept-orchestration-CLT6SAYW.js');await n(t,o,a);});s.command("reject-orch <orchestration-id> [path]").description("Reject orchestration changes").option("-r, --reason <text>","Rejection reason").option("--cleanup","Delete created files").option("--json","Output as JSON").action(async(t,o,a)=>{let{teamRejectOrchestrationCommand:n}=await import('./accept-orchestration-CLT6SAYW.js');await n(t,o,a);});s.command("cost [path]").description("Show cost summary for orchestrations").option("--from <date>","From date (ISO format)").option("--to <date>","To date (ISO format)").option("--days <n>","Last N days").option("-d, --detailed","Show detailed breakdown").option("--json","Output as JSON").action(async(t,o)=>{let{teamCostCommand:a}=await import('./cost-PK4KIF7R.js');await a(t,o);});s.command("export [path]").description("Export orchestration data").option("-f, --format <format>","Output format: json, csv","json").option("--from <date>","From date (ISO format)").option("--to <date>","To date (ISO format)").option("-o, --output <file>","Output file path").action(async(t,o)=>{let{teamExportCommand:a}=await import('./export-CV5KCTPS.js');await a(t,o);});s.command("providers [path]").description("Show available agent providers and their status").option("--set <provider>","Set preferred provider: auto, claude, claude-code, claude-cli, manual").option("--json","Output as JSON").action(async(t,o)=>{let{teamProvidersCommand:a}=await import('./providers-4PXMWA7V.js');await a(t,o);});s.command("models [path]").description("Configure or view agent model assignments").option("--refresh","Refresh model cache from environment").option("--json","Output as JSON").action(async(t,o)=>{let{teamModelsCommand:a}=await import('./team-MKLPUTW7.js');await a(t,o);});var z=s.command("agents").description("Agent management commands");z.command("suggest <task>").description("Suggest agents for a task based on triggers").option("--json","Output as JSON").action(async(t,o)=>{let{agentsSuggestCommand:a}=await import('./agents-suggest-HYTFMQD3.js');await a(t,o);});z.action(()=>{console.log(`
|
|
15
15
|
Usage: paradigm team agents <command>
|
|
16
|
-
`),console.log("Commands:"),console.log(" suggest <task> Suggest agents for a task based on triggers"),console.log("\nRun `paradigm team agents suggest --help` for options.\n");});s.action(async()=>{let{teamStatusCommand:t}=await import('./team-MKLPUTW7.js');await t(void 0,{});});var U=i.command("plugin").description("Plugin management commands");U.command("check").description("Check for updates to installed Claude Code plugins").option("-u, --update","Pull latest changes for all stale marketplace clones").action(async t=>{let{pluginCheckCommand:o}=await import('./check-THVGY4R5.js');await o(t);});U.action(async()=>{let{pluginCheckCommand:t}=await import('./check-THVGY4R5.js');await t({});});var j=i.command("workspace").description("Multi-project workspace commands");j.command("init").description("Create a .paradigm-workspace file from sibling projects").option("-n, --name <name>","Workspace name (default: directory name)").option("-f, --force","Overwrite existing workspace file").action(async t=>{let{workspaceInitCommand:o}=await import('./workspace-2ODL5WLY.js');await o(t);});j.command("status").description("Show workspace member status and symbol counts").option("--json","Output as JSON").action(async t=>{let{workspaceStatusCommand:o}=await import('./workspace-2ODL5WLY.js');await o(t);});j.command("reindex").description("Rebuild scan-index.json for all workspace members").option("-q, --quiet","Suppress progress output").action(async t=>{let{workspaceReindexCommand:o}=await import('./workspace-2ODL5WLY.js');await o(t);});j.action(async()=>{let{workspaceStatusCommand:t}=await import('./workspace-2ODL5WLY.js');await t({});});i.command("doctor").description("Health check - validate Paradigm setup").option("--context","Run only context audit checks (CLAUDE.md quality)").action(async t=>{let{doctorCommand:o}=await import('./doctor-HMQBF2WK.js');await o(t);});i.command("integrity").description("Symbol integrity check \u2014 broken refs, duplicates, orphans, missing anchors").option("--json","Output machine-readable JSON").action(async t=>{let{integrityCommand:o}=await import('./integrity-UYDOOJDP.js');await o(t);});i.command("review").description("Automated two-stage review pipeline \u2014 spec compliance + code quality").option("--pr <number>","Review a PR via gh CLI").option("--ci","Exit 1 on blocking findings").option("--deep","Include code quality checks (eval, secrets, console.log)").option("--json","Output machine-readable JSON").action(async t=>{let{reviewCommand:o}=await import('./review-6UAH6V3R.js');await o(t);});i.command("sweep").description("Entropy detection and cleanup \u2014 find orphaned symbols, stale purpose files, phantom gates").option("--dry","Report only, no fixes applied").option("--skip-fix","Same as --dry").option("-q, --quiet","Minimal output").action(async t=>{let{sweepCommand:o}=await import('./sweep-HU74OPVW.js');await o(t);});var K=i.command("drift").description("Aspect anchor drift detection");K.command("check").description("Check aspect anchors for drift and auto-heal shifted anchors").option("--json","Output as JSON").option("--auto-heal","Auto-heal shifted anchors (default: true)").option("--no-auto-heal","Disable auto-healing").action(async t=>{let{driftCheckCommand:o}=await import('./drift-ILZE5BFJ.js');await o(t);});var I=i.command("global").description("Manage Global Brain (~/.paradigm/)");I.command("clean").description("Remove old files from ~/.paradigm/ (Global Brain rotation)").option("--older-than <duration>","Remove files older than duration (e.g., 90d, 30d, 7d)","90d").option("-n, --dry-run","Show what would be deleted without deleting").action(async t=>{let{globalCleanCommand:o}=await import('./global-C44FW4G2.js');await o(t);});I.action(()=>{I.outputHelp();});i.command("watch").description("Watch for changes and auto-sync IDE files").action(async()=>{let{watchCommand:t}=await import('./watch-LRM5XD46.js');await t();});i.command("summary").description("Generate .paradigm/project.md with project stats").action(async()=>{let{summaryCommand:t}=await import('./summary-ZJLQ6KHB.js');await t();});i.command("constellation [path]").alias("const").description("Generate .paradigm/constellation.json - symbol relationship graph for AI agents").option("-f, --format <format>","Output format: json or yaml","json").option("-o, --output <path>","Custom output path").option("-q, --quiet","Suppress output").action(async(t,o)=>{let{constellationCommand:a}=await import('./constellation-CG7C4WFE.js');await a(t,o);});i.command("beacon [path]").description("Generate .paradigm/beacon.md - quick-start orientation for AI agents").option("-r, --refresh","Regenerate even if beacon exists").option("-o, --output <path>","Custom output path").option("--json","Output as JSON (for AI agent queries)").option("-q, --quiet","Suppress output").action(async(t,o)=>{let{beaconCommand:a}=await import('./beacon-5QVYV5DF.js');await a(t,o);});i.command("ripple <symbol> [path]").description("Show change impact analysis for a symbol").option("-d, --depth <depth>","Analysis depth (default: 1)","1").option("--json","Output as JSON").option("-q, --quiet","Suppress output").action(async(t,o,a)=>{let{rippleCommand:n}=await import('./ripple-ZGDITCGB.js');await n(t,o,a);});var b=i.command("thread").description("Session continuity - pass context between AI agent sessions");b.command("show [path]").alias("s").description("Show current thread").option("--json","Output as JSON (for AI agent queries)").action(async(t,o)=>{let{threadShowCommand:a}=await import('./thread-HFXK65D4.js');await a(t,o);});b.command("save <message> [path]").description("Save activity to the thread trail").option("-q, --quiet","Suppress output").action(async(t,o,a)=>{let{threadSaveCommand:n}=await import('./thread-HFXK65D4.js');await n(t,o,a);});b.command("todo <task> [path]").description("Add a loose end (unfinished task)").option("-q, --quiet","Suppress output").action(async(t,o,a)=>{let{threadTodoCommand:n}=await import('./thread-HFXK65D4.js');await n(t,o,a);});b.command("note <note> [path]").description("Add a breadcrumb (note for next agent)").option("-q, --quiet","Suppress output").action(async(t,o,a)=>{let{threadNoteCommand:n}=await import('./thread-HFXK65D4.js');await n(t,o,a);});b.command("clear [path]").description("Clear the thread").option("-q, --quiet","Suppress output").action(async(t,o)=>{let{threadClearCommand:a}=await import('./thread-HFXK65D4.js');await a(t,o);});b.option("--json","Output as JSON (for AI agent queries)").action(async t=>{let{threadShowCommand:o}=await import('./thread-HFXK65D4.js');await o(void 0,t);});var x=i.command("echo").description("Error-to-symbol mapping - find related symbols for error codes");x.command("lookup <errorCode> [path]").alias("l").description("Look up an error code").option("--json","Output as JSON (for AI agent queries)").action(async(t,o,a)=>{let{echoCommand:n}=await import('./echo-UPTQUEDU.js');await n(t,o,a);});x.command("init [path]").description("Create .paradigm/echoes.yaml template").option("-q, --quiet","Suppress output").action(async(t,o)=>{let{echoInitCommand:a}=await import('./echo-UPTQUEDU.js');await a(t,o);});x.command("list [path]").alias("ls").description("List all error mappings").action(async t=>{let{echoListCommand:o}=await import('./echo-UPTQUEDU.js');await o(t);});x.argument("[errorCode]","Error code to look up").option("--json","Output as JSON (for AI agent queries)").action(async(t,o)=>{if(t){let{echoCommand:a}=await import('./echo-UPTQUEDU.js');await a(t,void 0,o);}else {let{echoListCommand:a}=await import('./echo-UPTQUEDU.js');await a();}});var u=i.command("tutorial").description("Interactive tutorial system");u.command("start [path]").description("Start the tutorial").action(async t=>{let{tutorialStartCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});u.command("step [n] [path]").description("Show tutorial step").action(async(t,o)=>{let{tutorialStepCommand:a}=await import('./tutorial-UC6YQMNN.js');await a(o,t);});u.command("checkpoint [path]").description("Validate current checkpoint").action(async t=>{let{tutorialCheckpointCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});u.command("next [path]").description("Move to next step").action(async t=>{let{tutorialNextCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});u.command("status [path]").description("Show tutorial progress").action(async t=>{let{tutorialStatusCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});u.command("reset [path]").description("Reset tutorial to beginning").action(async t=>{let{tutorialResetCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});u.command("bugs [path]").description("List intentional bugs").action(async t=>{let{tutorialBugsCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});var w=i.command("mcp").description("MCP server configuration for AI clients");w.command("setup").description("Configure MCP server for detected AI clients").option("-c, --client <client>","Target client: cursor, claude-desktop, continue, cline, all").option("-f, --force","Overwrite existing config").option("--json","Output as JSON").option("--no-gitignore","Do not add config to .gitignore").action(async t=>{let{mcpSetupCommand:o}=await import('./setup-KPIMRZ4Q.js');await o(t);});w.command("status").description("Show MCP configuration status across clients").option("--json","Output as JSON").action(async t=>{let{mcpStatusCommand:o}=await import('./setup-KPIMRZ4Q.js');await o(t);});w.command("list").alias("ls").description("List all configured MCP servers across all clients").option("--json","Output as JSON").action(async t=>{let{mcpListCommand:o}=await import('./setup-KPIMRZ4Q.js');await o(t);});w.command("remove [server]").alias("rm").description("Remove MCP server from client configs").option("-c, --client <client>","Target client: cursor, claude-desktop, continue, cline, all").option("-f, --force","Skip confirmation").option("--json","Output as JSON").action(async(t,o)=>{let{mcpRemoveCommand:a}=await import('./setup-KPIMRZ4Q.js');await a(t,o);});w.command("use-dev").description("Switch MCP configs to use local dev build").option("-c, --client <client>","Target client: cursor, claude-desktop, claude-code, continue, cline").option("--json","Output as JSON").action(async t=>{let{mcpUseDevCommand:o}=await import('./switch-CTW4PDGI.js');await o(t);});w.command("use-prod").description("Switch MCP configs back to global production binary").option("-c, --client <client>","Target client: cursor, claude-desktop, claude-code, continue, cline").option("--json","Output as JSON").action(async t=>{let{mcpUseProdCommand:o}=await import('./switch-CTW4PDGI.js');await o(t);});w.action(async()=>{let{mcpSwitchStatusCommand:t}=await import('./switch-CTW4PDGI.js');await t({});});i.command("promote").description("Copy local build to production (~/.paradigm-cli/)").option("-f, --force","Create production directory if missing").option("--skip-build","Skip npm run build step").option("--json","Output as JSON").action(async t=>{let{promoteCommand:o}=await import('./promote-NJQDZBZA.js');await o(t);});var v=i.command("wisdom").description("Team wisdom - preferences, antipatterns, decisions, expertise");v.command("show [symbol]").description("Display wisdom for symbols or overview").option("--json","Output as JSON").action(async(t,o)=>{let{wisdomShowCommand:a}=await import('./wisdom-XZ3QKPNP.js');await a(t,o);});v.command("init").description("Initialize wisdom directory with templates").option("-f, --force","Overwrite existing files").action(async t=>{let{wisdomInitCommand:o}=await import('./wisdom-XZ3QKPNP.js');await o(t);});v.command("add-antipattern").description("Add a new antipattern").requiredOption("--id <id>","Antipattern ID (e.g., api-001)").requiredOption("--symbols <symbols>","Comma-separated symbols").requiredOption("--description <desc>","What NOT to do").requiredOption("--reason <reason>","Why this is bad").requiredOption("--alternative <alt>","What to do instead").action(async t=>{let{wisdomAddAntipatternCommand:o}=await import('./wisdom-XZ3QKPNP.js');await o(t);});v.command("decide").description("Create a new decision record (ADR)").requiredOption("--id <id>","Decision ID (e.g., 001)").requiredOption("--title <title>","Decision title").requiredOption("--symbols <symbols>","Comma-separated symbols").requiredOption("--context <context>","Context/problem").requiredOption("--decision <decision>","The decision made").option("--status <status>","Status: proposed, accepted","proposed").action(async t=>{let{wisdomDecideCommand:o}=await import('./wisdom-XZ3QKPNP.js');await o(t);});v.command("expert [query]").description("Find experts for symbols or areas").option("--json","Output as JSON").action(async(t,o)=>{let{wisdomExpertCommand:a}=await import('./wisdom-XZ3QKPNP.js');await a(t,o);});v.option("--json","Output as JSON").action(async t=>{let{wisdomShowCommand:o}=await import('./wisdom-XZ3QKPNP.js');await o(void 0,t);});var y=i.command("history").description("Implementation history - tracking changes, validation, fragility");y.command("show [symbol]").description("Display history for symbols or overview").option("--json","Output as JSON").option("-l, --limit <number>","Number of entries","10").action(async(t,o)=>{let{historyShowCommand:a}=await import('./history-UW454SDP.js');await a(t,{...o,limit:parseInt(o.limit)});});y.command("init").description("Initialize history directory").option("-f, --force","Overwrite existing files").action(async t=>{let{historyInitCommand:o}=await import('./history-UW454SDP.js');await o(t);});y.command("fragile").description("Show fragile symbols that need extra care").option("--json","Output as JSON").action(async t=>{let{historyFragileCommand:o}=await import('./history-UW454SDP.js');await o(t);});y.command("reindex").description("Regenerate index from log").action(async()=>{let{historyReindexCommand:t}=await import('./history-UW454SDP.js');await t();});y.command("record").description("Record an implementation event").requiredOption("--type <type>","Type: implement, refactor, rollback").requiredOption("--symbols <symbols>","Comma-separated symbols").requiredOption("--description <desc>","What was done").option("--intent <intent>","Intent: feature, fix, refactor").option("--commit <hash>","Git commit hash").option("--reason <reason>","Reason for rollback").action(async t=>{let{historyRecordCommand:o}=await import('./history-UW454SDP.js');await o(t);});y.command("validate").description("Record a validation result").requiredOption("--result <result>","Result: pass, fail, partial").option("--ref <id>","Implementation ID being validated").option("--passed <n>","Tests passed").option("--failed <n>","Tests failed").action(async t=>{let{historyValidateCommand:o}=await import('./history-UW454SDP.js');await o({...t,passed:t.passed?parseInt(t.passed):void 0,failed:t.failed?parseInt(t.failed):void 0});});y.option("--json","Output as JSON").action(async t=>{let{historyShowCommand:o}=await import('./history-UW454SDP.js');await o(void 0,t);});var N=i.command("hooks").description("Git hooks for automatic history capture");N.command("install").description("Install git hooks, Claude Code hooks, and Cursor hooks").option("-f, --force","Overwrite existing hooks").option("--post-commit","Only install post-commit hook").option("--pre-push","Only install pre-push hook").option("--claude-code","Only install Claude Code hooks (stop + pre-commit)").option("--cursor","Only install Cursor hooks (.cursor/hooks.json)").option("--dry-run","Show what would be installed without making changes").action(async t=>{let{hooksInstallCommand:o}=await import('./hooks-E7HQQ57M.js');await o(t);});N.command("uninstall").description("Remove paradigm hooks (git hooks, or --cursor for Cursor hooks)").option("--cursor","Remove Cursor hooks instead of git hooks").option("--dry-run","Show what would be removed without making changes").action(async t=>{let{hooksUninstallCommand:o}=await import('./hooks-E7HQQ57M.js');await o(t);});N.command("status").description("Check git hooks status").action(async()=>{let{hooksStatusCommand:t}=await import('./hooks-E7HQQ57M.js');await t();});N.action(async()=>{let{hooksStatusCommand:t}=await import('./hooks-E7HQQ57M.js');await t();});var r=i.command("triage").description("Semantic error triage - incident management and pattern matching");r.command("list").alias("ls").description("List recent incidents with matched patterns").option("-l, --limit <number>","Maximum incidents to show","10").option("-s, --status <status>","Filter by status: open, investigating, resolved, wont-fix, all").option("--symbol <symbol>","Filter by symbol (e.g., @checkout, ^auth)").option("-e, --env <environment>","Filter by environment").option("--search <text>","Search in error messages").option("--from <date>","Filter from date (ISO format)").option("--to <date>","Filter to date (ISO format)").option("--json","Output as JSON").action(async t=>{let{triageListCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});r.command("show <id>").description("Show full incident details").option("--timeline","Include flow timeline").option("--json","Output as JSON").action(async(t,o)=>{let{triageShowCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});r.command("resolve <id>").description("Mark incident as resolved").option("-p, --pattern <patternId>","Pattern that led to resolution").option("-c, --commit <hash>","Git commit hash of fix").option("--pr <url>","Pull request URL").option("-n, --notes <text>","Resolution notes").option("--wont-fix","Mark as will not fix").action(async(t,o)=>{let{triageResolveCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});r.command("note <id> <note>").description("Add a note to an incident").action(async(t,o)=>{let{triageNoteCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});r.command("link <id1> <id2>").description("Link two related incidents").action(async(t,o)=>{let{triageLinkCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});var g=r.command("patterns").description("Manage failure patterns");g.command("list").alias("ls").description("List all patterns").option("--source <source>","Filter by source: manual, suggested, imported, community").option("--min-confidence <score>","Minimum confidence score").option("--json","Output as JSON").action(async t=>{let{triagePatternsListCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});g.command("show <id>").description("Show pattern details").option("--json","Output as JSON").action(async(t,o)=>{let{triagePatternsShowCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});g.command("add").description("Create a new pattern").requiredOption("--id <id>","Pattern ID (kebab-case)").requiredOption("--name <name>","Human-readable name").option("--description <text>","Pattern description").option("--symbols <pairs>",'Symbol criteria (e.g., "feature:@checkout,gate:^auth")').option("--error-contains <keywords>","Error keywords (comma-separated)").option("--missing-signals <signals>","Expected missing signals (comma-separated)").option("--strategy <strategy>","Resolution strategy: retry, fallback, fix-data, fix-code, ignore, escalate","fix-code").option("--priority <priority>","Priority: low, medium, high, critical","medium").option("--code-hint <text>","Code hint for resolution").option("--tags <tags>","Tags (comma-separated)").option("--from-incident <id>","Generate suggestion from incident").action(async t=>{let{triagePatternsAddCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});g.command("delete <id>").alias("rm").description("Delete a pattern").action(async t=>{let{triagePatternsDeleteCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});g.command("test <id>").description("Test pattern against historical incidents").option("-l, --limit <number>","Max incidents to test against","100").option("--json","Output as JSON").action(async(t,o)=>{let{triagePatternsTestCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});g.command("seed").description("Load built-in seed patterns").action(async()=>{let{triagePatternsSeedCommand:t}=await import('./triage-FCWOZASE.js');await t();});g.action(async()=>{let{triagePatternsListCommand:t}=await import('./triage-FCWOZASE.js');await t({});});r.command("export <type>").description("Export patterns or full backup (type: patterns, backup)").option("-o, --output <path>","Output file path").option("--include-private","Include private patterns").action(async(t,o)=>{let{triageExportCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});r.command("import <file>").description("Import patterns from JSON file").option("--overwrite","Overwrite existing patterns").action(async(t,o)=>{let{triageImportCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});r.command("restore <file>").description("Restore from full backup").action(async t=>{let{triageRestoreCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});r.command("stats").description("Show statistics dashboard").option("-p, --period <period>","Time period: 1d, 7d, 30d, 90d","7d").option("--symbol <symbol>","Show health for specific symbol").option("--json","Output as JSON").action(async t=>{let{triageStatsCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});r.command("record").description("Manually record an incident").requiredOption("--error <message>","Error message").requiredOption("-e, --env <environment>","Environment").option("--feature <symbol>","Feature symbol (@...)").option("--component <symbol>","Component symbol (#...)").option("--flow <symbol>","Flow symbol ($...)").option("--gate <symbol>","Gate symbol (^...)").option("--signal <symbol>","Signal symbol (!...)").option("--state <symbol>","State symbol (%...)").option("--integration <symbol>","Integration symbol (&...)").option("--service <name>","Service name").option("--version <version>","App version").option("--stack <trace>","Stack trace").option("--json","Output as JSON").action(async t=>{let{triageRecordCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});r.option("-l, --limit <number>","Maximum incidents to show","10").option("-s, --status <status>","Filter by status").option("--json","Output as JSON").action(async t=>{let{triageListCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});var c=i.command("lore").description("Project lore - timeline of everything that happened to this project");c.command("list").alias("ls").description("List recent lore entries").option("--author <author>","Filter by author").option("--type <type>","Filter by type: agent-session, human-note, decision, review, incident, milestone, retro, insight").option("--symbol <symbol>","Filter by symbol").option("--tags <tags>","Filter by tags (comma-separated)").option("--from <date>","Filter from date (ISO format, e.g., 2026-02-20)").option("--to <date>","Filter to date (ISO format)").option("-l, --limit <number>","Number of entries","20").option("--json","Output as JSON").action(async t=>{let{loreListCommand:o}=await import('./list-YKIQNKGB.js');await o(t);});c.command("show <id>").description("Show full detail for a lore entry").option("--json","Output as JSON").action(async(t,o)=>{let{loreShowCommand:a}=await import('./show-PJ5LFLIL.js');await a(t,o);});c.command("record").description("Record a new lore entry (human note, milestone, etc.)").option("--type <type>","Entry type: human-note, decision, milestone, retro, insight","human-note").option("--author <author>","Author name").option("--title <title>","Entry title").option("--summary <summary>","Entry summary").option("--symbols <symbols>","Comma-separated symbols").option("--tags <tags>","Comma-separated tags").option("--files-modified <files>","Comma-separated files modified").option("--files-created <files>","Comma-separated files created").option("--commit <hash>","Git commit hash").option("--learnings <items>","Comma-separated learnings").option("--duration <minutes>","Duration in minutes").option("--meta <json>",`Project-defined metadata as JSON (e.g., '{"sprint": 12}')`).option("--body <text>","Long-form content (detailed notes, rationale, etc.)").option("--link-lore <ids>","Comma-separated lore entry IDs to link").option("--link-commits <shas>","Comma-separated git commit SHAs to link").option("--confidence <number>","Confidence in correctness (0.0 to 1.0)").action(async t=>{let{loreRecordCommand:o}=await import('./record-YXPB34MY.js');await o(t);});c.command("review <id>").description("Add a review to a lore entry").option("--reviewer <name>","Reviewer name").option("--completeness <n>","Completeness score (1-5)","3").option("--quality <n>","Quality score (1-5)","3").option("--notes <text>","Review notes").action(async(t,o)=>{let{loreReviewCommand:a}=await import('./review-77QI6VOC.js');await a(t,o);});c.command("assess <id> <verdict>").description("Record an assessment verdict on a lore entry (correct/partial/incorrect)").option("--assessor <name>","Assessor name").option("--notes <text>","Assessment notes").action(async(t,o,a)=>{let{loreAssessCommand:n}=await import('./assess-UFPYEJKP.js');await n(t,o,a);});c.command("calibration").description("Show calibration statistics across assessed lore entries").option("--symbol <symbol>","Filter by symbol").option("--tag <tag>","Filter by tag").option("--author <author>","Filter by author").option("--group-by <dimension>","Group by: symbol, tag, type").option("--json","Output as JSON").action(async t=>{let{loreCalibrationCommand:o}=await import('./calibration-OLJYB5HN.js');await o(t);});c.command("edit <id>").description("Edit an existing lore entry").option("--title <title>","New title").option("--summary <summary>","New summary").option("--type <type>","New type: agent-session, human-note, decision, review, incident, milestone").option("--symbols <symbols>","Comma-separated symbols").option("--tags <tags>","Comma-separated tags").option("--learnings <items>","Comma-separated learnings").action(async(t,o)=>{let{loreEditCommand:a}=await import('./edit-GUU3HBVW.js');await a(t,o);});c.command("delete <id>").description("Delete a lore entry").option("-y, --yes","Skip confirmation").option("--dry-run","Show what would be deleted without making changes").action(async(t,o)=>{let{loreDeleteCommand:a}=await import('./delete-P5VULXR4.js');await a(t,o);});c.command("migrate-assessments").description("Migrate assessment entries to lore with arc: tags").option("--dry-run","Show what would be migrated without making changes").action(async t=>{let{loreMigrateAssessmentsCommand:o}=await import('./migrate-assessments-GEI5WMI2.js');await o(t);});c.command("retag").description("Add or remove tags from matching lore entries").option("--add <tag>","Tag to add").option("--remove <tag>","Tag to remove").option("--type <type>","Filter by entry type").option("--symbol <symbol>","Filter by symbol").option("--author <author>","Filter by author").option("--from <date>","Filter from date").option("--to <date>","Filter to date").option("--tags <tags>","Filter by existing tags (comma-separated)").option("--dry-run","Show what would change without making changes").action(async t=>{let{loreRetagCommand:o}=await import('./retag-N5XF3KXP.js');await o(t);});c.command("timeline").description("Show lore timeline grouped by date with hot symbols and authors").option("-l, --limit <number>","Number of entries","20").option("--json","Output as JSON").action(async t=>{let{loreTimelineCommand:o}=await import('./timeline-K3ZFKJ3R.js');await o(t);});c.option("-p, --port <port>","Port to run on","3840").option("--no-open","Don't open browser automatically").action(async t=>{let{loreServeCommand:o}=await import('./serve-L52ZUTU6.js');await o(void 0,t);});i.command("serve").description("Launch Paradigm Platform \u2014 unified development management UI").option("-p, --port <port>","Port to run on","3850").option("--no-open","Don't open browser automatically").option("--sections <list>","Comma-separated sections to enable (e.g., lore,graph,git)").action(async t=>{let{serveCommand:o}=await import('./serve-ZJ3EXVA5.js');await o(t);});var X=i.command("graph").description("Interactive symbol relationship graph").argument("[path]","Project directory",void 0).option("-p, --port <port>","Port to run on","3841").option("--no-open","Don't open browser automatically").action(async(t,o)=>{let{graphCommand:a}=await import('./graph-CNDE5TAT.js');await a(t,o);});X.command("generate").description("Generate a named graph file in .paradigm/graphs/").argument("<name>","Graph name (used as filename: {name}.graph.json)").argument("[path]","Project directory",void 0).option("-s, --symbols <list>","Comma-separated symbol names to include").option("-g, --group <spec...>",'Group spec: "Label:#sym1,#sym2" (repeatable)').option("-l, --link <spec...>",'Link spec: "Source>Target:label" (repeatable)').action(async(t,o,a)=>{let{graphGenerateCommand:n}=await import('./graph-CNDE5TAT.js');await n(t,o,a);});var m=i.command("habits").description("Behavioral habits - practice tracking and compliance");m.command("list").alias("ls").description("List all configured habits").option("--trigger <trigger>","Filter by trigger: preflight, postflight, on-stop, on-commit").option("--category <category>","Filter by category: discovery, verification, testing, documentation, collaboration, security").option("--json","Output as JSON").action(async t=>{let{habitsListCommand:o}=await import('./habits-GICVMTJL.js');await o(t);});m.command("status").description("Show practice profile with compliance rates").option("-p, --period <period>","Time period: 7d, 30d, 90d, all","30d").option("--json","Output as JSON").action(async t=>{let{habitsStatusCommand:o}=await import('./habits-GICVMTJL.js');await o(t);});m.command("init").description("Initialize habits.yaml with seed habits").option("-f, --force","Overwrite existing file").action(async t=>{let{habitsInitCommand:o}=await import('./habits-GICVMTJL.js');await o(t);});m.command("check").description("Evaluate habit compliance for a trigger point").requiredOption("-t, --trigger <trigger>","Trigger: preflight, postflight, on-stop, on-commit").option("--record","Record practice events to Sentinel").option("--json","Output as JSON").option("--files <files>","Comma-separated files modified (default: git diff)").option("--symbols <symbols>","Comma-separated symbols touched").action(async t=>{let{habitsCheckCommand:o}=await import('./habits-GICVMTJL.js');await o(t);});m.command("add").description("Add a custom habit").requiredOption("--id <id>","Habit ID (kebab-case)").requiredOption("--name <name>","Human-readable name").requiredOption("--description <desc>","What this habit enforces").requiredOption("--category <category>","Category: discovery, verification, testing, documentation, collaboration, security").requiredOption("--trigger <trigger>","Trigger: preflight, postflight, on-stop, on-commit").option("--severity <severity>","Severity: advisory, warn, block","advisory").option("--tools <tools>","Comma-separated tools to check (for tool-called check type)").option("--check-type <type>","Check type: tool-called, file-exists, file-modified, lore-recorded, symbols-registered, gates-declared, tests-exist, git-clean","tool-called").option("--patterns <patterns>","Comma-separated patterns (for file-exists, file-modified, tests-exist check types)").action(async t=>{let{habitsAddCommand:o}=await import('./habits-GICVMTJL.js');await o({...t,checkType:t.checkType});});m.command("edit <id>").description("Edit a habit (seed habits: only severity/enabled; custom: all fields)").option("--name <name>","New name").option("--description <desc>","New description").option("--category <category>","New category").option("--trigger <trigger>","New trigger").option("--severity <severity>","New severity: advisory, warn, block").option("--enabled <bool>","Enable or disable: true, false").option("--check-type <type>","New check type").option("--patterns <patterns>","Comma-separated patterns").option("--tools <tools>","Comma-separated tools").action(async(t,o)=>{let{habitsEditCommand:a}=await import('./habits-GICVMTJL.js');await a(t,{...o,checkType:o.checkType});});m.command("remove <id>").description("Remove a custom habit (seed habits cannot be removed, only disabled)").option("-y, --yes","Skip confirmation").action(async(t,o)=>{let{habitsRemoveCommand:a}=await import('./habits-GICVMTJL.js');await a(t,o);});m.command("enable <id>").description("Enable a habit").action(async t=>{let{habitsToggleCommand:o}=await import('./habits-GICVMTJL.js');await o(t,"enable");});m.command("disable <id>").description("Disable a habit").action(async t=>{let{habitsToggleCommand:o}=await import('./habits-GICVMTJL.js');await o(t,"disable");});m.action(async()=>{let{habitsListCommand:t}=await import('./habits-GICVMTJL.js');await t({});});var D=i.command("graduate").description("Automation tier graduation \u2014 migrate habits to hooks");D.command("status",{isDefault:true}).description("Show current automation tier of every habit").option("--json","Output as JSON").action(async t=>{let{graduateStatusCommand:o}=await import('./graduate-3BBSC27A.js');await o(t);});D.command("promote <habitId>").description("Graduate a habit to hook tier (skip MCP evaluation)").action(async t=>{let{graduatePromoteCommand:o}=await import('./graduate-3BBSC27A.js');await o(t);});D.command("demote <habitId>").description("Demote a habit from hook back to habit tier").option("--cooldown <days>","Cooldown period in days before re-graduation","14").action(async(t,o)=>{let{graduateDemoteCommand:a}=await import('./graduate-3BBSC27A.js');await a(t,o);});var h=i.command("persona").description("Personas \u2014 actor-driven journey testing");h.command("list",{isDefault:true}).alias("ls").description("List all personas").option("--tag <tag>","Filter by tag").option("--trigger <type>","Filter by trigger type (root, invitation, signup, api)").option("--gate <gate>","Filter by gate usage").option("--json","Output as JSON").action(async t=>{let{personaListCommand:o}=await import('./persona-STQWZH5P.js');await o(t);});h.command("show <id>").description("Show full persona detail").option("--json","Output as JSON").action(async(t,o)=>{let{personaShowCommand:a}=await import('./persona-STQWZH5P.js');await a(t,o);});h.command("validate [id]").description("Validate persona schema and cross-references").option("--json","Output as JSON").action(async(t,o)=>{let{personaValidateCommand:a}=await import('./persona-STQWZH5P.js');await a(t,o);});h.command("coverage").description("Coverage report \u2014 routes and gates with/without persona coverage").option("--json","Output as JSON").action(async t=>{let{personaCoverageCommand:o}=await import('./persona-STQWZH5P.js');await o(t);});h.command("run <id>").description("Execute persona journey against a running server").requiredOption("--base-url <url>","Base URL (e.g. http://localhost:3000)").option("--dry-run","Show steps without making HTTP requests").option("--json","Output as JSON").action(async(t,o)=>{let{personaRunCommand:a}=await import('./persona-STQWZH5P.js');await a(t,o);});h.command("affected <symbol>").description("Show which personas reference a given symbol (gate, flow, signal)").option("--json","Output as JSON").action(async(t,o)=>{let{personaAffectedCommand:a}=await import('./persona-STQWZH5P.js');await a(t,o);});h.command("delete <id>").description("Delete a persona").action(async t=>{let{personaDeleteCommand:o}=await import('./persona-STQWZH5P.js');await o(t);});var Y=i.command("sentinel").description("Sentinel \u2014 semantic error monitoring");Y.command("defend [path]",{isDefault:true}).description("Launch the Sentinel UI - unified codebase intelligence visualizer").option("-p, --port <port>","Port to run on","3838").option("--no-open","Don't open browser automatically").action(async(t,o)=>{let{sentinelCommand:a}=await import('./sentinel-HYAZ3CO5.js');await a(t,o);});i.command("conductor").description("Launch Paradigm Conductor \u2014 multimodal mission control for Claude Code sessions").option("--build","Force rebuild the native binary").option("--install","Install Conductor binary to ~/.paradigm/conductor/bin/").option("-v, --verbose","Show build output").action(async t=>{let{conductorCommand:o}=await import('./conductor-Y5IXELTL.js');await o(t);});var p=i.command("university").description("Per-project university - knowledge base, quizzes, learning paths & PLSAT certification");p.command("serve").description("Launch Paradigm University learning platform").option("-p, --port <port>","Port to run on","3839").option("--no-open","Don't open browser automatically").action(async t=>{let{universityServeCommand:o}=await import('./serve-OY6XYL7F.js');await o(void 0,t);});p.command("list").alias("ls").description("List university content").option("--type <type>","Filter by type: note, policy, guide, runbook, quiz, path").option("--tag <tag>","Filter by tag").option("--difficulty <level>","Filter by difficulty: beginner, intermediate, advanced").option("--symbol <symbol>","Filter by Paradigm symbol").option("-l, --limit <number>","Number of entries","20").option("--json","Output as JSON").action(async t=>{let{universityListCommand:o}=await import('./list-5IUGP3ZB.js');await o(t);});p.command("add <type>").description("Create university content (note, policy, guide, runbook, quiz)").option("--title <title>","Content title (required)").option("--body <text>","Content body (markdown)").option("--tags <tags>","Comma-separated tags").option("--symbols <symbols>","Comma-separated Paradigm symbols").option("--difficulty <level>","Difficulty: beginner, intermediate, advanced").option("--minutes <n>","Estimated reading time in minutes").action(async(t,o)=>{let{universityAddCommand:a}=await import('./add-P76GEMGF.js');await a(t,o);});p.command("show <id>").description("Show a content item in full").option("--json","Output as JSON").action(async(t,o)=>{let{universityShowCommand:a}=await import('./show-BOAVWZPZ.js');await a(t,o);});p.command("quiz <id>").description("Take an interactive quiz in the terminal").action(async t=>{let{universityQuizCommand:o}=await import('./quiz-FE5UGAY2.js');await o(t);});p.command("status").description("Show university content overview and completion stats").option("--json","Output as JSON").action(async t=>{let{universityStatusCommand:o}=await import('./status-A37ECYNJ.js');await o(t);});p.command("validate").description("Validate university content integrity").option("--deep","Enable deep cross-reference checks against scan-index").option("--id <id>","Validate a specific content item").option("--json","Output as JSON").action(async t=>{let{universityValidateCommand:o}=await import('./validate-C6SMKGYD.js');await o(t);});p.option("-p, --port <port>","Port to run on","3839").option("--no-open","Don't open browser automatically").action(async t=>{let{universityServeCommand:o}=await import('./serve-OY6XYL7F.js');await o(void 0,t);});var L=i.command("docs").description("Auto-generated documentation from the symbol graph");L.command("serve").description("Launch interactive docs viewer in browser").option("-p, --port <port>","Port number (default: 3850)").option("--no-open","Do not open browser automatically").action(async t=>{let{docsServeCommand:o}=await import('./docs-5BX2YWYK.js');await o(t);});L.command("build").description("Build static documentation site").option("-o, --output <dir>","Output directory (default: from config or .paradigm/docs-site)").action(async t=>{let{docsBuildCommand:o}=await import('./docs-5BX2YWYK.js');await o(t);});L.action(async()=>{let{docsServeCommand:t}=await import('./docs-5BX2YWYK.js');await t({});});var f=i.command("pipeline").description("Spec pipeline \u2014 structured feature workflow with configurable gates");f.command("start <description>").description("Create a new pipeline for a feature").option("--template <template>","Pipeline template (add-feature, bug-fix, security-change, refactor)","add-feature").option("--gates <gates>","Custom gate modes: specify,plan,task,implement,validate").action(async(t,o)=>{let{pipelineStartCommand:a}=await import('./pipeline-MZUITRVN.js');await a(t,o);});f.command("status [feature]").description("Show pipeline status").action(async t=>{let{pipelineStatusCommand:o}=await import('./pipeline-MZUITRVN.js');await o(t);});f.command("advance <feature>").description("Advance pipeline past current gate").action(async t=>{let{pipelineAdvanceCommand:o}=await import('./pipeline-MZUITRVN.js');await o(t);});f.command("configure <feature>").description("Change gate mode on active pipeline").requiredOption("--stage <stage>","Stage to configure").requiredOption("--gate <gate>","New gate mode (auto, manual, sentinel)").option("--reason <reason>","Reason for change").action(async(t,o)=>{let{pipelineConfigureCommand:a}=await import('./pipeline-MZUITRVN.js');await a(t,o);});f.command("abort <feature>").description("Cancel a pipeline").action(async t=>{let{pipelineAbortCommand:o}=await import('./pipeline-MZUITRVN.js');await o(t);});f.command("list").description("List all active pipelines").action(async()=>{let{pipelineListCommand:t}=await import('./pipeline-MZUITRVN.js');await t();});f.action(async()=>{let{pipelineListCommand:t}=await import('./pipeline-MZUITRVN.js');await t();});var e=i.command("symphony").description("Symphony \u2014 agent-to-agent messaging for multi-session collaboration");e.command("join").description("Join this session to the Symphony network").option("--remote <ip>","Connect to remote Symphony server").action(async t=>{let{symphonyJoinCommand:o}=await import('./symphony-ZQ5OHJTP.js');await o(t);});e.command("leave").description("Remove this session from the Symphony network").action(async()=>{let{symphonyLeaveCommand:t}=await import('./symphony-ZQ5OHJTP.js');await t();});e.command("whoami").description("Show this agent's identity and linked peers").action(async()=>{let{symphonyWhoamiCommand:t}=await import('./symphony-ZQ5OHJTP.js');await t();});e.command("list").alias("ls").description("List all joined agents").option("--json","Output as JSON").action(async t=>{let{symphonyListCommand:o}=await import('./symphony-ZQ5OHJTP.js');await o(t);});e.command("send <message>").description("Send a note to agents").option("--to <agent>","Send to specific agent (omit for broadcast)").option("--thread <id>","Reply to existing thread").action(async(t,o)=>{let{symphonySendCommand:a}=await import('./symphony-ZQ5OHJTP.js');await a(t,o);});e.command("read").description("Show unread notes").action(async()=>{let{symphonyReadCommand:t}=await import('./symphony-ZQ5OHJTP.js');await t();});e.command("inbox").description("Show unread notes (alias for read)").action(async()=>{let{symphonyReadCommand:t}=await import('./symphony-ZQ5OHJTP.js');await t();});e.command("threads").description("List all threads").option("--json","Output as JSON").action(async t=>{let{symphonyThreadsCommand:o}=await import('./symphony-ZQ5OHJTP.js');await o(t);});e.command("thread <id>").description("Show full thread conversation").action(async t=>{let{symphonyThreadCommand:o}=await import('./symphony-ZQ5OHJTP.js');await o(t);});e.command("resolve <id>").description("Mark a thread as resolved").option("--decision <text>","Decision text to record").action(async(t,o)=>{let{symphonyResolveCommand:a}=await import('./symphony-ZQ5OHJTP.js');await a(t,o);});e.command("status").description("Show Symphony network status").option("--json","Output as JSON").action(async t=>{let{symphonyStatusCommand:o}=await import('./symphony-ZQ5OHJTP.js');await o(t);});e.command("serve").description("Start Symphony relay server for cross-machine networking").option("--port <port>","Port to listen on","3939").option("--public","Show connection string for internet access").action(async t=>{let{symphonyServeCommand:o}=await import('./symphony-ZQ5OHJTP.js');await o(t);});var q=e.command("peers").description("Manage trusted remote peers");q.command("list",{isDefault:true}).description("List trusted peers and their agents").option("--json","Output as JSON").action(async t=>{let{symphonyPeersCommand:o}=await import('./peers-P2KXU7ZK.js');await o(t);});q.command("revoke <id>").description("Revoke trust for a peer (disconnects immediately)").action(async t=>{let{symphonyPeersRevokeCommand:o}=await import('./peers-P2KXU7ZK.js');await o(t);});q.command("forget").description("Clear all peer trust records").option("--force","Skip confirmation").action(async t=>{let{symphonyPeersForgetCommand:o}=await import('./peers-P2KXU7ZK.js');await o(t);});q.action(async()=>{let{symphonyPeersCommand:t}=await import('./peers-P2KXU7ZK.js');await t({});});e.command("request <file>").description("Request a file from another agent").option("--from <agent>","Agent to request from").option("--reason <text>","Why this file is needed").action(async(t,o)=>{let{symphonyRequestCommand:a}=await import('./symphony-ZQ5OHJTP.js');await a(t,o);});e.command("requests").description("List pending file requests").action(async()=>{let{symphonyRequestsCommand:t}=await import('./symphony-ZQ5OHJTP.js');await t();});e.command("approve <id>").description("Approve a file request").option("--redact","Strip sensitive lines before sending").action(async(t,o)=>{let{symphonyApproveCommand:a}=await import('./symphony-ZQ5OHJTP.js');await a(t,o);});e.command("deny <id>").description("Deny a file request").option("--reason <text>","Reason for denial").action(async(t,o)=>{let{symphonyDenyCommand:a}=await import('./symphony-ZQ5OHJTP.js');await a(t,o);});e.command("watch").description("Watch inbox in real-time \u2014 zero AI tokens, pure file monitoring").option("--interval <ms>","Poll interval in milliseconds (default: 2000)").option("--thread <id>","Only show messages from this thread").option("--quiet","Minimal output \u2014 messages only, no header").action(async t=>{let{symphonyWatchCommand:o}=await import('./symphony-ZQ5OHJTP.js');await o(t);});e.action(async()=>{let{symphonyStatusCommand:t}=await import('./symphony-ZQ5OHJTP.js');await t({});});var J=i.command("notebook").description("Agent notebook management \u2014 curated snippet libraries");J.command("list").alias("ls").description("List notebook entries").option("--agent <id>","Filter by agent ID").option("--json","Output as JSON").action(async t=>{let{notebookListCommand:o}=await import('./notebook-PE3JSYZI.js');await o(t);});J.command("show <id>").description("Show a specific notebook entry").option("--agent <id>","Agent ID").option("--json","Output as JSON").action(async(t,o)=>{let{notebookShowCommand:a}=await import('./notebook-PE3JSYZI.js');await a(t,o);});J.command("export").description("Export notebook entries").option("--agent <id>","Filter by agent ID").option("--format <format>","Output format: yaml or json (default: yaml)").action(async t=>{let{notebookExportCommand:o}=await import('./notebook-PE3JSYZI.js');await o(t);});J.action(async()=>{let{notebookListCommand:t}=await import('./notebook-PE3JSYZI.js');await t({});});var d=i.command("agent").description("Agent identity management \u2014 persistent profiles with expertise tracking");d.command("list").alias("ls").description("List all agent identity profiles").option("--json","Output as JSON").option("--global","Show only global profiles").option("--project","Show only project-level profiles").action(async t=>{let{agentListCommand:o}=await import('./agent-UUTYOFTH.js');await o(t);});d.command("show <id>").description("Show full agent profile with expertise table").option("--json","Output as JSON").action(async(t,o)=>{let{agentShowCommand:a}=await import('./agent-UUTYOFTH.js');await a(t,o);});d.command("create <id>").description("Create a new .agent identity file").option("-r, --role <role>","Agent role description").option("-d, --description <desc>","Extended description").option("-g, --global","Create in global ~/.paradigm/agents/ (default)").option("--deny-paths <patterns>",'Comma-separated glob patterns to deny (e.g., ".env*,*.key")').action(async(t,o)=>{let{agentCreateCommand:a}=await import('./agent-UUTYOFTH.js');await a(t,{...o,global:o.global!==false});});d.command("sync <id>").description("Bootstrap expertise from existing project lore").option("-n, --dry-run","Show what would change without writing").option("--json","Output as JSON").action(async(t,o)=>{let{agentSyncCommand:a}=await import('./agent-UUTYOFTH.js');await a(t,o);});var A=d.command("roster").description("Manage per-project agent roster (.paradigm/roster.yaml)");A.command("init").description("Create a roster based on detected project type").option("-f, --force","Overwrite existing roster").option("--json","Output as JSON").action(async t=>{let{rosterInitCommand:o}=await import('./roster-K2QILE7K.js');await o(t);});A.command("add <ids...>").description("Add one or more agents to the active roster").option("--json","Output as JSON").action(async(t,o)=>{let{rosterAddCommand:a}=await import('./roster-K2QILE7K.js');await a(t,o);});A.command("remove <ids...>").description("Remove one or more agents from the active roster").option("--json","Output as JSON").action(async(t,o)=>{let{rosterRemoveCommand:a}=await import('./roster-K2QILE7K.js');await a(t,o);});A.option("--json","Output as JSON").action(async t=>{let{rosterShowCommand:o}=await import('./roster-K2QILE7K.js');await o(t);});d.command("bench <id>").description("Bench an agent \u2014 Maestro will skip it during orchestration").action(async t=>{let{agentBenchCommand:o}=await import('./agent-UUTYOFTH.js');await o(t);});d.command("activate <id>").description("Activate a benched agent \u2014 restore to Maestro orchestration").action(async t=>{let{agentActivateCommand:o}=await import('./agent-UUTYOFTH.js');await o(t);});d.action(async()=>{let{agentListCommand:t}=await import('./agent-UUTYOFTH.js');await t({});});var O=i.command("enforcement").description("Manage enforcement configuration (check severities and levels)");O.command("set <level>").description("Set enforcement level preset (strict, balanced, minimal)").action(async t=>{let{enforcementSetCommand:o}=await import('./enforcement-MKFUH4TE.js');await o(t);});O.command("override <check-id> <severity>").description("Set a per-check severity override (block, warn, off)").action(async(t,o)=>{let{enforcementOverrideCommand:a}=await import('./enforcement-MKFUH4TE.js');await a(t,o);});O.command("reset [check-id]").description("Remove a per-check override, or all overrides if no check-id given").action(async t=>{let{enforcementResetCommand:o}=await import('./enforcement-MKFUH4TE.js');await o(t);});O.command("resolve").description("Output the fully resolved severity map (used by stop hook)").option("--json","Output as JSON").action(async t=>{let{enforcementResolveCommand:o}=await import('./enforcement-MKFUH4TE.js');await o(t);});O.command("status",{isDefault:true}).description("Show enforcement status table (default)").option("--json","Output as JSON").action(async t=>{let{enforcementStatusCommand:o}=await import('./enforcement-MKFUH4TE.js');await o(t);});i.command("compliance-check").description("Run all compliance checks (habits, drift, portal) in a single process").option("--json","Output as JSON").option("--auto-heal","Auto-heal drift violations").option("--trigger <event>","Trigger context (e.g., on-stop)","on-stop").option("--learn","Run postflight learning pass (convert session verdicts to journal entries)").action(async t=>{let{complianceCheckCommand:o}=await import('./compliance-LM2NN2S6.js');await o(t);});i.parse();
|
|
16
|
+
`),console.log("Commands:"),console.log(" suggest <task> Suggest agents for a task based on triggers"),console.log("\nRun `paradigm team agents suggest --help` for options.\n");});s.action(async()=>{let{teamStatusCommand:t}=await import('./team-MKLPUTW7.js');await t(void 0,{});});var U=i.command("plugin").description("Plugin management commands");U.command("check").description("Check for updates to installed Claude Code plugins").option("-u, --update","Pull latest changes for all stale marketplace clones").action(async t=>{let{pluginCheckCommand:o}=await import('./check-THVGY4R5.js');await o(t);});U.action(async()=>{let{pluginCheckCommand:t}=await import('./check-THVGY4R5.js');await t({});});var j=i.command("workspace").description("Multi-project workspace commands");j.command("init").description("Create a .paradigm-workspace file from sibling projects").option("-n, --name <name>","Workspace name (default: directory name)").option("-f, --force","Overwrite existing workspace file").action(async t=>{let{workspaceInitCommand:o}=await import('./workspace-2ODL5WLY.js');await o(t);});j.command("status").description("Show workspace member status and symbol counts").option("--json","Output as JSON").action(async t=>{let{workspaceStatusCommand:o}=await import('./workspace-2ODL5WLY.js');await o(t);});j.command("reindex").description("Rebuild scan-index.json for all workspace members").option("-q, --quiet","Suppress progress output").action(async t=>{let{workspaceReindexCommand:o}=await import('./workspace-2ODL5WLY.js');await o(t);});j.action(async()=>{let{workspaceStatusCommand:t}=await import('./workspace-2ODL5WLY.js');await t({});});i.command("doctor").description("Health check - validate Paradigm setup").option("--context","Run only context audit checks (CLAUDE.md quality)").action(async t=>{let{doctorCommand:o}=await import('./doctor-HMQBF2WK.js');await o(t);});i.command("integrity").description("Symbol integrity check \u2014 broken refs, duplicates, orphans, missing anchors").option("--json","Output machine-readable JSON").action(async t=>{let{integrityCommand:o}=await import('./integrity-UYDOOJDP.js');await o(t);});i.command("review").description("Automated two-stage review pipeline \u2014 spec compliance + code quality").option("--pr <number>","Review a PR via gh CLI").option("--ci","Exit 1 on blocking findings").option("--deep","Include code quality checks (eval, secrets, console.log)").option("--json","Output machine-readable JSON").action(async t=>{let{reviewCommand:o}=await import('./review-6UAH6V3R.js');await o(t);});i.command("sweep").description("Entropy detection and cleanup \u2014 find orphaned symbols, stale purpose files, phantom gates").option("--dry","Report only, no fixes applied").option("--skip-fix","Same as --dry").option("-q, --quiet","Minimal output").action(async t=>{let{sweepCommand:o}=await import('./sweep-HU74OPVW.js');await o(t);});var K=i.command("drift").description("Aspect anchor drift detection");K.command("check").description("Check aspect anchors for drift and auto-heal shifted anchors").option("--json","Output as JSON").option("--auto-heal","Auto-heal shifted anchors (default: true)").option("--no-auto-heal","Disable auto-healing").action(async t=>{let{driftCheckCommand:o}=await import('./drift-ILZE5BFJ.js');await o(t);});var I=i.command("global").description("Manage Global Brain (~/.paradigm/)");I.command("clean").description("Remove old files from ~/.paradigm/ (Global Brain rotation)").option("--older-than <duration>","Remove files older than duration (e.g., 90d, 30d, 7d)","90d").option("-n, --dry-run","Show what would be deleted without deleting").action(async t=>{let{globalCleanCommand:o}=await import('./global-C44FW4G2.js');await o(t);});I.action(()=>{I.outputHelp();});i.command("watch").description("Watch for changes and auto-sync IDE files").action(async()=>{let{watchCommand:t}=await import('./watch-LRM5XD46.js');await t();});i.command("summary").description("Generate .paradigm/project.md with project stats").action(async()=>{let{summaryCommand:t}=await import('./summary-ZJLQ6KHB.js');await t();});i.command("constellation [path]").alias("const").description("Generate .paradigm/constellation.json - symbol relationship graph for AI agents").option("-f, --format <format>","Output format: json or yaml","json").option("-o, --output <path>","Custom output path").option("-q, --quiet","Suppress output").action(async(t,o)=>{let{constellationCommand:a}=await import('./constellation-CG7C4WFE.js');await a(t,o);});i.command("beacon [path]").description("Generate .paradigm/beacon.md - quick-start orientation for AI agents").option("-r, --refresh","Regenerate even if beacon exists").option("-o, --output <path>","Custom output path").option("--json","Output as JSON (for AI agent queries)").option("-q, --quiet","Suppress output").action(async(t,o)=>{let{beaconCommand:a}=await import('./beacon-5QVYV5DF.js');await a(t,o);});i.command("ripple <symbol> [path]").description("Show change impact analysis for a symbol").option("-d, --depth <depth>","Analysis depth (default: 1)","1").option("--json","Output as JSON").option("-q, --quiet","Suppress output").action(async(t,o,a)=>{let{rippleCommand:n}=await import('./ripple-ZGDITCGB.js');await n(t,o,a);});var b=i.command("thread").description("Session continuity - pass context between AI agent sessions");b.command("show [path]").alias("s").description("Show current thread").option("--json","Output as JSON (for AI agent queries)").action(async(t,o)=>{let{threadShowCommand:a}=await import('./thread-HFXK65D4.js');await a(t,o);});b.command("save <message> [path]").description("Save activity to the thread trail").option("-q, --quiet","Suppress output").action(async(t,o,a)=>{let{threadSaveCommand:n}=await import('./thread-HFXK65D4.js');await n(t,o,a);});b.command("todo <task> [path]").description("Add a loose end (unfinished task)").option("-q, --quiet","Suppress output").action(async(t,o,a)=>{let{threadTodoCommand:n}=await import('./thread-HFXK65D4.js');await n(t,o,a);});b.command("note <note> [path]").description("Add a breadcrumb (note for next agent)").option("-q, --quiet","Suppress output").action(async(t,o,a)=>{let{threadNoteCommand:n}=await import('./thread-HFXK65D4.js');await n(t,o,a);});b.command("clear [path]").description("Clear the thread").option("-q, --quiet","Suppress output").action(async(t,o)=>{let{threadClearCommand:a}=await import('./thread-HFXK65D4.js');await a(t,o);});b.option("--json","Output as JSON (for AI agent queries)").action(async t=>{let{threadShowCommand:o}=await import('./thread-HFXK65D4.js');await o(void 0,t);});var x=i.command("echo").description("Error-to-symbol mapping - find related symbols for error codes");x.command("lookup <errorCode> [path]").alias("l").description("Look up an error code").option("--json","Output as JSON (for AI agent queries)").action(async(t,o,a)=>{let{echoCommand:n}=await import('./echo-UPTQUEDU.js');await n(t,o,a);});x.command("init [path]").description("Create .paradigm/echoes.yaml template").option("-q, --quiet","Suppress output").action(async(t,o)=>{let{echoInitCommand:a}=await import('./echo-UPTQUEDU.js');await a(t,o);});x.command("list [path]").alias("ls").description("List all error mappings").action(async t=>{let{echoListCommand:o}=await import('./echo-UPTQUEDU.js');await o(t);});x.argument("[errorCode]","Error code to look up").option("--json","Output as JSON (for AI agent queries)").action(async(t,o)=>{if(t){let{echoCommand:a}=await import('./echo-UPTQUEDU.js');await a(t,void 0,o);}else {let{echoListCommand:a}=await import('./echo-UPTQUEDU.js');await a();}});var u=i.command("tutorial").description("Interactive tutorial system");u.command("start [path]").description("Start the tutorial").action(async t=>{let{tutorialStartCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});u.command("step [n] [path]").description("Show tutorial step").action(async(t,o)=>{let{tutorialStepCommand:a}=await import('./tutorial-UC6YQMNN.js');await a(o,t);});u.command("checkpoint [path]").description("Validate current checkpoint").action(async t=>{let{tutorialCheckpointCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});u.command("next [path]").description("Move to next step").action(async t=>{let{tutorialNextCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});u.command("status [path]").description("Show tutorial progress").action(async t=>{let{tutorialStatusCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});u.command("reset [path]").description("Reset tutorial to beginning").action(async t=>{let{tutorialResetCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});u.command("bugs [path]").description("List intentional bugs").action(async t=>{let{tutorialBugsCommand:o}=await import('./tutorial-UC6YQMNN.js');await o(t);});var w=i.command("mcp").description("MCP server configuration for AI clients");w.command("setup").description("Configure MCP server for detected AI clients").option("-c, --client <client>","Target client: cursor, claude-desktop, continue, cline, all").option("-f, --force","Overwrite existing config").option("--json","Output as JSON").option("--no-gitignore","Do not add config to .gitignore").action(async t=>{let{mcpSetupCommand:o}=await import('./setup-KPIMRZ4Q.js');await o(t);});w.command("status").description("Show MCP configuration status across clients").option("--json","Output as JSON").action(async t=>{let{mcpStatusCommand:o}=await import('./setup-KPIMRZ4Q.js');await o(t);});w.command("list").alias("ls").description("List all configured MCP servers across all clients").option("--json","Output as JSON").action(async t=>{let{mcpListCommand:o}=await import('./setup-KPIMRZ4Q.js');await o(t);});w.command("remove [server]").alias("rm").description("Remove MCP server from client configs").option("-c, --client <client>","Target client: cursor, claude-desktop, continue, cline, all").option("-f, --force","Skip confirmation").option("--json","Output as JSON").action(async(t,o)=>{let{mcpRemoveCommand:a}=await import('./setup-KPIMRZ4Q.js');await a(t,o);});w.command("use-dev").description("Switch MCP configs to use local dev build").option("-c, --client <client>","Target client: cursor, claude-desktop, claude-code, continue, cline").option("--json","Output as JSON").action(async t=>{let{mcpUseDevCommand:o}=await import('./switch-CTW4PDGI.js');await o(t);});w.command("use-prod").description("Switch MCP configs back to global production binary").option("-c, --client <client>","Target client: cursor, claude-desktop, claude-code, continue, cline").option("--json","Output as JSON").action(async t=>{let{mcpUseProdCommand:o}=await import('./switch-CTW4PDGI.js');await o(t);});w.action(async()=>{let{mcpSwitchStatusCommand:t}=await import('./switch-CTW4PDGI.js');await t({});});i.command("promote").description("Copy local build to production (~/.paradigm-cli/)").option("-f, --force","Create production directory if missing").option("--skip-build","Skip npm run build step").option("--json","Output as JSON").action(async t=>{let{promoteCommand:o}=await import('./promote-NJQDZBZA.js');await o(t);});var v=i.command("wisdom").description("Team wisdom - preferences, antipatterns, decisions, expertise");v.command("show [symbol]").description("Display wisdom for symbols or overview").option("--json","Output as JSON").action(async(t,o)=>{let{wisdomShowCommand:a}=await import('./wisdom-XZ3QKPNP.js');await a(t,o);});v.command("init").description("Initialize wisdom directory with templates").option("-f, --force","Overwrite existing files").action(async t=>{let{wisdomInitCommand:o}=await import('./wisdom-XZ3QKPNP.js');await o(t);});v.command("add-antipattern").description("Add a new antipattern").requiredOption("--id <id>","Antipattern ID (e.g., api-001)").requiredOption("--symbols <symbols>","Comma-separated symbols").requiredOption("--description <desc>","What NOT to do").requiredOption("--reason <reason>","Why this is bad").requiredOption("--alternative <alt>","What to do instead").action(async t=>{let{wisdomAddAntipatternCommand:o}=await import('./wisdom-XZ3QKPNP.js');await o(t);});v.command("decide").description("Create a new decision record (ADR)").requiredOption("--id <id>","Decision ID (e.g., 001)").requiredOption("--title <title>","Decision title").requiredOption("--symbols <symbols>","Comma-separated symbols").requiredOption("--context <context>","Context/problem").requiredOption("--decision <decision>","The decision made").option("--status <status>","Status: proposed, accepted","proposed").action(async t=>{let{wisdomDecideCommand:o}=await import('./wisdom-XZ3QKPNP.js');await o(t);});v.command("expert [query]").description("Find experts for symbols or areas").option("--json","Output as JSON").action(async(t,o)=>{let{wisdomExpertCommand:a}=await import('./wisdom-XZ3QKPNP.js');await a(t,o);});v.option("--json","Output as JSON").action(async t=>{let{wisdomShowCommand:o}=await import('./wisdom-XZ3QKPNP.js');await o(void 0,t);});var y=i.command("history").description("Implementation history - tracking changes, validation, fragility");y.command("show [symbol]").description("Display history for symbols or overview").option("--json","Output as JSON").option("-l, --limit <number>","Number of entries","10").action(async(t,o)=>{let{historyShowCommand:a}=await import('./history-UW454SDP.js');await a(t,{...o,limit:parseInt(o.limit)});});y.command("init").description("Initialize history directory").option("-f, --force","Overwrite existing files").action(async t=>{let{historyInitCommand:o}=await import('./history-UW454SDP.js');await o(t);});y.command("fragile").description("Show fragile symbols that need extra care").option("--json","Output as JSON").action(async t=>{let{historyFragileCommand:o}=await import('./history-UW454SDP.js');await o(t);});y.command("reindex").description("Regenerate index from log").action(async()=>{let{historyReindexCommand:t}=await import('./history-UW454SDP.js');await t();});y.command("record").description("Record an implementation event").requiredOption("--type <type>","Type: implement, refactor, rollback").requiredOption("--symbols <symbols>","Comma-separated symbols").requiredOption("--description <desc>","What was done").option("--intent <intent>","Intent: feature, fix, refactor").option("--commit <hash>","Git commit hash").option("--reason <reason>","Reason for rollback").action(async t=>{let{historyRecordCommand:o}=await import('./history-UW454SDP.js');await o(t);});y.command("validate").description("Record a validation result").requiredOption("--result <result>","Result: pass, fail, partial").option("--ref <id>","Implementation ID being validated").option("--passed <n>","Tests passed").option("--failed <n>","Tests failed").action(async t=>{let{historyValidateCommand:o}=await import('./history-UW454SDP.js');await o({...t,passed:t.passed?parseInt(t.passed):void 0,failed:t.failed?parseInt(t.failed):void 0});});y.option("--json","Output as JSON").action(async t=>{let{historyShowCommand:o}=await import('./history-UW454SDP.js');await o(void 0,t);});var N=i.command("hooks").description("Git hooks for automatic history capture");N.command("install").description("Install git hooks, Claude Code hooks, and Cursor hooks").option("-f, --force","Overwrite existing hooks").option("--post-commit","Only install post-commit hook").option("--pre-push","Only install pre-push hook").option("--claude-code","Only install Claude Code hooks (stop + pre-commit)").option("--cursor","Only install Cursor hooks (.cursor/hooks.json)").option("--dry-run","Show what would be installed without making changes").action(async t=>{let{hooksInstallCommand:o}=await import('./hooks-E7HQQ57M.js');await o(t);});N.command("uninstall").description("Remove paradigm hooks (git hooks, or --cursor for Cursor hooks)").option("--cursor","Remove Cursor hooks instead of git hooks").option("--dry-run","Show what would be removed without making changes").action(async t=>{let{hooksUninstallCommand:o}=await import('./hooks-E7HQQ57M.js');await o(t);});N.command("status").description("Check git hooks status").action(async()=>{let{hooksStatusCommand:t}=await import('./hooks-E7HQQ57M.js');await t();});N.action(async()=>{let{hooksStatusCommand:t}=await import('./hooks-E7HQQ57M.js');await t();});var r=i.command("triage").description("Semantic error triage - incident management and pattern matching");r.command("list").alias("ls").description("List recent incidents with matched patterns").option("-l, --limit <number>","Maximum incidents to show","10").option("-s, --status <status>","Filter by status: open, investigating, resolved, wont-fix, all").option("--symbol <symbol>","Filter by symbol (e.g., @checkout, ^auth)").option("-e, --env <environment>","Filter by environment").option("--search <text>","Search in error messages").option("--from <date>","Filter from date (ISO format)").option("--to <date>","Filter to date (ISO format)").option("--json","Output as JSON").action(async t=>{let{triageListCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});r.command("show <id>").description("Show full incident details").option("--timeline","Include flow timeline").option("--json","Output as JSON").action(async(t,o)=>{let{triageShowCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});r.command("resolve <id>").description("Mark incident as resolved").option("-p, --pattern <patternId>","Pattern that led to resolution").option("-c, --commit <hash>","Git commit hash of fix").option("--pr <url>","Pull request URL").option("-n, --notes <text>","Resolution notes").option("--wont-fix","Mark as will not fix").action(async(t,o)=>{let{triageResolveCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});r.command("note <id> <note>").description("Add a note to an incident").action(async(t,o)=>{let{triageNoteCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});r.command("link <id1> <id2>").description("Link two related incidents").action(async(t,o)=>{let{triageLinkCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});var g=r.command("patterns").description("Manage failure patterns");g.command("list").alias("ls").description("List all patterns").option("--source <source>","Filter by source: manual, suggested, imported, community").option("--min-confidence <score>","Minimum confidence score").option("--json","Output as JSON").action(async t=>{let{triagePatternsListCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});g.command("show <id>").description("Show pattern details").option("--json","Output as JSON").action(async(t,o)=>{let{triagePatternsShowCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});g.command("add").description("Create a new pattern").requiredOption("--id <id>","Pattern ID (kebab-case)").requiredOption("--name <name>","Human-readable name").option("--description <text>","Pattern description").option("--symbols <pairs>",'Symbol criteria (e.g., "feature:@checkout,gate:^auth")').option("--error-contains <keywords>","Error keywords (comma-separated)").option("--missing-signals <signals>","Expected missing signals (comma-separated)").option("--strategy <strategy>","Resolution strategy: retry, fallback, fix-data, fix-code, ignore, escalate","fix-code").option("--priority <priority>","Priority: low, medium, high, critical","medium").option("--code-hint <text>","Code hint for resolution").option("--tags <tags>","Tags (comma-separated)").option("--from-incident <id>","Generate suggestion from incident").action(async t=>{let{triagePatternsAddCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});g.command("delete <id>").alias("rm").description("Delete a pattern").action(async t=>{let{triagePatternsDeleteCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});g.command("test <id>").description("Test pattern against historical incidents").option("-l, --limit <number>","Max incidents to test against","100").option("--json","Output as JSON").action(async(t,o)=>{let{triagePatternsTestCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});g.command("seed").description("Load built-in seed patterns").action(async()=>{let{triagePatternsSeedCommand:t}=await import('./triage-FCWOZASE.js');await t();});g.action(async()=>{let{triagePatternsListCommand:t}=await import('./triage-FCWOZASE.js');await t({});});r.command("export <type>").description("Export patterns or full backup (type: patterns, backup)").option("-o, --output <path>","Output file path").option("--include-private","Include private patterns").action(async(t,o)=>{let{triageExportCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});r.command("import <file>").description("Import patterns from JSON file").option("--overwrite","Overwrite existing patterns").action(async(t,o)=>{let{triageImportCommand:a}=await import('./triage-FCWOZASE.js');await a(t,o);});r.command("restore <file>").description("Restore from full backup").action(async t=>{let{triageRestoreCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});r.command("stats").description("Show statistics dashboard").option("-p, --period <period>","Time period: 1d, 7d, 30d, 90d","7d").option("--symbol <symbol>","Show health for specific symbol").option("--json","Output as JSON").action(async t=>{let{triageStatsCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});r.command("record").description("Manually record an incident").requiredOption("--error <message>","Error message").requiredOption("-e, --env <environment>","Environment").option("--feature <symbol>","Feature symbol (@...)").option("--component <symbol>","Component symbol (#...)").option("--flow <symbol>","Flow symbol ($...)").option("--gate <symbol>","Gate symbol (^...)").option("--signal <symbol>","Signal symbol (!...)").option("--state <symbol>","State symbol (%...)").option("--integration <symbol>","Integration symbol (&...)").option("--service <name>","Service name").option("--version <version>","App version").option("--stack <trace>","Stack trace").option("--json","Output as JSON").action(async t=>{let{triageRecordCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});r.option("-l, --limit <number>","Maximum incidents to show","10").option("-s, --status <status>","Filter by status").option("--json","Output as JSON").action(async t=>{let{triageListCommand:o}=await import('./triage-FCWOZASE.js');await o(t);});var c=i.command("lore").description("Project lore - timeline of everything that happened to this project");c.command("list").alias("ls").description("List recent lore entries").option("--author <author>","Filter by author").option("--type <type>","Filter by type: agent-session, human-note, decision, review, incident, milestone, retro, insight").option("--symbol <symbol>","Filter by symbol").option("--tags <tags>","Filter by tags (comma-separated)").option("--from <date>","Filter from date (ISO format, e.g., 2026-02-20)").option("--to <date>","Filter to date (ISO format)").option("-l, --limit <number>","Number of entries","20").option("--json","Output as JSON").action(async t=>{let{loreListCommand:o}=await import('./list-YKIQNKGB.js');await o(t);});c.command("show <id>").description("Show full detail for a lore entry").option("--json","Output as JSON").action(async(t,o)=>{let{loreShowCommand:a}=await import('./show-PJ5LFLIL.js');await a(t,o);});c.command("record").description("Record a new lore entry (human note, milestone, etc.)").option("--type <type>","Entry type: human-note, decision, milestone, retro, insight","human-note").option("--author <author>","Author name").option("--title <title>","Entry title").option("--summary <summary>","Entry summary").option("--symbols <symbols>","Comma-separated symbols").option("--tags <tags>","Comma-separated tags").option("--files-modified <files>","Comma-separated files modified").option("--files-created <files>","Comma-separated files created").option("--commit <hash>","Git commit hash").option("--learnings <items>","Comma-separated learnings").option("--duration <minutes>","Duration in minutes").option("--meta <json>",`Project-defined metadata as JSON (e.g., '{"sprint": 12}')`).option("--body <text>","Long-form content (detailed notes, rationale, etc.)").option("--link-lore <ids>","Comma-separated lore entry IDs to link").option("--link-commits <shas>","Comma-separated git commit SHAs to link").option("--confidence <number>","Confidence in correctness (0.0 to 1.0)").action(async t=>{let{loreRecordCommand:o}=await import('./record-YXPB34MY.js');await o(t);});c.command("review <id>").description("Add a review to a lore entry").option("--reviewer <name>","Reviewer name").option("--completeness <n>","Completeness score (1-5)","3").option("--quality <n>","Quality score (1-5)","3").option("--notes <text>","Review notes").action(async(t,o)=>{let{loreReviewCommand:a}=await import('./review-77QI6VOC.js');await a(t,o);});c.command("assess <id> <verdict>").description("Record an assessment verdict on a lore entry (correct/partial/incorrect)").option("--assessor <name>","Assessor name").option("--notes <text>","Assessment notes").action(async(t,o,a)=>{let{loreAssessCommand:n}=await import('./assess-UFPYEJKP.js');await n(t,o,a);});c.command("calibration").description("Show calibration statistics across assessed lore entries").option("--symbol <symbol>","Filter by symbol").option("--tag <tag>","Filter by tag").option("--author <author>","Filter by author").option("--group-by <dimension>","Group by: symbol, tag, type").option("--json","Output as JSON").action(async t=>{let{loreCalibrationCommand:o}=await import('./calibration-OLJYB5HN.js');await o(t);});c.command("edit <id>").description("Edit an existing lore entry").option("--title <title>","New title").option("--summary <summary>","New summary").option("--type <type>","New type: agent-session, human-note, decision, review, incident, milestone").option("--symbols <symbols>","Comma-separated symbols").option("--tags <tags>","Comma-separated tags").option("--learnings <items>","Comma-separated learnings").action(async(t,o)=>{let{loreEditCommand:a}=await import('./edit-GUU3HBVW.js');await a(t,o);});c.command("delete <id>").description("Delete a lore entry").option("-y, --yes","Skip confirmation").option("--dry-run","Show what would be deleted without making changes").action(async(t,o)=>{let{loreDeleteCommand:a}=await import('./delete-P5VULXR4.js');await a(t,o);});c.command("migrate-assessments").description("Migrate assessment entries to lore with arc: tags").option("--dry-run","Show what would be migrated without making changes").action(async t=>{let{loreMigrateAssessmentsCommand:o}=await import('./migrate-assessments-GEI5WMI2.js');await o(t);});c.command("retag").description("Add or remove tags from matching lore entries").option("--add <tag>","Tag to add").option("--remove <tag>","Tag to remove").option("--type <type>","Filter by entry type").option("--symbol <symbol>","Filter by symbol").option("--author <author>","Filter by author").option("--from <date>","Filter from date").option("--to <date>","Filter to date").option("--tags <tags>","Filter by existing tags (comma-separated)").option("--dry-run","Show what would change without making changes").action(async t=>{let{loreRetagCommand:o}=await import('./retag-N5XF3KXP.js');await o(t);});c.command("timeline").description("Show lore timeline grouped by date with hot symbols and authors").option("-l, --limit <number>","Number of entries","20").option("--json","Output as JSON").action(async t=>{let{loreTimelineCommand:o}=await import('./timeline-K3ZFKJ3R.js');await o(t);});c.option("-p, --port <port>","Port to run on","3840").option("--no-open","Don't open browser automatically").action(async t=>{let{loreServeCommand:o}=await import('./serve-L52ZUTU6.js');await o(void 0,t);});i.command("serve").description("Launch Paradigm Platform \u2014 unified development management UI").option("-p, --port <port>","Port to run on","3850").option("--no-open","Don't open browser automatically").option("--sections <list>","Comma-separated sections to enable (e.g., lore,graph,git)").action(async t=>{let{serveCommand:o}=await import('./serve-ZJ3EXVA5.js');await o(t);});var X=i.command("graph").description("Interactive symbol relationship graph").argument("[path]","Project directory",void 0).option("-p, --port <port>","Port to run on","3841").option("--no-open","Don't open browser automatically").action(async(t,o)=>{let{graphCommand:a}=await import('./graph-CNDE5TAT.js');await a(t,o);});X.command("generate").description("Generate a named graph file in .paradigm/graphs/").argument("<name>","Graph name (used as filename: {name}.graph.json)").argument("[path]","Project directory",void 0).option("-s, --symbols <list>","Comma-separated symbol names to include").option("-g, --group <spec...>",'Group spec: "Label:#sym1,#sym2" (repeatable)').option("-l, --link <spec...>",'Link spec: "Source>Target:label" (repeatable)').action(async(t,o,a)=>{let{graphGenerateCommand:n}=await import('./graph-CNDE5TAT.js');await n(t,o,a);});var m=i.command("habits").description("Behavioral habits - practice tracking and compliance");m.command("list").alias("ls").description("List all configured habits").option("--trigger <trigger>","Filter by trigger: preflight, postflight, on-stop, on-commit").option("--category <category>","Filter by category: discovery, verification, testing, documentation, collaboration, security").option("--json","Output as JSON").action(async t=>{let{habitsListCommand:o}=await import('./habits-GICVMTJL.js');await o(t);});m.command("status").description("Show practice profile with compliance rates").option("-p, --period <period>","Time period: 7d, 30d, 90d, all","30d").option("--json","Output as JSON").action(async t=>{let{habitsStatusCommand:o}=await import('./habits-GICVMTJL.js');await o(t);});m.command("init").description("Initialize habits.yaml with seed habits").option("-f, --force","Overwrite existing file").action(async t=>{let{habitsInitCommand:o}=await import('./habits-GICVMTJL.js');await o(t);});m.command("check").description("Evaluate habit compliance for a trigger point").requiredOption("-t, --trigger <trigger>","Trigger: preflight, postflight, on-stop, on-commit").option("--record","Record practice events to Sentinel").option("--json","Output as JSON").option("--files <files>","Comma-separated files modified (default: git diff)").option("--symbols <symbols>","Comma-separated symbols touched").action(async t=>{let{habitsCheckCommand:o}=await import('./habits-GICVMTJL.js');await o(t);});m.command("add").description("Add a custom habit").requiredOption("--id <id>","Habit ID (kebab-case)").requiredOption("--name <name>","Human-readable name").requiredOption("--description <desc>","What this habit enforces").requiredOption("--category <category>","Category: discovery, verification, testing, documentation, collaboration, security").requiredOption("--trigger <trigger>","Trigger: preflight, postflight, on-stop, on-commit").option("--severity <severity>","Severity: advisory, warn, block","advisory").option("--tools <tools>","Comma-separated tools to check (for tool-called check type)").option("--check-type <type>","Check type: tool-called, file-exists, file-modified, lore-recorded, symbols-registered, gates-declared, tests-exist, git-clean","tool-called").option("--patterns <patterns>","Comma-separated patterns (for file-exists, file-modified, tests-exist check types)").action(async t=>{let{habitsAddCommand:o}=await import('./habits-GICVMTJL.js');await o({...t,checkType:t.checkType});});m.command("edit <id>").description("Edit a habit (seed habits: only severity/enabled; custom: all fields)").option("--name <name>","New name").option("--description <desc>","New description").option("--category <category>","New category").option("--trigger <trigger>","New trigger").option("--severity <severity>","New severity: advisory, warn, block").option("--enabled <bool>","Enable or disable: true, false").option("--check-type <type>","New check type").option("--patterns <patterns>","Comma-separated patterns").option("--tools <tools>","Comma-separated tools").action(async(t,o)=>{let{habitsEditCommand:a}=await import('./habits-GICVMTJL.js');await a(t,{...o,checkType:o.checkType});});m.command("remove <id>").description("Remove a custom habit (seed habits cannot be removed, only disabled)").option("-y, --yes","Skip confirmation").action(async(t,o)=>{let{habitsRemoveCommand:a}=await import('./habits-GICVMTJL.js');await a(t,o);});m.command("enable <id>").description("Enable a habit").action(async t=>{let{habitsToggleCommand:o}=await import('./habits-GICVMTJL.js');await o(t,"enable");});m.command("disable <id>").description("Disable a habit").action(async t=>{let{habitsToggleCommand:o}=await import('./habits-GICVMTJL.js');await o(t,"disable");});m.action(async()=>{let{habitsListCommand:t}=await import('./habits-GICVMTJL.js');await t({});});var D=i.command("graduate").description("Automation tier graduation \u2014 migrate habits to hooks");D.command("status",{isDefault:true}).description("Show current automation tier of every habit").option("--json","Output as JSON").action(async t=>{let{graduateStatusCommand:o}=await import('./graduate-3BBSC27A.js');await o(t);});D.command("promote <habitId>").description("Graduate a habit to hook tier (skip MCP evaluation)").action(async t=>{let{graduatePromoteCommand:o}=await import('./graduate-3BBSC27A.js');await o(t);});D.command("demote <habitId>").description("Demote a habit from hook back to habit tier").option("--cooldown <days>","Cooldown period in days before re-graduation","14").action(async(t,o)=>{let{graduateDemoteCommand:a}=await import('./graduate-3BBSC27A.js');await a(t,o);});var h=i.command("persona").description("Personas \u2014 actor-driven journey testing");h.command("list",{isDefault:true}).alias("ls").description("List all personas").option("--tag <tag>","Filter by tag").option("--trigger <type>","Filter by trigger type (root, invitation, signup, api)").option("--gate <gate>","Filter by gate usage").option("--json","Output as JSON").action(async t=>{let{personaListCommand:o}=await import('./persona-STQWZH5P.js');await o(t);});h.command("show <id>").description("Show full persona detail").option("--json","Output as JSON").action(async(t,o)=>{let{personaShowCommand:a}=await import('./persona-STQWZH5P.js');await a(t,o);});h.command("validate [id]").description("Validate persona schema and cross-references").option("--json","Output as JSON").action(async(t,o)=>{let{personaValidateCommand:a}=await import('./persona-STQWZH5P.js');await a(t,o);});h.command("coverage").description("Coverage report \u2014 routes and gates with/without persona coverage").option("--json","Output as JSON").action(async t=>{let{personaCoverageCommand:o}=await import('./persona-STQWZH5P.js');await o(t);});h.command("run <id>").description("Execute persona journey against a running server").requiredOption("--base-url <url>","Base URL (e.g. http://localhost:3000)").option("--dry-run","Show steps without making HTTP requests").option("--json","Output as JSON").action(async(t,o)=>{let{personaRunCommand:a}=await import('./persona-STQWZH5P.js');await a(t,o);});h.command("affected <symbol>").description("Show which personas reference a given symbol (gate, flow, signal)").option("--json","Output as JSON").action(async(t,o)=>{let{personaAffectedCommand:a}=await import('./persona-STQWZH5P.js');await a(t,o);});h.command("delete <id>").description("Delete a persona").action(async t=>{let{personaDeleteCommand:o}=await import('./persona-STQWZH5P.js');await o(t);});var Y=i.command("sentinel").description("Sentinel \u2014 semantic error monitoring");Y.command("defend [path]",{isDefault:true}).description("Launch the Sentinel UI - unified codebase intelligence visualizer").option("-p, --port <port>","Port to run on","3838").option("--no-open","Don't open browser automatically").action(async(t,o)=>{let{sentinelCommand:a}=await import('./sentinel-HYAZ3CO5.js');await a(t,o);});i.command("conductor").description("Launch Paradigm Conductor \u2014 multimodal mission control for Claude Code sessions").option("--build","Force rebuild the native binary").option("--install","Install Conductor binary to ~/.paradigm/conductor/bin/").option("-v, --verbose","Show build output").action(async t=>{let{conductorCommand:o}=await import('./conductor-Y5IXELTL.js');await o(t);});var p=i.command("university").description("Per-project university - knowledge base, quizzes, learning paths & PLSAT certification");p.command("serve").description("Launch Paradigm University learning platform").option("-p, --port <port>","Port to run on","3839").option("--no-open","Don't open browser automatically").action(async t=>{let{universityServeCommand:o}=await import('./serve-OY6XYL7F.js');await o(void 0,t);});p.command("list").alias("ls").description("List university content").option("--type <type>","Filter by type: note, policy, guide, runbook, quiz, path").option("--tag <tag>","Filter by tag").option("--difficulty <level>","Filter by difficulty: beginner, intermediate, advanced").option("--symbol <symbol>","Filter by Paradigm symbol").option("-l, --limit <number>","Number of entries","20").option("--json","Output as JSON").action(async t=>{let{universityListCommand:o}=await import('./list-5IUGP3ZB.js');await o(t);});p.command("add <type>").description("Create university content (note, policy, guide, runbook, quiz)").option("--title <title>","Content title (required)").option("--body <text>","Content body (markdown)").option("--tags <tags>","Comma-separated tags").option("--symbols <symbols>","Comma-separated Paradigm symbols").option("--difficulty <level>","Difficulty: beginner, intermediate, advanced").option("--minutes <n>","Estimated reading time in minutes").action(async(t,o)=>{let{universityAddCommand:a}=await import('./add-P76GEMGF.js');await a(t,o);});p.command("show <id>").description("Show a content item in full").option("--json","Output as JSON").action(async(t,o)=>{let{universityShowCommand:a}=await import('./show-BOAVWZPZ.js');await a(t,o);});p.command("quiz <id>").description("Take an interactive quiz in the terminal").action(async t=>{let{universityQuizCommand:o}=await import('./quiz-FE5UGAY2.js');await o(t);});p.command("status").description("Show university content overview and completion stats").option("--json","Output as JSON").action(async t=>{let{universityStatusCommand:o}=await import('./status-A37ECYNJ.js');await o(t);});p.command("validate").description("Validate university content integrity").option("--deep","Enable deep cross-reference checks against scan-index").option("--id <id>","Validate a specific content item").option("--json","Output as JSON").action(async t=>{let{universityValidateCommand:o}=await import('./validate-C6SMKGYD.js');await o(t);});p.option("-p, --port <port>","Port to run on","3839").option("--no-open","Don't open browser automatically").action(async t=>{let{universityServeCommand:o}=await import('./serve-OY6XYL7F.js');await o(void 0,t);});var L=i.command("docs").description("Auto-generated documentation from the symbol graph");L.command("serve").description("Launch interactive docs viewer in browser").option("-p, --port <port>","Port number (default: 3850)").option("--no-open","Do not open browser automatically").action(async t=>{let{docsServeCommand:o}=await import('./docs-5BX2YWYK.js');await o(t);});L.command("build").description("Build static documentation site").option("-o, --output <dir>","Output directory (default: from config or .paradigm/docs-site)").action(async t=>{let{docsBuildCommand:o}=await import('./docs-5BX2YWYK.js');await o(t);});L.action(async()=>{let{docsServeCommand:t}=await import('./docs-5BX2YWYK.js');await t({});});var f=i.command("pipeline").description("Spec pipeline \u2014 structured feature workflow with configurable gates");f.command("start <description>").description("Create a new pipeline for a feature").option("--template <template>","Pipeline template (add-feature, bug-fix, security-change, refactor)","add-feature").option("--gates <gates>","Custom gate modes: specify,plan,task,implement,validate").action(async(t,o)=>{let{pipelineStartCommand:a}=await import('./pipeline-MZUITRVN.js');await a(t,o);});f.command("status [feature]").description("Show pipeline status").action(async t=>{let{pipelineStatusCommand:o}=await import('./pipeline-MZUITRVN.js');await o(t);});f.command("advance <feature>").description("Advance pipeline past current gate").action(async t=>{let{pipelineAdvanceCommand:o}=await import('./pipeline-MZUITRVN.js');await o(t);});f.command("configure <feature>").description("Change gate mode on active pipeline").requiredOption("--stage <stage>","Stage to configure").requiredOption("--gate <gate>","New gate mode (auto, manual, sentinel)").option("--reason <reason>","Reason for change").action(async(t,o)=>{let{pipelineConfigureCommand:a}=await import('./pipeline-MZUITRVN.js');await a(t,o);});f.command("abort <feature>").description("Cancel a pipeline").action(async t=>{let{pipelineAbortCommand:o}=await import('./pipeline-MZUITRVN.js');await o(t);});f.command("list").description("List all active pipelines").action(async()=>{let{pipelineListCommand:t}=await import('./pipeline-MZUITRVN.js');await t();});f.action(async()=>{let{pipelineListCommand:t}=await import('./pipeline-MZUITRVN.js');await t();});var e=i.command("symphony").description("Symphony \u2014 agent-to-agent messaging for multi-session collaboration");e.command("join").description("Join this session to the Symphony network").option("--remote <ip>","Connect to remote Symphony server").action(async t=>{let{symphonyJoinCommand:o}=await import('./symphony-ZQ5OHJTP.js');await o(t);});e.command("leave").description("Remove this session from the Symphony network").action(async()=>{let{symphonyLeaveCommand:t}=await import('./symphony-ZQ5OHJTP.js');await t();});e.command("whoami").description("Show this agent's identity and linked peers").action(async()=>{let{symphonyWhoamiCommand:t}=await import('./symphony-ZQ5OHJTP.js');await t();});e.command("list").alias("ls").description("List all joined agents").option("--json","Output as JSON").action(async t=>{let{symphonyListCommand:o}=await import('./symphony-ZQ5OHJTP.js');await o(t);});e.command("send <message>").description("Send a note to agents").option("--to <agent>","Send to specific agent (omit for broadcast)").option("--thread <id>","Reply to existing thread").action(async(t,o)=>{let{symphonySendCommand:a}=await import('./symphony-ZQ5OHJTP.js');await a(t,o);});e.command("read").description("Show unread notes").action(async()=>{let{symphonyReadCommand:t}=await import('./symphony-ZQ5OHJTP.js');await t();});e.command("inbox").description("Show unread notes (alias for read)").action(async()=>{let{symphonyReadCommand:t}=await import('./symphony-ZQ5OHJTP.js');await t();});e.command("threads").description("List all threads").option("--json","Output as JSON").action(async t=>{let{symphonyThreadsCommand:o}=await import('./symphony-ZQ5OHJTP.js');await o(t);});e.command("thread <id>").description("Show full thread conversation").action(async t=>{let{symphonyThreadCommand:o}=await import('./symphony-ZQ5OHJTP.js');await o(t);});e.command("resolve <id>").description("Mark a thread as resolved").option("--decision <text>","Decision text to record").action(async(t,o)=>{let{symphonyResolveCommand:a}=await import('./symphony-ZQ5OHJTP.js');await a(t,o);});e.command("status").description("Show Symphony network status").option("--json","Output as JSON").action(async t=>{let{symphonyStatusCommand:o}=await import('./symphony-ZQ5OHJTP.js');await o(t);});e.command("serve").description("Start Symphony relay server for cross-machine networking").option("--port <port>","Port to listen on","3939").option("--public","Show connection string for internet access").action(async t=>{let{symphonyServeCommand:o}=await import('./symphony-ZQ5OHJTP.js');await o(t);});var q=e.command("peers").description("Manage trusted remote peers");q.command("list",{isDefault:true}).description("List trusted peers and their agents").option("--json","Output as JSON").action(async t=>{let{symphonyPeersCommand:o}=await import('./peers-P2KXU7ZK.js');await o(t);});q.command("revoke <id>").description("Revoke trust for a peer (disconnects immediately)").action(async t=>{let{symphonyPeersRevokeCommand:o}=await import('./peers-P2KXU7ZK.js');await o(t);});q.command("forget").description("Clear all peer trust records").option("--force","Skip confirmation").action(async t=>{let{symphonyPeersForgetCommand:o}=await import('./peers-P2KXU7ZK.js');await o(t);});q.action(async()=>{let{symphonyPeersCommand:t}=await import('./peers-P2KXU7ZK.js');await t({});});e.command("request <file>").description("Request a file from another agent").option("--from <agent>","Agent to request from").option("--reason <text>","Why this file is needed").action(async(t,o)=>{let{symphonyRequestCommand:a}=await import('./symphony-ZQ5OHJTP.js');await a(t,o);});e.command("requests").description("List pending file requests").action(async()=>{let{symphonyRequestsCommand:t}=await import('./symphony-ZQ5OHJTP.js');await t();});e.command("approve <id>").description("Approve a file request").option("--redact","Strip sensitive lines before sending").action(async(t,o)=>{let{symphonyApproveCommand:a}=await import('./symphony-ZQ5OHJTP.js');await a(t,o);});e.command("deny <id>").description("Deny a file request").option("--reason <text>","Reason for denial").action(async(t,o)=>{let{symphonyDenyCommand:a}=await import('./symphony-ZQ5OHJTP.js');await a(t,o);});e.command("watch").description("Watch inbox in real-time \u2014 zero AI tokens, pure file monitoring").option("--interval <ms>","Poll interval in milliseconds (default: 2000)").option("--thread <id>","Only show messages from this thread").option("--quiet","Minimal output \u2014 messages only, no header").action(async t=>{let{symphonyWatchCommand:o}=await import('./symphony-ZQ5OHJTP.js');await o(t);});e.action(async()=>{let{symphonyStatusCommand:t}=await import('./symphony-ZQ5OHJTP.js');await t({});});var J=i.command("notebook").description("Agent notebook management \u2014 curated snippet libraries");J.command("list").alias("ls").description("List notebook entries").option("--agent <id>","Filter by agent ID").option("--json","Output as JSON").action(async t=>{let{notebookListCommand:o}=await import('./notebook-PE3JSYZI.js');await o(t);});J.command("show <id>").description("Show a specific notebook entry").option("--agent <id>","Agent ID").option("--json","Output as JSON").action(async(t,o)=>{let{notebookShowCommand:a}=await import('./notebook-PE3JSYZI.js');await a(t,o);});J.command("export").description("Export notebook entries").option("--agent <id>","Filter by agent ID").option("--format <format>","Output format: yaml or json (default: yaml)").action(async t=>{let{notebookExportCommand:o}=await import('./notebook-PE3JSYZI.js');await o(t);});J.action(async()=>{let{notebookListCommand:t}=await import('./notebook-PE3JSYZI.js');await t({});});var d=i.command("agent").description("Agent identity management \u2014 persistent profiles with expertise tracking");d.command("list").alias("ls").description("List all agent identity profiles").option("--json","Output as JSON").option("--global","Show only global profiles").option("--project","Show only project-level profiles").action(async t=>{let{agentListCommand:o}=await import('./agent-UUTYOFTH.js');await o(t);});d.command("show <id>").description("Show full agent profile with expertise table").option("--json","Output as JSON").action(async(t,o)=>{let{agentShowCommand:a}=await import('./agent-UUTYOFTH.js');await a(t,o);});d.command("create <id>").description("Create a new .agent identity file").option("-r, --role <role>","Agent role description").option("-d, --description <desc>","Extended description").option("-g, --global","Create in global ~/.paradigm/agents/ (default)").option("--deny-paths <patterns>",'Comma-separated glob patterns to deny (e.g., ".env*,*.key")').action(async(t,o)=>{let{agentCreateCommand:a}=await import('./agent-UUTYOFTH.js');await a(t,{...o,global:o.global!==false});});d.command("sync <id>").description("Bootstrap expertise from existing project lore").option("-n, --dry-run","Show what would change without writing").option("--json","Output as JSON").action(async(t,o)=>{let{agentSyncCommand:a}=await import('./agent-UUTYOFTH.js');await a(t,o);});var A=d.command("roster").description("Manage per-project agent roster (.paradigm/roster.yaml)");A.command("init").description("Create a roster based on detected project type").option("-f, --force","Overwrite existing roster").option("--json","Output as JSON").action(async t=>{let{rosterInitCommand:o}=await import('./roster-K2QILE7K.js');await o(t);});A.command("add <ids...>").description("Add one or more agents to the active roster").option("--json","Output as JSON").action(async(t,o)=>{let{rosterAddCommand:a}=await import('./roster-K2QILE7K.js');await a(t,o);});A.command("remove <ids...>").description("Remove one or more agents from the active roster").option("--json","Output as JSON").action(async(t,o)=>{let{rosterRemoveCommand:a}=await import('./roster-K2QILE7K.js');await a(t,o);});A.option("--json","Output as JSON").action(async t=>{let{rosterShowCommand:o}=await import('./roster-K2QILE7K.js');await o(t);});d.command("bench <id>").description("Bench an agent \u2014 Maestro will skip it during orchestration").action(async t=>{let{agentBenchCommand:o}=await import('./agent-UUTYOFTH.js');await o(t);});d.command("activate <id>").description("Activate a benched agent \u2014 restore to Maestro orchestration").action(async t=>{let{agentActivateCommand:o}=await import('./agent-UUTYOFTH.js');await o(t);});d.action(async()=>{let{agentListCommand:t}=await import('./agent-UUTYOFTH.js');await t({});});var O=i.command("enforcement").description("Manage enforcement configuration (check severities and levels)");O.command("set <level>").description("Set enforcement level preset (strict, balanced, minimal)").action(async t=>{let{enforcementSetCommand:o}=await import('./enforcement-46XWPNSA.js');await o(t);});O.command("override <check-id> <severity>").description("Set a per-check severity override (block, warn, off)").action(async(t,o)=>{let{enforcementOverrideCommand:a}=await import('./enforcement-46XWPNSA.js');await a(t,o);});O.command("reset [check-id]").description("Remove a per-check override, or all overrides if no check-id given").action(async t=>{let{enforcementResetCommand:o}=await import('./enforcement-46XWPNSA.js');await o(t);});O.command("resolve").description("Output the fully resolved severity map (used by stop hook)").option("--json","Output as JSON").action(async t=>{let{enforcementResolveCommand:o}=await import('./enforcement-46XWPNSA.js');await o(t);});O.command("status",{isDefault:true}).description("Show enforcement status table (default)").option("--json","Output as JSON").action(async t=>{let{enforcementStatusCommand:o}=await import('./enforcement-46XWPNSA.js');await o(t);});i.command("compliance-check").description("Run all compliance checks (habits, drift, portal) in a single process").option("--json","Output as JSON").option("--auto-heal","Auto-heal drift violations").option("--trigger <event>","Trigger context (e.g., on-stop)","on-stop").option("--learn","Run postflight learning pass (convert session verdicts to journal entries)").action(async t=>{let{complianceCheckCommand:o}=await import('./compliance-LM2NN2S6.js');await o(t);});i.parse();
|
package/dist/mcp.js
CHANGED
|
@@ -837,7 +837,7 @@ ${c.content.diff}
|
|
|
837
837
|
`).map(m=>{try{let y=JSON.parse(m);return u.has(y.id)?(y.surfaced=!0,JSON.stringify(y)):m}catch{return m}});O.writeFileSync(l,g.join(`
|
|
838
838
|
`)+`
|
|
839
839
|
`,"utf8");}catch{}let d={count:a.length,nominations:a.map(p=>({id:p.id,agent:p.agent,urgency:p.urgency,type:p.type,brief:p.brief,relevance:p.relevance,timestamp:p.timestamp,engaged:p.engaged,response:p.response}))};if(e.include_debates){let u=j$3(s.rootDir).filter(g=>!g.resolution);d.debates=u.map(g=>({id:g.id,topic:g.topic,type:g.type,nominations:g.nominations})),d.debate_count=u.length;}return {text:t(d),handled:true}}case "paradigm_ambient_events":{let i=e.since?$g(e.since):void 0,r=e.limit||50,o=a$5(s.rootDir,{type:e.type,source:e.source,symbol:e.symbol,agent:e.agent,since:i,limit:r});return {text:t({count:o.length,events:o.map(a=>({id:a.id,type:a.type,source:a.source,timestamp:a.timestamp,path:a.path,symbols:a.symbols,context:a.context,agent:a.agent,tool:a.tool,severity:a.severity}))}),handled:true}}case "paradigm_ambient_engage":{let i=e.nomination_id,r=e.response,o=e.reason,a=k$1(s.rootDir,i,r,o);if(a)try{let{appendSessionWorkEntry:l}=await import('./session-work-log-IEYBPFUC.js'),p=i$2(s.rootDir,{limit:500}).find(u=>u.id===i);l(s.rootDir,{timestamp:new Date().toISOString(),type:"user-verdict",agent:p?.agent,nominationId:i,verdict:r,reason:o});}catch{}let c=false;return e.resolve_debate&&a&&(c=l$1(s.rootDir,e.resolve_debate,i,e.reason)),{text:t({engaged:a,nomination_id:i,response:r,debate_resolved:c||void 0}),handled:true}}case "paradigm_context_compose":{let i=e.agent,r=e.symbols||[],o=e.include_nominations!==false,a=e.include_decisions!==false,c=e.include_journal!==false,l=e.max_decisions||5,d=e.max_journal||5,p=f$2(s.rootDir,i);if(!p)return {text:t({error:`Agent profile not found: ${i}`}),handled:true};let u=[],g=n$2(p,r);if(g.trim()&&u.push(g),a){let m=d$2(s.rootDir,{status:"active",limit:l});if(m.length>0){u.push("## Recent Team Decisions");for(let y of m)u.push(`- **${y.title}**: ${y.decision.slice(0,150)}${y.decision.length>150?"...":""}`);u.push("");}}if(c){let m=b$4(i,{transferable:true,limit:d});if(m.length>0){u.push("## Transferable Insights");for(let y of m)u.push(`- [${y.trigger}] ${y.insight.slice(0,150)}${y.insight.length>150?"...":""}`);u.push("");}}if(o){let m=i$2(s.rootDir,{pending_only:true,limit:10});if(m.length>0){u.push("## Pending Nominations");for(let y of m)u.push(`- [${y.urgency}] ${y.brief}`);u.push("");}}return {text:t({agent:i,context:u.join(`
|
|
840
|
-
`),sections_included:{profile:true,decisions:a,journal:c,nominations:o}}),handled:true}}case "paradigm_ambient_promote":{let i=e.agent,r=s$1(s.rootDir,i);return {text:t({agent:i,promoted:r.promoted,entries:r.entries}),handled:true}}case "paradigm_ambient_learn":{let i=e.agent,r=e.dry_run===true,o=p$1(s.rootDir,i);if(r)return {text:t({agent:i,dry_run:true,stats:o,note:o.total<5?"Insufficient data for threshold adjustment (need 5+ engaged nominations)":`Accept rate: ${(o.acceptRate*100).toFixed(0)}% \u2014 ${o.acceptRate>.8?"would lower threshold":o.acceptRate<.4?"would raise threshold":"no adjustment needed"}`}),handled:true};let a=o$1(s.rootDir,i);return {text:t({agent:i,...a,stats:o}),handled:true}}case "paradigm_ambient_neverland":{let i=q$1(s.rootDir);return {text:t(i),handled:true}}case "paradigm_ambient_learn_postflight":return {text:t(await Eg(s.rootDir,e)),handled:true};default:return {text:`Unknown ambient tool: ${n}`,handled:false}}}var Fg={accepted:"human_feedback",dismissed:"confidence_miss",revised:"correction_received"};function Ng(n){try{let e=F.join(n,".paradigm","config.yaml");if(O.existsSync(e)){let t=O.readFileSync(e,"utf8").match(/project:\s*["']?([^"'\n]+)["']?/);if(t)return t[1].trim()}}catch{}return F.basename(n)}async function Eg(n,e={}){let s=e.dry_run===true,t=Ng(n),i=b$9(n),r=i.filter(m=>m.type==="user-verdict"&&m.verdict&&m.agent);if(r.length===0)return {sessionEntries:i.length,agentsProcessed:[],journalsWritten:0,journalsByAgent:{},promoted:0,promotedByAgent:{},dryRun:s,details:[]};let o=new Map;for(let m of r){let y=m.agent;o.has(y)||o.set(y,[]),o.get(y).push(m);}let a=i.filter(m=>m.type==="agent-contribution"),c=new Map;for(let m of a)m.agent&&(c.has(m.agent)||c.set(m.agent,[]),c.get(m.agent).push(m));let l=[],d={},p=0;for(let[m,y]of o){d[m]=0;let f=y.filter(k=>k.verdict==="accepted").length;y.filter(k=>k.verdict==="dismissed").length;y.filter(k=>k.verdict==="revised").length;let w=y.length,_=w>0?f/w:0;for(let k of y){let v=Fg[k.verdict];if(!v)continue;let S=c.get(m)?.shift(),x=Hg(k,S,{acceptRate:_,total:w,accepted:f}),C=k.verdict==="accepted"?.85:k.verdict==="revised"?.6:.4,T={agent:m,verdict:k.verdict,trigger:v,insight:x,symbols:k.symbols};if(l.push(T),s)d[m]++,p++;else try{a$3(m,{trigger:v,insight:x,confidence_before:k.verdict==="accepted"?.7:.8,confidence_after:C,project:t,transferable:k.verdict==="dismissed",tags:["postflight",`verdict:${k.verdict}`,...(k.symbols||[]).map(j=>`symbol:${j}`)]}),d[m]++,p++;}catch{}}}let u={},g=0;if(!s)for(let m of o.keys())try{let y=s$1(n,m);y.promoted>0&&(u[m]=y.promoted,g+=y.promoted);}catch{}return {sessionEntries:i.length,agentsProcessed:Array.from(o.keys()),journalsWritten:p,journalsByAgent:d,promoted:g,promotedByAgent:u,dryRun:s,details:l}}function Hg(n,e,s){let t=n.symbols?.length?` (symbols: ${n.symbols.join(", ")})`:"",i=n.reason?` Reason: ${n.reason}.`:"";switch(n.verdict){case "accepted":return `Contribution accepted by user${t}.${i}`+(e?.contribution?` Original: "${e.contribution.slice(0,120)}".`:"")+` Session accept rate: ${(s.acceptRate*100).toFixed(0)}% (${s.accepted}/${s.total}).`;case "dismissed":return `Contribution dismissed by user${t}.${i}`+(e?.contribution?` Rejected contribution: "${e.contribution.slice(0,120)}".`:"")+` Learn from this dismissal to improve future nominations. Session accept rate: ${(s.acceptRate*100).toFixed(0)}% (${s.accepted}/${s.total}).`;case "revised":return `Contribution revised by user${t}.${i}`+(n.revisionDelta?` Delta: "${n.revisionDelta.slice(0,120)}".`:"")+(e?.contribution?` Original: "${e.contribution.slice(0,120)}".`:"")+` Partial credit \u2014 close but not accurate enough. Session accept rate: ${(s.acceptRate*100).toFixed(0)}% (${s.accepted}/${s.total}).`;default:return `Unknown verdict "${n.verdict}"${t}.${i}`}}var Yt=["purpose-coverage","purpose-exists","portal-gates","aspect-anchors","purpose-freshness","aspect-advisory","lore-required","habits-blocking","purpose-required-patterns","drift-detection","portal-compliance","graduation-tracking","orchestration-required"],Fl={strict:{"purpose-coverage":"block","purpose-exists":"block","portal-gates":"block","aspect-anchors":"block","purpose-freshness":"warn","aspect-advisory":"warn","lore-required":"block","habits-blocking":"block","purpose-required-patterns":"block","drift-detection":"block","portal-compliance":"block","graduation-tracking":"warn","orchestration-required":"block"},balanced:{"purpose-coverage":"block","purpose-exists":"warn","portal-gates":"warn","aspect-anchors":"warn","purpose-freshness":"warn","aspect-advisory":"off","lore-required":"warn","habits-blocking":"block","purpose-required-patterns":"warn","drift-detection":"warn","portal-compliance":"warn","graduation-tracking":"off","orchestration-required":"warn"},minimal:{"purpose-coverage":"warn","purpose-exists":"off","portal-gates":"off","aspect-anchors":"off","purpose-freshness":"off","aspect-advisory":"off","lore-required":"off","habits-blocking":"warn","purpose-required-patterns":"off","drift-detection":"off","portal-compliance":"off","graduation-tracking":"off","orchestration-required":"off"}};function Vn(n){let e=F.join(n,".paradigm","config.yaml");if(!O.existsSync(e))return {};try{return Z.load(O.readFileSync(e,"utf8"))||{}}catch{return {}}}function mi(n,e){let s=F.join(n,".paradigm","config.yaml");O.writeFileSync(s,Z.dump(e,{lineWidth:120,noRefs:true}),"utf8");}function Yn(n){let e=n.enforcement?.level||"balanced",s=Fl[e]||Fl.balanced,t=n.enforcement?.checks||{},i=n.enforcement?.orchestration?.threshold??3,r={...s};for(let[o,a]of Object.entries(t))Yt.includes(o)&&Nl(a)&&(r[o]=a);return r.orchestrationThreshold=i,r}function Nl(n){return n==="block"||n==="warn"||n==="off"}function qg(n){return n==="strict"||n==="balanced"||n==="minimal"}function Mg(n){return Yt.includes(n)}var Lg=[{name:"paradigm_enforcement_configure",description:"View or modify stop hook enforcement levels. Actions: status (view current), set-level (change preset), override (set per-check severity), reset (clear overrides). ~250 tokens.",inputSchema:{type:"object",properties:{action:{type:"string",enum:["status","set-level","override","reset"],description:"Action to perform."},level:{type:"string",enum:["strict","balanced","minimal"],description:"Enforcement preset level (for set-level action)."},checkId:{type:"string",description:"Check ID to override (for override action). One of: "+Yt.join(", ")},severity:{type:"string",enum:["block","warn","off"],description:"Severity to set for the check (for override action)."}},required:["action"]}}];async function Wg(n,e){let{action:s,level:t,checkId:i,severity:r}=e;switch(s){case "status":{let o=Vn(n.rootDir),a=Yn(o),c=o.enforcement?.level||"balanced",l=o.enforcement?.checks||{},d=o.enforcement?.orchestration?.threshold??3;return JSON.stringify({level:c,orchestrationThreshold:d,orchestrationNote:"Threshold is compared against magnitude score (not just file count). Magnitude = source files + cross-package penalty + security-adjacent penalty + symbol file changes.",overrides:Object.keys(l).length>0?l:void 0,effective:a,checkIds:[...Yt],presetLevels:["strict","balanced","minimal"]},null,2)}case "set-level":{if(!t||!qg(t))return JSON.stringify({error:`Invalid level "${t}". Must be one of: strict, balanced, minimal`});let o=Vn(n.rootDir);o.enforcement||(o.enforcement={}),o.enforcement.level=t,o.enforcement.checks={},mi(n.rootDir,o);let a=Yn(o);return JSON.stringify({success:true,level:t,message:`Enforcement level set to "${t}". Per-check overrides cleared.`,effective:a},null,2)}case "override":{if(!i||!Mg(i))return JSON.stringify({error:`Invalid checkId "${i}". Must be one of: ${Yt.join(", ")}`});if(!r||!Nl(r))return JSON.stringify({error:`Invalid severity "${r}". Must be one of: block, warn, off`});let o=Vn(n.rootDir);o.enforcement||(o.enforcement={}),o.enforcement.checks||(o.enforcement.checks={}),o.enforcement.checks[i]=r,mi(n.rootDir,o);let a=Yn(o);return JSON.stringify({success:true,checkId:i,severity:r,message:`Override set: ${i} = ${r}`,effective:a},null,2)}case "reset":{let o=Vn(n.rootDir);o.enforcement&&(o.enforcement.checks={}),mi(n.rootDir,o);let a=Yn(o),c=o.enforcement?.level||"balanced";return JSON.stringify({success:true,message:`All per-check overrides cleared. Preset "${c}" is now fully in effect.`,effective:a},null,2)}default:return JSON.stringify({error:`Unknown action "${s}". Must be one of: status, set-level, override, reset`})}}function El(){return Lg}async function Hl(n,e,s){if(n==="paradigm_enforcement_configure"){let t=await Wg(s,e);return o(t.length,"paradigm_enforcement_configure"),{handled:true,text:t}}return {handled:false,text:""}}function Jg(n,e){let s=[];for(let t=0;t<=e.length;t++)s[t]=[t];for(let t=0;t<=n.length;t++)s[0][t]=t;for(let t=1;t<=e.length;t++)for(let i=1;i<=n.length;i++)e.charAt(t-1)===n.charAt(i-1)?s[t][i]=s[t-1][i-1]:s[t][i]=Math.min(s[t-1][i-1]+1,s[t][i-1]+1,s[t-1][i]+1);return s[e.length][n.length]}function ql(n,e,s={}){let{maxDistance:t=3,maxResults:i=5}=s,r=n.toLowerCase(),o=[];for(let a of e){let c=a.toLowerCase();if(c===r){o.push({match:a,distance:0});continue}if(c.includes(r)||r.includes(c)){o.push({match:a,distance:1});continue}let l=Jg(r,c);l<=t&&o.push({match:a,distance:l});}return o.sort((a,c)=>a.distance!==c.distance?a.distance-c.distance:a.match.localeCompare(c.match)),o.slice(0,i)}v();function zg(n,e){let s$1=new u(n),t=e||(async()=>{}),i=o=>async(a,c,l)=>o(a,c,l),r$1=o=>async(a,c,l)=>o(a,c,l,t);return s$1.registerAll([{key:"context",tier:"core",getToolsList:r,handleTool:i(s)},{key:"navigate",tier:"core",getToolsList:Xo,handleTool:i(Zo)},{key:"tags",tier:"core",getToolsList:_a,handleTool:i(ka)},{key:"purpose-portal",tier:"core",getToolsList:Ta,handleTool:r$1(Da)},{key:"pm",tier:"core",getToolsList:Ba,handleTool:i(Va)},{key:"reindex",tier:"core",getToolsList:ma$1,handleTool:r$1(na$1)},{key:"docs",tier:"core",getToolsList:Pl,handleTool:i(Rl)},{key:"ripple",tier:"core",getToolsList:Tl,handleTool:i(Dl)}]),s$1.registerAll([{key:"wisdom",tier:"feature",getToolsList:Go,handleTool:i(Uo)},{key:"history",tier:"feature",getToolsList:zo,handleTool:i(Bo)},{key:"lore",tier:"feature",getToolsList:Xa,handleTool:i(Za)},{key:"streams",tier:"feature",getToolsList:Al,handleTool:i(Ol)},{key:"ambient",tier:"feature",getToolsList:Il,handleTool:i($l)},{key:"sentinel",tier:"feature",getToolsList:ea,handleTool:i(ta)},{key:"flows",tier:"feature",getToolsList:sa,handleTool:i(ia)},{key:"fixtures",tier:"feature",getToolsList:la,handleTool:i(da)},{key:"orchestration",tier:"feature",getToolsList:fa,handleTool:i(ya)},{key:"habits",tier:"feature",getToolsList:tc,handleTool:i(nc)},{key:"tasks",tier:"feature",getToolsList:mc,handleTool:i(fc)},{key:"personas",tier:"feature",getToolsList:Fc,handleTool:i(Nc)},{key:"protocols",tier:"feature",getToolsList:Ec,handleTool:i(Hc)},{key:"symphony",tier:"feature",getToolsList:il,handleTool:i(rl)},{key:"university",tier:"feature",getToolsList:al,handleTool:i(cl)},{key:"agents",tier:"feature",getToolsList:pl,handleTool:i(ul)},{key:"notebooks",tier:"feature",getToolsList:gl,handleTool:i(ml)},{key:"aspect-graph",tier:"feature",getToolsList:uc,handleTool:i(gc)},{key:"enforcement",tier:"feature",getToolsList:El,handleTool:i(Hl),detect:o=>O.existsSync(F.join(o,".paradigm","config.yaml"))},{key:"graph",tier:"feature",getToolsList:Lc,handleTool:i(Wc),detect:o=>O.existsSync(F.join(o,".paradigm","aspect-graph.db"))},{key:"heatmap",tier:"feature",getToolsList:Gc,handleTool:i(Uc),detect:o=>O.existsSync(F.join(o,".paradigm","aspect-graph.db"))}]),s$1.registerAll([{key:"conductor",tier:"advanced",getToolsList:tl,handleTool:i(nl)},{key:"platform",tier:"advanced",getToolsList:ll,handleTool:i(dl)},{key:"pipeline",tier:"advanced",getToolsList:Yc,handleTool:i(Kc)},{key:"graduation",tier:"advanced",getToolsList:oc,handleTool:i(ac)},{key:"assessment",tier:"advanced",getToolsList:xc,handleTool:i(Cc)}]),s$1}function Bg(n,e){let s=g=>g.toLowerCase().replace(/\/+$/,""),t=s(n),i=s(e);if(t===i)return 1;let r=g=>!g.includes("/")&&g.includes("."),o=g=>r(g)?g.split("."):g.split("/").filter(Boolean),a=o(t),c=o(i);if(r(t)||r(i)){let g=r(t)?t.split("."):t.split("/").filter(Boolean),m=r(i)?i.split("."):i.split("/").filter(Boolean),y=0;for(let f=0;f<Math.min(g.length,m.length)&&g[f]===m[f];f++)y++;return y>0?Math.min(1,.5+y/Math.max(g.length,m.length)*.5):0}let l=0,d=Math.max(a.length,c.length);for(let g=0;g<d;g++){let m=a[g]||"",y=c[g]||"";m===y?l++:m.startsWith(":")&&y.startsWith(":")?l+=.9:m.startsWith(":")||y.startsWith(":")?l+=.7:(m.replace(/s$/,"")===y.replace(/s$/,"")||y.replace(/s$/,"")===m.replace(/s$/,""))&&(l+=.8);}let p=l/d,u=a.length===c.length?.1:0;return Math.min(1,p+u)}function Vg(){return [{name:"paradigm_search",description:"Search for Paradigm symbols by name, description, or tags. Includes fuzzy matching for typo tolerance. Returns matching symbols with names, paths, types, and descriptions. ~150 tokens.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Search query (matches symbol names, descriptions, tags)"},type:{type:"string",enum:["component","flow","gate","signal","aspect"],description:"Optional: filter by symbol type (v2: #component, $flow, ^gate, !signal, ~aspect)"},limit:{type:"number",description:"Maximum results to return (default: 10)"},fuzzy:{type:"boolean",description:"Enable fuzzy matching for typos (default: true)"},includeWorkspace:{type:"boolean",description:"Also search sibling workspace projects (default: false). Requires workspace configured in config.yaml."},componentType:{type:"string",description:'Filter components by type (e.g., "view", "service", "tool"). Only applies to #component symbols.'},response_format:{type:"string",enum:["concise","detailed"],description:'Response detail level. "concise" returns minimal fields to save tokens (default: "detailed")'}},required:["query"]},annotations:{readOnlyHint:true,destructiveHint:false}},{name:"paradigm_related",description:"Get all symbols related to a given symbol. Call before modifying code to understand what uses this symbol and what it depends on. Returns uses/used-by lists with symbol types. ~150 tokens.",inputSchema:{type:"object",properties:{symbol:{type:"string",description:"Symbol to find relations for"}},required:["symbol"]},annotations:{readOnlyHint:true,destructiveHint:false}},{name:"paradigm_status",description:"Get project overview - call this at session start for orientation. Shows symbol counts, project health, and available features. Returns symbol counts by type, project health score, and feature flags. ~100 tokens.",inputSchema:{type:"object",properties:{response_format:{type:"string",enum:["concise","detailed"],description:'Response detail level. "concise" returns minimal fields to save tokens (default: "detailed")'}}},annotations:{readOnlyHint:true,destructiveHint:false}},{name:"paradigm_gates_for_route",description:"Suggest which gates should be applied to a route based on patterns in the project. Returns suggested gates with confidence scores and existing patterns. ~150 tokens.",inputSchema:{type:"object",properties:{route:{type:"string",description:"Route path (e.g., /api/users, /admin/settings)"},method:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE"],description:"HTTP method"},response_format:{type:"string",enum:["concise","detailed"],description:'Response detail level. "concise" returns minimal fields to save tokens (default: "detailed")'}},required:["route"]},annotations:{readOnlyHint:true,destructiveHint:false}},{name:"paradigm_plugin_check",description:"Check for updates to installed Claude Code plugins. Reports which marketplace clones have newer remote commits and which cached versions are stale.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:true,destructiveHint:false}},{name:"paradigm_workspace_reindex",description:"Rebuild scan-index.json for all workspace members. Requires workspace configured in config.yaml. Returns per-member symbol counts. ~200 tokens.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:false,destructiveHint:true}},{name:"paradigm_tool_activate",description:"Activate an advanced-tier tool module for this session. Advanced tools are not loaded by default to reduce tool count. Call with a feature key to make its tools available. ~50 tokens.",inputSchema:{type:"object",properties:{feature:{type:"string",description:'Feature key to activate (e.g., "graph", "heatmap", "pipeline", "conductor", "platform")'}},required:["feature"]},annotations:{readOnlyHint:false,destructiveHint:false}}]}function Ll(n$2,e,s){let t=e(),i$1=zg(t.rootDir,s);n$2.setRequestHandler(ListToolsRequestSchema,async()=>({tools:[...Vg(),...i$1.getActiveTools()]})),n$2.setRequestHandler(CallToolRequestSchema,async r=>{let{name:o$1,arguments:a$1}=r.params;q(o$1,a$1??{});let c=e(),l$1=j$1();l$1.setRootDir(c.rootDir);let d=null,p=null;l$1.hasRecoveredThisSession()||(d=await t$1(c.rootDir),p=a(),b$2(),l$1.markRecovered());let u=await(async()=>{switch(o$1){case "paradigm_search":{let{query:g,type:m,limit:y=10,fuzzy:f=true,includeWorkspace:b=false,componentType:h,response_format:w}=a$1,_=`search:${g}:${m||""}:${y}:${f}:${b}:${h||""}`,k=await v$1.getOrCompute(_,()=>{let C=j$2(c.index,g);return m&&(C=C.filter(T=>T.type===m)),h&&(C=C.filter(T=>T.componentType===h)),C}),v=[];if(k.length===0&&f){let C=n(c.index),T=C.map(j=>j.symbol);v=ql(g,T,{maxDistance:3,maxResults:5}),v.length>0&&(k=v.map(j=>C.find(P=>P.symbol===j.match)).filter(j=>j!=null),m&&(k=k.filter(j=>j.type===m)));}k=k.slice(0,y);let S={query:g,count:k.length,results:k.map(C=>({symbol:C.symbol,type:C.type,description:C.description,filePath:C.filePath,...C.componentType?{componentType:C.componentType}:{},...C.parentSymbol?{parentSymbol:C.parentSymbol}:{}}))};if(v.length>0&&(S.fuzzyMatched=true,S.fuzzyNote=`No exact matches for "${g}". Showing similar symbols.`,S.suggestions=v.map(C=>({symbol:C.match,distance:C.distance}))),b&&c.workspace){let C=Tt(c.workspace,g),T=m?C.filter(j=>j.type===m):C;T.length>0&&(S.workspaceResults=T.slice(0,y).map(j=>({symbol:j.symbol,type:j.type,description:j.description,filePath:j.filePath,project:j.project})),S.workspaceCount=T.length);}w==="concise"&&(S.results=k.map(C=>({symbol:C.symbol,type:C.type})),delete S.fuzzyMatched,delete S.fuzzyNote,delete S.suggestions,delete S.workspaceResults,delete S.workspaceCount);let x=JSON.stringify(S,null,2);return o(x.length,o$1),{content:[{type:"text",text:x}]}}case "paradigm_related":{let{symbol:g}=a$1,m=h$1(c.index,g);if(!m){let h=Bn(c.rootDir,g,{maxResults:20});if(h.length===0){let S=JSON.stringify({error:"Symbol not found",symbol:g,fallback:"searched",referencesFound:0,recovery:["Run `paradigm_search` with a partial name to find similar symbols","Check `.purpose` files for symbol definitions","Use `paradigm_status` to see available symbols by type","The symbol may not be indexed yet - run `paradigm scan`"]},null,2);return o(S.length,o$1),{content:[{type:"text",text:S}]}}let w=[...new Set(h.map(S=>S.filePath))],_=h.filter(S=>S.context==="purpose"),k=h.filter(S=>S.context==="code"),v=JSON.stringify({symbol:g,status:"not-indexed",fallback:"grep-search",note:"Approximate relationships from grep \u2014 run `paradigm scan` for accurate graph data.",usedBy:w.slice(0,10).map(S=>({file:S,references:h.filter(x=>x.filePath===S).length})),uses:[],summary:{totalFiles:w.length,totalReferences:h.length,purposeFileRefs:_.length,codeRefs:k.length},suggestion:"Run `paradigm scan` to enable full relationship tracking"},null,2);return o(v.length,o$1),{content:[{type:"text",text:v}]}}let y=k(c.index,g),f=l(c.index,g),b=JSON.stringify({symbol:m.symbol,type:m.type,description:m.description,usedBy:y.map(h=>({symbol:h.symbol,type:h.type,description:h.description})),uses:f.map(h=>({symbol:h.symbol,type:h.type,description:h.description}))},null,2);return o(b.length,o$1),{content:[{type:"text",text:b}]}}case "paradigm_status":{let g=a$1.response_format,m$1=await v$1.getOrCompute("status",async()=>{let f=m(c.index),b=Object.values(f).reduce((j,P)=>j+P,0),h={};for(let j of Object.keys(f)){let P=i(c.index,j);h[j]=P.slice(0,3).map(D=>D.symbol);}let w=ga.platform(),_=w==="win32",k=_?"PowerShell/CMD":w==="darwin"?"zsh/bash":"bash",v;try{let j=await U(c.rootDir);j&&j.health.total>0&&(v=j.health);}catch{}let S=i(c.index,"component"),x={};for(let j of S)j.componentType&&(x[j.componentType]=(x[j.componentType]||0)+1);let C=S.filter(j=>!j.componentType).length,T;try{let{checkPurposeHealth:j}=await import('./integrity-checker-DHGMZQDG.js');T=j(c.aggregation.purposeFiles,c.rootDir).healthScore;}catch{}return JSON.stringify({project:c.projectName,symbolSystem:"v2",counts:{"# components":f.component,"$ flows":f.flow,"^ gates":f.gate,"! signals":f.signal,"~ aspects":f.aspect},total:b,...Object.keys(x).length>0?{componentTypes:{...x,...C>0?{"(untyped)":C}:{}}}:{},examples:h,hasPortalYaml:c.gateConfig!==null,purposeFiles:c.aggregation.purposeFiles.length,...T!==void 0?{purposeHealthScore:T}:{},...v?{protocols:v}:{},note:"Symbol System v2: Use tags [feature], [state], [integration], [idea] for classification. Use type field for structural role (view, service, tool, etc.)",environment:{os:w,shell:k,terminalNote:_?"Use PowerShell syntax: semicolons for command chaining, backslashes for paths, $env:VAR for env vars":"Use Unix syntax: && for command chaining, forward slashes for paths, $VAR for env vars"}},null,2)}),y=m$1;if(g==="concise")try{let f=JSON.parse(m$1);y=JSON.stringify({project:f.project,counts:f.counts,total:f.total},null,2);}catch{}return o(y.length,o$1),{content:[{type:"text",text:y}]}}case "paradigm_gates_for_route":{let{route:g,response_format:m}=a$1,f=typeof g=="string"&&!g.includes("/")&&g.includes(".")?"POST":a$1.method||"GET",b=i(c.index,"gate"),h=[],w=[];if(c.gateConfig?.routes)for(let[P,D]of Object.entries(c.gateConfig.routes))D.gates&&w.push({route:P,gates:D.gates,method:D.method});if(c.workspace)for(let[P,D]of c.workspace.siblingIndices){let I=D.gateConfig;if(I?.routes)for(let[A,N]of Object.entries(I.routes)){let H=N,q=Array.isArray(H)?H:H?.gates;q&&w.push({route:A,gates:q,method:Array.isArray(H)?void 0:H?.method,source:P});}}for(let P of w){let D=Bg(g,P.route);if(D>=.6&&(!P.method||P.method===f))for(let I of P.gates){let A=b.find(N=>N.symbol===I||N.symbol===`^${I}`);if(A&&!h.find(N=>N.gate===A.symbol)){let N=P.source?`${P.source}/portal.yaml`:"portal.yaml";h.push({gate:A.symbol,reason:`Similar route "${P.route}" uses this gate`,confidence:D>=.8?"high":"medium",source:N});}}}let v=g.split("/").filter(Boolean).find(P=>!P.startsWith(":")&&P!=="api")?.replace(/s$/,"")||"",S=g.match(/\/:(id|[a-z]+Id)($|\/)/i);if(S&&v){let P=b.find(D=>{let I=D.symbol.toLowerCase(),A=(D.description||"").toLowerCase();return I.includes(`${v}-owner`)||I.includes("owner")||I.includes("ownership")||A.includes("owner")||A.includes("ownership")||A.includes("belongs to")});P?h.push({gate:P.symbol,reason:`Resource ID route (${v}) typically needs ownership verification`,confidence:"high"}):h.push({gate:`^${v}-owner`,reason:`Consider adding ownership gate for ${v} resource`,confidence:"medium"});}if(g.includes("/admin")||g.includes("/settings")){let P=b.find(D=>D.symbol.includes("admin")||D.description?.toLowerCase().includes("admin"));P&&h.push({gate:P.symbol,reason:"Route appears to be admin-related",confidence:"high"});}if(g.startsWith("/api/")||g.includes("/user")||g.includes("/account")){let P=b.find(D=>D.symbol.includes("authenticated")||D.symbol.includes("auth"));P&&h.push({gate:P.symbol,reason:"API/user routes typically require authentication",confidence:"high"});}if(g.includes("/premium")||g.includes("/pro")||g.includes("/export")){let P=b.find(D=>D.symbol.includes("subscription")||D.symbol.includes("premium"));P&&h.push({gate:P.symbol,reason:"Route appears to be a premium feature",confidence:"medium"});}if(f==="DELETE"){let P=b.find(D=>D.symbol.includes("authenticated"));P&&!h.find(D=>D.gate===P.symbol)&&h.push({gate:P.symbol,reason:"DELETE operations require authentication",confidence:"high"});}if(["POST","PUT","PATCH"].includes(f)){let P=b.find(D=>D.symbol.includes("authenticated"));P&&!h.find(D=>D.gate===P.symbol)&&h.push({gate:P.symbol,reason:"Write operations typically require authentication",confidence:"high"});}let x=new Set,C=h.filter(P=>x.has(P.gate)?false:(x.add(P.gate),true)),T=m==="concise"?{suggestions:C.map(P=>({gate:P.gate,confidence:P.confidence}))}:{route:g,method:f,suggestions:C,availableGates:b.map(P=>({symbol:P.symbol,description:P.description})),note:S?"Resource ID routes should verify the user owns/has access to the specific resource.":"These are suggestions based on route patterns. Review your portal.yaml for exact requirements."},j=JSON.stringify(T,null,2);o(j.length,o$1);try{n$1(c.rootDir,{type:"gate-checked",source:"mcp-tool-call",tool:"paradigm_gates_for_route",symbols:C.map(P=>P.gate),context:`Gate check for ${f} ${g}`});}catch{}return {content:[{type:"text",text:j}]}}case "paradigm_plugin_check":{let{runPluginUpdateCheck:g}=await import('./plugin-update-checker-M7PW434O.js'),m=await g(),y=m.filter(w=>w.hasRemoteUpdate||w.hasCacheStale);if(y.length===0){let w=m.length===0?"No Claude Code plugins found in ~/.claude/plugins/marketplaces/.":"All installed plugins are up to date.";return o(w.length,o$1),{content:[{type:"text",text:w}]}}let f=[`Plugin updates available:
|
|
840
|
+
`),sections_included:{profile:true,decisions:a,journal:c,nominations:o}}),handled:true}}case "paradigm_ambient_promote":{let i=e.agent,r=s$1(s.rootDir,i);return {text:t({agent:i,promoted:r.promoted,entries:r.entries}),handled:true}}case "paradigm_ambient_learn":{let i=e.agent,r=e.dry_run===true,o=p$1(s.rootDir,i);if(r)return {text:t({agent:i,dry_run:true,stats:o,note:o.total<5?"Insufficient data for threshold adjustment (need 5+ engaged nominations)":`Accept rate: ${(o.acceptRate*100).toFixed(0)}% \u2014 ${o.acceptRate>.8?"would lower threshold":o.acceptRate<.4?"would raise threshold":"no adjustment needed"}`}),handled:true};let a=o$1(s.rootDir,i);return {text:t({agent:i,...a,stats:o}),handled:true}}case "paradigm_ambient_neverland":{let i=q$1(s.rootDir);return {text:t(i),handled:true}}case "paradigm_ambient_learn_postflight":return {text:t(await Eg(s.rootDir,e)),handled:true};default:return {text:`Unknown ambient tool: ${n}`,handled:false}}}var Fg={accepted:"human_feedback",dismissed:"confidence_miss",revised:"correction_received"};function Ng(n){try{let e=F.join(n,".paradigm","config.yaml");if(O.existsSync(e)){let t=O.readFileSync(e,"utf8").match(/project:\s*["']?([^"'\n]+)["']?/);if(t)return t[1].trim()}}catch{}return F.basename(n)}async function Eg(n,e={}){let s=e.dry_run===true,t=Ng(n),i=b$9(n),r=i.filter(m=>m.type==="user-verdict"&&m.verdict&&m.agent);if(r.length===0)return {sessionEntries:i.length,agentsProcessed:[],journalsWritten:0,journalsByAgent:{},promoted:0,promotedByAgent:{},dryRun:s,details:[]};let o=new Map;for(let m of r){let y=m.agent;o.has(y)||o.set(y,[]),o.get(y).push(m);}let a=i.filter(m=>m.type==="agent-contribution"),c=new Map;for(let m of a)m.agent&&(c.has(m.agent)||c.set(m.agent,[]),c.get(m.agent).push(m));let l=[],d={},p=0;for(let[m,y]of o){d[m]=0;let f=y.filter(k=>k.verdict==="accepted").length;y.filter(k=>k.verdict==="dismissed").length;y.filter(k=>k.verdict==="revised").length;let w=y.length,_=w>0?f/w:0;for(let k of y){let v=Fg[k.verdict];if(!v)continue;let S=c.get(m)?.shift(),x=Hg(k,S,{acceptRate:_,total:w,accepted:f}),C=k.verdict==="accepted"?.85:k.verdict==="revised"?.6:.4,T={agent:m,verdict:k.verdict,trigger:v,insight:x,symbols:k.symbols};if(l.push(T),s)d[m]++,p++;else try{a$3(m,{trigger:v,insight:x,confidence_before:k.verdict==="accepted"?.7:.8,confidence_after:C,project:t,transferable:k.verdict==="dismissed",tags:["postflight",`verdict:${k.verdict}`,...(k.symbols||[]).map(j=>`symbol:${j}`)]}),d[m]++,p++;}catch{}}}let u={},g=0;if(!s)for(let m of o.keys())try{let y=s$1(n,m);y.promoted>0&&(u[m]=y.promoted,g+=y.promoted);}catch{}return {sessionEntries:i.length,agentsProcessed:Array.from(o.keys()),journalsWritten:p,journalsByAgent:d,promoted:g,promotedByAgent:u,dryRun:s,details:l}}function Hg(n,e,s){let t=n.symbols?.length?` (symbols: ${n.symbols.join(", ")})`:"",i=n.reason?` Reason: ${n.reason}.`:"";switch(n.verdict){case "accepted":return `Contribution accepted by user${t}.${i}`+(e?.contribution?` Original: "${e.contribution.slice(0,120)}".`:"")+` Session accept rate: ${(s.acceptRate*100).toFixed(0)}% (${s.accepted}/${s.total}).`;case "dismissed":return `Contribution dismissed by user${t}.${i}`+(e?.contribution?` Rejected contribution: "${e.contribution.slice(0,120)}".`:"")+` Learn from this dismissal to improve future nominations. Session accept rate: ${(s.acceptRate*100).toFixed(0)}% (${s.accepted}/${s.total}).`;case "revised":return `Contribution revised by user${t}.${i}`+(n.revisionDelta?` Delta: "${n.revisionDelta.slice(0,120)}".`:"")+(e?.contribution?` Original: "${e.contribution.slice(0,120)}".`:"")+` Partial credit \u2014 close but not accurate enough. Session accept rate: ${(s.acceptRate*100).toFixed(0)}% (${s.accepted}/${s.total}).`;default:return `Unknown verdict "${n.verdict}"${t}.${i}`}}var Yt=["purpose-coverage","purpose-exists","portal-gates","aspect-anchors","purpose-freshness","aspect-advisory","lore-required","habits-blocking","purpose-required-patterns","drift-detection","portal-compliance","graduation-tracking","orchestration-required"],Fl={strict:{"purpose-coverage":"block","purpose-exists":"block","portal-gates":"block","aspect-anchors":"block","purpose-freshness":"warn","aspect-advisory":"warn","lore-required":"block","habits-blocking":"block","purpose-required-patterns":"block","drift-detection":"block","portal-compliance":"block","graduation-tracking":"warn","orchestration-required":"block"},balanced:{"purpose-coverage":"block","purpose-exists":"warn","portal-gates":"warn","aspect-anchors":"warn","purpose-freshness":"warn","aspect-advisory":"off","lore-required":"warn","habits-blocking":"block","purpose-required-patterns":"warn","drift-detection":"warn","portal-compliance":"warn","graduation-tracking":"off","orchestration-required":"warn"},minimal:{"purpose-coverage":"warn","purpose-exists":"off","portal-gates":"off","aspect-anchors":"off","purpose-freshness":"off","aspect-advisory":"off","lore-required":"off","habits-blocking":"warn","purpose-required-patterns":"off","drift-detection":"off","portal-compliance":"off","graduation-tracking":"off","orchestration-required":"off"}};function Vn(n){let e=F.join(n,".paradigm","config.yaml");if(!O.existsSync(e))return {};try{return Z.load(O.readFileSync(e,"utf8"))||{}}catch{return {}}}function mi(n,e){let s=F.join(n,".paradigm","config.yaml");O.writeFileSync(s,Z.dump(e,{lineWidth:120,noRefs:true}),"utf8");}function Yn(n){let e=n.enforcement?.level||"minimal",s=Fl[e]||Fl.minimal,t=n.enforcement?.checks||{},i=n.enforcement?.orchestration?.threshold??3,r={...s};for(let[o,a]of Object.entries(t))Yt.includes(o)&&Nl(a)&&(r[o]=a);return r.orchestrationThreshold=i,r}function Nl(n){return n==="block"||n==="warn"||n==="off"}function qg(n){return n==="strict"||n==="balanced"||n==="minimal"}function Mg(n){return Yt.includes(n)}var Lg=[{name:"paradigm_enforcement_configure",description:"View or modify stop hook enforcement levels. Actions: status (view current), set-level (change preset), override (set per-check severity), reset (clear overrides). ~250 tokens.",inputSchema:{type:"object",properties:{action:{type:"string",enum:["status","set-level","override","reset"],description:"Action to perform."},level:{type:"string",enum:["strict","balanced","minimal"],description:"Enforcement preset level (for set-level action)."},checkId:{type:"string",description:"Check ID to override (for override action). One of: "+Yt.join(", ")},severity:{type:"string",enum:["block","warn","off"],description:"Severity to set for the check (for override action)."}},required:["action"]}}];async function Wg(n,e){let{action:s,level:t,checkId:i,severity:r}=e;switch(s){case "status":{let o=Vn(n.rootDir),a=Yn(o),c=o.enforcement?.level||"minimal",l=o.enforcement?.checks||{},d=o.enforcement?.orchestration?.threshold??3;return JSON.stringify({level:c,orchestrationThreshold:d,orchestrationNote:"Threshold is compared against magnitude score (not just file count). Magnitude = source files + cross-package penalty + security-adjacent penalty + symbol file changes.",overrides:Object.keys(l).length>0?l:void 0,effective:a,checkIds:[...Yt],presetLevels:["strict","balanced","minimal"]},null,2)}case "set-level":{if(!t||!qg(t))return JSON.stringify({error:`Invalid level "${t}". Must be one of: strict, balanced, minimal`});let o=Vn(n.rootDir);o.enforcement||(o.enforcement={}),o.enforcement.level=t,o.enforcement.checks={},mi(n.rootDir,o);let a=Yn(o);return JSON.stringify({success:true,level:t,message:`Enforcement level set to "${t}". Per-check overrides cleared.`,effective:a},null,2)}case "override":{if(!i||!Mg(i))return JSON.stringify({error:`Invalid checkId "${i}". Must be one of: ${Yt.join(", ")}`});if(!r||!Nl(r))return JSON.stringify({error:`Invalid severity "${r}". Must be one of: block, warn, off`});let o=Vn(n.rootDir);o.enforcement||(o.enforcement={}),o.enforcement.checks||(o.enforcement.checks={}),o.enforcement.checks[i]=r,mi(n.rootDir,o);let a=Yn(o);return JSON.stringify({success:true,checkId:i,severity:r,message:`Override set: ${i} = ${r}`,effective:a},null,2)}case "reset":{let o=Vn(n.rootDir);o.enforcement&&(o.enforcement.checks={}),mi(n.rootDir,o);let a=Yn(o),c=o.enforcement?.level||"minimal";return JSON.stringify({success:true,message:`All per-check overrides cleared. Preset "${c}" is now fully in effect.`,effective:a},null,2)}default:return JSON.stringify({error:`Unknown action "${s}". Must be one of: status, set-level, override, reset`})}}function El(){return Lg}async function Hl(n,e,s){if(n==="paradigm_enforcement_configure"){let t=await Wg(s,e);return o(t.length,"paradigm_enforcement_configure"),{handled:true,text:t}}return {handled:false,text:""}}function Jg(n,e){let s=[];for(let t=0;t<=e.length;t++)s[t]=[t];for(let t=0;t<=n.length;t++)s[0][t]=t;for(let t=1;t<=e.length;t++)for(let i=1;i<=n.length;i++)e.charAt(t-1)===n.charAt(i-1)?s[t][i]=s[t-1][i-1]:s[t][i]=Math.min(s[t-1][i-1]+1,s[t][i-1]+1,s[t-1][i]+1);return s[e.length][n.length]}function ql(n,e,s={}){let{maxDistance:t=3,maxResults:i=5}=s,r=n.toLowerCase(),o=[];for(let a of e){let c=a.toLowerCase();if(c===r){o.push({match:a,distance:0});continue}if(c.includes(r)||r.includes(c)){o.push({match:a,distance:1});continue}let l=Jg(r,c);l<=t&&o.push({match:a,distance:l});}return o.sort((a,c)=>a.distance!==c.distance?a.distance-c.distance:a.match.localeCompare(c.match)),o.slice(0,i)}v();function zg(n,e){let s$1=new u(n),t=e||(async()=>{}),i=o=>async(a,c,l)=>o(a,c,l),r$1=o=>async(a,c,l)=>o(a,c,l,t);return s$1.registerAll([{key:"context",tier:"core",getToolsList:r,handleTool:i(s)},{key:"navigate",tier:"core",getToolsList:Xo,handleTool:i(Zo)},{key:"tags",tier:"core",getToolsList:_a,handleTool:i(ka)},{key:"purpose-portal",tier:"core",getToolsList:Ta,handleTool:r$1(Da)},{key:"pm",tier:"core",getToolsList:Ba,handleTool:i(Va)},{key:"reindex",tier:"core",getToolsList:ma$1,handleTool:r$1(na$1)},{key:"docs",tier:"core",getToolsList:Pl,handleTool:i(Rl)},{key:"ripple",tier:"core",getToolsList:Tl,handleTool:i(Dl)}]),s$1.registerAll([{key:"wisdom",tier:"feature",getToolsList:Go,handleTool:i(Uo)},{key:"history",tier:"feature",getToolsList:zo,handleTool:i(Bo)},{key:"lore",tier:"feature",getToolsList:Xa,handleTool:i(Za)},{key:"streams",tier:"feature",getToolsList:Al,handleTool:i(Ol)},{key:"ambient",tier:"feature",getToolsList:Il,handleTool:i($l)},{key:"sentinel",tier:"feature",getToolsList:ea,handleTool:i(ta)},{key:"flows",tier:"feature",getToolsList:sa,handleTool:i(ia)},{key:"fixtures",tier:"feature",getToolsList:la,handleTool:i(da)},{key:"orchestration",tier:"feature",getToolsList:fa,handleTool:i(ya)},{key:"habits",tier:"feature",getToolsList:tc,handleTool:i(nc)},{key:"tasks",tier:"feature",getToolsList:mc,handleTool:i(fc)},{key:"personas",tier:"feature",getToolsList:Fc,handleTool:i(Nc)},{key:"protocols",tier:"feature",getToolsList:Ec,handleTool:i(Hc)},{key:"symphony",tier:"feature",getToolsList:il,handleTool:i(rl)},{key:"university",tier:"feature",getToolsList:al,handleTool:i(cl)},{key:"agents",tier:"feature",getToolsList:pl,handleTool:i(ul)},{key:"notebooks",tier:"feature",getToolsList:gl,handleTool:i(ml)},{key:"aspect-graph",tier:"feature",getToolsList:uc,handleTool:i(gc)},{key:"enforcement",tier:"feature",getToolsList:El,handleTool:i(Hl),detect:o=>O.existsSync(F.join(o,".paradigm","config.yaml"))},{key:"graph",tier:"feature",getToolsList:Lc,handleTool:i(Wc),detect:o=>O.existsSync(F.join(o,".paradigm","aspect-graph.db"))},{key:"heatmap",tier:"feature",getToolsList:Gc,handleTool:i(Uc),detect:o=>O.existsSync(F.join(o,".paradigm","aspect-graph.db"))}]),s$1.registerAll([{key:"conductor",tier:"advanced",getToolsList:tl,handleTool:i(nl)},{key:"platform",tier:"advanced",getToolsList:ll,handleTool:i(dl)},{key:"pipeline",tier:"advanced",getToolsList:Yc,handleTool:i(Kc)},{key:"graduation",tier:"advanced",getToolsList:oc,handleTool:i(ac)},{key:"assessment",tier:"advanced",getToolsList:xc,handleTool:i(Cc)}]),s$1}function Bg(n,e){let s=g=>g.toLowerCase().replace(/\/+$/,""),t=s(n),i=s(e);if(t===i)return 1;let r=g=>!g.includes("/")&&g.includes("."),o=g=>r(g)?g.split("."):g.split("/").filter(Boolean),a=o(t),c=o(i);if(r(t)||r(i)){let g=r(t)?t.split("."):t.split("/").filter(Boolean),m=r(i)?i.split("."):i.split("/").filter(Boolean),y=0;for(let f=0;f<Math.min(g.length,m.length)&&g[f]===m[f];f++)y++;return y>0?Math.min(1,.5+y/Math.max(g.length,m.length)*.5):0}let l=0,d=Math.max(a.length,c.length);for(let g=0;g<d;g++){let m=a[g]||"",y=c[g]||"";m===y?l++:m.startsWith(":")&&y.startsWith(":")?l+=.9:m.startsWith(":")||y.startsWith(":")?l+=.7:(m.replace(/s$/,"")===y.replace(/s$/,"")||y.replace(/s$/,"")===m.replace(/s$/,""))&&(l+=.8);}let p=l/d,u=a.length===c.length?.1:0;return Math.min(1,p+u)}function Vg(){return [{name:"paradigm_search",description:"Search for Paradigm symbols by name, description, or tags. Includes fuzzy matching for typo tolerance. Returns matching symbols with names, paths, types, and descriptions. ~150 tokens.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Search query (matches symbol names, descriptions, tags)"},type:{type:"string",enum:["component","flow","gate","signal","aspect"],description:"Optional: filter by symbol type (v2: #component, $flow, ^gate, !signal, ~aspect)"},limit:{type:"number",description:"Maximum results to return (default: 10)"},fuzzy:{type:"boolean",description:"Enable fuzzy matching for typos (default: true)"},includeWorkspace:{type:"boolean",description:"Also search sibling workspace projects (default: false). Requires workspace configured in config.yaml."},componentType:{type:"string",description:'Filter components by type (e.g., "view", "service", "tool"). Only applies to #component symbols.'},response_format:{type:"string",enum:["concise","detailed"],description:'Response detail level. "concise" returns minimal fields to save tokens (default: "detailed")'}},required:["query"]},annotations:{readOnlyHint:true,destructiveHint:false}},{name:"paradigm_related",description:"Get all symbols related to a given symbol. Call before modifying code to understand what uses this symbol and what it depends on. Returns uses/used-by lists with symbol types. ~150 tokens.",inputSchema:{type:"object",properties:{symbol:{type:"string",description:"Symbol to find relations for"}},required:["symbol"]},annotations:{readOnlyHint:true,destructiveHint:false}},{name:"paradigm_status",description:"Get project overview - call this at session start for orientation. Shows symbol counts, project health, and available features. Returns symbol counts by type, project health score, and feature flags. ~100 tokens.",inputSchema:{type:"object",properties:{response_format:{type:"string",enum:["concise","detailed"],description:'Response detail level. "concise" returns minimal fields to save tokens (default: "detailed")'}}},annotations:{readOnlyHint:true,destructiveHint:false}},{name:"paradigm_gates_for_route",description:"Suggest which gates should be applied to a route based on patterns in the project. Returns suggested gates with confidence scores and existing patterns. ~150 tokens.",inputSchema:{type:"object",properties:{route:{type:"string",description:"Route path (e.g., /api/users, /admin/settings)"},method:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE"],description:"HTTP method"},response_format:{type:"string",enum:["concise","detailed"],description:'Response detail level. "concise" returns minimal fields to save tokens (default: "detailed")'}},required:["route"]},annotations:{readOnlyHint:true,destructiveHint:false}},{name:"paradigm_plugin_check",description:"Check for updates to installed Claude Code plugins. Reports which marketplace clones have newer remote commits and which cached versions are stale.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:true,destructiveHint:false}},{name:"paradigm_workspace_reindex",description:"Rebuild scan-index.json for all workspace members. Requires workspace configured in config.yaml. Returns per-member symbol counts. ~200 tokens.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:false,destructiveHint:true}},{name:"paradigm_tool_activate",description:"Activate an advanced-tier tool module for this session. Advanced tools are not loaded by default to reduce tool count. Call with a feature key to make its tools available. ~50 tokens.",inputSchema:{type:"object",properties:{feature:{type:"string",description:'Feature key to activate (e.g., "graph", "heatmap", "pipeline", "conductor", "platform")'}},required:["feature"]},annotations:{readOnlyHint:false,destructiveHint:false}}]}function Ll(n$2,e,s){let t=e(),i$1=zg(t.rootDir,s);n$2.setRequestHandler(ListToolsRequestSchema,async()=>({tools:[...Vg(),...i$1.getActiveTools()]})),n$2.setRequestHandler(CallToolRequestSchema,async r=>{let{name:o$1,arguments:a$1}=r.params;q(o$1,a$1??{});let c=e(),l$1=j$1();l$1.setRootDir(c.rootDir);let d=null,p=null;l$1.hasRecoveredThisSession()||(d=await t$1(c.rootDir),p=a(),b$2(),l$1.markRecovered());let u=await(async()=>{switch(o$1){case "paradigm_search":{let{query:g,type:m,limit:y=10,fuzzy:f=true,includeWorkspace:b=false,componentType:h,response_format:w}=a$1,_=`search:${g}:${m||""}:${y}:${f}:${b}:${h||""}`,k=await v$1.getOrCompute(_,()=>{let C=j$2(c.index,g);return m&&(C=C.filter(T=>T.type===m)),h&&(C=C.filter(T=>T.componentType===h)),C}),v=[];if(k.length===0&&f){let C=n(c.index),T=C.map(j=>j.symbol);v=ql(g,T,{maxDistance:3,maxResults:5}),v.length>0&&(k=v.map(j=>C.find(P=>P.symbol===j.match)).filter(j=>j!=null),m&&(k=k.filter(j=>j.type===m)));}k=k.slice(0,y);let S={query:g,count:k.length,results:k.map(C=>({symbol:C.symbol,type:C.type,description:C.description,filePath:C.filePath,...C.componentType?{componentType:C.componentType}:{},...C.parentSymbol?{parentSymbol:C.parentSymbol}:{}}))};if(v.length>0&&(S.fuzzyMatched=true,S.fuzzyNote=`No exact matches for "${g}". Showing similar symbols.`,S.suggestions=v.map(C=>({symbol:C.match,distance:C.distance}))),b&&c.workspace){let C=Tt(c.workspace,g),T=m?C.filter(j=>j.type===m):C;T.length>0&&(S.workspaceResults=T.slice(0,y).map(j=>({symbol:j.symbol,type:j.type,description:j.description,filePath:j.filePath,project:j.project})),S.workspaceCount=T.length);}w==="concise"&&(S.results=k.map(C=>({symbol:C.symbol,type:C.type})),delete S.fuzzyMatched,delete S.fuzzyNote,delete S.suggestions,delete S.workspaceResults,delete S.workspaceCount);let x=JSON.stringify(S,null,2);return o(x.length,o$1),{content:[{type:"text",text:x}]}}case "paradigm_related":{let{symbol:g}=a$1,m=h$1(c.index,g);if(!m){let h=Bn(c.rootDir,g,{maxResults:20});if(h.length===0){let S=JSON.stringify({error:"Symbol not found",symbol:g,fallback:"searched",referencesFound:0,recovery:["Run `paradigm_search` with a partial name to find similar symbols","Check `.purpose` files for symbol definitions","Use `paradigm_status` to see available symbols by type","The symbol may not be indexed yet - run `paradigm scan`"]},null,2);return o(S.length,o$1),{content:[{type:"text",text:S}]}}let w=[...new Set(h.map(S=>S.filePath))],_=h.filter(S=>S.context==="purpose"),k=h.filter(S=>S.context==="code"),v=JSON.stringify({symbol:g,status:"not-indexed",fallback:"grep-search",note:"Approximate relationships from grep \u2014 run `paradigm scan` for accurate graph data.",usedBy:w.slice(0,10).map(S=>({file:S,references:h.filter(x=>x.filePath===S).length})),uses:[],summary:{totalFiles:w.length,totalReferences:h.length,purposeFileRefs:_.length,codeRefs:k.length},suggestion:"Run `paradigm scan` to enable full relationship tracking"},null,2);return o(v.length,o$1),{content:[{type:"text",text:v}]}}let y=k(c.index,g),f=l(c.index,g),b=JSON.stringify({symbol:m.symbol,type:m.type,description:m.description,usedBy:y.map(h=>({symbol:h.symbol,type:h.type,description:h.description})),uses:f.map(h=>({symbol:h.symbol,type:h.type,description:h.description}))},null,2);return o(b.length,o$1),{content:[{type:"text",text:b}]}}case "paradigm_status":{let g=a$1.response_format,m$1=await v$1.getOrCompute("status",async()=>{let f=m(c.index),b=Object.values(f).reduce((j,P)=>j+P,0),h={};for(let j of Object.keys(f)){let P=i(c.index,j);h[j]=P.slice(0,3).map(D=>D.symbol);}let w=ga.platform(),_=w==="win32",k=_?"PowerShell/CMD":w==="darwin"?"zsh/bash":"bash",v;try{let j=await U(c.rootDir);j&&j.health.total>0&&(v=j.health);}catch{}let S=i(c.index,"component"),x={};for(let j of S)j.componentType&&(x[j.componentType]=(x[j.componentType]||0)+1);let C=S.filter(j=>!j.componentType).length,T;try{let{checkPurposeHealth:j}=await import('./integrity-checker-DHGMZQDG.js');T=j(c.aggregation.purposeFiles,c.rootDir).healthScore;}catch{}return JSON.stringify({project:c.projectName,symbolSystem:"v2",counts:{"# components":f.component,"$ flows":f.flow,"^ gates":f.gate,"! signals":f.signal,"~ aspects":f.aspect},total:b,...Object.keys(x).length>0?{componentTypes:{...x,...C>0?{"(untyped)":C}:{}}}:{},examples:h,hasPortalYaml:c.gateConfig!==null,purposeFiles:c.aggregation.purposeFiles.length,...T!==void 0?{purposeHealthScore:T}:{},...v?{protocols:v}:{},note:"Symbol System v2: Use tags [feature], [state], [integration], [idea] for classification. Use type field for structural role (view, service, tool, etc.)",environment:{os:w,shell:k,terminalNote:_?"Use PowerShell syntax: semicolons for command chaining, backslashes for paths, $env:VAR for env vars":"Use Unix syntax: && for command chaining, forward slashes for paths, $VAR for env vars"}},null,2)}),y=m$1;if(g==="concise")try{let f=JSON.parse(m$1);y=JSON.stringify({project:f.project,counts:f.counts,total:f.total},null,2);}catch{}return o(y.length,o$1),{content:[{type:"text",text:y}]}}case "paradigm_gates_for_route":{let{route:g,response_format:m}=a$1,f=typeof g=="string"&&!g.includes("/")&&g.includes(".")?"POST":a$1.method||"GET",b=i(c.index,"gate"),h=[],w=[];if(c.gateConfig?.routes)for(let[P,D]of Object.entries(c.gateConfig.routes))D.gates&&w.push({route:P,gates:D.gates,method:D.method});if(c.workspace)for(let[P,D]of c.workspace.siblingIndices){let I=D.gateConfig;if(I?.routes)for(let[A,N]of Object.entries(I.routes)){let H=N,q=Array.isArray(H)?H:H?.gates;q&&w.push({route:A,gates:q,method:Array.isArray(H)?void 0:H?.method,source:P});}}for(let P of w){let D=Bg(g,P.route);if(D>=.6&&(!P.method||P.method===f))for(let I of P.gates){let A=b.find(N=>N.symbol===I||N.symbol===`^${I}`);if(A&&!h.find(N=>N.gate===A.symbol)){let N=P.source?`${P.source}/portal.yaml`:"portal.yaml";h.push({gate:A.symbol,reason:`Similar route "${P.route}" uses this gate`,confidence:D>=.8?"high":"medium",source:N});}}}let v=g.split("/").filter(Boolean).find(P=>!P.startsWith(":")&&P!=="api")?.replace(/s$/,"")||"",S=g.match(/\/:(id|[a-z]+Id)($|\/)/i);if(S&&v){let P=b.find(D=>{let I=D.symbol.toLowerCase(),A=(D.description||"").toLowerCase();return I.includes(`${v}-owner`)||I.includes("owner")||I.includes("ownership")||A.includes("owner")||A.includes("ownership")||A.includes("belongs to")});P?h.push({gate:P.symbol,reason:`Resource ID route (${v}) typically needs ownership verification`,confidence:"high"}):h.push({gate:`^${v}-owner`,reason:`Consider adding ownership gate for ${v} resource`,confidence:"medium"});}if(g.includes("/admin")||g.includes("/settings")){let P=b.find(D=>D.symbol.includes("admin")||D.description?.toLowerCase().includes("admin"));P&&h.push({gate:P.symbol,reason:"Route appears to be admin-related",confidence:"high"});}if(g.startsWith("/api/")||g.includes("/user")||g.includes("/account")){let P=b.find(D=>D.symbol.includes("authenticated")||D.symbol.includes("auth"));P&&h.push({gate:P.symbol,reason:"API/user routes typically require authentication",confidence:"high"});}if(g.includes("/premium")||g.includes("/pro")||g.includes("/export")){let P=b.find(D=>D.symbol.includes("subscription")||D.symbol.includes("premium"));P&&h.push({gate:P.symbol,reason:"Route appears to be a premium feature",confidence:"medium"});}if(f==="DELETE"){let P=b.find(D=>D.symbol.includes("authenticated"));P&&!h.find(D=>D.gate===P.symbol)&&h.push({gate:P.symbol,reason:"DELETE operations require authentication",confidence:"high"});}if(["POST","PUT","PATCH"].includes(f)){let P=b.find(D=>D.symbol.includes("authenticated"));P&&!h.find(D=>D.gate===P.symbol)&&h.push({gate:P.symbol,reason:"Write operations typically require authentication",confidence:"high"});}let x=new Set,C=h.filter(P=>x.has(P.gate)?false:(x.add(P.gate),true)),T=m==="concise"?{suggestions:C.map(P=>({gate:P.gate,confidence:P.confidence}))}:{route:g,method:f,suggestions:C,availableGates:b.map(P=>({symbol:P.symbol,description:P.description})),note:S?"Resource ID routes should verify the user owns/has access to the specific resource.":"These are suggestions based on route patterns. Review your portal.yaml for exact requirements."},j=JSON.stringify(T,null,2);o(j.length,o$1);try{n$1(c.rootDir,{type:"gate-checked",source:"mcp-tool-call",tool:"paradigm_gates_for_route",symbols:C.map(P=>P.gate),context:`Gate check for ${f} ${g}`});}catch{}return {content:[{type:"text",text:j}]}}case "paradigm_plugin_check":{let{runPluginUpdateCheck:g}=await import('./plugin-update-checker-M7PW434O.js'),m=await g(),y=m.filter(w=>w.hasRemoteUpdate||w.hasCacheStale);if(y.length===0){let w=m.length===0?"No Claude Code plugins found in ~/.claude/plugins/marketplaces/.":"All installed plugins are up to date.";return o(w.length,o$1),{content:[{type:"text",text:w}]}}let f=[`Plugin updates available:
|
|
841
841
|
`],b=[];for(let w of y)w.hasRemoteUpdate?(f.push(` ${w.plugin} (${w.repo}): remote has newer commits`),b.push(`git -C ${w.marketplacePath} pull origin main`)):w.hasCacheStale&&f.push(` ${w.plugin} (${w.repo}): ${w.installedVersion} \u2192 ${w.localVersion} (restart needed)`);b.length>0?(f.push(`
|
|
842
842
|
Update command:
|
|
843
843
|
${b.join(` && \\
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {b}from'./chunk-VPMJWJ5R.js';import'./chunk-DG236EXP.js';import'./chunk-TYWB5IQJ.js';import'./chunk-WESTEMIM.js';import'./chunk-FYDRENK7.js';import'./chunk-IZSBGW6E.js';import {d as d$1}from'./chunk-AO7ZSRME.js';import'./chunk-Y4XFVDZC.js';import {a as a$5}from'./chunk-FSOI3CCD.js';import {d}from'./chunk-W5IWDW4Y.js';import {a as a$3,b as b$1}from'./chunk-4DVT5IEY.js';import'./chunk-SHD27BQX.js';import {a as a$6}from'./chunk-CSXVL2U7.js';import'./chunk-EKZDFEJW.js';import {a as a$1}from'./chunk-33LKBMVK.js';import {b as b$2}from'./chunk-JBDMCRPP.js';import'./chunk-4TXOVRWD.js';import'./chunk-T6IDXUUA.js';import'./chunk-JIXHEBGK.js';import'./chunk-QT2LKB3P.js';import'./chunk-VCKKJDLP.js';import'./chunk-WR6D3SC6.js';import {a as a$2}from'./chunk-UIKLE3WD.js';import {a as a$4}from'./chunk-QNZEG7IT.js';import'./chunk-HMQ5BHP2.js';import'./chunk-JQKKVAAN.js';import {a}from'./chunk-LKAT7IAK.js';import'./chunk-5TAVYPOV.js';import*as r from'fs';import*as n from'path';import e from'chalk';import U from'ora';import*as g from'js-yaml';async function
|
|
2
|
+
import {b}from'./chunk-VPMJWJ5R.js';import'./chunk-DG236EXP.js';import'./chunk-TYWB5IQJ.js';import'./chunk-WESTEMIM.js';import'./chunk-FYDRENK7.js';import'./chunk-IZSBGW6E.js';import {d as d$1}from'./chunk-AO7ZSRME.js';import'./chunk-Y4XFVDZC.js';import {a as a$5}from'./chunk-FSOI3CCD.js';import {d}from'./chunk-W5IWDW4Y.js';import {a as a$3,b as b$1}from'./chunk-4DVT5IEY.js';import'./chunk-SHD27BQX.js';import {a as a$6}from'./chunk-CSXVL2U7.js';import'./chunk-EKZDFEJW.js';import {a as a$1}from'./chunk-33LKBMVK.js';import {b as b$2}from'./chunk-JBDMCRPP.js';import'./chunk-4TXOVRWD.js';import'./chunk-T6IDXUUA.js';import'./chunk-JIXHEBGK.js';import'./chunk-QT2LKB3P.js';import'./chunk-VCKKJDLP.js';import'./chunk-WR6D3SC6.js';import {a as a$2}from'./chunk-UIKLE3WD.js';import {a as a$4}from'./chunk-QNZEG7IT.js';import'./chunk-HMQ5BHP2.js';import'./chunk-JQKKVAAN.js';import {a}from'./chunk-LKAT7IAK.js';import'./chunk-5TAVYPOV.js';import*as r from'fs';import*as n from'path';import e from'chalk';import U from'ora';import*as g from'js-yaml';async function oe(l={}){let s=process.cwd(),h=n.basename(s),u=n.join(s,".paradigm"),k=r.existsSync(u)&&r.statSync(u).isDirectory();console.log(e.blue(`
|
|
3
3
|
\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510`)),console.log(e.blue("\u2502")+e.white.bold(" paradigm shift ")+e.blue("\u2502")),console.log(e.blue("\u2502")+e.gray(" Full project setup in one command ")+e.blue("\u2502")),console.log(e.blue(`\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518
|
|
4
|
-
`)),console.log(e.white(` \u{1F4C1} Project: ${e.cyan(h)}`)),console.log(e.white(` \u{1F4CD} Status: ${k?e.green("Paradigm detected"):e.yellow("New project")}`)),console.log("");let j=a.command("shift").start("Running paradigm shift",{project:h}),i=U();if(!k||l.force){i.start("Step 1/6: Initializing Paradigm...");try{await a$1({force:l.force,quick:!0,name:h,stack:l.stack}),i.succeed(e.green("Paradigm initialized"));}catch(
|
|
5
|
-
discipline: ${c}`);f!==
|
|
4
|
+
`)),console.log(e.white(` \u{1F4C1} Project: ${e.cyan(h)}`)),console.log(e.white(` \u{1F4CD} Status: ${k?e.green("Paradigm detected"):e.yellow("New project")}`)),console.log("");let j=a.command("shift").start("Running paradigm shift",{project:h}),i=U();if(!k||l.force){i.start("Step 1/6: Initializing Paradigm...");try{await a$1({force:l.force,quick:!0,name:h,stack:l.stack}),i.succeed(e.green("Paradigm initialized"));}catch(o){i.fail(e.red(`Init failed: ${o.message}`)),j.error("Shift failed at init",{error:o.message});return}}else {i.succeed(e.gray("Step 1/6: Already initialized (use --force to reinit)"));let o=n.join(u,"config.yaml");if(r.existsSync(o))try{let t=r.readFileSync(o,"utf8"),a=g.load(t);if(!a.discipline||a.discipline==="auto"){let c=a$2(s);if(c!=="backend"){let f=t.replace(/^discipline:\s*auto\b.*$/m,`discipline: ${c}`);f!==t&&(r.writeFileSync(o,f,"utf8"),console.log(e.green(` \u2713 Detected discipline: ${e.cyan(c)} (updated config.yaml)`)));}else if(!a.discipline){let f=t.replace(/^(project:\s*.+)$/m,`$1
|
|
5
|
+
discipline: ${c}`);f!==t&&(r.writeFileSync(o,f,"utf8"),console.log(e.green(` \u2713 Added discipline: ${e.cyan(c)} to config.yaml`)));}}}catch(t){a.operation("shift").debug("Discipline detection failed",{error:t.message});}}if(k){i.start("Step 1b/6: Checking for migrations...");try{let{migrateCommand:o}=await import('./migrate-WT56YYAM.js');await o({apply:!0,quiet:!0,noSync:!0}),i.succeed(e.green("Migrations applied"));}catch(o){i.warn(e.yellow(`Migration warning: ${o.message}`));}}{let o=n.join(u,"config.yaml");if(l.workspace&&r.existsSync(o)){let t=l.workspacePath?n.resolve(s,l.workspacePath):n.join(n.dirname(s),".paradigm-workspace");if(r.existsSync(t))try{let a=g.load(r.readFileSync(t,"utf8")),c=n.basename(s),f=n.dirname(t),d$1="./"+n.relative(f,s);if(a.members.some(y=>n.resolve(f,y.path)===s))console.log(e.green(` \u2713 Already a member of workspace: ${e.cyan(a.name)}`));else {let y=d(c,s);a.members.push({name:c,path:d$1,...y&&{role:y}}),r.writeFileSync(t,g.dump(a,{indent:2,lineWidth:120,noRefs:!0,sortKeys:!1,quotingType:'"'}),"utf8"),console.log(e.green(` \u2713 Joined workspace: ${e.cyan(a.name)} (added as member)`));}}catch(a){console.log(e.yellow(` \u26A0 Failed to join workspace: ${a.message}`));}else try{let a=n.basename(s),c=n.dirname(t),f="./"+n.relative(c,s),d$1=d(a,s),p={version:"1.0",name:l.workspace,members:[{name:a,path:f,...d$1&&{role:d$1}}]};r.mkdirSync(n.dirname(t),{recursive:!0}),r.writeFileSync(t,g.dump(p,{indent:2,lineWidth:120,noRefs:!0,sortKeys:!1,quotingType:'"'}),"utf8"),console.log(e.green(` \u2713 Created workspace: ${e.cyan(l.workspace)} at ${e.gray(n.relative(s,t))}`));}catch(a){console.log(e.yellow(` \u26A0 Failed to create workspace: ${a.message}`));}try{let a=r.readFileSync(o,"utf8"),c=g.load(a),f=n.relative(s,t);if(c.workspace!==f){if(c.workspace){let d=a.replace(/^workspace:\s*.*$/m,`workspace: "${f}"`);r.writeFileSync(o,d,"utf8");}else {let d=a.trimEnd()+`
|
|
6
6
|
workspace: "${f}"
|
|
7
|
-
`;r.writeFileSync(
|
|
7
|
+
`;r.writeFileSync(o,d,"utf8");}console.log(e.green(" \u2713 Linked workspace in config.yaml"));}}catch(a$1){a.operation("shift").debug("Workspace config link failed",{error:a$1.message});}}else if(r.existsSync(o))try{let t=r.readFileSync(o,"utf8");if(!g.load(t).workspace){let c=n.dirname(s);for(let f=0;f<3;f++){let d=n.join(c,".paradigm-workspace");if(r.existsSync(d)){let y=n.relative(s,d),N=t.trimEnd()+`
|
|
8
8
|
workspace: "${y}"
|
|
9
|
-
`;r.writeFileSync(
|
|
10
|
-
`));}catch(
|
|
11
|
-
`));}}else i.succeed(e.gray("Step 2/6: Team already configured (use --force to reinit)"));let S=n.join(s,".paradigm","roster.yaml");if(!r.existsSync(S)||l.force)try{let
|
|
9
|
+
`;r.writeFileSync(o,N,"utf8"),console.log(e.green(` \u2713 Found workspace: ${e.cyan(y)} (added to config.yaml)`));break}let p=n.dirname(c);if(p===c)break;c=p;}}}catch(t){a.operation("shift").debug("Workspace auto-detect failed",{error:t.message});}}if(!d$1(s)||l.force){console.log(e.cyan(" Step 2/6: Initializing team configuration..."));try{await b(s,{force:l.force,json:!1,configureModels:l.configureModels||!1,noConfigureModels:!l.configureModels}),console.log(e.green(` \u2713 Team configuration initialized
|
|
10
|
+
`));}catch(o){console.log(e.yellow(` \u26A0 Team init warning: ${o.message}
|
|
11
|
+
`));}}else i.succeed(e.gray("Step 2/6: Team already configured (use --force to reinit)"));let S=n.join(s,".paradigm","roster.yaml");if(!r.existsSync(S)||l.force)try{let o=a$3(s),t=b$1[o]||b$1.generic,a={version:"1.0",project:h,type:o,active:t.sort()};r.writeFileSync(S,g.dump(a,{lineWidth:-1,noRefs:!0}),"utf8"),console.log(e.green(` \u2713 Agent roster set: ${e.cyan(t.length)} agents for ${e.cyan(o)}`));}catch(o){a.operation("shift").debug("Roster setup failed",{error:o.message});}else try{let t=g.load(r.readFileSync(S,"utf8"))?.active?.length??0;console.log(e.gray(` \u2713 Agent roster exists (${t} agents active)`));}catch{console.log(e.gray(" \u2713 Agent roster exists"));}{let o=n.join(u,"config.yaml");if(r.existsSync(o))try{let t=r.readFileSync(o,"utf8"),a=g.load(t);if(!a["model-resolution"]||l.force){let{ModelDiscovery:c}=await import('./model-discovery-HMB3YI4L.js'),d=new c(s).detectEnvironment(),p;d==="claude-code"?p={"tier-1":"opus","tier-2":"sonnet","tier-3":"haiku"}:d==="cursor"?p={"tier-1":"sonnet","tier-2":"sonnet","tier-3":"haiku"}:p={"tier-1":"sonnet","tier-2":"sonnet","tier-3":"sonnet"},a["model-resolution"]=p,r.writeFileSync(o,g.dump(a,{lineWidth:-1,noRefs:!0}),"utf8"),console.log(e.green(` \u2713 Model tiers configured for ${e.cyan(d)}: tier-1=${p["tier-1"]}, tier-2=${p["tier-2"]}, tier-3=${p["tier-3"]}`));}}catch(t){a.operation("shift").debug("Model tier config failed",{error:t.message});}}try{let{ensureEnforcementDefaults:o}=await import('./enforcement-BEGPQIUN.js');o(s)&&console.log(e.green(` \u2713 Enforcement config initialized (${e.cyan("balanced")} preset)`));}catch(o){a.operation("shift").debug("Enforcement config setup failed",{error:o.message});}if(l.quick)i.succeed(e.gray("Step 3/6: Skipped scan (--quick mode)"));else {i.start("Step 3/6: Scanning and indexing symbols...");try{await b$2(s,{quiet:!0}),i.succeed(e.green("Symbols indexed"));}catch(o){i.warn(e.yellow(`Scan warning: ${o.message}`));}}{let o=n.join(u,"config.yaml");if(r.existsSync(o))try{if(g.load(r.readFileSync(o,"utf8")).workspace){i.start("Step 3b/6: Reindexing workspace members...");try{let{workspaceReindexCommand:a}=await import('./workspace-2ODL5WLY.js');await a({quiet:!0}),i.succeed(e.green("Workspace members reindexed"));}catch(a){i.warn(e.yellow(`Workspace reindex: ${a.message}`));}}}catch(t){a.operation("shift").debug("Workspace config read failed",{error:t.message});}}let v=n.join(s,"portal.yaml");r.existsSync(v)||r.writeFileSync(v,g.dump({version:"1.0.0",gates:{},routes:{}},{lineWidth:-1,noRefs:true}),"utf8");let C=n.join(s,".paradigm","lore");r.existsSync(C)||r.mkdirSync(C,{recursive:true});let P=n.join(s,".paradigm","university");for(let o of ["content/notes","content/policies","content/quizzes","content/paths","diplomas"]){let t=n.join(P,o);r.existsSync(t)||r.mkdirSync(t,{recursive:true});}let E=n.join(P,"config.yaml");if(!r.existsSync(E)){let o="Project";try{let a=n.join(s,".paradigm","config.yaml");if(r.existsSync(a)){let c=g.load(r.readFileSync(a,"utf8"));c.project&&typeof c.project=="string"&&(o=c.project);}}catch{}let t={branding:{name:`${o} University`,tagline:`Learn the ${o} codebase`,institution:o},theme:{primary:"#6366f1",secondary:"#8b5cf6",accent:"#f59e0b",background:"#0f172a",surface:"#1e293b",text:"#f8fafc",textMuted:"#94a3b8",success:"#22c55e",error:"#ef4444",font:"Inter, system-ui, sans-serif"},content:{categories:[],defaultDifficulty:"beginner",requireApproval:false},diplomas:{includeGlobalPLSAT:true}};r.writeFileSync(E,g.dump(t,{lineWidth:-1,noRefs:true}),"utf8");}i.start("Step 4/6: Syncing IDE configurations...");try{let o=l.ide?[l.ide]:["claude","cursor","copilot","windsurf","agents"],t=[];for(let a of o)try{await a$4(a,{quiet:!0,force:!0}),t.push(a);}catch{}t.length>0?i.succeed(e.green(`IDE configs synced: ${t.join(", ")}`)):i.warn(e.yellow("No IDE configs to sync"));}catch(o){i.warn(e.yellow(`Sync warning: ${o.message}`));}i.start("Step 5/6: Installing hooks...");try{await a$5({force:l.force}),i.succeed(e.green("Hooks installed (git + Claude Code + Cursor)"));}catch(o){i.warn(e.yellow(`Hooks warning: ${o.message}`));}if(l.verify){i.start("Step 6/6: Running health checks...");try{await a$6({quiet:!0})?i.succeed(e.green("All health checks passed")):i.warn(e.yellow("Some health checks need attention"));}catch(o){i.warn(e.yellow(`Doctor warning: ${o.message}`));}}else i.succeed(e.gray("Step 6/6: Skipped verify (use --verify to check health)"));console.log(""),console.log(e.blue("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510")),console.log(e.blue("\u2502")+e.white.bold(" \u2728 Paradigm shift complete! ")+e.blue("\u2502")),console.log(e.blue("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518")),console.log(""),console.log(e.white(" Created/Updated:")),console.log(e.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));let x=[{path:".paradigm/config.yaml",desc:"Project configuration"},{path:".paradigm/navigator.yaml",desc:"Symbol navigation map"},{path:".paradigm/agents.yaml",desc:"Team agent configuration"},{path:".purpose",desc:"Root feature definitions"},{path:".paradigm/lore/",desc:"Project lore timeline",isDir:true},{path:"portal.yaml",desc:"Authorization gates"},{path:".paradigm/roster.yaml",desc:"Agent roster for this project"},{path:"CLAUDE.md",desc:"Claude Code AI instructions"},{path:"AGENTS.md",desc:"Universal AI agent instructions"},{path:".cursor/rules/",desc:"Cursor AI instructions",isDir:true},{path:".claude/hooks/",desc:"Claude Code enforcement hooks",isDir:true,optional:true},{path:".cursor/hooks/",desc:"Cursor enforcement hooks",isDir:true,optional:true}],F=n.join(u,"config.yaml");if(r.existsSync(F))try{let o=g.load(r.readFileSync(F,"utf8"));if(typeof o.workspace=="string"){let t=n.resolve(s,o.workspace),a=n.relative(s,t);x.push({path:a,desc:"Multi-project workspace",optional:!0});}}catch(o){a.operation("shift").debug("Summary config read failed",{error:o.message});}for(let o of x){let t=n.join(s,o.path);r.existsSync(t)?console.log(e.green(" \u2713 ")+e.white(o.path.padEnd(28))+e.gray(o.desc)):o.optional||console.log(e.yellow(" \u25CB ")+e.gray(o.path.padEnd(28))+e.gray(`(${o.desc})`));}console.log(""),console.log(e.white(" AI agents will now:")),console.log(e.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log(e.cyan(" \u2022 ")+e.white("Use MCP tools for navigation (paradigm_search, etc.)")),console.log(e.cyan(" \u2022 ")+e.white("Check .purpose files before modifying features")),console.log(e.cyan(" \u2022 ")+e.white("Update Paradigm files when making structural changes")),console.log(e.cyan(" \u2022 ")+e.white("Follow antipatterns and team preferences")),console.log(e.cyan(" \u2022 ")+e.white("Record lore entries to capture work history")),console.log(""),console.log(e.white(" Next steps:")),console.log(e.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));let w=1;l.workspace&&console.log(e.white(` ${w++}. `)+e.gray("Run ")+e.cyan(`paradigm shift --workspace "${l.workspace}"`)+e.gray(" in sibling projects")),console.log(e.white(` ${w++}. `)+e.gray("Edit ")+e.cyan(".purpose")+e.gray(" to define your features")),console.log(e.white(` ${w++}. `)+e.gray("Add ")+e.cyan(".purpose")+e.gray(" files to feature directories")),console.log(e.white(` ${w++}. `)+e.gray("Run ")+e.cyan("paradigm shift --verify")+e.gray(" to check health")),console.log(""),j.success("Paradigm shift complete",{project:h});}export{oe as shiftCommand};
|
package/package.json
CHANGED
package/dist/chunk-27FBCZX6.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import*as i from'fs';import*as m from'path';import*as f from'js-yaml';var s=["purpose-coverage","purpose-exists","portal-gates","aspect-anchors","purpose-freshness","aspect-advisory","lore-required","habits-blocking","purpose-required-patterns","drift-detection","portal-compliance","graduation-tracking","orchestration-required"];var A={"purpose-coverage":"block","purpose-exists":"block","portal-gates":"block","aspect-anchors":"block","purpose-freshness":"warn","aspect-advisory":"warn","lore-required":"block","habits-blocking":"block","purpose-required-patterns":"block","drift-detection":"block","portal-compliance":"block","graduation-tracking":"warn","orchestration-required":"block"},O={"purpose-coverage":"block","purpose-exists":"warn","portal-gates":"warn","aspect-anchors":"warn","purpose-freshness":"warn","aspect-advisory":"off","lore-required":"warn","habits-blocking":"block","purpose-required-patterns":"warn","drift-detection":"warn","portal-compliance":"warn","graduation-tracking":"off","orchestration-required":"warn"},P={"purpose-coverage":"warn","purpose-exists":"off","portal-gates":"off","aspect-anchors":"off","purpose-freshness":"off","aspect-advisory":"off","lore-required":"off","habits-blocking":"warn","purpose-required-patterns":"off","drift-detection":"off","portal-compliance":"off","graduation-tracking":"off","orchestration-required":"off"},x={strict:A,balanced:O,minimal:P};function p(e){return {...x[e]}}function V(e,t){return x[e][t]}function b(e){return s.includes(e)}function E(e){return e==="block"||e==="warn"||e==="off"}function S(e){return e==="strict"||e==="balanced"||e==="minimal"}var L="balanced",j={threshold:3,detection:"git-diff",exempt:["*.md","*.yaml","*.yml",".purpose"]};function T(e){let t=m.join(e,".paradigm","config.yaml");if(!i.existsSync(t))return h();try{let n=i.readFileSync(t,"utf8"),r=f.load(n);if(!r||typeof r!="object")return h();let o=r.enforcement;if(!o||typeof o!="object")return h();let y=o.level,q=typeof y=="string"&&S(y)?y:L,v=o.checks,w={};if(v&&typeof v=="object")for(let[l,C]of Object.entries(v))b(l)&&typeof C=="string"&&E(C)&&(w[l]=C);let c=o.orchestration,d={...j};return c&&typeof c=="object"&&(typeof c.threshold=="number"&&(d.threshold=c.threshold),typeof c.detection=="string"&&(d.detection=c.detection),Array.isArray(c.exempt)&&(d.exempt=c.exempt.filter(l=>typeof l=="string"))),{level:q,checks:w,orchestration:d}}catch{return h()}}function h(){return {level:L,checks:{},orchestration:{...j}}}function _(e,t){let n=e.checks[t];return n!==void 0?n:p(e.level)[t]}function D(e){let t=p(e.level);for(let n of s){let r=e.checks[n];r!==void 0&&(t[n]=r);}return t}function k(e){let t=m.join(e,".paradigm","config.yaml");if(!i.existsSync(t))throw new Error(`Config not found: ${t}`);let n=i.readFileSync(t,"utf8"),r=f.load(n);if(!r||typeof r!="object")throw new Error("Config is not a valid YAML object");return [r,n]}function a(e,t){let n=m.join(e,".paradigm","config.yaml"),r=f.dump(t,{lineWidth:-1,noRefs:true,sortKeys:false,quotingType:"'"});i.writeFileSync(n,r,"utf8");}function g(e){return (!e.enforcement||typeof e.enforcement!="object")&&(e.enforcement={level:"balanced",checks:{}}),e.enforcement}function F(e,t){let[n]=k(e),r=g(n);r.level=t,a(e,n);}function H(e,t,n){let[r]=k(e),o=g(r);(!o.checks||typeof o.checks!="object")&&(o.checks={}),o.checks[t]=n,a(e,r);}function K(e,t){let[n]=k(e),r=g(n);r.checks&&typeof r.checks=="object"&&delete r.checks[t],a(e,n);}function M(e){let[t]=k(e),n=g(t);n.checks={},a(e,t);}function N(e){let t=m.join(e,".paradigm","config.yaml");if(!i.existsSync(t))return false;try{let n=i.readFileSync(t,"utf8"),r=f.load(n);return !r||typeof r!="object"||r.enforcement?!1:(r.enforcement={level:"balanced",checks:{},orchestration:{threshold:3,detection:"git-diff",exempt:["*.md","*.yaml","*.yml",".purpose"]}},a(e,r),!0)}catch{return false}}export{s as a,p as b,V as c,b as d,E as e,S as f,T as g,_ as h,D as i,F as j,H as k,K as l,M as m,N as n};
|