@crowdedkingdoms/crowdyjs 17.14.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 +92 -1
- package/README.md +93 -162
- 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 +34 -59
- package/dist/crowdy-studio/controller.d.ts.map +1 -1
- package/dist/crowdy-studio/controller.js +96 -225
- 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 -49
- package/dist/crowdy-studio/embed/hud-layer.d.ts +1 -2
- package/dist/crowdy-studio/embed/hud-layer.d.ts.map +1 -1
- package/dist/crowdy-studio/embed/panel.d.ts +3 -13
- 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 -12
- package/dist/crowdy-studio/starter-projects.d.ts.map +1 -1
- package/dist/crowdy-studio/starter-projects.js +12 -103
- 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/host.d.ts +3 -3
- package/dist/domains/host.js +3 -3
- package/dist/domains/marketplace.d.ts +9 -70
- package/dist/domains/marketplace.d.ts.map +1 -1
- package/dist/domains/marketplace.js +9 -120
- 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 +141 -7083
- package/dist/generated/graphql.d.ts.map +1 -1
- package/dist/generated/graphql.js +5 -313
- package/dist/grid-mods/exec-client-halves.d.ts +19 -3
- package/dist/grid-mods/exec-client-halves.d.ts.map +1 -1
- package/dist/grid-mods/exec-client-halves.js +17 -2
- package/dist/grid-mods/grid-host-calls.d.ts +29 -17
- package/dist/grid-mods/grid-host-calls.d.ts.map +1 -1
- package/dist/grid-mods/grid-host-calls.js +40 -46
- package/dist/grid-mods/mod-runtime.d.ts +18 -11
- package/dist/grid-mods/mod-runtime.d.ts.map +1 -1
- package/dist/grid-mods/mod-runtime.js +4 -2
- package/dist/grid-scope.d.ts +0 -189
- package/dist/grid-scope.d.ts.map +1 -1
- package/dist/grid-scope.js +0 -70
- package/dist/index.d.ts +11 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -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 +30 -34
- 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 +24 -20
- package/dist/player-runtime/glue-runtime.d.ts.map +1 -1
- package/dist/player-runtime/glue-runtime.js +26 -55
- 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 +70 -43
- package/dist/player-runtime/player-code-broker.d.ts.map +1 -1
- package/dist/player-runtime/player-code-broker.js +159 -64
- package/dist/player-runtime/player-glue-worker.d.ts +8 -9
- package/dist/player-runtime/player-glue-worker.d.ts.map +1 -1
- package/dist/player-runtime/player-glue-worker.js +26 -11
- 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,76 +0,0 @@
|
|
|
1
|
-
import type { CrowdyLogger } from '../logger.js';
|
|
2
|
-
/**
|
|
3
|
-
* Tell the developer, once, when the server refuses something because the game model is
|
|
4
|
-
* wrong.
|
|
5
|
-
*
|
|
6
|
-
* THIS IS THE HALF THAT WORKS IN A SHIPPED GAME. `gameModelLint` needs `manage_apps`, so a
|
|
7
|
-
* client holding a player token cannot ask whether the app is coherent and never will be
|
|
8
|
-
* able to. What it can see is the server refusing one specific operation, and that turns
|
|
9
|
-
* out to be enough — the refusals carry a code and the facts, so the client can say what
|
|
10
|
-
* happened without being allowed to audit the app.
|
|
11
|
-
*
|
|
12
|
-
* WHY IT MATTERS THAT IT SAYS ANYTHING AT ALL. The case this was built for is a client that
|
|
13
|
-
* called `gameModelEnsureContainer` against a type nobody had defined. The call SUCCEEDED.
|
|
14
|
-
* The container was written, nothing bound to it, and the only trace anywhere was the game's
|
|
15
|
-
* own line — `[GameModel] InvokeAndApply: no container bound for entity F3B8B18E…` — which
|
|
16
|
-
* names a symptom and not one thing about the cause. It read as a permissions fault for
|
|
17
|
-
* most of a day. The server refuses that call now and says why; this is what makes sure the
|
|
18
|
-
* why is not swallowed on the way to the developer.
|
|
19
|
-
*
|
|
20
|
-
* ONCE PER (code, subject), NOT PER OCCURRENCE, and that is not a nicety. These fire on
|
|
21
|
-
* gameplay paths — a bind can be attempted every frame, for every entity — and a warning
|
|
22
|
-
* printed at that rate is indistinguishable from noise. Warnings being ignorable is the
|
|
23
|
-
* root cause of the incident this file exists because of, so reproducing it with better
|
|
24
|
-
* wording would be the one clearly wrong outcome.
|
|
25
|
-
*/
|
|
26
|
-
/** A refusal the server attributes to the app's game model. */
|
|
27
|
-
export interface CrowdyModelRefusal {
|
|
28
|
-
code: string;
|
|
29
|
-
message: string;
|
|
30
|
-
/** The object the refusal is about, for deduplication and for the developer. */
|
|
31
|
-
subject?: string;
|
|
32
|
-
/**
|
|
33
|
-
* For a quarantine: the lint finding that caused it, and what kind of object it is.
|
|
34
|
-
*
|
|
35
|
-
* FIRST-CLASS BECAUSE `reason` IS THE ONLY ACTIONABLE FIELD. Before these existed the
|
|
36
|
-
* server's `quarantineReason` was reachable only by digging through the untyped `detail`
|
|
37
|
-
* bag, so a developer was told their function is quarantined and left to guess which of
|
|
38
|
-
* their lint errors did it. `subject` says which object; this says what to fix.
|
|
39
|
-
*/
|
|
40
|
-
quarantine?: {
|
|
41
|
-
kind?: string;
|
|
42
|
-
reason: string;
|
|
43
|
-
};
|
|
44
|
-
/** Anything else the server named in `extensions`, for the developer to read. */
|
|
45
|
-
detail?: Record<string, unknown>;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Error codes that mean "your game model is wrong", as opposed to a transient or
|
|
49
|
-
* permissions failure. Keys off `extensions.code`, never the message text.
|
|
50
|
-
*/
|
|
51
|
-
export declare const MODEL_REFUSAL_CODES: Set<string>;
|
|
52
|
-
/** Read a refusal out of a GraphQL error, or null if it is not one of ours. */
|
|
53
|
-
export declare function modelRefusalFrom(error: unknown): CrowdyModelRefusal | null;
|
|
54
|
-
/**
|
|
55
|
-
* Deduplicating sink for model refusals.
|
|
56
|
-
*
|
|
57
|
-
* Holds the set for the life of the process rather than expiring it: the point is to say a
|
|
58
|
-
* thing once, and a TTL would only decide how often to repeat something the developer has
|
|
59
|
-
* already read. A game that runs for hours would repeat it hourly for no gain.
|
|
60
|
-
*/
|
|
61
|
-
export declare class CrowdyModelLintLog {
|
|
62
|
-
private readonly logger;
|
|
63
|
-
private readonly seen;
|
|
64
|
-
private readonly refusals;
|
|
65
|
-
constructor(logger?: CrowdyLogger);
|
|
66
|
-
/**
|
|
67
|
-
* Record a refusal. Returns true when this was the first of its kind, which is also
|
|
68
|
-
* when anything was logged.
|
|
69
|
-
*/
|
|
70
|
-
record(refusal: CrowdyModelRefusal): boolean;
|
|
71
|
-
/** Every distinct refusal seen so far, for an editor panel rather than a log tail. */
|
|
72
|
-
collected(): readonly CrowdyModelRefusal[];
|
|
73
|
-
/** Forget everything, so a reconnect to a repaired app reports afresh. */
|
|
74
|
-
reset(): void;
|
|
75
|
-
}
|
|
76
|
-
//# sourceMappingURL=model-lint-log.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model-lint-log.d.ts","sourceRoot":"","sources":["../../src/crowdy-studio/model-lint-log.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,+DAA+D;AAC/D,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,aAG9B,CAAC;AAEH,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,kBAAkB,GAAG,IAAI,CA4C1E;AAED;;;;;;GAMG;AACH,qBAAa,kBAAkB;IAIjB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAHnC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqB;IAC1C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA4B;gBAExB,MAAM,GAAE,YAAiB;IAEtD;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO;IAkB5C,sFAAsF;IACtF,SAAS,IAAI,SAAS,kBAAkB,EAAE;IAI1C,0EAA0E;IAC1E,KAAK,IAAI,IAAI;CAId"}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error codes that mean "your game model is wrong", as opposed to a transient or
|
|
3
|
-
* permissions failure. Keys off `extensions.code`, never the message text.
|
|
4
|
-
*/
|
|
5
|
-
export const MODEL_REFUSAL_CODES = new Set([
|
|
6
|
-
'CONTAINER_TYPE_UNDEFINED',
|
|
7
|
-
'OBJECT_QUARANTINED',
|
|
8
|
-
]);
|
|
9
|
-
/** Read a refusal out of a GraphQL error, or null if it is not one of ours. */
|
|
10
|
-
export function modelRefusalFrom(error) {
|
|
11
|
-
if (typeof error !== 'object' || error === null)
|
|
12
|
-
return null;
|
|
13
|
-
const extensions = error
|
|
14
|
-
.extensions;
|
|
15
|
-
if (!extensions)
|
|
16
|
-
return null;
|
|
17
|
-
const code = extensions.code;
|
|
18
|
-
// A QUARANTINE ON `gameModelInvoke` DOES NOT ARRIVE AS `OBJECT_QUARANTINED`. That entry
|
|
19
|
-
// point is a user-code boundary, so the server rebuilds the error from a
|
|
20
|
-
// { code, blame, retryable } triple and the code becomes USER_CODE_ERROR — while the
|
|
21
|
-
// quarantine fields survive. Recognising the code alone therefore misses the refusal on
|
|
22
|
-
// the single path a player takes, which is where it matters most, so the presence of
|
|
23
|
-
// `quarantineReason` is treated as identifying too.
|
|
24
|
-
const quarantineReason = typeof extensions.quarantineReason === 'string'
|
|
25
|
-
? extensions.quarantineReason
|
|
26
|
-
: undefined;
|
|
27
|
-
const isRefusal = (typeof code === 'string' && MODEL_REFUSAL_CODES.has(code)) ||
|
|
28
|
-
quarantineReason !== undefined;
|
|
29
|
-
if (!isRefusal)
|
|
30
|
-
return null;
|
|
31
|
-
const subject = typeof extensions.typeName === 'string'
|
|
32
|
-
? extensions.typeName
|
|
33
|
-
: typeof extensions.quarantinedName === 'string'
|
|
34
|
-
? extensions.quarantinedName
|
|
35
|
-
: undefined;
|
|
36
|
-
return {
|
|
37
|
-
code: typeof code === 'string' ? code : 'OBJECT_QUARANTINED',
|
|
38
|
-
message: String(error.message ?? code),
|
|
39
|
-
...(subject ? { subject } : {}),
|
|
40
|
-
...(quarantineReason
|
|
41
|
-
? {
|
|
42
|
-
quarantine: {
|
|
43
|
-
...(typeof extensions.quarantinedKind === 'string'
|
|
44
|
-
? { kind: extensions.quarantinedKind }
|
|
45
|
-
: {}),
|
|
46
|
-
reason: quarantineReason,
|
|
47
|
-
},
|
|
48
|
-
}
|
|
49
|
-
: {}),
|
|
50
|
-
detail: extensions,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Deduplicating sink for model refusals.
|
|
55
|
-
*
|
|
56
|
-
* Holds the set for the life of the process rather than expiring it: the point is to say a
|
|
57
|
-
* thing once, and a TTL would only decide how often to repeat something the developer has
|
|
58
|
-
* already read. A game that runs for hours would repeat it hourly for no gain.
|
|
59
|
-
*/
|
|
60
|
-
export class CrowdyModelLintLog {
|
|
61
|
-
constructor(logger = {}) {
|
|
62
|
-
this.logger = logger;
|
|
63
|
-
this.seen = new Set();
|
|
64
|
-
this.refusals = [];
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Record a refusal. Returns true when this was the first of its kind, which is also
|
|
68
|
-
* when anything was logged.
|
|
69
|
-
*/
|
|
70
|
-
record(refusal) {
|
|
71
|
-
const key = `${refusal.code}\u0000${refusal.subject ?? ''}`;
|
|
72
|
-
if (this.seen.has(key))
|
|
73
|
-
return false;
|
|
74
|
-
this.seen.add(key);
|
|
75
|
-
this.refusals.push(refusal);
|
|
76
|
-
// warn, not error: the app is running and the developer is the audience. An
|
|
77
|
-
// error would push a game's own error handling into treating a schema problem
|
|
78
|
-
// as a crash.
|
|
79
|
-
this.logger.warn?.(`[crowdy:model] ${refusal.code}: ${refusal.message}\n` +
|
|
80
|
-
' This is reported once per distinct problem. Call gameModelLint with an ' +
|
|
81
|
-
'app-admin token for everything currently wrong with this app.', refusal.detail);
|
|
82
|
-
return true;
|
|
83
|
-
}
|
|
84
|
-
/** Every distinct refusal seen so far, for an editor panel rather than a log tail. */
|
|
85
|
-
collected() {
|
|
86
|
-
return this.refusals;
|
|
87
|
-
}
|
|
88
|
-
/** Forget everything, so a reconnect to a repaired app reports afresh. */
|
|
89
|
-
reset() {
|
|
90
|
-
this.seen.clear();
|
|
91
|
-
this.refusals.length = 0;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { CrowdyStudioDiagnostic } from './diagnostics.js';
|
|
2
|
-
import type { CrowdyStudioTarget } from './models.js';
|
|
3
|
-
/**
|
|
4
|
-
* Turn `gameModelLint` findings into the diagnostics an editor already renders.
|
|
5
|
-
*
|
|
6
|
-
* WHY THIS IS A MAPPER AND NOT A NEW SURFACE. `CrowdyStudioDiagnostic` already exists on
|
|
7
|
-
* both SDKs, already carries a severity, a code and a message, and CrowdyJS already
|
|
8
|
-
* publishes it over `textDocument/publishDiagnostics` into Monaco. Lint findings are the
|
|
9
|
-
* same kind of thing arriving from a different place, so they become a `source` and reuse
|
|
10
|
-
* the Problems list, the gutter and the filtering for free. A second panel with its own
|
|
11
|
-
* shape would be a second thing to maintain and a second place for a developer to look.
|
|
12
|
-
*
|
|
13
|
-
* WHO CAN CALL THE QUERY THIS CONSUMES. `gameModelLint` is gated on `manage_apps`, so this
|
|
14
|
-
* is for an authoring context — Studio, an engine editor, a dev build signed in as someone
|
|
15
|
-
* who administers the app. A shipped game holding a player token cannot call it and should
|
|
16
|
-
* not be able to: what a player's client gets instead is the server refusing the specific
|
|
17
|
-
* operation, which `recordRefusal` in `./model-lint-log.js` surfaces.
|
|
18
|
-
*
|
|
19
|
-
* THERE IS NO FILE OR LINE, and pretending otherwise would be worse than admitting it.
|
|
20
|
-
* A finding is about a function, a container type or the app, none of which the developer
|
|
21
|
-
* has open in a text editor — the model is authored through the API. So `path` carries the
|
|
22
|
-
* subject and the line is 1: enough for the Problems list to group and label them, without
|
|
23
|
-
* inventing a location that would send a click into the wrong file.
|
|
24
|
-
*/
|
|
25
|
-
/** One finding as `gameModelLint` returns it. */
|
|
26
|
-
export interface CrowdyModelLintFinding {
|
|
27
|
-
code: string;
|
|
28
|
-
severity: 'error' | 'warning';
|
|
29
|
-
subjectKind: string;
|
|
30
|
-
subject: string;
|
|
31
|
-
message: string;
|
|
32
|
-
remedy?: string | null;
|
|
33
|
-
count?: number | null;
|
|
34
|
-
}
|
|
35
|
-
export interface CrowdyModelLintResult {
|
|
36
|
-
appId: string;
|
|
37
|
-
findings: CrowdyModelLintFinding[];
|
|
38
|
-
errorCount: number;
|
|
39
|
-
warningCount: number;
|
|
40
|
-
clean: boolean;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* The lint query, printed from the generated document rather than written here.
|
|
44
|
-
*
|
|
45
|
-
* IT USED TO BE A TEMPLATE LITERAL, and that made it the one query in this SDK that
|
|
46
|
-
* `check:schema` could not validate: codegen only sees operation documents, so the query
|
|
47
|
-
* asking "is this app's model coherent" was itself unchecked against the schema it targets.
|
|
48
|
-
* `gameModelLint` was not even present in the committed SDL. Printing from
|
|
49
|
-
* `CrowdyModelLintDocument` means the string and the validated document cannot disagree.
|
|
50
|
-
*/
|
|
51
|
-
export declare const MODEL_LINT_QUERY: string;
|
|
52
|
-
/**
|
|
53
|
-
* A stable, readable label for the thing the finding is about.
|
|
54
|
-
*
|
|
55
|
-
* Prefixed with the kind because subjects collide across kinds — an automation and a
|
|
56
|
-
* function may both be called `on_join`, and a Problems list that showed both as `on_join`
|
|
57
|
-
* would be actively misleading about which one is broken.
|
|
58
|
-
*/
|
|
59
|
-
export declare function modelLintSubjectPath(finding: CrowdyModelLintFinding): string;
|
|
60
|
-
export declare function modelLintDiagnostics(result: CrowdyModelLintResult | null | undefined, target?: CrowdyStudioTarget): CrowdyStudioDiagnostic[];
|
|
61
|
-
//# sourceMappingURL=model-lint.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model-lint.d.ts","sourceRoot":"","sources":["../../src/crowdy-studio/model-lint.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,sBAAsB,EAEvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,iDAAiD;AACjD,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,sBAAsB,EAAE,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,QAAiC,CAAC;AAQ/D;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,sBAAsB,GAAG,MAAM,CAE5E;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,qBAAqB,GAAG,IAAI,GAAG,SAAS,EAChD,MAAM,GAAE,kBAAmD,GAC1D,sBAAsB,EAAE,CAkB1B"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { print } from 'graphql';
|
|
2
|
-
import { CrowdyModelLintDocument } from '../generated/graphql.js';
|
|
3
|
-
/**
|
|
4
|
-
* The lint query, printed from the generated document rather than written here.
|
|
5
|
-
*
|
|
6
|
-
* IT USED TO BE A TEMPLATE LITERAL, and that made it the one query in this SDK that
|
|
7
|
-
* `check:schema` could not validate: codegen only sees operation documents, so the query
|
|
8
|
-
* asking "is this app's model coherent" was itself unchecked against the schema it targets.
|
|
9
|
-
* `gameModelLint` was not even present in the committed SDL. Printing from
|
|
10
|
-
* `CrowdyModelLintDocument` means the string and the validated document cannot disagree.
|
|
11
|
-
*/
|
|
12
|
-
export const MODEL_LINT_QUERY = print(CrowdyModelLintDocument);
|
|
13
|
-
function severityOf(finding) {
|
|
14
|
-
return finding.severity === 'error' ? 'error' : 'warning';
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* A stable, readable label for the thing the finding is about.
|
|
18
|
-
*
|
|
19
|
-
* Prefixed with the kind because subjects collide across kinds — an automation and a
|
|
20
|
-
* function may both be called `on_join`, and a Problems list that showed both as `on_join`
|
|
21
|
-
* would be actively misleading about which one is broken.
|
|
22
|
-
*/
|
|
23
|
-
export function modelLintSubjectPath(finding) {
|
|
24
|
-
return `${finding.subjectKind}/${finding.subject}`;
|
|
25
|
-
}
|
|
26
|
-
export function modelLintDiagnostics(result, target = 'SERVER') {
|
|
27
|
-
if (!result?.findings?.length)
|
|
28
|
-
return [];
|
|
29
|
-
return result.findings.map((finding) => ({
|
|
30
|
-
target,
|
|
31
|
-
path: modelLintSubjectPath(finding),
|
|
32
|
-
line: 1,
|
|
33
|
-
column: 1,
|
|
34
|
-
severity: severityOf(finding),
|
|
35
|
-
// The remedy is joined into the message rather than dropped: an editor's Problems
|
|
36
|
-
// list shows one line per entry and has nowhere else to put it, and a finding a
|
|
37
|
-
// developer cannot act on from where they are reading it is the failure this whole
|
|
38
|
-
// feature exists to fix.
|
|
39
|
-
message: finding.remedy
|
|
40
|
-
? `${finding.message} — ${finding.remedy}`
|
|
41
|
-
: finding.message,
|
|
42
|
-
code: finding.code,
|
|
43
|
-
source: 'model-lint',
|
|
44
|
-
}));
|
|
45
|
-
}
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import type { GraphQLClient } from '../client.js';
|
|
2
|
-
import { type ComputeUpsertModuleMutation, type ComputeUpsertModuleMutationVariables, type ComputeDeployVersionMutation, type ComputeSetModuleEnabledMutation, type ComputeSetModuleEnabledMutationVariables, type ComputeResetBreakerMutation, type ComputeResetBreakerMutationVariables, type ComputeDeleteModuleMutation, type ComputeDeleteModuleMutationVariables, type ComputeUpsertTriggerMutation, type ComputeUpsertTriggerMutationVariables, type ComputeDeleteTriggerMutation, type ComputeDeleteTriggerMutationVariables, type ComputeSetPolicyMutation, type ComputeSetPolicyMutationVariables, type ComputeInvokeMutation, type ComputeInvokeMutationVariables, type ComputeModulesQuery, type ComputeModulesQueryVariables, type ComputeModuleQuery, type ComputeModuleQueryVariables, type ComputeModuleVersionsQuery, type ComputeModuleVersionsQueryVariables, type ComputeModuleTriggersQuery, type ComputeModuleTriggersQueryVariables, type ComputeModulePolicyQuery, type ComputeModulePolicyQueryVariables, type ComputeModuleRunsQuery, type ComputeModuleRunsQueryVariables, type ComputeModuleStatsQuery, type ComputeModuleStatsQueryVariables, type ComputeModuleLogsQuery, type ComputeModuleLogsQueryVariables, type ComputeDeployTemplateMutation, type ComputeDeployTemplateMutationVariables, type ComputeTemplatesQuery, type ComputeTemplatesQueryVariables, type ComputeAppDiagnosticsQuery, type ComputeAppDiagnosticsQueryVariables } from '../generated/graphql.js';
|
|
3
|
-
/** The crowdy-compute-sdk version the platform toolchain currently pins. */
|
|
4
|
-
export declare const COMPUTE_SDK_VERSION = "0.1.3";
|
|
5
|
-
/** The guest ABI version the platform currently supports. */
|
|
6
|
-
export declare const COMPUTE_ABI_VERSION = 0;
|
|
7
|
-
/** Options for {@link ComputeAPI.deployVersion}. */
|
|
8
|
-
export interface DeployVersionOptions {
|
|
9
|
-
appId: ComputeSetModuleEnabledMutationVariables['appId'];
|
|
10
|
-
moduleName: string;
|
|
11
|
-
/**
|
|
12
|
-
* Relative path -> file contents. Must include `Cargo.toml` and
|
|
13
|
-
* `src/lib.rs`; only `.rs` files under `src/` plus `Cargo.toml` are
|
|
14
|
-
* accepted by the server (crate allowlist, size caps, no build-time code).
|
|
15
|
-
*/
|
|
16
|
-
sourceFiles: Record<string, string>;
|
|
17
|
-
/** crowdy-compute-sdk version pin. Defaults to {@link COMPUTE_SDK_VERSION}. */
|
|
18
|
-
sdkVersion?: string;
|
|
19
|
-
/** Guest ABI version pin. Defaults to {@link COMPUTE_ABI_VERSION}. */
|
|
20
|
-
abiVersion?: number;
|
|
21
|
-
}
|
|
22
|
-
/** Options for {@link ComputeAPI.waitForCompile}. */
|
|
23
|
-
export interface WaitForCompileOptions {
|
|
24
|
-
/** Total budget in ms before giving up (default 120_000). */
|
|
25
|
-
timeoutMs?: number;
|
|
26
|
-
/** Poll interval in ms (default 2_000). */
|
|
27
|
-
intervalMs?: number;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Typed client for **Compute Modules** — server-side Rust/WebAssembly logic
|
|
31
|
-
* on the Game API (`client.compute`). Studios upload Rust source; the
|
|
32
|
-
* platform compiles it to WASM and runs it sandboxed on the game servers with
|
|
33
|
-
* fuel metering, triggers (tick / event / invoke), an app-scoped host data
|
|
34
|
-
* API, and replication egress. Modules are **server-only**: this client
|
|
35
|
-
* manages, invokes, and observes them — nothing executes client-side.
|
|
36
|
-
*
|
|
37
|
-
* Authoring mutations require the org **`manage_compute`** permission;
|
|
38
|
-
* monitoring queries require **`view_compute_diagnostics`**. `invoke` is
|
|
39
|
-
* gated per-export by the invoke trigger's policy.
|
|
40
|
-
*
|
|
41
|
-
* Docs: https://docs.crowdedkingdoms.com/game-api/compute-modules
|
|
42
|
-
*/
|
|
43
|
-
export declare class ComputeAPI {
|
|
44
|
-
private gql;
|
|
45
|
-
constructor(gql: GraphQLClient);
|
|
46
|
-
/**
|
|
47
|
-
* Create or update a module's metadata (upsert key `(appId, name)`). New
|
|
48
|
-
* modules start disabled; enable after a successful compile.
|
|
49
|
-
*
|
|
50
|
-
* **Nothing runs for an app with no player in it.** A module ticks only while
|
|
51
|
-
* its app has at least one player connected, anywhere in the fleet, and stops
|
|
52
|
-
* when the last one leaves. `alwaysOn` is retired (2026-09-01) and passing
|
|
53
|
-
* `true` is refused — a world that must advance while empty should compute the
|
|
54
|
-
* elapsed time on its first tick after a player returns, which is cheaper than
|
|
55
|
-
* ticking an empty world and gives the same result.
|
|
56
|
-
*
|
|
57
|
-
* Requires the org **`manage_compute`** permission.
|
|
58
|
-
*
|
|
59
|
-
* @throws {CrowdyGraphQLError} `FORBIDDEN` without the permission.
|
|
60
|
-
* @throws {CrowdyGraphQLError} `BAD_REQUEST` if `alwaysOn: true` is passed.
|
|
61
|
-
*/
|
|
62
|
-
upsertModule(input: ComputeUpsertModuleMutationVariables['input']): Promise<ComputeUpsertModuleMutation['computeUpsertModule']>;
|
|
63
|
-
/**
|
|
64
|
-
* Upload an immutable source version and make it the deployed version. The
|
|
65
|
-
* source is validated server-side (Cargo.toml + `src/*.rs` only, dependency
|
|
66
|
-
* allowlist, size caps, no build-time code) and parked as
|
|
67
|
-
* `compileStatus: "pending"` until a game server compiles it — poll with
|
|
68
|
-
* {@link moduleVersions} or {@link waitForCompile}.
|
|
69
|
-
*
|
|
70
|
-
* Requires the org **`manage_compute`** permission.
|
|
71
|
-
*
|
|
72
|
-
* @param opts - App, module, `sourceFiles` map (stringified for you), and
|
|
73
|
-
* optional SDK/ABI pins (defaulted to the current platform pins).
|
|
74
|
-
*/
|
|
75
|
-
deployVersion(opts: DeployVersionOptions): Promise<ComputeDeployVersionMutation['computeDeployVersion']>;
|
|
76
|
-
/**
|
|
77
|
-
* Enable or disable a module. Enabling requires a successfully compiled
|
|
78
|
-
* deployed version and resets the failure circuit; disabling stops all
|
|
79
|
-
* scheduling. Requires the org **`manage_compute`** permission.
|
|
80
|
-
*
|
|
81
|
-
* This does **not** restart a module that was stopped for exceeding a
|
|
82
|
-
* resource limit (`breakerLatchedAt`). Deploy a fixed version, or call
|
|
83
|
-
* {@link resetBreaker}.
|
|
84
|
-
*/
|
|
85
|
-
setModuleEnabled(variables: ComputeSetModuleEnabledMutationVariables): Promise<ComputeSetModuleEnabledMutation['computeSetModuleEnabled']>;
|
|
86
|
-
/**
|
|
87
|
-
* Restart a module that was stopped for exceeding a resource limit, without
|
|
88
|
-
* deploying a new version.
|
|
89
|
-
*
|
|
90
|
-
* A module stopped this way reports `breakerLatchedAt` and a
|
|
91
|
-
* `breakerReason` saying what it exceeded. Deploying a fix clears it
|
|
92
|
-
* automatically and is the normal path; use this when the limit itself was
|
|
93
|
-
* wrong, or the load is being accepted deliberately. The reason is recorded
|
|
94
|
-
* with the module's history. Requires the org **`manage_compute`**
|
|
95
|
-
* permission.
|
|
96
|
-
*/
|
|
97
|
-
resetBreaker(variables: ComputeResetBreakerMutationVariables): Promise<ComputeResetBreakerMutation['computeResetBreaker']>;
|
|
98
|
-
/**
|
|
99
|
-
* Delete a module and (via cascade) its versions, triggers, and lease. Run
|
|
100
|
-
* history is retained for auditing. **Destructive.** Requires the org
|
|
101
|
-
* **`manage_compute`** permission.
|
|
102
|
-
*
|
|
103
|
-
* @returns `true` if a module was deleted.
|
|
104
|
-
*/
|
|
105
|
-
deleteModule(variables: ComputeDeleteModuleMutationVariables): Promise<ComputeDeleteModuleMutation['computeDeleteModule']>;
|
|
106
|
-
/**
|
|
107
|
-
* Bind a trigger to a module: a tick loop (`triggerType: "tick"` +
|
|
108
|
-
* `tickHz`, clamped by the app policy), an event subscription
|
|
109
|
-
* (`triggerType: "event"` + `onEvent`: `function_invoked` |
|
|
110
|
-
* `property_changed` | `container_created` | `compute_event`), or a
|
|
111
|
-
* client-callable export (`triggerType: "invoke"` + `exportName` +
|
|
112
|
-
* optional `invokePolicyJson` authority tree; null policy = compute admins
|
|
113
|
-
* only). Requires the org **`manage_compute`** permission.
|
|
114
|
-
*/
|
|
115
|
-
upsertTrigger(input: ComputeUpsertTriggerMutationVariables['input']): Promise<ComputeUpsertTriggerMutation['computeUpsertTrigger']>;
|
|
116
|
-
/**
|
|
117
|
-
* Delete a trigger by id. Requires the org **`manage_compute`** permission.
|
|
118
|
-
*
|
|
119
|
-
* @returns `true` if a trigger was deleted.
|
|
120
|
-
*/
|
|
121
|
-
deleteTrigger(variables: ComputeDeleteTriggerMutationVariables): Promise<ComputeDeleteTriggerMutation['computeDeleteTrigger']>;
|
|
122
|
-
/**
|
|
123
|
-
* Set the app's compute policy (guardrails: kill switch, module count,
|
|
124
|
-
* tick-rate / fuel / memory / runtime / host-op / egress ceilings, circuit
|
|
125
|
-
* tuning). Omitted fields keep their current values; values above the
|
|
126
|
-
* platform ceilings are rejected. Requires the org **`manage_compute`**
|
|
127
|
-
* permission.
|
|
128
|
-
*/
|
|
129
|
-
setPolicy(input: ComputeSetPolicyMutationVariables['input']): Promise<ComputeSetPolicyMutation['computeSetPolicy']>;
|
|
130
|
-
/**
|
|
131
|
-
* Invoke a module's client-callable export (an `invoke` trigger) as a
|
|
132
|
-
* **synchronous RPC**: the module runs server-side and its result comes
|
|
133
|
-
* back directly — unlike the spatial send surface, a failure (policy
|
|
134
|
-
* denial, fuel exhaustion, trap) is a thrown error, not a silent drop.
|
|
135
|
-
*
|
|
136
|
-
* Authorization: the export's invoke policy, or `manage_compute` holders
|
|
137
|
-
* only when no policy is set.
|
|
138
|
-
*
|
|
139
|
-
* @returns The invoke result; `resultJson` is set when the module's bytes
|
|
140
|
-
* parse as JSON (`resultBase64` always carries the raw bytes).
|
|
141
|
-
* @throws {CrowdyGraphQLError} `FORBIDDEN` on policy denial; `BAD_REQUEST`
|
|
142
|
-
* when the module is disabled or the call fails inside the sandbox.
|
|
143
|
-
*/
|
|
144
|
-
invoke(variables: ComputeInvokeMutationVariables): Promise<ComputeInvokeMutation['computeInvoke']>;
|
|
145
|
-
/** List the app's modules. Requires **`view_compute_diagnostics`**. */
|
|
146
|
-
modules(variables: ComputeModulesQueryVariables): Promise<ComputeModulesQuery['computeModules']>;
|
|
147
|
-
/** Read one module by name. Requires **`view_compute_diagnostics`**. */
|
|
148
|
-
module(variables: ComputeModuleQueryVariables): Promise<ComputeModuleQuery['computeModule']>;
|
|
149
|
-
/**
|
|
150
|
-
* List a module's source versions, newest first, including compile
|
|
151
|
-
* status/log. Requires **`view_compute_diagnostics`**.
|
|
152
|
-
*/
|
|
153
|
-
moduleVersions(variables: ComputeModuleVersionsQueryVariables): Promise<ComputeModuleVersionsQuery['computeModuleVersions']>;
|
|
154
|
-
/**
|
|
155
|
-
* The platform's engine-template registry: ready-made engines deployable
|
|
156
|
-
* by name with {@link deployTemplate}.
|
|
157
|
-
*/
|
|
158
|
-
templates(variables: ComputeTemplatesQueryVariables): Promise<ComputeTemplatesQuery['computeTemplates']>;
|
|
159
|
-
/**
|
|
160
|
-
* Deploy a named engine template from the platform registry — one call
|
|
161
|
-
* instead of the upsert/deploy/trigger/enable sequence. Compilation runs
|
|
162
|
-
* asynchronously; follow with {@link waitForCompile}.
|
|
163
|
-
*/
|
|
164
|
-
deployTemplate(variables: ComputeDeployTemplateMutationVariables): Promise<ComputeDeployTemplateMutation['computeDeployTemplate']>;
|
|
165
|
-
/**
|
|
166
|
-
* Poll {@link moduleVersions} until the newest version's compile settles
|
|
167
|
-
* (`succeeded` or `failed`). Resolves with the settled version; **rejects**
|
|
168
|
-
* on compile failure (message includes the compile log) or timeout.
|
|
169
|
-
*
|
|
170
|
-
* Requires **`view_compute_diagnostics`**.
|
|
171
|
-
*/
|
|
172
|
-
waitForCompile(appId: ComputeModuleVersionsQueryVariables['appId'], moduleName: string, opts?: WaitForCompileOptions): Promise<ComputeModuleVersionsQuery['computeModuleVersions'][number]>;
|
|
173
|
-
/**
|
|
174
|
-
* List trigger bindings, optionally filtered to one module. Requires
|
|
175
|
-
* **`view_compute_diagnostics`**.
|
|
176
|
-
*/
|
|
177
|
-
moduleTriggers(variables: ComputeModuleTriggersQueryVariables): Promise<ComputeModuleTriggersQuery['computeModuleTriggers']>;
|
|
178
|
-
/**
|
|
179
|
-
* Read the app's compute policy (platform defaults when unset). Requires
|
|
180
|
-
* **`view_compute_diagnostics`**.
|
|
181
|
-
*/
|
|
182
|
-
modulePolicy(variables: ComputeModulePolicyQueryVariables): Promise<ComputeModulePolicyQuery['computeModulePolicy']>;
|
|
183
|
-
/**
|
|
184
|
-
* List runs, newest first (module loads/`init`, every failure, and circuit
|
|
185
|
-
* probes; healthy high-frequency ticks are aggregated into per-minute
|
|
186
|
-
* usage instead of one row per tick). Requires
|
|
187
|
-
* **`view_compute_diagnostics`**.
|
|
188
|
-
*/
|
|
189
|
-
moduleRuns(variables: ComputeModuleRunsQueryVariables): Promise<ComputeModuleRunsQuery['computeModuleRuns']>;
|
|
190
|
-
/**
|
|
191
|
-
* Aggregate activity over a recent window (default 60 minutes): run and
|
|
192
|
-
* failure counts, fuel, egress, per-module breakdown. Requires
|
|
193
|
-
* **`view_compute_diagnostics`**.
|
|
194
|
-
*/
|
|
195
|
-
moduleStats(variables: ComputeModuleStatsQueryVariables): Promise<ComputeModuleStatsQuery['computeModuleStats']>;
|
|
196
|
-
/**
|
|
197
|
-
* Diagnostic log lines (guest `log()` output + failure lines), newest
|
|
198
|
-
* first. Requires **`view_compute_diagnostics`**.
|
|
199
|
-
*/
|
|
200
|
-
moduleLogs(variables: ComputeModuleLogsQueryVariables): Promise<ComputeModuleLogsQuery['computeModuleLogs']>;
|
|
201
|
-
/**
|
|
202
|
-
* Snapshot of the app's compute footprint: module/version/trigger counts,
|
|
203
|
-
* 24h run activity, most-active modules. Requires
|
|
204
|
-
* **`view_compute_diagnostics`**.
|
|
205
|
-
*/
|
|
206
|
-
appDiagnostics(variables: ComputeAppDiagnosticsQueryVariables): Promise<ComputeAppDiagnosticsQuery['computeAppDiagnostics']>;
|
|
207
|
-
}
|
|
208
|
-
//# sourceMappingURL=compute.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compute.d.ts","sourceRoot":"","sources":["../../src/domains/compute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAEL,KAAK,2BAA2B,EAChC,KAAK,oCAAoC,EAEzC,KAAK,4BAA4B,EAEjC,KAAK,+BAA+B,EACpC,KAAK,wCAAwC,EAE7C,KAAK,2BAA2B,EAChC,KAAK,oCAAoC,EAEzC,KAAK,2BAA2B,EAChC,KAAK,oCAAoC,EAEzC,KAAK,4BAA4B,EACjC,KAAK,qCAAqC,EAE1C,KAAK,4BAA4B,EACjC,KAAK,qCAAqC,EAE1C,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EAEtC,KAAK,qBAAqB,EAC1B,KAAK,8BAA8B,EAEnC,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EAEjC,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAEhC,KAAK,0BAA0B,EAC/B,KAAK,mCAAmC,EAExC,KAAK,0BAA0B,EAC/B,KAAK,mCAAmC,EAExC,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EAEtC,KAAK,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