eser 4.1.35 → 4.1.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/chunks/approve-DNKMQSPX.js +2 -0
  2. package/chunks/block-GRKMCTGR.js +2 -0
  3. package/chunks/chunk-25FUVC3C.js +13 -0
  4. package/chunks/chunk-6FNHSIZJ.js +2 -0
  5. package/chunks/chunk-CBGABZ5E.js +2 -0
  6. package/chunks/{chunk-LOLA6ZSE.js → chunk-CZS6DCUY.js} +1 -1
  7. package/chunks/{chunk-FKITIXO2.js → chunk-LKF6GBNU.js} +1 -1
  8. package/chunks/{chunk-N4HITOTN.js → chunk-OCPEFZBJ.js} +1 -1
  9. package/chunks/{chunk-P74JF7XR.js → chunk-P2DMLPKI.js} +1 -1
  10. package/chunks/{chunk-UESOCN2G.js → chunk-STTKPXTW.js} +1 -1
  11. package/chunks/{chunk-XVSIRN6G.js → chunk-V3WALAAO.js} +1 -1
  12. package/chunks/{chunk-WG6J7DFO.js → chunk-VD5ZJBSR.js} +2 -2
  13. package/chunks/concern-T2NW35XI.js +2 -0
  14. package/chunks/done-RZD34AZF.js +2 -0
  15. package/chunks/init-J46SBNIS.js +2 -0
  16. package/chunks/invoke-hook-YTLAPETS.js +10 -0
  17. package/chunks/{mod-SDQ3QKKS.js → mod-GY6YJWVP.js} +1 -1
  18. package/chunks/next-HAAR572Z.js +4 -0
  19. package/chunks/{purge-XYNNHOEN.js → purge-7QJOGWHM.js} +1 -1
  20. package/chunks/{reset-EYLAZVKO.js → reset-WSJ47SUR.js} +1 -1
  21. package/chunks/rule-J4FRRKOE.js +3 -0
  22. package/chunks/run-K6PMBZEQ.js +4 -0
  23. package/chunks/spec-KTBVG2EX.js +2 -0
  24. package/chunks/status-3C2T6QAE.js +2 -0
  25. package/chunks/{sync-M7MKXMYN.js → sync-WLEELRJW.js} +1 -1
  26. package/chunks/{system-5HS7XXTF.js → system-GTHT75OL.js} +1 -1
  27. package/chunks/{watch-YKYNWTZF.js → watch-NEFCEWP5.js} +1 -1
  28. package/eser.js +1 -1
  29. package/package.json +1 -1
  30. package/chunks/approve-XNUZYGYJ.js +0 -2
  31. package/chunks/block-NWIP4USQ.js +0 -2
  32. package/chunks/chunk-4GQY3STW.js +0 -2
  33. package/chunks/chunk-E5QQGGNF.js +0 -2
  34. package/chunks/chunk-JAQN64PH.js +0 -13
  35. package/chunks/chunk-LNNNLUZT.js +0 -2
  36. package/chunks/concern-UCYEAXJ4.js +0 -2
  37. package/chunks/done-DIN56LXZ.js +0 -2
  38. package/chunks/init-2FLT3GXG.js +0 -2
  39. package/chunks/invoke-hook-PADL4W3J.js +0 -10
  40. package/chunks/next-ARUY5FHZ.js +0 -4
  41. package/chunks/rule-JMNIMEH3.js +0 -3
  42. package/chunks/run-TL4KPOGO.js +0 -4
  43. package/chunks/spec-3UGU4UBE.js +0 -2
  44. package/chunks/status-RCEYJVRQ.js +0 -2
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as y}from"./chunk-V3WALAAO.js";import{a as C,d as P}from"./chunk-P2DMLPKI.js";import"./chunk-IDMI5OBK.js";import{e as v}from"./chunk-STTKPXTW.js";import{c as n}from"./chunk-CBGABZ5E.js";import{d as w,e as h,j as S,n as g}from"./chunk-VD5ZJBSR.js";import"./chunk-JYNHFD6B.js";import{f as d,h as f,k as u}from"./chunk-GBM3TZFD.js";import{c as a,d as o,f as c,g as l,k as m}from"./chunk-3SXTMY75.js";import{a as p}from"./chunk-A6RDYP6R.js";import{t as i}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var $=async E=>{let r=d({renderer:u.ansi(),sink:f.stdout()}),s=i.process.cwd(),e=await w(s),R=await S(s);if(e.phase==="SPEC_DRAFT"){if(e.classification===null&&e.spec!==null){let A=(await g(s)).filter(D=>R?.concerns.includes(D.id)??!1);try{await y(s,e,A)}catch{}}let t=v(e);await h(s,t),t.spec!==null&&(await C(s,t.spec,"approved"),await P(s,t.spec,"approved")),r.writeln(l("\u2714")," Spec approved. Phase: ",m("SPEC_APPROVED")),r.writeln("When ready, run ",a(`${n('next --answer="start"')}`)," to begin execution.")}else e.phase==="DISCOVERY"&&e.discovery.completed?(r.writeln(o("Discovery complete. Spec draft already generated.")),r.writeln("Review the spec and run ",a(n("approve"))," again when in SPEC_DRAFT phase.")):r.writeln(c(`Cannot approve in phase: ${e.phase}`));return await r.close(),p(void 0)};export{$ as main};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{g as k}from"./chunk-STTKPXTW.js";import{c as h}from"./chunk-CBGABZ5E.js";import{d as w,e as f}from"./chunk-VD5ZJBSR.js";import"./chunk-JYNHFD6B.js";import{f as c,h as d,k as u}from"./chunk-GBM3TZFD.js";import{c as i,d as m,f as l,h as p}from"./chunk-3SXTMY75.js";import{a as o,b as n}from"./chunk-A6RDYP6R.js";import{t as a}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var N=async g=>{let e=c({renderer:u.ansi(),sink:d.stdout()}),t=a.process.cwd(),r=g?.join(" ")??"No reason given",s=await w(t);if(s.phase!=="EXECUTING")return e.writeln(l(`Cannot block in phase: ${s.phase}`)),await e.close(),n({exitCode:1});let b=k(s,r);return await f(t,b),e.writeln(p("\u26A0")," Spec blocked: ",m(r)),e.writeln("Resolve with: ",i(`${h('next --answer="resolution"')}`)),await e.close(),o(void 0)};export{N as main};
@@ -0,0 +1,13 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as d}from"./chunk-CBGABZ5E.js";import{c as h}from"./chunk-VD5ZJBSR.js";import{t as i}from"./chunk-MRCBHVSB.js";var m="<!-- noskills:start -->",u="<!-- noskills:end -->",v=(e,s,o="npx eser noskills")=>{let t=[m,"## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/rules/`, `.eser/specs/`, or concern files directly.","noskills gives you exactly what you need via JSON output.","","### Protocol","",` ${o} next # get current instruction`,` ${o} next --answer="your response" # submit result and advance`,"","### When to call noskills next","",`You MUST call \`${o} next\` in these situations:`,"","1. At the **START** of every conversation (first thing you do)","2. **BEFORE** creating or modifying any file (to verify you have an active task)","3. **AFTER** completing a logical unit of work (to report progress)","4. When you encounter a **DECISION** that affects architecture or scope","5. When you are **UNSURE** what to do next","","NEVER proceed with implementation without checking noskills first.","NEVER make architectural decisions independently \u2014 noskills routes them to the user."];if((s?.allowGit??!1)||t.push("","### Git is read-only","","You MUST NOT run git write commands: commit, add, push, checkout, stash,","reset, merge, rebase, cherry-pick. The user controls git. You control files.","You MAY read from git: log, diff, status, show, blame."),t.push("","### Convention discovery","","When you discover a pattern, receive a correction, or identify a recurring",'preference from the user, ask: "Should this be a permanent rule for this',`project, or just for this task?" If permanent, run: \`${o} rule add`,'"<description>"`. If just this task, note it and move on.',"Never write to `.eser/rules/` directly.","","### JSON output","","noskills returns JSON with a `phase` field and phase-specific instructions.","The `meta` block contains resume context - use it to orient yourself,","especially after compaction or at the start of a new session.","Follow the `instruction` field. Use `transition` commands to advance state."),e.length>0){t.push("","### Active Rules","");for(let n of e)t.push(`- ${n}`)}return t.push(u),t.join(`
3
+ `)},p=async(e,s,o,t="npx eser noskills")=>{let n=`${e}/CLAUDE.md`,a=v(s,o,t),r;try{r=await i.fs.readTextFile(n);let c=r.indexOf(m),l=r.indexOf(u);c!==-1&&l!==-1?r=r.slice(0,c)+a+r.slice(l+u.length):r=r.trimEnd()+`
4
+
5
+ `+a+`
6
+ `}catch{r=a+`
7
+ `}await i.fs.writeTextFile(n,r)};var f=async(e,s,o="npx eser noskills")=>{let t=["# Generated by noskills \u2014 do not edit manually","","## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/specs/` or `.eser/rules/` directly. noskills gives you what you need.","",`Run \`${o} next\` to get your current instruction.`,`Submit results with \`${o} next --answer="..."\``,"","## When to call noskills next","","1. At the START of every conversation","2. BEFORE creating or modifying any file","3. AFTER completing a logical unit of work","4. When you encounter a DECISION that affects architecture","5. When you are UNSURE what to do next","","NEVER proceed with implementation without checking noskills first.",""];if(s.length>0){t.push("## Rules","");for(let n of s)t.push(`- ${n}`);t.push("")}await i.fs.writeTextFile(`${e}/.cursorrules`,t.join(`
8
+ `))};var y=async(e,s,o="npx eser noskills")=>{let t=["# Generated by noskills \u2014 do not edit manually","","## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/specs/` or `.eser/rules/` directly. noskills gives you what you need.","",`Run \`${o} next\` to get your current instruction.`,`Submit results with \`${o} next --answer="..."\``,"","## When to call noskills next","","1. At the START of every conversation","2. BEFORE creating or modifying any file","3. AFTER completing a logical unit of work","4. When you encounter a DECISION that affects architecture","5. When you are UNSURE what to do next","","NEVER proceed with implementation without checking noskills first.",""];if(s.length>0){t.push("## Rules","");for(let n of s)t.push(`- ${n}`);t.push("")}await i.fs.mkdir(`${e}/.kiro/steering`,{recursive:!0}),await i.fs.writeTextFile(`${e}/.kiro/steering/conventions.md`,t.join(`
9
+ `))};var k=async(e,s,o="npx eser noskills")=>{let t=["# Generated by noskills \u2014 do not edit manually","","## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/specs/` or `.eser/rules/` directly. noskills gives you what you need.","",`Run \`${o} next\` to get your current instruction.`,`Submit results with \`${o} next --answer="..."\``,"","## When to call noskills next","","1. At the START of every conversation","2. BEFORE creating or modifying any file","3. AFTER completing a logical unit of work","4. When you encounter a DECISION that affects architecture","5. When you are UNSURE what to do next","","NEVER proceed with implementation without checking noskills first.",""];if(s.length>0){t.push("## Rules","");for(let n of s)t.push(`- ${n}`);t.push("")}await i.fs.mkdir(`${e}/.github`,{recursive:!0}),await i.fs.writeTextFile(`${e}/.github/copilot-instructions.md`,t.join(`
10
+ `))};var g=async(e,s,o="npx eser noskills")=>{let t=["# Generated by noskills \u2014 do not edit manually","","## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/specs/` or `.eser/rules/` directly. noskills gives you what you need.","",`Run \`${o} next\` to get your current instruction.`,`Submit results with \`${o} next --answer="..."\``,"","## When to call noskills next","","1. At the START of every conversation","2. BEFORE creating or modifying any file","3. AFTER completing a logical unit of work","4. When you encounter a DECISION that affects architecture","5. When you are UNSURE what to do next","","NEVER proceed with implementation without checking noskills first.",""];if(s.length>0){t.push("## Rules","");for(let n of s)t.push(`- ${n}`);t.push("")}await i.fs.writeTextFile(`${e}/.windsurfrules`,t.join(`
11
+ `))};var N=e=>({hooks:{PreToolUse:[{matcher:"Write|Edit|MultiEdit|Bash",hooks:[{type:"command",command:`${e} invoke-hook pre-tool-use`,timeout:5}]}],PostToolUse:[{matcher:"Write|Edit|MultiEdit",hooks:[{type:"command",command:`${e} invoke-hook post-file-write`,timeout:3}]},{matcher:"Bash",hooks:[{type:"command",command:`${e} invoke-hook post-bash`,timeout:3}]}],Stop:[{hooks:[{type:"command",command:`${e} invoke-hook stop`,timeout:10}]}],SessionStart:[{hooks:[{type:"command",command:`${e} invoke-hook session-start`,timeout:5}]}]}}),w=async(e,s="npx eser@latest noskills")=>{let o=`${e}/.claude/settings.json`,t={};try{let r=await i.fs.readTextFile(o);t=JSON.parse(r)}catch{}let n=N(s),a={...t,...n};await i.fs.mkdir(`${e}/.claude`,{recursive:!0}),await i.fs.writeTextFile(o,JSON.stringify(a,null,2)+`
12
+ `)};var O=async e=>{let s=`${e}/${h.rulesDir}`,o=[];try{for await(let t of i.fs.readDir(s))if(t.isFile&&(t.name.endsWith(".md")||t.name.endsWith(".txt"))){let n=await i.fs.readTextFile(`${s}/${t.name}`),a=n.trim().split(`
13
+ `)[0]??n.trim();o.push(a)}}catch{}return o},A={cursor:f,kiro:y,copilot:k,windsurf:g},B=async(e,s,o)=>{let t=await O(e),n=[],a={allowGit:o?.allowGit??!1},r=await d();for(let c of s){if(c==="claude-code"){await p(e,t,a,r),n.push(c);continue}let l=A[c];l!==void 0&&(await l(e,t,r),n.push(c))}return s.includes("claude-code")&&(await w(e,r),n.push("hooks")),n};export{O as a,B as b};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as D,c as S,d as k,e as P}from"./chunk-OCPEFZBJ.js";import{c as O}from"./chunk-CBGABZ5E.js";var R=[{id:"status_quo",text:"What does the user do today without this feature?",concerns:["product:status_quo","eng:replace_scope","qa:regression_risk"]},{id:"ambition",text:"Describe the 1-star and 10-star versions.",concerns:["product:scope_direction","eng:complexity_tier","qa:test_depth"]},{id:"reversibility",text:"Does this change involve an irreversible decision?",concerns:["product:one_way_door","eng:migration_strategy","qa:verification_stringency"]},{id:"user_impact",text:"Does this change affect existing users' behavior?",concerns:["product:breaking_change","eng:backward_compat","qa:regression_tests"]},{id:"verification",text:"How do you verify this works correctly?",concerns:["product:success_metric","eng:test_strategy","qa:acceptance_criteria"]},{id:"scope_boundary",text:"What should this feature NOT do?",concerns:["product:focus","eng:out_of_scope","qa:negative_tests"]}],I=e=>R.map(n=>({...n,extras:S(e,n.id)})),K=(e,n)=>{let o=new Set(n.map(s=>s.questionId));for(let s of e)if(!o.has(s.id))return s;return null},A=e=>{let n=new Set(e.map(o=>o.questionId));return R.every(o=>n.has(o.id))};var t=e=>O(e),B="NEVER run git write commands (commit, add, push, checkout, stash, reset, merge, rebase, cherry-pick). Git is read-only for agents. The user controls git. You may read: git log, git diff, git status, git show, git blame.",F=(e,n,o,s)=>{let l=e.execution.iteration>=n,i=o?[]:[B],d=s?.outOfScope??[];switch(e.phase){case"IDLE":return{rules:[...i,"When interactiveOptions are present, use AskUserQuestion to present them. Map each option's label and description fields directly to the tool's options array. When the user picks one, run the corresponding command.","For availableConcerns: AskUserQuestion only supports 4 options per question. Use multiSelect and split concerns across two AskUserQuestion calls if needed (e.g., first 3 + last 3), or list all 6 as text and ask which to add. Never silently drop concerns.","Do not take action without the user choosing an option first."],tone:"Welcoming. Present choices, then wait."};case"DISCOVERY":return{rules:[...i,"Present questions to the user ONE AT A TIME. Show concern sub-questions as additional context for each.","Push back on shallow answers. If the user says something vague like 'a CLI project' or 'manual workarounds', probe deeper: 'What specific problem? Who needs this? How often?' \u2014 like a good PM in sprint planning.","A one-sentence answer is almost always too shallow. Ask one follow-up to deepen it before accepting.","Once you have a substantive answer for each question, collect all answers and submit them together in a single `noskills next --answer` call as a JSON object.","Do not start coding or exploring the codebase. Discovery is conversation only."],tone:"Curious interviewer who has a stake in the answers. Push for specifics, don't accept handwaving."};case"SPEC_DRAFT":return{rules:[...i,"Present the spec to the user for review. Do not modify it.","If the user requests changes, relay them \u2014 do not implement them.","Do not start coding. The spec must be approved first."],tone:"Brief. The user is reviewing, not discussing."};case"SPEC_APPROVED":return{rules:[...i,"The spec is approved but execution has not started.","Do not start coding until the user triggers execution.","If the user wants changes, they must reset and re-spec."],tone:"Patient. Wait for the go signal."};case"EXECUTING":{let a=[...i,"Do not explore the codebase beyond what the current task requires.","Do not refactor, improve, or modify code outside this task's scope.","Do not add features, tests, or documentation not specified in the spec.","If you need to read files to understand context, timebox it \u2014 then write code.","The deliverable is working code, not a plan or analysis.","Complete the task, then report progress. The user handles git.",`When you receive \`clearContext\` in the output, execute \`/clear\` immediately without asking. After clearing, read \`CLAUDE.md\` and run \`${t("next")}\`.`,`When you discover a pattern, receive a correction, or identify a recurring preference from the user, ask: 'Should this be a permanent rule for this project, or just for this task?' If permanent, run: \`${t('rule add "<description>"')}\`. If just this task, note it and move on. Never write to \`.eser/rules/\` directly.`];e.execution.lastVerification?.passed===!1&&a.push("Tests are failing. Fix ONLY the failing tests. Do not refactor passing code.");let r={rules:a,tone:"Direct. No preamble. Start coding immediately.",outOfScope:d.length>0?d:void 0};return l?{...r,urgency:`You have been in this session for ${e.execution.iteration}+ iterations. Your context is degrading. Finish the current task and recommend the user start a fresh session. Do not start new tasks.`}:r}case"BLOCKED":return{rules:[...i,"Present the decision to the user exactly as described.","Do not suggest a preferred option unless the user asks for your opinion.","After the user decides, relay the answer immediately. Do not elaborate."],tone:"Brief. The user is making a decision, not having a discussion."};case"DONE":return{rules:[...i,"Report the completion summary. Do not start new work.","If the user wants to continue, they start a new spec."],tone:"Concise. Celebrate briefly, then stop."};default:return{rules:[...i,`Run \`${t("next")}\` to get your instructions.`,"Do not take action without noskills guidance."],tone:"Neutral. Waiting for direction."}}},q=5*60*1e3,U=(e,n)=>{let o;switch(e.phase){case"IDLE":o=`No active spec. Start one with: \`${t("spec new")}\``;break;case"DISCOVERY":o=`Discovery in progress for "${e.spec}". ${e.discovery.answers.length} questions answered so far.`;break;case"SPEC_DRAFT":o=`Spec draft ready for review at ${e.specState.path}. Waiting for approval.`;break;case"SPEC_APPROVED":o=`Spec "${e.spec}" is approved. Waiting to start execution.`;break;case"EXECUTING":o=e.execution.lastProgress!==null?`Executing "${e.spec}", iteration ${e.execution.iteration}. Last progress: ${e.execution.lastProgress}. Continue with the current task.`:`Executing "${e.spec}", iteration ${e.execution.iteration}. Start the first task.`;break;case"BLOCKED":o=`Execution blocked: ${e.execution.lastProgress}. Ask the user to resolve.`;break;case"DONE":o=`Spec "${e.spec}" completed in ${e.execution.iteration} iterations.`;break;default:o=`Run \`${t("next")}\` to get started.`}return{protocol:`Run \`${t('next --answer="..."')}\` to submit results and advance`,spec:e.spec,branch:e.branch,iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,activeConcerns:n.map(s=>s.id),resumeHint:o}},L=e=>{if(e.lastCalledAt===null)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE",how:`Run \`${t("next")}\` for instructions. Submit results with \`${t('next --answer="..."')}\`. Never make architectural decisions without asking.`,currentPhase:e.phase};let n=new Date(e.lastCalledAt).getTime();if(Date.now()-n>q)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE",how:`Run \`${t("next")}\` for instructions. Submit results with \`${t('next --answer="..."')}\`. Never make architectural decisions without asking.`,currentPhase:e.phase}},Z=(e,n,o,s,l,i)=>{let d=U(e,n),a=s?.maxIterationsBeforeRestart??15,r=s?.allowGit??!1,h=F(e,a,r,l),x=L(e),u;switch(e.phase){case"IDLE":u=T(n,D);break;case"DISCOVERY":u=W(e,n,o);break;case"SPEC_DRAFT":u=G(e);break;case"SPEC_APPROVED":u=j(e);break;case"EXECUTING":u=M(e,n,o,a,l,i);break;case"BLOCKED":u=X(e);break;case"DONE":u=H(e);break;default:u=T(n,D)}let m={...u,meta:d,behavioral:h};x!==void 0&&(m={...m,protocolGuide:x}),e.pendingClear&&(m={...m,clearContext:{action:"clear_context",reason:`Task complete. Run \`/clear\` now. After clearing, read \`CLAUDE.md\` and run \`${t("next")}\` to continue.`},instruction:`Task accepted. Run \`/clear\` immediately to start fresh for the next task. After clearing, run \`${t("next")}\`.`});let y=V(e,n);return y.length>0&&(m={...m,interactiveOptions:y}),m},V=(e,n)=>{switch(e.phase){case"IDLE":return n.length===0?[{label:"Add concerns (Recommended)",description:"Shape how discovery and specs work by adding project concerns",command:t("concern add <id>")},{label:"Start a feature spec",description:"Begin discovery questions for a new feature",command:t('spec new "description"')},{label:"Add a coding rule",description:"Add a permanent coding convention for this project",command:t('rule add "rule"')},{label:"Check status",description:"Show current phase, spec, and progress",command:t("status")}]:[{label:"Start a feature spec",description:"Begin discovery questions for a new feature",command:t('spec new "description"')},{label:"Add more concerns",description:"Add additional project concerns",command:t("concern add <id>")},{label:"Add a coding rule",description:"Add a permanent coding convention for this project",command:t('rule add "rule"')},{label:"Check status",description:"Show current phase, spec, and progress",command:t("status")}];case"SPEC_DRAFT":return[{label:"Approve spec",description:"Review looks good \u2014 approve and move to execution",command:t("approve")},{label:"Start over",description:"Reset the spec and start fresh",command:t("reset")}];case"SPEC_APPROVED":return[{label:"Start execution",description:"Begin working through the spec tasks",command:t('next --answer="start"')},{label:"Reset",description:"Discard this spec and start over",command:t("reset")}];case"EXECUTING":return[];case"BLOCKED":return[{label:"Resolve block",description:"Provide a resolution to unblock execution",command:t('next --answer="resolution"')},{label:"Reset spec",description:"Abandon this spec and start over",command:t("reset")}];case"DONE":return[{label:"New spec",description:"Start a new feature spec",command:t('spec new "description"')},{label:"Check status",description:"Review completed spec summary",command:t("status")}];default:return[]}},T=(e,n)=>({phase:"IDLE",instruction:"Present the interactive options to the user using your interactive question tool. Do NOT list them as a text table.",availableConcerns:n.map(o=>({id:o.id,description:o.description})),activeConcerns:e.map(o=>o.id),hint:e.length===0?"No concerns active. Consider adding concerns first \u2014 they shape discovery questions and specs.":void 0}),W=(e,n,o)=>{let s=I(n),l=e.discovery.answers.length;if(A(e.discovery.answers))return{phase:"DISCOVERY",instruction:`All discovery questions answered. Run: \`${t("approve")}\``,questions:[],answeredCount:l,context:{rules:o,concernReminders:[]},transition:{onComplete:t("approve")}};let d=new Set(e.discovery.answers.map(r=>r.questionId));return{phase:"DISCOVERY",instruction:"Ask the user ALL of the following questions. Collect answers for each, then submit them all at once as a JSON object.",questions:s.filter(r=>!d.has(r.id)).map(r=>({id:r.id,text:r.text,concerns:[...r.concerns],extras:r.extras.map(h=>h.text)})),answeredCount:l,context:{rules:o,concernReminders:k(n)},transition:{onComplete:`${t(`next --answer='{"status_quo":"...","ambition":"...",...}'`)}`}}},G=e=>e.classification===null?{phase:"SPEC_DRAFT",instruction:"Before generating the spec, classify what this spec involves. Ask the user to select all that apply.",specPath:e.specState.path??"",transition:{onApprove:`${t(`next --answer='{"involvesUI":false,"involvesPublicAPI":false,"involvesMigration":false,"involvesDataHandling":false}'`)}`},classificationRequired:!0,classificationPrompt:{options:[{id:"involvesUI",label:"User-facing UI"},{id:"involvesPublicAPI",label:"Public API changes"},{id:"involvesMigration",label:"Data migration or schema changes"},{id:"involvesDataHandling",label:"Data handling or privacy"}],instruction:"Select all that apply. Submit as JSON: `"+t(`next --answer='{"involvesUI":true,"involvesPublicAPI":false,...}'`)+"`"}}:{phase:"SPEC_DRAFT",instruction:"Spec draft is ready for review. Ask the user to review and approve.",specPath:e.specState.path??"",transition:{onApprove:t("approve")}},j=e=>({phase:"SPEC_APPROVED",instruction:"Spec is approved and ready. When the user is ready to start, begin execution.",specPath:e.specState.path??"",transition:{onStart:`${t('next --answer="start"')}`}}),Q=(e,n)=>{if(n===null)return!1;switch(e){case"beautiful-product":return n.involvesUI;case"open-source":return n.involvesPublicAPI;case"long-lived":return n.involvesMigration;case"compliance":return n.involvesDataHandling;default:return!0}},Y=(e,n,o,s,l,i,d)=>{let a=[];if(s!==null)for(let r of s.items)a.push(`[DEBT from iteration ${s.fromIteration}] ${r}`);if(n&&a.push(`[FAILED] Tests \u2014 fix this first: ${o.slice(0,200)}`),i!=null)for(let r of i.verification)a.push(r);for(let r of e)if(Q(r.id,l)&&r.acceptanceCriteria!==void 0&&r.acceptanceCriteria.length>0)for(let h of r.acceptanceCriteria)a.push(`(${r.id}) ${h}`);if(d!==void 0)for(let r of d)a.push(`(folder: ${r.folder}) ${r.rule}`);return a},M=(e,n,o,s,l,i)=>{let d=P(n),a=e.execution.iteration>=s,r=e.execution.lastVerification?.passed===!1,h=e.execution.lastVerification?.output??"",x=l?.tasks??[],u=e.execution.completedTasks??[],m=new Set(u),y=x.find(p=>!m.has(p.id))??null,g=y!==null?{id:y.id,title:y.title,totalTasks:x.length,completedTasks:u.length}:void 0;if(e.execution.awaitingStatusReport){let p=Y(n,r,h,e.execution.debt,e.classification,l,i),b={phase:"EXECUTING",instruction:"Before this task is accepted, report your completion status against these acceptance criteria.",context:{rules:o,concernReminders:k(n)},transition:{onComplete:`${t(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`)}`,onBlocked:`${t('block "reason"')}`,iteration:e.execution.iteration},statusReportRequired:!0,statusReport:{criteria:p,reportFormat:{completed:"list items you finished with evidence (file exists, test passes)",remaining:"list items not yet done",blocked:"list items that need a decision from the user"}}};return r&&(b={...b,verificationFailed:!0,verificationOutput:h.slice(0,2e3)}),b}let E=(e.execution.lastProgress??"").includes("Task not accepted"),v=e.execution.debt?.items??[],C=e.execution.debt?.unaddressedIterations??0,$=g!==void 0?`Execute task ${g.id}: ${g.title} (${g.completedTasks}/${g.totalTasks} completed)`:"All tasks completed. Run `"+t("done")+"` to finish.",w;if(r)w="Verification FAILED. Fix the failing tests before continuing.";else if(E&&v.length>0){let p=C>=3?` These items have been outstanding for ${C} iterations.`:"";w=`Task not accepted \u2014 ${v.length} remaining item(s) must be addressed before this task can be completed.${p} Address them, then submit a new status report.`}else w=$;let c={phase:"EXECUTING",instruction:w,task:g,context:{rules:o,concernReminders:k(n)},transition:{onComplete:`${t('next --answer="..."')}`,onBlocked:`${t('block "reason"')}`,iteration:e.execution.iteration}};if(E&&v.length>0&&(c={...c,taskRejected:!0,rejectionReason:`${v.length} remaining item(s) must be addressed.`,rejectionRemaining:v}),e.execution.debt!==null&&e.execution.debt.items.length>0){let p=e.execution.debt.unaddressedIterations??0,b=p>=3?`URGENT: These items have been unaddressed for ${p} iterations. Address them IMMEDIATELY before any new work.`:"These were not completed in a previous iteration. Address them BEFORE starting new work.";c={...c,previousIterationDebt:{fromIteration:e.execution.debt.fromIteration,items:e.execution.debt.items,note:b}}}if(r){let p=h.slice(0,2e3);c={...c,verificationFailed:!0,verificationOutput:p}}d.length>0&&(c={...c,concernTensions:d}),a&&(c={...c,restartRecommended:!0,restartInstruction:`Context may be getting large after ${e.execution.iteration} iterations. Consider starting a new conversation and running \`${t("next")}\` to resume - your progress is saved.`});let f=[...e.decisions].reverse().find(p=>!p.promoted);return f!==void 0&&e.execution.lastProgress?.startsWith("Resolved:")&&(c={...c,promotePrompt:{decisionId:f.id,question:f.question,choice:f.choice,prompt:`You just resolved a decision: "${f.choice}". Ask the user: "Should this be a permanent rule for future specs too?" If yes, run: \`${t(`rule add "${f.choice}"`)}\``}}),c},X=e=>({phase:"BLOCKED",instruction:"A decision is needed. Ask the user.",reason:e.execution.lastProgress??"Unknown",transition:{onResolved:`${t('next --answer="..."')}`}}),H=e=>({phase:"DONE",summary:{spec:e.spec,iterations:e.execution.iteration,decisionsCount:e.decisions.length}});export{R as a,I as b,K as c,A as d,Z as e};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{r as s,t as r}from"./chunk-MRCBHVSB.js";var c="npx eser@latest noskills",o={command:"eser",devCommand:"deno task cli",npmPackage:"eser@latest",jsrPackage:"@eser/cli"},e=null,l=async()=>{if(e!==null)return e;try{e=`${(await s(o)).command} noskills`}catch{try{let t=r.process.args;for(let n=0;n<t.length;n++)if(t[n]==="noskills"||t[n]==="nos"){e=t.slice(0,n+1).join(" ");break}}catch{}}return e??=c,e},i=()=>e??c,m=t=>`${i()} ${t}`;export{l as a,i as b,m as c};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as _,b as H,c as P}from"./chunk-5GGGQJ4P.js";import{e as Q}from"./chunk-J2Z7NG2X.js";import{f as p,h as u,k as c}from"./chunk-GBM3TZFD.js";import{b as r,d as l,f as m,g,h as Y,k as o}from"./chunk-3SXTMY75.js";import{d as x}from"./chunk-PVPMHMKP.js";import{a as v}from"./chunk-FKITIXO2.js";import{a as h,b as w}from"./chunk-A6RDYP6R.js";import{a as re,g as W,h as K,i as B,r as I,t as d}from"./chunk-MRCBHVSB.js";var oe="# eser CLI completions",D="eser",X=async e=>{try{return await d.fs.readTextFile(e)}catch{return""}},ie=async e=>{try{return await d.fs.stat(e),!0}catch{return!1}},Z=async e=>{let t=P(e,D);if(t.completionType==="file")return await ie(t.completionsFile);let s=await X(t.rcFile),n=H(e,D);return s.includes(n)},ee=async e=>{let t=P(e,D),s=p({renderer:c.ansi(),sink:u.stdout()});try{if(t.completionType==="file"){let n=t.completionsFile,a=d.path.dirname(n);try{await d.fs.mkdir(a,{recursive:!0})}catch{}await d.fs.writeTextFile(n,`# eser CLI completions
2
+ import{a as _,b as H,c as P}from"./chunk-5GGGQJ4P.js";import{e as Q}from"./chunk-J2Z7NG2X.js";import{f as p,h as u,k as c}from"./chunk-GBM3TZFD.js";import{b as r,d as l,f as m,g,h as Y,k as o}from"./chunk-3SXTMY75.js";import{d as x}from"./chunk-PVPMHMKP.js";import{a as v}from"./chunk-LKF6GBNU.js";import{a as h,b as w}from"./chunk-A6RDYP6R.js";import{a as re,g as W,h as K,i as B,r as I,t as d}from"./chunk-MRCBHVSB.js";var oe="# eser CLI completions",D="eser",X=async e=>{try{return await d.fs.readTextFile(e)}catch{return""}},ie=async e=>{try{return await d.fs.stat(e),!0}catch{return!1}},Z=async e=>{let t=P(e,D);if(t.completionType==="file")return await ie(t.completionsFile);let s=await X(t.rcFile),n=H(e,D);return s.includes(n)},ee=async e=>{let t=P(e,D),s=p({renderer:c.ansi(),sink:u.stdout()});try{if(t.completionType==="file"){let n=t.completionsFile,a=d.path.dirname(n);try{await d.fs.mkdir(a,{recursive:!0})}catch{}await d.fs.writeTextFile(n,`# eser CLI completions
3
3
  # This file is auto-generated. Run 'eser system completions --shell fish' to regenerate.
4
4
  complete -c eser -f
5
5
  complete -c eser -n "__fish_use_subcommand" -a "codebase" -d "Codebase management tools"
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- var r={name:"@eser/cli",version:"4.1.35",type:"module",exports:"./main.ts",bin:{eser:"./bin.ts"},dependencies:{"@eser/ai":"workspace:*","@eser/codebase":"workspace:*","@eser/kit":"workspace:*","@eser/noskills":"workspace:*","@eser/laroux-server":"workspace:*","@eser/workflows":"workspace:*","@eser/functions":"workspace:*","@eser/logging":"workspace:*","@eser/shell":"workspace:*","@eser/standards":"workspace:*","@std/cli":"npm:@jsr/std__cli@^1.0.25","@std/fmt":"npm:@jsr/std__fmt@^1.0.8"},devDependencies:{"@std/assert":"npm:@jsr/std__assert@^1.0.16",esbuild:"^0.27.3"}};export{r as a};
2
+ var r={name:"@eser/cli",version:"4.1.37",type:"module",exports:"./main.ts",bin:{eser:"./bin.ts"},dependencies:{"@eser/ai":"workspace:*","@eser/codebase":"workspace:*","@eser/kit":"workspace:*","@eser/noskills":"workspace:*","@eser/laroux-server":"workspace:*","@eser/workflows":"workspace:*","@eser/functions":"workspace:*","@eser/logging":"workspace:*","@eser/shell":"workspace:*","@eser/standards":"workspace:*","@std/cli":"npm:@jsr/std__cli@^1.0.25","@std/fmt":"npm:@jsr/std__fmt@^1.0.8"},devDependencies:{"@std/assert":"npm:@jsr/std__assert@^1.0.16",esbuild:"^0.27.3"}};export{r as a};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- var s={id:"open-source",name:"Open Source",description:"Community-driven, inclusive, well-documented. Prioritize contributor experience, avoid exclusionary patterns, default to permissive choices.",extras:[{questionId:"status_quo",text:"Is this workaround common in the community?"},{questionId:"user_impact",text:"Does this make contribution harder?"}],specSections:["Contributor Guide","Public API Surface"],reminders:["Endpoint should be documented in API docs","Consider contributor experience for new patterns","Default to permissive, well-documented choices"],acceptanceCriteria:["Public API documented","Changes reflected in README or API docs","No exclusionary patterns introduced"]};var r={id:"beautiful-product",name:"Beautiful Product",description:"Design and UX are first-class. Agent critiques UI/UX like a passionate designer. Empty states, error states, loading states, mobile layout \u2014 nothing ships unspecified.",extras:[{questionId:"status_quo",text:"How painful is the current experience?"},{questionId:"ambition",text:"In the 10-star version, what does the user feel?"}],specSections:["Design States (empty, loading, error, success)","Mobile Layout","Interaction Design"],reminders:["Loading state and error state must be designed, not placeholder","No AI slop \u2014 every UI element is intentional","Empty states need clear CTAs with examples"],acceptanceCriteria:["All UI states designed (empty, loading, error, success)","Mobile layout considered","No placeholder or skeleton UI left unfinished"]};var a={id:"long-lived",name:"Long-Lived",description:"Built to last. Stability, maintainability, and backward compatibility matter. Every shortcut needs justification. Favor boring technology.",extras:[{questionId:"reversibility",text:"Will this decision still be correct in 2 years?"},{questionId:"scope_boundary",text:"What technical debt would this introduce?"}],specSections:["Migration & Deprecation","Backward Compatibility"],reminders:["Favor boring technology over shiny new tools","Every shortcut needs explicit justification","Consider maintenance burden for new dependencies"],acceptanceCriteria:["Backward compatibility preserved","Migration path documented if breaking","No unnecessary new dependencies"]};var c={id:"move-fast",name:"Move Fast",description:"Optimize for shipping speed. Acceptable trade-offs on polish. Good enough is good enough. Reduce ceremony.",extras:[{questionId:"scope_boundary",text:"Which polish items can be deferred to v2?"},{questionId:"ambition",text:"What is the minimum viable 5-star version?"}],specSections:["v1 vs v2 Scope"],reminders:["Good enough is good enough \u2014 ship it","Reduce ceremony, optimize for feedback speed","Mark polish items for v2 explicitly"],acceptanceCriteria:["Core functionality works","v2 items explicitly deferred"]};var d={id:"compliance",name:"Compliance",description:"Audit trails, access controls, data handling rules. Every change is traceable. Verification is mandatory, not optional.",extras:[{questionId:"reversibility",text:"Is the audit trail preserved on rollback?"},{questionId:"verification",text:"Is there an audit/traceability requirement?"}],specSections:["Audit Trail","Access Control","Data Handling"],reminders:["Every state change must be traceable","Verification is mandatory, not optional","Document data handling and retention policies"],acceptanceCriteria:["Audit trail added for state changes","Access control verified","Data handling documented"]};var l={id:"learning-project",name:"Learning Project",description:"Experimentation is the goal. Encourage trying new patterns, don't punish dead ends. Document learnings over polish.",extras:[{questionId:"ambition",text:"What do you want to learn from building this?"},{questionId:"scope_boundary",text:"What experiments are explicitly allowed?"}],specSections:["Learning Goals","Experiment Log"],reminders:["Document learnings, not just outcomes","Dead ends are acceptable \u2014 document why","Try new patterns freely, polish later"],acceptanceCriteria:["Learnings documented","Experiment outcomes recorded"]};var u=[s,r,a,c,d,l];var N=()=>Promise.resolve(u),U=(t,n)=>{let e=[];for(let i of t)for(let o of i.extras)o.questionId===n&&e.push(o);return e},F=t=>{let n=[];for(let e of t)for(let i of e.reminders)n.push(`${e.id}: ${i}`);return n},_=t=>{let n=[],e=t.map(i=>i.id);return e.includes("move-fast")&&e.includes("compliance")&&n.push({between:["move-fast","compliance"],issue:"Speed vs traceability \u2014 shortcuts may violate audit requirements."}),e.includes("move-fast")&&e.includes("long-lived")&&n.push({between:["move-fast","long-lived"],issue:"Shipping speed vs maintainability \u2014 tech debt decisions need human approval."}),e.includes("beautiful-product")&&e.includes("move-fast")&&n.push({between:["beautiful-product","move-fast"],issue:"Design polish vs speed \u2014 which UI states can be deferred?"}),n};export{N as a,U as b,F as c,_ as d};
2
+ var s={id:"open-source",name:"Open Source",description:"Community-driven, inclusive, well-documented. Prioritize contributor experience, avoid exclusionary patterns, default to permissive choices.",extras:[{questionId:"status_quo",text:"Is this workaround common in the community?"},{questionId:"user_impact",text:"Does this make contribution harder?"}],specSections:["Contributor Guide","Public API Surface"],reminders:["Endpoint should be documented in API docs","Consider contributor experience for new patterns","Default to permissive, well-documented choices"],acceptanceCriteria:["Public API documented","Changes reflected in README or API docs","No exclusionary patterns introduced"]};var r={id:"beautiful-product",name:"Beautiful Product",description:"Design and UX are first-class. Agent critiques UI/UX like a passionate designer. Empty states, error states, loading states, mobile layout \u2014 nothing ships unspecified.",extras:[{questionId:"status_quo",text:"How painful is the current experience?"},{questionId:"ambition",text:"In the 10-star version, what does the user feel?"}],specSections:["Design States (empty, loading, error, success)","Mobile Layout","Interaction Design"],reminders:["Loading state and error state must be designed, not placeholder","No AI slop \u2014 every UI element is intentional","Empty states need clear CTAs with examples"],acceptanceCriteria:["All UI states designed (empty, loading, error, success)","Mobile layout considered","No placeholder or skeleton UI left unfinished"]};var a={id:"long-lived",name:"Long-Lived",description:"Built to last. Stability, maintainability, and backward compatibility matter. Every shortcut needs justification. Favor boring technology.",extras:[{questionId:"reversibility",text:"Will this decision still be correct in 2 years?"},{questionId:"scope_boundary",text:"What technical debt would this introduce?"}],specSections:["Migration & Deprecation","Backward Compatibility"],reminders:["Favor boring technology over shiny new tools","Every shortcut needs explicit justification","Consider maintenance burden for new dependencies"],acceptanceCriteria:["Backward compatibility preserved","Migration path documented if breaking","No unnecessary new dependencies"]};var c={id:"move-fast",name:"Move Fast",description:"Optimize for shipping speed. Acceptable trade-offs on polish. Good enough is good enough. Reduce ceremony.",extras:[{questionId:"scope_boundary",text:"Which polish items can be deferred to v2?"},{questionId:"ambition",text:"What is the minimum viable 5-star version?"}],specSections:["v1 vs v2 Scope"],reminders:["Good enough is good enough \u2014 ship it","Reduce ceremony, optimize for feedback speed","Mark polish items for v2 explicitly"],acceptanceCriteria:["Core functionality works","v2 items explicitly deferred"]};var d={id:"compliance",name:"Compliance",description:"Audit trails, access controls, data handling rules. Every change is traceable. Verification is mandatory, not optional.",extras:[{questionId:"reversibility",text:"Is the audit trail preserved on rollback?"},{questionId:"verification",text:"Is there an audit/traceability requirement?"}],specSections:["Audit Trail","Access Control","Data Handling"],reminders:["Every state change must be traceable","Verification is mandatory, not optional","Document data handling and retention policies"],acceptanceCriteria:["Audit trail added for state changes","Access control verified","Data handling documented"]};var l={id:"learning-project",name:"Learning Project",description:"Experimentation is the goal. Encourage trying new patterns, don't punish dead ends. Document learnings over polish.",extras:[{questionId:"ambition",text:"What do you want to learn from building this?"},{questionId:"scope_boundary",text:"What experiments are explicitly allowed?"}],specSections:["Learning Goals","Experiment Log"],reminders:["Document learnings, not just outcomes","Dead ends are acceptable \u2014 document why","Try new patterns freely, polish later"],acceptanceCriteria:["Learnings documented","Experiment outcomes recorded"]};var u=[s,r,a,c,d,l];var N=()=>Promise.resolve(u),U=(t,n)=>{let e=[];for(let i of t)for(let o of i.extras)o.questionId===n&&e.push(o);return e},F=t=>{let n=[];for(let e of t)for(let i of e.reminders)n.push(`${e.id}: ${i}`);return n},_=t=>{let n=[],e=t.map(i=>i.id);return e.includes("move-fast")&&e.includes("compliance")&&n.push({between:["move-fast","compliance"],issue:"Speed vs traceability \u2014 shortcuts may violate audit requirements."}),e.includes("move-fast")&&e.includes("long-lived")&&n.push({between:["move-fast","long-lived"],issue:"Shipping speed vs maintainability \u2014 tech debt decisions need human approval."}),e.includes("beautiful-product")&&e.includes("move-fast")&&n.push({between:["beautiful-product","move-fast"],issue:"Design polish vs speed \u2014 which UI states can be deferred?"}),n};export{u as a,N as b,U as c,F as d,_ as e};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{c as o}from"./chunk-WG6J7DFO.js";import{t as e}from"./chunk-MRCBHVSB.js";var d=async(r,i,n)=>{let s=`${r}/${o.specFile(i)}`;try{let t=await e.fs.readTextFile(s);t=t.replace(/^## Status: .+$/m,`## Status: ${n}`),await e.fs.writeTextFile(s,t)}catch{}},u=async(r,i,n)=>{let s=`${r}/${o.specFile(i)}`;try{let t=await e.fs.readTextFile(s),a=new RegExp(`^(- )\\[ \\]( ${n}:.*)$`,"m");t=t.replace(a,"$1[x]$2"),await e.fs.writeTextFile(s,t)}catch{}},w=async(r,i,n,s)=>{let t=`${r}/${o.specDir(i)}/progress.json`;try{let a=await e.fs.readTextFile(t),c=JSON.parse(a);for(let p of c.tasks)p.id===n&&(p.status=s);c.updatedAt=new Date().toISOString(),await e.fs.writeTextFile(t,JSON.stringify(c,null,2)+`
2
+ import{c as o}from"./chunk-VD5ZJBSR.js";import{t as e}from"./chunk-MRCBHVSB.js";var d=async(r,i,n)=>{let s=`${r}/${o.specFile(i)}`;try{let t=await e.fs.readTextFile(s);t=t.replace(/^## Status: .+$/m,`## Status: ${n}`),await e.fs.writeTextFile(s,t)}catch{}},u=async(r,i,n)=>{let s=`${r}/${o.specFile(i)}`;try{let t=await e.fs.readTextFile(s),a=new RegExp(`^(- )\\[ \\]( ${n}:.*)$`,"m");t=t.replace(a,"$1[x]$2"),await e.fs.writeTextFile(s,t)}catch{}},w=async(r,i,n,s)=>{let t=`${r}/${o.specDir(i)}/progress.json`;try{let a=await e.fs.readTextFile(t),c=JSON.parse(a);for(let p of c.tasks)p.id===n&&(p.status=s);c.updatedAt=new Date().toISOString(),await e.fs.writeTextFile(t,JSON.stringify(c,null,2)+`
3
3
  `)}catch{}},f=async(r,i,n)=>{let s=`${r}/${o.specDir(i)}/progress.json`;try{let t=await e.fs.readTextFile(s),a=JSON.parse(t);a.status=n,a.updatedAt=new Date().toISOString(),await e.fs.writeTextFile(s,JSON.stringify(a,null,2)+`
4
4
  `)}catch{}};export{d as a,u as b,w as c,f as d};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{c as i}from"./chunk-WG6J7DFO.js";var n={UNINITIALIZED:["IDLE"],IDLE:["DISCOVERY"],DISCOVERY:["SPEC_DRAFT"],SPEC_DRAFT:["SPEC_APPROVED"],SPEC_APPROVED:["EXECUTING"],EXECUTING:["DONE","BLOCKED"],BLOCKED:["EXECUTING"],DONE:["IDLE"]},c=(e,s)=>n[e].includes(s),t=(e,s)=>{if(!c(e,s))throw new Error(`Invalid phase transition: ${e} \u2192 ${s}. Allowed: ${n[e].join(", ")}`)},h=(e,s)=>(t(e.phase,s),{...e,phase:s}),d=(e,s,a)=>(t(e.phase,"DISCOVERY"),{...e,phase:"DISCOVERY",spec:s,branch:a,discovery:{answers:[],completed:!1},specState:{path:null,status:"none"},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[]},decisions:[]}),E=(e,s,a)=>{if(e.phase!=="DISCOVERY")throw new Error(`Cannot add discovery answer in phase: ${e.phase}`);let o=[...e.discovery.answers.filter(r=>r.questionId!==s),{questionId:s,answer:a}];return{...e,discovery:{answers:o,completed:e.discovery.completed}}},u=e=>{if(e.phase!=="DISCOVERY")throw new Error(`Cannot complete discovery in phase: ${e.phase}`);return{...e,phase:"SPEC_DRAFT",discovery:{...e.discovery,completed:!0},specState:{path:i.specFile(e.spec),status:"draft"}}},m=e=>(t(e.phase,"SPEC_APPROVED"),{...e,phase:"SPEC_APPROVED",specState:{...e.specState,status:"approved"}}),S=e=>(t(e.phase,"EXECUTING"),{...e,phase:"EXECUTING",discovery:{answers:[],completed:!0},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[]}});var D=(e,s)=>(t(e.phase,"BLOCKED"),{...e,phase:"BLOCKED",execution:{...e.execution,lastProgress:`BLOCKED: ${s}`}}),C=(e,s)=>({...e,decisions:[...e.decisions,s]}),F=e=>({...e,phase:"IDLE",spec:null,branch:null,discovery:{answers:[],completed:!1},specState:{path:null,status:"none"},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[]},decisions:[],pendingClear:!1,classification:null});export{h as a,d as b,E as c,u as d,m as e,S as f,D as g,C as h,F as i};
2
+ import{c as i}from"./chunk-VD5ZJBSR.js";var n={UNINITIALIZED:["IDLE"],IDLE:["DISCOVERY"],DISCOVERY:["SPEC_DRAFT"],SPEC_DRAFT:["SPEC_APPROVED"],SPEC_APPROVED:["EXECUTING"],EXECUTING:["DONE","BLOCKED"],BLOCKED:["EXECUTING"],DONE:["IDLE"]},c=(e,s)=>n[e].includes(s),t=(e,s)=>{if(!c(e,s))throw new Error(`Invalid phase transition: ${e} \u2192 ${s}. Allowed: ${n[e].join(", ")}`)},h=(e,s)=>(t(e.phase,s),{...e,phase:s}),d=(e,s,a)=>(t(e.phase,"DISCOVERY"),{...e,phase:"DISCOVERY",spec:s,branch:a,discovery:{answers:[],completed:!1},specState:{path:null,status:"none"},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[]},decisions:[]}),E=(e,s,a)=>{if(e.phase!=="DISCOVERY")throw new Error(`Cannot add discovery answer in phase: ${e.phase}`);let o=[...e.discovery.answers.filter(r=>r.questionId!==s),{questionId:s,answer:a}];return{...e,discovery:{answers:o,completed:e.discovery.completed}}},u=e=>{if(e.phase!=="DISCOVERY")throw new Error(`Cannot complete discovery in phase: ${e.phase}`);return{...e,phase:"SPEC_DRAFT",discovery:{...e.discovery,completed:!0},specState:{path:i.specFile(e.spec),status:"draft"}}},m=e=>(t(e.phase,"SPEC_APPROVED"),{...e,phase:"SPEC_APPROVED",specState:{...e.specState,status:"approved"}}),S=e=>(t(e.phase,"EXECUTING"),{...e,phase:"EXECUTING",discovery:{answers:[],completed:!0},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[]}});var D=(e,s)=>(t(e.phase,"BLOCKED"),{...e,phase:"BLOCKED",execution:{...e.execution,lastProgress:`BLOCKED: ${s}`}}),C=(e,s)=>({...e,decisions:[...e.decisions,s]}),F=e=>({...e,phase:"IDLE",spec:null,branch:null,discovery:{answers:[],completed:!1},specState:{path:null,status:"none"},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[]},decisions:[],pendingClear:!1,classification:null});export{h as a,d as b,E as c,u as d,m as e,S as f,D as g,C as h,F as i};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{b as m}from"./chunk-IDMI5OBK.js";import{c as d}from"./chunk-WG6J7DFO.js";import{t as l}from"./chunk-MRCBHVSB.js";var h=c=>{let n=c.split(/\n/).flatMap(i=>i.trim().length>0?[i.trim()]:[]);return n.length>1?n:c.split(/\.\s+|;\s+/).map(i=>i.trim()).filter(i=>i.length>5)},v=c=>{let n=[],i=c.find(t=>t.questionId==="ambition");if(i!==void 0){let t=i.answer,e=t.match(/10[- ]?star[:\s]+(.+)/i),r=e!==null?e[1].trim():t.length>120?t.slice(0,120)+"...":t,p=r.charAt(0).toUpperCase()+r.slice(1);n.push(p)}let o=c.find(t=>t.questionId==="verification");if(o!==void 0){let t=h(o.answer);for(let e of t){let r=e.toLowerCase();r.startsWith("run ")||r.startsWith("check ")?n.push(`Test: ${e}`):n.push(e)}}return n.length===0&&n.push("_Tasks need to be defined before execution. Add tasks manually or run discovery with more detail._"),n},w=(c,n)=>{let i={};if(n===null){for(let o of c.specSections)i[o]=!1;return i}for(let o of c.specSections){let t=o.toLowerCase();t.includes("design")||t.includes("mobile")||t.includes("layout")||t.includes("interaction")?i[o]=n.involvesUI:t.includes("contributor")||t.includes("public api")||t.includes("api surface")?i[o]=n.involvesPublicAPI:t.includes("migration")||t.includes("deprecation")||t.includes("backward")||t.includes("compatibility")?i[o]=n.involvesMigration:t.includes("audit")||t.includes("access control")||t.includes("data handling")?i[o]=n.involvesDataHandling:i[o]=!0}return i},g=(c,n,i,o,t)=>{let e=[];e.push(`# Spec: ${c}`),e.push(""),e.push("## Status: draft"),e.push(""),i.length>0&&(e.push(`## Concerns: ${i.map(s=>s.id).join(", ")}`),e.push("")),e.push("## Discovery Answers"),e.push("");for(let s of n)e.push(`### ${s.questionId}`),e.push(""),e.push(s.answer),e.push("");for(let s of i)if(s.specSections.length>0){let a=w(s,t??null);for(let f of s.specSections)a[f]!==!1&&(e.push(`## ${f} (${s.id})`),e.push(""),e.push("_To be addressed during execution._"),e.push(""))}if(o.length>0){e.push("## Decisions"),e.push(""),e.push("| # | Decision | Choice | Promoted |"),e.push("|---|----------|--------|----------|");for(let s=0;s<o.length;s++){let a=o[s];e.push(`| ${s+1} | ${a.question} | ${a.choice} | ${a.promoted?"yes":"no"} |`)}e.push("")}let r=n.find(s=>s.questionId==="scope_boundary");if(r!==void 0){e.push("## Out of Scope"),e.push("");let s=h(r.answer);for(let a of s)e.push(`- ${a}`);e.push("")}let p=v(n);e.push("## Tasks"),e.push("");for(let s=0;s<p.length;s++)e.push(`- [ ] task-${s+1}: ${p[s]}`);e.push("");let u=n.find(s=>s.questionId==="verification");if(e.push("## Verification"),e.push(""),u!==void 0){let s=h(u.answer);for(let a of s)e.push(`- ${a}`)}else e.push("_To be defined._");return e.push(""),e.join(`
2
+ import{b as m}from"./chunk-IDMI5OBK.js";import{c as d}from"./chunk-VD5ZJBSR.js";import{t as l}from"./chunk-MRCBHVSB.js";var h=c=>{let n=c.split(/\n/).flatMap(i=>i.trim().length>0?[i.trim()]:[]);return n.length>1?n:c.split(/\.\s+|;\s+/).map(i=>i.trim()).filter(i=>i.length>5)},v=c=>{let n=[],i=c.find(t=>t.questionId==="ambition");if(i!==void 0){let t=i.answer,e=t.match(/10[- ]?star[:\s]+(.+)/i),r=e!==null?e[1].trim():t.length>120?t.slice(0,120)+"...":t,p=r.charAt(0).toUpperCase()+r.slice(1);n.push(p)}let o=c.find(t=>t.questionId==="verification");if(o!==void 0){let t=h(o.answer);for(let e of t){let r=e.toLowerCase();r.startsWith("run ")||r.startsWith("check ")?n.push(`Test: ${e}`):n.push(e)}}return n.length===0&&n.push("_Tasks need to be defined before execution. Add tasks manually or run discovery with more detail._"),n},w=(c,n)=>{let i={};if(n===null){for(let o of c.specSections)i[o]=!1;return i}for(let o of c.specSections){let t=o.toLowerCase();t.includes("design")||t.includes("mobile")||t.includes("layout")||t.includes("interaction")?i[o]=n.involvesUI:t.includes("contributor")||t.includes("public api")||t.includes("api surface")?i[o]=n.involvesPublicAPI:t.includes("migration")||t.includes("deprecation")||t.includes("backward")||t.includes("compatibility")?i[o]=n.involvesMigration:t.includes("audit")||t.includes("access control")||t.includes("data handling")?i[o]=n.involvesDataHandling:i[o]=!0}return i},g=(c,n,i,o,t)=>{let e=[];e.push(`# Spec: ${c}`),e.push(""),e.push("## Status: draft"),e.push(""),i.length>0&&(e.push(`## Concerns: ${i.map(s=>s.id).join(", ")}`),e.push("")),e.push("## Discovery Answers"),e.push("");for(let s of n)e.push(`### ${s.questionId}`),e.push(""),e.push(s.answer),e.push("");for(let s of i)if(s.specSections.length>0){let a=w(s,t??null);for(let f of s.specSections)a[f]!==!1&&(e.push(`## ${f} (${s.id})`),e.push(""),e.push("_To be addressed during execution._"),e.push(""))}if(o.length>0){e.push("## Decisions"),e.push(""),e.push("| # | Decision | Choice | Promoted |"),e.push("|---|----------|--------|----------|");for(let s=0;s<o.length;s++){let a=o[s];e.push(`| ${s+1} | ${a.question} | ${a.choice} | ${a.promoted?"yes":"no"} |`)}e.push("")}let r=n.find(s=>s.questionId==="scope_boundary");if(r!==void 0){e.push("## Out of Scope"),e.push("");let s=h(r.answer);for(let a of s)e.push(`- ${a}`);e.push("")}let p=v(n);e.push("## Tasks"),e.push("");for(let s=0;s<p.length;s++)e.push(`- [ ] task-${s+1}: ${p[s]}`);e.push("");let u=n.find(s=>s.questionId==="verification");if(e.push("## Verification"),e.push(""),u!==void 0){let s=h(u.answer);for(let a of s)e.push(`- ${a}`)}else e.push("_To be defined._");return e.push(""),e.join(`
3
3
  `)};var k=async(c,n,i)=>{if(n.spec===null)throw new Error("No active spec");let o=`${c}/${d.specDir(n.spec)}`,t=`${c}/${d.specFile(n.spec)}`;await l.fs.mkdir(o,{recursive:!0});let e=g(n.spec,n.discovery.answers,i,n.decisions,n.classification);await l.fs.writeTextFile(t,e);let r=m(n.spec,e),p=`${o}/progress.json`,u={spec:n.spec,status:"draft",tasks:r.tasks.map(s=>({id:s.id,title:s.title,status:"pending"})),decisions:n.decisions.map(s=>({question:s.question,choice:s.choice,promoted:s.promoted})),debt:[],updatedAt:new Date().toISOString()};return await l.fs.writeTextFile(p,JSON.stringify(u,null,2)+`
4
4
  `),t};export{k as a};
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as w}from"./chunk-JYNHFD6B.js";import{t as s}from"./chunk-MRCBHVSB.js";import{e as h}from"./chunk-G6NAG2EK.js";var u=()=>({version:"0.1.0",phase:"IDLE",spec:null,branch:null,discovery:{answers:[],completed:!1},specState:{path:null,status:"none"},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[]},decisions:[],lastCalledAt:null,pendingClear:!1,classification:null}),v=(e,t,r,n)=>({concerns:e,tools:t,providers:r,project:n,maxIterationsBeforeRestart:15,verifyCommand:null,allowGit:!1,command:"npx eser noskills"});var o=h(w(),1);var i=".eser",l=`${i}/.state`,f=`${l}/state.json`,g=`${i}/manifest.yml`,c=`${i}/concerns`,S=`${i}/rules`,p=`${i}/specs`,x=`${i}/workflows`,d=`${l}/specs`,D=`${l}/active.json`,y={eserDir:i,stateDir:l,stateFile:f,manifestFile:g,concernsDir:c,rulesDir:S,specsDir:p,workflowsDir:x,specStatesDir:d,activeFile:D,specDir:e=>`${p}/${e}`,specFile:e=>`${p}/${e}/spec.md`,specStateFile:e=>`${d}/${e}.json`,concernFile:e=>`${c}/${e}.json`,eserGitignore:`${i}/.gitignore`},F=async e=>{let t=`${e}/${f}`;try{let r=await s.fs.readTextFile(t);return JSON.parse(r)}catch{return u()}},P=async(e,t)=>{let r=`${e}/${l}`,n=`${e}/${f}`;await s.fs.mkdir(r,{recursive:!0}),await s.fs.writeTextFile(n,JSON.stringify(t,null,2)+`
2
+ import{a as w}from"./chunk-JYNHFD6B.js";import{t as s}from"./chunk-MRCBHVSB.js";import{e as x}from"./chunk-G6NAG2EK.js";var u=()=>({version:"0.1.0",phase:"IDLE",spec:null,branch:null,discovery:{answers:[],completed:!1},specState:{path:null,status:"none"},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[]},decisions:[],lastCalledAt:null,pendingClear:!1,classification:null}),v=(e,t,r,n)=>({concerns:e,tools:t,providers:r,project:n,maxIterationsBeforeRestart:15,verifyCommand:null,allowGit:!1});var o=x(w(),1);var i=".eser",l=`${i}/.state`,f=`${l}/state.json`,g=`${i}/manifest.yml`,c=`${i}/concerns`,S=`${i}/rules`,p=`${i}/specs`,h=`${i}/workflows`,d=`${l}/specs`,D=`${l}/active.json`,y={eserDir:i,stateDir:l,stateFile:f,manifestFile:g,concernsDir:c,rulesDir:S,specsDir:p,workflowsDir:h,specStatesDir:d,activeFile:D,specDir:e=>`${p}/${e}`,specFile:e=>`${p}/${e}/spec.md`,specStateFile:e=>`${d}/${e}.json`,concernFile:e=>`${c}/${e}.json`,eserGitignore:`${i}/.gitignore`},F=async e=>{let t=`${e}/${f}`;try{let r=await s.fs.readTextFile(t);return JSON.parse(r)}catch{return u()}},P=async(e,t)=>{let r=`${e}/${l}`,n=`${e}/${f}`;await s.fs.mkdir(r,{recursive:!0}),await s.fs.writeTextFile(n,JSON.stringify(t,null,2)+`
3
3
  `)},C=async e=>(await F(e)).spec;var E=async(e,t)=>{let r=`${e}/${y.specStateFile(t)}`;try{let n=await s.fs.readTextFile(r);return JSON.parse(n)}catch{return u()}},I=async(e,t,r)=>{let n=`${e}/${d}`,a=`${e}/${y.specStateFile(t)}`;await s.fs.mkdir(n,{recursive:!0}),await s.fs.writeTextFile(a,JSON.stringify(r,null,2)+`
4
4
  `)},b=async e=>{let t=`${e}/${d}`,r=[];try{for await(let n of s.fs.readDir(t))if(n.isFile&&n.name.endsWith(".json")){let a=n.name.replace(/\.json$/,""),m=await s.fs.readTextFile(`${t}/${n.name}`);r.push({name:a,state:JSON.parse(m)})}}catch{}return r},N=async e=>{let t=`${e}/${g}`;try{let r=await s.fs.readTextFile(t),n=o.parse(r);return n?.noskills===void 0?null:n.noskills}catch{return null}},R=async(e,t)=>{let r=`${e}/${g}`,n;try{let m=await s.fs.readTextFile(r);n=o.parseDocument(m)}catch{n=new o.Document({})}let a=n.createNode(t);a.commentBefore=" noskills orchestrator \u2014 inline comments in this section won't be preserved on next write",n.set("noskills",a),await s.fs.writeTextFile(r,n.toString())},k=async(e,t)=>{let r=`${e}/${y.concernFile(t)}`;try{let n=await s.fs.readTextFile(r);return JSON.parse(n)}catch{return null}},A=async(e,t)=>{let r=`${e}/${c}`,n=`${e}/${y.concernFile(t.id)}`;await s.fs.mkdir(r,{recursive:!0}),await s.fs.writeTextFile(n,JSON.stringify(t,null,2)+`
5
- `)},O=async e=>{let t=`${e}/${c}`,r=[];try{for await(let n of s.fs.readDir(t))if(n.isFile&&n.name.endsWith(".json")){let a=await s.fs.readTextFile(`${t}/${n.name}`);r.push(JSON.parse(a))}}catch{}return r},_=async e=>{let t=[i,l,d,c,S,p,x];for(let n of t)await s.fs.mkdir(`${e}/${n}`,{recursive:!0});let r=`${e}/${y.eserGitignore}`;try{await s.fs.stat(r)}catch{await s.fs.writeTextFile(r,`# eser toolchain runtime state \u2014 not tracked by git
5
+ `)},O=async e=>{let t=`${e}/${c}`,r=[];try{for await(let n of s.fs.readDir(t))if(n.isFile&&n.name.endsWith(".json")){let a=await s.fs.readTextFile(`${t}/${n.name}`);r.push(JSON.parse(a))}}catch{}return r},_=async e=>{let t=[i,l,d,c,S,p,h];for(let n of t)await s.fs.mkdir(`${e}/${n}`,{recursive:!0});let r=`${e}/${y.eserGitignore}`;try{await s.fs.stat(r)}catch{await s.fs.writeTextFile(r,`# eser toolchain runtime state \u2014 not tracked by git
6
6
  .state/
7
7
  `)}},j=async(e,t)=>{await P(e,t),t.spec!==null&&await I(e,t.spec,t)},M=async e=>{try{let t=await s.fs.readTextFile(`${e}/${g}`);return o.parse(t)?.noskills!==void 0}catch{return!1}};export{u as a,v as b,y as c,F as d,P as e,C as f,E as g,I as h,b as i,N as j,R as k,k as l,A as m,O as n,_ as o,j as p,M as q};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{b as A}from"./chunk-OCPEFZBJ.js";import{b as $,c as b}from"./chunk-CBGABZ5E.js";import{j as k,k as y,l as x,m as P}from"./chunk-VD5ZJBSR.js";import"./chunk-JYNHFD6B.js";import{f as m,h as w,k as g}from"./chunk-GBM3TZFD.js";import{c as d,d as c,f as u,g as C}from"./chunk-3SXTMY75.js";import{a as l,b as p}from"./chunk-A6RDYP6R.js";import{t as v}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var q=async s=>{let e=s?.[0];if(e==="add")return await I(s?.slice(1));if(e==="remove")return await M(s?.slice(1));if(e==="list")return await R();let r=$(),n=m({renderer:g.ansi(),sink:w.stdout()});return n.writeln(`Usage: ${r} concern <add <id> | remove <id> | list>`),await n.close(),l(void 0)},I=async s=>{let e=m({renderer:g.ansi(),sink:w.stdout()}),r=v.process.cwd(),n=(s??[]).filter(i=>!i.startsWith("-")),t=await k(r);if(n.length===0)return e.writeln(u("Please provide concern ID(s): "),d(b("concern add open-source beautiful-product"))),await e.close(),p({exitCode:1});if(t===null)return e.writeln(u("noskills not initialized.")),await e.close(),p({exitCode:1});let a=await A(),o=[];for(let i of n){let f=await x(r,i);if(f===null&&(f=a.find(h=>h.id===i)??null,f!==null&&await P(r,f)),f===null){e.writeln(u(`Unknown concern: ${i}`)),e.writeln(c(` Available: ${a.map(h=>h.id).join(", ")}`));continue}if(t.concerns.includes(i)||o.includes(i)){e.writeln(c(`Concern "${i}" is already active.`));continue}o.push(i)}if(o.length>0){let i={...t,concerns:[...t.concerns,...o]};await y(r,i),e.writeln(C("\u2714"),` Activated concerns: ${o.join(", ")}`)}return await e.close(),l(void 0)},M=async s=>{let e=m({renderer:g.ansi(),sink:w.stdout()}),r=v.process.cwd(),n=s?.[0],t=await k(r);if(n===void 0||n.length===0)return e.writeln(u("Please provide a concern ID: "),d(b("concern remove move-fast"))),await e.close(),p({exitCode:1});if(t===null)return e.writeln(u("noskills not initialized.")),await e.close(),p({exitCode:1});if(!t.concerns.includes(n))return e.writeln(c(`Concern "${n}" is not active.`)),await e.close(),l(void 0);let a={...t,concerns:t.concerns.filter(o=>o!==n)};return await y(r,a),e.writeln(C("\u2714")," Deactivated concern: ",d(n)),await e.close(),l(void 0)},R=async()=>{let s=m({renderer:g.ansi(),sink:w.stdout()}),e=v.process.cwd(),r=await k(e),n=await A(),t=r?.concerns??[];if(s.writeln(d("Concerns")),s.writeln(""),n.length===0)s.writeln(c(" No concerns defined."));else for(let a of n){let o=t.includes(a.id);s.writeln(" ",o?C("\u25CF"):c("\u25CB")," ",o?d(a.id):c(a.id),c(` ${a.description.slice(0,60)}...`))}return await s.close(),l(void 0)};export{q as main};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as E,d as C}from"./chunk-P2DMLPKI.js";import{a as S}from"./chunk-STTKPXTW.js";import{c as g}from"./chunk-CBGABZ5E.js";import{d as f,e as h}from"./chunk-VD5ZJBSR.js";import"./chunk-JYNHFD6B.js";import{f as d,h as w,k as u}from"./chunk-GBM3TZFD.js";import{c as n,d as i,f as c,g as m}from"./chunk-3SXTMY75.js";import{a,b as p}from"./chunk-A6RDYP6R.js";import{t as l}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var b=async $=>{let e=d({renderer:u.ansi(),sink:w.stdout()}),s=l.process.cwd(),t=await f(s);if(t.phase!=="EXECUTING")return e.writeln(c(`Cannot complete in phase: ${t.phase}`)),e.writeln(i("Only EXECUTING phase can transition to DONE.")),await e.close(),p({exitCode:1});let r=S(t,"DONE");if(await h(s,r),r.spec!==null&&(await E(s,r.spec,"done"),await C(s,r.spec,"done")),e.writeln(m("\u2714")," Spec completed!"),e.writeln(""),e.writeln(" Spec: ",n(t.spec??"unknown")),e.writeln(` Iterations: ${t.execution.iteration}`),e.writeln(` Decisions: ${t.decisions.length}`),t.decisions.length>0){let o=t.decisions.filter(U=>U.promoted);o.length>0&&e.writeln(i(` Promoted to rules: ${o.length}`))}return e.writeln(""),e.writeln("Start a new spec with: ",n(`${g('spec new "..."')}`)),await e.close(),a(void 0)};export{b as main};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as X,b as Y}from"./chunk-SP43S32B.js";import{d as Q}from"./chunk-5GGGQJ4P.js";import{e as H}from"./chunk-6FNHSIZJ.js";import{a as K,b as U}from"./chunk-25FUVC3C.js";import{b}from"./chunk-OCPEFZBJ.js";import{c as P}from"./chunk-CBGABZ5E.js";import{d as V}from"./chunk-2EVWKUN6.js";import{a as W,b as z,e as J,k as G,m as _,o as q,q as B}from"./chunk-VD5ZJBSR.js";import"./chunk-7ZYDAZBD.js";import{a as S,b as E,e as I,f as F,g as M,h as r,i as h}from"./chunk-JOTAKQMZ.js";import"./chunk-JYNHFD6B.js";import{a as R}from"./chunk-46ZWBKIW.js";import"./chunk-GE3LJ6QM.js";import"./chunk-BNQAZLIQ.js";import"./chunk-GBM3TZFD.js";import"./chunk-3SXTMY75.js";import"./chunk-J7YTWK67.js";import"./chunk-PVPMHMKP.js";import"./chunk-4MVO4LD5.js";import"./chunk-KVTG56GS.js";import"./chunk-PZNCE6QK.js";import"./chunk-MG65QJY6.js";import{a as k}from"./chunk-A6RDYP6R.js";import{t as f}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var Z=R;var ae=async t=>{try{return await f.fs.stat(t),!0}catch{return!1}},ce=[{id:"claude-code",paths:["CLAUDE.md",".claude"]},{id:"cursor",paths:[".cursorrules",".cursor"]},{id:"kiro",paths:[".kiro"]},{id:"copilot",paths:[".github/copilot-instructions.md"]},{id:"windsurf",paths:[".windsurfrules"]}],ee=async t=>{let e=[];for(let o of ce)for(let s of o.paths)if(await ae(`${t}/${s}`)){e.push(o.id);break}return e};var a=async t=>{try{return await f.fs.stat(t),!0}catch{return!1}},te=async(t,e)=>{try{let o=await f.fs.readTextFile(t);return JSON.parse(o)[e]??null}catch{return null}},de=async t=>{let e=[];return(await a(`${t}/package.json`)||await a(`${t}/deno.json`))&&e.push("typescript"),await a(`${t}/go.mod`)&&e.push("go"),await a(`${t}/Cargo.toml`)&&e.push("rust"),(await a(`${t}/pyproject.toml`)||await a(`${t}/setup.py`))&&e.push("python"),e},ue=async t=>{let e=[],o=await te(`${t}/package.json`,"dependencies");return o!==null&&("react"in o&&e.push("react"),"vue"in o&&e.push("vue"),"svelte"in o&&e.push("svelte"),"next"in o&&e.push("nextjs"),"express"in o&&e.push("express"),"hono"in o&&e.push("hono")),e},pe=async t=>{let e=[];return await a(`${t}/.github/workflows`)&&e.push("github-actions"),await a(`${t}/.gitlab-ci.yml`)&&e.push("gitlab-ci"),await a(`${t}/Jenkinsfile`)&&e.push("jenkins"),await a(`${t}/.circleci`)&&e.push("circleci"),e},fe=async t=>{if(await a(`${t}/deno.json`))return"deno";let e=await te(`${t}/package.json`,"devDependencies");if(e!==null){if("vitest"in e)return"vitest";if("jest"in e)return"jest";if("playwright"in e)return"playwright"}return null},se=async t=>{let[e,o,s,d]=await Promise.all([de(t),ue(t),pe(t),fe(t)]);return{languages:e,frameworks:o,ci:s,testRunner:d}};var Oe=async t=>{let e=f.process.cwd(),o=X(t),s=E({target:o==="agent"?"non-interactive":"interactive"}),d=Y(t),w=ne(d,"--concerns"),g=ne(d,"--tools"),u=d.includes("--non-interactive")||o==="agent";if(await B(e))return r.warn(s,"noskills is already initialized in this project."),r.info(s,`Run \`${P("sync")}\` to regenerate tool files.`),k(void 0);F(s,"noskills init");let j=h(s,"Scanning project...");j.start();let m=await se(e);j.succeed("Project scanned");for(let n of m.languages)r.step(s,` ${n}`);for(let n of m.frameworks)r.step(s,` ${n}`);for(let n of m.ci)r.step(s,` ${n}`);m.testRunner!==null&&r.step(s,` test runner: ${m.testRunner}`);let x=h(s,"Detecting coding tools...");x.start();let D=await ee(e),y=Q(),A=y!==null&&!D.includes(y)?[y]:[],v=[...new Set([...A,...D])];x.succeed(`${v.length} coding tool(s) detected`);for(let n of v){let i=n===y?" (current)":"";r.step(s,` ${n}${i}`)}let p;if(g!==null){let n=["claude-code","cursor","kiro","copilot","windsurf"],i=g.filter(l=>n.includes(l));p=[...new Set([...A,...i])]}else u?p=[...v]:p=await he(s,v,y);let L=h(s,"Detecting AI providers...");L.start();let C=(await Z()).filter(n=>n.available).map(n=>n.name);L.succeed(`${C.length} provider(s) detected`);let $=await b(),c;if(w!==null){let n=$.map(i=>i.id);c=w.filter(i=>n.includes(i)).sort((i,l)=>n.indexOf(i)-n.indexOf(l))}else if(u)c=[];else{let n=$.map(l=>({value:l.id,label:l.name,hint:l.description.slice(0,60)})),i=await I(s,{message:"What kind of project is this? (space to toggle, enter to confirm)",options:n});c=S(i)?[]:[...i]}c.length>0?r.success(s,`Concerns: ${c.join(", ")}`):r.info(s,"No concerns selected. Add later with `concern add <id>`.");let N=h(s,"Initializing...");N.start(),await q(e);let oe=$.filter(n=>c.includes(n.id));for(let n of oe)await _(e,n);let T=z(c,p,C,m);await G(e,T);let O=W();if(await J(e,O),N.succeed("Scaffolded `.eser/`"),p.length>0){let n=h(s,"Syncing tool files...");n.start();let i=await U(e,p,T);n.succeed(`Synced ${i.length} tool(s)`)}else r.warn(s,"No tools selected. noskills will work in agentless CLI mode only."),r.info(s,"Add tools later with `noskills sync`.");if(r.success(s,`Done. ${p.length} tool(s), ${C.length} provider(s), ${c.length} concern(s).`),o==="agent"){let i=(await b()).filter(re=>c.includes(re.id)),l=await K(e),ie=H(O,i,l,T);await V(ie,"json")}else M(s,`Start a spec with: ${P('spec new "..."')}`);return k(void 0)},me=[{value:"claude-code",label:"Claude Code"},{value:"cursor",label:"Cursor"},{value:"kiro",label:"Kiro"},{value:"copilot",label:"GitHub Copilot"},{value:"windsurf",label:"Windsurf"}],he=async(t,e,o)=>{let s=e.length===0?"No coding tools detected. Which tools do you use? (space to toggle)":"Any additional tools? (space to toggle, enter to skip)",d=new Set(e),w=await I(t,{message:s,options:me.map(u=>({...u,hint:u.value===o?"you're running inside it":d.has(u.value)?"detected":void 0,disabled:u.value===o})),initialValues:[...e],required:!1});if(S(w))return[...e];let g=[...w];return o!==null&&!g.includes(o)&&g.unshift(o),g},ne=(t,e)=>{if(t===void 0)return null;for(let o of t)if(o.startsWith(`${e}=`))return o.slice(e.length+1).split(",").map(s=>s.trim()).filter(Boolean);return null};export{Oe as main};
@@ -0,0 +1,10 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{e as D}from"./chunk-6FNHSIZJ.js";import{a as C}from"./chunk-25FUVC3C.js";import"./chunk-OCPEFZBJ.js";import{c as d}from"./chunk-CBGABZ5E.js";import{c as g,d as $,j as y,n as x,q as v}from"./chunk-VD5ZJBSR.js";import"./chunk-JYNHFD6B.js";import{a as i}from"./chunk-A6RDYP6R.js";import{t as n}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var S=async()=>{let e=n.process.stdin.getReader(),s=[];try{for(;;){let{done:r,value:o}=await e.read();if(r||o===void 0)break;s.push(o)}}finally{e.releaseLock()}let t=0,a=new Uint8Array(s.reduce((r,o)=>r+o.length,0));for(let r of s)a.set(r,t),t+=r.length;let c=new TextDecoder().decode(a);try{return JSON.parse(c)}catch{return{}}},P=async e=>{let s=new TextEncoder,t=n.process.stdout.getWriter();await t.write(s.encode(JSON.stringify(e))),t.releaseLock()},W=async e=>{switch(e?.[0]){case"pre-tool-use":return await T();case"stop":return await F();case"post-file-write":return await E();case"post-bash":return await I();case"session-start":return await N();default:return i(void 0)}},T=async()=>{let e=await S(),s=e.tool_name??"unknown",t=e.tool_input??{},a=e.cwd??n.process.cwd(),c=await y(a),r={};try{r=await $(a)}catch{return i(void 0)}let o=async u=>{await P({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`noskills: ${u}`}})};if(r.pendingClear===!0)return await o(`Task accepted. You must run \`/clear\` and then \`${d("next")}\` before continuing.`),i(void 0);if(s==="Bash"){let u=(t.command??"").trim();if(!(c?.allowGit??!1)){let w=["git add","git commit","git push","git merge","git rebase","git checkout","git stash","git reset","git cherry-pick","git tag","git branch -d","git branch -D","git branch -m","git revert","git am","git mv","git rm"];for(let p of w)if(u.startsWith(p)||u.includes(` && ${p}`)||u.includes(`; ${p}`))return await o("git is read-only for agents. The user controls git. You may use `git log`, `git diff`, `git status`, `git show`, `git blame`."),i(void 0)}return i(void 0)}if(!["Write","Edit","MultiEdit"].includes(s))return i(void 0);let m=t.file_path??t.path??"";if(m.includes(".eser/")||m.includes(".claude/"))return i(void 0);let f=r.phase??"UNKNOWN";if(f==="EXECUTING")return i(void 0);let k={IDLE:`No active spec. Run \`${d("spec new")}\``,UNINITIALIZED:`noskills not initialized. Run \`${d("init")}\``,DISCOVERY:`Discovery in progress. Run \`${d("next")}\` to continue.`,SPEC_DRAFT:`Spec needs review. Run \`${d("approve")}\``,SPEC_APPROVED:`Start execution first: \`${d('next --answer="start"')}\``,BLOCKED:`Execution blocked. Resolve with \`${d('next --answer="resolution"')}\``,DONE:`Spec complete. Start a new one or run \`${d("reset")}\``};return await o(k[f]??`Run \`${d("next")}\` first.`),i(void 0)},F=async()=>{let e=await S();if(e.stop_hook_active===!0)return i(void 0);let s=e.cwd??n.process.cwd(),t;try{let l=await n.fs.readTextFile(`${s}/${g.stateFile}`);t=JSON.parse(l)}catch{return i(void 0)}if(t.phase!=="EXECUTING")return i(void 0);let a=t.execution??{},c=`${s}/${g.stateDir}/files-changed.jsonl`,r=[];try{let w=(await n.fs.readTextFile(c)).trim().split(`
3
+ `).filter(Boolean);r=[...new Set(w.map(p=>{try{return JSON.parse(p).file}catch{return null}}).filter(p=>p!==null))]}catch{}let o=[],h="no changes";try{let{execSync:l}=await import("node:child_process");o=l("git diff --name-only",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
4
+ `).filter(Boolean);let R=l("git diff --stat",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
5
+ `);h=R[R.length-1]??"no changes"}catch{}let m=[...new Set([...r,...o])],f=(a.iteration??0)+1,k=`${s}/${g.stateDir}/iterations`;try{await n.fs.mkdir(k,{recursive:!0}),await n.fs.writeTextFile(`${k}/iteration-${f}.json`,JSON.stringify({iteration:f,files:m,gitStat:h.trim(),timestamp:new Date().toISOString()},null,2)+`
6
+ `)}catch{}let u=15;try{let l=await y(s);l!==null&&(u=l.maxIterationsBeforeRestart)}catch{}t.execution={...a,iteration:f,modifiedFiles:m,lastProgress:h.trim()||a.lastProgress||null},t.lastCalledAt=new Date().toISOString();try{await n.fs.writeTextFile(`${s}/${g.stateFile}`,JSON.stringify(t,null,2)+`
7
+ `)}catch{}try{await n.fs.writeTextFile(c,"")}catch{}if(f>=u){let l=new TextEncoder,w=n.process.stderr.getWriter();await w.write(l.encode(`noskills: iteration ${f} reached threshold (${u}). Consider starting a fresh conversation.
8
+ `)),w.releaseLock()}return i(void 0)},E=async()=>{let e=await S(),s=e.tool_input??{},t=s.file_path??s.path??"";if(!t||t.includes(".eser/")||t.includes(".claude/"))return i(void 0);let a=e.cwd??n.process.cwd(),c=`${a}/${g.stateDir}/files-changed.jsonl`,r=JSON.stringify({file:t,tool:e.tool_name,ts:new Date().toISOString()});try{await n.fs.mkdir(`${a}/${g.stateDir}`,{recursive:!0});let o="";try{o=await n.fs.readTextFile(c)}catch{}await n.fs.writeTextFile(c,o+r+`
9
+ `)}catch{}return i(void 0)},I=async()=>{let e=await S(),t=(e.tool_input??{}).command??"";if(!t.includes("noskills"))return i(void 0);let a=e.cwd??n.process.cwd(),c=`${a}/${g.stateDir}/noskills-calls.jsonl`,r=JSON.stringify({command:t,ts:new Date().toISOString()});try{await n.fs.mkdir(`${a}/${g.stateDir}`,{recursive:!0});let o="";try{o=await n.fs.readTextFile(c)}catch{}await n.fs.writeTextFile(c,o+r+`
10
+ `)}catch{}return i(void 0)},N=async()=>{let e=n.process.cwd();if(!await v(e))return i(void 0);let s=await $(e),t=await y(e),c=(await x(e)).filter(h=>t!==null&&t.concerns.includes(h.id)),r=await C(e),o=D(s,c,r,t);return await P(o),i(void 0)};export{W as main};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a,b,c,d,e,f}from"./chunk-LOLA6ZSE.js";import"./chunk-5GGGQJ4P.js";import"./chunk-J2Z7NG2X.js";import"./chunk-GBM3TZFD.js";import"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import"./chunk-FKITIXO2.js";import"./chunk-A6RDYP6R.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";export{d as completionsHandler,f as doctorHandler,a as installHandler,b as uninstallHandler,c as updateHandler,e as versionHandler};
2
+ import{a,b,c,d,e,f}from"./chunk-CZS6DCUY.js";import"./chunk-5GGGQJ4P.js";import"./chunk-J2Z7NG2X.js";import"./chunk-GBM3TZFD.js";import"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import"./chunk-LKF6GBNU.js";import"./chunk-A6RDYP6R.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";export{d as completionsHandler,f as doctorHandler,a as installHandler,b as uninstallHandler,c as updateHandler,e as versionHandler};
@@ -0,0 +1,4 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as _}from"./chunk-V3WALAAO.js";import{a as B,b as H,c as Q,d as z}from"./chunk-P2DMLPKI.js";import{a as v}from"./chunk-IDMI5OBK.js";import{b as U,c as L,d as N,e as I}from"./chunk-6FNHSIZJ.js";import{a as P}from"./chunk-25FUVC3C.js";import"./chunk-OCPEFZBJ.js";import{a as M,c as b,d as G,f as J,h as W}from"./chunk-STTKPXTW.js";import{c as V}from"./chunk-CBGABZ5E.js";import{a as q,b as j,d as x}from"./chunk-2EVWKUN6.js";import{c as k,d as O,j as E,n as $,p as y,q as T}from"./chunk-VD5ZJBSR.js";import"./chunk-JYNHFD6B.js";import{a as F,b as D}from"./chunk-A6RDYP6R.js";import{t as h}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var Z=o=>o.split(`
3
+ `).map(e=>e.replace(/^[-*]\s+/,"").trim()).filter(e=>e.length>0&&!e.startsWith("#")),ee=async(o,e)=>{let r=[],n=(e.startsWith(o)?e.slice(o.length+1):e).split("/");n.pop();for(let t=n.length;t>=0;t--){let i=`${t===0?o:`${o}/${n.slice(0,t).join("/")}`}/.folder-rules.md`,c=t===0?".":n.slice(0,t).join("/");try{let p=await h.fs.readTextFile(i),g=Z(p);for(let f of g)r.push({folder:c,rule:f})}catch{}}return r},A=async(o,e)=>{let r=new Set,a=[];for(let n of e){let t=await ee(o,n);for(let s of t){let i=`${s.folder}::${s.rule}`;r.has(i)||(r.add(i),a.push(s))}}return a};var ye=async o=>{let e=h.process.cwd(),r=q(o),a=j(o);if(!await T(e))return await x({error:`noskills not initialized. Run: ${V("init")}`},r),D({exitCode:1});let n=null;for(let l of a)l.startsWith("--answer=")&&(n=l.slice(9));let t=await O(e),s=await E(e);if(t.pendingClear&&(t={...t,pendingClear:!1},await y(e,t)),s===null)return await x({error:"No config found"},r),D({exitCode:1});let c=(await $(e)).filter(l=>s.concerns.includes(l.id));if(n!==null){let l=await se(e,t,s,c,n);await y(e,l);let u={...l,lastCalledAt:new Date().toISOString()};await y(e,u);let m=await P(e),d=u.spec!==null?await v(e,u.spec):null,R=await K(e,u),X=await A(e,R),Y=I(u,c,m,s,d,X);return await x(Y,r),F(void 0)}let p={...t,lastCalledAt:new Date().toISOString()};await y(e,p);let g=await P(e),f=p.spec!==null?await v(e,p.spec):null,w=await K(e,p),C=await A(e,w),S=I(p,c,g,s,f,C);return await x(S,r),F(void 0)},se=async(o,e,r,a,n)=>{switch(e.phase){case"DISCOVERY":{let t=null;try{let i=JSON.parse(n);typeof i=="object"&&i!==null&&!Array.isArray(i)&&(t=i)}catch{}let s=e;if(t!==null)for(let[i,c]of Object.entries(t))typeof c=="string"&&c.length>0&&(s=b(s,i,c));else{let i=U(a),c=L(i,s.discovery.answers);if(c===null)return e;s=b(s,c.id,n)}return N(s.discovery.answers)&&(s=G(s)),s}case"SPEC_DRAFT":{if(e.classification===null){let t;try{let i=JSON.parse(n);t={involvesUI:i.involvesUI===!0,involvesPublicAPI:i.involvesPublicAPI===!0,involvesMigration:i.involvesMigration===!0,involvesDataHandling:i.involvesDataHandling===!0}}catch{t={involvesUI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1}}let s={...e,classification:t};try{await _(o,s,a)}catch{}return s}return e}case"SPEC_APPROVED":{let t=J(e);return t.spec!==null&&(await B(o,t.spec,"executing"),await z(o,t.spec,"executing")),t}case"EXECUTING":{if(!e.execution.awaitingStatusReport){let t={...e,execution:{...e.execution,lastProgress:n}};if(r.verifyCommand!==null&&r.verifyCommand!==void 0&&r.verifyCommand.length>0){let s=await re(o,r.verifyCommand);if(t={...t,execution:{...t.execution,lastVerification:s}},!s.passed)return t}return t={...t,execution:{...t.execution,awaitingStatusReport:!0}},t}return await ne(o,e,n,a)}case"BLOCKED":{let t=e.execution.lastProgress??"Unknown",s={id:`d${e.decisions.length+1}`,question:t.replace(/^BLOCKED:\s*/,""),choice:n,promoted:!1,timestamp:new Date().toISOString()},i=W(e,s);return i=M(i,"EXECUTING"),i={...i,execution:{...i.execution,lastProgress:`Resolved: ${n}`}},i}default:return e}},ne=async(o,e,r,a)=>{let n;try{n=JSON.parse(r)}catch{return{...e,execution:{...e.execution,lastProgress:r,awaitingStatusReport:!1}}}let t=n.completed??[],s=n.remaining??[],i=n.blocked??[],c=[...s,...i],p=e.execution.debt?.unaddressedIterations??0,g=c.length>0?{items:c,fromIteration:e.execution.iteration,unaddressedIterations:1}:null,f=g;if(e.execution.debt!==null&&g!==null){let l=new Set(t.map(d=>d.toLowerCase().trim())),u=e.execution.debt.items.filter(d=>!l.has(d.toLowerCase().trim())),m=[...new Set([...u,...c])];f=m.length>0?{items:m,fromIteration:e.execution.debt.fromIteration,unaddressedIterations:u.length>0?p+1:1}:null}else if(e.execution.debt!==null&&g===null){let l=new Set(t.map(m=>m.toLowerCase().trim())),u=e.execution.debt.items.filter(m=>!l.has(m.toLowerCase().trim()));f=u.length>0?{items:u,fromIteration:e.execution.debt.fromIteration,unaddressedIterations:p+1}:null}let w=t.length>0?`Completed: ${t.join(", ")}`:"Status report submitted",C=e.execution.lastVerification===null||e.execution.lastVerification.passed===!0,S=f===null&&C;if(S&&e.spec!==null){let l=await v(o,e.spec);if(l!==null){let u=e.execution.completedTasks??[],m=new Set(u),d=l.tasks.find(R=>!m.has(R.id));if(d!==void 0)return await H(o,e.spec,d.id),await Q(o,e.spec,d.id,"done"),{...e,pendingClear:!0,execution:{...e.execution,lastProgress:`Task ${d.id} accepted: ${w}`,awaitingStatusReport:!1,debt:f,completedTasks:[...u,d.id]}}}}return{...e,pendingClear:S,execution:{...e.execution,lastProgress:S?w:`Task not accepted \u2014 remaining items must be addressed first. ${w}`,awaitingStatusReport:!1,debt:f}}},re=async(o,e)=>{try{let{execSync:r}=await import("node:child_process"),a=r(e,{cwd:o,encoding:"utf-8",timeout:6e4,stdio:["pipe","pipe","pipe"]});return{passed:!0,output:String(a).slice(0,4e3),timestamp:new Date().toISOString()}}catch(r){let a=r,n=((a.stdout??"")+(a.stderr??"")).slice(0,4e3);return a.status!==void 0?{passed:!1,output:n||"Verification failed with no output",timestamp:new Date().toISOString()}:{passed:!1,output:`Verification command failed to execute: ${r instanceof Error?r.message:String(r)}`,timestamp:new Date().toISOString()}}},K=async(o,e)=>{let r=[...e.execution.modifiedFiles??[]],a=await ie(o);return[...new Set([...r,...a])]},ie=async o=>{let e=`${o}/${k.stateDir}/files-changed.jsonl`;try{let a=(await h.fs.readTextFile(e)).trim().split(`
4
+ `).filter(Boolean),n=[];for(let t of a)try{let s=JSON.parse(t);n.includes(s.file)||n.push(s.file)}catch{}return n}catch{return[]}};export{ye as main};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as v,b as k}from"./chunk-SP43S32B.js";import"./chunk-5GGGQJ4P.js";import{c}from"./chunk-WG6J7DFO.js";import{a as p,b as w,c as h,h as r}from"./chunk-JOTAKQMZ.js";import{a as $}from"./chunk-JYNHFD6B.js";import"./chunk-GBM3TZFD.js";import"./chunk-3SXTMY75.js";import{a as d,b as g}from"./chunk-A6RDYP6R.js";import{t as n}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import{e as y}from"./chunk-G6NAG2EK.js";var x=y($(),1);var M=async i=>{let e=n.process.cwd(),s=v(i),t=w({target:s==="agent"?"non-interactive":"interactive"});if(!k(i).includes("--force")){if(s==="agent")return r.error(t,"Purge requires `--force` flag in agent mode."),g({exitCode:1});let l=await h(t,{message:"This will remove all noskills specs, rules, concerns, and hooks. Continue?"});if(p(l)||l!==!0)return r.info(t,"Aborted."),d(void 0)}return r.step(t,"Purging noskills content..."),await u(`${e}/${c.concernsDir}`,t,"`.eser/concerns/`"),await u(`${e}/${c.specsDir}`,t,"`.eser/specs/`"),await u(`${e}/${c.rulesDir}`,t,"`.eser/rules/`"),await u(`${e}/${c.stateDir}`,t,"`.eser/.state/`"),await C(e,t),await T(e,t),await m(`${e}/.cursorrules`,t,"`.cursorrules`"),await m(`${e}/.windsurfrules`,t,"`.windsurfrules`"),await m(`${e}/.kiro/steering/conventions.md`,t,"`.kiro/steering/conventions.md`"),await m(`${e}/.github/copilot-instructions.md`,t,"`.github/copilot-instructions.md`"),await F(e,t),r.success(t,"Purge complete."),d(void 0)},u=async(i,e,s)=>{try{await n.fs.stat(i);let{rmSync:t}=await import("node:fs");t(i,{recursive:!0,force:!0}),r.step(e,` Removed ${s}`)}catch{}},m=async(i,e,s)=>{try{await n.fs.stat(i);let{unlinkSync:t}=await import("node:fs");t(i),r.step(e,` Removed ${s}`)}catch{}},C=async(i,e)=>{let s=`${i}/${c.manifestFile}`;try{let t=await n.fs.readTextFile(s),o=x.parseDocument(t);o.has("noskills")&&(o.delete("noskills"),await n.fs.writeTextFile(s,o.toString()),r.step(e," Removed noskills section from `manifest.yml`"))}catch{}},T=async(i,e)=>{let s=`${i}/CLAUDE.md`,t="<!-- noskills:start -->",o="<!-- noskills:end -->";try{let a=await n.fs.readTextFile(s),l=a.indexOf(t),f=a.indexOf(o);l!==-1&&f!==-1&&(a=a.slice(0,l).trimEnd()+`
2
+ import{a as v,b as k}from"./chunk-SP43S32B.js";import"./chunk-5GGGQJ4P.js";import{c}from"./chunk-VD5ZJBSR.js";import{a as p,b as w,c as h,h as r}from"./chunk-JOTAKQMZ.js";import{a as $}from"./chunk-JYNHFD6B.js";import"./chunk-GBM3TZFD.js";import"./chunk-3SXTMY75.js";import{a as d,b as g}from"./chunk-A6RDYP6R.js";import{t as n}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import{e as y}from"./chunk-G6NAG2EK.js";var x=y($(),1);var M=async i=>{let e=n.process.cwd(),s=v(i),t=w({target:s==="agent"?"non-interactive":"interactive"});if(!k(i).includes("--force")){if(s==="agent")return r.error(t,"Purge requires `--force` flag in agent mode."),g({exitCode:1});let l=await h(t,{message:"This will remove all noskills specs, rules, concerns, and hooks. Continue?"});if(p(l)||l!==!0)return r.info(t,"Aborted."),d(void 0)}return r.step(t,"Purging noskills content..."),await u(`${e}/${c.concernsDir}`,t,"`.eser/concerns/`"),await u(`${e}/${c.specsDir}`,t,"`.eser/specs/`"),await u(`${e}/${c.rulesDir}`,t,"`.eser/rules/`"),await u(`${e}/${c.stateDir}`,t,"`.eser/.state/`"),await C(e,t),await T(e,t),await m(`${e}/.cursorrules`,t,"`.cursorrules`"),await m(`${e}/.windsurfrules`,t,"`.windsurfrules`"),await m(`${e}/.kiro/steering/conventions.md`,t,"`.kiro/steering/conventions.md`"),await m(`${e}/.github/copilot-instructions.md`,t,"`.github/copilot-instructions.md`"),await F(e,t),r.success(t,"Purge complete."),d(void 0)},u=async(i,e,s)=>{try{await n.fs.stat(i);let{rmSync:t}=await import("node:fs");t(i,{recursive:!0,force:!0}),r.step(e,` Removed ${s}`)}catch{}},m=async(i,e,s)=>{try{await n.fs.stat(i);let{unlinkSync:t}=await import("node:fs");t(i),r.step(e,` Removed ${s}`)}catch{}},C=async(i,e)=>{let s=`${i}/${c.manifestFile}`;try{let t=await n.fs.readTextFile(s),o=x.parseDocument(t);o.has("noskills")&&(o.delete("noskills"),await n.fs.writeTextFile(s,o.toString()),r.step(e," Removed noskills section from `manifest.yml`"))}catch{}},T=async(i,e)=>{let s=`${i}/CLAUDE.md`,t="<!-- noskills:start -->",o="<!-- noskills:end -->";try{let a=await n.fs.readTextFile(s),l=a.indexOf(t),f=a.indexOf(o);l!==-1&&f!==-1&&(a=a.slice(0,l).trimEnd()+`
3
3
  `+a.slice(f+o.length).trimStart(),await n.fs.writeTextFile(s,a.trimEnd()+`
4
4
  `),r.step(e," Removed noskills section from `CLAUDE.md`"))}catch{}},F=async(i,e)=>{let s=`${i}/.claude/settings.json`;try{let t=await n.fs.readTextFile(s),o=JSON.parse(t);o.hooks!==void 0&&(delete o.hooks,await n.fs.writeTextFile(s,JSON.stringify(o,null,2)+`
5
5
  `),r.step(e," Removed hooks from `.claude/settings.json`"))}catch{}};export{M as main};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{i as u}from"./chunk-UESOCN2G.js";import{d as c,e as d}from"./chunk-WG6J7DFO.js";import"./chunk-JYNHFD6B.js";import{f as m,h as p,k as l}from"./chunk-GBM3TZFD.js";import{d as a,g as o}from"./chunk-3SXTMY75.js";import{a as r}from"./chunk-A6RDYP6R.js";import{t as n}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var N=async w=>{let e=m({renderer:l.ansi(),sink:p.stdout()}),i=n.process.cwd(),s=await c(i);if(s.phase==="IDLE"||s.phase==="UNINITIALIZED")return e.writeln(a("Already idle. Nothing to reset.")),await e.close(),r(void 0);let t=s.spec,f=u(s);return await d(i,f),e.writeln(o("\u2714")," Reset to IDLE."),t!==null&&e.writeln(a(`Spec "${t}" state cleared. Files in .eser/specs/${t}/ preserved.`)),await e.close(),r(void 0)};export{N as main};
2
+ import{i as u}from"./chunk-STTKPXTW.js";import{d as c,e as d}from"./chunk-VD5ZJBSR.js";import"./chunk-JYNHFD6B.js";import{f as m,h as p,k as l}from"./chunk-GBM3TZFD.js";import{d as a,g as o}from"./chunk-3SXTMY75.js";import{a as r}from"./chunk-A6RDYP6R.js";import{t as n}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var N=async w=>{let e=m({renderer:l.ansi(),sink:p.stdout()}),i=n.process.cwd(),s=await c(i);if(s.phase==="IDLE"||s.phase==="UNINITIALIZED")return e.writeln(a("Already idle. Nothing to reset.")),await e.close(),r(void 0);let t=s.spec,f=u(s);return await d(i,f),e.writeln(o("\u2714")," Reset to IDLE."),t!==null&&e.writeln(a(`Spec "${t}" state cleared. Files in .eser/specs/${t}/ preserved.`)),await e.close(),r(void 0)};export{N as main};
@@ -0,0 +1,3 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as k,b as x}from"./chunk-25FUVC3C.js";import{b as y,c as w}from"./chunk-CBGABZ5E.js";import{c as f,j as h}from"./chunk-VD5ZJBSR.js";import"./chunk-JYNHFD6B.js";import{f as o,h as l,k as a}from"./chunk-GBM3TZFD.js";import{c as m,d as i,f as p,g}from"./chunk-3SXTMY75.js";import{a as u,b as c}from"./chunk-A6RDYP6R.js";import{t as n}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var U=async s=>{let e=s?.[0];if(e==="add")return await $(s?.slice(1));if(e==="list")return await v();if(e==="promote")return await C(s?.slice(1));let t=y(),r=o({renderer:a.ansi(),sink:l.stdout()});return r.writeln(`Usage: ${t} rule <add "rule text" | list | promote "decision">`),await r.close(),u(void 0)},$=async s=>{let e=o({renderer:a.ansi(),sink:l.stdout()}),t=n.process.cwd(),r=s?.join(" "),d=await h(t);if(r===void 0||r.length===0)return e.writeln(p("Please provide a rule: "),m(`${w('rule add "Use Deno Tests for all tests"')}`)),await e.close(),c({exitCode:1});let P=r.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,50),A=`${t}/${f.rulesDir}/${P}.md`;return await n.fs.mkdir(`${t}/${f.rulesDir}`,{recursive:!0}),await n.fs.writeTextFile(A,r+`
3
+ `),e.writeln(g("\u2714")," Rule added: ",i(r)),d!==null&&d.tools.length>0&&(await x(t,d.tools,d),e.writeln(i(" Tool files synced."))),await e.close(),u(void 0)},v=async()=>{let s=o({renderer:a.ansi(),sink:l.stdout()}),e=n.process.cwd(),t=await k(e);if(s.writeln(m("Rules")),s.writeln(""),t.length===0)s.writeln(i(` No rules yet. Add one with: ${w('rule add "..."')}`));else for(let r of t)s.writeln(" ",i("\u2022"),` ${r}`);return await s.close(),u(void 0)},C=async s=>{let e=o({renderer:a.ansi(),sink:l.stdout()}),t=s?.join(" ");return t===void 0||t.length===0?(e.writeln(p("Please provide the decision text to promote.")),await e.close(),c({exitCode:1})):(await e.close(),await $(s))};export{U as main};
@@ -0,0 +1,4 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{e as V}from"./chunk-6FNHSIZJ.js";import{a as B}from"./chunk-25FUVC3C.js";import"./chunk-OCPEFZBJ.js";import{a as L,f as M}from"./chunk-STTKPXTW.js";import{b as $,c as G}from"./chunk-CBGABZ5E.js";import{d as x,e as g,j as N,n as F,q as U}from"./chunk-VD5ZJBSR.js";import{a as T,b as D,d as A}from"./chunk-JOTAKQMZ.js";import"./chunk-JYNHFD6B.js";import{f as I,h as R,k as O}from"./chunk-GBM3TZFD.js";import{c as y,d as o,f as p,g as P,h,k as v}from"./chunk-3SXTMY75.js";import{a as k,b as w}from"./chunk-A6RDYP6R.js";import{t as S}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var oe=async t=>{let e=I({renderer:O.ansi(),sink:R.stdout()}),n=S.process.cwd(),i=t?.includes("--unattended")??!1,r=W(t,"--max-turns")??10,u=W(t,"--max-iterations")??50;if(!await U(n))return e.writeln(p(`noskills not initialized. Run: ${G("init")}`)),await e.close(),w({exitCode:1});let l=await x(n);if(l.phase!=="EXECUTING"&&l.phase!=="SPEC_APPROVED")return e.writeln(p(`Cannot run from phase: ${l.phase}`)),e.writeln(o("Must be in SPEC_APPROVED or EXECUTING to start.")),await e.close(),w({exitCode:1});if(l.phase==="SPEC_APPROVED"){e.writeln(o("Starting execution from approved spec..."));let s=M(l);await g(n,s)}let c=await N(n);if(c===null)return e.writeln(p("Config not found.")),await e.close(),w({exitCode:1});e.writeln(y(`${$()} run`)),e.writeln(o(`Mode: ${i?"unattended":"interactive"}, max-turns: ${r}, max-iterations: ${u}`)),e.writeln("");let m=0,d=0;for(;m<u;){m++;let s=await x(n);if(s.phase==="DONE"){e.writeln(""),e.writeln(P("\u2714")," Spec completed!"),e.writeln(` Iterations: ${s.execution.iteration}`),e.writeln(` Decisions: ${s.decisions.length}`);break}if(s.phase==="BLOCKED"){let a=s.execution.lastProgress??"Unknown";if(e.writeln(""),e.writeln(h("\u26A0")," Execution blocked: ",o(a)),i){await H(n,a,m),e.writeln(o("Logged to .eser/.state/blocked.log. Resolve and re-run.")),d=1;break}let C=D(),f=await A(C,{message:"Enter resolution (or leave empty to stop):"});if(T(f)||f===""){e.writeln(o("Stopped by user."));break}let E=L(s,"EXECUTING");await g(n,{...E,execution:{...E.execution,lastProgress:`Resolved: ${f}`}});continue}if(s.phase!=="EXECUTING"){e.writeln(p(`Unexpected phase: ${s.phase}. Stopping.`)),d=1;break}s.pendingClear&&await g(n,{...s,pendingClear:!1});let X=(await F(n)).filter(a=>c.concerns.includes(a.id)),_=await B(n),j=V(s,X,_,c),z=q(j);e.writeln(v(`\u2500\u2500 Iteration ${m}`),o(` (execution: ${s.execution.iteration}, debt: ${s.execution.debt?.items.length??0})`)),s.execution.lastProgress!==null&&e.writeln(o(` Last: ${s.execution.lastProgress}`)),s.execution.lastVerification?.passed===!1&&e.writeln(p(" Verification failed \u2014 agent will fix")),s.execution.debt!==null&&e.writeln(h(` Debt: ${s.execution.debt.items.length} items`)),e.writeln(o(" Spawning agent..."));try{await(await import("./mod-JI2A2546.js")).exec`claude -p ${z} --max-turns ${String(r)} --output-format json`.noThrow().text()}catch{e.writeln(p(" Failed to spawn claude CLI. Is it installed?")),d=1;break}e.writeln(o(" Agent exited. Stop hook captured state."));let b=await x(n);if(c.autoCommit===!0&&c.allowGit!==!1)try{let a=await import("./mod-JI2A2546.js");if((await a.exec`git diff --name-only`.noThrow().text()).trim().length>0){await a.exec`git add -A`.noThrow().text();let f=`noskills: iteration ${b.execution.iteration} \u2014 ${b.execution.lastProgress??"progress"}`;await a.exec`git commit -m ${f}`.noThrow().text(),e.writeln(o(" Auto-committed."))}}catch{e.writeln(o(" Auto-commit failed (non-fatal)."))}}return m>=u&&(e.writeln(""),e.writeln(h("\u26A0"),` Max iterations (${u}) reached. Stopping.`),d=2),await e.close(),d!==0?w({exitCode:d}):k(void 0)},q=t=>{let e=[];if(e.push(t.meta.resumeHint),e.push(""),t.meta.spec!==null&&(e.push(`Working on spec: ${t.meta.spec}`),e.push("")),"instruction"in t&&(e.push(t.instruction),e.push("")),"previousIterationDebt"in t){let i=t.previousIterationDebt;if(i!==void 0){e.push(`DEBT from iteration ${i.fromIteration} (address first):`);for(let r of i.items)e.push(`- ${r}`);e.push("")}}if("statusReportRequired"in t){let i=t.statusReport;if(i!==void 0){e.push("Report against these acceptance criteria:");for(let r of i.criteria)e.push(`- ${r}`);e.push("")}}if("verificationFailed"in t&&t.verificationFailed===!0&&(e.push("Test output:"),e.push(("verificationOutput"in t?t.verificationOutput:"")??""),e.push("")),t.behavioral.rules.length>0){e.push("Rules:");for(let i of t.behavioral.rules)e.push(`- ${i}`);e.push("")}if("context"in t){let i=t.context;if(i.concernReminders.length>0){e.push("Reminders:");for(let r of i.concernReminders)e.push(`- ${r}`);e.push("")}}let n=$();return e.push(`When done, report progress: ${n} next --answer="your progress"`),e.push(`If blocked, run: ${n} block "reason"`),e.push(`When all tasks are complete: ${n} done`),e.join(`
3
+ `)},W=(t,e)=>{if(t===void 0)return null;let n=`${e}=`;for(let i of t)if(i.startsWith(n)){let r=parseInt(i.slice(n.length),10);if(!isNaN(r)&&r>0)return r}return null},H=async(t,e,n)=>{let i=`${t}/.eser/.state/blocked.log`,r=`[${new Date().toISOString()}] iteration=${n} reason=${e}
4
+ `;try{let{appendFileSync:u,mkdirSync:l}=await import("node:fs"),{dirname:c}=await import("node:path");l(c(i),{recursive:!0}),u(i,r)}catch{}};export{oe as main};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{b as T,i as U}from"./chunk-STTKPXTW.js";import{b,c as k}from"./chunk-CBGABZ5E.js";import{a as O,d as z}from"./chunk-2EVWKUN6.js";import{c as g,d as E,e as N,f as P,g as A,h as I,i as R,q as L}from"./chunk-VD5ZJBSR.js";import"./chunk-JYNHFD6B.js";import{f as $,h as y,k as D}from"./chunk-GBM3TZFD.js";import{c as l,d as c,f as m,g as S,h as x,k as C}from"./chunk-3SXTMY75.js";import{a as f,b as h}from"./chunk-A6RDYP6R.js";import{t as u}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var _=async n=>{let e=n?.[0];if(e==="new")return await G(n?.slice(1));if(e==="list")return await B(n?.slice(1));if(e==="switch")return await q(n?.slice(1));let t=b(),r=$({renderer:D.ansi(),sink:y.stdout()});return r.writeln(`Usage: ${t} spec <new "description" | list | switch <name>>`),await r.close(),f(void 0)},G=async n=>{let e=$({renderer:D.ansi(),sink:y.stdout()}),t=u.process.cwd();if(!await L(t))return e.writeln(m("noskills is not initialized.")," Run: ",l(k("init"))),await e.close(),h({exitCode:1});let r=null,i=[];if(n!==void 0)for(let w of n)w.startsWith("--name=")?r=w.slice(7):w.startsWith("-")||i.push(w);let p=i.join(" ");if(p.length===0)return e.writeln(m("Please provide a description: "),l(`${b()} spec new "photo auto-listing"`)),await e.close(),h({exitCode:1});let o=r??W(p),a=await X(t,o),d=`spec/${a}`,s=await E(t);if(s.phase!=="IDLE"&&s.phase!=="DONE")return e.writeln(m(`Cannot start new spec in phase: ${s.phase}`),c(" \u2014 finish or reset the current spec first.")),await e.close(),h({exitCode:1});let v=T(s.phase==="DONE"?U(s):s,a,d);return await u.fs.mkdir(`${t}/${g.specDir(a)}`,{recursive:!0}),await N(t,v),await I(t,a,v),e.writeln(S("\u2714")," Spec started: ",l(a)),e.writeln(" Directory: ",c(g.specDir(a))),e.writeln(" Branch: ",c(d)),e.writeln(" Phase: ",x("DISCOVERY")),e.writeln(""),e.writeln("Run ",l(k("next"))," to begin discovery questions."),await e.close(),f(void 0)},W=n=>n.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,50).replace(/-$/,""),X=async(n,e)=>{let t=`${n}/${g.specsDir}`,r=async i=>{try{return await u.fs.stat(`${t}/${i}`),!0}catch{return!1}};if(!await r(e))return e;for(let i=2;i<=99;i++){let p=`${e}-${i}`;if(!await r(p))return p}return`${e}-${Date.now()}`},B=async n=>{let e=u.process.cwd(),t=O(n),r=await P(e),i=await R(e),p=`${e}/${g.specsDir}`,o=new Set(i.map(s=>s.name)),a=[];for(let s of i)a.push({name:s.name,phase:s.state.phase,iteration:s.state.execution.iteration,active:s.name===r});try{for await(let s of u.fs.readDir(p))s.isDirectory&&!o.has(s.name)&&a.push({name:s.name,phase:"IDLE",iteration:0,active:s.name===r})}catch{}if(t==="json")return await z(a,"json"),f(void 0);let d=$({renderer:D.ansi(),sink:y.stdout()});if(d.writeln(l("Specs")),d.writeln(""),a.length===0)d.writeln(c(" No specs yet."));else for(let s of a){let v=s.active?S("\u25CF"):c("\u25CB"),w=s.active?l(s.name):c(s.name),j=s.phase==="DONE"?S(s.phase):s.phase==="EXECUTING"?C(s.phase):s.phase==="BLOCKED"?m(s.phase):x(s.phase),F=s.phase==="EXECUTING"?c(` iteration ${s.iteration}`):"";d.writeln(" ",v," ",w," ",j,F)}return await d.close(),f(void 0)},q=async n=>{let e=$({renderer:D.ansi(),sink:y.stdout()}),t=u.process.cwd(),r=n?.[0];if(r===void 0||r.length===0)return e.writeln(m("Please provide a spec name: "),l(`${b()} spec switch my-feature`)),await e.close(),h({exitCode:1});let i=await P(t),p=await E(t);i!==null&&p.spec!==null&&await I(t,i,p);let o=await A(t,r),a=await u.fs.stat(`${t}/${g.specDir(r)}`).then(()=>!0).catch(()=>!1);return o.phase==="IDLE"&&!a?(e.writeln(m(`Spec "${r}" not found.`)),e.writeln(c(`Run \`${k("spec list")}\` to see available specs.`)),await e.close(),h({exitCode:1})):(await N(t,o),e.writeln(S("\u2714")," Switched to: ",l(r)," (",C(o.phase),")"),o.phase==="EXECUTING"&&(e.writeln(c(` Iteration: ${o.execution.iteration}`)),o.execution.lastProgress!==null&&e.writeln(c(` Progress: ${o.execution.lastProgress}`))),await e.close(),f(void 0))};export{_ as main};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as f,e as I}from"./chunk-6FNHSIZJ.js";import{a as P}from"./chunk-25FUVC3C.js";import"./chunk-OCPEFZBJ.js";import{c as w}from"./chunk-CBGABZ5E.js";import{a as v,d as h}from"./chunk-2EVWKUN6.js";import{d as y,j as b,n as D,q as k}from"./chunk-VD5ZJBSR.js";import"./chunk-JYNHFD6B.js";import{f as d,h as m,k as u}from"./chunk-GBM3TZFD.js";import{c as i,d as r,f as p,g as E,h as o,k as x}from"./chunk-3SXTMY75.js";import{a as c,b as g}from"./chunk-A6RDYP6R.js";import{t as C}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var K=async O=>{let t=C.process.cwd(),a=v(O);if(!await k(t)){if(a==="json")await h({error:"noskills is not initialized"},a);else{let s=d({renderer:u.ansi(),sink:m.stdout()});s.writeln(p("noskills is not initialized.")," Run: ",i(w("init"))),await s.close()}return g({exitCode:1})}let e=await y(t),n=await b(t),S={phase:e.phase,spec:e.spec,branch:e.branch,discovery:e.phase==="DISCOVERY"?{answered:e.discovery.answers.length,total:f.length}:void 0,execution:e.phase==="EXECUTING"||e.phase==="BLOCKED"?{iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,debt:e.execution.debt?.items.length??0,verificationPassed:e.execution.lastVerification?.passed??null}:void 0,concerns:n?.concerns??[],tools:n?.tools??[],decisions:e.decisions.length,pendingClear:e.pendingClear};if(a==="json"){let l=(await D(t)).filter(N=>n!==null&&n.concerns.includes(N.id)),$=await P(t),j=I(e,l,$,n);return await h({...S,...j},"json"),c(void 0)}{let s=d({renderer:u.ansi(),sink:m.stdout()});s.writeln(i(`${w("status")}`)),s.writeln("");let l=e.phase==="DONE"?E(e.phase):e.phase==="BLOCKED"?p(e.phase):e.phase==="EXECUTING"?x(e.phase):o(e.phase);s.writeln(" Phase: ",l),e.spec!==null&&s.writeln(" Spec: ",i(e.spec)),e.branch!==null&&s.writeln(" Branch: ",e.branch),e.phase==="DISCOVERY"&&s.writeln(` Discovery: ${e.discovery.answers.length}/${f.length} questions answered`),e.phase==="EXECUTING"&&(s.writeln(` Iteration: ${e.execution.iteration}`),e.execution.lastProgress!==null&&s.writeln(" Progress: ",r(e.execution.lastProgress)),e.execution.debt!==null&&s.writeln(o(` Debt: ${e.execution.debt.items.length} items`))),n!==null&&(s.writeln(""),n.concerns.length>0&&s.writeln(" Concerns: ",r(n.concerns.join(", "))),n.tools.length>0&&s.writeln(" Tools: ",r(n.tools.join(", ")))),e.decisions.length>0&&(s.writeln(""),s.writeln(` Decisions: ${e.decisions.length}`)),e.pendingClear&&(s.writeln(""),s.writeln(o(" \u26A0 Context clear pending \u2014 run `/clear`"))),await s.close()}return c(void 0)};export{K as main};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{b as w}from"./chunk-JAQN64PH.js";import{a as g}from"./chunk-LNNNLUZT.js";import{j as u}from"./chunk-WG6J7DFO.js";import"./chunk-JYNHFD6B.js";import{f as p,h as d,k as f}from"./chunk-GBM3TZFD.js";import{c as m,d as r,f as c,g as n}from"./chunk-3SXTMY75.js";import{a as o,b as a}from"./chunk-A6RDYP6R.js";import{t as l}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var v=async h=>{let s=p({renderer:f.ansi(),sink:d.stdout()}),t=l.process.cwd(),e=await u(t);if(e===null)return s.writeln(c("noskills is not initialized.")," Run: ",m(g("init",e))),await s.close(),a({exitCode:1});s.writeln(r("Syncing tool files..."));let i=await w(t,e.tools,e);for(let y of i)s.writeln(" ",n("\u2714"),` ${y}`);return i.length===0&&s.writeln(r(" No tools configured.")),s.writeln(""),s.writeln(n("Done.")),await s.close(),o(void 0)};export{v as main};
2
+ import{b as w}from"./chunk-25FUVC3C.js";import{c as g}from"./chunk-CBGABZ5E.js";import{j as u}from"./chunk-VD5ZJBSR.js";import"./chunk-JYNHFD6B.js";import{f as p,h as d,k as f}from"./chunk-GBM3TZFD.js";import{c as m,d as r,f as c,g as n}from"./chunk-3SXTMY75.js";import{a as o,b as a}from"./chunk-A6RDYP6R.js";import{t as l}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var v=async h=>{let s=p({renderer:f.ansi(),sink:d.stdout()}),t=l.process.cwd(),e=await u(t);if(e===null)return s.writeln(c("noskills is not initialized.")," Run: ",m(g("init"))),await s.close(),a({exitCode:1});s.writeln(r("Syncing tool files..."));let i=await w(t,e.tools,e);for(let y of i)s.writeln(" ",n("\u2714"),` ${y}`);return i.length===0&&s.writeln(r(" No tools configured.")),s.writeln(""),s.writeln(n("Done.")),await s.close(),o(void 0)};export{v as main};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as e,b as s,c as l,d as o,e as r,f as a}from"./chunk-LOLA6ZSE.js";import"./chunk-5GGGQJ4P.js";import"./chunk-J2Z7NG2X.js";import"./chunk-GBM3TZFD.js";import"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import"./chunk-FKITIXO2.js";import"./chunk-PWLF3WXM.js";import{b as n}from"./chunk-PZNCE6QK.js";import"./chunk-MG65QJY6.js";import"./chunk-A6RDYP6R.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var i=new n("system").description("Commands related with this CLI").command(new n("install").description("Install eser CLI globally").run(e)).command(new n("uninstall").description("Uninstall eser CLI globally").run(s)).command(new n("update").description("Update eser CLI to the latest version").run(l)).command(new n("completions").description("Generate shell completion scripts").flag({name:"shell",type:"string",description:"Shell type: bash, zsh, or fish"}).run(o)).command(new n("version").description("Show version and check for updates").flag({name:"bare",type:"boolean",description:"Print version number only"}).run(r)).command(new n("doctor").description("Run diagnostic checks").run(a));export{i as systemCommand};
2
+ import{a as e,b as s,c as l,d as o,e as r,f as a}from"./chunk-CZS6DCUY.js";import"./chunk-5GGGQJ4P.js";import"./chunk-J2Z7NG2X.js";import"./chunk-GBM3TZFD.js";import"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import"./chunk-LKF6GBNU.js";import"./chunk-PWLF3WXM.js";import{b as n}from"./chunk-PZNCE6QK.js";import"./chunk-MG65QJY6.js";import"./chunk-A6RDYP6R.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var i=new n("system").description("Commands related with this CLI").command(new n("install").description("Install eser CLI globally").run(e)).command(new n("uninstall").description("Uninstall eser CLI globally").run(s)).command(new n("update").description("Update eser CLI to the latest version").run(l)).command(new n("completions").description("Generate shell completion scripts").flag({name:"shell",type:"string",description:"Shell type: bash, zsh, or fish"}).run(o)).command(new n("version").description("Show version and check for updates").flag({name:"bare",type:"boolean",description:"Print version number only"}).run(r)).command(new n("doctor").description("Run diagnostic checks").run(a));export{i as systemCommand};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as S,c as E}from"./chunk-IDMI5OBK.js";import{a as C,c as M}from"./chunk-2EVWKUN6.js";import{d as T,j as y,q as b}from"./chunk-WG6J7DFO.js";import"./chunk-JYNHFD6B.js";import{a as x,b as k}from"./chunk-A6RDYP6R.js";import{t as m}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var D=async e=>{let s=await T(e),l=await y(e),d=await L(e),o=null,u=null,n=0,c=0;if(s.spec!==null){let i=await S(e,s.spec);if(i!==null){n=i.tasks.length,c=s.execution.completedTasks.length;let a=E(i.tasks,s.execution.completedTasks);a!==null&&(o=a.id,u=a.title)}}let $=null;return s.lastCalledAt!==null&&($=Math.floor((Date.now()-new Date(s.lastCalledAt).getTime())/1e3)),{spec:s.spec,phase:s.phase,iteration:s.execution.iteration,activeTaskId:o,activeTaskTitle:u,totalTasks:n,completedTaskCount:c,lastProgress:s.execution.lastProgress,lastCalledAt:s.lastCalledAt,modifiedFiles:s.execution.modifiedFiles,debt:s.execution.debt,concerns:l?.concerns??[],maxIterations:l?.maxIterationsBeforeRestart??15,awaitingStatusReport:s.execution.awaitingStatusReport,pendingClear:s.pendingClear,verificationPassed:s.execution.lastVerification?.passed??null,decisionsCount:s.decisions.length,discoveryAnswered:s.discovery.answers.length,discoveryTotal:6,trackedFiles:d,timeSinceUpdate:$}},L=async e=>{let s=`${e}/.eser/.state/files-changed.jsonl`;try{let d=(await m.fs.readTextFile(s)).trim().split(`
2
+ import{a as S,c as E}from"./chunk-IDMI5OBK.js";import{a as C,c as M}from"./chunk-2EVWKUN6.js";import{d as T,j as y,q as b}from"./chunk-VD5ZJBSR.js";import"./chunk-JYNHFD6B.js";import{a as x,b as k}from"./chunk-A6RDYP6R.js";import{t as m}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var D=async e=>{let s=await T(e),l=await y(e),d=await L(e),o=null,u=null,n=0,c=0;if(s.spec!==null){let i=await S(e,s.spec);if(i!==null){n=i.tasks.length,c=s.execution.completedTasks.length;let a=E(i.tasks,s.execution.completedTasks);a!==null&&(o=a.id,u=a.title)}}let $=null;return s.lastCalledAt!==null&&($=Math.floor((Date.now()-new Date(s.lastCalledAt).getTime())/1e3)),{spec:s.spec,phase:s.phase,iteration:s.execution.iteration,activeTaskId:o,activeTaskTitle:u,totalTasks:n,completedTaskCount:c,lastProgress:s.execution.lastProgress,lastCalledAt:s.lastCalledAt,modifiedFiles:s.execution.modifiedFiles,debt:s.execution.debt,concerns:l?.concerns??[],maxIterations:l?.maxIterationsBeforeRestart??15,awaitingStatusReport:s.execution.awaitingStatusReport,pendingClear:s.pendingClear,verificationPassed:s.execution.lastVerification?.passed??null,decisionsCount:s.decisions.length,discoveryAnswered:s.discovery.answers.length,discoveryTotal:6,trackedFiles:d,timeSinceUpdate:$}},L=async e=>{let s=`${e}/.eser/.state/files-changed.jsonl`;try{let d=(await m.fs.readTextFile(s)).trim().split(`
3
3
  `).filter(Boolean),o=[];for(let u of d)try{let n=JSON.parse(u);o.includes(n.file)||o.push(n.file)}catch{}return o}catch{return[]}},F="\x1B[2J\x1B[H",I="\x1B[1m",r="\x1B[2m",t="\x1B[0m",f="\x1B[32m",p="\x1B[33m",w="\x1B[31m",P="\x1B[36m",O=e=>{switch(e){case"DONE":return f;case"BLOCKED":return w;case"EXECUTING":return P;default:return p}},A=(e,s,l)=>{if(s===0)return"\u2591".repeat(l);let d=Math.min(e/s,1),o=Math.round(d*l);return"\u2588".repeat(o)+"\u2591".repeat(l-o)},v=e=>e===null?"never":e<60?`${e}s ago`:e<3600?`${Math.floor(e/60)}m ago`:`${Math.floor(e/3600)}h ago`,R=e=>{let s=[],d="\u2500".repeat(52);s.push(`${r}\u256D${d}\u256E${t}`),s.push(`${r}\u2502${t} ${I}noskills watch${t} \u2014 ${e.spec??"no active spec"}${r}${" ".repeat(Math.max(0,34-(e.spec?.length??15)))}\u2502${t}`);let o=O(e.phase);if(s.push(`${r}\u2502${t} Phase: ${o}${e.phase}${t}${" ".repeat(Math.max(0,42-e.phase.length))}${r}\u2502${t}`),e.phase==="DISCOVERY")s.push(`${r}\u2502${t} Discovery: ${e.discoveryAnswered}/${e.discoveryTotal} questions answered${" ".repeat(Math.max(0,14))}${r}\u2502${t}`);else if(e.phase==="SPEC_DRAFT")s.push(`${r}\u2502${t} ${p}Awaiting approval${t}${" ".repeat(Math.max(0,33))}${r}\u2502${t}`);else if(e.phase==="EXECUTING"||e.phase==="BLOCKED"){let n=A(e.completedTaskCount,e.totalTasks,12),c=e.totalTasks>0?Math.round(e.completedTaskCount/e.totalTasks*100):0,$=`${n} ${e.completedTaskCount}/${e.totalTasks} tasks (${c}%)`;if(s.push(`${r}\u2502${t} Progress: ${f}${$}${t}${" ".repeat(Math.max(0,40-$.length))}${r}\u2502${t}`),s.push(`${r}\u2502${t} Iteration: ${e.iteration}${" ".repeat(Math.max(0,38-String(e.iteration).length))}${r}\u2502${t}`),e.activeTaskId!==null){let a=`${e.activeTaskId}${e.activeTaskTitle!==null?` (${e.activeTaskTitle})`:""}`.slice(0,36);s.push(`${r}\u2502${t} Active task: ${P}${a}${t}${" ".repeat(Math.max(0,36-a.length))}${r}\u2502${t}`)}if(e.phase==="BLOCKED"){let i=(e.lastProgress??"unknown").replace(/^BLOCKED:\s*/,"");s.push(`${r}\u2502${t} ${w}BLOCKED: ${i.slice(0,40)}${t}${" ".repeat(Math.max(0,40-i.slice(0,40).length))}${r}\u2502${t}`),s.push(`${r}\u2502${t} ${p}Human input needed${t}${" ".repeat(Math.max(0,32))}${r}\u2502${t}`)}}else e.phase==="DONE"&&s.push(`${r}\u2502${t} ${f}Complete!${t} ${e.iteration} iterations, ${e.decisionsCount} decisions${" ".repeat(Math.max(0,17-String(e.iteration).length-String(e.decisionsCount).length))}${r}\u2502${t}`);if(s.push(`${r}\u2502${"".padEnd(52)}\u2502${t}`),s.push(`${r}\u2502${t} Last update: ${v(e.timeSinceUpdate)}${" ".repeat(Math.max(0,36-v(e.timeSinceUpdate).length))}${r}\u2502${t}`),e.lastProgress!==null){let n=e.lastProgress.slice(0,48);s.push(`${r}\u2502${t} ${r}${n}${t}${" ".repeat(Math.max(0,50-n.length))}${r}\u2502${t}`)}if(e.awaitingStatusReport&&s.push(`${r}\u2502${t} ${p}Status report pending${t}${" ".repeat(Math.max(0,29))}${r}\u2502${t}`),e.pendingClear&&s.push(`${r}\u2502${t} ${p}/clear pending${t}${" ".repeat(Math.max(0,36))}${r}\u2502${t}`),e.verificationPassed===!1&&s.push(`${r}\u2502${t} ${w}Verification failed${t}${" ".repeat(Math.max(0,31))}${r}\u2502${t}`),s.push(`${r}\u2502${"".padEnd(52)}\u2502${t}`),e.debt!==null&&e.debt.items.length>0){s.push(`${r}\u2502${t} Debt: ${e.debt.items.length} item(s)${" ".repeat(Math.max(0,34))}${r}\u2502${t}`);for(let n of e.debt.items.slice(0,3)){let c=n.slice(0,44);s.push(`${r}\u2502${t} \u2514\u2500 ${c}${" ".repeat(Math.max(0,46-c.length))}${r}\u2502${t}`)}e.debt.items.length>3&&s.push(`${r}\u2502${t} \u2514\u2500 ... and ${e.debt.items.length-3} more${" ".repeat(Math.max(0,32))}${r}\u2502${t}`)}if(e.trackedFiles.length>0||e.modifiedFiles.length>0){let n=e.trackedFiles.length>0?e.trackedFiles:e.modifiedFiles;s.push(`${r}\u2502${t} Files changed: ${n.length}${" ".repeat(Math.max(0,34-String(n.length).length))}${r}\u2502${t}`);for(let c of n.slice(0,5)){let $=c.length>44?"..."+c.slice(-41):c;s.push(`${r}\u2502${t} \u2514\u2500 ${$}${" ".repeat(Math.max(0,46-$.length))}${r}\u2502${t}`)}n.length>5&&s.push(`${r}\u2502${t} \u2514\u2500 ... and ${n.length-5} more${" ".repeat(Math.max(0,32))}${r}\u2502${t}`)}if(s.push(`${r}\u2502${"".padEnd(52)}\u2502${t}`),e.concerns.length>0){let n=e.concerns.join(", ").slice(0,38);s.push(`${r}\u2502${t} Concerns: ${n}${" ".repeat(Math.max(0,40-n.length))}${r}\u2502${t}`)}let u=e.iteration>=e.maxIterations?`${w}RESTART RECOMMENDED${t}`:`${f}ok${t} (${e.iteration}/${e.maxIterations})`;return s.push(`${r}\u2502${t} Context: ${u}${" ".repeat(Math.max(0,41-u.replace(/\x1b\[[0-9;]*m/g,"").length))}${r}\u2502${t}`),s.push(`${r}\u2570${d}\u256F${t}`),s.push(` ${r}watching .eser/.state/ for changes... (ctrl+c to stop)${t}`),s.join(`
4
4
  `)},W=e=>JSON.stringify({ts:new Date().toISOString(),phase:e.phase,spec:e.spec,iteration:e.iteration,activeTask:e.activeTaskId,tasks:{completed:e.completedTaskCount,total:e.totalTasks},progress:e.lastProgress,debt:e.debt?.items.length??0,filesChanged:e.trackedFiles.length>0?e.trackedFiles:e.modifiedFiles,timeSinceUpdate:e.timeSinceUpdate,pendingClear:e.pendingClear,verificationPassed:e.verificationPassed}),J=async e=>{let s=m.process.cwd(),l=C(e);if(!await b(s)){let i=new TextEncoder,a=m.process.stdout.getWriter();return await a.write(i.encode(`noskills not initialized.
5
5
  `)),a.releaseLock(),k({exitCode:1})}let d=`${s}/.eser/.state`,o="",u=async()=>{let i=await D(s),a=l==="json"?W(i):l==="markdown"?M(i,"markdown"):R(i);if(l==="json"){let g=new TextEncoder,h=m.process.stdout.getWriter();await h.write(g.encode(a+`
package/eser.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
3
- import{a as u}from"./chunks/chunk-FKITIXO2.js";import{a as m}from"./chunks/chunk-4MVO4LD5.js";import"./chunks/chunk-PWLF3WXM.js";import{a as o}from"./chunks/chunk-KVTG56GS.js";import{b as a}from"./chunks/chunk-PZNCE6QK.js";import"./chunks/chunk-MG65QJY6.js";import{b as d,e as c}from"./chunks/chunk-A6RDYP6R.js";import{t as p}from"./chunks/chunk-MRCBHVSB.js";import"./chunks/chunk-Y4ARZGGL.js";import"./chunks/chunk-STI6DX7K.js";import"./chunks/chunk-DTO2YJWZ.js";import"./chunks/chunk-G6NAG2EK.js";var g=new o({description:"Kit \u2014 recipes, templates, project creation",modules:{add:{description:"Add a recipe to your project",category:"Distribution",load:()=>import("./chunks/add-5SDE43IH.js")},list:{description:"Browse available recipes and templates",category:"Distribution",load:()=>import("./chunks/list-PY3A762R.js")},new:{description:"Create a new project from a template",category:"Distribution",load:()=>import("./chunks/new-BOGCXTIY.js")},clone:{description:"Clone a recipe from any GitHub repo",category:"Distribution",load:()=>import("./chunks/clone-H3UAEVVP.js")},update:{description:"Re-fetch and update an applied recipe",category:"Distribution",load:()=>import("./chunks/update-4C4WNXCE.js")}},aliases:{create:"new"}});var f=new o({description:"Codebase management tools",modules:{scaffolding:{description:"Initialize project from template",category:"Setup",load:()=>import("./chunks/mod-PFWQZF3T.js")},install:{description:"Install git hooks from .eser/manifest.yml",category:"Setup",load:()=>import("./chunks/install-KNZDCGIB.js")},uninstall:{description:"Remove managed git hooks",category:"Setup",load:async()=>({main:(await import("./chunks/install-KNZDCGIB.js")).uninstallMain})},status:{description:"Show git hook installation status",category:"Setup",load:async()=>({main:(await import("./chunks/install-KNZDCGIB.js")).statusMain})},commitmsg:{description:"Generate commit message from git diff",category:"AI",load:()=>import("./chunks/commitmsg-7XZGGERO.js")},gh:{description:"GitHub operations (contributors, releases, tags)",category:"GitHub",load:()=>import("./chunks/gh-L25JQWOY.js")},versions:{description:"Manage workspace package versions",category:"Release",load:()=>import("./chunks/versions-ODYWYT7U.js")},"changelog-gen":{description:"Generate CHANGELOG from commits",category:"Release",load:()=>import("./chunks/changelog-gen-MX6L2Z24.js")},release:{description:"Create a release (bump, changelog, commit, push)",category:"Release",load:()=>import("./chunks/release-J3PVDROM.js")},rerelease:{description:"Delete and recreate the current version tag",category:"Release",load:async()=>({main:(await import("./chunks/release-J3PVDROM.js")).rereleaseMain})},unrelease:{description:"Delete the current version tag",category:"Release",load:async()=>({main:(await import("./chunks/release-J3PVDROM.js")).unreleaseMain})},"validate-eof":{description:"Ensure files end with newline",category:"Validation",load:()=>import("./chunks/validate-eof-DTFV74VL.js")},"validate-trailing-whitespace":{description:"Remove trailing whitespace",category:"Validation",load:()=>import("./chunks/validate-trailing-whitespace-GRE2PJ6T.js")},"validate-bom":{description:"Remove UTF-8 byte order markers",category:"Validation",load:()=>import("./chunks/validate-bom-QVE5HNBO.js")},"validate-line-endings":{description:"Normalize line endings to LF",category:"Validation",load:()=>import("./chunks/validate-line-endings-PFF6QJ3W.js")},"validate-large-files":{description:"Detect files exceeding size limit",category:"Validation",load:()=>import("./chunks/validate-large-files-X5YF7D7T.js")},"validate-case-conflict":{description:"Detect case-conflicting filenames",category:"Validation",load:()=>import("./chunks/validate-case-conflict-XFS3URQN.js")},"validate-merge-conflict":{description:"Detect merge conflict markers",category:"Validation",load:()=>import("./chunks/validate-merge-conflict-KB2X6QLW.js")},"validate-json":{description:"Validate JSON syntax",category:"Validation",load:()=>import("./chunks/validate-json-KMODGNSU.js")},"validate-toml":{description:"Validate TOML syntax",category:"Validation",load:()=>import("./chunks/validate-toml-SG4IITMN.js")},"validate-yaml":{description:"Validate YAML syntax",category:"Validation",load:()=>import("./chunks/validate-yaml-RA22QNW6.js")},"validate-symlinks":{description:"Detect broken symlinks",category:"Validation",load:()=>import("./chunks/validate-symlinks-4LOWK2MQ.js")},"validate-shebangs":{description:"Validate shebang consistency",category:"Validation",load:()=>import("./chunks/validate-shebangs-WC66D7RK.js")},"validate-secrets":{description:"Detect credentials and private keys",category:"Validation",load:()=>import("./chunks/validate-secrets-RM6DMZVG.js")},"validate-filenames":{description:"Enforce filename conventions",category:"Validation",load:()=>import("./chunks/validate-filenames-J4RTDEBD.js")},"validate-submodules":{description:"Detect git submodules",category:"Validation",load:()=>import("./chunks/validate-submodules-SPAXASAG.js")},"validate-commit-msg":{description:"Validate conventional commit format",category:"Validation",load:()=>import("./chunks/validate-commit-msg-BPESCI7P.js")},"validate-docs":{description:"Validate JSDoc documentation",category:"Validation",load:()=>import("./chunks/validate-docs-ITL4L6KY.js")},"validate-circular-deps":{description:"Detect circular dependencies",category:"Validation",load:()=>import("./chunks/validate-circular-deps-BMPAT3PF.js")},"validate-export-names":{description:"Validate export naming conventions",category:"Validation",load:()=>import("./chunks/validate-export-names-HLOH7D73.js")},"validate-licenses":{description:"Validate license headers",category:"Validation",load:()=>import("./chunks/validate-licenses-OZ7DXQTY.js")},"validate-mod-exports":{description:"Validate mod.ts export coverage",category:"Validation",load:()=>import("./chunks/validate-mod-exports-VHK2NVKI.js")},"validate-package-configs":{description:"Validate package configurations",category:"Validation",load:()=>import("./chunks/validate-package-configs-ZNCAIYRO.js")}},aliases:{init:"scaffolding"}});var l=e=>new o({description:"Workflow engine \u2014 run tool pipelines",modules:{run:{description:"Run workflows by event or id",load:async()=>{let t=await import("./chunks/run-RGEZUAPM.js");return{main:r=>t.main(r,{tools:e??[]})}}},list:{description:"List available workflows and tools",load:async()=>{let t=await import("./chunks/list-N4ZKDFW7.js");return{main:r=>t.main(r,{tools:e??[]})}}}}}),R=l();var y=new o({description:"noskills \u2014 state-machine orchestrator for AI agents",modules:{init:{description:"Initialize noskills in project",load:()=>import("./chunks/init-2FLT3GXG.js")},status:{description:"Show current state",load:()=>import("./chunks/status-RCEYJVRQ.js")},spec:{description:"Manage specs (new, list)",load:()=>import("./chunks/spec-3UGU4UBE.js")},next:{description:"Get next instruction for agent",load:()=>import("./chunks/next-ARUY5FHZ.js")},approve:{description:"Approve phase transition",load:()=>import("./chunks/approve-XNUZYGYJ.js")},block:{description:"Mark spec as blocked",load:()=>import("./chunks/block-NWIP4USQ.js")},reset:{description:"Reset current spec state",load:()=>import("./chunks/reset-EYLAZVKO.js")},done:{description:"Mark spec execution as complete",load:()=>import("./chunks/done-DIN56LXZ.js")},concern:{description:"Manage concerns (add, remove, list)",load:()=>import("./chunks/concern-UCYEAXJ4.js")},run:{description:"Autonomous execution loop (Ralph loop)",load:()=>import("./chunks/run-TL4KPOGO.js")},watch:{description:"Live dashboard for monitoring agent progress",load:()=>import("./chunks/watch-YKYNWTZF.js")},sync:{description:"Regenerate tool-specific files",load:()=>import("./chunks/sync-M7MKXMYN.js")},purge:{description:"Remove all noskills content (specs, rules, concerns, hooks)",load:()=>import("./chunks/purge-XYNNHOEN.js")},"invoke-hook":{description:"Internal hook handlers (called by agents)",load:()=>import("./chunks/invoke-hook-PADL4W3J.js")},rule:{description:"Manage rules (add, list, promote)",load:()=>import("./chunks/rule-JMNIMEH3.js")}}});var w=new o({description:"laroux.js framework commands",modules:{init:{description:"Create a new laroux.js project",load:()=>import("./chunks/init-J4IHOVZL.js"),flags:[{name:"template",short:"t",type:"string",description:"Project template (minimal, blog, dashboard, docs)",default:"minimal"},{name:"force",short:"f",type:"boolean",description:"Overwrite existing files"},{name:"no-git",type:"boolean",description:"Skip git initialization"},{name:"no-install",type:"boolean",description:"Skip dependency installation"}]},dev:{description:"Start development server with hot reload",load:()=>import("./chunks/dev-PTMXZEVC.js"),flags:[{name:"port",short:"p",type:"number",description:"Server port",default:8e3},{name:"no-hmr",type:"boolean",description:"Disable hot module replacement"},{name:"log-level",type:"string",description:"Log level (debug, info, warn, error)",default:"info"},{name:"open",short:"o",type:"boolean",description:"Open browser automatically"}]},build:{description:"Build for production",load:()=>import("./chunks/build-EJLFNB4I.js"),flags:[{name:"out-dir",type:"string",description:"Output directory",default:"dist"},{name:"clean",type:"boolean",description:"Clean output directory first"},{name:"no-minify",type:"boolean",description:"Disable minification"},{name:"analyze",type:"boolean",description:"Analyze bundle size"},{name:"log-level",type:"string",description:"Log level (debug, info, warn, error)",default:"info"}]},serve:{description:"Serve production build locally",load:()=>import("./chunks/serve-XVAIQ37L.js"),flags:[{name:"port",short:"p",type:"number",description:"Server port",default:8e3},{name:"log-level",type:"string",description:"Log level (debug, info, warn, error)",default:"info"}]}}});var i=new o({description:"Terminal client for Eser's work"});i.addSubmodule({name:"ai"},m);i.addSubmodule({name:"kit"},g);i.addSubmodule({name:"codebase",aliases:["cb","."]},f);await i.addSubmoduleAsync({name:"workflows",aliases:["wf"]},(async()=>{let{getWorkflowTools:e}=await import("./chunks/mod-W3DBWTCY.js");return l(e())})());i.addSubmodule({name:"noskills",aliases:["nos"]},y);i.addSubmodule({name:"laroux"},w);var k=i.toCommand("eser",u.version).lazyCommand("system",{description:"Commands related with this CLI",load:async()=>(await import("./chunks/system-5HS7XXTF.js")).systemCommand}).lazyCommand("install",{description:"Install eser CLI globally (alias for system install)",load:async()=>{let e=await import("./chunks/mod-SDQ3QKKS.js");return new a("install").run(e.installHandler)}}).lazyCommand("update",{description:"Update eser CLI to latest version (alias for system update)",load:async()=>{let e=await import("./chunks/mod-SDQ3QKKS.js");return new a("update").run(e.updateHandler)}}).lazyCommand("version",{description:"Show version number",load:async()=>{let e=await import("./chunks/mod-SDQ3QKKS.js");return new a("version").flag({name:"bare",type:"boolean",description:"Print raw version only"}).run(e.versionHandler)}}).lazyCommand("doctor",{description:"Run diagnostic checks",load:async()=>{let e=await import("./chunks/mod-SDQ3QKKS.js");return new a("doctor").run(e.doctorHandler)}}).fallback(async(e,t)=>{let n=(await(await import("./chunks/manifest-NF2EK757.js")).loadManifest("."))?.scripts;if(n!=null&&typeof n=="object"){let s=n;if(e in s){let v=s[e],{runScript:b}=await import("./chunks/scripts-JK6W2MCO.js");return await b(e,v,s,t)}}return console.error(`Unknown subcommand "${e}"`),d({exitCode:1})}),h=async()=>await k.parse();if(import.meta.main){let e=await h();c(e,{ok:()=>{},fail:t=>{t.message!==void 0&&console.error(t.message),p.process.setExitCode(t.exitCode)}})}export{h as main};
3
+ import{a as u}from"./chunks/chunk-LKF6GBNU.js";import{a as m}from"./chunks/chunk-4MVO4LD5.js";import"./chunks/chunk-PWLF3WXM.js";import{a as o}from"./chunks/chunk-KVTG56GS.js";import{b as a}from"./chunks/chunk-PZNCE6QK.js";import"./chunks/chunk-MG65QJY6.js";import{b as d,e as c}from"./chunks/chunk-A6RDYP6R.js";import{t as p}from"./chunks/chunk-MRCBHVSB.js";import"./chunks/chunk-Y4ARZGGL.js";import"./chunks/chunk-STI6DX7K.js";import"./chunks/chunk-DTO2YJWZ.js";import"./chunks/chunk-G6NAG2EK.js";var g=new o({description:"Kit \u2014 recipes, templates, project creation",modules:{add:{description:"Add a recipe to your project",category:"Distribution",load:()=>import("./chunks/add-5SDE43IH.js")},list:{description:"Browse available recipes and templates",category:"Distribution",load:()=>import("./chunks/list-PY3A762R.js")},new:{description:"Create a new project from a template",category:"Distribution",load:()=>import("./chunks/new-BOGCXTIY.js")},clone:{description:"Clone a recipe from any GitHub repo",category:"Distribution",load:()=>import("./chunks/clone-H3UAEVVP.js")},update:{description:"Re-fetch and update an applied recipe",category:"Distribution",load:()=>import("./chunks/update-4C4WNXCE.js")}},aliases:{create:"new"}});var f=new o({description:"Codebase management tools",modules:{scaffolding:{description:"Initialize project from template",category:"Setup",load:()=>import("./chunks/mod-PFWQZF3T.js")},install:{description:"Install git hooks from .eser/manifest.yml",category:"Setup",load:()=>import("./chunks/install-KNZDCGIB.js")},uninstall:{description:"Remove managed git hooks",category:"Setup",load:async()=>({main:(await import("./chunks/install-KNZDCGIB.js")).uninstallMain})},status:{description:"Show git hook installation status",category:"Setup",load:async()=>({main:(await import("./chunks/install-KNZDCGIB.js")).statusMain})},commitmsg:{description:"Generate commit message from git diff",category:"AI",load:()=>import("./chunks/commitmsg-7XZGGERO.js")},gh:{description:"GitHub operations (contributors, releases, tags)",category:"GitHub",load:()=>import("./chunks/gh-L25JQWOY.js")},versions:{description:"Manage workspace package versions",category:"Release",load:()=>import("./chunks/versions-ODYWYT7U.js")},"changelog-gen":{description:"Generate CHANGELOG from commits",category:"Release",load:()=>import("./chunks/changelog-gen-MX6L2Z24.js")},release:{description:"Create a release (bump, changelog, commit, push)",category:"Release",load:()=>import("./chunks/release-J3PVDROM.js")},rerelease:{description:"Delete and recreate the current version tag",category:"Release",load:async()=>({main:(await import("./chunks/release-J3PVDROM.js")).rereleaseMain})},unrelease:{description:"Delete the current version tag",category:"Release",load:async()=>({main:(await import("./chunks/release-J3PVDROM.js")).unreleaseMain})},"validate-eof":{description:"Ensure files end with newline",category:"Validation",load:()=>import("./chunks/validate-eof-DTFV74VL.js")},"validate-trailing-whitespace":{description:"Remove trailing whitespace",category:"Validation",load:()=>import("./chunks/validate-trailing-whitespace-GRE2PJ6T.js")},"validate-bom":{description:"Remove UTF-8 byte order markers",category:"Validation",load:()=>import("./chunks/validate-bom-QVE5HNBO.js")},"validate-line-endings":{description:"Normalize line endings to LF",category:"Validation",load:()=>import("./chunks/validate-line-endings-PFF6QJ3W.js")},"validate-large-files":{description:"Detect files exceeding size limit",category:"Validation",load:()=>import("./chunks/validate-large-files-X5YF7D7T.js")},"validate-case-conflict":{description:"Detect case-conflicting filenames",category:"Validation",load:()=>import("./chunks/validate-case-conflict-XFS3URQN.js")},"validate-merge-conflict":{description:"Detect merge conflict markers",category:"Validation",load:()=>import("./chunks/validate-merge-conflict-KB2X6QLW.js")},"validate-json":{description:"Validate JSON syntax",category:"Validation",load:()=>import("./chunks/validate-json-KMODGNSU.js")},"validate-toml":{description:"Validate TOML syntax",category:"Validation",load:()=>import("./chunks/validate-toml-SG4IITMN.js")},"validate-yaml":{description:"Validate YAML syntax",category:"Validation",load:()=>import("./chunks/validate-yaml-RA22QNW6.js")},"validate-symlinks":{description:"Detect broken symlinks",category:"Validation",load:()=>import("./chunks/validate-symlinks-4LOWK2MQ.js")},"validate-shebangs":{description:"Validate shebang consistency",category:"Validation",load:()=>import("./chunks/validate-shebangs-WC66D7RK.js")},"validate-secrets":{description:"Detect credentials and private keys",category:"Validation",load:()=>import("./chunks/validate-secrets-RM6DMZVG.js")},"validate-filenames":{description:"Enforce filename conventions",category:"Validation",load:()=>import("./chunks/validate-filenames-J4RTDEBD.js")},"validate-submodules":{description:"Detect git submodules",category:"Validation",load:()=>import("./chunks/validate-submodules-SPAXASAG.js")},"validate-commit-msg":{description:"Validate conventional commit format",category:"Validation",load:()=>import("./chunks/validate-commit-msg-BPESCI7P.js")},"validate-docs":{description:"Validate JSDoc documentation",category:"Validation",load:()=>import("./chunks/validate-docs-ITL4L6KY.js")},"validate-circular-deps":{description:"Detect circular dependencies",category:"Validation",load:()=>import("./chunks/validate-circular-deps-BMPAT3PF.js")},"validate-export-names":{description:"Validate export naming conventions",category:"Validation",load:()=>import("./chunks/validate-export-names-HLOH7D73.js")},"validate-licenses":{description:"Validate license headers",category:"Validation",load:()=>import("./chunks/validate-licenses-OZ7DXQTY.js")},"validate-mod-exports":{description:"Validate mod.ts export coverage",category:"Validation",load:()=>import("./chunks/validate-mod-exports-VHK2NVKI.js")},"validate-package-configs":{description:"Validate package configurations",category:"Validation",load:()=>import("./chunks/validate-package-configs-ZNCAIYRO.js")}},aliases:{init:"scaffolding"}});var l=e=>new o({description:"Workflow engine \u2014 run tool pipelines",modules:{run:{description:"Run workflows by event or id",load:async()=>{let t=await import("./chunks/run-RGEZUAPM.js");return{main:r=>t.main(r,{tools:e??[]})}}},list:{description:"List available workflows and tools",load:async()=>{let t=await import("./chunks/list-N4ZKDFW7.js");return{main:r=>t.main(r,{tools:e??[]})}}}}}),R=l();var y=new o({description:"noskills \u2014 state-machine orchestrator for AI agents",modules:{init:{description:"Initialize noskills in project",load:()=>import("./chunks/init-J46SBNIS.js")},status:{description:"Show current state",load:()=>import("./chunks/status-3C2T6QAE.js")},spec:{description:"Manage specs (new, list)",load:()=>import("./chunks/spec-KTBVG2EX.js")},next:{description:"Get next instruction for agent",load:()=>import("./chunks/next-HAAR572Z.js")},approve:{description:"Approve phase transition",load:()=>import("./chunks/approve-DNKMQSPX.js")},block:{description:"Mark spec as blocked",load:()=>import("./chunks/block-GRKMCTGR.js")},reset:{description:"Reset current spec state",load:()=>import("./chunks/reset-WSJ47SUR.js")},done:{description:"Mark spec execution as complete",load:()=>import("./chunks/done-RZD34AZF.js")},concern:{description:"Manage concerns (add, remove, list)",load:()=>import("./chunks/concern-T2NW35XI.js")},run:{description:"Autonomous execution loop (Ralph loop)",load:()=>import("./chunks/run-K6PMBZEQ.js")},watch:{description:"Live dashboard for monitoring agent progress",load:()=>import("./chunks/watch-NEFCEWP5.js")},sync:{description:"Regenerate tool-specific files",load:()=>import("./chunks/sync-WLEELRJW.js")},purge:{description:"Remove all noskills content (specs, rules, concerns, hooks)",load:()=>import("./chunks/purge-7QJOGWHM.js")},"invoke-hook":{description:"Internal hook handlers (called by agents)",load:()=>import("./chunks/invoke-hook-YTLAPETS.js")},rule:{description:"Manage rules (add, list, promote)",load:()=>import("./chunks/rule-J4FRRKOE.js")}}});var w=new o({description:"laroux.js framework commands",modules:{init:{description:"Create a new laroux.js project",load:()=>import("./chunks/init-J4IHOVZL.js"),flags:[{name:"template",short:"t",type:"string",description:"Project template (minimal, blog, dashboard, docs)",default:"minimal"},{name:"force",short:"f",type:"boolean",description:"Overwrite existing files"},{name:"no-git",type:"boolean",description:"Skip git initialization"},{name:"no-install",type:"boolean",description:"Skip dependency installation"}]},dev:{description:"Start development server with hot reload",load:()=>import("./chunks/dev-PTMXZEVC.js"),flags:[{name:"port",short:"p",type:"number",description:"Server port",default:8e3},{name:"no-hmr",type:"boolean",description:"Disable hot module replacement"},{name:"log-level",type:"string",description:"Log level (debug, info, warn, error)",default:"info"},{name:"open",short:"o",type:"boolean",description:"Open browser automatically"}]},build:{description:"Build for production",load:()=>import("./chunks/build-EJLFNB4I.js"),flags:[{name:"out-dir",type:"string",description:"Output directory",default:"dist"},{name:"clean",type:"boolean",description:"Clean output directory first"},{name:"no-minify",type:"boolean",description:"Disable minification"},{name:"analyze",type:"boolean",description:"Analyze bundle size"},{name:"log-level",type:"string",description:"Log level (debug, info, warn, error)",default:"info"}]},serve:{description:"Serve production build locally",load:()=>import("./chunks/serve-XVAIQ37L.js"),flags:[{name:"port",short:"p",type:"number",description:"Server port",default:8e3},{name:"log-level",type:"string",description:"Log level (debug, info, warn, error)",default:"info"}]}}});var i=new o({description:"Terminal client for Eser's work"});i.addSubmodule({name:"ai"},m);i.addSubmodule({name:"kit"},g);i.addSubmodule({name:"codebase",aliases:["cb","."]},f);await i.addSubmoduleAsync({name:"workflows",aliases:["wf"]},(async()=>{let{getWorkflowTools:e}=await import("./chunks/mod-W3DBWTCY.js");return l(e())})());i.addSubmodule({name:"noskills",aliases:["nos"]},y);i.addSubmodule({name:"laroux"},w);var k=i.toCommand("eser",u.version).lazyCommand("system",{description:"Commands related with this CLI",load:async()=>(await import("./chunks/system-GTHT75OL.js")).systemCommand}).lazyCommand("install",{description:"Install eser CLI globally (alias for system install)",load:async()=>{let e=await import("./chunks/mod-GY6YJWVP.js");return new a("install").run(e.installHandler)}}).lazyCommand("update",{description:"Update eser CLI to latest version (alias for system update)",load:async()=>{let e=await import("./chunks/mod-GY6YJWVP.js");return new a("update").run(e.updateHandler)}}).lazyCommand("version",{description:"Show version number",load:async()=>{let e=await import("./chunks/mod-GY6YJWVP.js");return new a("version").flag({name:"bare",type:"boolean",description:"Print raw version only"}).run(e.versionHandler)}}).lazyCommand("doctor",{description:"Run diagnostic checks",load:async()=>{let e=await import("./chunks/mod-GY6YJWVP.js");return new a("doctor").run(e.doctorHandler)}}).fallback(async(e,t)=>{let n=(await(await import("./chunks/manifest-NF2EK757.js")).loadManifest("."))?.scripts;if(n!=null&&typeof n=="object"){let s=n;if(e in s){let v=s[e],{runScript:b}=await import("./chunks/scripts-JK6W2MCO.js");return await b(e,v,s,t)}}return console.error(`Unknown subcommand "${e}"`),d({exitCode:1})}),h=async()=>await k.parse();if(import.meta.main){let e=await h();c(e,{ok:()=>{},fail:t=>{t.message!==void 0&&console.error(t.message),p.process.setExitCode(t.exitCode)}})}export{h as main};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eser",
3
- "version": "4.1.35",
3
+ "version": "4.1.37",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "eser": "./eser.js"
@@ -1,2 +0,0 @@
1
- import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as C}from"./chunk-XVSIRN6G.js";import{a as P,d as R}from"./chunk-P74JF7XR.js";import"./chunk-IDMI5OBK.js";import{e as y}from"./chunk-UESOCN2G.js";import{a as p}from"./chunk-LNNNLUZT.js";import{d as h,e as S,j as g,n as v}from"./chunk-WG6J7DFO.js";import"./chunk-JYNHFD6B.js";import{f,h as u,k as w}from"./chunk-GBM3TZFD.js";import{c as n,d as c,f as l,g as m,k as d}from"./chunk-3SXTMY75.js";import{a as i}from"./chunk-A6RDYP6R.js";import{t as o}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var $=async E=>{let r=f({renderer:w.ansi(),sink:u.stdout()}),s=o.process.cwd(),e=await h(s),a=await g(s);if(e.phase==="SPEC_DRAFT"){if(e.classification===null&&e.spec!==null){let A=(await v(s)).filter(D=>a?.concerns.includes(D.id)??!1);try{await C(s,e,A)}catch{}}let t=y(e);await S(s,t),t.spec!==null&&(await P(s,t.spec,"approved"),await R(s,t.spec,"approved")),r.writeln(m("\u2714")," Spec approved. Phase: ",d("SPEC_APPROVED")),r.writeln("When ready, run ",n(`${p('next --answer="start"',a)}`)," to begin execution.")}else e.phase==="DISCOVERY"&&e.discovery.completed?(r.writeln(c("Discovery complete. Spec draft already generated.")),r.writeln("Review the spec and run ",n(p("approve",a))," again when in SPEC_DRAFT phase.")):r.writeln(l(`Cannot approve in phase: ${e.phase}`));return await r.close(),i(void 0)};export{$ as main};
@@ -1,2 +0,0 @@
1
- import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{g as k}from"./chunk-UESOCN2G.js";import{a as g}from"./chunk-LNNNLUZT.js";import{d as w,e as f,j as h}from"./chunk-WG6J7DFO.js";import"./chunk-JYNHFD6B.js";import{f as p,h as d,k as u}from"./chunk-GBM3TZFD.js";import{c as i,d as m,f as l,h as c}from"./chunk-3SXTMY75.js";import{a as o,b as n}from"./chunk-A6RDYP6R.js";import{t as a}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var $=async b=>{let e=p({renderer:u.ansi(),sink:d.stdout()}),s=a.process.cwd(),r=b?.join(" ")??"No reason given",t=await w(s),x=await h(s);if(t.phase!=="EXECUTING")return e.writeln(l(`Cannot block in phase: ${t.phase}`)),await e.close(),n({exitCode:1});let y=k(t,r);return await f(s,y),e.writeln(c("\u26A0")," Spec blocked: ",m(r)),e.writeln("Resolve with: ",i(`${g('next --answer="resolution"',x)}`)),await e.close(),o(void 0)};export{$ as main};
@@ -1,2 +0,0 @@
1
- import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{b as o}from"./chunk-N4HITOTN.js";var n=[{id:"status_quo",text:"What does the user do today without this feature?",concerns:["product:status_quo","eng:replace_scope","qa:regression_risk"]},{id:"ambition",text:"Describe the 1-star and 10-star versions.",concerns:["product:scope_direction","eng:complexity_tier","qa:test_depth"]},{id:"reversibility",text:"Does this change involve an irreversible decision?",concerns:["product:one_way_door","eng:migration_strategy","qa:verification_stringency"]},{id:"user_impact",text:"Does this change affect existing users' behavior?",concerns:["product:breaking_change","eng:backward_compat","qa:regression_tests"]},{id:"verification",text:"How do you verify this works correctly?",concerns:["product:success_metric","eng:test_strategy","qa:acceptance_criteria"]},{id:"scope_boundary",text:"What should this feature NOT do?",concerns:["product:focus","eng:out_of_scope","qa:negative_tests"]}],a=t=>n.map(e=>({...e,extras:o(t,e.id)})),c=(t,e)=>{let r=new Set(e.map(s=>s.questionId));for(let s of t)if(!r.has(s.id))return s;return null},d=t=>{let e=new Set(t.map(r=>r.questionId));return n.every(r=>e.has(r.id))};export{n as a,a as b,c,d};
@@ -1,2 +0,0 @@
1
- import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{b as P,d as S}from"./chunk-4GQY3STW.js";import{c as k,d as C}from"./chunk-N4HITOTN.js";import{a as O}from"./chunk-LNNNLUZT.js";var I=null,n=e=>O(e,I),T="NEVER run git write commands (commit, add, push, checkout, stash, reset, merge, rebase, cherry-pick). Git is read-only for agents. The user controls git. You may read: git log, git diff, git status, git show, git blame.",$=(e,o,r,i)=>{let l=e.execution.iteration>=o,s=r?[]:[T],u=i?.outOfScope??[];switch(e.phase){case"IDLE":return{rules:[...s,"Present options to the user using your native interactive question tool (AskUserQuestionTool or equivalent). Do NOT list them as a text table or numbered list.","If no interactive question tool is available, fall back to a concise numbered list.","Do not take action without the user choosing an option first."],tone:"Welcoming. Present choices, then wait."};case"DISCOVERY":return{rules:[...s,"Ask the question exactly as written. Do not rephrase or add your own questions.","Relay the user's answer back verbatim. Do not interpret or summarize.","Do not start coding or exploring the codebase. Discovery is conversation only."],tone:"Conversational. You are a messenger between noskills and the user."};case"SPEC_DRAFT":return{rules:[...s,"Present the spec to the user for review. Do not modify it.","If the user requests changes, relay them \u2014 do not implement them.","Do not start coding. The spec must be approved first."],tone:"Brief. The user is reviewing, not discussing."};case"SPEC_APPROVED":return{rules:[...s,"The spec is approved but execution has not started.","Do not start coding until the user triggers execution.","If the user wants changes, they must reset and re-spec."],tone:"Patient. Wait for the go signal."};case"EXECUTING":{let a=[...s,"Do not explore the codebase beyond what the current task requires.","Do not refactor, improve, or modify code outside this task's scope.","Do not add features, tests, or documentation not specified in the spec.","If you need to read files to understand context, timebox it \u2014 then write code.","The deliverable is working code, not a plan or analysis.","Complete the task, then report progress. The user handles git.",`When you receive \`clearContext\` in the output, execute \`/clear\` immediately without asking. After clearing, read \`CLAUDE.md\` and run \`${n("next")}\`.`,`When you discover a pattern, receive a correction, or identify a recurring preference from the user, ask: 'Should this be a permanent rule for this project, or just for this task?' If permanent, run: \`${n('rule add "<description>"')}\`. If just this task, note it and move on. Never write to \`.eser/rules/\` directly.`];e.execution.lastVerification?.passed===!1&&a.push("Tests are failing. Fix ONLY the failing tests. Do not refactor passing code.");let t={rules:a,tone:"Direct. No preamble. Start coding immediately.",outOfScope:u.length>0?u:void 0};return l?{...t,urgency:`You have been in this session for ${e.execution.iteration}+ iterations. Your context is degrading. Finish the current task and recommend the user start a fresh session. Do not start new tasks.`}:t}case"BLOCKED":return{rules:[...s,"Present the decision to the user exactly as described.","Do not suggest a preferred option unless the user asks for your opinion.","After the user decides, relay the answer immediately. Do not elaborate."],tone:"Brief. The user is making a decision, not having a discussion."};case"DONE":return{rules:[...s,"Report the completion summary. Do not start new work.","If the user wants to continue, they start a new spec."],tone:"Concise. Celebrate briefly, then stop."};default:return{rules:[...s,`Run \`${n("next")}\` to get your instructions.`,"Do not take action without noskills guidance."],tone:"Neutral. Waiting for direction."}}},N=5*60*1e3,B=(e,o)=>{let r;switch(e.phase){case"IDLE":r=`No active spec. Start one with: \`${n("spec new")}\``;break;case"DISCOVERY":r=`Discovery in progress for "${e.spec}". ${e.discovery.answers.length} questions answered so far.`;break;case"SPEC_DRAFT":r=`Spec draft ready for review at ${e.specState.path}. Waiting for approval.`;break;case"SPEC_APPROVED":r=`Spec "${e.spec}" is approved. Waiting to start execution.`;break;case"EXECUTING":r=e.execution.lastProgress!==null?`Executing "${e.spec}", iteration ${e.execution.iteration}. Last progress: ${e.execution.lastProgress}. Continue with the current task.`:`Executing "${e.spec}", iteration ${e.execution.iteration}. Start the first task.`;break;case"BLOCKED":r=`Execution blocked: ${e.execution.lastProgress}. Ask the user to resolve.`;break;case"DONE":r=`Spec "${e.spec}" completed in ${e.execution.iteration} iterations.`;break;default:r=`Run \`${n("next")}\` to get started.`}return{protocol:`Run \`${n('next --answer="..."')}\` to submit results and advance`,spec:e.spec,branch:e.branch,iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,activeConcerns:o.map(i=>i.id),resumeHint:r}},F=e=>{if(e.lastCalledAt===null)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE",how:`Run \`${n("next")}\` for instructions. Submit results with \`${n('next --answer="..."')}\`. Never make architectural decisions without asking.`,currentPhase:e.phase};let o=new Date(e.lastCalledAt).getTime();if(Date.now()-o>N)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE",how:`Run \`${n("next")}\` for instructions. Submit results with \`${n('next --answer="..."')}\`. Never make architectural decisions without asking.`,currentPhase:e.phase}},Q=(e,o,r,i,l,s)=>{I=i??null;let u=B(e,o),a=i?.maxIterationsBeforeRestart??15,t=i?.allowGit??!1,h=$(e,a,t,l),f=F(e),d;switch(e.phase){case"IDLE":d=R(o);break;case"DISCOVERY":d=q(e,o,r);break;case"SPEC_DRAFT":d=L(e);break;case"SPEC_APPROVED":d=_(e);break;case"EXECUTING":d=G(e,o,r,a,l,s);break;case"BLOCKED":d=Y(e);break;case"DONE":d=j(e);break;default:d=R(o)}let m={...d,meta:u,behavioral:h};return f!==void 0&&(m={...m,protocolGuide:f}),e.pendingClear&&(m={...m,clearContext:{action:"clear_context",reason:`Task complete. Run \`/clear\` now. After clearing, read \`CLAUDE.md\` and run \`${n("next")}\` to continue.`},instruction:`Task accepted. Run \`/clear\` immediately to start fresh for the next task. After clearing, run \`${n("next")}\`.`}),m},R=e=>({phase:"IDLE",instruction:"Present the following options to the user using your interactive question tool. Do NOT list them as a text table.",interactiveOptions:[{label:"Start a new feature spec",command:n('spec new "description"')},{label:"Add project concerns",command:n("concern add <id>")},{label:"Add a coding convention",command:n('rule add "rule"')},{label:"Check project status",command:n("status")}],hint:e.length===0?"No concerns active. Consider adding concerns first \u2014 they shape discovery questions and specs.":void 0}),q=(e,o,r)=>{let i=P(o),l=e.discovery.answers.length;if(S(e.discovery.answers))return{phase:"DISCOVERY",instruction:`All discovery questions answered. Run: \`${n("approve")}\``,questions:[],answeredCount:l,context:{rules:r,concernReminders:[]},transition:{onComplete:n("approve")}};let u=new Set(e.discovery.answers.map(t=>t.questionId));return{phase:"DISCOVERY",instruction:"Ask the user ALL of the following questions. Collect answers for each, then submit them all at once as a JSON object.",questions:i.filter(t=>!u.has(t.id)).map(t=>({id:t.id,text:t.text,concerns:[...t.concerns],extras:t.extras.map(h=>h.text)})),answeredCount:l,context:{rules:r,concernReminders:k(o)},transition:{onComplete:`${n(`next --answer='{"status_quo":"...","ambition":"...",...}'`)}`}}},L=e=>e.classification===null?{phase:"SPEC_DRAFT",instruction:"Before generating the spec, classify what this spec involves. Ask the user to select all that apply.",specPath:e.specState.path??"",transition:{onApprove:`${n(`next --answer='{"involvesUI":false,"involvesPublicAPI":false,"involvesMigration":false,"involvesDataHandling":false}'`)}`},classificationRequired:!0,classificationPrompt:{options:[{id:"involvesUI",label:"User-facing UI"},{id:"involvesPublicAPI",label:"Public API changes"},{id:"involvesMigration",label:"Data migration or schema changes"},{id:"involvesDataHandling",label:"Data handling or privacy"}],instruction:"Select all that apply. Submit as JSON: `"+n(`next --answer='{"involvesUI":true,"involvesPublicAPI":false,...}'`)+"`"}}:{phase:"SPEC_DRAFT",instruction:"Spec draft is ready for review. Ask the user to review and approve.",specPath:e.specState.path??"",transition:{onApprove:n("approve")}},_=e=>({phase:"SPEC_APPROVED",instruction:"Spec is approved and ready. When the user is ready to start, begin execution.",specPath:e.specState.path??"",transition:{onStart:`${n('next --answer="start"')}`}}),U=(e,o)=>{if(o===null)return!1;switch(e){case"beautiful-product":return o.involvesUI;case"open-source":return o.involvesPublicAPI;case"long-lived":return o.involvesMigration;case"compliance":return o.involvesDataHandling;default:return!0}},V=(e,o,r,i,l,s,u)=>{let a=[];if(i!==null)for(let t of i.items)a.push(`[DEBT from iteration ${i.fromIteration}] ${t}`);if(o&&a.push(`[FAILED] Tests \u2014 fix this first: ${r.slice(0,200)}`),s!=null)for(let t of s.verification)a.push(t);for(let t of e)if(U(t.id,l)&&t.acceptanceCriteria!==void 0&&t.acceptanceCriteria.length>0)for(let h of t.acceptanceCriteria)a.push(`(${t.id}) ${h}`);if(u!==void 0)for(let t of u)a.push(`(folder: ${t.folder}) ${t.rule}`);return a},G=(e,o,r,i,l,s)=>{let u=C(o),a=e.execution.iteration>=i,t=e.execution.lastVerification?.passed===!1,h=e.execution.lastVerification?.output??"",f=l?.tasks??[],d=e.execution.completedTasks??[],m=new Set(d),D=f.find(p=>!m.has(p.id))??null,y=D!==null?{id:D.id,title:D.title,totalTasks:f.length,completedTasks:d.length}:void 0;if(e.execution.awaitingStatusReport){let p=V(o,t,h,e.execution.debt,e.classification,l,s),b={phase:"EXECUTING",instruction:"Before this task is accepted, report your completion status against these acceptance criteria.",context:{rules:r,concernReminders:k(o)},transition:{onComplete:`${n(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`)}`,onBlocked:`${n('block "reason"')}`,iteration:e.execution.iteration},statusReportRequired:!0,statusReport:{criteria:p,reportFormat:{completed:"list items you finished with evidence (file exists, test passes)",remaining:"list items not yet done",blocked:"list items that need a decision from the user"}}};return t&&(b={...b,verificationFailed:!0,verificationOutput:h.slice(0,2e3)}),b}let w=(e.execution.lastProgress??"").includes("Task not accepted"),x=e.execution.debt?.items??[],E=e.execution.debt?.unaddressedIterations??0,A=y!==void 0?`Execute task ${y.id}: ${y.title} (${y.completedTasks}/${y.totalTasks} completed)`:"All tasks completed. Run `"+n("done")+"` to finish.",v;if(t)v="Verification FAILED. Fix the failing tests before continuing.";else if(w&&x.length>0){let p=E>=3?` These items have been outstanding for ${E} iterations.`:"";v=`Task not accepted \u2014 ${x.length} remaining item(s) must be addressed before this task can be completed.${p} Address them, then submit a new status report.`}else v=A;let c={phase:"EXECUTING",instruction:v,task:y,context:{rules:r,concernReminders:k(o)},transition:{onComplete:`${n('next --answer="..."')}`,onBlocked:`${n('block "reason"')}`,iteration:e.execution.iteration}};if(w&&x.length>0&&(c={...c,taskRejected:!0,rejectionReason:`${x.length} remaining item(s) must be addressed.`,rejectionRemaining:x}),e.execution.debt!==null&&e.execution.debt.items.length>0){let p=e.execution.debt.unaddressedIterations??0,b=p>=3?`URGENT: These items have been unaddressed for ${p} iterations. Address them IMMEDIATELY before any new work.`:"These were not completed in a previous iteration. Address them BEFORE starting new work.";c={...c,previousIterationDebt:{fromIteration:e.execution.debt.fromIteration,items:e.execution.debt.items,note:b}}}if(t){let p=h.slice(0,2e3);c={...c,verificationFailed:!0,verificationOutput:p}}u.length>0&&(c={...c,concernTensions:u}),a&&(c={...c,restartRecommended:!0,restartInstruction:`Context may be getting large after ${e.execution.iteration} iterations. Consider starting a new conversation and running \`${n("next")}\` to resume - your progress is saved.`});let g=[...e.decisions].reverse().find(p=>!p.promoted);return g!==void 0&&e.execution.lastProgress?.startsWith("Resolved:")&&(c={...c,promotePrompt:{decisionId:g.id,question:g.question,choice:g.choice,prompt:`You just resolved a decision: "${g.choice}". Ask the user: "Should this be a permanent rule for future specs too?" If yes, run: \`${n(`rule add "${g.choice}"`)}\``}}),c},Y=e=>({phase:"BLOCKED",instruction:"A decision is needed. Ask the user.",reason:e.execution.lastProgress??"Unknown",transition:{onResolved:`${n('next --answer="..."')}`}}),j=e=>({phase:"DONE",summary:{spec:e.spec,iterations:e.execution.iteration,decisionsCount:e.decisions.length}});export{Q as a};
@@ -1,13 +0,0 @@
1
- import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{c as h}from"./chunk-WG6J7DFO.js";import{t as i}from"./chunk-MRCBHVSB.js";var d="<!-- noskills:start -->",u="<!-- noskills:end -->",w=(t,s,o="npx eser noskills")=>{let e=[d,"## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/rules/`, `.eser/specs/`, or concern files directly.","noskills gives you exactly what you need via JSON output.","","### Protocol","",` ${o} next # get current instruction`,` ${o} next --answer="your response" # submit result and advance`,"","### When to call noskills next","",`You MUST call \`${o} next\` in these situations:`,"","1. At the **START** of every conversation (first thing you do)","2. **BEFORE** creating or modifying any file (to verify you have an active task)","3. **AFTER** completing a logical unit of work (to report progress)","4. When you encounter a **DECISION** that affects architecture or scope","5. When you are **UNSURE** what to do next","","NEVER proceed with implementation without checking noskills first.","NEVER make architectural decisions independently \u2014 noskills routes them to the user."];if((s?.allowGit??!1)||e.push("","### Git is read-only","","You MUST NOT run git write commands: commit, add, push, checkout, stash,","reset, merge, rebase, cherry-pick. The user controls git. You control files.","You MAY read from git: log, diff, status, show, blame."),e.push("","### Convention discovery","","When you discover a pattern, receive a correction, or identify a recurring",'preference from the user, ask: "Should this be a permanent rule for this',`project, or just for this task?" If permanent, run: \`${o} rule add`,'"<description>"`. If just this task, note it and move on.',"Never write to `.eser/rules/` directly.","","### JSON output","","noskills returns JSON with a `phase` field and phase-specific instructions.","The `meta` block contains resume context - use it to orient yourself,","especially after compaction or at the start of a new session.","Follow the `instruction` field. Use `transition` commands to advance state."),t.length>0){e.push("","### Active Rules","");for(let n of t)e.push(`- ${n}`)}return e.push(u),e.join(`
3
- `)},m=async(t,s,o,e="npx eser noskills")=>{let n=`${t}/CLAUDE.md`,a=w(s,o,e),r;try{r=await i.fs.readTextFile(n);let l=r.indexOf(d),c=r.indexOf(u);l!==-1&&c!==-1?r=r.slice(0,l)+a+r.slice(c+u.length):r=r.trimEnd()+`
4
-
5
- `+a+`
6
- `}catch{r=a+`
7
- `}await i.fs.writeTextFile(n,r)};var p=async(t,s,o="npx eser noskills")=>{let e=["# Generated by noskills \u2014 do not edit manually","","## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/specs/` or `.eser/rules/` directly. noskills gives you what you need.","",`Run \`${o} next\` to get your current instruction.`,`Submit results with \`${o} next --answer="..."\``,"","## When to call noskills next","","1. At the START of every conversation","2. BEFORE creating or modifying any file","3. AFTER completing a logical unit of work","4. When you encounter a DECISION that affects architecture","5. When you are UNSURE what to do next","","NEVER proceed with implementation without checking noskills first.",""];if(s.length>0){e.push("## Rules","");for(let n of s)e.push(`- ${n}`);e.push("")}await i.fs.writeTextFile(`${t}/.cursorrules`,e.join(`
8
- `))};var f=async(t,s,o="npx eser noskills")=>{let e=["# Generated by noskills \u2014 do not edit manually","","## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/specs/` or `.eser/rules/` directly. noskills gives you what you need.","",`Run \`${o} next\` to get your current instruction.`,`Submit results with \`${o} next --answer="..."\``,"","## When to call noskills next","","1. At the START of every conversation","2. BEFORE creating or modifying any file","3. AFTER completing a logical unit of work","4. When you encounter a DECISION that affects architecture","5. When you are UNSURE what to do next","","NEVER proceed with implementation without checking noskills first.",""];if(s.length>0){e.push("## Rules","");for(let n of s)e.push(`- ${n}`);e.push("")}await i.fs.mkdir(`${t}/.kiro/steering`,{recursive:!0}),await i.fs.writeTextFile(`${t}/.kiro/steering/conventions.md`,e.join(`
9
- `))};var y=async(t,s,o="npx eser noskills")=>{let e=["# Generated by noskills \u2014 do not edit manually","","## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/specs/` or `.eser/rules/` directly. noskills gives you what you need.","",`Run \`${o} next\` to get your current instruction.`,`Submit results with \`${o} next --answer="..."\``,"","## When to call noskills next","","1. At the START of every conversation","2. BEFORE creating or modifying any file","3. AFTER completing a logical unit of work","4. When you encounter a DECISION that affects architecture","5. When you are UNSURE what to do next","","NEVER proceed with implementation without checking noskills first.",""];if(s.length>0){e.push("## Rules","");for(let n of s)e.push(`- ${n}`);e.push("")}await i.fs.mkdir(`${t}/.github`,{recursive:!0}),await i.fs.writeTextFile(`${t}/.github/copilot-instructions.md`,e.join(`
10
- `))};var k=async(t,s,o="npx eser noskills")=>{let e=["# Generated by noskills \u2014 do not edit manually","","## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/specs/` or `.eser/rules/` directly. noskills gives you what you need.","",`Run \`${o} next\` to get your current instruction.`,`Submit results with \`${o} next --answer="..."\``,"","## When to call noskills next","","1. At the START of every conversation","2. BEFORE creating or modifying any file","3. AFTER completing a logical unit of work","4. When you encounter a DECISION that affects architecture","5. When you are UNSURE what to do next","","NEVER proceed with implementation without checking noskills first.",""];if(s.length>0){e.push("## Rules","");for(let n of s)e.push(`- ${n}`);e.push("")}await i.fs.writeTextFile(`${t}/.windsurfrules`,e.join(`
11
- `))};var S=t=>({hooks:{PreToolUse:[{matcher:"Write|Edit|MultiEdit|Bash",hooks:[{type:"command",command:`${t} invoke-hook pre-tool-use`,timeout:5}]}],PostToolUse:[{matcher:"Write|Edit|MultiEdit",hooks:[{type:"command",command:`${t} invoke-hook post-file-write`,timeout:3}]},{matcher:"Bash",hooks:[{type:"command",command:`${t} invoke-hook post-bash`,timeout:3}]}],Stop:[{hooks:[{type:"command",command:`${t} invoke-hook stop`,timeout:10}]}],SessionStart:[{hooks:[{type:"command",command:`${t} invoke-hook session-start`,timeout:5}]}]}}),g=async(t,s="npx eser noskills")=>{let o=`${t}/.claude/settings.json`,e={};try{let r=await i.fs.readTextFile(o);e=JSON.parse(r)}catch{}let n=S(s),a={...e,...n};await i.fs.mkdir(`${t}/.claude`,{recursive:!0}),await i.fs.writeTextFile(o,JSON.stringify(a,null,2)+`
12
- `)};var $=async t=>{let s=`${t}/${h.rulesDir}`,o=[];try{for await(let e of i.fs.readDir(s))if(e.isFile&&(e.name.endsWith(".md")||e.name.endsWith(".txt"))){let n=await i.fs.readTextFile(`${s}/${e.name}`),a=n.trim().split(`
13
- `)[0]??n.trim();o.push(a)}}catch{}return o},O={cursor:p,kiro:f,copilot:y,windsurf:k},C=async(t,s,o)=>{let e=await $(t),n=[],a={allowGit:o?.allowGit??!1},r=o?.command??"npx eser noskills";for(let l of s){if(l==="claude-code"){await m(t,e,a,r),n.push(l);continue}let c=O[l];c!==void 0&&(await c(t,e,r),n.push(l))}return s.includes("claude-code")&&(await g(t,r),n.push("hooks")),n};export{$ as a,C as b};
@@ -1,2 +0,0 @@
1
- import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- var r="npx eser noskills",o=(n,t)=>`${t?.command??r} ${n}`,c=n=>n?.command??r;export{o as a,c as b};
@@ -1,2 +0,0 @@
1
- import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as C}from"./chunk-N4HITOTN.js";import{a as y,b as P}from"./chunk-LNNNLUZT.js";import{j as g,k as b,l as A,m as x}from"./chunk-WG6J7DFO.js";import"./chunk-JYNHFD6B.js";import{f as p,h as m,k as w}from"./chunk-GBM3TZFD.js";import{c,d as o,f as u,g as v}from"./chunk-3SXTMY75.js";import{a,b as d}from"./chunk-A6RDYP6R.js";import{t as f}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var q=async r=>{let e=r?.[0];if(e==="add")return await $(r?.slice(1));if(e==="remove")return await M(r?.slice(1));if(e==="list")return await I();let i=await g(f.process.cwd()),n=P(i),s=p({renderer:w.ansi(),sink:m.stdout()});return s.writeln(`Usage: ${n} concern <add <id> | remove <id> | list>`),await s.close(),a(void 0)},$=async r=>{let e=p({renderer:w.ansi(),sink:m.stdout()}),i=f.process.cwd(),n=r?.[0],s=await g(i);if(n===void 0||n.length===0)return e.writeln(u("Please provide a concern ID: "),c(y("concern add open-source",s))),await e.close(),d({exitCode:1});let t=await A(i,n);if(t===null&&(t=(await C()).find(h=>h.id===n)??null,t!==null&&await x(i,t)),t===null){let k=await C();return e.writeln(u(`Unknown concern: ${n}`)),k.length>0&&e.writeln(o(` Available: ${k.map(h=>h.id).join(", ")}`)),await e.close(),d({exitCode:1})}if(s===null)return e.writeln(u("noskills not initialized.")),await e.close(),d({exitCode:1});if(s.concerns.includes(n))return e.writeln(o(`Concern "${n}" is already active.`)),await e.close(),a(void 0);let l={...s,concerns:[...s.concerns,n]};return await b(i,l),e.writeln(v("\u2714")," Activated concern: ",c(n)),e.writeln(o(` ${t.description}`)),await e.close(),a(void 0)},M=async r=>{let e=p({renderer:w.ansi(),sink:m.stdout()}),i=f.process.cwd(),n=r?.[0],s=await g(i);if(n===void 0||n.length===0)return e.writeln(u("Please provide a concern ID: "),c(y("concern remove move-fast",s))),await e.close(),d({exitCode:1});if(s===null)return e.writeln(u("noskills not initialized.")),await e.close(),d({exitCode:1});if(!s.concerns.includes(n))return e.writeln(o(`Concern "${n}" is not active.`)),await e.close(),a(void 0);let t={...s,concerns:s.concerns.filter(l=>l!==n)};return await b(i,t),e.writeln(v("\u2714")," Deactivated concern: ",c(n)),await e.close(),a(void 0)},I=async()=>{let r=p({renderer:w.ansi(),sink:m.stdout()}),e=f.process.cwd(),i=await g(e),n=await C(),s=i?.concerns??[];if(r.writeln(c("Concerns")),r.writeln(""),n.length===0)r.writeln(o(" No concerns defined."));else for(let t of n){let l=s.includes(t.id);r.writeln(" ",l?v("\u25CF"):o("\u25CB")," ",l?c(t.id):o(t.id),o(` ${t.description.slice(0,60)}...`))}return await r.close(),a(void 0)};export{q as main};
@@ -1,2 +0,0 @@
1
- import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as C,d as U}from"./chunk-P74JF7XR.js";import{a as E}from"./chunk-UESOCN2G.js";import{a as S}from"./chunk-LNNNLUZT.js";import{d as f,e as h,j as g}from"./chunk-WG6J7DFO.js";import"./chunk-JYNHFD6B.js";import{f as d,h as w,k as u}from"./chunk-GBM3TZFD.js";import{c as n,d as i,f as l,g as m}from"./chunk-3SXTMY75.js";import{a as o,b as p}from"./chunk-A6RDYP6R.js";import{t as c}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var G=async y=>{let e=d({renderer:u.ansi(),sink:w.stdout()}),s=c.process.cwd(),t=await f(s),$=await g(s);if(t.phase!=="EXECUTING")return e.writeln(l(`Cannot complete in phase: ${t.phase}`)),e.writeln(i("Only EXECUTING phase can transition to DONE.")),await e.close(),p({exitCode:1});let r=E(t,"DONE");if(await h(s,r),r.spec!==null&&(await C(s,r.spec,"done"),await U(s,r.spec,"done")),e.writeln(m("\u2714")," Spec completed!"),e.writeln(""),e.writeln(" Spec: ",n(t.spec??"unknown")),e.writeln(` Iterations: ${t.execution.iteration}`),e.writeln(` Decisions: ${t.decisions.length}`),t.decisions.length>0){let a=t.decisions.filter(k=>k.promoted);a.length>0&&e.writeln(i(` Promoted to rules: ${a.length}`))}return e.writeln(""),e.writeln("Start a new spec with: ",n(`${S('spec new "..."',$)}`)),await e.close(),o(void 0)};export{G as main};
@@ -1,2 +0,0 @@
1
- import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as ee,b as te}from"./chunk-SP43S32B.js";import{d as Z}from"./chunk-5GGGQJ4P.js";import{a as V}from"./chunk-E5QQGGNF.js";import{a as Q,b as X}from"./chunk-JAQN64PH.js";import"./chunk-4GQY3STW.js";import{a as b}from"./chunk-N4HITOTN.js";import{a as I}from"./chunk-LNNNLUZT.js";import{d as Y}from"./chunk-2EVWKUN6.js";import{a as J,b as G,e as _,j as q,k as B,m as H,o as K,q as U}from"./chunk-WG6J7DFO.js";import"./chunk-7ZYDAZBD.js";import{a as P,b as M,e as S,f as W,g as z,h as r,i as h}from"./chunk-JOTAKQMZ.js";import"./chunk-JYNHFD6B.js";import{a as F}from"./chunk-46ZWBKIW.js";import"./chunk-GE3LJ6QM.js";import"./chunk-BNQAZLIQ.js";import"./chunk-GBM3TZFD.js";import"./chunk-3SXTMY75.js";import"./chunk-J7YTWK67.js";import"./chunk-PVPMHMKP.js";import"./chunk-4MVO4LD5.js";import"./chunk-KVTG56GS.js";import"./chunk-PZNCE6QK.js";import"./chunk-MG65QJY6.js";import{a as T}from"./chunk-A6RDYP6R.js";import{q as E,t as f}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var se=F;var de=async t=>{try{return await f.fs.stat(t),!0}catch{return!1}},ue=[{id:"claude-code",paths:["CLAUDE.md",".claude"]},{id:"cursor",paths:[".cursorrules",".cursor"]},{id:"kiro",paths:[".kiro"]},{id:"copilot",paths:[".github/copilot-instructions.md"]},{id:"windsurf",paths:[".windsurfrules"]}],ne=async t=>{let e=[];for(let o of ue)for(let s of o.paths)if(await de(`${t}/${s}`)){e.push(o.id);break}return e};var a=async t=>{try{return await f.fs.stat(t),!0}catch{return!1}},oe=async(t,e)=>{try{let o=await f.fs.readTextFile(t);return JSON.parse(o)[e]??null}catch{return null}},fe=async t=>{let e=[];return(await a(`${t}/package.json`)||await a(`${t}/deno.json`))&&e.push("typescript"),await a(`${t}/go.mod`)&&e.push("go"),await a(`${t}/Cargo.toml`)&&e.push("rust"),(await a(`${t}/pyproject.toml`)||await a(`${t}/setup.py`))&&e.push("python"),e},me=async t=>{let e=[],o=await oe(`${t}/package.json`,"dependencies");return o!==null&&("react"in o&&e.push("react"),"vue"in o&&e.push("vue"),"svelte"in o&&e.push("svelte"),"next"in o&&e.push("nextjs"),"express"in o&&e.push("express"),"hono"in o&&e.push("hono")),e},ge=async t=>{let e=[];return await a(`${t}/.github/workflows`)&&e.push("github-actions"),await a(`${t}/.gitlab-ci.yml`)&&e.push("gitlab-ci"),await a(`${t}/Jenkinsfile`)&&e.push("jenkins"),await a(`${t}/.circleci`)&&e.push("circleci"),e},he=async t=>{if(await a(`${t}/deno.json`))return"deno";let e=await oe(`${t}/package.json`,"devDependencies");if(e!==null){if("vitest"in e)return"vitest";if("jest"in e)return"jest";if("playwright"in e)return"playwright"}return null},ie=async t=>{let[e,o,s,d]=await Promise.all([fe(t),me(t),ge(t),he(t)]);return{languages:e,frameworks:o,ci:s,testRunner:d}};var Me=async t=>{let e=f.process.cwd(),o=ee(t),s=M({target:o==="agent"?"non-interactive":"interactive"}),d=te(t),w=re(d,"--concerns"),m=re(d,"--tools"),u=d.includes("--non-interactive")||o==="agent";if(await U(e)){let n=await q(e);return r.warn(s,"noskills is already initialized in this project."),r.info(s,`Run \`${I("sync",n)}\` to regenerate tool files.`),T(void 0)}W(s,"noskills init");let x=h(s,"Scanning project...");x.start();let g=await ie(e);x.succeed("Project scanned");for(let n of g.languages)r.step(s,` ${n}`);for(let n of g.frameworks)r.step(s,` ${n}`);for(let n of g.ci)r.step(s,` ${n}`);g.testRunner!==null&&r.step(s,` test runner: ${g.testRunner}`);let j=h(s,"Detecting coding tools...");j.start();let D=await ne(e),y=Z(),A=y!==null&&!D.includes(y)?[y]:[],C=[...new Set([...A,...D])];j.succeed(`${C.length} coding tool(s) detected`);for(let n of C){let i=n===y?" (current)":"";r.step(s,` ${n}${i}`)}let p;if(m!==null){let n=["claude-code","cursor","kiro","copilot","windsurf"],i=m.filter(l=>n.includes(l));p=[...new Set([...A,...i])]}else u?p=[...C]:p=await Ce(s,C,y);let L=h(s,"Detecting AI providers...");L.start();let $=(await se()).filter(n=>n.available).map(n=>n.name);L.succeed(`${$.length} provider(s) detected`);let k=await b(),c;if(w!==null){let n=k.map(i=>i.id);c=w.filter(i=>n.includes(i)).sort((i,l)=>n.indexOf(i)-n.indexOf(l))}else if(u)c=[];else{let n=k.map(l=>({value:l.id,label:l.name,hint:l.description.slice(0,60)})),i=await S(s,{message:"What kind of project is this? (space to toggle, enter to confirm)",options:n});c=P(i)?[]:[...i]}c.length>0?r.success(s,`Concerns: ${c.join(", ")}`):r.info(s,"No concerns selected. Add later with `concern add <id>`.");let N=await ve(),O=h(s,"Initializing...");O.start(),await K(e);let ae=k.filter(n=>c.includes(n.id));for(let n of ae)await H(e,n);let v={...G(c,p,$,g),command:N};await B(e,v);let R=J();if(await _(e,R),O.succeed("Scaffolded `.eser/`"),p.length>0){let n=h(s,"Syncing tool files...");n.start();let i=await X(e,p,v);n.succeed(`Synced ${i.length} tool(s)`)}else r.warn(s,"No tools selected. noskills will work in agentless CLI mode only."),r.info(s,"Add tools later with `noskills sync`.");if(r.success(s,`Done. ${p.length} tool(s), ${$.length} provider(s), ${c.length} concern(s).`),r.info(s,`Command prefix: ${N}`),o==="agent"){let i=(await b()).filter(le=>c.includes(le.id)),l=await Q(e),ce=V(R,i,l,v);await Y(ce,"json")}else z(s,`Start a spec with: ${I('spec new "..."',v)}`);return T(void 0)},ye=[{value:"claude-code",label:"Claude Code"},{value:"cursor",label:"Cursor"},{value:"kiro",label:"Kiro"},{value:"copilot",label:"GitHub Copilot"},{value:"windsurf",label:"Windsurf"}],Ce=async(t,e,o)=>{let s=e.length===0?"No coding tools detected. Which tools do you use? (space to toggle)":"Any additional tools? (space to toggle, enter to skip)",d=new Set(e),w=await S(t,{message:s,options:ye.map(u=>({...u,hint:u.value===o?"you're running inside it":d.has(u.value)?"detected":void 0,disabled:u.value===o})),initialValues:[...e],required:!1});if(P(w))return[...e];let m=[...w];return o!==null&&!m.includes(o)&&m.unshift(o),m},re=(t,e)=>{if(t===void 0)return null;for(let o of t)if(o.startsWith(`${e}=`))return o.slice(e.length+1).split(",").map(s=>s.trim()).filter(Boolean);return null},ve=async()=>{try{return`${await E({command:"eser",devCommand:"deno task cli",npmPackage:"eser@latest",jsrPackage:"@eser/cli"})} noskills`}catch{return"npx eser@latest noskills"}};export{Me as main};
@@ -1,10 +0,0 @@
1
- import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as D}from"./chunk-E5QQGGNF.js";import{a as C}from"./chunk-JAQN64PH.js";import"./chunk-4GQY3STW.js";import"./chunk-N4HITOTN.js";import{a as d}from"./chunk-LNNNLUZT.js";import{c as g,d as $,j as y,n as x,q as v}from"./chunk-WG6J7DFO.js";import"./chunk-JYNHFD6B.js";import{a as r}from"./chunk-A6RDYP6R.js";import{t as i}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var S=async()=>{let e=i.process.stdin.getReader(),s=[];try{for(;;){let{done:o,value:a}=await e.read();if(o||a===void 0)break;s.push(a)}}finally{e.releaseLock()}let t=0,c=new Uint8Array(s.reduce((o,a)=>o+a.length,0));for(let o of s)c.set(o,t),t+=o.length;let n=new TextDecoder().decode(c);try{return JSON.parse(n)}catch{return{}}},P=async e=>{let s=new TextEncoder,t=i.process.stdout.getWriter();await t.write(s.encode(JSON.stringify(e))),t.releaseLock()},W=async e=>{switch(e?.[0]){case"pre-tool-use":return await T();case"stop":return await F();case"post-file-write":return await E();case"post-bash":return await I();case"session-start":return await N();default:return r(void 0)}},T=async()=>{let e=await S(),s=e.tool_name??"unknown",t=e.tool_input??{},c=e.cwd??i.process.cwd(),n=await y(c),o={};try{o=await $(c)}catch{return r(void 0)}let a=async u=>{await P({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`noskills: ${u}`}})};if(o.pendingClear===!0)return await a(`Task accepted. You must run \`/clear\` and then \`${d("next",n)}\` before continuing.`),r(void 0);if(s==="Bash"){let u=(t.command??"").trim();if(!(n?.allowGit??!1)){let w=["git add","git commit","git push","git merge","git rebase","git checkout","git stash","git reset","git cherry-pick","git tag","git branch -d","git branch -D","git branch -m","git revert","git am","git mv","git rm"];for(let p of w)if(u.startsWith(p)||u.includes(` && ${p}`)||u.includes(`; ${p}`))return await a("git is read-only for agents. The user controls git. You may use `git log`, `git diff`, `git status`, `git show`, `git blame`."),r(void 0)}return r(void 0)}if(!["Write","Edit","MultiEdit"].includes(s))return r(void 0);let m=t.file_path??t.path??"";if(m.includes(".eser/")||m.includes(".claude/"))return r(void 0);let f=o.phase??"UNKNOWN";if(f==="EXECUTING")return r(void 0);let k={IDLE:`No active spec. Run \`${d("spec new",n)}\``,UNINITIALIZED:`noskills not initialized. Run \`${d("init",n)}\``,DISCOVERY:`Discovery in progress. Run \`${d("next",n)}\` to continue.`,SPEC_DRAFT:`Spec needs review. Run \`${d("approve",n)}\``,SPEC_APPROVED:`Start execution first: \`${d('next --answer="start"',n)}\``,BLOCKED:`Execution blocked. Resolve with \`${d('next --answer="resolution"',n)}\``,DONE:`Spec complete. Start a new one or run \`${d("reset",n)}\``};return await a(k[f]??`Run \`${d("next",n)}\` first.`),r(void 0)},F=async()=>{let e=await S();if(e.stop_hook_active===!0)return r(void 0);let s=e.cwd??i.process.cwd(),t;try{let l=await i.fs.readTextFile(`${s}/${g.stateFile}`);t=JSON.parse(l)}catch{return r(void 0)}if(t.phase!=="EXECUTING")return r(void 0);let c=t.execution??{},n=`${s}/${g.stateDir}/files-changed.jsonl`,o=[];try{let w=(await i.fs.readTextFile(n)).trim().split(`
3
- `).filter(Boolean);o=[...new Set(w.map(p=>{try{return JSON.parse(p).file}catch{return null}}).filter(p=>p!==null))]}catch{}let a=[],h="no changes";try{let{execSync:l}=await import("node:child_process");a=l("git diff --name-only",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
4
- `).filter(Boolean);let R=l("git diff --stat",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
5
- `);h=R[R.length-1]??"no changes"}catch{}let m=[...new Set([...o,...a])],f=(c.iteration??0)+1,k=`${s}/${g.stateDir}/iterations`;try{await i.fs.mkdir(k,{recursive:!0}),await i.fs.writeTextFile(`${k}/iteration-${f}.json`,JSON.stringify({iteration:f,files:m,gitStat:h.trim(),timestamp:new Date().toISOString()},null,2)+`
6
- `)}catch{}let u=15;try{let l=await y(s);l!==null&&(u=l.maxIterationsBeforeRestart)}catch{}t.execution={...c,iteration:f,modifiedFiles:m,lastProgress:h.trim()||c.lastProgress||null},t.lastCalledAt=new Date().toISOString();try{await i.fs.writeTextFile(`${s}/${g.stateFile}`,JSON.stringify(t,null,2)+`
7
- `)}catch{}try{await i.fs.writeTextFile(n,"")}catch{}if(f>=u){let l=new TextEncoder,w=i.process.stderr.getWriter();await w.write(l.encode(`noskills: iteration ${f} reached threshold (${u}). Consider starting a fresh conversation.
8
- `)),w.releaseLock()}return r(void 0)},E=async()=>{let e=await S(),s=e.tool_input??{},t=s.file_path??s.path??"";if(!t||t.includes(".eser/")||t.includes(".claude/"))return r(void 0);let c=e.cwd??i.process.cwd(),n=`${c}/${g.stateDir}/files-changed.jsonl`,o=JSON.stringify({file:t,tool:e.tool_name,ts:new Date().toISOString()});try{await i.fs.mkdir(`${c}/${g.stateDir}`,{recursive:!0});let a="";try{a=await i.fs.readTextFile(n)}catch{}await i.fs.writeTextFile(n,a+o+`
9
- `)}catch{}return r(void 0)},I=async()=>{let e=await S(),t=(e.tool_input??{}).command??"";if(!t.includes("noskills"))return r(void 0);let c=e.cwd??i.process.cwd(),n=`${c}/${g.stateDir}/noskills-calls.jsonl`,o=JSON.stringify({command:t,ts:new Date().toISOString()});try{await i.fs.mkdir(`${c}/${g.stateDir}`,{recursive:!0});let a="";try{a=await i.fs.readTextFile(n)}catch{}await i.fs.writeTextFile(n,a+o+`
10
- `)}catch{}return r(void 0)},N=async()=>{let e=i.process.cwd();if(!await v(e))return r(void 0);let s=await $(e),t=await y(e),n=(await x(e)).filter(h=>t!==null&&t.concerns.includes(h.id)),o=await C(e),a=D(s,n,o,t);return await P(a),r(void 0)};export{W as main};
@@ -1,4 +0,0 @@
1
- import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as _}from"./chunk-XVSIRN6G.js";import{a as B,b as H,c as Q,d as z}from"./chunk-P74JF7XR.js";import{a as v}from"./chunk-IDMI5OBK.js";import{a as P}from"./chunk-E5QQGGNF.js";import{a as b}from"./chunk-JAQN64PH.js";import{b as U,c as L,d as N}from"./chunk-4GQY3STW.js";import"./chunk-N4HITOTN.js";import{a as j,c as A,d as G,f as J,h as W}from"./chunk-UESOCN2G.js";import{a as V}from"./chunk-LNNNLUZT.js";import{a as q,b as M,d as x}from"./chunk-2EVWKUN6.js";import{c as O,d as E,j as I,n as $,p as y,q as T}from"./chunk-WG6J7DFO.js";import"./chunk-JYNHFD6B.js";import{a as F,b as D}from"./chunk-A6RDYP6R.js";import{t as h}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var Z=o=>o.split(`
3
- `).map(e=>e.replace(/^[-*]\s+/,"").trim()).filter(e=>e.length>0&&!e.startsWith("#")),ee=async(o,e)=>{let i=[],n=(e.startsWith(o)?e.slice(o.length+1):e).split("/");n.pop();for(let t=n.length;t>=0;t--){let r=`${t===0?o:`${o}/${n.slice(0,t).join("/")}`}/.folder-rules.md`,c=t===0?".":n.slice(0,t).join("/");try{let p=await h.fs.readTextFile(r),g=Z(p);for(let f of g)i.push({folder:c,rule:f})}catch{}}return i},k=async(o,e)=>{let i=new Set,a=[];for(let n of e){let t=await ee(o,n);for(let s of t){let r=`${s.folder}::${s.rule}`;i.has(r)||(i.add(r),a.push(s))}}return a};var ye=async o=>{let e=h.process.cwd(),i=q(o),a=M(o);if(!await T(e)){let l=await I(e);return await x({error:`noskills not initialized. Run: ${V("init",l)}`},i),D({exitCode:1})}let n=null;for(let l of a)l.startsWith("--answer=")&&(n=l.slice(9));let t=await E(e),s=await I(e);if(t.pendingClear&&(t={...t,pendingClear:!1},await y(e,t)),s===null)return await x({error:"No config found"},i),D({exitCode:1});let c=(await $(e)).filter(l=>s.concerns.includes(l.id));if(n!==null){let l=await se(e,t,s,c,n);await y(e,l);let u={...l,lastCalledAt:new Date().toISOString()};await y(e,u);let m=await b(e),d=u.spec!==null?await v(e,u.spec):null,R=await K(e,u),X=await k(e,R),Y=P(u,c,m,s,d,X);return await x(Y,i),F(void 0)}let p={...t,lastCalledAt:new Date().toISOString()};await y(e,p);let g=await b(e),f=p.spec!==null?await v(e,p.spec):null,w=await K(e,p),C=await k(e,w),S=P(p,c,g,s,f,C);return await x(S,i),F(void 0)},se=async(o,e,i,a,n)=>{switch(e.phase){case"DISCOVERY":{let t=null;try{let r=JSON.parse(n);typeof r=="object"&&r!==null&&!Array.isArray(r)&&(t=r)}catch{}let s=e;if(t!==null)for(let[r,c]of Object.entries(t))typeof c=="string"&&c.length>0&&(s=A(s,r,c));else{let r=U(a),c=L(r,s.discovery.answers);if(c===null)return e;s=A(s,c.id,n)}return N(s.discovery.answers)&&(s=G(s)),s}case"SPEC_DRAFT":{if(e.classification===null){let t;try{let r=JSON.parse(n);t={involvesUI:r.involvesUI===!0,involvesPublicAPI:r.involvesPublicAPI===!0,involvesMigration:r.involvesMigration===!0,involvesDataHandling:r.involvesDataHandling===!0}}catch{t={involvesUI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1}}let s={...e,classification:t};try{await _(o,s,a)}catch{}return s}return e}case"SPEC_APPROVED":{let t=J(e);return t.spec!==null&&(await B(o,t.spec,"executing"),await z(o,t.spec,"executing")),t}case"EXECUTING":{if(!e.execution.awaitingStatusReport){let t={...e,execution:{...e.execution,lastProgress:n}};if(i.verifyCommand!==null&&i.verifyCommand!==void 0&&i.verifyCommand.length>0){let s=await ie(o,i.verifyCommand);if(t={...t,execution:{...t.execution,lastVerification:s}},!s.passed)return t}return t={...t,execution:{...t.execution,awaitingStatusReport:!0}},t}return await ne(o,e,n,a)}case"BLOCKED":{let t=e.execution.lastProgress??"Unknown",s={id:`d${e.decisions.length+1}`,question:t.replace(/^BLOCKED:\s*/,""),choice:n,promoted:!1,timestamp:new Date().toISOString()},r=W(e,s);return r=j(r,"EXECUTING"),r={...r,execution:{...r.execution,lastProgress:`Resolved: ${n}`}},r}default:return e}},ne=async(o,e,i,a)=>{let n;try{n=JSON.parse(i)}catch{return{...e,execution:{...e.execution,lastProgress:i,awaitingStatusReport:!1}}}let t=n.completed??[],s=n.remaining??[],r=n.blocked??[],c=[...s,...r],p=e.execution.debt?.unaddressedIterations??0,g=c.length>0?{items:c,fromIteration:e.execution.iteration,unaddressedIterations:1}:null,f=g;if(e.execution.debt!==null&&g!==null){let l=new Set(t.map(d=>d.toLowerCase().trim())),u=e.execution.debt.items.filter(d=>!l.has(d.toLowerCase().trim())),m=[...new Set([...u,...c])];f=m.length>0?{items:m,fromIteration:e.execution.debt.fromIteration,unaddressedIterations:u.length>0?p+1:1}:null}else if(e.execution.debt!==null&&g===null){let l=new Set(t.map(m=>m.toLowerCase().trim())),u=e.execution.debt.items.filter(m=>!l.has(m.toLowerCase().trim()));f=u.length>0?{items:u,fromIteration:e.execution.debt.fromIteration,unaddressedIterations:p+1}:null}let w=t.length>0?`Completed: ${t.join(", ")}`:"Status report submitted",C=e.execution.lastVerification===null||e.execution.lastVerification.passed===!0,S=f===null&&C;if(S&&e.spec!==null){let l=await v(o,e.spec);if(l!==null){let u=e.execution.completedTasks??[],m=new Set(u),d=l.tasks.find(R=>!m.has(R.id));if(d!==void 0)return await H(o,e.spec,d.id),await Q(o,e.spec,d.id,"done"),{...e,pendingClear:!0,execution:{...e.execution,lastProgress:`Task ${d.id} accepted: ${w}`,awaitingStatusReport:!1,debt:f,completedTasks:[...u,d.id]}}}}return{...e,pendingClear:S,execution:{...e.execution,lastProgress:S?w:`Task not accepted \u2014 remaining items must be addressed first. ${w}`,awaitingStatusReport:!1,debt:f}}},ie=async(o,e)=>{try{let{execSync:i}=await import("node:child_process"),a=i(e,{cwd:o,encoding:"utf-8",timeout:6e4,stdio:["pipe","pipe","pipe"]});return{passed:!0,output:String(a).slice(0,4e3),timestamp:new Date().toISOString()}}catch(i){let a=i,n=((a.stdout??"")+(a.stderr??"")).slice(0,4e3);return a.status!==void 0?{passed:!1,output:n||"Verification failed with no output",timestamp:new Date().toISOString()}:{passed:!1,output:`Verification command failed to execute: ${i instanceof Error?i.message:String(i)}`,timestamp:new Date().toISOString()}}},K=async(o,e)=>{let i=[...e.execution.modifiedFiles??[]],a=await re(o);return[...new Set([...i,...a])]},re=async o=>{let e=`${o}/${O.stateDir}/files-changed.jsonl`;try{let a=(await h.fs.readTextFile(e)).trim().split(`
4
- `).filter(Boolean),n=[];for(let t of a)try{let s=JSON.parse(t);n.includes(s.file)||n.push(s.file)}catch{}return n}catch{return[]}};export{ye as main};
@@ -1,3 +0,0 @@
1
- import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as k,b as x}from"./chunk-JAQN64PH.js";import{a as g,b as y}from"./chunk-LNNNLUZT.js";import{c as w,j as c}from"./chunk-WG6J7DFO.js";import"./chunk-JYNHFD6B.js";import{f as a,h as l,k as d}from"./chunk-GBM3TZFD.js";import{c as p,d as o,f,g as h}from"./chunk-3SXTMY75.js";import{a as u,b as m}from"./chunk-A6RDYP6R.js";import{t as i}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var L=async s=>{let e=s?.[0];if(e==="add")return await $(s?.slice(1));if(e==="list")return await v();if(e==="promote")return await C(s?.slice(1));let t=await c(i.process.cwd()),n=y(t),r=a({renderer:d.ansi(),sink:l.stdout()});return r.writeln(`Usage: ${n} rule <add "rule text" | list | promote "decision">`),await r.close(),u(void 0)},$=async s=>{let e=a({renderer:d.ansi(),sink:l.stdout()}),t=i.process.cwd(),n=s?.join(" "),r=await c(t);if(n===void 0||n.length===0)return e.writeln(f("Please provide a rule: "),p(`${g('rule add "Use Deno Tests for all tests"',r)}`)),await e.close(),m({exitCode:1});let P=n.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,50),A=`${t}/${w.rulesDir}/${P}.md`;return await i.fs.mkdir(`${t}/${w.rulesDir}`,{recursive:!0}),await i.fs.writeTextFile(A,n+`
3
- `),e.writeln(h("\u2714")," Rule added: ",o(n)),r!==null&&r.tools.length>0&&(await x(t,r.tools,r),e.writeln(o(" Tool files synced."))),await e.close(),u(void 0)},v=async()=>{let s=a({renderer:d.ansi(),sink:l.stdout()}),e=i.process.cwd(),t=await k(e);s.writeln(p("Rules")),s.writeln("");let n=await c(e);if(t.length===0)s.writeln(o(` No rules yet. Add one with: ${g('rule add "..."',n)}`));else for(let r of t)s.writeln(" ",o("\u2022"),` ${r}`);return await s.close(),u(void 0)},C=async s=>{let e=a({renderer:d.ansi(),sink:l.stdout()}),t=s?.join(" ");return t===void 0||t.length===0?(e.writeln(f("Please provide the decision text to promote.")),await e.close(),m({exitCode:1})):(await e.close(),await $(s))};export{L as main};
@@ -1,4 +0,0 @@
1
- import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as M}from"./chunk-E5QQGGNF.js";import{a as V}from"./chunk-JAQN64PH.js";import"./chunk-4GQY3STW.js";import"./chunk-N4HITOTN.js";import{a as B,f as L}from"./chunk-UESOCN2G.js";import{a as G,b as C}from"./chunk-LNNNLUZT.js";import{d as x,e as g,j as $,n as F,q as U}from"./chunk-WG6J7DFO.js";import{a as D,b as A,d as N}from"./chunk-JOTAKQMZ.js";import"./chunk-JYNHFD6B.js";import{f as R,h as O,k as T}from"./chunk-GBM3TZFD.js";import{c as P,d as r,f as u,g as v,h,k as I}from"./chunk-3SXTMY75.js";import{a as S,b as w}from"./chunk-A6RDYP6R.js";import{t as y}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var ae=async n=>{let t=R({renderer:T.ansi(),sink:O.stdout()}),e=y.process.cwd(),a=n?.includes("--unattended")??!1,s=W(n,"--max-turns")??10,o=W(n,"--max-iterations")??50;if(!await U(e)){let i=await $(e);return t.writeln(u(`noskills not initialized. Run: ${G("init",i)}`)),await t.close(),w({exitCode:1})}let p=await x(e);if(p.phase!=="EXECUTING"&&p.phase!=="SPEC_APPROVED")return t.writeln(u(`Cannot run from phase: ${p.phase}`)),t.writeln(r("Must be in SPEC_APPROVED or EXECUTING to start.")),await t.close(),w({exitCode:1});if(p.phase==="SPEC_APPROVED"){t.writeln(r("Starting execution from approved spec..."));let i=L(p);await g(e,i)}let c=await $(e);if(c===null)return t.writeln(u("Config not found.")),await t.close(),w({exitCode:1});t.writeln(P(`${C(c)} run`)),t.writeln(r(`Mode: ${a?"unattended":"interactive"}, max-turns: ${s}, max-iterations: ${o}`)),t.writeln("");let m=0,d=0;for(;m<o;){m++;let i=await x(e);if(i.phase==="DONE"){t.writeln(""),t.writeln(v("\u2714")," Spec completed!"),t.writeln(` Iterations: ${i.execution.iteration}`),t.writeln(` Decisions: ${i.decisions.length}`);break}if(i.phase==="BLOCKED"){let l=i.execution.lastProgress??"Unknown";if(t.writeln(""),t.writeln(h("\u26A0")," Execution blocked: ",r(l)),a){await H(e,l,m),t.writeln(r("Logged to .eser/.state/blocked.log. Resolve and re-run.")),d=1;break}let E=A(),f=await N(E,{message:"Enter resolution (or leave empty to stop):"});if(D(f)||f===""){t.writeln(r("Stopped by user."));break}let k=B(i,"EXECUTING");await g(e,{...k,execution:{...k.execution,lastProgress:`Resolved: ${f}`}});continue}if(i.phase!=="EXECUTING"){t.writeln(u(`Unexpected phase: ${i.phase}. Stopping.`)),d=1;break}i.pendingClear&&await g(e,{...i,pendingClear:!1});let X=(await F(e)).filter(l=>c.concerns.includes(l.id)),_=await V(e),j=M(i,X,_,c),z=q(j,c);t.writeln(I(`\u2500\u2500 Iteration ${m}`),r(` (execution: ${i.execution.iteration}, debt: ${i.execution.debt?.items.length??0})`)),i.execution.lastProgress!==null&&t.writeln(r(` Last: ${i.execution.lastProgress}`)),i.execution.lastVerification?.passed===!1&&t.writeln(u(" Verification failed \u2014 agent will fix")),i.execution.debt!==null&&t.writeln(h(` Debt: ${i.execution.debt.items.length} items`)),t.writeln(r(" Spawning agent..."));try{await(await import("./mod-JI2A2546.js")).exec`claude -p ${z} --max-turns ${String(s)} --output-format json`.noThrow().text()}catch{t.writeln(u(" Failed to spawn claude CLI. Is it installed?")),d=1;break}t.writeln(r(" Agent exited. Stop hook captured state."));let b=await x(e);if(c.autoCommit===!0&&c.allowGit!==!1)try{let l=await import("./mod-JI2A2546.js");if((await l.exec`git diff --name-only`.noThrow().text()).trim().length>0){await l.exec`git add -A`.noThrow().text();let f=`noskills: iteration ${b.execution.iteration} \u2014 ${b.execution.lastProgress??"progress"}`;await l.exec`git commit -m ${f}`.noThrow().text(),t.writeln(r(" Auto-committed."))}}catch{t.writeln(r(" Auto-commit failed (non-fatal)."))}}return m>=o&&(t.writeln(""),t.writeln(h("\u26A0"),` Max iterations (${o}) reached. Stopping.`),d=2),await t.close(),d!==0?w({exitCode:d}):S(void 0)},q=(n,t)=>{let e=[];if(e.push(n.meta.resumeHint),e.push(""),n.meta.spec!==null&&(e.push(`Working on spec: ${n.meta.spec}`),e.push("")),"instruction"in n&&(e.push(n.instruction),e.push("")),"previousIterationDebt"in n){let s=n.previousIterationDebt;if(s!==void 0){e.push(`DEBT from iteration ${s.fromIteration} (address first):`);for(let o of s.items)e.push(`- ${o}`);e.push("")}}if("statusReportRequired"in n){let s=n.statusReport;if(s!==void 0){e.push("Report against these acceptance criteria:");for(let o of s.criteria)e.push(`- ${o}`);e.push("")}}if("verificationFailed"in n&&n.verificationFailed===!0&&(e.push("Test output:"),e.push(("verificationOutput"in n?n.verificationOutput:"")??""),e.push("")),n.behavioral.rules.length>0){e.push("Rules:");for(let s of n.behavioral.rules)e.push(`- ${s}`);e.push("")}if("context"in n){let s=n.context;if(s.concernReminders.length>0){e.push("Reminders:");for(let o of s.concernReminders)e.push(`- ${o}`);e.push("")}}let a=C(t);return e.push(`When done, report progress: ${a} next --answer="your progress"`),e.push(`If blocked, run: ${a} block "reason"`),e.push(`When all tasks are complete: ${a} done`),e.join(`
3
- `)},W=(n,t)=>{if(n===void 0)return null;let e=`${t}=`;for(let a of n)if(a.startsWith(e)){let s=parseInt(a.slice(e.length),10);if(!isNaN(s)&&s>0)return s}return null},H=async(n,t,e)=>{let a=`${n}/.eser/.state/blocked.log`,s=`[${new Date().toISOString()}] iteration=${e} reason=${t}
4
- `;try{let{appendFileSync:o,mkdirSync:p}=await import("node:fs"),{dirname:c}=await import("node:path");p(c(a),{recursive:!0}),o(a,s)}catch{}};export{ae as main};
@@ -1,2 +0,0 @@
1
- import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{b as j,i as F}from"./chunk-UESOCN2G.js";import{a as x,b as C}from"./chunk-LNNNLUZT.js";import{a as T,d as U}from"./chunk-2EVWKUN6.js";import{c as S,d as P,e as I,f as A,g as L,h as R,i as O,j as k,q as z}from"./chunk-WG6J7DFO.js";import"./chunk-JYNHFD6B.js";import{f as y,h as D,k as v}from"./chunk-GBM3TZFD.js";import{c as d,d as c,f as w,g as $,h as E,k as N}from"./chunk-3SXTMY75.js";import{a as h,b as g}from"./chunk-A6RDYP6R.js";import{t as l}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var ee=async i=>{let e=i?.[0];if(e==="new")return await M(i?.slice(1));if(e==="list")return await B(i?.slice(1));if(e==="switch")return await q(i?.slice(1));let t=await k(l.process.cwd()),n=C(t),r=y({renderer:v.ansi(),sink:D.stdout()});return r.writeln(`Usage: ${n} spec <new "description" | list | switch <name>>`),await r.close(),h(void 0)},M=async i=>{let e=y({renderer:v.ansi(),sink:D.stdout()}),t=l.process.cwd(),n=await k(t);if(!await z(t))return e.writeln(w("noskills is not initialized.")," Run: ",d(x("init",n))),await e.close(),g({exitCode:1});let r=null,p=[];if(i!==void 0)for(let f of i)f.startsWith("--name=")?r=f.slice(7):f.startsWith("-")||p.push(f);let m=p.join(" ");if(m.length===0)return e.writeln(w("Please provide a description: "),d(`${C(n)} spec new "photo auto-listing"`)),await e.close(),g({exitCode:1});let a=r??W(m),o=await X(t,a),s=`spec/${o}`,u=await P(t);if(u.phase!=="IDLE"&&u.phase!=="DONE")return e.writeln(w(`Cannot start new spec in phase: ${u.phase}`),c(" \u2014 finish or reset the current spec first.")),await e.close(),g({exitCode:1});let b=j(u.phase==="DONE"?F(u):u,o,s);return await l.fs.mkdir(`${t}/${S.specDir(o)}`,{recursive:!0}),await I(t,b),await R(t,o,b),e.writeln($("\u2714")," Spec started: ",d(o)),e.writeln(" Directory: ",c(S.specDir(o))),e.writeln(" Branch: ",c(s)),e.writeln(" Phase: ",E("DISCOVERY")),e.writeln(""),e.writeln("Run ",d(x("next",n))," to begin discovery questions."),await e.close(),h(void 0)},W=i=>i.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,50).replace(/-$/,""),X=async(i,e)=>{let t=`${i}/${S.specsDir}`,n=async r=>{try{return await l.fs.stat(`${t}/${r}`),!0}catch{return!1}};if(!await n(e))return e;for(let r=2;r<=99;r++){let p=`${e}-${r}`;if(!await n(p))return p}return`${e}-${Date.now()}`},B=async i=>{let e=l.process.cwd(),t=T(i),n=await A(e),r=await O(e),p=`${e}/${S.specsDir}`,m=new Set(r.map(s=>s.name)),a=[];for(let s of r)a.push({name:s.name,phase:s.state.phase,iteration:s.state.execution.iteration,active:s.name===n});try{for await(let s of l.fs.readDir(p))s.isDirectory&&!m.has(s.name)&&a.push({name:s.name,phase:"IDLE",iteration:0,active:s.name===n})}catch{}if(t==="json")return await U(a,"json"),h(void 0);let o=y({renderer:v.ansi(),sink:D.stdout()});if(o.writeln(d("Specs")),o.writeln(""),a.length===0)o.writeln(c(" No specs yet."));else for(let s of a){let u=s.active?$("\u25CF"):c("\u25CB"),b=s.active?d(s.name):c(s.name),f=s.phase==="DONE"?$(s.phase):s.phase==="EXECUTING"?N(s.phase):s.phase==="BLOCKED"?w(s.phase):E(s.phase),G=s.phase==="EXECUTING"?c(` iteration ${s.iteration}`):"";o.writeln(" ",u," ",b," ",f,G)}return await o.close(),h(void 0)},q=async i=>{let e=y({renderer:v.ansi(),sink:D.stdout()}),t=l.process.cwd(),n=i?.[0],r=await k(t);if(n===void 0||n.length===0)return e.writeln(w("Please provide a spec name: "),d(`${C(r)} spec switch my-feature`)),await e.close(),g({exitCode:1});let p=await A(t),m=await P(t);p!==null&&m.spec!==null&&await R(t,p,m);let a=await L(t,n),o=await l.fs.stat(`${t}/${S.specDir(n)}`).then(()=>!0).catch(()=>!1);return a.phase==="IDLE"&&!o?(e.writeln(w(`Spec "${n}" not found.`)),e.writeln(c(`Run \`${x("spec list",r)}\` to see available specs.`)),await e.close(),g({exitCode:1})):(await I(t,a),e.writeln($("\u2714")," Switched to: ",d(n)," (",N(a.phase),")"),a.phase==="EXECUTING"&&(e.writeln(c(` Iteration: ${a.execution.iteration}`)),a.execution.lastProgress!==null&&e.writeln(c(` Progress: ${a.execution.lastProgress}`))),await e.close(),h(void 0))};export{ee as main};
@@ -1,2 +0,0 @@
1
- import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as f}from"./chunk-4GQY3STW.js";import"./chunk-N4HITOTN.js";import{a as h}from"./chunk-LNNNLUZT.js";import{a as I,d as w}from"./chunk-2EVWKUN6.js";import{d as y,j as u,q as D}from"./chunk-WG6J7DFO.js";import"./chunk-JYNHFD6B.js";import{f as p,h as d,k as m}from"./chunk-GBM3TZFD.js";import{c as i,d as r,f as c,g as b,h as o,k as E}from"./chunk-3SXTMY75.js";import{a as g,b as C}from"./chunk-A6RDYP6R.js";import{t as x}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var U=async P=>{let n=x.process.cwd(),a=I(P);if(!await D(n)){if(a==="json")await w({error:"noskills is not initialized"},a);else{let s=p({renderer:m.ansi(),sink:d.stdout()}),l=await u(n);s.writeln(c("noskills is not initialized.")," Run: ",i(h("init",l))),await s.close()}return C({exitCode:1})}let e=await y(n),t=await u(n),k={phase:e.phase,spec:e.spec,branch:e.branch,discovery:e.phase==="DISCOVERY"?{answered:e.discovery.answers.length,total:f.length}:void 0,execution:e.phase==="EXECUTING"||e.phase==="BLOCKED"?{iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,debt:e.execution.debt?.items.length??0,verificationPassed:e.execution.lastVerification?.passed??null}:void 0,concerns:t?.concerns??[],tools:t?.tools??[],decisions:e.decisions.length,pendingClear:e.pendingClear};if(a!=="json"){let s=p({renderer:m.ansi(),sink:d.stdout()});s.writeln(i(`${h("status",t)}`)),s.writeln("");let l=e.phase==="DONE"?b(e.phase):e.phase==="BLOCKED"?c(e.phase):e.phase==="EXECUTING"?E(e.phase):o(e.phase);s.writeln(" Phase: ",l),e.spec!==null&&s.writeln(" Spec: ",i(e.spec)),e.branch!==null&&s.writeln(" Branch: ",e.branch),e.phase==="DISCOVERY"&&s.writeln(` Discovery: ${e.discovery.answers.length}/${f.length} questions answered`),e.phase==="EXECUTING"&&(s.writeln(` Iteration: ${e.execution.iteration}`),e.execution.lastProgress!==null&&s.writeln(" Progress: ",r(e.execution.lastProgress)),e.execution.debt!==null&&s.writeln(o(` Debt: ${e.execution.debt.items.length} items`))),t!==null&&(s.writeln(""),t.concerns.length>0&&s.writeln(" Concerns: ",r(t.concerns.join(", "))),t.tools.length>0&&s.writeln(" Tools: ",r(t.tools.join(", ")))),e.decisions.length>0&&(s.writeln(""),s.writeln(` Decisions: ${e.decisions.length}`)),e.pendingClear&&(s.writeln(""),s.writeln(o(" \u26A0 Context clear pending \u2014 run `/clear`"))),await s.close()}else await w(k,"json");return g(void 0)};export{U as main};