@willwade/aac-processors 0.0.14 → 0.0.16

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.
Files changed (53) hide show
  1. package/README.md +58 -10
  2. package/dist/applePanels.d.ts +6 -0
  3. package/dist/applePanels.js +13 -0
  4. package/dist/astericsGrid.d.ts +6 -0
  5. package/dist/astericsGrid.js +13 -0
  6. package/dist/core/treeStructure.d.ts +1 -0
  7. package/dist/dot.d.ts +6 -0
  8. package/dist/dot.js +13 -0
  9. package/dist/excel.d.ts +6 -0
  10. package/dist/excel.js +13 -0
  11. package/dist/gridset.d.ts +17 -0
  12. package/dist/gridset.js +130 -0
  13. package/dist/index.d.ts +23 -2
  14. package/dist/index.js +36 -7
  15. package/dist/obf.d.ts +7 -0
  16. package/dist/obf.js +15 -0
  17. package/dist/obfset.d.ts +6 -0
  18. package/dist/obfset.js +13 -0
  19. package/dist/opml.d.ts +6 -0
  20. package/dist/opml.js +13 -0
  21. package/dist/processors/gridset/commands.js +15 -0
  22. package/dist/processors/gridset/pluginTypes.js +4 -4
  23. package/dist/processors/gridsetProcessor.d.ts +4 -0
  24. package/dist/processors/gridsetProcessor.js +315 -47
  25. package/dist/processors/index.d.ts +8 -18
  26. package/dist/processors/index.js +9 -175
  27. package/dist/processors/snapProcessor.js +105 -9
  28. package/dist/processors/touchchatProcessor.js +33 -13
  29. package/dist/snap.d.ts +7 -0
  30. package/dist/snap.js +24 -0
  31. package/dist/touchchat.d.ts +7 -0
  32. package/dist/touchchat.js +16 -0
  33. package/dist/translation.d.ts +13 -0
  34. package/dist/translation.js +21 -0
  35. package/dist/types/aac.d.ts +13 -3
  36. package/dist/types/aac.js +6 -2
  37. package/dist/utilities/analytics/metrics/comparison.d.ts +1 -0
  38. package/dist/utilities/analytics/metrics/comparison.js +52 -24
  39. package/dist/utilities/analytics/metrics/core.d.ts +7 -2
  40. package/dist/utilities/analytics/metrics/core.js +327 -197
  41. package/dist/utilities/analytics/metrics/effort.d.ts +8 -3
  42. package/dist/utilities/analytics/metrics/effort.js +10 -5
  43. package/dist/utilities/analytics/metrics/sentence.js +17 -4
  44. package/dist/utilities/analytics/metrics/types.d.ts +39 -0
  45. package/dist/utilities/analytics/metrics/vocabulary.js +1 -1
  46. package/dist/utilities/analytics/reference/index.js +12 -1
  47. package/dist/utilities/translation/translationProcessor.d.ts +2 -1
  48. package/dist/utilities/translation/translationProcessor.js +5 -2
  49. package/dist/validation.d.ts +13 -0
  50. package/dist/validation.js +28 -0
  51. package/package.json +58 -4
  52. package/dist/utilities/screenshotConverter.d.ts +0 -69
  53. package/dist/utilities/screenshotConverter.js +0 -453
package/README.md CHANGED
@@ -56,7 +56,7 @@ npm run build
56
56
 
57
57
  ### Requirements
58
58
 
59
- - **Node.js** 16.0.0 or higher
59
+ - **Node.js** 20.0.0 or higher
60
60
  - **TypeScript** 5.5+ (for development)
61
61
 
62
62
  ---
@@ -94,7 +94,7 @@ This step is only required for Electron apps; regular Node.js consumers do not n
94
94
 
95
95
  ## 🔧 Quick Start
96
96
 
97
- ### Basic Usage (TypeScript/ES6)
97
+ ### Basic Usage (TypeScript)
98
98
 
99
99
  ```typescript
100
100
  import {
@@ -118,15 +118,20 @@ const aacTree = dotProcessor.loadIntoTree("examples/example.dot");
118
118
  console.log("Pages:", Object.keys(aacTree.pages).length);
119
119
  ```
120
120
 
121
- ### Basic Usage (CommonJS)
121
+ ### Platform Support
122
122
 
123
- ```javascript
124
- const { getProcessor, DotProcessor } = require("aac-processors");
123
+ **AACProcessors is designed for Node.js environments only.** It requires Node.js v20+ and cannot run in browsers due to:
125
124
 
126
- const processor = getProcessor("board.dot");
127
- const tree = processor.loadIntoTree("board.dot");
128
- console.log(tree);
129
- ```
125
+ - **File system access** - Required for reading/writing AAC files
126
+ - **Native SQLite** - Used by Snap, TouchChat, and Analytics features
127
+ - **Binary format processing** - ZIP, encrypted formats, etc.
128
+
129
+ **For browser-based AAC display**, consider these alternatives:
130
+ - **obf-renderer** - Display OBF/OBZ files in web apps
131
+ - **Arc Core** - Browser-based AAC communication
132
+ - **Cboard** - Web-based AAC display system
133
+
134
+ This library focuses on **server-side file processing**, not client-side rendering.
130
135
 
131
136
  ### Button Filtering System
132
137
 
@@ -194,6 +199,45 @@ const translatedBuffer = processor.processTexts(
194
199
  console.log("Translation complete!");
195
200
  ```
196
201
 
202
+ ### 🤖 LLM-Based Translation with Symbol Preservation
203
+
204
+ For advanced AI-powered translation that preserves symbol-to-word associations across languages, see the **[Translation Utilities Guide](./src/utilities/translation/README.md)**.
205
+
206
+ **Features:**
207
+ - 🧠 **Intelligent symbol mapping**: LLMs understand grammar, not just word position
208
+ - 🎯 **Cross-format support**: Works with Gridset, OBF/OBZ, TouchChat, and Snap
209
+ - 🔗 **Symbol preservation**: Symbols stay attached to correct translated words
210
+ - ✅ **Validated output**: Built-in validation catches translation errors
211
+
212
+ **Quick Demo:**
213
+ ```bash
214
+ # Translate a Grid 3 file to Spanish using Gemini 2.0 Flash
215
+ export GEMINI_API_KEY="your-key-here"
216
+ node scripts/translation/gemini-translate-gridset.js "./tmp/Voco Chat.gridset" Spanish
217
+ ```
218
+
219
+ **Complete Example:**
220
+ ```typescript
221
+ import { GridsetProcessor } from "@willwade/aac-processors";
222
+
223
+ const processor = new GridsetProcessor();
224
+
225
+ // 1. Extract buttons with symbol information
226
+ const buttons = processor.extractSymbolsForLLM("board.gridset");
227
+
228
+ // 2. Create LLM prompt (or call your LLM API directly)
229
+ // See: src/utilities/translation/README.md
230
+
231
+ // 3. Apply translations with preserved symbols
232
+ processor.processLLMTranslations(
233
+ "board.gridset",
234
+ llmTranslations,
235
+ "board-spanish.gridset"
236
+ );
237
+ ```
238
+
239
+ See **[scripts/translation/](./scripts/translation/)** for complete working examples with Gemini, GPT-4, and other LLMs.
240
+
197
241
  ### 📊 AAC Analytics & Clinical Metrics
198
242
 
199
243
  The library includes an optional high-performance analytics engine for evaluating AAC board sets based on the **AAC Effort Algorithm (v0.2)**.
@@ -205,7 +249,7 @@ The library includes an optional high-performance analytics engine for evaluatin
205
249
  - **Sentence Analysis**: Measure the effort required to construct common test sentences.
206
250
  - **Comparative Analysis**: Identify gaps and improvements between two pageset versions.
207
251
 
208
- For detailed documentation, see the **[AAC Metrics Guide](./src/optional/analytics/docs/AAC_METRICS_GUIDE.md)** and **[Vocabulary Analysis Guide](./src/optional/analytics/docs/VOCABULARY_ANALYSIS_GUIDE.md)**.
252
+ For detailed documentation, see the **[AAC Metrics Guide](./src/utilities/analytics/docs/AAC_METRICS_GUIDE.md)** and **[Vocabulary Analysis Guide](./src/utilities/analytics/docs/VOCABULARY_ANALYSIS_GUIDE.md)**.
209
253
 
210
254
  ```typescript
211
255
  import { ObfsetProcessor, Analytics } from "@willwade/aac-processors";
@@ -854,3 +898,7 @@ Inspired by the Python AACProcessors project
854
898
  ### Contributing
855
899
 
856
900
  Want to help with any of these items? See our [Contributing Guidelines](#-contributing) and pick an issue that interests you!
901
+
902
+ ### Credits
903
+
904
+ Some of the OBF work is directly from https://github.com/open-aac/obf and https://github.com/open-aac/aac-metrics - OBLA too https://www.openboardformat.org/logs
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Apple Panels (macOS) Namespace
3
+ *
4
+ * Apple Panels format processing for macOS AAC solutions.
5
+ */
6
+ export { ApplePanelsProcessor } from './processors/applePanelsProcessor';
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ /**
3
+ * Apple Panels (macOS) Namespace
4
+ *
5
+ * Apple Panels format processing for macOS AAC solutions.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ApplePanelsProcessor = void 0;
9
+ // Processor class
10
+ var applePanelsProcessor_1 = require("./processors/applePanelsProcessor");
11
+ Object.defineProperty(exports, "ApplePanelsProcessor", { enumerable: true, get: function () { return applePanelsProcessor_1.ApplePanelsProcessor; } });
12
+ // Note: Apple Panels doesn't currently have platform-specific helpers
13
+ // Future helper functions can be added here
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Asterics Grid Namespace
3
+ *
4
+ * Asterics Grid format processing for Asterics AAC solutions.
5
+ */
6
+ export { AstericsGridProcessor } from './processors/astericsGridProcessor';
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ /**
3
+ * Asterics Grid Namespace
4
+ *
5
+ * Asterics Grid format processing for Asterics AAC solutions.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.AstericsGridProcessor = void 0;
9
+ // Processor class
10
+ var astericsGridProcessor_1 = require("./processors/astericsGridProcessor");
11
+ Object.defineProperty(exports, "AstericsGridProcessor", { enumerable: true, get: function () { return astericsGridProcessor_1.AstericsGridProcessor; } });
12
+ // Note: Asterics Grid doesn't currently have platform-specific helpers
13
+ // Future helper functions can be added here
@@ -86,6 +86,7 @@ export interface AACSemanticAction {
86
86
  touchChat?: {
87
87
  actionCode: number;
88
88
  actionData: string;
89
+ resourceId?: number;
89
90
  };
90
91
  snap?: {
91
92
  navigatePageId?: number;
package/dist/dot.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Dot (Graphviz) Namespace
3
+ *
4
+ * DOT format processing for graph-based communication boards.
5
+ */
6
+ export { DotProcessor } from './processors/dotProcessor';
package/dist/dot.js ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ /**
3
+ * Dot (Graphviz) Namespace
4
+ *
5
+ * DOT format processing for graph-based communication boards.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.DotProcessor = void 0;
9
+ // Processor class
10
+ var dotProcessor_1 = require("./processors/dotProcessor");
11
+ Object.defineProperty(exports, "DotProcessor", { enumerable: true, get: function () { return dotProcessor_1.DotProcessor; } });
12
+ // Note: DOT doesn't currently have platform-specific helpers
13
+ // Future helper functions can be added here
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Excel Namespace
3
+ *
4
+ * Excel export format for vocabulary analysis and reporting.
5
+ */
6
+ export { ExcelProcessor } from './processors/excelProcessor';
package/dist/excel.js ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ /**
3
+ * Excel Namespace
4
+ *
5
+ * Excel export format for vocabulary analysis and reporting.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ExcelProcessor = void 0;
9
+ // Processor class
10
+ var excelProcessor_1 = require("./processors/excelProcessor");
11
+ Object.defineProperty(exports, "ExcelProcessor", { enumerable: true, get: function () { return excelProcessor_1.ExcelProcessor; } });
12
+ // Note: Excel doesn't currently have platform-specific helpers
13
+ // Future helper functions can be added here
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Gridset (Grid 3) Namespace
3
+ *
4
+ * All Grid 3 / Gridset-specific utilities, helpers, and types.
5
+ * Organized by category for cleaner imports.
6
+ */
7
+ export { GridsetProcessor } from './processors/gridsetProcessor';
8
+ export { getPageTokenImageMap, getAllowedImageEntries, openImage, getCommonDocumentsPath, findGrid3UserPaths, findGrid3HistoryDatabases, findGrid3Users, findGrid3Vocabularies, findGrid3UserHistory, isGrid3Installed, readGrid3History, readGrid3HistoryForUser, readAllGrid3History, generateGrid3Guid, createSettingsXml, createFileMapXml, type Grid3UserPath, type Grid3VocabularyPath, type Grid3HistoryEntry, } from './processors/gridset/helpers';
9
+ export { createWordlist, extractWordlists, updateWordlist, wordlistToXml, type WordList, type WordListItem, } from './processors/gridset/wordlistHelpers';
10
+ export { getNamedColor, rgbaToHex, channelToHex, clampColorChannel, clampAlpha, toHexColor, darkenColor, normalizeColor, ensureAlphaChannel, } from './processors/gridset/colorUtils';
11
+ export { DEFAULT_GRID3_STYLES, CATEGORY_STYLES, createDefaultStylesXml, createCategoryStyle, CellBackgroundShape, SHAPE_NAMES, ensureAlphaChannel as ensureAlphaChannelFromStyles, } from './processors/gridset/styleHelpers';
12
+ export { detectPluginCellType, getCellTypeDisplayName, isWorkspaceCell, isLiveCell, isAutoContentCell, isRegularCell, type Grid3PluginMetadata, Grid3CellType, WORKSPACE_TYPES, LIVECELL_TYPES, AUTOCONTENT_TYPES, } from './processors/gridset/pluginTypes';
13
+ export { detectCommand, getCommandDefinition, getCommandsByPlugin, getCommandsByCategory, getAllCommandIds, getAllPluginIds, extractCommandParameters, GRID3_COMMANDS, type Grid3CommandDefinition, type CommandParameter, type ExtractedParameters, Grid3CommandCategory, } from './processors/gridset/commands';
14
+ export { parseSymbolReference, isSymbolReference, resolveSymbolReference, getAvailableSymbolLibraries, getSymbolLibraryInfo, extractSymbolReferences, analyzeSymbolUsage, createSymbolReference, getSymbolLibraryName, getSymbolPath, isKnownSymbolLibrary, getSymbolLibraryDisplayName, getDefaultGrid3Path, getSymbolLibrariesDir, getSymbolSearchIndexesDir, symbolReferenceToFilename, SYMBOL_LIBRARIES, isSymbolLibraryReference, parseImageSymbolReference, resolveGrid3CellImage, getSymbolsDir, getSymbolSearchDir, } from './processors/gridset/index';
15
+ export { extractButtonImage, extractSymbolLibraryImage, convertToAstericsImage, analyzeSymbolExtraction, suggestExtractionStrategy, exportSymbolReferencesToCsv, createSymbolManifest, } from './processors/gridset/symbolExtractor';
16
+ export { parsePixFile, loadSearchIndexes, searchSymbols, searchSymbolsWithReferences, getSymbolFilename, getSymbolDisplayName, getAllSearchTerms, getSearchSuggestions, countLibrarySymbols, getSymbolSearchStats, } from './processors/gridset/symbolSearch';
17
+ export { resolveGridsetPassword, resolveGridsetPasswordFromEnv, } from './processors/gridset/password';
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ /**
3
+ * Gridset (Grid 3) Namespace
4
+ *
5
+ * All Grid 3 / Gridset-specific utilities, helpers, and types.
6
+ * Organized by category for cleaner imports.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.getCommandsByPlugin = exports.getCommandDefinition = exports.detectCommand = exports.AUTOCONTENT_TYPES = exports.LIVECELL_TYPES = exports.WORKSPACE_TYPES = exports.Grid3CellType = exports.isRegularCell = exports.isAutoContentCell = exports.isLiveCell = exports.isWorkspaceCell = exports.getCellTypeDisplayName = exports.detectPluginCellType = exports.ensureAlphaChannelFromStyles = exports.SHAPE_NAMES = exports.CellBackgroundShape = exports.createCategoryStyle = exports.createDefaultStylesXml = exports.CATEGORY_STYLES = exports.DEFAULT_GRID3_STYLES = exports.ensureAlphaChannel = exports.normalizeColor = exports.darkenColor = exports.toHexColor = exports.clampAlpha = exports.clampColorChannel = exports.channelToHex = exports.rgbaToHex = exports.getNamedColor = exports.wordlistToXml = exports.updateWordlist = exports.extractWordlists = exports.createWordlist = exports.createFileMapXml = exports.createSettingsXml = exports.generateGrid3Guid = exports.readAllGrid3History = exports.readGrid3HistoryForUser = exports.readGrid3History = exports.isGrid3Installed = exports.findGrid3UserHistory = exports.findGrid3Vocabularies = exports.findGrid3Users = exports.findGrid3HistoryDatabases = exports.findGrid3UserPaths = exports.getCommonDocumentsPath = exports.openImage = exports.getAllowedImageEntries = exports.getPageTokenImageMap = exports.GridsetProcessor = void 0;
10
+ exports.resolveGridsetPasswordFromEnv = exports.resolveGridsetPassword = exports.getSymbolSearchStats = exports.countLibrarySymbols = exports.getSearchSuggestions = exports.getAllSearchTerms = exports.getSymbolDisplayName = exports.getSymbolFilename = exports.searchSymbolsWithReferences = exports.searchSymbols = exports.loadSearchIndexes = exports.parsePixFile = exports.createSymbolManifest = exports.exportSymbolReferencesToCsv = exports.suggestExtractionStrategy = exports.analyzeSymbolExtraction = exports.convertToAstericsImage = exports.extractSymbolLibraryImage = exports.extractButtonImage = exports.getSymbolSearchDir = exports.getSymbolsDir = exports.resolveGrid3CellImage = exports.parseImageSymbolReference = exports.isSymbolLibraryReference = exports.SYMBOL_LIBRARIES = exports.symbolReferenceToFilename = exports.getSymbolSearchIndexesDir = exports.getSymbolLibrariesDir = exports.getDefaultGrid3Path = exports.getSymbolLibraryDisplayName = exports.isKnownSymbolLibrary = exports.getSymbolPath = exports.getSymbolLibraryName = exports.createSymbolReference = exports.analyzeSymbolUsage = exports.extractSymbolReferences = exports.getSymbolLibraryInfo = exports.getAvailableSymbolLibraries = exports.resolveSymbolReference = exports.isSymbolReference = exports.parseSymbolReference = exports.Grid3CommandCategory = exports.GRID3_COMMANDS = exports.extractCommandParameters = exports.getAllPluginIds = exports.getAllCommandIds = exports.getCommandsByCategory = void 0;
11
+ // Processor class
12
+ var gridsetProcessor_1 = require("./processors/gridsetProcessor");
13
+ Object.defineProperty(exports, "GridsetProcessor", { enumerable: true, get: function () { return gridsetProcessor_1.GridsetProcessor; } });
14
+ // === User & File System Helpers ===
15
+ var helpers_1 = require("./processors/gridset/helpers");
16
+ Object.defineProperty(exports, "getPageTokenImageMap", { enumerable: true, get: function () { return helpers_1.getPageTokenImageMap; } });
17
+ Object.defineProperty(exports, "getAllowedImageEntries", { enumerable: true, get: function () { return helpers_1.getAllowedImageEntries; } });
18
+ Object.defineProperty(exports, "openImage", { enumerable: true, get: function () { return helpers_1.openImage; } });
19
+ Object.defineProperty(exports, "getCommonDocumentsPath", { enumerable: true, get: function () { return helpers_1.getCommonDocumentsPath; } });
20
+ Object.defineProperty(exports, "findGrid3UserPaths", { enumerable: true, get: function () { return helpers_1.findGrid3UserPaths; } });
21
+ Object.defineProperty(exports, "findGrid3HistoryDatabases", { enumerable: true, get: function () { return helpers_1.findGrid3HistoryDatabases; } });
22
+ Object.defineProperty(exports, "findGrid3Users", { enumerable: true, get: function () { return helpers_1.findGrid3Users; } });
23
+ Object.defineProperty(exports, "findGrid3Vocabularies", { enumerable: true, get: function () { return helpers_1.findGrid3Vocabularies; } });
24
+ Object.defineProperty(exports, "findGrid3UserHistory", { enumerable: true, get: function () { return helpers_1.findGrid3UserHistory; } });
25
+ Object.defineProperty(exports, "isGrid3Installed", { enumerable: true, get: function () { return helpers_1.isGrid3Installed; } });
26
+ Object.defineProperty(exports, "readGrid3History", { enumerable: true, get: function () { return helpers_1.readGrid3History; } });
27
+ Object.defineProperty(exports, "readGrid3HistoryForUser", { enumerable: true, get: function () { return helpers_1.readGrid3HistoryForUser; } });
28
+ Object.defineProperty(exports, "readAllGrid3History", { enumerable: true, get: function () { return helpers_1.readAllGrid3History; } });
29
+ Object.defineProperty(exports, "generateGrid3Guid", { enumerable: true, get: function () { return helpers_1.generateGrid3Guid; } });
30
+ Object.defineProperty(exports, "createSettingsXml", { enumerable: true, get: function () { return helpers_1.createSettingsXml; } });
31
+ Object.defineProperty(exports, "createFileMapXml", { enumerable: true, get: function () { return helpers_1.createFileMapXml; } });
32
+ // === Wordlist Management ===
33
+ var wordlistHelpers_1 = require("./processors/gridset/wordlistHelpers");
34
+ Object.defineProperty(exports, "createWordlist", { enumerable: true, get: function () { return wordlistHelpers_1.createWordlist; } });
35
+ Object.defineProperty(exports, "extractWordlists", { enumerable: true, get: function () { return wordlistHelpers_1.extractWordlists; } });
36
+ Object.defineProperty(exports, "updateWordlist", { enumerable: true, get: function () { return wordlistHelpers_1.updateWordlist; } });
37
+ Object.defineProperty(exports, "wordlistToXml", { enumerable: true, get: function () { return wordlistHelpers_1.wordlistToXml; } });
38
+ // === Color Utilities ===
39
+ var colorUtils_1 = require("./processors/gridset/colorUtils");
40
+ Object.defineProperty(exports, "getNamedColor", { enumerable: true, get: function () { return colorUtils_1.getNamedColor; } });
41
+ Object.defineProperty(exports, "rgbaToHex", { enumerable: true, get: function () { return colorUtils_1.rgbaToHex; } });
42
+ Object.defineProperty(exports, "channelToHex", { enumerable: true, get: function () { return colorUtils_1.channelToHex; } });
43
+ Object.defineProperty(exports, "clampColorChannel", { enumerable: true, get: function () { return colorUtils_1.clampColorChannel; } });
44
+ Object.defineProperty(exports, "clampAlpha", { enumerable: true, get: function () { return colorUtils_1.clampAlpha; } });
45
+ Object.defineProperty(exports, "toHexColor", { enumerable: true, get: function () { return colorUtils_1.toHexColor; } });
46
+ Object.defineProperty(exports, "darkenColor", { enumerable: true, get: function () { return colorUtils_1.darkenColor; } });
47
+ Object.defineProperty(exports, "normalizeColor", { enumerable: true, get: function () { return colorUtils_1.normalizeColor; } });
48
+ Object.defineProperty(exports, "ensureAlphaChannel", { enumerable: true, get: function () { return colorUtils_1.ensureAlphaChannel; } });
49
+ // === Style Helpers ===
50
+ var styleHelpers_1 = require("./processors/gridset/styleHelpers");
51
+ Object.defineProperty(exports, "DEFAULT_GRID3_STYLES", { enumerable: true, get: function () { return styleHelpers_1.DEFAULT_GRID3_STYLES; } });
52
+ Object.defineProperty(exports, "CATEGORY_STYLES", { enumerable: true, get: function () { return styleHelpers_1.CATEGORY_STYLES; } });
53
+ Object.defineProperty(exports, "createDefaultStylesXml", { enumerable: true, get: function () { return styleHelpers_1.createDefaultStylesXml; } });
54
+ Object.defineProperty(exports, "createCategoryStyle", { enumerable: true, get: function () { return styleHelpers_1.createCategoryStyle; } });
55
+ Object.defineProperty(exports, "CellBackgroundShape", { enumerable: true, get: function () { return styleHelpers_1.CellBackgroundShape; } });
56
+ Object.defineProperty(exports, "SHAPE_NAMES", { enumerable: true, get: function () { return styleHelpers_1.SHAPE_NAMES; } });
57
+ Object.defineProperty(exports, "ensureAlphaChannelFromStyles", { enumerable: true, get: function () { return styleHelpers_1.ensureAlphaChannel; } });
58
+ // === Plugin & Workspace Detection ===
59
+ var pluginTypes_1 = require("./processors/gridset/pluginTypes");
60
+ Object.defineProperty(exports, "detectPluginCellType", { enumerable: true, get: function () { return pluginTypes_1.detectPluginCellType; } });
61
+ Object.defineProperty(exports, "getCellTypeDisplayName", { enumerable: true, get: function () { return pluginTypes_1.getCellTypeDisplayName; } });
62
+ Object.defineProperty(exports, "isWorkspaceCell", { enumerable: true, get: function () { return pluginTypes_1.isWorkspaceCell; } });
63
+ Object.defineProperty(exports, "isLiveCell", { enumerable: true, get: function () { return pluginTypes_1.isLiveCell; } });
64
+ Object.defineProperty(exports, "isAutoContentCell", { enumerable: true, get: function () { return pluginTypes_1.isAutoContentCell; } });
65
+ Object.defineProperty(exports, "isRegularCell", { enumerable: true, get: function () { return pluginTypes_1.isRegularCell; } });
66
+ Object.defineProperty(exports, "Grid3CellType", { enumerable: true, get: function () { return pluginTypes_1.Grid3CellType; } });
67
+ Object.defineProperty(exports, "WORKSPACE_TYPES", { enumerable: true, get: function () { return pluginTypes_1.WORKSPACE_TYPES; } });
68
+ Object.defineProperty(exports, "LIVECELL_TYPES", { enumerable: true, get: function () { return pluginTypes_1.LIVECELL_TYPES; } });
69
+ Object.defineProperty(exports, "AUTOCONTENT_TYPES", { enumerable: true, get: function () { return pluginTypes_1.AUTOCONTENT_TYPES; } });
70
+ // === Command Detection ===
71
+ var commands_1 = require("./processors/gridset/commands");
72
+ Object.defineProperty(exports, "detectCommand", { enumerable: true, get: function () { return commands_1.detectCommand; } });
73
+ Object.defineProperty(exports, "getCommandDefinition", { enumerable: true, get: function () { return commands_1.getCommandDefinition; } });
74
+ Object.defineProperty(exports, "getCommandsByPlugin", { enumerable: true, get: function () { return commands_1.getCommandsByPlugin; } });
75
+ Object.defineProperty(exports, "getCommandsByCategory", { enumerable: true, get: function () { return commands_1.getCommandsByCategory; } });
76
+ Object.defineProperty(exports, "getAllCommandIds", { enumerable: true, get: function () { return commands_1.getAllCommandIds; } });
77
+ Object.defineProperty(exports, "getAllPluginIds", { enumerable: true, get: function () { return commands_1.getAllPluginIds; } });
78
+ Object.defineProperty(exports, "extractCommandParameters", { enumerable: true, get: function () { return commands_1.extractCommandParameters; } });
79
+ Object.defineProperty(exports, "GRID3_COMMANDS", { enumerable: true, get: function () { return commands_1.GRID3_COMMANDS; } });
80
+ Object.defineProperty(exports, "Grid3CommandCategory", { enumerable: true, get: function () { return commands_1.Grid3CommandCategory; } });
81
+ // === Symbol Libraries ===
82
+ var index_1 = require("./processors/gridset/index");
83
+ Object.defineProperty(exports, "parseSymbolReference", { enumerable: true, get: function () { return index_1.parseSymbolReference; } });
84
+ Object.defineProperty(exports, "isSymbolReference", { enumerable: true, get: function () { return index_1.isSymbolReference; } });
85
+ Object.defineProperty(exports, "resolveSymbolReference", { enumerable: true, get: function () { return index_1.resolveSymbolReference; } });
86
+ Object.defineProperty(exports, "getAvailableSymbolLibraries", { enumerable: true, get: function () { return index_1.getAvailableSymbolLibraries; } });
87
+ Object.defineProperty(exports, "getSymbolLibraryInfo", { enumerable: true, get: function () { return index_1.getSymbolLibraryInfo; } });
88
+ Object.defineProperty(exports, "extractSymbolReferences", { enumerable: true, get: function () { return index_1.extractSymbolReferences; } });
89
+ Object.defineProperty(exports, "analyzeSymbolUsage", { enumerable: true, get: function () { return index_1.analyzeSymbolUsage; } });
90
+ Object.defineProperty(exports, "createSymbolReference", { enumerable: true, get: function () { return index_1.createSymbolReference; } });
91
+ Object.defineProperty(exports, "getSymbolLibraryName", { enumerable: true, get: function () { return index_1.getSymbolLibraryName; } });
92
+ Object.defineProperty(exports, "getSymbolPath", { enumerable: true, get: function () { return index_1.getSymbolPath; } });
93
+ Object.defineProperty(exports, "isKnownSymbolLibrary", { enumerable: true, get: function () { return index_1.isKnownSymbolLibrary; } });
94
+ Object.defineProperty(exports, "getSymbolLibraryDisplayName", { enumerable: true, get: function () { return index_1.getSymbolLibraryDisplayName; } });
95
+ Object.defineProperty(exports, "getDefaultGrid3Path", { enumerable: true, get: function () { return index_1.getDefaultGrid3Path; } });
96
+ Object.defineProperty(exports, "getSymbolLibrariesDir", { enumerable: true, get: function () { return index_1.getSymbolLibrariesDir; } });
97
+ Object.defineProperty(exports, "getSymbolSearchIndexesDir", { enumerable: true, get: function () { return index_1.getSymbolSearchIndexesDir; } });
98
+ Object.defineProperty(exports, "symbolReferenceToFilename", { enumerable: true, get: function () { return index_1.symbolReferenceToFilename; } });
99
+ Object.defineProperty(exports, "SYMBOL_LIBRARIES", { enumerable: true, get: function () { return index_1.SYMBOL_LIBRARIES; } });
100
+ Object.defineProperty(exports, "isSymbolLibraryReference", { enumerable: true, get: function () { return index_1.isSymbolLibraryReference; } });
101
+ Object.defineProperty(exports, "parseImageSymbolReference", { enumerable: true, get: function () { return index_1.parseImageSymbolReference; } });
102
+ Object.defineProperty(exports, "resolveGrid3CellImage", { enumerable: true, get: function () { return index_1.resolveGrid3CellImage; } });
103
+ // Backward compatibility
104
+ Object.defineProperty(exports, "getSymbolsDir", { enumerable: true, get: function () { return index_1.getSymbolsDir; } });
105
+ Object.defineProperty(exports, "getSymbolSearchDir", { enumerable: true, get: function () { return index_1.getSymbolSearchDir; } });
106
+ // === Symbol Extraction ===
107
+ var symbolExtractor_1 = require("./processors/gridset/symbolExtractor");
108
+ Object.defineProperty(exports, "extractButtonImage", { enumerable: true, get: function () { return symbolExtractor_1.extractButtonImage; } });
109
+ Object.defineProperty(exports, "extractSymbolLibraryImage", { enumerable: true, get: function () { return symbolExtractor_1.extractSymbolLibraryImage; } });
110
+ Object.defineProperty(exports, "convertToAstericsImage", { enumerable: true, get: function () { return symbolExtractor_1.convertToAstericsImage; } });
111
+ Object.defineProperty(exports, "analyzeSymbolExtraction", { enumerable: true, get: function () { return symbolExtractor_1.analyzeSymbolExtraction; } });
112
+ Object.defineProperty(exports, "suggestExtractionStrategy", { enumerable: true, get: function () { return symbolExtractor_1.suggestExtractionStrategy; } });
113
+ Object.defineProperty(exports, "exportSymbolReferencesToCsv", { enumerable: true, get: function () { return symbolExtractor_1.exportSymbolReferencesToCsv; } });
114
+ Object.defineProperty(exports, "createSymbolManifest", { enumerable: true, get: function () { return symbolExtractor_1.createSymbolManifest; } });
115
+ // === Symbol Search ===
116
+ var symbolSearch_1 = require("./processors/gridset/symbolSearch");
117
+ Object.defineProperty(exports, "parsePixFile", { enumerable: true, get: function () { return symbolSearch_1.parsePixFile; } });
118
+ Object.defineProperty(exports, "loadSearchIndexes", { enumerable: true, get: function () { return symbolSearch_1.loadSearchIndexes; } });
119
+ Object.defineProperty(exports, "searchSymbols", { enumerable: true, get: function () { return symbolSearch_1.searchSymbols; } });
120
+ Object.defineProperty(exports, "searchSymbolsWithReferences", { enumerable: true, get: function () { return symbolSearch_1.searchSymbolsWithReferences; } });
121
+ Object.defineProperty(exports, "getSymbolFilename", { enumerable: true, get: function () { return symbolSearch_1.getSymbolFilename; } });
122
+ Object.defineProperty(exports, "getSymbolDisplayName", { enumerable: true, get: function () { return symbolSearch_1.getSymbolDisplayName; } });
123
+ Object.defineProperty(exports, "getAllSearchTerms", { enumerable: true, get: function () { return symbolSearch_1.getAllSearchTerms; } });
124
+ Object.defineProperty(exports, "getSearchSuggestions", { enumerable: true, get: function () { return symbolSearch_1.getSearchSuggestions; } });
125
+ Object.defineProperty(exports, "countLibrarySymbols", { enumerable: true, get: function () { return symbolSearch_1.countLibrarySymbols; } });
126
+ Object.defineProperty(exports, "getSymbolSearchStats", { enumerable: true, get: function () { return symbolSearch_1.getSymbolSearchStats; } });
127
+ // === Password Management ===
128
+ var password_1 = require("./processors/gridset/password");
129
+ Object.defineProperty(exports, "resolveGridsetPassword", { enumerable: true, get: function () { return password_1.resolveGridsetPassword; } });
130
+ Object.defineProperty(exports, "resolveGridsetPasswordFromEnv", { enumerable: true, get: function () { return password_1.resolveGridsetPasswordFromEnv; } });
package/dist/index.d.ts CHANGED
@@ -1,16 +1,37 @@
1
+ /**
2
+ * AACProcessors Library
3
+ *
4
+ * A comprehensive TypeScript library for processing AAC file formats.
5
+ *
6
+ * @module aac-processors
7
+ */
1
8
  export * from './core/treeStructure';
2
9
  export * from './core/baseProcessor';
3
10
  export * from './core/stringCasing';
4
11
  export * from './processors';
5
- export * from './validation';
6
12
  export * as Analytics from './utilities/analytics';
7
- export { collectUnifiedHistory, listGrid3Users as listHistoryGrid3Users, listSnapUsers as listHistorySnapUsers, } from './utilities/analytics/history';
13
+ export * as Validation from './validation';
14
+ export * as Gridset from './gridset';
15
+ export * as Snap from './snap';
16
+ export * as OBF from './obf';
17
+ export * as Obfset from './obfset';
18
+ export * as TouchChat from './touchchat';
19
+ export * as Dot from './dot';
20
+ export * as Excel from './excel';
21
+ export * as Opml from './opml';
22
+ export * as ApplePanels from './applePanels';
23
+ export * as AstericsGrid from './astericsGrid';
24
+ export * as Translation from './translation';
8
25
  import { BaseProcessor } from './core/baseProcessor';
9
26
  /**
10
27
  * Factory function to get the appropriate processor for a file extension
11
28
  * @param filePathOrExtension - File path or extension (e.g., '.dot', '/path/to/file.obf')
12
29
  * @returns The appropriate processor instance
13
30
  * @throws Error if the file extension is not supported
31
+ *
32
+ * @example
33
+ * const processor = getProcessor('/path/to/file.gridset');
34
+ * const tree = processor.loadIntoTree('/path/to/file.gridset');
14
35
  */
15
36
  export declare function getProcessor(filePathOrExtension: string): BaseProcessor;
16
37
  /**
package/dist/index.js CHANGED
@@ -1,4 +1,11 @@
1
1
  "use strict";
2
+ /**
3
+ * AACProcessors Library
4
+ *
5
+ * A comprehensive TypeScript library for processing AAC file formats.
6
+ *
7
+ * @module aac-processors
8
+ */
2
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
10
  if (k2 === undefined) k2 = k;
4
11
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -26,21 +33,39 @@ var __importStar = (this && this.__importStar) || function (mod) {
26
33
  return result;
27
34
  };
28
35
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.listHistorySnapUsers = exports.listHistoryGrid3Users = exports.collectUnifiedHistory = exports.Analytics = void 0;
36
+ exports.Translation = exports.AstericsGrid = exports.ApplePanels = exports.Opml = exports.Excel = exports.Dot = exports.TouchChat = exports.Obfset = exports.OBF = exports.Snap = exports.Gridset = exports.Validation = exports.Analytics = void 0;
30
37
  exports.getProcessor = getProcessor;
31
38
  exports.getSupportedExtensions = getSupportedExtensions;
32
39
  exports.isExtensionSupported = isExtensionSupported;
33
- // Main entry point for AACProcessors library
40
+ // ===================================================================
41
+ // CORE TYPES (always needed)
42
+ // ===================================================================
34
43
  __exportStar(require("./core/treeStructure"), exports);
35
44
  __exportStar(require("./core/baseProcessor"), exports);
36
45
  __exportStar(require("./core/stringCasing"), exports);
46
+ // ===================================================================
47
+ // PROCESSORS (main functionality)
48
+ // ===================================================================
37
49
  __exportStar(require("./processors"), exports);
38
- __exportStar(require("./validation"), exports);
50
+ // ===================================================================
51
+ // NAMESPACES
52
+ // ===================================================================
53
+ // Analytics namespace
39
54
  exports.Analytics = __importStar(require("./utilities/analytics"));
40
- var history_1 = require("./utilities/analytics/history");
41
- Object.defineProperty(exports, "collectUnifiedHistory", { enumerable: true, get: function () { return history_1.collectUnifiedHistory; } });
42
- Object.defineProperty(exports, "listHistoryGrid3Users", { enumerable: true, get: function () { return history_1.listGrid3Users; } });
43
- Object.defineProperty(exports, "listHistorySnapUsers", { enumerable: true, get: function () { return history_1.listSnapUsers; } });
55
+ // Validation namespace
56
+ exports.Validation = __importStar(require("./validation"));
57
+ // Processor namespaces (platform-specific utilities)
58
+ exports.Gridset = __importStar(require("./gridset"));
59
+ exports.Snap = __importStar(require("./snap"));
60
+ exports.OBF = __importStar(require("./obf"));
61
+ exports.Obfset = __importStar(require("./obfset"));
62
+ exports.TouchChat = __importStar(require("./touchchat"));
63
+ exports.Dot = __importStar(require("./dot"));
64
+ exports.Excel = __importStar(require("./excel"));
65
+ exports.Opml = __importStar(require("./opml"));
66
+ exports.ApplePanels = __importStar(require("./applePanels"));
67
+ exports.AstericsGrid = __importStar(require("./astericsGrid"));
68
+ exports.Translation = __importStar(require("./translation"));
44
69
  const dotProcessor_1 = require("./processors/dotProcessor");
45
70
  const excelProcessor_1 = require("./processors/excelProcessor");
46
71
  const opmlProcessor_1 = require("./processors/opmlProcessor");
@@ -56,6 +81,10 @@ const obfsetProcessor_1 = require("./processors/obfsetProcessor");
56
81
  * @param filePathOrExtension - File path or extension (e.g., '.dot', '/path/to/file.obf')
57
82
  * @returns The appropriate processor instance
58
83
  * @throws Error if the file extension is not supported
84
+ *
85
+ * @example
86
+ * const processor = getProcessor('/path/to/file.gridset');
87
+ * const tree = processor.loadIntoTree('/path/to/file.gridset');
59
88
  */
60
89
  function getProcessor(filePathOrExtension) {
61
90
  // Extract extension from file path
package/dist/obf.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ /**
2
+ * OBF (Open Board Format) Namespace
3
+ *
4
+ * All OBF/OBZ-specific utilities, helpers, and types.
5
+ */
6
+ export { ObfProcessor } from './processors/obfProcessor';
7
+ export { ObfsetProcessor } from './processors/obfsetProcessor';
package/dist/obf.js ADDED
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /**
3
+ * OBF (Open Board Format) Namespace
4
+ *
5
+ * All OBF/OBZ-specific utilities, helpers, and types.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ObfsetProcessor = exports.ObfProcessor = void 0;
9
+ // Processor class
10
+ var obfProcessor_1 = require("./processors/obfProcessor");
11
+ Object.defineProperty(exports, "ObfProcessor", { enumerable: true, get: function () { return obfProcessor_1.ObfProcessor; } });
12
+ var obfsetProcessor_1 = require("./processors/obfsetProcessor");
13
+ Object.defineProperty(exports, "ObfsetProcessor", { enumerable: true, get: function () { return obfsetProcessor_1.ObfsetProcessor; } });
14
+ // Note: OBF doesn't currently have platform-specific helpers like Gridset/Snap
15
+ // Future helper functions can be added here
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Obfset Namespace
3
+ *
4
+ * OBF Set (multiple OBF files) processing.
5
+ */
6
+ export { ObfsetProcessor } from './processors/obfsetProcessor';
package/dist/obfset.js ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ /**
3
+ * Obfset Namespace
4
+ *
5
+ * OBF Set (multiple OBF files) processing.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ObfsetProcessor = void 0;
9
+ // Processor class
10
+ var obfsetProcessor_1 = require("./processors/obfsetProcessor");
11
+ Object.defineProperty(exports, "ObfsetProcessor", { enumerable: true, get: function () { return obfsetProcessor_1.ObfsetProcessor; } });
12
+ // Note: Obfset doesn't currently have platform-specific helpers
13
+ // Future helper functions can be added here
package/dist/opml.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ /**
2
+ * OPML (Outline Processor Markup Language) Namespace
3
+ *
4
+ * OPML format processing for hierarchical communication boards.
5
+ */
6
+ export { OpmlProcessor } from './processors/opmlProcessor';
package/dist/opml.js ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ /**
3
+ * OPML (Outline Processor Markup Language) Namespace
4
+ *
5
+ * OPML format processing for hierarchical communication boards.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.OpmlProcessor = void 0;
9
+ // Processor class
10
+ var opmlProcessor_1 = require("./processors/opmlProcessor");
11
+ Object.defineProperty(exports, "OpmlProcessor", { enumerable: true, get: function () { return opmlProcessor_1.OpmlProcessor; } });
12
+ // Note: OPML doesn't currently have platform-specific helpers
13
+ // Future helper functions can be added here
@@ -699,6 +699,21 @@ exports.GRID3_COMMANDS = {
699
699
  description: 'Clear word prediction buffer',
700
700
  platforms: ['desktop', 'ios', 'medicare', 'medicareBionics'],
701
701
  },
702
+ 'Prediction.PredictThis': {
703
+ id: 'Prediction.PredictThis',
704
+ category: Grid3CommandCategory.AUTO_CONTENT,
705
+ pluginId: 'prediction',
706
+ displayName: 'Predict This',
707
+ description: 'Provide suggestions based on word list',
708
+ parameters: [
709
+ {
710
+ key: 'wordlist',
711
+ type: 'string', // Actually highly structured, but string type is a placeholder
712
+ required: true,
713
+ description: 'Word list for prediction',
714
+ },
715
+ ],
716
+ },
702
717
  'Grammar.Change': {
703
718
  id: 'Grammar.Change',
704
719
  category: Grid3CommandCategory.AUTO_CONTENT,
@@ -128,12 +128,12 @@ function detectPluginCellType(content) {
128
128
  }
129
129
  // AutoContent detection - dynamic word/content suggestions
130
130
  if (contentType === 'AutoContent' || content.Style?.BasedOnStyle === 'AutoContent') {
131
- const autoContentType = extractAutoContentType(content);
131
+ const autoContentType = extractAutoContentType(content) || contentSubType;
132
132
  return {
133
133
  cellType: Grid3CellType.AutoContent,
134
- autoContentType: autoContentType || undefined,
135
- pluginId: inferAutoContentPlugin(autoContentType),
136
- displayName: autoContentType || 'Auto Content',
134
+ autoContentType: autoContentType ? String(autoContentType) : undefined,
135
+ pluginId: inferAutoContentPlugin(autoContentType ? String(autoContentType) : undefined),
136
+ displayName: autoContentType ? String(autoContentType) : 'Auto Content',
137
137
  };
138
138
  }
139
139
  // Regular cell
@@ -12,6 +12,10 @@ declare class GridsetProcessor extends BaseProcessor {
12
12
  private decryptGridsetEntry;
13
13
  private getGridsetPassword;
14
14
  private ensureAlphaChannel;
15
+ /**
16
+ * Extract words from Grid3 WordList structure
17
+ */
18
+ private _extractWordsFromWordList;
15
19
  private generateCommandsFromSemanticAction;
16
20
  private convertGrid3StyleToAACStyle;
17
21
  private getStyleById;