@a-company/paradigm 2.0.13 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{auto-IU7VN55K.js → auto-6MOGYQ4G.js} +34 -0
- package/dist/chunk-27OSFWHG.js +199 -0
- package/dist/{chunk-753RICFF.js → chunk-2NMUSZFA.js} +1 -1
- package/dist/{chunk-2M6OSOIG.js → chunk-4WR7X3FE.js} +46 -0
- package/dist/{chunk-YDNKXH4Z.js → chunk-A5BKW7QV.js} +33 -0
- package/dist/{chunk-THFVK5AE.js → chunk-CH6VCTXQ.js} +1 -1
- package/dist/{chunk-5GOA7WYD.js → chunk-MOZPTZ77.js} +1 -1
- package/dist/{chunk-ELLR7WP6.js → chunk-S65LENNL.js} +4 -4
- package/dist/{dist-7MPIRMTZ-IOQOREMZ.js → dist-2F7NO4H4-KSL6SJIO.js} +156 -4182
- package/dist/{doctor-6Y6L6HEB.js → doctor-QMPFQONP.js} +2 -2
- package/dist/{hooks-MBWE4ILT.js → hooks-7TQIRXXS.js} +1 -1
- package/dist/index.js +56 -35
- package/dist/list-QMUE7DPK.js +53 -0
- package/dist/lore-server-3TAIUZ3Y.js +292 -0
- package/dist/mcp.js +856 -114
- package/dist/{promote-Z52ZJTJU.js → promote-E6NBZ3BK.js} +1 -0
- package/dist/record-5CTCDFUO.js +32 -0
- package/dist/review-QEDNQAIO.js +33 -0
- package/dist/{sentinel-LCFD56OJ.js → sentinel-J64XJVTU.js} +1 -1
- package/dist/serve-WCIRW244.js +36 -0
- package/dist/server-SKGY7GFZ.js +269 -0
- package/dist/server-VUYAY7TP.js +6135 -0
- package/dist/{shift-HKIAP4ZN.js → shift-BJKPOYEF.js} +11 -5
- package/dist/show-S653P3TO.js +127 -0
- package/dist/{summary-H6J6N6PJ.js → summary-ZIEIBCAF.js} +1 -1
- package/dist/{sync-BEOCW7TZ.js → sync-PF3MJ3E4.js} +2 -2
- package/dist/{triage-ETVXXFMV.js → triage-RM5KNG5V.js} +30 -31
- package/dist/{university-R2WDQLSI.js → university-IXTJCROL.js} +1 -1
- package/dist/{upgrade-5B3YGGC6.js → upgrade-X4PVS7UV.js} +1 -1
- package/dist/{watch-6IIWPWDN.js → watch-QYGAIYZ3.js} +1 -1
- package/lore-ui/dist/assets/index-DcT8TINz.js +56 -0
- package/lore-ui/dist/assets/index-DyJhpQ5w.css +1 -0
- package/lore-ui/dist/index.html +13 -0
- package/package.json +5 -2
- package/dist/chunk-ILOWBJRC.js +0 -12
- package/dist/chunk-MQWH7PFI.js +0 -13366
- package/dist/server-F5ITNK6T.js +0 -9846
- package/dist/server-T6WIFYRQ.js +0 -16076
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
doctorCommand
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-2NMUSZFA.js";
|
|
5
|
+
import "./chunk-A5BKW7QV.js";
|
|
6
6
|
import "./chunk-4NCFWYGG.js";
|
|
7
7
|
import "./chunk-YO6DVTL7.js";
|
|
8
8
|
import "./chunk-MO4EEYFW.js";
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
initCommand
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MOZPTZ77.js";
|
|
5
5
|
import "./chunk-CHSHON3O.js";
|
|
6
6
|
import "./chunk-N6PJAPDE.js";
|
|
7
7
|
import {
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
findGateFiles
|
|
17
17
|
} from "./chunk-IRKUEJVW.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-A5BKW7QV.js";
|
|
19
19
|
import {
|
|
20
20
|
log
|
|
21
21
|
} from "./chunk-4NCFWYGG.js";
|
|
@@ -107,7 +107,7 @@ ${chalk2.magenta("\u2569 ")}${chalk2.cyan("\u2534 \u2534\u2534\u2514\u2500\u253
|
|
|
107
107
|
program.name("paradigm").description("Unified developer tools ecosystem").version(VERSION).addHelpText("before", banner);
|
|
108
108
|
program.command("init").description("Initialize Paradigm in the current project").option("-f, --force", "Overwrite existing files").option("--name <name>", "Project name").option("--ide <ide>", "Target IDE: cursor, copilot, windsurf, claude").option("--migrate", "Output migration prompt for existing IDE files").option("--quick", "Non-interactive mode with smart defaults").option("--dry-run", "Show what would be created without creating").action(initCommand);
|
|
109
109
|
program.command("shift").description("Full project setup in one command (init + team init + scan + sync all IDEs + doctor)").option("-f, --force", "Reinitialize even if already setup").option("-q, --quick", "Skip slow operations (scan)").option("--verify", "Run health checks after setup").option("--ide <ide>", "Target specific IDE instead of all").option("--configure-models", "Force model configuration prompts for team agents").action(async (options) => {
|
|
110
|
-
const { shiftCommand } = await import("./shift-
|
|
110
|
+
const { shiftCommand } = await import("./shift-BJKPOYEF.js");
|
|
111
111
|
await shiftCommand(options);
|
|
112
112
|
});
|
|
113
113
|
program.command("setup [path]").description("Interactive setup wizard for Paradigm").option("-y, --yes", "Accept all defaults (non-interactive)").option("-f, --force", "Overwrite existing .paradigm config").action(async (path2, options) => {
|
|
@@ -151,7 +151,7 @@ premiseCmd.command("snapshot <name>").description("Create a timeline snapshot").
|
|
|
151
151
|
await premiseSnapshotCommand(name, options.description);
|
|
152
152
|
});
|
|
153
153
|
program.command("sync [ide]").description("Generate IDE instruction files from .paradigm/ config").option("--all", "Sync all supported IDEs").option("-f, --force", "Overwrite existing files").option("--mcp", "Generate MCP configuration (default: true)").option("--no-mcp", "Skip MCP configuration generation").option("--nested", "Generate nested CLAUDE.md files for directories with .purpose").action(async (ide, options) => {
|
|
154
|
-
const { syncCommand } = await import("./sync-
|
|
154
|
+
const { syncCommand } = await import("./sync-PF3MJ3E4.js");
|
|
155
155
|
await syncCommand(ide, options);
|
|
156
156
|
});
|
|
157
157
|
program.command("cursorrules [path]").description("[DEPRECATED] Use `paradigm sync cursor` instead").option("-a, --append", "Append to existing .cursorrules").option("-f, --force", "Overwrite existing .cursorrules").option("-p, --preview", "Preview output without writing").option("--init", "Create default .paradigm config if missing").option("--with-scan", "Include probe protocol section").action(async (path2, options) => {
|
|
@@ -169,7 +169,7 @@ probeCmd.command("index [path]").description("Generate probe index (alias for `p
|
|
|
169
169
|
await indexCommand(path2, options);
|
|
170
170
|
});
|
|
171
171
|
program.command("upgrade [path]").description("Upgrade project with new Paradigm features").option("--features <features...>", "Features to upgrade (probe, logger)").option("--all", "Apply all available upgrades").option("--from-horizon", "Migrate from Horizon to Paradigm").option("--dry-run", "Show what would be upgraded without making changes").option("-f, --force", "Force re-upgrade even if already configured").action(async (path2, options) => {
|
|
172
|
-
const { upgradeCommand } = await import("./upgrade-
|
|
172
|
+
const { upgradeCommand } = await import("./upgrade-X4PVS7UV.js");
|
|
173
173
|
await upgradeCommand(path2, options);
|
|
174
174
|
});
|
|
175
175
|
program.command("lint [path]").description("Validate .purpose files for schema errors").option("-f, --fix", "Auto-fix issues where possible").option("-s, --strict", "Fail on warnings (not just errors)").option("-q, --quiet", "Suppress output except errors").option("--json", "Output as JSON").action(async (path2, options) => {
|
|
@@ -181,8 +181,8 @@ program.command("cost [path]").description("Analyze token costs for AI context")
|
|
|
181
181
|
await costCommand(path2, options);
|
|
182
182
|
});
|
|
183
183
|
var scanCmd = program.command("scan").description("Visual discovery and auto-generation commands");
|
|
184
|
-
scanCmd.command("auto [path]").description("Auto-generate .purpose files from code analysis").option("-n, --dry-run", "Show what would be generated without writing").option("-f, --force", "Overwrite existing .purpose files").option("--json", "Output as JSON").action(async (path2, options) => {
|
|
185
|
-
const { autoScanCommand } = await import("./auto-
|
|
184
|
+
scanCmd.command("auto [path]").description("Auto-generate .purpose files from code analysis").option("-n, --dry-run", "Show what would be generated without writing").option("-f, --force", "Overwrite existing .purpose files").option("--json", "Output as JSON").option("--init", "Full project initialization: generate .purpose files + portal.yaml").action(async (path2, options) => {
|
|
185
|
+
const { autoScanCommand } = await import("./auto-6MOGYQ4G.js");
|
|
186
186
|
await autoScanCommand(path2, options);
|
|
187
187
|
});
|
|
188
188
|
scanCmd.action(() => {
|
|
@@ -276,15 +276,15 @@ teamCmd.action(async () => {
|
|
|
276
276
|
await teamStatusCommand(void 0, {});
|
|
277
277
|
});
|
|
278
278
|
program.command("doctor").description("Health check - validate Paradigm setup").action(async () => {
|
|
279
|
-
const { doctorCommand } = await import("./doctor-
|
|
279
|
+
const { doctorCommand } = await import("./doctor-QMPFQONP.js");
|
|
280
280
|
await doctorCommand();
|
|
281
281
|
});
|
|
282
282
|
program.command("watch").description("Watch for changes and auto-sync IDE files").action(async () => {
|
|
283
|
-
const { watchCommand } = await import("./watch-
|
|
283
|
+
const { watchCommand } = await import("./watch-QYGAIYZ3.js");
|
|
284
284
|
await watchCommand();
|
|
285
285
|
});
|
|
286
286
|
program.command("summary").description("Generate .paradigm/project.md with project stats").action(async () => {
|
|
287
|
-
const { summaryCommand } = await import("./summary-
|
|
287
|
+
const { summaryCommand } = await import("./summary-ZIEIBCAF.js");
|
|
288
288
|
await summaryCommand();
|
|
289
289
|
});
|
|
290
290
|
program.command("constellation [path]").alias("const").description("Generate .paradigm/constellation.json - symbol relationship graph for AI agents").option("-f, --format <format>", "Output format: json or yaml", "json").option("-o, --output <path>", "Custom output path").option("-q, --quiet", "Suppress output").action(async (path2, options) => {
|
|
@@ -405,7 +405,7 @@ mcpCmd.action(async () => {
|
|
|
405
405
|
await mcpSwitchStatusCommand({});
|
|
406
406
|
});
|
|
407
407
|
program.command("promote").description("Copy local build to production (~/.paradigm-cli/)").option("-f, --force", "Create production directory if missing").option("--skip-build", "Skip npm run build step").option("--json", "Output as JSON").action(async (options) => {
|
|
408
|
-
const { promoteCommand } = await import("./promote-
|
|
408
|
+
const { promoteCommand } = await import("./promote-E6NBZ3BK.js");
|
|
409
409
|
await promoteCommand(options);
|
|
410
410
|
});
|
|
411
411
|
var wisdomCmd = program.command("wisdom").description("Team wisdom - preferences, antipatterns, decisions, expertise");
|
|
@@ -468,101 +468,122 @@ historyCmd.option("--json", "Output as JSON").action(async (options) => {
|
|
|
468
468
|
});
|
|
469
469
|
var hooksCmd = program.command("hooks").description("Git hooks for automatic history capture");
|
|
470
470
|
hooksCmd.command("install").description("Install git hooks, Claude Code hooks, and Cursor hooks").option("-f, --force", "Overwrite existing hooks").option("--post-commit", "Only install post-commit hook").option("--pre-push", "Only install pre-push hook").option("--claude-code", "Only install Claude Code hooks (stop + pre-commit)").option("--cursor", "Only install Cursor hooks (.cursor/hooks.json)").action(async (options) => {
|
|
471
|
-
const { hooksInstallCommand } = await import("./hooks-
|
|
471
|
+
const { hooksInstallCommand } = await import("./hooks-7TQIRXXS.js");
|
|
472
472
|
await hooksInstallCommand(options);
|
|
473
473
|
});
|
|
474
474
|
hooksCmd.command("uninstall").description("Remove paradigm hooks (git hooks, or --cursor for Cursor hooks)").option("--cursor", "Remove Cursor hooks instead of git hooks").action(async (options) => {
|
|
475
|
-
const { hooksUninstallCommand } = await import("./hooks-
|
|
475
|
+
const { hooksUninstallCommand } = await import("./hooks-7TQIRXXS.js");
|
|
476
476
|
await hooksUninstallCommand(options);
|
|
477
477
|
});
|
|
478
478
|
hooksCmd.command("status").description("Check git hooks status").action(async () => {
|
|
479
|
-
const { hooksStatusCommand } = await import("./hooks-
|
|
479
|
+
const { hooksStatusCommand } = await import("./hooks-7TQIRXXS.js");
|
|
480
480
|
await hooksStatusCommand();
|
|
481
481
|
});
|
|
482
482
|
hooksCmd.action(async () => {
|
|
483
|
-
const { hooksStatusCommand } = await import("./hooks-
|
|
483
|
+
const { hooksStatusCommand } = await import("./hooks-7TQIRXXS.js");
|
|
484
484
|
await hooksStatusCommand();
|
|
485
485
|
});
|
|
486
486
|
var triageCmd = program.command("triage").description("Semantic error triage - incident management and pattern matching");
|
|
487
487
|
triageCmd.command("list").alias("ls").description("List recent incidents with matched patterns").option("-l, --limit <number>", "Maximum incidents to show", "10").option("-s, --status <status>", "Filter by status: open, investigating, resolved, wont-fix, all").option("--symbol <symbol>", "Filter by symbol (e.g., @checkout, ^auth)").option("-e, --env <environment>", "Filter by environment").option("--search <text>", "Search in error messages").option("--from <date>", "Filter from date (ISO format)").option("--to <date>", "Filter to date (ISO format)").option("--json", "Output as JSON").action(async (options) => {
|
|
488
|
-
const { triageListCommand } = await import("./triage-
|
|
488
|
+
const { triageListCommand } = await import("./triage-RM5KNG5V.js");
|
|
489
489
|
await triageListCommand(options);
|
|
490
490
|
});
|
|
491
491
|
triageCmd.command("show <id>").description("Show full incident details").option("--timeline", "Include flow timeline").option("--json", "Output as JSON").action(async (id, options) => {
|
|
492
|
-
const { triageShowCommand } = await import("./triage-
|
|
492
|
+
const { triageShowCommand } = await import("./triage-RM5KNG5V.js");
|
|
493
493
|
await triageShowCommand(id, options);
|
|
494
494
|
});
|
|
495
495
|
triageCmd.command("resolve <id>").description("Mark incident as resolved").option("-p, --pattern <patternId>", "Pattern that led to resolution").option("-c, --commit <hash>", "Git commit hash of fix").option("--pr <url>", "Pull request URL").option("-n, --notes <text>", "Resolution notes").option("--wont-fix", "Mark as will not fix").action(async (id, options) => {
|
|
496
|
-
const { triageResolveCommand } = await import("./triage-
|
|
496
|
+
const { triageResolveCommand } = await import("./triage-RM5KNG5V.js");
|
|
497
497
|
await triageResolveCommand(id, options);
|
|
498
498
|
});
|
|
499
499
|
triageCmd.command("note <id> <note>").description("Add a note to an incident").action(async (id, note) => {
|
|
500
|
-
const { triageNoteCommand } = await import("./triage-
|
|
500
|
+
const { triageNoteCommand } = await import("./triage-RM5KNG5V.js");
|
|
501
501
|
await triageNoteCommand(id, note);
|
|
502
502
|
});
|
|
503
503
|
triageCmd.command("link <id1> <id2>").description("Link two related incidents").action(async (id1, id2) => {
|
|
504
|
-
const { triageLinkCommand } = await import("./triage-
|
|
504
|
+
const { triageLinkCommand } = await import("./triage-RM5KNG5V.js");
|
|
505
505
|
await triageLinkCommand(id1, id2);
|
|
506
506
|
});
|
|
507
507
|
var triagePatternsCmd = triageCmd.command("patterns").description("Manage failure patterns");
|
|
508
508
|
triagePatternsCmd.command("list").alias("ls").description("List all patterns").option("--source <source>", "Filter by source: manual, suggested, imported, community").option("--min-confidence <score>", "Minimum confidence score").option("--json", "Output as JSON").action(async (options) => {
|
|
509
|
-
const { triagePatternsListCommand } = await import("./triage-
|
|
509
|
+
const { triagePatternsListCommand } = await import("./triage-RM5KNG5V.js");
|
|
510
510
|
await triagePatternsListCommand(options);
|
|
511
511
|
});
|
|
512
512
|
triagePatternsCmd.command("show <id>").description("Show pattern details").option("--json", "Output as JSON").action(async (id, options) => {
|
|
513
|
-
const { triagePatternsShowCommand } = await import("./triage-
|
|
513
|
+
const { triagePatternsShowCommand } = await import("./triage-RM5KNG5V.js");
|
|
514
514
|
await triagePatternsShowCommand(id, options);
|
|
515
515
|
});
|
|
516
516
|
triagePatternsCmd.command("add").description("Create a new pattern").requiredOption("--id <id>", "Pattern ID (kebab-case)").requiredOption("--name <name>", "Human-readable name").option("--description <text>", "Pattern description").option("--symbols <pairs>", 'Symbol criteria (e.g., "feature:@checkout,gate:^auth")').option("--error-contains <keywords>", "Error keywords (comma-separated)").option("--missing-signals <signals>", "Expected missing signals (comma-separated)").option("--strategy <strategy>", "Resolution strategy: retry, fallback, fix-data, fix-code, ignore, escalate", "fix-code").option("--priority <priority>", "Priority: low, medium, high, critical", "medium").option("--code-hint <text>", "Code hint for resolution").option("--tags <tags>", "Tags (comma-separated)").option("--from-incident <id>", "Generate suggestion from incident").action(async (options) => {
|
|
517
|
-
const { triagePatternsAddCommand } = await import("./triage-
|
|
517
|
+
const { triagePatternsAddCommand } = await import("./triage-RM5KNG5V.js");
|
|
518
518
|
await triagePatternsAddCommand(options);
|
|
519
519
|
});
|
|
520
520
|
triagePatternsCmd.command("delete <id>").alias("rm").description("Delete a pattern").action(async (id) => {
|
|
521
|
-
const { triagePatternsDeleteCommand } = await import("./triage-
|
|
521
|
+
const { triagePatternsDeleteCommand } = await import("./triage-RM5KNG5V.js");
|
|
522
522
|
await triagePatternsDeleteCommand(id);
|
|
523
523
|
});
|
|
524
524
|
triagePatternsCmd.command("test <id>").description("Test pattern against historical incidents").option("-l, --limit <number>", "Max incidents to test against", "100").option("--json", "Output as JSON").action(async (id, options) => {
|
|
525
|
-
const { triagePatternsTestCommand } = await import("./triage-
|
|
525
|
+
const { triagePatternsTestCommand } = await import("./triage-RM5KNG5V.js");
|
|
526
526
|
await triagePatternsTestCommand(id, options);
|
|
527
527
|
});
|
|
528
528
|
triagePatternsCmd.command("seed").description("Load built-in seed patterns").action(async () => {
|
|
529
|
-
const { triagePatternsSeedCommand } = await import("./triage-
|
|
529
|
+
const { triagePatternsSeedCommand } = await import("./triage-RM5KNG5V.js");
|
|
530
530
|
await triagePatternsSeedCommand();
|
|
531
531
|
});
|
|
532
532
|
triagePatternsCmd.action(async () => {
|
|
533
|
-
const { triagePatternsListCommand } = await import("./triage-
|
|
533
|
+
const { triagePatternsListCommand } = await import("./triage-RM5KNG5V.js");
|
|
534
534
|
await triagePatternsListCommand({});
|
|
535
535
|
});
|
|
536
536
|
triageCmd.command("export <type>").description("Export patterns or full backup (type: patterns, backup)").option("-o, --output <path>", "Output file path").option("--include-private", "Include private patterns").action(async (type, options) => {
|
|
537
|
-
const { triageExportCommand } = await import("./triage-
|
|
537
|
+
const { triageExportCommand } = await import("./triage-RM5KNG5V.js");
|
|
538
538
|
await triageExportCommand(type, options);
|
|
539
539
|
});
|
|
540
540
|
triageCmd.command("import <file>").description("Import patterns from JSON file").option("--overwrite", "Overwrite existing patterns").action(async (file, options) => {
|
|
541
|
-
const { triageImportCommand } = await import("./triage-
|
|
541
|
+
const { triageImportCommand } = await import("./triage-RM5KNG5V.js");
|
|
542
542
|
await triageImportCommand(file, options);
|
|
543
543
|
});
|
|
544
544
|
triageCmd.command("restore <file>").description("Restore from full backup").action(async (file) => {
|
|
545
|
-
const { triageRestoreCommand } = await import("./triage-
|
|
545
|
+
const { triageRestoreCommand } = await import("./triage-RM5KNG5V.js");
|
|
546
546
|
await triageRestoreCommand(file);
|
|
547
547
|
});
|
|
548
548
|
triageCmd.command("stats").description("Show statistics dashboard").option("-p, --period <period>", "Time period: 1d, 7d, 30d, 90d", "7d").option("--symbol <symbol>", "Show health for specific symbol").option("--json", "Output as JSON").action(async (options) => {
|
|
549
|
-
const { triageStatsCommand } = await import("./triage-
|
|
549
|
+
const { triageStatsCommand } = await import("./triage-RM5KNG5V.js");
|
|
550
550
|
await triageStatsCommand(options);
|
|
551
551
|
});
|
|
552
552
|
triageCmd.command("record").description("Manually record an incident").requiredOption("--error <message>", "Error message").requiredOption("-e, --env <environment>", "Environment").option("--feature <symbol>", "Feature symbol (@...)").option("--component <symbol>", "Component symbol (#...)").option("--flow <symbol>", "Flow symbol ($...)").option("--gate <symbol>", "Gate symbol (^...)").option("--signal <symbol>", "Signal symbol (!...)").option("--state <symbol>", "State symbol (%...)").option("--integration <symbol>", "Integration symbol (&...)").option("--service <name>", "Service name").option("--version <version>", "App version").option("--stack <trace>", "Stack trace").option("--json", "Output as JSON").action(async (options) => {
|
|
553
|
-
const { triageRecordCommand } = await import("./triage-
|
|
553
|
+
const { triageRecordCommand } = await import("./triage-RM5KNG5V.js");
|
|
554
554
|
await triageRecordCommand(options);
|
|
555
555
|
});
|
|
556
556
|
triageCmd.option("-l, --limit <number>", "Maximum incidents to show", "10").option("-s, --status <status>", "Filter by status").option("--json", "Output as JSON").action(async (options) => {
|
|
557
|
-
const { triageListCommand } = await import("./triage-
|
|
557
|
+
const { triageListCommand } = await import("./triage-RM5KNG5V.js");
|
|
558
558
|
await triageListCommand(options);
|
|
559
559
|
});
|
|
560
|
+
var loreCmd = program.command("lore").description("Project lore - timeline of everything that happened to this project");
|
|
561
|
+
loreCmd.command("list").alias("ls").description("List recent lore entries").option("--author <author>", "Filter by author").option("--type <type>", "Filter by type: agent-session, human-note, decision, review, incident, milestone").option("--symbol <symbol>", "Filter by symbol").option("--tags <tags>", "Filter by tags (comma-separated)").option("-l, --limit <number>", "Number of entries", "20").option("--json", "Output as JSON").action(async (options) => {
|
|
562
|
+
const { loreListCommand } = await import("./list-QMUE7DPK.js");
|
|
563
|
+
await loreListCommand(options);
|
|
564
|
+
});
|
|
565
|
+
loreCmd.command("show <id>").description("Show full detail for a lore entry").option("--json", "Output as JSON").action(async (id, options) => {
|
|
566
|
+
const { loreShowCommand } = await import("./show-S653P3TO.js");
|
|
567
|
+
await loreShowCommand(id, options);
|
|
568
|
+
});
|
|
569
|
+
loreCmd.command("record").description("Record a new lore entry (human note, milestone, etc.)").option("--type <type>", "Entry type: human-note, decision, milestone", "human-note").option("--author <author>", "Author name").option("--title <title>", "Entry title").option("--summary <summary>", "Entry summary").option("--symbols <symbols>", "Comma-separated symbols").option("--tags <tags>", "Comma-separated tags").action(async (options) => {
|
|
570
|
+
const { loreRecordCommand } = await import("./record-5CTCDFUO.js");
|
|
571
|
+
await loreRecordCommand(options);
|
|
572
|
+
});
|
|
573
|
+
loreCmd.command("review <id>").description("Add a review to a lore entry").option("--reviewer <name>", "Reviewer name").option("--completeness <n>", "Completeness score (1-5)", "3").option("--quality <n>", "Quality score (1-5)", "3").option("--notes <text>", "Review notes").action(async (id, options) => {
|
|
574
|
+
const { loreReviewCommand } = await import("./review-QEDNQAIO.js");
|
|
575
|
+
await loreReviewCommand(id, options);
|
|
576
|
+
});
|
|
577
|
+
loreCmd.option("-p, --port <port>", "Port to run on", "3840").option("--no-open", "Don't open browser automatically").action(async (options) => {
|
|
578
|
+
const { loreServeCommand } = await import("./serve-WCIRW244.js");
|
|
579
|
+
await loreServeCommand(void 0, options);
|
|
580
|
+
});
|
|
560
581
|
program.command("sentinel [path]").description("Launch the Sentinel UI - unified codebase intelligence visualizer").option("-p, --port <port>", "Port to run on", "3838").option("--no-open", "Don't open browser automatically").action(async (path2, options) => {
|
|
561
|
-
const { sentinelCommand } = await import("./sentinel-
|
|
582
|
+
const { sentinelCommand } = await import("./sentinel-J64XJVTU.js");
|
|
562
583
|
await sentinelCommand(path2, options);
|
|
563
584
|
});
|
|
564
585
|
program.command("university").description("Launch Paradigm University - interactive learning platform & PLSAT certification").option("-p, --port <port>", "Port to run on", "3839").option("--no-open", "Don't open browser automatically").action(async (options) => {
|
|
565
|
-
const { universityCommand } = await import("./university-
|
|
586
|
+
const { universityCommand } = await import("./university-IXTJCROL.js");
|
|
566
587
|
await universityCommand(void 0, options);
|
|
567
588
|
});
|
|
568
589
|
program.parse();
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
loadLoreEntries
|
|
4
|
+
} from "./chunk-27OSFWHG.js";
|
|
5
|
+
import "./chunk-MO4EEYFW.js";
|
|
6
|
+
|
|
7
|
+
// src/commands/lore/list.ts
|
|
8
|
+
import chalk from "chalk";
|
|
9
|
+
async function loreListCommand(options) {
|
|
10
|
+
const rootDir = process.cwd();
|
|
11
|
+
const filter = {};
|
|
12
|
+
if (options.author) filter.author = options.author;
|
|
13
|
+
if (options.type) filter.type = options.type;
|
|
14
|
+
if (options.symbol) filter.symbol = options.symbol;
|
|
15
|
+
if (options.tags) filter.tags = options.tags.split(",");
|
|
16
|
+
filter.limit = parseInt(options.limit || "20", 10);
|
|
17
|
+
const entries = await loadLoreEntries(rootDir, filter);
|
|
18
|
+
if (options.json) {
|
|
19
|
+
console.log(JSON.stringify(entries, null, 2));
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (entries.length === 0) {
|
|
23
|
+
console.log(chalk.gray("\nNo lore entries found.\n"));
|
|
24
|
+
console.log(chalk.gray("Record one with: paradigm lore record"));
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
console.log(chalk.cyan(`
|
|
28
|
+
Lore Entries (${entries.length})
|
|
29
|
+
`));
|
|
30
|
+
const typeColor = {
|
|
31
|
+
"agent-session": chalk.hex("#818cf8"),
|
|
32
|
+
"human-note": chalk.hex("#34d399"),
|
|
33
|
+
"decision": chalk.hex("#fbbf24"),
|
|
34
|
+
"review": chalk.hex("#c084fc"),
|
|
35
|
+
"incident": chalk.hex("#f87171"),
|
|
36
|
+
"milestone": chalk.hex("#60a5fa")
|
|
37
|
+
};
|
|
38
|
+
for (const entry of entries) {
|
|
39
|
+
const colorFn = typeColor[entry.type] || chalk.white;
|
|
40
|
+
const date = new Date(entry.timestamp);
|
|
41
|
+
const dateStr = date.toLocaleDateString("en-US", { month: "short", day: "numeric" });
|
|
42
|
+
const timeStr = date.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit" });
|
|
43
|
+
const authorIcon = entry.author.type === "agent" ? "\u{1F916}" : "\u{1F464}";
|
|
44
|
+
const verifyIcon = entry.verification?.status === "pass" ? chalk.green("\u2713") : entry.verification?.status === "fail" ? chalk.red("\u2717") : entry.verification?.status === "partial" ? chalk.yellow("\u26A0") : chalk.gray("\xB7");
|
|
45
|
+
const reviewStr = entry.review ? chalk.yellow("\u2605".repeat(entry.review.quality) + "\u2606".repeat(5 - entry.review.quality)) : "";
|
|
46
|
+
console.log(` ${chalk.gray(entry.id)} ${colorFn(entry.type.padEnd(14))} ${verifyIcon} ${chalk.white(entry.title)}`);
|
|
47
|
+
console.log(` ${chalk.gray(dateStr + " " + timeStr)} ${authorIcon} ${chalk.gray(entry.author.id)} ${entry.symbols_touched.map((s) => chalk.cyan(s)).join(" ")} ${reviewStr}`);
|
|
48
|
+
console.log();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
loreListCommand
|
|
53
|
+
};
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import "./chunk-MO4EEYFW.js";
|
|
3
|
+
|
|
4
|
+
// src/lore-server/index.ts
|
|
5
|
+
import express from "express";
|
|
6
|
+
import * as path3 from "path";
|
|
7
|
+
import * as fs3 from "fs";
|
|
8
|
+
import { fileURLToPath } from "url";
|
|
9
|
+
import chalk from "chalk";
|
|
10
|
+
|
|
11
|
+
// src/lore-server/routes/lore.ts
|
|
12
|
+
import { Router } from "express";
|
|
13
|
+
import * as fs from "fs";
|
|
14
|
+
import * as path from "path";
|
|
15
|
+
import * as yaml from "js-yaml";
|
|
16
|
+
var LORE_DIR = ".paradigm/lore";
|
|
17
|
+
var ENTRIES_DIR = "entries";
|
|
18
|
+
function loadAllEntries(projectDir) {
|
|
19
|
+
const entriesPath = path.join(projectDir, LORE_DIR, ENTRIES_DIR);
|
|
20
|
+
if (!fs.existsSync(entriesPath)) {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
const entries = [];
|
|
24
|
+
const dateDirs = fs.readdirSync(entriesPath).filter((d) => /^\d{4}-\d{2}-\d{2}$/.test(d)).sort().reverse();
|
|
25
|
+
for (const dateDir of dateDirs) {
|
|
26
|
+
const dirPath = path.join(entriesPath, dateDir);
|
|
27
|
+
const files = fs.readdirSync(dirPath).filter((f) => f.endsWith(".yaml")).sort();
|
|
28
|
+
for (const file of files) {
|
|
29
|
+
try {
|
|
30
|
+
const content = fs.readFileSync(path.join(dirPath, file), "utf8");
|
|
31
|
+
const entry = yaml.load(content);
|
|
32
|
+
entries.push(entry);
|
|
33
|
+
} catch {
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return entries;
|
|
38
|
+
}
|
|
39
|
+
function createLoreRouter(projectDir) {
|
|
40
|
+
const router = Router();
|
|
41
|
+
router.get("/", (req, res) => {
|
|
42
|
+
let entries = loadAllEntries(projectDir);
|
|
43
|
+
const { author, authorType, symbol, type, from, to, tags, hasReview, limit, offset } = req.query;
|
|
44
|
+
if (author) {
|
|
45
|
+
entries = entries.filter((e) => e.author.id === author);
|
|
46
|
+
}
|
|
47
|
+
if (authorType) {
|
|
48
|
+
entries = entries.filter((e) => e.author.type === authorType);
|
|
49
|
+
}
|
|
50
|
+
if (symbol) {
|
|
51
|
+
entries = entries.filter(
|
|
52
|
+
(e) => e.symbols_touched.includes(symbol) || e.symbols_created?.includes(symbol)
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
if (type) {
|
|
56
|
+
entries = entries.filter((e) => e.type === type);
|
|
57
|
+
}
|
|
58
|
+
if (from) {
|
|
59
|
+
const fromDate = new Date(from).getTime();
|
|
60
|
+
entries = entries.filter((e) => new Date(e.timestamp).getTime() >= fromDate);
|
|
61
|
+
}
|
|
62
|
+
if (to) {
|
|
63
|
+
const toDate = new Date(to).getTime();
|
|
64
|
+
entries = entries.filter((e) => new Date(e.timestamp).getTime() <= toDate);
|
|
65
|
+
}
|
|
66
|
+
if (tags) {
|
|
67
|
+
const tagList = tags.split(",");
|
|
68
|
+
entries = entries.filter((e) => tagList.some((t) => e.tags?.includes(t)));
|
|
69
|
+
}
|
|
70
|
+
if (hasReview === "true") {
|
|
71
|
+
entries = entries.filter((e) => e.review != null);
|
|
72
|
+
} else if (hasReview === "false") {
|
|
73
|
+
entries = entries.filter((e) => e.review == null);
|
|
74
|
+
}
|
|
75
|
+
entries.sort((a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime());
|
|
76
|
+
const off = parseInt(offset || "0", 10);
|
|
77
|
+
const lim = parseInt(limit || "100", 10);
|
|
78
|
+
const total = entries.length;
|
|
79
|
+
entries = entries.slice(off, off + lim);
|
|
80
|
+
res.json({ total, offset: off, limit: lim, entries });
|
|
81
|
+
});
|
|
82
|
+
router.get("/:id", (req, res) => {
|
|
83
|
+
const entries = loadAllEntries(projectDir);
|
|
84
|
+
const entry = entries.find((e) => e.id === req.params.id);
|
|
85
|
+
if (!entry) {
|
|
86
|
+
res.status(404).json({ error: "Entry not found" });
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
res.json(entry);
|
|
90
|
+
});
|
|
91
|
+
router.put("/:id/review", (req, res) => {
|
|
92
|
+
const entryId = req.params.id;
|
|
93
|
+
const entries = loadAllEntries(projectDir);
|
|
94
|
+
const entry = entries.find((e) => e.id === entryId);
|
|
95
|
+
if (!entry) {
|
|
96
|
+
res.status(404).json({ error: "Entry not found" });
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const dateStr = entry.timestamp.slice(0, 10);
|
|
100
|
+
const entryPath = path.join(projectDir, LORE_DIR, ENTRIES_DIR, dateStr, `${entryId}.yaml`);
|
|
101
|
+
if (!fs.existsSync(entryPath)) {
|
|
102
|
+
res.status(404).json({ error: "Entry file not found" });
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
entry.review = {
|
|
106
|
+
reviewer: req.body.reviewer || "anonymous",
|
|
107
|
+
completeness: req.body.completeness || 3,
|
|
108
|
+
quality: req.body.quality || 3,
|
|
109
|
+
notes: req.body.notes,
|
|
110
|
+
reviewed_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
111
|
+
};
|
|
112
|
+
fs.writeFileSync(entryPath, yaml.dump(entry, { lineWidth: -1, noRefs: true }));
|
|
113
|
+
res.json({ success: true, entry });
|
|
114
|
+
});
|
|
115
|
+
router.get("/timeline", (_req, res) => {
|
|
116
|
+
const timelinePath = path.join(projectDir, LORE_DIR, "timeline.yaml");
|
|
117
|
+
if (!fs.existsSync(timelinePath)) {
|
|
118
|
+
res.json({ version: "1.0", project: "unknown", entries: 0, last_updated: "", authors: [] });
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
try {
|
|
122
|
+
const content = fs.readFileSync(timelinePath, "utf8");
|
|
123
|
+
res.json(yaml.load(content));
|
|
124
|
+
} catch {
|
|
125
|
+
res.status(500).json({ error: "Failed to load timeline" });
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
router.get("/symbols", (_req, res) => {
|
|
129
|
+
const entries = loadAllEntries(projectDir);
|
|
130
|
+
const symbolCounts = {};
|
|
131
|
+
for (const entry of entries) {
|
|
132
|
+
for (const sym of entry.symbols_touched) {
|
|
133
|
+
symbolCounts[sym] = (symbolCounts[sym] || 0) + 1;
|
|
134
|
+
}
|
|
135
|
+
if (entry.symbols_created) {
|
|
136
|
+
for (const sym of entry.symbols_created) {
|
|
137
|
+
symbolCounts[sym] = (symbolCounts[sym] || 0) + 1;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const symbols = Object.entries(symbolCounts).map(([symbol, count]) => ({ symbol, count })).sort((a, b) => b.count - a.count);
|
|
142
|
+
res.json({ symbols });
|
|
143
|
+
});
|
|
144
|
+
router.get("/authors", (_req, res) => {
|
|
145
|
+
const entries = loadAllEntries(projectDir);
|
|
146
|
+
const authorMap = {};
|
|
147
|
+
for (const entry of entries) {
|
|
148
|
+
const aid = entry.author.id;
|
|
149
|
+
if (!authorMap[aid]) {
|
|
150
|
+
authorMap[aid] = { type: entry.author.type, count: 0, lastActive: entry.timestamp };
|
|
151
|
+
}
|
|
152
|
+
authorMap[aid].count++;
|
|
153
|
+
if (entry.timestamp > authorMap[aid].lastActive) {
|
|
154
|
+
authorMap[aid].lastActive = entry.timestamp;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const authors = Object.entries(authorMap).map(([id, info]) => ({ id, ...info })).sort((a, b) => b.count - a.count);
|
|
158
|
+
res.json({ authors });
|
|
159
|
+
});
|
|
160
|
+
return router;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// src/lore-server/routes/info.ts
|
|
164
|
+
import { Router as Router2 } from "express";
|
|
165
|
+
import * as fs2 from "fs";
|
|
166
|
+
import * as path2 from "path";
|
|
167
|
+
import * as yaml2 from "js-yaml";
|
|
168
|
+
function createInfoRouter(projectDir) {
|
|
169
|
+
const router = Router2();
|
|
170
|
+
router.get("/", (_req, res) => {
|
|
171
|
+
const configPath = path2.join(projectDir, ".paradigm", "config.yaml");
|
|
172
|
+
let project = path2.basename(projectDir);
|
|
173
|
+
if (fs2.existsSync(configPath)) {
|
|
174
|
+
try {
|
|
175
|
+
const config = yaml2.load(fs2.readFileSync(configPath, "utf8"));
|
|
176
|
+
project = config.project || config.name || project;
|
|
177
|
+
} catch {
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
res.json({
|
|
181
|
+
project,
|
|
182
|
+
projectDir,
|
|
183
|
+
paradigmVersion: "2.0"
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
return router;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// src/lore-server/index.ts
|
|
190
|
+
var __filename = fileURLToPath(import.meta.url);
|
|
191
|
+
var __dirname = path3.dirname(__filename);
|
|
192
|
+
var log = {
|
|
193
|
+
component(name) {
|
|
194
|
+
const symbol = chalk.magenta(`#${name}`);
|
|
195
|
+
return {
|
|
196
|
+
info: (msg, data) => {
|
|
197
|
+
const dataStr = data ? chalk.gray(` ${Object.entries(data).map(([k, v]) => `${k}=${v}`).join(" ")}`) : "";
|
|
198
|
+
console.log(`${chalk.blue("i")} ${symbol} ${msg}${dataStr}`);
|
|
199
|
+
},
|
|
200
|
+
success: (msg, data) => {
|
|
201
|
+
const dataStr = data ? chalk.gray(` ${Object.entries(data).map(([k, v]) => `${k}=${v}`).join(" ")}`) : "";
|
|
202
|
+
console.log(`${chalk.green("+")} ${symbol} ${msg}${dataStr}`);
|
|
203
|
+
},
|
|
204
|
+
warn: (msg, data) => {
|
|
205
|
+
const dataStr = data ? chalk.gray(` ${Object.entries(data).map(([k, v]) => `${k}=${v}`).join(" ")}`) : "";
|
|
206
|
+
console.log(`${chalk.yellow("!")} ${symbol} ${msg}${dataStr}`);
|
|
207
|
+
},
|
|
208
|
+
error: (msg, data) => {
|
|
209
|
+
const dataStr = data ? chalk.gray(` ${Object.entries(data).map(([k, v]) => `${k}=${v}`).join(" ")}`) : "";
|
|
210
|
+
console.error(`${chalk.red("x")} ${symbol} ${msg}${dataStr}`);
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
function createLoreApp(options) {
|
|
216
|
+
const app = express();
|
|
217
|
+
app.use(express.json());
|
|
218
|
+
app.use((_req, res, next) => {
|
|
219
|
+
res.header("Access-Control-Allow-Origin", "*");
|
|
220
|
+
res.header("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS");
|
|
221
|
+
res.header("Access-Control-Allow-Headers", "Content-Type");
|
|
222
|
+
if (_req.method === "OPTIONS") {
|
|
223
|
+
res.sendStatus(204);
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
next();
|
|
227
|
+
});
|
|
228
|
+
app.use("/api/lore", createLoreRouter(options.projectDir));
|
|
229
|
+
app.use("/api/info", createInfoRouter(options.projectDir));
|
|
230
|
+
app.get("/api/health", (_req, res) => {
|
|
231
|
+
res.json({ status: "ok", timestamp: (/* @__PURE__ */ new Date()).toISOString() });
|
|
232
|
+
});
|
|
233
|
+
let uiDistPath = path3.join(__dirname, "..", "lore-ui", "dist");
|
|
234
|
+
if (!fs3.existsSync(uiDistPath)) {
|
|
235
|
+
uiDistPath = path3.join(__dirname, "..", "..", "lore-ui", "dist");
|
|
236
|
+
}
|
|
237
|
+
if (fs3.existsSync(uiDistPath)) {
|
|
238
|
+
app.use(express.static(uiDistPath));
|
|
239
|
+
app.get("{*path}", (req, res) => {
|
|
240
|
+
if (!req.path.startsWith("/api")) {
|
|
241
|
+
res.sendFile(path3.join(uiDistPath, "index.html"));
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
} else {
|
|
245
|
+
app.get("/", (_req, res) => {
|
|
246
|
+
res.send(`
|
|
247
|
+
<html>
|
|
248
|
+
<head><title>Paradigm Lore</title></head>
|
|
249
|
+
<body style="background:#0a0a0f;color:#e2e8f0;font-family:system-ui;display:flex;align-items:center;justify-content:center;height:100vh;margin:0">
|
|
250
|
+
<div style="text-align:center">
|
|
251
|
+
<h1>Paradigm Lore</h1>
|
|
252
|
+
<p style="color:#94a3b8">UI not built yet. Run <code style="background:#1e293b;padding:4px 8px;border-radius:4px">cd lore-ui && npx vite build</code></p>
|
|
253
|
+
<p style="color:#94a3b8">API available at <a href="/api/lore" style="color:#7dd3fc">/api/lore</a></p>
|
|
254
|
+
</div>
|
|
255
|
+
</body>
|
|
256
|
+
</html>
|
|
257
|
+
`);
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
return app;
|
|
261
|
+
}
|
|
262
|
+
async function startLoreServer(options) {
|
|
263
|
+
const app = createLoreApp(options);
|
|
264
|
+
log.component("lore-server").info("Starting server", { port: options.port });
|
|
265
|
+
log.component("lore-server").info("Project directory", { path: options.projectDir });
|
|
266
|
+
return new Promise((resolve, reject) => {
|
|
267
|
+
const server = app.listen(options.port, () => {
|
|
268
|
+
log.component("lore-server").success("Server running", { url: `http://localhost:${options.port}` });
|
|
269
|
+
if (options.open) {
|
|
270
|
+
import("open").then((openModule) => {
|
|
271
|
+
openModule.default(`http://localhost:${options.port}`);
|
|
272
|
+
log.component("lore-server").info("Opened browser");
|
|
273
|
+
}).catch(() => {
|
|
274
|
+
log.component("lore-server").warn("Could not open browser automatically");
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
resolve();
|
|
278
|
+
});
|
|
279
|
+
server.on("error", (err) => {
|
|
280
|
+
if (err.code === "EADDRINUSE") {
|
|
281
|
+
log.component("lore-server").error("Port already in use", { port: options.port });
|
|
282
|
+
} else {
|
|
283
|
+
log.component("lore-server").error("Server error", { error: err.message });
|
|
284
|
+
}
|
|
285
|
+
reject(err);
|
|
286
|
+
});
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
export {
|
|
290
|
+
createLoreApp,
|
|
291
|
+
startLoreServer
|
|
292
|
+
};
|