eser 4.1.12 → 4.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/README.md +152 -3
  2. package/chunks/add-4LRHVBEC.js +7 -0
  3. package/chunks/anthropic-GBDSASP5.js +1 -0
  4. package/chunks/approve-364KOMLB.js +1 -0
  5. package/chunks/ask-752YJEHO.js +2 -0
  6. package/chunks/block-JVJQU723.js +1 -0
  7. package/chunks/browser-6UKLTPJO.js +1 -0
  8. package/chunks/build-VKOO2WEA.js +6 -0
  9. package/chunks/bun-N3TIWBPP.js +1 -0
  10. package/chunks/changelog-gen-ZCNNOY7G.js +7 -0
  11. package/chunks/chunk-2R4MK2KR.js +2 -0
  12. package/chunks/chunk-2TRQKCFC.js +1 -0
  13. package/chunks/chunk-34GCQZ3Z.js +3 -0
  14. package/chunks/chunk-3APERFKY.js +18 -0
  15. package/chunks/chunk-3DMTTLUJ.js +1 -0
  16. package/chunks/chunk-3TYZYY77.js +1 -0
  17. package/chunks/chunk-4HMEWMWL.js +1 -0
  18. package/chunks/chunk-4HNB3UTC.js +1 -0
  19. package/chunks/chunk-4OIKB2P5.js +1 -0
  20. package/chunks/chunk-4Q3SEHPE.js +1 -0
  21. package/chunks/chunk-4S7QYPS6.js +1 -0
  22. package/chunks/chunk-5C7ZQN6X.js +3 -0
  23. package/chunks/chunk-5O7V5P53.js +1 -0
  24. package/chunks/chunk-5UGVJVIQ.js +1 -0
  25. package/chunks/chunk-6FMPNAZ3.js +1 -0
  26. package/chunks/chunk-6U2VEZEM.js +1 -0
  27. package/chunks/chunk-6YRN6OJC.js +2 -0
  28. package/chunks/chunk-7GS5KPVF.js +1 -0
  29. package/chunks/chunk-7M3ONEMO.js +32 -0
  30. package/chunks/chunk-7QNRH7OR.js +3 -0
  31. package/chunks/chunk-A2GDVOQP.js +1 -0
  32. package/chunks/chunk-AK3OJD4W.js +1 -0
  33. package/chunks/chunk-ATLUGTI7.js +2 -0
  34. package/chunks/chunk-BK2BDHKB.js +1 -0
  35. package/chunks/chunk-BKVQBSFV.js +6 -0
  36. package/chunks/chunk-BP2MZX2P.js +2 -0
  37. package/chunks/chunk-C3OSYHJY.js +2 -0
  38. package/chunks/chunk-CDLEA2PD.js +1 -0
  39. package/chunks/chunk-DDLQMSA7.js +0 -0
  40. package/chunks/chunk-DLVQNMNV.js +1 -0
  41. package/chunks/chunk-DOV5776P.js +3 -0
  42. package/chunks/chunk-DQAEQEXD.js +1 -0
  43. package/chunks/chunk-DRQWYJMH.js +1 -0
  44. package/chunks/chunk-DXB73IDG.js +1 -0
  45. package/chunks/chunk-DZD6MI45.js +5 -0
  46. package/chunks/chunk-EW5NCPPE.js +3 -0
  47. package/chunks/chunk-FGDJVQG3.js +32 -0
  48. package/chunks/chunk-FKF2SWQM.js +18 -0
  49. package/chunks/chunk-GETSWLMF.js +4 -0
  50. package/chunks/chunk-GLSCZGXA.js +1 -0
  51. package/chunks/chunk-GRTR6TNJ.js +1 -0
  52. package/chunks/chunk-GXPLME3K.js +14 -0
  53. package/chunks/chunk-H2JGLZIR.js +1 -0
  54. package/chunks/chunk-HGNGFAAY.js +60 -0
  55. package/chunks/chunk-HPPFA3XU.js +1 -0
  56. package/chunks/chunk-HPVL4BVQ.js +2 -0
  57. package/chunks/chunk-HVMMNGY5.js +7 -0
  58. package/chunks/chunk-IA7GIU76.js +14 -0
  59. package/chunks/chunk-IAWIWTDY.js +1 -0
  60. package/chunks/chunk-JQHMDTPL.js +1 -0
  61. package/chunks/chunk-L2BYHWDC.js +1 -0
  62. package/chunks/chunk-LRL56YFE.js +1 -0
  63. package/chunks/chunk-LU3DHXOC.js +2 -0
  64. package/chunks/chunk-LXVBR775.js +1 -0
  65. package/chunks/chunk-M5TBBQQC.js +21 -0
  66. package/chunks/chunk-MQH4XBFN.js +1 -0
  67. package/chunks/chunk-NADES3GN.js +1 -0
  68. package/chunks/chunk-NIX3WX3O.js +1 -0
  69. package/chunks/chunk-NSZ4HGDI.js +1 -0
  70. package/chunks/chunk-NUSNMQPL.js +1 -0
  71. package/chunks/chunk-NZFUFGOC.js +1 -0
  72. package/chunks/chunk-OBIEQJDE.js +4 -0
  73. package/chunks/chunk-OLM5RTFK.js +1 -0
  74. package/chunks/chunk-PBSR4XR2.js +335 -0
  75. package/chunks/chunk-PLJNPQFC.js +1 -0
  76. package/chunks/chunk-PLRSDG6G.js +2 -0
  77. package/chunks/chunk-Q7QMINSQ.js +0 -0
  78. package/chunks/chunk-QIUIPRJP.js +1 -0
  79. package/chunks/chunk-QXTK62N4.js +1 -0
  80. package/chunks/chunk-R6F4EK2B.js +4 -0
  81. package/chunks/chunk-RGUC6KAZ.js +1 -0
  82. package/chunks/chunk-SCCNNGD4.js +2 -0
  83. package/chunks/chunk-SCULX2ND.js +1 -0
  84. package/chunks/chunk-SJQWPBMJ.js +1 -0
  85. package/chunks/chunk-TMFPDVYN.js +127 -0
  86. package/chunks/chunk-UJX2S56V.js +1 -0
  87. package/chunks/chunk-USCAYIWL.js +1 -0
  88. package/chunks/chunk-V5HTJPFW.js +3 -0
  89. package/chunks/chunk-VFMYWG2I.js +3 -0
  90. package/chunks/chunk-VGFZXQMW.js +1 -0
  91. package/chunks/chunk-VTQ72OK7.js +1 -0
  92. package/chunks/chunk-WE7PSSAQ.js +91 -0
  93. package/chunks/chunk-WUJUQPHI.js +1 -0
  94. package/chunks/chunk-X4ZCYXOT.js +1 -0
  95. package/chunks/chunk-XJ3VEVYL.js +3 -0
  96. package/chunks/chunk-XMTGT2NJ.js +10 -0
  97. package/chunks/chunk-XWYLEYLY.js +1 -0
  98. package/chunks/chunk-Y6DLCHJN.js +1 -0
  99. package/chunks/chunk-Y6DZEK4W.js +1 -0
  100. package/chunks/chunk-YUXQ7JNG.js +1 -0
  101. package/chunks/chunk-Z7742D7Q.js +1 -0
  102. package/chunks/chunk-ZE5T64HQ.js +1 -0
  103. package/chunks/chunk-ZF2XYULB.js +1 -0
  104. package/chunks/chunk-ZOZYBQX2.js +0 -0
  105. package/chunks/chunk-ZTLJ775S.js +1 -0
  106. package/chunks/chunk-ZY72QNKZ.js +3 -0
  107. package/chunks/claude-code-PWTLM554.js +1 -0
  108. package/chunks/clone-DASXIL35.js +5 -0
  109. package/chunks/commitmsg-SQRQONCS.js +10 -0
  110. package/chunks/deno-PZXN5K3J.js +1 -0
  111. package/chunks/dev-FLO2KEPZ.js +3 -0
  112. package/chunks/file-tools-shared-ESMPLZVJ.js +1 -0
  113. package/chunks/fileFromPath-4UEDFJ4U.js +6 -0
  114. package/chunks/gemini-I6F5N7PS.js +1 -0
  115. package/chunks/gh-Y4BXDXR5.js +4 -0
  116. package/chunks/gh-contributors-5SHGJHAQ.js +11 -0
  117. package/chunks/init-GXBXQGGV.js +1 -0
  118. package/chunks/init-UFJL24PW.js +12 -0
  119. package/chunks/install-Q2KQZM62.js +2 -0
  120. package/chunks/kiro-NMTIFMT4.js +1 -0
  121. package/chunks/list-B7L4FZKG.js +2 -0
  122. package/chunks/list-MN7OUE52.js +1 -0
  123. package/chunks/list-UZKWSA4S.js +1 -0
  124. package/chunks/load-config-TSM3AAQ6.js +1 -0
  125. package/chunks/main-WVXCURBF.js +5 -0
  126. package/chunks/manifest-VJQJG2LS.js +1 -0
  127. package/chunks/mod-3PJAIZ2O.js +1 -0
  128. package/chunks/mod-6P2JPEHC.js +1 -0
  129. package/chunks/mod-7X3BOO5H.js +1 -0
  130. package/chunks/mod-CI56JMO4.js +43 -0
  131. package/chunks/mod-FKPTF5D5.js +1 -0
  132. package/chunks/mod-GZ6BSK2P.js +1 -0
  133. package/chunks/mod-JTBNNSZZ.js +1 -0
  134. package/chunks/mod-MKMQWZ6G.js +1 -0
  135. package/chunks/mod-PEAFMI6F.js +1 -0
  136. package/chunks/mod-QODEWK3G.js +9 -0
  137. package/chunks/mod-STKIZYZ3.js +27 -0
  138. package/chunks/new-W5YBJFGW.js +4 -0
  139. package/chunks/next-773GX25N.js +3 -0
  140. package/chunks/node-RWYXITVV.js +59 -0
  141. package/chunks/node-VPHAK3FD.js +1 -0
  142. package/chunks/ollama-DQ5VM4HI.js +1 -0
  143. package/chunks/openai-EKIA3VP3.js +19 -0
  144. package/chunks/openai-XMIVMDDL.js +1 -0
  145. package/chunks/opencode-IZMQZ4ZK.js +1 -0
  146. package/chunks/recipe-applier-F2REROYS.js +1 -0
  147. package/chunks/registry-fetcher-ZJ76EHBA.js +1 -0
  148. package/chunks/release-YJOLKWDT.js +8 -0
  149. package/chunks/release-notes-Z53AFCII.js +3 -0
  150. package/chunks/release-tag-QRIKYVQB.js +1 -0
  151. package/chunks/reset-5LQGIOGB.js +1 -0
  152. package/chunks/rule-K42YEAMO.js +2 -0
  153. package/chunks/run-7JXDS75G.js +4 -0
  154. package/chunks/scripts-RSK5XDRW.js +1 -0
  155. package/chunks/sdk-5JGXLIO5.js +18 -0
  156. package/chunks/serve-U6IXMGXQ.js +3 -0
  157. package/chunks/server-PXE4DB3V.js +69 -0
  158. package/chunks/spec-5446CSQC.js +1 -0
  159. package/chunks/status-HK3P6J6G.js +1 -0
  160. package/chunks/sync-4FSA5257.js +1 -0
  161. package/chunks/system-3MH6OCP6.js +1 -0
  162. package/chunks/system-KWFBSQYQ.js +1 -0
  163. package/chunks/unstable_chmod-WRDBWEC2.js +1 -0
  164. package/chunks/update-QD5S73WT.js +5 -0
  165. package/chunks/validate-bom-IVALGNGE.js +1 -0
  166. package/chunks/validate-case-conflict-LKECKLD5.js +1 -0
  167. package/chunks/validate-circular-deps-PXFPCBXA.js +1 -0
  168. package/chunks/validate-commit-msg-77CBKGOF.js +1 -0
  169. package/chunks/validate-docs-3UGB7LN7.js +1 -0
  170. package/chunks/validate-eof-ZSIYNHO5.js +1 -0
  171. package/chunks/validate-export-names-BPSCBX7B.js +1 -0
  172. package/chunks/validate-filenames-G4XJ2LHN.js +1 -0
  173. package/chunks/validate-json-YRCFW2O7.js +1 -0
  174. package/chunks/validate-large-files-MWWSFDOE.js +1 -0
  175. package/chunks/validate-licenses-Q2YA2MND.js +1 -0
  176. package/chunks/validate-line-endings-C6NHWHGI.js +1 -0
  177. package/chunks/validate-merge-conflict-KTBL4FUY.js +1 -0
  178. package/chunks/validate-mod-exports-LQIIQRIS.js +1 -0
  179. package/chunks/validate-package-configs-36PYXIWC.js +1 -0
  180. package/chunks/validate-secrets-UFDJ7ITY.js +1 -0
  181. package/chunks/validate-shebangs-3UO4MDMZ.js +1 -0
  182. package/chunks/validate-submodules-YA654D3B.js +1 -0
  183. package/chunks/validate-symlinks-R2PNE5TG.js +1 -0
  184. package/chunks/validate-toml-7H2N5AKI.js +1 -0
  185. package/chunks/validate-trailing-whitespace-HXO7M3ED.js +1 -0
  186. package/chunks/validate-yaml-ZJJCQVBB.js +1 -0
  187. package/chunks/versions-CWT5S7G4.js +1 -0
  188. package/chunks/vertexai-2SMP54AR.js +1 -0
  189. package/chunks/workerd-NXKZMQPV.js +1 -0
  190. package/eser.js +1 -943
  191. package/package.json +1 -1
package/README.md CHANGED
@@ -1,8 +1,13 @@
1
1
  # 🖥️ [@eser/cli](./)
2
2
 
3
- Eser's swiss-army-knife tooling for your terminal. A multi-purpose CLI that
4
- dispatches to library modules for codebase management, workflow automation,
5
- framework scaffolding, and more.
3
+ Terminal client for Eser's work. A multi-purpose CLI that dispatches to library
4
+ modules for codebase management, workflow automation, framework scaffolding, and
5
+ more.
6
+
7
+ Built on a hexagonal architecture: business logic lives in pure handlers
8
+ (`@eser/registry/handlers`), output flows through Span-based formatting
9
+ (`@eser/streams`), and the CLI is just one adapter — the same handlers can serve
10
+ MCP tool calls, HTTP APIs, or tests.
6
11
 
7
12
  ## 🚀 Installation
8
13
 
@@ -31,6 +36,12 @@ deno run --allow-all jsr:@eser/cli <command>
31
36
 
32
37
  ```
33
38
  eser
39
+ ├── kit Recipe distribution & project scaffolding
40
+ │ ├── list Browse available recipes and templates
41
+ │ ├── add Add a recipe to your project
42
+ │ ├── new Create a new project from a template
43
+ │ ├── clone Clone a recipe from any GitHub repo
44
+ │ └── update Re-fetch and update an applied recipe
34
45
  ├── codebase Codebase management tools
35
46
  │ ├── scaffolding Initialize project from template
36
47
  │ ├── install Install git hooks from .manifest.yml
@@ -79,6 +90,102 @@ eser
79
90
 
80
91
  ## 📋 Commands
81
92
 
93
+ ### kit
94
+
95
+ Recipe distribution system — add code recipes, scaffold projects, and pull
96
+ utilities from the eser ecosystem. Copy code recipes into your project across
97
+ TypeScript and Go, at three scales: projects, structures, and utilities.
98
+
99
+ ```bash
100
+ # Browse all available recipes
101
+ npx eser kit list
102
+ npx eser kit list --language go
103
+ npx eser kit list --scale utility
104
+
105
+ # Add a recipe to your current project
106
+ npx eser kit add fp-pipe
107
+ npx eser kit add ajan-httpfx
108
+ npx eser kit add ajan-httpfx --no-install # skip auto-installing deps
109
+ npx eser kit add fp-pipe --dry-run # preview without writing
110
+
111
+ # Create a new project from a template
112
+ npx eser kit new laroux-app --name my-site
113
+ npx eser kit create go-service --name my-api # "create" is an alias for "new"
114
+
115
+ # Clone a recipe from any GitHub repo (not just the registry)
116
+ npx eser kit clone eser/ajan
117
+
118
+ # Re-fetch and update a previously applied recipe
119
+ npx eser kit update ajan-httpfx
120
+ ```
121
+
122
+ #### kit list
123
+
124
+ ```bash
125
+ eser kit list [options]
126
+ ```
127
+
128
+ | Option | Description |
129
+ | ------------ | -------------------------------------------------- |
130
+ | `--language` | Filter by language: `typescript`, `go` |
131
+ | `--scale` | Filter by scale: `project`, `structure`, `utility` |
132
+ | `--tag` | Filter by tag |
133
+ | `--registry` | Custom registry URL |
134
+ | `--local` | Use local registry (auto-detected) |
135
+
136
+ #### kit add
137
+
138
+ ```bash
139
+ eser kit add <recipe> [options]
140
+ ```
141
+
142
+ | Option | Description |
143
+ | ----------------- | ------------------------------------------------- |
144
+ | `--dry-run` | Preview files without writing |
145
+ | `--force` | Overwrite existing files |
146
+ | `--skip-existing` | Skip files that already exist |
147
+ | `--no-install` | Print dependency commands instead of running them |
148
+ | `--verbose` | Show detailed output |
149
+ | `--var key=value` | Set template variables (repeatable) |
150
+ | `--registry` | Custom registry URL |
151
+ | `--local` | Use local registry (auto-detected) |
152
+
153
+ #### kit new
154
+
155
+ ```bash
156
+ eser kit new <template> [options]
157
+ eser kit create <template> [options] # alias
158
+ ```
159
+
160
+ | Option | Description |
161
+ | ----------------- | ----------------------------------- |
162
+ | `--name` | Project name (defaults to template) |
163
+ | `--var key=value` | Set template variables (repeatable) |
164
+ | `--registry` | Custom registry URL |
165
+ | `--local` | Use local registry (auto-detected) |
166
+
167
+ **Available templates:** `library-pkg`, `laroux-app`, `go-service`,
168
+ `cf-workers-app`, `vite-app`, `cool-lime-app`, `jsx-runtime-app`, `vanilla-app`
169
+
170
+ #### kit clone
171
+
172
+ ```bash
173
+ eser kit clone <owner/repo> [options]
174
+ ```
175
+
176
+ Clones a recipe from any GitHub repository that contains a `recipe.json` file.
177
+ Not limited to the built-in registry.
178
+
179
+ #### Custom registries
180
+
181
+ Anyone can host their own recipe registry. Create an `eser-registry.json` file
182
+ following the [registry schema](https://eser.live/registry/v1.json) and use:
183
+
184
+ ```bash
185
+ npx eser kit list --registry https://example.com/my-registry.json
186
+ npx eser kit add my-recipe --registry https://example.com/my-registry.json
187
+ ```
188
+
82
189
  ### workflows
83
190
 
84
191
  Run tool pipelines driven by events (pre-commit, pre-push, etc.).
@@ -223,6 +330,48 @@ eser version --bare # version number only
223
330
  eser doctor
224
331
  ```
225
332
 
333
+ ## Architecture
334
+
335
+ The CLI follows a hexagonal (ports & adapters) architecture where:
336
+
337
+ 1. **Handlers** (`@eser/registry/handlers/`) contain pure business logic
338
+ 2. **Streams** (`@eser/streams`) provide adapter-agnostic output via Spans
339
+ 3. **CLI commands** are thin adapters that wire handlers to terminal I/O
340
+
341
+ ```
342
+ User types: eser kit list --language go
343
+
344
+ CLI adapter (commands/list.ts):
345
+ ├── Parse args with @std/cli/parse-args
346
+ ├── Create Output with ANSI renderer + stdout sink
347
+ ├── Run handler via task.runTask(listRecipes(input), { out })
348
+ └── Return ok/fail result
349
+
350
+ Handler (handlers/list-recipes.ts):
351
+ ├── Fetch registry
352
+ ├── Filter recipes
353
+ ├── Write to ctx.out using Span constructors (bold, cyan, dim)
354
+ └── Return typed Result
355
+
356
+ Output pipeline:
357
+ Spans → ANSI renderer → stdout sink → terminal
358
+ ```
359
+
360
+ The same handler can be invoked with a different renderer + sink:
361
+
362
+ - **MCP tool call**: `markdown()` renderer + `buffer()` sink → returns markdown
363
+ - **HTTP API**: `plain()` renderer + `buffer()` sink → returns JSON
364
+ - **Test**: `plain()` renderer + `buffer()` sink → assert on output
365
+
366
+ ### Key Packages
367
+
368
+ | Package | Role |
369
+ | ------------------------- | -------------------------------------------------- |
370
+ | `@eser/shell/args` | Command class (routing, lazy loading, completions) |
371
+ | `@eser/functions/task` | Task<T,E,R> for DI-aware lazy computation |
372
+ | `@eser/streams` | Output API + Span formatting + Renderers |
373
+ | `@eser/registry/handlers` | Pure business logic handlers |
374
+
226
375
  ## License
227
376
 
228
377
  Apache-2.0
@@ -0,0 +1,7 @@
1
+ import{a as C,b as N,c as x}from"./chunk-3TYZYY77.js";import{f as S}from"./chunk-6YRN6OJC.js";import{a as I,d as E}from"./chunk-NUSNMQPL.js";import{f as $}from"./chunk-SCULX2ND.js";import{f as A,h as b,k as h}from"./chunk-FGDJVQG3.js";import{d as o,e as v,f as g,g as k,j as y}from"./chunk-PLJNPQFC.js";import{a as w}from"./chunk-HPPFA3XU.js";import{a as d,b as c,c as R}from"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var D=r=>I(async e=>{try{let t=await $(r.registrySource,{verbose:r.verbose,local:r.local}),s=t.recipes.find(n=>n.name===r.recipeName);if(s===void 0)return c({_tag:"RecipeNotFound",message:`Recipe '${r.recipeName}' not found. Run \`eser kit list\` to see available recipes.`});let a=await C(r.cwd),i=N(s,a);for(let n of i.warnings)e.out.writeln(k(`Warning: ${n}`));let l=await S(r.recipeName,t.recipes,{cwd:r.cwd,registryUrl:t.registryUrl,force:r.force,skipExisting:r.skipExisting,dryRun:r.dryRun,verbose:r.verbose,variables:r.variables}),f=0,p=0;for(let n of l.recipes)f+=n.result.written.length,p+=n.result.skipped.length;e.out.writeln(g(`\u2713 Added ${f} file(s)`)),l.recipes.length>1&&e.out.writeln(o(` Applied ${l.recipes.length} recipes (including dependencies)`)),p>0&&e.out.writeln(o(` Skipped ${p} existing file(s)`));let m=l.recipes.find(n=>n.name===r.recipeName);if(m!==void 0)for(let n of m.result.written)e.out.writeln(` \u2192 ${n}`);let u;if(!r.noInstall&&!r.dryRun&&i.instructions.length>0){e.out.writeln(o(`
2
+ Installing dependencies...`)),u=await x(i.instructions,r.cwd,{verbose:r.verbose});for(let n of u)n.success?e.out.writeln(g(` \u2713 ${n.command}`)):e.out.writeln(v(` \u2717 ${n.command}: ${n.error}`))}else if(i.instructions.length>0){e.out.writeln(o(`
3
+ Dependencies (run manually):`));for(let n of i.instructions)e.out.writeln(o(` ${n}`))}return d({recipe:s,chainResult:l,depInfo:i,installResults:u})}catch(t){let s=t instanceof Error?t.message:String(t);return c({_tag:"ApplyError",message:s})}});var P=r=>{let e={};for(let t of r){let[s,...a]=String(t).split("=");s!==void 0&&s!==""&&(e[s]=a.join("="))}return e},q=async r=>{let e=w(r??[],{string:["registry","var"],boolean:["dry-run","force","skip-existing","verbose","local","no-install"],collect:["var"]}),t=e._[0],s=A({renderer:h.ansi(),sink:b.stdout()});if(t===void 0)return s.writeln("Usage: eser kit add <recipe> [--registry <url>] [--dry-run] [--var key=value]"),s.writeln(),s.writeln("Run ",o("`eser kit list`")," to see available recipes."),await s.close(),d(void 0);let a=e["dry-run"]===!0;a?s.writeln(y(`
4
+ Dry run: ${t}
5
+ `)):s.writeln(y(`
6
+ Adding ${t}...
7
+ `));let i=await E(D({recipeName:t,cwd:Deno.cwd(),registrySource:e.registry,local:e.local===!0,dryRun:a,force:e.force===!0,skipExisting:e["skip-existing"]===!0,verbose:e.verbose===!0,noInstall:e["no-install"]===!0,variables:P(e.var)}),{out:s});return await s.close(),R(i)?d(void 0):c({exitCode:1})};export{q as main};
@@ -0,0 +1 @@
1
+ import{a,b}from"./chunk-UJX2S56V.js";import"./chunk-LRL56YFE.js";import"./chunk-OLM5RTFK.js";import"./chunk-DXB73IDG.js";export{a as AnthropicModel,b as anthropicFactory};
@@ -0,0 +1 @@
1
+ import{e as w}from"./chunk-LXVBR775.js";import{d,e as h}from"./chunk-BKVQBSFV.js";import{f as l,h as m,k as c}from"./chunk-FGDJVQG3.js";import{c as r,d as n,e as o,f as i,j as p}from"./chunk-PLJNPQFC.js";import{a}from"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var R=async f=>{let e=l({renderer:c.ansi(),sink:m.stdout()}),t=Deno.cwd(),s=await d(t);if(s.phase==="SPEC_DRAFT"){let u=w(s);await h(t,u),e.writeln(i("\u2714")," Spec approved. Phase: ",p("BUILDING")),e.writeln("Run ",r("noskills next")," to start building.")}else s.phase==="DISCOVERY"&&s.discovery.completed?(e.writeln(n("Discovery complete. Spec draft already generated.")),e.writeln("Review the spec and run ",r("noskills approve")," again when in SPEC_DRAFT phase.")):e.writeln(o(`Cannot approve in phase: ${s.phase}`));return await e.close(),a(void 0)};export{R as main};
@@ -0,0 +1,2 @@
1
+ import{a as F,b as D}from"./chunk-6FMPNAZ3.js";import{a as $}from"./chunk-LRL56YFE.js";import{d as v,f as y,g as P,h as S,k as T}from"./chunk-FGDJVQG3.js";import{d as O,e as L,g as _}from"./chunk-OBIEQJDE.js";import{a as R}from"./chunk-USCAYIWL.js";import"./chunk-PLJNPQFC.js";import"./chunk-OLM5RTFK.js";import{b as k}from"./chunk-DOV5776P.js";import{a as I,b as u}from"./chunk-DQAEQEXD.js";import{t as h,u as x}from"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var A=(e,t,a)=>{let i=e.streamText(t,a);return{name:`ai-text/${e.provider}/${e.modelId}`,readable:new ReadableStream({async start(n){try{for await(let s of i)s.kind==="content_delta"&&n.enqueue(v(s.textDelta));n.close()}catch(s){n.error(s)}}})}};var q={cc:"claude-code",ol:"ollama",oc:"opencode",oai:"openai",ant:"anthropic",gem:"gemini",vtx:"vertexai"},H={"claude-code":"Claude Code",ollama:"Ollama",opencode:"OpenCode",kiro:"Kiro",anthropic:"Anthropic API",openai:"OpenAI API",gemini:"Gemini API",vertexai:"Vertex AI"},K=e=>q[e]??e,M=async e=>{if(e){let{current:t}=x,a=t.process.stderr.getWriter(),i=y({renderer:T.ansi(),sink:S.writable(new WritableStream({async write(n){await a.write(new TextEncoder().encode(String(n.data)))},close(){a.releaseLock()}}))});await O.configure({sinks:{stderr:_.getOutputSink(i)},loggers:[{category:["ai"],lowestLevel:R.Debug,sinks:["stderr"]}]})}return L.getLogger(["ai","ask"])},U=async e=>{await e.info("Auto-detecting AI provider...");try{if(await k`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 k`which opencode`.noThrow().code()===0)return await e.info("OpenCode detected."),"opencode"}catch{}let{current:t}=x;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.")},j=async e=>{switch(e){case"claude-code":return(await import("./claude-code-PWTLM554.js")).claudeCodeFactory;case"ollama":return(await import("./ollama-DQ5VM4HI.js")).ollamaFactory;case"opencode":return(await import("./opencode-IZMQZ4ZK.js")).openCodeFactory;case"kiro":return(await import("./kiro-NMTIFMT4.js")).kiroFactory;case"anthropic":return(await import("./anthropic-GBDSASP5.js")).anthropicFactory;case"openai":return(await import("./openai-XMIVMDDL.js")).openaiFactory;case"gemini":return(await import("./gemini-I6F5N7PS.js")).geminiFactory;case"vertexai":return(await import("./vertexai-2SMP54AR.js")).vertexaiFactory;default:throw new Error(`Unknown provider: ${e}`)}},le=async e=>{let t=e??[],a=null,i=null,n=null,s=!1,g=!1,E=[],o=0;for(;o<t.length;){let r=t[o];if(r==="-p"||r==="--provider"){a=t[o+1]??null,o+=2;continue}if(r==="-m"||r==="--model"){i=t[o+1]??null,o+=2;continue}if(r==="--max-tokens"){let c=t[o+1];c!==void 0&&(n=Number(c)),o+=2;continue}if(r==="--json"){s=!0,o+=1;continue}if(r==="-v"||r==="--verbose"){g=!0,o+=1;continue}r.startsWith("-")||E.push(r),o+=1}let p=E.join(" ");if(p.length===0)return u({message:'Usage: ai ask "your prompt" [-p provider] [-m model] [--verbose]',exitCode:1});let m=await M(g);try{let r=a!==null?K(a):await U(m),c=H[r]??r,b=i??J(r);await m.info(`Using ${c} (${b})`);let W=await j(r),f=new F({factories:[W]});await f.addModel("default",{provider:r,model:b});let w=f.getDefault();if(w===null)return u({message:"Failed to initialize model",exitCode:1});let C=[$("user",p)];if(await m.info(`Sending prompt (${p.length} chars)...`),s){let l=await w.generateText({messages:C,maxTokens:n??void 0});await m.info(`Response received (${D(l).length} chars)`);let d=y({sink:S.stdout()});d.writeln(JSON.stringify(l,null,2)),await d.close()}else{let l=A(w,{messages:C,maxTokens:n??void 0});await P().from(l).to(z()).run();let d=h.process.stdout.getWriter();await d.write(new TextEncoder().encode(`
2
+ `)),d.releaseLock()}return await f.close(),I(void 0)}catch(r){let c=r instanceof Error?r.message:String(r);return await m.error(c),g&&r instanceof Error&&r.cause!==void 0&&await m.debug(`Cause: ${String(r.cause)}`),u({message:c,exitCode:1})}},G=12,V=e=>new Promise(t=>setTimeout(t,e)),z=(e=G)=>{let t=new TextEncoder;return{name:"typewriter",writable:new WritableStream({async write(a){let i=String(a.data),n=h.process.stdout.getWriter();for(let s of i)await n.write(t.encode(s)),await V(e);n.releaseLock()}})}},J=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{le as main};
@@ -0,0 +1 @@
1
+ import{g as f}from"./chunk-LXVBR775.js";import{d as w,e as u}from"./chunk-BKVQBSFV.js";import{f as m,h as c,k as d}from"./chunk-FGDJVQG3.js";import{c as a,d as i,e as l,g as p}from"./chunk-PLJNPQFC.js";import{a as o,b as n}from"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var x=async h=>{let e=m({renderer:d.ansi(),sink:c.stdout()}),t=Deno.cwd(),r=h?.join(" ")??"No reason given",s=await w(t);if(s.phase!=="BUILDING")return e.writeln(l(`Cannot block in phase: ${s.phase}`)),await e.close(),n({exitCode:1});let k=f(s,r);return await u(t,k),e.writeln(p("\u26A0")," Spec blocked: ",i(r)),e.writeln("Resolve with: ",a('noskills next --answer="resolution"')),await e.close(),o(void 0)};export{x as main};
@@ -0,0 +1 @@
1
+ import{b as s}from"./chunk-VTQ72OK7.js";import{a as r}from"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var o={fs:!1,fsSync:!1,exec:!1,process:!1,env:!1,stdin:!1,stdout:!1,kv:!1},t=e=>()=>{throw new r(e,"browser")},n=()=>{let e=t("fs");return{readFile:e,readTextFile:e,writeFile:e,writeTextFile:e,exists:e,stat:e,lstat:e,mkdir:e,ensureDir:e,remove:e,readDir:e,copyFile:e,rename:e,makeTempDir:e,realPath:e,watch:e,walk:e,chmod:e}},i=()=>{let e=t("exec");return{spawn:e,exec:e,execJson:e,spawnChild:e}},a=()=>{let e=t("process");return{exit:e,setExitCode:e,cwd:e,chdir:e,hostname:e,execPath:e,get args(){throw new r("process","browser")},get pid(){throw new r("process","browser")},get stdin(){throw new r("process","browser")},get stdout(){throw new r("process","browser")},get stderr(){throw new r("process","browser")}}},c=()=>({get:()=>{},set:()=>{},delete:()=>{},has:()=>!1,toObject:()=>({})}),l=()=>({name:"browser",version:globalThis.navigator?.userAgent??"unknown",capabilities:o,fs:n(),path:s,exec:i(),env:c(),process:a()});export{o as BROWSER_CAPABILITIES,l as createBrowserRuntime};
@@ -0,0 +1,6 @@
1
+ import{f as d,h as g,k as m}from"./chunk-FGDJVQG3.js";import{b as c,d as L,g as C,j as u}from"./chunk-PLJNPQFC.js";import"./chunk-ZOZYBQX2.js";import{a as v}from"./chunk-WE7PSSAQ.js";import"./chunk-HPPFA3XU.js";import{a as y}from"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var V=["trace","debug","info","warn","error","fatal"],N=async x=>{let{flags:o}=v(x??[],[{name:"out-dir",type:"string",default:"dist",description:"Output directory"},{name:"clean",type:"boolean",description:"Clean output first"},{name:"no-minify",type:"boolean",description:"Disable minification"},{name:"analyze",type:"boolean",description:"Analyze bundle size"},{name:"log-level",type:"string",default:"info",description:"Log level"}]),t=d({renderer:m.ansi(),sink:g.stdout()});t.writeln(u(`
2
+ \u{1F4E6} Building for production...
3
+ `));let e=await import("./mod-6P2JPEHC.js"),{current:n}=await import("./mod-FKPTF5D5.js"),i=n.process.cwd(),p=o["out-dir"],S=!o["no-minify"],h=o.clean,k=o.analyze,f=o["log-level"]??"info",b=V.includes(f.toLowerCase())?f.toLowerCase():"info",z={trace:e.Severities.Trace,debug:e.Severities.Debug,info:e.Severities.Info,warn:e.Severities.Warning,error:e.Severities.Error,fatal:e.Severities.Critical},D=d({renderer:m.ansi(),sink:g.stdout()});await e.config.configure({sinks:{console:e.sinks.getOutputSink(D)},loggers:[{category:["laroux-bundler"],lowestLevel:z[b],sinks:["console"]}]});let[{build:A,createBuildContext:E},{loadConfig:O},{reactPlugin:B},{createTailwindPlugin:P}]=await Promise.all([import("./system-3MH6OCP6.js"),import("./load-config-TSM3AAQ6.js"),import("./mod-CI56JMO4.js"),import("./mod-JTBNNSZZ.js")]),T=e.logger.getLogger(["laroux-bundler","cli"]),s=await O(i),r={projectRoot:i,srcDir:n.path.resolve(i,s.srcDir),distDir:n.path.resolve(i,p),logLevel:b,fonts:s.fonts,images:s.images,cssModuleTypes:s.cssModuleTypes,noCssModuleAutoReference:s.noCssModuleAutoReference,browserShims:s.browserShims,serverExternals:s.build.serverExternals,build:{...s.build,minify:S}};if(h)try{await n.fs.remove(r.distDir,{recursive:!0}),T.debug(`Cleaned ${r.distDir}`)}catch{}let R=P({globalCssPath:n.path.resolve(i,"src/app/styles/global.css")}),j=E(r,{framework:B,css:R,bundlerBackend:"rolldown"});if(await A(j),await e.config.reset(),k){t.writeln(u(`
4
+ \u{1F4CA} Bundle Analysis:
5
+ `));try{let M=`${p}/client/manifest.json`,$=await n.fs.readTextFile(M),w=JSON.parse($);t.writeln(c("Chunks:"));for(let[a,l]of Object.entries(w.files)){let I=(l.size/1024).toFixed(2);t.writeln(c(` ${a.padEnd(30)} ${I.padStart(8)} KB`))}let F=Object.values(w.files).reduce((a,l)=>a+l.size,0);t.writeln(L(`
6
+ Total: ${(F/1024).toFixed(2)} KB`))}catch{t.writeln(C("Could not analyze build (manifest.json not found)"))}}return await t.close(),y(void 0)};export{N as main};
@@ -0,0 +1 @@
1
+ import{b as F}from"./chunk-4OIKB2P5.js";import{b as v,d as b}from"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";import*as n from"node:fs/promises";import*as O from"node:fs";import*as o from"node:path";import*as w from"node:os";import m from"node:process";import{Readable as x,Writable as k}from"node:stream";var E={fs:!0,fsSync:!0,exec:!0,process:!0,env:!0,stdin:!0,stdout:!0,kv:!1},R=()=>{let s=e=>({isFile:e.isFile(),isDirectory:e.isDirectory(),isSymlink:e.isSymbolicLink(),size:e.size,mtime:e.mtime,atime:e.atime,birthtime:e.birthtime}),a=(e,t)=>{throw e instanceof Error&&"code"in e&&e.code==="ENOENT"?new v(t):e};return{async readFile(e,t){try{let r=await n.readFile(e,{signal:t?.signal});return new Uint8Array(r)}catch(r){return a(r,e)}},async readTextFile(e,t){try{return await n.readFile(e,{encoding:"utf-8",signal:t?.signal})}catch(r){return a(r,e)}},async writeFile(e,t,r){let d=r?.append?"a":"w";await n.writeFile(e,t,{signal:r?.signal,mode:r?.mode,flag:d})},async writeTextFile(e,t,r){let d=r?.append?"a":"w";await n.writeFile(e,t,{encoding:"utf-8",signal:r?.signal,mode:r?.mode,flag:d})},async exists(e){try{return await n.access(e),!0}catch{return!1}},async stat(e){try{let t=await n.stat(e);return s(t)}catch(t){return a(t,e)}},async lstat(e){try{let t=await n.lstat(e);return s(t)}catch(t){return a(t,e)}},async mkdir(e,t){await n.mkdir(e,{recursive:t?.recursive??!1,mode:t?.mode})},async ensureDir(e){await n.mkdir(e,{recursive:!0})},async remove(e,t){try{await n.rm(e,{recursive:t?.recursive??!1,force:!1})}catch(r){a(r,e)}},async*readDir(e){try{let t=await n.readdir(e,{withFileTypes:!0});for(let r of t)yield{name:r.name,isFile:r.isFile(),isDirectory:r.isDirectory(),isSymlink:r.isSymbolicLink()}}catch(t){a(t,e)}},async copyFile(e,t){await n.copyFile(e,t)},async rename(e,t){await n.rename(e,t)},async makeTempDir(e){let t=e?.dir??w.tmpdir(),r=e?.prefix??"",d=e?.suffix??"",i=await n.mkdtemp(o.join(t,r));if(d){let c=i+d;return await n.rename(i,c),c}return i},async realPath(e){try{return await n.realpath(e)}catch(t){throw t instanceof Error&&"code"in t&&t.code==="ENOENT"?new v(e):t}},watch(e,t){let r=t?.recursive??!0,d=[],i=[],c=[],u=!1,h=l=>{u||(c.length>0?c.shift()({value:l,done:!1}):i.push(l))};for(let l of e)try{let P=O.watch(l,{recursive:r},(y,f)=>{f!==null&&h({kind:y==="rename"?"create":"modify",paths:[o.join(l,f)]})});d.push(P)}catch{}return{close:()=>{u=!0;for(let l of d)l.close();for(let l of c)l({value:void 0,done:!0});c=[]},[Symbol.asyncIterator]:()=>({next:()=>u?Promise.resolve({value:void 0,done:!0}):i.length>0?Promise.resolve({value:i.shift(),done:!1}):new Promise(l=>{c.push(l)})})}},async chmod(e,t){await n.chmod(e,t)},async*walk(e,t){let r=t?.includeDirs??!0,d=t?.includeFiles??!0,i=t?.exts,c=t?.skip,u=async function*(h){let l=await n.readdir(h,{withFileTypes:!0});for(let P of l){let y=o.join(h,P.name);if(c?.some(p=>p.test(y)))continue;let f=P.isSymbolicLink();if(P.isDirectory())r&&(yield{path:y,name:P.name,isFile:!1,isDirectory:!0,isSymlink:f}),yield*u(y);else if(P.isFile()||f){if(!d||i&&!i.some(p=>P.name.endsWith(p.startsWith(".")?p:`.${p}`)))continue;yield{path:y,name:P.name,isFile:P.isFile(),isDirectory:!1,isSymlink:f}}}};yield*u(e)}}},S=()=>({join:o.join,resolve:o.resolve,dirname:o.dirname,basename:o.basename,extname:o.extname,normalize:o.normalize,isAbsolute:o.isAbsolute,relative:o.relative,parse:o.parse,format:o.format,sep:o.sep,delimiter:o.delimiter}),g=async s=>{if(!s)return new Uint8Array(0);let a=[],e=s.getReader();try{for(;;){let{done:i,value:c}=await e.read();if(i)break;a.push(c)}}finally{e.releaseLock()}let t=a.reduce((i,c)=>i+c.length,0),r=new Uint8Array(t),d=0;for(let i of a)r.set(i,d),d+=i.length;return r},A=()=>({async spawn(s,a=[],e){let[t,r,d]=F(e),i=Bun.spawn([s,...a],{cwd:e?.cwd,env:e?.env,stdin:t,stdout:r,stderr:d}),[c,u,h]=await Promise.all([i.exited,g(i.stdout),g(i.stderr)]);return{success:c===0,code:c,stdout:u,stderr:h}},async exec(s,a=[],e){let t=await this.spawn(s,a,e);if(!t.success){let r=new TextDecoder().decode(t.stderr);throw new b(s,t.code,r)}return new TextDecoder().decode(t.stdout).trim()},async execJson(s,a=[],e){let t=await this.exec(s,a,e);return JSON.parse(t)},spawnChild(s,a=[],e){let[t,r,d]=F(e),i=Bun.spawn([s,...a],{cwd:e?.cwd,env:e?.env,stdin:t,stdout:r,stderr:d}),c=i.exited.then(u=>({success:u===0,code:u,signal:void 0}));return{pid:i.pid,stdin:i.stdin,stdout:i.stdout,stderr:i.stderr,status:c,output:async()=>{let[u,h,l]=await Promise.all([c,g(i.stdout),g(i.stderr)]);return{success:u.success,code:u.code,stdout:h,stderr:l}},kill:u=>{i.kill(u)}}}}),W=()=>({get(s){return m.env[s]},set(s,a){m.env[s]=a},delete(s){delete m.env[s]},has(s){return s in m.env},toObject(){let s={};for(let[a,e]of Object.entries(m.env))e!==void 0&&(s[a]=e);return s}}),D=()=>({exit(s){m.exit(s)},setExitCode(s){m.exitCode=s},cwd(){return m.cwd()},chdir(s){m.chdir(s)},hostname(){return w.hostname()},execPath(){return m.execPath},args:m.argv.slice(2),pid:m.pid,stdin:x.toWeb(m.stdin),stdout:k.toWeb(m.stdout),stderr:k.toWeb(m.stderr)}),C=()=>{let s=R(),a=S(),e=A(),t=W(),r=D();return{name:"bun",version:Bun.version,capabilities:E,fs:s,path:a,exec:e,env:t,process:r}};export{E as BUN_CAPABILITIES,C as createBunRuntime};
@@ -0,0 +1,7 @@
1
+ import{a as $,b as G}from"./chunk-BP2MZX2P.js";import{a as N}from"./chunk-LU3DHXOC.js";import"./chunk-ATLUGTI7.js";import"./chunk-Y6DZEK4W.js";import"./chunk-34GCQZ3Z.js";import"./chunk-3APERFKY.js";import{a as R}from"./chunk-6U2VEZEM.js";import{a as A,b as E}from"./chunk-JQHMDTPL.js";import"./chunk-2TRQKCFC.js";import"./chunk-ZF2XYULB.js";import"./chunk-5UGVJVIQ.js";import"./chunk-4S7QYPS6.js";import{f as w}from"./chunk-NUSNMQPL.js";import"./chunk-GXPLME3K.js";import"./chunk-FGDJVQG3.js";import"./chunk-USCAYIWL.js";import{b as u,e as h,f as y,g as v,h as x}from"./chunk-PLJNPQFC.js";import"./chunk-DOV5776P.js";import{a as C}from"./chunk-HPPFA3XU.js";import{g as p}from"./chunk-DQAEQEXD.js";import"./chunk-WUJUQPHI.js";import"./chunk-A2GDVOQP.js";import"./chunk-GLSCZGXA.js";import"./chunk-ZE5T64HQ.js";import{u as m}from"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var f=A(),S={feat:"Added",fix:"Fixed",refactor:"Changed",perf:"Changed",docs:"Changed",revert:"Removed"},O=new Set(["chore","ci","test"]),T=/^(\w+)(?:\(([^)]+)\))?!?:\s*(.+)$/,P=/\s*\(take\s+[IVXLCDM\d]+\)\s*\.?$/i,I=(n,t)=>{let r=n.match(T);if(r!==null)return{type:r[1].toLowerCase(),scope:r[2],message:r[3].trim(),hash:t}},b=n=>n.replace(P,"").trim(),k=n=>{let t=[];for(let r of n){let e=I(r.subject,r.hash);e!==void 0&&t.push(e)}return t},L=n=>{let t=new Set,r=[];for(let e of n){let s=b(e.message),a=s.replace(/[.\s]+$/,"").toLowerCase(),l=`${e.type}:${a}`;t.has(l)||(t.add(l),r.push({...e,message:s}))}return r},M=n=>{let t=new Map;for(let r of n){if(O.has(r.type))continue;let e=S[r.type];if(e===void 0)continue;let s=t.get(e);s!==void 0?s.push(r):t.set(e,[r])}return t},H=n=>n.scope!==void 0?`- **${n.scope}:** ${n.message}`:`- ${n.message}`,F=(n,t)=>{let r=M(t);if(r.size===0)return"";let e=new Date().toISOString().split("T")[0],s=[`## ${n} - ${e}`],a=["Added","Changed","Fixed","Removed"];for(let l of a){let o=r.get(l);if(!(o===void 0||o.length===0)){s.push("",`### ${l}`,"");for(let d of o)s.push(H(d))}}return s.join(`
2
+ `)},j=(n,t,r)=>{let e=n.split(`
3
+ `);if(r!==void 0){let o=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),d=new RegExp(`^##\\s+${o}\\b`),i=e.findIndex(g=>d.test(g));if(i!==-1){let g=e.length;for(let c=i+1;c<e.length;c++)if(/^##\s+/.test(e[c])){g=c;break}return e.splice(i,g-i,t),e.join(`
4
+ `)}}let s=e.findIndex(o=>/^##\s+\[Unreleased\]/i.test(o));if(s===-1){let o=e.findIndex((i,g)=>g>0&&i.startsWith("## ")),d=o===-1?e.length:o;return e.splice(d,0,"",t,""),e.join(`
5
+ `)}let a=-1;for(let o=s+1;o<e.length;o++)if(/^##\s+/.test(e[o])){a=o;break}let l=a===-1?e.length:a;return e.splice(l,0,t,""),e.join(`
6
+ `)},V=async(n={})=>{let{root:t=".",dryRun:r=!1}=n,e=await N({root:t});if(e===void 0||e==="")throw new Error("VERSION file is missing or empty.");let s;try{s=await $()}catch{throw new Error("No git tags found. Create an initial tag first (e.g., git tag v0.0.0).")}let a=await G(s,"HEAD");if(a.length===0)throw new Error(`No commits found since ${s}. Nothing to release.`);let l=k(a),o=L(l),d=F(e,o);if(d==="")throw new Error("No user-facing changes found (all commits are chore/ci/test). Nothing to add to CHANGELOG.");if(!r){let i=m.current.path.join(t,"CHANGELOG.md"),g;try{g=await m.current.fs.readTextFile(i)}catch{throw new Error(`CHANGELOG.md not found at ${i}. Create one first.`)}let c=j(g,d,e);await m.current.fs.writeTextFile(i,c)}return{version:e,commitCount:a.length,entryCount:o.filter(i=>!O.has(i.type)).length,content:d,dryRun:r}},D=n=>w.fromPromise(()=>V(n)),_=n=>p.ok({dryRun:n.flags["dry-run"]===!0}),z=n=>{if(p.isFail(n))return f.writeln(h("\u2717"),u(" "+(n.error instanceof Error?n.error.message:String(n.error)))),p.fail({exitCode:1});let{value:t}=n;return t.dryRun?(f.writeln(v("\u26A0"),u(" [DRY RUN] Generated changelog preview:")),f.writeln(x("\u2139"),u(`
7
+ ${t.content}`))):f.writeln(y("\u2713"),u(` Added ${t.entryCount} entries to CHANGELOG.md for v${t.version}`)),p.ok(void 0)},B=R.createTrigger({handler:D,adaptInput:_,adaptOutput:z}),ee=async n=>{let t=C(n??[],{boolean:["dry-run"],alias:{n:"dry-run"}}),r=E("changelog-gen",t);return await B(r)};export{L as deduplicateCommits,V as generateChangelog,D as generateChangelogHandler,F as generateChangelogSection,M as groupBySection,B as handleCli,j as insertIntoChangelog,ee as main,I as parseConventionalCommit,k as parseConventionalCommits,b as stripTakeSuffix};
@@ -0,0 +1,2 @@
1
+ import{b as w}from"./chunk-7GS5KPVF.js";import{a as c}from"./chunk-DOV5776P.js";var h=()=>{let e=new Map;return{register:o=>{e.set(o.name,o)},registerAll:o=>{for(let r of o)e.set(r.name,r)},get:o=>e.get(o),getAll:()=>[...e.values()],has:o=>e.has(o),names:()=>[...e.keys()]}};var y=e=>{let o=e.workflows;if(!Array.isArray(o))throw new Error("Invalid config: 'workflows' must be an array");for(let r=0;r<o.length;r++){let n=o[r],t=n?.id!==void 0&&n.id!==""?`workflow '${n.id}'`:`workflow at index ${r}`;if(typeof n?.id!="string"||n.id==="")throw new Error(`Invalid config: ${t} must have a non-empty 'id' string`);if(!Array.isArray(n.on)||n.on.length===0)throw new Error(`Invalid config: ${t} must have a non-empty 'on' array`);if(!Array.isArray(n.steps)||n.steps.length===0)throw new Error(`Invalid config: ${t} must have a non-empty 'steps' array`);for(let s=0;s<n.steps.length;s++){let i=n.steps[s];if(typeof i=="string")continue;if(typeof i!="object"||i===null||Array.isArray(i))throw new Error(`Invalid config: ${t}, step ${s} must be a string or an object with exactly one key`);let l=Object.keys(i);if(l.length!==1)throw new Error(`Invalid config: ${t}, step ${s} must be an object with exactly one key (got ${l.length})`)}}};var T=async e=>{let o=await w(e);if(o===null)return null;let r={stack:o.stack,workflows:o.workflows??[],scripts:o.scripts};return y(r),r};var $={name:"shell",description:"Execute shell commands",run:async e=>{let o=e.command,r=e.fixCommand,n=e.name??o??"shell",t=e.fix??!1,s=e.root??".",i=e.workingDirectory??s;if(o===void 0||o.length===0)throw new Error(`Shell tool requires a 'command' option. Usage: { shell: { command: "deno fmt --check" } }`);let l=t&&r!==void 0?r:o,a=await new c("sh",["-c",l]).cwd(i).noThrow().spawn(),f=a.code;if(f===0)return{name:n,passed:!0,issues:[],mutations:[],stats:{exitCode:0}};let d=new TextDecoder,g=d.decode(a.stderr).trim(),m=[d.decode(a.stdout).trim(),g].filter(u=>u.length>0).join(`
2
+ `);return{name:n,passed:!1,issues:[{message:m||`Command exited with code ${f}`}],mutations:[],stats:{exitCode:f}}}};export{h as a,T as b,$ as c};
@@ -0,0 +1 @@
1
+ function g(e,r){if(isNaN(e)||isNaN(r))throw new Error("Cannot compare against non-numbers");return e===r?0:e<r?-1:1}function z(e=[],r=[]){return e.length&&!r.length?-1:!e.length&&r.length?1:0}function V(e=[],r=[]){let n=Math.max(e.length,r.length);for(let o=0;o<n;o++){let a=e[o],t=r[o];if(a===void 0&&t===void 0)return 0;if(t===void 0)return 1;if(a===void 0)return-1;if(typeof a=="string"&&typeof t=="number")return 1;if(typeof a=="number"&&typeof t=="string"||a<t)return-1;if(a>t)return 1}return 0}var m="0|[1-9]\\d*",v="\\d*[a-zA-Z-][a-zA-Z0-9-]*",W=`(?<major>${m})\\.(?<minor>${m})\\.(?<patch>${m})`,A=`(?:${m}|${v})`,N=`(?:-(?<prerelease>${A}(?:\\.${A})*))`,B="[0-9A-Za-z-]+",D=`(?:\\+(?<buildmetadata>${B}(?:\\.${B})*))`,S=`v?${W}${N}?${D}?`,O=new RegExp(`^${S}$`),L="(?:<|>)?=?",H="x|X|\\*",R=`${m}|${H}`,P=`[v=\\s]*(?<major>${R})(?:\\.(?<minor>${R})(?:\\.(?<patch>${R})${N}?${D}?)?)?`,X=new RegExp(`^(?<operator>~>?|\\^|${L})\\s*${P}$`),Y=new RegExp(`^(?<operator>${L})\\s*(${S})$|^$`);function I(e){return typeof e=="number"&&!Number.isNaN(e)&&(!Number.isFinite(e)||0<=e&&e<=Number.MAX_SAFE_INTEGER)}var K=256;var q=new RegExp(`^${m}$`);function f(e){return e.split(".").filter(Boolean).map(r=>{if(q.test(r)){let n=Number(r);if(I(n))return n}return r})}function d(e){return e.split(".").filter(Boolean)}function x(e,r){let n=Number(e);if(!I(n))throw new TypeError(r);return n}function l(e,r){return e===r?0:g(e.major,r.major)||g(e.minor,r.minor)||g(e.patch,r.patch)||z(e.prerelease,r.prerelease)||V(e.prerelease,r.prerelease)}function M(e){return e.toFixed(0)}function G(e){let r=M(e.major),n=M(e.minor),o=M(e.patch),a=e.prerelease?.join(".")??"",t=e.build?.join(".")??"";return[[`${r}.${n}.${o}`,a].filter(i=>i).join("-"),t].filter(i=>i).join("+")}function Z(e=[]){let r=[...e],n=r.length;for(;n>=0;){let o=r[n];if(typeof o=="number"){r[n]=o+1;break}n-=1}return n===-1&&r.push(0),r}function y(e=[],r){let n=Z(e);if(!r)return n;let o=f(r);if(o.every(a=>typeof a=="string")){if(o.every((a,t)=>a===n[t])&&typeof n[o.length]=="number")return n;o=[...o,0]}return o}function ge(e,r,n={}){let o=n.build!==void 0?d(n.build):e.build??[];switch(r){case"premajor":return{major:e.major+1,minor:0,patch:0,prerelease:y(e.prerelease,n.prerelease),build:o};case"preminor":return{major:e.major,minor:e.minor+1,patch:0,prerelease:y(e.prerelease,n.prerelease),build:o};case"prepatch":return{major:e.major,minor:e.minor,patch:e.patch+1,prerelease:y(e.prerelease,n.prerelease),build:o};case"prerelease":{let t=(e.prerelease??[]).length===0?e.patch+1:e.patch;return{major:e.major,minor:e.minor,patch:t,prerelease:y(e.prerelease,n.prerelease),build:o}}case"major":return{major:(e.prerelease??[]).length===0||e.minor!==0||e.patch!==0?e.major+1:e.major,minor:0,patch:0,prerelease:[],build:o};case"minor":{let t=(e.prerelease??[]).length===0||e.patch!==0?e.minor+1:e.minor;return{major:e.major,minor:t,patch:0,prerelease:[],build:o}}case"patch":{let t=(e.prerelease??[]).length===0?e.patch+1:e.patch;return{major:e.major,minor:e.minor,patch:t,prerelease:[],build:o}}case"pre":return{major:e.major,minor:e.minor,patch:e.patch,prerelease:y(e.prerelease,n.prerelease),build:o};default:throw new TypeError(`Cannot increment version: invalid argument ${r}`)}}function T(e){if(typeof e!="string")throw new TypeError(`Cannot parse version as version must be a string: received ${typeof e}`);if(e.length>K)throw new TypeError(`Cannot parse version as version length is too long: length is ${e.length}, max length is ${K}`);e=e.trim();let r=e.match(O)?.groups;if(!r)throw new TypeError(`Cannot parse version: ${e}`);let n=x(r.major,`Cannot parse version ${e}: invalid major version`),o=x(r.minor,`Cannot parse version ${e}: invalid minor version`),a=x(r.patch,`Cannot parse version ${e}: invalid patch version`),t=r.prerelease?f(r.prerelease):[],s=r.buildmetadata?d(r.buildmetadata):[];return{major:n,minor:o,patch:a,prerelease:t,build:s}}var j={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},$={operator:void 0,...j};var te={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",408:"Request Timeout",409:"Conflict",410:"Gone",413:"Payload Too Large",415:"Unsupported Media Type",422:"Unprocessable Entity",429:"Too Many Requests",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout"},w=class extends Error{status;constructor(r,n){super(n??te[r]??"Unknown Error"),this.name="HttpError",this.status=r}};var u=e=>r=>new w(e,r),Rt=u(400),Vt=u(401),It=u(403),Kt=u(404),Mt=u(409),Tt=u(422),jt=u(429),Ct=u(500),wt=u(503);var h=()=>{let e=new Map,r=!1,n=()=>{if(r)throw new Error("ImmutableMapBuilder has been sealed. Use map.toBuilder() to create a new builder.")},o={set:(a,t)=>(n(),e.set(a,t),o),delete:a=>(n(),e.delete(a),o),has:a=>e.has(a),get size(){return e.size},build:()=>(n(),r=!0,_(e))};return o},k=e=>{let r=new Map;if(e)for(let[n,o]of e)r.set(n,o);return _(r)},_=e=>{let r={get:n=>e.get(n),has:n=>e.has(n),get size(){return e.size},get isEmpty(){return e.size===0},keys:function*(){yield*e.keys()},values:function*(){yield*e.values()},entries:function*(){for(let n of e.entries())yield n},forEach:n=>{for(let[o,a]of e)n(a,o,r)},[Symbol.iterator]:function*(){for(let n of e.entries())yield n},map:n=>{let o=h();for(let[a,t]of e)o.set(a,n(t,a));return o.build()},filter:n=>{let o=h();for(let[a,t]of e)n(t,a)&&o.set(a,t);return o.build()},reduce:(n,o)=>{let a=o;for(let[t,s]of e)a=n(a,s,t);return a},toBuilder:()=>{let n=h();for(let[o,a]of e)n.set(o,a);return n},merge:(...n)=>{let o=h();for(let[a,t]of e)o.set(a,t);for(let a of n)for(let[t,s]of a)o.set(t,s);return o.build()}};return Object.freeze(r)},ae=k();var se=e=>{let r=new Map(e),n=!1,o=()=>{if(n)throw new Error("RegistryBuilder has been sealed. Use registry.toBuilder() to create a new builder.")},a={set:(t,s)=>(o(),r.set(t,["value",s]),a),setLazy:(t,s)=>(o(),r.set(t,["lazy",s]),a),remove:t=>(o(),r.delete(t),a),has:t=>r.has(t),get size(){return r.size},build:()=>(o(),n=!0,E(r))};return a},E=e=>{let r={entries:e,keysCache:null,valuesCache:null,entriesCache:null,lazyCache:new Map},n=(t,s)=>{let[c,i]=s;if(c==="value")return i;if(r.lazyCache.has(t))return r.lazyCache.get(t);let p=i();if(!(p instanceof Promise))return r.lazyCache.set(t,p),p},o=async(t,s)=>{let[c,i]=s;if(c==="value")return i;if(r.lazyCache.has(t))return r.lazyCache.get(t);let p=await i();return r.lazyCache.set(t,p),p};return Object.freeze({get:t=>{let s=r.entries.get(t);if(s!==void 0)return n(t,s)},getAsync:async t=>{let s=r.entries.get(t);if(s!==void 0)return await o(t,s)},has:t=>r.entries.has(t),isLazy:t=>{let s=r.entries.get(t);return s===void 0?!1:s[0]==="lazy"},keys:()=>(r.keysCache===null&&(r.keysCache=Object.freeze([...r.entries.keys()])),r.keysCache),values:()=>{if(r.valuesCache===null){let t=[];for(let[s,c]of r.entries){let[i]=c;i==="value"?t.push(c[1]):i==="lazy"&&r.lazyCache.has(s)&&t.push(r.lazyCache.get(s))}r.valuesCache=Object.freeze(t)}return r.valuesCache},entries:()=>{if(r.entriesCache===null){let t=[];for(let[s,c]of r.entries){let[i]=c;i==="value"?t.push([s,c[1]]):i==="lazy"&&r.lazyCache.has(s)&&t.push([s,r.lazyCache.get(s)])}r.entriesCache=Object.freeze(t)}return r.entriesCache},get size(){return r.entries.size},toBuilder:()=>se(r.entries)})},ie=E(new Map);export{l as a,G as b,ge as c,T as d};
@@ -0,0 +1,3 @@
1
+ function c(s){if(new.target)throw new TypeError("Cannot create an instance: parse is not a constructor");return new o(s).parse()}var o=class{#i=new Set(` \r
2
+ `);#o=new Set([..."[]{}:,/",...this.#i]);#e;#r;#n;constructor(e){this.#e=`${e}`,this.#r=this.#e.length,this.#n=this.#h()}parse(){let e=this.#t(),t=this.#s(e),{done:r,value:i}=this.#n.next();if(!r)throw new SyntaxError(n(i));return t}#t(){let{done:e,value:t}=this.#n.next();if(e)throw new SyntaxError("Cannot parse JSONC: unexpected end of JSONC input");return t}*#h(){for(let e=0;e<this.#r;e++)if(!this.#i.has(this.#e[e])){if(this.#e[e]==="/"&&this.#e[e+1]==="*"){e+=2;let t=!1;for(;e<this.#r;e++)if(this.#e[e]==="*"&&this.#e[e+1]==="/"){t=!0;break}if(!t)throw new SyntaxError("Cannot parse JSONC: unexpected end of JSONC input");e++;continue}if(this.#e[e]==="/"&&this.#e[e+1]==="/"){for(e+=2;e<this.#r&&!(this.#e[e]===`
3
+ `||this.#e[e]==="\r");e++);continue}switch(this.#e[e]){case"{":yield{type:"BeginObject",position:e};break;case"}":yield{type:"EndObject",position:e};break;case"[":yield{type:"BeginArray",position:e};break;case"]":yield{type:"EndArray",position:e};break;case":":yield{type:"NameSeparator",position:e};break;case",":yield{type:"ValueSeparator",position:e};break;case'"':{let t=e,r=!1;for(e++;e<this.#r&&!(this.#e[e]==='"'&&!r);e++)r=this.#e[e]==="\\"&&!r;yield{type:"String",sourceText:this.#e.substring(t,e+1),position:t};break}default:{let t=e;for(;e<this.#r&&!this.#o.has(this.#e[e]);e++);e--,yield{type:"NullOrTrueOrFalseOrNumber",sourceText:this.#e.substring(t,e+1),position:t}}}}}#s(e){switch(e.type){case"BeginObject":return this.#c();case"BeginArray":return this.#u();case"NullOrTrueOrFalseOrNumber":return this.#p(e);case"String":return this.#a(e);default:throw new SyntaxError(n(e))}}#c(){let e={};for(;;){let t=this.#t();if(t.type==="EndObject")return e;if(t.type!=="String")throw new SyntaxError(n(t));let r=this.#a(t),i=this.#t();if(i.type!=="NameSeparator")throw new SyntaxError(n(i));let h=this.#t();Object.defineProperty(e,r,{value:this.#s(h),writable:!0,enumerable:!0,configurable:!0});let a=this.#t();if(a.type==="EndObject")return e;if(a.type!=="ValueSeparator")throw new SyntaxError(n(a))}}#u(){let e=[];for(;;){let t=this.#t();if(t.type==="EndArray")return e;e.push(this.#s(t));let r=this.#t();if(r.type==="EndArray")return e;if(r.type!=="ValueSeparator")throw new SyntaxError(n(r))}}#a(e){let t;try{t=JSON.parse(e.sourceText)}catch{throw new SyntaxError(n(e))}if(typeof t!="string")throw new TypeError(`Parsed value is not a string: ${t}`);return t}#p(e){if(e.sourceText==="null")return null;if(e.sourceText==="true")return!0;if(e.sourceText==="false")return!1;let t;try{t=JSON.parse(e.sourceText)}catch{throw new SyntaxError(n(e))}if(typeof t!="number")throw new TypeError(`Parsed value is not a number: ${t}`);return t}};function n({type:s,sourceText:e,position:t}){let r="";switch(s){case"BeginObject":r="{";break;case"EndObject":r="}";break;case"BeginArray":r="[";break;case"EndArray":r="]";break;case"NameSeparator":r=":";break;case"ValueSeparator":r=",";break;case"NullOrTrueOrFalseOrNumber":case"String":r=30<e.length?`${e.slice(0,30)}...`:e;break}return`Cannot parse JSONC: unexpected token "${r}" in JSONC at position ${t}`}export{c as a};
@@ -0,0 +1,18 @@
1
+ var D={arrays:"merge",sets:"merge",maps:"merge"};function p(t,e,r){return O(t,e,new Set,r??D)}function O(t,e,r,n){let o={},s=new Set([...I(t),...I(e)]);for(let c of s){if(c==="__proto__")continue;let f=t[c];if(!Object.hasOwn(e,c)){o[c]=f;continue}let h=e[c];if(S(f)&&S(h)&&!r.has(f)&&!r.has(h)){r.add(f),r.add(h),o[c]=G(f,h,r,n);continue}o[c]=h}return o}function G(t,e,r,n){if(E(t)&&E(e))return O(t,e,r,n);if(_(t)&&_(e)){if(Array.isArray(t)&&Array.isArray(e))return n.arrays==="merge"?t.concat(e):e;if(t instanceof Map&&e instanceof Map){if(n.maps==="merge"){let o=new Map(t);for(let[s,c]of e)o.set(s,c);return o}return e}if(t instanceof Set&&e instanceof Set){if(n.sets==="merge"){let o=new Set(t);for(let s of e)o.add(s);return o}return e}}return e}function E(t){return Object.getPrototypeOf(t)===Object.prototype}function _(t){return typeof t[Symbol.iterator]=="function"}function S(t){return t!==null&&typeof t=="object"}function I(t){let e=Object.keys(t),r=Object.getOwnPropertySymbols(t);if(r.length===0)return e;for(let n of r)Object.prototype.propertyIsEnumerable.call(t,n)&&e.push(n);return e}function X(t){return t%4===0&&t%100!==0||t%400===0}var x=class{#r=/[ \t]/;#t=0;#e;constructor(e){this.#e=e}get position(){return this.#t}get source(){return this.#e}char(e=0){return this.#e[this.#t+e]??""}slice(e,r){return this.#e.slice(this.#t+e,this.#t+r)}next(e=1){this.#t+=e}skipWhitespaces(){for(;this.#r.test(this.char())&&!this.eof();)this.next();if(!this.isCurrentCharEOL()&&/\s/.test(this.char())){let e="\\u"+this.char().charCodeAt(0).toString(16),r=this.#t;throw new SyntaxError(`Cannot parse the TOML: It contains invalid whitespace at position '${r}': \`${e}\``)}}nextUntilChar(e={skipComments:!0}){for(;!this.eof();){let r=this.char();if(this.#r.test(r)||this.isCurrentCharEOL())this.next();else if(e.skipComments&&this.char()==="#")for(;!this.isCurrentCharEOL()&&!this.eof();)this.next();else break}}eof(){return this.#t>=this.#e.length}isCurrentCharEOL(){return this.char()===`
2
+ `||this.startsWith(`\r
3
+ `)}startsWith(e){return this.#e.startsWith(e,this.#t)}match(e){if(!e.sticky)throw new Error(`RegExp ${e} does not have a sticky 'y' flag`);return e.lastIndex=this.#t,this.#e.match(e)}};function i(t){return{ok:!0,body:t}}function u(){return{ok:!1}}function d(t,e={__proto__:null}){return t.reduceRight((r,n)=>({[n]:r}),e)}function $(t){return typeof t=="object"&&t!==null}function A(t,e){let r=e[0];if(!r)throw new Error("Cannot parse the TOML: key length is not a positive number");return t[r]}function Y(t,e){let{keys:r,type:n,value:o}=e,s=A(t,r);if(s===void 0)return Object.assign(t,d(r,o));if(Array.isArray(s)){let c=s.at(-1);return a(c,{type:n,keys:r.slice(1),value:o}),t}if($(s))return a(s,{type:n,keys:r.slice(1),value:o}),t;throw new Error("Unexpected assign")}function v(t,e){let{type:r,keys:n,value:o}=e,s=A(t,n);if(s===void 0)return Object.assign(t,d(n,[o]));if(Array.isArray(s)){if(e.keys.length===1)s.push(o);else{let c=s.at(-1);a(c,{type:e.type,keys:e.keys.slice(1),value:e.value})}return t}if($(s))return a(s,{type:r,keys:n.slice(1),value:o}),t;throw new Error("Unexpected assign")}function a(t,e){switch(e.type){case"Block":return p(t,e.value);case"Table":return Y(t,e);case"TableArray":return v(t,e)}}function g(t){return e=>{for(let r of t){let n=r(e);if(n.ok)return n}return u()}}function B(t,e){let r=l(e);return n=>{let o=[],s=t(n);if(!s.ok)return i(o);for(o.push(s.body);!n.eof()&&r(n).ok;){let c=t(n);if(!c.ok)throw new SyntaxError(`Invalid token after "${e}"`);o.push(c.body)}return i(o)}}function F(t,e){let r=l(e);return n=>{let o=t(n);if(!o.ok)return u();let s=[o.body];for(;!n.eof()&&r(n).ok;){let c=t(n);if(!c.ok)throw new SyntaxError(`Invalid token after "${e}"`);s.push(c.body)}return i(s)}}function V(t,e,r){let n=l(e);return o=>{let s=o.position,c=t(o);if(!c.ok)return u();if(!n(o).ok)throw new SyntaxError(`key/value pair doesn't have "${e}"`);let h=r(o);if(!h.ok){let w=o.source.indexOf(`
4
+ `,o.position),U=w>0?w:o.source.length,M=o.source.slice(s,U);throw new SyntaxError(`Cannot parse value on line '${M}'`)}return i(d(c.body,h.body))}}function J(t){return e=>{let r=t(e);if(!r.ok)return u();let n={__proto__:null};for(let o of r.body)typeof o=="object"&&o!==null&&(n=p(n,o));return i(n)}}function C(t){return e=>{let r=[];for(;!e.eof();){let n=t(e);if(!n.ok)break;r.push(n.body),e.nextUntilChar()}return r.length===0?u():i(r)}}function b(t,e,r){let n=l(t),o=l(r);return s=>{if(!n(s).ok)return u();let c=e(s);if(!c.ok)throw new SyntaxError(`Invalid token after "${t}"`);if(!o(s).ok)throw new SyntaxError(`Not closed by "${r}" after started with "${t}"`);return i(c.body)}}function l(t){return e=>(e.skipWhitespaces(),e.startsWith(t)?(e.next(t.length),e.skipWhitespaces(),i(void 0)):u())}var K=/[A-Za-z0-9_-]+/y;function H(t){t.skipWhitespaces();let e=t.match(K)?.[0];return e?(t.next(e.length),i(e)):u()}function T(t){if(t.char()!=="\\")return u();switch(t.next(),t.char()){case"b":return t.next(),i("\b");case"t":return t.next(),i(" ");case"n":return t.next(),i(`
5
+ `);case"f":return t.next(),i("\f");case"r":return t.next(),i("\r");case"u":case"U":{let e=t.char()==="u"?4:6,r=parseInt("0x"+t.slice(1,1+e),16),n=String.fromCodePoint(r);return t.next(e+1),i(n)}case'"':return t.next(),i('"');case"\\":return t.next(),i("\\");default:throw new SyntaxError(`Invalid escape sequence: \\${t.char()}`)}}function N(t){if(t.skipWhitespaces(),t.char()!=='"')return u();t.next();let e=[];for(;t.char()!=='"'&&!t.eof();){if(t.char()===`
6
+ `)throw new SyntaxError("Single-line string cannot contain EOL");let r=T(t);r.ok?e.push(r.body):(e.push(t.char()),t.next())}if(t.eof())throw new SyntaxError(`Single-line string is not closed:
7
+ ${e.join("")}`);return t.next(),i(e.join(""))}function j(t){if(t.skipWhitespaces(),t.char()!=="'")return u();t.next();let e=[];for(;t.char()!=="'"&&!t.eof();){if(t.char()===`
8
+ `)throw new SyntaxError("Single-line string cannot contain EOL");e.push(t.char()),t.next()}if(t.eof())throw new SyntaxError(`Single-line string is not closed:
9
+ ${e.join("")}`);return t.next(),i(e.join(""))}function z(t){if(t.skipWhitespaces(),!t.startsWith('"""'))return u();t.next(3),t.char()===`
10
+ `?t.next():t.startsWith(`\r
11
+ `)&&t.next(2);let e=[];for(;!t.startsWith('"""')&&!t.eof();){if(t.startsWith(`\\
12
+ `)){t.next(),t.nextUntilChar({skipComments:!1});continue}else if(t.startsWith(`\\\r
13
+ `)){t.next(),t.nextUntilChar({skipComments:!1});continue}let r=T(t);r.ok?e.push(r.body):(e.push(t.char()),t.next())}if(t.eof())throw new SyntaxError(`Multi-line string is not closed:
14
+ ${e.join("")}`);return t.char(3)==='"'&&(e.push('"'),t.next()),t.next(3),i(e.join(""))}function Z(t){if(t.skipWhitespaces(),!t.startsWith("'''"))return u();t.next(3),t.char()===`
15
+ `?t.next():t.startsWith(`\r
16
+ `)&&t.next(2);let e=[];for(;!t.startsWith("'''")&&!t.eof();)e.push(t.char()),t.next();if(t.eof())throw new SyntaxError(`Multi-line string is not closed:
17
+ ${e.join("")}`);return t.char(3)==="'"&&(e.push("'"),t.next()),t.next(3),i(e.join(""))}var q=/(?:true|false)\b/y;function Q(t){t.skipWhitespaces();let e=t.match(q);if(!e)return u();let r=e[0];return t.next(r.length),i(r==="true")}var tt=new Map([["inf",1/0],["+inf",1/0],["-inf",-1/0]]),et=/[+-]?inf\b/y;function rt(t){t.skipWhitespaces();let e=t.match(et);if(!e)return u();let r=e[0];t.next(r.length);let n=tt.get(r);return i(n)}var nt=/[+-]?nan\b/y;function ot(t){t.skipWhitespaces();let e=t.match(nt);if(!e)return u();let r=e[0];return t.next(r.length),i(NaN)}var m=F(g([H,N,j]),"."),it=/0b[01]+(?:_[01]+)*\b/y;function st(t){t.skipWhitespaces();let e=t.match(it)?.[0];if(!e)return u();t.next(e.length);let r=e.slice(2).replaceAll("_",""),n=parseInt(r,2);return isNaN(n)?u():i(n)}var ut=/0o[0-7]+(?:_[0-7]+)*\b/y;function ct(t){t.skipWhitespaces();let e=t.match(ut)?.[0];if(!e)return u();t.next(e.length);let r=e.slice(2).replaceAll("_",""),n=parseInt(r,8);return isNaN(n)?u():i(n)}var ht=/0x[0-9a-f]+(?:_[0-9a-f]+)*\b/yi;function ft(t){t.skipWhitespaces();let e=t.match(ht)?.[0];if(!e)return u();t.next(e.length);let r=e.slice(2).replaceAll("_",""),n=parseInt(r,16);return isNaN(n)?u():i(n)}var at=/[+-]?(?:0|[1-9][0-9]*(?:_[0-9]+)*)\b/y;function lt(t){t.skipWhitespaces();let e=t.match(at)?.[0];if(!e)return u();t.next(e.length);let r=e.replaceAll("_",""),n=parseInt(r,10);return i(n)}var pt=/[+-]?(?:0|[1-9][0-9]*(?:_[0-9]+)*)(?:\.[0-9]+(?:_[0-9]+)*)?(?:e[+-]?[0-9]+(?:_[0-9]+)*)?\b/yi;function yt(t){t.skipWhitespaces();let e=t.match(pt)?.[0];if(!e)return u();t.next(e.length);let r=e.replaceAll("_",""),n=parseFloat(r);return isNaN(n)?u():i(n)}var xt=/(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})(?:[ 0-9TZ.:+-]+)?\b/y;function dt(t){t.skipWhitespaces();let e=t.match(xt);if(!e)return u();let r=e[0];t.next(r.length);let n=e.groups;if(n.month=="02"){let s=parseInt(n.day);if(s>29)throw new SyntaxError(`Invalid date string "${e}"`);let c=parseInt(n.year);if(s>28&&!X(c))throw new SyntaxError(`Invalid date string "${e}"`)}let o=new Date(r.trim());if(isNaN(o.getTime()))throw new SyntaxError(`Invalid date string "${e}"`);return i(o)}var gt=/(\d{2}):(\d{2}):(\d{2})(?:\.[0-9]+)?\b/y;function bt(t){t.skipWhitespaces();let e=t.match(gt)?.[0];return e?(t.next(e.length),i(e)):u()}function mt(t){if(t.skipWhitespaces(),t.char()!=="[")return u();t.next();let e=[];for(;!t.eof();){t.nextUntilChar();let r=P(t);if(!r.ok||(e.push(r.body),t.skipWhitespaces(),t.char()!==","))break;t.next()}if(t.nextUntilChar(),t.char()!=="]")throw new SyntaxError("Array is not closed");return t.next(),i(e)}function kt(t){if(t.nextUntilChar(),t.char(1)==="}")return t.next(2),i({__proto__:null});let e=b("{",B(W,","),"}")(t);if(!e.ok)return u();let r={__proto__:null};for(let n of e.body)r=p(r,n);return i(r)}var P=g([z,Z,N,j,Q,rt,ot,dt,bt,st,ct,ft,yt,lt,mt,kt]),W=V(m,"=",P);function k(t){t.nextUntilChar();let e=J(C(W))(t);return e.ok?i({type:"Block",value:e.body}):u()}var wt=b("[",m,"]");function Et(t){t.nextUntilChar();let e=wt(t);if(!e.ok)return u();t.nextUntilChar();let r=k(t);return i({type:"Table",keys:e.body,value:r.ok?r.body.value:{__proto__:null}})}var _t=b("[[",m,"]]");function St(t){t.nextUntilChar();let e=_t(t);if(!e.ok)return u();t.nextUntilChar();let r=k(t);return i({type:"TableArray",keys:e.body,value:r.ok?r.body.value:{__proto__:null}})}function R(t){let e=C(g([k,St,Et]))(t);if(!e.ok)return i({__proto__:null});let r=e.body.reduce(a,{__proto__:null});return i(r)}function y(t,e){let n=t.source.slice(0,t.position).split(`
18
+ `),o=n.length,s=n.at(-1)?.length??0;return`Parse error on line ${o}, column ${s}: ${e}`}function L(t){return e=>{let r=new x(e);try{let n=t(r);if(n.ok&&r.eof())return n.body;let o=`Unexpected character: "${r.char()}"`;throw new SyntaxError(y(r,o))}catch(n){if(n instanceof Error)throw new SyntaxError(y(r,n.message));let o="Invalid error type caught";throw new SyntaxError(y(r,o))}}}function Ct(t){return L(R)(t)}export{Ct as a};
@@ -0,0 +1 @@
1
+ import{a as k,b as p,c as h,e as m,f as u,g as f}from"./chunk-7QNRH7OR.js";import{a as c}from"./chunk-OLM5RTFK.js";var y=class{capabilities=["text_generation","streaming","tool_calling"];provider="claude-code";modelId;binary;config;constructor(e,n){this.binary=e,this.config=n,this.modelId=n.model}async generateText(e,n){let r=w(this.config,e,"json"),s=f(e.messages,e.system);r.push("-p",s);let o=p(this.binary,r,{signal:n}),l=m(o.stderr),i=o.stdout.getReader(),a=[],d=new TextDecoder,g=await i.read();for(;g.done!==!0;)a.push(d.decode(g.value,{stream:!0})),g=await i.read();i.releaseLock();let T=await o.waitForExit(),_=await l,x=u("claude-code",T.code,_);if(x!==null)throw x;let S=a.join("");return v(S,this.modelId)}async*streamText(e,n){let r=this.config.properties?.streamFormat??"text",s=w(this.config,e,r),o=f(e.messages,e.system);s.push("-p",o);let l=p(this.binary,s,{signal:n}),i=m(l.stderr);try{r==="stream-json"?yield*this.#t(l,i):yield*this.#e(l,i)}catch(a){a instanceof c?yield{kind:"error",error:a}:yield{kind:"error",error:new c(a instanceof Error?a.message:String(a),{provider:"claude-code",cause:a instanceof Error?a:void 0})}}}async*#e(e,n){let r=new TextDecoder,s=e.stdout.getReader(),o=await s.read();for(;o.done!==!0;){let d=r.decode(o.value,{stream:!0});d.length>0&&(yield{kind:"content_delta",textDelta:d}),o=await s.read()}s.releaseLock();let l=await e.waitForExit(),i=await n,a=u("claude-code",l.code,i);a!==null?yield{kind:"error",error:a}:yield{kind:"message_done",stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0}}}async*#t(e,n){for await(let l of h(e.stdout)){let i=E(l);i!==null&&(yield i)}let r=await e.waitForExit(),s=await n,o=u("claude-code",r.code,s);o!==null&&(yield{kind:"error",error:o})}close(){return Promise.resolve()}getRawClient(){return null}},P={provider:"claude-code",async createModel(t){let e=await k("claude",t);return new y(e,t)}},w=(t,e,n)=>{let r=[];n!=="text"&&r.push("--output-format",n),n==="stream-json"&&r.push("--verbose"),r.push("--model",t.model);let s=t.properties?.maxTurns;s!==void 0&&r.push("--max-turns",String(s));let o=t.properties?.allowedTools;if(o!==void 0)for(let i of o)r.push("--allowedTools",i);let l=t.properties?.args;return l!==void 0&&r.push(...l),r},v=(t,e)=>{try{let n=JSON.parse(t);return b(n,e)}catch{return{content:[{kind:"text",text:t.trim()}],stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0},modelId:e}}},b=(t,e)=>{let n=[];if(t.result!==void 0)n.push({kind:"text",text:String(t.result)});else if(t.message?.content!==void 0)for(let r of t.message.content)r.type==="text"?n.push({kind:"text",text:r.text}):r.type==="tool_use"&&n.push({kind:"tool_call",toolCall:{id:r.id??r.name,name:r.name,arguments:r.input??{}}});else typeof t=="string"&&n.push({kind:"text",text:t});return n.length===0&&n.push({kind:"text",text:JSON.stringify(t)}),{content:n,stopReason:t.stop_reason==="tool_use"?"tool_use":"end_turn",usage:{inputTokens:t.usage?.input_tokens??0,outputTokens:t.usage?.output_tokens??0,totalTokens:(t.usage?.input_tokens??0)+(t.usage?.output_tokens??0)},modelId:e,rawResponse:t}},E=t=>{if(t===null||typeof t!="object")return null;let e=t;if(e.type==="assistant"){if(e.message?.content!==void 0){for(let n of e.message.content)if(n.type==="text")return{kind:"content_delta",textDelta:n.text}}return null}return e.type==="content_block_delta"?e.delta?.type==="text_delta"?{kind:"content_delta",textDelta:e.delta.text}:null:e.type==="result"?{kind:"message_done",stopReason:e.subtype==="tool_use"?"tool_use":"end_turn",usage:{inputTokens:e.usage?.input_tokens??0,outputTokens:e.usage?.output_tokens??0,totalTokens:(e.usage?.input_tokens??0)+(e.usage?.output_tokens??0)}}:e.type==="error"?{kind:"error",error:new c(e.error?.message??"Unknown Claude Code error",{provider:"claude-code"})}:e.content!==void 0&&typeof e.content=="string"?{kind:"content_delta",textDelta:e.content}:null};export{y as a,P as b};
@@ -0,0 +1 @@
1
+ var u=[["go.mod","go"],["deno.json","deno"],["deno.jsonc","deno"],["package.json","node"]],l=async r=>{for(let[c,n]of u)try{return await Deno.stat(`${r}/${c}`),{type:n,configFile:c}}catch{}return{type:"unknown",configFile:void 0}},p=(r,c)=>{let n=[],t=[],e=r.dependencies;if(e===void 0)return{instructions:n,warnings:t};let i=r.language,o=c.type;if(o!=="unknown"&&(i==="go"&&o==="go"||i==="typescript"&&(o==="deno"||o==="node")||i==="javascript"&&(o==="deno"||o==="node")||t.push(`Recipe '${r.name}' is for ${i}, but detected ${o} project (${c.configFile}).`)),e.go!==void 0&&e.go.length>0)for(let s of e.go)n.push(`go get ${s}`);if(e.jsr!==void 0&&e.jsr.length>0)for(let s of e.jsr)n.push(`deno add ${s}`);if(e.npm!==void 0&&e.npm.length>0)for(let s of e.npm)n.push(`npm install ${s}`);return{instructions:n,warnings:t}},g=async(r,c,n)=>{let t=[];for(let e of r){if(n?.dryRun===!0){t.push({command:e,success:!0});continue}n?.verbose===!0&&console.log(` [install] ${e}`);let i=e.split(/\s+/),o=i[0],s=i.slice(1);try{let d=await new Deno.Command(o,{args:s,cwd:c,stdout:"inherit",stderr:"inherit"}).output();if(!d.success){t.push({command:e,success:!1,error:`Exit code ${d.code}`});break}t.push({command:e,success:!0})}catch(a){let d=a instanceof Error?a.message:String(a);t.push({command:e,success:!1,error:d});break}}return t};export{l as a,p as b,g as c};
@@ -0,0 +1 @@
1
+ import{a as i}from"./chunk-VFMYWG2I.js";import{a as o}from"./chunk-GXPLME3K.js";var a=i({name:"validate-yaml",description:"Validate YAML syntax",canFix:!1,stacks:[],defaults:{},extensions:[".yml",".yaml"],checkFile(e,r){if(r===void 0)return[];try{return o(r),[]}catch(t){let n=t instanceof Error?t.message:"invalid YAML";return[{path:e.path,message:n}]}}}),p=a.run,d=a.validator,u=a.main;export{a,p as b,d as c,u as d};
@@ -0,0 +1 @@
1
+ var r={name:"@eser/cli",version:"4.1.22",type:"module",exports:"./main.ts",bin:{eser:"./bin.ts"},dependencies:{"@eser/ai":"workspace:*","@eser/codebase":"workspace:*","@eser/kit":"workspace:*","@eser/noskills":"workspace:*","@eser/laroux-server":"workspace:*","@eser/workflows":"workspace:*","@eser/functions":"workspace:*","@eser/logging":"workspace:*","@eser/shell":"workspace:*","@eser/standards":"workspace:*","@std/cli":"npm:@jsr/std__cli@^1.0.25","@std/fmt":"npm:@jsr/std__fmt@^1.0.8"},devDependencies:{"@std/assert":"npm:@jsr/std__assert@^1.0.16",esbuild:"^0.27.3"}};export{r as a};
@@ -0,0 +1 @@
1
+ var o=e=>e==="inherit"?"inherit":e==="piped"?"pipe":"ignore";var d=e=>({stdin:e?.stdin??"null",stdout:e?.stdout??"piped",stderr:e?.stderr??"piped"}),i=e=>{let t=d(e);return[o(t.stdin),o(t.stdout),o(t.stderr)]};export{d as a,i as b};
@@ -0,0 +1 @@
1
+ import{c as y,d as h,e as k,f as T}from"./chunk-PLRSDG6G.js";import{a as m,e as p}from"./chunk-OLM5RTFK.js";var c=class{capabilities=["text_generation","streaming","tool_calling","vision","audio","structured_output","reasoning"];provider="vertexai";modelId;client;config;constructor(e,t){this.client=e,this.config=t,this.modelId=t.model}async generateText(e,t){let r=x(this.config,e);try{let o=await this.client.models.generateContent({model:this.config.model,...r,config:{...r.config,httpOptions:t!==void 0?{signal:t}:void 0}});return k(o,this.modelId)}catch(o){throw v(o)}}async*streamText(e,t){let r=x(this.config,e);try{let o=await this.client.models.generateContentStream({model:this.config.model,...r,config:{...r.config,httpOptions:t!==void 0?{signal:t}:void 0}}),a=0,s=0;for await(let l of o){let g=l?.candidates??[];if(g.length>0){let f=g[0],C=f?.content?.parts??[];for(let i of C)i.text!==void 0&&(yield{kind:"content_delta",textDelta:i.text}),i.functionCall!==void 0&&(yield{kind:"tool_call_delta",toolCall:{id:i.functionCall.name,name:i.functionCall.name,arguments:i.functionCall.args??{}}});let d=f?.finishReason;if(d!=null){let i=l?.usageMetadata;a=i?.promptTokenCount??a,s=i?.candidatesTokenCount??s;let u="end_turn";d==="MAX_TOKENS"&&(u="max_tokens"),yield{kind:"message_done",stopReason:u,usage:{inputTokens:a,outputTokens:s,totalTokens:a+s}}}}}}catch(o){yield{kind:"error",error:v(o)}}}async close(){}getRawClient(){return this.client}},w={provider:"vertexai",async createModel(n){let{GoogleGenAI:e}=await import("./node-RWYXITVV.js"),t={vertexai:!0,project:n.projectId,location:n.location??"us-central1"};n.apiKey!==void 0&&(t.apiKey=n.apiKey);let r=new e(t);return new c(r,n)}},x=(n,e)=>{let{contents:t,systemInstruction:r}=y(e.messages),o={maxOutputTokens:e.maxTokens??n.maxTokens};e.temperature!==void 0&&(o.temperature=e.temperature),e.topP!==void 0&&(o.topP=e.topP),e.stopWords!==void 0&&(o.stopSequences=e.stopWords),e.responseFormat!==void 0&&e.responseFormat.type==="json_schema"&&(o.responseMimeType="application/json",o.responseSchema=e.responseFormat.jsonSchema),e.thinkingBudget!==void 0&&(o.thinkingConfig={thinkingBudget:e.thinkingBudget});let a={contents:t,config:o},s=e.system??r;return s!=null&&(a.systemInstruction=s),e.tools!==void 0&&(a.tools=h(e.tools)),e.safetySettings!==void 0&&(a.safetySettings=e.safetySettings),a},v=n=>{if(n instanceof m)return n;let e=n instanceof Error?n:new Error(String(n)),t=T(n);return p("vertexai",t,e)};export{c as a,w as b};
@@ -0,0 +1 @@
1
+ var n=async function*(){},u=n.constructor,o=function*(){},T=o.constructor,t=async()=>{},p=t.constructor;var c=globalThis.Function;
@@ -0,0 +1,3 @@
1
+ import{a as S,b as g,d as T,e as m,f,g as y}from"./chunk-7QNRH7OR.js";import{a as l}from"./chunk-OLM5RTFK.js";var k=class{capabilities=["text_generation","streaming"];provider="kiro";modelId;binary;config;constructor(e,r){this.binary=e,this.config=r,this.modelId=r.model}async generateText(e,r){let o=v(this.config,e),c=y(e.messages,e.system);o.push("--prompt",c);let s=g(this.binary,o,{signal:r}),u=m(s.stderr),t=await T(s.stdout,this.modelId),d=await s.waitForExit(),i=await u,a=f("kiro",d.code,i);if(a!==null)throw a;return t}async*streamText(e,r){let o=v(this.config,e),c=y(e.messages,e.system);o.push("--prompt",c);let s=g(this.binary,o,{signal:r}),u=m(s.stderr);try{let t=new TextDecoder,d=s.stdout.getReader(),i="",a=await d.read();for(;a.done!==!0;){i+=t.decode(a.value,{stream:!0});let x=i.split(`
2
+ `);i=x.pop()??"";for(let _ of x){let p=_.trim();if(p.length!==0){try{let A=JSON.parse(p),w=C(A);if(w!==null){yield w;continue}}catch{}yield{kind:"content_delta",textDelta:p+`
3
+ `}}}a=await d.read()}d.releaseLock(),i.trim().length>0&&(yield{kind:"content_delta",textDelta:i.trim()});let E=await s.waitForExit(),b=await u,h=f("kiro",E.code,b);h!==null?yield{kind:"error",error:h}:yield{kind:"message_done",stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0}}}catch(t){t instanceof l?yield{kind:"error",error:t}:yield{kind:"error",error:new l(t instanceof Error?t.message:String(t),{provider:"kiro",cause:t instanceof Error?t:void 0})}}}close(){return Promise.resolve()}getRawClient(){return null}},O={provider:"kiro",async createModel(n){let e=await S("kiro",n);return new k(e,n)}},v=(n,e)=>{let r=[];r.push("--output","json"),r.push("--model",n.model),e.maxTokens!==void 0&&r.push("--max-tokens",String(e.maxTokens));let o=n.properties?.args;return o!==void 0&&r.push(...o),r},C=n=>{if(n===null||typeof n!="object")return null;let e=n;if(e.type==="content"||e.type==="text"){let r=e.text??e.content;return r!==void 0?{kind:"content_delta",textDelta:String(r)}:null}return e.type==="done"||e.type==="result"||e.done===!0?{kind:"message_done",stopReason:"end_turn",usage:{inputTokens:e.usage?.input_tokens??0,outputTokens:e.usage?.output_tokens??0,totalTokens:(e.usage?.input_tokens??0)+(e.usage?.output_tokens??0)}}:e.type==="error"?{kind:"error",error:new l(e.error?.message??e.message??"Unknown Kiro error",{provider:"kiro"})}:null};export{k as a,O as b};
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-DRQWYJMH.js";var i=new e({description:"AI provider interface \u2014 ask questions, generate content",modules:{ask:{description:"Send a prompt to an AI provider",load:()=>import("./ask-752YJEHO.js")},list:{description:"List available AI providers",load:()=>import("./list-UZKWSA4S.js")}}});export{i as a};
@@ -0,0 +1 @@
1
+ var e=/\.(?:[cm]?[jt]sx?)$/,n=["tsx","jsx","ts","js","mts","mjs","cts","cjs"];function r(t,s){return t.replace(e,s)}export{e as a,n as b,r as c};
@@ -0,0 +1 @@
1
+ import{b as a,c as l,d}from"./chunk-OLM5RTFK.js";var i=r=>({...r,maxTokens:r.maxTokens??1024,temperature:r.temperature??.7,requestTimeoutMs:r.requestTimeoutMs??6e4});var y=class{models=new Map;factories=new Map;constructor(e){if(e?.factories!==void 0)for(let o of e.factories)this.factories.set(o.provider,o)}registerFactory(e){this.factories.set(e.provider,e)}async addModel(e,o){if(this.models.has(e))throw new l(e);let t=this.factories.get(o.provider);if(t===void 0)throw new d(o.provider);let n=i(o),s=await t.createModel(n);return this.models.set(e,s),s}async removeModel(e){let o=this.models.get(e);if(o===void 0)throw new a(e);await o.close(),this.models.delete(e)}getDefault(){let e=this.models.get("default");if(e!==void 0)return e;let o=this.models.values().next();return o.done===!0?null:o.value}getNamed(e){return this.models.get(e)??null}getByProvider(e){let o=[];for(let t of this.models.values())t.provider===e&&o.push(t);return o}getByCapability(e){let o=[];for(let t of this.models.values())t.capabilities.includes(e)&&o.push(t);return o}listModels(){return[...this.models.keys()]}listRegisteredProviders(){return[...this.factories.keys()]}async loadFromConfig(e){let o=Object.entries(e.targets);for(let[t,n]of o)await this.addModel(t,n)}async close(){let e=[];for(let o of this.models.values())e.push(o.close());await Promise.all(e),this.models.clear()}};var c=r=>{let e=[];for(let o of r.content)o.kind==="text"&&e.push(o.text);return e.join("")};export{y as a,c as b};
@@ -0,0 +1 @@
1
+ import{b as o,d as l}from"./chunk-NUSNMQPL.js";import{d as n}from"./chunk-DQAEQEXD.js";import{d as E}from"./chunk-DXB73IDG.js";var i={};E(i,{adaptError:()=>d,bind:()=>u,createTrigger:()=>c});var d=(e,r)=>({_tag:"AdaptError",message:e,source:r}),u=(e,r)=>s=>{let t=r(s);return n(t)?o(t.error):e(t.value)},c=e=>async(r,...s)=>{let t=u(e.handler,e.adaptInput),p=await l(t(r),...s);return e.adaptOutput(p)};export{i as a};
@@ -0,0 +1,2 @@
1
+ import{g as h,i as w}from"./chunk-SCULX2ND.js";var f=class extends Error{constructor(r){super(`Required variable '${r}' has no value and no default`),this.name="MissingVariableError"}},R=(e,r)=>{let t={};for(let n of e){let a=r[n.name];if(a!==void 0)t[n.name]=a;else if(n.default!==void 0)t[n.name]=n.default;else throw new f(n.name)}return t},m=(e,r)=>e.replace(/\{\{\s*\.(\w+)\s*\}\}/g,(t,n)=>n in r?r[n]:t);var p=class extends Error{constructor(r){super(`Circular dependency detected: ${r.join(" \u2192 ")}`),this.name="CyclicDependencyError"}},u=class extends Error{constructor(r,t){super(`Recipe '${r}' requires '${t}', which is not in the registry`),this.name="MissingDependencyError"}},v=(e,r)=>{let t=new Map;for(let s of r)t.set(s.name,s);if(t.get(e)===void 0)throw new u("<root>",e);let a=[],i=new Set,o=new Set,l=(s,d)=>{if(i.has(s))return;if(o.has(s))throw new p([...d,s]);let c=t.get(s);if(c===void 0)throw new u(d[d.length-1]??"<root>",s);if(o.add(s),c.requires!==void 0)for(let g of c.requires)l(g,[...d,s]);o.delete(s),i.add(s),a.push(c)};return l(e,[]),a};var b=(e,r)=>{let t=e.endsWith("/")?e:`${e}/`,n=new URL(r,`file://${t}`).pathname;return n.startsWith(t)||n===e},$=async e=>{let r=e.split("/");r.pop();let t=r.join("/");t!==""&&t!=="."&&await Deno.mkdir(t,{recursive:!0})},y=async e=>{try{return await Deno.stat(e),!0}catch{return!1}},x=(e,r)=>r===void 0||Object.keys(r).length===0?e:m(e,r),A=async(e,r,t,n)=>{let a=`${r.cwd}/${e.target}`;if(n.includes(e.target))return;if(r.skipExisting===!0&&await y(a)){r.verbose===!0&&console.log(` [skip] ${e.target} (already exists)`),n.push(e.target);return}if(r.dryRun===!0){console.log(` [dry-run] would write ${e.target}`),t.push(e.target);return}r.verbose===!0&&console.log(` [write] ${e.target}`);let i=await h(r.registryUrl,e.source),o=x(i,r.variables);await $(a),await Deno.writeTextFile(a,o),t.push(e.target)},F=async(e,r,t,n)=>{let a=await w(r.registryUrl,e.source);for(let i of a){let o=`${e.target}/${i.path}`;if(!b(r.cwd,o))throw new Error(`Folder recipe contains path traversal in '${o}'. Aborting.`)}for(let i of a){let o=`${e.target}/${i.path}`,l=`${r.cwd}/${o}`;if(r.skipExisting===!0&&await y(l)){n.push(o);continue}if(r.dryRun===!0){console.log(` [dry-run] would write ${o}`),t.push(o);continue}r.verbose===!0&&console.log(` [write] ${o}`);let s=x(i.content,r.variables);await $(l),await Deno.writeTextFile(l,s),t.push(o)}},E=async(e,r,t,n)=>{let a=[];for(let i of e){if(t===!0){console.log(` [dry-run] would run: ${i}`),a.push(i);continue}n===!0&&console.log(` [post-install] ${i}`);let o=i.split(/\s+/),s=await new Deno.Command(o[0],{args:o.slice(1),cwd:r,stdout:"inherit",stderr:"inherit"}).output();if(!s.success)throw new Error(`Post-install command failed: '${i}' (exit code ${s.code})`);a.push(i)}return a},C=async(e,r)=>{let t=[],n=[],a=e.files.length,i=r.variables;e.variables!==void 0&&e.variables.length>0&&(i=R(e.variables,r.variables??{}));let o={...r,variables:i};for(let s of e.files)if((s.kind??"file")==="file"&&!b(r.cwd,s.target))throw new Error(`Recipe '${e.name}' contains path traversal in target '${s.target}'. Aborting.`);if(r.force!==!0&&r.skipExisting!==!0)for(let s of e.files){if((s.kind??"file")!=="file")continue;let c=`${r.cwd}/${s.target}`;await y(c)&&(r.dryRun===!0?console.log(` [conflict] ${s.target} (already exists)`):(console.warn(` Warning: ${s.target} already exists. Use --force to overwrite or --skip-existing to skip.`),n.push(s.target)))}for(let s of e.files){let d=s.kind??"file";try{d==="folder"?await F(s,o,t,n):await A(s,o,t,n)}catch(c){let g=c instanceof Error?c.message:String(c);throw new Error(`Failed applying '${s.target}'. ${t.length} files written so far. Retry with \`eser kit add ${e.name} --force\`. Cause: ${g}`)}}let l=[];return e.postInstall!==void 0&&e.postInstall.length>0&&(l=await E(e.postInstall,r.cwd,r.dryRun,r.verbose)),{written:t,skipped:n,total:a,postInstallRan:l}},q=async(e,r,t)=>{let n=v(e,r),a=[];for(let i of n){t.verbose===!0&&console.log(`
2
+ Applying recipe: ${i.name}`);let o=await C(i,t);a.push({name:i.name,result:o})}return{recipes:a}};export{b as a,y as b,x as c,E as d,C as e,q as f};
@@ -0,0 +1 @@
1
+ import{a as s}from"./chunk-GXPLME3K.js";import{t}from"./chunk-GRTR6TNJ.js";import{b as a}from"./chunk-QXTK62N4.js";var i=[".manifest.yml",".manifest.yaml"],l=async o=>{for(let e of i){let n=t.path.join(o,e);try{let r=await t.fs.readTextFile(n);return s(r)}catch(r){if(r instanceof a)continue;throw r}}return null},m=async o=>{for(let e of i){let n=t.path.join(o,e);try{return await t.fs.stat(n),n}catch{continue}}return null};export{i as a,l as b,m as c};
@@ -0,0 +1,32 @@
1
+ import{a as $}from"./chunk-RGUC6KAZ.js";import{e as x}from"./chunk-OBIEQJDE.js";import{t as c}from"./chunk-GRTR6TNJ.js";import{Scanner as ie}from"@tailwindcss/oxide";import{compile as j}from"tailwindcss";async function L(e,s){if(e.startsWith(".")||e.startsWith("/")){let r=c.path.resolve(s,e),n=await c.fs.readTextFile(r);return{path:r,content:n,base:c.path.dirname(r)}}let t=s;for(;t!=="/"&&t!=="";){let r=c.path.resolve(t,"node_modules",e);try{let n=await c.fs.readTextFile(r);return{path:r,content:n,base:c.path.dirname(r)}}catch{if(!e.endsWith(".css")){let a=`${r}.css`;try{let o=await c.fs.readTextFile(a);return{path:a,content:o,base:c.path.dirname(a)}}catch{}}let n=c.path.resolve(t,"node_modules",e,"index.css");try{let a=await c.fs.readTextFile(n);return{path:n,content:a,base:c.path.dirname(n)}}catch{t=c.path.dirname(t)}}}let l=c.path.resolve(s,e),i=await c.fs.readTextFile(l);return{path:l,content:i,base:c.path.dirname(l)}}async function w(e,s){let t=await j(e,{base:s.base,loadStylesheet:L}),l=s.candidates??[];return t.build(l)}function v(e,s){return w(e,{base:s,candidates:[]})}var R=["theme","base","properties"],P=[/^\.(flex|grid|block|inline|hidden)/,/^\.(items-|justify-|gap-|space-)/,/^\.(w-|h-|min-h-|max-w-)/,/^\.(p-|px-|py-|pt-|pb-|pl-|pr-)/,/^\.(m-|mx-|my-|mt-|mb-|ml-|mr-)/,/^\.(text-|font-|leading-)/,/^\.(bg-|border-)/,/^\.(from-|via-|to-)/,/^\.(container|wrapper)/,/^\.(rounded|shadow)/,/^\.(overflow-)/,/^\.(sm:|md:|lg:|xl:)/],B=[/--tw-gradient/,/--tw-rotate/,/--tw-scale/,/--tw-skew/,/--tw-translate/,/--tw-shadow/,/--tw-ring/,/--tw-blur/,/--tw-brightness/];function N(){return{criticalLayers:R,aboveFoldPatterns:P,forceInclude:[],forceExclude:[]}}var b=x.getLogger(["laroux-bundler","critical-page-css"]);function W(e,s){let t=s;for(;t<e.length&&e[t]!=="{";)t++;if(t>=e.length)return null;let l=t+1,i=1;for(t++;t<e.length&&i>0;)e[t]==="{"?i++:e[t]==="}"&&i--,t++;return{innerContent:e.slice(l,t-1).trim(),end:t}}function V(e){let s=[],t="@keyframes",l=0;for(;l<e.length;){let i=e.indexOf(t,l);if(i===-1)break;let r=i+t.length;for(;r<e.length&&/\s/.test(e[r]??"");)r++;let n=r;for(;n<e.length&&e[n]!=="{"&&!/\s/.test(e[n]??"");)n++;let a=e.slice(r,n),o=n;for(;o<e.length&&e[o]!=="{";)o++;if(o>=e.length){l=e.length;break}let g=1,u=o+1;for(;u<e.length&&g>0;)e[u]==="{"?g++:e[u]==="}"&&g--,u++;let d=e.slice(i,u);s.push({name:a,block:d}),l=u}return s}function Z(e){let s=new Map,t=new Map,l=new Map,i=/@layer\s+([a-zA-Z_-][a-zA-Z0-9_-]*)\s*[{;]/g,r;for(;(r=i.exec(e))!==null;){let n=r[1];if(n===void 0||r[0].endsWith(";"))continue;let a=W(e,r.index+r[0].length-1);a&&(t.has(n)||(t.set(n,[]),l.set(n,{start:r.index,end:a.end})),t.get(n).push(a.innerContent),l.get(n).end=a.end)}for(let[n,a]of t){let o=a.join(`
2
+ `),g=l.get(n);s.set(n,{block:`@layer ${n} {
3
+ ${o}
4
+ }`,start:g.start,end:g.end})}return s}function Y(e){let s=[],t=0;for(;t<e.length;){for(;t<e.length&&/\s/.test(e[t]);)t++;if(t>=e.length)break;let l=t;for(;t<e.length&&e[t]!=="{";)t++;if(t>=e.length)break;let i=e.slice(l,t).trim();if(!i){t++;continue}let r=1;for(t++;t<e.length&&r>0;)e[t]==="{"?r++:e[t]==="}"&&r--,t++;let n=e.slice(l,t);i.startsWith("@media")||i.startsWith("@supports")?s.push({selector:"@media",full:n}):i&&!i.startsWith("@")&&s.push({selector:i,full:n})}return s}function H(e,s){let t=e.match(/\.([a-zA-Z_-][a-zA-Z0-9_\-\\:/.[\]]*)/g);if(t)for(let r of t){let n=r.substring(1);if(n=n.replace(/\\/g,""),n=n.split(":")[0]??"",n&&new RegExp(`class=["'][^"']*\\b${q(n)}\\b`,"i").test(s))return!0}let l=e.match(/^([a-zA-Z][a-zA-Z0-9-]*)/);if(l&&l[1]){let r=l[1].toLowerCase();if(new RegExp(`<${r}[\\s>]`,"i").test(s))return!0}let i=e.match(/#([a-zA-Z_-][a-zA-Z0-9_-]*)/g);if(i)for(let r of i){let n=r.substring(1);if(new RegExp(`id=["']${n}["']`,"i").test(s))return!0}return!1}function q(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function z(e,s){return s.some(t=>typeof t=="string"?e.includes(t):t.test(e))}function K(e){return P.some(s=>s.test(e))}function k(e){let{html:s,css:t,forceInclude:l=[],forceExclude:i=[]}=e;b.debug("Extracting critical page CSS (Tailwind v4 aware)...");let r=[],n=[],a=0,o=0,g=t.match(/^\/\*![\s\S]*?\*\//);g&&r.push(g[0]);let u=t.match(/@layer\s+[\w,-]{1,200}(?:\s+[\w,-]{1,50})*\s*;/);u&&r.push(u[0]);let d=/@property\s+--[\w-]+\s*\{[^}]{0,5000}\}/g,f=t.match(d)??[];f.length>0&&(r.push(f.join(`
5
+ `)),a+=f.length,b.debug(` @property rules: ${f.length} (CRITICAL)`));let h=Z(t);for(let[p,y]of h)if(R.includes(p))r.push(y.block),a++,b.debug(` @layer ${p}: CRITICAL (required)`);else if(p==="utilities"){let{critical:m,deferred:C}=O(y.block,s,l,i);m.trim()&&(r.push(`@layer utilities {
6
+ ${m}
7
+ }`),a+=m.split("}").length-1),C.trim()&&(n.push(`@layer utilities {
8
+ ${C}
9
+ }`),o+=C.split("}").length-1),b.debug(" @layer utilities: split")}else if(p==="components"){let{critical:m,deferred:C}=O(y.block,s,l,i);m.trim()&&(r.push(`@layer components {
10
+ ${m}
11
+ }`),a++),C.trim()&&(n.push(`@layer components {
12
+ ${C}
13
+ }`),o++)}else n.push(y.block),o++;let A=/@font-face\s*\{[^}]{0,10000}\}/gi,D=t.match(A)??[];for(let p of D)r.push(p),a++;let M=V(t);for(let p of M)p.name&&s.includes(p.name)?(r.push(p.block),a++):(n.push(p.block),o++);let I=r.join(`
14
+
15
+ `),_=n.join(`
16
+
17
+ `),T={originalSize:new TextEncoder().encode(t).length,criticalSize:new TextEncoder().encode(I).length,deferredSize:new TextEncoder().encode(_).length,criticalRules:a,deferredRules:o};return b.debug(`Critical: ${T.criticalSize} bytes (${a} parts), Deferred: ${T.deferredSize} bytes (${o} parts)`),{critical:I,deferred:_,stats:T}}function O(e,s,t,l){let i=e.replace(/^@layer\s+\w+\s*\{/,"").replace(/\}$/,"").trim(),r=Y(i),n=[],a=[];for(let o of r){if(o.selector==="@media"){o.full.includes("@media")&&(o.full.includes("min-width")||o.full.includes("max-width"))?n.push(o.full):a.push(o.full);continue}if(z(o.selector,l)){a.push(o.full);continue}if(z(o.selector,t)){n.push(o.full);continue}let g=H(o.selector,s),u=K(o.selector);g||u?n.push(o.full):a.push(o.full)}return{critical:n.join(`
18
+ `),deferred:a.join(`
19
+ `)}}function X(e){return`<script>
20
+ (function(){
21
+ var l=document.createElement('link');
22
+ l.rel='stylesheet';
23
+ l.href='${e}';
24
+ l.media='print';
25
+ l.onload=function(){this.media='all'};
26
+ document.head.appendChild(l);
27
+ })();
28
+ </script>
29
+ <noscript><link rel="stylesheet" href="${e}"></noscript>`}var U=x.getLogger(["laroux-bundler","critical-universal-css"]),G=["html",":host","html, :host","body","#root",".initial-loading","[data-client-component]"],J=["*","*, ::after, ::before","*, ::after, ::before, ::backdrop, ::file-selector-button","a","button","h1","h2","h3","h4","h5","h6","h1, h2, h3, h4, h5, h6"];function E(e,s){let l=new RegExp(`@layer\\s+${s}\\s*\\{`,"g").exec(e);if(!l)return null;let i=l.index+l[0].length,r=1,n=i;for(;n<e.length&&r>0;)e[n]==="{"?r++:e[n]==="}"&&r--,n++;return e.slice(i,n-1).trim()}function Q(e){let s=[],t=/([^{}]+)\{([^{}]*)\}/g,l;for(;(l=t.exec(e))!==null;){let i=l[1],r=l[2];if(i===void 0||r===void 0)continue;let n=i.trim(),a=r.trim();n&&a&&s.push({selector:n,declarations:a})}return s}function ee(e){let s=e.trim().toLowerCase();for(let t of J)if(s===t.toLowerCase()||s.startsWith("a ")||s.startsWith("a,")||s.startsWith("button ")||s.startsWith("button,"))return!1;for(let t of G){if(s===t.toLowerCase())return!0;let l=s.split(",").map(r=>r.trim()),i=t.toLowerCase().split(",").map(r=>r.trim());if(l.some(r=>i.includes(r))||i.some(r=>l.includes(r)))return!0}return!1}function te(e){let s={},t=/(--[\w-]+):\s*([^;]+);/g,l;for(;(l=t.exec(e))!==null;){let[,i,r]=l;i&&r&&(s[i]=r.trim())}return s}function S(e){U.debug("Extracting critical universal CSS from compiled output...");let s=[],t=0,l=E(e,"theme"),i=l?te(l):{};s.push("*,*::before,*::after{box-sizing:border-box}"),t++;let r=E(e,"base");if(r){let o=[r],g=e.indexOf(r)+r.length;for(;g<e.length;){let u=E(e.slice(g),"base");if(u)o.push(u),g+=e.slice(g).indexOf(u)+u.length;else break}for(let u of o){let d=Q(u);for(let f of d)if(ee(f.selector)){let h=f.declarations.replace(/\s+/g," ").replace(/;\s*/g,";").replace(/:\s*/g,":").trim();h&&(s.push(`${f.selector}{${h}}`),t++)}}}let n=s.join(`
30
+ `),a={variableCount:Object.keys(i).length,rulesExtracted:t,size:new TextEncoder().encode(n).length};return U.debug(`Extracted critical universal CSS: ${a.size} bytes, ${a.rulesExtracted} rules, ${a.variableCount} theme variables`),{css:n,themeVariables:i,stats:a}}function re(e){return S(e).css.replace(/\n+/g,"").replace(/\s*{\s*/g,"{").replace(/\s*}\s*/g,"}").replace(/\s*;\s*/g,";").replace(/\s*:\s*/g,":").replace(/;\}/g,"}")}function ne(e){return E(e,"theme")}var se="html{scrollbar-gutter:stable}*,*::before,*::after{box-sizing:border-box}";var le=x.getLogger(["laroux-bundler","tailwindcss"]);function ae(e={}){let{globalCssPath:s="src/app/styles/global.css",autoInjectReference:t=!0,detectPatterns:l=[/@tailwind\b/,/@apply\b/,/@import\s+["']tailwindcss/]}=e;return{name:"tailwindcss",shouldProcess(i,r){return l.some(n=>n.test(i))},preprocess(i,r){if(r.isModule&&i.includes("@apply")){let n=i,a=/^@reference\s+/m.test(i);if(t&&!a){let o=c.path.dirname(r.cssPath),g=c.path.resolve(r.projectRoot,s);n=`@reference "${c.path.relative(o,g)}";
31
+
32
+ ${i}`}return v(n,c.path.dirname(r.cssPath))}return i},async compile(i,r){let n=c.path.dirname(r.cssPath),a=c.path.resolve(r.projectRoot,"src"),o=[];for await(let d of $(a,"**/*.{tsx,ts,jsx,js}",/node_modules/)){let f=c.path.resolve(a,d),h=c.path.extname(d),A=await c.fs.readTextFile(f);o.push({content:A,extension:h.slice(1)})}let u=new ie({}).scanFiles(o);return le.debug(`Scanned ${o.length} files, found ${Array.isArray(u)?u.length:0} candidates`),w(i,{base:n,candidates:u})},extractCriticalCss(i,r,n){let a=k({css:i,html:r,forceInclude:n?.forceInclude,forceExclude:n?.forceExclude});return{critical:a.critical,deferred:a.deferred,stats:{originalSize:a.stats.originalSize,criticalSize:a.stats.criticalSize,deferredSize:a.stats.deferredSize}}},extractUniversalCss(i){let r=S(i);return{css:r.css,themeVariables:r.themeVariables}}}}export{L as a,w as b,v as c,R as d,P as e,B as f,N as g,k as h,X as i,S as j,re as k,ne as l,se as m,ae as n};
@@ -0,0 +1,3 @@
1
+ import{a as i}from"./chunk-OLM5RTFK.js";import{a as d,b as c}from"./chunk-DOV5776P.js";var y=async(r,t)=>{let e=t.properties?.binPath;if(e!==void 0)return e;try{let n=await c`which ${r}`.noThrow().text();if(n.length>0)return n}catch{}throw new i(`Binary "${r}" not found. Set properties.binPath in config or ensure it is on PATH.`,{provider:r})},f=(r,t,e)=>{let s=new d(r,[...t],{stdin:"null",stdout:"piped",stderr:"piped",cwd:e?.cwd,env:e?.env}).child();if(e?.signal!==void 0){let o=e.signal;o.aborted?s.kill("SIGTERM"):o.addEventListener("abort",()=>{s.kill("SIGTERM")},{once:!0})}return{stdout:s.stdout,stderr:s.stderr,waitForExit:async()=>{let o=await s.status;return{code:o.code,success:o.success}},kill:o=>{s.kill(o??"SIGTERM")}}},a=new TextDecoder;async function*m(r){let t=r.getReader(),e="";try{let n=await t.read();for(;n.done!==!0;){e+=a.decode(n.value,{stream:!0});let o=e.split(`
2
+ `);e=o.pop()??"";for(let u of o){let l=u.trim();if(l.length!==0)try{yield JSON.parse(l)}catch{}}n=await t.read()}let s=e.trim();if(s.length>0)try{yield JSON.parse(s)}catch{}}finally{t.releaseLock()}}var h=async(r,t)=>{let e=r.getReader(),n=[],s=await e.read();for(;s.done!==!0;)n.push(a.decode(s.value,{stream:!0})),s=await e.read();return e.releaseLock(),{content:[{kind:"text",text:n.join("").trim()}],stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0},modelId:t}},w=async r=>{let t=r.getReader(),e=[],n=await t.read();for(;n.done!==!0;)e.push(a.decode(n.value,{stream:!0})),n=await t.read();return t.releaseLock(),e.join("").trim()},x=(r,t,e)=>{if(t===0)return null;let n=e.length>0?`${r} exited with code ${t}: ${e}`:`${r} exited with code ${t}`;return t===1?new i(n,{provider:r}):t===126||t===127?new i(`${r} binary not found or not executable (exit code ${t})`,{provider:r}):new i(n,{provider:r})},b=(r,t)=>{let e=[];t!==void 0&&(e.push(t),e.push(""));for(let n of r)for(let s of n.content)s.kind==="text"&&e.push(s.text);return e.join(`
3
+ `)};export{y as a,f as b,m as c,h as d,w as e,x as f,b as g};
@@ -0,0 +1 @@
1
+ import{a as n,g as i,h as l}from"./chunk-ZE5T64HQ.js";var a={" ":"%09","\n":"%0A","\v":"%0B","\f":"%0C","\r":"%0D"," ":"%20"};function t(e){return e.replaceAll(/[\s]/g,o=>a[o]??o)}function s(e){if(!i(e))throw new TypeError(`Path must be absolute: received "${e}"`);let o=new URL("file:///");return o.pathname=t(e.replace(/%/g,"%25").replace(/\\/g,"%5C")),o}function m(e){if(!l(e))throw new TypeError(`Path must be absolute: received "${e}"`);let[,o,u]=e.match(/^(?:[/\\]{2}([^/\\]+)(?=[/\\](?:[^/\\]|$)))?(.*)/),r=new URL("file:///");if(r.pathname=t(u.replace(/%/g,"%25")),o!==void 0&&o!=="localhost"&&(r.hostname=o,!r.hostname))throw new TypeError(`Invalid hostname: "${r.hostname}"`);return r}function E(e){return n?m(e):s(e)}export{E as a};