@byfriends/vis-server 0.3.4

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.
@@ -0,0 +1,49 @@
1
+ //#region src/server.d.ts
2
+ /** Options for starting a vis HTTP server programmatically. */
3
+ interface StartVisServerOptions {
4
+ /** Bind host. Defaults to `resolveHost()` (loopback). */
5
+ readonly host?: string;
6
+ /** Bind port. Defaults to `resolvePort()` (3001). */
7
+ readonly port?: number;
8
+ /** Auth token. Defaults to `resolveVisAuthToken(host)` (required outside loopback). */
9
+ readonly authToken?: string;
10
+ /**
11
+ * Directory holding the built SPA assets to serve. When omitted, the
12
+ * `public/` directory next to the compiled server bundle is used (if any);
13
+ * in dev mode this resolves to `null` and only the API is served.
14
+ */
15
+ readonly publicDir?: string;
16
+ }
17
+ /** A handle to a running vis server. */
18
+ interface VisServerHandle {
19
+ /** The host the server is bound to. */
20
+ readonly host: string;
21
+ /** The port the server is bound to. */
22
+ readonly port: number;
23
+ /** Base URL (`http://<host>:<port>`), with IPv6 hosts bracketed. */
24
+ readonly url: string;
25
+ /** Stop the server. Subsequent connections are refused. */
26
+ close(): void;
27
+ }
28
+ /**
29
+ * Start the vis HTTP server programmatically. Resolves once the server is
30
+ * listening. Used by the CLI `byf vis` subcommand (in-process) and by the
31
+ * standalone `index.ts` entry.
32
+ */
33
+ declare function startVisServer(options?: StartVisServerOptions): Promise<VisServerHandle>;
34
+ /**
35
+ * Resolve the BYF_HOME the server reads session records from. Exposed for the
36
+ * standalone entry's startup banner. CLI consumers rely on the same env var.
37
+ */
38
+ declare function resolveVisByfHome(): string;
39
+ /**
40
+ * Format the startup banner text. Exposed so the CLI can reuse the exact same
41
+ * wording without depending on startup-banner internals.
42
+ */
43
+ declare function formatVisStartupBanner(input: {
44
+ readonly authToken?: string;
45
+ readonly host: string;
46
+ readonly port: number;
47
+ }): string;
48
+ //#endregion
49
+ export { StartVisServerOptions, VisServerHandle, formatVisStartupBanner, resolveVisByfHome, startVisServer };
@@ -0,0 +1,2 @@
1
+ import { n as resolveVisByfHome, r as startVisServer, t as formatVisStartupBanner } from "./server-CqbNDUBH.mjs";
2
+ export { formatVisStartupBanner, resolveVisByfHome, startVisServer };
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@byfriends/vis-server",
3
+ "version": "0.3.4",
4
+ "description": "HTTP server for BYF session visualization, serving the API and built SPA assets",
5
+ "keywords": [
6
+ "byf",
7
+ "debugging",
8
+ "server",
9
+ "vis",
10
+ "visualization"
11
+ ],
12
+ "homepage": "https://github.com/ByronFinn/byf",
13
+ "bugs": {
14
+ "url": "https://github.com/ByronFinn/byf/issues"
15
+ },
16
+ "license": "Proprietary",
17
+ "author": "ByronFinn",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/ByronFinn/byf.git"
21
+ },
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "type": "module",
26
+ "imports": {
27
+ "#/*": [
28
+ "./src/*.ts",
29
+ "./src/*/index.ts"
30
+ ]
31
+ },
32
+ "exports": {
33
+ ".": {
34
+ "types": "./dist/server.d.mts",
35
+ "import": "./dist/server.mjs",
36
+ "default": "./dist/server.mjs"
37
+ },
38
+ "./package.json": "./package.json"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public",
42
+ "provenance": false
43
+ },
44
+ "dependencies": {
45
+ "@hono/node-server": "^1.13.7",
46
+ "hono": "^4.7.7",
47
+ "@byfriends/agent-core": "^0.3.4"
48
+ },
49
+ "devDependencies": {
50
+ "tsx": "^4.21.0",
51
+ "vitest": "4.1.4",
52
+ "@byfriends/kosong": "0.3.4",
53
+ "@byfriends/vis-web": "0.3.2"
54
+ },
55
+ "scripts": {
56
+ "dev": "tsx watch src/index.ts",
57
+ "build": "tsdown && node ../scripts/copy-web-dist.mjs",
58
+ "test": "vitest run"
59
+ }
60
+ }