outfitter 0.3.2 → 0.3.4

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 (256) hide show
  1. package/README.md +33 -5
  2. package/dist/actions/add.d.ts +18 -0
  3. package/dist/actions/add.js +14 -0
  4. package/dist/actions/check-automation.d.ts +20 -0
  5. package/dist/actions/check-automation.js +27 -0
  6. package/dist/actions/check.d.ts +34 -0
  7. package/dist/actions/check.js +19 -0
  8. package/dist/actions/demo.d.ts +12 -0
  9. package/dist/actions/demo.js +11 -0
  10. package/dist/actions/docs-output-mode.d.ts +4 -0
  11. package/dist/actions/docs-output-mode.js +8 -0
  12. package/dist/actions/docs.d.ts +25 -0
  13. package/dist/actions/docs.js +31 -0
  14. package/dist/actions/doctor.d.ts +10 -0
  15. package/dist/actions/doctor.js +15 -0
  16. package/dist/actions/init.d.ts +28 -0
  17. package/dist/actions/init.js +31 -0
  18. package/dist/actions/scaffold.d.ts +19 -0
  19. package/dist/actions/scaffold.js +21 -0
  20. package/dist/actions/shared.d.ts +61 -0
  21. package/dist/actions/shared.js +30 -0
  22. package/dist/actions/upgrade.d.ts +17 -0
  23. package/dist/actions/upgrade.js +21 -0
  24. package/dist/actions.d.ts +2 -0
  25. package/dist/actions.js +66 -0
  26. package/dist/cli.js +66 -4
  27. package/dist/commands/add.d.ts +54 -0
  28. package/dist/commands/add.js +16 -0
  29. package/dist/commands/check-action-ceremony.d.ts +55 -0
  30. package/dist/commands/check-action-ceremony.js +15 -0
  31. package/dist/commands/check-docs-sentinel.d.ts +27 -0
  32. package/dist/commands/check-docs-sentinel.js +18 -0
  33. package/dist/commands/check-orchestrator.d.ts +2 -0
  34. package/dist/commands/check-orchestrator.js +17 -0
  35. package/dist/commands/check-preset-versions.d.ts +20 -0
  36. package/dist/commands/check-preset-versions.js +15 -0
  37. package/dist/commands/check-publish-guardrails.d.ts +38 -0
  38. package/dist/commands/check-publish-guardrails.js +19 -0
  39. package/dist/commands/check-surface-map-format.d.ts +29 -0
  40. package/dist/commands/check-surface-map-format.js +19 -0
  41. package/dist/commands/check-surface-map.d.ts +20 -0
  42. package/dist/commands/check-surface-map.js +15 -0
  43. package/dist/commands/check-tsdoc.d.ts +3 -0
  44. package/dist/commands/check-tsdoc.js +9 -0
  45. package/dist/commands/check.d.ts +93 -0
  46. package/dist/commands/check.js +14 -0
  47. package/dist/commands/demo.d.ts +21 -0
  48. package/dist/commands/demo.js +8 -0
  49. package/dist/commands/docs-api.d.ts +4 -0
  50. package/dist/commands/docs-api.js +13 -0
  51. package/dist/commands/docs-export.d.ts +4 -0
  52. package/dist/commands/docs-export.js +12 -0
  53. package/dist/commands/docs-list.d.ts +3 -0
  54. package/dist/commands/docs-list.js +13 -0
  55. package/dist/commands/docs-module-loader.d.ts +2 -0
  56. package/dist/commands/docs-module-loader.js +8 -0
  57. package/dist/commands/docs-search.d.ts +3 -0
  58. package/dist/commands/docs-search.js +13 -0
  59. package/dist/commands/docs-show.d.ts +3 -0
  60. package/dist/commands/docs-show.js +13 -0
  61. package/dist/commands/docs-types.d.ts +21 -0
  62. package/dist/commands/docs-types.js +1 -0
  63. package/dist/commands/doctor.d.ts +2 -0
  64. package/dist/commands/doctor.js +17 -0
  65. package/dist/commands/init-execution.d.ts +8 -0
  66. package/dist/commands/init-execution.js +11 -0
  67. package/dist/commands/init-option-resolution.d.ts +5 -0
  68. package/dist/commands/init-option-resolution.js +14 -0
  69. package/dist/commands/init-output.d.ts +9 -0
  70. package/dist/commands/init-output.js +11 -0
  71. package/dist/commands/init.d.ts +9 -0
  72. package/dist/commands/init.js +24 -0
  73. package/dist/commands/jq-utils.d.ts +17 -0
  74. package/dist/commands/jq-utils.js +8 -0
  75. package/dist/commands/repo.d.ts +3 -0
  76. package/dist/commands/repo.js +13 -0
  77. package/dist/commands/scaffold-output.d.ts +4 -0
  78. package/dist/commands/scaffold-output.js +11 -0
  79. package/dist/commands/scaffold-planning.d.ts +65 -0
  80. package/dist/commands/scaffold-planning.js +20 -0
  81. package/dist/commands/scaffold.d.ts +4 -0
  82. package/dist/commands/scaffold.js +26 -0
  83. package/dist/commands/shared-deps.d.ts +22 -0
  84. package/dist/commands/shared-deps.js +11 -0
  85. package/dist/commands/upgrade-apply.d.ts +14 -0
  86. package/dist/commands/upgrade-apply.js +8 -0
  87. package/dist/commands/upgrade-codemods.d.ts +47 -0
  88. package/dist/commands/upgrade-codemods.js +14 -0
  89. package/dist/commands/upgrade-latest-version.d.ts +8 -0
  90. package/dist/commands/upgrade-latest-version.js +8 -0
  91. package/dist/commands/upgrade-migration-docs.d.ts +3 -0
  92. package/dist/commands/upgrade-migration-docs.js +15 -0
  93. package/dist/commands/upgrade-migration-frontmatter.d.ts +2 -0
  94. package/dist/commands/upgrade-migration-frontmatter.js +10 -0
  95. package/dist/commands/upgrade-migration-guides.d.ts +5 -0
  96. package/dist/commands/upgrade-migration-guides.js +10 -0
  97. package/dist/commands/upgrade-output.d.ts +5 -0
  98. package/dist/commands/upgrade-output.js +11 -0
  99. package/dist/commands/upgrade-planner.d.ts +58 -0
  100. package/dist/commands/upgrade-planner.js +8 -0
  101. package/dist/commands/upgrade-report.d.ts +5 -0
  102. package/dist/commands/upgrade-report.js +8 -0
  103. package/dist/commands/upgrade-workspace.d.ts +2 -0
  104. package/dist/commands/upgrade-workspace.js +16 -0
  105. package/dist/commands/upgrade.d.ts +5 -0
  106. package/dist/commands/upgrade.js +37 -0
  107. package/dist/create/index.d.ts +5 -0
  108. package/dist/create/index.js +2 -0
  109. package/dist/create/planner.d.ts +3 -0
  110. package/dist/create/planner.js +85 -0
  111. package/dist/create/presets.d.ts +3 -0
  112. package/dist/create/presets.js +12 -0
  113. package/dist/create/types.d.ts +2 -0
  114. package/dist/create/types.js +1 -0
  115. package/dist/engine/blocks.d.ts +3 -0
  116. package/dist/engine/blocks.js +12 -0
  117. package/dist/engine/collector.d.ts +2 -0
  118. package/dist/engine/collector.js +8 -0
  119. package/dist/engine/config.d.ts +3 -0
  120. package/dist/engine/config.js +15 -0
  121. package/dist/engine/dependency-versions.d.ts +17 -0
  122. package/dist/engine/dependency-versions.js +12 -0
  123. package/dist/engine/executor.d.ts +3 -0
  124. package/dist/engine/executor.js +156 -0
  125. package/dist/engine/index.d.ts +10 -0
  126. package/dist/engine/index.js +54 -0
  127. package/dist/engine/names.d.ts +2 -0
  128. package/dist/engine/names.js +24 -0
  129. package/dist/engine/post-scaffold.d.ts +3 -0
  130. package/dist/engine/post-scaffold.js +8 -0
  131. package/dist/engine/preset.d.ts +3 -0
  132. package/dist/engine/preset.js +17 -0
  133. package/dist/engine/render-plan.d.ts +7 -0
  134. package/dist/engine/render-plan.js +9 -0
  135. package/dist/engine/template.d.ts +4 -0
  136. package/dist/engine/template.js +34 -0
  137. package/dist/engine/types.d.ts +2 -0
  138. package/dist/engine/types.js +8 -0
  139. package/dist/engine/workspace.d.ts +3 -0
  140. package/dist/engine/workspace.js +20 -0
  141. package/dist/index.d.ts +17 -397
  142. package/dist/index.js +7 -165
  143. package/dist/manifest.d.ts +71 -0
  144. package/dist/manifest.js +16 -0
  145. package/dist/output-mode.d.ts +2 -0
  146. package/dist/output-mode.js +10 -0
  147. package/dist/shared/outfitter-109s75x0.d.ts +76 -0
  148. package/dist/shared/outfitter-1fy7byz5.js +170 -0
  149. package/dist/shared/outfitter-1gmrtapz.js +325 -0
  150. package/dist/shared/outfitter-1h7k8xxt.js +29 -0
  151. package/dist/shared/outfitter-1tfa9hke.d.ts +55 -0
  152. package/dist/shared/outfitter-2nx0k4b3.d.ts +4 -0
  153. package/dist/shared/outfitter-2ysjerp6.d.ts +44 -0
  154. package/dist/shared/outfitter-2z61gp5w.js +29 -0
  155. package/dist/shared/outfitter-34vg353f.d.ts +82 -0
  156. package/dist/shared/outfitter-3dq4r10s.d.ts +24 -0
  157. package/dist/shared/outfitter-3rcrvva8.js +103 -0
  158. package/dist/shared/outfitter-3tx3adgj.js +278 -0
  159. package/dist/shared/outfitter-4q1zfmvc.js +154 -0
  160. package/dist/shared/outfitter-4s9meh3j.js +221 -0
  161. package/dist/shared/outfitter-507ra35w.js +285 -0
  162. package/dist/shared/outfitter-56jq0rh2.d.ts +42 -0
  163. package/dist/shared/outfitter-58rn1sj1.d.ts +30 -0
  164. package/dist/shared/outfitter-5d9wbzhh.d.ts +19 -0
  165. package/dist/shared/outfitter-5j7zee11.d.ts +180 -0
  166. package/dist/shared/outfitter-5r6q2749.d.ts +18 -0
  167. package/dist/shared/outfitter-5vx1bp7h.js +41 -0
  168. package/dist/shared/outfitter-6ddf91vh.js +190 -0
  169. package/dist/shared/outfitter-6mpkh3zn.js +432 -0
  170. package/dist/shared/outfitter-6rtcemk7.d.ts +18 -0
  171. package/dist/shared/outfitter-6t7xeyg1.js +159 -0
  172. package/dist/shared/outfitter-738z4c37.js +262 -0
  173. package/dist/shared/outfitter-76k25svs.js +322 -0
  174. package/dist/shared/outfitter-7n7vsz95.js +101 -0
  175. package/dist/shared/outfitter-7q9fnbwa.js +60 -0
  176. package/dist/shared/outfitter-7r12fj7f.js +30 -0
  177. package/dist/shared/outfitter-8ggmja91.js +301 -0
  178. package/dist/shared/outfitter-8kmak0wc.d.ts +4 -0
  179. package/dist/shared/outfitter-8y2dfx6n.js +11 -0
  180. package/dist/shared/outfitter-940h0x7b.js +71 -0
  181. package/dist/shared/outfitter-954y4mzx.d.ts +5 -0
  182. package/dist/shared/outfitter-a79xrm12.d.ts +17 -0
  183. package/dist/shared/outfitter-b9cpnr7e.js +110 -0
  184. package/dist/shared/outfitter-bpr28y54.js +70 -0
  185. package/dist/shared/outfitter-c7sbs7es.js +92 -0
  186. package/dist/shared/outfitter-cyhzstz0.js +93 -0
  187. package/dist/shared/outfitter-cyvr4r8d.d.ts +67 -0
  188. package/dist/shared/outfitter-d0kqashd.d.ts +98 -0
  189. package/dist/shared/outfitter-dmfac1w9.js +306 -0
  190. package/dist/shared/outfitter-e84cr97g.js +232 -0
  191. package/dist/shared/outfitter-ec83h4v2.js +17 -0
  192. package/dist/shared/outfitter-eepj7rf7.js +4 -0
  193. package/dist/shared/outfitter-ekb6t1zz.js +35 -0
  194. package/dist/shared/outfitter-ex8gn945.js +51 -0
  195. package/dist/shared/outfitter-f3a70135.js +75 -0
  196. package/dist/shared/outfitter-fbvfd5zq.d.ts +13 -0
  197. package/dist/shared/outfitter-fj2v5ffz.js +165 -0
  198. package/dist/shared/outfitter-fx1m251y.js +122 -0
  199. package/dist/shared/outfitter-fxry5n58.js +254 -0
  200. package/dist/shared/outfitter-g3hvjshg.js +1 -0
  201. package/dist/shared/outfitter-gdc7b7de.d.ts +5 -0
  202. package/dist/shared/outfitter-gyayfx5r.js +156 -0
  203. package/dist/shared/outfitter-h0wmtxw8.d.ts +23 -0
  204. package/dist/shared/outfitter-hcexcvxe.d.ts +25 -0
  205. package/dist/shared/outfitter-hf5bj2gq.js +117 -0
  206. package/dist/shared/outfitter-hsp8vy5m.d.ts +146 -0
  207. package/dist/shared/outfitter-htx4asgr.d.ts +52 -0
  208. package/dist/shared/outfitter-jwxggvz4.js +42 -0
  209. package/dist/shared/outfitter-ksyvwmb5.js +191 -0
  210. package/dist/shared/outfitter-m3ehh37q.d.ts +22 -0
  211. package/dist/shared/outfitter-mstr60zz.js +215 -0
  212. package/dist/shared/outfitter-n0ed012k.js +101 -0
  213. package/dist/shared/outfitter-n13pqaft.js +19 -0
  214. package/dist/shared/outfitter-nxvjxrmw.d.ts +48 -0
  215. package/dist/shared/outfitter-p2wn07b7.js +160 -0
  216. package/dist/shared/outfitter-px5sv5gn.js +321 -0
  217. package/dist/shared/outfitter-q1g58t85.js +8 -0
  218. package/dist/shared/outfitter-qsd5638j.js +378 -0
  219. package/dist/shared/outfitter-qsrx7m4w.js +72 -0
  220. package/dist/shared/outfitter-r2awqszh.d.ts +52 -0
  221. package/dist/shared/outfitter-rdpw2sbp.d.ts +77 -0
  222. package/dist/shared/outfitter-rp89dafm.js +109 -0
  223. package/dist/shared/outfitter-s1c0whzj.js +121 -0
  224. package/dist/shared/outfitter-ssrtakh3.js +342 -0
  225. package/dist/shared/outfitter-ssynegbs.js +167 -0
  226. package/dist/shared/outfitter-svts4wk2.js +36 -0
  227. package/dist/shared/outfitter-tavatb5p.js +166 -0
  228. package/dist/shared/outfitter-tqznjgbm.js +44 -0
  229. package/dist/shared/outfitter-ttjr95y9.js +98 -0
  230. package/dist/shared/outfitter-wcrp7d7m.d.ts +5 -0
  231. package/dist/shared/outfitter-wkt0a0ra.js +67 -0
  232. package/dist/shared/outfitter-wrcqq29p.js +132 -0
  233. package/dist/shared/outfitter-wyg1tpp5.d.ts +43 -0
  234. package/dist/shared/outfitter-x0vpb7tj.js +126 -0
  235. package/dist/shared/outfitter-x39awx8g.js +146 -0
  236. package/dist/shared/outfitter-x4cc5xsq.js +168 -0
  237. package/dist/shared/outfitter-x8w5sjnd.d.ts +39 -0
  238. package/dist/shared/outfitter-xr6g13nz.d.ts +50 -0
  239. package/dist/shared/outfitter-xs94pkfe.js +106 -0
  240. package/dist/shared/outfitter-xwzjgswj.js +488 -0
  241. package/dist/shared/outfitter-y37yfehn.d.ts +37 -0
  242. package/dist/shared/outfitter-y6ee0k45.d.ts +18 -0
  243. package/dist/shared/outfitter-ydw7x6bh.js +61 -0
  244. package/dist/shared/outfitter-yhb23pjc.js +89 -0
  245. package/dist/shared/outfitter-ypcvwg1s.js +91 -0
  246. package/dist/shared/outfitter-yywcypw8.js +53 -0
  247. package/dist/shared/outfitter-znbqe5zy.d.ts +45 -0
  248. package/dist/shared/outfitter-zng6w0t9.d.ts +4 -0
  249. package/dist/targets/index.d.ts +4 -0
  250. package/dist/targets/index.js +28 -0
  251. package/dist/targets/registry.d.ts +3 -0
  252. package/dist/targets/registry.js +221 -0
  253. package/dist/targets/types.d.ts +2 -0
  254. package/dist/targets/types.js +1 -0
  255. package/package.json +194 -35
  256. package/dist/shared/chunk-3pwh8ys4.js +0 -6461
@@ -0,0 +1,325 @@
1
+ // @bun
2
+ import {
3
+ checkTsdocOutputSchema
4
+ } from "./outfitter-dmfac1w9.js";
5
+ import {
6
+ resolveDocsOutputMode
7
+ } from "./outfitter-ec83h4v2.js";
8
+ import {
9
+ outputModeSchema,
10
+ resolveCwdFromPreset,
11
+ resolveStringFlag
12
+ } from "./outfitter-7n7vsz95.js";
13
+ import {
14
+ printDocsListResults,
15
+ runDocsList
16
+ } from "./outfitter-yhb23pjc.js";
17
+ import {
18
+ printDocsApiResults,
19
+ runDocsApi
20
+ } from "./outfitter-cyhzstz0.js";
21
+ import {
22
+ printDocsSearchResults,
23
+ runDocsSearch
24
+ } from "./outfitter-hf5bj2gq.js";
25
+ import {
26
+ printDocsExportResults,
27
+ runDocsExport
28
+ } from "./outfitter-940h0x7b.js";
29
+ import {
30
+ printDocsShowResults,
31
+ runDocsShow
32
+ } from "./outfitter-c7sbs7es.js";
33
+
34
+ // apps/outfitter/src/actions/docs.ts
35
+ import { cwdPreset } from "@outfitter/cli/flags";
36
+ import { jqPreset, outputModePreset } from "@outfitter/cli/query";
37
+ import { defineAction, Result } from "@outfitter/contracts";
38
+ import { z } from "zod";
39
+ var docsListInputSchema = z.object({
40
+ cwd: z.string(),
41
+ kind: z.string().optional(),
42
+ package: z.string().optional(),
43
+ jq: z.string().optional(),
44
+ outputMode: outputModeSchema
45
+ });
46
+ var docsListCwd = cwdPreset();
47
+ var docsListOutputMode = outputModePreset({ includeJsonl: true });
48
+ var docsListJq = jqPreset();
49
+ var docsListAction = defineAction({
50
+ id: "docs.list",
51
+ description: "List documentation entries from the docs map",
52
+ surfaces: ["cli"],
53
+ input: docsListInputSchema,
54
+ cli: {
55
+ group: "docs",
56
+ command: "list",
57
+ description: "List documentation entries from the docs map",
58
+ options: [
59
+ {
60
+ flags: "-k, --kind <kind>",
61
+ description: "Filter by doc kind (readme, guide, reference, architecture, release, convention, deep, generated)"
62
+ },
63
+ {
64
+ flags: "-p, --package <name>",
65
+ description: "Filter by package name"
66
+ },
67
+ ...docsListOutputMode.options,
68
+ ...docsListJq.options,
69
+ ...docsListCwd.options
70
+ ],
71
+ mapInput: (context) => {
72
+ const { outputMode: presetOutputMode } = docsListOutputMode.resolve(context.flags);
73
+ const { jq } = docsListJq.resolve(context.flags);
74
+ const outputMode = resolveDocsOutputMode(context.flags, presetOutputMode);
75
+ const kind = resolveStringFlag(context.flags["kind"]);
76
+ const pkg = resolveStringFlag(context.flags["package"]);
77
+ return {
78
+ cwd: resolveCwdFromPreset(context.flags, docsListCwd),
79
+ outputMode,
80
+ jq,
81
+ ...kind !== undefined ? { kind } : {},
82
+ ...pkg !== undefined ? { package: pkg } : {}
83
+ };
84
+ }
85
+ },
86
+ handler: async (input) => {
87
+ const { outputMode, jq } = input;
88
+ const result = await runDocsList(input);
89
+ if (result.isErr()) {
90
+ return result;
91
+ }
92
+ await printDocsListResults(result.value, { mode: outputMode, jq });
93
+ return Result.ok(result.value);
94
+ }
95
+ });
96
+ var docsShowInputSchema = z.object({
97
+ id: z.string(),
98
+ cwd: z.string(),
99
+ jq: z.string().optional(),
100
+ outputMode: outputModeSchema
101
+ });
102
+ var docsShowCwd = cwdPreset();
103
+ var docsShowOutputMode = outputModePreset({ includeJsonl: true });
104
+ var docsShowJq = jqPreset();
105
+ var docsShowAction = defineAction({
106
+ id: "docs.show",
107
+ description: "Show a specific documentation entry and its content",
108
+ surfaces: ["cli"],
109
+ input: docsShowInputSchema,
110
+ cli: {
111
+ group: "docs",
112
+ command: "show <id>",
113
+ description: "Show a specific documentation entry and its content",
114
+ options: [
115
+ ...docsShowOutputMode.options,
116
+ ...docsShowJq.options,
117
+ ...docsShowCwd.options
118
+ ],
119
+ mapInput: (context) => {
120
+ const { outputMode: presetOutputMode } = docsShowOutputMode.resolve(context.flags);
121
+ const { jq } = docsShowJq.resolve(context.flags);
122
+ const outputMode = resolveDocsOutputMode(context.flags, presetOutputMode);
123
+ return {
124
+ id: context.args[0],
125
+ cwd: resolveCwdFromPreset(context.flags, docsShowCwd),
126
+ jq,
127
+ outputMode
128
+ };
129
+ }
130
+ },
131
+ handler: async (input) => {
132
+ const { outputMode, jq } = input;
133
+ const result = await runDocsShow(input);
134
+ if (result.isErr()) {
135
+ return result;
136
+ }
137
+ await printDocsShowResults(result.value, { mode: outputMode, jq });
138
+ return Result.ok(result.value);
139
+ }
140
+ });
141
+ var docsSearchInputSchema = z.object({
142
+ query: z.string(),
143
+ cwd: z.string(),
144
+ kind: z.string().optional(),
145
+ package: z.string().optional(),
146
+ jq: z.string().optional(),
147
+ outputMode: outputModeSchema
148
+ });
149
+ var docsSearchCwd = cwdPreset();
150
+ var docsSearchOutputMode = outputModePreset({ includeJsonl: true });
151
+ var docsSearchJq = jqPreset();
152
+ var docsSearchAction = defineAction({
153
+ id: "docs.search",
154
+ description: "Search documentation content for a query string",
155
+ surfaces: ["cli"],
156
+ input: docsSearchInputSchema,
157
+ cli: {
158
+ group: "docs",
159
+ command: "search <query>",
160
+ description: "Search documentation content for a query string",
161
+ options: [
162
+ {
163
+ flags: "-k, --kind <kind>",
164
+ description: "Filter by doc kind (readme, guide, reference, architecture, release, convention, deep, generated)"
165
+ },
166
+ {
167
+ flags: "-p, --package <name>",
168
+ description: "Filter by package name"
169
+ },
170
+ ...docsSearchOutputMode.options,
171
+ ...docsSearchJq.options,
172
+ ...docsSearchCwd.options
173
+ ],
174
+ mapInput: (context) => {
175
+ const { outputMode: presetOutputMode } = docsSearchOutputMode.resolve(context.flags);
176
+ const { jq } = docsSearchJq.resolve(context.flags);
177
+ const outputMode = resolveDocsOutputMode(context.flags, presetOutputMode);
178
+ const kind = resolveStringFlag(context.flags["kind"]);
179
+ const pkg = resolveStringFlag(context.flags["package"]);
180
+ return {
181
+ query: context.args[0],
182
+ cwd: resolveCwdFromPreset(context.flags, docsSearchCwd),
183
+ outputMode,
184
+ jq,
185
+ ...kind !== undefined ? { kind } : {},
186
+ ...pkg !== undefined ? { package: pkg } : {}
187
+ };
188
+ }
189
+ },
190
+ handler: async (input) => {
191
+ const { outputMode, jq, ...searchInput } = input;
192
+ const result = await runDocsSearch({ ...searchInput, outputMode, jq });
193
+ if (result.isErr()) {
194
+ return result;
195
+ }
196
+ await printDocsSearchResults(result.value, { mode: outputMode, jq });
197
+ return Result.ok(result.value);
198
+ }
199
+ });
200
+ var docsApiInputSchema = z.object({
201
+ cwd: z.string(),
202
+ level: z.enum(["documented", "partial", "undocumented"]).optional(),
203
+ packages: z.array(z.string()),
204
+ jq: z.string().optional(),
205
+ outputMode: outputModeSchema
206
+ });
207
+ var docsApiCwd = cwdPreset();
208
+ var docsApiOutputMode = outputModePreset({ includeJsonl: true });
209
+ var docsApiJq = jqPreset();
210
+ var docsApiAction = defineAction({
211
+ id: "docs.api",
212
+ description: "Extract API reference from TSDoc coverage data",
213
+ surfaces: ["cli"],
214
+ input: docsApiInputSchema,
215
+ output: checkTsdocOutputSchema,
216
+ cli: {
217
+ group: "docs",
218
+ command: "api",
219
+ description: "Extract API reference from TSDoc coverage data",
220
+ options: [
221
+ {
222
+ flags: "--level <level>",
223
+ description: "Filter declarations by coverage level (undocumented, partial, documented)"
224
+ },
225
+ {
226
+ flags: "--package <name>",
227
+ description: "Filter to specific package(s) by name (repeatable)"
228
+ },
229
+ ...docsApiOutputMode.options,
230
+ ...docsApiJq.options,
231
+ ...docsApiCwd.options
232
+ ],
233
+ mapInput: (context) => {
234
+ const { outputMode: presetOutputMode } = docsApiOutputMode.resolve(context.flags);
235
+ const { jq } = docsApiJq.resolve(context.flags);
236
+ const outputMode = resolveDocsOutputMode(context.flags, presetOutputMode);
237
+ const levelRaw = context.flags["level"];
238
+ const validLevels = new Set(["documented", "partial", "undocumented"]);
239
+ const level = typeof levelRaw === "string" && validLevels.has(levelRaw) ? levelRaw : undefined;
240
+ const pkgRaw = context.flags["package"];
241
+ let packages = [];
242
+ if (Array.isArray(pkgRaw)) {
243
+ packages = pkgRaw.filter((v) => typeof v === "string");
244
+ } else if (typeof pkgRaw === "string") {
245
+ packages = [pkgRaw];
246
+ }
247
+ return {
248
+ cwd: resolveCwdFromPreset(context.flags, docsApiCwd),
249
+ outputMode,
250
+ jq,
251
+ level,
252
+ packages
253
+ };
254
+ }
255
+ },
256
+ handler: async (input) => {
257
+ const { cwd, packages, level, outputMode, jq } = input;
258
+ const result = await runDocsApi({
259
+ cwd,
260
+ packages,
261
+ level,
262
+ outputMode,
263
+ jq
264
+ });
265
+ if (result.isErr()) {
266
+ return result;
267
+ }
268
+ await printDocsApiResults(result.value, { mode: outputMode, jq });
269
+ return Result.ok(result.value);
270
+ }
271
+ });
272
+ var docsExportTargetValues = [
273
+ "packages",
274
+ "llms",
275
+ "llms-full",
276
+ "all"
277
+ ];
278
+ var docsExportInputSchema = z.object({
279
+ cwd: z.string(),
280
+ target: z.enum(docsExportTargetValues).default("all"),
281
+ outputMode: outputModeSchema
282
+ });
283
+ var docsExportCwd = cwdPreset();
284
+ var docsExportOutputMode = outputModePreset({ includeJsonl: true });
285
+ var docsExportAction = defineAction({
286
+ id: "docs.export",
287
+ description: "Export documentation to packages, llms.txt, or both",
288
+ surfaces: ["cli"],
289
+ input: docsExportInputSchema,
290
+ cli: {
291
+ group: "docs",
292
+ command: "export",
293
+ description: "Export documentation to packages, llms.txt, or both",
294
+ options: [
295
+ {
296
+ flags: "-t, --target <target>",
297
+ description: "Export target (packages|llms|llms-full|all, default: all)"
298
+ },
299
+ ...docsExportOutputMode.options,
300
+ ...docsExportCwd.options
301
+ ],
302
+ mapInput: (context) => {
303
+ const { outputMode: presetOutputMode } = docsExportOutputMode.resolve(context.flags);
304
+ const outputMode = resolveDocsOutputMode(context.flags, presetOutputMode);
305
+ const targetRaw = resolveStringFlag(context.flags["target"]);
306
+ const target = targetRaw ?? "all";
307
+ return {
308
+ cwd: resolveCwdFromPreset(context.flags, docsExportCwd),
309
+ target,
310
+ outputMode
311
+ };
312
+ }
313
+ },
314
+ handler: async (input) => {
315
+ const { outputMode, ...exportInput } = input;
316
+ const result = await runDocsExport({ ...exportInput, outputMode });
317
+ if (result.isErr()) {
318
+ return result;
319
+ }
320
+ await printDocsExportResults(result.value, { mode: outputMode });
321
+ return Result.ok(result.value);
322
+ }
323
+ });
324
+
325
+ export { docsListAction, docsShowAction, docsSearchAction, docsApiAction, docsExportAction };
@@ -0,0 +1,29 @@
1
+ // @bun
2
+ // apps/outfitter/src/engine/collector.ts
3
+ class OperationCollector {
4
+ operations = [];
5
+ add(op) {
6
+ this.operations.push(op);
7
+ }
8
+ getOperations() {
9
+ return this.operations;
10
+ }
11
+ countByType() {
12
+ const counts = {};
13
+ for (const op of this.operations) {
14
+ counts[op.type] = (counts[op.type] ?? 0) + 1;
15
+ }
16
+ return counts;
17
+ }
18
+ isEmpty() {
19
+ return this.operations.length === 0;
20
+ }
21
+ toJSON() {
22
+ return {
23
+ operations: this.operations,
24
+ summary: this.countByType()
25
+ };
26
+ }
27
+ }
28
+
29
+ export { OperationCollector };
@@ -0,0 +1,55 @@
1
+ import { Command } from "commander";
2
+ type DocsMdxMode = "strict" | "lossy";
3
+ interface DocsBaseOptions {
4
+ readonly cwd?: string;
5
+ readonly excludedFilenames?: readonly string[];
6
+ readonly mdxMode?: DocsMdxMode;
7
+ readonly outputDir?: string;
8
+ readonly packagesDir?: string;
9
+ readonly workspaceRoot?: string;
10
+ }
11
+ interface ExecuteCheckCommandOptions extends DocsBaseOptions {}
12
+ interface ExecuteSyncCommandOptions extends DocsBaseOptions {}
13
+ type DocsExportTarget = "packages" | "llms" | "llms-full" | "all";
14
+ interface ExecuteExportCommandOptions extends DocsBaseOptions {
15
+ readonly llmsFile?: string;
16
+ readonly llmsFullFile?: string;
17
+ readonly target?: DocsExportTarget | string;
18
+ }
19
+ interface DocsCommandIo {
20
+ readonly err: (line: string) => void;
21
+ readonly out: (line: string) => void;
22
+ }
23
+ interface CreateDocsCommandOptions {
24
+ readonly commandName?: string;
25
+ readonly io?: {
26
+ readonly out?: (line: string) => void;
27
+ readonly err?: (line: string) => void;
28
+ };
29
+ }
30
+ interface DocsResultLike<TValue> {
31
+ readonly error: {
32
+ readonly message: string;
33
+ };
34
+ readonly isErr: () => boolean;
35
+ readonly value: TValue;
36
+ }
37
+ interface DocsMapLike {
38
+ readonly entries: readonly unknown[];
39
+ }
40
+ interface DocsModule {
41
+ createDocsCommand: (options?: CreateDocsCommandOptions) => Command;
42
+ executeCheckCommand: (options: ExecuteCheckCommandOptions, io: DocsCommandIo) => Promise<number>;
43
+ executeExportCommand: (options: ExecuteExportCommandOptions, io: DocsCommandIo) => Promise<number>;
44
+ executeSyncCommand: (options: ExecuteSyncCommandOptions, io: DocsCommandIo) => Promise<number>;
45
+ generateDocsMap: (options: {
46
+ readonly workspaceRoot: string;
47
+ }) => Promise<DocsResultLike<DocsMapLike>>;
48
+ generatePackageListSection: (workspaceRoot: string) => Promise<string>;
49
+ replaceSentinelSection: (input: string, sentinelId: string, replacement: string) => string;
50
+ }
51
+ /**
52
+ * Load docs command module with source-first resolution in monorepo development.
53
+ */
54
+ declare function loadDocsModule(): Promise<DocsModule>;
55
+ export { ExecuteCheckCommandOptions, ExecuteSyncCommandOptions, DocsExportTarget, ExecuteExportCommandOptions, DocsCommandIo, CreateDocsCommandOptions, DocsModule, loadDocsModule };
@@ -0,0 +1,4 @@
1
+ import { ActionRegistry } from "@outfitter/contracts";
2
+ /** Central action registry containing all Outfitter CLI commands. */
3
+ declare const outfitterActions: ActionRegistry;
4
+ export { outfitterActions };
@@ -0,0 +1,44 @@
1
+ import { runCheckTsdoc } from "./outfitter-h0wmtxw8.js";
2
+ import { CliOutputMode } from "./outfitter-a79xrm12.js";
3
+ import { InternalError, Result, ValidationError } from "@outfitter/contracts";
4
+ import { TsDocCheckResult } from "@outfitter/tooling";
5
+ /** Validated input for the docs.api action handler. */
6
+ interface DocsApiInput {
7
+ /** Workspace root used to resolve package paths. */
8
+ readonly cwd: string;
9
+ /** Optional jq expression applied to structured output. */
10
+ readonly jq?: string | undefined;
11
+ /** Filter declarations by documentation coverage level. */
12
+ readonly level?: "documented" | "partial" | "undocumented" | undefined;
13
+ readonly outputMode: CliOutputMode;
14
+ /** Package names to include; empty array means all packages. */
15
+ readonly packages: string[];
16
+ }
17
+ interface DocsApiDependencies {
18
+ readonly runCheckTsdoc?: typeof runCheckTsdoc;
19
+ }
20
+ /**
21
+ * Extract API reference from TSDoc coverage data.
22
+ *
23
+ * Delegates to `runCheckTsdoc` with sensible defaults for documentation
24
+ * output (non-strict, full declaration detail, no minimum coverage).
25
+ *
26
+ * @param input - Validated action input
27
+ * @returns Result containing the TSDoc check result shaped as API reference
28
+ */
29
+ declare function runDocsApi(input: DocsApiInput, dependencies?: DocsApiDependencies): Promise<Result<TsDocCheckResult, ValidationError | InternalError>>;
30
+ /**
31
+ * Print API reference results in the appropriate output format.
32
+ *
33
+ * For structured modes (JSON/JSONL), delegates to the standard output
34
+ * helper. For human mode, formats as an API reference listing grouped
35
+ * by package.
36
+ *
37
+ * @param result - The TSDoc check result
38
+ * @param options - Output formatting options
39
+ */
40
+ declare function printDocsApiResults(result: TsDocCheckResult, options?: {
41
+ mode?: CliOutputMode;
42
+ jq?: string | undefined;
43
+ }): Promise<void>;
44
+ export { DocsApiInput, runDocsApi, printDocsApiResults };
@@ -0,0 +1,29 @@
1
+ // @bun
2
+ // apps/outfitter/src/commands/init-option-resolution.ts
3
+ import { Result } from "@outfitter/contracts";
4
+ function parseBlocks(withFlag) {
5
+ if (!withFlag) {
6
+ return;
7
+ }
8
+ const blocks = withFlag.split(",").map((value) => value.trim()).filter((value) => value.length > 0);
9
+ return blocks.length > 0 ? blocks : undefined;
10
+ }
11
+ function isBinaryPreset(preset) {
12
+ return preset === "cli" || preset === "daemon";
13
+ }
14
+ function isValidInitPreset(value) {
15
+ return value === "minimal" || value === "cli" || value === "mcp" || value === "daemon" || value === "library" || value === "full-stack";
16
+ }
17
+ function resolvePresetFromFlags(presetFromFlag, availablePresetIds) {
18
+ if (!presetFromFlag) {
19
+ return Result.ok(undefined);
20
+ }
21
+ const knownAvailablePresetIds = availablePresetIds.filter(isValidInitPreset);
22
+ const isKnownAndAvailable = isValidInitPreset(presetFromFlag) && knownAvailablePresetIds.includes(presetFromFlag);
23
+ if (!isKnownAndAvailable) {
24
+ return Result.err(`Unknown preset '${presetFromFlag}'. Available presets: ${knownAvailablePresetIds.join(", ")}`);
25
+ }
26
+ return Result.ok(presetFromFlag);
27
+ }
28
+
29
+ export { parseBlocks, isBinaryPreset, isValidInitPreset, resolvePresetFromFlags };
@@ -0,0 +1,82 @@
1
+ import { PostScaffoldResult } from "./outfitter-hcexcvxe.js";
2
+ import { OutputMode } from "@outfitter/cli/types";
3
+ import { Result } from "@outfitter/contracts";
4
+ import { AddBlockResult } from "@outfitter/tooling";
5
+ import { Command } from "commander";
6
+ /** Options for the scaffold command, corresponding to CLI flags and positional arguments. */
7
+ interface ScaffoldOptions {
8
+ /** Working directory to scaffold in. */
9
+ readonly cwd: string;
10
+ /** Preview changes without writing to disk. */
11
+ readonly dryRun: boolean;
12
+ /** Overwrite existing files without prompting. */
13
+ readonly force: boolean;
14
+ /** Timeout in milliseconds for `bun install`. */
15
+ readonly installTimeout?: number | undefined;
16
+ /** Use `workspace:*` protocol for `@outfitter` dependencies. */
17
+ readonly local?: boolean | undefined;
18
+ /** Override the default target directory name. */
19
+ readonly name?: string | undefined;
20
+ /** Skip adding default tooling blocks. */
21
+ readonly noTooling?: boolean | undefined;
22
+ /** Skip running `bun install` after scaffolding. */
23
+ readonly skipInstall: boolean;
24
+ /** Target preset ID to scaffold (e.g. "cli", "mcp"). */
25
+ readonly target: string;
26
+ /** Comma-separated tooling block names to include. */
27
+ readonly with?: string | undefined;
28
+ }
29
+ /** Result of a successful `outfitter scaffold` run. */
30
+ interface ScaffoldCommandResult {
31
+ /** Tooling blocks that were added, if any. */
32
+ readonly blocksAdded?: AddBlockResult | undefined;
33
+ /** Whether the project was converted from single-package to workspace. */
34
+ readonly converted: boolean;
35
+ /** Present only for dry-run invocations; contains the planned operations and summary counts. */
36
+ readonly dryRunPlan?: {
37
+ readonly operations: readonly unknown[];
38
+ readonly summary: Record<string, number>;
39
+ } | undefined;
40
+ /** Details of the existing package that was relocated during workspace conversion. */
41
+ readonly movedExisting?: {
42
+ readonly from: string;
43
+ readonly to: string;
44
+ readonly name: string;
45
+ } | undefined;
46
+ /** Results from post-scaffold steps (install, next-step hints). */
47
+ readonly postScaffold: PostScaffoldResult;
48
+ /** Absolute path to the workspace root. */
49
+ readonly rootDir: string;
50
+ /** The target preset ID that was scaffolded. */
51
+ readonly target: string;
52
+ /** Absolute path to the scaffolded target directory. */
53
+ readonly targetDir: string;
54
+ /** Whether a new workspace pattern was added to the root package.json. */
55
+ readonly workspacePatternsUpdated: boolean;
56
+ }
57
+ /** Error returned when scaffolding fails. */
58
+ declare class ScaffoldCommandError extends Error {
59
+ readonly _tag: "ScaffoldCommandError";
60
+ /** @param message - Human-readable description of the scaffold failure. */
61
+ constructor(message: string);
62
+ }
63
+ /**
64
+ * Runs the full scaffold flow: detects project structure, converts to workspace
65
+ * if needed, executes the preset plan, and performs post-scaffold steps.
66
+ */
67
+ declare function runScaffold(options: ScaffoldOptions): Promise<Result<ScaffoldCommandResult, ScaffoldCommandError>>;
68
+ /**
69
+ * Registers the `scaffold` command on a Commander program.
70
+ * @deprecated Use action-registry CLI wiring via `buildCliCommands(outfitterActions, ...)`.
71
+ */
72
+ declare function scaffoldCommand(program: Command): void;
73
+ /** Options controlling how scaffold results are rendered (human-readable, JSON, or JSONL). */
74
+ interface PrintScaffoldResultsOptions {
75
+ readonly mode?: OutputMode;
76
+ }
77
+ /**
78
+ * Renders scaffold results to stdout. Handles dry-run plans, structured output modes,
79
+ * and human-readable summaries including workspace conversion details and next steps.
80
+ */
81
+ declare function printScaffoldResults(result: ScaffoldCommandResult, options?: PrintScaffoldResultsOptions): Promise<void>;
82
+ export { PrintScaffoldResultsOptions, printScaffoldResults, ScaffoldOptions, ScaffoldCommandResult, ScaffoldCommandError, runScaffold, scaffoldCommand };
@@ -0,0 +1,24 @@
1
+ import { ExecuteCheckCommandOptions, ExecuteExportCommandOptions, ExecuteSyncCommandOptions } from "./outfitter-1tfa9hke.js";
2
+ import { Command } from "commander";
3
+ declare const DOCS_COMMON_OPTION_FLAGS: readonly ["--cwd <path>", "--packages-dir <path>", "--output-dir <path>", "--mdx-mode <mode>"];
4
+ declare const DOCS_EXPORT_OPTION_FLAGS: readonly ["--llms-file <path>", "--llms-full-file <path>", "--target <target>"];
5
+ type RepoCheckSubject = "docs" | "exports" | "readme" | "registry" | "changeset" | "tree" | "boundary-invocations";
6
+ interface RepoCommandIo {
7
+ readonly err?: (line: string) => void;
8
+ readonly out?: (line: string) => void;
9
+ }
10
+ interface RepoToolingInvocation {
11
+ readonly args: readonly string[];
12
+ readonly command: "check-exports" | "check-readme-imports" | "check-bunup-registry" | "check-changeset" | "check-clean-tree" | "check-boundary-invocations" | "check-markdown-links";
13
+ readonly cwd: string;
14
+ }
15
+ interface CreateRepoCommandOptions {
16
+ readonly commandName?: string;
17
+ readonly io?: RepoCommandIo;
18
+ readonly runDocsCheck?: (options: ExecuteCheckCommandOptions, io: Required<RepoCommandIo>) => Promise<number>;
19
+ readonly runDocsExport?: (options: ExecuteExportCommandOptions, io: Required<RepoCommandIo>) => Promise<number>;
20
+ readonly runDocsSync?: (options: ExecuteSyncCommandOptions, io: Required<RepoCommandIo>) => Promise<number>;
21
+ readonly runToolingCommand?: (input: RepoToolingInvocation) => Promise<number>;
22
+ }
23
+ declare function createRepoCommand(options?: CreateRepoCommandOptions): Command;
24
+ export { DOCS_COMMON_OPTION_FLAGS, DOCS_EXPORT_OPTION_FLAGS, RepoCheckSubject, RepoCommandIo, RepoToolingInvocation, CreateRepoCommandOptions, createRepoCommand };