@willwade/aac-processors 0.0.9 → 0.0.11

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 (75) hide show
  1. package/README.md +85 -11
  2. package/dist/cli/index.js +87 -0
  3. package/dist/core/analyze.js +1 -0
  4. package/dist/core/baseProcessor.d.ts +6 -0
  5. package/dist/core/fileProcessor.js +1 -0
  6. package/dist/core/treeStructure.d.ts +3 -1
  7. package/dist/core/treeStructure.js +3 -1
  8. package/dist/index.d.ts +1 -0
  9. package/dist/index.js +3 -0
  10. package/dist/optional/symbolTools.js +4 -2
  11. package/dist/processors/gridset/colorUtils.d.ts +18 -0
  12. package/dist/processors/gridset/colorUtils.js +36 -0
  13. package/dist/processors/gridset/commands.d.ts +103 -0
  14. package/dist/processors/gridset/commands.js +958 -0
  15. package/dist/processors/gridset/helpers.d.ts +1 -1
  16. package/dist/processors/gridset/helpers.js +5 -3
  17. package/dist/processors/gridset/index.d.ts +45 -0
  18. package/dist/processors/gridset/index.js +153 -0
  19. package/dist/processors/gridset/password.d.ts +11 -0
  20. package/dist/processors/gridset/password.js +37 -0
  21. package/dist/processors/gridset/pluginTypes.d.ts +109 -0
  22. package/dist/processors/gridset/pluginTypes.js +285 -0
  23. package/dist/processors/gridset/resolver.d.ts +14 -1
  24. package/dist/processors/gridset/resolver.js +47 -5
  25. package/dist/processors/gridset/styleHelpers.d.ts +22 -0
  26. package/dist/processors/gridset/styleHelpers.js +35 -1
  27. package/dist/processors/gridset/symbolExtractor.d.ts +121 -0
  28. package/dist/processors/gridset/symbolExtractor.js +362 -0
  29. package/dist/processors/gridset/symbolSearch.d.ts +117 -0
  30. package/dist/processors/gridset/symbolSearch.js +280 -0
  31. package/dist/processors/gridset/symbols.d.ts +199 -0
  32. package/dist/processors/gridset/symbols.js +468 -0
  33. package/dist/processors/gridset/wordlistHelpers.d.ts +2 -2
  34. package/dist/processors/gridset/wordlistHelpers.js +7 -4
  35. package/dist/processors/gridsetProcessor.d.ts +15 -1
  36. package/dist/processors/gridsetProcessor.js +98 -22
  37. package/dist/processors/index.d.ts +10 -1
  38. package/dist/processors/index.js +94 -2
  39. package/dist/processors/obfProcessor.d.ts +7 -0
  40. package/dist/processors/obfProcessor.js +9 -0
  41. package/dist/processors/snapProcessor.d.ts +7 -0
  42. package/dist/processors/snapProcessor.js +9 -0
  43. package/dist/processors/touchchatProcessor.d.ts +7 -0
  44. package/dist/processors/touchchatProcessor.js +9 -0
  45. package/dist/types/aac.d.ts +17 -0
  46. package/dist/utilities/screenshotConverter.d.ts +69 -0
  47. package/dist/utilities/screenshotConverter.js +453 -0
  48. package/dist/validation/baseValidator.d.ts +80 -0
  49. package/dist/validation/baseValidator.js +160 -0
  50. package/dist/validation/gridsetValidator.d.ts +36 -0
  51. package/dist/validation/gridsetValidator.js +288 -0
  52. package/dist/validation/index.d.ts +13 -0
  53. package/dist/validation/index.js +69 -0
  54. package/dist/validation/obfValidator.d.ts +44 -0
  55. package/dist/validation/obfValidator.js +530 -0
  56. package/dist/validation/snapValidator.d.ts +33 -0
  57. package/dist/validation/snapValidator.js +237 -0
  58. package/dist/validation/touchChatValidator.d.ts +33 -0
  59. package/dist/validation/touchChatValidator.js +229 -0
  60. package/dist/validation/validationTypes.d.ts +64 -0
  61. package/dist/validation/validationTypes.js +15 -0
  62. package/examples/README.md +7 -0
  63. package/examples/demo.js +143 -0
  64. package/examples/obf/aboutme.json +376 -0
  65. package/examples/obf/array.json +6 -0
  66. package/examples/obf/hash.json +4 -0
  67. package/examples/obf/links.obz +0 -0
  68. package/examples/obf/simple.obf +53 -0
  69. package/examples/package-lock.json +1326 -0
  70. package/examples/package.json +10 -0
  71. package/examples/styling-example.ts +316 -0
  72. package/examples/translate.js +39 -0
  73. package/examples/translate_demo.js +254 -0
  74. package/examples/typescript-demo.ts +251 -0
  75. package/package.json +3 -1
@@ -0,0 +1,958 @@
1
+ "use strict";
2
+ /**
3
+ * Grid 3 Command Definitions and Detection System
4
+ *
5
+ * This module provides comprehensive metadata for all Grid 3 commands,
6
+ * organized by plugin/category. It enables:
7
+ * - Command detection and classification
8
+ * - Parameter extraction
9
+ * - Future extensibility for command execution
10
+ * - Semantic action mapping
11
+ *
12
+ * Grid 3 has 33+ plugins with 200+ commands. This catalog captures
13
+ * the most commonly used and important commands.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.GRID3_COMMANDS = exports.Grid3CommandCategory = void 0;
17
+ exports.getCommandDefinition = getCommandDefinition;
18
+ exports.isKnownCommand = isKnownCommand;
19
+ exports.getCommandsByPlugin = getCommandsByPlugin;
20
+ exports.getCommandsByCategory = getCommandsByCategory;
21
+ exports.getAllCommandIds = getAllCommandIds;
22
+ exports.getAllPluginIds = getAllPluginIds;
23
+ exports.extractCommandParameters = extractCommandParameters;
24
+ exports.detectCommand = detectCommand;
25
+ /**
26
+ * Command categories in Grid 3
27
+ */
28
+ var Grid3CommandCategory;
29
+ (function (Grid3CommandCategory) {
30
+ Grid3CommandCategory["NAVIGATION"] = "navigation";
31
+ Grid3CommandCategory["COMMUNICATION"] = "communication";
32
+ Grid3CommandCategory["TEXT_EDITING"] = "text_editing";
33
+ Grid3CommandCategory["COMPUTER_CONTROL"] = "computer_control";
34
+ Grid3CommandCategory["WEB_BROWSER"] = "web_browser";
35
+ Grid3CommandCategory["EMAIL"] = "email";
36
+ Grid3CommandCategory["PHONE"] = "phone";
37
+ Grid3CommandCategory["SMS"] = "sms";
38
+ Grid3CommandCategory["SYSTEM"] = "system";
39
+ Grid3CommandCategory["SETTINGS"] = "settings";
40
+ Grid3CommandCategory["SPEECH"] = "speech";
41
+ Grid3CommandCategory["AUTO_CONTENT"] = "auto_content";
42
+ Grid3CommandCategory["ENVIRONMENT_CONTROL"] = "environment_control";
43
+ Grid3CommandCategory["MOUSE"] = "mouse";
44
+ Grid3CommandCategory["WINDOW"] = "window";
45
+ Grid3CommandCategory["MEDIA"] = "media";
46
+ Grid3CommandCategory["CUSTOM"] = "custom";
47
+ })(Grid3CommandCategory || (exports.Grid3CommandCategory = Grid3CommandCategory = {}));
48
+ /**
49
+ * Registry of all Grid 3 commands
50
+ * Key is command ID (e.g., 'Jump.To', 'Action.InsertText')
51
+ */
52
+ exports.GRID3_COMMANDS = {
53
+ // ========================================
54
+ // NAVIGATION COMMANDS
55
+ // ========================================
56
+ 'Jump.To': {
57
+ id: 'Jump.To',
58
+ category: Grid3CommandCategory.NAVIGATION,
59
+ pluginId: 'navigation',
60
+ displayName: 'Jump To',
61
+ description: 'Navigate to a specific grid',
62
+ parameters: [
63
+ {
64
+ key: 'grid',
65
+ type: 'grid',
66
+ required: true,
67
+ description: 'Target grid name',
68
+ },
69
+ ],
70
+ platforms: ['desktop', 'ios', 'medicare', 'medicareBionics'],
71
+ },
72
+ 'Jump.Back': {
73
+ id: 'Jump.Back',
74
+ category: Grid3CommandCategory.NAVIGATION,
75
+ pluginId: 'navigation',
76
+ displayName: 'Jump Back',
77
+ description: 'Navigate to the previous grid',
78
+ platforms: ['desktop', 'ios', 'medicare', 'medicareBionics'],
79
+ },
80
+ 'Jump.Home': {
81
+ id: 'Jump.Home',
82
+ category: Grid3CommandCategory.NAVIGATION,
83
+ pluginId: 'navigation',
84
+ displayName: 'Jump Home',
85
+ description: 'Navigate to the home/start grid',
86
+ platforms: ['desktop', 'ios', 'medicare', 'medicareBionics'],
87
+ },
88
+ 'Jump.Favorite': {
89
+ id: 'Jump.Favorite',
90
+ category: Grid3CommandCategory.NAVIGATION,
91
+ pluginId: 'navigation',
92
+ displayName: 'Jump To Favorite',
93
+ description: 'Navigate to a favorite grid',
94
+ parameters: [
95
+ {
96
+ key: 'favorite',
97
+ type: 'number',
98
+ required: true,
99
+ description: 'Favorite slot number',
100
+ },
101
+ ],
102
+ },
103
+ // ========================================
104
+ // COMMUNICATION COMMANDS
105
+ // ========================================
106
+ 'Action.Speak': {
107
+ id: 'Action.Speak',
108
+ category: Grid3CommandCategory.COMMUNICATION,
109
+ pluginId: 'speech',
110
+ displayName: 'Speak',
111
+ description: 'Speak the current message bar contents',
112
+ parameters: [
113
+ {
114
+ key: 'unit',
115
+ type: 'string',
116
+ required: false,
117
+ description: 'Speaking unit (sentence/word/character)',
118
+ },
119
+ {
120
+ key: 'movecaret',
121
+ type: 'boolean',
122
+ required: false,
123
+ description: 'Move caret after speaking',
124
+ },
125
+ ],
126
+ platforms: ['desktop', 'ios', 'medicare', 'medicareBionics'],
127
+ },
128
+ 'Action.InsertText': {
129
+ id: 'Action.InsertText',
130
+ category: Grid3CommandCategory.COMMUNICATION,
131
+ pluginId: 'core',
132
+ displayName: 'Insert Text',
133
+ description: 'Insert text into the message bar',
134
+ parameters: [
135
+ {
136
+ key: 'text',
137
+ type: 'string',
138
+ required: true,
139
+ description: 'Text to insert',
140
+ },
141
+ ],
142
+ platforms: ['desktop', 'ios', 'medicare', 'medicareBionics'],
143
+ },
144
+ 'Action.InsertTextAndSpeak': {
145
+ id: 'Action.InsertTextAndSpeak',
146
+ category: Grid3CommandCategory.COMMUNICATION,
147
+ pluginId: 'core',
148
+ displayName: 'Insert Text and Speak',
149
+ description: 'Insert text and speak immediately',
150
+ parameters: [
151
+ {
152
+ key: 'text',
153
+ type: 'string',
154
+ required: true,
155
+ description: 'Text to insert and speak',
156
+ },
157
+ ],
158
+ },
159
+ // ========================================
160
+ // TEXT EDITING COMMANDS
161
+ // ========================================
162
+ 'Action.DeleteWord': {
163
+ id: 'Action.DeleteWord',
164
+ category: Grid3CommandCategory.TEXT_EDITING,
165
+ pluginId: 'core',
166
+ displayName: 'Delete Word',
167
+ description: 'Delete the last word in the message bar',
168
+ platforms: ['desktop', 'ios', 'medicare', 'medicareBionics'],
169
+ },
170
+ 'Action.DeleteLetter': {
171
+ id: 'Action.DeleteLetter',
172
+ category: Grid3CommandCategory.TEXT_EDITING,
173
+ pluginId: 'core',
174
+ displayName: 'Delete Letter',
175
+ description: 'Delete the last character in the message bar',
176
+ platforms: ['desktop', 'ios', 'medicare', 'medicareBionics'],
177
+ },
178
+ 'Action.Clear': {
179
+ id: 'Action.Clear',
180
+ category: Grid3CommandCategory.TEXT_EDITING,
181
+ pluginId: 'core',
182
+ displayName: 'Clear',
183
+ description: 'Clear the message bar',
184
+ platforms: ['desktop', 'ios', 'medicare', 'medicareBionics'],
185
+ },
186
+ 'Action.Letter': {
187
+ id: 'Action.Letter',
188
+ category: Grid3CommandCategory.TEXT_EDITING,
189
+ pluginId: 'core',
190
+ displayName: 'Insert Letter',
191
+ description: 'Insert a single letter',
192
+ parameters: [
193
+ {
194
+ key: 'letter',
195
+ type: 'string',
196
+ required: true,
197
+ description: 'Letter to insert',
198
+ },
199
+ ],
200
+ },
201
+ 'Action.Space': {
202
+ id: 'Action.Space',
203
+ category: Grid3CommandCategory.TEXT_EDITING,
204
+ pluginId: 'core',
205
+ displayName: 'Space',
206
+ description: 'Insert a space',
207
+ platforms: ['desktop', 'ios', 'medicare', 'medicareBionics'],
208
+ },
209
+ 'Action.Backspace': {
210
+ id: 'Action.Backspace',
211
+ category: Grid3CommandCategory.TEXT_EDITING,
212
+ pluginId: 'core',
213
+ displayName: 'Backspace',
214
+ description: 'Delete character before cursor',
215
+ platforms: ['desktop', 'ios', 'medicare', 'medicareBionics'],
216
+ },
217
+ // ========================================
218
+ // SPEECH COMMANDS
219
+ // ========================================
220
+ 'Speech.ChangePublicVoice': {
221
+ id: 'Speech.ChangePublicVoice',
222
+ category: Grid3CommandCategory.SPEECH,
223
+ pluginId: 'speech',
224
+ displayName: 'Change Voice',
225
+ description: 'Change the public speaking voice',
226
+ parameters: [
227
+ {
228
+ key: 'voice',
229
+ type: 'string',
230
+ required: true,
231
+ description: 'Voice name or ID',
232
+ },
233
+ ],
234
+ },
235
+ 'Speech.ChangePublicSpeed': {
236
+ id: 'Speech.ChangePublicSpeed',
237
+ category: Grid3CommandCategory.SPEECH,
238
+ pluginId: 'speech',
239
+ displayName: 'Change Speech Speed',
240
+ description: 'Change the speaking speed',
241
+ parameters: [
242
+ {
243
+ key: 'speed',
244
+ type: 'number',
245
+ required: true,
246
+ description: 'Speed percentage (50-200)',
247
+ },
248
+ ],
249
+ },
250
+ 'Speech.ChangePublicPitch': {
251
+ id: 'Speech.ChangePublicPitch',
252
+ category: Grid3CommandCategory.SPEECH,
253
+ pluginId: 'speech',
254
+ displayName: 'Change Speech Pitch',
255
+ description: 'Change the voice pitch',
256
+ parameters: [
257
+ {
258
+ key: 'pitch',
259
+ type: 'number',
260
+ required: true,
261
+ description: 'Pitch value',
262
+ },
263
+ ],
264
+ },
265
+ 'Speech.ChangePublicVolume': {
266
+ id: 'Speech.ChangePublicVolume',
267
+ category: Grid3CommandCategory.SPEECH,
268
+ pluginId: 'speech',
269
+ displayName: 'Change Speech Volume',
270
+ description: 'Change the speech volume',
271
+ parameters: [
272
+ {
273
+ key: 'volume',
274
+ type: 'number',
275
+ required: true,
276
+ description: 'Volume percentage (0-100)',
277
+ },
278
+ ],
279
+ },
280
+ 'Speech.SpeakNothing': {
281
+ id: 'Action.SpeakNothing',
282
+ category: Grid3CommandCategory.SPEECH,
283
+ pluginId: 'speech',
284
+ displayName: 'Speak Nothing',
285
+ description: 'Speak without inserting text',
286
+ platforms: ['desktop', 'ios', 'medicare', 'medicareBionics'],
287
+ },
288
+ // ========================================
289
+ // COMPUTER CONTROL COMMANDS
290
+ // ========================================
291
+ 'ComputerControl.LeftClick': {
292
+ id: 'ComputerControl.LeftClick',
293
+ category: Grid3CommandCategory.COMPUTER_CONTROL,
294
+ pluginId: 'computercontrol',
295
+ displayName: 'Left Click',
296
+ description: 'Perform left mouse click',
297
+ platforms: ['desktop', 'medicareBionics'],
298
+ },
299
+ 'ComputerControl.RightClick': {
300
+ id: 'ComputerControl.RightClick',
301
+ category: Grid3CommandCategory.COMPUTER_CONTROL,
302
+ pluginId: 'computercontrol',
303
+ displayName: 'Right Click',
304
+ description: 'Perform right mouse click',
305
+ platforms: ['desktop', 'medicareBionics'],
306
+ },
307
+ 'ComputerControl.DoubleClick': {
308
+ id: 'ComputerControl.DoubleClick',
309
+ category: Grid3CommandCategory.COMPUTER_CONTROL,
310
+ pluginId: 'computercontrol',
311
+ displayName: 'Double Click',
312
+ description: 'Perform double mouse click',
313
+ platforms: ['desktop', 'medicareBionics'],
314
+ },
315
+ 'ComputerControl.MouseMove': {
316
+ id: 'ComputerControl.MouseMove',
317
+ category: Grid3CommandCategory.COMPUTER_CONTROL,
318
+ pluginId: 'computercontrol',
319
+ displayName: 'Move Mouse',
320
+ description: 'Move mouse pointer',
321
+ parameters: [
322
+ { key: 'x', type: 'number', required: true, description: 'X coordinate' },
323
+ { key: 'y', type: 'number', required: true, description: 'Y coordinate' },
324
+ ],
325
+ platforms: ['desktop', 'medicareBionics'],
326
+ },
327
+ 'ComputerControl.SendKeys': {
328
+ id: 'ComputerControl.SendKeys',
329
+ category: Grid3CommandCategory.COMPUTER_CONTROL,
330
+ pluginId: 'computercontrol',
331
+ displayName: 'Send Keys',
332
+ description: 'Send keyboard input',
333
+ parameters: [
334
+ {
335
+ key: 'keys',
336
+ type: 'string',
337
+ required: true,
338
+ description: 'Key sequence to send',
339
+ },
340
+ ],
341
+ platforms: ['desktop', 'medicareBionics'],
342
+ },
343
+ 'ComputerControl.WindowsKey': {
344
+ id: 'ComputerControl.WindowsKey',
345
+ category: Grid3CommandCategory.COMPUTER_CONTROL,
346
+ pluginId: 'computercontrol',
347
+ displayName: 'Windows Key',
348
+ description: 'Press Windows key',
349
+ platforms: ['desktop'],
350
+ },
351
+ 'ComputerControl.MenuKey': {
352
+ id: 'ComputerControl.MenuKey',
353
+ category: Grid3CommandCategory.COMPUTER_CONTROL,
354
+ pluginId: 'computercontrol',
355
+ displayName: 'Menu Key',
356
+ description: 'Press context menu key',
357
+ platforms: ['desktop'],
358
+ },
359
+ // ========================================
360
+ // WEB BROWSER COMMANDS
361
+ // ========================================
362
+ 'WebBrowser.Navigate': {
363
+ id: 'WebBrowser.Navigate',
364
+ category: Grid3CommandCategory.WEB_BROWSER,
365
+ pluginId: 'webbrowser',
366
+ displayName: 'Navigate to URL',
367
+ description: 'Open a URL in the web browser',
368
+ parameters: [
369
+ {
370
+ key: 'url',
371
+ type: 'string',
372
+ required: true,
373
+ description: 'URL to navigate to',
374
+ },
375
+ ],
376
+ platforms: ['desktop', 'ios'],
377
+ },
378
+ 'WebBrowser.Back': {
379
+ id: 'WebBrowser.Back',
380
+ category: Grid3CommandCategory.WEB_BROWSER,
381
+ pluginId: 'webbrowser',
382
+ displayName: 'Browser Back',
383
+ description: 'Go back in browser history',
384
+ platforms: ['desktop', 'ios'],
385
+ },
386
+ 'WebBrowser.Forward': {
387
+ id: 'WebBrowser.Forward',
388
+ category: Grid3CommandCategory.WEB_BROWSER,
389
+ pluginId: 'webbrowser',
390
+ displayName: 'Browser Forward',
391
+ description: 'Go forward in browser history',
392
+ platforms: ['desktop', 'ios'],
393
+ },
394
+ 'WebBrowser.Refresh': {
395
+ id: 'WebBrowser.Refresh',
396
+ category: Grid3CommandCategory.WEB_BROWSER,
397
+ pluginId: 'webbrowser',
398
+ displayName: 'Refresh Page',
399
+ description: 'Refresh the current page',
400
+ platforms: ['desktop', 'ios'],
401
+ },
402
+ 'WebBrowser.Home': {
403
+ id: 'WebBrowser.Home',
404
+ category: Grid3CommandCategory.WEB_BROWSER,
405
+ pluginId: 'webbrowser',
406
+ displayName: 'Browser Home',
407
+ description: 'Navigate to browser home page',
408
+ platforms: ['desktop', 'ios'],
409
+ },
410
+ 'WebBrowser.FavoriteAdd': {
411
+ id: 'WebBrowser.FavoriteAdd',
412
+ category: Grid3CommandCategory.WEB_BROWSER,
413
+ pluginId: 'webbrowser',
414
+ displayName: 'Add Favorite',
415
+ description: 'Add current page to favorites',
416
+ platforms: ['desktop', 'ios'],
417
+ },
418
+ 'WebBrowser.ZoomIn': {
419
+ id: 'WebBrowser.ZoomIn',
420
+ category: Grid3CommandCategory.WEB_BROWSER,
421
+ pluginId: 'webbrowser',
422
+ displayName: 'Zoom In',
423
+ description: 'Zoom in the page',
424
+ platforms: ['desktop', 'ios'],
425
+ },
426
+ 'WebBrowser.ZoomOut': {
427
+ id: 'WebBrowser.ZoomOut',
428
+ category: Grid3CommandCategory.WEB_BROWSER,
429
+ pluginId: 'webbrowser',
430
+ displayName: 'Zoom Out',
431
+ description: 'Zoom out the page',
432
+ platforms: ['desktop', 'ios'],
433
+ },
434
+ // ========================================
435
+ // EMAIL COMMANDS
436
+ // ========================================
437
+ 'Email.SendTo': {
438
+ id: 'Email.SendTo',
439
+ category: Grid3CommandCategory.EMAIL,
440
+ pluginId: 'email',
441
+ displayName: 'Send Email To',
442
+ description: 'Send email to a recipient',
443
+ parameters: [
444
+ {
445
+ key: 'recipient',
446
+ type: 'string',
447
+ required: true,
448
+ description: 'Recipient email address',
449
+ },
450
+ {
451
+ key: 'subject',
452
+ type: 'string',
453
+ required: false,
454
+ description: 'Email subject',
455
+ },
456
+ ],
457
+ platforms: ['desktop', 'medicare', 'medicareBionics'],
458
+ },
459
+ 'Email.AddRecipient': {
460
+ id: 'Email.AddRecipient',
461
+ category: Grid3CommandCategory.EMAIL,
462
+ pluginId: 'email',
463
+ displayName: 'Add Recipient',
464
+ description: 'Add a recipient to the email',
465
+ parameters: [
466
+ {
467
+ key: 'recipient',
468
+ type: 'string',
469
+ required: true,
470
+ description: 'Recipient email address',
471
+ },
472
+ ],
473
+ platforms: ['desktop', 'medicare', 'medicareBionics'],
474
+ },
475
+ 'Email.SetSubject': {
476
+ id: 'Email.SetSubject',
477
+ category: Grid3CommandCategory.EMAIL,
478
+ pluginId: 'email',
479
+ displayName: 'Set Subject',
480
+ description: 'Set the email subject',
481
+ parameters: [
482
+ {
483
+ key: 'subject',
484
+ type: 'string',
485
+ required: true,
486
+ description: 'Email subject',
487
+ },
488
+ ],
489
+ platforms: ['desktop', 'medicare', 'medicareBionics'],
490
+ },
491
+ 'Email.AttachFile': {
492
+ id: 'Email.AttachFile',
493
+ category: Grid3CommandCategory.EMAIL,
494
+ pluginId: 'email',
495
+ displayName: 'Attach File',
496
+ description: 'Attach a file to the email',
497
+ parameters: [
498
+ {
499
+ key: 'filepath',
500
+ type: 'string',
501
+ required: true,
502
+ description: 'Path to file',
503
+ },
504
+ ],
505
+ platforms: ['desktop', 'medicare', 'medicareBionics'],
506
+ },
507
+ // ========================================
508
+ // PHONE COMMANDS
509
+ // ========================================
510
+ 'Phone.Call': {
511
+ id: 'Phone.Call',
512
+ category: Grid3CommandCategory.PHONE,
513
+ pluginId: 'phone',
514
+ displayName: 'Make Call',
515
+ description: 'Initiate a phone call',
516
+ parameters: [
517
+ {
518
+ key: 'number',
519
+ type: 'string',
520
+ required: true,
521
+ description: 'Phone number to call',
522
+ },
523
+ ],
524
+ platforms: ['desktop', 'medicare', 'medicareBionics'],
525
+ },
526
+ 'Phone.Answer': {
527
+ id: 'Phone.Answer',
528
+ category: Grid3CommandCategory.PHONE,
529
+ pluginId: 'phone',
530
+ displayName: 'Answer Call',
531
+ description: 'Answer incoming call',
532
+ platforms: ['desktop', 'medicare', 'medicareBionics'],
533
+ },
534
+ 'Phone.Hangup': {
535
+ id: 'Phone.Hangup',
536
+ category: Grid3CommandCategory.PHONE,
537
+ pluginId: 'phone',
538
+ displayName: 'End Call',
539
+ description: 'End current call',
540
+ platforms: ['desktop', 'medicare', 'medicareBionics'],
541
+ },
542
+ // ========================================
543
+ // SMS COMMANDS
544
+ // ========================================
545
+ 'Sms.SendTo': {
546
+ id: 'Sms.SendTo',
547
+ category: Grid3CommandCategory.SMS,
548
+ pluginId: 'sms',
549
+ displayName: 'Send SMS To',
550
+ description: 'Send text message to a recipient',
551
+ parameters: [
552
+ {
553
+ key: 'recipient',
554
+ type: 'string',
555
+ required: true,
556
+ description: 'Phone number',
557
+ },
558
+ {
559
+ key: 'message',
560
+ type: 'string',
561
+ required: false,
562
+ description: 'Message text',
563
+ },
564
+ ],
565
+ platforms: ['desktop', 'medicare', 'medicareBionics'],
566
+ },
567
+ 'Sms.AddRecipient': {
568
+ id: 'Sms.AddRecipient',
569
+ category: Grid3CommandCategory.SMS,
570
+ pluginId: 'sms',
571
+ displayName: 'Add SMS Recipient',
572
+ description: 'Add a recipient to the SMS',
573
+ parameters: [
574
+ {
575
+ key: 'recipient',
576
+ type: 'string',
577
+ required: true,
578
+ description: 'Phone number',
579
+ },
580
+ ],
581
+ platforms: ['desktop', 'medicare', 'medicareBionics'],
582
+ },
583
+ // ========================================
584
+ // SYSTEM COMMANDS
585
+ // ========================================
586
+ 'System.LogOff': {
587
+ id: 'System.LogOff',
588
+ category: Grid3CommandCategory.SYSTEM,
589
+ pluginId: 'computersession',
590
+ displayName: 'Log Off',
591
+ description: 'Log off from Windows',
592
+ platforms: ['desktop', 'medicare', 'medicareBionics'],
593
+ },
594
+ 'System.Lock': {
595
+ id: 'System.Lock',
596
+ category: Grid3CommandCategory.SYSTEM,
597
+ pluginId: 'computersession',
598
+ displayName: 'Lock Computer',
599
+ description: 'Lock the computer',
600
+ platforms: ['desktop', 'medicare', 'medicareBionics'],
601
+ },
602
+ 'System.Sleep': {
603
+ id: 'System.Sleep',
604
+ category: Grid3CommandCategory.SYSTEM,
605
+ pluginId: 'computersession',
606
+ displayName: 'Sleep',
607
+ description: 'Put computer to sleep',
608
+ platforms: ['desktop', 'medicare', 'medicareBionics'],
609
+ },
610
+ 'System.Restart': {
611
+ id: 'System.Restart',
612
+ category: Grid3CommandCategory.SYSTEM,
613
+ pluginId: 'computersession',
614
+ displayName: 'Restart',
615
+ description: 'Restart the computer',
616
+ platforms: ['desktop', 'medicare', 'medicareBionics'],
617
+ },
618
+ 'System.ShutDown': {
619
+ id: 'System.ShutDown',
620
+ category: Grid3CommandCategory.SYSTEM,
621
+ pluginId: 'computersession',
622
+ displayName: 'Shut Down',
623
+ description: 'Shut down the computer',
624
+ platforms: ['desktop', 'medicare', 'medicareBionics'],
625
+ },
626
+ // ========================================
627
+ // SETTINGS COMMANDS
628
+ // ========================================
629
+ 'Settings.RestoreAll': {
630
+ id: 'Settings.RestoreAll',
631
+ category: Grid3CommandCategory.SETTINGS,
632
+ pluginId: 'settings',
633
+ displayName: 'Restore All Settings',
634
+ description: 'Restore all settings to defaults',
635
+ parameters: [
636
+ {
637
+ key: 'indicatorenabled',
638
+ type: 'boolean',
639
+ required: false,
640
+ description: 'Show indicator',
641
+ },
642
+ {
643
+ key: 'action',
644
+ type: 'string',
645
+ required: false,
646
+ description: 'Action to perform',
647
+ },
648
+ ],
649
+ platforms: ['desktop', 'ios', 'medicare', 'medicareBionics'],
650
+ },
651
+ 'Settings.Open': {
652
+ id: 'Settings.Open',
653
+ category: Grid3CommandCategory.SETTINGS,
654
+ pluginId: 'settings',
655
+ displayName: 'Open Settings',
656
+ description: 'Open the settings window',
657
+ platforms: ['desktop', 'ios', 'medicare', 'medicareBionics'],
658
+ },
659
+ 'Scanning.Start': {
660
+ id: 'Scanning.Start',
661
+ category: Grid3CommandCategory.SETTINGS,
662
+ pluginId: 'access',
663
+ displayName: 'Start Scanning',
664
+ description: 'Start scanning access method',
665
+ platforms: ['desktop', 'ios', 'medicare', 'medicareBionics'],
666
+ },
667
+ 'Scanning.Stop': {
668
+ id: 'Scanning.Stop',
669
+ category: Grid3CommandCategory.SETTINGS,
670
+ pluginId: 'access',
671
+ displayName: 'Stop Scanning',
672
+ description: 'Stop scanning access method',
673
+ platforms: ['desktop', 'ios', 'medicare', 'medicareBionics'],
674
+ },
675
+ // ========================================
676
+ // AUTO CONTENT COMMANDS
677
+ // ========================================
678
+ 'AutoContent.Activate': {
679
+ id: 'AutoContent.Activate',
680
+ category: Grid3CommandCategory.AUTO_CONTENT,
681
+ pluginId: 'autocontent',
682
+ displayName: 'Activate Auto Content',
683
+ description: 'Activate an auto content cell',
684
+ parameters: [
685
+ {
686
+ key: 'autocontenttype',
687
+ type: 'string',
688
+ required: true,
689
+ description: 'Type of auto content',
690
+ },
691
+ ],
692
+ platforms: ['desktop', 'ios', 'medicare', 'medicareBionics'],
693
+ },
694
+ 'Prediction.Clear': {
695
+ id: 'Prediction.Clear',
696
+ category: Grid3CommandCategory.AUTO_CONTENT,
697
+ pluginId: 'prediction',
698
+ displayName: 'Clear Prediction',
699
+ description: 'Clear word prediction buffer',
700
+ platforms: ['desktop', 'ios', 'medicare', 'medicareBionics'],
701
+ },
702
+ 'Grammar.Change': {
703
+ id: 'Grammar.Change',
704
+ category: Grid3CommandCategory.AUTO_CONTENT,
705
+ pluginId: 'grammar',
706
+ displayName: 'Change Grammar',
707
+ description: 'Change grammar context',
708
+ parameters: [
709
+ {
710
+ key: 'context',
711
+ type: 'string',
712
+ required: true,
713
+ description: 'Grammar context',
714
+ },
715
+ ],
716
+ platforms: ['desktop', 'ios', 'medicare', 'medicareBionics'],
717
+ },
718
+ // ========================================
719
+ // ENVIRONMENT CONTROL COMMANDS
720
+ // ========================================
721
+ 'EnvControl.Send': {
722
+ id: 'EnvControl.Send',
723
+ category: Grid3CommandCategory.ENVIRONMENT_CONTROL,
724
+ pluginId: 'environmentcontrol',
725
+ displayName: 'Send Environment Control',
726
+ description: 'Send environment control command',
727
+ parameters: [
728
+ {
729
+ key: 'code',
730
+ type: 'string',
731
+ required: true,
732
+ description: 'IR/EC code to send',
733
+ },
734
+ ],
735
+ platforms: ['desktop', 'medicare', 'medicareBionics'],
736
+ },
737
+ 'EnvControl.Learn': {
738
+ id: 'EnvControl.Learn',
739
+ category: Grid3CommandCategory.ENVIRONMENT_CONTROL,
740
+ pluginId: 'environmentcontrol',
741
+ displayName: 'Learn Environment Control',
742
+ description: 'Learn environment control code',
743
+ platforms: ['desktop', 'medicare', 'medicareBionics'],
744
+ },
745
+ // ========================================
746
+ // MOUSE COMMANDS
747
+ // ========================================
748
+ 'Mouse.LeftClick': {
749
+ id: 'Mouse.LeftClick',
750
+ category: Grid3CommandCategory.MOUSE,
751
+ pluginId: 'computercontrol',
752
+ displayName: 'Mouse Left Click',
753
+ description: 'Left mouse click',
754
+ platforms: ['desktop', 'medicareBionics'],
755
+ },
756
+ 'Mouse.RightClick': {
757
+ id: 'Mouse.RightClick',
758
+ category: Grid3CommandCategory.MOUSE,
759
+ pluginId: 'computercontrol',
760
+ displayName: 'Mouse Right Click',
761
+ description: 'Right mouse click',
762
+ platforms: ['desktop', 'medicareBionics'],
763
+ },
764
+ 'Mouse.DoubleClick': {
765
+ id: 'Mouse.DoubleClick',
766
+ category: Grid3CommandCategory.MOUSE,
767
+ pluginId: 'computercontrol',
768
+ displayName: 'Mouse Double Click',
769
+ description: 'Double mouse click',
770
+ platforms: ['desktop', 'medicareBionics'],
771
+ },
772
+ 'Mouse.Move': {
773
+ id: 'Mouse.Move',
774
+ category: Grid3CommandCategory.MOUSE,
775
+ pluginId: 'computercontrol',
776
+ displayName: 'Move Mouse',
777
+ description: 'Move mouse pointer',
778
+ parameters: [
779
+ { key: 'x', type: 'number', required: true, description: 'X coordinate' },
780
+ { key: 'y', type: 'number', required: true, description: 'Y coordinate' },
781
+ ],
782
+ platforms: ['desktop', 'medicareBionics'],
783
+ },
784
+ // ========================================
785
+ // WINDOW COMMANDS
786
+ // ========================================
787
+ 'Window.Minimize': {
788
+ id: 'Window.Minimize',
789
+ category: Grid3CommandCategory.WINDOW,
790
+ pluginId: 'computercontrol',
791
+ displayName: 'Minimize Window',
792
+ description: 'Minimize active window',
793
+ platforms: ['desktop', 'medicareBionics'],
794
+ },
795
+ 'Window.Maximize': {
796
+ id: 'Window.Maximize',
797
+ category: Grid3CommandCategory.WINDOW,
798
+ pluginId: 'computercontrol',
799
+ displayName: 'Maximize Window',
800
+ description: 'Maximize active window',
801
+ platforms: ['desktop', 'medicareBionics'],
802
+ },
803
+ 'Window.Close': {
804
+ id: 'Window.Close',
805
+ category: Grid3CommandCategory.WINDOW,
806
+ pluginId: 'computercontrol',
807
+ displayName: 'Close Window',
808
+ description: 'Close active window',
809
+ platforms: ['desktop', 'medicareBionics'],
810
+ },
811
+ 'Window.Switch': {
812
+ id: 'Window.Switch',
813
+ category: Grid3CommandCategory.WINDOW,
814
+ pluginId: 'computercontrol',
815
+ displayName: 'Switch Window',
816
+ description: 'Switch to next window',
817
+ platforms: ['desktop', 'medicareBionics'],
818
+ },
819
+ // ========================================
820
+ // MEDIA COMMANDS
821
+ // ========================================
822
+ 'Media.PlayPause': {
823
+ id: 'Media.PlayPause',
824
+ category: Grid3CommandCategory.MEDIA,
825
+ pluginId: 'musicvideo',
826
+ displayName: 'Play/Pause',
827
+ description: 'Toggle play/pause media',
828
+ platforms: ['desktop', 'ios'],
829
+ },
830
+ 'Media.Next': {
831
+ id: 'Media.Next',
832
+ category: Grid3CommandCategory.MEDIA,
833
+ pluginId: 'musicvideo',
834
+ displayName: 'Next Track',
835
+ description: 'Skip to next track',
836
+ platforms: ['desktop', 'ios'],
837
+ },
838
+ 'Media.Previous': {
839
+ id: 'Media.Previous',
840
+ category: Grid3CommandCategory.MEDIA,
841
+ pluginId: 'musicvideo',
842
+ displayName: 'Previous Track',
843
+ description: 'Go to previous track',
844
+ platforms: ['desktop', 'ios'],
845
+ },
846
+ 'Media.Stop': {
847
+ id: 'Media.Stop',
848
+ category: Grid3CommandCategory.MEDIA,
849
+ pluginId: 'musicvideo',
850
+ displayName: 'Stop',
851
+ description: 'Stop media playback',
852
+ platforms: ['desktop', 'ios'],
853
+ },
854
+ 'Media.VolumeUp': {
855
+ id: 'Media.VolumeUp',
856
+ category: Grid3CommandCategory.MEDIA,
857
+ pluginId: 'musicvideo',
858
+ displayName: 'Volume Up',
859
+ description: 'Increase volume',
860
+ platforms: ['desktop', 'ios'],
861
+ },
862
+ 'Media.VolumeDown': {
863
+ id: 'Media.VolumeDown',
864
+ category: Grid3CommandCategory.MEDIA,
865
+ pluginId: 'musicvideo',
866
+ displayName: 'Volume Down',
867
+ description: 'Decrease volume',
868
+ platforms: ['desktop', 'ios'],
869
+ },
870
+ };
871
+ /**
872
+ * Get command definition by ID
873
+ */
874
+ function getCommandDefinition(commandId) {
875
+ return exports.GRID3_COMMANDS[commandId];
876
+ }
877
+ /**
878
+ * Check if a command ID is known
879
+ */
880
+ function isKnownCommand(commandId) {
881
+ return commandId in exports.GRID3_COMMANDS;
882
+ }
883
+ /**
884
+ * Get all commands for a specific plugin
885
+ */
886
+ function getCommandsByPlugin(pluginId) {
887
+ return Object.values(exports.GRID3_COMMANDS).filter((cmd) => cmd.pluginId === pluginId);
888
+ }
889
+ /**
890
+ * Get all commands in a category
891
+ */
892
+ function getCommandsByCategory(category) {
893
+ return Object.values(exports.GRID3_COMMANDS).filter((cmd) => cmd.category === category);
894
+ }
895
+ /**
896
+ * Get all command IDs
897
+ */
898
+ function getAllCommandIds() {
899
+ return Object.keys(exports.GRID3_COMMANDS);
900
+ }
901
+ /**
902
+ * Get all plugin IDs that have commands
903
+ */
904
+ function getAllPluginIds() {
905
+ const plugins = new Set(Object.values(exports.GRID3_COMMANDS).map((cmd) => cmd.pluginId));
906
+ return Array.from(plugins).sort();
907
+ }
908
+ function extractCommandParameters(command) {
909
+ const parameters = {};
910
+ const params = command.Parameter || command.parameter;
911
+ if (!params)
912
+ return parameters;
913
+ const paramArray = Array.isArray(params) ? params : [params];
914
+ for (const param of paramArray) {
915
+ const key = param['@_Key'] || param.Key || param.key;
916
+ let value = param['#text'] ?? param.text ?? param.value;
917
+ if (key && value !== undefined) {
918
+ // Try to convert to number if it looks numeric
919
+ if (typeof value === 'string' && /^\d+$/.test(value)) {
920
+ value = parseInt(value, 10);
921
+ }
922
+ else if (typeof value === 'string' && /^\d+\.\d+$/.test(value)) {
923
+ value = parseFloat(value);
924
+ }
925
+ else if (value === 'true') {
926
+ value = true;
927
+ }
928
+ else if (value === 'false') {
929
+ value = false;
930
+ }
931
+ parameters[key] = value;
932
+ }
933
+ }
934
+ return parameters;
935
+ }
936
+ /**
937
+ * Detect and categorize a command from Grid 3
938
+ */
939
+ function detectCommand(commandObj) {
940
+ const commandId = String(commandObj['@_ID'] || commandObj.ID || commandObj.id || '');
941
+ if (!commandId) {
942
+ return {
943
+ id: 'unknown',
944
+ parameters: {},
945
+ category: 'unknown',
946
+ pluginId: 'unknown',
947
+ };
948
+ }
949
+ const definition = getCommandDefinition(commandId);
950
+ const parameters = extractCommandParameters(commandObj);
951
+ return {
952
+ id: commandId,
953
+ definition,
954
+ parameters,
955
+ category: definition?.category || 'unknown',
956
+ pluginId: definition?.pluginId || 'unknown',
957
+ };
958
+ }