@a-company/paradigm 3.28.0 → 3.43.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/{accept-orchestration-6EM5EHXA.js → accept-orchestration-ZUWQUHSK.js} +6 -6
- package/dist/add-VSPZ6FM4.js +81 -0
- package/dist/{aggregate-M5WMUI6B.js → aggregate-SV3VGEIL.js} +2 -2
- package/dist/assess-UHBDYIK7.js +68 -0
- package/dist/{beacon-XL2ALH5O.js → beacon-3SJV4DAP.js} +2 -2
- package/dist/calibration-WWHK73WU.js +135 -0
- package/dist/{chunk-C5ZE6WEX.js → chunk-2SKXFXIT.js} +91 -1
- package/dist/{chunk-AK5M6KJB.js → chunk-36TKPM5Z.js} +20 -2
- package/dist/{chunk-W4VFKZVF.js → chunk-7COU5S2Z.js} +3 -3
- package/dist/{chunk-3BAMPB6I.js → chunk-7WEKMZ46.js} +2 -147
- package/dist/{chunk-SCC77UUP.js → chunk-AKIMFN6I.js} +3 -3
- package/dist/{chunk-3DYYXGDC.js → chunk-CDMAMDSG.js} +33 -0
- package/dist/{chunk-7IJ5JVKT.js → chunk-CZEIK3Y2.js} +913 -40
- package/dist/{chunk-MRENOFTR.js → chunk-EDOAWN7J.js} +6 -1
- package/dist/chunk-F3BCHPYT.js +143 -0
- package/dist/chunk-GT5QGC2H.js +253 -0
- package/dist/{chunk-N6RNYCZD.js → chunk-HIKKOCXY.js} +1 -1
- package/dist/{chunk-J26YQVAK.js → chunk-J4E6K5MG.js} +1 -1
- package/dist/chunk-L27I3CPZ.js +357 -0
- package/dist/{chunk-KWDTBXP2.js → chunk-LHLIAYQ3.js} +1 -1
- package/dist/{chunk-OXG5GVDJ.js → chunk-P7XSBJE3.js} +1 -1
- package/dist/{chunk-Z7W7HNRG.js → chunk-QDXI2DHR.js} +1 -1
- package/dist/{chunk-BRILIG7Z.js → chunk-QIOCFXDQ.js} +42 -0
- package/dist/{chunk-ZOH24ZPF.js → chunk-QWA26UNO.js} +7 -7
- package/dist/{lore-server-ILPHKWLK.js → chunk-RAB5IKPR.js} +77 -112
- package/dist/{chunk-BKMNLROM.js → chunk-RGFANZ4Q.js} +448 -147
- package/dist/{chunk-R2SGQ22F.js → chunk-YW5OCVKB.js} +448 -2
- package/dist/{chunk-6P4IFIK2.js → chunk-ZGUAAVMA.js} +53 -4
- package/dist/{commands-6ZVTD74M.js → commands-LEPFD7S5.js} +452 -1
- package/dist/config-schema-3YNIFJCJ.js +152 -0
- package/dist/{constellation-NXU6Q2HM.js → constellation-FAGT45TU.js} +2 -2
- package/dist/{context-audit-RI4R2WRH.js → context-audit-557EO6PK.js} +138 -8
- package/dist/{cost-CTGSLSOC.js → cost-UD3WPEKZ.js} +1 -1
- package/dist/{cursorrules-XBWFX66V.js → cursorrules-3TKZ4E4R.js} +2 -2
- package/dist/{delete-YTASL4SM.js → delete-RRK4RL6Y.js} +1 -1
- package/dist/{diff-AH7L4PRQ.js → diff-IP5CIARP.js} +6 -6
- package/dist/{dist-AG5JNIZU-HW2FWNTZ.js → dist-5QE2BB2B-X6DYVSUL.js} +59 -5
- package/dist/{dist-KY5HGDDL.js → dist-OGTSAZ55.js} +58 -4
- package/dist/{dist-IKBGY7FQ.js → dist-RVKYUCRU.js} +3 -1
- package/dist/{dist-7U64HDSC.js → dist-UXWV4OKX.js} +8 -2
- package/dist/{dist-RMAIFRTW.js → dist-Y7I3CFY5.js} +5 -3
- package/dist/{doctor-INBOLZC7.js → doctor-GKZJU7QG.js} +1 -1
- package/dist/{edit-S7NZD7H7.js → edit-4CLNN5JG.js} +1 -1
- package/dist/{graph-ERNQQQ7C.js → graph-YYUXI3F7.js} +1 -1
- package/dist/graph-server-ZPXRSGCW.js +116 -0
- package/dist/{habits-7BORPC2F.js → habits-O37HTUKE.js} +2 -2
- package/dist/index.js +207 -89
- package/dist/integrity-MK2OP5TA.js +194 -0
- package/dist/integrity-checker-J7YXRTBT.js +11 -0
- package/dist/{lint-53GPXKKI.js → lint-HYWGS3JJ.js} +1 -1
- package/dist/{list-QTFWN35D.js → list-BTLFHSRC.js} +1 -1
- package/dist/list-IUCYPGMK.js +57 -0
- package/dist/{lore-loader-S5BXMH27.js → lore-loader-VTEEZDX3.js} +3 -1
- package/dist/lore-server-NOOAHKJX.js +118 -0
- package/dist/mcp.js +2616 -112
- package/dist/migrate-FQVGQNXZ.js +889 -0
- package/dist/{migrate-assessments-FPR6C35Z.js → migrate-assessments-JP6Q5KME.js} +1 -1
- package/dist/{orchestrate-HMSQ2CED.js → orchestrate-A226N6FC.js} +6 -6
- package/dist/platform-server-KK4OCRTV.js +891 -0
- package/dist/{probe-SN4BNXOC.js → probe-7JK7IDNI.js} +5 -5
- package/dist/{providers-YW3FG6DA.js → providers-YNFSL6HK.js} +1 -1
- package/dist/quiz-I75NU2QQ.js +99 -0
- package/dist/{record-UGN75GTB.js → record-46CLR4OG.js} +11 -2
- package/dist/{reindex-YG3KIXAK.js → reindex-NZQRGKPN.js} +3 -2
- package/dist/{remember-IEBQHXHZ.js → remember-4EUZKIIB.js} +1 -1
- package/dist/{retag-URLJLMSK.js → retag-KC4JVRLE.js} +1 -1
- package/dist/{review-725ZKA7U.js → review-Q7M4CRB5.js} +1 -1
- package/dist/{ripple-DFMXLFWI.js → ripple-RI3LOT6R.js} +2 -2
- package/dist/{sentinel-FUR3QKCJ.js → sentinel-BKYTBT7M.js} +1 -1
- package/dist/sentinel-bridge-IZTXYS5M.js +109 -0
- package/dist/sentinel-ui/assets/{index-Zh1YM0C9.css → index-CJ1Wx083.css} +1 -1
- package/dist/sentinel-ui/assets/index-S1VJ67dT.js +62 -0
- package/dist/sentinel-ui/assets/index-S1VJ67dT.js.map +1 -0
- package/dist/sentinel-ui/index.html +2 -2
- package/dist/sentinel.js +6 -6
- package/dist/{serve-DIALBCTU.js → serve-22A4XOIG.js} +1 -1
- package/dist/{university-A66BMZ4Z.js → serve-2YJ6D2Y6.js} +9 -8
- package/dist/serve-3V2WXLGM.js +33 -0
- package/dist/{server-2VICPDUR.js → server-OFEJ2HJP.js} +25 -2
- package/dist/{server-OWBK2WFS.js → server-RDLQ3DK7.js} +49 -4
- package/dist/{setup-HOI52TN3.js → setup-M2ZKLKNN.js} +4 -4
- package/dist/{shift-DRF5M3G6.js → shift-LNMKFYLR.js} +73 -14
- package/dist/{show-GEVVQWWG.js → show-P7GYO43X.js} +1 -1
- package/dist/show-PKZMYKRN.js +82 -0
- package/dist/{snapshot-XHINQBZS.js → snapshot-Y3COXK4T.js} +2 -2
- package/dist/{spawn-DIY7T4QW.js → spawn-SSXZX45U.js} +2 -2
- package/dist/status-KLHALGW4.js +71 -0
- package/dist/{summary-NV7SBV5O.js → summary-5NQNOD3F.js} +2 -2
- package/dist/{sweep-5POCF2E4.js → sweep-EZU3GU6S.js} +1 -1
- package/dist/symphony-ROEKK7VD.js +999 -0
- package/dist/{team-YOGT2Q2X.js → team-HGLJXWQG.js} +7 -7
- package/dist/{timeline-RKXNRMKF.js → timeline-ANC7LVDL.js} +1 -1
- package/dist/{triage-GJ6GK647.js → triage-POXJ2TIX.js} +2 -2
- package/dist/university-content/courses/.purpose +7 -1
- package/dist/university-content/courses/para-101.json +53 -0
- package/dist/university-content/courses/para-501.json +166 -0
- package/dist/university-content/plsat/.purpose +6 -0
- package/dist/university-content/plsat/v3.0.json +400 -1
- package/dist/university-content/reference.json +48 -0
- package/dist/university-ui/assets/{index-TcsCEBMo.js → index-tfi5xN4Q.js} +2 -2
- package/dist/university-ui/assets/{index-TcsCEBMo.js.map → index-tfi5xN4Q.js.map} +1 -1
- package/dist/university-ui/index.html +1 -1
- package/dist/{upgrade-65QOQXRC.js → upgrade-ANX3LVSA.js} +1 -0
- package/dist/validate-GD5XWILV.js +134 -0
- package/dist/{validate-TKKRGJKC.js → validate-ZVPNN4FL.js} +1 -1
- package/dist/{workspace-L27RR5MF.js → workspace-UIUTHZTD.js} +6 -6
- package/package.json +4 -2
- package/platform-ui/dist/assets/GitSection-C-GQWHcu.css +1 -0
- package/platform-ui/dist/assets/GitSection-DvyJBF_-.js +4 -0
- package/platform-ui/dist/assets/GraphSection-BiQrXqfs.js +8 -0
- package/platform-ui/dist/assets/GraphSection-BlgXTl53.css +1 -0
- package/platform-ui/dist/assets/LoreSection-BaH1FaRb.js +1 -0
- package/platform-ui/dist/assets/LoreSection-C3EixkjW.css +1 -0
- package/platform-ui/dist/assets/SentinelSection-BI-aIYKL.css +1 -0
- package/platform-ui/dist/assets/SentinelSection-DemAznjI.js +1 -0
- package/platform-ui/dist/assets/index-CfpZFjea.css +1 -0
- package/platform-ui/dist/assets/index-DDKhCt-w.js +57 -0
- package/platform-ui/dist/index.html +14 -0
- package/dist/graph-server-BZ73HTAT.js +0 -251
- package/dist/sentinel-ui/assets/index-C_Wstm64.js +0 -62
- package/dist/sentinel-ui/assets/index-C_Wstm64.js.map +0 -1
- /package/dist/{chunk-5SXMV4SP.js → chunk-FS3WTUHY.js} +0 -0
|
@@ -360,25 +360,35 @@ async function checkOrphanedSymbols(rootDir) {
|
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
|
-
const
|
|
363
|
+
const hasOutgoingRefs = /* @__PURE__ */ new Set();
|
|
364
|
+
for (const cat of categories) {
|
|
365
|
+
const entries = index[cat];
|
|
366
|
+
if (!entries || typeof entries !== "object") continue;
|
|
367
|
+
for (const [, entry] of Object.entries(entries)) {
|
|
368
|
+
if (entry.symbol && entry.related && Array.isArray(entry.related) && entry.related.length > 0) {
|
|
369
|
+
hasOutgoingRefs.add(entry.symbol);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
const isolated = [];
|
|
364
374
|
for (const [symbol] of allSymbols) {
|
|
365
|
-
if (!referencedSymbols.has(symbol)) {
|
|
366
|
-
|
|
375
|
+
if (!referencedSymbols.has(symbol) && !hasOutgoingRefs.has(symbol)) {
|
|
376
|
+
isolated.push(symbol);
|
|
367
377
|
}
|
|
368
378
|
}
|
|
369
|
-
if (
|
|
379
|
+
if (isolated.length > 0) {
|
|
370
380
|
results.push({
|
|
371
381
|
check: "orphaned-symbols",
|
|
372
382
|
status: "advisory",
|
|
373
|
-
message: `${
|
|
374
|
-
details:
|
|
375
|
-
fix: "
|
|
383
|
+
message: `${isolated.length} isolated symbol${isolated.length > 1 ? "s" : ""} (no connections to other symbols)`,
|
|
384
|
+
details: isolated.slice(0, 20),
|
|
385
|
+
fix: "Wire isolated symbols into features or remove them from .purpose files"
|
|
376
386
|
});
|
|
377
387
|
} else {
|
|
378
388
|
results.push({
|
|
379
389
|
check: "orphaned-symbols",
|
|
380
390
|
status: "ok",
|
|
381
|
-
message: "All symbols
|
|
391
|
+
message: "All symbols are connected"
|
|
382
392
|
});
|
|
383
393
|
}
|
|
384
394
|
return results;
|
|
@@ -524,6 +534,124 @@ async function checkInstructionVagueness(rootDir) {
|
|
|
524
534
|
}
|
|
525
535
|
return results;
|
|
526
536
|
}
|
|
537
|
+
async function checkConfigSchema(rootDir) {
|
|
538
|
+
const results = [];
|
|
539
|
+
const configPath = path.join(rootDir, ".paradigm", "config.yaml");
|
|
540
|
+
if (!fs.existsSync(configPath)) {
|
|
541
|
+
results.push({
|
|
542
|
+
check: "config-schema-validation",
|
|
543
|
+
status: "advisory",
|
|
544
|
+
message: "No .paradigm/config.yaml found"
|
|
545
|
+
});
|
|
546
|
+
return results;
|
|
547
|
+
}
|
|
548
|
+
try {
|
|
549
|
+
const content = fs.readFileSync(configPath, "utf8");
|
|
550
|
+
const { validateConfig } = await import("./config-schema-3YNIFJCJ.js");
|
|
551
|
+
const validation = validateConfig(content);
|
|
552
|
+
const details = [];
|
|
553
|
+
for (const err of validation.errors) {
|
|
554
|
+
details.push(`Error: ${err}`);
|
|
555
|
+
}
|
|
556
|
+
for (const warn of validation.warnings) {
|
|
557
|
+
details.push(`Warning: ${warn}`);
|
|
558
|
+
}
|
|
559
|
+
if (validation.errors.length > 0) {
|
|
560
|
+
results.push({
|
|
561
|
+
check: "config-schema-validation",
|
|
562
|
+
status: "error",
|
|
563
|
+
message: `${validation.errors.length} schema error${validation.errors.length > 1 ? "s" : ""} in config.yaml`,
|
|
564
|
+
details,
|
|
565
|
+
fix: "Fix invalid fields in .paradigm/config.yaml"
|
|
566
|
+
});
|
|
567
|
+
} else if (validation.warnings.length > 0) {
|
|
568
|
+
results.push({
|
|
569
|
+
check: "config-schema-validation",
|
|
570
|
+
status: "warn",
|
|
571
|
+
message: `${validation.warnings.length} unrecognized key${validation.warnings.length > 1 ? "s" : ""} in config.yaml`,
|
|
572
|
+
details,
|
|
573
|
+
fix: "Check for typos in .paradigm/config.yaml field names"
|
|
574
|
+
});
|
|
575
|
+
} else {
|
|
576
|
+
results.push({
|
|
577
|
+
check: "config-schema-validation",
|
|
578
|
+
status: "ok",
|
|
579
|
+
message: "config.yaml schema is valid"
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
} catch (e) {
|
|
583
|
+
results.push({
|
|
584
|
+
check: "config-schema-validation",
|
|
585
|
+
status: "error",
|
|
586
|
+
message: `Could not validate config.yaml: ${e.message}`
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
return results;
|
|
590
|
+
}
|
|
591
|
+
async function checkPurposeFileHealth(rootDir) {
|
|
592
|
+
const results = [];
|
|
593
|
+
const purposeFiles = [];
|
|
594
|
+
function findPurpose(dir) {
|
|
595
|
+
const skipDirs = /* @__PURE__ */ new Set(["node_modules", "dist", ".git", ".paradigm", "coverage", "build"]);
|
|
596
|
+
try {
|
|
597
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
598
|
+
for (const entry of entries) {
|
|
599
|
+
if (skipDirs.has(entry.name)) continue;
|
|
600
|
+
const full = path.join(dir, entry.name);
|
|
601
|
+
if (entry.isDirectory()) {
|
|
602
|
+
findPurpose(full);
|
|
603
|
+
} else if (entry.name === ".purpose") {
|
|
604
|
+
purposeFiles.push(full);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
} catch {
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
findPurpose(rootDir);
|
|
611
|
+
if (purposeFiles.length === 0) {
|
|
612
|
+
results.push({
|
|
613
|
+
check: "purpose-file-health",
|
|
614
|
+
status: "ok",
|
|
615
|
+
message: "No .purpose files to check"
|
|
616
|
+
});
|
|
617
|
+
return results;
|
|
618
|
+
}
|
|
619
|
+
const oversized = [];
|
|
620
|
+
let maxLines = 0;
|
|
621
|
+
let maxFile = "";
|
|
622
|
+
for (const pf of purposeFiles) {
|
|
623
|
+
try {
|
|
624
|
+
const content = fs.readFileSync(pf, "utf8");
|
|
625
|
+
const lines = content.split("\n").length;
|
|
626
|
+
if (lines > maxLines) {
|
|
627
|
+
maxLines = lines;
|
|
628
|
+
maxFile = path.relative(rootDir, pf);
|
|
629
|
+
}
|
|
630
|
+
if (lines > 500) {
|
|
631
|
+
const severity = lines > 1e3 ? "!!" : "!";
|
|
632
|
+
oversized.push(`${severity} ${path.relative(rootDir, pf)} (${lines} lines)`);
|
|
633
|
+
}
|
|
634
|
+
} catch {
|
|
635
|
+
continue;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
if (oversized.length > 0) {
|
|
639
|
+
results.push({
|
|
640
|
+
check: "purpose-file-health",
|
|
641
|
+
status: "warn",
|
|
642
|
+
message: `${oversized.length} oversized .purpose file${oversized.length > 1 ? "s" : ""} (largest: ${maxFile} at ${maxLines} lines)`,
|
|
643
|
+
details: oversized,
|
|
644
|
+
fix: "Split large .purpose files by component type or subdirectory"
|
|
645
|
+
});
|
|
646
|
+
} else {
|
|
647
|
+
results.push({
|
|
648
|
+
check: "purpose-file-health",
|
|
649
|
+
status: "ok",
|
|
650
|
+
message: `${purposeFiles.length} .purpose files, all under 500 lines`
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
return results;
|
|
654
|
+
}
|
|
527
655
|
async function runContextAudit(rootDir, _options) {
|
|
528
656
|
const tracker = log.command("doctor:context-audit").start("Running context audit checks");
|
|
529
657
|
const results = [];
|
|
@@ -534,6 +662,8 @@ async function runContextAudit(rootDir, _options) {
|
|
|
534
662
|
results.push(...await checkOrphanedSymbols(rootDir));
|
|
535
663
|
results.push(...await checkStalePortal(rootDir));
|
|
536
664
|
results.push(...await checkInstructionVagueness(rootDir));
|
|
665
|
+
results.push(...await checkConfigSchema(rootDir));
|
|
666
|
+
results.push(...await checkPurposeFileHealth(rootDir));
|
|
537
667
|
const errorCount = results.filter((r) => r.status === "error").length;
|
|
538
668
|
const warnCount = results.filter((r) => r.status === "warn").length;
|
|
539
669
|
const advisoryCount = results.filter((r) => r.status === "advisory").length;
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
generateCursorrules,
|
|
5
5
|
paradigmConfigExists,
|
|
6
6
|
writeCursorrules
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-LHLIAYQ3.js";
|
|
8
|
+
import "./chunk-36TKPM5Z.js";
|
|
9
9
|
import {
|
|
10
10
|
getDefaultParadigmConfig,
|
|
11
11
|
parseParadigmConfig,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
BackgroundOrchestrator
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-J26YQVAK.js";
|
|
4
|
+
} from "./chunk-QWA26UNO.js";
|
|
5
|
+
import "./chunk-J4E6K5MG.js";
|
|
7
6
|
import "./chunk-PBHIFAL4.js";
|
|
8
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-FS3WTUHY.js";
|
|
8
|
+
import "./chunk-6QC3YGB6.js";
|
|
9
9
|
import "./chunk-PMXRGPRQ.js";
|
|
10
10
|
import "./chunk-MW5DMGBB.js";
|
|
11
11
|
import "./chunk-5JGJACDU.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-ZGUAAVMA.js";
|
|
13
|
+
import "./chunk-EDOAWN7J.js";
|
|
14
14
|
import "./chunk-IRKUEJVW.js";
|
|
15
15
|
import "./chunk-ZXMDA7VB.js";
|
|
16
16
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import "./chunk-ZXMDA7VB.js";
|
|
3
3
|
|
|
4
|
-
// ../sentinel/dist/dist-
|
|
4
|
+
// ../sentinel/dist/dist-5QE2BB2B.js
|
|
5
5
|
import * as fs4 from "fs";
|
|
6
6
|
import { z as z2 } from "zod";
|
|
7
7
|
import * as path3 from "path";
|
|
@@ -5578,6 +5578,12 @@ var Ze = Object.assign(Je, { glob: Je, globSync: ts, sync: Ui, globStream: Qe, s
|
|
|
5578
5578
|
Ze.glob = Ze;
|
|
5579
5579
|
var PurposeItemSchema = z.object({
|
|
5580
5580
|
description: z.string(),
|
|
5581
|
+
// Component type and hierarchy (v4)
|
|
5582
|
+
type: z.string().optional(),
|
|
5583
|
+
parent: z.string().optional(),
|
|
5584
|
+
anchors: z.array(z.string()).optional(),
|
|
5585
|
+
tags: z.array(z.string()).optional(),
|
|
5586
|
+
// Standard fields
|
|
5581
5587
|
endpoints: z.array(z.string()).optional(),
|
|
5582
5588
|
tests: z.array(z.string()).optional(),
|
|
5583
5589
|
rules: z.record(z.unknown()).optional(),
|
|
@@ -5589,7 +5595,6 @@ var PurposeItemSchema = z.object({
|
|
|
5589
5595
|
states: z.array(z.string()).optional(),
|
|
5590
5596
|
components: z.array(z.string()).optional(),
|
|
5591
5597
|
// Extra fields preserved
|
|
5592
|
-
tags: z.array(z.string()).optional(),
|
|
5593
5598
|
location: z.string().optional(),
|
|
5594
5599
|
locations: z.array(z.string()).optional(),
|
|
5595
5600
|
uses: z.array(z.string()).optional(),
|
|
@@ -6401,6 +6406,7 @@ async function aggregateFromPremise(premiseFile, rootDir) {
|
|
|
6401
6406
|
purposeFiles.push(...parsed.map((p) => p.filePath));
|
|
6402
6407
|
const features = extractFeatures(parsed);
|
|
6403
6408
|
for (const [id, { item, filePath }] of features) {
|
|
6409
|
+
const featureTags = ["feature", ...item.tags || []];
|
|
6404
6410
|
symbols.push(createSymbolEntry({
|
|
6405
6411
|
id: `purpose-feature-${id}`,
|
|
6406
6412
|
symbol: `#${id}`,
|
|
@@ -6409,7 +6415,10 @@ async function aggregateFromPremise(premiseFile, rootDir) {
|
|
|
6409
6415
|
filePath,
|
|
6410
6416
|
data: item,
|
|
6411
6417
|
description: item.description,
|
|
6412
|
-
tags:
|
|
6418
|
+
tags: featureTags,
|
|
6419
|
+
componentType: item.type,
|
|
6420
|
+
parentSymbol: item.parent,
|
|
6421
|
+
anchors: item.anchors?.map((a) => parseAnchorString(a))
|
|
6413
6422
|
}));
|
|
6414
6423
|
}
|
|
6415
6424
|
const components = extractComponents(parsed);
|
|
@@ -6421,7 +6430,11 @@ async function aggregateFromPremise(premiseFile, rootDir) {
|
|
|
6421
6430
|
source: "purpose",
|
|
6422
6431
|
filePath,
|
|
6423
6432
|
data: item,
|
|
6424
|
-
description: item.description
|
|
6433
|
+
description: item.description,
|
|
6434
|
+
tags: item.tags,
|
|
6435
|
+
componentType: item.type,
|
|
6436
|
+
parentSymbol: item.parent,
|
|
6437
|
+
anchors: item.anchors?.map((a) => parseAnchorString(a))
|
|
6425
6438
|
}));
|
|
6426
6439
|
}
|
|
6427
6440
|
const gates = extractGates(parsed);
|
|
@@ -6587,12 +6600,27 @@ async function aggregateFromPremise(premiseFile, rootDir) {
|
|
|
6587
6600
|
}));
|
|
6588
6601
|
}
|
|
6589
6602
|
resolveReferences(symbols);
|
|
6603
|
+
const symbolFileMap = /* @__PURE__ */ new Map();
|
|
6604
|
+
for (const sym of symbols) {
|
|
6605
|
+
const files = symbolFileMap.get(sym.symbol) || [];
|
|
6606
|
+
if (!files.includes(sym.filePath)) {
|
|
6607
|
+
files.push(sym.filePath);
|
|
6608
|
+
}
|
|
6609
|
+
symbolFileMap.set(sym.symbol, files);
|
|
6610
|
+
}
|
|
6611
|
+
const duplicateSymbols = [];
|
|
6612
|
+
for (const [symbol, files] of symbolFileMap) {
|
|
6613
|
+
if (files.length > 1) {
|
|
6614
|
+
duplicateSymbols.push({ symbol, files });
|
|
6615
|
+
}
|
|
6616
|
+
}
|
|
6590
6617
|
return {
|
|
6591
6618
|
symbols,
|
|
6592
6619
|
purposeFiles,
|
|
6593
6620
|
portalFiles,
|
|
6594
6621
|
errors,
|
|
6595
|
-
timestamp: Date.now()
|
|
6622
|
+
timestamp: Date.now(),
|
|
6623
|
+
...duplicateSymbols.length > 0 ? { duplicateSymbols } : {}
|
|
6596
6624
|
};
|
|
6597
6625
|
}
|
|
6598
6626
|
function createSymbolEntry(partial) {
|
|
@@ -6751,10 +6779,33 @@ function searchSymbols(index, query) {
|
|
|
6751
6779
|
}
|
|
6752
6780
|
if (entry.tags?.some((tag) => tag.toLowerCase().includes(lowerQuery))) {
|
|
6753
6781
|
results.push(entry);
|
|
6782
|
+
continue;
|
|
6783
|
+
}
|
|
6784
|
+
if (entry.componentType?.toLowerCase().includes(lowerQuery)) {
|
|
6785
|
+
results.push(entry);
|
|
6786
|
+
continue;
|
|
6754
6787
|
}
|
|
6755
6788
|
}
|
|
6756
6789
|
return results;
|
|
6757
6790
|
}
|
|
6791
|
+
function getComponentsByType(index, componentType) {
|
|
6792
|
+
const components = getSymbolsByType(index, "component");
|
|
6793
|
+
return components.filter((c) => c.componentType === componentType);
|
|
6794
|
+
}
|
|
6795
|
+
function getAllComponentTypes(index) {
|
|
6796
|
+
const types = /* @__PURE__ */ new Set();
|
|
6797
|
+
const components = getSymbolsByType(index, "component");
|
|
6798
|
+
for (const comp of components) {
|
|
6799
|
+
if (comp.componentType) {
|
|
6800
|
+
types.add(comp.componentType);
|
|
6801
|
+
}
|
|
6802
|
+
}
|
|
6803
|
+
return Array.from(types).sort();
|
|
6804
|
+
}
|
|
6805
|
+
function getChildComponents(index, parentSymbol) {
|
|
6806
|
+
const components = getSymbolsByType(index, "component");
|
|
6807
|
+
return components.filter((c) => c.parentSymbol === parentSymbol);
|
|
6808
|
+
}
|
|
6758
6809
|
function getReferencesTo(index, symbol) {
|
|
6759
6810
|
const entry = getSymbol(index, symbol);
|
|
6760
6811
|
if (!entry) return [];
|
|
@@ -6838,9 +6889,12 @@ export {
|
|
|
6838
6889
|
createSnapshot,
|
|
6839
6890
|
createSymbolIndex,
|
|
6840
6891
|
createSymbolString,
|
|
6892
|
+
getAllComponentTypes,
|
|
6841
6893
|
getAllSymbols,
|
|
6842
6894
|
getAllTags,
|
|
6843
6895
|
getAutocompleteSuggestions,
|
|
6896
|
+
getChildComponents,
|
|
6897
|
+
getComponentsByType,
|
|
6844
6898
|
getDefaultPremiseContent,
|
|
6845
6899
|
getReferencesFrom,
|
|
6846
6900
|
getReferencesTo,
|
|
@@ -14,6 +14,12 @@ import * as path from "path";
|
|
|
14
14
|
import { glob } from "glob";
|
|
15
15
|
var PurposeItemSchema = z.object({
|
|
16
16
|
description: z.string(),
|
|
17
|
+
// Component type and hierarchy (v4)
|
|
18
|
+
type: z.string().optional(),
|
|
19
|
+
parent: z.string().optional(),
|
|
20
|
+
anchors: z.array(z.string()).optional(),
|
|
21
|
+
tags: z.array(z.string()).optional(),
|
|
22
|
+
// Standard fields
|
|
17
23
|
endpoints: z.array(z.string()).optional(),
|
|
18
24
|
tests: z.array(z.string()).optional(),
|
|
19
25
|
rules: z.record(z.unknown()).optional(),
|
|
@@ -25,7 +31,6 @@ var PurposeItemSchema = z.object({
|
|
|
25
31
|
states: z.array(z.string()).optional(),
|
|
26
32
|
components: z.array(z.string()).optional(),
|
|
27
33
|
// Extra fields preserved
|
|
28
|
-
tags: z.array(z.string()).optional(),
|
|
29
34
|
location: z.string().optional(),
|
|
30
35
|
locations: z.array(z.string()).optional(),
|
|
31
36
|
uses: z.array(z.string()).optional(),
|
|
@@ -845,6 +850,7 @@ async function aggregateFromPremise(premiseFile, rootDir) {
|
|
|
845
850
|
purposeFiles.push(...parsed.map((p) => p.filePath));
|
|
846
851
|
const features = extractFeatures(parsed);
|
|
847
852
|
for (const [id, { item, filePath }] of features) {
|
|
853
|
+
const featureTags = ["feature", ...item.tags || []];
|
|
848
854
|
symbols.push(createSymbolEntry({
|
|
849
855
|
id: `purpose-feature-${id}`,
|
|
850
856
|
symbol: `#${id}`,
|
|
@@ -853,7 +859,10 @@ async function aggregateFromPremise(premiseFile, rootDir) {
|
|
|
853
859
|
filePath,
|
|
854
860
|
data: item,
|
|
855
861
|
description: item.description,
|
|
856
|
-
tags:
|
|
862
|
+
tags: featureTags,
|
|
863
|
+
componentType: item.type,
|
|
864
|
+
parentSymbol: item.parent,
|
|
865
|
+
anchors: item.anchors?.map((a) => parseAnchorString(a))
|
|
857
866
|
}));
|
|
858
867
|
}
|
|
859
868
|
const components = extractComponents(parsed);
|
|
@@ -865,7 +874,11 @@ async function aggregateFromPremise(premiseFile, rootDir) {
|
|
|
865
874
|
source: "purpose",
|
|
866
875
|
filePath,
|
|
867
876
|
data: item,
|
|
868
|
-
description: item.description
|
|
877
|
+
description: item.description,
|
|
878
|
+
tags: item.tags,
|
|
879
|
+
componentType: item.type,
|
|
880
|
+
parentSymbol: item.parent,
|
|
881
|
+
anchors: item.anchors?.map((a) => parseAnchorString(a))
|
|
869
882
|
}));
|
|
870
883
|
}
|
|
871
884
|
const gates = extractGates(parsed);
|
|
@@ -1031,12 +1044,27 @@ async function aggregateFromPremise(premiseFile, rootDir) {
|
|
|
1031
1044
|
}));
|
|
1032
1045
|
}
|
|
1033
1046
|
resolveReferences(symbols);
|
|
1047
|
+
const symbolFileMap = /* @__PURE__ */ new Map();
|
|
1048
|
+
for (const sym of symbols) {
|
|
1049
|
+
const files = symbolFileMap.get(sym.symbol) || [];
|
|
1050
|
+
if (!files.includes(sym.filePath)) {
|
|
1051
|
+
files.push(sym.filePath);
|
|
1052
|
+
}
|
|
1053
|
+
symbolFileMap.set(sym.symbol, files);
|
|
1054
|
+
}
|
|
1055
|
+
const duplicateSymbols = [];
|
|
1056
|
+
for (const [symbol, files] of symbolFileMap) {
|
|
1057
|
+
if (files.length > 1) {
|
|
1058
|
+
duplicateSymbols.push({ symbol, files });
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1034
1061
|
return {
|
|
1035
1062
|
symbols,
|
|
1036
1063
|
purposeFiles,
|
|
1037
1064
|
portalFiles,
|
|
1038
1065
|
errors,
|
|
1039
|
-
timestamp: Date.now()
|
|
1066
|
+
timestamp: Date.now(),
|
|
1067
|
+
...duplicateSymbols.length > 0 ? { duplicateSymbols } : {}
|
|
1040
1068
|
};
|
|
1041
1069
|
}
|
|
1042
1070
|
function createSymbolEntry(partial) {
|
|
@@ -1195,10 +1223,33 @@ function searchSymbols(index, query) {
|
|
|
1195
1223
|
}
|
|
1196
1224
|
if (entry.tags?.some((tag) => tag.toLowerCase().includes(lowerQuery))) {
|
|
1197
1225
|
results.push(entry);
|
|
1226
|
+
continue;
|
|
1227
|
+
}
|
|
1228
|
+
if (entry.componentType?.toLowerCase().includes(lowerQuery)) {
|
|
1229
|
+
results.push(entry);
|
|
1230
|
+
continue;
|
|
1198
1231
|
}
|
|
1199
1232
|
}
|
|
1200
1233
|
return results;
|
|
1201
1234
|
}
|
|
1235
|
+
function getComponentsByType(index, componentType) {
|
|
1236
|
+
const components = getSymbolsByType(index, "component");
|
|
1237
|
+
return components.filter((c) => c.componentType === componentType);
|
|
1238
|
+
}
|
|
1239
|
+
function getAllComponentTypes(index) {
|
|
1240
|
+
const types = /* @__PURE__ */ new Set();
|
|
1241
|
+
const components = getSymbolsByType(index, "component");
|
|
1242
|
+
for (const comp of components) {
|
|
1243
|
+
if (comp.componentType) {
|
|
1244
|
+
types.add(comp.componentType);
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
return Array.from(types).sort();
|
|
1248
|
+
}
|
|
1249
|
+
function getChildComponents(index, parentSymbol) {
|
|
1250
|
+
const components = getSymbolsByType(index, "component");
|
|
1251
|
+
return components.filter((c) => c.parentSymbol === parentSymbol);
|
|
1252
|
+
}
|
|
1202
1253
|
function getReferencesTo(index, symbol) {
|
|
1203
1254
|
const entry = getSymbol(index, symbol);
|
|
1204
1255
|
if (!entry) return [];
|
|
@@ -1282,9 +1333,12 @@ export {
|
|
|
1282
1333
|
createSnapshot,
|
|
1283
1334
|
createSymbolIndex,
|
|
1284
1335
|
createSymbolString,
|
|
1336
|
+
getAllComponentTypes,
|
|
1285
1337
|
getAllSymbols,
|
|
1286
1338
|
getAllTags,
|
|
1287
1339
|
getAutocompleteSuggestions,
|
|
1340
|
+
getChildComponents,
|
|
1341
|
+
getComponentsByType,
|
|
1288
1342
|
getDefaultPremiseContent,
|
|
1289
1343
|
getReferencesFrom,
|
|
1290
1344
|
getReferencesTo,
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
PatternImporter,
|
|
11
11
|
PatternMatcher,
|
|
12
12
|
PatternSuggester,
|
|
13
|
+
SYMPHONY_SCHEMA,
|
|
13
14
|
Sentinel,
|
|
14
15
|
SentinelClient,
|
|
15
16
|
SentinelStorage,
|
|
@@ -27,7 +28,7 @@ import {
|
|
|
27
28
|
loadServerConfig,
|
|
28
29
|
loadUniversalPatterns,
|
|
29
30
|
writeConfig
|
|
30
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-RGFANZ4Q.js";
|
|
31
32
|
export {
|
|
32
33
|
ContextEnricher,
|
|
33
34
|
DEFAULT_AUTH_CONFIG,
|
|
@@ -39,6 +40,7 @@ export {
|
|
|
39
40
|
PatternImporter,
|
|
40
41
|
PatternMatcher,
|
|
41
42
|
PatternSuggester,
|
|
43
|
+
SYMPHONY_SCHEMA,
|
|
42
44
|
Sentinel,
|
|
43
45
|
SentinelClient,
|
|
44
46
|
SentinelStorage,
|
|
@@ -11,9 +11,12 @@ import {
|
|
|
11
11
|
createSnapshot,
|
|
12
12
|
createSymbolIndex,
|
|
13
13
|
createSymbolString,
|
|
14
|
+
getAllComponentTypes,
|
|
14
15
|
getAllSymbols,
|
|
15
16
|
getAllTags,
|
|
16
17
|
getAutocompleteSuggestions,
|
|
18
|
+
getChildComponents,
|
|
19
|
+
getComponentsByType,
|
|
17
20
|
getDefaultPremiseContent,
|
|
18
21
|
getReferencesFrom,
|
|
19
22
|
getReferencesTo,
|
|
@@ -30,8 +33,8 @@ import {
|
|
|
30
33
|
searchSymbols,
|
|
31
34
|
serializePremiseFile,
|
|
32
35
|
updateNodePosition
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import "./chunk-
|
|
36
|
+
} from "./chunk-ZGUAAVMA.js";
|
|
37
|
+
import "./chunk-EDOAWN7J.js";
|
|
35
38
|
import "./chunk-IRKUEJVW.js";
|
|
36
39
|
import "./chunk-ZXMDA7VB.js";
|
|
37
40
|
export {
|
|
@@ -46,9 +49,12 @@ export {
|
|
|
46
49
|
createSnapshot,
|
|
47
50
|
createSymbolIndex,
|
|
48
51
|
createSymbolString,
|
|
52
|
+
getAllComponentTypes,
|
|
49
53
|
getAllSymbols,
|
|
50
54
|
getAllTags,
|
|
51
55
|
getAutocompleteSuggestions,
|
|
56
|
+
getChildComponents,
|
|
57
|
+
getComponentsByType,
|
|
52
58
|
getDefaultPremiseContent,
|
|
53
59
|
getReferencesFrom,
|
|
54
60
|
getReferencesTo,
|
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
ContextEnricher,
|
|
4
4
|
FlowTracker,
|
|
5
5
|
IncidentGrouper,
|
|
6
|
-
PARADIGM_SCHEMA,
|
|
7
6
|
PatternImporter,
|
|
8
7
|
PatternMatcher,
|
|
9
8
|
PatternSuggester,
|
|
@@ -20,16 +19,18 @@ import {
|
|
|
20
19
|
loadAllSeedPatterns,
|
|
21
20
|
loadParadigmPatterns,
|
|
22
21
|
loadUniversalPatterns
|
|
23
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-7WEKMZ46.js";
|
|
24
23
|
import {
|
|
25
24
|
DEFAULT_AUTH_CONFIG,
|
|
26
25
|
DEFAULT_RATE_LIMIT_CONFIG,
|
|
27
26
|
DEFAULT_SERVER_CONFIG,
|
|
27
|
+
PARADIGM_SCHEMA,
|
|
28
|
+
SYMPHONY_SCHEMA,
|
|
28
29
|
SentinelStorage,
|
|
29
30
|
loadConfig,
|
|
30
31
|
loadServerConfig,
|
|
31
32
|
writeConfig
|
|
32
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-YW5OCVKB.js";
|
|
33
34
|
import "./chunk-ZXMDA7VB.js";
|
|
34
35
|
export {
|
|
35
36
|
ContextEnricher,
|
|
@@ -42,6 +43,7 @@ export {
|
|
|
42
43
|
PatternImporter,
|
|
43
44
|
PatternMatcher,
|
|
44
45
|
PatternSuggester,
|
|
46
|
+
SYMPHONY_SCHEMA,
|
|
45
47
|
Sentinel,
|
|
46
48
|
SentinelClient,
|
|
47
49
|
SentinelStorage,
|