@yaks/cli 0.0.0-stage → 0.2.36
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/LICENSE +202 -0
- package/README.md +1059 -2
- package/_dist/account-forward.d.ts +12 -0
- package/_dist/account-forward.d.ts.map +1 -0
- package/_dist/accounts.d.ts +23 -0
- package/_dist/accounts.d.ts.map +1 -0
- package/_dist/answer.d.ts +88 -0
- package/_dist/answer.d.ts.map +1 -0
- package/_dist/apply.d.ts +17 -0
- package/_dist/apply.d.ts.map +1 -0
- package/_dist/args.d.ts +86 -0
- package/_dist/args.d.ts.map +1 -0
- package/_dist/commands.d.ts +15 -0
- package/_dist/commands.d.ts.map +1 -0
- package/_dist/complete.d.ts +15 -0
- package/_dist/complete.d.ts.map +1 -0
- package/_dist/config.d.ts +37 -0
- package/_dist/config.d.ts.map +1 -0
- package/_dist/dependencies.d.ts +6 -0
- package/_dist/dependencies.d.ts.map +1 -0
- package/_dist/facets.d.ts +71 -0
- package/_dist/facets.d.ts.map +1 -0
- package/_dist/grammar.d.ts +5 -0
- package/_dist/grammar.d.ts.map +1 -0
- package/_dist/host.d.ts +164 -0
- package/_dist/host.d.ts.map +1 -0
- package/_dist/install.d.ts +43 -0
- package/_dist/install.d.ts.map +1 -0
- package/_dist/main.d.ts +16 -0
- package/_dist/main.d.ts.map +1 -0
- package/_dist/memo.d.ts +60 -0
- package/_dist/memo.d.ts.map +1 -0
- package/_dist/mod.d.ts +46 -0
- package/_dist/mod.d.ts.map +1 -0
- package/_dist/page.d.ts +73 -0
- package/_dist/page.d.ts.map +1 -0
- package/_dist/platform.d.ts +27 -0
- package/_dist/platform.d.ts.map +1 -0
- package/_dist/reader.d.ts +10 -0
- package/_dist/reader.d.ts.map +1 -0
- package/_dist/release.d.ts +48 -0
- package/_dist/release.d.ts.map +1 -0
- package/_dist/remote.d.ts +13 -0
- package/_dist/remote.d.ts.map +1 -0
- package/_dist/reported.d.ts +11 -0
- package/_dist/reported.d.ts.map +1 -0
- package/_dist/roles.d.ts +2 -0
- package/_dist/roles.d.ts.map +1 -0
- package/_dist/roster.d.ts +41 -0
- package/_dist/roster.d.ts.map +1 -0
- package/_dist/rpc.d.ts +29 -0
- package/_dist/rpc.d.ts.map +1 -0
- package/_dist/run.d.ts +164 -0
- package/_dist/run.d.ts.map +1 -0
- package/_dist/runtime.d.ts +4 -0
- package/_dist/runtime.d.ts.map +1 -0
- package/_dist/searching.d.ts +7 -0
- package/_dist/searching.d.ts.map +1 -0
- package/_dist/show.d.ts +22 -0
- package/_dist/show.d.ts.map +1 -0
- package/_dist/store.d.ts +25 -0
- package/_dist/store.d.ts.map +1 -0
- package/_dist/terminal.d.ts +17 -0
- package/_dist/terminal.d.ts.map +1 -0
- package/_dist/tool.d.ts +55 -0
- package/_dist/tool.d.ts.map +1 -0
- package/_dist/tty.d.ts +3 -0
- package/_dist/tty.d.ts.map +1 -0
- package/_dist/vault.d.ts +9 -0
- package/_dist/vault.d.ts.map +1 -0
- package/_dist/words.d.ts +11 -0
- package/_dist/words.d.ts.map +1 -0
- package/_dist/yak.d.ts +10 -0
- package/_dist/yak.d.ts.map +1 -0
- package/account-forward.js +40 -0
- package/account-forward.js.map +1 -0
- package/account-forward.ts +50 -0
- package/accounts.js +162 -0
- package/accounts.js.map +1 -0
- package/accounts.ts +228 -0
- package/answer.js +394 -0
- package/answer.js.map +1 -0
- package/answer.ts +569 -0
- package/apply.js +49 -0
- package/apply.js.map +1 -0
- package/apply.ts +54 -0
- package/args.js +420 -0
- package/args.js.map +1 -0
- package/args.ts +494 -0
- package/code.js +209 -0
- package/code.js.map +1 -0
- package/code.ts +227 -0
- package/commands.js +131 -0
- package/commands.js.map +1 -0
- package/commands.ts +142 -0
- package/complete.js +104 -0
- package/complete.js.map +1 -0
- package/complete.ts +152 -0
- package/config.js +125 -0
- package/config.js.map +1 -0
- package/config.ts +180 -0
- package/declarations.js +67 -0
- package/declarations.js.map +1 -0
- package/declarations.ts +84 -0
- package/deno.json +1 -0
- package/dependencies.js +126 -0
- package/dependencies.js.map +1 -0
- package/dependencies.ts +141 -0
- package/derive.js +102 -0
- package/derive.js.map +1 -0
- package/derive.ts +125 -0
- package/drain.js +83 -0
- package/drain.js.map +1 -0
- package/drain.ts +115 -0
- package/duties.ts +17 -0
- package/exports.json +1486 -0
- package/external.js +373 -0
- package/external.js.map +1 -0
- package/external.ts +435 -0
- package/facets.js +214 -0
- package/facets.js.map +1 -0
- package/facets.ts +232 -0
- package/feedback.js +54 -0
- package/feedback.js.map +1 -0
- package/feedback.ts +57 -0
- package/files.js +84 -0
- package/files.js.map +1 -0
- package/files.ts +112 -0
- package/get_starts.js +31 -0
- package/get_starts.js.map +1 -0
- package/get_starts.ts +34 -0
- package/git-credential.js +79 -0
- package/git-credential.js.map +1 -0
- package/git-credential.ts +77 -0
- package/grammar.js +4 -0
- package/grammar.js.map +1 -0
- package/grammar.ts +5 -0
- package/held.js +51 -0
- package/held.js.map +1 -0
- package/held.ts +66 -0
- package/host.js +1174 -0
- package/host.js.map +1 -0
- package/host.ts +1343 -0
- package/init.js +138 -0
- package/init.js.map +1 -0
- package/init.ts +139 -0
- package/install.js +216 -0
- package/install.js.map +1 -0
- package/install.ts +223 -0
- package/lifetime.js +56 -0
- package/lifetime.js.map +1 -0
- package/lifetime.ts +66 -0
- package/local-page.ts +114 -0
- package/local.js +417 -0
- package/local.js.map +1 -0
- package/local.ts +537 -0
- package/lockfile.js +20 -0
- package/lockfile.js.map +1 -0
- package/lockfile.ts +32 -0
- package/machines.js +33 -0
- package/machines.js.map +1 -0
- package/machines.ts +51 -0
- package/made/4f855610bdabcd736100d34e4e467ea5.json +1 -0
- package/main.js +534 -0
- package/main.js.map +1 -0
- package/main.ts +547 -0
- package/mcp.js +108 -0
- package/mcp.js.map +1 -0
- package/mcp.ts +113 -0
- package/member.js +103 -0
- package/member.js.map +1 -0
- package/member.ts +133 -0
- package/memo.js +503 -0
- package/memo.js.map +1 -0
- package/memo.ts +634 -0
- package/mod.js +46 -0
- package/mod.js.map +1 -0
- package/mod.ts +99 -0
- package/operations.js +53 -0
- package/operations.js.map +1 -0
- package/operations.ts +68 -0
- package/package.json +115 -4
- package/page.js +211 -0
- package/page.js.map +1 -0
- package/page.ts +308 -0
- package/parser.js +45 -0
- package/parser.js.map +1 -0
- package/parser.ts +77 -0
- package/people-search.js +112 -0
- package/people-search.js.map +1 -0
- package/people-search.ts +162 -0
- package/platform.js +184 -0
- package/platform.js.map +1 -0
- package/platform.ts +224 -0
- package/platform_effects.js +5 -0
- package/platform_effects.js.map +1 -0
- package/platform_effects.ts +13 -0
- package/prepare.js +40 -0
- package/prepare.js.map +1 -0
- package/prepare.ts +46 -0
- package/read_activity.js +54 -0
- package/read_activity.js.map +1 -0
- package/read_activity.ts +61 -0
- package/read_thread.js +387 -0
- package/read_thread.js.map +1 -0
- package/read_thread.ts +506 -0
- package/read_worker.ts +164 -0
- package/reader.js +48 -0
- package/reader.js.map +1 -0
- package/reader.ts +57 -0
- package/release.js +82 -0
- package/release.js.map +1 -0
- package/release.json +127 -0
- package/release.ts +98 -0
- package/remote-page.ts +70 -0
- package/remote.js +96 -0
- package/remote.js.map +1 -0
- package/remote.ts +153 -0
- package/report.js +83 -0
- package/report.js.map +1 -0
- package/report.ts +101 -0
- package/reported.js +32 -0
- package/reported.js.map +1 -0
- package/reported.ts +38 -0
- package/restart.js +349 -0
- package/restart.js.map +1 -0
- package/restart.ts +478 -0
- package/restore.js +32 -0
- package/restore.js.map +1 -0
- package/restore.ts +38 -0
- package/roles.js +32 -0
- package/roles.js.map +1 -0
- package/roles.ts +49 -0
- package/roster.js +65 -0
- package/roster.js.map +1 -0
- package/roster.ts +84 -0
- package/rpc.js +113 -0
- package/rpc.js.map +1 -0
- package/rpc.ts +159 -0
- package/run.js +533 -0
- package/run.js.map +1 -0
- package/run.ts +741 -0
- package/runtime.js +381 -0
- package/runtime.js.map +1 -0
- package/runtime.ts +433 -0
- package/sandboxes.js +26 -0
- package/sandboxes.js.map +1 -0
- package/sandboxes.ts +30 -0
- package/searching.js +33 -0
- package/searching.js.map +1 -0
- package/searching.ts +50 -0
- package/show.js +109 -0
- package/show.js.map +1 -0
- package/show.ts +144 -0
- package/shown.js +13 -0
- package/shown.js.map +1 -0
- package/shown.ts +44 -0
- package/stall.js +90 -0
- package/stall.js.map +1 -0
- package/stall.ts +156 -0
- package/stall_profile.js +113 -0
- package/stall_profile.js.map +1 -0
- package/stall_profile.ts +142 -0
- package/stall_wait.js +183 -0
- package/stall_wait.js.map +1 -0
- package/stall_wait.ts +249 -0
- package/stall_wait_worker.ts +11 -0
- package/start.js +349 -0
- package/start.js.map +1 -0
- package/start.ts +343 -0
- package/starvation.js +147 -0
- package/starvation.js.map +1 -0
- package/starvation.ts +224 -0
- package/store.js +118 -0
- package/store.js.map +1 -0
- package/store.ts +193 -0
- package/subcommands.js +62 -0
- package/subcommands.js.map +1 -0
- package/subcommands.ts +77 -0
- package/terminal.js +93 -0
- package/terminal.js.map +1 -0
- package/terminal.ts +128 -0
- package/text.js +20 -0
- package/text.js.map +1 -0
- package/text.ts +37 -0
- package/tool.js +76 -0
- package/tool.js.map +1 -0
- package/tool.ts +157 -0
- package/trace_control.js +231 -0
- package/trace_control.js.map +1 -0
- package/trace_control.ts +233 -0
- package/traces.js +138 -0
- package/traces.js.map +1 -0
- package/traces.ts +160 -0
- package/tracker.js +22 -0
- package/tracker.js.map +1 -0
- package/tracker.ts +27 -0
- package/tty.js +82 -0
- package/tty.js.map +1 -0
- package/tty.ts +142 -0
- package/unit_failure.js +178 -0
- package/unit_failure.js.map +1 -0
- package/unit_failure.ts +191 -0
- package/upkeep_thread.js +32 -0
- package/upkeep_thread.js.map +1 -0
- package/upkeep_thread.ts +35 -0
- package/upkeep_worker.ts +27 -0
- package/vault.js +186 -0
- package/vault.js.map +1 -0
- package/vault.ts +220 -0
- package/vocab-ids.js +63 -0
- package/vocab-ids.js.map +1 -0
- package/vocab-ids.ts +62 -0
- package/vocab.json +35 -0
- package/warm.js +138 -0
- package/warm.js.map +1 -0
- package/warm.ts +171 -0
- package/watch_revision.js +25 -0
- package/watch_revision.js.map +1 -0
- package/watch_revision.ts +30 -0
- package/words.js +29 -0
- package/words.js.map +1 -0
- package/words.ts +41 -0
- package/workspaces.js +40 -0
- package/workspaces.js.map +1 -0
- package/workspaces.ts +58 -0
- package/yak-unit-failure.conf +6 -0
- package/yak-unit-handoff.conf +2 -0
- package/yak.js +123 -0
- package/yak.js.map +1 -0
- package/yak.ts +136 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** The `deno` arguments that install `yak` at `version` under `config`.
|
|
2
|
+
*
|
|
3
|
+
* ```ts
|
|
4
|
+
* import { assertEquals } from '@std/assert'
|
|
5
|
+
* assertEquals(install('1.2.3', '/tmp/c.json').at(-1), 'jsr:@yaks/cli@1.2.3/yak')
|
|
6
|
+
* ```
|
|
7
|
+
*/ export declare let install: (version: string, config: string) => string[];
|
|
8
|
+
/** The `deno` arguments that run `yak` at `version` under `config`, with
|
|
9
|
+
* `args`: what the installed command runs, without installing it.
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { assertEquals } from '@std/assert'
|
|
13
|
+
* assertEquals(run('1.2.3', '/tmp/c.json', ['help']).slice(-2), ['jsr:@yaks/cli@1.2.3/yak', 'help'])
|
|
14
|
+
* ```
|
|
15
|
+
*/ export declare let run: (version: string, config: string, args: string[]) => string[];
|
|
16
|
+
/** A first `yak init` and `yak task list`, against a scratch graph in `dir`:
|
|
17
|
+
* a command imports the plugins a config names by name, which `deno install`
|
|
18
|
+
* never fetched, since it follows literal imports only. Run here, the wait to
|
|
19
|
+
* fetch and compile them is part of installing, and a person's first command
|
|
20
|
+
* finds them. */ export declare let warming: (dir: string) => string[][];
|
|
21
|
+
/** A first `yak serve` on that scratch graph, at `port`, asked for its canvas
|
|
22
|
+
* and stopped once it says it is ready, in the file `ready`: serving imports
|
|
23
|
+
* the facets of the web role, bundles the page, and, as it warms, starts its
|
|
24
|
+
* readers and the workers for its duty roles, none of which a command before
|
|
25
|
+
* it fetched, so a person's first `yak serve` would otherwise download them as
|
|
26
|
+
* it starts.
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* import { assertEquals } from '@std/assert'
|
|
30
|
+
* assertEquals(serving('/tmp/i', 9).slice(-5), ['serve', '--port', '9', '--ready', '/tmp/i/ready'])
|
|
31
|
+
* ```
|
|
32
|
+
*/ export declare let serving: (dir: string, port: number) => string[];
|
|
33
|
+
/** What a warm-up of `yak serve` asks for once it listens, after the page at
|
|
34
|
+
* `/`: everything the page loads (its canvas, stylesheet, icons, manifest),
|
|
35
|
+
* which serve makes from the files Deno then keeps, so a first `yak serve`
|
|
36
|
+
* answers with them offline too.
|
|
37
|
+
*
|
|
38
|
+
* ```ts
|
|
39
|
+
* import { assertEquals } from '@std/assert'
|
|
40
|
+
* assertEquals(loads('<link href="/web/s.css" /><a href="https://x"><script src="/web/app.js">'), ['/web/s.css', '/web/app.js'])
|
|
41
|
+
* ```
|
|
42
|
+
*/ export declare let loads: (page: string) => string[];
|
|
43
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sources":["../install.ts"],"names":[],"mappings":"AAsBA;;;;;;CAMC,GACD,OAAO,YAAI,UAAW,SAAS,MAAM,EAAE,QAAQ,MAAM,KAAG,MAAM,GAe7D;AAED;;;;;;;CAOC,GACD,OAAO,YAAI,MACT,SAAS,MAAM,EACf,QAAQ,MAAM,EACd,MAAM,MAAM,OACX,MAAM,GAOR;AAED;;;;eAIe,GACf,OAAO,YAAI,UAAW,KAAK,MAAM,KAAG,MAAM,KAGzC;AAED;;;;;;;;;;;CAWC,GACD,OAAO,YAAI,UAAW,KAAK,MAAM,EAAE,MAAM,MAAM,KAAG,MAAM,GAQvD;AAED;;;;;;;;;CASC,GACD,OAAO,YAAI,QAAS,MAAM,MAAM,KAAG,MAAM,GACgC"}
|
package/_dist/main.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Command, type Opts } from "./run.js";
|
|
2
|
+
/** The platform this command talks to when it opens no graph of its own. */ export declare let HOST: string;
|
|
3
|
+
/** What `yak` itself is, besides the tools it lists. */ export declare let YAK: Opts;
|
|
4
|
+
/** The command's built-in subcommands, which shadow a tool of the same name
|
|
5
|
+
* from either list. */ export declare let own: Command[];
|
|
6
|
+
/** What a plain install carries, in precedence order. The apps' commands come
|
|
7
|
+
* after this command's built-ins and before the graph's tools, because one of
|
|
8
|
+
* those tools is `command` itself: the graph's version takes the app's
|
|
9
|
+
* arguments as a JSON object, and the one here takes them the way a person
|
|
10
|
+
* types them. */ export declare let TOOLS: Command[];
|
|
11
|
+
/** One command line, from argv to an exit code, printing any refusal on the
|
|
12
|
+
* way. A program with subcommands of its own passes them in, and they shadow
|
|
13
|
+
* everything here. Whatever graph the command opened is closed when it is
|
|
14
|
+
* done, and the exit code it returns is what its `process` row records as its
|
|
15
|
+
* ending. */ export declare let main: (argv: string[], extra?: readonly Command[]) => Promise<number>;
|
|
16
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sources":["../main.ts"],"names":[],"mappings":"AA2CA,SAAc,KAAK,OAAO,EAAsB,KAAK,IAAI,mBAAkB;AAc3E,0EAA0E,GAC1E,OAAO,YAAI,aAAiB;AA0F5B,sDAAsD,GACtD,OAAO,YAAI,KAAK,KAqBf;AAyHD;qBACqB,GACrB,OAAO,YAAI,KAAK,UAyNf;AAED;;;;eAIe,GACf,OAAO,YAAI,OAAO,UAAiC;AAEnD;;;;WAIW,GACX,OAAO,YAAI,OACT,MAAM,MAAM,IACZ,iBAAgB,cACf,QAAQ,MAAM,EAmBhB"}
|
package/_dist/memo.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as disk from "@yaks/file/io";
|
|
2
|
+
/** A source module, or an optional facet of a configured package. */ export type MemoRoot = string | readonly [plugin: string, facet: string];
|
|
3
|
+
export type MemoFiles = {
|
|
4
|
+
readTextFileSync: (path: string) => string;
|
|
5
|
+
statSync: (path: string) => Pick<disk.FileInfo, 'size' | 'mtime' | 'ctime' | 'ino'>;
|
|
6
|
+
mkdirSync: (path: string, options: disk.MkdirOptions) => void;
|
|
7
|
+
writeTextFileSync: (path: string, text: string, options: disk.WriteFileOptions) => void;
|
|
8
|
+
renameSync: (from: string, to: string) => void;
|
|
9
|
+
removeSync: (path: string) => void;
|
|
10
|
+
readDirSync: (path: string) => Iterable<{
|
|
11
|
+
name: string;
|
|
12
|
+
}>;
|
|
13
|
+
utimeSync: (path: string, atime: Date, mtime: Date) => void;
|
|
14
|
+
};
|
|
15
|
+
export type MemoOptions = {
|
|
16
|
+
dir?: string;
|
|
17
|
+
files?: MemoFiles;
|
|
18
|
+
resolve?: (specifier: string) => string;
|
|
19
|
+
/** Function-valued fields excluded from each facet's derived data. */ callbacks?: {
|
|
20
|
+
[facet: string]: readonly string[];
|
|
21
|
+
};
|
|
22
|
+
/** Literal source dependencies; injected at the filesystem boundary in tests. */ imports?: (source: string, name?: string) => Promise<string[]>;
|
|
23
|
+
/** The digest boundary is synchronous in memory tests. */ digest?: (text: string) => string | Promise<string>;
|
|
24
|
+
/** A directory whose files cannot change while this process runs, and the
|
|
25
|
+
* id naming its contents (./runtime.ts `runtimeTree`): a memo kept under
|
|
26
|
+
* the same id proves every file inside it without asking for its stat. */ tree?: {
|
|
27
|
+
root: string;
|
|
28
|
+
id: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
/** The memos a miss sweeps: those nothing has read for a day. A hit moves its
|
|
32
|
+
* memo's time at most hourly, so a memo in use never ages out.
|
|
33
|
+
*
|
|
34
|
+
* ```ts
|
|
35
|
+
* import { assertEquals } from '@std/assert'
|
|
36
|
+
* let now = Date.parse('2026-10-12T12:00:00Z')
|
|
37
|
+
* assertEquals(
|
|
38
|
+
* idle([
|
|
39
|
+
* { name: 'gone.json', at: now - 2 * 86_400_000 },
|
|
40
|
+
* { name: 'used.json', at: now - 3_600_000 },
|
|
41
|
+
* ], now),
|
|
42
|
+
* ['gone.json'],
|
|
43
|
+
* )
|
|
44
|
+
* ```
|
|
45
|
+
*/ export declare let idle: (entries: readonly {
|
|
46
|
+
name: string;
|
|
47
|
+
at: number;
|
|
48
|
+
}[], now: number) => string[];
|
|
49
|
+
import type { ImportSpecifier } from "es-module-lexer/js";
|
|
50
|
+
export declare let sourceImports: (source: string, parsed: readonly ImportSpecifier[]) => string[];
|
|
51
|
+
/** Reuse JSON data while the configuration and every literal source dependency
|
|
52
|
+
* are unchanged. Static imports and literal dynamic imports are tracked; a
|
|
53
|
+
* caller supplies roots for modules chosen by runtime callbacks. Callbacks
|
|
54
|
+
* projected out of the data keep their imports for invocation. A source agrees
|
|
55
|
+
* while its stat has not moved, or, once it has, while its contents (or its
|
|
56
|
+
* absence) still do. Only the digest of `inputs` is kept; callers project away
|
|
57
|
+
* closures and host capabilities before returning their data. */ export declare let remember: <T>(inputs: unknown, roots: readonly MemoRoot[], make: () => T | Promise<T>, opts?: MemoOptions & {
|
|
58
|
+
valid?: (value: T) => boolean | Promise<boolean>;
|
|
59
|
+
}) => Promise<T>;
|
|
60
|
+
//# sourceMappingURL=memo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memo.d.ts","sources":["../memo.ts"],"names":[],"mappings":"AACA,YAAY,+BAAoC;AAahD,mEAAmE,GACnE,YAAY,WAAW,MAAM,aAAa,QAAQ,MAAM,EAAE,OAAO,MAAM;AAEvE,YAAY;EACV,mBAAmB,MAAM,MAAM,KAAK,MAAM;EAC1C,WACE,MAAM,MAAM,KACT,KAAK,KAAK,UAAU,SAAS,UAAU,UAAU;EACtD,YAAY,MAAM,MAAM,EAAE,SAAS,KAAK,iBAAiB,IAAI;EAC7D,oBACE,MAAM,MAAM,EACZ,MAAM,MAAM,EACZ,SAAS,KAAK,qBACX,IAAI;EACT,aAAa,MAAM,MAAM,EAAE,IAAI,MAAM,KAAK,IAAI;EAC9C,aAAa,MAAM,MAAM,KAAK,IAAI;EAClC,cAAc,MAAM,MAAM,KAAK;IAAW,MAAM,MAAM;;EACtD,YAAY,MAAM,MAAM,EAAE,OAAO,MAAM,OAAO,SAAS,IAAI;;AAG7D,YAAY;EACV,MAAM,MAAM;EACZ,QAAQ;EACR,WAAW,WAAW,MAAM,KAAK,MAAM;EACvC,oEAAoE,GACpE;KAAe,OAAO,MAAM,YAAY,MAAM;;EAC9C,+EAA+E,GAC/E,WAAW,QAAQ,MAAM,EAAE,OAAO,MAAM,KAAK,QAAQ,MAAM;EAC3D,wDAAwD,GACxD,UAAU,MAAM,MAAM,KAAK,MAAM,GAAG,QAAQ,MAAM;EAClD;;0EAEwE,GACxE;IAAS,MAAM,MAAM;IAAE,IAAI,MAAM;;;AAqDnC;;;;;;;;;;;;;;CAcC,GACD,OAAO,YAAI,OACT;EAAoB,MAAM,MAAM;EAAE,IAAI,MAAM;KAC5C,KAAK,MAAM,KACV,MAAM,GAAgE;AAGzE,cAAc,eAAe,6BAAsC;AAEnE,OAAO,YAAI,gBACT,QAAQ,MAAM,EACd,iBAAiB,sBAChB,MAAM,GAYY;AA6BrB;;;;;;+DAM+D,GAC/D,OAAO,YAAI,WAAkB,GAC3B,QAAQ,OAAO,EACf,gBAAgB,YAChB,YAAY,IAAI,QAAQ,IACxB,OAAM;EAAgB,SAAS,OAAO,MAAM,OAAO,GAAG,QAAQ,OAAO;MACpE,QAAQ,GAscV"}
|
package/_dist/mod.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `yak` command line, as a library.
|
|
3
|
+
*
|
|
4
|
+
* The command itself is the other export — `./yak`, which `./install` puts on
|
|
5
|
+
* PATH — and this module is what it is assembled from, for anybody building
|
|
6
|
+
* the same thing: the tools of the graph a config file names, or the ones an
|
|
7
|
+
* MCP server lists, read at run time, every tool a subcommand, and the command
|
|
8
|
+
* line parsed through each tool's own input schema.
|
|
9
|
+
*
|
|
10
|
+
* ```ts ignore
|
|
11
|
+
* import { argsFor, doorUrl, rpc } from '@yaks/cli'
|
|
12
|
+
*
|
|
13
|
+
* let ask = rpc({ url: doorUrl('yaks.app'), token: '…' })
|
|
14
|
+
* let { tools } = await ask('tools/list') as { tools: [] }
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* A program with subcommands of its own passes them in and runs the same
|
|
18
|
+
* program: `exit(await main(args, commands))`, with `args` and `exit` from
|
|
19
|
+
* `@yaks/process/system` and `main` from
|
|
20
|
+
* `@yaks/cli/main`.
|
|
21
|
+
*
|
|
22
|
+
* A program that is not `yak` at all calls `cli(commands, opts)` — its
|
|
23
|
+
* subcommands, and the name it goes by. One whose commands run tools on a
|
|
24
|
+
* graph it opened itself draws each answer the way `yak` does: `registry` of
|
|
25
|
+
* the plugins' views, and `show`.
|
|
26
|
+
*
|
|
27
|
+
* @module
|
|
28
|
+
*/ export { appGrammar, argsFor, type Grammar, inflate, type Reads, type Said, saidIn, Usage, valueOf } from "./args.js";
|
|
29
|
+
export { bundlesIn, CHUNK, chunks } from "./apply.js";
|
|
30
|
+
export { registry, type Source, type Views } from "./answer.js";
|
|
31
|
+
export { show } from "./tty.js";
|
|
32
|
+
export { complete, type Lookup } from "./complete.js";
|
|
33
|
+
export { type Door, doorUrl, initialize, PROTOCOL, Refused, type Rpc, rpc, Unauthorized } from "./rpc.js";
|
|
34
|
+
export { type Result, rosterAfter, saidBy, STALE, versionIn } from "./roster.js";
|
|
35
|
+
export { lineOf, safe, sketch, toolHelp, toolLines, wrap } from "./show.js";
|
|
36
|
+
export { cached, configDir, forget, remember, type Roster, stateDir, tokenFor } from "./store.js";
|
|
37
|
+
export { commandOf, type Listed, type Prop, type Schema, titleOf, typeOf } from "./tool.js";
|
|
38
|
+
export { aimed, cli, type Command, commandFor, type Ctx, globals, helpTool, type Opts, unique, usage } from "./run.js";
|
|
39
|
+
export { type Config, configPath, read } from "./config.js";
|
|
40
|
+
export { runtimeSource } from "./runtime.js";
|
|
41
|
+
export { fileVault, vaultOf } from "./vault.js";
|
|
42
|
+
export { listed, printed, rosterOf } from "./platform.js";
|
|
43
|
+
export { appStray, appTools, toolCall } from "./commands.js";
|
|
44
|
+
export { readJson } from "./remote.js";
|
|
45
|
+
export { accountHost, type AccountOptions, closeAccounts, personal, personalPath } from "./accounts.js";
|
|
46
|
+
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sources":["../mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BC,GAED,SACE,UAAU,EACV,OAAO,EACP,KAAK,OAAO,EACZ,OAAO,EACP,KAAK,KAAK,EACV,KAAK,IAAI,EACT,MAAM,EACN,KAAK,EACL,OAAO,oBACS;AAClB,SAAS,SAAS,EAAE,KAAK,EAAE,MAAM,qBAAoB;AACrD,SAAS,QAAQ,EAAE,KAAK,MAAM,EAAE,KAAK,KAAK,sBAAqB;AAC/D,SAAS,IAAI,mBAAkB;AAC/B,SAAS,QAAQ,EAAE,KAAK,MAAM,wBAAuB;AACrD,SACE,KAAK,IAAI,EACT,OAAO,EACP,UAAU,EACV,QAAQ,EACR,OAAO,EACP,KAAK,GAAG,EACR,GAAG,EACH,YAAY,mBACG;AACjB,SAAS,KAAK,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,sBAAqB;AAChF,SAAS,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,oBAAmB;AAC3E,SACE,MAAM,EACN,SAAS,EACT,MAAM,EACN,QAAQ,EACR,KAAK,MAAM,EACX,QAAQ,EACR,QAAQ,qBACS;AACnB,SACE,SAAS,EACT,KAAK,MAAM,EACX,KAAK,IAAI,EACT,KAAK,MAAM,EACX,OAAO,EACP,MAAM,oBACU;AAClB,SACE,KAAK,EACL,GAAG,EACH,KAAK,OAAO,EACZ,UAAU,EACV,KAAK,GAAG,EACR,OAAO,EACP,QAAQ,EACR,KAAK,IAAI,EACT,MAAM,EACN,KAAK,mBACU;AACjB,SAAS,KAAK,MAAM,EAAE,UAAU,EAAE,IAAI,sBAAqB;AAC3D,SAAS,aAAa,uBAAsB;AAC5C,SAAS,SAAS,EAAE,OAAO,qBAAoB;AAC/C,SAAS,MAAM,EAAE,OAAO,EAAE,QAAQ,wBAAuB;AACzD,SAAS,QAAQ,EAAE,QAAQ,EAAE,QAAQ,wBAAuB;AAC5D,SAAS,QAAQ,sBAAqB;AAEtC,SACE,WAAW,EACX,KAAK,cAAc,EACnB,aAAa,EACb,QAAQ,EACR,YAAY,wBACQ"}
|
package/_dist/page.d.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/** A body a page loads. */ export type Body = string | Uint8Array<ArrayBuffer>;
|
|
2
|
+
/** How long a body may take to make before it is given up on. A bundle from a
|
|
3
|
+
* checkout takes a few seconds, one from JSR far longer (./remote-page.ts),
|
|
4
|
+
* which is why a release makes a fresh install's ahead; a hung one never
|
|
5
|
+
* finishes (T-38240). */ export declare let LIMIT: number;
|
|
6
|
+
/** Where a release keeps the bodies it made ahead. */ export declare let MADE: URL;
|
|
7
|
+
/** The body made ahead for `key`, or undefined where none was. */ export declare let ahead: (key: string, at?: URL) => Promise<string | undefined>;
|
|
8
|
+
/** Keep `body` in `dir` (a release's `./made/`) where `ahead(key)` finds it. */ export declare let keep: (dir: URL, key: string, body: string) => Promise<void>;
|
|
9
|
+
/** `make(signal)`, given up on (and `signal` aborted) after `limit` ms, or
|
|
10
|
+
* once `closing` aborts. */ export declare let within: <T>(limit: number, make: (signal: AbortSignal) => Promise<T>, closing?: AbortSignal) => Promise<T>;
|
|
11
|
+
/** The handler that answers `where` with the body `make` makes. `early` is
|
|
12
|
+
* handed its making, to start ahead of the first request (@yaks/host
|
|
13
|
+
* `Host.early`), which then finds it made; `closing` is the host's own signal,
|
|
14
|
+
* which ends a make still going. Its `tag()` is the etag of the body made,
|
|
15
|
+
* undefined until one is. */ export declare let kept: (where: string, type: string, make: (signal: AbortSignal) => Promise<Body>, _dts_1: never) => Kept;
|
|
16
|
+
/** What {@link kept} answers with: the handler, and the tag of what it made. */ export type Kept = ((request: Request) => Promise<Response>) & {
|
|
17
|
+
tag: () => string | undefined;
|
|
18
|
+
};
|
|
19
|
+
/** An entry written where it is bundled rather than read from a file: its
|
|
20
|
+
* `code`, whose imports resolve as they would in a module at `at`. */ export type Written = {
|
|
21
|
+
code: string;
|
|
22
|
+
at: URL;
|
|
23
|
+
};
|
|
24
|
+
/** What a build made: its output, and what it read where it says. */ export type Built = {
|
|
25
|
+
outputFiles?: {
|
|
26
|
+
path: string;
|
|
27
|
+
text: string;
|
|
28
|
+
}[];
|
|
29
|
+
metafile?: {
|
|
30
|
+
inputs: {
|
|
31
|
+
[path: string]: unknown;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
/** The operations one build owns, independent of its compiler's service. */ export type Build = {
|
|
36
|
+
rebuild: () => Promise<Built>;
|
|
37
|
+
cancel: () => Promise<void>;
|
|
38
|
+
dispose: () => Promise<void>;
|
|
39
|
+
};
|
|
40
|
+
/** Finish or cancel one build, always releasing its context: what it
|
|
41
|
+
* made. */ export declare let finished: (build: Build, signal?: AbortSignal) => Promise<Built>;
|
|
42
|
+
/** Finish or cancel one build of one module, always releasing its context:
|
|
43
|
+
* the module it made. */ export declare let compiled: (build: Build, signal?: AbortSignal, done?: (built: Built) => void) => Promise<string>;
|
|
44
|
+
/** How one browser module is bundled: the bare specifiers it leaves to the
|
|
45
|
+
* page to resolve (its import map), so every module on the page that imports
|
|
46
|
+
* one shares the one copy the page loads. */ export type Bundling = {
|
|
47
|
+
external?: string[];
|
|
48
|
+
alias?: Record<string, string>;
|
|
49
|
+
format?: 'esm' | 'cjs';
|
|
50
|
+
};
|
|
51
|
+
/** Import maps name exact specifiers. An external root does not cover its subpaths. */ export declare let pageExternals: (specifiers?: string[]) => import("esbuild").Plugin;
|
|
52
|
+
/** One browser module: from a checkout, resolved through the npm workspace
|
|
53
|
+
* (./local-page.ts); from JSR, through Deno's resolver (./remote-page.ts).
|
|
54
|
+
* Every build owns its cancellation and cleanup, so concurrent builds stay
|
|
55
|
+
* independent. */ export declare let bundle: (entry: URL | Written, signal?: AbortSignal, opts?: Bundling) => Promise<string>;
|
|
56
|
+
/** Browser modules bundled together, from a checkout: each entry's module by
|
|
57
|
+
* its name, and the modules two or more of them import once, in chunks named
|
|
58
|
+
* by their bytes (`chunks`, by path), which every entry imports from the
|
|
59
|
+
* site's `/${CHUNKS}/`. A page loading several of them runs each shared
|
|
60
|
+
* module once, and a browser keeps the chunks for good. */ export declare let split: (entries: Record<string, URL>, signal?: AbortSignal, opts?: Bundling) => Promise<{
|
|
61
|
+
entries: Record<string, string>;
|
|
62
|
+
chunks: Record<string, string>;
|
|
63
|
+
}>;
|
|
64
|
+
/** Where split bundles keep their shared chunks, below the site's root. */ export declare let CHUNKS: string;
|
|
65
|
+
export declare let CHUNK: string;
|
|
66
|
+
/** The chunks a split module imports, by path from the site's root.
|
|
67
|
+
*
|
|
68
|
+
* ```ts
|
|
69
|
+
* import { assertEquals } from '@std/assert'
|
|
70
|
+
* assertEquals(imports('import{a}from"/_yak/chunk.A.js";import"/_yak/chunk.B.js"'), ['_yak/chunk.A.js', '_yak/chunk.B.js'])
|
|
71
|
+
* ```
|
|
72
|
+
*/ export declare let imports: (code: string) => string[];
|
|
73
|
+
//# sourceMappingURL=page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.d.ts","sources":["../page.ts"],"names":[],"mappings":"AA6BA,yBAAyB,GACzB,YAAY,OAAO,MAAM,GAAG,WAAW;AAEvC;;;uBAGuB,GACvB,OAAO,YAAI,cAAc;AAazB,oDAAoD,GACpD,OAAO,YAAI,MAAM,IAAyC;AAI1D,gEAAgE,GAChE,OAAO,YAAI,QACT,KAAK,MAAM,EACX,KAAI,QACH,QAAQ,MAAM,GAAG,SAAS,EAU5B;AAED,8EAA8E,GAC9E,OAAO,YAAI,OACT,KAAK,KACL,KAAK,MAAM,EACX,MAAM,MAAM,KACX,QAAQ,IAAI,EAGd;AAWD;0BAC0B,GAC1B,OAAO,YAAI,SAAU,GACnB,OAAO,MAAM,EACb,OAAO,QAAQ,gBAAgB,QAAQ,IACvC,UAAU,gBACT,QAAQ,GAwBP;AAEJ;;;;2BAI2B,GAC3B,OAAO,YAAI,OACT,OAAO,MAAM,EACb,MAAM,MAAM,EACZ,OAAO,QAAQ,gBAAgB,QAAQ,OACvC,kBAKC,KAyBF;AAED,8EAA8E,GAC9E,YAAY,SAAS,SAAS,YAAY,QAAQ;EAChD,WAAW,MAAM,GAAG,SAAS;;AAG/B;oEACoE,GACpE,YAAY;EAAY,MAAM,MAAM;EAAE,IAAI;;AAE1C,mEAAmE,GACnE,YAAY;EACV;IAAgB,MAAM,MAAM;IAAE,MAAM,MAAM;;EAC1C;IAAa;OAAW,MAAM,MAAM,GAAG,OAAO;;;;AAGhD,0EAA0E,GAC1E,YAAY;EACV,eAAe,QAAQ;EACvB,cAAc,QAAQ,IAAI;EAC1B,eAAe,QAAQ,IAAI;;AAG7B;SACS,GACT,OAAO,YAAI,WACT,OAAO,OACP,SAAS,gBACR,QAAQ,OAcV;AAED;uBACuB,GACvB,OAAO,YAAI,WACT,OAAO,OACP,SAAS,aACT,QAAO,OAAO,UAAU,IAAI,KAC3B,QAAQ,MAAM,EAIhB;AAED;;2CAE2C,GAC3C,YAAY;EACV,WAAW,MAAM;EACjB,QAAQ,OAAO,MAAM,EAAE,MAAM;EAC7B,SAAS,QAAQ;;AAGnB,qFAAqF,GACrF,OAAO,YAAI,gBACT,aAAY,MAAM,yBACY,OAiB/B;AAWD;;;gBAGgB,GAChB,OAAO,YAAI,SACT,OAAO,MAAM,SACb,SAAS,aACT,OAAM,aACL,QAAQ,MAAM,EAMhB;AAED;;;;yDAIyD,GACzD,OAAO,YAAI,QACT,SAAS,OAAO,MAAM,EAAE,MACxB,SAAS,aACT,OAAM,aACL;EACC,SAAS,OAAO,MAAM,EAAE,MAAM;EAAG,QAAQ,OAAO,MAAM,EAAE,MAAM;GAQjE;AAED,yEAAyE,GACzE,OAAO,YAAI,eAAe;AAC1B,OAAO,YAAI,cAAyB;AAEpC;;;;;;CAMC,GACD,OAAO,YAAI,UAAW,MAAM,MAAM,KAAG,MAAM,GAGb"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { VocabDoc } from "@yaks/vocab";
|
|
2
|
+
import type { Command, Ctx } from "./run.js";
|
|
3
|
+
import type { Drawn } from "./answer.js";
|
|
4
|
+
import { type Rpc } from "./rpc.js";
|
|
5
|
+
import { type Result } from "./roster.js";
|
|
6
|
+
import { type Roster } from "./store.js";
|
|
7
|
+
/** The tool list for a host: the cached one, or an `initialize` handshake
|
|
8
|
+
* followed by `tools/list` — always the latter when `fresh`. The protocol
|
|
9
|
+
* version is negotiated on that same path and cached beside the list, and so
|
|
10
|
+
* is the roster `version` an `about` answered just before it (roster.ts). */ export declare let rosterOf: (host: string, ask: Rpc, state?: string, fresh?: boolean, version?: string) => Promise<Roster>;
|
|
11
|
+
type Drawing = {
|
|
12
|
+
doc: VocabDoc;
|
|
13
|
+
ready: Promise<Awaited<ReturnType<typeof import("./reported.js").reported>>>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Show a tool's result, and the roster notice the server added beside it
|
|
17
|
+
* (roster.ts). Returns the exit code. A caller holding no tool list passes
|
|
18
|
+
* `null` — a staleness notice still drops the cache. `tool` is what the server
|
|
19
|
+
* listed about the tool that decides how its answer is drawn (./answer.ts
|
|
20
|
+
* `Drawn`).
|
|
21
|
+
*/ export declare let printed: (c: Ctx, roster: Roster | null, name: string, said: Result, args?: Record<string, unknown>, tool?: Drawn, drawing?: Drawing) => Promise<number>;
|
|
22
|
+
/** Every tool this server lists, as a subcommand. This is the list that costs
|
|
23
|
+
* a round trip (run.ts `more`), so a command that never needs it pays
|
|
24
|
+
* nothing, and `fresh` asks the server past the cache. */ export declare let listed: (c: Ctx, o?: {
|
|
25
|
+
fresh?: boolean;
|
|
26
|
+
}) => Promise<Command[]>;
|
|
27
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sources":["../platform.ts"],"names":[],"mappings":"AAoBA,cAAc,QAAQ,2BAAgC;AACtD,cAAc,OAAO,EAAE,GAAG,mBAAkB;AAC5C,cAAc,KAAK,sBAAqB;AACxC,SAAqB,KAAK,GAAG,mBAAkB;AAE/C,SAAS,KAAK,MAAM,sBAAqD;AACzE,SAAmC,KAAK,MAAM,qBAAoB;AAGlE;;;2EAG2E,GAC3E,OAAO,YAAI,WACT,MAAM,MAAM,EACZ,KAAK,KACL,QAAQ,MAAM,EACd,iBACA,UAAU,MAAM,KACf,QAAQ,QAYV;KA0BI;EACH,KAAK;EACL,OAAO,QAAQ,QAAQ,0CAA0C;;AA0BnE;;;;;;CAMC,GACD,OAAO,YAAI,UACT,GAAG,KACH,QAAQ,SAAS,IAAI,EACrB,MAAM,MAAM,EACZ,MAAM,QACN,OAAM,OAAO,MAAM,EAAE,OAAO,GAC5B,OAAM,OACN,UAAU,YACT,QAAQ,MAAM,EAyDhB;AAqCD;;wDAEwD,GACxD,OAAO,YAAI,SACT,GAAG,KACH;EAAK,QAAQ,OAAO;MACnB,QAAQ,WAGV"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Graph } from "@yaks/graph";
|
|
2
|
+
import { type Config } from "./config.js";
|
|
3
|
+
export type Reader = {
|
|
4
|
+
graph: Pick<Graph, 'read' | 'get' | 'address'>;
|
|
5
|
+
close: () => void;
|
|
6
|
+
};
|
|
7
|
+
/** Read the stored components declared by `plugins` in an installed graph.
|
|
8
|
+
* The caller chooses its vocabulary; no plugin's executable graph facet runs.
|
|
9
|
+
* The reader cannot apply a write and the file itself is opened read-only. */ export declare let reader: (config: Config, plugins: string[]) => Promise<Reader>;
|
|
10
|
+
//# sourceMappingURL=reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reader.d.ts","sources":["../reader.ts"],"names":[],"mappings":"AAGA,cAAc,KAAK,2BAAgC;AAOnD,SAAS,KAAK,MAAM,sBAAoC;AAKxD,YAAY;EACV,OAAO,KAAK,OAAO,SAAS,QAAQ;EACpC,aAAa,IAAI;;AAGnB;;4EAE4E,GAC5E,OAAO,YAAI,SACT,QAAQ,QACR,SAAS,MAAM,OACd,QAAQ,QA8BV"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** The part of a Deno config that says which versions it will resolve. */ export type Resolving = {
|
|
2
|
+
minimumDependencyAge: {
|
|
3
|
+
age: string;
|
|
4
|
+
exclude: string[];
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
/** A Deno config keeping the default minimum dependency age for everything but
|
|
8
|
+
* the JSR packages named.
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { assertEquals } from '@std/assert'
|
|
12
|
+
* assertEquals(exempt(['@yaks/cli', '@yaks/doc']), {
|
|
13
|
+
* minimumDependencyAge: {
|
|
14
|
+
* age: 'P1D',
|
|
15
|
+
* exclude: ['jsr:@yaks/cli', 'jsr:@yaks/doc'],
|
|
16
|
+
* },
|
|
17
|
+
* })
|
|
18
|
+
* ```
|
|
19
|
+
*/ export declare let exempt: (names: string[]) => Resolving;
|
|
20
|
+
/** The version of each @yaks package this release is made of. */ export declare let pinned: Readonly<Record<string, string>>;
|
|
21
|
+
/** The subpaths each package of this release exports (`.`, `./vocab`, …),
|
|
22
|
+
* which bin/publish.ts writes into ./exports.json as it publishes: a module
|
|
23
|
+
* from JSR resolves any subpath of a package and finds one missing only by
|
|
24
|
+
* loading it. A checkout's is empty, since its import map knows. */ export declare let shipped: Readonly<Record<string, readonly string[]>>;
|
|
25
|
+
/** The unstable features a release runs with: this repository's deno.json's.
|
|
26
|
+
* `lazy-dynamic-imports` is the one a person waits on: without it Deno loads
|
|
27
|
+
* every module a literal `import()` reaches before the program starts
|
|
28
|
+
* (./yak.ts `local`), and a `yak serve` from JSR listens 0.4 s later.
|
|
29
|
+
* `raw-imports` reads the files a package ships from Deno's module cache
|
|
30
|
+
* instead of jsr.io (@yaks/api/asset). */ export declare let UNSTABLE: readonly [string, string, string, string];
|
|
31
|
+
/** The config a resolver of this release runs under. */ export declare let released: Resolving & {
|
|
32
|
+
unstable: string[];
|
|
33
|
+
};
|
|
34
|
+
/** The Deno config a `deno` process this CLI starts runs under: a checkout's
|
|
35
|
+
* own deno.json, or, for a CLI served from JSR, `released` written into the
|
|
36
|
+
* directory `dir` makes, so the child resolves the same release its parent
|
|
37
|
+
* did.
|
|
38
|
+
*
|
|
39
|
+
* ```ts
|
|
40
|
+
* import { assertEquals } from '@std/assert'
|
|
41
|
+
* import * as disk from '@yaks/file/io'
|
|
42
|
+
* let dir = () => disk.makeTempDir()
|
|
43
|
+
* assertEquals(await launching(dir, 'file:///repo/packages/cli/release.ts'), '/repo/deno.json')
|
|
44
|
+
* let config = await launching(dir, 'https://jsr.io/@yaks/cli/1.2.3/release.ts')
|
|
45
|
+
* assertEquals(JSON.parse(await disk.readTextFile(config)), released)
|
|
46
|
+
* ```
|
|
47
|
+
*/ export declare let launching: (dir: () => Promise<string>, source?: string) => Promise<string>;
|
|
48
|
+
//# sourceMappingURL=release.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release.d.ts","sources":["../release.ts"],"names":[],"mappings":"AAmBA,wEAAwE,GACxE,YAAY;EACV;IAAwB,KAAK,MAAM;IAAE,SAAS,MAAM;;;AAGtD;;;;;;;;;;;;CAYC,GACD,OAAO,YAAI,SAAU,OAAO,MAAM,OAAK,UAKrC;AAEF,+DAA+D,GAC/D,OAAO,YAAI,QAAQ,SAAS,OAAO,MAAM,EAAE,MAAM,GAAO;AAExD;;;kEAGkE,GAClE,OAAO,YAAI,SAAS,SAAS,OAAO,MAAM,WAAW,MAAM,KAAe;AAE1E;;;;;wCAKwC,GACxC,OAAO,YAAI,oDAKV;AAED,sDAAsD,GACtD,OAAO,YAAI,UAAU;EAAc,UAAU,MAAM;EAGlD;AAED;;;;;;;;;;;;;CAaC,GACD,OAAO,YAAI,YACT,WAAW,QAAQ,MAAM,GACzB,SAAQ,MAAM,KACb,QAAQ,MAAM,EAQhB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AccountOptions } from "./accounts.js";
|
|
2
|
+
type Selection = {
|
|
3
|
+
as?: string;
|
|
4
|
+
via?: string;
|
|
5
|
+
host?: string;
|
|
6
|
+
state?: string;
|
|
7
|
+
config?: string;
|
|
8
|
+
env?: AccountOptions['env'];
|
|
9
|
+
fetch?: typeof globalThis.fetch;
|
|
10
|
+
credential?: (host: string, as?: string, agent?: boolean) => Promise<string | null>;
|
|
11
|
+
};
|
|
12
|
+
/** Authenticated JSON delivery shared by HTTP commands and graph tools. */ export declare let readJson: (url: string | URL, options?: Selection) => Promise<unknown>;
|
|
13
|
+
//# sourceMappingURL=remote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote.d.ts","sources":["../remote.ts"],"names":[],"mappings":"AAYA,cAAc,cAAc,wBAAuB;KAG9C;EACH,KAAK,MAAM;EACX,MAAM,MAAM;EACZ,OAAO,MAAM;EACb,QAAQ,MAAM;EACd,SAAS,MAAM;EACf,MAAM,eAAe;EACrB,eAAe,WAAW;EAC1B,cACE,MAAM,MAAM,EACZ,KAAK,MAAM,EACX,QAAQ,OAAO,KACZ,QAAQ,MAAM,GAAG,IAAI;;AAG5B,yEAAyE,GACzE,OAAO,YAAI,WACT,KAAK,MAAM,GAAG,KACd,UAAS,cACR,QAAQ,OAAO,EAwCjB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Vocab, type VocabDoc } from "@yaks/vocab/runtime";
|
|
2
|
+
import type { Registry } from "@yaks/render";
|
|
3
|
+
import { type Held } from "./answer.js";
|
|
4
|
+
/** A vocabulary a server reported (`graph_schema`), read the way a host reads
|
|
5
|
+
* its own — with the keywords every host understands — and the views of the
|
|
6
|
+
* packages it says declared its components, where this machine has them. */ export declare let reported: (doc: VocabDoc) => Promise<{
|
|
7
|
+
views: Registry;
|
|
8
|
+
vocab: Vocab;
|
|
9
|
+
components: () => Promise<Held>;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=reported.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reported.d.ts","sources":["../reported.ts"],"names":[],"mappings":"AAEA,SAAoB,KAAK,KAAK,EAAE,KAAK,QAAQ,mCAAwC;AAErF,cAAc,QAAQ,4BAAiC;AACvD,SAAS,KAAK,IAAI,sBAA2D;AAQ7E;;0EAE0E,GAC1E,OAAO,YAAI,WACT,KAAK,aACJ;EACC,OAAO;EAAU,OAAO;EAAO,kBAAkB,QAAQ;GAkB5D"}
|
package/_dist/roles.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roles.d.ts","sources":["../roles.ts"],"names":[],"mappings":"AAMA,SAAS,KAAK,gCAAqC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Roster } from "./store.js";
|
|
2
|
+
/** A tool result, as much of it as this client reads. */ export type Result = {
|
|
3
|
+
content?: {
|
|
4
|
+
type: string;
|
|
5
|
+
text?: string;
|
|
6
|
+
}[];
|
|
7
|
+
structuredContent?: unknown;
|
|
8
|
+
isError?: boolean;
|
|
9
|
+
};
|
|
10
|
+
/** How @yaks/mcp's roster notice begins, which is how it is recognized. */ export declare let STALE: string;
|
|
11
|
+
/** The tool's own output, and the roster notice the server added beside
|
|
12
|
+
* it. */ export declare let saidBy: (out: Result) => {
|
|
13
|
+
text: string;
|
|
14
|
+
stale?: string;
|
|
15
|
+
};
|
|
16
|
+
/** The roster version an `about` result names (workers/yak `tools.ts`), off
|
|
17
|
+
* the answer as data: its words are for a person. */ export declare let versionIn: (out: Result) => string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* The roster to keep after a result: the same one, or `null` — drop the cache
|
|
20
|
+
* and call `tools/list` again. Only an `about` naming the version the list is
|
|
21
|
+
* stamped with confirms it. A list nobody stamped may come from any release,
|
|
22
|
+
* however long ago it was listed, so `about` drops it too; the caller lists
|
|
23
|
+
* again at once and stamps that list with the version `about` named
|
|
24
|
+
* (platform.ts `printed`).
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* let about = {
|
|
28
|
+
* structuredContent: {
|
|
29
|
+
* result: [{
|
|
30
|
+
* entity: { eid: '$said' },
|
|
31
|
+
* output: { value: { roster: { version: '1a2b3c4d' } } },
|
|
32
|
+
* }],
|
|
33
|
+
* },
|
|
34
|
+
* }
|
|
35
|
+
* rosterAfter({ tools: [], version: '1a2b3c4d' }, 'about', about)
|
|
36
|
+
* // { tools: [], version: '1a2b3c4d' }
|
|
37
|
+
* rosterAfter({ tools: [] }, 'about', about)
|
|
38
|
+
* // null
|
|
39
|
+
* ```
|
|
40
|
+
*/ export declare let rosterAfter: (roster: Roster, name: string, out: Result) => Roster | null;
|
|
41
|
+
//# sourceMappingURL=roster.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roster.d.ts","sources":["../roster.ts"],"names":[],"mappings":"AAmBA,cAAc,MAAM,qBAAoB;AAExC,uDAAuD,GACvD,YAAY;EACV;IAAY,MAAM,MAAM;IAAE,OAAO,MAAM;;EACvC,oBAAoB,OAAO;EAC3B,UAAU,OAAO;;AAGnB,yEAAyE,GACzE,OAAO,YAAI,cAAmD;AAE9D;OACO,GACP,OAAO,YAAI,SAAU,KAAK;EAAW,MAAM,MAAM;EAAE,QAAQ,MAAM;EAOhE;AAED;mDACmD,GACnD,OAAO,YAAI,YAAa,KAAK,WAAS,MAAM,GAAG,SAAS,CAMvD;AAED;;;;;;;;;;;;;;;;;;;;;;CAsBC,GACD,OAAO,YAAI,cACT,QAAQ,QACR,MAAM,MAAM,EACZ,KAAK,WACJ,SAAS,IAAI,CAIf"}
|
package/_dist/rpc.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** The newest MCP protocol version this client supports. */ export declare let PROTOCOL: string;
|
|
2
|
+
/** The server said no: a transport failure, or a JSON-RPC error, whose
|
|
3
|
+
* code it carries. */ export declare class Refused extends Error {
|
|
4
|
+
readonly code?: number | string;
|
|
5
|
+
constructor(message: string, code?: number | string);
|
|
6
|
+
}
|
|
7
|
+
/** Nobody is signed in — the message is the sentence to print. */ export declare class Unauthorized extends Error {
|
|
8
|
+
}
|
|
9
|
+
/** Where to call and as whom: the `/mcp` URL, the bearer token, the session
|
|
10
|
+
* this command speaks for, and the `fetch` to use (a test passes a handler, so
|
|
11
|
+
* nothing here needs a socket). */ export type Door = {
|
|
12
|
+
url: string;
|
|
13
|
+
token?: string | null | (() => string | null | Promise<string | null>);
|
|
14
|
+
/** the session this command line is part of, sent on the `x-via` header —
|
|
15
|
+
* it records what wrote something, and is never a credential. A host that
|
|
16
|
+
* stores transcripts resolves it to that session and attributes the writes
|
|
17
|
+
* to it (@yaks/session/graph); one that does not ignores the header. */ via?: string | null;
|
|
18
|
+
/** more headers sent on every request */ headers?: Record<string, string>;
|
|
19
|
+
fetch?: (request: Request) => Response | Promise<Response>;
|
|
20
|
+
};
|
|
21
|
+
/** Send one JSON-RPC method and return its result. */ export type Rpc = (method: string, params?: unknown) => Promise<Record<string, unknown>>;
|
|
22
|
+
/** `yaks.app` → `https://yaks.app/mcp`, `localhost:5173` →
|
|
23
|
+
* `http://localhost:5173/mcp`; a full origin is used as given. */ export declare let doorUrl: (host: string) => string;
|
|
24
|
+
/** A client of one MCP server. Request ids count up within the process; the
|
|
25
|
+
* session id, if the server issued one, is sent on every request after the
|
|
26
|
+
* response that carried it. */ export declare let rpc: (door: Door) => Rpc;
|
|
27
|
+
/** The `initialize` handshake, sent before listing tools: it returns what the
|
|
28
|
+
* server calls itself and which protocol version it agreed to. */ export declare let initialize: (ask: Rpc) => Promise<Record<string, unknown>>;
|
|
29
|
+
//# sourceMappingURL=rpc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc.d.ts","sources":["../rpc.ts"],"names":[],"mappings":"AAoBA,0DAA0D,GAC1D,OAAO,YAAI,iBAAuB;AAElC;oBACoB,GACpB,OAAO,cAAM,gBAAgB;WACW,OAAO,MAAM,GAAG,MAAM;EAA5D,YAAY,SAAS,MAAM,EAAE,AAAS,OAAO,MAAM,GAAG,MAAM;AAG9D;AAEA,gEAAgE,GAChE,OAAO,cAAM,qBAAqB;AAAO;AAMzC;;iCAEiC,GACjC,YAAY;EACV,KAAK,MAAM;EACX,QAAQ,MAAM,GAAG,IAAI,UAAU,MAAM,GAAG,IAAI,GAAG,QAAQ,MAAM,GAAG,IAAI;EACpE;;;wEAGsE,GACtE,MAAM,MAAM,GAAG,IAAI;EACnB,uCAAuC,GACvC,UAAU,OAAO,MAAM,EAAE,MAAM;EAC/B,SAAS,SAAS,YAAY,WAAW,QAAQ;;AAGnD,oDAAoD,GACpD,YAAY,OACV,QAAQ,MAAM,EACd,SAAS,OAAO,KACb,QAAQ,OAAO,MAAM,EAAE,OAAO;AAMnC;gEACgE,GAChE,OAAO,YAAI,UAAW,MAAM,MAAM,KAAG,MAAM,CAIV;AAajC;;6BAE6B,GAC7B,OAAO,YAAI,MAAO,MAAM,SAAO,IA+D9B;AAED;gEACgE,GAChE,OAAO,YAAI,aAAoB,KAAK,QAAM,QAAQ,OAAO,MAAM,EAAE,OAAO,GAKpE"}
|