@crowdedkingdoms/crowdyjs 13.0.2 → 13.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3307,11 +3307,30 @@ export type FunctionPermissionEffectInput = {
3307
3307
  /** Expression resolving the target user id (int), e.g. "$caller_user_id" or "self.owner_user_id". */
3308
3308
  userExpression: Scalars['String']['input'];
3309
3309
  };
3310
+ /** A declarative one-shot timer the function arms TRANSACTIONALLY with its property mutations: "invoke this function again in N ms". The timer survives replica restarts and is claimed by the same dispatcher that runs scheduled automations, so it fires exactly once. Rolling back the invocation arms nothing. The target function must be autonomousInvocable, because a timer fires headlessly with no player in the request. */
3311
+ export type FunctionTimerInput = {
3312
+ /** Optional expression resolving an app-scoped string key. Re-arming the same key replaces the pending timer instead of queueing another fire, so a repeatedly invoked function cannot flood the timer queue. */
3313
+ dedupeKeyExpression?: InputMaybe<Scalars['String']['input']>;
3314
+ /** Expression resolving the delay in milliseconds (int > 0), floored by the app's minTimerDelayMs policy. */
3315
+ delayMsExpression: Scalars['String']['input'];
3316
+ /** The function to invoke when the timer fires. Must exist and be autonomousInvocable. */
3317
+ functionName: Scalars['String']['input'];
3318
+ /** Parameters bound into the delayed invocation. Expressions are evaluated at arm time on post-mutation state, so the fired invocation sees the values the arming logic decided. */
3319
+ params?: InputMaybe<Array<TimerParamInput>>;
3320
+ /** Container reference the delayed invocation runs against, e.g. "self" (default) or "$target_id". */
3321
+ target?: InputMaybe<Scalars['String']['input']>;
3322
+ };
3310
3323
  /** Startup contract for browser game clients. Fetch this after login to initialize protocol/version checks and UDP proxy state in one round trip. */
3311
3324
  export type GameClientBootstrap = {
3312
3325
  __typename?: 'GameClientBootstrap';
3313
3326
  /** The app (game) this bootstrap was requested for, echoed back. A BigInt as a decimal string. Reuse this exact appId to scope the udpNotifications subscription and on every spatial send for this play session. */
3314
3327
  appId: Scalars['BigInt']['output'];
3328
+ /** Whether this server exposes the binary realtime relay (crowdy-relay-v1): a raw WebSocket endpoint at binaryRelayPath that relays complete client-signed Buddy wire datagrams as BINARY frames in both directions, replacing the GraphQL send*\/udpNotifications hot path. When false, use the GraphQL realtime surface. */
3329
+ binaryRelayEnabled: Scalars['Boolean']['output'];
3330
+ /** HTTP path of the binary realtime relay WebSocket endpoint on this origin (e.g. "/realtime"). Connect with `?appId=<appId>` and offer the binaryRelayProtocol subprotocol; authenticate with an app-scoped bearer token via the Authorization header, a `bearer.<base64url(token)>` subprotocol entry, or `?token=`. Wire format: cks docs, client-wire-formats. */
3331
+ binaryRelayPath: Scalars['String']['output'];
3332
+ /** Required WebSocket subprotocol for the binary realtime relay. The client must offer it during the upgrade; the server selects it. Currently "crowdy-relay-v1". */
3333
+ binaryRelayProtocol: Scalars['String']['output'];
3315
3334
  /** Maximum allowed value for the `decayRate` (named attenuation algorithm id) field on spatial sends. Currently 5; the server clamps send `decayRate` to 0..this. decayRate selects how the message attenuates with distance (0 = none). */
3316
3335
  maxDecayRate: Scalars['Int']['output'];
3317
3336
  /** Maximum allowed value for the `distance` (chunk fan-out radius) field on spatial sends. Currently 8; the server clamps send `distance` to 0..this. distance is the number of chunks outward the message is replicated. */
@@ -3569,17 +3588,21 @@ export type GmAutomationPolicy = {
3569
3588
  maxCascadeDepth: Scalars['Int']['output'];
3570
3589
  /** Maximum fan-out targets per run. */
3571
3590
  maxFanout: Scalars['Int']['output'];
3591
+ /** Maximum pending (armed but not yet fired) timers the app may hold at once. */
3592
+ maxPendingTimers: Scalars['Int']['output'];
3572
3593
  /** Minimum allowed schedule interval (ms) floor. */
3573
3594
  minIntervalMs: Scalars['Int']['output'];
3595
+ /** Minimum timer delay (ms) floor for gameModelScheduleInvoke and function timer effects. */
3596
+ minTimerDelayMs: Scalars['Int']['output'];
3574
3597
  };
3575
3598
  /** One execution of an automation: its target/fan-out + invocation counts, timing, outcome, circuit action, and billed compute. The monitoring + billing record. */
3576
3599
  export type GmAutomationRun = {
3577
3600
  __typename?: 'GmAutomationRun';
3578
3601
  /** The app (tenant). */
3579
3602
  appId: Scalars['BigInt']['output'];
3580
- /** The automation that ran. */
3581
- automationId: Scalars['String']['output'];
3582
- /** The automation name at run time. */
3603
+ /** The automation that ran, or null for a timer fire (which has no owning automation). */
3604
+ automationId: Maybe<Scalars['String']['output']>;
3605
+ /** The automation name at run time, or the invoked function name for a timer fire. */
3583
3606
  automationName: Scalars['String']['output'];
3584
3607
  /** Cascade depth (0 = top-level). */
3585
3608
  cascadeDepth: Scalars['Int']['output'];
@@ -3613,7 +3636,9 @@ export type GmAutomationRun = {
3613
3636
  success: Scalars['Boolean']['output'];
3614
3637
  /** Number of target containers acted on (fan-out). */
3615
3638
  targets: Scalars['Int']['output'];
3616
- /** What triggered the run: schedule | event | manual | cascade. */
3639
+ /** The event trigger that matched, when the run came from one. Null for schedule, manual, and timer-fired runs. */
3640
+ triggerId: Maybe<Scalars['String']['output']>;
3641
+ /** What triggered the run: schedule | event | manual | cascade | timer. */
3617
3642
  triggerSource: Scalars['String']['output'];
3618
3643
  };
3619
3644
  /** Per-automation rollup within a stats window. */
@@ -3671,12 +3696,20 @@ export type GmAutomationTrigger = {
3671
3696
  debounceMs: Scalars['Int']['output'];
3672
3697
  /** Filter: only this function name. Always null for player_count_changed. */
3673
3698
  functionName: Maybe<Scalars['String']['output']>;
3699
+ /** When this trigger last matched an event and dispatched a run, or null if it has never matched. A trigger that stays null while its event is happening is almost always a filter that cannot match — see warnings. */
3700
+ lastMatchedAt: Maybe<Scalars['DateTime']['output']>;
3701
+ /** Runs this trigger dispatched in the last 24 hours, including runs a guard then dropped. Fires suppressed by debounceMs never reach a run and are not counted. */
3702
+ matchCount24h: Scalars['Int']['output'];
3674
3703
  /** Observed event: function_invoked | property_changed | container_created | player_count_changed. */
3675
3704
  onEvent: Scalars['String']['output'];
3676
3705
  /** Filter: only this property key. Always null for player_count_changed. */
3677
3706
  propertyKey: Maybe<Scalars['String']['output']>;
3678
3707
  /** Unique trigger id (UUID). */
3679
3708
  triggerId: Scalars['String']['output'];
3709
+ /** Authoring problems detected for this trigger, empty when healthy. Reported rather than silently never firing. */
3710
+ warnings: Array<Scalars['String']['output']>;
3711
+ /** property_changed only: which writes are observed — "direct" (gameModelSetProperty), "function" (a mutation applied inside an invoke, automation run, or timer fire), or "any". Always "any" for other events, which ignore it. */
3712
+ writeSource: Scalars['String']['output'];
3680
3713
  };
3681
3714
  /** A container: a runtime instance of a container type (optionally scoped to a session). */
3682
3715
  export type GmContainer = {
@@ -3863,6 +3896,8 @@ export type GmFunction = {
3863
3896
  returnExpression: Maybe<Scalars['String']['output']>;
3864
3897
  /** Optional declared return value type. */
3865
3898
  returnType: Maybe<Scalars['String']['output']>;
3899
+ /** Declarative one-shot timers armed atomically with the function's mutations. */
3900
+ timers: Array<GmFunctionTimer>;
3866
3901
  /** Non-fatal static-analysis warnings from the last upload. */
3867
3902
  warnings: Array<Scalars['String']['output']>;
3868
3903
  };
@@ -3916,6 +3951,20 @@ export type GmFunctionPermissionEffect = {
3916
3951
  /** The expression (source) resolving the target user id. */
3917
3952
  userExpression: Scalars['String']['output'];
3918
3953
  };
3954
+ /** A declarative one-shot timer the function arms transactionally with its mutations: invoke another function after a delay. Fires exactly once, survives replica restarts, and is bounded by the app's automation guardrails. */
3955
+ export type GmFunctionTimer = {
3956
+ __typename?: 'GmFunctionTimer';
3957
+ /** Optional expression (source) resolving the app-scoped dedupe key; re-arming the same key replaces the pending timer. */
3958
+ dedupeKeyExpression: Maybe<Scalars['String']['output']>;
3959
+ /** The expression (source) resolving the delay in milliseconds. */
3960
+ delayMsExpression: Scalars['String']['output'];
3961
+ /** The function invoked when the timer fires. */
3962
+ functionName: Scalars['String']['output'];
3963
+ /** Parameters bound into the delayed invocation. */
3964
+ params: Array<GmTimerParam>;
3965
+ /** Container reference (source) the delayed invocation runs against, e.g. "self". */
3966
+ target: Scalars['String']['output'];
3967
+ };
3919
3968
  /** The outcome of a gameModelInvoke call (return value, applied writes, and any error). */
3920
3969
  export type GmInvokeResult = {
3921
3970
  __typename?: 'GmInvokeResult';
@@ -4039,6 +4088,42 @@ export type GmTierFeature = {
4039
4088
  /** The access tier the feature is granted to. */
4040
4089
  tierId: Scalars['BigInt']['output'];
4041
4090
  };
4091
+ /** A pending one-shot timer: a delayed invocation that has been armed but has not fired yet. Timers are removed from this list the moment they are claimed for execution. */
4092
+ export type GmTimer = {
4093
+ __typename?: 'GmTimer';
4094
+ /** The app (tenant). */
4095
+ appId: Scalars['BigInt']['output'];
4096
+ /** What armed it: function (a timer effect inside an invoke) | client (gameModelScheduleInvoke) | automation. */
4097
+ armedBy: Scalars['String']['output'];
4098
+ /** Cascade depth inherited from whatever armed the timer. The fired invocation runs one deeper, so timer chains are bounded by the app's maxCascadeDepth. */
4099
+ cascadeDepth: Scalars['Int']['output'];
4100
+ /** When the timer was armed. */
4101
+ createdAt: Scalars['DateTime']['output'];
4102
+ /** App-scoped dedupe key, or null. Re-arming the same key replaces this timer instead of adding another. */
4103
+ dedupeKey: Maybe<Scalars['String']['output']>;
4104
+ /** When the timer becomes due. */
4105
+ fireAt: Scalars['DateTime']['output'];
4106
+ /** Flow correlation id carried from the arming call, so the eventual fire stays visible in gameModelFlow. */
4107
+ flowId: Maybe<Scalars['String']['output']>;
4108
+ /** The function that will be invoked when it fires. */
4109
+ functionName: Scalars['String']['output'];
4110
+ /** JSON object of parameters bound at arm time and passed to the invocation. */
4111
+ paramsJson: Scalars['String']['output'];
4112
+ /** Container the delayed invocation runs against ("self"). */
4113
+ selfContainerId: Scalars['String']['output'];
4114
+ /** Session the delayed invocation runs in, or null if app-global. */
4115
+ sessionId: Maybe<Scalars['String']['output']>;
4116
+ /** Unique timer id (UUID). */
4117
+ timerId: Scalars['String']['output'];
4118
+ };
4119
+ /** One named parameter expression bound into a timer invocation at arm time. */
4120
+ export type GmTimerParam = {
4121
+ __typename?: 'GmTimerParam';
4122
+ /** The expression (source) evaluated when arming. */
4123
+ expression: Scalars['String']['output'];
4124
+ /** Parameter name on the timer's target function. */
4125
+ name: Scalars['String']['output'];
4126
+ };
4042
4127
  /** A function and its recent invocation counts (diagnostics). */
4043
4128
  export type GmTopFunction = {
4044
4129
  __typename?: 'GmTopFunction';
@@ -4722,6 +4807,8 @@ export type Mutation = {
4722
4807
  forceLogoutUser: Scalars['Boolean']['output'];
4723
4808
  /** Create a directed relationship edge between two containers (the game model is a graph), with a relationship type and optional weight. Requires a valid token. */
4724
4809
  gameModelAddEdge: GmEdge;
4810
+ /** Cancel pending timers by id or by dedupe key, returning how many were removed. A timer already claimed for execution cannot be cancelled. Requires app-admin ('manage_apps'). */
4811
+ gameModelCancelTimer: Scalars['Int']['output'];
4725
4812
  /** Instantiate a container (a runtime entity of a given type), optionally within a session, with an owner and initial properties. Subject to the type's instantiableBy rule (admin | member | owner). Requires a valid token. */
4726
4813
  gameModelCreateContainer: GmContainer;
4727
4814
  /** Create a runtime session: an isolated instance scope for containers (e.g. a match, room, or save). Subject to the app's session creation policy. The caller becomes the creator and a participant. Requires a valid token. */
@@ -4754,6 +4841,8 @@ export type Mutation = {
4754
4841
  gameModelRevokeTierFeature: Scalars['Boolean']['output'];
4755
4842
  /** Run an automation once, immediately (manual trigger), regardless of its schedule. Applies the same guard chain (app gate, rate limit, circuit) and records a run. Useful for testing an NPC. Requires app-admin ('manage_apps'). */
4756
4843
  gameModelRunAutomation: GmAutomationRun;
4844
+ /** Arm a one-shot timer: invoke a function once, after a delay. The timer is durable (it survives an API restart) and claimed by exactly one replica, so it fires once. The target function must be autonomousInvocable, because the fire is headless and runs with system authority rather than a player's — which is also why this needs app-admin ('manage_apps'). For player-driven delays, author a timers effect on a function instead so the delay is part of your game logic. Supply dedupeKey to make re-arming replace the pending timer rather than queue another fire. */
4845
+ gameModelScheduleInvoke: GmTimer;
4757
4846
  /** Bulk-create game-model definitions (container types, property defs, functions) and optionally instances (containers + edges) in one transaction — used to initialize or import a model. Requires app-admin ('manage_apps'). Returns counts created, warnings, and a map of seed temp_id -> created container UUID. */
4758
4847
  gameModelSeed: GmSeedResult;
4759
4848
  /** Enable or disable an automation. Re-enabling also resets its circuit breaker (closed, zero failures, no pause) so a tripped automation resumes. Requires app-admin ('manage_apps'). */
@@ -5327,6 +5416,11 @@ export type MutationForceLogoutUserArgs = {
5327
5416
  export type MutationGameModelAddEdgeArgs = {
5328
5417
  input: AddEdgeInput;
5329
5418
  };
5419
+ export type MutationGameModelCancelTimerArgs = {
5420
+ appId: Scalars['BigInt']['input'];
5421
+ dedupeKey?: InputMaybe<Scalars['String']['input']>;
5422
+ timerId?: InputMaybe<Scalars['String']['input']>;
5423
+ };
5330
5424
  export type MutationGameModelCreateContainerArgs = {
5331
5425
  input: CreateContainerInput;
5332
5426
  };
@@ -5384,6 +5478,9 @@ export type MutationGameModelRunAutomationArgs = {
5384
5478
  appId: Scalars['BigInt']['input'];
5385
5479
  name: Scalars['String']['input'];
5386
5480
  };
5481
+ export type MutationGameModelScheduleInvokeArgs = {
5482
+ input: ScheduleInvokeInput;
5483
+ };
5387
5484
  export type MutationGameModelSeedArgs = {
5388
5485
  input: SeedGameModelInput;
5389
5486
  };
@@ -7070,6 +7167,8 @@ export type Query = {
7070
7167
  gameModelSessions: Array<GmSession>;
7071
7168
  /** List tier -> feature grants for an app, optionally filtered to one tier. Requires app-admin ('manage_apps'). */
7072
7169
  gameModelTierFeatures: Array<GmTierFeature>;
7170
+ /** Pending one-shot timers for the app, soonest first. A timer leaves this list the moment it is claimed for execution, so an empty list means nothing is scheduled (not that nothing ran). Requires app-admin ('manage_apps'). */
7171
+ gameModelTimers: Array<GmTimer>;
7073
7172
  /** Traverse the container graph from a root container along a relationship type up to a depth, returning the reachable nodes and edges. Requires a valid token. */
7074
7173
  gameModelTraverse: GmTraverseResult;
7075
7174
  /** Fetch a container type's full schema: its property definitions plus the functions available on it. Requires app-admin ('manage_apps'). */
@@ -7630,6 +7729,11 @@ export type QueryGameModelTierFeaturesArgs = {
7630
7729
  appId: Scalars['BigInt']['input'];
7631
7730
  tierId?: InputMaybe<Scalars['BigInt']['input']>;
7632
7731
  };
7732
+ export type QueryGameModelTimersArgs = {
7733
+ appId: Scalars['BigInt']['input'];
7734
+ limit?: InputMaybe<Scalars['Int']['input']>;
7735
+ sessionId?: InputMaybe<Scalars['String']['input']>;
7736
+ };
7633
7737
  export type QueryGameModelTraverseArgs = {
7634
7738
  appId: Scalars['BigInt']['input'];
7635
7739
  depth?: InputMaybe<Scalars['Int']['input']>;
@@ -8145,6 +8249,23 @@ export type SavedPaymentMethod = {
8145
8249
  /** Method status, e.g. 'active' or 'expired'. */
8146
8250
  status: Scalars['String']['output'];
8147
8251
  };
8252
+ /** Arm a one-shot timer that invokes a function after a delay. The target function must be autonomousInvocable, because the timer fires headlessly with no player in the request. */
8253
+ export type ScheduleInvokeInput = {
8254
+ /** The app (tenant). */
8255
+ appId: Scalars['BigInt']['input'];
8256
+ /** Optional app-scoped key. Re-arming the same key replaces the pending timer instead of adding another, which makes "reset the countdown" a single call. */
8257
+ dedupeKey?: InputMaybe<Scalars['String']['input']>;
8258
+ /** Delay in milliseconds before the timer fires. Must be at least the app's minTimerDelayMs and at most 30 days. */
8259
+ delayMs: Scalars['Int']['input'];
8260
+ /** The function to invoke when the timer fires. Must be autonomousInvocable. */
8261
+ functionName: Scalars['String']['input'];
8262
+ /** JSON object of parameters passed to the delayed invocation. Defaults to '{}'. */
8263
+ paramsJson?: InputMaybe<Scalars['String']['input']>;
8264
+ /** The 'self' container the delayed invocation runs against. Must belong to the app, and match the function's bound container type when it has one. */
8265
+ selfContainerId: Scalars['String']['input'];
8266
+ /** Session for the delayed invocation. Defaults to the container's own session. */
8267
+ sessionId?: InputMaybe<Scalars['String']['input']>;
8268
+ };
8148
8269
  /** A container (instance) to create as part of a seed. */
8149
8270
  export type SeedContainerInput = {
8150
8271
  /** Optional description. */
@@ -8216,6 +8337,8 @@ export type SeedFunctionInput = {
8216
8337
  returnExpression?: InputMaybe<Scalars['String']['input']>;
8217
8338
  /** Optional declared return value type. */
8218
8339
  returnType?: InputMaybe<Scalars['String']['input']>;
8340
+ /** Declarative one-shot timers armed atomically with the function's mutations: invoke another function after a delay. Max 4 per function. */
8341
+ timers?: InputMaybe<Array<FunctionTimerInput>>;
8219
8342
  };
8220
8343
  /** Bulk-create game-model definitions and optional instances in one transaction (model init/import). */
8221
8344
  export type SeedGameModelInput = {
@@ -8382,6 +8505,8 @@ export type ServerStatus = {
8382
8505
  cpuPeakPct: Maybe<Scalars['Float']['output']>;
8383
8506
  /** When this server was first registered in the fleet. */
8384
8507
  createdAt: Scalars['DateTime']['output'];
8508
+ /** True while the infra control plane is taking this server out of service (autoscale scale-in, or an in-place update). Excluded from serverWithLeastClients immediately; the server then reports Stopping and sends every client a reconnect command so they migrate elsewhere. Never set by the server itself. */
8509
+ drainRequested: Scalars['Boolean']['output'];
8385
8510
  /** IPv4 address native clients send spatial UDP datagrams to (paired with clientPort). Preferred over ip6 for inter-host UDP in current deployments. */
8386
8511
  ip4: Scalars['String']['output'];
8387
8512
  /** IPv6 address of the UDP game server. Global IPv6 between hosts can be unroutable in some deployments, so native clients generally use ip4 + clientPort. */
@@ -8490,8 +8615,12 @@ export type SetAutomationPolicyInput = {
8490
8615
  maxCascadeDepth?: InputMaybe<Scalars['Int']['input']>;
8491
8616
  /** Max fan-out targets per run. */
8492
8617
  maxFanout?: InputMaybe<Scalars['Int']['input']>;
8618
+ /** Max pending (armed but not yet fired) timers the app may hold at once. */
8619
+ maxPendingTimers?: InputMaybe<Scalars['Int']['input']>;
8493
8620
  /** Minimum schedule interval (ms) floor. */
8494
8621
  minIntervalMs?: InputMaybe<Scalars['Int']['input']>;
8622
+ /** Minimum timer delay (ms) floor for gameModelScheduleInvoke and function timer effects. */
8623
+ minTimerDelayMs?: InputMaybe<Scalars['Int']['input']>;
8495
8624
  };
8496
8625
  /** Set the per-app channel creation/membership policy (app-admin only). */
8497
8626
  export type SetChannelPolicyInput = {
@@ -8903,6 +9032,13 @@ export type TeleportResponse = {
8903
9032
  /** True when the teleport is authorized/accepted; false otherwise (inspect errorCode for the reason). */
8904
9033
  success: Scalars['Boolean']['output'];
8905
9034
  };
9035
+ /** One named parameter expression bound into a timer invocation. */
9036
+ export type TimerParamInput = {
9037
+ /** Expression evaluated when the timer is armed (not when it fires), in the arming invocation context. */
9038
+ expression: Scalars['String']['input'];
9039
+ /** Parameter name on the timer's target function. */
9040
+ name: Scalars['String']['input'];
9041
+ };
8906
9042
  export type TransferGridOwnershipInput = {
8907
9043
  /** App that contains the grid. */
8908
9044
  appId: Scalars['BigInt']['input'];
@@ -9230,16 +9366,18 @@ export type UpsertAutomationTriggerInput = {
9230
9366
  appId: Scalars['BigInt']['input'];
9231
9367
  /** The automation (by name) this trigger fires. */
9232
9368
  automationName: Scalars['String']['input'];
9233
- /** Filter: only this container type. Rejected for player_count_changed. */
9369
+ /** Filter: only this container type. For function_invoked this is the type of the invocation's "self" container, so you can watch "this function, on this type". Rejected for player_count_changed. */
9234
9370
  containerTypeName?: InputMaybe<Scalars['String']['input']>;
9235
9371
  /** Debounce window in ms. player_count_changed uses trailing-edge coalescing (first previous count plus latest current count/revision); existing model events retain leading-edge suppression. */
9236
9372
  debounceMs?: InputMaybe<Scalars['Int']['input']>;
9237
- /** Filter: only this function name. Rejected for player_count_changed. */
9373
+ /** Filter: only this function name. Applies to function_invoked; rejected for property_changed, container_created, and player_count_changed. */
9238
9374
  functionName?: InputMaybe<Scalars['String']['input']>;
9239
9375
  /** Event to observe: function_invoked | property_changed | container_created | player_count_changed. player_count_changed fires only after complete fleet counts change, and injects reserved previous/current/delta/revision params. */
9240
9376
  onEvent: Scalars['String']['input'];
9241
- /** Filter: only this property key. Rejected for player_count_changed. */
9377
+ /** Filter: only this property key. Applies to property_changed; rejected for function_invoked, container_created, and player_count_changed. */
9242
9378
  propertyKey?: InputMaybe<Scalars['String']['input']>;
9379
+ /** property_changed only: which writes to observe — "direct" (gameModelSetProperty), "function" (a mutation applied inside a gameModelInvoke, automation run, or timer fire), or "any" (default). Rejected for other events. */
9380
+ writeSource?: InputMaybe<Scalars['String']['input']>;
9243
9381
  };
9244
9382
  /** Create or update a WASM compute module (metadata only; source is uploaded with computeDeployVersion). Upsert key is (app, name). */
9245
9383
  export type UpsertComputeModuleInput = {
@@ -9326,6 +9464,8 @@ export type UpsertFunctionInput = {
9326
9464
  returnExpression?: InputMaybe<Scalars['String']['input']>;
9327
9465
  /** Optional declared return value type. */
9328
9466
  returnType?: InputMaybe<Scalars['String']['input']>;
9467
+ /** Declarative one-shot timers armed atomically with the function's mutations: invoke another function after a delay. Max 4 per function. */
9468
+ timers?: InputMaybe<Array<FunctionTimerInput>>;
9329
9469
  };
9330
9470
  /** Create or update a typed property on a container type. */
9331
9471
  export type UpsertPropertyDefInput = {
@@ -14652,7 +14792,11 @@ export type GmAutomationTriggerFieldsFragment = {
14652
14792
  functionName: string | null;
14653
14793
  containerTypeName: string | null;
14654
14794
  propertyKey: string | null;
14795
+ writeSource: string;
14655
14796
  debounceMs: number;
14797
+ lastMatchedAt: string | null;
14798
+ matchCount24h: number;
14799
+ warnings: Array<string>;
14656
14800
  };
14657
14801
  export type GmAutomationPolicyFieldsFragment = {
14658
14802
  __typename?: 'GmAutomationPolicy';
@@ -14663,15 +14807,18 @@ export type GmAutomationPolicyFieldsFragment = {
14663
14807
  maxFanout: number;
14664
14808
  maxCascadeDepth: number;
14665
14809
  globalRunsPerMinute: number;
14810
+ minTimerDelayMs: number;
14811
+ maxPendingTimers: number;
14666
14812
  };
14667
14813
  export type GmAutomationRunFieldsFragment = {
14668
14814
  __typename?: 'GmAutomationRun';
14669
14815
  runId: string;
14670
14816
  appId: string;
14671
14817
  flowId: string | null;
14672
- automationId: string;
14818
+ automationId: string | null;
14673
14819
  automationName: string;
14674
14820
  triggerSource: string;
14821
+ triggerId: string | null;
14675
14822
  parentRunId: string | null;
14676
14823
  cascadeDepth: number;
14677
14824
  startedAt: string;
@@ -14795,7 +14942,11 @@ export type GameModelUpsertAutomationTriggerMutation = {
14795
14942
  functionName: string | null;
14796
14943
  containerTypeName: string | null;
14797
14944
  propertyKey: string | null;
14945
+ writeSource: string;
14798
14946
  debounceMs: number;
14947
+ lastMatchedAt: string | null;
14948
+ matchCount24h: number;
14949
+ warnings: Array<string>;
14799
14950
  };
14800
14951
  };
14801
14952
  export type GameModelDeleteAutomationTriggerMutationVariables = Exact<{
@@ -14820,6 +14971,8 @@ export type GameModelSetAutomationPolicyMutation = {
14820
14971
  maxFanout: number;
14821
14972
  maxCascadeDepth: number;
14822
14973
  globalRunsPerMinute: number;
14974
+ minTimerDelayMs: number;
14975
+ maxPendingTimers: number;
14823
14976
  };
14824
14977
  };
14825
14978
  export type GameModelRunAutomationMutationVariables = Exact<{
@@ -14833,9 +14986,10 @@ export type GameModelRunAutomationMutation = {
14833
14986
  runId: string;
14834
14987
  appId: string;
14835
14988
  flowId: string | null;
14836
- automationId: string;
14989
+ automationId: string | null;
14837
14990
  automationName: string;
14838
14991
  triggerSource: string;
14992
+ triggerId: string | null;
14839
14993
  parentRunId: string | null;
14840
14994
  cascadeDepth: number;
14841
14995
  startedAt: string;
@@ -14952,7 +15106,11 @@ export type GameModelAutomationTriggersQuery = {
14952
15106
  functionName: string | null;
14953
15107
  containerTypeName: string | null;
14954
15108
  propertyKey: string | null;
15109
+ writeSource: string;
14955
15110
  debounceMs: number;
15111
+ lastMatchedAt: string | null;
15112
+ matchCount24h: number;
15113
+ warnings: Array<string>;
14956
15114
  }>;
14957
15115
  };
14958
15116
  export type GameModelAutomationPolicyQueryVariables = Exact<{
@@ -14969,6 +15127,8 @@ export type GameModelAutomationPolicyQuery = {
14969
15127
  maxFanout: number;
14970
15128
  maxCascadeDepth: number;
14971
15129
  globalRunsPerMinute: number;
15130
+ minTimerDelayMs: number;
15131
+ maxPendingTimers: number;
14972
15132
  };
14973
15133
  };
14974
15134
  export type GameModelAutomationRunsQueryVariables = Exact<{
@@ -14985,9 +15145,10 @@ export type GameModelAutomationRunsQuery = {
14985
15145
  runId: string;
14986
15146
  appId: string;
14987
15147
  flowId: string | null;
14988
- automationId: string;
15148
+ automationId: string | null;
14989
15149
  automationName: string;
14990
15150
  triggerSource: string;
15151
+ triggerId: string | null;
14991
15152
  parentRunId: string | null;
14992
15153
  cascadeDepth: number;
14993
15154
  startedAt: string;
@@ -15059,6 +15220,74 @@ export type GameModelAppDiagnosticsQuery = {
15059
15220
  }>;
15060
15221
  };
15061
15222
  };
15223
+ export type GmTimerFieldsFragment = {
15224
+ __typename?: 'GmTimer';
15225
+ timerId: string;
15226
+ appId: string;
15227
+ sessionId: string | null;
15228
+ selfContainerId: string;
15229
+ functionName: string;
15230
+ paramsJson: string;
15231
+ fireAt: string;
15232
+ dedupeKey: string | null;
15233
+ cascadeDepth: number;
15234
+ flowId: string | null;
15235
+ armedBy: string;
15236
+ createdAt: string;
15237
+ };
15238
+ export type GameModelScheduleInvokeMutationVariables = Exact<{
15239
+ input: ScheduleInvokeInput;
15240
+ }>;
15241
+ export type GameModelScheduleInvokeMutation = {
15242
+ __typename?: 'Mutation';
15243
+ gameModelScheduleInvoke: {
15244
+ __typename?: 'GmTimer';
15245
+ timerId: string;
15246
+ appId: string;
15247
+ sessionId: string | null;
15248
+ selfContainerId: string;
15249
+ functionName: string;
15250
+ paramsJson: string;
15251
+ fireAt: string;
15252
+ dedupeKey: string | null;
15253
+ cascadeDepth: number;
15254
+ flowId: string | null;
15255
+ armedBy: string;
15256
+ createdAt: string;
15257
+ };
15258
+ };
15259
+ export type GameModelCancelTimerMutationVariables = Exact<{
15260
+ appId: Scalars['BigInt']['input'];
15261
+ timerId?: InputMaybe<Scalars['String']['input']>;
15262
+ dedupeKey?: InputMaybe<Scalars['String']['input']>;
15263
+ }>;
15264
+ export type GameModelCancelTimerMutation = {
15265
+ __typename?: 'Mutation';
15266
+ gameModelCancelTimer: number;
15267
+ };
15268
+ export type GameModelTimersQueryVariables = Exact<{
15269
+ appId: Scalars['BigInt']['input'];
15270
+ sessionId?: InputMaybe<Scalars['String']['input']>;
15271
+ limit?: InputMaybe<Scalars['Int']['input']>;
15272
+ }>;
15273
+ export type GameModelTimersQuery = {
15274
+ __typename?: 'Query';
15275
+ gameModelTimers: Array<{
15276
+ __typename?: 'GmTimer';
15277
+ timerId: string;
15278
+ appId: string;
15279
+ sessionId: string | null;
15280
+ selfContainerId: string;
15281
+ functionName: string;
15282
+ paramsJson: string;
15283
+ fireAt: string;
15284
+ dedupeKey: string | null;
15285
+ cascadeDepth: number;
15286
+ flowId: string | null;
15287
+ armedBy: string;
15288
+ createdAt: string;
15289
+ }>;
15290
+ };
15062
15291
  export type GameModelActivePlayerCountQueryVariables = Exact<{
15063
15292
  appId: Scalars['BigInt']['input'];
15064
15293
  }>;
@@ -15504,9 +15733,10 @@ export type GameModelFlowQuery = {
15504
15733
  runId: string;
15505
15734
  appId: string;
15506
15735
  flowId: string | null;
15507
- automationId: string;
15736
+ automationId: string | null;
15508
15737
  automationName: string;
15509
15738
  triggerSource: string;
15739
+ triggerId: string | null;
15510
15740
  parentRunId: string | null;
15511
15741
  cascadeDepth: number;
15512
15742
  startedAt: string;
@@ -15590,6 +15820,18 @@ export type GmFunctionFieldsFragment = {
15590
15820
  gridIdExpression: string;
15591
15821
  ttlSecondsExpression: string | null;
15592
15822
  }>;
15823
+ timers: Array<{
15824
+ __typename?: 'GmFunctionTimer';
15825
+ functionName: string;
15826
+ target: string;
15827
+ delayMsExpression: string;
15828
+ dedupeKeyExpression: string | null;
15829
+ params: Array<{
15830
+ __typename?: 'GmTimerParam';
15831
+ name: string;
15832
+ expression: string;
15833
+ }>;
15834
+ }>;
15593
15835
  };
15594
15836
  export type GmPropertyDefFieldsFragment = {
15595
15837
  __typename?: 'GmPropertyDef';
@@ -15719,6 +15961,18 @@ export type GameModelUpsertFunctionMutation = {
15719
15961
  gridIdExpression: string;
15720
15962
  ttlSecondsExpression: string | null;
15721
15963
  }>;
15964
+ timers: Array<{
15965
+ __typename?: 'GmFunctionTimer';
15966
+ functionName: string;
15967
+ target: string;
15968
+ delayMsExpression: string;
15969
+ dedupeKeyExpression: string | null;
15970
+ params: Array<{
15971
+ __typename?: 'GmTimerParam';
15972
+ name: string;
15973
+ expression: string;
15974
+ }>;
15975
+ }>;
15722
15976
  };
15723
15977
  };
15724
15978
  export type GameModelDeleteFunctionMutationVariables = Exact<{
@@ -15831,6 +16085,18 @@ export type GameModelTypeSchemaQuery = {
15831
16085
  gridIdExpression: string;
15832
16086
  ttlSecondsExpression: string | null;
15833
16087
  }>;
16088
+ timers: Array<{
16089
+ __typename?: 'GmFunctionTimer';
16090
+ functionName: string;
16091
+ target: string;
16092
+ delayMsExpression: string;
16093
+ dedupeKeyExpression: string | null;
16094
+ params: Array<{
16095
+ __typename?: 'GmTimerParam';
16096
+ name: string;
16097
+ expression: string;
16098
+ }>;
16099
+ }>;
15834
16100
  }>;
15835
16101
  };
15836
16102
  };
@@ -15920,6 +16186,18 @@ export type GameModelFunctionQuery = {
15920
16186
  gridIdExpression: string;
15921
16187
  ttlSecondsExpression: string | null;
15922
16188
  }>;
16189
+ timers: Array<{
16190
+ __typename?: 'GmFunctionTimer';
16191
+ functionName: string;
16192
+ target: string;
16193
+ delayMsExpression: string;
16194
+ dedupeKeyExpression: string | null;
16195
+ params: Array<{
16196
+ __typename?: 'GmTimerParam';
16197
+ name: string;
16198
+ expression: string;
16199
+ }>;
16200
+ }>;
15923
16201
  };
15924
16202
  };
15925
16203
  export type GameModelFunctionsQueryVariables = Exact<{
@@ -15974,6 +16252,18 @@ export type GameModelFunctionsQuery = {
15974
16252
  gridIdExpression: string;
15975
16253
  ttlSecondsExpression: string | null;
15976
16254
  }>;
16255
+ timers: Array<{
16256
+ __typename?: 'GmFunctionTimer';
16257
+ functionName: string;
16258
+ target: string;
16259
+ delayMsExpression: string;
16260
+ dedupeKeyExpression: string | null;
16261
+ params: Array<{
16262
+ __typename?: 'GmTimerParam';
16263
+ name: string;
16264
+ expression: string;
16265
+ }>;
16266
+ }>;
15977
16267
  }>;
15978
16268
  };
15979
16269
  export type GameModelFeaturesQueryVariables = Exact<{
@@ -19725,6 +20015,7 @@ export declare const GmAutomationFieldsFragmentDoc: DocumentNode<GmAutomationFie
19725
20015
  export declare const GmAutomationTriggerFieldsFragmentDoc: DocumentNode<GmAutomationTriggerFieldsFragment, unknown>;
19726
20016
  export declare const GmAutomationPolicyFieldsFragmentDoc: DocumentNode<GmAutomationPolicyFieldsFragment, unknown>;
19727
20017
  export declare const GmAutomationRunFieldsFragmentDoc: DocumentNode<GmAutomationRunFieldsFragment, unknown>;
20018
+ export declare const GmTimerFieldsFragmentDoc: DocumentNode<GmTimerFieldsFragment, unknown>;
19728
20019
  export declare const GmSessionFieldsFragmentDoc: DocumentNode<GmSessionFieldsFragment, unknown>;
19729
20020
  export declare const GmContainerFieldsFragmentDoc: DocumentNode<GmContainerFieldsFragment, unknown>;
19730
20021
  export declare const GmInvokeResultFieldsFragmentDoc: DocumentNode<GmInvokeResultFieldsFragment, unknown>;
@@ -19902,6 +20193,9 @@ export declare const GameModelAutomationPolicyDocument: DocumentNode<GameModelAu
19902
20193
  export declare const GameModelAutomationRunsDocument: DocumentNode<GameModelAutomationRunsQuery, GameModelAutomationRunsQueryVariables>;
19903
20194
  export declare const GameModelAutomationStatsDocument: DocumentNode<GameModelAutomationStatsQuery, GameModelAutomationStatsQueryVariables>;
19904
20195
  export declare const GameModelAppDiagnosticsDocument: DocumentNode<GameModelAppDiagnosticsQuery, GameModelAppDiagnosticsQueryVariables>;
20196
+ export declare const GameModelScheduleInvokeDocument: DocumentNode<GameModelScheduleInvokeMutation, GameModelScheduleInvokeMutationVariables>;
20197
+ export declare const GameModelCancelTimerDocument: DocumentNode<GameModelCancelTimerMutation, GameModelCancelTimerMutationVariables>;
20198
+ export declare const GameModelTimersDocument: DocumentNode<GameModelTimersQuery, GameModelTimersQueryVariables>;
19905
20199
  export declare const GameModelActivePlayerCountDocument: DocumentNode<GameModelActivePlayerCountQuery, GameModelActivePlayerCountQueryVariables>;
19906
20200
  export declare const GameModelActivePlayerCountChangedDocument: DocumentNode<GameModelActivePlayerCountChangedSubscription, GameModelActivePlayerCountChangedSubscriptionVariables>;
19907
20201
  export declare const GameModelCreateSessionDocument: DocumentNode<GameModelCreateSessionMutation, GameModelCreateSessionMutationVariables>;