@memberjunction/cli 6.2.0-edge.2 → 6.2.0-edge.3

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 (81) hide show
  1. package/dist/commands/queue/backlog.d.ts +11 -0
  2. package/dist/commands/queue/backlog.d.ts.map +1 -0
  3. package/dist/commands/queue/backlog.js +32 -0
  4. package/dist/commands/queue/backlog.js.map +1 -0
  5. package/dist/commands/queue/dead-letters.d.ts +13 -0
  6. package/dist/commands/queue/dead-letters.d.ts.map +1 -0
  7. package/dist/commands/queue/dead-letters.js +35 -0
  8. package/dist/commands/queue/dead-letters.js.map +1 -0
  9. package/dist/commands/queue/discard.d.ts +12 -0
  10. package/dist/commands/queue/discard.d.ts.map +1 -0
  11. package/dist/commands/queue/discard.js +45 -0
  12. package/dist/commands/queue/discard.js.map +1 -0
  13. package/dist/commands/queue/export-topology.d.ts +12 -0
  14. package/dist/commands/queue/export-topology.d.ts.map +1 -0
  15. package/dist/commands/queue/export-topology.js +40 -0
  16. package/dist/commands/queue/export-topology.js.map +1 -0
  17. package/dist/commands/queue/import-bindings.d.ts +14 -0
  18. package/dist/commands/queue/import-bindings.d.ts.map +1 -0
  19. package/dist/commands/queue/import-bindings.js +41 -0
  20. package/dist/commands/queue/import-bindings.js.map +1 -0
  21. package/dist/commands/queue/index.d.ts +7 -0
  22. package/dist/commands/queue/index.d.ts.map +1 -0
  23. package/dist/commands/queue/index.js +25 -0
  24. package/dist/commands/queue/index.js.map +1 -0
  25. package/dist/commands/queue/partitions.d.ts +14 -0
  26. package/dist/commands/queue/partitions.d.ts.map +1 -0
  27. package/dist/commands/queue/partitions.js +36 -0
  28. package/dist/commands/queue/partitions.js.map +1 -0
  29. package/dist/commands/queue/publish.d.ts +35 -0
  30. package/dist/commands/queue/publish.d.ts.map +1 -0
  31. package/dist/commands/queue/publish.js +94 -0
  32. package/dist/commands/queue/publish.js.map +1 -0
  33. package/dist/commands/queue/replay.d.ts +12 -0
  34. package/dist/commands/queue/replay.d.ts.map +1 -0
  35. package/dist/commands/queue/replay.js +42 -0
  36. package/dist/commands/queue/replay.js.map +1 -0
  37. package/dist/commands/queue/stats.d.ts +11 -0
  38. package/dist/commands/queue/stats.d.ts.map +1 -0
  39. package/dist/commands/queue/stats.js +35 -0
  40. package/dist/commands/queue/stats.js.map +1 -0
  41. package/dist/commands/queue/usage.d.ts +7 -0
  42. package/dist/commands/queue/usage.d.ts.map +1 -0
  43. package/dist/commands/queue/usage.js +10 -0
  44. package/dist/commands/queue/usage.js.map +1 -0
  45. package/dist/commands/queue/validate-bindings.d.ts +12 -0
  46. package/dist/commands/queue/validate-bindings.d.ts.map +1 -0
  47. package/dist/commands/queue/validate-bindings.js +37 -0
  48. package/dist/commands/queue/validate-bindings.js.map +1 -0
  49. package/dist/commands/queue/work.d.ts +20 -0
  50. package/dist/commands/queue/work.d.ts.map +1 -0
  51. package/dist/commands/queue/work.js +77 -0
  52. package/dist/commands/queue/work.js.map +1 -0
  53. package/dist/commands/rubric/evaluate.d.ts +3 -0
  54. package/dist/commands/rubric/evaluate.d.ts.map +1 -1
  55. package/dist/commands/rubric/evaluate.js +9 -2
  56. package/dist/commands/rubric/evaluate.js.map +1 -1
  57. package/dist/hooks/postrun.d.ts +1 -1
  58. package/dist/lib/domain-profiles.d.ts.map +1 -1
  59. package/dist/lib/domain-profiles.js +4 -0
  60. package/dist/lib/domain-profiles.js.map +1 -1
  61. package/dist/lib/work-queue/queue-format.d.ts +17 -0
  62. package/dist/lib/work-queue/queue-format.d.ts.map +1 -0
  63. package/dist/lib/work-queue/queue-format.js +125 -0
  64. package/dist/lib/work-queue/queue-format.js.map +1 -0
  65. package/dist/lib/work-queue/queue-session.d.ts +9 -0
  66. package/dist/lib/work-queue/queue-session.d.ts.map +1 -0
  67. package/dist/lib/work-queue/queue-session.js +8 -0
  68. package/dist/lib/work-queue/queue-session.js.map +1 -0
  69. package/dist/lib/work-queue/queue-worker.d.ts +24 -0
  70. package/dist/lib/work-queue/queue-worker.d.ts.map +1 -0
  71. package/dist/lib/work-queue/queue-worker.js +50 -0
  72. package/dist/lib/work-queue/queue-worker.js.map +1 -0
  73. package/dist/light-commands.d.ts.map +1 -1
  74. package/dist/light-commands.js +3 -0
  75. package/dist/light-commands.js.map +1 -1
  76. package/dist/utils/open-app-context.d.ts +6 -0
  77. package/dist/utils/open-app-context.d.ts.map +1 -1
  78. package/dist/utils/open-app-context.js +3 -3
  79. package/dist/utils/open-app-context.js.map +1 -1
  80. package/oclif.manifest.json +1862 -1180
  81. package/package.json +24 -22
@@ -157,6 +157,101 @@
157
157
  "usage.js"
158
158
  ]
159
159
  },
160
+ "artifacts:reclassify": {
161
+ "aliases": [],
162
+ "args": {},
163
+ "description": "Upgrade-recovery utility for v5.35 artifact unification. Re-evaluates rows whose TypeID is the deleted JSON fallback but whose actual content does not parse as JSON. Normally a no-op: the v5.35 backfill migration handles this automatically. This command is only relevant when the migration ran BEFORE the artifact-type metadata (Generic Text / Generic Binary) was pushed via `mj sync push`, in which case the migration prints a notice telling you to run this. Reports \"no candidates\" once everything is reconciled. Dry-run by default; --apply writes through Record Changes.",
164
+ "examples": [
165
+ "<%= config.bin %> <%= command.id %>",
166
+ "<%= config.bin %> <%= command.id %> --apply --limit 50"
167
+ ],
168
+ "flags": {
169
+ "conversation-id": {
170
+ "description": "Scope to artifacts attached to the given conversation.",
171
+ "name": "conversation-id",
172
+ "hasDynamicHelp": false,
173
+ "multiple": false,
174
+ "type": "option"
175
+ },
176
+ "since": {
177
+ "description": "Scope to artifacts created on/after this ISO date.",
178
+ "name": "since",
179
+ "hasDynamicHelp": false,
180
+ "multiple": false,
181
+ "type": "option"
182
+ },
183
+ "limit": {
184
+ "description": "Maximum number of rows to inspect.",
185
+ "name": "limit",
186
+ "default": 100,
187
+ "hasDynamicHelp": false,
188
+ "multiple": false,
189
+ "type": "option"
190
+ },
191
+ "apply": {
192
+ "description": "Write changes. Without this flag, this command only reports what it would do.",
193
+ "name": "apply",
194
+ "allowNo": false,
195
+ "type": "boolean"
196
+ },
197
+ "verbose": {
198
+ "char": "v",
199
+ "description": "Print every candidate row, not just the summary.",
200
+ "name": "verbose",
201
+ "allowNo": false,
202
+ "type": "boolean"
203
+ }
204
+ },
205
+ "hasDynamicHelp": false,
206
+ "hiddenAliases": [],
207
+ "id": "artifacts:reclassify",
208
+ "pluginAlias": "@memberjunction/cli",
209
+ "pluginName": "@memberjunction/cli",
210
+ "pluginType": "core",
211
+ "strict": true,
212
+ "enableJsonFlag": false,
213
+ "isESM": true,
214
+ "relativePath": [
215
+ "dist",
216
+ "commands",
217
+ "artifacts",
218
+ "reclassify.js"
219
+ ]
220
+ },
221
+ "artifacts:usage": {
222
+ "aliases": [],
223
+ "args": {},
224
+ "description": "Show usage, flags, examples, and runtime hints for every `mj artifacts` command.",
225
+ "flags": {
226
+ "format": {
227
+ "description": "Output format. Defaults to text on a terminal and json when stdout is piped.",
228
+ "name": "format",
229
+ "hasDynamicHelp": false,
230
+ "multiple": false,
231
+ "options": [
232
+ "text",
233
+ "json",
234
+ "md"
235
+ ],
236
+ "type": "option"
237
+ }
238
+ },
239
+ "hasDynamicHelp": false,
240
+ "hiddenAliases": [],
241
+ "id": "artifacts:usage",
242
+ "pluginAlias": "@memberjunction/cli",
243
+ "pluginName": "@memberjunction/cli",
244
+ "pluginType": "core",
245
+ "strict": true,
246
+ "enableJsonFlag": false,
247
+ "isESM": true,
248
+ "relativePath": [
249
+ "dist",
250
+ "commands",
251
+ "artifacts",
252
+ "usage.js"
253
+ ]
254
+ },
160
255
  "app:check-updates": {
161
256
  "aliases": [],
162
257
  "args": {},
@@ -521,101 +616,6 @@
521
616
  "usage.js"
522
617
  ]
523
618
  },
524
- "artifacts:reclassify": {
525
- "aliases": [],
526
- "args": {},
527
- "description": "Upgrade-recovery utility for v5.35 artifact unification. Re-evaluates rows whose TypeID is the deleted JSON fallback but whose actual content does not parse as JSON. Normally a no-op: the v5.35 backfill migration handles this automatically. This command is only relevant when the migration ran BEFORE the artifact-type metadata (Generic Text / Generic Binary) was pushed via `mj sync push`, in which case the migration prints a notice telling you to run this. Reports \"no candidates\" once everything is reconciled. Dry-run by default; --apply writes through Record Changes.",
528
- "examples": [
529
- "<%= config.bin %> <%= command.id %>",
530
- "<%= config.bin %> <%= command.id %> --apply --limit 50"
531
- ],
532
- "flags": {
533
- "conversation-id": {
534
- "description": "Scope to artifacts attached to the given conversation.",
535
- "name": "conversation-id",
536
- "hasDynamicHelp": false,
537
- "multiple": false,
538
- "type": "option"
539
- },
540
- "since": {
541
- "description": "Scope to artifacts created on/after this ISO date.",
542
- "name": "since",
543
- "hasDynamicHelp": false,
544
- "multiple": false,
545
- "type": "option"
546
- },
547
- "limit": {
548
- "description": "Maximum number of rows to inspect.",
549
- "name": "limit",
550
- "default": 100,
551
- "hasDynamicHelp": false,
552
- "multiple": false,
553
- "type": "option"
554
- },
555
- "apply": {
556
- "description": "Write changes. Without this flag, this command only reports what it would do.",
557
- "name": "apply",
558
- "allowNo": false,
559
- "type": "boolean"
560
- },
561
- "verbose": {
562
- "char": "v",
563
- "description": "Print every candidate row, not just the summary.",
564
- "name": "verbose",
565
- "allowNo": false,
566
- "type": "boolean"
567
- }
568
- },
569
- "hasDynamicHelp": false,
570
- "hiddenAliases": [],
571
- "id": "artifacts:reclassify",
572
- "pluginAlias": "@memberjunction/cli",
573
- "pluginName": "@memberjunction/cli",
574
- "pluginType": "core",
575
- "strict": true,
576
- "enableJsonFlag": false,
577
- "isESM": true,
578
- "relativePath": [
579
- "dist",
580
- "commands",
581
- "artifacts",
582
- "reclassify.js"
583
- ]
584
- },
585
- "artifacts:usage": {
586
- "aliases": [],
587
- "args": {},
588
- "description": "Show usage, flags, examples, and runtime hints for every `mj artifacts` command.",
589
- "flags": {
590
- "format": {
591
- "description": "Output format. Defaults to text on a terminal and json when stdout is piped.",
592
- "name": "format",
593
- "hasDynamicHelp": false,
594
- "multiple": false,
595
- "options": [
596
- "text",
597
- "json",
598
- "md"
599
- ],
600
- "type": "option"
601
- }
602
- },
603
- "hasDynamicHelp": false,
604
- "hiddenAliases": [],
605
- "id": "artifacts:usage",
606
- "pluginAlias": "@memberjunction/cli",
607
- "pluginName": "@memberjunction/cli",
608
- "pluginType": "core",
609
- "strict": true,
610
- "enableJsonFlag": false,
611
- "isESM": true,
612
- "relativePath": [
613
- "dist",
614
- "commands",
615
- "artifacts",
616
- "usage.js"
617
- ]
618
- },
619
619
  "baseline:build": {
620
620
  "aliases": [],
621
621
  "args": {},
@@ -1280,68 +1280,38 @@
1280
1280
  "usage.js"
1281
1281
  ]
1282
1282
  },
1283
- "codegen:5-0-fix-entity-names": {
1283
+ "dbdoc:analyze": {
1284
1284
  "aliases": [],
1285
1285
  "args": {},
1286
- "description": "[v5.0 Migration] Scan TypeScript files for entity names AND class names that need updating.\n\nThree strategies are applied:\n 1. Class name renames (regex) — ActionEntity -> MJActionEntity, ActionSchema -> MJActionSchema,\n ActionEntityExtended -> MJActionEntityExtended (extended subclasses),\n ActionEntityServerEntity -> MJActionEntityServer (server subclass suffix standardization),\n ActionFormComponentExtended -> MJActionFormComponentExtended (Angular form components).\n Explicit subclass mappings (57 entries from subclass-rename-map.json) take priority over\n auto-generated suffix rules, enabling suffix changes (e.g., _Server -> Server, ServerEntity -> Server).\n 2. Multi-word entity name renames (regex) — 'AI Models' -> 'MJ: AI Models'\n 3. Single-word entity name renames (AST) — 'Actions' -> 'MJ: Actions' in GetEntityObject, OpenEntityRecord,\n navigateToEntity, EntityName: assignments, .Name === comparisons, @RegisterClass decorators.\n\nThe rename map (272 entity entries + 57 subclass entries) is built from entity_subclasses.ts @RegisterClass\ndecorators plus embedded rename maps. Runs in dry-run mode by default; use --fix to apply.",
1286
+ "description": "Analyze database and generate documentation (delegates to db-auto-doc analyze)",
1287
1287
  "examples": [
1288
- {
1289
- "description": "Dry-run scan of the packages directory",
1290
- "command": "<%= config.bin %> <%= command.id %> --path packages/"
1291
- },
1292
- {
1293
- "description": "Scan a single file",
1294
- "command": "<%= config.bin %> <%= command.id %> --path packages/Angular/Explorer/dashboards/src/Actions/components/actions-overview.component.ts"
1295
- },
1296
- {
1297
- "description": "Apply fixes across the codebase",
1298
- "command": "<%= config.bin %> <%= command.id %> --path packages/ --fix"
1299
- },
1300
- {
1301
- "description": "Quiet mode (summary only)",
1302
- "command": "<%= config.bin %> <%= command.id %> --path packages/ -q"
1303
- }
1288
+ "<%= config.bin %> <%= command.id %>",
1289
+ "<%= config.bin %> <%= command.id %> --resume ./output/run-6/state.json",
1290
+ "<%= config.bin %> <%= command.id %> --config ./my-config.json"
1304
1291
  ],
1305
1292
  "flags": {
1306
- "path": {
1307
- "char": "p",
1308
- "description": "File or directory to scan. Accepts a single .ts file or a directory (scanned recursively). Defaults to the current working directory.",
1309
- "name": "path",
1293
+ "resume": {
1294
+ "char": "r",
1295
+ "description": "Resume from an existing state file",
1296
+ "name": "resume",
1297
+ "required": false,
1310
1298
  "hasDynamicHelp": false,
1311
1299
  "multiple": false,
1312
1300
  "type": "option"
1313
1301
  },
1314
- "fix": {
1315
- "description": "Apply fixes in place. Without this flag, the command runs in dry-run mode and only reports findings.",
1316
- "name": "fix",
1317
- "allowNo": false,
1318
- "type": "boolean"
1319
- },
1320
- "entity-subclasses": {
1321
- "description": "Explicit path to entity_subclasses.ts for building the rename map. If omitted, the tool searches common locations relative to the target path.",
1322
- "name": "entity-subclasses",
1302
+ "config": {
1303
+ "char": "c",
1304
+ "description": "Path to config file",
1305
+ "name": "config",
1306
+ "default": "./config.json",
1323
1307
  "hasDynamicHelp": false,
1324
1308
  "multiple": false,
1325
1309
  "type": "option"
1326
- },
1327
- "quiet": {
1328
- "char": "q",
1329
- "description": "Suppress detailed per-file output; only show the final summary counts.",
1330
- "name": "quiet",
1331
- "allowNo": false,
1332
- "type": "boolean"
1333
- },
1334
- "verbose": {
1335
- "char": "v",
1336
- "description": "Show detailed progress including each file being scanned.",
1337
- "name": "verbose",
1338
- "allowNo": false,
1339
- "type": "boolean"
1340
1310
  }
1341
1311
  },
1342
1312
  "hasDynamicHelp": false,
1343
1313
  "hiddenAliases": [],
1344
- "id": "codegen:5-0-fix-entity-names",
1314
+ "id": "dbdoc:analyze",
1345
1315
  "pluginAlias": "@memberjunction/cli",
1346
1316
  "pluginName": "@memberjunction/cli",
1347
1317
  "pluginType": "core",
@@ -1351,147 +1321,105 @@
1351
1321
  "relativePath": [
1352
1322
  "dist",
1353
1323
  "commands",
1354
- "codegen",
1355
- "5-0-fix-entity-names.js"
1324
+ "dbdoc",
1325
+ "analyze.js"
1356
1326
  ]
1357
1327
  },
1358
- "codegen:5-0-fix-html-entity-names": {
1328
+ "dbdoc:export-sample-queries": {
1359
1329
  "aliases": [],
1360
1330
  "args": {},
1361
- "description": "[v5.0 Migration] Scan Angular HTML template files for hardcoded entity names that need \"MJ: \" prefix updates.\n\nUses targeted regex patterns to find entity name references in template expressions\nand attribute values. Detects method calls like navigateToEntity('Actions'),\nOpenEntityRecord('Entities', id), and attribute values like RowsEntityName=\"Users\".\nRuns in dry-run mode by default; use --fix to apply.\n\nThe rename map is built dynamically from entity_subclasses.ts by parsing all\n@RegisterClass(BaseEntity, 'MJ: XYZ') decorators (~272 entries).",
1331
+ "description": "Export sample queries to MemberJunction metadata format (delegates to db-auto-doc export-sample-queries)",
1362
1332
  "examples": [
1363
- {
1364
- "description": "Dry-run scan of Angular templates",
1365
- "command": "<%= config.bin %> <%= command.id %> --path packages/Angular/"
1366
- },
1367
- {
1368
- "description": "Apply fixes to HTML templates",
1369
- "command": "<%= config.bin %> <%= command.id %> --path packages/Angular/ --fix"
1370
- },
1371
- {
1372
- "description": "Scan with verbose output",
1373
- "command": "<%= config.bin %> <%= command.id %> --path packages/ -v"
1374
- },
1375
- {
1376
- "description": "Scan a single template file",
1377
- "command": "<%= config.bin %> <%= command.id %> --path packages/Angular/Explorer/dashboards/src/Actions/actions-dashboard.component.html"
1378
- }
1333
+ "<%= config.bin %> <%= command.id %> --input ./output/sample-queries.json --output ./metadata/queries/.queries.json",
1334
+ "<%= config.bin %> <%= command.id %> --input ./sample-queries.json --output ./metadata/queries/.queries.json --separate-sql-files",
1335
+ "<%= config.bin %> <%= command.id %> --input ./sample-queries.json --output ./queries/.queries.json --category \"Database Documentation\"",
1336
+ "<%= config.bin %> <%= command.id %> --input ./sample-queries.json --output ./queries/.queries.json --status Pending --min-confidence 0.8"
1379
1337
  ],
1380
1338
  "flags": {
1381
- "path": {
1382
- "char": "p",
1383
- "description": "File or directory to scan. Accepts a single .html file or a directory (scanned recursively). Defaults to the current working directory.",
1384
- "name": "path",
1339
+ "input": {
1340
+ "char": "i",
1341
+ "description": "Path to sample-queries.json file generated by generate-queries command",
1342
+ "name": "input",
1343
+ "required": true,
1385
1344
  "hasDynamicHelp": false,
1386
1345
  "multiple": false,
1387
1346
  "type": "option"
1388
1347
  },
1389
- "fix": {
1390
- "description": "Apply fixes in place. Without this flag, the command runs in dry-run mode and only reports findings.",
1391
- "name": "fix",
1392
- "allowNo": false,
1393
- "type": "boolean"
1394
- },
1395
- "entity-subclasses": {
1396
- "description": "Explicit path to entity_subclasses.ts for building the rename map. If omitted, the tool searches common locations relative to the target path.",
1397
- "name": "entity-subclasses",
1348
+ "output": {
1349
+ "char": "o",
1350
+ "description": "Output path for the .queries.json metadata file",
1351
+ "name": "output",
1352
+ "required": true,
1398
1353
  "hasDynamicHelp": false,
1399
1354
  "multiple": false,
1400
1355
  "type": "option"
1401
1356
  },
1402
- "quiet": {
1403
- "char": "q",
1404
- "description": "Suppress detailed per-file output; only show the final summary counts.",
1405
- "name": "quiet",
1406
- "allowNo": false,
1407
- "type": "boolean"
1408
- },
1409
- "verbose": {
1410
- "char": "v",
1411
- "description": "Show detailed progress including each file being scanned.",
1412
- "name": "verbose",
1357
+ "separate-sql-files": {
1358
+ "description": "Write SQL to separate files and use @file: references",
1359
+ "name": "separate-sql-files",
1413
1360
  "allowNo": false,
1414
1361
  "type": "boolean"
1415
- }
1416
- },
1417
- "hasDynamicHelp": false,
1418
- "hiddenAliases": [],
1419
- "id": "codegen:5-0-fix-html-entity-names",
1420
- "pluginAlias": "@memberjunction/cli",
1421
- "pluginName": "@memberjunction/cli",
1422
- "pluginType": "core",
1423
- "strict": true,
1424
- "enableJsonFlag": false,
1425
- "isESM": true,
1426
- "relativePath": [
1427
- "dist",
1428
- "commands",
1429
- "codegen",
1430
- "5-0-fix-html-entity-names.js"
1431
- ]
1432
- },
1433
- "codegen:5-0-fix-metadata-names": {
1434
- "aliases": [],
1435
- "args": {},
1436
- "description": "[v5.0 Migration] Scan metadata JSON files for entity names that need \"MJ: \" prefix updates.\n\nTargets the metadata/ directory used by \"mj sync\". Detects entity name references in\n@lookup: directives (both the entity name and lookup value), .mj-sync.json and\n.mj-folder.json config files (entity/entityName fields), relatedEntities object keys,\nand fields.Name values in Entities-managing folders. Runs in dry-run mode by default;\nuse --fix to apply.\n\nThe rename map is built dynamically from entity_subclasses.ts by parsing all\n@RegisterClass(BaseEntity, 'MJ: XYZ') decorators (~272 entries).",
1437
- "examples": [
1438
- {
1439
- "description": "Dry-run scan of the metadata directory",
1440
- "command": "<%= config.bin %> <%= command.id %> --path metadata/"
1441
- },
1442
- {
1443
- "description": "Apply fixes to metadata files",
1444
- "command": "<%= config.bin %> <%= command.id %> --path metadata/ --fix"
1445
1362
  },
1446
- {
1447
- "description": "Scan a specific subdirectory",
1448
- "command": "<%= config.bin %> <%= command.id %> --path metadata/resource-types"
1363
+ "sql-dir": {
1364
+ "description": "Directory for SQL files when using --separate-sql-files (relative to output file)",
1365
+ "name": "sql-dir",
1366
+ "default": "SQL",
1367
+ "hasDynamicHelp": false,
1368
+ "multiple": false,
1369
+ "type": "option"
1449
1370
  },
1450
- {
1451
- "description": "Scan and fix a single metadata file",
1452
- "command": "<%= config.bin %> <%= command.id %> --path metadata/entities/.audit-related-entities.json --fix"
1453
- }
1454
- ],
1455
- "flags": {
1456
- "path": {
1457
- "char": "p",
1458
- "description": "File or directory to scan. Accepts a single .json file or a directory (scanned recursively, including dotfiles like .mj-sync.json). Defaults to the current working directory.",
1459
- "name": "path",
1371
+ "category": {
1372
+ "description": "Category name for @lookup reference (e.g., \"Database Documentation\")",
1373
+ "name": "category",
1374
+ "required": false,
1460
1375
  "hasDynamicHelp": false,
1461
1376
  "multiple": false,
1462
1377
  "type": "option"
1463
1378
  },
1464
- "fix": {
1465
- "description": "Apply fixes in place. Without this flag, the command runs in dry-run mode and only reports findings.",
1466
- "name": "fix",
1467
- "allowNo": false,
1468
- "type": "boolean"
1379
+ "status": {
1380
+ "description": "Status to assign to exported queries",
1381
+ "name": "status",
1382
+ "default": "Pending",
1383
+ "hasDynamicHelp": false,
1384
+ "multiple": false,
1385
+ "options": [
1386
+ "Approved",
1387
+ "Pending",
1388
+ "Rejected",
1389
+ "Expired"
1390
+ ],
1391
+ "type": "option"
1469
1392
  },
1470
- "entity-subclasses": {
1471
- "description": "Explicit path to entity_subclasses.ts for building the rename map. If omitted, the tool searches common locations relative to the target path.",
1472
- "name": "entity-subclasses",
1393
+ "min-confidence": {
1394
+ "description": "Minimum confidence threshold to export (0-1)",
1395
+ "name": "min-confidence",
1396
+ "default": "0",
1473
1397
  "hasDynamicHelp": false,
1474
1398
  "multiple": false,
1475
1399
  "type": "option"
1476
1400
  },
1477
- "quiet": {
1478
- "char": "q",
1479
- "description": "Suppress detailed per-file output; only show the final summary counts.",
1480
- "name": "quiet",
1401
+ "validated-only": {
1402
+ "description": "Only export queries that were successfully validated",
1403
+ "name": "validated-only",
1481
1404
  "allowNo": false,
1482
1405
  "type": "boolean"
1483
1406
  },
1484
- "verbose": {
1485
- "char": "v",
1486
- "description": "Show detailed progress including each file being scanned.",
1487
- "name": "verbose",
1407
+ "append": {
1408
+ "description": "Append to existing metadata file instead of overwriting",
1409
+ "name": "append",
1410
+ "allowNo": false,
1411
+ "type": "boolean"
1412
+ },
1413
+ "include-primary-key": {
1414
+ "description": "Include primaryKey and sync fields (for updating existing records)",
1415
+ "name": "include-primary-key",
1488
1416
  "allowNo": false,
1489
1417
  "type": "boolean"
1490
1418
  }
1491
1419
  },
1492
1420
  "hasDynamicHelp": false,
1493
1421
  "hiddenAliases": [],
1494
- "id": "codegen:5-0-fix-metadata-names",
1422
+ "id": "dbdoc:export-sample-queries",
1495
1423
  "pluginAlias": "@memberjunction/cli",
1496
1424
  "pluginName": "@memberjunction/cli",
1497
1425
  "pluginType": "core",
@@ -1501,290 +1429,281 @@
1501
1429
  "relativePath": [
1502
1430
  "dist",
1503
1431
  "commands",
1504
- "codegen",
1505
- "5-0-fix-metadata-names.js"
1432
+ "dbdoc",
1433
+ "export-sample-queries.js"
1506
1434
  ]
1507
1435
  },
1508
- "codegen": {
1436
+ "dbdoc:export": {
1509
1437
  "aliases": [],
1510
1438
  "args": {},
1511
- "description": "Run the full MemberJunction code generation pipeline.\n\nAnalyzes your database schema, updates MemberJunction metadata, and generates\nsynchronized code across the stack: SQL objects, TypeScript entities, Angular\nforms, GraphQL resolvers, Action subclasses, and DB schema JSON.\n\nUse --skipdb to regenerate code from existing metadata only; --skipfiles to run\ndatabase-side operations only. --force-advanced-gen re-runs the LLM-driven\nadvanced generation for ALL entities (bypasses changed-entity scoping).",
1439
+ "description": "Export documentation in multiple formats (delegates to db-auto-doc export)",
1440
+ "examples": [
1441
+ "<%= config.bin %> <%= command.id %> --state-file=./db-doc-state.json",
1442
+ "<%= config.bin %> <%= command.id %> --sql",
1443
+ "<%= config.bin %> <%= command.id %> --markdown",
1444
+ "<%= config.bin %> <%= command.id %> --html",
1445
+ "<%= config.bin %> <%= command.id %> --csv",
1446
+ "<%= config.bin %> <%= command.id %> --mermaid",
1447
+ "<%= config.bin %> <%= command.id %> --sql --markdown --html --csv --mermaid --apply"
1448
+ ],
1512
1449
  "flags": {
1513
- "format": {
1514
- "description": "Output format: text (human), json (machine-readable), md (Markdown-fenced). Defaults to text on a terminal and json when stdout is piped.",
1515
- "name": "format",
1450
+ "state-file": {
1451
+ "char": "s",
1452
+ "description": "Path to state JSON file",
1453
+ "name": "state-file",
1516
1454
  "hasDynamicHelp": false,
1517
1455
  "multiple": false,
1518
- "options": [
1519
- "text",
1520
- "json",
1521
- "md",
1522
- "human",
1523
- "console",
1524
- "markdown"
1525
- ],
1526
1456
  "type": "option"
1527
1457
  },
1528
- "verbose": {
1529
- "char": "v",
1530
- "description": "Show detailed output",
1531
- "name": "verbose",
1458
+ "output-dir": {
1459
+ "char": "o",
1460
+ "description": "Output directory for generated files",
1461
+ "name": "output-dir",
1462
+ "hasDynamicHelp": false,
1463
+ "multiple": false,
1464
+ "type": "option"
1465
+ },
1466
+ "sql": {
1467
+ "description": "Generate SQL script",
1468
+ "name": "sql",
1532
1469
  "allowNo": false,
1533
1470
  "type": "boolean"
1534
1471
  },
1535
- "no-banner": {
1536
- "description": "Suppress the startup banner and runtime advisory",
1537
- "name": "no-banner",
1472
+ "markdown": {
1473
+ "description": "Generate Markdown documentation",
1474
+ "name": "markdown",
1538
1475
  "allowNo": false,
1539
1476
  "type": "boolean"
1540
1477
  },
1541
- "no-app-packages": {
1542
- "description": "Do not load installed Open App server packages (or the host's generated packages) for this run, so records are written with the generic BaseEntity — no custom Save() logic or lifecycle hooks.",
1543
- "name": "no-app-packages",
1478
+ "html": {
1479
+ "description": "Generate interactive HTML documentation",
1480
+ "name": "html",
1544
1481
  "allowNo": false,
1545
1482
  "type": "boolean"
1546
1483
  },
1547
- "interactive": {
1548
- "description": "Allow interactive prompts. Defaults to on at a terminal and off when piped, spawned, or in CI, so an agent never hangs on a question. Use --no-interactive to force it off.",
1549
- "name": "interactive",
1550
- "allowNo": true,
1484
+ "csv": {
1485
+ "description": "Generate CSV exports (tables and columns)",
1486
+ "name": "csv",
1487
+ "allowNo": false,
1551
1488
  "type": "boolean"
1552
1489
  },
1553
- "skipdb": {
1554
- "description": "Skip database operations. Only regenerate TypeScript entities, Angular components, and GraphQL resolvers from existing metadata.",
1555
- "name": "skipdb",
1490
+ "mermaid": {
1491
+ "description": "Generate Mermaid ERD diagram files",
1492
+ "name": "mermaid",
1556
1493
  "allowNo": false,
1557
1494
  "type": "boolean"
1558
1495
  },
1559
- "skipfiles": {
1560
- "description": "Skip file-generation operations. Only run database-side operations (metadata sync, SQL object generation).",
1561
- "name": "skipfiles",
1496
+ "report": {
1497
+ "description": "Generate analysis report",
1498
+ "name": "report",
1562
1499
  "allowNo": false,
1563
1500
  "type": "boolean"
1564
1501
  },
1565
- "force-advanced-gen": {
1566
- "description": "Bypass entity scoping in Pass 2 and force advanced generation to re-run for all entities.",
1567
- "name": "force-advanced-gen",
1502
+ "apply": {
1503
+ "description": "Apply SQL to database",
1504
+ "name": "apply",
1568
1505
  "allowNo": false,
1569
1506
  "type": "boolean"
1570
1507
  },
1571
- "no-ai": {
1572
- "description": "Disable AI-driven advanced generation (descriptions, categories, search ranking). Overrides config and credential checks. Can also be set with MJ_CODEGEN_NO_AI=1.",
1573
- "name": "no-ai",
1508
+ "approved-only": {
1509
+ "description": "Only export approved items",
1510
+ "name": "approved-only",
1574
1511
  "allowNo": false,
1575
1512
  "type": "boolean"
1576
1513
  },
1577
- "sql-output-dir": {
1578
- "description": "Directory for CodeGen_Run_*.sql (EntityField INSERTs and other metadata SQL). Open Apps default to ./migrations/codegen. Do not point this at MJ/migrations/v*.",
1579
- "name": "sql-output-dir",
1514
+ "confidence-threshold": {
1515
+ "description": "Minimum confidence threshold",
1516
+ "name": "confidence-threshold",
1517
+ "default": "0",
1580
1518
  "hasDynamicHelp": false,
1581
1519
  "multiple": false,
1582
1520
  "type": "option"
1583
- },
1584
- "skip-commands": {
1585
- "description": "Skip running BEFORE and AFTER shell commands configured in mj.config. Can also be set with MJ_CODEGEN_SKIP_COMMANDS=1.",
1586
- "name": "skip-commands",
1587
- "allowNo": false,
1588
- "type": "boolean"
1589
1521
  }
1590
1522
  },
1591
1523
  "hasDynamicHelp": false,
1592
1524
  "hiddenAliases": [],
1593
- "id": "codegen",
1525
+ "id": "dbdoc:export",
1594
1526
  "pluginAlias": "@memberjunction/cli",
1595
1527
  "pluginName": "@memberjunction/cli",
1596
1528
  "pluginType": "core",
1597
1529
  "strict": true,
1598
1530
  "enableJsonFlag": false,
1599
- "Examples": [
1600
- {
1601
- "command": "<%= config.bin %> <%= command.id %>",
1602
- "description": "Run the full code generation pipeline"
1603
- },
1604
- {
1605
- "command": "<%= config.bin %> <%= command.id %> --skipdb",
1606
- "description": "Regenerate code files without touching the database"
1607
- },
1608
- {
1609
- "command": "<%= config.bin %> <%= command.id %> --format=json",
1610
- "description": "Emit a machine-readable result for an agent"
1611
- }
1612
- ],
1613
- "Usage": {
1614
- "domain": "codegen",
1615
- "command": "codegen",
1616
- "summary": "Regenerate entities, SQL, and Angular forms from the database schema.",
1617
- "description": "Runs the full CodeGen pipeline. Scales with entity count — a full run is far slower than a single-entity change. Use --skipdb/--skipfiles to run only one half.",
1618
- "flags": [
1619
- {
1620
- "name": "--skipdb",
1621
- "type": "boolean",
1622
- "description": "Regenerate code from existing metadata only (no DB operations)"
1623
- },
1624
- {
1625
- "name": "--skipfiles",
1626
- "type": "boolean",
1627
- "description": "Run DB-side operations only (no code files)"
1628
- },
1629
- {
1630
- "name": "--force-advanced-gen",
1631
- "type": "boolean",
1632
- "description": "Re-run advanced generation for all entities"
1633
- },
1634
- {
1635
- "name": "--no-ai",
1636
- "type": "boolean",
1637
- "description": "Disable AI-driven advanced generation (same as MJ_CODEGEN_NO_AI=1)"
1638
- },
1639
- {
1640
- "name": "--skip-commands",
1641
- "type": "boolean",
1642
- "description": "Skip running BEFORE/AFTER commands (same as MJ_CODEGEN_SKIP_COMMANDS=1)"
1643
- },
1644
- {
1645
- "name": "--sql-output-dir",
1646
- "type": "string",
1647
- "description": "Directory for CodeGen_Run metadata SQL (Open Apps: ./migrations/codegen)"
1648
- },
1649
- {
1650
- "name": "--format",
1651
- "type": "text|json|md",
1652
- "description": "Output format (json for machine-readable result)"
1653
- }
1654
- ],
1655
- "examples": [
1656
- "mj codegen",
1657
- "mj codegen --skipdb",
1658
- "mj codegen --skip-commands",
1659
- "mj codegen --format=json"
1660
- ],
1661
- "runtime": {
1662
- "class": "slow",
1663
- "typicalSeconds": 45,
1664
- "note": "scales with entity count; full run far slower than a single-entity change"
1665
- }
1666
- },
1667
1531
  "isESM": true,
1668
1532
  "relativePath": [
1669
1533
  "dist",
1670
1534
  "commands",
1671
- "codegen",
1672
- "index.js"
1535
+ "dbdoc",
1536
+ "export.js"
1673
1537
  ]
1674
1538
  },
1675
- "codegen:manifest": {
1539
+ "dbdoc:generate-queries": {
1676
1540
  "aliases": [],
1677
1541
  "args": {},
1678
- "description": "Generate a class registration manifest to prevent tree-shaking.\n\nMemberJunction uses @RegisterClass decorators with a dynamic class factory.\nModern bundlers (ESBuild, Vite) cannot detect dynamic instantiation and will\ntree-shake these classes out of production builds. This command scans the\ndependency tree for all @RegisterClass-decorated classes and emits a manifest\nfile with static imports that the bundler cannot eliminate.\n\nTypically used as a prebuild/prestart script for MJAPI and MJExplorer. For\nMJ distribution users, pre-built manifests ship inside @memberjunction/server-bootstrap\nand @memberjunction/ng-bootstrap -- use --exclude-packages @memberjunction to\ngenerate a supplemental manifest covering only your own application classes.",
1542
+ "description": "Generate sample SQL queries from existing analysis state (delegates to db-auto-doc generate-queries)",
1679
1543
  "examples": [
1680
- {
1681
- "command": "<%= config.bin %> <%= command.id %>",
1682
- "description": "Generate manifest with default output path"
1683
- },
1684
- {
1685
- "command": "<%= config.bin %> <%= command.id %> --appDir ./packages/MJAPI --output ./packages/MJAPI/src/generated/class-registrations-manifest.ts",
1686
- "description": "Generate manifest for a specific application directory"
1687
- },
1688
- {
1689
- "command": "<%= config.bin %> <%= command.id %> --exclude-packages @memberjunction",
1690
- "description": "Exclude MJ packages (use pre-built bootstrap manifests instead)"
1691
- },
1692
- {
1693
- "command": "<%= config.bin %> <%= command.id %> --exclude-packages @memberjunction --no-sync-deps",
1694
- "description": "Exclude MJ packages and skip dependency reconciliation"
1695
- },
1696
- {
1697
- "command": "<%= config.bin %> <%= command.id %> --filter BaseEngine --filter BaseAction --verbose",
1698
- "description": "Only include specific base classes with detailed progress"
1699
- },
1700
- {
1701
- "command": "<%= config.bin %> <%= command.id %> --scan-dist",
1702
- "description": "Include dist/ scanning for npm-published packages without src/"
1703
- }
1544
+ "<%= config.bin %> <%= command.id %> --from-state ./output/run-1/state.json",
1545
+ "<%= config.bin %> <%= command.id %> --from-state ./output/run-1/state.json --output-dir ./queries",
1546
+ "<%= config.bin %> <%= command.id %> --from-state ./output/run-1/state.json --queries-per-table 10"
1704
1547
  ],
1705
1548
  "flags": {
1706
- "output": {
1707
- "char": "o",
1708
- "description": "Output file path for the generated manifest. The file will contain named imports and a CLASS_REGISTRATIONS array.",
1709
- "name": "output",
1710
- "default": "./src/generated/class-registrations-manifest.ts",
1549
+ "from-state": {
1550
+ "description": "Path to existing state.json file from previous analysis",
1551
+ "name": "from-state",
1552
+ "required": true,
1711
1553
  "hasDynamicHelp": false,
1712
1554
  "multiple": false,
1713
1555
  "type": "option"
1714
1556
  },
1715
- "appDir": {
1716
- "char": "a",
1717
- "description": "Root directory of the application whose package.json dependency tree will be scanned. Defaults to the current working directory.",
1718
- "name": "appDir",
1557
+ "output-dir": {
1558
+ "description": "Output directory for generated queries",
1559
+ "name": "output-dir",
1560
+ "required": false,
1719
1561
  "hasDynamicHelp": false,
1720
1562
  "multiple": false,
1721
1563
  "type": "option"
1722
1564
  },
1723
- "filter": {
1724
- "char": "f",
1725
- "description": "Only include classes extending this base class. Can be repeated (e.g., --filter BaseEngine --filter BaseAction).",
1726
- "name": "filter",
1565
+ "config": {
1566
+ "char": "c",
1567
+ "description": "Path to config file (for database connection and AI settings)",
1568
+ "name": "config",
1569
+ "default": "./config.json",
1727
1570
  "hasDynamicHelp": false,
1728
- "multiple": true,
1571
+ "multiple": false,
1729
1572
  "type": "option"
1730
1573
  },
1731
- "exclude-packages": {
1732
- "char": "e",
1733
- "description": "Skip packages whose name starts with this prefix. Useful for excluding @memberjunction packages when using pre-built bootstrap manifests. Can be repeated.",
1734
- "name": "exclude-packages",
1574
+ "queries-per-table": {
1575
+ "description": "Number of queries to generate per table",
1576
+ "name": "queries-per-table",
1577
+ "required": false,
1735
1578
  "hasDynamicHelp": false,
1736
- "multiple": true,
1579
+ "multiple": false,
1737
1580
  "type": "option"
1738
1581
  },
1739
- "no-sync-deps": {
1740
- "description": "Skip automatic dependency reconciliation. By default, the manifest generator adds any manifest-imported packages that are missing from package.json dependencies. Use this flag when generating supplemental manifests with --exclude-packages, where excluded packages are already covered by a pre-built bootstrap manifest.",
1741
- "name": "no-sync-deps",
1742
- "allowNo": false,
1743
- "type": "boolean"
1744
- },
1745
- "quiet": {
1746
- "char": "q",
1747
- "description": "Suppress all output except errors.",
1748
- "name": "quiet",
1749
- "allowNo": false,
1750
- "type": "boolean"
1751
- },
1752
- "verbose": {
1753
- "char": "v",
1754
- "description": "Show detailed progress including per-package scanning info and skipped classes.",
1755
- "name": "verbose",
1756
- "allowNo": false,
1757
- "type": "boolean"
1758
- },
1759
- "scan-dist": {
1760
- "description": "Scan compiled JavaScript files in dist/ directories for packages without src/. Use this when your dependency tree includes npm-published packages that contain @RegisterClass decorators. Without this flag, only TypeScript source in src/ is scanned.",
1761
- "name": "scan-dist",
1582
+ "max-execution-time": {
1583
+ "description": "Maximum execution time for query validation (ms)",
1584
+ "name": "max-execution-time",
1585
+ "required": false,
1586
+ "hasDynamicHelp": false,
1587
+ "multiple": false,
1588
+ "type": "option"
1589
+ }
1590
+ },
1591
+ "hasDynamicHelp": false,
1592
+ "hiddenAliases": [],
1593
+ "id": "dbdoc:generate-queries",
1594
+ "pluginAlias": "@memberjunction/cli",
1595
+ "pluginName": "@memberjunction/cli",
1596
+ "pluginType": "core",
1597
+ "strict": true,
1598
+ "enableJsonFlag": false,
1599
+ "isESM": true,
1600
+ "relativePath": [
1601
+ "dist",
1602
+ "commands",
1603
+ "dbdoc",
1604
+ "generate-queries.js"
1605
+ ]
1606
+ },
1607
+ "dbdoc": {
1608
+ "aliases": [],
1609
+ "args": {},
1610
+ "description": "AI-powered database documentation generator",
1611
+ "flags": {},
1612
+ "hasDynamicHelp": false,
1613
+ "hidden": false,
1614
+ "hiddenAliases": [],
1615
+ "id": "dbdoc",
1616
+ "pluginAlias": "@memberjunction/cli",
1617
+ "pluginName": "@memberjunction/cli",
1618
+ "pluginType": "core",
1619
+ "strict": true,
1620
+ "enableJsonFlag": false,
1621
+ "isESM": true,
1622
+ "relativePath": [
1623
+ "dist",
1624
+ "commands",
1625
+ "dbdoc",
1626
+ "index.js"
1627
+ ]
1628
+ },
1629
+ "dbdoc:init": {
1630
+ "aliases": [],
1631
+ "args": {},
1632
+ "description": "Initialize DBAutoDoc project (delegates to db-auto-doc init)",
1633
+ "examples": [
1634
+ "<%= config.bin %> <%= command.id %>"
1635
+ ],
1636
+ "flags": {},
1637
+ "hasDynamicHelp": false,
1638
+ "hiddenAliases": [],
1639
+ "id": "dbdoc:init",
1640
+ "pluginAlias": "@memberjunction/cli",
1641
+ "pluginName": "@memberjunction/cli",
1642
+ "pluginType": "core",
1643
+ "strict": true,
1644
+ "enableJsonFlag": false,
1645
+ "isESM": true,
1646
+ "relativePath": [
1647
+ "dist",
1648
+ "commands",
1649
+ "dbdoc",
1650
+ "init.js"
1651
+ ]
1652
+ },
1653
+ "dbdoc:reset": {
1654
+ "aliases": [],
1655
+ "args": {},
1656
+ "description": "Reset analysis state (delegates to db-auto-doc reset)",
1657
+ "examples": [
1658
+ "<%= config.bin %> <%= command.id %>",
1659
+ "<%= config.bin %> <%= command.id %> --force"
1660
+ ],
1661
+ "flags": {
1662
+ "force": {
1663
+ "char": "f",
1664
+ "description": "Force reset without confirmation",
1665
+ "name": "force",
1762
1666
  "allowNo": false,
1763
1667
  "type": "boolean"
1764
- },
1765
- "lazy-config": {
1766
- "description": "Output path for a generated lazy-loading feature config file. Maps @RegisterClass keys from excluded packages to dynamic import() loaders based on package.json subpath exports. Only packages with subpath exports in their package.json are included. Requires --exclude-packages.",
1767
- "name": "lazy-config",
1668
+ }
1669
+ },
1670
+ "hasDynamicHelp": false,
1671
+ "hiddenAliases": [],
1672
+ "id": "dbdoc:reset",
1673
+ "pluginAlias": "@memberjunction/cli",
1674
+ "pluginName": "@memberjunction/cli",
1675
+ "pluginType": "core",
1676
+ "strict": true,
1677
+ "enableJsonFlag": false,
1678
+ "isESM": true,
1679
+ "relativePath": [
1680
+ "dist",
1681
+ "commands",
1682
+ "dbdoc",
1683
+ "reset.js"
1684
+ ]
1685
+ },
1686
+ "dbdoc:status": {
1687
+ "aliases": [],
1688
+ "args": {},
1689
+ "description": "Show analysis status and progress (delegates to db-auto-doc status)",
1690
+ "examples": [
1691
+ "<%= config.bin %> <%= command.id %>",
1692
+ "<%= config.bin %> <%= command.id %> --state-file ./custom-state.json"
1693
+ ],
1694
+ "flags": {
1695
+ "state-file": {
1696
+ "char": "s",
1697
+ "description": "Path to state JSON file",
1698
+ "name": "state-file",
1768
1699
  "hasDynamicHelp": false,
1769
1700
  "multiple": false,
1770
1701
  "type": "option"
1771
- },
1772
- "strict": {
1773
- "description": "Treat coverage audit gaps as fatal errors. A gap is a @RegisterClass class in an excluded package that is not reachable from any lazy chunk subpath export. Use in CI to catch tree-shaking issues before merge.",
1774
- "name": "strict",
1775
- "allowNo": false,
1776
- "type": "boolean"
1777
- },
1778
- "open-app-client-bootstrap": {
1779
- "description": "After generating the manifest, append a managed block of side-effect imports — one per Open App client package recorded in mj.config `dynamicPackages.client` — so installed apps' client classes register when the client bundle loads. Used by MJExplorer's prebuild; requires --output.",
1780
- "name": "open-app-client-bootstrap",
1781
- "allowNo": false,
1782
- "type": "boolean"
1783
1702
  }
1784
1703
  },
1785
1704
  "hasDynamicHelp": false,
1786
1705
  "hiddenAliases": [],
1787
- "id": "codegen:manifest",
1706
+ "id": "dbdoc:status",
1788
1707
  "pluginAlias": "@memberjunction/cli",
1789
1708
  "pluginName": "@memberjunction/cli",
1790
1709
  "pluginType": "core",
@@ -1794,14 +1713,14 @@
1794
1713
  "relativePath": [
1795
1714
  "dist",
1796
1715
  "commands",
1797
- "codegen",
1798
- "manifest.js"
1716
+ "dbdoc",
1717
+ "status.js"
1799
1718
  ]
1800
1719
  },
1801
- "codegen:usage": {
1720
+ "dbdoc:usage": {
1802
1721
  "aliases": [],
1803
1722
  "args": {},
1804
- "description": "Show usage, flags, examples, and runtime hints for `mj codegen`.",
1723
+ "description": "Show usage, flags, examples, and runtime hints for every `mj dbdoc` command.",
1805
1724
  "flags": {
1806
1725
  "format": {
1807
1726
  "description": "Output format. Defaults to text on a terminal and json when stdout is piped.",
@@ -1818,7 +1737,7 @@
1818
1737
  },
1819
1738
  "hasDynamicHelp": false,
1820
1739
  "hiddenAliases": [],
1821
- "id": "codegen:usage",
1740
+ "id": "dbdoc:usage",
1822
1741
  "pluginAlias": "@memberjunction/cli",
1823
1742
  "pluginName": "@memberjunction/cli",
1824
1743
  "pluginType": "core",
@@ -1828,7 +1747,7 @@
1828
1747
  "relativePath": [
1829
1748
  "dist",
1830
1749
  "commands",
1831
- "codegen",
1750
+ "dbdoc",
1832
1751
  "usage.js"
1833
1752
  ]
1834
1753
  },
@@ -2491,16 +2410,242 @@
2491
2410
  "multiple": false,
2492
2411
  "type": "option"
2493
2412
  },
2494
- "check-connection": {
2495
- "description": "Verify the database connection (including TLS) and exit without migrating",
2496
- "name": "check-connection",
2413
+ "check-connection": {
2414
+ "description": "Verify the database connection (including TLS) and exit without migrating",
2415
+ "name": "check-connection",
2416
+ "allowNo": false,
2417
+ "type": "boolean"
2418
+ }
2419
+ },
2420
+ "hasDynamicHelp": false,
2421
+ "hiddenAliases": [],
2422
+ "id": "migrate",
2423
+ "pluginAlias": "@memberjunction/cli",
2424
+ "pluginName": "@memberjunction/cli",
2425
+ "pluginType": "core",
2426
+ "strict": true,
2427
+ "enableJsonFlag": false,
2428
+ "isESM": true,
2429
+ "relativePath": [
2430
+ "dist",
2431
+ "commands",
2432
+ "migrate",
2433
+ "index.js"
2434
+ ]
2435
+ },
2436
+ "migrate:rebake": {
2437
+ "aliases": [],
2438
+ "args": {},
2439
+ "description": "Re-bake the post-baseline PG migration set with inline native CodeGen",
2440
+ "examples": [
2441
+ "<%= config.bin %> migrate rebake",
2442
+ "<%= config.bin %> migrate rebake --baseline-floor V202605291452 --dry-run"
2443
+ ],
2444
+ "flags": {
2445
+ "source-dir": {
2446
+ "description": "Source T-SQL migrations directory",
2447
+ "name": "source-dir",
2448
+ "default": "./migrations/v5",
2449
+ "hasDynamicHelp": false,
2450
+ "multiple": false,
2451
+ "type": "option"
2452
+ },
2453
+ "output-dir": {
2454
+ "description": "PG migrations directory (committed files read here + baked output written here)",
2455
+ "name": "output-dir",
2456
+ "default": "./migrations-pg/v5",
2457
+ "hasDynamicHelp": false,
2458
+ "multiple": false,
2459
+ "type": "option"
2460
+ },
2461
+ "schema": {
2462
+ "description": "Target schema name",
2463
+ "name": "schema",
2464
+ "default": "__mj",
2465
+ "hasDynamicHelp": false,
2466
+ "multiple": false,
2467
+ "type": "option"
2468
+ },
2469
+ "core-schema": {
2470
+ "description": "MJ core schema substituted for ${mjSchema} (default __mj). Distinct from --schema, which is the app's OWN schema: an Open App migration references core as ${mjSchema} and itself as ${flyway:defaultSchema}, and for every app those differ.",
2471
+ "name": "core-schema",
2472
+ "default": "__mj",
2473
+ "hasDynamicHelp": false,
2474
+ "multiple": false,
2475
+ "type": "option"
2476
+ },
2477
+ "baseline-floor": {
2478
+ "description": "Re-bake migrations strictly AFTER this version key (default: the latest B* in output-dir)",
2479
+ "name": "baseline-floor",
2480
+ "hasDynamicHelp": false,
2481
+ "multiple": false,
2482
+ "type": "option"
2483
+ },
2484
+ "dry-run": {
2485
+ "description": "Report what would be re-baked without writing files",
2486
+ "name": "dry-run",
2487
+ "allowNo": false,
2488
+ "type": "boolean"
2489
+ }
2490
+ },
2491
+ "hasDynamicHelp": false,
2492
+ "hiddenAliases": [],
2493
+ "id": "migrate:rebake",
2494
+ "pluginAlias": "@memberjunction/cli",
2495
+ "pluginName": "@memberjunction/cli",
2496
+ "pluginType": "core",
2497
+ "strict": true,
2498
+ "enableJsonFlag": false,
2499
+ "isESM": true,
2500
+ "relativePath": [
2501
+ "dist",
2502
+ "commands",
2503
+ "migrate",
2504
+ "rebake.js"
2505
+ ]
2506
+ },
2507
+ "migrate:usage": {
2508
+ "aliases": [],
2509
+ "args": {},
2510
+ "description": "Show usage, flags, examples, and runtime hints for every `mj migrate` command.",
2511
+ "flags": {
2512
+ "format": {
2513
+ "description": "Output format. Defaults to text on a terminal and json when stdout is piped.",
2514
+ "name": "format",
2515
+ "hasDynamicHelp": false,
2516
+ "multiple": false,
2517
+ "options": [
2518
+ "text",
2519
+ "json",
2520
+ "md"
2521
+ ],
2522
+ "type": "option"
2523
+ }
2524
+ },
2525
+ "hasDynamicHelp": false,
2526
+ "hiddenAliases": [],
2527
+ "id": "migrate:usage",
2528
+ "pluginAlias": "@memberjunction/cli",
2529
+ "pluginName": "@memberjunction/cli",
2530
+ "pluginType": "core",
2531
+ "strict": true,
2532
+ "enableJsonFlag": false,
2533
+ "isESM": true,
2534
+ "relativePath": [
2535
+ "dist",
2536
+ "commands",
2537
+ "migrate",
2538
+ "usage.js"
2539
+ ]
2540
+ },
2541
+ "plugin:add": {
2542
+ "aliases": [],
2543
+ "args": {
2544
+ "package": {
2545
+ "description": "Plugin entry-point specifier (package name, subpath, or relative path)",
2546
+ "name": "package",
2547
+ "required": true
2548
+ }
2549
+ },
2550
+ "description": "Register a CLI plugin package in mj-cli-plugins.json so `mj` loads it at startup.",
2551
+ "examples": [
2552
+ "<%= config.bin %> <%= command.id %> @my-org/mj-plugin/plugins",
2553
+ "<%= config.bin %> <%= command.id %> ./local-plugins/my-tool"
2554
+ ],
2555
+ "flags": {
2556
+ "format": {
2557
+ "description": "Output format",
2558
+ "name": "format",
2559
+ "default": "text",
2560
+ "hasDynamicHelp": false,
2561
+ "multiple": false,
2562
+ "options": [
2563
+ "text",
2564
+ "json"
2565
+ ],
2566
+ "type": "option"
2567
+ }
2568
+ },
2569
+ "hasDynamicHelp": false,
2570
+ "hiddenAliases": [],
2571
+ "id": "plugin:add",
2572
+ "pluginAlias": "@memberjunction/cli",
2573
+ "pluginName": "@memberjunction/cli",
2574
+ "pluginType": "core",
2575
+ "strict": true,
2576
+ "enableJsonFlag": false,
2577
+ "isESM": true,
2578
+ "relativePath": [
2579
+ "dist",
2580
+ "commands",
2581
+ "plugin",
2582
+ "add.js"
2583
+ ]
2584
+ },
2585
+ "plugin:usage": {
2586
+ "aliases": [],
2587
+ "args": {},
2588
+ "description": "Show usage, flags, examples, and runtime hints for every `mj plugin` command.",
2589
+ "flags": {
2590
+ "format": {
2591
+ "description": "Output format. Defaults to text on a terminal and json when stdout is piped.",
2592
+ "name": "format",
2593
+ "hasDynamicHelp": false,
2594
+ "multiple": false,
2595
+ "options": [
2596
+ "text",
2597
+ "json",
2598
+ "md"
2599
+ ],
2600
+ "type": "option"
2601
+ }
2602
+ },
2603
+ "hasDynamicHelp": false,
2604
+ "hiddenAliases": [],
2605
+ "id": "plugin:usage",
2606
+ "pluginAlias": "@memberjunction/cli",
2607
+ "pluginName": "@memberjunction/cli",
2608
+ "pluginType": "core",
2609
+ "strict": true,
2610
+ "enableJsonFlag": false,
2611
+ "isESM": true,
2612
+ "relativePath": [
2613
+ "dist",
2614
+ "commands",
2615
+ "plugin",
2616
+ "usage.js"
2617
+ ]
2618
+ },
2619
+ "querygen:export": {
2620
+ "aliases": [],
2621
+ "args": {},
2622
+ "description": "Export queries from database to metadata files",
2623
+ "examples": [
2624
+ "<%= config.bin %> <%= command.id %>",
2625
+ "<%= config.bin %> <%= command.id %> --output ./metadata/queries",
2626
+ "<%= config.bin %> <%= command.id %> --verbose"
2627
+ ],
2628
+ "flags": {
2629
+ "output": {
2630
+ "char": "o",
2631
+ "description": "Output directory",
2632
+ "name": "output",
2633
+ "default": "./metadata/queries",
2634
+ "hasDynamicHelp": false,
2635
+ "multiple": false,
2636
+ "type": "option"
2637
+ },
2638
+ "verbose": {
2639
+ "char": "v",
2640
+ "description": "Verbose output",
2641
+ "name": "verbose",
2497
2642
  "allowNo": false,
2498
2643
  "type": "boolean"
2499
2644
  }
2500
2645
  },
2501
2646
  "hasDynamicHelp": false,
2502
2647
  "hiddenAliases": [],
2503
- "id": "migrate",
2648
+ "id": "querygen:export",
2504
2649
  "pluginAlias": "@memberjunction/cli",
2505
2650
  "pluginName": "@memberjunction/cli",
2506
2651
  "pluginType": "core",
@@ -2510,68 +2655,126 @@
2510
2655
  "relativePath": [
2511
2656
  "dist",
2512
2657
  "commands",
2513
- "migrate",
2514
- "index.js"
2658
+ "querygen",
2659
+ "export.js"
2515
2660
  ]
2516
2661
  },
2517
- "migrate:rebake": {
2662
+ "querygen:generate": {
2518
2663
  "aliases": [],
2519
2664
  "args": {},
2520
- "description": "Re-bake the post-baseline PG migration set with inline native CodeGen",
2665
+ "description": "Generate SQL query templates for entities using AI",
2521
2666
  "examples": [
2522
- "<%= config.bin %> migrate rebake",
2523
- "<%= config.bin %> migrate rebake --baseline-floor V202605291452 --dry-run"
2667
+ "<%= config.bin %> <%= command.id %>",
2668
+ "<%= config.bin %> <%= command.id %> --entities \"Customers,Orders\"",
2669
+ "<%= config.bin %> <%= command.id %> --max-entities 5 --verbose",
2670
+ "<%= config.bin %> <%= command.id %> --mode database"
2524
2671
  ],
2525
2672
  "flags": {
2526
- "source-dir": {
2527
- "description": "Source T-SQL migrations directory",
2528
- "name": "source-dir",
2529
- "default": "./migrations/v5",
2673
+ "entities": {
2674
+ "char": "e",
2675
+ "description": "Specific entities to generate queries for (comma-separated)",
2676
+ "name": "entities",
2530
2677
  "hasDynamicHelp": false,
2531
2678
  "multiple": false,
2532
2679
  "type": "option"
2533
2680
  },
2534
- "output-dir": {
2535
- "description": "PG migrations directory (committed files read here + baked output written here)",
2536
- "name": "output-dir",
2537
- "default": "./migrations-pg/v5",
2681
+ "exclude-entities": {
2682
+ "char": "x",
2683
+ "description": "Entities to exclude (comma-separated)",
2684
+ "name": "exclude-entities",
2538
2685
  "hasDynamicHelp": false,
2539
2686
  "multiple": false,
2540
2687
  "type": "option"
2541
2688
  },
2542
- "schema": {
2543
- "description": "Target schema name",
2544
- "name": "schema",
2545
- "default": "__mj",
2689
+ "exclude-schemas": {
2690
+ "char": "s",
2691
+ "description": "Schemas to exclude (comma-separated)",
2692
+ "name": "exclude-schemas",
2546
2693
  "hasDynamicHelp": false,
2547
2694
  "multiple": false,
2548
2695
  "type": "option"
2549
2696
  },
2550
- "core-schema": {
2551
- "description": "MJ core schema substituted for ${mjSchema} (default __mj). Distinct from --schema, which is the app's OWN schema: an Open App migration references core as ${mjSchema} and itself as ${flyway:defaultSchema}, and for every app those differ.",
2552
- "name": "core-schema",
2553
- "default": "__mj",
2697
+ "max-entities": {
2698
+ "char": "m",
2699
+ "description": "Max entities per group",
2700
+ "name": "max-entities",
2701
+ "default": 3,
2554
2702
  "hasDynamicHelp": false,
2555
2703
  "multiple": false,
2556
2704
  "type": "option"
2557
2705
  },
2558
- "baseline-floor": {
2559
- "description": "Re-bake migrations strictly AFTER this version key (default: the latest B* in output-dir)",
2560
- "name": "baseline-floor",
2706
+ "target-groups": {
2707
+ "char": "t",
2708
+ "description": "Target number of entity groups to generate",
2709
+ "name": "target-groups",
2710
+ "default": 75,
2561
2711
  "hasDynamicHelp": false,
2562
2712
  "multiple": false,
2563
2713
  "type": "option"
2564
2714
  },
2565
- "dry-run": {
2566
- "description": "Report what would be re-baked without writing files",
2567
- "name": "dry-run",
2715
+ "max-refinements": {
2716
+ "char": "r",
2717
+ "description": "Max refinement iterations",
2718
+ "name": "max-refinements",
2719
+ "default": 3,
2720
+ "hasDynamicHelp": false,
2721
+ "multiple": false,
2722
+ "type": "option"
2723
+ },
2724
+ "max-fixes": {
2725
+ "char": "f",
2726
+ "description": "Max error-fixing attempts",
2727
+ "name": "max-fixes",
2728
+ "default": 5,
2729
+ "hasDynamicHelp": false,
2730
+ "multiple": false,
2731
+ "type": "option"
2732
+ },
2733
+ "model": {
2734
+ "description": "Preferred AI model",
2735
+ "name": "model",
2736
+ "hasDynamicHelp": false,
2737
+ "multiple": false,
2738
+ "type": "option"
2739
+ },
2740
+ "vendor": {
2741
+ "description": "Preferred AI vendor",
2742
+ "name": "vendor",
2743
+ "hasDynamicHelp": false,
2744
+ "multiple": false,
2745
+ "type": "option"
2746
+ },
2747
+ "output": {
2748
+ "char": "o",
2749
+ "description": "Output directory",
2750
+ "name": "output",
2751
+ "hasDynamicHelp": false,
2752
+ "multiple": false,
2753
+ "type": "option"
2754
+ },
2755
+ "mode": {
2756
+ "description": "Output mode: metadata|database|both",
2757
+ "name": "mode",
2758
+ "hasDynamicHelp": false,
2759
+ "multiple": false,
2760
+ "options": [
2761
+ "metadata",
2762
+ "database",
2763
+ "both"
2764
+ ],
2765
+ "type": "option"
2766
+ },
2767
+ "verbose": {
2768
+ "char": "v",
2769
+ "description": "Verbose output",
2770
+ "name": "verbose",
2568
2771
  "allowNo": false,
2569
2772
  "type": "boolean"
2570
2773
  }
2571
2774
  },
2572
2775
  "hasDynamicHelp": false,
2573
2776
  "hiddenAliases": [],
2574
- "id": "migrate:rebake",
2777
+ "id": "querygen:generate",
2575
2778
  "pluginAlias": "@memberjunction/cli",
2576
2779
  "pluginName": "@memberjunction/cli",
2577
2780
  "pluginType": "core",
@@ -2581,14 +2784,14 @@
2581
2784
  "relativePath": [
2582
2785
  "dist",
2583
2786
  "commands",
2584
- "migrate",
2585
- "rebake.js"
2787
+ "querygen",
2788
+ "generate.js"
2586
2789
  ]
2587
2790
  },
2588
- "migrate:usage": {
2791
+ "querygen:usage": {
2589
2792
  "aliases": [],
2590
2793
  "args": {},
2591
- "description": "Show usage, flags, examples, and runtime hints for every `mj migrate` command.",
2794
+ "description": "Show usage, flags, examples, and runtime hints for every `mj querygen` command.",
2592
2795
  "flags": {
2593
2796
  "format": {
2594
2797
  "description": "Output format. Defaults to text on a terminal and json when stdout is piped.",
@@ -2605,7 +2808,7 @@
2605
2808
  },
2606
2809
  "hasDynamicHelp": false,
2607
2810
  "hiddenAliases": [],
2608
- "id": "migrate:usage",
2811
+ "id": "querygen:usage",
2609
2812
  "pluginAlias": "@memberjunction/cli",
2610
2813
  "pluginName": "@memberjunction/cli",
2611
2814
  "pluginType": "core",
@@ -2615,41 +2818,40 @@
2615
2818
  "relativePath": [
2616
2819
  "dist",
2617
2820
  "commands",
2618
- "migrate",
2821
+ "querygen",
2619
2822
  "usage.js"
2620
2823
  ]
2621
2824
  },
2622
- "plugin:add": {
2825
+ "querygen:validate": {
2623
2826
  "aliases": [],
2624
- "args": {
2625
- "package": {
2626
- "description": "Plugin entry-point specifier (package name, subpath, or relative path)",
2627
- "name": "package",
2628
- "required": true
2629
- }
2630
- },
2631
- "description": "Register a CLI plugin package in mj-cli-plugins.json so `mj` loads it at startup.",
2827
+ "args": {},
2828
+ "description": "Validate existing query templates",
2632
2829
  "examples": [
2633
- "<%= config.bin %> <%= command.id %> @my-org/mj-plugin/plugins",
2634
- "<%= config.bin %> <%= command.id %> ./local-plugins/my-tool"
2830
+ "<%= config.bin %> <%= command.id %>",
2831
+ "<%= config.bin %> <%= command.id %> --path ./metadata/queries",
2832
+ "<%= config.bin %> <%= command.id %> --verbose"
2635
2833
  ],
2636
2834
  "flags": {
2637
- "format": {
2638
- "description": "Output format",
2639
- "name": "format",
2640
- "default": "text",
2835
+ "path": {
2836
+ "char": "p",
2837
+ "description": "Path to queries metadata file or directory",
2838
+ "name": "path",
2839
+ "default": "./metadata/queries",
2641
2840
  "hasDynamicHelp": false,
2642
2841
  "multiple": false,
2643
- "options": [
2644
- "text",
2645
- "json"
2646
- ],
2647
2842
  "type": "option"
2843
+ },
2844
+ "verbose": {
2845
+ "char": "v",
2846
+ "description": "Verbose output",
2847
+ "name": "verbose",
2848
+ "allowNo": false,
2849
+ "type": "boolean"
2648
2850
  }
2649
2851
  },
2650
2852
  "hasDynamicHelp": false,
2651
2853
  "hiddenAliases": [],
2652
- "id": "plugin:add",
2854
+ "id": "querygen:validate",
2653
2855
  "pluginAlias": "@memberjunction/cli",
2654
2856
  "pluginName": "@memberjunction/cli",
2655
2857
  "pluginType": "core",
@@ -2659,31 +2861,72 @@
2659
2861
  "relativePath": [
2660
2862
  "dist",
2661
2863
  "commands",
2662
- "plugin",
2663
- "add.js"
2864
+ "querygen",
2865
+ "validate.js"
2664
2866
  ]
2665
2867
  },
2666
- "plugin:usage": {
2868
+ "codegen:5-0-fix-entity-names": {
2667
2869
  "aliases": [],
2668
2870
  "args": {},
2669
- "description": "Show usage, flags, examples, and runtime hints for every `mj plugin` command.",
2871
+ "description": "[v5.0 Migration] Scan TypeScript files for entity names AND class names that need updating.\n\nThree strategies are applied:\n 1. Class name renames (regex) — ActionEntity -> MJActionEntity, ActionSchema -> MJActionSchema,\n ActionEntityExtended -> MJActionEntityExtended (extended subclasses),\n ActionEntityServerEntity -> MJActionEntityServer (server subclass suffix standardization),\n ActionFormComponentExtended -> MJActionFormComponentExtended (Angular form components).\n Explicit subclass mappings (57 entries from subclass-rename-map.json) take priority over\n auto-generated suffix rules, enabling suffix changes (e.g., _Server -> Server, ServerEntity -> Server).\n 2. Multi-word entity name renames (regex) — 'AI Models' -> 'MJ: AI Models'\n 3. Single-word entity name renames (AST) — 'Actions' -> 'MJ: Actions' in GetEntityObject, OpenEntityRecord,\n navigateToEntity, EntityName: assignments, .Name === comparisons, @RegisterClass decorators.\n\nThe rename map (272 entity entries + 57 subclass entries) is built from entity_subclasses.ts @RegisterClass\ndecorators plus embedded rename maps. Runs in dry-run mode by default; use --fix to apply.",
2872
+ "examples": [
2873
+ {
2874
+ "description": "Dry-run scan of the packages directory",
2875
+ "command": "<%= config.bin %> <%= command.id %> --path packages/"
2876
+ },
2877
+ {
2878
+ "description": "Scan a single file",
2879
+ "command": "<%= config.bin %> <%= command.id %> --path packages/Angular/Explorer/dashboards/src/Actions/components/actions-overview.component.ts"
2880
+ },
2881
+ {
2882
+ "description": "Apply fixes across the codebase",
2883
+ "command": "<%= config.bin %> <%= command.id %> --path packages/ --fix"
2884
+ },
2885
+ {
2886
+ "description": "Quiet mode (summary only)",
2887
+ "command": "<%= config.bin %> <%= command.id %> --path packages/ -q"
2888
+ }
2889
+ ],
2670
2890
  "flags": {
2671
- "format": {
2672
- "description": "Output format. Defaults to text on a terminal and json when stdout is piped.",
2673
- "name": "format",
2891
+ "path": {
2892
+ "char": "p",
2893
+ "description": "File or directory to scan. Accepts a single .ts file or a directory (scanned recursively). Defaults to the current working directory.",
2894
+ "name": "path",
2674
2895
  "hasDynamicHelp": false,
2675
2896
  "multiple": false,
2676
- "options": [
2677
- "text",
2678
- "json",
2679
- "md"
2680
- ],
2681
2897
  "type": "option"
2898
+ },
2899
+ "fix": {
2900
+ "description": "Apply fixes in place. Without this flag, the command runs in dry-run mode and only reports findings.",
2901
+ "name": "fix",
2902
+ "allowNo": false,
2903
+ "type": "boolean"
2904
+ },
2905
+ "entity-subclasses": {
2906
+ "description": "Explicit path to entity_subclasses.ts for building the rename map. If omitted, the tool searches common locations relative to the target path.",
2907
+ "name": "entity-subclasses",
2908
+ "hasDynamicHelp": false,
2909
+ "multiple": false,
2910
+ "type": "option"
2911
+ },
2912
+ "quiet": {
2913
+ "char": "q",
2914
+ "description": "Suppress detailed per-file output; only show the final summary counts.",
2915
+ "name": "quiet",
2916
+ "allowNo": false,
2917
+ "type": "boolean"
2918
+ },
2919
+ "verbose": {
2920
+ "char": "v",
2921
+ "description": "Show detailed progress including each file being scanned.",
2922
+ "name": "verbose",
2923
+ "allowNo": false,
2924
+ "type": "boolean"
2682
2925
  }
2683
2926
  },
2684
2927
  "hasDynamicHelp": false,
2685
2928
  "hiddenAliases": [],
2686
- "id": "plugin:usage",
2929
+ "id": "codegen:5-0-fix-entity-names",
2687
2930
  "pluginAlias": "@memberjunction/cli",
2688
2931
  "pluginName": "@memberjunction/cli",
2689
2932
  "pluginType": "core",
@@ -2693,42 +2936,72 @@
2693
2936
  "relativePath": [
2694
2937
  "dist",
2695
2938
  "commands",
2696
- "plugin",
2697
- "usage.js"
2939
+ "codegen",
2940
+ "5-0-fix-entity-names.js"
2698
2941
  ]
2699
2942
  },
2700
- "dbdoc:analyze": {
2943
+ "codegen:5-0-fix-html-entity-names": {
2701
2944
  "aliases": [],
2702
2945
  "args": {},
2703
- "description": "Analyze database and generate documentation (delegates to db-auto-doc analyze)",
2946
+ "description": "[v5.0 Migration] Scan Angular HTML template files for hardcoded entity names that need \"MJ: \" prefix updates.\n\nUses targeted regex patterns to find entity name references in template expressions\nand attribute values. Detects method calls like navigateToEntity('Actions'),\nOpenEntityRecord('Entities', id), and attribute values like RowsEntityName=\"Users\".\nRuns in dry-run mode by default; use --fix to apply.\n\nThe rename map is built dynamically from entity_subclasses.ts by parsing all\n@RegisterClass(BaseEntity, 'MJ: XYZ') decorators (~272 entries).",
2704
2947
  "examples": [
2705
- "<%= config.bin %> <%= command.id %>",
2706
- "<%= config.bin %> <%= command.id %> --resume ./output/run-6/state.json",
2707
- "<%= config.bin %> <%= command.id %> --config ./my-config.json"
2948
+ {
2949
+ "description": "Dry-run scan of Angular templates",
2950
+ "command": "<%= config.bin %> <%= command.id %> --path packages/Angular/"
2951
+ },
2952
+ {
2953
+ "description": "Apply fixes to HTML templates",
2954
+ "command": "<%= config.bin %> <%= command.id %> --path packages/Angular/ --fix"
2955
+ },
2956
+ {
2957
+ "description": "Scan with verbose output",
2958
+ "command": "<%= config.bin %> <%= command.id %> --path packages/ -v"
2959
+ },
2960
+ {
2961
+ "description": "Scan a single template file",
2962
+ "command": "<%= config.bin %> <%= command.id %> --path packages/Angular/Explorer/dashboards/src/Actions/actions-dashboard.component.html"
2963
+ }
2708
2964
  ],
2709
2965
  "flags": {
2710
- "resume": {
2711
- "char": "r",
2712
- "description": "Resume from an existing state file",
2713
- "name": "resume",
2714
- "required": false,
2966
+ "path": {
2967
+ "char": "p",
2968
+ "description": "File or directory to scan. Accepts a single .html file or a directory (scanned recursively). Defaults to the current working directory.",
2969
+ "name": "path",
2715
2970
  "hasDynamicHelp": false,
2716
2971
  "multiple": false,
2717
2972
  "type": "option"
2718
2973
  },
2719
- "config": {
2720
- "char": "c",
2721
- "description": "Path to config file",
2722
- "name": "config",
2723
- "default": "./config.json",
2974
+ "fix": {
2975
+ "description": "Apply fixes in place. Without this flag, the command runs in dry-run mode and only reports findings.",
2976
+ "name": "fix",
2977
+ "allowNo": false,
2978
+ "type": "boolean"
2979
+ },
2980
+ "entity-subclasses": {
2981
+ "description": "Explicit path to entity_subclasses.ts for building the rename map. If omitted, the tool searches common locations relative to the target path.",
2982
+ "name": "entity-subclasses",
2724
2983
  "hasDynamicHelp": false,
2725
2984
  "multiple": false,
2726
2985
  "type": "option"
2986
+ },
2987
+ "quiet": {
2988
+ "char": "q",
2989
+ "description": "Suppress detailed per-file output; only show the final summary counts.",
2990
+ "name": "quiet",
2991
+ "allowNo": false,
2992
+ "type": "boolean"
2993
+ },
2994
+ "verbose": {
2995
+ "char": "v",
2996
+ "description": "Show detailed progress including each file being scanned.",
2997
+ "name": "verbose",
2998
+ "allowNo": false,
2999
+ "type": "boolean"
2727
3000
  }
2728
3001
  },
2729
3002
  "hasDynamicHelp": false,
2730
3003
  "hiddenAliases": [],
2731
- "id": "dbdoc:analyze",
3004
+ "id": "codegen:5-0-fix-html-entity-names",
2732
3005
  "pluginAlias": "@memberjunction/cli",
2733
3006
  "pluginName": "@memberjunction/cli",
2734
3007
  "pluginType": "core",
@@ -2738,105 +3011,72 @@
2738
3011
  "relativePath": [
2739
3012
  "dist",
2740
3013
  "commands",
2741
- "dbdoc",
2742
- "analyze.js"
3014
+ "codegen",
3015
+ "5-0-fix-html-entity-names.js"
2743
3016
  ]
2744
3017
  },
2745
- "dbdoc:export-sample-queries": {
3018
+ "codegen:5-0-fix-metadata-names": {
2746
3019
  "aliases": [],
2747
3020
  "args": {},
2748
- "description": "Export sample queries to MemberJunction metadata format (delegates to db-auto-doc export-sample-queries)",
3021
+ "description": "[v5.0 Migration] Scan metadata JSON files for entity names that need \"MJ: \" prefix updates.\n\nTargets the metadata/ directory used by \"mj sync\". Detects entity name references in\n@lookup: directives (both the entity name and lookup value), .mj-sync.json and\n.mj-folder.json config files (entity/entityName fields), relatedEntities object keys,\nand fields.Name values in Entities-managing folders. Runs in dry-run mode by default;\nuse --fix to apply.\n\nThe rename map is built dynamically from entity_subclasses.ts by parsing all\n@RegisterClass(BaseEntity, 'MJ: XYZ') decorators (~272 entries).",
2749
3022
  "examples": [
2750
- "<%= config.bin %> <%= command.id %> --input ./output/sample-queries.json --output ./metadata/queries/.queries.json",
2751
- "<%= config.bin %> <%= command.id %> --input ./sample-queries.json --output ./metadata/queries/.queries.json --separate-sql-files",
2752
- "<%= config.bin %> <%= command.id %> --input ./sample-queries.json --output ./queries/.queries.json --category \"Database Documentation\"",
2753
- "<%= config.bin %> <%= command.id %> --input ./sample-queries.json --output ./queries/.queries.json --status Pending --min-confidence 0.8"
3023
+ {
3024
+ "description": "Dry-run scan of the metadata directory",
3025
+ "command": "<%= config.bin %> <%= command.id %> --path metadata/"
3026
+ },
3027
+ {
3028
+ "description": "Apply fixes to metadata files",
3029
+ "command": "<%= config.bin %> <%= command.id %> --path metadata/ --fix"
3030
+ },
3031
+ {
3032
+ "description": "Scan a specific subdirectory",
3033
+ "command": "<%= config.bin %> <%= command.id %> --path metadata/resource-types"
3034
+ },
3035
+ {
3036
+ "description": "Scan and fix a single metadata file",
3037
+ "command": "<%= config.bin %> <%= command.id %> --path metadata/entities/.audit-related-entities.json --fix"
3038
+ }
2754
3039
  ],
2755
3040
  "flags": {
2756
- "input": {
2757
- "char": "i",
2758
- "description": "Path to sample-queries.json file generated by generate-queries command",
2759
- "name": "input",
2760
- "required": true,
2761
- "hasDynamicHelp": false,
2762
- "multiple": false,
2763
- "type": "option"
2764
- },
2765
- "output": {
2766
- "char": "o",
2767
- "description": "Output path for the .queries.json metadata file",
2768
- "name": "output",
2769
- "required": true,
3041
+ "path": {
3042
+ "char": "p",
3043
+ "description": "File or directory to scan. Accepts a single .json file or a directory (scanned recursively, including dotfiles like .mj-sync.json). Defaults to the current working directory.",
3044
+ "name": "path",
2770
3045
  "hasDynamicHelp": false,
2771
3046
  "multiple": false,
2772
3047
  "type": "option"
2773
3048
  },
2774
- "separate-sql-files": {
2775
- "description": "Write SQL to separate files and use @file: references",
2776
- "name": "separate-sql-files",
3049
+ "fix": {
3050
+ "description": "Apply fixes in place. Without this flag, the command runs in dry-run mode and only reports findings.",
3051
+ "name": "fix",
2777
3052
  "allowNo": false,
2778
3053
  "type": "boolean"
2779
3054
  },
2780
- "sql-dir": {
2781
- "description": "Directory for SQL files when using --separate-sql-files (relative to output file)",
2782
- "name": "sql-dir",
2783
- "default": "SQL",
2784
- "hasDynamicHelp": false,
2785
- "multiple": false,
2786
- "type": "option"
2787
- },
2788
- "category": {
2789
- "description": "Category name for @lookup reference (e.g., \"Database Documentation\")",
2790
- "name": "category",
2791
- "required": false,
2792
- "hasDynamicHelp": false,
2793
- "multiple": false,
2794
- "type": "option"
2795
- },
2796
- "status": {
2797
- "description": "Status to assign to exported queries",
2798
- "name": "status",
2799
- "default": "Pending",
2800
- "hasDynamicHelp": false,
2801
- "multiple": false,
2802
- "options": [
2803
- "Approved",
2804
- "Pending",
2805
- "Rejected",
2806
- "Expired"
2807
- ],
2808
- "type": "option"
2809
- },
2810
- "min-confidence": {
2811
- "description": "Minimum confidence threshold to export (0-1)",
2812
- "name": "min-confidence",
2813
- "default": "0",
3055
+ "entity-subclasses": {
3056
+ "description": "Explicit path to entity_subclasses.ts for building the rename map. If omitted, the tool searches common locations relative to the target path.",
3057
+ "name": "entity-subclasses",
2814
3058
  "hasDynamicHelp": false,
2815
3059
  "multiple": false,
2816
3060
  "type": "option"
2817
3061
  },
2818
- "validated-only": {
2819
- "description": "Only export queries that were successfully validated",
2820
- "name": "validated-only",
2821
- "allowNo": false,
2822
- "type": "boolean"
2823
- },
2824
- "append": {
2825
- "description": "Append to existing metadata file instead of overwriting",
2826
- "name": "append",
3062
+ "quiet": {
3063
+ "char": "q",
3064
+ "description": "Suppress detailed per-file output; only show the final summary counts.",
3065
+ "name": "quiet",
2827
3066
  "allowNo": false,
2828
3067
  "type": "boolean"
2829
3068
  },
2830
- "include-primary-key": {
2831
- "description": "Include primaryKey and sync fields (for updating existing records)",
2832
- "name": "include-primary-key",
3069
+ "verbose": {
3070
+ "char": "v",
3071
+ "description": "Show detailed progress including each file being scanned.",
3072
+ "name": "verbose",
2833
3073
  "allowNo": false,
2834
3074
  "type": "boolean"
2835
3075
  }
2836
3076
  },
2837
3077
  "hasDynamicHelp": false,
2838
3078
  "hiddenAliases": [],
2839
- "id": "dbdoc:export-sample-queries",
3079
+ "id": "codegen:5-0-fix-metadata-names",
2840
3080
  "pluginAlias": "@memberjunction/cli",
2841
3081
  "pluginName": "@memberjunction/cli",
2842
3082
  "pluginType": "core",
@@ -2846,168 +3086,290 @@
2846
3086
  "relativePath": [
2847
3087
  "dist",
2848
3088
  "commands",
2849
- "dbdoc",
2850
- "export-sample-queries.js"
3089
+ "codegen",
3090
+ "5-0-fix-metadata-names.js"
2851
3091
  ]
2852
3092
  },
2853
- "dbdoc:export": {
3093
+ "codegen": {
2854
3094
  "aliases": [],
2855
3095
  "args": {},
2856
- "description": "Export documentation in multiple formats (delegates to db-auto-doc export)",
2857
- "examples": [
2858
- "<%= config.bin %> <%= command.id %> --state-file=./db-doc-state.json",
2859
- "<%= config.bin %> <%= command.id %> --sql",
2860
- "<%= config.bin %> <%= command.id %> --markdown",
2861
- "<%= config.bin %> <%= command.id %> --html",
2862
- "<%= config.bin %> <%= command.id %> --csv",
2863
- "<%= config.bin %> <%= command.id %> --mermaid",
2864
- "<%= config.bin %> <%= command.id %> --sql --markdown --html --csv --mermaid --apply"
2865
- ],
3096
+ "description": "Run the full MemberJunction code generation pipeline.\n\nAnalyzes your database schema, updates MemberJunction metadata, and generates\nsynchronized code across the stack: SQL objects, TypeScript entities, Angular\nforms, GraphQL resolvers, Action subclasses, and DB schema JSON.\n\nUse --skipdb to regenerate code from existing metadata only; --skipfiles to run\ndatabase-side operations only. --force-advanced-gen re-runs the LLM-driven\nadvanced generation for ALL entities (bypasses changed-entity scoping).",
2866
3097
  "flags": {
2867
- "state-file": {
2868
- "char": "s",
2869
- "description": "Path to state JSON file",
2870
- "name": "state-file",
2871
- "hasDynamicHelp": false,
2872
- "multiple": false,
2873
- "type": "option"
2874
- },
2875
- "output-dir": {
2876
- "char": "o",
2877
- "description": "Output directory for generated files",
2878
- "name": "output-dir",
3098
+ "format": {
3099
+ "description": "Output format: text (human), json (machine-readable), md (Markdown-fenced). Defaults to text on a terminal and json when stdout is piped.",
3100
+ "name": "format",
2879
3101
  "hasDynamicHelp": false,
2880
3102
  "multiple": false,
3103
+ "options": [
3104
+ "text",
3105
+ "json",
3106
+ "md",
3107
+ "human",
3108
+ "console",
3109
+ "markdown"
3110
+ ],
2881
3111
  "type": "option"
2882
3112
  },
2883
- "sql": {
2884
- "description": "Generate SQL script",
2885
- "name": "sql",
3113
+ "verbose": {
3114
+ "char": "v",
3115
+ "description": "Show detailed output",
3116
+ "name": "verbose",
2886
3117
  "allowNo": false,
2887
3118
  "type": "boolean"
2888
3119
  },
2889
- "markdown": {
2890
- "description": "Generate Markdown documentation",
2891
- "name": "markdown",
3120
+ "no-banner": {
3121
+ "description": "Suppress the startup banner and runtime advisory",
3122
+ "name": "no-banner",
2892
3123
  "allowNo": false,
2893
3124
  "type": "boolean"
2894
3125
  },
2895
- "html": {
2896
- "description": "Generate interactive HTML documentation",
2897
- "name": "html",
3126
+ "no-app-packages": {
3127
+ "description": "Do not load installed Open App server packages (or the host's generated packages) for this run, so records are written with the generic BaseEntity — no custom Save() logic or lifecycle hooks.",
3128
+ "name": "no-app-packages",
2898
3129
  "allowNo": false,
2899
3130
  "type": "boolean"
2900
3131
  },
2901
- "csv": {
2902
- "description": "Generate CSV exports (tables and columns)",
2903
- "name": "csv",
2904
- "allowNo": false,
3132
+ "interactive": {
3133
+ "description": "Allow interactive prompts. Defaults to on at a terminal and off when piped, spawned, or in CI, so an agent never hangs on a question. Use --no-interactive to force it off.",
3134
+ "name": "interactive",
3135
+ "allowNo": true,
2905
3136
  "type": "boolean"
2906
3137
  },
2907
- "mermaid": {
2908
- "description": "Generate Mermaid ERD diagram files",
2909
- "name": "mermaid",
3138
+ "skipdb": {
3139
+ "description": "Skip database operations. Only regenerate TypeScript entities, Angular components, and GraphQL resolvers from existing metadata.",
3140
+ "name": "skipdb",
2910
3141
  "allowNo": false,
2911
3142
  "type": "boolean"
2912
3143
  },
2913
- "report": {
2914
- "description": "Generate analysis report",
2915
- "name": "report",
3144
+ "skipfiles": {
3145
+ "description": "Skip file-generation operations. Only run database-side operations (metadata sync, SQL object generation).",
3146
+ "name": "skipfiles",
2916
3147
  "allowNo": false,
2917
3148
  "type": "boolean"
2918
3149
  },
2919
- "apply": {
2920
- "description": "Apply SQL to database",
2921
- "name": "apply",
3150
+ "force-advanced-gen": {
3151
+ "description": "Bypass entity scoping in Pass 2 and force advanced generation to re-run for all entities.",
3152
+ "name": "force-advanced-gen",
2922
3153
  "allowNo": false,
2923
3154
  "type": "boolean"
2924
3155
  },
2925
- "approved-only": {
2926
- "description": "Only export approved items",
2927
- "name": "approved-only",
3156
+ "no-ai": {
3157
+ "description": "Disable AI-driven advanced generation (descriptions, categories, search ranking). Overrides config and credential checks. Can also be set with MJ_CODEGEN_NO_AI=1.",
3158
+ "name": "no-ai",
2928
3159
  "allowNo": false,
2929
3160
  "type": "boolean"
2930
3161
  },
2931
- "confidence-threshold": {
2932
- "description": "Minimum confidence threshold",
2933
- "name": "confidence-threshold",
2934
- "default": "0",
3162
+ "sql-output-dir": {
3163
+ "description": "Directory for CodeGen_Run_*.sql (EntityField INSERTs and other metadata SQL). Open Apps default to ./migrations/codegen. Do not point this at MJ/migrations/v*.",
3164
+ "name": "sql-output-dir",
2935
3165
  "hasDynamicHelp": false,
2936
3166
  "multiple": false,
2937
3167
  "type": "option"
3168
+ },
3169
+ "skip-commands": {
3170
+ "description": "Skip running BEFORE and AFTER shell commands configured in mj.config. Can also be set with MJ_CODEGEN_SKIP_COMMANDS=1.",
3171
+ "name": "skip-commands",
3172
+ "allowNo": false,
3173
+ "type": "boolean"
2938
3174
  }
2939
3175
  },
2940
3176
  "hasDynamicHelp": false,
2941
3177
  "hiddenAliases": [],
2942
- "id": "dbdoc:export",
3178
+ "id": "codegen",
2943
3179
  "pluginAlias": "@memberjunction/cli",
2944
3180
  "pluginName": "@memberjunction/cli",
2945
3181
  "pluginType": "core",
2946
3182
  "strict": true,
2947
3183
  "enableJsonFlag": false,
3184
+ "Examples": [
3185
+ {
3186
+ "command": "<%= config.bin %> <%= command.id %>",
3187
+ "description": "Run the full code generation pipeline"
3188
+ },
3189
+ {
3190
+ "command": "<%= config.bin %> <%= command.id %> --skipdb",
3191
+ "description": "Regenerate code files without touching the database"
3192
+ },
3193
+ {
3194
+ "command": "<%= config.bin %> <%= command.id %> --format=json",
3195
+ "description": "Emit a machine-readable result for an agent"
3196
+ }
3197
+ ],
3198
+ "Usage": {
3199
+ "domain": "codegen",
3200
+ "command": "codegen",
3201
+ "summary": "Regenerate entities, SQL, and Angular forms from the database schema.",
3202
+ "description": "Runs the full CodeGen pipeline. Scales with entity count — a full run is far slower than a single-entity change. Use --skipdb/--skipfiles to run only one half.",
3203
+ "flags": [
3204
+ {
3205
+ "name": "--skipdb",
3206
+ "type": "boolean",
3207
+ "description": "Regenerate code from existing metadata only (no DB operations)"
3208
+ },
3209
+ {
3210
+ "name": "--skipfiles",
3211
+ "type": "boolean",
3212
+ "description": "Run DB-side operations only (no code files)"
3213
+ },
3214
+ {
3215
+ "name": "--force-advanced-gen",
3216
+ "type": "boolean",
3217
+ "description": "Re-run advanced generation for all entities"
3218
+ },
3219
+ {
3220
+ "name": "--no-ai",
3221
+ "type": "boolean",
3222
+ "description": "Disable AI-driven advanced generation (same as MJ_CODEGEN_NO_AI=1)"
3223
+ },
3224
+ {
3225
+ "name": "--skip-commands",
3226
+ "type": "boolean",
3227
+ "description": "Skip running BEFORE/AFTER commands (same as MJ_CODEGEN_SKIP_COMMANDS=1)"
3228
+ },
3229
+ {
3230
+ "name": "--sql-output-dir",
3231
+ "type": "string",
3232
+ "description": "Directory for CodeGen_Run metadata SQL (Open Apps: ./migrations/codegen)"
3233
+ },
3234
+ {
3235
+ "name": "--format",
3236
+ "type": "text|json|md",
3237
+ "description": "Output format (json for machine-readable result)"
3238
+ }
3239
+ ],
3240
+ "examples": [
3241
+ "mj codegen",
3242
+ "mj codegen --skipdb",
3243
+ "mj codegen --skip-commands",
3244
+ "mj codegen --format=json"
3245
+ ],
3246
+ "runtime": {
3247
+ "class": "slow",
3248
+ "typicalSeconds": 45,
3249
+ "note": "scales with entity count; full run far slower than a single-entity change"
3250
+ }
3251
+ },
2948
3252
  "isESM": true,
2949
3253
  "relativePath": [
2950
3254
  "dist",
2951
3255
  "commands",
2952
- "dbdoc",
2953
- "export.js"
3256
+ "codegen",
3257
+ "index.js"
2954
3258
  ]
2955
3259
  },
2956
- "dbdoc:generate-queries": {
3260
+ "codegen:manifest": {
2957
3261
  "aliases": [],
2958
3262
  "args": {},
2959
- "description": "Generate sample SQL queries from existing analysis state (delegates to db-auto-doc generate-queries)",
3263
+ "description": "Generate a class registration manifest to prevent tree-shaking.\n\nMemberJunction uses @RegisterClass decorators with a dynamic class factory.\nModern bundlers (ESBuild, Vite) cannot detect dynamic instantiation and will\ntree-shake these classes out of production builds. This command scans the\ndependency tree for all @RegisterClass-decorated classes and emits a manifest\nfile with static imports that the bundler cannot eliminate.\n\nTypically used as a prebuild/prestart script for MJAPI and MJExplorer. For\nMJ distribution users, pre-built manifests ship inside @memberjunction/server-bootstrap\nand @memberjunction/ng-bootstrap -- use --exclude-packages @memberjunction to\ngenerate a supplemental manifest covering only your own application classes.",
2960
3264
  "examples": [
2961
- "<%= config.bin %> <%= command.id %> --from-state ./output/run-1/state.json",
2962
- "<%= config.bin %> <%= command.id %> --from-state ./output/run-1/state.json --output-dir ./queries",
2963
- "<%= config.bin %> <%= command.id %> --from-state ./output/run-1/state.json --queries-per-table 10"
3265
+ {
3266
+ "command": "<%= config.bin %> <%= command.id %>",
3267
+ "description": "Generate manifest with default output path"
3268
+ },
3269
+ {
3270
+ "command": "<%= config.bin %> <%= command.id %> --appDir ./packages/MJAPI --output ./packages/MJAPI/src/generated/class-registrations-manifest.ts",
3271
+ "description": "Generate manifest for a specific application directory"
3272
+ },
3273
+ {
3274
+ "command": "<%= config.bin %> <%= command.id %> --exclude-packages @memberjunction",
3275
+ "description": "Exclude MJ packages (use pre-built bootstrap manifests instead)"
3276
+ },
3277
+ {
3278
+ "command": "<%= config.bin %> <%= command.id %> --exclude-packages @memberjunction --no-sync-deps",
3279
+ "description": "Exclude MJ packages and skip dependency reconciliation"
3280
+ },
3281
+ {
3282
+ "command": "<%= config.bin %> <%= command.id %> --filter BaseEngine --filter BaseAction --verbose",
3283
+ "description": "Only include specific base classes with detailed progress"
3284
+ },
3285
+ {
3286
+ "command": "<%= config.bin %> <%= command.id %> --scan-dist",
3287
+ "description": "Include dist/ scanning for npm-published packages without src/"
3288
+ }
2964
3289
  ],
2965
3290
  "flags": {
2966
- "from-state": {
2967
- "description": "Path to existing state.json file from previous analysis",
2968
- "name": "from-state",
2969
- "required": true,
3291
+ "output": {
3292
+ "char": "o",
3293
+ "description": "Output file path for the generated manifest. The file will contain named imports and a CLASS_REGISTRATIONS array.",
3294
+ "name": "output",
3295
+ "default": "./src/generated/class-registrations-manifest.ts",
2970
3296
  "hasDynamicHelp": false,
2971
3297
  "multiple": false,
2972
3298
  "type": "option"
2973
3299
  },
2974
- "output-dir": {
2975
- "description": "Output directory for generated queries",
2976
- "name": "output-dir",
2977
- "required": false,
3300
+ "appDir": {
3301
+ "char": "a",
3302
+ "description": "Root directory of the application whose package.json dependency tree will be scanned. Defaults to the current working directory.",
3303
+ "name": "appDir",
2978
3304
  "hasDynamicHelp": false,
2979
3305
  "multiple": false,
2980
3306
  "type": "option"
2981
3307
  },
2982
- "config": {
2983
- "char": "c",
2984
- "description": "Path to config file (for database connection and AI settings)",
2985
- "name": "config",
2986
- "default": "./config.json",
3308
+ "filter": {
3309
+ "char": "f",
3310
+ "description": "Only include classes extending this base class. Can be repeated (e.g., --filter BaseEngine --filter BaseAction).",
3311
+ "name": "filter",
2987
3312
  "hasDynamicHelp": false,
2988
- "multiple": false,
3313
+ "multiple": true,
2989
3314
  "type": "option"
2990
3315
  },
2991
- "queries-per-table": {
2992
- "description": "Number of queries to generate per table",
2993
- "name": "queries-per-table",
2994
- "required": false,
3316
+ "exclude-packages": {
3317
+ "char": "e",
3318
+ "description": "Skip packages whose name starts with this prefix. Useful for excluding @memberjunction packages when using pre-built bootstrap manifests. Can be repeated.",
3319
+ "name": "exclude-packages",
2995
3320
  "hasDynamicHelp": false,
2996
- "multiple": false,
3321
+ "multiple": true,
2997
3322
  "type": "option"
2998
3323
  },
2999
- "max-execution-time": {
3000
- "description": "Maximum execution time for query validation (ms)",
3001
- "name": "max-execution-time",
3002
- "required": false,
3324
+ "no-sync-deps": {
3325
+ "description": "Skip automatic dependency reconciliation. By default, the manifest generator adds any manifest-imported packages that are missing from package.json dependencies. Use this flag when generating supplemental manifests with --exclude-packages, where excluded packages are already covered by a pre-built bootstrap manifest.",
3326
+ "name": "no-sync-deps",
3327
+ "allowNo": false,
3328
+ "type": "boolean"
3329
+ },
3330
+ "quiet": {
3331
+ "char": "q",
3332
+ "description": "Suppress all output except errors.",
3333
+ "name": "quiet",
3334
+ "allowNo": false,
3335
+ "type": "boolean"
3336
+ },
3337
+ "verbose": {
3338
+ "char": "v",
3339
+ "description": "Show detailed progress including per-package scanning info and skipped classes.",
3340
+ "name": "verbose",
3341
+ "allowNo": false,
3342
+ "type": "boolean"
3343
+ },
3344
+ "scan-dist": {
3345
+ "description": "Scan compiled JavaScript files in dist/ directories for packages without src/. Use this when your dependency tree includes npm-published packages that contain @RegisterClass decorators. Without this flag, only TypeScript source in src/ is scanned.",
3346
+ "name": "scan-dist",
3347
+ "allowNo": false,
3348
+ "type": "boolean"
3349
+ },
3350
+ "lazy-config": {
3351
+ "description": "Output path for a generated lazy-loading feature config file. Maps @RegisterClass keys from excluded packages to dynamic import() loaders based on package.json subpath exports. Only packages with subpath exports in their package.json are included. Requires --exclude-packages.",
3352
+ "name": "lazy-config",
3003
3353
  "hasDynamicHelp": false,
3004
3354
  "multiple": false,
3005
3355
  "type": "option"
3356
+ },
3357
+ "strict": {
3358
+ "description": "Treat coverage audit gaps as fatal errors. A gap is a @RegisterClass class in an excluded package that is not reachable from any lazy chunk subpath export. Use in CI to catch tree-shaking issues before merge.",
3359
+ "name": "strict",
3360
+ "allowNo": false,
3361
+ "type": "boolean"
3362
+ },
3363
+ "open-app-client-bootstrap": {
3364
+ "description": "After generating the manifest, append a managed block of side-effect imports — one per Open App client package recorded in mj.config `dynamicPackages.client` — so installed apps' client classes register when the client bundle loads. Used by MJExplorer's prebuild; requires --output.",
3365
+ "name": "open-app-client-bootstrap",
3366
+ "allowNo": false,
3367
+ "type": "boolean"
3006
3368
  }
3007
3369
  },
3008
3370
  "hasDynamicHelp": false,
3009
3371
  "hiddenAliases": [],
3010
- "id": "dbdoc:generate-queries",
3372
+ "id": "codegen:manifest",
3011
3373
  "pluginAlias": "@memberjunction/cli",
3012
3374
  "pluginName": "@memberjunction/cli",
3013
3375
  "pluginType": "core",
@@ -3017,19 +3379,31 @@
3017
3379
  "relativePath": [
3018
3380
  "dist",
3019
3381
  "commands",
3020
- "dbdoc",
3021
- "generate-queries.js"
3382
+ "codegen",
3383
+ "manifest.js"
3022
3384
  ]
3023
3385
  },
3024
- "dbdoc": {
3386
+ "codegen:usage": {
3025
3387
  "aliases": [],
3026
3388
  "args": {},
3027
- "description": "AI-powered database documentation generator",
3028
- "flags": {},
3389
+ "description": "Show usage, flags, examples, and runtime hints for `mj codegen`.",
3390
+ "flags": {
3391
+ "format": {
3392
+ "description": "Output format. Defaults to text on a terminal and json when stdout is piped.",
3393
+ "name": "format",
3394
+ "hasDynamicHelp": false,
3395
+ "multiple": false,
3396
+ "options": [
3397
+ "text",
3398
+ "json",
3399
+ "md"
3400
+ ],
3401
+ "type": "option"
3402
+ }
3403
+ },
3029
3404
  "hasDynamicHelp": false,
3030
- "hidden": false,
3031
3405
  "hiddenAliases": [],
3032
- "id": "dbdoc",
3406
+ "id": "codegen:usage",
3033
3407
  "pluginAlias": "@memberjunction/cli",
3034
3408
  "pluginName": "@memberjunction/cli",
3035
3409
  "pluginType": "core",
@@ -3039,21 +3413,38 @@
3039
3413
  "relativePath": [
3040
3414
  "dist",
3041
3415
  "commands",
3042
- "dbdoc",
3043
- "index.js"
3416
+ "codegen",
3417
+ "usage.js"
3044
3418
  ]
3045
3419
  },
3046
- "dbdoc:init": {
3420
+ "queue:backlog": {
3047
3421
  "aliases": [],
3048
3422
  "args": {},
3049
- "description": "Initialize DBAutoDoc project (delegates to db-auto-doc init)",
3423
+ "description": "Show the autoscaler metric for one subscription: claimable pending plus in-flight deliveries",
3050
3424
  "examples": [
3051
- "<%= config.bin %> <%= command.id %>"
3425
+ "<%= config.bin %> <%= command.id %> --subscription venue-import",
3426
+ "<%= config.bin %> <%= command.id %> --subscription venue-import --json"
3052
3427
  ],
3053
- "flags": {},
3428
+ "flags": {
3429
+ "subscription": {
3430
+ "char": "s",
3431
+ "description": "Subscription name",
3432
+ "name": "subscription",
3433
+ "required": true,
3434
+ "hasDynamicHelp": false,
3435
+ "multiple": false,
3436
+ "type": "option"
3437
+ },
3438
+ "json": {
3439
+ "description": "Print JSON instead of text",
3440
+ "name": "json",
3441
+ "allowNo": false,
3442
+ "type": "boolean"
3443
+ }
3444
+ },
3054
3445
  "hasDynamicHelp": false,
3055
3446
  "hiddenAliases": [],
3056
- "id": "dbdoc:init",
3447
+ "id": "queue:backlog",
3057
3448
  "pluginAlias": "@memberjunction/cli",
3058
3449
  "pluginName": "@memberjunction/cli",
3059
3450
  "pluginType": "core",
@@ -3063,30 +3454,52 @@
3063
3454
  "relativePath": [
3064
3455
  "dist",
3065
3456
  "commands",
3066
- "dbdoc",
3067
- "init.js"
3457
+ "queue",
3458
+ "backlog.js"
3068
3459
  ]
3069
3460
  },
3070
- "dbdoc:reset": {
3461
+ "queue:dead-letters": {
3071
3462
  "aliases": [],
3072
3463
  "args": {},
3073
- "description": "Reset analysis state (delegates to db-auto-doc reset)",
3464
+ "description": "List a work-queue subscription's dead-lettered deliveries",
3074
3465
  "examples": [
3075
- "<%= config.bin %> <%= command.id %>",
3076
- "<%= config.bin %> <%= command.id %> --force"
3466
+ "<%= config.bin %> <%= command.id %> --subscription integration.apply --page-size 20"
3077
3467
  ],
3078
3468
  "flags": {
3079
- "force": {
3080
- "char": "f",
3081
- "description": "Force reset without confirmation",
3082
- "name": "force",
3469
+ "subscription": {
3470
+ "char": "s",
3471
+ "description": "Subscription name",
3472
+ "name": "subscription",
3473
+ "required": true,
3474
+ "hasDynamicHelp": false,
3475
+ "multiple": false,
3476
+ "type": "option"
3477
+ },
3478
+ "cursor": {
3479
+ "description": "nextCursor from a previous page",
3480
+ "name": "cursor",
3481
+ "hasDynamicHelp": false,
3482
+ "multiple": false,
3483
+ "type": "option"
3484
+ },
3485
+ "page-size": {
3486
+ "description": "Items per page (1–500)",
3487
+ "name": "page-size",
3488
+ "default": 50,
3489
+ "hasDynamicHelp": false,
3490
+ "multiple": false,
3491
+ "type": "option"
3492
+ },
3493
+ "json": {
3494
+ "description": "Print JSON instead of a table",
3495
+ "name": "json",
3083
3496
  "allowNo": false,
3084
3497
  "type": "boolean"
3085
3498
  }
3086
3499
  },
3087
3500
  "hasDynamicHelp": false,
3088
3501
  "hiddenAliases": [],
3089
- "id": "dbdoc:reset",
3502
+ "id": "queue:dead-letters",
3090
3503
  "pluginAlias": "@memberjunction/cli",
3091
3504
  "pluginName": "@memberjunction/cli",
3092
3505
  "pluginType": "core",
@@ -3096,23 +3509,41 @@
3096
3509
  "relativePath": [
3097
3510
  "dist",
3098
3511
  "commands",
3099
- "dbdoc",
3100
- "reset.js"
3512
+ "queue",
3513
+ "dead-letters.js"
3101
3514
  ]
3102
3515
  },
3103
- "dbdoc:status": {
3516
+ "queue:discard": {
3104
3517
  "aliases": [],
3105
3518
  "args": {},
3106
- "description": "Show analysis status and progress (delegates to db-auto-doc status)",
3519
+ "description": "Discard one pending or dead-lettered work-queue delivery, or cancel one that is in flight",
3107
3520
  "examples": [
3108
- "<%= config.bin %> <%= command.id %>",
3109
- "<%= config.bin %> <%= command.id %> --state-file ./custom-state.json"
3521
+ "<%= config.bin %> <%= command.id %> --subscription integration.apply --delivery <id> --reason \"bad batch, republished\""
3110
3522
  ],
3111
3523
  "flags": {
3112
- "state-file": {
3524
+ "subscription": {
3113
3525
  "char": "s",
3114
- "description": "Path to state JSON file",
3115
- "name": "state-file",
3526
+ "description": "Subscription name",
3527
+ "name": "subscription",
3528
+ "required": true,
3529
+ "hasDynamicHelp": false,
3530
+ "multiple": false,
3531
+ "type": "option"
3532
+ },
3533
+ "delivery": {
3534
+ "char": "d",
3535
+ "description": "DeliveryID to discard",
3536
+ "name": "delivery",
3537
+ "required": true,
3538
+ "hasDynamicHelp": false,
3539
+ "multiple": false,
3540
+ "type": "option"
3541
+ },
3542
+ "reason": {
3543
+ "char": "r",
3544
+ "description": "Why the work is dropped (at most 1000 characters)",
3545
+ "name": "reason",
3546
+ "required": true,
3116
3547
  "hasDynamicHelp": false,
3117
3548
  "multiple": false,
3118
3549
  "type": "option"
@@ -3120,7 +3551,7 @@
3120
3551
  },
3121
3552
  "hasDynamicHelp": false,
3122
3553
  "hiddenAliases": [],
3123
- "id": "dbdoc:status",
3554
+ "id": "queue:discard",
3124
3555
  "pluginAlias": "@memberjunction/cli",
3125
3556
  "pluginName": "@memberjunction/cli",
3126
3557
  "pluginType": "core",
@@ -3130,31 +3561,39 @@
3130
3561
  "relativePath": [
3131
3562
  "dist",
3132
3563
  "commands",
3133
- "dbdoc",
3134
- "status.js"
3564
+ "queue",
3565
+ "discard.js"
3135
3566
  ]
3136
3567
  },
3137
- "dbdoc:usage": {
3568
+ "queue:export-topology": {
3138
3569
  "aliases": [],
3139
3570
  "args": {},
3140
- "description": "Show usage, flags, examples, and runtime hints for every `mj dbdoc` command.",
3571
+ "description": "Write the topology manifest for one transport (input to the Terraform module)",
3572
+ "examples": [
3573
+ "<%= config.bin %> <%= command.id %> --transport AWS-prod --output infrastructure/work-queue/manifest.json"
3574
+ ],
3141
3575
  "flags": {
3142
- "format": {
3143
- "description": "Output format. Defaults to text on a terminal and json when stdout is piped.",
3144
- "name": "format",
3576
+ "transport": {
3577
+ "char": "t",
3578
+ "description": "Transport name",
3579
+ "name": "transport",
3580
+ "required": true,
3581
+ "hasDynamicHelp": false,
3582
+ "multiple": false,
3583
+ "type": "option"
3584
+ },
3585
+ "output": {
3586
+ "char": "o",
3587
+ "description": "File to write; stdout when omitted",
3588
+ "name": "output",
3145
3589
  "hasDynamicHelp": false,
3146
3590
  "multiple": false,
3147
- "options": [
3148
- "text",
3149
- "json",
3150
- "md"
3151
- ],
3152
3591
  "type": "option"
3153
3592
  }
3154
3593
  },
3155
3594
  "hasDynamicHelp": false,
3156
3595
  "hiddenAliases": [],
3157
- "id": "dbdoc:usage",
3596
+ "id": "queue:export-topology",
3158
3597
  "pluginAlias": "@memberjunction/cli",
3159
3598
  "pluginName": "@memberjunction/cli",
3160
3599
  "pluginType": "core",
@@ -3164,40 +3603,34 @@
3164
3603
  "relativePath": [
3165
3604
  "dist",
3166
3605
  "commands",
3167
- "dbdoc",
3168
- "usage.js"
3606
+ "queue",
3607
+ "export-topology.js"
3169
3608
  ]
3170
3609
  },
3171
- "querygen:export": {
3610
+ "queue:import-bindings": {
3172
3611
  "aliases": [],
3173
- "args": {},
3174
- "description": "Export queries from database to metadata files",
3612
+ "args": {
3613
+ "file": {
3614
+ "description": "BindingImport JSON file",
3615
+ "name": "file",
3616
+ "required": true
3617
+ }
3618
+ },
3619
+ "description": "Record cloud resource bindings (Terraform output) on work-queue topics and subscriptions",
3175
3620
  "examples": [
3176
- "<%= config.bin %> <%= command.id %>",
3177
- "<%= config.bin %> <%= command.id %> --output ./metadata/queries",
3178
- "<%= config.bin %> <%= command.id %> --verbose"
3621
+ "terraform output -json mj_work_queue_bindings > bindings.json && <%= config.bin %> <%= command.id %> bindings.json"
3179
3622
  ],
3180
3623
  "flags": {
3181
- "output": {
3182
- "char": "o",
3183
- "description": "Output directory",
3184
- "name": "output",
3185
- "default": "./metadata/queries",
3186
- "hasDynamicHelp": false,
3187
- "multiple": false,
3188
- "type": "option"
3189
- },
3190
- "verbose": {
3191
- "char": "v",
3192
- "description": "Verbose output",
3193
- "name": "verbose",
3624
+ "json": {
3625
+ "description": "Print issues as JSON",
3626
+ "name": "json",
3194
3627
  "allowNo": false,
3195
3628
  "type": "boolean"
3196
3629
  }
3197
3630
  },
3198
3631
  "hasDynamicHelp": false,
3199
3632
  "hiddenAliases": [],
3200
- "id": "querygen:export",
3633
+ "id": "queue:import-bindings",
3201
3634
  "pluginAlias": "@memberjunction/cli",
3202
3635
  "pluginName": "@memberjunction/cli",
3203
3636
  "pluginType": "core",
@@ -3207,126 +3640,90 @@
3207
3640
  "relativePath": [
3208
3641
  "dist",
3209
3642
  "commands",
3210
- "querygen",
3211
- "export.js"
3643
+ "queue",
3644
+ "import-bindings.js"
3212
3645
  ]
3213
3646
  },
3214
- "querygen:generate": {
3647
+ "queue": {
3215
3648
  "aliases": [],
3216
3649
  "args": {},
3217
- "description": "Generate SQL query templates for entities using AI",
3650
+ "description": "Operate the durable work queue",
3218
3651
  "examples": [
3219
- "<%= config.bin %> <%= command.id %>",
3220
- "<%= config.bin %> <%= command.id %> --entities \"Customers,Orders\"",
3221
- "<%= config.bin %> <%= command.id %> --max-entities 5 --verbose",
3222
- "<%= config.bin %> <%= command.id %> --mode database"
3652
+ "<%= config.bin %> <%= command.id %> publish --topic samples.hello --payload '{\"name\":\"Paul\"}'",
3653
+ "<%= config.bin %> <%= command.id %> stats",
3654
+ "<%= config.bin %> <%= command.id %> dead-letters --subscription email.unsubscribe"
3655
+ ],
3656
+ "flags": {},
3657
+ "hasDynamicHelp": false,
3658
+ "hiddenAliases": [],
3659
+ "id": "queue",
3660
+ "pluginAlias": "@memberjunction/cli",
3661
+ "pluginName": "@memberjunction/cli",
3662
+ "pluginType": "core",
3663
+ "strict": true,
3664
+ "enableJsonFlag": false,
3665
+ "isESM": true,
3666
+ "relativePath": [
3667
+ "dist",
3668
+ "commands",
3669
+ "queue",
3670
+ "index.js"
3671
+ ]
3672
+ },
3673
+ "queue:partitions": {
3674
+ "aliases": [],
3675
+ "args": {},
3676
+ "description": "List a work-queue subscription's in-flight or blocked partition keys",
3677
+ "examples": [
3678
+ "<%= config.bin %> <%= command.id %> --subscription integration.apply --condition Blocked"
3223
3679
  ],
3224
3680
  "flags": {
3225
- "entities": {
3226
- "char": "e",
3227
- "description": "Specific entities to generate queries for (comma-separated)",
3228
- "name": "entities",
3229
- "hasDynamicHelp": false,
3230
- "multiple": false,
3231
- "type": "option"
3232
- },
3233
- "exclude-entities": {
3234
- "char": "x",
3235
- "description": "Entities to exclude (comma-separated)",
3236
- "name": "exclude-entities",
3237
- "hasDynamicHelp": false,
3238
- "multiple": false,
3239
- "type": "option"
3240
- },
3241
- "exclude-schemas": {
3681
+ "subscription": {
3242
3682
  "char": "s",
3243
- "description": "Schemas to exclude (comma-separated)",
3244
- "name": "exclude-schemas",
3245
- "hasDynamicHelp": false,
3246
- "multiple": false,
3247
- "type": "option"
3248
- },
3249
- "max-entities": {
3250
- "char": "m",
3251
- "description": "Max entities per group",
3252
- "name": "max-entities",
3253
- "default": 3,
3254
- "hasDynamicHelp": false,
3255
- "multiple": false,
3256
- "type": "option"
3257
- },
3258
- "target-groups": {
3259
- "char": "t",
3260
- "description": "Target number of entity groups to generate",
3261
- "name": "target-groups",
3262
- "default": 75,
3263
- "hasDynamicHelp": false,
3264
- "multiple": false,
3265
- "type": "option"
3266
- },
3267
- "max-refinements": {
3268
- "char": "r",
3269
- "description": "Max refinement iterations",
3270
- "name": "max-refinements",
3271
- "default": 3,
3272
- "hasDynamicHelp": false,
3273
- "multiple": false,
3274
- "type": "option"
3275
- },
3276
- "max-fixes": {
3277
- "char": "f",
3278
- "description": "Max error-fixing attempts",
3279
- "name": "max-fixes",
3280
- "default": 5,
3281
- "hasDynamicHelp": false,
3282
- "multiple": false,
3283
- "type": "option"
3284
- },
3285
- "model": {
3286
- "description": "Preferred AI model",
3287
- "name": "model",
3683
+ "description": "Subscription name",
3684
+ "name": "subscription",
3685
+ "required": true,
3288
3686
  "hasDynamicHelp": false,
3289
3687
  "multiple": false,
3290
3688
  "type": "option"
3291
3689
  },
3292
- "vendor": {
3293
- "description": "Preferred AI vendor",
3294
- "name": "vendor",
3690
+ "condition": {
3691
+ "description": "Only keys in this condition",
3692
+ "name": "condition",
3295
3693
  "hasDynamicHelp": false,
3296
3694
  "multiple": false,
3695
+ "options": [
3696
+ "Idle",
3697
+ "InFlight",
3698
+ "Blocked"
3699
+ ],
3297
3700
  "type": "option"
3298
3701
  },
3299
- "output": {
3300
- "char": "o",
3301
- "description": "Output directory",
3302
- "name": "output",
3702
+ "cursor": {
3703
+ "description": "nextCursor from a previous page",
3704
+ "name": "cursor",
3303
3705
  "hasDynamicHelp": false,
3304
3706
  "multiple": false,
3305
3707
  "type": "option"
3306
3708
  },
3307
- "mode": {
3308
- "description": "Output mode: metadata|database|both",
3309
- "name": "mode",
3709
+ "page-size": {
3710
+ "description": "Items per page (1–500)",
3711
+ "name": "page-size",
3712
+ "default": 50,
3310
3713
  "hasDynamicHelp": false,
3311
3714
  "multiple": false,
3312
- "options": [
3313
- "metadata",
3314
- "database",
3315
- "both"
3316
- ],
3317
3715
  "type": "option"
3318
3716
  },
3319
- "verbose": {
3320
- "char": "v",
3321
- "description": "Verbose output",
3322
- "name": "verbose",
3717
+ "json": {
3718
+ "description": "Print JSON instead of a table",
3719
+ "name": "json",
3323
3720
  "allowNo": false,
3324
3721
  "type": "boolean"
3325
3722
  }
3326
3723
  },
3327
3724
  "hasDynamicHelp": false,
3328
3725
  "hiddenAliases": [],
3329
- "id": "querygen:generate",
3726
+ "id": "queue:partitions",
3330
3727
  "pluginAlias": "@memberjunction/cli",
3331
3728
  "pluginName": "@memberjunction/cli",
3332
3729
  "pluginType": "core",
@@ -3336,31 +3733,80 @@
3336
3733
  "relativePath": [
3337
3734
  "dist",
3338
3735
  "commands",
3339
- "querygen",
3340
- "generate.js"
3736
+ "queue",
3737
+ "partitions.js"
3341
3738
  ]
3342
3739
  },
3343
- "querygen:usage": {
3740
+ "queue:publish": {
3344
3741
  "aliases": [],
3345
3742
  "args": {},
3346
- "description": "Show usage, flags, examples, and runtime hints for every `mj querygen` command.",
3743
+ "description": "Publish messages to a work-queue topic from this machine through MJ code (no API key needed)",
3744
+ "examples": [
3745
+ "<%= config.bin %> <%= command.id %> --topic samples.hello --payload '{\"name\":\"Paul\"}'",
3746
+ "<%= config.bin %> <%= command.id %> --topic samples.hello --payload '{\"sleepMs\":60000}' --partition-key customer-42",
3747
+ "<%= config.bin %> <%= command.id %> --topic samples.hello --count 5 --partition-key k1 --attribute source=demo"
3748
+ ],
3347
3749
  "flags": {
3348
- "format": {
3349
- "description": "Output format. Defaults to text on a terminal and json when stdout is piped.",
3350
- "name": "format",
3750
+ "topic": {
3751
+ "char": "t",
3752
+ "description": "Topic name",
3753
+ "name": "topic",
3754
+ "required": true,
3755
+ "hasDynamicHelp": false,
3756
+ "multiple": false,
3757
+ "type": "option"
3758
+ },
3759
+ "payload": {
3760
+ "char": "p",
3761
+ "description": "Message payload as JSON",
3762
+ "name": "payload",
3763
+ "default": "{}",
3764
+ "hasDynamicHelp": false,
3765
+ "multiple": false,
3766
+ "type": "option"
3767
+ },
3768
+ "partition-key": {
3769
+ "char": "k",
3770
+ "description": "PartitionKey for Exclusive / Ordered subscriptions",
3771
+ "name": "partition-key",
3772
+ "hasDynamicHelp": false,
3773
+ "multiple": false,
3774
+ "type": "option"
3775
+ },
3776
+ "dedup-key": {
3777
+ "description": "DeduplicationKey: a repeat within the topic TTL is reported as Duplicate",
3778
+ "name": "dedup-key",
3779
+ "hasDynamicHelp": false,
3780
+ "multiple": false,
3781
+ "type": "option"
3782
+ },
3783
+ "attribute": {
3784
+ "char": "a",
3785
+ "description": "Message attribute as key=value (repeatable)",
3786
+ "name": "attribute",
3787
+ "hasDynamicHelp": false,
3788
+ "multiple": true,
3789
+ "type": "option"
3790
+ },
3791
+ "count": {
3792
+ "char": "n",
3793
+ "description": "How many copies to publish in one batch",
3794
+ "name": "count",
3795
+ "default": 1,
3351
3796
  "hasDynamicHelp": false,
3352
3797
  "multiple": false,
3353
- "options": [
3354
- "text",
3355
- "json",
3356
- "md"
3357
- ],
3358
3798
  "type": "option"
3799
+ },
3800
+ "json": {
3801
+ "description": "Print the publish results as JSON",
3802
+ "name": "json",
3803
+ "allowNo": false,
3804
+ "type": "boolean"
3359
3805
  }
3360
3806
  },
3361
3807
  "hasDynamicHelp": false,
3362
3808
  "hiddenAliases": [],
3363
- "id": "querygen:usage",
3809
+ "id": "queue:publish",
3364
3810
  "pluginAlias": "@memberjunction/cli",
3365
3811
  "pluginName": "@memberjunction/cli",
3366
3812
  "pluginType": "core",
@@ -3370,40 +3816,47 @@
3370
3816
  "relativePath": [
3371
3817
  "dist",
3372
3818
  "commands",
3373
- "querygen",
3374
- "usage.js"
3819
+ "queue",
3820
+ "publish.js"
3375
3821
  ]
3376
3822
  },
3377
- "querygen:validate": {
3823
+ "queue:replay": {
3378
3824
  "aliases": [],
3379
3825
  "args": {},
3380
- "description": "Validate existing query templates",
3826
+ "description": "Replay one dead-lettered work-queue delivery",
3381
3827
  "examples": [
3382
- "<%= config.bin %> <%= command.id %>",
3383
- "<%= config.bin %> <%= command.id %> --path ./metadata/queries",
3384
- "<%= config.bin %> <%= command.id %> --verbose"
3828
+ "<%= config.bin %> <%= command.id %> --subscription integration.apply --delivery <id> --note \"mapping fixed\""
3385
3829
  ],
3386
3830
  "flags": {
3387
- "path": {
3388
- "char": "p",
3389
- "description": "Path to queries metadata file or directory",
3390
- "name": "path",
3391
- "default": "./metadata/queries",
3831
+ "subscription": {
3832
+ "char": "s",
3833
+ "description": "Subscription name",
3834
+ "name": "subscription",
3835
+ "required": true,
3392
3836
  "hasDynamicHelp": false,
3393
3837
  "multiple": false,
3394
3838
  "type": "option"
3395
3839
  },
3396
- "verbose": {
3397
- "char": "v",
3398
- "description": "Verbose output",
3399
- "name": "verbose",
3400
- "allowNo": false,
3401
- "type": "boolean"
3840
+ "delivery": {
3841
+ "char": "d",
3842
+ "description": "DeliveryID from `mj queue dead-letters`",
3843
+ "name": "delivery",
3844
+ "required": true,
3845
+ "hasDynamicHelp": false,
3846
+ "multiple": false,
3847
+ "type": "option"
3848
+ },
3849
+ "note": {
3850
+ "description": "Operator note stored with the resolution",
3851
+ "name": "note",
3852
+ "hasDynamicHelp": false,
3853
+ "multiple": false,
3854
+ "type": "option"
3402
3855
  }
3403
3856
  },
3404
3857
  "hasDynamicHelp": false,
3405
3858
  "hiddenAliases": [],
3406
- "id": "querygen:validate",
3859
+ "id": "queue:replay",
3407
3860
  "pluginAlias": "@memberjunction/cli",
3408
3861
  "pluginName": "@memberjunction/cli",
3409
3862
  "pluginType": "core",
@@ -3413,64 +3866,37 @@
3413
3866
  "relativePath": [
3414
3867
  "dist",
3415
3868
  "commands",
3416
- "querygen",
3417
- "validate.js"
3869
+ "queue",
3870
+ "replay.js"
3418
3871
  ]
3419
3872
  },
3420
- "sql-audit": {
3873
+ "queue:stats": {
3421
3874
  "aliases": [],
3422
3875
  "args": {},
3423
- "description": "Compare source and target databases for migration verification",
3876
+ "description": "Show pending, in-flight and dead-lettered counts for work-queue subscriptions",
3424
3877
  "examples": [
3425
- "<%= config.bin %> sql-audit --source \"mssql://sa:pass@host/db\" --target \"postgres://user:pass@host:5432/db\"",
3426
- "<%= config.bin %> sql-audit --source \"mssql://sa:pass@host/db\" --target \"postgres://user:pass@host:5432/db\" --output report.txt",
3427
- "<%= config.bin %> sql-audit --source \"mssql://sa:pass@host/db\" --target \"postgres://user:pass@host:5432/db\" --source-schema __mj --target-schema __mj"
3878
+ "<%= config.bin %> <%= command.id %>",
3879
+ "<%= config.bin %> <%= command.id %> --subscription email.unsubscribe --json"
3428
3880
  ],
3429
3881
  "flags": {
3430
- "source": {
3431
- "description": "Source database connection string (mssql://... or postgres://...)",
3432
- "name": "source",
3433
- "required": true,
3434
- "hasDynamicHelp": false,
3435
- "multiple": false,
3436
- "type": "option"
3437
- },
3438
- "target": {
3439
- "description": "Target database connection string (mssql://... or postgres://...)",
3440
- "name": "target",
3441
- "required": true,
3442
- "hasDynamicHelp": false,
3443
- "multiple": false,
3444
- "type": "option"
3445
- },
3446
- "source-schema": {
3447
- "description": "Source schema name",
3448
- "name": "source-schema",
3449
- "default": "__mj",
3450
- "hasDynamicHelp": false,
3451
- "multiple": false,
3452
- "type": "option"
3453
- },
3454
- "target-schema": {
3455
- "description": "Target schema name",
3456
- "name": "target-schema",
3457
- "default": "__mj",
3882
+ "subscription": {
3883
+ "char": "s",
3884
+ "description": "Subscription name; omit for every subscription",
3885
+ "name": "subscription",
3458
3886
  "hasDynamicHelp": false,
3459
3887
  "multiple": false,
3460
3888
  "type": "option"
3461
3889
  },
3462
- "output": {
3463
- "char": "o",
3464
- "description": "Save report to file",
3465
- "name": "output",
3466
- "hasDynamicHelp": false,
3467
- "multiple": false,
3468
- "type": "option"
3890
+ "json": {
3891
+ "description": "Print JSON instead of a table",
3892
+ "name": "json",
3893
+ "allowNo": false,
3894
+ "type": "boolean"
3469
3895
  }
3470
3896
  },
3471
3897
  "hasDynamicHelp": false,
3472
3898
  "hiddenAliases": [],
3473
- "id": "sql-audit",
3899
+ "id": "queue:stats",
3474
3900
  "pluginAlias": "@memberjunction/cli",
3475
3901
  "pluginName": "@memberjunction/cli",
3476
3902
  "pluginType": "core",
@@ -3480,14 +3906,14 @@
3480
3906
  "relativePath": [
3481
3907
  "dist",
3482
3908
  "commands",
3483
- "sql-audit",
3484
- "index.js"
3909
+ "queue",
3910
+ "stats.js"
3485
3911
  ]
3486
3912
  },
3487
- "sql-audit:usage": {
3913
+ "queue:usage": {
3488
3914
  "aliases": [],
3489
3915
  "args": {},
3490
- "description": "Show usage, flags, examples, and runtime hints for every `mj sql-audit` command.",
3916
+ "description": "Show usage, flags, examples, and runtime hints for every `mj queue` command.",
3491
3917
  "flags": {
3492
3918
  "format": {
3493
3919
  "description": "Output format. Defaults to text on a terminal and json when stdout is piped.",
@@ -3504,7 +3930,7 @@
3504
3930
  },
3505
3931
  "hasDynamicHelp": false,
3506
3932
  "hiddenAliases": [],
3507
- "id": "sql-audit:usage",
3933
+ "id": "queue:usage",
3508
3934
  "pluginAlias": "@memberjunction/cli",
3509
3935
  "pluginName": "@memberjunction/cli",
3510
3936
  "pluginType": "core",
@@ -3514,34 +3940,37 @@
3514
3940
  "relativePath": [
3515
3941
  "dist",
3516
3942
  "commands",
3517
- "sql-audit",
3943
+ "queue",
3518
3944
  "usage.js"
3519
3945
  ]
3520
3946
  },
3521
- "rubric:diff": {
3947
+ "queue:validate-bindings": {
3522
3948
  "aliases": [],
3523
- "args": {
3524
- "rubric": {
3525
- "description": "Rubric name or id",
3526
- "name": "rubric",
3527
- "required": true
3528
- },
3529
- "from": {
3530
- "description": "Version 1.2.0 or id",
3531
- "name": "from",
3532
- "required": true
3949
+ "args": {},
3950
+ "description": "Validate work-queue topology and cloud bindings; exits 1 on any error",
3951
+ "examples": [
3952
+ "<%= config.bin %> <%= command.id %>",
3953
+ "<%= config.bin %> <%= command.id %> --transport AWS-prod"
3954
+ ],
3955
+ "flags": {
3956
+ "transport": {
3957
+ "char": "t",
3958
+ "description": "Validate one transport's bindings against its resources",
3959
+ "name": "transport",
3960
+ "hasDynamicHelp": false,
3961
+ "multiple": false,
3962
+ "type": "option"
3533
3963
  },
3534
- "to": {
3535
- "description": "Version 1.2.0 or id",
3536
- "name": "to",
3537
- "required": true
3964
+ "json": {
3965
+ "description": "Print issues as JSON",
3966
+ "name": "json",
3967
+ "allowNo": false,
3968
+ "type": "boolean"
3538
3969
  }
3539
3970
  },
3540
- "description": "Print the version bump between two rubric versions.",
3541
- "flags": {},
3542
3971
  "hasDynamicHelp": false,
3543
3972
  "hiddenAliases": [],
3544
- "id": "rubric:diff",
3973
+ "id": "queue:validate-bindings",
3545
3974
  "pluginAlias": "@memberjunction/cli",
3546
3975
  "pluginName": "@memberjunction/cli",
3547
3976
  "pluginType": "core",
@@ -3551,43 +3980,79 @@
3551
3980
  "relativePath": [
3552
3981
  "dist",
3553
3982
  "commands",
3554
- "rubric",
3555
- "diff.js"
3983
+ "queue",
3984
+ "validate-bindings.js"
3556
3985
  ]
3557
3986
  },
3558
- "rubric:evaluate": {
3987
+ "queue:work": {
3559
3988
  "aliases": [],
3560
3989
  "args": {},
3561
- "description": "Evaluate one record against a rubric. Does not publish.",
3990
+ "description": "Run work-queue subscriptions in this process: once for a container job, or until stopped",
3991
+ "examples": [
3992
+ "<%= config.bin %> <%= command.id %> --subscription venue-import --once",
3993
+ "<%= config.bin %> <%= command.id %> --subscription venue-import --once --max 5 --concurrency 2 --max-duration-ms 3300000",
3994
+ "<%= config.bin %> <%= command.id %> --subscription \"*\""
3995
+ ],
3562
3996
  "flags": {
3563
- "rubric": {
3564
- "description": "Rubric name or id, optionally @version",
3565
- "name": "rubric",
3997
+ "subscription": {
3998
+ "char": "s",
3999
+ "description": "Subscription name, or '*' for every MJWorker subscription",
4000
+ "name": "subscription",
3566
4001
  "required": true,
3567
4002
  "hasDynamicHelp": false,
3568
4003
  "multiple": false,
3569
4004
  "type": "option"
3570
4005
  },
3571
- "entity": {
3572
- "description": "Subject entity name",
3573
- "name": "entity",
3574
- "required": true,
4006
+ "once": {
4007
+ "description": "Receive up to --max deliveries, drain and exit (container-job mode)",
4008
+ "name": "once",
4009
+ "allowNo": false,
4010
+ "type": "boolean"
4011
+ },
4012
+ "max": {
4013
+ "dependsOn": [
4014
+ "once"
4015
+ ],
4016
+ "description": "With --once: how many deliveries to receive",
4017
+ "name": "max",
4018
+ "default": 1,
3575
4019
  "hasDynamicHelp": false,
3576
4020
  "multiple": false,
3577
4021
  "type": "option"
3578
4022
  },
3579
- "record": {
3580
- "description": "Subject record id",
3581
- "name": "record",
3582
- "required": true,
4023
+ "idle-exit-ms": {
4024
+ "dependsOn": [
4025
+ "once"
4026
+ ],
4027
+ "description": "With --once: exit after this long with an empty queue",
4028
+ "name": "idle-exit-ms",
4029
+ "default": 5000,
3583
4030
  "hasDynamicHelp": false,
3584
4031
  "multiple": false,
3585
4032
  "type": "option"
3586
4033
  },
3587
- "evaluator": {
3588
- "description": "LLM or Deterministic",
3589
- "name": "evaluator",
3590
- "default": "LLM",
4034
+ "max-duration-ms": {
4035
+ "dependsOn": [
4036
+ "once"
4037
+ ],
4038
+ "description": "With --once: stop claiming after this long and drain (keep it below the scheduler's job deadline)",
4039
+ "name": "max-duration-ms",
4040
+ "hasDynamicHelp": false,
4041
+ "multiple": false,
4042
+ "type": "option"
4043
+ },
4044
+ "concurrency": {
4045
+ "description": "Handlers in flight per subscription",
4046
+ "name": "concurrency",
4047
+ "default": 1,
4048
+ "hasDynamicHelp": false,
4049
+ "multiple": false,
4050
+ "type": "option"
4051
+ },
4052
+ "shutdown-drain-ms": {
4053
+ "description": "How long in-flight handlers get to finish on exit; the drain can take twice this",
4054
+ "name": "shutdown-drain-ms",
4055
+ "default": 30000,
3591
4056
  "hasDynamicHelp": false,
3592
4057
  "multiple": false,
3593
4058
  "type": "option"
@@ -3595,28 +4060,7 @@
3595
4060
  },
3596
4061
  "hasDynamicHelp": false,
3597
4062
  "hiddenAliases": [],
3598
- "id": "rubric:evaluate",
3599
- "pluginAlias": "@memberjunction/cli",
3600
- "pluginName": "@memberjunction/cli",
3601
- "pluginType": "core",
3602
- "strict": true,
3603
- "enableJsonFlag": false,
3604
- "isESM": true,
3605
- "relativePath": [
3606
- "dist",
3607
- "commands",
3608
- "rubric",
3609
- "evaluate.js"
3610
- ]
3611
- },
3612
- "rubric": {
3613
- "aliases": [],
3614
- "args": {},
3615
- "description": "List, show, diff, validate, and evaluate rubrics.",
3616
- "flags": {},
3617
- "hasDynamicHelp": false,
3618
- "hiddenAliases": [],
3619
- "id": "rubric",
4063
+ "id": "queue:work",
3620
4064
  "pluginAlias": "@memberjunction/cli",
3621
4065
  "pluginName": "@memberjunction/cli",
3622
4066
  "pluginType": "core",
@@ -3626,45 +4070,64 @@
3626
4070
  "relativePath": [
3627
4071
  "dist",
3628
4072
  "commands",
3629
- "rubric",
3630
- "index.js"
4073
+ "queue",
4074
+ "work.js"
3631
4075
  ]
3632
4076
  },
3633
- "rubric:list": {
4077
+ "sql-audit": {
3634
4078
  "aliases": [],
3635
4079
  "args": {},
3636
- "description": "List rubrics.",
3637
- "flags": {},
3638
- "hasDynamicHelp": false,
3639
- "hiddenAliases": [],
3640
- "id": "rubric:list",
3641
- "pluginAlias": "@memberjunction/cli",
3642
- "pluginName": "@memberjunction/cli",
3643
- "pluginType": "core",
3644
- "strict": true,
3645
- "enableJsonFlag": false,
3646
- "isESM": true,
3647
- "relativePath": [
3648
- "dist",
3649
- "commands",
3650
- "rubric",
3651
- "list.js"
3652
- ]
3653
- },
3654
- "rubric:show": {
3655
- "aliases": [],
3656
- "args": {
3657
- "rubric": {
3658
- "description": "Rubric name or id, optionally @version",
3659
- "name": "rubric",
3660
- "required": true
4080
+ "description": "Compare source and target databases for migration verification",
4081
+ "examples": [
4082
+ "<%= config.bin %> sql-audit --source \"mssql://sa:pass@host/db\" --target \"postgres://user:pass@host:5432/db\"",
4083
+ "<%= config.bin %> sql-audit --source \"mssql://sa:pass@host/db\" --target \"postgres://user:pass@host:5432/db\" --output report.txt",
4084
+ "<%= config.bin %> sql-audit --source \"mssql://sa:pass@host/db\" --target \"postgres://user:pass@host:5432/db\" --source-schema __mj --target-schema __mj"
4085
+ ],
4086
+ "flags": {
4087
+ "source": {
4088
+ "description": "Source database connection string (mssql://... or postgres://...)",
4089
+ "name": "source",
4090
+ "required": true,
4091
+ "hasDynamicHelp": false,
4092
+ "multiple": false,
4093
+ "type": "option"
4094
+ },
4095
+ "target": {
4096
+ "description": "Target database connection string (mssql://... or postgres://...)",
4097
+ "name": "target",
4098
+ "required": true,
4099
+ "hasDynamicHelp": false,
4100
+ "multiple": false,
4101
+ "type": "option"
4102
+ },
4103
+ "source-schema": {
4104
+ "description": "Source schema name",
4105
+ "name": "source-schema",
4106
+ "default": "__mj",
4107
+ "hasDynamicHelp": false,
4108
+ "multiple": false,
4109
+ "type": "option"
4110
+ },
4111
+ "target-schema": {
4112
+ "description": "Target schema name",
4113
+ "name": "target-schema",
4114
+ "default": "__mj",
4115
+ "hasDynamicHelp": false,
4116
+ "multiple": false,
4117
+ "type": "option"
4118
+ },
4119
+ "output": {
4120
+ "char": "o",
4121
+ "description": "Save report to file",
4122
+ "name": "output",
4123
+ "hasDynamicHelp": false,
4124
+ "multiple": false,
4125
+ "type": "option"
3661
4126
  }
3662
4127
  },
3663
- "description": "Show a rubric version and its criteria.",
3664
- "flags": {},
3665
4128
  "hasDynamicHelp": false,
3666
4129
  "hiddenAliases": [],
3667
- "id": "rubric:show",
4130
+ "id": "sql-audit",
3668
4131
  "pluginAlias": "@memberjunction/cli",
3669
4132
  "pluginName": "@memberjunction/cli",
3670
4133
  "pluginType": "core",
@@ -3674,24 +4137,31 @@
3674
4137
  "relativePath": [
3675
4138
  "dist",
3676
4139
  "commands",
3677
- "rubric",
3678
- "show.js"
4140
+ "sql-audit",
4141
+ "index.js"
3679
4142
  ]
3680
4143
  },
3681
- "rubric:validate": {
4144
+ "sql-audit:usage": {
3682
4145
  "aliases": [],
3683
- "args": {
3684
- "file": {
3685
- "description": "JSON snapshot file",
3686
- "name": "file",
3687
- "required": true
4146
+ "args": {},
4147
+ "description": "Show usage, flags, examples, and runtime hints for every `mj sql-audit` command.",
4148
+ "flags": {
4149
+ "format": {
4150
+ "description": "Output format. Defaults to text on a terminal and json when stdout is piped.",
4151
+ "name": "format",
4152
+ "hasDynamicHelp": false,
4153
+ "multiple": false,
4154
+ "options": [
4155
+ "text",
4156
+ "json",
4157
+ "md"
4158
+ ],
4159
+ "type": "option"
3688
4160
  }
3689
4161
  },
3690
- "description": "Check a rubric snapshot file for duplicate keys, gates, weights, and scales.",
3691
- "flags": {},
3692
4162
  "hasDynamicHelp": false,
3693
4163
  "hiddenAliases": [],
3694
- "id": "rubric:validate",
4164
+ "id": "sql-audit:usage",
3695
4165
  "pluginAlias": "@memberjunction/cli",
3696
4166
  "pluginName": "@memberjunction/cli",
3697
4167
  "pluginType": "core",
@@ -3701,8 +4171,8 @@
3701
4171
  "relativePath": [
3702
4172
  "dist",
3703
4173
  "commands",
3704
- "rubric",
3705
- "validate.js"
4174
+ "sql-audit",
4175
+ "usage.js"
3706
4176
  ]
3707
4177
  },
3708
4178
  "sql-convert": {
@@ -5916,51 +6386,30 @@
5916
6386
  "usage.js"
5917
6387
  ]
5918
6388
  },
5919
- "ai:actions:list": {
6389
+ "rubric:diff": {
5920
6390
  "aliases": [],
5921
- "args": {},
5922
- "description": "List available AI actions",
5923
- "examples": [
5924
- "<%= config.bin %> <%= command.id %>",
5925
- "<%= config.bin %> <%= command.id %> --output=table",
5926
- "<%= config.bin %> <%= command.id %> --output=json"
5927
- ],
5928
- "flags": {
5929
- "format": {
5930
- "description": "Output format: text (human), json (machine-readable), md (Markdown). Defaults to human output on a terminal and json when stdout is piped. Legacy spellings (console/markdown/compact/table) are accepted.",
5931
- "name": "format",
5932
- "hasDynamicHelp": false,
5933
- "multiple": false,
5934
- "options": [
5935
- "text",
5936
- "json",
5937
- "md",
5938
- "human",
5939
- "console",
5940
- "markdown",
5941
- "compact",
5942
- "table"
5943
- ],
5944
- "type": "option"
6391
+ "args": {
6392
+ "rubric": {
6393
+ "description": "Rubric name or id",
6394
+ "name": "rubric",
6395
+ "required": true
5945
6396
  },
5946
- "output": {
5947
- "char": "o",
5948
- "description": "Output format (legacy alias for --format in the 'mj ai' family; elsewhere -o is an output FILE path). Prefer --format.",
5949
- "name": "output",
5950
- "default": "compact",
5951
- "hasDynamicHelp": false,
5952
- "multiple": false,
5953
- "options": [
5954
- "compact",
5955
- "json",
5956
- "table"
5957
- ],
5958
- "type": "option"
6397
+ "from": {
6398
+ "description": "Version 1.2.0 or id",
6399
+ "name": "from",
6400
+ "required": true
6401
+ },
6402
+ "to": {
6403
+ "description": "Version 1.2.0 or id",
6404
+ "name": "to",
6405
+ "required": true
5959
6406
  }
5960
6407
  },
6408
+ "description": "Print the version bump between two rubric versions.",
6409
+ "flags": {},
5961
6410
  "hasDynamicHelp": false,
5962
6411
  "hiddenAliases": [],
5963
- "id": "ai:actions:list",
6412
+ "id": "rubric:diff",
5964
6413
  "pluginAlias": "@memberjunction/cli",
5965
6414
  "pluginName": "@memberjunction/cli",
5966
6415
  "pluginType": "core",
@@ -5970,95 +6419,145 @@
5970
6419
  "relativePath": [
5971
6420
  "dist",
5972
6421
  "commands",
5973
- "ai",
5974
- "actions",
5975
- "list.js"
6422
+ "rubric",
6423
+ "diff.js"
5976
6424
  ]
5977
6425
  },
5978
- "ai:actions:run": {
6426
+ "rubric:evaluate": {
5979
6427
  "aliases": [],
5980
6428
  "args": {},
5981
- "description": "Execute an AI action with parameters",
5982
- "examples": [
5983
- "<%= config.bin %> <%= command.id %> -n \"Get Weather\" --param \"Location=Boston\"",
5984
- "<%= config.bin %> <%= command.id %> -n \"Get Stock Price\" --param \"Ticker=AAPL\"",
5985
- "<%= config.bin %> <%= command.id %> -n \"Send Single Message\" --param \"To=user@example.com\" --param \"Subject=Test\" --param \"Body=Hello\" --param \"MessageType=Email\" --param \"Provider=SendGrid\"",
5986
- "<%= config.bin %> <%= command.id %> -n \"Calculate Expression\" --param \"Expression=2+2*3\" --dry-run"
5987
- ],
6429
+ "description": "Evaluate one record against a rubric. Does not publish.",
5988
6430
  "flags": {
5989
- "name": {
5990
- "char": "n",
5991
- "description": "Action name",
5992
- "name": "name",
6431
+ "rubric": {
6432
+ "description": "Rubric name or id, optionally @version",
6433
+ "name": "rubric",
5993
6434
  "required": true,
5994
6435
  "hasDynamicHelp": false,
5995
6436
  "multiple": false,
5996
6437
  "type": "option"
5997
6438
  },
5998
- "param": {
5999
- "char": "p",
6000
- "description": "Action parameters in key=value format",
6001
- "name": "param",
6439
+ "entity": {
6440
+ "description": "Subject entity name",
6441
+ "name": "entity",
6442
+ "required": true,
6002
6443
  "hasDynamicHelp": false,
6003
- "multiple": true,
6444
+ "multiple": false,
6004
6445
  "type": "option"
6005
6446
  },
6006
- "dry-run": {
6007
- "description": "Validate without executing",
6008
- "name": "dry-run",
6009
- "allowNo": false,
6010
- "type": "boolean"
6447
+ "record": {
6448
+ "description": "Subject record id",
6449
+ "name": "record",
6450
+ "required": true,
6451
+ "hasDynamicHelp": false,
6452
+ "multiple": false,
6453
+ "type": "option"
6011
6454
  },
6012
- "format": {
6013
- "description": "Output format: text (human), json (machine-readable), md (Markdown). Defaults to human output on a terminal and json when stdout is piped. Legacy spellings (console/markdown/compact/table) are accepted.",
6014
- "name": "format",
6455
+ "evaluator": {
6456
+ "description": "A registered evaluator: LLM, Decision, Agent, Deterministic, or a custom one",
6457
+ "name": "evaluator",
6458
+ "default": "LLM",
6015
6459
  "hasDynamicHelp": false,
6016
6460
  "multiple": false,
6017
- "options": [
6018
- "text",
6019
- "json",
6020
- "md",
6021
- "human",
6022
- "console",
6023
- "markdown",
6024
- "compact",
6025
- "table"
6026
- ],
6027
6461
  "type": "option"
6028
6462
  },
6029
- "output": {
6030
- "char": "o",
6031
- "description": "Output format (legacy alias for --format in the 'mj ai' family; elsewhere -o is an output FILE path). Prefer --format.",
6032
- "name": "output",
6033
- "default": "compact",
6463
+ "prompt": {
6464
+ "description": "LLM: the judge prompt composed into Rubric Evaluator (default Rubric Evaluator - Default Judge). Decision: the decision prompt (default Default Decision)",
6465
+ "name": "prompt",
6034
6466
  "hasDynamicHelp": false,
6035
6467
  "multiple": false,
6036
- "options": [
6037
- "compact",
6038
- "json",
6039
- "table"
6040
- ],
6041
6468
  "type": "option"
6042
6469
  },
6043
- "verbose": {
6044
- "char": "v",
6045
- "description": "Show detailed execution information",
6046
- "name": "verbose",
6047
- "allowNo": false,
6048
- "type": "boolean"
6470
+ "model": {
6471
+ "description": "AI Model ID to pin. Otherwise the prompt's bindings choose",
6472
+ "name": "model",
6473
+ "hasDynamicHelp": false,
6474
+ "multiple": false,
6475
+ "type": "option"
6049
6476
  },
6050
- "timeout": {
6051
- "description": "Execution timeout in milliseconds",
6052
- "name": "timeout",
6053
- "default": 300000,
6477
+ "mode": {
6478
+ "description": "LLM only: SinglePass or PerCriterion",
6479
+ "name": "mode",
6054
6480
  "hasDynamicHelp": false,
6055
6481
  "multiple": false,
6482
+ "options": [
6483
+ "SinglePass",
6484
+ "PerCriterion"
6485
+ ],
6056
6486
  "type": "option"
6057
6487
  }
6058
6488
  },
6059
6489
  "hasDynamicHelp": false,
6060
6490
  "hiddenAliases": [],
6061
- "id": "ai:actions:run",
6491
+ "id": "rubric:evaluate",
6492
+ "pluginAlias": "@memberjunction/cli",
6493
+ "pluginName": "@memberjunction/cli",
6494
+ "pluginType": "core",
6495
+ "strict": true,
6496
+ "enableJsonFlag": false,
6497
+ "isESM": true,
6498
+ "relativePath": [
6499
+ "dist",
6500
+ "commands",
6501
+ "rubric",
6502
+ "evaluate.js"
6503
+ ]
6504
+ },
6505
+ "rubric": {
6506
+ "aliases": [],
6507
+ "args": {},
6508
+ "description": "List, show, diff, validate, and evaluate rubrics.",
6509
+ "flags": {},
6510
+ "hasDynamicHelp": false,
6511
+ "hiddenAliases": [],
6512
+ "id": "rubric",
6513
+ "pluginAlias": "@memberjunction/cli",
6514
+ "pluginName": "@memberjunction/cli",
6515
+ "pluginType": "core",
6516
+ "strict": true,
6517
+ "enableJsonFlag": false,
6518
+ "isESM": true,
6519
+ "relativePath": [
6520
+ "dist",
6521
+ "commands",
6522
+ "rubric",
6523
+ "index.js"
6524
+ ]
6525
+ },
6526
+ "rubric:list": {
6527
+ "aliases": [],
6528
+ "args": {},
6529
+ "description": "List rubrics.",
6530
+ "flags": {},
6531
+ "hasDynamicHelp": false,
6532
+ "hiddenAliases": [],
6533
+ "id": "rubric:list",
6534
+ "pluginAlias": "@memberjunction/cli",
6535
+ "pluginName": "@memberjunction/cli",
6536
+ "pluginType": "core",
6537
+ "strict": true,
6538
+ "enableJsonFlag": false,
6539
+ "isESM": true,
6540
+ "relativePath": [
6541
+ "dist",
6542
+ "commands",
6543
+ "rubric",
6544
+ "list.js"
6545
+ ]
6546
+ },
6547
+ "rubric:show": {
6548
+ "aliases": [],
6549
+ "args": {
6550
+ "rubric": {
6551
+ "description": "Rubric name or id, optionally @version",
6552
+ "name": "rubric",
6553
+ "required": true
6554
+ }
6555
+ },
6556
+ "description": "Show a rubric version and its criteria.",
6557
+ "flags": {},
6558
+ "hasDynamicHelp": false,
6559
+ "hiddenAliases": [],
6560
+ "id": "rubric:show",
6062
6561
  "pluginAlias": "@memberjunction/cli",
6063
6562
  "pluginName": "@memberjunction/cli",
6064
6563
  "pluginType": "core",
@@ -6068,15 +6567,41 @@
6068
6567
  "relativePath": [
6069
6568
  "dist",
6070
6569
  "commands",
6071
- "ai",
6072
- "actions",
6073
- "run.js"
6570
+ "rubric",
6571
+ "show.js"
6074
6572
  ]
6075
6573
  },
6076
- "ai:agents:list": {
6574
+ "rubric:validate": {
6575
+ "aliases": [],
6576
+ "args": {
6577
+ "file": {
6578
+ "description": "JSON snapshot file",
6579
+ "name": "file",
6580
+ "required": true
6581
+ }
6582
+ },
6583
+ "description": "Check a rubric snapshot file for duplicate keys, gates, weights, and scales.",
6584
+ "flags": {},
6585
+ "hasDynamicHelp": false,
6586
+ "hiddenAliases": [],
6587
+ "id": "rubric:validate",
6588
+ "pluginAlias": "@memberjunction/cli",
6589
+ "pluginName": "@memberjunction/cli",
6590
+ "pluginType": "core",
6591
+ "strict": true,
6592
+ "enableJsonFlag": false,
6593
+ "isESM": true,
6594
+ "relativePath": [
6595
+ "dist",
6596
+ "commands",
6597
+ "rubric",
6598
+ "validate.js"
6599
+ ]
6600
+ },
6601
+ "ai:actions:list": {
6077
6602
  "aliases": [],
6078
6603
  "args": {},
6079
- "description": "List available AI agents",
6604
+ "description": "List available AI actions",
6080
6605
  "examples": [
6081
6606
  "<%= config.bin %> <%= command.id %>",
6082
6607
  "<%= config.bin %> <%= command.id %> --output=table",
@@ -6117,7 +6642,7 @@
6117
6642
  },
6118
6643
  "hasDynamicHelp": false,
6119
6644
  "hiddenAliases": [],
6120
- "id": "ai:agents:list",
6645
+ "id": "ai:actions:list",
6121
6646
  "pluginAlias": "@memberjunction/cli",
6122
6647
  "pluginName": "@memberjunction/cli",
6123
6648
  "pluginType": "core",
@@ -6128,47 +6653,41 @@
6128
6653
  "dist",
6129
6654
  "commands",
6130
6655
  "ai",
6131
- "agents",
6656
+ "actions",
6132
6657
  "list.js"
6133
6658
  ]
6134
6659
  },
6135
- "ai:agents:run": {
6660
+ "ai:actions:run": {
6136
6661
  "aliases": [],
6137
6662
  "args": {},
6138
- "description": "Execute an AI agent with a prompt or start interactive chat",
6663
+ "description": "Execute an AI action with parameters",
6139
6664
  "examples": [
6140
- "<%= config.bin %> <%= command.id %> -a \"Skip: Requirements Expert\" -p \"Create a dashboard for sales metrics\"",
6141
- "<%= config.bin %> <%= command.id %> -a \"Child Component Generator Sub-agent\" --chat",
6142
- "<%= config.bin %> <%= command.id %> -a \"Skip: Technical Design Expert\" -p \"Build a React component\" --verbose --timeout=600000"
6665
+ "<%= config.bin %> <%= command.id %> -n \"Get Weather\" --param \"Location=Boston\"",
6666
+ "<%= config.bin %> <%= command.id %> -n \"Get Stock Price\" --param \"Ticker=AAPL\"",
6667
+ "<%= config.bin %> <%= command.id %> -n \"Send Single Message\" --param \"To=user@example.com\" --param \"Subject=Test\" --param \"Body=Hello\" --param \"MessageType=Email\" --param \"Provider=SendGrid\"",
6668
+ "<%= config.bin %> <%= command.id %> -n \"Calculate Expression\" --param \"Expression=2+2*3\" --dry-run"
6143
6669
  ],
6144
6670
  "flags": {
6145
- "agent": {
6146
- "char": "a",
6147
- "description": "Agent name",
6148
- "name": "agent",
6671
+ "name": {
6672
+ "char": "n",
6673
+ "description": "Action name",
6674
+ "name": "name",
6149
6675
  "required": true,
6150
6676
  "hasDynamicHelp": false,
6151
6677
  "multiple": false,
6152
6678
  "type": "option"
6153
6679
  },
6154
- "prompt": {
6680
+ "param": {
6155
6681
  "char": "p",
6156
- "description": "Prompt to execute",
6157
- "exclusive": [
6158
- "chat"
6159
- ],
6160
- "name": "prompt",
6682
+ "description": "Action parameters in key=value format",
6683
+ "name": "param",
6161
6684
  "hasDynamicHelp": false,
6162
- "multiple": false,
6685
+ "multiple": true,
6163
6686
  "type": "option"
6164
6687
  },
6165
- "chat": {
6166
- "char": "c",
6167
- "description": "Start interactive chat mode",
6168
- "exclusive": [
6169
- "prompt"
6170
- ],
6171
- "name": "chat",
6688
+ "dry-run": {
6689
+ "description": "Validate without executing",
6690
+ "name": "dry-run",
6172
6691
  "allowNo": false,
6173
6692
  "type": "boolean"
6174
6693
  },
@@ -6221,7 +6740,7 @@
6221
6740
  },
6222
6741
  "hasDynamicHelp": false,
6223
6742
  "hiddenAliases": [],
6224
- "id": "ai:agents:run",
6743
+ "id": "ai:actions:run",
6225
6744
  "pluginAlias": "@memberjunction/cli",
6226
6745
  "pluginName": "@memberjunction/cli",
6227
6746
  "pluginType": "core",
@@ -6232,7 +6751,7 @@
6232
6751
  "dist",
6233
6752
  "commands",
6234
6753
  "ai",
6235
- "agents",
6754
+ "actions",
6236
6755
  "run.js"
6237
6756
  ]
6238
6757
  },
@@ -6469,6 +6988,169 @@
6469
6988
  "index.js"
6470
6989
  ]
6471
6990
  },
6991
+ "ai:agents:list": {
6992
+ "aliases": [],
6993
+ "args": {},
6994
+ "description": "List available AI agents",
6995
+ "examples": [
6996
+ "<%= config.bin %> <%= command.id %>",
6997
+ "<%= config.bin %> <%= command.id %> --output=table",
6998
+ "<%= config.bin %> <%= command.id %> --output=json"
6999
+ ],
7000
+ "flags": {
7001
+ "format": {
7002
+ "description": "Output format: text (human), json (machine-readable), md (Markdown). Defaults to human output on a terminal and json when stdout is piped. Legacy spellings (console/markdown/compact/table) are accepted.",
7003
+ "name": "format",
7004
+ "hasDynamicHelp": false,
7005
+ "multiple": false,
7006
+ "options": [
7007
+ "text",
7008
+ "json",
7009
+ "md",
7010
+ "human",
7011
+ "console",
7012
+ "markdown",
7013
+ "compact",
7014
+ "table"
7015
+ ],
7016
+ "type": "option"
7017
+ },
7018
+ "output": {
7019
+ "char": "o",
7020
+ "description": "Output format (legacy alias for --format in the 'mj ai' family; elsewhere -o is an output FILE path). Prefer --format.",
7021
+ "name": "output",
7022
+ "default": "compact",
7023
+ "hasDynamicHelp": false,
7024
+ "multiple": false,
7025
+ "options": [
7026
+ "compact",
7027
+ "json",
7028
+ "table"
7029
+ ],
7030
+ "type": "option"
7031
+ }
7032
+ },
7033
+ "hasDynamicHelp": false,
7034
+ "hiddenAliases": [],
7035
+ "id": "ai:agents:list",
7036
+ "pluginAlias": "@memberjunction/cli",
7037
+ "pluginName": "@memberjunction/cli",
7038
+ "pluginType": "core",
7039
+ "strict": true,
7040
+ "enableJsonFlag": false,
7041
+ "isESM": true,
7042
+ "relativePath": [
7043
+ "dist",
7044
+ "commands",
7045
+ "ai",
7046
+ "agents",
7047
+ "list.js"
7048
+ ]
7049
+ },
7050
+ "ai:agents:run": {
7051
+ "aliases": [],
7052
+ "args": {},
7053
+ "description": "Execute an AI agent with a prompt or start interactive chat",
7054
+ "examples": [
7055
+ "<%= config.bin %> <%= command.id %> -a \"Skip: Requirements Expert\" -p \"Create a dashboard for sales metrics\"",
7056
+ "<%= config.bin %> <%= command.id %> -a \"Child Component Generator Sub-agent\" --chat",
7057
+ "<%= config.bin %> <%= command.id %> -a \"Skip: Technical Design Expert\" -p \"Build a React component\" --verbose --timeout=600000"
7058
+ ],
7059
+ "flags": {
7060
+ "agent": {
7061
+ "char": "a",
7062
+ "description": "Agent name",
7063
+ "name": "agent",
7064
+ "required": true,
7065
+ "hasDynamicHelp": false,
7066
+ "multiple": false,
7067
+ "type": "option"
7068
+ },
7069
+ "prompt": {
7070
+ "char": "p",
7071
+ "description": "Prompt to execute",
7072
+ "exclusive": [
7073
+ "chat"
7074
+ ],
7075
+ "name": "prompt",
7076
+ "hasDynamicHelp": false,
7077
+ "multiple": false,
7078
+ "type": "option"
7079
+ },
7080
+ "chat": {
7081
+ "char": "c",
7082
+ "description": "Start interactive chat mode",
7083
+ "exclusive": [
7084
+ "prompt"
7085
+ ],
7086
+ "name": "chat",
7087
+ "allowNo": false,
7088
+ "type": "boolean"
7089
+ },
7090
+ "format": {
7091
+ "description": "Output format: text (human), json (machine-readable), md (Markdown). Defaults to human output on a terminal and json when stdout is piped. Legacy spellings (console/markdown/compact/table) are accepted.",
7092
+ "name": "format",
7093
+ "hasDynamicHelp": false,
7094
+ "multiple": false,
7095
+ "options": [
7096
+ "text",
7097
+ "json",
7098
+ "md",
7099
+ "human",
7100
+ "console",
7101
+ "markdown",
7102
+ "compact",
7103
+ "table"
7104
+ ],
7105
+ "type": "option"
7106
+ },
7107
+ "output": {
7108
+ "char": "o",
7109
+ "description": "Output format (legacy alias for --format in the 'mj ai' family; elsewhere -o is an output FILE path). Prefer --format.",
7110
+ "name": "output",
7111
+ "default": "compact",
7112
+ "hasDynamicHelp": false,
7113
+ "multiple": false,
7114
+ "options": [
7115
+ "compact",
7116
+ "json",
7117
+ "table"
7118
+ ],
7119
+ "type": "option"
7120
+ },
7121
+ "verbose": {
7122
+ "char": "v",
7123
+ "description": "Show detailed execution information",
7124
+ "name": "verbose",
7125
+ "allowNo": false,
7126
+ "type": "boolean"
7127
+ },
7128
+ "timeout": {
7129
+ "description": "Execution timeout in milliseconds",
7130
+ "name": "timeout",
7131
+ "default": 300000,
7132
+ "hasDynamicHelp": false,
7133
+ "multiple": false,
7134
+ "type": "option"
7135
+ }
7136
+ },
7137
+ "hasDynamicHelp": false,
7138
+ "hiddenAliases": [],
7139
+ "id": "ai:agents:run",
7140
+ "pluginAlias": "@memberjunction/cli",
7141
+ "pluginName": "@memberjunction/cli",
7142
+ "pluginType": "core",
7143
+ "strict": true,
7144
+ "enableJsonFlag": false,
7145
+ "isESM": true,
7146
+ "relativePath": [
7147
+ "dist",
7148
+ "commands",
7149
+ "ai",
7150
+ "agents",
7151
+ "run.js"
7152
+ ]
7153
+ },
6472
7154
  "ai:prompts:list": {
6473
7155
  "aliases": [],
6474
7156
  "args": {},
@@ -7279,5 +7961,5 @@
7279
7961
  ]
7280
7962
  }
7281
7963
  },
7282
- "version": "6.2.0-edge.2"
7964
+ "version": "6.2.0-edge.3"
7283
7965
  }