@a-company/paradigm 3.28.0 → 3.34.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.
Files changed (41) hide show
  1. package/dist/{accept-orchestration-6EM5EHXA.js → accept-orchestration-XXANWJVZ.js} +3 -3
  2. package/dist/{aggregate-M5WMUI6B.js → aggregate-XHQ6GI3Z.js} +2 -2
  3. package/dist/{beacon-XL2ALH5O.js → beacon-BTLQMYQL.js} +2 -2
  4. package/dist/{chunk-AK5M6KJB.js → chunk-36TKPM5Z.js} +20 -2
  5. package/dist/{chunk-ZOH24ZPF.js → chunk-3BGSDKWD.js} +3 -3
  6. package/dist/{chunk-6P4IFIK2.js → chunk-CTF6RHKG.js} +37 -3
  7. package/dist/{chunk-SCC77UUP.js → chunk-H4TVBJD4.js} +3 -3
  8. package/dist/{chunk-KWDTBXP2.js → chunk-LHLIAYQ3.js} +1 -1
  9. package/dist/{chunk-7IJ5JVKT.js → chunk-PFLWLC6J.js} +59 -7
  10. package/dist/{chunk-W4VFKZVF.js → chunk-S5TDFT5Q.js} +2 -2
  11. package/dist/{chunk-N6RNYCZD.js → chunk-UQNTJ5VB.js} +1 -1
  12. package/dist/{chunk-MRENOFTR.js → chunk-VUSCJJ4A.js} +6 -1
  13. package/dist/{chunk-OXG5GVDJ.js → chunk-WOONGZ3C.js} +1 -1
  14. package/dist/{commands-6ZVTD74M.js → commands-KPT2T2OZ.js} +1 -1
  15. package/dist/{constellation-NXU6Q2HM.js → constellation-LZ6XIKDT.js} +2 -2
  16. package/dist/{cost-CTGSLSOC.js → cost-4SZM7OUS.js} +1 -1
  17. package/dist/{cursorrules-XBWFX66V.js → cursorrules-3TKZ4E4R.js} +2 -2
  18. package/dist/{diff-AH7L4PRQ.js → diff-T6YJSAAC.js} +3 -3
  19. package/dist/{dist-KY5HGDDL.js → dist-OH4DBV2O.js} +42 -3
  20. package/dist/{dist-7U64HDSC.js → dist-QSBAGCZT.js} +8 -2
  21. package/dist/index.js +43 -39
  22. package/dist/{lint-53GPXKKI.js → lint-MTRZB5EC.js} +1 -1
  23. package/dist/mcp.js +42 -7
  24. package/dist/migrate-HRN5TUBQ.js +871 -0
  25. package/dist/{orchestrate-HMSQ2CED.js → orchestrate-3SI6ON33.js} +3 -3
  26. package/dist/{probe-SN4BNXOC.js → probe-ABMGCXQG.js} +4 -4
  27. package/dist/{reindex-YG3KIXAK.js → reindex-YC7LD4MN.js} +1 -1
  28. package/dist/{remember-IEBQHXHZ.js → remember-WR6ZVXLT.js} +1 -1
  29. package/dist/{ripple-DFMXLFWI.js → ripple-QTXKJCEI.js} +2 -2
  30. package/dist/sentinel.js +6 -6
  31. package/dist/{setup-HOI52TN3.js → setup-ASR6OMKV.js} +4 -4
  32. package/dist/{shift-DRF5M3G6.js → shift-7XLSBLDW.js} +19 -9
  33. package/dist/{snapshot-XHINQBZS.js → snapshot-QZFD7YBI.js} +2 -2
  34. package/dist/{summary-NV7SBV5O.js → summary-R4CSYNNP.js} +2 -2
  35. package/dist/{team-YOGT2Q2X.js → team-VH3HYABB.js} +4 -4
  36. package/dist/university-content/courses/para-101.json +53 -0
  37. package/dist/university-content/plsat/v3.0.json +78 -1
  38. package/dist/{upgrade-65QOQXRC.js → upgrade-ANX3LVSA.js} +1 -0
  39. package/dist/{validate-TKKRGJKC.js → validate-OUHUBZPO.js} +1 -1
  40. package/dist/{workspace-L27RR5MF.js → workspace-5RBSALXC.js} +5 -5
  41. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  BackgroundOrchestrator
4
- } from "./chunk-ZOH24ZPF.js";
4
+ } from "./chunk-3BGSDKWD.js";
5
5
  import "./chunk-6QC3YGB6.js";
6
6
  import "./chunk-J26YQVAK.js";
7
7
  import "./chunk-PBHIFAL4.js";
@@ -9,8 +9,8 @@ import "./chunk-5SXMV4SP.js";
9
9
  import "./chunk-PMXRGPRQ.js";
10
10
  import "./chunk-MW5DMGBB.js";
11
11
  import "./chunk-5JGJACDU.js";
12
- import "./chunk-6P4IFIK2.js";
13
- import "./chunk-MRENOFTR.js";
12
+ import "./chunk-CTF6RHKG.js";
13
+ import "./chunk-VUSCJJ4A.js";
14
14
  import "./chunk-IRKUEJVW.js";
15
15
  import "./chunk-ZXMDA7VB.js";
16
16
 
@@ -5,8 +5,8 @@ import {
5
5
  buildSymbolIndex,
6
6
  getSymbolCounts,
7
7
  parsePremiseFile
8
- } from "./chunk-6P4IFIK2.js";
9
- import "./chunk-MRENOFTR.js";
8
+ } from "./chunk-CTF6RHKG.js";
9
+ import "./chunk-VUSCJJ4A.js";
10
10
  import "./chunk-IRKUEJVW.js";
11
11
  import "./chunk-ZXMDA7VB.js";
12
12
 
@@ -4,8 +4,8 @@ import {
4
4
  buildSymbolIndex,
5
5
  getAllSymbols,
6
6
  getSymbolCounts
7
- } from "./chunk-6P4IFIK2.js";
8
- import "./chunk-MRENOFTR.js";
7
+ } from "./chunk-CTF6RHKG.js";
8
+ import "./chunk-VUSCJJ4A.js";
9
9
  import "./chunk-IRKUEJVW.js";
10
10
  import {
11
11
  log
@@ -34,6 +34,20 @@ function generateScanIndex(input, options) {
34
34
  }
35
35
  }
36
36
  }
37
+ const typeCounts = {};
38
+ for (const comp of Object.values(index.components)) {
39
+ if (comp.componentType) {
40
+ typeCounts[comp.componentType] = (typeCounts[comp.componentType] || 0) + 1;
41
+ }
42
+ }
43
+ for (const feat of Object.values(index.features)) {
44
+ if (feat.componentType) {
45
+ typeCounts[feat.componentType] = (typeCounts[feat.componentType] || 0) + 1;
46
+ }
47
+ }
48
+ if (Object.keys(typeCounts).length > 0) {
49
+ index.$meta.componentTypes = typeCounts;
50
+ }
37
51
  buildScreenReferences(index);
38
52
  return index;
39
53
  }
@@ -89,7 +103,9 @@ function addComponent(symbol, index, options) {
89
103
  path: symbol.filePath,
90
104
  description: symbol.description,
91
105
  visualTags,
92
- related: symbol.references
106
+ related: symbol.references,
107
+ componentType: symbol.componentType,
108
+ parent: symbol.parentSymbol
93
109
  };
94
110
  index.components[id] = element;
95
111
  index.symbolMap[symbol.symbol] = { category: "components", id };
@@ -105,7 +121,9 @@ function addFeature(symbol, index, options) {
105
121
  path: symbol.filePath,
106
122
  description: symbol.description,
107
123
  visualTags,
108
- related: symbol.references
124
+ related: symbol.references,
125
+ componentType: symbol.componentType,
126
+ parent: symbol.parentSymbol
109
127
  };
110
128
  index.features[id] = element;
111
129
  index.symbolMap[symbol.symbol] = { category: "features", id };
@@ -23,7 +23,7 @@ import {
23
23
  buildSymbolIndex,
24
24
  getReferencesTo,
25
25
  searchSymbols
26
- } from "./chunk-6P4IFIK2.js";
26
+ } from "./chunk-CTF6RHKG.js";
27
27
 
28
28
  // src/core/orchestrator.ts
29
29
  import { minimatch } from "minimatch";
@@ -566,7 +566,7 @@ var Orchestrator = class {
566
566
  let preflightResult;
567
567
  if (options.pmGovernance?.enabled) {
568
568
  try {
569
- const { aggregateFromDirectory } = await import("./dist-7U64HDSC.js");
569
+ const { aggregateFromDirectory } = await import("./dist-QSBAGCZT.js");
570
570
  const aggregation = await aggregateFromDirectory(this.rootDir);
571
571
  const index = buildSymbolIndex(aggregation);
572
572
  preflightResult = runPreflight(task, this.rootDir, index);
@@ -593,7 +593,7 @@ var Orchestrator = class {
593
593
  }
594
594
  if (options.pmGovernance?.enabled && preflightResult) {
595
595
  try {
596
- const { aggregateFromDirectory } = await import("./dist-7U64HDSC.js");
596
+ const { aggregateFromDirectory } = await import("./dist-QSBAGCZT.js");
597
597
  const aggregation = await aggregateFromDirectory(this.rootDir);
598
598
  const index = buildSymbolIndex(aggregation);
599
599
  const filesModified = [];
@@ -9,7 +9,7 @@ import {
9
9
  extractStates,
10
10
  extractSymbolReferences,
11
11
  getAllPurposeFiles
12
- } from "./chunk-MRENOFTR.js";
12
+ } from "./chunk-VUSCJJ4A.js";
13
13
  import {
14
14
  findGateFiles,
15
15
  parseGateConfig
@@ -247,6 +247,7 @@ async function aggregateFromPremise(premiseFile, rootDir) {
247
247
  purposeFiles.push(...parsed.map((p) => p.filePath));
248
248
  const features = extractFeatures(parsed);
249
249
  for (const [id, { item, filePath }] of features) {
250
+ const featureTags = ["feature", ...item.tags || []];
250
251
  symbols.push(createSymbolEntry({
251
252
  id: `purpose-feature-${id}`,
252
253
  symbol: `#${id}`,
@@ -255,7 +256,10 @@ async function aggregateFromPremise(premiseFile, rootDir) {
255
256
  filePath,
256
257
  data: item,
257
258
  description: item.description,
258
- tags: ["feature"]
259
+ tags: featureTags,
260
+ componentType: item.type,
261
+ parentSymbol: item.parent,
262
+ anchors: item.anchors?.map((a) => parseAnchorString(a))
259
263
  }));
260
264
  }
261
265
  const components = extractComponents(parsed);
@@ -267,7 +271,11 @@ async function aggregateFromPremise(premiseFile, rootDir) {
267
271
  source: "purpose",
268
272
  filePath,
269
273
  data: item,
270
- description: item.description
274
+ description: item.description,
275
+ tags: item.tags,
276
+ componentType: item.type,
277
+ parentSymbol: item.parent,
278
+ anchors: item.anchors?.map((a) => parseAnchorString(a))
271
279
  }));
272
280
  }
273
281
  const gates = extractGates(parsed);
@@ -597,10 +605,33 @@ function searchSymbols(index, query) {
597
605
  }
598
606
  if (entry.tags?.some((tag) => tag.toLowerCase().includes(lowerQuery))) {
599
607
  results.push(entry);
608
+ continue;
609
+ }
610
+ if (entry.componentType?.toLowerCase().includes(lowerQuery)) {
611
+ results.push(entry);
612
+ continue;
600
613
  }
601
614
  }
602
615
  return results;
603
616
  }
617
+ function getComponentsByType(index, componentType) {
618
+ const components = getSymbolsByType(index, "component");
619
+ return components.filter((c) => c.componentType === componentType);
620
+ }
621
+ function getAllComponentTypes(index) {
622
+ const types = /* @__PURE__ */ new Set();
623
+ const components = getSymbolsByType(index, "component");
624
+ for (const comp of components) {
625
+ if (comp.componentType) {
626
+ types.add(comp.componentType);
627
+ }
628
+ }
629
+ return Array.from(types).sort();
630
+ }
631
+ function getChildComponents(index, parentSymbol) {
632
+ const components = getSymbolsByType(index, "component");
633
+ return components.filter((c) => c.parentSymbol === parentSymbol);
634
+ }
604
635
  function getReferencesTo(index, symbol) {
605
636
  const entry = getSymbol(index, symbol);
606
637
  if (!entry) return [];
@@ -694,6 +725,9 @@ export {
694
725
  getSymbolsByType,
695
726
  getSymbolsBySource,
696
727
  searchSymbols,
728
+ getComponentsByType,
729
+ getAllComponentTypes,
730
+ getChildComponents,
697
731
  getReferencesTo,
698
732
  getReferencesFrom,
699
733
  getSymbolsByTag,
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  indexCommand
4
- } from "./chunk-W4VFKZVF.js";
4
+ } from "./chunk-S5TDFT5Q.js";
5
5
  import {
6
6
  getDefaultPremiseContent
7
- } from "./chunk-6P4IFIK2.js";
7
+ } from "./chunk-CTF6RHKG.js";
8
8
  import {
9
9
  getDefaultPurposeContent
10
- } from "./chunk-MRENOFTR.js";
10
+ } from "./chunk-VUSCJJ4A.js";
11
11
  import {
12
12
  STACK_PRESETS,
13
13
  detectDiscipline,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  getScanProtocol
4
- } from "./chunk-AK5M6KJB.js";
4
+ } from "./chunk-36TKPM5Z.js";
5
5
 
6
6
  // src/core/cursorrules.ts
7
7
  import * as fs from "fs";
@@ -22,6 +22,12 @@ import * as path from "path";
22
22
  import { glob } from "glob";
23
23
  var PurposeItemSchema = z.object({
24
24
  description: z.string(),
25
+ // Component type and hierarchy (v4)
26
+ type: z.string().optional(),
27
+ parent: z.string().optional(),
28
+ anchors: z.array(z.string()).optional(),
29
+ tags: z.array(z.string()).optional(),
30
+ // Standard fields
25
31
  endpoints: z.array(z.string()).optional(),
26
32
  tests: z.array(z.string()).optional(),
27
33
  rules: z.record(z.unknown()).optional(),
@@ -33,7 +39,6 @@ var PurposeItemSchema = z.object({
33
39
  states: z.array(z.string()).optional(),
34
40
  components: z.array(z.string()).optional(),
35
41
  // Extra fields preserved
36
- tags: z.array(z.string()).optional(),
37
42
  location: z.string().optional(),
38
43
  locations: z.array(z.string()).optional(),
39
44
  uses: z.array(z.string()).optional(),
@@ -847,6 +852,7 @@ async function aggregateFromPremise(premiseFile, rootDir) {
847
852
  purposeFiles.push(...parsed.map((p) => p.filePath));
848
853
  const features = extractFeatures(parsed);
849
854
  for (const [id, { item, filePath }] of features) {
855
+ const featureTags = ["feature", ...item.tags || []];
850
856
  symbols.push(createSymbolEntry({
851
857
  id: `purpose-feature-${id}`,
852
858
  symbol: `#${id}`,
@@ -855,7 +861,10 @@ async function aggregateFromPremise(premiseFile, rootDir) {
855
861
  filePath,
856
862
  data: item,
857
863
  description: item.description,
858
- tags: ["feature"]
864
+ tags: featureTags,
865
+ componentType: item.type,
866
+ parentSymbol: item.parent,
867
+ anchors: item.anchors?.map((a) => parseAnchorString(a))
859
868
  }));
860
869
  }
861
870
  const components = extractComponents(parsed);
@@ -867,7 +876,11 @@ async function aggregateFromPremise(premiseFile, rootDir) {
867
876
  source: "purpose",
868
877
  filePath,
869
878
  data: item,
870
- description: item.description
879
+ description: item.description,
880
+ tags: item.tags,
881
+ componentType: item.type,
882
+ parentSymbol: item.parent,
883
+ anchors: item.anchors?.map((a) => parseAnchorString(a))
871
884
  }));
872
885
  }
873
886
  const gates = extractGates(parsed);
@@ -1191,6 +1204,11 @@ function searchSymbols(index, query) {
1191
1204
  }
1192
1205
  if (entry.tags?.some((tag) => tag.toLowerCase().includes(lowerQuery))) {
1193
1206
  results.push(entry);
1207
+ continue;
1208
+ }
1209
+ if (entry.componentType?.toLowerCase().includes(lowerQuery)) {
1210
+ results.push(entry);
1211
+ continue;
1194
1212
  }
1195
1213
  }
1196
1214
  return results;
@@ -1258,6 +1276,20 @@ function generateScanIndex(input, options) {
1258
1276
  }
1259
1277
  }
1260
1278
  }
1279
+ const typeCounts = {};
1280
+ for (const comp of Object.values(index.components)) {
1281
+ if (comp.componentType) {
1282
+ typeCounts[comp.componentType] = (typeCounts[comp.componentType] || 0) + 1;
1283
+ }
1284
+ }
1285
+ for (const feat of Object.values(index.features)) {
1286
+ if (feat.componentType) {
1287
+ typeCounts[feat.componentType] = (typeCounts[feat.componentType] || 0) + 1;
1288
+ }
1289
+ }
1290
+ if (Object.keys(typeCounts).length > 0) {
1291
+ index.$meta.componentTypes = typeCounts;
1292
+ }
1261
1293
  buildScreenReferences(index);
1262
1294
  return index;
1263
1295
  }
@@ -1313,7 +1345,9 @@ function addComponent(symbol, index, options) {
1313
1345
  path: symbol.filePath,
1314
1346
  description: symbol.description,
1315
1347
  visualTags,
1316
- related: symbol.references
1348
+ related: symbol.references,
1349
+ componentType: symbol.componentType,
1350
+ parent: symbol.parentSymbol
1317
1351
  };
1318
1352
  index.components[id] = element;
1319
1353
  index.symbolMap[symbol.symbol] = { category: "components", id };
@@ -1329,7 +1363,9 @@ function addFeature(symbol, index, options) {
1329
1363
  path: symbol.filePath,
1330
1364
  description: symbol.description,
1331
1365
  visualTags,
1332
- related: symbol.references
1366
+ related: symbol.references,
1367
+ componentType: symbol.componentType,
1368
+ parent: symbol.parentSymbol
1333
1369
  };
1334
1370
  index.features[id] = element;
1335
1371
  index.symbolMap[symbol.symbol] = { category: "features", id };
@@ -4801,6 +4837,12 @@ async function rebuildStaticFiles(rootDir, ctx) {
4801
4837
  for (const sym of aggregation.symbols) {
4802
4838
  breakdown[sym.type] = (breakdown[sym.type] || 0) + 1;
4803
4839
  }
4840
+ const componentTypeBreakdown = {};
4841
+ for (const sym of aggregation.symbols) {
4842
+ if (sym.type === "component" && sym.componentType) {
4843
+ componentTypeBreakdown[sym.componentType] = (componentTypeBreakdown[sym.componentType] || 0) + 1;
4844
+ }
4845
+ }
4804
4846
  return {
4805
4847
  action: "reindex",
4806
4848
  filesWritten,
@@ -4809,17 +4851,27 @@ async function rebuildStaticFiles(rootDir, ctx) {
4809
4851
  flowCount,
4810
4852
  aspectGraphStats,
4811
4853
  personaCount,
4812
- protocolHealth
4854
+ protocolHealth,
4855
+ ...Object.keys(componentTypeBreakdown).length > 0 ? { componentTypeBreakdown } : {}
4813
4856
  };
4814
4857
  }
4815
4858
  function buildNavigatorData(rootDir, aggregation) {
4859
+ const symbolsByComponentType = {};
4860
+ for (const sym of aggregation.symbols) {
4861
+ if (sym.type === "component" && sym.componentType) {
4862
+ const ct = sym.componentType;
4863
+ if (!symbolsByComponentType[ct]) symbolsByComponentType[ct] = [];
4864
+ symbolsByComponentType[ct].push(sym.symbol);
4865
+ }
4866
+ }
4816
4867
  return {
4817
4868
  version: "1.0",
4818
4869
  generated: (/* @__PURE__ */ new Date()).toISOString(),
4819
4870
  structure: buildStructure(rootDir),
4820
4871
  key_files: buildKeyFiles(rootDir),
4821
4872
  skip_patterns: buildSkipPatterns(rootDir),
4822
- symbols: buildSymbolMap(aggregation.symbols, aggregation.purposeFiles, rootDir)
4873
+ symbols: buildSymbolMap(aggregation.symbols, aggregation.purposeFiles, rootDir),
4874
+ ...Object.keys(symbolsByComponentType).length > 0 ? { symbolsByComponentType } : {}
4823
4875
  };
4824
4876
  }
4825
4877
  function buildStructure(rootDir) {
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  generateScanIndex,
4
4
  serializeScanIndex
5
- } from "./chunk-AK5M6KJB.js";
5
+ } from "./chunk-36TKPM5Z.js";
6
6
  import {
7
7
  aggregateFromDirectory
8
- } from "./chunk-6P4IFIK2.js";
8
+ } from "./chunk-CTF6RHKG.js";
9
9
  import {
10
10
  cliBuildGraphState
11
11
  } from "./chunk-Z7W7HNRG.js";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  BackgroundOrchestrator
4
- } from "./chunk-ZOH24ZPF.js";
4
+ } from "./chunk-3BGSDKWD.js";
5
5
  import {
6
6
  AGENT_MODEL_RECOMMENDATIONS,
7
7
  addActivity,
@@ -8,6 +8,12 @@ import * as path from "path";
8
8
  import { glob } from "glob";
9
9
  var PurposeItemSchema = z.object({
10
10
  description: z.string(),
11
+ // Component type and hierarchy (v4)
12
+ type: z.string().optional(),
13
+ parent: z.string().optional(),
14
+ anchors: z.array(z.string()).optional(),
15
+ tags: z.array(z.string()).optional(),
16
+ // Standard fields
11
17
  endpoints: z.array(z.string()).optional(),
12
18
  tests: z.array(z.string()).optional(),
13
19
  rules: z.record(z.unknown()).optional(),
@@ -19,7 +25,6 @@ var PurposeItemSchema = z.object({
19
25
  states: z.array(z.string()).optional(),
20
26
  components: z.array(z.string()).optional(),
21
27
  // Extra fields preserved
22
- tags: z.array(z.string()).optional(),
23
28
  location: z.string().optional(),
24
29
  locations: z.array(z.string()).optional(),
25
30
  uses: z.array(z.string()).optional(),
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  indexCommand
4
- } from "./chunk-W4VFKZVF.js";
4
+ } from "./chunk-S5TDFT5Q.js";
5
5
  import {
6
6
  log
7
7
  } from "./chunk-4NCFWYGG.js";
@@ -3174,7 +3174,7 @@ async function loadParadigmConfig(projectDir) {
3174
3174
  }
3175
3175
  async function loadWithPremiseCore(projectDir) {
3176
3176
  try {
3177
- const { aggregateFromDirectory } = await import("./dist-KY5HGDDL.js");
3177
+ const { aggregateFromDirectory } = await import("./dist-OH4DBV2O.js");
3178
3178
  log.flow("load-symbols").info("Using premise-core aggregator", { path: projectDir });
3179
3179
  const result = await aggregateFromDirectory(projectDir);
3180
3180
  const counts = {};
@@ -5,8 +5,8 @@ import {
5
5
  getAllSymbols,
6
6
  getSymbolCounts,
7
7
  getSymbolsByType
8
- } from "./chunk-6P4IFIK2.js";
9
- import "./chunk-MRENOFTR.js";
8
+ } from "./chunk-CTF6RHKG.js";
9
+ import "./chunk-VUSCJJ4A.js";
10
10
  import "./chunk-IRKUEJVW.js";
11
11
  import {
12
12
  log
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  findPurposeFiles
4
- } from "./chunk-MRENOFTR.js";
4
+ } from "./chunk-VUSCJJ4A.js";
5
5
  import {
6
6
  findGateFiles
7
7
  } from "./chunk-IRKUEJVW.js";
@@ -4,8 +4,8 @@ import {
4
4
  generateCursorrules,
5
5
  paradigmConfigExists,
6
6
  writeCursorrules
7
- } from "./chunk-KWDTBXP2.js";
8
- import "./chunk-AK5M6KJB.js";
7
+ } from "./chunk-LHLIAYQ3.js";
8
+ import "./chunk-36TKPM5Z.js";
9
9
  import {
10
10
  getDefaultParadigmConfig,
11
11
  parseParadigmConfig,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  BackgroundOrchestrator
4
- } from "./chunk-ZOH24ZPF.js";
4
+ } from "./chunk-3BGSDKWD.js";
5
5
  import "./chunk-6QC3YGB6.js";
6
6
  import "./chunk-J26YQVAK.js";
7
7
  import "./chunk-PBHIFAL4.js";
@@ -9,8 +9,8 @@ import "./chunk-5SXMV4SP.js";
9
9
  import "./chunk-PMXRGPRQ.js";
10
10
  import "./chunk-MW5DMGBB.js";
11
11
  import "./chunk-5JGJACDU.js";
12
- import "./chunk-6P4IFIK2.js";
13
- import "./chunk-MRENOFTR.js";
12
+ import "./chunk-CTF6RHKG.js";
13
+ import "./chunk-VUSCJJ4A.js";
14
14
  import "./chunk-IRKUEJVW.js";
15
15
  import "./chunk-ZXMDA7VB.js";
16
16
 
@@ -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: ["feature"]
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);
@@ -1195,10 +1208,33 @@ function searchSymbols(index, query) {
1195
1208
  }
1196
1209
  if (entry.tags?.some((tag) => tag.toLowerCase().includes(lowerQuery))) {
1197
1210
  results.push(entry);
1211
+ continue;
1212
+ }
1213
+ if (entry.componentType?.toLowerCase().includes(lowerQuery)) {
1214
+ results.push(entry);
1215
+ continue;
1198
1216
  }
1199
1217
  }
1200
1218
  return results;
1201
1219
  }
1220
+ function getComponentsByType(index, componentType) {
1221
+ const components = getSymbolsByType(index, "component");
1222
+ return components.filter((c) => c.componentType === componentType);
1223
+ }
1224
+ function getAllComponentTypes(index) {
1225
+ const types = /* @__PURE__ */ new Set();
1226
+ const components = getSymbolsByType(index, "component");
1227
+ for (const comp of components) {
1228
+ if (comp.componentType) {
1229
+ types.add(comp.componentType);
1230
+ }
1231
+ }
1232
+ return Array.from(types).sort();
1233
+ }
1234
+ function getChildComponents(index, parentSymbol) {
1235
+ const components = getSymbolsByType(index, "component");
1236
+ return components.filter((c) => c.parentSymbol === parentSymbol);
1237
+ }
1202
1238
  function getReferencesTo(index, symbol) {
1203
1239
  const entry = getSymbol(index, symbol);
1204
1240
  if (!entry) return [];
@@ -1282,9 +1318,12 @@ export {
1282
1318
  createSnapshot,
1283
1319
  createSymbolIndex,
1284
1320
  createSymbolString,
1321
+ getAllComponentTypes,
1285
1322
  getAllSymbols,
1286
1323
  getAllTags,
1287
1324
  getAutocompleteSuggestions,
1325
+ getChildComponents,
1326
+ getComponentsByType,
1288
1327
  getDefaultPremiseContent,
1289
1328
  getReferencesFrom,
1290
1329
  getReferencesTo,
@@ -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-6P4IFIK2.js";
34
- import "./chunk-MRENOFTR.js";
36
+ } from "./chunk-CTF6RHKG.js";
37
+ import "./chunk-VUSCJJ4A.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,