@crowdedkingdoms/crowdyjs 17.13.0-dev.1 → 18.0.0-dev.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 +163 -1
- package/README.md +142 -146
- package/dist/crowdy-client.d.ts +12 -31
- package/dist/crowdy-client.d.ts.map +1 -1
- package/dist/crowdy-client.js +15 -37
- package/dist/crowdy-dsh/bridge.d.ts.map +1 -1
- package/dist/crowdy-dsh/bridge.js +3 -6
- package/dist/crowdy-studio/controller.d.ts +59 -57
- package/dist/crowdy-studio/controller.d.ts.map +1 -1
- package/dist/crowdy-studio/controller.js +268 -206
- package/dist/crowdy-studio/diagnostics.d.ts +3 -12
- package/dist/crowdy-studio/diagnostics.d.ts.map +1 -1
- package/dist/crowdy-studio/dom-shell.d.ts +2 -4
- package/dist/crowdy-studio/dom-shell.d.ts.map +1 -1
- package/dist/crowdy-studio/dom-shell.js +16 -47
- package/dist/crowdy-studio/embed/hud-layer.d.ts +1 -1
- package/dist/crowdy-studio/embed/panel.d.ts +3 -12
- package/dist/crowdy-studio/embed/panel.d.ts.map +1 -1
- package/dist/crowdy-studio/embed/panel.js +3 -6
- package/dist/crowdy-studio/index.d.ts +1 -3
- package/dist/crowdy-studio/index.d.ts.map +1 -1
- package/dist/crowdy-studio/index.js +0 -2
- package/dist/crowdy-studio/models.d.ts +3 -4
- package/dist/crowdy-studio/models.d.ts.map +1 -1
- package/dist/crowdy-studio/starter-projects.d.ts +8 -4
- package/dist/crowdy-studio/starter-projects.d.ts.map +1 -1
- package/dist/crowdy-studio/starter-projects.js +83 -100
- package/dist/domains/appAccess.d.ts +14 -1
- package/dist/domains/appAccess.d.ts.map +1 -1
- package/dist/domains/appAccess.js +37 -1
- package/dist/domains/exec.d.ts +162 -15
- package/dist/domains/exec.d.ts.map +1 -1
- package/dist/domains/exec.js +180 -18
- package/dist/domains/host.d.ts +3 -3
- package/dist/domains/host.js +3 -3
- package/dist/domains/marketplace.d.ts +9 -58
- package/dist/domains/marketplace.d.ts.map +1 -1
- package/dist/domains/marketplace.js +9 -106
- package/dist/domains/playerWallet.d.ts +6 -12
- package/dist/domains/playerWallet.d.ts.map +1 -1
- package/dist/domains/playerWallet.js +6 -21
- package/dist/errors.d.ts +7 -13
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +6 -10
- package/dist/generated/graphql.d.ts +1384 -7977
- package/dist/generated/graphql.d.ts.map +1 -1
- package/dist/generated/graphql.js +22 -321
- package/dist/grid-mods/exec-client-halves.d.ts +156 -0
- package/dist/grid-mods/exec-client-halves.d.ts.map +1 -0
- package/dist/grid-mods/exec-client-halves.js +356 -0
- package/dist/grid-mods/grid-host-calls.d.ts +29 -15
- package/dist/grid-mods/grid-host-calls.d.ts.map +1 -1
- package/dist/grid-mods/grid-host-calls.js +40 -44
- package/dist/grid-mods/index.d.ts +1 -0
- package/dist/grid-mods/index.d.ts.map +1 -1
- package/dist/grid-mods/index.js +1 -0
- package/dist/grid-mods/mod-runtime.d.ts +21 -6
- package/dist/grid-mods/mod-runtime.d.ts.map +1 -1
- package/dist/grid-mods/mod-runtime.js +6 -2
- package/dist/grid-scope.d.ts +0 -188
- package/dist/grid-scope.d.ts.map +1 -1
- package/dist/grid-scope.js +0 -69
- package/dist/index.d.ts +12 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -16
- package/dist/kit/actions.d.ts +5 -9
- package/dist/kit/actions.d.ts.map +1 -1
- package/dist/kit/actions.js +5 -9
- package/dist/kit/index.d.ts +2 -33
- package/dist/kit/index.d.ts.map +1 -1
- package/dist/kit/index.js +1 -32
- package/dist/kit/kit.d.ts +8 -208
- package/dist/kit/kit.d.ts.map +1 -1
- package/dist/kit/kit.js +5 -163
- package/dist/kit/social.d.ts +1 -3
- package/dist/kit/social.d.ts.map +1 -1
- package/dist/kit/social.js +1 -3
- package/dist/kit/wire.d.ts +16 -5
- package/dist/kit/wire.d.ts.map +1 -1
- package/dist/kit/wire.js +19 -5
- 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 +1496 -4386
- package/dist/live-coding/rust-analysis.d.ts.map +1 -1
- package/dist/live-coding/rust-analysis.js +31 -23
- package/dist/player-runtime/client-host-calls.d.ts +8 -0
- package/dist/player-runtime/client-host-calls.d.ts.map +1 -0
- package/dist/player-runtime/client-host-calls.js +28 -0
- package/dist/player-runtime/glue-runtime.d.ts +27 -10
- package/dist/player-runtime/glue-runtime.d.ts.map +1 -1
- package/dist/player-runtime/glue-runtime.js +40 -45
- package/dist/player-runtime/glue-sab.d.ts +2 -2
- package/dist/player-runtime/glue-sab.js +2 -2
- package/dist/player-runtime/player-code-broker.d.ts +80 -24
- package/dist/player-runtime/player-code-broker.d.ts.map +1 -1
- package/dist/player-runtime/player-code-broker.js +169 -41
- package/dist/player-runtime/player-glue-worker.d.ts +8 -8
- package/dist/player-runtime/player-glue-worker.d.ts.map +1 -1
- package/dist/player-runtime/player-glue-worker.js +26 -9
- package/dist/stores/actors.d.ts +12 -2
- package/dist/stores/actors.d.ts.map +1 -1
- package/dist/stores/actors.js +43 -18
- package/dist/stores/chunks.d.ts +12 -0
- package/dist/stores/chunks.d.ts.map +1 -1
- package/dist/stores/chunks.js +112 -39
- package/dist/stores/durable.d.ts.map +1 -1
- package/dist/stores/durable.js +2 -1
- package/dist/stores/inbox.d.ts +1 -1
- package/dist/stores/inbox.d.ts.map +1 -1
- package/dist/stores/index.d.ts +0 -11
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/stores/index.js +0 -4
- package/dist/stores/session.d.ts +0 -2
- package/dist/stores/session.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/crowdy-studio/model-lint-log.d.ts +0 -76
- package/dist/crowdy-studio/model-lint-log.d.ts.map +0 -1
- package/dist/crowdy-studio/model-lint-log.js +0 -93
- package/dist/crowdy-studio/model-lint.d.ts +0 -61
- package/dist/crowdy-studio/model-lint.d.ts.map +0 -1
- package/dist/crowdy-studio/model-lint.js +0 -45
- package/dist/domains/compute.d.ts +0 -208
- package/dist/domains/compute.d.ts.map +0 -1
- package/dist/domains/compute.js +0 -274
- package/dist/domains/controlPlane.d.ts +0 -38
- package/dist/domains/controlPlane.d.ts.map +0 -1
- package/dist/domains/controlPlane.js +0 -43
- package/dist/domains/gameModel.d.ts +0 -1174
- package/dist/domains/gameModel.d.ts.map +0 -1
- package/dist/domains/gameModel.js +0 -1333
- package/dist/domains/playerCompute.d.ts +0 -91
- package/dist/domains/playerCompute.d.ts.map +0 -1
- package/dist/domains/playerCompute.js +0 -136
- package/dist/domains/playerModel.d.ts +0 -20
- package/dist/domains/playerModel.d.ts.map +0 -1
- package/dist/domains/playerModel.js +0 -54
- package/dist/kit/abilities.d.ts +0 -66
- package/dist/kit/abilities.d.ts.map +0 -1
- package/dist/kit/abilities.js +0 -71
- package/dist/kit/blueprints/combat.d.ts +0 -81
- package/dist/kit/blueprints/combat.d.ts.map +0 -1
- package/dist/kit/blueprints/combat.js +0 -357
- package/dist/kit/blueprints/core.d.ts +0 -222
- package/dist/kit/blueprints/core.d.ts.map +0 -1
- package/dist/kit/blueprints/core.js +0 -185
- package/dist/kit/blueprints/decks.d.ts +0 -50
- package/dist/kit/blueprints/decks.d.ts.map +0 -1
- package/dist/kit/blueprints/decks.js +0 -163
- package/dist/kit/blueprints/economy.d.ts +0 -88
- package/dist/kit/blueprints/economy.d.ts.map +0 -1
- package/dist/kit/blueprints/economy.js +0 -533
- package/dist/kit/blueprints/guild.d.ts +0 -51
- package/dist/kit/blueprints/guild.d.ts.map +0 -1
- package/dist/kit/blueprints/guild.js +0 -50
- package/dist/kit/blueprints/index.d.ts +0 -23
- package/dist/kit/blueprints/index.d.ts.map +0 -1
- package/dist/kit/blueprints/index.js +0 -22
- package/dist/kit/blueprints/inventory.d.ts +0 -84
- package/dist/kit/blueprints/inventory.d.ts.map +0 -1
- package/dist/kit/blueprints/inventory.js +0 -257
- package/dist/kit/blueprints/leaderboards.d.ts +0 -49
- package/dist/kit/blueprints/leaderboards.d.ts.map +0 -1
- package/dist/kit/blueprints/leaderboards.js +0 -126
- package/dist/kit/blueprints/liveops.d.ts +0 -42
- package/dist/kit/blueprints/liveops.d.ts.map +0 -1
- package/dist/kit/blueprints/liveops.js +0 -170
- package/dist/kit/blueprints/locks.d.ts +0 -82
- package/dist/kit/blueprints/locks.d.ts.map +0 -1
- package/dist/kit/blueprints/locks.js +0 -155
- package/dist/kit/blueprints/loot.d.ts +0 -90
- package/dist/kit/blueprints/loot.d.ts.map +0 -1
- package/dist/kit/blueprints/loot.js +0 -229
- package/dist/kit/blueprints/matches.d.ts +0 -84
- package/dist/kit/blueprints/matches.d.ts.map +0 -1
- package/dist/kit/blueprints/matches.js +0 -349
- package/dist/kit/blueprints/moderation.d.ts +0 -32
- package/dist/kit/blueprints/moderation.d.ts.map +0 -1
- package/dist/kit/blueprints/moderation.js +0 -140
- package/dist/kit/blueprints/npcs.d.ts +0 -78
- package/dist/kit/blueprints/npcs.d.ts.map +0 -1
- package/dist/kit/blueprints/npcs.js +0 -125
- package/dist/kit/blueprints/plots.d.ts +0 -63
- package/dist/kit/blueprints/plots.d.ts.map +0 -1
- package/dist/kit/blueprints/plots.js +0 -151
- package/dist/kit/blueprints/progression.d.ts +0 -68
- package/dist/kit/blueprints/progression.d.ts.map +0 -1
- package/dist/kit/blueprints/progression.js +0 -324
- package/dist/kit/blueprints/quests.d.ts +0 -72
- package/dist/kit/blueprints/quests.d.ts.map +0 -1
- package/dist/kit/blueprints/quests.js +0 -285
- package/dist/kit/blueprints/worldsim.d.ts +0 -91
- package/dist/kit/blueprints/worldsim.d.ts.map +0 -1
- package/dist/kit/blueprints/worldsim.js +0 -468
- package/dist/kit/combat.d.ts +0 -141
- package/dist/kit/combat.d.ts.map +0 -1
- package/dist/kit/combat.js +0 -196
- package/dist/kit/decks.d.ts +0 -157
- package/dist/kit/decks.d.ts.map +0 -1
- package/dist/kit/decks.js +0 -186
- package/dist/kit/director.d.ts +0 -88
- package/dist/kit/director.d.ts.map +0 -1
- package/dist/kit/director.js +0 -86
- package/dist/kit/economy.d.ts +0 -289
- package/dist/kit/economy.d.ts.map +0 -1
- package/dist/kit/economy.js +0 -427
- package/dist/kit/engine.d.ts +0 -48
- package/dist/kit/engine.d.ts.map +0 -1
- package/dist/kit/engine.js +0 -113
- package/dist/kit/features.d.ts +0 -60
- package/dist/kit/features.d.ts.map +0 -1
- package/dist/kit/features.js +0 -65
- package/dist/kit/instances.d.ts +0 -52
- package/dist/kit/instances.d.ts.map +0 -1
- package/dist/kit/instances.js +0 -60
- package/dist/kit/inventory.d.ts +0 -129
- package/dist/kit/inventory.d.ts.map +0 -1
- package/dist/kit/inventory.js +0 -200
- package/dist/kit/leaderboards.d.ts +0 -86
- package/dist/kit/leaderboards.d.ts.map +0 -1
- package/dist/kit/leaderboards.js +0 -133
- package/dist/kit/liveops.d.ts +0 -112
- package/dist/kit/liveops.d.ts.map +0 -1
- package/dist/kit/liveops.js +0 -183
- package/dist/kit/loot.d.ts +0 -128
- package/dist/kit/loot.d.ts.map +0 -1
- package/dist/kit/loot.js +0 -160
- package/dist/kit/matches.d.ts +0 -301
- package/dist/kit/matches.d.ts.map +0 -1
- package/dist/kit/matches.js +0 -458
- package/dist/kit/matchmaking.d.ts +0 -57
- package/dist/kit/matchmaking.d.ts.map +0 -1
- package/dist/kit/matchmaking.js +0 -59
- package/dist/kit/minigames.d.ts +0 -30
- package/dist/kit/minigames.d.ts.map +0 -1
- package/dist/kit/minigames.js +0 -38
- package/dist/kit/mobs.d.ts +0 -90
- package/dist/kit/mobs.d.ts.map +0 -1
- package/dist/kit/mobs.js +0 -98
- package/dist/kit/moderation.d.ts +0 -73
- package/dist/kit/moderation.d.ts.map +0 -1
- package/dist/kit/moderation.js +0 -103
- package/dist/kit/movement.d.ts +0 -78
- package/dist/kit/movement.d.ts.map +0 -1
- package/dist/kit/movement.js +0 -103
- package/dist/kit/notifications.d.ts +0 -45
- package/dist/kit/notifications.d.ts.map +0 -1
- package/dist/kit/notifications.js +0 -67
- package/dist/kit/npcs.d.ts +0 -226
- package/dist/kit/npcs.d.ts.map +0 -1
- package/dist/kit/npcs.js +0 -141
- package/dist/kit/objects.d.ts +0 -116
- package/dist/kit/objects.d.ts.map +0 -1
- package/dist/kit/objects.js +0 -119
- package/dist/kit/pets.d.ts +0 -85
- package/dist/kit/pets.d.ts.map +0 -1
- package/dist/kit/pets.js +0 -96
- package/dist/kit/plots.d.ts +0 -85
- package/dist/kit/plots.d.ts.map +0 -1
- package/dist/kit/plots.js +0 -113
- package/dist/kit/progression.d.ts +0 -181
- package/dist/kit/progression.d.ts.map +0 -1
- package/dist/kit/progression.js +0 -265
- package/dist/kit/quests.d.ts +0 -171
- package/dist/kit/quests.d.ts.map +0 -1
- package/dist/kit/quests.js +0 -237
- package/dist/kit/racing.d.ts +0 -85
- package/dist/kit/racing.d.ts.map +0 -1
- package/dist/kit/racing.js +0 -99
- package/dist/kit/shared.d.ts +0 -73
- package/dist/kit/shared.d.ts.map +0 -1
- package/dist/kit/shared.js +0 -101
- package/dist/kit/telemetry.d.ts +0 -66
- package/dist/kit/telemetry.d.ts.map +0 -1
- package/dist/kit/telemetry.js +0 -133
- package/dist/kit/territory.d.ts +0 -97
- package/dist/kit/territory.d.ts.map +0 -1
- package/dist/kit/territory.js +0 -114
- package/dist/kit/worldsim.d.ts +0 -263
- package/dist/kit/worldsim.d.ts.map +0 -1
- package/dist/kit/worldsim.js +0 -268
- package/dist/stores/model.d.ts +0 -81
- package/dist/stores/model.d.ts.map +0 -1
- package/dist/stores/model.js +0 -163
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import type { GraphQLClient } from '../client.js';
|
|
2
|
-
import { type PlayerComputeArtifactQuery, type PlayerComputeArtifactQueryVariables, type PlayerComputeUsageQuery, type PlayerComputeUsageQueryVariables, type PlayerComputeRunsQuery, type PlayerComputeRunsQueryVariables, type PlayerComputeLogsQuery, type PlayerComputeLogsQueryVariables, type PlayerComputeSetSwitchMutation, type PlayerComputeSetSwitchMutationVariables, type PlayerComputeSwitchesQuery, type PlayerComputeSwitchesQueryVariables, type PlayerComputeDeployMutation, type PlayerComputeDeployMutationVariables, type PlayerComputeSetEnabledMutation, type PlayerComputeSetEnabledMutationVariables, type PlayerComputeSetRequiresMutation, type PlayerComputeSetRequiresMutationVariables, type PlayerComputeMyModulesQuery, type PlayerComputeMyModulesQueryVariables, type PlayerComputeVersionsQuery, type PlayerComputeVersionsQueryVariables, type PlayerComputeDeleteMutation, type PlayerComputeDeleteMutationVariables, type PlayerComputeInvokeMutation, type PlayerComputeInvokeMutationVariables } from '../generated/graphql.js';
|
|
3
|
-
/**
|
|
4
|
-
* Player-authored Rust/WASM bound to player-owned grids — exposed as
|
|
5
|
-
* `client.playerCompute` and routed to the Game API.
|
|
6
|
-
*
|
|
7
|
-
* Deploying requires current grid ownership plus the target-specific
|
|
8
|
-
* `write_server_code` or `write_client_code` permission at both the app-tier
|
|
9
|
-
* and grid ACL layers. Enabling separately requires the matching run
|
|
10
|
-
* permission, a successful compile, and app admission when strict allow-list
|
|
11
|
-
* mode is active. Closed source remains visible only to its personal author.
|
|
12
|
-
*/
|
|
13
|
-
export declare class PlayerComputeAPI {
|
|
14
|
-
private readonly graphql;
|
|
15
|
-
constructor(graphql: GraphQLClient);
|
|
16
|
-
/**
|
|
17
|
-
* Create or update a grid-bound module and publish an immutable pending
|
|
18
|
-
* source version. Compilation is asynchronous.
|
|
19
|
-
*/
|
|
20
|
-
deploy(input: PlayerComputeDeployMutationVariables['input']): Promise<PlayerComputeDeployMutation['playerComputeDeploy']>;
|
|
21
|
-
/**
|
|
22
|
-
* Request activation or stop execution. Enabling checks ownership, run
|
|
23
|
-
* permission, compile success, and app code admission independently of
|
|
24
|
-
* authoring permission.
|
|
25
|
-
*/
|
|
26
|
-
setEnabled(variables: PlayerComputeSetEnabledMutationVariables): Promise<PlayerComputeSetEnabledMutation['playerComputeSetEnabled']>;
|
|
27
|
-
/**
|
|
28
|
-
* Set or clear the required CLIENT companion for the current SERVER module
|
|
29
|
-
* version. Both modules must be caller-authored, compiled, and in the same
|
|
30
|
-
* owned grid; pass `requiredClientName: null` to clear the edge.
|
|
31
|
-
*/
|
|
32
|
-
setRequires(variables: PlayerComputeSetRequiresMutationVariables): Promise<PlayerComputeSetRequiresMutation['playerComputeSetRequires']>;
|
|
33
|
-
/**
|
|
34
|
-
* List modules authored by the caller or installed on grids they currently
|
|
35
|
-
* own. Closed source is not included in this module-level result.
|
|
36
|
-
*/
|
|
37
|
-
myModules(variables: PlayerComputeMyModulesQueryVariables): Promise<PlayerComputeMyModulesQuery['playerComputeMyModules']>;
|
|
38
|
-
/**
|
|
39
|
-
* List immutable versions newest-first. Source and compile logs are redacted
|
|
40
|
-
* unless the caller is the personal author or the version is open source.
|
|
41
|
-
*/
|
|
42
|
-
versions(variables: PlayerComputeVersionsQueryVariables): Promise<PlayerComputeVersionsQuery['playerComputeVersions']>;
|
|
43
|
-
/**
|
|
44
|
-
* Delete a self-authored module and its versions. The caller must still own
|
|
45
|
-
* the grid. Returns false when no matching module exists.
|
|
46
|
-
*/
|
|
47
|
-
delete(variables: PlayerComputeDeleteMutationVariables): Promise<PlayerComputeDeleteMutation['playerComputeDelete']>;
|
|
48
|
-
/** Invoke an enabled/admitted server module synchronously as the grid owner. */
|
|
49
|
-
invoke(variables: PlayerComputeInvokeMutationVariables): Promise<PlayerComputeInvokeMutation['playerComputeInvoke']>;
|
|
50
|
-
/**
|
|
51
|
-
* The caller's spend/quota view for one app (P2): compute units burned in
|
|
52
|
-
* the current clock hour/day vs the effective policy caps, compile-quota
|
|
53
|
-
* utilization, and the wallet/spend-cap gate state with its typed reason
|
|
54
|
-
* (PLAYER_QUOTA_EXHAUSTED / PLAYER_WALLET_EMPTY / PLAYER_SPEND_CAP /
|
|
55
|
-
* PLAYER_COMPUTE_KILLED). The remaining-budget source for a live cost
|
|
56
|
-
* meter.
|
|
57
|
-
*/
|
|
58
|
-
usage(variables: PlayerComputeUsageQueryVariables): Promise<PlayerComputeUsageQuery['playerComputeUsage']>;
|
|
59
|
-
/** Executions on an owned grid, newest first (attributed to the grid owner). */
|
|
60
|
-
runs(variables: PlayerComputeRunsQueryVariables): Promise<PlayerComputeRunsQuery['playerComputeRuns']>;
|
|
61
|
-
/** Failed-run diagnostics on an owned grid (typed error kinds), newest first. */
|
|
62
|
-
logs(variables: PlayerComputeLogsQueryVariables): Promise<PlayerComputeLogsQuery['playerComputeLogs']>;
|
|
63
|
-
/**
|
|
64
|
-
* Throw or release a kill-ladder switch at player/grid/app scope (studio,
|
|
65
|
-
* requires `manage_compute`). Quota state is retained across a kill.
|
|
66
|
-
*/
|
|
67
|
-
setSwitch(variables: PlayerComputeSetSwitchMutationVariables): Promise<PlayerComputeSetSwitchMutation['playerComputeSetSwitch']>;
|
|
68
|
-
/** Active kill-ladder switches (studio, requires `view_compute_diagnostics`). */
|
|
69
|
-
switches(variables: PlayerComputeSwitchesQueryVariables): Promise<PlayerComputeSwitchesQuery['playerComputeSwitches']>;
|
|
70
|
-
/**
|
|
71
|
-
* Fetch a compiled CLIENT artifact + metadata for the browser broker (P3).
|
|
72
|
-
* Fail-closed server-side (ownership, authorship, run_client_code,
|
|
73
|
-
* admission). Returns the metadata as-is; use {@link artifactBytes} to get
|
|
74
|
-
* the decoded ArrayBuffer ready to hand {@link PlayerCodeBroker.start}.
|
|
75
|
-
*/
|
|
76
|
-
artifact(variables: PlayerComputeArtifactQueryVariables): Promise<PlayerComputeArtifactQuery['playerComputeArtifact']>;
|
|
77
|
-
/**
|
|
78
|
-
* Fetch a client artifact and decode its bytes to an ArrayBuffer plus the
|
|
79
|
-
* broker inputs (content hash for side-load verification, per-dispatch fuel
|
|
80
|
-
* budget). Convenience over {@link artifact} for the Crowdy Studio CLIENT
|
|
81
|
-
* deploy loop.
|
|
82
|
-
*/
|
|
83
|
-
artifactBytes(variables: PlayerComputeArtifactQueryVariables): Promise<{
|
|
84
|
-
bytes: ArrayBuffer;
|
|
85
|
-
artifactHash: string;
|
|
86
|
-
fuelPerDispatch: bigint;
|
|
87
|
-
contractJson: string | null;
|
|
88
|
-
versionId: string;
|
|
89
|
-
}>;
|
|
90
|
-
}
|
|
91
|
-
//# sourceMappingURL=playerCompute.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"playerCompute.d.ts","sourceRoot":"","sources":["../../src/domains/playerCompute.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { PlayerComputeDeployDocument, PlayerComputeSetEnabledDocument, PlayerComputeSetRequiresDocument, PlayerComputeMyModulesDocument, PlayerComputeVersionsDocument, PlayerComputeDeleteDocument, PlayerComputeInvokeDocument, PlayerComputeUsageDocument, PlayerComputeRunsDocument, PlayerComputeLogsDocument, PlayerComputeSetSwitchDocument, PlayerComputeSwitchesDocument, PlayerComputeArtifactDocument, } from '../generated/graphql.js';
|
|
2
|
-
/**
|
|
3
|
-
* Player-authored Rust/WASM bound to player-owned grids — exposed as
|
|
4
|
-
* `client.playerCompute` and routed to the Game API.
|
|
5
|
-
*
|
|
6
|
-
* Deploying requires current grid ownership plus the target-specific
|
|
7
|
-
* `write_server_code` or `write_client_code` permission at both the app-tier
|
|
8
|
-
* and grid ACL layers. Enabling separately requires the matching run
|
|
9
|
-
* permission, a successful compile, and app admission when strict allow-list
|
|
10
|
-
* mode is active. Closed source remains visible only to its personal author.
|
|
11
|
-
*/
|
|
12
|
-
export class PlayerComputeAPI {
|
|
13
|
-
constructor(graphql) {
|
|
14
|
-
this.graphql = graphql;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Create or update a grid-bound module and publish an immutable pending
|
|
18
|
-
* source version. Compilation is asynchronous.
|
|
19
|
-
*/
|
|
20
|
-
async deploy(input) {
|
|
21
|
-
const data = await this.graphql.request(PlayerComputeDeployDocument, { input });
|
|
22
|
-
return data.playerComputeDeploy;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Request activation or stop execution. Enabling checks ownership, run
|
|
26
|
-
* permission, compile success, and app code admission independently of
|
|
27
|
-
* authoring permission.
|
|
28
|
-
*/
|
|
29
|
-
async setEnabled(variables) {
|
|
30
|
-
const data = await this.graphql.request(PlayerComputeSetEnabledDocument, variables);
|
|
31
|
-
return data.playerComputeSetEnabled;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Set or clear the required CLIENT companion for the current SERVER module
|
|
35
|
-
* version. Both modules must be caller-authored, compiled, and in the same
|
|
36
|
-
* owned grid; pass `requiredClientName: null` to clear the edge.
|
|
37
|
-
*/
|
|
38
|
-
async setRequires(variables) {
|
|
39
|
-
const data = await this.graphql.request(PlayerComputeSetRequiresDocument, variables);
|
|
40
|
-
return data.playerComputeSetRequires;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* List modules authored by the caller or installed on grids they currently
|
|
44
|
-
* own. Closed source is not included in this module-level result.
|
|
45
|
-
*/
|
|
46
|
-
async myModules(variables) {
|
|
47
|
-
const data = await this.graphql.request(PlayerComputeMyModulesDocument, variables);
|
|
48
|
-
return data.playerComputeMyModules;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* List immutable versions newest-first. Source and compile logs are redacted
|
|
52
|
-
* unless the caller is the personal author or the version is open source.
|
|
53
|
-
*/
|
|
54
|
-
async versions(variables) {
|
|
55
|
-
const data = await this.graphql.request(PlayerComputeVersionsDocument, variables);
|
|
56
|
-
return data.playerComputeVersions;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Delete a self-authored module and its versions. The caller must still own
|
|
60
|
-
* the grid. Returns false when no matching module exists.
|
|
61
|
-
*/
|
|
62
|
-
async delete(variables) {
|
|
63
|
-
const data = await this.graphql.request(PlayerComputeDeleteDocument, variables);
|
|
64
|
-
return data.playerComputeDelete;
|
|
65
|
-
}
|
|
66
|
-
/** Invoke an enabled/admitted server module synchronously as the grid owner. */
|
|
67
|
-
async invoke(variables) {
|
|
68
|
-
const data = await this.graphql.request(PlayerComputeInvokeDocument, variables);
|
|
69
|
-
return data.playerComputeInvoke;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* The caller's spend/quota view for one app (P2): compute units burned in
|
|
73
|
-
* the current clock hour/day vs the effective policy caps, compile-quota
|
|
74
|
-
* utilization, and the wallet/spend-cap gate state with its typed reason
|
|
75
|
-
* (PLAYER_QUOTA_EXHAUSTED / PLAYER_WALLET_EMPTY / PLAYER_SPEND_CAP /
|
|
76
|
-
* PLAYER_COMPUTE_KILLED). The remaining-budget source for a live cost
|
|
77
|
-
* meter.
|
|
78
|
-
*/
|
|
79
|
-
async usage(variables) {
|
|
80
|
-
const data = await this.graphql.request(PlayerComputeUsageDocument, variables);
|
|
81
|
-
return data.playerComputeUsage;
|
|
82
|
-
}
|
|
83
|
-
/** Executions on an owned grid, newest first (attributed to the grid owner). */
|
|
84
|
-
async runs(variables) {
|
|
85
|
-
const data = await this.graphql.request(PlayerComputeRunsDocument, variables);
|
|
86
|
-
return data.playerComputeRuns;
|
|
87
|
-
}
|
|
88
|
-
/** Failed-run diagnostics on an owned grid (typed error kinds), newest first. */
|
|
89
|
-
async logs(variables) {
|
|
90
|
-
const data = await this.graphql.request(PlayerComputeLogsDocument, variables);
|
|
91
|
-
return data.playerComputeLogs;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Throw or release a kill-ladder switch at player/grid/app scope (studio,
|
|
95
|
-
* requires `manage_compute`). Quota state is retained across a kill.
|
|
96
|
-
*/
|
|
97
|
-
async setSwitch(variables) {
|
|
98
|
-
const data = await this.graphql.request(PlayerComputeSetSwitchDocument, variables);
|
|
99
|
-
return data.playerComputeSetSwitch;
|
|
100
|
-
}
|
|
101
|
-
/** Active kill-ladder switches (studio, requires `view_compute_diagnostics`). */
|
|
102
|
-
async switches(variables) {
|
|
103
|
-
const data = await this.graphql.request(PlayerComputeSwitchesDocument, variables);
|
|
104
|
-
return data.playerComputeSwitches;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Fetch a compiled CLIENT artifact + metadata for the browser broker (P3).
|
|
108
|
-
* Fail-closed server-side (ownership, authorship, run_client_code,
|
|
109
|
-
* admission). Returns the metadata as-is; use {@link artifactBytes} to get
|
|
110
|
-
* the decoded ArrayBuffer ready to hand {@link PlayerCodeBroker.start}.
|
|
111
|
-
*/
|
|
112
|
-
async artifact(variables) {
|
|
113
|
-
const data = await this.graphql.request(PlayerComputeArtifactDocument, variables);
|
|
114
|
-
return data.playerComputeArtifact;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Fetch a client artifact and decode its bytes to an ArrayBuffer plus the
|
|
118
|
-
* broker inputs (content hash for side-load verification, per-dispatch fuel
|
|
119
|
-
* budget). Convenience over {@link artifact} for the Crowdy Studio CLIENT
|
|
120
|
-
* deploy loop.
|
|
121
|
-
*/
|
|
122
|
-
async artifactBytes(variables) {
|
|
123
|
-
const a = await this.artifact(variables);
|
|
124
|
-
const binary = atob(a.artifactBase64);
|
|
125
|
-
const bytes = new Uint8Array(binary.length);
|
|
126
|
-
for (let i = 0; i < binary.length; i++)
|
|
127
|
-
bytes[i] = binary.charCodeAt(i);
|
|
128
|
-
return {
|
|
129
|
-
bytes: bytes.buffer,
|
|
130
|
-
artifactHash: a.artifactHash,
|
|
131
|
-
fuelPerDispatch: BigInt(a.clientFuelPerDispatch),
|
|
132
|
-
contractJson: a.contractJson ?? null,
|
|
133
|
-
versionId: a.versionId,
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { GraphQLClient } from '../client.js';
|
|
2
|
-
import { type PlayerModelContainersQuery, type PlayerModelContainersQueryVariables, type PlayerModelContainerQuery, type PlayerModelContainerQueryVariables, type PlayerModelCreateContainerMutation, type PlayerModelCreateContainerMutationVariables, type PlayerModelSetPropertyMutation, type PlayerModelSetPropertyMutationVariables, type PlayerModelDeleteContainerMutation, type PlayerModelDeleteContainerMutationVariables, type PlayerAutomationsQuery, type PlayerAutomationsQueryVariables, type PlayerAutomationCreateMutation, type PlayerAutomationCreateMutationVariables, type PlayerAutomationSetEnabledMutation, type PlayerAutomationSetEnabledMutationVariables, type PlayerAutomationDeleteMutation, type PlayerAutomationDeleteMutationVariables } from '../generated/graphql.js';
|
|
3
|
-
/**
|
|
4
|
-
* Grid-owner Model data and Automations. Every operation is forced to the
|
|
5
|
-
* current caller + owned grid by game-api; no studio gm_* row is reachable.
|
|
6
|
-
*/
|
|
7
|
-
export declare class PlayerModelAPI {
|
|
8
|
-
private readonly graphql;
|
|
9
|
-
constructor(graphql: GraphQLClient);
|
|
10
|
-
containers(variables: PlayerModelContainersQueryVariables): Promise<PlayerModelContainersQuery['playerModelContainers']>;
|
|
11
|
-
container(input: PlayerModelContainerQueryVariables['input']): Promise<PlayerModelContainerQuery['playerModelContainer']>;
|
|
12
|
-
createContainer(input: PlayerModelCreateContainerMutationVariables['input']): Promise<PlayerModelCreateContainerMutation['playerModelCreateContainer']>;
|
|
13
|
-
setProperty(input: PlayerModelSetPropertyMutationVariables['input']): Promise<PlayerModelSetPropertyMutation['playerModelSetProperty']>;
|
|
14
|
-
deleteContainer(input: PlayerModelDeleteContainerMutationVariables['input']): Promise<PlayerModelDeleteContainerMutation['playerModelDeleteContainer']>;
|
|
15
|
-
automations(variables: PlayerAutomationsQueryVariables): Promise<PlayerAutomationsQuery['playerAutomations']>;
|
|
16
|
-
createAutomation(input: PlayerAutomationCreateMutationVariables['input']): Promise<PlayerAutomationCreateMutation['playerAutomationCreate']>;
|
|
17
|
-
setAutomationEnabled(input: PlayerAutomationSetEnabledMutationVariables['input']): Promise<PlayerAutomationSetEnabledMutation['playerAutomationSetEnabled']>;
|
|
18
|
-
deleteAutomation(input: PlayerAutomationDeleteMutationVariables['input']): Promise<PlayerAutomationDeleteMutation['playerAutomationDelete']>;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=playerModel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"playerModel.d.ts","sourceRoot":"","sources":["../../src/domains/playerModel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAUL,KAAK,0BAA0B,EAC/B,KAAK,mCAAmC,EACxC,KAAK,yBAAyB,EAC9B,KAAK,kCAAkC,EACvC,KAAK,kCAAkC,EACvC,KAAK,2CAA2C,EAChD,KAAK,8BAA8B,EACnC,KAAK,uCAAuC,EAC5C,KAAK,kCAAkC,EACvC,KAAK,2CAA2C,EAChD,KAAK,sBAAsB,EAC3B,KAAK,+BAA+B,EACpC,KAAK,8BAA8B,EACnC,KAAK,uCAAuC,EAC5C,KAAK,kCAAkC,EACvC,KAAK,2CAA2C,EAChD,KAAK,8BAA8B,EACnC,KAAK,uCAAuC,EAC7C,MAAM,yBAAyB,CAAC;AAEjC;;;GAGG;AACH,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,aAAa;IAE7C,UAAU,CACd,SAAS,EAAE,mCAAmC,GAC7C,OAAO,CAAC,0BAA0B,CAAC,uBAAuB,CAAC,CAAC;IAQzD,SAAS,CACb,KAAK,EAAE,kCAAkC,CAAC,OAAO,CAAC,GACjD,OAAO,CAAC,yBAAyB,CAAC,sBAAsB,CAAC,CAAC;IAOvD,eAAe,CACnB,KAAK,EAAE,2CAA2C,CAAC,OAAO,CAAC,GAC1D,OAAO,CAAC,kCAAkC,CAAC,4BAA4B,CAAC,CAAC;IAQtE,WAAW,CACf,KAAK,EAAE,uCAAuC,CAAC,OAAO,CAAC,GACtD,OAAO,CAAC,8BAA8B,CAAC,wBAAwB,CAAC,CAAC;IAO9D,eAAe,CACnB,KAAK,EAAE,2CAA2C,CAAC,OAAO,CAAC,GAC1D,OAAO,CAAC,kCAAkC,CAAC,4BAA4B,CAAC,CAAC;IAQtE,WAAW,CACf,SAAS,EAAE,+BAA+B,GACzC,OAAO,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,CAAC;IAQjD,gBAAgB,CACpB,KAAK,EAAE,uCAAuC,CAAC,OAAO,CAAC,GACtD,OAAO,CAAC,8BAA8B,CAAC,wBAAwB,CAAC,CAAC;IAO9D,oBAAoB,CACxB,KAAK,EAAE,2CAA2C,CAAC,OAAO,CAAC,GAC1D,OAAO,CACR,kCAAkC,CAAC,4BAA4B,CAAC,CACjE;IAQK,gBAAgB,CACpB,KAAK,EAAE,uCAAuC,CAAC,OAAO,CAAC,GACtD,OAAO,CAAC,8BAA8B,CAAC,wBAAwB,CAAC,CAAC;CAMrE"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { PlayerModelContainersDocument, PlayerModelContainerDocument, PlayerModelCreateContainerDocument, PlayerModelSetPropertyDocument, PlayerModelDeleteContainerDocument, PlayerAutomationsDocument, PlayerAutomationCreateDocument, PlayerAutomationSetEnabledDocument, PlayerAutomationDeleteDocument, } from '../generated/graphql.js';
|
|
2
|
-
/**
|
|
3
|
-
* Grid-owner Model data and Automations. Every operation is forced to the
|
|
4
|
-
* current caller + owned grid by game-api; no studio gm_* row is reachable.
|
|
5
|
-
*/
|
|
6
|
-
export class PlayerModelAPI {
|
|
7
|
-
constructor(graphql) {
|
|
8
|
-
this.graphql = graphql;
|
|
9
|
-
}
|
|
10
|
-
async containers(variables) {
|
|
11
|
-
const data = await this.graphql.request(PlayerModelContainersDocument, variables);
|
|
12
|
-
return data.playerModelContainers;
|
|
13
|
-
}
|
|
14
|
-
async container(input) {
|
|
15
|
-
const data = await this.graphql.request(PlayerModelContainerDocument, {
|
|
16
|
-
input,
|
|
17
|
-
});
|
|
18
|
-
return data.playerModelContainer;
|
|
19
|
-
}
|
|
20
|
-
async createContainer(input) {
|
|
21
|
-
const data = await this.graphql.request(PlayerModelCreateContainerDocument, { input });
|
|
22
|
-
return data.playerModelCreateContainer;
|
|
23
|
-
}
|
|
24
|
-
async setProperty(input) {
|
|
25
|
-
const data = await this.graphql.request(PlayerModelSetPropertyDocument, {
|
|
26
|
-
input,
|
|
27
|
-
});
|
|
28
|
-
return data.playerModelSetProperty;
|
|
29
|
-
}
|
|
30
|
-
async deleteContainer(input) {
|
|
31
|
-
const data = await this.graphql.request(PlayerModelDeleteContainerDocument, { input });
|
|
32
|
-
return data.playerModelDeleteContainer;
|
|
33
|
-
}
|
|
34
|
-
async automations(variables) {
|
|
35
|
-
const data = await this.graphql.request(PlayerAutomationsDocument, variables);
|
|
36
|
-
return data.playerAutomations;
|
|
37
|
-
}
|
|
38
|
-
async createAutomation(input) {
|
|
39
|
-
const data = await this.graphql.request(PlayerAutomationCreateDocument, {
|
|
40
|
-
input,
|
|
41
|
-
});
|
|
42
|
-
return data.playerAutomationCreate;
|
|
43
|
-
}
|
|
44
|
-
async setAutomationEnabled(input) {
|
|
45
|
-
const data = await this.graphql.request(PlayerAutomationSetEnabledDocument, { input });
|
|
46
|
-
return data.playerAutomationSetEnabled;
|
|
47
|
-
}
|
|
48
|
-
async deleteAutomation(input) {
|
|
49
|
-
const data = await this.graphql.request(PlayerAutomationDeleteDocument, {
|
|
50
|
-
input,
|
|
51
|
-
});
|
|
52
|
-
return data.playerAutomationDelete;
|
|
53
|
-
}
|
|
54
|
-
}
|
package/dist/kit/abilities.d.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type { GameModelAPI } from '../domains/gameModel.js';
|
|
2
|
-
import type { Scalars } from '../generated/graphql.js';
|
|
3
|
-
import type { EngineDetector } from './engine.js';
|
|
4
|
-
import { type AbilityEvent } from './wire.js';
|
|
5
|
-
/** Options for {@link AbilitiesKit}. */
|
|
6
|
-
export interface AbilitiesKitOptions {
|
|
7
|
-
/** The abilities engine module name. Defaults to `'abilities-engine'`. */
|
|
8
|
-
moduleName?: string;
|
|
9
|
-
/** The ability-definition container type. Defaults to `'AbilityDef'`. */
|
|
10
|
-
defTypeName?: string;
|
|
11
|
-
}
|
|
12
|
-
/** One ability as the engine's loadout reports it. */
|
|
13
|
-
export interface KitAbility {
|
|
14
|
-
abilityId: string;
|
|
15
|
-
cooldownMs: number;
|
|
16
|
-
resourceCost: number;
|
|
17
|
-
range: number;
|
|
18
|
-
kind: 'instant' | 'projectile' | 'aoe' | string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Runtime helpers for the abilities engine (Wave 3): realtime casts with
|
|
22
|
-
* server-side cooldown/resource/range books, tick-stepped projectiles, and
|
|
23
|
-
* delayed AoEs. The caster's position is their live pose — `cast()` only
|
|
24
|
-
* carries the TARGET; the server decides everything else. Type-94
|
|
25
|
-
* cast/impact events carry the visuals.
|
|
26
|
-
*
|
|
27
|
-
* Obtained via `client.kit(appId).abilities`.
|
|
28
|
-
*/
|
|
29
|
-
export declare class AbilitiesKit {
|
|
30
|
-
private readonly appId;
|
|
31
|
-
private readonly gameModel;
|
|
32
|
-
private readonly engines;
|
|
33
|
-
private readonly moduleName;
|
|
34
|
-
private readonly defTypeName;
|
|
35
|
-
constructor(appId: Scalars['BigInt']['input'], gameModel: GameModelAPI, engines: EngineDetector, options?: AbilitiesKitOptions);
|
|
36
|
-
/** Is the abilities engine deployed + enabled (cached per session)? */
|
|
37
|
-
engineAvailable(): Promise<boolean>;
|
|
38
|
-
/** STUDIO (admin) — create an ability definition container. */
|
|
39
|
-
defineAbility(input: {
|
|
40
|
-
abilityId: string;
|
|
41
|
-
displayName?: string;
|
|
42
|
-
spec: Record<string, unknown>;
|
|
43
|
-
}): Promise<{
|
|
44
|
-
__typename?: "GmContainer";
|
|
45
|
-
containerId: string;
|
|
46
|
-
appId: string;
|
|
47
|
-
sessionId: string | null;
|
|
48
|
-
typeName: string;
|
|
49
|
-
displayName: string;
|
|
50
|
-
description: string | null;
|
|
51
|
-
ownerUserId: string | null;
|
|
52
|
-
metadataJson: string;
|
|
53
|
-
}>;
|
|
54
|
-
/** Cast at a target point (your position comes from your live pose). */
|
|
55
|
-
cast(abilityId: string, targetX: number, targetZ: number): Promise<Record<string, unknown>>;
|
|
56
|
-
/** The deployed ability loadout. */
|
|
57
|
-
loadout(): Promise<KitAbility[]>;
|
|
58
|
-
/** YOUR caster book: resource pool + live cooldowns. */
|
|
59
|
-
book(): Promise<Record<string, unknown>>;
|
|
60
|
-
/** Engine totals (casters, live projectiles, hits). */
|
|
61
|
-
status(): Promise<Record<string, unknown>>;
|
|
62
|
-
/** Parse a type-94 cast/impact server event. */
|
|
63
|
-
parseAbilityEvent(bytes: Uint8Array): AbilityEvent | null;
|
|
64
|
-
private invoke;
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=abilities.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"abilities.d.ts","sourceRoot":"","sources":["../../src/kit/abilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAEjE,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAClC,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,sDAAsD;AACtD,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,GAAG,YAAY,GAAG,KAAK,GAAG,MAAM,CAAC;CACjD;AAED;;;;;;;;GAQG;AACH,qBAAa,YAAY;IAKrB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAN1B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;gBAGlB,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,EACjC,SAAS,EAAE,YAAY,EACvB,OAAO,EAAE,cAAc,EACxC,OAAO,GAAE,mBAAwB;IAMnC,uEAAuE;IACvE,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;IAInC,+DAA+D;IACzD,aAAa,CAAC,KAAK,EAAE;QACzB,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC/B;;;;;;;;;;;IAYD,wEAAwE;IAClE,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAI9D,oCAAoC;IAC9B,OAAO,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;IAatC,wDAAwD;IAClD,IAAI;IAIV,uDAAuD;IACjD,MAAM;IAIZ,gDAAgD;IAChD,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG,YAAY,GAAG,IAAI;YAI3C,MAAM;CAOrB"}
|
package/dist/kit/abilities.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { parseAbilityEvent } from './wire.js';
|
|
2
|
-
/**
|
|
3
|
-
* Runtime helpers for the abilities engine (Wave 3): realtime casts with
|
|
4
|
-
* server-side cooldown/resource/range books, tick-stepped projectiles, and
|
|
5
|
-
* delayed AoEs. The caster's position is their live pose — `cast()` only
|
|
6
|
-
* carries the TARGET; the server decides everything else. Type-94
|
|
7
|
-
* cast/impact events carry the visuals.
|
|
8
|
-
*
|
|
9
|
-
* Obtained via `client.kit(appId).abilities`.
|
|
10
|
-
*/
|
|
11
|
-
export class AbilitiesKit {
|
|
12
|
-
constructor(appId, gameModel, engines, options = {}) {
|
|
13
|
-
this.appId = appId;
|
|
14
|
-
this.gameModel = gameModel;
|
|
15
|
-
this.engines = engines;
|
|
16
|
-
this.moduleName = options.moduleName ?? 'abilities-engine';
|
|
17
|
-
this.defTypeName = options.defTypeName ?? 'AbilityDef';
|
|
18
|
-
}
|
|
19
|
-
/** Is the abilities engine deployed + enabled (cached per session)? */
|
|
20
|
-
engineAvailable() {
|
|
21
|
-
return this.engines.has(this.moduleName);
|
|
22
|
-
}
|
|
23
|
-
/** STUDIO (admin) — create an ability definition container. */
|
|
24
|
-
async defineAbility(input) {
|
|
25
|
-
return this.gameModel.createContainer({
|
|
26
|
-
appId: this.appId,
|
|
27
|
-
typeName: this.defTypeName,
|
|
28
|
-
displayName: input.displayName ?? `ability-${input.abilityId}`,
|
|
29
|
-
properties: [
|
|
30
|
-
{ key: 'ability_id', valueType: 'string', valueJson: JSON.stringify(input.abilityId) },
|
|
31
|
-
{ key: 'spec', valueType: 'string', valueJson: JSON.stringify(JSON.stringify(input.spec)) },
|
|
32
|
-
],
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
/** Cast at a target point (your position comes from your live pose). */
|
|
36
|
-
async cast(abilityId, targetX, targetZ) {
|
|
37
|
-
return this.invoke('cast', { abilityId, targetX, targetZ });
|
|
38
|
-
}
|
|
39
|
-
/** The deployed ability loadout. */
|
|
40
|
-
async loadout() {
|
|
41
|
-
const body = await this.invoke('loadout', {});
|
|
42
|
-
return Array.isArray(body.abilities)
|
|
43
|
-
? body.abilities.map((a) => ({
|
|
44
|
-
abilityId: String(a.abilityId ?? ''),
|
|
45
|
-
cooldownMs: Number(a.cooldownMs ?? 0),
|
|
46
|
-
resourceCost: Number(a.resourceCost ?? 0),
|
|
47
|
-
range: Number(a.range ?? 0),
|
|
48
|
-
kind: String(a.kind ?? ''),
|
|
49
|
-
}))
|
|
50
|
-
: [];
|
|
51
|
-
}
|
|
52
|
-
/** YOUR caster book: resource pool + live cooldowns. */
|
|
53
|
-
async book() {
|
|
54
|
-
return this.invoke('book', {});
|
|
55
|
-
}
|
|
56
|
-
/** Engine totals (casters, live projectiles, hits). */
|
|
57
|
-
async status() {
|
|
58
|
-
return this.invoke('status', {});
|
|
59
|
-
}
|
|
60
|
-
/** Parse a type-94 cast/impact server event. */
|
|
61
|
-
parseAbilityEvent(bytes) {
|
|
62
|
-
return parseAbilityEvent(bytes);
|
|
63
|
-
}
|
|
64
|
-
async invoke(exportName, params) {
|
|
65
|
-
const result = await this.engines.invoke(this.moduleName, exportName, params);
|
|
66
|
-
if (!result.success) {
|
|
67
|
-
throw new Error(`abilities.${exportName} failed: ${result.reason ?? 'unknown'}`);
|
|
68
|
-
}
|
|
69
|
-
return result.body;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { type KitBlueprint, type KitOwnerIdKind } from './core.js';
|
|
2
|
-
/** Options for {@link combatBlueprint}. */
|
|
3
|
-
export interface CombatBlueprintOptions {
|
|
4
|
-
/** Prefix for the type/function names. Defaults to none. */
|
|
5
|
-
typePrefix?: string;
|
|
6
|
-
/**
|
|
7
|
-
* Turn-based mode: adds `is_current_turn` to the attack/apply_effect
|
|
8
|
-
* policies, so only the player whose session turn it is may act. Defaults
|
|
9
|
-
* to false.
|
|
10
|
-
*/
|
|
11
|
-
turnBased?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Host-synced mode for **fast** combat: adds a `sync_combatant` function
|
|
14
|
-
* gated `is_host` so the elected host client can run smooth per-frame
|
|
15
|
-
* combat on the replication plane and periodically write the durable hp
|
|
16
|
-
* back (the Blocks-with-Friends `mob_update` precedent, with the policy
|
|
17
|
-
* actually enforced). Defaults to false.
|
|
18
|
-
*/
|
|
19
|
-
hostSynced?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Interval of the status-effect tick automation, in ms (dispatcher floor
|
|
22
|
-
* is seconds). Defaults to 5000.
|
|
23
|
-
*/
|
|
24
|
-
effectTickIntervalMs?: number;
|
|
25
|
-
/**
|
|
26
|
-
* Who may instantiate combatants: `'member'` (player characters; the
|
|
27
|
-
* default) or `'admin'` (studio-spawned mobs).
|
|
28
|
-
*/
|
|
29
|
-
combatantInstantiableBy?: 'member' | 'admin';
|
|
30
|
-
/**
|
|
31
|
-
* When set, adds a `revive` function gated on this team/group permission
|
|
32
|
-
* (e.g. a healer role), usable on any downed combatant.
|
|
33
|
-
*/
|
|
34
|
-
reviveGroup?: {
|
|
35
|
-
groupId: string;
|
|
36
|
-
permission?: string;
|
|
37
|
-
};
|
|
38
|
-
/** Owner-mirror typing (see the kit convention). Defaults to `'int'`. */
|
|
39
|
-
ownerIdKind?: KitOwnerIdKind;
|
|
40
|
-
}
|
|
41
|
-
/** Names derived by {@link combatBlueprint} for a given prefix. */
|
|
42
|
-
export interface CombatNames {
|
|
43
|
-
combatantType: string;
|
|
44
|
-
effectType: string;
|
|
45
|
-
attackFn: string;
|
|
46
|
-
applyEffectFn: string;
|
|
47
|
-
effectTickFn: string;
|
|
48
|
-
respawnFn: string;
|
|
49
|
-
reviveFn: string;
|
|
50
|
-
syncFn: string;
|
|
51
|
-
effectTickAutomation: string;
|
|
52
|
-
}
|
|
53
|
-
/** Compute the type/function names a combat blueprint (and its runtime helper) uses. */
|
|
54
|
-
export declare function combatNames(typePrefix?: string): CombatNames;
|
|
55
|
-
/**
|
|
56
|
-
* Blueprint for **server-authoritative combat** (the turn-based / MMO-durable
|
|
57
|
-
* tier): `Combatant` containers (hp / attack / defense / alive), an `attack`
|
|
58
|
-
* function whose damage formula and death flip run entirely server-side,
|
|
59
|
-
* status effects as `StatusEffect` containers ticked by an interval
|
|
60
|
-
* automation (damage-over-time between requests), and respawn/revive.
|
|
61
|
-
*
|
|
62
|
-
* The effect tick runs only while the app has a player in it (2026-09-01), which
|
|
63
|
-
* for combat is usually what you want: nothing is fighting in an empty world.
|
|
64
|
-
* Store an expiry timestamp on each effect rather than a remaining-ticks counter,
|
|
65
|
-
* so an effect that should have lapsed while the app was empty is treated as
|
|
66
|
-
* lapsed on the next tick instead of resuming with time left on it.
|
|
67
|
-
*
|
|
68
|
-
* The effect tick uses the selector **join** pattern: each combatant carries
|
|
69
|
-
* a unique `combat_key`, effects record a `target_key`, and the automation's
|
|
70
|
-
* selector binds the matching combatant as a `$target` ref param
|
|
71
|
-
* (`where combat_key == self.target_key`) — automations cannot follow
|
|
72
|
-
* property refs directly.
|
|
73
|
-
*
|
|
74
|
-
* For fast-twitch combat keep the per-frame simulation on the replication
|
|
75
|
-
* plane under host authority and set `hostSynced: true` to get the
|
|
76
|
-
* `is_host`-gated durable sync function.
|
|
77
|
-
*
|
|
78
|
-
* Runtime counterpart: `client.kit(appId).combat`.
|
|
79
|
-
*/
|
|
80
|
-
export declare function combatBlueprint(options?: CombatBlueprintOptions): KitBlueprint;
|
|
81
|
-
//# sourceMappingURL=combat.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"combat.d.ts","sourceRoot":"","sources":["../../../src/kit/blueprints/combat.ts"],"names":[],"mappings":"AAIA,OAAO,EAKL,KAAK,YAAY,EAEjB,KAAK,cAAc,EACpB,MAAM,WAAW,CAAC;AAEnB,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,uBAAuB,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC7C;;;OAGG;IACH,WAAW,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvD,yEAAyE;IACzE,WAAW,CAAC,EAAE,cAAc,CAAC;CAC9B;AAED,mEAAmE;AACnE,MAAM,WAAW,WAAW;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,wFAAwF;AACxF,wBAAgB,WAAW,CAAC,UAAU,SAAK,GAAG,WAAW,CAaxD;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,YAAY,CAmVlF"}
|