eser 4.1.32 → 4.1.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunks/chunk-5GGGQJ4P.js +2 -0
- package/chunks/{chunk-WIOHVWZZ.js → chunk-7LRPRBT6.js} +1 -1
- package/chunks/{chunk-F5BPXG5L.js → chunk-JAQN64PH.js} +4 -4
- package/chunks/{chunk-3E4IG3ET.js → chunk-JLY6XWDP.js} +1 -1
- package/chunks/{chunk-6QC7ILI5.js → chunk-SP43S32B.js} +1 -1
- package/chunks/chunk-YEOC73LX.js +2 -0
- package/chunks/init-XV5ILPUE.js +2 -0
- package/chunks/invoke-hook-7RPFDMV3.js +10 -0
- package/chunks/{mod-XKU4H3NE.js → mod-MACR3KPO.js} +1 -1
- package/chunks/{next-VEKY722P.js → next-VUWK6CDH.js} +2 -2
- package/chunks/{purge-SQ6NCKWN.js → purge-XYNNHOEN.js} +1 -1
- package/chunks/{rule-HV7DARH6.js → rule-JMNIMEH3.js} +2 -2
- package/chunks/{run-6IMOOTJ5.js → run-NZPCSAOA.js} +1 -1
- package/chunks/{spec-JCR5EYCU.js → spec-3UGU4UBE.js} +1 -1
- package/chunks/{status-F6JR6RIQ.js → status-RCEYJVRQ.js} +1 -1
- package/chunks/{sync-ZOU46K25.js → sync-M7MKXMYN.js} +1 -1
- package/chunks/{system-36UPFRHW.js → system-QCLDIN7D.js} +1 -1
- package/eser.js +1 -1
- package/package.json +1 -1
- package/chunks/chunk-C7HGK43H.js +0 -2
- package/chunks/chunk-XU5SILYR.js +0 -2
- package/chunks/init-DKNS6BZV.js +0 -2
- package/chunks/invoke-hook-4DBMDFA5.js +0 -10
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{t as o}from"./chunk-MRCBHVSB.js";var r=()=>o.env.get("HOME")??"",l=()=>{let e=o.env.get("SHELL")??"";return e.includes("zsh")?"zsh":e.includes("fish")?"fish":"bash"},s=e=>{let t=r();switch(e){case"zsh":return o.path.join(t,".zshrc");case"bash":return o.path.join(t,".bashrc");case"fish":return o.path.join(t,".config","fish","config.fish")}},c=(e,t)=>{let n=r();switch(e){case"zsh":return o.path.join(n,".zshrc");case"bash":return o.path.join(n,".bashrc");case"fish":return o.path.join(n,".config","fish","completions",`${t}.fish`)}},g=(e,t)=>`eval "$(${t} system completions --shell ${e})"`,a=e=>e==="fish"?"file":"eval",p=(e,t="eser")=>{let n=e??l(),i=a(n);return{shell:n,rcFile:s(n),completionType:i,completionsFile:i==="file"?c(n,t):void 0}},f=[{envVars:["CLAUDE_CODE","CLAUDECODE","CLAUDE_CODE_ENTRYPOINT","CLAUDE_SESSION_ID"],tool:"claude-code"},{envVars:["CURSOR_SESSION","CURSOR"],tool:"cursor"},{envVars:["KIRO_SESSION","KIRO"],tool:"kiro"},{envVars:["WINDSURF_SESSION"],tool:"windsurf"},{envVars:["GITHUB_COPILOT"],tool:"copilot"}],h=()=>{for(let e of f)for(let t of e.envVars){let n=o.env.get(t);if(n!==void 0&&n!=="")return e.tool}return null},u=()=>h()!==null?"agent":"human";export{l as a,g as b,p as c,h as d,u as e};
|
|
@@ -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-
|
|
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-JLY6XWDP.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,13 +1,13 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
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
|
-
`)},
|
|
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
4
|
|
|
5
5
|
`+a+`
|
|
6
6
|
`}catch{r=a+`
|
|
7
|
-
`}await i.fs.writeTextFile(n,r)};var
|
|
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
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
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
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}]}]}}),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)+`
|
|
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
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:
|
|
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 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
var r={name:"@eser/cli",version:"4.1.
|
|
2
|
+
var r={name:"@eser/cli",version:"4.1.33",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
|
-
import{
|
|
2
|
+
import{e as o}from"./chunk-5GGGQJ4P.js";var d=(e,n)=>{if(e!==void 0)for(let r of e){if(r==="--agent")return"agent";if(r==="--human")return"human"}let t=n?.agentMode;return t===!0?"agent":t===!1?"human":o()};var u=e=>e===void 0?[]:e.filter(n=>n!=="--agent"&&n!=="--human"&&n!=="--non-interactive");export{d as a,u as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as S,d as P}from"./chunk-4GQY3STW.js";import{c as k,d as C}from"./chunk-N4HITOTN.js";import{a as R}from"./chunk-LNNNLUZT.js";var I=null,n=e=>R(e,I),$="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.",T=(e,o,r,i)=>{let l=e.execution.iteration>=o,s=r?[]:[$],u=i?.outOfScope??[];switch(e.phase){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."}}},B=5*60*1e3,N=(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>B)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}},H=(e,o,r,i,l,s)=>{I=i??null;let u=N(e,o),a=i?.maxIterationsBeforeRestart??15,t=i?.allowGit??!1,h=T(e,a,t,l),f=F(e),d;switch(e.phase){case"IDLE":d=O(o);break;case"DISCOVERY":d=_(e,o,r);break;case"SPEC_DRAFT":d=q(e);break;case"SPEC_APPROVED":d=L(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=O(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},O=e=>({phase:"IDLE",instruction:"noskills is initialized. Ask the user what they would like to do next.",availableActions:[{command:n('spec new "description"'),description:"Start a new feature spec with discovery questions"},{command:n("concern add <id>"),description:"Add project concerns: open-source, beautiful-product, long-lived, move-fast, compliance, learning-project"},{command:n('rule add "rule"'),description:"Add a permanent coding convention"},{command:n("status"),description:"Show current project status"}],hint:e.length===0?"No concerns active. Consider adding concerns first \u2014 they shape how discovery questions and specs work.":void 0}),_=(e,o,r)=>{let i=S(o),l=e.discovery.answers.length;if(P(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":"...",...}'`)}`}}},q=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")}},L=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),v={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&&(v={...v,verificationFailed:!0,verificationOutput:h.slice(0,2e3)}),v}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.",b;if(t)b="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.`:"";b=`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 b=A;let c={phase:"EXECUTING",instruction:b,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,v=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:v}}}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{H as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as Z,b as ee}from"./chunk-SP43S32B.js";import{d as Y}from"./chunk-5GGGQJ4P.js";import{a as U}from"./chunk-YEOC73LX.js";import{a as V,b as Q}from"./chunk-JAQN64PH.js";import"./chunk-4GQY3STW.js";import{a as j}from"./chunk-N4HITOTN.js";import{a as b}from"./chunk-LNNNLUZT.js";import{d as X}from"./chunk-2EVWKUN6.js";import{a as z,b as J,e as G,j as _,k as q,m as B,o as H,q as K}from"./chunk-WG6J7DFO.js";import"./chunk-7ZYDAZBD.js";import{a as S,b as F,e as I,f as M,g as W,h as r,i as h}from"./chunk-JOTAKQMZ.js";import"./chunk-JYNHFD6B.js";import{a as E}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-CEYKWASA.js";import"./chunk-KKBIUT5L.js";import"./chunk-SQINSLNL.js";import"./chunk-MG65QJY6.js";import{a as T}from"./chunk-A6RDYP6R.js";import{t as d}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var te=E;var le=async t=>{try{return await d.fs.stat(t),!0}catch{return!1}},de=[{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"]}],se=async t=>{let e=[];for(let i of de)for(let s of i.paths)if(await le(`${t}/${s}`)){e.push(i.id);break}return e};var a=async t=>{try{return await d.fs.stat(t),!0}catch{return!1}},ne=async(t,e)=>{try{let i=await d.fs.readTextFile(t);return JSON.parse(i)[e]??null}catch{return null}},pe=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},fe=async t=>{let e=[],i=await ne(`${t}/package.json`,"dependencies");return i!==null&&("react"in i&&e.push("react"),"vue"in i&&e.push("vue"),"svelte"in i&&e.push("svelte"),"next"in i&&e.push("nextjs"),"express"in i&&e.push("express"),"hono"in i&&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},me=async t=>{if(await a(`${t}/deno.json`))return"deno";let e=await ne(`${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,i,s,u]=await Promise.all([pe(t),fe(t),ge(t),me(t)]);return{languages:e,frameworks:i,ci:s,testRunner:u}};var Fe=async t=>{let e=d.process.cwd(),i=Z(t),s=F({target:i==="agent"?"non-interactive":"interactive"}),u=ee(t),w=oe(u,"--concerns"),g=oe(u,"--tools"),p=u.includes("--non-interactive")||i==="agent";if(await K(e)){let n=await _(e);return r.warn(s,"noskills is already initialized in this project."),r.info(s,`Run \`${b("sync",n)}\` to regenerate tool files.`),T(void 0)}M(s,"noskills init");let P=h(s,"Scanning project...");P.start();let m=await ie(e);P.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 se(e),y=Y(),A=y!==null&&!D.includes(y)?[y]:[],C=[...new Set([...A,...D])];x.succeed(`${C.length} coding tool(s) detected`);for(let n of C){let o=n===y?" (current)":"";r.step(s,` ${n}${o}`)}let f;if(g!==null){let n=["claude-code","cursor","kiro","copilot","windsurf"],o=g.filter(l=>n.includes(l));f=[...new Set([...A,...o])]}else p?f=[...C]:f=await ye(s,C,y);let L=h(s,"Detecting AI providers...");L.start();let k=(await te()).filter(n=>n.available).map(n=>n.name);L.succeed(`${k.length} provider(s) detected`);let $=await j(),c;if(w!==null){let n=$.map(o=>o.id);c=w.filter(o=>n.includes(o)).sort((o,l)=>n.indexOf(o)-n.indexOf(l))}else if(p)c=[];else{let n=$.map(l=>({value:l.id,label:l.name,hint:l.description.slice(0,60)})),o=await I(s,{message:"What kind of project is this? (space to toggle, enter to confirm)",options:n});c=S(o)?[]:[...o]}c.length>0?r.success(s,`Concerns: ${c.join(", ")}`):r.info(s,"No concerns selected. Add later with `concern add <id>`.");let N=Ce(),O=h(s,"Initializing...");O.start(),await H(e);let re=$.filter(n=>c.includes(n.id));for(let n of re)await B(e,n);let v={...J(c,f,k,m),command:N};await q(e,v);let R=z();if(await G(e,R),O.succeed("Scaffolded `.eser/`"),f.length>0){let n=h(s,"Syncing tool files...");n.start();let o=await Q(e,f,v);n.succeed(`Synced ${o.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. ${f.length} tool(s), ${k.length} provider(s), ${c.length} concern(s).`),r.info(s,`Command prefix: ${N}`),i==="agent"){let o=(await j()).filter(ce=>c.includes(ce.id)),l=await V(e),ae=U(R,o,l,v);await X(ae,"json")}else W(s,`Start a spec with: ${b('spec new "..."',v)}`);return T(void 0)},we=[{value:"claude-code",label:"Claude Code"},{value:"cursor",label:"Cursor"},{value:"kiro",label:"Kiro"},{value:"copilot",label:"GitHub Copilot"},{value:"windsurf",label:"Windsurf"}],ye=async(t,e,i)=>{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)",u=new Set(e),w=await I(t,{message:s,options:we.map(p=>({...p,hint:p.value===i?"you're running inside it":u.has(p.value)?"detected":void 0,disabled:p.value===i})),initialValues:[...e],required:!1});if(S(w))return[...e];let g=[...w];return i!==null&&!g.includes(i)&&g.unshift(i),g},oe=(t,e)=>{if(t===void 0)return null;for(let i of t)if(i.startsWith(`${e}=`))return i.slice(e.length+1).split(",").map(s=>s.trim()).filter(Boolean);return null},Ce=()=>{try{let e=d.process.args.join(" ");if(e.includes("jsr:@eser/noskills"))return"deno run jsr:@eser/noskills";if(e.includes("noskills/main.ts"))return"deno run --allow-all ./pkg/@eser/noskills/main.ts";if(e.includes("eser")&&e.includes("nos")&&!e.includes("noskills"))return"eser nos";if(e.includes("eser")&&e.includes("noskills"))return"eser noskills"}catch{}return"npx eser noskills"};export{Fe as main};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as D}from"./chunk-YEOC73LX.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,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-
|
|
2
|
+
import{a,b,c,d,e,f}from"./chunk-7LRPRBT6.js";import"./chunk-5GGGQJ4P.js";import"./chunk-J2Z7NG2X.js";import"./chunk-GBM3TZFD.js";import"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import"./chunk-JLY6XWDP.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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
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
|
|
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: ${
|
|
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-YEOC73LX.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
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-
|
|
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()+`
|
|
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,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as
|
|
3
|
-
`),e.writeln(h("\u2714")," Rule added: ",o(n)),r!==null&&r.tools.length>0&&(await
|
|
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 +1,4 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as
|
|
2
|
+
import{a as M}from"./chunk-YEOC73LX.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
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
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 +1,2 @@
|
|
|
1
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
|
|
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 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as
|
|
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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as
|
|
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};
|
|
@@ -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-
|
|
2
|
+
import{a as e,b as s,c as l,d as o,e as r,f as a}from"./chunk-7LRPRBT6.js";import"./chunk-5GGGQJ4P.js";import"./chunk-J2Z7NG2X.js";import"./chunk-GBM3TZFD.js";import"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import"./chunk-JLY6XWDP.js";import"./chunk-PWLF3WXM.js";import{b as n}from"./chunk-SQINSLNL.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};
|
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-3E4IG3ET.js";import{a as m}from"./chunks/chunk-CEYKWASA.js";import"./chunks/chunk-PWLF3WXM.js";import{a as o}from"./chunks/chunk-KKBIUT5L.js";import{b as a}from"./chunks/chunk-SQINSLNL.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-5WXRQGLS.js")},install:{description:"Install git hooks from .eser/manifest.yml",category:"Setup",load:()=>import("./chunks/install-LM44N3DB.js")},uninstall:{description:"Remove managed git hooks",category:"Setup",load:async()=>({main:(await import("./chunks/install-LM44N3DB.js")).uninstallMain})},status:{description:"Show git hook installation status",category:"Setup",load:async()=>({main:(await import("./chunks/install-LM44N3DB.js")).statusMain})},commitmsg:{description:"Generate commit message from git diff",category:"AI",load:()=>import("./chunks/commitmsg-UK2ABB7D.js")},gh:{description:"GitHub operations (contributors, releases, tags)",category:"GitHub",load:()=>import("./chunks/gh-RKKHKA3B.js")},versions:{description:"Manage workspace package versions",category:"Release",load:()=>import("./chunks/versions-IVXYMSAZ.js")},"changelog-gen":{description:"Generate CHANGELOG from commits",category:"Release",load:()=>import("./chunks/changelog-gen-7V37P7PE.js")},release:{description:"Create a release (bump, changelog, commit, push)",category:"Release",load:()=>import("./chunks/release-WKMSWXDS.js")},rerelease:{description:"Delete and recreate the current version tag",category:"Release",load:async()=>({main:(await import("./chunks/release-WKMSWXDS.js")).rereleaseMain})},unrelease:{description:"Delete the current version tag",category:"Release",load:async()=>({main:(await import("./chunks/release-WKMSWXDS.js")).unreleaseMain})},"validate-eof":{description:"Ensure files end with newline",category:"Validation",load:()=>import("./chunks/validate-eof-MX52AUUT.js")},"validate-trailing-whitespace":{description:"Remove trailing whitespace",category:"Validation",load:()=>import("./chunks/validate-trailing-whitespace-3UUUKE22.js")},"validate-bom":{description:"Remove UTF-8 byte order markers",category:"Validation",load:()=>import("./chunks/validate-bom-KEC4IOKO.js")},"validate-line-endings":{description:"Normalize line endings to LF",category:"Validation",load:()=>import("./chunks/validate-line-endings-K36HS73S.js")},"validate-large-files":{description:"Detect files exceeding size limit",category:"Validation",load:()=>import("./chunks/validate-large-files-CMCMEGYA.js")},"validate-case-conflict":{description:"Detect case-conflicting filenames",category:"Validation",load:()=>import("./chunks/validate-case-conflict-ZZKZQQX4.js")},"validate-merge-conflict":{description:"Detect merge conflict markers",category:"Validation",load:()=>import("./chunks/validate-merge-conflict-PMGZYM3B.js")},"validate-json":{description:"Validate JSON syntax",category:"Validation",load:()=>import("./chunks/validate-json-TABLVKEH.js")},"validate-toml":{description:"Validate TOML syntax",category:"Validation",load:()=>import("./chunks/validate-toml-JLQ3BY73.js")},"validate-yaml":{description:"Validate YAML syntax",category:"Validation",load:()=>import("./chunks/validate-yaml-2BG7G35N.js")},"validate-symlinks":{description:"Detect broken symlinks",category:"Validation",load:()=>import("./chunks/validate-symlinks-LSEEVFTR.js")},"validate-shebangs":{description:"Validate shebang consistency",category:"Validation",load:()=>import("./chunks/validate-shebangs-GUBDNU2N.js")},"validate-secrets":{description:"Detect credentials and private keys",category:"Validation",load:()=>import("./chunks/validate-secrets-IAMY5DB5.js")},"validate-filenames":{description:"Enforce filename conventions",category:"Validation",load:()=>import("./chunks/validate-filenames-LXIMPWRW.js")},"validate-submodules":{description:"Detect git submodules",category:"Validation",load:()=>import("./chunks/validate-submodules-ZA2FAF3W.js")},"validate-commit-msg":{description:"Validate conventional commit format",category:"Validation",load:()=>import("./chunks/validate-commit-msg-PZZ4T4QF.js")},"validate-docs":{description:"Validate JSDoc documentation",category:"Validation",load:()=>import("./chunks/validate-docs-M55HAXPX.js")},"validate-circular-deps":{description:"Detect circular dependencies",category:"Validation",load:()=>import("./chunks/validate-circular-deps-QCJYK5K5.js")},"validate-export-names":{description:"Validate export naming conventions",category:"Validation",load:()=>import("./chunks/validate-export-names-UFXPIDFW.js")},"validate-licenses":{description:"Validate license headers",category:"Validation",load:()=>import("./chunks/validate-licenses-MDGIDYNC.js")},"validate-mod-exports":{description:"Validate mod.ts export coverage",category:"Validation",load:()=>import("./chunks/validate-mod-exports-M3UYNBK7.js")},"validate-package-configs":{description:"Validate package configurations",category:"Validation",load:()=>import("./chunks/validate-package-configs-V5LR7K5C.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-DKNS6BZV.js")},status:{description:"Show current state",load:()=>import("./chunks/status-F6JR6RIQ.js")},spec:{description:"Manage specs (new, list)",load:()=>import("./chunks/spec-JCR5EYCU.js")},next:{description:"Get next instruction for agent",load:()=>import("./chunks/next-VEKY722P.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-6IMOOTJ5.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-ZOU46K25.js")},purge:{description:"Remove all noskills content (specs, rules, concerns, hooks)",load:()=>import("./chunks/purge-SQ6NCKWN.js")},"invoke-hook":{description:"Internal hook handlers (called by agents)",load:()=>import("./chunks/invoke-hook-4DBMDFA5.js")},rule:{description:"Manage rules (add, list, promote)",load:()=>import("./chunks/rule-HV7DARH6.js")}}});var w=new o({description:"laroux.js framework commands",modules:{init:{description:"Create a new laroux.js project",load:()=>import("./chunks/init-32DVDSNZ.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-XBH6C6DH.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-6DCIDFY7.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-DEYVWV2K.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-Y4UHOKMZ.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-36UPFRHW.js")).systemCommand}).lazyCommand("install",{description:"Install eser CLI globally (alias for system install)",load:async()=>{let e=await import("./chunks/mod-XKU4H3NE.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-XKU4H3NE.js");return new a("update").run(e.updateHandler)}}).lazyCommand("version",{description:"Show version number",load:async()=>{let e=await import("./chunks/mod-XKU4H3NE.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-XKU4H3NE.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-JLY6XWDP.js";import{a as m}from"./chunks/chunk-CEYKWASA.js";import"./chunks/chunk-PWLF3WXM.js";import{a as o}from"./chunks/chunk-KKBIUT5L.js";import{b as a}from"./chunks/chunk-SQINSLNL.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-5WXRQGLS.js")},install:{description:"Install git hooks from .eser/manifest.yml",category:"Setup",load:()=>import("./chunks/install-LM44N3DB.js")},uninstall:{description:"Remove managed git hooks",category:"Setup",load:async()=>({main:(await import("./chunks/install-LM44N3DB.js")).uninstallMain})},status:{description:"Show git hook installation status",category:"Setup",load:async()=>({main:(await import("./chunks/install-LM44N3DB.js")).statusMain})},commitmsg:{description:"Generate commit message from git diff",category:"AI",load:()=>import("./chunks/commitmsg-UK2ABB7D.js")},gh:{description:"GitHub operations (contributors, releases, tags)",category:"GitHub",load:()=>import("./chunks/gh-RKKHKA3B.js")},versions:{description:"Manage workspace package versions",category:"Release",load:()=>import("./chunks/versions-IVXYMSAZ.js")},"changelog-gen":{description:"Generate CHANGELOG from commits",category:"Release",load:()=>import("./chunks/changelog-gen-7V37P7PE.js")},release:{description:"Create a release (bump, changelog, commit, push)",category:"Release",load:()=>import("./chunks/release-WKMSWXDS.js")},rerelease:{description:"Delete and recreate the current version tag",category:"Release",load:async()=>({main:(await import("./chunks/release-WKMSWXDS.js")).rereleaseMain})},unrelease:{description:"Delete the current version tag",category:"Release",load:async()=>({main:(await import("./chunks/release-WKMSWXDS.js")).unreleaseMain})},"validate-eof":{description:"Ensure files end with newline",category:"Validation",load:()=>import("./chunks/validate-eof-MX52AUUT.js")},"validate-trailing-whitespace":{description:"Remove trailing whitespace",category:"Validation",load:()=>import("./chunks/validate-trailing-whitespace-3UUUKE22.js")},"validate-bom":{description:"Remove UTF-8 byte order markers",category:"Validation",load:()=>import("./chunks/validate-bom-KEC4IOKO.js")},"validate-line-endings":{description:"Normalize line endings to LF",category:"Validation",load:()=>import("./chunks/validate-line-endings-K36HS73S.js")},"validate-large-files":{description:"Detect files exceeding size limit",category:"Validation",load:()=>import("./chunks/validate-large-files-CMCMEGYA.js")},"validate-case-conflict":{description:"Detect case-conflicting filenames",category:"Validation",load:()=>import("./chunks/validate-case-conflict-ZZKZQQX4.js")},"validate-merge-conflict":{description:"Detect merge conflict markers",category:"Validation",load:()=>import("./chunks/validate-merge-conflict-PMGZYM3B.js")},"validate-json":{description:"Validate JSON syntax",category:"Validation",load:()=>import("./chunks/validate-json-TABLVKEH.js")},"validate-toml":{description:"Validate TOML syntax",category:"Validation",load:()=>import("./chunks/validate-toml-JLQ3BY73.js")},"validate-yaml":{description:"Validate YAML syntax",category:"Validation",load:()=>import("./chunks/validate-yaml-2BG7G35N.js")},"validate-symlinks":{description:"Detect broken symlinks",category:"Validation",load:()=>import("./chunks/validate-symlinks-LSEEVFTR.js")},"validate-shebangs":{description:"Validate shebang consistency",category:"Validation",load:()=>import("./chunks/validate-shebangs-GUBDNU2N.js")},"validate-secrets":{description:"Detect credentials and private keys",category:"Validation",load:()=>import("./chunks/validate-secrets-IAMY5DB5.js")},"validate-filenames":{description:"Enforce filename conventions",category:"Validation",load:()=>import("./chunks/validate-filenames-LXIMPWRW.js")},"validate-submodules":{description:"Detect git submodules",category:"Validation",load:()=>import("./chunks/validate-submodules-ZA2FAF3W.js")},"validate-commit-msg":{description:"Validate conventional commit format",category:"Validation",load:()=>import("./chunks/validate-commit-msg-PZZ4T4QF.js")},"validate-docs":{description:"Validate JSDoc documentation",category:"Validation",load:()=>import("./chunks/validate-docs-M55HAXPX.js")},"validate-circular-deps":{description:"Detect circular dependencies",category:"Validation",load:()=>import("./chunks/validate-circular-deps-QCJYK5K5.js")},"validate-export-names":{description:"Validate export naming conventions",category:"Validation",load:()=>import("./chunks/validate-export-names-UFXPIDFW.js")},"validate-licenses":{description:"Validate license headers",category:"Validation",load:()=>import("./chunks/validate-licenses-MDGIDYNC.js")},"validate-mod-exports":{description:"Validate mod.ts export coverage",category:"Validation",load:()=>import("./chunks/validate-mod-exports-M3UYNBK7.js")},"validate-package-configs":{description:"Validate package configurations",category:"Validation",load:()=>import("./chunks/validate-package-configs-V5LR7K5C.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-XV5ILPUE.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-VUWK6CDH.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-NZPCSAOA.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-7RPFDMV3.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-32DVDSNZ.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-XBH6C6DH.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-6DCIDFY7.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-DEYVWV2K.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-Y4UHOKMZ.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-QCLDIN7D.js")).systemCommand}).lazyCommand("install",{description:"Install eser CLI globally (alias for system install)",load:async()=>{let e=await import("./chunks/mod-MACR3KPO.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-MACR3KPO.js");return new a("update").run(e.updateHandler)}}).lazyCommand("version",{description:"Show version number",load:async()=>{let e=await import("./chunks/mod-MACR3KPO.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-MACR3KPO.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
package/chunks/chunk-C7HGK43H.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as P,d as R}from"./chunk-4GQY3STW.js";import{c as k,d as C}from"./chunk-N4HITOTN.js";import{a as S}from"./chunk-LNNNLUZT.js";var I=null,n=e=>S(e,I),$="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.",T=(e,o,r,i)=>{let l=e.execution.iteration>=o,s=r?[]:[$],u=i?.outOfScope??[];switch(e.phase){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."}}},B=5*60*1e3,N=(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>B)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}},H=(e,o,r,i,l,s)=>{I=i??null;let u=N(e,o),a=i?.maxIterationsBeforeRestart??15,t=i?.allowGit??!1,h=T(e,a,t,l),f=F(e),d;switch(e.phase){case"IDLE":d=O();break;case"DISCOVERY":d=_(e,o,r);break;case"SPEC_DRAFT":d=L(e);break;case"SPEC_APPROVED":d=q(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=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},O=()=>({phase:"IDLE",instruction:`No active spec. Start one with: \`${n('spec new "description"')}\``}),_=(e,o,r)=>{let i=P(o),l=e.discovery.answers.length;if(R(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")}},q=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),v={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&&(v={...v,verificationFailed:!0,verificationOutput:h.slice(0,2e3)}),v}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.",b;if(t)b="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.`:"";b=`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 b=A;let c={phase:"EXECUTING",instruction:b,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,v=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:v}}}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{H as a};
|
package/chunks/chunk-XU5SILYR.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{t as n}from"./chunk-MRCBHVSB.js";var o=()=>n.env.get("HOME")??"",s=()=>{let e=n.env.get("SHELL")??"";return e.includes("zsh")?"zsh":e.includes("fish")?"fish":"bash"},l=e=>{let t=o();switch(e){case"zsh":return n.path.join(t,".zshrc");case"bash":return n.path.join(t,".bashrc");case"fish":return n.path.join(t,".config","fish","config.fish")}},c=(e,t)=>{let i=o();switch(e){case"zsh":return n.path.join(i,".zshrc");case"bash":return n.path.join(i,".bashrc");case"fish":return n.path.join(i,".config","fish","completions",`${t}.fish`)}},a=(e,t)=>`eval "$(${t} system completions --shell ${e})"`,h=e=>e==="fish"?"file":"eval",p=(e,t="eser")=>{let i=e??s(),r=h(i);return{shell:i,rcFile:l(i),completionType:r,completionsFile:r==="file"?c(i,t):void 0}},g=["CLAUDE_CODE","CLAUDECODE","CLAUDE_CODE_ENTRYPOINT","CLAUDE_SESSION_ID","CURSOR_SESSION","CURSOR","KIRO_SESSION","KIRO","WINDSURF_SESSION","GITHUB_COPILOT"],f=()=>{for(let e of g){let t=n.env.get(e);if(t!==void 0&&t!=="")return"agent"}return"human"};export{s as a,a as b,p as c,f as d};
|
package/chunks/init-DKNS6BZV.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as B,b as G}from"./chunk-6QC7ILI5.js";import"./chunk-XU5SILYR.js";import{b as W}from"./chunk-F5BPXG5L.js";import{a as J}from"./chunk-N4HITOTN.js";import{a as v}from"./chunk-LNNNLUZT.js";import{a as R,b as E,e as M,j as N,k as O,m as F,o as L,q as z}from"./chunk-WG6J7DFO.js";import"./chunk-7ZYDAZBD.js";import{a as b,b as D,e as I,f as A,g as T,h as r,i as p}from"./chunk-JOTAKQMZ.js";import"./chunk-JYNHFD6B.js";import{a as x}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-CEYKWASA.js";import"./chunk-KKBIUT5L.js";import"./chunk-SQINSLNL.js";import"./chunk-MG65QJY6.js";import{a as y}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 U=x;var X=async t=>{try{return await l.fs.stat(t),!0}catch{return!1}},Y=[{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"]}],_=async t=>{let e=[];for(let i of Y)for(let s of i.paths)if(await X(`${t}/${s}`)){e.push(i.id);break}return e};var o=async t=>{try{return await l.fs.stat(t),!0}catch{return!1}},q=async(t,e)=>{try{let i=await l.fs.readTextFile(t);return JSON.parse(i)[e]??null}catch{return null}},ee=async t=>{let e=[];return(await o(`${t}/package.json`)||await o(`${t}/deno.json`))&&e.push("typescript"),await o(`${t}/go.mod`)&&e.push("go"),await o(`${t}/Cargo.toml`)&&e.push("rust"),(await o(`${t}/pyproject.toml`)||await o(`${t}/setup.py`))&&e.push("python"),e},te=async t=>{let e=[],i=await q(`${t}/package.json`,"dependencies");return i!==null&&("react"in i&&e.push("react"),"vue"in i&&e.push("vue"),"svelte"in i&&e.push("svelte"),"next"in i&&e.push("nextjs"),"express"in i&&e.push("express"),"hono"in i&&e.push("hono")),e},se=async t=>{let e=[];return await o(`${t}/.github/workflows`)&&e.push("github-actions"),await o(`${t}/.gitlab-ci.yml`)&&e.push("gitlab-ci"),await o(`${t}/Jenkinsfile`)&&e.push("jenkins"),await o(`${t}/.circleci`)&&e.push("circleci"),e},ne=async t=>{if(await o(`${t}/deno.json`))return"deno";let e=await q(`${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},H=async t=>{let[e,i,s,g]=await Promise.all([ee(t),te(t),se(t),ne(t)]);return{languages:e,frameworks:i,ci:s,testRunner:g}};var ke=async t=>{let e=l.process.cwd(),i=B(t),s=D({target:i==="agent"?"non-interactive":"interactive"}),g=G(t),$=re(g,"--concerns"),K=g.includes("--non-interactive")||i==="agent";if(await z(e)){let n=await N(e);return r.warn(s,"noskills is already initialized in this project."),r.info(s,`Run \`${v("sync",n)}\` to regenerate tool files.`),y(void 0)}A(s,"noskills init");let k=p(s,"Scanning project...");k.start();let d=await H(e);k.succeed("Project scanned");for(let n of d.languages)r.step(s,` ${n}`);for(let n of d.frameworks)r.step(s,` ${n}`);for(let n of d.ci)r.step(s,` ${n}`);d.testRunner!==null&&r.step(s,` test runner: ${d.testRunner}`);let j=p(s,"Detecting coding tools...");j.start();let u=await _(e);j.succeed(`${u.length} coding tool(s) detected`);for(let n of u)r.step(s,` ${n}`);let P=p(s,"Detecting AI providers...");P.start();let m=(await U()).filter(n=>n.available).map(n=>n.name);P.succeed(`${m.length} provider(s) detected`);let h=await J(),c;if($!==null){let n=h.map(a=>a.id);c=$.filter(a=>n.includes(a)).sort((a,f)=>n.indexOf(a)-n.indexOf(f))}else if(K)c=[];else{let n=h.map(f=>({value:f.id,label:f.name,hint:f.description.slice(0,60)})),a=await I(s,{message:"What kind of project is this? (space to toggle, enter to confirm)",options:n});c=b(a)?[]:[...a]}c.length>0?r.success(s,`Concerns: ${c.join(", ")}`):r.info(s,"No concerns selected. Add later with `concern add <id>`.");let C=oe(),S=p(s,"Initializing...");S.start(),await L(e);let Q=h.filter(n=>c.includes(n.id));for(let n of Q)await F(e,n);let w={...E(c,u,m,d),command:C};await O(e,w);let V=R();if(await M(e,V),S.succeed("Scaffolded `.eser/`"),u.length>0){let n=p(s,"Syncing tool files...");n.start();let a=await W(e,u,w);n.succeed(`Synced ${a.length} tool(s)`)}return r.success(s,`Done. ${u.length} tool(s), ${m.length} provider(s), ${c.length} concern(s).`),r.info(s,`Command prefix: ${C}`),T(s,`Start a spec with: ${v('spec new "..."',w)}`),y(void 0)},re=(t,e)=>{if(t===void 0)return null;for(let i of t)if(i.startsWith(`${e}=`))return i.slice(e.length+1).split(",").map(s=>s.trim()).filter(Boolean);return null},oe=()=>{try{let e=l.process.args.join(" ");if(e.includes("jsr:@eser/noskills"))return"deno run jsr:@eser/noskills";if(e.includes("noskills/main.ts"))return"deno run --allow-all ./pkg/@eser/noskills/main.ts";if(e.includes("eser")&&e.includes("nos")&&!e.includes("noskills"))return"eser nos";if(e.includes("eser")&&e.includes("noskills"))return"eser noskills"}catch{}return"npx eser noskills"};export{ke 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-LNNNLUZT.js";import{c as g,d as x,j as S}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 y=async()=>{let n=i.process.stdin.getReader(),e=[];try{for(;;){let{done:o,value:a}=await n.read();if(o||a===void 0)break;e.push(a)}}finally{n.releaseLock()}let t=0,c=new Uint8Array(e.reduce((o,a)=>o+a.length,0));for(let o of e)c.set(o,t),t+=o.length;let s=new TextDecoder().decode(c);try{return JSON.parse(s)}catch{return{}}},R=async n=>{let e=new TextEncoder,t=i.process.stdout.getWriter();await t.write(e.encode(JSON.stringify(n))),t.releaseLock()},I=async n=>{switch(n?.[0]){case"pre-tool-use":return await D();case"stop":return await T();case"post-file-write":return await v();case"post-bash":return await F();default:return r(void 0)}},D=async()=>{let n=await y(),e=n.tool_name??"unknown",t=n.tool_input??{},c=n.cwd??i.process.cwd(),s=await S(c),o={};try{o=await x(c)}catch{return r(void 0)}let a=async u=>{await R({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",s)}\` before continuing.`),r(void 0);if(e==="Bash"){let u=(t.command??"").trim();if(!(s?.allowGit??!1)){let p=["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 w of p)if(u.startsWith(w)||u.includes(` && ${w}`)||u.includes(`; ${w}`))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(e))return r(void 0);let h=t.file_path??t.path??"";if(h.includes(".eser/")||h.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",s)}\``,UNINITIALIZED:`noskills not initialized. Run \`${d("init",s)}\``,DISCOVERY:`Discovery in progress. Run \`${d("next",s)}\` to continue.`,SPEC_DRAFT:`Spec needs review. Run \`${d("approve",s)}\``,SPEC_APPROVED:`Start execution first: \`${d('next --answer="start"',s)}\``,BLOCKED:`Execution blocked. Resolve with \`${d('next --answer="resolution"',s)}\``,DONE:`Spec complete. Start a new one or run \`${d("reset",s)}\``};return await a(k[f]??`Run \`${d("next",s)}\` first.`),r(void 0)},T=async()=>{let n=await y();if(n.stop_hook_active===!0)return r(void 0);let e=n.cwd??i.process.cwd(),t;try{let l=await i.fs.readTextFile(`${e}/${g.stateFile}`);t=JSON.parse(l)}catch{return r(void 0)}if(t.phase!=="EXECUTING")return r(void 0);let c=t.execution??{},s=`${e}/${g.stateDir}/files-changed.jsonl`,o=[];try{let p=(await i.fs.readTextFile(s)).trim().split(`
|
|
3
|
-
`).filter(Boolean);o=[...new Set(p.map(w=>{try{return JSON.parse(w).file}catch{return null}}).filter(w=>w!==null))]}catch{}let a=[],m="no changes";try{let{execSync:l}=await import("node:child_process");a=l("git diff --name-only",{cwd:e,encoding:"utf-8",timeout:5e3}).trim().split(`
|
|
4
|
-
`).filter(Boolean);let $=l("git diff --stat",{cwd:e,encoding:"utf-8",timeout:5e3}).trim().split(`
|
|
5
|
-
`);m=$[$.length-1]??"no changes"}catch{}let h=[...new Set([...o,...a])],f=(c.iteration??0)+1,k=`${e}/${g.stateDir}/iterations`;try{await i.fs.mkdir(k,{recursive:!0}),await i.fs.writeTextFile(`${k}/iteration-${f}.json`,JSON.stringify({iteration:f,files:h,gitStat:m.trim(),timestamp:new Date().toISOString()},null,2)+`
|
|
6
|
-
`)}catch{}let u=15;try{let l=await S(e);l!==null&&(u=l.maxIterationsBeforeRestart)}catch{}t.execution={...c,iteration:f,modifiedFiles:h,lastProgress:m.trim()||c.lastProgress||null},t.lastCalledAt=new Date().toISOString();try{await i.fs.writeTextFile(`${e}/${g.stateFile}`,JSON.stringify(t,null,2)+`
|
|
7
|
-
`)}catch{}try{await i.fs.writeTextFile(s,"")}catch{}if(f>=u){let l=new TextEncoder,p=i.process.stderr.getWriter();await p.write(l.encode(`noskills: iteration ${f} reached threshold (${u}). Consider starting a fresh conversation.
|
|
8
|
-
`)),p.releaseLock()}return r(void 0)},v=async()=>{let n=await y(),e=n.tool_input??{},t=e.file_path??e.path??"";if(!t||t.includes(".eser/")||t.includes(".claude/"))return r(void 0);let c=n.cwd??i.process.cwd(),s=`${c}/${g.stateDir}/files-changed.jsonl`,o=JSON.stringify({file:t,tool:n.tool_name,ts:new Date().toISOString()});try{await i.fs.mkdir(`${c}/${g.stateDir}`,{recursive:!0});let a="";try{a=await i.fs.readTextFile(s)}catch{}await i.fs.writeTextFile(s,a+o+`
|
|
9
|
-
`)}catch{}return r(void 0)},F=async()=>{let n=await y(),t=(n.tool_input??{}).command??"";if(!t.includes("noskills"))return r(void 0);let c=n.cwd??i.process.cwd(),s=`${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(s)}catch{}await i.fs.writeTextFile(s,a+o+`
|
|
10
|
-
`)}catch{}return r(void 0)};export{I as main};
|