@outfitter/cli 0.1.0-rc.1 → 0.1.0-rc.3

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 (266) hide show
  1. package/README.md +21 -32
  2. package/dist/actions.js +1 -1
  3. package/dist/borders/index.d.ts +3 -0
  4. package/dist/borders/index.js +13 -0
  5. package/dist/box/index.d.ts +4 -0
  6. package/dist/box/index.js +13 -0
  7. package/dist/cli.d.ts +2 -103
  8. package/dist/cli.js +4 -51
  9. package/dist/colors/index.d.ts +3 -0
  10. package/dist/colors/index.js +18 -0
  11. package/dist/command.d.ts +3 -37
  12. package/dist/command.js +5 -1
  13. package/dist/demo/index.d.ts +78 -0
  14. package/dist/demo/index.js +148 -0
  15. package/dist/demo/registry.d.ts +7 -0
  16. package/dist/demo/registry.js +28 -0
  17. package/dist/demo/renderers/borders.d.ts +7 -0
  18. package/dist/demo/renderers/borders.js +17 -0
  19. package/dist/demo/renderers/box.d.ts +7 -0
  20. package/dist/demo/renderers/box.js +18 -0
  21. package/dist/demo/renderers/colors.d.ts +7 -0
  22. package/dist/demo/renderers/colors.js +18 -0
  23. package/dist/demo/renderers/indicators.d.ts +7 -0
  24. package/dist/demo/renderers/indicators.js +17 -0
  25. package/dist/demo/renderers/list.d.ts +7 -0
  26. package/dist/demo/renderers/list.js +19 -0
  27. package/dist/demo/renderers/markdown.d.ts +7 -0
  28. package/dist/demo/renderers/markdown.js +18 -0
  29. package/dist/demo/renderers/progress.d.ts +7 -0
  30. package/dist/demo/renderers/progress.js +17 -0
  31. package/dist/demo/renderers/spinner.d.ts +7 -0
  32. package/dist/demo/renderers/spinner.js +19 -0
  33. package/dist/demo/renderers/table.d.ts +7 -0
  34. package/dist/demo/renderers/table.js +19 -0
  35. package/dist/demo/renderers/text.d.ts +7 -0
  36. package/dist/demo/renderers/text.js +16 -0
  37. package/dist/demo/renderers/tree.d.ts +7 -0
  38. package/dist/demo/renderers/tree.js +18 -0
  39. package/dist/demo/section.d.ts +5 -0
  40. package/dist/demo/section.js +23 -0
  41. package/dist/demo/templates.d.ts +4 -0
  42. package/dist/demo/templates.js +10 -0
  43. package/dist/demo/types.d.ts +3 -0
  44. package/dist/demo/types.js +8 -0
  45. package/dist/index.d.ts +5 -607
  46. package/dist/index.js +10 -44
  47. package/dist/input.d.ts +9 -123
  48. package/dist/input.js +2 -3
  49. package/dist/list/index.d.ts +3 -0
  50. package/dist/list/index.js +9 -0
  51. package/dist/output.d.ts +2 -68
  52. package/dist/output.js +4 -150
  53. package/dist/pagination.d.ts +1 -34
  54. package/dist/pagination.js +1 -1
  55. package/dist/preset/full.d.ts +14 -0
  56. package/dist/preset/full.js +41 -0
  57. package/dist/preset/standard.d.ts +11 -0
  58. package/dist/preset/standard.js +30 -0
  59. package/dist/prompt/confirm.d.ts +4 -0
  60. package/dist/prompt/confirm.js +9 -0
  61. package/dist/prompt/group.d.ts +4 -0
  62. package/dist/prompt/group.js +9 -0
  63. package/dist/prompt/index.d.ts +7 -0
  64. package/dist/prompt/index.js +32 -0
  65. package/dist/prompt/select.d.ts +4 -0
  66. package/dist/prompt/select.js +11 -0
  67. package/dist/prompt/text.d.ts +4 -0
  68. package/dist/prompt/text.js +11 -0
  69. package/dist/prompt/types.d.ts +3 -0
  70. package/dist/prompt/types.js +8 -0
  71. package/dist/prompt/validators.d.ts +2 -0
  72. package/dist/prompt/validators.js +8 -0
  73. package/dist/render/borders.d.ts +2 -0
  74. package/dist/render/borders.js +15 -0
  75. package/dist/render/box.d.ts +3 -0
  76. package/dist/render/box.js +23 -0
  77. package/dist/render/colors.d.ts +2 -0
  78. package/dist/render/colors.js +20 -0
  79. package/dist/render/date.d.ts +2 -0
  80. package/dist/render/date.js +12 -0
  81. package/dist/render/format-relative.d.ts +2 -0
  82. package/dist/render/format-relative.js +8 -0
  83. package/dist/render/format.d.ts +2 -0
  84. package/dist/render/format.js +10 -0
  85. package/dist/render/heading.d.ts +3 -0
  86. package/dist/render/heading.js +14 -0
  87. package/dist/render/index.d.ts +32 -0
  88. package/dist/render/index.js +235 -0
  89. package/dist/render/indicators.d.ts +2 -0
  90. package/dist/render/indicators.js +14 -0
  91. package/dist/render/json.d.ts +2 -0
  92. package/dist/render/json.js +10 -0
  93. package/dist/render/layout.d.ts +5 -0
  94. package/dist/render/layout.js +25 -0
  95. package/dist/render/list.d.ts +2 -0
  96. package/dist/render/list.js +8 -0
  97. package/dist/render/markdown.d.ts +2 -0
  98. package/dist/render/markdown.js +10 -0
  99. package/dist/render/progress.d.ts +2 -0
  100. package/dist/render/progress.js +8 -0
  101. package/dist/render/separator.d.ts +3 -0
  102. package/dist/render/separator.js +14 -0
  103. package/dist/render/shapes.d.ts +2 -0
  104. package/dist/render/shapes.js +35 -0
  105. package/dist/render/spinner.d.ts +2 -0
  106. package/dist/render/spinner.js +12 -0
  107. package/dist/render/stack.d.ts +3 -0
  108. package/dist/render/stack.js +38 -0
  109. package/dist/render/table.d.ts +3 -0
  110. package/dist/render/table.js +12 -0
  111. package/dist/render/text.d.ts +2 -0
  112. package/dist/render/text.js +27 -0
  113. package/dist/render/tree.d.ts +2 -0
  114. package/dist/render/tree.js +10 -0
  115. package/dist/render/types.d.ts +2 -0
  116. package/dist/render/types.js +1 -0
  117. package/dist/shared/@outfitter/cli-0ggcy7fa.js +20 -0
  118. package/dist/shared/@outfitter/cli-0psys2vm.js +7 -0
  119. package/dist/shared/@outfitter/cli-1bghjef6.js +352 -0
  120. package/dist/shared/@outfitter/cli-1kwbnt86.d.ts +45 -0
  121. package/dist/shared/@outfitter/cli-2g8bx1aq.d.ts +50 -0
  122. package/dist/shared/@outfitter/cli-33e97cjs.d.ts +42 -0
  123. package/dist/shared/@outfitter/cli-34fqr7bp.js +37 -0
  124. package/dist/shared/@outfitter/cli-3b7ed3rm.d.ts +97 -0
  125. package/dist/shared/@outfitter/cli-3dxmmy4c.d.ts +20 -0
  126. package/dist/shared/@outfitter/cli-3f12z5kf.d.ts +83 -0
  127. package/dist/shared/@outfitter/cli-3hp8qwx3.js +11 -0
  128. package/dist/shared/@outfitter/cli-3t2zaenc.d.ts +59 -0
  129. package/dist/shared/@outfitter/cli-4cb5g831.d.ts +147 -0
  130. package/dist/shared/@outfitter/cli-4w2a1rfy.d.ts +23 -0
  131. package/dist/shared/@outfitter/cli-4x6pqnez.js +20 -0
  132. package/dist/shared/@outfitter/cli-671sxkhj.js +146 -0
  133. package/dist/shared/@outfitter/cli-6bztk73z.d.ts +51 -0
  134. package/dist/shared/@outfitter/cli-6fxffp8k.js +1 -0
  135. package/dist/shared/@outfitter/cli-6j9qynm8.js +118 -0
  136. package/dist/shared/@outfitter/cli-6m988kh0.d.ts +61 -0
  137. package/dist/shared/@outfitter/cli-72kg550t.d.ts +53 -0
  138. package/dist/shared/@outfitter/cli-74ba31gz.js +134 -0
  139. package/dist/shared/@outfitter/cli-7gnrb8cr.js +214 -0
  140. package/dist/shared/@outfitter/cli-7na6p4fs.d.ts +59 -0
  141. package/dist/shared/@outfitter/cli-7nm6edvh.d.ts +17 -0
  142. package/dist/shared/@outfitter/cli-85fg2vr5.js +123 -0
  143. package/dist/shared/@outfitter/cli-8a8xrzhy.js +20 -0
  144. package/dist/shared/@outfitter/cli-8aa1vhdn.d.ts +119 -0
  145. package/dist/shared/@outfitter/cli-8bwaw3pz.js +7 -0
  146. package/dist/shared/@outfitter/cli-8j5k6mr3.js +71 -0
  147. package/dist/shared/@outfitter/cli-8rx4g3s5.d.ts +41 -0
  148. package/dist/shared/@outfitter/cli-8xsmsbbd.d.ts +223 -0
  149. package/dist/shared/@outfitter/cli-96b2p4td.d.ts +56 -0
  150. package/dist/shared/@outfitter/cli-9khk3cbq.d.ts +190 -0
  151. package/dist/shared/@outfitter/cli-9mtjjykw.js +67 -0
  152. package/dist/shared/@outfitter/cli-9nbyj2bt.js +128 -0
  153. package/dist/shared/@outfitter/cli-a4q87517.d.ts +64 -0
  154. package/dist/shared/@outfitter/cli-afhjqmg3.js +63 -0
  155. package/dist/shared/@outfitter/cli-an9j0h80.js +117 -0
  156. package/dist/shared/@outfitter/cli-ay411nbr.js +122 -0
  157. package/dist/shared/@outfitter/cli-b0tzqgnf.d.ts +132 -0
  158. package/dist/shared/@outfitter/cli-b5c2k0d7.js +39 -0
  159. package/dist/shared/@outfitter/cli-b5epywry.js +1 -0
  160. package/dist/shared/@outfitter/cli-bc17qeh2.js +19 -0
  161. package/dist/shared/@outfitter/cli-bcmcaz1b.js +23 -0
  162. package/dist/shared/@outfitter/cli-bf3vma4q.js +61 -0
  163. package/dist/shared/@outfitter/cli-c8q4f71g.js +144 -0
  164. package/dist/shared/@outfitter/cli-c9knfqn5.d.ts +30 -0
  165. package/dist/shared/@outfitter/cli-cf1xexgn.d.ts +53 -0
  166. package/dist/shared/@outfitter/cli-cf2s94s1.d.ts +42 -0
  167. package/dist/shared/@outfitter/cli-cs45xd6q.js +59 -0
  168. package/dist/shared/@outfitter/cli-d7jpshq5.d.ts +128 -0
  169. package/dist/shared/@outfitter/cli-d9ad0rqj.js +75 -0
  170. package/dist/shared/@outfitter/cli-daw296mv.js +61 -0
  171. package/dist/shared/@outfitter/cli-e5ms1y0x.d.ts +91 -0
  172. package/dist/shared/@outfitter/cli-e73v3qqy.d.ts +93 -0
  173. package/dist/shared/@outfitter/cli-efy6jfcj.js +52 -0
  174. package/dist/shared/@outfitter/cli-en6zn6sj.js +1 -0
  175. package/dist/shared/@outfitter/cli-ep2cvtk8.js +48 -0
  176. package/dist/shared/@outfitter/cli-evx7qcp1.d.ts +300 -0
  177. package/dist/shared/@outfitter/cli-f75h8e94.js +7 -0
  178. package/dist/shared/@outfitter/cli-fakncnjp.d.ts +106 -0
  179. package/dist/shared/@outfitter/cli-feb5j90n.js +94 -0
  180. package/dist/shared/@outfitter/cli-h20jc0bs.d.ts +66 -0
  181. package/dist/shared/@outfitter/cli-hnpbqmc8.d.ts +328 -0
  182. package/dist/shared/@outfitter/cli-j19a91ck.js +30 -0
  183. package/dist/shared/@outfitter/cli-j4n8gaf3.js +95 -0
  184. package/dist/shared/@outfitter/cli-jejfypgf.js +85 -0
  185. package/dist/shared/@outfitter/cli-jhcdwvpn.js +135 -0
  186. package/dist/shared/@outfitter/cli-jjemfdta.js +85 -0
  187. package/dist/shared/@outfitter/cli-kc84wmch.js +267 -0
  188. package/dist/shared/@outfitter/cli-ktqme80d.js +7 -0
  189. package/dist/shared/@outfitter/cli-mhamvbty.d.ts +34 -0
  190. package/dist/shared/@outfitter/cli-mq0jp15z.js +1 -0
  191. package/dist/shared/@outfitter/cli-mymyavvj.d.ts +26 -0
  192. package/dist/shared/@outfitter/cli-n17gt1dz.js +19 -0
  193. package/dist/shared/@outfitter/cli-n9dbh0hp.js +51 -0
  194. package/dist/shared/@outfitter/cli-nvvc92c8.js +128 -0
  195. package/dist/shared/@outfitter/cli-p1m5dhrs.js +169 -0
  196. package/dist/shared/@outfitter/cli-p38sfxyk.js +25 -0
  197. package/dist/shared/@outfitter/cli-p3dqm1vd.js +22 -0
  198. package/dist/shared/@outfitter/cli-p9j1phge.js +20 -0
  199. package/dist/shared/@outfitter/cli-pkxmzavm.js +62 -0
  200. package/dist/shared/@outfitter/cli-q8r6jarq.d.ts +24 -0
  201. package/dist/shared/@outfitter/cli-qj83y5wj.d.ts +71 -0
  202. package/dist/shared/@outfitter/cli-qjfc3j11.d.ts +112 -0
  203. package/dist/shared/@outfitter/cli-qp4cbhqr.js +70 -0
  204. package/dist/shared/@outfitter/cli-s0kkx9m1.d.ts +164 -0
  205. package/dist/shared/@outfitter/cli-snxj55n6.js +43 -0
  206. package/dist/shared/@outfitter/cli-swwxvjvm.d.ts +24 -0
  207. package/dist/shared/@outfitter/cli-sx67mmfx.d.ts +98 -0
  208. package/dist/shared/@outfitter/cli-tarpsa8a.js +30 -0
  209. package/dist/shared/@outfitter/cli-thvzhjd1.js +126 -0
  210. package/dist/shared/@outfitter/cli-tqewy503.d.ts +36 -0
  211. package/dist/shared/@outfitter/cli-ttt7r0j7.d.ts +253 -0
  212. package/dist/shared/@outfitter/cli-tvw1xrdj.js +20 -0
  213. package/dist/shared/@outfitter/cli-v1tzwxkt.js +32 -0
  214. package/dist/shared/@outfitter/cli-vd60dj65.js +1 -0
  215. package/dist/shared/@outfitter/cli-vp88gxev.js +279 -0
  216. package/dist/shared/@outfitter/cli-vstbkzky.d.ts +74 -0
  217. package/dist/shared/@outfitter/cli-vtg0sqk2.d.ts +54 -0
  218. package/dist/shared/@outfitter/cli-w5y3xepp.js +20 -0
  219. package/dist/shared/@outfitter/cli-x4cavvc0.js +1 -0
  220. package/dist/shared/@outfitter/cli-xep6v2c0.js +52 -0
  221. package/dist/shared/@outfitter/cli-xg5y5fhk.js +86 -0
  222. package/dist/shared/@outfitter/cli-xsaheemc.d.ts +248 -0
  223. package/dist/shared/@outfitter/cli-xvqtqjxk.js +82 -0
  224. package/dist/shared/@outfitter/cli-y25tt8nc.d.ts +48 -0
  225. package/dist/shared/@outfitter/cli-zact3325.js +152 -0
  226. package/dist/shared/@outfitter/cli-zx598p8q.d.ts +26 -0
  227. package/dist/streaming/ansi.d.ts +2 -0
  228. package/dist/streaming/ansi.js +8 -0
  229. package/dist/streaming/index.d.ts +4 -0
  230. package/dist/streaming/index.js +17 -0
  231. package/dist/streaming/spinner.d.ts +3 -0
  232. package/dist/streaming/spinner.js +10 -0
  233. package/dist/streaming/writer.d.ts +2 -0
  234. package/dist/streaming/writer.js +9 -0
  235. package/dist/table/index.d.ts +4 -0
  236. package/dist/table/index.js +13 -0
  237. package/dist/terminal/detection.d.ts +2 -0
  238. package/dist/terminal/detection.js +23 -0
  239. package/dist/terminal/index.d.ts +2 -0
  240. package/dist/terminal/index.js +24 -0
  241. package/dist/theme/context.d.ts +9 -0
  242. package/dist/theme/context.js +14 -0
  243. package/dist/theme/create.d.ts +8 -0
  244. package/dist/theme/create.js +12 -0
  245. package/dist/theme/index.d.ts +17 -0
  246. package/dist/theme/index.js +42 -0
  247. package/dist/theme/presets/bold.d.ts +8 -0
  248. package/dist/theme/presets/bold.js +12 -0
  249. package/dist/theme/presets/default.d.ts +8 -0
  250. package/dist/theme/presets/default.js +11 -0
  251. package/dist/theme/presets/index.d.ts +12 -0
  252. package/dist/theme/presets/index.js +24 -0
  253. package/dist/theme/presets/minimal.d.ts +8 -0
  254. package/dist/theme/presets/minimal.js +12 -0
  255. package/dist/theme/presets/rounded.d.ts +8 -0
  256. package/dist/theme/presets/rounded.js +12 -0
  257. package/dist/theme/resolve.d.ts +8 -0
  258. package/dist/theme/resolve.js +11 -0
  259. package/dist/theme/types.d.ts +7 -0
  260. package/dist/theme/types.js +1 -0
  261. package/dist/tree/index.d.ts +3 -0
  262. package/dist/tree/index.js +11 -0
  263. package/dist/types.d.ts +1 -252
  264. package/dist/types.js +1 -1
  265. package/package.json +228 -20
  266. package/dist/shared/@outfitter/cli-4yy82cmp.js +0 -20
package/dist/input.d.ts CHANGED
@@ -1,120 +1,6 @@
1
- /**
2
- * Options for collectIds() input utility.
3
- *
4
- * @example
5
- * ```typescript
6
- * const ids = await collectIds(args, {
7
- * allowFile: true, // @file expansion
8
- * allowStdin: true, // - reads from stdin
9
- * });
10
- * ```
11
- */
12
- interface CollectIdsOptions {
13
- /** Allow @file expansion (reads IDs from file) */
14
- readonly allowFile?: boolean;
15
- /** Allow glob patterns */
16
- readonly allowGlob?: boolean;
17
- /** Allow reading from stdin with "-" */
18
- readonly allowStdin?: boolean;
19
- /** Separator for comma-separated values */
20
- readonly separator?: string;
21
- }
22
- /**
23
- * Options for expandFileArg() input utility.
24
- */
25
- interface ExpandFileOptions {
26
- /** Encoding for file reads (defaults to utf-8) */
27
- readonly encoding?: BufferEncoding;
28
- /** Maximum file size to read (in bytes) */
29
- readonly maxSize?: number;
30
- /** Whether to trim the file content */
31
- readonly trim?: boolean;
32
- }
33
- /**
34
- * Options for parseGlob() input utility.
35
- */
36
- interface ParseGlobOptions {
37
- /** Current working directory for glob resolution */
38
- readonly cwd?: string;
39
- /** Whether to follow symlinks */
40
- readonly followSymlinks?: boolean;
41
- /** Patterns to exclude */
42
- readonly ignore?: readonly string[];
43
- /** Only match files (not directories) */
44
- readonly onlyFiles?: boolean;
45
- /** Only match directories (not files) */
46
- readonly onlyDirectories?: boolean;
47
- }
48
- /**
49
- * Options for normalizeId().
50
- */
51
- interface NormalizeIdOptions {
52
- /** Whether to lowercase the ID */
53
- readonly lowercase?: boolean;
54
- /** Whether to trim whitespace */
55
- readonly trim?: boolean;
56
- /** Minimum length requirement */
57
- readonly minLength?: number;
58
- /** Maximum length requirement */
59
- readonly maxLength?: number;
60
- /** Pattern the ID must match */
61
- readonly pattern?: RegExp;
62
- }
63
- /**
64
- * Options for confirmDestructive().
65
- */
66
- interface ConfirmDestructiveOptions {
67
- /** Message to display to the user */
68
- readonly message: string;
69
- /** Whether to bypass confirmation (e.g., --yes flag) */
70
- readonly bypassFlag?: boolean;
71
- /** Number of items affected (shown in confirmation) */
72
- readonly itemCount?: number;
73
- }
74
- /**
75
- * Numeric or date range parsed from CLI input.
76
- */
77
- type Range = NumericRange | DateRange;
78
- /**
79
- * Numeric range (e.g., "1-10").
80
- */
81
- interface NumericRange {
82
- readonly type: "number";
83
- readonly min: number;
84
- readonly max: number;
85
- }
86
- /**
87
- * Date range (e.g., "2024-01-01..2024-12-31").
88
- */
89
- interface DateRange {
90
- readonly type: "date";
91
- readonly start: Date;
92
- readonly end: Date;
93
- }
94
- /**
95
- * Filter expression parsed from CLI input.
96
- */
97
- interface FilterExpression {
98
- readonly field: string;
99
- readonly value: string;
100
- readonly operator?: "eq" | "ne" | "gt" | "lt" | "gte" | "lte" | "contains";
101
- }
102
- /**
103
- * Sort criteria parsed from CLI input.
104
- */
105
- interface SortCriteria {
106
- readonly field: string;
107
- readonly direction: "asc" | "desc";
108
- }
109
- /**
110
- * Key-value pair parsed from CLI input.
111
- */
112
- interface KeyValuePair {
113
- readonly key: string;
114
- readonly value: string;
115
- }
116
- import { CancelledError as CancelledError2, ValidationError as ValidationError2 } from "@outfitter/contracts";
117
- import { Result as Result2 } from "better-result";
1
+ import { CollectIdsOptions, ConfirmDestructiveOptions, ExpandFileOptions, FilterExpression, KeyValuePair, NormalizeIdOptions, ParseGlobOptions, Range, SortCriteria } from "./shared/@outfitter/cli-ttt7r0j7";
2
+ import { CancelledError, ValidationError } from "@outfitter/contracts";
3
+ import { Result } from "better-result";
118
4
  /**
119
5
  * Collect IDs from various input formats.
120
6
  *
@@ -188,7 +74,7 @@ declare function parseGlob(pattern: string, options?: ParseGlobOptions): Promise
188
74
  * // => [{ key: "key", value: "value" }, { key: "key2", value: "value2" }]
189
75
  * ```
190
76
  */
191
- declare function parseKeyValue(input: string | readonly string[]): Result2<KeyValuePair[], InstanceType<typeof ValidationError2>>;
77
+ declare function parseKeyValue(input: string | readonly string[]): Result<KeyValuePair[], InstanceType<typeof ValidationError>>;
192
78
  /**
193
79
  * Parse range inputs (numeric or date).
194
80
  *
@@ -205,7 +91,7 @@ declare function parseKeyValue(input: string | readonly string[]): Result2<KeyVa
205
91
  * // => Result<{ type: "date", start: Date, end: Date }, ValidationError>
206
92
  * ```
207
93
  */
208
- declare function parseRange(input: string, type: "number" | "date"): Result2<Range, InstanceType<typeof ValidationError2>>;
94
+ declare function parseRange(input: string, type: "number" | "date"): Result<Range, InstanceType<typeof ValidationError>>;
209
95
  /**
210
96
  * Parse filter expressions from CLI input.
211
97
  *
@@ -221,7 +107,7 @@ declare function parseRange(input: string, type: "number" | "date"): Result2<Ran
221
107
  * // ], ValidationError>
222
108
  * ```
223
109
  */
224
- declare function parseFilter(input: string): Result2<FilterExpression[], InstanceType<typeof ValidationError2>>;
110
+ declare function parseFilter(input: string): Result<FilterExpression[], InstanceType<typeof ValidationError>>;
225
111
  /**
226
112
  * Parse sort specification from CLI input.
227
113
  *
@@ -237,7 +123,7 @@ declare function parseFilter(input: string): Result2<FilterExpression[], Instanc
237
123
  * // ], ValidationError>
238
124
  * ```
239
125
  */
240
- declare function parseSortSpec(input: string): Result2<SortCriteria[], InstanceType<typeof ValidationError2>>;
126
+ declare function parseSortSpec(input: string): Result<SortCriteria[], InstanceType<typeof ValidationError>>;
241
127
  /**
242
128
  * Normalize an identifier (trim, lowercase where appropriate).
243
129
  *
@@ -251,7 +137,7 @@ declare function parseSortSpec(input: string): Result2<SortCriteria[], InstanceT
251
137
  * // => Result<"my-id", ValidationError>
252
138
  * ```
253
139
  */
254
- declare function normalizeId(input: string, options?: NormalizeIdOptions): Result2<string, InstanceType<typeof ValidationError2>>;
140
+ declare function normalizeId(input: string, options?: NormalizeIdOptions): Result<string, InstanceType<typeof ValidationError>>;
255
141
  /**
256
142
  * Prompt for confirmation before destructive operations.
257
143
  *
@@ -274,5 +160,5 @@ declare function normalizeId(input: string, options?: NormalizeIdOptions): Resul
274
160
  * }
275
161
  * ```
276
162
  */
277
- declare function confirmDestructive(options: ConfirmDestructiveOptions): Promise<Result2<boolean, InstanceType<typeof CancelledError2>>>;
163
+ declare function confirmDestructive(options: ConfirmDestructiveOptions): Promise<Result<boolean, InstanceType<typeof CancelledError>>>;
278
164
  export { parseSortSpec, parseRange, parseKeyValue, parseGlob, parseFilter, normalizeId, expandFileArg, confirmDestructive, collectIds };
package/dist/input.js CHANGED
@@ -1,8 +1,7 @@
1
1
  // @bun
2
2
  import {
3
- __require,
4
- __toESM
5
- } from "./shared/@outfitter/cli-4yy82cmp.js";
3
+ __require
4
+ } from "./shared/@outfitter/cli-v1tzwxkt.js";
6
5
 
7
6
  // packages/cli/src/input.ts
8
7
  import path from "path";
@@ -0,0 +1,3 @@
1
+ import "../shared/@outfitter/cli-yef5b9ds";
2
+ import { ListItem, ListOptions, ListStyle, NestedListItem, renderList } from "../shared/@outfitter/cli-b0tzqgnf";
3
+ export { renderList, NestedListItem, ListStyle, ListOptions, ListItem };
@@ -0,0 +1,9 @@
1
+ // @bun
2
+ import"../shared/@outfitter/cli-en6zn6sj.js";
3
+ import {
4
+ renderList
5
+ } from "../shared/@outfitter/cli-xg5y5fhk.js";
6
+ import"../shared/@outfitter/cli-v1tzwxkt.js";
7
+ export {
8
+ renderList
9
+ };
package/dist/output.d.ts CHANGED
@@ -1,69 +1,3 @@
1
- /**
2
- * Available output modes for CLI commands.
3
- */
4
- type OutputMode = "human" | "json" | "jsonl" | "tree" | "table";
5
- /**
6
- * Options for the output() function.
7
- */
8
- interface OutputOptions {
9
- /** Force a specific output mode (overrides flag detection) */
10
- readonly mode?: OutputMode;
11
- /** Stream to write to (defaults to stdout) */
12
- readonly stream?: NodeJS.WritableStream;
13
- /** Whether to pretty-print JSON output */
14
- readonly pretty?: boolean;
15
- /** Exit code to use after output (undefined = don't exit) */
16
- readonly exitCode?: number;
17
- }
18
- /**
19
- * Output data to the console with automatic mode selection.
20
- *
21
- * Respects --json, --jsonl, --tree, --table flags automatically.
22
- * Defaults to human-friendly output when no flags are present.
23
- *
24
- * @param data - The data to output
25
- * @param options - Output configuration options
26
- *
27
- * @example
28
- * ```typescript
29
- * import { output } from "@outfitter/cli";
30
- *
31
- * // Basic usage - mode auto-detected from flags
32
- * output(results);
33
- *
34
- * // Force JSON mode
35
- * output(results, { mode: "json" });
36
- *
37
- * // Pretty-print JSON
38
- * output(results, { mode: "json", pretty: true });
39
- *
40
- * // Output to stderr
41
- * output(errors, { stream: process.stderr });
42
- *
43
- * // Await for large outputs (recommended)
44
- * await output(largeDataset, { mode: "jsonl" });
45
- * ```
46
- */
47
- declare function output(data: unknown, options?: OutputOptions): Promise<void>;
48
- /**
49
- * Exit the process with an error message.
50
- *
51
- * Formats the error according to the current output mode (human or JSON)
52
- * and exits with an appropriate exit code.
53
- *
54
- * @param error - The error to display
55
- * @returns Never returns (exits the process)
56
- *
57
- * @example
58
- * ```typescript
59
- * import { exitWithError } from "@outfitter/cli";
60
- *
61
- * try {
62
- * await riskyOperation();
63
- * } catch (error) {
64
- * exitWithError(error instanceof Error ? error : new Error(String(error)));
65
- * }
66
- * ```
67
- */
68
- declare function exitWithError(error: Error, options?: OutputOptions): never;
1
+ import { exitWithError, output } from "./shared/@outfitter/cli-72kg550t";
2
+ import "./shared/@outfitter/cli-ttt7r0j7";
69
3
  export { output, exitWithError };
package/dist/output.js CHANGED
@@ -1,155 +1,9 @@
1
1
  // @bun
2
- import"./shared/@outfitter/cli-4yy82cmp.js";
3
-
4
- // packages/cli/src/output.ts
5
2
  import {
6
- safeStringify as contractsSafeStringify,
7
- exitCodeMap
8
- } from "@outfitter/contracts";
9
- var DEFAULT_EXIT_CODE = 1;
10
- function writeWithBackpressure(stream, data) {
11
- return new Promise((resolve, reject) => {
12
- const canContinue = stream.write(data, (error) => {
13
- if (error)
14
- reject(error);
15
- });
16
- if (canContinue) {
17
- resolve();
18
- } else {
19
- stream.once("drain", () => resolve());
20
- stream.once("error", reject);
21
- }
22
- });
23
- }
24
- function detectMode(options) {
25
- if (options?.mode) {
26
- return options.mode;
27
- }
28
- const envJsonl = process.env["OUTFITTER_JSONL"];
29
- const envJson = process.env["OUTFITTER_JSON"];
30
- if (envJsonl === "1")
31
- return "jsonl";
32
- if (envJson === "1")
33
- return "json";
34
- if (envJsonl === "0" || envJson === "0")
35
- return "human";
36
- return process.stdout.isTTY ? "human" : "json";
37
- }
38
- function isValidCategory(category) {
39
- return category in exitCodeMap;
40
- }
41
- function safeStringify(value, pretty) {
42
- const wrappedValue = value === undefined ? null : value;
43
- return contractsSafeStringify(wrappedValue, pretty ? 2 : undefined);
44
- }
45
- function formatHuman(data) {
46
- if (data === null || data === undefined) {
47
- return "";
48
- }
49
- if (typeof data === "string") {
50
- return data;
51
- }
52
- if (typeof data === "number" || typeof data === "boolean") {
53
- return String(data);
54
- }
55
- if (Array.isArray(data)) {
56
- return data.map((item) => formatHuman(item)).join(`
57
- `);
58
- }
59
- if (typeof data === "object") {
60
- const lines = [];
61
- for (const [key, value] of Object.entries(data)) {
62
- lines.push(`${key}: ${formatHuman(value)}`);
63
- }
64
- return lines.join(`
65
- `);
66
- }
67
- return String(data);
68
- }
69
- function getErrorProperties(error) {
70
- const errorObj = error;
71
- return {
72
- _tag: errorObj._tag,
73
- category: errorObj.category,
74
- context: errorObj.context
75
- };
76
- }
77
- function getExitCode(error) {
78
- const { category } = getErrorProperties(error);
79
- if (category !== undefined && isValidCategory(category)) {
80
- return exitCodeMap[category];
81
- }
82
- return DEFAULT_EXIT_CODE;
83
- }
84
- function serializeErrorToJson(error) {
85
- const { _tag, category, context } = getErrorProperties(error);
86
- const result = {
87
- message: error.message
88
- };
89
- if (_tag !== undefined) {
90
- result._tag = _tag;
91
- }
92
- if (category !== undefined) {
93
- result.category = category;
94
- }
95
- if (context !== undefined) {
96
- result.context = context;
97
- }
98
- return JSON.stringify(result);
99
- }
100
- function formatErrorHuman(error) {
101
- const { _tag } = getErrorProperties(error);
102
- if (_tag) {
103
- return `${_tag}: ${error.message}`;
104
- }
105
- return error.message;
106
- }
107
- async function output(data, options) {
108
- const mode = detectMode(options);
109
- const stream = options?.stream ?? process.stdout;
110
- let outputText;
111
- switch (mode) {
112
- case "json": {
113
- const jsonData = data === undefined ? null : data;
114
- outputText = safeStringify(jsonData, options?.pretty);
115
- break;
116
- }
117
- case "jsonl": {
118
- if (Array.isArray(data)) {
119
- if (data.length === 0) {
120
- outputText = "";
121
- } else {
122
- outputText = data.map((item) => safeStringify(item)).join(`
123
- `);
124
- }
125
- } else {
126
- outputText = safeStringify(data);
127
- }
128
- break;
129
- }
130
- default: {
131
- outputText = formatHuman(data);
132
- break;
133
- }
134
- }
135
- if (outputText) {
136
- await writeWithBackpressure(stream, `${outputText}
137
- `);
138
- }
139
- }
140
- function exitWithError(error, options) {
141
- const exitCode = getExitCode(error);
142
- const mode = detectMode(options);
143
- const isJsonMode = mode === "json" || mode === "jsonl";
144
- if (isJsonMode) {
145
- process.stderr.write(`${serializeErrorToJson(error)}
146
- `);
147
- } else {
148
- process.stderr.write(`${formatErrorHuman(error)}
149
- `);
150
- }
151
- process.exit(exitCode);
152
- }
3
+ exitWithError,
4
+ output
5
+ } from "./shared/@outfitter/cli-zact3325.js";
6
+ import"./shared/@outfitter/cli-v1tzwxkt.js";
153
7
  export {
154
8
  output,
155
9
  exitWithError
@@ -1,37 +1,4 @@
1
- /**
2
- * State for paginated command results.
3
- */
4
- interface PaginationState {
5
- /** Cursor for the next page */
6
- readonly cursor: string;
7
- /** Command that generated this state */
8
- readonly command: string;
9
- /** Context key for scoping pagination */
10
- readonly context?: string;
11
- /** Timestamp when state was created */
12
- readonly timestamp: number;
13
- /** Whether there are more results */
14
- readonly hasMore: boolean;
15
- /** Total count (if known) */
16
- readonly total?: number;
17
- }
18
- /**
19
- * Options for cursor persistence operations.
20
- */
21
- interface CursorOptions {
22
- /** Command name for cursor scoping */
23
- readonly command: string;
24
- /** Context key for additional scoping */
25
- readonly context?: string;
26
- /** Tool name for XDG path resolution */
27
- readonly toolName: string;
28
- /** Maximum age in milliseconds before a cursor is treated as expired */
29
- readonly maxAgeMs?: number;
30
- /** Whether there are more results (defaults to true) */
31
- readonly hasMore?: boolean;
32
- /** Total count of results (if known) */
33
- readonly total?: number;
34
- }
1
+ import { CursorOptions, PaginationState } from "./shared/@outfitter/cli-ttt7r0j7";
35
2
  /**
36
3
  * Load persisted pagination state for a command.
37
4
  *
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./shared/@outfitter/cli-4yy82cmp.js";
2
+ import"./shared/@outfitter/cli-v1tzwxkt.js";
3
3
 
4
4
  // packages/cli/src/pagination.ts
5
5
  import fs from "fs";
@@ -0,0 +1,14 @@
1
+ import "../shared/@outfitter/cli-0v8vw1de";
2
+ import { renderTree } from "../shared/@outfitter/cli-3b7ed3rm";
3
+ import "../shared/@outfitter/cli-w7w7ta31";
4
+ import "../shared/@outfitter/cli-smckkdsq";
5
+ import "../shared/@outfitter/cli-zfqz333z";
6
+ import { BoxOptions, renderBox } from "../shared/@outfitter/cli-8xsmsbbd";
7
+ import "../shared/@outfitter/cli-mn8f7rh4";
8
+ import { TableOptions, renderTable } from "../shared/@outfitter/cli-qj83y5wj";
9
+ import "../shared/@outfitter/cli-yef5b9ds";
10
+ import { ListOptions, ListStyle, renderList } from "../shared/@outfitter/cli-b0tzqgnf";
11
+ import { BORDERS, BorderStyle, getBorderCharacters } from "../shared/@outfitter/cli-fakncnjp";
12
+ import "../shared/@outfitter/cli-qz47jk6d";
13
+ import { ANSI, Theme, Tokens, createTheme } from "../shared/@outfitter/cli-xsaheemc";
14
+ export { renderTree, renderTable, renderList, renderBox, getBorderCharacters, createTheme, Tokens, Theme, TableOptions, ListStyle, ListOptions, BoxOptions, BorderStyle, BORDERS, ANSI };
@@ -0,0 +1,41 @@
1
+ // @bun
2
+ import"../shared/@outfitter/cli-b5epywry.js";
3
+ import"../shared/@outfitter/cli-ktqme80d.js";
4
+ import"../shared/@outfitter/cli-x4cavvc0.js";
5
+ import"../shared/@outfitter/cli-f75h8e94.js";
6
+ import"../shared/@outfitter/cli-mq0jp15z.js";
7
+ import"../shared/@outfitter/cli-en6zn6sj.js";
8
+ import {
9
+ renderTree
10
+ } from "../shared/@outfitter/cli-b5c2k0d7.js";
11
+ import {
12
+ renderList
13
+ } from "../shared/@outfitter/cli-xg5y5fhk.js";
14
+ import {
15
+ renderTable
16
+ } from "../shared/@outfitter/cli-an9j0h80.js";
17
+ import {
18
+ renderBox
19
+ } from "../shared/@outfitter/cli-vp88gxev.js";
20
+ import"../shared/@outfitter/cli-jjemfdta.js";
21
+ import {
22
+ BORDERS,
23
+ getBorderCharacters
24
+ } from "../shared/@outfitter/cli-85fg2vr5.js";
25
+ import"../shared/@outfitter/cli-0psys2vm.js";
26
+ import {
27
+ ANSI,
28
+ createTheme
29
+ } from "../shared/@outfitter/cli-9nbyj2bt.js";
30
+ import"../shared/@outfitter/cli-d9ad0rqj.js";
31
+ import"../shared/@outfitter/cli-v1tzwxkt.js";
32
+ export {
33
+ renderTree,
34
+ renderTable,
35
+ renderList,
36
+ renderBox,
37
+ getBorderCharacters,
38
+ createTheme,
39
+ BORDERS,
40
+ ANSI
41
+ };
@@ -0,0 +1,11 @@
1
+ import "../shared/@outfitter/cli-smckkdsq";
2
+ import "../shared/@outfitter/cli-zfqz333z";
3
+ import { BoxOptions, renderBox } from "../shared/@outfitter/cli-8xsmsbbd";
4
+ import "../shared/@outfitter/cli-mn8f7rh4";
5
+ import { TableOptions, renderTable } from "../shared/@outfitter/cli-qj83y5wj";
6
+ import "../shared/@outfitter/cli-yef5b9ds";
7
+ import { ListOptions, ListStyle, renderList } from "../shared/@outfitter/cli-b0tzqgnf";
8
+ import "../shared/@outfitter/cli-fakncnjp";
9
+ import "../shared/@outfitter/cli-qz47jk6d";
10
+ import { ANSI, Theme, Tokens, createTheme } from "../shared/@outfitter/cli-xsaheemc";
11
+ export { renderTable, renderList, renderBox, createTheme, Tokens, Theme, TableOptions, ListStyle, ListOptions, BoxOptions, ANSI };
@@ -0,0 +1,30 @@
1
+ // @bun
2
+ import"../shared/@outfitter/cli-x4cavvc0.js";
3
+ import"../shared/@outfitter/cli-f75h8e94.js";
4
+ import"../shared/@outfitter/cli-mq0jp15z.js";
5
+ import"../shared/@outfitter/cli-en6zn6sj.js";
6
+ import {
7
+ renderList
8
+ } from "../shared/@outfitter/cli-xg5y5fhk.js";
9
+ import {
10
+ renderTable
11
+ } from "../shared/@outfitter/cli-an9j0h80.js";
12
+ import {
13
+ renderBox
14
+ } from "../shared/@outfitter/cli-vp88gxev.js";
15
+ import"../shared/@outfitter/cli-jjemfdta.js";
16
+ import"../shared/@outfitter/cli-85fg2vr5.js";
17
+ import"../shared/@outfitter/cli-0psys2vm.js";
18
+ import {
19
+ ANSI,
20
+ createTheme
21
+ } from "../shared/@outfitter/cli-9nbyj2bt.js";
22
+ import"../shared/@outfitter/cli-d9ad0rqj.js";
23
+ import"../shared/@outfitter/cli-v1tzwxkt.js";
24
+ export {
25
+ renderTable,
26
+ renderList,
27
+ renderBox,
28
+ createTheme,
29
+ ANSI
30
+ };
@@ -0,0 +1,4 @@
1
+ import { promptConfirm } from "../shared/@outfitter/cli-4w2a1rfy";
2
+ import "../shared/@outfitter/cli-3f12z5kf";
3
+ import "../shared/@outfitter/cli-vstbkzky";
4
+ export { promptConfirm };
@@ -0,0 +1,9 @@
1
+ // @bun
2
+ import {
3
+ promptConfirm
4
+ } from "../shared/@outfitter/cli-bcmcaz1b.js";
5
+ import"../shared/@outfitter/cli-8bwaw3pz.js";
6
+ import"../shared/@outfitter/cli-v1tzwxkt.js";
7
+ export {
8
+ promptConfirm
9
+ };
@@ -0,0 +1,4 @@
1
+ import { PromptStep, promptGroup } from "../shared/@outfitter/cli-tqewy503";
2
+ import "../shared/@outfitter/cli-3f12z5kf";
3
+ import "../shared/@outfitter/cli-vstbkzky";
4
+ export { promptGroup, PromptStep };
@@ -0,0 +1,9 @@
1
+ // @bun
2
+ import {
3
+ promptGroup
4
+ } from "../shared/@outfitter/cli-4x6pqnez.js";
5
+ import"../shared/@outfitter/cli-8bwaw3pz.js";
6
+ import"../shared/@outfitter/cli-v1tzwxkt.js";
7
+ export {
8
+ promptGroup
9
+ };
@@ -0,0 +1,7 @@
1
+ import { promptPassword, promptText } from "../shared/@outfitter/cli-8rx4g3s5";
2
+ import { promptConfirm } from "../shared/@outfitter/cli-4w2a1rfy";
3
+ import { PromptStep, promptGroup } from "../shared/@outfitter/cli-tqewy503";
4
+ import { promptMultiSelect, promptSelect } from "../shared/@outfitter/cli-y25tt8nc";
5
+ import { CancelledError, ConfirmPromptOptions, MultiSelectPromptOptions, PasswordPromptOptions, PromptResult, SelectPromptOptions, TextPromptOptions, createCancelledError } from "../shared/@outfitter/cli-3f12z5kf";
6
+ import { Validator, validators } from "../shared/@outfitter/cli-vstbkzky";
7
+ export { validators, promptText, promptSelect, promptPassword, promptMultiSelect, promptGroup, promptConfirm, createCancelledError, Validator, TextPromptOptions, SelectPromptOptions, PromptStep, PromptResult, PasswordPromptOptions, MultiSelectPromptOptions, ConfirmPromptOptions, CancelledError };
@@ -0,0 +1,32 @@
1
+ // @bun
2
+ import {
3
+ promptPassword,
4
+ promptText
5
+ } from "../shared/@outfitter/cli-snxj55n6.js";
6
+ import {
7
+ promptConfirm
8
+ } from "../shared/@outfitter/cli-bcmcaz1b.js";
9
+ import {
10
+ promptGroup
11
+ } from "../shared/@outfitter/cli-4x6pqnez.js";
12
+ import {
13
+ promptMultiSelect,
14
+ promptSelect
15
+ } from "../shared/@outfitter/cli-bf3vma4q.js";
16
+ import {
17
+ createCancelledError
18
+ } from "../shared/@outfitter/cli-8bwaw3pz.js";
19
+ import {
20
+ validators
21
+ } from "../shared/@outfitter/cli-n17gt1dz.js";
22
+ import"../shared/@outfitter/cli-v1tzwxkt.js";
23
+ export {
24
+ validators,
25
+ promptText,
26
+ promptSelect,
27
+ promptPassword,
28
+ promptMultiSelect,
29
+ promptGroup,
30
+ promptConfirm,
31
+ createCancelledError
32
+ };
@@ -0,0 +1,4 @@
1
+ import { promptMultiSelect, promptSelect } from "../shared/@outfitter/cli-y25tt8nc";
2
+ import "../shared/@outfitter/cli-3f12z5kf";
3
+ import "../shared/@outfitter/cli-vstbkzky";
4
+ export { promptSelect, promptMultiSelect };
@@ -0,0 +1,11 @@
1
+ // @bun
2
+ import {
3
+ promptMultiSelect,
4
+ promptSelect
5
+ } from "../shared/@outfitter/cli-bf3vma4q.js";
6
+ import"../shared/@outfitter/cli-8bwaw3pz.js";
7
+ import"../shared/@outfitter/cli-v1tzwxkt.js";
8
+ export {
9
+ promptSelect,
10
+ promptMultiSelect
11
+ };