noskills 4.1.34 → 4.1.36
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 +85 -17
- package/chunks/{approve-5N5LJ2WQ.js → approve-YXRIBZVV.js} +1 -1
- package/chunks/{ask-TR4ZPBU5.js → ask-4XOYE32R.js} +1 -1
- package/chunks/block-D67USBJS.js +1 -0
- package/chunks/{chunk-AT7V3AKV.js → chunk-24SANXOZ.js} +1 -1
- package/chunks/{chunk-PSXXTDLU.js → chunk-2WH262CW.js} +1 -1
- package/chunks/{chunk-6C2MLMD6.js → chunk-3AZBET4N.js} +1 -1
- package/chunks/{chunk-5ORUHRWF.js → chunk-3HRRWTVF.js} +1 -1
- package/chunks/{chunk-TGA7MX5P.js → chunk-42EQ3GZJ.js} +1 -1
- package/chunks/{chunk-HLQNHWXS.js → chunk-4ODVKO5Y.js} +1 -1
- package/chunks/{chunk-4IFPLK7L.js → chunk-EZH232V7.js} +1 -1
- package/chunks/chunk-GOOD5WBA.js +1 -0
- package/chunks/{chunk-LZSLKXJE.js → chunk-GSYCN7EG.js} +2 -2
- package/chunks/{chunk-RVIPYZ7F.js → chunk-IR75X4G7.js} +1 -1
- package/chunks/{chunk-7ADGJB4H.js → chunk-IVSTITPL.js} +1 -1
- package/chunks/{chunk-AB4ZUDV6.js → chunk-LG5R766Y.js} +1 -1
- package/chunks/{chunk-BLHOTPRB.js → chunk-NTKVTLTO.js} +1 -1
- package/chunks/{chunk-ZS6ZJ4YL.js → chunk-O5KQZHIN.js} +1 -1
- package/chunks/chunk-UA3VIHYO.js +1 -0
- package/chunks/{chunk-OJUA2UZK.js → chunk-WUVVLUU5.js} +1 -1
- package/chunks/{chunk-KBNVVXFC.js → chunk-XCVAHUBM.js} +1 -1
- package/chunks/{chunk-LICLZJKZ.js → chunk-ZQ77HAFD.js} +1 -1
- package/chunks/{claude-code-3XV3QOZJ.js → claude-code-6AAAJZKK.js} +1 -1
- package/chunks/concern-4GBYLKWP.js +1 -0
- package/chunks/{done-IBA3FUE5.js → done-PTJRZ26W.js} +1 -1
- package/chunks/init-PVRN54IZ.js +1 -0
- package/chunks/{invoke-hook-AWHCXLLQ.js → invoke-hook-5VXI4CPD.js} +1 -1
- package/chunks/{kiro-IXVNKPRT.js → kiro-MHP573OZ.js} +1 -1
- package/chunks/{list-UT3MSC6R.js → list-GRXQ2DIM.js} +1 -1
- package/chunks/{mod-LUIKS5KC.js → mod-V2Z6HGL6.js} +1 -1
- package/chunks/{next-EO3BYTU5.js → next-BZS3EN33.js} +1 -1
- package/chunks/{ollama-K4QCYLVL.js → ollama-24ACY3UB.js} +1 -1
- package/chunks/{opencode-QBVD5FAD.js → opencode-LFWHRZPL.js} +1 -1
- package/chunks/{purge-RKZ7SY3Z.js → purge-JSAHNTXI.js} +1 -1
- package/chunks/{reset-VZO7YXM6.js → reset-CWI7K6GC.js} +1 -1
- package/chunks/{rule-YVHDEVR2.js → rule-GP665FCC.js} +1 -1
- package/chunks/{run-O6SYZE7T.js → run-WLG5XKTM.js} +1 -1
- package/chunks/{spec-RTBL43T7.js → spec-JET4WJSV.js} +1 -1
- package/chunks/{status-GQYCHJ2W.js → status-EOXWE5UM.js} +1 -1
- package/chunks/{sync-JDMWRRGH.js → sync-RWNLL4VW.js} +1 -1
- package/chunks/{watch-7DNXJAAQ.js → watch-5OC7T473.js} +1 -1
- package/noskills.js +1 -1
- package/package.json +1 -1
- package/chunks/block-WWW3MXHP.js +0 -1
- package/chunks/chunk-HS6FTDDW.js +0 -1
- package/chunks/chunk-ZJVSE2FP.js +0 -1
- package/chunks/concern-NGOU3XMP.js +0 -1
- package/chunks/init-XVNWKPT7.js +0 -1
package/README.md
CHANGED
|
@@ -57,17 +57,74 @@ emerge. If you want to discover those limits together, jump on board.
|
|
|
57
57
|
The name mirrors the SQL -> NoSQL shift: skills define everything upfront,
|
|
58
58
|
noskills determines what's needed at runtime.
|
|
59
59
|
|
|
60
|
+
## Philosophy — A Scrum Master for Agents
|
|
61
|
+
|
|
62
|
+
I used to teach Agile. In those trainings, I'd go all the way back to the Toyota
|
|
63
|
+
Production System to explain why we do what we do.
|
|
64
|
+
|
|
65
|
+
I'd talk about WIP limits — not as a process rule, but as acknowledgment that
|
|
66
|
+
human attention is finite. I'd explain how story points emerged from the need to
|
|
67
|
+
break work into pieces small enough for a single person's working memory. I'd
|
|
68
|
+
walk through why we have daily standups (people lose track), why we have
|
|
69
|
+
Definition of Done (everyone's "done" is different), why we have acceptance
|
|
70
|
+
criteria (without them, work drifts from intent). I'd talk about cognitive load
|
|
71
|
+
— how the brain starts dropping things when you pile on too much context.
|
|
72
|
+
|
|
73
|
+
When I first encountered context rot in AI agents, it felt familiar. The agent
|
|
74
|
+
starts strong, makes a great plan, then gradually loses the plot — forgets
|
|
75
|
+
instructions, gets sloppy, declares things "done" that aren't. I'd seen this in
|
|
76
|
+
humans. The practices we built around human limitations applied directly.
|
|
77
|
+
|
|
78
|
+
When I saw Ralph loops, I got excited — they felt like sprints. Each iteration
|
|
79
|
+
starts clean: fresh context, clear goal, defined scope. Just like a sprint
|
|
80
|
+
protects the team from mid-sprint chaos, a Ralph loop protects the agent from
|
|
81
|
+
context accumulation. But just as sprint quality depends on what goes INTO the
|
|
82
|
+
sprint, loop quality depends on what context the agent receives.
|
|
83
|
+
|
|
84
|
+
I'd also teach Jidoka — one of the pillars of the Toyota Production System.
|
|
85
|
+
Jidoka means "automation with a human touch." The machine runs autonomously, but
|
|
86
|
+
when it detects an anomaly, it stops and calls a human. The human doesn't watch
|
|
87
|
+
every step — they intervene at the right moments. Production quality comes from
|
|
88
|
+
human and machine working together, each doing what they're best at.
|
|
89
|
+
|
|
90
|
+
noskills is Jidoka for AI coding. The agent runs autonomously through tasks, but
|
|
91
|
+
at every phase transition — discovery, spec approval, blocked decisions — it
|
|
92
|
+
stops and the human decides. The human doesn't watch every line of code. They
|
|
93
|
+
intervene at the moments that matter: what to build, whether the plan is right,
|
|
94
|
+
which tradeoffs to accept. The agent handles execution; the human handles
|
|
95
|
+
judgment.
|
|
96
|
+
|
|
97
|
+
That's why I stopped using skills and built a scrum master instead:
|
|
98
|
+
|
|
99
|
+
- **Ralph loops are sprints** — fresh context, clear scope, no carryover rot.
|
|
100
|
+
- **Discovery is sprint planning** — the same questions a good PM asks before
|
|
101
|
+
work starts.
|
|
102
|
+
- **Backpressure is Definition of Done** — "done" requires evidence, not
|
|
103
|
+
declaration.
|
|
104
|
+
- **Debt tracking is the sprint board** — unfinished items don't vanish, they
|
|
105
|
+
carry forward with increasing urgency.
|
|
106
|
+
- **Concerns are team values** — "we care about open source" shapes every
|
|
107
|
+
decision, just like team values shape how a team works.
|
|
108
|
+
- **Phase transitions are Jidoka stops** — the machine pauses, the human
|
|
109
|
+
decides, then the machine continues.
|
|
110
|
+
|
|
111
|
+
The insight isn't technical. It's that the practices we spent decades developing
|
|
112
|
+
for human teams apply directly to AI agents — because the underlying problem is
|
|
113
|
+
the same: finite attention, drifting focus, and the need for structure to keep
|
|
114
|
+
work on track.
|
|
115
|
+
|
|
60
116
|
## Getting Started with Claude Code
|
|
61
117
|
|
|
62
118
|
Open Claude Code and paste:
|
|
63
119
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
120
|
+
Run `eser noskills init`
|
|
121
|
+
|
|
122
|
+
If `eser` CLI is not installed:
|
|
67
123
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
noskills
|
|
124
|
+
Run `npx eser@latest noskills init`
|
|
125
|
+
|
|
126
|
+
That's it. noskills will detect Claude Code, set up hooks, generate `CLAUDE.md`,
|
|
127
|
+
and present your next options automatically.
|
|
71
128
|
|
|
72
129
|
If you want to add this to an existing project where teammates also use
|
|
73
130
|
noskills, the init scaffolds `.eser/` which should be committed to your repo.
|
|
@@ -94,10 +151,10 @@ to prompt-engineer the agent's behavior — noskills handles that.
|
|
|
94
151
|
eser noskills init
|
|
95
152
|
eser noskills concern add beautiful-product
|
|
96
153
|
eser noskills spec new "photo upload"
|
|
97
|
-
eser noskills next -o text # Shows
|
|
98
|
-
eser noskills next --answer="
|
|
99
|
-
|
|
100
|
-
|
|
154
|
+
eser noskills next -o text # Shows all 6 questions at once
|
|
155
|
+
eser noskills next --answer='{"status_quo":"...","ambition":"...","reversibility":"...","user_impact":"...","verification":"...","scope_boundary":"..."}' -o text
|
|
156
|
+
# Classification: what does this spec involve?
|
|
157
|
+
eser noskills next --answer='{"involvesUI":true,"involvesPublicAPI":false,"involvesMigration":false,"involvesDataHandling":false}' -o text
|
|
101
158
|
eser noskills approve
|
|
102
159
|
eser noskills next --answer="start" -o text # Begin execution
|
|
103
160
|
eser noskills next --answer="task-1 done" -o text
|
|
@@ -107,6 +164,10 @@ eser noskills next --answer='{"completed":["endpoint works"],"remaining":["error
|
|
|
107
164
|
eser noskills status -o markdown
|
|
108
165
|
```
|
|
109
166
|
|
|
167
|
+
After discovery, noskills asks you to classify the spec (UI, API, migration,
|
|
168
|
+
data handling). If you skip this by running `approve` directly, all concern
|
|
169
|
+
sections default to N/A — the spec stays clean.
|
|
170
|
+
|
|
110
171
|
The entire lifecycle works without any agent. noskills is the orchestrator —
|
|
111
172
|
agents and humans are both consumers.
|
|
112
173
|
|
|
@@ -125,7 +186,13 @@ eser noskills run --max-iterations=20 # Safety valve
|
|
|
125
186
|
eser noskills run --max-turns=15 # Turns per agent process
|
|
126
187
|
```
|
|
127
188
|
|
|
128
|
-
Each iteration is a fresh `claude -p` process with zero context accumulation
|
|
189
|
+
Each iteration is a fresh `claude -p` process with zero context accumulation —
|
|
190
|
+
this is the Ralph loop pattern (originated by Geoff Huntley). AI agents suffer
|
|
191
|
+
from context rot: the longer they work, the more stale instructions accumulate
|
|
192
|
+
and performance degrades. The Ralph loop solves this by restarting the agent
|
|
193
|
+
every iteration with fresh context while persisting state in files. noskills IS
|
|
194
|
+
the Ralph loop — no separate bash script needed.
|
|
195
|
+
|
|
129
196
|
State persists in `.eser/.state/state.json` between iterations. The Stop hook
|
|
130
197
|
snapshots git state automatically. Verification backpressure prevents advancing
|
|
131
198
|
past broken tests. When `autoCommit: true` in `manifest.yml`, the `noskills run`
|
|
@@ -442,12 +509,13 @@ noskills next --answer='{"involvesUI":true,"involvesPublicAPI":false,"involvesMi
|
|
|
442
509
|
noskills installs Claude Code hooks that handle state bookkeeping without
|
|
443
510
|
spending LLM tokens:
|
|
444
511
|
|
|
445
|
-
| Hook | Event
|
|
446
|
-
| ------------------- |
|
|
447
|
-
| **pre-tool-use** | PreToolUse
|
|
448
|
-
| **stop** | Stop
|
|
449
|
-
| **post-file-write** | PostToolUse
|
|
450
|
-
| **post-bash** | PostToolUse
|
|
512
|
+
| Hook | Event | What it does |
|
|
513
|
+
| ------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
514
|
+
| **pre-tool-use** | PreToolUse | Blocks file edits outside EXECUTING phase. Blocks git write commands. Blocks edits when pendingClear is set. |
|
|
515
|
+
| **stop** | Stop | Increments iteration counter, snapshots `git diff` into state, checks restart threshold. The Ralph loop's heartbeat. |
|
|
516
|
+
| **post-file-write** | PostToolUse | Logs modified file paths to `.eser/.state/files-changed.jsonl` |
|
|
517
|
+
| **post-bash** | PostToolUse | Logs noskills CLI invocations for observability |
|
|
518
|
+
| **session-start** | SessionStart | Runs `noskills next` at session start so the agent is immediately oriented. No CLAUDE.md reading needed — the hook delivers the current instruction. |
|
|
451
519
|
|
|
452
520
|
Hooks are CLI subcommands (`noskills invoke-hook <name>`), not generated script
|
|
453
521
|
files. This avoids ESM/CJS issues — the same Deno entry point handles
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as C}from"./chunk-
|
|
1
|
+
import{a as C}from"./chunk-3HRRWTVF.js";import"./chunk-IVSTITPL.js";import{a as P,d as R}from"./chunk-XCVAHUBM.js";import{e as y}from"./chunk-4ODVKO5Y.js";import{a as p}from"./chunk-UXRWSNVZ.js";import{e as h,f as S,k as g,o as v}from"./chunk-WUVVLUU5.js";import{c as n,d as c,f as l,g as m,k as d,o as f,q as u,r as w}from"./chunk-EZH232V7.js";import{a as i}from"./chunk-2N4GTHXQ.js";import{b as o}from"./chunk-UA3VIHYO.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var $=async E=>{let r=f({renderer:w.ansi(),sink:u.stdout()}),s=o.process.cwd(),e=await h(s),a=await g(s);if(e.phase==="SPEC_DRAFT"){if(e.classification===null&&e.spec!==null){let A=(await v(s)).filter(D=>a?.concerns.includes(D.id)??!1);try{await C(s,e,A)}catch{}}let t=y(e);await S(s,t),t.spec!==null&&(await P(s,t.spec,"approved"),await R(s,t.spec,"approved")),r.writeln(m("\u2714")," Spec approved. Phase: ",d("SPEC_APPROVED")),r.writeln("When ready, run ",n(`${p('next --answer="start"',a)}`)," to begin execution.")}else e.phase==="DISCOVERY"&&e.discovery.completed?(r.writeln(c("Discovery complete. Spec draft already generated.")),r.writeln("Review the spec and run ",n(p("approve",a))," again when in SPEC_DRAFT phase.")):r.writeln(l(`Cannot approve in phase: ${e.phase}`));return await r.close(),i(void 0)};export{$ as main};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as Ee,b as Ie}from"./chunk-AGPCY6XP.js";import{a as te,b as C,c as M,d as G,f as L,g as Ae,h as be,j as ke,k as re,l as Pe,o as ne,p as Re,q as oe,r as _e}from"./chunk-4IFPLK7L.js";import{a as Fe}from"./chunk-5MN3MWQN.js";import"./chunk-OLM5RTFK.js";import{a as Le,b as D}from"./chunk-2N4GTHXQ.js";import{d as ie}from"./chunk-6C2MLMD6.js";import{a as T}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import{d as ee}from"./chunk-DXB73IDG.js";var Ne=e=>({rawMessage:e.rawMessage??e.message,args:e.args??[],datetime:e.datetime??new Date,properties:e.properties??{},context:e.context??{},...e});var d=e=>typeof e=="string"?e.split(".").filter(Boolean):e,V=(e,t=".")=>e.join(t),w=e=>e.join("\0");var Oe=(e,t)=>e.length<t.length?!1:t.every((r,n)=>e[n]===r);var De=(e,t)=>{let r=[];for(let n of t.values()){let i=d(n.category);Oe(e,i)&&r.push(n)}return r.sort((n,i)=>{let o=d(n.category).length;return d(i.category).length-o}),r};var j=(e,t)=>{let r=typeof t=="string"?[t]:t;return[...e,...r]};var K={};ee(K,{configure:()=>Tt,configureSync:()=>Ct,getEffectiveConfig:()=>ue,getFilterNames:()=>Rt,getLoggerCategories:()=>_t,getRegistryState:()=>St,getSinkNames:()=>Pt,isConfigured:()=>ht,registerFilter:()=>At,registerLogger:()=>kt,registerLoggerCacheClear:()=>le,registerSink:()=>wt,reset:()=>ze,resetSync:()=>Ke,unregisterFilter:()=>bt,unregisterSink:()=>Lt});var g={Trace:1,Debug:5,Info:9,Notice:10,Warning:13,Error:17,Critical:21,Alert:22,Emergency:23},Me={[g.Trace]:"Trace",[g.Debug]:"Debug",[g.Info]:"Info",[g.Notice]:"Notice",[g.Warning]:"Warning",[g.Error]:"Error",[g.Critical]:"Critical",[g.Alert]:"Alert",[g.Emergency]:"Emergency"};var $,z,pt=()=>{if($===void 0)try{let e=globalThis.AsyncLocalStorage??globalThis.require?.("async_hooks")?.AsyncLocalStorage;e&&($=new e)}catch{}return $},mt=()=>{if(z===void 0)try{let e=globalThis.AsyncLocalStorage??globalThis.require?.("async_hooks")?.AsyncLocalStorage;e&&(z=new e)}catch{}return z},Ge,Ve,R=e=>{Ge=e},se=e=>{Ve=e},ge=()=>{$=void 0,z=void 0},dt=()=>Ge??pt(),yt=()=>Ve??mt();var je=()=>{let e=dt();return e?e.getStore()??{}:{}};var xt=()=>{let e=yt();return e?e.getStore()??[]:[]},$e=e=>{let t=xt();return t.length===0?e:j(t,e)};var ce=null,le=e=>{ce=e},u=null,y=new Map,St=()=>u,ht=()=>u!==null,Tt=async e=>{(e.reset||u===null)&&await ze(),u={sinks:new Map(Object.entries(e.sinks)),filters:new Map(Object.entries(e.filters??{})),loggers:new Map,contextLocalStorage:e.contextLocalStorage};for(let t of e.loggers){let r=d(t.category),n=w(r);u.loggers.set(n,{...t,category:r})}e.contextLocalStorage&&R(e.contextLocalStorage),y.clear()},Ct=e=>{(e.reset||u===null)&&Ke(),u={sinks:new Map(Object.entries(e.sinks)),filters:new Map(Object.entries(e.filters??{})),loggers:new Map,contextLocalStorage:e.contextLocalStorage};for(let t of e.loggers){let r=d(t.category),n=w(r);u.loggers.set(n,{...t,category:r})}e.contextLocalStorage&&R(e.contextLocalStorage),y.clear()},ze=async()=>{if(u)for(let e of u.sinks.values()){let t=e;typeof t.dispose=="function"?await t.dispose():typeof t[Symbol.asyncDispose]=="function"&&await t[Symbol.asyncDispose]()}u=null,y.clear(),ce?.(),R(void 0),se(void 0),ge()},Ke=()=>{if(u)for(let e of u.sinks.values()){let t=e;typeof t.disposeSync=="function"?t.disposeSync():typeof t[Symbol.dispose]=="function"&&t[Symbol.dispose]()}u=null,y.clear(),ce?.(),R(void 0),se(void 0),ge()},ue=e=>{let t=w(e),r=y.get(t);if(r)return r;let n={sinks:[],filters:[],lowestLevel:g.Info};if(!u)return n;let i=De(e,u.loggers),o=new Set,a=new Set,l=!1;for(let s of i){if(s.sinks&&s.sinks.length>0){s.parentSinks==="override"&&o.clear();for(let c of s.sinks)o.add(c)}if(s.filters)for(let c of s.filters)a.add(c);!l&&s.lowestLevel!==void 0&&(n.lowestLevel=s.lowestLevel,l=!0)}for(let s of o){let c=u.sinks.get(s);c&&n.sinks.push(c)}for(let s of a){let c=u.filters.get(s);c&&n.filters.push(c)}return y.set(t,n),n},wt=(e,t)=>{if(!u)throw new Error("Logging not configured. Call configure() first.");u.sinks.set(e,t),y.clear()},Lt=e=>{u&&(u.sinks.delete(e),y.clear())},At=(e,t)=>{if(!u)throw new Error("Logging not configured. Call configure() first.");u.filters.set(e,t),y.clear()},bt=e=>{u&&(u.filters.delete(e),y.clear())},kt=e=>{if(!u)throw new Error("Logging not configured. Call configure() first.");let t=d(e.category),r=w(t);u.loggers.set(r,{...e,category:t}),y.clear()},Pt=()=>u?Array.from(u.sinks.keys()):[],Rt=()=>u?Array.from(u.filters.keys()):[],_t=()=>u?Array.from(u.loggers.values()).map(e=>d(e.category)):[];var W={};ee(W,{DEFAULT_LEVEL:()=>Ft,Logger:()=>_,clearLoggerCache:()=>We,current:()=>It,getLogger:()=>Et});var Ft=g.Info,_=class e{category;parent;#e;#t=null;constructor(t,r=null,n={}){this.category=d(t),this.parent=r,this.#e=n}#r(){return this.#t===null&&(this.#t=ue(this.category)),this.#t}getChild(t){let r=j(this.category,d(t));return new e(r,this,this.#e)}with(t){return new e(this.category,this.parent,{...this.#e,...t})}get loggerName(){return V(this.category)}asString(t,r=!1){return typeof t=="string"?r?`"${t}"`:t:t===null||typeof t=="number"||typeof t=="bigint"||typeof t=="boolean"||typeof t>"u"||typeof t=="symbol"?String(t):t instanceof Error?t.stack:t!==null&&typeof t=="object"?Array.isArray(t)?JSON.stringify(t):`{${Object.entries(t).map(([n,i])=>`"${n}":${this.asString(i,!0)}`).join(",")}}`:"undefined"}async log(t,r,...n){let i=this.#r();if(t<i.lowestLevel)return r instanceof Function?void 0:r;let o,a;r instanceof Function?(o=r(),a=this.asString(o)):a=this.asString(r);let l=je(),s=Ne({message:a,rawMessage:a,args:n,datetime:new Date,severity:t,category:this.category,properties:this.#e,context:l});for(let c of i.filters)if(!c(s))return r instanceof Function?o:r;return i.sinks.length>0&&await Promise.all(i.sinks.map(c=>c(s))),r instanceof Function?o:r}debug(t,...r){return this.log(g.Debug,t,...r)}info(t,...r){return this.log(g.Info,t,...r)}warn(t,...r){return this.log(g.Warning,t,...r)}error(t,...r){return this.log(g.Error,t,...r)}critical(t,...r){return this.log(g.Critical,t,...r)}emergency(t,...r){return this.log(g.Emergency,t,...r)}alert(t,...r){return this.log(g.Alert,t,...r)}notice(t,...r){return this.log(g.Notice,t,...r)}trace(t,...r){return this.log(g.Trace,t,...r)}},fe=new Map,Et=e=>{let t=$e(d(e)),r=w(t),n=fe.get(r);return n||(n=new _(t),fe.set(r,n)),n},We=()=>{fe.clear()};le(We);var It=new _(["default"]);var B={};ee(B,{fingersCrossedSink:()=>Kt,getBufferedSink:()=>zt,getOutputSink:()=>jt,getRecordCollectorSink:()=>Ue,getTestSink:()=>Wt,withFilter:()=>$t});var Nt={[g.Trace]:"TRCE",[g.Debug]:"DBUG",[g.Info]:"INFO",[g.Notice]:"NOTC",[g.Warning]:"WARN",[g.Error]:"ERRO",[g.Critical]:"CRIT",[g.Alert]:"ALRT",[g.Emergency]:"EMRG"};var Ot=(e,t)=>{if(t==="none")return"";if(typeof t=="function")return t(e);let r=e.toISOString(),n=r.slice(0,10),i=r.slice(11,19),o=r.slice(19);switch(t){case"rfc3339":return r;case"date-time-timezone":case void 0:return`${n} ${i}${o}`;case"date-time":return`${n} ${i}`;case"time-timezone":return`${i}${o}`;case"time":return i;case"date":return n}},Dt=e=>{try{return JSON.stringify(e)}catch{return String(e)}},Mt=(e,t)=>{let r={...t,...e},n=Object.entries(r);return n.length===0?"":" "+n.map(([i,o])=>{let a=typeof o=="string"?o:Dt(o);return`${i}=${a}`}).join(" ")};var Gt=(e,t)=>{switch(e){case g.Trace:return G(ke(t));case g.Debug:return Pe(t);case g.Info:return Ae(t);case g.Notice:return re(t);case g.Warning:return be(t);case g.Error:return L(t);case g.Critical:return M(L(t));case g.Alert:return M(L(t));case g.Emergency:return M(L(t));default:return C(t)}},Be=e=>{let t=Ot(e.datetime,"date-time-timezone"),r=Nt[e.severity]??"????",n=e.category.length>0?V(e.category):"",i=Mt(e.properties,e.context),o=[];return t&&o.push(G(t),C(" ")),o.push(Gt(e.severity,r),C(" ")),n&&o.push(re(`[${n}]`),C(" ")),e.severity>=g.Error?o.push(L(e.message)):o.push(C(e.message)),i.trim()&&o.push(C(" "),G(i.trim())),o};var jt=(e,t)=>{let r=t?.formatter??Be;return n=>{let i=r(n);e.writeln(...i)}},$t=(e,t)=>r=>{if(t(r))return e(r)},zt=(e,t={})=>{let{maxSize:r=100,flushIntervalMs:n=5e3}=t,i=[],o=null,a=async()=>{if(i.length===0)return;let c=i;i=[],o&&(clearTimeout(o),o=null),await Promise.all(c.map(p=>e(p)))},l=()=>{o===null&&(o=setTimeout(()=>{o=null,a().catch(()=>{})},n))},s=async c=>{i.push(c),i.length>=r?await a():l()};return s.flush=a,s},Kt=(e,t={})=>{let{triggerLevel:r=17,maxBufferSize:n=1e3}=t,i=[],o=!1,a=async()=>{let c=i;i=[],o=!0,await Promise.all(c.map(p=>e(p)))},l=()=>{i=[],o=!1},s=async c=>{if(o){await e(c);return}if(c.severity>=r){i.push(c),await a();return}i.push(c),i.length>n&&i.shift()};return s.flush=a,s.clear=l,s},Ue=()=>{let e=[];return{sink:r=>{e.push(r)},records:e}},Wt=Ue;var Ye=typeof globalThis=="object"?globalThis:global;var v="1.9.0";var Xe=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function Ut(e){var t=new Set([e]),r=new Set,n=e.match(Xe);if(!n)return function(){return!1};var i={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(i.prerelease!=null)return function(s){return s===e};function o(l){return r.add(l),!1}function a(l){return t.add(l),!0}return function(s){if(t.has(s))return!0;if(r.has(s))return!1;var c=s.match(Xe);if(!c)return o(s);var p={major:+c[1],minor:+c[2],patch:+c[3],prerelease:c[4]};return p.prerelease!=null||i.major!==p.major?o(s):i.major===0?i.minor===p.minor&&i.patch<=p.patch?a(s):o(s):i.minor<=p.minor?a(s):o(s)}}var qe=Ut(v);var Yt=v.split(".")[0],F=Symbol.for("opentelemetry.js.api."+Yt),E=Ye;function A(e,t,r,n){var i;n===void 0&&(n=!1);var o=E[F]=(i=E[F])!==null&&i!==void 0?i:{version:v};if(!n&&o[e]){var a=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(a.stack||a.message),!1}if(o.version!==v){var a=new Error("@opentelemetry/api: Registration of version v"+o.version+" for "+e+" does not match previously registered API v"+v);return r.error(a.stack||a.message),!1}return o[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+v+"."),!0}function S(e){var t,r,n=(t=E[F])===null||t===void 0?void 0:t.version;if(!(!n||!qe(n)))return(r=E[F])===null||r===void 0?void 0:r[e]}function b(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+v+".");var r=E[F];r&&delete r[e]}var Xt=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},qt=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},He=function(){function e(t){this._namespace=t.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return I("debug",this._namespace,t)},e.prototype.error=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return I("error",this._namespace,t)},e.prototype.info=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return I("info",this._namespace,t)},e.prototype.warn=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return I("warn",this._namespace,t)},e.prototype.verbose=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return I("verbose",this._namespace,t)},e}();function I(e,t,r){var n=S("diag");if(n)return r.unshift(t),n[e].apply(n,qt([],Xt(r),!1))}var m;(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(m||(m={}));function Je(e,t){e<m.NONE?e=m.NONE:e>m.ALL&&(e=m.ALL),t=t||{};function r(n,i){var o=t[n];return typeof o=="function"&&e>=i?o.bind(t):function(){}}return{error:r("error",m.ERROR),warn:r("warn",m.WARN),info:r("info",m.INFO),debug:r("debug",m.DEBUG),verbose:r("verbose",m.VERBOSE)}}var Ht=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},Jt=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},Qt="diag",k=function(){function e(){function t(i){return function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var l=S("diag");if(l)return l[i].apply(l,Jt([],Ht(o),!1))}}var r=this,n=function(i,o){var a,l,s;if(o===void 0&&(o={logLevel:m.INFO}),i===r){var c=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return r.error((a=c.stack)!==null&&a!==void 0?a:c.message),!1}typeof o=="number"&&(o={logLevel:o});var p=S("diag"),f=Je((l=o.logLevel)!==null&&l!==void 0?l:m.INFO,i);if(p&&!o.suppressOverrideMessage){var x=(s=new Error().stack)!==null&&s!==void 0?s:"<failed to generate stacktrace>";p.warn("Current logger will be overwritten from "+x),f.warn("Current logger will overwrite one already registered from "+x)}return A("diag",f,r,!0)};r.setLogger=n,r.disable=function(){b(Qt,r)},r.createComponentLogger=function(i){return new He(i)},r.verbose=t("verbose"),r.debug=t("debug"),r.info=t("info"),r.warn=t("warn"),r.error=t("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}();function Qe(e){return Symbol.for(e)}var Zt=function(){function e(t){var r=this;r._currentContext=t?new Map(t):new Map,r.getValue=function(n){return r._currentContext.get(n)},r.setValue=function(n,i){var o=new e(r._currentContext);return o._currentContext.set(n,i),o},r.deleteValue=function(n){var i=new e(r._currentContext);return i._currentContext.delete(n),i}}return e}(),Ze=new Zt;var er=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},tr=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},et=function(){function e(){}return e.prototype.active=function(){return Ze},e.prototype.with=function(t,r,n){for(var i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];return r.call.apply(r,tr([n],er(i),!1))},e.prototype.bind=function(t,r){return r},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}();var rr=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},nr=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},pe="context",or=new et,U=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(t){return A(pe,t,k.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(t,r,n){for(var i,o=[],a=3;a<arguments.length;a++)o[a-3]=arguments[a];return(i=this._getContextManager()).with.apply(i,nr([t,r,n],rr(o),!1))},e.prototype.bind=function(t,r){return this._getContextManager().bind(t,r)},e.prototype._getContextManager=function(){return S(pe)||or},e.prototype.disable=function(){this._getContextManager().disable(),b(pe,k.instance())},e}();var Y;(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(Y||(Y={}));var me="0000000000000000",de="00000000000000000000000000000000",tt={traceId:de,spanId:me,traceFlags:Y.NONE};var h=function(){function e(t){t===void 0&&(t=tt),this._spanContext=t}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(t,r){return this},e.prototype.setAttributes=function(t){return this},e.prototype.addEvent=function(t,r){return this},e.prototype.addLink=function(t){return this},e.prototype.addLinks=function(t){return this},e.prototype.setStatus=function(t){return this},e.prototype.updateName=function(t){return this},e.prototype.end=function(t){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(t,r){},e}();var ye=Qe("OpenTelemetry Context Key SPAN");function X(e){return e.getValue(ye)||void 0}function rt(){return X(U.getInstance().active())}function N(e,t){return e.setValue(ye,t)}function nt(e){return e.deleteValue(ye)}function ot(e,t){return N(e,new h(t))}function q(e){var t;return(t=X(e))===null||t===void 0?void 0:t.spanContext()}var ir=/^([0-9a-f]{32})$/i,ar=/^[0-9a-f]{16}$/i;function sr(e){return ir.test(e)&&e!==de}function gr(e){return ar.test(e)&&e!==me}function H(e){return sr(e.traceId)&&gr(e.spanId)}function it(e){return new h(e)}var xe=U.getInstance(),J=function(){function e(){}return e.prototype.startSpan=function(t,r,n){n===void 0&&(n=xe.active());var i=!!r?.root;if(i)return new h;var o=n&&q(n);return cr(o)&&H(o)?new h(o):new h},e.prototype.startActiveSpan=function(t,r,n,i){var o,a,l;if(!(arguments.length<2)){arguments.length===2?l=r:arguments.length===3?(o=r,l=n):(o=r,a=n,l=i);var s=a??xe.active(),c=this.startSpan(t,o,s),p=N(s,c);return xe.with(p,l,void 0,c)}},e}();function cr(e){return typeof e=="object"&&typeof e.spanId=="string"&&typeof e.traceId=="string"&&typeof e.traceFlags=="number"}var lr=new J,at=function(){function e(t,r,n,i){this._provider=t,this.name=r,this.version=n,this.options=i}return e.prototype.startSpan=function(t,r,n){return this._getTracer().startSpan(t,r,n)},e.prototype.startActiveSpan=function(t,r,n,i){var o=this._getTracer();return Reflect.apply(o.startActiveSpan,o,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):lr},e}();var st=function(){function e(){}return e.prototype.getTracer=function(t,r,n){return new J},e}();var ur=new st,ve=function(){function e(){}return e.prototype.getTracer=function(t,r,n){var i;return(i=this.getDelegateTracer(t,r,n))!==null&&i!==void 0?i:new at(this,t,r,n)},e.prototype.getDelegate=function(){var t;return(t=this._delegate)!==null&&t!==void 0?t:ur},e.prototype.setDelegate=function(t){this._delegate=t},e.prototype.getDelegateTracer=function(t,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getTracer(t,r,n)},e}();var Se="trace",gt=function(){function e(){this._proxyTracerProvider=new ve,this.wrapSpanContext=it,this.isSpanContextValid=H,this.deleteSpan=nt,this.getSpan=X,this.getActiveSpan=rt,this.getSpanContext=q,this.setSpan=N,this.setSpanContext=ot}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(t){var r=A(Se,this._proxyTracerProvider,k.instance());return r&&this._proxyTracerProvider.setDelegate(t),r},e.prototype.getTracerProvider=function(){return S(Se)||this._proxyTracerProvider},e.prototype.getTracer=function(t,r){return this.getTracerProvider().getTracer(t,r)},e.prototype.disable=function(){b(Se,k.instance()),this._proxyTracerProvider=new ve},e}();var he=gt.getInstance();var Yn=he.getTracer("@eser/logging");var Te=(e,t,r)=>{let n=e.streamText(t,r);return{name:`ai-text/${e.provider}/${e.modelId}`,readable:new ReadableStream({async start(i){try{for await(let o of n)o.kind==="content_delta"&&i.enqueue(te(o.textDelta));i.close()}catch(o){i.error(o)}}})}};var dr={cc:"claude-code",ol:"ollama",oc:"opencode",oai:"openai",ant:"anthropic",gem:"gemini",vtx:"vertexai"},yr={"claude-code":"Claude Code",ollama:"Ollama",opencode:"OpenCode",kiro:"Kiro",anthropic:"Anthropic API",openai:"OpenAI API",gemini:"Gemini API",vertexai:"Vertex AI"},xr=e=>dr[e]??e,vr=async e=>{if(e){let t=T.process.stderr.getWriter(),r=ne({renderer:_e.ansi(),sink:oe.writable(new WritableStream({async write(n){await t.write(new TextEncoder().encode(String(n.data)))},close(){t.releaseLock()}}))});await K.configure({sinks:{stderr:B.getOutputSink(r)},loggers:[{category:["ai"],lowestLevel:g.Debug,sinks:["stderr"]}]})}return W.getLogger(["ai","ask"])},Sr=async e=>{await e.info("Auto-detecting AI provider...");try{if(await ie`which claude`.noThrow().code()===0)return await e.info("Claude Code detected."),"claude-code"}catch{}try{if((await fetch("http://localhost:11434/api/version",{signal:AbortSignal.timeout(1e3)})).ok)return await e.info("Ollama detected at localhost:11434."),"ollama"}catch{}try{if(await ie`which opencode`.noThrow().code()===0)return await e.info("OpenCode detected."),"opencode"}catch{}if(T.capabilities.env){if(T.env.has("ANTHROPIC_API_KEY"))return await e.info("Anthropic API key detected."),"anthropic";if(T.env.has("OPENAI_API_KEY"))return await e.info("OpenAI API key detected."),"openai"}throw new Error("No AI provider detected. Install claude, ollama, or set ANTHROPIC_API_KEY / OPENAI_API_KEY.")},hr=async e=>{switch(e){case"claude-code":return(await import("./claude-code-3XV3QOZJ.js")).claudeCodeFactory;case"ollama":return(await import("./ollama-K4QCYLVL.js")).ollamaFactory;case"opencode":return(await import("./opencode-QBVD5FAD.js")).openCodeFactory;case"kiro":return(await import("./kiro-IXVNKPRT.js")).kiroFactory;case"anthropic":return(await import("./anthropic-GKH6HH6J.js")).anthropicFactory;case"openai":return(await import("./openai-ZNKOR4CD.js")).openaiFactory;case"gemini":return(await import("./gemini-Z57NY6WY.js")).geminiFactory;case"vertexai":return(await import("./vertexai-WVENJL2F.js")).vertexaiFactory;default:throw new Error(`Unknown provider: ${e}`)}},lo=async e=>{let t=e??[],r=null,n=null,i=null,o=!1,a=!1,l=[],s=0;for(;s<t.length;){let f=t[s];if(f==="-p"||f==="--provider"){r=t[s+1]??null,s+=2;continue}if(f==="-m"||f==="--model"){n=t[s+1]??null,s+=2;continue}if(f==="--max-tokens"){let x=t[s+1];x!==void 0&&(i=Number(x)),s+=2;continue}if(f==="--json"){o=!0,s+=1;continue}if(f==="-v"||f==="--verbose"){a=!0,s+=1;continue}f.startsWith("-")||l.push(f),s+=1}let c=l.join(" ");if(c.length===0)return D({message:'Usage: ai ask "your prompt" [-p provider] [-m model] [--verbose]',exitCode:1});let p=await vr(a);try{let f=r!==null?xr(r):await Sr(p),x=yr[f]??f,Ce=n??Lr(f);await p.info(`Using ${x} (${Ce})`);let lt=await hr(f),Q=new Ie({factories:[lt]});await Q.addModel("default",{provider:f,model:Ce});let Z=Q.getDefault();if(Z===null)return D({message:"Failed to initialize model",exitCode:1});let we=[Fe("user",c)];if(await p.info(`Sending prompt (${c.length} chars)...`),o){let O=await Z.generateText({messages:we,maxTokens:i??void 0});await p.info(`Response received (${Ee(O).length} chars)`);let P=ne({sink:oe.stdout()});P.writeln(JSON.stringify(O,null,2)),await P.close()}else{let O=Te(Z,{messages:we,maxTokens:i??void 0});await Re().from(O).to(wr()).run();let P=T.process.stdout.getWriter();await P.write(new TextEncoder().encode(`
|
|
1
|
+
import{a as Ee,b as Ie}from"./chunk-AGPCY6XP.js";import{a as te,b as C,c as M,d as G,f as L,g as Ae,h as be,j as ke,k as re,l as Pe,o as ne,p as Re,q as oe,r as _e}from"./chunk-EZH232V7.js";import{a as Fe}from"./chunk-5MN3MWQN.js";import"./chunk-OLM5RTFK.js";import{a as Le,b as D}from"./chunk-2N4GTHXQ.js";import{d as ie}from"./chunk-3AZBET4N.js";import{b as T}from"./chunk-UA3VIHYO.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import{d as ee}from"./chunk-DXB73IDG.js";var Ne=e=>({rawMessage:e.rawMessage??e.message,args:e.args??[],datetime:e.datetime??new Date,properties:e.properties??{},context:e.context??{},...e});var d=e=>typeof e=="string"?e.split(".").filter(Boolean):e,V=(e,t=".")=>e.join(t),w=e=>e.join("\0");var Oe=(e,t)=>e.length<t.length?!1:t.every((r,n)=>e[n]===r);var De=(e,t)=>{let r=[];for(let n of t.values()){let i=d(n.category);Oe(e,i)&&r.push(n)}return r.sort((n,i)=>{let o=d(n.category).length;return d(i.category).length-o}),r};var j=(e,t)=>{let r=typeof t=="string"?[t]:t;return[...e,...r]};var K={};ee(K,{configure:()=>Tt,configureSync:()=>Ct,getEffectiveConfig:()=>ue,getFilterNames:()=>Rt,getLoggerCategories:()=>_t,getRegistryState:()=>St,getSinkNames:()=>Pt,isConfigured:()=>ht,registerFilter:()=>At,registerLogger:()=>kt,registerLoggerCacheClear:()=>le,registerSink:()=>wt,reset:()=>ze,resetSync:()=>Ke,unregisterFilter:()=>bt,unregisterSink:()=>Lt});var g={Trace:1,Debug:5,Info:9,Notice:10,Warning:13,Error:17,Critical:21,Alert:22,Emergency:23},Me={[g.Trace]:"Trace",[g.Debug]:"Debug",[g.Info]:"Info",[g.Notice]:"Notice",[g.Warning]:"Warning",[g.Error]:"Error",[g.Critical]:"Critical",[g.Alert]:"Alert",[g.Emergency]:"Emergency"};var $,z,pt=()=>{if($===void 0)try{let e=globalThis.AsyncLocalStorage??globalThis.require?.("async_hooks")?.AsyncLocalStorage;e&&($=new e)}catch{}return $},mt=()=>{if(z===void 0)try{let e=globalThis.AsyncLocalStorage??globalThis.require?.("async_hooks")?.AsyncLocalStorage;e&&(z=new e)}catch{}return z},Ge,Ve,R=e=>{Ge=e},se=e=>{Ve=e},ge=()=>{$=void 0,z=void 0},dt=()=>Ge??pt(),yt=()=>Ve??mt();var je=()=>{let e=dt();return e?e.getStore()??{}:{}};var xt=()=>{let e=yt();return e?e.getStore()??[]:[]},$e=e=>{let t=xt();return t.length===0?e:j(t,e)};var ce=null,le=e=>{ce=e},u=null,y=new Map,St=()=>u,ht=()=>u!==null,Tt=async e=>{(e.reset||u===null)&&await ze(),u={sinks:new Map(Object.entries(e.sinks)),filters:new Map(Object.entries(e.filters??{})),loggers:new Map,contextLocalStorage:e.contextLocalStorage};for(let t of e.loggers){let r=d(t.category),n=w(r);u.loggers.set(n,{...t,category:r})}e.contextLocalStorage&&R(e.contextLocalStorage),y.clear()},Ct=e=>{(e.reset||u===null)&&Ke(),u={sinks:new Map(Object.entries(e.sinks)),filters:new Map(Object.entries(e.filters??{})),loggers:new Map,contextLocalStorage:e.contextLocalStorage};for(let t of e.loggers){let r=d(t.category),n=w(r);u.loggers.set(n,{...t,category:r})}e.contextLocalStorage&&R(e.contextLocalStorage),y.clear()},ze=async()=>{if(u)for(let e of u.sinks.values()){let t=e;typeof t.dispose=="function"?await t.dispose():typeof t[Symbol.asyncDispose]=="function"&&await t[Symbol.asyncDispose]()}u=null,y.clear(),ce?.(),R(void 0),se(void 0),ge()},Ke=()=>{if(u)for(let e of u.sinks.values()){let t=e;typeof t.disposeSync=="function"?t.disposeSync():typeof t[Symbol.dispose]=="function"&&t[Symbol.dispose]()}u=null,y.clear(),ce?.(),R(void 0),se(void 0),ge()},ue=e=>{let t=w(e),r=y.get(t);if(r)return r;let n={sinks:[],filters:[],lowestLevel:g.Info};if(!u)return n;let i=De(e,u.loggers),o=new Set,a=new Set,l=!1;for(let s of i){if(s.sinks&&s.sinks.length>0){s.parentSinks==="override"&&o.clear();for(let c of s.sinks)o.add(c)}if(s.filters)for(let c of s.filters)a.add(c);!l&&s.lowestLevel!==void 0&&(n.lowestLevel=s.lowestLevel,l=!0)}for(let s of o){let c=u.sinks.get(s);c&&n.sinks.push(c)}for(let s of a){let c=u.filters.get(s);c&&n.filters.push(c)}return y.set(t,n),n},wt=(e,t)=>{if(!u)throw new Error("Logging not configured. Call configure() first.");u.sinks.set(e,t),y.clear()},Lt=e=>{u&&(u.sinks.delete(e),y.clear())},At=(e,t)=>{if(!u)throw new Error("Logging not configured. Call configure() first.");u.filters.set(e,t),y.clear()},bt=e=>{u&&(u.filters.delete(e),y.clear())},kt=e=>{if(!u)throw new Error("Logging not configured. Call configure() first.");let t=d(e.category),r=w(t);u.loggers.set(r,{...e,category:t}),y.clear()},Pt=()=>u?Array.from(u.sinks.keys()):[],Rt=()=>u?Array.from(u.filters.keys()):[],_t=()=>u?Array.from(u.loggers.values()).map(e=>d(e.category)):[];var W={};ee(W,{DEFAULT_LEVEL:()=>Ft,Logger:()=>_,clearLoggerCache:()=>We,current:()=>It,getLogger:()=>Et});var Ft=g.Info,_=class e{category;parent;#e;#t=null;constructor(t,r=null,n={}){this.category=d(t),this.parent=r,this.#e=n}#r(){return this.#t===null&&(this.#t=ue(this.category)),this.#t}getChild(t){let r=j(this.category,d(t));return new e(r,this,this.#e)}with(t){return new e(this.category,this.parent,{...this.#e,...t})}get loggerName(){return V(this.category)}asString(t,r=!1){return typeof t=="string"?r?`"${t}"`:t:t===null||typeof t=="number"||typeof t=="bigint"||typeof t=="boolean"||typeof t>"u"||typeof t=="symbol"?String(t):t instanceof Error?t.stack:t!==null&&typeof t=="object"?Array.isArray(t)?JSON.stringify(t):`{${Object.entries(t).map(([n,i])=>`"${n}":${this.asString(i,!0)}`).join(",")}}`:"undefined"}async log(t,r,...n){let i=this.#r();if(t<i.lowestLevel)return r instanceof Function?void 0:r;let o,a;r instanceof Function?(o=r(),a=this.asString(o)):a=this.asString(r);let l=je(),s=Ne({message:a,rawMessage:a,args:n,datetime:new Date,severity:t,category:this.category,properties:this.#e,context:l});for(let c of i.filters)if(!c(s))return r instanceof Function?o:r;return i.sinks.length>0&&await Promise.all(i.sinks.map(c=>c(s))),r instanceof Function?o:r}debug(t,...r){return this.log(g.Debug,t,...r)}info(t,...r){return this.log(g.Info,t,...r)}warn(t,...r){return this.log(g.Warning,t,...r)}error(t,...r){return this.log(g.Error,t,...r)}critical(t,...r){return this.log(g.Critical,t,...r)}emergency(t,...r){return this.log(g.Emergency,t,...r)}alert(t,...r){return this.log(g.Alert,t,...r)}notice(t,...r){return this.log(g.Notice,t,...r)}trace(t,...r){return this.log(g.Trace,t,...r)}},fe=new Map,Et=e=>{let t=$e(d(e)),r=w(t),n=fe.get(r);return n||(n=new _(t),fe.set(r,n)),n},We=()=>{fe.clear()};le(We);var It=new _(["default"]);var B={};ee(B,{fingersCrossedSink:()=>Kt,getBufferedSink:()=>zt,getOutputSink:()=>jt,getRecordCollectorSink:()=>Ue,getTestSink:()=>Wt,withFilter:()=>$t});var Nt={[g.Trace]:"TRCE",[g.Debug]:"DBUG",[g.Info]:"INFO",[g.Notice]:"NOTC",[g.Warning]:"WARN",[g.Error]:"ERRO",[g.Critical]:"CRIT",[g.Alert]:"ALRT",[g.Emergency]:"EMRG"};var Ot=(e,t)=>{if(t==="none")return"";if(typeof t=="function")return t(e);let r=e.toISOString(),n=r.slice(0,10),i=r.slice(11,19),o=r.slice(19);switch(t){case"rfc3339":return r;case"date-time-timezone":case void 0:return`${n} ${i}${o}`;case"date-time":return`${n} ${i}`;case"time-timezone":return`${i}${o}`;case"time":return i;case"date":return n}},Dt=e=>{try{return JSON.stringify(e)}catch{return String(e)}},Mt=(e,t)=>{let r={...t,...e},n=Object.entries(r);return n.length===0?"":" "+n.map(([i,o])=>{let a=typeof o=="string"?o:Dt(o);return`${i}=${a}`}).join(" ")};var Gt=(e,t)=>{switch(e){case g.Trace:return G(ke(t));case g.Debug:return Pe(t);case g.Info:return Ae(t);case g.Notice:return re(t);case g.Warning:return be(t);case g.Error:return L(t);case g.Critical:return M(L(t));case g.Alert:return M(L(t));case g.Emergency:return M(L(t));default:return C(t)}},Be=e=>{let t=Ot(e.datetime,"date-time-timezone"),r=Nt[e.severity]??"????",n=e.category.length>0?V(e.category):"",i=Mt(e.properties,e.context),o=[];return t&&o.push(G(t),C(" ")),o.push(Gt(e.severity,r),C(" ")),n&&o.push(re(`[${n}]`),C(" ")),e.severity>=g.Error?o.push(L(e.message)):o.push(C(e.message)),i.trim()&&o.push(C(" "),G(i.trim())),o};var jt=(e,t)=>{let r=t?.formatter??Be;return n=>{let i=r(n);e.writeln(...i)}},$t=(e,t)=>r=>{if(t(r))return e(r)},zt=(e,t={})=>{let{maxSize:r=100,flushIntervalMs:n=5e3}=t,i=[],o=null,a=async()=>{if(i.length===0)return;let c=i;i=[],o&&(clearTimeout(o),o=null),await Promise.all(c.map(p=>e(p)))},l=()=>{o===null&&(o=setTimeout(()=>{o=null,a().catch(()=>{})},n))},s=async c=>{i.push(c),i.length>=r?await a():l()};return s.flush=a,s},Kt=(e,t={})=>{let{triggerLevel:r=17,maxBufferSize:n=1e3}=t,i=[],o=!1,a=async()=>{let c=i;i=[],o=!0,await Promise.all(c.map(p=>e(p)))},l=()=>{i=[],o=!1},s=async c=>{if(o){await e(c);return}if(c.severity>=r){i.push(c),await a();return}i.push(c),i.length>n&&i.shift()};return s.flush=a,s.clear=l,s},Ue=()=>{let e=[];return{sink:r=>{e.push(r)},records:e}},Wt=Ue;var Ye=typeof globalThis=="object"?globalThis:global;var v="1.9.0";var Xe=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function Ut(e){var t=new Set([e]),r=new Set,n=e.match(Xe);if(!n)return function(){return!1};var i={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(i.prerelease!=null)return function(s){return s===e};function o(l){return r.add(l),!1}function a(l){return t.add(l),!0}return function(s){if(t.has(s))return!0;if(r.has(s))return!1;var c=s.match(Xe);if(!c)return o(s);var p={major:+c[1],minor:+c[2],patch:+c[3],prerelease:c[4]};return p.prerelease!=null||i.major!==p.major?o(s):i.major===0?i.minor===p.minor&&i.patch<=p.patch?a(s):o(s):i.minor<=p.minor?a(s):o(s)}}var qe=Ut(v);var Yt=v.split(".")[0],F=Symbol.for("opentelemetry.js.api."+Yt),E=Ye;function A(e,t,r,n){var i;n===void 0&&(n=!1);var o=E[F]=(i=E[F])!==null&&i!==void 0?i:{version:v};if(!n&&o[e]){var a=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(a.stack||a.message),!1}if(o.version!==v){var a=new Error("@opentelemetry/api: Registration of version v"+o.version+" for "+e+" does not match previously registered API v"+v);return r.error(a.stack||a.message),!1}return o[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+v+"."),!0}function S(e){var t,r,n=(t=E[F])===null||t===void 0?void 0:t.version;if(!(!n||!qe(n)))return(r=E[F])===null||r===void 0?void 0:r[e]}function b(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+v+".");var r=E[F];r&&delete r[e]}var Xt=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},qt=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},He=function(){function e(t){this._namespace=t.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return I("debug",this._namespace,t)},e.prototype.error=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return I("error",this._namespace,t)},e.prototype.info=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return I("info",this._namespace,t)},e.prototype.warn=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return I("warn",this._namespace,t)},e.prototype.verbose=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return I("verbose",this._namespace,t)},e}();function I(e,t,r){var n=S("diag");if(n)return r.unshift(t),n[e].apply(n,qt([],Xt(r),!1))}var m;(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(m||(m={}));function Je(e,t){e<m.NONE?e=m.NONE:e>m.ALL&&(e=m.ALL),t=t||{};function r(n,i){var o=t[n];return typeof o=="function"&&e>=i?o.bind(t):function(){}}return{error:r("error",m.ERROR),warn:r("warn",m.WARN),info:r("info",m.INFO),debug:r("debug",m.DEBUG),verbose:r("verbose",m.VERBOSE)}}var Ht=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},Jt=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},Qt="diag",k=function(){function e(){function t(i){return function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var l=S("diag");if(l)return l[i].apply(l,Jt([],Ht(o),!1))}}var r=this,n=function(i,o){var a,l,s;if(o===void 0&&(o={logLevel:m.INFO}),i===r){var c=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return r.error((a=c.stack)!==null&&a!==void 0?a:c.message),!1}typeof o=="number"&&(o={logLevel:o});var p=S("diag"),f=Je((l=o.logLevel)!==null&&l!==void 0?l:m.INFO,i);if(p&&!o.suppressOverrideMessage){var x=(s=new Error().stack)!==null&&s!==void 0?s:"<failed to generate stacktrace>";p.warn("Current logger will be overwritten from "+x),f.warn("Current logger will overwrite one already registered from "+x)}return A("diag",f,r,!0)};r.setLogger=n,r.disable=function(){b(Qt,r)},r.createComponentLogger=function(i){return new He(i)},r.verbose=t("verbose"),r.debug=t("debug"),r.info=t("info"),r.warn=t("warn"),r.error=t("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}();function Qe(e){return Symbol.for(e)}var Zt=function(){function e(t){var r=this;r._currentContext=t?new Map(t):new Map,r.getValue=function(n){return r._currentContext.get(n)},r.setValue=function(n,i){var o=new e(r._currentContext);return o._currentContext.set(n,i),o},r.deleteValue=function(n){var i=new e(r._currentContext);return i._currentContext.delete(n),i}}return e}(),Ze=new Zt;var er=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},tr=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},et=function(){function e(){}return e.prototype.active=function(){return Ze},e.prototype.with=function(t,r,n){for(var i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];return r.call.apply(r,tr([n],er(i),!1))},e.prototype.bind=function(t,r){return r},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}();var rr=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},nr=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},pe="context",or=new et,U=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(t){return A(pe,t,k.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(t,r,n){for(var i,o=[],a=3;a<arguments.length;a++)o[a-3]=arguments[a];return(i=this._getContextManager()).with.apply(i,nr([t,r,n],rr(o),!1))},e.prototype.bind=function(t,r){return this._getContextManager().bind(t,r)},e.prototype._getContextManager=function(){return S(pe)||or},e.prototype.disable=function(){this._getContextManager().disable(),b(pe,k.instance())},e}();var Y;(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(Y||(Y={}));var me="0000000000000000",de="00000000000000000000000000000000",tt={traceId:de,spanId:me,traceFlags:Y.NONE};var h=function(){function e(t){t===void 0&&(t=tt),this._spanContext=t}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(t,r){return this},e.prototype.setAttributes=function(t){return this},e.prototype.addEvent=function(t,r){return this},e.prototype.addLink=function(t){return this},e.prototype.addLinks=function(t){return this},e.prototype.setStatus=function(t){return this},e.prototype.updateName=function(t){return this},e.prototype.end=function(t){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(t,r){},e}();var ye=Qe("OpenTelemetry Context Key SPAN");function X(e){return e.getValue(ye)||void 0}function rt(){return X(U.getInstance().active())}function N(e,t){return e.setValue(ye,t)}function nt(e){return e.deleteValue(ye)}function ot(e,t){return N(e,new h(t))}function q(e){var t;return(t=X(e))===null||t===void 0?void 0:t.spanContext()}var ir=/^([0-9a-f]{32})$/i,ar=/^[0-9a-f]{16}$/i;function sr(e){return ir.test(e)&&e!==de}function gr(e){return ar.test(e)&&e!==me}function H(e){return sr(e.traceId)&&gr(e.spanId)}function it(e){return new h(e)}var xe=U.getInstance(),J=function(){function e(){}return e.prototype.startSpan=function(t,r,n){n===void 0&&(n=xe.active());var i=!!r?.root;if(i)return new h;var o=n&&q(n);return cr(o)&&H(o)?new h(o):new h},e.prototype.startActiveSpan=function(t,r,n,i){var o,a,l;if(!(arguments.length<2)){arguments.length===2?l=r:arguments.length===3?(o=r,l=n):(o=r,a=n,l=i);var s=a??xe.active(),c=this.startSpan(t,o,s),p=N(s,c);return xe.with(p,l,void 0,c)}},e}();function cr(e){return typeof e=="object"&&typeof e.spanId=="string"&&typeof e.traceId=="string"&&typeof e.traceFlags=="number"}var lr=new J,at=function(){function e(t,r,n,i){this._provider=t,this.name=r,this.version=n,this.options=i}return e.prototype.startSpan=function(t,r,n){return this._getTracer().startSpan(t,r,n)},e.prototype.startActiveSpan=function(t,r,n,i){var o=this._getTracer();return Reflect.apply(o.startActiveSpan,o,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):lr},e}();var st=function(){function e(){}return e.prototype.getTracer=function(t,r,n){return new J},e}();var ur=new st,ve=function(){function e(){}return e.prototype.getTracer=function(t,r,n){var i;return(i=this.getDelegateTracer(t,r,n))!==null&&i!==void 0?i:new at(this,t,r,n)},e.prototype.getDelegate=function(){var t;return(t=this._delegate)!==null&&t!==void 0?t:ur},e.prototype.setDelegate=function(t){this._delegate=t},e.prototype.getDelegateTracer=function(t,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getTracer(t,r,n)},e}();var Se="trace",gt=function(){function e(){this._proxyTracerProvider=new ve,this.wrapSpanContext=it,this.isSpanContextValid=H,this.deleteSpan=nt,this.getSpan=X,this.getActiveSpan=rt,this.getSpanContext=q,this.setSpan=N,this.setSpanContext=ot}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(t){var r=A(Se,this._proxyTracerProvider,k.instance());return r&&this._proxyTracerProvider.setDelegate(t),r},e.prototype.getTracerProvider=function(){return S(Se)||this._proxyTracerProvider},e.prototype.getTracer=function(t,r){return this.getTracerProvider().getTracer(t,r)},e.prototype.disable=function(){b(Se,k.instance()),this._proxyTracerProvider=new ve},e}();var he=gt.getInstance();var Yn=he.getTracer("@eser/logging");var Te=(e,t,r)=>{let n=e.streamText(t,r);return{name:`ai-text/${e.provider}/${e.modelId}`,readable:new ReadableStream({async start(i){try{for await(let o of n)o.kind==="content_delta"&&i.enqueue(te(o.textDelta));i.close()}catch(o){i.error(o)}}})}};var dr={cc:"claude-code",ol:"ollama",oc:"opencode",oai:"openai",ant:"anthropic",gem:"gemini",vtx:"vertexai"},yr={"claude-code":"Claude Code",ollama:"Ollama",opencode:"OpenCode",kiro:"Kiro",anthropic:"Anthropic API",openai:"OpenAI API",gemini:"Gemini API",vertexai:"Vertex AI"},xr=e=>dr[e]??e,vr=async e=>{if(e){let t=T.process.stderr.getWriter(),r=ne({renderer:_e.ansi(),sink:oe.writable(new WritableStream({async write(n){await t.write(new TextEncoder().encode(String(n.data)))},close(){t.releaseLock()}}))});await K.configure({sinks:{stderr:B.getOutputSink(r)},loggers:[{category:["ai"],lowestLevel:g.Debug,sinks:["stderr"]}]})}return W.getLogger(["ai","ask"])},Sr=async e=>{await e.info("Auto-detecting AI provider...");try{if(await ie`which claude`.noThrow().code()===0)return await e.info("Claude Code detected."),"claude-code"}catch{}try{if((await fetch("http://localhost:11434/api/version",{signal:AbortSignal.timeout(1e3)})).ok)return await e.info("Ollama detected at localhost:11434."),"ollama"}catch{}try{if(await ie`which opencode`.noThrow().code()===0)return await e.info("OpenCode detected."),"opencode"}catch{}if(T.capabilities.env){if(T.env.has("ANTHROPIC_API_KEY"))return await e.info("Anthropic API key detected."),"anthropic";if(T.env.has("OPENAI_API_KEY"))return await e.info("OpenAI API key detected."),"openai"}throw new Error("No AI provider detected. Install claude, ollama, or set ANTHROPIC_API_KEY / OPENAI_API_KEY.")},hr=async e=>{switch(e){case"claude-code":return(await import("./claude-code-6AAAJZKK.js")).claudeCodeFactory;case"ollama":return(await import("./ollama-24ACY3UB.js")).ollamaFactory;case"opencode":return(await import("./opencode-LFWHRZPL.js")).openCodeFactory;case"kiro":return(await import("./kiro-MHP573OZ.js")).kiroFactory;case"anthropic":return(await import("./anthropic-GKH6HH6J.js")).anthropicFactory;case"openai":return(await import("./openai-ZNKOR4CD.js")).openaiFactory;case"gemini":return(await import("./gemini-Z57NY6WY.js")).geminiFactory;case"vertexai":return(await import("./vertexai-WVENJL2F.js")).vertexaiFactory;default:throw new Error(`Unknown provider: ${e}`)}},lo=async e=>{let t=e??[],r=null,n=null,i=null,o=!1,a=!1,l=[],s=0;for(;s<t.length;){let f=t[s];if(f==="-p"||f==="--provider"){r=t[s+1]??null,s+=2;continue}if(f==="-m"||f==="--model"){n=t[s+1]??null,s+=2;continue}if(f==="--max-tokens"){let x=t[s+1];x!==void 0&&(i=Number(x)),s+=2;continue}if(f==="--json"){o=!0,s+=1;continue}if(f==="-v"||f==="--verbose"){a=!0,s+=1;continue}f.startsWith("-")||l.push(f),s+=1}let c=l.join(" ");if(c.length===0)return D({message:'Usage: ai ask "your prompt" [-p provider] [-m model] [--verbose]',exitCode:1});let p=await vr(a);try{let f=r!==null?xr(r):await Sr(p),x=yr[f]??f,Ce=n??Lr(f);await p.info(`Using ${x} (${Ce})`);let lt=await hr(f),Q=new Ie({factories:[lt]});await Q.addModel("default",{provider:f,model:Ce});let Z=Q.getDefault();if(Z===null)return D({message:"Failed to initialize model",exitCode:1});let we=[Fe("user",c)];if(await p.info(`Sending prompt (${c.length} chars)...`),o){let O=await Z.generateText({messages:we,maxTokens:i??void 0});await p.info(`Response received (${Ee(O).length} chars)`);let P=ne({sink:oe.stdout()});P.writeln(JSON.stringify(O,null,2)),await P.close()}else{let O=Te(Z,{messages:we,maxTokens:i??void 0});await Re().from(O).to(wr()).run();let P=T.process.stdout.getWriter();await P.write(new TextEncoder().encode(`
|
|
2
2
|
`)),P.releaseLock()}return await Q.close(),Le(void 0)}catch(f){let x=f instanceof Error?f.message:String(f);return await p.error(x),a&&f instanceof Error&&f.cause!==void 0&&await p.debug(`Cause: ${String(f.cause)}`),D({message:x,exitCode:1})}},Tr=12,Cr=e=>new Promise(t=>setTimeout(t,e)),wr=(e=Tr)=>{let t=new TextEncoder;return{name:"typewriter",writable:new WritableStream({async write(r){let n=String(r.data),i=T.process.stdout.getWriter();for(let o of n)await i.write(t.encode(o)),await Cr(e);i.releaseLock()}})}},Lr=e=>{switch(e){case"claude-code":return"claude-sonnet-4-20250514";case"ollama":return"llama3";case"opencode":return"default";case"kiro":return"default";case"anthropic":return"claude-sonnet-4-20250514";case"openai":return"gpt-4o";case"gemini":return"gemini-2.0-flash";case"vertexai":return"gemini-2.0-flash";default:return"default"}};export{lo as main};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as k}from"./chunk-4ODVKO5Y.js";import{a as g}from"./chunk-UXRWSNVZ.js";import{e as w,f,k as h}from"./chunk-WUVVLUU5.js";import{c as i,d as m,f as l,h as c,o as p,q as d,r as u}from"./chunk-EZH232V7.js";import{a as o,b as n}from"./chunk-2N4GTHXQ.js";import{b as a}from"./chunk-UA3VIHYO.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var $=async b=>{let e=p({renderer:u.ansi(),sink:d.stdout()}),s=a.process.cwd(),r=b?.join(" ")??"No reason given",t=await w(s),x=await h(s);if(t.phase!=="EXECUTING")return e.writeln(l(`Cannot block in phase: ${t.phase}`)),await e.close(),n({exitCode:1});let y=k(t,r);return await f(s,y),e.writeln(c("\u26A0")," Spec blocked: ",m(r)),e.writeln("Resolve with: ",i(`${g('next --answer="resolution"',x)}`)),await e.close(),o(void 0)};export{$ as main};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as i}from"./chunk-OLM5RTFK.js";import{b as d,d as c}from"./chunk-
|
|
1
|
+
import{a as i}from"./chunk-OLM5RTFK.js";import{b as d,d as c}from"./chunk-3AZBET4N.js";var y=async(r,t)=>{let e=t.properties?.binPath;if(e!==void 0)return e;try{let n=await c`which ${r}`.noThrow().text();if(n.length>0)return n}catch{}throw new i(`Binary "${r}" not found. Set properties.binPath in config or ensure it is on PATH.`,{provider:r})},f=(r,t,e)=>{let s=new d(r,[...t],{stdin:"null",stdout:"piped",stderr:"piped",cwd:e?.cwd,env:e?.env}).child();if(e?.signal!==void 0){let o=e.signal;o.aborted?s.kill("SIGTERM"):o.addEventListener("abort",()=>{s.kill("SIGTERM")},{once:!0})}return{stdout:s.stdout,stderr:s.stderr,waitForExit:async()=>{let o=await s.status;return{code:o.code,success:o.success}},kill:o=>{s.kill(o??"SIGTERM")}}},a=new TextDecoder;async function*m(r){let t=r.getReader(),e="";try{let n=await t.read();for(;n.done!==!0;){e+=a.decode(n.value,{stream:!0});let o=e.split(`
|
|
2
2
|
`);e=o.pop()??"";for(let u of o){let l=u.trim();if(l.length!==0)try{yield JSON.parse(l)}catch{}}n=await t.read()}let s=e.trim();if(s.length>0)try{yield JSON.parse(s)}catch{}}finally{t.releaseLock()}}var h=async(r,t)=>{let e=r.getReader(),n=[],s=await e.read();for(;s.done!==!0;)n.push(a.decode(s.value,{stream:!0})),s=await e.read();return e.releaseLock(),{content:[{kind:"text",text:n.join("").trim()}],stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0},modelId:t}},w=async r=>{let t=r.getReader(),e=[],n=await t.read();for(;n.done!==!0;)e.push(a.decode(n.value,{stream:!0})),n=await t.read();return t.releaseLock(),e.join("").trim()},x=(r,t,e)=>{if(t===0)return null;let n=e.length>0?`${r} exited with code ${t}: ${e}`:`${r} exited with code ${t}`;return t===1?new i(n,{provider:r}):t===126||t===127?new i(`${r} binary not found or not executable (exit code ${t})`,{provider:r}):new i(n,{provider:r})},b=(r,t)=>{let e=[];t!==void 0&&(e.push(t),e.push(""));for(let n of r)for(let s of n.content)s.kind==="text"&&e.push(s.text);return e.join(`
|
|
3
3
|
`)};export{y as a,f as b,m as c,h as d,w as e,x as f,b as g};
|
|
@@ -1 +1 @@
|
|
|
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"],acceptanceCriteria:["Public API documented","Changes reflected in README or API docs","No exclusionary patterns introduced"]};var r={id:"beautiful-product",name:"Beautiful Product",description:"Design and UX are first-class. Agent critiques UI/UX like a passionate designer. Empty states, error states, loading states, mobile layout \u2014 nothing ships unspecified.",extras:[{questionId:"status_quo",text:"How painful is the current experience?"},{questionId:"ambition",text:"In the 10-star version, what does the user feel?"}],specSections:["Design States (empty, loading, error, success)","Mobile Layout","Interaction Design"],reminders:["Loading state and error state must be designed, not placeholder","No AI slop \u2014 every UI element is intentional","Empty states need clear CTAs with examples"],acceptanceCriteria:["All UI states designed (empty, loading, error, success)","Mobile layout considered","No placeholder or skeleton UI left unfinished"]};var a={id:"long-lived",name:"Long-Lived",description:"Built to last. Stability, maintainability, and backward compatibility matter. Every shortcut needs justification. Favor boring technology.",extras:[{questionId:"reversibility",text:"Will this decision still be correct in 2 years?"},{questionId:"scope_boundary",text:"What technical debt would this introduce?"}],specSections:["Migration & Deprecation","Backward Compatibility"],reminders:["Favor boring technology over shiny new tools","Every shortcut needs explicit justification","Consider maintenance burden for new dependencies"],acceptanceCriteria:["Backward compatibility preserved","Migration path documented if breaking","No unnecessary new dependencies"]};var c={id:"move-fast",name:"Move Fast",description:"Optimize for shipping speed. Acceptable trade-offs on polish. Good enough is good enough. Reduce ceremony.",extras:[{questionId:"scope_boundary",text:"Which polish items can be deferred to v2?"},{questionId:"ambition",text:"What is the minimum viable 5-star version?"}],specSections:["v1 vs v2 Scope"],reminders:["Good enough is good enough \u2014 ship it","Reduce ceremony, optimize for feedback speed","Mark polish items for v2 explicitly"],acceptanceCriteria:["Core functionality works","v2 items explicitly deferred"]};var d={id:"compliance",name:"Compliance",description:"Audit trails, access controls, data handling rules. Every change is traceable. Verification is mandatory, not optional.",extras:[{questionId:"reversibility",text:"Is the audit trail preserved on rollback?"},{questionId:"verification",text:"Is there an audit/traceability requirement?"}],specSections:["Audit Trail","Access Control","Data Handling"],reminders:["Every state change must be traceable","Verification is mandatory, not optional","Document data handling and retention policies"],acceptanceCriteria:["Audit trail added for state changes","Access control verified","Data handling documented"]};var l={id:"learning-project",name:"Learning Project",description:"Experimentation is the goal. Encourage trying new patterns, don't punish dead ends. Document learnings over polish.",extras:[{questionId:"ambition",text:"What do you want to learn from building this?"},{questionId:"scope_boundary",text:"What experiments are explicitly allowed?"}],specSections:["Learning Goals","Experiment Log"],reminders:["Document learnings, not just outcomes","Dead ends are acceptable \u2014 document why","Try new patterns freely, polish later"],acceptanceCriteria:["Learnings documented","Experiment outcomes recorded"]};var u=[s,r,a,c,d,l];var N=()=>Promise.resolve(u),U=(t,n)=>{let e=[];for(let i of t)for(let o of i.extras)o.questionId===n&&e.push(o);return e},F=t=>{let n=[];for(let e of t)for(let i of e.reminders)n.push(`${e.id}: ${i}`);return n},_=t=>{let n=[],e=t.map(i=>i.id);return e.includes("move-fast")&&e.includes("compliance")&&n.push({between:["move-fast","compliance"],issue:"Speed vs traceability \u2014 shortcuts may violate audit requirements."}),e.includes("move-fast")&&e.includes("long-lived")&&n.push({between:["move-fast","long-lived"],issue:"Shipping speed vs maintainability \u2014 tech debt decisions need human approval."}),e.includes("beautiful-product")&&e.includes("move-fast")&&n.push({between:["beautiful-product","move-fast"],issue:"Design polish vs speed \u2014 which UI states can be deferred?"}),n};export{
|
|
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"],acceptanceCriteria:["Public API documented","Changes reflected in README or API docs","No exclusionary patterns introduced"]};var r={id:"beautiful-product",name:"Beautiful Product",description:"Design and UX are first-class. Agent critiques UI/UX like a passionate designer. Empty states, error states, loading states, mobile layout \u2014 nothing ships unspecified.",extras:[{questionId:"status_quo",text:"How painful is the current experience?"},{questionId:"ambition",text:"In the 10-star version, what does the user feel?"}],specSections:["Design States (empty, loading, error, success)","Mobile Layout","Interaction Design"],reminders:["Loading state and error state must be designed, not placeholder","No AI slop \u2014 every UI element is intentional","Empty states need clear CTAs with examples"],acceptanceCriteria:["All UI states designed (empty, loading, error, success)","Mobile layout considered","No placeholder or skeleton UI left unfinished"]};var a={id:"long-lived",name:"Long-Lived",description:"Built to last. Stability, maintainability, and backward compatibility matter. Every shortcut needs justification. Favor boring technology.",extras:[{questionId:"reversibility",text:"Will this decision still be correct in 2 years?"},{questionId:"scope_boundary",text:"What technical debt would this introduce?"}],specSections:["Migration & Deprecation","Backward Compatibility"],reminders:["Favor boring technology over shiny new tools","Every shortcut needs explicit justification","Consider maintenance burden for new dependencies"],acceptanceCriteria:["Backward compatibility preserved","Migration path documented if breaking","No unnecessary new dependencies"]};var c={id:"move-fast",name:"Move Fast",description:"Optimize for shipping speed. Acceptable trade-offs on polish. Good enough is good enough. Reduce ceremony.",extras:[{questionId:"scope_boundary",text:"Which polish items can be deferred to v2?"},{questionId:"ambition",text:"What is the minimum viable 5-star version?"}],specSections:["v1 vs v2 Scope"],reminders:["Good enough is good enough \u2014 ship it","Reduce ceremony, optimize for feedback speed","Mark polish items for v2 explicitly"],acceptanceCriteria:["Core functionality works","v2 items explicitly deferred"]};var d={id:"compliance",name:"Compliance",description:"Audit trails, access controls, data handling rules. Every change is traceable. Verification is mandatory, not optional.",extras:[{questionId:"reversibility",text:"Is the audit trail preserved on rollback?"},{questionId:"verification",text:"Is there an audit/traceability requirement?"}],specSections:["Audit Trail","Access Control","Data Handling"],reminders:["Every state change must be traceable","Verification is mandatory, not optional","Document data handling and retention policies"],acceptanceCriteria:["Audit trail added for state changes","Access control verified","Data handling documented"]};var l={id:"learning-project",name:"Learning Project",description:"Experimentation is the goal. Encourage trying new patterns, don't punish dead ends. Document learnings over polish.",extras:[{questionId:"ambition",text:"What do you want to learn from building this?"},{questionId:"scope_boundary",text:"What experiments are explicitly allowed?"}],specSections:["Learning Goals","Experiment Log"],reminders:["Document learnings, not just outcomes","Dead ends are acceptable \u2014 document why","Try new patterns freely, polish later"],acceptanceCriteria:["Learnings documented","Experiment outcomes recorded"]};var u=[s,r,a,c,d,l];var N=()=>Promise.resolve(u),U=(t,n)=>{let e=[];for(let i of t)for(let o of i.extras)o.questionId===n&&e.push(o);return e},F=t=>{let n=[];for(let e of t)for(let i of e.reminders)n.push(`${e.id}: ${i}`);return n},_=t=>{let n=[],e=t.map(i=>i.id);return e.includes("move-fast")&&e.includes("compliance")&&n.push({between:["move-fast","compliance"],issue:"Speed vs traceability \u2014 shortcuts may violate audit requirements."}),e.includes("move-fast")&&e.includes("long-lived")&&n.push({between:["move-fast","long-lived"],issue:"Shipping speed vs maintainability \u2014 tech debt decisions need human approval."}),e.includes("beautiful-product")&&e.includes("move-fast")&&n.push({between:["beautiful-product","move-fast"],issue:"Design polish vs speed \u2014 which UI states can be deferred?"}),n};export{u as a,N as b,U as c,F as d,_ as e};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{c as l}from"./chunk-UA3VIHYO.js";var a=class extends Error{constructor(e,n,s,o){super(e);this.command=n;this.code=s;this.stderr=o;this.name="CommandError"}};var u=new TextDecoder,c=class r{#e;#r;#t;constructor(t,e=[],n={}){this.#e=t,this.#r=e,this.#t={throwOnError:!0,stdout:"piped",stderr:"piped",...n}}cwd(t){return new r(this.#e,this.#r,{...this.#t,cwd:t})}env(t,e){let n=this.#t.env??{},s;return typeof t=="string"&&e!==void 0?s={...n,[t]:e}:t!==null&&typeof t=="object"?s={...n,...t}:s=n,new r(this.#e,this.#r,{...this.#t,env:s})}stdin(t){return new r(this.#e,this.#r,{...this.#t,stdin:t})}stdout(t){return new r(this.#e,this.#r,{...this.#t,stdout:t})}stderr(t){return new r(this.#e,this.#r,{...this.#t,stderr:t})}timeout(t){return new r(this.#e,this.#r,{...this.#t,timeout:t})}noThrow(){return new r(this.#e,this.#r,{...this.#t,throwOnError:!1})}quiet(){return new r(this.#e,this.#r,{...this.#t,stdout:"null",stderr:"null"})}printCommand(){let t=[this.#e,...this.#r].join(" ");return console.log(`$ ${t}`),this}async spawn(){let{runtime:t}=l,e=await t.exec.spawn(this.#e,this.#r,{cwd:this.#t.cwd,env:this.#t.env,stdin:this.#t.stdin,stdout:this.#t.stdout,stderr:this.#t.stderr});if(!e.success&&this.#t.throwOnError===!0){let n=u.decode(e.stderr);throw new a(`Command failed with exit code ${e.code}: ${this.#e}`,this.#e,e.code,n)}return e}async text(t="stdout"){let e=await this.spawn();switch(t){case"stdout":return u.decode(e.stdout).trim();case"stderr":return u.decode(e.stderr).trim();case"combined":return(u.decode(e.stdout)+u.decode(e.stderr)).trim()}}async json(){let t=await this.text();return JSON.parse(t)}async lines(){let t=await this.text();return t===""?[]:t.split(`
|
|
2
2
|
`)}async bytes(){return(await this.spawn()).stdout}async code(){return(await this.noThrow().spawn()).code}pipe(t){return new p([this,t])}child(){let{runtime:t}=l;return t.exec.spawnChild(this.#e,this.#r,{cwd:this.#t.cwd,env:this.#t.env,stdin:this.#t.stdin??"piped",stdout:this.#t.stdout??"piped",stderr:this.#t.stderr??"piped"})}},p=class r{#e;constructor(t){this.#e=t}pipe(t){return new r([...this.#e,t])}async text(){let t="";for(let e of this.#e){let n=await e.spawn();t=u.decode(n.stdout)}return t.trim()}async lines(){let t=await this.text();return t===""?[]:t.split(`
|
|
3
3
|
`)}};var h=(r,t)=>{let e=[];for(let s=0;s<r.length;s++){let o=r[s];if(o!==void 0&&e.push(o),s<t.length){let i=t[s];Array.isArray(i)?e.push(i.map(m=>w(String(m))).join(" ")):i!=null&&e.push(w(String(i)))}}let n=e.join("").trim();return f(n)},w=r=>/[\s"'\\$`]/.test(r)?`'${r.replace(/'/g,"'\\''")}'`:r,f=r=>{let t=[],e="",n=!1,s=!1,o=!1;for(let m=0;m<r.length;m++){let d=r[m];if(o){e+=d,o=!1;continue}if(d==="\\"){o=!0;continue}if(d==="'"&&!s){n=!n;continue}if(d==='"'&&!n){s=!s;continue}if(d===" "&&!n&&!s){e.length>0&&(t.push(e),e="");continue}e+=d}e.length>0&&t.push(e);let i=t[0];return i===void 0?["",[]]:[i,t.slice(1)]};var g=(r,...t)=>{let[e,n]=h(r,t);return new c(e,n)};export{a,c as b,h as c,g as d};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as m}from"./chunk-
|
|
1
|
+
import{b as m}from"./chunk-IVSTITPL.js";import{d}from"./chunk-WUVVLUU5.js";import{b as l}from"./chunk-UA3VIHYO.js";var h=c=>{let n=c.split(/\n/).flatMap(i=>i.trim().length>0?[i.trim()]:[]);return n.length>1?n:c.split(/\.\s+|;\s+/).map(i=>i.trim()).filter(i=>i.length>5)},v=c=>{let n=[],i=c.find(t=>t.questionId==="ambition");if(i!==void 0){let t=i.answer,e=t.match(/10[- ]?star[:\s]+(.+)/i),r=e!==null?e[1].trim():t.length>120?t.slice(0,120)+"...":t,p=r.charAt(0).toUpperCase()+r.slice(1);n.push(p)}let o=c.find(t=>t.questionId==="verification");if(o!==void 0){let t=h(o.answer);for(let e of t){let r=e.toLowerCase();r.startsWith("run ")||r.startsWith("check ")?n.push(`Test: ${e}`):n.push(e)}}return n.length===0&&n.push("_Tasks need to be defined before execution. Add tasks manually or run discovery with more detail._"),n},w=(c,n)=>{let i={};if(n===null){for(let o of c.specSections)i[o]=!1;return i}for(let o of c.specSections){let t=o.toLowerCase();t.includes("design")||t.includes("mobile")||t.includes("layout")||t.includes("interaction")?i[o]=n.involvesUI:t.includes("contributor")||t.includes("public api")||t.includes("api surface")?i[o]=n.involvesPublicAPI:t.includes("migration")||t.includes("deprecation")||t.includes("backward")||t.includes("compatibility")?i[o]=n.involvesMigration:t.includes("audit")||t.includes("access control")||t.includes("data handling")?i[o]=n.involvesDataHandling:i[o]=!0}return i},g=(c,n,i,o,t)=>{let e=[];e.push(`# Spec: ${c}`),e.push(""),e.push("## Status: draft"),e.push(""),i.length>0&&(e.push(`## Concerns: ${i.map(s=>s.id).join(", ")}`),e.push("")),e.push("## Discovery Answers"),e.push("");for(let s of n)e.push(`### ${s.questionId}`),e.push(""),e.push(s.answer),e.push("");for(let s of i)if(s.specSections.length>0){let a=w(s,t??null);for(let f of s.specSections)a[f]!==!1&&(e.push(`## ${f} (${s.id})`),e.push(""),e.push("_To be addressed during execution._"),e.push(""))}if(o.length>0){e.push("## Decisions"),e.push(""),e.push("| # | Decision | Choice | Promoted |"),e.push("|---|----------|--------|----------|");for(let s=0;s<o.length;s++){let a=o[s];e.push(`| ${s+1} | ${a.question} | ${a.choice} | ${a.promoted?"yes":"no"} |`)}e.push("")}let r=n.find(s=>s.questionId==="scope_boundary");if(r!==void 0){e.push("## Out of Scope"),e.push("");let s=h(r.answer);for(let a of s)e.push(`- ${a}`);e.push("")}let p=v(n);e.push("## Tasks"),e.push("");for(let s=0;s<p.length;s++)e.push(`- [ ] task-${s+1}: ${p[s]}`);e.push("");let u=n.find(s=>s.questionId==="verification");if(e.push("## Verification"),e.push(""),u!==void 0){let s=h(u.answer);for(let a of s)e.push(`- ${a}`)}else e.push("_To be defined._");return e.push(""),e.join(`
|
|
2
2
|
`)};var k=async(c,n,i)=>{if(n.spec===null)throw new Error("No active spec");let o=`${c}/${d.specDir(n.spec)}`,t=`${c}/${d.specFile(n.spec)}`;await l.fs.mkdir(o,{recursive:!0});let e=g(n.spec,n.discovery.answers,i,n.decisions,n.classification);await l.fs.writeTextFile(t,e);let r=m(n.spec,e),p=`${o}/progress.json`,u={spec:n.spec,status:"draft",tasks:r.tasks.map(s=>({id:s.id,title:s.title,status:"pending"})),decisions:n.decisions.map(s=>({question:s.question,choice:s.choice,promoted:s.promoted})),debt:[],updatedAt:new Date().toISOString()};return await l.fs.writeTextFile(p,JSON.stringify(u,null,2)+`
|
|
3
3
|
`),t};export{k as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as l}from"./chunk-UA3VIHYO.js";var F=s=>{if(s===void 0)return"json";for(let n of s)if(n==="-o"||n.startsWith("--output")){let t=s.indexOf(n);if(n.includes("="))return x(n.split("=")[1]??"json");let i=s[t+1];if(i!==void 0&&!i.startsWith("-"))return x(i)}return"json"},O=s=>{if(s===void 0)return[];let n=[],t=!1;for(let i=0;i<s.length;i++){if(t){t=!1;continue}let o=s[i];if(!o.startsWith("--output=")){if(o==="-o"||o==="--output"){t=!0;continue}n.push(o)}}return n},x=s=>{let n=s.toLowerCase();return n==="md"||n==="markdown"?"markdown":n==="text"||n==="txt"||n==="plain"?"text":"json"},e=(s,n)=>s[n],$=s=>JSON.stringify(s,null,2),w=s=>{let n=s,t=[],i=e(n,"phase");i!==void 0&&(t.push(`# noskills \u2014 ${i}`),t.push(""));let o=e(n,"instruction");o!==void 0&&(t.push("## Instruction"),t.push(""),t.push(o),t.push(""));let a=e(n,"questions");if(a!==void 0&&a.length>0)for(let r of a){if(t.push(`## Question: ${r.id}`),t.push(""),t.push(`> ${r.text}`),r.extras!==void 0&&r.extras.length>0){t.push(""),t.push("Also consider:");for(let m of r.extras)t.push(`- ${m}`)}t.push("")}let h=e(n,"statusReport");if(h!==void 0){t.push("## Acceptance Criteria"),t.push("");for(let r of h.criteria)t.push(`- [ ] ${r}`);t.push("")}let p=e(n,"previousIterationDebt");if(p!==void 0){t.push(`## Debt (from iteration ${p.fromIteration})`),t.push(""),t.push(`> ${p.note}`),t.push("");for(let r of p.items)t.push(`- ${r}`);t.push("")}e(n,"verificationFailed")===!0&&(t.push("## Verification FAILED"),t.push(""),t.push("```"),t.push(String(e(n,"verificationOutput")??"")),t.push("```"),t.push(""));let c=e(n,"behavioral");if(c!==void 0){t.push("## Behavioral"),t.push(""),t.push(`**Tone:** ${c.tone}`),t.push("");for(let r of c.rules)t.push(`- ${r}`);c.urgency!==void 0&&(t.push(""),t.push(`**Urgency:** ${c.urgency}`)),t.push("")}let f=e(n,"meta");f!==void 0&&(t.push("---"),t.push(""),t.push(`*${f.resumeHint}*`),t.push(""));let d=e(n,"transition");if(d!==void 0){t.push("## Next Steps"),t.push("");for(let[r,m]of Object.entries(d))r!=="iteration"&&t.push(`- **${r}:** \`${m}\``);t.push("")}let u=e(n,"summary");u!==void 0&&(t.push("## Summary"),t.push(""),t.push(`- Spec: ${u.spec}`),t.push(`- Iterations: ${u.iterations}`),t.push(`- Decisions: ${u.decisionsCount}`),t.push(""));let g=e(n,"clearContext");return g!==void 0&&(t.push("---"),t.push(""),t.push(`**Action required:** ${g.reason}`),t.push("")),t.join(`
|
|
2
2
|
`)},k=s=>{let n=s,t=[],i=e(n,"phase");i!==void 0&&t.push(`[${i}]`);let o=e(n,"instruction");o!==void 0&&t.push(o);let a=e(n,"questions");if(a!==void 0&&a.length>0){for(let u of a)if(t.push(""),t.push(`Question [${u.id}]: ${u.text}`),u.extras!==void 0)for(let g of u.extras)t.push(` - ${g}`)}let h=e(n,"statusReport");if(h!==void 0){t.push(""),t.push("Criteria:");for(let u of h.criteria)t.push(` - ${u}`)}let p=e(n,"previousIterationDebt");if(p!==void 0){t.push(""),t.push(p.note);for(let u of p.items)t.push(` - ${u}`)}e(n,"verificationFailed")===!0&&(t.push(""),t.push(`Verification failed: ${String(e(n,"verificationOutput")??"").slice(0,200)}`));let c=e(n,"meta");c!==void 0&&(t.push(""),t.push(c.resumeHint));let f=e(n,"summary");f!==void 0&&t.push(`Spec: ${f.spec}, Iterations: ${f.iterations}, Decisions: ${f.decisionsCount}`);let d=e(n,"clearContext");return d!==void 0&&(t.push(""),t.push(d.reason)),t.join(`
|
|
3
3
|
`)},b=(s,n)=>{switch(n){case"markdown":return w(s);case"text":return k(s);default:return $(s)}},v=async(s,n)=>{let t=b(s,n),i=new TextEncoder,o=l.process.stdout.getWriter();await o.write(i.encode(t+`
|
|
4
4
|
`)),o.releaseLock()};export{F as a,O as b,b as c,v as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as i}from"./chunk-
|
|
1
|
+
import{d as i}from"./chunk-WUVVLUU5.js";var n={UNINITIALIZED:["IDLE"],IDLE:["DISCOVERY"],DISCOVERY:["SPEC_DRAFT"],SPEC_DRAFT:["SPEC_APPROVED"],SPEC_APPROVED:["EXECUTING"],EXECUTING:["DONE","BLOCKED"],BLOCKED:["EXECUTING"],DONE:["IDLE"]},c=(e,s)=>n[e].includes(s),t=(e,s)=>{if(!c(e,s))throw new Error(`Invalid phase transition: ${e} \u2192 ${s}. Allowed: ${n[e].join(", ")}`)},h=(e,s)=>(t(e.phase,s),{...e,phase:s}),d=(e,s,a)=>(t(e.phase,"DISCOVERY"),{...e,phase:"DISCOVERY",spec:s,branch:a,discovery:{answers:[],completed:!1},specState:{path:null,status:"none"},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[]},decisions:[]}),E=(e,s,a)=>{if(e.phase!=="DISCOVERY")throw new Error(`Cannot add discovery answer in phase: ${e.phase}`);let o=[...e.discovery.answers.filter(r=>r.questionId!==s),{questionId:s,answer:a}];return{...e,discovery:{answers:o,completed:e.discovery.completed}}},u=e=>{if(e.phase!=="DISCOVERY")throw new Error(`Cannot complete discovery in phase: ${e.phase}`);return{...e,phase:"SPEC_DRAFT",discovery:{...e.discovery,completed:!0},specState:{path:i.specFile(e.spec),status:"draft"}}},m=e=>(t(e.phase,"SPEC_APPROVED"),{...e,phase:"SPEC_APPROVED",specState:{...e.specState,status:"approved"}}),S=e=>(t(e.phase,"EXECUTING"),{...e,phase:"EXECUTING",discovery:{answers:[],completed:!0},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[]}});var D=(e,s)=>(t(e.phase,"BLOCKED"),{...e,phase:"BLOCKED",execution:{...e.execution,lastProgress:`BLOCKED: ${s}`}}),C=(e,s)=>({...e,decisions:[...e.decisions,s]}),F=e=>({...e,phase:"IDLE",spec:null,branch:null,discovery:{answers:[],completed:!1},specState:{path:null,status:"none"},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[]},decisions:[],pendingClear:!1,classification:null});export{h as a,d as b,E as c,u as d,m as e,S as f,D as g,C as h,F as i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as v}from"./chunk-UA3VIHYO.js";import{d as G}from"./chunk-DXB73IDG.js";var y=e=>e.map(n=>typeof n=="string"?X(n):n),X=e=>({kind:"text",value:e}),se=(...e)=>({kind:"bold",children:y(e)}),le=(...e)=>({kind:"dim",children:y(e)});var pe=(...e)=>({kind:"group",children:y(e)});var g=(e,...n)=>({kind:"color",color:e,children:y(n)}),ue=(...e)=>g("red",...e),de=(...e)=>g("green",...e),ce=(...e)=>g("yellow",...e),me=(...e)=>g("blue",...e),ye=(...e)=>g("magenta",...e),he=(...e)=>g("cyan",...e),fe=(...e)=>g("gray",...e);var ke=(e,n)=>({kind:"table",headers:y(e),rows:n.map(r=>y(r))});var Se=(e,...n)=>({kind:"alert",level:e,children:y(n)}),h=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+h(r),0);case"code-block":return e.value.length;case"table":case"list":return 0;case"gauge":{let n=e.width??20,r=e.label?` ${e.label}`:"";return n+` ${e.percent}%`.length+r.length}case"separator":return 0;case"alert":return 2+e.children.reduce((n,r)=>n+h(r),0)}};var w=(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
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
3
|
`).map(n=>` ${n}`).join(`
|
|
4
4
|
`)+`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as O,d as P}from"./chunk-NTKVTLTO.js";import{a as w,d as D,e as S}from"./chunk-2WH262CW.js";import{a as R}from"./chunk-UXRWSNVZ.js";var A=null,t=e=>R(e,A),$="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.",N=(e,n,r,i)=>{let l=e.execution.iteration>=n,s=r?[]:[$],d=i?.outOfScope??[];switch(e.phase){case"IDLE":return{rules:[...s,"Present interactiveOptions to the user using your native interactive question tool (AskUserQuestionTool or equivalent). Do NOT list them as a text table.","If no interactive question tool is available, fall back to a concise numbered list.","Do not take action without the user choosing an option first."],tone:"Welcoming. Present choices, then wait."};case"DISCOVERY":return{rules:[...s,"You received all questions at once from noskills. Present them to the user ONE AT A TIME for better conversation flow.","Use your interactive question tool to ask each question individually. Show concern sub-questions as additional context.","Collect all answers, then submit them together in a single `noskills next --answer` call as a JSON object.","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 \`${t("next")}\`.`,`When you discover a pattern, receive a correction, or identify a recurring preference from the user, ask: 'Should this be a permanent rule for this project, or just for this task?' If permanent, run: \`${t('rule add "<description>"')}\`. If just this task, note it and move on. Never write to \`.eser/rules/\` directly.`];e.execution.lastVerification?.passed===!1&&a.push("Tests are failing. Fix ONLY the failing tests. Do not refactor passing code.");let o={rules:a,tone:"Direct. No preamble. Start coding immediately.",outOfScope:d.length>0?d:void 0};return l?{...o,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.`}:o}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 \`${t("next")}\` to get your instructions.`,"Do not take action without noskills guidance."],tone:"Neutral. Waiting for direction."}}},B=5*60*1e3,F=(e,n)=>{let r;switch(e.phase){case"IDLE":r=`No active spec. Start one with: \`${t("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 \`${t("next")}\` to get started.`}return{protocol:`Run \`${t('next --answer="..."')}\` to submit results and advance`,spec:e.spec,branch:e.branch,iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,activeConcerns:n.map(i=>i.id),resumeHint:r}},q=e=>{if(e.lastCalledAt===null)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE",how:`Run \`${t("next")}\` for instructions. Submit results with \`${t('next --answer="..."')}\`. Never make architectural decisions without asking.`,currentPhase:e.phase};let n=new Date(e.lastCalledAt).getTime();if(Date.now()-n>B)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE",how:`Run \`${t("next")}\` for instructions. Submit results with \`${t('next --answer="..."')}\`. Never make architectural decisions without asking.`,currentPhase:e.phase}},J=(e,n,r,i,l,s)=>{A=i??null;let d=F(e,n),a=i?.maxIterationsBeforeRestart??15,o=i?.allowGit??!1,m=N(e,a,o,l),b=q(e),u;switch(e.phase){case"IDLE":u=I(n,w);break;case"DISCOVERY":u=_(e,n,r);break;case"SPEC_DRAFT":u=U(e);break;case"SPEC_APPROVED":u=V(e);break;case"EXECUTING":u=Y(e,n,r,a,l,s);break;case"BLOCKED":u=M(e);break;case"DONE":u=W(e);break;default:u=I(n,w)}let h={...u,meta:d,behavioral:m};b!==void 0&&(h={...h,protocolGuide:b}),e.pendingClear&&(h={...h,clearContext:{action:"clear_context",reason:`Task complete. Run \`/clear\` now. After clearing, read \`CLAUDE.md\` and run \`${t("next")}\` to continue.`},instruction:`Task accepted. Run \`/clear\` immediately to start fresh for the next task. After clearing, run \`${t("next")}\`.`});let y=L(e,n);return y.length>0&&(h={...h,interactiveOptions:y}),h},L=(e,n)=>{switch(e.phase){case"IDLE":return n.length===0?[{label:"Add project concerns",command:t("concern add <id>")},{label:"Start a new feature spec",command:t('spec new "description"')},{label:"Add a coding convention",command:t('rule add "rule"')},{label:"Check project status",command:t("status")}]:[{label:"Start a new feature spec",command:t('spec new "description"')},{label:"Add more concerns",command:t("concern add <id>")},{label:"Add a coding convention",command:t('rule add "rule"')},{label:"Check project status",command:t("status")}];case"SPEC_DRAFT":return[{label:"Review and approve spec",command:t("approve")},{label:"Reset and start over",command:t("reset")}];case"SPEC_APPROVED":return[{label:"Start execution",command:t('next --answer="start"')},{label:"Reset",command:t("reset")}];case"EXECUTING":return[];case"BLOCKED":return[{label:"Resolve the block",command:t('next --answer="resolution"')},{label:"Reset spec",command:t("reset")}];case"DONE":return[{label:"Start a new spec",command:t('spec new "description"')},{label:"Check project status",command:t("status")}];default:return[]}},I=(e,n)=>({phase:"IDLE",instruction:"Present the interactive options to the user using your interactive question tool. Do NOT list them as a text table.",availableConcerns:n.map(r=>({id:r.id,description:r.description})),activeConcerns:e.map(r=>r.id),hint:e.length===0?"No concerns active. Consider adding concerns first \u2014 they shape discovery questions and specs.":void 0}),_=(e,n,r)=>{let i=O(n),l=e.discovery.answers.length;if(P(e.discovery.answers))return{phase:"DISCOVERY",instruction:`All discovery questions answered. Run: \`${t("approve")}\``,questions:[],answeredCount:l,context:{rules:r,concernReminders:[]},transition:{onComplete:t("approve")}};let d=new Set(e.discovery.answers.map(o=>o.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(o=>!d.has(o.id)).map(o=>({id:o.id,text:o.text,concerns:[...o.concerns],extras:o.extras.map(m=>m.text)})),answeredCount:l,context:{rules:r,concernReminders:D(n)},transition:{onComplete:`${t(`next --answer='{"status_quo":"...","ambition":"...",...}'`)}`}}},U=e=>e.classification===null?{phase:"SPEC_DRAFT",instruction:"Before generating the spec, classify what this spec involves. Ask the user to select all that apply.",specPath:e.specState.path??"",transition:{onApprove:`${t(`next --answer='{"involvesUI":false,"involvesPublicAPI":false,"involvesMigration":false,"involvesDataHandling":false}'`)}`},classificationRequired:!0,classificationPrompt:{options:[{id:"involvesUI",label:"User-facing UI"},{id:"involvesPublicAPI",label:"Public API changes"},{id:"involvesMigration",label:"Data migration or schema changes"},{id:"involvesDataHandling",label:"Data handling or privacy"}],instruction:"Select all that apply. Submit as JSON: `"+t(`next --answer='{"involvesUI":true,"involvesPublicAPI":false,...}'`)+"`"}}:{phase:"SPEC_DRAFT",instruction:"Spec draft is ready for review. Ask the user to review and approve.",specPath:e.specState.path??"",transition:{onApprove:t("approve")}},V=e=>({phase:"SPEC_APPROVED",instruction:"Spec is approved and ready. When the user is ready to start, begin execution.",specPath:e.specState.path??"",transition:{onStart:`${t('next --answer="start"')}`}}),G=(e,n)=>{if(n===null)return!1;switch(e){case"beautiful-product":return n.involvesUI;case"open-source":return n.involvesPublicAPI;case"long-lived":return n.involvesMigration;case"compliance":return n.involvesDataHandling;default:return!0}},j=(e,n,r,i,l,s,d)=>{let a=[];if(i!==null)for(let o of i.items)a.push(`[DEBT from iteration ${i.fromIteration}] ${o}`);if(n&&a.push(`[FAILED] Tests \u2014 fix this first: ${r.slice(0,200)}`),s!=null)for(let o of s.verification)a.push(o);for(let o of e)if(G(o.id,l)&&o.acceptanceCriteria!==void 0&&o.acceptanceCriteria.length>0)for(let m of o.acceptanceCriteria)a.push(`(${o.id}) ${m}`);if(d!==void 0)for(let o of d)a.push(`(folder: ${o.folder}) ${o.rule}`);return a},Y=(e,n,r,i,l,s)=>{let d=S(n),a=e.execution.iteration>=i,o=e.execution.lastVerification?.passed===!1,m=e.execution.lastVerification?.output??"",b=l?.tasks??[],u=e.execution.completedTasks??[],h=new Set(u),y=b.find(p=>!h.has(p.id))??null,g=y!==null?{id:y.id,title:y.title,totalTasks:b.length,completedTasks:u.length}:void 0;if(e.execution.awaitingStatusReport){let p=j(n,o,m,e.execution.debt,e.classification,l,s),x={phase:"EXECUTING",instruction:"Before this task is accepted, report your completion status against these acceptance criteria.",context:{rules:r,concernReminders:D(n)},transition:{onComplete:`${t(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`)}`,onBlocked:`${t('block "reason"')}`,iteration:e.execution.iteration},statusReportRequired:!0,statusReport:{criteria:p,reportFormat:{completed:"list items you finished with evidence (file exists, test passes)",remaining:"list items not yet done",blocked:"list items that need a decision from the user"}}};return o&&(x={...x,verificationFailed:!0,verificationOutput:m.slice(0,2e3)}),x}let E=(e.execution.lastProgress??"").includes("Task not accepted"),v=e.execution.debt?.items??[],C=e.execution.debt?.unaddressedIterations??0,T=g!==void 0?`Execute task ${g.id}: ${g.title} (${g.completedTasks}/${g.totalTasks} completed)`:"All tasks completed. Run `"+t("done")+"` to finish.",k;if(o)k="Verification FAILED. Fix the failing tests before continuing.";else if(E&&v.length>0){let p=C>=3?` These items have been outstanding for ${C} iterations.`:"";k=`Task not accepted \u2014 ${v.length} remaining item(s) must be addressed before this task can be completed.${p} Address them, then submit a new status report.`}else k=T;let c={phase:"EXECUTING",instruction:k,task:g,context:{rules:r,concernReminders:D(n)},transition:{onComplete:`${t('next --answer="..."')}`,onBlocked:`${t('block "reason"')}`,iteration:e.execution.iteration}};if(E&&v.length>0&&(c={...c,taskRejected:!0,rejectionReason:`${v.length} remaining item(s) must be addressed.`,rejectionRemaining:v}),e.execution.debt!==null&&e.execution.debt.items.length>0){let p=e.execution.debt.unaddressedIterations??0,x=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:x}}}if(o){let p=m.slice(0,2e3);c={...c,verificationFailed:!0,verificationOutput:p}}d.length>0&&(c={...c,concernTensions:d}),a&&(c={...c,restartRecommended:!0,restartInstruction:`Context may be getting large after ${e.execution.iteration} iterations. Consider starting a new conversation and running \`${t("next")}\` to resume - your progress is saved.`});let f=[...e.decisions].reverse().find(p=>!p.promoted);return f!==void 0&&e.execution.lastProgress?.startsWith("Resolved:")&&(c={...c,promotePrompt:{decisionId:f.id,question:f.question,choice:f.choice,prompt:`You just resolved a decision: "${f.choice}". Ask the user: "Should this be a permanent rule for future specs too?" If yes, run: \`${t(`rule add "${f.choice}"`)}\``}}),c},M=e=>({phase:"BLOCKED",instruction:"A decision is needed. Ask the user.",reason:e.execution.lastProgress??"Unknown",transition:{onResolved:`${t('next --answer="..."')}`}}),W=e=>({phase:"DONE",summary:{spec:e.spec,iterations:e.execution.iteration,decisionsCount:e.decisions.length}});export{J as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as M,b as H}from"./chunk-2N4GTHXQ.js";import{
|
|
1
|
+
import{a as M,b as H}from"./chunk-2N4GTHXQ.js";import{b as B}from"./chunk-UA3VIHYO.js";var de=/^(?:-(?:(?<doubleDash>-)(?<negated>no-)?)?)(?<key>.+?)(?:=(?<value>.*))?$/s,ce=/[A-Za-z]/,fe=/-?\d+(\.\d*)?(e-?\d+)?$/,ue=/^(-|--)[^-]/,ge=/=(?<value>.+)/,me=/^--[^=]+$/,pe=/\W/,he=/\S/;function T(n){return he.test(n)&&Number.isFinite(Number(n))}function V(n,e){return e==="constructor"&&typeof n[e]=="function"||e==="__proto__"}function k(n,e,t,o=!1){e=[...e];let s=e.pop();for(let r of e){if(V(n,r))return;n=n[r]??={}}if(!V(n,s)){if(o){let r=n[s];if(Array.isArray(r)){r.push(t);return}t=r?[r,t]:[t]}n[s]=t}}function N(n,e){for(let t of e){let o=n[t];if(!Object.hasOwn(n,t))return!1;n=o}return!0}function X(n,e,t){let o=n.get(t);if(o===void 0)return!1;for(let s of o)if(e.has(s))return!0;return!1}function v(n){return n==="true"||n==="false"}function j(n){return n!=="false"}function L(n,e){let{"--":t=!1,alias:o={},boolean:s=!1,default:r={},stopEarly:i=!1,string:d=[],collect:m=[],negatable:p=[],unknown:S=l=>l}=e??{},h=new Map,$=new Set,C=new Set,x=new Set,b=new Set,g=!1;if(o)for(let[l,a]of Object.entries(o)){if(a===void 0)throw new TypeError("Alias value must be defined");let c=Array.isArray(a)?a:[a];h.set(l,new Set(c)),c.forEach(O=>h.set(O,new Set([l,...c.filter(E=>E!==O)])))}if(s)if(typeof s=="boolean")g=s;else{let l=Array.isArray(s)?s:[s];for(let a of l.filter(Boolean))$.add(a),h.get(a)?.forEach(c=>{$.add(c)})}if(d){let l=Array.isArray(d)?d:[d];for(let a of l.filter(Boolean))C.add(a),h.get(a)?.forEach(c=>C.add(c))}if(m){let l=Array.isArray(m)?m:[m];for(let a of l.filter(Boolean))x.add(a),h.get(a)?.forEach(c=>x.add(c))}if(p){let l=Array.isArray(p)?p:[p];for(let a of l.filter(Boolean))b.add(a),h.get(a)?.forEach(c=>b.add(c))}let u={_:[]};function y(l,a,c,O){if(!$.has(l)&&!C.has(l)&&!h.has(l)&&!x.has(l)&&!(g&&me.test(c))&&S?.(c,l,a)===!1)return;typeof a=="string"&&!C.has(l)&&(a=T(a)?Number(a):a);let E=O&&x.has(l);k(u,l.split("."),a,E),h.get(l)?.forEach(f=>{k(u,f.split("."),a,E)})}let R=[],D=n.indexOf("--");D!==-1&&(R=n.slice(D+1),n=n.slice(0,D));e:for(let l=0;l<n.length;l++){let a=n[l],c=a.match(de)?.groups;if(c){let{doubleDash:O,negated:E}=c,f=c.key,F=c.value;if(O){if(F!=null){$.has(f)&&(F=j(F)),y(f,F,a,!0);continue}if(E){if(b.has(f)){y(f,!1,a,!1);continue}f=`no-${f}`}let _=n[l+1];if(_){if(!$.has(f)&&!g&&!_.startsWith("-")&&(!h.has(f)||!X(h,$,f))){F=_,l++,y(f,F,a,!0);continue}if(v(_)){F=j(_),l++,y(f,F,a,!0);continue}}F=C.has(f)?"":!0,y(f,F,a,!0);continue}let z=a.slice(1,-1).split("");for(let[_,A]of z.entries()){let w=a.slice(_+2);if(w==="-"){y(A,w,a,!0);continue}if(w==="="){y(A,"",a,!0);continue e}if(ce.test(A)){let W=ge.exec(w)?.groups;if(W){y(A,W.value,a,!0);continue e}if(fe.test(w)){y(A,w,a,!0);continue e}}if(z[_+1]?.match(pe)){y(A,a.slice(_+2),a,!0);continue e}y(A,C.has(A)?"":!0,a,!0)}if(f=a.slice(-1),f==="-")continue;let P=n[l+1];if(P){if(!ue.test(P)&&!$.has(f)&&(!h.has(f)||!X(h,$,f))){y(f,P,a,!0),l++;continue}if(v(P)){let _=j(P);y(f,_,a,!0),l++;continue}}y(f,C.has(f)?"":!0,a,!0);continue}if(S?.(a)!==!1&&u._.push(C.has("_")||!T(a)?a:Number(a)),i){u._.push(...n.slice(l+1));break}}for(let[l,a]of Object.entries(r)){let c=l.split(".");N(u,c)||(k(u,c,a),h.get(l)?.forEach(O=>k(u,O.split("."),a)))}for(let l of $.keys()){let a=l.split(".");if(!N(u,a)){let c=x.has(l)?[]:!1;k(u,a,c)}}for(let l of C.keys()){let a=l.split(".");!N(u,a)&&x.has(l)&&k(u,a,[])}return t?u["--"]=R:u._.push(...R),u}var I=n=>{let e=[],t=[],o={},s={};for(let r of n)r.type==="boolean"?e.push(r.name):t.push(r.name),r.short!==void 0&&(o[r.short]=r.name),r.default!==void 0&&(s[r.name]=r.default);return{boolean:e,string:t,alias:o,default:s}},ye=n=>n!=null&&n.constructor===String,$e={boolean:n=>!!n,number:n=>ye(n)?Number(n):n,string:n=>String(n),"string[]":n=>Array.isArray(n)?n.map(String):[String(n)]},Ce=(n,e)=>{if(n!==void 0)return $e[e]?.(n)??n},q=(n,e)=>{let t={};for(let o of e){let s=n[o.name];t[o.name]=Ce(s,o.type)}return t};var Y=(n,e)=>{let t=[];for(let o of e)if(o.required===!0){let s=n[o.name];(s===void 0||s===""||s===!1)&&t.push(`Required flag --${o.name} is missing`)}return t};var Z=(n,e)=>n+" ".repeat(Math.max(0,e-n.length)),be=n=>{let e=n.short!==void 0?`-${n.short}, `:"",t=n.type!=="boolean"?` <${n.type}>`:"";return`${e}--${n.name}${t}`},_e=(n,e)=>[n.description!==void 0?`${e} - ${n.description}`:e,""],Fe=(n,e)=>{if(n.usage!==void 0)return["Usage:",` ${n.usage}`,""];let t=n.children.length>0?" <command>":"",o=n.flags.length>0?" [options]":"";return["Usage:",` ${e}${t}${o}`,""]},xe=n=>{if(n.length===0)return[];let e=s=>s.aliases!==void 0&&s.aliases.length>0?`${s.name}, ${s.aliases.join(", ")}`:s.name,t=Math.max(...n.map(s=>e(s).length));return["Commands:",...n.map(s=>` ${Z(e(s),t+2)}${s.description??""}`),""]},Oe=n=>{if(n.length===0)return[];let e=n.map(s=>({flag:be(s),desc:s.description})),t=Math.max(...e.map(s=>s.flag.length));return["Options:",...e.map(({flag:s,desc:r})=>` ${Z(s,t+2)}${r}`),""]},Ae=n=>n?.length?["Examples:",...n.map(e=>` ${e}`),""]:[],J=(n,e)=>{let t=e.join(" "),o=[..._e(n,t),...Fe(n,t),...xe(n.children),...Oe(n.flags),...Ae(n.examples)];return n.children.length>0&&o.push(`Run '${t} <command> --help' for more information on a command.`),o.join(`
|
|
2
2
|
`)};var K=n=>{let e=[];for(let t of n)e.push(`--${t.name}`),t.short!==void 0&&e.push(`-${t.short}`);return e.join(" ")},Q=(n,e)=>{if(n.children===void 0||n.children.length===0)return"";let t=n.children.map(i=>i.name).join(" "),o=n.flags!==void 0?K(n.flags):"",s=[t,o].filter(i=>i.length>0).join(" "),r=` ${e})
|
|
3
3
|
`;r+=` COMPREPLY=( $(compgen -W "${s}" -- "\${cur}") )
|
|
4
4
|
`,r+=` return 0
|
|
@@ -76,7 +76,7 @@ complete -F _${n}_completions ${n}
|
|
|
76
76
|
`;return t+=`# ${n} zsh completion
|
|
77
77
|
`,t+=`# Generated by @eser/shell/completions
|
|
78
78
|
|
|
79
|
-
`,t+=te(n,e,[]),t};var oe=n=>n.replace(
|
|
79
|
+
`,t+=te(n,e,[]),t};var oe=n=>n.replace(/[\\'\$`()]/g,"\\$&"),ke=(n,e,t)=>{let o="";for(let s of e){let r=oe(s.description??`${s.name} flag`),i=`complete -c ${n} ${t}`;i+=` -l ${s.name}`,s.short!==void 0&&(i+=` -s ${s.short}`),s.takesValue===!0&&(i+=" -r"),i+=` -d '${r}'`,o+=i+`
|
|
80
80
|
`}return o},re=(n,e,t)=>{let o="",s;if(t.length===0?s="-n __fish_use_subcommand":s=`-n "${t.map(i=>`__fish_seen_subcommand_from ${i}`).join("; and ")}"`,e.children!==void 0&&e.children.length>0){for(let r of e.children){let i=oe(r.description??r.name);if(t.length===0)o+=`complete -c ${n} -f ${s} `,o+=`-a "${r.name}" -d '${i}'
|
|
81
81
|
`;else{let d=`-n "__fish_seen_subcommand_from ${t[t.length-1]}"`;o+=`complete -c ${n} -f ${d} `,o+=`-a "${r.name}" -d '${i}'
|
|
82
82
|
`}}for(let r of e.children)o+=re(n,r,[...t,r.name])}return e.flags!==void 0&&e.flags.length>0&&(o+=ke(n,e.flags,s)),o},ie=(n,e)=>{let t=`# ${n} fish completion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as r}from"./chunk-
|
|
1
|
+
import{d as r}from"./chunk-3AZBET4N.js";import{b as i}from"./chunk-UA3VIHYO.js";var t=async e=>{try{return await r`which ${e}`.noThrow().code()===0}catch{return!1}},s=async()=>{try{return(await fetch("http://localhost:11434/api/version",{signal:AbortSignal.timeout(1e3)})).ok}catch{return!1}},a=e=>i.env.has(e),d=async()=>{let[e,o,l,n]=await Promise.all([t("claude"),s(),t("opencode"),t("kiro")]);return[{name:"claude-code",alias:"cc",type:"CLI",available:e,detail:e?"claude binary found":"claude not on PATH"},{name:"ollama",alias:"ol",type:"HTTP",available:o,detail:o?"localhost:11434 reachable":"localhost:11434 not reachable"},{name:"opencode",alias:"oc",type:"CLI",available:l,detail:l?"opencode binary found":"opencode not on PATH"},{name:"kiro",alias:"kr",type:"CLI",available:n,detail:n?"kiro binary found":"kiro not on PATH"},{name:"anthropic",alias:"ant",type:"API",available:a("ANTHROPIC_API_KEY"),detail:a("ANTHROPIC_API_KEY")?"ANTHROPIC_API_KEY set":"ANTHROPIC_API_KEY not set"},{name:"openai",alias:"oai",type:"API",available:a("OPENAI_API_KEY"),detail:a("OPENAI_API_KEY")?"OPENAI_API_KEY set":"OPENAI_API_KEY not set"},{name:"gemini",alias:"gem",type:"API",available:a("GEMINI_API_KEY")||a("GOOGLE_API_KEY"),detail:a("GEMINI_API_KEY")||a("GOOGLE_API_KEY")?"API key set":"GEMINI_API_KEY not set"},{name:"vertexai",alias:"vtx",type:"API",available:a("GOOGLE_CLOUD_PROJECT"),detail:a("GOOGLE_CLOUD_PROJECT")?"GOOGLE_CLOUD_PROJECT set":"GOOGLE_CLOUD_PROJECT not set"}]};export{d as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as c}from"./chunk-UA3VIHYO.js";var f=async(n,r)=>{let e=`${n}/.eser/specs/${r}/spec.md`,t;try{t=await c.fs.readTextFile(e)}catch{return null}return d(r,t)},d=(n,r)=>{let e=[],t=[],o=[],i="";for(let l of r.split(`
|
|
2
2
|
`)){let s=l.trim();if(s.startsWith("## ")){i=s.slice(3).trim().toLowerCase();continue}if(i.startsWith("tasks")){let a=s.match(/^-\s*\[[ x]\]\s*(task-\d+):\s*(.+)$/i);a!==null&&e.push({id:a[1],title:a[2].trim()})}i.startsWith("out of scope")&&s.startsWith("- ")&&t.push(s.slice(2).trim()),i.startsWith("verification")&&s.startsWith("- ")&&o.push(s.slice(2).trim())}return{name:n,tasks:e,outOfScope:t,verification:o}},u=(n,r)=>{let e=new Set(r);for(let t of n)if(!e.has(t.id))return t;return null};export{f as a,d as b,u as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a,c as W,d as l,e as M,f as w,g as c,h as x,i as X,k as T,l as $,n as D,o as j,q as K,r as F}from"./chunk-
|
|
1
|
+
import{b as a,c as W,d as l,e as M,f as w,g as c,h as x,i as X,k as T,l as $,n as D,o as j,q as K,r as F}from"./chunk-EZH232V7.js";import{b as A}from"./chunk-UA3VIHYO.js";var f=Symbol("tui.cancel"),ae=e=>e===f,ie=()=>{try{return A.process.stdin}catch{return new ReadableStream}},oe=e=>{let t=e?.interaction??(e?.target==="non-interactive"?"non-interactive":"interactive"),n=e?.audience??"human",s=t==="non-interactive"?"non-interactive":"interactive",r=t==="interactive";return{output:e?.output??j({renderer:r?F.ansi():F.plain(),sink:r?K.stdout():K.stderr()}),input:e?.input??ie(),target:s,interaction:t,audience:n,stderr:e?.stderr??j({renderer:F.plain(),sink:K.stderr()})}};var g="\u2502",G="\u250C",h="\u2514";var H="\u25CF",q="\u25CB",z="\u25FC",J="\u25FB",P="\u25C6",C="\u25C7",b="\u25A0",Q="\u25CF";var N="\u25B2";var Z="\u25C7";var v=async e=>{let t=!1;if(A.capabilities.stdin&&A.process.isTerminal("stdin"))try{A.process.setStdinRaw(!0),t=!0}catch{}try{return await e()}finally{if(t)try{A.process.setStdinRaw(!1)}catch{}}},R=e=>{e.write(a("\x1B[?25l"))},E=e=>{e.write(a("\x1B[?25h"))},m=(e,t)=>{t>0&&e.write(a(`\x1B[${t}A\x1B[J`))};var le=e=>{if(e.length===1&&e[0]===3)return{name:"c",ctrl:!0,meta:!1,shift:!1};if(e.length===1&&e[0]===27)return{name:"escape",ctrl:!1,meta:!1,shift:!1};if(e.length===1&&(e[0]===13||e[0]===10))return{name:"return",ctrl:!1,meta:!1,shift:!1};if(e.length===1&&e[0]===9)return{name:"tab",ctrl:!1,meta:!1,shift:!1};if(e.length===1&&e[0]===127)return{name:"backspace",ctrl:!1,meta:!1,shift:!1};if(e.length>=3&&e[0]===27&&e[1]===91)switch(e[2]){case 65:return{name:"up",ctrl:!1,meta:!1,shift:!1};case 66:return{name:"down",ctrl:!1,meta:!1,shift:!1};case 67:return{name:"right",ctrl:!1,meta:!1,shift:!1};case 68:return{name:"left",ctrl:!1,meta:!1,shift:!1};case 72:return{name:"home",ctrl:!1,meta:!1,shift:!1};case 70:return{name:"end",ctrl:!1,meta:!1,shift:!1}}if(e.length===1&&e[0]>=1&&e[0]<=26)return{name:String.fromCharCode(e[0]+96),ctrl:!0,meta:!1,shift:!1};if(e.length===1&&e[0]===32)return{name:"space",char:" ",ctrl:!1,meta:!1,shift:!1};if(e.length===1&&e[0]>=33&&e[0]<=126){let t=String.fromCharCode(e[0]);return{name:t,char:t,ctrl:!1,meta:!1,shift:!1}}if(e.length>0&&e[0]>=192){let t=new TextDecoder().decode(e);return{name:t,char:t,ctrl:!1,meta:!1,shift:!1}}return{name:"unknown",ctrl:!1,meta:!1,shift:!1}};async function*k(e,t){let n=e.getReader();try{for(;!t?.aborted;){let{done:s,value:r}=await n.read();if(s||r===void 0)break;yield le(r)}}finally{n.releaseLock()}}var U=(e,t,n,s)=>{if(s==="done"){let o=n?"Yes":"No";return e.output.writeln(c(C),a(` ${t}`),l(` \xB7 ${o}`)),1}if(s==="cancel")return e.output.writeln(w(b),a(` ${t}`)),1;let r=n?M(c(H),a(" Yes")):M(l(q),l(" Yes")),i=n?M(l(q),l(" No")):M(c(H),a(" No"));return e.output.writeln(T(P),a(` ${t}`)),e.output.writeln(l(g),a(" "),r,l(" / "),i),e.output.writeln(l(h)),3},pe=async(e,t)=>{let n=t.initialValue??!0,s=0;R(e.output);try{return await v(async()=>{s=U(e,t.message,n,"active"),await e.output.flush();for await(let r of k(e.input)){if(r.name==="c"&&r.ctrl)return m(e.output,s),U(e,t.message,n,"cancel"),await e.output.flush(),f;if(r.name==="escape")return m(e.output,s),U(e,t.message,n,"cancel"),await e.output.flush(),f;if(r.name==="return")return m(e.output,s),U(e,t.message,n,"done"),await e.output.flush(),n;let i=!1;(r.name==="left"||r.name==="right")&&(n=!n,i=!0),(r.name==="y"||r.name==="Y")&&(n=!0,i=!0),(r.name==="n"||r.name==="N")&&(n=!1,i=!0),i&&(m(e.output,s),s=U(e,t.message,n,"active"),await e.output.flush())}return f})}finally{E(e.output),await e.output.flush()}};var _=(e,t,n,s,r,i)=>{if(i==="done")return e.output.writeln(c(C),a(` ${t}`),l(` \xB7 ${n}`)),1;if(i==="cancel")return e.output.writeln(w(b),a(` ${t}`)),1;let o=n.length>0?a(n):s!==void 0?l(s):a(""),d=r!==void 0?x(N):T(P);e.output.writeln(d,a(` ${t}`)),e.output.writeln(l(g),a(" "),o);let y=2;return r!==void 0?(e.output.writeln(l(h),a(" "),x(r)),y=3):(e.output.writeln(l(h)),y=3),y},ue=async(e,t)=>{let n=t.initialValue??"",s=n.length,r,i=0;R(e.output);try{return await v(async()=>{i=_(e,t.message,n,t.placeholder,r,"active"),await e.output.flush();for await(let o of k(e.input)){if(o.name==="c"&&o.ctrl)return m(e.output,i),_(e,t.message,n,t.placeholder,void 0,"cancel"),await e.output.flush(),f;if(o.name==="escape")return m(e.output,i),_(e,t.message,n,t.placeholder,void 0,"cancel"),await e.output.flush(),f;if(o.name==="return"){if(t.validate!==void 0){let d=t.validate(n);if(d!==void 0){r=d,m(e.output,i),i=_(e,t.message,n,t.placeholder,r,"active"),await e.output.flush();continue}}return m(e.output,i),_(e,t.message,n,t.placeholder,void 0,"done"),await e.output.flush(),n}if(r=void 0,o.name==="backspace")s>0&&(n=n.slice(0,s-1)+n.slice(s),s--);else if(o.name==="left")s>0&&s--;else if(o.name==="right")s<n.length&&s++;else if(o.name==="home")s=0;else if(o.name==="end")s=n.length;else if(o.char!==void 0)n=n.slice(0,s)+o.char+n.slice(s),s++;else continue;m(e.output,i),i=_(e,t.message,n,t.placeholder,r,"active"),await e.output.flush()}return f})}finally{E(e.output),await e.output.flush()}};var L=(e,t,n,s,r,i,o)=>{if(o==="done"){let u=[...r].sort((p,I)=>p-I).map(p=>n[p]?.label??"").join(", ");return e.output.writeln(c(C),a(` ${t}`),l(` \xB7 ${u}`)),1}if(o==="cancel")return e.output.writeln(w(b),a(` ${t}`)),1;let d=i!==void 0?x(N):T(P);e.output.writeln(d,a(` ${t}`));for(let u=0;u<n.length;u++){let p=n[u],I=u===s,ee=r.has(u),te=p.disabled===!0,ne=ee?c(z):l(J),se=te?l(` ${p.label}`):I?a(` ${p.label}`):l(` ${p.label}`),re=p.hint!==void 0?l(` (${p.hint})`):a("");e.output.writeln(l(g),a(" "),ne,se,re)}let y=n.length+2;return i!==void 0?e.output.writeln(l(h),a(" "),x(i)):e.output.writeln(l(h)),y},Y=(e,t,n)=>{let s=e.length,r=t;for(let i=0;i<s;i++)if(r=(r+n+s)%s,e[r]?.disabled!==!0)return r;return t},de=async(e,t)=>{let n=0,s=new Set;if(t.initialValues!==void 0)for(let o of t.initialValues){let d=t.options.findIndex(y=>y.value===o);d>=0&&s.add(d)}t.options[n]?.disabled===!0&&(n=Y(t.options,n,1));let r=0,i;R(e.output);try{return await v(async()=>{r=L(e,t.message,t.options,n,s,i,"active"),await e.output.flush();for await(let o of k(e.input)){if(o.name==="c"&&o.ctrl)return m(e.output,r),L(e,t.message,t.options,n,s,void 0,"cancel"),await e.output.flush(),f;if(o.name==="escape")return m(e.output,r),L(e,t.message,t.options,n,s,void 0,"cancel"),await e.output.flush(),f;if(o.name==="return"){if(t.required!==!1&&s.size===0){i="Please select at least one option.",m(e.output,r),r=L(e,t.message,t.options,n,s,i,"active"),await e.output.flush();continue}return m(e.output,r),L(e,t.message,t.options,n,s,void 0,"done"),await e.output.flush(),[...s].sort((y,u)=>y-u).map(y=>t.options[y].value)}i=void 0;let d=!1;if((o.name==="up"||o.name==="k")&&(n=Y(t.options,n,-1),d=!0),(o.name==="down"||o.name==="j")&&(n=Y(t.options,n,1),d=!0),o.name==="space"&&t.options[n]?.disabled!==!0&&(s.has(n)?s.delete(n):s.add(n),d=!0),o.name==="a"){let y=t.options.every((u,p)=>u.disabled===!0||s.has(p));for(let u=0;u<t.options.length;u++)t.options[u]?.disabled!==!0&&(y?s.delete(u):s.add(u));d=!0}d&&(m(e.output,r),r=L(e,t.message,t.options,n,s,i,"active"),await e.output.flush())}return f})}finally{E(e.output),await e.output.flush()}};var me=(e,t)=>{e.output.writeln($(G),a(" "),W(t)),e.output.writeln($(g))},fe=(e,t)=>{e.output.writeln($(g)),e.output.writeln($(h),a(" "),a(t))},ye={info:(e,t)=>{e.output.writeln(D("info",t))},success:(e,t)=>{e.output.writeln(D("success",t))},warn:(e,t)=>{e.output.writeln(D("warning",t))},error:(e,t)=>{e.output.writeln(D("error",t))},step:(e,t)=>{e.output.writeln(l(Z),a(" "),l(t))},message:(e,t,n)=>{e.output.writeln(l(n??g),a(" "),a(t))}};var ce=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],ge=80,he=(e,t,n)=>{let s=n?.frames??ce,r=n?.interval??ge,i=t,o=0,d,y=()=>{e.output.write(a(`\r${" ".repeat(i.length+4)}\r`))},u=()=>{d!==void 0&&(clearInterval(d),d=void 0,y())};return{start:p=>{p!==void 0&&(i=p),d=setInterval(()=>{let I=s[o%s.length];e.output.write(a("\r"),T(I??""),a(` ${i}`)),o++},r)},stop:p=>{u(),p!==void 0&&(i=p)},update:p=>{i=p},succeed:p=>{u(),e.output.writeln(c(C),a(` ${p??i}`))},fail:p=>{u(),e.output.writeln(w(b),a(` ${p??i}`))},warn:p=>{u(),e.output.writeln(x(N),a(` ${p??i}`))},info:p=>{u(),e.output.writeln(X(Q),a(` ${p??i}`))}}};export{ae as a,oe as b,pe as c,ue as d,de as e,me as f,fe as g,ye as h,he as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{c as o}from"./chunk-2WH262CW.js";var n=[{id:"status_quo",text:"What does the user do today without this feature?",concerns:["product:status_quo","eng:replace_scope","qa:regression_risk"]},{id:"ambition",text:"Describe the 1-star and 10-star versions.",concerns:["product:scope_direction","eng:complexity_tier","qa:test_depth"]},{id:"reversibility",text:"Does this change involve an irreversible decision?",concerns:["product:one_way_door","eng:migration_strategy","qa:verification_stringency"]},{id:"user_impact",text:"Does this change affect existing users' behavior?",concerns:["product:breaking_change","eng:backward_compat","qa:regression_tests"]},{id:"verification",text:"How do you verify this works correctly?",concerns:["product:success_metric","eng:test_strategy","qa:acceptance_criteria"]},{id:"scope_boundary",text:"What should this feature NOT do?",concerns:["product:focus","eng:out_of_scope","qa:negative_tests"]}],a=t=>n.map(e=>({...e,extras:o(t,e.id)})),c=(t,e)=>{let r=new Set(e.map(s=>s.questionId));for(let s of t)if(!r.has(s.id))return s;return null},d=t=>{let e=new Set(t.map(r=>r.questionId));return n.every(r=>e.has(r.id))};export{n as a,a as b,c,d};
|