@crowdedkingdoms/crowdyjs 16.0.0 → 16.1.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,6 +1,6 @@
1
1
  /**
2
2
  * GENERATED — do not edit. The operator tooling's
3
- * `sync-client-origins.mjs --write --tier prod` writes this file, and
3
+ * `sync-client-origins.mjs --write --tier dev` writes this file, and
4
4
  * `check-sdk-default-origin.mjs` refuses it when it names the wrong tier or a
5
5
  * host that declaration does not carry. Regenerate; never hand-edit.
6
6
  *
@@ -10,14 +10,14 @@
10
10
  * than no default at all. Every fallback this SDK ever removed named a host that
11
11
  * was already dead. A generated file plus a gate is what makes this one different.
12
12
  *
13
- * Source: the operator's per-tier public CK API origin declaration, tier 'prod'
13
+ * Source: the operator's per-tier public CK API origin declaration, tier 'dev'
14
14
  */
15
15
  /** The tier this build of the SDK is published for. */
16
- export declare const CROWDY_DEFAULT_TIER = "prod";
16
+ export declare const CROWDY_DEFAULT_TIER = "dev";
17
17
  /** The public CK API origin for that tier. */
18
- export declare const CROWDY_DEFAULT_HTTP_ORIGIN = "https://ck.prod.crowdedkingdoms.com";
18
+ export declare const CROWDY_DEFAULT_HTTP_ORIGIN = "https://ck.dev.crowdedkingdoms.com";
19
19
  /** The same host over WebSocket. A scheme is composed; a hostname is looked up. */
20
- export declare const CROWDY_DEFAULT_WS_ORIGIN = "wss://ck.prod.crowdedkingdoms.com";
20
+ export declare const CROWDY_DEFAULT_WS_ORIGIN = "wss://ck.dev.crowdedkingdoms.com";
21
21
  /** The bare hostname, for callers that need to compare rather than dial. */
22
- export declare const CROWDY_DEFAULT_HOST = "ck.prod.crowdedkingdoms.com";
22
+ export declare const CROWDY_DEFAULT_HOST = "ck.dev.crowdedkingdoms.com";
23
23
  //# sourceMappingURL=default-origin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"default-origin.d.ts","sourceRoot":"","sources":["../src/default-origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,SAAS,CAAC;AAE1C,8CAA8C;AAC9C,eAAO,MAAM,0BAA0B,wCAAwC,CAAC;AAEhF,mFAAmF;AACnF,eAAO,MAAM,wBAAwB,sCAAsC,CAAC;AAE5E,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,gCAAgC,CAAC"}
1
+ {"version":3,"file":"default-origin.d.ts","sourceRoot":"","sources":["../src/default-origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,QAAQ,CAAC;AAEzC,8CAA8C;AAC9C,eAAO,MAAM,0BAA0B,uCAAuC,CAAC;AAE/E,mFAAmF;AACnF,eAAO,MAAM,wBAAwB,qCAAqC,CAAC;AAE3E,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,+BAA+B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * GENERATED — do not edit. The operator tooling's
3
- * `sync-client-origins.mjs --write --tier prod` writes this file, and
3
+ * `sync-client-origins.mjs --write --tier dev` writes this file, and
4
4
  * `check-sdk-default-origin.mjs` refuses it when it names the wrong tier or a
5
5
  * host that declaration does not carry. Regenerate; never hand-edit.
6
6
  *
@@ -10,13 +10,13 @@
10
10
  * than no default at all. Every fallback this SDK ever removed named a host that
11
11
  * was already dead. A generated file plus a gate is what makes this one different.
12
12
  *
13
- * Source: the operator's per-tier public CK API origin declaration, tier 'prod'
13
+ * Source: the operator's per-tier public CK API origin declaration, tier 'dev'
14
14
  */
15
15
  /** The tier this build of the SDK is published for. */
16
- export const CROWDY_DEFAULT_TIER = 'prod';
16
+ export const CROWDY_DEFAULT_TIER = 'dev';
17
17
  /** The public CK API origin for that tier. */
18
- export const CROWDY_DEFAULT_HTTP_ORIGIN = 'https://ck.prod.crowdedkingdoms.com';
18
+ export const CROWDY_DEFAULT_HTTP_ORIGIN = 'https://ck.dev.crowdedkingdoms.com';
19
19
  /** The same host over WebSocket. A scheme is composed; a hostname is looked up. */
20
- export const CROWDY_DEFAULT_WS_ORIGIN = 'wss://ck.prod.crowdedkingdoms.com';
20
+ export const CROWDY_DEFAULT_WS_ORIGIN = 'wss://ck.dev.crowdedkingdoms.com';
21
21
  /** The bare hostname, for callers that need to compare rather than dial. */
22
- export const CROWDY_DEFAULT_HOST = 'ck.prod.crowdedkingdoms.com';
22
+ export const CROWDY_DEFAULT_HOST = 'ck.dev.crowdedkingdoms.com';
@@ -5,9 +5,13 @@ import { type WalletBalanceQuery, type WalletTransactionsQuery, type WalletTrans
5
5
  * `client.admin`).
6
6
  *
7
7
  * Part of the management surface. Reads require the `view_billing` org/app
8
- * permission; {@link setAppBudget} requires `manage_billing`. Monetary values
9
- * are minor currency units (`*Cents`) and serialized as `BigInt` decimal
10
- * strings.
8
+ * permission; {@link setAppBudget} requires `manage_billing`. Wallet money is
9
+ * MICRO-USD (`*Microusd`, 1 USD = 1,000,000) serialized as `BigInt` decimal
10
+ * strings -- the unit of account since the lossless ledger (ck-api 2026-09-11),
11
+ * in which nothing is rounded. The `*Cents` fields remain as deprecated
12
+ * derived values (micro-USD / 10,000, truncated toward zero) and will be
13
+ * removed in a later major. Budget caps (`monthlyLimitCents`) stay in cents:
14
+ * they are limits, not money of record.
11
15
  *
12
16
  * @throws {CrowdyGraphQLError} `UNAUTHENTICATED` / `FORBIDDEN` / `SCOPE_MISSING`
13
17
  * per the permission notes above.
@@ -20,7 +24,9 @@ export declare class BillingAPI {
20
24
  * permission.
21
25
  *
22
26
  * @param orgId - Numeric org id (`BigInt` as a decimal string).
23
- * @returns The wallet balance (cents as a decimal string).
27
+ * @returns The wallet balance: `balanceMicrousd` and `holdsMicrousd`
28
+ * (micro-USD as decimal strings; spendable = balance − holds), plus the
29
+ * deprecated `balanceCents`.
24
30
  */
25
31
  walletBalance(orgId: string): Promise<WalletBalanceQuery['walletBalance']>;
26
32
  /**
@@ -1 +1 @@
1
- {"version":3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@@ import { WalletBalanceDocument, WalletTransactionsDocument, WalletTransactionsCo
4
4
  * `client.admin`).
5
5
  *
6
6
  * Part of the management surface. Reads require the `view_billing` org/app
7
- * permission; {@link setAppBudget} requires `manage_billing`. Monetary values
8
- * are minor currency units (`*Cents`) and serialized as `BigInt` decimal
9
- * strings.
7
+ * permission; {@link setAppBudget} requires `manage_billing`. Wallet money is
8
+ * MICRO-USD (`*Microusd`, 1 USD = 1,000,000) serialized as `BigInt` decimal
9
+ * strings -- the unit of account since the lossless ledger (ck-api 2026-09-11),
10
+ * in which nothing is rounded. The `*Cents` fields remain as deprecated
11
+ * derived values (micro-USD / 10,000, truncated toward zero) and will be
12
+ * removed in a later major. Budget caps (`monthlyLimitCents`) stay in cents:
13
+ * they are limits, not money of record.
10
14
  *
11
15
  * @throws {CrowdyGraphQLError} `UNAUTHENTICATED` / `FORBIDDEN` / `SCOPE_MISSING`
12
16
  * per the permission notes above.
@@ -20,7 +24,9 @@ export class BillingAPI {
20
24
  * permission.
21
25
  *
22
26
  * @param orgId - Numeric org id (`BigInt` as a decimal string).
23
- * @returns The wallet balance (cents as a decimal string).
27
+ * @returns The wallet balance: `balanceMicrousd` and `holdsMicrousd`
28
+ * (micro-USD as decimal strings; spendable = balance − holds), plus the
29
+ * deprecated `balanceCents`.
24
30
  */
25
31
  async walletBalance(orgId) {
26
32
  const data = await this.api.request(WalletBalanceDocument, { orgId });
@@ -16,7 +16,12 @@ import { type BeginPlayerCardSetupMutation, type PlayerWalletBalanceQuery, type
16
16
  export declare class PlayerWalletAPI {
17
17
  private readonly graphql;
18
18
  constructor(graphql: GraphQLClient);
19
- /** The caller's wallet, created empty on first access (never null). */
19
+ /**
20
+ * The caller's wallet, created empty on first access (never null).
21
+ * `balanceMicrousd` / `holdsMicrousd` are micro-USD (1 USD = 1,000,000)
22
+ * decimal strings; spendable = balance − holds (a model turn holds its
23
+ * worst case while it runs). `balanceCents` is the deprecated truncation.
24
+ */
20
25
  balance(): Promise<PlayerWalletBalanceQuery['playerWalletBalance']>;
21
26
  /** The caller's wallet ledger, newest first. */
22
27
  transactions(variables?: PlayerWalletTransactionsQueryVariables): Promise<PlayerWalletTransactionsQuery['playerWalletTransactions']>;
@@ -1 +1 @@
1
- {"version":3,"file":"playerWallet.d.ts","sourceRoot":"","sources":["../../src/domains/playerWallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EASL,KAAK,4BAA4B,EASjC,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,KAAK,sCAAsC,EAC3C,KAAK,uBAAuB,EAC5B,KAAK,gCAAgC,EACrC,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,kCAAkC,EACvC,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,EACjC,KAAK,qCAAqC,EAC1C,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,gCAAgC,EACrC,KAAK,2BAA2B,EAChC,KAAK,oCAAoC,EACzC,KAAK,8BAA8B,EACnC,KAAK,uCAAuC,EAC5C,KAAK,qBAAqB,EAC1B,KAAK,8BAA8B,EACnC,KAAK,2BAA2B,EAChC,KAAK,oCAAoC,EACzC,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,EAChC,KAAK,oCAAoC,EAC1C,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;GAYG;AACH,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,aAAa;IAEnD,uEAAuE;IACjE,OAAO,IAAI,OAAO,CAAC,wBAAwB,CAAC,qBAAqB,CAAC,CAAC;IAKzE,gDAAgD;IAC1C,YAAY,CAChB,SAAS,GAAE,sCAA2C,GACrD,OAAO,CAAC,6BAA6B,CAAC,0BAA0B,CAAC,CAAC;IAQrE;;;OAGG;IACG,OAAO,CACX,SAAS,GAAE,gCAAqC,GAC/C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IAC/D,gBAAgB,CACpB,SAAS,EAAE,oCAAoC,GAC9C,OAAO,CAAC,2BAA2B,CAAC,wBAAwB,CAAC,CAAC;CAOlE"}
@@ -16,7 +16,12 @@ export class PlayerWalletAPI {
16
16
  constructor(graphql) {
17
17
  this.graphql = graphql;
18
18
  }
19
- /** The caller's wallet, created empty on first access (never null). */
19
+ /**
20
+ * The caller's wallet, created empty on first access (never null).
21
+ * `balanceMicrousd` / `holdsMicrousd` are micro-USD (1 USD = 1,000,000)
22
+ * decimal strings; spendable = balance − holds (a model turn holds its
23
+ * worst case while it runs). `balanceCents` is the deprecated truncation.
24
+ */
20
25
  async balance() {
21
26
  const data = await this.graphql.request(PlayerWalletBalanceDocument, {});
22
27
  return data.playerWalletBalance;
@@ -1435,6 +1435,29 @@ export type BatchActorLookupInput = {
1435
1435
  /** Actor ids to look up. Each is exactly 32 ASCII characters (the UDP-wire actor id), NOT a hyphenated RFC-4122 UUID. Must be non-empty; unknown ids are silently omitted from the result. */
1436
1436
  uuids: Array<Scalars['String']['input']>;
1437
1437
  };
1438
+ /** One settlement unit of the lossless ledger: a (payer, meter, period) for a continuous meter, or one request for a request-priced meter. Amounts in micro-USD; nothing is rounded. */
1439
+ export type BillingCharge = {
1440
+ __typename?: 'BillingCharge';
1441
+ appId: Scalars['BigInt']['output'];
1442
+ billedMicrousd: Scalars['BigInt']['output'];
1443
+ chargeId: Scalars['String']['output'];
1444
+ heldMicrousd: Scalars['BigInt']['output'];
1445
+ meter: Scalars['String']['output'];
1446
+ payerId: Scalars['BigInt']['output'];
1447
+ payerKind: Scalars['String']['output'];
1448
+ periodStart: Maybe<Scalars['DateTime']['output']>;
1449
+ pricedTotalMicrousd: Scalars['BigInt']['output'];
1450
+ quantityFree: Scalars['BigInt']['output'];
1451
+ quantityTotal: Scalars['BigInt']['output'];
1452
+ settlementRef: Scalars['String']['output'];
1453
+ state: Scalars['String']['output'];
1454
+ updatedAt: Scalars['DateTime']['output'];
1455
+ writtenOffMicrousd: Scalars['BigInt']['output'];
1456
+ };
1457
+ export type BillingCreditResult = {
1458
+ __typename?: 'BillingCreditResult';
1459
+ creditedMicrousd: Scalars['BigInt']['output'];
1460
+ };
1438
1461
  /** An organization whose wallet is not debited and whose apps are not denied for funds. Usage is still metered; waived amounts are in org_billing_waivers. */
1439
1462
  export type BillingExemptOrgType = {
1440
1463
  __typename?: 'BillingExemptOrgType';
@@ -1451,6 +1474,45 @@ export type BillingExemptOrgType = {
1451
1474
  /** Organization slug. */
1452
1475
  slug: Scalars['String']['output'];
1453
1476
  };
1477
+ /** One run of the ledger invariant checks. */
1478
+ export type BillingInvariantRun = {
1479
+ __typename?: 'BillingInvariantRun';
1480
+ /** JSON text. */
1481
+ detail: Maybe<Scalars['String']['output']>;
1482
+ ok: Scalars['Boolean']['output'];
1483
+ ranAt: Scalars['DateTime']['output'];
1484
+ residueMicrousd: Scalars['BigInt']['output'];
1485
+ runId: Scalars['String']['output'];
1486
+ /** JSON text. */
1487
+ sums: Scalars['String']['output'];
1488
+ };
1489
+ /** Ledger versus provider for one UTC day. */
1490
+ export type BillingReconciliation = {
1491
+ __typename?: 'BillingReconciliation';
1492
+ day: Scalars['String']['output'];
1493
+ deltaMicrousd: Maybe<Scalars['BigInt']['output']>;
1494
+ /** JSON text. */
1495
+ detail: Maybe<Scalars['String']['output']>;
1496
+ expectedMicrousd: Scalars['BigInt']['output'];
1497
+ provider: Scalars['String']['output'];
1498
+ providerReportedMicrousd: Maybe<Scalars['BigInt']['output']>;
1499
+ status: Scalars['String']['output'];
1500
+ };
1501
+ /** A billable amount that could not be billed, with the reason. */
1502
+ export type BillingWriteOff = {
1503
+ __typename?: 'BillingWriteOff';
1504
+ amountMicrousd: Scalars['BigInt']['output'];
1505
+ appId: Maybe<Scalars['BigInt']['output']>;
1506
+ createdAt: Scalars['DateTime']['output'];
1507
+ /** JSON text. */
1508
+ evidence: Maybe<Scalars['String']['output']>;
1509
+ meter: Scalars['String']['output'];
1510
+ payerId: Scalars['BigInt']['output'];
1511
+ payerKind: Scalars['String']['output'];
1512
+ quantity: Scalars['BigInt']['output'];
1513
+ reason: Scalars['String']['output'];
1514
+ writeOffId: Scalars['String']['output'];
1515
+ };
1454
1516
  export type BindCrowdyStudioGitHubInput = {
1455
1517
  appId: Scalars['BigInt']['input'];
1456
1518
  branch?: InputMaybe<Scalars['String']['input']>;
@@ -4964,6 +5026,8 @@ export type Mutation = {
4964
5026
  connectUdpProxy: UdpProxyConnectionStatus;
4965
5027
  /** Consent to run a grid-attached client mod (D2): acknowledges the attachment's exact capability hash. A newer version with a widened summary carries a different hash, so stale consents fail closed — re-consent is always explicit. Consent is per player per attachment. */
4966
5028
  consentGridClientMod: Scalars['Boolean']['output'];
5029
+ /** Operator only. Credit the payer of an over-billed charge (an I3 finding: an allowance or rate was raised after the charge landed) the difference, and close the charge row. Idempotent per charge state. SIDE EFFECT: a wallet credit and a CREDIT event. */
5030
+ cpBillingCreditOverbill: BillingCreditResult;
4967
5031
  /** Operator only (is_operator). Patches the platform compute ceilings: omitted fields stay unchanged, an explicit null clears that override (game-api falls back to env/default), a value (> 0) sets it. SIDE EFFECTS: fans a replica notify out to every game-api so the new ceilings clamp computeSetPolicy within ~30 seconds without a restart, and writes an audit entry. Lowering a ceiling does not shrink already-stored per-app policies; it rejects future computeSetPolicy values above the new ceiling. Returns the updated ceilings row. */
4968
5032
  cpSetComputePlatformCeilings: CpComputePlatformCeilings;
4969
5033
  /** Operator only (is_operator or is_super_admin). Publish or release an emergency kill for one app. This state is separate from the app's own kill and always takes precedence in Management's effective envelope; app users cannot clear it. SIDE EFFECTS: revision increment and a sanitized audit event. NOTHING IS PUSHED TO GAME API: preemption takes effect when its runtime next pulls this app's crowdy.studio-agent-policy/1 replica, which is within about a minute for an app already holding one and not at all for an app that does not until a permitted caller asks. Releasing the operator kill does not enable the app or clear its own kill. Stable errors: AGENT_POLICY_INVALID, AGENT_POLICY_REVISION_CONFLICT, IDEMPOTENCY_CONFLICT. */
@@ -5482,6 +5546,11 @@ export type MutationConsentGridClientModArgs = {
5482
5546
  attachmentId: Scalars['String']['input'];
5483
5547
  consentCapabilityHash: Scalars['String']['input'];
5484
5548
  };
5549
+ export type MutationCpBillingCreditOverbillArgs = {
5550
+ appId: Scalars['BigInt']['input'];
5551
+ chargeId: Scalars['String']['input'];
5552
+ reason: Scalars['String']['input'];
5553
+ };
5485
5554
  export type MutationCpSetComputePlatformCeilingsArgs = {
5486
5555
  input: CpSetComputePlatformCeilingsInput;
5487
5556
  };
@@ -6442,12 +6511,19 @@ export type OrgUsageSummary = {
6442
6511
  };
6443
6512
  export type OrgWallet = {
6444
6513
  __typename?: 'OrgWallet';
6445
- /** Current wallet balance in minor currency units (cents) of `currency`, as a BigInt decimal string. May be negative if usage was charged against an empty wallet. */
6514
+ /**
6515
+ * DEPRECATED. balanceMicrousd / 10,000 truncated toward zero, as a BigInt decimal string.
6516
+ * @deprecated Cents are a display convenience derived from balanceMicrousd (truncated toward zero). Read balanceMicrousd.
6517
+ */
6446
6518
  balanceCents: Scalars['BigInt']['output'];
6519
+ /** Current wallet balance in MICRO-USD (1 USD = 1,000,000), as a BigInt decimal string. The unit of account since 2026-09-11: every charge is recorded to the micro-USD and nothing is rounded. May be negative when accrued usage settled against an empty wallet. */
6520
+ balanceMicrousd: Scalars['BigInt']['output'];
6447
6521
  /** When the wallet was created (ISO-8601 UTC timestamp). */
6448
6522
  createdAt: Scalars['DateTime']['output'];
6449
6523
  /** ISO-4217 currency code for `balanceCents`, lowercase (e.g. "usd"). Defaults to "usd". */
6450
6524
  currency: Scalars['String']['output'];
6525
+ /** Micro-USD currently held against in-flight request-priced usage (a model turn reserves its worst case here before it runs and releases the difference when it settles). Spendable balance is balanceMicrousd - holdsMicrousd. */
6526
+ holdsMicrousd: Scalars['BigInt']['output'];
6451
6527
  /** Organization that owns this wallet (BigInt as a decimal string). There is exactly one wallet per organization. */
6452
6528
  orgId: Scalars['BigInt']['output'];
6453
6529
  /** When the wallet was last modified, e.g. on balance change (ISO-8601 UTC timestamp). */
@@ -7086,12 +7162,19 @@ export type PlayerUsageCharge = {
7086
7162
  /** The caller's player wallet (player compute P2, DN-5): a platform-scoped balance funding that player's grid compute across every org/app they play in. Out-of-band from org wallets — player usage never touches an org's money. */
7087
7163
  export type PlayerWallet = {
7088
7164
  __typename?: 'PlayerWallet';
7089
- /** Current balance in cents (may go negative on a closed hour). */
7165
+ /**
7166
+ * DEPRECATED. balanceMicrousd / 10,000 truncated toward zero.
7167
+ * @deprecated Derived from balanceMicrousd (truncated toward zero). Read balanceMicrousd.
7168
+ */
7090
7169
  balanceCents: Scalars['BigInt']['output'];
7170
+ /** Current balance in MICRO-USD (1 USD = 1,000,000). The unit of account since 2026-09-11; nothing is rounded. May go negative when accrued usage settles against an empty wallet. */
7171
+ balanceMicrousd: Scalars['BigInt']['output'];
7091
7172
  /** Wallet creation time. */
7092
7173
  createdAt: Scalars['DateTime']['output'];
7093
7174
  /** ISO currency code (lowercase). */
7094
7175
  currency: Scalars['String']['output'];
7176
+ /** Micro-USD held against in-flight request-priced usage (a model turn reserves its worst case before it runs). Spendable = balanceMicrousd - holdsMicrousd. */
7177
+ holdsMicrousd: Scalars['BigInt']['output'];
7095
7178
  /** The owning player user id. */
7096
7179
  userId: Scalars['BigInt']['output'];
7097
7180
  /** Wallet id. */
@@ -7100,12 +7183,22 @@ export type PlayerWallet = {
7100
7183
  /** One player-wallet ledger entry: top-ups, hourly usage debits, auto-recharges, refunds, and adjustments. Usage debits carry the app and reference the hour's charge row, whose snapshot splits platform vs studio-markup components. */
7101
7184
  export type PlayerWalletTransaction = {
7102
7185
  __typename?: 'PlayerWalletTransaction';
7103
- /** Signed amount in cents (debits negative). */
7186
+ /**
7187
+ * DEPRECATED. amountMicrousd / 10,000 truncated toward zero.
7188
+ * @deprecated Derived from amountMicrousd (truncated toward zero). Read amountMicrousd.
7189
+ */
7104
7190
  amountCents: Scalars['BigInt']['output'];
7191
+ /** Signed amount in micro-USD (debits negative). Exact. */
7192
+ amountMicrousd: Scalars['BigInt']['output'];
7105
7193
  /** The app a usage debit covers; null for wallet-level entries. */
7106
7194
  appId: Maybe<Scalars['BigInt']['output']>;
7107
- /** Balance after this entry. */
7195
+ /**
7196
+ * DEPRECATED. balanceAfterMicrousd / 10,000 truncated toward zero.
7197
+ * @deprecated Derived from balanceAfterMicrousd. Read balanceAfterMicrousd.
7198
+ */
7108
7199
  balanceAfter: Scalars['BigInt']['output'];
7200
+ /** Balance in micro-USD after this entry. */
7201
+ balanceAfterMicrousd: Scalars['BigInt']['output'];
7109
7202
  /** Entry time. */
7110
7203
  createdAt: Scalars['DateTime']['output'];
7111
7204
  /** Human description. */
@@ -7439,10 +7532,14 @@ export type Query = {
7439
7532
  avatarAppStates: Array<AppAvatarState>;
7440
7533
  /** Bulk-fetches actors by a list of 32-character ASCII uuids in one round-trip. Requires a valid game token. PUBLIC-STATE ONLY: `privateState` is stripped (null) for every result regardless of ownership. Unknown uuids are silently omitted. Use this to resolve many actors at once; use `actor` for a single owner-scoped fetch. */
7441
7534
  batchLookupActors: Array<Actor>;
7535
+ /** The lossless ledger's charge rows for one app: every (payer, meter, period) or request that has been priced, with what was billed, held and written off, in micro-USD. Requires 'view_billing' on the org. */
7536
+ billingCharges: Array<BillingCharge>;
7442
7537
  /** OPERATOR ONLY. Every organization currently marked billing_exempt. An exemption nobody can enumerate is an exemption that outlives its reason. */
7443
7538
  billingExemptOrgs: Array<BillingExemptOrgType>;
7444
7539
  /** OPERATOR ONLY. The metered rate card for a scope: every priced dimension with its unit, price and hourly free allowance. SHARED is organization usage billed to the org wallet as "shared_usage"; PLAYER is player compute billed to the player wallet as "usage_debit". A dimension priced at 0 is metered but not charged. Read-only. Customers read the same rates through `meteredRateCard`, which is public and omits the operator note. */
7445
7540
  billingRateCard: Array<RateCardEntryType>;
7541
+ /** Amounts the platform could not bill this org for, with the reason (an exempt org, a provider with no generation record, a process that died with metered usage in memory). Requires 'view_billing' on the org. */
7542
+ billingWriteOffs: Array<BillingWriteOff>;
7446
7543
  /** Fetch one channel by id. Errors if the id is not a channel. */
7447
7544
  channel: Group;
7448
7545
  /** List the members of a channel (the subscriber set, including pending requests), each with their status and roles. */
@@ -7479,6 +7576,12 @@ export type Query = {
7479
7576
  computeModules: Array<WasmModule>;
7480
7577
  /** The platform's engine-template registry: ready-made compute engines (mob/world/match/deck/instance/director/matchmaking/market/board/minigame/abilities/movement-warden/territory/racing/...) deployable by name with computeDeployTemplate. Requires the org 'manage_compute' permission. */
7481
7578
  computeTemplates: Array<ComputeTemplateInfo>;
7579
+ /** Operator only. The ledger invariant runs, newest first: whether the sums closed and, when they did not, which check failed and by how much. */
7580
+ cpBillingInvariantRuns: Array<BillingInvariantRun>;
7581
+ /** Operator only. Ledger-versus-provider reconciliation, one row per provider per UTC day. */
7582
+ cpBillingReconciliations: Array<BillingReconciliation>;
7583
+ /** Operator only (is_operator or is_super_admin). Every write-off, newest first. */
7584
+ cpBillingWriteOffs: Array<BillingWriteOff>;
7482
7585
  /** Operator only (is_operator). The stored platform ceilings for the per-app WASM compute policy (the knobs computeSetPolicy clamps against). Null fields mean no operator override: game-api uses its COMPUTE_PLATFORM_MAX_* env var, then the code default. Read-only. */
7483
7586
  cpComputePlatformCeilings: CpComputePlatformCeilings;
7484
7587
  /** Operator only (is_operator or is_super_admin). What the ANSWERING ck-api instance carries for Agentic Studio: allowlisted models with their pinned micro-USD prices, the implemented crowdy.agent-tools/1 tools with risk classes, and the complete mode and risk-class value sets a policy may draw from. It is deployed configuration read from that one process, not stored policy and not a fleet-wide claim, so it reports which instance and datacenter answered. A platform policy may name a model or tool absent here: the write succeeds, the value is stored and echoed back, and no run can use it. */
@@ -7916,9 +8019,18 @@ export type QueryAvatarAppStatesArgs = {
7916
8019
  export type QueryBatchLookupActorsArgs = {
7917
8020
  input: BatchActorLookupInput;
7918
8021
  };
8022
+ export type QueryBillingChargesArgs = {
8023
+ appId: Scalars['BigInt']['input'];
8024
+ limit?: InputMaybe<Scalars['Int']['input']>;
8025
+ orgId: Scalars['BigInt']['input'];
8026
+ };
7919
8027
  export type QueryBillingRateCardArgs = {
7920
8028
  scope: RateScope;
7921
8029
  };
8030
+ export type QueryBillingWriteOffsArgs = {
8031
+ limit?: InputMaybe<Scalars['Int']['input']>;
8032
+ orgId: Scalars['BigInt']['input'];
8033
+ };
7922
8034
  export type QueryChannelArgs = {
7923
8035
  groupId: Scalars['BigInt']['input'];
7924
8036
  };
@@ -7988,6 +8100,15 @@ export type QueryComputeModulesArgs = {
7988
8100
  export type QueryComputeTemplatesArgs = {
7989
8101
  appId: Scalars['BigInt']['input'];
7990
8102
  };
8103
+ export type QueryCpBillingInvariantRunsArgs = {
8104
+ limit?: InputMaybe<Scalars['Int']['input']>;
8105
+ };
8106
+ export type QueryCpBillingReconciliationsArgs = {
8107
+ limit?: InputMaybe<Scalars['Int']['input']>;
8108
+ };
8109
+ export type QueryCpBillingWriteOffsArgs = {
8110
+ limit?: InputMaybe<Scalars['Int']['input']>;
8111
+ };
7991
8112
  export type QueryCrowdyStudioAgentEffectivePolicyArgs = {
7992
8113
  appId: Scalars['BigInt']['input'];
7993
8114
  };
@@ -10398,12 +10519,22 @@ export type VoxelUpdatesByDistanceResponse = {
10398
10519
  };
10399
10520
  export type WalletTransaction = {
10400
10521
  __typename?: 'WalletTransaction';
10401
- /** Signed change applied to the wallet in minor currency units (cents), as a BigInt decimal string: positive credits funds, negative debits funds. */
10522
+ /**
10523
+ * DEPRECATED. amountMicrousd / 10,000 truncated toward zero.
10524
+ * @deprecated Derived from amountMicrousd (truncated toward zero). Read amountMicrousd.
10525
+ */
10402
10526
  amountCents: Scalars['BigInt']['output'];
10527
+ /** Signed change applied to the wallet in MICRO-USD, as a BigInt decimal string: positive credits funds, negative debits funds. Exact; nothing is rounded. */
10528
+ amountMicrousd: Scalars['BigInt']['output'];
10403
10529
  /** App that incurred the charge (BigInt as a decimal string), set on usage-type transactions; null for org-level credits such as top-ups. */
10404
10530
  appId: Maybe<Scalars['BigInt']['output']>;
10405
- /** Wallet balance in cents immediately after this transaction was applied, as a BigInt decimal string. */
10531
+ /**
10532
+ * DEPRECATED. balanceAfterMicrousd / 10,000 truncated toward zero.
10533
+ * @deprecated Derived from balanceAfterMicrousd (truncated toward zero). Read balanceAfterMicrousd.
10534
+ */
10406
10535
  balanceAfter: Scalars['BigInt']['output'];
10536
+ /** Wallet balance in micro-USD immediately after this transaction was applied, as a BigInt decimal string. */
10537
+ balanceAfterMicrousd: Scalars['BigInt']['output'];
10407
10538
  /** When the transaction was recorded (ISO-8601 UTC timestamp). */
10408
10539
  createdAt: Scalars['DateTime']['output'];
10409
10540
  /** Optional human-readable note describing the transaction; null when not set. */
@@ -11730,6 +11861,8 @@ export type WalletBalanceQuery = {
11730
11861
  __typename?: 'OrgWallet';
11731
11862
  walletId: string;
11732
11863
  orgId: string;
11864
+ balanceMicrousd: string;
11865
+ holdsMicrousd: string;
11733
11866
  balanceCents: string;
11734
11867
  currency: string;
11735
11868
  createdAt: string;
@@ -11748,6 +11881,8 @@ export type WalletTransactionsQuery = {
11748
11881
  transactionId: string;
11749
11882
  walletId: string;
11750
11883
  orgId: string;
11884
+ amountMicrousd: string;
11885
+ balanceAfterMicrousd: string;
11751
11886
  amountCents: string;
11752
11887
  balanceAfter: string;
11753
11888
  transactionType: string;
@@ -11775,6 +11910,8 @@ export type WalletTransactionsConnectionQuery = {
11775
11910
  transactionId: string;
11776
11911
  walletId: string;
11777
11912
  orgId: string;
11913
+ amountMicrousd: string;
11914
+ balanceAfterMicrousd: string;
11778
11915
  amountCents: string;
11779
11916
  balanceAfter: string;
11780
11917
  transactionType: string;
@@ -16673,6 +16810,8 @@ export type PlayerWalletFieldsFragment = {
16673
16810
  __typename?: 'PlayerWallet';
16674
16811
  walletId: string;
16675
16812
  userId: string;
16813
+ balanceMicrousd: string;
16814
+ holdsMicrousd: string;
16676
16815
  balanceCents: string;
16677
16816
  currency: string;
16678
16817
  createdAt: string;
@@ -16682,6 +16821,8 @@ export type PlayerWalletTransactionFieldsFragment = {
16682
16821
  transactionId: string;
16683
16822
  walletId: string;
16684
16823
  userId: string;
16824
+ amountMicrousd: string;
16825
+ balanceAfterMicrousd: string;
16685
16826
  amountCents: string;
16686
16827
  balanceAfter: string;
16687
16828
  transactionType: string;
@@ -16757,6 +16898,8 @@ export type PlayerWalletBalanceQuery = {
16757
16898
  __typename?: 'PlayerWallet';
16758
16899
  walletId: string;
16759
16900
  userId: string;
16901
+ balanceMicrousd: string;
16902
+ holdsMicrousd: string;
16760
16903
  balanceCents: string;
16761
16904
  currency: string;
16762
16905
  createdAt: string;
@@ -16773,6 +16916,8 @@ export type PlayerWalletTransactionsQuery = {
16773
16916
  transactionId: string;
16774
16917
  walletId: string;
16775
16918
  userId: string;
16919
+ amountMicrousd: string;
16920
+ balanceAfterMicrousd: string;
16776
16921
  amountCents: string;
16777
16922
  balanceAfter: string;
16778
16923
  transactionType: string;