@neta-art/cohub 2.3.0 → 2.5.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 +178 -51
- package/dist/chunks/http.js +14 -0
- package/dist/http.d.ts +1 -1
- package/dist/index.d.ts +112 -52
- package/dist/index.js +636 -53
- package/package.json +1 -1
package/dist/chunks/http.d.ts
CHANGED
|
@@ -2,52 +2,15 @@ import { n as CohubEnvironment } from "./environment.js";
|
|
|
2
2
|
import { C as ContentBlock, S as Usage, _ as SessionForkRecord, a as WebsocketClientOptions, b as SessionTurnIndexItem, d as RealtimePatchOperation, g as SessionBindingRecord$1, h as MessageRecord, m as SpacePublicEndpoints, p as SessionTurnPatchEvent, r as WebsocketClient, s as WebsocketEventPayload, v as SessionRecord$1, x as SessionTurnRecord } from "./websocket.js";
|
|
3
3
|
import { a as VoiceInputCreateOptions } from "./voice-input.js";
|
|
4
4
|
|
|
5
|
-
//#region src/
|
|
6
|
-
type
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
type RawHttpResponse = {
|
|
11
|
-
response: Response;
|
|
12
|
-
blob(): Promise<Blob>;
|
|
13
|
-
arrayBuffer(): Promise<ArrayBuffer>;
|
|
14
|
-
text(): Promise<string>;
|
|
15
|
-
json(): Promise<unknown>;
|
|
5
|
+
//#region ../protocol/src/gateway/types.d.ts
|
|
6
|
+
type ChannelModelConfig = {
|
|
7
|
+
provider: string;
|
|
8
|
+
id: string;
|
|
16
9
|
};
|
|
17
|
-
type
|
|
18
|
-
|
|
19
|
-
baseUrl?: string;
|
|
20
|
-
getAccessToken?: (options?: {
|
|
21
|
-
forceRefresh?: boolean;
|
|
22
|
-
}) => Promise<string | null> | string | null;
|
|
23
|
-
onUnauthorized?: () => Promise<void> | void;
|
|
24
|
-
setStoredAuthToken?: (token: string) => void;
|
|
25
|
-
clearStoredAuthToken?: () => void;
|
|
26
|
-
fetch?: Fetch;
|
|
27
|
-
websocket?: WebsocketClientOptions;
|
|
28
|
-
voice?: VoiceInputCreateOptions;
|
|
10
|
+
type BaseChannelConfig = {
|
|
11
|
+
model?: ChannelModelConfig | null;
|
|
29
12
|
};
|
|
30
|
-
|
|
31
|
-
readonly status: number;
|
|
32
|
-
readonly body: unknown;
|
|
33
|
-
readonly code: string | null;
|
|
34
|
-
constructor(message: string, status: number, body: unknown);
|
|
35
|
-
}
|
|
36
|
-
declare class HttpTransport {
|
|
37
|
-
private readonly baseUrl;
|
|
38
|
-
private readonly fetcher;
|
|
39
|
-
private readonly getAccessToken?;
|
|
40
|
-
private readonly onUnauthorized?;
|
|
41
|
-
constructor(options?: CohubClientOptions);
|
|
42
|
-
private withAuthorization;
|
|
43
|
-
private send;
|
|
44
|
-
request<T>(path: string, init?: RequestInitWithFetch): Promise<T>;
|
|
45
|
-
raw(path: string, init?: RequestInitWithFetch): Promise<RawHttpResponse>;
|
|
46
|
-
blob(path: string, init?: RequestInitWithFetch): Promise<Blob>;
|
|
47
|
-
}
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region ../protocol/src/gateway/types.d.ts
|
|
50
|
-
type DiscordChannelConfig = {
|
|
13
|
+
type DiscordChannelConfig = BaseChannelConfig & {
|
|
51
14
|
inbound?: {
|
|
52
15
|
requireMentionInGuild?: boolean;
|
|
53
16
|
};
|
|
@@ -56,7 +19,7 @@ type DiscordChannelConfig = {
|
|
|
56
19
|
showToolCalls?: boolean;
|
|
57
20
|
};
|
|
58
21
|
};
|
|
59
|
-
type FeishuChannelConfig = {
|
|
22
|
+
type FeishuChannelConfig = BaseChannelConfig & {
|
|
60
23
|
brand?: "feishu" | "lark";
|
|
61
24
|
inbound?: {
|
|
62
25
|
requireMentionInGroup?: boolean;
|
|
@@ -67,12 +30,12 @@ type FeishuChannelConfig = {
|
|
|
67
30
|
showToolCalls?: boolean;
|
|
68
31
|
};
|
|
69
32
|
};
|
|
70
|
-
type WeChatChannelConfig = {
|
|
33
|
+
type WeChatChannelConfig = BaseChannelConfig & {
|
|
71
34
|
outbound?: {
|
|
72
35
|
showIntermediateStatus?: boolean;
|
|
73
36
|
};
|
|
74
37
|
};
|
|
75
|
-
type ChannelConfig = DiscordChannelConfig | FeishuChannelConfig | WeChatChannelConfig | Record<string, unknown
|
|
38
|
+
type ChannelConfig = DiscordChannelConfig | FeishuChannelConfig | WeChatChannelConfig | (BaseChannelConfig & Record<string, unknown>);
|
|
76
39
|
//#endregion
|
|
77
40
|
//#region ../../node_modules/.pnpm/@neta-art+generation@0.1.10/node_modules/@neta-art/generation/dist/builtins-CWEB_GK4.d.ts
|
|
78
41
|
//#region src/types.d.ts
|
|
@@ -1241,7 +1204,7 @@ type LabelAssignmentRecord = {
|
|
|
1241
1204
|
scopeId: string;
|
|
1242
1205
|
resourceType: LabelResourceType;
|
|
1243
1206
|
resourceRef: string;
|
|
1244
|
-
rank: number;
|
|
1207
|
+
rank: number | null;
|
|
1245
1208
|
source: LabelSource;
|
|
1246
1209
|
createdBy: string | null;
|
|
1247
1210
|
meta: Record<string, unknown> | null;
|
|
@@ -1438,6 +1401,164 @@ type ReferenceAggregateResponse = {
|
|
|
1438
1401
|
groups: ReferenceAggregateGroup[];
|
|
1439
1402
|
};
|
|
1440
1403
|
//#endregion
|
|
1404
|
+
//#region src/work-runtime.d.ts
|
|
1405
|
+
type WorkRuntimeContext = {
|
|
1406
|
+
work: {
|
|
1407
|
+
id: string;
|
|
1408
|
+
slug: string;
|
|
1409
|
+
url?: string | null;
|
|
1410
|
+
};
|
|
1411
|
+
space: {
|
|
1412
|
+
id: string;
|
|
1413
|
+
name?: string | null;
|
|
1414
|
+
};
|
|
1415
|
+
viewer?: {
|
|
1416
|
+
userUuid: string;
|
|
1417
|
+
} | null;
|
|
1418
|
+
permissions?: {
|
|
1419
|
+
scopes: Permission[];
|
|
1420
|
+
workScopes: Permission[];
|
|
1421
|
+
viewerScopes: Permission[];
|
|
1422
|
+
};
|
|
1423
|
+
};
|
|
1424
|
+
type WorkRuntimeCheckoutStatus = "success" | "failed" | "cancel" | null;
|
|
1425
|
+
type WorkRuntimeCheckoutState = {
|
|
1426
|
+
status: WorkRuntimeCheckoutStatus;
|
|
1427
|
+
orderId: string | null;
|
|
1428
|
+
};
|
|
1429
|
+
/**
|
|
1430
|
+
* Options for a single work runtime transport request.
|
|
1431
|
+
*/
|
|
1432
|
+
type WorkRuntimeRequestOptions = {
|
|
1433
|
+
/** How long to wait for a matching response before resolving with null. */timeoutMs?: number; /** When set, re-posts the request on this interval until a response arrives. */
|
|
1434
|
+
retryIntervalMs?: number;
|
|
1435
|
+
};
|
|
1436
|
+
/**
|
|
1437
|
+
* Transport layer for {@link WorkRuntimeApi}. Decoupled so the same API can run
|
|
1438
|
+
* over either the iframe parent bridge (bridge mode) or a popup broker window
|
|
1439
|
+
* (broker mode). The transport is responsible for posting the request and
|
|
1440
|
+
* resolving with the first matching response (or null on timeout).
|
|
1441
|
+
*/
|
|
1442
|
+
interface WorkRuntimeTransport {
|
|
1443
|
+
request<T>(message: Record<string, unknown>, options?: WorkRuntimeRequestOptions): Promise<T | null>;
|
|
1444
|
+
}
|
|
1445
|
+
/**
|
|
1446
|
+
* Bridge-mode transport: posts messages to `window.parent` (the Cohub host
|
|
1447
|
+
* embedding the work in an iframe) and listens for the matching reply.
|
|
1448
|
+
* Behaviorally identical to the previous module-level `request()` helper.
|
|
1449
|
+
*/
|
|
1450
|
+
declare class ParentBridgeTransport implements WorkRuntimeTransport {
|
|
1451
|
+
private trustedParentOrigin;
|
|
1452
|
+
request<T>(message: Record<string, unknown>, options?: WorkRuntimeRequestOptions): Promise<T | null>;
|
|
1453
|
+
}
|
|
1454
|
+
/**
|
|
1455
|
+
* Broker-mode transport for standalone-deployed works. Opens a popup window to
|
|
1456
|
+
* the Cohub auth broker page, performs a ready-handshake, sends the request via
|
|
1457
|
+
* postMessage, and resolves with the broker's response. The popup is closed
|
|
1458
|
+
* after a single request is fulfilled (one-shot, per §7.2 of the plan).
|
|
1459
|
+
*
|
|
1460
|
+
* Non-interactive messages (`context`, `checkout-state`) are answered locally
|
|
1461
|
+
* without opening a popup — the work already knows its own workId, and
|
|
1462
|
+
* checkout state is not available on the work's own origin in broker mode.
|
|
1463
|
+
*/
|
|
1464
|
+
declare class PopupBrokerTransport implements WorkRuntimeTransport {
|
|
1465
|
+
private readonly brokerOrigin;
|
|
1466
|
+
private readonly workId;
|
|
1467
|
+
constructor(config: {
|
|
1468
|
+
brokerOrigin: string;
|
|
1469
|
+
workId: string;
|
|
1470
|
+
});
|
|
1471
|
+
request<T>(message: Record<string, unknown>, options?: WorkRuntimeRequestOptions): Promise<T | null>;
|
|
1472
|
+
}
|
|
1473
|
+
declare class WorkRuntimeApi {
|
|
1474
|
+
private token;
|
|
1475
|
+
private readonly transport;
|
|
1476
|
+
private readonly tokenStorageKey;
|
|
1477
|
+
constructor(transport?: WorkRuntimeTransport, workId?: string);
|
|
1478
|
+
private readStoredToken;
|
|
1479
|
+
private writeStoredToken;
|
|
1480
|
+
context(): Promise<WorkRuntimeContext | null>;
|
|
1481
|
+
getAccessToken(options?: {
|
|
1482
|
+
forceRefresh?: boolean;
|
|
1483
|
+
}): Promise<string | null>;
|
|
1484
|
+
requestAuthorization(input: {
|
|
1485
|
+
scopes: Permission[];
|
|
1486
|
+
reason?: string;
|
|
1487
|
+
}): Promise<boolean>;
|
|
1488
|
+
purchase(input: {
|
|
1489
|
+
productKey: string;
|
|
1490
|
+
}): Promise<{
|
|
1491
|
+
providerKey: string | null;
|
|
1492
|
+
checkoutUrl: string | null;
|
|
1493
|
+
checkoutUsable: boolean;
|
|
1494
|
+
status: string | null;
|
|
1495
|
+
message: string | null;
|
|
1496
|
+
orderId: string;
|
|
1497
|
+
productKey: string;
|
|
1498
|
+
} | null>;
|
|
1499
|
+
checkoutState(): Promise<WorkRuntimeCheckoutState | null>;
|
|
1500
|
+
}
|
|
1501
|
+
/**
|
|
1502
|
+
* Configuration for the work runtime mode.
|
|
1503
|
+
*/
|
|
1504
|
+
type WorkRuntimeModeConfig = {
|
|
1505
|
+
/** Explicit mode selection. When omitted, auto-detection is used. */mode?: "bridge" | "broker"; /** Cohub origin for the broker page (e.g. "https://cohub.run"). */
|
|
1506
|
+
brokerOrigin?: string; /** The work's public id. Required for broker mode. */
|
|
1507
|
+
workId?: string;
|
|
1508
|
+
};
|
|
1509
|
+
/**
|
|
1510
|
+
* Resolves the appropriate transport based on the work mode configuration.
|
|
1511
|
+
* Auto-detection: inside an iframe → bridge; standalone with broker config →
|
|
1512
|
+
* broker; otherwise → bridge (returns null for non-work contexts).
|
|
1513
|
+
*/
|
|
1514
|
+
declare function resolveWorkTransport(config?: WorkRuntimeModeConfig): WorkRuntimeTransport;
|
|
1515
|
+
declare const createWorkRuntime: (transport?: WorkRuntimeTransport, workId?: string) => WorkRuntimeApi;
|
|
1516
|
+
//#endregion
|
|
1517
|
+
//#region src/transport.d.ts
|
|
1518
|
+
type Fetch = typeof globalThis.fetch;
|
|
1519
|
+
type RequestInitWithFetch = RequestInit & {
|
|
1520
|
+
fetch?: Fetch;
|
|
1521
|
+
};
|
|
1522
|
+
type RawHttpResponse = {
|
|
1523
|
+
response: Response;
|
|
1524
|
+
blob(): Promise<Blob>;
|
|
1525
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
1526
|
+
text(): Promise<string>;
|
|
1527
|
+
json(): Promise<unknown>;
|
|
1528
|
+
};
|
|
1529
|
+
type CohubClientOptions = {
|
|
1530
|
+
env?: CohubEnvironment;
|
|
1531
|
+
baseUrl?: string;
|
|
1532
|
+
getAccessToken?: (options?: {
|
|
1533
|
+
forceRefresh?: boolean;
|
|
1534
|
+
}) => Promise<string | null> | string | null;
|
|
1535
|
+
onUnauthorized?: () => Promise<void> | void;
|
|
1536
|
+
setStoredAuthToken?: (token: string) => void;
|
|
1537
|
+
clearStoredAuthToken?: () => void;
|
|
1538
|
+
fetch?: Fetch;
|
|
1539
|
+
websocket?: WebsocketClientOptions;
|
|
1540
|
+
voice?: VoiceInputCreateOptions; /** Work runtime mode configuration (bridge vs broker). */
|
|
1541
|
+
work?: WorkRuntimeModeConfig;
|
|
1542
|
+
};
|
|
1543
|
+
declare class HttpError extends Error {
|
|
1544
|
+
readonly status: number;
|
|
1545
|
+
readonly body: unknown;
|
|
1546
|
+
readonly code: string | null;
|
|
1547
|
+
constructor(message: string, status: number, body: unknown);
|
|
1548
|
+
}
|
|
1549
|
+
declare class HttpTransport {
|
|
1550
|
+
private readonly baseUrl;
|
|
1551
|
+
private readonly fetcher;
|
|
1552
|
+
private readonly getAccessToken?;
|
|
1553
|
+
private readonly onUnauthorized?;
|
|
1554
|
+
constructor(options?: CohubClientOptions);
|
|
1555
|
+
private withAuthorization;
|
|
1556
|
+
private send;
|
|
1557
|
+
request<T>(path: string, init?: RequestInitWithFetch): Promise<T>;
|
|
1558
|
+
raw(path: string, init?: RequestInitWithFetch): Promise<RawHttpResponse>;
|
|
1559
|
+
blob(path: string, init?: RequestInitWithFetch): Promise<Blob>;
|
|
1560
|
+
}
|
|
1561
|
+
//#endregion
|
|
1441
1562
|
//#region src/apis/channels.d.ts
|
|
1442
1563
|
declare class ChannelsApi {
|
|
1443
1564
|
private readonly transport;
|
|
@@ -2076,7 +2197,7 @@ type SpaceChannelBindingRecord = {
|
|
|
2076
2197
|
id: string;
|
|
2077
2198
|
spaceId: string;
|
|
2078
2199
|
channelId: string;
|
|
2079
|
-
config:
|
|
2200
|
+
config: ChannelConfig | null;
|
|
2080
2201
|
createdAt: string;
|
|
2081
2202
|
channel: {
|
|
2082
2203
|
id: string;
|
|
@@ -2093,7 +2214,8 @@ declare class SpaceChannelsApi {
|
|
|
2093
2214
|
private readonly spaceId;
|
|
2094
2215
|
constructor(transport: HttpTransport, spaceId: string);
|
|
2095
2216
|
list(): Promise<SpaceChannelBindingRecord[]>;
|
|
2096
|
-
bind(channelId: string, config?:
|
|
2217
|
+
bind(channelId: string, config?: ChannelConfig | null): Promise<SpaceChannelBindingRecord>;
|
|
2218
|
+
updateConfig(channelId: string, config?: ChannelConfig | null): Promise<SpaceChannelBindingRecord>;
|
|
2097
2219
|
unbind(channelId: string): Promise<{
|
|
2098
2220
|
ok: true;
|
|
2099
2221
|
}>;
|
|
@@ -2585,6 +2707,11 @@ declare class WorksApi {
|
|
|
2585
2707
|
works: WorkRecord[];
|
|
2586
2708
|
}>;
|
|
2587
2709
|
get(id: string): Promise<WorkDetailResponse>;
|
|
2710
|
+
/**
|
|
2711
|
+
* Loads a published work's metadata + owner info by id (public access model).
|
|
2712
|
+
* Used by the standalone work auth broker page.
|
|
2713
|
+
*/
|
|
2714
|
+
getPublicById(id: string): Promise<WorkDetailResponse>;
|
|
2588
2715
|
getBySlug(username: string, spaceSlug: string, workSlug: string): Promise<WorkDetailResponse>;
|
|
2589
2716
|
create(input: WorkCreateInput): Promise<{
|
|
2590
2717
|
work: WorkRecord;
|
|
@@ -2700,4 +2827,4 @@ declare class CohubHttpClient {
|
|
|
2700
2827
|
}
|
|
2701
2828
|
declare const createHttpClient: (options?: CohubClientOptions) => CohubHttpClient;
|
|
2702
2829
|
//#endregion
|
|
2703
|
-
export { parseAssistantMessageCommit as $,
|
|
2830
|
+
export { parseAssistantMessageCommit as $, GenerationContentBlock as $i, PatchResourceLabelsInput as $n, SpaceFsFileKind as $r, BillingCreditStatus as $t, TasksApi as A, SpaceUsageResponse as Ai, CronJobRecord as An, SpaceBootstrapSource as Ar, WorkRuntimeCheckoutState as At, GenerationStreamCommitEvent as B, PublicGenerationDeclaration as Bi, JsonObject as Bn, SpaceCommerceProductCreditBenefit as Br, BatchUserProfilesResponse as Bt, WorkStatus as C, SpaceRecord as Ci, CreateInvitationResponse as Cn, SessionTurnResponse as Cr, Fetch as Ct, WorkVisibility as D, SpaceSandboxProvider as Di, CreateSpacePromptResponse as Dn, SessionTurnsPaginatedResponse as Dr, ParentBridgeTransport as Dt, WorkVersionRecord as E, SpaceSandboxConfig as Ei, CreateSpacePromptInput as En, SessionTurnWindowResponse as Er, RawHttpResponse as Et, SpaceEventName as F, UserRulesResponse as Fi, ExploreSpacesResponse as Fn, SpaceCommerceCreditsBenefit as Fr, WorkRuntimeTransport as Ft, GenerationStreamLifecycleEvent as G, assertGenerationRequestAllowedByPolicy as Gi, LabelAssignmentRecord as Gn, SpaceDefaultResponse as Gr, BillingBalanceActivityStatus as Gt, GenerationStreamEvent as H, GenerationParameterConstraint as Hi, JsonValue as Hn, SpaceConfigInput as Hr, BillingBalanceActivity as Ht, SpacesApi as I, CreateGenerationTaskRequest as Ii, GlobalSearchResponse as In, SpaceCommerceFeatureBenefit as Ir, createWorkRuntime as It, GenerationStreamSubscribeOptions as J, filterGenerationDeclarationsByPolicy as Ji, LabelResourceType as Jn, SpaceFsCompleteUploadResponse as Jr, BillingCheckoutActionState as Jt, GenerationStreamOutOfSyncEvent as K, decodeGenerationPolicy as Ki, LabelListItem as Kn, SpaceEnvInput as Kr, BillingCatalog as Kt, WebSocketConnectionState as L, CreateGenerationTaskResponse as Li, GlobalSearchResult as Ln, SpaceCommerceOrder as Lr, resolveWorkTransport as Lt, SessionSubscriptionHandlers as M, TaskRunDetailResponse as Mi, CursorPageInfo as Mn, SpaceCheckpointDetailResponse as Mr, WorkRuntimeContext as Mt, SpaceChannelBindingRecord as N, TaskRunRecord as Ni, ExploreSection as Nn, SpaceCommerceBenefit as Nr, WorkRuntimeModeConfig as Nt, WorksApi as O, SpaceSessionsResponse as Oi, CreateSpaceSessionInput as On, SpaceAccess as Or, PopupBrokerTransport as Ot, SpaceClient as P, UserProfile as Pi, ExploreSpaceItem as Pn, SpaceCommerceBuyerProfile as Pr, WorkRuntimeRequestOptions as Pt, createSessionGenerationStreamClient as Q, parseGenerationPolicyFromEnv as Qi, ModelCatalogEntry as Qn, SpaceFsEntry as Qr, BillingCreditGrantStatus as Qt, PublicInviteApi as R, GenerationTaskResult as Ri, GlobalSearchType as Rn, SpaceCommerceProduct as Rr, AcceptInvitationResponse as Rt, WorkSessionResponse as S, SpacePublicProfile as Si, CreateInvitationInput as Sn, SessionTurnIndexResponse as Sr, CohubClientOptions as St, WorkUpdateInput as T, SpaceSandboxAutoDestroyPolicy as Ti, CreateSpaceModInput as Tn, SessionTurnStreamSnapshotResponse as Tr, HttpTransport as Tt, GenerationStreamFinalizedEvent as U, GenerationPolicy as Ui, LabelAssignmentListItem as Un, SpaceConfigResponse as Ur, BillingBalanceActivityKind as Ut, GenerationStreamErrorEvent as V, GenerationModelPolicy as Vi, JsonPrimitive as Vn, SpaceConfig as Vr, BillingAccessWarning as Vt, GenerationStreamIntermediateMessage as W, GenerationPolicyError as Wi, LabelAssignmentPageInfo as Wn, SpaceCreateResponse as Wr, BillingBalanceActivityList as Wt, GenerationStreamTurnUpdatedEvent as X, getAllowedGenerationModelIds as Xi, LabelSource as Xn, SpaceFsCreateUploadResponse as Xr, BillingConversionIntent as Xt, GenerationStreamSubscriptionHandlers as Y, findGenerationModelPolicy as Yi, LabelScopeType as Yn, SpaceFsCreateUploadInput as Yr, BillingCheckoutResult as Yt, SessionGenerationStreamClient as Z, normalizeGenerationPolicy as Zi, MeResponse as Zn, SpaceFsEncoding as Zr, BillingCreditExpiryGroup as Zt, WorkPresentationMeta as _, SpaceMember as _i, CanvasNodeRecord as _n, SessionBindingRecord as _r, PromptsApi as _t, WorkCommerceCreditConsumeResponse as a, SpaceFsReadFilesResponse as ai, BillingProductCreditBenefit as an, PublicUserProfile as ar, createSessionPatchReducer as at, WorkRecord as b, SpacePresenceSnapshot as bi, Channel as bn, SessionMessagesResponse as br, CronJobsApi as bt, WorkCommerceEntitlementsResponse as c, SpaceFsUploadEntry as ci, BillingProductPricing as cn, ReferenceAggregateResponse as cr, ReferencesApi as ct, WorkCommercePurchaseResponse as d, SpaceFsUploadPlanEntryInput as di, BillingSubscriptionHistoryStatus as dn, ReferenceQueryResponse as dr, CreatePublicAssetUploadResponse as dt, ChannelConfig as ea, SpaceFsFileResponse as ei, BillingCreditUnit as en, PatchResourceLabelsResponse as er, SessionPatchApplyInput as et, WorkAuthorizeResponse as f, SpaceFsUploadProgress as fi, BillingSubscriptionSummary as fn, ReferenceQueryableType as fr, PublicAssetMimeType as ft, WorkMeta as g, SpaceListItem as gi, CanvasNodeInput as gn, SendMessageCronJobPayload as gr, UploadPublicAssetInput as gt, WorkGetResponse as h, SpaceInvitation as hi, CanvasDocumentRecord as hn, ResourceLabelsResponse as hr, UploadChatImageAttachmentInput as ht, WorkCommerceCheckoutStatus as i, SpaceFsReadFilesInput as ii, BillingProductBillingInterval as in, PromptTemplateCatalogResponse as ir, SessionPatchStatus as it, SessionEventName as j, SpaceUsageSummary as ji, CronJobUpdatePatch as jn, SpaceChannelBindingInput as jr, WorkRuntimeCheckoutStatus as jt, UserApi as k, SpaceUsageHourlyStat as ki, CronJobPayload as kn, SpaceAccessPolicy as kr, WorkRuntimeApi as kt, WorkCommerceOrder as l, SpaceFsUploadError as li, BillingRedemptionResult as ln, ReferenceDirection as lr, SearchApi as lt, WorkDetailResponse as m, SpaceFsWriteFileInput as mi, CanvasCreateInput as mn, ReferenceResourceType as mr, PublicAssetsApi as mt, createHttpClient as n, SpaceFsPreparingFile as ni, BillingPaymentStatus as nn, PromptAccessMode as nr, SessionPatchReducer as nt, WorkCommerceCreditConsumeStatus as o, SpaceFsTreeResponse as oi, BillingProductDisplay as on, ReferenceAggregateGroup as or, SessionAccessApi as ot, WorkCreateInput as p, SpaceFsUploadResponse as pi, CanvasBootstrapResponse as pn, ReferenceRecord as pr, PublicAssetPurpose as pt, GenerationStreamStateEvent as q, encodeGenerationPolicy as qi, LabelRecord as qn, SpaceFsCompleteUploadInput as qr, BillingCatalogProduct as qt, WorkCommerceApi as r, SpaceFsReadFilesError as ri, BillingPluginStatus as rn, PromptTemplateCatalogEntry as rr, SessionPatchState as rt, WorkCommerceEntitlement as s, SpaceFsUploadDestination as si, BillingProductKind as sn, ReferenceAggregateGroupBy as sr, ReferenceResourceSelector as st, CohubHttpClient as t, DiscordChannelConfig as ta, SpaceFsMoveInput as ti, BillingHistoryPagination as tn, Permission as tr, SessionPatchApplyResult as tt, WorkCommerceProductResolveResponse as u, SpaceFsUploadPlanEntry as ui, BillingSubscriptionHistoryList as un, ReferenceKind as ur, CreatePublicAssetUploadInput as ut, WorkPublicOwnerRecord as v, SpaceMeta as vi, CanvasSemanticOp as vn, SessionMessageResponse as vr, ModelsApi as vt, WorkTargetType as w, SpaceRole as wi, CreateSpaceInput as wn, SessionTurnSignedUrlsResponse as wr, HttpError as wt, WorkResolveResponse as x, SpacePresenceUser as xi, CheckpointRecord as xn, SessionRecord as xr, ChannelsApi as xt, WorkPublicSpaceRecord as y, SpaceModListItem as yi, CanvasTransactionInput as yn, SessionMessagesPaginatedResponse as yr, GenerationsApi as yt, AssistantMessageCommit as z, ListGenerationModelsResponse as zi, InvitationDetail as zn, SpaceCommerceProductBenefitBinding as zr, ApiError as zt };
|
package/dist/chunks/http.js
CHANGED
|
@@ -1923,6 +1923,13 @@ var SpaceChannelsApi = class {
|
|
|
1923
1923
|
body: JSON.stringify({ config: config ?? null })
|
|
1924
1924
|
});
|
|
1925
1925
|
}
|
|
1926
|
+
updateConfig(channelId, config) {
|
|
1927
|
+
return this.transport.request(`/api/spaces/${this.spaceId}/channels/${channelId}`, {
|
|
1928
|
+
method: "PATCH",
|
|
1929
|
+
headers: { "Content-Type": "application/json" },
|
|
1930
|
+
body: JSON.stringify({ config: config ?? null })
|
|
1931
|
+
});
|
|
1932
|
+
}
|
|
1926
1933
|
unbind(channelId) {
|
|
1927
1934
|
return this.transport.request(`/api/spaces/${this.spaceId}/channels/${channelId}`, { method: "DELETE" });
|
|
1928
1935
|
}
|
|
@@ -2477,6 +2484,13 @@ var WorksApi = class {
|
|
|
2477
2484
|
get(id) {
|
|
2478
2485
|
return this.transport.request(`/api/works/${id}`);
|
|
2479
2486
|
}
|
|
2487
|
+
/**
|
|
2488
|
+
* Loads a published work's metadata + owner info by id (public access model).
|
|
2489
|
+
* Used by the standalone work auth broker page.
|
|
2490
|
+
*/
|
|
2491
|
+
getPublicById(id) {
|
|
2492
|
+
return this.transport.request(`/api/works/${id}/public`);
|
|
2493
|
+
}
|
|
2480
2494
|
getBySlug(username, spaceSlug, workSlug) {
|
|
2481
2495
|
return this.transport.request(`/api/works/by-slug/${encodeURIComponent(username)}/${encodeURIComponent(spaceSlug)}/${encodeURIComponent(workSlug)}`);
|
|
2482
2496
|
}
|
package/dist/http.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { C as ContentBlock, _ as SessionForkRecord, b as SessionTurnIndexItem, h as MessageRecord, x as SessionTurnRecord, y as SessionTurnSegmentRecord } from "./chunks/websocket.js";
|
|
2
|
-
import { $n as
|
|
2
|
+
import { $i as GenerationContentBlock, $n as PatchResourceLabelsInput, $r as SpaceFsFileKind, $t as BillingCreditStatus, Ai as SpaceUsageResponse, An as CronJobRecord, Ar as SpaceBootstrapSource, Bi as PublicGenerationDeclaration, Bn as JsonObject, Br as SpaceCommerceProductCreditBenefit, Bt as BatchUserProfilesResponse, Ci as SpaceRecord, Cn as CreateInvitationResponse, Cr as SessionTurnResponse, Ct as Fetch, Di as SpaceSandboxProvider, Dn as CreateSpacePromptResponse, Dr as SessionTurnsPaginatedResponse, Ei as SpaceSandboxConfig, En as CreateSpacePromptInput, Er as SessionTurnWindowResponse, Fi as UserRulesResponse, Fn as ExploreSpacesResponse, Fr as SpaceCommerceCreditsBenefit, Gn as LabelAssignmentRecord, Gr as SpaceDefaultResponse, Gt as BillingBalanceActivityStatus, Hn as JsonValue, Hr as SpaceConfigInput, Ht as BillingBalanceActivity, Ii as CreateGenerationTaskRequest, In as GlobalSearchResponse, Ir as SpaceCommerceFeatureBenefit, Jn as LabelResourceType, Jr as SpaceFsCompleteUploadResponse, Jt as BillingCheckoutActionState, Kn as LabelListItem, Kr as SpaceEnvInput, Kt as BillingCatalog, Li as CreateGenerationTaskResponse, Ln as GlobalSearchResult, Lr as SpaceCommerceOrder, Mi as TaskRunDetailResponse, Mn as CursorPageInfo, Mr as SpaceCheckpointDetailResponse, Ni as TaskRunRecord, Nn as ExploreSection, Nr as SpaceCommerceBenefit, Oi as SpaceSessionsResponse, On as CreateSpaceSessionInput, Or as SpaceAccess, Pi as UserProfile, Pn as ExploreSpaceItem, Pr as SpaceCommerceBuyerProfile, Qn as ModelCatalogEntry, Qr as SpaceFsEntry, Qt as BillingCreditGrantStatus, Ri as GenerationTaskResult, Rn as GlobalSearchType, Rr as SpaceCommerceProduct, Rt as AcceptInvitationResponse, Si as SpacePublicProfile, Sn as CreateInvitationInput, Sr as SessionTurnIndexResponse, St as CohubClientOptions, Ti as SpaceSandboxAutoDestroyPolicy, Tn as CreateSpaceModInput, Tr as SessionTurnStreamSnapshotResponse, Tt as HttpTransport, Ui as GenerationPolicy, Un as LabelAssignmentListItem, Ur as SpaceConfigResponse, Ut as BillingBalanceActivityKind, Vn as JsonPrimitive, Vr as SpaceConfig, Vt as BillingAccessWarning, Wn as LabelAssignmentPageInfo, Wr as SpaceCreateResponse, Wt as BillingBalanceActivityList, Xn as LabelSource, Xr as SpaceFsCreateUploadResponse, Xt as BillingConversionIntent, Yn as LabelScopeType, Yr as SpaceFsCreateUploadInput, Yt as BillingCheckoutResult, Zn as MeResponse, Zr as SpaceFsEncoding, Zt as BillingCreditExpiryGroup, _i as SpaceMember, _n as CanvasNodeRecord, _r as SessionBindingRecord, ai as SpaceFsReadFilesResponse, an as BillingProductCreditBenefit, ar as PublicUserProfile, bi as SpacePresenceSnapshot, bn as Channel, br as SessionMessagesResponse, ci as SpaceFsUploadEntry, cn as BillingProductPricing, cr as ReferenceAggregateResponse, di as SpaceFsUploadPlanEntryInput, dn as BillingSubscriptionHistoryStatus, dr as ReferenceQueryResponse, ea as ChannelConfig, ei as SpaceFsFileResponse, en as BillingCreditUnit, er as PatchResourceLabelsResponse, fi as SpaceFsUploadProgress, fn as BillingSubscriptionSummary, fr as ReferenceQueryableType, gi as SpaceListItem, gn as CanvasNodeInput, gr as SendMessageCronJobPayload, hi as SpaceInvitation, hn as CanvasDocumentRecord, hr as ResourceLabelsResponse, ii as SpaceFsReadFilesInput, in as BillingProductBillingInterval, ir as PromptTemplateCatalogResponse, ji as SpaceUsageSummary, jn as CronJobUpdatePatch, jr as SpaceChannelBindingInput, ki as SpaceUsageHourlyStat, kn as CronJobPayload, kr as SpaceAccessPolicy, li as SpaceFsUploadError, ln as BillingRedemptionResult, lr as ReferenceDirection, mi as SpaceFsWriteFileInput, mn as CanvasCreateInput, mr as ReferenceResourceType, n as createHttpClient, ni as SpaceFsPreparingFile, nn as BillingPaymentStatus, nr as PromptAccessMode, oi as SpaceFsTreeResponse, on as BillingProductDisplay, or as ReferenceAggregateGroup, pi as SpaceFsUploadResponse, pn as CanvasBootstrapResponse, pr as ReferenceRecord, qn as LabelRecord, qr as SpaceFsCompleteUploadInput, qt as BillingCatalogProduct, ri as SpaceFsReadFilesError, rn as BillingPluginStatus, rr as PromptTemplateCatalogEntry, si as SpaceFsUploadDestination, sn as BillingProductKind, sr as ReferenceAggregateGroupBy, t as CohubHttpClient, ta as DiscordChannelConfig, ti as SpaceFsMoveInput, tn as BillingHistoryPagination, tr as Permission, ui as SpaceFsUploadPlanEntry, un as BillingSubscriptionHistoryList, ur as ReferenceKind, vi as SpaceMeta, vn as CanvasSemanticOp, vr as SessionMessageResponse, wi as SpaceRole, wn as CreateSpaceInput, wr as SessionTurnSignedUrlsResponse, wt as HttpError, xi as SpacePresenceUser, xn as CheckpointRecord, xr as SessionRecord, yi as SpaceModListItem, yn as CanvasTransactionInput, yr as SessionMessagesPaginatedResponse, zi as ListGenerationModelsResponse, zn as InvitationDetail, zr as SpaceCommerceProductBenefitBinding, zt as ApiError } from "./chunks/http.js";
|
|
3
3
|
export { AcceptInvitationResponse, ApiError, BatchUserProfilesResponse, BillingAccessWarning, BillingBalanceActivity, BillingBalanceActivityKind, BillingBalanceActivityList, BillingBalanceActivityStatus, BillingCatalog, BillingCatalogProduct, BillingCheckoutActionState, BillingCheckoutResult, BillingConversionIntent, BillingCreditExpiryGroup, BillingCreditGrantStatus, BillingCreditStatus, BillingCreditUnit, BillingHistoryPagination, BillingPaymentStatus, BillingPluginStatus, BillingProductBillingInterval, BillingProductCreditBenefit, BillingProductDisplay, BillingProductKind, BillingProductPricing, BillingRedemptionResult, BillingSubscriptionHistoryList, BillingSubscriptionHistoryStatus, BillingSubscriptionSummary, CanvasBootstrapResponse, CanvasCreateInput, CanvasDocumentRecord, CanvasNodeInput, CanvasNodeRecord, CanvasSemanticOp, CanvasTransactionInput, Channel, type ChannelConfig, CheckpointRecord, type CohubClientOptions, CohubHttpClient, type ContentBlock, type CreateGenerationTaskRequest, type CreateGenerationTaskResponse, CreateInvitationInput, CreateInvitationResponse, CreateSpaceInput, CreateSpaceModInput, CreateSpacePromptInput, CreateSpacePromptResponse, CreateSpaceSessionInput, CronJobPayload, CronJobRecord, CronJobUpdatePatch, CursorPageInfo, 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, PatchResourceLabelsInput, PatchResourceLabelsResponse, Permission, PromptAccessMode, PromptTemplateCatalogEntry, PromptTemplateCatalogResponse, type PublicGenerationDeclaration, PublicUserProfile, ReferenceAggregateGroup, ReferenceAggregateGroupBy, ReferenceAggregateResponse, ReferenceDirection, ReferenceKind, ReferenceQueryResponse, ReferenceQueryableType, ReferenceRecord, ReferenceResourceType, ResourceLabelsResponse, SendMessageCronJobPayload, SessionBindingRecord, type SessionForkRecord, SessionMessageResponse, SessionMessagesPaginatedResponse, SessionMessagesResponse, SessionRecord, type SessionTurnIndexItem, SessionTurnIndexResponse, type SessionTurnRecord, SessionTurnResponse, type SessionTurnSegmentRecord, SessionTurnSignedUrlsResponse, SessionTurnStreamSnapshotResponse, SessionTurnWindowResponse, SessionTurnsPaginatedResponse, SpaceAccess, SpaceAccessPolicy, SpaceBootstrapSource, SpaceChannelBindingInput, SpaceCheckpointDetailResponse, SpaceCommerceBenefit, SpaceCommerceBuyerProfile, SpaceCommerceCreditsBenefit, SpaceCommerceFeatureBenefit, SpaceCommerceOrder, SpaceCommerceProduct, SpaceCommerceProductBenefitBinding, SpaceCommerceProductCreditBenefit, SpaceConfig, SpaceConfigInput, SpaceConfigResponse, SpaceCreateResponse, SpaceDefaultResponse, 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, SpacePresenceSnapshot, SpacePresenceUser, SpacePublicProfile, SpaceRecord, SpaceRole, SpaceSandboxAutoDestroyPolicy, SpaceSandboxConfig, SpaceSandboxProvider, SpaceSessionsResponse, SpaceUsageHourlyStat, SpaceUsageResponse, SpaceUsageSummary, TaskRunDetailResponse, TaskRunRecord, UserProfile, UserRulesResponse, createHttpClient };
|