@crowdedkingdoms/crowdyjs 8.11.0 → 8.13.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.
@@ -2334,6 +2334,8 @@ export type GmAutomationRun = {
2334
2334
  errorMessage: Maybe<Scalars['String']['output']>;
2335
2335
  /** When the run finished. */
2336
2336
  finishedAt: Maybe<Scalars['DateTime']['output']>;
2337
+ /** Flow correlation id: shared with gm event-log rows and compute module runs triggered by the same entry call (player invoke / automation run / computeInvoke). */
2338
+ flowId: Maybe<Scalars['String']['output']>;
2337
2339
  /** Number of fn: user-function calls across invocations. */
2338
2340
  fnCalls: Scalars['Int']['output'];
2339
2341
  /** Evaluation gas consumed across invocations. */
@@ -2437,6 +2439,26 @@ export type GmContainer = {
2437
2439
  /** The container type name. */
2438
2440
  typeName: Scalars['String']['output'];
2439
2441
  };
2442
+ /** 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. */
2443
+ export type GmContainerChange = {
2444
+ __typename?: 'GmContainerChange';
2445
+ /** The app (tenant). */
2446
+ appId: Scalars['BigInt']['output'];
2447
+ /** The property keys the change touched (empty for created/deleted; clamped to 32 keys). */
2448
+ changedKeys: Array<Scalars['String']['output']>;
2449
+ /** The container that changed. */
2450
+ containerId: Scalars['String']['output'];
2451
+ /** For source='function': the function that mutated it. */
2452
+ functionName: Maybe<Scalars['String']['output']>;
2453
+ /** When the change committed. */
2454
+ occurredAt: Scalars['DateTime']['output'];
2455
+ /** The session scope of the change, when any. */
2456
+ sessionId: Maybe<Scalars['String']['output']>;
2457
+ /** What changed it: 'function' (invoke mutation), 'direct' (gameModelSetProperty), 'created', or 'deleted'. */
2458
+ source: Scalars['String']['output'];
2459
+ /** The container type (null if the type is unknown). */
2460
+ typeName: Maybe<Scalars['String']['output']>;
2461
+ };
2440
2462
  /** A container plus its property values filtered to what the requesting caller is allowed to see. */
2441
2463
  export type GmContainerState = {
2442
2464
  __typename?: 'GmContainerState';
@@ -2502,6 +2524,8 @@ export type GmEvent = {
2502
2524
  eventId: Scalars['String']['output'];
2503
2525
  /** When the invocation executed. */
2504
2526
  executedAt: Scalars['DateTime']['output'];
2527
+ /** Flow correlation id: shared with automation runs and compute module runs caused by the same entry call (player invoke / automation run / computeInvoke), so cross-engine flows can be stitched together. */
2528
+ flowId: Maybe<Scalars['String']['output']>;
2505
2529
  /** The function that was invoked. */
2506
2530
  functionName: Scalars['String']['output'];
2507
2531
  /** JSON array of applied mutations. */
@@ -2527,6 +2551,18 @@ export type GmEventEdge = {
2527
2551
  /** The node at the end of this edge. */
2528
2552
  node: GmEvent;
2529
2553
  };
2554
+ /** The stitched cross-engine timeline for one flow correlation id: every model event, automation run, and compute module run that shares the flow_id minted at the entry edge (player invoke / automation run / computeInvoke). Each array is ordered by time ascending, so the three together read as one causal diagnostics trace (e.g. mob kill -> compute event -> reward grant). */
2555
+ export type GmFlowTimeline = {
2556
+ __typename?: 'GmFlowTimeline';
2557
+ /** Automation (autonomous process) runs in the flow, ordered by startedAt ascending. */
2558
+ automationRuns: Array<GmAutomationRun>;
2559
+ /** Model function-invocation events (gm_event_log rows) in the flow, ordered by executedAt ascending. */
2560
+ events: Array<GmEvent>;
2561
+ /** The flow correlation id (UUID) this timeline was built for. */
2562
+ flowId: Scalars['String']['output'];
2563
+ /** Compute module runs in the flow, ordered by startedAt ascending. */
2564
+ moduleRuns: Array<WasmModuleRun>;
2565
+ };
2530
2566
  /** A studio-defined function: a named, sandboxed behavior over containers (parameters, declared mutations, optional return, and an authority invoke policy). */
2531
2567
  export type GmFunction = {
2532
2568
  __typename?: 'GmFunction';
@@ -4596,6 +4632,8 @@ export type Query = {
4596
4632
  gameModelEventsConnection: GameModelEventsConnection;
4597
4633
  /** List the feature keys defined for an app. Requires app-admin ('manage_apps'). */
4598
4634
  gameModelFeatures: Array<GmAppFeature>;
4635
+ /** Diagnostics surface: stitch one flow correlation id into a single cross-engine timeline — the model events (gm event log), automation runs, and compute module runs that share the flowId minted at the entry edge (player gameModelInvoke / automation run / computeInvoke) and propagated across model_invoke, the event bus, and emit_compute_event. Each array is ordered by time ascending; an unknown flowId returns three empty arrays. Answers "what happened to this kill's reward" in one query instead of three hand-joined ones. Requires app-admin ('manage_apps'). */
4636
+ gameModelFlow: GmFlowTimeline;
4599
4637
  /** Fetch one studio-defined function by name. Requires app-admin ('manage_apps'). */
4600
4638
  gameModelFunction: GmFunction;
4601
4639
  /** List studio-defined functions for an app, optionally filtered to those attached to a container type. Requires app-admin ('manage_apps'). */
@@ -5057,6 +5095,10 @@ export type QueryGameModelEventsConnectionArgs = {
5057
5095
  export type QueryGameModelFeaturesArgs = {
5058
5096
  appId: Scalars['BigInt']['input'];
5059
5097
  };
5098
+ export type QueryGameModelFlowArgs = {
5099
+ appId: Scalars['BigInt']['input'];
5100
+ flowId: Scalars['String']['input'];
5101
+ };
5060
5102
  export type QueryGameModelFunctionArgs = {
5061
5103
  appId: Scalars['BigInt']['input'];
5062
5104
  name: Scalars['String']['input'];
@@ -5893,9 +5935,16 @@ export type SocialLoginStartInput = {
5893
5935
  };
5894
5936
  export type Subscription = {
5895
5937
  __typename?: 'Subscription';
5938
+ /** 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. */
5939
+ gameModelContainerChanged: GmContainerChange;
5896
5940
  /** 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. */
5897
5941
  udpNotifications: Maybe<UdpNotification>;
5898
5942
  };
5943
+ export type SubscriptionGameModelContainerChangedArgs = {
5944
+ appId: Scalars['BigInt']['input'];
5945
+ sessionId?: InputMaybe<Scalars['String']['input']>;
5946
+ typeName?: InputMaybe<Scalars['String']['input']>;
5947
+ };
5899
5948
  export type TeleportRequestInput = {
5900
5949
  /** 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. */
5901
5950
  appId: Scalars['BigInt']['input'];
@@ -6276,6 +6325,8 @@ export type UpsertComputeTriggerInput = {
6276
6325
  appId: Scalars['BigInt']['input'];
6277
6326
  /** Event filter: only this container type. */
6278
6327
  containerTypeName?: InputMaybe<Scalars['String']['input']>;
6328
+ /** 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. */
6329
+ contractJson?: InputMaybe<Scalars['String']['input']>;
6279
6330
  /** Debounce/coalesce window in ms for event triggers. */
6280
6331
  debounceMs?: InputMaybe<Scalars['Int']['input']>;
6281
6332
  /** Event filter: only compute events with this name (on_event=compute_event). */
@@ -6886,6 +6937,8 @@ export type WasmModuleRun = {
6886
6937
  entry: Maybe<Scalars['String']['output']>;
6887
6938
  /** Error message when the run failed (trap, fuel, watchdog). */
6888
6939
  errorMessage: Maybe<Scalars['String']['output']>;
6940
+ /** Flow correlation id: shared with gm event-log rows and automation runs caused by the same entry call (computeInvoke / automation run / player invoke); ticks mint their own. */
6941
+ flowId: Maybe<Scalars['String']['output']>;
6889
6942
  /** Fuel consumed by the run. */
6890
6943
  fuelUsed: Scalars['BigInt']['output'];
6891
6944
  /** The module that ran. */
@@ -6908,6 +6961,8 @@ export type WasmModuleTrigger = {
6908
6961
  appId: Scalars['BigInt']['output'];
6909
6962
  /** Event filter: only this container type. */
6910
6963
  containerTypeName: Maybe<Scalars['String']['output']>;
6964
+ /** 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. */
6965
+ contractJson: Maybe<Scalars['String']['output']>;
6911
6966
  /** When the trigger was created. */
6912
6967
  createdAt: Scalars['DateTime']['output'];
6913
6968
  /** Debounce/coalesce window in ms. */
@@ -8558,6 +8613,7 @@ export type ComputeTriggerFieldsFragment = {
8558
8613
  debounceMs: number;
8559
8614
  exportName: string | null;
8560
8615
  invokePolicyJson: string | null;
8616
+ contractJson: string | null;
8561
8617
  createdAt: string;
8562
8618
  };
8563
8619
  export type ComputePolicyFieldsFragment = {
@@ -8580,6 +8636,7 @@ export type ComputeRunFieldsFragment = {
8580
8636
  __typename?: 'WasmModuleRun';
8581
8637
  runId: string;
8582
8638
  appId: string;
8639
+ flowId: string | null;
8583
8640
  moduleId: string;
8584
8641
  moduleName: string;
8585
8642
  triggerSource: string;
@@ -8690,6 +8747,7 @@ export type ComputeUpsertTriggerMutation = {
8690
8747
  debounceMs: number;
8691
8748
  exportName: string | null;
8692
8749
  invokePolicyJson: string | null;
8750
+ contractJson: string | null;
8693
8751
  createdAt: string;
8694
8752
  };
8695
8753
  };
@@ -8828,6 +8886,7 @@ export type ComputeModuleTriggersQuery = {
8828
8886
  debounceMs: number;
8829
8887
  exportName: string | null;
8830
8888
  invokePolicyJson: string | null;
8889
+ contractJson: string | null;
8831
8890
  createdAt: string;
8832
8891
  }>;
8833
8892
  };
@@ -8866,6 +8925,7 @@ export type ComputeModuleRunsQuery = {
8866
8925
  __typename?: 'WasmModuleRun';
8867
8926
  runId: string;
8868
8927
  appId: string;
8928
+ flowId: string | null;
8869
8929
  moduleId: string;
8870
8930
  moduleName: string;
8871
8931
  triggerSource: string;
@@ -9952,6 +10012,7 @@ export type GmAutomationRunFieldsFragment = {
9952
10012
  __typename?: 'GmAutomationRun';
9953
10013
  runId: string;
9954
10014
  appId: string;
10015
+ flowId: string | null;
9955
10016
  automationId: string;
9956
10017
  automationName: string;
9957
10018
  triggerSource: string;
@@ -10115,6 +10176,7 @@ export type GameModelRunAutomationMutation = {
10115
10176
  __typename?: 'GmAutomationRun';
10116
10177
  runId: string;
10117
10178
  appId: string;
10179
+ flowId: string | null;
10118
10180
  automationId: string;
10119
10181
  automationName: string;
10120
10182
  triggerSource: string;
@@ -10266,6 +10328,7 @@ export type GameModelAutomationRunsQuery = {
10266
10328
  __typename?: 'GmAutomationRun';
10267
10329
  runId: string;
10268
10330
  appId: string;
10331
+ flowId: string | null;
10269
10332
  automationId: string;
10270
10333
  automationName: string;
10271
10334
  triggerSource: string;
@@ -10547,6 +10610,25 @@ export type GameModelContainersQuery = {
10547
10610
  metadataJson: string;
10548
10611
  }>;
10549
10612
  };
10613
+ export type GameModelContainerChangedSubscriptionVariables = Exact<{
10614
+ appId: Scalars['BigInt']['input'];
10615
+ typeName?: InputMaybe<Scalars['String']['input']>;
10616
+ sessionId?: InputMaybe<Scalars['String']['input']>;
10617
+ }>;
10618
+ export type GameModelContainerChangedSubscription = {
10619
+ __typename?: 'Subscription';
10620
+ gameModelContainerChanged: {
10621
+ __typename?: 'GmContainerChange';
10622
+ appId: string;
10623
+ containerId: string;
10624
+ typeName: string | null;
10625
+ sessionId: string | null;
10626
+ source: string;
10627
+ functionName: string | null;
10628
+ changedKeys: Array<string>;
10629
+ occurredAt: string;
10630
+ };
10631
+ };
10550
10632
  export type GameModelContainerStateQueryVariables = Exact<{
10551
10633
  appId: Scalars['BigInt']['input'];
10552
10634
  containerId: Scalars['String']['input'];
@@ -10644,6 +10726,7 @@ export type GameModelEventsQuery = {
10644
10726
  gameModelEvents: Array<{
10645
10727
  __typename?: 'GmEvent';
10646
10728
  eventId: string;
10729
+ flowId: string | null;
10647
10730
  sessionId: string | null;
10648
10731
  functionName: string;
10649
10732
  selfContainerId: string | null;
@@ -10679,6 +10762,7 @@ export type GameModelEventsConnectionQuery = {
10679
10762
  node: {
10680
10763
  __typename?: 'GmEvent';
10681
10764
  eventId: string;
10765
+ flowId: string | null;
10682
10766
  sessionId: string | null;
10683
10767
  functionName: string;
10684
10768
  selfContainerId: string | null;
@@ -10703,6 +10787,78 @@ export type GameModelEventsConnectionQuery = {
10703
10787
  };
10704
10788
  };
10705
10789
  };
10790
+ export type GameModelFlowQueryVariables = Exact<{
10791
+ appId: Scalars['BigInt']['input'];
10792
+ flowId: Scalars['String']['input'];
10793
+ }>;
10794
+ export type GameModelFlowQuery = {
10795
+ __typename?: 'Query';
10796
+ gameModelFlow: {
10797
+ __typename?: 'GmFlowTimeline';
10798
+ flowId: string;
10799
+ events: Array<{
10800
+ __typename?: 'GmEvent';
10801
+ eventId: string;
10802
+ flowId: string | null;
10803
+ sessionId: string | null;
10804
+ functionName: string;
10805
+ selfContainerId: string | null;
10806
+ callerUserId: string | null;
10807
+ callerKind: string;
10808
+ automationId: string | null;
10809
+ paramsJson: string;
10810
+ mutationsAppliedJson: string;
10811
+ permissionEffectsAppliedJson: string;
10812
+ returnValueJson: string | null;
10813
+ success: boolean;
10814
+ errorMessage: string | null;
10815
+ executedAt: string;
10816
+ }>;
10817
+ automationRuns: Array<{
10818
+ __typename?: 'GmAutomationRun';
10819
+ runId: string;
10820
+ appId: string;
10821
+ flowId: string | null;
10822
+ automationId: string;
10823
+ automationName: string;
10824
+ triggerSource: string;
10825
+ parentRunId: string | null;
10826
+ cascadeDepth: number;
10827
+ startedAt: string;
10828
+ finishedAt: string | null;
10829
+ durationUs: number;
10830
+ targets: number;
10831
+ invocations: number;
10832
+ mutations: number;
10833
+ fnCalls: number;
10834
+ gasUsed: number;
10835
+ success: boolean;
10836
+ errorMessage: string | null;
10837
+ circuitAction: string | null;
10838
+ computeUnits: number;
10839
+ }>;
10840
+ moduleRuns: Array<{
10841
+ __typename?: 'WasmModuleRun';
10842
+ runId: string;
10843
+ appId: string;
10844
+ flowId: string | null;
10845
+ moduleId: string;
10846
+ moduleName: string;
10847
+ triggerSource: string;
10848
+ entry: string | null;
10849
+ startedAt: string;
10850
+ durationUs: number;
10851
+ fuelUsed: string;
10852
+ dbReads: number;
10853
+ dbWrites: number;
10854
+ egressMsgs: number;
10855
+ egressBytes: string;
10856
+ success: boolean;
10857
+ errorMessage: string | null;
10858
+ circuitAction: string | null;
10859
+ }>;
10860
+ };
10861
+ };
10706
10862
  export type GmFunctionFieldsFragment = {
10707
10863
  __typename?: 'GmFunction';
10708
10864
  functionId: string;
@@ -13520,12 +13676,14 @@ export declare const GameModelDeleteEdgeDocument: DocumentNode<GameModelDeleteEd
13520
13676
  export declare const GameModelInvokeDocument: DocumentNode<GameModelInvokeMutation, GameModelInvokeMutationVariables>;
13521
13677
  export declare const GameModelContainerDocument: DocumentNode<GameModelContainerQuery, GameModelContainerQueryVariables>;
13522
13678
  export declare const GameModelContainersDocument: DocumentNode<GameModelContainersQuery, GameModelContainersQueryVariables>;
13679
+ export declare const GameModelContainerChangedDocument: DocumentNode<GameModelContainerChangedSubscription, GameModelContainerChangedSubscriptionVariables>;
13523
13680
  export declare const GameModelContainerStateDocument: DocumentNode<GameModelContainerStateQuery, GameModelContainerStateQueryVariables>;
13524
13681
  export declare const GameModelTraverseDocument: DocumentNode<GameModelTraverseQuery, GameModelTraverseQueryVariables>;
13525
13682
  export declare const GameModelSessionDocument: DocumentNode<GameModelSessionQuery, GameModelSessionQueryVariables>;
13526
13683
  export declare const GameModelSessionsDocument: DocumentNode<GameModelSessionsQuery, GameModelSessionsQueryVariables>;
13527
13684
  export declare const GameModelEventsDocument: DocumentNode<GameModelEventsQuery, GameModelEventsQueryVariables>;
13528
13685
  export declare const GameModelEventsConnectionDocument: DocumentNode<GameModelEventsConnectionQuery, GameModelEventsConnectionQueryVariables>;
13686
+ export declare const GameModelFlowDocument: DocumentNode<GameModelFlowQuery, GameModelFlowQueryVariables>;
13529
13687
  export declare const GameModelSeedDocument: DocumentNode<GameModelSeedMutation, GameModelSeedMutationVariables>;
13530
13688
  export declare const GameModelUpsertContainerTypeDocument: DocumentNode<GameModelUpsertContainerTypeMutation, GameModelUpsertContainerTypeMutationVariables>;
13531
13689
  export declare const GameModelUpsertPropertyDefDocument: DocumentNode<GameModelUpsertPropertyDefMutation, GameModelUpsertPropertyDefMutationVariables>;