@crowdedkingdoms/crowdyjs 8.10.0 → 8.12.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.
@@ -2228,12 +2228,18 @@ export type GmAppPolicy = {
2228
2228
  /** An autonomous process (automation / NPC): a server-driven entry-point function bound to a trigger (schedule or model activity) plus a safety budget and circuit-breaker state. */
2229
2229
  export type GmAutomation = {
2230
2230
  __typename?: 'GmAutomation';
2231
+ /** Action kind: model_function (invoke a Model function) or compute_invoke (invoke a compute-module export). */
2232
+ actionKind: Scalars['String']['output'];
2231
2233
  /** The app (tenant) that owns the automation. */
2232
2234
  appId: Scalars['BigInt']['output'];
2233
2235
  /** Unique automation id (UUID). */
2234
2236
  automationId: Scalars['String']['output'];
2235
2237
  /** Circuit-breaker state: closed | open | half_open. */
2236
2238
  circuitState: Scalars['String']['output'];
2239
+ /** For action_kind=compute_invoke: the module invoke export called. */
2240
+ computeExport: Maybe<Scalars['String']['output']>;
2241
+ /** For action_kind=compute_invoke: the compute module name invoked. */
2242
+ computeModuleName: Maybe<Scalars['String']['output']>;
2237
2243
  /** Current consecutive-failure count. */
2238
2244
  consecutiveFailures: Scalars['Int']['output'];
2239
2245
  /** Cooldown (ms) while the circuit is open. */
@@ -2246,8 +2252,8 @@ export type GmAutomation = {
2246
2252
  enabled: Scalars['Boolean']['output'];
2247
2253
  /** Consecutive failures that trip the circuit breaker. */
2248
2254
  failureThreshold: Scalars['Int']['output'];
2249
- /** The entry-point function name (must be autonomous_invocable). */
2250
- functionName: Scalars['String']['output'];
2255
+ /** The entry-point function name (must be autonomous_invocable). Null for compute_invoke actions. */
2256
+ functionName: Maybe<Scalars['String']['output']>;
2251
2257
  /** Override: evaluation gas per invoke. */
2252
2258
  gasLimit: Maybe<Scalars['Int']['output']>;
2253
2259
  /** Interval in ms (schedule_kind=interval). */
@@ -2431,6 +2437,26 @@ export type GmContainer = {
2431
2437
  /** The container type name. */
2432
2438
  typeName: Scalars['String']['output'];
2433
2439
  };
2440
+ /** One container-change notification from gameModelContainerChanged. Metadata only (no property values): clients pull the visibility-filtered state with gameModelContainerState on receipt. Delivery is post-commit and best-effort, like model-driven notifications. */
2441
+ export type GmContainerChange = {
2442
+ __typename?: 'GmContainerChange';
2443
+ /** The app (tenant). */
2444
+ appId: Scalars['BigInt']['output'];
2445
+ /** The property keys the change touched (empty for created/deleted; clamped to 32 keys). */
2446
+ changedKeys: Array<Scalars['String']['output']>;
2447
+ /** The container that changed. */
2448
+ containerId: Scalars['String']['output'];
2449
+ /** For source='function': the function that mutated it. */
2450
+ functionName: Maybe<Scalars['String']['output']>;
2451
+ /** When the change committed. */
2452
+ occurredAt: Scalars['DateTime']['output'];
2453
+ /** The session scope of the change, when any. */
2454
+ sessionId: Maybe<Scalars['String']['output']>;
2455
+ /** What changed it: 'function' (invoke mutation), 'direct' (gameModelSetProperty), 'created', or 'deleted'. */
2456
+ source: Scalars['String']['output'];
2457
+ /** The container type (null if the type is unknown). */
2458
+ typeName: Maybe<Scalars['String']['output']>;
2459
+ };
2434
2460
  /** A container plus its property values filtered to what the requesting caller is allowed to see. */
2435
2461
  export type GmContainerState = {
2436
2462
  __typename?: 'GmContainerState';
@@ -2663,6 +2689,15 @@ export type GmPropertyDef = {
2663
2689
  /** Who may write the property: function | owner | admin. */
2664
2690
  writable: Scalars['String']['output'];
2665
2691
  };
2692
+ /** One property predicate for filtered container lists (the same shape automation selectors use): compare a property value against a JSON literal. Missing properties fall back to the type default. */
2693
+ export type GmPropertyPredicateInput = {
2694
+ /** Property key to compare. */
2695
+ key: Scalars['String']['input'];
2696
+ /** Comparison operator: '==', '!=', '<', '>', '<=' or '>='. */
2697
+ op: Scalars['String']['input'];
2698
+ /** JSON-encoded comparison value (e.g. '"enemy"', 'true', '10'). */
2699
+ valueJson: Scalars['String']['input'];
2700
+ };
2666
2701
  /** Summary of what a gameModelSeed call created. */
2667
2702
  export type GmSeedResult = {
2668
2703
  __typename?: 'GmSeedResult';
@@ -4573,7 +4608,7 @@ export type Query = {
4573
4608
  gameModelContainerState: GmContainerState;
4574
4609
  /** List all container types defined for an app. Requires app-admin ('manage_apps'). */
4575
4610
  gameModelContainerTypes: Array<GmContainerType>;
4576
- /** List containers in an app, optionally filtered by container type and/or session. Requires a valid token. */
4611
+ /** List containers in an app, optionally filtered by container type and/or session, by property predicates (`where`, requires typeName; the same predicate shape automation selectors use — missing properties fall back to the type default), and paged with offset/limit over the stable created-at ordering. Requires a valid token. */
4577
4612
  gameModelContainers: Array<GmContainer>;
4578
4613
  /** Query the function-invocation event log (audit trail) with optional filters and pagination. Useful for debugging functions or showing recent activity. Requires a valid token. */
4579
4614
  gameModelEvents: Array<GmEvent>;
@@ -5015,8 +5050,11 @@ export type QueryGameModelContainerTypesArgs = {
5015
5050
  };
5016
5051
  export type QueryGameModelContainersArgs = {
5017
5052
  appId: Scalars['BigInt']['input'];
5053
+ limit?: InputMaybe<Scalars['Int']['input']>;
5054
+ offset?: InputMaybe<Scalars['Int']['input']>;
5018
5055
  sessionId?: InputMaybe<Scalars['String']['input']>;
5019
5056
  typeName?: InputMaybe<Scalars['String']['input']>;
5057
+ where?: InputMaybe<Array<GmPropertyPredicateInput>>;
5020
5058
  };
5021
5059
  export type QueryGameModelEventsArgs = {
5022
5060
  appId: Scalars['BigInt']['input'];
@@ -5875,9 +5913,16 @@ export type SocialLoginStartInput = {
5875
5913
  };
5876
5914
  export type Subscription = {
5877
5915
  __typename?: 'Subscription';
5916
+ /** Push notification whenever a container in the app changes: an invoke mutated it, a direct gameModelSetProperty wrote it, or it was created/deleted. Metadata only (containerId, typeName, changedKeys — no property values); pull the visibility-filtered state with gameModelContainerState on receipt. Post-commit and best-effort (a dropped event costs one missed pull, never correctness) — durable reads remain the source of truth. Optional typeName/sessionId filters narrow delivery. Fans out across all API replicas. Requires a valid token. Replaces interval polling with pull-on-push. */
5917
+ gameModelContainerChanged: GmContainerChange;
5878
5918
  /** Realtime downlink from the game server: spatial notifications and responses, GenericErrorResponse (errors from your sends, correlated by sequenceNumber), and RealtimeConnectionEvent (lifecycle/setup failures). Requires a bearer game token AND an appId-scoped connection — the appId is read from the graphql-transport-ws connection (game tokens are app-agnostic and one UDP socket is shared across apps, so an app-agnostic subscription is rejected with a RealtimeConnectionEvent code APP_ID_REQUIRED, and a missing/invalid token with AUTH_REQUIRED). On subscribe, opens a UDP proxy session if none exists (binds to the least-loaded game server); open/transport failures are delivered as RealtimeConnectionEvent (code UDP_PROXY_CONNECTION_FAILED) and then the stream ends. Only this app’s spatial fan-out is delivered; appId-less control frames always pass. Subscribe before/while sending so async results are not missed. Unsubscribing stops delivery only — it does NOT close the UDP session; call disconnectUdpProxy (or rely on the server inactivity timeout) to release it. */
5879
5919
  udpNotifications: Maybe<UdpNotification>;
5880
5920
  };
5921
+ export type SubscriptionGameModelContainerChangedArgs = {
5922
+ appId: Scalars['BigInt']['input'];
5923
+ sessionId?: InputMaybe<Scalars['String']['input']>;
5924
+ typeName?: InputMaybe<Scalars['String']['input']>;
5925
+ };
5881
5926
  export type TeleportRequestInput = {
5882
5927
  /** App (game) to teleport within. Must be greater than 0 (a non-positive value yields errorCode INVALID_APP_ID). BigInt sent as a decimal string. */
5883
5928
  appId: Scalars['BigInt']['input'];
@@ -6171,8 +6216,14 @@ export type UpdateVoxelInput = {
6171
6216
  };
6172
6217
  /** Create or update an autonomous process (automation / NPC). Upsert key is (app, name). */
6173
6218
  export type UpsertAutomationInput = {
6219
+ /** Action kind: model_function (default — invoke a Model function) or compute_invoke (invoke a compute-module export directly; the trusted server path, no invoke policy evaluation). */
6220
+ actionKind?: InputMaybe<Scalars['String']['input']>;
6174
6221
  /** The app (tenant) that owns the automation. */
6175
6222
  appId: Scalars['BigInt']['input'];
6223
+ /** For action_kind=compute_invoke: the module invoke export to call (must be bound as an invoke trigger on the module). */
6224
+ computeExport?: InputMaybe<Scalars['String']['input']>;
6225
+ /** For action_kind=compute_invoke: the compute module name to invoke. */
6226
+ computeModuleName?: InputMaybe<Scalars['String']['input']>;
6176
6227
  /** Cooldown (ms) while the circuit is open. */
6177
6228
  cooldownMs?: InputMaybe<Scalars['Int']['input']>;
6178
6229
  /** Cron expression (schedule_kind=cron). */
@@ -6183,8 +6234,8 @@ export type UpsertAutomationInput = {
6183
6234
  enabled?: InputMaybe<Scalars['Boolean']['input']>;
6184
6235
  /** Consecutive failures that open the circuit. */
6185
6236
  failureThreshold?: InputMaybe<Scalars['Int']['input']>;
6186
- /** Entry-point function name (must be autonomous_invocable). */
6187
- functionName: Scalars['String']['input'];
6237
+ /** Entry-point function name (must be autonomous_invocable). Required for action_kind=model_function; ignored for compute_invoke. */
6238
+ functionName?: InputMaybe<Scalars['String']['input']>;
6188
6239
  /** Override: gas per invoke. */
6189
6240
  gasLimit?: InputMaybe<Scalars['Int']['input']>;
6190
6241
  /** Interval in ms (schedule_kind=interval). */
@@ -6211,7 +6262,7 @@ export type UpsertAutomationInput = {
6211
6262
  selfContainerId?: InputMaybe<Scalars['String']['input']>;
6212
6263
  /** Optional session scope (UUID). */
6213
6264
  sessionId?: InputMaybe<Scalars['String']['input']>;
6214
- /** Target mode: container | type | global. Defaults to container. */
6265
+ /** Target mode: container | type | global. Defaults to container (model_function) / global (compute_invoke). */
6215
6266
  targetMode?: InputMaybe<Scalars['String']['input']>;
6216
6267
  /** For target_mode=type: the container type to fan out over. */
6217
6268
  targetTypeName?: InputMaybe<Scalars['String']['input']>;
@@ -6252,6 +6303,8 @@ export type UpsertComputeTriggerInput = {
6252
6303
  appId: Scalars['BigInt']['input'];
6253
6304
  /** Event filter: only this container type. */
6254
6305
  containerTypeName?: InputMaybe<Scalars['String']['input']>;
6306
+ /** For invoke triggers: optional typed contract (JSON): {"params": {name: {type, required?, description?}}, "result": {...}, "description"?}. Types: int|float|string|bool|object|array. Declared params are validated on computeInvoke BEFORE the sandbox runs (required presence + type; undeclared params pass through); result is documentation/codegen only. Null = no validation. */
6307
+ contractJson?: InputMaybe<Scalars['String']['input']>;
6255
6308
  /** Debounce/coalesce window in ms for event triggers. */
6256
6309
  debounceMs?: InputMaybe<Scalars['Int']['input']>;
6257
6310
  /** Event filter: only compute events with this name (on_event=compute_event). */
@@ -6884,6 +6937,8 @@ export type WasmModuleTrigger = {
6884
6937
  appId: Scalars['BigInt']['output'];
6885
6938
  /** Event filter: only this container type. */
6886
6939
  containerTypeName: Maybe<Scalars['String']['output']>;
6940
+ /** For invoke triggers: the typed contract (JSON: params/result field maps with int|float|string|bool|object|array types). The platform validates computeInvoke params against it pre-sandbox; client codegen reads it for typed wrappers. Null = undeclared. */
6941
+ contractJson: Maybe<Scalars['String']['output']>;
6887
6942
  /** When the trigger was created. */
6888
6943
  createdAt: Scalars['DateTime']['output'];
6889
6944
  /** Debounce/coalesce window in ms. */
@@ -8534,6 +8589,7 @@ export type ComputeTriggerFieldsFragment = {
8534
8589
  debounceMs: number;
8535
8590
  exportName: string | null;
8536
8591
  invokePolicyJson: string | null;
8592
+ contractJson: string | null;
8537
8593
  createdAt: string;
8538
8594
  };
8539
8595
  export type ComputePolicyFieldsFragment = {
@@ -8666,6 +8722,7 @@ export type ComputeUpsertTriggerMutation = {
8666
8722
  debounceMs: number;
8667
8723
  exportName: string | null;
8668
8724
  invokePolicyJson: string | null;
8725
+ contractJson: string | null;
8669
8726
  createdAt: string;
8670
8727
  };
8671
8728
  };
@@ -8804,6 +8861,7 @@ export type ComputeModuleTriggersQuery = {
8804
8861
  debounceMs: number;
8805
8862
  exportName: string | null;
8806
8863
  invokePolicyJson: string | null;
8864
+ contractJson: string | null;
8807
8865
  createdAt: string;
8808
8866
  }>;
8809
8867
  };
@@ -9874,7 +9932,10 @@ export type GmAutomationFieldsFragment = {
9874
9932
  name: string;
9875
9933
  description: string | null;
9876
9934
  enabled: boolean;
9877
- functionName: string;
9935
+ actionKind: string;
9936
+ functionName: string | null;
9937
+ computeModuleName: string | null;
9938
+ computeExport: string | null;
9878
9939
  targetMode: string;
9879
9940
  selfContainerId: string | null;
9880
9941
  targetTypeName: string | null;
@@ -9955,7 +10016,10 @@ export type GameModelUpsertAutomationMutation = {
9955
10016
  name: string;
9956
10017
  description: string | null;
9957
10018
  enabled: boolean;
9958
- functionName: string;
10019
+ actionKind: string;
10020
+ functionName: string | null;
10021
+ computeModuleName: string | null;
10022
+ computeExport: string | null;
9959
10023
  targetMode: string;
9960
10024
  selfContainerId: string | null;
9961
10025
  targetTypeName: string | null;
@@ -10004,7 +10068,10 @@ export type GameModelSetAutomationEnabledMutation = {
10004
10068
  name: string;
10005
10069
  description: string | null;
10006
10070
  enabled: boolean;
10007
- functionName: string;
10071
+ actionKind: string;
10072
+ functionName: string | null;
10073
+ computeModuleName: string | null;
10074
+ computeExport: string | null;
10008
10075
  targetMode: string;
10009
10076
  selfContainerId: string | null;
10010
10077
  targetTypeName: string | null;
@@ -10113,7 +10180,10 @@ export type GameModelAutomationsQuery = {
10113
10180
  name: string;
10114
10181
  description: string | null;
10115
10182
  enabled: boolean;
10116
- functionName: string;
10183
+ actionKind: string;
10184
+ functionName: string | null;
10185
+ computeModuleName: string | null;
10186
+ computeExport: string | null;
10117
10187
  targetMode: string;
10118
10188
  selfContainerId: string | null;
10119
10189
  targetTypeName: string | null;
@@ -10153,7 +10223,10 @@ export type GameModelAutomationQuery = {
10153
10223
  name: string;
10154
10224
  description: string | null;
10155
10225
  enabled: boolean;
10156
- functionName: string;
10226
+ actionKind: string;
10227
+ functionName: string | null;
10228
+ computeModuleName: string | null;
10229
+ computeExport: string | null;
10157
10230
  targetMode: string;
10158
10231
  selfContainerId: string | null;
10159
10232
  targetTypeName: string | null;
@@ -10490,6 +10563,9 @@ export type GameModelContainersQueryVariables = Exact<{
10490
10563
  appId: Scalars['BigInt']['input'];
10491
10564
  typeName?: InputMaybe<Scalars['String']['input']>;
10492
10565
  sessionId?: InputMaybe<Scalars['String']['input']>;
10566
+ where?: InputMaybe<Array<GmPropertyPredicateInput> | GmPropertyPredicateInput>;
10567
+ limit?: InputMaybe<Scalars['Int']['input']>;
10568
+ offset?: InputMaybe<Scalars['Int']['input']>;
10493
10569
  }>;
10494
10570
  export type GameModelContainersQuery = {
10495
10571
  __typename?: 'Query';
@@ -10505,6 +10581,25 @@ export type GameModelContainersQuery = {
10505
10581
  metadataJson: string;
10506
10582
  }>;
10507
10583
  };
10584
+ export type GameModelContainerChangedSubscriptionVariables = Exact<{
10585
+ appId: Scalars['BigInt']['input'];
10586
+ typeName?: InputMaybe<Scalars['String']['input']>;
10587
+ sessionId?: InputMaybe<Scalars['String']['input']>;
10588
+ }>;
10589
+ export type GameModelContainerChangedSubscription = {
10590
+ __typename?: 'Subscription';
10591
+ gameModelContainerChanged: {
10592
+ __typename?: 'GmContainerChange';
10593
+ appId: string;
10594
+ containerId: string;
10595
+ typeName: string | null;
10596
+ sessionId: string | null;
10597
+ source: string;
10598
+ functionName: string | null;
10599
+ changedKeys: Array<string>;
10600
+ occurredAt: string;
10601
+ };
10602
+ };
10508
10603
  export type GameModelContainerStateQueryVariables = Exact<{
10509
10604
  appId: Scalars['BigInt']['input'];
10510
10605
  containerId: Scalars['String']['input'];
@@ -13478,6 +13573,7 @@ export declare const GameModelDeleteEdgeDocument: DocumentNode<GameModelDeleteEd
13478
13573
  export declare const GameModelInvokeDocument: DocumentNode<GameModelInvokeMutation, GameModelInvokeMutationVariables>;
13479
13574
  export declare const GameModelContainerDocument: DocumentNode<GameModelContainerQuery, GameModelContainerQueryVariables>;
13480
13575
  export declare const GameModelContainersDocument: DocumentNode<GameModelContainersQuery, GameModelContainersQueryVariables>;
13576
+ export declare const GameModelContainerChangedDocument: DocumentNode<GameModelContainerChangedSubscription, GameModelContainerChangedSubscriptionVariables>;
13481
13577
  export declare const GameModelContainerStateDocument: DocumentNode<GameModelContainerStateQuery, GameModelContainerStateQueryVariables>;
13482
13578
  export declare const GameModelTraverseDocument: DocumentNode<GameModelTraverseQuery, GameModelTraverseQueryVariables>;
13483
13579
  export declare const GameModelSessionDocument: DocumentNode<GameModelSessionQuery, GameModelSessionQueryVariables>;