@a-company/paradigm 3.1.5 → 3.5.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 (80) hide show
  1. package/dist/{accept-orchestration-CWZNCGZX.js → accept-orchestration-DIGPJVUR.js} +6 -5
  2. package/dist/{aggregate-W7Q6VIM2.js → aggregate-V4KPR3RW.js} +2 -2
  3. package/dist/{beacon-B47XSTL7.js → beacon-XRXL5KZB.js} +2 -2
  4. package/dist/{chunk-4LGLU2LO.js → chunk-2E2RTBSM.js} +533 -182
  5. package/dist/{chunk-YCLN7WXV.js → chunk-2QNZ6PVD.js} +219 -35
  6. package/dist/{chunk-UM54F7G5.js → chunk-4N6AYEEA.js} +1 -1
  7. package/dist/{chunk-MVXJVRFI.js → chunk-5TUAVVIG.js} +65 -1
  8. package/dist/{chunk-5C4SGQKH.js → chunk-6P4IFIK2.js} +4 -2
  9. package/dist/{chunk-WS5KM7OL.js → chunk-6RNYVBSG.js} +1 -1
  10. package/dist/{chunk-N6PJAPDE.js → chunk-AK5M6KJB.js} +18 -0
  11. package/dist/{chunk-VZ7CXFRZ.js → chunk-CRICL4FQ.js} +1004 -17
  12. package/dist/{chunk-MC7XC7XQ.js → chunk-GZDFVP2N.js} +20 -13
  13. package/dist/chunk-HPC3JAUP.js +42 -0
  14. package/dist/chunk-IRVA7NKV.js +657 -0
  15. package/dist/{chunk-ZPN7MXRA.js → chunk-KFHK6EBI.js} +184 -1
  16. package/dist/{chunk-UUZ2DMG5.js → chunk-KWDTBXP2.js} +1 -1
  17. package/dist/{chunk-DRUDZKIT.js → chunk-M2XMTJHQ.js} +693 -70
  18. package/dist/{chunk-PW2EXJQT.js → chunk-MRENOFTR.js} +24 -1
  19. package/dist/{chunk-QS36NGWV.js → chunk-QHJGB5TV.js} +1 -1
  20. package/dist/chunk-UI3XXVJ6.js +449 -0
  21. package/dist/{chunk-AD2LSCHB.js → chunk-Y4XZWCHK.js} +40 -74
  22. package/dist/{constellation-K3CIQCHI.js → constellation-GNK5DIMH.js} +2 -2
  23. package/dist/{cost-AEK6R7HK.js → cost-AGO5N7DD.js} +1 -1
  24. package/dist/{cursorrules-KI5QWHIX.js → cursorrules-LQFA7M62.js} +2 -2
  25. package/dist/{delete-W67IVTLJ.js → delete-3YXAJ5AA.js} +12 -1
  26. package/dist/{diff-AJJ5H6HV.js → diff-J6C5IHPV.js} +6 -5
  27. package/dist/{dist-2F7NO4H4-KSL6SJIO.js → dist-AG5JNIZU-XSEZ2LLK.js} +28 -3
  28. package/dist/dist-JOHRYQUA.js +7294 -0
  29. package/dist/{dist-NHJQVVUW.js → dist-Q6SAZI7X.js} +2 -2
  30. package/dist/{dist-GPQ4LAY3.js → dist-YP2CO4TG.js} +24 -6
  31. package/dist/{doctor-JBIV5PMN.js → doctor-TQYRF7KK.js} +2 -2
  32. package/dist/{edit-Y7XPYSMK.js → edit-EOMPXOG5.js} +1 -1
  33. package/dist/flow-7JUH6D4H.js +185 -0
  34. package/dist/global-AXILUM5X.js +136 -0
  35. package/dist/{habits-FA65W77Y.js → habits-CHP4EW5H.js} +234 -5
  36. package/dist/{hooks-JKWO44WH.js → hooks-DLZEYHI3.js} +1 -1
  37. package/dist/index.js +125 -100
  38. package/dist/{lint-HXKTWRNO.js → lint-N4LMMEXH.js} +141 -1
  39. package/dist/{list-R3QWW4SC.js → list-JKBJ7ESH.js} +1 -1
  40. package/dist/mcp.js +9273 -6515
  41. package/dist/{orchestrate-4ZH5GUQH.js → orchestrate-FAV64G2R.js} +6 -5
  42. package/dist/{probe-OYCP4JYG.js → probe-X3J2JX62.js} +18 -3
  43. package/dist/{promote-E6NBZ3BK.js → promote-HZH5E5CO.js} +1 -1
  44. package/dist/{providers-4PGPZEWP.js → providers-NQ67LO2Z.js} +1 -1
  45. package/dist/{record-OHQNWOUP.js → record-EECZ3E4I.js} +1 -1
  46. package/dist/{remember-6VZ74B7E.js → remember-3KJZGDUG.js} +1 -1
  47. package/dist/{review-RUHX25A5.js → review-BF26ILZB.js} +1 -1
  48. package/dist/{ripple-SBQOSTZD.js → ripple-JIUAMBLA.js} +2 -2
  49. package/dist/sentinel-ZTL224IG.js +63 -0
  50. package/dist/{server-MV4HNFVF.js → server-MZBYDXJY.js} +4193 -9
  51. package/dist/{setup-DF4F3ICN.js → setup-363IB6MO.js} +1 -1
  52. package/dist/{setup-JHBPZAG7.js → setup-UKJ3VGHI.js} +4 -4
  53. package/dist/{shift-2LQFQP4P.js → shift-KDVYB6CR.js} +16 -13
  54. package/dist/{show-WTOJXUTN.js → show-SAMTXEHG.js} +1 -1
  55. package/dist/{snapshot-GTVPRYZG.js → snapshot-KCMONZAO.js} +2 -2
  56. package/dist/{spawn-BJRQA2NR.js → spawn-EO7B2UM3.js} +2 -2
  57. package/dist/{summary-5SBFO7QK.js → summary-E2PU4UN2.js} +3 -3
  58. package/dist/{switch-6EANJ7O6.js → switch-CC2KACXO.js} +1 -1
  59. package/dist/{sync-5KSTPJ4B.js → sync-5VJPZQNX.js} +2 -2
  60. package/dist/sync-llms-7QDA3ZWC.js +166 -0
  61. package/dist/{team-NWP2KJAB.js → team-6CCNANKE.js} +7 -6
  62. package/dist/{test-MA5TWJQV.js → test-DK2RWLTK.js} +91 -8
  63. package/dist/{thread-JCJVRUQR.js → thread-RNSLADXN.js} +18 -2
  64. package/dist/{timeline-P7BARFLI.js → timeline-TJDVVVA3.js} +1 -1
  65. package/dist/{triage-TBIWJA6R.js → triage-PXMU3RWV.js} +2 -2
  66. package/dist/university-content/courses/para-101.json +2 -1
  67. package/dist/university-content/courses/para-201.json +102 -3
  68. package/dist/university-content/courses/para-301.json +14 -11
  69. package/dist/university-content/courses/para-401.json +57 -3
  70. package/dist/university-content/courses/para-501.json +204 -6
  71. package/dist/university-content/plsat/v3.0.json +808 -3
  72. package/dist/university-content/reference.json +270 -0
  73. package/dist/{upgrade-TIYFQYPO.js → upgrade-RBSE4M6I.js} +1 -1
  74. package/dist/{validate-QEEY6KFS.js → validate-2LTHHORX.js} +1 -1
  75. package/dist/{watch-4LT4O6K7.js → watch-NBPOMOEX.js} +76 -0
  76. package/dist/{watch-2XEYUH43.js → watch-PAEH6MOG.js} +1 -1
  77. package/package.json +1 -1
  78. package/dist/chunk-GWM2WRXL.js +0 -1095
  79. package/dist/sentinel-WB7GIK4V.js +0 -43
  80. /package/dist/{chunk-TAP5N3HH.js → chunk-CCG6KYBT.js} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  parsePurposeFileDetailed,
5
5
  serializePurposeFile,
6
6
  validatePurposeFile
7
- } from "./chunk-PW2EXJQT.js";
7
+ } from "./chunk-MRENOFTR.js";
8
8
  import {
9
9
  log
10
10
  } from "./chunk-4NCFWYGG.js";
@@ -201,6 +201,94 @@ function formatIssue(issue, indent = " ") {
201
201
  }
202
202
  return lines;
203
203
  }
204
+ var SOURCE_DIR_PATTERNS = [
205
+ "src",
206
+ "lib",
207
+ "features",
208
+ "components",
209
+ "services",
210
+ "utils",
211
+ "routes",
212
+ "api",
213
+ "commands",
214
+ "core",
215
+ "middleware",
216
+ "models",
217
+ "handlers",
218
+ "hooks",
219
+ "stores",
220
+ "config",
221
+ "plugins"
222
+ ];
223
+ var SKIP_DIRS = /* @__PURE__ */ new Set([
224
+ "node_modules",
225
+ "dist",
226
+ "build",
227
+ ".git",
228
+ ".paradigm",
229
+ "coverage",
230
+ "__pycache__",
231
+ ".next",
232
+ ".nuxt",
233
+ "vendor",
234
+ "target"
235
+ ]);
236
+ function findUndocumentedDirs(rootDir, existingPurposeFiles) {
237
+ const coveredDirs = new Set(existingPurposeFiles.map((f) => path.dirname(f)));
238
+ const suggestions = [];
239
+ function scanDir(dir, depth) {
240
+ if (depth > 4) return;
241
+ if (coveredDirs.has(dir)) return;
242
+ let entries;
243
+ try {
244
+ entries = fs.readdirSync(dir, { withFileTypes: true });
245
+ } catch {
246
+ return;
247
+ }
248
+ const dirName = path.basename(dir);
249
+ if (SKIP_DIRS.has(dirName)) return;
250
+ const isSourceDir = SOURCE_DIR_PATTERNS.includes(dirName) || entries.some((e) => !e.isDirectory() && /\.(ts|tsx|js|jsx|rs|py|go)$/.test(e.name));
251
+ if (isSourceDir && !entries.some((e) => e.name === ".purpose")) {
252
+ const sourceFiles = entries.filter((e) => !e.isDirectory() && /\.(ts|tsx|js|jsx|rs|py|go)$/.test(e.name)).filter((e) => !e.name.endsWith(".test.ts") && !e.name.endsWith(".spec.ts") && e.name !== "index.ts").map((e) => e.name.replace(/\.[^.]+$/, ""));
253
+ const components = sourceFiles.slice(0, 10).map(
254
+ (f) => f.replace(/([A-Z])/g, (_, c, i) => (i > 0 ? "-" : "") + c.toLowerCase())
255
+ );
256
+ if (components.length > 0) {
257
+ const purposePath = path.join(dir, ".purpose");
258
+ const relDir = path.relative(rootDir, dir);
259
+ const content = generatePurposeDraft(dirName, components);
260
+ suggestions.push({
261
+ dir,
262
+ relativeDir: relDir,
263
+ purposePath,
264
+ relativePurposePath: path.relative(rootDir, purposePath),
265
+ components,
266
+ content
267
+ });
268
+ }
269
+ }
270
+ for (const entry of entries) {
271
+ if (entry.isDirectory() && !SKIP_DIRS.has(entry.name)) {
272
+ scanDir(path.join(dir, entry.name), depth + 1);
273
+ }
274
+ }
275
+ }
276
+ scanDir(rootDir, 0);
277
+ return suggestions;
278
+ }
279
+ function generatePurposeDraft(dirName, components) {
280
+ const lines = [
281
+ `description: "Components in ${dirName}"`,
282
+ "",
283
+ "components:"
284
+ ];
285
+ for (const comp of components) {
286
+ lines.push(` ${comp}:`);
287
+ lines.push(` description: "TODO: describe #${comp}"`);
288
+ }
289
+ lines.push("");
290
+ return lines.join("\n");
291
+ }
204
292
  async function lintCommand(targetPath, options) {
205
293
  const rootDir = targetPath ? path.resolve(targetPath) : process.cwd();
206
294
  const spinner = ora();
@@ -212,6 +300,58 @@ async function lintCommand(targetPath, options) {
212
300
  const files = await findPurposeFiles(rootDir);
213
301
  spinner.stop();
214
302
  log.operation("find-files").debug("Purpose files found", { count: files.length });
303
+ if (options.autoPopulate) {
304
+ spinner.start("Scanning for undocumented source directories...");
305
+ const suggestions = findUndocumentedDirs(rootDir, files);
306
+ spinner.stop();
307
+ if (suggestions.length === 0) {
308
+ if (!options.quiet && !options.json) {
309
+ console.log(chalk.green("All source directories have .purpose coverage.\n"));
310
+ }
311
+ if (options.json) {
312
+ console.log(JSON.stringify({ suggestions: [], populated: 0 }));
313
+ }
314
+ return;
315
+ }
316
+ if (options.json) {
317
+ const populated = options.fix ? suggestions.length : 0;
318
+ if (options.fix) {
319
+ for (const s of suggestions) {
320
+ fs.writeFileSync(s.purposePath, s.content, "utf8");
321
+ }
322
+ }
323
+ console.log(JSON.stringify({
324
+ suggestions: suggestions.map((s) => ({
325
+ dir: s.relativeDir,
326
+ purposePath: s.relativePurposePath,
327
+ components: s.components
328
+ })),
329
+ populated
330
+ }));
331
+ return;
332
+ }
333
+ console.log(chalk.yellow(`Found ${suggestions.length} source director${suggestions.length > 1 ? "ies" : "y"} without .purpose files:
334
+ `));
335
+ for (const s of suggestions) {
336
+ console.log(` ${chalk.cyan(s.relativeDir)}/`);
337
+ for (const comp of s.components) {
338
+ console.log(chalk.gray(` #${comp}`));
339
+ }
340
+ if (options.fix) {
341
+ fs.writeFileSync(s.purposePath, s.content, "utf8");
342
+ console.log(chalk.green(` \u2192 Created ${s.relativePurposePath}`));
343
+ }
344
+ console.log("");
345
+ }
346
+ if (!options.fix) {
347
+ console.log(chalk.gray(`Run ${chalk.cyan("paradigm lint --auto-populate --fix")} to create these .purpose files.
348
+ `));
349
+ } else {
350
+ console.log(chalk.green(`Created ${suggestions.length} .purpose file${suggestions.length > 1 ? "s" : ""}.
351
+ `));
352
+ }
353
+ return;
354
+ }
215
355
  if (files.length === 0) {
216
356
  if (options.json) {
217
357
  console.log(JSON.stringify({ files: [], summary: { totalFiles: 0 } }));
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  loadLoreEntries
4
- } from "./chunk-MVXJVRFI.js";
4
+ } from "./chunk-5TUAVVIG.js";
5
5
  import "./chunk-MO4EEYFW.js";
6
6
 
7
7
  // src/commands/lore/list.ts