flagstaff 1.7.2 → 1.7.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.
package/README.md CHANGED
@@ -572,7 +572,7 @@ keeps both true.
572
572
  | Package | What it is | Migrates from |
573
573
  | :-- | :-- | :-- |
574
574
  | [burgee](https://burgee.interlace.tools/docs/packages/burgee) | The CLI framework: one declaration, every surface | commander, yargs and meow |
575
- | [roundel](https://roundel.interlace.tools/docs) | Colour: one output policy, semantic tokens, a theme | chalk and picocolors |
575
+ | [roundel](https://roundel.interlace.tools/docs) | Colour: one output policy, semantic tokens, a theme | chalk, picocolors and supports-color |
576
576
  | **flagstaff** (this package) | The frame loop: spinners, progress, boxes and tables | ora, log-update, boxen and cli-table3 |
577
577
  | [caique](https://caique.interlace.tools/docs) | Prompts that are flags first, and never hang | @inquirer/core |
578
578
  | [linegauge](https://linegauge.interlace.tools/docs) | Measuring, wrapping, truncating and slicing styled text | string-width, wrap-ansi, strip-ansi, slice-ansi, cli-truncate and widest-line |
package/dist/boxen.d.ts CHANGED
@@ -56,12 +56,5 @@ export type CustomBorderStyle = BoxenBorderStyle;
56
56
  export type Boxes = typeof BOXES;
57
57
  /**
58
58
  * Draw a box around `text`, exactly as boxen 9 draws it.
59
- *
60
- * An invalid colour throws rather than drawing something plausible, because boxen throws: a
61
- * colour name that is not one is a typo, and a box drawn in the wrong colour is a bug somebody
62
- * ships.
63
- *
64
- * `import boxen from 'boxen'` is the incumbent's surface. A named export here would break
65
- * every migration this file exists to serve, so the house rule yields to the host.
66
59
  */
67
60
  export default function boxen(input: string, options?: BoxenOptions): string;
@@ -8,13 +8,6 @@ export declare function wordWrap(maxLength: number, input: string, wrapOnWordBou
8
8
  * OSC 8 — the terminal hyperlink escape, and **not this package's to spell** (R12). The
9
9
  * sequence is paratext's `link` capability rendered against {@link EMITTING}; this function
10
10
  * contributes the argument order and upstream's `url || text`, and nothing else.
11
- *
12
- * Upstream's `hyperlink()` is an escape *builder*, not a policy decision: `utils-test.js`
13
- * grades its exact bytes with no terminal anywhere in the call, and a cell given an `href`
14
- * gets a sequence whatever `process.stdout` is. So this stays unconditional — the caller
15
- * already decided — and the runtime handed to paratext says so out loud. `flagstaff/table`
16
- * is the surface that *asks* whether the terminal can (rule 6); a façade that started asking
17
- * would be reinterpreting its host, and `link.test.ts` pins these bytes against upstream's.
18
11
  */
19
12
  export declare function hyperlink(url: string, text: string): string;
20
13
  export interface TableChars {
package/dist/import.d.ts CHANGED
@@ -1,11 +1,5 @@
1
1
  /**
2
2
  * `flagstaff/import` (R11) — the two data corpora the ecosystem already has, as plugins.
3
- *
4
- * cli-spinners ships ~80 spinner styles and cli-boxes ships eight border sets, both as
5
- * plain JSON that thousands of programs already depend on. Neither is bundled here: the
6
- * weight of a corpus nobody asked for is exactly what U5 is about, and a caller who wants
7
- * one already has it on disk. So these take the JSON and hand back a plugin:
8
- *
9
3
  * ```js
10
4
  * import cliSpinners from 'cli-spinners';
11
5
  * import { fromCliSpinners } from 'flagstaff/import';
@@ -14,10 +8,6 @@
14
8
  * register(fromCliSpinners(cliSpinners));
15
9
  * spinner('moon');
16
10
  * ```
17
- *
18
- * The result is an ordinary plugin — it goes through the same `register()`, is validated
19
- * against the same schema, and can be replaced by another. That is the point: the gallery
20
- * opens full, and a third-party plugin starts as a copy of one of these.
21
11
  */
22
12
  import { type BorderStyle, type Plugin } from './plugin.js';
23
13
  /** cli-spinners' shape: no `static`, because it has no projection for a pipe. */
@@ -33,11 +23,6 @@ export interface FromCliSpinnersOptions {
33
23
  /**
34
24
  * The static projection for a style, given its name and its frames. Default: `'…'` for
35
25
  * every one of them.
36
- *
37
- * The design sketched "the first frame" here, and that turned out to be wrong when it met
38
- * the corpus: a frozen `⠋` or `▰` is an animation stopped mid-stride, not a projection —
39
- * it tells a pipe, an agent and a screen reader nothing that `…` does not tell them
40
- * better. The parameter exists because it is the author's call, not this function's.
41
26
  */
42
27
  staticFor?: (name: string, spinner: CliSpinner) => string;
43
28
  }
package/dist/index.d.ts CHANGED
@@ -1,12 +1,6 @@
1
1
  /**
2
2
  * flagstaff — the staff the flag flies from. Re-exports only; each subpath is its own entry
3
3
  * and costs only itself, so prefer `flagstaff/spinner` when that is all you need.
4
- *
5
- * `./loop.js` is first on purpose. esbuild emits modules in import order, and its renamer hands
6
- * out the one-character names in that order, so `import { hoist } from 'flagstaff'` came out 2
7
- * bytes off the same import from `flagstaff/loop` once the loop reached `linegauge` through
8
- * `box.js`'s edge before its own. Same code, different names: `tree-shake-fixture.test.ts`
9
- * holds the two equal, and loop-first keeps them equal.
10
4
  */
11
5
  export * from './loop.js';
12
6
  export * from './box.js';
package/dist/link.d.ts CHANGED
@@ -1,22 +1,5 @@
1
1
  /**
2
2
  * The one place this package reaches OSC 8, and it does not implement it (R12).
3
- *
4
- * **Why `paratext/link` and not `paratext`.** The root entry reaches 20,221 B across ten
5
- * modules and calls `registerBuiltins()` at import — a side effect, in a package that declares
6
- * `sideEffects: false` so a bundler may drop what a program does not use. `paratext/link` is
7
- * **2,410 B across four modules and registers nothing**, and it carries the whole of what the
8
- * built-ins need: the guess (`supportsLink`), the bytes (`linkFor`) and the capability record.
9
- * The 17,811 B difference would land on `flagstaff/table`, whose entire budget is 4,000 B, so
10
- * this was not a close call — but it was measured rather than assumed, which is the rule.
11
- * What the narrow entry gives up is the registry: a host that re-registered `link` to correct
12
- * paratext's guess does not change what a box or a table emits. A program that needs that
13
- * imports `paratext` and calls `emit()` itself.
14
- *
15
- * **What this module is allowed to decide: nothing.** `supportsLink` is asked, never
16
- * re-derived — `box.ts` and `table.ts` read `live` to choose a *layout* (a url that is about
17
- * to be carried by an escape must not also be carried by the columns), and `paint` for the
18
- * bytes. Neither file names `isTTY`, `TERM`, or an escape. PRINCIPLES rule 6 is therefore
19
- * paratext's to keep, and `link.test.ts` checks it was kept.
20
3
  */
21
4
  import { linkFor } from 'paratext/link';
22
5
  /**
package/dist/plugin.d.ts CHANGED
@@ -49,16 +49,6 @@ export interface Plugin {
49
49
  * `flagstaff check` adds for what only a renderer can discover: a plugin that validates but
50
50
  * contributes nothing renderable, and a component whose `static` throws on the state it is
51
51
  * shown with.
52
- *
53
- * The last two lived as bare string literals in `cli.ts` until 2026-09-09, which is exactly
54
- * the hole R8 exists to close: a second host could spell `E_COMPONENT_THREW` its own way and
55
- * nothing would notice. `scripts/plugin-error-vocabulary-lock.test.ts` now reads this
56
- * declaration out of the source and refuses any `'E_…'` literal in a host that is not in it.
57
- *
58
- * It stays a *type* rather than a `const` array on purpose. R3 forbids one layer importing
59
- * another, so a runtime list could not be shared with roundel or caique even if it existed —
60
- * the lock has to read the source to work across the family, and it does. A `const` array
61
- * would therefore buy nothing and cost ~195 B on `./spinner`, which has 82 B of headroom.
62
52
  */
63
53
  export type PluginErrorCode = 'E_PLUGIN_SCHEMA' | 'E_NO_STATIC_PROJECTION' | 'E_PLUGIN_CONTRACT' | 'E_UNKNOWN_SPINNER' | 'E_UNKNOWN_BORDER' | 'E_NO_CONTRIBUTION' | 'E_COMPONENT_THREW' | 'E_UNKNOWN_KIND';
64
54
  /** A refused plugin says what is wrong, where, and what to do about it. */
@@ -1,16 +1,6 @@
1
1
  /**
2
2
  * The progress bar, which reports to an MCP client instead of drawing when it runs inside a
3
3
  * burgee `--mcp` tool call that asked for progress (mcp-current R5).
4
- *
5
- * A bar drawn into an agent's tool result is noise the agent has to read past; the same count
6
- * sent as `notifications/progress` is what the client shows its user while the call runs. burgee's
7
- * server publishes the call it is serving under `Symbol.for('burgee.mcp')`, and its `progress` is
8
- * the call's `ctx.progress`: it sends with the call's token, and drops a value that does not rise.
9
- * So the bar reads the symbol on every render, not once, and imports nothing of burgee's.
10
- * Anywhere else — no server, or a call without a `progressToken` — it draws as it always has.
11
- *
12
- * Only this subpath carries the bridge. The root `flagstaff` entry's `progress` always draws:
13
- * every flagstaff user pays for the root, and only a program served over MCP needs this.
14
4
  */
15
5
  import { type Component } from './plugin.js';
16
6
  import { type ProgressOptions, type ProgressState } from './progress-bar.js';
@@ -31,12 +31,6 @@ export declare const DEFAULT_INTERVAL = 80;
31
31
  * line, and writes only what changed since the last paint, wrapped in synchronized output;
32
32
  * a frame identical to the last writes nothing. `release` forgets the painted frame without
33
33
  * erasing it: what is on screen becomes scrollback, and the next paint starts at the cursor.
34
- *
35
- * Between paints the cursor rests at the end of the frame's last row, which is where the
36
- * hoisted projection has always left it. A frame taller than the terminal cannot be reached
37
- * above its top row, so one is clipped (frames-fit-the-screen R2): its tail, the lines that
38
- * change, under one dim `… N more` line. `release` then writes the whole frame once, because
39
- * a final write needs no repaint, so nothing the frame held is lost to the clip.
40
34
  */
41
35
  export interface FrameWriter {
42
36
  paint(lines: readonly string[]): void;
@@ -47,20 +41,6 @@ export declare function frameWriter(out: Writer): FrameWriter;
47
41
  export declare function ttyProjection<S>(component: Component<S>, out: Writer, clock: Clock): Projection<S>;
48
42
  /**
49
43
  * A pipe, CI, or a screen reader: the static projection, once per change, and nothing else.
50
- *
51
- * "Once per change" is finer than "when the text differs". A component whose projection is
52
- * a list — `tasks`, whose static is every task that has settled — grows it a line at a
53
- * time, and printing the whole list on every change repeats every line already in the log:
54
- *
55
- * ✔ install ← install settled
56
- * ✔ install ← build settled, and install is printed again
57
- * ✔ build
58
- *
59
- * So what is written is the lines *past the common prefix* with what was written last. A
60
- * component whose text replaces itself rather than growing shares no prefix and is printed
61
- * whole, which is the ordinary case; one that grows is appended to, which is what a log
62
- * wants. An empty projection writes nothing at all — a component with nothing to say yet
63
- * should not cost a blank line.
64
44
  */
65
45
  export declare function staticProjection<S>(component: Component<S>, out: Writer): Projection<S>;
66
46
  /** `--json`: one NDJSON event per transition on stderr, so stdout stays the envelope's (R1). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flagstaff",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "description": "Spinners, progress, boxes and tables on one terminal frame loop, with a static projection for pipes, screen readers and agents, and a plugin host. No dependency outside the burgee family. Drop-in paths for ora, log-update, boxen and cli-table3.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -163,10 +163,10 @@
163
163
  "json"
164
164
  ],
165
165
  "dependencies": {
166
- "closeout": "^1.1.5",
167
- "linegauge": "^1.1.3",
168
- "paratext": "^1.0.9",
169
- "roundel": "^1.1.3"
166
+ "closeout": "^1.1.6",
167
+ "linegauge": "^1.1.4",
168
+ "paratext": "^1.0.10",
169
+ "roundel": "^1.2.0"
170
170
  },
171
171
  "devDependencies": {
172
172
  "fast-check": "^4.10.2",