@osdlc/wayfinder 0.7.4 → 0.9.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.
- package/CHANGELOG.md +240 -0
- package/CONTRIBUTING.md +6 -0
- package/README.md +310 -150
- package/SECURITY.md +19 -5
- package/dist/actions.d.ts +23 -0
- package/dist/actions.js +97 -0
- package/dist/app.d.ts +1 -13
- package/dist/app.js +1 -13
- package/dist/args.d.ts +11 -6
- package/dist/args.js +25 -7
- package/dist/cache.d.ts +2 -4
- package/dist/cache.js +5 -10
- package/dist/catalog.d.ts +45 -4
- package/dist/catalog.js +134 -13
- package/dist/clean-command.d.ts +65 -36
- package/dist/clean-command.js +372 -226
- package/dist/cli.d.ts +24 -57
- package/dist/cli.js +139 -568
- package/dist/commands/browse.d.ts +128 -0
- package/dist/commands/browse.js +153 -0
- package/dist/commands/index.d.ts +25 -0
- package/dist/commands/index.js +71 -0
- package/dist/commands/list.d.ts +224 -0
- package/dist/commands/list.js +178 -0
- package/dist/commands/query.d.ts +166 -0
- package/dist/commands/query.js +73 -0
- package/dist/commands/run.d.ts +114 -0
- package/dist/commands/run.js +139 -0
- package/dist/commands/shared.d.ts +152 -0
- package/dist/commands/shared.js +209 -0
- package/dist/config-command.d.ts +27 -43
- package/dist/config-command.js +129 -330
- package/dist/config-keys.d.ts +25 -0
- package/dist/config-keys.js +29 -0
- package/dist/config.d.ts +272 -257
- package/dist/config.js +611 -460
- package/dist/core/copy-text.d.ts +30 -0
- package/dist/core/copy-text.js +50 -0
- package/dist/core/filter.d.ts +55 -0
- package/dist/core/filter.js +59 -0
- package/dist/core/run.d.ts +22 -0
- package/dist/core/run.js +59 -0
- package/dist/core/saved-view.d.ts +59 -0
- package/dist/core/saved-view.js +119 -0
- package/dist/core/session.d.ts +282 -0
- package/dist/core/session.js +602 -0
- package/dist/core/skills.d.ts +53 -0
- package/dist/core/skills.js +54 -0
- package/dist/core/unknowns.d.ts +72 -0
- package/dist/core/unknowns.js +68 -0
- package/dist/devlink.d.ts +3 -0
- package/dist/devlink.js +5 -2
- package/dist/document-schemas.generated.d.ts +22 -0
- package/dist/document-schemas.generated.js +916 -0
- package/dist/documents.d.ts +508 -0
- package/dist/documents.js +181 -0
- package/dist/groups.d.ts +22 -26
- package/dist/groups.js +13 -29
- package/dist/guide.d.ts +26 -13
- package/dist/guide.js +119 -103
- package/dist/index.d.ts +118 -0
- package/dist/index.js +61 -0
- package/dist/keys.d.ts +51 -0
- package/dist/keys.js +273 -0
- package/dist/page.d.ts +18 -8
- package/dist/page.js +28 -17
- package/dist/providers-command.d.ts +81 -20
- package/dist/providers-command.js +33 -75
- package/dist/schema.d.ts +48 -0
- package/dist/schema.js +61 -0
- package/dist/serve/auth.d.ts +46 -0
- package/dist/serve/auth.js +82 -0
- package/dist/serve/catalog-share.d.ts +63 -0
- package/dist/serve/catalog-share.js +155 -0
- package/dist/serve/index.d.ts +100 -0
- package/dist/serve/index.js +259 -0
- package/dist/serve/routes.d.ts +60 -0
- package/dist/serve/routes.js +186 -0
- package/dist/serve/terminal-input.d.ts +50 -0
- package/dist/serve/terminal-input.js +108 -0
- package/dist/skills.d.ts +19 -0
- package/dist/skills.js +54 -0
- package/dist/terminal-text.d.ts +8 -0
- package/dist/terminal-text.js +19 -6
- package/dist/tool-info.d.ts +24 -0
- package/dist/tool-info.js +17 -0
- package/dist/trust-command.d.ts +15 -27
- package/dist/trust-command.js +110 -208
- package/dist/trust-store.d.ts +5 -10
- package/dist/trust-store.js +9 -42
- package/dist/tui/app.d.ts +193 -0
- package/dist/tui/app.js +1400 -0
- package/dist/tui/copy.d.ts +29 -0
- package/dist/tui/copy.js +39 -0
- package/dist/tui/index.d.ts +33 -0
- package/dist/tui/index.js +97 -0
- package/dist/tui/keys-input.d.ts +27 -0
- package/dist/tui/keys-input.js +87 -0
- package/dist/tui/settings.d.ts +94 -0
- package/dist/tui/settings.js +198 -0
- package/dist/tui/style.d.ts +62 -0
- package/dist/tui/style.js +77 -0
- package/dist/version.d.ts +6 -0
- package/dist/version.js +7 -0
- package/dist/vocabulary.d.ts +91 -0
- package/dist/vocabulary.js +155 -0
- package/dist/web/main.js +2232 -582
- package/dist/web/page.html +41 -33
- package/dist/web/styles.css +513 -329
- package/dist/xdg.d.ts +76 -4
- package/dist/xdg.js +77 -5
- package/package.json +27 -8
- package/schema/config.json +133 -0
- package/dist/http.d.ts +0 -22
- package/dist/http.js +0 -149
- package/dist/origin-owner.d.ts +0 -19
- package/dist/origin-owner.js +0 -85
- package/dist/serve.d.ts +0 -98
- package/dist/serve.js +0 -671
- package/dist/tui.d.ts +0 -177
- package/dist/tui.js +0 -840
package/dist/tui.d.ts
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The terminal UI: browse every task in a repository, and run one.
|
|
3
|
-
*
|
|
4
|
-
* Unlike the page, Enter runs the selected task in this shell and hands it the
|
|
5
|
-
* terminal. The page can only give you a command to paste.
|
|
6
|
-
*
|
|
7
|
-
* No dependencies: raw mode, ANSI, and one frame string per keystroke. A TUI
|
|
8
|
-
* toolkit would weigh more than the code it saves, and this has to keep
|
|
9
|
-
* working from a checkout whose node_modules is what you are trying to repair.
|
|
10
|
-
* The CLI sends its output through `CliIo` so `main()` can be tested without
|
|
11
|
-
* a real stream. This file writes to `process.stdout` directly, because its
|
|
12
|
-
* job is to control the terminal: raw mode, the alternate screen, and handing
|
|
13
|
-
* the terminal to a spawned task.
|
|
14
|
-
*
|
|
15
|
-
* Collection is async, which is what most of the state handling below is for:
|
|
16
|
-
* keystrokes arrive during a refresh, and a row can be stale.
|
|
17
|
-
*/
|
|
18
|
-
import { type Catalog, type Project, type RunnerCacheState, type Task } from '@osdlc/system-model/detect';
|
|
19
|
-
import { type Mode } from '@osdlc/system-model/match';
|
|
20
|
-
import type { ExecGate } from '@osdlc/trust-repo';
|
|
21
|
-
import { type WayOptions } from './catalog.ts';
|
|
22
|
-
export interface Row {
|
|
23
|
-
task: Task;
|
|
24
|
-
score: number;
|
|
25
|
-
labelHits: number[] | null;
|
|
26
|
-
}
|
|
27
|
-
interface State {
|
|
28
|
-
catalog: Catalog | null;
|
|
29
|
-
/** The registered tools, built-ins plus any loaded. */
|
|
30
|
-
project: Project;
|
|
31
|
-
/**
|
|
32
|
-
* The project file names tools that were not loaded, because the repository
|
|
33
|
-
* is untrusted or execution is off.
|
|
34
|
-
*/
|
|
35
|
-
projectToolsPending: boolean;
|
|
36
|
-
root: string;
|
|
37
|
-
options: WayOptions;
|
|
38
|
-
/** `runners.order` from config; applied to every collected catalog. */
|
|
39
|
-
runnerOrder: string[] | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* The trust store's environment and home, passed from the CLI. Injectable so
|
|
42
|
-
* a test does not grant trust in the developer's own
|
|
43
|
-
* `~/.local/state/wayfinder/`. Only tests pass them.
|
|
44
|
-
*/
|
|
45
|
-
env: Record<string, string | undefined> | undefined;
|
|
46
|
-
home: string | undefined;
|
|
47
|
-
/** Where stored probes live, resolved once from the injected env and home. */
|
|
48
|
-
store: string;
|
|
49
|
-
/**
|
|
50
|
-
* Where each runner's rows came from, one entry per selected runner.
|
|
51
|
-
*
|
|
52
|
-
* At start the screen shows the store before anything is probed, so a row
|
|
53
|
-
* may be an hour old. This records which rows are, and is reset to all-fresh
|
|
54
|
-
* as soon as a real probe finishes.
|
|
55
|
-
*/
|
|
56
|
-
cache: RunnerCacheState[];
|
|
57
|
-
runner: string;
|
|
58
|
-
query: string;
|
|
59
|
-
mode: Mode;
|
|
60
|
-
/** Show only services — tasks that run until you stop them. Toggled by ^t. */
|
|
61
|
-
servicesOnly: boolean;
|
|
62
|
-
/** Selection is held by task id, not row index — see `refresh`. */
|
|
63
|
-
selectedId: string | null;
|
|
64
|
-
scroll: number;
|
|
65
|
-
message: string;
|
|
66
|
-
loading: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* Why execution is on or off, decided once by the CLI. Only `"untrusted"`
|
|
69
|
-
* offers ^s. When a config file turned execution off, trusting the
|
|
70
|
-
* repository would change nothing, so offering it would mislead.
|
|
71
|
-
*/
|
|
72
|
-
gate: ExecGate | null;
|
|
73
|
-
/**
|
|
74
|
-
* True once ^s has asked and is waiting for `y`. Trust lets this
|
|
75
|
-
* repository's code run, so one keystroke cannot grant it. This matters
|
|
76
|
-
* most for ^s, which is flow control on many terminals and can be sent by
|
|
77
|
-
* accident. The second key makes it a decision.
|
|
78
|
-
*/
|
|
79
|
-
confirmingTrust: boolean;
|
|
80
|
-
/**
|
|
81
|
-
* The task whose arguments are being typed, and what has been typed so far.
|
|
82
|
-
*
|
|
83
|
-
* Set only for a task that declares parameters. `argv` leaves them out, so
|
|
84
|
-
* running it straight from Enter would spawn `just deploy` with no
|
|
85
|
-
* environment, and the terminal would be handed over before anything could
|
|
86
|
-
* say so. For a task with no parameters it stays null and Enter runs it.
|
|
87
|
-
*/
|
|
88
|
-
entering: {
|
|
89
|
-
task: Task;
|
|
90
|
-
text: string;
|
|
91
|
-
} | null;
|
|
92
|
-
/**
|
|
93
|
-
* The settings screen's rendered lines, or null when it is closed.
|
|
94
|
-
*
|
|
95
|
-
* Rendered once on open rather than on every frame. It reads the config
|
|
96
|
-
* from disk, and nothing on this screen can change it, so re-reading it per
|
|
97
|
-
* keystroke would be wasted work.
|
|
98
|
-
*/
|
|
99
|
-
settings: string[] | null;
|
|
100
|
-
/** Increased on each refresh, so an older result cannot overwrite a newer one. */
|
|
101
|
-
generation: number;
|
|
102
|
-
inFlight: AbortController | null;
|
|
103
|
-
rows: Row[];
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* The module singleton.
|
|
107
|
-
*
|
|
108
|
-
* Exported for one reason. `runTui` takes over a real terminal and never
|
|
109
|
-
* returns, so the selection rule (the selection must survive a refresh that
|
|
110
|
-
* reorders or drops rows under the cursor) can only be tested through this
|
|
111
|
-
* and {@link recompute}. Nothing outside a test writes to it.
|
|
112
|
-
*/
|
|
113
|
-
export declare const state: State;
|
|
114
|
-
/**
|
|
115
|
-
* What the status line says about the rows on screen, in three states.
|
|
116
|
-
*
|
|
117
|
-
* Fresh says nothing. A line that is always shown is a line nobody reads,
|
|
118
|
-
* and there is nothing to report.
|
|
119
|
-
*
|
|
120
|
-
* Stale and slow is kept apart from ordinary stale because it is the case the
|
|
121
|
-
* cache exists for. A runner measured at several seconds in this repository
|
|
122
|
-
* is why the screen would otherwise be empty. Showing it the same way as a
|
|
123
|
-
* 200ms refresh would hide the one warning that matters. Slowness is
|
|
124
|
-
* measured, never assumed: a runner that is quick here is not called slow
|
|
125
|
-
* because it is slow elsewhere.
|
|
126
|
-
*/
|
|
127
|
-
export declare function refreshNote(rows: readonly RunnerCacheState[], loading: boolean): {
|
|
128
|
-
text: string;
|
|
129
|
-
slow: boolean;
|
|
130
|
-
} | null;
|
|
131
|
-
/** Index of the selected task, or 0 when its id is no longer present. */
|
|
132
|
-
export declare function cursor(): number;
|
|
133
|
-
/**
|
|
134
|
-
* The whole screen as one string.
|
|
135
|
-
*
|
|
136
|
-
* Exported with {@link state} and {@link recompute} so tests can check the
|
|
137
|
-
* three cache states in the rendered lines, not only in the helper that
|
|
138
|
-
* builds them. The user reads the status line, and a correct note placed in
|
|
139
|
-
* the wrong line helps nobody.
|
|
140
|
-
*/
|
|
141
|
-
export declare function frame(width: number, height: number): string;
|
|
142
|
-
/**
|
|
143
|
-
* Rebuild the visible rows and re-anchor the selection onto a task that is
|
|
144
|
-
* still there.
|
|
145
|
-
*
|
|
146
|
-
* Split out of {@link draw} so it can be tested without a terminal. This is
|
|
147
|
-
* why selection is held by task id: a refresh reorders and drops rows, and an
|
|
148
|
-
* index would silently point at a different task, so the same keystroke
|
|
149
|
-
* would run the wrong command.
|
|
150
|
-
*/
|
|
151
|
-
export declare function recompute(): void;
|
|
152
|
-
/**
|
|
153
|
-
* One keystroke.
|
|
154
|
-
*
|
|
155
|
-
* Exported for the same reason `state` is. `runTui` takes over a real
|
|
156
|
-
* terminal and never returns, so tests reach the keys that touch disk
|
|
157
|
-
* (settings, trust) only through this.
|
|
158
|
-
*/
|
|
159
|
-
export declare function handle(key: string): void;
|
|
160
|
-
/**
|
|
161
|
-
* `gate` is the trust decision the CLI already made. The TUI needs the whole
|
|
162
|
-
* decision, not just its boolean. "No exec because a file said so" and "no
|
|
163
|
-
* exec because this repository is not trusted" need different messages, and
|
|
164
|
-
* only the second has a key that fixes it.
|
|
165
|
-
*/
|
|
166
|
-
export interface TuiOptions {
|
|
167
|
-
project: Project;
|
|
168
|
-
projectToolsPending?: boolean | undefined;
|
|
169
|
-
root: string;
|
|
170
|
-
options: WayOptions;
|
|
171
|
-
runnerOrder?: string[] | undefined;
|
|
172
|
-
gate?: ExecGate | undefined;
|
|
173
|
-
env?: Record<string, string | undefined> | undefined;
|
|
174
|
-
home?: string | undefined;
|
|
175
|
-
}
|
|
176
|
-
export declare function runTui({ project, projectToolsPending, root, options, runnerOrder, gate, env, home, }: TuiOptions): Promise<number>;
|
|
177
|
-
export {};
|