@effected/cli 0.19.0 → 0.21.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 (89) hide show
  1. package/Cancelled.js +1 -2
  2. package/CliAudience.js +1 -2
  3. package/CliColor.js +1 -2
  4. package/CliEnv.js +1 -2
  5. package/CliExit.js +1 -2
  6. package/CliFailure.js +1 -2
  7. package/CliInteractive.js +1 -2
  8. package/CliLinks.js +1 -2
  9. package/CliLog.js +1 -2
  10. package/CliLogger.js +1 -2
  11. package/CliMessage.js +1 -2
  12. package/CliPrompt.js +1 -2
  13. package/CliRuntime.js +1 -2
  14. package/CliTest.js +1 -2
  15. package/CliTheme.js +1 -2
  16. package/ConfigIssueRenderer.js +1 -2
  17. package/Doc.js +1 -2
  18. package/Fmt.js +15 -6
  19. package/GithubAnnotation.js +1 -2
  20. package/Glyphs.js +1 -2
  21. package/NotInteractive.js +1 -2
  22. package/Render.js +1 -2
  23. package/SchemaIssueRenderer.js +1 -2
  24. package/Status.js +1 -2
  25. package/TestTerminal.js +1 -2
  26. package/Token.js +1 -2
  27. package/index.d.ts +10 -53
  28. package/internal/ExitRequested.js +1 -2
  29. package/internal/HelpRouting.js +1 -2
  30. package/internal/ansi.js +1 -2
  31. package/internal/autoFormat.js +1 -2
  32. package/internal/canPrompt.js +1 -2
  33. package/internal/counts.js +1 -2
  34. package/internal/diagnostics.js +1 -2
  35. package/internal/displayWidth.js +1 -2
  36. package/internal/failureTarget.js +1 -2
  37. package/internal/fallbackAnswer.js +1 -2
  38. package/internal/fileSink.js +1 -2
  39. package/internal/format.js +1 -2
  40. package/internal/isExitCode.js +1 -2
  41. package/internal/layout.js +1 -2
  42. package/internal/linkScheme.js +1 -2
  43. package/internal/linkTarget.js +1 -2
  44. package/internal/logSafety.js +1 -2
  45. package/internal/renderAnsi.js +1 -2
  46. package/internal/renderDoc.js +1 -2
  47. package/internal/renderGithubLog.js +1 -2
  48. package/internal/renderMarkdown.js +1 -2
  49. package/internal/renderPlain.js +1 -2
  50. package/internal/scanAudience.js +1 -2
  51. package/internal/splitFrame.js +1 -2
  52. package/internal/wizardGate.js +1 -2
  53. package/package.json +6 -6
  54. package/testing.d.ts +0 -4
  55. package/ui/CliUi.js +3 -4
  56. package/ui/CliUiLive.js +1 -2
  57. package/ui/Confirm.js +1 -2
  58. package/ui/DocView.js +1 -2
  59. package/ui/KeyHelp.js +1 -2
  60. package/ui/KeyTable.js +1 -2
  61. package/ui/MultiSelect.js +1 -2
  62. package/ui/Select.js +1 -2
  63. package/ui/Tabs.js +1 -2
  64. package/ui/TextInput.js +1 -2
  65. package/ui/Toggle.js +1 -2
  66. package/ui/UiKey.js +2 -3
  67. package/ui/UiProvider.js +1 -2
  68. package/ui/UiStreams.js +1 -2
  69. package/ui/UiTheme.js +1 -2
  70. package/ui/Viewport.js +1 -2
  71. package/ui/internal/ErrorBoundary.js +1 -2
  72. package/ui/internal/Holder.js +1 -2
  73. package/ui/internal/ScreenContext.js +1 -2
  74. package/ui/internal/UiProviders.js +1 -2
  75. package/ui/internal/ink.js +1 -2
  76. package/ui/internal/inkChalk.js +1 -2
  77. package/ui/internal/inkConsole.js +1 -2
  78. package/ui/internal/lazyView.js +1 -2
  79. package/ui/internal/lineText.js +1 -2
  80. package/ui/internal/mountPermit.js +1 -2
  81. package/ui/internal/processStreams.js +1 -2
  82. package/ui/internal/renderOptions.js +1 -2
  83. package/ui/testing/CliUiTest.js +1 -2
  84. package/ui/testing/fakeStreams.js +1 -2
  85. package/ui/testing/terminalModel.js +1 -2
  86. package/ui-testing-serializer.d.ts +0 -2
  87. package/ui-testing-serializer.js +1 -2
  88. package/ui-testing.d.ts +0 -2
  89. package/ui.d.ts +5 -37
package/index.d.ts CHANGED
@@ -1,8 +1,7 @@
1
- import { Array as Array$1, Cause, Context, Effect, FileSystem, Layer, LogLevel, Logger, MutableRef, Option, Path, Runtime, Schema, Stdio, Terminal } from "effect";
1
+ import { Array as Array$1, Cause, Context, Duration, Effect, FileSystem, Layer, LogLevel, Logger, MutableRef, Option, Path, Runtime, Schema, Stdio, Terminal } from "effect";
2
2
  import { Audience, AudienceKind, ColorLevel, CurrentRuntimeEnv, RuntimeEnv, TerminalEnv } from "@effected/env";
3
3
  import { CliError, CliOutput, Command, Flag, Param, Prompt } from "effect/cli";
4
4
  import { ConfigValidationError } from "@effected/config-file";
5
- //#region src/Cancelled.d.ts
6
5
  declare const Cancelled_base: Schema.Class<Cancelled, Schema.TaggedStruct<"Cancelled", {
7
6
  readonly reason: Schema.Literals<readonly ["escape", "interrupt"]>;
8
7
  }>, import("effect/Cause").YieldableError>;
@@ -40,8 +39,6 @@ export declare class Cancelled extends Cancelled_base {
40
39
  */
41
40
  get [Runtime.errorExitCode](): number;
42
41
  }
43
- //#endregion
44
- //#region src/CliAudience.d.ts
45
42
  /**
46
43
  * The four parsed audience flags a root command carries once {@link CliAudience.flags} is shared onto it.
47
44
  *
@@ -185,8 +182,6 @@ export declare class CliAudience {
185
182
  readonly renderErrors?: boolean | undefined;
186
183
  }) => Effect.Effect<void, Exclude<E | CliError.UserError, Terminal.QuitError> | CliError.CliError, Exclude<R, Audience> | Audience | Command.Environment>;
187
184
  }
188
- //#endregion
189
- //#region src/CliColor.d.ts
190
185
  /**
191
186
  * Whether a CLI's output should carry ANSI colour, decided once and shared by
192
187
  * everything that renders — help text, error output, and any rendered result.
@@ -236,8 +231,6 @@ export declare class CliColor {
236
231
  */
237
232
  static readonly formatterLayer: (overrides?: Partial<CliOutput.Formatter>) => Layer.Layer<never, never, Stdio.Stdio>;
238
233
  }
239
- //#endregion
240
- //#region src/Glyphs.d.ts
241
234
  /**
242
235
  * The symbols a theme draws with.
243
236
  *
@@ -315,8 +308,6 @@ export declare class Glyphs {
315
308
  /** ASCII-only symbols. */
316
309
  static readonly ascii: GlyphSet;
317
310
  }
318
- //#endregion
319
- //#region src/Token.d.ts
320
311
  /**
321
312
  * A named terminal colour: the eight ANSI colours and their bright variants.
322
313
  *
@@ -401,8 +392,6 @@ export declare class Token {
401
392
  */
402
393
  static readonly style: (style: Style) => Style;
403
394
  }
404
- //#endregion
405
- //#region src/Status.d.ts
406
395
  /**
407
396
  * How one status looks: a Unicode glyph, an ASCII fallback, a token and a rank.
408
397
  *
@@ -525,8 +514,6 @@ export declare class Status<Names extends string> {
525
514
  */
526
515
  worstOption(names: ReadonlyArray<Names>): Option.Option<Names>;
527
516
  }
528
- //#endregion
529
- //#region src/CliTheme.d.ts
530
517
  /**
531
518
  * The shape of the {@link CliTheme} service: a colour level, a glyph set and the functions that use them.
532
519
  *
@@ -663,8 +650,6 @@ export declare class CliTheme extends CliTheme_base {
663
650
  */
664
651
  static readonly promptTheme: Layer.Layer<never, never, CliTheme>;
665
652
  }
666
- //#endregion
667
- //#region src/Doc.d.ts
668
653
  /**
669
654
  * A status as a document stores it: its name and its resolved definition.
670
655
  *
@@ -1432,8 +1417,6 @@ export declare class Doc {
1432
1417
  */
1433
1418
  static readonly print: (doc: Document, options?: DocPrintOptions) => Effect.Effect<void, never, CliTheme | TerminalEnv | Audience | CliLinks>;
1434
1419
  }
1435
- //#endregion
1436
- //#region src/CliLinks.d.ts
1437
1420
  /**
1438
1421
  * Whether file links open in an editor.
1439
1422
  *
@@ -1534,8 +1517,6 @@ export declare class CliLinks extends CliLinks_base {
1534
1517
  */
1535
1518
  static readonly linker: (options: CliLinksLinkerOptions) => (target: LinkTarget, label: string) => string;
1536
1519
  }
1537
- //#endregion
1538
- //#region src/CliLogger.d.ts
1539
1520
  /**
1540
1521
  * How a log record is turned into a line.
1541
1522
  *
@@ -1636,8 +1617,6 @@ export declare class CliLogger {
1636
1617
  */
1637
1618
  static readonly layer: (options?: CliLoggerOptions) => Layer.Layer<never>;
1638
1619
  }
1639
- //#endregion
1640
- //#region src/CliLog.d.ts
1641
1620
  /**
1642
1621
  * Options for `CliLog.status`.
1643
1622
  *
@@ -1997,8 +1976,6 @@ export declare class CliLog {
1997
1976
  */
1998
1977
  static readonly component: (name: string) => <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
1999
1978
  }
2000
- //#endregion
2001
- //#region src/CliEnv.d.ts
2002
1979
  /**
2003
1980
  * Options for {@link CliEnv.layer} and for `CliRuntime.main`'s `env` option.
2004
1981
  *
@@ -2175,8 +2152,6 @@ export declare class CliEnv {
2175
2152
  */
2176
2153
  static readonly layerTest: (options?: CliEnvTestOptions) => Layer.Layer<CliEnvTestServices>;
2177
2154
  }
2178
- //#endregion
2179
- //#region src/CliExit.d.ts
2180
2155
  /**
2181
2156
  * The shape behind {@link CliExit}.
2182
2157
  *
@@ -2241,8 +2216,6 @@ export declare class CliExit extends CliExit_base {
2241
2216
  */
2242
2217
  static readonly set: (code: number) => Effect.Effect<void, never, CliExit>;
2243
2218
  }
2244
- //#endregion
2245
- //#region src/CliFailure.d.ts
2246
2219
  /**
2247
2220
  * The protocol an error class implements to say how a failure is shown: a method under this key that returns the
2248
2221
  * document.
@@ -2346,8 +2319,6 @@ export declare class CliFailure {
2346
2319
  */
2347
2320
  static readonly toDoc: (cause: Cause.Cause<unknown>, options?: CliFailureOptions) => Document;
2348
2321
  }
2349
- //#endregion
2350
- //#region src/CliInteractive.d.ts
2351
2322
  declare const CliInteractive_base: Context.Reference<boolean>;
2352
2323
  /**
2353
2324
  * Whether this run may prompt a person: a human audience, with a terminal on
@@ -2405,8 +2376,6 @@ export declare class CliInteractive extends CliInteractive_base {
2405
2376
  */
2406
2377
  static readonly unless: (condition: boolean) => <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
2407
2378
  }
2408
- //#endregion
2409
- //#region src/CliMessage.d.ts
2410
2379
  /**
2411
2380
  * Options for {@link CliMessage.status}.
2412
2381
  *
@@ -2475,8 +2444,6 @@ export declare class CliMessage {
2475
2444
  */
2476
2445
  static readonly failure: (text: string) => Effect.Effect<void, never, CliTheme | Audience>;
2477
2446
  }
2478
- //#endregion
2479
- //#region src/CliPrompt.d.ts
2480
2447
  /**
2481
2448
  * Which missing parameter a fallback stands in for, so a non-interactive run can fail with core's own error.
2482
2449
  *
@@ -2563,8 +2530,6 @@ export declare class CliPrompt {
2563
2530
  */
2564
2531
  static readonly gateWizard: Layer.Layer<never>;
2565
2532
  }
2566
- //#endregion
2567
- //#region src/CliRuntime.d.ts
2568
2533
  /**
2569
2534
  * What `render` is told about a failure beyond the squashed error.
2570
2535
  *
@@ -2943,8 +2908,6 @@ export declare class CliRuntime {
2943
2908
  static reported<E extends Error>(error: E, exitCode?: number): E;
2944
2909
  static reported(error: unknown, exitCode?: number): Error;
2945
2910
  }
2946
- //#endregion
2947
- //#region src/ConfigIssueRenderer.d.ts
2948
2911
  /**
2949
2912
  * Turns a `@effected/config-file` `ConfigValidationError` into one line per rejected value.
2950
2913
  *
@@ -2997,8 +2960,6 @@ export declare class ConfigIssueRenderer {
2997
2960
  */
2998
2961
  static readonly render: (error: ConfigValidationError) => ReadonlyArray<string>;
2999
2962
  }
3000
- //#endregion
3001
- //#region src/Fmt.d.ts
3002
2963
  /**
3003
2964
  * Options for {@link Fmt.truncate}.
3004
2965
  *
@@ -3064,18 +3025,23 @@ export declare class Fmt {
3064
3025
  */
3065
3026
  static readonly truncate: (text: string, width: number, options?: TruncateOptions) => string;
3066
3027
  /**
3067
- * A duration in milliseconds as short human text: `250ms`, `1.2s`, `2s`, `1m 3s`, `2m`, `1h 2m`, `2h`.
3028
+ * A duration as short human text: `250ms`, `1.2s`, `2s`, `1m 3s`, `2m`, `1h 2m`, `2h`.
3068
3029
  *
3069
3030
  * @remarks
3070
3031
  * Under a second it is whole milliseconds; under a minute, seconds to one decimal with a trailing `.0`
3071
3032
  * dropped; under an hour, minutes and whole seconds, with the seconds dropped when zero; from an hour, hours and
3072
3033
  * whole minutes, the seconds dropped. A value that rounds up to the next unit (`999.6` to a second, `59999` to a
3073
3034
  * minute, `3599999` to an hour) is written in that unit, so `1000ms`, `60s` and `60m` never appear. There is no
3074
- * days unit. A negative or non-finite input is `0ms`.
3035
+ * days unit. The format is bespoke: core's `Duration.format` renders differently.
3075
3036
  *
3076
- * @param ms - the duration in milliseconds
3037
+ * The input is anything `Duration.Input` admits. A plain number is milliseconds and is used as given, never
3038
+ * converted through a `Duration`, which rounds a fractional millisecond to whole nanoseconds and would move a value
3039
+ * such as `999.4999999` across the rounding boundary. A `bigint` is nanoseconds, as in core. A negative, infinite
3040
+ * or invalid input (a string `Duration.Input` cannot parse) is `0ms`: a formatter in a render path never throws.
3041
+ *
3042
+ * @param input - the duration; a number is milliseconds
3077
3043
  */
3078
- static readonly duration: (ms: number) => string;
3044
+ static readonly duration: (input: Duration.Input) => string;
3079
3045
  /**
3080
3046
  * A ratio from 0 to 1 as a percentage, or a number already from 0 to 100 with `scale: 100`: `83.3%`, `50%`,
3081
3047
  * `100%`.
@@ -3097,8 +3063,6 @@ export declare class Fmt {
3097
3063
  */
3098
3064
  static readonly plural: (n: number, singular: string, plural?: string) => string;
3099
3065
  }
3100
- //#endregion
3101
- //#region src/GithubAnnotation.d.ts
3102
3066
  /**
3103
3067
  * The severity of a GitHub annotation.
3104
3068
  *
@@ -3151,8 +3115,6 @@ export declare class GithubAnnotation {
3151
3115
  */
3152
3116
  static readonly format: (annotation: GithubAnnotationProperties, message: string) => string;
3153
3117
  }
3154
- //#endregion
3155
- //#region src/NotInteractive.d.ts
3156
3118
  declare const NotInteractive_base: Schema.Class<NotInteractive, Schema.TaggedStruct<"NotInteractive", {}>, import("effect/Cause").YieldableError>;
3157
3119
  /**
3158
3120
  * A command needed to prompt, but there is no terminal to prompt on.
@@ -3186,8 +3148,6 @@ export declare class NotInteractive extends NotInteractive_base {
3186
3148
  */
3187
3149
  get [Runtime.errorExitCode](): number;
3188
3150
  }
3189
- //#endregion
3190
- //#region src/Render.d.ts
3191
3151
  /**
3192
3152
  * Everything a renderer needs to know about where its output is going.
3193
3153
  *
@@ -3491,8 +3451,6 @@ export declare class Render {
3491
3451
  */
3492
3452
  static readonly githubLog: (doc: Document, ctx: RenderContext) => string;
3493
3453
  }
3494
- //#endregion
3495
- //#region src/SchemaIssueRenderer.d.ts
3496
3454
  /**
3497
3455
  * Turns a `SchemaIssue` tree into lines a user can act on.
3498
3456
  *
@@ -3535,6 +3493,5 @@ export declare class SchemaIssueRenderer {
3535
3493
  */
3536
3494
  static readonly render: (issue: unknown) => ReadonlyArray<string>;
3537
3495
  }
3538
- //#endregion
3539
3496
  export type { AnnotationLevel, AnnotationOptions, AudienceFlagInput, Block, BlockOf, CliAudienceFlagsOptions, CliDocSource, CliEnvOptions, CliEnvServices, CliEnvTestOptions, CliEnvTestServices, CliExitShape, CliFailureOptions, CliLinksLinkerOptions, CliLinksOptions, CliLinksShape, CliLogFile, CliLogFileOptions, CliLogOptions, CliLogStatusOptions, CliLoggerOptions, CliMessageOptions, CliPromptFallbackOptions, CliPromptTarget, CliThemeOptions, CliThemeShape, CliThemeTestOptions, Column, CoreStatusName, Counter, CountsOptions, CountsRow, CountsTableOptions, DocPrintOptions, Document, EditorLinks, FailureDetails, GithubAnnotationProperties, GlyphSelectOptions, GlyphSet, Inline, InlineInput, InlineOf, LinkOptions, LinkTarget, ListOptions, MainOptions, NamedColor, OverflowOptions, PercentOptions, RenderContext, RenderContextOfOptions, RenderContextOptions, ReportFailuresOptions, RequiresAudienceFlags, StatusDef, StatusRef, StreamTheme, Style, TableOptions, TokenName, TreeInput, TreeNode, TruncateOptions };
3540
3497
  //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { Runtime } from "effect";
2
2
 
3
- //#region src/internal/ExitRequested.ts
3
+ // src/internal/ExitRequested.ts
4
4
  /**
5
5
  * The failure `CliRuntime.main` raises when a successful program recorded a
6
6
  * non-zero exit code through `CliExit`. Private: nothing outside this package
@@ -18,5 +18,4 @@ var ExitRequested = class extends Error {
18
18
  }
19
19
  };
20
20
 
21
- //#endregion
22
21
  export { ExitRequested };
@@ -1,7 +1,7 @@
1
1
  import { Console, Effect } from "effect";
2
2
  import { CliOutput } from "effect/cli";
3
3
 
4
- //#region src/internal/HelpRouting.ts
4
+ // src/internal/HelpRouting.ts
5
5
  const OTHER_METHODS = Object.keys({
6
6
  assert: true,
7
7
  clear: true,
@@ -86,5 +86,4 @@ const routeHelpOnUsageError = (program) => Effect.gen(function* () {
86
86
  return yield* program.pipe(Effect.provideService(CliOutput.Formatter, recording), Effect.provideService(Console.Console, routing), Effect.ensuring(Effect.sync(release)));
87
87
  });
88
88
 
89
- //#endregion
90
89
  export { routeHelpOnUsageError };
package/internal/ansi.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/internal/ansi.ts
1
+ // src/internal/ansi.ts
2
2
  /** Foreground SGR parameter for each named colour: 30 to 37, then 90 to 97. */
3
3
  const NAMED = {
4
4
  black: 30,
@@ -226,5 +226,4 @@ const paintStyle = (style, level, text) => {
226
226
  /** The raw opening SGR sequence of a style at a level, `""` at `none` or for a style that paints nothing. */
227
227
  const openSequence = (style, level) => level === "none" ? "" : wraps(style, level).toReversed().map((wrap) => wrap.open).join("");
228
228
 
229
- //#endregion
230
229
  export { nearest256, openSequence, paintStyle, parseHex };
@@ -1,7 +1,7 @@
1
1
  import { Effect, Option } from "effect";
2
2
  import { CurrentRuntimeEnv } from "@effected/env";
3
3
 
4
- //#region src/internal/autoFormat.ts
4
+ // src/internal/autoFormat.ts
5
5
  /**
6
6
  * Whether the environment says the program runs under GitHub Actions, whose runner reads workflow commands out of
7
7
  * the log.
@@ -30,5 +30,4 @@ const autoFormat = (audience) => Effect.gen(function* () {
30
30
  return (yield* underGithubActions) ? "githubLog" : "plain";
31
31
  });
32
32
 
33
- //#endregion
34
33
  export { autoFormat, underGithubActions };
@@ -1,6 +1,6 @@
1
1
  import { Config, Effect, Option } from "effect";
2
2
 
3
- //#region src/internal/canPrompt.ts
3
+ // src/internal/canPrompt.ts
4
4
  /**
5
5
  * Whether the terminal facts let a run prompt: a terminal on standard input and on standard output, and a `TERM` that
6
6
  * is not `dumb`. A dumb terminal is a terminal, but it cannot move the cursor or take synchronized output, which every
@@ -11,5 +11,4 @@ import { Config, Effect, Option } from "effect";
11
11
  */
12
12
  const canPrompt = (terminal) => terminal.stdinIsTerminal && terminal.stdout.isTerminal ? Effect.map(Config.option(Config.String("TERM")).pipe(Effect.orElseSucceed(() => Option.none())), (term) => !(Option.isSome(term) && term.value === "dumb")) : Effect.succeed(false);
13
13
 
14
- //#endregion
15
14
  export { canPrompt };
@@ -1,6 +1,6 @@
1
1
  import { Fmt } from "../Fmt.js";
2
2
 
3
- //#region src/internal/counts.ts
3
+ // src/internal/counts.ts
4
4
  /**
5
5
  * The label a counter shows for a count: its one label, or `one` when the count is exactly 1 and `other` otherwise.
6
6
  * The count is the counter's own `n`, except in a share headline (`1/3 repos`), which reads by the denominator, the
@@ -80,5 +80,4 @@ const countsTableOf = (block) => {
80
80
  };
81
81
  };
82
82
 
83
- //#endregion
84
83
  export { columnLabel, counterLabel, countsTableOf, totalOf, visibleCountersOf };
@@ -1,6 +1,6 @@
1
1
  import { Context, LogLevel, Logger, References } from "effect";
2
2
 
3
- //#region src/internal/diagnostics.ts
3
+ // src/internal/diagnostics.ts
4
4
  /**
5
5
  * The diagnostics threshold reference behind `CliLog.Level`. Lives here so the stderr sink and the file sink share
6
6
  * one definition without `CliLog` importing itself.
@@ -28,5 +28,4 @@ const passes = (record, installed) => {
28
28
  */
29
29
  const formatNdjson = (record) => Logger.formatJson.log(record);
30
30
 
31
- //#endregion
32
31
  export { Level, formatNdjson, passes };
@@ -1,4 +1,4 @@
1
- //#region src/internal/displayWidth.ts
1
+ // src/internal/displayWidth.ts
2
2
  const segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
3
3
  const ANSI = /\u001B\][^\u0007\u001B]*(?:\u0007|\u001B\\)|\u001B\[[0-?]*[ -/]*[@-~]/g;
4
4
  const EMOJI = /^\p{RGI_Emoji}$/v;
@@ -31,5 +31,4 @@ const displayWidth = (input) => {
31
31
  */
32
32
  const graphemes = (input) => Array.from(segmenter.segment(input), (s) => s.segment);
33
33
 
34
- //#endregion
35
34
  export { displayWidth, graphemes, stripAnsi };
@@ -9,7 +9,7 @@ import { Config, Context, Effect, MutableRef, Option } from "effect";
9
9
  import { Audience, TerminalEnv } from "@effected/env";
10
10
  import { CommandNeutralizer } from "@effected/github-commands";
11
11
 
12
- //#region src/internal/failureTarget.ts
12
+ // src/internal/failureTarget.ts
13
13
  /**
14
14
  * A cell `CliRuntime.main` provides outside failure reporting and fills from inside it.
15
15
  *
@@ -191,5 +191,4 @@ const readSpans = (explicit, envVar) => Effect.gen(function* () {
191
191
  };
192
192
  });
193
193
 
194
- //#endregion
195
194
  export { FailureTargetCell, currentTarget, fallbackTarget, guardConsumerLines, linesOf, plainFailureLines, readSpans, refreshFailureTarget };
@@ -1,7 +1,7 @@
1
1
  import { Effect } from "effect";
2
2
  import { CliError, Prompt } from "effect/cli";
3
3
 
4
- //#region src/internal/fallbackAnswer.ts
4
+ // src/internal/fallbackAnswer.ts
5
5
  /**
6
6
  * What a fallback hands core when the run is not interactive: `otherwise`, answered, when given (`undefined` counts
7
7
  * as not given); otherwise core's own missing-parameter error, so the parse fails exactly as it would with no
@@ -14,5 +14,4 @@ const answerWithoutPerson = (target) => {
14
14
  return Effect.fail("flag" in target ? new CliError.MissingOption({ option: target.flag }) : new CliError.MissingArgument({ argument: target.argument }));
15
15
  };
16
16
 
17
- //#endregion
18
17
  export { answerWithoutPerson };
@@ -3,7 +3,7 @@ import { formatNdjson, passes } from "./diagnostics.js";
3
3
  import { Cause, Console, Effect, Exit, Fiber, FileSystem, Logger, Path, Queue } from "effect";
4
4
  import { CommandNeutralizer } from "@effected/github-commands";
5
5
 
6
- //#region src/internal/fileSink.ts
6
+ // src/internal/fileSink.ts
7
7
  /** How long closing the scope waits for queued lines to reach the file before giving up on a hung filesystem. */
8
8
  const CLOSE_TIMEOUT = "2 seconds";
9
9
  /**
@@ -58,5 +58,4 @@ const makeFileSink = (path, installed, underActions) => Effect.gen(function* ()
58
58
  });
59
59
  });
60
60
 
61
- //#endregion
62
61
  export { makeFileSink };
@@ -1,6 +1,6 @@
1
1
  import { SchemaIssue } from "effect";
2
2
 
3
- //#region src/internal/format.ts
3
+ // src/internal/format.ts
4
4
  /**
5
5
  * Core's structured formatter, with one phrasing override.
6
6
  *
@@ -101,5 +101,4 @@ const issueTreeChildren = (entries) => {
101
101
  return [...leaves(root), ...[...root.children].map(([name, child]) => named(name, child))];
102
102
  };
103
103
 
104
- //#endregion
105
104
  export { formatIssue, issueEntries, issueTreeChildren };
@@ -1,4 +1,4 @@
1
- //#region src/internal/isExitCode.ts
1
+ // src/internal/isExitCode.ts
2
2
  /**
3
3
  * Whether `code` is an exit status a POSIX process can carry: an integer in
4
4
  * `0..255`. `NaN`, fractions and out-of-range values all fail — a relational
@@ -8,5 +8,4 @@
8
8
  */
9
9
  const isExitCode = (code) => Number.isInteger(code) && code >= 0 && code <= 255;
10
10
 
11
- //#endregion
12
11
  export { isExitCode };
@@ -1,7 +1,7 @@
1
1
  import { displayWidth, graphemes } from "./displayWidth.js";
2
2
  import { sanitize } from "../Fmt.js";
3
3
 
4
- //#region src/internal/layout.ts
4
+ // src/internal/layout.ts
5
5
  const pathSeparator = (ctx) => ctx.audience === "agent" ? ctx.glyphs.pathSeparator.agent : ` ${ctx.glyphs.pathSeparator.human} `;
6
6
  /** A link target is sanitized like content, and loses its line breaks, which no URL or path holds. */
7
7
  const safeTargetText = (text) => sanitize(text).replace(/[\r\n]/g, "");
@@ -246,5 +246,4 @@ const wrapSpans = (spans, width, options) => {
246
246
  return lines.map(spansFromCells);
247
247
  };
248
248
 
249
- //#endregion
250
249
  export { flatten, paintSpans, truncateSpans, widthOf, wrapSpans };
@@ -1,6 +1,6 @@
1
1
  import { sanitize } from "../Fmt.js";
2
2
 
3
- //#region src/internal/linkScheme.ts
3
+ // src/internal/linkScheme.ts
4
4
  /** The URL schemes a link may have, besides a relative URL. */
5
5
  const ALLOWED = /* @__PURE__ */ new Set([
6
6
  "http",
@@ -26,5 +26,4 @@ const isAllowedLinkUrl = (url) => {
26
26
  return scheme === null || ALLOWED.has(scheme[1]);
27
27
  };
28
28
 
29
- //#endregion
30
29
  export { isAllowedLinkUrl };
@@ -1,4 +1,4 @@
1
- //#region src/internal/linkTarget.ts
1
+ // src/internal/linkTarget.ts
2
2
  const LONE_SURROGATE = /[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g;
3
3
  /**
4
4
  * A Windows drive path (`C:\x`, `C:/x`): absolute whatever the `Path` flavour, so never resolved against a directory.
@@ -46,5 +46,4 @@ const fileUrlPath = (absolute) => {
46
46
  */
47
47
  const encodeForOsc8 = (url) => url.replace(LONE_SURROGATE, "�").replace(/[^\x20-\x7e]/gu, (char) => encodeURIComponent(char));
48
48
 
49
- //#endregion
50
49
  export { DRIVE, UNC, encodeForOsc8, encodePath, fileUrlPath };
@@ -2,7 +2,7 @@ import { sanitize } from "../Fmt.js";
2
2
  import { Context, Option } from "effect";
3
3
  import { CurrentRuntimeEnv } from "@effected/env";
4
4
 
5
- //#region src/internal/logSafety.ts
5
+ // src/internal/logSafety.ts
6
6
  /**
7
7
  * Marks a log line the kit has already rendered, so the logger does not strip the escapes the kit painted into it.
8
8
  *
@@ -42,5 +42,4 @@ const sanitizeParts = (message) => {
42
42
  */
43
43
  const neutralizeJson = (line) => line.replaceAll("##[", "#\\u0023[");
44
44
 
45
- //#endregion
46
45
  export { TrustedLine, neutralizeJson, sanitizeParts, underActionsIn };
@@ -1,7 +1,7 @@
1
1
  import { flatten, paintSpans } from "./layout.js";
2
2
  import { renderDoc, showsSuffix, targetText } from "./renderDoc.js";
3
3
 
4
- //#region src/internal/renderAnsi.ts
4
+ // src/internal/renderAnsi.ts
5
5
  /**
6
6
  * Inline content as styled spans: code painted `accent` with no backticks, and links kept on their spans so that
7
7
  * painting wraps them through `ctx.link`.
@@ -48,5 +48,4 @@ const ansi = {
48
48
  */
49
49
  const renderAnsi = (doc, ctx) => renderDoc(doc, ctx, ansi);
50
50
 
51
- //#endregion
52
51
  export { renderAnsi };
@@ -2,7 +2,7 @@ import { Fmt, sanitize } from "../Fmt.js";
2
2
  import { counterLabel, countsTableOf, totalOf, visibleCountersOf } from "./counts.js";
3
3
  import { truncateSpans, widthOf, wrapSpans } from "./layout.js";
4
4
 
5
- //#region src/internal/renderDoc.ts
5
+ // src/internal/renderDoc.ts
6
6
  const span = (text, token) => token === void 0 ? { text } : {
7
7
  text,
8
8
  token
@@ -319,5 +319,4 @@ const renderDocLines = (doc, ctx, flavour) => {
319
319
  */
320
320
  const renderDoc = (doc, ctx, flavour) => renderDocLines(doc, ctx, flavour).join("\n");
321
321
 
322
- //#endregion
323
322
  export { capOf, isAnnotation, renderDoc, renderDocLines, showsSuffix, targetText, textLines, trimLine };
@@ -2,7 +2,7 @@ import { sanitize } from "../Fmt.js";
2
2
  import { plainInline, renderPlainLines } from "./renderPlain.js";
3
3
  import { CommandNeutralizer, WorkflowCommand } from "@effected/github-commands";
4
4
 
5
- //#region src/internal/renderGithubLog.ts
5
+ // src/internal/renderGithubLog.ts
6
6
  /** Plain lines, neutralized; a block that draws nothing, such as an empty table, gives no line at all. */
7
7
  const plainLines = (blocks, ctx) => renderPlainLines(blocks, ctx).flatMap((line) => CommandNeutralizer.lines(line));
8
8
  /**
@@ -54,5 +54,4 @@ const blockLines = (block, ctx) => {
54
54
  */
55
55
  const renderGithubLog = (doc, ctx) => doc.flatMap((block) => blockLines(block, ctx)).join("\n");
56
56
 
57
- //#endregion
58
57
  export { renderGithubLog };
@@ -5,7 +5,7 @@ import { DRIVE, encodePath, fileUrlPath } from "./linkTarget.js";
5
5
  import { flatten } from "./layout.js";
6
6
  import { capOf, isAnnotation, showsSuffix, targetText, textLines } from "./renderDoc.js";
7
7
 
8
- //#region src/internal/renderMarkdown.ts
8
+ // src/internal/renderMarkdown.ts
9
9
  /** Marks a line break inside flowing text until the paragraph is split into lines. Sanitized text never holds NUL. */
10
10
  const BREAK = "\0";
11
11
  /**
@@ -364,5 +364,4 @@ const blockMd = (walk, block, depth, compact = false) => {
364
364
  */
365
365
  const renderMarkdown = (doc, ctx) => joinBlocks(doc.map((block) => blockMd({ ctx }, block, 0))).join("\n");
366
366
 
367
- //#endregion
368
367
  export { renderMarkdown };
@@ -1,7 +1,7 @@
1
1
  import { flatten } from "./layout.js";
2
2
  import { renderDocLines, showsSuffix, targetText } from "./renderDoc.js";
3
3
 
4
- //#region src/internal/renderPlain.ts
4
+ // src/internal/renderPlain.ts
5
5
  /**
6
6
  * Inline content as spans of plain text: code in backticks, and a link as its label followed by its target in
7
7
  * parentheses unless the label already is the target. Tokens and links are dropped, as plain text has neither.
@@ -46,5 +46,4 @@ const renderPlainLines = (doc, ctx) => renderDocLines(doc, {
46
46
  */
47
47
  const renderPlain = (doc, ctx) => renderPlainLines(doc, ctx).join("\n");
48
48
 
49
- //#endregion
50
49
  export { plainInline, renderPlain, renderPlainLines };
@@ -1,4 +1,4 @@
1
- //#region src/internal/scanAudience.ts
1
+ // src/internal/scanAudience.ts
2
2
  /**
3
3
  * The one counting rule, shared by the resolver that runs on parsed flags and by {@link scanAudience}, so the two
4
4
  * cannot drift: every `--audience` value counts, and a boolean counts only when it is true (`--agent=false` and
@@ -102,5 +102,4 @@ const scanAudience = (argv) => {
102
102
  });
103
103
  };
104
104
 
105
- //#endregion
106
105
  export { scanAudience, tallyAudience };
@@ -1,4 +1,4 @@
1
- //#region src/internal/splitFrame.ts
1
+ // src/internal/splitFrame.ts
2
2
  /** What JavaScript's `.` does not match outside dotAll mode: the four line terminators. */
3
3
  const isTerminator = (ch) => ch === "\n" || ch === "\r" || ch === "\u2028" || ch === "\u2029";
4
4
  /** One UTF-16 unit of JavaScript's `\s`; every character `\s` matches is in the BMP. */
@@ -52,5 +52,4 @@ const splitFrame = (raw) => {
52
52
  };
53
53
  };
54
54
 
55
- //#endregion
56
55
  export { splitFrame };
@@ -1,6 +1,6 @@
1
1
  import { Context } from "effect";
2
2
 
3
- //#region src/internal/wizardGate.ts
3
+ // src/internal/wizardGate.ts
4
4
  /**
5
5
  * The exact `CliConfig` object `CliPrompt.gateWizard` produced when it removed `--wizard`, or `undefined` when it
6
6
  * removed nothing.
@@ -14,5 +14,4 @@ import { Context } from "effect";
14
14
  */
15
15
  var WizardDropped = class extends Context.Reference("@effected/cli/WizardDropped", { defaultValue: () => void 0 }) {};
16
16
 
17
- //#endregion
18
17
  export { WizardDropped };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effected/cli",
3
- "version": "0.19.0",
3
+ "version": "0.21.0",
4
4
  "private": false,
5
5
  "description": "The presentation boundary of an effect/cli program: audience-aware output, a document IR and renderers, editor links, failure reports and logging, plus opt-in Ink screens, widgets and a live view",
6
6
  "keywords": [
@@ -57,13 +57,13 @@
57
57
  "./package.json": "./package.json"
58
58
  },
59
59
  "dependencies": {
60
- "@effected/github-commands": "^0.5.0"
60
+ "@effected/github-commands": "^0.6.1"
61
61
  },
62
62
  "peerDependencies": {
63
- "@effected/config-file": "^0.17.0",
64
- "@effected/env": "^0.4.0",
65
- "@effected/glob": "^0.13.0",
66
- "@effected/walker": "^0.18.0",
63
+ "@effected/config-file": "^0.19.0",
64
+ "@effected/env": "^0.5.0",
65
+ "@effected/glob": "^0.14.0",
66
+ "@effected/walker": "^0.19.0",
67
67
  "@types/react": "^19.3.0",
68
68
  "effect": "^4.0.0",
69
69
  "ink": "^8.0.0",