@nodetool-ai/document-services 0.0.0-stage → 0.8.9-beta.2

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
@@ -1,3 +1,7 @@
1
- # Temporary Holding Version
1
+ # Document services
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Canonical storyboard, entity, script and timeline model interfaces shared by
4
+ HTTP and local execution hosts. This optional package depends on the full
5
+ persistence models and runtime contracts, without the HTTP application.
6
+
7
+ Import `documentModelInterfaces` from `@nodetool-ai/document-services`.
@@ -0,0 +1 @@
1
+ 2026-10-31T10:34:52.785Z
@@ -0,0 +1,30 @@
1
+ /**
2
+ * The model interfaces a graph uses to reach the documents a director approves:
3
+ * storyboards and the entity library.
4
+ *
5
+ * They live here rather than in `session/model-interfaces.ts` so the CLI's
6
+ * local (no-server) runs get the same implementations — a `nodetool debug` run
7
+ * of a graph that recasts a board has to write the same rows the server does,
8
+ * or the harness proves nothing about the server.
9
+ */
10
+ import type { ProcessingContextModelInterfaces } from "@nodetool-ai/runtime";
11
+ /** Storyboards, mirroring the script trio: owner-scoped reads, CAS updates. */
12
+ export declare function storyboardModelInterfaces(): Pick<ProcessingContextModelInterfaces, "getStoryboard" | "listStoryboards" | "findRecastStoryboard" | "createStoryboard" | "updateStoryboard">;
13
+ /**
14
+ * The entity library. An entity is an image asset carrying a marker, so every
15
+ * read here is an owner-scoped asset read and every write is a metadata write —
16
+ * the same path the `entities` agent capability takes.
17
+ */
18
+ export declare function entityModelInterfaces(): Pick<ProcessingContextModelInterfaces, "listEntities" | "getEntity" | "upsertEntity">;
19
+ /** All three groups, for a host installing the whole document surface. */
20
+ /**
21
+ * Scripts and timeline sequences, owner-scoped with CAS updates.
22
+ *
23
+ * These live here rather than beside the server session because the CLI
24
+ * installs this module: without them `nodetool debug` cannot run a single
25
+ * `nodetool.script.*` or `nodetool.timeline.*` node, which is most of what the
26
+ * graph-resource fixtures do.
27
+ */
28
+ export declare function scriptModelInterfaces(): Pick<ProcessingContextModelInterfaces, "getTimelineSequence" | "createTimelineSequence" | "updateTimelineSequence" | "getScript" | "createScript" | "updateScript">;
29
+ export declare function documentModelInterfaces(): ProcessingContextModelInterfaces;
30
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgBH,OAAO,KAAK,EAEV,gCAAgC,EACjC,MAAM,sBAAsB,CAAC;AA2F9B,+EAA+E;AAC/E,wBAAgB,yBAAyB,IAAI,IAAI,CAC/C,gCAAgC,EAC9B,eAAe,GACf,iBAAiB,GACjB,sBAAsB,GACtB,kBAAkB,GAClB,kBAAkB,CACrB,CA+DA;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAC3C,gCAAgC,EAChC,cAAc,GAAG,WAAW,GAAG,cAAc,CAC9C,CA2DA;AAED,0EAA0E;AAC1E;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAC3C,gCAAgC,EAC9B,qBAAqB,GACrB,wBAAwB,GACxB,wBAAwB,GACxB,WAAW,GACX,cAAc,GACd,cAAc,CACjB,CA0EA;AAED,wBAAgB,uBAAuB,IAAI,gCAAgC,CA8B1E"}
package/dist/index.js ADDED
@@ -0,0 +1,296 @@
1
+ /**
2
+ * The model interfaces a graph uses to reach the documents a director approves:
3
+ * storyboards and the entity library.
4
+ *
5
+ * They live here rather than in `session/model-interfaces.ts` so the CLI's
6
+ * local (no-server) runs get the same implementations — a `nodetool debug` run
7
+ * of a graph that recasts a board has to write the same rows the server does,
8
+ * or the harness proves nothing about the server.
9
+ */
10
+ import { Asset, ImageDocument, Script, Storyboard, TimelineSequence, entityFromAsset } from "@nodetool-ai/models";
11
+ import { ENTITY_METADATA_KEY, isRecord, readEntityMarker } from "@nodetool-ai/protocol";
12
+ /** How many of the caller's image assets a library scan reads. */
13
+ const ENTITY_ASSET_LIMIT = 1000;
14
+ const norm = (value) => value.trim().toLowerCase();
15
+ /**
16
+ * The entity row an upsert writes to: the one a previous run of the same graph
17
+ * made (`source.key`), else the one with the same kind and name in the same
18
+ * project. Null when neither exists and the entity is new.
19
+ *
20
+ * A caller that gives a key never lands on a row carrying a *different* key.
21
+ * Two SKUs of one product share a display name, so name matching would make the
22
+ * second SKU overwrite the first's descriptor, picture and key — and inherit
23
+ * its recast mapping. A row carrying no key of its own is still fair game: that
24
+ * is how an entity a person made by hand becomes the graph's on the first keyed
25
+ * run, instead of gaining a duplicate beside it.
26
+ */
27
+ async function findUpsertTarget(args) {
28
+ const [assets] = await Asset.paginate(args.userId, {
29
+ contentType: "image",
30
+ projectId: args.projectId,
31
+ limit: ENTITY_ASSET_LIMIT
32
+ });
33
+ const markers = assets.map((asset) => [asset, readEntityMarker(asset.metadata)]);
34
+ const key = args.source?.key?.trim();
35
+ if (key) {
36
+ const bySource = markers.find(([, marker]) => marker?.source?.key === key);
37
+ if (bySource)
38
+ return bySource[0];
39
+ }
40
+ const name = norm(args.name);
41
+ const byName = markers.find(([, marker]) => !!marker &&
42
+ marker.kind === args.kind &&
43
+ norm(marker.name) === name &&
44
+ (!key || !marker.source?.key?.trim()));
45
+ return byName?.[0] ?? null;
46
+ }
47
+ /**
48
+ * Write the marker fields onto an asset's metadata and save it. Optional
49
+ * fields are left alone when the caller did not pass them, so a re-run that
50
+ * only knows the name and descriptor does not wipe a hand-written description.
51
+ */
52
+ async function writeEntityMarker(asset, args) {
53
+ const refusal = Asset.systemEntityRefusal(asset);
54
+ if (refusal) {
55
+ throw new Error(refusal);
56
+ }
57
+ const raw = asset.metadata?.[ENTITY_METADATA_KEY];
58
+ const marker = isRecord(raw) ? { ...raw } : {};
59
+ marker["kind"] = args.kind;
60
+ marker["name"] = args.name;
61
+ marker["descriptor"] = args.descriptor;
62
+ if (args.description !== undefined)
63
+ marker["description"] = args.description;
64
+ if (args.tags !== undefined)
65
+ marker["tags"] = args.tags;
66
+ if (args.voiceId !== undefined) {
67
+ if (args.voiceId === null)
68
+ delete marker["voice_id"];
69
+ else
70
+ marker["voice_id"] = args.voiceId;
71
+ }
72
+ if (args.source !== undefined)
73
+ marker["source"] = { ...args.source };
74
+ // A swap points the entity's picture at another asset rather than moving the
75
+ // marker: the id boards and scripts store is the marker asset's, and moving
76
+ // it would leave every one of those references dangling.
77
+ if (args.imageAssetId && args.imageAssetId !== asset.id) {
78
+ marker["reference_asset_id"] = args.imageAssetId;
79
+ }
80
+ else {
81
+ delete marker["reference_asset_id"];
82
+ }
83
+ asset.metadata = { ...(asset.metadata ?? {}), [ENTITY_METADATA_KEY]: marker };
84
+ if (args.projectId) {
85
+ asset.project_id = args.projectId;
86
+ }
87
+ await asset.save();
88
+ const entity = entityFromAsset(asset);
89
+ if (!entity) {
90
+ throw new Error(`Entity marker on asset ${asset.id} was not readable`);
91
+ }
92
+ return entity;
93
+ }
94
+ /** Storyboards, mirroring the script trio: owner-scoped reads, CAS updates. */
95
+ export function storyboardModelInterfaces() {
96
+ return {
97
+ getStoryboard: async ({ userId, id }) => {
98
+ const board = await Storyboard.findById(id);
99
+ if (!board || board.user_id !== userId)
100
+ return null;
101
+ return board.toResponse();
102
+ },
103
+ listStoryboards: async ({ userId, projectId, limit }) => {
104
+ const boards = projectId
105
+ ? await Storyboard.listByProject(projectId, userId, limit)
106
+ : await Storyboard.listByUser(userId, limit);
107
+ return boards.map((board) => board.toResponse());
108
+ },
109
+ // Scoped, not listed: `listStoryboards` answers with a window of the most
110
+ // recently updated rows, and a catalog batch bigger than that window would
111
+ // stop finding the copies it made and re-render them every pass.
112
+ findRecastStoryboard: async ({ userId, projectId, templateId, recastKey }) => {
113
+ const board = await Storyboard.findRecast({
114
+ userId,
115
+ projectId,
116
+ templateId,
117
+ recastKey
118
+ });
119
+ return board ? board.toResponse() : null;
120
+ },
121
+ createStoryboard: async ({ userId, name, projectId, document }) => {
122
+ const board = new Storyboard({
123
+ user_id: userId,
124
+ name: name ?? "Untitled storyboard",
125
+ project_id: projectId ?? "default",
126
+ document: JSON.stringify(document)
127
+ });
128
+ await board.save();
129
+ return board.toResponse();
130
+ },
131
+ updateStoryboard: async ({ userId, id, document, timelineId, baseUpdatedAt }) => {
132
+ const existing = await Storyboard.findById(id);
133
+ if (!existing || existing.user_id !== userId)
134
+ return null;
135
+ const fields = {};
136
+ if (document !== undefined)
137
+ fields.document = JSON.stringify(document);
138
+ if (timelineId !== undefined)
139
+ fields.timeline_id = timelineId;
140
+ const updated = await Storyboard.updateFieldsIfUnchanged(id, baseUpdatedAt ?? existing.updated_at, fields);
141
+ return updated ? updated.toResponse() : null;
142
+ }
143
+ };
144
+ }
145
+ /**
146
+ * The entity library. An entity is an image asset carrying a marker, so every
147
+ * read here is an owner-scoped asset read and every write is a metadata write —
148
+ * the same path the `entities` agent capability takes.
149
+ */
150
+ export function entityModelInterfaces() {
151
+ return {
152
+ listEntities: async ({ userId, projectId, kind, tags, nameContains, limit }) => {
153
+ const [assets] = await Asset.paginate(userId, {
154
+ contentType: "image",
155
+ projectId,
156
+ limit: ENTITY_ASSET_LIMIT
157
+ });
158
+ const wanted = nameContains ? norm(nameContains) : "";
159
+ const matched = assets
160
+ .map((asset) => entityFromAsset(asset))
161
+ .filter((entity) => entity !== null)
162
+ .filter((entity) => {
163
+ if (kind && entity.kind !== kind)
164
+ return false;
165
+ if (wanted && !norm(entity.name).includes(wanted))
166
+ return false;
167
+ if (tags && tags.length > 0) {
168
+ const own = entity.tags ?? [];
169
+ if (!tags.every((tag) => own.includes(tag)))
170
+ return false;
171
+ }
172
+ return true;
173
+ });
174
+ return limit !== undefined
175
+ ? matched.slice(0, Math.max(limit, 0))
176
+ : matched;
177
+ },
178
+ getEntity: async ({ userId, id }) => {
179
+ // An asset owned by someone else reads as missing, and an untagged one is
180
+ // not an entity — the library only sees assets carrying the marker.
181
+ const asset = await Asset.find(userId, id);
182
+ return asset ? entityFromAsset(asset) : null;
183
+ },
184
+ upsertEntity: async (args) => {
185
+ const asset = await Asset.find(args.userId, args.imageAssetId);
186
+ if (!asset) {
187
+ throw new Error(`Asset ${args.imageAssetId} was not found`);
188
+ }
189
+ if (!asset.content_type.startsWith("image/")) {
190
+ throw new Error(`${asset.name || asset.id} is a ${asset.content_type} asset; entities are image assets`);
191
+ }
192
+ const validatedArgs = { ...args, imageAssetId: asset.id };
193
+ const existing = await findUpsertTarget(validatedArgs);
194
+ if (existing) {
195
+ return {
196
+ entity: await writeEntityMarker(existing, validatedArgs),
197
+ created: false
198
+ };
199
+ }
200
+ return { entity: await writeEntityMarker(asset, validatedArgs), created: true };
201
+ }
202
+ };
203
+ }
204
+ /** All three groups, for a host installing the whole document surface. */
205
+ /**
206
+ * Scripts and timeline sequences, owner-scoped with CAS updates.
207
+ *
208
+ * These live here rather than beside the server session because the CLI
209
+ * installs this module: without them `nodetool debug` cannot run a single
210
+ * `nodetool.script.*` or `nodetool.timeline.*` node, which is most of what the
211
+ * graph-resource fixtures do.
212
+ */
213
+ export function scriptModelInterfaces() {
214
+ return {
215
+ getTimelineSequence: async ({ userId, id }) => {
216
+ const seq = await TimelineSequence.findById(id);
217
+ if (!seq || seq.user_id !== userId)
218
+ return null;
219
+ return seq.toTimelineSequence();
220
+ },
221
+ createTimelineSequence: async ({ userId, sequence }) => {
222
+ const seq = TimelineSequence.fromTimelineSequence(userId, sequence);
223
+ await seq.save();
224
+ return seq.toTimelineSequence();
225
+ },
226
+ updateTimelineSequence: async ({ userId, id, sequence }) => {
227
+ const existing = await TimelineSequence.findById(id);
228
+ if (!existing || existing.user_id !== userId)
229
+ return null;
230
+ const next = TimelineSequence.fromTimelineSequence(userId, sequence);
231
+ const updated = await TimelineSequence.updateFieldsIfUnchanged(id, next.updated_at, {
232
+ name: next.name,
233
+ fps: next.fps,
234
+ width: next.width,
235
+ height: next.height,
236
+ duration_ms: next.duration_ms,
237
+ document: next.document
238
+ });
239
+ return updated ? updated.toTimelineSequence() : null;
240
+ },
241
+ getScript: async ({ userId, id }) => {
242
+ const script = await Script.findById(id);
243
+ if (!script || script.user_id !== userId)
244
+ return null;
245
+ return script.toResponse();
246
+ },
247
+ createScript: async ({ userId, name, projectId, document }) => {
248
+ const script = new Script({
249
+ user_id: userId,
250
+ name: name ?? "Untitled script",
251
+ project_id: projectId ?? "default",
252
+ document: JSON.stringify(document)
253
+ });
254
+ await script.save();
255
+ return script.toResponse();
256
+ },
257
+ updateScript: async ({ userId, id, document, timelineId, baseUpdatedAt }) => {
258
+ const existing = await Script.findById(id);
259
+ if (!existing || existing.user_id !== userId)
260
+ return null;
261
+ const fields = {};
262
+ if (document !== undefined)
263
+ fields.document = JSON.stringify(document);
264
+ if (timelineId !== undefined)
265
+ fields.timeline_id = timelineId;
266
+ const updated = await Script.updateFieldsIfUnchanged(id, baseUpdatedAt ?? existing.updated_at, fields);
267
+ return updated ? updated.toResponse() : null;
268
+ }
269
+ };
270
+ }
271
+ export function documentModelInterfaces() {
272
+ return {
273
+ getImageDocument: async ({ userId, id }) => {
274
+ const doc = await ImageDocument.findById(id);
275
+ if (!doc || doc.user_id !== userId)
276
+ return null;
277
+ return doc.toResponse();
278
+ },
279
+ createImageDocument: async ({ userId, name, projectId, width, height, document }) => {
280
+ const doc = new ImageDocument({
281
+ user_id: userId,
282
+ project_id: projectId ?? "default",
283
+ name,
284
+ width,
285
+ height,
286
+ document: JSON.stringify(document)
287
+ });
288
+ await doc.save();
289
+ return doc.toResponse();
290
+ },
291
+ ...scriptModelInterfaces(),
292
+ ...storyboardModelInterfaces(),
293
+ ...entityModelInterfaces()
294
+ };
295
+ }
296
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,KAAK,EACL,aAAa,EACb,MAAM,EACN,UAAU,EACV,gBAAgB,EAChB,eAAe,EAChB,MAAM,q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B;IACrC,OAAO;QACL,gBAAgB,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE;YACzC,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;YAC7C,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,KAAK,MAAM;gBAAE,OAAO,IAAI,CAAC;YAChD,OAAO,GAAG,CAAC,UAAU,EAAE,CAAC;QAC1B,CAAC;QACD,mBAAmB,EAAE,KAAK,EAAE,EAC1B,MAAM,EACN,IAAI,EACJ,SAAS,EACT,KAAK,EACL,MAAM,EACN,QAAQ,EACT,EAAE,EAAE;YACH,MAAM,GAAG,GAAG,IAAI,aAAa,CAAC;gBAC5B,OAAO,EAAE,MAAM;gBACf,UAAU,EAAE,SAAS,IAAI,SAAS;gBAClC,IAAI;gBACJ,KAAK;gBACL,MAAM;gBACN,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;aACnC,CAAC,CAAC;YACH,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;YACjB,OAAO,GAAG,CAAC,UAAU,EAAE,CAAC;QAC1B,CAAC;QACD,GAAG,qBAAqB,EAAE;QAC1B,GAAG,yBAAyB,EAAE;QAC9B,GAAG,qBAAqB,EAAE;KAC3B,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,61 @@
1
1
  {
2
2
  "name": "@nodetool-ai/document-services",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.8.9-beta.2",
4
+ "description": "Shared document services for NodeTool hosts",
5
+ "type": "module",
6
+ "engines": {
7
+ "node": "24.22.1"
8
+ },
9
+ "main": "dist/index.js",
10
+ "types": "dist/index.d.ts",
11
+ "scripts": {
12
+ "build": "node ../../scripts/build-typescript-workspace.mjs",
13
+ "test": "node ../../scripts/run-vitest.mjs run",
14
+ "lint": "node ../../scripts/run-tsc.mjs --noEmit"
15
+ },
16
+ "dependencies": {
17
+ "@nodetool-ai/models": "0.8.9-beta.2",
18
+ "@nodetool-ai/protocol": "0.8.9-beta.2",
19
+ "@nodetool-ai/runtime": "0.8.9-beta.2"
20
+ },
21
+ "devDependencies": {
22
+ "typescript": "npm:@typescript/typescript6@6.0.2",
23
+ "vitest": "^5.0.1",
24
+ "@types/node": "^22.0.0"
25
+ },
26
+ "exports": {
27
+ ".": {
28
+ "nodetool-dev": "./src/index.ts",
29
+ "types": "./dist/index.d.ts",
30
+ "import": "./dist/index.js"
31
+ }
32
+ },
33
+ "license": "MIT",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://github.com/nodetool-ai/nodetool.git",
37
+ "directory": "packages/document-services"
38
+ },
39
+ "homepage": "https://nodetool.ai",
40
+ "bugs": {
41
+ "url": "https://github.com/nodetool-ai/nodetool/issues"
42
+ },
43
+ "publishConfig": {
44
+ "access": "public"
45
+ },
46
+ "files": [
47
+ "dist",
48
+ "README.md"
49
+ ],
50
+ "keywords": [
51
+ "nodetool",
52
+ "ai",
53
+ "workflow",
54
+ "workflow-automation",
55
+ "typescript",
56
+ "message-types",
57
+ "msgpack",
58
+ "protocol",
59
+ "websocket"
60
+ ]
61
+ }