@a-company/paradigm 2.0.13 → 3.0.1

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 (49) hide show
  1. package/dist/{auto-IU7VN55K.js → auto-6MOGYQ4G.js} +34 -0
  2. package/dist/chunk-27OSFWHG.js +199 -0
  3. package/dist/{chunk-2M6OSOIG.js → chunk-4WR7X3FE.js} +46 -0
  4. package/dist/{chunk-5GOA7WYD.js → chunk-GWM2WRXL.js} +1 -1
  5. package/dist/{chunk-THFVK5AE.js → chunk-QS36NGWV.js} +1 -1
  6. package/dist/{chunk-ELLR7WP6.js → chunk-S65LENNL.js} +4 -4
  7. package/dist/{chunk-YDNKXH4Z.js → chunk-YCLN7WXV.js} +37 -0
  8. package/dist/{chunk-753RICFF.js → chunk-ZPN7MXRA.js} +1 -1
  9. package/dist/{dist-7MPIRMTZ-IOQOREMZ.js → dist-2F7NO4H4-KSL6SJIO.js} +156 -4182
  10. package/dist/{doctor-6Y6L6HEB.js → doctor-JBIV5PMN.js} +2 -2
  11. package/dist/{hooks-MBWE4ILT.js → hooks-7TQIRXXS.js} +1 -1
  12. package/dist/index.js +56 -35
  13. package/dist/list-QMUE7DPK.js +53 -0
  14. package/dist/lore-server-3TAIUZ3Y.js +292 -0
  15. package/dist/mcp.js +856 -114
  16. package/dist/{promote-Z52ZJTJU.js → promote-E6NBZ3BK.js} +1 -0
  17. package/dist/record-5CTCDFUO.js +32 -0
  18. package/dist/review-QEDNQAIO.js +33 -0
  19. package/dist/{sentinel-LCFD56OJ.js → sentinel-RSEXIRXM.js} +1 -1
  20. package/dist/serve-WCIRW244.js +36 -0
  21. package/dist/server-E2CNZC4K.js +288 -0
  22. package/dist/server-NXG5N7JE.js +6135 -0
  23. package/dist/{shift-HKIAP4ZN.js → shift-NABNKPGL.js} +11 -5
  24. package/dist/show-S653P3TO.js +127 -0
  25. package/dist/{summary-H6J6N6PJ.js → summary-5SBFO7QK.js} +1 -1
  26. package/dist/{sync-BEOCW7TZ.js → sync-5KSTPJ4B.js} +2 -2
  27. package/dist/{triage-ETVXXFMV.js → triage-RM5KNG5V.js} +30 -31
  28. package/dist/{university-R2WDQLSI.js → university-65YJZ2LW.js} +10 -2
  29. package/dist/university-content/courses/para-101.json +561 -0
  30. package/dist/university-content/courses/para-201.json +707 -0
  31. package/dist/university-content/courses/para-301.json +654 -0
  32. package/dist/university-content/courses/para-401.json +640 -0
  33. package/dist/university-content/plsat/v2.0.json +760 -0
  34. package/dist/university-content/plsat/v3.0.json +1162 -0
  35. package/dist/university-content/reference.json +336 -0
  36. package/dist/university-ui/assets/index-CoBFthx2.js +87 -0
  37. package/dist/university-ui/assets/index-CoBFthx2.js.map +1 -0
  38. package/dist/university-ui/assets/index-DW2N5NTk.css +1 -0
  39. package/dist/university-ui/index.html +17 -0
  40. package/dist/{upgrade-5B3YGGC6.js → upgrade-TIYFQYPO.js} +1 -1
  41. package/dist/{watch-6IIWPWDN.js → watch-2XEYUH43.js} +1 -1
  42. package/lore-ui/dist/assets/index-DcT8TINz.js +56 -0
  43. package/lore-ui/dist/assets/index-DyJhpQ5w.css +1 -0
  44. package/lore-ui/dist/index.html +13 -0
  45. package/package.json +7 -3
  46. package/dist/chunk-ILOWBJRC.js +0 -12
  47. package/dist/chunk-MQWH7PFI.js +0 -13366
  48. package/dist/server-F5ITNK6T.js +0 -9846
  49. package/dist/server-T6WIFYRQ.js +0 -16076
package/dist/mcp.js CHANGED
@@ -525,15 +525,15 @@ var require_sql_wasm = __commonJS({
525
525
  "undefined" != typeof __filename ? ya = __filename : ba && (ya = self.location.href);
526
526
  var za = "", Aa, Ba;
527
527
  if (ca) {
528
- var fs22 = __require("fs");
528
+ var fs24 = __require("fs");
529
529
  za = __dirname + "/";
530
530
  Ba = (a) => {
531
531
  a = Ca(a) ? new URL(a) : a;
532
- return fs22.readFileSync(a);
532
+ return fs24.readFileSync(a);
533
533
  };
534
534
  Aa = async (a) => {
535
535
  a = Ca(a) ? new URL(a) : a;
536
- return fs22.readFileSync(a, void 0);
536
+ return fs24.readFileSync(a, void 0);
537
537
  };
538
538
  1 < process.argv.length && (wa = process.argv[1].replace(/\\/g, "/"));
539
539
  process.argv.slice(2);
@@ -815,7 +815,7 @@ var require_sql_wasm = __commonJS({
815
815
  if (ca) {
816
816
  var b = Buffer.alloc(256), c = 0, d = process.stdin.fd;
817
817
  try {
818
- c = fs22.readSync(d, b, 0, 256);
818
+ c = fs24.readSync(d, b, 0, 256);
819
819
  } catch (e) {
820
820
  if (e.toString().includes("EOF")) c = 0;
821
821
  else throw e;
@@ -2323,12 +2323,12 @@ function parsePurposeFileDetailed(filePath) {
2323
2323
  const parseResult = PurposeFileSchema.safeParse(data);
2324
2324
  if (!parseResult.success) {
2325
2325
  for (const issue of parseResult.error.issues) {
2326
- const path26 = issue.path.join(".");
2326
+ const path27 = issue.path.join(".");
2327
2327
  const message = issue.message;
2328
- errors.push(`Schema error at ${path26 || "/"}: ${message}`);
2328
+ errors.push(`Schema error at ${path27 || "/"}: ${message}`);
2329
2329
  detailedErrors.push({
2330
2330
  message,
2331
- path: path26 || "/",
2331
+ path: path27 || "/",
2332
2332
  type: "schema"
2333
2333
  });
2334
2334
  }
@@ -2716,19 +2716,19 @@ function validatePurposeFile(data, filePath) {
2716
2716
  };
2717
2717
  }
2718
2718
  function validatePurposeItem(id, item, itemType, prefix, issues) {
2719
- const path26 = `${itemType}s.${id}`;
2719
+ const path27 = `${itemType}s.${id}`;
2720
2720
  if (!/^[a-zA-Z][a-zA-Z0-9-]*$/.test(id)) {
2721
2721
  issues.push({
2722
2722
  type: "warning",
2723
2723
  message: `${prefix}${itemType} ID "${id}" should use alphanumeric characters and hyphens`,
2724
- path: path26
2724
+ path: path27
2725
2725
  });
2726
2726
  }
2727
2727
  if (!item.description || item.description.trim() === "") {
2728
2728
  issues.push({
2729
2729
  type: "warning",
2730
2730
  message: `${prefix}${itemType} "${id}" has no description`,
2731
- path: path26
2731
+ path: path27
2732
2732
  });
2733
2733
  }
2734
2734
  if (item.endpoints) {
@@ -2737,7 +2737,7 @@ function validatePurposeItem(id, item, itemType, prefix, issues) {
2737
2737
  issues.push({
2738
2738
  type: "warning",
2739
2739
  message: `${prefix}Endpoint "${endpoint}" in ${itemType} "${id}" may not be in standard format (e.g., "GET /api/users")`,
2740
- path: `${path26}.endpoints`
2740
+ path: `${path27}.endpoints`
2741
2741
  });
2742
2742
  }
2743
2743
  }
@@ -4278,8 +4278,8 @@ var SessionTracker = class {
4278
4278
  * Extract resource type from URI
4279
4279
  */
4280
4280
  extractResourceType(uri) {
4281
- const path26 = uri.replace("paradigm://", "");
4282
- const firstPart = path26.split("/")[0];
4281
+ const path27 = uri.replace("paradigm://", "");
4282
+ const firstPart = path27.split("/")[0];
4283
4283
  return firstPart || "unknown";
4284
4284
  }
4285
4285
  /**
@@ -4510,6 +4510,10 @@ function getContextToolsList() {
4510
4510
  description: "Context window size in tokens (default: 200000)"
4511
4511
  }
4512
4512
  }
4513
+ },
4514
+ annotations: {
4515
+ readOnlyHint: true,
4516
+ destructiveHint: false
4513
4517
  }
4514
4518
  },
4515
4519
  {
@@ -4548,6 +4552,10 @@ function getContextToolsList() {
4548
4552
  }
4549
4553
  },
4550
4554
  required: ["summary"]
4555
+ },
4556
+ annotations: {
4557
+ readOnlyHint: false,
4558
+ destructiveHint: false
4551
4559
  }
4552
4560
  },
4553
4561
  {
@@ -4556,6 +4564,10 @@ function getContextToolsList() {
4556
4564
  inputSchema: {
4557
4565
  type: "object",
4558
4566
  properties: {}
4567
+ },
4568
+ annotations: {
4569
+ readOnlyHint: true,
4570
+ destructiveHint: false
4559
4571
  }
4560
4572
  },
4561
4573
  {
@@ -4564,6 +4576,52 @@ function getContextToolsList() {
4564
4576
  inputSchema: {
4565
4577
  type: "object",
4566
4578
  properties: {}
4579
+ },
4580
+ annotations: {
4581
+ readOnlyHint: true,
4582
+ destructiveHint: false
4583
+ }
4584
+ },
4585
+ {
4586
+ name: "paradigm_session_checkpoint",
4587
+ description: "Save a cognitive-transition checkpoint for crash recovery. Call when transitioning between phases (planning \u2192 implementing \u2192 validating \u2192 complete).",
4588
+ inputSchema: {
4589
+ type: "object",
4590
+ properties: {
4591
+ phase: {
4592
+ type: "string",
4593
+ enum: ["planning", "implementing", "validating", "complete"],
4594
+ description: "Current workflow phase"
4595
+ },
4596
+ context: {
4597
+ type: "string",
4598
+ description: "What's top-of-mind right now (1-3 sentences)"
4599
+ },
4600
+ plan: {
4601
+ type: "string",
4602
+ description: "Optional: the current plan or approach"
4603
+ },
4604
+ modifiedFiles: {
4605
+ type: "array",
4606
+ items: { type: "string" },
4607
+ description: "Optional: files modified so far"
4608
+ },
4609
+ symbolsTouched: {
4610
+ type: "array",
4611
+ items: { type: "string" },
4612
+ description: "Optional: symbols touched so far"
4613
+ },
4614
+ decisions: {
4615
+ type: "array",
4616
+ items: { type: "string" },
4617
+ description: "Optional: key decisions made so far"
4618
+ }
4619
+ },
4620
+ required: ["phase", "context"]
4621
+ },
4622
+ annotations: {
4623
+ readOnlyHint: false,
4624
+ destructiveHint: false
4567
4625
  }
4568
4626
  },
4569
4627
  {
@@ -6194,6 +6252,10 @@ function getWisdomToolsList() {
6194
6252
  }
6195
6253
  },
6196
6254
  required: ["symbols"]
6255
+ },
6256
+ annotations: {
6257
+ readOnlyHint: true,
6258
+ destructiveHint: false
6197
6259
  }
6198
6260
  },
6199
6261
  {
@@ -6275,6 +6337,33 @@ function getWisdomToolsList() {
6275
6337
  }
6276
6338
  },
6277
6339
  required: ["type", "id", "symbols"]
6340
+ },
6341
+ annotations: {
6342
+ readOnlyHint: false,
6343
+ destructiveHint: false
6344
+ }
6345
+ },
6346
+ {
6347
+ name: "paradigm_wisdom_promote",
6348
+ description: "Promote a project-local antipattern or decision to global scope (~/.paradigm/wisdom/). Makes it available across all projects.",
6349
+ inputSchema: {
6350
+ type: "object",
6351
+ properties: {
6352
+ type: {
6353
+ type: "string",
6354
+ enum: ["antipattern", "decision"],
6355
+ description: "Type of wisdom to promote"
6356
+ },
6357
+ id: {
6358
+ type: "string",
6359
+ description: "ID of the antipattern or decision to promote"
6360
+ }
6361
+ },
6362
+ required: ["type", "id"]
6363
+ },
6364
+ annotations: {
6365
+ readOnlyHint: false,
6366
+ destructiveHint: false
6278
6367
  }
6279
6368
  },
6280
6369
  {
@@ -6311,6 +6400,10 @@ function getWisdomToolsList() {
6311
6400
  description: 'General area to find experts for (e.g., "payments", "auth")'
6312
6401
  }
6313
6402
  }
6403
+ },
6404
+ annotations: {
6405
+ readOnlyHint: true,
6406
+ destructiveHint: false
6314
6407
  }
6315
6408
  }
6316
6409
  ];
@@ -6574,6 +6667,10 @@ function getHistoryToolsList() {
6574
6667
  }
6575
6668
  },
6576
6669
  required: ["symbols"]
6670
+ },
6671
+ annotations: {
6672
+ readOnlyHint: true,
6673
+ destructiveHint: false
6577
6674
  }
6578
6675
  },
6579
6676
  {
@@ -6616,6 +6713,10 @@ function getHistoryToolsList() {
6616
6713
  }
6617
6714
  },
6618
6715
  required: ["type", "symbols", "description"]
6716
+ },
6717
+ annotations: {
6718
+ readOnlyHint: false,
6719
+ destructiveHint: false
6619
6720
  }
6620
6721
  },
6621
6722
  {
@@ -6644,6 +6745,10 @@ function getHistoryToolsList() {
6644
6745
  }
6645
6746
  },
6646
6747
  required: ["result"]
6748
+ },
6749
+ annotations: {
6750
+ readOnlyHint: false,
6751
+ destructiveHint: false
6647
6752
  }
6648
6753
  },
6649
6754
  {
@@ -6659,6 +6764,10 @@ function getHistoryToolsList() {
6659
6764
  }
6660
6765
  },
6661
6766
  required: ["symbols"]
6767
+ },
6768
+ annotations: {
6769
+ readOnlyHint: true,
6770
+ destructiveHint: false
6662
6771
  }
6663
6772
  }
6664
6773
  ];
@@ -6880,7 +6989,7 @@ function navigateExplore(config, target, rootDir) {
6880
6989
  }
6881
6990
  if (result.paths.length === 0) {
6882
6991
  const areaSymbols = Object.entries(config.symbols).filter(
6883
- ([sym, path26]) => sym.toLowerCase().includes(targetLower) || path26.toLowerCase().includes(targetLower)
6992
+ ([sym, path27]) => sym.toLowerCase().includes(targetLower) || path27.toLowerCase().includes(targetLower)
6884
6993
  ).slice(0, 10);
6885
6994
  result.paths = [...new Set(areaSymbols.map(([, p]) => p))];
6886
6995
  result.symbols = areaSymbols.map(([s]) => s);
@@ -7035,6 +7144,10 @@ var navigateTool = {
7035
7144
  }
7036
7145
  },
7037
7146
  required: ["intent"]
7147
+ },
7148
+ annotations: {
7149
+ readOnlyHint: true,
7150
+ destructiveHint: false
7038
7151
  }
7039
7152
  };
7040
7153
  function getNavigateToolsList() {
@@ -7202,7 +7315,7 @@ function generateMinimalNavigator(ctx) {
7202
7315
  };
7203
7316
  }
7204
7317
 
7205
- // ../sentinel/dist/chunk-CL7K7CMH.js
7318
+ // ../sentinel/dist/chunk-WNZBSJR7.js
7206
7319
  var import_sql = __toESM(require_sql_wasm(), 1);
7207
7320
 
7208
7321
  // ../sentinel/node_modules/uuid/dist/esm-node/rng.js
@@ -7252,7 +7365,7 @@ function v4(options, buf, offset) {
7252
7365
  }
7253
7366
  var v4_default = v4;
7254
7367
 
7255
- // ../sentinel/dist/chunk-CL7K7CMH.js
7368
+ // ../sentinel/dist/chunk-WNZBSJR7.js
7256
7369
  import * as path14 from "path";
7257
7370
  import * as fs12 from "fs";
7258
7371
  var SCHEMA_VERSION = 1;
@@ -7272,8 +7385,8 @@ var SentinelStorage = class {
7272
7385
  this.dbPath = dbPath || this.getDefaultDbPath();
7273
7386
  }
7274
7387
  getDefaultDbPath() {
7275
- const paradigmDir = process.env.PARADIGM_DATA_DIR || path14.join(process.cwd(), ".paradigm", "sentinel");
7276
- return path14.join(paradigmDir, "sentinel.db");
7388
+ const dataDir = process.env.SENTINEL_DATA_DIR || process.env.PARADIGM_DATA_DIR || path14.join(process.cwd(), ".paradigm", "sentinel");
7389
+ return path14.join(dataDir, "sentinel.db");
7277
7390
  }
7278
7391
  createSchema() {
7279
7392
  if (!this.db) return;
@@ -8252,8 +8365,8 @@ var SentinelStorage = class {
8252
8365
  };
8253
8366
 
8254
8367
  // ../sentinel/dist/index.js
8255
- import * as path22 from "path";
8256
- import * as fs32 from "fs";
8368
+ import * as path15 from "path";
8369
+ import * as fs13 from "fs";
8257
8370
  import { fileURLToPath } from "url";
8258
8371
  var DEFAULT_CONFIG = {
8259
8372
  minScore: 30,
@@ -8474,6 +8587,27 @@ var PatternMatcher = class {
8474
8587
  return pattern.pattern.environment.includes(incident.environment);
8475
8588
  }
8476
8589
  };
8590
+ var __filename2 = fileURLToPath(import.meta.url);
8591
+ var __dirname2 = path15.dirname(__filename2);
8592
+ function loadUniversalPatterns() {
8593
+ const filePath = path15.join(__dirname2, "universal-patterns.json");
8594
+ const content = fs13.readFileSync(filePath, "utf-8");
8595
+ return JSON.parse(content);
8596
+ }
8597
+ function loadParadigmPatterns() {
8598
+ const filePath = path15.join(__dirname2, "paradigm-patterns.json");
8599
+ const content = fs13.readFileSync(filePath, "utf-8");
8600
+ return JSON.parse(content);
8601
+ }
8602
+ function loadAllSeedPatterns() {
8603
+ const universal = loadUniversalPatterns();
8604
+ const paradigm = loadParadigmPatterns();
8605
+ return {
8606
+ version: "1.0.0",
8607
+ exportedAt: (/* @__PURE__ */ new Date()).toISOString(),
8608
+ patterns: [...universal.patterns, ...paradigm.patterns]
8609
+ };
8610
+ }
8477
8611
  var TimelineBuilder = class {
8478
8612
  /**
8479
8613
  * Build a timeline from an incident with flow position
@@ -9247,27 +9381,6 @@ var PatternSuggester = class {
9247
9381
  return "low";
9248
9382
  }
9249
9383
  };
9250
- var __filename2 = fileURLToPath(import.meta.url);
9251
- var __dirname2 = path22.dirname(__filename2);
9252
- function loadUniversalPatterns() {
9253
- const filePath = path22.join(__dirname2, "universal-patterns.json");
9254
- const content = fs32.readFileSync(filePath, "utf-8");
9255
- return JSON.parse(content);
9256
- }
9257
- function loadParadigmPatterns() {
9258
- const filePath = path22.join(__dirname2, "paradigm-patterns.json");
9259
- const content = fs32.readFileSync(filePath, "utf-8");
9260
- return JSON.parse(content);
9261
- }
9262
- function loadAllSeedPatterns() {
9263
- const universal = loadUniversalPatterns();
9264
- const paradigm = loadParadigmPatterns();
9265
- return {
9266
- version: "1.0.0",
9267
- exportedAt: (/* @__PURE__ */ new Date()).toISOString(),
9268
- patterns: [...universal.patterns, ...paradigm.patterns]
9269
- };
9270
- }
9271
9384
 
9272
9385
  // ../paradigm-mcp/src/tools/sentinel.ts
9273
9386
  var storage = null;
@@ -9322,6 +9435,10 @@ function getSentinelToolsList() {
9322
9435
  description: "Max results (default: 10)"
9323
9436
  }
9324
9437
  }
9438
+ },
9439
+ annotations: {
9440
+ readOnlyHint: true,
9441
+ destructiveHint: false
9325
9442
  }
9326
9443
  },
9327
9444
  {
@@ -9344,6 +9461,10 @@ function getSentinelToolsList() {
9344
9461
  }
9345
9462
  },
9346
9463
  required: ["incidentId"]
9464
+ },
9465
+ annotations: {
9466
+ readOnlyHint: true,
9467
+ destructiveHint: false
9347
9468
  }
9348
9469
  },
9349
9470
  {
@@ -9366,6 +9487,10 @@ function getSentinelToolsList() {
9366
9487
  }
9367
9488
  },
9368
9489
  required: ["incidentId"]
9490
+ },
9491
+ annotations: {
9492
+ readOnlyHint: false,
9493
+ destructiveHint: false
9369
9494
  }
9370
9495
  },
9371
9496
  {
@@ -9388,6 +9513,10 @@ function getSentinelToolsList() {
9388
9513
  description: "Filter by source"
9389
9514
  }
9390
9515
  }
9516
+ },
9517
+ annotations: {
9518
+ readOnlyHint: true,
9519
+ destructiveHint: false
9391
9520
  }
9392
9521
  },
9393
9522
  {
@@ -9445,6 +9574,10 @@ function getSentinelToolsList() {
9445
9574
  }
9446
9575
  },
9447
9576
  required: ["id", "name", "pattern", "resolution"]
9577
+ },
9578
+ annotations: {
9579
+ readOnlyHint: false,
9580
+ destructiveHint: false
9448
9581
  }
9449
9582
  },
9450
9583
  {
@@ -9490,6 +9623,10 @@ function getSentinelToolsList() {
9490
9623
  }
9491
9624
  },
9492
9625
  required: ["error", "symbols", "environment"]
9626
+ },
9627
+ annotations: {
9628
+ readOnlyHint: false,
9629
+ destructiveHint: false
9493
9630
  }
9494
9631
  },
9495
9632
  {
@@ -9507,6 +9644,10 @@ function getSentinelToolsList() {
9507
9644
  description: "Get health for specific symbol"
9508
9645
  }
9509
9646
  }
9647
+ },
9648
+ annotations: {
9649
+ readOnlyHint: true,
9650
+ destructiveHint: false
9510
9651
  }
9511
9652
  },
9512
9653
  {
@@ -9524,6 +9665,10 @@ function getSentinelToolsList() {
9524
9665
  description: "Min similar incidents for suggestion"
9525
9666
  }
9526
9667
  }
9668
+ },
9669
+ annotations: {
9670
+ readOnlyHint: true,
9671
+ destructiveHint: false
9527
9672
  }
9528
9673
  }
9529
9674
  ];
@@ -9853,17 +9998,17 @@ async function handleSentinelTool(name, args, ctx) {
9853
9998
  }
9854
9999
 
9855
10000
  // ../paradigm-mcp/src/tools/flows.ts
9856
- import * as fs14 from "fs";
9857
- import * as path16 from "path";
10001
+ import * as fs15 from "fs";
10002
+ import * as path17 from "path";
9858
10003
  import * as yaml8 from "js-yaml";
9859
10004
 
9860
10005
  // ../paradigm-mcp/src/utils/flow-loader.ts
9861
- import * as fs13 from "fs";
9862
- import * as path15 from "path";
10006
+ import * as fs14 from "fs";
10007
+ import * as path16 from "path";
9863
10008
  var FLOW_CACHE_TTL_MS = 30 * 1e3;
9864
10009
  var flowCache = /* @__PURE__ */ new Map();
9865
10010
  async function loadFlowIndex(rootDir) {
9866
- const absoluteRoot = path15.resolve(rootDir);
10011
+ const absoluteRoot = path16.resolve(rootDir);
9867
10012
  const cached = flowCache.get(absoluteRoot);
9868
10013
  if (cached && Date.now() - cached.loadedAt < FLOW_CACHE_TTL_MS) {
9869
10014
  return cached.index;
@@ -9878,12 +10023,12 @@ async function loadFlowIndex(rootDir) {
9878
10023
  return index;
9879
10024
  }
9880
10025
  async function loadFlowIndexFresh(rootDir) {
9881
- const flowIndexPath = path15.join(rootDir, ".paradigm", "flow-index.json");
9882
- if (!fs13.existsSync(flowIndexPath)) {
10026
+ const flowIndexPath = path16.join(rootDir, ".paradigm", "flow-index.json");
10027
+ if (!fs14.existsSync(flowIndexPath)) {
9883
10028
  return null;
9884
10029
  }
9885
10030
  try {
9886
- const content = fs13.readFileSync(flowIndexPath, "utf8");
10031
+ const content = fs14.readFileSync(flowIndexPath, "utf8");
9887
10032
  return JSON.parse(content);
9888
10033
  } catch (error) {
9889
10034
  console.error("[flow-loader] Error parsing flow-index.json:", error);
@@ -9964,6 +10109,10 @@ function getFlowsToolsList() {
9964
10109
  }
9965
10110
  },
9966
10111
  required: ["symbol"]
10112
+ },
10113
+ annotations: {
10114
+ readOnlyHint: true,
10115
+ destructiveHint: false
9967
10116
  }
9968
10117
  },
9969
10118
  {
@@ -9981,6 +10130,10 @@ function getFlowsToolsList() {
9981
10130
  description: "Deep check: verify actions and signals exist in codebase (default: false)"
9982
10131
  }
9983
10132
  }
10133
+ },
10134
+ annotations: {
10135
+ readOnlyHint: true,
10136
+ destructiveHint: false
9984
10137
  }
9985
10138
  }
9986
10139
  ];
@@ -10047,11 +10200,11 @@ flows:
10047
10200
  }
10048
10201
  case "paradigm_flow_validate": {
10049
10202
  const { flowId, checkImplementation = false } = args;
10050
- const flowsPath = path16.join(ctx.rootDir, ".paradigm", "flows.yaml");
10203
+ const flowsPath = path17.join(ctx.rootDir, ".paradigm", "flows.yaml");
10051
10204
  let flowsConfig = null;
10052
- if (fs14.existsSync(flowsPath)) {
10205
+ if (fs15.existsSync(flowsPath)) {
10053
10206
  try {
10054
- const content = fs14.readFileSync(flowsPath, "utf-8");
10207
+ const content = fs15.readFileSync(flowsPath, "utf-8");
10055
10208
  flowsConfig = yaml8.load(content);
10056
10209
  } catch (e) {
10057
10210
  const text2 = JSON.stringify({
@@ -10087,11 +10240,11 @@ flows:
10087
10240
  }, null, 2);
10088
10241
  return { handled: true, text: text2 };
10089
10242
  }
10090
- const portalPath = path16.join(ctx.rootDir, "portal.yaml");
10243
+ const portalPath = path17.join(ctx.rootDir, "portal.yaml");
10091
10244
  let declaredGates = [];
10092
- if (fs14.existsSync(portalPath)) {
10245
+ if (fs15.existsSync(portalPath)) {
10093
10246
  try {
10094
- const portalContent = fs14.readFileSync(portalPath, "utf-8");
10247
+ const portalContent = fs15.readFileSync(portalPath, "utf-8");
10095
10248
  const portalConfig = yaml8.load(portalContent);
10096
10249
  if (portalConfig?.gates) {
10097
10250
  declaredGates = Object.keys(portalConfig.gates).map(
@@ -10194,13 +10347,13 @@ function parseSymbolSimple(symbol) {
10194
10347
  }
10195
10348
 
10196
10349
  // ../paradigm-mcp/src/utils/fixtures-loader.ts
10197
- import * as fs15 from "fs";
10198
- import * as path17 from "path";
10350
+ import * as fs16 from "fs";
10351
+ import * as path18 from "path";
10199
10352
  import * as yaml9 from "js-yaml";
10200
10353
  var FIXTURES_CACHE_TTL_MS = 60 * 1e3;
10201
10354
  var fixturesCache = /* @__PURE__ */ new Map();
10202
10355
  async function loadFixtures(rootDir) {
10203
- const absoluteRoot = path17.resolve(rootDir);
10356
+ const absoluteRoot = path18.resolve(rootDir);
10204
10357
  const cached = fixturesCache.get(absoluteRoot);
10205
10358
  if (cached && Date.now() - cached.loadedAt < FIXTURES_CACHE_TTL_MS) {
10206
10359
  return cached.fixtures;
@@ -10215,12 +10368,12 @@ async function loadFixtures(rootDir) {
10215
10368
  return fixtures;
10216
10369
  }
10217
10370
  async function loadFixturesFresh(rootDir) {
10218
- const fixturesPath = path17.join(rootDir, ".paradigm", "fixtures.yaml");
10219
- if (!fs15.existsSync(fixturesPath)) {
10371
+ const fixturesPath = path18.join(rootDir, ".paradigm", "fixtures.yaml");
10372
+ if (!fs16.existsSync(fixturesPath)) {
10220
10373
  return null;
10221
10374
  }
10222
10375
  try {
10223
- const content = fs15.readFileSync(fixturesPath, "utf8");
10376
+ const content = fs16.readFileSync(fixturesPath, "utf8");
10224
10377
  return yaml9.load(content);
10225
10378
  } catch (error) {
10226
10379
  console.error("[fixtures-loader] Error parsing fixtures.yaml:", error);
@@ -10276,6 +10429,10 @@ function getFixturesToolsList() {
10276
10429
  description: 'Specific fixture name within the category (e.g., "admin", "createTask")'
10277
10430
  }
10278
10431
  }
10432
+ },
10433
+ annotations: {
10434
+ readOnlyHint: true,
10435
+ destructiveHint: false
10279
10436
  }
10280
10437
  }
10281
10438
  ];
@@ -10367,8 +10524,8 @@ payloads:
10367
10524
  }
10368
10525
 
10369
10526
  // ../paradigm-mcp/src/tools/orchestration.ts
10370
- import * as fs16 from "fs";
10371
- import * as path18 from "path";
10527
+ import * as fs17 from "fs";
10528
+ import * as path19 from "path";
10372
10529
  import * as yaml10 from "js-yaml";
10373
10530
  var SYMBOL_PATTERN = /[@#$%^!?&~][a-zA-Z0-9_-]+/g;
10374
10531
  var DEFAULT_MODELS = {
@@ -10584,6 +10741,10 @@ Examples:
10584
10741
  }
10585
10742
  },
10586
10743
  required: ["task"]
10744
+ },
10745
+ annotations: {
10746
+ readOnlyHint: true,
10747
+ destructiveHint: false
10587
10748
  }
10588
10749
  },
10589
10750
  {
@@ -10611,6 +10772,10 @@ Examples:
10611
10772
  }
10612
10773
  },
10613
10774
  required: ["agent", "task"]
10775
+ },
10776
+ annotations: {
10777
+ readOnlyHint: true,
10778
+ destructiveHint: false
10614
10779
  }
10615
10780
  }
10616
10781
  ];
@@ -11217,23 +11382,23 @@ function suggestAgentsForTask(task, agents) {
11217
11382
  return suggestions.sort((a, b) => scoreMap[b.confidence] - scoreMap[a.confidence]);
11218
11383
  }
11219
11384
  function loadAgentsManifest(rootDir) {
11220
- const manifestPath = path18.join(rootDir, ".paradigm", "agents.yaml");
11221
- if (!fs16.existsSync(manifestPath)) {
11385
+ const manifestPath = path19.join(rootDir, ".paradigm", "agents.yaml");
11386
+ if (!fs17.existsSync(manifestPath)) {
11222
11387
  return null;
11223
11388
  }
11224
11389
  try {
11225
- const content = fs16.readFileSync(manifestPath, "utf-8");
11390
+ const content = fs17.readFileSync(manifestPath, "utf-8");
11226
11391
  return yaml10.load(content);
11227
11392
  } catch {
11228
11393
  return null;
11229
11394
  }
11230
11395
  }
11231
11396
  function logOrchestration(rootDir, orchestrationId, task, plan) {
11232
- const orchestrationsDir = path18.join(rootDir, ".paradigm", "orchestrations");
11233
- if (!fs16.existsSync(orchestrationsDir)) {
11234
- fs16.mkdirSync(orchestrationsDir, { recursive: true });
11397
+ const orchestrationsDir = path19.join(rootDir, ".paradigm", "orchestrations");
11398
+ if (!fs17.existsSync(orchestrationsDir)) {
11399
+ fs17.mkdirSync(orchestrationsDir, { recursive: true });
11235
11400
  }
11236
- const logPath = path18.join(orchestrationsDir, `${orchestrationId}.yaml`);
11401
+ const logPath = path19.join(orchestrationsDir, `${orchestrationId}.yaml`);
11237
11402
  const logContent = {
11238
11403
  id: orchestrationId,
11239
11404
  task,
@@ -11246,31 +11411,31 @@ function logOrchestration(rootDir, orchestrationId, task, plan) {
11246
11411
  stages: plan.stages
11247
11412
  };
11248
11413
  try {
11249
- fs16.writeFileSync(logPath, yaml10.dump(logContent));
11414
+ fs17.writeFileSync(logPath, yaml10.dump(logContent));
11250
11415
  } catch {
11251
11416
  }
11252
11417
  }
11253
11418
 
11254
11419
  // ../paradigm-mcp/src/tools/tags.ts
11255
- import * as fs17 from "fs";
11256
- import * as path19 from "path";
11420
+ import * as fs18 from "fs";
11421
+ import * as path20 from "path";
11257
11422
  import * as yaml11 from "js-yaml";
11258
11423
  function loadTagBank(rootDir) {
11259
- const tagPath = path19.join(rootDir, ".paradigm", "tags.yaml");
11260
- if (!fs17.existsSync(tagPath)) {
11424
+ const tagPath = path20.join(rootDir, ".paradigm", "tags.yaml");
11425
+ if (!fs18.existsSync(tagPath)) {
11261
11426
  return null;
11262
11427
  }
11263
11428
  try {
11264
- const content = fs17.readFileSync(tagPath, "utf-8");
11429
+ const content = fs18.readFileSync(tagPath, "utf-8");
11265
11430
  return yaml11.load(content);
11266
11431
  } catch {
11267
11432
  return null;
11268
11433
  }
11269
11434
  }
11270
11435
  function saveTagBank(rootDir, tagBank) {
11271
- const tagPath = path19.join(rootDir, ".paradigm", "tags.yaml");
11436
+ const tagPath = path20.join(rootDir, ".paradigm", "tags.yaml");
11272
11437
  const content = yaml11.dump(tagBank, { lineWidth: -1 });
11273
- fs17.writeFileSync(tagPath, content, "utf-8");
11438
+ fs18.writeFileSync(tagPath, content, "utf-8");
11274
11439
  }
11275
11440
  function getTagsToolsList() {
11276
11441
  return [
@@ -11300,6 +11465,10 @@ function getTagsToolsList() {
11300
11465
  }
11301
11466
  },
11302
11467
  required: ["action"]
11468
+ },
11469
+ annotations: {
11470
+ readOnlyHint: true,
11471
+ destructiveHint: false
11303
11472
  }
11304
11473
  },
11305
11474
  {
@@ -11332,6 +11501,10 @@ function getTagsToolsList() {
11332
11501
  }
11333
11502
  },
11334
11503
  required: ["tag", "description", "reason"]
11504
+ },
11505
+ annotations: {
11506
+ readOnlyHint: false,
11507
+ destructiveHint: false
11335
11508
  }
11336
11509
  },
11337
11510
  {
@@ -11346,6 +11519,10 @@ function getTagsToolsList() {
11346
11519
  }
11347
11520
  },
11348
11521
  required: ["aspect"]
11522
+ },
11523
+ annotations: {
11524
+ readOnlyHint: true,
11525
+ destructiveHint: false
11349
11526
  }
11350
11527
  }
11351
11528
  ];
@@ -11585,12 +11762,12 @@ async function handleTagsTool(name, args, ctx) {
11585
11762
  const anchors = entry.anchors || [];
11586
11763
  const anchorResults = [];
11587
11764
  for (const anchor of anchors) {
11588
- const filePath = path19.isAbsolute(anchor.path) ? anchor.path : path19.join(ctx.rootDir, anchor.path);
11589
- const exists = fs17.existsSync(filePath);
11765
+ const filePath = path20.isAbsolute(anchor.path) ? anchor.path : path20.join(ctx.rootDir, anchor.path);
11766
+ const exists = fs18.existsSync(filePath);
11590
11767
  let lineCount;
11591
11768
  if (exists) {
11592
11769
  try {
11593
- const content = fs17.readFileSync(filePath, "utf-8");
11770
+ const content = fs18.readFileSync(filePath, "utf-8");
11594
11771
  const lines = content.split("\n");
11595
11772
  if (typeof anchor.lines === "number") {
11596
11773
  lineCount = 1;
@@ -11660,8 +11837,8 @@ async function handleTagsTool(name, args, ctx) {
11660
11837
  }
11661
11838
 
11662
11839
  // ../paradigm-mcp/src/utils/purpose-writer.ts
11663
- import * as fs18 from "fs";
11664
- import * as path20 from "path";
11840
+ import * as fs19 from "fs";
11841
+ import * as path21 from "path";
11665
11842
  var SYMBOL_PREFIXES = ["#", "$", "^", "!", "~"];
11666
11843
  function stripSymbolPrefix(name) {
11667
11844
  if (name.length > 1 && SYMBOL_PREFIXES.includes(name[0])) {
@@ -11674,14 +11851,14 @@ function ensurePrefix(name, prefix) {
11674
11851
  return `${prefix}${stripped}`;
11675
11852
  }
11676
11853
  function resolvePurposeFilePath(fileOrDir, rootDir) {
11677
- const resolved = path20.isAbsolute(fileOrDir) ? fileOrDir : path20.resolve(rootDir, fileOrDir);
11854
+ const resolved = path21.isAbsolute(fileOrDir) ? fileOrDir : path21.resolve(rootDir, fileOrDir);
11678
11855
  if (resolved.endsWith(".purpose")) {
11679
11856
  return resolved;
11680
11857
  }
11681
- return path20.join(resolved, ".purpose");
11858
+ return path21.join(resolved, ".purpose");
11682
11859
  }
11683
11860
  function readPurposeFile(filePath) {
11684
- if (!fs18.existsSync(filePath)) {
11861
+ if (!fs19.existsSync(filePath)) {
11685
11862
  return {};
11686
11863
  }
11687
11864
  const result = parsePurposeFileDetailed(filePath);
@@ -11691,12 +11868,12 @@ function readPurposeFile(filePath) {
11691
11868
  return result.data;
11692
11869
  }
11693
11870
  function writePurposeFile(filePath, data) {
11694
- const dir = path20.dirname(filePath);
11695
- if (!fs18.existsSync(dir)) {
11696
- fs18.mkdirSync(dir, { recursive: true });
11871
+ const dir = path21.dirname(filePath);
11872
+ if (!fs19.existsSync(dir)) {
11873
+ fs19.mkdirSync(dir, { recursive: true });
11697
11874
  }
11698
11875
  const content = serializePurposeFile(data);
11699
- fs18.writeFileSync(filePath, content, "utf8");
11876
+ fs19.writeFileSync(filePath, content, "utf8");
11700
11877
  }
11701
11878
  function normalizeToRecord(items) {
11702
11879
  if (!items) return {};
@@ -11885,18 +12062,18 @@ function renameInRefArrays(item, oldRef, newRef) {
11885
12062
  }
11886
12063
 
11887
12064
  // ../paradigm-mcp/src/utils/portal-writer.ts
11888
- import * as fs19 from "fs";
11889
- import * as path21 from "path";
12065
+ import * as fs20 from "fs";
12066
+ import * as path22 from "path";
11890
12067
  import * as yaml12 from "js-yaml";
11891
12068
  function readPortalFile(rootDir) {
11892
- const filePath = path21.join(rootDir, "portal.yaml");
11893
- if (!fs19.existsSync(filePath)) {
12069
+ const filePath = path22.join(rootDir, "portal.yaml");
12070
+ if (!fs20.existsSync(filePath)) {
11894
12071
  return {
11895
12072
  data: { version: "1.0.0", gates: {} },
11896
12073
  filePath
11897
12074
  };
11898
12075
  }
11899
- const content = fs19.readFileSync(filePath, "utf8");
12076
+ const content = fs20.readFileSync(filePath, "utf8");
11900
12077
  const data = yaml12.load(content);
11901
12078
  return {
11902
12079
  data: data || { version: "1.0.0", gates: {} },
@@ -11910,7 +12087,7 @@ function writePortalFile(filePath, data) {
11910
12087
  noRefs: true,
11911
12088
  sortKeys: false
11912
12089
  });
11913
- fs19.writeFileSync(filePath, content, "utf8");
12090
+ fs20.writeFileSync(filePath, content, "utf8");
11914
12091
  }
11915
12092
  function addGateToPortal(rootDir, params) {
11916
12093
  const { data, filePath } = readPortalFile(rootDir);
@@ -11979,6 +12156,10 @@ var purposeInitTool = {
11979
12156
  }
11980
12157
  },
11981
12158
  required: ["purposeFile", "name"]
12159
+ },
12160
+ annotations: {
12161
+ readOnlyHint: false,
12162
+ destructiveHint: false
11982
12163
  }
11983
12164
  };
11984
12165
  var purposeAddComponentTool = {
@@ -12049,6 +12230,10 @@ var purposeAddComponentTool = {
12049
12230
  }
12050
12231
  },
12051
12232
  required: ["purposeFile", "id", "description"]
12233
+ },
12234
+ annotations: {
12235
+ readOnlyHint: false,
12236
+ destructiveHint: false
12052
12237
  }
12053
12238
  };
12054
12239
  var purposeAddAspectTool = {
@@ -12090,6 +12275,10 @@ var purposeAddAspectTool = {
12090
12275
  }
12091
12276
  },
12092
12277
  required: ["purposeFile", "id", "description", "anchors"]
12278
+ },
12279
+ annotations: {
12280
+ readOnlyHint: false,
12281
+ destructiveHint: false
12093
12282
  }
12094
12283
  };
12095
12284
  var purposeAddSignalTool = {
@@ -12135,6 +12324,10 @@ var purposeAddSignalTool = {
12135
12324
  }
12136
12325
  },
12137
12326
  required: ["purposeFile", "id", "description"]
12327
+ },
12328
+ annotations: {
12329
+ readOnlyHint: false,
12330
+ destructiveHint: false
12138
12331
  }
12139
12332
  };
12140
12333
  var purposeAddFlowTool = {
@@ -12185,6 +12378,10 @@ var purposeAddFlowTool = {
12185
12378
  }
12186
12379
  },
12187
12380
  required: ["purposeFile", "id", "description"]
12381
+ },
12382
+ annotations: {
12383
+ readOnlyHint: false,
12384
+ destructiveHint: false
12188
12385
  }
12189
12386
  };
12190
12387
  var purposeAddGateTool = {
@@ -12222,6 +12419,10 @@ var purposeAddGateTool = {
12222
12419
  }
12223
12420
  },
12224
12421
  required: ["purposeFile", "id", "description"]
12422
+ },
12423
+ annotations: {
12424
+ readOnlyHint: false,
12425
+ destructiveHint: false
12225
12426
  }
12226
12427
  };
12227
12428
  var purposeAddStateTool = {
@@ -12255,6 +12456,10 @@ var purposeAddStateTool = {
12255
12456
  }
12256
12457
  },
12257
12458
  required: ["purposeFile", "id", "description"]
12459
+ },
12460
+ annotations: {
12461
+ readOnlyHint: false,
12462
+ destructiveHint: false
12258
12463
  }
12259
12464
  };
12260
12465
  var purposeLinkTool = {
@@ -12303,6 +12508,10 @@ var purposeLinkTool = {
12303
12508
  }
12304
12509
  },
12305
12510
  required: ["purposeFile", "componentId"]
12511
+ },
12512
+ annotations: {
12513
+ readOnlyHint: false,
12514
+ destructiveHint: false
12306
12515
  }
12307
12516
  };
12308
12517
  var purposeRemoveTool = {
@@ -12326,6 +12535,10 @@ var purposeRemoveTool = {
12326
12535
  }
12327
12536
  },
12328
12537
  required: ["purposeFile", "section", "id"]
12538
+ },
12539
+ annotations: {
12540
+ readOnlyHint: false,
12541
+ destructiveHint: true
12329
12542
  }
12330
12543
  };
12331
12544
  var purposeRenameTool = {
@@ -12349,6 +12562,10 @@ var purposeRenameTool = {
12349
12562
  }
12350
12563
  },
12351
12564
  required: ["oldId", "newId", "symbolType"]
12565
+ },
12566
+ annotations: {
12567
+ readOnlyHint: false,
12568
+ destructiveHint: false
12352
12569
  }
12353
12570
  };
12354
12571
  var portalAddGateTool = {
@@ -12406,6 +12623,10 @@ var portalAddGateTool = {
12406
12623
  }
12407
12624
  },
12408
12625
  required: ["id", "description"]
12626
+ },
12627
+ annotations: {
12628
+ readOnlyHint: false,
12629
+ destructiveHint: false
12409
12630
  }
12410
12631
  };
12411
12632
  var portalAddRouteTool = {
@@ -12430,6 +12651,10 @@ var portalAddRouteTool = {
12430
12651
  }
12431
12652
  },
12432
12653
  required: ["route", "method", "gates"]
12654
+ },
12655
+ annotations: {
12656
+ readOnlyHint: false,
12657
+ destructiveHint: false
12433
12658
  }
12434
12659
  };
12435
12660
  var purposeValidateTool = {
@@ -12447,6 +12672,10 @@ var purposeValidateTool = {
12447
12672
  description: "Also validate portal.yaml (default: true)"
12448
12673
  }
12449
12674
  }
12675
+ },
12676
+ annotations: {
12677
+ readOnlyHint: true,
12678
+ destructiveHint: false
12450
12679
  }
12451
12680
  };
12452
12681
  function getPurposePortalToolsList() {
@@ -12978,7 +13207,7 @@ async function handleValidate(args, ctx) {
12978
13207
  }
12979
13208
 
12980
13209
  // ../paradigm-mcp/src/tools/pm.ts
12981
- import * as fs20 from "fs";
13210
+ import * as fs21 from "fs";
12982
13211
  import * as path23 from "path";
12983
13212
  var SYMBOL_PATTERN2 = /[@#$%^!?&~][a-zA-Z][a-zA-Z0-9_-]*/g;
12984
13213
  var ROUTE_KEYWORDS = [
@@ -13015,6 +13244,10 @@ function getPmToolsList() {
13015
13244
  }
13016
13245
  },
13017
13246
  required: ["task"]
13247
+ },
13248
+ annotations: {
13249
+ readOnlyHint: true,
13250
+ destructiveHint: false
13018
13251
  }
13019
13252
  },
13020
13253
  {
@@ -13035,6 +13268,10 @@ function getPmToolsList() {
13035
13268
  }
13036
13269
  },
13037
13270
  required: ["filesModified", "symbolsTouched"]
13271
+ },
13272
+ annotations: {
13273
+ readOnlyHint: true,
13274
+ destructiveHint: false
13038
13275
  }
13039
13276
  }
13040
13277
  ];
@@ -13158,10 +13395,10 @@ function runPostflightCheck(filesModified, symbolsTouched, ctx) {
13158
13395
  const declaredRoutes = ctx.gateConfig?.routes ? Object.keys(ctx.gateConfig.routes) : [];
13159
13396
  for (const file of filesModified) {
13160
13397
  const absPath = path23.isAbsolute(file) ? file : path23.join(ctx.rootDir, file);
13161
- if (!fs20.existsSync(absPath)) continue;
13398
+ if (!fs21.existsSync(absPath)) continue;
13162
13399
  let content;
13163
13400
  try {
13164
- content = fs20.readFileSync(absPath, "utf-8");
13401
+ content = fs21.readFileSync(absPath, "utf-8");
13165
13402
  } catch {
13166
13403
  continue;
13167
13404
  }
@@ -13247,7 +13484,7 @@ function runPostflightCheck(filesModified, symbolsTouched, ctx) {
13247
13484
  } else {
13248
13485
  for (const anchor of anchors) {
13249
13486
  const filePath = path23.isAbsolute(anchor.path) ? anchor.path : path23.join(ctx.rootDir, anchor.path);
13250
- if (!fs20.existsSync(filePath)) {
13487
+ if (!fs21.existsSync(filePath)) {
13251
13488
  violations.push({
13252
13489
  type: "stale-aspect",
13253
13490
  severity: "warning",
@@ -13300,7 +13537,7 @@ function runPostflightCheck(filesModified, symbolsTouched, ctx) {
13300
13537
  }
13301
13538
 
13302
13539
  // ../paradigm-mcp/src/tools/reindex.ts
13303
- import * as fs21 from "fs";
13540
+ import * as fs22 from "fs";
13304
13541
  import * as path24 from "path";
13305
13542
  import * as yaml13 from "js-yaml";
13306
13543
 
@@ -13608,6 +13845,10 @@ function getReindexToolsList() {
13608
13845
  inputSchema: {
13609
13846
  type: "object",
13610
13847
  properties: {}
13848
+ },
13849
+ annotations: {
13850
+ readOnlyHint: false,
13851
+ destructiveHint: true
13611
13852
  }
13612
13853
  }
13613
13854
  ];
@@ -13638,8 +13879,8 @@ async function rebuildStaticFiles(rootDir, ctx) {
13638
13879
  }
13639
13880
  const projectName = ctx?.projectName || path24.basename(rootDir);
13640
13881
  const paradigmDir = path24.join(rootDir, ".paradigm");
13641
- if (!fs21.existsSync(paradigmDir)) {
13642
- fs21.mkdirSync(paradigmDir, { recursive: true });
13882
+ if (!fs22.existsSync(paradigmDir)) {
13883
+ fs22.mkdirSync(paradigmDir, { recursive: true });
13643
13884
  }
13644
13885
  const scanIndex = generateScanIndex(
13645
13886
  {
@@ -13650,11 +13891,11 @@ async function rebuildStaticFiles(rootDir, ctx) {
13650
13891
  { projectName }
13651
13892
  );
13652
13893
  const scanIndexPath = path24.join(paradigmDir, "scan-index.json");
13653
- fs21.writeFileSync(scanIndexPath, serializeScanIndex(scanIndex), "utf8");
13894
+ fs22.writeFileSync(scanIndexPath, serializeScanIndex(scanIndex), "utf8");
13654
13895
  filesWritten.push(".paradigm/scan-index.json");
13655
13896
  const navigatorData = buildNavigatorData(rootDir, aggregation);
13656
13897
  const navigatorPath = path24.join(paradigmDir, "navigator.yaml");
13657
- fs21.writeFileSync(
13898
+ fs22.writeFileSync(
13658
13899
  navigatorPath,
13659
13900
  yaml13.dump(navigatorData, { indent: 2, lineWidth: 120, noRefs: true, sortKeys: false }),
13660
13901
  "utf8"
@@ -13664,7 +13905,7 @@ async function rebuildStaticFiles(rootDir, ctx) {
13664
13905
  let flowCount = 0;
13665
13906
  if (flowIndex && Object.keys(flowIndex.flows).length > 0) {
13666
13907
  const flowIndexPath = path24.join(paradigmDir, "flow-index.json");
13667
- fs21.writeFileSync(flowIndexPath, JSON.stringify(flowIndex, null, 2), "utf8");
13908
+ fs22.writeFileSync(flowIndexPath, JSON.stringify(flowIndex, null, 2), "utf8");
13668
13909
  filesWritten.push(".paradigm/flow-index.json");
13669
13910
  flowCount = Object.keys(flowIndex.flows).length;
13670
13911
  }
@@ -13693,7 +13934,7 @@ function buildNavigatorData(rootDir, aggregation) {
13693
13934
  function buildStructure(rootDir) {
13694
13935
  const structure = {};
13695
13936
  for (const [category, patterns] of Object.entries(DIRECTORY_PATTERNS)) {
13696
- const existingPaths = patterns.filter((p) => fs21.existsSync(path24.join(rootDir, p)));
13937
+ const existingPaths = patterns.filter((p) => fs22.existsSync(path24.join(rootDir, p)));
13697
13938
  if (existingPaths.length > 0) {
13698
13939
  const symbolInfo = Object.values(SYMBOL_CATEGORIES).find((s) => s.category === category);
13699
13940
  structure[category] = { paths: existingPaths, symbol: symbolInfo?.prefix || "@" };
@@ -13704,7 +13945,7 @@ function buildStructure(rootDir) {
13704
13945
  function buildKeyFiles(rootDir) {
13705
13946
  const keyFiles = {};
13706
13947
  for (const [category, patterns] of Object.entries(KEY_FILE_PATTERNS)) {
13707
- const existingPaths = patterns.filter((p) => fs21.existsSync(path24.join(rootDir, p)));
13948
+ const existingPaths = patterns.filter((p) => fs22.existsSync(path24.join(rootDir, p)));
13708
13949
  if (existingPaths.length > 0) {
13709
13950
  keyFiles[category] = existingPaths;
13710
13951
  }
@@ -13721,9 +13962,9 @@ function buildSkipPatterns(rootDir) {
13721
13962
  unless_docs: [...DEFAULT_SKIP_PATTERNS.unless_docs]
13722
13963
  };
13723
13964
  const gitignorePath = path24.join(rootDir, ".gitignore");
13724
- if (fs21.existsSync(gitignorePath)) {
13965
+ if (fs22.existsSync(gitignorePath)) {
13725
13966
  try {
13726
- const content = fs21.readFileSync(gitignorePath, "utf8");
13967
+ const content = fs22.readFileSync(gitignorePath, "utf8");
13727
13968
  const gitignorePatterns = content.split("\n").map((line) => line.trim()).filter((line) => line && !line.startsWith("#")).filter(
13728
13969
  (line) => line.endsWith("/") || line.includes("*") || ["node_modules", "dist", "build", ".cache"].some((p) => line.includes(p))
13729
13970
  ).slice(0, 20);
@@ -13787,7 +14028,7 @@ function generateFlowIndex(rootDir, purposeFiles) {
13787
14028
  const symbolToFlows = {};
13788
14029
  for (const filePath of purposeFiles) {
13789
14030
  try {
13790
- const content = fs21.readFileSync(filePath, "utf8");
14031
+ const content = fs22.readFileSync(filePath, "utf8");
13791
14032
  const data = yaml13.load(content);
13792
14033
  if (!data?.flows) continue;
13793
14034
  if (Array.isArray(data.flows)) {
@@ -13869,8 +14110,478 @@ function indexFlowSymbols(flowId, steps, symbolToFlows) {
13869
14110
  }
13870
14111
  }
13871
14112
 
13872
- // ../paradigm-mcp/src/tools/fallback-grep.ts
14113
+ // ../paradigm-mcp/src/utils/lore-loader.ts
14114
+ import * as fs23 from "fs";
13873
14115
  import * as path25 from "path";
14116
+ import * as yaml14 from "js-yaml";
14117
+ var LORE_DIR = ".paradigm/lore";
14118
+ var ENTRIES_DIR = "entries";
14119
+ var TIMELINE_FILE = "timeline.yaml";
14120
+ async function loadLoreEntries(rootDir, filter) {
14121
+ const entriesPath = path25.join(rootDir, LORE_DIR, ENTRIES_DIR);
14122
+ if (!fs23.existsSync(entriesPath)) {
14123
+ return [];
14124
+ }
14125
+ const entries = [];
14126
+ const dateDirs = fs23.readdirSync(entriesPath).filter((d) => /^\d{4}-\d{2}-\d{2}$/.test(d)).sort().reverse();
14127
+ for (const dateDir of dateDirs) {
14128
+ if (filter?.dateFrom && dateDir < filter.dateFrom.slice(0, 10)) continue;
14129
+ if (filter?.dateTo && dateDir > filter.dateTo.slice(0, 10)) continue;
14130
+ const dirPath = path25.join(entriesPath, dateDir);
14131
+ const files = fs23.readdirSync(dirPath).filter((f) => f.endsWith(".yaml")).sort();
14132
+ for (const file of files) {
14133
+ try {
14134
+ const content = fs23.readFileSync(path25.join(dirPath, file), "utf8");
14135
+ const entry = yaml14.load(content);
14136
+ entries.push(entry);
14137
+ } catch {
14138
+ }
14139
+ }
14140
+ }
14141
+ return filter ? applyFilter(entries, filter) : entries;
14142
+ }
14143
+ async function loadLoreTimeline(rootDir) {
14144
+ const timelinePath = path25.join(rootDir, LORE_DIR, TIMELINE_FILE);
14145
+ if (!fs23.existsSync(timelinePath)) {
14146
+ return null;
14147
+ }
14148
+ try {
14149
+ const content = fs23.readFileSync(timelinePath, "utf8");
14150
+ return yaml14.load(content);
14151
+ } catch {
14152
+ return null;
14153
+ }
14154
+ }
14155
+ async function recordLoreEntry(rootDir, entry) {
14156
+ const lorePath = path25.join(rootDir, LORE_DIR);
14157
+ const dateStr = entry.timestamp.slice(0, 10);
14158
+ const datePath = path25.join(lorePath, ENTRIES_DIR, dateStr);
14159
+ if (!fs23.existsSync(datePath)) {
14160
+ fs23.mkdirSync(datePath, { recursive: true });
14161
+ }
14162
+ if (!entry.id) {
14163
+ entry.id = generateLoreId(rootDir, dateStr);
14164
+ }
14165
+ const entryPath = path25.join(datePath, `${entry.id}.yaml`);
14166
+ fs23.writeFileSync(entryPath, yaml14.dump(entry, { lineWidth: -1, noRefs: true }));
14167
+ await rebuildTimeline(rootDir);
14168
+ return entry.id;
14169
+ }
14170
+ async function rebuildTimeline(rootDir) {
14171
+ const lorePath = path25.join(rootDir, LORE_DIR);
14172
+ const entriesPath = path25.join(lorePath, ENTRIES_DIR);
14173
+ if (!fs23.existsSync(entriesPath)) return;
14174
+ const authors = /* @__PURE__ */ new Set();
14175
+ let entryCount = 0;
14176
+ let lastUpdated = "";
14177
+ const dateDirs = fs23.readdirSync(entriesPath).filter((d) => /^\d{4}-\d{2}-\d{2}$/.test(d));
14178
+ for (const dateDir of dateDirs) {
14179
+ const dirPath = path25.join(entriesPath, dateDir);
14180
+ const files = fs23.readdirSync(dirPath).filter((f) => f.endsWith(".yaml"));
14181
+ for (const file of files) {
14182
+ try {
14183
+ const content = fs23.readFileSync(path25.join(dirPath, file), "utf8");
14184
+ const entry = yaml14.load(content);
14185
+ authors.add(entry.author.id);
14186
+ entryCount++;
14187
+ if (!lastUpdated || entry.timestamp > lastUpdated) {
14188
+ lastUpdated = entry.timestamp;
14189
+ }
14190
+ } catch {
14191
+ }
14192
+ }
14193
+ }
14194
+ let project = "unknown";
14195
+ const configPath = path25.join(rootDir, ".paradigm", "config.yaml");
14196
+ if (fs23.existsSync(configPath)) {
14197
+ try {
14198
+ const config = yaml14.load(fs23.readFileSync(configPath, "utf8"));
14199
+ project = config.project || config.name || "unknown";
14200
+ } catch {
14201
+ }
14202
+ }
14203
+ const timeline = {
14204
+ version: "1.0",
14205
+ project,
14206
+ entries: entryCount,
14207
+ last_updated: lastUpdated || (/* @__PURE__ */ new Date()).toISOString(),
14208
+ authors: Array.from(authors)
14209
+ };
14210
+ if (!fs23.existsSync(lorePath)) {
14211
+ fs23.mkdirSync(lorePath, { recursive: true });
14212
+ }
14213
+ fs23.writeFileSync(
14214
+ path25.join(lorePath, TIMELINE_FILE),
14215
+ yaml14.dump(timeline, { lineWidth: -1, noRefs: true })
14216
+ );
14217
+ }
14218
+ function applyFilter(entries, filter) {
14219
+ let result = entries;
14220
+ if (filter.author) {
14221
+ result = result.filter((e) => e.author.id === filter.author);
14222
+ }
14223
+ if (filter.authorType) {
14224
+ result = result.filter((e) => e.author.type === filter.authorType);
14225
+ }
14226
+ if (filter.symbol) {
14227
+ result = result.filter(
14228
+ (e) => e.symbols_touched.includes(filter.symbol) || e.symbols_created?.includes(filter.symbol)
14229
+ );
14230
+ }
14231
+ if (filter.dateFrom) {
14232
+ const from = new Date(filter.dateFrom).getTime();
14233
+ result = result.filter((e) => new Date(e.timestamp).getTime() >= from);
14234
+ }
14235
+ if (filter.dateTo) {
14236
+ const to = new Date(filter.dateTo).getTime();
14237
+ result = result.filter((e) => new Date(e.timestamp).getTime() <= to);
14238
+ }
14239
+ if (filter.type) {
14240
+ result = result.filter((e) => e.type === filter.type);
14241
+ }
14242
+ if (filter.tags && filter.tags.length > 0) {
14243
+ result = result.filter((e) => filter.tags.some((tag) => e.tags?.includes(tag)));
14244
+ }
14245
+ if (filter.hasReview !== void 0) {
14246
+ result = result.filter((e) => filter.hasReview ? e.review != null : e.review == null);
14247
+ }
14248
+ result.sort((a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime());
14249
+ if (filter.offset) result = result.slice(filter.offset);
14250
+ if (filter.limit) result = result.slice(0, filter.limit);
14251
+ return result;
14252
+ }
14253
+ function generateLoreId(rootDir, dateStr) {
14254
+ const datePath = path25.join(rootDir, LORE_DIR, ENTRIES_DIR, dateStr);
14255
+ if (!fs23.existsSync(datePath)) {
14256
+ return `L-${dateStr}-001`;
14257
+ }
14258
+ const existing = fs23.readdirSync(datePath).filter((f) => f.startsWith("L-") && f.endsWith(".yaml")).map((f) => {
14259
+ const match = f.match(/L-\d{4}-\d{2}-\d{2}-(\d+)\.yaml/);
14260
+ return match ? parseInt(match[1], 10) : 0;
14261
+ });
14262
+ const next = existing.length > 0 ? Math.max(...existing) + 1 : 1;
14263
+ return `L-${dateStr}-${String(next).padStart(3, "0")}`;
14264
+ }
14265
+
14266
+ // ../paradigm-mcp/src/tools/lore.ts
14267
+ function getLoreToolsList() {
14268
+ return [
14269
+ {
14270
+ name: "paradigm_lore_search",
14271
+ description: "Search lore entries by symbol, author, date range, type, or tags. Returns project history records.",
14272
+ inputSchema: {
14273
+ type: "object",
14274
+ properties: {
14275
+ symbol: {
14276
+ type: "string",
14277
+ description: 'Filter by symbol (e.g., "#sentinel-sdk", "^authenticated")'
14278
+ },
14279
+ author: {
14280
+ type: "string",
14281
+ description: 'Filter by author ID (e.g., "ascend", "claude-opus-4")'
14282
+ },
14283
+ authorType: {
14284
+ type: "string",
14285
+ enum: ["human", "agent"],
14286
+ description: "Filter by author type"
14287
+ },
14288
+ type: {
14289
+ type: "string",
14290
+ enum: ["agent-session", "human-note", "decision", "review", "incident", "milestone"],
14291
+ description: "Filter by entry type"
14292
+ },
14293
+ dateFrom: {
14294
+ type: "string",
14295
+ description: 'Filter from date (ISO 8601, e.g., "2026-02-20")'
14296
+ },
14297
+ dateTo: {
14298
+ type: "string",
14299
+ description: "Filter to date (ISO 8601)"
14300
+ },
14301
+ tags: {
14302
+ type: "array",
14303
+ items: { type: "string" },
14304
+ description: "Filter by tags (OR logic)"
14305
+ },
14306
+ hasReview: {
14307
+ type: "boolean",
14308
+ description: "Filter for entries with/without reviews"
14309
+ },
14310
+ limit: {
14311
+ type: "number",
14312
+ description: "Maximum results (default: 20)"
14313
+ },
14314
+ offset: {
14315
+ type: "number",
14316
+ description: "Offset for pagination"
14317
+ }
14318
+ }
14319
+ },
14320
+ annotations: {
14321
+ readOnlyHint: true,
14322
+ destructiveHint: false
14323
+ }
14324
+ },
14325
+ {
14326
+ name: "paradigm_lore_record",
14327
+ description: "Record a new lore entry (agent session, decision, milestone, etc.). Call after completing significant work.",
14328
+ inputSchema: {
14329
+ type: "object",
14330
+ properties: {
14331
+ type: {
14332
+ type: "string",
14333
+ enum: ["agent-session", "human-note", "decision", "review", "incident", "milestone"],
14334
+ description: "Entry type"
14335
+ },
14336
+ title: {
14337
+ type: "string",
14338
+ description: 'Short title (e.g., "Built Sentinel Phase 1")'
14339
+ },
14340
+ summary: {
14341
+ type: "string",
14342
+ description: "2-3 sentence narrative summary"
14343
+ },
14344
+ symbols_touched: {
14345
+ type: "array",
14346
+ items: { type: "string" },
14347
+ description: 'Symbols affected (e.g., ["#sentinel-sdk", "^authenticated"])'
14348
+ },
14349
+ symbols_created: {
14350
+ type: "array",
14351
+ items: { type: "string" },
14352
+ description: "New symbols introduced"
14353
+ },
14354
+ files_created: {
14355
+ type: "array",
14356
+ items: { type: "string" },
14357
+ description: "Files created"
14358
+ },
14359
+ files_modified: {
14360
+ type: "array",
14361
+ items: { type: "string" },
14362
+ description: "Files modified"
14363
+ },
14364
+ lines_added: { type: "number", description: "Lines of code added" },
14365
+ lines_removed: { type: "number", description: "Lines of code removed" },
14366
+ commit: { type: "string", description: "Git commit hash" },
14367
+ duration_minutes: { type: "number", description: "Duration in minutes" },
14368
+ decisions: {
14369
+ type: "array",
14370
+ items: {
14371
+ type: "object",
14372
+ properties: {
14373
+ id: { type: "string" },
14374
+ decision: { type: "string" },
14375
+ rationale: { type: "string" }
14376
+ },
14377
+ required: ["id", "decision", "rationale"]
14378
+ },
14379
+ description: "Decisions made during this work"
14380
+ },
14381
+ errors_encountered: {
14382
+ type: "array",
14383
+ items: {
14384
+ type: "object",
14385
+ properties: {
14386
+ description: { type: "string" },
14387
+ resolution: { type: "string" },
14388
+ time_to_fix: { type: "string" }
14389
+ },
14390
+ required: ["description", "resolution"]
14391
+ }
14392
+ },
14393
+ learnings: {
14394
+ type: "array",
14395
+ items: { type: "string" },
14396
+ description: "Key learnings from this work"
14397
+ },
14398
+ verification: {
14399
+ type: "object",
14400
+ properties: {
14401
+ status: {
14402
+ type: "string",
14403
+ enum: ["pass", "fail", "partial", "untested"]
14404
+ },
14405
+ details: {
14406
+ type: "object",
14407
+ description: 'Per-check results (e.g., { "build": "pass", "tests": "fail" })'
14408
+ }
14409
+ }
14410
+ },
14411
+ tags: {
14412
+ type: "array",
14413
+ items: { type: "string" },
14414
+ description: "Tags for categorization"
14415
+ }
14416
+ },
14417
+ required: ["type", "title", "summary", "symbols_touched"]
14418
+ },
14419
+ annotations: {
14420
+ readOnlyHint: false,
14421
+ destructiveHint: false
14422
+ }
14423
+ },
14424
+ {
14425
+ name: "paradigm_lore_timeline",
14426
+ description: "Get lore timeline overview: recent entries, active authors, hot symbols. Call for project history orientation.",
14427
+ inputSchema: {
14428
+ type: "object",
14429
+ properties: {
14430
+ limit: {
14431
+ type: "number",
14432
+ description: "Number of recent entries to include (default: 10)"
14433
+ }
14434
+ }
14435
+ },
14436
+ annotations: {
14437
+ readOnlyHint: true,
14438
+ destructiveHint: false
14439
+ }
14440
+ }
14441
+ ];
14442
+ }
14443
+ async function handleLoreTool(name, args, ctx) {
14444
+ switch (name) {
14445
+ case "paradigm_lore_search": {
14446
+ const filter = {
14447
+ author: args.author,
14448
+ authorType: args.authorType,
14449
+ symbol: args.symbol,
14450
+ dateFrom: args.dateFrom,
14451
+ dateTo: args.dateTo,
14452
+ type: args.type,
14453
+ tags: args.tags,
14454
+ hasReview: args.hasReview,
14455
+ limit: args.limit || 20,
14456
+ offset: args.offset
14457
+ };
14458
+ const entries = await loadLoreEntries(ctx.rootDir, filter);
14459
+ return {
14460
+ handled: true,
14461
+ text: JSON.stringify({
14462
+ count: entries.length,
14463
+ filter: Object.fromEntries(
14464
+ Object.entries(filter).filter(([, v]) => v !== void 0)
14465
+ ),
14466
+ entries: entries.map(summarizeEntry)
14467
+ }, null, 2)
14468
+ };
14469
+ }
14470
+ case "paradigm_lore_record": {
14471
+ const {
14472
+ type,
14473
+ title,
14474
+ summary,
14475
+ symbols_touched,
14476
+ symbols_created,
14477
+ files_created,
14478
+ files_modified,
14479
+ lines_added,
14480
+ lines_removed,
14481
+ commit,
14482
+ duration_minutes,
14483
+ decisions,
14484
+ errors_encountered,
14485
+ learnings,
14486
+ verification,
14487
+ tags
14488
+ } = args;
14489
+ const entry = {
14490
+ id: "",
14491
+ // Will be generated
14492
+ type,
14493
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14494
+ duration_minutes,
14495
+ author: { type: "agent", id: "claude", model: "claude-opus-4-6" },
14496
+ title,
14497
+ summary,
14498
+ symbols_touched,
14499
+ symbols_created,
14500
+ files_created,
14501
+ files_modified,
14502
+ lines_added,
14503
+ lines_removed,
14504
+ commit,
14505
+ decisions,
14506
+ errors_encountered,
14507
+ learnings,
14508
+ verification,
14509
+ tags
14510
+ };
14511
+ const id = await recordLoreEntry(ctx.rootDir, entry);
14512
+ return {
14513
+ handled: true,
14514
+ text: JSON.stringify({
14515
+ success: true,
14516
+ id,
14517
+ type,
14518
+ title,
14519
+ message: "Lore entry recorded successfully"
14520
+ })
14521
+ };
14522
+ }
14523
+ case "paradigm_lore_timeline": {
14524
+ const limit = args.limit || 10;
14525
+ const timeline = await loadLoreTimeline(ctx.rootDir);
14526
+ const entries = await loadLoreEntries(ctx.rootDir, { limit });
14527
+ const symbolCounts = {};
14528
+ for (const entry of entries) {
14529
+ for (const sym of entry.symbols_touched) {
14530
+ symbolCounts[sym] = (symbolCounts[sym] || 0) + 1;
14531
+ }
14532
+ }
14533
+ const hotSymbols = Object.entries(symbolCounts).sort(([, a], [, b]) => b - a).slice(0, 10).map(([symbol, count]) => ({ symbol, count }));
14534
+ const authorActivity = {};
14535
+ for (const entry of entries) {
14536
+ const aid = entry.author.id;
14537
+ if (!authorActivity[aid]) {
14538
+ authorActivity[aid] = { count: 0, lastActive: entry.timestamp, type: entry.author.type };
14539
+ }
14540
+ authorActivity[aid].count++;
14541
+ if (entry.timestamp > authorActivity[aid].lastActive) {
14542
+ authorActivity[aid].lastActive = entry.timestamp;
14543
+ }
14544
+ }
14545
+ return {
14546
+ handled: true,
14547
+ text: JSON.stringify({
14548
+ timeline: timeline || { version: "1.0", project: "unknown", entries: 0, last_updated: "", authors: [] },
14549
+ recentEntries: entries.map(summarizeEntry),
14550
+ hotSymbols,
14551
+ authors: Object.entries(authorActivity).map(([id, info]) => ({
14552
+ id,
14553
+ type: info.type,
14554
+ entries: info.count,
14555
+ lastActive: info.lastActive
14556
+ }))
14557
+ }, null, 2)
14558
+ };
14559
+ }
14560
+ default:
14561
+ return { handled: false, text: "" };
14562
+ }
14563
+ }
14564
+ function summarizeEntry(entry) {
14565
+ return {
14566
+ id: entry.id,
14567
+ type: entry.type,
14568
+ title: entry.title,
14569
+ summary: entry.summary,
14570
+ author: entry.author,
14571
+ timestamp: entry.timestamp,
14572
+ duration_minutes: entry.duration_minutes,
14573
+ symbols_touched: entry.symbols_touched,
14574
+ verification: entry.verification?.status,
14575
+ review: entry.review ? {
14576
+ completeness: entry.review.completeness,
14577
+ quality: entry.review.quality
14578
+ } : null,
14579
+ tags: entry.tags
14580
+ };
14581
+ }
14582
+
14583
+ // ../paradigm-mcp/src/tools/fallback-grep.ts
14584
+ import * as path26 from "path";
13874
14585
  import { execSync } from "child_process";
13875
14586
  function grepForReferences(rootDir, symbol, options = {}) {
13876
14587
  const { maxResults = 20 } = options;
@@ -13899,7 +14610,7 @@ function grepForReferences(rootDir, symbol, options = {}) {
13899
14610
  const match = line.match(/^(.+?):(\d+):(.*)$/);
13900
14611
  if (match) {
13901
14612
  const [, filePath, lineNum, content] = match;
13902
- const relativePath = path25.relative(rootDir, filePath);
14613
+ const relativePath = path26.relative(rootDir, filePath);
13903
14614
  let context2 = "unknown";
13904
14615
  if (relativePath.includes(".purpose") || relativePath.includes("portal.yaml")) {
13905
14616
  context2 = "purpose";
@@ -14036,6 +14747,10 @@ function registerTools(server, getContext2, reloadContext2) {
14036
14747
  }
14037
14748
  },
14038
14749
  required: ["query"]
14750
+ },
14751
+ annotations: {
14752
+ readOnlyHint: true,
14753
+ destructiveHint: false
14039
14754
  }
14040
14755
  },
14041
14756
  {
@@ -14054,6 +14769,10 @@ function registerTools(server, getContext2, reloadContext2) {
14054
14769
  }
14055
14770
  },
14056
14771
  required: ["symbol"]
14772
+ },
14773
+ annotations: {
14774
+ readOnlyHint: true,
14775
+ destructiveHint: false
14057
14776
  }
14058
14777
  },
14059
14778
  {
@@ -14068,6 +14787,10 @@ function registerTools(server, getContext2, reloadContext2) {
14068
14787
  }
14069
14788
  },
14070
14789
  required: ["symbol"]
14790
+ },
14791
+ annotations: {
14792
+ readOnlyHint: true,
14793
+ destructiveHint: false
14071
14794
  }
14072
14795
  },
14073
14796
  {
@@ -14076,6 +14799,10 @@ function registerTools(server, getContext2, reloadContext2) {
14076
14799
  inputSchema: {
14077
14800
  type: "object",
14078
14801
  properties: {}
14802
+ },
14803
+ annotations: {
14804
+ readOnlyHint: true,
14805
+ destructiveHint: false
14079
14806
  }
14080
14807
  },
14081
14808
  {
@@ -14095,6 +14822,10 @@ function registerTools(server, getContext2, reloadContext2) {
14095
14822
  }
14096
14823
  },
14097
14824
  required: ["route"]
14825
+ },
14826
+ annotations: {
14827
+ readOnlyHint: true,
14828
+ destructiveHint: false
14098
14829
  }
14099
14830
  },
14100
14831
  // Wisdom tools
@@ -14120,7 +14851,9 @@ function registerTools(server, getContext2, reloadContext2) {
14120
14851
  // PM governance tools
14121
14852
  ...getPmToolsList(),
14122
14853
  // Reindex tool
14123
- ...getReindexToolsList()
14854
+ ...getReindexToolsList(),
14855
+ // Lore tools
14856
+ ...getLoreToolsList()
14124
14857
  ]
14125
14858
  };
14126
14859
  }
@@ -14668,6 +15401,15 @@ function registerTools(server, getContext2, reloadContext2) {
14668
15401
  };
14669
15402
  }
14670
15403
  }
15404
+ if (name.startsWith("paradigm_lore_")) {
15405
+ const result = await handleLoreTool(name, args, ctx);
15406
+ if (result.handled) {
15407
+ trackToolCall(result.text.length, name);
15408
+ return {
15409
+ content: [{ type: "text", text: result.text }]
15410
+ };
15411
+ }
15412
+ }
14671
15413
  if (name === "paradigm_reindex") {
14672
15414
  const reload = reloadContext2 || (async () => {
14673
15415
  });