@neta-art/cohub 3.0.0 → 3.2.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/README.md +33 -2
- package/dist/{board.d.ts → board/animation.d.ts} +4 -2
- package/dist/{chunks/board.js → board/animation.js} +5 -44
- package/dist/board/codec.d.ts +25 -0
- package/dist/board/codec.js +252 -0
- package/dist/board/core/bindings.d.ts +45 -0
- package/dist/board/core/bindings.js +162 -0
- package/dist/board/core/draw-geometry.d.ts +31 -0
- package/dist/board/core/draw-geometry.js +183 -0
- package/dist/board/core/export-assets.d.ts +14 -0
- package/dist/board/core/export-assets.js +22 -0
- package/dist/board/core/export-plan.d.ts +84 -0
- package/dist/board/core/export-plan.js +128 -0
- package/dist/board/core/file-preview.d.ts +176 -0
- package/dist/board/core/file-preview.js +271 -0
- package/dist/board/core/palette.d.ts +42 -0
- package/dist/board/core/palette.js +138 -0
- package/dist/board/core/shape-definition.d.ts +35 -0
- package/dist/board/core/shape-definition.js +64 -0
- package/dist/board/core/shape-types.d.ts +144 -0
- package/dist/board/core/shape-types.js +27 -0
- package/dist/board/core/text-metrics.d.ts +18 -0
- package/dist/board/core/text-metrics.js +43 -0
- package/dist/board/export/index.d.ts +56 -0
- package/dist/board/export/index.js +86 -0
- package/dist/board/export/scene.d.ts +35 -0
- package/dist/board/export/scene.js +69 -0
- package/dist/board/geometry.d.ts +131 -0
- package/dist/board/geometry.js +468 -0
- package/dist/board/headless/index.d.ts +69 -0
- package/dist/board/headless/index.js +150 -0
- package/dist/board/image-key.d.ts +19 -0
- package/dist/board/image-key.js +34 -0
- package/dist/board/index.d.ts +16 -0
- package/dist/board/index.js +16 -0
- package/dist/board/render/index.d.ts +6 -0
- package/dist/board/render/index.js +6 -0
- package/dist/board/render/palette.d.ts +5 -0
- package/dist/board/render/palette.js +30 -0
- package/dist/board/render/renderers/arrow-card-renderer.d.ts +5 -0
- package/dist/board/render/renderers/arrow-card-renderer.js +157 -0
- package/dist/board/render/renderers/base-card-renderer.d.ts +46 -0
- package/dist/board/render/renderers/base-card-renderer.js +153 -0
- package/dist/board/render/renderers/board-renderer-registry.d.ts +85 -0
- package/dist/board/render/renderers/board-renderer-registry.js +43 -0
- package/dist/board/render/renderers/draw-card-renderer.d.ts +5 -0
- package/dist/board/render/renderers/draw-card-renderer.js +82 -0
- package/dist/board/render/renderers/far-plate.d.ts +39 -0
- package/dist/board/render/renderers/far-plate.js +92 -0
- package/dist/board/render/renderers/file-card-renderer.d.ts +33 -0
- package/dist/board/render/renderers/file-card-renderer.js +371 -0
- package/dist/board/render/renderers/frame-card-renderer.d.ts +5 -0
- package/dist/board/render/renderers/frame-card-renderer.js +99 -0
- package/dist/board/render/renderers/geo-card-renderer.d.ts +5 -0
- package/dist/board/render/renderers/geo-card-renderer.js +128 -0
- package/dist/board/render/renderers/image-card-renderer.d.ts +8 -0
- package/dist/board/render/renderers/image-card-renderer.js +138 -0
- package/dist/board/render/renderers/note-card-renderer.d.ts +5 -0
- package/dist/board/render/renderers/note-card-renderer.js +112 -0
- package/dist/board/render/renderers/text-card-renderer.d.ts +7 -0
- package/dist/board/render/renderers/text-card-renderer.js +94 -0
- package/dist/board/render/renderers/unknown-card-renderer.d.ts +5 -0
- package/dist/board/render/renderers/unknown-card-renderer.js +102 -0
- package/dist/board/render/renderers/video-card-renderer.d.ts +7 -0
- package/dist/board/render/renderers/video-card-renderer.js +146 -0
- package/dist/board/render/text-measurement.d.ts +30 -0
- package/dist/board/render/text-measurement.js +57 -0
- package/dist/board/render/text-resolution.d.ts +16 -0
- package/dist/board/render/text-resolution.js +43 -0
- package/dist/board/render/themes/board-theme-registry.d.ts +20 -0
- package/dist/board/render/themes/board-theme-registry.js +13 -0
- package/dist/board/render/themes/clean-theme.d.ts +5 -0
- package/dist/board/render/themes/clean-theme.js +102 -0
- package/dist/chunks/http.d.ts +10 -40
- package/dist/chunks/http.js +26 -4
- package/dist/chunks/transport.js +4 -2
- package/dist/chunks/websocket.d.ts +832 -21
- package/dist/chunks/websocket.js +19 -2
- package/dist/http.d.ts +2 -3
- package/dist/index.d.ts +100 -5
- package/dist/index.js +391 -1
- package/dist/protocol/dist/board-constants.d.ts +23 -0
- package/dist/protocol/dist/board-constants.js +60 -0
- package/dist/protocol/dist/board-document.d.ts +1124 -0
- package/dist/protocol/dist/board-document.js +331 -0
- package/dist/protocol/dist/board.d.ts +186 -0
- package/dist/protocol/dist/board.js +207 -0
- package/dist/protocol/dist/index.d.ts +5 -0
- package/dist/protocol/dist/index.js +5 -0
- package/dist/protocol/dist/provenance.js +12 -0
- package/dist/protocol/dist/realtime/board-awareness.d.ts +1 -0
- package/dist/protocol/dist/realtime/board-awareness.js +117 -0
- package/dist/protocol/dist/realtime/types.d.ts +2 -0
- package/package.json +39 -4
- package/dist/board.js +0 -2
- package/dist/chunks/board.d.ts +0 -2589
package/dist/chunks/http.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $ as CreateSpacePromptInput, $r as BoardTransactionAppliedEvent$1, Ar as UserSessionsResponse, At as ModelCatalogEntry, Bn as SpaceFsCreateUploadResponse, Cn as SpaceCommerceBuyerProfile, Dn as SpaceCommerceProduct, Dr as UserRulesResponse, En as SpaceCommerceOrder, Er as UserProfile, Et as LabelResourceType, Fn as SpaceDefaultResponse, Gn as SpaceFsMoveInput, Gt as ReferenceDirection, In as SpaceEnvInput, It as PromptTemplateCatalogResponse, J as ClaimReferralResponse, Jt as ReferenceQueryableType, K as CheckpointDiffSummary, Kn as SpaceFsPreparingFile, Kt as ReferenceKind, Ln as SpaceFsCompleteUploadInput, Lt as PublicReferral, Mn as SpaceConfigResponse, Mr as ChannelHealth, Mt as PatchResourceLabelsResponse, Nn as SpaceConfigUpdateResponse, Nt as Permission, On as SpaceCommerceProductBenefitBinding, Pn as SpaceCreateResponse, Qr as BoardPlaybackChangedEvent$1, R as Channel, Rn as SpaceFsCompleteUploadResponse, Rt as PublicUserPageResponse, Si as BillingPayload, Sn as SpaceCommerceBenefit, Sr as SpaceUsageResponse, St as LabelItemsResponse, Tr as TaskRunRecord, Ut as ReferenceAggregateGroupBy, V as CheckpointDiffFileResponse, Wn as SpaceFsFileResponse, Wt as ReferenceAggregateResponse, X as CreateInvitationResponse, Xn as SpaceFsTreeResponse, Xr as GenerationModelDeclaration, Y as CreateInvitationInput, Yn as SpaceFsReadFilesResponse, Yr as GenerationContentBlock, Z as CreateSpaceInput, Zt as ReferralDashboard, a as WebsocketClientOptions, ai as SpacePublicEndpoints, an as SessionMessageResponse, ar as SpaceInvitation, at as CursorPageInfo, bi as Usage, br as SpaceSessionsResponse, cn as SessionRecord, d as BatchUserProfilesResponse, dn as SessionTurnSignedUrlsResponse, dr as SpacePendingDiffSummary, et as CreateSpacePromptResponse, fn as SessionTurnStreamSnapshotResponse, fr as SpacePresenceSnapshot, ft as GlobalSearchResponse, gi as CreateSpaceCompletionInput, gn as SkillCatalogResponse, gr as SpaceRole, hr as SpaceRecord, ht as InvitationDetail, ii as SessionTurnPatchEvent, ir as SpaceFsWriteFileInput, it as CronJobUpdatePatch, jn as SpaceConfigInput, jr as ChannelConfig, jt as PatchResourceLabelsInput, kt as MeResponse, l as AcceptInvitationResponse, ln as SessionTurnIndexResponse, lr as SpaceModListItem, mn as SessionTurnsPaginatedResponse, mr as SpacePublicProfile, mt as GlobalSearchType, ni as RealtimePatchOperation, oi as MessageRecord, on as SessionMessagesPaginatedResponse, pn as SessionTurnWindowResponse, q as CheckpointRecord, qt as ReferenceQueryResponse, r as WebsocketClient, rr as SpaceFsUploadResponse, rt as CronJobRecord, s as WebsocketEventPayload, si as SessionForkRecord, sn as SessionMessagesResponse, sr as SpaceMember, tt as CreateSpaceSessionInput, ui as SessionTurnRecord, un as SessionTurnResponse, ur as SpacePendingDiffFileResponse, vi as SpaceCompletionResult, vn as SpaceAccessPolicy, wr as TaskRunDetailResponse, wt as LabelListItem, xi as ContentBlock, xn as SpaceCheckpointDetailResponse, xt as LabelAssignmentRecord, yi as SpaceCompletionStreamEvent, zn as SpaceFsCreateUploadInput } from "./websocket.js";
|
|
1
|
+
import { $ as CreateSpacePromptInput, $r as BoardPlaybackChangedEvent$1, Ai as BoardValidationResult, Ar as UserSessionsResponse, At as ModelCatalogEntry, Bn as SpaceFsCreateUploadResponse, Cn as SpaceCommerceBuyerProfile, Dn as SpaceCommerceProduct, Dr as UserRulesResponse, En as SpaceCommerceOrder, Er as UserProfile, Et as LabelResourceType, Fi as SessionForkRecord, Fn as SpaceDefaultResponse, Gn as SpaceFsMoveInput, Gt as ReferenceDirection, In as SpaceEnvInput, It as PromptTemplateCatalogResponse, J as ClaimReferralResponse, Ji as Usage, Jt as ReferenceQueryableType, K as CheckpointDiffSummary, Ki as SpaceCompletionResult, Kn as SpaceFsPreparingFile, Kt as ReferenceKind, Ln as SpaceFsCompleteUploadInput, Lt as PublicReferral, Mn as SpaceConfigResponse, Mr as ChannelHealth, Mt as PatchResourceLabelsResponse, Ni as SpacePublicEndpoints, Nn as SpaceConfigUpdateResponse, Nt as Permission, On as SpaceCommerceProductBenefitBinding, Pi as MessageRecord, Pn as SpaceCreateResponse, Qr as BoardAwarenessUpdatedEvent$1, R as Channel, Ri as SessionTurnRecord, Rn as SpaceFsCompleteUploadResponse, Rt as PublicUserPageResponse, Sn as SpaceCommerceBenefit, Sr as SpaceUsageResponse, St as LabelItemsResponse, Ti as BoardPlaybackSnapshot, Tr as TaskRunRecord, Ut as ReferenceAggregateGroupBy, V as CheckpointDiffFileResponse, Wi as CreateSpaceCompletionInput, Wn as SpaceFsFileResponse, Wt as ReferenceAggregateResponse, X as CreateInvitationResponse, Xi as ContentBlock, Xn as SpaceFsTreeResponse, Xr as GenerationModelDeclaration, Y as CreateInvitationInput, Yi as BillingPayload, Yn as SpaceFsReadFilesResponse, Yr as GenerationContentBlock, Z as CreateSpaceInput, Zt as ReferralDashboard, a as WebsocketClientOptions, ai as SessionTurnPatchEvent, an as SessionMessageResponse, ar as SpaceInvitation, at as CursorPageInfo, br as SpaceSessionsResponse, cn as SessionRecord, d as BatchUserProfilesResponse, di as BoardBootstrap, dn as SessionTurnSignedUrlsResponse, dr as SpacePendingDiffSummary, ea as RequestSource, ei as BoardTransactionAppliedEvent$1, et as CreateSpacePromptResponse, fi as BoardCapabilities, fn as SessionTurnStreamSnapshotResponse, fr as SpacePresenceSnapshot, ft as GlobalSearchResponse, gn as SkillCatalogResponse, gr as SpaceRole, hr as SpaceRecord, ht as InvitationDetail, ir as SpaceFsWriteFileInput, it as CronJobUpdatePatch, jn as SpaceConfigInput, jr as ChannelConfig, jt as PatchResourceLabelsInput, ki as BoardTransaction, kt as MeResponse, l as AcceptInvitationResponse, li as BoardAwarenessUpdate, ln as SessionTurnIndexResponse, lr as SpaceModListItem, mi as BoardCreateInput, mn as SessionTurnsPaginatedResponse, mr as SpacePublicProfile, mt as GlobalSearchType, on as SessionMessagesPaginatedResponse, pn as SessionTurnWindowResponse, q as CheckpointRecord, qi as SpaceCompletionStreamEvent, qt as ReferenceQueryResponse, r as WebsocketClient, ri as RealtimePatchOperation, rr as SpaceFsUploadResponse, rt as CronJobRecord, s as WebsocketEventPayload, sn as SessionMessagesResponse, sr as SpaceMember, tt as CreateSpaceSessionInput, un as SessionTurnResponse, ur as SpacePendingDiffFileResponse, vi as BoardInspectInput, vn as SpaceAccessPolicy, wi as BoardPlaybackCommand, wr as TaskRunDetailResponse, wt as LabelListItem, xn as SpaceCheckpointDetailResponse, xt as LabelAssignmentRecord, zn as SpaceFsCreateUploadInput } from "./websocket.js";
|
|
3
2
|
import { n as CohubEnvironment } from "./environment.js";
|
|
4
3
|
import { a as VoiceInputCreateOptions } from "./voice-input.js";
|
|
5
4
|
//#region ../protocol/dist/model/status.d.ts
|
|
@@ -161,41 +160,6 @@ type SpaceStartupResponse = {
|
|
|
161
160
|
retryAfterMs?: number;
|
|
162
161
|
};
|
|
163
162
|
//#endregion
|
|
164
|
-
//#region ../protocol/dist/provenance.d.ts
|
|
165
|
-
/** Request provenance via X-Cohub-Source-* headers. Never used for authorization. */
|
|
166
|
-
declare const COHUB_SOURCE_HEADER: {
|
|
167
|
-
readonly space: "X-Cohub-Source-Space";
|
|
168
|
-
readonly session: "X-Cohub-Source-Session";
|
|
169
|
-
readonly turn: "X-Cohub-Source-Turn";
|
|
170
|
-
readonly toolCall: "X-Cohub-Source-Tool-Call";
|
|
171
|
-
readonly via: "X-Cohub-Source-Via";
|
|
172
|
-
};
|
|
173
|
-
type RequestSourceVia = "cli" | "bash" | "tool" | "api" | "web" | (string & {});
|
|
174
|
-
/** Caller context: via (channel) and optional identity fields. */
|
|
175
|
-
type RequestSource = {
|
|
176
|
-
spaceId?: string;
|
|
177
|
-
sessionId?: string;
|
|
178
|
-
turnId?: string;
|
|
179
|
-
toolCallId?: string;
|
|
180
|
-
via?: RequestSourceVia;
|
|
181
|
-
};
|
|
182
|
-
declare const isRequestSourceUuid: (value: unknown) => value is string;
|
|
183
|
-
declare const REQUEST_SOURCE_VIA_MAX_LENGTH = 64;
|
|
184
|
-
declare const isRequestSourceEmpty: (source: RequestSource | null | undefined) => boolean;
|
|
185
|
-
declare const hasRequestSourceIdentity: (source: RequestSource | null | undefined) => boolean;
|
|
186
|
-
/** Drop invalid UUIDs; via-only is valid. */
|
|
187
|
-
declare const normalizeRequestSource: (input: unknown) => RequestSource | null;
|
|
188
|
-
declare const parseRequestSourceFromHeaders: (getHeader: (name: string) => string | null | undefined) => RequestSource | null;
|
|
189
|
-
declare const requestSourceToHeaders: (source: RequestSource | null | undefined) => Record<string, string>;
|
|
190
|
-
/** Read COHUB_* env into a RequestSource. */
|
|
191
|
-
declare const readRequestSourceFromEnv: (env?: Record<string, string | undefined>, defaults?: {
|
|
192
|
-
via?: RequestSourceVia;
|
|
193
|
-
}) => RequestSource | null;
|
|
194
|
-
declare const resolveRequestSourceChannel: (source: RequestSource | null | undefined, fallback?: string) => string;
|
|
195
|
-
/** Put identity under meta.source; strip body source. Via-only is skipped. */
|
|
196
|
-
declare const mergeRequestSourceIntoMeta: (meta: Record<string, unknown> | null | undefined, headerSource: RequestSource | null | undefined) => Record<string, unknown> | null;
|
|
197
|
-
declare const COHUB_SOURCE_HEADER_NAMES: readonly string[];
|
|
198
|
-
//#endregion
|
|
199
163
|
//#region src/work-runtime.d.ts
|
|
200
164
|
type WorkRuntimeContext = {
|
|
201
165
|
work: {
|
|
@@ -898,12 +862,14 @@ declare class BoardTransactionError extends Error {
|
|
|
898
862
|
}
|
|
899
863
|
type BoardTransactionInput = Omit<BoardTransaction, "boardId">;
|
|
900
864
|
type BoardTransactionAppliedEvent = BoardTransactionAppliedEvent$1;
|
|
865
|
+
type BoardAwarenessUpdatedEvent = BoardAwarenessUpdatedEvent$1;
|
|
901
866
|
type BoardPlaybackChangedEvent = BoardPlaybackChangedEvent$1;
|
|
902
|
-
type BoardEventName = "transaction" | "playback";
|
|
867
|
+
type BoardEventName = "transaction" | "awareness" | "playback";
|
|
903
868
|
type BoardSubscriptionHandlers = {
|
|
904
869
|
transaction?: (event: BoardTransactionAppliedEvent) => void;
|
|
870
|
+
awareness?: (event: BoardAwarenessUpdatedEvent) => void;
|
|
905
871
|
playback?: (event: BoardPlaybackChangedEvent) => void;
|
|
906
|
-
event?: (event: BoardTransactionAppliedEvent | BoardPlaybackChangedEvent) => void;
|
|
872
|
+
event?: (event: BoardTransactionAppliedEvent | BoardAwarenessUpdatedEvent | BoardPlaybackChangedEvent) => void;
|
|
907
873
|
};
|
|
908
874
|
type SessionSubscriptionHandlers = {
|
|
909
875
|
patch?: (event: WebsocketEventPayload) => void;
|
|
@@ -1382,11 +1348,13 @@ declare class BoardRealtimeClient {
|
|
|
1382
1348
|
constructor(websocketClient: WebsocketClient | null, spaceId: string, boardId: string);
|
|
1383
1349
|
subscribe(handlers: BoardSubscriptionHandlers): () => void;
|
|
1384
1350
|
on(type: "transaction", handler: (event: BoardTransactionAppliedEvent) => void): () => void;
|
|
1351
|
+
on(type: "awareness", handler: (event: BoardAwarenessUpdatedEvent) => void): () => void;
|
|
1385
1352
|
on(type: "playback", handler: (event: BoardPlaybackChangedEvent) => void): () => void;
|
|
1386
1353
|
}
|
|
1387
1354
|
declare class BoardClient {
|
|
1388
1355
|
readonly spaceId: string;
|
|
1389
1356
|
readonly id: string;
|
|
1357
|
+
private readonly websocketClient;
|
|
1390
1358
|
readonly realtime: BoardRealtimeClient;
|
|
1391
1359
|
private readonly boards;
|
|
1392
1360
|
constructor(spaceId: string, id: string, transport: HttpTransport, websocketClient: WebsocketClient | null);
|
|
@@ -1394,6 +1362,7 @@ declare class BoardClient {
|
|
|
1394
1362
|
capabilities(customFetch?: Fetch): Promise<BoardCapabilities>;
|
|
1395
1363
|
validate(transaction: BoardTransactionInput): Promise<BoardValidationResult>;
|
|
1396
1364
|
apply(transaction: BoardTransactionInput): Promise<BoardBootstrap>;
|
|
1365
|
+
updateAwareness(seq: number, update: BoardAwarenessUpdate): Promise<void>;
|
|
1397
1366
|
playback(command: BoardPlaybackCommand): Promise<BoardPlaybackSnapshot>;
|
|
1398
1367
|
play(command: Omit<Extract<BoardPlaybackCommand, {
|
|
1399
1368
|
type: "play";
|
|
@@ -1411,6 +1380,7 @@ declare class BoardClient {
|
|
|
1411
1380
|
}>): Promise<BoardPlaybackSnapshot>;
|
|
1412
1381
|
subscribe(handlers: BoardSubscriptionHandlers): () => void;
|
|
1413
1382
|
on(type: "transaction", handler: (event: BoardTransactionAppliedEvent) => void): () => void;
|
|
1383
|
+
on(type: "awareness", handler: (event: BoardAwarenessUpdatedEvent) => void): () => void;
|
|
1414
1384
|
on(type: "playback", handler: (event: BoardPlaybackChangedEvent) => void): () => void;
|
|
1415
1385
|
}
|
|
1416
1386
|
declare class SpaceBoardsApi {
|
|
@@ -1910,4 +1880,4 @@ declare class CohubHttpClient {
|
|
|
1910
1880
|
}
|
|
1911
1881
|
declare const createHttpClient: (options?: CohubClientOptions) => CohubHttpClient;
|
|
1912
1882
|
//#endregion
|
|
1913
|
-
export {
|
|
1883
|
+
export { GenerationStreamEvent as $, createWorkRuntime as $t, ReferralsApi as A, PromptsApi as At, BoardTransactionError as B, joinApiUrl as Bt, WorkSessionResponse as C, PublicAssetMimeType as Ct, WorkVersionRecord as D, UploadChatImageAttachmentInput as Dt, WorkUpdateInput as E, UploadChatAttachmentInput as Et, BoardClient as F, CohubClientOptions as Ft, SpaceClient as G, WorkRuntimeApi as Gt, SessionEventName as H, ParentBridgeTransport as Ht, BoardEventName as I, Fetch as It, WebSocketConnectionState as J, WorkRuntimeContext as Jt, SpaceEventName as K, WorkRuntimeCheckoutState as Kt, BoardPlaybackChangedEvent as L, HttpError as Lt, UserApi as M, GenerationsApi as Mt, TasksApi as N, CronJobsApi as Nt, WorkVisibility as O, UploadPublicAssetInput as Ot, BoardAwarenessUpdatedEvent as P, ChannelsApi as Pt, GenerationStreamErrorEvent as Q, createSlugWorkIdResolver as Qt, BoardSubscriptionHandlers as R, HttpTransport as Rt, WorkResolveResponse as S, CreatePublicAssetUploadResponse as St, WorkTargetType as T, PublicAssetsApi as Tt, SessionSubscriptionHandlers as U, PopupBrokerTransport as Ut, BoardTransactionInput as V, sanitizeAccessToken as Vt, SpaceChannelBindingRecord as W, WorkIdResolver as Wt, AssistantMessageCommit as X, WorkRuntimeRequestOptions as Xt, PublicInviteApi as Y, WorkRuntimeModeConfig as Yt, GenerationStreamCommitEvent as Z, WorkRuntimeTransport as Zt, WorkMeta as _, SessionAccessApi as _t, WorkCommerceCreditConsumeResponse as a, GenerationUsageBilling as an, GenerationStreamSubscribeOptions as at, WorkPublicSpaceRecord as b, SearchApi as bt, WorkCommerceEntitlementsResponse as c, ModelStatusEntry as cn, SessionGenerationStreamClient as ct, WorkCommercePurchaseResponse as d, SessionPatchApplyInput as dt, resolveWorkTransport as en, GenerationStreamFinalizedEvent as et, WorkAuthorizeResponse as f, SessionPatchApplyResult as ft, WorkGetResponse as g, createSessionPatchReducer as gt, WorkExtractedPageMeta as h, SessionPatchStatus as ht, WorkCommerceCheckoutStatus as i, GenerationTaskResult as in, GenerationStreamStateEvent as it, UsersApi as j, ModelsApi as jt, WorksApi as k, SkillsApi as kt, WorkCommerceOrder as l, ModelStatusResponse as ln, createSessionGenerationStreamClient as lt, WorkDetailResponse as m, SessionPatchState as mt, createHttpClient as n, CreateGenerationTaskRequest as nn, GenerationStreamLifecycleEvent as nt, WorkCommerceCreditConsumeStatus as o, ListGenerationModelsResponse as on, GenerationStreamSubscriptionHandlers as ot, WorkCreateInput as p, SessionPatchReducer as pt, SpacesApi as q, WorkRuntimeCheckoutStatus as qt, WorkCommerceApi as r, CreateGenerationTaskResponse as rn, GenerationStreamOutOfSyncEvent as rt, WorkCommerceEntitlement as s, PublicGenerationDeclaration as sn, GenerationStreamTurnUpdatedEvent as st, CohubHttpClient as t, SpaceStartupResponse as tn, GenerationStreamIntermediateMessage as tt, WorkCommerceProductResolveResponse as u, parseAssistantMessageCommit as ut, WorkPresentationMeta as v, ReferenceResourceSelector as vt, WorkStatus as w, PublicAssetPurpose as wt, WorkRecord as x, CreatePublicAssetUploadInput as xt, WorkPublicOwnerRecord as y, ReferencesApi as yt, BoardTransactionAppliedEvent as z, RawHttpResponse as zt };
|
package/dist/chunks/http.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as HttpTransport, t as HttpError,
|
|
1
|
+
import { b as getRealtimeBoardRoom, n as HttpTransport, t as HttpError, x as getRealtimeSpaceRoom } from "./transport.js";
|
|
2
2
|
import { a as resolveApiBaseUrl } from "./environment.js";
|
|
3
3
|
//#region src/apis/channels.ts
|
|
4
4
|
var ChannelsApi = class {
|
|
@@ -2161,7 +2161,7 @@ var BoardRealtimeClient = class {
|
|
|
2161
2161
|
subscribe(handlers) {
|
|
2162
2162
|
if (!this.websocketClient) throw new Error("realtime transport is not configured for this client");
|
|
2163
2163
|
ensureRealtimeConnected(this.websocketClient);
|
|
2164
|
-
const releaseRoom = this.websocketClient.retainRooms([getRealtimeSpaceRoom(this.spaceId)]);
|
|
2164
|
+
const releaseRoom = this.websocketClient.retainRooms([getRealtimeSpaceRoom(this.spaceId), getRealtimeBoardRoom(this.boardId)]);
|
|
2165
2165
|
const unsubscribe = this.websocketClient.on("event", (event) => {
|
|
2166
2166
|
if (event.spaceId !== this.spaceId) return;
|
|
2167
2167
|
if (event.type === "board.transaction.applied" && event.payload.boardId === this.boardId) {
|
|
@@ -2169,6 +2169,13 @@ var BoardRealtimeClient = class {
|
|
|
2169
2169
|
handlers.event?.(transactionEvent);
|
|
2170
2170
|
handlers.transaction?.(transactionEvent);
|
|
2171
2171
|
}
|
|
2172
|
+
if (event.type === "board.awareness.updated" && event.payload.boardId === this.boardId) {
|
|
2173
|
+
const awarenessEvent = event;
|
|
2174
|
+
if (awarenessEvent.payload.connectionId !== this.websocketClient?.connectionId) {
|
|
2175
|
+
handlers.event?.(awarenessEvent);
|
|
2176
|
+
handlers.awareness?.(awarenessEvent);
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2172
2179
|
if (event.type === "board.playback.changed" && event.payload.boardId === this.boardId) {
|
|
2173
2180
|
const playbackEvent = event;
|
|
2174
2181
|
handlers.event?.(playbackEvent);
|
|
@@ -2181,17 +2188,21 @@ var BoardRealtimeClient = class {
|
|
|
2181
2188
|
};
|
|
2182
2189
|
}
|
|
2183
2190
|
on(type, handler) {
|
|
2184
|
-
|
|
2191
|
+
if (type === "transaction") return this.subscribe({ transaction: handler });
|
|
2192
|
+
if (type === "awareness") return this.subscribe({ awareness: handler });
|
|
2193
|
+
return this.subscribe({ playback: handler });
|
|
2185
2194
|
}
|
|
2186
2195
|
};
|
|
2187
2196
|
var BoardClient = class {
|
|
2188
2197
|
spaceId;
|
|
2189
2198
|
id;
|
|
2199
|
+
websocketClient;
|
|
2190
2200
|
realtime;
|
|
2191
2201
|
boards;
|
|
2192
2202
|
constructor(spaceId, id, transport, websocketClient) {
|
|
2193
2203
|
this.spaceId = spaceId;
|
|
2194
2204
|
this.id = id;
|
|
2205
|
+
this.websocketClient = websocketClient;
|
|
2195
2206
|
this.boards = new SpaceBoardsApi(transport, spaceId, websocketClient);
|
|
2196
2207
|
this.realtime = new BoardRealtimeClient(websocketClient, spaceId, id);
|
|
2197
2208
|
}
|
|
@@ -2213,6 +2224,15 @@ var BoardClient = class {
|
|
|
2213
2224
|
boardId: this.id
|
|
2214
2225
|
});
|
|
2215
2226
|
}
|
|
2227
|
+
updateAwareness(seq, update) {
|
|
2228
|
+
if (!this.websocketClient) return Promise.resolve();
|
|
2229
|
+
return this.websocketClient.updateBoardAwareness({
|
|
2230
|
+
spaceId: this.spaceId,
|
|
2231
|
+
boardId: this.id,
|
|
2232
|
+
seq,
|
|
2233
|
+
update
|
|
2234
|
+
});
|
|
2235
|
+
}
|
|
2216
2236
|
playback(command) {
|
|
2217
2237
|
return this.boards.playback(this.id, command);
|
|
2218
2238
|
}
|
|
@@ -2232,7 +2252,9 @@ var BoardClient = class {
|
|
|
2232
2252
|
return this.realtime.subscribe(handlers);
|
|
2233
2253
|
}
|
|
2234
2254
|
on(type, handler) {
|
|
2235
|
-
|
|
2255
|
+
if (type === "transaction") return this.realtime.on("transaction", handler);
|
|
2256
|
+
if (type === "awareness") return this.realtime.on("awareness", handler);
|
|
2257
|
+
return this.realtime.on("playback", handler);
|
|
2236
2258
|
}
|
|
2237
2259
|
};
|
|
2238
2260
|
var SpaceBoardsApi = class {
|
package/dist/chunks/transport.js
CHANGED
|
@@ -2,7 +2,9 @@ import { a as resolveApiBaseUrl } from "./environment.js";
|
|
|
2
2
|
//#region ../protocol/dist/realtime/types.js
|
|
3
3
|
const WS_COMPACT_STREAM_CAPABILITY = "session.compact_stream.v1";
|
|
4
4
|
const WS_ROOM_SUBSCRIPTION_CAPABILITY = "realtime.rooms.v1";
|
|
5
|
+
const WS_BOARD_AWARENESS_CAPABILITY = "board.awareness.v1";
|
|
5
6
|
const getRealtimeSpaceRoom = (spaceId) => `space:${spaceId}`;
|
|
7
|
+
const getRealtimeBoardRoom = (boardId) => `board:${boardId}`;
|
|
6
8
|
const parseRealtimeRoom = (room) => {
|
|
7
9
|
const trimmed = room.trim();
|
|
8
10
|
const separatorIndex = trimmed.indexOf(":");
|
|
@@ -10,7 +12,7 @@ const parseRealtimeRoom = (room) => {
|
|
|
10
12
|
const kind = trimmed.slice(0, separatorIndex);
|
|
11
13
|
const id = trimmed.slice(separatorIndex + 1).trim();
|
|
12
14
|
if (!id) return null;
|
|
13
|
-
if (kind !== "space" && kind !== "user") return null;
|
|
15
|
+
if (kind !== "space" && kind !== "user" && kind !== "board") return null;
|
|
14
16
|
return {
|
|
15
17
|
kind,
|
|
16
18
|
id
|
|
@@ -302,4 +304,4 @@ var HttpTransport = class {
|
|
|
302
304
|
}
|
|
303
305
|
};
|
|
304
306
|
//#endregion
|
|
305
|
-
export {
|
|
307
|
+
export { normalizeRealtimeRooms as C, getSessionTurnPatchStreamKey as S, WS_BOARD_AWARENESS_CAPABILITY as _, COHUB_SOURCE_HEADER as a, getRealtimeBoardRoom as b, hasRequestSourceIdentity as c, mergeRequestSourceIntoMeta as d, normalizeRequestSource as f, resolveRequestSourceChannel as g, requestSourceToHeaders as h, sanitizeAccessToken as i, isRequestSourceEmpty as l, readRequestSourceFromEnv as m, HttpTransport as n, COHUB_SOURCE_HEADER_NAMES as o, parseRequestSourceFromHeaders as p, joinApiUrl as r, REQUEST_SOURCE_VIA_MAX_LENGTH as s, HttpError as t, isRequestSourceUuid as u, WS_COMPACT_STREAM_CAPABILITY as v, getRealtimeSpaceRoom as x, WS_ROOM_SUBSCRIPTION_CAPABILITY as y };
|