noskills 4.1.26 → 4.1.29
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/README.md +659 -2
- package/chunks/approve-UATWGG53.js +1 -0
- package/chunks/{ask-Q7AVFBH5.js → ask-5YIOZTBI.js} +1 -1
- package/chunks/block-IDVJLPNV.js +1 -0
- package/chunks/chunk-52HFDP2R.js +39 -0
- package/chunks/chunk-6XR33H6Q.js +2 -0
- package/chunks/chunk-C2SQE5AG.js +1 -0
- package/chunks/chunk-D6Q2GR7X.js +1 -0
- package/chunks/chunk-FAK366X2.js +1 -0
- package/chunks/chunk-G2NW625V.js +4 -0
- package/chunks/{chunk-N4POD6ZW.js → chunk-G65TSD56.js} +1 -1
- package/chunks/chunk-LEPZPNTN.js +12 -0
- package/chunks/chunk-MJVACJ6D.js +144 -0
- package/chunks/chunk-O3PI76HM.js +3 -0
- package/chunks/chunk-OM4QJ24S.js +1 -0
- package/chunks/chunk-QHS53BRV.js +3 -0
- package/chunks/chunk-SBUQXH6U.js +1 -0
- package/chunks/{chunk-FEWVQ5CW.js → chunk-SOMEQCOS.js} +1 -1
- package/chunks/{chunk-RAI7PS2P.js → chunk-UWD66JGG.js} +1 -1
- package/chunks/chunk-UXRWSNVZ.js +1 -0
- package/chunks/chunk-XHFYREAD.js +1 -0
- package/chunks/{claude-code-AFPWU2BS.js → claude-code-Z7LYZDY5.js} +1 -1
- package/chunks/concern-JUE2IFQI.js +1 -0
- package/chunks/done-LOYNEBUX.js +1 -0
- package/chunks/init-FMAEQACG.js +1 -0
- package/chunks/invoke-hook-2VRIZ4VU.js +9 -0
- package/chunks/{kiro-WSWAMBP2.js → kiro-C7DKUCGL.js} +1 -1
- package/chunks/list-U5OS3WZ4.js +1 -0
- package/chunks/mod-RWDPEKPY.js +1 -0
- package/chunks/next-WEQWWHMJ.js +3 -0
- package/chunks/{ollama-ZD3BKKDE.js → ollama-HRLYSKFN.js} +1 -1
- package/chunks/{opencode-TJR46E7H.js → opencode-QKZUHQHY.js} +1 -1
- package/chunks/purge-AISADFMA.js +4 -0
- package/chunks/reset-2II5XIWI.js +1 -0
- package/chunks/rule-3UTOQ32B.js +2 -0
- package/chunks/run-EP6XJQXK.js +3 -0
- package/chunks/spec-BLGJLET3.js +1 -0
- package/chunks/status-K2DRYXDX.js +1 -0
- package/chunks/sync-NR33ZH7R.js +1 -0
- package/chunks/watch-DTNAKL6O.js +8 -0
- package/noskills.js +1 -1
- package/package.json +1 -1
- package/chunks/approve-JJTQKJU6.js +0 -1
- package/chunks/block-4I5XBXK7.js +0 -1
- package/chunks/chunk-BK2BDHKB.js +0 -1
- package/chunks/chunk-JYJTZEC4.js +0 -32
- package/chunks/chunk-LXVBR775.js +0 -1
- package/chunks/chunk-NGURBONB.js +0 -6
- package/chunks/chunk-PQQKC72V.js +0 -10
- package/chunks/init-QCOPTDGO.js +0 -1
- package/chunks/list-UVJ2Q5KF.js +0 -1
- package/chunks/next-DNJGG34Q.js +0 -3
- package/chunks/reset-WLKKKEUZ.js +0 -1
- package/chunks/rule-3VERAMM3.js +0 -2
- package/chunks/spec-P6YE224I.js +0 -1
- package/chunks/status-CJMMUOTY.js +0 -1
- package/chunks/sync-BZ3Z5YQP.js +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as d}from"./chunk-UXRWSNVZ.js";import{d as g,e as x,k as S}from"./chunk-MJVACJ6D.js";import{a as r}from"./chunk-2N4GTHXQ.js";import{a as i}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.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(`
|
|
2
|
+
`).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(`
|
|
3
|
+
`).filter(Boolean);let $=l("git diff --stat",{cwd:e,encoding:"utf-8",timeout:5e3}).trim().split(`
|
|
4
|
+
`);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)+`
|
|
5
|
+
`)}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)+`
|
|
6
|
+
`)}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.
|
|
7
|
+
`)),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+`
|
|
8
|
+
`)}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+`
|
|
9
|
+
`)}catch{}return r(void 0)};export{I as main};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as S,b as g,d as T,e as m,f,g as y}from"./chunk-
|
|
1
|
+
import{a as S,b as g,d as T,e as m,f,g as y}from"./chunk-G65TSD56.js";import{a as l}from"./chunk-OLM5RTFK.js";import"./chunk-SOMEQCOS.js";import"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var k=class{capabilities=["text_generation","streaming"];provider="kiro";modelId;binary;config;constructor(e,r){this.binary=e,this.config=r,this.modelId=r.model}async generateText(e,r){let o=v(this.config,e),c=y(e.messages,e.system);o.push("--prompt",c);let s=g(this.binary,o,{signal:r}),u=m(s.stderr),t=await T(s.stdout,this.modelId),d=await s.waitForExit(),i=await u,a=f("kiro",d.code,i);if(a!==null)throw a;return t}async*streamText(e,r){let o=v(this.config,e),c=y(e.messages,e.system);o.push("--prompt",c);let s=g(this.binary,o,{signal:r}),u=m(s.stderr);try{let t=new TextDecoder,d=s.stdout.getReader(),i="",a=await d.read();for(;a.done!==!0;){i+=t.decode(a.value,{stream:!0});let x=i.split(`
|
|
2
2
|
`);i=x.pop()??"";for(let _ of x){let p=_.trim();if(p.length!==0){try{let A=JSON.parse(p),w=C(A);if(w!==null){yield w;continue}}catch{}yield{kind:"content_delta",textDelta:p+`
|
|
3
3
|
`}}}a=await d.read()}d.releaseLock(),i.trim().length>0&&(yield{kind:"content_delta",textDelta:i.trim()});let E=await s.waitForExit(),b=await u,h=f("kiro",E.code,b);h!==null?yield{kind:"error",error:h}:yield{kind:"message_done",stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0}}}catch(t){t instanceof l?yield{kind:"error",error:t}:yield{kind:"error",error:new l(t instanceof Error?t.message:String(t),{provider:"kiro",cause:t instanceof Error?t:void 0})}}}close(){return Promise.resolve()}getRawClient(){return null}},O={provider:"kiro",async createModel(n){let e=await S("kiro",n);return new k(e,n)}},v=(n,e)=>{let r=[];r.push("--output","json"),r.push("--model",n.model),e.maxTokens!==void 0&&r.push("--max-tokens",String(e.maxTokens));let o=n.properties?.args;return o!==void 0&&r.push(...o),r},C=n=>{if(n===null||typeof n!="object")return null;let e=n;if(e.type==="content"||e.type==="text"){let r=e.text??e.content;return r!==void 0?{kind:"content_delta",textDelta:String(r)}:null}return e.type==="done"||e.type==="result"||e.done===!0?{kind:"message_done",stopReason:"end_turn",usage:{inputTokens:e.usage?.input_tokens??0,outputTokens:e.usage?.output_tokens??0,totalTokens:(e.usage?.input_tokens??0)+(e.usage?.output_tokens??0)}}:e.type==="error"?{kind:"error",error:new l(e.error?.message??e.message??"Unknown Kiro error",{provider:"kiro"})}:null};export{k as KiroModel,O as kiroFactory};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as p}from"./chunk-UWD66JGG.js";import{c as t,d as a,g as l,m as n,o,q as m,r as d}from"./chunk-52HFDP2R.js";import{a as i}from"./chunk-2N4GTHXQ.js";import"./chunk-SOMEQCOS.js";import"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var $=async b=>{let e=o({renderer:d.ansi(),sink:m.stdout()});e.writeln(t("AI Providers")),e.writeln("");let r=await p(),v=r.map(s=>[s.available?l("\u25CF"):a("\u25CB"),s.available?t(`${s.name} (${s.alias})`):a(`${s.name} (${s.alias})`),a(s.type),s.available?s.detail:a(s.detail)]);e.writeln(n(["","Provider","Type","Status"],v));let u=r.filter(s=>s.available).length;return e.writeln(a(`${u}/${r.length} providers available`)),await e.close(),i(void 0)};export{$ as main};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d}from"./chunk-SOMEQCOS.js";import"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";export{b as CommandBuilder,a as CommandError,d as exec,c as parseCommand};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as _}from"./chunk-QHS53BRV.js";import{a as v}from"./chunk-6XR33H6Q.js";import{a as B,b as H,c as Q,d as z}from"./chunk-O3PI76HM.js";import{a as A}from"./chunk-SBUQXH6U.js";import{a as j,c as b,d as G,f as J,h as W}from"./chunk-OM4QJ24S.js";import{a as P}from"./chunk-LEPZPNTN.js";import{a as q,b as M,d as x}from"./chunk-G2NW625V.js";import{b as L,c as N,d as V}from"./chunk-FAK366X2.js";import"./chunk-D6Q2GR7X.js";import{a as U}from"./chunk-UXRWSNVZ.js";import{d as O,e as E,k as I,o as $,q as y,r as T}from"./chunk-MJVACJ6D.js";import{a as F,b as D}from"./chunk-2N4GTHXQ.js";import{a as h}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var Z=o=>o.split(`
|
|
2
|
+
`).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: ${U("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 P(e),d=u.spec!==null?await v(e,u.spec):null,R=await K(e,u),X=await k(e,R),Y=A(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 P(e),f=p.spec!==null?await v(e,p.spec):null,w=await K(e,p),C=await k(e,w),S=A(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=b(s,r,c));else{let r=L(a),c=N(r,s.discovery.answers);if(c===null)return e;s=b(s,c.id,n)}return V(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(`
|
|
3
|
+
`).filter(Boolean),n=[];for(let t of a)try{let s=JSON.parse(t);n.includes(s.file)||n.push(s.file)}catch{}return n}catch{return[]}};export{ye as main};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{c as u}from"./chunk-
|
|
1
|
+
import{c as u}from"./chunk-G65TSD56.js";import{a as i,e as m}from"./chunk-OLM5RTFK.js";import"./chunk-SOMEQCOS.js";import"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var p="http://localhost:11434",d=class{capabilities=["text_generation","streaming","vision"];provider="ollama";modelId;baseUrl;config;constructor(e,o){this.baseUrl=e,this.config=o,this.modelId=o.model}async generateText(e,o){let s=g(this.config,e,!1);try{let t=await fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),signal:o});if(!t.ok)throw await f(t);let r=await t.json();return h(r,this.modelId)}catch(t){throw t instanceof i?t:new i(t instanceof Error?t.message:String(t),{provider:"ollama",cause:t instanceof Error?t:void 0})}}async*streamText(e,o){let s=g(this.config,e,!0);try{let t=await fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),signal:o});if(!t.ok){yield{kind:"error",error:await f(t)};return}if(t.body===null){yield{kind:"error",error:new i("No response body",{provider:"ollama"})};return}for await(let r of u(t.body)){let l=k(r);l!==null&&(yield l)}}catch(t){t instanceof i?yield{kind:"error",error:t}:yield{kind:"error",error:new i(t instanceof Error?t.message:String(t),{provider:"ollama",cause:t instanceof Error?t:void 0})}}}close(){return Promise.resolve()}getRawClient(){return null}},v={provider:"ollama",createModel(n){let e=n.properties?.baseUrl??p;return Promise.resolve(new d(e,n))}},g=(n,e,o)=>{let s=y(e.messages,e.system),t={model:n.model,messages:s,stream:o},r={};return e.temperature!==void 0&&(r.temperature=e.temperature),e.maxTokens!==void 0&&(r.num_predict=e.maxTokens),e.topP!==void 0&&(r.top_p=e.topP),e.stopWords!==void 0&&(r.stop=e.stopWords),Object.keys(r).length>0&&(t.options=r),e.responseFormat!==void 0&&(e.responseFormat.type==="json_schema"?t.format=e.responseFormat.jsonSchema:e.responseFormat.type==="json_object"&&(t.format="json")),t},y=(n,e)=>{let o=[];e!==void 0&&o.push({role:"system",content:e});for(let s of n){if(s.role==="system"){let a=[];for(let c of s.content)c.kind==="text"&&a.push(c.text);o.push({role:"system",content:a.join(`
|
|
2
2
|
`)});continue}let t=[],r=[];for(let a of s.content)a.kind==="text"?t.push(a.text):a.kind==="image"&&a.image.url!==void 0&&r.push(a.image.url);let l={role:s.role==="tool"?"user":s.role,content:t.join(`
|
|
3
3
|
`)};r.length>0&&(l.images=r),o.push(l)}return o},h=(n,e)=>{let o=[];return n.message?.content!==void 0&&o.push({kind:"text",text:n.message.content}),{content:o,stopReason:n.done_reason==="length"?"max_tokens":"end_turn",usage:{inputTokens:n.prompt_eval_count??0,outputTokens:n.eval_count??0,totalTokens:(n.prompt_eval_count??0)+(n.eval_count??0)},modelId:e,rawResponse:n}},k=n=>{if(n===null||typeof n!="object")return null;let e=n;return e.done===!0?{kind:"message_done",stopReason:e.done_reason==="length"?"max_tokens":"end_turn",usage:{inputTokens:e.prompt_eval_count??0,outputTokens:e.eval_count??0,totalTokens:(e.prompt_eval_count??0)+(e.eval_count??0)}}:e.message?.content!==void 0&&e.message.content.length>0?{kind:"content_delta",textDelta:e.message.content}:e.response!==void 0&&e.response.length>0?{kind:"content_delta",textDelta:e.response}:null},f=async n=>{let e;try{e=(await n.json()).error??`Ollama HTTP ${n.status}`}catch{e=`Ollama HTTP ${n.status}: ${n.statusText}`}return m("ollama",n.status,new Error(e))};export{d as OllamaModel,v as ollamaFactory};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h,b as u,c as S,d as k,e as g,f as m,g as f}from"./chunk-
|
|
1
|
+
import{a as h,b as u,c as S,d as k,e as g,f as m,g as f}from"./chunk-G65TSD56.js";import{a as c}from"./chunk-OLM5RTFK.js";import"./chunk-SOMEQCOS.js";import"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var y=class{capabilities=["text_generation","streaming"];provider="opencode";modelId;binary;config;constructor(e,r){this.binary=e,this.config=r,this.modelId=r.model}async generateText(e,r){let o=w(this.config,e,"json"),i=f(e.messages,e.system);o.push("-p",i);let s=u(this.binary,o,{signal:r}),l=g(s.stderr),t=await k(s.stdout,this.modelId),p=await s.waitForExit(),a=await l,d=m("opencode",p.code,a);if(d!==null)throw d;return t}async*streamText(e,r){let o=w(this.config,e,"stream-json"),i=f(e.messages,e.system);o.push("-p",i);let s=u(this.binary,o,{signal:r}),l=g(s.stderr);try{for await(let d of S(s.stdout)){let x=v(d);x!==null&&(yield x)}let t=await s.waitForExit(),p=await l,a=m("opencode",t.code,p);a!==null&&(yield{kind:"error",error:a})}catch(t){t instanceof c?yield{kind:"error",error:t}:yield{kind:"error",error:new c(t instanceof Error?t.message:String(t),{provider:"opencode",cause:t instanceof Error?t:void 0})}}}close(){return Promise.resolve()}getRawClient(){return null}},b={provider:"opencode",async createModel(n){let e=await h("opencode",n);return new y(e,n)}},w=(n,e,r)=>{let o=["--output-format",r];o.push("--model",n.model),e.maxTokens!==void 0&&o.push("--max-tokens",String(e.maxTokens));let i=n.properties?.args;return i!==void 0&&o.push(...i),o},v=n=>{if(n===null||typeof n!="object")return null;let e=n;if(e.type==="content_block_delta"||e.type==="assistant"){let r=e.delta?.text??e.message?.content?.[0]?.text;return r!==void 0?{kind:"content_delta",textDelta:r}:null}return e.type==="result"||e.done===!0?{kind:"message_done",stopReason:"end_turn",usage:{inputTokens:e.usage?.input_tokens??0,outputTokens:e.usage?.output_tokens??0,totalTokens:(e.usage?.input_tokens??0)+(e.usage?.output_tokens??0)}}:e.type==="error"?{kind:"error",error:new c(e.error?.message??"Unknown OpenCode error",{provider:"opencode"})}:e.content!==void 0&&typeof e.content=="string"?{kind:"content_delta",textDelta:e.content}:null};export{y as OpenCodeModel,b as openCodeFactory};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as v,b as k}from"./chunk-XHFYREAD.js";import{a as p,b as w,c as h,h as r}from"./chunk-C2SQE5AG.js";import{c as $,d as c}from"./chunk-MJVACJ6D.js";import"./chunk-52HFDP2R.js";import{a as d,b as g}from"./chunk-2N4GTHXQ.js";import{a as n}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import{e as y}from"./chunk-DXB73IDG.js";var x=y($(),1);var M=async i=>{let e=n.process.cwd(),s=v(i),t=w({target:s==="agent"?"non-interactive":"interactive"});if(!k(i).includes("--force")){if(s==="agent")return r.error(t,"Purge requires `--force` flag in agent mode."),g({exitCode:1});let l=await h(t,{message:"This will remove all noskills specs, rules, concerns, and hooks. Continue?"});if(p(l)||l!==!0)return r.info(t,"Aborted."),d(void 0)}return r.step(t,"Purging noskills content..."),await u(`${e}/${c.concernsDir}`,t,"`.eser/concerns/`"),await u(`${e}/${c.specsDir}`,t,"`.eser/specs/`"),await u(`${e}/${c.rulesDir}`,t,"`.eser/rules/`"),await u(`${e}/${c.stateDir}`,t,"`.eser/.state/`"),await C(e,t),await T(e,t),await m(`${e}/.cursorrules`,t,"`.cursorrules`"),await m(`${e}/.windsurfrules`,t,"`.windsurfrules`"),await m(`${e}/.kiro/steering/conventions.md`,t,"`.kiro/steering/conventions.md`"),await m(`${e}/.github/copilot-instructions.md`,t,"`.github/copilot-instructions.md`"),await F(e,t),r.success(t,"Purge complete."),d(void 0)},u=async(i,e,s)=>{try{await n.fs.stat(i);let{rmSync:t}=await import("node:fs");t(i,{recursive:!0,force:!0}),r.step(e,` Removed ${s}`)}catch{}},m=async(i,e,s)=>{try{await n.fs.stat(i);let{unlinkSync:t}=await import("node:fs");t(i),r.step(e,` Removed ${s}`)}catch{}},C=async(i,e)=>{let s=`${i}/${c.manifestFile}`;try{let t=await n.fs.readTextFile(s),o=x.parseDocument(t);o.has("noskills")&&(o.delete("noskills"),await n.fs.writeTextFile(s,o.toString()),r.step(e," Removed noskills section from `manifest.yml`"))}catch{}},T=async(i,e)=>{let s=`${i}/CLAUDE.md`,t="<!-- noskills:start -->",o="<!-- noskills:end -->";try{let a=await n.fs.readTextFile(s),l=a.indexOf(t),f=a.indexOf(o);l!==-1&&f!==-1&&(a=a.slice(0,l).trimEnd()+`
|
|
2
|
+
`+a.slice(f+o.length).trimStart(),await n.fs.writeTextFile(s,a.trimEnd()+`
|
|
3
|
+
`),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)+`
|
|
4
|
+
`),r.step(e," Removed hooks from `.claude/settings.json`"))}catch{}};export{M as main};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as u}from"./chunk-OM4QJ24S.js";import{e as c,f as d}from"./chunk-MJVACJ6D.js";import{d as a,g as o,o as m,q as p,r as l}from"./chunk-52HFDP2R.js";import{a as r}from"./chunk-2N4GTHXQ.js";import{a as n}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var N=async w=>{let e=m({renderer:l.ansi(),sink:p.stdout()}),i=n.process.cwd(),s=await c(i);if(s.phase==="IDLE"||s.phase==="UNINITIALIZED")return e.writeln(a("Already idle. Nothing to reset.")),await e.close(),r(void 0);let t=s.spec,f=u(s);return await d(i,f),e.writeln(o("\u2714")," Reset to IDLE."),t!==null&&e.writeln(a(`Spec "${t}" state cleared. Files in .eser/specs/${t}/ preserved.`)),await e.close(),r(void 0)};export{N as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as y,b as k}from"./chunk-LEPZPNTN.js";import{a as g,b as x}from"./chunk-UXRWSNVZ.js";import{d as w,k as c}from"./chunk-MJVACJ6D.js";import{c as p,d as o,f,g as h,o as a,q as l,r as d}from"./chunk-52HFDP2R.js";import{a as u,b as m}from"./chunk-2N4GTHXQ.js";import{a as i}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.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=x(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+`
|
|
2
|
+
`),e.writeln(h("\u2714")," Rule added: ",o(n)),r!==null&&r.tools.length>0&&(await k(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 y(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};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as L}from"./chunk-SBUQXH6U.js";import{a as V,f as B}from"./chunk-OM4QJ24S.js";import{a as D,b as A,d as N}from"./chunk-C2SQE5AG.js";import{a as G}from"./chunk-LEPZPNTN.js";import"./chunk-FAK366X2.js";import"./chunk-D6Q2GR7X.js";import{a as M,b as C}from"./chunk-UXRWSNVZ.js";import{e as x,f as g,k as $,o as F,r as U}from"./chunk-MJVACJ6D.js";import{c as P,d as r,f as u,g as v,h,k as I,o as R,q as O,r as T}from"./chunk-52HFDP2R.js";import{a as S,b as w}from"./chunk-2N4GTHXQ.js";import{a as y}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.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: ${M("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=B(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=V(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 G(e),j=L(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-RWDPEKPY.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-RWDPEKPY.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(`
|
|
2
|
+
`)},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}
|
|
3
|
+
`;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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as j,i as F}from"./chunk-OM4QJ24S.js";import{a as T,d as U}from"./chunk-G2NW625V.js";import{a as x,b as C}from"./chunk-UXRWSNVZ.js";import{d as S,e as P,f as I,g as A,h as L,i as R,j as O,k,r as z}from"./chunk-MJVACJ6D.js";import{c as d,d as c,f as w,g as $,h as E,k as N,o as y,q as D,r as v}from"./chunk-52HFDP2R.js";import{a as h,b as g}from"./chunk-2N4GTHXQ.js";import{a as l}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as I,d as w}from"./chunk-G2NW625V.js";import{a as h}from"./chunk-FAK366X2.js";import"./chunk-D6Q2GR7X.js";import{a as f}from"./chunk-UXRWSNVZ.js";import{e as y,k as u,r as D}from"./chunk-MJVACJ6D.js";import{c as i,d as r,f as c,g as b,h as o,k as E,o as p,q as d,r as m}from"./chunk-52HFDP2R.js";import{a as g,b as C}from"./chunk-2N4GTHXQ.js";import{a as x}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.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(f("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:h.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(`${f("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}/${h.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as g}from"./chunk-LEPZPNTN.js";import{a as w}from"./chunk-UXRWSNVZ.js";import{k as u}from"./chunk-MJVACJ6D.js";import{c as m,d as r,f as c,g as n,o as p,q as d,r as f}from"./chunk-52HFDP2R.js";import{a as o,b as a}from"./chunk-2N4GTHXQ.js";import{a as l}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.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(w("init",e))),await s.close(),a({exitCode:1});s.writeln(r("Syncing tool files..."));let i=await g(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};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{a as S,c as E}from"./chunk-6XR33H6Q.js";import{a as C,c as M}from"./chunk-G2NW625V.js";import{e as T,k as y,r as b}from"./chunk-MJVACJ6D.js";import{a as x,b as k}from"./chunk-2N4GTHXQ.js";import{a as m}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var D=async e=>{let s=await T(e),l=await y(e),d=await L(e),o=null,u=null,n=0,c=0;if(s.spec!==null){let i=await S(e,s.spec);if(i!==null){n=i.tasks.length,c=s.execution.completedTasks.length;let a=E(i.tasks,s.execution.completedTasks);a!==null&&(o=a.id,u=a.title)}}let $=null;return s.lastCalledAt!==null&&($=Math.floor((Date.now()-new Date(s.lastCalledAt).getTime())/1e3)),{spec:s.spec,phase:s.phase,iteration:s.execution.iteration,activeTaskId:o,activeTaskTitle:u,totalTasks:n,completedTaskCount:c,lastProgress:s.execution.lastProgress,lastCalledAt:s.lastCalledAt,modifiedFiles:s.execution.modifiedFiles,debt:s.execution.debt,concerns:l?.concerns??[],maxIterations:l?.maxIterationsBeforeRestart??15,awaitingStatusReport:s.execution.awaitingStatusReport,pendingClear:s.pendingClear,verificationPassed:s.execution.lastVerification?.passed??null,decisionsCount:s.decisions.length,discoveryAnswered:s.discovery.answers.length,discoveryTotal:6,trackedFiles:d,timeSinceUpdate:$}},L=async e=>{let s=`${e}/.eser/.state/files-changed.jsonl`;try{let d=(await m.fs.readTextFile(s)).trim().split(`
|
|
2
|
+
`).filter(Boolean),o=[];for(let u of d)try{let n=JSON.parse(u);o.includes(n.file)||o.push(n.file)}catch{}return o}catch{return[]}},F="\x1B[2J\x1B[H",I="\x1B[1m",r="\x1B[2m",t="\x1B[0m",f="\x1B[32m",p="\x1B[33m",w="\x1B[31m",P="\x1B[36m",O=e=>{switch(e){case"DONE":return f;case"BLOCKED":return w;case"EXECUTING":return P;default:return p}},A=(e,s,l)=>{if(s===0)return"\u2591".repeat(l);let d=Math.min(e/s,1),o=Math.round(d*l);return"\u2588".repeat(o)+"\u2591".repeat(l-o)},v=e=>e===null?"never":e<60?`${e}s ago`:e<3600?`${Math.floor(e/60)}m ago`:`${Math.floor(e/3600)}h ago`,R=e=>{let s=[],d="\u2500".repeat(52);s.push(`${r}\u256D${d}\u256E${t}`),s.push(`${r}\u2502${t} ${I}noskills watch${t} \u2014 ${e.spec??"no active spec"}${r}${" ".repeat(Math.max(0,34-(e.spec?.length??15)))}\u2502${t}`);let o=O(e.phase);if(s.push(`${r}\u2502${t} Phase: ${o}${e.phase}${t}${" ".repeat(Math.max(0,42-e.phase.length))}${r}\u2502${t}`),e.phase==="DISCOVERY")s.push(`${r}\u2502${t} Discovery: ${e.discoveryAnswered}/${e.discoveryTotal} questions answered${" ".repeat(Math.max(0,14))}${r}\u2502${t}`);else if(e.phase==="SPEC_DRAFT")s.push(`${r}\u2502${t} ${p}Awaiting approval${t}${" ".repeat(Math.max(0,33))}${r}\u2502${t}`);else if(e.phase==="EXECUTING"||e.phase==="BLOCKED"){let n=A(e.completedTaskCount,e.totalTasks,12),c=e.totalTasks>0?Math.round(e.completedTaskCount/e.totalTasks*100):0,$=`${n} ${e.completedTaskCount}/${e.totalTasks} tasks (${c}%)`;if(s.push(`${r}\u2502${t} Progress: ${f}${$}${t}${" ".repeat(Math.max(0,40-$.length))}${r}\u2502${t}`),s.push(`${r}\u2502${t} Iteration: ${e.iteration}${" ".repeat(Math.max(0,38-String(e.iteration).length))}${r}\u2502${t}`),e.activeTaskId!==null){let a=`${e.activeTaskId}${e.activeTaskTitle!==null?` (${e.activeTaskTitle})`:""}`.slice(0,36);s.push(`${r}\u2502${t} Active task: ${P}${a}${t}${" ".repeat(Math.max(0,36-a.length))}${r}\u2502${t}`)}if(e.phase==="BLOCKED"){let i=(e.lastProgress??"unknown").replace(/^BLOCKED:\s*/,"");s.push(`${r}\u2502${t} ${w}BLOCKED: ${i.slice(0,40)}${t}${" ".repeat(Math.max(0,40-i.slice(0,40).length))}${r}\u2502${t}`),s.push(`${r}\u2502${t} ${p}Human input needed${t}${" ".repeat(Math.max(0,32))}${r}\u2502${t}`)}}else e.phase==="DONE"&&s.push(`${r}\u2502${t} ${f}Complete!${t} ${e.iteration} iterations, ${e.decisionsCount} decisions${" ".repeat(Math.max(0,17-String(e.iteration).length-String(e.decisionsCount).length))}${r}\u2502${t}`);if(s.push(`${r}\u2502${"".padEnd(52)}\u2502${t}`),s.push(`${r}\u2502${t} Last update: ${v(e.timeSinceUpdate)}${" ".repeat(Math.max(0,36-v(e.timeSinceUpdate).length))}${r}\u2502${t}`),e.lastProgress!==null){let n=e.lastProgress.slice(0,48);s.push(`${r}\u2502${t} ${r}${n}${t}${" ".repeat(Math.max(0,50-n.length))}${r}\u2502${t}`)}if(e.awaitingStatusReport&&s.push(`${r}\u2502${t} ${p}Status report pending${t}${" ".repeat(Math.max(0,29))}${r}\u2502${t}`),e.pendingClear&&s.push(`${r}\u2502${t} ${p}/clear pending${t}${" ".repeat(Math.max(0,36))}${r}\u2502${t}`),e.verificationPassed===!1&&s.push(`${r}\u2502${t} ${w}Verification failed${t}${" ".repeat(Math.max(0,31))}${r}\u2502${t}`),s.push(`${r}\u2502${"".padEnd(52)}\u2502${t}`),e.debt!==null&&e.debt.items.length>0){s.push(`${r}\u2502${t} Debt: ${e.debt.items.length} item(s)${" ".repeat(Math.max(0,34))}${r}\u2502${t}`);for(let n of e.debt.items.slice(0,3)){let c=n.slice(0,44);s.push(`${r}\u2502${t} \u2514\u2500 ${c}${" ".repeat(Math.max(0,46-c.length))}${r}\u2502${t}`)}e.debt.items.length>3&&s.push(`${r}\u2502${t} \u2514\u2500 ... and ${e.debt.items.length-3} more${" ".repeat(Math.max(0,32))}${r}\u2502${t}`)}if(e.trackedFiles.length>0||e.modifiedFiles.length>0){let n=e.trackedFiles.length>0?e.trackedFiles:e.modifiedFiles;s.push(`${r}\u2502${t} Files changed: ${n.length}${" ".repeat(Math.max(0,34-String(n.length).length))}${r}\u2502${t}`);for(let c of n.slice(0,5)){let $=c.length>44?"..."+c.slice(-41):c;s.push(`${r}\u2502${t} \u2514\u2500 ${$}${" ".repeat(Math.max(0,46-$.length))}${r}\u2502${t}`)}n.length>5&&s.push(`${r}\u2502${t} \u2514\u2500 ... and ${n.length-5} more${" ".repeat(Math.max(0,32))}${r}\u2502${t}`)}if(s.push(`${r}\u2502${"".padEnd(52)}\u2502${t}`),e.concerns.length>0){let n=e.concerns.join(", ").slice(0,38);s.push(`${r}\u2502${t} Concerns: ${n}${" ".repeat(Math.max(0,40-n.length))}${r}\u2502${t}`)}let u=e.iteration>=e.maxIterations?`${w}RESTART RECOMMENDED${t}`:`${f}ok${t} (${e.iteration}/${e.maxIterations})`;return s.push(`${r}\u2502${t} Context: ${u}${" ".repeat(Math.max(0,41-u.replace(/\x1b\[[0-9;]*m/g,"").length))}${r}\u2502${t}`),s.push(`${r}\u2570${d}\u256F${t}`),s.push(` ${r}watching .eser/.state/ for changes... (ctrl+c to stop)${t}`),s.join(`
|
|
3
|
+
`)},W=e=>JSON.stringify({ts:new Date().toISOString(),phase:e.phase,spec:e.spec,iteration:e.iteration,activeTask:e.activeTaskId,tasks:{completed:e.completedTaskCount,total:e.totalTasks},progress:e.lastProgress,debt:e.debt?.items.length??0,filesChanged:e.trackedFiles.length>0?e.trackedFiles:e.modifiedFiles,timeSinceUpdate:e.timeSinceUpdate,pendingClear:e.pendingClear,verificationPassed:e.verificationPassed}),J=async e=>{let s=m.process.cwd(),l=C(e);if(!await b(s)){let i=new TextEncoder,a=m.process.stdout.getWriter();return await a.write(i.encode(`noskills not initialized.
|
|
4
|
+
`)),a.releaseLock(),k({exitCode:1})}let d=`${s}/.eser/.state`,o="",u=async()=>{let i=await D(s),a=l==="json"?W(i):l==="markdown"?M(i,"markdown"):R(i);if(l==="json"){let g=new TextEncoder,h=m.process.stdout.getWriter();await h.write(g.encode(a+`
|
|
5
|
+
`)),h.releaseLock()}else if(l==="markdown"){let g=new TextEncoder,h=m.process.stdout.getWriter();await h.write(g.encode(a+`
|
|
6
|
+
---
|
|
7
|
+
`)),h.releaseLock()}else if(a!==o){let g=new TextEncoder,h=m.process.stdout.getWriter();await h.write(g.encode(F+a+`
|
|
8
|
+
`)),h.releaseLock(),o=a}return i.phase==="DONE"};if(await u())return x(void 0);let c=1e3,$=0;for(;;){await new Promise(i=>setTimeout(i,c));try{let a=(await m.fs.stat(`${d}/state.json`)).mtime?.getTime()??0;if(a>$&&($=a,await new Promise(h=>setTimeout(h,100)),await u()))break}catch{}}return x(void 0)};export{D as buildSnapshot,J as main,W as renderJsonLine,R as renderTerminal};
|
package/noskills.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as t}from"./chunks/chunk-TNKUKNM4.js";import{c as o}from"./chunks/chunk-2N4GTHXQ.js";import{a as s}from"./chunks/chunk-FPO2JRU3.js";import"./chunks/chunk-SG4G3OOO.js";import"./chunks/chunk-FDZP7B5Y.js";import"./chunks/chunk-ACQUINWH.js";import"./chunks/chunk-DXB73IDG.js";var i=new t({description:"noskills \u2014 state-machine orchestrator for AI agents",modules:{init:{description:"Initialize noskills in project",load:()=>import("./chunks/init-
|
|
2
|
+
import{a as t}from"./chunks/chunk-TNKUKNM4.js";import{c as o}from"./chunks/chunk-2N4GTHXQ.js";import{a as s}from"./chunks/chunk-FPO2JRU3.js";import"./chunks/chunk-SG4G3OOO.js";import"./chunks/chunk-FDZP7B5Y.js";import"./chunks/chunk-ACQUINWH.js";import"./chunks/chunk-DXB73IDG.js";var i=new t({description:"noskills \u2014 state-machine orchestrator for AI agents",modules:{init:{description:"Initialize noskills in project",load:()=>import("./chunks/init-FMAEQACG.js")},status:{description:"Show current state",load:()=>import("./chunks/status-K2DRYXDX.js")},spec:{description:"Manage specs (new, list)",load:()=>import("./chunks/spec-BLGJLET3.js")},next:{description:"Get next instruction for agent",load:()=>import("./chunks/next-WEQWWHMJ.js")},approve:{description:"Approve phase transition",load:()=>import("./chunks/approve-UATWGG53.js")},block:{description:"Mark spec as blocked",load:()=>import("./chunks/block-IDVJLPNV.js")},reset:{description:"Reset current spec state",load:()=>import("./chunks/reset-2II5XIWI.js")},done:{description:"Mark spec execution as complete",load:()=>import("./chunks/done-LOYNEBUX.js")},concern:{description:"Manage concerns (add, remove, list)",load:()=>import("./chunks/concern-JUE2IFQI.js")},run:{description:"Autonomous execution loop (Ralph loop)",load:()=>import("./chunks/run-EP6XJQXK.js")},watch:{description:"Live dashboard for monitoring agent progress",load:()=>import("./chunks/watch-DTNAKL6O.js")},sync:{description:"Regenerate tool-specific files",load:()=>import("./chunks/sync-NR33ZH7R.js")},purge:{description:"Remove all noskills content (specs, rules, concerns, hooks)",load:()=>import("./chunks/purge-AISADFMA.js")},"invoke-hook":{description:"Internal hook handlers (called by agents)",load:()=>import("./chunks/invoke-hook-2VRIZ4VU.js")},rule:{description:"Manage rules (add, list, promote)",load:()=>import("./chunks/rule-3UTOQ32B.js")}}});var r={name:"@eser/noskills",version:"4.1.29",type:"module",exports:{".":"./main.ts","./mod":"./mod.ts","./module":"./module.ts"},dependencies:{"@eser/ai":"workspace:*","@eser/primitives":"workspace:*","@eser/shell":"workspace:*","@eser/standards":"workspace:*","@eser/streams":"workspace:*",yaml:"^2"},devDependencies:{"@std/assert":"npm:@jsr/std__assert@^1.0.16","@std/testing":"npm:@jsr/std__testing@^1.0.16"}};var p=i.toCommand("noskills",r.version),d=async()=>await p.parse();if(import.meta.main){let n=await d();o(n,{ok:()=>{},fail:e=>{e.message!==void 0&&console.error(e.message),s.process.setExitCode(e.exitCode)}})}export{d as main};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as w}from"./chunk-LXVBR775.js";import{d as h,e as u}from"./chunk-NGURBONB.js";import{c as r,d as o,e as i,f as p,i as l,l as m,n as c,o as d}from"./chunk-JYJTZEC4.js";import{a}from"./chunk-2N4GTHXQ.js";import{a as n}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var D=async g=>{let e=m({renderer:d.ansi(),sink:c.stdout()}),t=n.process.cwd(),s=await h(t);if(s.phase==="SPEC_DRAFT"){let f=w(s);await u(t,f),e.writeln(p("\u2714")," Spec approved. Phase: ",l("BUILDING")),e.writeln("Run ",r("noskills next")," to start building.")}else s.phase==="DISCOVERY"&&s.discovery.completed?(e.writeln(o("Discovery complete. Spec draft already generated.")),e.writeln("Review the spec and run ",r("noskills approve")," again when in SPEC_DRAFT phase.")):e.writeln(i(`Cannot approve in phase: ${s.phase}`));return await e.close(),a(void 0)};export{D as main};
|
package/chunks/block-4I5XBXK7.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as h}from"./chunk-LXVBR775.js";import{d as w,e as f}from"./chunk-NGURBONB.js";import{c as i,d as l,e as m,g as p,l as c,n as d,o as u}from"./chunk-JYJTZEC4.js";import{a as o,b as n}from"./chunk-2N4GTHXQ.js";import{a}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var A=async k=>{let e=c({renderer:u.ansi(),sink:d.stdout()}),t=a.process.cwd(),r=k?.join(" ")??"No reason given",s=await w(t);if(s.phase!=="BUILDING")return e.writeln(m(`Cannot block in phase: ${s.phase}`)),await e.close(),n({exitCode:1});let g=h(s,r);return await f(t,g),e.writeln(p("\u26A0")," Spec blocked: ",l(r)),e.writeln("Resolve with: ",i('noskills next --answer="resolution"')),await e.close(),o(void 0)};export{A as main};
|
package/chunks/chunk-BK2BDHKB.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var s=[{id:"open-source",name:"Open Source",description:"Community-driven, inclusive, well-documented. Prioritize contributor experience, avoid exclusionary patterns, default to permissive choices.",extras:[{questionId:"status_quo",text:"Is this workaround common in the community?"},{questionId:"user_impact",text:"Does this make contribution harder?"}],specSections:["Contributor Guide","Public API Surface"],reminders:["Endpoint should be documented in API docs","Consider contributor experience for new patterns","Default to permissive, well-documented choices"]},{id:"beautiful-product",name:"Beautiful Product",description:"Design and UX are first-class. Agent critiques UI/UX like a passionate designer. Empty states, error states, loading states, mobile layout \u2014 nothing ships unspecified.",extras:[{questionId:"status_quo",text:"How painful is the current experience?"},{questionId:"ambition",text:"In the 10-star version, what does the user feel?"}],specSections:["Design States (empty, loading, error, success)","Mobile Layout","Interaction Design"],reminders:["Loading state and error state must be designed, not placeholder","No AI slop \u2014 every UI element is intentional","Empty states need clear CTAs with examples"]},{id:"long-lived",name:"Long-Lived",description:"Built to last. Stability, maintainability, and backward compatibility matter. Every shortcut needs justification. Favor boring technology.",extras:[{questionId:"reversibility",text:"Will this decision still be correct in 2 years?"},{questionId:"scope_boundary",text:"What technical debt would this introduce?"}],specSections:["Migration & Deprecation","Backward Compatibility"],reminders:["Favor boring technology over shiny new tools","Every shortcut needs explicit justification","Consider maintenance burden for new dependencies"]},{id:"move-fast",name:"Move Fast",description:"Optimize for shipping speed. Acceptable trade-offs on polish. Good enough is good enough. Reduce ceremony.",extras:[{questionId:"scope_boundary",text:"Which polish items can be deferred to v2?"},{questionId:"ambition",text:"What is the minimum viable 5-star version?"}],specSections:["v1 vs v2 Scope"],reminders:["Good enough is good enough \u2014 ship it","Reduce ceremony, optimize for feedback speed","Mark polish items for v2 explicitly"]},{id:"compliance",name:"Compliance",description:"Audit trails, access controls, data handling rules. Every change is traceable. Verification is mandatory, not optional.",extras:[{questionId:"reversibility",text:"Is the audit trail preserved on rollback?"},{questionId:"verification",text:"Is there an audit/traceability requirement?"}],specSections:["Audit Trail","Access Control","Data Handling"],reminders:["Every state change must be traceable","Verification is mandatory, not optional","Document data handling and retention policies"]},{id:"learning-project",name:"Learning Project",description:"Experimentation is the goal. Encourage trying new patterns, don't punish dead ends. Document learnings over polish.",extras:[{questionId:"ambition",text:"What do you want to learn from building this?"},{questionId:"scope_boundary",text:"What experiments are explicitly allowed?"}],specSections:["Learning Goals","Experiment Log"],reminders:["Document learnings, not just outcomes","Dead ends are acceptable \u2014 document why","Try new patterns freely, polish later"]}],r=(i,t)=>{let e=[];for(let n of i)for(let o of n.extras)o.questionId===t&&e.push(o);return e},a=i=>{let t=[];for(let e of i)for(let n of e.reminders)t.push(`${e.id}: ${n}`);return t},c=i=>{let t=[],e=i.map(n=>n.id);return e.includes("move-fast")&&e.includes("compliance")&&t.push({between:["move-fast","compliance"],issue:"Speed vs traceability \u2014 shortcuts may violate audit requirements."}),e.includes("move-fast")&&e.includes("long-lived")&&t.push({between:["move-fast","long-lived"],issue:"Shipping speed vs maintainability \u2014 tech debt decisions need human approval."}),e.includes("beautiful-product")&&e.includes("move-fast")&&t.push({between:["beautiful-product","move-fast"],issue:"Design polish vs speed \u2014 which UI states can be deferred?"}),t};export{s as a,r as b,a as c,c as d};
|
package/chunks/chunk-JYJTZEC4.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import{a as D}from"./chunk-FPO2JRU3.js";import{d as B}from"./chunk-DXB73IDG.js";var h=e=>e.map(n=>typeof n=="string"?K(n):n),K=e=>({kind:"text",value:e}),oe=(...e)=>({kind:"bold",children:h(e)}),ae=(...e)=>({kind:"dim",children:h(e)});var b=(e,...n)=>({kind:"color",color:e,children:h(n)}),ie=(...e)=>b("red",...e),se=(...e)=>b("green",...e),pe=(...e)=>b("yellow",...e);var le=(...e)=>b("magenta",...e),ue=(...e)=>b("cyan",...e),de=(...e)=>b("gray",...e);var me=(e,n)=>({kind:"table",headers:h(e),rows:n.map(r=>h(r))});var c=e=>{switch(e.kind){case"text":return e.value.length;case"newline":return 1;case"bold":case"dim":case"italic":case"underline":case"strikethrough":case"color":case"group":return e.children.reduce((n,r)=>n+c(r),0);case"code-block":return e.value.length;case"table":case"list":return 0}};var k=(e,n)=>{let r=typeof e=="string"?"text":e instanceof Uint8Array?"bytes":"structured";return{data:e,meta:{timestamp:Date.now(),kind:r,channel:"stdout",...n}}};var E=e=>{switch(e.kind){case"text":return e.value;case"newline":return`
|
|
2
|
-
`;case"bold":case"dim":case"italic":case"underline":case"strikethrough":case"color":case"group":return e.children.map(E).join("");case"code-block":return e.value.split(`
|
|
3
|
-
`).map(n=>` ${n}`).join(`
|
|
4
|
-
`)+`
|
|
5
|
-
`;case"table":{let n=e.headers.map((s,p)=>{let i=e.rows.reduce((C,u)=>{let d=u[p];return Math.max(C,d!==void 0?c(d):0)},0);return Math.max(c(s),i)}),r=(s,p)=>{let i=E(s),C=c(s);return i+" ".repeat(Math.max(0,p-C))},o=e.headers.map((s,p)=>r(s,n[p])).join(" "),t=n.map(s=>"-".repeat(s)).join(" "),m=e.rows.map(s=>s.map((p,i)=>r(p,n[i])).join(" ")).join(`
|
|
6
|
-
`);return`${o}
|
|
7
|
-
${t}
|
|
8
|
-
${m}
|
|
9
|
-
`}case"list":return e.items.map(n=>` - ${n.map(E).join("")}`).join(`
|
|
10
|
-
`)+`
|
|
11
|
-
`}},P=()=>({name:"plain",render:e=>e.map(E).join("")});var $=()=>{let e=[];return{name:"buffer",writable:new WritableStream({write(n){e.push(n)}}),chunks:()=>e,items:()=>e.map(n=>n.data),clear:()=>{e.length=0}}};var V=e=>{console.error(`[streams] Error at chunk #${e.chunkIndex} (${e.pendingCount} pending):`,e.error)},q=e=>{let n=[],r=e?.onError??V,o=e?.renderer??P(),t=!1,m=0,s=!1,p,u=(()=>{let l=e?.sink??$(),f=e?.layers??[];if(f.length===0)return l.writable;let{readable:O,writable:J}=new TransformStream,j=O;for(let R of f)j=j.pipeThrough(R.transform());return j.pipeTo(l.writable).catch(R=>{r({error:R,chunkIndex:m,pendingCount:n.length,lastChunk:n[n.length-1]})}),J})().getWriter(),d=async()=>{for(t=!1;n.length>0;){let l=n.shift();try{await u.ready,await u.write(l),m++}catch(f){r({error:f,chunkIndex:m,pendingCount:n.length,lastChunk:l}),n.length=0;break}}p!==void 0&&(p(),p=void 0)},y=()=>{t||(t=!0,queueMicrotask(d))},g=l=>{s||(n.push(l),y())},v={write:(...l)=>{let f=h(l),O=o.render(f);g(k(O))},writeln:(...l)=>{let f=h(l),O=o.render(f)+`
|
|
12
|
-
`;g(k(O))},flush:()=>n.length===0&&!t?Promise.resolve():new Promise(l=>{p=l,y()}),close:async()=>{s=!0,await v.flush();try{await u.close()}catch{}},pipe:(...l)=>q({sink:e?.sink,renderer:e?.renderer,layers:[...e?.layers??[],...l],onError:r})};return v};var L=class extends Error{constructor(n){super(n),this.name="StreamError"}},w=class extends L{cause;constructor(n,r){super(n),this.name="PipelineError",this.cause=r}},T=class extends L{constructor(n){super(`Pipeline timed out after ${n}ms`),this.name="TimeoutError"}};var X=()=>{let e,n=[],r,o={from:t=>(e=t,o),through:(...t)=>(n.push(...t),o),to:t=>(r=t,o),run:async t=>{if(e===void 0)throw new w("Pipeline has no source. Call .from() first.");if(r===void 0)throw new w("Pipeline has no sink. Call .to() first.");let m=e.readable;for(let i of n)m=m.pipeThrough(i.transform());let s=new AbortController,p;t?.timeout!==void 0&&t.timeout>0&&(p=setTimeout(()=>{s.abort(new T(t.timeout))},t.timeout));try{await m.pipeTo(r.writable,{signal:s.signal})}catch(i){throw i instanceof T?i:i instanceof DOMException&&i.name==="AbortError"?new T(t?.timeout??0):new w(`Pipeline failed: ${i instanceof Error?i.message:String(i)}`,i instanceof Error?i:void 0)}finally{p!==void 0&&clearTimeout(p)}},collect:async()=>{let t=$();return r=t,await o.run(),t.items()}};return o};var _={};B(_,{buffer:()=>$,multiplex:()=>G,nullSink:()=>U,stdout:()=>H,writable:()=>A});var W,Z=()=>(W===void 0&&(W=new TextEncoder),W),H=()=>{let e=D.process.stdout;return{name:"stdout",writable:new WritableStream({async write(n){let r=String(n.data),o=Z().encode(r),t=e.getWriter();try{await t.write(o)}finally{t.releaseLock()}}})}};var U=()=>({name:"null",writable:new WritableStream({write(e){}})});var A=(e,n)=>({name:n??"writable",writable:e});var G=(...e)=>{let n=e.map(r=>({name:r.name,writer:r.writable.getWriter()}));return{name:`multiplex(${e.map(r=>r.name).join(",")})`,writable:new WritableStream({async write(r){await Promise.all(n.map(o=>o.writer.write(r)))},async close(){await Promise.all(n.map(r=>r.writer.close()))},async abort(r){await Promise.all(n.map(o=>o.writer.abort(r)))}})}};var F={};B(F,{ansi:()=>N,markdown:()=>Y,plain:()=>P});var a="\x1B[",ee=`${a}0m`,x={bold:[`${a}1m`,`${a}22m`],dim:[`${a}2m`,`${a}22m`],italic:[`${a}3m`,`${a}23m`],underline:[`${a}4m`,`${a}24m`],strikethrough:[`${a}9m`,`${a}29m`]},z={black:`${a}30m`,red:`${a}31m`,green:`${a}32m`,yellow:`${a}33m`,blue:`${a}34m`,magenta:`${a}35m`,cyan:`${a}36m`,white:`${a}37m`,gray:`${a}90m`},ne=`${a}39m`,I=e=>{switch(e.kind){case"text":return e.value;case"newline":return`
|
|
13
|
-
`;case"bold":case"dim":case"italic":case"underline":case"strikethrough":{let[n,r]=x[e.kind];return`${n}${e.children.map(I).join("")}${r}`}case"color":return`${z[e.color]??z.white}${e.children.map(I).join("")}${ne}`;case"group":return e.children.map(I).join("");case"code-block":{let n=x.dim[0],r=x.dim[1];return e.value.split(`
|
|
14
|
-
`).map(o=>`${n} ${o}${r}`).join(`
|
|
15
|
-
`)+`
|
|
16
|
-
`}case"table":{let n=e.headers.map((u,d)=>{let y=e.rows.reduce((g,v)=>{let l=v[d];return Math.max(g,l!==void 0?c(l):0)},0);return Math.max(c(u),y)}),r=x.bold[0],o=x.bold[1],t=x.dim[0],m=x.dim[1],s=(u,d)=>{let y=I(u),g=c(u);return y+" ".repeat(Math.max(0,d-g))},p=e.headers.map((u,d)=>`${r}${s(u,n[d])}${o}`).join(" "),i=`${t}${n.map(u=>"\u2500".repeat(u)).join("\u2500\u2500")}${m}`,C=e.rows.map(u=>u.map((d,y)=>s(d,n[y])).join(" ")).join(`
|
|
17
|
-
`);return`${p}
|
|
18
|
-
${i}
|
|
19
|
-
${C}
|
|
20
|
-
`}case"list":return e.items.map(n=>` \u2022 ${n.map(I).join("")}`).join(`
|
|
21
|
-
`)+`
|
|
22
|
-
`}},N=()=>({name:"ansi",render:e=>{let n=e.map(I).join("");return n.includes(a)?n+ee:n}});var S=e=>{switch(e.kind){case"text":return e.value;case"newline":return`
|
|
23
|
-
`;case"bold":return`**${e.children.map(S).join("")}**`;case"italic":return`*${e.children.map(S).join("")}*`;case"strikethrough":return`~~${e.children.map(S).join("")}~~`;case"dim":case"underline":case"color":case"group":return e.children.map(S).join("");case"code-block":return`\`\`\`${e.language??""}
|
|
24
|
-
${e.value}
|
|
25
|
-
\`\`\`
|
|
26
|
-
`;case"table":{let n=`| ${e.headers.map(S).join(" | ")} |`,r=`| ${e.headers.map(()=>"---").join(" | ")} |`,o=e.rows.map(t=>`| ${t.map(S).join(" | ")} |`).join(`
|
|
27
|
-
`);return`${n}
|
|
28
|
-
${r}
|
|
29
|
-
${o}
|
|
30
|
-
`}case"list":return e.items.map(n=>`- ${n.map(S).join("")}`).join(`
|
|
31
|
-
`)+`
|
|
32
|
-
`}},Y=()=>({name:"markdown",render:e=>e.map(S).join("")});export{k as a,K as b,oe as c,ae as d,ie as e,se as f,pe as g,le as h,ue as i,de as j,me as k,q as l,X as m,_ as n,F as o};
|
package/chunks/chunk-LXVBR775.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var n={UNINITIALIZED:["IDLE"],IDLE:["DISCOVERY"],DISCOVERY:["SPEC_DRAFT"],SPEC_DRAFT:["SPEC_APPROVED"],SPEC_APPROVED:["BUILDING"],BUILDING:["DONE","BLOCKED"],BLOCKED:["BUILDING"],DONE:["IDLE"]},o=(e,s)=>n[e].includes(s),t=(e,s)=>{if(!o(e,s))throw new Error(`Invalid phase transition: ${e} \u2192 ${s}. Allowed: ${n[e].join(", ")}`)},l=(e,s)=>(t(e.phase,s),{...e,phase:s}),h=(e,s,a)=>(t(e.phase,"DISCOVERY"),{...e,phase:"DISCOVERY",spec:s,branch:a,discovery:{answers:[],completed:!1},specState:{path:null,status:"none"},building:{iteration:0,lastProgress:null},decisions:[]}),p=(e,s,a)=>{if(e.phase!=="DISCOVERY")throw new Error(`Cannot add discovery answer in phase: ${e.phase}`);let r=[...e.discovery.answers.filter(i=>i.questionId!==s),{questionId:s,answer:a}];return{...e,discovery:{answers:r,completed:e.discovery.completed}}},d=e=>{if(e.phase!=="DISCOVERY")throw new Error(`Cannot complete discovery in phase: ${e.phase}`);return{...e,phase:"SPEC_DRAFT",discovery:{...e.discovery,completed:!0},specState:{path:`.nos/specs/${e.spec}/spec.md`,status:"draft"}}},S=e=>(t(e.phase,"SPEC_APPROVED"),{...e,phase:"BUILDING",specState:{...e.specState,status:"approved"},building:{iteration:0,lastProgress:null}}),m=(e,s)=>{if(e.phase!=="BUILDING")throw new Error(`Cannot advance building in phase: ${e.phase}`);return{...e,building:{iteration:e.building.iteration+1,lastProgress:s}}},D=(e,s)=>(t(e.phase,"BLOCKED"),{...e,phase:"BLOCKED",building:{...e.building,lastProgress:`BLOCKED: ${s}`}});var u=e=>({...e,phase:"IDLE",spec:null,branch:null,discovery:{answers:[],completed:!1},specState:{path:null,status:"none"},building:{iteration:0,lastProgress:null},decisions:[]});export{l as a,h as b,p as c,d,S as e,m as f,D as g,u as h};
|
package/chunks/chunk-NGURBONB.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./chunk-FPO2JRU3.js";var y=()=>({version:"0.1.0",phase:"IDLE",spec:null,branch:null,discovery:{answers:[],completed:!1},specState:{path:null,status:"none"},building:{iteration:0,lastProgress:null},decisions:[]}),D=(e,n,t)=>({version:"0.1.0",concerns:e,tools:n,project:t});var s=".nos",l=`${s}/.state`,d=`${l}/state.json`,c=`${s}/config.json`,o=`${s}/concerns`,g=`${s}/rules`,a=`${s}/specs`,p=`${s}/workflows`,f={nosDir:s,stateDir:l,stateFile:d,configFile:c,concernsDir:o,rulesDir:g,specsDir:a,workflowsDir:p,specDir:e=>`${a}/${e}`,specFile:e=>`${a}/${e}/spec.md`,concernFile:e=>`${o}/${e}.json`,nosGitignore:`${s}/.gitignore`},$=async e=>{let n=`${e}/${d}`;try{let t=await r.fs.readTextFile(n);return JSON.parse(t)}catch{return y()}},S=async(e,n)=>{let t=`${e}/${l}`,i=`${e}/${d}`;await r.fs.mkdir(t,{recursive:!0}),await r.fs.writeTextFile(i,JSON.stringify(n,null,2)+`
|
|
2
|
-
`)},x=async e=>{let n=`${e}/${c}`;try{let t=await r.fs.readTextFile(n);return JSON.parse(t)}catch{return null}},w=async(e,n)=>{let t=`${e}/${c}`;await r.fs.writeTextFile(t,JSON.stringify(n,null,2)+`
|
|
3
|
-
`)};var P=async(e,n)=>{let t=`${e}/${o}`,i=`${e}/${f.concernFile(n.id)}`;await r.fs.mkdir(t,{recursive:!0}),await r.fs.writeTextFile(i,JSON.stringify(n,null,2)+`
|
|
4
|
-
`)},F=async e=>{let n=`${e}/${o}`,t=[];try{for await(let i of r.fs.readDir(n))if(i.isFile&&i.name.endsWith(".json")){let u=await r.fs.readTextFile(`${n}/${i.name}`);t.push(JSON.parse(u))}}catch{}return t},C=async e=>{let n=[s,l,o,g,a,p];for(let t of n)await r.fs.mkdir(`${e}/${t}`,{recursive:!0});await r.fs.writeTextFile(`${e}/${f.nosGitignore}`,`# noskills runtime state \u2014 not tracked by git
|
|
5
|
-
.state/
|
|
6
|
-
`)},I=async e=>{try{return await r.fs.stat(`${e}/${c}`),!0}catch{return!1}};export{y as a,D as b,f as c,$ as d,S as e,x as f,w as g,P as h,F as i,C as j,I as k};
|
package/chunks/chunk-PQQKC72V.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{a as o}from"./chunk-FPO2JRU3.js";var a="<!-- noskills:start -->",l="<!-- noskills:end -->",h=t=>{let e=[a,"## noskills orchestrator","","This project uses noskills. Do not read skill files, concern files,","or rule files directly.","","At every step, run:",""," npx eser noskills next","","Follow the output. To submit a result or answer:","",' npx eser noskills next --answer="your response here"',"","Do not make architectural decisions independently.","noskills will tell you what to do next."];if(t.length>0){e.push("","### Active Rules","");for(let s of t)e.push(`- ${s}`)}return e.push(l),e.join(`
|
|
2
|
-
`)},u=async(t,e)=>{let s=`${t}/CLAUDE.md`,n=h(e),r;try{r=await o.fs.readTextFile(s);let i=r.indexOf(a),c=r.indexOf(l);i!==-1&&c!==-1?r=r.slice(0,i)+n+r.slice(c+l.length):r=r.trimEnd()+`
|
|
3
|
-
|
|
4
|
-
`+n+`
|
|
5
|
-
`}catch{r=n+`
|
|
6
|
-
`}await o.fs.writeTextFile(s,r)};var d=async(t,e)=>{let s=["# Generated by noskills \u2014 do not edit manually","","## Orchestration","","This project uses noskills for AI orchestration.","Run `npx eser noskills next` at every step.",'Follow the JSON output. Submit results with `npx eser noskills next --answer="..."`',""];if(e.length>0){s.push("## Rules","");for(let n of e)s.push(`- ${n}`);s.push("")}await o.fs.writeTextFile(`${t}/.cursorrules`,s.join(`
|
|
7
|
-
`))};var p=async(t,e)=>{let s=["# Generated by noskills \u2014 do not edit manually","","## Orchestration","","This project uses noskills for AI orchestration.","Run `npx eser noskills next` at every step.",""];if(e.length>0){s.push("## Rules","");for(let n of e)s.push(`- ${n}`);s.push("")}await o.fs.mkdir(`${t}/.kiro/steering`,{recursive:!0}),await o.fs.writeTextFile(`${t}/.kiro/steering/conventions.md`,s.join(`
|
|
8
|
-
`))};var m=async(t,e)=>{let s=["# Generated by noskills \u2014 do not edit manually","","## Orchestration","","This project uses noskills for AI orchestration.","Run `npx eser noskills next` at every step.",""];if(e.length>0){s.push("## Rules","");for(let n of e)s.push(`- ${n}`);s.push("")}await o.fs.mkdir(`${t}/.github`,{recursive:!0}),await o.fs.writeTextFile(`${t}/.github/copilot-instructions.md`,s.join(`
|
|
9
|
-
`))};var f=async(t,e)=>{let s=["# Generated by noskills \u2014 do not edit manually","","## Orchestration","","This project uses noskills for AI orchestration.","Run `npx eser noskills next` at every step.",""];if(e.length>0){s.push("## Rules","");for(let n of e)s.push(`- ${n}`);s.push("")}await o.fs.writeTextFile(`${t}/.windsurfrules`,s.join(`
|
|
10
|
-
`))};var T=async t=>{let e=`${t}/.nos/rules`,s=[];try{for await(let n of o.fs.readDir(e))if(n.isFile&&(n.name.endsWith(".md")||n.name.endsWith(".txt"))){let r=await o.fs.readTextFile(`${e}/${n.name}`);s.push(r.trim())}}catch{}return s},v={"claude-code":u,cursor:d,kiro:p,copilot:m,windsurf:f},F=async(t,e)=>{let s=await T(t),n=[];for(let r of e){let i=v[r];i!==void 0&&(await i(t,s),n.push(r))}return n};export{T as a,F as b};
|
package/chunks/init-QCOPTDGO.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as g}from"./chunk-BK2BDHKB.js";import"./chunk-AGPCY6XP.js";import{a as m}from"./chunk-RAI7PS2P.js";import{a as v,b as x,e as B,g as P,h as C,j as k,k as R}from"./chunk-NGURBONB.js";import{c as p,d as n,f as i,g as h,l as w,n as y,o as b}from"./chunk-JYJTZEC4.js";import"./chunk-5MN3MWQN.js";import{a as u}from"./chunk-TNKUKNM4.js";import{a as d}from"./chunk-2N4GTHXQ.js";import"./chunk-FEWVQ5CW.js";import"./chunk-OLM5RTFK.js";import{a as l}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var D=new u({description:"AI provider interface \u2014 ask questions, generate content",modules:{ask:{description:"Send a prompt to an AI provider",load:()=>import("./ask-Q7AVFBH5.js")},list:{description:"List available AI providers",load:()=>import("./list-UVJ2Q5KF.js")}}});var S=m;var s=async t=>{try{return await l.fs.stat(t),!0}catch{return!1}},A=async(t,e)=>{try{let o=await l.fs.readTextFile(t);return JSON.parse(o)[e]??null}catch{return null}},L=async t=>{let e=[];return(await s(`${t}/package.json`)||await s(`${t}/deno.json`))&&e.push("typescript"),await s(`${t}/go.mod`)&&e.push("go"),await s(`${t}/Cargo.toml`)&&e.push("rust"),(await s(`${t}/pyproject.toml`)||await s(`${t}/setup.py`))&&e.push("python"),e},N=async t=>{let e=[],o=await A(`${t}/package.json`,"dependencies");return o!==null&&("react"in o&&e.push("react"),"vue"in o&&e.push("vue"),"svelte"in o&&e.push("svelte"),"next"in o&&e.push("nextjs"),"express"in o&&e.push("express"),"hono"in o&&e.push("hono")),e},F=async t=>{let e=[];return await s(`${t}/.github/workflows`)&&e.push("github-actions"),await s(`${t}/.gitlab-ci.yml`)&&e.push("gitlab-ci"),await s(`${t}/Jenkinsfile`)&&e.push("jenkins"),await s(`${t}/.circleci`)&&e.push("circleci"),e},O=async t=>{if(await s(`${t}/deno.json`))return"deno";let e=await A(`${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},$=async t=>{let[e,o,a,c]=await Promise.all([L(t),N(t),F(t),O(t)]);return{languages:e,frameworks:o,ci:a,testRunner:c}};var Ee=async t=>{let e=w({renderer:b.ansi(),sink:y.stdout()}),o=l.process.cwd();if(await R(o))return e.writeln(h("noskills is already initialized in this project.")),e.writeln(n("Run `noskills sync` to regenerate tool files.")),await e.close(),d(void 0);e.writeln(p("noskills init")),e.writeln(""),e.writeln(n("Scanning project..."));let a=await $(o);for(let r of a.languages)e.writeln(" ",i("\u2714"),` ${r}`);for(let r of a.frameworks)e.writeln(" ",i("\u2714"),` ${r}`);for(let r of a.ci)e.writeln(" ",i("\u2714"),` ${r}`);a.testRunner!==null&&e.writeln(" ",i("\u2714"),` test runner: ${a.testRunner}`),e.writeln(""),e.writeln(n("Detecting AI providers..."));let c=await S();for(let r of c)r.available?e.writeln(" ",i("\u25CF")," ",p(`${r.name} (${r.alias})`),n(` ${r.detail}`)):e.writeln(" ",n("\u25CB")," ",n(`${r.name} (${r.alias}) ${r.detail}`));let f=c.filter(r=>r.available).map(r=>r.name);e.writeln(""),e.writeln(n("Initializing...")),await k(o),e.writeln(" Created .nos/");for(let r of g)await C(o,r);e.writeln(` Bootstrapped ${g.length} concerns into .nos/concerns/`);let I=x([],f,a);await P(o,I),e.writeln(" Created .nos/config.json");let T=v();await B(o,T),e.writeln(" Created .nos/.state/state.json"),e.writeln("");let j=f.length;return e.writeln(i("Done."),` ${j} AI provider(s) detected.`),e.writeln("Start a spec with: ",p('noskills spec new "..."')),await e.close(),d(void 0)};export{Ee as main};
|
package/chunks/list-UVJ2Q5KF.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as p}from"./chunk-RAI7PS2P.js";import{c as t,d as a,f as l,k as n,l as o,n as m,o as d}from"./chunk-JYJTZEC4.js";import{a as i}from"./chunk-2N4GTHXQ.js";import"./chunk-FEWVQ5CW.js";import"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var $=async b=>{let e=o({renderer:d.ansi(),sink:m.stdout()});e.writeln(t("AI Providers")),e.writeln("");let r=await p(),v=r.map(s=>[s.available?l("\u25CF"):a("\u25CB"),s.available?t(`${s.name} (${s.alias})`):a(`${s.name} (${s.alias})`),a(s.type),s.available?s.detail:a(s.detail)]);e.writeln(n(["","Provider","Type","Status"],v));let u=r.filter(s=>s.available).length;return e.writeln(a(`${u}/${r.length} providers available`)),await e.close(),i(void 0)};export{$ as main};
|
package/chunks/next-DNJGG34Q.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as f}from"./chunk-PQQKC72V.js";import{b as O,c as g,d as E}from"./chunk-BK2BDHKB.js";import{a as k,c as _,d as I,f as q}from"./chunk-LXVBR775.js";import{c as y,d as x,e as D,f as S,i as v,k as C}from"./chunk-NGURBONB.js";import{a as m,b as h}from"./chunk-2N4GTHXQ.js";import{a as l}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var B=[{id:"status_quo",text:"What does the user do today without this feature?",concerns:["product:status_quo","eng:replace_scope","qa:regression_risk"]},{id:"ambition",text:"Describe the 1-star and 10-star versions.",concerns:["product:scope_direction","eng:complexity_tier","qa:test_depth"]},{id:"reversibility",text:"Does this change involve an irreversible decision?",concerns:["product:one_way_door","eng:migration_strategy","qa:verification_stringency"]},{id:"user_impact",text:"Does this change affect existing users' behavior?",concerns:["product:breaking_change","eng:backward_compat","qa:regression_tests"]},{id:"verification",text:"How do you verify this works correctly?",concerns:["product:success_metric","eng:test_strategy","qa:acceptance_criteria"]},{id:"scope_boundary",text:"What should this feature NOT do?",concerns:["product:focus","eng:out_of_scope","qa:negative_tests"]}],u=t=>B.map(n=>({...n,extras:O(t,n.id)})),p=(t,n)=>{let s=new Set(n.map(r=>r.questionId));for(let r of t)if(!s.has(r.id))return r;return null},R=t=>{let n=new Set(t.map(s=>s.questionId));return B.every(s=>n.has(s.id))};var w=(t,n,s)=>{switch(t.phase){case"IDLE":return b();case"DISCOVERY":return $(t,n,s);case"SPEC_DRAFT":return W(t);case"SPEC_APPROVED":case"BUILDING":return U(t,n,s);case"BLOCKED":return G(t);case"DONE":return V(t);default:return b()}},b=()=>({phase:"IDLE",instruction:'No active spec. Start one with: noskills spec new "description"'}),$=(t,n,s)=>{let r=u(n),e=p(r,t.discovery.answers);if(e===null)return{phase:"DISCOVERY",instruction:"All discovery questions answered. Run: noskills approve",question:{id:"",text:"",concerns:[],extras:[]},context:{rules:s,concernReminders:[]},transition:{onComplete:"noskills approve",remainingQuestions:0}};let o=t.discovery.answers.length,i=r.length;return{phase:"DISCOVERY",instruction:"Ask the user the following question and relay their answer.",question:{id:e.id,text:e.text,concerns:[...e.concerns],extras:e.extras.map(c=>c.text)},context:{rules:s,concernReminders:g(n)},transition:{onComplete:'noskills next --answer="..."',remainingQuestions:i-o-1}}},W=t=>({phase:"SPEC_DRAFT",instruction:"Spec draft is ready for review. Ask the user to review and approve.",specPath:t.specState.path??"",transition:{onApprove:"noskills approve"}}),U=(t,n,s)=>{let r=E(n),e={phase:"BUILDING",instruction:"Read the spec and implement the next task. Report progress when done.",context:{rules:s,concernReminders:g(n)},transition:{onComplete:'noskills next --answer="..."',onBlocked:'noskills block "reason"',iteration:t.building.iteration}};return r.length>0?{...e,concernTensions:r}:e},G=t=>({phase:"BLOCKED",instruction:"A decision is needed. Ask the user.",reason:t.building.lastProgress??"Unknown",transition:{onResolved:'noskills next --answer="..."'}}),V=t=>({phase:"DONE",summary:{spec:t.spec,iterations:t.building.iteration,decisionsCount:t.decisions.length}});var A=(t,n,s,r)=>{let e=[];e.push(`# Spec: ${t}`),e.push(""),e.push("## Status: draft"),e.push(""),s.length>0&&(e.push(`## Concerns: ${s.map(o=>o.id).join(", ")}`),e.push("")),e.push("## Discovery Answers"),e.push("");for(let o of n)e.push(`### ${o.questionId}`),e.push(""),e.push(o.answer),e.push("");for(let o of s)if(o.specSections.length>0)for(let i of o.specSections)e.push(`## ${i} (${o.id})`),e.push(""),e.push("_To be filled in during implementation._"),e.push("");if(r.length>0){e.push("## Decisions"),e.push(""),e.push("| # | Decision | Choice | Promoted |"),e.push("|---|----------|--------|----------|");for(let o=0;o<r.length;o++){let i=r[o];e.push(`| ${o+1} | ${i.question} | ${i.choice} | ${i.promoted?"yes":"no"} |`)}e.push("")}return e.push("## Tasks"),e.push(""),e.push("_To be generated from discovery answers._"),e.push(""),e.push("## Verification"),e.push(""),e.push("_To be defined based on discovery answers._"),e.push(""),e.join(`
|
|
2
|
-
`)};var Q=async(t,n,s)=>{if(n.spec===null)throw new Error("No active spec");let r=`${t}/${y.specDir(n.spec)}`,e=`${t}/${y.specFile(n.spec)}`;await l.fs.mkdir(r,{recursive:!0});let o=A(n.spec,n.discovery.answers,s,n.decisions);return await l.fs.writeTextFile(e,o),e};var ne=async t=>{let n=l.process.cwd();if(!await C(n)){let a=JSON.stringify({error:"noskills not initialized. Run: noskills init"});return await d(a),h({exitCode:1})}let s=null;if(t!==void 0)for(let a of t)a.startsWith("--answer=")&&(s=a.slice(9));let r=await x(n),e=await S(n);if(e===null){let a=JSON.stringify({error:"No config found"});return await d(a),h({exitCode:1})}let i=(await v(n)).filter(a=>e.concerns.includes(a.id));if(s!==null){let a=await z(n,r,e,i,s);await D(n,a);let F=await f(n),P=w(a,i,F);return await d(JSON.stringify(P,null,2)),m(void 0)}let c=await f(n),T=w(r,i,c);return await d(JSON.stringify(T,null,2)),m(void 0)},z=async(t,n,s,r,e)=>{switch(n.phase){case"DISCOVERY":{let o=u(r),i=p(o,n.discovery.answers);if(i===null)return n;let c=_(n,i.id,e);return R(c.discovery.answers)&&(c=I(c),await Q(t,c,r)),c}case"BUILDING":return q(n,e);case"BLOCKED":return k(n,"BUILDING");default:return n}},d=async t=>{let n=new TextEncoder,s=l.process.stdout.getWriter();await s.write(n.encode(t+`
|
|
3
|
-
`)),s.releaseLock()};export{ne as main};
|
package/chunks/reset-WLKKKEUZ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as u}from"./chunk-LXVBR775.js";import{d as c,e as d}from"./chunk-NGURBONB.js";import{d as a,f as o,l as m,n as p,o as l}from"./chunk-JYJTZEC4.js";import{a as r}from"./chunk-2N4GTHXQ.js";import{a as i}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var N=async w=>{let e=m({renderer:l.ansi(),sink:p.stdout()}),n=i.process.cwd(),s=await c(n);if(s.phase==="IDLE"||s.phase==="UNINITIALIZED")return e.writeln(a("Already idle. Nothing to reset.")),await e.close(),r(void 0);let t=s.spec,f=u(s);return await d(n,f),e.writeln(o("\u2714")," Reset to IDLE."),t!==null&&e.writeln(a(`Spec "${t}" state cleared. Files in .nos/specs/${t}/ preserved.`)),await e.close(),r(void 0)};export{N as main};
|
package/chunks/rule-3VERAMM3.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as h,b as k}from"./chunk-PQQKC72V.js";import{c as f,f as g}from"./chunk-NGURBONB.js";import{c as m,d as n,e as p,f as w,l as o,n as l,o as a}from"./chunk-JYJTZEC4.js";import{a as d,b as c}from"./chunk-2N4GTHXQ.js";import{a as i}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var j=async s=>{let e=s?.[0];if(e==="add")return await y(s?.slice(1));if(e==="list")return await A();if(e==="promote")return await C(s?.slice(1));let t=o({renderer:a.ansi(),sink:l.stdout()});return t.writeln('Usage: noskills rule <add "rule text" | list | promote "decision">'),await t.close(),d(void 0)},y=async s=>{let e=o({renderer:a.ansi(),sink:l.stdout()}),t=i.process.cwd(),r=s?.join(" ");if(r===void 0||r.length===0)return e.writeln(p("Please provide a rule: "),m('noskills rule add "Use Vitest for all tests"')),await e.close(),c({exitCode:1});let P=r.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,50),x=`${t}/${f.rulesDir}/${P}.md`;await i.fs.mkdir(`${t}/${f.rulesDir}`,{recursive:!0}),await i.fs.writeTextFile(x,r+`
|
|
2
|
-
`),e.writeln(w("\u2714")," Rule added: ",n(r));let u=await g(t);return u!==null&&u.tools.length>0&&(await k(t,u.tools),e.writeln(n(" Tool files synced."))),await e.close(),d(void 0)},A=async()=>{let s=o({renderer:a.ansi(),sink:l.stdout()}),e=i.process.cwd(),t=await h(e);if(s.writeln(m("Rules")),s.writeln(""),t.length===0)s.writeln(n(' No rules yet. Add one with: noskills rule add "..."'));else for(let r of t)s.writeln(" ",n("\u2022"),` ${r}`);return await s.close(),d(void 0)},C=async s=>{let e=o({renderer:a.ansi(),sink:l.stdout()}),t=s?.join(" ");return t===void 0||t.length===0?(e.writeln(p("Please provide the decision text to promote.")),await e.close(),c({exitCode:1})):(e.writeln(n("Promoting decision to rule...")),await e.close(),await y(s))};export{j as main};
|
package/chunks/spec-P6YE224I.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as D,h as $}from"./chunk-LXVBR775.js";import{c as k,d as y,e as b,k as C}from"./chunk-NGURBONB.js";import{c as i,d as n,e as m,f as h,g,l as u,n as w,o as f}from"./chunk-JYJTZEC4.js";import{a as p,b as d}from"./chunk-2N4GTHXQ.js";import{a as l}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var z=async e=>{let s=e?.[0];if(s==="new")return await v(e?.slice(1));if(s==="list")return await N();let t=u({renderer:f.ansi(),sink:w.stdout()});return t.writeln('Usage: noskills spec <new "description" | list>'),await t.close(),p(void 0)},v=async e=>{let s=u({renderer:f.ansi(),sink:w.stdout()}),t=l.process.cwd();if(!await C(t))return s.writeln(m("noskills is not initialized.")," Run: ",i("noskills init")),await s.close(),d({exitCode:1});let a=e?.join(" ");if(a===void 0||a.length===0)return s.writeln(m("Please provide a description: "),i('noskills spec new "photo auto-listing"')),await s.close(),d({exitCode:1});let r=a.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""),c=`spec/${r}`,o=await y(t);if(o.phase!=="IDLE"&&o.phase!=="DONE")return s.writeln(m(`Cannot start new spec in phase: ${o.phase}`),n(" \u2014 finish or reset the current spec first.")),await s.close(),d({exitCode:1});let S=D(o.phase==="DONE"?$(o):o,r,c);return await l.fs.mkdir(`${t}/${k.specDir(r)}`,{recursive:!0}),await b(t,S),s.writeln(h("\u2714")," Spec started: ",i(r)),s.writeln(" Branch: ",n(c)),s.writeln(" Phase: ",g("DISCOVERY")),s.writeln(""),s.writeln("Run ",i("noskills next")," to begin discovery questions."),await s.close(),p(void 0)},N=async()=>{let e=u({renderer:f.ansi(),sink:w.stdout()}),t=`${l.process.cwd()}/${k.specsDir}`;e.writeln(i("Specs")),e.writeln("");try{let a=0;for await(let r of l.fs.readDir(t))if(r.isDirectory){let c=await l.fs.stat(`${t}/${r.name}/spec.md`).then(()=>!0).catch(()=>!1);e.writeln(" ",c?h("\u25CF"):n("\u25CB")," ",i(r.name),c?n(" spec.md"):n(" (no spec yet)")),a++}a===0&&e.writeln(n(" No specs yet."))}catch{e.writeln(n(" No specs directory."))}return await e.close(),p(void 0)};export{z as main};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as f,f as g,k as b}from"./chunk-NGURBONB.js";import{c as i,d as r,e as a,f as c,g as d,i as w,l as h,n as m,o as u}from"./chunk-JYJTZEC4.js";import{a as o,b as l}from"./chunk-2N4GTHXQ.js";import{a as p}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var E=async D=>{let e=h({renderer:u.ansi(),sink:m.stdout()}),t=p.process.cwd();if(!await b(t))return e.writeln(a("noskills is not initialized.")," Run: ",i("noskills init")),await e.close(),l({exitCode:1});let s=await f(t),n=await g(t);e.writeln(i("noskills status")),e.writeln("");let y=s.phase==="DONE"?c(s.phase):s.phase==="BLOCKED"?a(s.phase):s.phase==="BUILDING"?w(s.phase):d(s.phase);if(e.writeln(" Phase: ",y),s.spec!==null&&e.writeln(" Spec: ",i(s.spec)),s.branch!==null&&e.writeln(" Branch: ",s.branch),s.phase==="DISCOVERY"){let C=s.discovery.answers.length;e.writeln(` Discovery: ${C}/6 questions answered`)}return s.phase==="BUILDING"&&(e.writeln(` Iteration: ${s.building.iteration}`),s.building.lastProgress!==null&&e.writeln(" Progress: ",r(s.building.lastProgress))),n!==null&&(e.writeln(""),n.concerns.length>0&&e.writeln(" Concerns: ",r(n.concerns.join(", "))),n.tools.length>0&&e.writeln(" Tools: ",r(n.tools.join(", ")))),s.decisions.length>0&&(e.writeln(""),e.writeln(` Decisions: ${s.decisions.length}`)),await e.close(),o(void 0)};export{E as main};
|
package/chunks/sync-BZ3Z5YQP.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as g}from"./chunk-PQQKC72V.js";import{f as u}from"./chunk-NGURBONB.js";import{c as m,d as e,e as c,f as n,l as p,n as d,o as f}from"./chunk-JYJTZEC4.js";import{a as o,b as l}from"./chunk-2N4GTHXQ.js";import{a}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var R=async y=>{let s=p({renderer:f.ansi(),sink:d.stdout()}),r=a.process.cwd(),t=await u(r);if(t===null)return s.writeln(c("noskills is not initialized.")," Run: ",m("noskills init")),await s.close(),l({exitCode:1});s.writeln(e("Syncing tool files..."));let i=await g(r,t.tools);for(let w of i)s.writeln(" ",n("\u2714"),` ${w}`);return i.length===0&&s.writeln(e(" No tools configured.")),s.writeln(""),s.writeln(n("Done.")),await s.close(),o(void 0)};export{R as main};
|