@neta-art/cohub 8.21.0 → 8.22.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 CHANGED
@@ -231,122 +231,11 @@ An **App** (previously *Work*) is a published, shareable web page hosted by
231
231
  Cohub. When a viewer opens an App, it runs inside a Cohub-managed runtime that
232
232
  provides short-lived access tokens — no API keys required.
233
233
 
234
- These runtime-only APIs are available **exclusively inside a published App**:
235
-
236
- - `client.context()` — returns App identity, App home Space identity, the current
237
- viewer, permissions, optional invocation identifiers, and the current shell
238
- location (`context.shell`). A new chat background has `shell.surface:
239
- "background"` with the hosting Space in `shell.space` (`session` / `turn` are
240
- null); `invocation.spaceId` is the same Space for compatibility.
241
- Returns `null` outside an App runtime. `client.app.onContextChanged()` pushes
242
- fresh state.
243
- - `client.auth.authorize({ target, scopes, reason?, alwaysAsk?, fallback? })`
244
- — requests consent for an account, a specific Space, or a viewer-picked
245
- Space. Silent when a grant covers the scopes. Returns the actual target,
246
- how it was resolved, and the authoritative grant; see the
247
- [authorization contract](../../docs/app-authorization.md).
248
- `client.auth.request()` / `requestSpace()` / `requestCreateSpace()` remain
249
- available for older Apps.
250
- - `client.context().permissions.viewerGrants` — render the viewer's current
251
- per-space grants. Grant management uses an account-authenticated client or
252
- the CLI; an App session cannot manage its own grants.
253
- - `client.app.commerce.*` — entitlement checks, credit consumption,
254
- purchases.
255
- - `client.app.realtime.*` — temporary rooms, typed events, presence, and
256
- membership.
257
-
258
- ### Quick start (inside an App)
234
+ The App runtime APIs — `client.context()`, `client.auth.authorize()`, app
235
+ scopes and viewer grants, realtime rooms, callable surface, composer context,
236
+ commerce, and App Actions — are documented in one place:
259
237
 
260
- ```ts
261
- // Browsers don't inject ENV — pass it explicitly.
262
- const client = createCohubClient({ env: "prod" });
263
-
264
- const ctx = await client.context();
265
- if (!ctx?.app?.id) throw new Error("Not inside a published app.");
266
-
267
- const sourceSessionId = ctx.invocation?.sessionId ?? null;
268
- // `shell.space` is the current Cohub location. `app.homeSpace` is the App's
269
- // owning Space. A new chat background also has `invocation.spaceId`.
270
- const spaceId = ctx.shell?.space?.id ?? ctx.invocation?.spaceId ?? ctx.app.homeSpace?.id;
271
- const space = client.space(spaceId);
272
-
273
- // Request viewer grants from a user gesture (button click)
274
- const consent = await client.auth.authorize({
275
- target: { kind: "space", spaceId },
276
- scopes: ["session.prompt.fullaccess", "generation.create"],
277
- reason: "This app sends prompts and generates images.",
278
- });
279
- if (consent.status !== "granted") return;
280
- // Act on the granted target, which may differ from the request.
281
- const activeSpace = consent.target.kind === "space"
282
- ? client.space(consent.target.spaceId)
283
- : space;
284
- ```
285
-
286
- ### The permission model (critical)
287
-
288
- An app's effective permission for one Space is the union of **two grant
289
- sources** — either one is enough:
290
-
291
- - **App scopes** (no consent): eight bounded scopes — `space.view`,
292
- `session.view`, `file.view`, `file.edit`, `taskrun.view`,
293
- `session.prompt.readonly`, `session.prompt.fullaccess`, `command.execute` —
294
- granted at publish time via `appScopes`, applying only to the app's own
295
- Space.
296
- - **Viewer grants** (consent-required): any permission the viewer holds, on
297
- any Space they choose — one grant per Space, valid 14 days, re-validated
298
- against the viewer's live access on every request. Includes scopes beyond
299
- the eight app scopes, such as `generation.create` and the account-level
300
- `user.*` scopes.
301
-
302
- **They never substitute for each other's halves.** `session.prompt.fullaccess`
303
- lets you send a prompt but does NOT let you read the reply — that needs
304
- `session.view`. `generation.create` lets you create a generation task, but
305
- polling its result needs `taskrun.view`.
306
-
307
- Render grant state from `ctx.permissions.viewerGrants`; act through
308
- `auth.authorize()` (silent when covered). `allowedViewerScopes` is deprecated —
309
- viewer grants are no longer gated by the app configuration.
310
-
311
- ### Realtime rooms
312
-
313
- App runtime rooms are generic, temporary event channels. The SDK does not
314
- know the App's business events; define their names and payload types in the
315
- App itself.
316
-
317
- ```ts
318
- type Events = {
319
- "shared.state.updated": { value: number };
320
- "activity.submitted": { itemId: string };
321
- };
322
-
323
- const room = await client.app.realtime.createRoom<Events>({
324
- code: "TEAM-ALPHA", // optional; generated when omitted
325
- maxParticipants: 64,
326
- expiresInSeconds: 2 * 60 * 60,
327
- });
328
-
329
- const stop = room.subscribe("shared.state.updated", (event) => {
330
- console.log(event.sequence, event.data.value, event.self);
331
- });
332
-
333
- await room.publish("shared.state.updated", { value: 42 });
334
- await room.setPresence({ status: "active" });
335
- await room.leave();
336
- stop();
337
- ```
338
-
339
- `expiresInSeconds` is an absolute lifetime from server-side room creation. It
340
- never extends on publish, presence, or heartbeat. The maximum lifetime is
341
- 24 hours. Room events are live and ordered while connected, with publish ACKs
342
- and sequence-gap detection; events missed during a disconnect are not replayed.
343
-
344
- For high-frequency traffic such as input frames, `room.send(type, data)` skips
345
- the per-event ACK that would otherwise cap throughput at one round trip per
346
- event; failures surface through `room.onSendError`. Every connection is its own
347
- participant by default; create the room with `seatPerUser: true` to give each
348
- viewer a single seat instead.
238
+ **[App development](https://cohub.live/docs/developers/apps)**
349
239
 
350
- For the complete API-to-scope mapping, initialization recipe, capability
351
- recipes, a full working example, and a pitfalls checklist, see the
352
- **[App Runtime Guide](./docs/app-runtime-guide.md)**.
240
+ Runtime APIs only work inside a published App; local pages get `null` from
241
+ `context()`.
@@ -63,10 +63,27 @@ declare function resolveConnection(connection: BoardConnection, getFrame: FrameL
63
63
  declare function pathMidpoint(path: WorldPoint[]): WorldPoint;
64
64
  /** World bounds of a resolved connection, padded for its stroke. */
65
65
  declare function connectionBounds(resolved: ResolvedConnection, strokeSize: number): Rect;
66
+ type ConnectionGeometry = {
67
+ connection: BoardConnection;
68
+ resolved: ResolvedConnection;
69
+ bounds: Rect;
70
+ };
71
+ /**
72
+ * Resolved geometry reused until the connection or an endpoint frame changes
73
+ * identity, so unchanged relations keep returning the same object.
74
+ */
75
+ type ConnectionGeometryCache = {
76
+ get: (connection: BoardConnection, getFrame: FrameLookup) => ConnectionGeometry | null;
77
+ peek: (connectionId: string) => ConnectionGeometry | null;
78
+ retain: (connections: readonly BoardConnection[]) => void;
79
+ clear: () => void;
80
+ };
81
+ declare function createConnectionGeometryCache(): ConnectionGeometryCache;
66
82
  /** Distance from a world point to a resolved connection's path. */
67
83
  declare function distanceToConnection(resolved: ResolvedConnection, point: WorldPoint): number;
68
84
  /** Hit test a connection with a zoom-independent screen-space tolerance. */
69
85
  declare function connectionHitTest(resolved: ResolvedConnection, point: WorldPoint, strokeSize: number): boolean;
86
+ declare function connectionHitRadius(strokeSize: number): number;
70
87
  /** Whether the connection draws an arrowhead at its source / target. */
71
88
  declare function connectionArrowheads(connection: BoardConnection): {
72
89
  atSource: boolean;
@@ -88,4 +105,4 @@ type ConnectionIndex = {
88
105
  };
89
106
  declare function createConnectionIndex(connections: readonly BoardConnection[]): ConnectionIndex;
90
107
  //#endregion
91
- export { CONNECTION_ENDPOINT_GAP, ConnectionIndex, FrameLookup, ResolvedConnection, ResolvedConnectionEndpoint, anchorPointOnFrame, anchorToWorld, autoConnectionSide, connectionArrowheads, connectionBounds, connectionHitTest, createConnectionIndex, distanceToConnection, pathMidpoint, resolveConnection, worldToAnchor };
108
+ export { CONNECTION_ENDPOINT_GAP, ConnectionGeometry, ConnectionGeometryCache, ConnectionIndex, FrameLookup, ResolvedConnection, ResolvedConnectionEndpoint, anchorPointOnFrame, anchorToWorld, autoConnectionSide, connectionArrowheads, connectionBounds, connectionHitRadius, connectionHitTest, createConnectionGeometryCache, createConnectionIndex, distanceToConnection, pathMidpoint, resolveConnection, worldToAnchor };
@@ -347,6 +347,44 @@ function connectionBounds(resolved, strokeSize) {
347
347
  height: Math.max(1, maxY - minY + pad * 2)
348
348
  };
349
349
  }
350
+ function createConnectionGeometryCache() {
351
+ const entries = /* @__PURE__ */ new Map();
352
+ return {
353
+ get(connection, getFrame) {
354
+ const source = getFrame(connection.source.itemId);
355
+ const target = getFrame(connection.target.itemId);
356
+ if (!source || !target) {
357
+ entries.delete(connection.id);
358
+ return null;
359
+ }
360
+ const entry = entries.get(connection.id);
361
+ if (entry && entry.geometry.connection === connection && entry.source === source && entry.target === target) return entry.geometry;
362
+ const resolved = resolveConnection(connection, getFrame);
363
+ if (!resolved) {
364
+ entries.delete(connection.id);
365
+ return null;
366
+ }
367
+ const geometry = {
368
+ connection,
369
+ resolved,
370
+ bounds: connectionBounds(resolved, connection.style.size)
371
+ };
372
+ entries.set(connection.id, {
373
+ source,
374
+ target,
375
+ geometry
376
+ });
377
+ return geometry;
378
+ },
379
+ peek: (connectionId) => entries.get(connectionId)?.geometry ?? null,
380
+ retain(connections) {
381
+ if (entries.size === 0) return;
382
+ const live = new Set(connections.map((connection) => connection.id));
383
+ for (const id of entries.keys()) if (!live.has(id)) entries.delete(id);
384
+ },
385
+ clear: () => entries.clear()
386
+ };
387
+ }
350
388
  /** Distance from a world point to a resolved connection's path. */
351
389
  function distanceToConnection(resolved, point) {
352
390
  let min = Number.POSITIVE_INFINITY;
@@ -369,7 +407,10 @@ function segmentDistance(p, a, b) {
369
407
  }
370
408
  /** Hit test a connection with a zoom-independent screen-space tolerance. */
371
409
  function connectionHitTest(resolved, point, strokeSize) {
372
- return distanceToConnection(resolved, point) <= Math.max(8, strokeSize * 2.5);
410
+ return distanceToConnection(resolved, point) <= connectionHitRadius(strokeSize);
411
+ }
412
+ function connectionHitRadius(strokeSize) {
413
+ return Math.max(8, strokeSize * 2.5);
373
414
  }
374
415
  /** Whether the connection draws an arrowhead at its source / target. */
375
416
  function connectionArrowheads(connection) {
@@ -411,4 +452,4 @@ function createConnectionIndex(connections) {
411
452
  };
412
453
  }
413
454
  //#endregion
414
- export { CONNECTION_ENDPOINT_GAP, anchorPointOnFrame, anchorToWorld, autoConnectionSide, connectionArrowheads, connectionBounds, connectionHitTest, createConnectionIndex, distanceToConnection, pathMidpoint, resolveConnection, worldToAnchor };
455
+ export { CONNECTION_ENDPOINT_GAP, anchorPointOnFrame, anchorToWorld, autoConnectionSide, connectionArrowheads, connectionBounds, connectionHitRadius, connectionHitTest, createConnectionGeometryCache, createConnectionIndex, distanceToConnection, pathMidpoint, resolveConnection, worldToAnchor };
@@ -90,7 +90,8 @@ function createBoardExportScene(input) {
90
90
  getFrame: (id) => frames.get(id),
91
91
  colors: context.colors,
92
92
  colorScheme: input.colorScheme,
93
- zoom: input.scale
93
+ zoom: input.scale,
94
+ cullRect: input.world
94
95
  });
95
96
  }
96
97
  for (const item of input.items) {
@@ -62,6 +62,8 @@ declare const FIT_PADDING = 64;
62
62
  * texture is already requested before the card scrolls into view.
63
63
  */
64
64
  declare const VIEWPORT_MARGIN_RATIO = 0.5;
65
+ /** Viewport plus margin, snapped to a grid so small pans return the same rect. */
66
+ declare function stableCullRect(view: Rect): Rect;
65
67
  declare function clampZoom(zoom: number): number;
66
68
  /** Keep transient camera state finite without discarding its last valid axes. */
67
69
  declare function normalizeViewport(viewport: BoardViewport, fallback?: BoardViewport): BoardViewport;
@@ -162,4 +164,4 @@ declare function fitToContent(content: Rect, surface: Size, padding?: number): B
162
164
  /** World-space rectangle currently visible in the board stage. */
163
165
  declare function visibleWorldRect(viewport: BoardViewport, surfaceWidth: number, surfaceHeight: number): Rect;
164
166
  //#endregion
165
- export { BoardNormalizedPoint, BoardScreenOffset, BoardScreenPoint, BoardWorldOffset, BoardWorldPoint, BoardWorldRect, CORNER_RESIZE_HANDLES, CORNER_ROTATION_ZONE_WIDTH, CornerResizeHandle, EDGE_RESIZE_HANDLES, FIT_PADDING, HANDLE_DIRECTION, HANDLE_HIT_RADIUS, MAX_BOARD_ZOOM, MIN_BOARD_ZOOM, MIN_ITEM_SIZE, Point, RESIZE_HANDLES, ROTATION_HANDLE_OFFSET, Rect, ResizeHandle, ScreenPoint, Size, VIEWPORT_MARGIN_RATIO, WorldPoint, angleFromCenter, cameraForFocus, cameraForRect, cameraForState, clamp, clampZoom, degToRad, expandRect, fitToContent, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, handlePosition, itemBounds, normalizeRotation, normalizeViewport, normalizedPoint, panBy, pointToWorld, pointsBounds, radToDeg, rectCenter, rectContainsPoint, rectForCameraFocus, rectsIntersect, resizeFrame, resizeFrameToSize, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, scaleFrames, screenOffset, screenPoint, screenToWorld, selectionBounds, unionRects, visibleWorldRect, worldOffset, worldPoint, worldRect, worldToScreen, zoomAround };
167
+ export { BoardNormalizedPoint, BoardScreenOffset, BoardScreenPoint, BoardWorldOffset, BoardWorldPoint, BoardWorldRect, CORNER_RESIZE_HANDLES, CORNER_ROTATION_ZONE_WIDTH, CornerResizeHandle, EDGE_RESIZE_HANDLES, FIT_PADDING, HANDLE_DIRECTION, HANDLE_HIT_RADIUS, MAX_BOARD_ZOOM, MIN_BOARD_ZOOM, MIN_ITEM_SIZE, Point, RESIZE_HANDLES, ROTATION_HANDLE_OFFSET, Rect, ResizeHandle, ScreenPoint, Size, VIEWPORT_MARGIN_RATIO, WorldPoint, angleFromCenter, cameraForFocus, cameraForRect, cameraForState, clamp, clampZoom, degToRad, expandRect, fitToContent, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, handlePosition, itemBounds, normalizeRotation, normalizeViewport, normalizedPoint, panBy, pointToWorld, pointsBounds, radToDeg, rectCenter, rectContainsPoint, rectForCameraFocus, rectsIntersect, resizeFrame, resizeFrameToSize, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, scaleFrames, screenOffset, screenPoint, screenToWorld, selectionBounds, stableCullRect, unionRects, visibleWorldRect, worldOffset, worldPoint, worldRect, worldToScreen, zoomAround };
@@ -54,6 +54,21 @@ const FIT_PADDING = 64;
54
54
  * texture is already requested before the card scrolls into view.
55
55
  */
56
56
  const VIEWPORT_MARGIN_RATIO = .5;
57
+ /** Viewport plus margin, snapped to a grid so small pans return the same rect. */
58
+ function stableCullRect(view) {
59
+ const margin = Math.max(view.width, view.height, 1) * VIEWPORT_MARGIN_RATIO;
60
+ const step = 2 ** Math.floor(Math.log2(margin / 2));
61
+ const left = Math.floor((view.x - margin) / step) * step;
62
+ const top = Math.floor((view.y - margin) / step) * step;
63
+ const right = Math.ceil((view.x + view.width + margin) / step) * step;
64
+ const bottom = Math.ceil((view.y + view.height + margin) / step) * step;
65
+ return {
66
+ x: left,
67
+ y: top,
68
+ width: right - left,
69
+ height: bottom - top
70
+ };
71
+ }
57
72
  function clampZoom(zoom) {
58
73
  const value = Number.isFinite(zoom) ? zoom : DEFAULT_BOARD_VIEWPORT.zoom;
59
74
  return Math.min(8, Math.max(MIN_BOARD_ZOOM, value));
@@ -581,4 +596,4 @@ function visibleWorldRect(viewport, surfaceWidth, surfaceHeight) {
581
596
  };
582
597
  }
583
598
  //#endregion
584
- export { CORNER_RESIZE_HANDLES, CORNER_ROTATION_ZONE_WIDTH, EDGE_RESIZE_HANDLES, FIT_PADDING, HANDLE_DIRECTION, HANDLE_HIT_RADIUS, MAX_BOARD_ZOOM, MIN_BOARD_ZOOM, MIN_ITEM_SIZE, RESIZE_HANDLES, ROTATION_HANDLE_OFFSET, VIEWPORT_MARGIN_RATIO, angleFromCenter, cameraForFocus, cameraForRect, cameraForState, clamp, clampZoom, degToRad, expandRect, fitToContent, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, handlePosition, itemBounds, normalizeRotation, normalizeViewport, normalizedPoint, panBy, pointToWorld, pointsBounds, radToDeg, rectCenter, rectContainsPoint, rectForCameraFocus, rectsIntersect, resizeFrame, resizeFrameToSize, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, scaleFrames, screenOffset, screenPoint, screenToWorld, selectionBounds, unionRects, visibleWorldRect, worldOffset, worldPoint, worldRect, worldToScreen, zoomAround };
599
+ export { CORNER_RESIZE_HANDLES, CORNER_ROTATION_ZONE_WIDTH, EDGE_RESIZE_HANDLES, FIT_PADDING, HANDLE_DIRECTION, HANDLE_HIT_RADIUS, MAX_BOARD_ZOOM, MIN_BOARD_ZOOM, MIN_ITEM_SIZE, RESIZE_HANDLES, ROTATION_HANDLE_OFFSET, VIEWPORT_MARGIN_RATIO, angleFromCenter, cameraForFocus, cameraForRect, cameraForState, clamp, clampZoom, degToRad, expandRect, fitToContent, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, handlePosition, itemBounds, normalizeRotation, normalizeViewport, normalizedPoint, panBy, pointToWorld, pointsBounds, radToDeg, rectCenter, rectContainsPoint, rectForCameraFocus, rectsIntersect, resizeFrame, resizeFrameToSize, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, scaleFrames, screenOffset, screenPoint, screenToWorld, selectionBounds, stableCullRect, unionRects, visibleWorldRect, worldOffset, worldPoint, worldRect, worldToScreen, zoomAround };
@@ -8,9 +8,9 @@ import { BOARD_TASK_ARTIFACT_LIMIT, BoardAppearance, BoardAppearanceSchema, Boar
8
8
  import { boardArrowFrame } from "../protocol/dist/board-geometry.js";
9
9
  import "../protocol/dist/index.js";
10
10
  import { BOARD_CHANNELS, BoardExtensionDefinition, BoardExtensionRegistry, BoardPresetDefinition, CompositionInput, DEFAULT_BOARD_LIMITS, ProceduralClipInput, QualityProfile, RenderBounds, SampledTrack, TrackInput, compileComposition, composition, createBoardExtensionRegistry, proceduralClip, sampleCompositionTracks, sampleEasing, sampleTrack, track } from "./animation.js";
11
- import { BoardNormalizedPoint, BoardScreenOffset, BoardScreenPoint, BoardWorldOffset, BoardWorldPoint, BoardWorldRect, CORNER_RESIZE_HANDLES, CORNER_ROTATION_ZONE_WIDTH, CornerResizeHandle, EDGE_RESIZE_HANDLES, FIT_PADDING, HANDLE_DIRECTION, HANDLE_HIT_RADIUS, MAX_BOARD_ZOOM, MIN_BOARD_ZOOM, MIN_ITEM_SIZE, Point, RESIZE_HANDLES, ROTATION_HANDLE_OFFSET, Rect, ResizeHandle, ScreenPoint, Size, VIEWPORT_MARGIN_RATIO, WorldPoint, angleFromCenter, cameraForFocus, cameraForRect, cameraForState, clamp, clampZoom, degToRad, expandRect, fitToContent, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, handlePosition, itemBounds, normalizeRotation, normalizeViewport, normalizedPoint, panBy, pointToWorld, pointsBounds, radToDeg, rectCenter, rectContainsPoint, rectForCameraFocus, rectsIntersect, resizeFrame, resizeFrameToSize, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, scaleFrames, screenOffset, screenPoint, screenToWorld, selectionBounds, unionRects, visibleWorldRect, worldOffset, worldPoint, worldRect, worldToScreen, zoomAround } from "./geometry.js";
11
+ import { BoardNormalizedPoint, BoardScreenOffset, BoardScreenPoint, BoardWorldOffset, BoardWorldPoint, BoardWorldRect, CORNER_RESIZE_HANDLES, CORNER_ROTATION_ZONE_WIDTH, CornerResizeHandle, EDGE_RESIZE_HANDLES, FIT_PADDING, HANDLE_DIRECTION, HANDLE_HIT_RADIUS, MAX_BOARD_ZOOM, MIN_BOARD_ZOOM, MIN_ITEM_SIZE, Point, RESIZE_HANDLES, ROTATION_HANDLE_OFFSET, Rect, ResizeHandle, ScreenPoint, Size, VIEWPORT_MARGIN_RATIO, WorldPoint, angleFromCenter, cameraForFocus, cameraForRect, cameraForState, clamp, clampZoom, degToRad, expandRect, fitToContent, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, handlePosition, itemBounds, normalizeRotation, normalizeViewport, normalizedPoint, panBy, pointToWorld, pointsBounds, radToDeg, rectCenter, rectContainsPoint, rectForCameraFocus, rectsIntersect, resizeFrame, resizeFrameToSize, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, scaleFrames, screenOffset, screenPoint, screenToWorld, selectionBounds, stableCullRect, unionRects, visibleWorldRect, worldOffset, worldPoint, worldRect, worldToScreen, zoomAround } from "./geometry.js";
12
12
  import { ResolvedArrow, arrowBounds, arrowFrame, distanceToArrow, resolveArrow, sampleArrow, translateArrow } from "./core/arrow-geometry.js";
13
- import { CONNECTION_ENDPOINT_GAP, ConnectionIndex, FrameLookup, ResolvedConnection, ResolvedConnectionEndpoint, anchorPointOnFrame, anchorToWorld, autoConnectionSide, connectionArrowheads, connectionBounds, connectionHitTest, createConnectionIndex, distanceToConnection, pathMidpoint, resolveConnection, worldToAnchor } from "./core/connections.js";
13
+ import { CONNECTION_ENDPOINT_GAP, ConnectionGeometry, ConnectionGeometryCache, ConnectionIndex, FrameLookup, ResolvedConnection, ResolvedConnectionEndpoint, anchorPointOnFrame, anchorToWorld, autoConnectionSide, connectionArrowheads, connectionBounds, connectionHitRadius, connectionHitTest, createConnectionGeometryCache, createConnectionIndex, distanceToConnection, pathMidpoint, resolveConnection, worldToAnchor } from "./core/connections.js";
14
14
  import { StrokeRibbonGeometry, buildStrokeOutline, buildStrokeRibbonGeometry, computeDrawBounds, distanceToStroke, isStrokeCorner, sampleRadius, simplifyDrawIndices } from "./core/draw-geometry.js";
15
15
  import { BOARD_EXPORT_MAX_TEXTURES, BoardExportAssetSelection, selectBoardExportAssets } from "./core/export-assets.js";
16
16
  import { BOARD_EXPORT_DEFAULT_PADDING, BOARD_EXPORT_DEFAULT_SCALE, BOARD_EXPORT_ITEM_WARN_THRESHOLD, BOARD_EXPORT_MAX_EDGE, BOARD_EXPORT_MAX_PIXELS, BoardExportPlan, BoardExportPlanInput, BoardExportRegion, boardFrameLookup, exportConnectionBounds, exportItemBounds, normalizeBoardDocument, planBoardExport } from "./core/export-plan.js";
@@ -29,4 +29,4 @@ import { patchBoardAppearance } from "./mutation.js";
29
29
  import { BoardReplayActorKind, BoardReplayEntry, BoardReplayPlayer, boardReplayActorKind, createBoardReplayPlayer } from "./replay.js";
30
30
  import { applyBoardSemanticCommands, boardDocumentToSemanticCommands } from "./semantic-mutation.js";
31
31
  import { featuredTaskArtifact, rankedTaskArtifacts, taskArtifactPreviewUrl, taskArtifacts, taskRunToBoardTaskSnapshot } from "./task.js";
32
- export { AUTO_BOARD_CONNECTION_ANCHOR, type ArrowShapeProps, type AudioShapeProps, BOARD_CHANNELS, BOARD_COLORS, BOARD_CONNECTION_DIRECTIONS, BOARD_CONNECTION_LINES, BOARD_CONNECTION_ROUTINGS, BOARD_CONNECTION_SIDES, BOARD_DOCUMENT_KIND, BOARD_EXPORT_DEFAULT_PADDING, BOARD_EXPORT_DEFAULT_SCALE, BOARD_EXPORT_ITEM_WARN_THRESHOLD, BOARD_EXPORT_MAX_EDGE, BOARD_EXPORT_MAX_PIXELS, BOARD_EXPORT_MAX_TEXTURES, BOARD_EXTENSION, BOARD_REMOTE_URL_MAX_LENGTH, BOARD_STROKE_MAX_SIZE, BOARD_STROKE_MIN_SIZE, BOARD_TASK_ARTIFACT_LIMIT, BoardAppearance, BoardAppearanceSchema, BoardArrowItem, BoardArrowItemSchema, BoardAssetSource, BoardAudioItem, BoardAudioItemSchema, type BoardCameraFocus, type BoardCameraFocusParams, BoardCameraFocusParamsSchema, BoardCameraFocusSchema, type BoardCameraState, BoardCameraStateSchema, BoardColorEntry, type BoardColorId, BoardColorValue, BoardConnection, BoardConnectionAnchor, BoardConnectionAnchorSchema, BoardConnectionDirection, BoardConnectionEndpoint, BoardConnectionEndpointSchema, BoardConnectionInput, BoardConnectionLine, BoardConnectionPatch, BoardConnectionPatchSchema, BoardConnectionRecord, BoardConnectionRouting, BoardConnectionRoutingConfig, BoardConnectionRoutingSchema, BoardConnectionSchema, BoardConnectionSide, BoardConnectionStyle, BoardConnectionStyleSchema, BoardConnectionWaypointSchema, BoardDocument, BoardDocumentSchema, BoardDrawItem, BoardDrawItemSchema, BoardExportAssetSelection, BoardExportPlan, BoardExportPlanInput, BoardExportRegion, BoardExtensionDefinition, BoardExtensionRegistry, BoardFileItem, BoardFileItemSchema, BoardFileSnapshot, type BoardFileSnapshotFacts, BoardFileSnapshotSchema, BoardFrame, BoardFrameItem, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItem, BoardGeoItemSchema, BoardImageItem, BoardImageItemSchema, BoardItem, BoardItemSchema, BoardItemStyle, BoardItemStyleSchema, BoardKnownItem, BoardMediaKind, BoardMediaSnapshot, BoardMediaSnapshotSchema, BoardNormalizedPoint, BoardPlayableMedia, BoardPoint, BoardPointSchema, BoardPresetDefinition, BoardRelationSchema, BoardRemoteUrlSchema, BoardReplayActorKind, BoardReplayEntry, BoardReplayPlayer, BoardScreenOffset, BoardScreenPoint, BoardShapeColors, BoardStyledToolId, BoardTaskArtifact, BoardTaskArtifactSchema, BoardTaskItem, BoardTaskItemSchema, BoardTaskSnapshot, BoardTaskSnapshotSchema, BoardTextItem, BoardTextItemSchema, BoardToolStyleMap, BoardToolStylePatch, type BoardTrackInterpolation, BoardUnknownItem, BoardVideoItem, BoardVideoItemSchema, BoardViewport, BoardViewportSchema, BoardWorldOffset, BoardWorldPoint, BoardWorldRect, type BuildSnapshotInput, CONNECTION_ENDPOINT_GAP, CORNER_RESIZE_HANDLES, CORNER_ROTATION_ZONE_WIDTH, CompositionInput, ConnectionIndex, CornerResizeHandle, DEFAULT_BOARD_APPEARANCE, DEFAULT_BOARD_COLOR, DEFAULT_BOARD_CONNECTION_ROUTING, DEFAULT_BOARD_CONNECTION_STYLE, DEFAULT_BOARD_LIMITS, DEFAULT_BOARD_RELATION, DEFAULT_BOARD_TOOL_STYLES, DrawPoint, DrawPointSchema, type DrawShapeProps, EDGE_RESIZE_HANDLES, FILE_EXCERPT_MAX_BYTES, FILE_EXCERPT_MAX_CHARS, FIT_PADDING, FULL_CAPABILITIES, FileAvailability, type FileCategory, FilePreviewKind, FrameLookup, GEO_KINDS, type GeoKind, type GeoShapeProps, HANDLE_DIRECTION, HANDLE_HIT_RADIUS, type HandleDragResult, type ImageShapeProps, KNOWN_BOARD_ITEM_TYPES, KnownBoardItemType, MAX_BOARD_ZOOM, MIN_BOARD_ZOOM, MIN_ITEM_SIZE, Point, ProceduralClipInput, QualityProfile, RESIZE_HANDLES, ROTATION_HANDLE_OFFSET, Rect, RenderBounds, ResizeHandle, ResolvedArrow, ResolvedConnection, ResolvedConnectionEndpoint, type ResolvedCover, SampledTrack, ScreenPoint, type ShapeCapabilities, ShapeDefinition, type ShapeGeometry, type ShapeHandle, type ShapeHandleId, type ShapeResizeMode, Size, SpaceFileRef, SpaceFileRefSchema, StrokeRibbonGeometry, TEXT_FONT_FAMILY, TEXT_FONT_SIZE, TEXT_LINE_HEIGHT, TEXT_MAX_FONT_SIZE, TEXT_MIN_FONT_SIZE, type TextShapeProps, TrackInput, UNKNOWN_BOARD_ITEM_TYPE, VIEWPORT_MARGIN_RATIO, type VideoShapeProps, WorldPoint, anchorPointOnFrame, anchorToWorld, angleFromCenter, applyBoardAuthoringSnapshot, applyBoardSemanticCommands, arrowBounds, arrowFrame, autoConnectionSide, availabilityFromError, boardAuthoringItemToDocumentItem, boardAuthoringSnapshotToDocument, boardColorCssVar, boardDocumentToSemanticCommands, boardFrameLookup, boardImageKeySource, boardItemToAuthoringItem, boardReplayActorKind, boardTextLineHeight, buildCodeExcerpt, buildFallbackShapeColors, buildFileExcerpt, buildFileSnapshot, buildStrokeOutline, buildStrokeRibbonGeometry, cameraForFocus, cameraForRect, cameraForState, clamp, clampBoardStrokeSize, clampBoardTextFontSize, clampZoom, compileComposition, composition, boardArrowFrame as computeArrowFrame, computeDrawBounds, connectionArrowheads, connectionBounds, connectionHitTest, connectionItemIds, connectionOtherItemId, connectionTouchesItem, createBoardConnection, createBoardExtensionRegistry, createBoardReplayPlayer, createBoardToolStyles, createConnectionIndex, definitionForItem, degToRad, distanceToArrow, distanceToConnection, distanceToStroke, expandRect, exportConnectionBounds, exportItemBounds, featuredTaskArtifact, fileBaseName, fileCategory, fileCategoryAccent, fileMetaLine, filePreviewKind, filePreviewMemoKey, filePreviewScope, fileStem, fileTypeLabel, fitToContent, flipBoardConnection, formatFileSize, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, getMediaExtension, getMediaResourceTitle, getShapeDefinition, handlePosition, imageAssetKey, inferBoardMediaKind, isBoardColorId, isBoardPath, isFileBackedItem, isFileSnapshotFresh, isGeoKind, isMediaItem, isPublicBoardRemoteAddress, isStrokeCorner, isUnknownItem, itemBounds, measureBoardText, mergeFileSnapshot, normalizeBoardConnectionStyle, normalizeBoardDocument, normalizeBoardRemoteUrl, normalizeRotation, normalizeViewport, normalizedPoint, panBy, parseBoardDocument, parseBoardItemLoose, parseBoardManifest, patchBoardAppearance, pathMidpoint, pickBoardColor, planBoardExport, playableBoardMedia, playableBoardMediaList, pointToWorld, pointsBounds, proceduralClip, radToDeg, rankedTaskArtifacts, readCoverFromFrontmatter, readFrontmatterScalars, readTitleFromFrontmatter, rectCenter, rectContainsPoint, rectForCameraFocus, rectsIntersect, registerShapeDefinition, resetBoardPlaybackUrlCache, resizeFrame, resizeFrameToSize, resizeModeForCapabilities, resolveArrow, resolveBoardColor, resolveConnection, resolveCoverRef, resolveFileTitle, resolveSpacePath, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, sampleArrow, sampleCompositionTracks, sampleEasing, sampleRadius, sampleTrack, scaleFrames, screenOffset, screenPoint, screenToWorld, selectBoardExportAssets, selectionBounds, serializeBoardManifest, setBoardTextMeasurer, shapeBounds, shapeCapabilities, shapeHandles, shapeHitTest, shapeResizeMode, shouldFetchFileExcerpt, simplifyDrawIndices, splitFrontmatter, taskArtifactPreviewUrl, taskArtifacts, taskRunToBoardTaskSnapshot, track, translateArrow, unionRects, unknownRealType, unknownShapeDefinition, visibleWorldRect, withResolvedConnections, worldOffset, worldPoint, worldRect, worldToAnchor, worldToScreen, zoomAround };
32
+ export { AUTO_BOARD_CONNECTION_ANCHOR, type ArrowShapeProps, type AudioShapeProps, BOARD_CHANNELS, BOARD_COLORS, BOARD_CONNECTION_DIRECTIONS, BOARD_CONNECTION_LINES, BOARD_CONNECTION_ROUTINGS, BOARD_CONNECTION_SIDES, BOARD_DOCUMENT_KIND, BOARD_EXPORT_DEFAULT_PADDING, BOARD_EXPORT_DEFAULT_SCALE, BOARD_EXPORT_ITEM_WARN_THRESHOLD, BOARD_EXPORT_MAX_EDGE, BOARD_EXPORT_MAX_PIXELS, BOARD_EXPORT_MAX_TEXTURES, BOARD_EXTENSION, BOARD_REMOTE_URL_MAX_LENGTH, BOARD_STROKE_MAX_SIZE, BOARD_STROKE_MIN_SIZE, BOARD_TASK_ARTIFACT_LIMIT, BoardAppearance, BoardAppearanceSchema, BoardArrowItem, BoardArrowItemSchema, BoardAssetSource, BoardAudioItem, BoardAudioItemSchema, type BoardCameraFocus, type BoardCameraFocusParams, BoardCameraFocusParamsSchema, BoardCameraFocusSchema, type BoardCameraState, BoardCameraStateSchema, BoardColorEntry, type BoardColorId, BoardColorValue, BoardConnection, BoardConnectionAnchor, BoardConnectionAnchorSchema, BoardConnectionDirection, BoardConnectionEndpoint, BoardConnectionEndpointSchema, BoardConnectionInput, BoardConnectionLine, BoardConnectionPatch, BoardConnectionPatchSchema, BoardConnectionRecord, BoardConnectionRouting, BoardConnectionRoutingConfig, BoardConnectionRoutingSchema, BoardConnectionSchema, BoardConnectionSide, BoardConnectionStyle, BoardConnectionStyleSchema, BoardConnectionWaypointSchema, BoardDocument, BoardDocumentSchema, BoardDrawItem, BoardDrawItemSchema, BoardExportAssetSelection, BoardExportPlan, BoardExportPlanInput, BoardExportRegion, BoardExtensionDefinition, BoardExtensionRegistry, BoardFileItem, BoardFileItemSchema, BoardFileSnapshot, type BoardFileSnapshotFacts, BoardFileSnapshotSchema, BoardFrame, BoardFrameItem, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItem, BoardGeoItemSchema, BoardImageItem, BoardImageItemSchema, BoardItem, BoardItemSchema, BoardItemStyle, BoardItemStyleSchema, BoardKnownItem, BoardMediaKind, BoardMediaSnapshot, BoardMediaSnapshotSchema, BoardNormalizedPoint, BoardPlayableMedia, BoardPoint, BoardPointSchema, BoardPresetDefinition, BoardRelationSchema, BoardRemoteUrlSchema, BoardReplayActorKind, BoardReplayEntry, BoardReplayPlayer, BoardScreenOffset, BoardScreenPoint, BoardShapeColors, BoardStyledToolId, BoardTaskArtifact, BoardTaskArtifactSchema, BoardTaskItem, BoardTaskItemSchema, BoardTaskSnapshot, BoardTaskSnapshotSchema, BoardTextItem, BoardTextItemSchema, BoardToolStyleMap, BoardToolStylePatch, type BoardTrackInterpolation, BoardUnknownItem, BoardVideoItem, BoardVideoItemSchema, BoardViewport, BoardViewportSchema, BoardWorldOffset, BoardWorldPoint, BoardWorldRect, type BuildSnapshotInput, CONNECTION_ENDPOINT_GAP, CORNER_RESIZE_HANDLES, CORNER_ROTATION_ZONE_WIDTH, CompositionInput, ConnectionGeometry, ConnectionGeometryCache, ConnectionIndex, CornerResizeHandle, DEFAULT_BOARD_APPEARANCE, DEFAULT_BOARD_COLOR, DEFAULT_BOARD_CONNECTION_ROUTING, DEFAULT_BOARD_CONNECTION_STYLE, DEFAULT_BOARD_LIMITS, DEFAULT_BOARD_RELATION, DEFAULT_BOARD_TOOL_STYLES, DrawPoint, DrawPointSchema, type DrawShapeProps, EDGE_RESIZE_HANDLES, FILE_EXCERPT_MAX_BYTES, FILE_EXCERPT_MAX_CHARS, FIT_PADDING, FULL_CAPABILITIES, FileAvailability, type FileCategory, FilePreviewKind, FrameLookup, GEO_KINDS, type GeoKind, type GeoShapeProps, HANDLE_DIRECTION, HANDLE_HIT_RADIUS, type HandleDragResult, type ImageShapeProps, KNOWN_BOARD_ITEM_TYPES, KnownBoardItemType, MAX_BOARD_ZOOM, MIN_BOARD_ZOOM, MIN_ITEM_SIZE, Point, ProceduralClipInput, QualityProfile, RESIZE_HANDLES, ROTATION_HANDLE_OFFSET, Rect, RenderBounds, ResizeHandle, ResolvedArrow, ResolvedConnection, ResolvedConnectionEndpoint, type ResolvedCover, SampledTrack, ScreenPoint, type ShapeCapabilities, ShapeDefinition, type ShapeGeometry, type ShapeHandle, type ShapeHandleId, type ShapeResizeMode, Size, SpaceFileRef, SpaceFileRefSchema, StrokeRibbonGeometry, TEXT_FONT_FAMILY, TEXT_FONT_SIZE, TEXT_LINE_HEIGHT, TEXT_MAX_FONT_SIZE, TEXT_MIN_FONT_SIZE, type TextShapeProps, TrackInput, UNKNOWN_BOARD_ITEM_TYPE, VIEWPORT_MARGIN_RATIO, type VideoShapeProps, WorldPoint, anchorPointOnFrame, anchorToWorld, angleFromCenter, applyBoardAuthoringSnapshot, applyBoardSemanticCommands, arrowBounds, arrowFrame, autoConnectionSide, availabilityFromError, boardAuthoringItemToDocumentItem, boardAuthoringSnapshotToDocument, boardColorCssVar, boardDocumentToSemanticCommands, boardFrameLookup, boardImageKeySource, boardItemToAuthoringItem, boardReplayActorKind, boardTextLineHeight, buildCodeExcerpt, buildFallbackShapeColors, buildFileExcerpt, buildFileSnapshot, buildStrokeOutline, buildStrokeRibbonGeometry, cameraForFocus, cameraForRect, cameraForState, clamp, clampBoardStrokeSize, clampBoardTextFontSize, clampZoom, compileComposition, composition, boardArrowFrame as computeArrowFrame, computeDrawBounds, connectionArrowheads, connectionBounds, connectionHitRadius, connectionHitTest, connectionItemIds, connectionOtherItemId, connectionTouchesItem, createBoardConnection, createBoardExtensionRegistry, createBoardReplayPlayer, createBoardToolStyles, createConnectionGeometryCache, createConnectionIndex, definitionForItem, degToRad, distanceToArrow, distanceToConnection, distanceToStroke, expandRect, exportConnectionBounds, exportItemBounds, featuredTaskArtifact, fileBaseName, fileCategory, fileCategoryAccent, fileMetaLine, filePreviewKind, filePreviewMemoKey, filePreviewScope, fileStem, fileTypeLabel, fitToContent, flipBoardConnection, formatFileSize, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, getMediaExtension, getMediaResourceTitle, getShapeDefinition, handlePosition, imageAssetKey, inferBoardMediaKind, isBoardColorId, isBoardPath, isFileBackedItem, isFileSnapshotFresh, isGeoKind, isMediaItem, isPublicBoardRemoteAddress, isStrokeCorner, isUnknownItem, itemBounds, measureBoardText, mergeFileSnapshot, normalizeBoardConnectionStyle, normalizeBoardDocument, normalizeBoardRemoteUrl, normalizeRotation, normalizeViewport, normalizedPoint, panBy, parseBoardDocument, parseBoardItemLoose, parseBoardManifest, patchBoardAppearance, pathMidpoint, pickBoardColor, planBoardExport, playableBoardMedia, playableBoardMediaList, pointToWorld, pointsBounds, proceduralClip, radToDeg, rankedTaskArtifacts, readCoverFromFrontmatter, readFrontmatterScalars, readTitleFromFrontmatter, rectCenter, rectContainsPoint, rectForCameraFocus, rectsIntersect, registerShapeDefinition, resetBoardPlaybackUrlCache, resizeFrame, resizeFrameToSize, resizeModeForCapabilities, resolveArrow, resolveBoardColor, resolveConnection, resolveCoverRef, resolveFileTitle, resolveSpacePath, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, sampleArrow, sampleCompositionTracks, sampleEasing, sampleRadius, sampleTrack, scaleFrames, screenOffset, screenPoint, screenToWorld, selectBoardExportAssets, selectionBounds, serializeBoardManifest, setBoardTextMeasurer, shapeBounds, shapeCapabilities, shapeHandles, shapeHitTest, shapeResizeMode, shouldFetchFileExcerpt, simplifyDrawIndices, splitFrontmatter, stableCullRect, taskArtifactPreviewUrl, taskArtifacts, taskRunToBoardTaskSnapshot, track, translateArrow, unionRects, unknownRealType, unknownShapeDefinition, visibleWorldRect, withResolvedConnections, worldOffset, worldPoint, worldRect, worldToAnchor, worldToScreen, zoomAround };
@@ -5,12 +5,12 @@ import { BOARD_REMOTE_URL_MAX_LENGTH, BoardRemoteUrlSchema, isPublicBoardRemoteA
5
5
  import { BOARD_TASK_ARTIFACT_LIMIT, BoardAppearanceSchema, BoardArrowItemSchema, BoardAudioItemSchema, BoardDocumentSchema, BoardDrawItemSchema, BoardFileItemSchema, BoardFileSnapshotSchema, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItemSchema, BoardImageItemSchema, BoardItemSchema, BoardItemStyleSchema, BoardMediaSnapshotSchema, BoardPointSchema, BoardTaskArtifactSchema, BoardTaskItemSchema, BoardTaskSnapshotSchema, BoardTextItemSchema, BoardVideoItemSchema, BoardViewportSchema, DrawPointSchema, KNOWN_BOARD_ITEM_TYPES, SpaceFileRefSchema, UNKNOWN_BOARD_ITEM_TYPE, isFileBackedItem, isMediaItem, isUnknownItem, parseBoardDocument, parseBoardItemLoose, unknownRealType, withResolvedConnections } from "../protocol/dist/board-document.js";
6
6
  import { boardArrowFrame } from "../protocol/dist/board-geometry.js";
7
7
  import { BOARD_CHANNELS, BoardExtensionRegistry, DEFAULT_BOARD_LIMITS, compileComposition, composition, createBoardExtensionRegistry, proceduralClip, sampleCompositionTracks, sampleEasing, sampleTrack, track } from "./animation.js";
8
- import { CORNER_RESIZE_HANDLES, CORNER_ROTATION_ZONE_WIDTH, EDGE_RESIZE_HANDLES, FIT_PADDING, HANDLE_DIRECTION, HANDLE_HIT_RADIUS, MAX_BOARD_ZOOM, MIN_BOARD_ZOOM, MIN_ITEM_SIZE, RESIZE_HANDLES, ROTATION_HANDLE_OFFSET, VIEWPORT_MARGIN_RATIO, angleFromCenter, cameraForFocus, cameraForRect, cameraForState, clamp, clampZoom, degToRad, expandRect, fitToContent, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, handlePosition, itemBounds, normalizeRotation, normalizeViewport, normalizedPoint, panBy, pointToWorld, pointsBounds, radToDeg, rectCenter, rectContainsPoint, rectForCameraFocus, rectsIntersect, resizeFrame, resizeFrameToSize, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, scaleFrames, screenOffset, screenPoint, screenToWorld, selectionBounds, unionRects, visibleWorldRect, worldOffset, worldPoint, worldRect, worldToScreen, zoomAround } from "./geometry.js";
8
+ import { CORNER_RESIZE_HANDLES, CORNER_ROTATION_ZONE_WIDTH, EDGE_RESIZE_HANDLES, FIT_PADDING, HANDLE_DIRECTION, HANDLE_HIT_RADIUS, MAX_BOARD_ZOOM, MIN_BOARD_ZOOM, MIN_ITEM_SIZE, RESIZE_HANDLES, ROTATION_HANDLE_OFFSET, VIEWPORT_MARGIN_RATIO, angleFromCenter, cameraForFocus, cameraForRect, cameraForState, clamp, clampZoom, degToRad, expandRect, fitToContent, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, handlePosition, itemBounds, normalizeRotation, normalizeViewport, normalizedPoint, panBy, pointToWorld, pointsBounds, radToDeg, rectCenter, rectContainsPoint, rectForCameraFocus, rectsIntersect, resizeFrame, resizeFrameToSize, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, scaleFrames, screenOffset, screenPoint, screenToWorld, selectionBounds, stableCullRect, unionRects, visibleWorldRect, worldOffset, worldPoint, worldRect, worldToScreen, zoomAround } from "./geometry.js";
9
9
  import { featuredTaskArtifact, rankedTaskArtifacts, taskArtifactPreviewUrl, taskArtifacts, taskRunToBoardTaskSnapshot } from "./task.js";
10
10
  import { boardImageKeySource, imageAssetKey } from "./image-key.js";
11
11
  import { DEFAULT_BOARD_APPEARANCE, applyBoardAuthoringSnapshot, boardAuthoringItemToDocumentItem, boardAuthoringSnapshotToDocument, boardItemToAuthoringItem } from "./semantic-document.js";
12
12
  import { arrowBounds, arrowFrame, distanceToArrow, resolveArrow, sampleArrow, translateArrow } from "./core/arrow-geometry.js";
13
- import { CONNECTION_ENDPOINT_GAP, anchorPointOnFrame, anchorToWorld, autoConnectionSide, connectionArrowheads, connectionBounds, connectionHitTest, createConnectionIndex, distanceToConnection, pathMidpoint, resolveConnection, worldToAnchor } from "./core/connections.js";
13
+ import { CONNECTION_ENDPOINT_GAP, anchorPointOnFrame, anchorToWorld, autoConnectionSide, connectionArrowheads, connectionBounds, connectionHitRadius, connectionHitTest, createConnectionGeometryCache, createConnectionIndex, distanceToConnection, pathMidpoint, resolveConnection, worldToAnchor } from "./core/connections.js";
14
14
  import { buildStrokeOutline, buildStrokeRibbonGeometry, computeDrawBounds, distanceToStroke, isStrokeCorner, sampleRadius, simplifyDrawIndices } from "./core/draw-geometry.js";
15
15
  import { BOARD_EXPORT_MAX_TEXTURES, selectBoardExportAssets } from "./core/export-assets.js";
16
16
  import { BOARD_EXPORT_DEFAULT_PADDING, BOARD_EXPORT_DEFAULT_SCALE, BOARD_EXPORT_ITEM_WARN_THRESHOLD, BOARD_EXPORT_MAX_EDGE, BOARD_EXPORT_MAX_PIXELS, boardFrameLookup, exportConnectionBounds, exportItemBounds, normalizeBoardDocument, planBoardExport } from "./core/export-plan.js";
@@ -26,4 +26,4 @@ import { playableBoardMedia, playableBoardMediaList, resetBoardPlaybackUrlCache
26
26
  import { patchBoardAppearance } from "./mutation.js";
27
27
  import { boardReplayActorKind, createBoardReplayPlayer } from "./replay.js";
28
28
  import { applyBoardSemanticCommands, boardDocumentToSemanticCommands } from "./semantic-mutation.js";
29
- export { AUTO_BOARD_CONNECTION_ANCHOR, BOARD_CHANNELS, BOARD_COLORS, BOARD_CONNECTION_DIRECTIONS, BOARD_CONNECTION_LINES, BOARD_CONNECTION_ROUTINGS, BOARD_CONNECTION_SIDES, BOARD_DOCUMENT_KIND, BOARD_EXPORT_DEFAULT_PADDING, BOARD_EXPORT_DEFAULT_SCALE, BOARD_EXPORT_ITEM_WARN_THRESHOLD, BOARD_EXPORT_MAX_EDGE, BOARD_EXPORT_MAX_PIXELS, BOARD_EXPORT_MAX_TEXTURES, BOARD_EXTENSION, BOARD_REMOTE_URL_MAX_LENGTH, BOARD_STROKE_MAX_SIZE, BOARD_STROKE_MIN_SIZE, BOARD_TASK_ARTIFACT_LIMIT, BoardAppearanceSchema, BoardArrowItemSchema, BoardAudioItemSchema, BoardCameraFocusParamsSchema, BoardCameraFocusSchema, BoardCameraStateSchema, BoardConnectionAnchorSchema, BoardConnectionEndpointSchema, BoardConnectionPatchSchema, BoardConnectionRoutingSchema, BoardConnectionSchema, BoardConnectionStyleSchema, BoardConnectionWaypointSchema, BoardDocumentSchema, BoardDrawItemSchema, BoardExtensionRegistry, BoardFileItemSchema, BoardFileSnapshotSchema, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItemSchema, BoardImageItemSchema, BoardItemSchema, BoardItemStyleSchema, BoardMediaSnapshotSchema, BoardPointSchema, BoardRelationSchema, BoardRemoteUrlSchema, BoardTaskArtifactSchema, BoardTaskItemSchema, BoardTaskSnapshotSchema, BoardTextItemSchema, BoardVideoItemSchema, BoardViewportSchema, CONNECTION_ENDPOINT_GAP, CORNER_RESIZE_HANDLES, CORNER_ROTATION_ZONE_WIDTH, DEFAULT_BOARD_APPEARANCE, DEFAULT_BOARD_COLOR, DEFAULT_BOARD_CONNECTION_ROUTING, DEFAULT_BOARD_CONNECTION_STYLE, DEFAULT_BOARD_LIMITS, DEFAULT_BOARD_RELATION, DEFAULT_BOARD_TOOL_STYLES, DrawPointSchema, EDGE_RESIZE_HANDLES, FILE_EXCERPT_MAX_BYTES, FILE_EXCERPT_MAX_CHARS, FIT_PADDING, FULL_CAPABILITIES, GEO_KINDS, HANDLE_DIRECTION, HANDLE_HIT_RADIUS, KNOWN_BOARD_ITEM_TYPES, MAX_BOARD_ZOOM, MIN_BOARD_ZOOM, MIN_ITEM_SIZE, RESIZE_HANDLES, ROTATION_HANDLE_OFFSET, SpaceFileRefSchema, TEXT_FONT_FAMILY, TEXT_FONT_SIZE, TEXT_LINE_HEIGHT, TEXT_MAX_FONT_SIZE, TEXT_MIN_FONT_SIZE, UNKNOWN_BOARD_ITEM_TYPE, VIEWPORT_MARGIN_RATIO, anchorPointOnFrame, anchorToWorld, angleFromCenter, applyBoardAuthoringSnapshot, applyBoardSemanticCommands, arrowBounds, arrowFrame, autoConnectionSide, availabilityFromError, boardAuthoringItemToDocumentItem, boardAuthoringSnapshotToDocument, boardColorCssVar, boardDocumentToSemanticCommands, boardFrameLookup, boardImageKeySource, boardItemToAuthoringItem, boardReplayActorKind, boardTextLineHeight, buildCodeExcerpt, buildFallbackShapeColors, buildFileExcerpt, buildFileSnapshot, buildStrokeOutline, buildStrokeRibbonGeometry, cameraForFocus, cameraForRect, cameraForState, clamp, clampBoardStrokeSize, clampBoardTextFontSize, clampZoom, compileComposition, composition, boardArrowFrame as computeArrowFrame, computeDrawBounds, connectionArrowheads, connectionBounds, connectionHitTest, connectionItemIds, connectionOtherItemId, connectionTouchesItem, createBoardConnection, createBoardExtensionRegistry, createBoardReplayPlayer, createBoardToolStyles, createConnectionIndex, definitionForItem, degToRad, distanceToArrow, distanceToConnection, distanceToStroke, expandRect, exportConnectionBounds, exportItemBounds, featuredTaskArtifact, fileBaseName, fileCategory, fileCategoryAccent, fileMetaLine, filePreviewKind, filePreviewMemoKey, filePreviewScope, fileStem, fileTypeLabel, fitToContent, flipBoardConnection, formatFileSize, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, getMediaExtension, getMediaResourceTitle, getShapeDefinition, handlePosition, imageAssetKey, inferBoardMediaKind, isBoardColorId, isBoardPath, isFileBackedItem, isFileSnapshotFresh, isGeoKind, isMediaItem, isPublicBoardRemoteAddress, isStrokeCorner, isUnknownItem, itemBounds, measureBoardText, mergeFileSnapshot, normalizeBoardConnectionStyle, normalizeBoardDocument, normalizeBoardRemoteUrl, normalizeRotation, normalizeViewport, normalizedPoint, panBy, parseBoardDocument, parseBoardItemLoose, parseBoardManifest, patchBoardAppearance, pathMidpoint, pickBoardColor, planBoardExport, playableBoardMedia, playableBoardMediaList, pointToWorld, pointsBounds, proceduralClip, radToDeg, rankedTaskArtifacts, readCoverFromFrontmatter, readFrontmatterScalars, readTitleFromFrontmatter, rectCenter, rectContainsPoint, rectForCameraFocus, rectsIntersect, registerShapeDefinition, resetBoardPlaybackUrlCache, resizeFrame, resizeFrameToSize, resizeModeForCapabilities, resolveArrow, resolveBoardColor, resolveConnection, resolveCoverRef, resolveFileTitle, resolveSpacePath, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, sampleArrow, sampleCompositionTracks, sampleEasing, sampleRadius, sampleTrack, scaleFrames, screenOffset, screenPoint, screenToWorld, selectBoardExportAssets, selectionBounds, serializeBoardManifest, setBoardTextMeasurer, shapeBounds, shapeCapabilities, shapeHandles, shapeHitTest, shapeResizeMode, shouldFetchFileExcerpt, simplifyDrawIndices, splitFrontmatter, taskArtifactPreviewUrl, taskArtifacts, taskRunToBoardTaskSnapshot, track, translateArrow, unionRects, unknownRealType, unknownShapeDefinition, visibleWorldRect, withResolvedConnections, worldOffset, worldPoint, worldRect, worldToAnchor, worldToScreen, zoomAround };
29
+ export { AUTO_BOARD_CONNECTION_ANCHOR, BOARD_CHANNELS, BOARD_COLORS, BOARD_CONNECTION_DIRECTIONS, BOARD_CONNECTION_LINES, BOARD_CONNECTION_ROUTINGS, BOARD_CONNECTION_SIDES, BOARD_DOCUMENT_KIND, BOARD_EXPORT_DEFAULT_PADDING, BOARD_EXPORT_DEFAULT_SCALE, BOARD_EXPORT_ITEM_WARN_THRESHOLD, BOARD_EXPORT_MAX_EDGE, BOARD_EXPORT_MAX_PIXELS, BOARD_EXPORT_MAX_TEXTURES, BOARD_EXTENSION, BOARD_REMOTE_URL_MAX_LENGTH, BOARD_STROKE_MAX_SIZE, BOARD_STROKE_MIN_SIZE, BOARD_TASK_ARTIFACT_LIMIT, BoardAppearanceSchema, BoardArrowItemSchema, BoardAudioItemSchema, BoardCameraFocusParamsSchema, BoardCameraFocusSchema, BoardCameraStateSchema, BoardConnectionAnchorSchema, BoardConnectionEndpointSchema, BoardConnectionPatchSchema, BoardConnectionRoutingSchema, BoardConnectionSchema, BoardConnectionStyleSchema, BoardConnectionWaypointSchema, BoardDocumentSchema, BoardDrawItemSchema, BoardExtensionRegistry, BoardFileItemSchema, BoardFileSnapshotSchema, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItemSchema, BoardImageItemSchema, BoardItemSchema, BoardItemStyleSchema, BoardMediaSnapshotSchema, BoardPointSchema, BoardRelationSchema, BoardRemoteUrlSchema, BoardTaskArtifactSchema, BoardTaskItemSchema, BoardTaskSnapshotSchema, BoardTextItemSchema, BoardVideoItemSchema, BoardViewportSchema, CONNECTION_ENDPOINT_GAP, CORNER_RESIZE_HANDLES, CORNER_ROTATION_ZONE_WIDTH, DEFAULT_BOARD_APPEARANCE, DEFAULT_BOARD_COLOR, DEFAULT_BOARD_CONNECTION_ROUTING, DEFAULT_BOARD_CONNECTION_STYLE, DEFAULT_BOARD_LIMITS, DEFAULT_BOARD_RELATION, DEFAULT_BOARD_TOOL_STYLES, DrawPointSchema, EDGE_RESIZE_HANDLES, FILE_EXCERPT_MAX_BYTES, FILE_EXCERPT_MAX_CHARS, FIT_PADDING, FULL_CAPABILITIES, GEO_KINDS, HANDLE_DIRECTION, HANDLE_HIT_RADIUS, KNOWN_BOARD_ITEM_TYPES, MAX_BOARD_ZOOM, MIN_BOARD_ZOOM, MIN_ITEM_SIZE, RESIZE_HANDLES, ROTATION_HANDLE_OFFSET, SpaceFileRefSchema, TEXT_FONT_FAMILY, TEXT_FONT_SIZE, TEXT_LINE_HEIGHT, TEXT_MAX_FONT_SIZE, TEXT_MIN_FONT_SIZE, UNKNOWN_BOARD_ITEM_TYPE, VIEWPORT_MARGIN_RATIO, anchorPointOnFrame, anchorToWorld, angleFromCenter, applyBoardAuthoringSnapshot, applyBoardSemanticCommands, arrowBounds, arrowFrame, autoConnectionSide, availabilityFromError, boardAuthoringItemToDocumentItem, boardAuthoringSnapshotToDocument, boardColorCssVar, boardDocumentToSemanticCommands, boardFrameLookup, boardImageKeySource, boardItemToAuthoringItem, boardReplayActorKind, boardTextLineHeight, buildCodeExcerpt, buildFallbackShapeColors, buildFileExcerpt, buildFileSnapshot, buildStrokeOutline, buildStrokeRibbonGeometry, cameraForFocus, cameraForRect, cameraForState, clamp, clampBoardStrokeSize, clampBoardTextFontSize, clampZoom, compileComposition, composition, boardArrowFrame as computeArrowFrame, computeDrawBounds, connectionArrowheads, connectionBounds, connectionHitRadius, connectionHitTest, connectionItemIds, connectionOtherItemId, connectionTouchesItem, createBoardConnection, createBoardExtensionRegistry, createBoardReplayPlayer, createBoardToolStyles, createConnectionGeometryCache, createConnectionIndex, definitionForItem, degToRad, distanceToArrow, distanceToConnection, distanceToStroke, expandRect, exportConnectionBounds, exportItemBounds, featuredTaskArtifact, fileBaseName, fileCategory, fileCategoryAccent, fileMetaLine, filePreviewKind, filePreviewMemoKey, filePreviewScope, fileStem, fileTypeLabel, fitToContent, flipBoardConnection, formatFileSize, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, getMediaExtension, getMediaResourceTitle, getShapeDefinition, handlePosition, imageAssetKey, inferBoardMediaKind, isBoardColorId, isBoardPath, isFileBackedItem, isFileSnapshotFresh, isGeoKind, isMediaItem, isPublicBoardRemoteAddress, isStrokeCorner, isUnknownItem, itemBounds, measureBoardText, mergeFileSnapshot, normalizeBoardConnectionStyle, normalizeBoardDocument, normalizeBoardRemoteUrl, normalizeRotation, normalizeViewport, normalizedPoint, panBy, parseBoardDocument, parseBoardItemLoose, parseBoardManifest, patchBoardAppearance, pathMidpoint, pickBoardColor, planBoardExport, playableBoardMedia, playableBoardMediaList, pointToWorld, pointsBounds, proceduralClip, radToDeg, rankedTaskArtifacts, readCoverFromFrontmatter, readFrontmatterScalars, readTitleFromFrontmatter, rectCenter, rectContainsPoint, rectForCameraFocus, rectsIntersect, registerShapeDefinition, resetBoardPlaybackUrlCache, resizeFrame, resizeFrameToSize, resizeModeForCapabilities, resolveArrow, resolveBoardColor, resolveConnection, resolveCoverRef, resolveFileTitle, resolveSpacePath, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, sampleArrow, sampleCompositionTracks, sampleEasing, sampleRadius, sampleTrack, scaleFrames, screenOffset, screenPoint, screenToWorld, selectBoardExportAssets, selectionBounds, serializeBoardManifest, setBoardTextMeasurer, shapeBounds, shapeCapabilities, shapeHandles, shapeHitTest, shapeResizeMode, shouldFetchFileExcerpt, simplifyDrawIndices, splitFrontmatter, stableCullRect, taskArtifactPreviewUrl, taskArtifacts, taskRunToBoardTaskSnapshot, track, translateArrow, unionRects, unknownRealType, unknownShapeDefinition, visibleWorldRect, withResolvedConnections, worldOffset, worldPoint, worldRect, worldToAnchor, worldToScreen, zoomAround };
@@ -1,5 +1,6 @@
1
1
  import { BoardConnection } from "../../protocol/dist/board-connection.js";
2
2
  import { BoardFrame } from "../../protocol/dist/board-document.js";
3
+ import { Rect } from "../geometry.js";
3
4
  import { FrameLookup, ResolvedConnection } from "../core/connections.js";
4
5
  import { BoardShapeColors } from "../core/palette.js";
5
6
  import { Container } from "pixi.js";
@@ -20,9 +21,13 @@ type ConnectionRenderInput = {
20
21
  * of a preview drawn over its own committed geometry.
21
22
  */
22
23
  skipIds?: ReadonlySet<string>;
24
+ /** Cull and dash-clip rect; use `stableCullRect` so small pans keep the cache. */
25
+ cullRect?: Rect | null;
26
+ /** Nodes being manipulated; their relations are drawn on the live layer. */
27
+ liveNodeIds?: ReadonlySet<string>;
23
28
  };
24
29
  type ConnectionLayer = {
25
- /** Redraw every connection. Cheap: one Graphics, batched. */
30
+ /** Draw the connection set; only changed layers re-tessellate. */
26
31
  sync: (input: ConnectionRenderInput) => void;
27
32
  /** Resolved geometry from the last sync, for hit testing and overlays. */
28
33
  resolved: (connectionId: string) => ResolvedConnection | null;