1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# atlibs-web-editor-ui
Author, check and publish [atlibs](https://knotless.dev/johnandersen777.bsky.social/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:
```sh
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):
```sh
npm ci
node --test test/*.test.mjs
```
The example is written by `compose.ts` from `atlibs.modules.js` (`atlibs add` wrote it):
```sh
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):
```sh
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
```
| what | from |
|---|---|
| `@publicdomainrelay/atlibs` 0.3.0 | jsdelivr (`index.html` import map; `package-lock.json` for `compose.ts`) |
| the example's `compose` module | `atlibs.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.2 | esm.sh |
| `lexicons/` | atlibs 88b2ba8 (v0.3.0), and `com.atproto.repo.strongRef` |
| the OAuth client | `records/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.