@crowdedkingdoms/crowdyjs 18.12.0-dev.1 → 18.13.0-test.1
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/MIGRATION.md +25 -0
- package/README.md +7 -1
- package/dist/default-origin.d.ts +6 -6
- package/dist/default-origin.d.ts.map +1 -1
- package/dist/default-origin.js +6 -6
- package/dist/generated/graphql-schema.d.ts +4 -4
- package/dist/generated/graphql-schema.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/kit/index.d.ts +2 -0
- package/dist/kit/index.d.ts.map +1 -1
- package/dist/kit/index.js +2 -0
- package/dist/kit/kit.d.ts +40 -1
- package/dist/kit/kit.d.ts.map +1 -1
- package/dist/kit/kit.js +71 -1
- package/dist/kit/modules/market.d.ts +159 -0
- package/dist/kit/modules/market.d.ts.map +1 -0
- package/dist/kit/modules/market.js +141 -0
- package/dist/kit/modules/player.d.ts +264 -0
- package/dist/kit/modules/player.d.ts.map +1 -0
- package/dist/kit/modules/player.js +258 -0
- package/dist/kit/protocol.d.ts +2 -0
- package/dist/kit/protocol.d.ts.map +1 -1
- package/dist/kit/protocol.js +2 -0
- package/dist/kit/runtime.d.ts.map +1 -1
- package/dist/kit/runtime.js +6 -1
- package/dist/live-coding/assets/browser-authoring-index.json +1 -1
- package/dist/live-coding/assets/manifest.json +1 -1
- package/dist/live-coding/browser-authoring-index.generated.d.ts.map +1 -1
- package/dist/live-coding/browser-authoring-index.generated.js +1474 -4
- package/package.json +1 -1
package/MIGRATION.md
CHANGED
|
@@ -120,6 +120,31 @@ super-admin's session). There is no SDK replacement.
|
|
|
120
120
|
`dev`'s SDL after #417 merged (`npm run schema:sync:paths -- --schema <that schema.gql>`, then
|
|
121
121
|
`npm run codegen`).
|
|
122
122
|
|
|
123
|
+
## 18.13.0: the economy
|
|
124
|
+
|
|
125
|
+
Additive. **Needs a compute toolchain whose starter pack has the `player` and `market`
|
|
126
|
+
starters** (ckx-sdk 0.12.1; dev's toolchain v1.15.0). The economy lives in hub state and is
|
|
127
|
+
not a ledger (the operator's decision HS-52): no double-entry book, no real money, transfers as
|
|
128
|
+
steps each hub answers once.
|
|
129
|
+
|
|
130
|
+
- **The caller's own `player` hub**, keyed by their player id (the kit needs it: `playerId` in
|
|
131
|
+
`client.kit()`'s options, or the identity it can ask): `kit.player` (`watch`, `me`, `rules`,
|
|
132
|
+
`profileOf`, `onEvent`) and its views `kit.inventory` (`items`, `count`, `discard`,
|
|
133
|
+
`takeMail`), `kit.wallet` (`balances`, `balance`), `kit.progression` (`progress`, `profile`,
|
|
134
|
+
`onLevel`), `kit.achievements` (`list`, `onUnlock`), `kit.quests` (`list`, `accept`, `claim`,
|
|
135
|
+
`step` for the counters the game lets a client report), `kit.crafting` (`recipes`, `craft`),
|
|
136
|
+
`kit.loot` (`tables`, `open`) and `kit.production` (`view`, `collect`). The inventory, wallet
|
|
137
|
+
and progress are read by calls only the player may make, and read again when the hub's
|
|
138
|
+
`changed` message names them; the profile is public.
|
|
139
|
+
- **Markets** by name: `kit.shops.at(key)` (`vendors`, `buy`, `sell`), `kit.market.at(key)`
|
|
140
|
+
(`book`, `order`, `cancel`, `orders` mirrored) and `kit.trades.at(key)` (`open`, `offer`,
|
|
141
|
+
`accept`, `decline`, `mine` mirrored). An order or an offer holds what it puts up in the
|
|
142
|
+
player's own hub; a fill or an accepted trade moves it hub to hub.
|
|
143
|
+
- **`unavailable`** (`KIT_CODES.UNAVAILABLE`): a hub refuses a change it could not finish
|
|
144
|
+
because another hub did not answer. The kit sends a call with an action id again, as it does
|
|
145
|
+
after a platform `Unavailable`; the hub keeps no receipt for it, so the resend finishes what
|
|
146
|
+
the first began.
|
|
147
|
+
|
|
123
148
|
## 18.12.0: the genre starters
|
|
124
149
|
|
|
125
150
|
Additive. **Needs a compute toolchain whose starter pack has the genre starters** (ckx-sdk
|
package/README.md
CHANGED
|
@@ -759,6 +759,8 @@ modules are the tree's starter types:
|
|
|
759
759
|
| `kit.arenas.arena(key)` | `arena` | real-time fights: `join` as a class, `move` (the hub's warden keeps what the speed allows), `cast` (cooldown, resource, range; projectiles and areas land on the hub's ticks) |
|
|
760
760
|
| `kit.racing.race(key)` / `ball(key)` | `race`, `ball` (`racing`) | races (gates in order, laps, splits, places, the winner's `ghost`) and ball games (`claim`, `pass`, `shoot`, goals) on reported positions the warden keeps |
|
|
761
761
|
| `kit.territory.map(key)` / `zone(key)` | `territory`, `zone` (`territory`) | control points a faction captures by standing on them (the hub reads where players are), and a circle that shrinks and wears down whoever is outside |
|
|
762
|
+
| `kit.player` and its views: `kit.inventory`, `kit.wallet`, `kit.progression`, `kit.achievements`, `kit.quests`, `kit.crafting`, `kit.loot`, `kit.production` | `player` (keyed by the player's id) | the caller's own hub: stacks and mail, soft currencies, levels and public profiles, achievements, quests with tutorials (`step` for the counters a client may report), crafting, loot with pity, idle production; private parts read again when the hub says they changed (18.13.0) |
|
|
763
|
+
| `kit.shops.at(key)`, `kit.market.at(key)`, `kit.trades.at(key)` | `market` | vendors with stock and restocks (`buy`, `sell`), order books (`order`, `cancel`, `book`), trades between two players (`open`, `offer`, `accept`, `decline`); what a player puts up is held in their own hub, and a call that could not reach it is refused `unavailable` and sent again |
|
|
762
764
|
| `kit.topology` | — | composes a manifest from `exec.starters` (the types picked, what they hang under and call), checks the tree, builds and deploys (developers, `manage_compute`) |
|
|
763
765
|
| `kit.spectate`, `kit.emotes`, `kit.shards` | — | a viewer's heartbeat so the world's messages reach it; emotes as client events every kit client reads; shard keys as the hubs compute them |
|
|
764
766
|
| `kit.social` | — | parties, guilds and chat rooms over teams and channels |
|
|
@@ -791,7 +793,11 @@ await kit.sessions.open(key).act({ points: 2 }); // sent with an action id: pl
|
|
|
791
793
|
shape React's `useSyncExternalStore` takes. `PrivateState` reads what only its player may
|
|
792
794
|
see with a call, again whenever the hub says it changed for them.
|
|
793
795
|
- **Refusals** are `KitError` (a `CrowdyExecError` with status `AppError`) with a `code` to
|
|
794
|
-
branch on: `not_your_turn`, `cooldown`, `full`, `forbidden`, ... (`KIT_CODES`).
|
|
796
|
+
branch on: `not_your_turn`, `cooldown`, `full`, `forbidden`, ... (`KIT_CODES`). A call with an
|
|
797
|
+
action id refused `unavailable` (a hub it needed did not answer) is sent again (18.13.0).
|
|
798
|
+
- **The economy is not a ledger.** Items and soft currency are hub state; a transfer between
|
|
799
|
+
players is steps each hub answers once. See the Game Kit's economy page before you put
|
|
800
|
+
anything of real value in it.
|
|
795
801
|
- **Kit types are the hubs' MessagePack maps as they arrive**, field names and all
|
|
796
802
|
(`time_of_day`, `expires_in_ms`), the same in CrowdyCPP and CrowdyPy.
|
|
797
803
|
- **Realtime**: hubs show server-driven actors through the realtime tier; `kitActorCodec`,
|
package/dist/default-origin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GENERATED — do not edit. The operator tooling's
|
|
3
|
-
* `sync-client-origins.mjs --write --tier
|
|
3
|
+
* `sync-client-origins.mjs --write --tier test` writes this file, and
|
|
4
4
|
* `check-sdk-default-origin.mjs` refuses it when it names the wrong tier or a
|
|
5
5
|
* host that declaration does not carry. Regenerate; never hand-edit.
|
|
6
6
|
*
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
* than no default at all. Every fallback this SDK ever removed named a host that
|
|
11
11
|
* was already dead. A generated file plus a gate is what makes this one different.
|
|
12
12
|
*
|
|
13
|
-
* Source: the operator's per-tier public CK API origin declaration, tier '
|
|
13
|
+
* Source: the operator's per-tier public CK API origin declaration, tier 'test'
|
|
14
14
|
*/
|
|
15
15
|
/** The tier this build of the SDK is published for. */
|
|
16
|
-
export declare const CROWDY_DEFAULT_TIER = "
|
|
16
|
+
export declare const CROWDY_DEFAULT_TIER = "test";
|
|
17
17
|
/** The public CK API origin for that tier. */
|
|
18
|
-
export declare const CROWDY_DEFAULT_HTTP_ORIGIN = "https://ck.
|
|
18
|
+
export declare const CROWDY_DEFAULT_HTTP_ORIGIN = "https://ck.test.crowdedkingdoms.com";
|
|
19
19
|
/** The same host over WebSocket. A scheme is composed; a hostname is looked up. */
|
|
20
|
-
export declare const CROWDY_DEFAULT_WS_ORIGIN = "wss://ck.
|
|
20
|
+
export declare const CROWDY_DEFAULT_WS_ORIGIN = "wss://ck.test.crowdedkingdoms.com";
|
|
21
21
|
/** The bare hostname, for callers that need to compare rather than dial. */
|
|
22
|
-
export declare const CROWDY_DEFAULT_HOST = "ck.
|
|
22
|
+
export declare const CROWDY_DEFAULT_HOST = "ck.test.crowdedkingdoms.com";
|
|
23
23
|
//# sourceMappingURL=default-origin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-origin.d.ts","sourceRoot":"","sources":["../src/default-origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"default-origin.d.ts","sourceRoot":"","sources":["../src/default-origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,SAAS,CAAC;AAE1C,8CAA8C;AAC9C,eAAO,MAAM,0BAA0B,wCAAwC,CAAC;AAEhF,mFAAmF;AACnF,eAAO,MAAM,wBAAwB,sCAAsC,CAAC;AAE5E,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,gCAAgC,CAAC"}
|
package/dist/default-origin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GENERATED — do not edit. The operator tooling's
|
|
3
|
-
* `sync-client-origins.mjs --write --tier
|
|
3
|
+
* `sync-client-origins.mjs --write --tier test` writes this file, and
|
|
4
4
|
* `check-sdk-default-origin.mjs` refuses it when it names the wrong tier or a
|
|
5
5
|
* host that declaration does not carry. Regenerate; never hand-edit.
|
|
6
6
|
*
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
* than no default at all. Every fallback this SDK ever removed named a host that
|
|
11
11
|
* was already dead. A generated file plus a gate is what makes this one different.
|
|
12
12
|
*
|
|
13
|
-
* Source: the operator's per-tier public CK API origin declaration, tier '
|
|
13
|
+
* Source: the operator's per-tier public CK API origin declaration, tier 'test'
|
|
14
14
|
*/
|
|
15
15
|
/** The tier this build of the SDK is published for. */
|
|
16
|
-
export const CROWDY_DEFAULT_TIER = '
|
|
16
|
+
export const CROWDY_DEFAULT_TIER = 'test';
|
|
17
17
|
/** The public CK API origin for that tier. */
|
|
18
|
-
export const CROWDY_DEFAULT_HTTP_ORIGIN = 'https://ck.
|
|
18
|
+
export const CROWDY_DEFAULT_HTTP_ORIGIN = 'https://ck.test.crowdedkingdoms.com';
|
|
19
19
|
/** The same host over WebSocket. A scheme is composed; a hostname is looked up. */
|
|
20
|
-
export const CROWDY_DEFAULT_WS_ORIGIN = 'wss://ck.
|
|
20
|
+
export const CROWDY_DEFAULT_WS_ORIGIN = 'wss://ck.test.crowdedkingdoms.com';
|
|
21
21
|
/** The bare hostname, for callers that need to compare rather than dial. */
|
|
22
|
-
export const CROWDY_DEFAULT_HOST = 'ck.
|
|
22
|
+
export const CROWDY_DEFAULT_HOST = 'ck.test.crowdedkingdoms.com';
|
|
@@ -3760,14 +3760,14 @@ export type ExecStarterFile = {
|
|
|
3760
3760
|
/** The path within the crate, as `execBuild` takes it. */
|
|
3761
3761
|
path: Scalars['String']['output'];
|
|
3762
3762
|
};
|
|
3763
|
-
/** The starter packs:
|
|
3763
|
+
/** The starter packs: the starter crates, and a manifest that deploys them as one app. */
|
|
3764
3764
|
export type ExecStarterPack = {
|
|
3765
3765
|
__typename?: 'ExecStarterPack';
|
|
3766
|
-
/** The manifest for `execDeploy` with the build’s id: the root `world` hub
|
|
3766
|
+
/** The manifest for `execDeploy` with the build’s id: the root `world` hub and the types under it, each naming its crate. */
|
|
3767
3767
|
manifestJson: Scalars['String']['output'];
|
|
3768
3768
|
/** The mod starter: a player’s code on a grid they own, built with `execModBuild` and deployed with `execModDeploy` rather than in the manifest. Null on a toolchain without it. */
|
|
3769
3769
|
mod: Maybe<ExecStarter>;
|
|
3770
|
-
/**
|
|
3770
|
+
/** One entry per node type of the manifest: a crate that serves two types appears twice, so build each crate once. */
|
|
3771
3771
|
starters: Array<ExecStarter>;
|
|
3772
3772
|
};
|
|
3773
3773
|
/** A deployed version of an app’s ck-exec topology. */
|
|
@@ -6799,7 +6799,7 @@ export type Query = {
|
|
|
6799
6799
|
execMods: Array<ExecMod>;
|
|
6800
6800
|
/** Your mods in an app, on every grid. */
|
|
6801
6801
|
execMyMods: Array<ExecMod>;
|
|
6802
|
-
/** The starter packs, which replace the compute templates: ckx-sdk hub crates for a root world, matchmaking, game sessions, NPCs and mobs,
|
|
6802
|
+
/** The starter packs, which replace the compute templates: ckx-sdk hub crates for a root world, matchmaking, game sessions, NPCs and mobs, game genres (leaderboards, cards, tactics, waves, duels, private runs, arenas, races, territory), and the economy (a player's own hub, markets), to pass to `execBuild`, with a manifest for `execDeploy`. `starters` has one entry per node type, so a crate that serves two types appears twice: build it once. Requires the org 'manage_compute' permission. */
|
|
6803
6803
|
execStarters: ExecStarterPack;
|
|
6804
6804
|
/** An app's deployed ck-exec versions, newest first, and which is active. Requires the org 'view_compute_diagnostics' permission. */
|
|
6805
6805
|
execVersions: Array<ExecVersion>;
|