@vestra-player/sdk 1.5.49 → 1.5.50
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 +12 -0
- package/README.md +1 -1
- package/bin/vestra-plugin.mjs +46 -0
- package/dist/docs-tree.json.gz +0 -0
- package/dist/docs.d.ts +53 -0
- package/dist/docs.js +544 -0
- package/llms.txt +31 -137
- package/package.json +6 -4
- package/llms-full.txt +0 -20347
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.5.50
|
|
4
|
+
|
|
5
|
+
**Who must change: tools that read `llms-full.txt`.** It is removed (approved by the maintainer, 2026-11-01): from the package (`@vestra-player/sdk/llms-full.txt`), from the documentation site and from the generators. Read the documentation tree instead: `npx -p @vestra-player/sdk vestra-plugin docs [path]` and `… docs --search <words>`, or `docs(path)` and `searchDocs(query)` from `@vestra-player/sdk/docs` in a program. The player's Workshop vendors the package's `dist/` (the tree is `dist/docs-tree.json.gz`, built with the package; reading it needs nothing else) and must drop its `llms-full.txt` expectation. Plugins need no change: no changes to the plugin API, `apiVersion` stays `vestra/1`, no new capability, no player version needed.
|
|
6
|
+
|
|
7
|
+
- **The documentation as a tree for agents** (`@vestra-player/sdk/docs`, `vestra-plugin docs`). An agent never gets one large file any more (`llms-full.txt` was 1,032 KiB, half of it the API type dump, too large for an agent to read): it reads the documentation by path, like `go doc`, with the same pages, structure and text as the site. `/` lists Overview (the README), Guides and API; `/Guides/<group>/<page>` is a page of the site (`/Guides/How-to/Test a plugin`; its file name, with or without `.md`, and an old title work too); `/API/<category>/<symbol>/<member>` is one declaration of `@vestra-player/sdk`, `@vestra-player/sdk/testing` or `@vestra-player/sdk/docs` with its import line, signature (and links to the SDK types it names), parameters, return value, errors, capability, minimum player version, since and examples (`/API/Media/Snapshot/dispose`). Every node lists the paths one level down with the site's one-line summary (a page's description, a declaration's first paragraph). Links in the text are paths of the tree (in angle brackets when they have spaces), including the README's links to the site; other repository files link to GitHub; images are left out.
|
|
8
|
+
- **Paths are forgiving.** Case, spaces and punctuation do not matter, the leading `/` is optional, `.` works like `/` (`Snapshot.export`, `plugin.player`), a name alone finds its node at any depth (`TestHost`, `TestHost/settle`; a declaration wins over a guide page of a similar name and an interface over a category of the same name), one stale segment is left out (`/API/Playback/Snapshot/export`), and the whole path is tried against every candidate (`/API/Media/current` finds the interface `Media`'s member, not the category). Several equally good matches are listed, not guessed; a path that matches nothing answers with the nearest names and the level's contents. `#heading` opens the page of a long answer that has the section. In Git Bash, `vestra-plugin docs` undoes the shell's conversion of `/API…` into a Windows path (detected by `MSYSTEM`).
|
|
9
|
+
- **Search** (`searchDocs(query)`, `--search`) lists the nodes containing every word, leaving out common words ("a", "the", "to"); names rank first, a declaration's before a page's, a path that contains every word first of all.
|
|
10
|
+
- **Bounded answers.** Every answer is at most 8 KB (`DOCS_PAGE_BYTES`); a longer one comes in pages (`{ page: 2 }`, `--page 2`). Page 1 lists the sections with the page each starts on; a code block cut by a break is closed and opened again, a short one moves to the next page whole, a cut table repeats its header row.
|
|
11
|
+
- **Built with the package.** `npm run build` (and so `prepare`) converts the project with TypeDoc exactly as the site does (typedoc.json, `scripts/typedoc-plugin.mjs`) and writes `dist/docs-tree.json.gz` (scripts/docs-tree.mjs): 1,137 nodes, about 372 KiB gzipped (1.4 MiB of JSON), read on first use; TypeDoc is needed only to build it. A test checks that every page and every declaration of the site is in the tree, as a node or described in its owner's text.
|
|
12
|
+
- **`llms.txt` is a short entry** (llmstxt.org): what the SDK is, how to read the tree by command line or library, the path scheme, and the tree's top levels with their summaries; about 5 KB, generated from the tree (`npm run docs:llms`).
|
|
13
|
+
- _Docs_: new how-to [Give a coding agent the documentation](docs/how-to/agent-docs.md); [Command line](docs/reference/cli.md) lists `vestra-plugin docs`; the API pages gain `@vestra-player/sdk/docs`; the README and the maintainers' notes point to the tree instead of `llms-full.txt`.
|
|
14
|
+
|
|
3
15
|
## 1.5.49
|
|
4
16
|
|
|
5
17
|
**Who must change: nobody.** No changes to the plugin API (`@vestra-player/sdk/runtime` gains the additive `RuntimeOptions` and an optional sixth `createPlugin` argument), `apiVersion` stays `vestra/1`, no new capability, no player version needed, and the player's runner needs no change. **Behaviour change, approved by the maintainer (2026-11-01):** in the player, a command declaration it refuses during activation no longer fails the whole plugin. What `commands.add` checks itself (an unknown `@` menu id, more than 8 path segments, an `order` out of range, a malformed or repeated binding, a bad `button`, a reason text of the wrong shape) still throws from `add`. A plugin whose `activate` relied on that failure (none is known) now runs without the refused command.
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
- **Tests without the player**: `@vestra-player/sdk/testing` runs your plugin against an in-memory host with `node --test`.
|
|
24
24
|
- **One command line tool**, `vestra-plugin`, to check, test, build and pack a `.vxp` package.
|
|
25
25
|
- **The same API on macOS and Windows**; every plugin runs in its own Node.js 26 process that the player ships.
|
|
26
|
-
- **
|
|
26
|
+
- **Documentation for coding agents**: `npx -p @vestra-player/sdk vestra-plugin docs [path]` reads this documentation as a tree of short pages, like `go doc` (`… docs Snapshot.export`, `… docs --search <words>`; in a project that depends on the SDK, `npx vestra-plugin docs`); programs import `@vestra-player/sdk/docs`. [`llms.txt`](https://vestrasys.github.io/vestra-player-sdk/llms.txt) (also `@vestra-player/sdk/llms.txt`) is the short entry that explains it.
|
|
27
27
|
|
|
28
28
|
## Install
|
|
29
29
|
|
package/bin/vestra-plugin.mjs
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
* vestra-plugin <check|build|test|pack> [plugin-dir...] [--version x.y.z] [--out dir]
|
|
7
7
|
* vestra-plugin i18n extract [plugin-dir...] [--locale <lang>]...
|
|
8
8
|
* vestra-plugin i18n check [plugin-dir...]
|
|
9
|
+
* vestra-plugin docs [path] [--page N]
|
|
10
|
+
* vestra-plugin docs --search <query> [--page N]
|
|
9
11
|
*
|
|
10
12
|
* A plugin directory holds manifest.json; the default is the current
|
|
11
13
|
* directory. Works in any project that depends on @vestra-player/sdk.
|
|
@@ -19,6 +21,10 @@
|
|
|
19
21
|
* test node --test on tests/*.test.{ts,mjs}
|
|
20
22
|
* pack build, then dist/ → <out>/<id>-<version>.vxp (a zip; default
|
|
21
23
|
* out: the current directory) with its sha256 and size
|
|
24
|
+
* docs the SDK's documentation by path, for coding agents: `/` lists
|
|
25
|
+
* Overview, Guides and API, `/API/Media/Snapshot/dispose` is
|
|
26
|
+
* one member's whole documentation; --search <query> lists
|
|
27
|
+
* matching paths; at most 8 KB per answer, --page N for the rest
|
|
22
28
|
*
|
|
23
29
|
* Translations (docs/how-to/i18n.md). English is the source text; each
|
|
24
30
|
* language is a gettext file locales/<lang>.po:
|
|
@@ -932,8 +938,44 @@ const USAGE = [
|
|
|
932
938
|
" vestra-plugin check [plugin-dir...] --json",
|
|
933
939
|
" vestra-plugin i18n extract [plugin-dir...] [--locale <lang>]...",
|
|
934
940
|
" vestra-plugin i18n check [plugin-dir...]",
|
|
941
|
+
" vestra-plugin docs [path] [--page N]",
|
|
942
|
+
" vestra-plugin docs --search <query> [--page N]",
|
|
935
943
|
].join("\n");
|
|
936
944
|
|
|
945
|
+
/** `vestra-plugin docs`: `@vestra-player/sdk/docs` on the command line. */
|
|
946
|
+
async function docsCommand(args) {
|
|
947
|
+
const index = args.indexOf("--page");
|
|
948
|
+
let page;
|
|
949
|
+
if (index >= 0) {
|
|
950
|
+
const [, value] = args.splice(index, 2);
|
|
951
|
+
page = Number(value);
|
|
952
|
+
if (!Number.isInteger(page) || page < 1)
|
|
953
|
+
fail("--page needs a page number (1, 2, …)");
|
|
954
|
+
}
|
|
955
|
+
const { docs, searchDocs } = await import(
|
|
956
|
+
pathToFileURL(join(sdkRoot, "dist/docs.js")).href
|
|
957
|
+
);
|
|
958
|
+
const search = args.indexOf("--search");
|
|
959
|
+
if (search >= 0) {
|
|
960
|
+
args.splice(search, 1);
|
|
961
|
+
if (!args.length) fail("--search needs words to search for");
|
|
962
|
+
console.log(searchDocs(args.join(" "), { page }));
|
|
963
|
+
return;
|
|
964
|
+
}
|
|
965
|
+
// A path with spaces may come as several arguments.
|
|
966
|
+
let path = args.length ? args.join(" ") : "/";
|
|
967
|
+
// Git Bash (MSYSTEM) turns "/API/Media" into "<its root>/API/Media":
|
|
968
|
+
// start again at the tree's top level.
|
|
969
|
+
if (process.env.MSYSTEM && /^[A-Za-z]:[\\/]/.test(path)) {
|
|
970
|
+
const segments = path.split(/[\\/]/);
|
|
971
|
+
const top = segments.findIndex((segment) =>
|
|
972
|
+
["overview", "guides", "api"].includes(segment.toLowerCase()),
|
|
973
|
+
);
|
|
974
|
+
if (top > 0) path = `/${segments.slice(top).join("/")}`;
|
|
975
|
+
}
|
|
976
|
+
console.log(docs(path, { page }));
|
|
977
|
+
}
|
|
978
|
+
|
|
937
979
|
async function main() {
|
|
938
980
|
const args = process.argv.slice(2);
|
|
939
981
|
const command = args.shift();
|
|
@@ -948,6 +990,10 @@ async function main() {
|
|
|
948
990
|
console.log(USAGE);
|
|
949
991
|
return;
|
|
950
992
|
}
|
|
993
|
+
if (command === "docs") {
|
|
994
|
+
await docsCommand(args);
|
|
995
|
+
return;
|
|
996
|
+
}
|
|
951
997
|
let subcommand = null;
|
|
952
998
|
if (command === "i18n") {
|
|
953
999
|
subcommand = args.shift();
|
|
Binary file
|
package/dist/docs.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The most bytes (UTF-8) one answer of `docs` or `searchDocs` has.
|
|
3
|
+
*
|
|
4
|
+
* @category Docs
|
|
5
|
+
*/
|
|
6
|
+
export declare const DOCS_PAGE_BYTES = 8192;
|
|
7
|
+
/**
|
|
8
|
+
* Which page of a long answer to return.
|
|
9
|
+
*
|
|
10
|
+
* @category Docs
|
|
11
|
+
*/
|
|
12
|
+
export interface DocsOptions {
|
|
13
|
+
/** 1-based; the default is 1. */
|
|
14
|
+
page?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The documentation at `path`: its text, then the paths one level down,
|
|
18
|
+
* each with a one-line summary.
|
|
19
|
+
*
|
|
20
|
+
* `/` lists Overview, Guides and API. `/Guides/<group>/<page title>` is a
|
|
21
|
+
* page of the documentation site (its file name works too:
|
|
22
|
+
* `/Guides/How-to/testing`); `/API/<category>/<symbol>/<member>` is a
|
|
23
|
+
* declaration with its signature, parameters, return value, errors,
|
|
24
|
+
* capability, player version and examples. Matching ignores case, spaces
|
|
25
|
+
* and punctuation; a leading `/` and a `.md` suffix are optional; `.`
|
|
26
|
+
* works like `/` (`Snapshot.export`); a name that is not at its level is
|
|
27
|
+
* looked up below it (`TestHost`, `/API/Snapshot` finds
|
|
28
|
+
* `/API/Media/Snapshot`), and one stale segment is skipped. A `#heading`
|
|
29
|
+
* opens the page of a long answer that has it. A path that matches
|
|
30
|
+
* nothing answers with the nearest names and the level's contents.
|
|
31
|
+
*
|
|
32
|
+
* @param path - Default `/`.
|
|
33
|
+
* @param options - `page` of a long answer.
|
|
34
|
+
* @returns At most {@link DOCS_PAGE_BYTES} bytes of text; a continued
|
|
35
|
+
* answer ends with the number of the next page.
|
|
36
|
+
*
|
|
37
|
+
* @category Docs
|
|
38
|
+
*/
|
|
39
|
+
export declare function docs(path?: string, options?: DocsOptions): string;
|
|
40
|
+
/**
|
|
41
|
+
* Search the documentation by name and text: the matching paths, best
|
|
42
|
+
* first, each with its one-line summary. Every word of `query` (common
|
|
43
|
+
* words such as "a", "the", "to" left out) must occur, in any case, in
|
|
44
|
+
* the path, the summary or the text; a match in a name ranks first, a
|
|
45
|
+
* declaration's name before a page's.
|
|
46
|
+
*
|
|
47
|
+
* @param query - Words, such as `"snapshot export"` or `"onError"`.
|
|
48
|
+
* @param options - `page` of a long answer.
|
|
49
|
+
* @returns At most {@link DOCS_PAGE_BYTES} bytes of text.
|
|
50
|
+
*
|
|
51
|
+
* @category Docs
|
|
52
|
+
*/
|
|
53
|
+
export declare function searchDocs(query: string, options?: DocsOptions): string;
|