@osdlc/wayfinder 0.7.0 → 0.7.2

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/SECURITY.md CHANGED
@@ -33,11 +33,49 @@ making `way` run code the user did not choose to run are in scope.
33
33
  - **Tool modules are code.** A module named by `--config` or the user file is
34
34
  the user's own choice. One named by the project file loads only when the
35
35
  repository is trusted and execution is allowed.
36
+ - **Detection turns off the git config keys that run commands.** Discovery and
37
+ the owner lookup run git with `core.fsmonitor` off. The other keys that run
38
+ commands (hooks, `diff.external`, `filter.*`, `core.sshCommand`,
39
+ `core.pager`) do not apply to the git commands detection runs. git still
40
+ reads the rest of `.git/config`, such as the `origin` URL and `insteadOf`
41
+ rewrites.
42
+ - **Detection runs the git on your PATH, not one in the repository.** Every
43
+ command detection and the owner lookup start is looked up on the absolute
44
+ `PATH` entries only. A relative or empty entry (`bin`, `.`,
45
+ `node_modules/.bin`) is skipped, and on Windows the current folder is not
46
+ searched. An absolute entry is still searched, even one inside the
47
+ repository: direnv's `PATH_add`, mise's `_.path` and `npx` add such
48
+ entries, and each is a choice you made. `way providers` uses the same
49
+ lookup, and a tool found only through a relative entry reads as not
50
+ installed.
51
+ - **Owner trust believes the repository's own git config.** `trust.owners`
52
+ matches the remote URL the repository's `.git/config` reports. That file
53
+ comes with the directory: a folder from an archive or a shared drive can
54
+ name any owner. Owner trust fits clones you made yourself. `trust.paths` is
55
+ the stronger form, since a repository cannot choose where it is on your disk.
56
+ - **Repository text cannot drive the terminal.** Task names, docs, paths and
57
+ config values have their control characters (C0, DEL, C1) and bidi controls
58
+ (U+202A-202E, U+2066-2069) replaced with U+FFFD before the terminal UI,
59
+ `--list`, `query`, `trust`, `config`, `providers`, `dev`, the `--serve`
60
+ summary or stderr prints them. Copied commands get the same text. `--json`,
61
+ `way dev … --json` included, keeps every value exact: C0 is escaped by JSON
62
+ itself, and DEL, C1 and the bidi controls are written as `\u` escapes, so
63
+ the output is safe to print. An error no command catches is printed the
64
+ same way, on one line.
65
+ - **The installed `way` runs its own code.** It hands off to a checkout only
66
+ when `WAY_HOME` (an absolute path) or `way dev link` names one, and only when
67
+ that checkout's `package.json` is named `@osdlc/wayfinder`. `bun` is looked
68
+ up on the absolute `PATH` entries only, like git. The checkout runs
69
+ under Bun with `--no-env-file` and an empty config, so the `.env` and
70
+ `bunfig.toml` of the directory you stand in are not read. A relative `HOME`,
71
+ `XDG_*` or `WAYFINDER_CONFIG` is ignored, so no config, trust store or link
72
+ file is looked up under that directory. The directory you run it in does not
73
+ choose the code that runs.
36
74
  - **Tasks run without a shell.** A task is spawned from an argument vector.
37
75
  Typed arguments are bound by the task's tool and never replace its binary.
38
76
  - **The web view listens on 127.0.0.1.** Any local process and any page the
39
77
  browser visits can reach the port. A one-shot boot token and a session token
40
- guard every route. `/api/run` takes a task id from the server's own catalog,
78
+ protect every route. `/api/run` takes a task id from the server's own catalog,
41
79
  never a command. `/api/trust` refuses when a grant would not apply, so
42
80
  `--no-exec` cannot be lifted from the page.
43
81
  - **Trust is keyed on the resolved path.** A trusted repository that later
package/bin/way.js CHANGED
@@ -1,18 +1,23 @@
1
1
  #!/usr/bin/env node
2
2
  // The installed `way`. Before running its own code it asks devlink which
3
- // checkout should answer: `WAY_HOME`, a wayfinder checkout above the cwd, or one
4
- // linked by `way dev link`. Any of those other than this one runs there
5
- // instead, so an installed `way` follows the source you are working on.
3
+ // checkout should answer: the one `WAY_HOME` names, or the one `way dev link`
4
+ // linked. A checkout other than this one runs there instead. The cwd is never
5
+ // searched, so a repository you stand in cannot choose the code that runs.
6
6
  // Requires the built dist/ (`pnpm run build`).
7
7
  import { execSelection, resolve } from '@osdlc/cli-tool/devlink'
8
8
 
9
9
  import { main } from '../dist/cli.js'
10
10
  import { WAYFINDER_SPEC, checkoutRoot } from '../dist/devlink.js'
11
+ import { guardedExit, terminalSafe } from '../dist/terminal-text.js'
11
12
 
12
13
  const argv = process.argv.slice(2)
13
- const handedOff = execSelection(
14
- WAYFINDER_SPEC,
15
- resolve(WAYFINDER_SPEC, { self: checkoutRoot() }),
16
- argv,
17
- )
18
- process.exitCode = handedOff ?? (await main(argv))
14
+ // An error nothing caught is printed terminal-safe, not raw by Node.
15
+ process.exitCode = await guardedExit(() => {
16
+ const handedOff = execSelection(
17
+ WAYFINDER_SPEC,
18
+ resolve(WAYFINDER_SPEC, { self: checkoutRoot() }),
19
+ argv,
20
+ { announce: (line) => process.stderr.write(`${terminalSafe(line)}\n`) },
21
+ )
22
+ return handedOff ?? main(argv)
23
+ })
package/dist/args.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
- * Turning a typed argument tail into argv entries, shared by the terminal's
3
- * entry line and the page's run bar so the two never disagree about a quote.
2
+ * Turns typed trailing arguments into argv entries. The terminal's entry line
3
+ * and the page's run bar share it, so the two always split quotes the same way.
4
4
  *
5
- * {@link runArgv} and {@link acceptArgs} are the boundary: what a caller may
6
- * contribute to a spawn, and what it may not. As pure functions they can be
7
- * asserted; the route they protect cannot, because succeeding at it hands over
8
- * the terminal and exits the process.
5
+ * {@link runArgv} and {@link acceptArgs} decide what a caller may add to a
6
+ * spawn and what it may not. As pure functions they can be tested. The route
7
+ * they protect cannot, because a successful call hands over the terminal and
8
+ * exits the process.
9
9
  */
10
10
  import type { Project, Task } from '@osdlc/system-model/detect';
11
11
  /**
@@ -23,22 +23,22 @@ export declare function runArgv(project: Project, task: Task, args?: readonly st
23
23
  /**
24
24
  * The argument list from an untrusted JSON body, or an empty one.
25
25
  *
26
- * Non-strings are DROPPED rather than coerced: `String(value)` would quietly
27
- * hand a spawn `"[object Object]"` or `"null"` as a real argument, and an
26
+ * Non-strings are dropped rather than converted. `String(value)` would quietly
27
+ * pass `"[object Object]"` or `"null"` to a spawn as a real argument, and an
28
28
  * argument nobody typed is worse than a missing one.
29
29
  */
30
30
  export declare function acceptArgs(value: unknown): string[];
31
31
  /**
32
- * Split a typed argument tail the way a shell splits words, and in no other
33
- * way a shell behaves.
32
+ * Split typed arguments into words the way a shell does, and do nothing else
33
+ * a shell does.
34
34
  *
35
35
  * Quotes group and a backslash escapes the next character. There is no
36
- * globbing, no variable expansion, no operators, no substitution: the result
37
- * goes to an `execvp`-style spawn as separate argv entries, never to a shell,
38
- * so `*.log` is passed through as the four characters somebody typed. That is
39
- * the same rule `argv` and `display` exist to keep.
36
+ * globbing, no variable expansion, no operators and no substitution. The
37
+ * result goes to an `execvp`-style spawn as separate argv entries, never to a
38
+ * shell, so `*.log` is passed through as the five characters typed. This is
39
+ * the same rule that keeps `argv` separate from `display`.
40
40
  *
41
- * Splitting rather than `.split(/\s+/)` for exactly one reason: a quoted
42
- * `"two words"` has to stay ONE argument.
41
+ * This is not `.split(/\s+/)` for one reason: a quoted `"two words"` must stay
42
+ * one argument.
43
43
  */
44
44
  export declare function splitArgs(input: string): string[];
package/dist/args.js CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
- * Turning a typed argument tail into argv entries, shared by the terminal's
3
- * entry line and the page's run bar so the two never disagree about a quote.
2
+ * Turns typed trailing arguments into argv entries. The terminal's entry line
3
+ * and the page's run bar share it, so the two always split quotes the same way.
4
4
  *
5
- * {@link runArgv} and {@link acceptArgs} are the boundary: what a caller may
6
- * contribute to a spawn, and what it may not. As pure functions they can be
7
- * asserted; the route they protect cannot, because succeeding at it hands over
8
- * the terminal and exits the process.
5
+ * {@link runArgv} and {@link acceptArgs} decide what a caller may add to a
6
+ * spawn and what it may not. As pure functions they can be tested. The route
7
+ * they protect cannot, because a successful call hands over the terminal and
8
+ * exits the process.
9
9
  */
10
10
  /**
11
11
  * The argv a task runs with: the caller's arguments bound the way the task's
@@ -30,8 +30,8 @@ export function runArgv(project, task, args = []) {
30
30
  /**
31
31
  * The argument list from an untrusted JSON body, or an empty one.
32
32
  *
33
- * Non-strings are DROPPED rather than coerced: `String(value)` would quietly
34
- * hand a spawn `"[object Object]"` or `"null"` as a real argument, and an
33
+ * Non-strings are dropped rather than converted. `String(value)` would quietly
34
+ * pass `"[object Object]"` or `"null"` to a spawn as a real argument, and an
35
35
  * argument nobody typed is worse than a missing one.
36
36
  */
37
37
  export function acceptArgs(value) {
@@ -40,17 +40,17 @@ export function acceptArgs(value) {
40
40
  return value.filter((a) => typeof a === 'string');
41
41
  }
42
42
  /**
43
- * Split a typed argument tail the way a shell splits words, and in no other
44
- * way a shell behaves.
43
+ * Split typed arguments into words the way a shell does, and do nothing else
44
+ * a shell does.
45
45
  *
46
46
  * Quotes group and a backslash escapes the next character. There is no
47
- * globbing, no variable expansion, no operators, no substitution: the result
48
- * goes to an `execvp`-style spawn as separate argv entries, never to a shell,
49
- * so `*.log` is passed through as the four characters somebody typed. That is
50
- * the same rule `argv` and `display` exist to keep.
47
+ * globbing, no variable expansion, no operators and no substitution. The
48
+ * result goes to an `execvp`-style spawn as separate argv entries, never to a
49
+ * shell, so `*.log` is passed through as the five characters typed. This is
50
+ * the same rule that keeps `argv` separate from `display`.
51
51
  *
52
- * Splitting rather than `.split(/\s+/)` for exactly one reason: a quoted
53
- * `"two words"` has to stay ONE argument.
52
+ * This is not `.split(/\s+/)` for one reason: a quoted `"two words"` must stay
53
+ * one argument.
54
54
  */
55
55
  export function splitArgs(input) {
56
56
  const out = [];
@@ -84,9 +84,9 @@ export function splitArgs(input) {
84
84
  current += ch;
85
85
  started = true;
86
86
  }
87
- // An unterminated quote keeps what was typed rather than dropping it. The
88
- // user is mid-word; losing their text would be worse than passing a token
89
- // they can see in the command echoed above the run.
87
+ // An unclosed quote keeps what was typed rather than dropping it. Losing the
88
+ // user's text would be worse than passing a word they can see in the
89
+ // command shown above the run.
90
90
  if (started)
91
91
  out.push(current);
92
92
  return out;
package/dist/cache.js CHANGED
@@ -1,15 +1,14 @@
1
- import { homedir } from 'node:os';
2
1
  import { join } from 'node:path';
3
- import { xdgHome } from '@osdlc/trust-repo';
2
+ import { homeDir, xdgHome } from '@osdlc/trust-repo';
4
3
  import { APP, LEGACY_APP } from "./app.js";
5
4
  /**
6
5
  * Where stored runner probes live: `$XDG_CACHE_HOME/wayfinder`, else
7
6
  * `~/.cache/wayfinder`. `@osdlc/system-model` owns the layout inside it.
8
7
  */
9
- export function cacheDir(env = process.env, home = homedir()) {
8
+ export function cacheDir(env = process.env, home = homeDir()) {
10
9
  return join(xdgHome(env, home, 'XDG_CACHE_HOME', '.cache'), APP);
11
10
  }
12
11
  /** The old waypost cache directory. Never read; `way clean` offers to remove it. */
13
- export function legacyCacheDir(env = process.env, home = homedir()) {
12
+ export function legacyCacheDir(env = process.env, home = homeDir()) {
14
13
  return join(xdgHome(env, home, 'XDG_CACHE_HOME', '.cache'), LEGACY_APP);
15
14
  }
@@ -1,43 +1,43 @@
1
1
  /**
2
2
  * The `clean` subcommand: the three stores wayfinder keeps outside your
3
3
  * repositories (cache, trust, config). `--cache` and `--trust` also clear
4
- * the old waypost cache and trust store. Each is listed only when it holds
5
- * something.
4
+ * the old waypost cache and trust store. An old store is listed only when it
5
+ * holds something.
6
6
  *
7
7
  * ## Nothing is removed unless asked
8
8
  *
9
- * Bare `clean` REPORTS: what each store is, where it is, and whether anything
10
- * is in it. A `--dry-run` flag would put the safe behaviour behind a flag people
11
- * forget, so instead the flags name what to remove, and no flag removes nothing.
9
+ * Bare `clean` only reports: what each store is, where it is, and whether
10
+ * anything is in it. A `--dry-run` flag would put the safe behaviour behind a
11
+ * flag people forget. Instead the flags name what to remove, and with no flag
12
+ * nothing is removed.
12
13
  *
13
14
  * ## Why `--config` alone needs `--yes`
14
15
  *
15
- * The three stores are not equally replaceable, and the guard follows that
16
- * rather than being uniform for tidiness:
16
+ * The three stores are not equally easy to replace, and the check follows
17
+ * that:
17
18
  *
18
- * - the CACHE is derived. Deleting it costs one slow probe.
19
- * - the TRUST store is consent. Deleting it costs re-answering a question
20
- * you have already answered, per repository — annoying, not lossy.
21
- * - the CONFIG is the only thing here a person WROTE. Nothing regenerates it.
19
+ * - The cache is derived. Deleting it costs one slow probe.
20
+ * - The trust store is consent. Deleting it means answering the trust
21
+ * question again for each repository. That is annoying, but nothing is lost.
22
+ * - The config is the only one a person wrote. Nothing regenerates it.
22
23
  *
23
- * So `--config` (and `--all`, which includes it) additionally wants `--yes`.
24
+ * So `--config` (and `--all`, which includes it) also needs `--yes`.
24
25
  *
25
26
  * ## What it will not touch
26
27
  *
27
28
  * Anything inside a repository. `wayfinder.config.json` is a project file that
28
- * belongs to whoever wrote it, and a tool that deletes files from a checkout
29
- * because it was asked to clean its own data has misunderstood whose data it
30
- * is. Only paths under the user's home (or their XDG overrides) are candidates.
29
+ * belongs to whoever wrote it, not to this tool's data. Only paths under the
30
+ * user's home (or their XDG overrides) are removed.
31
31
  *
32
- * Everything outside that is injected — `stdout`, `stderr`, `env`, `home` — so
33
- * a test cannot read or delete the developer's real stores.
32
+ * `stdout`, `stderr`, `env` and `home` are injected, so a test cannot read or
33
+ * delete the developer's real stores.
34
34
  */
35
35
  import { type CliIo } from '@osdlc/cli-tool';
36
36
  /** `CliIo` plus the environment this command needs injected. */
37
37
  export interface CleanCommandIO extends CliIo {
38
38
  /** Defaults to `process.env`. Supplies the XDG overrides. */
39
39
  env?: Record<string, string | undefined>;
40
- /** Defaults to `os.homedir()`. The base for every non-XDG path. */
40
+ /** Defaults to `homeDir()` from `@osdlc/trust-repo`. The base for every non-XDG path. */
41
41
  home?: string;
42
42
  }
43
43
  export declare function runCleanCommand(toolName: string, argv: string[], io: CleanCommandIO): Promise<number>;
@@ -1,45 +1,45 @@
1
1
  /**
2
2
  * The `clean` subcommand: the three stores wayfinder keeps outside your
3
3
  * repositories (cache, trust, config). `--cache` and `--trust` also clear
4
- * the old waypost cache and trust store. Each is listed only when it holds
5
- * something.
4
+ * the old waypost cache and trust store. An old store is listed only when it
5
+ * holds something.
6
6
  *
7
7
  * ## Nothing is removed unless asked
8
8
  *
9
- * Bare `clean` REPORTS: what each store is, where it is, and whether anything
10
- * is in it. A `--dry-run` flag would put the safe behaviour behind a flag people
11
- * forget, so instead the flags name what to remove, and no flag removes nothing.
9
+ * Bare `clean` only reports: what each store is, where it is, and whether
10
+ * anything is in it. A `--dry-run` flag would put the safe behaviour behind a
11
+ * flag people forget. Instead the flags name what to remove, and with no flag
12
+ * nothing is removed.
12
13
  *
13
14
  * ## Why `--config` alone needs `--yes`
14
15
  *
15
- * The three stores are not equally replaceable, and the guard follows that
16
- * rather than being uniform for tidiness:
16
+ * The three stores are not equally easy to replace, and the check follows
17
+ * that:
17
18
  *
18
- * - the CACHE is derived. Deleting it costs one slow probe.
19
- * - the TRUST store is consent. Deleting it costs re-answering a question
20
- * you have already answered, per repository — annoying, not lossy.
21
- * - the CONFIG is the only thing here a person WROTE. Nothing regenerates it.
19
+ * - The cache is derived. Deleting it costs one slow probe.
20
+ * - The trust store is consent. Deleting it means answering the trust
21
+ * question again for each repository. That is annoying, but nothing is lost.
22
+ * - The config is the only one a person wrote. Nothing regenerates it.
22
23
  *
23
- * So `--config` (and `--all`, which includes it) additionally wants `--yes`.
24
+ * So `--config` (and `--all`, which includes it) also needs `--yes`.
24
25
  *
25
26
  * ## What it will not touch
26
27
  *
27
28
  * Anything inside a repository. `wayfinder.config.json` is a project file that
28
- * belongs to whoever wrote it, and a tool that deletes files from a checkout
29
- * because it was asked to clean its own data has misunderstood whose data it
30
- * is. Only paths under the user's home (or their XDG overrides) are candidates.
29
+ * belongs to whoever wrote it, not to this tool's data. Only paths under the
30
+ * user's home (or their XDG overrides) are removed.
31
31
  *
32
- * Everything outside that is injected — `stdout`, `stderr`, `env`, `home` — so
33
- * a test cannot read or delete the developer's real stores.
32
+ * `stdout`, `stderr`, `env` and `home` are injected, so a test cannot read or
33
+ * delete the developer's real stores.
34
34
  */
35
35
  import { readdir, rm, rmdir, stat } from 'node:fs/promises';
36
- import { homedir } from 'node:os';
37
36
  import { dirname } from 'node:path';
38
37
  import { BIN } from "./app.js";
39
38
  import { cacheDir, legacyCacheDir } from "./cache.js";
40
39
  import { LEGACY_TRUST_STORE_TOOL, TRUST_STORE_TOOL, configLocations } from "./config.js";
41
40
  import { EXIT } from '@osdlc/cli-tool';
42
- import { trustStoreDir } from '@osdlc/trust-repo';
41
+ import { homeDir, trustStoreDir } from '@osdlc/trust-repo';
42
+ import { jsonText } from "./terminal-text.js";
43
43
  function usage() {
44
44
  return `${BIN} clean — remove the data this tool stores outside your repositories
45
45
 
@@ -90,9 +90,9 @@ function humanBytes(bytes) {
90
90
  return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
91
91
  }
92
92
  function storesFor(env, home) {
93
- // The root is irrelevant to the USER config path, which is what this command
94
- // touches; the project layer is deliberately out of scope. `home` stands in
95
- // so the call is well-formed without pretending a repository is involved.
93
+ // This command touches only the user config path, which does not depend on
94
+ // the root. The project layer is out of scope. `home` is passed as the root
95
+ // because the call needs one and no repository is involved.
96
96
  const user = configLocations(home, env, home).user;
97
97
  return [
98
98
  {
@@ -128,7 +128,7 @@ function storesFor(env, home) {
128
128
  { key: 'config', flag: '--config', what: 'your user configuration', path: user, file: true },
129
129
  ];
130
130
  }
131
- /** A store's reportable fields — `file` is an implementation detail, not an answer. */
131
+ /** A store's reported fields. `file` is internal and is left out. */
132
132
  function reportOf(store, bytes, removed) {
133
133
  return { key: store.key, flag: store.flag, what: store.what, path: store.path, bytes, removed };
134
134
  }
@@ -178,10 +178,9 @@ export async function runCleanCommand(toolName, argv, io) {
178
178
  return EXIT.ok;
179
179
  }
180
180
  const env = io.env ?? process.env;
181
- const home = io.home ?? homedir();
181
+ const home = io.home ?? homeDir();
182
182
  const stores = storesFor(env, home);
183
- // The report. Also what a bare `clean` prints, which is why it is built
184
- // before anything is removed rather than inside the removal branch.
183
+ // A bare `clean` prints the report and removes nothing.
185
184
  if (parsed.chosen.size === 0) {
186
185
  const reports = [];
187
186
  for (const store of stores) {
@@ -191,7 +190,7 @@ export async function runCleanCommand(toolName, argv, io) {
191
190
  reports.push(reportOf(store, bytes, false));
192
191
  }
193
192
  if (parsed.json) {
194
- io.stdout(`${JSON.stringify({ stores: reports }, null, 2)}\n`);
193
+ io.stdout(`${jsonText({ stores: reports }, 2)}\n`);
195
194
  return EXIT.ok;
196
195
  }
197
196
  const lines = [`${toolName} stores three things outside your repositories:\n`];
@@ -227,9 +226,9 @@ export async function runCleanCommand(toolName, argv, io) {
227
226
  }
228
227
  try {
229
228
  await rm(store.path, { recursive: true, force: true });
230
- // A config file leaves its directory behind. Remove it when this was the
231
- // last thing in it, and leave it alone when it was not — the directory is
232
- // shared with anything else a future version puts there.
229
+ // A config file leaves its directory behind. Remove the directory when it
230
+ // is now empty, and leave it when it is not, since a future version may
231
+ // keep other files there.
233
232
  if (store.file) {
234
233
  const dir = dirname(store.path);
235
234
  try {
@@ -237,7 +236,7 @@ export async function runCleanCommand(toolName, argv, io) {
237
236
  await rmdir(dir);
238
237
  }
239
238
  catch {
240
- // Not ours to insist on. The file is gone, which is what was asked.
239
+ // Not required. The file is gone, which is what was asked.
241
240
  }
242
241
  }
243
242
  reports.push(reportOf(store, size, true));
@@ -248,8 +247,8 @@ export async function runCleanCommand(toolName, argv, io) {
248
247
  }
249
248
  catch (err) {
250
249
  io.stderr(`${toolName}: could not remove ${store.path}: ${String(err)}\n`);
251
- // Recorded and then abandoned, exactly as before: a store that would not
252
- // delete is not a reason to keep deleting the others.
250
+ // Record the failure and stop. A store that would not delete is a reason
251
+ // to stop deleting the others.
253
252
  reports.push(reportOf(store, size, false));
254
253
  failed = true;
255
254
  break;
@@ -258,12 +257,12 @@ export async function runCleanCommand(toolName, argv, io) {
258
257
  // One document, printed once, so a --json caller parses a single object
259
258
  // whether the run finished or stopped on a failure.
260
259
  if (parsed.json)
261
- io.stdout(`${JSON.stringify({ stores: reports }, null, 2)}\n`);
260
+ io.stdout(`${jsonText({ stores: reports }, 2)}\n`);
262
261
  if (failed)
263
262
  return EXIT.error;
264
263
  if (removed > 0 && parsed.chosen.has('trust')) {
265
- // An aside rather than the answer, so under --json it goes to stderr and
266
- // leaves the document one object.
264
+ // A side note, not the answer, so under --json it goes to stderr and
265
+ // stdout stays one JSON object.
267
266
  const note = 'Trusted repositories will ask again the next time you read them.\n';
268
267
  if (parsed.json)
269
268
  io.stderr(note);
package/dist/cli.d.ts CHANGED
@@ -1,17 +1,16 @@
1
1
  /**
2
2
  * `way`: browse and run every task in a repository.
3
3
  *
4
- * wayfinder is willing to run a repository's tools in principle (`allowExec:
5
- * true` by default): you are standing in your own repository, and a task
6
- * browser that cannot see the build graph is not much of a browser.
7
- * `--no-exec` opts out.
4
+ * wayfinder's `allowExec` default is `true`. You usually run it in your own
5
+ * repository, and a task browser that cannot see the build graph is of little
6
+ * use. `--no-exec` turns execution off.
8
7
  *
9
- * The default is not the gate. Per-repository trust is: `@osdlc/trust-repo`'s
10
- * `policyExecGate` combines the configured value with the marker store and the
11
- * user file's `trust.paths`/`trust.owners` policy, so willingness becomes
12
- * execution only once a person, or a policy they configured, has said yes to
13
- * this repository. A configured `false` means no exec however trusted the
14
- * repository is.
8
+ * The default alone does not allow execution. The repository must also be
9
+ * trusted. `@osdlc/trust-repo`'s `policyExecGate` combines the configured value
10
+ * with the marker store and the user file's `trust.paths`/`trust.owners`
11
+ * policy. Execution happens only once a person, or a policy they configured,
12
+ * has trusted this repository. A configured `false` means no execution, however
13
+ * trusted the repository is.
15
14
  */
16
15
  import { type CliIo } from '@osdlc/cli-tool';
17
16
  import { type Catalog, type RunnerCacheState } from '@osdlc/system-model/detect';
@@ -21,13 +20,13 @@ import { type GuideTool } from './guide.ts';
21
20
  export declare const GUIDE_TOOL: GuideTool;
22
21
  /**
23
22
  * Optional fields are absent unless their flag was given, so the config layer
24
- * can answer instead. wayfinder's `allowExec: true` default lives in
25
- * {@link main}, below that layer.
23
+ * can supply the value instead. wayfinder's `allowExec: true` default is
24
+ * applied in {@link main}, below that layer.
26
25
  */
27
26
  interface Flags {
28
27
  mode: 'tui' | 'serve' | 'json' | 'list' | 'query';
29
28
  dir: string;
30
- /** Answer --json/--list from the stored probe. The UI surfaces do it always. */
29
+ /** Answer --json/--list from the stored probe. The UI surfaces always do. */
31
30
  cached: boolean;
32
31
  allowExec?: boolean;
33
32
  open: boolean;
@@ -36,14 +35,14 @@ interface Flags {
36
35
  exclude?: string[];
37
36
  /**
38
37
  * Repeatable: `--exclude-path a --exclude-path b` means both. Passing any
39
- * at all replaces the configured list, as every other array setting merges.
38
+ * replaces the configured list, as with every other array setting.
40
39
  */
41
40
  excludePaths?: string[];
42
41
  discovery?: 'git' | 'walk' | 'auto';
43
42
  help: boolean;
44
43
  /**
45
- * `query`'s search terms, and the marker that this IS a query: absent for
46
- * every other mode, whose one positional is a directory instead.
44
+ * `query`'s search terms. Present only for a query. In every other mode the
45
+ * one positional is a directory instead.
47
46
  */
48
47
  terms?: string[];
49
48
  /** `query --json`: the matching tasks, rather than one command line each. */
@@ -58,10 +57,10 @@ interface Flags {
58
57
  toolModules: string[];
59
58
  }
60
59
  /**
61
- * `query` is claimed before the flag parse like `config` and `trust` (see
62
- * {@link main}), but only because it changes what a positional MEANS, from a
63
- * directory to search terms. Every collection flag still applies after it,
64
- * which is why it is not a command with its own flag list.
60
+ * `query` is matched before the flags are parsed, like `config` and `trust`
61
+ * (see {@link main}), because it changes what a positional means: search terms
62
+ * instead of a directory. Every collection flag still applies after it, so it
63
+ * is not a command with its own flag list.
65
64
  */
66
65
  export declare function parseArgs(argv: readonly string[], io: CliIo, cwd?: string): Flags | {
67
66
  error: string;