diff --git a/.gitignore b/.gitignore index e5dc11d..4923d39 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ node_modules -.venv .DS_Store dbs .env diff --git a/bliss-cli/live-editor/artifact-editor.eta b/bliss-cli/live-editor/artifact-editor.eta deleted file mode 100644 index 7e5c1a8..0000000 --- a/bliss-cli/live-editor/artifact-editor.eta +++ /dev/null @@ -1,57 +0,0 @@ -
-
- <% if (it.kind === 'route') { %><%= it.artifact.verb %> <%= it.artifact.path %><% } else { %><%= it.artifact.name %><% } %> - <%= it.kind %> -
-
- <% if (it.kind === 'route' && it.artifact.verb !== 'GET') { %> -

Saving does not replay this <%= it.artifact.verb %> route.

- <% } %> - -
<%= it.kind === 'route' ? it.artifact.handler : it.artifact.content %>
- <% if (it.kind === 'template') { %> -
- Rendering test -
<%= it.artifact.test_object || '' %>
- -
- <% } %> - -
-
- diff --git a/bliss-cli/live-editor/inspector.js b/bliss-cli/live-editor/inspector.js deleted file mode 100644 index b4f228d..0000000 --- a/bliss-cli/live-editor/inspector.js +++ /dev/null @@ -1,3 +0,0 @@ -function handler(req, res) { - res.render("inspector/slideout", {}); -} diff --git a/bliss-cli/live-editor/install.js b/bliss-cli/live-editor/install.js deleted file mode 100644 index 9ca0487..0000000 --- a/bliss-cli/live-editor/install.js +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env node - -// Install/update the live editor using Bliss's public CLI workflow. This file -// intentionally does not open the Bliss database directly. -const { spawnSync } = require("node:child_process"); -const path = require("node:path"); - -const repo = path.resolve(__dirname, "../.."); -const cli = path.join(repo, "bliss-cli/bliss"); - -function bliss(...args) { - const result = spawnSync(process.execPath, [cli, ...args], { - cwd: repo, - env: process.env, - encoding: "utf8", - }); - if (result.status !== 0) throw new Error(result.stderr || result.stdout); - return result.stdout.trim(); -} - -function json(...args) { - return JSON.parse(bliss(...args)); -} - -const structures = json("structures"); -let structure = structures.find((item) => item.name === "__bliss_live_editor"); -if (!structure) { - const created = json("create-structure", "__bliss_live_editor"); - structure = { id: created.id }; -} - -const structureId = String(structure.id); -bliss("update-settings", structureId, "--route-prefix", "/_bliss"); -let state = json("structure", structureId); -if (!state.dbs.some((db) => String(db.id) === "0" && db.alias === "bliss")) { - bliss("attach-db", structureId, "0", "bliss"); -} - -const templates = [ - ["inspector/slideout", "slideout.eta"], - ["inspector/route_editor", "route-editor.eta"], - ["inspector/template_editor", "template-editor.eta"], - ["inspector/artifact_editor", "artifact-editor.eta"], -]; -for (const [name, filename] of templates) { - let template = state.templates.find((item) => item.name === name); - if (!template) { - template = json("create-template", structureId, name); - } - bliss( - "update-template", - structureId, - String(template.id), - "--content-file", - path.join(__dirname, filename), - ); -} - -const routes = [ - ["/inspector", "inspector.js"], - ["/editor/route/:id", "route-editor.js"], - ["/editor/template/:id", "template-editor.js"], -]; -for (const [routePath, filename] of routes) { - let route = state.routes.find( - (item) => item.verb === "GET" && item.path === routePath, - ); - if (!route) { - route = json("create-route", structureId, "GET", routePath); - } - bliss( - "update-route", - structureId, - String(route.id), - "--handler-file", - path.join(__dirname, filename), - ); -} - -console.log(`live editor installed as Structure ${structureId}`); diff --git a/bliss-cli/live-editor/route-editor.eta b/bliss-cli/live-editor/route-editor.eta deleted file mode 100644 index 212859e..0000000 --- a/bliss-cli/live-editor/route-editor.eta +++ /dev/null @@ -1,28 +0,0 @@ -
-
<%= it.sourceRoute.verb %> <%= it.sourceRoute.path %>
- <% if (it.sourceRoute.verb !== "GET") { %> -
Rerunning this <%= it.sourceRoute.verb %> request can repeat writes or external side effects. Bliss will not rerun it automatically.
- <% } %> -
<%= it.sourceRoute.handler %>
- -
- diff --git a/bliss-cli/live-editor/route-editor.js b/bliss-cli/live-editor/route-editor.js deleted file mode 100644 index 85e2cb9..0000000 --- a/bliss-cli/live-editor/route-editor.js +++ /dev/null @@ -1,7 +0,0 @@ -function handler(req, res) { - const sql = require("db")("bliss").sql; - const kind = "route"; - const artifact = sql.prepare("SELECT * FROM routes WHERE id = ?").get(req.params.id); - if (!artifact) return res.status(404).send("Route not found"); - res.render("inspector/artifact_editor", { kind, artifact }); -} diff --git a/bliss-cli/live-editor/slideout.eta b/bliss-cli/live-editor/slideout.eta deleted file mode 100644 index e3fe878..0000000 --- a/bliss-cli/live-editor/slideout.eta +++ /dev/null @@ -1,200 +0,0 @@ - - diff --git a/bliss-cli/live-editor/template-editor.eta b/bliss-cli/live-editor/template-editor.eta deleted file mode 100644 index f2aa49d..0000000 --- a/bliss-cli/live-editor/template-editor.eta +++ /dev/null @@ -1,25 +0,0 @@ -
-
<%= it.sourceTemplate.name %>
-
<%= it.sourceTemplate.content %>
- -
- diff --git a/bliss-cli/live-editor/template-editor.js b/bliss-cli/live-editor/template-editor.js deleted file mode 100644 index 00843a1..0000000 --- a/bliss-cli/live-editor/template-editor.js +++ /dev/null @@ -1,7 +0,0 @@ -function handler(req, res) { - const sql = require("db")("bliss").sql; - const kind = "template"; - const artifact = sql.prepare("SELECT * FROM templates WHERE id = ?").get(req.params.id); - if (!artifact) return res.status(404).send("Template not found"); - res.render("inspector/artifact_editor", { kind, artifact }); -} diff --git a/chat-rearchitecture.md b/chat-rearchitecture.md deleted file mode 100644 index ffb64aa..0000000 --- a/chat-rearchitecture.md +++ /dev/null @@ -1,558 +0,0 @@ -# Chat Rearchitecture — "AIM 2005" edition - -> Living design doc **and** build log. Section 1–8 is the plan; Section 10 is the -> running notes I update as I build. Keep it honest: record what actually -> happened, not what was supposed to. - ---- - -## 0. Prime directive (read this first) - -**We are building fun interfaces at the expense of security and safety.** This is -a hypermedia playground, not a hardened product. Concretely: - -- **Messages may contain arbitrary HTML/JS and we render it unescaped, forever.** - `<%~ it.content %>` (Eta raw) stays. A message can ` -