@crowdedkingdoms/crowdyjs 8.22.0 → 10.0.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.
Files changed (95) hide show
  1. package/MIGRATION.md +66 -0
  2. package/README.md +111 -7
  3. package/dist/crowdy-client.d.ts +3 -0
  4. package/dist/crowdy-client.d.ts.map +1 -1
  5. package/dist/crowdy-client.js +2 -0
  6. package/dist/domains/playerCodeProjects.d.ts +25 -0
  7. package/dist/domains/playerCodeProjects.d.ts.map +1 -0
  8. package/dist/domains/playerCodeProjects.js +299 -0
  9. package/dist/domains/playerCompute.d.ts +1 -1
  10. package/dist/domains/playerCompute.js +1 -1
  11. package/dist/generated/graphql.d.ts +792 -7
  12. package/dist/generated/graphql.d.ts.map +1 -1
  13. package/dist/generated/graphql.js +57 -0
  14. package/dist/index.d.ts +3 -5
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +3 -5
  17. package/dist/kit/npcs.d.ts.map +1 -1
  18. package/dist/kit/social.d.ts.map +1 -1
  19. package/dist/live-coding/assets/browser-authoring-index.json +1 -0
  20. package/dist/live-coding/assets/manifest.json +19 -0
  21. package/dist/live-coding/assets/tree-sitter-rust.wasm +0 -0
  22. package/dist/live-coding/assets/web-tree-sitter.wasm +0 -0
  23. package/dist/live-coding/browser-authoring-index.generated.d.ts +2 -0
  24. package/dist/live-coding/browser-authoring-index.generated.d.ts.map +1 -0
  25. package/dist/live-coding/browser-authoring-index.generated.js +5127 -0
  26. package/dist/live-coding/lsp-protocol.d.ts +98 -0
  27. package/dist/live-coding/lsp-protocol.d.ts.map +1 -0
  28. package/dist/live-coding/lsp-protocol.js +70 -0
  29. package/dist/live-coding/monaco-services.d.ts +22 -0
  30. package/dist/live-coding/monaco-services.d.ts.map +1 -0
  31. package/dist/live-coding/monaco-services.js +69 -0
  32. package/dist/live-coding/platform-index.d.ts +29 -0
  33. package/dist/live-coding/platform-index.d.ts.map +1 -0
  34. package/dist/live-coding/platform-index.js +281 -0
  35. package/dist/live-coding/rust-analysis.d.ts +24 -0
  36. package/dist/live-coding/rust-analysis.d.ts.map +1 -0
  37. package/dist/live-coding/rust-analysis.js +375 -0
  38. package/dist/live-coding/rust-lsp-server.d.ts +43 -0
  39. package/dist/live-coding/rust-lsp-server.d.ts.map +1 -0
  40. package/dist/live-coding/rust-lsp-server.js +455 -0
  41. package/dist/live-coding/rust-lsp.worker.d.ts +2 -0
  42. package/dist/live-coding/rust-lsp.worker.d.ts.map +1 -0
  43. package/dist/live-coding/rust-lsp.worker.js +26 -0
  44. package/dist/live-coding/vfs.d.ts +41 -0
  45. package/dist/live-coding/vfs.d.ts.map +1 -0
  46. package/dist/live-coding/vfs.js +174 -0
  47. package/dist/live-coding/worker-transport.d.ts +63 -0
  48. package/dist/live-coding/worker-transport.d.ts.map +1 -0
  49. package/dist/live-coding/worker-transport.js +217 -0
  50. package/dist/mod-studio/controller.d.ts +188 -0
  51. package/dist/mod-studio/controller.d.ts.map +1 -0
  52. package/dist/mod-studio/controller.js +915 -0
  53. package/dist/mod-studio/diagnostics.d.ts +22 -0
  54. package/dist/mod-studio/diagnostics.d.ts.map +1 -0
  55. package/dist/mod-studio/diagnostics.js +141 -0
  56. package/dist/mod-studio/dom-shell.d.ts +55 -0
  57. package/dist/mod-studio/dom-shell.d.ts.map +1 -0
  58. package/dist/mod-studio/dom-shell.js +527 -0
  59. package/dist/mod-studio/editor.d.ts +17 -0
  60. package/dist/mod-studio/editor.d.ts.map +1 -0
  61. package/dist/mod-studio/editor.js +1 -0
  62. package/dist/mod-studio/index.d.ts +10 -0
  63. package/dist/mod-studio/index.d.ts.map +1 -0
  64. package/dist/mod-studio/index.js +9 -0
  65. package/dist/mod-studio/models.d.ts +149 -0
  66. package/dist/mod-studio/models.d.ts.map +1 -0
  67. package/dist/mod-studio/models.js +62 -0
  68. package/dist/mod-studio/monaco-editor.d.ts +16 -0
  69. package/dist/mod-studio/monaco-editor.d.ts.map +1 -0
  70. package/dist/mod-studio/monaco-editor.js +548 -0
  71. package/dist/mod-studio/mount.d.ts +17 -0
  72. package/dist/mod-studio/mount.d.ts.map +1 -0
  73. package/dist/mod-studio/mount.js +86 -0
  74. package/dist/mod-studio/starter-projects.d.ts +11 -0
  75. package/dist/mod-studio/starter-projects.d.ts.map +1 -0
  76. package/dist/mod-studio/starter-projects.js +102 -0
  77. package/dist/mod-studio/styles.d.ts +2 -0
  78. package/dist/mod-studio/styles.d.ts.map +1 -0
  79. package/dist/mod-studio/styles.js +14 -0
  80. package/dist/mod-studio/textarea-editor.d.ts +8 -0
  81. package/dist/mod-studio/textarea-editor.d.ts.map +1 -0
  82. package/dist/mod-studio/textarea-editor.js +71 -0
  83. package/package.json +18 -6
  84. package/dist/live-coding/ide.d.ts +0 -16
  85. package/dist/live-coding/ide.d.ts.map +0 -1
  86. package/dist/live-coding/ide.js +0 -399
  87. package/dist/live-coding/live-coding-controller.d.ts +0 -75
  88. package/dist/live-coding/live-coding-controller.d.ts.map +0 -1
  89. package/dist/live-coding/live-coding-controller.js +0 -141
  90. package/dist/live-coding/mount.d.ts +0 -26
  91. package/dist/live-coding/mount.d.ts.map +0 -1
  92. package/dist/live-coding/mount.js +0 -108
  93. package/dist/live-coding/templates.d.ts +0 -17
  94. package/dist/live-coding/templates.d.ts.map +0 -1
  95. package/dist/live-coding/templates.js +0 -59
package/MIGRATION.md CHANGED
@@ -1,3 +1,69 @@
1
+ # CrowdyJS v10 — project-first Mod Studio (BREAKING)
2
+
3
+ This migration is implemented on the feature branch but is **not versioned or
4
+ published yet**.
5
+
6
+ The session-only live-coding API was removed. There are deliberately no
7
+ compatibility aliases.
8
+
9
+ Removed exports:
10
+
11
+ - `mountLiveCodingIDE`
12
+ - `mountLiveCoding`
13
+ - `LiveCodingController`
14
+ - `MountLiveCodingOptions`
15
+ - `PLAYER_CODE_TEMPLATES` / `templateById`
16
+ - the `moduleName` and `draftByDefault` mount options
17
+ - the `@crowdedkingdoms/crowdyjs/live-coding` package subpath
18
+
19
+ Replace the old mount with a cloud project provider and the new subpath:
20
+
21
+ ```ts
22
+ import { mountModStudio } from '@crowdedkingdoms/crowdyjs/mod-studio';
23
+
24
+ const studio = await mountModStudio(host, {
25
+ projectProvider: game.playerCodeProjects,
26
+ playerCompute: game.playerCompute,
27
+ playerWallet: identity.playerWallet,
28
+ appId,
29
+ gridId,
30
+ grid,
31
+ workerUrl: playerCodeGlueWorkerUrl,
32
+ onHostCall,
33
+ });
34
+ ```
35
+
36
+ Custom UIs instantiate `ModStudioController` directly. Move all source state
37
+ into `ModStudioProjectProvider`: project files are typed
38
+ `{ target: 'SERVER' | 'CLIENT', path, content }`, and full-stack files share one
39
+ revision/save. Module names and pairing preference are project settings.
40
+ Do not stringify source maps in callers; Mod Studio creates `sourceFilesJson`
41
+ only at the existing `playerCompute.deploy` wire boundary.
42
+
43
+ Action semantics are now explicit:
44
+
45
+ - **Test draft** saves atomically, compiles, and runs with draft egress rules.
46
+ - **Deploy live** saves and runs the live project.
47
+ - **Stop project** attempts `setEnabled(false)`, client broker shutdown, and
48
+ polling cleanup, and returns partial failures instead of hiding them.
49
+
50
+ Full-stack order is CLIENT compile → SERVER compile → `setRequires` (only after
51
+ both succeed) → SERVER enable → exact-version CLIENT artifact hot-swap.
52
+
53
+ The local Rust worker remains credential-free and server-free. Monaco now uses
54
+ target-prefixed URIs and loads project, personal-library, and common Rust files
55
+ for cross-file completion/hover/symbols/definition. If Monaco/Worker/WASM fails,
56
+ `mountModStudio` keeps a target/file-aware textarea inside the same project UI;
57
+ there is no standalone fallback API.
58
+
59
+ The Game API project contract is exposed through `PlayerCodeProjectsAPI`.
60
+ Generated operations cover `playerCodeProjects`, `playerCodeProject`,
61
+ `playerCodeProjectCreate`, `playerCodeProjectSave`,
62
+ `playerCodeLibraryFiles`, `playerCodeLibrarySave`,
63
+ `playerCodeCommonFiles`, and `playerCodeProjectImportFile`.
64
+
65
+ This branch is versioned `10.0.0` for the coordinated major release.
66
+
1
67
  # CrowdyJS v8.10 Notes
2
68
 
3
69
  ## Added
package/README.md CHANGED
@@ -32,10 +32,11 @@ CrowdyJS v4 targets browsers by default and uses native `fetch`, `WebSocket`, `c
32
32
  >
33
33
  > **Player-code authoring DX:** `playerCompute.setRequires`,
34
34
  > `marketplace.trustGridAuthor`, self-authored `gridClientMods` fields, and
35
- > attachment-keyed client artifact fetches require the 2026-07-22 authoring-DX
36
- > migration. `mountLiveCodingIDE` lazy-loads Monaco and rust-analyzer LSP support
37
- > when given an authenticated language-service URL and app-token getter; without
38
- > them it preserves the dependency-free textarea fallback.
35
+ > version-keyed client artifact fetches require the 2026-07-22 authoring-DX
36
+ > migration. The v9 `mountModStudio` surface is project-first: cloud project
37
+ > revisions, target-scoped files, atomic autosave, and explicit draft/live/stop
38
+ > orchestration. Its Rust language worker receives source plus the committed
39
+ > platform index only—never a credential and never a server connection.
39
40
 
40
41
  > **v8.10 inventory authority:** generated craft/barter transactions work on
41
42
  > existing Model servers. Compute-refereed durable commits require Compute SDK
@@ -64,6 +65,21 @@ accepts explicit sources.) Commit `schema.gql` and `src/generated/graphql.ts`
64
65
  together whenever the public GraphQL surface changes; `npm run check:schema`
65
66
  detects drift in CI/release work.
66
67
 
68
+ The browser authoring index follows the same boundary. `npm run build` validates
69
+ only the committed internal `src/live-coding/assets/browser-authoring-index.json` and its
70
+ generated TypeScript copy; it never discovers or reads a sibling game-api
71
+ checkout. Coordinated maintainers compare an explicitly supplied exporter path:
72
+
73
+ ```bash
74
+ npm run authoring-index:drift -- --source /path/to/browser-authoring-index.json
75
+ # To accept that exact source, then regenerate the committed TypeScript:
76
+ npm run authoring-index:drift -- --source /path/to/browser-authoring-index.json --write
77
+ npm run authoring-index:generate
78
+ ```
79
+
80
+ The drift command rejects a missing `--source`; cross-repository orchestration,
81
+ not standalone package build or tests, owns that comparison.
82
+
67
83
  ## Quick start
68
84
 
69
85
  ```ts
@@ -124,6 +140,7 @@ If `managementUrl` is omitted, the SDK falls back to `httpUrl` for backwards-com
124
140
  | `client.gameModel` | Abstract game model: containers, properties, functions (incl. model-driven `notify_*` effects), sessions, and **automations / NPCs** (`upsertAutomation`, `runAutomation`, `automationRuns`, `automationStats`, …). |
125
141
  | `client.compute` | **Compute Modules** — server-side Rust/WASM logic: author + deploy source (`upsertModule`, `deployVersion`, `waitForCompile`), triggers + policy, synchronous `invoke`, and monitoring (`moduleRuns`, `moduleStats`, `moduleLogs`, `appDiagnostics`). Modules run server-only; see [Compute Modules docs](https://docs.crowdedkingdoms.com/game-api/compute-modules). |
126
142
  | `client.playerCompute` | Player-authored SERVER/CLIENT Rust/WASM bound to player-owned grids: deploy source, activate/deactivate, list modules/versions, and delete self-authored modules. |
143
+ | `client.playerCodeProjects` | Cloud project, personal-library, and common-file APIs for Mod Studio: target-scoped files, metadata/module names, pairing preference, optimistic revisions, copy-by-value imports, and atomic metadata/file saves. Generated operations are pinned to the committed merged SDL. |
127
144
  | `client.playerModel` | Player-owned flexible model containers and grid-confined automations (`containers`, `createContainer`, `setProperty`, `automations`, `createAutomation`, …). |
128
145
  | `client.marketplace` | Player-code store/install/consent flows plus player-authorized grid claims: `claimGridOwnership` preserves the existing-grid policy flow, while `claimGridChunk` atomically creates and owns one chunk under `SELF_CLAIM` and `releaseClaimedGrid` releases an eligible owner-created claim. |
129
146
  | `client.udp` | UDP proxy subscriptions + spatial mutations (`sendActorUpdate`, `sendVoxelUpdate`, `sendAudioPacket`, `sendTextPacket`, `sendClientEvent`). |
@@ -131,11 +148,98 @@ If `managementUrl` is omitted, the SDK falls back to `httpUrl` for backwards-com
131
148
  | `client.refreshGameplayToken()` | Safely rotates an active game client's app token: disconnects the old-token UDP proxy, refreshes/stores the token, and opens the new-token proxy while existing realtime handlers resubscribe in place. |
132
149
  | `client.world(appId)` | Higher-level helpers for browser games (`actor.join`, `actor.sendState`, `actor.sendText`). |
133
150
 
134
- `PlayerCodeBroker` is the P1 page-side browser security skeleton: it transfers
151
+ `PlayerCodeBroker` transfers
135
152
  compiled client artifacts to a platform-owned worker, keeps tokens on the page,
136
153
  allow-lists host calls, and locally clamps chunk-targeted effects to the owned
137
- grid before the normal SDK path reaches server authorization. P3 adds the
138
- platform worker glue/live-coding presentation UI.
154
+ grid before the normal SDK path reaches server authorization. Mod Studio
155
+ hot-swaps only the exact version-keyed artifact returned after a successful
156
+ CLIENT compile.
157
+
158
+ ## Player-code Mod Studio
159
+
160
+ `mountModStudio` is the project-first SERVER/CLIENT Rust authoring surface. A
161
+ project has one cloud revision, target-scoped files, project metadata, separate
162
+ server/client module names, and a pairing preference. Full-stack edits autosave
163
+ as one optimistic-concurrency write; the UI renders **Saving**, **Saved**,
164
+ **Conflict**, or **Offline**, with retry and conflict-resolution actions.
165
+
166
+ ```ts
167
+ import { mountModStudio } from '@crowdedkingdoms/crowdyjs/mod-studio';
168
+
169
+ const studio = await mountModStudio(host, {
170
+ projectProvider: game.playerCodeProjects,
171
+ playerCompute: game.playerCompute,
172
+ playerWallet: identity.playerWallet,
173
+ appId,
174
+ gridId,
175
+ grid,
176
+ workerUrl: playerCodeGlueWorkerUrl,
177
+ onHostCall,
178
+ });
179
+
180
+ // Stops editor/runtime polling, the Rust worker, and any client broker owned
181
+ // by this mount. It does not implicitly disable a deliberately live server.
182
+ studio.destroy();
183
+ ```
184
+
185
+ Use `new ModStudioController(options)` for a custom/headless presentation. Its
186
+ public edits are file operations (`addFile`, `renameFile`, `deleteFile`,
187
+ `updateFile`) and project settings—there is no session-only source blob, fixed
188
+ module name, or template JSON API. The deploy conversion to the Game API's
189
+ legacy `sourceFilesJson` input happens only inside the controller's
190
+ `playerCompute.deploy` call.
191
+
192
+ The built-in UI provides a project switcher/new-project wizard
193
+ (server/client/full-stack), target explorer, personal library/common files,
194
+ tabs, settings, Problems/Build/Logs/Runs/Invoke panels, and explicit **Test
195
+ draft**, **Deploy live**, and **Stop project** actions. Full-stack deployment is
196
+ ordered: save once → compile CLIENT → compile SERVER → set/clear the pairing
197
+ requirement only after both compiles → enable SERVER → hot-swap the exact
198
+ version-keyed CLIENT artifact. Partial compile failures never write a new
199
+ requirement. Stop always attempts both server disable and client/poll cleanup
200
+ and reports each failure.
201
+
202
+ Monaco uses target-prefixed model URIs (`.../server/Cargo.toml` and
203
+ `.../client/Cargo.toml`) and opens every loaded project/library/common Rust file
204
+ in one bounded local worker workspace. Completion, hover, symbols, and
205
+ definition therefore work across loaded files; lifecycle snippets and hover
206
+ notes distinguish SERVER platform execution from CLIENT broker host calls.
207
+ Local tree-sitter markers are labeled advisory. Platform rustc output is parsed
208
+ separately into authoritative path/line/column markers and remains visible in
209
+ Build.
210
+
211
+ The Rust worker receives source files and the strict embedded platform index
212
+ only. It receives no credential, opens no socket/fetch path, and never falls
213
+ back to a server language service. If Monaco, Worker, a WASM asset, or a custom
214
+ platform index fails, the same Mod Studio mount keeps project/target tabs and
215
+ uses one file-aware textarea—never a raw JSON blob.
216
+
217
+ Modern bundlers must preserve module workers and package `.wasm` assets. Custom
218
+ pipelines can pass `languageWorkerFactory` and `editorWorkerFactory`. The
219
+ embedded index remains the byte-identical game export (`schemaVersion: 2`, Rust
220
+ 1.97.1, SDK 0.1.5, ABI 0, 725 symbols, content hash
221
+ `3f5f39d4…18ffb`).
222
+
223
+ ### Game API project contract
224
+
225
+ `PlayerCodeProjectsAPI` implements the transport-neutral
226
+ `ModStudioProjectProvider`; generated GraphQL types remain inside the adapter.
227
+ The committed merged schema and generated operations cover:
228
+
229
+ - `playerCodeProjects(appId)` / `playerCodeProject(appId, projectId)`
230
+ - `playerCodeProjectCreate(input)`
231
+ - `playerCodeProjectSave(input)` for one atomic metadata/file delta
232
+ - `playerCodeLibraryFiles(appId)` / `playerCodeLibrarySave(input)`
233
+ - `playerCodeCommonFiles(appId)`
234
+ - `playerCodeProjectImportFile(input)` for copy-by-value imports
235
+
236
+ The adapter maps the API's `PAIRED | INDEPENDENT | SERVER_ONLY | CLIENT_ONLY`
237
+ presentation enum to Mod Studio's runtime-oriented project kind and
238
+ `REQUIRED | OPTIONAL | NONE` setting. A stale expected `revision` arrives as
239
+ `CONFLICT` with `PLAYER_CODE_REVISION_CONFLICT` in the message and becomes a
240
+ `ModStudioRevisionConflictError` with the latest cloud project when that
241
+ follow-up read succeeds.
242
+
139
243
  | `createWorldSession(client, appId, config)` (from `@crowdedkingdoms/crowdyjs/stores`) | World Stores: opt-in, SDK-managed game state — typed codecs (`structCodec` binary DSL), your own actor with a 5 Hz send loop (`session.self`), a remote-actor registry with lanes/history/staleness (`session.actors`), attributed send errors (`session.errors`), a chunk/voxel cache with realtime merge + worldgen write-back (`session.chunks`), channel/direct-message inboxes + a typed event router, host tracking, typed save/avatar state, and a game-model container mirror. Only configured stores exist (compile-time + runtime); unimported stores tree-shake away. |
140
244
  | `client.kit(appId)` | Game Kit: ready-made mappings of game concepts onto the game model — `kit.inventory`, `kit.objects` (lockable doors/chests with custom permissions), `kit.npcs`, `kit.plots` (buy/rent land with transactional, replication-enforced grid grants), and the genre layers `kit.economy` (wallets/shops/trades/market), `kit.progression` (xp/skills/achievements/rating), `kit.loot`, `kit.quests`, `kit.combat`, `kit.matches` (session lobbies/turns/scores with notify-to-pull channels), `kit.decks` (hidden hands), `kit.worldsim` (clock/nodes/crops/waves), `kit.social` (parties/guilds/chat over teams+channels), `kit.leaderboards`, `kit.features` (tier gates), and the engine-aware helpers `kit.mobs` (refereed attacks, defs/slots, contact-damage parsing), `kit.pets` (adopt/summon/dismiss/rename), `kit.instances` (private world slices, seeded runs), `kit.director` (encounter runs), `kit.matchmaking` (queues/proposals/rating), `kit.minigames` (invoke-loop wrapper), `kit.economy.orderBook` (escrowed bid/ask market), engine paths on `kit.matches`/`kit.decks`/`kit.leaderboards`, `kit.quests` tutorial sequencing, `kit.engines` (compute capability detection) with `kit/wire` (the engine pose codec, `engineLanes()`, and the 77/90/91/92/93 event parsers) — plus blueprint builders + `kit.deploy(...)` for the admin "load the rules" step. |
141
245
 
@@ -59,6 +59,7 @@ import { UdpAPI } from './domains/udp.js';
59
59
  import { GameModelAPI } from './domains/gameModel.js';
60
60
  import { ComputeAPI } from './domains/compute.js';
61
61
  import { PlayerComputeAPI } from './domains/playerCompute.js';
62
+ import { PlayerCodeProjectsAPI } from './domains/playerCodeProjects.js';
62
63
  import { PlayerWalletAPI } from './domains/playerWallet.js';
63
64
  import { MarketplaceAPI } from './domains/marketplace.js';
64
65
  import { PlayerModelAPI } from './domains/playerModel.js';
@@ -197,6 +198,8 @@ export declare class CrowdyClient {
197
198
  readonly compute: ComputeAPI;
198
199
  /** Player-authored Rust/WASM bound to player-owned grids. */
199
200
  readonly playerCompute: PlayerComputeAPI;
201
+ /** Cloud source projects consumed by the project-first Mod Studio. */
202
+ readonly playerCodeProjects: PlayerCodeProjectsAPI;
200
203
  /** P4a marketplace (free mode): store, installs, consent, claim flows. */
201
204
  readonly marketplace: MarketplaceAPI;
202
205
  /** Player wallet, spend caps, hourly usage charges, and player policy (P2). */
@@ -1 +1 @@
1
- {"version":3,"file":"crowdy-client.d.ts","sourceRoot":"","sources":["../src/crowdy-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,QAA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,MAAM,GAAG,IAAI,GAAG,IAAI;IAIpC,0DAA0D;IAC1D,QAAQ,IAAI,MAAM,GAAG,IAAI;IAIzB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACG,oBAAoB,IAAI,OAAO,CAAC,gBAAgB,CAAC;YAczC,2BAA2B;IAczC;;;;;;;OAOG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW;IAIjC;;;;;;;;;;;;OAYG;IACH,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,aAAa;IAS3D,gEAAgE;IAChE,KAAK,IAAI,IAAI;CAId;AAED,wBAAgB,kBAAkB,CAChC,MAAM,GAAE,kBAAuB,GAC9B,YAAY,CAEd"}
@@ -58,6 +58,7 @@ import { UdpAPI } from './domains/udp.js';
58
58
  import { GameModelAPI } from './domains/gameModel.js';
59
59
  import { ComputeAPI } from './domains/compute.js';
60
60
  import { PlayerComputeAPI } from './domains/playerCompute.js';
61
+ import { PlayerCodeProjectsAPI } from './domains/playerCodeProjects.js';
61
62
  import { PlayerWalletAPI } from './domains/playerWallet.js';
62
63
  import { MarketplaceAPI } from './domains/marketplace.js';
63
64
  import { PlayerModelAPI } from './domains/playerModel.js';
@@ -120,6 +121,7 @@ export class CrowdyClient {
120
121
  });
121
122
  this.compute = new ComputeAPI(this.graphql);
122
123
  this.playerCompute = new PlayerComputeAPI(this.graphql);
124
+ this.playerCodeProjects = new PlayerCodeProjectsAPI(this.graphql);
123
125
  this.playerWallet = new PlayerWalletAPI(this.management);
124
126
  this.marketplace = new MarketplaceAPI(this.graphql, this.management);
125
127
  this.playerModel = new PlayerModelAPI(this.graphql);
@@ -0,0 +1,25 @@
1
+ import type { GraphQLClient } from '../client.js';
2
+ import { type CreateModStudioProjectInput, type ImportModStudioReferenceFileInput, type ModStudioProject, type ModStudioProjectProvider, type ModStudioProjectScope, type ModStudioProjectSummary, type ModStudioReferenceFile, type SaveModStudioLibraryFileInput, type SaveModStudioProjectInput } from '../mod-studio/models.js';
3
+ /**
4
+ * Typed Game API adapter for private Mod Studio projects and reusable files.
5
+ * Mutable projects remain separate from immutable player-compute versions;
6
+ * only the controller's deploy path converts target files to sourceFilesJson.
7
+ */
8
+ export declare class PlayerCodeProjectsAPI implements ModStudioProjectProvider {
9
+ private readonly graphql;
10
+ private readonly baselines;
11
+ constructor(graphql: GraphQLClient);
12
+ listProjects(scope: ModStudioProjectScope): Promise<ModStudioProjectSummary[]>;
13
+ getProject(input: ModStudioProjectScope & {
14
+ projectId: string;
15
+ }): Promise<ModStudioProject>;
16
+ createProject(input: CreateModStudioProjectInput): Promise<ModStudioProject>;
17
+ saveProject(input: SaveModStudioProjectInput): Promise<ModStudioProject>;
18
+ listPersonalLibraryFiles(scope: ModStudioProjectScope): Promise<ModStudioReferenceFile[]>;
19
+ savePersonalLibraryFile(input: SaveModStudioLibraryFileInput): Promise<ModStudioReferenceFile>;
20
+ listCommonFiles(scope: ModStudioProjectScope): Promise<ModStudioReferenceFile[]>;
21
+ importReferenceFile(input: ImportModStudioReferenceFileInput): Promise<ModStudioProject>;
22
+ private remember;
23
+ private request;
24
+ }
25
+ //# sourceMappingURL=playerCodeProjects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playerCodeProjects.d.ts","sourceRoot":"","sources":["../../src/domains/playerCodeProjects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAQlD,OAAO,EAIL,KAAK,2BAA2B,EAChC,KAAK,iCAAiC,EAEtC,KAAK,gBAAgB,EAErB,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC/B,MAAM,yBAAyB,CAAC;AA0BjC;;;;GAIG;AACH,qBAAa,qBAAsB,YAAW,wBAAwB;IAGxD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAuC;gBAEpC,OAAO,EAAE,aAAa;IAE7C,YAAY,CAChB,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,uBAAuB,EAAE,CAAC;IAU/B,UAAU,CACd,KAAK,EAAE,qBAAqB,GAAG;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,GACnD,OAAO,CAAC,gBAAgB,CAAC;IAQtB,aAAa,CACjB,KAAK,EAAE,2BAA2B,GACjC,OAAO,CAAC,gBAAgB,CAAC;IAoBtB,WAAW,CACf,KAAK,EAAE,yBAAyB,GAC/B,OAAO,CAAC,gBAAgB,CAAC;IAwDtB,wBAAwB,CAC5B,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,sBAAsB,EAAE,CAAC;IAU9B,uBAAuB,CAC3B,KAAK,EAAE,6BAA6B,GACnC,OAAO,CAAC,sBAAsB,CAAC;IAc5B,eAAe,CACnB,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,sBAAsB,EAAE,CAAC;IAS9B,mBAAmB,CACvB,KAAK,EAAE,iCAAiC,GACvC,OAAO,CAAC,gBAAgB,CAAC;IAuB5B,OAAO,CAAC,QAAQ;YAKF,OAAO;CAiBtB"}
@@ -0,0 +1,299 @@
1
+ import { CrowdyGraphQLError, CrowdyHttpError, CrowdyNetworkError, CrowdyTimeoutError, } from '../errors.js';
2
+ import { ModStudioOfflineError, ModStudioRevisionConflictError, normalizeModStudioPath, } from '../mod-studio/models.js';
3
+ import { PlayerCodeCommonFilesDocument, PlayerCodeImportSource, PlayerCodeLibraryFilesDocument, PlayerCodeLibrarySaveDocument, PlayerCodePairingPreference, PlayerCodeProjectCreateDocument, PlayerCodeProjectDocument, PlayerCodeProjectImportFileDocument, PlayerCodeProjectSaveDocument, PlayerCodeProjectsDocument, } from '../generated/graphql.js';
4
+ /**
5
+ * Typed Game API adapter for private Mod Studio projects and reusable files.
6
+ * Mutable projects remain separate from immutable player-compute versions;
7
+ * only the controller's deploy path converts target files to sourceFilesJson.
8
+ */
9
+ export class PlayerCodeProjectsAPI {
10
+ constructor(graphql) {
11
+ this.graphql = graphql;
12
+ this.baselines = new Map();
13
+ }
14
+ async listProjects(scope) {
15
+ const data = await this.request(PlayerCodeProjectsDocument, {
16
+ appId: scope.appId,
17
+ includeArchived: false,
18
+ limit: 50,
19
+ offset: 0,
20
+ });
21
+ return data.playerCodeProjects.map(fromSummaryDto);
22
+ }
23
+ async getProject(input) {
24
+ const data = await this.request(PlayerCodeProjectDocument, {
25
+ appId: input.appId,
26
+ projectId: input.projectId,
27
+ });
28
+ return this.remember(fromProjectDto(data.playerCodeProject, input.gridId));
29
+ }
30
+ async createProject(input) {
31
+ const data = await this.request(PlayerCodeProjectCreateDocument, {
32
+ input: {
33
+ appId: input.appId,
34
+ gridId: input.gridId,
35
+ name: input.metadata.name,
36
+ description: input.metadata.description ?? null,
37
+ serverModuleName: input.metadata.serverModuleName ?? null,
38
+ clientModuleName: input.metadata.clientModuleName ?? null,
39
+ pairingPreference: toApiPairing(input.kind, input.metadata.pairingPreference),
40
+ sdkVersion: '0.1.5',
41
+ abiVersion: 0,
42
+ initialFiles: input.files.map(toApiFile),
43
+ },
44
+ });
45
+ return this.remember(fromProjectDto(data.playerCodeProjectCreate, input.gridId));
46
+ }
47
+ async saveProject(input) {
48
+ try {
49
+ const baseline = this.baselines.get(input.projectId) ??
50
+ (await this.getProject({
51
+ appId: input.appId,
52
+ gridId: input.gridId,
53
+ projectId: input.projectId,
54
+ }));
55
+ const delta = projectFileDelta(baseline, input);
56
+ const data = await this.request(PlayerCodeProjectSaveDocument, {
57
+ input: {
58
+ appId: input.appId,
59
+ projectId: input.projectId,
60
+ expectedRevision: input.expectedRevisionId,
61
+ gridId: input.gridId,
62
+ name: input.metadata.name,
63
+ description: input.metadata.description ?? null,
64
+ serverModuleName: input.metadata.serverModuleName ?? null,
65
+ clientModuleName: input.metadata.clientModuleName ?? null,
66
+ pairingPreference: toApiPairing(projectKind(input), input.metadata.pairingPreference),
67
+ upserts: delta.upserts.map(toApiFile),
68
+ deletes: delta.deletes.map(({ target, path }) => ({
69
+ target: target,
70
+ path,
71
+ })),
72
+ },
73
+ });
74
+ return this.remember(fromProjectDto(data.playerCodeProjectSave, input.gridId));
75
+ }
76
+ catch (error) {
77
+ if (error instanceof CrowdyGraphQLError &&
78
+ error.code === 'CONFLICT' &&
79
+ error.message.includes('PLAYER_CODE_REVISION_CONFLICT')) {
80
+ let remoteProject;
81
+ try {
82
+ remoteProject = await this.getProject({
83
+ appId: input.appId,
84
+ gridId: input.gridId,
85
+ projectId: input.projectId,
86
+ });
87
+ }
88
+ catch {
89
+ // The conflict remains actionable if the follow-up read fails.
90
+ }
91
+ throw new ModStudioRevisionConflictError(error.message, remoteProject);
92
+ }
93
+ throw error;
94
+ }
95
+ }
96
+ async listPersonalLibraryFiles(scope) {
97
+ const data = await this.request(PlayerCodeLibraryFilesDocument, {
98
+ appId: scope.appId,
99
+ includeArchived: false,
100
+ limit: 100,
101
+ offset: 0,
102
+ });
103
+ return data.playerCodeLibraryFiles.map(fromLibraryDto);
104
+ }
105
+ async savePersonalLibraryFile(input) {
106
+ const data = await this.request(PlayerCodeLibrarySaveDocument, {
107
+ input: {
108
+ appId: input.appId,
109
+ title: input.title,
110
+ pathHint: normalizeModStudioPath(input.path),
111
+ target: input.target,
112
+ tags: input.tags ?? [],
113
+ content: input.content,
114
+ },
115
+ });
116
+ return fromLibraryDto(data.playerCodeLibrarySave);
117
+ }
118
+ async listCommonFiles(scope) {
119
+ const data = await this.request(PlayerCodeCommonFilesDocument, {
120
+ appId: scope.appId,
121
+ limit: 100,
122
+ offset: 0,
123
+ });
124
+ return data.playerCodeCommonFiles.map(fromCommonDto);
125
+ }
126
+ async importReferenceFile(input) {
127
+ const data = await this.request(PlayerCodeProjectImportFileDocument, {
128
+ input: {
129
+ appId: input.appId,
130
+ projectId: input.projectId,
131
+ expectedProjectRevision: input.expectedRevisionId,
132
+ source: input.source === 'PERSONAL_LIBRARY'
133
+ ? PlayerCodeImportSource.Library
134
+ : PlayerCodeImportSource.Common,
135
+ ...(input.source === 'PERSONAL_LIBRARY'
136
+ ? { libraryFileId: input.referenceId }
137
+ : { commonVersionId: input.referenceId }),
138
+ ...(input.destinationPath
139
+ ? { destinationPath: normalizeModStudioPath(input.destinationPath) }
140
+ : {}),
141
+ },
142
+ });
143
+ return this.remember(fromProjectDto(data.playerCodeProjectImportFile, input.gridId));
144
+ }
145
+ remember(project) {
146
+ this.baselines.set(project.projectId, cloneProject(project));
147
+ return project;
148
+ }
149
+ async request(document, variables) {
150
+ try {
151
+ return await this.graphql.request(document, variables);
152
+ }
153
+ catch (error) {
154
+ if (error instanceof CrowdyNetworkError ||
155
+ error instanceof CrowdyTimeoutError ||
156
+ (error instanceof CrowdyHttpError && error.status >= 500)) {
157
+ throw new ModStudioOfflineError(error.message, error);
158
+ }
159
+ throw error;
160
+ }
161
+ }
162
+ }
163
+ function fromSummaryDto(dto) {
164
+ return {
165
+ projectId: dto.projectId,
166
+ name: dto.name,
167
+ kind: kindFromApi(dto.pairingPreference),
168
+ revisionId: String(dto.revision),
169
+ ...(dto.serverModuleName
170
+ ? { serverModuleName: dto.serverModuleName }
171
+ : {}),
172
+ ...(dto.clientModuleName
173
+ ? { clientModuleName: dto.clientModuleName }
174
+ : {}),
175
+ updatedAt: dto.updatedAt,
176
+ };
177
+ }
178
+ function fromProjectDto(dto, fallbackGridId) {
179
+ const files = dto.files.map((file) => ({
180
+ target: file.target,
181
+ path: normalizeModStudioPath(file.path),
182
+ content: file.content,
183
+ }));
184
+ return {
185
+ projectId: dto.projectId,
186
+ appId: String(dto.appId),
187
+ gridId: dto.gridId == null ? fallbackGridId : String(dto.gridId),
188
+ kind: kindFromApi(dto.pairingPreference),
189
+ metadata: {
190
+ name: dto.name,
191
+ ...(dto.description ? { description: dto.description } : {}),
192
+ ...(dto.serverModuleName
193
+ ? { serverModuleName: dto.serverModuleName }
194
+ : {}),
195
+ ...(dto.clientModuleName
196
+ ? { clientModuleName: dto.clientModuleName }
197
+ : {}),
198
+ pairingPreference: fromApiPairing(dto.pairingPreference),
199
+ },
200
+ files,
201
+ sdkVersion: dto.sdkVersion,
202
+ abiVersion: dto.abiVersion,
203
+ revision: {
204
+ id: String(dto.revision),
205
+ savedAt: dto.updatedAt,
206
+ },
207
+ createdAt: dto.createdAt,
208
+ updatedAt: dto.updatedAt,
209
+ };
210
+ }
211
+ function fromLibraryDto(dto) {
212
+ return {
213
+ id: dto.libraryFileId,
214
+ source: 'PERSONAL_LIBRARY',
215
+ title: dto.title,
216
+ target: dto.target,
217
+ path: normalizeModStudioPath(dto.pathHint),
218
+ content: dto.content,
219
+ tags: [...dto.tags],
220
+ updatedAt: dto.updatedAt,
221
+ };
222
+ }
223
+ function fromCommonDto(dto) {
224
+ return {
225
+ id: dto.versionId,
226
+ source: 'COMMON',
227
+ title: dto.title,
228
+ target: dto.target,
229
+ path: normalizeModStudioPath(dto.path),
230
+ content: dto.content,
231
+ tags: [...dto.tags],
232
+ updatedAt: dto.updatedAt,
233
+ };
234
+ }
235
+ function kindFromApi(pairing) {
236
+ if (pairing === PlayerCodePairingPreference.ServerOnly)
237
+ return 'SERVER';
238
+ if (pairing === PlayerCodePairingPreference.ClientOnly)
239
+ return 'CLIENT';
240
+ return 'FULL_STACK';
241
+ }
242
+ function fromApiPairing(pairing) {
243
+ if (pairing === PlayerCodePairingPreference.Paired)
244
+ return 'REQUIRED';
245
+ if (pairing === PlayerCodePairingPreference.Independent)
246
+ return 'OPTIONAL';
247
+ return 'NONE';
248
+ }
249
+ function toApiPairing(kind, pairing) {
250
+ if (kind === 'SERVER')
251
+ return PlayerCodePairingPreference.ServerOnly;
252
+ if (kind === 'CLIENT')
253
+ return PlayerCodePairingPreference.ClientOnly;
254
+ return pairing === 'REQUIRED'
255
+ ? PlayerCodePairingPreference.Paired
256
+ : PlayerCodePairingPreference.Independent;
257
+ }
258
+ function toApiFile(file) {
259
+ return {
260
+ target: file.target,
261
+ path: normalizeModStudioPath(file.path),
262
+ content: file.content,
263
+ };
264
+ }
265
+ function projectKind(input) {
266
+ const hasServer = input.files.some((file) => file.target === 'SERVER');
267
+ const hasClient = input.files.some((file) => file.target === 'CLIENT');
268
+ if (hasServer && hasClient)
269
+ return 'FULL_STACK';
270
+ if (hasServer)
271
+ return 'SERVER';
272
+ return 'CLIENT';
273
+ }
274
+ function projectFileDelta(baseline, input) {
275
+ const previous = new Map(baseline.files.map((file) => [
276
+ `${file.target}:${normalizeModStudioPath(file.path)}`,
277
+ file,
278
+ ]));
279
+ const current = new Map(input.files.map((file) => [
280
+ `${file.target}:${normalizeModStudioPath(file.path)}`,
281
+ file,
282
+ ]));
283
+ const upserts = input.files.filter((file) => {
284
+ const before = previous.get(`${file.target}:${normalizeModStudioPath(file.path)}`);
285
+ return !before || before.content !== file.content;
286
+ });
287
+ const deletes = baseline.files
288
+ .filter((file) => !current.has(`${file.target}:${normalizeModStudioPath(file.path)}`))
289
+ .map((file) => ({ target: file.target, path: file.path }));
290
+ return { upserts, deletes };
291
+ }
292
+ function cloneProject(project) {
293
+ return {
294
+ ...project,
295
+ metadata: { ...project.metadata },
296
+ files: project.files.map((file) => ({ ...file })),
297
+ revision: { ...project.revision },
298
+ };
299
+ }
@@ -77,7 +77,7 @@ export declare class PlayerComputeAPI {
77
77
  /**
78
78
  * Fetch a client artifact and decode its bytes to an ArrayBuffer plus the
79
79
  * broker inputs (content hash for side-load verification, per-dispatch fuel
80
- * budget). Convenience over {@link artifact} for the live-coding client
80
+ * budget). Convenience over {@link artifact} for the Mod Studio CLIENT
81
81
  * deploy loop.
82
82
  */
83
83
  artifactBytes(variables: PlayerComputeArtifactQueryVariables): Promise<{
@@ -116,7 +116,7 @@ export class PlayerComputeAPI {
116
116
  /**
117
117
  * Fetch a client artifact and decode its bytes to an ArrayBuffer plus the
118
118
  * broker inputs (content hash for side-load verification, per-dispatch fuel
119
- * budget). Convenience over {@link artifact} for the live-coding client
119
+ * budget). Convenience over {@link artifact} for the Mod Studio CLIENT
120
120
  * deploy loop.
121
121
  */
122
122
  async artifactBytes(variables) {