@neta-art/cohub 5.6.0 → 5.7.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.
@@ -193,6 +193,21 @@ function boardNodeToItemValue(node) {
193
193
  style
194
194
  };
195
195
  }
196
+ case "audio": {
197
+ const path = spaceFilePathFromNode(node) ?? "missing";
198
+ return {
199
+ id: node.nodeId,
200
+ type: "audio",
201
+ ref: {
202
+ kind: "space-file",
203
+ path
204
+ },
205
+ snapshot: node.view,
206
+ frame,
207
+ ...locked ? { locked } : {},
208
+ style
209
+ };
210
+ }
196
211
  case "file": {
197
212
  const path = spaceFilePathFromNode(node) ?? "missing";
198
213
  const parsed = BoardFileSnapshotSchema.safeParse(node.view ?? {});
@@ -142,5 +142,9 @@ type VideoShapeProps = {
142
142
  path: string;
143
143
  mimeType?: string;
144
144
  };
145
+ type AudioShapeProps = {
146
+ path: string;
147
+ mimeType?: string;
148
+ };
145
149
  //#endregion
146
- export { ArrowEndpoint, ArrowShapeProps, DrawPoint, DrawShapeProps, FULL_CAPABILITIES, GEO_KINDS, GeoKind, GeoShapeProps, HandleDragResult, ImageShapeProps, ShapeCapabilities, ShapeGeometry, ShapeHandle, ShapeHandleId, ShapeResizeMode, TextShapeProps, VideoShapeProps, isGeoKind, resizeModeForCapabilities };
150
+ export { ArrowEndpoint, ArrowShapeProps, AudioShapeProps, DrawPoint, DrawShapeProps, FULL_CAPABILITIES, GEO_KINDS, GeoKind, GeoShapeProps, HandleDragResult, ImageShapeProps, ShapeCapabilities, ShapeGeometry, ShapeHandle, ShapeHandleId, ShapeResizeMode, TextShapeProps, VideoShapeProps, isGeoKind, resizeModeForCapabilities };
@@ -2,7 +2,7 @@ import { BOARD_STROKE_MAX_SIZE, BOARD_STROKE_MIN_SIZE, clampBoardStrokeSize } fr
2
2
  import { 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 } from "../protocol/dist/board-connection.js";
3
3
  import { BOARD_DOCUMENT_KIND, BOARD_EXTENSION, BoardManifest, BoardNodeRecord, BoardRecord, InvalidBoardFileError, isBoardPath, parseBoardManifest, serializeBoardManifest } from "../protocol/dist/board.js";
4
4
  import { BoardExtensionDefinition, BoardExtensionRegistry, BoardPresetDefinition, CompiledSequence, DEFAULT_BOARD_LIMITS, QualityProfile, RenderBounds, TimelineClipInput, TimelineInput, clip, compileSequence, createBoardExtensionRegistry, timeline } from "./animation.js";
5
- import { BoardAppearance, BoardAppearanceSchema, BoardArrowItem, BoardArrowItemSchema, BoardDocument, BoardDocumentSchema, BoardDrawItem, BoardDrawItemSchema, BoardFileItem, BoardFileItemSchema, BoardFileSnapshot, BoardFileSnapshotSchema, BoardFrame, BoardFrameItem, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItem, BoardGeoItemSchema, BoardImageItem, BoardImageItemSchema, BoardItem, BoardItemSchema, BoardItemStyle, BoardItemStyleSchema, BoardKnownItem, BoardMediaSnapshot, BoardMediaSnapshotSchema, BoardPoint, BoardPointSchema, BoardTaskItem, BoardTaskItemSchema, BoardTaskOutput, BoardTaskOutputSchema, BoardTaskSnapshot, BoardTaskSnapshotSchema, BoardTextItem, BoardTextItemSchema, BoardUnknownItem, BoardVideoItem, BoardVideoItemSchema, BoardViewport, BoardViewportSchema, DrawPoint, DrawPointSchema, KNOWN_BOARD_ITEM_TYPES, KnownBoardItemType, SpaceFileRef, SpaceFileRefSchema, UNKNOWN_BOARD_ITEM_TYPE, isFileBackedItem, isMediaItem, isUnknownItem, parseBoardDocument, parseBoardItemLoose, unknownRealType, withResolvedConnections } from "../protocol/dist/board-document.js";
5
+ import { BoardAppearance, BoardAppearanceSchema, BoardArrowItem, BoardArrowItemSchema, BoardAudioItem, BoardAudioItemSchema, BoardDocument, BoardDocumentSchema, BoardDrawItem, BoardDrawItemSchema, BoardFileItem, BoardFileItemSchema, BoardFileSnapshot, BoardFileSnapshotSchema, BoardFrame, BoardFrameItem, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItem, BoardGeoItemSchema, BoardImageItem, BoardImageItemSchema, BoardItem, BoardItemSchema, BoardItemStyle, BoardItemStyleSchema, BoardKnownItem, BoardMediaSnapshot, BoardMediaSnapshotSchema, BoardPoint, BoardPointSchema, BoardTaskItem, BoardTaskItemSchema, BoardTaskOutput, BoardTaskOutputSchema, BoardTaskSnapshot, BoardTaskSnapshotSchema, BoardTextItem, BoardTextItemSchema, BoardUnknownItem, BoardVideoItem, BoardVideoItemSchema, BoardViewport, BoardViewportSchema, DrawPoint, DrawPointSchema, KNOWN_BOARD_ITEM_TYPES, KnownBoardItemType, SpaceFileRef, SpaceFileRefSchema, UNKNOWN_BOARD_ITEM_TYPE, isFileBackedItem, isMediaItem, isUnknownItem, parseBoardDocument, parseBoardItemLoose, unknownRealType, withResolvedConnections } from "../protocol/dist/board-document.js";
6
6
  import { BOARD_NODE_SOURCE, DEFAULT_BOARD_APPEARANCE, ITEM_BASE_KEYS, WireBackedBoardItem, boardBootstrapToDocument, boardNodeToItem, isRecord, nodeInputFromRecord, sourceForItem } from "./codec.js";
7
7
  import { 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, clamp, clampZoom, degToRad, expandRect, fitToContent, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, handlePosition, itemBounds, normalizeRotation, normalizeViewport, panBy, pointToWorld, radToDeg, rectCenter, rectContainsPoint, rectsIntersect, resizeFrame, resizeFrameToSize, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, scaleFrames, screenPoint, screenToWorld, selectionBounds, unionRects, visibleWorldRect, worldPoint, worldToScreen, zoomAround } from "./geometry.js";
8
8
  import { ResolvedArrow, arrowBounds, arrowFrame, distanceToArrow, resolveArrow, sampleArrow, translateArrow } from "./core/arrow-geometry.js";
@@ -12,10 +12,10 @@ import { BOARD_EXPORT_MAX_TEXTURES, BoardExportAssetSelection, selectBoardExport
12
12
  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";
13
13
  import { BoardFileSnapshotFacts, BuildSnapshotInput, FILE_EXCERPT_MAX_BYTES, FILE_EXCERPT_MAX_CHARS, FileAvailability, FilePreviewKind, ResolvedCover, availabilityFromError, buildFileExcerpt, buildFileSnapshot, fileBaseName, filePreviewKind, filePreviewMemoKey, filePreviewScope, fileTypeLabel, formatFileSize, isFileSnapshotFresh, mergeFileSnapshot, readCoverFromFrontmatter, readTitleFromFrontmatter, resolveCoverRef, resolveSpacePath, shouldFetchFileExcerpt, splitFrontmatter } from "./core/file-preview.js";
14
14
  import { BOARD_COLORS, BoardColorEntry, BoardColorId, BoardColorValue, BoardShapeColors, DEFAULT_BOARD_COLOR, boardColorCssVar, buildFallbackShapeColors, isBoardColorId, pickBoardColor, resolveBoardColor } from "./core/palette.js";
15
- import { ArrowShapeProps, DrawShapeProps, FULL_CAPABILITIES, GEO_KINDS, GeoKind, GeoShapeProps, HandleDragResult, ImageShapeProps, ShapeCapabilities, ShapeGeometry, ShapeHandle, ShapeHandleId, ShapeResizeMode, TextShapeProps, VideoShapeProps, isGeoKind, resizeModeForCapabilities } from "./core/shape-types.js";
15
+ import { ArrowShapeProps, AudioShapeProps, DrawShapeProps, FULL_CAPABILITIES, GEO_KINDS, GeoKind, GeoShapeProps, HandleDragResult, ImageShapeProps, ShapeCapabilities, ShapeGeometry, ShapeHandle, ShapeHandleId, ShapeResizeMode, TextShapeProps, VideoShapeProps, isGeoKind, resizeModeForCapabilities } from "./core/shape-types.js";
16
16
  import { ShapeDefinition, definitionForItem, getShapeDefinition, registerShapeDefinition, shapeBounds, shapeCapabilities, shapeHandles, shapeHitTest, shapeResizeMode, unknownShapeDefinition } from "./core/shape-definition.js";
17
17
  import { TEXT_FONT_FAMILY, TEXT_FONT_SIZE, TEXT_LINE_HEIGHT, TEXT_MAX_FONT_SIZE, TEXT_MIN_FONT_SIZE, boardTextLineHeight, clampBoardTextFontSize, measureBoardText, setBoardTextMeasurer } from "./core/text-metrics.js";
18
18
  import { BoardStyledToolId, BoardToolStyleMap, BoardToolStylePatch, DEFAULT_BOARD_TOOL_STYLES, createBoardToolStyles } from "./core/tool-styles.js";
19
19
  import { boardImageKeySource, imageAssetKey } from "./image-key.js";
20
20
  import { normalizeBoardTaskOutputUrl, taskRunToBoardTaskSnapshot } from "./task.js";
21
- export { AUTO_BOARD_CONNECTION_ANCHOR, type ArrowShapeProps, 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_NODE_SOURCE, BOARD_STROKE_MAX_SIZE, BOARD_STROKE_MIN_SIZE, BoardAppearance, BoardAppearanceSchema, BoardArrowItem, BoardArrowItemSchema, BoardColorEntry, 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, BoardFileSnapshotFacts, BoardFileSnapshotSchema, BoardFrame, BoardFrameItem, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItem, BoardGeoItemSchema, BoardImageItem, BoardImageItemSchema, BoardItem, BoardItemSchema, BoardItemStyle, BoardItemStyleSchema, BoardKnownItem, type BoardManifest, BoardMediaSnapshot, BoardMediaSnapshotSchema, type BoardNodeRecord, BoardPoint, BoardPointSchema, BoardPresetDefinition, type BoardRecord, BoardRelationSchema, BoardShapeColors, BoardStyledToolId, BoardTaskItem, BoardTaskItemSchema, BoardTaskOutput, BoardTaskOutputSchema, BoardTaskSnapshot, BoardTaskSnapshotSchema, BoardTextItem, BoardTextItemSchema, BoardToolStyleMap, BoardToolStylePatch, BoardUnknownItem, BoardVideoItem, BoardVideoItemSchema, BoardViewport, BoardViewportSchema, BuildSnapshotInput, CONNECTION_ENDPOINT_GAP, CORNER_RESIZE_HANDLES, CORNER_ROTATION_ZONE_WIDTH, CompiledSequence, 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, FilePreviewKind, FrameLookup, GEO_KINDS, type GeoKind, type GeoShapeProps, HANDLE_DIRECTION, HANDLE_HIT_RADIUS, type HandleDragResult, ITEM_BASE_KEYS, type ImageShapeProps, InvalidBoardFileError, KNOWN_BOARD_ITEM_TYPES, KnownBoardItemType, MAX_BOARD_ZOOM, MIN_BOARD_ZOOM, MIN_ITEM_SIZE, Point, QualityProfile, RESIZE_HANDLES, ROTATION_HANDLE_OFFSET, Rect, RenderBounds, ResizeHandle, ResolvedArrow, ResolvedConnection, ResolvedConnectionEndpoint, ResolvedCover, ScreenPoint, type ShapeCapabilities, ShapeDefinition, type ShapeGeometry, type ShapeHandle, type ShapeHandleId, type ShapeResizeMode, Size, SpaceFileRef, SpaceFileRefSchema, TEXT_FONT_FAMILY, TEXT_FONT_SIZE, TEXT_LINE_HEIGHT, TEXT_MAX_FONT_SIZE, TEXT_MIN_FONT_SIZE, type TextShapeProps, TimelineClipInput, TimelineInput, UNKNOWN_BOARD_ITEM_TYPE, VIEWPORT_MARGIN_RATIO, type VideoShapeProps, WireBackedBoardItem, WorldPoint, anchorPointOnFrame, anchorToWorld, angleFromCenter, arrowBounds, arrowFrame, autoConnectionSide, availabilityFromError, boardBootstrapToDocument, boardColorCssVar, boardFrameLookup, boardImageKeySource, boardNodeToItem, boardTextLineHeight, buildFallbackShapeColors, buildFileExcerpt, buildFileSnapshot, buildStrokeOutline, clamp, clampBoardStrokeSize, clampBoardTextFontSize, clampZoom, clip, compileSequence, computeDrawBounds, connectionArrowheads, connectionBounds, connectionHitTest, connectionNodeIds, connectionOtherNodeId, connectionTouchesNode, createBoardConnection, createBoardExtensionRegistry, createBoardToolStyles, createConnectionIndex, definitionForItem, degToRad, distanceToArrow, distanceToConnection, distanceToStroke, expandRect, exportConnectionBounds, exportItemBounds, fileBaseName, filePreviewKind, filePreviewMemoKey, filePreviewScope, fileTypeLabel, fitToContent, flipBoardConnection, formatFileSize, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, getShapeDefinition, handlePosition, imageAssetKey, isBoardColorId, isBoardPath, isFileBackedItem, isFileSnapshotFresh, isGeoKind, isMediaItem, isRecord, isUnknownItem, itemBounds, measureBoardText, mergeFileSnapshot, nodeInputFromRecord, normalizeBoardConnectionStyle, normalizeBoardDocument, normalizeBoardTaskOutputUrl, normalizeRotation, normalizeViewport, panBy, parseBoardDocument, parseBoardItemLoose, parseBoardManifest, pathMidpoint, pickBoardColor, planBoardExport, pointToWorld, radToDeg, readCoverFromFrontmatter, readTitleFromFrontmatter, rectCenter, rectContainsPoint, rectsIntersect, registerShapeDefinition, resizeFrame, resizeFrameToSize, resizeModeForCapabilities, resolveArrow, resolveBoardColor, resolveConnection, resolveCoverRef, resolveSpacePath, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, sampleArrow, sampleRadius, scaleFrames, screenPoint, screenToWorld, selectBoardExportAssets, selectionBounds, serializeBoardManifest, setBoardTextMeasurer, shapeBounds, shapeCapabilities, shapeHandles, shapeHitTest, shapeResizeMode, shouldFetchFileExcerpt, simplifyDrawIndices, sourceForItem, splitFrontmatter, taskRunToBoardTaskSnapshot, timeline, translateArrow, unionRects, unknownRealType, unknownShapeDefinition, visibleWorldRect, withResolvedConnections, worldPoint, worldToAnchor, worldToScreen, zoomAround };
21
+ export { AUTO_BOARD_CONNECTION_ANCHOR, type ArrowShapeProps, type AudioShapeProps, 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_NODE_SOURCE, BOARD_STROKE_MAX_SIZE, BOARD_STROKE_MIN_SIZE, BoardAppearance, BoardAppearanceSchema, BoardArrowItem, BoardArrowItemSchema, BoardAudioItem, BoardAudioItemSchema, BoardColorEntry, 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, BoardFileSnapshotFacts, BoardFileSnapshotSchema, BoardFrame, BoardFrameItem, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItem, BoardGeoItemSchema, BoardImageItem, BoardImageItemSchema, BoardItem, BoardItemSchema, BoardItemStyle, BoardItemStyleSchema, BoardKnownItem, type BoardManifest, BoardMediaSnapshot, BoardMediaSnapshotSchema, type BoardNodeRecord, BoardPoint, BoardPointSchema, BoardPresetDefinition, type BoardRecord, BoardRelationSchema, BoardShapeColors, BoardStyledToolId, BoardTaskItem, BoardTaskItemSchema, BoardTaskOutput, BoardTaskOutputSchema, BoardTaskSnapshot, BoardTaskSnapshotSchema, BoardTextItem, BoardTextItemSchema, BoardToolStyleMap, BoardToolStylePatch, BoardUnknownItem, BoardVideoItem, BoardVideoItemSchema, BoardViewport, BoardViewportSchema, BuildSnapshotInput, CONNECTION_ENDPOINT_GAP, CORNER_RESIZE_HANDLES, CORNER_ROTATION_ZONE_WIDTH, CompiledSequence, 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, FilePreviewKind, FrameLookup, GEO_KINDS, type GeoKind, type GeoShapeProps, HANDLE_DIRECTION, HANDLE_HIT_RADIUS, type HandleDragResult, ITEM_BASE_KEYS, type ImageShapeProps, InvalidBoardFileError, KNOWN_BOARD_ITEM_TYPES, KnownBoardItemType, MAX_BOARD_ZOOM, MIN_BOARD_ZOOM, MIN_ITEM_SIZE, Point, QualityProfile, RESIZE_HANDLES, ROTATION_HANDLE_OFFSET, Rect, RenderBounds, ResizeHandle, ResolvedArrow, ResolvedConnection, ResolvedConnectionEndpoint, ResolvedCover, ScreenPoint, type ShapeCapabilities, ShapeDefinition, type ShapeGeometry, type ShapeHandle, type ShapeHandleId, type ShapeResizeMode, Size, SpaceFileRef, SpaceFileRefSchema, TEXT_FONT_FAMILY, TEXT_FONT_SIZE, TEXT_LINE_HEIGHT, TEXT_MAX_FONT_SIZE, TEXT_MIN_FONT_SIZE, type TextShapeProps, TimelineClipInput, TimelineInput, UNKNOWN_BOARD_ITEM_TYPE, VIEWPORT_MARGIN_RATIO, type VideoShapeProps, WireBackedBoardItem, WorldPoint, anchorPointOnFrame, anchorToWorld, angleFromCenter, arrowBounds, arrowFrame, autoConnectionSide, availabilityFromError, boardBootstrapToDocument, boardColorCssVar, boardFrameLookup, boardImageKeySource, boardNodeToItem, boardTextLineHeight, buildFallbackShapeColors, buildFileExcerpt, buildFileSnapshot, buildStrokeOutline, clamp, clampBoardStrokeSize, clampBoardTextFontSize, clampZoom, clip, compileSequence, computeDrawBounds, connectionArrowheads, connectionBounds, connectionHitTest, connectionNodeIds, connectionOtherNodeId, connectionTouchesNode, createBoardConnection, createBoardExtensionRegistry, createBoardToolStyles, createConnectionIndex, definitionForItem, degToRad, distanceToArrow, distanceToConnection, distanceToStroke, expandRect, exportConnectionBounds, exportItemBounds, fileBaseName, filePreviewKind, filePreviewMemoKey, filePreviewScope, fileTypeLabel, fitToContent, flipBoardConnection, formatFileSize, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, getShapeDefinition, handlePosition, imageAssetKey, isBoardColorId, isBoardPath, isFileBackedItem, isFileSnapshotFresh, isGeoKind, isMediaItem, isRecord, isUnknownItem, itemBounds, measureBoardText, mergeFileSnapshot, nodeInputFromRecord, normalizeBoardConnectionStyle, normalizeBoardDocument, normalizeBoardTaskOutputUrl, normalizeRotation, normalizeViewport, panBy, parseBoardDocument, parseBoardItemLoose, parseBoardManifest, pathMidpoint, pickBoardColor, planBoardExport, pointToWorld, radToDeg, readCoverFromFrontmatter, readTitleFromFrontmatter, rectCenter, rectContainsPoint, rectsIntersect, registerShapeDefinition, resizeFrame, resizeFrameToSize, resizeModeForCapabilities, resolveArrow, resolveBoardColor, resolveConnection, resolveCoverRef, resolveSpacePath, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, sampleArrow, sampleRadius, scaleFrames, screenPoint, screenToWorld, selectBoardExportAssets, selectionBounds, serializeBoardManifest, setBoardTextMeasurer, shapeBounds, shapeCapabilities, shapeHandles, shapeHitTest, shapeResizeMode, shouldFetchFileExcerpt, simplifyDrawIndices, sourceForItem, splitFrontmatter, taskRunToBoardTaskSnapshot, timeline, translateArrow, unionRects, unknownRealType, unknownShapeDefinition, visibleWorldRect, withResolvedConnections, worldPoint, worldToAnchor, worldToScreen, zoomAround };
@@ -2,7 +2,7 @@ import { BOARD_STROKE_MAX_SIZE, BOARD_STROKE_MIN_SIZE, clampBoardStrokeSize } fr
2
2
  import { BoardExtensionRegistry, DEFAULT_BOARD_LIMITS, clip, compileSequence, createBoardExtensionRegistry, timeline } from "./animation.js";
3
3
  import { AUTO_BOARD_CONNECTION_ANCHOR, BOARD_CONNECTION_DIRECTIONS, BOARD_CONNECTION_LINES, BOARD_CONNECTION_ROUTINGS, BOARD_CONNECTION_SIDES, BoardConnectionAnchorSchema, BoardConnectionEndpointSchema, BoardConnectionPatchSchema, BoardConnectionRoutingSchema, BoardConnectionSchema, BoardConnectionStyleSchema, BoardConnectionWaypointSchema, BoardRelationSchema, DEFAULT_BOARD_CONNECTION_ROUTING, DEFAULT_BOARD_CONNECTION_STYLE, DEFAULT_BOARD_RELATION, connectionNodeIds, connectionOtherNodeId, connectionTouchesNode, createBoardConnection, flipBoardConnection, normalizeBoardConnectionStyle } from "../protocol/dist/board-connection.js";
4
4
  import { BOARD_DOCUMENT_KIND, BOARD_EXTENSION, InvalidBoardFileError, isBoardPath, parseBoardManifest, serializeBoardManifest } from "../protocol/dist/board.js";
5
- import { BoardAppearanceSchema, BoardArrowItemSchema, BoardDocumentSchema, BoardDrawItemSchema, BoardFileItemSchema, BoardFileSnapshotSchema, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItemSchema, BoardImageItemSchema, BoardItemSchema, BoardItemStyleSchema, BoardMediaSnapshotSchema, BoardPointSchema, BoardTaskItemSchema, BoardTaskOutputSchema, 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";
5
+ import { BoardAppearanceSchema, BoardArrowItemSchema, BoardAudioItemSchema, BoardDocumentSchema, BoardDrawItemSchema, BoardFileItemSchema, BoardFileSnapshotSchema, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItemSchema, BoardImageItemSchema, BoardItemSchema, BoardItemStyleSchema, BoardMediaSnapshotSchema, BoardPointSchema, BoardTaskItemSchema, BoardTaskOutputSchema, 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 { TEXT_FONT_FAMILY, TEXT_FONT_SIZE, TEXT_LINE_HEIGHT, TEXT_MAX_FONT_SIZE, TEXT_MIN_FONT_SIZE, boardTextLineHeight, clampBoardTextFontSize, measureBoardText, setBoardTextMeasurer } from "./core/text-metrics.js";
7
7
  import { BOARD_NODE_SOURCE, DEFAULT_BOARD_APPEARANCE, ITEM_BASE_KEYS, boardBootstrapToDocument, boardNodeToItem, isRecord, nodeInputFromRecord, sourceForItem } from "./codec.js";
8
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, clamp, clampZoom, degToRad, expandRect, fitToContent, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, handlePosition, itemBounds, normalizeRotation, normalizeViewport, panBy, pointToWorld, radToDeg, rectCenter, rectContainsPoint, rectsIntersect, resizeFrame, resizeFrameToSize, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, scaleFrames, screenPoint, screenToWorld, selectionBounds, unionRects, visibleWorldRect, worldPoint, worldToScreen, zoomAround } from "./geometry.js";
@@ -18,4 +18,4 @@ import { FULL_CAPABILITIES, GEO_KINDS, isGeoKind, resizeModeForCapabilities } fr
18
18
  import { definitionForItem, getShapeDefinition, registerShapeDefinition, shapeBounds, shapeCapabilities, shapeHandles, shapeHitTest, shapeResizeMode, unknownShapeDefinition } from "./core/shape-definition.js";
19
19
  import { DEFAULT_BOARD_TOOL_STYLES, createBoardToolStyles } from "./core/tool-styles.js";
20
20
  import { normalizeBoardTaskOutputUrl, taskRunToBoardTaskSnapshot } from "./task.js";
21
- export { AUTO_BOARD_CONNECTION_ANCHOR, 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_NODE_SOURCE, BOARD_STROKE_MAX_SIZE, BOARD_STROKE_MIN_SIZE, BoardAppearanceSchema, BoardArrowItemSchema, BoardConnectionAnchorSchema, BoardConnectionEndpointSchema, BoardConnectionPatchSchema, BoardConnectionRoutingSchema, BoardConnectionSchema, BoardConnectionStyleSchema, BoardConnectionWaypointSchema, BoardDocumentSchema, BoardDrawItemSchema, BoardExtensionRegistry, BoardFileItemSchema, BoardFileSnapshotSchema, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItemSchema, BoardImageItemSchema, BoardItemSchema, BoardItemStyleSchema, BoardMediaSnapshotSchema, BoardPointSchema, BoardRelationSchema, BoardTaskItemSchema, BoardTaskOutputSchema, 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, ITEM_BASE_KEYS, InvalidBoardFileError, 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, arrowBounds, arrowFrame, autoConnectionSide, availabilityFromError, boardBootstrapToDocument, boardColorCssVar, boardFrameLookup, boardImageKeySource, boardNodeToItem, boardTextLineHeight, buildFallbackShapeColors, buildFileExcerpt, buildFileSnapshot, buildStrokeOutline, clamp, clampBoardStrokeSize, clampBoardTextFontSize, clampZoom, clip, compileSequence, computeDrawBounds, connectionArrowheads, connectionBounds, connectionHitTest, connectionNodeIds, connectionOtherNodeId, connectionTouchesNode, createBoardConnection, createBoardExtensionRegistry, createBoardToolStyles, createConnectionIndex, definitionForItem, degToRad, distanceToArrow, distanceToConnection, distanceToStroke, expandRect, exportConnectionBounds, exportItemBounds, fileBaseName, filePreviewKind, filePreviewMemoKey, filePreviewScope, fileTypeLabel, fitToContent, flipBoardConnection, formatFileSize, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, getShapeDefinition, handlePosition, imageAssetKey, isBoardColorId, isBoardPath, isFileBackedItem, isFileSnapshotFresh, isGeoKind, isMediaItem, isRecord, isUnknownItem, itemBounds, measureBoardText, mergeFileSnapshot, nodeInputFromRecord, normalizeBoardConnectionStyle, normalizeBoardDocument, normalizeBoardTaskOutputUrl, normalizeRotation, normalizeViewport, panBy, parseBoardDocument, parseBoardItemLoose, parseBoardManifest, pathMidpoint, pickBoardColor, planBoardExport, pointToWorld, radToDeg, readCoverFromFrontmatter, readTitleFromFrontmatter, rectCenter, rectContainsPoint, rectsIntersect, registerShapeDefinition, resizeFrame, resizeFrameToSize, resizeModeForCapabilities, resolveArrow, resolveBoardColor, resolveConnection, resolveCoverRef, resolveSpacePath, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, sampleArrow, sampleRadius, scaleFrames, screenPoint, screenToWorld, selectBoardExportAssets, selectionBounds, serializeBoardManifest, setBoardTextMeasurer, shapeBounds, shapeCapabilities, shapeHandles, shapeHitTest, shapeResizeMode, shouldFetchFileExcerpt, simplifyDrawIndices, sourceForItem, splitFrontmatter, taskRunToBoardTaskSnapshot, timeline, translateArrow, unionRects, unknownRealType, unknownShapeDefinition, visibleWorldRect, withResolvedConnections, worldPoint, worldToAnchor, worldToScreen, zoomAround };
21
+ export { AUTO_BOARD_CONNECTION_ANCHOR, 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_NODE_SOURCE, BOARD_STROKE_MAX_SIZE, BOARD_STROKE_MIN_SIZE, BoardAppearanceSchema, BoardArrowItemSchema, BoardAudioItemSchema, BoardConnectionAnchorSchema, BoardConnectionEndpointSchema, BoardConnectionPatchSchema, BoardConnectionRoutingSchema, BoardConnectionSchema, BoardConnectionStyleSchema, BoardConnectionWaypointSchema, BoardDocumentSchema, BoardDrawItemSchema, BoardExtensionRegistry, BoardFileItemSchema, BoardFileSnapshotSchema, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItemSchema, BoardImageItemSchema, BoardItemSchema, BoardItemStyleSchema, BoardMediaSnapshotSchema, BoardPointSchema, BoardRelationSchema, BoardTaskItemSchema, BoardTaskOutputSchema, 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, ITEM_BASE_KEYS, InvalidBoardFileError, 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, arrowBounds, arrowFrame, autoConnectionSide, availabilityFromError, boardBootstrapToDocument, boardColorCssVar, boardFrameLookup, boardImageKeySource, boardNodeToItem, boardTextLineHeight, buildFallbackShapeColors, buildFileExcerpt, buildFileSnapshot, buildStrokeOutline, clamp, clampBoardStrokeSize, clampBoardTextFontSize, clampZoom, clip, compileSequence, computeDrawBounds, connectionArrowheads, connectionBounds, connectionHitTest, connectionNodeIds, connectionOtherNodeId, connectionTouchesNode, createBoardConnection, createBoardExtensionRegistry, createBoardToolStyles, createConnectionIndex, definitionForItem, degToRad, distanceToArrow, distanceToConnection, distanceToStroke, expandRect, exportConnectionBounds, exportItemBounds, fileBaseName, filePreviewKind, filePreviewMemoKey, filePreviewScope, fileTypeLabel, fitToContent, flipBoardConnection, formatFileSize, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, getShapeDefinition, handlePosition, imageAssetKey, isBoardColorId, isBoardPath, isFileBackedItem, isFileSnapshotFresh, isGeoKind, isMediaItem, isRecord, isUnknownItem, itemBounds, measureBoardText, mergeFileSnapshot, nodeInputFromRecord, normalizeBoardConnectionStyle, normalizeBoardDocument, normalizeBoardTaskOutputUrl, normalizeRotation, normalizeViewport, panBy, parseBoardDocument, parseBoardItemLoose, parseBoardManifest, pathMidpoint, pickBoardColor, planBoardExport, pointToWorld, radToDeg, readCoverFromFrontmatter, readTitleFromFrontmatter, rectCenter, rectContainsPoint, rectsIntersect, registerShapeDefinition, resizeFrame, resizeFrameToSize, resizeModeForCapabilities, resolveArrow, resolveBoardColor, resolveConnection, resolveCoverRef, resolveSpacePath, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, sampleArrow, sampleRadius, scaleFrames, screenPoint, screenToWorld, selectBoardExportAssets, selectionBounds, serializeBoardManifest, setBoardTextMeasurer, shapeBounds, shapeCapabilities, shapeHandles, shapeHitTest, shapeResizeMode, shouldFetchFileExcerpt, simplifyDrawIndices, sourceForItem, splitFrontmatter, taskRunToBoardTaskSnapshot, timeline, translateArrow, unionRects, unknownRealType, unknownShapeDefinition, visibleWorldRect, withResolvedConnections, worldPoint, worldToAnchor, worldToScreen, zoomAround };
@@ -0,0 +1,12 @@
1
+ import { Graphics } from "pixi.js";
2
+ //#region src/board/render/audio-waveform.d.ts
3
+ /** Stable placeholder amplitudes without reading or decoding the audio file. */
4
+ declare function audioWaveformBars(seed: string, count: number): number[];
5
+ declare function drawAudioWaveform(graphics: Graphics, seed: string, rect: {
6
+ x: number;
7
+ y: number;
8
+ width: number;
9
+ height: number;
10
+ }, color: number, alpha?: number): void;
11
+ //#endregion
12
+ export { audioWaveformBars, drawAudioWaveform };
@@ -0,0 +1,36 @@
1
+ //#region src/board/render/audio-waveform.ts
2
+ const DEFAULT_BARS = 44;
3
+ const BAR_GAP = 2;
4
+ /** Stable placeholder amplitudes without reading or decoding the audio file. */
5
+ function audioWaveformBars(seed, count) {
6
+ let hash = 2166136261;
7
+ for (let index = 0; index < seed.length; index += 1) {
8
+ hash ^= seed.charCodeAt(index);
9
+ hash = Math.imul(hash, 16777619);
10
+ }
11
+ const bars = [];
12
+ for (let index = 0; index < count; index += 1) {
13
+ hash ^= hash << 13;
14
+ hash ^= hash >>> 17;
15
+ hash ^= hash << 5;
16
+ bars.push(.2 + (hash >>> 0) / 4294967295 * .8);
17
+ }
18
+ return bars;
19
+ }
20
+ function drawAudioWaveform(graphics, seed, rect, color, alpha = .72) {
21
+ const count = Math.max(8, Math.min(DEFAULT_BARS, Math.floor(rect.width / 4)));
22
+ const step = rect.width / count;
23
+ const barWidth = Math.max(1.5, step - BAR_GAP);
24
+ const centerY = rect.y + rect.height / 2;
25
+ const maxHeight = Math.max(2, rect.height * .72);
26
+ const bars = audioWaveformBars(seed, count);
27
+ for (let index = 0; index < count; index += 1) {
28
+ const height = Math.max(2, (bars[index] ?? .4) * maxHeight);
29
+ graphics.roundRect(rect.x + index * step, centerY - height / 2, barWidth, height, barWidth / 2).fill({
30
+ color,
31
+ alpha
32
+ });
33
+ }
34
+ }
35
+ //#endregion
36
+ export { audioWaveformBars, drawAudioWaveform };
@@ -1,7 +1,8 @@
1
1
  import { ConnectionLayer, ConnectionRenderInput, createConnectionLayer, framesFromItems } from "./connection-layer.js";
2
2
  import { BoardCardRenderer, BoardRenderContext, BoardRenderPalette, boardCardRenderersForTest, getBoardCardRenderer, registerBoardCardRenderer } from "./renderers/board-renderer-registry.js";
3
3
  import { defaultBoardPalette } from "./palette.js";
4
+ import { TASK_CARD_FULL_DETAIL_ZOOM } from "./renderers/task-card-renderer.js";
4
5
  import { ensureBoardTextMeasurement, installBoardTextMeasurement } from "./text-measurement.js";
5
6
  import { getBoardResolution, syncTextResolution, syncTextWrapWidth, textResolutionForZoom, textZoomBucket } from "./text-resolution.js";
6
7
  import { BoardThemeContext, BoardThemeRenderer, getBoardThemeRenderer, registerBoardThemeRenderer } from "./themes/board-theme-registry.js";
7
- export { BoardCardRenderer, BoardRenderContext, BoardRenderPalette, BoardThemeContext, BoardThemeRenderer, ConnectionLayer, ConnectionRenderInput, boardCardRenderersForTest, createConnectionLayer, defaultBoardPalette, ensureBoardTextMeasurement, framesFromItems, getBoardCardRenderer, getBoardResolution, getBoardThemeRenderer, installBoardTextMeasurement, registerBoardCardRenderer, registerBoardThemeRenderer, syncTextResolution, syncTextWrapWidth, textResolutionForZoom, textZoomBucket };
8
+ export { BoardCardRenderer, BoardRenderContext, BoardRenderPalette, BoardThemeContext, BoardThemeRenderer, ConnectionLayer, ConnectionRenderInput, TASK_CARD_FULL_DETAIL_ZOOM, boardCardRenderersForTest, createConnectionLayer, defaultBoardPalette, ensureBoardTextMeasurement, framesFromItems, getBoardCardRenderer, getBoardResolution, getBoardThemeRenderer, installBoardTextMeasurement, registerBoardCardRenderer, registerBoardThemeRenderer, syncTextResolution, syncTextWrapWidth, textResolutionForZoom, textZoomBucket };
@@ -2,6 +2,7 @@ import { getBoardResolution, syncTextResolution, syncTextWrapWidth, textResoluti
2
2
  import { createConnectionLayer, framesFromItems } from "./connection-layer.js";
3
3
  import { defaultBoardPalette } from "./palette.js";
4
4
  import { ensureBoardTextMeasurement, installBoardTextMeasurement } from "./text-measurement.js";
5
+ import { TASK_CARD_FULL_DETAIL_ZOOM } from "./renderers/task-card-renderer.js";
5
6
  import { boardCardRenderersForTest, getBoardCardRenderer, registerBoardCardRenderer } from "./renderers/board-renderer-registry.js";
6
7
  import { getBoardThemeRenderer, registerBoardThemeRenderer } from "./themes/board-theme-registry.js";
7
- export { boardCardRenderersForTest, createConnectionLayer, defaultBoardPalette, ensureBoardTextMeasurement, framesFromItems, getBoardCardRenderer, getBoardResolution, getBoardThemeRenderer, installBoardTextMeasurement, registerBoardCardRenderer, registerBoardThemeRenderer, syncTextResolution, syncTextWrapWidth, textResolutionForZoom, textZoomBucket };
8
+ export { TASK_CARD_FULL_DETAIL_ZOOM, boardCardRenderersForTest, createConnectionLayer, defaultBoardPalette, ensureBoardTextMeasurement, framesFromItems, getBoardCardRenderer, getBoardResolution, getBoardThemeRenderer, installBoardTextMeasurement, registerBoardCardRenderer, registerBoardThemeRenderer, syncTextResolution, syncTextWrapWidth, textResolutionForZoom, textZoomBucket };
@@ -0,0 +1,5 @@
1
+ import { BoardCardRenderer } from "./board-renderer-registry.js";
2
+ //#region src/board/render/renderers/audio-card-renderer.d.ts
3
+ declare const audioCardRenderer: BoardCardRenderer;
4
+ //#endregion
5
+ export { audioCardRenderer };
@@ -0,0 +1,120 @@
1
+ import { BOARD_FONT_STACK } from "../../../protocol/dist/board-constants.js";
2
+ import { syncTextResolution, syncTextWrapWidth, textResolutionForZoom } from "../text-resolution.js";
3
+ import { drawFarPlate } from "./far-plate.js";
4
+ import { drawAudioWaveform } from "../audio-waveform.js";
5
+ import { positionShell } from "./base-card-renderer.js";
6
+ import { Container, Graphics, Text } from "pixi.js";
7
+ //#region src/board/render/renderers/audio-card-renderer.ts
8
+ const RADIUS = 4;
9
+ const PLAY_RADIUS = 18;
10
+ const partsByContainer = /* @__PURE__ */ new WeakMap();
11
+ function sync(container, item, context) {
12
+ const parts = partsByContainer.get(container);
13
+ if (!parts) return;
14
+ positionShell(parts.root, item);
15
+ const { width, height } = item.frame;
16
+ const selected = context.selectedIds.has(item.id);
17
+ const hovered = context.hoveredId === item.id;
18
+ const title = item.snapshot?.title ?? item.ref.path.split("/").pop() ?? "Audio";
19
+ syncTextResolution(parts.label, parts, context.zoom);
20
+ if (parts.label.text !== title) parts.label.text = title;
21
+ syncTextWrapWidth(parts.label, parts, Math.max(1, width - 24), false);
22
+ parts.label.position.set(12, Math.max(8, height - parts.label.height - 8));
23
+ const sig = [
24
+ width,
25
+ height,
26
+ selected,
27
+ hovered,
28
+ title,
29
+ parts.label.height,
30
+ context.palette.surface,
31
+ context.palette.brand,
32
+ context.palette.border,
33
+ context.palette.muted,
34
+ context.palette.text
35
+ ].join("|");
36
+ if (sig === parts.sig) return;
37
+ parts.sig = sig;
38
+ parts.plate.clear().roundRect(0, 0, width, height, RADIUS).fill({
39
+ color: context.palette.surface,
40
+ alpha: .98
41
+ }).roundRect(0, 0, width, height, RADIUS).stroke({
42
+ color: selected ? context.palette.brand : hovered ? context.palette.muted : context.palette.border,
43
+ width: selected ? 2 : 1,
44
+ alpha: selected ? .96 : .84
45
+ });
46
+ const labelBand = Math.min(height * .38, parts.label.height + 16);
47
+ const waveformInset = Math.min(24, width * .08);
48
+ parts.waveform.clear();
49
+ drawAudioWaveform(parts.waveform, `${item.ref.path}:${item.snapshot?.mtimeMs ?? "unknown"}`, {
50
+ x: waveformInset,
51
+ y: 10,
52
+ width: Math.max(1, width - waveformInset * 2),
53
+ height: Math.max(8, height - labelBand - 16)
54
+ }, context.palette.brand);
55
+ const cx = width / 2;
56
+ const cy = Math.max(24, (height - labelBand) / 2);
57
+ parts.chrome.clear().circle(cx, cy, PLAY_RADIUS).fill({
58
+ color: selected ? context.palette.brand : context.palette.surface,
59
+ alpha: .92
60
+ });
61
+ const triangle = PLAY_RADIUS * .58;
62
+ parts.chrome.moveTo(cx - triangle * .35, cy - triangle * .62).lineTo(cx - triangle * .35, cy + triangle * .62).lineTo(cx + triangle * .72, cy).closePath().fill({
63
+ color: context.palette.text,
64
+ alpha: .96
65
+ });
66
+ parts.label.style.fill = context.palette.text;
67
+ }
68
+ const audioCardRenderer = {
69
+ id: "audio-card",
70
+ canRender: (item) => item.type === "audio",
71
+ create: (item, context) => {
72
+ const root = new Container();
73
+ const plate = new Graphics();
74
+ const waveform = new Graphics();
75
+ const chrome = new Graphics();
76
+ const resolution = textResolutionForZoom(context.zoom);
77
+ const label = new Text({
78
+ text: "",
79
+ style: {
80
+ fill: context.palette.text,
81
+ fontFamily: BOARD_FONT_STACK,
82
+ fontSize: 12,
83
+ fontWeight: "500",
84
+ wordWrap: true
85
+ },
86
+ resolution,
87
+ roundPixels: true
88
+ });
89
+ root.addChild(plate, waveform, chrome, label);
90
+ partsByContainer.set(root, {
91
+ root,
92
+ plate,
93
+ waveform,
94
+ chrome,
95
+ label,
96
+ sig: "",
97
+ wrapWidth: 0,
98
+ resolution
99
+ });
100
+ if (item.type === "audio") sync(root, item, context);
101
+ return root;
102
+ },
103
+ update: (container, item, context) => {
104
+ if (item.type === "audio") sync(container, item, context);
105
+ },
106
+ renderFar: (graphics, item, context) => {
107
+ drawFarPlate(graphics, item.frame, {
108
+ fill: context.palette.surface,
109
+ fillAlpha: .96,
110
+ accent: context.palette.brand,
111
+ accentAlpha: .72
112
+ });
113
+ },
114
+ destroy: (container) => {
115
+ partsByContainer.get(container)?.root.destroy({ children: true });
116
+ partsByContainer.delete(container);
117
+ }
118
+ };
119
+ //#endregion
120
+ export { audioCardRenderer };
@@ -1,5 +1,6 @@
1
1
  import { ensureBoardTextMeasurement } from "../text-measurement.js";
2
2
  import { arrowCardRenderer } from "./arrow-card-renderer.js";
3
+ import { audioCardRenderer } from "./audio-card-renderer.js";
3
4
  import { drawCardRenderer } from "./draw-card-renderer.js";
4
5
  import { fileCardRenderer } from "./file-card-renderer.js";
5
6
  import { frameCardRenderer } from "./frame-card-renderer.js";
@@ -14,6 +15,7 @@ const boardCardRenderers = [
14
15
  textCardRenderer,
15
16
  imageCardRenderer,
16
17
  videoCardRenderer,
18
+ audioCardRenderer,
17
19
  fileCardRenderer,
18
20
  taskCardRenderer,
19
21
  geoCardRenderer,
@@ -1,5 +1,6 @@
1
1
  import { BoardCardRenderer } from "./board-renderer-registry.js";
2
2
  //#region src/board/render/renderers/task-card-renderer.d.ts
3
+ declare const TASK_CARD_FULL_DETAIL_ZOOM = 0.55;
3
4
  /** Scale a texture into a frame without cropping or distortion. */
4
5
  declare function containTaskPreviewRect(width: number, height: number, imageWidth: number, imageHeight: number): {
5
6
  x: number;
@@ -9,4 +10,4 @@ declare function containTaskPreviewRect(width: number, height: number, imageWidt
9
10
  };
10
11
  declare const taskCardRenderer: BoardCardRenderer;
11
12
  //#endregion
12
- export { containTaskPreviewRect, taskCardRenderer };
13
+ export { TASK_CARD_FULL_DETAIL_ZOOM, containTaskPreviewRect, taskCardRenderer };
@@ -1,6 +1,7 @@
1
1
  import { BOARD_FONT_STACK, BOARD_MONO_FONT_STACK } from "../../../protocol/dist/board-constants.js";
2
2
  import { syncTextResolution, textResolutionForZoom } from "../text-resolution.js";
3
3
  import { drawFarPlate } from "./far-plate.js";
4
+ import { drawAudioWaveform } from "../audio-waveform.js";
4
5
  import { positionShell } from "./base-card-renderer.js";
5
6
  import { fitTextToLines } from "./file-card-renderer.js";
6
7
  import { Container, Graphics, Sprite, Text } from "pixi.js";
@@ -8,9 +9,7 @@ import { Container, Graphics, Sprite, Text } from "pixi.js";
8
9
  const RADIUS = 4;
9
10
  const PADDING = 12;
10
11
  const META_HEIGHT = 28;
11
- const FULL_DETAIL_ZOOM = .55;
12
- const WAVEFORM_BARS = 44;
13
- const WAVEFORM_GAP = 2;
12
+ const TASK_CARD_FULL_DETAIL_ZOOM = .55;
14
13
  const PLAY_BADGE_RADIUS = 15;
15
14
  const partsByContainer = /* @__PURE__ */ new WeakMap();
16
15
  function previewKindFor(item) {
@@ -68,40 +67,6 @@ function containTaskPreviewRect(width, height, imageWidth, imageHeight) {
68
67
  height: renderedHeight
69
68
  };
70
69
  }
71
- function waveformBars(seed, count) {
72
- let hash = 2166136261;
73
- for (let index = 0; index < seed.length; index += 1) {
74
- hash ^= seed.charCodeAt(index);
75
- hash = Math.imul(hash, 16777619) >>> 0;
76
- }
77
- const bars = [];
78
- for (let index = 0; index < count; index += 1) {
79
- hash ^= hash << 13;
80
- hash ^= hash >>> 17;
81
- hash ^= hash << 5;
82
- hash >>>= 0;
83
- const unit = hash % 1e3 / 1e3;
84
- const envelope = Math.sin(Math.PI * (index + .5) / count);
85
- bars.push(.18 + unit * .82 * (.45 + envelope * .55));
86
- }
87
- return bars;
88
- }
89
- function drawWaveform(graphics, seed, rect, color) {
90
- const count = Math.max(8, Math.min(WAVEFORM_BARS, Math.floor(rect.width / 4)));
91
- const step = rect.width / count;
92
- const barWidth = Math.max(1.5, step - WAVEFORM_GAP);
93
- const centerY = rect.y + rect.height / 2;
94
- const maxHeight = Math.max(2, rect.height * .68);
95
- const bars = waveformBars(seed, count);
96
- for (let index = 0; index < count; index += 1) {
97
- const amplitude = (bars[index] ?? .4) * maxHeight;
98
- graphics.roundRect(rect.x + index * step + (step - barWidth) / 2, centerY - amplitude / 2, barWidth, amplitude, barWidth / 2);
99
- }
100
- graphics.fill({
101
- color,
102
- alpha: .68
103
- });
104
- }
105
70
  function drawPlayBadge(graphics, rect, context) {
106
71
  const radius = Math.min(PLAY_BADGE_RADIUS, Math.max(8, Math.min(rect.width, rect.height) * .16));
107
72
  const cx = rect.x + rect.width / 2;
@@ -194,7 +159,7 @@ function sync(container, item, context) {
194
159
  const { width, height } = item.frame;
195
160
  const selected = context.selectedIds.has(item.id);
196
161
  const hovered = context.hoveredId === item.id;
197
- const full = context.zoom >= FULL_DETAIL_ZOOM;
162
+ const full = context.zoom >= TASK_CARD_FULL_DETAIL_ZOOM;
198
163
  const color = statusColor(item, context);
199
164
  const key = context.assetKey(item);
200
165
  if (key !== parts.assetKey) {
@@ -255,14 +220,14 @@ function sync(container, item, context) {
255
220
  parts.previewArt.clear();
256
221
  if (kind === "waveform") {
257
222
  const bottomInset = showMeta ? META_HEIGHT : 0;
258
- drawWaveform(parts.previewArt, item.taskRunId, {
223
+ drawAudioWaveform(parts.previewArt, item.taskRunId, {
259
224
  x: frame.x + PADDING,
260
225
  y: frame.y + PADDING,
261
226
  width: Math.max(1, frame.width - PADDING * 2),
262
227
  height: Math.max(1, frame.height - PADDING * 2 - bottomInset)
263
228
  }, context.colors.brand.stroke);
264
229
  }
265
- if (kind === "texture" && texture && item.snapshot.primaryOutput?.type === "video" && full) drawPlayBadge(parts.previewArt, frame, context);
230
+ if (full && (item.snapshot.primaryOutput?.type === "audio" || item.snapshot.primaryOutput?.type === "video" && texture)) drawPlayBadge(parts.previewArt, frame, context);
266
231
  if (surface) {
267
232
  const markY = frame.y + frame.height / 2 - (full && stateLabel(surface) ? 10 : 0);
268
233
  drawStateMark(parts.previewArt, surface, frame.x + frame.width / 2, markY, surface === "failed" ? color : context.colors.neutral.stroke);
@@ -386,4 +351,4 @@ const taskCardRenderer = {
386
351
  }
387
352
  };
388
353
  //#endregion
389
- export { containTaskPreviewRect, taskCardRenderer };
354
+ export { TASK_CARD_FULL_DETAIL_ZOOM, containTaskPreviewRect, taskCardRenderer };
@@ -2877,7 +2877,7 @@ type BillingRedemptionResult = {
2877
2877
  };
2878
2878
  type BillingConversionIntent = {
2879
2879
  level: "soft" | "hard";
2880
- reason: "negative_balance" | "negative_balance_limit_exceeded" | "minimum_balance_not_met" | "feature_not_entitled";
2880
+ reason: "negative_balance" | "negative_balance_limit_exceeded" | "balance_not_positive" | "minimum_balance_not_met" | "feature_not_entitled";
2881
2881
  audience: "free" | "paid" | "unknown";
2882
2882
  preferredOfferKind: "plan" | "upgrade" | "addon" | "mixed";
2883
2883
  title: string;
@@ -370,6 +370,50 @@ declare const BoardVideoItemSchema: z.ZodObject<{
370
370
  naturalHeight: z.ZodOptional<z.ZodNumber>;
371
371
  }, z.core.$strip>>;
372
372
  }, z.core.$strip>;
373
+ /** Audio node — space file only. Playback state is local UI, never synced. */
374
+ declare const BoardAudioItemSchema: z.ZodObject<{
375
+ id: z.ZodString;
376
+ frame: z.ZodObject<{
377
+ x: z.ZodNumber;
378
+ y: z.ZodNumber;
379
+ width: z.ZodNumber;
380
+ height: z.ZodNumber;
381
+ rotation: z.ZodDefault<z.ZodNumber>;
382
+ }, z.core.$strip>;
383
+ locked: z.ZodOptional<z.ZodBoolean>;
384
+ style: z.ZodOptional<z.ZodObject<{
385
+ variant: z.ZodDefault<z.ZodString>;
386
+ theme: z.ZodOptional<z.ZodString>;
387
+ accentColor: z.ZodOptional<z.ZodString>;
388
+ size: z.ZodDefault<z.ZodEnum<{
389
+ lg: "lg";
390
+ md: "md";
391
+ sm: "sm";
392
+ }>>;
393
+ emphasis: z.ZodDefault<z.ZodEnum<{
394
+ epic: "epic";
395
+ legendary: "legendary";
396
+ normal: "normal";
397
+ rare: "rare";
398
+ }>>;
399
+ effects: z.ZodDefault<z.ZodArray<z.ZodString>>;
400
+ }, z.core.$strip>>;
401
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
402
+ type: z.ZodLiteral<"audio">;
403
+ ref: z.ZodObject<{
404
+ kind: z.ZodLiteral<"space-file">;
405
+ path: z.ZodString;
406
+ }, z.core.$strip>;
407
+ snapshot: z.ZodOptional<z.ZodObject<{
408
+ title: z.ZodOptional<z.ZodString>;
409
+ mimeType: z.ZodOptional<z.ZodString>;
410
+ size: z.ZodOptional<z.ZodNumber>;
411
+ mtimeMs: z.ZodOptional<z.ZodNumber>;
412
+ naturalWidth: z.ZodOptional<z.ZodNumber>;
413
+ naturalHeight: z.ZodOptional<z.ZodNumber>;
414
+ durationMs: z.ZodOptional<z.ZodNumber>;
415
+ }, z.core.$strip>>;
416
+ }, z.core.$strip>;
373
417
  /**
374
418
  * Cached display facts for a file card.
375
419
  *
@@ -549,7 +593,7 @@ declare const BoardTaskItemSchema: z.ZodObject<{
549
593
  * authored by newer clients round-trip losslessly — data is never dropped or
550
594
  * silently downgraded just because this client predates a shape type.
551
595
  */
552
- declare const KNOWN_BOARD_ITEM_TYPES: readonly ["image", "video", "file", "task", "text", "geo", "draw", "arrow", "frame"];
596
+ declare const KNOWN_BOARD_ITEM_TYPES: readonly ["image", "video", "audio", "file", "task", "text", "geo", "draw", "arrow", "frame"];
553
597
  type KnownBoardItemType = (typeof KNOWN_BOARD_ITEM_TYPES)[number];
554
598
  /**
555
599
  * A forward-compatible carrier for shape types this client does not recognise.
@@ -640,6 +684,39 @@ declare const BoardItemSchema: z.ZodPipe<z.ZodAny, z.ZodTransform<BoardUnknownIt
640
684
  naturalWidth?: number | undefined;
641
685
  naturalHeight?: number | undefined;
642
686
  } | undefined;
687
+ } | {
688
+ id: string;
689
+ frame: {
690
+ x: number;
691
+ y: number;
692
+ width: number;
693
+ height: number;
694
+ rotation: number;
695
+ };
696
+ locked?: boolean | undefined;
697
+ style?: {
698
+ variant: string;
699
+ theme?: string | undefined;
700
+ accentColor?: string | undefined;
701
+ size: "lg" | "md" | "sm";
702
+ emphasis: "epic" | "legendary" | "normal" | "rare";
703
+ effects: string[];
704
+ } | undefined;
705
+ metadata?: Record<string, unknown> | undefined;
706
+ type: "audio";
707
+ ref: {
708
+ kind: "space-file";
709
+ path: string;
710
+ };
711
+ snapshot?: {
712
+ title?: string | undefined;
713
+ mimeType?: string | undefined;
714
+ size?: number | undefined;
715
+ mtimeMs?: number | undefined;
716
+ naturalWidth?: number | undefined;
717
+ naturalHeight?: number | undefined;
718
+ durationMs?: number | undefined;
719
+ } | undefined;
643
720
  } | {
644
721
  id: string;
645
722
  frame: {
@@ -953,6 +1030,39 @@ declare const BoardDocumentSchema: z.ZodObject<{
953
1030
  naturalWidth?: number | undefined;
954
1031
  naturalHeight?: number | undefined;
955
1032
  } | undefined;
1033
+ } | {
1034
+ id: string;
1035
+ frame: {
1036
+ x: number;
1037
+ y: number;
1038
+ width: number;
1039
+ height: number;
1040
+ rotation: number;
1041
+ };
1042
+ locked?: boolean | undefined;
1043
+ style?: {
1044
+ variant: string;
1045
+ theme?: string | undefined;
1046
+ accentColor?: string | undefined;
1047
+ size: "lg" | "md" | "sm";
1048
+ emphasis: "epic" | "legendary" | "normal" | "rare";
1049
+ effects: string[];
1050
+ } | undefined;
1051
+ metadata?: Record<string, unknown> | undefined;
1052
+ type: "audio";
1053
+ ref: {
1054
+ kind: "space-file";
1055
+ path: string;
1056
+ };
1057
+ snapshot?: {
1058
+ title?: string | undefined;
1059
+ mimeType?: string | undefined;
1060
+ size?: number | undefined;
1061
+ mtimeMs?: number | undefined;
1062
+ naturalWidth?: number | undefined;
1063
+ naturalHeight?: number | undefined;
1064
+ durationMs?: number | undefined;
1065
+ } | undefined;
956
1066
  } | {
957
1067
  id: string;
958
1068
  frame: {
@@ -1241,13 +1351,14 @@ type BoardArrowItem = z.infer<typeof BoardArrowItemSchema>;
1241
1351
  type BoardFrameItem = z.infer<typeof BoardFrameItemSchema>;
1242
1352
  type BoardImageItem = z.infer<typeof BoardImageItemSchema>;
1243
1353
  type BoardVideoItem = z.infer<typeof BoardVideoItemSchema>;
1354
+ type BoardAudioItem = z.infer<typeof BoardAudioItemSchema>;
1244
1355
  type BoardFileSnapshot = z.infer<typeof BoardFileSnapshotSchema>;
1245
1356
  type BoardFileItem = z.infer<typeof BoardFileItemSchema>;
1246
1357
  type BoardTaskOutput = z.infer<typeof BoardTaskOutputSchema>;
1247
1358
  type BoardTaskSnapshot = z.infer<typeof BoardTaskSnapshotSchema>;
1248
1359
  type BoardTaskItem = z.infer<typeof BoardTaskItemSchema>;
1249
1360
  /** Known (natively handled) item variants. */
1250
- type BoardKnownItem = BoardImageItem | BoardVideoItem | BoardFileItem | BoardTaskItem | BoardTextItem | BoardGeoItem | BoardDrawItem | BoardArrowItem | BoardFrameItem;
1361
+ type BoardKnownItem = BoardImageItem | BoardVideoItem | BoardAudioItem | BoardFileItem | BoardTaskItem | BoardTextItem | BoardGeoItem | BoardDrawItem | BoardArrowItem | BoardFrameItem;
1251
1362
  /** Any item, including forward-compatible unknown types. */
1252
1363
  type BoardItem = BoardKnownItem | BoardUnknownItem;
1253
1364
  type BoardDocument = z.infer<typeof BoardDocumentSchema>;
@@ -1268,8 +1379,8 @@ declare function parseBoardDocument(input: unknown): BoardDocument;
1268
1379
  /** Keep only the connections whose endpoints both exist in `items`. */
1269
1380
  declare function withResolvedConnections(document: BoardDocument): BoardDocument;
1270
1381
  declare function isUnknownItem(item: BoardItem): item is BoardUnknownItem;
1271
- declare function isMediaItem(item: BoardItem): item is BoardImageItem | BoardVideoItem;
1272
- /** Whether an item references a workspace file (image, video or file card). */
1273
- declare function isFileBackedItem(item: BoardItem): item is BoardImageItem | BoardVideoItem | BoardFileItem;
1382
+ declare function isMediaItem(item: BoardItem): item is BoardImageItem | BoardVideoItem | BoardAudioItem;
1383
+ /** Whether an item references a workspace file (media or file card). */
1384
+ declare function isFileBackedItem(item: BoardItem): item is BoardImageItem | BoardVideoItem | BoardAudioItem | BoardFileItem;
1274
1385
  //#endregion
1275
- export { BOARD_DOCUMENT_KIND, BOARD_EXTENSION, BoardAppearance, BoardAppearanceSchema, BoardArrowItem, BoardArrowItemSchema, BoardDocument, BoardDocumentSchema, BoardDrawItem, BoardDrawItemSchema, BoardFileItem, BoardFileItemSchema, BoardFileSnapshot, BoardFileSnapshotSchema, BoardFrame, BoardFrameItem, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItem, BoardGeoItemSchema, BoardImageItem, BoardImageItemSchema, BoardItem, BoardItemSchema, BoardItemStyle, BoardItemStyleSchema, BoardKnownItem, BoardMediaSnapshot, BoardMediaSnapshotSchema, BoardPoint, BoardPointSchema, BoardTaskItem, BoardTaskItemSchema, BoardTaskOutput, BoardTaskOutputSchema, BoardTaskSnapshot, BoardTaskSnapshotSchema, BoardTextItem, BoardTextItemSchema, BoardUnknownItem, BoardVideoItem, BoardVideoItemSchema, BoardViewport, BoardViewportSchema, DrawPoint, DrawPointSchema, KNOWN_BOARD_ITEM_TYPES, KnownBoardItemType, SpaceFileRef, SpaceFileRefSchema, UNKNOWN_BOARD_ITEM_TYPE, isFileBackedItem, isMediaItem, isUnknownItem, parseBoardDocument, parseBoardItemLoose, unknownRealType, withResolvedConnections };
1386
+ export { BOARD_DOCUMENT_KIND, BOARD_EXTENSION, BoardAppearance, BoardAppearanceSchema, BoardArrowItem, BoardArrowItemSchema, BoardAudioItem, BoardAudioItemSchema, BoardDocument, BoardDocumentSchema, BoardDrawItem, BoardDrawItemSchema, BoardFileItem, BoardFileItemSchema, BoardFileSnapshot, BoardFileSnapshotSchema, BoardFrame, BoardFrameItem, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItem, BoardGeoItemSchema, BoardImageItem, BoardImageItemSchema, BoardItem, BoardItemSchema, BoardItemStyle, BoardItemStyleSchema, BoardKnownItem, BoardMediaSnapshot, BoardMediaSnapshotSchema, BoardPoint, BoardPointSchema, BoardTaskItem, BoardTaskItemSchema, BoardTaskOutput, BoardTaskOutputSchema, BoardTaskSnapshot, BoardTaskSnapshotSchema, BoardTextItem, BoardTextItemSchema, BoardUnknownItem, BoardVideoItem, BoardVideoItemSchema, BoardViewport, BoardViewportSchema, DrawPoint, DrawPointSchema, KNOWN_BOARD_ITEM_TYPES, KnownBoardItemType, SpaceFileRef, SpaceFileRefSchema, UNKNOWN_BOARD_ITEM_TYPE, isFileBackedItem, isMediaItem, isUnknownItem, parseBoardDocument, parseBoardItemLoose, unknownRealType, withResolvedConnections };
@@ -167,6 +167,12 @@ const BoardVideoItemSchema = BoardItemBaseSchema.extend({
167
167
  ref: SpaceFileRefSchema,
168
168
  snapshot: BoardMediaSnapshotSchema.optional()
169
169
  });
170
+ /** Audio node — space file only. Playback state is local UI, never synced. */
171
+ const BoardAudioItemSchema = BoardItemBaseSchema.extend({
172
+ type: z.literal("audio"),
173
+ ref: SpaceFileRefSchema,
174
+ snapshot: BoardMediaSnapshotSchema.extend({ durationMs: z.number().finite().nonnegative().optional() }).optional()
175
+ });
170
176
  /**
171
177
  * Cached display facts for a file card.
172
178
  *
@@ -251,6 +257,7 @@ const BoardTaskItemSchema = BoardItemBaseSchema.extend({
251
257
  const KNOWN_BOARD_ITEM_TYPES = [
252
258
  "image",
253
259
  "video",
260
+ "audio",
254
261
  "file",
255
262
  "task",
256
263
  "text",
@@ -288,6 +295,10 @@ function parseBoardItemLoose(raw) {
288
295
  const parsed = BoardVideoItemSchema.safeParse(raw);
289
296
  return parsed.success ? parsed.data : makeUnknownItem(raw);
290
297
  }
298
+ case "audio": {
299
+ const parsed = BoardAudioItemSchema.safeParse(raw);
300
+ return parsed.success ? parsed.data : makeUnknownItem(raw);
301
+ }
291
302
  case "file": {
292
303
  const parsed = BoardFileItemSchema.safeParse(raw);
293
304
  return parsed.success ? parsed.data : makeUnknownItem(raw);
@@ -396,11 +407,11 @@ function isUnknownItem(item) {
396
407
  return item.type === UNKNOWN_BOARD_ITEM_TYPE;
397
408
  }
398
409
  function isMediaItem(item) {
399
- return item.type === "image" || item.type === "video";
410
+ return item.type === "image" || item.type === "video" || item.type === "audio";
400
411
  }
401
- /** Whether an item references a workspace file (image, video or file card). */
412
+ /** Whether an item references a workspace file (media or file card). */
402
413
  function isFileBackedItem(item) {
403
- return item.type === "image" || item.type === "video" || item.type === "file";
414
+ return item.type === "image" || item.type === "video" || item.type === "audio" || item.type === "file";
404
415
  }
405
416
  //#endregion
406
- export { BOARD_DOCUMENT_KIND, BOARD_EXTENSION, BoardAppearanceSchema, BoardArrowItemSchema, BoardDocumentSchema, BoardDrawItemSchema, BoardFileItemSchema, BoardFileSnapshotSchema, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItemSchema, BoardImageItemSchema, BoardItemSchema, BoardItemStyleSchema, BoardMediaSnapshotSchema, BoardPointSchema, BoardTaskItemSchema, BoardTaskOutputSchema, BoardTaskSnapshotSchema, BoardTextItemSchema, BoardVideoItemSchema, BoardViewportSchema, DrawPointSchema, KNOWN_BOARD_ITEM_TYPES, SpaceFileRefSchema, UNKNOWN_BOARD_ITEM_TYPE, isFileBackedItem, isMediaItem, isUnknownItem, parseBoardDocument, parseBoardItemLoose, unknownRealType, withResolvedConnections };
417
+ export { BOARD_DOCUMENT_KIND, BOARD_EXTENSION, BoardAppearanceSchema, BoardArrowItemSchema, BoardAudioItemSchema, BoardDocumentSchema, BoardDrawItemSchema, BoardFileItemSchema, BoardFileSnapshotSchema, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItemSchema, BoardImageItemSchema, BoardItemSchema, BoardItemStyleSchema, BoardMediaSnapshotSchema, BoardPointSchema, BoardTaskItemSchema, BoardTaskOutputSchema, BoardTaskSnapshotSchema, BoardTextItemSchema, BoardVideoItemSchema, BoardViewportSchema, DrawPointSchema, KNOWN_BOARD_ITEM_TYPES, SpaceFileRefSchema, UNKNOWN_BOARD_ITEM_TYPE, isFileBackedItem, isMediaItem, isUnknownItem, parseBoardDocument, parseBoardItemLoose, unknownRealType, withResolvedConnections };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neta-art/cohub",
3
- "version": "5.6.0",
3
+ "version": "5.7.0",
4
4
  "description": "Cohub SDK for spaces, sessions, boards, and realtime agent collaboration.",
5
5
  "license": "Apache-2.0",
6
6
  "private": false,