@osdlc/wayfinder 0.7.3 → 0.8.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 +221 -0
- package/CONTRIBUTING.md +6 -0
- package/README.md +295 -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 +30 -3
- package/dist/catalog.js +87 -11
- 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 +151 -0
- package/dist/commands/index.d.ts +25 -0
- package/dist/commands/index.js +71 -0
- package/dist/commands/list.d.ts +208 -0
- package/dist/commands/list.js +127 -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 +271 -257
- package/dist/config.js +610 -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 +262 -0
- package/dist/core/session.js +589 -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 +432 -0
- package/dist/documents.js +163 -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 +112 -0
- package/dist/index.js +58 -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 +51 -0
- package/dist/serve/catalog-share.js +116 -0
- package/dist/serve/index.d.ts +98 -0
- package/dist/serve/index.js +251 -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 +180 -0
- package/dist/tui/app.js +1278 -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 +89 -0
- package/dist/vocabulary.js +153 -0
- package/dist/web/main.js +1965 -568
- package/dist/web/page.html +39 -33
- package/dist/web/styles.css +457 -329
- package/dist/xdg.d.ts +76 -4
- package/dist/xdg.js +77 -5
- package/package.json +28 -9
- 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/serve.d.ts
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The web view: the same catalog as a page you can search in a browser.
|
|
3
|
-
*
|
|
4
|
-
* It is a server rather than a generated file, because a file goes out of date
|
|
5
|
-
* as soon as a task is added, with no sign that it has. `/api/catalog`
|
|
6
|
-
* re-probes (requests close together share one probe), and the page re-fetches
|
|
7
|
-
* on focus and on a slow poll, so the screen shows what the repository has now.
|
|
8
|
-
*
|
|
9
|
-
* Loopback alone does not keep other callers out, so every route needs a token.
|
|
10
|
-
*
|
|
11
|
-
* Other local users on this machine can reach 127.0.0.1, and can read a
|
|
12
|
-
* process's argv and environment while it runs. So the session token never
|
|
13
|
-
* appears in a URL or an argv. The URL carries the boot token instead. It works
|
|
14
|
-
* once and expires after a minute, so it is only usable between opening the
|
|
15
|
-
* browser and the page loading.
|
|
16
|
-
*
|
|
17
|
-
* Any website the user visits can also send cross-origin requests to
|
|
18
|
-
* 127.0.0.1. A cookie would be sent with those (that is CSRF), but a request
|
|
19
|
-
* header is not. The token header is not a CORS-safelisted header, so a
|
|
20
|
-
* cross-origin fetch must first pass a CORS preflight, which this server never
|
|
21
|
-
* answers. That is why auth uses a header, and why the boot token is accepted
|
|
22
|
-
* on the page routes only, never on the API.
|
|
23
|
-
*
|
|
24
|
-
* `/api/run` hands this server's own terminal to a task and exits. It takes a
|
|
25
|
-
* task id and nothing else (see the note on the route).
|
|
26
|
-
*
|
|
27
|
-
* `POST /api/trust` lets this repository's code run from now on, so it has a
|
|
28
|
-
* third check beyond the method and the token: the grant must be applicable.
|
|
29
|
-
* That is the same condition that decides whether the page shows the button.
|
|
30
|
-
* Without it a grant would override `--no-exec` or write the store under
|
|
31
|
-
* `--exec`. DELETE revokes and has no such check.
|
|
32
|
-
*/
|
|
33
|
-
import { type Catalog, type Project, type RunnerCacheState } from '@osdlc/system-model/detect';
|
|
34
|
-
import { type WayOptions } from './catalog.ts';
|
|
35
|
-
import { type FetchServer } from './http.ts';
|
|
36
|
-
export interface ServeOptions {
|
|
37
|
-
/** The registered tools, built-ins plus any loaded. */
|
|
38
|
-
project: Project;
|
|
39
|
-
/**
|
|
40
|
-
* The project file names tools that were not loaded, because the repository
|
|
41
|
-
* is untrusted or execution is off. A grant from the page does not load them,
|
|
42
|
-
* and the response says so.
|
|
43
|
-
*/
|
|
44
|
-
projectToolsPending?: boolean | undefined;
|
|
45
|
-
root: string;
|
|
46
|
-
collectOptions: WayOptions;
|
|
47
|
-
port?: number | undefined;
|
|
48
|
-
open?: boolean | undefined;
|
|
49
|
-
/** `runners.order` from config; applied to every collected catalog. */
|
|
50
|
-
runnerOrder?: string[] | undefined;
|
|
51
|
-
/**
|
|
52
|
-
* Which `collectOptions` keys came from a command-line flag rather than the
|
|
53
|
-
* config file. Saving a setting re-reads the config's collect options in the
|
|
54
|
-
* running process. A key named here is left alone, because the flag is the
|
|
55
|
-
* user's latest explicit choice and saving another setting must not undo it.
|
|
56
|
-
*
|
|
57
|
-
* Only the keys `collectOptionsFromConfig` returns have an effect:
|
|
58
|
-
* `exclude`, `discovery`, `excludePaths`.
|
|
59
|
-
*/
|
|
60
|
-
pinnedByFlag?: readonly string[] | undefined;
|
|
61
|
-
/**
|
|
62
|
-
* The trust store's environment and home, passed from the CLI. Injectable so
|
|
63
|
-
* a test does not grant trust in the developer's own
|
|
64
|
-
* `~/.local/state/wayfinder/`. Only tests pass them.
|
|
65
|
-
*/
|
|
66
|
-
env?: Record<string, string | undefined> | undefined;
|
|
67
|
-
home?: string | undefined;
|
|
68
|
-
}
|
|
69
|
-
/** What the page is served: a catalog, and where each runner's rows came from. */
|
|
70
|
-
export interface CatalogSnapshot {
|
|
71
|
-
catalog: Catalog;
|
|
72
|
-
/** One entry per selected runner. All "fresh" after a real probe. */
|
|
73
|
-
cache: RunnerCacheState[];
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Bind the port and return the server's handle, without printing or opening anything.
|
|
77
|
-
*
|
|
78
|
-
* Split out of {@link serve} because `serve` never returns, and a function
|
|
79
|
-
* that never returns cannot be tested. Tests need to bind an ephemeral port,
|
|
80
|
-
* send real requests to the endpoints that write, and stop again.
|
|
81
|
-
*
|
|
82
|
-
* The catalog source is returned with the handle, so the startup banner
|
|
83
|
-
* reports the same probe the page will see.
|
|
84
|
-
*/
|
|
85
|
-
export declare function startServer(options: ServeOptions): Promise<{
|
|
86
|
-
server: FetchServer;
|
|
87
|
-
catalog: (force: boolean) => Promise<CatalogSnapshot>;
|
|
88
|
-
/** The one-shot token that signs a browser in; spent on first use. */
|
|
89
|
-
bootToken: string;
|
|
90
|
-
/** Starts the boot token's expiry timer. Call it when the URL is shown to the user. */
|
|
91
|
-
armBoot: () => void;
|
|
92
|
-
}>;
|
|
93
|
-
/**
|
|
94
|
-
* The first lines `--serve` prints: the address, the root, what was collected
|
|
95
|
-
* and what came from the cache. Repository text in them is terminal-safe.
|
|
96
|
-
*/
|
|
97
|
-
export declare function startupSummary(address: string, first: CatalogSnapshot): string;
|
|
98
|
-
export declare function serve(options: ServeOptions): Promise<number>;
|