@crowdedkingdoms/crowdyjs 17.10.0-dev.1 → 17.11.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.
@@ -1,7 +1,7 @@
1
1
  import type { DecoderOptions } from '@msgpack/msgpack';
2
2
  import type { GraphQLClient } from '../client.js';
3
3
  import { CrowdyError } from '../errors.js';
4
- import { type ExecAppStatusFieldsFragment, type ExecInstancesQuery, type ExecLogsQuery, type ExecVersionsQuery } from '../generated/graphql.js';
4
+ import { type ExecAppStatusFieldsFragment, type ExecBuildFieldsFragment, type ExecInstancesQuery, type ExecLogsQuery, type ExecVersionsQuery } from '../generated/graphql.js';
5
5
  /**
6
6
  * ck-exec, the hub-and-spoke execution service (dev-tier preview).
7
7
  *
@@ -181,7 +181,9 @@ export declare class ExecConnection {
181
181
  export interface ExecNodeTypeInput {
182
182
  kind: 'hub' | 'spoke';
183
183
  /** The compiled module (`wasm32-unknown-unknown`, built with `ckx-sdk`). */
184
- wasm: Uint8Array;
184
+ wasm?: Uint8Array;
185
+ /** Instead of `wasm`: a crate of the deploy's `buildId`. */
186
+ crate?: string;
185
187
  /** The type that owns this one; none for the root. */
186
188
  parent?: string;
187
189
  /** Clients may call it through the gateway. */
@@ -196,6 +198,40 @@ export interface ExecDeployOptions {
196
198
  /** The root hub's type name. */
197
199
  root: string;
198
200
  types: Record<string, ExecNodeTypeInput>;
201
+ /** A succeeded {@link ExecAPI.build} of this app whose crates the types may name. */
202
+ buildId?: string;
203
+ }
204
+ /** One crate for {@link ExecAPI.build}: its files by path (`Cargo.toml`, `src/lib.rs`, ...). */
205
+ export interface ExecCrate {
206
+ name: string;
207
+ files: Record<string, string> | ExecSourceFile[];
208
+ }
209
+ export interface ExecSourceFile {
210
+ path: string;
211
+ content: string;
212
+ }
213
+ /** A build: `queued`, `building`, `succeeded` or `failed`, its log, and one module per crate. */
214
+ export type ExecBuild = Omit<ExecBuildFieldsFragment, '__typename' | 'artifacts'> & {
215
+ artifacts: Array<{
216
+ crate: string;
217
+ digest: string;
218
+ sizeBytes: number;
219
+ }>;
220
+ };
221
+ /** A starter crate, with its files ready for {@link ExecAPI.build}. */
222
+ export interface ExecStarter {
223
+ crate: string;
224
+ nodeType: string;
225
+ description: string;
226
+ files: ExecSourceFile[];
227
+ }
228
+ /** The starter packs, and the manifest that deploys them as one app, its types naming their crates. */
229
+ export interface ExecStarterPack {
230
+ manifest: {
231
+ root: string;
232
+ types: Record<string, ExecNodeTypeInput>;
233
+ };
234
+ starters: ExecStarter[];
199
235
  }
200
236
  /** One guest log line (`ctx.log`); `level` is 0 error, 1 warn, 2 info, 3 debug. */
201
237
  export type ExecLogLine = Omit<ExecLogsQuery['execLogs'][number], '__typename'>;
@@ -216,8 +252,9 @@ export interface ExecLogsOptions {
216
252
  limit?: number;
217
253
  }
218
254
  /**
219
- * `client.exec`: connecting players to ck-exec, deploying an app's nodes, and operating
220
- * them (logs, instances, versions, rollback, the kill switch, developer connections).
255
+ * `client.exec`: connecting players to ck-exec, building and deploying an app's nodes (and
256
+ * the starter packs), and operating them (logs, instances, versions, rollback, the kill
257
+ * switch, developer connections).
221
258
  */
222
259
  export declare class ExecAPI {
223
260
  private readonly graphql;
@@ -259,6 +296,28 @@ export declare class ExecAPI {
259
296
  * `manage_compute`.
260
297
  */
261
298
  setEnabled(appId: string, enabled: boolean, nodeType?: string): Promise<ExecAppStatus>;
299
+ /**
300
+ * The starter packs, which replace the compute templates: a world tick (the root hub), a
301
+ * matchmaker, game sessions and an NPC and mob engine. Build them with {@link build} and
302
+ * deploy the build with `manifest`. Requires `manage_compute`.
303
+ */
304
+ starters(appId: string): Promise<ExecStarterPack>;
305
+ /**
306
+ * Builds crates into modules on the platform (`ckx-sdk`, `wasm32-unknown-unknown`), so you
307
+ * need no Rust toolchain. Returns at once with the build queued; wait with
308
+ * {@link waitForBuild}, then {@link deploy} with its `buildId`. Requires `manage_compute`.
309
+ */
310
+ build(appId: string, crates: ExecCrate[]): Promise<ExecBuild>;
311
+ /** A build's status, log and modules, or null. Requires `view_compute_diagnostics`. */
312
+ buildStatus(appId: string, buildId: string): Promise<ExecBuild | null>;
313
+ /**
314
+ * Polls a build until it succeeds or fails, and returns it either way; a failed build's
315
+ * `log` says why. Throws when it is not done in `timeoutMs` (default 10 minutes).
316
+ */
317
+ waitForBuild(appId: string, buildId: string, options?: {
318
+ intervalMs?: number;
319
+ timeoutMs?: number;
320
+ }): Promise<ExecBuild>;
262
321
  /** A host for this player and its connect token (valid for about a minute). */
263
322
  endpoint(appId: string, options?: {
264
323
  nodeType?: string;
@@ -274,8 +333,9 @@ export declare class ExecAPI {
274
333
  connect(appId: string, options?: ExecConnectOptions): Promise<ExecConnection>;
275
334
  /**
276
335
  * Deploys a new version of the app's nodes and makes it active: the manifest, and
277
- * each distinct module once. Running instances pick it up when they next start.
278
- * Requires the org `manage_compute` permission.
336
+ * each distinct module once. A type gives its module as `wasm`, or names a `crate` of
337
+ * `buildId`, whose modules the platform already holds. Running instances pick it up
338
+ * when they next start. Requires the org `manage_compute` permission.
279
339
  */
280
340
  deploy(options: ExecDeployOptions): Promise<{
281
341
  version: number;
@@ -1 +1 @@
1
- {"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../src/domains/exec.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAGL,KAAK,2BAA2B,EAOhC,KAAK,kBAAkB,EAEvB,KAAK,aAAa,EAGlB,KAAK,iBAAiB,EACvB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;;;;;GAkBG;AAEH,oFAAoF;AACpF,eAAO,MAAM,aAAa,2JAahB,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,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,6 +1,6 @@
1
1
  import { decode, encode } from '@msgpack/msgpack';
2
2
  import { CrowdyError } from '../errors.js';
3
- import { ExecActivateVersionDocument, ExecAppStatusDocument, ExecConnectAsDeveloperDocument, ExecConnectDocument, ExecDeployDocument, ExecInstancesDocument, ExecLogsDocument, ExecSetEnabledDocument, ExecVersionsDocument, } from '../generated/graphql.js';
3
+ import { ExecActivateVersionDocument, ExecAppStatusDocument, ExecBuildDocument, ExecBuildStatusDocument, ExecConnectAsDeveloperDocument, ExecConnectDocument, ExecDeployDocument, ExecInstancesDocument, ExecLogsDocument, ExecSetEnabledDocument, ExecStartersDocument, ExecVersionsDocument, } from '../generated/graphql.js';
4
4
  /**
5
5
  * ck-exec, the hub-and-spoke execution service (dev-tier preview).
6
6
  *
@@ -516,9 +516,14 @@ function strip(v) {
516
516
  const { __typename: _, ...rest } = v;
517
517
  return rest;
518
518
  }
519
+ function build(b) {
520
+ const { __typename: _, artifacts, ...rest } = b;
521
+ return { ...rest, artifacts: artifacts.map(strip) };
522
+ }
519
523
  /**
520
- * `client.exec`: connecting players to ck-exec, deploying an app's nodes, and operating
521
- * them (logs, instances, versions, rollback, the kill switch, developer connections).
524
+ * `client.exec`: connecting players to ck-exec, building and deploying an app's nodes (and
525
+ * the starter packs), and operating them (logs, instances, versions, rollback, the kill
526
+ * switch, developer connections).
522
527
  */
523
528
  export class ExecAPI {
524
529
  constructor(graphql) {
@@ -585,6 +590,64 @@ export class ExecAPI {
585
590
  const data = await this.graphql.request(ExecSetEnabledDocument, { appId, enabled, nodeType });
586
591
  return strip(data.execSetEnabled);
587
592
  }
593
+ /**
594
+ * The starter packs, which replace the compute templates: a world tick (the root hub), a
595
+ * matchmaker, game sessions and an NPC and mob engine. Build them with {@link build} and
596
+ * deploy the build with `manifest`. Requires `manage_compute`.
597
+ */
598
+ async starters(appId) {
599
+ const data = await this.graphql.request(ExecStartersDocument, { appId });
600
+ return {
601
+ manifest: JSON.parse(data.execStarters.manifestJson),
602
+ starters: data.execStarters.starters.map((s) => ({
603
+ crate: s.crate,
604
+ nodeType: s.nodeType,
605
+ description: s.description,
606
+ files: s.files.map(strip),
607
+ })),
608
+ };
609
+ }
610
+ /**
611
+ * Builds crates into modules on the platform (`ckx-sdk`, `wasm32-unknown-unknown`), so you
612
+ * need no Rust toolchain. Returns at once with the build queued; wait with
613
+ * {@link waitForBuild}, then {@link deploy} with its `buildId`. Requires `manage_compute`.
614
+ */
615
+ async build(appId, crates) {
616
+ const data = await this.graphql.request(ExecBuildDocument, {
617
+ input: {
618
+ appId,
619
+ crates: crates.map((c) => ({
620
+ name: c.name,
621
+ files: Array.isArray(c.files)
622
+ ? c.files
623
+ : Object.entries(c.files).map(([path, content]) => ({ path, content })),
624
+ })),
625
+ },
626
+ });
627
+ return build(data.execBuild);
628
+ }
629
+ /** A build's status, log and modules, or null. Requires `view_compute_diagnostics`. */
630
+ async buildStatus(appId, buildId) {
631
+ const data = await this.graphql.request(ExecBuildStatusDocument, { appId, buildId });
632
+ return data.execBuildStatus ? build(data.execBuildStatus) : null;
633
+ }
634
+ /**
635
+ * Polls a build until it succeeds or fails, and returns it either way; a failed build's
636
+ * `log` says why. Throws when it is not done in `timeoutMs` (default 10 minutes).
637
+ */
638
+ async waitForBuild(appId, buildId, options = {}) {
639
+ const until = Date.now() + (options.timeoutMs ?? 600000);
640
+ for (;;) {
641
+ const b = await this.buildStatus(appId, buildId);
642
+ if (!b)
643
+ throw new CrowdyError({ message: `no build ${buildId} in app ${appId}` });
644
+ if (b.status === 'succeeded' || b.status === 'failed')
645
+ return b;
646
+ if (Date.now() > until)
647
+ throw new CrowdyError({ message: `build ${buildId} is still ${b.status}` });
648
+ await new Promise((r) => setTimeout(r, options.intervalMs ?? 2000));
649
+ }
650
+ }
588
651
  /** A host for this player and its connect token (valid for about a minute). */
589
652
  async endpoint(appId, options = {}) {
590
653
  const data = await this.graphql.request(ExecConnectDocument, {
@@ -606,14 +669,22 @@ export class ExecAPI {
606
669
  }
607
670
  /**
608
671
  * Deploys a new version of the app's nodes and makes it active: the manifest, and
609
- * each distinct module once. Running instances pick it up when they next start.
610
- * Requires the org `manage_compute` permission.
672
+ * each distinct module once. A type gives its module as `wasm`, or names a `crate` of
673
+ * `buildId`, whose modules the platform already holds. Running instances pick it up
674
+ * when they next start. Requires the org `manage_compute` permission.
611
675
  */
612
676
  async deploy(options) {
613
677
  const types = {};
614
678
  const artifacts = new Map();
615
679
  for (const [name, t] of Object.entries(options.types)) {
616
680
  const { wasm, ...spec } = t;
681
+ if (!wasm) {
682
+ if (!spec.crate || !options.buildId) {
683
+ throw new CrowdyError({ message: `type '${name}' needs its wasm, or a crate of the deploy's buildId` });
684
+ }
685
+ types[name] = spec;
686
+ continue;
687
+ }
617
688
  const digest = await sha256Hex(wasm);
618
689
  if (!artifacts.has(digest))
619
690
  artifacts.set(digest, base64(wasm));
@@ -624,6 +695,7 @@ export class ExecAPI {
624
695
  appId: options.appId,
625
696
  manifestJson: JSON.stringify({ root: options.root, types }),
626
697
  artifacts: [...artifacts].map(([digest, wasmBase64]) => ({ digest, wasmBase64 })),
698
+ buildId: options.buildId,
627
699
  },
628
700
  });
629
701
  return data.execDeploy;
@@ -3638,6 +3638,55 @@ export type ExecArtifactInput = {
3638
3638
  /** The WASM module (wasm32-unknown-unknown, built with ckx-sdk), base64. */
3639
3639
  wasmBase64: Scalars['String']['input'];
3640
3640
  };
3641
+ /** A ck-exec build (dev-tier preview): queued, building, succeeded or failed, with the compiler’s log and, once it succeeds, one module per crate. */
3642
+ export type ExecBuild = {
3643
+ __typename?: 'ExecBuild';
3644
+ /** The modules built so far, one per crate. */
3645
+ artifacts: Array<ExecBuildArtifact>;
3646
+ /** The build’s id, for `execBuildStatus` and `execDeploy`. */
3647
+ buildId: Scalars['String']['output'];
3648
+ /** When the build was requested. */
3649
+ createdAt: Scalars['DateTime']['output'];
3650
+ /** When it finished. */
3651
+ finishedAt: Maybe<Scalars['DateTime']['output']>;
3652
+ /** The compiler’s output once the build finishes, at most 64 KB (the end is kept). */
3653
+ log: Maybe<Scalars['String']['output']>;
3654
+ /** When it started compiling. */
3655
+ startedAt: Maybe<Scalars['DateTime']['output']>;
3656
+ /** `queued`, `building`, `succeeded` or `failed`. */
3657
+ status: Scalars['String']['output'];
3658
+ };
3659
+ /** One module a ck-exec build produced. */
3660
+ export type ExecBuildArtifact = {
3661
+ __typename?: 'ExecBuildArtifact';
3662
+ /** The crate it was built from. */
3663
+ crate: Scalars['String']['output'];
3664
+ /** SHA-256 of the WASM: the `digest` a manifest names it by. */
3665
+ digest: Scalars['String']['output'];
3666
+ /** The module’s size in bytes. */
3667
+ sizeBytes: Scalars['Int']['output'];
3668
+ };
3669
+ /** One crate of a ck-exec build: a `ckx-sdk` library with `[lib] crate-type = ["cdylib"]`, built into one module. */
3670
+ export type ExecBuildCrateInput = {
3671
+ /** Its files, at most 64. `Cargo.toml` may have only [package], [lib] and [dependencies] from `ckx-sdk`, `serde` and `serde_json`. */
3672
+ files: Array<ExecBuildFileInput>;
3673
+ /** The crate’s name: lowercase letters, digits, `-` or `_`, at most 64 characters. The build reports each module under it. */
3674
+ name: Scalars['String']['input'];
3675
+ };
3676
+ /** One source file of a ck-exec crate. */
3677
+ export type ExecBuildFileInput = {
3678
+ /** The file’s contents, UTF-8. */
3679
+ content: Scalars['String']['input'];
3680
+ /** The path within the crate: `Cargo.toml`, `README.md`, or a `.rs` file under `src/`. */
3681
+ path: Scalars['String']['input'];
3682
+ };
3683
+ /** Sources to build into ck-exec modules. */
3684
+ export type ExecBuildInput = {
3685
+ /** The app to build for. */
3686
+ appId: Scalars['BigInt']['input'];
3687
+ /** The crates, at most 16, 2 MB of source in all; each becomes one module. */
3688
+ crates: Array<ExecBuildCrateInput>;
3689
+ };
3641
3690
  /** Where and how a game client connects to ck-exec, the hub-and-spoke execution service (dev-tier preview). Open a WebSocket to `{gatewayUrl}/v1/connect?token={token}` before `expiresAt`. */
3642
3691
  export type ExecConnection = {
3643
3692
  __typename?: 'ExecConnection';
@@ -3656,7 +3705,9 @@ export type ExecDeployInput = {
3656
3705
  appId: Scalars['BigInt']['input'];
3657
3706
  /** Modules the manifest names that this app has not uploaded before (at most 64). A request body is limited to 10 MB, so about 7 MB of modules per call. */
3658
3707
  artifacts?: InputMaybe<Array<ExecArtifactInput>>;
3659
- /** The manifest as JSON: `{ "root": "<hub type>", "types": { "<name>": { "kind": "hub"|"spoke", "parent", "digest", "client", "calls", "scopes", ... } } }`. Every field and its platform bounds: https://docs.dev.crowdedkingdoms.com/exec/intro#the-manifest. */
3708
+ /** A succeeded `execBuild` of this app whose modules to include, so a manifest can name them by digest without uploading them. */
3709
+ buildId?: InputMaybe<Scalars['String']['input']>;
3710
+ /** The manifest as JSON: `{ "root": "<hub type>", "types": { "<name>": { "kind": "hub"|"spoke", "parent", "digest", "client", "calls", "scopes", ... } } }`; with `buildId`, a type may give `"crate": "<name>"` instead of `digest`. Every field and its platform bounds: https://docs.dev.crowdedkingdoms.com/exec/intro#the-manifest. */
3660
3711
  manifestJson: Scalars['String']['input'];
3661
3712
  };
3662
3713
  /** The result of a ck-exec deploy. */
@@ -3704,6 +3755,34 @@ export type ExecLogLine = {
3704
3755
  /** The line, at most 1 KiB. */
3705
3756
  text: Scalars['String']['output'];
3706
3757
  };
3758
+ /** A starter crate: a ckx-sdk hub to build with `execBuild` as it is, or to change first. */
3759
+ export type ExecStarter = {
3760
+ __typename?: 'ExecStarter';
3761
+ /** The crate’s name, which the pack’s manifest names it by. */
3762
+ crate: Scalars['String']['output'];
3763
+ /** What it does. */
3764
+ description: Scalars['String']['output'];
3765
+ /** Its Cargo.toml and sources. */
3766
+ files: Array<ExecStarterFile>;
3767
+ /** The node type the pack’s manifest deploys it as. */
3768
+ nodeType: Scalars['String']['output'];
3769
+ };
3770
+ /** One source file of a starter crate. */
3771
+ export type ExecStarterFile = {
3772
+ __typename?: 'ExecStarterFile';
3773
+ /** The file’s contents. */
3774
+ content: Scalars['String']['output'];
3775
+ /** The path within the crate, as `execBuild` takes it. */
3776
+ path: Scalars['String']['output'];
3777
+ };
3778
+ /** The starter packs (dev-tier preview): four crates and a manifest that deploys them as one app. */
3779
+ export type ExecStarterPack = {
3780
+ __typename?: 'ExecStarterPack';
3781
+ /** The manifest for `execDeploy` with the build’s id: the root `world` hub, and `matchmaker`, `session` and `npcs` under it, each naming its crate. */
3782
+ manifestJson: Scalars['String']['output'];
3783
+ /** The crates. */
3784
+ starters: Array<ExecStarter>;
3785
+ };
3707
3786
  /** A deployed version of an app’s ck-exec topology. */
3708
3787
  export type ExecVersion = {
3709
3788
  __typename?: 'ExecVersion';
@@ -5589,6 +5668,8 @@ export type Mutation = {
5589
5668
  exchangePortalCode: AppTokenResponse;
5590
5669
  /** Make an earlier ck-exec version active again, a rollback (dev-tier preview). Running instances pick it up when they next start, as after a deploy. Requires the org 'manage_compute' permission. */
5591
5670
  execActivateVersion: ExecAppStatus;
5671
+ /** Build ck-exec modules from Rust source (dev-tier preview): each crate is compiled with the platform's pinned toolchain and `ckx-sdk`, for wasm32-unknown-unknown, and checked against the guest ABI. Returns at once with the build queued; poll `execBuildStatus`, then pass its id to `execDeploy`. Requires the org 'manage_compute' permission. */
5672
+ execBuild: ExecBuild;
5592
5673
  /** Connect a player to ck-exec (dev-tier preview): the execution manager picks a host (the one running `nodeType`/`key` when given, placing it if needed) and this returns its gateway and a 60-second connect token bound to this player, this app and that host. Requires the app-scoped token of the app named. */
5593
5674
  execConnect: ExecConnection;
5594
5675
  /** Connect to an app's ck-exec code as one of its developers, for studio tools, manual runs and admin endpoints (dev-tier preview). The session's calls arrive as `Caller::Developer` with your user id and may reach any node type, not only `client` ones, but never the platform's `$` methods. Requires the org 'manage_compute' permission and your own session, not an app token. */
@@ -6212,6 +6293,9 @@ export type MutationExecActivateVersionArgs = {
6212
6293
  appId: Scalars['BigInt']['input'];
6213
6294
  version: Scalars['Int']['input'];
6214
6295
  };
6296
+ export type MutationExecBuildArgs = {
6297
+ input: ExecBuildInput;
6298
+ };
6215
6299
  export type MutationExecConnectArgs = {
6216
6300
  appId: Scalars['BigInt']['input'];
6217
6301
  key?: InputMaybe<Scalars['String']['input']>;
@@ -8208,10 +8292,14 @@ export type Query = {
8208
8292
  emailDeliveryConfig: EmailDeliveryConfig;
8209
8293
  /** Whether an app's ck-exec code may run: its active version, kill switches and budget pause (dev-tier preview). Requires the org 'view_compute_diagnostics' permission. */
8210
8294
  execAppStatus: ExecAppStatus;
8295
+ /** A ck-exec build's status, compiler log and modules (dev-tier preview); null when this app has no such build. Builds are kept for 7 days. Requires the org 'view_compute_diagnostics' permission. */
8296
+ execBuildStatus: Maybe<ExecBuild>;
8211
8297
  /** What the execution manager has placed for an app: every instance, its phase and host (dev-tier preview). Requires the org 'view_compute_diagnostics' permission. */
8212
8298
  execInstances: Array<ExecInstance>;
8213
8299
  /** Guest log lines from an app's ck-exec instances (`ctx.log`), newest first, kept for 24 hours (dev-tier preview). Requires the org 'view_compute_diagnostics' permission. */
8214
8300
  execLogs: Array<ExecLogLine>;
8301
+ /** The starter packs (dev-tier preview), which replace the compute templates: a world tick (the root hub: clock, weather, resource nodes, liveops events), a matchmaker, game sessions (lobby, host, turns, scores) and an NPC and mob engine, as ckx-sdk crates to pass to `execBuild` and a manifest for `execDeploy`. Requires the org 'manage_compute' permission. */
8302
+ execStarters: ExecStarterPack;
8215
8303
  /** An app's deployed ck-exec versions, newest first, and which is active (dev-tier preview). Requires the org 'view_compute_diagnostics' permission. */
8216
8304
  execVersions: Array<ExecVersion>;
8217
8305
  /** Reports whether a free-play window is active now, a human-readable schedule description, and the ISO-8601 start of the next window. PUBLIC: no authentication required. Takes no arguments; computed from server config and the current clock. */
@@ -8791,6 +8879,10 @@ export type QueryEmailDeliverabilityArgs = {
8791
8879
  export type QueryExecAppStatusArgs = {
8792
8880
  appId: Scalars['BigInt']['input'];
8793
8881
  };
8882
+ export type QueryExecBuildStatusArgs = {
8883
+ appId: Scalars['BigInt']['input'];
8884
+ buildId: Scalars['String']['input'];
8885
+ };
8794
8886
  export type QueryExecInstancesArgs = {
8795
8887
  appId: Scalars['BigInt']['input'];
8796
8888
  };
@@ -8802,6 +8894,9 @@ export type QueryExecLogsArgs = {
8802
8894
  maxLevel?: InputMaybe<Scalars['Int']['input']>;
8803
8895
  nodeType?: InputMaybe<Scalars['String']['input']>;
8804
8896
  };
8897
+ export type QueryExecStartersArgs = {
8898
+ appId: Scalars['BigInt']['input'];
8899
+ };
8805
8900
  export type QueryExecVersionsArgs = {
8806
8901
  appId: Scalars['BigInt']['input'];
8807
8902
  };
@@ -14200,6 +14295,85 @@ export type ExecSetEnabledMutation = {
14200
14295
  budgetPaused: boolean;
14201
14296
  };
14202
14297
  };
14298
+ export type ExecStartersQueryVariables = Exact<{
14299
+ appId: Scalars['BigInt']['input'];
14300
+ }>;
14301
+ export type ExecStartersQuery = {
14302
+ __typename?: 'Query';
14303
+ execStarters: {
14304
+ __typename?: 'ExecStarterPack';
14305
+ manifestJson: string;
14306
+ starters: Array<{
14307
+ __typename?: 'ExecStarter';
14308
+ crate: string;
14309
+ nodeType: string;
14310
+ description: string;
14311
+ files: Array<{
14312
+ __typename?: 'ExecStarterFile';
14313
+ path: string;
14314
+ content: string;
14315
+ }>;
14316
+ }>;
14317
+ };
14318
+ };
14319
+ export type ExecBuildFieldsFragment = {
14320
+ __typename?: 'ExecBuild';
14321
+ buildId: string;
14322
+ status: string;
14323
+ log: string | null;
14324
+ createdAt: string;
14325
+ startedAt: string | null;
14326
+ finishedAt: string | null;
14327
+ artifacts: Array<{
14328
+ __typename?: 'ExecBuildArtifact';
14329
+ crate: string;
14330
+ digest: string;
14331
+ sizeBytes: number;
14332
+ }>;
14333
+ };
14334
+ export type ExecBuildMutationVariables = Exact<{
14335
+ input: ExecBuildInput;
14336
+ }>;
14337
+ export type ExecBuildMutation = {
14338
+ __typename?: 'Mutation';
14339
+ execBuild: {
14340
+ __typename?: 'ExecBuild';
14341
+ buildId: string;
14342
+ status: string;
14343
+ log: string | null;
14344
+ createdAt: string;
14345
+ startedAt: string | null;
14346
+ finishedAt: string | null;
14347
+ artifacts: Array<{
14348
+ __typename?: 'ExecBuildArtifact';
14349
+ crate: string;
14350
+ digest: string;
14351
+ sizeBytes: number;
14352
+ }>;
14353
+ };
14354
+ };
14355
+ export type ExecBuildStatusQueryVariables = Exact<{
14356
+ appId: Scalars['BigInt']['input'];
14357
+ buildId: Scalars['String']['input'];
14358
+ }>;
14359
+ export type ExecBuildStatusQuery = {
14360
+ __typename?: 'Query';
14361
+ execBuildStatus: {
14362
+ __typename?: 'ExecBuild';
14363
+ buildId: string;
14364
+ status: string;
14365
+ log: string | null;
14366
+ createdAt: string;
14367
+ startedAt: string | null;
14368
+ finishedAt: string | null;
14369
+ artifacts: Array<{
14370
+ __typename?: 'ExecBuildArtifact';
14371
+ crate: string;
14372
+ digest: string;
14373
+ sizeBytes: number;
14374
+ }>;
14375
+ } | null;
14376
+ };
14203
14377
  export type GridOwnershipFieldsFragment = {
14204
14378
  __typename?: 'GridOwnership';
14205
14379
  gridOwnershipId: string;
@@ -20357,6 +20531,7 @@ export declare const ComputePolicyFieldsFragmentDoc: DocumentNode<ComputePolicyF
20357
20531
  export declare const ComputeRunFieldsFragmentDoc: DocumentNode<ComputeRunFieldsFragment, unknown>;
20358
20532
  export declare const CrowdyStudioProjectFieldsFragmentDoc: DocumentNode<CrowdyStudioProjectFieldsFragment, unknown>;
20359
20533
  export declare const ExecAppStatusFieldsFragmentDoc: DocumentNode<ExecAppStatusFieldsFragment, unknown>;
20534
+ export declare const ExecBuildFieldsFragmentDoc: DocumentNode<ExecBuildFieldsFragment, unknown>;
20360
20535
  export declare const GridOwnershipFieldsFragmentDoc: DocumentNode<GridOwnershipFieldsFragment, unknown>;
20361
20536
  export declare const GmAutomationFieldsFragmentDoc: DocumentNode<GmAutomationFieldsFragment, unknown>;
20362
20537
  export declare const GmAutomationTriggerFieldsFragmentDoc: DocumentNode<GmAutomationTriggerFieldsFragment, unknown>;
@@ -20507,6 +20682,9 @@ export declare const ExecVersionsDocument: DocumentNode<ExecVersionsQuery, ExecV
20507
20682
  export declare const ExecAppStatusDocument: DocumentNode<ExecAppStatusQuery, ExecAppStatusQueryVariables>;
20508
20683
  export declare const ExecActivateVersionDocument: DocumentNode<ExecActivateVersionMutation, ExecActivateVersionMutationVariables>;
20509
20684
  export declare const ExecSetEnabledDocument: DocumentNode<ExecSetEnabledMutation, ExecSetEnabledMutationVariables>;
20685
+ export declare const ExecStartersDocument: DocumentNode<ExecStartersQuery, ExecStartersQueryVariables>;
20686
+ export declare const ExecBuildDocument: DocumentNode<ExecBuildMutation, ExecBuildMutationVariables>;
20687
+ export declare const ExecBuildStatusDocument: DocumentNode<ExecBuildStatusQuery, ExecBuildStatusQueryVariables>;
20510
20688
  export declare const GridOwnershipDocument: DocumentNode<GridOwnershipQuery, GridOwnershipQueryVariables>;
20511
20689
  export declare const AssignGridOwnershipDocument: DocumentNode<AssignGridOwnershipMutation, AssignGridOwnershipMutationVariables>;
20512
20690
  export declare const TransferGridOwnershipDocument: DocumentNode<TransferGridOwnershipMutation, TransferGridOwnershipMutationVariables>;