@loomcli/core 0.2.0 → 0.3.0

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 (51) hide show
  1. package/dist/application.d.ts +59 -34
  2. package/dist/application.js +162 -59
  3. package/dist/chain.d.ts +25 -6
  4. package/dist/chain.js +99 -15
  5. package/dist/command.d.ts +146 -42
  6. package/dist/command.js +620 -78
  7. package/dist/environment.d.ts +22 -0
  8. package/dist/environment.js +1 -0
  9. package/dist/errors.d.ts +31 -59
  10. package/dist/errors.js +49 -106
  11. package/dist/extension.d.ts +5 -1
  12. package/dist/extension.js +18 -1
  13. package/dist/globals.d.ts +14 -25
  14. package/dist/globals.js +10 -61
  15. package/dist/glyphs.generated.d.ts +464 -0
  16. package/dist/glyphs.generated.js +491 -0
  17. package/dist/host.js +2 -1
  18. package/dist/index.d.ts +14 -5
  19. package/dist/index.js +5 -2
  20. package/dist/inspect.d.ts +26 -3
  21. package/dist/inspect.js +19 -5
  22. package/dist/lanes.d.ts +26 -0
  23. package/dist/lanes.js +45 -0
  24. package/dist/output.d.ts +93 -15
  25. package/dist/output.js +307 -34
  26. package/dist/plugin.d.ts +32 -16
  27. package/dist/plugin.js +46 -18
  28. package/dist/rendering.d.ts +21 -0
  29. package/dist/rendering.js +72 -0
  30. package/dist/sequence.d.ts +41 -0
  31. package/dist/sequence.js +225 -0
  32. package/dist/style-ansi.d.ts +13 -0
  33. package/dist/style-ansi.js +306 -0
  34. package/dist/style-layout.d.ts +29 -0
  35. package/dist/style-layout.js +228 -0
  36. package/dist/style-resolve.d.ts +6 -0
  37. package/dist/style-resolve.js +26 -0
  38. package/dist/style-state.d.ts +14 -0
  39. package/dist/style-state.js +179 -0
  40. package/dist/style-wire.d.ts +31 -0
  41. package/dist/style-wire.js +201 -0
  42. package/dist/style.d.ts +86 -0
  43. package/dist/style.js +201 -0
  44. package/dist/theme.d.ts +3 -0
  45. package/dist/theme.js +22 -0
  46. package/dist/types.d.ts +169 -21
  47. package/dist/validation.d.ts +8 -1
  48. package/dist/validation.js +17 -2
  49. package/dist/view.d.ts +180 -0
  50. package/dist/view.js +307 -0
  51. package/package.json +2 -1
@@ -0,0 +1,491 @@
1
+ // Generated by scripts/check-glyph-catalog.py from Inquirer a446ea9e273864a3653a26943f59b4fbe8003796.
2
+ /*
3
+ Copyright (c) 2025 Simon Boudrias
4
+
5
+ Permission is hereby granted, free of charge, to any person
6
+ obtaining a copy of this software and associated documentation
7
+ files (the "Software"), to deal in the Software without
8
+ restriction, including without limitation the rights to use,
9
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the
11
+ Software is furnished to do so, subject to the following
12
+ conditions:
13
+
14
+ The above copyright notice and this permission notice shall be
15
+ included in all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24
+ OTHER DEALINGS IN THE SOFTWARE.
25
+
26
+ */
27
+ import { frame } from './style.js';
28
+ export const glyphForms = {
29
+ circleQuestionMark: ["(?)", "(?)"],
30
+ questionMarkPrefix: ["(?)", "(?)"],
31
+ square: ["█", "█"],
32
+ squareDarkShade: ["▓", "▓"],
33
+ squareMediumShade: ["▒", "▒"],
34
+ squareLightShade: ["░", "░"],
35
+ squareTop: ["▀", "▀"],
36
+ squareBottom: ["▄", "▄"],
37
+ squareLeft: ["▌", "▌"],
38
+ squareRight: ["▐", "▐"],
39
+ squareCenter: ["■", "■"],
40
+ bullet: ["●", "●"],
41
+ dot: ["․", "․"],
42
+ ellipsis: ["…", "…"],
43
+ pointerSmall: ["›", "›"],
44
+ triangleUp: ["▲", "▲"],
45
+ triangleUpSmall: ["▴", "▴"],
46
+ triangleDown: ["▼", "▼"],
47
+ triangleDownSmall: ["▾", "▾"],
48
+ triangleLeftSmall: ["◂", "◂"],
49
+ triangleRightSmall: ["▸", "▸"],
50
+ home: ["⌂", "⌂"],
51
+ heart: ["♥", "♥"],
52
+ musicNote: ["♪", "♪"],
53
+ musicNoteBeamed: ["♫", "♫"],
54
+ arrowUp: ["↑", "↑"],
55
+ arrowDown: ["↓", "↓"],
56
+ arrowLeft: ["←", "←"],
57
+ arrowRight: ["→", "→"],
58
+ arrowLeftRight: ["↔", "↔"],
59
+ arrowUpDown: ["↕", "↕"],
60
+ almostEqual: ["≈", "≈"],
61
+ notEqual: ["≠", "≠"],
62
+ lessOrEqual: ["≤", "≤"],
63
+ greaterOrEqual: ["≥", "≥"],
64
+ identical: ["≡", "≡"],
65
+ infinity: ["∞", "∞"],
66
+ subscriptZero: ["₀", "₀"],
67
+ subscriptOne: ["₁", "₁"],
68
+ subscriptTwo: ["₂", "₂"],
69
+ subscriptThree: ["₃", "₃"],
70
+ subscriptFour: ["₄", "₄"],
71
+ subscriptFive: ["₅", "₅"],
72
+ subscriptSix: ["₆", "₆"],
73
+ subscriptSeven: ["₇", "₇"],
74
+ subscriptEight: ["₈", "₈"],
75
+ subscriptNine: ["₉", "₉"],
76
+ oneHalf: ["½", "½"],
77
+ oneThird: ["⅓", "⅓"],
78
+ oneQuarter: ["¼", "¼"],
79
+ oneFifth: ["⅕", "⅕"],
80
+ oneSixth: ["⅙", "⅙"],
81
+ oneEighth: ["⅛", "⅛"],
82
+ twoThirds: ["⅔", "⅔"],
83
+ twoFifths: ["⅖", "⅖"],
84
+ threeQuarters: ["¾", "¾"],
85
+ threeFifths: ["⅗", "⅗"],
86
+ threeEighths: ["⅜", "⅜"],
87
+ fourFifths: ["⅘", "⅘"],
88
+ fiveSixths: ["⅚", "⅚"],
89
+ fiveEighths: ["⅝", "⅝"],
90
+ sevenEighths: ["⅞", "⅞"],
91
+ line: ["─", "─"],
92
+ lineBold: ["━", "━"],
93
+ lineDouble: ["═", "═"],
94
+ lineDashed0: ["┄", "┄"],
95
+ lineDashed1: ["┅", "┅"],
96
+ lineDashed2: ["┈", "┈"],
97
+ lineDashed3: ["┉", "┉"],
98
+ lineDashed4: ["╌", "╌"],
99
+ lineDashed5: ["╍", "╍"],
100
+ lineDashed6: ["╴", "╴"],
101
+ lineDashed7: ["╶", "╶"],
102
+ lineDashed8: ["╸", "╸"],
103
+ lineDashed9: ["╺", "╺"],
104
+ lineDashed10: ["╼", "╼"],
105
+ lineDashed11: ["╾", "╾"],
106
+ lineDashed12: ["−", "−"],
107
+ lineDashed13: ["–", "–"],
108
+ lineDashed14: ["‐", "‐"],
109
+ lineDashed15: ["⁃", "⁃"],
110
+ lineVertical: ["│", "│"],
111
+ lineVerticalBold: ["┃", "┃"],
112
+ lineVerticalDouble: ["║", "║"],
113
+ lineVerticalDashed0: ["┆", "┆"],
114
+ lineVerticalDashed1: ["┇", "┇"],
115
+ lineVerticalDashed2: ["┊", "┊"],
116
+ lineVerticalDashed3: ["┋", "┋"],
117
+ lineVerticalDashed4: ["╎", "╎"],
118
+ lineVerticalDashed5: ["╏", "╏"],
119
+ lineVerticalDashed6: ["╵", "╵"],
120
+ lineVerticalDashed7: ["╷", "╷"],
121
+ lineVerticalDashed8: ["╹", "╹"],
122
+ lineVerticalDashed9: ["╻", "╻"],
123
+ lineVerticalDashed10: ["╽", "╽"],
124
+ lineVerticalDashed11: ["╿", "╿"],
125
+ lineDownLeft: ["┐", "┐"],
126
+ lineDownLeftArc: ["╮", "╮"],
127
+ lineDownBoldLeftBold: ["┓", "┓"],
128
+ lineDownBoldLeft: ["┒", "┒"],
129
+ lineDownLeftBold: ["┑", "┑"],
130
+ lineDownDoubleLeftDouble: ["╗", "╗"],
131
+ lineDownDoubleLeft: ["╖", "╖"],
132
+ lineDownLeftDouble: ["╕", "╕"],
133
+ lineDownRight: ["┌", "┌"],
134
+ lineDownRightArc: ["╭", "╭"],
135
+ lineDownBoldRightBold: ["┏", "┏"],
136
+ lineDownBoldRight: ["┎", "┎"],
137
+ lineDownRightBold: ["┍", "┍"],
138
+ lineDownDoubleRightDouble: ["╔", "╔"],
139
+ lineDownDoubleRight: ["╓", "╓"],
140
+ lineDownRightDouble: ["╒", "╒"],
141
+ lineUpLeft: ["┘", "┘"],
142
+ lineUpLeftArc: ["╯", "╯"],
143
+ lineUpBoldLeftBold: ["┛", "┛"],
144
+ lineUpBoldLeft: ["┚", "┚"],
145
+ lineUpLeftBold: ["┙", "┙"],
146
+ lineUpDoubleLeftDouble: ["╝", "╝"],
147
+ lineUpDoubleLeft: ["╜", "╜"],
148
+ lineUpLeftDouble: ["╛", "╛"],
149
+ lineUpRight: ["└", "└"],
150
+ lineUpRightArc: ["╰", "╰"],
151
+ lineUpBoldRightBold: ["┗", "┗"],
152
+ lineUpBoldRight: ["┖", "┖"],
153
+ lineUpRightBold: ["┕", "┕"],
154
+ lineUpDoubleRightDouble: ["╚", "╚"],
155
+ lineUpDoubleRight: ["╙", "╙"],
156
+ lineUpRightDouble: ["╘", "╘"],
157
+ lineUpDownLeft: ["┤", "┤"],
158
+ lineUpBoldDownBoldLeftBold: ["┫", "┫"],
159
+ lineUpBoldDownBoldLeft: ["┨", "┨"],
160
+ lineUpDownLeftBold: ["┥", "┥"],
161
+ lineUpBoldDownLeftBold: ["┩", "┩"],
162
+ lineUpDownBoldLeftBold: ["┪", "┪"],
163
+ lineUpDownBoldLeft: ["┧", "┧"],
164
+ lineUpBoldDownLeft: ["┦", "┦"],
165
+ lineUpDoubleDownDoubleLeftDouble: ["╣", "╣"],
166
+ lineUpDoubleDownDoubleLeft: ["╢", "╢"],
167
+ lineUpDownLeftDouble: ["╡", "╡"],
168
+ lineUpDownRight: ["├", "├"],
169
+ lineUpBoldDownBoldRightBold: ["┣", "┣"],
170
+ lineUpBoldDownBoldRight: ["┠", "┠"],
171
+ lineUpDownRightBold: ["┝", "┝"],
172
+ lineUpBoldDownRightBold: ["┡", "┡"],
173
+ lineUpDownBoldRightBold: ["┢", "┢"],
174
+ lineUpDownBoldRight: ["┟", "┟"],
175
+ lineUpBoldDownRight: ["┞", "┞"],
176
+ lineUpDoubleDownDoubleRightDouble: ["╠", "╠"],
177
+ lineUpDoubleDownDoubleRight: ["╟", "╟"],
178
+ lineUpDownRightDouble: ["╞", "╞"],
179
+ lineDownLeftRight: ["┬", "┬"],
180
+ lineDownBoldLeftBoldRightBold: ["┳", "┳"],
181
+ lineDownLeftBoldRightBold: ["┯", "┯"],
182
+ lineDownBoldLeftRight: ["┰", "┰"],
183
+ lineDownBoldLeftBoldRight: ["┱", "┱"],
184
+ lineDownBoldLeftRightBold: ["┲", "┲"],
185
+ lineDownLeftRightBold: ["┮", "┮"],
186
+ lineDownLeftBoldRight: ["┭", "┭"],
187
+ lineDownDoubleLeftDoubleRightDouble: ["╦", "╦"],
188
+ lineDownDoubleLeftRight: ["╥", "╥"],
189
+ lineDownLeftDoubleRightDouble: ["╤", "╤"],
190
+ lineUpLeftRight: ["┴", "┴"],
191
+ lineUpBoldLeftBoldRightBold: ["┻", "┻"],
192
+ lineUpLeftBoldRightBold: ["┷", "┷"],
193
+ lineUpBoldLeftRight: ["┸", "┸"],
194
+ lineUpBoldLeftBoldRight: ["┹", "┹"],
195
+ lineUpBoldLeftRightBold: ["┺", "┺"],
196
+ lineUpLeftRightBold: ["┶", "┶"],
197
+ lineUpLeftBoldRight: ["┵", "┵"],
198
+ lineUpDoubleLeftDoubleRightDouble: ["╩", "╩"],
199
+ lineUpDoubleLeftRight: ["╨", "╨"],
200
+ lineUpLeftDoubleRightDouble: ["╧", "╧"],
201
+ lineUpDownLeftRight: ["┼", "┼"],
202
+ lineUpBoldDownBoldLeftBoldRightBold: ["╋", "╋"],
203
+ lineUpDownBoldLeftBoldRightBold: ["╈", "╈"],
204
+ lineUpBoldDownLeftBoldRightBold: ["╇", "╇"],
205
+ lineUpBoldDownBoldLeftRightBold: ["╊", "╊"],
206
+ lineUpBoldDownBoldLeftBoldRight: ["╉", "╉"],
207
+ lineUpBoldDownLeftRight: ["╀", "╀"],
208
+ lineUpDownBoldLeftRight: ["╁", "╁"],
209
+ lineUpDownLeftBoldRight: ["┽", "┽"],
210
+ lineUpDownLeftRightBold: ["┾", "┾"],
211
+ lineUpBoldDownBoldLeftRight: ["╂", "╂"],
212
+ lineUpDownLeftBoldRightBold: ["┿", "┿"],
213
+ lineUpBoldDownLeftBoldRight: ["╃", "╃"],
214
+ lineUpBoldDownLeftRightBold: ["╄", "╄"],
215
+ lineUpDownBoldLeftBoldRight: ["╅", "╅"],
216
+ lineUpDownBoldLeftRightBold: ["╆", "╆"],
217
+ lineUpDoubleDownDoubleLeftDoubleRightDouble: ["╬", "╬"],
218
+ lineUpDoubleDownDoubleLeftRight: ["╫", "╫"],
219
+ lineUpDownLeftDoubleRightDouble: ["╪", "╪"],
220
+ lineCross: ["╳", "╳"],
221
+ lineBackslash: ["╲", "╲"],
222
+ lineSlash: ["╱", "╱"],
223
+ tick: ["✔", "√"],
224
+ info: ["ℹ", "i"],
225
+ warning: ["⚠", "‼"],
226
+ cross: ["✘", "×"],
227
+ squareSmall: ["◻", "□"],
228
+ squareSmallFilled: ["◼", "■"],
229
+ circle: ["◯", "( )"],
230
+ circleFilled: ["◉", "(*)"],
231
+ circleDotted: ["◌", "( )"],
232
+ circleDouble: ["◎", "( )"],
233
+ circleCircle: ["ⓞ", "(○)"],
234
+ circleCross: ["ⓧ", "(×)"],
235
+ circlePipe: ["Ⓘ", "(│)"],
236
+ radioOn: ["◉", "(*)"],
237
+ radioOff: ["◯", "( )"],
238
+ checkboxOn: ["☒", "[×]"],
239
+ checkboxOff: ["☐", "[ ]"],
240
+ checkboxCircleOn: ["ⓧ", "(×)"],
241
+ checkboxCircleOff: ["Ⓘ", "( )"],
242
+ pointer: ["❯", ">"],
243
+ triangleUpOutline: ["△", "∆"],
244
+ triangleLeft: ["◀", "◄"],
245
+ triangleRight: ["▶", "►"],
246
+ lozenge: ["◆", "♦"],
247
+ lozengeOutline: ["◇", "◊"],
248
+ hamburger: ["☰", "≡"],
249
+ smiley: ["㋡", "☺"],
250
+ mustache: ["෴", "┌─┐"],
251
+ star: ["★", "✶"],
252
+ play: ["▶", "►"],
253
+ nodejs: ["⬢", "♦"],
254
+ oneSeventh: ["⅐", "1/7"],
255
+ oneNinth: ["⅑", "1/9"],
256
+ oneTenth: ["⅒", "1/10"],
257
+ success: ["✔", "√"],
258
+ error: ["✘", "×"],
259
+ };
260
+ export const glyph = Object.freeze({
261
+ circleQuestionMark: frame(['glyph', 'circleQuestionMark'], ''),
262
+ questionMarkPrefix: frame(['glyph', 'questionMarkPrefix'], ''),
263
+ square: frame(['glyph', 'square'], ''),
264
+ squareDarkShade: frame(['glyph', 'squareDarkShade'], ''),
265
+ squareMediumShade: frame(['glyph', 'squareMediumShade'], ''),
266
+ squareLightShade: frame(['glyph', 'squareLightShade'], ''),
267
+ squareTop: frame(['glyph', 'squareTop'], ''),
268
+ squareBottom: frame(['glyph', 'squareBottom'], ''),
269
+ squareLeft: frame(['glyph', 'squareLeft'], ''),
270
+ squareRight: frame(['glyph', 'squareRight'], ''),
271
+ squareCenter: frame(['glyph', 'squareCenter'], ''),
272
+ bullet: frame(['glyph', 'bullet'], ''),
273
+ dot: frame(['glyph', 'dot'], ''),
274
+ ellipsis: frame(['glyph', 'ellipsis'], ''),
275
+ pointerSmall: frame(['glyph', 'pointerSmall'], ''),
276
+ triangleUp: frame(['glyph', 'triangleUp'], ''),
277
+ triangleUpSmall: frame(['glyph', 'triangleUpSmall'], ''),
278
+ triangleDown: frame(['glyph', 'triangleDown'], ''),
279
+ triangleDownSmall: frame(['glyph', 'triangleDownSmall'], ''),
280
+ triangleLeftSmall: frame(['glyph', 'triangleLeftSmall'], ''),
281
+ triangleRightSmall: frame(['glyph', 'triangleRightSmall'], ''),
282
+ home: frame(['glyph', 'home'], ''),
283
+ heart: frame(['glyph', 'heart'], ''),
284
+ musicNote: frame(['glyph', 'musicNote'], ''),
285
+ musicNoteBeamed: frame(['glyph', 'musicNoteBeamed'], ''),
286
+ arrowUp: frame(['glyph', 'arrowUp'], ''),
287
+ arrowDown: frame(['glyph', 'arrowDown'], ''),
288
+ arrowLeft: frame(['glyph', 'arrowLeft'], ''),
289
+ arrowRight: frame(['glyph', 'arrowRight'], ''),
290
+ arrowLeftRight: frame(['glyph', 'arrowLeftRight'], ''),
291
+ arrowUpDown: frame(['glyph', 'arrowUpDown'], ''),
292
+ almostEqual: frame(['glyph', 'almostEqual'], ''),
293
+ notEqual: frame(['glyph', 'notEqual'], ''),
294
+ lessOrEqual: frame(['glyph', 'lessOrEqual'], ''),
295
+ greaterOrEqual: frame(['glyph', 'greaterOrEqual'], ''),
296
+ identical: frame(['glyph', 'identical'], ''),
297
+ infinity: frame(['glyph', 'infinity'], ''),
298
+ subscriptZero: frame(['glyph', 'subscriptZero'], ''),
299
+ subscriptOne: frame(['glyph', 'subscriptOne'], ''),
300
+ subscriptTwo: frame(['glyph', 'subscriptTwo'], ''),
301
+ subscriptThree: frame(['glyph', 'subscriptThree'], ''),
302
+ subscriptFour: frame(['glyph', 'subscriptFour'], ''),
303
+ subscriptFive: frame(['glyph', 'subscriptFive'], ''),
304
+ subscriptSix: frame(['glyph', 'subscriptSix'], ''),
305
+ subscriptSeven: frame(['glyph', 'subscriptSeven'], ''),
306
+ subscriptEight: frame(['glyph', 'subscriptEight'], ''),
307
+ subscriptNine: frame(['glyph', 'subscriptNine'], ''),
308
+ oneHalf: frame(['glyph', 'oneHalf'], ''),
309
+ oneThird: frame(['glyph', 'oneThird'], ''),
310
+ oneQuarter: frame(['glyph', 'oneQuarter'], ''),
311
+ oneFifth: frame(['glyph', 'oneFifth'], ''),
312
+ oneSixth: frame(['glyph', 'oneSixth'], ''),
313
+ oneEighth: frame(['glyph', 'oneEighth'], ''),
314
+ twoThirds: frame(['glyph', 'twoThirds'], ''),
315
+ twoFifths: frame(['glyph', 'twoFifths'], ''),
316
+ threeQuarters: frame(['glyph', 'threeQuarters'], ''),
317
+ threeFifths: frame(['glyph', 'threeFifths'], ''),
318
+ threeEighths: frame(['glyph', 'threeEighths'], ''),
319
+ fourFifths: frame(['glyph', 'fourFifths'], ''),
320
+ fiveSixths: frame(['glyph', 'fiveSixths'], ''),
321
+ fiveEighths: frame(['glyph', 'fiveEighths'], ''),
322
+ sevenEighths: frame(['glyph', 'sevenEighths'], ''),
323
+ line: frame(['glyph', 'line'], ''),
324
+ lineBold: frame(['glyph', 'lineBold'], ''),
325
+ lineDouble: frame(['glyph', 'lineDouble'], ''),
326
+ lineDashed0: frame(['glyph', 'lineDashed0'], ''),
327
+ lineDashed1: frame(['glyph', 'lineDashed1'], ''),
328
+ lineDashed2: frame(['glyph', 'lineDashed2'], ''),
329
+ lineDashed3: frame(['glyph', 'lineDashed3'], ''),
330
+ lineDashed4: frame(['glyph', 'lineDashed4'], ''),
331
+ lineDashed5: frame(['glyph', 'lineDashed5'], ''),
332
+ lineDashed6: frame(['glyph', 'lineDashed6'], ''),
333
+ lineDashed7: frame(['glyph', 'lineDashed7'], ''),
334
+ lineDashed8: frame(['glyph', 'lineDashed8'], ''),
335
+ lineDashed9: frame(['glyph', 'lineDashed9'], ''),
336
+ lineDashed10: frame(['glyph', 'lineDashed10'], ''),
337
+ lineDashed11: frame(['glyph', 'lineDashed11'], ''),
338
+ lineDashed12: frame(['glyph', 'lineDashed12'], ''),
339
+ lineDashed13: frame(['glyph', 'lineDashed13'], ''),
340
+ lineDashed14: frame(['glyph', 'lineDashed14'], ''),
341
+ lineDashed15: frame(['glyph', 'lineDashed15'], ''),
342
+ lineVertical: frame(['glyph', 'lineVertical'], ''),
343
+ lineVerticalBold: frame(['glyph', 'lineVerticalBold'], ''),
344
+ lineVerticalDouble: frame(['glyph', 'lineVerticalDouble'], ''),
345
+ lineVerticalDashed0: frame(['glyph', 'lineVerticalDashed0'], ''),
346
+ lineVerticalDashed1: frame(['glyph', 'lineVerticalDashed1'], ''),
347
+ lineVerticalDashed2: frame(['glyph', 'lineVerticalDashed2'], ''),
348
+ lineVerticalDashed3: frame(['glyph', 'lineVerticalDashed3'], ''),
349
+ lineVerticalDashed4: frame(['glyph', 'lineVerticalDashed4'], ''),
350
+ lineVerticalDashed5: frame(['glyph', 'lineVerticalDashed5'], ''),
351
+ lineVerticalDashed6: frame(['glyph', 'lineVerticalDashed6'], ''),
352
+ lineVerticalDashed7: frame(['glyph', 'lineVerticalDashed7'], ''),
353
+ lineVerticalDashed8: frame(['glyph', 'lineVerticalDashed8'], ''),
354
+ lineVerticalDashed9: frame(['glyph', 'lineVerticalDashed9'], ''),
355
+ lineVerticalDashed10: frame(['glyph', 'lineVerticalDashed10'], ''),
356
+ lineVerticalDashed11: frame(['glyph', 'lineVerticalDashed11'], ''),
357
+ lineDownLeft: frame(['glyph', 'lineDownLeft'], ''),
358
+ lineDownLeftArc: frame(['glyph', 'lineDownLeftArc'], ''),
359
+ lineDownBoldLeftBold: frame(['glyph', 'lineDownBoldLeftBold'], ''),
360
+ lineDownBoldLeft: frame(['glyph', 'lineDownBoldLeft'], ''),
361
+ lineDownLeftBold: frame(['glyph', 'lineDownLeftBold'], ''),
362
+ lineDownDoubleLeftDouble: frame(['glyph', 'lineDownDoubleLeftDouble'], ''),
363
+ lineDownDoubleLeft: frame(['glyph', 'lineDownDoubleLeft'], ''),
364
+ lineDownLeftDouble: frame(['glyph', 'lineDownLeftDouble'], ''),
365
+ lineDownRight: frame(['glyph', 'lineDownRight'], ''),
366
+ lineDownRightArc: frame(['glyph', 'lineDownRightArc'], ''),
367
+ lineDownBoldRightBold: frame(['glyph', 'lineDownBoldRightBold'], ''),
368
+ lineDownBoldRight: frame(['glyph', 'lineDownBoldRight'], ''),
369
+ lineDownRightBold: frame(['glyph', 'lineDownRightBold'], ''),
370
+ lineDownDoubleRightDouble: frame(['glyph', 'lineDownDoubleRightDouble'], ''),
371
+ lineDownDoubleRight: frame(['glyph', 'lineDownDoubleRight'], ''),
372
+ lineDownRightDouble: frame(['glyph', 'lineDownRightDouble'], ''),
373
+ lineUpLeft: frame(['glyph', 'lineUpLeft'], ''),
374
+ lineUpLeftArc: frame(['glyph', 'lineUpLeftArc'], ''),
375
+ lineUpBoldLeftBold: frame(['glyph', 'lineUpBoldLeftBold'], ''),
376
+ lineUpBoldLeft: frame(['glyph', 'lineUpBoldLeft'], ''),
377
+ lineUpLeftBold: frame(['glyph', 'lineUpLeftBold'], ''),
378
+ lineUpDoubleLeftDouble: frame(['glyph', 'lineUpDoubleLeftDouble'], ''),
379
+ lineUpDoubleLeft: frame(['glyph', 'lineUpDoubleLeft'], ''),
380
+ lineUpLeftDouble: frame(['glyph', 'lineUpLeftDouble'], ''),
381
+ lineUpRight: frame(['glyph', 'lineUpRight'], ''),
382
+ lineUpRightArc: frame(['glyph', 'lineUpRightArc'], ''),
383
+ lineUpBoldRightBold: frame(['glyph', 'lineUpBoldRightBold'], ''),
384
+ lineUpBoldRight: frame(['glyph', 'lineUpBoldRight'], ''),
385
+ lineUpRightBold: frame(['glyph', 'lineUpRightBold'], ''),
386
+ lineUpDoubleRightDouble: frame(['glyph', 'lineUpDoubleRightDouble'], ''),
387
+ lineUpDoubleRight: frame(['glyph', 'lineUpDoubleRight'], ''),
388
+ lineUpRightDouble: frame(['glyph', 'lineUpRightDouble'], ''),
389
+ lineUpDownLeft: frame(['glyph', 'lineUpDownLeft'], ''),
390
+ lineUpBoldDownBoldLeftBold: frame(['glyph', 'lineUpBoldDownBoldLeftBold'], ''),
391
+ lineUpBoldDownBoldLeft: frame(['glyph', 'lineUpBoldDownBoldLeft'], ''),
392
+ lineUpDownLeftBold: frame(['glyph', 'lineUpDownLeftBold'], ''),
393
+ lineUpBoldDownLeftBold: frame(['glyph', 'lineUpBoldDownLeftBold'], ''),
394
+ lineUpDownBoldLeftBold: frame(['glyph', 'lineUpDownBoldLeftBold'], ''),
395
+ lineUpDownBoldLeft: frame(['glyph', 'lineUpDownBoldLeft'], ''),
396
+ lineUpBoldDownLeft: frame(['glyph', 'lineUpBoldDownLeft'], ''),
397
+ lineUpDoubleDownDoubleLeftDouble: frame(['glyph', 'lineUpDoubleDownDoubleLeftDouble'], ''),
398
+ lineUpDoubleDownDoubleLeft: frame(['glyph', 'lineUpDoubleDownDoubleLeft'], ''),
399
+ lineUpDownLeftDouble: frame(['glyph', 'lineUpDownLeftDouble'], ''),
400
+ lineUpDownRight: frame(['glyph', 'lineUpDownRight'], ''),
401
+ lineUpBoldDownBoldRightBold: frame(['glyph', 'lineUpBoldDownBoldRightBold'], ''),
402
+ lineUpBoldDownBoldRight: frame(['glyph', 'lineUpBoldDownBoldRight'], ''),
403
+ lineUpDownRightBold: frame(['glyph', 'lineUpDownRightBold'], ''),
404
+ lineUpBoldDownRightBold: frame(['glyph', 'lineUpBoldDownRightBold'], ''),
405
+ lineUpDownBoldRightBold: frame(['glyph', 'lineUpDownBoldRightBold'], ''),
406
+ lineUpDownBoldRight: frame(['glyph', 'lineUpDownBoldRight'], ''),
407
+ lineUpBoldDownRight: frame(['glyph', 'lineUpBoldDownRight'], ''),
408
+ lineUpDoubleDownDoubleRightDouble: frame(['glyph', 'lineUpDoubleDownDoubleRightDouble'], ''),
409
+ lineUpDoubleDownDoubleRight: frame(['glyph', 'lineUpDoubleDownDoubleRight'], ''),
410
+ lineUpDownRightDouble: frame(['glyph', 'lineUpDownRightDouble'], ''),
411
+ lineDownLeftRight: frame(['glyph', 'lineDownLeftRight'], ''),
412
+ lineDownBoldLeftBoldRightBold: frame(['glyph', 'lineDownBoldLeftBoldRightBold'], ''),
413
+ lineDownLeftBoldRightBold: frame(['glyph', 'lineDownLeftBoldRightBold'], ''),
414
+ lineDownBoldLeftRight: frame(['glyph', 'lineDownBoldLeftRight'], ''),
415
+ lineDownBoldLeftBoldRight: frame(['glyph', 'lineDownBoldLeftBoldRight'], ''),
416
+ lineDownBoldLeftRightBold: frame(['glyph', 'lineDownBoldLeftRightBold'], ''),
417
+ lineDownLeftRightBold: frame(['glyph', 'lineDownLeftRightBold'], ''),
418
+ lineDownLeftBoldRight: frame(['glyph', 'lineDownLeftBoldRight'], ''),
419
+ lineDownDoubleLeftDoubleRightDouble: frame(['glyph', 'lineDownDoubleLeftDoubleRightDouble'], ''),
420
+ lineDownDoubleLeftRight: frame(['glyph', 'lineDownDoubleLeftRight'], ''),
421
+ lineDownLeftDoubleRightDouble: frame(['glyph', 'lineDownLeftDoubleRightDouble'], ''),
422
+ lineUpLeftRight: frame(['glyph', 'lineUpLeftRight'], ''),
423
+ lineUpBoldLeftBoldRightBold: frame(['glyph', 'lineUpBoldLeftBoldRightBold'], ''),
424
+ lineUpLeftBoldRightBold: frame(['glyph', 'lineUpLeftBoldRightBold'], ''),
425
+ lineUpBoldLeftRight: frame(['glyph', 'lineUpBoldLeftRight'], ''),
426
+ lineUpBoldLeftBoldRight: frame(['glyph', 'lineUpBoldLeftBoldRight'], ''),
427
+ lineUpBoldLeftRightBold: frame(['glyph', 'lineUpBoldLeftRightBold'], ''),
428
+ lineUpLeftRightBold: frame(['glyph', 'lineUpLeftRightBold'], ''),
429
+ lineUpLeftBoldRight: frame(['glyph', 'lineUpLeftBoldRight'], ''),
430
+ lineUpDoubleLeftDoubleRightDouble: frame(['glyph', 'lineUpDoubleLeftDoubleRightDouble'], ''),
431
+ lineUpDoubleLeftRight: frame(['glyph', 'lineUpDoubleLeftRight'], ''),
432
+ lineUpLeftDoubleRightDouble: frame(['glyph', 'lineUpLeftDoubleRightDouble'], ''),
433
+ lineUpDownLeftRight: frame(['glyph', 'lineUpDownLeftRight'], ''),
434
+ lineUpBoldDownBoldLeftBoldRightBold: frame(['glyph', 'lineUpBoldDownBoldLeftBoldRightBold'], ''),
435
+ lineUpDownBoldLeftBoldRightBold: frame(['glyph', 'lineUpDownBoldLeftBoldRightBold'], ''),
436
+ lineUpBoldDownLeftBoldRightBold: frame(['glyph', 'lineUpBoldDownLeftBoldRightBold'], ''),
437
+ lineUpBoldDownBoldLeftRightBold: frame(['glyph', 'lineUpBoldDownBoldLeftRightBold'], ''),
438
+ lineUpBoldDownBoldLeftBoldRight: frame(['glyph', 'lineUpBoldDownBoldLeftBoldRight'], ''),
439
+ lineUpBoldDownLeftRight: frame(['glyph', 'lineUpBoldDownLeftRight'], ''),
440
+ lineUpDownBoldLeftRight: frame(['glyph', 'lineUpDownBoldLeftRight'], ''),
441
+ lineUpDownLeftBoldRight: frame(['glyph', 'lineUpDownLeftBoldRight'], ''),
442
+ lineUpDownLeftRightBold: frame(['glyph', 'lineUpDownLeftRightBold'], ''),
443
+ lineUpBoldDownBoldLeftRight: frame(['glyph', 'lineUpBoldDownBoldLeftRight'], ''),
444
+ lineUpDownLeftBoldRightBold: frame(['glyph', 'lineUpDownLeftBoldRightBold'], ''),
445
+ lineUpBoldDownLeftBoldRight: frame(['glyph', 'lineUpBoldDownLeftBoldRight'], ''),
446
+ lineUpBoldDownLeftRightBold: frame(['glyph', 'lineUpBoldDownLeftRightBold'], ''),
447
+ lineUpDownBoldLeftBoldRight: frame(['glyph', 'lineUpDownBoldLeftBoldRight'], ''),
448
+ lineUpDownBoldLeftRightBold: frame(['glyph', 'lineUpDownBoldLeftRightBold'], ''),
449
+ lineUpDoubleDownDoubleLeftDoubleRightDouble: frame(['glyph', 'lineUpDoubleDownDoubleLeftDoubleRightDouble'], ''),
450
+ lineUpDoubleDownDoubleLeftRight: frame(['glyph', 'lineUpDoubleDownDoubleLeftRight'], ''),
451
+ lineUpDownLeftDoubleRightDouble: frame(['glyph', 'lineUpDownLeftDoubleRightDouble'], ''),
452
+ lineCross: frame(['glyph', 'lineCross'], ''),
453
+ lineBackslash: frame(['glyph', 'lineBackslash'], ''),
454
+ lineSlash: frame(['glyph', 'lineSlash'], ''),
455
+ tick: frame(['glyph', 'tick'], ''),
456
+ info: frame(['glyph', 'info'], ''),
457
+ warning: frame(['glyph', 'warning'], ''),
458
+ cross: frame(['glyph', 'cross'], ''),
459
+ squareSmall: frame(['glyph', 'squareSmall'], ''),
460
+ squareSmallFilled: frame(['glyph', 'squareSmallFilled'], ''),
461
+ circle: frame(['glyph', 'circle'], ''),
462
+ circleFilled: frame(['glyph', 'circleFilled'], ''),
463
+ circleDotted: frame(['glyph', 'circleDotted'], ''),
464
+ circleDouble: frame(['glyph', 'circleDouble'], ''),
465
+ circleCircle: frame(['glyph', 'circleCircle'], ''),
466
+ circleCross: frame(['glyph', 'circleCross'], ''),
467
+ circlePipe: frame(['glyph', 'circlePipe'], ''),
468
+ radioOn: frame(['glyph', 'radioOn'], ''),
469
+ radioOff: frame(['glyph', 'radioOff'], ''),
470
+ checkboxOn: frame(['glyph', 'checkboxOn'], ''),
471
+ checkboxOff: frame(['glyph', 'checkboxOff'], ''),
472
+ checkboxCircleOn: frame(['glyph', 'checkboxCircleOn'], ''),
473
+ checkboxCircleOff: frame(['glyph', 'checkboxCircleOff'], ''),
474
+ pointer: frame(['glyph', 'pointer'], ''),
475
+ triangleUpOutline: frame(['glyph', 'triangleUpOutline'], ''),
476
+ triangleLeft: frame(['glyph', 'triangleLeft'], ''),
477
+ triangleRight: frame(['glyph', 'triangleRight'], ''),
478
+ lozenge: frame(['glyph', 'lozenge'], ''),
479
+ lozengeOutline: frame(['glyph', 'lozengeOutline'], ''),
480
+ hamburger: frame(['glyph', 'hamburger'], ''),
481
+ smiley: frame(['glyph', 'smiley'], ''),
482
+ mustache: frame(['glyph', 'mustache'], ''),
483
+ star: frame(['glyph', 'star'], ''),
484
+ play: frame(['glyph', 'play'], ''),
485
+ nodejs: frame(['glyph', 'nodejs'], ''),
486
+ oneSeventh: frame(['glyph', 'oneSeventh'], ''),
487
+ oneNinth: frame(['glyph', 'oneNinth'], ''),
488
+ oneTenth: frame(['glyph', 'oneTenth'], ''),
489
+ success: frame(['glyph', 'success'], ''),
490
+ error: frame(['glyph', 'error'], ''),
491
+ });
package/dist/host.js CHANGED
@@ -6,11 +6,12 @@ function dimension(value) {
6
6
  return value === 0 ? undefined : value;
7
7
  }
8
8
  export function captureHost(overrides, stderr) {
9
- const { argv, cwd, env, stdin, stdout, terminal } = overrides ?? {};
9
+ const { argv, cwd, env, platform, stdin, stdout, terminal } = overrides ?? {};
10
10
  return {
11
11
  argv: [...(argv ?? process.argv.slice(2))],
12
12
  cwd: cwd ?? process.cwd(),
13
13
  env: { ...(env ?? process.env) },
14
+ platform: platform ?? process.platform,
14
15
  stderr,
15
16
  stdin: stdin ?? process.stdin,
16
17
  stdout: stdout ?? process.stdout,
package/dist/index.d.ts CHANGED
@@ -1,18 +1,27 @@
1
1
  export { Application } from './application.js';
2
2
  export { Command } from './command.js';
3
3
  export { validationContext, validationContextKey } from './context.js';
4
- export { DeclarationError, FatalError, InputError, InternalError, LoomError, MissingValueError, NonCallableCommandError, RepeatedOptionError, ShortGroupError, UnexpectedArgumentError, UnexpectedValueError, UnknownCommandError, UnknownOptionError, UsageError, renderFailure, } from './errors.js';
4
+ export { DeclarationError, FatalError, InputError, InternalError, LoomError, MissingValueError, NonCallableCommandError, RepeatedOptionError, ResultError, ShortGroupError, UnexpectedArgumentError, UnexpectedValueError, UnknownCommandError, UnknownOptionError, UsageError, } from './errors.js';
5
5
  export { extension, readExtension } from './extension.js';
6
- export { GlobalOptions } from './globals.js';
6
+ export { incompleteResult, lanes } from './lanes.js';
7
+ export { override, view } from './view.js';
7
8
  export { plugin } from './plugin.js';
9
+ export { glyph } from './glyphs.generated.js';
10
+ export type { RenderingPolicy } from './rendering.js';
11
+ export type { ViewContext } from './types.js';
12
+ export { pad, style } from './style.js';
8
13
  export { issuePath } from './validation.js';
9
14
  export type { StandardSchemaV1 } from '@standard-schema/spec';
10
15
  export type { ApplicationMethod, ApplicationOptions } from './application.js';
11
16
  export type { ChainOutcome, MiddlewareContext } from './chain.js';
12
- export type { FailureRenderer, InputProblem } from './errors.js';
17
+ export type { InputProblem, ResultFault } from './errors.js';
13
18
  export type { AnyExtension, Extension, ExtensionValue } from './extension.js';
14
19
  export type { CommandMethod, CommandOptions } from './command.js';
15
20
  export type { CancellationReason } from './signals.js';
16
- export type { ArgumentNode, CommandGraph, CommandNode, OptionNode } from './inspect.js';
21
+ export type { IncompleteResult } from './lanes.js';
22
+ export type { AnyDeclaredView, DeclaredRowView, DeclaredView, DeclaredViewBrand, FailureClass, ViewContribution, ViewOverride, } from './view.js';
23
+ export type { ArgumentNode, CommandGraph, CommandNode, OptionNode, ResultNode } from './inspect.js';
17
24
  export type { Middleware, OptionsOf, Plugin, PluginDefinition, PluginOptions, PluginOptionValues, } from './plugin.js';
18
- export type { Action, ActionArgs, ActionContext, ActionHandler, ActionOptions, ArgumentConfig, BooleanOption, ExitCode, Host, InputIdentity, InputTerminal, Out, OptionConfig, OutputTerminal, Renderer, RunOptions, ScalarArgument, StringOption, SuppliedInputs, ValidationContext, VariadicArgument, } from './types.js';
25
+ export type { Action, ActionArgs, ActionContext, ActionHandler, ActionOptions, ArgumentConfig, AttachedCommand, BooleanOption, CommandAttachHook, ExitCode, Host, InputIdentity, InputTerminal, Out, OptionConfig, OutputTerminal, Request, ResultInput, ResultView, ResultViews, RunOptions, ScalarArgument, StringOption, SuppliedInputs, RowView, RowViews, ValidationContext, VariadicArgument, View, } from './types.js';
26
+ export type { ApplicationEnvironment, EnvironmentOf, Register, RegisteredEnvironment, } from './environment.js';
27
+ export type { Ansi16Color, Ansi256Fallbacks, ColorFallbacks, ConcreteStyle, Style, ThemeMapping, ThemeConstraint, } from './style.js';
package/dist/index.js CHANGED
@@ -1,8 +1,11 @@
1
1
  export { Application } from './application.js';
2
2
  export { Command } from './command.js';
3
3
  export { validationContext, validationContextKey } from './context.js';
4
- export { DeclarationError, FatalError, InputError, InternalError, LoomError, MissingValueError, NonCallableCommandError, RepeatedOptionError, ShortGroupError, UnexpectedArgumentError, UnexpectedValueError, UnknownCommandError, UnknownOptionError, UsageError, renderFailure, } from './errors.js';
4
+ export { DeclarationError, FatalError, InputError, InternalError, LoomError, MissingValueError, NonCallableCommandError, RepeatedOptionError, ResultError, ShortGroupError, UnexpectedArgumentError, UnexpectedValueError, UnknownCommandError, UnknownOptionError, UsageError, } from './errors.js';
5
5
  export { extension, readExtension } from './extension.js';
6
- export { GlobalOptions } from './globals.js';
6
+ export { incompleteResult, lanes } from './lanes.js';
7
+ export { override, view } from './view.js';
7
8
  export { plugin } from './plugin.js';
9
+ export { glyph } from './glyphs.generated.js';
10
+ export { pad, style } from './style.js';
8
11
  export { issuePath } from './validation.js';
package/dist/inspect.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { BuiltGraph } from './command.js';
2
+ import type { DeclaredResult } from './types.js';
2
3
  /** One declared argument. `default` wraps the declared value, so an explicit `undefined` shows. */
3
4
  interface ArgumentNode {
4
5
  readonly name: string;
@@ -14,7 +15,9 @@ interface ArgumentNode {
14
15
  }
15
16
  /**
16
17
  * One declared option, in the shape its type gives it. Spellings are the accepted CLI forms, and
17
- * `scope` tells an application's own option from a plugin option, which reaches no action.
18
+ * `scope` tells an application's own option from a plugin option, which reaches no action. An
19
+ * option a plugin's lifecycle hook declared on a Command is that Command's own in every respect, so
20
+ * it reads `application` and names no plugin.
18
21
  * `hidden` is `false` unless the declaration says `true`, and `deprecated` is the declared
19
22
  * migration message or `undefined`. A listing projection omits a hidden node and marks a
20
23
  * deprecated one; parsing binds without reading either.
@@ -64,11 +67,21 @@ interface CommandNode {
64
67
  readonly hidden: boolean;
65
68
  readonly deprecated: string | undefined;
66
69
  readonly hasAction: boolean;
70
+ readonly result: ResultNode | null;
67
71
  readonly arguments: readonly ArgumentNode[];
68
72
  readonly options: readonly OptionNode[];
69
73
  readonly children: readonly CommandNode[];
70
74
  readonly extensions: Readonly<Record<string, unknown>>;
71
75
  }
76
+ /**
77
+ * The result one Command declares: the unit its action emits, the view names in record order, and
78
+ * the name of the view core renders when nothing selects another.
79
+ */
80
+ interface ResultNode {
81
+ readonly kind: 'value' | 'rows';
82
+ readonly views: readonly string[];
83
+ readonly default: string;
84
+ }
72
85
  /**
73
86
  * One built graph as plain data. The globals appear once here and in no `CommandNode`. `version`
74
87
  * and `description` are the Application's own core facts. `version` is the declared string, or
@@ -82,6 +95,16 @@ interface CommandGraph {
82
95
  readonly globals: readonly OptionNode[];
83
96
  readonly root: CommandNode;
84
97
  }
98
+ /**
99
+ * A snapshot of one value. Arrays and plain objects are copied and frozen to any depth, so a
100
+ * consumer cannot reach the source through the copy, and a later call reports the value again.
101
+ * Primitives and library objects, such as a class instance or a `Date` a schema produced, are
102
+ * reported as they are, because core cannot copy them meaningfully. The graph reads it for a
103
+ * declared value and the chain reads it for the request one middleware holds.
104
+ */
105
+ export declare function snapshot(value: unknown): unknown;
106
+ /** The declared result as plain data, or `null` on a Command that declares none. */
107
+ declare function resultNode(result: DeclaredResult | undefined): ResultNode | null;
85
108
  /**
86
109
  * Renders one built graph as frozen plain data. Nothing here reads a host fact or a schema. The
87
110
  * globals list holds the application's own options, then each installed plugin's in installation
@@ -91,5 +114,5 @@ declare function inspectGraph(name: string, graph: BuiltGraph, facts: {
91
114
  description: string | undefined;
92
115
  version: string;
93
116
  }): CommandGraph;
94
- export type { ArgumentNode, CommandGraph, CommandNode, OptionNode };
95
- export { inspectGraph };
117
+ export type { ArgumentNode, CommandGraph, CommandNode, OptionNode, ResultNode };
118
+ export { inspectGraph, resultNode };