@a-company/paradigm 5.27.0 → 5.28.0
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/agent-loader-CZFB5BDP.js +2 -0
- package/dist/agent-loader-EBERCNMO.js +2 -0
- package/dist/{ambient-2RAKMUC7.js → ambient-S3CXHD7P.js} +9 -9
- package/dist/{chunk-DJERXYEL.js → chunk-5KSNYRT7.js} +5 -5
- package/dist/{chunk-HBGRP73K.js → chunk-AYYS2AMB.js} +1 -1
- package/dist/chunk-KYA4TP26.js +2 -0
- package/dist/chunk-QWL3LERH.js +3 -0
- package/dist/{chunk-UELDOSWH.js → chunk-SL3RZQPW.js} +1 -1
- package/dist/chunk-U4J5J7GG.js +3 -0
- package/dist/{chunk-PBVBTHGE.js → chunk-VKGY42FP.js} +1 -1
- package/dist/{chunk-4YIKDQRB.js → chunk-VNQGILQU.js} +2 -2
- package/dist/{compliance-LM2NN2S6.js → compliance-5OYNHE5D.js} +1 -1
- 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 +41 -41
- package/dist/{nomination-engine-K7MQD53E.js → nomination-engine-LMSZ2CAS.js} +1 -1
- package/dist/reindex-BSD7ZIEY.js +2 -0
- package/dist/session-tracker-FDFL4PZI.js +2 -0
- package/dist/{session-work-log-IEYBPFUC.js → session-work-log-5PHOUEQ6.js} +1 -1
- package/dist/{session-work-log-HFOD7LEG.js → session-work-log-LWEGZ5CN.js} +1 -1
- package/dist/{shift-TDOYQKR4.js → shift-WNP27SPB.js} +7 -7
- package/package.json +1 -1
- package/dist/agent-loader-MQMXCI3D.js +0 -2
- package/dist/agent-loader-RGPE3LRD.js +0 -2
- package/dist/chunk-27FBCZX6.js +0 -2
- package/dist/chunk-XGAOYG77.js +0 -3
- package/dist/chunk-ZMQXXFG2.js +0 -3
- package/dist/reindex-HA3CJG7S.js +0 -2
- package/dist/session-tracker-G7VOLRMR.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {v}from'./chunk-
|
|
2
|
+
import {v}from'./chunk-5KSNYRT7.js';export{o as adjustAttentionFromFeedback,u as applySurfacingRules,s as autoPromoteJournalEntries,g as detectDebates,n as emitAndProcess,k as engageNomination,r as forwardNominationsToRelay,q as getNeverlandMetrics,p as getNominationStats,j as loadDebates,i as loadNominations,t as loadSurfacingConfig,h as persistNominations,f as processEvent,m as processPendingEvents,l as resolveDebate}from'./chunk-5KSNYRT7.js';import'./chunk-QWL3LERH.js';import'./chunk-QGZRM6ZB.js';import'./chunk-VG7FN2TU.js';import'./chunk-5TAVYPOV.js';v();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {h}from'./chunk-
|
|
2
|
+
import {h}from'./chunk-SL3RZQPW.js';export{a as appendSessionWorkEntry,c as clearSessionWorkLog,e as getAgentEntries,f as getAgentVerdicts,d as getContributingAgents,b as readSessionWorkLog}from'./chunk-SL3RZQPW.js';import'./chunk-5TAVYPOV.js';h();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export{a as appendSessionWorkEntry,c as clearSessionWorkLog,e as getAgentEntries,f as getAgentVerdicts,d as getContributingAgents,b as readSessionWorkLog}from'./chunk-
|
|
2
|
+
export{a as appendSessionWorkEntry,c as clearSessionWorkLog,e as getAgentEntries,f as getAgentVerdicts,d as getContributingAgents,b as readSessionWorkLog}from'./chunk-VKGY42FP.js';import'./chunk-5TAVYPOV.js';
|
|
@@ -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
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {t}from'./chunk-ZMQXXFG2.js';export{n as buildProfileEnrichment,p as checkPathPermission,q as checkToolPermission,r as computeIntegrityHash,i as createAgentProfile,a as decayedConfidence,c as isAgentActive,e as listAllGlobalAgentIds,f as loadAgentProfile,g as loadAllAgentProfiles,b as loadProjectRoster,m as mergeAgentProfileWithManifest,j as queryExpertise,h as saveAgentProfile,d as saveProjectRoster,o as syncExpertiseFromLore,l as updateExpertiseFromAssessment,k as updateExpertiseFromLore,s as verifyIntegrity}from'./chunk-ZMQXXFG2.js';import'./chunk-5TAVYPOV.js';t();
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
export{n as buildProfileEnrichment,p as checkPathPermission,q as checkToolPermission,r as computeIntegrityHash,i as createAgentProfile,a as decayedConfidence,c as isAgentActive,e as listAllGlobalAgentIds,f as loadAgentProfile,g as loadAllAgentProfiles,b as loadProjectRoster,m as mergeAgentProfileWithManifest,j as queryExpertise,h as saveAgentProfile,d as saveProjectRoster,o as syncExpertiseFromLore,l as updateExpertiseFromAssessment,k as updateExpertiseFromLore,s as verifyIntegrity}from'./chunk-XGAOYG77.js';import'./chunk-5TAVYPOV.js';
|
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};
|
package/dist/chunk-XGAOYG77.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import*as l from'fs';import*as u from'path';import*as S from'os';import*as k from'crypto';import*as d from'js-yaml';var P={architect:{style:"deliberate",risk:"conservative",verbosity:"detailed"},builder:{style:"rapid",risk:"balanced",verbosity:"concise"},tester:{style:"methodical",risk:"conservative",verbosity:"concise"},reviewer:{style:"deliberate",risk:"conservative",verbosity:"detailed"},security:{style:"methodical",risk:"conservative",verbosity:"detailed"},documentor:{style:"methodical",risk:"conservative",verbosity:"concise"}},v={architect:{symbols:["$*","#*"],concepts:["architecture","design","pattern","refactor"],signals:[{type:"flow-modified"},{type:"compliance-violation"}],threshold:.5},builder:{paths:["src/**","lib/**","packages/**"],signals:[{type:"file-modified"},{type:"error-encountered"}],threshold:.7},reviewer:{concepts:["code quality","bug","smell","convention"],signals:[{type:"compliance-violation"}],threshold:.6},tester:{paths:["**/*.test.*","**/*.spec.*"],concepts:["test","coverage","assertion"],signals:[{type:"error-encountered"},{type:"test-result"}],threshold:.5},security:{symbols:["^*","#*-auth","#*-middleware"],paths:["auth/**","middleware/**","guards/**"],concepts:["permission","JWT","session","RBAC","XSS","injection"],signals:[{type:"gate-added"},{type:"route-created"},{type:"gate-checked"},{type:"compliance-violation"}],threshold:.4},documentor:{paths:["**/.purpose","**/portal.yaml",".paradigm/**"],concepts:["purpose","portal","symbol","documentation","component","gate","flow"],signals:[{type:"file-modified"},{type:"compliance-violation"},{type:"work-completed"}],threshold:.3}},w={architect:{stance:"lead",debate:{will_challenge:true,evidence_required:true,escalate_to_human:true}},builder:{stance:"supportive",with:{architect:{stance:"supportive",can_contradict:false}}},reviewer:{stance:"advisory",debate:{will_challenge:true,evidence_required:true,escalate_to_human:true}},tester:{stance:"supportive",debate:{will_challenge:false,evidence_required:true,escalate_to_human:false}},security:{stance:"advisory",with:{architect:{stance:"peer",can_contradict:true},builder:{stance:"advisory",review_output:true}},debate:{will_challenge:true,evidence_required:true,escalate_to_human:true}},documentor:{stance:"supportive",with:{architect:{stance:"supportive"},builder:{stance:"supportive"},reviewer:{stance:"supportive"},security:{stance:"supportive"}},debate:{will_challenge:false,evidence_required:false,escalate_to_human:false}}};var y=u.join(S.homedir(),".paradigm","agents"),x=".paradigm/agents",h=".agent",T=".paradigm/roster.yaml",b=.3,L=60,$=7,N=.2;function m(e,t){let o=(Date.now()-new Date(t).getTime())/(1e3*60*60*24);if(o<=$)return e;let r=Math.pow(.5,(o-$)/L);return e*r}function F(e){let t=u.join(e,T);if(!l.existsSync(t))return null;try{return d.load(l.readFileSync(t,"utf8"))?.active??null}catch{return null}}function W(e,t){let i=F(t);return i?i.includes(e):true}function U(e,t){let i=u.join(e,T),o=u.dirname(i);l.existsSync(o)||l.mkdirSync(o,{recursive:true});let r={version:"1.0",active:t.sort()};l.writeFileSync(i,d.dump(r,{lineWidth:-1,noRefs:true}),"utf8");}function H(){if(!l.existsSync(y))return [];try{return l.readdirSync(y).filter(e=>e.endsWith(h)).map(e=>e.replace(h,""))}catch{return []}}function j(e,t){let i=u.join(e,x,`${t}${h}`);if(l.existsSync(i))try{let r=l.readFileSync(i,"utf-8");return d.load(r)}catch{}let o=u.join(y,`${t}${h}`);if(l.existsSync(o))try{let r=l.readFileSync(o,"utf-8"),n=d.load(r);if(l.existsSync(i))try{let a=l.readFileSync(i,"utf-8"),f=d.load(a);return R(n,f)}catch{}return n}catch{}return null}function O(e){let t=new Map;if(l.existsSync(y))try{let o=l.readdirSync(y).filter(r=>r.endsWith(h));for(let r of o)try{let n=l.readFileSync(u.join(y,r),"utf-8"),a=d.load(n);a?.id&&t.set(a.id,a);}catch{}}catch{}let i=u.join(e,x);if(l.existsSync(i))try{let o=l.readdirSync(i).filter(r=>r.endsWith(h));for(let r of o)try{let n=l.readFileSync(u.join(i,r),"utf-8"),a=d.load(n);if(!a?.id)continue;let f=t.get(a.id);f?t.set(a.id,R(f,a)):t.set(a.id,a);}catch{}}catch{}return Array.from(t.values())}function _(e,t,i,o){let r=i==="global"?y:u.join(o||process.cwd(),x);l.existsSync(r)||l.mkdirSync(r,{recursive:true});let n=u.join(r,`${e}${h}`);t.permissions&&(t.integrityHash=E(t)),t.updated=new Date().toISOString();let a=d.dump(t,{lineWidth:120,noRefs:true,sortKeys:false});return l.writeFileSync(n,a,"utf-8"),n}function I(e,t={}){let i=new Date().toISOString(),o={id:e,role:t.role||`${e.charAt(0).toUpperCase()+e.slice(1)} agent`,description:t.description||`Persistent identity for the ${e} agent role`,version:"1.0.0",personality:P[e]||{style:"balanced",risk:"balanced",verbosity:"concise"},expertise:[],transferable:[],contexts:{},created:i,updated:i};P[e]||(o.personality={style:"deliberate",risk:"balanced",verbosity:"concise"}),v[e]&&(o.attention={...v[e]}),w[e]&&(o.collaboration={...w[e]});let r=t.scope||"global",n=_(e,o,r,t.rootDir);return {profile:o,filePath:n}}function G(e,t){let i=O(e),o=[];for(let r of i){let n=(r.expertise||[]).find(a=>a.symbol===t);n&&o.push({agentId:r.id,entry:n});}return o.sort((r,n)=>m(n.entry.confidence,n.entry.lastTouch)-m(r.entry.confidence,r.entry.lastTouch))}function Y(e,t,i){let o=j(e,t);if(!o)return false;let r=new Date().toISOString(),n=o.expertise||[];for(let c of i.symbols_touched){let p=n.find(g=>g.symbol===c);p?(p.sessions++,p.lastTouch=r,i.confidence!=null&&(p.confidence=(1-b)*p.confidence+b*i.confidence)):n.push({symbol:c,confidence:i.confidence??.5,sessions:1,lastTouch:r});}o.expertise=n;let a=D(e);if(a){let c=o.contexts[a]||{focus:[],sessionsInProject:0};c.lastActive=r,c.sessionsInProject=(c.sessionsInProject||0)+1,o.contexts[a]=c;}let f=u.join(e,x,`${t}${h}`),s=l.existsSync(f)?"project":"global";return _(t,o,s,e),true}function B(e,t,i){let o=j(e,t);if(!o)return false;let n={correct:1,partial:.5,incorrect:0}[i.verdict];for(let s of i.symbols_touched){let c=(o.expertise||[]).find(p=>p.symbol===s);c&&(c.confidence=(1-b)*c.confidence+b*n);}let a=u.join(e,x,`${t}${h}`),f=l.existsSync(a)?"project":"global";return _(t,o,f,e),true}function J(e,t,i){return t?{personality:t.personality||null,topExpertise:(t.expertise||[]).sort((o,r)=>m(r.confidence,r.lastTouch)-m(o.confidence,o.lastTouch)).slice(0,10),projectContext:t.contexts?.[i]||null,transferablePatterns:(t.transferable||[]).filter(o=>o.successRate>=.7).map(o=>({id:o.id,description:o.description,successRate:o.successRate}))}:{personality:null,topExpertise:[],projectContext:null,transferablePatterns:[]}}function z(e,t,i,o,r){let n=[];if(e.personality){let s=e.personality;n.push(`## Agent Identity: ${e.id}`),n.push(`**Style:** ${s.style} | **Risk:** ${s.risk} | **Verbosity:** ${s.verbosity}`),n.push("");}let a=(e.expertise||[]).filter(s=>t.length===0||t.includes(s.symbol)).sort((s,c)=>m(c.confidence,c.lastTouch)-m(s.confidence,s.lastTouch)).slice(0,8);if(a.length>0){n.push("## Your Expertise on Relevant Symbols");for(let s of a){let p=1-m(s.confidence,s.lastTouch)/s.confidence,g=s.confidence>0&&p>N?" (aging)":"";n.push(`- \`${s.symbol}\`: confidence ${s.confidence.toFixed(2)} (${s.sessions} sessions)${g}`);}n.push("");}let f=(e.transferable||[]).filter(s=>s.successRate>=.7);if(f.length>0){n.push("## Transferable Patterns");for(let s of f){let c=s.appliedIn?.length||0;n.push(`- ${s.id}: ${(s.successRate*100).toFixed(0)}% success (learned in ${s.learnedIn}${c>0?`, applied in ${c} projects`:""})`);}n.push("");}if(i&&i.length>0){n.push("## Relevant Notebook Entries");for(let s of i.slice(0,5)){n.push(`### ${s.context}`),n.push(`Concepts: ${s.concepts.join(", ")}`),n.push("```");let c=s.snippet.length>300?s.snippet.slice(0,300)+"...":s.snippet;n.push(c),n.push("```"),n.push("");}}if(r){if(n.push(""),n.push("## Your Recent Work on This Project"),r.lastSession){let s=Date.now()-new Date(r.lastSession.date).getTime(),c=Math.floor(s/(3600*1e3)),p=c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`;n.push(`Last session (${p}): ${r.lastSession.summary}`);}if(r.sessionsOnProject&&n.push(`Sessions on this project: ${r.sessionsOnProject}`),r.pendingWork?.length){n.push("**Pending from last session:**");for(let s of r.pendingWork.slice(0,5))n.push(`- ${s}`);}if(r.recentPatterns?.length){n.push("**Project patterns you've learned:**");for(let s of r.recentPatterns.slice(0,5))n.push(`- ${s}`);}n.push("");}if(e.attention){let s=e.attention,c=[];s.symbols?.length&&c.push(`Symbols: ${s.symbols.join(", ")}`),s.paths?.length&&c.push(`Paths: ${s.paths.join(", ")}`),s.concepts?.length&&c.push(`Concepts: ${s.concepts.join(", ")}`),s.signals?.length&&c.push(`Signals: ${s.signals.map(p=>p.type).join(", ")}`),c.length>0&&(n.push(""),n.push("### Attention"),n.push(`Threshold: ${s.threshold??.6}`),n.push(c.join(" | ")));}if(e.collaboration){let s=e.collaboration;if(n.push(""),n.push("### Collaboration"),n.push(`Default stance: ${s.stance||"supportive"}`),s.with)for(let[c,p]of Object.entries(s.with)){let g=[`${c}: ${p.stance||"peer"}`];p.can_contradict&&g.push("can contradict"),p.review_output&&g.push("reviews output"),n.push(`- ${g.join(", ")}`);}if(s.debate){let c=s.debate,p=[];c.will_challenge&&p.push("challenges"),c.evidence_required&&p.push("evidence-based"),c.escalate_to_human&&p.push("escalates to human"),p.length&&n.push(`Debate: ${p.join(", ")}`);}}if(e.nomination){let s=e.nomination;if(n.push(""),n.push("### Nomination"),s.speak_when?.urgency?.length&&n.push(`Always speaks on: ${s.speak_when.urgency.join(", ")}`),s.contribution_style){let c=[];s.contribution_style.brief_first&&c.push("brief first"),s.contribution_style.cite_sources&&c.push("cites sources"),s.contribution_style.offer_action&&c.push("offers action"),c.length&&n.push(`Style: ${c.join(", ")}`);}}if(o){if(o.recentDecisions?.length){n.push(""),n.push("## Recent Team Decisions");for(let s of o.recentDecisions.slice(0,5))n.push(`- **${s.title}**: ${s.decision.slice(0,150)}${s.decision.length>150?"...":""}`);}if(o.journalInsights?.length){n.push(""),n.push("## Transferable Insights");for(let s of o.journalInsights.slice(0,5))n.push(`- [${s.trigger}] ${s.insight.slice(0,150)}${s.insight.length>150?"...":""}`);}if(o.pendingNominations?.length){n.push(""),n.push("## Pending Nominations");for(let s of o.pendingNominations.slice(0,10))n.push(`- [${s.urgency}] ${s.brief}`);}}return n.join(`
|
|
3
|
-
`)}async function X(e,t,i=false){let{loadLoreEntries:o}=await import('./lore-loader-XY5MZRR2.js'),r=await o(e,{limit:500}),n=0,a=new Set,f=j(e,t)||I(t,{rootDir:e}).profile,s=f.expertise||[];for(let c of r)if(!(!c.symbols_touched||c.symbols_touched.length===0)){n++;for(let p of c.symbols_touched){a.add(p);let g=s.find(C=>C.symbol===p);g?(g.sessions++,g.lastTouch=c.timestamp,c.confidence!=null&&(g.confidence=(1-b)*g.confidence+b*c.confidence)):s.push({symbol:p,confidence:c.confidence??.5,sessions:1,lastTouch:c.timestamp});}}if(f.expertise=s,!i){let c=u.join(e,x,`${t}${h}`),p=l.existsSync(c)?"project":"global";_(t,f,p,e);}return {entriesProcessed:n,symbolsUpdated:a.size}}function K(e,t,i){if(!e.permissions?.paths)return {allowed:true};let{read:o,write:r,deny:n}=e.permissions.paths;if(n&&n.length>0){for(let f of n)if(A(f,t))return {allowed:false,reason:`Path denied by pattern: ${f}`}}let a=i==="read"?o:r;if(a&&a.length>0){for(let f of a)if(A(f,t))return {allowed:true};return {allowed:false,reason:`No ${i} pattern matches: ${t}`}}return {allowed:true}}function V(e,t){if(!e.permissions?.tools)return {allowed:true};let{allow:i,deny:o}=e.permissions.tools;if(o&&o.length>0){for(let r of o)if(A(r,t))return {allowed:false,reason:`Tool denied by pattern: ${r}`}}if(i&&i.length>0){for(let r of i)if(A(r,t))return {allowed:true};return {allowed:false,reason:`Tool not in allow list: ${t}`}}return {allowed:true}}function E(e){let t=JSON.stringify({id:e.id,role:e.role,permissions:e.permissions||null});return k.createHash("sha256").update(t).digest("hex")}function Q(e){return e.integrityHash?E(e)===e.integrityHash?{valid:true}:{valid:false,reason:"Integrity hash mismatch \u2014 profile may have been tampered with"}:{valid:true,reason:"No integrity hash stored (pre-4.0 profile)"}}function A(e,t){let i=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${i}$`).test(t)}function R(e,t){let i={...e};if(t.role&&(i.role=t.role),t.description&&(i.description=t.description),t.version&&(i.version=t.version),t.personality&&(i.personality={...e.personality,...t.personality}),t.expertise){let o=new Map(e.expertise.map(r=>[r.symbol,r]));for(let r of t.expertise)o.set(r.symbol,r);i.expertise=Array.from(o.values());}if(t.transferable){let o=new Map(e.transferable.map(r=>[r.id,r]));for(let r of t.transferable)o.set(r.id,r);i.transferable=Array.from(o.values());}if(t.contexts){i.contexts={...e.contexts};for(let[o,r]of Object.entries(t.contexts))i.contexts[o]={...i.contexts[o],...r};}return i}function D(e){try{let t=u.join(e,".paradigm","config.yaml");if(l.existsSync(t)){let i=l.readFileSync(t,"utf-8"),o=d.load(i);if(o?.project&&typeof o.project=="string")return o.project}}catch{}return u.basename(e)}export{m as a,F as b,W as c,U as d,H as e,j as f,O as g,_ as h,I as i,G as j,Y as k,B as l,J as m,z as n,X as o,K as p,V as q,E as r,Q as s};
|
package/dist/chunk-ZMQXXFG2.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {b as b$1}from'./chunk-5TAVYPOV.js';import*as l from'fs';import*as u from'path';import*as T from'os';import*as E from'crypto';import*as d from'js-yaml';var P,v,w,S=b$1(()=>{P={architect:{style:"deliberate",risk:"conservative",verbosity:"detailed"},builder:{style:"rapid",risk:"balanced",verbosity:"concise"},tester:{style:"methodical",risk:"conservative",verbosity:"concise"},reviewer:{style:"deliberate",risk:"conservative",verbosity:"detailed"},security:{style:"methodical",risk:"conservative",verbosity:"detailed"},documentor:{style:"methodical",risk:"conservative",verbosity:"concise"}},v={architect:{symbols:["$*","#*"],concepts:["architecture","design","pattern","refactor"],signals:[{type:"flow-modified"},{type:"compliance-violation"}],threshold:.5},builder:{paths:["src/**","lib/**","packages/**"],signals:[{type:"file-modified"},{type:"error-encountered"}],threshold:.7},reviewer:{concepts:["code quality","bug","smell","convention"],signals:[{type:"compliance-violation"}],threshold:.6},tester:{paths:["**/*.test.*","**/*.spec.*"],concepts:["test","coverage","assertion"],signals:[{type:"error-encountered"},{type:"test-result"}],threshold:.5},security:{symbols:["^*","#*-auth","#*-middleware"],paths:["auth/**","middleware/**","guards/**"],concepts:["permission","JWT","session","RBAC","XSS","injection"],signals:[{type:"gate-added"},{type:"route-created"},{type:"gate-checked"},{type:"compliance-violation"}],threshold:.4},documentor:{paths:["**/.purpose","**/portal.yaml",".paradigm/**"],concepts:["purpose","portal","symbol","documentation","component","gate","flow"],signals:[{type:"file-modified"},{type:"compliance-violation"},{type:"work-completed"}],threshold:.3}},w={architect:{stance:"lead",debate:{will_challenge:true,evidence_required:true,escalate_to_human:true}},builder:{stance:"supportive",with:{architect:{stance:"supportive",can_contradict:false}}},reviewer:{stance:"advisory",debate:{will_challenge:true,evidence_required:true,escalate_to_human:true}},tester:{stance:"supportive",debate:{will_challenge:false,evidence_required:true,escalate_to_human:false}},security:{stance:"advisory",with:{architect:{stance:"peer",can_contradict:true},builder:{stance:"advisory",review_output:true}},debate:{will_challenge:true,evidence_required:true,escalate_to_human:true}},documentor:{stance:"supportive",with:{architect:{stance:"supportive"},builder:{stance:"supportive"},reviewer:{stance:"supportive"},security:{stance:"supportive"}},debate:{will_challenge:false,evidence_required:false,escalate_to_human:false}}};});function m(e,t){let o=(Date.now()-new Date(t).getTime())/(1e3*60*60*24);if(o<=k)return e;let r=Math.pow(.5,(o-k)/F);return e*r}function I(e){let t=u.join(e,R);if(!l.existsSync(t))return null;try{return d.load(l.readFileSync(t,"utf8"))?.active??null}catch{return null}}function G(e,t){let i=I(t);return i?i.includes(e):true}function Y(e,t){let i=u.join(e,R),o=u.dirname(i);l.existsSync(o)||l.mkdirSync(o,{recursive:true});let r={version:"1.0",active:t.sort()};l.writeFileSync(i,d.dump(r,{lineWidth:-1,noRefs:true}),"utf8");}function B(){if(!l.existsSync(y))return [];try{return l.readdirSync(y).filter(e=>e.endsWith(h)).map(e=>e.replace(h,""))}catch{return []}}function j(e,t){let i=u.join(e,x,`${t}${h}`);if(l.existsSync(i))try{let r=l.readFileSync(i,"utf-8");return d.load(r)}catch{}let o=u.join(y,`${t}${h}`);if(l.existsSync(o))try{let r=l.readFileSync(o,"utf-8"),n=d.load(r);if(l.existsSync(i))try{let a=l.readFileSync(i,"utf-8"),f=d.load(a);return L(n,f)}catch{}return n}catch{}return null}function D(e){let t=new Map;if(l.existsSync(y))try{let o=l.readdirSync(y).filter(r=>r.endsWith(h));for(let r of o)try{let n=l.readFileSync(u.join(y,r),"utf-8"),a=d.load(n);a?.id&&t.set(a.id,a);}catch{}}catch{}let i=u.join(e,x);if(l.existsSync(i))try{let o=l.readdirSync(i).filter(r=>r.endsWith(h));for(let r of o)try{let n=l.readFileSync(u.join(i,r),"utf-8"),a=d.load(n);if(!a?.id)continue;let f=t.get(a.id);f?t.set(a.id,L(f,a)):t.set(a.id,a);}catch{}}catch{}return Array.from(t.values())}function _(e,t,i,o){let r=i==="global"?y:u.join(o||process.cwd(),x);l.existsSync(r)||l.mkdirSync(r,{recursive:true});let n=u.join(r,`${e}${h}`);t.permissions&&(t.integrityHash=C(t)),t.updated=new Date().toISOString();let a=d.dump(t,{lineWidth:120,noRefs:true,sortKeys:false});return l.writeFileSync(n,a,"utf-8"),n}function M(e,t={}){let i=new Date().toISOString(),o={id:e,role:t.role||`${e.charAt(0).toUpperCase()+e.slice(1)} agent`,description:t.description||`Persistent identity for the ${e} agent role`,version:"1.0.0",personality:P[e]||{style:"balanced",risk:"balanced",verbosity:"concise"},expertise:[],transferable:[],contexts:{},created:i,updated:i};P[e]||(o.personality={style:"deliberate",risk:"balanced",verbosity:"concise"}),v[e]&&(o.attention={...v[e]}),w[e]&&(o.collaboration={...w[e]});let r=t.scope||"global",n=_(e,o,r,t.rootDir);return {profile:o,filePath:n}}function J(e,t){let i=D(e),o=[];for(let r of i){let n=(r.expertise||[]).find(a=>a.symbol===t);n&&o.push({agentId:r.id,entry:n});}return o.sort((r,n)=>m(n.entry.confidence,n.entry.lastTouch)-m(r.entry.confidence,r.entry.lastTouch))}function z(e,t,i){let o=j(e,t);if(!o)return false;let r=new Date().toISOString(),n=o.expertise||[];for(let c of i.symbols_touched){let p=n.find(g=>g.symbol===c);p?(p.sessions++,p.lastTouch=r,i.confidence!=null&&(p.confidence=(1-b)*p.confidence+b*i.confidence)):n.push({symbol:c,confidence:i.confidence??.5,sessions:1,lastTouch:r});}o.expertise=n;let a=q(e);if(a){let c=o.contexts[a]||{focus:[],sessionsInProject:0};c.lastActive=r,c.sessionsInProject=(c.sessionsInProject||0)+1,o.contexts[a]=c;}let f=u.join(e,x,`${t}${h}`),s=l.existsSync(f)?"project":"global";return _(t,o,s,e),true}function X(e,t,i){let o=j(e,t);if(!o)return false;let n={correct:1,partial:.5,incorrect:0}[i.verdict];for(let s of i.symbols_touched){let c=(o.expertise||[]).find(p=>p.symbol===s);c&&(c.confidence=(1-b)*c.confidence+b*n);}let a=u.join(e,x,`${t}${h}`),f=l.existsSync(a)?"project":"global";return _(t,o,f,e),true}function K(e,t,i){return t?{personality:t.personality||null,topExpertise:(t.expertise||[]).sort((o,r)=>m(r.confidence,r.lastTouch)-m(o.confidence,o.lastTouch)).slice(0,10),projectContext:t.contexts?.[i]||null,transferablePatterns:(t.transferable||[]).filter(o=>o.successRate>=.7).map(o=>({id:o.id,description:o.description,successRate:o.successRate}))}:{personality:null,topExpertise:[],projectContext:null,transferablePatterns:[]}}function V(e,t,i,o,r){let n=[];if(e.personality){let s=e.personality;n.push(`## Agent Identity: ${e.id}`),n.push(`**Style:** ${s.style} | **Risk:** ${s.risk} | **Verbosity:** ${s.verbosity}`),n.push("");}let a=(e.expertise||[]).filter(s=>t.length===0||t.includes(s.symbol)).sort((s,c)=>m(c.confidence,c.lastTouch)-m(s.confidence,s.lastTouch)).slice(0,8);if(a.length>0){n.push("## Your Expertise on Relevant Symbols");for(let s of a){let p=1-m(s.confidence,s.lastTouch)/s.confidence,g=s.confidence>0&&p>O?" (aging)":"";n.push(`- \`${s.symbol}\`: confidence ${s.confidence.toFixed(2)} (${s.sessions} sessions)${g}`);}n.push("");}let f=(e.transferable||[]).filter(s=>s.successRate>=.7);if(f.length>0){n.push("## Transferable Patterns");for(let s of f){let c=s.appliedIn?.length||0;n.push(`- ${s.id}: ${(s.successRate*100).toFixed(0)}% success (learned in ${s.learnedIn}${c>0?`, applied in ${c} projects`:""})`);}n.push("");}if(i&&i.length>0){n.push("## Relevant Notebook Entries");for(let s of i.slice(0,5)){n.push(`### ${s.context}`),n.push(`Concepts: ${s.concepts.join(", ")}`),n.push("```");let c=s.snippet.length>300?s.snippet.slice(0,300)+"...":s.snippet;n.push(c),n.push("```"),n.push("");}}if(r){if(n.push(""),n.push("## Your Recent Work on This Project"),r.lastSession){let s=Date.now()-new Date(r.lastSession.date).getTime(),c=Math.floor(s/(3600*1e3)),p=c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`;n.push(`Last session (${p}): ${r.lastSession.summary}`);}if(r.sessionsOnProject&&n.push(`Sessions on this project: ${r.sessionsOnProject}`),r.pendingWork?.length){n.push("**Pending from last session:**");for(let s of r.pendingWork.slice(0,5))n.push(`- ${s}`);}if(r.recentPatterns?.length){n.push("**Project patterns you've learned:**");for(let s of r.recentPatterns.slice(0,5))n.push(`- ${s}`);}n.push("");}if(e.attention){let s=e.attention,c=[];s.symbols?.length&&c.push(`Symbols: ${s.symbols.join(", ")}`),s.paths?.length&&c.push(`Paths: ${s.paths.join(", ")}`),s.concepts?.length&&c.push(`Concepts: ${s.concepts.join(", ")}`),s.signals?.length&&c.push(`Signals: ${s.signals.map(p=>p.type).join(", ")}`),c.length>0&&(n.push(""),n.push("### Attention"),n.push(`Threshold: ${s.threshold??.6}`),n.push(c.join(" | ")));}if(e.collaboration){let s=e.collaboration;if(n.push(""),n.push("### Collaboration"),n.push(`Default stance: ${s.stance||"supportive"}`),s.with)for(let[c,p]of Object.entries(s.with)){let g=[`${c}: ${p.stance||"peer"}`];p.can_contradict&&g.push("can contradict"),p.review_output&&g.push("reviews output"),n.push(`- ${g.join(", ")}`);}if(s.debate){let c=s.debate,p=[];c.will_challenge&&p.push("challenges"),c.evidence_required&&p.push("evidence-based"),c.escalate_to_human&&p.push("escalates to human"),p.length&&n.push(`Debate: ${p.join(", ")}`);}}if(e.nomination){let s=e.nomination;if(n.push(""),n.push("### Nomination"),s.speak_when?.urgency?.length&&n.push(`Always speaks on: ${s.speak_when.urgency.join(", ")}`),s.contribution_style){let c=[];s.contribution_style.brief_first&&c.push("brief first"),s.contribution_style.cite_sources&&c.push("cites sources"),s.contribution_style.offer_action&&c.push("offers action"),c.length&&n.push(`Style: ${c.join(", ")}`);}}if(o){if(o.recentDecisions?.length){n.push(""),n.push("## Recent Team Decisions");for(let s of o.recentDecisions.slice(0,5))n.push(`- **${s.title}**: ${s.decision.slice(0,150)}${s.decision.length>150?"...":""}`);}if(o.journalInsights?.length){n.push(""),n.push("## Transferable Insights");for(let s of o.journalInsights.slice(0,5))n.push(`- [${s.trigger}] ${s.insight.slice(0,150)}${s.insight.length>150?"...":""}`);}if(o.pendingNominations?.length){n.push(""),n.push("## Pending Nominations");for(let s of o.pendingNominations.slice(0,10))n.push(`- [${s.urgency}] ${s.brief}`);}}return n.join(`
|
|
3
|
-
`)}async function Q(e,t,i=false){let{loadLoreEntries:o}=await import('./lore-loader-RVQI5GXL.js'),r=await o(e,{limit:500}),n=0,a=new Set,f=j(e,t)||M(t,{rootDir:e}).profile,s=f.expertise||[];for(let c of r)if(!(!c.symbols_touched||c.symbols_touched.length===0)){n++;for(let p of c.symbols_touched){a.add(p);let g=s.find(N=>N.symbol===p);g?(g.sessions++,g.lastTouch=c.timestamp,c.confidence!=null&&(g.confidence=(1-b)*g.confidence+b*c.confidence)):s.push({symbol:p,confidence:c.confidence??.5,sessions:1,lastTouch:c.timestamp});}}if(f.expertise=s,!i){let c=u.join(e,x,`${t}${h}`),p=l.existsSync(c)?"project":"global";_(t,f,p,e);}return {entriesProcessed:n,symbolsUpdated:a.size}}function Z(e,t,i){if(!e.permissions?.paths)return {allowed:true};let{read:o,write:r,deny:n}=e.permissions.paths;if(n&&n.length>0){for(let f of n)if(A(f,t))return {allowed:false,reason:`Path denied by pattern: ${f}`}}let a=i==="read"?o:r;if(a&&a.length>0){for(let f of a)if(A(f,t))return {allowed:true};return {allowed:false,reason:`No ${i} pattern matches: ${t}`}}return {allowed:true}}function ee(e,t){if(!e.permissions?.tools)return {allowed:true};let{allow:i,deny:o}=e.permissions.tools;if(o&&o.length>0){for(let r of o)if(A(r,t))return {allowed:false,reason:`Tool denied by pattern: ${r}`}}if(i&&i.length>0){for(let r of i)if(A(r,t))return {allowed:true};return {allowed:false,reason:`Tool not in allow list: ${t}`}}return {allowed:true}}function C(e){let t=JSON.stringify({id:e.id,role:e.role,permissions:e.permissions||null});return E.createHash("sha256").update(t).digest("hex")}function te(e){return e.integrityHash?C(e)===e.integrityHash?{valid:true}:{valid:false,reason:"Integrity hash mismatch \u2014 profile may have been tampered with"}:{valid:true,reason:"No integrity hash stored (pre-4.0 profile)"}}function A(e,t){let i=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${i}$`).test(t)}function L(e,t){let i={...e};if(t.role&&(i.role=t.role),t.description&&(i.description=t.description),t.version&&(i.version=t.version),t.personality&&(i.personality={...e.personality,...t.personality}),t.expertise){let o=new Map(e.expertise.map(r=>[r.symbol,r]));for(let r of t.expertise)o.set(r.symbol,r);i.expertise=Array.from(o.values());}if(t.transferable){let o=new Map(e.transferable.map(r=>[r.id,r]));for(let r of t.transferable)o.set(r.id,r);i.transferable=Array.from(o.values());}if(t.contexts){i.contexts={...e.contexts};for(let[o,r]of Object.entries(t.contexts))i.contexts[o]={...i.contexts[o],...r};}return i}function q(e){try{let t=u.join(e,".paradigm","config.yaml");if(l.existsSync(t)){let i=l.readFileSync(t,"utf-8"),o=d.load(i);if(o?.project&&typeof o.project=="string")return o.project}}catch{}return u.basename(e)}var y,x,h,R,b,F,k,O,W=b$1(()=>{S();y=u.join(T.homedir(),".paradigm","agents"),x=".paradigm/agents",h=".agent",R=".paradigm/roster.yaml",b=.3,F=60,k=7,O=.2;});export{m as a,I as b,G as c,Y as d,B as e,j as f,D as g,_ as h,M as i,J as j,z as k,X as l,K as m,V as n,Q as o,Z as p,ee as q,C as r,te as s,W as t};
|
package/dist/reindex-HA3CJG7S.js
DELETED