@neta-art/cohub 1.18.1 → 1.20.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.
- package/dist/chunks/http.d.ts +222 -22
- package/dist/chunks/http.js +52 -13
- package/dist/chunks/websocket.d.ts +10 -0
- package/dist/http.d.ts +2 -2
- package/dist/index.d.ts +34 -2
- package/dist/index.js +37 -0
- package/package.json +1 -1
package/dist/chunks/http.d.ts
CHANGED
|
@@ -269,6 +269,7 @@ type BillingCreditGrantStatus = {
|
|
|
269
269
|
id: string;
|
|
270
270
|
tokenType: string;
|
|
271
271
|
benefitKey: string | null;
|
|
272
|
+
benefitName: string | null;
|
|
272
273
|
grantKind: string | null;
|
|
273
274
|
sourceType: string | null;
|
|
274
275
|
sourceId: string | null;
|
|
@@ -277,9 +278,17 @@ type BillingCreditGrantStatus = {
|
|
|
277
278
|
remainingAmountUsd: number;
|
|
278
279
|
originalAmount: number | null;
|
|
279
280
|
originalAmountUsd: number | null;
|
|
281
|
+
consumedAmount: number | null;
|
|
282
|
+
consumedAmountUsd: number | null;
|
|
283
|
+
usageConsumedAmount: number | null;
|
|
284
|
+
usageConsumedAmountUsd: number | null;
|
|
285
|
+
settledOverageAmount: number | null;
|
|
286
|
+
settledOverageAmountUsd: number | null;
|
|
287
|
+
consumedPercent: number | null;
|
|
280
288
|
effectiveAt: string | null;
|
|
281
289
|
expiresAt: string | null;
|
|
282
290
|
daysRemaining: number | null;
|
|
291
|
+
createdAt: string;
|
|
283
292
|
};
|
|
284
293
|
type BillingCreditExpiryGroup = {
|
|
285
294
|
key: "expired" | "lt_7d" | "lt_30d" | "gte_30d" | "never";
|
|
@@ -318,6 +327,134 @@ type BillingCreditStatus = {
|
|
|
318
327
|
};
|
|
319
328
|
groups: BillingCreditExpiryGroup[];
|
|
320
329
|
};
|
|
330
|
+
type BillingOpenOverageList = {
|
|
331
|
+
userId: string;
|
|
332
|
+
billing: BillingPluginStatus;
|
|
333
|
+
tokenType: string;
|
|
334
|
+
unit: BillingCreditUnit;
|
|
335
|
+
page: number;
|
|
336
|
+
limit: number;
|
|
337
|
+
items: BillingOpenOverageStatus[];
|
|
338
|
+
pagination: {
|
|
339
|
+
maxPage: number;
|
|
340
|
+
totalCount: number;
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
type BillingProductKind = "plan" | "addon";
|
|
344
|
+
type BillingProductBillingInterval = "monthly" | "quarterly" | "yearly" | "one_time" | "other";
|
|
345
|
+
type BillingProductPricing = {
|
|
346
|
+
amountMinor: number;
|
|
347
|
+
amountUsd: number;
|
|
348
|
+
compareAtAmountMinor: number | null;
|
|
349
|
+
compareAtAmountUsd: number | null;
|
|
350
|
+
discountLabel: string | null;
|
|
351
|
+
discountRate: number | null;
|
|
352
|
+
};
|
|
353
|
+
type BillingProductDisplay = {
|
|
354
|
+
description: string | null;
|
|
355
|
+
benefits: string[];
|
|
356
|
+
creditsAmount: number | null;
|
|
357
|
+
validity: string | null;
|
|
358
|
+
creditBenefits: BillingProductCreditBenefit[];
|
|
359
|
+
};
|
|
360
|
+
type BillingProductCreditBenefit = {
|
|
361
|
+
key: string;
|
|
362
|
+
name: string;
|
|
363
|
+
tokenType: string;
|
|
364
|
+
grantKind: string;
|
|
365
|
+
scope: string;
|
|
366
|
+
cycleAmount: number;
|
|
367
|
+
cycleAmountUsd: number;
|
|
368
|
+
periodAmount: number;
|
|
369
|
+
periodAmountUsd: number;
|
|
370
|
+
expiresInDays: number | null;
|
|
371
|
+
};
|
|
372
|
+
type BillingCatalogProduct = {
|
|
373
|
+
id: string;
|
|
374
|
+
key: string;
|
|
375
|
+
name: string;
|
|
376
|
+
description: string | null;
|
|
377
|
+
status: string;
|
|
378
|
+
visibility: string;
|
|
379
|
+
billingType: string;
|
|
380
|
+
billingPeriod: string;
|
|
381
|
+
billingIntervalCount: number;
|
|
382
|
+
currency: string;
|
|
383
|
+
kind: BillingProductKind;
|
|
384
|
+
interval: BillingProductBillingInterval;
|
|
385
|
+
pricing: BillingProductPricing;
|
|
386
|
+
display: BillingProductDisplay;
|
|
387
|
+
isDefaultPlan: boolean;
|
|
388
|
+
};
|
|
389
|
+
type BillingSubscriptionSummary = {
|
|
390
|
+
id: string;
|
|
391
|
+
productKey: string | null;
|
|
392
|
+
productName: string | null;
|
|
393
|
+
status: string;
|
|
394
|
+
currentPeriodStart: string | null;
|
|
395
|
+
currentPeriodEnd: string | null;
|
|
396
|
+
cancelAtPeriodEnd: boolean;
|
|
397
|
+
};
|
|
398
|
+
type BillingPaymentStatus = {
|
|
399
|
+
available: boolean;
|
|
400
|
+
reason: string | null;
|
|
401
|
+
};
|
|
402
|
+
type BillingCatalog = {
|
|
403
|
+
userId: string;
|
|
404
|
+
billing: BillingPluginStatus;
|
|
405
|
+
payment: BillingPaymentStatus;
|
|
406
|
+
products: BillingCatalogProduct[];
|
|
407
|
+
plans: BillingCatalogProduct[];
|
|
408
|
+
addons: BillingCatalogProduct[];
|
|
409
|
+
currentSubscriptions: BillingSubscriptionSummary[];
|
|
410
|
+
hasActiveSubscription: boolean;
|
|
411
|
+
defaultPlanProductKey: string | null;
|
|
412
|
+
};
|
|
413
|
+
type BillingCheckoutResult = {
|
|
414
|
+
userId: string;
|
|
415
|
+
billing: BillingPluginStatus;
|
|
416
|
+
payment: BillingPaymentStatus;
|
|
417
|
+
productKey: string;
|
|
418
|
+
checkoutUrl: string | null;
|
|
419
|
+
checkoutUsable: boolean;
|
|
420
|
+
message: string | null;
|
|
421
|
+
orderId: string | null;
|
|
422
|
+
subscriptionId: string | null;
|
|
423
|
+
reused: boolean;
|
|
424
|
+
};
|
|
425
|
+
type BillingRedemptionResult = {
|
|
426
|
+
userId: string;
|
|
427
|
+
billing: BillingPluginStatus;
|
|
428
|
+
redeemed: boolean;
|
|
429
|
+
message: string | null;
|
|
430
|
+
redemptionRecordId: string | null;
|
|
431
|
+
itemCount: number;
|
|
432
|
+
};
|
|
433
|
+
type BillingUsageRecordStatus = {
|
|
434
|
+
id: string;
|
|
435
|
+
tokenType: string;
|
|
436
|
+
usageType: string | null;
|
|
437
|
+
sourceType: string | null;
|
|
438
|
+
sourceId: string | null;
|
|
439
|
+
operationId: string | null;
|
|
440
|
+
amount: number;
|
|
441
|
+
amountUsd: number;
|
|
442
|
+
reason: string | null;
|
|
443
|
+
createdAt: string;
|
|
444
|
+
};
|
|
445
|
+
type BillingUsageRecordList = {
|
|
446
|
+
userId: string;
|
|
447
|
+
billing: BillingPluginStatus;
|
|
448
|
+
tokenType: string;
|
|
449
|
+
unit: BillingCreditUnit;
|
|
450
|
+
page: number;
|
|
451
|
+
limit: number;
|
|
452
|
+
items: BillingUsageRecordStatus[];
|
|
453
|
+
pagination: {
|
|
454
|
+
maxPage: number;
|
|
455
|
+
totalCount: number;
|
|
456
|
+
};
|
|
457
|
+
};
|
|
321
458
|
type UserRulesResponse = {
|
|
322
459
|
content: string;
|
|
323
460
|
updatedAt: string | null;
|
|
@@ -699,6 +836,7 @@ type SpaceSessionsResponse = {
|
|
|
699
836
|
nextCursor: string | null;
|
|
700
837
|
};
|
|
701
838
|
};
|
|
839
|
+
type PromptAccessMode = "read_only" | "full_access";
|
|
702
840
|
type CreateSpacePromptInput = {
|
|
703
841
|
sessionId?: string | null;
|
|
704
842
|
title?: string | null;
|
|
@@ -707,6 +845,7 @@ type CreateSpacePromptInput = {
|
|
|
707
845
|
provider?: string | null;
|
|
708
846
|
clientMessageId?: string | null;
|
|
709
847
|
generationPolicy?: GenerationPolicy | null;
|
|
848
|
+
accessMode?: PromptAccessMode | null;
|
|
710
849
|
schedule?: {
|
|
711
850
|
mode?: "immediate";
|
|
712
851
|
} | {
|
|
@@ -796,21 +935,42 @@ type SpaceMember = {
|
|
|
796
935
|
createdAt: string;
|
|
797
936
|
updatedAt: string;
|
|
798
937
|
};
|
|
799
|
-
type
|
|
800
|
-
type
|
|
801
|
-
type
|
|
938
|
+
type LabelScopeType = "space" | "user" | "org";
|
|
939
|
+
type LabelSource = "user" | "migration" | "system";
|
|
940
|
+
type LabelResourceType = "session" | "checkpoint" | "file";
|
|
941
|
+
type LabelRecord = {
|
|
802
942
|
id: string;
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
943
|
+
scopeType: LabelScopeType;
|
|
944
|
+
scopeId: string;
|
|
945
|
+
name: string;
|
|
946
|
+
slug: string;
|
|
947
|
+
parentId: string | null;
|
|
948
|
+
depth: number;
|
|
949
|
+
source: LabelSource;
|
|
950
|
+
systemKey: string | null;
|
|
951
|
+
rank: number;
|
|
952
|
+
createdBy: string | null;
|
|
953
|
+
createdAt: string | null;
|
|
954
|
+
updatedAt: string | null;
|
|
955
|
+
};
|
|
956
|
+
type LabelListItem = LabelRecord & {
|
|
957
|
+
children?: LabelListItem[];
|
|
958
|
+
};
|
|
959
|
+
type LabelAssignmentRecord = {
|
|
960
|
+
id: string;
|
|
961
|
+
labelId: string;
|
|
962
|
+
scopeType: LabelScopeType;
|
|
963
|
+
scopeId: string;
|
|
964
|
+
resourceType: LabelResourceType;
|
|
806
965
|
resourceRef: string;
|
|
807
|
-
label: string | null;
|
|
808
966
|
rank: number;
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
967
|
+
source: LabelSource;
|
|
968
|
+
createdBy: string | null;
|
|
969
|
+
meta: Record<string, unknown> | null;
|
|
970
|
+
createdAt: string | null;
|
|
971
|
+
updatedAt: string | null;
|
|
812
972
|
};
|
|
813
|
-
type
|
|
973
|
+
type LabelAssignmentListItem = LabelAssignmentRecord & {
|
|
814
974
|
href: string;
|
|
815
975
|
resource: {
|
|
816
976
|
title: string;
|
|
@@ -818,6 +978,14 @@ type SpaceMarkListItem = SpaceMarkRecord & {
|
|
|
818
978
|
status: string | null;
|
|
819
979
|
} | null;
|
|
820
980
|
};
|
|
981
|
+
type LabelAssignmentPageInfo = {
|
|
982
|
+
hasMore: boolean;
|
|
983
|
+
nextCursor: string | null;
|
|
984
|
+
};
|
|
985
|
+
type ResourceLabelsResponse = {
|
|
986
|
+
labels: LabelListItem[];
|
|
987
|
+
assignments: LabelAssignmentRecord[];
|
|
988
|
+
};
|
|
821
989
|
type SpaceModListItem = {
|
|
822
990
|
id: string;
|
|
823
991
|
spaceId: string;
|
|
@@ -867,7 +1035,7 @@ type ExploreSpacesResponse = {
|
|
|
867
1035
|
sections: ExploreSection[];
|
|
868
1036
|
spaces: ExploreSpaceItem[];
|
|
869
1037
|
};
|
|
870
|
-
type Permission = "space.view" | "space.edit" | "space.
|
|
1038
|
+
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" | "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";
|
|
871
1039
|
type SpaceAccess = {
|
|
872
1040
|
role: SpaceRole | null;
|
|
873
1041
|
permissions: Permission[];
|
|
@@ -1571,24 +1739,56 @@ declare class SpaceSandboxApi {
|
|
|
1571
1739
|
type SpaceRunCommandResponse = {
|
|
1572
1740
|
taskRunId: string;
|
|
1573
1741
|
};
|
|
1574
|
-
declare class
|
|
1742
|
+
declare class SpaceLabelsApi {
|
|
1575
1743
|
private readonly transport;
|
|
1576
1744
|
private readonly spaceId;
|
|
1577
1745
|
constructor(transport: HttpTransport, spaceId: string);
|
|
1578
|
-
list(
|
|
1579
|
-
|
|
1746
|
+
list(): Promise<{
|
|
1747
|
+
labels: LabelListItem[];
|
|
1580
1748
|
}>;
|
|
1581
1749
|
create(input: {
|
|
1582
|
-
|
|
1583
|
-
|
|
1750
|
+
name: string;
|
|
1751
|
+
parentId?: string | null;
|
|
1752
|
+
}): Promise<{
|
|
1753
|
+
label: LabelListItem;
|
|
1754
|
+
}>;
|
|
1755
|
+
update(labelId: string, input: {
|
|
1756
|
+
name?: string;
|
|
1757
|
+
parentId?: string | null;
|
|
1758
|
+
rank?: number;
|
|
1759
|
+
}): Promise<{
|
|
1760
|
+
label: LabelListItem;
|
|
1761
|
+
}>;
|
|
1762
|
+
delete(labelId: string): Promise<{
|
|
1763
|
+
ok: true;
|
|
1764
|
+
}>;
|
|
1765
|
+
reorder(labelIds: string[]): Promise<{
|
|
1766
|
+
labels: LabelListItem[];
|
|
1767
|
+
}>;
|
|
1768
|
+
listItems(labelId: string, input?: {
|
|
1769
|
+
limit?: number;
|
|
1770
|
+
cursor?: string | null;
|
|
1771
|
+
}): Promise<{
|
|
1772
|
+
items: LabelAssignmentListItem[];
|
|
1773
|
+
pageInfo: LabelAssignmentPageInfo;
|
|
1774
|
+
}>;
|
|
1775
|
+
addItem(labelId: string, input: {
|
|
1776
|
+
resourceType: LabelResourceType;
|
|
1584
1777
|
resourceRef: string;
|
|
1585
|
-
label?: string | null;
|
|
1586
1778
|
}): Promise<{
|
|
1587
|
-
|
|
1779
|
+
assignment: LabelAssignmentRecord;
|
|
1588
1780
|
}>;
|
|
1589
|
-
|
|
1781
|
+
deleteItem(labelId: string, assignmentId: string): Promise<{
|
|
1590
1782
|
ok: true;
|
|
1591
1783
|
}>;
|
|
1784
|
+
getResourceLabels(resourceType: LabelResourceType, resourceRef: string): Promise<{
|
|
1785
|
+
labels: LabelListItem[];
|
|
1786
|
+
assignments: LabelAssignmentRecord[];
|
|
1787
|
+
}>;
|
|
1788
|
+
setResourceLabels(resourceType: LabelResourceType, resourceRef: string, labelIds: string[]): Promise<{
|
|
1789
|
+
labels: LabelListItem[];
|
|
1790
|
+
assignments: LabelAssignmentRecord[];
|
|
1791
|
+
}>;
|
|
1592
1792
|
}
|
|
1593
1793
|
declare class SpaceCheckpointsApi {
|
|
1594
1794
|
private readonly transport;
|
|
@@ -1618,7 +1818,7 @@ declare class SpaceClient {
|
|
|
1618
1818
|
readonly env: SpaceEnvApi;
|
|
1619
1819
|
readonly sandbox: SpaceSandboxApi;
|
|
1620
1820
|
readonly invitations: SpaceInvitationsApi;
|
|
1621
|
-
readonly
|
|
1821
|
+
readonly labels: SpaceLabelsApi;
|
|
1622
1822
|
constructor(id: string, transport: HttpTransport, websocketClient: WebsocketClient | null);
|
|
1623
1823
|
get(customFetch?: Fetch): Promise<SpaceRecord>;
|
|
1624
1824
|
prompt(input: CreateSpacePromptInput): Promise<CreateSpacePromptResponse>;
|
|
@@ -1702,4 +1902,4 @@ declare class CohubHttpClient {
|
|
|
1702
1902
|
}
|
|
1703
1903
|
declare const createHttpClient: (options?: CohubClientOptions) => CohubHttpClient;
|
|
1704
1904
|
//#endregion
|
|
1705
|
-
export {
|
|
1905
|
+
export { BillingOpenOverageStatus as $, CreateGenerationTaskResponse as $n, SessionTurnStreamSnapshotResponse as $t, SessionPatchStatus as A, SpaceFsUploadPlanEntryInput as An, LabelAssignmentListItem as At, GenerationsApi as B, SpaceRecord as Bn, Permission as Bt, SessionGenerationStreamClient as C, SpaceFsReadFilesInput as Cn, GlobalSearchResponse as Ct, SessionPatchApplyResult as D, SpaceFsUploadEntry as Dn, JsonObject as Dt, SessionPatchApplyInput as E, SpaceFsUploadDestination as En, InvitationDetail as Et, CreatePublicAssetUploadResponse as F, SpaceListItem as Fn, LabelResourceType as Ft, BillingCatalog as G, SpaceUsageHourlyStat as Gn, SessionBindingRecord as Gt, ChannelsApi as H, SpaceSandboxAutoDestroyPolicy as Hn, PromptTemplateCatalogEntry as Ht, PublicAssetPurpose as I, SpaceMember as In, LabelScopeType as It, BillingCreditExpiryGroup as J, TaskRunDetailResponse as Jn, SessionMessagesResponse as Jt, BillingCatalogProduct as K, SpaceUsageResponse as Kn, SessionMessageResponse as Kt, PublicAssetsApi as L, SpaceMeta as Ln, LabelSource as Lt, SessionAccessApi as M, SpaceFsUploadResponse as Mn, LabelAssignmentRecord as Mt, SearchApi as N, SpaceFsWriteFileInput as Nn, LabelListItem as Nt, SessionPatchReducer as O, SpaceFsUploadError as On, JsonPrimitive as Ot, CreatePublicAssetUploadInput as P, SpaceInvitation as Pn, LabelRecord as Pt, BillingOpenOverageList as Q, CreateGenerationTaskRequest as Qn, SessionTurnSignedUrlsResponse as Qt, PromptsApi as R, SpaceModListItem as Rn, MeResponse as Rt, GenerationStreamTurnUpdatedEvent as S, SpaceFsReadFilesError as Sn, RawHttpResponse as Sr, ExploreSpacesResponse as St, parseAssistantMessageCommit as T, SpaceFsTreeResponse as Tn, GlobalSearchType as Tt, AcceptInvitationResponse as U, SpaceSandboxConfig as Un, PromptTemplateCatalogResponse as Ut, CronJobsApi as V, SpaceRole as Vn, PromptAccessMode as Vt, ApiError as W, SpaceSessionsResponse as Wn, ResourceLabelsResponse as Wt, BillingCreditStatus as X, UserProfile as Xn, SessionTurnIndexResponse as Xt, BillingCreditGrantStatus as Y, TaskRunRecord as Yn, SessionRecord as Yt, BillingCreditUnit as Z, UserRulesResponse as Zn, SessionTurnResponse as Zt, GenerationStreamFinalizedEvent as _, SpaceFsEntry as _n, DiscordChannelConfig as _r, CreateSpacePromptInput as _t, SessionEventName as a, SpaceChannelBindingInput as an, GenerationPolicy as ar, BillingProductKind as at, GenerationStreamStateEvent as b, SpaceFsMoveInput as bn, HttpError as br, ExploreSection as bt, SpaceClient as c, SpaceConfigInput as cn, decodeGenerationPolicy as cr, BillingSubscriptionSummary as ct, WebSocketConnectionState as d, SpaceEnvInput as dn, findGenerationModelPolicy as dr, Channel as dt, SessionTurnWindowResponse as en, GenerationTaskResult as er, BillingPaymentStatus as et, PublicInviteApi as f, SpaceFsCompleteUploadInput as fn, getAllowedGenerationModelIds as fr, CheckpointRecord as ft, GenerationStreamEvent as g, SpaceFsEncoding as gn, ChannelConfig as gr, CreateSpaceModInput as gt, GenerationStreamErrorEvent as h, SpaceFsCreateUploadResponse as hn, GenerationContentBlock as hr, CreateSpaceInput as ht, TasksApi as i, SpaceBootstrapSource as in, GenerationParameterConstraint as ir, BillingProductDisplay as it, createSessionPatchReducer as j, SpaceFsUploadProgress as jn, LabelAssignmentPageInfo as jt, SessionPatchState as k, SpaceFsUploadPlanEntry as kn, JsonValue as kt, SpaceEventName as l, SpaceConfigResponse as ln, encodeGenerationPolicy as lr, BillingUsageRecordList as lt, GenerationStreamCommitEvent as m, SpaceFsCreateUploadInput as mn, parseGenerationPolicyFromEnv as mr, CreateInvitationResponse as mt, createHttpClient as n, SpaceAccess as nn, PublicGenerationDeclaration as nr, BillingProductBillingInterval as nt, SessionSubscriptionHandlers as o, SpaceCheckpointDetailResponse as on, GenerationPolicyError as or, BillingProductPricing as ot, AssistantMessageCommit as p, SpaceFsCompleteUploadResponse as pn, normalizeGenerationPolicy as pr, CreateInvitationInput as pt, BillingCheckoutResult as q, SpaceUsageSummary as qn, SessionMessagesPaginatedResponse as qt, UserApi as r, SpaceAccessPolicy as rn, GenerationModelPolicy as rr, BillingProductCreditBenefit as rt, SpaceChannelBindingRecord as s, SpaceConfig as sn, assertGenerationRequestAllowedByPolicy as sr, BillingRedemptionResult as st, CohubHttpClient as t, SessionTurnsPaginatedResponse as tn, ListGenerationModelsResponse as tr, BillingPluginStatus as tt, SpacesApi as u, SpaceCreateResponse as un, filterGenerationDeclarationsByPolicy as ur, BillingUsageRecordStatus as ut, GenerationStreamIntermediateMessage as v, SpaceFsFileKind as vn, CohubClientOptions as vr, CreateSpacePromptResponse as vt, createSessionGenerationStreamClient as w, SpaceFsReadFilesResponse as wn, GlobalSearchResult as wt, GenerationStreamSubscriptionHandlers as x, SpaceFsPreparingFile as xn, HttpTransport as xr, ExploreSpaceItem as xt, GenerationStreamOutOfSyncEvent as y, SpaceFsFileResponse as yn, Fetch as yr, CronJobRecord as yt, ModelsApi as z, SpacePublicProfile as zn, ModelCatalogEntry as zt };
|
package/dist/chunks/http.js
CHANGED
|
@@ -1669,29 +1669,68 @@ var SpaceSandboxApi = class {
|
|
|
1669
1669
|
return this.transport.request(`/api/spaces/${this.spaceId}/sandbox/recreate`, { method: "POST" });
|
|
1670
1670
|
}
|
|
1671
1671
|
};
|
|
1672
|
-
var
|
|
1672
|
+
var SpaceLabelsApi = class {
|
|
1673
1673
|
transport;
|
|
1674
1674
|
spaceId;
|
|
1675
1675
|
constructor(transport, spaceId) {
|
|
1676
1676
|
this.transport = transport;
|
|
1677
1677
|
this.spaceId = spaceId;
|
|
1678
1678
|
}
|
|
1679
|
-
list(
|
|
1680
|
-
|
|
1681
|
-
return this.transport.request(`/api/spaces/${this.spaceId}/marks?${params.toString()}`);
|
|
1679
|
+
list() {
|
|
1680
|
+
return this.transport.request(`/api/spaces/${this.spaceId}/labels`);
|
|
1682
1681
|
}
|
|
1683
1682
|
create(input) {
|
|
1684
|
-
return this.transport.request(`/api/spaces/${this.spaceId}/
|
|
1683
|
+
return this.transport.request(`/api/spaces/${this.spaceId}/labels`, {
|
|
1685
1684
|
method: "POST",
|
|
1686
1685
|
headers: { "Content-Type": "application/json" },
|
|
1687
|
-
body: JSON.stringify(
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1686
|
+
body: JSON.stringify(input)
|
|
1687
|
+
});
|
|
1688
|
+
}
|
|
1689
|
+
update(labelId, input) {
|
|
1690
|
+
return this.transport.request(`/api/spaces/${this.spaceId}/labels/${labelId}`, {
|
|
1691
|
+
method: "PATCH",
|
|
1692
|
+
headers: { "Content-Type": "application/json" },
|
|
1693
|
+
body: JSON.stringify(input)
|
|
1694
|
+
});
|
|
1695
|
+
}
|
|
1696
|
+
delete(labelId) {
|
|
1697
|
+
return this.transport.request(`/api/spaces/${this.spaceId}/labels/${labelId}`, { method: "DELETE" });
|
|
1698
|
+
}
|
|
1699
|
+
reorder(labelIds) {
|
|
1700
|
+
return this.transport.request(`/api/spaces/${this.spaceId}/labels/reorder`, {
|
|
1701
|
+
method: "POST",
|
|
1702
|
+
headers: { "Content-Type": "application/json" },
|
|
1703
|
+
body: JSON.stringify({ labelIds })
|
|
1691
1704
|
});
|
|
1692
1705
|
}
|
|
1693
|
-
|
|
1694
|
-
|
|
1706
|
+
listItems(labelId, input) {
|
|
1707
|
+
const params = new URLSearchParams();
|
|
1708
|
+
if (input?.limit) params.set("limit", String(input.limit));
|
|
1709
|
+
if (input?.cursor) params.set("cursor", input.cursor);
|
|
1710
|
+
const query = params.toString();
|
|
1711
|
+
return this.transport.request(`/api/spaces/${this.spaceId}/labels/${labelId}/items${query ? `?${query}` : ""}`);
|
|
1712
|
+
}
|
|
1713
|
+
addItem(labelId, input) {
|
|
1714
|
+
return this.transport.request(`/api/spaces/${this.spaceId}/labels/${labelId}/items`, {
|
|
1715
|
+
method: "POST",
|
|
1716
|
+
headers: { "Content-Type": "application/json" },
|
|
1717
|
+
body: JSON.stringify(input)
|
|
1718
|
+
});
|
|
1719
|
+
}
|
|
1720
|
+
deleteItem(labelId, assignmentId) {
|
|
1721
|
+
return this.transport.request(`/api/spaces/${this.spaceId}/labels/${labelId}/items/${assignmentId}`, { method: "DELETE" });
|
|
1722
|
+
}
|
|
1723
|
+
getResourceLabels(resourceType, resourceRef) {
|
|
1724
|
+
const params = new URLSearchParams({ resourceRef });
|
|
1725
|
+
return this.transport.request(`/api/spaces/${this.spaceId}/resources/${resourceType}/labels?${params.toString()}`);
|
|
1726
|
+
}
|
|
1727
|
+
setResourceLabels(resourceType, resourceRef, labelIds) {
|
|
1728
|
+
const params = new URLSearchParams({ resourceRef });
|
|
1729
|
+
return this.transport.request(`/api/spaces/${this.spaceId}/resources/${resourceType}/labels?${params.toString()}`, {
|
|
1730
|
+
method: "PUT",
|
|
1731
|
+
headers: { "Content-Type": "application/json" },
|
|
1732
|
+
body: JSON.stringify({ labelIds })
|
|
1733
|
+
});
|
|
1695
1734
|
}
|
|
1696
1735
|
};
|
|
1697
1736
|
var SpaceCheckpointsApi = class {
|
|
@@ -1730,7 +1769,7 @@ var SpaceClient = class {
|
|
|
1730
1769
|
env;
|
|
1731
1770
|
sandbox;
|
|
1732
1771
|
invitations;
|
|
1733
|
-
|
|
1772
|
+
labels;
|
|
1734
1773
|
constructor(id, transport, websocketClient) {
|
|
1735
1774
|
this.id = id;
|
|
1736
1775
|
this.transport = transport;
|
|
@@ -1746,7 +1785,7 @@ var SpaceClient = class {
|
|
|
1746
1785
|
this.env = new SpaceEnvApi(transport, id);
|
|
1747
1786
|
this.sandbox = new SpaceSandboxApi(transport, id);
|
|
1748
1787
|
this.invitations = new SpaceInvitationsApi(transport, id);
|
|
1749
|
-
this.
|
|
1788
|
+
this.labels = new SpaceLabelsApi(transport, id);
|
|
1750
1789
|
}
|
|
1751
1790
|
get(customFetch) {
|
|
1752
1791
|
return this.transport.request(`/api/spaces/${this.id}`, { fetch: customFetch });
|
|
@@ -204,9 +204,19 @@ type SessionBindingRecord = {
|
|
|
204
204
|
updatedAt: string;
|
|
205
205
|
lastMessageAt: string | null;
|
|
206
206
|
};
|
|
207
|
+
type SessionUserProfile = {
|
|
208
|
+
userUuid: string;
|
|
209
|
+
username: string | null;
|
|
210
|
+
displayName: string;
|
|
211
|
+
avatarUrl: string | null;
|
|
212
|
+
};
|
|
207
213
|
type SessionRecord = {
|
|
208
214
|
id: string;
|
|
209
215
|
spaceId: string;
|
|
216
|
+
userUuid: string | null;
|
|
217
|
+
userProfile?: SessionUserProfile | null;
|
|
218
|
+
participantUserUuids?: string[];
|
|
219
|
+
participantProfiles?: SessionUserProfile[];
|
|
210
220
|
title: string | null;
|
|
211
221
|
source: string | null;
|
|
212
222
|
status: string | null;
|
package/dist/http.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { _ as SessionTurnIndexItem, b as ContentBlock, f as MessageRecord, g as SessionTurnSegmentRecord, m as SessionForkRecord, v as SessionTurnRecord } from "./chunks/websocket.js";
|
|
2
|
-
import { $ as
|
|
3
|
-
export { AcceptInvitationResponse, ApiError, BillingCreditExpiryGroup, BillingCreditGrantStatus, BillingCreditStatus, BillingCreditUnit, BillingOpenOverageStatus, BillingPluginStatus, Channel, type ChannelConfig, CheckpointRecord, type CohubClientOptions, CohubHttpClient, type ContentBlock, type CreateGenerationTaskRequest, type CreateGenerationTaskResponse, CreateInvitationInput, CreateInvitationResponse, CreateSpaceInput, CreateSpaceModInput, CreateSpacePromptInput, CreateSpacePromptResponse, CronJobRecord, type DiscordChannelConfig, ExploreSection, ExploreSpaceItem, ExploreSpacesResponse, type Fetch, type GenerationContentBlock, type GenerationPolicy, type GenerationTaskResult, GlobalSearchResponse, GlobalSearchResult, GlobalSearchType, HttpError, HttpTransport, InvitationDetail, JsonObject, JsonPrimitive, JsonValue, type ListGenerationModelsResponse, MeResponse, type MessageRecord, ModelCatalogEntry, Permission, PromptTemplateCatalogEntry, PromptTemplateCatalogResponse, type PublicGenerationDeclaration, SessionBindingRecord, type SessionForkRecord, SessionMessageResponse, SessionMessagesPaginatedResponse, SessionMessagesResponse, SessionRecord, type SessionTurnIndexItem, SessionTurnIndexResponse, type SessionTurnRecord, SessionTurnResponse, type SessionTurnSegmentRecord, SessionTurnSignedUrlsResponse, SessionTurnStreamSnapshotResponse, SessionTurnWindowResponse, SessionTurnsPaginatedResponse, SpaceAccess, SpaceAccessPolicy, SpaceBootstrapSource, SpaceChannelBindingInput, SpaceCheckpointDetailResponse, SpaceConfig, SpaceConfigInput, SpaceConfigResponse, SpaceCreateResponse, SpaceEnvInput, SpaceFsCompleteUploadInput, SpaceFsCompleteUploadResponse, SpaceFsCreateUploadInput, SpaceFsCreateUploadResponse, SpaceFsEncoding, SpaceFsEntry, SpaceFsFileKind, SpaceFsFileResponse, SpaceFsMoveInput, SpaceFsPreparingFile, SpaceFsReadFilesError, SpaceFsReadFilesInput, SpaceFsReadFilesResponse, SpaceFsTreeResponse, SpaceFsUploadDestination, SpaceFsUploadEntry, SpaceFsUploadError, SpaceFsUploadPlanEntry, SpaceFsUploadPlanEntryInput, SpaceFsUploadProgress, SpaceFsUploadResponse, SpaceFsWriteFileInput, SpaceInvitation, SpaceListItem,
|
|
2
|
+
import { $ as BillingOpenOverageStatus, $n as CreateGenerationTaskResponse, $t as SessionTurnStreamSnapshotResponse, An as SpaceFsUploadPlanEntryInput, At as LabelAssignmentListItem, Bn as SpaceRecord, Bt as Permission, Cn as SpaceFsReadFilesInput, Ct as GlobalSearchResponse, Dn as SpaceFsUploadEntry, Dt as JsonObject, En as SpaceFsUploadDestination, Et as InvitationDetail, Fn as SpaceListItem, Ft as LabelResourceType, G as BillingCatalog, Gn as SpaceUsageHourlyStat, Gt as SessionBindingRecord, Hn as SpaceSandboxAutoDestroyPolicy, Ht as PromptTemplateCatalogEntry, In as SpaceMember, It as LabelScopeType, J as BillingCreditExpiryGroup, Jn as TaskRunDetailResponse, Jt as SessionMessagesResponse, K as BillingCatalogProduct, Kn as SpaceUsageResponse, Kt as SessionMessageResponse, Ln as SpaceMeta, Lt as LabelSource, Mn as SpaceFsUploadResponse, Mt as LabelAssignmentRecord, Nn as SpaceFsWriteFileInput, Nt as LabelListItem, On as SpaceFsUploadError, Ot as JsonPrimitive, Pn as SpaceInvitation, Pt as LabelRecord, Q as BillingOpenOverageList, Qn as CreateGenerationTaskRequest, Qt as SessionTurnSignedUrlsResponse, Rn as SpaceModListItem, Rt as MeResponse, Sn as SpaceFsReadFilesError, St as ExploreSpacesResponse, Tn as SpaceFsTreeResponse, Tt as GlobalSearchType, U as AcceptInvitationResponse, Un as SpaceSandboxConfig, Ut as PromptTemplateCatalogResponse, Vn as SpaceRole, Vt as PromptAccessMode, W as ApiError, Wn as SpaceSessionsResponse, Wt as ResourceLabelsResponse, X as BillingCreditStatus, Xn as UserProfile, Xt as SessionTurnIndexResponse, Y as BillingCreditGrantStatus, Yn as TaskRunRecord, Yt as SessionRecord, Z as BillingCreditUnit, Zn as UserRulesResponse, Zt as SessionTurnResponse, _n as SpaceFsEntry, _r as DiscordChannelConfig, _t as CreateSpacePromptInput, an as SpaceChannelBindingInput, ar as GenerationPolicy, at as BillingProductKind, bn as SpaceFsMoveInput, br as HttpError, bt as ExploreSection, cn as SpaceConfigInput, ct as BillingSubscriptionSummary, dn as SpaceEnvInput, dt as Channel, en as SessionTurnWindowResponse, er as GenerationTaskResult, et as BillingPaymentStatus, fn as SpaceFsCompleteUploadInput, ft as CheckpointRecord, gn as SpaceFsEncoding, gr as ChannelConfig, gt as CreateSpaceModInput, hn as SpaceFsCreateUploadResponse, hr as GenerationContentBlock, ht as CreateSpaceInput, in as SpaceBootstrapSource, it as BillingProductDisplay, jn as SpaceFsUploadProgress, jt as LabelAssignmentPageInfo, kn as SpaceFsUploadPlanEntry, kt as JsonValue, ln as SpaceConfigResponse, lt as BillingUsageRecordList, mn as SpaceFsCreateUploadInput, mt as CreateInvitationResponse, n as createHttpClient, nn as SpaceAccess, nr as PublicGenerationDeclaration, nt as BillingProductBillingInterval, on as SpaceCheckpointDetailResponse, ot as BillingProductPricing, pn as SpaceFsCompleteUploadResponse, pt as CreateInvitationInput, q as BillingCheckoutResult, qn as SpaceUsageSummary, qt as SessionMessagesPaginatedResponse, rn as SpaceAccessPolicy, rt as BillingProductCreditBenefit, sn as SpaceConfig, st as BillingRedemptionResult, t as CohubHttpClient, tn as SessionTurnsPaginatedResponse, tr as ListGenerationModelsResponse, tt as BillingPluginStatus, un as SpaceCreateResponse, ut as BillingUsageRecordStatus, vn as SpaceFsFileKind, vr as CohubClientOptions, vt as CreateSpacePromptResponse, wn as SpaceFsReadFilesResponse, wt as GlobalSearchResult, xn as SpaceFsPreparingFile, xr as HttpTransport, xt as ExploreSpaceItem, yn as SpaceFsFileResponse, yr as Fetch, yt as CronJobRecord, zn as SpacePublicProfile, zt as ModelCatalogEntry } from "./chunks/http.js";
|
|
3
|
+
export { AcceptInvitationResponse, ApiError, BillingCatalog, BillingCatalogProduct, BillingCheckoutResult, BillingCreditExpiryGroup, BillingCreditGrantStatus, BillingCreditStatus, BillingCreditUnit, BillingOpenOverageList, BillingOpenOverageStatus, BillingPaymentStatus, BillingPluginStatus, BillingProductBillingInterval, BillingProductCreditBenefit, BillingProductDisplay, BillingProductKind, BillingProductPricing, BillingRedemptionResult, BillingSubscriptionSummary, BillingUsageRecordList, BillingUsageRecordStatus, Channel, type ChannelConfig, CheckpointRecord, type CohubClientOptions, CohubHttpClient, type ContentBlock, type CreateGenerationTaskRequest, type CreateGenerationTaskResponse, CreateInvitationInput, CreateInvitationResponse, CreateSpaceInput, CreateSpaceModInput, CreateSpacePromptInput, CreateSpacePromptResponse, CronJobRecord, type DiscordChannelConfig, ExploreSection, ExploreSpaceItem, ExploreSpacesResponse, type Fetch, type GenerationContentBlock, type GenerationPolicy, type GenerationTaskResult, GlobalSearchResponse, GlobalSearchResult, GlobalSearchType, HttpError, HttpTransport, InvitationDetail, JsonObject, JsonPrimitive, JsonValue, LabelAssignmentListItem, LabelAssignmentPageInfo, LabelAssignmentRecord, LabelListItem, LabelRecord, LabelResourceType, LabelScopeType, LabelSource, type ListGenerationModelsResponse, MeResponse, type MessageRecord, ModelCatalogEntry, Permission, PromptAccessMode, PromptTemplateCatalogEntry, PromptTemplateCatalogResponse, type PublicGenerationDeclaration, ResourceLabelsResponse, SessionBindingRecord, type SessionForkRecord, SessionMessageResponse, SessionMessagesPaginatedResponse, SessionMessagesResponse, SessionRecord, type SessionTurnIndexItem, SessionTurnIndexResponse, type SessionTurnRecord, SessionTurnResponse, type SessionTurnSegmentRecord, SessionTurnSignedUrlsResponse, SessionTurnStreamSnapshotResponse, SessionTurnWindowResponse, SessionTurnsPaginatedResponse, SpaceAccess, SpaceAccessPolicy, SpaceBootstrapSource, SpaceChannelBindingInput, SpaceCheckpointDetailResponse, SpaceConfig, SpaceConfigInput, SpaceConfigResponse, SpaceCreateResponse, SpaceEnvInput, SpaceFsCompleteUploadInput, SpaceFsCompleteUploadResponse, SpaceFsCreateUploadInput, SpaceFsCreateUploadResponse, SpaceFsEncoding, SpaceFsEntry, SpaceFsFileKind, SpaceFsFileResponse, SpaceFsMoveInput, SpaceFsPreparingFile, SpaceFsReadFilesError, SpaceFsReadFilesInput, SpaceFsReadFilesResponse, SpaceFsTreeResponse, SpaceFsUploadDestination, SpaceFsUploadEntry, SpaceFsUploadError, SpaceFsUploadPlanEntry, SpaceFsUploadPlanEntryInput, SpaceFsUploadProgress, SpaceFsUploadResponse, SpaceFsWriteFileInput, SpaceInvitation, SpaceListItem, SpaceMember, SpaceMeta, SpaceModListItem, SpacePublicProfile, SpaceRecord, SpaceRole, SpaceSandboxAutoDestroyPolicy, SpaceSandboxConfig, SpaceSessionsResponse, SpaceUsageHourlyStat, SpaceUsageResponse, SpaceUsageSummary, TaskRunDetailResponse, TaskRunRecord, UserProfile, UserRulesResponse, createHttpClient };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as normalizeBaseUrl, D as resolveWebsocketUrl, E as resolveCohubEnvironment, S as CohubEnvironment, T as resolveApiBaseUrl, _ as SessionTurnIndexItem, b as ContentBlock, c as createWebsocketClient, f as MessageRecord, g as SessionTurnSegmentRecord, m as SessionForkRecord, r as WebsocketClient, v as SessionTurnRecord, w as normalizeWebsocketUrl, x as COHUB_ENVIRONMENTS } from "./chunks/websocket.js";
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as BillingOpenOverageStatus, $n as CreateGenerationTaskResponse, $t as SessionTurnStreamSnapshotResponse, A as SessionPatchStatus, An as SpaceFsUploadPlanEntryInput, At as LabelAssignmentListItem, B as GenerationsApi, Bn as SpaceRecord, Bt as Permission, C as SessionGenerationStreamClient, Cn as SpaceFsReadFilesInput, Ct as GlobalSearchResponse, D as SessionPatchApplyResult, Dn as SpaceFsUploadEntry, Dt as JsonObject, E as SessionPatchApplyInput, En as SpaceFsUploadDestination, Et as InvitationDetail, F as CreatePublicAssetUploadResponse, Fn as SpaceListItem, Ft as LabelResourceType, G as BillingCatalog, Gn as SpaceUsageHourlyStat, Gt as SessionBindingRecord, H as ChannelsApi, Hn as SpaceSandboxAutoDestroyPolicy, Ht as PromptTemplateCatalogEntry, I as PublicAssetPurpose, In as SpaceMember, It as LabelScopeType, J as BillingCreditExpiryGroup, Jn as TaskRunDetailResponse, Jt as SessionMessagesResponse, K as BillingCatalogProduct, Kn as SpaceUsageResponse, Kt as SessionMessageResponse, L as PublicAssetsApi, Ln as SpaceMeta, Lt as LabelSource, M as SessionAccessApi, Mn as SpaceFsUploadResponse, Mt as LabelAssignmentRecord, N as SearchApi, Nn as SpaceFsWriteFileInput, Nt as LabelListItem, O as SessionPatchReducer, On as SpaceFsUploadError, Ot as JsonPrimitive, P as CreatePublicAssetUploadInput, Pn as SpaceInvitation, Pt as LabelRecord, Q as BillingOpenOverageList, Qn as CreateGenerationTaskRequest, Qt as SessionTurnSignedUrlsResponse, R as PromptsApi, Rn as SpaceModListItem, Rt as MeResponse, S as GenerationStreamTurnUpdatedEvent, Sn as SpaceFsReadFilesError, Sr as RawHttpResponse, St as ExploreSpacesResponse, T as parseAssistantMessageCommit, Tn as SpaceFsTreeResponse, Tt as GlobalSearchType, U as AcceptInvitationResponse, Un as SpaceSandboxConfig, Ut as PromptTemplateCatalogResponse, V as CronJobsApi, Vn as SpaceRole, Vt as PromptAccessMode, W as ApiError, Wn as SpaceSessionsResponse, Wt as ResourceLabelsResponse, X as BillingCreditStatus, Xn as UserProfile, Xt as SessionTurnIndexResponse, Y as BillingCreditGrantStatus, Yn as TaskRunRecord, Yt as SessionRecord, Z as BillingCreditUnit, Zn as UserRulesResponse, Zt as SessionTurnResponse, _ as GenerationStreamFinalizedEvent, _n as SpaceFsEntry, _r as DiscordChannelConfig, _t as CreateSpacePromptInput, a as SessionEventName, an as SpaceChannelBindingInput, ar as GenerationPolicy, at as BillingProductKind, b as GenerationStreamStateEvent, bn as SpaceFsMoveInput, br as HttpError, bt as ExploreSection, c as SpaceClient, cn as SpaceConfigInput, cr as decodeGenerationPolicy, ct as BillingSubscriptionSummary, d as WebSocketConnectionState, dn as SpaceEnvInput, dr as findGenerationModelPolicy, dt as Channel, en as SessionTurnWindowResponse, er as GenerationTaskResult, et as BillingPaymentStatus, f as PublicInviteApi, fn as SpaceFsCompleteUploadInput, fr as getAllowedGenerationModelIds, ft as CheckpointRecord, g as GenerationStreamEvent, gn as SpaceFsEncoding, gr as ChannelConfig, gt as CreateSpaceModInput, h as GenerationStreamErrorEvent, hn as SpaceFsCreateUploadResponse, hr as GenerationContentBlock, ht as CreateSpaceInput, i as TasksApi, in as SpaceBootstrapSource, ir as GenerationParameterConstraint, it as BillingProductDisplay, j as createSessionPatchReducer, jn as SpaceFsUploadProgress, jt as LabelAssignmentPageInfo, k as SessionPatchState, kn as SpaceFsUploadPlanEntry, kt as JsonValue, l as SpaceEventName, ln as SpaceConfigResponse, lr as encodeGenerationPolicy, lt as BillingUsageRecordList, m as GenerationStreamCommitEvent, mn as SpaceFsCreateUploadInput, mr as parseGenerationPolicyFromEnv, mt as CreateInvitationResponse, n as createHttpClient, nn as SpaceAccess, nr as PublicGenerationDeclaration, nt as BillingProductBillingInterval, o as SessionSubscriptionHandlers, on as SpaceCheckpointDetailResponse, or as GenerationPolicyError, ot as BillingProductPricing, p as AssistantMessageCommit, pn as SpaceFsCompleteUploadResponse, pr as normalizeGenerationPolicy, pt as CreateInvitationInput, q as BillingCheckoutResult, qn as SpaceUsageSummary, qt as SessionMessagesPaginatedResponse, r as UserApi, rn as SpaceAccessPolicy, rr as GenerationModelPolicy, rt as BillingProductCreditBenefit, s as SpaceChannelBindingRecord, sn as SpaceConfig, sr as assertGenerationRequestAllowedByPolicy, st as BillingRedemptionResult, t as CohubHttpClient, tn as SessionTurnsPaginatedResponse, tr as ListGenerationModelsResponse, tt as BillingPluginStatus, u as SpacesApi, un as SpaceCreateResponse, ur as filterGenerationDeclarationsByPolicy, ut as BillingUsageRecordStatus, v as GenerationStreamIntermediateMessage, vn as SpaceFsFileKind, vr as CohubClientOptions, vt as CreateSpacePromptResponse, w as createSessionGenerationStreamClient, wn as SpaceFsReadFilesResponse, wt as GlobalSearchResult, x as GenerationStreamSubscriptionHandlers, xn as SpaceFsPreparingFile, xr as HttpTransport, xt as ExploreSpaceItem, y as GenerationStreamOutOfSyncEvent, yn as SpaceFsFileResponse, yr as Fetch, yt as CronJobRecord, z as ModelsApi, zn as SpacePublicProfile, zt as ModelCatalogEntry } from "./chunks/http.js";
|
|
3
3
|
|
|
4
4
|
//#region src/apis/billing.d.ts
|
|
5
5
|
declare class BillingApi {
|
|
@@ -10,6 +10,38 @@ declare class BillingApi {
|
|
|
10
10
|
}): Promise<{
|
|
11
11
|
credit: BillingCreditStatus;
|
|
12
12
|
}>;
|
|
13
|
+
getUsageRecords(input?: {
|
|
14
|
+
tokenType?: string;
|
|
15
|
+
page?: number;
|
|
16
|
+
limit?: number;
|
|
17
|
+
}): Promise<{
|
|
18
|
+
usage: BillingUsageRecordList;
|
|
19
|
+
}>;
|
|
20
|
+
getOverages(input?: {
|
|
21
|
+
tokenType?: string;
|
|
22
|
+
page?: number;
|
|
23
|
+
limit?: number;
|
|
24
|
+
}): Promise<{
|
|
25
|
+
overages: BillingOpenOverageList;
|
|
26
|
+
}>;
|
|
27
|
+
getCatalog(): Promise<{
|
|
28
|
+
catalog: BillingCatalog;
|
|
29
|
+
}>;
|
|
30
|
+
purchaseAddon(productKey: string, input?: {
|
|
31
|
+
returnUrl?: string;
|
|
32
|
+
}): Promise<{
|
|
33
|
+
checkout: BillingCheckoutResult;
|
|
34
|
+
}>;
|
|
35
|
+
subscribePlan(productKey: string, input?: {
|
|
36
|
+
returnUrl?: string;
|
|
37
|
+
}): Promise<{
|
|
38
|
+
checkout: BillingCheckoutResult;
|
|
39
|
+
}>;
|
|
40
|
+
redeemCode(input: {
|
|
41
|
+
code: string;
|
|
42
|
+
}): Promise<{
|
|
43
|
+
redemption: BillingRedemptionResult;
|
|
44
|
+
}>;
|
|
13
45
|
}
|
|
14
46
|
//#endregion
|
|
15
47
|
//#region src/apis/explore.d.ts
|
|
@@ -43,4 +75,4 @@ declare class CohubClient {
|
|
|
43
75
|
}
|
|
44
76
|
declare const createCohubClient: (options?: CohubClientOptions) => CohubClient;
|
|
45
77
|
//#endregion
|
|
46
|
-
export { AcceptInvitationResponse, ApiError, type AssistantMessageCommit, BillingApi, BillingCreditExpiryGroup, BillingCreditGrantStatus, BillingCreditStatus, BillingCreditUnit, BillingOpenOverageStatus, BillingPluginStatus, COHUB_ENVIRONMENTS, Channel, type ChannelConfig, CheckpointRecord, CohubClient, type CohubClientOptions, type CohubEnvironment, CohubHttpClient, type ContentBlock, type CreateGenerationTaskRequest, type CreateGenerationTaskResponse, CreateInvitationInput, CreateInvitationResponse, type CreatePublicAssetUploadInput, type CreatePublicAssetUploadResponse, CreateSpaceInput, CreateSpaceModInput, CreateSpacePromptInput, CreateSpacePromptResponse, CronJobRecord, type DiscordChannelConfig, ExploreSection, ExploreSpaceItem, ExploreSpacesResponse, type Fetch, type GenerationContentBlock, type GenerationModelPolicy, type GenerationParameterConstraint, type GenerationPolicy, GenerationPolicyError, type GenerationStreamCommitEvent, type GenerationStreamErrorEvent, type GenerationStreamEvent, type GenerationStreamFinalizedEvent, type GenerationStreamIntermediateMessage, type GenerationStreamOutOfSyncEvent, type GenerationStreamStateEvent, type GenerationStreamSubscriptionHandlers, type GenerationStreamTurnUpdatedEvent, type GenerationTaskResult, GlobalSearchResponse, GlobalSearchResult, GlobalSearchType, HttpError, InvitationDetail, JsonObject, JsonPrimitive, JsonValue, type ListGenerationModelsResponse, MeResponse, type MessageRecord, ModelCatalogEntry, Permission, PromptTemplateCatalogEntry, PromptTemplateCatalogResponse, type PublicAssetPurpose, type PublicGenerationDeclaration, type RawHttpResponse, SessionBindingRecord, type SessionEventName, type SessionForkRecord, SessionGenerationStreamClient, SessionMessageResponse, SessionMessagesPaginatedResponse, SessionMessagesResponse, type SessionPatchApplyInput, type SessionPatchApplyResult, SessionPatchReducer, type SessionPatchState, type SessionPatchStatus, SessionRecord, type SessionSubscriptionHandlers, type SessionTurnIndexItem, SessionTurnIndexResponse, type SessionTurnRecord, SessionTurnResponse, type SessionTurnSegmentRecord, SessionTurnSignedUrlsResponse, SessionTurnStreamSnapshotResponse, SessionTurnWindowResponse, SessionTurnsPaginatedResponse, SpaceAccess, SpaceAccessPolicy, SpaceBootstrapSource, SpaceChannelBindingInput, type SpaceChannelBindingRecord, SpaceCheckpointDetailResponse, SpaceConfig, SpaceConfigInput, SpaceConfigResponse, SpaceCreateResponse, SpaceEnvInput, type SpaceEventName, SpaceFsCompleteUploadInput, SpaceFsCompleteUploadResponse, SpaceFsCreateUploadInput, SpaceFsCreateUploadResponse, SpaceFsEncoding, SpaceFsEntry, SpaceFsFileKind, SpaceFsFileResponse, SpaceFsMoveInput, SpaceFsPreparingFile, SpaceFsReadFilesError, SpaceFsReadFilesInput, SpaceFsReadFilesResponse, SpaceFsTreeResponse, SpaceFsUploadDestination, SpaceFsUploadEntry, SpaceFsUploadError, SpaceFsUploadPlanEntry, SpaceFsUploadPlanEntryInput, SpaceFsUploadProgress, SpaceFsUploadResponse, SpaceFsWriteFileInput, SpaceInvitation, SpaceListItem,
|
|
78
|
+
export { AcceptInvitationResponse, ApiError, type AssistantMessageCommit, BillingApi, BillingCatalog, BillingCatalogProduct, BillingCheckoutResult, BillingCreditExpiryGroup, BillingCreditGrantStatus, BillingCreditStatus, BillingCreditUnit, BillingOpenOverageList, BillingOpenOverageStatus, BillingPaymentStatus, BillingPluginStatus, BillingProductBillingInterval, BillingProductCreditBenefit, BillingProductDisplay, BillingProductKind, BillingProductPricing, BillingRedemptionResult, BillingSubscriptionSummary, BillingUsageRecordList, BillingUsageRecordStatus, COHUB_ENVIRONMENTS, Channel, type ChannelConfig, CheckpointRecord, CohubClient, type CohubClientOptions, type CohubEnvironment, CohubHttpClient, type ContentBlock, type CreateGenerationTaskRequest, type CreateGenerationTaskResponse, CreateInvitationInput, CreateInvitationResponse, type CreatePublicAssetUploadInput, type CreatePublicAssetUploadResponse, CreateSpaceInput, CreateSpaceModInput, CreateSpacePromptInput, CreateSpacePromptResponse, CronJobRecord, type DiscordChannelConfig, ExploreSection, ExploreSpaceItem, ExploreSpacesResponse, type Fetch, type GenerationContentBlock, type GenerationModelPolicy, type GenerationParameterConstraint, type GenerationPolicy, GenerationPolicyError, type GenerationStreamCommitEvent, type GenerationStreamErrorEvent, type GenerationStreamEvent, type GenerationStreamFinalizedEvent, type GenerationStreamIntermediateMessage, type GenerationStreamOutOfSyncEvent, type GenerationStreamStateEvent, type GenerationStreamSubscriptionHandlers, type GenerationStreamTurnUpdatedEvent, type GenerationTaskResult, GlobalSearchResponse, GlobalSearchResult, GlobalSearchType, HttpError, InvitationDetail, JsonObject, JsonPrimitive, JsonValue, LabelAssignmentListItem, LabelAssignmentPageInfo, LabelAssignmentRecord, LabelListItem, LabelRecord, LabelResourceType, LabelScopeType, LabelSource, type ListGenerationModelsResponse, MeResponse, type MessageRecord, ModelCatalogEntry, Permission, PromptAccessMode, PromptTemplateCatalogEntry, PromptTemplateCatalogResponse, type PublicAssetPurpose, type PublicGenerationDeclaration, type RawHttpResponse, ResourceLabelsResponse, SessionBindingRecord, type SessionEventName, type SessionForkRecord, SessionGenerationStreamClient, SessionMessageResponse, SessionMessagesPaginatedResponse, SessionMessagesResponse, type SessionPatchApplyInput, type SessionPatchApplyResult, SessionPatchReducer, type SessionPatchState, type SessionPatchStatus, SessionRecord, type SessionSubscriptionHandlers, type SessionTurnIndexItem, SessionTurnIndexResponse, type SessionTurnRecord, SessionTurnResponse, type SessionTurnSegmentRecord, SessionTurnSignedUrlsResponse, SessionTurnStreamSnapshotResponse, SessionTurnWindowResponse, SessionTurnsPaginatedResponse, SpaceAccess, SpaceAccessPolicy, SpaceBootstrapSource, SpaceChannelBindingInput, type SpaceChannelBindingRecord, SpaceCheckpointDetailResponse, SpaceConfig, SpaceConfigInput, SpaceConfigResponse, SpaceCreateResponse, SpaceEnvInput, type SpaceEventName, SpaceFsCompleteUploadInput, SpaceFsCompleteUploadResponse, SpaceFsCreateUploadInput, SpaceFsCreateUploadResponse, SpaceFsEncoding, SpaceFsEntry, SpaceFsFileKind, SpaceFsFileResponse, SpaceFsMoveInput, SpaceFsPreparingFile, SpaceFsReadFilesError, SpaceFsReadFilesInput, SpaceFsReadFilesResponse, SpaceFsTreeResponse, SpaceFsUploadDestination, SpaceFsUploadEntry, SpaceFsUploadError, SpaceFsUploadPlanEntry, SpaceFsUploadPlanEntryInput, SpaceFsUploadProgress, SpaceFsUploadResponse, SpaceFsWriteFileInput, SpaceInvitation, SpaceListItem, SpaceMember, SpaceMeta, SpaceModListItem, SpacePublicProfile, SpaceRecord, SpaceRole, SpaceSandboxAutoDestroyPolicy, SpaceSandboxConfig, SpaceSessionsResponse, SpaceUsageHourlyStat, SpaceUsageResponse, SpaceUsageSummary, TaskRunDetailResponse, TaskRunRecord, UserProfile, UserRulesResponse, type WebSocketConnectionState, WebsocketClient, assertGenerationRequestAllowedByPolicy, createCohubClient, createHttpClient, createSessionGenerationStreamClient, createSessionPatchReducer, createWebsocketClient, decodeGenerationPolicy, encodeGenerationPolicy, filterGenerationDeclarationsByPolicy, findGenerationModelPolicy, getAllowedGenerationModelIds, normalizeBaseUrl, normalizeGenerationPolicy, normalizeWebsocketUrl, parseAssistantMessageCommit, parseGenerationPolicyFromEnv, resolveApiBaseUrl, resolveCohubEnvironment, resolveWebsocketUrl };
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,43 @@ var BillingApi = class {
|
|
|
11
11
|
const query = input?.tokenType ? `?tokenType=${encodeURIComponent(input.tokenType)}` : "";
|
|
12
12
|
return this.transport.request(`/api/billing/credits${query}`);
|
|
13
13
|
}
|
|
14
|
+
async getUsageRecords(input) {
|
|
15
|
+
const params = new URLSearchParams();
|
|
16
|
+
if (input?.tokenType) params.set("tokenType", input.tokenType);
|
|
17
|
+
if (input?.page) params.set("page", String(input.page));
|
|
18
|
+
if (input?.limit) params.set("limit", String(input.limit));
|
|
19
|
+
const query = params.toString();
|
|
20
|
+
return this.transport.request(`/api/billing/usage-records${query ? `?${query}` : ""}`);
|
|
21
|
+
}
|
|
22
|
+
async getOverages(input) {
|
|
23
|
+
const params = new URLSearchParams();
|
|
24
|
+
if (input?.tokenType) params.set("tokenType", input.tokenType);
|
|
25
|
+
if (input?.page) params.set("page", String(input.page));
|
|
26
|
+
if (input?.limit) params.set("limit", String(input.limit));
|
|
27
|
+
const query = params.toString();
|
|
28
|
+
return this.transport.request(`/api/billing/overages${query ? `?${query}` : ""}`);
|
|
29
|
+
}
|
|
30
|
+
async getCatalog() {
|
|
31
|
+
return this.transport.request("/api/billing/catalog");
|
|
32
|
+
}
|
|
33
|
+
async purchaseAddon(productKey, input) {
|
|
34
|
+
return this.transport.request(`/api/billing/addons/${encodeURIComponent(productKey)}/purchase`, {
|
|
35
|
+
method: "POST",
|
|
36
|
+
body: JSON.stringify(input ?? {})
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
async subscribePlan(productKey, input) {
|
|
40
|
+
return this.transport.request(`/api/billing/plans/${encodeURIComponent(productKey)}/subscribe`, {
|
|
41
|
+
method: "POST",
|
|
42
|
+
body: JSON.stringify(input ?? {})
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
async redeemCode(input) {
|
|
46
|
+
return this.transport.request("/api/billing/redemption-codes/redeem", {
|
|
47
|
+
method: "POST",
|
|
48
|
+
body: JSON.stringify(input)
|
|
49
|
+
});
|
|
50
|
+
}
|
|
14
51
|
};
|
|
15
52
|
//#endregion
|
|
16
53
|
//#region src/apis/explore.ts
|