@agent-play/sdk 3.3.2 → 3.3.5
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 +11 -0
- package/dist/browser-da9E-kSP.d.ts +1120 -0
- package/dist/browser.d.ts +2 -1
- package/dist/browser.js +97 -3
- package/dist/chunk-BCDEUIYP.js +5180 -0
- package/dist/chunk-BCDEUIYP.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +120 -15
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/browser-BQR40I8R.d.ts +0 -480
- package/dist/chunk-WWIEHWZZ.js +0 -649
- package/dist/chunk-WWIEHWZZ.js.map +0 -1
package/README.md
CHANGED
|
@@ -4,6 +4,17 @@ Node.js SDK for **Agent Play**: register agents, stream world state, and call th
|
|
|
4
4
|
|
|
5
5
|
**Incremental world sync** — After `connect()`, call **`getWorldSnapshot()`** for a full parse, or **`subscribeWorldState()`** to follow SSE **`playerChainNotify`** (stable keys + leaf indices) and merge each slice with **`getPlayerChainNode`** using **`mergeSnapshotWithPlayerChainNode`**. Pure merge/parse helpers are exported for custom transports. Server fanout previously carried **`playerChainDelta`** (per-leaf digests); it is now **`playerChainNotify`** + serialized node RPC — a breaking change for anyone parsing Redis payloads or custom SSE clients.
|
|
6
6
|
|
|
7
|
+
**3.1.1 — amenity content & wallets** — New Zod schemas and helpers describe the server-authoritative content owned by a space and the per-player wallet that funds purchases:
|
|
8
|
+
|
|
9
|
+
- **`SaleStateSchema`** — `{ status: 'available' | 'sold', soldToPlayerId?, soldAt? }`.
|
|
10
|
+
- **`ShopItemSchema`** / **`SupermarketItemSchema`** / **`CarWashCarSchema`** — three amenity-content kinds, each carrying a `sale` block.
|
|
11
|
+
- **`PlayerWalletSchema`** + **`createInitialPlayerWallet(playerId, now)`** + **`DEFAULT_PLAYER_WALLET_BALANCE_USD`** (`70`) — every player's wallet is lazily seeded at $70 on first read.
|
|
12
|
+
- **`PurchaseRecordSchema`** — append-only audit row for each completed purchase.
|
|
13
|
+
- **`isItemAvailableForPurchase(item)`** — pure helper consumed by the `purchase` RPC and the play-ui renderers.
|
|
14
|
+
- **`desaturateColor(hex)`** — luminance-preserving grey conversion used to render sold sprites.
|
|
15
|
+
|
|
16
|
+
All are re-exported from the package root (`@agent-play/sdk`) and the browser entry (`@agent-play/sdk/browser`). See [docs/aql/language-reference.md](https://github.com/wilforlan/agent-play/blob/main/docs/aql/language-reference.md) for the AQL surface that writes them and the [3.1.1 release notes](https://github.com/wilforlan/agent-play/blob/main/docs/releases/agent-play-3.1.1.md) for the full flow.
|
|
17
|
+
|
|
7
18
|
## Documentation
|
|
8
19
|
|
|
9
20
|
- **[Repository](https://github.com/wilforlan/agent-play)** — source and monorepo layout
|