@neta-art/cohub 2.7.1 → 2.8.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.
@@ -46,6 +46,24 @@ type ContentBlock = {
46
46
  _meta?: ContentBlockMeta;
47
47
  };
48
48
  //#endregion
49
+ //#region ../protocol/src/billing.d.ts
50
+ /**
51
+ * Standard billing payload attached under the `billing` key of any response
52
+ * or realtime event that involves a billing gate. Present on 402 error bodies
53
+ * (blocked / not entitled), on success responses carrying a soft debt warning,
54
+ * and on realtime error events. `conversion` always drives the shared upgrade
55
+ * UI; balance fields appear only for balance-based gates.
56
+ *
57
+ * `conversion` is intentionally `unknown` here to keep the protocol layer free
58
+ * of a billing dependency — clients validate it against `BillingConversionIntent`.
59
+ */
60
+ type BillingPayload = {
61
+ conversion: unknown;
62
+ status?: "blocked" | "allowed_with_debt";
63
+ netUsd?: number;
64
+ hardNegativeLimitUsd?: number;
65
+ };
66
+ //#endregion
49
67
  //#region ../protocol/src/core/usage.d.ts
50
68
  type Usage = {
51
69
  input?: number;
@@ -168,7 +186,7 @@ type SessionTurnSegmentRecord = {
168
186
  toSequence: number | null;
169
187
  createdAt: string;
170
188
  };
171
- type SessionBindingRecord = {
189
+ type SessionBindingRecord$1 = {
172
190
  id: string;
173
191
  spaceId: string;
174
192
  spaceSessionId: string;
@@ -188,7 +206,7 @@ type SessionUserProfile = {
188
206
  displayName: string;
189
207
  avatarUrl: string | null;
190
208
  };
191
- type SessionRecord = {
209
+ type SessionRecord$1 = {
192
210
  id: string;
193
211
  spaceId: string;
194
212
  userUuid: string | null;
@@ -376,7 +394,7 @@ type SystemSubscribeErrorEvent = {
376
394
  }>;
377
395
  };
378
396
  };
379
- type RealtimeSessionRecord = Pick<SessionRecord, "id" | "spaceId" | "userUuid" | "title" | "source" | "status" | "externalSessionId" | "latestMessageText" | "lastMessageAt" | "lastMessageId" | "createdAt" | "updatedAt">;
397
+ type RealtimeSessionRecord = Pick<SessionRecord$1, "id" | "spaceId" | "userUuid" | "title" | "source" | "status" | "externalSessionId" | "latestMessageText" | "lastMessageAt" | "lastMessageId" | "createdAt" | "updatedAt">;
380
398
  type SessionCreatedEvent = {
381
399
  id: string;
382
400
  timestamp: number;
@@ -429,6 +447,7 @@ type SessionRequestErrorEvent = {
429
447
  code?: string;
430
448
  message: string;
431
449
  clientMessageId?: string | null;
450
+ billing?: BillingPayload | null;
432
451
  };
433
452
  };
434
453
  type RealtimePatchOperation = {
@@ -600,7 +619,7 @@ type SpacePortsChangedEvent = {
600
619
  sessionId?: string | null;
601
620
  payload: SpacePortsChangedPayload;
602
621
  };
603
- type SpacePresenceUser = {
622
+ type SpacePresenceUser$1 = {
604
623
  userId: string;
605
624
  connectionCount: number;
606
625
  lastSeenAt: string;
@@ -613,9 +632,9 @@ type SpacePresenceUser = {
613
632
  avatarUrl: string | null;
614
633
  };
615
634
  };
616
- type SpacePresenceSnapshot = {
635
+ type SpacePresenceSnapshot$1 = {
617
636
  spaceId: string;
618
- users: SpacePresenceUser[];
637
+ users: SpacePresenceUser$1[];
619
638
  updatedAt: string;
620
639
  };
621
640
  type SpacePresenceUpdatedEvent = {
@@ -626,7 +645,7 @@ type SpacePresenceUpdatedEvent = {
626
645
  requestId?: string | null;
627
646
  spaceId: string;
628
647
  sessionId?: string | null;
629
- payload: SpacePresenceSnapshot;
648
+ payload: SpacePresenceSnapshot$1;
630
649
  };
631
650
  type CanvasTransactionAppliedEvent = {
632
651
  id: string;
@@ -734,6 +753,1571 @@ type LabelAssignmentsUpdatedEvent = {
734
753
  };
735
754
  type RealtimeServerEvent = SystemReadyEvent | SystemAuthOkEvent | SystemRequestErrorEvent | SystemPongEvent | SystemAckOkEvent | SystemSubscribeOkEvent | SystemSubscribeErrorEvent | SessionCreatedEvent | SessionUpdatedEvent | SessionRequestAcceptedEvent | SessionRequestErrorEvent | SessionTurnCreatedEvent | SessionTurnPatchEvent | SessionTurnErrorEvent | SessionTurnLifecycleEvent | SessionTurnUpdatedEvent | SessionTurnFinalizedEvent | SessionTurnNotifyEvent | SessionMessagePersistedEvent | SpaceFsChangedEvent | SpacePortsChangedEvent | SpacePresenceUpdatedEvent | CanvasTransactionAppliedEvent | CanvasTransactionAckEvent | CanvasTransactionErrorEvent | TaskCreatedEvent | TaskUpdatedEvent | LabelAssignmentsUpdatedEvent;
736
755
  //#endregion
756
+ //#region ../protocol/src/gateway/types.d.ts
757
+ type ChannelModelConfig = {
758
+ provider: string;
759
+ id: string;
760
+ };
761
+ type BaseChannelConfig = {
762
+ model?: ChannelModelConfig | null;
763
+ };
764
+ type DiscordChannelConfig = BaseChannelConfig & {
765
+ inbound?: {
766
+ requireMentionInGuild?: boolean;
767
+ };
768
+ outbound?: {
769
+ showThinking?: boolean;
770
+ showToolCalls?: boolean;
771
+ };
772
+ };
773
+ type FeishuChannelConfig = BaseChannelConfig & {
774
+ brand?: "feishu" | "lark";
775
+ inbound?: {
776
+ requireMentionInGroup?: boolean;
777
+ };
778
+ outbound?: {
779
+ renderMode?: "card" | "post";
780
+ showThinking?: boolean;
781
+ showToolCalls?: boolean;
782
+ };
783
+ };
784
+ type WeChatChannelConfig = BaseChannelConfig & {
785
+ outbound?: {
786
+ showIntermediateStatus?: boolean;
787
+ };
788
+ };
789
+ type QQChannelConfig = BaseChannelConfig & {
790
+ inbound?: {
791
+ requireMentionInGroup?: boolean;
792
+ };
793
+ outbound?: {
794
+ markdownSupport?: boolean;
795
+ };
796
+ };
797
+ type ChannelConfig = DiscordChannelConfig | FeishuChannelConfig | WeChatChannelConfig | QQChannelConfig | (BaseChannelConfig & Record<string, unknown>);
798
+ /** Runtime connection health for a bound gateway channel (space_channel id). */
799
+ type ChannelRuntimeState = "unbound" | "connecting" | "ready" | "degraded" | "error" | "stopped";
800
+ type ChannelHealthReasonCode = "invalid_credentials" | "auth_failed" | "network" | "permission" | "provider_error" | "unknown";
801
+ type ChannelHealth = {
802
+ state: ChannelRuntimeState;
803
+ reasonCode?: ChannelHealthReasonCode | null;
804
+ message?: string | null;
805
+ detail?: string | null;
806
+ lastReadyAt?: string | null;
807
+ lastErrorAt?: string | null;
808
+ lastInboundAt?: string | null;
809
+ lastOutboundAt?: string | null;
810
+ nodeId?: string | null;
811
+ updatedAt: string;
812
+ meta?: Record<string, string> | null;
813
+ };
814
+ //#endregion
815
+ //#region ../../node_modules/.pnpm/@neta-art+generation@0.1.12/node_modules/@neta-art/generation/dist/builtins-H7pH9ppJ.d.ts
816
+ //#region src/types.d.ts
817
+ declare const MODEL_SCHEMA: "neta.generation.model.v1";
818
+ type GenerationSource = {
819
+ type: "url";
820
+ url: string;
821
+ } | {
822
+ type: "base64";
823
+ mediaType: string;
824
+ data: string;
825
+ };
826
+ type GenerationContentBlockMeta = Record<string, unknown>;
827
+ type GenerationContentBlock = {
828
+ type: "text";
829
+ text: string;
830
+ meta?: GenerationContentBlockMeta;
831
+ } | {
832
+ type: "image";
833
+ source: GenerationSource;
834
+ meta?: GenerationContentBlockMeta;
835
+ } | {
836
+ type: "video";
837
+ source: GenerationSource;
838
+ meta?: GenerationContentBlockMeta;
839
+ } | {
840
+ type: "audio";
841
+ source: GenerationSource;
842
+ meta?: GenerationContentBlockMeta;
843
+ };
844
+ type GenerationResult = {
845
+ content: GenerationContentBlock[];
846
+ requestId?: string;
847
+ cost?: number;
848
+ };
849
+ type GenerationContentSpec = {
850
+ type: "text" | "image" | "video" | "audio";
851
+ required?: boolean;
852
+ min?: number;
853
+ max?: number;
854
+ sources?: Array<GenerationSource["type"]>;
855
+ roles?: string[];
856
+ roleRequired?: boolean;
857
+ merge?: "newline" | "space" | "concat";
858
+ meta?: Record<string, unknown>;
859
+ description?: string;
860
+ };
861
+ type GenerationParameterSpec = {
862
+ type: "string";
863
+ optional?: boolean;
864
+ default?: string;
865
+ enum?: string[];
866
+ description?: string;
867
+ examples?: string[];
868
+ } | {
869
+ type: "number";
870
+ optional?: boolean;
871
+ default?: number;
872
+ min?: number;
873
+ max?: number;
874
+ description?: string;
875
+ examples?: number[];
876
+ } | {
877
+ type: "integer";
878
+ optional?: boolean;
879
+ default?: number;
880
+ min?: number;
881
+ max?: number;
882
+ description?: string;
883
+ examples?: number[];
884
+ } | {
885
+ type: "boolean";
886
+ optional?: boolean;
887
+ default?: boolean;
888
+ description?: string;
889
+ examples?: boolean[];
890
+ };
891
+ type GenerationMetaFieldSpec = GenerationParameterSpec | {
892
+ type: "object";
893
+ optional?: boolean;
894
+ description?: string;
895
+ };
896
+ type GenerationMetaTaskVariantSpec = {
897
+ description?: string;
898
+ required?: string[];
899
+ requiredContent?: Array<GenerationContentSpec["type"]>;
900
+ sendTask?: boolean;
901
+ };
902
+ type GenerationMetaSpec = {
903
+ fields?: Record<string, GenerationMetaFieldSpec>;
904
+ taskField?: string;
905
+ taskVariants?: Record<string, GenerationMetaTaskVariantSpec>;
906
+ };
907
+ type GenerationModelDeclaration = {
908
+ schema: typeof MODEL_SCHEMA;
909
+ model: string;
910
+ title?: string;
911
+ description?: string;
912
+ allowUnknownParameters?: boolean;
913
+ adapter: {
914
+ type: string;
915
+ } & Record<string, unknown>;
916
+ content: {
917
+ input: GenerationContentSpec[];
918
+ };
919
+ parameters?: Record<string, GenerationParameterSpec>;
920
+ meta?: GenerationMetaSpec;
921
+ examples?: Array<{
922
+ title?: string;
923
+ request: GenerateRequest;
924
+ }>;
925
+ };
926
+ type GenerateRequest = {
927
+ model: string;
928
+ content: GenerationContentBlock[];
929
+ parameters?: Record<string, unknown>;
930
+ meta?: Record<string, unknown>; /** @deprecated Use meta. */
931
+ metadata?: Record<string, unknown>;
932
+ apiKey?: string;
933
+ baseUrl?: string;
934
+ };
935
+ //#endregion
936
+ //#region ../protocol/src/generation/policy.d.ts
937
+ type GenerationPolicy = {
938
+ version: 1;
939
+ mode: "auto" | "limited";
940
+ models?: GenerationModelPolicy[];
941
+ };
942
+ type GenerationModelPolicy = {
943
+ model: string;
944
+ /**
945
+ * Generic constraints keyed by generation declaration parameter name.
946
+ * Missing parameters are not restricted by policy.
947
+ */
948
+ parameters?: Record<string, GenerationParameterConstraint>;
949
+ };
950
+ type GenerationParameterConstraint = {
951
+ kind: "enum";
952
+ values: Array<string | number | boolean>;
953
+ } | {
954
+ kind: "number";
955
+ min?: number;
956
+ max?: number;
957
+ values?: number[];
958
+ } | {
959
+ kind: "integer";
960
+ min?: number;
961
+ max?: number;
962
+ values?: number[];
963
+ } | {
964
+ kind: "boolean";
965
+ value?: boolean;
966
+ };
967
+ declare class GenerationPolicyError extends Error {
968
+ constructor(message: string);
969
+ }
970
+ type EnvLike = Record<string, string | undefined>;
971
+ type PublicDeclaration = Omit<GenerationModelDeclaration, "adapter">;
972
+ declare function normalizeGenerationPolicy(value: unknown): GenerationPolicy | null;
973
+ declare function encodeGenerationPolicy(policy: GenerationPolicy): string;
974
+ declare function decodeGenerationPolicy(value: string): GenerationPolicy | null;
975
+ declare function parseGenerationPolicyFromEnv(env: EnvLike): GenerationPolicy | null;
976
+ declare function getAllowedGenerationModelIds(policy: GenerationPolicy | null): string[] | null;
977
+ declare function findGenerationModelPolicy(policy: GenerationPolicy | null, model: string): GenerationModelPolicy | null;
978
+ declare function assertGenerationRequestAllowedByPolicy(input: {
979
+ policy: GenerationPolicy | null;
980
+ model: string;
981
+ parameters?: Record<string, unknown>;
982
+ }): void;
983
+ declare function filterGenerationDeclarationsByPolicy<T extends PublicDeclaration>(declarations: T[], policy: GenerationPolicy | null): T[];
984
+ //#endregion
985
+ //#region ../protocol/src/generation/index.d.ts
986
+ declare const GENERATION_TASK_TYPE: "generation";
987
+ type CreateGenerationTaskRequest = {
988
+ spaceId: string;
989
+ sessionId?: string | null;
990
+ turnId?: string | null;
991
+ model: string;
992
+ content: GenerationContentBlock[];
993
+ parameters?: Record<string, unknown>;
994
+ meta?: Record<string, unknown>;
995
+ };
996
+ type CreateGenerationTaskResponse = {
997
+ taskRunId: string;
998
+ taskType: typeof GENERATION_TASK_TYPE;
999
+ status: "pending";
1000
+ billing?: BillingPayload | null;
1001
+ };
1002
+ /**
1003
+ * Final generation task payload stored on the task run.
1004
+ *
1005
+ * - `output` is the generated content blocks (SDK `GenerationResult.content`)
1006
+ * - `requestId` maps to the provider response body's top-level `request_id`
1007
+ * - `cost` maps to the official request price in `usage.cost`
1008
+ * - `billing` records post-success credit consumption (when attempted)
1009
+ * - `meta` is the request meta (including Cohub context such as taskRunId/spaceId)
1010
+ */
1011
+ type GenerationUsageBilling = {
1012
+ amountUsd: number;
1013
+ usageType: string;
1014
+ status: "recorded" | "overage" | "skipped";
1015
+ reason?: string | null;
1016
+ };
1017
+ type GenerationTaskResult = {
1018
+ model: string;
1019
+ output: GenerationContentBlock[];
1020
+ requestId?: string;
1021
+ cost?: number; /** Post-success usage charge metadata. Distinct from gate `billing` on create. */
1022
+ billing?: GenerationUsageBilling | null;
1023
+ meta?: Record<string, unknown>;
1024
+ };
1025
+ type PublicGenerationDeclaration = Omit<GenerationModelDeclaration, "adapter">;
1026
+ type ListGenerationModelsResponse = {
1027
+ models: PublicGenerationDeclaration[];
1028
+ };
1029
+ //#endregion
1030
+ //#region src/types.d.ts
1031
+ type ApiError = {
1032
+ message: string;
1033
+ };
1034
+ type UserProfile = {
1035
+ userUuid: string;
1036
+ logtoUserId?: string;
1037
+ username: string | null;
1038
+ displayName: string;
1039
+ avatarUrl: string | null;
1040
+ syncedAt?: string;
1041
+ };
1042
+ type PublicUserProfile = {
1043
+ userUuid: string;
1044
+ username: string | null;
1045
+ displayName: string;
1046
+ avatarUrl: string | null;
1047
+ };
1048
+ type BatchUserProfilesResponse = {
1049
+ profiles: Record<string, PublicUserProfile>;
1050
+ missingUserUuids: string[];
1051
+ };
1052
+ type SpacePresenceUser = {
1053
+ userId: string;
1054
+ connectionCount: number;
1055
+ lastSeenAt: string;
1056
+ meta: Record<string, unknown> | null;
1057
+ metas: Record<string, unknown>[];
1058
+ profile: PublicUserProfile;
1059
+ };
1060
+ type SpacePresenceSnapshot = {
1061
+ spaceId: string;
1062
+ users: SpacePresenceUser[];
1063
+ updatedAt: string;
1064
+ };
1065
+ type MeResponse = {
1066
+ uuid: string;
1067
+ profile: UserProfile;
1068
+ email: string | null;
1069
+ };
1070
+ type BillingPluginStatus = {
1071
+ provider: "disabled" | "talesofai";
1072
+ configured: boolean;
1073
+ reason?: string;
1074
+ };
1075
+ type BillingCreditUnit = {
1076
+ tokenType: string;
1077
+ displayCurrency: "USD";
1078
+ displayUnit: string;
1079
+ unitToUsd: number;
1080
+ unitsPerUsd: number;
1081
+ usdDecimalPlaces: number;
1082
+ };
1083
+ type BillingCreditGrantStatus = {
1084
+ id: string;
1085
+ tokenType: string;
1086
+ benefitKey: string | null;
1087
+ benefitName: string | null;
1088
+ grantKind: string | null;
1089
+ sourceType: string | null;
1090
+ sourceId: string | null;
1091
+ status: string;
1092
+ availableNow: boolean | null;
1093
+ unavailableReasons: string[];
1094
+ remainingAmount: number;
1095
+ remainingAmountUsd: number;
1096
+ originalAmount: number | null;
1097
+ originalAmountUsd: number | null;
1098
+ consumedAmount: number | null;
1099
+ consumedAmountUsd: number | null;
1100
+ usageConsumedAmount: number | null;
1101
+ usageConsumedAmountUsd: number | null;
1102
+ settledOverageAmount: number | null;
1103
+ settledOverageAmountUsd: number | null;
1104
+ consumedPercent: number | null;
1105
+ effectiveAt: string | null;
1106
+ expiresAt: string | null;
1107
+ daysRemaining: number | null;
1108
+ createdAt: string;
1109
+ };
1110
+ type BillingCreditExpiryGroup = {
1111
+ key: "expired" | "lt_7d" | "lt_30d" | "gte_30d" | "never";
1112
+ remainingAmountUsd: number;
1113
+ grants: BillingCreditGrantStatus[];
1114
+ };
1115
+ type BillingCreditStatus = {
1116
+ netUsd: number;
1117
+ groups: BillingCreditExpiryGroup[];
1118
+ };
1119
+ type BillingProductKind = "plan" | "addon";
1120
+ type BillingProductBillingInterval = "monthly" | "quarterly" | "yearly" | "one_time" | "other";
1121
+ type BillingProductPricing = {
1122
+ amountMinor: number;
1123
+ amountUsd: number;
1124
+ compareAtAmountMinor: number | null;
1125
+ compareAtAmountUsd: number | null;
1126
+ discountLabel: string | null;
1127
+ discountRate: number | null;
1128
+ };
1129
+ type BillingProductDisplay = {
1130
+ description: string | null;
1131
+ benefits: string[];
1132
+ creditsAmount: number | null;
1133
+ validity: string | null;
1134
+ creditBenefits: BillingProductCreditBenefit[];
1135
+ };
1136
+ type BillingProductCreditBenefit = {
1137
+ key: string;
1138
+ name: string;
1139
+ tokenType: string;
1140
+ grantKind: string;
1141
+ scope: string;
1142
+ cycleAmount: number;
1143
+ cycleAmountUsd: number;
1144
+ periodAmount: number;
1145
+ periodAmountUsd: number;
1146
+ expiresInDays: number | null;
1147
+ };
1148
+ type BillingCatalogProduct = {
1149
+ id: string;
1150
+ key: string;
1151
+ name: string;
1152
+ description: string | null;
1153
+ status: string;
1154
+ visibility: string;
1155
+ billingType: string;
1156
+ billingPeriod: string;
1157
+ billingIntervalCount: number;
1158
+ currency: string;
1159
+ kind: BillingProductKind;
1160
+ interval: BillingProductBillingInterval;
1161
+ pricing: BillingProductPricing;
1162
+ display: BillingProductDisplay;
1163
+ isDefaultPlan: boolean;
1164
+ };
1165
+ type SpaceCommerceFeatureBenefit = {
1166
+ key: string;
1167
+ name: string;
1168
+ description: string | null;
1169
+ status: string;
1170
+ type: "feature";
1171
+ config: {
1172
+ type: "feature";
1173
+ metadata: Record<string, string | number | boolean>;
1174
+ };
1175
+ };
1176
+ type SpaceCommerceCreditsBenefit = {
1177
+ key: string;
1178
+ name: string;
1179
+ description: string | null;
1180
+ status: string;
1181
+ type: "credits";
1182
+ config: {
1183
+ type: "credits";
1184
+ amount: number;
1185
+ expiresInDays: number | null;
1186
+ };
1187
+ };
1188
+ type SpaceCommerceBenefit = SpaceCommerceFeatureBenefit | SpaceCommerceCreditsBenefit;
1189
+ type SpaceCommerceProductCreditBenefit = {
1190
+ key: string;
1191
+ name: string;
1192
+ amount: number;
1193
+ expiresInDays: number | null;
1194
+ };
1195
+ type SpaceCommerceProduct = {
1196
+ id: string;
1197
+ key: string;
1198
+ name: string;
1199
+ description: string | null;
1200
+ status: string;
1201
+ visibility: string;
1202
+ billingType: string;
1203
+ billingPeriod: string;
1204
+ billingIntervalCount: number;
1205
+ currency: string;
1206
+ kind: "addon";
1207
+ interval: "one_time";
1208
+ pricing: {
1209
+ amountMinor: number;
1210
+ amountUsd: number;
1211
+ compareAtAmountMinor: number | null;
1212
+ compareAtAmountUsd: number | null;
1213
+ discountLabel: string | null;
1214
+ discountRate: number | null;
1215
+ };
1216
+ display: {
1217
+ description: string | null;
1218
+ benefits: string[];
1219
+ creditsAmount: number | null;
1220
+ validity: string | null;
1221
+ creditBenefits: SpaceCommerceProductCreditBenefit[];
1222
+ };
1223
+ isDefaultPlan: boolean;
1224
+ };
1225
+ type SpaceCommerceProductBenefitBinding = {
1226
+ id: string | null;
1227
+ productKey: string;
1228
+ benefitKey: string;
1229
+ createdAt: string | null;
1230
+ };
1231
+ type SpaceCommerceBuyerProfile = {
1232
+ displayName: string;
1233
+ avatarUrl: string | null;
1234
+ };
1235
+ type SpaceCommerceOrder = {
1236
+ id: string;
1237
+ productKeySnapshot: string;
1238
+ productNameSnapshot: string;
1239
+ status: string;
1240
+ amountSnapshot: number;
1241
+ paidAmountSnapshot: number;
1242
+ createdAt: string;
1243
+ paidAt: string | null;
1244
+ buyerProfile: SpaceCommerceBuyerProfile | null;
1245
+ };
1246
+ type BillingSubscriptionSummary = {
1247
+ id: string;
1248
+ productKey: string | null;
1249
+ productName: string | null;
1250
+ status: string;
1251
+ currentPeriodStart: string | null;
1252
+ currentPeriodEnd: string | null;
1253
+ cancelAtPeriodEnd: boolean;
1254
+ };
1255
+ type BillingPaymentStatus = {
1256
+ available: boolean;
1257
+ reason: string | null;
1258
+ };
1259
+ type BillingCatalog = {
1260
+ userId: string;
1261
+ billing: BillingPluginStatus;
1262
+ payment: BillingPaymentStatus;
1263
+ products: BillingCatalogProduct[];
1264
+ plans: BillingCatalogProduct[];
1265
+ addons: BillingCatalogProduct[];
1266
+ currentSubscriptions: BillingSubscriptionSummary[];
1267
+ hasActiveSubscription: boolean;
1268
+ defaultPlanProductKey: string | null;
1269
+ };
1270
+ type BillingHistoryPagination = {
1271
+ hasMore: boolean;
1272
+ nextPage: number | null;
1273
+ };
1274
+ type BillingCheckoutActionState = {
1275
+ canPay: boolean;
1276
+ checkoutUrl: string | null;
1277
+ checkoutUsable: boolean;
1278
+ canCancelCheckout: boolean;
1279
+ canCancelAutoRenew: boolean;
1280
+ unavailableReason: string | null;
1281
+ };
1282
+ type BillingSubscriptionHistoryStatus = {
1283
+ id: string;
1284
+ externalUserId: string;
1285
+ productKey: string;
1286
+ productName: string;
1287
+ status: string;
1288
+ amountMinor: number;
1289
+ amountUsd: number;
1290
+ paidAmountMinor: number;
1291
+ paidAmountUsd: number;
1292
+ currency: string;
1293
+ billingPeriod: string;
1294
+ billingIntervalCount: number;
1295
+ currentPeriodStart: string | null;
1296
+ currentPeriodEnd: string | null;
1297
+ cancelAtPeriodEnd: boolean;
1298
+ canceledAt: string | null;
1299
+ checkoutExpiresAt: string | null;
1300
+ checkoutCanceledAt: string | null;
1301
+ checkoutExpiredAt: string | null;
1302
+ paymentConflictedAt: string | null;
1303
+ endedAt: string | null;
1304
+ createdAt: string;
1305
+ updatedAt: string;
1306
+ providerStatus: string | null;
1307
+ providerTerminal: boolean;
1308
+ checkoutStatus: string | null;
1309
+ actions: BillingCheckoutActionState;
1310
+ };
1311
+ type BillingSubscriptionHistoryList = {
1312
+ userId: string;
1313
+ billing: BillingPluginStatus;
1314
+ page: number;
1315
+ limit: number;
1316
+ items: BillingSubscriptionHistoryStatus[];
1317
+ pagination: BillingHistoryPagination;
1318
+ };
1319
+ type BillingCheckoutResult = {
1320
+ userId: string;
1321
+ billing: BillingPluginStatus;
1322
+ payment: BillingPaymentStatus;
1323
+ productKey: string;
1324
+ checkoutUrl: string | null;
1325
+ checkoutUsable: boolean;
1326
+ message: string | null;
1327
+ orderId: string | null;
1328
+ subscriptionId: string | null;
1329
+ reused: boolean;
1330
+ };
1331
+ type BillingRedemptionResult = {
1332
+ userId: string;
1333
+ billing: BillingPluginStatus;
1334
+ redeemed: boolean;
1335
+ message: string | null;
1336
+ redemptionRecordId: string | null;
1337
+ itemCount: number;
1338
+ };
1339
+ type BillingConversionIntent = {
1340
+ level: "soft" | "hard";
1341
+ reason: "negative_balance" | "negative_balance_limit_exceeded" | "feature_not_entitled";
1342
+ audience: "free" | "paid" | "unknown";
1343
+ preferredOfferKind: "plan" | "upgrade" | "addon" | "mixed";
1344
+ title: string;
1345
+ message: string;
1346
+ primaryAction: {
1347
+ label: string;
1348
+ action: "open_billing_conversion";
1349
+ };
1350
+ source: string;
1351
+ };
1352
+ /**
1353
+ * Standard `billing` payload on 402 error bodies and soft-warning success
1354
+ * responses. `conversion` drives the shared upgrade UI.
1355
+ */
1356
+ type BillingResponsePayload = {
1357
+ conversion: BillingConversionIntent;
1358
+ status?: "blocked" | "allowed_with_debt";
1359
+ netUsd?: number;
1360
+ hardNegativeLimitUsd?: number;
1361
+ };
1362
+ type BillingBalanceActivityKind = "grant" | "usage" | "refund" | "expire" | "revoke" | "adjust";
1363
+ type BillingBalanceActivityStatus = "covered" | "overage" | "partial" | null;
1364
+ type BillingBalanceActivity = {
1365
+ id: string;
1366
+ kind: BillingBalanceActivityKind;
1367
+ tokenType: string;
1368
+ title: string;
1369
+ description: string | null;
1370
+ sourceType: string | null;
1371
+ sourceId: string | null;
1372
+ operationId: string | null;
1373
+ amountUsd: number;
1374
+ status: BillingBalanceActivityStatus;
1375
+ createdAt: string;
1376
+ };
1377
+ type BillingBalanceActivityList = {
1378
+ userId: string;
1379
+ billing: BillingPluginStatus;
1380
+ tokenType: string;
1381
+ unit: BillingCreditUnit;
1382
+ page: number;
1383
+ limit: number;
1384
+ items: BillingBalanceActivity[];
1385
+ pagination: BillingHistoryPagination;
1386
+ };
1387
+ type UserRulesResponse = {
1388
+ content: string;
1389
+ updatedAt: string | null;
1390
+ source: "config-space";
1391
+ path: string;
1392
+ };
1393
+ type SpaceFsEntry = {
1394
+ name: string;
1395
+ path: string;
1396
+ type: "file" | "dir" | "symlink";
1397
+ size: number;
1398
+ mimeType: string | null;
1399
+ mtimeMs: number;
1400
+ };
1401
+ type SpaceFsTreeResponse = {
1402
+ path: string;
1403
+ entries: SpaceFsEntry[];
1404
+ };
1405
+ type SpaceFsFileKind = "text" | "binary";
1406
+ type SpaceFsEncoding = "utf-8" | "base64";
1407
+ type SpaceFsFileResponse = {
1408
+ path: string;
1409
+ name: string;
1410
+ size: number;
1411
+ mimeType: string | null;
1412
+ mtimeMs: number;
1413
+ kind: SpaceFsFileKind;
1414
+ encoding: SpaceFsEncoding;
1415
+ content: string;
1416
+ delivery?: "inline" | "url";
1417
+ url?: string;
1418
+ };
1419
+ type SpaceFsReadFilesInput = {
1420
+ paths: string[];
1421
+ };
1422
+ type SpaceFsReadFilesError = {
1423
+ path: string;
1424
+ code: string;
1425
+ message: string;
1426
+ status: number;
1427
+ };
1428
+ type SpaceFsPreparingFile = {
1429
+ path: string;
1430
+ name: string;
1431
+ size: number;
1432
+ mimeType: string | null;
1433
+ mtimeMs: number;
1434
+ retryAfterMs: number;
1435
+ };
1436
+ type SpaceFsReadFilesResponse = {
1437
+ files: SpaceFsFileResponse[];
1438
+ preparing?: SpaceFsPreparingFile[];
1439
+ errors: SpaceFsReadFilesError[];
1440
+ };
1441
+ type SpaceFsWriteFileInput = {
1442
+ path: string;
1443
+ content: string;
1444
+ encoding: SpaceFsEncoding;
1445
+ };
1446
+ type SpaceFsMoveInput = {
1447
+ fromPath: string;
1448
+ toPath: string;
1449
+ };
1450
+ type SpaceFsUploadEntry = {
1451
+ path: string;
1452
+ name: string;
1453
+ size: number;
1454
+ mimeType: string | null;
1455
+ mtimeMs: number;
1456
+ };
1457
+ type SpaceFsUploadError = {
1458
+ name: string;
1459
+ code: "file_too_large" | "name_invalid" | "path_invalid" | "write_failed" | "object_missing";
1460
+ message: string;
1461
+ };
1462
+ type SpaceFsUploadResponse = {
1463
+ uploaded: SpaceFsUploadEntry[];
1464
+ errors: SpaceFsUploadError[];
1465
+ };
1466
+ type SpaceFsUploadPlanEntryInput = {
1467
+ id: string;
1468
+ name: string;
1469
+ relativePath: string;
1470
+ size: number;
1471
+ mimeType?: string | null;
1472
+ lastModified?: number;
1473
+ };
1474
+ type SpaceFsUploadDestination = {
1475
+ kind: "workspace";
1476
+ targetDir?: string;
1477
+ } | {
1478
+ kind: "sandbox_tmp";
1479
+ sessionId: string;
1480
+ };
1481
+ type SpaceFsCreateUploadInput = {
1482
+ destination: SpaceFsUploadDestination;
1483
+ entries: SpaceFsUploadPlanEntryInput[];
1484
+ };
1485
+ type SpaceFsUploadPlanEntry = {
1486
+ id: string;
1487
+ objectKey: string;
1488
+ uploadUrl: string;
1489
+ headers?: Record<string, string>;
1490
+ };
1491
+ type SpaceFsCreateUploadResponse = {
1492
+ uploadId: string;
1493
+ expiresAt: string;
1494
+ entries: SpaceFsUploadPlanEntry[];
1495
+ };
1496
+ type SpaceFsCompleteUploadInput = {
1497
+ entries: Array<{
1498
+ id: string;
1499
+ etag?: string | null;
1500
+ }>;
1501
+ };
1502
+ type SpaceFsCompleteUploadResponse = {
1503
+ ok: true;
1504
+ uploaded: SpaceFsUploadEntry[];
1505
+ };
1506
+ type SpaceFsUploadProgress = {
1507
+ phase: "queued" | "importing" | "done" | "failed";
1508
+ totalFiles: number;
1509
+ importedFiles: number;
1510
+ totalBytes: number;
1511
+ importedBytes: number;
1512
+ currentPath?: string;
1513
+ errors: SpaceFsUploadError[];
1514
+ };
1515
+ type SessionBindingRecord = SessionBindingRecord$1;
1516
+ type SessionRecord = SessionRecord$1 & {
1517
+ bindings?: SessionBindingRecord[];
1518
+ totalMessages?: number;
1519
+ totalToolCalls?: number;
1520
+ totalInputTokens?: number;
1521
+ totalOutputTokens?: number;
1522
+ totalCost?: string | number | null;
1523
+ };
1524
+ type JsonPrimitive = string | number | boolean | null;
1525
+ type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
1526
+ type JsonObject = {
1527
+ [key: string]: JsonValue;
1528
+ };
1529
+ type SpaceSandboxAutoDestroyPolicy = {
1530
+ mode: "idle";
1531
+ ttlSeconds: number;
1532
+ } | {
1533
+ mode: "never";
1534
+ };
1535
+ type SpaceSandboxProvider = "cloud" | "local";
1536
+ type SandboxSpecId = "standard" | "boost" | "ultra";
1537
+ type SpaceSandboxConfig = {
1538
+ provider?: SpaceSandboxProvider;
1539
+ autoDestroy: SpaceSandboxAutoDestroyPolicy;
1540
+ spec?: SandboxSpecId;
1541
+ appliedSpec?: SandboxSpecId | null;
1542
+ specPendingRestart?: boolean;
1543
+ allowedSpec?: SandboxSpecId;
1544
+ specs?: Record<string, unknown>;
1545
+ };
1546
+ type SpaceConfig = {
1547
+ sandbox?: SpaceSandboxConfig;
1548
+ };
1549
+ type SpacePublicProfile = {
1550
+ avatarUrl: string | null;
1551
+ };
1552
+ type SpaceMeta = JsonObject & {
1553
+ config?: SpaceConfig;
1554
+ extraEnv?: SpaceEnvInput[];
1555
+ publicProfile?: Partial<SpacePublicProfile> | null;
1556
+ };
1557
+ type SpaceRecord = {
1558
+ id: string;
1559
+ userUuid: string;
1560
+ name: string | null;
1561
+ slug: string | null;
1562
+ description: string | null;
1563
+ storageRepoName?: string | null;
1564
+ baseCheckpointId?: string | null;
1565
+ headCheckpointId?: string | null;
1566
+ title: string | null;
1567
+ status: string | null;
1568
+ meta: SpaceMeta | null;
1569
+ publicProfile?: SpacePublicProfile;
1570
+ createdAt: string;
1571
+ updatedAt: string;
1572
+ lastActivityAt?: string | null;
1573
+ channels?: {
1574
+ id: string;
1575
+ name: string | null;
1576
+ provider: string;
1577
+ status: string;
1578
+ }[];
1579
+ access?: SpaceAccess;
1580
+ accessLevel?: "minimal";
1581
+ ownerProfile?: Pick<UserProfile, "userUuid" | "username" | "displayName" | "avatarUrl"> | null;
1582
+ };
1583
+ type SpaceBootstrapSource = {
1584
+ type: "blank";
1585
+ } | {
1586
+ type: "git_repo";
1587
+ repoUrl?: string;
1588
+ ref?: string | null;
1589
+ } | {
1590
+ type: "checkpoint";
1591
+ checkpointId: string;
1592
+ };
1593
+ type SpaceConfigInput = {
1594
+ sandbox?: {
1595
+ provider?: SpaceSandboxProvider;
1596
+ autoDestroy?: SpaceSandboxAutoDestroyPolicy;
1597
+ spec?: SandboxSpecId;
1598
+ };
1599
+ };
1600
+ type CreateSpaceModInput = {
1601
+ modSpaceId: string;
1602
+ name?: string | null;
1603
+ mountSlug?: string | null;
1604
+ enabled?: boolean;
1605
+ };
1606
+ type CreateSpaceInput = {
1607
+ name?: string;
1608
+ slug?: string | null;
1609
+ description?: string | null;
1610
+ source?: string;
1611
+ extraEnv?: SpaceEnvInput[];
1612
+ channelBindings?: SpaceChannelBindingInput[];
1613
+ mods?: CreateSpaceModInput[];
1614
+ bootstrapSource?: SpaceBootstrapSource;
1615
+ config?: SpaceConfigInput;
1616
+ };
1617
+ type SpaceConfigResponse = {
1618
+ config: Required<Pick<SpaceConfig, "sandbox">>;
1619
+ };
1620
+ type SpaceConfigUpdateResponse = {
1621
+ space: SpaceRecord;
1622
+ sandbox?: {
1623
+ resized?: boolean;
1624
+ applying?: boolean;
1625
+ pendingRestart?: boolean;
1626
+ appliedSpec?: SandboxSpecId;
1627
+ skipped?: boolean;
1628
+ message?: string;
1629
+ };
1630
+ };
1631
+ type CanvasDocumentRecord = {
1632
+ id: string;
1633
+ spaceId: string;
1634
+ filePath: string;
1635
+ title: string;
1636
+ version: number;
1637
+ meta?: Record<string, unknown> | null;
1638
+ createdAt: string | null;
1639
+ updatedAt: string | null;
1640
+ deletedAt?: string | null;
1641
+ };
1642
+ type CanvasNodeRecord = {
1643
+ documentId: string;
1644
+ nodeId: string;
1645
+ type: string;
1646
+ parentId?: string | null;
1647
+ orderKey?: string | null;
1648
+ x: number;
1649
+ y: number;
1650
+ width: number;
1651
+ height: number;
1652
+ rotation: number;
1653
+ refKind?: string | null;
1654
+ refPath?: string | null;
1655
+ refUrl?: string | null;
1656
+ view: Record<string, unknown>;
1657
+ style: Record<string, unknown>;
1658
+ animation: Record<string, unknown>;
1659
+ data: Record<string, unknown>;
1660
+ version: number;
1661
+ createdAt: string | null;
1662
+ updatedAt: string | null;
1663
+ deletedAt?: string | null;
1664
+ };
1665
+ type CanvasNodeInput = Omit<CanvasNodeRecord, "documentId" | "version" | "createdAt" | "updatedAt" | "deletedAt">;
1666
+ type CanvasSemanticOp = {
1667
+ opId?: string;
1668
+ type: "node.create" | "node.patch" | "node.delete";
1669
+ payload: Record<string, unknown>;
1670
+ inverse?: Record<string, unknown>;
1671
+ };
1672
+ type CanvasTransactionInput = {
1673
+ txId: string;
1674
+ baseVersion?: number | null;
1675
+ clientId?: string | null;
1676
+ undoGroupId?: string | null;
1677
+ ops: CanvasSemanticOp[];
1678
+ };
1679
+ type CanvasCreateInput = {
1680
+ path: string;
1681
+ title?: string;
1682
+ nodes?: CanvasNodeInput[];
1683
+ };
1684
+ type CanvasBootstrapResponse = {
1685
+ document: CanvasDocumentRecord;
1686
+ nodes: CanvasNodeRecord[];
1687
+ };
1688
+ type SpaceCreateResponse = {
1689
+ space: SpaceRecord;
1690
+ taskRunId: string;
1691
+ };
1692
+ type SpaceDefaultResponse = {
1693
+ space: SpaceRecord | null;
1694
+ };
1695
+ type SpaceListItem = SpaceRecord;
1696
+ type SessionMessagesResponse = {
1697
+ session: SessionRecord;
1698
+ messages: MessageRecord[];
1699
+ };
1700
+ type SessionMessageResponse = {
1701
+ session: SessionRecord;
1702
+ message: MessageRecord;
1703
+ };
1704
+ type SessionMessagesPaginatedResponse = {
1705
+ session: SessionRecord;
1706
+ messages: MessageRecord[];
1707
+ hasMore: boolean;
1708
+ nextCursor: number | undefined;
1709
+ };
1710
+ type SessionTurnsPaginatedResponse = {
1711
+ session: SessionRecord;
1712
+ turns: SessionTurnRecord[];
1713
+ hasMore: boolean;
1714
+ nextCursor: number | undefined;
1715
+ };
1716
+ type SessionTurnIndexResponse = {
1717
+ session: SessionRecord;
1718
+ turns: SessionTurnIndexItem[];
1719
+ hasMore: boolean;
1720
+ nextCursor: number | undefined;
1721
+ };
1722
+ type SessionTurnWindowResponse = {
1723
+ session: SessionRecord;
1724
+ turns: SessionTurnRecord[];
1725
+ hasMoreOlder: boolean;
1726
+ hasMoreNewer: boolean;
1727
+ oldestCursor: number | undefined;
1728
+ newestCursor: number | undefined;
1729
+ anchorSequence: number | undefined;
1730
+ };
1731
+ type SessionTurnResponse = {
1732
+ session: SessionRecord;
1733
+ turn: SessionTurnRecord;
1734
+ billing?: BillingResponsePayload | null;
1735
+ };
1736
+ type SessionTurnSignedUrlsResponse = {
1737
+ urls: Record<string, string>;
1738
+ };
1739
+ type SessionTurnStreamSnapshotResponse = {
1740
+ snapshot: {
1741
+ version: 2;
1742
+ spaceId: string;
1743
+ sessionId: string;
1744
+ turnId: string | null;
1745
+ anchorUserMessageId: string | null;
1746
+ seq: number;
1747
+ current: {
1748
+ messageId: string | null;
1749
+ messageOrdinal: number | null;
1750
+ content: ContentBlock[];
1751
+ appendPath: string | null;
1752
+ };
1753
+ intermediateMessages: Array<{
1754
+ messageId: string | null;
1755
+ messageOrdinal: number | null;
1756
+ content: ContentBlock[];
1757
+ id?: string;
1758
+ sessionId?: string;
1759
+ role?: "user" | "assistant" | "system";
1760
+ text?: string | null;
1761
+ provider?: string | null;
1762
+ model?: string | null;
1763
+ stopReason?: string | null;
1764
+ errorMessage?: string | null;
1765
+ usage?: Usage | null;
1766
+ toolCallsObjectKey?: string | null;
1767
+ meta?: Record<string, unknown> | null;
1768
+ createdAt?: string;
1769
+ }>;
1770
+ lifecycle?: {
1771
+ phase: "llm_call_started";
1772
+ llmRound: number;
1773
+ provider: string | null;
1774
+ model: string | null;
1775
+ at: string;
1776
+ } | null;
1777
+ updatedAt: number;
1778
+ } | null;
1779
+ };
1780
+ type ModelCatalogEntry = {
1781
+ provider: string;
1782
+ id: string;
1783
+ model: Record<string, unknown>;
1784
+ };
1785
+ type PromptTemplateCatalogEntry = {
1786
+ name: string;
1787
+ description: string;
1788
+ argumentHint?: string;
1789
+ category?: string;
1790
+ scope: "platform" | "mod" | "user" | "project";
1791
+ };
1792
+ type PromptTemplateCatalogResponse = {
1793
+ prompts: PromptTemplateCatalogEntry[];
1794
+ };
1795
+ type Channel = {
1796
+ id: string;
1797
+ userUuid: string;
1798
+ provider: string;
1799
+ name: string;
1800
+ status: string;
1801
+ createdAt: string;
1802
+ updatedAt: string;
1803
+ boundSpace: {
1804
+ id: string;
1805
+ title: string | null;
1806
+ status: string;
1807
+ } | null;
1808
+ health?: ChannelHealth | null;
1809
+ };
1810
+ type SpaceEnvInput = {
1811
+ name: string;
1812
+ value: string;
1813
+ };
1814
+ type SpaceChannelBindingInput = {
1815
+ channelId: string;
1816
+ config?: ChannelConfig | null;
1817
+ };
1818
+ type GlobalSearchType = "turn" | "session" | "space" | "label";
1819
+ type GlobalSearchResult = {
1820
+ type: GlobalSearchType;
1821
+ id: string;
1822
+ spaceId: string;
1823
+ sessionId: string | null;
1824
+ turnId: string | null;
1825
+ sequence: number | null;
1826
+ title: string;
1827
+ excerpt?: string | null;
1828
+ spaceName?: string | null;
1829
+ sessionTitle?: string | null;
1830
+ ownerProfile?: Pick<UserProfile, "userUuid" | "username" | "displayName" | "avatarUrl"> | null;
1831
+ spaceProfile?: SpacePublicProfile | null;
1832
+ matchedField: "userText" | "title" | "name" | "description" | "labelName" | "labelItemContent";
1833
+ href: string;
1834
+ score: number;
1835
+ textScore: number;
1836
+ recencyScore: number;
1837
+ typePriorityScore: number;
1838
+ membershipPriorityScore?: number;
1839
+ labelRef?: string | null;
1840
+ labelName?: string | null;
1841
+ labelResourceType?: LabelResourceType | null;
1842
+ labelResourceRef?: string | null;
1843
+ updatedAt: string | null;
1844
+ source: "remote";
1845
+ };
1846
+ type GlobalSearchResponse = {
1847
+ items: GlobalSearchResult[];
1848
+ query: string;
1849
+ source: "remote";
1850
+ degraded?: boolean;
1851
+ };
1852
+ type CreateSpaceSessionInput = {
1853
+ title?: string | null;
1854
+ source?: string | null;
1855
+ labelRefs?: string[];
1856
+ };
1857
+ type SpaceSessionsResponse = {
1858
+ sessions: SessionRecord[];
1859
+ forks?: Array<SessionForkRecord & {
1860
+ firstUserTextAfterFork?: string | null;
1861
+ parentTitle?: string | null;
1862
+ }>;
1863
+ pageInfo?: {
1864
+ hasMore: boolean;
1865
+ nextCursor: string | null;
1866
+ };
1867
+ };
1868
+ type PromptAccessMode = "read_only" | "full_access";
1869
+ type CreateSpacePromptInput = {
1870
+ sessionId?: string | null;
1871
+ title?: string | null;
1872
+ source?: string | null;
1873
+ content: ContentBlock[];
1874
+ model?: string | null;
1875
+ provider?: string | null;
1876
+ clientMessageId?: string | null;
1877
+ generationPolicy?: GenerationPolicy | null;
1878
+ intent?: "followup" | "steer" | "compact" | null;
1879
+ accessMode?: PromptAccessMode | null;
1880
+ env?: Record<string, string> | null;
1881
+ labelRefs?: string[];
1882
+ schedule?: {
1883
+ mode?: "immediate";
1884
+ } | {
1885
+ mode: "delay";
1886
+ delayMs: number;
1887
+ } | {
1888
+ mode: "at";
1889
+ sendAt: string;
1890
+ } | {
1891
+ mode: "repeat";
1892
+ cronExpression: string;
1893
+ timezone: string;
1894
+ };
1895
+ };
1896
+ type CreateSpacePromptResponse = (SessionTurnResponse & {
1897
+ mode: "immediate";
1898
+ }) | {
1899
+ mode: "delay" | "at";
1900
+ taskRunId: string;
1901
+ scheduledAt: string;
1902
+ sessionId: string | null;
1903
+ } | {
1904
+ mode: "repeat";
1905
+ cronJobId: string;
1906
+ nextRunAt: string;
1907
+ timezone: string;
1908
+ sessionId: string | null;
1909
+ };
1910
+ type CronJobPayload = Record<string, unknown>;
1911
+ type SendMessageCronJobPayload = CronJobPayload & {
1912
+ content: ContentBlock[];
1913
+ clientMessageId?: string;
1914
+ generationPolicy?: unknown;
1915
+ intent?: "followup" | "steer" | string;
1916
+ accessMode?: "read_only" | "full_access";
1917
+ env?: Record<string, string> | null;
1918
+ source?: string;
1919
+ sessionId?: string;
1920
+ title?: string;
1921
+ model?: string;
1922
+ provider?: string;
1923
+ labelIds?: string[];
1924
+ };
1925
+ type CronJobUpdatePatch<TPayload extends CronJobPayload = CronJobPayload> = {
1926
+ title?: string;
1927
+ payload?: TPayload;
1928
+ cronExpression?: string;
1929
+ timezone?: string;
1930
+ enabled?: boolean;
1931
+ };
1932
+ type CursorPageInfo = {
1933
+ hasMore: boolean;
1934
+ nextCursor: string | null;
1935
+ };
1936
+ type CronJobRecord<TPayload extends CronJobPayload = CronJobPayload> = {
1937
+ id: string;
1938
+ userUuid: string;
1939
+ userProfile?: UserProfile;
1940
+ title: string;
1941
+ taskType: string;
1942
+ payload: TPayload;
1943
+ cronExpression: string;
1944
+ timezone: string;
1945
+ bullJobKey: string;
1946
+ spaceId: string | null;
1947
+ sessionId: string | null;
1948
+ enabled: boolean;
1949
+ createdAt: string;
1950
+ updatedAt: string;
1951
+ };
1952
+ type TaskRunDetailResponse = {
1953
+ run: TaskRunRecord;
1954
+ progress: unknown;
1955
+ };
1956
+ type TaskRunRecord = {
1957
+ id: string;
1958
+ jobId: string;
1959
+ cronJobId: string | null;
1960
+ taskType: string;
1961
+ status: "pending" | "running" | "completed" | "failed";
1962
+ payload: unknown;
1963
+ result: unknown;
1964
+ errorMessage: string | null;
1965
+ attemptCount: number;
1966
+ spaceId: string | null;
1967
+ sessionId: string | null;
1968
+ turnId: string | null;
1969
+ userUuid: string | null;
1970
+ userProfile?: UserProfile;
1971
+ scheduledAt: string | null;
1972
+ startedAt: string | null;
1973
+ finishedAt: string | null;
1974
+ createdAt: string;
1975
+ updatedAt: string;
1976
+ };
1977
+ type CheckpointRecord = {
1978
+ id: string;
1979
+ spaceId: string;
1980
+ commitHash: string;
1981
+ description: string;
1982
+ parentCheckpointId: string | null;
1983
+ rootCheckpointId?: string | null;
1984
+ forkCount: number;
1985
+ saveVersion?: number;
1986
+ meta?: Record<string, unknown> | null;
1987
+ createdAt: string;
1988
+ };
1989
+ type SpaceCheckpointDetailResponse = {
1990
+ checkpoint: CheckpointRecord;
1991
+ };
1992
+ type CheckpointDiffStatus = "A" | "M" | "D" | "R" | "C" | "T";
1993
+ type CheckpointDiffStats = {
1994
+ changedFileCount: number;
1995
+ addedFileCount: number;
1996
+ modifiedFileCount: number;
1997
+ deletedFileCount: number;
1998
+ renamedFileCount: number;
1999
+ copiedFileCount: number;
2000
+ additions: number;
2001
+ deletions: number;
2002
+ };
2003
+ type CheckpointDiffFile = {
2004
+ status: CheckpointDiffStatus;
2005
+ path: string;
2006
+ oldPath?: string | null;
2007
+ additions: number | null;
2008
+ deletions: number | null;
2009
+ binary: boolean;
2010
+ asset: boolean;
2011
+ };
2012
+ type CheckpointDiffDelivery = "inline" | "url";
2013
+ type CheckpointDiffSummary = {
2014
+ baseCheckpointId: string | null;
2015
+ baseCommitHash: string | null;
2016
+ headCheckpointId: string;
2017
+ headCommitHash: string;
2018
+ files: CheckpointDiffFile[];
2019
+ truncated: boolean;
2020
+ stats: CheckpointDiffStats;
2021
+ delivery?: CheckpointDiffDelivery;
2022
+ url?: string;
2023
+ precomputed?: boolean;
2024
+ };
2025
+ type CheckpointDiffPatchKind = "text" | "binary" | "asset" | "too_large" | "unavailable";
2026
+ type CheckpointDiffPatchLine = {
2027
+ type: "context" | "add" | "del" | "hunk" | "meta";
2028
+ text: string;
2029
+ };
2030
+ type CheckpointDiffFileResponse = {
2031
+ path: string;
2032
+ oldPath?: string | null;
2033
+ status: CheckpointDiffStatus | null;
2034
+ kind: CheckpointDiffPatchKind;
2035
+ binary: boolean;
2036
+ asset: boolean;
2037
+ additions: number | null;
2038
+ deletions: number | null;
2039
+ oldSize?: number | null;
2040
+ newSize?: number | null;
2041
+ truncated: boolean;
2042
+ lines: CheckpointDiffPatchLine[];
2043
+ delivery?: CheckpointDiffDelivery;
2044
+ url?: string;
2045
+ precomputed?: boolean;
2046
+ };
2047
+ type SpacePendingDiffSummary = {
2048
+ baseCheckpointId: string | null;
2049
+ files: CheckpointDiffFile[];
2050
+ truncated: boolean;
2051
+ incomplete: boolean;
2052
+ stats: CheckpointDiffStats;
2053
+ };
2054
+ type SpacePendingDiffFileResponse = CheckpointDiffFileResponse & {
2055
+ baseCheckpointId: string | null;
2056
+ };
2057
+ type SpaceRole = "host" | "builder" | "guest";
2058
+ type SpaceMember = {
2059
+ userId: string;
2060
+ role: SpaceRole;
2061
+ profile: UserProfile;
2062
+ createdAt: string;
2063
+ updatedAt: string;
2064
+ };
2065
+ type LabelScopeType = "space" | "user" | "org";
2066
+ type LabelSource = "user" | "system";
2067
+ type LabelResourceType = "session" | "checkpoint" | "file";
2068
+ type LabelRecord = {
2069
+ id: string;
2070
+ scopeType: LabelScopeType;
2071
+ scopeId: string;
2072
+ name: string;
2073
+ slug: string;
2074
+ parentId: string | null;
2075
+ depth: number;
2076
+ source: LabelSource;
2077
+ systemKey: string | null;
2078
+ rank: number;
2079
+ createdBy: string | null;
2080
+ createdAt: string | null;
2081
+ updatedAt: string | null;
2082
+ };
2083
+ type LabelListItem = LabelRecord & {
2084
+ children?: LabelListItem[];
2085
+ };
2086
+ type LabelAssignmentRecord = {
2087
+ id: string;
2088
+ labelId: string;
2089
+ scopeType: LabelScopeType;
2090
+ scopeId: string;
2091
+ resourceType: LabelResourceType;
2092
+ resourceRef: string;
2093
+ rank: number | null;
2094
+ source: LabelSource;
2095
+ createdBy: string | null;
2096
+ meta: Record<string, unknown> | null;
2097
+ createdAt: string | null;
2098
+ updatedAt: string | null;
2099
+ };
2100
+ type LabelAssignmentListItem = LabelAssignmentRecord & {
2101
+ href: string;
2102
+ resource: {
2103
+ title: string;
2104
+ subtitle: string | null;
2105
+ status: string | null;
2106
+ } | null;
2107
+ };
2108
+ type LabelAssignmentPageInfo = {
2109
+ hasMore: boolean;
2110
+ nextCursor: string | null;
2111
+ };
2112
+ /** Optional hydrated session previews for label item pages (avoids N+1 session detail fetches). */
2113
+ type LabelItemsSessionFork = SessionForkRecord & {
2114
+ firstUserTextAfterFork?: string | null;
2115
+ parentTitle?: string | null;
2116
+ };
2117
+ type LabelItemsResponse = {
2118
+ items: LabelAssignmentListItem[];
2119
+ pageInfo: LabelAssignmentPageInfo; /** Hydrated sessions for this page (optional for older servers). */
2120
+ sessions?: SessionRecord[]; /** Fork edges for page sessions (optional for older servers). */
2121
+ forks?: LabelItemsSessionFork[];
2122
+ };
2123
+ type PatchResourceLabelsInput = {
2124
+ addLabelRefs?: string[];
2125
+ removeLabelRefs?: string[];
2126
+ };
2127
+ type ResourceLabelsResponse = {
2128
+ labels: LabelListItem[];
2129
+ assignments: LabelAssignmentRecord[];
2130
+ };
2131
+ type PatchResourceLabelsResponse = ResourceLabelsResponse & {
2132
+ changed: boolean;
2133
+ };
2134
+ type SpaceModListItem = {
2135
+ id: string;
2136
+ spaceId: string;
2137
+ modSpaceId: string;
2138
+ name: string | null;
2139
+ mountSlug: string;
2140
+ mountPath: string;
2141
+ enabled: boolean;
2142
+ sortOrder: number;
2143
+ createdBy: string;
2144
+ createdAt: string | null;
2145
+ updatedAt: string | null;
2146
+ modSpaceName: string | null;
2147
+ modSpaceDescription: string | null;
2148
+ };
2149
+ /**
2150
+ * Public-safe DTO for Explore spaces.
2151
+ * Only contains fields safe for unauthenticated product rendering.
2152
+ */
2153
+ type ExploreSpaceItem = {
2154
+ id: string;
2155
+ slug: string | null;
2156
+ title: string;
2157
+ summary: string | null;
2158
+ spaceUrl: string;
2159
+ avatarUrl: string | null;
2160
+ avatarAlt: string | null;
2161
+ ownerDisplayName: string | null;
2162
+ ownerAvatarUrl: string | null;
2163
+ category: string | null;
2164
+ tags: string[];
2165
+ saveCount: number;
2166
+ pinCount: number;
2167
+ forkCount: number;
2168
+ updatedAt: string | null;
2169
+ accessLabel: "public" | "sign-in-required" | "unknown";
2170
+ latestSaveLabel: string | null;
2171
+ };
2172
+ type ExploreSection = {
2173
+ key: string;
2174
+ title: string | null;
2175
+ subtitle: string | null;
2176
+ description: string | null;
2177
+ spaces: ExploreSpaceItem[];
2178
+ };
2179
+ type ExploreSpacesResponse = {
2180
+ sections: ExploreSection[];
2181
+ spaces: ExploreSpaceItem[];
2182
+ };
2183
+ type Permission = "space.view" | "space.edit" | "space.label.view" | "space.label.manage" | "space.label.assign" | "session.view" | "session.edit" | "session.prompt.readonly" | "session.prompt.fullaccess" | "generation.create" | "file.view" | "file.view.filtered" | "file.edit" | "checkpoint.view" | "checkpoint.edit" | "member.view" | "member.manage" | "channel.view" | "channel.manage" | "cronjob.view" | "cronjob.manage" | "taskrun.view" | "sandbox.view" | "sandbox.manage" | "mod.view" | "mod.manage" | "user.space.list" | "user.session.list" | "user.usage.read";
2184
+ type SpaceAccess = {
2185
+ role: SpaceRole | null;
2186
+ permissions: Permission[];
2187
+ };
2188
+ type SpaceAccessPolicy = {
2189
+ signed_in_user: SpaceRole | null;
2190
+ anonymous_user: SpaceRole | null;
2191
+ };
2192
+ type SpaceUsageHourlyStat = {
2193
+ bucketStartAt: string;
2194
+ totalTokens: number;
2195
+ inputTokens: number;
2196
+ outputTokens: number;
2197
+ cacheReadTokens: number;
2198
+ cacheWriteTokens: number;
2199
+ costInput: number;
2200
+ costOutput: number;
2201
+ costCacheRead: number;
2202
+ costCacheWrite: number;
2203
+ costTotal: number;
2204
+ requestCount: number;
2205
+ successCount: number;
2206
+ errorCount: number;
2207
+ models: string[];
2208
+ };
2209
+ type SpaceUsageSummary = {
2210
+ totalTokens: number;
2211
+ inputTokens: number;
2212
+ outputTokens: number;
2213
+ cacheReadTokens: number;
2214
+ cacheWriteTokens: number;
2215
+ costInput: number;
2216
+ costOutput: number;
2217
+ costCacheRead: number;
2218
+ costCacheWrite: number;
2219
+ costTotal: number;
2220
+ requestCount: number;
2221
+ successCount: number;
2222
+ errorCount: number;
2223
+ };
2224
+ type GenerationUsageHourlyStat = {
2225
+ bucketStartAt: Date | string;
2226
+ costTotal: number;
2227
+ requestCount: number;
2228
+ successCount: number;
2229
+ errorCount: number;
2230
+ models: string[];
2231
+ usageTypes: string[];
2232
+ };
2233
+ type GenerationUsageSummary = {
2234
+ costTotal: number;
2235
+ requestCount: number;
2236
+ successCount: number;
2237
+ errorCount: number;
2238
+ };
2239
+ type GenerationUsageBlock = {
2240
+ hourly: GenerationUsageHourlyStat[];
2241
+ summary: GenerationUsageSummary;
2242
+ };
2243
+ type SpaceUsageResponse = {
2244
+ hourly: SpaceUsageHourlyStat[];
2245
+ summary: SpaceUsageSummary; /** Multimodal generation rollups (image / video / music). Optional for older servers. */
2246
+ generation?: GenerationUsageBlock;
2247
+ days: number;
2248
+ };
2249
+ type SpaceInvitation = {
2250
+ token: string;
2251
+ role: SpaceRole;
2252
+ status: "active" | "revoked" | "exhausted";
2253
+ useCount: number;
2254
+ maxUses: number | null;
2255
+ createdAt: string | null;
2256
+ expiresInSeconds: number | null;
2257
+ };
2258
+ type CreateInvitationInput = {
2259
+ role?: SpaceRole;
2260
+ ttlSeconds?: number;
2261
+ maxUses?: number;
2262
+ };
2263
+ type CreateInvitationResponse = {
2264
+ token: string;
2265
+ role: SpaceRole;
2266
+ expiresAt: string;
2267
+ maxUses: number | null;
2268
+ };
2269
+ type InvitationDetail = {
2270
+ token: string;
2271
+ spaceId: string;
2272
+ spaceName: string;
2273
+ role: SpaceRole;
2274
+ expiresInSeconds: number | null;
2275
+ };
2276
+ type AcceptInvitationResponse = {
2277
+ ok: true;
2278
+ spaceId: string;
2279
+ spaceName: string;
2280
+ role: SpaceRole;
2281
+ };
2282
+ type ReferenceResourceType = "space" | "session" | "checkpoint" | "user" | "file" | "tool";
2283
+ /**
2284
+ * Resource types usable as a query `source`. Only these have an owning space to
2285
+ * authorize against; user/file/tool appear only as reference targets.
2286
+ */
2287
+ type ReferenceQueryableType = "space" | "session" | "checkpoint";
2288
+ type ReferenceKind = "session_fork" | "space_fork" | "checkpoint_fork" | "mention" | "tool_call" | "mod" | "participant";
2289
+ type ReferenceDirection = "out" | "in" | "both";
2290
+ type ReferenceRecord = {
2291
+ kind: ReferenceKind;
2292
+ sourceType: ReferenceResourceType;
2293
+ sourceId: string;
2294
+ sourceTurnId: string | null;
2295
+ targetType: ReferenceResourceType;
2296
+ targetId: string;
2297
+ spaceId: string;
2298
+ sessionId: string | null;
2299
+ count: number;
2300
+ createdAt: string;
2301
+ updatedAt: string;
2302
+ meta: Record<string, unknown> | null;
2303
+ };
2304
+ type ReferenceQueryResponse = {
2305
+ source: string;
2306
+ direction: ReferenceDirection;
2307
+ references: ReferenceRecord[];
2308
+ };
2309
+ type ReferenceAggregateGroupBy = "kind" | "targetType" | "sourceType" | "day";
2310
+ type ReferenceAggregateGroup = {
2311
+ group: string;
2312
+ references: number;
2313
+ total: number;
2314
+ };
2315
+ type ReferenceAggregateResponse = {
2316
+ space: string;
2317
+ groupBy: ReferenceAggregateGroupBy;
2318
+ groups: ReferenceAggregateGroup[];
2319
+ };
2320
+ //#endregion
737
2321
  //#region src/websocket.d.ts
738
2322
  type WebsocketEventPayload = ChannelEnvelope;
739
2323
  type WebSocketLike = {
@@ -806,6 +2390,7 @@ type WebsocketClientEvents = {
806
2390
  sessionId?: string | null;
807
2391
  spaceId?: string | null;
808
2392
  clientMessageId?: string | null;
2393
+ billing?: BillingResponsePayload | null;
809
2394
  };
810
2395
  subscribed: {
811
2396
  rooms: RealtimeRoom[];
@@ -909,4 +2494,4 @@ declare class WebsocketClient {
909
2494
  }
910
2495
  declare const createWebsocketClient: (options?: WebsocketClientOptions) => WebsocketClient;
911
2496
  //#endregion
912
- export { ContentBlock as C, Usage as S, SessionForkRecord as _, WebsocketClientOptions as a, SessionTurnIndexItem as b, createWebsocketClient as c, RealtimePatchOperation as d, RealtimeServerEvent as f, SessionBindingRecord as g, MessageRecord as h, WebsocketClientEvents as i, ChannelEnvelope as l, SpacePublicEndpoints as m, WebSocketLike as n, WebsocketClientState as o, SessionTurnPatchEvent as p, WebsocketClient as r, WebsocketEventPayload as s, WebSocketConstructor as t, LabelAssignmentsUpdatedEvent as u, SessionRecord as v, SessionTurnRecord as x, SessionTurnSegmentRecord as y };
2497
+ export { CheckpointDiffSummary as $, SpaceFsUploadResponse as $n, RealtimeServerEvent as $r, ResourceLabelsResponse as $t, BillingProductDisplay as A, SpaceCreateResponse as An, GenerationModelPolicy as Ar, LabelListItem as At, CanvasDocumentRecord as B, SpaceFsFileResponse as Bn, normalizeGenerationPolicy as Br, PromptAccessMode as Bt, BillingCreditStatus as C, SpaceCommerceProduct as Cn, UserRulesResponse as Cr, JsonPrimitive as Ct, BillingPluginStatus as D, SpaceConfigInput as Dn, GenerationUsageBilling as Dr, LabelAssignmentRecord as Dt, BillingPaymentStatus as E, SpaceConfig as En, GenerationTaskResult as Er, LabelAssignmentPageInfo as Et, BillingSubscriptionHistoryList as F, SpaceFsCreateUploadInput as Fn, decodeGenerationPolicy as Fr, MeResponse as Ft, Channel as G, SpaceFsReadFilesResponse as Gn, ChannelHealth as Gr, ReferenceAggregateGroupBy as Gt, CanvasNodeRecord as H, SpaceFsPreparingFile as Hn, GenerationContentBlock as Hr, PromptTemplateCatalogResponse as Ht, BillingSubscriptionHistoryStatus as I, SpaceFsCreateUploadResponse as In, encodeGenerationPolicy as Ir, ModelCatalogEntry as It, CheckpointDiffFileResponse as J, SpaceFsUploadEntry as Jn, DiscordChannelConfig as Jr, ReferenceKind as Jt, CheckpointDiffDelivery as K, SpaceFsTreeResponse as Kn, ChannelHealthReasonCode as Kr, ReferenceAggregateResponse as Kt, BillingSubscriptionSummary as L, SpaceFsEncoding as Ln, filterGenerationDeclarationsByPolicy as Lr, PatchResourceLabelsInput as Lt, BillingProductPricing as M, SpaceEnvInput as Mn, GenerationPolicy as Mr, LabelResourceType as Mt, BillingRedemptionResult as N, SpaceFsCompleteUploadInput as Nn, GenerationPolicyError as Nr, LabelScopeType as Nt, BillingProductBillingInterval as O, SpaceConfigResponse as On, ListGenerationModelsResponse as Or, LabelItemsResponse as Ot, BillingResponsePayload as P, SpaceFsCompleteUploadResponse as Pn, assertGenerationRequestAllowedByPolicy as Pr, LabelSource as Pt, CheckpointDiffStatus as Q, SpaceFsUploadProgress as Qn, RealtimePatchOperation as Qr, ReferenceResourceType as Qt, CanvasBootstrapResponse as R, SpaceFsEntry as Rn, findGenerationModelPolicy as Rr, PatchResourceLabelsResponse as Rt, BillingCreditGrantStatus as S, SpaceCommerceOrder as Sn, UserProfile as Sr, JsonObject as St, BillingHistoryPagination as T, SpaceCommerceProductCreditBenefit as Tn, CreateGenerationTaskResponse as Tr, LabelAssignmentListItem as Tt, CanvasSemanticOp as U, SpaceFsReadFilesError as Un, GenerationResult as Ur, PublicUserProfile as Ut, CanvasNodeInput as V, SpaceFsMoveInput as Vn, parseGenerationPolicyFromEnv as Vr, PromptTemplateCatalogEntry as Vt, CanvasTransactionInput as W, SpaceFsReadFilesInput as Wn, ChannelConfig as Wr, ReferenceAggregateGroup as Wt, CheckpointDiffPatchLine as X, SpaceFsUploadPlanEntry as Xn, ChannelEnvelope as Xr, ReferenceQueryableType as Xt, CheckpointDiffPatchKind as Y, SpaceFsUploadError as Yn, FeishuChannelConfig as Yr, ReferenceQueryResponse as Yt, CheckpointDiffStats as Z, SpaceFsUploadPlanEntryInput as Zn, LabelAssignmentsUpdatedEvent as Zr, ReferenceRecord as Zt, BillingCatalogProduct as _, SpaceCheckpointDetailResponse as _n, SpaceUsageHourlyStat as _r, GenerationUsageSummary as _t, WebsocketClientOptions as a, SessionTurnIndexItem as ai, SessionMessagesResponse as an, SpaceModListItem as ar, CreateSpacePromptInput as at, BillingConversionIntent as b, SpaceCommerceCreditsBenefit as bn, TaskRunDetailResponse as br, GlobalSearchType as bt, createWebsocketClient as c, ContentBlock as ci, SessionTurnResponse as cn, SpacePresenceSnapshot as cr, CronJobPayload as ct, BatchUserProfilesResponse as d, SessionTurnWindowResponse as dn, SpaceRecord as dr, CursorPageInfo as dt, SessionTurnPatchEvent as ei, SandboxSpecId as en, SpaceFsWriteFileInput as er, CheckpointRecord as et, BillingBalanceActivity as f, SessionTurnsPaginatedResponse as fn, SpaceRole as fr, ExploreSection as ft, BillingCatalog as g, SpaceChannelBindingInput as gn, SpaceSessionsResponse as gr, GenerationUsageHourlyStat as gt, BillingBalanceActivityStatus as h, SpaceBootstrapSource as hn, SpaceSandboxProvider as hr, GenerationUsageBlock as ht, WebsocketClientEvents as i, SessionTurnSegmentRecord as ii, SessionMessagesPaginatedResponse as in, SpaceMeta as ir, CreateSpaceModInput as it, BillingProductKind as j, SpaceDefaultResponse as jn, GenerationParameterConstraint as jr, LabelRecord as jt, BillingProductCreditBenefit as k, SpaceConfigUpdateResponse as kn, PublicGenerationDeclaration as kr, LabelItemsSessionFork as kt, AcceptInvitationResponse as l, SessionTurnSignedUrlsResponse as ln, SpacePresenceUser as lr, CronJobRecord as lt, BillingBalanceActivityList as m, SpaceAccessPolicy as mn, SpaceSandboxConfig as mr, ExploreSpacesResponse as mt, WebSocketLike as n, MessageRecord as ni, SessionBindingRecord as nn, SpaceListItem as nr, CreateInvitationResponse as nt, WebsocketClientState as o, SessionTurnRecord as oi, SessionRecord as on, SpacePendingDiffFileResponse as or, CreateSpacePromptResponse as ot, BillingBalanceActivityKind as p, SpaceAccess as pn, SpaceSandboxAutoDestroyPolicy as pr, ExploreSpaceItem as pt, CheckpointDiffFile as q, SpaceFsUploadDestination as qn, ChannelRuntimeState as qr, ReferenceDirection as qt, WebsocketClient as r, SessionForkRecord as ri, SessionMessageResponse as rn, SpaceMember as rr, CreateSpaceInput as rt, WebsocketEventPayload as s, Usage as si, SessionTurnIndexResponse as sn, SpacePendingDiffSummary as sr, CreateSpaceSessionInput as st, WebSocketConstructor as t, SpacePublicEndpoints as ti, SendMessageCronJobPayload as tn, SpaceInvitation as tr, CreateInvitationInput as tt, ApiError as u, SessionTurnStreamSnapshotResponse as un, SpacePublicProfile as ur, CronJobUpdatePatch as ut, BillingCheckoutActionState as v, SpaceCommerceBenefit as vn, SpaceUsageResponse as vr, GlobalSearchResponse as vt, BillingCreditUnit as w, SpaceCommerceProductBenefitBinding as wn, CreateGenerationTaskRequest as wr, JsonValue as wt, BillingCreditExpiryGroup as x, SpaceCommerceFeatureBenefit as xn, TaskRunRecord as xr, InvitationDetail as xt, BillingCheckoutResult as y, SpaceCommerceBuyerProfile as yn, SpaceUsageSummary as yr, GlobalSearchResult as yt, CanvasCreateInput as z, SpaceFsFileKind as zn, getAllowedGenerationModelIds as zr, Permission as zt };