@joiner-platform/cli 0.1.14 → 0.1.16

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@joiner-platform/cli",
3
- "version": "0.1.14",
4
- "gitHead": "2384b73b316818de7b9d10700bef32a0833096cc",
3
+ "version": "0.1.16",
4
+ "gitHead": "232db36a9e3d77c44fb2d44e40f52f6e82263b1e",
5
5
  "description": "The Joiner CLI: create, test, and publish Joiner tiles, with agent skills for coding agents.",
6
6
  "keywords": [
7
7
  "joiner",
@@ -5,7 +5,7 @@ description: "Build apps that USE synced-store for real-time multiplayer state.
5
5
 
6
6
  # Synced-Store Reference
7
7
 
8
- Real-time sync engine (like Replicache). Each app instance = one server-side SQLite DB + per-client IndexedDB copies. Mutators run optimistically on the client and authoritatively on the server. Actions run server-only (randomness). Neither mutators nor actions can make HTTP requests: the backend runtime's `fetch` throws. Outbound work goes through `ctx.platform.call(...)` for platform services and `ctx.externalStore(...)` / `ctx.mutateExternal(...)` for other stores; neither gives general HTTP access.
8
+ Real-time sync engine (like Replicache). Each app instance = one server-side SQLite DB + per-client IndexedDB copies. Mutators run optimistically on the client and authoritatively on the server. Actions run server-only (randomness). Neither mutators nor actions can make HTTP requests: the backend runtime's `fetch` throws. Outbound work goes through `ctx.platform.call(...)` for platform services and `ctx.mutateExternal(...)` (mutators) / `ctx.externalStore(...)` (actions) for other stores; neither gives general HTTP access.
9
9
 
10
10
  - Mutators and actions are portable store code, not normal browser/Node code: mutators run on the client and then on the backend, and actions run on the backend. Backend execution happens in a special store-function runtime where ambient timer APIs such as `setTimeout` / `clearTimeout` are not available.
11
11
  - Never change a row you read. `get`, `scan` and `entries` on the client return the object the local cache holds, so an in-place edit (`row.step++`, `row.cells[i].owner = id`, `row.items.push(x)`) corrupts local state even without a `set`, while the server's pass reads a fresh copy and the two diverge. Write a new value instead: `set({ itemKey, value: { ...row, step: row.step + 1 } })`. Read types mark top-level properties `readonly`; nested objects and arrays are not checked, so copy those too.
@@ -1,6 +1,6 @@
1
1
  # External Stores: Cross-App Reads & Writes
2
2
 
3
- Mutators and actions can interact with other store instances on the server. Mutators can write via `ctx.mutateExternal(...)`; mutators and actions can read via `ctx.externalStore(...)`. Receiving code identifies the caller via `ctx.source`.
3
+ Mutators and actions can interact with other store instances on the server. Mutators can write via `ctx.mutateExternal(...)`; actions can read via `ctx.externalStore(...)`. Mutators cannot read another store. Receiving code identifies the caller via `ctx.source`.
4
4
 
5
5
  ## External Mutations (Writes)
6
6
 
@@ -42,24 +42,27 @@ await store.mutate.notifyParent({
42
42
  ### Constraints
43
43
 
44
44
  - Max 200 unique external mutation targets per commit (each target = `(storeTypeId, instanceId)` pair; multiple mutations to the same target count as one)
45
- - Max depth of 1 — target mutators cannot trigger further external **writes** (`blockExternalMutations: true`). External **reads** are not affected
45
+ - Max depth of 1 — target mutators cannot trigger further external **writes** (`blockExternalMutations: true`)
46
46
  - External mutations expire after 5 minutes if not committed
47
47
 
48
48
  ## External Reads
49
49
 
50
- A mutator or action can read from another store using `ctx.externalStore({ storeTypeId, instanceId })`. The handle exposes `.table(name)` with `get`, `scan`, and `entries` (read-only).
50
+ An action can read from another store using `ctx.externalStore({ storeTypeId, instanceId })`. The handle exposes `.table(name)` with `get`, `scan`, and `entries` (read-only).
51
+
52
+ A mutator that needs another store's data gets it from that store instead: the other store sends it with `ctx.mutateExternal(...)`, and the receiving mutator trusts it because `ctx.source` names the sender. Send any data that decides whether a write is allowed (membership, ownership, a permission) this way.
53
+
54
+ An action can also read another store and pass the result to a mutator with `ctx.mutate`, but that input carries no trust: clients can call the same mutator directly with any input. Use this path only for data the mutator would accept from the caller anyway, never to gate a write.
51
55
 
52
56
  ```typescript
53
- // In a mutator or action:
57
+ // In an action:
54
58
  const ext = ctx.externalStore({ storeTypeId: "emoji-prefs", instanceId: ctx.userId });
55
59
  const favorites = await ext.table("preferences").get("favorites");
56
60
  const recent = await ext.table("entries").scan({ limit: 50 }).values().toArray();
57
61
  ```
58
62
 
59
- In actions, the handle also exposes `.action(name, input)` and `.getSchema()`.
63
+ The handle also exposes `.action(name, input)` and `.getSchema()`.
60
64
 
61
65
  ```typescript
62
- // In an action only:
63
66
  const ext = ctx.externalStore({ storeTypeId: "chat", instanceId: "room-1" });
64
67
  const result = await ext.action("summarize", { limit: 100 });
65
68
  const schema = await ext.getSchema();
@@ -67,8 +70,7 @@ const schema = await ext.getSchema();
67
70
 
68
71
  ### Reads vs writes
69
72
 
70
- - **Server-only path**: on the client, `ctx.externalStore(...).table(...).get(...)` is a no-op stub that returns empty results. Don't depend on optimistic external reads
71
- - **No depth limit**: reads are stateless (no commits, no broadcasts, no retries) and are allowed inside external dispatch targets and action-invoked mutators — unlike writes
73
+ - **No depth limit**: reads are stateless (no commits, no broadcasts, no retries), so an action may read any store its authorization allows — unlike writes
72
74
  - **Bounded**: a single scan/list returns at most `MAX_EXTERNAL_READ_ITEMS` (1000) and `MAX_EXTERNAL_READ_BYTES` (1 MB). Response carries a `truncated` flag when limits were hit
73
75
  - **Timeout**: `EXTERNAL_READ_TIMEOUT_MS` = 5s for the dispatch RPC
74
76
 
@@ -307,7 +307,7 @@ import { MAX_TABLE_PAGE_CURSOR_LENGTH } from "joiner-sdk/v1/shared.js";
307
307
 
308
308
  - `EntryKey` has a required `itemKey` and optional `sortKey`. Within a table, `itemKey` identifies the row; `sortKey` controls ordering, not identity.
309
309
  - `ExternalStoreTableReader<T>` is a read-only table interface without `pageByItemKey`. Its `getWithStoreVersion(key)` returns `{ value, storeVersion, synced }`: the value and target store version come from the same snapshot, even when the row is absent. `synced` indicates whether the target has completed at least one sync.
310
- - In a mutator or action, an external `scan` (`ctx.externalStore(...)`) reads one target snapshot per response. A scan with a `limit` gets up to 1,000 rows (and at most 1,048,576 bytes of JSON-serialized rows) per response; a scan without one gets 100 rows per response. If the target commits between two responses of the same scan, the scan throws a version conflict. To read a whole bounded table consistently, pass its maximum row count as the `limit`.
310
+ - In an action, an external `scan` (`ctx.externalStore(...)`) reads one target snapshot per response. A scan with a `limit` gets up to 1,000 rows (and at most 1,048,576 bytes of JSON-serialized rows) per response; a scan without one gets 100 rows per response. If the target commits between two responses of the same scan, the scan throws a version conflict. To read a whole bounded table consistently, pass its maximum row count as the `limit`.
311
311
 
312
312
  Server current-store table handles expose `pageByItemKey(options)`, using
313
313
  `TablePageOptions`: required `maxPhysicalRows` (a positive safe integer) and
@@ -61,7 +61,7 @@ an older pin, so prefer the live result when upgrading:
61
61
 
62
62
  <!-- begin: sdk-tarball-snippet (auto-generated by packages/poe-tiles-sdk/scripts/publish-tar.ts — do not edit by hand) -->
63
63
  ```json
64
- "joiner-sdk": "https://misc-dev-uploads.quora-913.workers.dev/0cce8e521c3b44a86a55176966d2c1c735f32017f73d8cf5bc413bb6dde3d851"
64
+ "joiner-sdk": "https://misc-dev-uploads.quora-913.workers.dev/76306b6900592a9e0611bab2f46560b798c65ed8af6737a05c650acf17d59ac7"
65
65
  ```
66
66
  <!-- end: sdk-tarball-snippet -->
67
67
 
@@ -20,7 +20,7 @@ A tile cannot reach a host the creator chooses, anywhere its code runs. Direct a
20
20
 
21
21
  | Need | Use |
22
22
  | --- | --- |
23
- | Talk to another tile's store | `ctx.externalStore({ storeTypeId, instanceId })` for reads and, in actions, `.action(name, input)`; `ctx.mutateExternal(...)` for writes from mutators (see [external stores](../../synced-store/references/external-stores.md)) |
23
+ | Talk to another tile's store | `ctx.externalStore({ storeTypeId, instanceId })` in actions for reads and `.action(name, input)`; `ctx.mutateExternal(...)` for writes from mutators (see [external stores](../../synced-store/references/external-stores.md)) |
24
24
  | Read deployment settings | `env.get` |
25
25
  | Open a web page for the user | `Poe.openExternalUrl({ url })` from client code (the user confirms any destination outside the platform) |
26
26
 
@@ -1,4 +1,4 @@
1
1
  // Auto-generated by poe-tiles-sdk/scripts/publish-tar.ts — do not edit
2
- // publishedAt: 2026-11-25T23:52:23.100Z
2
+ // publishedAt: 2026-11-30T15:21:52.061Z
3
3
  export const SDK_TARBALL_URL =
4
- "https://misc-dev-uploads.quora-913.workers.dev/0cce8e521c3b44a86a55176966d2c1c735f32017f73d8cf5bc413bb6dde3d851";
4
+ "https://misc-dev-uploads.quora-913.workers.dev/76306b6900592a9e0611bab2f46560b798c65ed8af6737a05c650acf17d59ac7";