Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Working on Jeview

Jeview is a local gateway for Jev (TypeSafe System One) with a live viewer. To *use* a running Jeview, read
Jeview is a local visualizer for Jev (TypeSafe System One): a gateway your code sends its calls through, with a live
viewer. It is unofficial, and not affiliated with TypeSafe AI. To *use* a running Jeview, read
[llms.txt](llms.txt), or `/llms.txt` on the Jeview itself. This file is for changing the code.

## The lie of the land
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

> Agents: [llms.txt](llms.txt) says how to use a running Jeview, and [AGENTS.md](AGENTS.md) how to work on this repository.

An unofficial local middleman for Jev ([TypeSafe](https://typesafe.ai) System One), with a live view of every call.
Jeview is an independent project: it is not made or endorsed by TypeSafe.
An unofficial local visualizer for Jev ([TypeSafe](https://typesafe.ai) System One): a live view of every call your code
makes. Jeview is an independent project. It is not affiliated with TypeSafe AI, nor made or endorsed by it.

```
your code → Jeview (127.0.0.1:4777) → TypeSafe (api.typesafe.ai)
Expand Down
1 change: 1 addition & 0 deletions demo/pixel-knight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ const server = createServer((req, res) => {
}
res.writeHead(404).end();
});
server.on("error", (error: NodeJS.ErrnoException) => { console.error(error.code === "EADDRINUSE" ? `Port ${port} is already in use. If Pixel Knight is already running, open http://127.0.0.1:${port}/; otherwise start this one on another port: --port ${port + 1}` : `Pixel Knight could not start: ${error.message}`); process.exit(1); });
server.listen(port, "127.0.0.1", () => console.log(`Pixel Knight: open http://127.0.0.1:${port}/ to watch Jev play (through ${url}). Ctrl-C stops it.`));
process.on("SIGINT", () => process.exit(0));
process.on("SIGTERM", () => process.exit(0));
Expand Down
1 change: 1 addition & 0 deletions demo/support-desk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ const server = createServer((req, res) => {
}
res.writeHead(404).end();
});
server.on("error", (error: NodeJS.ErrnoException) => { console.error(error.code === "EADDRINUSE" ? `Port ${port} is already in use. If Support Desk is already running, open http://127.0.0.1:${port}/; otherwise start this one on another port: --port ${port + 1}` : `Support Desk could not start: ${error.message}`); process.exit(1); });
server.listen(port, "127.0.0.1", () => console.log(`Support Desk: open http://127.0.0.1:${port}/ to watch Jev triage the inbox (through ${url}). Ctrl-C stops it.`));
process.on("SIGINT", () => process.exit(0));
process.on("SIGTERM", () => process.exit(0));
Expand Down
4 changes: 3 additions & 1 deletion jeview.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jeview: a local middleman for Jev with a live view of every call (README.md).
// Jeview: a local visualizer for Jev, with a live view of every call (README.md).
// node jeview.ts [--port 4777] [--dir ~/.local/share/jeview]
// Open http://127.0.0.1:4777/, add your Jev key (the key icon), and send Jev requests to http://127.0.0.1:4777/v1/systemone
// (or /<label>/v1/systemone) instead of https://api.typesafe.ai/v1/systemone. --jev-endpoint points it at a local mock.
Expand All @@ -12,4 +12,6 @@ const port = Number(values.port);
if (!Number.isInteger(port) || port < 1 || port > 65535) throw Error("Usage: node jeview.ts [--port 4777] [--dir ~/.local/share/jeview] [--jev-endpoint URL]");
const { server, store } = createJeview({ dir: values.dir, port, ...(values["jev-endpoint"] ? { jevEndpoint: values["jev-endpoint"] } : {}) });
for (const signal of ["SIGINT", "SIGTERM"] as const) process.once(signal, () => { server.close(); process.exit(0); });
// a port that is taken, most often by a Jeview already running, is said in a sentence
server.on("error", (error: NodeJS.ErrnoException) => { console.error(error.code === "EADDRINUSE" ? `Port ${port} is already in use. If Jeview is already running, open http://127.0.0.1:${port}/; otherwise start this one on another port: --port ${port + 1}` : `Jeview could not start: ${error.message}`); process.exit(1); });
server.listen(port, "127.0.0.1", () => console.log(JSON.stringify({ viewer: `http://127.0.0.1:${port}/`, send_jev_requests_to: `http://127.0.0.1:${port}/v1/systemone`, jev_key: store.setting("jevKey") ? "set" : "not set: add it in the viewer (the key icon, top right)", database: store.database, recorded: store.count() })));
2 changes: 1 addition & 1 deletion llms.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Jeview

A local middleman for Jev (TypeSafe System One) at http://127.0.0.1:4777, with a live view of every call at http://127.0.0.1:4777/
An unofficial local visualizer for Jev (TypeSafe System One) at http://127.0.0.1:4777, with a live view of every call at http://127.0.0.1:4777/
It is a gateway, not a model: it sits between a Jev client and TypeSafe and answers nothing itself. Each request it
receives goes on to Jev with the Jev key set in the viewer, Jev's answer goes back to the caller, and the call is kept
whole (what was asked, what Jev saw, what it answered) in a SQLite database on this machine. Nothing is stored anywhere
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "jeview",
"version": "0.1.0",
"private": true,
"description": "An unofficial local middleman for Jev (TypeSafe), with a live view of every call.",
"description": "An unofficial local visualizer for Jev (TypeSafe), with a live view of every call.",
"license": "MIT",
"repository": { "type": "git", "url": "git+https://github.com/andududu/jeview.git" },
"type": "module",
Expand Down
4 changes: 2 additions & 2 deletions src/jeview.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jeview: a local middleman for Jev with a live view of every call (README.md). A client sends its Jev requests
// Jeview: a local visualizer for Jev, with a live view of every call (README.md). A client sends its Jev requests
// here exactly as it would to TypeSafe (POST /v1/systemone, or /<label>/v1/systemone to group requests); the proxy
// calls Jev with the key set in the viewer (without a key, calls are refused), answers the client with
// Jev's answer, and keeps each call whole in a private SQLite database. Loopback only: calls can hold private data.
Expand Down Expand Up @@ -201,7 +201,7 @@ function keyChange(req: IncomingMessage, body: Buffer): string | null {
export function llmsText(origin: string, keyed: boolean): string {
return `# Jeview

A local middleman for Jev (TypeSafe System One) at ${origin}, with a live view of every call at ${origin}/
An unofficial local visualizer for Jev (TypeSafe System One) at ${origin}, with a live view of every call at ${origin}/
It is a gateway, not a model: it sits between a Jev client and TypeSafe and answers nothing itself. Each request it
receives goes on to Jev with the Jev key set in the viewer, Jev's answer goes back to the caller, and the call is kept
whole (what was asked, what Jev saw, what it answered) in a SQLite database on this machine. Nothing is stored anywhere
Expand Down
2 changes: 1 addition & 1 deletion ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<div id="about-panel" class="popover" hidden>
<p class="eyebrow">What Jeview is</p>
<p class="quiet">A middleman between your code and Jev. Your requests come here instead of going to TypeSafe; Jeview sends each one on with your key, hands Jev's answer back, and keeps a copy to show you. It answers nothing itself.</p>
<p class="quiet">A visualizer for Jev that sits between your code and TypeSafe. Your requests come here instead of going to TypeSafe; Jeview sends each one on with your key, hands Jev's answer back, and keeps a copy to show you. It answers nothing itself.</p>
<p class="eyebrow">Send Jev requests here</p>
<p class="line"><code id="run-line">http://127.0.0.1:4777/v1/systemone</code><button class="ghost small" data-copy="run-line">Copy</button></p>
<p class="quiet">The same requests and answers as TypeSafe's address, with no key needed. To group requests under a project or label, add it to the path: <code>/&lt;label&gt;/v1/systemone</code>.</p>
Expand Down
Loading