noskills 4.1.36 → 4.1.39
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 +208 -50
- package/chunks/{anthropic-GKH6HH6J.js → anthropic-UTLWCK66.js} +1 -1
- package/chunks/approve-GSSSUQWC.js +1 -0
- package/chunks/ask-F4XM2EEC.js +2 -0
- package/chunks/block-LVQNJU4P.js +1 -0
- package/chunks/browser-AXSE2CPY.js +1 -0
- package/chunks/bun-LARHC47N.js +1 -0
- package/chunks/chunk-4BH6CF3J.js +1 -0
- package/chunks/chunk-4XOSXARZ.js +9 -0
- package/chunks/chunk-73EEM3FY.js +1 -0
- package/chunks/{chunk-24SANXOZ.js → chunk-7QFOEK3I.js} +1 -1
- package/chunks/chunk-AGWPQX43.js +31 -0
- package/chunks/{chunk-GSYCN7EG.js → chunk-ALZM4JXG.js} +1 -1
- package/chunks/{chunk-3AZBET4N.js → chunk-BBKSV2RO.js} +1 -1
- package/chunks/chunk-DHMCIRLT.js +1 -0
- package/chunks/{chunk-WUVVLUU5.js → chunk-EMHZF6ZY.js} +59 -59
- package/chunks/{chunk-IR75X4G7.js → chunk-ERX4HONR.js} +1 -1
- package/chunks/chunk-G5OCHQQ2.js +1 -0
- package/chunks/chunk-IAR3DEWR.js +1 -0
- package/chunks/{chunk-XCVAHUBM.js → chunk-KJH7Q57A.js} +1 -1
- package/chunks/chunk-MNEZ5QGX.js +1 -0
- package/chunks/chunk-OTRBRRIO.js +1 -0
- package/chunks/chunk-RYQPPQNO.js +3 -0
- package/chunks/{chunk-42EQ3GZJ.js → chunk-TJZAIUKM.js} +1 -1
- package/chunks/{chunk-O5KQZHIN.js → chunk-VK7L5SMS.js} +1 -1
- package/chunks/{chunk-IVSTITPL.js → chunk-VPXOI7CR.js} +1 -1
- package/chunks/chunk-XADY6SXR.js +67 -0
- package/chunks/{chunk-EZH232V7.js → chunk-Y6AFIAJP.js} +1 -1
- package/chunks/chunk-YK6UG66R.js +1 -0
- package/chunks/claude-code-K3SX5D5F.js +1 -0
- package/chunks/cmd-RST2ZPA6.js +1 -0
- package/chunks/concern-FGNG32KU.js +1 -0
- package/chunks/deno-WQJZSBAW.js +1 -0
- package/chunks/dist-UI3SRKS3.js +12 -0
- package/chunks/done-5IX2F6V7.js +1 -0
- package/chunks/{gemini-Z57NY6WY.js → gemini-YR5KT32S.js} +1 -1
- package/chunks/init-M7SJOVPZ.js +1 -0
- package/chunks/invoke-hook-VXIVDDQG.js +10 -0
- package/chunks/{kiro-MHP573OZ.js → kiro-T5X4D4SC.js} +1 -1
- package/chunks/list-3RK7TPGG.js +1 -0
- package/chunks/mod-KTV64DHD.js +1 -0
- package/chunks/multipart-parser-UVM6CEKF.js +2 -0
- package/chunks/next-GGVR6JM2.js +8 -0
- package/chunks/node-3FTYLC7H.js +67 -0
- package/chunks/node-JJN2TSIE.js +1 -0
- package/chunks/ollama-CNKKUTPX.js +3 -0
- package/chunks/{openai-ZNKOR4CD.js → openai-QGEN33SU.js} +2 -2
- package/chunks/openai-Y74OQTVB.js +23 -0
- package/chunks/opencode-MJO3K6T4.js +1 -0
- package/chunks/purge-6DEK2ZSI.js +4 -0
- package/chunks/reset-JEIUVTWV.js +1 -0
- package/chunks/rule-OVSBPSYO.js +2 -0
- package/chunks/run-7MZATQML.js +3 -0
- package/chunks/sdk-LHBUQS75.js +40 -0
- package/chunks/spec-J7KC4VFM.js +1 -0
- package/chunks/src-GLQPTDNR.js +3 -0
- package/chunks/status-BISV6DFB.js +1 -0
- package/chunks/sync-MWQWXN2C.js +1 -0
- package/chunks/{unstable_chmod-WRDBWEC2.js → unstable_chmod-RZ5DE3XZ.js} +1 -1
- package/chunks/{vertexai-WVENJL2F.js → vertexai-RUXZ24C2.js} +1 -1
- package/chunks/watch-AP5GGXG6.js +8 -0
- package/chunks/workerd-VA2BYLUO.js +1 -0
- package/noskills.js +1 -1
- package/package.json +1 -1
- package/chunks/approve-YXRIBZVV.js +0 -1
- package/chunks/ask-4XOYE32R.js +0 -2
- package/chunks/block-D67USBJS.js +0 -1
- package/chunks/browser-JYFQKVFU.js +0 -1
- package/chunks/bun-KVGAHBUF.js +0 -1
- package/chunks/chunk-3HRRWTVF.js +0 -3
- package/chunks/chunk-4ODVKO5Y.js +0 -1
- package/chunks/chunk-ACQUINWH.js +0 -1
- package/chunks/chunk-AK3OJD4W.js +0 -1
- package/chunks/chunk-DXB73IDG.js +0 -1
- package/chunks/chunk-FDZP7B5Y.js +0 -1
- package/chunks/chunk-FKF2SWQM.js +0 -18
- package/chunks/chunk-GOOD5WBA.js +0 -1
- package/chunks/chunk-IA7GIU76.js +0 -14
- package/chunks/chunk-LG5R766Y.js +0 -1
- package/chunks/chunk-NTKVTLTO.js +0 -1
- package/chunks/chunk-T7K64JD5.js +0 -1
- package/chunks/chunk-UA3VIHYO.js +0 -1
- package/chunks/chunk-UXRWSNVZ.js +0 -1
- package/chunks/chunk-WV3HK5WR.js +0 -1
- package/chunks/chunk-ZQ77HAFD.js +0 -12
- package/chunks/claude-code-6AAAJZKK.js +0 -1
- package/chunks/concern-4GBYLKWP.js +0 -1
- package/chunks/deno-5VR3ZY4Z.js +0 -1
- package/chunks/done-PTJRZ26W.js +0 -1
- package/chunks/fileFromPath-4UEDFJ4U.js +0 -6
- package/chunks/init-PVRN54IZ.js +0 -1
- package/chunks/invoke-hook-5VXI4CPD.js +0 -9
- package/chunks/list-GRXQ2DIM.js +0 -1
- package/chunks/mod-V2Z6HGL6.js +0 -1
- package/chunks/next-BZS3EN33.js +0 -3
- package/chunks/node-MZTU6BAB.js +0 -1
- package/chunks/node-RWYXITVV.js +0 -59
- package/chunks/ollama-24ACY3UB.js +0 -3
- package/chunks/openai-EKIA3VP3.js +0 -19
- package/chunks/opencode-LFWHRZPL.js +0 -1
- package/chunks/purge-JSAHNTXI.js +0 -4
- package/chunks/reset-CWI7K6GC.js +0 -1
- package/chunks/rule-GP665FCC.js +0 -2
- package/chunks/run-WLG5XKTM.js +0 -3
- package/chunks/sdk-5JGXLIO5.js +0 -18
- package/chunks/spec-JET4WJSV.js +0 -1
- package/chunks/status-EOXWE5UM.js +0 -1
- package/chunks/sync-RWNLL4VW.js +0 -1
- package/chunks/watch-5OC7T473.js +0 -8
- package/chunks/workerd-QUMEG65S.js +0 -1
package/README.md
CHANGED
|
@@ -5,6 +5,20 @@ context and hoping the agent picks the right one, noskills pushes exactly the
|
|
|
5
5
|
right instruction at the right time — the agent never decides what to do next,
|
|
6
6
|
the state machine does.
|
|
7
7
|
|
|
8
|
+
## Status: Beta
|
|
9
|
+
|
|
10
|
+
noskills is in active beta. We've battle-tested it with Claude Code — the
|
|
11
|
+
discovery flow, sub-agent orchestration, verification backpressure, and the full
|
|
12
|
+
spec lifecycle are working in production use. Other platforms (Cursor, Kiro,
|
|
13
|
+
Copilot, Windsurf) have sync support but haven't been tested end-to-end yet.
|
|
14
|
+
|
|
15
|
+
If you want to test noskills with a platform other than Claude Code, reach out —
|
|
16
|
+
we'd love early feedback. Find me at [github.com/eser](https://github.com/eser)
|
|
17
|
+
or [@eaborai](https://x.com/eaborai).
|
|
18
|
+
|
|
19
|
+
**Coming next:** deeper rule management, concern customization, and platform
|
|
20
|
+
integrations beyond Claude Code. Star the repo and watch for updates.
|
|
21
|
+
|
|
8
22
|
## Why
|
|
9
23
|
|
|
10
24
|
AI coding agents have a context rot problem. The more skills, rules, and
|
|
@@ -25,6 +39,91 @@ The agent calls `noskills next`, gets exactly what it needs for the current
|
|
|
25
39
|
phase, acts on it, and calls `noskills next` again. No skill selection, no
|
|
26
40
|
context pollution, no forgetting.
|
|
27
41
|
|
|
42
|
+
## Before & After
|
|
43
|
+
|
|
44
|
+
**Without noskills:**
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
You: "Add photo upload with validation"
|
|
48
|
+
Agent: *reads 17 skill files into context*
|
|
49
|
+
Agent: *picks wrong skill, starts building auth instead*
|
|
50
|
+
Agent: "I've implemented a comprehensive authentication system..."
|
|
51
|
+
You: "No, photo UPLOAD"
|
|
52
|
+
Agent: *context is now 60% full with auth code it wrote*
|
|
53
|
+
Agent: *starts photo upload but forgets validation requirement*
|
|
54
|
+
Agent: "Done! Photo upload is working."
|
|
55
|
+
You: *tests* "There's no validation. And you deleted my error handler."
|
|
56
|
+
Agent: "I apologize, let me fix that..."
|
|
57
|
+
Agent: *context window full, compaction happens*
|
|
58
|
+
Agent: *forgets everything, starts from scratch*
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**With noskills:**
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
You: "Add photo upload with validation"
|
|
65
|
+
noskills: Discovery Q1/6: "What do users do today without this?"
|
|
66
|
+
You: "They fill forms manually, it's slow"
|
|
67
|
+
noskills: Q2/6: "1-star and 10-star versions?"
|
|
68
|
+
You: "1-star: basic upload. 10-star: auto-detect from photo"
|
|
69
|
+
... 4 more questions ...
|
|
70
|
+
noskills: "Here's your spec. 5 tasks. Approve?"
|
|
71
|
+
You: "Approved"
|
|
72
|
+
noskills -> Agent: "Task 1: Create upload endpoint. Acceptance: returns 200 for JPEG/PNG/WebP, 400 for invalid."
|
|
73
|
+
Agent: *implements task 1 in fresh context*
|
|
74
|
+
noskills: "Tests pass. Status report: what's done?"
|
|
75
|
+
Agent: "Endpoint works. Error handling done. Docs not yet."
|
|
76
|
+
noskills: "Docs carried as debt. Task 2: Add validation..."
|
|
77
|
+
*Each task: fresh context, clear scope, verified before advancing*
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## What You Get
|
|
81
|
+
|
|
82
|
+
**Discovery that actually discovers.** Not "Got it, I'll start coding." noskills
|
|
83
|
+
asks 6 questions that probe product, engineering, and QA simultaneously — with
|
|
84
|
+
sub-questions injected by your active concerns. The agent scans your codebase
|
|
85
|
+
first, challenges your assumptions, then asks. You get a spec that reflects what
|
|
86
|
+
you actually need, not what the agent guessed.
|
|
87
|
+
|
|
88
|
+
**Specs that track themselves.** Every spec has a status (draft -> approved ->
|
|
89
|
+
executing -> done), tasks with checkboxes, and acceptance criteria from both the
|
|
90
|
+
spec AND your active concerns. You don't track progress — noskills tracks it.
|
|
91
|
+
The agent reports against specific criteria, not vibes.
|
|
92
|
+
|
|
93
|
+
**Agents that can't lie about being done.** When the agent says "task done,"
|
|
94
|
+
noskills runs your test suite first. If tests fail, the task stays incomplete —
|
|
95
|
+
no exceptions. Then it asks for a status report against each acceptance
|
|
96
|
+
criterion. Items the agent didn't finish carry forward as debt with increasing
|
|
97
|
+
urgency. The agent can't declare victory and move on.
|
|
98
|
+
|
|
99
|
+
**Context that never rots.** Each task runs in a sub-agent with fresh context.
|
|
100
|
+
The main agent orchestrates, sub-agents execute. No `/clear` gymnastics, no "the
|
|
101
|
+
agent forgot my requirements." State lives in files, not in the agent's memory.
|
|
102
|
+
|
|
103
|
+
**Concerns that shape everything.** "We're open-source" isn't a wish — it's a
|
|
104
|
+
lens that injects documentation requirements into every spec,
|
|
105
|
+
contributor-friendliness checks into every review, and permissive-default
|
|
106
|
+
reminders into every task. Stack concerns to define your project's character.
|
|
107
|
+
|
|
108
|
+
**One source of truth for every tool.** Write rules once in `.eser/rules/`.
|
|
109
|
+
noskills generates CLAUDE.md, .cursorrules, Kiro steering files, Copilot
|
|
110
|
+
instructions, and Windsurf rules. Your teammate on Cursor and your teammate on
|
|
111
|
+
Claude Code both get the same conventions, automatically.
|
|
112
|
+
|
|
113
|
+
**A human who's always in charge.** noskills never makes decisions silently.
|
|
114
|
+
Discovery questions -> you answer. Spec approval -> you decide. Architectural
|
|
115
|
+
choices -> you pick. Concern tensions -> you resolve. The agent executes, you
|
|
116
|
+
decide. Explicit > Clever.
|
|
117
|
+
|
|
118
|
+
## Who Is This For
|
|
119
|
+
|
|
120
|
+
noskills is for builders who use AI coding agents daily and are tired of
|
|
121
|
+
babysitting them — repeating the same corrections, watching the agent forget
|
|
122
|
+
requirements mid-session, and manually tracking what's done and what isn't. Solo
|
|
123
|
+
builders get a structured workflow that keeps the agent focused. Teams get a
|
|
124
|
+
shared source of truth that every tool and every teammate inherits
|
|
125
|
+
automatically.
|
|
126
|
+
|
|
28
127
|
## The Mental Model
|
|
29
128
|
|
|
30
129
|
```
|
|
@@ -107,6 +206,8 @@ That's why I stopped using skills and built a scrum master instead:
|
|
|
107
206
|
decision, just like team values shape how a team works.
|
|
108
207
|
- **Phase transitions are Jidoka stops** — the machine pauses, the human
|
|
109
208
|
decides, then the machine continues.
|
|
209
|
+
- **Explicit over clever** — noskills never makes decisions silently. It always
|
|
210
|
+
asks.
|
|
110
211
|
|
|
111
212
|
The insight isn't technical. It's that the practices we spent decades developing
|
|
112
213
|
for human teams apply directly to AI agents — because the underlying problem is
|
|
@@ -117,20 +218,23 @@ work on track.
|
|
|
117
218
|
|
|
118
219
|
Open Claude Code and paste:
|
|
119
220
|
|
|
120
|
-
Run `eser noskills init`
|
|
221
|
+
Run `eser noskills init` — it will scaffold your project and guide you through setup.
|
|
121
222
|
|
|
122
223
|
If `eser` CLI is not installed:
|
|
123
224
|
|
|
124
|
-
Run `npx eser@latest noskills init`
|
|
225
|
+
Run `npx eser@latest noskills init` — it will scaffold your project and guide you through setup.
|
|
125
226
|
|
|
126
|
-
That's it.
|
|
127
|
-
and
|
|
227
|
+
That's it. The init command detects Claude Code, sets up hooks, generates
|
|
228
|
+
`CLAUDE.md`, and presents your next options automatically.
|
|
128
229
|
|
|
129
230
|
If you want to add this to an existing project where teammates also use
|
|
130
231
|
noskills, the init scaffolds `.eser/` which should be committed to your repo.
|
|
131
232
|
|
|
132
233
|
## Quick Start
|
|
133
234
|
|
|
235
|
+
noskills works with any AI coding agent. Here's how to get started in a few
|
|
236
|
+
minutes.
|
|
237
|
+
|
|
134
238
|
### With an agent (Claude Code, Cursor, etc.)
|
|
135
239
|
|
|
136
240
|
```bash
|
|
@@ -154,7 +258,7 @@ eser noskills spec new "photo upload"
|
|
|
154
258
|
eser noskills next -o text # Shows all 6 questions at once
|
|
155
259
|
eser noskills next --answer='{"status_quo":"...","ambition":"...","reversibility":"...","user_impact":"...","verification":"...","scope_boundary":"..."}' -o text
|
|
156
260
|
# Classification: what does this spec involve?
|
|
157
|
-
eser noskills next --answer='{"
|
|
261
|
+
eser noskills next --answer='{"involvesWebUI":true,"involvesCLI":false,"involvesPublicAPI":false,"involvesMigration":false,"involvesDataHandling":false}' -o text
|
|
158
262
|
eser noskills approve
|
|
159
263
|
eser noskills next --answer="start" -o text # Begin execution
|
|
160
264
|
eser noskills next --answer="task-1 done" -o text
|
|
@@ -216,25 +320,31 @@ for changes. Zero LLM tokens. Exits automatically when phase reaches DONE.
|
|
|
216
320
|
|
|
217
321
|
## How It Works
|
|
218
322
|
|
|
323
|
+
noskills is a state machine. Your spec moves through phases — each phase has
|
|
324
|
+
different rules, different questions, and different behavioral constraints for
|
|
325
|
+
the agent. You don't need to understand the internals to use noskills, but
|
|
326
|
+
here's how it works under the hood.
|
|
327
|
+
|
|
219
328
|
### The State Machine
|
|
220
329
|
|
|
221
330
|
Every spec follows a deterministic phase flow:
|
|
222
331
|
|
|
223
332
|
```
|
|
224
|
-
IDLE -> DISCOVERY -> SPEC_DRAFT -> SPEC_APPROVED -> EXECUTING <-> BLOCKED
|
|
225
|
-
^
|
|
226
|
-
|
|
333
|
+
IDLE -> DISCOVERY -> DISCOVERY_REVIEW -> SPEC_DRAFT -> SPEC_APPROVED -> EXECUTING <-> BLOCKED
|
|
334
|
+
^ |
|
|
335
|
+
+--------------------------------- DONE <---------------------------------+
|
|
227
336
|
```
|
|
228
337
|
|
|
229
|
-
| Phase
|
|
230
|
-
|
|
|
231
|
-
| **IDLE**
|
|
232
|
-
| **DISCOVERY**
|
|
233
|
-
| **
|
|
234
|
-
| **
|
|
235
|
-
| **
|
|
236
|
-
| **
|
|
237
|
-
| **
|
|
338
|
+
| Phase | What happens |
|
|
339
|
+
| -------------------- | ---------------------------------------------------------------------- |
|
|
340
|
+
| **IDLE** | No active spec. Start one with `noskills spec new "..."` |
|
|
341
|
+
| **DISCOVERY** | 6 blended questions probe product, engineering, and QA simultaneously |
|
|
342
|
+
| **DISCOVERY_REVIEW** | User reviews and confirms all discovery answers before spec generation |
|
|
343
|
+
| **SPEC_DRAFT** | Spec generated from discovery answers. Human reviews |
|
|
344
|
+
| **SPEC_APPROVED** | Spec approved, waiting to start. A deliberate "ready but not yet" gate |
|
|
345
|
+
| **EXECUTING** | Agent works through the spec. Reports progress each iteration |
|
|
346
|
+
| **BLOCKED** | Agent hit a decision it can't make alone. Human resolves |
|
|
347
|
+
| **DONE** | Spec complete. Summary with iteration count and decisions |
|
|
238
348
|
|
|
239
349
|
### Phase Transition Protocol
|
|
240
350
|
|
|
@@ -334,13 +444,13 @@ noskills status -o json # Structured status for scripts
|
|
|
334
444
|
Every `noskills next` output includes a `behavioral` block with phase-specific
|
|
335
445
|
rules. These tell the agent HOW to behave, not just WHAT to do:
|
|
336
446
|
|
|
337
|
-
| Phase | Behavioral tone | Key rules
|
|
338
|
-
| ---------- | ------------------------------ |
|
|
339
|
-
| DISCOVERY | "
|
|
340
|
-
| SPEC_DRAFT | "The user is reviewing" | Don't modify the spec, don't start coding
|
|
341
|
-
| EXECUTING | "Start coding immediately" | Don't explore beyond scope, don't refactor, timebox reading
|
|
342
|
-
| BLOCKED | "Brief. Decision time." | Present decision as-is, don't suggest preferences
|
|
343
|
-
| DONE | "Celebrate briefly, then stop" | Don't start new work
|
|
447
|
+
| Phase | Behavioral tone | Key rules |
|
|
448
|
+
| ---------- | ------------------------------ | ------------------------------------------------------------- |
|
|
449
|
+
| DISCOVERY | "Curious, has a stake" | Push back on shallow answers, probe for specifics, don't code |
|
|
450
|
+
| SPEC_DRAFT | "The user is reviewing" | Don't modify the spec, don't start coding |
|
|
451
|
+
| EXECUTING | "Start coding immediately" | Don't explore beyond scope, don't refactor, timebox reading |
|
|
452
|
+
| BLOCKED | "Brief. Decision time." | Present decision as-is, don't suggest preferences |
|
|
453
|
+
| DONE | "Celebrate briefly, then stop" | Don't start new work |
|
|
344
454
|
|
|
345
455
|
**Git is read-only** for agents (configurable via `allowGit: true` in manifest).
|
|
346
456
|
Agents may read (`git log`, `git diff`, `git status`) but never write
|
|
@@ -436,9 +546,8 @@ When the agent reports a task complete, noskills doesn't take its word for it.
|
|
|
436
546
|
and must be addressed before any new work.
|
|
437
547
|
|
|
438
548
|
4. **Context clearing** — when debt is zero and verification passes, noskills
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
complies.
|
|
549
|
+
recommends a `/clear` for fresh context on the next task. The sub-agent
|
|
550
|
+
pattern handles context isolation naturally, so this is advisory only.
|
|
442
551
|
|
|
443
552
|
### Scoped Folder Rules
|
|
444
553
|
|
|
@@ -484,11 +593,12 @@ question 1 also asks: _"Is this workaround common in the community?"_
|
|
|
484
593
|
### Spec Classification
|
|
485
594
|
|
|
486
595
|
After discovery answers are submitted, noskills asks the user to classify the
|
|
487
|
-
spec along
|
|
596
|
+
spec along five boolean axes:
|
|
488
597
|
|
|
489
598
|
| Flag | What it controls |
|
|
490
599
|
| ---------------------- | ------------------------------------------------------- |
|
|
491
|
-
| `
|
|
600
|
+
| `involvesWebUI` | Web/Mobile UI sections from beautiful-product concern |
|
|
601
|
+
| `involvesCLI` | CLI/Terminal UI loading states |
|
|
492
602
|
| `involvesPublicAPI` | API documentation sections from open-source concern |
|
|
493
603
|
| `involvesMigration` | Migration checklist sections from compliance/long-lived |
|
|
494
604
|
| `involvesDataHandling` | Data safety sections from compliance concern |
|
|
@@ -501,7 +611,7 @@ keyword-based guessing with explicit user input.
|
|
|
501
611
|
The classification is submitted as JSON via `noskills next`:
|
|
502
612
|
|
|
503
613
|
```bash
|
|
504
|
-
noskills next --answer='{"
|
|
614
|
+
noskills next --answer='{"involvesWebUI":true,"involvesCLI":false,"involvesPublicAPI":false,"involvesMigration":false,"involvesDataHandling":false}'
|
|
505
615
|
```
|
|
506
616
|
|
|
507
617
|
### Hooks — Zero-Token Bookkeeping
|
|
@@ -511,7 +621,7 @@ spending LLM tokens:
|
|
|
511
621
|
|
|
512
622
|
| Hook | Event | What it does |
|
|
513
623
|
| ------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
514
|
-
| **pre-tool-use** | PreToolUse | Blocks file edits outside EXECUTING phase. Blocks git write commands.
|
|
624
|
+
| **pre-tool-use** | PreToolUse | Blocks file edits outside EXECUTING phase. Blocks git write commands. |
|
|
515
625
|
| **stop** | Stop | Increments iteration counter, snapshots `git diff` into state, checks restart threshold. The Ralph loop's heartbeat. |
|
|
516
626
|
| **post-file-write** | PostToolUse | Logs modified file paths to `.eser/.state/files-changed.jsonl` |
|
|
517
627
|
| **post-bash** | PostToolUse | Logs noskills CLI invocations for observability |
|
|
@@ -578,6 +688,51 @@ Multiple specs can exist at different stages. Switching away from an EXECUTING
|
|
|
578
688
|
spec preserves everything — iteration, debt, verification result, progress.
|
|
579
689
|
Switching back resumes exactly where it left off.
|
|
580
690
|
|
|
691
|
+
> **Future:** `spec new --from-plan <file>` — import an existing plan document
|
|
692
|
+
> (e.g., from Claude Code's plan mode) as the basis for discovery, pre-filling
|
|
693
|
+
> some answers. Not yet implemented.
|
|
694
|
+
|
|
695
|
+
## Common Workflows
|
|
696
|
+
|
|
697
|
+
**"I have a bug report from a customer"**
|
|
698
|
+
|
|
699
|
+
```bash
|
|
700
|
+
eser noskills spec new "Fix: users can't upload files over 10MB"
|
|
701
|
+
# Discovery mode: Ship fast (skip expansions, minimal questions)
|
|
702
|
+
# 3 tasks generated: reproduce, fix, test
|
|
703
|
+
# Agent implements in ~8 minutes with verification
|
|
704
|
+
```
|
|
705
|
+
|
|
706
|
+
**"I need to add a major feature"**
|
|
707
|
+
|
|
708
|
+
```bash
|
|
709
|
+
eser noskills spec new "Add real-time collaboration to the editor"
|
|
710
|
+
# Discovery mode: Explore scope (expansion proposals, dream state table)
|
|
711
|
+
# 12 tasks generated with architectural decisions
|
|
712
|
+
# Agent works through tasks over multiple sessions
|
|
713
|
+
# Debt tracking ensures nothing is forgotten between sessions
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
**"I have meeting notes and need to turn them into work"**
|
|
717
|
+
|
|
718
|
+
```bash
|
|
719
|
+
eser noskills spec new "From product meeting: need analytics dashboard,
|
|
720
|
+
CEO wants daily active users, retention curves, revenue per cohort.
|
|
721
|
+
Mobile must work. Launch by end of Q2."
|
|
722
|
+
# noskills accepts any input format — meeting notes, kanban cards, emails
|
|
723
|
+
# Discovery challenges assumptions: "Is mobile-first or desktop-first?"
|
|
724
|
+
# Spec generated with proper tasks, not meeting note fragments
|
|
725
|
+
```
|
|
726
|
+
|
|
727
|
+
**"I want the agent to work autonomously while I sleep"**
|
|
728
|
+
|
|
729
|
+
```bash
|
|
730
|
+
eser noskills run --unattended --max-iterations=50
|
|
731
|
+
# Fresh agent per iteration, zero context rot
|
|
732
|
+
# Blocks logged to file — resolve in the morning
|
|
733
|
+
# Git commits handled by CLI, not the agent
|
|
734
|
+
```
|
|
735
|
+
|
|
581
736
|
## CLI Reference
|
|
582
737
|
|
|
583
738
|
```bash
|
|
@@ -593,25 +748,28 @@ eser nos <command>
|
|
|
593
748
|
|
|
594
749
|
### Commands
|
|
595
750
|
|
|
596
|
-
| Command
|
|
597
|
-
|
|
|
598
|
-
| `init`
|
|
599
|
-
| `status [-o format]`
|
|
600
|
-
| `spec new "..." [--name=N]`
|
|
601
|
-
| `spec list [-o format]`
|
|
602
|
-
| `spec switch <name>`
|
|
603
|
-
| `next [-o format]`
|
|
604
|
-
| `next --answer="..."
|
|
605
|
-
| `approve`
|
|
606
|
-
| `done`
|
|
607
|
-
| `block "reason"`
|
|
608
|
-
| `reset`
|
|
609
|
-
| `run [--unattended]`
|
|
610
|
-
| `watch [-o format]`
|
|
611
|
-
| `concern add/remove/list`
|
|
612
|
-
| `rule add/list/promote`
|
|
613
|
-
| `sync`
|
|
614
|
-
| `purge [--force]`
|
|
751
|
+
| Command | Description |
|
|
752
|
+
| ------------------------------------------ | ------------------------------------------------------------------ |
|
|
753
|
+
| `init` | Scaffold `.eser/`, detect project traits, install hooks |
|
|
754
|
+
| `status [-o format]` | Show current phase, spec name, progress, debt |
|
|
755
|
+
| `spec new "..." [--name=N]` | Start a new spec, enter DISCOVERY |
|
|
756
|
+
| `spec list [-o format]` | List all specs with phase info |
|
|
757
|
+
| `spec switch <name>` | Switch active spec (preserves state) |
|
|
758
|
+
| `next [--spec=name] [-o format]` | Get instruction for current phase |
|
|
759
|
+
| `next --answer="..." [--spec=name] [-o f]` | Submit answer and advance state |
|
|
760
|
+
| `approve [--spec=name]` | Approve spec draft -> SPEC_APPROVED |
|
|
761
|
+
| `done [--spec=name]` | Complete execution -> DONE |
|
|
762
|
+
| `block [--spec=name] "reason"` | Mark execution as blocked |
|
|
763
|
+
| `reset [--spec=name]` | Reset current spec to IDLE |
|
|
764
|
+
| `run [--spec=name] [--unattended]` | Autonomous execution loop (Ralph loop) |
|
|
765
|
+
| `watch [-o format]` | Live dashboard monitoring agent progress |
|
|
766
|
+
| `concern add/remove/list` | Manage active concerns |
|
|
767
|
+
| `rule add/list/promote` | Manage permanent rules |
|
|
768
|
+
| `sync` | Regenerate tool-specific instruction files + hooks |
|
|
769
|
+
| `purge [--force]` | Remove all noskills content (specs, rules, concerns, hooks, state) |
|
|
770
|
+
|
|
771
|
+
The `--spec` flag targets a specific spec by name, enabling parallel work across
|
|
772
|
+
multiple terminal sessions. When omitted, commands operate on the active spec.
|
|
615
773
|
|
|
616
774
|
### Output Formats
|
|
617
775
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as y,c as f}from"./chunk-5MN3MWQN.js";import{a as _,e as b}from"./chunk-OLM5RTFK.js";import"./chunk-
|
|
1
|
+
import{b as y,c as f}from"./chunk-5MN3MWQN.js";import{a as _,e as b}from"./chunk-OLM5RTFK.js";import"./chunk-OTRBRRIO.js";var h=class{capabilities=["text_generation","streaming","tool_calling","vision","batch_processing"];provider="anthropic";modelId;client;config;constructor(t,n){this.client=t,this.config=n,this.modelId=n.model}async generateText(t,n){let o=p(this.config,t);try{let a=await this.client.messages.create(o,{signal:n,timeout:this.config.requestTimeoutMs});return k(a,this.modelId)}catch(a){throw i(a)}}async*streamText(t,n){let o=p(this.config,t);try{let a=await this.client.messages.create({...o,stream:!0},{signal:n,timeout:this.config.requestTimeoutMs}),r=null,l=null,c="",d=0,u=0;for await(let s of a)if(s.type==="message_start")d=s.message?.usage?.input_tokens??0;else if(s.type==="content_block_start")s.content_block?.type==="tool_use"&&(r=s.content_block.id??null,l=s.content_block.name??null,c="");else if(s.type==="content_block_delta")s.delta?.type==="text_delta"?yield{kind:"content_delta",textDelta:s.delta.text}:s.delta?.type==="input_json_delta"&&(c+=s.delta.partial_json??"",yield{kind:"tool_call_delta",textDelta:s.delta.partial_json});else if(s.type==="content_block_stop"){if(r!==null&&l!==null){let m={};try{m=JSON.parse(c||"{}")}catch{}yield{kind:"tool_call_delta",toolCall:{id:r,name:l,arguments:m}},r=null,l=null,c=""}}else s.type==="message_delta"&&(u=s.usage?.output_tokens??u,yield{kind:"message_done",stopReason:x(s.delta?.stop_reason),usage:{inputTokens:d,outputTokens:u,totalTokens:d+u}})}catch(a){yield{kind:"error",error:i(a)}}}async submitBatch(t,n){let o=t.items.map(a=>({custom_id:a.customId,params:p(this.config,a.options)}));try{let a=await this.client.beta.messages.batches.create({requests:o},{signal:n});return g(a)}catch(a){throw i(a)}}async getBatchJob(t,n){try{let o=await this.client.beta.messages.batches.retrieve(t,{signal:n});return g(o)}catch(o){throw i(o)}}async listBatchJobs(t,n){try{let o=await this.client.beta.messages.batches.list({limit:t?.limit,after_id:t?.after},{signal:n}),a=[];for(let r of o.data??[])a.push(g(r));return a}catch(o){throw i(o)}}async downloadBatchResults(t,n){try{let o=await this.client.beta.messages.batches.results(t.id,{signal:n}),a=[];for await(let r of o)r.result?.type==="succeeded"?a.push({customId:r.custom_id,result:k(r.result.message,this.modelId)}):a.push({customId:r.custom_id,error:r.result?.error?.message??"Unknown error"});return a}catch(o){throw i(o)}}async cancelBatchJob(t,n){try{await this.client.beta.messages.batches.cancel(t,{signal:n})}catch(o){throw i(o)}}async close(){}getRawClient(){return this.client}},A={provider:"anthropic",async createModel(e){let{default:t}=await import("./sdk-LHBUQS75.js"),n={};e.apiKey!==void 0&&(n.apiKey=e.apiKey),e.baseUrl!==void 0&&(n.baseURL=e.baseUrl);let o=new t(n);return new h(o,e)}},p=(e,t)=>{let n={model:e.model,max_tokens:t.maxTokens??e.maxTokens,messages:R(t.messages)};return t.system!==void 0&&(n.system=t.system),t.temperature!==void 0&&(n.temperature=t.temperature),t.topP!==void 0&&(n.top_p=t.topP),t.stopWords!==void 0&&(n.stop_sequences=t.stopWords),t.tools!==void 0&&(n.tools=t.tools.map(o=>({name:o.name,description:o.description,input_schema:o.parameters??{type:"object",properties:{}}}))),t.toolChoice!==void 0&&(n.tool_choice={type:t.toolChoice}),t.thinkingBudget!==void 0&&(n.thinking={type:"enabled",budget_tokens:t.thinkingBudget}),n},R=e=>{let t=[];for(let n of e){if(n.role==="system")continue;let o=n.content.map(C);t.push({role:n.role==="tool"?"user":n.role,content:o})}return t},C=e=>{switch(e.kind){case"text":return{type:"text",text:e.text};case"image":{if(e.image.data!==void 0)return{type:"image",source:{type:"base64",media_type:e.image.mimeType??"image/png",data:w(e.image.data)}};if(e.image.url!==void 0){if(y(e.image.url)){let t=f(e.image.url);if(t!==null)return{type:"image",source:{type:"base64",media_type:t.mimeType,data:w(t.data)}}}return{type:"image",source:{type:"url",url:e.image.url}}}return{type:"text",text:"[unsupported image]"}}case"tool_call":return{type:"tool_use",id:e.toolCall.id,name:e.toolCall.name,input:e.toolCall.arguments};case"tool_result":return{type:"tool_result",tool_use_id:e.toolResult.toolCallId,content:e.toolResult.content,is_error:e.toolResult.isError};default:return{type:"text",text:`[unsupported content: ${e.kind}]`}}},k=(e,t)=>{let n=[];for(let o of e.content??[])o.type==="text"?n.push({kind:"text",text:o.text}):o.type==="thinking"?n.push({kind:"text",text:`[thinking] ${o.thinking}`}):o.type==="tool_use"&&n.push({kind:"tool_call",toolCall:{id:o.id,name:o.name,arguments:o.input??{}}});return{content:n,stopReason:x(e.stop_reason),usage:{inputTokens:e.usage?.input_tokens??0,outputTokens:e.usage?.output_tokens??0,totalTokens:(e.usage?.input_tokens??0)+(e.usage?.output_tokens??0)},modelId:t,rawResponse:e}},x=e=>e==="end_turn"?"end_turn":e==="max_tokens"?"max_tokens":e==="tool_use"?"tool_use":e==="stop_sequence"?"stop":"end_turn",g=e=>({id:e.id,status:B(e.processing_status),createdAt:new Date(e.created_at),completedAt:e.ended_at!==void 0?new Date(e.ended_at):void 0,totalCount:e.request_counts?.total??0,doneCount:e.request_counts?.succeeded??0,failedCount:e.request_counts?.errored??0}),B=e=>e==="in_progress"?"processing":e==="ended"?"completed":e==="canceling"||e==="canceled"?"cancelled":"pending",i=e=>{if(e instanceof _)return e;let t=e instanceof Error?e:new Error(String(e)),n=e?.status??e?.statusCode??500;return b("anthropic",n,t)},w=e=>{let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)};export{h as AnthropicModel,A as anthropicFactory};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as R}from"./chunk-RYQPPQNO.js";import{a as P,d as D}from"./chunk-KJH7Q57A.js";import"./chunk-VPXOI7CR.js";import{c as n}from"./chunk-YK6UG66R.js";import{e as y,g as C}from"./chunk-IAR3DEWR.js";import{f as v,g as h,h as o,m as S,q as g}from"./chunk-EMHZF6ZY.js";import{c as t,d,f as m,g as p,k as i,o as w,q as f,r as u}from"./chunk-Y6AFIAJP.js";import{a as c}from"./chunk-2N4GTHXQ.js";import{b as l}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var $=async E=>{let s=w({renderer:u.ansi(),sink:f.stdout()}),a=l.process.cwd(),A=h(E),e=await v(a,A),F=await S(a);if(e.phase==="SPEC_DRAFT"){if(e.classification===null&&e.spec!==null){let _=(await g(a)).filter(b=>F?.concerns.includes(b.id)??!1);try{await R(a,e,_)}catch{}}let r=C(e);await o(a,r),r.spec!==null&&(await P(a,r.spec,"approved"),await D(a,r.spec,"approved")),s.writeln(p("\u2714")," Spec approved. Phase: ",i("SPEC_APPROVED")),s.writeln("When ready, run ",t(`${n('next --answer="start"')}`)," to begin execution.")}else if(e.phase==="DISCOVERY_REVIEW"){let r=y(e);await o(a,r),s.writeln(p("\u2714")," Discovery answers approved. Phase: ",i("SPEC_DRAFT")),s.writeln("Review the spec and run ",t(n("approve"))," again to approve.")}else e.phase==="DISCOVERY"&&e.discovery.completed?(s.writeln(d("Discovery complete. Spec draft already generated.")),s.writeln("Review the spec and run ",t(n("approve"))," again when in SPEC_DRAFT phase.")):s.writeln(m(`Cannot approve in phase: ${e.phase}`));return await s.close(),c(void 0)};export{$ as main};
|
|
@@ -0,0 +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-Y6AFIAJP.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-BBKSV2RO.js";import{b as T}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import{d as ee}from"./chunk-OTRBRRIO.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-K3SX5D5F.js")).claudeCodeFactory;case"ollama":return(await import("./ollama-CNKKUTPX.js")).ollamaFactory;case"opencode":return(await import("./opencode-MJO3K6T4.js")).openCodeFactory;case"kiro":return(await import("./kiro-T5X4D4SC.js")).kiroFactory;case"anthropic":return(await import("./anthropic-UTLWCK66.js")).anthropicFactory;case"openai":return(await import("./openai-QGEN33SU.js")).openaiFactory;case"gemini":return(await import("./gemini-YR5KT32S.js")).geminiFactory;case"vertexai":return(await import("./vertexai-RUXZ24C2.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
|
+
`)),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{c as k}from"./chunk-YK6UG66R.js";import{i as S}from"./chunk-IAR3DEWR.js";import{f as w,g as h,h as g}from"./chunk-EMHZF6ZY.js";import{c as l,d as p,f as c,h as m,o as d,q as f,r as u}from"./chunk-Y6AFIAJP.js";import{a as n,b as i}from"./chunk-2N4GTHXQ.js";import{b as a}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var j=async t=>{let e=d({renderer:u.ansi(),sink:f.stdout()}),r=a.process.cwd(),b=h(t),o=(t??[]).filter(x=>!x.startsWith("--spec=")).join(" ")||"No reason given",s=await w(r,b);if(s.phase!=="EXECUTING")return e.writeln(c(`Cannot block in phase: ${s.phase}`)),await e.close(),i({exitCode:1});let v=S(s,o);return await g(r,v),e.writeln(m("\u26A0")," Spec blocked: ",p(o)),e.writeln("Resolve with: ",l(`${k('next --answer="resolution"')}`)),await e.close(),n(void 0)};export{j as main};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e,u as s,v as t,w as r,x as a}from"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var o={fs:!1,fsSync:!1,exec:!1,process:!1,env:!1,stdin:!1,stdout:!1,kv:!1},c=()=>({name:"browser",version:globalThis.navigator?.userAgent??"unknown",capabilities:o,fs:s("browser"),path:e,exec:t("browser"),env:a(),process:r("browser")});export{o as BROWSER_CAPABILITIES,c as createBrowserRuntime};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as m,b as h,c as g,d as S}from"./chunk-G5OCHQQ2.js";import{s as l,t as p}from"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var y={fs:!0,fsSync:!0,exec:!0,process:!0,env:!0,stdin:!0,stdout:!0,kv:!1},u=async i=>{if(!i)return new Uint8Array(0);let n=[],t=i.getReader();try{for(;;){let{done:e,value:s}=await t.read();if(e)break;n.push(s)}}finally{t.releaseLock()}let a=n.reduce((e,s)=>e+s.length,0),o=new Uint8Array(a),d=0;for(let e of n)o.set(e,d),d+=e.length;return o},P=async(i,n=[],t)=>{let[a,o,d]=l(t),e=Bun.spawn([i,...n],{cwd:t?.cwd,env:t?.env,stdin:a,stdout:o,stderr:d}),[s,r,c]=await Promise.all([e.exited,u(e.stdout),u(e.stderr)]);return{success:s===0,code:s,stdout:r,stderr:c}},b=(i,n=[],t)=>{let[a,o,d]=l(t),e=Bun.spawn([i,...n],{cwd:t?.cwd,env:t?.env,stdin:a,stdout:o,stderr:d}),s=e.exited.then(r=>({success:r===0,code:r,signal:void 0}));return{pid:e.pid,stdin:e.stdin,stdout:e.stdout,stderr:e.stderr,status:s,output:async()=>{let[r,c,w]=await Promise.all([s,u(e.stdout),u(e.stderr)]);return{success:r.success,code:r.code,stdout:c,stderr:w}},kill:r=>{e.kill(r)}}},A=()=>({name:"bun",version:Bun.version,capabilities:y,fs:m(),path:h(),exec:p(P,b),env:g(),process:S()});export{y as BUN_CAPABILITIES,A as createBunRuntime};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var d=class extends Error{capability;runtimeName;constructor(t,n){super(`Capability "${t}" is not available on runtime "${n}"`),this.name="RuntimeCapabilityError",this.capability=t,this.runtimeName=n}},w=class extends Error{path;constructor(t){super(`No such file or directory: ${t}`),this.name="NotFoundError",this.path=t}},R=class extends Error{path;constructor(t){super(`File or directory already exists: ${t}`),this.name="AlreadyExistsError",this.path=t}},p=class extends Error{cmd;code;stderr;constructor(t,n,r){super(`Command "${t}" failed with exit code ${n}: ${r}`),this.name="ProcessError",this.cmd=t,this.code=n,this.stderr=r}};var P="/",W=":",c=e=>e.replace(/\\/g,"/").replace(/\/+/g,"/"),Y=e=>c(e),C=(...e)=>{if(e.length===0)return".";let t=e.filter(n=>n.length>0).join(P);return t.length===0?".":y(t)},m=(...e)=>{let t="",n=!1;for(let r=e.length-1;r>=0&&!n;r--){let o=e[r];o===void 0||o.length===0||(t=`${o}/${t}`,n=k(o))}return t=c(t),t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),y(t)??"."},v=e=>{if(e.length===0)return".";for(e=c(e);e.length>1&&e.endsWith("/");)e=e.slice(0,-1);let t=e.lastIndexOf("/");return t===-1?".":t===0?"/":e.slice(0,t)},f=(e,t)=>{if(e.length===0)return"";for(e=c(e);e.length>1&&e.endsWith("/");)e=e.slice(0,-1);let n=e.lastIndexOf("/"),r=n===-1?e:e.slice(n+1);return t&&r.endsWith(t)&&(r=r.slice(0,-t.length)),r},S=e=>{let t=f(e),n=t.lastIndexOf(".");return n<=0||n===t.length-1?"":t.slice(n)},y=e=>{if(e.length===0)return".";e=c(e);let t=e.startsWith("/"),n=e.endsWith("/"),r=e.split("/").filter(i=>i.length>0),o=[];for(let i of r)i!=="."&&(i===".."?o.length>0&&o[o.length-1]!==".."?o.pop():t||o.push(".."):o.push(i));let s=o.join("/");return t&&(s=`/${s}`),n&&s.length>1&&(s+="/"),s??"."},k=e=>e.length===0?!1:!!(e.startsWith("/")||e.length>=3&&/^[a-zA-Z]:[/\\]/.test(e)),N=(e,t)=>{if(e===t||(e=m(e),t=m(t),e===t))return"";let n=e.split("/").filter(l=>l.length>0),r=t.split("/").filter(l=>l.length>0),o=0,s=Math.min(n.length,r.length);for(let l=0;l<s&&n[l]===r[l];l++)o++;let i=n.length-o,g=r.slice(o);return[...Array(i).fill(".."),...g].join("/")??"."},I=e=>{if(e.length===0)return{root:"",dir:"",base:"",ext:"",name:""};e=c(e);let t="",n="",r=f(e),o=S(e),s=o?r.slice(0,-o.length):r;return e.startsWith("/")?t="/":/^[a-zA-Z]:[/\\]/.test(e)&&(t=e.slice(0,3)),n=v(e),n==="."&&(n=""),{root:t,dir:n,base:r,ext:o,name:s}},U=e=>{let{root:t="",dir:n,base:r,ext:o="",name:s=""}=e,i=r??s+o;return n?n===t?`${n}${i}`:`${n}/${i}`:`${t}${i}`},E={join:C,resolve:m,dirname:v,basename:f,extname:S,normalize:y,isAbsolute:k,relative:N,parse:I,format:U,sep:P,delimiter:W};var $=e=>{if(typeof Deno<"u"&&Deno.env?.get)return Deno.env.get(e);let t=globalThis.process;if(t?.env)return t.env[e]},F=(...e)=>{for(let t of e){let n=$(t);if(n!==void 0)return n}},T=e=>{try{let t=globalThis.require;if(t instanceof Function)return t(e)}catch{}},D=()=>globalThis.process,M=()=>globalThis.navigator,a=globalThis,j=()=>typeof a.caches<"u"&&typeof a.Request<"u"&&typeof a.Response<"u"&&typeof a.window>"u"&&typeof a.document>"u",z=()=>typeof a.window<"u"||typeof a.document<"u",u=()=>{if(typeof globalThis>"u")return"unknown";if(typeof a.Bun<"u")return"bun";if(typeof a.Deno<"u")return"deno";let e=a.process;return e?.versions?.node&&!e?.versions?.bun?"node":j()?"workerd":z()?"browser":"unknown"},L={deno:()=>a.Deno?.version?.deno??"unknown",bun:()=>a.Bun?.version??"unknown",node:()=>a.process?.versions?.node??"unknown",workerd:()=>"unknown",browser:()=>a.navigator?.userAgent??"unknown",unknown:()=>"unknown"},re=()=>L[u()](),oe=e=>u()===e,ie=()=>u()==="browser",_=new Set(["deno","node","bun"]),se=()=>_.has(u()),ae=()=>u()==="workerd",O={darwin:"darwin",linux:"linux",windows:"windows",win32:"windows"},x=()=>{if(typeof Deno<"u"&&Deno.build?.os)return O[Deno.build.os]??"linux";let e=D();if(e?.platform)return O[e.platform]??"linux";let t=M();if(t?.userAgent){let n=t.userAgent.toLowerCase();if(n.includes("mac"))return"darwin";if(n.includes("win"))return"windows";if(n.includes("linux"))return"linux"}return"linux"},A={x86_64:"amd64",x64:"amd64",aarch64:"arm64",arm64:"arm64"},B=()=>{if(typeof Deno<"u"&&Deno.build?.arch)return A[Deno.build.arch]??"amd64";let e=D();if(e?.arch)return A[e.arch]??"amd64";let t=M();if(t?.userAgent){let n=t.userAgent.toLowerCase();if(n.includes("arm64")||n.includes("aarch64"))return"arm64"}return"amd64"},q=()=>{let e=F("HOME","USERPROFILE");if(e)return e;let t=T("os");return t?.homedir?t.homedir():x()==="windows"?"C:\\Users\\Default":"/home"},J=()=>{let e=F("TMPDIR","TMP","TEMP");if(e)return e;let t=T("os");return t?.tmpdir?t.tmpdir():x()==="windows"?"C:\\Windows\\Temp":"/tmp"},de=()=>({platform:x(),arch:B(),homedir:q(),tmpdir:J()}),h=e=>e==="inherit"?"inherit":e==="piped"?"pipe":"ignore";var V=e=>({stdin:e?.stdin??"null",stdout:e?.stdout??"piped",stderr:e?.stderr??"piped"}),le=e=>{let t=V(e);return[h(t.stdin),h(t.stdout),h(t.stderr)]};var ce=(e,t)=>{let n={spawn:e,spawnChild:t,async exec(r,o=[],s){let i=await e(r,o,s);if(!i.success){let g=new TextDecoder().decode(i.stderr);throw new p(r,i.code,g)}return new TextDecoder().decode(i.stdout).trim()},async execJson(r,o=[],s){let i=await n.exec(r,o,s);return JSON.parse(i)}};return n},b=(e,t)=>()=>{throw new d(e,t)},H=e=>{let t=b("fs",e);return{readFile:t,readTextFile:t,writeFile:t,writeTextFile:t,exists:t,stat:t,lstat:t,mkdir:t,ensureDir:t,remove:t,readDir:t,copyFile:t,rename:t,makeTempDir:t,realPath:t,watch:t,walk:t,chmod:t}},X=e=>{let t=b("exec",e);return{spawn:t,exec:t,execJson:t,spawnChild:t}},Z=e=>{let t=b("process",e);return{exit:t,setExitCode:t,cwd:t,chdir:t,hostname:t,execPath:t,get argv(){throw new d("process",e)},get argv0(){throw new d("process",e)},get args(){throw new d("process",e)},get pid(){throw new d("process",e)},get stdin(){throw new d("process",e)},get stdout(){throw new d("process",e)},get stderr(){throw new d("process",e)},isTerminal(){return!1},setStdinRaw(){throw new d("process",e)}}},G=()=>({get:()=>{},set:()=>{},delete:()=>{},has:()=>!1,toObject:()=>({})}),ue=e=>({name:e,version:"unknown",capabilities:{fs:!1,fsSync:!1,exec:!1,process:!1,env:!1,stdin:!1,stdout:!1,kv:!1},fs:H(e),path:E,exec:X(e),env:G(),process:Z(e)});export{d as a,w as b,R as c,p as d,Y as e,E as f,u as g,re as h,oe as i,ie as j,se as k,ae as l,x as m,B as n,q as o,J as p,de as q,V as r,le as s,ce as t,H as u,X as v,Z as w,G as x,ue as y};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as S,c as R,d as x,e as O}from"./chunk-2WH262CW.js";import{c as A}from"./chunk-YK6UG66R.js";var T=[{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"]}],C=e=>T.map(s=>({...s,extras:R(e,s.id)}));var P=e=>{let s=new Set(e.map(t=>t.questionId));return T.every(t=>s.has(t.id))};var n=e=>A(e),_="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.",U=(e,s,t,a)=>{let c=e.execution.iteration>=s,p="You are a senior engineer and a scrum master who takes pride in honest reporting. Your reputation depends on accuracy, not speed. You are responsible for others' toil, and you are a perfect example of a servant leader. When reporting progress: if something is NOT implemented, say so \u2014 don't hide it. If partially done, say 'partially done: [what works] / [what doesn't]'. If untested, say 'implemented but untested'. NEVER say 'done' for something you haven't verified yourself. Underpromise \u2014 4 of 6 done means '4 of 6 done, 2 remaining', not 'almost done'.",i="Never skip steps or make decisions without asking the user. If you think something can be skipped or inferred, ask first. Explicit > Clever.",f="At every decision point (discovery questions, classification, spec approval, expansion proposals, architectural decisions, rule promotion), you MUST use AskUserQuestion to get the user's input. You MUST NOT make decisions, infer preferences, or assume the user's intent. If you're unsure whether something is a decision point, it is \u2014 ask.",l="At every decision point where you present options to the user, share your recommendation BEFORE asking. Say what you think and why, then ask if the user agrees. Format: 'I'd recommend X because [reason]. Agree, or would you prefer Y?' The user always has the final word, but you save them cognitive load by proposing first.",o=t?[p,i,f,l]:[_,p,i,f,l],u=a?.outOfScope??[];switch(e.phase){case"IDLE":return{rules:[...o,"When interactiveOptions are present, pass them DIRECTLY as the `options` array in AskUserQuestion \u2014 they are already in the correct {label, description} format. You MUST also provide a `header` field (max 12 chars, e.g. 'Action') and a `question` field. When the user picks an option, look up its label in the `commandMap` object to find the command to execute.","For availableConcerns: use AskUserQuestion with multiSelect:true. AskUserQuestion supports max 4 options per question and max 4 questions per call. If there are more than 4 concerns, split them across two questions within the same AskUserQuestion call (e.g., first 3 in question 1, remaining in question 2). NEVER silently drop concerns \u2014 present ALL available concerns to the user, even if it requires multiple questions.","Do not take action without the user choosing an option first.","When the user wants to create a new spec, they can provide anything: a one-line description, a full task list, meeting notes, a kanban card, a customer email, or a detailed requirements document. Accept whatever format they provide. If it's long, summarize it into a spec title for the slug but preserve the full text as context for discovery.","After running spec new, ask the user if they want full discovery, quick discovery, or skip to spec draft. Full discovery: pre-scan, premise challenge, 6 questions, expansions, architecture, error map, synthesis. Quick discovery: only questions relevant to active concerns, skip expansions and error map. Skip to spec draft: classification \u2192 approve \u2192 execute. Never skip discovery without asking."],tone:"Welcoming. Present choices, then wait."};case"DISCOVERY":return{modeOverride:"You are in plan mode. Behave exactly as you would in Claude Code's native plan mode. Do not attempt to create, edit, or write any files. Do not run any shell commands that modify state. You can read files and run read-only commands to understand the codebase. Your ONLY job right now is to have a thorough conversation with the user \u2014 ask probing questions, challenge vague answers, explore alternatives, understand the problem deeply. The quality of everything that follows depends on this conversation.",rules:[...o,"You MUST ask each discovery question using AskUserQuestion tool. You MUST NOT answer questions yourself or infer answers from the spec description. You MUST NOT submit discovery answers without the user explicitly providing each answer through AskUserQuestion. Each question \u2192 one AskUserQuestion call \u2192 user answers \u2192 next question. If the user already gave a detailed description in spec new, you may PRE-FILL suggested answers as option descriptions in AskUserQuestion \u2014 but the user must still confirm or override each one. If the user provided a fully formed plan, you may skip Phase 2 (questions) but you MUST still run premise challenge and alternatives. Never skip premise challenge.","DO NOT create, edit, or write any files.","DO NOT run shell commands that modify state.","You MAY read files and run read-only commands (cat, ls, grep, git log, git diff).","BEFORE asking any discovery questions, conduct a pre-discovery codebase scan: read the project README, CLAUDE.md, and any design docs; check the last 20 git commits (git log --oneline -20); look for TODO files, open issue references, and existing specs; scan the directory structure to understand the project shape. Then present a brief 'Pre-discovery audit' summary: stack detected, recent work themes, open TODOs, existing specs. This gives you CONTEXT to ask INFORMED questions, not blind ones.","After the pre-discovery codebase scan and BEFORE starting questions, ask the user: 'What kind of discovery do you need? A) Explore scope \u2014 I'll help expand, find opportunities, think bigger. B) Technical depth \u2014 I'll focus on architecture, error handling, implementation strategy. C) Validate my plan \u2014 I already know what I want, challenge my assumptions. D) Ship fast \u2014 minimal scope, cut the fat, get to tasks quickly.' Adapt your discovery emphasis accordingly: Explore \u2192 heavy on expansion proposals and dream state; Technical \u2192 heavy on architectural decisions and error/rescue map; Validate \u2192 heavy on premise challenge and pushback; Ship fast \u2192 minimal questions, skip expansions, go direct to classification and tasks.","Before starting discovery questions, challenge the user's initial spec description against what you learned from the codebase scan. Look for: hidden complexity they haven't mentioned, conflicts with existing code, scope that's bigger or smaller than they think, existing modules that overlap with what they're asking for. Share your observations and ask clarifying follow-ups, then proceed to questions.","When asking discovery questions, use your codebase knowledge to offer concrete options alongside the open-ended question. For example, instead of just 'What does the user do today?' present: 'Based on the codebase, I see three likely scenarios: A) ... B) ... C) ... D) Something else \u2014 describe it. Which is closest?' The user can always pick 'something else' but concrete options speed up the conversation and force specificity.","Ask one question at a time using your interactive question tool.","Push back on vague answers \u2014 you will be the one executing this spec, vague answers make your job harder.","When the user gives a short answer, follow up: 'Can you be more specific?'","After collecting discovery answers, synthesize a CURRENT STATE \u2192 THIS SPEC \u2192 6-MONTH IDEAL vision before generating the spec. Show three columns: where the project is now, what this spec achieves, and where it could go in 6 months. Note: 'This spec moves you from column 1 to column 2. Column 3 is out of scope but worth knowing \u2014 every decision in this spec should keep column 3 possible.' This helps the user see if the scope is right.","When you spot expansion opportunities during discovery (from codebase scan, TODOs, concern requirements, synergies with the current plan), present each as a numbered proposal (1/N, 2/N...). Every proposal MUST include: clear description of WHAT and WHY (how it connects to the current plan); effort estimate as S/M/L/XL with human time and CC time estimates (e.g., 'S (human: ~1 day / CC: ~15 min)' \u2014 not just 'small'); risk assessment as Low/Low-Med/Med/Med-High/High naming the specific risk factor; completeness delta showing X/10 without this and Y/10 with this. Every proposal gets three options: A) Add to scope B) Defer to future spec C) Skip \u2014 not interested, plus 'Chat about this' and 'Skip remaining proposals' escape hatches.","After discovery questions and expansion proposals, identify architectural decisions that must be resolved before implementation. These are decisions where choosing A vs B changes the shape of multiple tasks, the data model, the API surface, or system boundaries. Present each as a concrete technical question with options, a RECOMMENDATION with reasoning, and completeness scores. Show how each option affects downstream work (e.g., 'If you choose B, tasks 3 and 4 need a job queue setup step added'). Only surface decisions that BLOCK implementation \u2014 not preferences or nice-to-haves. If the user says 'I don't know yet', mark it as a risk: 'UNRESOLVED: [decision] TBD. Tasks X-Y may change.' Never allow implementation to start with unresolved architectural decisions \u2014 flag them prominently in the spec.","Before finalizing, map error and rescue paths for every significant codepath in the planned work. Create a table: codepath | what can go wrong | how it's handled. Identify CRITICAL GAPS \u2014 failure modes that the plan doesn't address. Present each critical gap as a decision with options, a recommendation, and completeness scores, just like architectural decisions. Resolved gaps become tasks or acceptance criteria. Unresolved gaps become risk flags. Think like an SRE reviewing a design doc \u2014 what fails at 3am?","After all discovery questions, expansion proposals, architectural decisions, and error mapping are complete, present a DISCOVERY SUMMARY for the user to review: intent, ambition, reversibility, impact, verification, out of scope, the dream state table (current \u2192 this spec \u2192 future), accepted/deferred/skipped expansions, resolved architectural decisions, and the error/rescue map. Ask for confirmation before generating the spec. This is the last chance to catch misunderstandings.","Once you have a substantive answer for each question, collect all answers and submit them together in a single `noskills next --answer` call as a JSON object."],tone:"Curious interviewer who has a stake in the answers and comes PREPARED. You've read the codebase before asking. Challenge assumptions, offer concrete options, think about architecture and failure modes. Think deeply before asking each question."};case"DISCOVERY_REVIEW":return{modeOverride:"You are in plan mode. Do not create, edit, or write any files. Present the discovery answers to the user for review and confirmation.",rules:[...o,"DO NOT create, edit, or write any files.","Present ALL discovery answers to the user clearly, one by one.","Use AskUserQuestion to ask: 'Are these answers correct, or would you like to revise any?'","If the user approves, run the approve command.","If the user wants to revise, collect their corrections and submit them.","You MUST NOT approve on behalf of the user. The user must explicitly confirm."],tone:"Careful reviewer. The user must confirm every answer."};case"SPEC_DRAFT":return{modeOverride:"You are in plan mode. Behave exactly as you would in Claude Code's native plan mode. Do not attempt to create, edit, or write any files. Your job is to review the generated spec with the user \u2014 identify gaps, suggest improvements, check if tasks are concrete enough to execute.",rules:[...o,"DO NOT create, edit, or write any files.","Read the spec and present a summary to the user.","Flag any tasks that are too vague to execute.","Flag any missing acceptance criteria.","Ask the user if they want to refine before approving.","When presenting classification options, use AskUserQuestion with multiSelect:true. Do NOT infer classification yourself.","If you identify issues in the spec (vague tasks, irrelevant sections, missing acceptance criteria), submit a refinement via: `"+n(`next --answer='{"refinement":"task-1: Add upload endpoint, task-2: Add validation middleware, task-3: Write integration tests"}'`)+"`. The spec will be updated and you can review again."],tone:"Thoughtful reviewer preparing to hand off to an implementer."};case"SPEC_APPROVED":return{rules:[...o,"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.","Before starting execution, show the spec summary to the user and ask for final confirmation via AskUserQuestion."],tone:"Patient. Wait for the go signal."};case"EXECUTING":{let h=[...o,"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 a task from noskills next, do NOT execute it yourself. Spawn the noskills-executor sub-agent using the Agent tool. Pass it: the task title, description, acceptance criteria (with IDs), behavioral rules, out-of-scope constraints, concern reminders, and relevant file paths. When the sub-agent completes, review its results briefly, then report to noskills via \`${n(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`)}\`. You are the orchestrator \u2014 the sub-agent is the implementer.`,"If the sub-agent fails, errors out, or returns no results, fall back to executing the task directly yourself. Report the sub-agent failure in your next status report so it can be investigated.","After the noskills-executor sub-agent completes a task, spawn a noskills-verifier sub-agent to independently verify the work. Pass it: the list of changed files, the acceptance criteria, and the test commands. The verifier reports PASS/FAIL per criterion with evidence. Use the verifier's report as your status report to noskills. Do NOT submit status reports based solely on the executor's self-report.",`After spawning sub-agents, ALWAYS present a dispatch table showing the FULL pipeline \u2014 not just executors, but also verification and test steps:
|
|
2
|
+
|
|
3
|
+
| Step | Agent | Files | Tasks | Est. Time |
|
|
4
|
+
|------|-------|-------|-------|-----------|
|
|
5
|
+
| 1. Implement | noskills-executor | purge.ts | Tasks 1-6 | ~3 min |
|
|
6
|
+
| 2. Verify | noskills-verifier | purge.ts (read-only) | Validate ACs | ~1 min |
|
|
7
|
+
| 3. Write tests | noskills-executor | purge.test.ts | Task 7 | ~2 min |
|
|
8
|
+
|
|
9
|
+
When agents complete, update with actual time and status (Done / Failed / Found N issues). The user should see the complete plan upfront.`,"The agent that writes implementation code must NOT write tests for that code. Spawn a SEPARATE sub-agent for test writing. This prevents the implementer from writing tests that only confirm what it already knows. The test writer reads the code fresh and tests what it actually does, not what the implementer intended.","When deciding how to split work across sub-agents: if all tasks touch the same file or tightly coupled files, batch them into one executor. If tasks touch independent files or modules, spawn parallel executors. Always err toward smaller, focused sub-agents over large batched ones \u2014 fresh context per task is better than accumulated context across tasks.",`When you discover a pattern, receive a correction, or identify a recurring preference from the user, ask: 'Should this be a permanent rule for this project, or just for this task?' If permanent, run: \`${n('rule add "<description>"')}\`. If just this task, note it and move on. Never write to \`.eser/rules/\` directly.`];e.execution.lastVerification?.passed===!1&&h.push("Tests are failing. Fix ONLY the failing tests. Do not refactor passing code.");let r={rules:h,tone:"Direct. No preamble. Start coding immediately.",outOfScope:u.length>0?u:void 0};return c?{...r,urgency:`You have been in this session for ${e.execution.iteration}+ iterations. Your context is degrading. Finish the current task and recommend the user start a fresh session. Do not start new tasks.`}:r}case"BLOCKED":return{rules:[...o,"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:[...o,"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:[...o,`Run \`${n("next")}\` to get your instructions.`,"Do not take action without noskills guidance."],tone:"Neutral. Waiting for direction."}}},$=5*60*1e3,F=(e,s)=>{let t;switch(e.phase){case"IDLE":t=`No active spec. Start one with: \`${n("spec new")}\``;break;case"DISCOVERY":t=`Discovery in progress for "${e.spec}". ${e.discovery.answers.length} questions answered so far.`;break;case"DISCOVERY_REVIEW":t=`Discovery answers ready for review. ${e.discovery.answers.length} answers collected. Waiting for user confirmation.`;break;case"SPEC_DRAFT":t=`Spec draft ready for review at ${e.specState.path}. Waiting for approval.`;break;case"SPEC_APPROVED":t=`Spec "${e.spec}" is approved. Waiting to start execution.`;break;case"EXECUTING":t=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":t=`Execution blocked: ${e.execution.lastProgress}. Ask the user to resolve.`;break;case"DONE":t=`Spec "${e.spec}" completed in ${e.execution.iteration} iterations.`;break;default:t=`Run \`${n("next")}\` to get started.`}return{protocol:`Run \`${n('next --answer="..."')}\` to submit results and advance`,spec:e.spec,branch:e.branch,iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,activeConcerns:s.map(a=>a.id),resumeHint:t}},B=e=>{if(e.lastCalledAt===null)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 DISCOVERY_REVIEW \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE",how:`Run \`${n("next")}\` for instructions. Submit results with \`${n('next --answer="..."')}\`. Never make architectural decisions without asking.`,currentPhase:e.phase};let s=new Date(e.lastCalledAt).getTime();if(Date.now()-s>$)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 DISCOVERY_REVIEW \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE",how:`Run \`${n("next")}\` for instructions. Submit results with \`${n('next --answer="..."')}\`. Never make architectural decisions without asking.`,currentPhase:e.phase}},ee=(e,s,t,a,c,p,i)=>{let f=F(e,s),l=a?.maxIterationsBeforeRestart??15,o=a?.allowGit??!1,u=U(e,l,o,c),h=B(e),r;switch(e.phase){case"IDLE":r=N(s,S,t.length,i);break;case"DISCOVERY":r=V(e,s,t);break;case"DISCOVERY_REVIEW":r=M(e,s);break;case"SPEC_DRAFT":r=Q(e);break;case"SPEC_APPROVED":r=j(e);break;case"EXECUTING":r=H(e,s,t,l,c,p);break;case"BLOCKED":r=K(e);break;case"DONE":r=z(e);break;default:r=N(s,S,t.length,i)}let d={...r,meta:f,behavioral:u};h!==void 0&&(d={...d,protocolGuide:h});let y=Y(e,s,i);if(y.length>0){let E=y.map(({label:w,description:D})=>({label:w,description:D})),v={};for(let w of y)v[w.label]=w.command;d={...d,interactiveOptions:E,commandMap:v}}return d},Y=(e,s,t)=>{switch(e.phase){case"IDLE":{let a=[],p=(t?.existingSpecs??[]).filter(i=>i.phase!=="DONE");s.length===0&&a.push({label:"Add concerns (Recommended)",description:"Shape how discovery and specs work by adding project concerns",command:n("concern add <id> [<id2> ...]")}),a.push({label:"Start a new spec",description:"Begin discovery questions for a new feature",command:n('spec new "description"')});for(let i of p.slice(0,2))a.push({label:`Continue: ${i.name} (${i.phase})`,description:i.detail??`Iteration ${i.iteration}`,command:n(`spec switch ${i.name}`)});return s.length>0&&a.push({label:"Edit concerns",description:`Currently: ${s.map(i=>i.id).join(", ")}`,command:n("concern list")}),a.slice(0,4)}case"DISCOVERY_REVIEW":return[{label:"Approve all answers",description:"Answers look correct \u2014 generate the spec",command:n('next --answer="approve"')},{label:"Revise answers",description:"Correct one or more discovery answers",command:n(`next --answer='{"revise":{...}}'`)}];case"SPEC_DRAFT":return[{label:"Approve spec",description:"Review looks good \u2014 approve and move to execution",command:n("approve")},{label:"Refine spec",description:"Submit refinements to improve tasks or sections",command:n(`next --answer='{"refinement":"..."}'`)},{label:"Start over",description:"Reset the spec and start fresh",command:n("reset")}];case"SPEC_APPROVED":return[{label:"Start execution",description:"Begin working through the spec tasks",command:n('next --answer="start"')},{label:"Reset",description:"Discard this spec and start over",command:n("reset")}];case"EXECUTING":return[];case"BLOCKED":return[{label:"Resolve block",description:"Provide a resolution to unblock execution",command:n('next --answer="resolution"')},{label:"Reset spec",description:"Abandon this spec and start over",command:n("reset")}];case"DONE":return[{label:"New spec",description:"Start a new feature spec",command:n('spec new "description"')},{label:"Check status",description:"Review completed spec summary",command:n("status")}];default:return[]}},W="noskills is a state-machine orchestrator that acts as a scrum master for both you and your agent \u2014 keeping work focused, decisions in your hands, and tokens efficient.",N=(e,s,t,a)=>({phase:"IDLE",instruction:"Present the welcome dashboard and interactive options to the user. Show existing specs if any, then present choices. IMPORTANT: Present ALL available concerns to the user \u2014 never truncate the list. Split across multiple AskUserQuestion calls if needed.",welcome:W,existingSpecs:a?.existingSpecs??[],availableConcerns:s.map(c=>({id:c.id,description:c.description})),activeConcerns:e.map(c=>c.id),activeRulesCount:a?.rulesCount??t,hint:e.length===0?"No concerns active. Consider adding concerns first \u2014 they shape discovery questions and specs.":void 0}),V=(e,s,t)=>{let a=C(s),c=e.discovery.answers.length,p=P(e.discovery.answers),i=e.discovery.audience==="agent";if(p)return{phase:"DISCOVERY",instruction:`All discovery questions answered. Run: \`${n("approve")}\``,questions:[],answeredCount:c,context:{rules:t,concernReminders:[]},transition:{onComplete:n("approve")}};if(i){let o=e.discovery.currentQuestion,u=a[o];if(u===void 0)return{phase:"DISCOVERY",instruction:`All discovery questions answered. Run: \`${n("approve")}\``,questions:[],answeredCount:c,context:{rules:t,concernReminders:[]},transition:{onComplete:n("approve")}};let h={id:u.id,text:u.text,concerns:[...u.concerns],extras:u.extras.map(r=>r.text)};return{phase:"DISCOVERY",instruction:`Ask this question to the user using AskUserQuestion. Submit the answer with: \`${n('next --agent --answer="<answer>"')}\``,questions:[h],answeredCount:c,currentQuestion:o,totalQuestions:a.length,context:{rules:t,concernReminders:x(s)},transition:{onComplete:`${n('next --agent --answer="<answer>"')}`}}}let f=new Set(e.discovery.answers.map(o=>o.questionId));return{phase:"DISCOVERY",instruction:"Conduct a thorough discovery conversation. FIRST: perform a pre-discovery codebase scan (README, CLAUDE.md, recent git log, TODOs, directory structure) and present a brief audit summary. THEN: challenge the user's spec description against your findings. THEN: ask the discovery questions one at a time, offering concrete options based on codebase knowledge. AFTER questions: present a dream state table (current \u2192 this spec \u2192 future), scored expansion proposals, architectural decisions, and an error/rescue map. FINALLY: present a complete discovery synthesis for user confirmation before submitting answers as a JSON object.",questions:a.filter(o=>!f.has(o.id)).map(o=>({id:o.id,text:o.text,concerns:[...o.concerns],extras:o.extras.map(u=>u.text)})),answeredCount:c,context:{rules:t,concernReminders:x(s)},transition:{onComplete:`${n(`next --answer='{"status_quo":"...","ambition":"...",...}'`)}`}}},M=(e,s)=>{let t=C(s);return{phase:"DISCOVERY_REVIEW",instruction:"Present ALL discovery answers to the user for review. The user must confirm or correct each answer before the spec can be generated. Use AskUserQuestion to ask for confirmation.",answers:e.discovery.answers.map(c=>{let p=t.find(i=>i.id===c.questionId);return{questionId:c.questionId,question:p?.text??c.questionId,answer:c.answer}}),transition:{onApprove:n('next --answer="approve"'),onRevise:n(`next --answer='{"revise":{"status_quo":"corrected answer"}}'`)}}},Q=e=>e.classification===null?{phase:"SPEC_DRAFT",instruction:"Before generating the spec, classify what this spec involves. Ask the user to select all that apply.",specPath:e.specState.path??"",transition:{onApprove:`${n(`next --answer='{"involvesWebUI":false,"involvesCLI":false,"involvesPublicAPI":false,"involvesMigration":false,"involvesDataHandling":false}'`)}`},classificationRequired:!0,classificationPrompt:{options:[{id:"involvesWebUI",label:"Web/Mobile UI \u2014 layouts, responsive design, visual components"},{id:"involvesCLI",label:"CLI/Terminal UI \u2014 spinners, progress bars, interactive prompts"},{id:"involvesPublicAPI",label:"Public API changes"},{id:"involvesMigration",label:"Data migration or schema changes"},{id:"involvesDataHandling",label:"Data handling or privacy"}],instruction:"Select all that apply. Submit as JSON: `"+n(`next --answer='{"involvesWebUI":true,"involvesCLI":false,"involvesPublicAPI":false,...}'`)+"`"}}:{phase:"SPEC_DRAFT",instruction:"Spec draft is ready for review. Ask the user to review and approve.",specPath:e.specState.path??"",transition:{onApprove:n("approve")}},j=e=>({phase:"SPEC_APPROVED",instruction:"Spec is approved and ready. When the user is ready to start, begin execution.",specPath:e.specState.path??"",transition:{onStart:`${n('next --answer="start"')}`}}),G=(e,s)=>{if(s===null)return!1;let t=e.toLowerCase();return t.includes("mobile")||t.includes("layout")||t.includes("interaction design")?s.involvesWebUI:t.includes("ui state")||t.includes("skeleton ui")?s.involvesWebUI||s.involvesCLI:t.includes("api doc")||t.includes("public api")?s.involvesPublicAPI:t.includes("migration")||t.includes("backward compat")||t.includes("deprecat")?s.involvesMigration:t.includes("audit trail")||t.includes("access control")||t.includes("data handling")||t.includes("data retention")?s.involvesDataHandling:!0},X=(e,s,t,a,c,p,i,f)=>{let l=[],o=new Set(f??[]),u=0,h=()=>`ac-${++u}`;if(a!==null)for(let r of a.items)o.has(r.id)||l.push({id:r.id,text:`[DEBT from iteration ${r.since}] ${r.text}`});if(s&&l.push({id:h(),text:`[FAILED] Tests \u2014 fix this first: ${t.slice(0,200)}`}),p!=null)for(let r of p.verification){let d=h();o.has(d)||l.push({id:d,text:r})}for(let r of e)if(r.acceptanceCriteria!==void 0&&r.acceptanceCriteria.length>0)for(let d of r.acceptanceCriteria){if(!G(d,c))continue;let y=h();o.has(y)||l.push({id:y,text:`(${r.id}) ${d}`})}if(i!==void 0)for(let r of i){let d=h();o.has(d)||l.push({id:d,text:`(folder: ${r.folder}) ${r.rule}`})}return l},H=(e,s,t,a,c,p)=>{let i=O(s),f=e.execution.iteration>=a,l=e.execution.lastVerification?.passed===!1,o=e.execution.lastVerification?.output??"",u=c?.tasks??[],h=e.execution.completedTasks??[],r=new Set(h),d=u.find(m=>!r.has(m.id))??null,y=d!==null?{id:d.id,title:d.title,totalTasks:u.length,completedTasks:h.length}:void 0;if(e.execution.awaitingStatusReport){let m=X(s,l,o,e.execution.debt,e.classification,c,p,e.execution.naItems),k={phase:"EXECUTING",instruction:"Before this task is accepted, report your completion status against these acceptance criteria.",context:{rules:t,concernReminders:x(s)},transition:{onComplete:`${n(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`)}`,onBlocked:`${n('block "reason"')}`,iteration:e.execution.iteration},statusReportRequired:!0,statusReport:{criteria:m,reportFormat:{completed:"list item IDs you finished (e.g., ['debt-1', 'ac-3']) with evidence",remaining:"list item IDs not yet done",blocked:"list item IDs that need a decision from the user",na:"(optional) list item IDs that are not applicable to this task \u2014 they will be removed from future criteria",newIssues:"(optional) list NEW issues discovered during implementation \u2014 free text, will be assigned debt IDs automatically"}}};return l&&(k={...k,verificationFailed:!0,verificationOutput:o.slice(0,2e3)}),k}let E=(e.execution.lastProgress??"").includes("Task not accepted"),v=e.execution.debt?.items??[],w=e.execution.debt?.unaddressedIterations??0,D=y!==void 0?`Execute task ${y.id}: ${y.title} (${y.completedTasks}/${y.totalTasks} completed)`:"All tasks completed. Run `"+n("done")+"` to finish.",I;if(l)I="Verification FAILED. Fix the failing tests before continuing.";else if(E&&v.length>0){let m=w>=3?` These items have been outstanding for ${w} iterations.`:"";I=`Task not accepted \u2014 ${v.length} remaining item(s) must be addressed before this task can be completed.${m} Address them, then submit a new status report.`}else I=D;let g={phase:"EXECUTING",instruction:I,task:y,context:{rules:t,concernReminders:x(s)},transition:{onComplete:`${n('next --answer="..."')}`,onBlocked:`${n('block "reason"')}`,iteration:e.execution.iteration}};if(E&&v.length>0&&(g={...g,taskRejected:!0,rejectionReason:`${v.length} remaining item(s) must be addressed.`,rejectionRemaining:v.map(m=>m.text)}),e.execution.debt!==null&&e.execution.debt.items.length>0){let m=e.execution.debt.unaddressedIterations??0,k=m>=3?`URGENT: These items have been unaddressed for ${m} iterations. Address them IMMEDIATELY before any new work.`:"These were not completed in a previous iteration. Address them BEFORE starting new work.";g={...g,previousIterationDebt:{fromIteration:e.execution.debt.fromIteration,items:e.execution.debt.items,note:k}}}if(l){let m=o.slice(0,2e3);g={...g,verificationFailed:!0,verificationOutput:m}}i.length>0&&(g={...g,concernTensions:i}),f&&(g={...g,restartRecommended:!0,restartInstruction:`Context may be getting large after ${e.execution.iteration} iterations. Consider starting a new conversation and running \`${n("next")}\` to resume - your progress is saved.`});let b=[...e.decisions].reverse().find(m=>!m.promoted);return b!==void 0&&e.execution.lastProgress?.startsWith("Resolved:")&&(g={...g,promotePrompt:{decisionId:b.id,question:b.question,choice:b.choice,prompt:`You just resolved a decision: "${b.choice}". Ask the user: "Should this be a permanent rule for future specs too?" If yes, run: \`${n(`rule add "${b.choice}"`)}\``}}),g},K=e=>({phase:"BLOCKED",instruction:"A decision is needed. Ask the user.",reason:e.execution.lastProgress??"Unknown",transition:{onResolved:`${n('next --answer="..."')}`}}),z=e=>({phase:"DONE",summary:{spec:e.spec,iterations:e.execution.iteration,decisionsCount:e.decisions.length}});export{T as a,C as b,P as c,ee as d};
|