@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/CHANGELOG.md +37 -0
- package/README.md +210 -182
- package/SECURITY.md +39 -1
- package/bin/way.js +14 -9
- package/dist/args.d.ts +16 -16
- package/dist/args.js +19 -19
- package/dist/cache.js +3 -4
- package/dist/clean-command.d.ts +18 -18
- package/dist/clean-command.js +35 -36
- package/dist/cli.d.ts +19 -20
- package/dist/cli.js +76 -69
- package/dist/config-command.d.ts +15 -14
- package/dist/config-command.js +63 -59
- package/dist/config.d.ts +135 -130
- package/dist/config.js +156 -149
- package/dist/devlink.d.ts +6 -2
- package/dist/devlink.js +7 -2
- package/dist/guide.js +5 -4
- package/dist/origin-owner.d.ts +7 -2
- package/dist/origin-owner.js +20 -4
- package/dist/providers-command.d.ts +1 -1
- package/dist/providers-command.js +11 -23
- package/dist/serve.d.ts +43 -42
- package/dist/serve.js +251 -258
- package/dist/terminal-text.d.ts +57 -0
- package/dist/terminal-text.js +91 -0
- package/dist/tools.d.ts +4 -4
- package/dist/tools.js +4 -4
- package/dist/trust-command.d.ts +6 -7
- package/dist/trust-command.js +48 -50
- package/dist/trust-store.d.ts +1 -1
- package/dist/tui.d.ts +65 -66
- package/dist/tui.js +124 -130
- package/dist/web/main.js +371 -386
- package/dist/web/page.html +6 -5
- package/dist/web/styles.css +258 -271
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -34,10 +34,11 @@ Node.js `^22.22.2 || ^24.15.0 || >=26.0.0`, the range of its dependency
|
|
|
34
34
|
|
|
35
35
|
## Running from a checkout
|
|
36
36
|
|
|
37
|
-
An installed `way`
|
|
38
|
-
[`@osdlc/cli-tool/devlink`](https://www.npmjs.com/package/@osdlc/cli-tool).
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
An installed `way` can run the source of a checkout instead, through
|
|
38
|
+
[`@osdlc/cli-tool/devlink`](https://www.npmjs.com/package/@osdlc/cli-tool).
|
|
39
|
+
`way dev link` makes one checkout the one every `way` on the machine runs, and
|
|
40
|
+
`WAY_HOME` names one for a shell. Every link is remembered. `way dev` is a
|
|
41
|
+
contributor tool, so `way --help` does not list it.
|
|
41
42
|
|
|
42
43
|
```sh
|
|
43
44
|
way dev install # once: put shims for this checkout on PATH as way and wayfinder
|
|
@@ -48,12 +49,16 @@ way dev use canonical # … or to the install itself
|
|
|
48
49
|
way dev status # which checkout runs now, and why
|
|
49
50
|
```
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
The first match wins, in this order: `WAY_HOME`, the linked checkout, then the
|
|
53
|
+
install. `way` never picks a checkout from the cwd, so a repository you run it
|
|
54
|
+
in cannot choose the code that runs. A checkout must hold `src/cli.ts` and a
|
|
55
|
+
`package.json` named `@osdlc/wayfinder`; anything else is skipped. The shim
|
|
56
|
+
prints which one it chose on stderr, and `WAY_QUIET=1` silences it. State
|
|
57
|
+
is kept in `<config>/way/`, which is `~/Library/Application Support/way` on
|
|
58
|
+
macOS and `${XDG_CONFIG_HOME:-~/.config}/way` elsewhere. A checkout runs from
|
|
59
|
+
source, so it needs [Bun](https://bun.sh) on an absolute PATH entry and a
|
|
60
|
+
`pnpm install` in the checkout. A `bun` found only through a relative entry
|
|
61
|
+
such as `bin` or `.` is not used.
|
|
57
62
|
|
|
58
63
|
## Why
|
|
59
64
|
|
|
@@ -62,8 +67,8 @@ answers only for itself. `just --list` shows recipes. `moon query tasks` shows
|
|
|
62
67
|
moon tasks. Neither helps when the question is "how do I start that app" and you
|
|
63
68
|
do not yet know which tool owns it.
|
|
64
69
|
|
|
65
|
-
`wayfinder` puts all of them in one searchable list
|
|
66
|
-
|
|
70
|
+
`wayfinder` puts all of them in one searchable list. Each row shows the command
|
|
71
|
+
you would type, and in the terminal UI, Enter runs it.
|
|
67
72
|
|
|
68
73
|
## Groups
|
|
69
74
|
|
|
@@ -96,24 +101,24 @@ tab next runner (all · just · node-scripts │ dependencies │ tools …)
|
|
|
96
101
|
esc quit
|
|
97
102
|
```
|
|
98
103
|
|
|
99
|
-
`^s` asks
|
|
100
|
-
|
|
101
|
-
|
|
104
|
+
`^s` asks first. The status line becomes `trust this repository? y/n`, and
|
|
105
|
+
only `y` records a grant. A single key press should not decide whether this
|
|
106
|
+
repository's code may run.
|
|
102
107
|
|
|
103
|
-
A recipe that takes arguments
|
|
104
|
-
turns the key line into a command line with the command
|
|
105
|
-
cursor after it
|
|
106
|
-
`just deploy staging`, `esc`
|
|
107
|
-
|
|
108
|
+
A recipe that takes arguments asks for them first. Enter on
|
|
109
|
+
`just deploy <env>` turns the key line into a command line, with the command
|
|
110
|
+
already on it and the cursor after it. Type `staging` and press Enter to run
|
|
111
|
+
`just deploy staging`, or press `esc` to go back. A task with no arguments
|
|
112
|
+
runs as soon as you press Enter.
|
|
108
113
|
|
|
109
114
|
Fuzzy by default. Terms are ANDed, so `photo dev` narrows to a photo app's dev
|
|
110
115
|
server. A leading `'` forces one term to match exactly.
|
|
111
116
|
|
|
112
|
-
|
|
117
|
+
To start an app: press `^t`, type the app's name, then press Enter.
|
|
113
118
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
recipe
|
|
119
|
+
The command Enter will run is always shown above the key line. Tasks are
|
|
120
|
+
spawned from an argument list, never through a shell, so a shell cannot
|
|
121
|
+
reinterpret a recipe that has `<placeholders>`.
|
|
117
122
|
|
|
118
123
|
## Searching from the shell
|
|
119
124
|
|
|
@@ -129,39 +134,42 @@ way query dev --json the matching tasks, rather than their command lines
|
|
|
129
134
|
```
|
|
130
135
|
|
|
131
136
|
A leading `'` forces one term to match exactly, as it does in the UI. A search
|
|
132
|
-
that
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
`--
|
|
136
|
-
|
|
137
|
+
that matches nothing exits 1, so `way query dev && …` works in a script. A bare
|
|
138
|
+
`way query` matches everything, the same as `way --list`. Every collection
|
|
139
|
+
flag applies (`-C`, `--only`, `--exclude`, `--cached` and the rest). Like
|
|
140
|
+
`--list` and `--json`, it re-probes unless you pass `--cached`.
|
|
141
|
+
|
|
142
|
+
`--list`, `query` and the terminal UI replace each control character and bidi
|
|
143
|
+
control in repository text with U+FFFD, so a task name cannot send escape
|
|
144
|
+
sequences to your terminal or read in a different order from what runs.
|
|
145
|
+
`--json` keeps the text exact, writing DEL, C1 and bidi controls as `\u`
|
|
146
|
+
escapes, so it is safe to print too.
|
|
137
147
|
|
|
138
148
|
## The web view
|
|
139
149
|
|
|
140
150
|
`way --serve` opens a page with the same catalog: a collapsible tree by call
|
|
141
151
|
chain, sticky group headers, fuzzy and exact search, and copy buttons.
|
|
142
152
|
|
|
143
|
-
It is a server
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
is what the repository currently has.
|
|
153
|
+
It is a server, not a generated file, on purpose. A file goes out of date as
|
|
154
|
+
soon as you add a task. The server re-probes, and the page refreshes when it
|
|
155
|
+
gets focus and on a slow poll, so it shows what the repository has now.
|
|
147
156
|
|
|
148
|
-
The
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
157
|
+
The first request is answered from the [stored probe](#the-cache) while a real
|
|
158
|
+
probe runs in the background. So the page appears at once, even when the
|
|
159
|
+
slowest runner takes seconds. The rows update in place when the probe
|
|
160
|
+
finishes. Refresh always runs a real probe.
|
|
152
161
|
|
|
153
162
|
## Execution, and trust
|
|
154
163
|
|
|
155
164
|
Some runners can only be read by running them. `moon query tasks` evaluates the
|
|
156
|
-
repository's own toolchain configuration, and `mise tasks` can
|
|
157
|
-
`[hooks]`.
|
|
158
|
-
|
|
159
|
-
already ran that repository's code.
|
|
165
|
+
repository's own toolchain configuration, and `mise tasks` can run its
|
|
166
|
+
`[hooks]`. So opening a task browser on a repository you did not write runs
|
|
167
|
+
that repository's code, even if you run no task.
|
|
160
168
|
|
|
161
|
-
`wayfinder`
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
169
|
+
`wayfinder`'s `allowExec` default is `true`. You usually open a task browser in
|
|
170
|
+
your own repository, and one that cannot see the build graph is of little use.
|
|
171
|
+
But `allowExec` alone does not allow execution. The repository must also be
|
|
172
|
+
trusted. You grant trust once per repository, and it is remembered:
|
|
165
173
|
|
|
166
174
|
```text
|
|
167
175
|
way trust trust the repository at the resolved root
|
|
@@ -172,15 +180,16 @@ way trust --json the same answer as one JSON object
|
|
|
172
180
|
way trust --help this list
|
|
173
181
|
```
|
|
174
182
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
`"marker" | "path" | "owner" | null`
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
183
|
+
Each mode also has a JSON form, and `--json` prints one object per run. The
|
|
184
|
+
three modes that act on the root (the plain grant, `--untrust` and `--show`)
|
|
185
|
+
all print `{"root": …, "trusted": …, "changed": …, "by": …, "rule": …}`, so a
|
|
186
|
+
caller does not have to branch on the flag it passed. `--list` prints
|
|
187
|
+
`{"trusted": [paths]}`. `by` is `"marker" | "path" | "owner" | null` and names
|
|
188
|
+
the layer that decided (see [The policy](#the-policy) below). `rule` is the
|
|
189
|
+
matching `trust.paths` or `trust.owners` entry, present only when `by` is
|
|
190
|
+
`"path"` or `"owner"`. A `--untrust` that finds no marker to remove still
|
|
191
|
+
prints its object, and reports the miss with exit 1 and a line on stderr. So a
|
|
192
|
+
parser never gets an empty stdout.
|
|
184
193
|
|
|
185
194
|
`-C` applies here too. Trust, with execution allowed, also lets the project
|
|
186
195
|
file load tool modules; see
|
|
@@ -188,38 +197,46 @@ file load tool modules; see
|
|
|
188
197
|
|
|
189
198
|
### The policy
|
|
190
199
|
|
|
191
|
-
A root can also be trusted
|
|
192
|
-
|
|
193
|
-
|
|
200
|
+
A root can also be trusted without a marker, through a `trust` block in the
|
|
201
|
+
user config file. The project file cannot hold one: a repository cannot grant
|
|
202
|
+
itself trust, just as it cannot set `allowExec: true`.
|
|
194
203
|
|
|
195
204
|
```jsonc
|
|
196
205
|
// ~/.config/wayfinder/config.json
|
|
197
206
|
{
|
|
198
207
|
"trust": {
|
|
199
208
|
"paths": ["/home/me/work/**"], // @osdlc/trust-repo's glob dialect
|
|
200
|
-
"owners": ["my-org"] //
|
|
209
|
+
"owners": ["my-org", "gitlab.com/other-org"] // `origin` remote owners; bare means github.com
|
|
201
210
|
}
|
|
202
211
|
}
|
|
203
212
|
```
|
|
204
213
|
|
|
205
|
-
`@osdlc/trust-repo`'s `policyExecGate`
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
214
|
+
`@osdlc/trust-repo`'s `policyExecGate` checks, in order: a marker in the
|
|
215
|
+
store, then `trust.paths` (a glob over the root, with symlinks resolved), then
|
|
216
|
+
`trust.owners` (the host and owner in the `origin` remote's URL, which
|
|
217
|
+
wayfinder asks git for). An entry is `host/owner`, or a bare `owner`, which
|
|
218
|
+
means `github.com/owner`. Matching ignores case, and the host must match too:
|
|
219
|
+
`my-org` does not trust a clone from `gitlab.com/my-org`. `@osdlc/trust-repo`'s README documents the order and the glob
|
|
220
|
+
dialect. wayfinder adds only one thing: a leading `~` in a `trust.paths` entry
|
|
221
|
+
expands to `$HOME`. An owner match trusts every repository whose remote names
|
|
222
|
+
that owner, so list only owners whose repositories you would run.
|
|
223
|
+
|
|
224
|
+
Owner trust believes the repository's own git config. The `origin` URL comes
|
|
225
|
+
from the repository's `.git/config`, which arrives with the directory, so a
|
|
226
|
+
folder unpacked from an archive or copied from a shared drive can name any
|
|
227
|
+
owner. Owner trust fits clones you made yourself. `trust.paths` is the
|
|
228
|
+
stronger form: a repository cannot choose where it sits on your disk.
|
|
229
|
+
|
|
230
|
+
`way trust --show` reports which layer decided (`by` and `rule`). A plain
|
|
231
|
+
`way trust` still writes a marker on a root the policy already trusts, because
|
|
232
|
+
the policy can change later and the marker stays. `--untrust` tells you when
|
|
233
|
+
the policy still covers the root after the marker is removed.
|
|
217
234
|
|
|
218
235
|
### Removing what it has stored
|
|
219
236
|
|
|
220
|
-
|
|
221
|
-
Bare `clean` reports them
|
|
222
|
-
|
|
237
|
+
wayfinder stores three things outside your repositories, and `way clean`
|
|
238
|
+
removes them. Bare `way clean` only reports them, so it deletes nothing by
|
|
239
|
+
default.
|
|
223
240
|
|
|
224
241
|
```text
|
|
225
242
|
way clean show each store, where it is, and what it holds
|
|
@@ -230,46 +247,47 @@ way clean --all --yes all three
|
|
|
230
247
|
way clean --json the same answer as one JSON object
|
|
231
248
|
```
|
|
232
249
|
|
|
233
|
-
`--json`
|
|
234
|
-
`{key, flag, what, path, bytes, removed}
|
|
235
|
-
the ones you named
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
goes to stderr
|
|
239
|
-
|
|
240
|
-
`--config` and `--all`
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
project's own `wayfinder.config.json` belongs to that project.
|
|
245
|
-
|
|
246
|
-
The store is a directory of marker files at
|
|
247
|
-
`~/.local/state/wayfinder/trusted/`
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
`~/.local/state/waypost/trusted/`, still
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
`
|
|
271
|
-
|
|
272
|
-
|
|
250
|
+
`--json` prints one object with a `stores` array of
|
|
251
|
+
`{key, flag, what, path, bytes, removed}`. A bare report lists every store. A
|
|
252
|
+
removal lists only the ones you named. `bytes` is null when nothing was stored.
|
|
253
|
+
That tells "nothing to remove" apart from "could not remove", since both have
|
|
254
|
+
`removed: false`. Under `--json`, the closing note that trust will be asked for
|
|
255
|
+
again goes to stderr, so stdout stays one JSON document.
|
|
256
|
+
|
|
257
|
+
`--config` and `--all` need `--yes` because the three stores are not equally
|
|
258
|
+
easy to replace. The cache is rebuilt by one slow probe. Losing trust means
|
|
259
|
+
answering the trust question again for each repository. The configuration is
|
|
260
|
+
the only one you wrote by hand. `clean` never touches anything inside a
|
|
261
|
+
repository: a project's own `wayfinder.config.json` belongs to that project.
|
|
262
|
+
|
|
263
|
+
The trust store is a directory of marker files at
|
|
264
|
+
`$XDG_STATE_HOME/wayfinder/trusted/`, or `~/.local/state/wayfinder/trusted/`
|
|
265
|
+
when that variable is unset. It is XDG state, not config. The program
|
|
266
|
+
maintains trust, and a person does not edit it by hand. A consent record
|
|
267
|
+
copied to a new machine in a dotfiles repository is no longer consent. Grants
|
|
268
|
+
made under the old waypost name, in `~/.local/state/waypost/trusted/`, still
|
|
269
|
+
count.
|
|
270
|
+
|
|
271
|
+
**A repository cannot trust itself.** `allowExec: true` in
|
|
272
|
+
`wayfinder.config.json` is ignored with a warning, because that file lives
|
|
273
|
+
inside the repository being scanned. The project file may still lower
|
|
274
|
+
`allowExec` to `false`. A `trust` block in the project file is ignored with a
|
|
275
|
+
warning too. Unlike `allowExec`, trust has no lower setting a repository could
|
|
276
|
+
choose.
|
|
277
|
+
|
|
278
|
+
`--exec` allows execution for one run and records nothing, which suits a
|
|
279
|
+
script or a CI job. `--no-exec` turns execution off, however trusted the
|
|
280
|
+
repository is. Both flags apply on every surface, including the web view. Its
|
|
281
|
+
`POST /api/trust` returns `409` whenever a grant would have no effect, so the
|
|
282
|
+
page cannot lift `--no-exec` or make an `--exec` run permanent. The page hides
|
|
283
|
+
its trust button in those states, and the server refuses the request anyway.
|
|
284
|
+
The session token proves who is asking, not that the request makes sense.
|
|
285
|
+
|
|
286
|
+
When runners are withheld, every surface says so and offers a way to grant
|
|
287
|
+
trust. `--list` and `--json` print one line on stderr. The terminal UI shows
|
|
288
|
+
`N hidden — repo not trusted (^s to trust)` beside the counts. The web view
|
|
289
|
+
shows a **Trust this repository** button in a bar above the list, in each
|
|
290
|
+
withheld runner's info panel and in the runner picker.
|
|
273
291
|
|
|
274
292
|
### What decides
|
|
275
293
|
|
|
@@ -283,26 +301,27 @@ and in the runner picker.
|
|
|
283
301
|
| `true` | no | none | `false` | willing in principle, but this repository has not been trusted |
|
|
284
302
|
| `true` | yes | none | `true` | the only combination that runs a subprocess |
|
|
285
303
|
|
|
286
|
-
|
|
287
|
-
hash of its contents
|
|
288
|
-
that later pulls hostile changes stays trusted, and `way trust --untrust` is
|
|
289
|
-
only remedy.
|
|
290
|
-
ordinary edits,
|
|
304
|
+
Trust is keyed on the repository's absolute path, with symlinks resolved, not
|
|
305
|
+
on a hash of its contents. mise makes the same tradeoff. A trusted repository
|
|
306
|
+
that later pulls hostile changes stays trusted, and `way trust --untrust` is
|
|
307
|
+
the only remedy. Hashing every runner config instead would ask again after
|
|
308
|
+
ordinary edits, and people would learn to approve without reading.
|
|
291
309
|
|
|
292
310
|
## The cache
|
|
293
311
|
|
|
294
|
-
Some runners are slow to ask
|
|
295
|
-
a browser that waits for them looks broken. `wayfinder`
|
|
296
|
-
|
|
312
|
+
Some runners are slow to ask (moon starts its toolchain, sbt starts a JVM),
|
|
313
|
+
and a browser that waits for them looks broken. `wayfinder` stores the last
|
|
314
|
+
answer for each root and runner, so the UI can show rows at once.
|
|
297
315
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
316
|
+
The terminal UI and `--serve` always start from the store. They read it, show
|
|
317
|
+
the rows, then probe in the background and update in place. `--json` and
|
|
318
|
+
`--list` re-probe on every run, because a script or an agent reading them needs
|
|
319
|
+
what the repository has right now. Those runs also write the store, so the next
|
|
320
|
+
UI start is instant. `--cached` makes `--json` and `--list` read the store for
|
|
303
321
|
one run.
|
|
304
322
|
|
|
305
|
-
|
|
323
|
+
A stored answer is in one of three states, and every surface shows them the
|
|
324
|
+
same way:
|
|
306
325
|
|
|
307
326
|
- **Fresh** — the stored answer still holds, and nothing is said.
|
|
308
327
|
- **Stale** — the answer was used and is out of date. The terminal UI marks the
|
|
@@ -310,21 +329,21 @@ Three states, and each surface shows them the same way:
|
|
|
310
329
|
(~149ms)` beside the counts, or `cached rows: just 35s old — ^r to re-probe`
|
|
311
330
|
once the refresh is over and the rows are still the stored ones; the page
|
|
312
331
|
shows `cached: just 35s old - re-probing`.
|
|
313
|
-
- **Stale and slow to probe here** — the case the cache exists for
|
|
314
|
-
|
|
332
|
+
- **Stale and slow to probe here** — the case the cache exists for. It is
|
|
333
|
+
shown in red, to set it apart from a 200ms refresh:
|
|
315
334
|
`cached rows — moon (~2.4s) is slow to probe here, so this takes a moment`.
|
|
316
335
|
|
|
317
|
-
Slowness is measured in
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
336
|
+
Slowness is measured in this repository: the median of the last five probe
|
|
337
|
+
durations. A runner that is quick here is never called slow because it is slow
|
|
338
|
+
elsewhere. When a repository has no measurement yet, the surface says so
|
|
339
|
+
instead of guessing a number.
|
|
321
340
|
|
|
322
|
-
`^r` in the terminal UI and Refresh on the page
|
|
323
|
-
|
|
341
|
+
`^r` in the terminal UI and Refresh on the page always run a real probe. They
|
|
342
|
+
never answer from the store.
|
|
324
343
|
|
|
325
|
-
If a row
|
|
326
|
-
both surfaces
|
|
327
|
-
spawn failure.
|
|
344
|
+
If you run a row whose task no longer exists, such as a task renamed since the
|
|
345
|
+
stored probe, both surfaces tell you the row came from the store, instead of
|
|
346
|
+
showing only a spawn failure.
|
|
328
347
|
|
|
329
348
|
For the pipeable surfaces, `--cached` names the stale runners on stderr, so
|
|
330
349
|
`--list` stays pipeable and `--json` stays parseable:
|
|
@@ -334,31 +353,37 @@ wayfinder: --cached: stale: just (35s old, refresh usually about 149ms)
|
|
|
334
353
|
wayfinder: --cached: not cached, probed now: github-actions
|
|
335
354
|
```
|
|
336
355
|
|
|
337
|
-
`--cached`
|
|
338
|
-
and says so. `--json --cached`
|
|
339
|
-
entry per selected runner
|
|
340
|
-
|
|
341
|
-
The
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
un-trust repositories. The cache
|
|
345
|
-
answer is never a trust grant, clearing
|
|
346
|
-
|
|
347
|
-
|
|
356
|
+
`--cached` with an empty store is not an error. It probes, stores the result,
|
|
357
|
+
and says so. `--json --cached` adds a `cache` array beside the catalog, with
|
|
358
|
+
one entry per selected runner. Over HTTP the page always receives this array.
|
|
359
|
+
|
|
360
|
+
The cache is at `$XDG_CACHE_HOME/wayfinder/`, or `~/.cache/wayfinder/`. It is
|
|
361
|
+
XDG cache, not the `~/.local/state/wayfinder/` directory that
|
|
362
|
+
[trust](#execution-and-trust) uses. Losing the cache costs one slow probe.
|
|
363
|
+
Losing the trust store would silently un-trust repositories. The cache plays no
|
|
364
|
+
part in deciding execution. A cached answer is never a trust grant, clearing
|
|
365
|
+
the cache never changes what is trusted, and a runner withheld for lack of
|
|
366
|
+
trust is never stored. A stored answer is invalidated by a content hash over
|
|
367
|
+
the files its probe read, never by mtime. The
|
|
348
368
|
[`@osdlc/system-model` README](https://www.npmjs.com/package/@osdlc/system-model)
|
|
349
|
-
|
|
369
|
+
describes the limits of this.
|
|
350
370
|
|
|
351
371
|
## Configuration
|
|
352
372
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
defaults, `$XDG_CONFIG_HOME/wayfinder/config.json` (or
|
|
357
|
-
`wayfinder.config.json` at the project
|
|
373
|
+
Options you would otherwise type on every run can live in a file: which
|
|
374
|
+
runners to skip, what order to show them in, whether execution is allowed, and
|
|
375
|
+
how files are discovered. The layers, lowest precedence first: built-in
|
|
376
|
+
defaults, `$XDG_CONFIG_HOME/wayfinder/config.json` (or
|
|
377
|
+
`~/.config/wayfinder/config.json`), `wayfinder.config.json` at the project
|
|
378
|
+
root, then the flags on the command line.
|
|
358
379
|
|
|
359
380
|
The keys are `runners.disabled`, `runners.order`, `allowExec`, `discovery`,
|
|
360
381
|
`excludePaths`, `trust.paths`, `trust.owners` and `tools`. `WAYFINDER_CONFIG`
|
|
361
|
-
names a different user file and changes nothing else.
|
|
382
|
+
names a different user file and changes nothing else. A relative
|
|
383
|
+
`WAYFINDER_CONFIG` is ignored with a warning: from the repository root it
|
|
384
|
+
would name a file in the repository. Use an absolute path or `~/`. A relative
|
|
385
|
+
`HOME` counts as unset, and the account's home is used. A relative `XDG_CONFIG_HOME`, `XDG_STATE_HOME` or `XDG_CACHE_HOME` is
|
|
386
|
+
ignored, as the XDG spec says.
|
|
362
387
|
|
|
363
388
|
The tool was called waypost before its first release. `WAYPOST_CONFIG`,
|
|
364
389
|
`~/.config/waypost/config.json` and `waypost.config.json` are still read when
|
|
@@ -375,28 +400,29 @@ way config --help this list
|
|
|
375
400
|
```
|
|
376
401
|
|
|
377
402
|
`-C` applies here too, so `way config path -C /elsewhere` reports that
|
|
378
|
-
directory's files rather than this one's.
|
|
379
|
-
|
|
380
|
-
|
|
403
|
+
directory's files rather than this one's. Exit code 2 means the command as
|
|
404
|
+
typed cannot run, such as an unknown key or a value of the wrong type. Exit
|
|
405
|
+
code 1 means the command was valid but failed against the state it found.
|
|
381
406
|
|
|
382
|
-
`runners.order` sets the
|
|
383
|
-
terminal UI's tab
|
|
384
|
-
|
|
407
|
+
`runners.order` sets the runner order everywhere: `--json`, `--list`, the
|
|
408
|
+
terminal UI's tab order, and the web view. In the web view, an order you set by
|
|
409
|
+
dragging is saved in the browser and overrides it.
|
|
385
410
|
|
|
386
411
|
### `allowExec` here
|
|
387
412
|
|
|
388
|
-
wayfinder's execution default is `true`,
|
|
413
|
+
wayfinder's execution default is `true`, and any file overrides it. Highest
|
|
414
|
+
precedence first:
|
|
389
415
|
|
|
390
416
|
1. `--exec` or `--no-exec` on this command line
|
|
391
|
-
2. `allowExec
|
|
417
|
+
2. `allowExec: false` in `wayfinder.config.json`, then `allowExec` in the user file
|
|
392
418
|
3. wayfinder's own default, `true`
|
|
393
419
|
|
|
394
420
|
A file has to say `false` for execution to be off. `way config list` and
|
|
395
421
|
`way config get allowExec` report that default, labelled `(default)`.
|
|
396
422
|
|
|
397
|
-
This
|
|
398
|
-
|
|
399
|
-
|
|
423
|
+
This setting alone does not allow execution. The repository must also be
|
|
424
|
+
[trusted](#execution-and-trust), so with `true` here, runners that must run to
|
|
425
|
+
be read are still skipped until then.
|
|
400
426
|
|
|
401
427
|
## Options
|
|
402
428
|
|
|
@@ -430,12 +456,11 @@ providers the registered tools, built-in and your own;
|
|
|
430
456
|
`providers --help`
|
|
431
457
|
clean remove what this tool has stored; `clean --help`
|
|
432
458
|
guide how to use and extend this tool, in Markdown
|
|
433
|
-
dev link a checkout of this tool over the installed copy
|
|
434
459
|
```
|
|
435
460
|
|
|
436
|
-
A subcommand is
|
|
437
|
-
top-level command
|
|
438
|
-
answer depends on
|
|
461
|
+
A subcommand is matched before flags are parsed, so the flags above belong to
|
|
462
|
+
the top-level command, not to the subcommands. `-C` is the exception. The
|
|
463
|
+
subcommands whose answer depends on the repository take it.
|
|
439
464
|
|
|
440
465
|
| Subcommand | `-C, --dir` | Why |
|
|
441
466
|
|---|---|---|
|
|
@@ -444,17 +469,17 @@ answer depends on which repository you are asking about take it.
|
|
|
444
469
|
| `providers` | yes | a trusted project file can add tools when execution is allowed |
|
|
445
470
|
| `clean` | no | resolves every path from the environment and the home directory |
|
|
446
471
|
| `guide` | no | its argument is a topic name |
|
|
447
|
-
| `dev` | no | its state is devlink's, keyed on the tool name |
|
|
472
|
+
| `dev` | no | its state is devlink's, keyed on the tool name; not listed in the help |
|
|
448
473
|
|
|
449
|
-
`way --help` is the short form: the ways
|
|
450
|
-
pass, and the names of
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
usage error prints the short form too.
|
|
474
|
+
`way --help` is the short form: the main ways to run it, the flags most runs
|
|
475
|
+
pass, and the names of the subcommands. `way --help --all` is the full flag
|
|
476
|
+
list shown above. Each subcommand has its own `--help`. `way guide` is the long
|
|
477
|
+
form, by topic. A usage error, such as a mistyped flag, prints the short form,
|
|
478
|
+
so the error is not lost in the full list.
|
|
455
479
|
|
|
456
|
-
`way guide` prints
|
|
457
|
-
`guide extend`
|
|
480
|
+
`way guide` prints instructions on using and extending the tool, for people
|
|
481
|
+
and for agents. `way guide extend` covers adding a tool, and `way guide trust`
|
|
482
|
+
covers when runners may run.
|
|
458
483
|
|
|
459
484
|
The directory is resolved upward to the project root, so running from a
|
|
460
485
|
subdirectory still inspects the whole repository.
|
|
@@ -477,12 +502,15 @@ repository is trusted and execution is allowed (`allowExec` not `false`, no
|
|
|
477
502
|
`--no-exec`); otherwise wayfinder prints a warning and loads nothing from it.
|
|
478
503
|
`way guide extend` prints a complete example. A tool's runner may define
|
|
479
504
|
`invoke(task, args)` to say where typed arguments go, such as after `--` for
|
|
480
|
-
`npm run
|
|
505
|
+
`npm run`. By default they are appended.
|
|
481
506
|
|
|
482
507
|
`way providers` lists every registered tool: its roles, its runner kind
|
|
483
508
|
(`parse` reads files, `exec` must run the tool and needs trust), its binary,
|
|
484
509
|
whether that binary is on PATH, and whether it is built in or custom.
|
|
485
|
-
`--json` gives the same rows as data.
|
|
510
|
+
`--json` gives the same rows as data. Only absolute PATH entries count, as in
|
|
511
|
+
detection: a tool found only through a relative entry (`bin`, `.`,
|
|
512
|
+
`node_modules/.bin`) reads as not installed. Put an absolute entry for it on
|
|
513
|
+
PATH.
|
|
486
514
|
|
|
487
515
|
## How it compares
|
|
488
516
|
|