Commit graph

64 commits

Author SHA1 Message Date
Your Name
684a89460f doc to prefer literal html injection 2026-08-08 17:57:14 -04:00
Your Name
465cc74796 docs 2026-08-08 16:28:12 -04:00
Your Name
dc947d16b9 inspector updates 2026-08-07 18:40:04 -04:00
Your Name
324f4abd4b this was suppsoed to just be the fuckin uhhhh encoding fix for notifs but its bigger than that so idk 2026-08-07 17:46:01 -04:00
Your Name
cda04f48ed Preserve child head content in HTMX embeds 2026-08-06 17:41:16 -04:00
Your Name
c8e50cb629 fix: retain child provenance in htmx page swaps 2026-08-06 17:08:17 -04:00
Your Name
e9f235505f fix: inspector reload hoepfully? 2026-08-06 16:46:48 -04:00
Your Name
ffba038b35 fix: restore inspector template hot reload 2026-08-06 16:37:42 -04:00
Your Name
cbbb87cd2e fix: uploader fix 2026-08-06 15:43:31 -04:00
Your Name
5299bd34ee feat: add current user to req 2026-08-06 14:36:21 -04:00
Your Name
48ac1249c8 feat: slideout editor new new new! 2026-08-03 01:24:54 -04:00
Your Name
c175a610da fix router stuff 2026-08-03 00:31:30 -04:00
Your Name
5bf756833d chore: incidental working-tree changes (not from the versioning work)
Changes already present in the working tree at the time of the versioning
commit, committed here so nothing is left dangling:

- index.js: template PUT preserves the untouched field (?? existing) and the
  preview handler tolerates a null/empty test_object
- update-deployed.sh: detect and restart a pm2-managed app process, and don't
  hard-fail when no bare Node process is found

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 00:27:31 -04:00
Your Name
42f4aacf7c feat: append-only version history + bliss CLI ergonomics
Snapshot the code-bearing fields of routes (verb/path/handler), templates
(name/content/test_object), and db libraries (name/library) on every
content-changing save, so nothing edited is ever lost. Recorded in a new
`versions` table via recordVersion() hooked into the create/update functions
in db.js (the single write choke point), deduped against the latest snapshot
so no-op saves, error-flag-only route writes, and server-restart WS
re-bootstraps don't pile up. The live row stays current; old snapshots are the
undo trail. Read-only, no revert UI yet.

- migrations/004_add_versions.sql: versions table + indexes
- db.js: recordVersion/getVersions/getVersion + create/update hooks
- plumbing.js: /versions/:id and per-entity .../versions list endpoints
- bliss: `versions <type> <sid> <id>` and `version <id>` reads;
  `update-settings` (edit route_prefix/head_injection, preserving the
  untouched field); `use <url>` sticky target persisted to ~/.bliss/target
  so BLISS_URL needn't be re-exported each call
- client.js: target-file precedence (BLISS_URL > ~/.bliss/target > localhost)
- SKILL.md: document the above

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 00:27:24 -04:00
Your Name
03a9d2143d Allow fetch in db library vm contexts
Db library scripts are basically a JS module scoped to the db, and
handlers already get fetch — but runLibrary's own vm context only
bound sql/console, so any library calling fetch (e.g. the chat db's
OpenAI call) threw ReferenceError. Since library calls are often
fire-and-forget inside setTimeout (no rejection handler), that
crashed the whole process. Bind fetch in all three places a library
script runs: request-time (runLibrary), the library-editor save eval,
and repl.

Also add `bliss link` to bliss-cli for jumping straight to a
structure/route/template/db's workshop editor URL, including
resolving a db by its require('db')(alias) name.
2026-08-02 23:19:24 -04:00
Your Name
44f345fff0 featchoremiscmiscmisc 2026-08-02 23:00:26 -04:00
Your Name
fb3d904f5b Merge branch 'refactor/simplify-render'
Simplify render pipeline, sandbox context, and db helpers; fix route
precedence so the most recently saved route wins.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-02 22:36:07 -04:00
Your Name
1add367621 chore: remove stray debug console.logs from createScaffoldPage
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-02 22:32:48 -04:00
Your Name
386e65fa88 refactor: use model.getRoute in the catch-all instead of raw SQL
The app.all("*") dispatcher hand-rolled a SELECT * FROM routes while
every other read goes through the model layer. Use model.getRoute for
consistency; the handler only reads structure_id/id/verb/handler, all
of which it returns.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-02 22:32:30 -04:00
Your Name
e45c890119 refactor: extract formatError/logError from repeated catch blocks
The `e.stack ? \`${e}\n\n${e.stack}\` : \`${e}\`` + createLog(...true)
pattern appeared in four catch blocks. Extract formatError(e) and
logError(structureId, routeId, e) and call them instead. Behavior and
the 500 response body are unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-02 22:31:59 -04:00
Your Name
de94d43e48 refactor: collapse five identical update builders into one update()
updateRoute/updateDb/updateStruct/updateTemplate/updateScaffoldPage
were the same UPDATE-by-id builder with a different table and field
list. Extract a single update(table, fields, obj) and express each as
a one-liner. (updateScaffoldPage's two stray debug console.logs went
away with the rewrite; it keeps its changes>0 return.)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-02 22:31:15 -04:00
Your Name
d34c917ef9 refactor: untangle bootstrapContext into makeConsole/makeLibs/runLibrary
Remove the shared-mutable-state dance where each db library was run in
the handler context via `context.sql = x; run; module.exports = null`.
Split into three single-purpose functions:

- makeConsole(structureId, routeId) — the logs-table-backed console
- runLibrary(sql, source, console) — eval one library in its own context
- makeLibs(structureId, console) — the require() targets map

Libraries are still evaluated eagerly per request (no laziness), and
still see `sql` and `console`, so behavior is preserved. Verified the
prime db library's top-level console.log still fires on a live request.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-02 22:30:34 -04:00
Your Name
d01f1411c5 fix: make the most recently saved route win on path conflicts
The matcher loop kept the last match instead of the first. Since
routes[verb] is ordered by updated_at DESC, that meant the OLDEST
route won when two routes matched the same path. Break on first
match so the most recently saved route wins.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-02 22:28:19 -04:00
Your Name
14f9ec3160 refactor: decompose render pipeline into decorate() + source value
Replace the one branchy bootstrapTemplateWithHTMXetc (six positional
args, five jobs) with small pure functions: headChrome, blissAttrs,
decoratePage, decorateFragment, and a decorate() entry point. The
route/clone/copy provenance triple becomes a single `source` value
({structureId, routeId, copyUrl}) threaded through render — the same
data the inspector roadmap needs.

Collapse the four copy-pasted render sites (res.render, ws.render,
template preview, scaffold preview) onto renderTemplate + decorate,
and dedupe the per-structure route() closure into makeRoute().

Emitted HTML (head chrome + data-bliss-* attributes) is unchanged;
verified full-page and htmx-fragment output.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-02 22:22:00 -04:00
Your Name
ae51fc763c chore: cleanup of code 2026-08-02 22:14:02 -04:00
HRG @ SCExC
28a441d98a feat: add route helper to handler context 2025-02-12 00:46:39 +09:00
HRG @ SCExC
9613188a1c chore: add ws htmx ext to vc 2025-02-12 00:41:58 +09:00
my name
8b68c8514b fix(temp?): dont add relative for no reason (hopefully) 2025-02-04 02:57:03 -05:00
my name
71a902a939 feat: add timeout stuff to handlers 2025-02-04 01:54:56 -05:00
my name
2c494d9c52 feat: add fetch to handlers 2025-02-04 00:23:03 -05:00
Your Name
91c1d30674 fix: try something claude said to see if we can get session in the ws req 2025-02-02 17:55:13 -05:00
Your Name
b8d3dbfa39 fix: catch errors in ws on handlers 2025-02-01 01:14:32 -05:00
Your Name
19a9d63d6c feat: add file lib to routes, abstract out file upload functionality 2025-02-01 01:14:32 -05:00
Your Name
a680ff9120 fix: don't rethrow exception
can't catch it there pal! crashes the server
2025-01-31 01:59:05 -05:00
Your Name
7e0025cfac chore: remove console logs 2025-01-21 18:14:15 -05:00
Your Name
308df5a5e6 feat: add persistent connections to ws 2025-01-21 18:13:31 -05:00
Your Name
c2f6d6b653 fix: get url prefix for ws redefinition 2025-01-21 02:38:24 -05:00
Your Name
a23aee5d21 feat: wip previews for non-get routes 2025-01-21 02:38:24 -05:00
Your Name
ee0b9e597a feat: support inspector on ws swapped elems 2025-01-20 12:53:52 -05:00
Your Name
df42cd8a8b feat: add ability to ws.render from websocket 2025-01-20 11:49:54 -05:00
Your Name
73779a32ad refactor: call ws stuff outside of vm script 2025-01-20 11:04:25 -05:00
HRG @ SCExC
445fa4803a chore: various gitignore fixes 2025-01-12 12:13:59 -05:00
HRG @ SCExC
c6fe03db7a feat: add web push 2025-01-12 12:07:08 -05:00
HRG @ SCExC
a7c679e610 fix: return 500 for exceptions 2025-01-12 11:56:17 -05:00
HRG @ SCExC
66911677f0 feat: support async handlers 2025-01-12 11:56:17 -05:00
HRG @ SCExC
9d625b0fd5 fix: updte templte fix, json bodyprser 2025-01-12 11:56:17 -05:00
HRG @ SCExC
00d62c5d42 chore: formatter 2025-01-12 11:56:17 -05:00
HRG @ SCExC
bf37f91a34 fix: register templte bug 2025-01-12 11:56:17 -05:00
HRG @ SCExC
38b9c0e538 fix: logs bug where it was repeating due to flaw in most recent id query 2025-01-12 11:56:17 -05:00
HRG @ SCExC
7a5a1a5e9d chore: format 2025-01-12 11:56:15 -05:00