@neta-art/cohub 7.0.0 → 8.0.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 +328 -226
- package/dist/chunks/http.js +227 -194
- package/dist/chunks/websocket.d.ts +92 -73
- package/dist/http.d.ts +3 -3
- package/dist/index.d.ts +165 -119
- package/dist/index.js +409 -286
- package/dist/protocol/dist/index.d.ts +1 -1
- package/dist/protocol/dist/realtime/types.d.ts +1 -1
- package/package.json +1 -1
- /package/dist/protocol/dist/{work.d.ts → app.d.ts} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as CreateInvitationInput, $a as
|
|
1
|
+
import { $ as CreateInvitationInput, $a as BoardCapability, $i as DesktopCommand, $n as SpaceFsMoveInput, $r as FeishuChannelConfig, $t as ReferralDashboard, A as BillingPluginStatus, Aa as BoardItemPatch, Ai as RealtimeRoomMember, An as SpaceCommerceCreditsBenefit, Ao as mergeRequestSourceIntoMeta, Ar as SpaceSessionsResponse, At as MeResponse, B as BillingSubscriptionHistoryStatus, Ba as BOARD_ANIMATION_CHANNEL_CAPABILITIES, Bi as AppArtifactManifestFile, Bn as SpaceCreateResponse, Br as UserActivityRange, Bt as PublicUserPageResponse, C as BillingCreditStatus, Ca as BoardSummary, Ci as ChannelEnvelope, Cn as SpaceBootstrapSource, Co as REQUEST_SOURCE_VIA_MAX_LENGTH, Cr as SpacePresenceUser, Ct as LabelItemsResponse, D as BillingDiscountPricing, Da as BoardAuthoringItemSchema, Dn as SpaceCheckpointDetailResponse, Do as isRequestSourceClientId, Dr as SpaceSandboxAutoDestroyPolicy, Dt as LabelResourceType, E as BillingDiscountOfferRef, Ea as BoardAuthoringItem, Ei as RealtimeAppVersionRecord, En as SpaceChannelBindingInput, Eo as hasRequestSourceIdentity, Er as SpaceRole, Et as LabelRecord, F as BillingProductPricing, Fa as BoardEffect, Fi as BoardAwarenessStateUpdate, Fn as SpaceCommerceProductCreditBenefit, Fo as resolveRequestSourceChannel, Fr as SpaceUsageResponse, Ft as PromptAccessMode, G as CheckpointDiffFileResponse, Ga as BoardCompositionSchema, Gi as DESKTOP_COMMAND_MAX_TIMEOUT_MS, Gn as SpaceFsCreateDirectoryInput, Gr as UserSessionListItem, Gt as ReferenceAggregateGroupBy, H as Channel, Ha as BoardComposition, Hi as AppBoardAsset, Hn as SpaceEnvInput, Hr as UserActivityResponse, Ht as PublicUserSpaceItem, I as BillingPromotionCodePreview, Ia as BoardEffectInput, Ii as BoardAwarenessUpdate, In as SpaceConfig, Ir as SpaceUsageSummary, It as PromptTemplateCatalogEntry, J as CheckpointDiffStats, Ja as BoardTimeline, Ji as DESKTOP_COMMAND_SETTLEMENT_GRACE_SECONDS, Jn as SpaceFsDeleteNodeInput, Jr as ChannelConfig, Jt as ReferenceKind, K as CheckpointDiffPatchKind, Ka as BoardEasing, Ki as DESKTOP_COMMAND_PAYLOAD_MAX_BYTES, Kn as SpaceFsCreateUploadInput, Kr as UserSessionSpaceSummary, Kt as ReferenceAggregateResponse, L as BillingRedemptionResult, La as BoardEffectInputSchema, Li as AppArtifactDescriptor, Ln as SpaceConfigInput, Lr as TaskRunDetailResponse, Lt as PromptTemplateCatalogResponse, M as BillingProductCreditBenefit, Ma as BoardSemanticCommand, Mn as SpaceCommerceOrder, Mo as parseRequestSourceFromHeaders, Mr as SpaceTurnListItem, Mt as PatchResourceLabelsInput, N as BillingProductDisplay, Na as BoardSemanticMutation, Ni as BoardAwarenessGesture, Nn as SpaceCommerceProduct, No as readRequestSourceFromEnv, Nr as SpaceTurnsResponse, Nt as PatchResourceLabelsResponse, O as BillingHistoryPagination, Oa as BoardAuthoringReadInput, Oi as RealtimeRoomDescriptor, On as SpaceCommerceBenefit, Oo as isRequestSourceEmpty, Or as SpaceSandboxConfig, Ot as LabelScopeType, P as BillingProductKind, Pa as BoardAssetRef, Pi as BoardAwarenessNodePreview, Pn as SpaceCommerceProductBenefitBinding, Po as requestSourceToHeaders, Pr as SpaceUsageHourlyStat, Pt as Permission, Q as ClaimReferralResponse, Qa as parseBoardCompositionInput, Qi as DesktopCall, Qn as SpaceFsFileResponse, Qr as DiscordChannelConfig, Qt as ReferenceResourceType, R as BillingResponsePayload, Ra as BoardEffectSchema, Ri as AppArtifactDownloadDescriptor, Rn as SpaceConfigResponse, Rr as TaskRunRecord, Rt as PublicReferral, S as BillingCreditGrantStatus, Sa as BoardRecord, Sn as SpaceBootstrapMeta, So as COHUB_SOURCE_HEADER_NAMES, Sr as SpacePresenceSnapshot, St as LabelAssignmentRecord, T as BillingDiscountOffer, Ta as parseBoardPlaybackPolicy, Ti as RealtimeAppRecord, Tn as SpaceBootstrapStatus, To as RequestSourceVia, Tr as SpaceRecord, Tt as LabelListItem, U as CheckpointDiffDelivery, Ua as BoardCompositionInputSchema, Ui as AppContentKind, Un as SpaceFsCompleteUploadInput, Ur as UserProfile, Ut as PublicUserWorkItem, V as BillingSubscriptionSummary, Va as BoardAnimationTarget, Vi as AppBoardArtifactManifest, Vn as SpaceDefaultResponse, Vr as UserActivityRankings, Vt as PublicUserProfile, W as CheckpointDiffFile, Wa as BoardCompositionPlayback, Wi as DESKTOP_COMMAND_DEFAULT_TIMEOUT_MS, Wn as SpaceFsCompleteUploadResponse, Wr as UserRulesResponse, Wt as ReferenceAggregateGroup, X as CheckpointDiffSummary, Xa as BoardTrack, Xi as DESKTOP_COMMAND_VERSION, Xn as SpaceFsEntry, Xr as ChannelHealthReasonCode, Xt as ReferenceQueryableType, Y as CheckpointDiffStatus, Ya as BoardTimelineMarker, Yi as DESKTOP_COMMAND_TERMINAL_TTL_SECONDS, Yn as SpaceFsEncoding, Yr as ChannelHealth, Yt as ReferenceQueryResponse, Z as CheckpointRecord, Za as BoardTrackInterpolation, Zi as DesktopAppTarget, Zn as SpaceFsFileKind, Zr as ChannelRuntimeState, Zt as ReferenceRecord, _ as BillingCatalogProduct, _a as BoardMutationReceipt, _i as BoardColorId, _n as SkillCatalogEntry, _o as SpaceCompletionStreamEvent, _r as SpaceMember, _t as JsonObject, aa as DesktopOpenCommand, ai as decodeGenerationPolicy, an as SendMessageCronJobPayload, ao as SessionTurnSegmentRecord, ar as SpaceFsUploadDestination, at as CreateSpaceSessionInput, b as BillingConversionIntent, ba as BoardPlaybackPolicySchema, bn as SpaceAccess, bo as ContentBlock, br as SpacePendingDiffFileResponse, bt as LabelAssignmentListItem, c as createWebsocketClient, ca as isTerminalDesktopCommandStatus, ci as findGenerationModelPolicy, cn as SessionMessagesPaginatedResponse, cr as SpaceFsUploadPlanEntry, ct as CronJobUpdatePatch, d as BatchUserProfilesResponse, da as BoardCameraFocusParams, di as parseGenerationPolicyFromEnv, dn as SessionTurnIndexResponse, do as CompletionMessageRole, dr as SpaceFsUploadResponse, dt as GenerationUsageHourlyStat, ea as DesktopCommandDispatchedPayload, ei as GenerationModelPolicy, en as ReferralListItem, eo as BoardCoordinateSpace, er as SpaceFsPreparingFile, et as CreateInvitationResponse, f as BillingBalanceActivity, fa as BoardCameraState, fi as GenerationContentBlock, fn as SessionTurnResponse, fo as CompletionThinkingLevel, fr as SpaceFsWriteFileInput, ft as GenerationUsageSummary, g as BillingCatalog, ga as BoardManifest, gi as BOARD_GEO_KINDS, gn as SessionTurnsPaginatedResponse, go as SpaceCompletionResult, gr as SpaceListItem, gt as InvitationDetail, h as BillingBalanceActivityStatus, ha as BoardDiagnostic, hi as BOARD_COLOR_IDS, hn as SessionTurnWindowResponse, ho as ModelThinkingLevel, hr as SpaceInvitationLocation, ht as GlobalSearchType, ia as DesktopFileTarget, ii as assertGenerationRequestAllowedByPolicy, in as SandboxSpecId, io as SessionForkRecord, ir as SpaceFsTreeResponse, it as CreateSpacePromptResponse, j as BillingProductBillingInterval, ja as BoardItemPatchSchema, ji as RealtimeServerEvent, jn as SpaceCommerceFeatureBenefit, jo as normalizeRequestSource, jr as SpaceTurnAuthorFilter, jt as ModelCatalogEntry, k as BillingPaymentStatus, ka as BoardAuthoringSnapshot, ki as RealtimeRoomEvent, kn as SpaceCommerceBuyerProfile, ko as isRequestSourceUuid, kr as SpaceSandboxProvider, kt as LabelSource, l as AcceptInvitationResponse, la as parseDesktopCommand, li as getAllowedGenerationModelIds, ln as SessionMessagesResponse, lo as CompletionAssistantMessage, lr as SpaceFsUploadPlanEntryInput, lt as CursorPageInfo, m as BillingBalanceActivityList, ma as BoardCreateInput, mi as GenerationResult, mn as SessionTurnStreamSnapshotResponse, mo as CreateSpaceCompletionInput, mr as SpaceInvitationListResponse, mt as GlobalSearchResult, na as DesktopCommandRecord, ni as GenerationPolicy, nn as ReferralStatus, nr as SpaceFsReadFilesInput, nt as CreateSpaceModInput, oa as DesktopTarget, oi as encodeGenerationPolicy, on as SessionBindingRecord, oo as SessionTurnIndexItem, or as SpaceFsUploadEntry, ot as CronJobPayload, p as BillingBalanceActivityKind, pa as BoardCapabilities, pi as GenerationModelDeclaration, pn as SessionTurnSignedUrlsResponse, po as CompletionUsage, pr as SpaceInvitation, pt as GlobalSearchResponse, q as CheckpointDiffPatchLine, qa as BoardProceduralClip, qi as DESKTOP_COMMAND_PENDING_TTL_SECONDS, qn as SpaceFsCreateUploadResponse, qr as UserSessionsResponse, qt as ReferenceDirection, r as WebsocketClient, ra as DesktopCommandStatus, ri as GenerationPolicyError, rn as ResourceLabelsResponse, ro as MessageRecord, rr as SpaceFsReadFilesResponse, rt as CreateSpacePromptInput, s as WebsocketEventPayload, sa as isDesktopCallMethod, si as filterGenerationDeclarationsByPolicy, sn as SessionMessageResponse, so as SessionTurnRecord, sr as SpaceFsUploadError, st as CronJobRecord, ta as DesktopCommandError, ti as GenerationParameterConstraint, tn as ReferralReward, to as BoardRenderCost, tr as SpaceFsReadFilesError, tt as CreateSpaceInput, u as ApiError, ua as BoardCameraFocus, ui as normalizeGenerationPolicy, un as SessionRecord, uo as CompletionMessage, ur as SpaceFsUploadProgress, ut as GenerationUsageBlock, v as BillingCheckoutActionState, va as BoardPlaybackCommand, vi as BoardGeoKind, vn as SkillCatalogResponse, vr as SpaceMeta, vt as JsonPrimitive, w as BillingCreditUnit, wa as BoardValidationResult, wi as LabelAssignmentsUpdatedEvent, wn as SpaceBootstrapStage, wo as RequestSource, wr as SpacePublicProfile, wt as LabelItemsSessionFork, x as BillingCreditExpiryGroup, xa as BoardPlaybackSnapshot, xn as SpaceAccessPolicy, xo as COHUB_SOURCE_HEADER, xr as SpacePendingDiffSummary, xt as LabelAssignmentPageInfo, y as BillingCheckoutResult, ya as BoardPlaybackPolicy, yi as AppVersionPublishedEvent, yn as SkillCatalogSource, yr as SpaceModListItem, yt as JsonValue, z as BillingSubscriptionHistoryList, za as parseBoardEffectInput, zi as AppArtifactManifest, zn as SpaceConfigUpdateResponse, zr as UserActivityQuery, zt as PublicUserAppItem } from "./chunks/websocket.js";
|
|
2
2
|
import { a as normalizeWebsocketUrl, c as resolveVoiceInputWebsocketUrl, i as normalizeVoiceInputWebsocketUrl, l as resolveWebsocketUrl, n as CohubEnvironment, o as resolveApiBaseUrl, r as normalizeBaseUrl, s as resolveCohubEnvironment, t as COHUB_ENVIRONMENTS } from "./chunks/environment.js";
|
|
3
|
-
import { $ as
|
|
3
|
+
import { $ as AppUpdateInput, $n as AppContextChangedListener, $t as PublicInviteApi, A as WaitForUiCommandOptions, An as PublicAssetPurpose, At as WorkViewStatsResponse, B as AppPromotionCreateInput, Bn as GenerationsApi, Bt as BoardPlaybackChangedEvent, C as DesktopCommandsApi, Cn as SessionAccessApi, Cr as CreateGenerationTaskResponse, Ct as WorkResolveResponse, D as UiCommandStatus, Dn as CreatePublicAssetUploadInput, Dr as PublicGenerationDeclaration, Dt as WorkUpdateInput, E as UiCommandRecord, En as SearchApi, Er as ListGenerationModelsResponse, Et as WorkTargetType, F as AppDetailResponse, Fn as UploadChatImageAttachmentInput, Ft as TasksApi, G as AppPromotionStatsResponse, Gn as HttpError, Gt as SpaceClient, H as AppPromotionProvider, Hn as ChannelsApi, Ht as SessionEventName, I as AppExtractedPageMeta, In as UploadPublicAssetInput, It as BoardAwarenessUpdatedEvent, J as AppRecord, Jn as RawHttpResponse, Jt as SpaceTurnListOptions, K as AppPublicOwnerRecord, Kn as HttpTraceContext, Kt as SpaceEventName, L as AppGetResponse, Ln as SkillsApi, Lt as BoardChangedEvent, M as AppContent, Mn as PublicAssetUploadProtocol, Mt as ReferralsApi, N as AppContentDownload, Nn as PublicAssetsApi, Nt as UsersApi, O as UiCommandsApi, On as CreatePublicAssetUploadResponse, Or as ModelStatusEntry, Ot as WorkVersionRecord, P as AppCreateInput, Pn as UploadChatAttachmentInput, Pt as UserApi, Q as AppTargetType, Qn as sanitizeAccessToken, Qt as BuildSpacePathInput, R as AppMeta, Rn as PromptsApi, Rt as BoardClient, S as CreateUiCommandInput, Sn as createSessionPatchReducer, Sr as CreateGenerationTaskRequest, St as WorkRecord, T as UiCommandError, Tn as ReferencesApi, Tr as GenerationUsageBilling, Tt as WorkStatus, U as AppPromotionProviderStatus, Un as CohubClientOptions, Ut as SessionSubscriptionHandlers, V as AppPromotionEventResponse, Vn as CronJobsApi, Vt as BoardSubscriptionHandlers, W as AppPromotionRecord, Wn as Fetch, Wt as SpaceChannelBindingRecord, X as AppSessionResponse, Xn as joinApiUrl, Xt as WebSocketConnectionState, Y as AppResolveResponse, Yn as UnauthorizedContext, Yt as SpacesApi, Z as AppStatus, Zn as matchesUnauthorizedErrorToken, Zt as BuildSpaceInvitePathInput, _ as WorkCommerceEntitlementsResponse, _n as SessionPatchApplyInput, _r as PublicFileListResponse, _t as WorkPromotionProviderStatus, a as AppCommerceCreditConsumeResponse, an as GenerationStreamEvent, ar as AppRuntimeInvocationContext, at as WorkAuthorizeResponse, b as WorkCommercePurchaseResponse, bn as SessionPatchState, br as PublicFileUrlResponse, bt as WorkPublicOwnerRecord, c as AppCommerceEntitlementsResponse, cn as GenerationStreamLifecycleEvent, cr as AppRuntimeTransport, ct as WorkCreateInput, d as AppCommercePurchaseResponse, dn as GenerationStreamSubscribeOptions, dr as createAppRuntime, dt as WorkGetResponse, en as buildSpaceInvitePath, er as AppIdResolver, et as AppVersionRecord, f as WorkCommerceApi, fn as GenerationStreamSubscriptionHandlers, fr as createSlugAppIdResolver, ft as WorkMeta, g as WorkCommerceEntitlement, gn as parseAssistantMessageCommit, gr as PublicFileListEntry, gt as WorkPromotionProvider, h as WorkCommerceCreditConsumeStatus, hn as createSessionGenerationStreamClient, hr as PublicFileCreateUploadResponse, ht as WorkPromotionEventResponse, i as AppCommerceCheckoutStatus, in as GenerationStreamErrorEvent, ir as AppRuntimeContext, it as AppsApi, j as AppAuthorizeResponse, jn as PublicAssetUploadProgress, jt as WorkVisibility, k as WaitForDesktopCommandOptions, kn as PublicAssetMimeType, kr as ModelStatusResponse, kt as WorkViewSource, l as AppCommerceOrder, ln as GenerationStreamOutOfSyncEvent, lr as ParentBridgeTransport, lt as WorkDetailResponse, m as WorkCommerceCreditConsumeResponse, mn as SessionGenerationStreamClient, mr as PublicFileCreateUploadInput, mt as WorkPromotionCreateInput, n as createHttpClient, nn as AssistantMessageCommit, nr as AppRuntimeCheckoutState, nt as AppViewStatsResponse, o as AppCommerceCreditConsumeStatus, on as GenerationStreamFinalizedEvent, or as AppRuntimeModeConfig, ot as WorkContent, p as WorkCommerceCheckoutStatus, pn as GenerationStreamTurnUpdatedEvent, pr as resolveAppTransport, pt as WorkPresentationMeta, q as AppPublicSpaceRecord, qn as HttpTransport, qt as SpacePublicFilesApi, r as AppCommerceApi, rn as GenerationStreamCommitEvent, rr as AppRuntimeCheckoutStatus, rt as AppVisibility, s as AppCommerceEntitlement, sn as GenerationStreamIntermediateMessage, sr as AppRuntimeRequestOptions, st as WorkContentDownload, t as CohubHttpClient, tn as buildSpacePath, tr as AppRuntimeApi, tt as AppViewSource, u as AppCommerceProductResolveResponse, un as GenerationStreamStateEvent, ur as PopupBrokerTransport, ut as WorkExtractedPageMeta, v as WorkCommerceOrder, vn as SessionPatchApplyResult, vr as PublicFileUploadEntryInput, vt as WorkPromotionRecord, w as UiCommand, wn as ReferenceResourceSelector, wr as GenerationTaskResult, wt as WorkSessionResponse, x as CreateDesktopCommandInput, xn as SessionPatchStatus, xr as SpaceStartupResponse, xt as WorkPublicSpaceRecord, y as WorkCommerceProductResolveResponse, yn as SessionPatchReducer, yr as PublicFileUploadPlanEntry, yt as WorkPromotionStatsResponse, z as AppPresentationMeta, zn as ModelsApi, zt as BoardEventName } from "./chunks/http.js";
|
|
4
4
|
import { a as VoiceInputCreateOptions, i as VoiceInputClientOptions, l as createVoiceInputClient, n as VoiceInputCallbacks, o as VoiceInputEvent, r as VoiceInputClient, t as VoiceApi } from "./chunks/voice-input.js";
|
|
5
5
|
//#region ../protocol/dist/generation/catalog.d.ts
|
|
6
6
|
type GenerationModelVisibility = Pick<GenerationModelDeclaration, "model" | "hidden">;
|
|
@@ -13,31 +13,31 @@ declare function filterDiscoverableGenerationModels<T extends GenerationModelVis
|
|
|
13
13
|
declare function isUuid(value: string): boolean;
|
|
14
14
|
declare function isUuid(value: unknown): value is string;
|
|
15
15
|
//#endregion
|
|
16
|
-
//#region ../protocol/dist/
|
|
17
|
-
declare const
|
|
18
|
-
declare const
|
|
19
|
-
declare const
|
|
20
|
-
declare const
|
|
21
|
-
declare const
|
|
22
|
-
declare const
|
|
23
|
-
declare const
|
|
16
|
+
//#region ../protocol/dist/app-surface.d.ts
|
|
17
|
+
declare const APP_SURFACE_PROTOCOL = "cohub.app.surface";
|
|
18
|
+
declare const APP_SURFACE_VERSION = 1;
|
|
19
|
+
declare const APP_SURFACE_READY_TIMEOUT_MS = 10000;
|
|
20
|
+
declare const APP_SURFACE_REQUEST_TIMEOUT_MS = 15000;
|
|
21
|
+
declare const APP_COMPOSER_CHIP_KEY_MAX_LENGTH = 80;
|
|
22
|
+
declare const APP_COMPOSER_CHIP_LABEL_MAX_LENGTH = 120;
|
|
23
|
+
declare const APP_COMPOSER_CHIP_CONTENT_MAX_BYTES: number;
|
|
24
24
|
type SurfaceEnvelope = {
|
|
25
|
-
protocol: typeof
|
|
26
|
-
version: typeof
|
|
25
|
+
protocol: typeof APP_SURFACE_PROTOCOL;
|
|
26
|
+
version: typeof APP_SURFACE_VERSION;
|
|
27
27
|
};
|
|
28
|
-
type
|
|
28
|
+
type AppSurfaceReadyMessage = SurfaceEnvelope & {
|
|
29
29
|
type: "ready";
|
|
30
30
|
methods: string[];
|
|
31
31
|
};
|
|
32
|
-
type
|
|
32
|
+
type AppSurfaceRequestMessage = SurfaceEnvelope & {
|
|
33
33
|
type: "request";
|
|
34
34
|
requestId: string;
|
|
35
35
|
method: string;
|
|
36
36
|
input?: unknown;
|
|
37
|
-
/** The originating
|
|
37
|
+
/** The originating desktop command that the app will complete. */
|
|
38
38
|
commandId: string;
|
|
39
39
|
};
|
|
40
|
-
type
|
|
40
|
+
type AppSurfaceResponseMessage = SurfaceEnvelope & {
|
|
41
41
|
type: "response";
|
|
42
42
|
requestId: string;
|
|
43
43
|
ok: boolean;
|
|
@@ -46,14 +46,14 @@ type WorkSurfaceResponseMessage = SurfaceEnvelope & {
|
|
|
46
46
|
message: string;
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
|
-
type
|
|
49
|
+
type AppComposerChip = {
|
|
50
50
|
key: string;
|
|
51
51
|
label: string;
|
|
52
52
|
content: string;
|
|
53
53
|
};
|
|
54
|
-
declare const
|
|
55
|
-
declare const
|
|
56
|
-
declare const
|
|
54
|
+
declare const parseAppSurfaceReady: (value: unknown) => AppSurfaceReadyMessage | null;
|
|
55
|
+
declare const parseAppSurfaceResponse: (value: unknown) => AppSurfaceResponseMessage | null;
|
|
56
|
+
declare const buildAppSurfaceRequest: (input: Omit<AppSurfaceRequestMessage, keyof SurfaceEnvelope | "type">) => AppSurfaceRequestMessage;
|
|
57
57
|
//#endregion
|
|
58
58
|
//#region src/apis/billing.d.ts
|
|
59
59
|
declare class BillingApi {
|
|
@@ -114,9 +114,9 @@ declare class BillingApi {
|
|
|
114
114
|
}>;
|
|
115
115
|
}
|
|
116
116
|
//#endregion
|
|
117
|
-
//#region src/apis/
|
|
118
|
-
type
|
|
119
|
-
type
|
|
117
|
+
//#region src/apis/app-realtime.d.ts
|
|
118
|
+
type AppRoomEventMap = object;
|
|
119
|
+
type AppRoomCreateInput = {
|
|
120
120
|
code?: string;
|
|
121
121
|
expiresInSeconds?: number;
|
|
122
122
|
maxParticipants?: number;
|
|
@@ -126,14 +126,14 @@ type WorkRoomCreateInput = {
|
|
|
126
126
|
*/
|
|
127
127
|
seatPerUser?: boolean;
|
|
128
128
|
};
|
|
129
|
-
type
|
|
129
|
+
type AppRoomAdmissionResponse = {
|
|
130
130
|
room: RealtimeRoomDescriptor;
|
|
131
131
|
participantId: string;
|
|
132
132
|
userKey: string;
|
|
133
133
|
ticket: string;
|
|
134
134
|
};
|
|
135
|
-
type
|
|
136
|
-
type
|
|
135
|
+
type AppRoomState = "connecting" | "joined" | "reconnecting" | "expired" | "closed";
|
|
136
|
+
type AppRoomEvent<T = unknown> = {
|
|
137
137
|
id: string;
|
|
138
138
|
timestamp: number;
|
|
139
139
|
roomId: string;
|
|
@@ -146,15 +146,15 @@ type WorkRoomEvent<T = unknown> = {
|
|
|
146
146
|
};
|
|
147
147
|
self: boolean;
|
|
148
148
|
};
|
|
149
|
-
type
|
|
149
|
+
type AppRoomPublishResult = {
|
|
150
150
|
eventId: string;
|
|
151
151
|
sequence: number;
|
|
152
152
|
clientEventId: string | null;
|
|
153
153
|
};
|
|
154
|
-
type EventHandler<T> = (event:
|
|
155
|
-
type StateHandler = (state:
|
|
154
|
+
type EventHandler<T> = (event: AppRoomEvent<T>) => void;
|
|
155
|
+
type StateHandler = (state: AppRoomState) => void;
|
|
156
156
|
type MembersHandler = (members: RealtimeRoomMember[]) => void;
|
|
157
|
-
declare class
|
|
157
|
+
declare class AppRoom<Events extends AppRoomEventMap = AppRoomEventMap> {
|
|
158
158
|
private readonly websocket;
|
|
159
159
|
private readonly admission;
|
|
160
160
|
readonly id: string;
|
|
@@ -184,8 +184,8 @@ declare class WorkRoom<Events extends WorkRoomEventMap = WorkRoomEventMap> {
|
|
|
184
184
|
private readonly offOpen;
|
|
185
185
|
private readonly offClose;
|
|
186
186
|
private readonly offReconnecting;
|
|
187
|
-
constructor(websocket: WebsocketClient, admission:
|
|
188
|
-
get state():
|
|
187
|
+
constructor(websocket: WebsocketClient, admission: AppRoomAdmissionResponse);
|
|
188
|
+
get state(): AppRoomState;
|
|
189
189
|
/**
|
|
190
190
|
* Identity of this connection inside the room. A `seatPerUser` join can take over a
|
|
191
191
|
* seat the viewer already holds, so this may differ from the id issued at admission.
|
|
@@ -194,7 +194,7 @@ declare class WorkRoom<Events extends WorkRoomEventMap = WorkRoomEventMap> {
|
|
|
194
194
|
get members(): RealtimeRoomMember[];
|
|
195
195
|
connect(): Promise<this>;
|
|
196
196
|
subscribe<K extends Extract<keyof Events, string>>(type: K, handler: EventHandler<Events[K]>): () => boolean;
|
|
197
|
-
subscribeAll(handler: (event:
|
|
197
|
+
subscribeAll(handler: (event: AppRoomEvent<unknown>) => void): () => boolean;
|
|
198
198
|
onStateChange(handler: StateHandler): () => boolean;
|
|
199
199
|
onMembersChanged(handler: MembersHandler): () => boolean;
|
|
200
200
|
onOutOfSync(handler: (expected: number, actual: number) => void): () => boolean;
|
|
@@ -232,34 +232,50 @@ declare class WorkRoom<Events extends WorkRoomEventMap = WorkRoomEventMap> {
|
|
|
232
232
|
private expire;
|
|
233
233
|
private dispose;
|
|
234
234
|
}
|
|
235
|
-
declare class
|
|
235
|
+
declare class AppRealtimeApi {
|
|
236
236
|
private readonly transport;
|
|
237
237
|
private readonly websocket;
|
|
238
238
|
private readonly getContext;
|
|
239
|
-
constructor(transport: HttpTransport, websocket: WebsocketClient, getContext: () => Promise<
|
|
240
|
-
createRoom<Events extends
|
|
241
|
-
joinRoom<Events extends
|
|
239
|
+
constructor(transport: HttpTransport, websocket: WebsocketClient, getContext: () => Promise<AppRuntimeContext | null>);
|
|
240
|
+
createRoom<Events extends AppRoomEventMap = AppRoomEventMap>(input?: AppRoomCreateInput): Promise<AppRoom<Events>>;
|
|
241
|
+
joinRoom<Events extends AppRoomEventMap = AppRoomEventMap>(input: {
|
|
242
242
|
code: string;
|
|
243
|
-
}): Promise<
|
|
244
|
-
private
|
|
243
|
+
}): Promise<AppRoom<Events>>;
|
|
244
|
+
private requireAppId;
|
|
245
245
|
private openRoom;
|
|
246
246
|
}
|
|
247
|
+
/** @deprecated Use `AppRoomAdmissionResponse`. */
|
|
248
|
+
type WorkRoomAdmissionResponse = AppRoomAdmissionResponse;
|
|
249
|
+
/** @deprecated Use `AppRoomCreateInput`. */
|
|
250
|
+
type WorkRoomCreateInput = AppRoomCreateInput;
|
|
251
|
+
/** @deprecated Use `AppRoomEvent`. */
|
|
252
|
+
type WorkRoomEvent<T = unknown> = AppRoomEvent<T>;
|
|
253
|
+
/** @deprecated Use `AppRoomEventMap`. */
|
|
254
|
+
type WorkRoomEventMap = AppRoomEventMap;
|
|
255
|
+
/** @deprecated Use `AppRoomPublishResult`. */
|
|
256
|
+
type WorkRoomPublishResult = AppRoomPublishResult;
|
|
257
|
+
/** @deprecated Use `AppRoomState`. */
|
|
258
|
+
type WorkRoomState = AppRoomState;
|
|
259
|
+
/** @deprecated Use `AppRealtimeApi`. */
|
|
260
|
+
declare class WorkRealtimeApi extends AppRealtimeApi {}
|
|
261
|
+
/** @deprecated Use `AppRoom`. */
|
|
262
|
+
declare class WorkRoom<Events extends AppRoomEventMap = AppRoomEventMap> extends AppRoom<Events> {}
|
|
247
263
|
//#endregion
|
|
248
|
-
//#region src/
|
|
249
|
-
type
|
|
264
|
+
//#region src/app-surface.d.ts
|
|
265
|
+
type AppSurfaceHandlerContext = {
|
|
250
266
|
/** The UI command this handler must complete. */
|
|
251
267
|
commandId: string;
|
|
252
268
|
};
|
|
253
|
-
type
|
|
254
|
-
declare class
|
|
269
|
+
type AppSurfaceHandler = (input: unknown, context: AppSurfaceHandlerContext) => unknown | Promise<unknown>;
|
|
270
|
+
declare class AppSurfaceApi {
|
|
255
271
|
private readonly handlers;
|
|
256
272
|
private listening;
|
|
257
273
|
private allowedOrigins;
|
|
258
274
|
private trustedOrigin;
|
|
259
275
|
allowHostOrigins(origins: string[]): void;
|
|
260
|
-
handle(method: string, handler:
|
|
276
|
+
handle(method: string, handler: AppSurfaceHandler): () => void;
|
|
261
277
|
get methods(): string[];
|
|
262
|
-
setComposerChip(chip:
|
|
278
|
+
setComposerChip(chip: AppComposerChip): void;
|
|
263
279
|
clearComposerChip(key: string): void;
|
|
264
280
|
announce(): void;
|
|
265
281
|
private isTrusted;
|
|
@@ -269,6 +285,8 @@ declare class WorkSurfaceApi {
|
|
|
269
285
|
private dispatch;
|
|
270
286
|
private post;
|
|
271
287
|
}
|
|
288
|
+
/** @deprecated Use `AppSurfaceApi`. */
|
|
289
|
+
declare class WorkSurfaceApi extends AppSurfaceApi {}
|
|
272
290
|
//#endregion
|
|
273
291
|
//#region src/client.d.ts
|
|
274
292
|
declare class CohubClient {
|
|
@@ -287,43 +305,50 @@ declare class CohubClient {
|
|
|
287
305
|
readonly references: ReferencesApi;
|
|
288
306
|
readonly tasks: TasksApi;
|
|
289
307
|
readonly cronJobs: CronJobsApi;
|
|
290
|
-
readonly
|
|
308
|
+
readonly desktop: DesktopCommandsApi;
|
|
291
309
|
readonly invite: PublicInviteApi;
|
|
292
310
|
readonly referrals: ReferralsApi;
|
|
293
311
|
readonly voice: VoiceApi;
|
|
294
|
-
readonly
|
|
295
|
-
readonly
|
|
312
|
+
readonly apps: AppsApi;
|
|
313
|
+
readonly appCommerce: AppCommerceApi;
|
|
314
|
+
/** @deprecated Use `client.desktop`. */
|
|
315
|
+
get ui(): DesktopCommandsApi;
|
|
316
|
+
/** @deprecated Use `client.apps`. */
|
|
317
|
+
get works(): AppsApi;
|
|
318
|
+
/** @deprecated Use `client.appCommerce`. */
|
|
319
|
+
get workCommerce(): AppCommerceApi;
|
|
296
320
|
private readonly transport;
|
|
297
321
|
private readonly websocketClient;
|
|
298
|
-
private readonly
|
|
322
|
+
private readonly appRuntime;
|
|
299
323
|
constructor(options?: CohubClientOptions);
|
|
300
|
-
context(): Promise<
|
|
324
|
+
context(): Promise<AppRuntimeContext | null>;
|
|
301
325
|
readonly auth: {
|
|
302
326
|
request: (input: {
|
|
303
327
|
scopes: Permission[];
|
|
304
328
|
reason?: string;
|
|
305
329
|
}) => Promise<boolean>;
|
|
306
330
|
};
|
|
307
|
-
readonly
|
|
308
|
-
realtime:
|
|
309
|
-
/** Expose callable methods from inside a published
|
|
310
|
-
surface:
|
|
331
|
+
readonly app: {
|
|
332
|
+
realtime: AppRealtimeApi;
|
|
333
|
+
/** Expose callable methods from inside a published app. */
|
|
334
|
+
surface: AppSurfaceApi;
|
|
335
|
+
onContextChanged: (listener: AppContextChangedListener) => () => void;
|
|
311
336
|
composer: {
|
|
312
|
-
/** Attach or update context from this
|
|
313
|
-
setChip: (chip:
|
|
314
|
-
/** Remove context previously attached by this
|
|
337
|
+
/** Attach or update context from this app in the Cohub composer. */
|
|
338
|
+
setChip: (chip: AppComposerChip) => void;
|
|
339
|
+
/** Remove context previously attached by this app. */
|
|
315
340
|
clearChip: (key: string) => void;
|
|
316
341
|
};
|
|
317
342
|
commerce: {
|
|
318
343
|
resolveProducts: (input: {
|
|
319
344
|
productKeys: string[];
|
|
320
|
-
}) => Promise<
|
|
321
|
-
getEntitlements: () => Promise<
|
|
345
|
+
}) => Promise<AppCommerceProductResolveResponse>;
|
|
346
|
+
getEntitlements: () => Promise<AppCommerceEntitlementsResponse>;
|
|
322
347
|
consumeCredits: (input: {
|
|
323
348
|
amount: number;
|
|
324
349
|
operationId: string;
|
|
325
350
|
reason?: string;
|
|
326
|
-
}) => Promise<
|
|
351
|
+
}) => Promise<AppCommerceCreditConsumeResponse>;
|
|
327
352
|
purchase: (input: {
|
|
328
353
|
productKey: string;
|
|
329
354
|
purchaseAttemptId?: string;
|
|
@@ -337,11 +362,11 @@ declare class CohubClient {
|
|
|
337
362
|
productKey: string;
|
|
338
363
|
} | null>;
|
|
339
364
|
getCheckoutState: () => Promise<{
|
|
340
|
-
status:
|
|
365
|
+
status: AppCommerceCheckoutStatus;
|
|
341
366
|
orderId: string | null;
|
|
342
367
|
}>;
|
|
343
368
|
getOrder: (orderId: string) => Promise<{
|
|
344
|
-
order:
|
|
369
|
+
order: AppCommerceOrder;
|
|
345
370
|
}>;
|
|
346
371
|
};
|
|
347
372
|
};
|
|
@@ -351,46 +376,61 @@ declare class CohubClient {
|
|
|
351
376
|
}
|
|
352
377
|
declare const createCohubClient: (options?: CohubClientOptions) => CohubClient;
|
|
353
378
|
//#endregion
|
|
354
|
-
//#region src/
|
|
379
|
+
//#region src/app-ref.d.ts
|
|
355
380
|
/**
|
|
356
|
-
* Accepts every way
|
|
357
|
-
* URL, `cohub://
|
|
381
|
+
* Accepts every way an app is named across Cohub — id, management URL, public
|
|
382
|
+
* URL, `cohub://apps` URI, or `username/space/app` — and normalizes it.
|
|
383
|
+
*
|
|
384
|
+
* The legacy `work://` and `cohub://works` schemes stay accepted so existing
|
|
385
|
+
* scripts keep working; new references use the `app://` spelling.
|
|
358
386
|
*
|
|
359
387
|
* Public and mention forms may carry launch state (`?query#hash`); it is kept
|
|
360
|
-
* separately so it can be forwarded to the
|
|
388
|
+
* separately so it can be forwarded to the app while the stable identity stays
|
|
361
389
|
* clean.
|
|
362
390
|
*/
|
|
363
|
-
type
|
|
391
|
+
type AppPublicRef = {
|
|
364
392
|
username: string;
|
|
365
393
|
spaceSlug: string;
|
|
366
|
-
|
|
394
|
+
appSlug: string;
|
|
367
395
|
};
|
|
368
|
-
type
|
|
396
|
+
type ParsedAppRef = ({
|
|
369
397
|
id: string;
|
|
370
|
-
} |
|
|
398
|
+
} | AppPublicRef) & {
|
|
371
399
|
/** Query string including `?`, when the reference carried one. */
|
|
372
400
|
search?: string;
|
|
373
401
|
/** Hash including `#`, when the reference carried one. */
|
|
374
402
|
hash?: string;
|
|
375
403
|
};
|
|
376
|
-
declare const
|
|
377
|
-
declare class
|
|
404
|
+
declare const isAppId: (value: string) => boolean;
|
|
405
|
+
declare class AppRefParseError extends Error {
|
|
378
406
|
constructor();
|
|
379
407
|
}
|
|
380
|
-
declare function
|
|
381
|
-
declare function
|
|
408
|
+
declare function parseAppRef(input: string): ParsedAppRef;
|
|
409
|
+
declare function formatAppRef(ref: ParsedAppRef): string;
|
|
410
|
+
/** @deprecated Use `AppPublicRef`. */
|
|
411
|
+
type WorkPublicRef = AppPublicRef;
|
|
412
|
+
/** @deprecated Use `ParsedAppRef`. */
|
|
413
|
+
type ParsedWorkRef = ParsedAppRef;
|
|
414
|
+
/** @deprecated Use `isAppId`. */
|
|
415
|
+
declare const isWorkId: typeof isAppId;
|
|
416
|
+
/** @deprecated Use `AppRefParseError`. */
|
|
417
|
+
declare const WorkRefParseError: typeof AppRefParseError;
|
|
418
|
+
/** @deprecated Use `parseAppRef`. */
|
|
419
|
+
declare const parseWorkRef: typeof parseAppRef;
|
|
420
|
+
/** @deprecated Use `formatAppRef`. */
|
|
421
|
+
declare const formatWorkRef: typeof formatAppRef;
|
|
382
422
|
//#endregion
|
|
383
|
-
//#region src/
|
|
423
|
+
//#region src/app-bridge-core.d.ts
|
|
384
424
|
/**
|
|
385
|
-
* The subset of
|
|
386
|
-
* Matches what the iframe host (
|
|
387
|
-
* hand after loading the
|
|
425
|
+
* The subset of an app record the bridge host needs to answer bridge messages.
|
|
426
|
+
* Matches what the iframe host (AppSurface) and the broker page both have on
|
|
427
|
+
* hand after loading the app.
|
|
388
428
|
*/
|
|
389
|
-
type
|
|
429
|
+
type AppBridgeCoreApp = Pick<AppRecord, "id" | "spaceId" | "slug" | "userUuid" | "appScopes" | "allowedViewerScopes">;
|
|
390
430
|
/**
|
|
391
431
|
* A pending authorize request surfaced to the UI as a consent dialog.
|
|
392
432
|
*/
|
|
393
|
-
type
|
|
433
|
+
type AppAuthorizeRequest = {
|
|
394
434
|
requestId: string;
|
|
395
435
|
scopes: Permission[];
|
|
396
436
|
reason?: string;
|
|
@@ -398,100 +438,106 @@ type WorkAuthorizeRequest = {
|
|
|
398
438
|
/**
|
|
399
439
|
* A pending purchase request surfaced to the UI as a checkout confirmation.
|
|
400
440
|
*/
|
|
401
|
-
type
|
|
441
|
+
type AppPurchaseRequest = {
|
|
402
442
|
requestId: string;
|
|
403
443
|
productKey: string;
|
|
404
444
|
purchaseAttemptId: string;
|
|
405
445
|
};
|
|
406
|
-
type
|
|
446
|
+
type AppCheckoutStarted = AppPurchaseRequest & {
|
|
407
447
|
value?: number;
|
|
408
448
|
currency?: string;
|
|
409
449
|
};
|
|
410
450
|
/**
|
|
411
451
|
* Reactive dialog state managed by the core. The host (Svelte or React)
|
|
412
|
-
* subscribes via {@link
|
|
452
|
+
* subscribes via {@link AppBridgeCoreConfig.onStateChange} and mirrors these
|
|
413
453
|
* fields into its own reactive primitives.
|
|
414
454
|
*/
|
|
415
|
-
type
|
|
455
|
+
type AppBridgeDialogState = {
|
|
416
456
|
authOpen: boolean;
|
|
417
|
-
pendingAuth:
|
|
457
|
+
pendingAuth: AppAuthorizeRequest | null;
|
|
418
458
|
authError: string | null;
|
|
419
459
|
authSaving: boolean;
|
|
420
460
|
purchaseOpen: boolean;
|
|
421
|
-
pendingPurchase:
|
|
461
|
+
pendingPurchase: AppPurchaseRequest | null;
|
|
422
462
|
purchaseError: string | null;
|
|
423
463
|
purchaseSaving: boolean;
|
|
424
464
|
};
|
|
425
465
|
/**
|
|
426
466
|
* Resolves the current user's Cohub API access token. The core uses this to
|
|
427
|
-
* mint
|
|
467
|
+
* mint app session / authorization tokens via the Cohub API.
|
|
428
468
|
*/
|
|
429
|
-
type
|
|
469
|
+
type AppBridgeGetAccessToken = (options?: {
|
|
430
470
|
forceRefresh?: boolean;
|
|
431
471
|
}) => Promise<string | null>;
|
|
432
472
|
/**
|
|
433
473
|
* Resolves the current viewer's user UUID (or null when unauthenticated).
|
|
434
474
|
* Used for ownership checks and silent re-authorization cache lookups.
|
|
435
475
|
*/
|
|
436
|
-
type
|
|
437
|
-
type
|
|
476
|
+
type AppBridgeGetViewerUuid = () => Promise<string | null>;
|
|
477
|
+
type AppPromotionAttributionContext = {
|
|
438
478
|
promotionId: string;
|
|
439
479
|
sourceUrl?: string;
|
|
440
480
|
fbp?: string;
|
|
441
481
|
fbc?: string;
|
|
442
482
|
};
|
|
443
|
-
type
|
|
483
|
+
type AppBridgeAuthorizationContext = {
|
|
444
484
|
/** The host surface handling this authorization request. */
|
|
445
|
-
surface: "page" | "
|
|
485
|
+
surface: "page" | "app" | "background" | "broker";
|
|
446
486
|
};
|
|
447
487
|
/**
|
|
448
488
|
* Requests the host to start a sign-in flow, redirecting back to the given
|
|
449
489
|
* path afterward. The core calls this when an API request fails due to missing
|
|
450
490
|
* authentication.
|
|
451
491
|
*/
|
|
452
|
-
type
|
|
492
|
+
type AppBridgeRequestSignIn = (redirectPath: string) => Promise<void>;
|
|
453
493
|
/**
|
|
454
494
|
* Configuration injected by the caller. The core is transport-agnostic: how a
|
|
455
|
-
* reply is delivered back to the
|
|
495
|
+
* reply is delivered back to the app (iframe postMessage vs opener
|
|
456
496
|
* postMessage) and how the current checkout state is read (page URL) are the
|
|
457
497
|
* caller's responsibility, so the same core serves both bridge and broker
|
|
458
498
|
* hosts. Auth dependencies (token resolution, viewer identity, sign-in) are
|
|
459
499
|
* also injected so the core stays free of any framework's store/auth plumbing.
|
|
460
500
|
*/
|
|
461
|
-
type
|
|
462
|
-
|
|
501
|
+
type AppBridgeCoreConfig = {
|
|
502
|
+
app: AppBridgeCoreApp;
|
|
463
503
|
/** Trusted host context used to decide whether the publisher may authorize silently. */
|
|
464
|
-
authorizationContext?:
|
|
465
|
-
/** Optional snapshot describing what opened this
|
|
466
|
-
invocation?:
|
|
504
|
+
authorizationContext?: AppBridgeAuthorizationContext;
|
|
505
|
+
/** Optional snapshot describing what opened this app runtime. */
|
|
506
|
+
invocation?: AppRuntimeInvocationContext;
|
|
507
|
+
/** Reads the latest opening context without recreating the app surface. */
|
|
508
|
+
getInvocation?: () => AppRuntimeInvocationContext | undefined;
|
|
509
|
+
/** Sends an unsolicited event to the app runtime. */
|
|
510
|
+
notify?: (payload: Record<string, unknown>) => void;
|
|
467
511
|
/** @deprecated Use authorizationContext with a background surface. */
|
|
468
512
|
isBackground?: boolean;
|
|
469
513
|
/** Base origin for Cohub API requests (e.g. "https://cohub.live"). */
|
|
470
514
|
apiOrigin: string;
|
|
471
|
-
/** Sends a reply payload back to the
|
|
515
|
+
/** Sends a reply payload back to the app runtime. */
|
|
472
516
|
reply: (requestId: string, payload: Record<string, unknown>) => void;
|
|
473
517
|
/** Reads the current checkout state (typically derived from the page URL). */
|
|
474
|
-
getCheckoutState: () =>
|
|
518
|
+
getCheckoutState: () => AppRuntimeCheckoutState;
|
|
475
519
|
/** Resolves the current user's Cohub access token. */
|
|
476
|
-
getAccessToken:
|
|
520
|
+
getAccessToken: AppBridgeGetAccessToken;
|
|
477
521
|
/** Resolves the current viewer's user UUID. */
|
|
478
|
-
getViewerUuid:
|
|
522
|
+
getViewerUuid: AppBridgeGetViewerUuid;
|
|
479
523
|
/** Starts a sign-in flow with a post-login redirect path. */
|
|
480
|
-
requestSignIn:
|
|
524
|
+
requestSignIn: AppBridgeRequestSignIn;
|
|
481
525
|
/** Returns optional host-owned promotion attribution for checkout. */
|
|
482
|
-
getPromotionAttribution?: () =>
|
|
526
|
+
getPromotionAttribution?: () => AppPromotionAttributionContext | null;
|
|
483
527
|
/** Called when the host displays the purchase confirmation. */
|
|
484
|
-
onPurchaseRequested?: (input:
|
|
528
|
+
onPurchaseRequested?: (input: AppPurchaseRequest) => void;
|
|
485
529
|
/** Called immediately before navigating to a usable checkout. */
|
|
486
|
-
onCheckoutStarted?: (input:
|
|
530
|
+
onCheckoutStarted?: (input: AppCheckoutStarted) => void;
|
|
487
531
|
/** Called whenever the dialog state changes, for reactive UI binding. */
|
|
488
|
-
onStateChange?: (state:
|
|
532
|
+
onStateChange?: (state: AppBridgeDialogState) => void;
|
|
489
533
|
};
|
|
490
|
-
type
|
|
534
|
+
type AppBridgeCore = {
|
|
491
535
|
/** Returns a snapshot of the current dialog state. */
|
|
492
|
-
getState: () =>
|
|
536
|
+
getState: () => AppBridgeDialogState;
|
|
493
537
|
/** Processes an inbound bridge message (already source/origin-validated). */
|
|
494
538
|
handleMessage: (event: MessageEvent) => Promise<void>;
|
|
539
|
+
/** Sends the current complete runtime context to the app. */
|
|
540
|
+
notifyContextChanged: (invocation?: AppRuntimeInvocationContext) => Promise<void>;
|
|
495
541
|
/** Confirm/cancel handlers for the authorize dialog. */
|
|
496
542
|
confirmAuth: () => Promise<void>;
|
|
497
543
|
cancelAuth: () => void;
|
|
@@ -500,32 +546,32 @@ type WorkBridgeCore = {
|
|
|
500
546
|
cancelPurchase: () => void;
|
|
501
547
|
};
|
|
502
548
|
/**
|
|
503
|
-
* Framework-agnostic
|
|
549
|
+
* Framework-agnostic app bridge host core — message handling, app session
|
|
504
550
|
* token minting, authorization (with silent re-grant cache), and
|
|
505
551
|
* purchase/checkout flow — without any rendering or reactive primitives.
|
|
506
552
|
*
|
|
507
|
-
* Both the Cohub iframe host (
|
|
553
|
+
* Both the Cohub iframe host (AppSurface, Svelte) and the standalone broker
|
|
508
554
|
* page compose this with their own transport-specific reply and auth
|
|
509
555
|
* dependencies. External hosts (e.g. Neta-Studio in React) can do the same.
|
|
510
556
|
*/
|
|
511
|
-
declare function
|
|
557
|
+
declare function createAppBridgeCore(config: AppBridgeCoreConfig): AppBridgeCore;
|
|
512
558
|
//#endregion
|
|
513
|
-
//#region src/
|
|
559
|
+
//#region src/app-grant-cache.d.ts
|
|
514
560
|
/**
|
|
515
561
|
* Returns true when the viewer has previously granted every requested scope
|
|
516
562
|
* for this work, allowing a silent re-authorization.
|
|
517
563
|
*/
|
|
518
|
-
declare function
|
|
564
|
+
declare function hasGrantedAppScopes(userUuid: string | null | undefined, appId: string, scopes: readonly Permission[]): boolean;
|
|
519
565
|
/**
|
|
520
566
|
* Records the granted scopes for a work, merged with any previously granted
|
|
521
567
|
* scopes so a growing permission set stays covered.
|
|
522
568
|
*/
|
|
523
|
-
declare function
|
|
569
|
+
declare function setGrantedAppScopes(userUuid: string | null | undefined, appId: string, scopes: readonly Permission[]): void;
|
|
524
570
|
/**
|
|
525
|
-
* Clears cached grants. Pass a
|
|
571
|
+
* Clears cached grants. Pass a appId to clear a single work, or omit it to
|
|
526
572
|
* clear every cached grant for the user (used on sign-out).
|
|
527
573
|
*/
|
|
528
|
-
declare function
|
|
574
|
+
declare function clearGrantedAppScopes(userUuid: string | null | undefined, appId?: string): void;
|
|
529
575
|
//#endregion
|
|
530
576
|
//#region src/http-error.d.ts
|
|
531
577
|
/** Shared HTTP error code for every plan entitlement gate (402). */
|
|
@@ -735,4 +781,4 @@ declare const BOARD_CHANNELS: {
|
|
|
735
781
|
};
|
|
736
782
|
};
|
|
737
783
|
//#endregion
|
|
738
|
-
export { AcceptInvitationResponse, ApiError, type AssistantMessageCommit, BILLING_ACCESS_BLOCKED_ERROR_CODE, BOARD_ANIMATION_CHANNEL_CAPABILITIES, BOARD_CHANNELS, BOARD_COLOR_IDS, BOARD_GEO_KINDS, BatchUserProfilesResponse, BillingApi, BillingBalanceActivity, BillingBalanceActivityKind, BillingBalanceActivityList, BillingBalanceActivityStatus, BillingCatalog, BillingCatalogProduct, BillingCheckoutActionState, BillingCheckoutResult, BillingConversionIntent, BillingCreditExpiryGroup, BillingCreditGrantStatus, BillingCreditStatus, BillingCreditUnit, BillingDiscountOffer, BillingDiscountOfferRef, BillingDiscountPricing, BillingHistoryPagination, BillingPaymentStatus, BillingPluginStatus, BillingProductBillingInterval, BillingProductCreditBenefit, BillingProductDisplay, BillingProductKind, BillingProductPricing, BillingPromotionCodePreview, BillingRedemptionResult, BillingResponsePayload, BillingSubscriptionHistoryList, BillingSubscriptionHistoryStatus, BillingSubscriptionSummary, type BoardAnimationTarget, type BoardAssetRef, type BoardAuthoringItem, BoardAuthoringItemSchema, type BoardAuthoringReadInput, type BoardAuthoringSnapshot, type BoardAwarenessGesture, type BoardAwarenessNodePreview, type BoardAwarenessStateUpdate, type BoardAwarenessUpdate, type BoardAwarenessUpdatedEvent, type BoardCameraFocus, type BoardCameraFocusParams, type BoardCameraState, type BoardCapabilities, type BoardCapability, type BoardChangedEvent, BoardClient, type BoardColorId, type BoardComposition, BoardCompositionInputSchema, type BoardCompositionPlayback, BoardCompositionSchema, type BoardCoordinateSpace, type BoardCreateInput, type BoardDiagnostic, type BoardEasing, type BoardEffect, type BoardEffectInput, BoardEffectInputSchema, BoardEffectSchema, type BoardEventName, BoardExtensionDefinition, BoardExtensionRegistry, type BoardGeoKind, type BoardItemPatch, BoardItemPatchSchema, type BoardManifest, type BoardMutationReceipt, type BoardPlaybackChangedEvent, type BoardPlaybackCommand, type BoardPlaybackPolicy, BoardPlaybackPolicySchema, type BoardPlaybackSnapshot, BoardPresetDefinition, type BoardProceduralClip, type BoardRecord, type BoardRenderCost, type BoardSemanticCommand, type BoardSemanticMutation, type BoardSubscriptionHandlers, type BoardSummary, type BoardTimeline, type BoardTimelineMarker, type BoardTrack, type BoardTrackInterpolation, type BoardValidationResult, type BuildSpaceInvitePathInput, type BuildSpacePathInput, COHUB_ENVIRONMENTS, COHUB_SOURCE_HEADER, COHUB_SOURCE_HEADER_NAMES, Channel, type ChannelConfig, type ChannelEnvelope, type ChannelHealth, type ChannelHealthReasonCode, type ChannelRuntimeState, CheckpointDiffDelivery, CheckpointDiffFile, CheckpointDiffFileResponse, CheckpointDiffPatchKind, CheckpointDiffPatchLine, CheckpointDiffStats, CheckpointDiffStatus, CheckpointDiffSummary, CheckpointRecord, ClaimReferralResponse, CohubClient, type CohubClientOptions, type CohubEnvironment, CohubHttpClient, type CompletionAssistantMessage, type CompletionMessage, type CompletionMessageRole, type CompletionThinkingLevel, type CompletionUsage, CompositionInput, type ContentBlock, type CreateGenerationTaskRequest, type CreateGenerationTaskResponse, CreateInvitationInput, CreateInvitationResponse, type CreatePublicAssetUploadInput, type CreatePublicAssetUploadResponse, type CreateSpaceCompletionInput, CreateSpaceInput, CreateSpaceModInput, CreateSpacePromptInput, CreateSpacePromptResponse, CreateSpaceSessionInput, type CreateUiCommandInput, CronJobPayload, CronJobRecord, CronJobUpdatePatch, CursorPageInfo, DEFAULT_BOARD_LIMITS, type DiscordChannelConfig, FEATURE_NOT_ENTITLED_ERROR_CODE, type FeishuChannelConfig, type Fetch, type GenerationContentBlock, type GenerationModelPolicy, type GenerationModelVisibility, type GenerationParameterConstraint, type GenerationPolicy, GenerationPolicyError, type GenerationResult, type GenerationStreamCommitEvent, type GenerationStreamErrorEvent, type GenerationStreamEvent, type GenerationStreamFinalizedEvent, type GenerationStreamIntermediateMessage, type GenerationStreamLifecycleEvent, type GenerationStreamOutOfSyncEvent, type GenerationStreamStateEvent, type GenerationStreamSubscribeOptions, type GenerationStreamSubscriptionHandlers, type GenerationStreamTurnUpdatedEvent, type GenerationTaskResult, type GenerationUsageBilling, GenerationUsageBlock, GenerationUsageHourlyStat, GenerationUsageSummary, GlobalSearchResponse, GlobalSearchResult, GlobalSearchType, HttpError, type HttpTraceContext, InvitationDetail, JsonObject, JsonPrimitive, JsonValue, LabelAssignmentListItem, LabelAssignmentPageInfo, LabelAssignmentRecord, type LabelAssignmentsUpdatedEvent, LabelItemsResponse, LabelItemsSessionFork, LabelListItem, LabelRecord, LabelResourceType, LabelScopeType, LabelSource, type ListGenerationModelsResponse, MeResponse, type MessageRecord, ModelCatalogEntry, type ModelStatusEntry, type ModelStatusResponse, type ModelThinkingLevel, ParentBridgeTransport, type ParsedWorkRef, PatchResourceLabelsInput, PatchResourceLabelsResponse, Permission, PopupBrokerTransport, ProceduralClipInput, PromptAccessMode, PromptTemplateCatalogEntry, PromptTemplateCatalogResponse, type PublicAssetMimeType, type PublicAssetPurpose, type PublicAssetUploadProgress, type PublicAssetUploadProtocol, type PublicFileCreateUploadInput, type PublicFileCreateUploadResponse, type PublicFileListEntry, type PublicFileListResponse, type PublicFileUploadEntryInput, type PublicFileUploadPlanEntry, type PublicFileUrlResponse, type PublicGenerationDeclaration, PublicReferral, PublicUserPageResponse, PublicUserProfile, PublicUserSpaceItem, PublicUserWorkItem, QualityProfile, REQUEST_SOURCE_VIA_MAX_LENGTH, type RawHttpResponse, type RealtimeRoomDescriptor, type RealtimeRoomEvent, type RealtimeRoomMember, type RealtimeServerEvent, type RealtimeWorkRecord, type RealtimeWorkVersionRecord, ReferenceAggregateGroup, ReferenceAggregateGroupBy, ReferenceAggregateResponse, ReferenceDirection, ReferenceKind, ReferenceQueryResponse, ReferenceQueryableType, ReferenceRecord, type ReferenceResourceSelector, ReferenceResourceType, ReferencesApi, ReferralDashboard, ReferralListItem, ReferralReward, ReferralStatus, ReferralsApi, RenderBounds, type RequestSource, type RequestSourceVia, ResourceLabelsResponse, SampledTrack, SandboxSpecId, SendMessageCronJobPayload, 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, SkillCatalogEntry, SkillCatalogResponse, SkillCatalogSource, SpaceAccess, SpaceAccessPolicy, SpaceBootstrapMeta, SpaceBootstrapSource, SpaceBootstrapStage, SpaceBootstrapStatus, SpaceChannelBindingInput, type SpaceChannelBindingRecord, SpaceCheckpointDetailResponse, SpaceCommerceBenefit, SpaceCommerceBuyerProfile, SpaceCommerceCreditsBenefit, SpaceCommerceFeatureBenefit, SpaceCommerceOrder, SpaceCommerceProduct, SpaceCommerceProductBenefitBinding, SpaceCommerceProductCreditBenefit, type SpaceCompletionResult, type SpaceCompletionStreamEvent, SpaceConfig, SpaceConfigInput, SpaceConfigResponse, SpaceConfigUpdateResponse, SpaceCreateResponse, SpaceDefaultResponse, SpaceEnvInput, type SpaceEventName, SpaceFsCompleteUploadInput, SpaceFsCompleteUploadResponse, SpaceFsCreateDirectoryInput, SpaceFsCreateUploadInput, SpaceFsCreateUploadResponse, SpaceFsDeleteNodeInput, SpaceFsEncoding, SpaceFsEntry, SpaceFsFileKind, SpaceFsFileResponse, SpaceFsMoveInput, SpaceFsPreparingFile, SpaceFsReadFilesError, SpaceFsReadFilesInput, SpaceFsReadFilesResponse, SpaceFsTreeResponse, SpaceFsUploadDestination, SpaceFsUploadEntry, SpaceFsUploadError, SpaceFsUploadPlanEntry, SpaceFsUploadPlanEntryInput, SpaceFsUploadProgress, SpaceFsUploadResponse, SpaceFsWriteFileInput, SpaceInvitation, SpaceInvitationListResponse, SpaceInvitationLocation, SpaceListItem, SpaceMember, SpaceMeta, SpaceModListItem, SpacePendingDiffFileResponse, SpacePendingDiffSummary, SpacePresenceSnapshot, SpacePresenceUser, SpacePublicFilesApi, SpacePublicProfile, SpaceRecord, SpaceRole, SpaceSandboxAutoDestroyPolicy, SpaceSandboxConfig, SpaceSandboxProvider, SpaceSessionsResponse, type SpaceStartupResponse, SpaceTurnAuthorFilter, SpaceTurnListItem, type SpaceTurnListOptions, SpaceTurnsResponse, SpaceUsageHourlyStat, SpaceUsageResponse, SpaceUsageSummary, TaskRunDetailResponse, TaskRunRecord, TrackInput, UI_COMMAND_DEFAULT_TIMEOUT_MS, UI_COMMAND_MAX_TIMEOUT_MS, UI_COMMAND_PAYLOAD_MAX_BYTES, UI_COMMAND_PENDING_TTL_SECONDS, UI_COMMAND_SETTLEMENT_GRACE_SECONDS, UI_COMMAND_TERMINAL_TTL_SECONDS, UI_COMMAND_VERSION, type UiCommand, type UiCommandDispatchedPayload, type UiCommandError, type UiCommandRecord, type UiCommandStatus, UiCommandsApi, type UiFilePreviewTarget, type UiPreviewShowCommand, type UiPreviewTarget, type UiSurfaceRequest, type UiWorkPreviewTarget, type UnauthorizedContext, type UploadChatAttachmentInput, type UploadChatImageAttachmentInput, type UploadPublicAssetInput, UserActivityQuery, UserActivityRange, UserActivityRankings, UserActivityResponse, UserProfile, UserRulesResponse, UserSessionListItem, UserSessionSpaceSummary, UserSessionsResponse, UsersApi, VoiceApi, type VoiceInputCallbacks, VoiceInputClient, type VoiceInputClientOptions, type VoiceInputCreateOptions, type VoiceInputEvent, WORK_COMPOSER_CHIP_CONTENT_MAX_BYTES, WORK_COMPOSER_CHIP_KEY_MAX_LENGTH, WORK_COMPOSER_CHIP_LABEL_MAX_LENGTH, WORK_SURFACE_READY_TIMEOUT_MS, WORK_SURFACE_REQUEST_TIMEOUT_MS, type WaitForUiCommandOptions, type WebSocketConnectionState, WebsocketClient, type WorkArtifactDescriptor, type WorkArtifactDownloadDescriptor, type WorkArtifactManifest, type WorkArtifactManifestFile, type WorkAuthorizeRequest, type WorkAuthorizeResponse, type WorkBoardArtifactManifest, type WorkBoardAsset, type WorkBridgeAuthorizationContext, type WorkBridgeCore, type WorkBridgeCoreConfig, type WorkBridgeCoreWork, type WorkBridgeDialogState, type WorkBridgeGetAccessToken, type WorkBridgeGetViewerUuid, type WorkBridgeRequestSignIn, type WorkCheckoutStarted, WorkCommerceApi, type WorkCommerceCheckoutStatus, type WorkCommerceCreditConsumeResponse, type WorkCommerceCreditConsumeStatus, type WorkCommerceEntitlement, type WorkCommerceEntitlementsResponse, type WorkCommerceOrder, type WorkCommerceProductResolveResponse, type WorkCommercePurchaseResponse, type WorkComposerChip, type WorkContent, type WorkContentDownload, type WorkContentKind, type WorkCreateInput, type WorkDetailResponse, type WorkExtractedPageMeta, type WorkGetResponse, type WorkIdResolver, type WorkMeta, type WorkPresentationMeta, type WorkPromotionAttributionContext, type WorkPromotionCreateInput, type WorkPromotionEventResponse, type WorkPromotionProvider, type WorkPromotionProviderStatus, type WorkPromotionRecord, type WorkPromotionStatsResponse, type WorkPublicOwnerRecord, type WorkPublicRef, type WorkPublicSpaceRecord, type WorkPurchaseRequest, WorkRealtimeApi, type WorkRecord, WorkRefParseError, type WorkResolveResponse, WorkRoom, type WorkRoomAdmissionResponse, type WorkRoomCreateInput, type WorkRoomEvent, type WorkRoomEventMap, type WorkRoomPublishResult, type WorkRoomState, WorkRuntimeApi, type WorkRuntimeCheckoutState, type WorkRuntimeCheckoutStatus, type WorkRuntimeContext, type WorkRuntimeInvocationContext, type WorkRuntimeModeConfig, type WorkRuntimeRequestOptions, type WorkRuntimeTransport, type WorkSessionResponse, type WorkStatus, WorkSurfaceApi, type WorkSurfaceHandler, type WorkSurfaceHandlerContext, type WorkSurfaceReadyMessage, type WorkSurfaceResponseMessage, type WorkTargetType, type WorkUpdateInput, type WorkVersionPublishedEvent, type WorkVersionRecord, type WorkViewSource, type WorkViewStatsResponse, type WorkVisibility, WorksApi, assertGenerationRequestAllowedByPolicy, buildSpaceInvitePath, buildSpacePath, buildWorkSurfaceRequest, clearGrantedWorkScopes, compileComposition, composition, createBoardExtensionRegistry, createCohubClient, createHttpClient, createSessionGenerationStreamClient, createSessionPatchReducer, createSlugWorkIdResolver, createVoiceInputClient, createWebsocketClient, createWorkBridgeCore, createWorkRuntime, decodeGenerationPolicy, encodeGenerationPolicy, extractBillingPayload, filterDiscoverableGenerationModels, filterGenerationDeclarationsByPolicy, findGenerationModelPolicy, formatWorkRef, getAllowedGenerationModelIds, hasGrantedWorkScopes, hasRequestSourceIdentity, isBillingAccessBlockedCode, isBillingAccessBlockedError, isFeatureNotEntitledError, isGenerationModelHidden, isHttpErrorCode, isRequestSourceClientId, isRequestSourceEmpty, isRequestSourceUuid, isTerminalUiCommandStatus, isUiSurfaceMethod, isUuid, isWorkId, joinApiUrl, matchesUnauthorizedErrorToken, mergeRequestSourceIntoMeta, normalizeBaseUrl, normalizeGenerationPolicy, normalizeRequestSource, normalizeVoiceInputWebsocketUrl, normalizeWebsocketUrl, parseAssistantMessageCommit, parseBoardCompositionInput, parseBoardEffectInput, parseBoardPlaybackPolicy, parseGenerationPolicyFromEnv, parseRequestSourceFromHeaders, parseUiCommand, parseWorkRef, parseWorkSurfaceReady, parseWorkSurfaceResponse, proceduralClip, readRequestSourceFromEnv, requestSourceToHeaders, resolveApiBaseUrl, resolveCohubEnvironment, resolveRequestSourceChannel, resolveVoiceInputWebsocketUrl, resolveWebsocketUrl, resolveWorkTransport, sampleCompositionTracks, sampleEasing, sampleTrack, sanitizeAccessToken, setGrantedWorkScopes, track };
|
|
784
|
+
export { APP_COMPOSER_CHIP_CONTENT_MAX_BYTES, APP_COMPOSER_CHIP_KEY_MAX_LENGTH, APP_COMPOSER_CHIP_LABEL_MAX_LENGTH, APP_SURFACE_READY_TIMEOUT_MS, APP_SURFACE_REQUEST_TIMEOUT_MS, AcceptInvitationResponse, ApiError, type AppArtifactDescriptor, type AppArtifactDescriptor as WorkArtifactDescriptor, type AppArtifactDownloadDescriptor, type AppArtifactDownloadDescriptor as WorkArtifactDownloadDescriptor, type AppArtifactManifest, type AppArtifactManifest as WorkArtifactManifest, type AppArtifactManifestFile, type AppArtifactManifestFile as WorkArtifactManifestFile, type AppAuthorizeRequest, type AppAuthorizeRequest as WorkAuthorizeRequest, type AppAuthorizeResponse, type AppBoardArtifactManifest, type AppBoardArtifactManifest as WorkBoardArtifactManifest, type AppBoardAsset, type AppBoardAsset as WorkBoardAsset, type AppBridgeAuthorizationContext, type AppBridgeAuthorizationContext as WorkBridgeAuthorizationContext, type AppBridgeCore, type AppBridgeCore as WorkBridgeCore, type AppBridgeCoreApp, type AppBridgeCoreApp as WorkBridgeCoreWork, type AppBridgeCoreConfig, type AppBridgeCoreConfig as WorkBridgeCoreConfig, type AppBridgeDialogState, type AppBridgeDialogState as WorkBridgeDialogState, type AppBridgeGetAccessToken, type AppBridgeGetAccessToken as WorkBridgeGetAccessToken, type AppBridgeGetViewerUuid, type AppBridgeGetViewerUuid as WorkBridgeGetViewerUuid, type AppBridgeRequestSignIn, type AppBridgeRequestSignIn as WorkBridgeRequestSignIn, type AppCheckoutStarted, type AppCheckoutStarted as WorkCheckoutStarted, AppCommerceApi, type AppCommerceCheckoutStatus, type AppCommerceCreditConsumeResponse, type AppCommerceCreditConsumeStatus, type AppCommerceEntitlement, type AppCommerceEntitlementsResponse, type AppCommerceOrder, type AppCommerceProductResolveResponse, type AppCommercePurchaseResponse, type AppComposerChip, type AppContent, type AppContentDownload, type AppContentKind, type AppContentKind as WorkContentKind, type AppContextChangedListener, type AppCreateInput, type AppDetailResponse, type AppExtractedPageMeta, type AppGetResponse, type AppIdResolver, type AppIdResolver as WorkIdResolver, type AppMeta, type AppPresentationMeta, type AppPromotionAttributionContext, type AppPromotionAttributionContext as WorkPromotionAttributionContext, type AppPromotionCreateInput, type AppPromotionEventResponse, type AppPromotionProvider, type AppPromotionProviderStatus, type AppPromotionRecord, type AppPromotionStatsResponse, type AppPublicOwnerRecord, type AppPublicRef, type AppPublicSpaceRecord, type AppPurchaseRequest, type AppPurchaseRequest as WorkPurchaseRequest, AppRealtimeApi, type AppRecord, AppRefParseError, type AppResolveResponse, AppRoom, type AppRoomAdmissionResponse, type AppRoomCreateInput, type AppRoomEvent, type AppRoomEventMap, type AppRoomPublishResult, type AppRoomState, AppRuntimeApi, AppRuntimeApi as WorkRuntimeApi, type AppRuntimeCheckoutState, type AppRuntimeCheckoutState as WorkRuntimeCheckoutState, type AppRuntimeCheckoutStatus, type AppRuntimeCheckoutStatus as WorkRuntimeCheckoutStatus, type AppRuntimeContext, type AppRuntimeContext as WorkRuntimeContext, type AppRuntimeInvocationContext, type AppRuntimeInvocationContext as WorkRuntimeInvocationContext, type AppRuntimeModeConfig, type AppRuntimeModeConfig as WorkRuntimeModeConfig, type AppRuntimeRequestOptions, type AppRuntimeRequestOptions as WorkRuntimeRequestOptions, type AppRuntimeTransport, type AppRuntimeTransport as WorkRuntimeTransport, type AppSessionResponse, type AppStatus, AppSurfaceApi, type AppSurfaceHandler, type AppSurfaceHandler as WorkSurfaceHandler, type AppSurfaceHandlerContext, type AppSurfaceHandlerContext as WorkSurfaceHandlerContext, type AppSurfaceReadyMessage, type AppSurfaceResponseMessage, type AppTargetType, type AppUpdateInput, type AppVersionPublishedEvent, type AppVersionPublishedEvent as WorkVersionPublishedEvent, type AppVersionRecord, type AppViewSource, type AppViewStatsResponse, type AppVisibility, AppsApi, type AssistantMessageCommit, BILLING_ACCESS_BLOCKED_ERROR_CODE, BOARD_ANIMATION_CHANNEL_CAPABILITIES, BOARD_CHANNELS, BOARD_COLOR_IDS, BOARD_GEO_KINDS, BatchUserProfilesResponse, BillingApi, BillingBalanceActivity, BillingBalanceActivityKind, BillingBalanceActivityList, BillingBalanceActivityStatus, BillingCatalog, BillingCatalogProduct, BillingCheckoutActionState, BillingCheckoutResult, BillingConversionIntent, BillingCreditExpiryGroup, BillingCreditGrantStatus, BillingCreditStatus, BillingCreditUnit, BillingDiscountOffer, BillingDiscountOfferRef, BillingDiscountPricing, BillingHistoryPagination, BillingPaymentStatus, BillingPluginStatus, BillingProductBillingInterval, BillingProductCreditBenefit, BillingProductDisplay, BillingProductKind, BillingProductPricing, BillingPromotionCodePreview, BillingRedemptionResult, BillingResponsePayload, BillingSubscriptionHistoryList, BillingSubscriptionHistoryStatus, BillingSubscriptionSummary, type BoardAnimationTarget, type BoardAssetRef, type BoardAuthoringItem, BoardAuthoringItemSchema, type BoardAuthoringReadInput, type BoardAuthoringSnapshot, type BoardAwarenessGesture, type BoardAwarenessNodePreview, type BoardAwarenessStateUpdate, type BoardAwarenessUpdate, type BoardAwarenessUpdatedEvent, type BoardCameraFocus, type BoardCameraFocusParams, type BoardCameraState, type BoardCapabilities, type BoardCapability, type BoardChangedEvent, BoardClient, type BoardColorId, type BoardComposition, BoardCompositionInputSchema, type BoardCompositionPlayback, BoardCompositionSchema, type BoardCoordinateSpace, type BoardCreateInput, type BoardDiagnostic, type BoardEasing, type BoardEffect, type BoardEffectInput, BoardEffectInputSchema, BoardEffectSchema, type BoardEventName, BoardExtensionDefinition, BoardExtensionRegistry, type BoardGeoKind, type BoardItemPatch, BoardItemPatchSchema, type BoardManifest, type BoardMutationReceipt, type BoardPlaybackChangedEvent, type BoardPlaybackCommand, type BoardPlaybackPolicy, BoardPlaybackPolicySchema, type BoardPlaybackSnapshot, BoardPresetDefinition, type BoardProceduralClip, type BoardRecord, type BoardRenderCost, type BoardSemanticCommand, type BoardSemanticMutation, type BoardSubscriptionHandlers, type BoardSummary, type BoardTimeline, type BoardTimelineMarker, type BoardTrack, type BoardTrackInterpolation, type BoardValidationResult, type BuildSpaceInvitePathInput, type BuildSpacePathInput, COHUB_ENVIRONMENTS, COHUB_SOURCE_HEADER, COHUB_SOURCE_HEADER_NAMES, Channel, type ChannelConfig, type ChannelEnvelope, type ChannelHealth, type ChannelHealthReasonCode, type ChannelRuntimeState, CheckpointDiffDelivery, CheckpointDiffFile, CheckpointDiffFileResponse, CheckpointDiffPatchKind, CheckpointDiffPatchLine, CheckpointDiffStats, CheckpointDiffStatus, CheckpointDiffSummary, CheckpointRecord, ClaimReferralResponse, CohubClient, type CohubClientOptions, type CohubEnvironment, CohubHttpClient, type CompletionAssistantMessage, type CompletionMessage, type CompletionMessageRole, type CompletionThinkingLevel, type CompletionUsage, CompositionInput, type ContentBlock, type CreateDesktopCommandInput, type CreateGenerationTaskRequest, type CreateGenerationTaskResponse, CreateInvitationInput, CreateInvitationResponse, type CreatePublicAssetUploadInput, type CreatePublicAssetUploadResponse, type CreateSpaceCompletionInput, CreateSpaceInput, CreateSpaceModInput, CreateSpacePromptInput, CreateSpacePromptResponse, CreateSpaceSessionInput, type CreateUiCommandInput, CronJobPayload, CronJobRecord, CronJobUpdatePatch, CursorPageInfo, DEFAULT_BOARD_LIMITS, DESKTOP_COMMAND_DEFAULT_TIMEOUT_MS, DESKTOP_COMMAND_MAX_TIMEOUT_MS, DESKTOP_COMMAND_PAYLOAD_MAX_BYTES, DESKTOP_COMMAND_PENDING_TTL_SECONDS, DESKTOP_COMMAND_SETTLEMENT_GRACE_SECONDS, DESKTOP_COMMAND_TERMINAL_TTL_SECONDS, DESKTOP_COMMAND_VERSION, type DesktopAppTarget, type DesktopCall, type DesktopCommand, type DesktopCommandDispatchedPayload, type DesktopCommandError, type DesktopCommandRecord, type DesktopCommandStatus, DesktopCommandsApi, type DesktopFileTarget, type DesktopOpenCommand, type DesktopTarget, type DiscordChannelConfig, FEATURE_NOT_ENTITLED_ERROR_CODE, type FeishuChannelConfig, type Fetch, type GenerationContentBlock, type GenerationModelPolicy, type GenerationModelVisibility, type GenerationParameterConstraint, type GenerationPolicy, GenerationPolicyError, type GenerationResult, type GenerationStreamCommitEvent, type GenerationStreamErrorEvent, type GenerationStreamEvent, type GenerationStreamFinalizedEvent, type GenerationStreamIntermediateMessage, type GenerationStreamLifecycleEvent, type GenerationStreamOutOfSyncEvent, type GenerationStreamStateEvent, type GenerationStreamSubscribeOptions, type GenerationStreamSubscriptionHandlers, type GenerationStreamTurnUpdatedEvent, type GenerationTaskResult, type GenerationUsageBilling, GenerationUsageBlock, GenerationUsageHourlyStat, GenerationUsageSummary, GlobalSearchResponse, GlobalSearchResult, GlobalSearchType, HttpError, type HttpTraceContext, InvitationDetail, JsonObject, JsonPrimitive, JsonValue, LabelAssignmentListItem, LabelAssignmentPageInfo, LabelAssignmentRecord, type LabelAssignmentsUpdatedEvent, LabelItemsResponse, LabelItemsSessionFork, LabelListItem, LabelRecord, LabelResourceType, LabelScopeType, LabelSource, type ListGenerationModelsResponse, MeResponse, type MessageRecord, ModelCatalogEntry, type ModelStatusEntry, type ModelStatusResponse, type ModelThinkingLevel, ParentBridgeTransport, type ParsedAppRef, type ParsedWorkRef, PatchResourceLabelsInput, PatchResourceLabelsResponse, Permission, PopupBrokerTransport, ProceduralClipInput, PromptAccessMode, PromptTemplateCatalogEntry, PromptTemplateCatalogResponse, type PublicAssetMimeType, type PublicAssetPurpose, type PublicAssetUploadProgress, type PublicAssetUploadProtocol, type PublicFileCreateUploadInput, type PublicFileCreateUploadResponse, type PublicFileListEntry, type PublicFileListResponse, type PublicFileUploadEntryInput, type PublicFileUploadPlanEntry, type PublicFileUrlResponse, type PublicGenerationDeclaration, PublicReferral, PublicUserAppItem, PublicUserPageResponse, PublicUserProfile, PublicUserSpaceItem, PublicUserWorkItem, QualityProfile, REQUEST_SOURCE_VIA_MAX_LENGTH, type RawHttpResponse, type RealtimeAppRecord, type RealtimeAppRecord as RealtimeWorkRecord, type RealtimeAppVersionRecord, type RealtimeAppVersionRecord as RealtimeWorkVersionRecord, type RealtimeRoomDescriptor, type RealtimeRoomEvent, type RealtimeRoomMember, type RealtimeServerEvent, ReferenceAggregateGroup, ReferenceAggregateGroupBy, ReferenceAggregateResponse, ReferenceDirection, ReferenceKind, ReferenceQueryResponse, ReferenceQueryableType, ReferenceRecord, type ReferenceResourceSelector, ReferenceResourceType, ReferencesApi, ReferralDashboard, ReferralListItem, ReferralReward, ReferralStatus, ReferralsApi, RenderBounds, type RequestSource, type RequestSourceVia, ResourceLabelsResponse, SampledTrack, SandboxSpecId, SendMessageCronJobPayload, 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, SkillCatalogEntry, SkillCatalogResponse, SkillCatalogSource, SpaceAccess, SpaceAccessPolicy, SpaceBootstrapMeta, SpaceBootstrapSource, SpaceBootstrapStage, SpaceBootstrapStatus, SpaceChannelBindingInput, type SpaceChannelBindingRecord, SpaceCheckpointDetailResponse, SpaceCommerceBenefit, SpaceCommerceBuyerProfile, SpaceCommerceCreditsBenefit, SpaceCommerceFeatureBenefit, SpaceCommerceOrder, SpaceCommerceProduct, SpaceCommerceProductBenefitBinding, SpaceCommerceProductCreditBenefit, type SpaceCompletionResult, type SpaceCompletionStreamEvent, SpaceConfig, SpaceConfigInput, SpaceConfigResponse, SpaceConfigUpdateResponse, SpaceCreateResponse, SpaceDefaultResponse, SpaceEnvInput, type SpaceEventName, SpaceFsCompleteUploadInput, SpaceFsCompleteUploadResponse, SpaceFsCreateDirectoryInput, SpaceFsCreateUploadInput, SpaceFsCreateUploadResponse, SpaceFsDeleteNodeInput, SpaceFsEncoding, SpaceFsEntry, SpaceFsFileKind, SpaceFsFileResponse, SpaceFsMoveInput, SpaceFsPreparingFile, SpaceFsReadFilesError, SpaceFsReadFilesInput, SpaceFsReadFilesResponse, SpaceFsTreeResponse, SpaceFsUploadDestination, SpaceFsUploadEntry, SpaceFsUploadError, SpaceFsUploadPlanEntry, SpaceFsUploadPlanEntryInput, SpaceFsUploadProgress, SpaceFsUploadResponse, SpaceFsWriteFileInput, SpaceInvitation, SpaceInvitationListResponse, SpaceInvitationLocation, SpaceListItem, SpaceMember, SpaceMeta, SpaceModListItem, SpacePendingDiffFileResponse, SpacePendingDiffSummary, SpacePresenceSnapshot, SpacePresenceUser, SpacePublicFilesApi, SpacePublicProfile, SpaceRecord, SpaceRole, SpaceSandboxAutoDestroyPolicy, SpaceSandboxConfig, SpaceSandboxProvider, SpaceSessionsResponse, type SpaceStartupResponse, SpaceTurnAuthorFilter, SpaceTurnListItem, type SpaceTurnListOptions, SpaceTurnsResponse, SpaceUsageHourlyStat, SpaceUsageResponse, SpaceUsageSummary, TaskRunDetailResponse, TaskRunRecord, TrackInput, type UiCommand, type UiCommandError, type UiCommandRecord, type UiCommandStatus, UiCommandsApi, type UnauthorizedContext, type UploadChatAttachmentInput, type UploadChatImageAttachmentInput, type UploadPublicAssetInput, UserActivityQuery, UserActivityRange, UserActivityRankings, UserActivityResponse, UserProfile, UserRulesResponse, UserSessionListItem, UserSessionSpaceSummary, UserSessionsResponse, UsersApi, VoiceApi, type VoiceInputCallbacks, VoiceInputClient, type VoiceInputClientOptions, type VoiceInputCreateOptions, type VoiceInputEvent, type WaitForDesktopCommandOptions, type WaitForUiCommandOptions, type WebSocketConnectionState, WebsocketClient, type WorkAuthorizeResponse, WorkCommerceApi, type WorkCommerceCheckoutStatus, type WorkCommerceCreditConsumeResponse, type WorkCommerceCreditConsumeStatus, type WorkCommerceEntitlement, type WorkCommerceEntitlementsResponse, type WorkCommerceOrder, type WorkCommerceProductResolveResponse, type WorkCommercePurchaseResponse, type WorkContent, type WorkContentDownload, type WorkCreateInput, type WorkDetailResponse, type WorkExtractedPageMeta, type WorkGetResponse, type WorkMeta, type WorkPresentationMeta, type WorkPromotionCreateInput, type WorkPromotionEventResponse, type WorkPromotionProvider, type WorkPromotionProviderStatus, type WorkPromotionRecord, type WorkPromotionStatsResponse, type WorkPublicOwnerRecord, type WorkPublicRef, type WorkPublicSpaceRecord, WorkRealtimeApi, type WorkRecord, WorkRefParseError, type WorkResolveResponse, WorkRoom, type WorkRoomAdmissionResponse, type WorkRoomCreateInput, type WorkRoomEvent, type WorkRoomEventMap, type WorkRoomPublishResult, type WorkRoomState, type WorkSessionResponse, type WorkStatus, WorkSurfaceApi, type WorkTargetType, type WorkUpdateInput, type WorkVersionRecord, type WorkViewSource, type WorkViewStatsResponse, type WorkVisibility, assertGenerationRequestAllowedByPolicy, buildAppSurfaceRequest, buildSpaceInvitePath, buildSpacePath, clearGrantedAppScopes, compileComposition, composition, createAppBridgeCore, createAppBridgeCore as createWorkBridgeCore, createAppRuntime, createAppRuntime as createWorkRuntime, createBoardExtensionRegistry, createCohubClient, createHttpClient, createSessionGenerationStreamClient, createSessionPatchReducer, createSlugAppIdResolver, createSlugAppIdResolver as createSlugWorkIdResolver, createVoiceInputClient, createWebsocketClient, decodeGenerationPolicy, encodeGenerationPolicy, extractBillingPayload, filterDiscoverableGenerationModels, filterGenerationDeclarationsByPolicy, findGenerationModelPolicy, formatAppRef, formatWorkRef, getAllowedGenerationModelIds, hasGrantedAppScopes, hasRequestSourceIdentity, isAppId, isBillingAccessBlockedCode, isBillingAccessBlockedError, isDesktopCallMethod, isFeatureNotEntitledError, isGenerationModelHidden, isHttpErrorCode, isRequestSourceClientId, isRequestSourceEmpty, isRequestSourceUuid, isTerminalDesktopCommandStatus, isUuid, isWorkId, joinApiUrl, matchesUnauthorizedErrorToken, mergeRequestSourceIntoMeta, normalizeBaseUrl, normalizeGenerationPolicy, normalizeRequestSource, normalizeVoiceInputWebsocketUrl, normalizeWebsocketUrl, parseAppRef, parseAppSurfaceReady, parseAppSurfaceResponse, parseAssistantMessageCommit, parseBoardCompositionInput, parseBoardEffectInput, parseBoardPlaybackPolicy, parseDesktopCommand, parseGenerationPolicyFromEnv, parseRequestSourceFromHeaders, parseWorkRef, proceduralClip, readRequestSourceFromEnv, requestSourceToHeaders, resolveApiBaseUrl, resolveAppTransport, resolveAppTransport as resolveWorkTransport, resolveCohubEnvironment, resolveRequestSourceChannel, resolveVoiceInputWebsocketUrl, resolveWebsocketUrl, sampleCompositionTracks, sampleEasing, sampleTrack, sanitizeAccessToken, setGrantedAppScopes, track };
|