pinecall 0.3.0 → 0.4.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/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +43 -12
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/env.d.ts +22 -6
- package/dist/cli/env.d.ts.map +1 -1
- package/dist/cli/env.js +56 -14
- package/dist/cli/env.js.map +1 -1
- package/dist/cli/gateway.d.ts +12 -0
- package/dist/cli/gateway.d.ts.map +1 -0
- package/dist/cli/gateway.js +67 -0
- package/dist/cli/gateway.js.map +1 -0
- package/dist/cli/index.js +6 -6
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/login.d.ts +1 -1
- package/dist/cli/login.d.ts.map +1 -1
- package/dist/cli/login.js +87 -10
- package/dist/cli/login.js.map +1 -1
- package/dist/cli/profiles.d.ts +57 -5
- package/dist/cli/profiles.d.ts.map +1 -1
- package/dist/cli/profiles.js +111 -9
- package/dist/cli/profiles.js.map +1 -1
- package/dist/cli/ui/console/assets/index-DhcpHPdk.js +102 -0
- package/dist/cli/ui/console/assets/index-iylvEP0_.css +1 -0
- package/dist/cli/ui/console/favicon.png +0 -0
- package/dist/cli/ui/console/index.html +4 -4
- package/dist/cli/ui/console/pinecall-logo.png +0 -0
- package/dist/cli/ui/console/pinecall-mark.png +0 -0
- package/dist/cli/world.d.ts.map +1 -1
- package/dist/cli/world.js +2 -1
- package/dist/cli/world.js.map +1 -1
- package/package.json +2 -2
- package/dist/cli/signup.d.ts +0 -25
- package/dist/cli/signup.d.ts.map +0 -1
- package/dist/cli/signup.js +0 -122
- package/dist/cli/signup.js.map +0 -1
- package/dist/cli/ui/admin/assets/index-BlHXSYVz.css +0 -1
- package/dist/cli/ui/admin/assets/index-BpdIOuyO.js +0 -58
- package/dist/cli/ui/admin/index.html +0 -20
- package/dist/cli/ui/browser.d.ts +0 -10
- package/dist/cli/ui/browser.d.ts.map +0 -1
- package/dist/cli/ui/browser.js +0 -30
- package/dist/cli/ui/browser.js.map +0 -1
- package/dist/cli/ui/console/assets/index-BUlGAwqn.css +0 -1
- package/dist/cli/ui/console/assets/index-D9StTnoH.js +0 -102
- package/dist/cli/ui/index.d.ts +0 -15
- package/dist/cli/ui/index.d.ts.map +0 -1
- package/dist/cli/ui/index.js +0 -117
- package/dist/cli/ui/index.js.map +0 -1
- package/dist/cli/ui/refused.d.ts +0 -8
- package/dist/cli/ui/refused.d.ts.map +0 -1
- package/dist/cli/ui/refused.js +0 -11
- package/dist/cli/ui/refused.js.map +0 -1
- package/dist/cli/ui/server.d.ts +0 -22
- package/dist/cli/ui/server.d.ts.map +0 -1
- package/dist/cli/ui/server.js +0 -211
- package/dist/cli/ui/server.js.map +0 -1
package/dist/cli/ui/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/** `pinecall ui [agent]`: the console on 127.0.0.1 for the life of the command, opened in this machine's browser. */
|
|
2
|
-
import type { Group } from "../groups.js";
|
|
3
|
-
export declare const group: Group;
|
|
4
|
-
/** What ui can be told besides the argv: where to print, and which browser to open. Tests only. */
|
|
5
|
-
export interface Opening {
|
|
6
|
-
out?: NodeJS.WritableStream;
|
|
7
|
-
err?: NodeJS.WritableStream;
|
|
8
|
-
open?: (url: string) => void;
|
|
9
|
-
env?: NodeJS.ProcessEnv;
|
|
10
|
-
files?: string;
|
|
11
|
-
}
|
|
12
|
-
/** Serve, open, wait, close. The org key is read once and spent only by the server, never printed. */
|
|
13
|
-
export declare function ui(argv: string[], how?: Opening): Promise<number>;
|
|
14
|
-
export declare function consoleFiles(): string;
|
|
15
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/ui/index.ts"],"names":[],"mappings":"AAAA,qHAAqH;AAOrH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAoB1C,eAAO,MAAM,KAAK,EAAE,KAcnB,CAAC;AAEF,mGAAmG;AACnG,MAAM,WAAW,OAAO;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IAC5B,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,sGAAsG;AACtG,wBAAsB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,GAAE,OAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAuD3E;AAWD,wBAAgB,YAAY,IAAI,MAAM,CAMrC"}
|
package/dist/cli/ui/index.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/** `pinecall ui [agent]`: the console on 127.0.0.1 for the life of the command, opened in this machine's browser. */
|
|
2
|
-
import { existsSync } from "node:fs";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { slugOf } from "../../runtime/connect.js";
|
|
5
|
-
import { doorLine, theDoor } from "../env.js";
|
|
6
|
-
import { agentOfThisDirectory, DEFAULT_AGENTS } from "../load.js";
|
|
7
|
-
import { headless, openInBrowser } from "./browser.js";
|
|
8
|
-
import { chattingFrom } from "./chatting.js";
|
|
9
|
-
import { driftingFrom } from "./drifting.js";
|
|
10
|
-
import { ownDoors } from "./doors.js";
|
|
11
|
-
import { knowingFrom } from "./knowing.js";
|
|
12
|
-
import { promotingFrom } from "./promoting.js";
|
|
13
|
-
import { rememberingFrom } from "./remembering.js";
|
|
14
|
-
import { reproducingFrom } from "./reproducing.js";
|
|
15
|
-
import { LocalConsole } from "./server.js";
|
|
16
|
-
import { simulatingFrom } from "./simulating.js";
|
|
17
|
-
import { testingFrom } from "./testing.js";
|
|
18
|
-
const USAGE = "usage: pinecall ui [agent]";
|
|
19
|
-
// A checkout runs everything else from its sources; the console is the one thing that has to be
|
|
20
|
-
// bundled first, because a browser reads no TypeScript. The sentence names the command.
|
|
21
|
-
const NOT_BUILT = "the console is not built: run scripts/build once, then pinecall ui";
|
|
22
|
-
export const group = {
|
|
23
|
-
purpose: "the console: this gateway's agents, their calls and logs as they happen, evals, and a page to talk",
|
|
24
|
-
usage: `${USAGE}
|
|
25
|
-
|
|
26
|
-
Opens the console on this gateway, landing on the agent of this directory — the class in
|
|
27
|
-
${DEFAULT_AGENTS[0]} — or on the agent named, or on the list of every agent the gateway holds when
|
|
28
|
-
there is neither. The console is served on 127.0.0.1 for as long as the command runs and opened
|
|
29
|
-
in this machine's browser: Talk joins the agent's room with the browser's microphone, Calls
|
|
30
|
-
follows every call as it happens, Sessions reads the finished ones, Evals and Pipeline read
|
|
31
|
-
their doors. Ctrl-C here closes the port with the command.
|
|
32
|
-
|
|
33
|
-
The key never reaches the browser: this process signs every request the console makes, under a
|
|
34
|
-
URL only it printed. Runs where a browser is — over ssh or with no display it says so and exits 2.`,
|
|
35
|
-
run: ui,
|
|
36
|
-
};
|
|
37
|
-
/** Serve, open, wait, close. The org key is read once and spent only by the server, never printed. */
|
|
38
|
-
export async function ui(argv, how = {}) {
|
|
39
|
-
const out = how.out ?? process.stdout;
|
|
40
|
-
const err = how.err ?? process.stderr;
|
|
41
|
-
const env = how.env ?? process.env;
|
|
42
|
-
if (argv[0]?.startsWith("-")) {
|
|
43
|
-
out.write(`${USAGE}\n`);
|
|
44
|
-
return 2;
|
|
45
|
-
}
|
|
46
|
-
const door = theDoor(env, err);
|
|
47
|
-
if (door === undefined)
|
|
48
|
-
return 2;
|
|
49
|
-
const why = headless(env);
|
|
50
|
-
if (why !== null) {
|
|
51
|
-
err.write(`ui needs a browser on this machine and ${why}: run it where the screen is\n`);
|
|
52
|
-
return 2;
|
|
53
|
-
}
|
|
54
|
-
const here = await agentOfThisDirectory();
|
|
55
|
-
const agent = argv[0] ?? here;
|
|
56
|
-
const files = how.files ?? consoleFiles();
|
|
57
|
-
if (!existsSync(files)) {
|
|
58
|
-
err.write(`${NOT_BUILT}\n`);
|
|
59
|
-
return 2;
|
|
60
|
-
}
|
|
61
|
-
// A simulation or a suite started from the page mounts the class of THIS directory in this
|
|
62
|
-
// process and prints here, exactly as `pinecall simulate` and `pinecall test` would; the page
|
|
63
|
-
// watches the call's log, or the run's row.
|
|
64
|
-
const chatting = chattingFrom(door, here, out);
|
|
65
|
-
const served = await LocalConsole.open(door, files, ownDoors({
|
|
66
|
-
simulating: simulatingFrom(door, here, out),
|
|
67
|
-
testing: testingFrom(door, here, out),
|
|
68
|
-
chatting,
|
|
69
|
-
knowing: knowingFrom(door, here),
|
|
70
|
-
remembering: rememberingFrom(door, here),
|
|
71
|
-
promoting: promotingFrom(door, here, out),
|
|
72
|
-
drifting: driftingFrom(door),
|
|
73
|
-
reproducing: reproducingFrom(),
|
|
74
|
-
}));
|
|
75
|
-
const at = agent === null ? served.url : served.at(`a/${agent}`);
|
|
76
|
-
// Which gateway and which of the four places the key came from: the one line that answers
|
|
77
|
-
// "why is it talking to that box" before anybody has to grep for an exported name.
|
|
78
|
-
out.write(`${doorLine(door)}\n`);
|
|
79
|
-
out.write(`${agent ?? "console"} · ${door.url} · ${at}\n`);
|
|
80
|
-
(how.open ?? openInBrowser)(at);
|
|
81
|
-
const hungUp = interrupted();
|
|
82
|
-
try {
|
|
83
|
-
await hungUp.happened;
|
|
84
|
-
}
|
|
85
|
-
finally {
|
|
86
|
-
hungUp.stop();
|
|
87
|
-
await chatting.close();
|
|
88
|
-
await served.close();
|
|
89
|
-
}
|
|
90
|
-
return 0;
|
|
91
|
-
}
|
|
92
|
-
// Named by the same rule `run` registers it under, read from the same file, so the two verbs never
|
|
93
|
-
// The console is a browser program inside this package: its source is src/cli/ui/console and vite
|
|
94
|
-
// writes its build to dist/cli/ui/console, which is what `files` publishes. So from the compiled
|
|
95
|
-
// verb the page is the sibling directory, and from the source under a loader it is the same path
|
|
96
|
-
// in dist — one of the two exists, and a tree where neither does was never built.
|
|
97
|
-
// Beside this module sits `console/` twice over: in the published package it is the BUILT console,
|
|
98
|
-
// and in a checkout it is the SOURCE, whose index.html points at `main.tsx` — TypeScript, which no
|
|
99
|
-
// browser runs, and which served a blank page for as long as the check was `existsSync` alone.
|
|
100
|
-
// What tells them apart is that source file, so that is what is asked about.
|
|
101
|
-
export function consoleFiles() {
|
|
102
|
-
const beside = fileURLToPath(new URL("console/", import.meta.url));
|
|
103
|
-
if (existsSync(beside) && !existsSync(fileURLToPath(new URL("console/main.tsx", import.meta.url)))) {
|
|
104
|
-
return beside;
|
|
105
|
-
}
|
|
106
|
-
return fileURLToPath(new URL("../../../dist/cli/ui/console/", import.meta.url));
|
|
107
|
-
}
|
|
108
|
-
/** Ctrl-C, as a promise that resolves once, and the handle that unhooks it. */
|
|
109
|
-
function interrupted() {
|
|
110
|
-
let hungUp = () => undefined;
|
|
111
|
-
const happened = new Promise((resolve) => {
|
|
112
|
-
hungUp = () => resolve();
|
|
113
|
-
process.once("SIGINT", hungUp);
|
|
114
|
-
});
|
|
115
|
-
return { happened, stop: () => process.off("SIGINT", hungUp) };
|
|
116
|
-
}
|
|
117
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cli/ui/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/ui/index.ts"],"names":[],"mappings":"AAAA,qHAAqH;AAErH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC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,CAAC;QACnG,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,aAAa,CAAC,IAAI,GAAG,CAAC,+BAA+B,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAClF,CAAC;AAED,+EAA+E;AAC/E,SAAS,WAAW;IAClB,IAAI,MAAM,GAAG,GAAS,EAAE,CAAC,SAAS,CAAC;IACnC,MAAM,QAAQ,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;QAC7C,MAAM,GAAG,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC;AACjE,CAAC"}
|
package/dist/cli/ui/refused.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** A refusal from one of the console's own doors: a sentence for the page, and the status it travels under. */
|
|
2
|
-
/** Thrown by a door of this process; the server writes it as `{detail}` under `status`, as FastAPI would. */
|
|
3
|
-
export declare class Refused extends Error {
|
|
4
|
-
readonly status: number;
|
|
5
|
-
readonly name = "Refused";
|
|
6
|
-
constructor(status: number, message: string);
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=refused.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"refused.d.ts","sourceRoot":"","sources":["../../../src/cli/ui/refused.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAE/G,6GAA6G;AAC7G,qBAAa,OAAQ,SAAQ,KAAK;IAI9B,QAAQ,CAAC,MAAM,EAAE,MAAM;IAHzB,SAAkB,IAAI,aAAa;IAEnC,YACW,MAAM,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,EAGhB;CACF"}
|
package/dist/cli/ui/refused.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/** A refusal from one of the console's own doors: a sentence for the page, and the status it travels under. */
|
|
2
|
-
/** Thrown by a door of this process; the server writes it as `{detail}` under `status`, as FastAPI would. */
|
|
3
|
-
export class Refused extends Error {
|
|
4
|
-
status;
|
|
5
|
-
name = "Refused";
|
|
6
|
-
constructor(status, message) {
|
|
7
|
-
super(message);
|
|
8
|
-
this.status = status;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=refused.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"refused.js","sourceRoot":"","sources":["../../../src/cli/ui/refused.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAE/G,6GAA6G;AAC7G,MAAM,OAAO,OAAQ,SAAQ,KAAK;IAIrB,MAAM;IAHC,IAAI,GAAG,SAAS,CAAC;IAEnC,YACW,MAAc,EACvB,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;sBAHN,MAAM;IAIjB,CAAC;CACF"}
|
package/dist/cli/ui/server.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/** The local server behind `pinecall ui`: the console's files and the gateway's doors, under one nonce on 127.0.0.1. */
|
|
2
|
-
import type { Door } from "../testing/gateway.js";
|
|
3
|
-
import type { OwnDoor } from "./doors.js";
|
|
4
|
-
/**
|
|
5
|
-
* The console's server for the life of one command. Under its nonce it serves the built console
|
|
6
|
-
* and forwards `v1/*` to the gateway with the org key on the header; outside the nonce it answers
|
|
7
|
-
* 404 and nothing else. The key is a field of this object and is written into exactly one place:
|
|
8
|
-
* the authorization header of a request this process makes.
|
|
9
|
-
*/
|
|
10
|
-
export declare class LocalConsole {
|
|
11
|
-
#private;
|
|
12
|
-
private constructor();
|
|
13
|
-
/** Bind the loopback on a free port and serve the console in `files` for this door. */
|
|
14
|
-
static open(door: Door, files: string, own?: OwnDoor[]): Promise<LocalConsole>;
|
|
15
|
-
/** Where the console is: the loopback, the port, the nonce. The one URL that answers anything. */
|
|
16
|
-
get url(): string;
|
|
17
|
-
/** Where one screen of the console is, by the path the console routes. */
|
|
18
|
-
at(path: string): string;
|
|
19
|
-
/** Close every socket and the port. After this, nothing answers at `url`. */
|
|
20
|
-
close(): Promise<void>;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=server.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/cli/ui/server.ts"],"names":[],"mappings":"AAAA,wHAAwH;AASxH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAoC1C;;;;;GAKG;AACH,qBAAa,YAAY;;IAQvB,OAAO,eAYN;IAED,uFAAuF;IACvF,OAAa,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,GAAE,OAAO,EAAO,GAAG,OAAO,CAAC,YAAY,CAAC,CAIvF;IAED,kGAAkG;IAClG,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED,0EAA0E;IAC1E,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvB;IAED,6EAA6E;IACvE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAG3B;CAqHF"}
|
package/dist/cli/ui/server.js
DELETED
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
/** The local server behind `pinecall ui`: the console's files and the gateway's doors, under one nonce on 127.0.0.1. */
|
|
2
|
-
import { randomBytes } from "node:crypto";
|
|
3
|
-
import { createReadStream, existsSync, readFileSync, statSync } from "node:fs";
|
|
4
|
-
import { createServer } from "node:http";
|
|
5
|
-
import { extname, join, normalize, resolve, sep } from "node:path";
|
|
6
|
-
import { Readable } from "node:stream";
|
|
7
|
-
import { Refusal, refusedAs } from "./refusal.js";
|
|
8
|
-
// Loopback only, and the kernel picks the port: nothing on the network can reach this console,
|
|
9
|
-
// and two `ui`s on one laptop do not fight over a number.
|
|
10
|
-
const LOOPBACK = "127.0.0.1";
|
|
11
|
-
// Everything answers under a random path — the console's files and, with them, the door to the
|
|
12
|
-
// gateway that this process opens with the org key. A process on this machine that scans the
|
|
13
|
-
// loopback finds a port; without the URL this process printed, it finds a 404 and nothing behind
|
|
14
|
-
// it. The key itself never leaves this process: the browser sends requests, this server signs them.
|
|
15
|
-
const NONCE_BYTES = 16;
|
|
16
|
-
// The gateway's doors, as the console asks for them relative to its base. Everything else under
|
|
17
|
-
// the nonce is a file of the console, or the console's page for a screen it routes itself.
|
|
18
|
-
const DOORS = "v1/";
|
|
19
|
-
// This process's OWN doors, beside the gateway's: what only the terminal that typed `ui` can do,
|
|
20
|
-
// because it stands in the agent's directory. Which ones there are is ui/doors.ts, and this
|
|
21
|
-
// server knows no more about them than their paths.
|
|
22
|
-
const OWN = "ui/";
|
|
23
|
-
const TYPES = {
|
|
24
|
-
".html": "text/html; charset=utf-8",
|
|
25
|
-
".js": "text/javascript; charset=utf-8",
|
|
26
|
-
".css": "text/css; charset=utf-8",
|
|
27
|
-
".json": "application/json",
|
|
28
|
-
".map": "application/json",
|
|
29
|
-
".svg": "image/svg+xml",
|
|
30
|
-
".woff2": "font/woff2",
|
|
31
|
-
};
|
|
32
|
-
// The headers a browser's request carries that the gateway needs to see. Everything else — the
|
|
33
|
-
// cookies, the origin, the user agent — is the browser's business and stops here.
|
|
34
|
-
const FORWARDED = ["content-type", "accept", "last-event-id", "range"];
|
|
35
|
-
/**
|
|
36
|
-
* The console's server for the life of one command. Under its nonce it serves the built console
|
|
37
|
-
* and forwards `v1/*` to the gateway with the org key on the header; outside the nonce it answers
|
|
38
|
-
* 404 and nothing else. The key is a field of this object and is written into exactly one place:
|
|
39
|
-
* the authorization header of a request this process makes.
|
|
40
|
-
*/
|
|
41
|
-
export class LocalConsole {
|
|
42
|
-
#server;
|
|
43
|
-
#nonce;
|
|
44
|
-
#door;
|
|
45
|
-
#files;
|
|
46
|
-
#own;
|
|
47
|
-
#url = "";
|
|
48
|
-
constructor(door, files, own) {
|
|
49
|
-
this.#door = door;
|
|
50
|
-
this.#own = own;
|
|
51
|
-
// Resolved, which is what strips a trailing separator: the directory arrives as a URL's path
|
|
52
|
-
// and so ends in one, and `#serve` compares against `#files + sep`. Left as it came, that
|
|
53
|
-
// comparison is `…/console//`, which no file under it starts with, and EVERY request fell
|
|
54
|
-
// through to the page — including the bundle, which the browser then parsed as HTML.
|
|
55
|
-
this.#files = resolve(files);
|
|
56
|
-
this.#nonce = randomBytes(NONCE_BYTES).toString("hex");
|
|
57
|
-
this.#server = createServer((request, response) => {
|
|
58
|
-
void this.#answer(request, response);
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
/** Bind the loopback on a free port and serve the console in `files` for this door. */
|
|
62
|
-
static async open(door, files, own = []) {
|
|
63
|
-
const served = new LocalConsole(door, files, own);
|
|
64
|
-
await served.#listen();
|
|
65
|
-
return served;
|
|
66
|
-
}
|
|
67
|
-
/** Where the console is: the loopback, the port, the nonce. The one URL that answers anything. */
|
|
68
|
-
get url() {
|
|
69
|
-
return this.#url;
|
|
70
|
-
}
|
|
71
|
-
/** Where one screen of the console is, by the path the console routes. */
|
|
72
|
-
at(path) {
|
|
73
|
-
return `${this.#url}${path.replace(/^\//, "")}`;
|
|
74
|
-
}
|
|
75
|
-
/** Close every socket and the port. After this, nothing answers at `url`. */
|
|
76
|
-
async close() {
|
|
77
|
-
this.#server.closeAllConnections();
|
|
78
|
-
await new Promise((closed) => this.#server.close(() => closed()));
|
|
79
|
-
}
|
|
80
|
-
async #listen() {
|
|
81
|
-
await new Promise((bound, failed) => {
|
|
82
|
-
this.#server.once("error", failed);
|
|
83
|
-
this.#server.listen(0, LOOPBACK, bound);
|
|
84
|
-
});
|
|
85
|
-
const { port } = this.#server.address();
|
|
86
|
-
this.#url = `http://${LOOPBACK}:${port}/${this.#nonce}/`;
|
|
87
|
-
}
|
|
88
|
-
async #answer(request, response) {
|
|
89
|
-
const asked = new URL(request.url ?? "/", this.#url);
|
|
90
|
-
const under = `/${this.#nonce}/`;
|
|
91
|
-
if (!asked.pathname.startsWith(under)) {
|
|
92
|
-
response.writeHead(404, { "content-type": "text/plain; charset=utf-8" });
|
|
93
|
-
response.end("not here\n");
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
const path = asked.pathname.slice(under.length);
|
|
97
|
-
if (path.startsWith(DOORS)) {
|
|
98
|
-
await this.#forward(request, response, `/${path}${asked.search}`);
|
|
99
|
-
}
|
|
100
|
-
else if (path.startsWith(OWN)) {
|
|
101
|
-
await this.#answerOwn(request, response, path);
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
this.#serve(response, path);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
// The doors this process answers itself, read off the table it was opened with. A refusal
|
|
108
|
-
// travels as FastAPI's would — a status and a `detail` sentence — so the page reads both kinds
|
|
109
|
-
// of door the same way.
|
|
110
|
-
async #answerOwn(request, response, path) {
|
|
111
|
-
const method = request.method ?? "GET";
|
|
112
|
-
const door = this.#own.find((one) => `${OWN}${one.path}` === path);
|
|
113
|
-
const answer = method === "GET" ? door?.get : method === "POST" ? door?.post : undefined;
|
|
114
|
-
try {
|
|
115
|
-
if (answer === undefined)
|
|
116
|
-
throw new Refusal(404, `nothing at ${path}`);
|
|
117
|
-
json(response, 200, await answer(JSON.parse((await whole(request)).toString() || "{}")));
|
|
118
|
-
}
|
|
119
|
-
catch (refused) {
|
|
120
|
-
const said = refusedAs(refused);
|
|
121
|
-
json(response, said.status, { detail: said.detail });
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
// The one place the key is spent. The response streams back as it arrives, which is what a log
|
|
125
|
-
// over SSE needs; a browser that navigates away aborts the request behind it.
|
|
126
|
-
async #forward(request, response, path) {
|
|
127
|
-
const headers = { authorization: `Bearer ${this.#door.apiKey}` };
|
|
128
|
-
for (const name of FORWARDED) {
|
|
129
|
-
const value = request.headers[name];
|
|
130
|
-
if (typeof value === "string")
|
|
131
|
-
headers[name] = value;
|
|
132
|
-
}
|
|
133
|
-
// The response closing before it finished is the browser going away — a tab closed, a screen
|
|
134
|
-
// left — and the door behind it is let go with it. (The request's own `close` is not that: it
|
|
135
|
-
// fires the moment its body has been read.)
|
|
136
|
-
const stopping = new AbortController();
|
|
137
|
-
response.once("close", () => {
|
|
138
|
-
if (!response.writableFinished)
|
|
139
|
-
stopping.abort();
|
|
140
|
-
});
|
|
141
|
-
// A body the console sends is one JSON object, read whole before the door is asked: the
|
|
142
|
-
// doors it writes to take a document, never a stream.
|
|
143
|
-
const method = request.method ?? "GET";
|
|
144
|
-
const body = method === "GET" || method === "HEAD" ? {} : { body: await whole(request) };
|
|
145
|
-
let answered;
|
|
146
|
-
try {
|
|
147
|
-
answered = await fetch(new URL(path, this.#door.url), { method, headers, signal: stopping.signal, ...body });
|
|
148
|
-
}
|
|
149
|
-
catch (failed) {
|
|
150
|
-
if (stopping.signal.aborted)
|
|
151
|
-
return;
|
|
152
|
-
response.writeHead(502, { "content-type": "text/plain; charset=utf-8" });
|
|
153
|
-
response.end(`the gateway did not answer: ${failed instanceof Error ? failed.message : String(failed)}\n`);
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
const relayed = {
|
|
157
|
-
"content-type": answered.headers.get("content-type") ?? "application/octet-stream",
|
|
158
|
-
"cache-control": "no-store",
|
|
159
|
-
};
|
|
160
|
-
// A recording is served in byte ranges so a player can seek; those three headers are the
|
|
161
|
-
// range's own and travel back with it.
|
|
162
|
-
for (const name of ["content-range", "accept-ranges", "content-length"]) {
|
|
163
|
-
const value = answered.headers.get(name);
|
|
164
|
-
if (value !== null)
|
|
165
|
-
relayed[name] = value;
|
|
166
|
-
}
|
|
167
|
-
response.writeHead(answered.status, relayed);
|
|
168
|
-
if (answered.body === null) {
|
|
169
|
-
response.end();
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
const relaying = Readable.fromWeb(answered.body);
|
|
173
|
-
// The browser leaving mid-stream aborts the fetch, and the abort surfaces here as the body's
|
|
174
|
-
// own error. It is the one way a stream is expected to end, not a failure of this process —
|
|
175
|
-
// unheard, it was an uncaught exception that took the whole console down (2026-09-09).
|
|
176
|
-
relaying.on("error", () => response.destroy());
|
|
177
|
-
relaying.pipe(response);
|
|
178
|
-
}
|
|
179
|
-
// A path that names a file of the console is that file; every other path is a screen the console
|
|
180
|
-
// routes itself, so it gets the page. Nothing above the console's directory is ever read.
|
|
181
|
-
#serve(response, path) {
|
|
182
|
-
const file = join(this.#files, normalize(`/${path}`));
|
|
183
|
-
if (!file.startsWith(this.#files + sep) || !existsSync(file) || statSync(file).isDirectory()) {
|
|
184
|
-
response.writeHead(200, { "content-type": TYPES[".html"], "cache-control": "no-store" });
|
|
185
|
-
response.end(this.#page());
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
response.writeHead(200, { "content-type": TYPES[extname(file)] ?? "application/octet-stream" });
|
|
189
|
-
createReadStream(file).pipe(response);
|
|
190
|
-
}
|
|
191
|
-
// Read on every request and not once: a console rebuilt while `ui` runs names new assets in a
|
|
192
|
-
// new page, and a person reloading should get it. The page is served for every screen the
|
|
193
|
-
// console routes itself, at any depth, so its assets are addressed from the base and not from
|
|
194
|
-
// wherever the address bar happens to stand.
|
|
195
|
-
#page() {
|
|
196
|
-
return readFileSync(join(this.#files, "index.html"), "utf8").replace("<head>", `<head><base href="/${this.#nonce}/">`);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
/** One JSON answer, whole. */
|
|
200
|
-
function json(response, status, body) {
|
|
201
|
-
response.writeHead(status, { "content-type": TYPES[".json"], "cache-control": "no-store" });
|
|
202
|
-
response.end(`${JSON.stringify(body)}\n`);
|
|
203
|
-
}
|
|
204
|
-
/** Every byte of a request's body, as one buffer. */
|
|
205
|
-
async function whole(request) {
|
|
206
|
-
const chunks = [];
|
|
207
|
-
for await (const chunk of request)
|
|
208
|
-
chunks.push(Buffer.from(chunk));
|
|
209
|
-
return Buffer.concat(chunks);
|
|
210
|
-
}
|
|
211
|
-
//# sourceMappingURL=server.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/cli/ui/server.ts"],"names":[],"mappings":"AAAA,wHAAwH;AAExH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/E,OAAO,EAAE,YAAY,EAA0D,MAAM,WAAW,CAAC;AAEjG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIvC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAElD,+FAA+F;AAC/F,0DAA0D;AAC1D,MAAM,QAAQ,GAAG,WAAW,CAAC;AAE7B,+FAA+F;AAC/F,6FAA6F;AAC7F,iGAAiG;AACjG,oGAAoG;AACpG,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB,gGAAgG;AAChG,2FAA2F;AAC3F,MAAM,KAAK,GAAG,KAAK,CAAC;AAEpB,iGAAiG;AACjG,4FAA4F;AAC5F,oDAAoD;AACpD,MAAM,GAAG,GAAG,KAAK,CAAC;AAElB,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,0BAA0B;IACnC,KAAK,EAAE,gCAAgC;IACvC,MAAM,EAAE,yBAAyB;IACjC,OAAO,EAAE,kBAAkB;IAC3B,MAAM,EAAE,kBAAkB;IAC1B,MAAM,EAAE,eAAe;IACvB,QAAQ,EAAE,YAAY;CACvB,CAAC;AAEF,+FAA+F;AAC/F,kFAAkF;AAClF,MAAM,SAAS,GAAG,CAAC,cAAc,EAAE,QAAQ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