@neta-art/cohub 1.19.0 → 1.21.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 +228 -27
- package/dist/chunks/http.js +63 -11
- 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;
|
|
@@ -688,6 +825,11 @@ type GlobalSearchResponse = {
|
|
|
688
825
|
source: "remote";
|
|
689
826
|
degraded?: boolean;
|
|
690
827
|
};
|
|
828
|
+
type CreateSpaceSessionInput = {
|
|
829
|
+
title?: string | null;
|
|
830
|
+
source?: string | null;
|
|
831
|
+
labelRefs?: string[];
|
|
832
|
+
};
|
|
691
833
|
type SpaceSessionsResponse = {
|
|
692
834
|
sessions: SessionRecord[];
|
|
693
835
|
forks?: Array<SessionForkRecord & {
|
|
@@ -709,6 +851,7 @@ type CreateSpacePromptInput = {
|
|
|
709
851
|
clientMessageId?: string | null;
|
|
710
852
|
generationPolicy?: GenerationPolicy | null;
|
|
711
853
|
accessMode?: PromptAccessMode | null;
|
|
854
|
+
labelRefs?: string[];
|
|
712
855
|
schedule?: {
|
|
713
856
|
mode?: "immediate";
|
|
714
857
|
} | {
|
|
@@ -798,21 +941,42 @@ type SpaceMember = {
|
|
|
798
941
|
createdAt: string;
|
|
799
942
|
updatedAt: string;
|
|
800
943
|
};
|
|
801
|
-
type
|
|
802
|
-
type
|
|
803
|
-
type
|
|
944
|
+
type LabelScopeType = "space" | "user" | "org";
|
|
945
|
+
type LabelSource = "user" | "system";
|
|
946
|
+
type LabelResourceType = "session" | "checkpoint" | "file";
|
|
947
|
+
type LabelRecord = {
|
|
804
948
|
id: string;
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
949
|
+
scopeType: LabelScopeType;
|
|
950
|
+
scopeId: string;
|
|
951
|
+
name: string;
|
|
952
|
+
slug: string;
|
|
953
|
+
parentId: string | null;
|
|
954
|
+
depth: number;
|
|
955
|
+
source: LabelSource;
|
|
956
|
+
systemKey: string | null;
|
|
957
|
+
rank: number;
|
|
958
|
+
createdBy: string | null;
|
|
959
|
+
createdAt: string | null;
|
|
960
|
+
updatedAt: string | null;
|
|
961
|
+
};
|
|
962
|
+
type LabelListItem = LabelRecord & {
|
|
963
|
+
children?: LabelListItem[];
|
|
964
|
+
};
|
|
965
|
+
type LabelAssignmentRecord = {
|
|
966
|
+
id: string;
|
|
967
|
+
labelId: string;
|
|
968
|
+
scopeType: LabelScopeType;
|
|
969
|
+
scopeId: string;
|
|
970
|
+
resourceType: LabelResourceType;
|
|
808
971
|
resourceRef: string;
|
|
809
|
-
label: string | null;
|
|
810
972
|
rank: number;
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
973
|
+
source: LabelSource;
|
|
974
|
+
createdBy: string | null;
|
|
975
|
+
meta: Record<string, unknown> | null;
|
|
976
|
+
createdAt: string | null;
|
|
977
|
+
updatedAt: string | null;
|
|
814
978
|
};
|
|
815
|
-
type
|
|
979
|
+
type LabelAssignmentListItem = LabelAssignmentRecord & {
|
|
816
980
|
href: string;
|
|
817
981
|
resource: {
|
|
818
982
|
title: string;
|
|
@@ -820,6 +984,14 @@ type SpaceMarkListItem = SpaceMarkRecord & {
|
|
|
820
984
|
status: string | null;
|
|
821
985
|
} | null;
|
|
822
986
|
};
|
|
987
|
+
type LabelAssignmentPageInfo = {
|
|
988
|
+
hasMore: boolean;
|
|
989
|
+
nextCursor: string | null;
|
|
990
|
+
};
|
|
991
|
+
type ResourceLabelsResponse = {
|
|
992
|
+
labels: LabelListItem[];
|
|
993
|
+
assignments: LabelAssignmentRecord[];
|
|
994
|
+
};
|
|
823
995
|
type SpaceModListItem = {
|
|
824
996
|
id: string;
|
|
825
997
|
spaceId: string;
|
|
@@ -869,7 +1041,7 @@ type ExploreSpacesResponse = {
|
|
|
869
1041
|
sections: ExploreSection[];
|
|
870
1042
|
spaces: ExploreSpaceItem[];
|
|
871
1043
|
};
|
|
872
|
-
type Permission = "space.view" | "space.edit" | "space.
|
|
1044
|
+
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";
|
|
873
1045
|
type SpaceAccess = {
|
|
874
1046
|
role: SpaceRole | null;
|
|
875
1047
|
permissions: Permission[];
|
|
@@ -1413,10 +1585,7 @@ declare class SpaceSessionsApi {
|
|
|
1413
1585
|
private readonly spaceId;
|
|
1414
1586
|
private readonly websocketClient;
|
|
1415
1587
|
constructor(transport: HttpTransport, spaceId: string, websocketClient: WebsocketClient | null);
|
|
1416
|
-
create(input?: {
|
|
1417
|
-
title?: string;
|
|
1418
|
-
source?: string;
|
|
1419
|
-
}): Promise<{
|
|
1588
|
+
create(input?: CreateSpaceSessionInput): Promise<{
|
|
1420
1589
|
ok: true;
|
|
1421
1590
|
session: SessionRecord;
|
|
1422
1591
|
}>;
|
|
@@ -1573,24 +1742,56 @@ declare class SpaceSandboxApi {
|
|
|
1573
1742
|
type SpaceRunCommandResponse = {
|
|
1574
1743
|
taskRunId: string;
|
|
1575
1744
|
};
|
|
1576
|
-
declare class
|
|
1745
|
+
declare class SpaceLabelsApi {
|
|
1577
1746
|
private readonly transport;
|
|
1578
1747
|
private readonly spaceId;
|
|
1579
1748
|
constructor(transport: HttpTransport, spaceId: string);
|
|
1580
|
-
list(
|
|
1581
|
-
|
|
1749
|
+
list(): Promise<{
|
|
1750
|
+
labels: LabelListItem[];
|
|
1582
1751
|
}>;
|
|
1583
|
-
create(
|
|
1584
|
-
|
|
1585
|
-
|
|
1752
|
+
create(labelRef: string): Promise<{
|
|
1753
|
+
labels: LabelListItem[];
|
|
1754
|
+
}>;
|
|
1755
|
+
update(labelRef: string, input: {
|
|
1756
|
+
name?: string;
|
|
1757
|
+
parentRef?: string | null;
|
|
1758
|
+
rank?: number;
|
|
1759
|
+
}): Promise<{
|
|
1760
|
+
label: LabelListItem;
|
|
1761
|
+
}>;
|
|
1762
|
+
delete(labelRef: string): Promise<{
|
|
1763
|
+
ok: true;
|
|
1764
|
+
}>;
|
|
1765
|
+
reorder(labelRefs: string[]): Promise<{
|
|
1766
|
+
labels: LabelListItem[];
|
|
1767
|
+
}>;
|
|
1768
|
+
listItems(labelRef: string, input?: {
|
|
1769
|
+
limit?: number;
|
|
1770
|
+
cursor?: string | null;
|
|
1771
|
+
}): Promise<{
|
|
1772
|
+
items: LabelAssignmentListItem[];
|
|
1773
|
+
pageInfo: LabelAssignmentPageInfo;
|
|
1774
|
+
}>;
|
|
1775
|
+
attach(labelRef: string, input: {
|
|
1776
|
+
resourceType: LabelResourceType;
|
|
1586
1777
|
resourceRef: string;
|
|
1587
|
-
label?: string | null;
|
|
1588
1778
|
}): Promise<{
|
|
1589
|
-
|
|
1779
|
+
assignment: LabelAssignmentRecord;
|
|
1590
1780
|
}>;
|
|
1591
|
-
|
|
1781
|
+
detach(labelRef: string, input: {
|
|
1782
|
+
resourceType: LabelResourceType;
|
|
1783
|
+
resourceRef: string;
|
|
1784
|
+
}): Promise<{
|
|
1592
1785
|
ok: true;
|
|
1593
1786
|
}>;
|
|
1787
|
+
getResourceLabels(resourceType: LabelResourceType, resourceRef: string): Promise<{
|
|
1788
|
+
labels: LabelListItem[];
|
|
1789
|
+
assignments: LabelAssignmentRecord[];
|
|
1790
|
+
}>;
|
|
1791
|
+
setResourceLabels(resourceType: LabelResourceType, resourceRef: string, labelRefs: string[]): Promise<{
|
|
1792
|
+
labels: LabelListItem[];
|
|
1793
|
+
assignments: LabelAssignmentRecord[];
|
|
1794
|
+
}>;
|
|
1594
1795
|
}
|
|
1595
1796
|
declare class SpaceCheckpointsApi {
|
|
1596
1797
|
private readonly transport;
|
|
@@ -1620,7 +1821,7 @@ declare class SpaceClient {
|
|
|
1620
1821
|
readonly env: SpaceEnvApi;
|
|
1621
1822
|
readonly sandbox: SpaceSandboxApi;
|
|
1622
1823
|
readonly invitations: SpaceInvitationsApi;
|
|
1623
|
-
readonly
|
|
1824
|
+
readonly labels: SpaceLabelsApi;
|
|
1624
1825
|
constructor(id: string, transport: HttpTransport, websocketClient: WebsocketClient | null);
|
|
1625
1826
|
get(customFetch?: Fetch): Promise<SpaceRecord>;
|
|
1626
1827
|
prompt(input: CreateSpacePromptInput): Promise<CreateSpacePromptResponse>;
|
|
@@ -1704,4 +1905,4 @@ declare class CohubHttpClient {
|
|
|
1704
1905
|
}
|
|
1705
1906
|
declare const createHttpClient: (options?: CohubClientOptions) => CohubHttpClient;
|
|
1706
1907
|
//#endregion
|
|
1707
|
-
export {
|
|
1908
|
+
export { BillingOpenOverageStatus as $, CreateGenerationTaskRequest as $n, SessionTurnSignedUrlsResponse as $t, SessionPatchStatus as A, SpaceFsUploadPlanEntry as An, JsonValue as At, GenerationsApi as B, SpacePublicProfile as Bn, ModelCatalogEntry as Bt, SessionGenerationStreamClient as C, SpaceFsReadFilesError as Cn, RawHttpResponse as Cr, ExploreSpacesResponse as Ct, SessionPatchApplyResult as D, SpaceFsUploadDestination as Dn, InvitationDetail as Dt, SessionPatchApplyInput as E, SpaceFsTreeResponse as En, GlobalSearchType as Et, CreatePublicAssetUploadResponse as F, SpaceInvitation as Fn, LabelRecord as Ft, BillingCatalog as G, SpaceSessionsResponse as Gn, ResourceLabelsResponse as Gt, ChannelsApi as H, SpaceRole as Hn, PromptAccessMode as Ht, PublicAssetPurpose as I, SpaceListItem as In, LabelResourceType as It, BillingCreditExpiryGroup as J, SpaceUsageSummary as Jn, SessionMessagesPaginatedResponse as Jt, BillingCatalogProduct as K, SpaceUsageHourlyStat as Kn, SessionBindingRecord as Kt, PublicAssetsApi as L, SpaceMember as Ln, LabelScopeType as Lt, SessionAccessApi as M, SpaceFsUploadProgress as Mn, LabelAssignmentPageInfo as Mt, SearchApi as N, SpaceFsUploadResponse as Nn, LabelAssignmentRecord as Nt, SessionPatchReducer as O, SpaceFsUploadEntry as On, JsonObject as Ot, CreatePublicAssetUploadInput as P, SpaceFsWriteFileInput as Pn, LabelListItem as Pt, BillingOpenOverageList as Q, UserRulesResponse as Qn, SessionTurnResponse as Qt, PromptsApi as R, SpaceMeta as Rn, LabelSource as Rt, GenerationStreamTurnUpdatedEvent as S, SpaceFsPreparingFile as Sn, HttpTransport as Sr, ExploreSpaceItem as St, parseAssistantMessageCommit as T, SpaceFsReadFilesResponse as Tn, GlobalSearchResult as Tt, AcceptInvitationResponse as U, SpaceSandboxAutoDestroyPolicy as Un, PromptTemplateCatalogEntry as Ut, CronJobsApi as V, SpaceRecord as Vn, Permission as Vt, ApiError as W, SpaceSandboxConfig as Wn, PromptTemplateCatalogResponse as Wt, BillingCreditStatus as X, TaskRunRecord as Xn, SessionRecord as Xt, BillingCreditGrantStatus as Y, TaskRunDetailResponse as Yn, SessionMessagesResponse as Yt, BillingCreditUnit as Z, UserProfile as Zn, SessionTurnIndexResponse as Zt, GenerationStreamFinalizedEvent as _, SpaceFsEncoding as _n, ChannelConfig as _r, CreateSpacePromptInput as _t, SessionEventName as a, SpaceBootstrapSource as an, GenerationParameterConstraint as ar, BillingProductKind as at, GenerationStreamStateEvent as b, SpaceFsFileResponse as bn, Fetch as br, CronJobRecord as bt, SpaceClient as c, SpaceConfig as cn, assertGenerationRequestAllowedByPolicy as cr, BillingSubscriptionSummary as ct, WebSocketConnectionState as d, SpaceCreateResponse as dn, filterGenerationDeclarationsByPolicy as dr, Channel as dt, SessionTurnStreamSnapshotResponse as en, CreateGenerationTaskResponse as er, BillingPaymentStatus as et, PublicInviteApi as f, SpaceEnvInput as fn, findGenerationModelPolicy as fr, CheckpointRecord as ft, GenerationStreamEvent as g, SpaceFsCreateUploadResponse as gn, GenerationContentBlock as gr, CreateSpaceModInput as gt, GenerationStreamErrorEvent as h, SpaceFsCreateUploadInput as hn, parseGenerationPolicyFromEnv as hr, CreateSpaceInput as ht, TasksApi as i, SpaceAccessPolicy as in, GenerationModelPolicy as ir, BillingProductDisplay as it, createSessionPatchReducer as j, SpaceFsUploadPlanEntryInput as jn, LabelAssignmentListItem as jt, SessionPatchState as k, SpaceFsUploadError as kn, JsonPrimitive as kt, SpaceEventName as l, SpaceConfigInput as ln, decodeGenerationPolicy as lr, BillingUsageRecordList as lt, GenerationStreamCommitEvent as m, SpaceFsCompleteUploadResponse as mn, normalizeGenerationPolicy as mr, CreateInvitationResponse as mt, createHttpClient as n, SessionTurnsPaginatedResponse as nn, ListGenerationModelsResponse as nr, BillingProductBillingInterval as nt, SessionSubscriptionHandlers as o, SpaceChannelBindingInput as on, GenerationPolicy as or, BillingProductPricing as ot, AssistantMessageCommit as p, SpaceFsCompleteUploadInput as pn, getAllowedGenerationModelIds as pr, CreateInvitationInput as pt, BillingCheckoutResult as q, SpaceUsageResponse as qn, SessionMessageResponse as qt, UserApi as r, SpaceAccess as rn, PublicGenerationDeclaration as rr, BillingProductCreditBenefit as rt, SpaceChannelBindingRecord as s, SpaceCheckpointDetailResponse as sn, GenerationPolicyError as sr, BillingRedemptionResult as st, CohubHttpClient as t, SessionTurnWindowResponse as tn, GenerationTaskResult as tr, BillingPluginStatus as tt, SpacesApi as u, SpaceConfigResponse as un, encodeGenerationPolicy as ur, BillingUsageRecordStatus as ut, GenerationStreamIntermediateMessage as v, SpaceFsEntry as vn, DiscordChannelConfig as vr, CreateSpacePromptResponse as vt, createSessionGenerationStreamClient as w, SpaceFsReadFilesInput as wn, GlobalSearchResponse as wt, GenerationStreamSubscriptionHandlers as x, SpaceFsMoveInput as xn, HttpError as xr, ExploreSection as xt, GenerationStreamOutOfSyncEvent as y, SpaceFsFileKind as yn, CohubClientOptions as yr, CreateSpaceSessionInput as yt, ModelsApi as z, SpaceModListItem as zn, MeResponse as zt };
|
package/dist/chunks/http.js
CHANGED
|
@@ -1669,29 +1669,81 @@ 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
|
-
create(
|
|
1684
|
-
return this.transport.request(`/api/spaces/${this.spaceId}/
|
|
1682
|
+
create(labelRef) {
|
|
1683
|
+
return this.transport.request(`/api/spaces/${this.spaceId}/labels`, {
|
|
1684
|
+
method: "POST",
|
|
1685
|
+
headers: { "Content-Type": "application/json" },
|
|
1686
|
+
body: JSON.stringify({ labelRef })
|
|
1687
|
+
});
|
|
1688
|
+
}
|
|
1689
|
+
update(labelRef, input) {
|
|
1690
|
+
return this.transport.request(`/api/spaces/${this.spaceId}/labels/by-ref`, {
|
|
1691
|
+
method: "PATCH",
|
|
1692
|
+
headers: { "Content-Type": "application/json" },
|
|
1693
|
+
body: JSON.stringify({
|
|
1694
|
+
labelRef,
|
|
1695
|
+
...input
|
|
1696
|
+
})
|
|
1697
|
+
});
|
|
1698
|
+
}
|
|
1699
|
+
delete(labelRef) {
|
|
1700
|
+
const params = new URLSearchParams({ ref: labelRef });
|
|
1701
|
+
return this.transport.request(`/api/spaces/${this.spaceId}/labels/by-ref?${params.toString()}`, { method: "DELETE" });
|
|
1702
|
+
}
|
|
1703
|
+
reorder(labelRefs) {
|
|
1704
|
+
return this.transport.request(`/api/spaces/${this.spaceId}/labels/reorder`, {
|
|
1705
|
+
method: "POST",
|
|
1706
|
+
headers: { "Content-Type": "application/json" },
|
|
1707
|
+
body: JSON.stringify({ labelRefs })
|
|
1708
|
+
});
|
|
1709
|
+
}
|
|
1710
|
+
listItems(labelRef, input) {
|
|
1711
|
+
const params = new URLSearchParams({ ref: labelRef });
|
|
1712
|
+
if (input?.limit) params.set("limit", String(input.limit));
|
|
1713
|
+
if (input?.cursor) params.set("cursor", input.cursor);
|
|
1714
|
+
return this.transport.request(`/api/spaces/${this.spaceId}/labels/items?${params.toString()}`);
|
|
1715
|
+
}
|
|
1716
|
+
attach(labelRef, input) {
|
|
1717
|
+
return this.transport.request(`/api/spaces/${this.spaceId}/labels/attach`, {
|
|
1685
1718
|
method: "POST",
|
|
1686
1719
|
headers: { "Content-Type": "application/json" },
|
|
1687
1720
|
body: JSON.stringify({
|
|
1688
|
-
|
|
1721
|
+
labelRef,
|
|
1689
1722
|
...input
|
|
1690
1723
|
})
|
|
1691
1724
|
});
|
|
1692
1725
|
}
|
|
1693
|
-
|
|
1694
|
-
return this.transport.request(`/api/spaces/${this.spaceId}/
|
|
1726
|
+
detach(labelRef, input) {
|
|
1727
|
+
return this.transport.request(`/api/spaces/${this.spaceId}/labels/detach`, {
|
|
1728
|
+
method: "POST",
|
|
1729
|
+
headers: { "Content-Type": "application/json" },
|
|
1730
|
+
body: JSON.stringify({
|
|
1731
|
+
labelRef,
|
|
1732
|
+
...input
|
|
1733
|
+
})
|
|
1734
|
+
});
|
|
1735
|
+
}
|
|
1736
|
+
getResourceLabels(resourceType, resourceRef) {
|
|
1737
|
+
const params = new URLSearchParams({ resourceRef });
|
|
1738
|
+
return this.transport.request(`/api/spaces/${this.spaceId}/resources/${resourceType}/labels?${params.toString()}`);
|
|
1739
|
+
}
|
|
1740
|
+
setResourceLabels(resourceType, resourceRef, labelRefs) {
|
|
1741
|
+
const params = new URLSearchParams({ resourceRef });
|
|
1742
|
+
return this.transport.request(`/api/spaces/${this.spaceId}/resources/${resourceType}/labels?${params.toString()}`, {
|
|
1743
|
+
method: "PUT",
|
|
1744
|
+
headers: { "Content-Type": "application/json" },
|
|
1745
|
+
body: JSON.stringify({ labelRefs })
|
|
1746
|
+
});
|
|
1695
1747
|
}
|
|
1696
1748
|
};
|
|
1697
1749
|
var SpaceCheckpointsApi = class {
|
|
@@ -1730,7 +1782,7 @@ var SpaceClient = class {
|
|
|
1730
1782
|
env;
|
|
1731
1783
|
sandbox;
|
|
1732
1784
|
invitations;
|
|
1733
|
-
|
|
1785
|
+
labels;
|
|
1734
1786
|
constructor(id, transport, websocketClient) {
|
|
1735
1787
|
this.id = id;
|
|
1736
1788
|
this.transport = transport;
|
|
@@ -1746,7 +1798,7 @@ var SpaceClient = class {
|
|
|
1746
1798
|
this.env = new SpaceEnvApi(transport, id);
|
|
1747
1799
|
this.sandbox = new SpaceSandboxApi(transport, id);
|
|
1748
1800
|
this.invitations = new SpaceInvitationsApi(transport, id);
|
|
1749
|
-
this.
|
|
1801
|
+
this.labels = new SpaceLabelsApi(transport, id);
|
|
1750
1802
|
}
|
|
1751
1803
|
get(customFetch) {
|
|
1752
1804
|
return this.transport.request(`/api/spaces/${this.id}`, { fetch: customFetch });
|
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, PromptAccessMode, 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 CreateGenerationTaskRequest, $t as SessionTurnSignedUrlsResponse, An as SpaceFsUploadPlanEntry, At as JsonValue, Bn as SpacePublicProfile, Bt as ModelCatalogEntry, Cn as SpaceFsReadFilesError, Ct as ExploreSpacesResponse, Dn as SpaceFsUploadDestination, Dt as InvitationDetail, En as SpaceFsTreeResponse, Et as GlobalSearchType, Fn as SpaceInvitation, Ft as LabelRecord, G as BillingCatalog, Gn as SpaceSessionsResponse, Gt as ResourceLabelsResponse, Hn as SpaceRole, Ht as PromptAccessMode, In as SpaceListItem, It as LabelResourceType, J as BillingCreditExpiryGroup, Jn as SpaceUsageSummary, Jt as SessionMessagesPaginatedResponse, K as BillingCatalogProduct, Kn as SpaceUsageHourlyStat, Kt as SessionBindingRecord, Ln as SpaceMember, Lt as LabelScopeType, Mn as SpaceFsUploadProgress, Mt as LabelAssignmentPageInfo, Nn as SpaceFsUploadResponse, Nt as LabelAssignmentRecord, On as SpaceFsUploadEntry, Ot as JsonObject, Pn as SpaceFsWriteFileInput, Pt as LabelListItem, Q as BillingOpenOverageList, Qn as UserRulesResponse, Qt as SessionTurnResponse, Rn as SpaceMeta, Rt as LabelSource, Sn as SpaceFsPreparingFile, Sr as HttpTransport, St as ExploreSpaceItem, Tn as SpaceFsReadFilesResponse, Tt as GlobalSearchResult, U as AcceptInvitationResponse, Un as SpaceSandboxAutoDestroyPolicy, Ut as PromptTemplateCatalogEntry, Vn as SpaceRecord, Vt as Permission, W as ApiError, Wn as SpaceSandboxConfig, Wt as PromptTemplateCatalogResponse, X as BillingCreditStatus, Xn as TaskRunRecord, Xt as SessionRecord, Y as BillingCreditGrantStatus, Yn as TaskRunDetailResponse, Yt as SessionMessagesResponse, Z as BillingCreditUnit, Zn as UserProfile, Zt as SessionTurnIndexResponse, _n as SpaceFsEncoding, _r as ChannelConfig, _t as CreateSpacePromptInput, an as SpaceBootstrapSource, at as BillingProductKind, bn as SpaceFsFileResponse, br as Fetch, bt as CronJobRecord, cn as SpaceConfig, ct as BillingSubscriptionSummary, dn as SpaceCreateResponse, dt as Channel, en as SessionTurnStreamSnapshotResponse, er as CreateGenerationTaskResponse, et as BillingPaymentStatus, fn as SpaceEnvInput, ft as CheckpointRecord, gn as SpaceFsCreateUploadResponse, gr as GenerationContentBlock, gt as CreateSpaceModInput, hn as SpaceFsCreateUploadInput, ht as CreateSpaceInput, in as SpaceAccessPolicy, it as BillingProductDisplay, jn as SpaceFsUploadPlanEntryInput, jt as LabelAssignmentListItem, kn as SpaceFsUploadError, kt as JsonPrimitive, ln as SpaceConfigInput, lt as BillingUsageRecordList, mn as SpaceFsCompleteUploadResponse, mt as CreateInvitationResponse, n as createHttpClient, nn as SessionTurnsPaginatedResponse, nr as ListGenerationModelsResponse, nt as BillingProductBillingInterval, on as SpaceChannelBindingInput, or as GenerationPolicy, ot as BillingProductPricing, pn as SpaceFsCompleteUploadInput, pt as CreateInvitationInput, q as BillingCheckoutResult, qn as SpaceUsageResponse, qt as SessionMessageResponse, rn as SpaceAccess, rr as PublicGenerationDeclaration, rt as BillingProductCreditBenefit, sn as SpaceCheckpointDetailResponse, st as BillingRedemptionResult, t as CohubHttpClient, tn as SessionTurnWindowResponse, tr as GenerationTaskResult, tt as BillingPluginStatus, un as SpaceConfigResponse, ut as BillingUsageRecordStatus, vn as SpaceFsEntry, vr as DiscordChannelConfig, vt as CreateSpacePromptResponse, wn as SpaceFsReadFilesInput, wt as GlobalSearchResponse, xn as SpaceFsMoveInput, xr as HttpError, xt as ExploreSection, yn as SpaceFsFileKind, yr as CohubClientOptions, yt as CreateSpaceSessionInput, zn as SpaceModListItem, zt as MeResponse } 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, CreateSpaceSessionInput, 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 CreateGenerationTaskRequest, $t as SessionTurnSignedUrlsResponse, A as SessionPatchStatus, An as SpaceFsUploadPlanEntry, At as JsonValue, B as GenerationsApi, Bn as SpacePublicProfile, Bt as ModelCatalogEntry, C as SessionGenerationStreamClient, Cn as SpaceFsReadFilesError, Cr as RawHttpResponse, Ct as ExploreSpacesResponse, D as SessionPatchApplyResult, Dn as SpaceFsUploadDestination, Dt as InvitationDetail, E as SessionPatchApplyInput, En as SpaceFsTreeResponse, Et as GlobalSearchType, F as CreatePublicAssetUploadResponse, Fn as SpaceInvitation, Ft as LabelRecord, G as BillingCatalog, Gn as SpaceSessionsResponse, Gt as ResourceLabelsResponse, H as ChannelsApi, Hn as SpaceRole, Ht as PromptAccessMode, I as PublicAssetPurpose, In as SpaceListItem, It as LabelResourceType, J as BillingCreditExpiryGroup, Jn as SpaceUsageSummary, Jt as SessionMessagesPaginatedResponse, K as BillingCatalogProduct, Kn as SpaceUsageHourlyStat, Kt as SessionBindingRecord, L as PublicAssetsApi, Ln as SpaceMember, Lt as LabelScopeType, M as SessionAccessApi, Mn as SpaceFsUploadProgress, Mt as LabelAssignmentPageInfo, N as SearchApi, Nn as SpaceFsUploadResponse, Nt as LabelAssignmentRecord, O as SessionPatchReducer, On as SpaceFsUploadEntry, Ot as JsonObject, P as CreatePublicAssetUploadInput, Pn as SpaceFsWriteFileInput, Pt as LabelListItem, Q as BillingOpenOverageList, Qn as UserRulesResponse, Qt as SessionTurnResponse, R as PromptsApi, Rn as SpaceMeta, Rt as LabelSource, S as GenerationStreamTurnUpdatedEvent, Sn as SpaceFsPreparingFile, Sr as HttpTransport, St as ExploreSpaceItem, T as parseAssistantMessageCommit, Tn as SpaceFsReadFilesResponse, Tt as GlobalSearchResult, U as AcceptInvitationResponse, Un as SpaceSandboxAutoDestroyPolicy, Ut as PromptTemplateCatalogEntry, V as CronJobsApi, Vn as SpaceRecord, Vt as Permission, W as ApiError, Wn as SpaceSandboxConfig, Wt as PromptTemplateCatalogResponse, X as BillingCreditStatus, Xn as TaskRunRecord, Xt as SessionRecord, Y as BillingCreditGrantStatus, Yn as TaskRunDetailResponse, Yt as SessionMessagesResponse, Z as BillingCreditUnit, Zn as UserProfile, Zt as SessionTurnIndexResponse, _ as GenerationStreamFinalizedEvent, _n as SpaceFsEncoding, _r as ChannelConfig, _t as CreateSpacePromptInput, a as SessionEventName, an as SpaceBootstrapSource, ar as GenerationParameterConstraint, at as BillingProductKind, b as GenerationStreamStateEvent, bn as SpaceFsFileResponse, br as Fetch, bt as CronJobRecord, c as SpaceClient, cn as SpaceConfig, cr as assertGenerationRequestAllowedByPolicy, ct as BillingSubscriptionSummary, d as WebSocketConnectionState, dn as SpaceCreateResponse, dr as filterGenerationDeclarationsByPolicy, dt as Channel, en as SessionTurnStreamSnapshotResponse, er as CreateGenerationTaskResponse, et as BillingPaymentStatus, f as PublicInviteApi, fn as SpaceEnvInput, fr as findGenerationModelPolicy, ft as CheckpointRecord, g as GenerationStreamEvent, gn as SpaceFsCreateUploadResponse, gr as GenerationContentBlock, gt as CreateSpaceModInput, h as GenerationStreamErrorEvent, hn as SpaceFsCreateUploadInput, hr as parseGenerationPolicyFromEnv, ht as CreateSpaceInput, i as TasksApi, in as SpaceAccessPolicy, ir as GenerationModelPolicy, it as BillingProductDisplay, j as createSessionPatchReducer, jn as SpaceFsUploadPlanEntryInput, jt as LabelAssignmentListItem, k as SessionPatchState, kn as SpaceFsUploadError, kt as JsonPrimitive, l as SpaceEventName, ln as SpaceConfigInput, lr as decodeGenerationPolicy, lt as BillingUsageRecordList, m as GenerationStreamCommitEvent, mn as SpaceFsCompleteUploadResponse, mr as normalizeGenerationPolicy, mt as CreateInvitationResponse, n as createHttpClient, nn as SessionTurnsPaginatedResponse, nr as ListGenerationModelsResponse, nt as BillingProductBillingInterval, o as SessionSubscriptionHandlers, on as SpaceChannelBindingInput, or as GenerationPolicy, ot as BillingProductPricing, p as AssistantMessageCommit, pn as SpaceFsCompleteUploadInput, pr as getAllowedGenerationModelIds, pt as CreateInvitationInput, q as BillingCheckoutResult, qn as SpaceUsageResponse, qt as SessionMessageResponse, r as UserApi, rn as SpaceAccess, rr as PublicGenerationDeclaration, rt as BillingProductCreditBenefit, s as SpaceChannelBindingRecord, sn as SpaceCheckpointDetailResponse, sr as GenerationPolicyError, st as BillingRedemptionResult, t as CohubHttpClient, tn as SessionTurnWindowResponse, tr as GenerationTaskResult, tt as BillingPluginStatus, u as SpacesApi, un as SpaceConfigResponse, ur as encodeGenerationPolicy, ut as BillingUsageRecordStatus, v as GenerationStreamIntermediateMessage, vn as SpaceFsEntry, vr as DiscordChannelConfig, vt as CreateSpacePromptResponse, w as createSessionGenerationStreamClient, wn as SpaceFsReadFilesInput, wt as GlobalSearchResponse, x as GenerationStreamSubscriptionHandlers, xn as SpaceFsMoveInput, xr as HttpError, xt as ExploreSection, y as GenerationStreamOutOfSyncEvent, yn as SpaceFsFileKind, yr as CohubClientOptions, yt as CreateSpaceSessionInput, z as ModelsApi, zn as SpaceModListItem, zt as MeResponse } 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, PromptAccessMode, 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, CreateSpaceSessionInput, 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
|