@neta-art/cohub 5.3.2 → 5.4.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.
Files changed (44) hide show
  1. package/dist/board/codec.d.ts +2 -0
  2. package/dist/board/codec.js +18 -13
  3. package/dist/board/core/arrow-geometry.d.ts +23 -0
  4. package/dist/board/core/arrow-geometry.js +109 -0
  5. package/dist/board/core/connections.d.ts +83 -0
  6. package/dist/board/core/connections.js +399 -0
  7. package/dist/board/core/export-plan.d.ts +15 -4
  8. package/dist/board/core/export-plan.js +49 -16
  9. package/dist/board/core/shape-definition.js +1 -1
  10. package/dist/board/core/shape-types.d.ts +8 -2
  11. package/dist/board/core/shape-types.js +1 -1
  12. package/dist/board/core/tool-styles.d.ts +9 -3
  13. package/dist/board/core/tool-styles.js +10 -6
  14. package/dist/board/export/index.js +1 -0
  15. package/dist/board/export/scene.d.ts +3 -0
  16. package/dist/board/export/scene.js +18 -1
  17. package/dist/board/index.d.ts +8 -5
  18. package/dist/board/index.js +8 -5
  19. package/dist/board/render/connection-layer.d.ts +48 -0
  20. package/dist/board/render/connection-layer.js +223 -0
  21. package/dist/board/render/index.d.ts +2 -1
  22. package/dist/board/render/index.js +3 -2
  23. package/dist/board/render/renderers/arrow-card-renderer.js +35 -48
  24. package/dist/chunks/http.d.ts +53 -1
  25. package/dist/chunks/http.js +287 -1
  26. package/dist/chunks/websocket.d.ts +296 -57
  27. package/dist/http.d.ts +1 -1
  28. package/dist/index.d.ts +9 -3
  29. package/dist/index.js +22 -58
  30. package/dist/protocol/dist/board-connection.d.ts +310 -0
  31. package/dist/protocol/dist/board-connection.js +215 -0
  32. package/dist/protocol/dist/board-constants.d.ts +11 -1
  33. package/dist/protocol/dist/board-constants.js +15 -1
  34. package/dist/protocol/dist/board-document.d.ts +106 -60
  35. package/dist/protocol/dist/board-document.js +57 -17
  36. package/dist/protocol/dist/board.d.ts +1 -0
  37. package/dist/protocol/dist/board.js +3 -0
  38. package/dist/protocol/dist/index.d.ts +2 -1
  39. package/dist/protocol/dist/index.js +2 -1
  40. package/dist/protocol/dist/realtime/board-awareness.js +15 -15
  41. package/docs/work-runtime-guide.md +1 -1
  42. package/package.json +1 -1
  43. package/dist/board/core/bindings.d.ts +0 -45
  44. package/dist/board/core/bindings.js +0 -162
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as CreateSpacePromptInput, $a as readRequestSourceFromEnv, $i as BoardClip, $n as SpaceFsTreeResponse, $r as findGenerationModelPolicy, $t as SandboxSpecId, A as BillingProductDisplay, Aa as CompletionMessage, Ai as WorkContentKind, An as SpaceCommerceProductCreditBenefit, Ar as SpaceUsageResponse, At as Permission, B as CheckpointDiffFile, Ba as ContentBlock, Bi as UiCommandError, Bn as SpaceFsCreateDirectoryInput, Br as ChannelHealth, Bt as ReferenceAggregateGroupBy, C as BillingCreditStatus, Ca as MessageRecord, Ci as BoardAwarenessUpdate, Cn as SpaceCommerceBenefit, Cr as SpaceSandboxConfig, Ct as LabelResourceType, D as BillingPluginStatus, Da as SessionTurnRecord, Di as WorkArtifactManifestFile, Dn as SpaceCommerceOrder, Dr as SpaceTurnListItem, Dt as ModelCatalogEntry, E as BillingPaymentStatus, Ea as SessionTurnIndexItem, Ei as WorkArtifactManifest, En as SpaceCommerceFeatureBenefit, Er as SpaceTurnAuthorFilter, Et as MeResponse, F as BillingSubscriptionHistoryList, Fa as ModelThinkingLevel, Fi as UI_COMMAND_SETTLEMENT_GRACE_SECONDS, Fn as SpaceCreateResponse, Fr as UserRulesResponse, Ft as PublicUserPageResponse, G as CheckpointDiffStatus, Ga as RequestSourceVia, Gi as UiSurfaceRequest, Gn as SpaceFsEntry, Gr as GenerationModelPolicy, Gt as ReferenceQueryableType, H as CheckpointDiffPatchKind, Ha as COHUB_SOURCE_HEADER_NAMES, Hi as UiCommandStatus, Hn as SpaceFsCreateUploadResponse, Hr as ChannelRuntimeState, Ht as ReferenceDirection, I as BillingSubscriptionHistoryStatus, Ia as SpaceCompletionResult, Ii as UI_COMMAND_TERMINAL_TTL_SECONDS, In as SpaceDefaultResponse, Ir as UserSessionListItem, It as PublicUserProfile, J as ClaimReferralResponse, Ja as isRequestSourceEmpty, Ji as isUiSurfaceMethod, Jn as SpaceFsMoveInput, Jr as GenerationPolicyError, Jt as ReferralDashboard, K as CheckpointDiffSummary, Ka as hasRequestSourceIdentity, Ki as UiWorkPreviewTarget, Kn as SpaceFsFileKind, Kr as GenerationParameterConstraint, Kt as ReferenceRecord, L as BillingSubscriptionSummary, La as SpaceCompletionStreamEvent, Li as UI_COMMAND_VERSION, Ln as SpaceEnvInput, Lr as UserSessionSpaceSummary, Lt as PublicUserSpaceItem, M as BillingProductPricing, Ma as CompletionThinkingLevel, Mi as UI_COMMAND_MAX_TIMEOUT_MS, Mn as SpaceConfigInput, Mr as TaskRunDetailResponse, Mt as PromptTemplateCatalogEntry, N as BillingRedemptionResult, Na as CompletionUsage, Ni as UI_COMMAND_PAYLOAD_MAX_BYTES, Nn as SpaceConfigResponse, Nr as TaskRunRecord, Nt as PromptTemplateCatalogResponse, O as BillingProductBillingInterval, Oi as WorkBoardArtifactManifest, On as SpaceCommerceProduct, Or as SpaceTurnsResponse, Ot as PatchResourceLabelsInput, P as BillingResponsePayload, Pa as CreateSpaceCompletionInput, Pi as UI_COMMAND_PENDING_TTL_SECONDS, Pn as SpaceConfigUpdateResponse, Pr as UserProfile, Pt as PublicReferral, Q as CreateSpaceModInput, Qa as parseRequestSourceFromHeaders, Qi as BoardCapabilities, Qn as SpaceFsReadFilesResponse, Qr as filterGenerationDeclarationsByPolicy, Qt as ResourceLabelsResponse, R as Channel, Ri as UiCommand, Rn as SpaceFsCompleteUploadInput, Rr as UserSessionsResponse, Rt as PublicUserWorkItem, S as BillingCreditGrantStatus, Si as BoardAwarenessStateUpdate, Sn as SpaceCheckpointDetailResponse, Sr as SpaceSandboxAutoDestroyPolicy, St as LabelRecord, T as BillingHistoryPagination, Ta as SessionTurnSegmentRecord, Ti as WorkArtifactDownloadDescriptor, Tn as SpaceCommerceCreditsBenefit, Tr as SpaceSessionsResponse, Tt as LabelSource, U as CheckpointDiffPatchLine, Ua as REQUEST_SOURCE_VIA_MAX_LENGTH, Ui as UiPreviewShowCommand, Un as SpaceFsDeleteNodeInput, Ur as DiscordChannelConfig, Ut as ReferenceKind, V as CheckpointDiffFileResponse, Va as COHUB_SOURCE_HEADER, Vi as UiCommandRecord, Vn as SpaceFsCreateUploadInput, Vr as ChannelHealthReasonCode, Vt as ReferenceAggregateResponse, W as CheckpointDiffStats, Wa as RequestSource, Wi as UiPreviewTarget, Wn as SpaceFsEncoding, Wr as FeishuChannelConfig, Wt as ReferenceQueryResponse, X as CreateInvitationResponse, Xa as mergeRequestSourceIntoMeta, Xi as BoardAssetRef, Xn as SpaceFsReadFilesError, Xr as decodeGenerationPolicy, Xt as ReferralReward, Y as CreateInvitationInput, Ya as isRequestSourceUuid, Yi as parseUiCommand, Yn as SpaceFsPreparingFile, Yr as assertGenerationRequestAllowedByPolicy, Yt as ReferralListItem, Z as CreateSpaceInput, Za as normalizeRequestSource, Zi as BoardBootstrap, Zn as SpaceFsReadFilesInput, Zr as encodeGenerationPolicy, Zt as ReferralStatus, _ as BillingCatalogProduct, _a as BoardTransaction, _i as RealtimeWorkVersionRecord, _n as SpaceBootstrapMeta, _r as SpacePresenceSnapshot, _t as LabelAssignmentPageInfo, aa as BoardKeyframe, ai as GenerationResult, an as SessionRecord, ar as SpaceFsUploadProgress, at as CursorPageInfo, b as BillingConversionIntent, ba as BoardCapability, bi as BoardAwarenessGesture, bn as SpaceBootstrapStatus, br as SpaceRecord, bt as LabelItemsSessionFork, c as createWebsocketClient, ca as BoardNodeRecord, cn as SessionTurnSignedUrlsResponse, cr as SpaceInvitation, ct as GenerationUsageSummary, d as BatchUserProfilesResponse, da as BoardPlaybackPolicy, dn as SessionTurnsPaginatedResponse, dr as SpaceListItem, dt as GlobalSearchType, ea as BoardCreateInput, ei as getAllowedGenerationModelIds, en as SendMessageCronJobPayload, eo as requestSourceToHeaders, er as SpaceFsUploadDestination, et as CreateSpacePromptResponse, f as BillingBalanceActivity, fa as BoardPlaybackPolicySchema, fi as RealtimeRoomDescriptor, fn as SkillCatalogEntry, fr as SpaceMember, ft as InvitationDetail, g as BillingCatalog, ga as BoardTarget, gi as RealtimeWorkRecord, gn as SpaceAccessPolicy, gr as SpacePendingDiffSummary, gt as LabelAssignmentListItem, h as BillingBalanceActivityStatus, ha as BoardSequence, hi as RealtimeServerEvent, hn as SpaceAccess, hr as SpacePendingDiffFileResponse, ht as JsonValue, ia as BoardInspectInput, ii as GenerationModelDeclaration, in as SessionMessagesResponse, ir as SpaceFsUploadPlanEntryInput, it as CronJobUpdatePatch, j as BillingProductKind, ja as CompletionMessageRole, ji as UI_COMMAND_DEFAULT_TIMEOUT_MS, jn as SpaceConfig, jr as SpaceUsageSummary, jt as PromptAccessMode, k as BillingProductCreditBenefit, ka as CompletionAssistantMessage, ki as WorkBoardAsset, kn as SpaceCommerceProductBenefitBinding, kr as SpaceUsageHourlyStat, kt as PatchResourceLabelsResponse, l as AcceptInvitationResponse, la as BoardOperation, li as ChannelEnvelope, ln as SessionTurnStreamSnapshotResponse, lr as SpaceInvitationListResponse, lt as GlobalSearchResponse, m as BillingBalanceActivityList, ma as BoardRecord, mi as RealtimeRoomMember, mn as SkillCatalogSource, mr as SpaceModListItem, mt as JsonPrimitive, na as BoardDiagnostic, ni as parseGenerationPolicyFromEnv, nn as SessionMessageResponse, nr as SpaceFsUploadError, nt as CronJobPayload, oa as BoardManifest, on as SessionTurnIndexResponse, or as SpaceFsUploadResponse, ot as GenerationUsageBlock, p as BillingBalanceActivityKind, pa as BoardPlaybackSnapshot, pi as RealtimeRoomEvent, pn as SkillCatalogResponse, pr as SpaceMeta, pt as JsonObject, q as CheckpointRecord, qa as isRequestSourceClientId, qi as isTerminalUiCommandStatus, qn as SpaceFsFileResponse, qr as GenerationPolicy, qt as ReferenceResourceType, r as WebsocketClient, ra as BoardEffect, ri as GenerationContentBlock, rn as SessionMessagesPaginatedResponse, rr as SpaceFsUploadPlanEntry, rt as CronJobRecord, s as WebsocketEventPayload, sa as BoardNodeInput, sn as SessionTurnResponse, sr as SpaceFsWriteFileInput, st as GenerationUsageHourlyStat, ta as BoardDeleteReason, ti as normalizeGenerationPolicy, tn as SessionBindingRecord, to as resolveRequestSourceChannel, tr as SpaceFsUploadEntry, tt as CreateSpaceSessionInput, u as ApiError, ua as BoardPlaybackCommand, ui as LabelAssignmentsUpdatedEvent, un as SessionTurnWindowResponse, ur as SpaceInvitationLocation, ut as GlobalSearchResult, v as BillingCheckoutActionState, va as BoardValidationResult, vn as SpaceBootstrapSource, vr as SpacePresenceUser, vt as LabelAssignmentRecord, w as BillingCreditUnit, wa as SessionForkRecord, wi as WorkArtifactDescriptor, wn as SpaceCommerceBuyerProfile, wr as SpaceSandboxProvider, wt as LabelScopeType, x as BillingCreditExpiryGroup, xa as BoardRenderCost, xi as BoardAwarenessNodePreview, xn as SpaceChannelBindingInput, xr as SpaceRole, xt as LabelListItem, y as BillingCheckoutResult, ya as parseBoardPlaybackPolicy, yi as WorkVersionPublishedEvent, yn as SpaceBootstrapStage, yr as SpacePublicProfile, yt as LabelItemsResponse, z as CheckpointDiffDelivery, zi as UiCommandDispatchedPayload, zn as SpaceFsCompleteUploadResponse, zr as ChannelConfig, zt as ReferenceAggregateGroup } from "./chunks/websocket.js";
1
+ import { $ as CreateSpacePromptInput, $a as mergeRequestSourceIntoMeta, $i as BoardClip, $n as SpaceFsTreeResponse, $r as findGenerationModelPolicy, $t as SandboxSpecId, A as BillingProductDisplay, Aa as SessionTurnRecord, Ai as WorkContentKind, An as SpaceCommerceProductCreditBenefit, Ar as SpaceUsageResponse, At as Permission, B as CheckpointDiffFile, Ba as SpaceCompletionStreamEvent, Bi as UiCommandError, Bn as SpaceFsCreateDirectoryInput, Br as ChannelHealth, Bt as ReferenceAggregateGroupBy, C as BillingCreditStatus, Ca as BoardCapability, Ci as BoardAwarenessUpdate, Cn as SpaceCommerceBenefit, Cr as SpaceSandboxConfig, Ct as LabelResourceType, D as BillingPluginStatus, Da as SessionForkRecord, Di as WorkArtifactManifestFile, Dn as SpaceCommerceOrder, Dr as SpaceTurnListItem, Dt as ModelCatalogEntry, E as BillingPaymentStatus, Ea as MessageRecord, Ei as WorkArtifactManifest, En as SpaceCommerceFeatureBenefit, Er as SpaceTurnAuthorFilter, Et as MeResponse, F as BillingSubscriptionHistoryList, Fa as CompletionThinkingLevel, Fi as UI_COMMAND_SETTLEMENT_GRACE_SECONDS, Fn as SpaceCreateResponse, Fr as UserRulesResponse, Ft as PublicUserPageResponse, G as CheckpointDiffStatus, Ga as COHUB_SOURCE_HEADER_NAMES, Gi as UiSurfaceRequest, Gn as SpaceFsEntry, Gr as GenerationModelPolicy, Gt as ReferenceQueryableType, H as CheckpointDiffPatchKind, Hi as UiCommandStatus, Hn as SpaceFsCreateUploadResponse, Hr as ChannelRuntimeState, Ht as ReferenceDirection, I as BillingSubscriptionHistoryStatus, Ia as CompletionUsage, Ii as UI_COMMAND_TERMINAL_TTL_SECONDS, In as SpaceDefaultResponse, Ir as UserSessionListItem, It as PublicUserProfile, J as ClaimReferralResponse, Ja as RequestSourceVia, Ji as isUiSurfaceMethod, Jn as SpaceFsMoveInput, Jr as GenerationPolicyError, Jt as ReferralDashboard, K as CheckpointDiffSummary, Ka as REQUEST_SOURCE_VIA_MAX_LENGTH, Ki as UiWorkPreviewTarget, Kn as SpaceFsFileKind, Kr as GenerationParameterConstraint, Kt as ReferenceRecord, L as BillingSubscriptionSummary, La as CreateSpaceCompletionInput, Li as UI_COMMAND_VERSION, Ln as SpaceEnvInput, Lr as UserSessionSpaceSummary, Lt as PublicUserSpaceItem, M as BillingProductPricing, Ma as CompletionAssistantMessage, Mi as UI_COMMAND_MAX_TIMEOUT_MS, Mn as SpaceConfigInput, Mr as TaskRunDetailResponse, Mt as PromptTemplateCatalogEntry, N as BillingRedemptionResult, Na as CompletionMessage, Ni as UI_COMMAND_PAYLOAD_MAX_BYTES, Nn as SpaceConfigResponse, Nr as TaskRunRecord, Nt as PromptTemplateCatalogResponse, O as BillingProductBillingInterval, Oa as SessionTurnSegmentRecord, Oi as WorkBoardArtifactManifest, On as SpaceCommerceProduct, Or as SpaceTurnsResponse, Ot as PatchResourceLabelsInput, P as BillingResponsePayload, Pa as CompletionMessageRole, Pi as UI_COMMAND_PENDING_TTL_SECONDS, Pn as SpaceConfigUpdateResponse, Pr as UserProfile, Pt as PublicReferral, Q as CreateSpaceModInput, Qa as isRequestSourceUuid, Qi as BoardCapabilities, Qn as SpaceFsReadFilesResponse, Qr as filterGenerationDeclarationsByPolicy, Qt as ResourceLabelsResponse, R as Channel, Ra as ModelThinkingLevel, Ri as UiCommand, Rn as SpaceFsCompleteUploadInput, Rr as UserSessionsResponse, Rt as PublicUserWorkItem, S as BillingCreditGrantStatus, Si as BoardAwarenessStateUpdate, Sn as SpaceCheckpointDetailResponse, Sr as SpaceSandboxAutoDestroyPolicy, St as LabelRecord, T as BillingHistoryPagination, Ti as WorkArtifactDownloadDescriptor, Tn as SpaceCommerceCreditsBenefit, Tr as SpaceSessionsResponse, Tt as LabelSource, U as CheckpointDiffPatchLine, Ua as ContentBlock, Ui as UiPreviewShowCommand, Un as SpaceFsDeleteNodeInput, Ur as DiscordChannelConfig, Ut as ReferenceKind, V as CheckpointDiffFileResponse, Vi as UiCommandRecord, Vn as SpaceFsCreateUploadInput, Vr as ChannelHealthReasonCode, Vt as ReferenceAggregateResponse, W as CheckpointDiffStats, Wa as COHUB_SOURCE_HEADER, Wi as UiPreviewTarget, Wn as SpaceFsEncoding, Wr as FeishuChannelConfig, Wt as ReferenceQueryResponse, X as CreateInvitationResponse, Xa as isRequestSourceClientId, Xi as BoardAssetRef, Xn as SpaceFsReadFilesError, Xr as decodeGenerationPolicy, Xt as ReferralReward, Y as CreateInvitationInput, Ya as hasRequestSourceIdentity, Yi as parseUiCommand, Yn as SpaceFsPreparingFile, Yr as assertGenerationRequestAllowedByPolicy, Yt as ReferralListItem, Z as CreateSpaceInput, Za as isRequestSourceEmpty, Zi as BoardBootstrap, Zn as SpaceFsReadFilesInput, Zr as encodeGenerationPolicy, Zt as ReferralStatus, _ as BillingCatalogProduct, _a as BoardTransaction, _i as RealtimeWorkVersionRecord, _n as SpaceBootstrapMeta, _r as SpacePresenceSnapshot, _t as LabelAssignmentPageInfo, aa as BoardKeyframe, ai as GenerationResult, an as SessionRecord, ar as SpaceFsUploadProgress, at as CursorPageInfo, b as BillingConversionIntent, bi as BoardAwarenessGesture, bn as SpaceBootstrapStatus, br as SpaceRecord, bt as LabelItemsSessionFork, c as createWebsocketClient, ca as BoardNodeRecord, cn as SessionTurnSignedUrlsResponse, cr as SpaceInvitation, ct as GenerationUsageSummary, d as BatchUserProfilesResponse, da as BoardPlaybackPolicy, dn as SessionTurnsPaginatedResponse, dr as SpaceListItem, dt as GlobalSearchType, ea as BoardCreateInput, ei as getAllowedGenerationModelIds, en as SendMessageCronJobPayload, eo as normalizeRequestSource, er as SpaceFsUploadDestination, et as CreateSpacePromptResponse, f as BillingBalanceActivity, fa as BoardPlaybackPolicySchema, fi as RealtimeRoomDescriptor, fn as SkillCatalogEntry, fr as SpaceMember, ft as InvitationDetail, g as BillingCatalog, ga as BoardTarget, gi as RealtimeWorkRecord, gn as SpaceAccessPolicy, gr as SpacePendingDiffSummary, gt as LabelAssignmentListItem, h as BillingBalanceActivityStatus, ha as BoardSequence, hi as RealtimeServerEvent, hn as SpaceAccess, hr as SpacePendingDiffFileResponse, ht as JsonValue, ia as BoardInspectInput, ii as GenerationModelDeclaration, in as SessionMessagesResponse, io as resolveRequestSourceChannel, ir as SpaceFsUploadPlanEntryInput, it as CronJobUpdatePatch, j as BillingProductKind, ji as UI_COMMAND_DEFAULT_TIMEOUT_MS, jn as SpaceConfig, jr as SpaceUsageSummary, jt as PromptAccessMode, k as BillingProductCreditBenefit, ka as SessionTurnIndexItem, ki as WorkBoardAsset, kn as SpaceCommerceProductBenefitBinding, kr as SpaceUsageHourlyStat, kt as PatchResourceLabelsResponse, l as AcceptInvitationResponse, la as BoardOperation, li as ChannelEnvelope, ln as SessionTurnStreamSnapshotResponse, lr as SpaceInvitationListResponse, lt as GlobalSearchResponse, m as BillingBalanceActivityList, ma as BoardRecord, mi as RealtimeRoomMember, mn as SkillCatalogSource, mr as SpaceModListItem, mt as JsonPrimitive, na as BoardDiagnostic, ni as parseGenerationPolicyFromEnv, nn as SessionMessageResponse, no as readRequestSourceFromEnv, nr as SpaceFsUploadError, nt as CronJobPayload, oa as BoardManifest, on as SessionTurnIndexResponse, or as SpaceFsUploadResponse, ot as GenerationUsageBlock, p as BillingBalanceActivityKind, pa as BoardPlaybackSnapshot, pi as RealtimeRoomEvent, pn as SkillCatalogResponse, pr as SpaceMeta, pt as JsonObject, q as CheckpointRecord, qa as RequestSource, qi as isTerminalUiCommandStatus, qn as SpaceFsFileResponse, qr as GenerationPolicy, qt as ReferenceResourceType, r as WebsocketClient, ra as BoardEffect, ri as GenerationContentBlock, rn as SessionMessagesPaginatedResponse, ro as requestSourceToHeaders, rr as SpaceFsUploadPlanEntry, rt as CronJobRecord, s as WebsocketEventPayload, sa as BoardNodeInput, sn as SessionTurnResponse, sr as SpaceFsWriteFileInput, st as GenerationUsageHourlyStat, ta as BoardDeleteReason, ti as normalizeGenerationPolicy, tn as SessionBindingRecord, to as parseRequestSourceFromHeaders, tr as SpaceFsUploadEntry, tt as CreateSpaceSessionInput, u as ApiError, ua as BoardPlaybackCommand, ui as LabelAssignmentsUpdatedEvent, un as SessionTurnWindowResponse, ur as SpaceInvitationLocation, ut as GlobalSearchResult, v as BillingCheckoutActionState, va as BoardValidationResult, vn as SpaceBootstrapSource, vr as SpacePresenceUser, vt as LabelAssignmentRecord, w as BillingCreditUnit, wa as BoardRenderCost, wi as WorkArtifactDescriptor, wn as SpaceCommerceBuyerProfile, wr as SpaceSandboxProvider, wt as LabelScopeType, x as BillingCreditExpiryGroup, xi as BoardAwarenessNodePreview, xn as SpaceChannelBindingInput, xr as SpaceRole, xt as LabelListItem, y as BillingCheckoutResult, ya as parseBoardPlaybackPolicy, yi as WorkVersionPublishedEvent, yn as SpaceBootstrapStage, yr as SpacePublicProfile, yt as LabelItemsResponse, z as CheckpointDiffDelivery, za as SpaceCompletionResult, zi as UiCommandDispatchedPayload, zn as SpaceFsCompleteUploadResponse, zr as ChannelConfig, zt as ReferenceAggregateGroup } 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
3
  import { $ as SpaceEventName, $t as HttpTransport, A as WorkViewSource, At as ReferenceResourceSelector, B as TasksApi, Bt as UploadChatAttachmentInput, C as WorkRecord, Cn as ListGenerationModelsResponse, Ct as SessionPatchApplyInput, D as WorkTargetType, Dt as SessionPatchStatus, E as WorkStatus, En as ModelStatusResponse, Et as SessionPatchState, F as UsersApi, Ft as PublicAssetMimeType, G as BoardSubscriptionHandlers, Gt as ModelsApi, H as BoardClient, Ht as UploadPublicAssetInput, I as UserApi, It as PublicAssetPurpose, J as BoardTransactionInput, Jt as ChannelsApi, K as BoardTransactionAppliedEvent, Kt as GenerationsApi, L as CreateUiCommandInput, Lt as PublicAssetUploadProgress, M as WorkVisibility, Mt as SearchApi, N as WorksApi, Nt as CreatePublicAssetUploadInput, O as WorkUpdateInput, Ot as createSessionPatchReducer, P as ReferralsApi, Pt as CreatePublicAssetUploadResponse, Q as SpaceClient, Qt as HttpTraceContext, R as UiCommandsApi, Rt as PublicAssetUploadProtocol, S as WorkPublicSpaceRecord, Sn as GenerationUsageBilling, St as parseAssistantMessageCommit, T as WorkSessionResponse, Tn as ModelStatusEntry, Tt as SessionPatchReducer, U as BoardEventName, Ut as SkillsApi, V as BoardAwarenessUpdatedEvent, Vt as UploadChatImageAttachmentInput, W as BoardPlaybackChangedEvent, Wt as PromptsApi, X as SessionSubscriptionHandlers, Xt as Fetch, Y as SessionEventName, Yt as CohubClientOptions, Z as SpaceChannelBindingRecord, Zt as HttpError, _ as WorkExtractedPageMeta, _n as resolveWorkTransport, _t as GenerationStreamSubscribeOptions, a as WorkCommerceCreditConsumeResponse, an as ParentBridgeTransport, at as PublicInviteApi, b as WorkPresentationMeta, bn as CreateGenerationTaskResponse, bt as SessionGenerationStreamClient, c as WorkCommerceEntitlementsResponse, cn as WorkRuntimeApi, ct as AssistantMessageCommit, d as WorkCommercePurchaseResponse, dn as WorkRuntimeContext, dt as GenerationStreamEvent, en as RawHttpResponse, et as SpaceTurnListOptions, f as WorkAuthorizeResponse, fn as WorkRuntimeModeConfig, ft as GenerationStreamFinalizedEvent, g as WorkDetailResponse, gn as createWorkRuntime, gt as GenerationStreamStateEvent, h as WorkCreateInput, hn as createSlugWorkIdResolver, ht as GenerationStreamOutOfSyncEvent, i as WorkCommerceCheckoutStatus, in as sanitizeAccessToken, it as BuildSpacePathInput, j as WorkViewStatsResponse, jt as ReferencesApi, k as WorkVersionRecord, kt as SessionAccessApi, l as WorkCommerceOrder, ln as WorkRuntimeCheckoutState, lt as GenerationStreamCommitEvent, m as WorkContentDownload, mn as WorkRuntimeTransport, mt as GenerationStreamLifecycleEvent, n as createHttpClient, nn as joinApiUrl, nt as WebSocketConnectionState, o as WorkCommerceCreditConsumeStatus, on as PopupBrokerTransport, ot as buildSpaceInvitePath, p as WorkContent, pn as WorkRuntimeRequestOptions, pt as GenerationStreamIntermediateMessage, q as BoardTransactionError, qt as CronJobsApi, r as WorkCommerceApi, rn as matchesUnauthorizedErrorToken, rt as BuildSpaceInvitePathInput, s as WorkCommerceEntitlement, sn as WorkIdResolver, st as buildSpacePath, t as CohubHttpClient, tn as UnauthorizedContext, tt as SpacesApi, u as WorkCommerceProductResolveResponse, un as WorkRuntimeCheckoutStatus, ut as GenerationStreamErrorEvent, v as WorkGetResponse, vn as SpaceStartupResponse, vt as GenerationStreamSubscriptionHandlers, w as WorkResolveResponse, wn as PublicGenerationDeclaration, wt as SessionPatchApplyResult, x as WorkPublicOwnerRecord, xn as GenerationTaskResult, xt as createSessionGenerationStreamClient, y as WorkMeta, yn as CreateGenerationTaskRequest, yt as GenerationStreamTurnUpdatedEvent, z as WaitForUiCommandOptions, zt as PublicAssetsApi } 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";
@@ -408,6 +408,10 @@ type WorkBridgeGetAccessToken = (options?: {
408
408
  * Used for ownership checks and silent re-authorization cache lookups.
409
409
  */
410
410
  type WorkBridgeGetViewerUuid = () => Promise<string | null>;
411
+ type WorkBridgeAuthorizationContext = {
412
+ /** The host surface handling this authorization request. */
413
+ surface: "page" | "preview" | "background" | "broker";
414
+ };
411
415
  /**
412
416
  * Requests the host to start a sign-in flow, redirecting back to the given
413
417
  * path afterward. The core calls this when an API request fails due to missing
@@ -424,7 +428,9 @@ type WorkBridgeRequestSignIn = (redirectPath: string) => Promise<void>;
424
428
  */
425
429
  type WorkBridgeCoreConfig = {
426
430
  work: WorkBridgeCoreWork;
427
- /** True when running as a background chat surface (owner auto-authorizes). */
431
+ /** Trusted host context used to decide whether the publisher may authorize silently. */
432
+ authorizationContext?: WorkBridgeAuthorizationContext;
433
+ /** @deprecated Use authorizationContext with a background surface. */
428
434
  isBackground?: boolean;
429
435
  /** Base origin for Cohub API requests (e.g. "https://cohub.run"). */
430
436
  apiOrigin: string;
@@ -601,4 +607,4 @@ declare function createBoardExtensionRegistry(input?: {
601
607
  builtins?: boolean;
602
608
  }): BoardExtensionRegistry;
603
609
  //#endregion
604
- export { AcceptInvitationResponse, ApiError, type AssistantMessageCommit, BILLING_ACCESS_BLOCKED_ERROR_CODE, BatchUserProfilesResponse, BillingApi, BillingBalanceActivity, BillingBalanceActivityKind, BillingBalanceActivityList, BillingBalanceActivityStatus, BillingCatalog, BillingCatalogProduct, BillingCheckoutActionState, BillingCheckoutResult, BillingConversionIntent, BillingCreditExpiryGroup, BillingCreditGrantStatus, BillingCreditStatus, BillingCreditUnit, BillingHistoryPagination, BillingPaymentStatus, BillingPluginStatus, BillingProductBillingInterval, BillingProductCreditBenefit, BillingProductDisplay, BillingProductKind, BillingProductPricing, BillingRedemptionResult, BillingResponsePayload, BillingSubscriptionHistoryList, BillingSubscriptionHistoryStatus, BillingSubscriptionSummary, type BoardAssetRef, type BoardAwarenessGesture, type BoardAwarenessNodePreview, type BoardAwarenessStateUpdate, type BoardAwarenessUpdate, type BoardAwarenessUpdatedEvent, type BoardBootstrap, type BoardCapabilities, type BoardCapability, BoardClient, type BoardClip, type BoardCreateInput, type BoardDeleteReason, type BoardDiagnostic, type BoardEffect, type BoardEventName, BoardExtensionDefinition, BoardExtensionRegistry, type BoardInspectInput, type BoardKeyframe, type BoardManifest, type BoardNodeInput, type BoardNodeRecord, type BoardOperation, type BoardPlaybackChangedEvent, type BoardPlaybackCommand, type BoardPlaybackPolicy, BoardPlaybackPolicySchema, type BoardPlaybackSnapshot, BoardPresetDefinition, type BoardRecord, type BoardRenderCost, type BoardSequence, type BoardSubscriptionHandlers, type BoardTarget, type BoardTransaction, type BoardTransactionAppliedEvent, BoardTransactionError, type BoardTransactionInput, 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, CompiledSequence, type CompletionAssistantMessage, type CompletionMessage, type CompletionMessageRole, type CompletionThinkingLevel, type CompletionUsage, 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, PromptAccessMode, PromptTemplateCatalogEntry, PromptTemplateCatalogResponse, type PublicAssetMimeType, type PublicAssetPurpose, type PublicAssetUploadProgress, type PublicAssetUploadProtocol, 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, 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, SpacePublicProfile, SpaceRecord, SpaceRole, SpaceSandboxAutoDestroyPolicy, SpaceSandboxConfig, SpaceSandboxProvider, SpaceSessionsResponse, type SpaceStartupResponse, SpaceTurnAuthorFilter, SpaceTurnListItem, type SpaceTurnListOptions, SpaceTurnsResponse, SpaceUsageHourlyStat, SpaceUsageResponse, SpaceUsageSummary, TaskRunDetailResponse, TaskRunRecord, TimelineClipInput, TimelineInput, 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 UiPreviewShowCommand, type UiPreviewTarget, type UiSurfaceRequest, type UiWorkPreviewTarget, type UnauthorizedContext, type UploadChatAttachmentInput, type UploadChatImageAttachmentInput, type UploadPublicAssetInput, 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 WorkBridgeCore, type WorkBridgeCoreConfig, type WorkBridgeCoreWork, type WorkBridgeDialogState, type WorkBridgeGetAccessToken, type WorkBridgeGetViewerUuid, type WorkBridgeRequestSignIn, 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 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 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, clip, compileSequence, 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, isWorkId, joinApiUrl, matchesUnauthorizedErrorToken, mergeRequestSourceIntoMeta, normalizeBaseUrl, normalizeGenerationPolicy, normalizeRequestSource, normalizeVoiceInputWebsocketUrl, normalizeWebsocketUrl, parseAssistantMessageCommit, parseBoardPlaybackPolicy, parseGenerationPolicyFromEnv, parseRequestSourceFromHeaders, parseUiCommand, parseWorkRef, parseWorkSurfaceReady, parseWorkSurfaceResponse, readRequestSourceFromEnv, requestSourceToHeaders, resolveApiBaseUrl, resolveCohubEnvironment, resolveRequestSourceChannel, resolveVoiceInputWebsocketUrl, resolveWebsocketUrl, resolveWorkTransport, sanitizeAccessToken, setGrantedWorkScopes, timeline };
610
+ export { AcceptInvitationResponse, ApiError, type AssistantMessageCommit, BILLING_ACCESS_BLOCKED_ERROR_CODE, BatchUserProfilesResponse, BillingApi, BillingBalanceActivity, BillingBalanceActivityKind, BillingBalanceActivityList, BillingBalanceActivityStatus, BillingCatalog, BillingCatalogProduct, BillingCheckoutActionState, BillingCheckoutResult, BillingConversionIntent, BillingCreditExpiryGroup, BillingCreditGrantStatus, BillingCreditStatus, BillingCreditUnit, BillingHistoryPagination, BillingPaymentStatus, BillingPluginStatus, BillingProductBillingInterval, BillingProductCreditBenefit, BillingProductDisplay, BillingProductKind, BillingProductPricing, BillingRedemptionResult, BillingResponsePayload, BillingSubscriptionHistoryList, BillingSubscriptionHistoryStatus, BillingSubscriptionSummary, type BoardAssetRef, type BoardAwarenessGesture, type BoardAwarenessNodePreview, type BoardAwarenessStateUpdate, type BoardAwarenessUpdate, type BoardAwarenessUpdatedEvent, type BoardBootstrap, type BoardCapabilities, type BoardCapability, BoardClient, type BoardClip, type BoardCreateInput, type BoardDeleteReason, type BoardDiagnostic, type BoardEffect, type BoardEventName, BoardExtensionDefinition, BoardExtensionRegistry, type BoardInspectInput, type BoardKeyframe, type BoardManifest, type BoardNodeInput, type BoardNodeRecord, type BoardOperation, type BoardPlaybackChangedEvent, type BoardPlaybackCommand, type BoardPlaybackPolicy, BoardPlaybackPolicySchema, type BoardPlaybackSnapshot, BoardPresetDefinition, type BoardRecord, type BoardRenderCost, type BoardSequence, type BoardSubscriptionHandlers, type BoardTarget, type BoardTransaction, type BoardTransactionAppliedEvent, BoardTransactionError, type BoardTransactionInput, 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, CompiledSequence, type CompletionAssistantMessage, type CompletionMessage, type CompletionMessageRole, type CompletionThinkingLevel, type CompletionUsage, 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, PromptAccessMode, PromptTemplateCatalogEntry, PromptTemplateCatalogResponse, type PublicAssetMimeType, type PublicAssetPurpose, type PublicAssetUploadProgress, type PublicAssetUploadProtocol, 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, 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, SpacePublicProfile, SpaceRecord, SpaceRole, SpaceSandboxAutoDestroyPolicy, SpaceSandboxConfig, SpaceSandboxProvider, SpaceSessionsResponse, type SpaceStartupResponse, SpaceTurnAuthorFilter, SpaceTurnListItem, type SpaceTurnListOptions, SpaceTurnsResponse, SpaceUsageHourlyStat, SpaceUsageResponse, SpaceUsageSummary, TaskRunDetailResponse, TaskRunRecord, TimelineClipInput, TimelineInput, 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 UiPreviewShowCommand, type UiPreviewTarget, type UiSurfaceRequest, type UiWorkPreviewTarget, type UnauthorizedContext, type UploadChatAttachmentInput, type UploadChatImageAttachmentInput, type UploadPublicAssetInput, 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, 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 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 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, clip, compileSequence, 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, isWorkId, joinApiUrl, matchesUnauthorizedErrorToken, mergeRequestSourceIntoMeta, normalizeBaseUrl, normalizeGenerationPolicy, normalizeRequestSource, normalizeVoiceInputWebsocketUrl, normalizeWebsocketUrl, parseAssistantMessageCommit, parseBoardPlaybackPolicy, parseGenerationPolicyFromEnv, parseRequestSourceFromHeaders, parseUiCommand, parseWorkRef, parseWorkSurfaceReady, parseWorkSurfaceResponse, readRequestSourceFromEnv, requestSourceToHeaders, resolveApiBaseUrl, resolveCohubEnvironment, resolveRequestSourceChannel, resolveVoiceInputWebsocketUrl, resolveWebsocketUrl, resolveWorkTransport, sanitizeAccessToken, setGrantedWorkScopes, timeline };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as parseAssistantMessageCommit, B as ModelsApi, C as SpaceClient, D as buildSpacePath, E as buildSpaceInvitePath, F as ReferencesApi, H as CronJobsApi, I as SearchApi, L as PublicAssetsApi, M as createSessionPatchReducer, N as ensureRealtimeConnected, O as SessionGenerationStreamClient, P as SessionAccessApi, R as SkillsApi, S as BoardTransactionError, T as PublicInviteApi, U as ChannelsApi, V as GenerationsApi, _ as isUiSurfaceMethod, a as ReferralsApi, b as TasksApi, c as UiCommandsApi, d as UI_COMMAND_PAYLOAD_MAX_BYTES, f as UI_COMMAND_PENDING_TTL_SECONDS, g as isTerminalUiCommandStatus, h as UI_COMMAND_VERSION, i as WorksApi, j as SessionPatchReducer, k as createSessionGenerationStreamClient, l as UI_COMMAND_DEFAULT_TIMEOUT_MS, m as UI_COMMAND_TERMINAL_TTL_SECONDS, n as createHttpClient, o as UsersApi, p as UI_COMMAND_SETTLEMENT_GRACE_SECONDS, r as WorkCommerceApi, s as UserApi, t as CohubHttpClient, u as UI_COMMAND_MAX_TIMEOUT_MS, v as parseUiCommand, w as SpacesApi, x as BoardClient, y as parseUiCommandId, z as PromptsApi } from "./chunks/http.js";
1
+ import { A as parseAssistantMessageCommit, B as ReferencesApi, C as SpaceClient, D as buildSpacePath, E as buildSpaceInvitePath, F as BOARD_ARROW_STROKE_SIZE, G as ModelsApi, H as PublicAssetsApi, I as BOARD_BUILTIN_CAPABILITIES, J as ChannelsApi, K as GenerationsApi, L as BOARD_CONNECTION_STROKE_SIZE, M as createSessionPatchReducer, N as ensureRealtimeConnected, O as SessionGenerationStreamClient, P as BoardConnectionSchema, R as DEFAULT_BOARD_RENDER_LIMITS, S as BoardTransactionError, T as PublicInviteApi, U as SkillsApi, V as SearchApi, W as PromptsApi, _ as isUiSurfaceMethod, a as ReferralsApi, b as TasksApi, c as UiCommandsApi, d as UI_COMMAND_PAYLOAD_MAX_BYTES, f as UI_COMMAND_PENDING_TTL_SECONDS, g as isTerminalUiCommandStatus, h as UI_COMMAND_VERSION, i as WorksApi, j as SessionPatchReducer, k as createSessionGenerationStreamClient, l as UI_COMMAND_DEFAULT_TIMEOUT_MS, m as UI_COMMAND_TERMINAL_TTL_SECONDS, n as createHttpClient, o as UsersApi, p as UI_COMMAND_SETTLEMENT_GRACE_SECONDS, q as CronJobsApi, r as WorkCommerceApi, s as UserApi, t as CohubHttpClient, u as UI_COMMAND_MAX_TIMEOUT_MS, v as parseUiCommand, w as SpacesApi, x as BoardClient, y as parseUiCommandId, z as SessionAccessApi } from "./chunks/http.js";
2
2
  import { _ as requestSourceToHeaders, a as sanitizeAccessToken, b as REALTIME_ROOM_EVENT_NAME_PATTERN, c as REQUEST_SOURCE_VIA_MAX_LENGTH, d as isRequestSourceEmpty, f as isRequestSourceUuid, g as readRequestSourceFromEnv, h as parseRequestSourceFromHeaders, i as matchesUnauthorizedErrorToken, l as hasRequestSourceIdentity, m as normalizeRequestSource, n as HttpTransport, o as COHUB_SOURCE_HEADER, p as mergeRequestSourceIntoMeta, r as joinApiUrl, s as COHUB_SOURCE_HEADER_NAMES, t as HttpError, u as isRequestSourceClientId, v as resolveRequestSourceChannel, y as REALTIME_DOMAINS } from "./chunks/transport.js";
3
3
  import { a as resolveApiBaseUrl, c as resolveWebsocketUrl, i as normalizeWebsocketUrl, n as normalizeBaseUrl, o as resolveCohubEnvironment, r as normalizeVoiceInputWebsocketUrl, s as resolveVoiceInputWebsocketUrl, t as COHUB_ENVIRONMENTS } from "./chunks/environment.js";
4
4
  import { a as extractBillingPayload, c as isFeatureNotEntitledError, i as FEATURE_NOT_ENTITLED_ERROR_CODE, l as isHttpErrorCode, n as createWebsocketClient, o as isBillingAccessBlockedCode, r as BILLING_ACCESS_BLOCKED_ERROR_CODE, s as isBillingAccessBlockedError, t as WebsocketClient } from "./chunks/websocket.js";
@@ -70,47 +70,6 @@ var BillingApi = class {
70
70
  }
71
71
  };
72
72
  //#endregion
73
- //#region ../protocol/dist/board-constants.js
74
- const DEFAULT_BOARD_RENDER_LIMITS = {
75
- particles: 2e4,
76
- vertices: 5e5,
77
- dynamicVertices: 15e4,
78
- drawCalls: 400,
79
- filterPasses: 24,
80
- renderTexturePixels: 16777216,
81
- textureBytes: 512 * 1024 * 1024,
82
- bufferBytes: 256 * 1024 * 1024,
83
- simulationSteps: 1e5
84
- };
85
- const BOARD_BUILTIN_CLIP_KINDS = [
86
- "motion.keyframes",
87
- "motion.path",
88
- "draw.reveal",
89
- "draw.handwrite",
90
- "text.reveal",
91
- "effects.particles",
92
- "effects.trail",
93
- "effects.impact",
94
- "effects.flash",
95
- "effects.color",
96
- "camera.pan",
97
- "camera.zoom",
98
- "camera.shake"
99
- ];
100
- const BOARD_BUILTIN_EFFECT_KINDS = ["effects.pulse", "effects.float"];
101
- const BOARD_ARROW_STROKE_SIZE = 2.5;
102
- const BOARD_BUILTIN_CAPABILITIES = [...BOARD_BUILTIN_CLIP_KINDS.map((id) => ({
103
- kind: "clip",
104
- id,
105
- version: 1,
106
- renderers: ["webgpu", "webgl"]
107
- })), ...BOARD_BUILTIN_EFFECT_KINDS.map((id) => ({
108
- kind: "effect",
109
- id,
110
- version: 1,
111
- renderers: ["webgpu", "webgl"]
112
- }))];
113
- //#endregion
114
73
  //#region ../protocol/dist/realtime/board-awareness.js
115
74
  const idSchema$1 = z.string().min(1).max(160);
116
75
  const finiteSchema$1 = z.number().finite();
@@ -126,23 +85,13 @@ const BoardAwarenessFrameSchema = z.object({
126
85
  height: finiteSchema$1.positive(),
127
86
  rotation: finiteSchema$1
128
87
  });
129
- const arrowEndpointSchema = z.union([z.object({
130
- kind: z.literal("point"),
131
- x: finiteSchema$1,
132
- y: finiteSchema$1
133
- }), z.object({
134
- kind: z.literal("binding"),
135
- target: idSchema$1,
136
- nx: finiteSchema$1,
137
- ny: finiteSchema$1,
138
- precise: z.boolean()
139
- })]);
140
88
  const BoardAwarenessNodePreviewSchema = z.object({
141
89
  nodeId: idSchema$1,
142
90
  frame: BoardAwarenessFrameSchema,
91
+ /** Live endpoints of a free arrow being dragged. */
143
92
  arrow: z.object({
144
- start: arrowEndpointSchema,
145
- end: arrowEndpointSchema,
93
+ start: BoardAwarenessPointSchema,
94
+ end: BoardAwarenessPointSchema,
146
95
  bend: finiteSchema$1
147
96
  }).optional()
148
97
  });
@@ -191,6 +140,15 @@ const BoardAwarenessGestureSchema = z.discriminatedUnion("kind", [
191
140
  color: z.string().min(1).max(64),
192
141
  geo: z.string().min(1).max(40)
193
142
  }),
143
+ z.object({
144
+ kind: z.literal("connection"),
145
+ id: idSchema$1,
146
+ sourceNodeId: idSchema$1,
147
+ targetNodeId: idSchema$1.nullable(),
148
+ current: BoardAwarenessPointSchema,
149
+ color: z.string().min(1).max(64),
150
+ size: finiteSchema$1.positive().max(256).default(BOARD_CONNECTION_STROKE_SIZE)
151
+ }),
194
152
  z.object({
195
153
  kind: z.literal("transform"),
196
154
  id: idSchema$1,
@@ -198,7 +156,8 @@ const BoardAwarenessGestureSchema = z.discriminatedUnion("kind", [
198
156
  "translate",
199
157
  "resize",
200
158
  "rotate",
201
- "arrow"
159
+ "arrow",
160
+ "connection"
202
161
  ]),
203
162
  nodes: z.array(BoardAwarenessNodePreviewSchema).max(64),
204
163
  bounds: BoardAwarenessFrameSchema.nullable()
@@ -1897,7 +1856,7 @@ function clonePermissionScopes(scopes) {
1897
1856
  function createWorkBridgeCore(config) {
1898
1857
  const { work, reply, getCheckoutState, getAccessToken, getViewerUuid } = config;
1899
1858
  const apiOrigin = config.apiOrigin;
1900
- const isBackground = config.isBackground ?? false;
1859
+ const authorizationContext = config.authorizationContext ?? (config.isBackground ? { surface: "background" } : { surface: "page" });
1901
1860
  const onStateChange = config.onStateChange;
1902
1861
  let workToken = null;
1903
1862
  const state = {
@@ -1918,6 +1877,9 @@ function createWorkBridgeCore(config) {
1918
1877
  const viewerUuid = await getViewerUuid();
1919
1878
  return Boolean(viewerUuid && viewerUuid === work.userUuid);
1920
1879
  }
1880
+ function allowsOwnerAutoAuthorization() {
1881
+ return authorizationContext.surface === "background" || authorizationContext.surface === "preview";
1882
+ }
1921
1883
  async function ensureBaseToken(forceRefresh = false) {
1922
1884
  if (workToken && !forceRefresh) return workToken;
1923
1885
  const userToken = await getAccessToken({ forceRefresh });
@@ -2082,7 +2044,7 @@ function createWorkBridgeCore(config) {
2082
2044
  });
2083
2045
  return;
2084
2046
  }
2085
- if (isBackground && await isCurrentViewerWorkOwner()) {
2047
+ if (allowsOwnerAutoAuthorization() && await isCurrentViewerWorkOwner()) {
2086
2048
  const token = await authorize(scopes);
2087
2049
  reply(data.requestId, {
2088
2050
  type: "cohub.work.authorize.result",
@@ -2569,6 +2531,7 @@ z.object({
2569
2531
  title: z.string().min(1).max(255).optional(),
2570
2532
  metadata: jsonObjectSchema.optional(),
2571
2533
  nodes: z.array(BoardNodeInputSchema).max(5e4).optional(),
2534
+ connections: z.array(BoardConnectionSchema).max(5e4).optional(),
2572
2535
  effects: z.array(BoardEffectSchema.omit({
2573
2536
  boardId: true,
2574
2537
  revision: true
@@ -2584,6 +2547,7 @@ z.object({
2584
2547
  z.object({
2585
2548
  include: z.array(z.enum([
2586
2549
  "nodes",
2550
+ "connections",
2587
2551
  "effects",
2588
2552
  "sequences",
2589
2553
  "clips",
@@ -0,0 +1,310 @@
1
+ import { z } from "zod";
2
+ //#region ../protocol/dist/board-connection.d.ts
3
+ /** Sides of a node frame a connection can attach to. */
4
+ declare const BOARD_CONNECTION_SIDES: readonly ["top", "right", "bottom", "left"];
5
+ type BoardConnectionSide = (typeof BOARD_CONNECTION_SIDES)[number];
6
+ /**
7
+ * Where a connection meets its node.
8
+ *
9
+ * - `auto` — the side is chosen from the live geometry of both endpoints, so the
10
+ * connection stays sensible through any move or resize. This is the default and
11
+ * what almost every connection should use.
12
+ * - `side` — the user pinned a side; `offset` (0..1) positions it along that edge.
13
+ * - `fixed` — the user pinned an exact normalized point on the frame.
14
+ *
15
+ * `auto` is a *declaration of intent*, not a computed value: the resolved side is
16
+ * never written back, so the connection keeps adapting instead of freezing the
17
+ * first layout it happened to have.
18
+ */
19
+ declare const BoardConnectionAnchorSchema: z.ZodUnion<readonly [z.ZodObject<{
20
+ kind: z.ZodLiteral<"auto">;
21
+ }, z.core.$strip>, z.ZodObject<{
22
+ kind: z.ZodLiteral<"side">;
23
+ side: z.ZodEnum<{
24
+ bottom: "bottom";
25
+ left: "left";
26
+ right: "right";
27
+ top: "top";
28
+ }>;
29
+ offset: z.ZodDefault<z.ZodNumber>;
30
+ }, z.core.$strip>, z.ZodObject<{
31
+ kind: z.ZodLiteral<"fixed">;
32
+ nx: z.ZodNumber;
33
+ ny: z.ZodNumber;
34
+ }, z.core.$strip>]>;
35
+ type BoardConnectionAnchor = z.infer<typeof BoardConnectionAnchorSchema>;
36
+ declare const AUTO_BOARD_CONNECTION_ANCHOR: BoardConnectionAnchor;
37
+ declare const BoardConnectionEndpointSchema: z.ZodObject<{
38
+ nodeId: z.ZodString;
39
+ anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
40
+ kind: z.ZodLiteral<"auto">;
41
+ }, z.core.$strip>, z.ZodObject<{
42
+ kind: z.ZodLiteral<"side">;
43
+ side: z.ZodEnum<{
44
+ bottom: "bottom";
45
+ left: "left";
46
+ right: "right";
47
+ top: "top";
48
+ }>;
49
+ offset: z.ZodDefault<z.ZodNumber>;
50
+ }, z.core.$strip>, z.ZodObject<{
51
+ kind: z.ZodLiteral<"fixed">;
52
+ nx: z.ZodNumber;
53
+ ny: z.ZodNumber;
54
+ }, z.core.$strip>]>>;
55
+ }, z.core.$strip>;
56
+ type BoardConnectionEndpoint = z.infer<typeof BoardConnectionEndpointSchema>;
57
+ /**
58
+ * Which ends carry an arrowhead.
59
+ *
60
+ * This is the *semantic* direction, not a style flag: `forward` means the
61
+ * relation reads source → target, `backward` means target → source, and `none`
62
+ * means the relation is symmetric. Renderers derive arrowheads from it, so the
63
+ * drawing can never disagree with the meaning.
64
+ */
65
+ declare const BOARD_CONNECTION_DIRECTIONS: readonly ["none", "forward", "backward", "both"];
66
+ type BoardConnectionDirection = (typeof BOARD_CONNECTION_DIRECTIONS)[number];
67
+ /** How the line travels between its two resolved endpoints. */
68
+ declare const BOARD_CONNECTION_ROUTINGS: readonly ["straight", "curve", "orthogonal"];
69
+ type BoardConnectionRouting = (typeof BOARD_CONNECTION_ROUTINGS)[number];
70
+ declare const BOARD_CONNECTION_LINES: readonly ["solid", "dashed"];
71
+ type BoardConnectionLine = (typeof BOARD_CONNECTION_LINES)[number];
72
+ /**
73
+ * The default relation kind.
74
+ *
75
+ * "related" is deliberately unopinionated: drawing a line between two nodes
76
+ * states that they are connected, not *how*. A stronger claim (depends-on,
77
+ * blocks, ...) is something the user or an agent asserts explicitly.
78
+ */
79
+ declare const DEFAULT_BOARD_RELATION: "related";
80
+ /**
81
+ * Relation kind — a free-form slug, not an enum.
82
+ *
83
+ * Boards are used for domains we do not control, so a closed vocabulary would
84
+ * force unrelated meanings into the wrong bucket. The format is constrained
85
+ * (lowercase, dash/dot separated) so relations stay comparable and queryable
86
+ * across clients instead of accumulating near-duplicate spellings.
87
+ */
88
+ declare const BoardRelationSchema: z.ZodDefault<z.ZodString>;
89
+ /**
90
+ * Waypoints a user dragged the line through, in world space.
91
+ *
92
+ * Stored because they are *input*, not output: the resolved path is recomputed
93
+ * from them on every read, but the intent behind a hand-routed line cannot be
94
+ * recovered once discarded.
95
+ */
96
+ declare const BoardConnectionWaypointSchema: z.ZodObject<{
97
+ x: z.ZodNumber;
98
+ y: z.ZodNumber;
99
+ }, z.core.$strip>;
100
+ declare const BoardConnectionRoutingSchema: z.ZodObject<{
101
+ kind: z.ZodDefault<z.ZodEnum<{
102
+ curve: "curve";
103
+ orthogonal: "orthogonal";
104
+ straight: "straight";
105
+ }>>;
106
+ bend: z.ZodDefault<z.ZodNumber>;
107
+ waypoints: z.ZodDefault<z.ZodArray<z.ZodObject<{
108
+ x: z.ZodNumber;
109
+ y: z.ZodNumber;
110
+ }, z.core.$strip>>>;
111
+ }, z.core.$strip>;
112
+ type BoardConnectionRoutingConfig = z.infer<typeof BoardConnectionRoutingSchema>;
113
+ declare const BoardConnectionStyleSchema: z.ZodObject<{
114
+ color: z.ZodDefault<z.ZodString>;
115
+ size: z.ZodDefault<z.ZodNumber>;
116
+ line: z.ZodDefault<z.ZodEnum<{
117
+ dashed: "dashed";
118
+ solid: "solid";
119
+ }>>;
120
+ }, z.core.$strip>;
121
+ type BoardConnectionStyle = z.infer<typeof BoardConnectionStyleSchema>;
122
+ declare const DEFAULT_BOARD_CONNECTION_ROUTING: BoardConnectionRoutingConfig;
123
+ declare const DEFAULT_BOARD_CONNECTION_STYLE: BoardConnectionStyle;
124
+ declare const BoardConnectionSchema: z.ZodObject<{
125
+ id: z.ZodString;
126
+ source: z.ZodObject<{
127
+ nodeId: z.ZodString;
128
+ anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
129
+ kind: z.ZodLiteral<"auto">;
130
+ }, z.core.$strip>, z.ZodObject<{
131
+ kind: z.ZodLiteral<"side">;
132
+ side: z.ZodEnum<{
133
+ bottom: "bottom";
134
+ left: "left";
135
+ right: "right";
136
+ top: "top";
137
+ }>;
138
+ offset: z.ZodDefault<z.ZodNumber>;
139
+ }, z.core.$strip>, z.ZodObject<{
140
+ kind: z.ZodLiteral<"fixed">;
141
+ nx: z.ZodNumber;
142
+ ny: z.ZodNumber;
143
+ }, z.core.$strip>]>>;
144
+ }, z.core.$strip>;
145
+ target: z.ZodObject<{
146
+ nodeId: z.ZodString;
147
+ anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
148
+ kind: z.ZodLiteral<"auto">;
149
+ }, z.core.$strip>, z.ZodObject<{
150
+ kind: z.ZodLiteral<"side">;
151
+ side: z.ZodEnum<{
152
+ bottom: "bottom";
153
+ left: "left";
154
+ right: "right";
155
+ top: "top";
156
+ }>;
157
+ offset: z.ZodDefault<z.ZodNumber>;
158
+ }, z.core.$strip>, z.ZodObject<{
159
+ kind: z.ZodLiteral<"fixed">;
160
+ nx: z.ZodNumber;
161
+ ny: z.ZodNumber;
162
+ }, z.core.$strip>]>>;
163
+ }, z.core.$strip>;
164
+ relation: z.ZodDefault<z.ZodString>;
165
+ direction: z.ZodDefault<z.ZodEnum<{
166
+ backward: "backward";
167
+ both: "both";
168
+ forward: "forward";
169
+ none: "none";
170
+ }>>;
171
+ label: z.ZodDefault<z.ZodString>;
172
+ routing: z.ZodDefault<z.ZodObject<{
173
+ kind: z.ZodDefault<z.ZodEnum<{
174
+ curve: "curve";
175
+ orthogonal: "orthogonal";
176
+ straight: "straight";
177
+ }>>;
178
+ bend: z.ZodDefault<z.ZodNumber>;
179
+ waypoints: z.ZodDefault<z.ZodArray<z.ZodObject<{
180
+ x: z.ZodNumber;
181
+ y: z.ZodNumber;
182
+ }, z.core.$strip>>>;
183
+ }, z.core.$strip>>;
184
+ style: z.ZodDefault<z.ZodObject<{
185
+ color: z.ZodDefault<z.ZodString>;
186
+ size: z.ZodDefault<z.ZodNumber>;
187
+ line: z.ZodDefault<z.ZodEnum<{
188
+ dashed: "dashed";
189
+ solid: "solid";
190
+ }>>;
191
+ }, z.core.$strip>>;
192
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
193
+ }, z.core.$strip>;
194
+ type BoardConnection = z.infer<typeof BoardConnectionSchema>;
195
+ /** Server-owned fields, mirroring how nodes carry a board id and revision. */
196
+ type BoardConnectionRecord = BoardConnection & {
197
+ boardId: string;
198
+ revision: number;
199
+ createdAt: string | null;
200
+ updatedAt: string | null;
201
+ };
202
+ /** The client-authored form of a connection (no server-owned fields). */
203
+ type BoardConnectionInput = BoardConnection;
204
+ /**
205
+ * A patch to an existing connection.
206
+ *
207
+ * `id` is excluded: a connection's identity never changes, and re-pointing both
208
+ * endpoints is an edit of the same relation, not a new one.
209
+ */
210
+ declare const BoardConnectionPatchSchema: z.ZodObject<{
211
+ source: z.ZodOptional<z.ZodObject<{
212
+ nodeId: z.ZodString;
213
+ anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
214
+ kind: z.ZodLiteral<"auto">;
215
+ }, z.core.$strip>, z.ZodObject<{
216
+ kind: z.ZodLiteral<"side">;
217
+ side: z.ZodEnum<{
218
+ bottom: "bottom";
219
+ left: "left";
220
+ right: "right";
221
+ top: "top";
222
+ }>;
223
+ offset: z.ZodDefault<z.ZodNumber>;
224
+ }, z.core.$strip>, z.ZodObject<{
225
+ kind: z.ZodLiteral<"fixed">;
226
+ nx: z.ZodNumber;
227
+ ny: z.ZodNumber;
228
+ }, z.core.$strip>]>>;
229
+ }, z.core.$strip>>;
230
+ target: z.ZodOptional<z.ZodObject<{
231
+ nodeId: z.ZodString;
232
+ anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
233
+ kind: z.ZodLiteral<"auto">;
234
+ }, z.core.$strip>, z.ZodObject<{
235
+ kind: z.ZodLiteral<"side">;
236
+ side: z.ZodEnum<{
237
+ bottom: "bottom";
238
+ left: "left";
239
+ right: "right";
240
+ top: "top";
241
+ }>;
242
+ offset: z.ZodDefault<z.ZodNumber>;
243
+ }, z.core.$strip>, z.ZodObject<{
244
+ kind: z.ZodLiteral<"fixed">;
245
+ nx: z.ZodNumber;
246
+ ny: z.ZodNumber;
247
+ }, z.core.$strip>]>>;
248
+ }, z.core.$strip>>;
249
+ relation: z.ZodOptional<z.ZodDefault<z.ZodString>>;
250
+ direction: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
251
+ backward: "backward";
252
+ both: "both";
253
+ forward: "forward";
254
+ none: "none";
255
+ }>>>;
256
+ label: z.ZodOptional<z.ZodDefault<z.ZodString>>;
257
+ routing: z.ZodOptional<z.ZodDefault<z.ZodObject<{
258
+ kind: z.ZodDefault<z.ZodEnum<{
259
+ curve: "curve";
260
+ orthogonal: "orthogonal";
261
+ straight: "straight";
262
+ }>>;
263
+ bend: z.ZodDefault<z.ZodNumber>;
264
+ waypoints: z.ZodDefault<z.ZodArray<z.ZodObject<{
265
+ x: z.ZodNumber;
266
+ y: z.ZodNumber;
267
+ }, z.core.$strip>>>;
268
+ }, z.core.$strip>>>;
269
+ style: z.ZodOptional<z.ZodDefault<z.ZodObject<{
270
+ color: z.ZodDefault<z.ZodString>;
271
+ size: z.ZodDefault<z.ZodNumber>;
272
+ line: z.ZodDefault<z.ZodEnum<{
273
+ dashed: "dashed";
274
+ solid: "solid";
275
+ }>>;
276
+ }, z.core.$strip>>>;
277
+ metadata: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
278
+ }, z.core.$strip>;
279
+ type BoardConnectionPatch = z.infer<typeof BoardConnectionPatchSchema>;
280
+ /** Both node ids a connection touches, deduped for a self-loop. */
281
+ declare function connectionNodeIds(connection: BoardConnection): string[];
282
+ /** Whether a connection touches the given node. */
283
+ declare function connectionTouchesNode(connection: BoardConnection, nodeId: string): boolean;
284
+ /** The node at the far end of a connection from `nodeId`, or null. */
285
+ declare function connectionOtherNodeId(connection: BoardConnection, nodeId: string): string | null;
286
+ declare function normalizeBoardConnectionStyle(style: Partial<BoardConnectionStyle> | undefined): BoardConnectionStyle;
287
+ /**
288
+ * Build a connection with every default filled in.
289
+ *
290
+ * Callers only state what they mean (which nodes, and optionally the relation),
291
+ * so a connection created by the editor, an agent or the CLI is byte-identical
292
+ * for the same intent.
293
+ */
294
+ declare function createBoardConnection(input: {
295
+ id: string;
296
+ sourceNodeId: string;
297
+ targetNodeId: string;
298
+ relation?: string;
299
+ direction?: BoardConnectionDirection;
300
+ label?: string;
301
+ sourceAnchor?: BoardConnectionAnchor;
302
+ targetAnchor?: BoardConnectionAnchor;
303
+ routing?: Partial<BoardConnectionRoutingConfig>;
304
+ style?: Partial<BoardConnectionStyle>;
305
+ metadata?: Record<string, unknown>;
306
+ }): BoardConnection;
307
+ /** Reverse a connection's endpoints, preserving the relation's reading order. */
308
+ declare function flipBoardConnection(connection: BoardConnection): BoardConnection;
309
+ //#endregion
310
+ export { AUTO_BOARD_CONNECTION_ANCHOR, BOARD_CONNECTION_DIRECTIONS, BOARD_CONNECTION_LINES, BOARD_CONNECTION_ROUTINGS, BOARD_CONNECTION_SIDES, BoardConnection, BoardConnectionAnchor, BoardConnectionAnchorSchema, BoardConnectionDirection, BoardConnectionEndpoint, BoardConnectionEndpointSchema, BoardConnectionInput, BoardConnectionLine, BoardConnectionPatch, BoardConnectionPatchSchema, BoardConnectionRecord, BoardConnectionRouting, BoardConnectionRoutingConfig, BoardConnectionRoutingSchema, BoardConnectionSchema, BoardConnectionSide, BoardConnectionStyle, BoardConnectionStyleSchema, BoardConnectionWaypointSchema, BoardRelationSchema, DEFAULT_BOARD_CONNECTION_ROUTING, DEFAULT_BOARD_CONNECTION_STYLE, DEFAULT_BOARD_RELATION, connectionNodeIds, connectionOtherNodeId, connectionTouchesNode, createBoardConnection, flipBoardConnection, normalizeBoardConnectionStyle };