@tryvira/sdk 0.1.108 → 0.1.109

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.
package/README.md CHANGED
@@ -15,7 +15,7 @@ Compound execution plans can be persisted with `saveCompoundTaskPlan(plan, {idem
15
15
  ## Install
16
16
 
17
17
  ```bash
18
- npm install @tryvira/sdk@0.1.108
18
+ npm install @tryvira/sdk@0.1.109
19
19
  ```
20
20
 
21
21
  Configure the organization, project, and environment for every request. Keep the API
package/dist/index.js CHANGED
@@ -182,8 +182,8 @@ var ViraClient = class {
182
182
  if (!actorId.trim()) throw new Error("SDK_ACTOR_ID_REQUIRED");
183
183
  return this.request({ method: "POST", path: `/v1/organization/billing-admins/${encodeURIComponent(actorId)}`, body: { status } }, { idempotencyKey: options.idempotencyKey ?? `sdk:billing-admin:${globalThis.crypto.randomUUID()}`, enforcing: true });
184
184
  }
185
- getAICreditWallet() {
186
- return this.request({ method: "GET", path: "/v1/billing/credits" });
185
+ getAICreditWallet(input = {}) {
186
+ return this.request({ method: "GET", path: "/v1/billing/credits", ...input.includeCommercial === true ? { query: { includeCommercial: "true" } } : {} });
187
187
  }
188
188
  listAICreditBudgets() {
189
189
  return this.request({ method: "GET", path: "/v1/billing/credits/budgets" });
@@ -847,12 +847,68 @@ export interface AICreditReservationRecord {
847
847
  ledgerEntryId: string | null;
848
848
  usageReceiptId: string | null;
849
849
  }
850
+ export interface AICreditFundingLot {
851
+ grantId: string;
852
+ kind: "included" | "purchased";
853
+ grantedMicrocredits: number;
854
+ remainingMicrocredits: number;
855
+ reservedMicrocredits: number;
856
+ expiresAt: string;
857
+ expired: boolean;
858
+ }
859
+ export interface AICreditFundingView {
860
+ status: "ALLOCATED" | "LEGACY_UNALLOCATED";
861
+ lots: readonly AICreditFundingLot[];
862
+ totals: {
863
+ balance: number;
864
+ reserved: number;
865
+ spendable: number;
866
+ expiredUnspent: number;
867
+ included: number;
868
+ purchased: number;
869
+ } | null;
870
+ }
871
+ export interface ManualCommercialWalletSummary {
872
+ status: "AVAILABLE" | "NO_ACCOUNT";
873
+ hasMore: boolean;
874
+ items: readonly {
875
+ id: string;
876
+ kind: string;
877
+ planVersion: string;
878
+ currency: string;
879
+ totalMinor: string;
880
+ startAt: string;
881
+ endAt: string;
882
+ status: string;
883
+ accessCurrent: boolean;
884
+ paymentStatus: string;
885
+ collectedMinor: string;
886
+ outstandingMinor: string;
887
+ overdueMinor: string;
888
+ creditFulfillment?: {
889
+ grantedAt: string;
890
+ expiresAt: string;
891
+ microcredits: string;
892
+ remainingMicrocredits: string;
893
+ reservedMicrocredits: string;
894
+ consumedMicrocredits: string;
895
+ consumedRefundMicrocredits?: string;
896
+ expiredRefundMicrocredits?: string;
897
+ recollectedRefundMinor?: string;
898
+ reversedMicrocredits: string;
899
+ expiredMicrocredits: string;
900
+ reversalStatus: "NONE" | "PARTIAL" | "FULL";
901
+ };
902
+ }[];
903
+ }
850
904
  export interface AICreditWalletResult {
851
905
  organizationId: string;
852
906
  billingAccountId: string;
853
907
  balanceMicrocredits: number;
854
908
  entries: readonly AICreditLedgerEntry[];
855
909
  source: "ai-credit-wallet-ledger";
910
+ funding?: AICreditFundingView;
911
+ commercial?: ManualCommercialWalletSummary;
856
912
  }
857
913
  export interface AICreditReservationResult {
858
914
  organizationId: string;
@@ -1083,7 +1139,9 @@ export declare class ViraClient {
1083
1139
  setOrganizationBillingAdmin(actorId: string, status?: "ACTIVE" | "REVOKED", options?: {
1084
1140
  idempotencyKey?: string;
1085
1141
  }): Promise<ViraResponse<ClientBody> | null>;
1086
- getAICreditWallet(): Promise<ViraResponse<AICreditWalletResult> | null>;
1142
+ getAICreditWallet(input?: {
1143
+ includeCommercial?: boolean;
1144
+ }): Promise<ViraResponse<AICreditWalletResult> | null>;
1087
1145
  listAICreditBudgets(): Promise<ViraResponse<AICreditBudgetList> | null>;
1088
1146
  listAIUsageReceipts(input?: {
1089
1147
  organizationUnitId?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryvira/sdk",
3
- "version": "0.1.108",
3
+ "version": "0.1.109",
4
4
  "description": "Typed Vira SDK for connect-once, observation and governed runtime execution.",
5
5
  "keywords": [
6
6
  "vira",