@pharn-dev/pharn 0.21.3 → 0.21.4

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/index.js CHANGED
@@ -8,4 +8,4 @@ import{parseArchetypeList}from"./chunk-IC45C3NS.js";import{REF_CHOICES}from"./ch
8
8
  and pharn says which applies whenever a proxy variable is set
9
9
  NO_COLOR=1 Turn colored output off (FORCE_COLOR=1 turns it on)`,DESCRIPTION_COLUMN=21,COMMAND_COLUMN=29,isGlobal=opt=>opt.uses.some(u=>u.commands.length===0),takesOption=(opt,cmd)=>isGlobal(opt)||opt.uses.some(u=>u.commands.includes(cmd));function optionLines(opt,forCommand){let body=(forCommand===void 0?opt.uses:opt.uses.filter(u=>u.commands.length===0||u.commands.includes(forCommand))).flatMap(({commands,text})=>text.map((line,i)=>i===0&&forCommand===void 0&&commands.length>0?`${commands.join(", ")}: ${line}`:line)),indent=" ".repeat(DESCRIPTION_COLUMN),head=` ${opt.short?`-${opt.short}, `:" "}${opt.long}`;if(head.length+2>DESCRIPTION_COLUMN)return[head,...body.map(line=>indent+line)];let[first,...rest]=body;return[head.padEnd(DESCRIPTION_COLUMN)+(first??""),...rest.map(line=>indent+line)]}function commandLabel(c){let names=[c.name,...c.aliases??[]].join(", ");return c.args?`${names} ${c.args}`:names}var USAGE=[INTRO,"","Usage:"," pharn [command] [options]","","Commands:",...COMMANDS.map(c=>` ${commandLabel(c).padEnd(COMMAND_COLUMN-2)}${c.summary}`),"","Options (each names the commands that take it; any other command refuses it):",...OPTIONS.flatMap(opt=>optionLines(opt)),"",ENVIRONMENT,"","Run `pharn <command> --help` for one command and only its options."].join(`
10
10
  `);function commandUsage(doc){let args=doc.args?` ${doc.args}`:"",options=OPTIONS.some(opt=>!isGlobal(opt)&&takesOption(opt,doc.name))?" [options]":"";return["Usage:",` pharn ${doc.name}${args}${options}`,...(doc.aliases??[]).map(a=>` pharn ${a}${args}${options} (alias)`),"",doc.page??`${doc.summary}.`,"","Options:",...OPTIONS.filter(opt=>takesOption(opt,doc.name)).flatMap(opt=>optionLines(opt,doc.name)),"","Run `pharn --help` for every command and the environment variables pharn reads."].join(`
11
- `)}var USAGE_POINTER="Run `pharn --help` for usage.",PARSE_OPTIONS=Object.fromEntries(OPTIONS.map(opt=>[opt.key,{type:opt.value?"string":"boolean",...opt.short===void 0?{}:{short:opt.short}}])),OPTION_BY_KEY=new Map(OPTIONS.map(opt=>[opt.key,opt])),COMMAND_BY_WORD=new Map(COMMANDS.flatMap(c=>[c.name,...c.aliases??[]].map(word=>[word,c])));function refuse(label,offenders){return{kind:"refuse",message:`${label}: ${[...new Set(offenders)].map(o=>JSON.stringify(o)).join(", ")}`}}function parseCliArgs(args){let{tokens}=parseArgs({args:[...args],options:PARSE_OPTIONS,strict:!1,allowPositionals:!0,tokens:!0}),options=[],positionals=[];for(let t of tokens)t.kind==="option"?options.push(t):t.kind==="positional"&&positionals.push(t.value);let written=t=>args[t.index],word=positionals[0],doc=COMMAND_BY_WORD.get(word??"init"),unknown=options.filter(t=>!OPTION_BY_KEY.has(t.name));if(unknown.length>0)return refuse("Unknown option",unknown.map(written));if(doc!==void 0){let unsupported=options.filter(t=>!takesOption(OPTION_BY_KEY.get(t.name),doc.name));if(unsupported.length>0){let typed=[doc.name,...doc.aliases??[]].find(w=>w===word)??doc.name;return refuse(`Unsupported option for \`${typed}\``,unsupported.map(written))}}let valued=options.filter(t=>OPTION_BY_KEY.get(t.name).value!==!0&&t.inlineValue===!0);if(valued.length>0)return refuse("Option takes no value",valued.map(written));let repeated=OPTIONS.filter(opt=>opt.value&&options.filter(t=>t.name===opt.key).length>1);if(repeated.length>0)return refuse("Repeated option",repeated.map(opt=>`--${opt.key}`));let has=key=>options.some(t=>t.name===key),valueOf=key=>{let t=options.find(o=>o.name===key);return t===void 0?void 0:t.value??""},refValue=valueOf("ref"),ref=refValue===void 0?void 0:REF_CHOICES.find(choice=>choice===refValue);if(refValue!==void 0&&ref===void 0)return refuse(`Invalid value for --ref (expected ${REF_CHOICES.map(r=>`"${r}"`).join(" or ")})`,[refValue]);let archetypeValue=valueOf("archetype"),archetypes=archetypeValue===void 0?void 0:parseArchetypeList(archetypeValue);if(archetypes===null)return refuse('Invalid value for --archetype (expected a comma-separated list of "ssr", "backend", "spa" \u2014 or "lib" alone \u2014 each at most once)',[archetypeValue]);if(has("version"))return{kind:"print",text:PHARN_VERSION};if(has("help"))return{kind:"print",text:word!==void 0&&doc!==void 0?commandUsage(doc):USAGE};if(doc===void 0)return{kind:"refuse",message:`Unknown command: ${escapeUnsafe(word)}`};let maxPositionals=doc.args===void 0?1:2;if(positionals.length>maxPositionals)return refuse("Unexpected argument",positionals.slice(maxPositionals));let json=has("json");switch(doc.name){case"init":return run({command:"init",options:{ref,archetypes,yes:has("yes"),dryRun:has("dry-run")||json,json}});case"add":case"remove":return run({command:doc.name,capability:positionals[1]});case"update":{let compact=has("compact");return run({command:"update",options:{force:has("force"),yes:has("yes"),dryRun:has("dry-run")||json||compact,json:json||compact,compact,ref}})}case"list":return run({command:"list",options:{json}});case"status":return run({command:"status",options:{strict:has("strict"),drift:!has("no-drift"),json}});case"uninstall":return run({command:"uninstall",options:{yes:has("yes")}})}}function run(invocation){return{kind:"run",invocation}}async function main(args=process.argv.slice(2)){let parsed=parseCliArgs(args);if(parsed.kind==="refuse")throw console.error(parsed.message),console.error(USAGE_POINTER),CliError.reported();if(parsed.kind==="print"){console.log(parsed.text);return}let{invocation}=parsed;switch(invocation.command){case"init":{let{runInit}=await import("./init-EPDY3RLK.js");await runInit(invocation.options);return}case"add":{let{runAdd}=await import("./add-SQD64NY5.js");await runAdd(invocation.capability);return}case"remove":{let{runRemove}=await import("./remove-JOTEICQD.js");await runRemove(invocation.capability);return}case"update":{let{runUpdate}=await import("./update-IM2C2RDO.js");await runUpdate(invocation.options);return}case"list":{let{runList}=await import("./list-JME23KNT.js");await runList(invocation.options);return}case"status":{let{runStatus}=await import("./status-MDA62RG7.js");await runStatus(invocation.options);return}case"uninstall":{let{runUninstall}=await import("./uninstall-AISUCCXU.js");await runUninstall(invocation.options);return}}}function isEntryPoint(){if(!process.argv[1])return!1;try{return realpathSync(process.argv[1])===fileURLToPath(import.meta.url)}catch{return!1}}async function runCli(args=process.argv.slice(2)){try{await main(args)}catch(err){if(err instanceof CliError&&err.form==="reported"){process.exitCode=err.exitCode;return}let{reportCliError}=await import("./report-error-63XMOBGV.js");process.exitCode=reportCliError(err)}}isEntryPoint()&&runCli();export{main,runCli};
11
+ `)}var USAGE_POINTER="Run `pharn --help` for usage.",PARSE_OPTIONS=Object.fromEntries(OPTIONS.map(opt=>[opt.key,{type:opt.value?"string":"boolean",...opt.short===void 0?{}:{short:opt.short}}])),OPTION_BY_KEY=new Map(OPTIONS.map(opt=>[opt.key,opt])),COMMAND_BY_WORD=new Map(COMMANDS.flatMap(c=>[c.name,...c.aliases??[]].map(word=>[word,c])));function refuse(label,offenders){return{kind:"refuse",message:`${label}: ${[...new Set(offenders)].map(o=>JSON.stringify(o)).join(", ")}`}}function parseCliArgs(args){let{tokens}=parseArgs({args:[...args],options:PARSE_OPTIONS,strict:!1,allowPositionals:!0,tokens:!0}),options=[],positionals=[];for(let t of tokens)t.kind==="option"?options.push(t):t.kind==="positional"&&positionals.push(t.value);let written=t=>args[t.index],word=positionals[0],doc=COMMAND_BY_WORD.get(word??"init"),unknown=options.filter(t=>!OPTION_BY_KEY.has(t.name));if(unknown.length>0)return refuse("Unknown option",unknown.map(written));if(doc!==void 0){let unsupported=options.filter(t=>!takesOption(OPTION_BY_KEY.get(t.name),doc.name));if(unsupported.length>0){let typed=[doc.name,...doc.aliases??[]].find(w=>w===word)??doc.name;return refuse(`Unsupported option for \`${typed}\``,unsupported.map(written))}}let valued=options.filter(t=>OPTION_BY_KEY.get(t.name).value!==!0&&t.inlineValue===!0);if(valued.length>0)return refuse("Option takes no value",valued.map(written));let repeated=OPTIONS.filter(opt=>opt.value&&options.filter(t=>t.name===opt.key).length>1);if(repeated.length>0)return refuse("Repeated option",repeated.map(opt=>`--${opt.key}`));let has=key=>options.some(t=>t.name===key),valueOf=key=>{let t=options.find(o=>o.name===key);return t===void 0?void 0:t.value??""},refValue=valueOf("ref"),ref=refValue===void 0?void 0:REF_CHOICES.find(choice=>choice===refValue);if(refValue!==void 0&&ref===void 0)return refuse(`Invalid value for --ref (expected ${REF_CHOICES.map(r=>`"${r}"`).join(" or ")})`,[refValue]);let archetypeValue=valueOf("archetype"),archetypes=archetypeValue===void 0?void 0:parseArchetypeList(archetypeValue);if(archetypes===null)return refuse('Invalid value for --archetype (expected a comma-separated list of "ssr", "backend", "spa" \u2014 or "lib" alone \u2014 each at most once)',[archetypeValue]);if(has("version"))return{kind:"print",text:PHARN_VERSION};if(has("help"))return{kind:"print",text:word!==void 0&&doc!==void 0?commandUsage(doc):USAGE};if(doc===void 0)return{kind:"refuse",message:`Unknown command: ${escapeUnsafe(word)}`};let maxPositionals=doc.args===void 0?1:2;if(positionals.length>maxPositionals)return refuse("Unexpected argument",positionals.slice(maxPositionals));let json=has("json");switch(doc.name){case"init":return run({command:"init",options:{ref,archetypes,yes:has("yes"),dryRun:has("dry-run")||json,json}});case"add":case"remove":return run({command:doc.name,capability:positionals[1]});case"update":{let compact=has("compact");return run({command:"update",options:{force:has("force"),yes:has("yes"),dryRun:has("dry-run")||json||compact,json:json||compact,compact,ref}})}case"list":return run({command:"list",options:{json}});case"status":return run({command:"status",options:{strict:has("strict"),drift:!has("no-drift"),json}});case"uninstall":return run({command:"uninstall",options:{yes:has("yes")}})}}function run(invocation){return{kind:"run",invocation}}async function main(args=process.argv.slice(2)){let parsed=parseCliArgs(args);if(parsed.kind==="refuse")throw console.error(parsed.message),console.error(USAGE_POINTER),CliError.reported();if(parsed.kind==="print"){console.log(parsed.text);return}let{invocation}=parsed;switch(invocation.command){case"init":{let{runInit}=await import("./init-EPDY3RLK.js");await runInit(invocation.options);return}case"add":{let{runAdd}=await import("./add-SQD64NY5.js");await runAdd(invocation.capability);return}case"remove":{let{runRemove}=await import("./remove-JOTEICQD.js");await runRemove(invocation.capability);return}case"update":{let{runUpdate}=await import("./update-4LEMFH6Y.js");await runUpdate(invocation.options);return}case"list":{let{runList}=await import("./list-JME23KNT.js");await runList(invocation.options);return}case"status":{let{runStatus}=await import("./status-MDA62RG7.js");await runStatus(invocation.options);return}case"uninstall":{let{runUninstall}=await import("./uninstall-AISUCCXU.js");await runUninstall(invocation.options);return}}}function isEntryPoint(){if(!process.argv[1])return!1;try{return realpathSync(process.argv[1])===fileURLToPath(import.meta.url)}catch{return!1}}async function runCli(args=process.argv.slice(2)){try{await main(args)}catch(err){if(err instanceof CliError&&err.form==="reported"){process.exitCode=err.exitCode;return}let{reportCliError}=await import("./report-error-63XMOBGV.js");process.exitCode=reportCliError(err)}}isEntryPoint()&&runCli();export{main,runCli};
@@ -4,7 +4,7 @@ import{CapabilityRemovalError,absentSurfaceLines,planCapabilityRemovals,readUpst
4
4
  `),"HOOKS"),reportAbsentSurfaces(outcome.absentUpstream??[]),reportExecutableUnit(plan.held,!1);let forceable=reportSkipped(plan.skipped,!1);if(reportOrphans(outcome.orphans),reportLayoutWarnings(outcome.featuresReadmeRelocation,!1),versionWithheld&&log.warn(withheldVersionLine({skipped:counts.skipped,recordedVersion:outcome.recordedVersion,installedVersion:outcome.installedVersion,forceable,preview:!1})),outcome.unchanged){outro(`${noChangeVerdict({counts,recordedVersion:outcome.recordedVersion,installedVersion:outcome.installedVersion})} ${color_default.dim(`(unchanged ${counts.ok} \xB7 skipped ${counts.skipped} \xB7 ${outcome.capCount} capabilit${outcome.capCount===1?"y":"ies"}, skills v${outcome.recordedVersion})`)}`);return}let summary=`updated ${counts.updated} \xB7 restored ${counts.restored} \xB7 unchanged ${counts.ok}`+(force?` \xB7 forced ${counts.forced}`:"")+` \xB7 skipped ${counts.skipped}`;outro(`${color_default.green("\u2714")} ${summary} ${color_default.dim(`(${outcome.capCount} capabilit${outcome.capCount===1?"y":"ies"}, skills v${outcome.recordedVersion})`)}`)}function reportAbsentSurfaces(absent){let lines=absentSurfaceLines(absent);lines&&note(lines.join(`
5
5
  `),"NOT SHIPPED")}function withheldVersionLine(o){let{skipped,recordedVersion,installedVersion,forceable,preview}=o;if(recordedVersion===installedVersion){let action=forceable?`${preview?"run":"re-run"} with --force to overwrite them (backed up to ${BACKUP_DIR}/ first), or keep them as they are`:"resolve them by hand";return`${skipped} file(s) ${preview?"would be":"were"} skipped; your install is already at skills v${installedVersion}, so there is no upgrade to finish \u2014 ${action}.`}return preview?`${skipped} file(s) would be skipped, so your install would stay recorded as skills v${recordedVersion} (upstream is v${installedVersion}) \u2014 resolve them${forceable?", or run with --force,":""} to finish the upgrade.`:`${skipped} file(s) were skipped, so your install is still recorded as skills v${recordedVersion} (upstream is v${installedVersion}) \u2014 resolve them${forceable?", or re-run with --force,":""} to finish the upgrade.`}function reportSkipped(skipped,preview){let forceable=skipped.some(g=>FORCEABLE_SKIPS.has(g.label)),hasUnreadable=skipped.some(g=>!FORCEABLE_SKIPS.has(g.label));if(skipped.length>0){let lines=[];for(let group of skipped){lines.push(` ${skipHeading(group.label)}`);for(let rel of group.rels)lines.push(` ${rel}`);lines.push("")}forceable&&lines.push(color_default.dim(preview?` Run \`pharn update --force\` to overwrite (skipped files would be backed up to ${BACKUP_DIR}/ first).`:` Re-run with --force to overwrite (skipped files are backed up to ${BACKUP_DIR}/ first).`)),hasUnreadable&&lines.push(color_default.dim(" --force cannot clear the UNREADABLE paths above."),color_default.dim(" Inspect each path by hand \u2014 a directory, a symlink, or an"),color_default.dim(" unreadable file sits where pharn expects a regular file.")),note(lines.join(`
6
6
  `),"SKIPPED")}return forceable}function reportOrphans(orphans){let lines=orphanNoteLines(orphans);lines&&note(lines.join(`
7
- `),"ORPHANED")}function reportLayoutWarnings(featuresReadmeRelocation,preview){featuresReadmeRelocation&&log.warn(preview?"Your install would keep the product-loop boundary contract at pharn/features/README.md. A copy at the project root (features/README.md) would be left behind and no longer managed by pharn \u2014 you would delete it by hand.":"Your install now keeps the product-loop boundary contract at pharn/features/README.md. A copy at the project root (features/README.md) is left behind and is no longer managed by pharn \u2014 delete it by hand.")}function reportDryRun(r,force,channel,config){r.recordsNote&&log.warn(`\u26A0 ${escapeUnsafe(r.recordsNote)}`);let writes=r.files.filter(f=>f.action==="write"),sections=[{heading:"WOULD WRITE \u2014 restored (missing from your project)",rels:writes.filter(f=>f.label==="restored").map(f=>f.rel)},{heading:"WOULD WRITE \u2014 updated (still exactly as pharn wrote them)",rels:writes.filter(f=>f.label==="updated").map(f=>f.rel)},...forcedOverwriteSections(r,"WOULD")],deletes=r.removals.filter(removal=>removal.present);sections.push({heading:"WOULD DELETE \u2014 directories of capabilities dropped from your config",rels:deletes.map(removal=>`${removal.dir}/`)});let backupRels=[...new Set([...r.backups,...r.removals.flatMap(x=>x.backups)])],lines=[];for(let{heading,rels}of sections)if(rels.length!==0){lines.push(` ${heading}`);for(let rel of rels)lines.push(` ${rel}`);lines.push("")}if(backupRels.length>0){lines.push(` WOULD BACK UP ${backupRels.length} file(s) to ${BACKUP_DIR}/<timestamp>/ first`);for(let rel of backupRels)lines.push(` ${rel}`);lines.push("")}let gitignore=gitignoreLines(r.gitignore,{preview:!0});gitignore!==null&&!gitignore.warn&&lines.push(` ${gitignore.text}`,"");let prettierignore=prettierignoreLines(r.prettierignore,{preview:!0});prettierignore!==null&&!prettierignore.warn&&lines.push(` ${prettierignore.text}`,"");let stateFiles=[...r.stateChanges.config?[CONFIG_FILENAME]:[],...r.stateChanges.records?[RECORDS_FILE]:[]];r.changesNothing?lines.push(" Nothing would be written.",""):changesNoFiles(r)&&lines.push(` Would rewrite only ${stateFiles.join(" and ")}.`,""),lines.push(` UNCHANGED ${r.counts.ok} file(s) \xB7 SKIPPED ${r.counts.skipped} file(s)`),channel!==channelOf(config)&&lines.push("",` Would record channel: ${channel}`),note(lines.join(`
7
+ `),"ORPHANED")}function reportLayoutWarnings(featuresReadmeRelocation,preview){featuresReadmeRelocation&&log.warn(preview?"Your install would keep the product-loop boundary contract at pharn/features/README.md. A copy at the project root (features/README.md) would be left behind and no longer managed by pharn \u2014 you would delete it by hand.":"Your install now keeps the product-loop boundary contract at pharn/features/README.md. A copy at the project root (features/README.md) is left behind and is no longer managed by pharn \u2014 delete it by hand.")}function reportDryRun(r,force,channel,config){r.recordsNote&&log.warn(`\u26A0 ${escapeUnsafe(r.recordsNote)}`);let writes=r.files.filter(f=>f.action==="write"),sections=[{heading:"WOULD WRITE \u2014 restored (missing from your project)",rels:writes.filter(f=>f.label==="restored").map(f=>f.rel)},{heading:"WOULD WRITE \u2014 updated (still exactly as pharn wrote them)",rels:writes.filter(f=>f.label==="updated").map(f=>f.rel)},...forcedOverwriteSections(r,"WOULD")],deletes=r.removals.filter(removal=>removal.present);sections.push({heading:"WOULD DELETE \u2014 directories of capabilities dropped from your config",rels:deletes.map(removal=>`${removal.dir}/`)});let backupRels=[...new Set([...r.backups,...r.removals.flatMap(x=>x.backups)])],lines=[];for(let{heading,rels}of sections)if(rels.length!==0){lines.push(` ${heading}`);for(let rel of rels)lines.push(` ${rel}`);lines.push("")}if(backupRels.length>0){lines.push(` WOULD BACK UP ${backupRels.length} file(s) to ${BACKUP_DIR}/<timestamp>/ first`);for(let rel of backupRels)lines.push(` ${terminalSafe(rel,{max:300})}`);lines.push("")}let gitignore=gitignoreLines(r.gitignore,{preview:!0});gitignore!==null&&!gitignore.warn&&lines.push(` ${gitignore.text}`,"");let prettierignore=prettierignoreLines(r.prettierignore,{preview:!0});prettierignore!==null&&!prettierignore.warn&&lines.push(` ${prettierignore.text}`,"");let stateFiles=[...r.stateChanges.config?[CONFIG_FILENAME]:[],...r.stateChanges.records?[RECORDS_FILE]:[]];r.changesNothing?lines.push(" Nothing would be written.",""):changesNoFiles(r)&&lines.push(` Would rewrite only ${stateFiles.join(" and ")}.`,""),lines.push(` UNCHANGED ${r.counts.ok} file(s) \xB7 SKIPPED ${r.counts.skipped} file(s)`),channel!==channelOf(config)&&lines.push("",` Would record channel: ${channel}`),note(lines.join(`
8
8
  `),"PLAN"),gitignore?.warn&&log.warn(gitignore.text),prettierignore?.warn&&log.warn(prettierignore.text),reportCapabilityChanges(r.capabilityChanges,r.removals,!0),reportModels(r.models,r.modelsFloor,null,!0);let hookLines=hookWiringLines(r.hookWiring);hookLines&&note(hookLines.join(`
9
9
  `),"HOOKS"),reportAbsentSurfaces(r.absentUpstream),reportExecutableUnit(r.executableUnit,!0);let forceable=reportSkipped(r.skipped,!0);if(reportOrphans(r.orphans),reportLayoutWarnings(r.featuresReadmeRelocation,!0),r.versionWithheld?(log.warn(withheldVersionLine({skipped:r.counts.skipped,recordedVersion:r.recordedVersion,installedVersion:r.installedVersion,forceable,preview:!0})),r.pendingSkillsVersion!==null&&log.info(`Would record skills v${r.pendingSkillsVersion} as pending, so \`pharn add\` installs at it.`)):log.info(`Would record skills v${r.recordedVersion}.`),r.frozenCapabilities.length>0&&log.info(`Would keep unread upstream capabilities as they are: ${r.frozenCapabilities.join(", ")}.`),r.changesNothing){outro(`Dry run \u2014 ${noChangeVerdict(r)} Unchanged ${r.counts.ok} \xB7 skipped ${r.counts.skipped}. A real run would ask nothing and write nothing.`);return}outro(`Dry run \u2014 would write ${writes.length}${deletes.length>0?` \xB7 delete ${deletes.length} director${deletes.length===1?"y":"ies"}`:""} \xB7 back up ${backupRels.length} \xB7 unchanged ${r.counts.ok} \xB7 skipped ${r.counts.skipped}. Nothing was changed. Run \`pharn update${force?" --force":""}\` to apply.`)}function reportBackup(backup,opts){let output=opts.aborted?process.stderr:process.stdout;opts.aborted&&log.warn(`The update stopped part-way \u2014 some originals may already have been ${ABORTED_PHRASE[backup.action]}.`,{output}),printBackupNotice({dir:backup.dir,saved:backup.count,action:backup.action,gitignored:backup.gitignored},opts)}var ABORTED_PHRASE={overwriting:"overwritten",removing:"removed","overwriting and removing":"overwritten or removed"},CHANGE_ORDER=[{reason:"added",heading:"ADDED \u2014 newly selected for your archetypes"},{reason:"dropped-unselected",heading:"REMOVED \u2014 no longer selected for your archetypes"},{reason:"dropped-gone",heading:"REMOVED \u2014 no longer exists upstream (was a manual add)"},{reason:"kept-manual",heading:"KEPT \u2014 your manual add, not selected by your archetypes"},{reason:"kept-frozen",heading:"KEPT \u2014 pharn could not read these upstream this run, so they were left exactly as they are"}];function reportCapabilityChanges(changes,removals,preview){if(changes.length===0)return;let removalOf=new Map(removals.map(r=>[`${r.cap.role}:${r.cap.name}`,r])),lines=[];for(let{reason,heading}of CHANGE_ORDER){let inGroup=changes.filter(c=>c.reason===reason);if(inGroup.length!==0){lines.push(` ${heading}`);for(let{cap:cap2}of inGroup){let key2=`${cap2.role}:${cap2.name}`,removal=removalOf.get(key2);lines.push(removal===void 0?` ${key2}`:` ${key2} \u2014 ${removalPhrase(removal,preview)}`)}lines.push("")}}removals.length>0&&(lines.push(color_default.dim(preview?" Removed capabilities\u2019 directories would be deleted, so PHARN would no longer run them.":" Removed capabilities\u2019 directories are deleted, so PHARN no longer runs them.")),removals.some(r=>r.backups.length>0)&&lines.push(color_default.dim(preview?` Files in them pharn did not write would be copied to ${BACKUP_DIR}/ first.`:` Files in them pharn did not write were copied to ${BACKUP_DIR}/ first.`))),note(lines.join(`
10
10
  `),"CAPABILITIES")}function removalPhrase(removal,preview){if(!removal.present)return"already gone";let n=removal.backups.length,deleted=preview?"directory would be deleted":"directory deleted";return n===0?deleted:preview?`${deleted} (${n} file(s) would be backed up first)`:`${deleted} (${n} file(s) backed up first)`}function reportModels(models,floor,backup,preview=!1){let lines=modelsReportLines(models,backup,preview);lines.length!==0&&(models.next!==void 0&&lines.push("",...modelsLabelLines(floor).map(line=>color_default.dim(line))),note(lines.join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pharn-dev/pharn",
3
- "version": "0.21.3",
3
+ "version": "0.21.4",
4
4
  "description": "Install and update PHARN in any git project. PHARN gets features shipped right with Claude Code, with spec, plan and checks kept in Git.",
5
5
  "keywords": [
6
6
  "claude-code",