@nimbus-sh/platform 0.2.0 → 0.3.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.
@@ -1,4 +1,28 @@
1
- /** Shared composition state for core workspaces and the process fabric. */
1
+ /**
2
+ * composition.ts — the ONE seam an embedder wires the fabric through.
3
+ *
4
+ * The fabric mints supervisor bindings and assembles staged boots for the
5
+ * programs it hosts, but the entrypoint class that answers those bindings
6
+ * and the artifact sources a stage names both belong to the embedder. The
7
+ * embedder states them once, in its composition root, with one call:
8
+ *
9
+ * composeFabric({
10
+ * supervisorEntrypoint: 'SupervisorRPC',
11
+ * stagedBootAssembler: (env, stage) => assembleConfig(env, stage),
12
+ * });
13
+ *
14
+ * First-write-wins, like every holder in this module: the composition
15
+ * root's module scope runs once per isolate, before any request.
16
+ *
17
+ * `ctx.exports` is runtime state, not composition: workerd mints it per
18
+ * instance, so the embedder captures it where the platform hands it over —
19
+ * the first fetch, or the DO constructor — with {@link adoptCtxExports}.
20
+ *
21
+ * This module stays a leaf (no fabric imports) so helpers (notably
22
+ * isolate-pool.ts) can read `ctx.exports` without transitively importing
23
+ * the Durable Object classes, which is what lets the pool be unit-tested
24
+ * in a plain Node/Bun process.
25
+ */
2
26
  export type EntrypointLoopbackFactory = <Stub = unknown>(options: {
3
27
  props: object;
4
28
  }) => Stub;
@@ -1 +1 @@
1
- {"version":3,"file":"composition.d.ts","sourceRoot":"","sources":["../src/composition.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,MAAM,MAAM,yBAAyB,GAAG,CAAC,IAAI,GAAG,OAAO,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,KAAK,IAAI,CAAC;AAC7F,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,yBAAyB,GAAG,SAAS,CAAC,CAAC;AAC/E,MAAM,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAA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,CAAC;AAEpF,MAAM,WAAW,iBAAiB;IAChC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,gEAAgE;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AACvD,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAI3D,8EAA8E;AAC9E,wBAAgB,aAAa,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAE5D;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAEvD;AAED,wBAAgB,aAAa,IAAI,UAAU,GAAG,IAAI,CAEjD;AAED,wBAAgB,oBAAoB,CAAC,UAAU,CAAC,EAAE,OAAO,GAAG,yBAAyB,GAAG,IAAI,CAO3F;AAED,wBAAgB,wBAAwB,IAAI,MAAM,GAAG,IAAI,CAExD;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED,wBAAgB,mBAAmB,IAAI,mBAAmB,CASzD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nimbus-sh/platform",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "The measured Cloudflare platform truths Nimbus is built on — error taxonomy, limits tables, budget coordination, and wire-format primitives, with zero runtime dependencies.",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -1,4 +1,28 @@
1
- /** Shared composition state for core workspaces and the process fabric. */
1
+ /**
2
+ * composition.ts — the ONE seam an embedder wires the fabric through.
3
+ *
4
+ * The fabric mints supervisor bindings and assembles staged boots for the
5
+ * programs it hosts, but the entrypoint class that answers those bindings
6
+ * and the artifact sources a stage names both belong to the embedder. The
7
+ * embedder states them once, in its composition root, with one call:
8
+ *
9
+ * composeFabric({
10
+ * supervisorEntrypoint: 'SupervisorRPC',
11
+ * stagedBootAssembler: (env, stage) => assembleConfig(env, stage),
12
+ * });
13
+ *
14
+ * First-write-wins, like every holder in this module: the composition
15
+ * root's module scope runs once per isolate, before any request.
16
+ *
17
+ * `ctx.exports` is runtime state, not composition: workerd mints it per
18
+ * instance, so the embedder captures it where the platform hands it over —
19
+ * the first fetch, or the DO constructor — with {@link adoptCtxExports}.
20
+ *
21
+ * This module stays a leaf (no fabric imports) so helpers (notably
22
+ * isolate-pool.ts) can read `ctx.exports` without transitively importing
23
+ * the Durable Object classes, which is what lets the pool be unit-tested
24
+ * in a plain Node/Bun process.
25
+ */
2
26
  export type EntrypointLoopbackFactory = <Stub = unknown>(options: { props: object }) => Stub;
3
27
  export type CtxExports = Record<string, EntrypointLoopbackFactory | undefined>;
4
28
  export type StagedBootAssembler = (env: unknown, stage: unknown) => Promise<object>;