@augurworks/augur 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/CANVAS.md +858 -0
  2. package/INSTALL.md +603 -0
  3. package/LICENSE +27 -0
  4. package/README.md +150 -0
  5. package/TRADEMARKS.md +72 -0
  6. package/agents/README.md +65 -0
  7. package/agents/canon-extract.md +117 -0
  8. package/agents/canon.md +151 -0
  9. package/agents/canvas.md +88 -0
  10. package/agents/currency.md +74 -0
  11. package/agents/drafts.md +92 -0
  12. package/agents/identity.md +148 -0
  13. package/agents/prototype-contract.md +69 -0
  14. package/agents/publishing.md +324 -0
  15. package/agents/review-feedback.md +76 -0
  16. package/agents/space-json.md +132 -0
  17. package/agents/ui-skill.md +101 -0
  18. package/agents/working-marks.md +86 -0
  19. package/brand/augur-eye.svg +3 -0
  20. package/brand/augur-icon.svg +41 -0
  21. package/brand/augur-mark.svg +5 -0
  22. package/brand/lentianova-bulky.otf +0 -0
  23. package/brand/lentianova-median.otf +0 -0
  24. package/brand/lentianova.woff2 +0 -0
  25. package/build.js +8409 -0
  26. package/changelog.md +133 -0
  27. package/fonts/inter-latin-wght-normal.woff2 +0 -0
  28. package/package.json +57 -0
  29. package/pitis/PETS.md +121 -0
  30. package/pitis/README.md +117 -0
  31. package/pitis/index.html +266 -0
  32. package/pitis/piti.build.js +81 -0
  33. package/pitis/piti.js +929 -0
  34. package/pitis/roast-agent.md +185 -0
  35. package/realtime/src/index.js +119 -0
  36. package/realtime/wrangler.example.toml +44 -0
  37. package/scripts/adopt.mjs +106 -0
  38. package/scripts/board-snapshot.mjs +197 -0
  39. package/scripts/build-seed-pack.mjs +33 -0
  40. package/scripts/bundle-rekey.mjs +112 -0
  41. package/scripts/bundle-tenancy-rehearsal.mjs +781 -0
  42. package/scripts/canon-extract.mjs +578 -0
  43. package/scripts/canon.mjs +599 -0
  44. package/scripts/canvas-screen.mjs +333 -0
  45. package/scripts/check-local.mjs +136 -0
  46. package/scripts/clawd-art.mjs +75 -0
  47. package/scripts/clawd-canvas.mjs +741 -0
  48. package/scripts/cli.mjs +100 -0
  49. package/scripts/clone.mjs +422 -0
  50. package/scripts/close.mjs +30 -0
  51. package/scripts/connect.mjs +103 -0
  52. package/scripts/deploy.mjs +157 -0
  53. package/scripts/dev.mjs +54 -0
  54. package/scripts/doc-lint.mjs +143 -0
  55. package/scripts/export.mjs +300 -0
  56. package/scripts/fork.mjs +64 -0
  57. package/scripts/freeze.mjs +74 -0
  58. package/scripts/frontdoor-parity.mjs +180 -0
  59. package/scripts/hook.mjs +67 -0
  60. package/scripts/identity-rekey.mjs +112 -0
  61. package/scripts/init.mjs +122 -0
  62. package/scripts/land.mjs +40 -0
  63. package/scripts/lib/adapters.mjs +156 -0
  64. package/scripts/lib/board-snapshot.mjs +511 -0
  65. package/scripts/lib/draft.mjs +385 -0
  66. package/scripts/lib/graduate.mjs +276 -0
  67. package/scripts/lib/instance.mjs +74 -0
  68. package/scripts/lib/marks.mjs +107 -0
  69. package/scripts/lib/materialize.mjs +138 -0
  70. package/scripts/lib/merge3.mjs +124 -0
  71. package/scripts/lib/offline-posture.mjs +120 -0
  72. package/scripts/lib/offline-respawn.mjs +18 -0
  73. package/scripts/lib/offline-wrangler.mjs +78 -0
  74. package/scripts/lib/publish-compose.mjs +12 -0
  75. package/scripts/lib/publish-conflict.mjs +78 -0
  76. package/scripts/lib/publish-evidence.mjs +144 -0
  77. package/scripts/lib/refine-compare.mjs +140 -0
  78. package/scripts/lib/refine-ledger.mjs +150 -0
  79. package/scripts/lib/refine-png.mjs +149 -0
  80. package/scripts/lib/seed-pack-build.mjs +141 -0
  81. package/scripts/lib/state-compare.mjs +68 -0
  82. package/scripts/lib/store.mjs +122 -0
  83. package/scripts/login.mjs +84 -0
  84. package/scripts/mark.mjs +112 -0
  85. package/scripts/migrate-board-keys.mjs +164 -0
  86. package/scripts/migrate.mjs +265 -0
  87. package/scripts/no-foreign-vocabulary.mjs +216 -0
  88. package/scripts/no-product-names.mjs +157 -0
  89. package/scripts/no-tenant-globals.mjs +1134 -0
  90. package/scripts/offline.mjs +247 -0
  91. package/scripts/og.mjs +170 -0
  92. package/scripts/one-tenant-resolver.mjs +146 -0
  93. package/scripts/open.mjs +63 -0
  94. package/scripts/publish.mjs +1041 -0
  95. package/scripts/read.mjs +31 -0
  96. package/scripts/refine.mjs +455 -0
  97. package/scripts/release-drift.mjs +138 -0
  98. package/scripts/restore.mjs +322 -0
  99. package/scripts/review.mjs +125 -0
  100. package/scripts/save.mjs +21 -0
  101. package/scripts/shell-lint.mjs +189 -0
  102. package/scripts/ship.mjs +460 -0
  103. package/scripts/shoot.mjs +264 -0
  104. package/scripts/smoke-invite.mjs +113 -0
  105. package/scripts/state-inventory.mjs +223 -0
  106. package/scripts/status.mjs +177 -0
  107. package/scripts/sync.mjs +27 -0
  108. package/scripts/tenant-do-rehearsal.mjs +1314 -0
  109. package/scripts/ui-copy-lint.mjs +202 -0
  110. package/scripts/watch.mjs +32 -0
  111. package/scripts/wrangler-preflight.mjs +246 -0
  112. package/seed/CANON.md +43 -0
  113. package/seed/README.md +119 -0
  114. package/seed/prototype-status.json +9 -0
  115. package/seed/registry.json +88 -0
  116. package/seed/skills/starter-ui/SKILL.md +52 -0
  117. package/seed/skills/starter-ui/skill.json +11 -0
  118. package/seed/skills/starter-ui/starter-tokens.css +73 -0
  119. package/seed/skills/starter-ui/starter-ui.css +318 -0
  120. package/seed/skills/starter-ui/starter-ui.js +50 -0
  121. package/seed/space.json +5 -0
  122. package/seed/start-here/prototypes/connect-your-terminal/index.html +428 -0
  123. package/seed/start-here/prototypes/connect-your-terminal/preview.webp +0 -0
  124. package/seed/start-here/prototypes/sample-with-comments/index.html +172 -0
  125. package/seed/start-here/prototypes/sample-with-comments/preview.webp +0 -0
  126. package/seed/start-here/prototypes/set-up-your-design-system/index.html +353 -0
  127. package/seed/start-here/prototypes/set-up-your-design-system/preview.webp +0 -0
  128. package/seed/threads.json +52 -0
  129. package/seed/worked-examples/prototypes/field-readings/index.html +273 -0
  130. package/seed/worked-examples/prototypes/field-readings/preview.webp +0 -0
  131. package/seed/worked-examples/prototypes/slide-deck/index.html +214 -0
  132. package/seed/worked-examples/prototypes/slide-deck/preview.webp +0 -0
  133. package/seed/worked-examples/prototypes/specimen-viewer/index.html +203 -0
  134. package/seed/worked-examples/prototypes/specimen-viewer/preview.webp +0 -0
  135. package/src/_worker.js +12668 -0
  136. package/src/board-key.mjs +57 -0
  137. package/src/board-room.mjs +881 -0
  138. package/src/bundle-keys.mjs +138 -0
  139. package/src/canon/collect-in-browser.js +215 -0
  140. package/src/canon/emit.mjs +232 -0
  141. package/src/canon/observe.mjs +260 -0
  142. package/src/canon/schema.mjs +451 -0
  143. package/src/canvas/DSEG-LICENSE.txt +95 -0
  144. package/src/canvas/DSEG7Classic-Bold.woff2 +0 -0
  145. package/src/canvas/canvas.css +885 -0
  146. package/src/canvas/canvas.js +5780 -0
  147. package/src/canvas/capture.js +485 -0
  148. package/src/chrome/appchrome.mjs +568 -0
  149. package/src/currency.mjs +203 -0
  150. package/src/delete-confirmation.mjs +254 -0
  151. package/src/drafts/drafts.js +326 -0
  152. package/src/entry.js +58 -0
  153. package/src/galleries.mjs +400 -0
  154. package/src/health-cron.mjs +173 -0
  155. package/src/identity.json +1 -0
  156. package/src/kv-codec.mjs +135 -0
  157. package/src/kv-identity.mjs +259 -0
  158. package/src/mail.mjs +599 -0
  159. package/src/provenance.mjs +74 -0
  160. package/src/publish-compose.mjs +363 -0
  161. package/src/publish-fork.mjs +221 -0
  162. package/src/publish-units.mjs +44 -0
  163. package/src/purge.mjs +81 -0
  164. package/src/review/COMMENTING-UX.md +306 -0
  165. package/src/review/cat.png +0 -0
  166. package/src/review/comment-cursor.svg +7 -0
  167. package/src/review/comments.js +1738 -0
  168. package/src/room-ticket.mjs +96 -0
  169. package/src/roster-chip.mjs +32 -0
  170. package/src/seed-pack.mjs +261 -0
  171. package/src/state-inventory.mjs +249 -0
  172. package/src/sw-logic.mjs +48 -0
  173. package/src/tenant-cache.mjs +141 -0
  174. package/src/tenant-context.mjs +386 -0
  175. package/src/tenant-do.js +2940 -0
  176. package/src/tenant-host.mjs +144 -0
  177. package/src/tenant-quotas.mjs +140 -0
  178. package/src/unit-core.mjs +103 -0
  179. package/src/unit-object.mjs +338 -0
  180. package/templates/README.md +67 -0
  181. package/templates/shell/deploy.yml +145 -0
  182. package/templates/shell/engine-bump.yml +142 -0
  183. package/templates/shell/health.yml +233 -0
  184. package/templates/shell/kv-backup.yml +201 -0
  185. package/templates/shell/roster-update.yml +110 -0
  186. package/templates/shell/space-preflight.yml +35 -0
  187. package/templates/shell/space-rebake.yml +79 -0
  188. package/templates/shell/store-backup.yml +152 -0
  189. package/templates/shell/wrangler.example.toml +266 -0
  190. package/templates/space/publish.yml +91 -0
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env node
2
+ // build-seed-pack.mjs — build `dist/__seed/pack.json` by hand.
3
+ //
4
+ // node scripts/build-seed-pack.mjs [--out <dist>] [--print]
5
+ //
6
+ // build.js does this itself on every engine-only build (the deploy path); this is the same
7
+ // builder for a person who wants to see the document — `--print` writes the pack's summary
8
+ // (space, engine, files, threads) to stdout instead of the bytes. See
9
+ // scripts/lib/seed-pack-build.mjs for what the pack is and what it asserts.
10
+
11
+ import path from "node:path";
12
+ import { fileURLToPath } from "node:url";
13
+ import { buildSeedPack, writeSeedPack } from "./lib/seed-pack-build.mjs";
14
+
15
+ const ROOT = fileURLToPath(new URL("..", import.meta.url));
16
+ const argv = process.argv.slice(2);
17
+ const opt = (n) => { const i = argv.indexOf(n); return i > -1 && argv[i + 1] ? argv[i + 1] : null; };
18
+
19
+ const summary = (pack) => ({
20
+ format: pack.format, engine: pack.engine, space: pack.space.id,
21
+ files: Object.keys(pack.files).length,
22
+ prototypes: (pack.routing.publicPrefixes || []).length,
23
+ threads: Object.values(pack.threads).reduce((n, l) => n + l.length, 0),
24
+ connectCommandFile: pack.connectCommandFile,
25
+ });
26
+
27
+ if (argv.includes("--print")) {
28
+ console.log(JSON.stringify(summary(buildSeedPack({ engineRoot: ROOT })), null, 2));
29
+ } else {
30
+ const dist = path.resolve(opt("--out") || path.join(ROOT, "dist"));
31
+ const { file, pack } = writeSeedPack(dist, { engineRoot: ROOT });
32
+ console.error(`[seed-pack] wrote ${path.relative(process.cwd(), file)} — ${JSON.stringify(summary(pack))}`);
33
+ }
@@ -0,0 +1,112 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * augur bundle-rekey — move a live workspace's published content onto the workspace
4
+ * segment, one page at a time, without an account credential.
5
+ *
6
+ * augur bundle-rekey what WOULD move (a dry run; the default)
7
+ * augur bundle-rekey --confirm <workspace> move it
8
+ * augur bundle-rekey --confirm <ws> --families spaces,config,assets
9
+ *
10
+ * `B-bundle-store-tenancy`. The store's keys now carry the workspace on a deployment that
11
+ * resolves one from the Host (`bundleKey` in src/_worker.js). A deployment that starts
12
+ * WRITING `t/<workspace>/…` does not thereby start reading what it wrote yesterday: the
13
+ * unprefixed keys stay where they are, and there is deliberately no read-through fallback
14
+ * to them, because an unprefixed key on a shared bucket belongs to whichever workspace the
15
+ * deployment served before the segment existed and nothing in the key says which. So a
16
+ * live workspace is MOVED, and this is the command that moves it.
17
+ *
18
+ * WHY THIS IS NOT `augur migrate`, and it is structural rather than a missing flag.
19
+ * `migrate` is origin-addressed — it writes INTO a workspace over `/__publish/*` and cannot
20
+ * name a key — and a restore lands every space at v1, so re-keying by exporting and
21
+ * restoring into the same workspace would strand the whole version history under the old
22
+ * prefix and start the new one at one. `rollback` would then reach nothing. This copies
23
+ * KEYS, so the history comes with it.
24
+ *
25
+ * ⚠️ IT IS A COPY AND NEVER A CUT. Nothing is deleted. That is what makes it safe to
26
+ * interrupt, safe to re-run, and what keeps `BUNDLE_TENANCY`'s per-family flag a revert:
27
+ * flip the word back and the unprefixed answer is still there. Reclaiming the originals is
28
+ * a separate act for after somebody has looked.
29
+ *
30
+ * ⚠️ IT IS CORRECT FOR EXACTLY ONE WORKSPACE PER DEPLOYMENT, and the worker refuses rather
31
+ * than trusting this script about it: a bucket that already holds a second workspace prefix
32
+ * answers `not-the-only-workspace`, because there the unprefixed keys cannot be said to be
33
+ * anybody's.
34
+ *
35
+ * WHAT DOES NOT MOVE, and must not: `blobs/` and `spaces/_engine/`. Both are shared across
36
+ * every workspace on the deployment by decision — the blob namespace is content-addressed
37
+ * and deduplicated, the engine chrome is one build serving everyone — so both are already
38
+ * at the key every workspace reads them at. The run reports them as `shared`.
39
+ *
40
+ * RUN IT BEHIND A FREEZE (`augur freeze`). `/__publish/` writes are refused while frozen and
41
+ * the `_state/*` routes are exempt, so a re-key runs with no publish racing it. Reads and
42
+ * sign-in are unaffected, so the site stays up for the whole move.
43
+ *
44
+ * Exit 0 when the move is complete (or was already), 1 on a refusal.
45
+ */
46
+ import { target, apiClient } from "./lib/store.mjs";
47
+
48
+ const log = (m) => console.error(`\x1b[36m[bundle-rekey]\x1b[0m ${m}`);
49
+ const die = (m) => { log(m); process.exit(1); };
50
+
51
+ const args = process.argv.slice(2);
52
+ const opt = (f) => { const i = args.indexOf(f); return i >= 0 ? args[i + 1] : null; };
53
+ const CONFIRM = opt("--confirm");
54
+ const FAMILIES = (opt("--families") || "").split(",").map((s) => s.trim()).filter(Boolean);
55
+ const MAX_PAGES = Number(opt("--max-pages")) > 0 ? Number(opt("--max-pages")) : 200;
56
+
57
+ let origin, token;
58
+ try { ({ origin, token } = target()); } catch (e) { die(e.message); }
59
+ const req = apiClient(origin, token);
60
+
61
+ const call = async (body) => {
62
+ const res = await req("_state/rekey", {
63
+ method: "POST",
64
+ headers: { "content-type": "application/json" },
65
+ body: JSON.stringify(body),
66
+ });
67
+ let out;
68
+ try { out = await res.json(); } catch (e) { die(`${origin} answered ${res.status} with something that is not JSON`); }
69
+ if (!out.ok) {
70
+ if (out.reason === "not-the-only-workspace") {
71
+ die(`${origin} refused: this bucket already holds another workspace (${(out.others || []).join(", ")}).`
72
+ + ` An unprefixed key there belongs to nobody in particular, so nothing may claim it.`);
73
+ }
74
+ if (out.reason === "confirm-mismatch") die(`${origin} refused: --confirm must be "${out.expected}"`);
75
+ die(`${origin} refused: ${out.reason}`);
76
+ }
77
+ return out;
78
+ };
79
+
80
+ const base = { ...(FAMILIES.length ? { families: FAMILIES } : {}) };
81
+
82
+ // The dry run always happens, confirmed or not: the number it prints is what the caller
83
+ // gets to check before anything is written, and after a real run it is the receipt.
84
+ const plan = await call(base);
85
+ if (plan.reason === "no-segment") {
86
+ log(`${origin} serves one workspace and writes no segment — there is nothing to move.`);
87
+ process.exit(0);
88
+ }
89
+ log(`${origin} — workspace ${plan.workspace} → ${plan.segment}`);
90
+ log(`families ${plan.families.join(", ")}; ${plan.considered} object(s) considered, `
91
+ + `${plan.skipped} already there, ${plan.shared} deliberately shared (blobs/ and spaces/_engine/)`);
92
+
93
+ if (!CONFIRM) {
94
+ const left = plan.copied + plan.pending;
95
+ if (!left) { log("\x1b[32mnothing to move\x1b[0m — this workspace is already on the segment"); process.exit(0); }
96
+ log(`\x1b[33mwould copy ${left} object(s)\x1b[0m`);
97
+ for (const k of plan.keys) console.log(` ${k}`);
98
+ if (plan.keys.length < left) console.log(` … and ${left - plan.keys.length} more`);
99
+ console.log("\x1b[2mre-run with --confirm <workspace> to move them; nothing is ever deleted\x1b[0m");
100
+ process.exit(0);
101
+ }
102
+
103
+ let copied = 0, bytes = 0, pages = 0;
104
+ for (;;) {
105
+ const out = await call({ ...base, confirm: CONFIRM });
106
+ copied += out.copied; bytes += out.bytes; pages++;
107
+ if (out.copied) log(`page ${pages}: ${out.copied} copied (${(bytes / 1e6).toFixed(2)} MB so far)`);
108
+ if (out.done) break;
109
+ if (pages >= MAX_PAGES) die(`stopped after ${MAX_PAGES} pages with work left — re-run to continue`);
110
+ }
111
+ log(`\x1b[32mdone\x1b[0m — ${copied} object(s) copied, ${(bytes / 1e6).toFixed(2)} MB`);
112
+ console.log("\x1b[2mthe originals are untouched: this is a copy, and it is what the per-family revert reads\x1b[0m");