@neta-art/cohub 5.10.0 → 7.0.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 +47 -50
- package/dist/board/animation.d.ts +157 -67
- package/dist/board/animation.js +161 -306
- package/dist/board/core/connections.js +4 -4
- package/dist/board/core/export-plan.js +1 -1
- package/dist/board/core/shape-types.js +0 -1
- package/dist/board/geometry.js +4 -4
- package/dist/board/index.d.ts +8 -7
- package/dist/board/index.js +8 -9
- package/dist/board/mutation.d.ts +2 -17
- package/dist/board/mutation.js +2 -93
- package/dist/board/render/renderers/text-card-renderer.js +1 -1
- package/dist/board/semantic-document.d.ts +30 -0
- package/dist/board/semantic-document.js +271 -0
- package/dist/board/semantic-mutation.d.ts +10 -0
- package/dist/board/semantic-mutation.js +203 -0
- package/dist/chunks/http.d.ts +27 -95
- package/dist/chunks/http.js +628 -1610
- package/dist/chunks/transport.js +1 -1
- package/dist/chunks/websocket.d.ts +3462 -533
- package/dist/chunks/websocket.js +1 -1
- package/dist/http.d.ts +3 -3
- package/dist/index.d.ts +158 -299
- package/dist/index.js +1207 -499
- package/dist/protocol/dist/board-authoring.d.ts +1305 -0
- package/dist/protocol/dist/board-authoring.js +291 -0
- package/dist/protocol/dist/board-capability-registry.d.ts +2 -0
- package/dist/protocol/dist/board-capability-registry.js +74 -0
- package/dist/protocol/dist/board-codec.d.ts +2 -0
- package/dist/protocol/dist/board-codec.js +19 -0
- package/dist/protocol/dist/board-composition.d.ts +383 -0
- package/dist/protocol/dist/board-composition.js +310 -0
- package/dist/protocol/dist/board-connection.d.ts +16 -16
- package/dist/protocol/dist/board-connection.js +16 -16
- package/dist/protocol/dist/board-constants.js +0 -25
- package/dist/protocol/dist/board-document.d.ts +34 -3
- package/dist/protocol/dist/board-document.js +3 -1
- package/dist/protocol/dist/board-effect.d.ts +94 -0
- package/dist/protocol/dist/board-effect.js +53 -0
- package/dist/protocol/dist/board-json.js +16 -0
- package/dist/protocol/dist/board-node.d.ts +1 -12
- package/dist/protocol/dist/board-node.js +1 -81
- package/dist/protocol/dist/board.d.ts +42 -245
- package/dist/protocol/dist/board.js +56 -117
- package/dist/protocol/dist/index.d.ts +9 -4
- package/dist/types.d.ts +4 -1
- package/docs/work-runtime-guide.md +19 -3
- package/package.json +2 -2
- package/dist/board/codec.d.ts +0 -27
- package/dist/board/codec.js +0 -277
- package/dist/board/nodes.d.ts +0 -113
- package/dist/board/nodes.js +0 -154
- package/dist/protocol/dist/board-content.js +0 -26
- package/dist/protocol/dist/identifiers.js +0 -10
- package/dist/protocol/dist/index.js +0 -14
- package/dist/protocol/dist/provenance.js +0 -15
- package/dist/protocol/dist/public-identifiers.js +0 -38
- package/dist/protocol/dist/realtime/board-awareness.js +0 -119
- package/dist/protocol/dist/ui-command.js +0 -2
- package/dist/protocol/dist/work-promotion-stats.js +0 -11
- package/dist/protocol/dist/work-surface.js +0 -2
- package/dist/protocol/dist/work-view-stats.js +0 -3
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region ../protocol/dist/board-json.js
|
|
2
|
+
/** Structural equality for JSON-shaped semantic values. */
|
|
3
|
+
function boardJsonEquals(a, b) {
|
|
4
|
+
if (a === b) return true;
|
|
5
|
+
if (typeof a !== "object" || typeof b !== "object" || a === null || b === null) return Number.isNaN(a) && Number.isNaN(b);
|
|
6
|
+
const aArray = Array.isArray(a);
|
|
7
|
+
const bArray = Array.isArray(b);
|
|
8
|
+
if (aArray !== bArray) return false;
|
|
9
|
+
if (aArray && bArray) return a.length === b.length && a.every((value, index) => boardJsonEquals(value, b[index]));
|
|
10
|
+
const aRecord = a;
|
|
11
|
+
const bRecord = b;
|
|
12
|
+
const keys = Object.keys(aRecord);
|
|
13
|
+
return keys.length === Object.keys(bRecord).length && keys.every((key) => Object.hasOwn(bRecord, key) && boardJsonEquals(aRecord[key], bRecord[key]));
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { boardJsonEquals };
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
import { BoardCoordinateSpace } from "./board-constants.js";
|
|
2
1
|
import { z } from "zod";
|
|
3
2
|
//#region ../protocol/dist/board-node.d.ts
|
|
4
3
|
declare const BOARD_COLOR_IDS: readonly ["brand", "neutral", "black", "white", "blue", "green", "amber", "violet", "rose"];
|
|
5
4
|
type BoardColorId = (typeof BOARD_COLOR_IDS)[number];
|
|
6
5
|
declare const BOARD_GEO_KINDS: readonly ["rectangle", "rounded", "ellipse", "diamond", "triangle"];
|
|
7
6
|
type BoardGeoKind = (typeof BOARD_GEO_KINDS)[number];
|
|
8
|
-
type BoardNodeValidationDiagnostic = {
|
|
9
|
-
severity: "error";
|
|
10
|
-
code: "INVALID_BOARD_NODE" | "INVALID_BOARD_GEOMETRY";
|
|
11
|
-
message: string;
|
|
12
|
-
path: string;
|
|
13
|
-
expected?: string;
|
|
14
|
-
received?: unknown;
|
|
15
|
-
allowedValues?: readonly string[];
|
|
16
|
-
coordinateSpace?: BoardCoordinateSpace;
|
|
17
|
-
};
|
|
18
7
|
//#endregion
|
|
19
|
-
export { BOARD_COLOR_IDS, BOARD_GEO_KINDS, BoardColorId, BoardGeoKind
|
|
8
|
+
export { BOARD_COLOR_IDS, BOARD_GEO_KINDS, BoardColorId, BoardGeoKind };
|
|
@@ -155,85 +155,5 @@ function jsonSchema(schema) {
|
|
|
155
155
|
return z.toJSONSchema(schema);
|
|
156
156
|
}
|
|
157
157
|
jsonSchema(nodeEnvelopeSchema), Object.fromEntries(BOARD_NATIVE_NODE_TYPES.map((type) => [type, jsonSchema(dataSchemas[type])])), Object.fromEntries(BOARD_NATIVE_NODE_TYPES.map((type) => [type, jsonSchema(viewSchemas[type])]));
|
|
158
|
-
function issueDiagnostic(issue, path) {
|
|
159
|
-
const fullPath = [path, ...issue.path].join(".");
|
|
160
|
-
const values = "values" in issue && Array.isArray(issue.values) ? issue.values.filter((value) => typeof value === "string") : void 0;
|
|
161
|
-
return {
|
|
162
|
-
severity: "error",
|
|
163
|
-
code: "INVALID_BOARD_NODE",
|
|
164
|
-
message: `${fullPath}: ${issue.message}`,
|
|
165
|
-
path: fullPath,
|
|
166
|
-
...values?.length ? { allowedValues: values } : {}
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
function drawGeometryDiagnostic(node, data, path) {
|
|
170
|
-
let minX = Number.POSITIVE_INFINITY;
|
|
171
|
-
let minY = Number.POSITIVE_INFINITY;
|
|
172
|
-
let maxX = Number.NEGATIVE_INFINITY;
|
|
173
|
-
let maxY = Number.NEGATIVE_INFINITY;
|
|
174
|
-
for (const point of data.points) {
|
|
175
|
-
const radius = Math.max(.5, data.size / 2 * (.5 + point.p));
|
|
176
|
-
minX = Math.min(minX, point.x - radius);
|
|
177
|
-
minY = Math.min(minY, point.y - radius);
|
|
178
|
-
maxX = Math.max(maxX, point.x + radius);
|
|
179
|
-
maxY = Math.max(maxY, point.y + radius);
|
|
180
|
-
}
|
|
181
|
-
const width = Math.max(1, maxX - minX);
|
|
182
|
-
const height = Math.max(1, maxY - minY);
|
|
183
|
-
const tolerance = Math.max(.01, node.width * 1e-6, node.height * 1e-6);
|
|
184
|
-
if (Math.abs(minX) <= tolerance && Math.abs(minY) <= tolerance && Math.abs(width - node.width) <= tolerance && Math.abs(height - node.height) <= tolerance) return null;
|
|
185
|
-
return {
|
|
186
|
-
severity: "error",
|
|
187
|
-
code: "INVALID_BOARD_GEOMETRY",
|
|
188
|
-
message: `${path}.data.points must use frame-local coordinates and match the node frame`,
|
|
189
|
-
path: `${path}.data.points`,
|
|
190
|
-
expected: "frame-local points with bounds matching width and height",
|
|
191
|
-
coordinateSpace: "frame-local"
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
function validateBoardNodeInput(node, path = "node") {
|
|
195
|
-
const envelopeResult = nodeEnvelopeSchema.safeParse(node);
|
|
196
|
-
if (!envelopeResult.success) return envelopeResult.error.issues.map((issue) => issueDiagnostic(issue, path));
|
|
197
|
-
if (typeof node.type !== "string" || !BOARD_NATIVE_NODE_TYPES.includes(node.type)) return [{
|
|
198
|
-
severity: "error",
|
|
199
|
-
code: "INVALID_BOARD_NODE",
|
|
200
|
-
message: `${path}.type is not supported`,
|
|
201
|
-
path: `${path}.type`,
|
|
202
|
-
expected: "BoardNativeNodeType",
|
|
203
|
-
received: node.type,
|
|
204
|
-
allowedValues: BOARD_NATIVE_NODE_TYPES
|
|
205
|
-
}];
|
|
206
|
-
const type = node.type;
|
|
207
|
-
const dataResult = dataSchemas[type].safeParse(node.data ?? {});
|
|
208
|
-
if (!dataResult.success) return dataResult.error.issues.map((issue) => issueDiagnostic(issue, `${path}.data`));
|
|
209
|
-
const viewResult = viewSchemas[type].safeParse(node.view ?? {});
|
|
210
|
-
if (!viewResult.success) return viewResult.error.issues.map((issue) => issueDiagnostic(issue, `${path}.view`));
|
|
211
|
-
if (type === "image" || type === "video" || type === "audio" || type === "file") {
|
|
212
|
-
if (node.refKind !== "space_file" || typeof node.refPath !== "string" || !node.refPath) return [{
|
|
213
|
-
severity: "error",
|
|
214
|
-
code: "INVALID_BOARD_NODE",
|
|
215
|
-
message: `${path} requires a space file reference`,
|
|
216
|
-
path: `${path}.refPath`,
|
|
217
|
-
expected: "non-empty refPath with refKind space_file"
|
|
218
|
-
}];
|
|
219
|
-
}
|
|
220
|
-
if (type === "draw") {
|
|
221
|
-
const diagnostic = drawGeometryDiagnostic(node, dataResult.data, path);
|
|
222
|
-
return diagnostic ? [diagnostic] : [];
|
|
223
|
-
}
|
|
224
|
-
if (type === "arrow") {
|
|
225
|
-
const data = dataResult.data;
|
|
226
|
-
const inside = (point) => point.x >= node.x && point.x <= node.x + node.width && point.y >= node.y && point.y <= node.y + node.height;
|
|
227
|
-
if (!inside(data.start) || !inside(data.end)) return [{
|
|
228
|
-
severity: "error",
|
|
229
|
-
code: "INVALID_BOARD_GEOMETRY",
|
|
230
|
-
message: `${path}.data endpoints must be covered by the node frame`,
|
|
231
|
-
path: `${path}.data`,
|
|
232
|
-
expected: "world-space endpoints inside the node frame",
|
|
233
|
-
coordinateSpace: "world"
|
|
234
|
-
}];
|
|
235
|
-
}
|
|
236
|
-
return [];
|
|
237
|
-
}
|
|
238
158
|
//#endregion
|
|
239
|
-
export { BOARD_COLOR_IDS, BOARD_GEO_KINDS, BOARD_NATIVE_NODE_TYPES, BoardColorIdSchema, BoardGeoKindSchema
|
|
159
|
+
export { BOARD_COLOR_IDS, BOARD_GEO_KINDS, BOARD_NATIVE_NODE_TYPES, BoardColorIdSchema, BoardGeoKindSchema };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { BoardCapability, BoardCoordinateSpace, BoardRenderCost } from "./board-constants.js";
|
|
2
|
-
import
|
|
3
|
-
import "./board-
|
|
2
|
+
import "./board-connection.js";
|
|
3
|
+
import "./board-composition.js";
|
|
4
|
+
import { BoardAssetRef, BoardAssetRefSchema, BoardEffect, BoardEffectInput, BoardEffectInputSchema, BoardEffectSchema } from "./board-effect.js";
|
|
5
|
+
import "./board-authoring.js";
|
|
4
6
|
import { z } from "zod";
|
|
5
7
|
//#region ../protocol/dist/board.d.ts
|
|
6
8
|
declare const BOARD_EXTENSION: ".board";
|
|
@@ -12,23 +14,8 @@ declare const BoardManifestSchema: z.ZodObject<{
|
|
|
12
14
|
title: z.ZodString;
|
|
13
15
|
}, z.core.$strip>;
|
|
14
16
|
type BoardManifest = z.infer<typeof BoardManifestSchema>;
|
|
15
|
-
declare class InvalidBoardFileError extends Error {
|
|
16
|
-
readonly code = "INVALID_BOARD_FILE";
|
|
17
|
-
constructor(message?: string);
|
|
18
|
-
}
|
|
19
17
|
declare function parseBoardManifest(input: string | unknown): BoardManifest;
|
|
20
18
|
declare function serializeBoardManifest(manifest: BoardManifest): string;
|
|
21
|
-
declare const BoardTargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
22
|
-
type: z.ZodLiteral<"node">;
|
|
23
|
-
nodeId: z.ZodString;
|
|
24
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
25
|
-
type: z.ZodLiteral<"effect">;
|
|
26
|
-
effectId: z.ZodString;
|
|
27
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
28
|
-
type: z.ZodLiteral<"board">;
|
|
29
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
30
|
-
type: z.ZodLiteral<"camera">;
|
|
31
|
-
}, z.core.$strip>], "type">;
|
|
32
19
|
declare const BoardCameraStateSchema: z.ZodObject<{
|
|
33
20
|
centerX: z.ZodNumber;
|
|
34
21
|
centerY: z.ZodNumber;
|
|
@@ -43,11 +30,11 @@ declare const BoardCameraFocusSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
43
30
|
height: z.ZodNumber;
|
|
44
31
|
}, z.core.$strip>;
|
|
45
32
|
}, z.core.$strip>, z.ZodObject<{
|
|
46
|
-
type: z.ZodLiteral<"
|
|
47
|
-
|
|
33
|
+
type: z.ZodLiteral<"item">;
|
|
34
|
+
itemId: z.ZodString;
|
|
48
35
|
}, z.core.$strip>, z.ZodObject<{
|
|
49
|
-
type: z.ZodLiteral<"
|
|
50
|
-
|
|
36
|
+
type: z.ZodLiteral<"items">;
|
|
37
|
+
itemIds: z.ZodArray<z.ZodString>;
|
|
51
38
|
}, z.core.$strip>, z.ZodObject<{
|
|
52
39
|
type: z.ZodLiteral<"frame">;
|
|
53
40
|
frameId: z.ZodString;
|
|
@@ -62,11 +49,11 @@ declare const BoardCameraFocusParamsSchema: z.ZodObject<{
|
|
|
62
49
|
height: z.ZodNumber;
|
|
63
50
|
}, z.core.$strip>;
|
|
64
51
|
}, z.core.$strip>, z.ZodObject<{
|
|
65
|
-
type: z.ZodLiteral<"
|
|
66
|
-
|
|
52
|
+
type: z.ZodLiteral<"item">;
|
|
53
|
+
itemId: z.ZodString;
|
|
67
54
|
}, z.core.$strip>, z.ZodObject<{
|
|
68
|
-
type: z.ZodLiteral<"
|
|
69
|
-
|
|
55
|
+
type: z.ZodLiteral<"items">;
|
|
56
|
+
itemIds: z.ZodArray<z.ZodString>;
|
|
70
57
|
}, z.core.$strip>, z.ZodObject<{
|
|
71
58
|
type: z.ZodLiteral<"frame">;
|
|
72
59
|
frameId: z.ZodString;
|
|
@@ -79,223 +66,27 @@ declare const BoardCameraFocusParamsSchema: z.ZodObject<{
|
|
|
79
66
|
minZoom: z.ZodOptional<z.ZodNumber>;
|
|
80
67
|
maxZoom: z.ZodOptional<z.ZodNumber>;
|
|
81
68
|
}, z.core.$strip>;
|
|
82
|
-
declare const BoardAssetRefSchema: z.ZodObject<{
|
|
83
|
-
type: z.ZodEnum<{
|
|
84
|
-
extension: "extension";
|
|
85
|
-
"space-file": "space-file";
|
|
86
|
-
}>;
|
|
87
|
-
ref: z.ZodString;
|
|
88
|
-
digest: z.ZodOptional<z.ZodString>;
|
|
89
|
-
}, z.core.$strip>;
|
|
90
|
-
declare const BoardClipSchema: z.ZodObject<{
|
|
91
|
-
id: z.ZodString;
|
|
92
|
-
sequenceId: z.ZodString;
|
|
93
|
-
kind: z.ZodString;
|
|
94
|
-
kindVersion: z.ZodNumber;
|
|
95
|
-
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
96
|
-
type: z.ZodLiteral<"node">;
|
|
97
|
-
nodeId: z.ZodString;
|
|
98
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
99
|
-
type: z.ZodLiteral<"effect">;
|
|
100
|
-
effectId: z.ZodString;
|
|
101
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
102
|
-
type: z.ZodLiteral<"board">;
|
|
103
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
104
|
-
type: z.ZodLiteral<"camera">;
|
|
105
|
-
}, z.core.$strip>], "type">;
|
|
106
|
-
start: z.ZodNumber;
|
|
107
|
-
duration: z.ZodNumber;
|
|
108
|
-
layer: z.ZodDefault<z.ZodEnum<{
|
|
109
|
-
behind: "behind";
|
|
110
|
-
content: "content";
|
|
111
|
-
front: "front";
|
|
112
|
-
screen: "screen";
|
|
113
|
-
}>>;
|
|
114
|
-
fill: z.ZodDefault<z.ZodEnum<{
|
|
115
|
-
backwards: "backwards";
|
|
116
|
-
both: "both";
|
|
117
|
-
forwards: "forwards";
|
|
118
|
-
none: "none";
|
|
119
|
-
}>>;
|
|
120
|
-
easing: z.ZodDefault<z.ZodString>;
|
|
121
|
-
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
122
|
-
keyframes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
123
|
-
at: z.ZodNumber;
|
|
124
|
-
value: z.ZodUnknown;
|
|
125
|
-
easing: z.ZodOptional<z.ZodString>;
|
|
126
|
-
}, z.core.$strip>>>;
|
|
127
|
-
assetRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
128
|
-
type: z.ZodEnum<{
|
|
129
|
-
extension: "extension";
|
|
130
|
-
"space-file": "space-file";
|
|
131
|
-
}>;
|
|
132
|
-
ref: z.ZodString;
|
|
133
|
-
digest: z.ZodOptional<z.ZodString>;
|
|
134
|
-
}, z.core.$strip>>>;
|
|
135
|
-
seed: z.ZodString;
|
|
136
|
-
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
137
|
-
}, z.core.$strip>;
|
|
138
|
-
declare const BoardEffectSchema: z.ZodObject<{
|
|
139
|
-
id: z.ZodString;
|
|
140
|
-
boardId: z.ZodString;
|
|
141
|
-
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
142
|
-
type: z.ZodLiteral<"node">;
|
|
143
|
-
nodeId: z.ZodString;
|
|
144
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
145
|
-
type: z.ZodLiteral<"board">;
|
|
146
|
-
}, z.core.$strip>], "type">;
|
|
147
|
-
kind: z.ZodString;
|
|
148
|
-
kindVersion: z.ZodNumber;
|
|
149
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
150
|
-
lifecycle: z.ZodEnum<{
|
|
151
|
-
manual: "manual";
|
|
152
|
-
persistent: "persistent";
|
|
153
|
-
"when-visible": "when-visible";
|
|
154
|
-
}>;
|
|
155
|
-
timeOrigin: z.ZodEnum<{
|
|
156
|
-
activation: "activation";
|
|
157
|
-
board: "board";
|
|
158
|
-
visible: "visible";
|
|
159
|
-
}>;
|
|
160
|
-
layer: z.ZodDefault<z.ZodEnum<{
|
|
161
|
-
behind: "behind";
|
|
162
|
-
front: "front";
|
|
163
|
-
screen: "screen";
|
|
164
|
-
}>>;
|
|
165
|
-
seed: z.ZodString;
|
|
166
|
-
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
167
|
-
assetRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
168
|
-
type: z.ZodEnum<{
|
|
169
|
-
extension: "extension";
|
|
170
|
-
"space-file": "space-file";
|
|
171
|
-
}>;
|
|
172
|
-
ref: z.ZodString;
|
|
173
|
-
digest: z.ZodOptional<z.ZodString>;
|
|
174
|
-
}, z.core.$strip>>>;
|
|
175
|
-
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
176
|
-
revision: z.ZodNumber;
|
|
177
|
-
}, z.core.$strip>;
|
|
178
|
-
declare const BoardSequenceSchema: z.ZodObject<{
|
|
179
|
-
id: z.ZodString;
|
|
180
|
-
boardId: z.ZodString;
|
|
181
|
-
name: z.ZodString;
|
|
182
|
-
duration: z.ZodNumber;
|
|
183
|
-
seed: z.ZodString;
|
|
184
|
-
restPose: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
185
|
-
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
186
|
-
revision: z.ZodNumber;
|
|
187
|
-
}, z.core.$strip>;
|
|
188
|
-
type BoardTarget = z.infer<typeof BoardTargetSchema>;
|
|
189
69
|
type BoardCameraState = z.infer<typeof BoardCameraStateSchema>;
|
|
190
70
|
type BoardCameraFocus = z.infer<typeof BoardCameraFocusSchema>;
|
|
191
71
|
type BoardCameraFocusParams = z.infer<typeof BoardCameraFocusParamsSchema>;
|
|
192
|
-
type
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
version: number;
|
|
201
|
-
metadata: Record<string, unknown>;
|
|
202
|
-
createdAt: string | null;
|
|
203
|
-
updatedAt: string | null;
|
|
204
|
-
};
|
|
205
|
-
type BoardNodeRecord = {
|
|
206
|
-
boardId: string;
|
|
207
|
-
nodeId: string;
|
|
208
|
-
type: string;
|
|
209
|
-
parentId: string | null;
|
|
210
|
-
orderKey: string | null;
|
|
211
|
-
x: number;
|
|
212
|
-
y: number;
|
|
213
|
-
width: number;
|
|
214
|
-
height: number;
|
|
215
|
-
rotation: number;
|
|
216
|
-
refKind: string | null;
|
|
217
|
-
refPath: string | null;
|
|
218
|
-
refUrl: string | null;
|
|
219
|
-
view: Record<string, unknown>;
|
|
220
|
-
style: Record<string, unknown>;
|
|
221
|
-
data: Record<string, unknown>;
|
|
222
|
-
version: number;
|
|
223
|
-
createdAt: string | null;
|
|
224
|
-
updatedAt: string | null;
|
|
225
|
-
};
|
|
226
|
-
type BoardNodeInput = Omit<BoardNodeRecord, "boardId" | "version" | "createdAt" | "updatedAt">;
|
|
227
|
-
declare const BOARD_DELETE_REASONS: readonly ["user-delete", "orphan-cleanup", "layout-replace", "placeholder-cascade", "node-cascade"];
|
|
228
|
-
type BoardDeleteReason = (typeof BOARD_DELETE_REASONS)[number] | (string & {});
|
|
229
|
-
type BoardOperationBase = {
|
|
230
|
-
opId?: string;
|
|
231
|
-
/** Optional local undo hint. Servers recompute authoritative inverse data. */
|
|
232
|
-
inverse?: Record<string, unknown>;
|
|
233
|
-
};
|
|
234
|
-
type BoardOperation = (BoardOperationBase & {
|
|
235
|
-
type: "board.patch";
|
|
236
|
-
payload: {
|
|
237
|
-
patch: {
|
|
238
|
-
title?: string;
|
|
239
|
-
metadata?: Record<string, unknown>;
|
|
240
|
-
metadataPatch?: Record<string, unknown>;
|
|
241
|
-
};
|
|
242
|
-
};
|
|
243
|
-
}) | (BoardOperationBase & {
|
|
244
|
-
type: "node.create";
|
|
245
|
-
payload: {
|
|
246
|
-
node: BoardNodeInput;
|
|
247
|
-
};
|
|
248
|
-
}) | (BoardOperationBase & {
|
|
249
|
-
type: "node.patch";
|
|
250
|
-
payload: {
|
|
251
|
-
nodeId: string;
|
|
252
|
-
patch: Partial<BoardNodeInput>;
|
|
253
|
-
};
|
|
254
|
-
}) | (BoardOperationBase & {
|
|
255
|
-
type: "node.delete";
|
|
256
|
-
payload: {
|
|
257
|
-
nodeId: string;
|
|
258
|
-
reason?: BoardDeleteReason;
|
|
259
|
-
};
|
|
260
|
-
}) | (BoardOperationBase & {
|
|
261
|
-
type: "connection.create";
|
|
262
|
-
payload: {
|
|
263
|
-
connection: BoardConnectionInput;
|
|
72
|
+
type BoardMutationReceipt = {
|
|
73
|
+
mutationId: string;
|
|
74
|
+
status: "applied" | "validated";
|
|
75
|
+
outcome: "applied" | "noop" | "dry-run";
|
|
76
|
+
replayed: boolean;
|
|
77
|
+
board: {
|
|
78
|
+
id: string;
|
|
79
|
+
version: number;
|
|
264
80
|
};
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
81
|
+
changed: {
|
|
82
|
+
items: string[];
|
|
83
|
+
connections: string[];
|
|
84
|
+
effects: string[];
|
|
85
|
+
compositions: string[];
|
|
86
|
+
board: boolean;
|
|
87
|
+
orderChanged: boolean;
|
|
270
88
|
};
|
|
271
|
-
}
|
|
272
|
-
type: "connection.delete";
|
|
273
|
-
payload: {
|
|
274
|
-
connectionId: string;
|
|
275
|
-
reason?: BoardDeleteReason;
|
|
276
|
-
};
|
|
277
|
-
}) | (BoardOperationBase & {
|
|
278
|
-
type: "effect.upsert";
|
|
279
|
-
payload: {
|
|
280
|
-
effect: Omit<BoardEffect, "boardId" | "revision">;
|
|
281
|
-
};
|
|
282
|
-
}) | (BoardOperationBase & {
|
|
283
|
-
type: "effect.delete";
|
|
284
|
-
payload: {
|
|
285
|
-
effectId: string;
|
|
286
|
-
};
|
|
287
|
-
}) | (BoardOperationBase & {
|
|
288
|
-
type: "sequence.upsert";
|
|
289
|
-
payload: {
|
|
290
|
-
sequence: Omit<BoardSequence, "boardId" | "revision">;
|
|
291
|
-
clips: Array<Omit<BoardClip, "sequenceId">>;
|
|
292
|
-
};
|
|
293
|
-
}) | (BoardOperationBase & {
|
|
294
|
-
type: "sequence.delete";
|
|
295
|
-
payload: {
|
|
296
|
-
sequenceId: string;
|
|
297
|
-
};
|
|
298
|
-
});
|
|
89
|
+
};
|
|
299
90
|
type BoardDiagnostic = {
|
|
300
91
|
severity: "info" | "warning" | "error";
|
|
301
92
|
code: string;
|
|
@@ -312,13 +103,19 @@ type BoardValidationResult = {
|
|
|
312
103
|
diagnostics: BoardDiagnostic[];
|
|
313
104
|
peakCost: BoardRenderCost;
|
|
314
105
|
};
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
106
|
+
type BoardPlaybackStatus = "playing" | "paused" | "stopped";
|
|
107
|
+
type BoardPlaybackSnapshot = {
|
|
108
|
+
boardId: string;
|
|
109
|
+
playbackId: string;
|
|
110
|
+
compositionId: string;
|
|
111
|
+
compositionRevision: number;
|
|
112
|
+
playbackRevision: number;
|
|
113
|
+
status: BoardPlaybackStatus;
|
|
114
|
+
position: number;
|
|
115
|
+
effectiveAt: number;
|
|
116
|
+
timeScale: number;
|
|
117
|
+
seed: string;
|
|
118
|
+
};
|
|
322
119
|
declare function isBoardPath(path: string): boolean;
|
|
323
120
|
//#endregion
|
|
324
|
-
export {
|
|
121
|
+
export { BOARD_DOCUMENT_KIND, BOARD_EXTENSION, type BoardAssetRef, BoardCameraFocus, BoardCameraFocusParams, BoardCameraFocusParamsSchema, BoardCameraFocusSchema, BoardCameraState, BoardCameraStateSchema, type BoardCapability, BoardDiagnostic, type BoardEffect, BoardManifest, BoardManifestSchema, BoardMutationReceipt, BoardPlaybackSnapshot, BoardPlaybackStatus, type BoardRenderCost, BoardValidationResult, isBoardPath, parseBoardManifest, serializeBoardManifest };
|