@neta-art/cohub 11.2.0 → 11.3.1
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/board/export/index.js +14 -3
- package/dist/board/export/node/fonts.d.ts +13 -0
- package/dist/board/export/node/fonts.js +44 -0
- package/dist/board/export/node/index.d.ts +4 -10
- package/dist/board/export/node/index.js +12 -20
- package/dist/board/export/node/scripts.d.ts +1 -0
- package/dist/board/export/node/scripts.js +21 -8
- package/dist/board/export/scene.js +1 -1
- package/dist/board/model/index.d.ts +2 -1
- package/dist/board/model/index.js +2 -1
- package/dist/board/model/script-api.d.ts +69 -0
- package/dist/board/model/script-api.js +77 -0
- package/dist/board/render/diagnostics.d.ts +20 -2
- package/dist/board/render/diagnostics.js +17 -4
- package/dist/board/render/index.d.ts +2 -2
- package/dist/board/render/index.js +5 -5
- package/dist/board/render/renderers/arrow-card-renderer.js +1 -1
- package/dist/board/render/renderers/audio-card-renderer.js +1 -1
- package/dist/board/render/renderers/frame-card-renderer.js +1 -1
- package/dist/board/render/renderers/shape-card-renderer.js +1 -1
- package/dist/board/render/renderers/task-card-renderer.js +1 -1
- package/dist/board/render/renderers/text-card-renderer.js +2 -2
- package/dist/board/stage/stage.js +3 -3
- package/dist/chunks/app-realtime.js +1697 -0
- package/dist/chunks/environment.d.ts +1 -0
- package/dist/chunks/http.d.ts +346 -3
- package/dist/chunks/http.js +32 -1
- package/dist/chunks/websocket.d.ts +4 -0
- package/dist/chunks/websocket.js +11 -2
- package/dist/http.d.ts +1 -1
- package/dist/index.d.ts +3 -322
- package/dist/index.js +59 -1660
- package/dist/protocol/dist/board-model.js +51 -51
- package/dist/protocol/dist/board-schema.d.ts +1 -2
- package/dist/protocol/dist/board-schema.js +7 -22
- package/package.json +1 -1
package/dist/chunks/http.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $a as BoardPlaybackChangedEvent$1, $n as SpaceCommerceProduct, $r as SpaceSessionsResponse, $t as PromptTemplateCatalogResponse, An as SessionTurnSignedUrlsResponse, Bc as ContentBlock, Bi as SessionTurnRecord, Br as SpaceMember, Cc as RtcIceServers, Ci as ChannelHealth, Cr as SpaceFsReadFilesResponse, Dn as SessionRecord, En as SessionMessagesResponse, Et as GlobalSearchType, Fc as CreateSpaceCompletionInput, Fn as SkillCatalogResponse, Ft as LabelItemsResponse, Gr as SpacePresenceSnapshot, Gt as PaletteOverviewResponse, Hi as StoredIntermediateMessage, Hr as SpaceModListItem, Ht as MeResponse, Ii as SessionStats, Io as DesktopCommandError, Jn as SpaceCommerceBenefit, Jo as NavigationCall, Jr as SpaceRecord, Jt as PatchResourceLabelsInput, Ka as GenerationContentBlock, Ks as AppAuthorizationRequest$1, Lc as SpaceCompletionResult, Lo as DesktopCommandRecord, Ls as BoardPatch, Lt as LabelListItem, Mi as SessionForkRecord, Mn as SessionTurnWindowResponse, Mr as SpaceFsWriteFileInput, Nn as SessionTurnsPaginatedResponse, Oi as MessageRecord, On as SessionTurnIndexResponse, Ot as InvitationDetail, Po as DesktopCommand, Pr as SpaceInvitationListResponse, Pt as LabelAssignmentRecord, Q as Channel, Qa as BoardChangedEvent$1, Qn as SpaceCommerceOrder, Qo as SpaceFsCopyInput, Qs as RuntimeArchivePage, Rc as SpaceCompletionStreamEvent, Ri as MessageToolCallsFile, Rn as SpaceAccessPolicy, Ro as DesktopCommandStatus, Rr as SpaceListOptions, Si as ChannelConfig, So as AppVersionSource, Tn as SessionMessagesPaginatedResponse, Ur as SpacePendingDiffFileResponse, Ut as ModelCatalogEntry, Vi as SpaceTurnsResponse, Vn as SpaceActivityResponse, Wi as TurnIntermediateMessagesFile, Wr as SpacePendingDiffSummary, Ws as BillingPayload, Xo as SpacePublicEndpoints, Xs as HarnessArchiveIndex, Xt as Permission, Yn as SpaceCommerceBuyerProfile, Yo as NavigationLaunch, Yr as SpaceRole, Yt as PatchResourceLabelsResponse, Za as BoardAwarenessUpdatedEvent$1, _ as AcceptInvitationResponse, _i as UserSessionSourceKey, _t as CronJobRecord, aa as RuntimeStopConfirmation, ac as DisplayCapture, ar as SpaceConfigUpdateResponse, br as SpaceFsPreparingFile, bs as BoardReadInput, cc as DisplayInfo, cn as ReferenceAggregateResponse, cr as SpaceEnvInput, cs as BoardAwarenessUpdate, ct as ClaimReferralResponse, dc as DisplaySession, dn as ReferenceQueryResponse, ds as BoardApplyInput, dt as CreateSpaceInput, ec as RuntimeArchiveUpload, ei as SpaceTurnAuthorFilter, en as PublicReferral, er as SpaceCommerceProductBenefitBinding, es as SpaceFsCopyResponse, fn as ReferenceQueryableType, fr as SpaceFsCreateUploadInput, fs as BoardApplyResult, gc as DisplayVirtualStart, gs as BoardHistoryPage, hi as UserRulesResponse, hn as ReferralDashboard, ho as AppArtifactDescriptor, hs as BoardHistoryInput, ht as CreateSpaceSessionInput, ia as RuntimeStatus, ii as SpaceUsageResponse, io as RealtimePatchOperation, ir as SpaceConfigResponse, ji as SessionFilesResponse, jn as SessionTurnStreamSnapshotResponse, jr as SpaceFsUploadResponse, js as BoardDelta, kn as SessionTurnResponse, lc as DisplayInputEvent, ln as ReferenceDirection, lo as RealtimeRoomHistoryEvent, lr as SpaceFsCompleteUploadInput, lt as CreateInvitationInput, mc as DisplayTreeParams, mi as UserProfile, mo as SessionTurnPatchEvent, ms as BoardCreateInput, mt as CreateSpacePromptResponse, nn as PublicUserPageResponse, oc as DisplayCaptureParams, oi as TaskRunDetailResponse, oo as RealtimeRoomDescriptor, or as SpaceCreateResponse, ot as CheckpointDiffSummary, pi as UserActivityResponse, pr as SpaceFsCreateUploadResponse, pt as CreateSpacePromptInput, qa as GenerationModelDeclaration, qc as RequestSource, qn as SpaceCheckpointDetailResponse, qr as SpacePublicProfile, qs as AppAuthorizationResult, r as CohubEnvironment, ra as RuntimeSessionRecoveryStatus, rn as PublicUserProfile, rr as SpaceConfigInput, rs as SpaceFsCopyStats, si as TaskRunRecord, sn as ReferenceAggregateGroupBy, sr as SpaceDefaultResponse, st as CheckpointRecord, ts as SpaceFsCopyResult, tt as CheckpointDiffFileResponse, uc as DisplayList, ui as UserActivityQuery, un as ReferenceKind, uo as RealtimeRoomMember, ur as SpaceFsCompleteUploadResponse, ut as CreateInvitationResponse, vr as SpaceFsFileResponse, vt as CronJobUpdatePatch, wn as SessionMessageResponse, wr as SpaceFsTreeResponse, wt as GlobalSearchResponse, xo as AppContentKind, xs as BoardReadResult, y as BatchUserProfilesResponse, yi as UserSessionsResponse, yr as SpaceFsMoveInput, ys as BoardPlaybackSnapshot, yt as CursorPageInfo, zc as Usage, zr as SpaceListPage, zt as LabelResourceType } from "./environment.js";
|
|
1
|
+
import { $a as BoardPlaybackChangedEvent$1, $n as SpaceCommerceProduct, $r as SpaceSessionsResponse, $t as PromptTemplateCatalogResponse, An as SessionTurnSignedUrlsResponse, Bc as ContentBlock, Bi as SessionTurnRecord, Br as SpaceMember, Cc as RtcIceServers, Ci as ChannelHealth, Cr as SpaceFsReadFilesResponse, Dn as SessionRecord, En as SessionMessagesResponse, Et as GlobalSearchType, Fc as CreateSpaceCompletionInput, Fn as SkillCatalogResponse, Ft as LabelItemsResponse, Gr as SpacePresenceSnapshot, Gt as PaletteOverviewResponse, Hi as StoredIntermediateMessage, Hr as SpaceModListItem, Ht as MeResponse, Ii as SessionStats, Io as DesktopCommandError, Jn as SpaceCommerceBenefit, Jo as NavigationCall, Jr as SpaceRecord, Jt as PatchResourceLabelsInput, Ka as GenerationContentBlock, Ks as AppAuthorizationRequest$1, Lc as SpaceCompletionResult, Lo as DesktopCommandRecord, Ls as BoardPatch, Lt as LabelListItem, Mi as SessionForkRecord, Mn as SessionTurnWindowResponse, Mr as SpaceFsWriteFileInput, Nn as SessionTurnsPaginatedResponse, Oi as MessageRecord, On as SessionTurnIndexResponse, Ot as InvitationDetail, Po as DesktopCommand, Pr as SpaceInvitationListResponse, Pt as LabelAssignmentRecord, Q as Channel, Qa as BoardChangedEvent$1, Qn as SpaceCommerceOrder, Qo as SpaceFsCopyInput, Qs as RuntimeArchivePage, Rc as SpaceCompletionStreamEvent, Ri as MessageToolCallsFile, Rn as SpaceAccessPolicy, Ro as DesktopCommandStatus, Rr as SpaceListOptions, Si as ChannelConfig, So as AppVersionSource, Tn as SessionMessagesPaginatedResponse, Ur as SpacePendingDiffFileResponse, Ut as ModelCatalogEntry, Vi as SpaceTurnsResponse, Vn as SpaceActivityResponse, Wi as TurnIntermediateMessagesFile, Wr as SpacePendingDiffSummary, Ws as BillingPayload, Xo as SpacePublicEndpoints, Xs as HarnessArchiveIndex, Xt as Permission, Yn as SpaceCommerceBuyerProfile, Yo as NavigationLaunch, Yr as SpaceRole, Yt as PatchResourceLabelsResponse, Za as BoardAwarenessUpdatedEvent$1, _ as AcceptInvitationResponse, _i as UserSessionSourceKey, _t as CronJobRecord, aa as RuntimeStopConfirmation, ac as DisplayCapture, ar as SpaceConfigUpdateResponse, br as SpaceFsPreparingFile, bs as BoardReadInput, cc as DisplayInfo, cn as ReferenceAggregateResponse, cr as SpaceEnvInput, cs as BoardAwarenessUpdate, ct as ClaimReferralResponse, dc as DisplaySession, dn as ReferenceQueryResponse, ds as BoardApplyInput, dt as CreateSpaceInput, ec as RuntimeArchiveUpload, ei as SpaceTurnAuthorFilter, en as PublicReferral, er as SpaceCommerceProductBenefitBinding, es as SpaceFsCopyResponse, fn as ReferenceQueryableType, fr as SpaceFsCreateUploadInput, fs as BoardApplyResult, gc as DisplayVirtualStart, gs as BoardHistoryPage, hi as UserRulesResponse, hn as ReferralDashboard, ho as AppArtifactDescriptor, hs as BoardHistoryInput, ht as CreateSpaceSessionInput, ia as RuntimeStatus, ii as SpaceUsageResponse, io as RealtimePatchOperation, ir as SpaceConfigResponse, ji as SessionFilesResponse, jn as SessionTurnStreamSnapshotResponse, jr as SpaceFsUploadResponse, js as BoardDelta, kn as SessionTurnResponse, lc as DisplayInputEvent, ln as ReferenceDirection, lo as RealtimeRoomHistoryEvent, lr as SpaceFsCompleteUploadInput, lt as CreateInvitationInput, mc as DisplayTreeParams, mi as UserProfile, mo as SessionTurnPatchEvent, ms as BoardCreateInput, mt as CreateSpacePromptResponse, nn as PublicUserPageResponse, oc as DisplayCaptureParams, oi as TaskRunDetailResponse, oo as RealtimeRoomDescriptor, or as SpaceCreateResponse, ot as CheckpointDiffSummary, pi as UserActivityResponse, pr as SpaceFsCreateUploadResponse, pt as CreateSpacePromptInput, qa as GenerationModelDeclaration, qc as RequestSource, qn as SpaceCheckpointDetailResponse, qr as SpacePublicProfile, qs as AppAuthorizationResult, r as CohubEnvironment, ra as RuntimeSessionRecoveryStatus, rn as PublicUserProfile, rr as SpaceConfigInput, rs as SpaceFsCopyStats, si as TaskRunRecord, sn as ReferenceAggregateGroupBy, sr as SpaceDefaultResponse, st as CheckpointRecord, ts as SpaceFsCopyResult, tt as CheckpointDiffFileResponse, uc as DisplayList, ui as UserActivityQuery, un as ReferenceKind, uo as RealtimeRoomMember, ur as SpaceFsCompleteUploadResponse, ut as CreateInvitationResponse, vc as AppRtcDelivery, vr as SpaceFsFileResponse, vt as CronJobUpdatePatch, wn as SessionMessageResponse, wr as SpaceFsTreeResponse, wt as GlobalSearchResponse, xc as AppRtcQuality, xo as AppContentKind, xs as BoardReadResult, y as BatchUserProfilesResponse, yc as AppRtcMediaKind, yi as UserSessionsResponse, yr as SpaceFsMoveInput, ys as BoardPlaybackSnapshot, yt as CursorPageInfo, zc as Usage, zr as SpaceListPage, zt as LabelResourceType } from "./environment.js";
|
|
2
2
|
import { a as WebsocketClientOptions, r as WebsocketClient, s as WebsocketEventPayload } from "./websocket.js";
|
|
3
3
|
import { a as VoiceInputCreateOptions } from "./voice-input.js";
|
|
4
4
|
//#region ../protocol/dist/model/decision.d.ts
|
|
@@ -3082,6 +3082,339 @@ declare class WorkCommerceApi extends AppCommerceApi {}
|
|
|
3082
3082
|
/** @deprecated Use `AppCommerceOrder`. */
|
|
3083
3083
|
type WorkCommerceOrder = AppCommerceOrder;
|
|
3084
3084
|
//#endregion
|
|
3085
|
+
//#region src/apis/app-room-rtc.d.ts
|
|
3086
|
+
type AppRtcState = "connecting" | "connected" | "reconnecting" | "closed";
|
|
3087
|
+
type AppRtcErrorCode = "RTC_UNSUPPORTED" | "RTC_UNAVAILABLE" | "RTC_FORBIDDEN" | "RTC_LIMIT_EXCEEDED" | "RTC_RATE_LIMITED" | "RTC_CLOSED" | "ROOM_NOT_FOUND" | "ROOM_EXPIRED" | "RTC_FAILED";
|
|
3088
|
+
declare class AppRtcError extends Error {
|
|
3089
|
+
readonly code: AppRtcErrorCode;
|
|
3090
|
+
constructor(code: AppRtcErrorCode, message: string);
|
|
3091
|
+
}
|
|
3092
|
+
type AppRtcMessage<T = unknown> = {
|
|
3093
|
+
from: string;
|
|
3094
|
+
data: T | ArrayBuffer;
|
|
3095
|
+
};
|
|
3096
|
+
type AppRtcChannelOptions = {
|
|
3097
|
+
delivery?: AppRtcDelivery;
|
|
3098
|
+
};
|
|
3099
|
+
type AppRtcPeerEvent = {
|
|
3100
|
+
participantId: string;
|
|
3101
|
+
open: boolean;
|
|
3102
|
+
};
|
|
3103
|
+
type AppRtcCandidate = {
|
|
3104
|
+
participantId: string;
|
|
3105
|
+
name: string;
|
|
3106
|
+
kind: AppRtcMediaKind;
|
|
3107
|
+
simulcast: boolean;
|
|
3108
|
+
subscribed: boolean;
|
|
3109
|
+
};
|
|
3110
|
+
type AppRtcRemoteTrack = {
|
|
3111
|
+
participantId: string;
|
|
3112
|
+
name: string;
|
|
3113
|
+
kind: AppRtcMediaKind;
|
|
3114
|
+
track: MediaStreamTrack;
|
|
3115
|
+
quality: AppRtcQuality | null;
|
|
3116
|
+
setQuality(quality: AppRtcQuality): Promise<void>;
|
|
3117
|
+
};
|
|
3118
|
+
type AppRtcTrackInput = MediaStreamTrack | {
|
|
3119
|
+
track: MediaStreamTrack;
|
|
3120
|
+
simulcast?: boolean;
|
|
3121
|
+
};
|
|
3122
|
+
type AppRtcLocalTrack = {
|
|
3123
|
+
readonly name: string;
|
|
3124
|
+
readonly kind: AppRtcMediaKind;
|
|
3125
|
+
readonly track: MediaStreamTrack;
|
|
3126
|
+
readonly simulcast: boolean;
|
|
3127
|
+
replace(track: MediaStreamTrack): Promise<void>;
|
|
3128
|
+
onEnded(handler: () => void): () => void;
|
|
3129
|
+
stop(): Promise<void>;
|
|
3130
|
+
};
|
|
3131
|
+
type AppRtcHost = {
|
|
3132
|
+
roomId: string;
|
|
3133
|
+
appId: string;
|
|
3134
|
+
ticket: string;
|
|
3135
|
+
transport: HttpTransport;
|
|
3136
|
+
hosted?: boolean;
|
|
3137
|
+
createPeerConnection?: (configuration: RTCConfiguration) => RTCPeerConnection;
|
|
3138
|
+
participantId(): string;
|
|
3139
|
+
members(): RealtimeRoomMember[];
|
|
3140
|
+
onMembersChanged(handler: (members: RealtimeRoomMember[]) => void): () => void;
|
|
3141
|
+
};
|
|
3142
|
+
declare class AppRtcChannel<T = unknown> {
|
|
3143
|
+
private readonly rtc;
|
|
3144
|
+
readonly name: string;
|
|
3145
|
+
readonly delivery: AppRtcDelivery;
|
|
3146
|
+
private readonly handlers;
|
|
3147
|
+
private readonly peerHandlers;
|
|
3148
|
+
private readonly openPeers;
|
|
3149
|
+
private publication;
|
|
3150
|
+
private pending;
|
|
3151
|
+
private offFlush;
|
|
3152
|
+
private sequence;
|
|
3153
|
+
private closed;
|
|
3154
|
+
constructor(rtc: AppRoomRtc, name: string, delivery: AppRtcDelivery);
|
|
3155
|
+
get peers(): string[];
|
|
3156
|
+
send(data: T | ArrayBuffer | ArrayBufferView): boolean;
|
|
3157
|
+
onMessage(handler: (message: AppRtcMessage<T>) => void): () => boolean;
|
|
3158
|
+
/** Reports when this client starts or stops receiving a peer's channel. */
|
|
3159
|
+
onPeer(handler: (event: AppRtcPeerEvent) => void): () => boolean;
|
|
3160
|
+
close(): void;
|
|
3161
|
+
private write;
|
|
3162
|
+
}
|
|
3163
|
+
declare class AppRoomRtc {
|
|
3164
|
+
private readonly host;
|
|
3165
|
+
private _state;
|
|
3166
|
+
private pc;
|
|
3167
|
+
private sessionId;
|
|
3168
|
+
private queue;
|
|
3169
|
+
private releasePending;
|
|
3170
|
+
private reconcileQueued;
|
|
3171
|
+
private reconcileFailures;
|
|
3172
|
+
private reconnectAttempt;
|
|
3173
|
+
private reconnectTimer;
|
|
3174
|
+
private generation;
|
|
3175
|
+
private filter;
|
|
3176
|
+
private readonly channels;
|
|
3177
|
+
private readonly channelsToPublish;
|
|
3178
|
+
private readonly remoteData;
|
|
3179
|
+
private readonly localTracks;
|
|
3180
|
+
private readonly remoteMedia;
|
|
3181
|
+
private readonly mediaByMid;
|
|
3182
|
+
private readonly stateHandlers;
|
|
3183
|
+
private readonly trackHandlers;
|
|
3184
|
+
private readonly offMembers;
|
|
3185
|
+
constructor(host: AppRtcHost);
|
|
3186
|
+
get state(): AppRtcState;
|
|
3187
|
+
get tracks(): AppRtcRemoteTrack[];
|
|
3188
|
+
get candidates(): AppRtcCandidate[];
|
|
3189
|
+
onStateChange(handler: (state: AppRtcState) => void): () => boolean;
|
|
3190
|
+
onTracksChanged(handler: (tracks: AppRtcRemoteTrack[]) => void): () => boolean;
|
|
3191
|
+
select(filter: ((candidate: AppRtcCandidate) => boolean) | null): void;
|
|
3192
|
+
channel<T = unknown>(name: string, options?: AppRtcChannelOptions): AppRtcChannel<T>;
|
|
3193
|
+
publish<Names extends string>(tracks: Record<Names, AppRtcTrackInput>): Promise<Record<Names, AppRtcLocalTrack>>;
|
|
3194
|
+
stats(): Promise<RtcTransportStats>;
|
|
3195
|
+
close(): void;
|
|
3196
|
+
shutdown(): Promise<void>;
|
|
3197
|
+
private localEntry;
|
|
3198
|
+
private localHandle;
|
|
3199
|
+
private dropLocal;
|
|
3200
|
+
private stopLocal;
|
|
3201
|
+
private publishTracks;
|
|
3202
|
+
private unpublishTrack;
|
|
3203
|
+
private publishChannel;
|
|
3204
|
+
private connect;
|
|
3205
|
+
private connected;
|
|
3206
|
+
private reconnect;
|
|
3207
|
+
private teardown;
|
|
3208
|
+
private enqueue;
|
|
3209
|
+
private publishChannels;
|
|
3210
|
+
private unpublishData;
|
|
3211
|
+
private settleOffer;
|
|
3212
|
+
private offerExchange;
|
|
3213
|
+
private scheduleReconcile;
|
|
3214
|
+
private mediaCandidates;
|
|
3215
|
+
private reconcile;
|
|
3216
|
+
private dropRemoteData;
|
|
3217
|
+
private reconcileData;
|
|
3218
|
+
private reconcileMedia;
|
|
3219
|
+
private retarget;
|
|
3220
|
+
private setQuality;
|
|
3221
|
+
private unsubscribeMedia;
|
|
3222
|
+
private subscribeMedia;
|
|
3223
|
+
private answerOffer;
|
|
3224
|
+
private localOffer;
|
|
3225
|
+
private request;
|
|
3226
|
+
private send;
|
|
3227
|
+
private requirePc;
|
|
3228
|
+
private onData;
|
|
3229
|
+
private onTrack;
|
|
3230
|
+
private notifyTracks;
|
|
3231
|
+
private setState;
|
|
3232
|
+
}
|
|
3233
|
+
//#endregion
|
|
3234
|
+
//#region src/apis/app-realtime.d.ts
|
|
3235
|
+
type AppRoomEventMap = object;
|
|
3236
|
+
type AppRoomCreateInput = {
|
|
3237
|
+
code?: string;
|
|
3238
|
+
expiresInSeconds?: number;
|
|
3239
|
+
maxParticipants?: number;
|
|
3240
|
+
/**
|
|
3241
|
+
* Give each viewer at most one seat, so a second tab or a rejoin after an unclean
|
|
3242
|
+
* disconnect takes it over. Defaults to false: every connection is a participant.
|
|
3243
|
+
*/
|
|
3244
|
+
seatPerUser?: boolean;
|
|
3245
|
+
};
|
|
3246
|
+
type AppRoomAdmissionResponse = {
|
|
3247
|
+
room: RealtimeRoomDescriptor;
|
|
3248
|
+
participantId: string;
|
|
3249
|
+
userKey: string;
|
|
3250
|
+
ticket: string;
|
|
3251
|
+
};
|
|
3252
|
+
type AppRoomState = "connecting" | "joined" | "reconnecting" | "expired" | "closed";
|
|
3253
|
+
type AppRoomEvent<T = unknown> = {
|
|
3254
|
+
id: string;
|
|
3255
|
+
timestamp: number;
|
|
3256
|
+
roomId: string;
|
|
3257
|
+
sequence: number;
|
|
3258
|
+
type: string;
|
|
3259
|
+
data: T;
|
|
3260
|
+
clientEventId: string | null;
|
|
3261
|
+
sender: {
|
|
3262
|
+
participantId: string;
|
|
3263
|
+
};
|
|
3264
|
+
self: boolean;
|
|
3265
|
+
};
|
|
3266
|
+
type AppRoomPublishResult = {
|
|
3267
|
+
eventId: string;
|
|
3268
|
+
sequence: number;
|
|
3269
|
+
clientEventId: string | null;
|
|
3270
|
+
};
|
|
3271
|
+
type AppRoomHistory<T = unknown> = {
|
|
3272
|
+
events: AppRoomEvent<T>[];
|
|
3273
|
+
cursor: number;
|
|
3274
|
+
truncated: boolean;
|
|
3275
|
+
};
|
|
3276
|
+
type AppRoomInvite = {
|
|
3277
|
+
invite: string;
|
|
3278
|
+
expiresAt: string;
|
|
3279
|
+
};
|
|
3280
|
+
type EventHandler<T> = (event: AppRoomEvent<T>) => void;
|
|
3281
|
+
type StateHandler = (state: AppRoomState) => void;
|
|
3282
|
+
type MembersHandler = (members: RealtimeRoomMember[]) => void;
|
|
3283
|
+
declare class AppRoom<Events extends AppRoomEventMap = AppRoomEventMap> {
|
|
3284
|
+
private readonly websocket;
|
|
3285
|
+
private readonly admission;
|
|
3286
|
+
private readonly appContext?;
|
|
3287
|
+
readonly id: string;
|
|
3288
|
+
readonly code: string;
|
|
3289
|
+
readonly createdAt: string;
|
|
3290
|
+
readonly expiresAt: string;
|
|
3291
|
+
readonly maxParticipants: number;
|
|
3292
|
+
readonly seatPerUser: boolean;
|
|
3293
|
+
/** Opaque, stable identity of this viewer inside the room. */
|
|
3294
|
+
readonly userKey: string;
|
|
3295
|
+
private _participantId;
|
|
3296
|
+
private _state;
|
|
3297
|
+
private _members;
|
|
3298
|
+
private joinBuffer;
|
|
3299
|
+
private lastSequence;
|
|
3300
|
+
private hasJoined;
|
|
3301
|
+
private explicitLeave;
|
|
3302
|
+
private expiryTimer;
|
|
3303
|
+
private readonly pending;
|
|
3304
|
+
private readonly handlers;
|
|
3305
|
+
private readonly allHandlers;
|
|
3306
|
+
private readonly stateHandlers;
|
|
3307
|
+
private readonly membersHandlers;
|
|
3308
|
+
private readonly outOfSyncHandlers;
|
|
3309
|
+
private readonly sendErrorHandlers;
|
|
3310
|
+
private readonly offEvent;
|
|
3311
|
+
private readonly offOpen;
|
|
3312
|
+
private readonly offClose;
|
|
3313
|
+
private readonly offReconnecting;
|
|
3314
|
+
private readonly instanceId;
|
|
3315
|
+
private rtcConnection;
|
|
3316
|
+
constructor(websocket: WebsocketClient, admission: AppRoomAdmissionResponse, appContext?: {
|
|
3317
|
+
transport: HttpTransport;
|
|
3318
|
+
appId: string;
|
|
3319
|
+
hosted?: boolean;
|
|
3320
|
+
} | undefined);
|
|
3321
|
+
get state(): AppRoomState;
|
|
3322
|
+
/**
|
|
3323
|
+
* Identity of this connection inside the room. A `seatPerUser` join can take over a
|
|
3324
|
+
* seat the viewer already holds, so this may differ from the id issued at admission.
|
|
3325
|
+
*/
|
|
3326
|
+
get participantId(): string;
|
|
3327
|
+
get members(): RealtimeRoomMember[];
|
|
3328
|
+
get sequence(): number;
|
|
3329
|
+
connect(options?: {
|
|
3330
|
+
after?: number;
|
|
3331
|
+
}): Promise<this>;
|
|
3332
|
+
subscribe<K extends Extract<keyof Events, string>>(type: K, handler: EventHandler<Events[K]>): () => boolean;
|
|
3333
|
+
subscribeAll(handler: (event: AppRoomEvent<unknown>) => void): () => boolean;
|
|
3334
|
+
onStateChange(handler: StateHandler): () => boolean;
|
|
3335
|
+
onMembersChanged(handler: MembersHandler): () => boolean;
|
|
3336
|
+
onOutOfSync(handler: (expected: number, actual: number) => void): () => boolean;
|
|
3337
|
+
/** Reports failures of {@link send}, which has no ack to reject. */
|
|
3338
|
+
onSendError(handler: (error: Error) => void): () => boolean;
|
|
3339
|
+
/**
|
|
3340
|
+
* Publishes without waiting for the server ack, for high-frequency traffic such as
|
|
3341
|
+
* input frames. Awaiting {@link publish} instead caps a loop at `1000 / rtt` events
|
|
3342
|
+
* per second. Ordering still holds, but failures surface through
|
|
3343
|
+
* {@link onSendError} rather than a rejected promise, and calls are ignored while
|
|
3344
|
+
* the room is not joined; watch {@link onStateChange} to know when it resumes.
|
|
3345
|
+
*/
|
|
3346
|
+
send<K extends Extract<keyof Events, string>>(type: K, data: Events[K]): void;
|
|
3347
|
+
private validateSend;
|
|
3348
|
+
publish<K extends Extract<keyof Events, string>>(type: K, data: Events[K], options?: {
|
|
3349
|
+
clientEventId?: string;
|
|
3350
|
+
}): Promise<{
|
|
3351
|
+
eventId: string;
|
|
3352
|
+
sequence: number;
|
|
3353
|
+
clientEventId: string | null;
|
|
3354
|
+
}>;
|
|
3355
|
+
/** Published events after `after`, oldest first; without it, the newest ones. */
|
|
3356
|
+
history<T = unknown>(input?: {
|
|
3357
|
+
after?: number;
|
|
3358
|
+
limit?: number;
|
|
3359
|
+
}): Promise<AppRoomHistory<T>>;
|
|
3360
|
+
/** An invite for someone outside the App, e.g. an Agent: `cohub rooms join <invite>`. */
|
|
3361
|
+
invite(input?: {
|
|
3362
|
+
expiresInSeconds?: number;
|
|
3363
|
+
}): Promise<AppRoomInvite>;
|
|
3364
|
+
private rtcFactory;
|
|
3365
|
+
rtc(options?: {
|
|
3366
|
+
createPeerConnection?: (configuration: RTCConfiguration) => RTCPeerConnection;
|
|
3367
|
+
}): Promise<AppRoomRtc>;
|
|
3368
|
+
private openRtc;
|
|
3369
|
+
setPresence(presence: Record<string, unknown> | null): Promise<void>;
|
|
3370
|
+
disconnect(): Promise<void>;
|
|
3371
|
+
leave(): Promise<void>;
|
|
3372
|
+
private rejoin;
|
|
3373
|
+
private joinOverWebsocket;
|
|
3374
|
+
private request;
|
|
3375
|
+
/** Detaches the entry awaiting this requestId, so the caller can settle it. */
|
|
3376
|
+
private takePending;
|
|
3377
|
+
private handleEvent;
|
|
3378
|
+
private catchUp;
|
|
3379
|
+
private emit;
|
|
3380
|
+
private toHistory;
|
|
3381
|
+
private observeSequence;
|
|
3382
|
+
private assertJoined;
|
|
3383
|
+
private setState;
|
|
3384
|
+
private notifyMembers;
|
|
3385
|
+
private rejectPending;
|
|
3386
|
+
private expire;
|
|
3387
|
+
private dispose;
|
|
3388
|
+
}
|
|
3389
|
+
declare class AppRealtimeApi {
|
|
3390
|
+
private readonly transport;
|
|
3391
|
+
private readonly websocket;
|
|
3392
|
+
private readonly getContext;
|
|
3393
|
+
constructor(transport: HttpTransport, websocket: WebsocketClient, getContext: () => Promise<AppRuntimeContext | null>);
|
|
3394
|
+
createRoom<Events extends AppRoomEventMap = AppRoomEventMap>(input?: AppRoomCreateInput): Promise<AppRoom<Events>>;
|
|
3395
|
+
joinRoom<Events extends AppRoomEventMap = AppRoomEventMap>(input: {
|
|
3396
|
+
code: string;
|
|
3397
|
+
}): Promise<AppRoom<Events>>;
|
|
3398
|
+
private requireAppId;
|
|
3399
|
+
private openRoom;
|
|
3400
|
+
}
|
|
3401
|
+
/** @deprecated Use `AppRoomAdmissionResponse`. */
|
|
3402
|
+
type WorkRoomAdmissionResponse = AppRoomAdmissionResponse;
|
|
3403
|
+
/** @deprecated Use `AppRoomCreateInput`. */
|
|
3404
|
+
type WorkRoomCreateInput = AppRoomCreateInput;
|
|
3405
|
+
/** @deprecated Use `AppRoomEvent`. */
|
|
3406
|
+
type WorkRoomEvent<T = unknown> = AppRoomEvent<T>;
|
|
3407
|
+
/** @deprecated Use `AppRoomEventMap`. */
|
|
3408
|
+
type WorkRoomEventMap = AppRoomEventMap;
|
|
3409
|
+
/** @deprecated Use `AppRoomPublishResult`. */
|
|
3410
|
+
type WorkRoomPublishResult = AppRoomPublishResult;
|
|
3411
|
+
/** @deprecated Use `AppRoomState`. */
|
|
3412
|
+
type WorkRoomState = AppRoomState;
|
|
3413
|
+
/** @deprecated Use `AppRealtimeApi`. */
|
|
3414
|
+
declare class WorkRealtimeApi extends AppRealtimeApi {}
|
|
3415
|
+
/** @deprecated Use `AppRoom`. */
|
|
3416
|
+
declare class WorkRoom<Events extends AppRoomEventMap = AppRoomEventMap> extends AppRoom<Events> {}
|
|
3417
|
+
//#endregion
|
|
3085
3418
|
//#region src/apis/rooms.d.ts
|
|
3086
3419
|
type RoomView = {
|
|
3087
3420
|
room: RealtimeRoomDescriptor;
|
|
@@ -3114,7 +3447,8 @@ type RoomEventsQuery = {
|
|
|
3114
3447
|
};
|
|
3115
3448
|
declare class RoomsApi {
|
|
3116
3449
|
private readonly transport;
|
|
3117
|
-
|
|
3450
|
+
private readonly websocket?;
|
|
3451
|
+
constructor(transport: HttpTransport, websocket?: WebsocketClient | undefined);
|
|
3118
3452
|
create(input: {
|
|
3119
3453
|
appId: string;
|
|
3120
3454
|
code?: string;
|
|
@@ -3128,6 +3462,15 @@ declare class RoomsApi {
|
|
|
3128
3462
|
idleSeconds?: number;
|
|
3129
3463
|
}): Promise<RoomView>;
|
|
3130
3464
|
get(roomId: string): Promise<RoomView>;
|
|
3465
|
+
connect(roomId: string, options?: {
|
|
3466
|
+
after?: number;
|
|
3467
|
+
onRoom?: (room: AppRoom<Record<string, unknown>>) => void;
|
|
3468
|
+
}): Promise<AppRoom<Record<string, unknown>>>;
|
|
3469
|
+
signalRtc<T = unknown>(roomId: string, input: {
|
|
3470
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
3471
|
+
path?: string;
|
|
3472
|
+
body?: unknown;
|
|
3473
|
+
}): Promise<T>;
|
|
3131
3474
|
events(roomId: string, query?: RoomEventsQuery): Promise<RoomEvents>;
|
|
3132
3475
|
publish(roomId: string, type: string, data?: unknown): Promise<{
|
|
3133
3476
|
sequence: number;
|
|
@@ -3181,4 +3524,4 @@ declare class CohubHttpClient {
|
|
|
3181
3524
|
}
|
|
3182
3525
|
declare const createHttpClient: (options?: CohubClientOptions) => CohubHttpClient;
|
|
3183
3526
|
//#endregion
|
|
3184
|
-
export {
|
|
3527
|
+
export { WorkCommerceEntitlement as $, SpaceStartupResponse as $i, SessionGenerationStreamClient as $n, sanitizeAccessToken as $r, WorkPresentationMeta as $t, AppRtcChannel as A, AppNavigationOpenMessage as Ai, SpacePublicFilesApi as An, PublicAssetUploadProgress as Ar, AppPublicOwnerRecord as At, AppCommerceApi as B, AppRuntimeRect as Bi, buildSpacePath as Bn, ModelsApi as Br, AppViewStatsResponse as Bt, WorkRoomCreateInput as C, createSlugAppIdResolver as Ci, OpenSpaceFileOptions as Cn, ReferenceResourceSelector as Cr, AppPresentationMeta as Ct, WorkRoomState as D, AppDevicesStatus as Di, SpaceClient as Dn, CreatePublicAssetUploadResponse as Dr, AppPromotionProviderStatus as Dt, WorkRoomPublishResult as E, AppDevice as Ei, SpaceChannelBindingRecord as En, CreatePublicAssetUploadInput as Er, AppPromotionProvider as Et, AppRtcMessage as F, AppAppearanceToken as Fi, WebSocketConnectionState as Fn, UploadChatImageAttachmentInput as Fr, AppStatus as Ft, AppCommerceEntitlementsResponse as G, PublicFileCreateUploadResponse as Gi, GenerationStreamFinalizedEvent as Gn, Fetch as Gr, WorkAuthorizeResponse as Gt, AppCommerceCreditConsumeResponse as H, AppWindowStatus as Hi, GenerationStreamCommitEvent as Hn, CronJobsApi as Hr, AppVisibility as Ht, AppRtcPeerEvent as I, AppDropResource as Ii, BuildSpaceInvitePathInput as In, UploadGenerationInputInput as Ir, AppTargetType as It, AppCommercePurchaseResponse as J, PublicFileUploadEntryInput as Ji, GenerationStreamOutOfSyncEvent as Jn, HttpTransport as Jr, WorkCreateInput as Jt, AppCommerceOrder as K, PublicFileListEntry as Ki, GenerationStreamIntermediateMessage as Kn, HttpError as Kr, WorkContent as Kt, AppRtcRemoteTrack as L, AppDropResourceType as Li, BuildSpacePathInput as Ln, UploadPublicAssetInput as Lr, AppUpdateInput as Lt, AppRtcError as M, AppNavigationTarget as Mi, SpaceWebhooksApi as Mn, PublicAssetsApi as Mr, AppRecord as Mt, AppRtcErrorCode as N, APP_APPEARANCE_TOKENS as Ni, SpacesApi as Nn, UploadAppSourceInput as Nr, AppResolveResponse as Nt, AppRoomRtc as O, AppNavigationCall as Oi, SpaceEventName as On, PublicAssetMimeType as Or, AppPromotionRecord as Ot, AppRtcLocalTrack as P, AppAppearance as Pi, WaitForSpaceFsCopyOptions as Pn, UploadChatAttachmentInput as Pr, AppSessionResponse as Pt, WorkCommerceCreditConsumeStatus as Q, SpaceWebhookTriggerResponse as Qi, GenerationStreamTurnUpdatedEvent as Qn, matchesUnauthorizedErrorToken as Qr, WorkMeta as Qt, AppRtcState as R, AppRuntimeAnchor as Ri, PublicInviteApi as Rn, SkillsApi as Rr, AppVersionRecord as Rt, WorkRoomAdmissionResponse as S, createOriginAppResolver as Si, TasksApi as Sn, SessionAccessApi as Sr, AppMeta as St, WorkRoomEventMap as T, APP_DEVICES as Ti, SessionSubscriptionHandlers as Tn, SearchApi as Tr, AppPromotionEventResponse as Tt, AppCommerceCreditConsumeStatus as U, appAppearanceVar as Ui, GenerationStreamErrorEvent as Un, ChannelsApi as Ur, AppsApi as Ut, AppCommerceCheckoutStatus as V, AppWindowState as Vi, AssistantMessageCommit as Vn, GenerationsApi as Vr, AppViewerGrantRecord as Vt, AppCommerceEntitlement as W, PublicFileCreateUploadInput as Wi, GenerationStreamEvent as Wn, CohubClientOptions as Wr, PublicAppVersionSummary as Wt, WorkCommerceCheckoutStatus as X, PublicFileUrlResponse as Xi, GenerationStreamSubscribeOptions as Xn, UnauthorizedContext as Xr, WorkExtractedPageMeta as Xt, WorkCommerceApi as Y, PublicFileUploadPlanEntry as Yi, GenerationStreamStateEvent as Yn, RawHttpResponse as Yr, WorkDetailResponse as Yt, WorkCommerceCreditConsumeResponse as Z, SpaceWebhookListItem as Zi, GenerationStreamSubscriptionHandlers as Zn, joinApiUrl as Zr, WorkGetResponse as Zt, AppRoomInvite as _, AppRuntimeTransport as _i, WorkVisibility as _n, BoardClient as _r, AppContentDownload as _t, RoomEvents as a, PublicGenerationDeclaration as aa, AppRuntimeApi as ai, WorkPromotionStatsResponse as an, SessionPatchState as ar, CreateUiCommandInput as at, WorkRealtimeApi as b, PopupBrokerTransport as bi, UserApi as bn, BoardPlaybackChangedEvent as br, AppExtractedPageMeta as bt, RoomView as c, CreateSpaceDecisionInput as ca, AppRuntimeCheckoutState as ci, WorkRecord as cn, SpaceDisplaysApi as cr, UiCommandError as ct, AppRoom as d, DecisionState as da, AppRuntimeError as di, WorkStatus as dn, DisplayConnectionState as dr, UiCommandsApi as dt, CreateGenerationTaskRequest as ea, AppAuthorizationRequest as ei, WorkPromotionCreateInput as en, createSessionGenerationStreamClient as er, WorkCommerceEntitlementsResponse as et, AppRoomAdmissionResponse as f, DecisionStateImage as fa, AppRuntimeInvocationContext as fi, WorkTargetType as fn, connectDisplay as fr, WaitForDesktopCommandOptions as ft, AppRoomHistory as g, AppRuntimeShellContext as gi, WorkViewStatsResponse as gn, BoardChangedEvent as gr, AppContent as gt, AppRoomEventMap as h, AppRuntimeResolvedApp as hi, WorkViewSource as hn, BoardAwarenessUpdatedEvent as hr, AppAuthorizeResponse as ht, RoomEvent as i, ListGenerationModelsResponse as ia, AppIdResolver as ii, WorkPromotionRecord as in, SessionPatchReducer as ir, CreateDesktopCommandInput as it, AppRtcChannelOptions as j, AppNavigationOpenResponse as ji, SpaceTurnListOptions as jn, PublicAssetUploadProtocol as jr, AppPublicSpaceRecord as jt, AppRtcCandidate as k, AppNavigationLaunch as ki, SpaceFileStream as kn, PublicAssetPurpose as kr, AppPromotionStatsResponse as kt, RoomsApi as l, DecisionAnswer as la, AppRuntimeCheckoutStatus as li, WorkResolveResponse as ln, ConnectDisplayOptions as lr, UiCommandRecord as lt, AppRoomEvent as m, AppRuntimeRequestOptions as mi, WorkVersionRecord as mn, RtcTransportStats as mr, AppActionRunResponse as mt, createHttpClient as n, GenerationTaskResult as na, AppDiagnostic as ni, WorkPromotionProvider as nn, SessionPatchApplyInput as nr, WorkCommerceProductResolveResponse as nt, RoomEventsQuery as o, ModelStatusEntry as oa, AppRuntimeAppResolver as oi, WorkPublicOwnerRecord as on, SessionPatchStatus as or, DesktopCommandsApi as ot, AppRoomCreateInput as p, SpaceDecisionResult as pa, AppRuntimeModeConfig as pi, WorkUpdateInput as pn, DisplayConnectionStats as pr, WaitForUiCommandOptions as pt, AppCommerceProductResolveResponse as q, PublicFileListResponse as qi, GenerationStreamLifecycleEvent as qn, HttpTraceContext as qr, WorkContentDownload as qt, RoomCreated as r, GenerationUsageBilling as ra, AppDiagnosticListener as ri, WorkPromotionProviderStatus as rn, SessionPatchApplyResult as rr, WorkCommercePurchaseResponse as rt, RoomInvite as s, ModelStatusResponse as sa, AppRuntimeAuthorizationResult as si, WorkPublicSpaceRecord as sn, createSessionPatchReducer as sr, UiCommand as st, CohubHttpClient as t, CreateGenerationTaskResponse as ta, AppContextChangedListener as ti, WorkPromotionEventResponse as tn, parseAssistantMessageCommit as tr, WorkCommerceOrder as tt, AppRealtimeApi as u, DecisionQuestion as ua, AppRuntimeContext as ui, WorkSessionResponse as un, DisplayConnection as ur, UiCommandStatus as ut, AppRoomPublishResult as v, OriginBrokerTransport as vi, ReferralsApi as vn, BoardClientOptions as vr, AppCreateInput as vt, WorkRoomEvent as w, resolveAppTransport as wi, SessionEventName as wn, ReferencesApi as wr, AppPromotionCreateInput as wt, WorkRoom as x, createAppRuntime as xi, TaskWaitOptions as xn, BoardSubscriptionHandlers as xr, AppGetResponse as xt, AppRoomState as y, ParentBridgeTransport as yi, UsersApi as yn, BoardEventName as yr, AppDetailResponse as yt, AppRtcTrackInput as z, AppRuntimeConfigureRequest as zi, buildSpaceInvitePath as zn, PromptsApi as zr, AppViewSource as zt };
|
package/dist/chunks/http.js
CHANGED
|
@@ -4778,8 +4778,10 @@ var WorkCommerceApi = class extends AppCommerceApi {};
|
|
|
4778
4778
|
const MAX_WAIT_PER_READ_MS = 25e3;
|
|
4779
4779
|
var RoomsApi = class {
|
|
4780
4780
|
transport;
|
|
4781
|
-
|
|
4781
|
+
websocket;
|
|
4782
|
+
constructor(transport, websocket) {
|
|
4782
4783
|
this.transport = transport;
|
|
4784
|
+
this.websocket = websocket;
|
|
4783
4785
|
}
|
|
4784
4786
|
create(input) {
|
|
4785
4787
|
return this.post("", input);
|
|
@@ -4790,6 +4792,35 @@ var RoomsApi = class {
|
|
|
4790
4792
|
get(roomId) {
|
|
4791
4793
|
return this.transport.request(this.path(roomId));
|
|
4792
4794
|
}
|
|
4795
|
+
async connect(roomId, options = {}) {
|
|
4796
|
+
if (!this.websocket) throw new Error("Room realtime requires CohubClient; CohubHttpClient supports HTTP only");
|
|
4797
|
+
if (options.after !== void 0 && (!Number.isSafeInteger(options.after) || options.after < 0)) throw new Error("after must be a non-negative safe integer");
|
|
4798
|
+
const admission = await this.post(`/${encodeURIComponent(roomId)}/connect`, {});
|
|
4799
|
+
const { AppRoom } = await import("./app-realtime.js").then((n) => n.a);
|
|
4800
|
+
const room = new AppRoom(this.websocket, admission, {
|
|
4801
|
+
transport: this.transport,
|
|
4802
|
+
appId: admission.appId,
|
|
4803
|
+
hosted: true
|
|
4804
|
+
});
|
|
4805
|
+
try {
|
|
4806
|
+
options.onRoom?.(room);
|
|
4807
|
+
return await room.connect({ after: options.after });
|
|
4808
|
+
} catch (error) {
|
|
4809
|
+
await room.disconnect();
|
|
4810
|
+
throw error;
|
|
4811
|
+
}
|
|
4812
|
+
}
|
|
4813
|
+
signalRtc(roomId, input) {
|
|
4814
|
+
const path = input.path ?? "";
|
|
4815
|
+
if (path && !/^\/[A-Za-z0-9_-]{8,64}(?:\/(?:publish|unpublish|subscribe|unsubscribe|media))?$/.test(path)) throw new Error("Invalid RTC signaling path");
|
|
4816
|
+
return this.transport.request(`${this.path(roomId)}/rtc${path}`, {
|
|
4817
|
+
method: input.method,
|
|
4818
|
+
...input.body === void 0 ? {} : {
|
|
4819
|
+
headers: { "Content-Type": "application/json" },
|
|
4820
|
+
body: JSON.stringify(input.body)
|
|
4821
|
+
}
|
|
4822
|
+
});
|
|
4823
|
+
}
|
|
4793
4824
|
async events(roomId, query = {}) {
|
|
4794
4825
|
const deadline = Date.now() + Math.max(0, query.waitMs ?? 0);
|
|
4795
4826
|
const result = {
|
|
@@ -168,6 +168,10 @@ declare class WebsocketClient {
|
|
|
168
168
|
clientEventId?: string;
|
|
169
169
|
requestId?: string;
|
|
170
170
|
}): Promise<void>;
|
|
171
|
+
detachRealtimeRoom(input: {
|
|
172
|
+
roomId: string;
|
|
173
|
+
requestId?: string;
|
|
174
|
+
}): Promise<void>;
|
|
171
175
|
leaveRealtimeRoom(input: {
|
|
172
176
|
roomId: string;
|
|
173
177
|
requestId?: string;
|
package/dist/chunks/websocket.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as isRealtimeDomain, c as WS_BOARD_AWARENESS_CAPABILITY, g as getSessionTurnPatchStreamKey, h as getRealtimeSpaceRoom, l as WS_COMPACT_STREAM_CAPABILITY, p as WS_ROOM_SUBSCRIPTION_CAPABILITY, t as HttpError, u as WS_REALTIME_ROOM_CAPABILITY, v as normalizeRealtimeRooms } from "./transport.js";
|
|
1
|
+
import { _ as isRealtimeDomain, c as WS_BOARD_AWARENESS_CAPABILITY, d as WS_REALTIME_ROOM_HISTORY_CAPABILITY, g as getSessionTurnPatchStreamKey, h as getRealtimeSpaceRoom, l as WS_COMPACT_STREAM_CAPABILITY, p as WS_ROOM_SUBSCRIPTION_CAPABILITY, t as HttpError, u as WS_REALTIME_ROOM_CAPABILITY, v as normalizeRealtimeRooms } from "./transport.js";
|
|
2
2
|
import { f as resolveWebsocketUrl } from "./environment.js";
|
|
3
3
|
//#region src/http-error.ts
|
|
4
4
|
/** Shared HTTP error code for every plan entitlement gate (402). */
|
|
@@ -434,6 +434,14 @@ var WebsocketClient = class {
|
|
|
434
434
|
}
|
|
435
435
|
});
|
|
436
436
|
}
|
|
437
|
+
async detachRealtimeRoom(input) {
|
|
438
|
+
await this.ensureOpen();
|
|
439
|
+
this.send({
|
|
440
|
+
type: "realtime.room.detach",
|
|
441
|
+
requestId: input.requestId,
|
|
442
|
+
payload: { roomId: input.roomId }
|
|
443
|
+
});
|
|
444
|
+
}
|
|
437
445
|
async leaveRealtimeRoom(input) {
|
|
438
446
|
await this.ensureOpen();
|
|
439
447
|
this.send({
|
|
@@ -556,7 +564,8 @@ var WebsocketClient = class {
|
|
|
556
564
|
WS_COMPACT_STREAM_CAPABILITY,
|
|
557
565
|
WS_ROOM_SUBSCRIPTION_CAPABILITY,
|
|
558
566
|
WS_BOARD_AWARENESS_CAPABILITY,
|
|
559
|
-
WS_REALTIME_ROOM_CAPABILITY
|
|
567
|
+
WS_REALTIME_ROOM_CAPABILITY,
|
|
568
|
+
WS_REALTIME_ROOM_HISTORY_CAPABILITY
|
|
560
569
|
]
|
|
561
570
|
}
|
|
562
571
|
});
|
package/dist/http.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { $ as CheckpointDiffDelivery, $n as SpaceCommerceProduct, $o as SpaceFsCopyOptions, $r as SpaceSessionsResponse, $t as PromptTemplateCatalogResponse, A as BillingCreditExpiryGroup, Ac as CompletionMessage, Ai as SessionFileRecord, An as SessionTurnSignedUrlsResponse, Ar as SpaceFsUploadProgress, As as BoardColor, At as JsonPrimitive, B as BillingProductBillingInterval, Bc as ContentBlock, Bi as SessionTurnRecord, Bn as SpaceActivityContributor, Br as SpaceMember, Bs as BoardStyle, Bt as LabelScopeType, C as BillingBalanceActivityStatus, Ci as ChannelHealth, Cn as SessionListFork, Cr as SpaceFsReadFilesResponse, Cs as BoardSnapshot, Ct as GlobalSearchChatHit, D as BillingCheckoutConfirmation, Di as FeishuChannelConfig, Dn as SessionRecord, Dr as SpaceFsUploadError, Ds as BoardAnimation, Dt as GlobalSearchViewerRelation, E as BillingCheckoutActionState, Ei as DiscordChannelConfig, En as SessionMessagesResponse, Er as SpaceFsUploadEntry, Et as GlobalSearchType, F as BillingDiscountOfferRef, Fc as CreateSpaceCompletionInput, Fi as RequestMetric, Fn as SkillCatalogResponse, Fr as SpaceInvitationLocation, Fs as BoardKeyframe, Ft as LabelItemsResponse, G as BillingProductPromotion, Gn as SpaceBootstrapStatus, Gr as SpacePresenceSnapshot, Gt as PaletteOverviewResponse, H as BillingProductDisplay, Hi as StoredIntermediateMessage, Hn as SpaceBootstrapMeta, Hr as SpaceModListItem, Ht as MeResponse, I as BillingDiscountPricing, Ia as GenerationPolicy, Ic as ModelThinkingLevel, Ii as SessionStats, In as SkillCatalogSource, Ir as SpaceListFilter, Is as BoardMarker, It as LabelItemsSessionFork, J as BillingResponsePayload, Ja as GenerationResult, Jn as SpaceCommerceBenefit, Jr as SpaceRecord, Jt as PatchResourceLabelsInput, K as BillingPromotionCodePreview, Ka as GenerationContentBlock, Kn as SpaceChannelBindingInput, Kr as SpacePresenceUser, Kt as PaletteOverviewSpace, L as BillingHistoryPagination, Lc as SpaceCompletionResult, Li as TurnMetrics, Ln as SpaceAccess, Lr as SpaceListItem, Ls as BoardPatch, Lt as LabelListItem, M as BillingCreditStatus, Mc as CompletionMessageRole, Mi as SessionForkRecord, Mn as SessionTurnWindowResponse, Mr as SpaceFsWriteFileInput, Ms as BoardDiagnostic, Mt as LabelAssignmentListItem, N as BillingCreditUnit, Nc as CompletionThinkingLevel, Ni as SessionTurnSegmentRecord, Nn as SessionTurnsPaginatedResponse, Nr as SpaceInvitation, Ns as BoardDocument, Nt as LabelAssignmentPageInfo, O as BillingCheckoutResult, Oc as CompletionAssistantMessage, Oi as MessageRecord, On as SessionTurnIndexResponse, Or as SpaceFsUploadPlanEntry, Os as BoardAnimationHeader, Ot as InvitationDetail, P as BillingDiscountOffer, Pc as CompletionUsage, Pi as ExecutionStats, Pn as SkillCatalogEntry, Pr as SpaceInvitationListResponse, Ps as BoardItem, Pt as LabelAssignmentRecord, Q as Channel, Qn as SpaceCommerceOrder, Qo as SpaceFsCopyInput, Qr as SpaceSandboxProvider, Qt as PromptTemplateCatalogEntry, R as BillingPaymentStatus, Rc as SpaceCompletionStreamEvent, Ri as MessageToolCallsFile, Rn as SpaceAccessPolicy, Rr as SpaceListOptions, Rt as LabelRecord, S as BillingBalanceActivityList, Si as ChannelConfig, Sn as SessionBindingRecord, Sr as SpaceFsReadFilesInput, Ss as BoardRecord, St as GenerationUsageSummary, T as BillingCatalogProduct, Ti as ChannelRuntimeState, Tn as SessionMessagesPaginatedResponse, Tr as SpaceFsUploadDestination, Tt as GlobalSearchResult, U as BillingProductKind, Ui as StoredToolCall, Un as SpaceBootstrapSource, Ur as SpacePendingDiffFileResponse, Ut as ModelCatalogEntry, V as BillingProductCreditBenefit, Vn as SpaceActivityResponse, Vr as SpaceMeta, Vs as BoardTrack, Vt as LabelSource, W as BillingProductPricing, Wi as TurnIntermediateMessagesFile, Wn as SpaceBootstrapStage, Wr as SpacePendingDiffSummary, Wt as PERMISSIONS, X as BillingSubscriptionHistoryStatus, Xn as SpaceCommerceCreditsBenefit, Xr as SpaceSandboxAutoDestroyPolicy, Xt as Permission, Y as BillingSubscriptionHistoryList, Ya as SearchTextRange, Yn as SpaceCommerceBuyerProfile, Yr as SpaceRole, Yt as PatchResourceLabelsResponse, Z as BillingSubscriptionSummary, Zn as SpaceCommerceFeatureBenefit, Zo as SpaceFsCopyError, Zr as SpaceSandboxConfig, Zt as PromptAccessMode, _ as AcceptInvitationResponse, _i as UserSessionSourceKey, _n as ReferralReward, _r as SpaceFsFileKind, _s as BoardManifest, _t as CronJobRecord, ai as SpaceUsageSummary, an as PublicUserWorkItem, ar as SpaceConfigUpdateResponse, at as CheckpointDiffStatus, b as BillingBalanceActivity, bi as isUserLevelPermission, bn as SandboxSpecId, br as SpaceFsPreparingFile, bs as BoardReadInput, bt as GenerationUsageBlock, ci as USER_LEVEL_PERMISSIONS, cn as ReferenceAggregateResponse, cr as SpaceEnvInput, ct as ClaimReferralResponse, di as UserActivityRange, dn as ReferenceQueryResponse, dr as SpaceFsCreateDirectoryInput, ds as BoardApplyInput, dt as CreateSpaceInput, ei as SpaceTurnAuthorFilter, en as PublicReferral, er as SpaceCommerceProductBenefitBinding, es as SpaceFsCopyResponse, et as CheckpointDiffFile, fi as UserActivityRankings, fn as ReferenceQueryableType, fr as SpaceFsCreateUploadInput, fs as BoardApplyResult, ft as CreateSpaceModInput, gi as UserSessionListItem, gn as ReferralListItem, gr as SpaceFsEntry, gs as BoardHistoryPage, gt as CronJobPayload, hi as UserRulesResponse, hn as ReferralDashboard, hr as SpaceFsEncoding, hs as BoardHistoryInput, ht as CreateSpaceSessionInput, ii as SpaceUsageResponse, in as PublicUserSpaceItem, ir as SpaceConfigResponse, is as SpaceFsCopyStatus, it as CheckpointDiffStats, j as BillingCreditGrantStatus, jc as CompletionMessageInput, ji as SessionFilesResponse, jn as SessionTurnStreamSnapshotResponse, jr as SpaceFsUploadResponse, js as BoardDelta, jt as JsonValue, k as BillingConversionIntent, kc as CompletionImageInput, ki as SessionFileChangeKind, kn as SessionTurnResponse, kr as SpaceFsUploadPlanEntryInput, kt as JsonObject, li as UsageTotals, ln as ReferenceDirection, lr as SpaceFsCompleteUploadInput, ls as TaskRunBoard, lt as CreateInvitationInput, mi as UserProfile, mn as ReferenceResourceType, mr as SpaceFsDeleteNodeInput, ms as BoardCreateInput, mt as CreateSpacePromptResponse, ni as SpaceTurnsResponse, nn as PublicUserPageResponse, nr as SpaceConfig, ns as SpaceFsCopySource, nt as CheckpointDiffPatchKind, oi as TaskRunDetailResponse, on as ReferenceAggregateGroup, or as SpaceCreateResponse, ot as CheckpointDiffSummary, pi as UserActivityResponse, pn as ReferenceRecord, pr as SpaceFsCreateUploadResponse, ps as BoardChangeSummary, pt as CreateSpacePromptInput, q as BillingRedemptionResult, qn as SpaceCheckpointDetailResponse, qr as SpacePublicProfile, qt as PaletteOverviewSpaceRelation, ri as SpaceUsageHourlyStat, rn as PublicUserProfile, rr as SpaceConfigInput, rs as SpaceFsCopyStats, rt as CheckpointDiffPatchLine, si as TaskRunRecord, sn as ReferenceAggregateGroupBy, sr as SpaceDefaultResponse, st as CheckpointRecord, ti as SpaceTurnListItem, tn as PublicUserAppItem, tr as SpaceCommerceProductCreditBenefit, ts as SpaceFsCopyResult, tt as CheckpointDiffFileResponse, ui as UserActivityQuery, un as ReferenceKind, ur as SpaceFsCompleteUploadResponse, ut as CreateInvitationResponse, v as ApiError, vi as UserSessionSpaceSummary, vn as ReferralStatus, vr as SpaceFsFileResponse, vs as BoardPlaybackCommand, vt as CronJobUpdatePatch, w as BillingCatalog, wi as ChannelHealthReasonCode, wn as SessionMessageResponse, wr as SpaceFsTreeResponse, ws as BoardTransactionRecord, wt as GlobalSearchResponse, x as BillingBalanceActivityKind, xi as scopeListHasPermission, xn as SendMessageCronJobPayload, xr as SpaceFsReadFilesError, xs as BoardReadResult, xt as GenerationUsageHourlyStat, y as BatchUserProfilesResponse, yi as UserSessionsResponse, yn as ResourceLabelsResponse, yr as SpaceFsMoveInput, ys as BoardPlaybackSnapshot, yt as CursorPageInfo, z as BillingPluginStatus, zi as SessionTurnIndexItem, zn as SpaceActivityAppRanking, zr as SpaceListPage, zs as BoardSettings, zt as LabelResourceType } from "./chunks/environment.js";
|
|
2
|
-
import {
|
|
2
|
+
import { $i as SpaceStartupResponse, Gr as Fetch, Jr as HttpTransport, Kr as HttpError, Wr as CohubClientOptions, aa as PublicGenerationDeclaration, ca as CreateSpaceDecisionInput, da as DecisionState, ea as CreateGenerationTaskRequest, fa as DecisionStateImage, ia as ListGenerationModelsResponse, la as DecisionAnswer, n as createHttpClient, na as GenerationTaskResult, oa as ModelStatusEntry, pa as SpaceDecisionResult, ra as GenerationUsageBilling, sa as ModelStatusResponse, t as CohubHttpClient, ta as CreateGenerationTaskResponse, ua as DecisionQuestion } from "./chunks/http.js";
|
|
3
3
|
export { AcceptInvitationResponse, ApiError, BatchUserProfilesResponse, BillingBalanceActivity, BillingBalanceActivityKind, BillingBalanceActivityList, BillingBalanceActivityStatus, BillingCatalog, BillingCatalogProduct, BillingCheckoutActionState, BillingCheckoutConfirmation, BillingCheckoutResult, BillingConversionIntent, BillingCreditExpiryGroup, BillingCreditGrantStatus, BillingCreditStatus, BillingCreditUnit, BillingDiscountOffer, BillingDiscountOfferRef, BillingDiscountPricing, BillingHistoryPagination, BillingPaymentStatus, BillingPluginStatus, BillingProductBillingInterval, BillingProductCreditBenefit, BillingProductDisplay, BillingProductKind, BillingProductPricing, BillingProductPromotion, BillingPromotionCodePreview, BillingRedemptionResult, BillingResponsePayload, BillingSubscriptionHistoryList, BillingSubscriptionHistoryStatus, BillingSubscriptionSummary, type BoardAnimation, type BoardAnimationHeader, type BoardApplyInput, type BoardApplyResult, type BoardChangeSummary, type BoardColor, type BoardCreateInput, type BoardDelta, type BoardDiagnostic, type BoardDocument, type BoardHistoryInput, type BoardHistoryPage, type BoardItem, type BoardKeyframe, type BoardManifest, type BoardMarker, type BoardPatch, type BoardPlaybackCommand, type BoardPlaybackSnapshot, type BoardReadInput, type BoardReadResult, type BoardRecord, type BoardSettings, type BoardSnapshot, type BoardStyle, type BoardTrack, type BoardTransactionRecord, Channel, type ChannelConfig, type ChannelHealth, type ChannelHealthReasonCode, type ChannelRuntimeState, CheckpointDiffDelivery, CheckpointDiffFile, CheckpointDiffFileResponse, CheckpointDiffPatchKind, CheckpointDiffPatchLine, CheckpointDiffStats, CheckpointDiffStatus, CheckpointDiffSummary, CheckpointRecord, ClaimReferralResponse, type CohubClientOptions, CohubHttpClient, type CompletionAssistantMessage, type CompletionImageInput, type CompletionMessage, type CompletionMessageInput, type CompletionMessageRole, type CompletionThinkingLevel, type CompletionUsage, type ContentBlock, type CreateGenerationTaskRequest, type CreateGenerationTaskResponse, CreateInvitationInput, CreateInvitationResponse, type CreateSpaceCompletionInput, type CreateSpaceDecisionInput, CreateSpaceInput, CreateSpaceModInput, CreateSpacePromptInput, CreateSpacePromptResponse, CreateSpaceSessionInput, CronJobPayload, CronJobRecord, CronJobUpdatePatch, CursorPageInfo, type DecisionAnswer, type DecisionQuestion, type DecisionState, type DecisionStateImage, type DiscordChannelConfig, type ExecutionStats, type FeishuChannelConfig, type Fetch, type GenerationContentBlock, type GenerationPolicy, type GenerationResult, type GenerationTaskResult, type GenerationUsageBilling, GenerationUsageBlock, GenerationUsageHourlyStat, GenerationUsageSummary, GlobalSearchChatHit, GlobalSearchResponse, GlobalSearchResult, GlobalSearchType, GlobalSearchViewerRelation, HttpError, HttpTransport, InvitationDetail, JsonObject, JsonPrimitive, JsonValue, LabelAssignmentListItem, LabelAssignmentPageInfo, LabelAssignmentRecord, LabelItemsResponse, LabelItemsSessionFork, LabelListItem, LabelRecord, LabelResourceType, LabelScopeType, LabelSource, type ListGenerationModelsResponse, MeResponse, type MessageRecord, type MessageToolCallsFile, ModelCatalogEntry, type ModelStatusEntry, type ModelStatusResponse, type ModelThinkingLevel, PERMISSIONS, PaletteOverviewResponse, PaletteOverviewSpace, PaletteOverviewSpaceRelation, PatchResourceLabelsInput, PatchResourceLabelsResponse, Permission, PromptAccessMode, PromptTemplateCatalogEntry, PromptTemplateCatalogResponse, type PublicGenerationDeclaration, PublicReferral, PublicUserAppItem, PublicUserPageResponse, PublicUserProfile, PublicUserSpaceItem, PublicUserWorkItem, ReferenceAggregateGroup, ReferenceAggregateGroupBy, ReferenceAggregateResponse, ReferenceDirection, ReferenceKind, ReferenceQueryResponse, ReferenceQueryableType, ReferenceRecord, ReferenceResourceType, ReferralDashboard, ReferralListItem, ReferralReward, ReferralStatus, type RequestMetric, ResourceLabelsResponse, SandboxSpecId, type SearchTextRange, SendMessageCronJobPayload, SessionBindingRecord, type SessionFileChangeKind, type SessionFileRecord, type SessionFilesResponse, type SessionForkRecord, SessionListFork, SessionMessageResponse, SessionMessagesPaginatedResponse, SessionMessagesResponse, SessionRecord, type SessionStats, type SessionTurnIndexItem, SessionTurnIndexResponse, type SessionTurnRecord, SessionTurnResponse, type SessionTurnSegmentRecord, SessionTurnSignedUrlsResponse, SessionTurnStreamSnapshotResponse, SessionTurnWindowResponse, SessionTurnsPaginatedResponse, SkillCatalogEntry, SkillCatalogResponse, SkillCatalogSource, SpaceAccess, SpaceAccessPolicy, SpaceActivityAppRanking, SpaceActivityContributor, SpaceActivityResponse, SpaceBootstrapMeta, SpaceBootstrapSource, SpaceBootstrapStage, SpaceBootstrapStatus, SpaceChannelBindingInput, SpaceCheckpointDetailResponse, SpaceCommerceBenefit, SpaceCommerceBuyerProfile, SpaceCommerceCreditsBenefit, SpaceCommerceFeatureBenefit, SpaceCommerceOrder, SpaceCommerceProduct, SpaceCommerceProductBenefitBinding, SpaceCommerceProductCreditBenefit, type SpaceCompletionResult, type SpaceCompletionStreamEvent, SpaceConfig, SpaceConfigInput, SpaceConfigResponse, SpaceConfigUpdateResponse, SpaceCreateResponse, type SpaceDecisionResult, SpaceDefaultResponse, SpaceEnvInput, SpaceFsCompleteUploadInput, SpaceFsCompleteUploadResponse, type SpaceFsCopyError, type SpaceFsCopyInput, type SpaceFsCopyOptions, type SpaceFsCopyResponse, type SpaceFsCopyResult, type SpaceFsCopySource, type SpaceFsCopyStats, type SpaceFsCopyStatus, 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, SpaceListFilter, SpaceListItem, SpaceListOptions, SpaceListPage, SpaceMember, SpaceMeta, SpaceModListItem, SpacePendingDiffFileResponse, SpacePendingDiffSummary, SpacePresenceSnapshot, SpacePresenceUser, SpacePublicProfile, SpaceRecord, SpaceRole, SpaceSandboxAutoDestroyPolicy, SpaceSandboxConfig, SpaceSandboxProvider, SpaceSessionsResponse, type SpaceStartupResponse, SpaceTurnAuthorFilter, SpaceTurnListItem, SpaceTurnsResponse, SpaceUsageHourlyStat, SpaceUsageResponse, SpaceUsageSummary, type StoredIntermediateMessage, type StoredToolCall, type TaskRunBoard, TaskRunDetailResponse, TaskRunRecord, type TurnIntermediateMessagesFile, type TurnMetrics, USER_LEVEL_PERMISSIONS, UsageTotals, UserActivityQuery, UserActivityRange, UserActivityRankings, UserActivityResponse, UserProfile, UserRulesResponse, UserSessionListItem, UserSessionSourceKey, UserSessionSpaceSummary, UserSessionsResponse, createHttpClient, isUserLevelPermission, scopeListHasPermission };
|