@gusto/baerly-storage 0.1.0
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.
- package/README.md +97 -0
- package/dist/API.md +850 -0
- package/dist/app-config-Cb5dO2s9.d.ts +480 -0
- package/dist/app-config.d.ts +2 -0
- package/dist/app-config.js +8 -0
- package/dist/app-config.js.map +1 -0
- package/dist/auth.d.ts +237 -0
- package/dist/auth.js +1335 -0
- package/dist/auth.js.map +1 -0
- package/dist/baerly.js +761 -0
- package/dist/baerly.js.map +1 -0
- package/dist/bucket-uri-BrDEYvzy.js +4922 -0
- package/dist/bucket-uri-BrDEYvzy.js.map +1 -0
- package/dist/chunk-EAsCxrDo.js +14 -0
- package/dist/client-BLf3Ae5s.d.ts +233 -0
- package/dist/client-react.d.ts +131 -0
- package/dist/client-react.js +559 -0
- package/dist/client-react.js.map +1 -0
- package/dist/client.d.ts +4 -0
- package/dist/client.js +160 -0
- package/dist/client.js.map +1 -0
- package/dist/cloudflare-CINJPKCW.js +911 -0
- package/dist/cloudflare-CINJPKCW.js.map +1 -0
- package/dist/cloudflare.d.ts +211 -0
- package/dist/cloudflare.js +445 -0
- package/dist/cloudflare.js.map +1 -0
- package/dist/config-Bsg8wgwo.js +198 -0
- package/dist/config-Bsg8wgwo.js.map +1 -0
- package/dist/context-Oj7ffwD-.js +187 -0
- package/dist/context-Oj7ffwD-.js.map +1 -0
- package/dist/cost-B1WiZxlf.js +203 -0
- package/dist/cost-B1WiZxlf.js.map +1 -0
- package/dist/current-json-BkatBzF7.js +252 -0
- package/dist/current-json-BkatBzF7.js.map +1 -0
- package/dist/db-D62JguBc.d.ts +336 -0
- package/dist/deploy-BB-wqbhf.js +83 -0
- package/dist/deploy-BB-wqbhf.js.map +1 -0
- package/dist/dev-banner-CWHIk8tH.d.ts +26 -0
- package/dist/dev-vite.d.ts +146 -0
- package/dist/dev-vite.js +223 -0
- package/dist/dev-vite.js.map +1 -0
- package/dist/dev.d.ts +3 -0
- package/dist/dev.js +2 -0
- package/dist/doctor-B8h9GCN9.js +331 -0
- package/dist/doctor-B8h9GCN9.js.map +1 -0
- package/dist/dump-BHo_sIMZ.js +116 -0
- package/dist/dump-BHo_sIMZ.js.map +1 -0
- package/dist/errors-DOdL95kK.js +58 -0
- package/dist/errors-DOdL95kK.js.map +1 -0
- package/dist/export-Dz2PZKSR.js +423 -0
- package/dist/export-Dz2PZKSR.js.map +1 -0
- package/dist/fsck-DEz9lyCy.js +293 -0
- package/dist/fsck-DEz9lyCy.js.map +1 -0
- package/dist/http-CjUO1Bec.js +1756 -0
- package/dist/http-CjUO1Bec.js.map +1 -0
- package/dist/http.d.ts +1619 -0
- package/dist/http.js +2 -0
- package/dist/index-BGC-ENnj.d.ts +1065 -0
- package/dist/index-BYv0hb8M.d.ts +1457 -0
- package/dist/index-BquQkhJi.d.ts +112 -0
- package/dist/index-COsQ-Mlz.d.ts +146 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/indexes-BXn7a06a.js +297 -0
- package/dist/indexes-BXn7a06a.js.map +1 -0
- package/dist/indexes-DwOXkn1Y.d.ts +22 -0
- package/dist/inspect-x02aFWnh.js +149 -0
- package/dist/inspect-x02aFWnh.js.map +1 -0
- package/dist/log-walk-DIru96UT.js +260 -0
- package/dist/log-walk-DIru96UT.js.map +1 -0
- package/dist/maintenance-Bn6ul9aV.js +758 -0
- package/dist/maintenance-Bn6ul9aV.js.map +1 -0
- package/dist/maintenance.d.ts +323 -0
- package/dist/maintenance.js +2 -0
- package/dist/node.d.ts +422 -0
- package/dist/node.js +2 -0
- package/dist/normalize-XWY25_sG.js +133 -0
- package/dist/normalize-XWY25_sG.js.map +1 -0
- package/dist/observability-2IDYRuZK.js +2333 -0
- package/dist/observability-2IDYRuZK.js.map +1 -0
- package/dist/observability.d.ts +3 -0
- package/dist/observability.js +3 -0
- package/dist/plan-Cs17VqjU.js +224 -0
- package/dist/plan-Cs17VqjU.js.map +1 -0
- package/dist/query-DcSbFLJt.js +1880 -0
- package/dist/query-DcSbFLJt.js.map +1 -0
- package/dist/rebuild-index-C5gTXryd.js +119 -0
- package/dist/rebuild-index-C5gTXryd.js.map +1 -0
- package/dist/rebuild-index-DwXM0WfA.js +104 -0
- package/dist/rebuild-index-DwXM0WfA.js.map +1 -0
- package/dist/request-BEF_OvMh.js +72 -0
- package/dist/request-BEF_OvMh.js.map +1 -0
- package/dist/restore-CbKVMMpm.js +847 -0
- package/dist/restore-CbKVMMpm.js.map +1 -0
- package/dist/shared-secret-BJdSwpgw.js +71 -0
- package/dist/shared-secret-BJdSwpgw.js.map +1 -0
- package/dist/snapshot-D7C4_FSl.js +71 -0
- package/dist/snapshot-D7C4_FSl.js.map +1 -0
- package/dist/snapshot-z_N9hpTe.js +917 -0
- package/dist/snapshot-z_N9hpTe.js.map +1 -0
- package/dist/src-Chafbw8r.js +522 -0
- package/dist/src-Chafbw8r.js.map +1 -0
- package/dist/src-DyET_VPP.js +6199 -0
- package/dist/src-DyET_VPP.js.map +1 -0
- package/dist/src-n0Te1r98.js +352 -0
- package/dist/src-n0Te1r98.js.map +1 -0
- package/dist/subcommand-BWs6K7zb.js +110 -0
- package/dist/subcommand-BWs6K7zb.js.map +1 -0
- package/dist/usage-RVUQMLop.js +339 -0
- package/dist/usage-RVUQMLop.js.map +1 -0
- package/dist/validate-DhH1lO8I.js +377 -0
- package/dist/validate-DhH1lO8I.js.map +1 -0
- package/dist/wire-izfGZDvr.js +7 -0
- package/dist/wire-izfGZDvr.js.map +1 -0
- package/package.json +189 -0
package/README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# baerly-storage
|
|
2
|
+
|
|
3
|
+
**Storage is the missing primitive for agent-built software, and all you need is a library.**
|
|
4
|
+
|
|
5
|
+
> _Currently a private Gusto preview, published as `@gusto/baerly-storage` to Gusto's private npm registry._
|
|
6
|
+
|
|
7
|
+
`baerly-storage` is a library that turns an S3-compatible bucket into a document database. So small that all coordination — fencing, commit, compaction, garbage collection — runs inside the HTTP request that triggered it: no daemon, no leader, no service bill, no on-call. The only persistent component is your bucket.
|
|
8
|
+
|
|
9
|
+
~100 KB gzipped on the server, ~5 KB gzipped in the browser. Zero services to run, and a kernel is small enough that an LLM can hold the whole `.d.ts` in context.
|
|
10
|
+
|
|
11
|
+
[S3 is does the hard parts](https://aws.amazon.com/blogs/aws/amazon-s3-update-strong-read-after-write-consistency/), `baerly-storage` is the coordination that fixes the API. Document model, live queries, snapshot isolation — the whole surface in a `.d.ts` an LLM can use zero-shot.
|
|
12
|
+
|
|
13
|
+
The apps LLMs spit out by the dozen don't deserve Postgres + Docker + a pager; they deserve this.
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
Compute → FaaS
|
|
17
|
+
Tokens → LLM API
|
|
18
|
+
Storage → this.
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## The whole backend
|
|
22
|
+
|
|
23
|
+
```diff
|
|
24
|
+
- docker-compose.yml
|
|
25
|
+
- init.sql
|
|
26
|
+
- prisma/schema.prisma
|
|
27
|
+
- migrations/0001_initial.sql
|
|
28
|
+
- RLS policies
|
|
29
|
+
- DATABASE_URL secret
|
|
30
|
+
- connection pool (pgbouncer)
|
|
31
|
+
- pager rotation
|
|
32
|
+
-
|
|
33
|
+
+ // baerly.config.ts
|
|
34
|
+
+ export default defineConfig({
|
|
35
|
+
+ app: "tickets",
|
|
36
|
+
+ collections: { tickets: {} },
|
|
37
|
+
+ target: "cloudflare",
|
|
38
|
+
+ });
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Your data lives in your bucket. The entire public surface fits in `.d.ts` files — no DDL, no SQL strings, no migrations to chase across deploys.
|
|
42
|
+
|
|
43
|
+
## In code
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
// server — writes land in your R2 bucket
|
|
47
|
+
await db.collection("tickets")
|
|
48
|
+
.insert({ title: "Onboard Alex", status: "open" });
|
|
49
|
+
|
|
50
|
+
// client — live across every open tab
|
|
51
|
+
const { rows } = useLiveQuery<Ticket>({
|
|
52
|
+
collection: "tickets",
|
|
53
|
+
where: { status: "open" },
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Why?
|
|
58
|
+
|
|
59
|
+
- **An API an LLM can use first try.** The whole public surface fits in
|
|
60
|
+
`.d.ts` files. No DDL. No raw SQL. Discriminated string errors.
|
|
61
|
+
Provisioning is `pnpm install`, not a cloud-console detour. Verified
|
|
62
|
+
with zero-shot eval suites.
|
|
63
|
+
- **Idle rounds to zero.** No $5/mo floors multiplied across forty
|
|
64
|
+
abandoned internal tools the loop produced last quarter. The runtime
|
|
65
|
+
is a rounding error against the bucket.
|
|
66
|
+
- **No hostage situation.** Log entries are shaped like Postgres
|
|
67
|
+
logical-replication messages. `baerly export --target=postgres`
|
|
68
|
+
graduates you out, mechanically, on the day an app outgrows this.
|
|
69
|
+
|
|
70
|
+
## Quick start
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
pnpm create @gusto/baerly-storage@latest -- my-app --target=cloudflare
|
|
74
|
+
cd my-app && pnpm install && pnpm dev
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
`pnpm dev` boots Vite + workerd on `:5173`, so `/v1/*` and the React UI share one origin. For `--target=node`, it's `:3000` over `LocalFsStorage` — no S3 creds needed.
|
|
78
|
+
|
|
79
|
+
Production deploys: anywhere `node server.js` runs — Railway, Render, Fly, Docker, bare VMs, on-prem boxes.
|
|
80
|
+
|
|
81
|
+
For a runnable multi-tab demo see [`examples/react-node/`](./examples/react-node); for the full set of production-shaped scaffolds see [`examples/`](./examples).
|
|
82
|
+
|
|
83
|
+
## Go deeper
|
|
84
|
+
|
|
85
|
+
- 📖 **The essay** — [*Storage Is the Missing Primitive for Agent-Built Software*](https://docs.google.com/document/d/1jpMR-dV9wCprtzY2DUxAg_NZTrAf81OcB_vxKhiCPQ0/edit?tab=t.vo58xtzxjwr) [TODO: Replace with external link on publish]
|
|
86
|
+
- 🧱 **Product thesis** — [`docs/about/thesis.md`](./docs/about/thesis.md)
|
|
87
|
+
- 🏗️ **Architecture** — [`docs/contributing/architecture.md`](./docs/contributing/architecture.md)
|
|
88
|
+
- 🔧 **Embed by hand** — [`docs/guide/embed.md`](./docs/guide/embed.md) (drop baerly into any existing Node app in ~30 lines)
|
|
89
|
+
|
|
90
|
+
## Where things live
|
|
91
|
+
|
|
92
|
+
- [`CLAUDE.md`](./CLAUDE.md) — agent + contributor entry point (the
|
|
93
|
+
fastest map for humans too). `AGENTS.md` is a symlink.
|
|
94
|
+
- [`docs/README.md`](./docs/README.md) — topic map: architecture,
|
|
95
|
+
conventions, ADRs, protocol specs, operating procedures.
|
|
96
|
+
- [`examples/`](./examples) — runnable scaffolds + the `react-node/`
|
|
97
|
+
multi-tab demo.
|