~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0
main
Go to filet
Code
README.md

atlibs-web-editor-ui

Author, check and publish atlibs compositions: https://atlibs.socialweb.computer/

  • Open <handle>/<name> or at://… (@<cid> pins it); ?ref= in the URL does the same.
  • Each edit is checked against the com.fedfork.exec.composition lexicon, then loaded as both hosts load it (loadComposition: pins, hooks, parameters). Shown: instances, edges, hooks, parameters, exports, session scopes.
  • Add module <handle>/<module>: an instance at its at:// URI and pin.
  • Publish: putRecord as you (a swap on your own record's CID).
  • Bind to knotless repo: a com.fedfork.exec.binding at the repository's key (getRecord of its dev.knotless.repo), or self, pinning the opened composition by CID.

Run it:

git clone https://knotless.dev/johnandersen777.bsky.social/atlibs-web-editor-ui
cd atlibs-web-editor-ui
python3 -m http.server 8790 --bind 127.0.0.1   # http://127.0.0.1:8790/ (sign-in: the loopback client)

Test (headless Chrome; with ALICE_ATPROTO_HANDLE and ALICE_ATPROTO_PASSWORD, an app password, also a publish, bind and delete round as that account):

npm ci
node --test test/*.test.mjs

The example is written by compose.ts from atlibs.modules.js (atlibs add wrote it):

node compose.ts | diff - example.json
atlibs compose check example.json > /dev/null && echo loads

Deploy (scripts/deploy.sh: dist/ to the socialweb.computer gateway, a Caddy site):

cargo install --locked --git https://knotless.dev/johnandersen777.bsky.social/atlibs --rev 88b2ba8 atlibs
scripts/build.sh    # dist/ for https://atlibs.socialweb.computer/; another origin: scripts/build.sh https://host/path/
scripts/deploy.sh
whatfrom
@publicdomainrelay/atlibs 0.3.0jsdelivr (index.html import map; package-lock.json for compose.ts)
the example's compose moduleatlibs.lock.json (atlibs add bobvmbuilder.bsky.social/compose)
@atproto/oauth-client-browser 0.5.14, @atproto/lexicon 0.7.17, codemirror 6.0.2, @codemirror/lang-json 6.0.2esm.sh
lexicons/atlibs 88b2ba8 (v0.3.0), and com.atproto.repo.strongRef
the OAuth clientrecords/editor.json, staged by atlibs stage --target spa

Decisions:

  • Records store at:// URIs and pins; the editor shows <handle>/<name> (a handle verified both ways, else <did>/<name>). Inputs take <handle>/<name>, <did>/<name> or at://….
  • A module key resolves against the opened composition's publisher, else you. Publishing someone else's composition rewrites its keys to at:// URIs of theirs.
  • Added modules are pinned; the example pins every instance.
  • No listRecords: everything is a getRecord at a known key.