@willwade/aac-processors 0.2.20 → 0.3.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.
@@ -0,0 +1,51 @@
1
+ /**
2
+ * GoTalk NOW Processor
3
+ *
4
+ * Reads, translates, and converts Attainment Company's GoTalk NOW
5
+ * communication-board files (`.gtbz`).
6
+ *
7
+ * A `.gtbz` file is a ZIP archive containing Apple property lists:
8
+ * - BookInfo.plist – format version (GoTalkBookFormatVersion)
9
+ * - PageData.plist – pages dict keyed by page id (positive = content,
10
+ * negative = system/express-bar pages)
11
+ * - PageOrder.plist – ordered array of page ids
12
+ * - PageHistory.plist – navigation history (usually empty)
13
+ * - SettingsWriteOut.plist– app-level settings (TTS, scanning, …)
14
+ * - IconSource-<id>.png – page icons
15
+ * - Source-<page>-<btn>-<guid>-…png – button images
16
+ * - <page>-<btn>.caf – audio recordings (Core Audio Format)
17
+ * - Backup-<n>.zip – rolling backups
18
+ * - REQUIRESREGEN – marker file
19
+ *
20
+ * Colours and fonts in PageData are NSKeyedArchiver-encoded binary plists
21
+ * carried inside `<data>` tags. They are treated as opaque blobs and preserved
22
+ * verbatim so that only text fields are touched during translation.
23
+ */
24
+ import { BaseProcessor, ProcessorOptions, ExtractStringsResult, TranslatedString, SourceString } from '../core/baseProcessor';
25
+ import { AACTree } from '../core/treeStructure';
26
+ import { ProcessorInput } from '../utils/io';
27
+ declare class GotalkNowProcessor extends BaseProcessor {
28
+ readonly capabilities: {
29
+ wordList: "none";
30
+ preservesAssetsOnSave: boolean;
31
+ newCellCreation: "allowed";
32
+ };
33
+ constructor(options?: ProcessorOptions);
34
+ private openZip;
35
+ private readPlistFromZip;
36
+ extractTexts(filePathOrBuffer: ProcessorInput): Promise<string[]>;
37
+ loadIntoTree(filePathOrBuffer: ProcessorInput): Promise<AACTree>;
38
+ processTexts(filePathOrBuffer: ProcessorInput, translations: Map<string, string>, outputPath: string): Promise<Uint8Array>;
39
+ saveFromTree(tree: AACTree, outputPath: string): Promise<void>;
40
+ /**
41
+ * Extract strings with metadata for aac-tools-platform compatibility.
42
+ * Uses the generic implementation from BaseProcessor.
43
+ */
44
+ extractStringsWithMetadata(filePath: string): Promise<ExtractStringsResult>;
45
+ /**
46
+ * Generate translated download for aac-tools-platform compatibility.
47
+ * Uses the generic implementation from BaseProcessor.
48
+ */
49
+ generateTranslatedDownload(filePath: string, translatedStrings: TranslatedString[], sourceStrings: SourceString[]): Promise<string>;
50
+ }
51
+ export { GotalkNowProcessor };
@@ -0,0 +1,469 @@
1
+ "use strict";
2
+ /**
3
+ * GoTalk NOW Processor
4
+ *
5
+ * Reads, translates, and converts Attainment Company's GoTalk NOW
6
+ * communication-board files (`.gtbz`).
7
+ *
8
+ * A `.gtbz` file is a ZIP archive containing Apple property lists:
9
+ * - BookInfo.plist – format version (GoTalkBookFormatVersion)
10
+ * - PageData.plist – pages dict keyed by page id (positive = content,
11
+ * negative = system/express-bar pages)
12
+ * - PageOrder.plist – ordered array of page ids
13
+ * - PageHistory.plist – navigation history (usually empty)
14
+ * - SettingsWriteOut.plist– app-level settings (TTS, scanning, …)
15
+ * - IconSource-<id>.png – page icons
16
+ * - Source-<page>-<btn>-<guid>-…png – button images
17
+ * - <page>-<btn>.caf – audio recordings (Core Audio Format)
18
+ * - Backup-<n>.zip – rolling backups
19
+ * - REQUIRESREGEN – marker file
20
+ *
21
+ * Colours and fonts in PageData are NSKeyedArchiver-encoded binary plists
22
+ * carried inside `<data>` tags. They are treated as opaque blobs and preserved
23
+ * verbatim so that only text fields are touched during translation.
24
+ */
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.GotalkNowProcessor = void 0;
30
+ const baseProcessor_1 = require("../core/baseProcessor");
31
+ const treeStructure_1 = require("../core/treeStructure");
32
+ const plist_1 = __importDefault(require("plist"));
33
+ const validationTypes_1 = require("../validation/validationTypes");
34
+ const io_1 = require("../utils/io");
35
+ const nsKeyed_1 = require("./gotalkNow/nsKeyed");
36
+ // ---------------------------------------------------------------------------
37
+ // GoTalk NOW button type → semantic-action mapping
38
+ // ---------------------------------------------------------------------------
39
+ function buildSemanticAction(rawButton, pageId, buttonIndex) {
40
+ const buttonType = rawButton.ButtonType || 'TTS';
41
+ const actionData = rawButton.ActionData || {};
42
+ const label = rawButton.ButtonText ?? '';
43
+ const ttsText = actionData.TTSText;
44
+ switch (buttonType) {
45
+ case 'Jump': {
46
+ const jumpTo = actionData.JumpTo;
47
+ const target = jumpTo !== undefined ? String(jumpTo) : undefined;
48
+ return {
49
+ semanticAction: {
50
+ category: treeStructure_1.AACSemanticCategory.NAVIGATION,
51
+ intent: treeStructure_1.AACSemanticIntent.NAVIGATE_TO,
52
+ targetId: target,
53
+ platformData: {
54
+ gotalkNow: { buttonType: 'Jump', jumpTo },
55
+ },
56
+ fallback: { type: 'NAVIGATE', targetPageId: target },
57
+ },
58
+ message: '',
59
+ targetPageId: target,
60
+ };
61
+ }
62
+ case 'Audio': {
63
+ // Audio buttons play a recorded .caf file named <pageId>-<buttonIndex>.caf
64
+ const audioLocation = `${pageId}-${buttonIndex}.caf`;
65
+ return {
66
+ semanticAction: {
67
+ category: treeStructure_1.AACSemanticCategory.MEDIA,
68
+ intent: treeStructure_1.AACSemanticIntent.PLAY_SOUND,
69
+ platformData: {
70
+ gotalkNow: { buttonType: 'Audio', audioLocation },
71
+ },
72
+ fallback: { type: 'ACTION' },
73
+ },
74
+ message: label,
75
+ };
76
+ }
77
+ case 'Express':
78
+ case 'Bookmark':
79
+ case 'URL':
80
+ case 'Video': {
81
+ return {
82
+ semanticAction: {
83
+ category: treeStructure_1.AACSemanticCategory.SYSTEM_CONTROL,
84
+ intent: treeStructure_1.AACSemanticIntent.PLATFORM_SPECIFIC,
85
+ platformData: {
86
+ gotalkNow: { buttonType },
87
+ },
88
+ fallback: { type: 'ACTION' },
89
+ },
90
+ message: ttsText && ttsText.length > 0 ? ttsText : label,
91
+ };
92
+ }
93
+ case 'TTS':
94
+ default: {
95
+ // When TTSText is empty the visible ButtonText is spoken.
96
+ const spoken = ttsText && ttsText.length > 0 ? ttsText : label;
97
+ return {
98
+ semanticAction: {
99
+ category: treeStructure_1.AACSemanticCategory.COMMUNICATION,
100
+ intent: treeStructure_1.AACSemanticIntent.SPEAK_TEXT,
101
+ text: spoken,
102
+ platformData: {
103
+ gotalkNow: { buttonType: 'TTS' },
104
+ },
105
+ fallback: { type: 'SPEAK', message: spoken },
106
+ },
107
+ message: spoken,
108
+ };
109
+ }
110
+ }
111
+ }
112
+ /**
113
+ * Derive a square-ish grid layout from the declared button count.
114
+ * GoTalk NOW uses fixed layouts (1, 4, 9, 16, 25, 36 …).
115
+ */
116
+ function gridDimensionsFromButtonCount(count) {
117
+ const side = Math.max(1, Math.ceil(Math.sqrt(Math.max(count, 1))));
118
+ return { rows: side, cols: side };
119
+ }
120
+ // ---------------------------------------------------------------------------
121
+ // Processor
122
+ // ---------------------------------------------------------------------------
123
+ class GotalkNowProcessor extends baseProcessor_1.BaseProcessor {
124
+ constructor(options) {
125
+ super(options);
126
+ this.capabilities = {
127
+ wordList: 'none',
128
+ preservesAssetsOnSave: true,
129
+ newCellCreation: 'allowed',
130
+ };
131
+ }
132
+ // ---- Zip access ---------------------------------------------------------
133
+ async openZip(filePathOrBuffer) {
134
+ const zip = await this.options.zipAdapter(filePathOrBuffer, this.options.fileAdapter);
135
+ return zip;
136
+ }
137
+ async readPlistFromZip(zip, name, fallback) {
138
+ const files = zip.listFiles();
139
+ if (!files.includes(name)) {
140
+ if (fallback)
141
+ return fallback();
142
+ throw new Error(`GoTalk NOW archive is missing ${name}`);
143
+ }
144
+ const bytes = await zip.readFile(name);
145
+ const text = typeof Buffer !== 'undefined' && Buffer.isBuffer(bytes)
146
+ ? bytes.toString('utf8')
147
+ : new TextDecoder().decode(bytes);
148
+ return plist_1.default.parse(text);
149
+ }
150
+ // ---- extractTexts -------------------------------------------------------
151
+ async extractTexts(filePathOrBuffer) {
152
+ const tree = await this.loadIntoTree(filePathOrBuffer);
153
+ const texts = [];
154
+ for (const pageId in tree.pages) {
155
+ const page = tree.pages[pageId];
156
+ if (page.name)
157
+ texts.push(page.name);
158
+ page.buttons.forEach((btn) => {
159
+ if (btn.label)
160
+ texts.push(btn.label);
161
+ if (btn.message && btn.message !== btn.label)
162
+ texts.push(btn.message);
163
+ });
164
+ }
165
+ return texts;
166
+ }
167
+ // ---- loadIntoTree -------------------------------------------------------
168
+ async loadIntoTree(filePathOrBuffer) {
169
+ const { getFileSize, pathExists } = this.options.fileAdapter;
170
+ const filename = typeof filePathOrBuffer === 'string' ? (0, io_1.getBasename)(filePathOrBuffer) : 'upload.gtbz';
171
+ let zip;
172
+ let pageDataValue;
173
+ let pageOrderValue;
174
+ let bookInfoValue;
175
+ try {
176
+ zip = await this.openZip(filePathOrBuffer);
177
+ pageDataValue = await this.readPlistFromZip(zip, 'PageData.plist');
178
+ pageOrderValue = await this.readPlistFromZip(zip, 'PageOrder.plist', () => []);
179
+ bookInfoValue = await this.readPlistFromZip(zip, 'BookInfo.plist', () => ({}));
180
+ }
181
+ catch (err) {
182
+ if (err instanceof validationTypes_1.ValidationFailureError)
183
+ throw err;
184
+ const validation = (0, validationTypes_1.buildValidationResultFromMessage)({
185
+ filename,
186
+ filesize: typeof filePathOrBuffer === 'string'
187
+ ? (await pathExists(filePathOrBuffer))
188
+ ? await getFileSize(filePathOrBuffer)
189
+ : 0
190
+ : 0,
191
+ format: 'gotalknow',
192
+ message: err?.message || 'Failed to open GoTalk NOW archive',
193
+ type: 'structure',
194
+ description: 'gtbz archive',
195
+ });
196
+ throw new validationTypes_1.ValidationFailureError('Failed to load GoTalk NOW file', validation, err);
197
+ }
198
+ const pageData = pageDataValue || {};
199
+ const pageOrderRaw = Array.isArray(pageOrderValue) ? pageOrderValue : [];
200
+ const tree = new treeStructure_1.AACTree();
201
+ tree.metadata.format = 'gotalknow';
202
+ // Format version
203
+ const bookInfo = bookInfoValue || {};
204
+ if (bookInfo.GoTalkBookFormatVersion !== undefined) {
205
+ const version = bookInfo.GoTalkBookFormatVersion;
206
+ tree.metadata.version =
207
+ typeof version === 'number' || typeof version === 'string' ? String(version) : '1';
208
+ }
209
+ // Preserve the ordered list of page ids for round-trip fidelity.
210
+ const orderedPageIds = pageOrderRaw.map((id) => String(id));
211
+ tree.metadata.pageOrder = orderedPageIds;
212
+ // The first page in PageOrder (if any) is treated as the home page.
213
+ if (orderedPageIds.length > 0) {
214
+ tree.metadata.defaultHomePageId = orderedPageIds[0];
215
+ }
216
+ // Track available image files so we can resolve ButtonImages locations.
217
+ const zipFiles = new Set(zip.listFiles());
218
+ // Build pages. Use the union of PageData keys and PageOrder ids.
219
+ const allPageIds = new Set([...Object.keys(pageData), ...orderedPageIds]);
220
+ // Deterministic ordering: ordered pages first (in order), then any extras sorted numerically.
221
+ const sortedPageIds = [
222
+ ...orderedPageIds.filter((id) => allPageIds.has(id)),
223
+ ...[...allPageIds]
224
+ .filter((id) => !orderedPageIds.includes(id))
225
+ .sort((a, b) => Number(a) - Number(b)),
226
+ ];
227
+ if (sortedPageIds.length === 0) {
228
+ const validation = (0, validationTypes_1.buildValidationResultFromMessage)({
229
+ filename,
230
+ filesize: 0,
231
+ format: 'gotalknow',
232
+ message: 'No pages found in GoTalk NOW PageData.plist',
233
+ type: 'structure',
234
+ description: 'PageData.plist',
235
+ });
236
+ throw new validationTypes_1.ValidationFailureError('GoTalk NOW file has no pages', validation);
237
+ }
238
+ for (const pageId of sortedPageIds) {
239
+ const rawPage = pageData[pageId] || { Buttons: {} };
240
+ const pageTitle = typeof rawPage.PageTitle === 'string' && rawPage.PageTitle.trim().length > 0
241
+ ? rawPage.PageTitle
242
+ : `Page ${pageId}`;
243
+ const page = new treeStructure_1.AACPage({
244
+ id: pageId,
245
+ name: pageTitle,
246
+ grid: [],
247
+ buttons: [],
248
+ parentId: null,
249
+ });
250
+ // Page-level style: background colour and title font.
251
+ const pageBg = (0, nsKeyed_1.decodeNsColor)(rawPage.BackgroundColor);
252
+ const pageFont = (0, nsKeyed_1.decodeNsFont)(rawPage.TitleFont);
253
+ if (pageBg || pageFont.fontFamily) {
254
+ page.style = {
255
+ ...(page.style || {}),
256
+ ...(pageBg ? { backgroundColor: pageBg } : {}),
257
+ ...(pageFont.fontFamily ? { fontFamily: pageFont.fontFamily } : {}),
258
+ };
259
+ }
260
+ if (rawPage.Enabled === false) {
261
+ // Disabled pages are retained but flagged for fidelity.
262
+ page.enabled = false;
263
+ }
264
+ const buttonsById = rawPage.Buttons || {};
265
+ // Numeric sort of button indices ("0","1",…,"10",…)
266
+ const buttonIndices = Object.keys(buttonsById).sort((a, b) => Number(a) - Number(b));
267
+ const buttonCount = rawPage.ButtonCount ?? buttonIndices.length;
268
+ const { rows, cols } = gridDimensionsFromButtonCount(buttonCount);
269
+ const gridLayout = Array.from({ length: rows }, () => Array.from({ length: cols }, () => null));
270
+ buttonIndices.forEach((btnIndex, i) => {
271
+ const rawButton = buttonsById[btnIndex];
272
+ if (!rawButton)
273
+ return;
274
+ const { semanticAction, message, targetPageId } = buildSemanticAction(rawButton, pageId, btnIndex);
275
+ const button = new treeStructure_1.AACButton({
276
+ id: `${pageId}_btn_${btnIndex}`,
277
+ label: rawButton.ButtonText ?? '',
278
+ message,
279
+ targetPageId,
280
+ semanticAction,
281
+ });
282
+ // Decode style from NSKeyedArchiver blobs.
283
+ const backgroundColor = (0, nsKeyed_1.decodeNsColor)(rawButton.BackgroundColor);
284
+ const borderColor = (0, nsKeyed_1.decodeNsColor)(rawButton.BorderColor);
285
+ const fontColor = (0, nsKeyed_1.decodeNsColor)(rawButton.TextColor);
286
+ const font = (0, nsKeyed_1.decodeNsFont)(rawButton.TextFont);
287
+ if (backgroundColor || borderColor || fontColor || font.fontFamily) {
288
+ button.style = {
289
+ ...(button.style || {}),
290
+ ...(backgroundColor ? { backgroundColor } : {}),
291
+ ...(borderColor ? { borderColor } : {}),
292
+ ...(fontColor ? { fontColor } : {}),
293
+ ...(font.fontFamily ? { fontFamily: font.fontFamily } : {}),
294
+ };
295
+ }
296
+ // Resolve image metadata.
297
+ const images = rawButton.ButtonImages;
298
+ if (Array.isArray(images) && images.length > 0) {
299
+ const first = images[0];
300
+ if (first?.Location) {
301
+ button.image = first.Location;
302
+ if (zipFiles.has(first.Location)) {
303
+ button.resolvedImageEntry = first.Location;
304
+ }
305
+ }
306
+ if (first?.SourceLibrary)
307
+ button.symbolLibrary = first.SourceLibrary;
308
+ if (first?.SourceImageName)
309
+ button.symbolPath = first.SourceImageName;
310
+ }
311
+ // Visibility: GoTalk buttons can be disabled.
312
+ if (rawButton.Enabled === false) {
313
+ button.visibility = 'Disabled';
314
+ }
315
+ // Preserve raw style data opaquely for round-trip styling.
316
+ button.parameters = {
317
+ ...(button.parameters || {}),
318
+ __gotalkNow: {
319
+ buttonType: rawButton.ButtonType,
320
+ textShadow: rawButton.TextShadow,
321
+ textCenter: rawButton.TextCenter,
322
+ },
323
+ };
324
+ page._loadButton(button);
325
+ // Place into grid by index (row-major).
326
+ const row = Math.floor(i / cols);
327
+ const col = i % cols;
328
+ if (row < rows && col < cols) {
329
+ gridLayout[row][col] = button;
330
+ }
331
+ });
332
+ page.grid = gridLayout;
333
+ tree.addPage(page);
334
+ }
335
+ return tree;
336
+ }
337
+ // ---- processTexts (asset-preserving round-trip) -------------------------
338
+ async processTexts(filePathOrBuffer, translations, outputPath) {
339
+ const { writeBinaryToPath } = this.options.fileAdapter;
340
+ const originalZip = await this.openZip(filePathOrBuffer);
341
+ // Parse PageData and apply translations in place.
342
+ const pageDataBytes = await originalZip.readFile('PageData.plist');
343
+ const pageDataText = typeof Buffer !== 'undefined' && Buffer.isBuffer(pageDataBytes)
344
+ ? pageDataBytes.toString('utf8')
345
+ : new TextDecoder().decode(pageDataBytes);
346
+ const pageData = plist_1.default.parse(pageDataText);
347
+ for (const pageId of Object.keys(pageData)) {
348
+ const rawPage = pageData[pageId];
349
+ if (!rawPage || !rawPage.Buttons)
350
+ continue;
351
+ for (const btnIndex of Object.keys(rawPage.Buttons)) {
352
+ const rawButton = rawPage.Buttons[btnIndex];
353
+ if (!rawButton)
354
+ continue;
355
+ // Translate the visible label.
356
+ if (rawButton.ButtonText && translations.has(rawButton.ButtonText)) {
357
+ rawButton.ButtonText = translations.get(rawButton.ButtonText);
358
+ }
359
+ // Translate the spoken text (only when explicitly set).
360
+ const actionData = rawButton.ActionData;
361
+ if (actionData && actionData.TTSText && translations.has(actionData.TTSText)) {
362
+ actionData.TTSText = translations.get(actionData.TTSText);
363
+ }
364
+ }
365
+ }
366
+ const rebuiltPageData = plist_1.default.build(pageData);
367
+ // Repack: copy every original entry verbatim, replacing only PageData.plist.
368
+ const outputZip = await this.options.zipAdapter(undefined, this.options.fileAdapter);
369
+ const files = [];
370
+ for (const name of originalZip.listFiles()) {
371
+ if (name === 'PageData.plist')
372
+ continue;
373
+ files.push({ name, data: await originalZip.readFile(name) });
374
+ }
375
+ files.push({ name: 'PageData.plist', data: rebuiltPageData });
376
+ const outputBuffer = await outputZip.writeFiles(files);
377
+ await writeBinaryToPath(outputPath, outputBuffer);
378
+ return outputBuffer;
379
+ }
380
+ // ---- saveFromTree (build from tree) -------------------------------------
381
+ async saveFromTree(tree, outputPath) {
382
+ const { writeBinaryToPath } = this.options.fileAdapter;
383
+ const pageData = {};
384
+ const pageOrder = [];
385
+ const imageFiles = [];
386
+ const pageIds = Object.keys(tree.pages);
387
+ pageIds.forEach((pageId, pageIdx) => {
388
+ const page = tree.pages[pageId];
389
+ const numericId = Number(pageId);
390
+ if (!Number.isNaN(numericId))
391
+ pageOrder.push(numericId);
392
+ const buttons = {};
393
+ const buttonList = page.buttons;
394
+ buttonList.forEach((btn, i) => {
395
+ const btnIndex = String(i);
396
+ const buttonType = btn.parameters?.__gotalkNow?.buttonType ||
397
+ (btn.targetPageId ? 'Jump' : 'TTS');
398
+ const actionData = {};
399
+ if (buttonType === 'Jump' && btn.targetPageId) {
400
+ actionData.JumpTo = Number(btn.targetPageId);
401
+ actionData.TTSText = '';
402
+ }
403
+ else if (buttonType === 'TTS') {
404
+ // Only store TTSText when it differs from the label (matches GoTalk's convention).
405
+ actionData.TTSText = btn.message && btn.message !== btn.label ? btn.message : '';
406
+ }
407
+ else {
408
+ actionData.TTSText = btn.message || '';
409
+ }
410
+ const rawButton = {
411
+ ActionData: actionData,
412
+ ButtonType: buttonType,
413
+ ButtonText: btn.label || '',
414
+ };
415
+ if (btn.resolvedImageEntry || btn.image) {
416
+ rawButton.ButtonImages = [
417
+ {
418
+ Location: btn.resolvedImageEntry || btn.image,
419
+ Type: 'Saved',
420
+ },
421
+ ];
422
+ }
423
+ buttons[btnIndex] = rawButton;
424
+ });
425
+ pageData[pageId] = {
426
+ ButtonCount: buttonList.length,
427
+ Buttons: buttons,
428
+ };
429
+ // Collect referenced images so we can include them in the archive.
430
+ buttonList.forEach((btn) => {
431
+ if (btn.resolvedImageEntry) {
432
+ // Image bytes are not available from the tree alone; skip if absent.
433
+ }
434
+ });
435
+ void pageIdx;
436
+ });
437
+ const bookInfo = {
438
+ GoTalkBookFormatVersion: Number(tree.metadata.version) || 1,
439
+ };
440
+ const zip = await this.options.zipAdapter(undefined, this.options.fileAdapter);
441
+ const files = [
442
+ { name: 'BookInfo.plist', data: plist_1.default.build(bookInfo) },
443
+ { name: 'PageData.plist', data: plist_1.default.build(pageData) },
444
+ {
445
+ name: 'PageOrder.plist',
446
+ data: plist_1.default.build(pageOrder),
447
+ },
448
+ { name: 'PageHistory.plist', data: plist_1.default.build([]) },
449
+ ...imageFiles,
450
+ ];
451
+ const outputBuffer = await zip.writeFiles(files);
452
+ await writeBinaryToPath(outputPath, outputBuffer);
453
+ }
454
+ /**
455
+ * Extract strings with metadata for aac-tools-platform compatibility.
456
+ * Uses the generic implementation from BaseProcessor.
457
+ */
458
+ extractStringsWithMetadata(filePath) {
459
+ return this.extractStringsWithMetadataGeneric(filePath);
460
+ }
461
+ /**
462
+ * Generate translated download for aac-tools-platform compatibility.
463
+ * Uses the generic implementation from BaseProcessor.
464
+ */
465
+ generateTranslatedDownload(filePath, translatedStrings, sourceStrings) {
466
+ return this.generateTranslatedDownloadGeneric(filePath, translatedStrings, sourceStrings);
467
+ }
468
+ }
469
+ exports.GotalkNowProcessor = GotalkNowProcessor;
@@ -16,3 +16,4 @@ export { SnapProcessor } from './snapProcessor';
16
16
  export { TouchChatProcessor } from './touchchatProcessor';
17
17
  export { AstericsGridProcessor } from './astericsGridProcessor';
18
18
  export { ObfsetProcessor } from './obfsetProcessor';
19
+ export { GotalkNowProcessor } from './gotalkNowProcessor';
@@ -8,7 +8,7 @@
8
8
  * - import { Snap } from 'aac-processors/snap';
9
9
  */
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.ObfsetProcessor = exports.AstericsGridProcessor = exports.TouchChatProcessor = exports.SnapProcessor = exports.OpmlProcessor = exports.ObfProcessor = exports.GridsetProcessor = exports.ExcelProcessor = exports.DotProcessor = exports.ApplePanelsProcessor = void 0;
11
+ exports.GotalkNowProcessor = exports.ObfsetProcessor = exports.AstericsGridProcessor = exports.TouchChatProcessor = exports.SnapProcessor = exports.OpmlProcessor = exports.ObfProcessor = exports.GridsetProcessor = exports.ExcelProcessor = exports.DotProcessor = exports.ApplePanelsProcessor = void 0;
12
12
  var applePanelsProcessor_1 = require("./applePanelsProcessor");
13
13
  Object.defineProperty(exports, "ApplePanelsProcessor", { enumerable: true, get: function () { return applePanelsProcessor_1.ApplePanelsProcessor; } });
14
14
  var dotProcessor_1 = require("./dotProcessor");
@@ -29,3 +29,5 @@ var astericsGridProcessor_1 = require("./astericsGridProcessor");
29
29
  Object.defineProperty(exports, "AstericsGridProcessor", { enumerable: true, get: function () { return astericsGridProcessor_1.AstericsGridProcessor; } });
30
30
  var obfsetProcessor_1 = require("./obfsetProcessor");
31
31
  Object.defineProperty(exports, "ObfsetProcessor", { enumerable: true, get: function () { return obfsetProcessor_1.ObfsetProcessor; } });
32
+ var gotalkNowProcessor_1 = require("./gotalkNowProcessor");
33
+ Object.defineProperty(exports, "GotalkNowProcessor", { enumerable: true, get: function () { return gotalkNowProcessor_1.GotalkNowProcessor; } });
@@ -691,7 +691,9 @@ class ObfProcessor extends baseProcessor_1.BaseProcessor {
691
691
  });
692
692
  const manifest = {
693
693
  format: OBF_FORMAT_VERSION,
694
- root: tree.metadata.defaultHomePageId,
694
+ root: tree.metadata.defaultHomePageId
695
+ ? this.getPageFilename(tree.metadata.defaultHomePageId, tree.metadata)
696
+ : undefined,
695
697
  paths: {
696
698
  boards: Object.fromEntries(Object.entries(tree.pages).map(([id, page]) => [
697
699
  id,
@@ -758,7 +760,9 @@ class ObfProcessor extends baseProcessor_1.BaseProcessor {
758
760
  if (Object.keys(tree.pages).length > 0) {
759
761
  const manifest = {
760
762
  format: OBF_FORMAT_VERSION,
761
- root: tree.metadata.defaultHomePageId,
763
+ root: tree.metadata.defaultHomePageId
764
+ ? this.getPageFilename(tree.metadata.defaultHomePageId, tree.metadata)
765
+ : undefined,
762
766
  paths: {
763
767
  boards: Object.fromEntries(Object.entries(tree.pages).map(([id, page]) => [
764
768
  id,
@@ -23,27 +23,20 @@ export declare class GridsetValidator extends BaseValidator {
23
23
  */
24
24
  private isZip;
25
25
  /**
26
- * Validate a single XML file (legacy or exploded format)
26
+ * Validate a single grid.xml file (exploded/non-zip format)
27
27
  */
28
28
  private validateSingleXml;
29
29
  /**
30
30
  * Validate a ZIP archive (.gridset)
31
+ *
32
+ * Real Grid 3 archives do NOT contain a top-level gridset.xml. The required
33
+ * structure is: Settings0/settings.xml + FileMap.xml + Grids/<name>/grid.xml
34
+ * (+ optional Styles, images, thumbnails).
31
35
  */
32
36
  private validateZipArchive;
33
37
  /**
34
- * Validate Gridset structure
38
+ * Validate a real Grid 3 <Grid> element (from grid.xml).
39
+ * Checks for GridGuid, Cells, and basic cell structure.
35
40
  */
36
- private validateGridsetStructure;
37
- /**
38
- * Validate a single page
39
- */
40
- private validatePage;
41
- /**
42
- * Validate a single cell
43
- */
44
- private validateCell;
45
- /**
46
- * Validate color format (Grid3 uses ARGB format)
47
- */
48
- private isValidGrid3Color;
41
+ private validateGridStructure;
49
42
  }