@a-company/paradigm 3.9.0 → 3.12.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 (48) hide show
  1. package/dist/{accept-orchestration-DIGPJVUR.js → accept-orchestration-YKMKMWGA.js} +5 -5
  2. package/dist/{assessment-loader-T4GPBHLB.js → assessment-loader-C5EOUM47.js} +0 -1
  3. package/dist/{chunk-4N6AYEEA.js → chunk-4PEQHWD7.js} +1 -1
  4. package/dist/{chunk-5S5CF3ER.js → chunk-4ZO3ZOPM.js} +19 -2141
  5. package/dist/chunk-C3BK3E23.js +268 -0
  6. package/dist/{chunk-Y4XZWCHK.js → chunk-CQFNTBFJ.js} +8 -8
  7. package/dist/{chunk-KFHK6EBI.js → chunk-CYGHL7PQ.js} +63 -7
  8. package/dist/{chunk-M2XMTJHQ.js → chunk-DS5QY37M.js} +201 -287
  9. package/dist/chunk-F6EJKLF4.js +4971 -0
  10. package/dist/{chunk-6RNYVBSG.js → chunk-JQYGPVLQ.js} +4 -4
  11. package/dist/{chunk-BC6XKMUA.js → chunk-K34C7NAN.js} +4 -4
  12. package/dist/{chunk-2QNZ6PVD.js → chunk-KB4XJWE3.js} +63 -1
  13. package/dist/chunk-MW5DMGBB.js +255 -0
  14. package/dist/{chunk-GY5KO3YZ.js → chunk-RDPXBMHK.js} +1 -1
  15. package/dist/{chunk-QHJGB5TV.js → chunk-RP6TZYGE.js} +1 -1
  16. package/dist/{chunk-ADOBV4PH.js → chunk-UVI3OH3G.js} +6 -2127
  17. package/dist/{diff-J6C5IHPV.js → diff-4FV7T35U.js} +5 -5
  18. package/dist/{dist-OLFOTUHS.js → dist-6SX5ZKKF.js} +2 -2
  19. package/dist/{dist-OMY7U6NR.js → dist-YB7T54QE.js} +1 -2
  20. package/dist/{doctor-TQYRF7KK.js → doctor-2KM5HOK6.js} +3 -3
  21. package/dist/drift-FH2UY64B.js +251 -0
  22. package/dist/{flow-7JUH6D4H.js → flow-MCKPJGRJ.js} +1 -1
  23. package/dist/{habits-ZJBAL4HD.js → habits-NC2TRMRV.js} +2 -2
  24. package/dist/{hooks-DLZEYHI3.js → hooks-JXYHVGIN.js} +1 -1
  25. package/dist/index.js +87 -61
  26. package/dist/mcp.js +5502 -9984
  27. package/dist/{orchestrate-FAV64G2R.js → orchestrate-IV54FMHD.js} +5 -5
  28. package/dist/{plugin-update-checker-TWBWUSAG.js → plugin-update-checker-S3W4BUJO.js} +0 -1
  29. package/dist/portal-check-2HI4FFD6.js +42 -0
  30. package/dist/portal-compliance-KQCTAQTJ.js +18 -0
  31. package/dist/{providers-NQ67LO2Z.js → providers-IONB4YRJ.js} +1 -1
  32. package/dist/reindex-ZM6J53UP.js +11 -0
  33. package/dist/{sentinel-KDIGZWKT.js → sentinel-BGCISNIK.js} +1 -1
  34. package/dist/{server-NN7WDAZJ.js → server-3K3TTJH3.js} +1 -1
  35. package/dist/{shift-KJWSJLWN.js → shift-G2ZCIR5Q.js} +158 -19
  36. package/dist/{spawn-EO7B2UM3.js → spawn-7SDONTJN.js} +3 -3
  37. package/dist/{summary-E2PU4UN2.js → summary-F46FRO3Y.js} +1 -1
  38. package/dist/{sync-5VJPZQNX.js → sync-4CNRHUWX.js} +3 -3
  39. package/dist/{sync-llms-7QDA3ZWC.js → sync-llms-MCWB37HN.js} +2 -2
  40. package/dist/{task-loader-GUX4KS6N.js → task-loader-7M2FCBX6.js} +0 -1
  41. package/dist/{team-6CCNANKE.js → team-XUZBPIFZ.js} +6 -6
  42. package/dist/{triage-B5W6GZLT.js → triage-MKKIWBSW.js} +2 -2
  43. package/dist/{upgrade-RBSE4M6I.js → upgrade-HGF4MBGV.js} +1 -1
  44. package/dist/{watch-PAEH6MOG.js → watch-CL2PPS2K.js} +1 -1
  45. package/dist/workspace-7CWY4IWV.js +20 -0
  46. package/package.json +2 -1
  47. package/dist/chunk-HPC3JAUP.js +0 -42
  48. /package/dist/{chunk-CCG6KYBT.js → chunk-5N5LR2KS.js} +0 -0
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- AuditLogger
4
- } from "./chunk-PBHIFAL4.js";
5
2
  import {
6
3
  getProvider,
7
4
  initializeProviders
8
- } from "./chunk-CCG6KYBT.js";
5
+ } from "./chunk-5N5LR2KS.js";
9
6
  import {
10
7
  loadAgentsManifest
11
8
  } from "./chunk-PMXRGPRQ.js";
9
+ import {
10
+ AuditLogger
11
+ } from "./chunk-PBHIFAL4.js";
12
12
  import {
13
13
  calculateCost,
14
14
  formatCost,
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- indexCommand
4
- } from "./chunk-UI3XXVJ6.js";
5
2
  import {
6
3
  detectDiscipline,
7
4
  getDisciplineConfig
8
5
  } from "./chunk-CHSHON3O.js";
6
+ import {
7
+ indexCommand
8
+ } from "./chunk-UI3XXVJ6.js";
9
9
  import {
10
10
  getDefaultPremiseContent
11
11
  } from "./chunk-6P4IFIK2.js";
@@ -16,7 +16,7 @@ import {
16
16
  detectIDE,
17
17
  loadParadigmFiles,
18
18
  syncToIDE
19
- } from "./chunk-2QNZ6PVD.js";
19
+ } from "./chunk-KB4XJWE3.js";
20
20
  import {
21
21
  log
22
22
  } from "./chunk-4NCFWYGG.js";
@@ -474,6 +474,41 @@ function generateLlmsTxtSection() {
474
474
  lines.push("");
475
475
  return lines.join("\n");
476
476
  }
477
+ function generateWorkspaceSection(files) {
478
+ if (!files.workspace) return "";
479
+ const ws = files.workspace;
480
+ const siblings = ws.members.filter((m) => m.name !== ws.currentMember);
481
+ if (siblings.length === 0) return "";
482
+ const lines = [];
483
+ lines.push(`## Workspace: ${ws.name}`);
484
+ lines.push("");
485
+ lines.push("This project is part of a multi-project workspace.");
486
+ lines.push("");
487
+ lines.push("| Member | Role | Path |");
488
+ lines.push("|--------|------|------|");
489
+ for (const m of ws.members) {
490
+ const tag = m.name === ws.currentMember ? " **(this project)**" : "";
491
+ lines.push(`| ${m.name}${tag} | ${m.role || "-"} | \`${m.path}\` |`);
492
+ }
493
+ lines.push("");
494
+ lines.push("### Cross-Project Tools");
495
+ lines.push("");
496
+ lines.push("Use `includeWorkspace: true` when:");
497
+ lines.push("- Modifying symbols consumed by sibling projects");
498
+ lines.push("- Adding API endpoints or gates that siblings depend on");
499
+ lines.push("- Investigating cross-project impact of changes");
500
+ lines.push("");
501
+ lines.push("| Tool | Workspace Parameter |");
502
+ lines.push("|------|-------------------|");
503
+ lines.push("| `paradigm_search` | `includeWorkspace: true` \u2014 search sibling indices |");
504
+ lines.push("| `paradigm_ripple` | `includeWorkspace: true` \u2014 cross-project impact |");
505
+ lines.push("| `paradigm_gates_for_route` | Automatic \u2014 learns from sibling portal.yaml |");
506
+ lines.push("| `paradigm_workspace_reindex` | Rebuild all member indices |");
507
+ lines.push("");
508
+ lines.push("Cross-project symbols are prefixed: " + siblings.map((s) => `\`${s.name}/#symbol\``).join(", "));
509
+ lines.push("");
510
+ return lines.join("\n");
511
+ }
477
512
  function generateFooter() {
478
513
  const lines = [];
479
514
  lines.push("---");
@@ -1971,6 +2006,10 @@ var ClaudeAdapter = class {
1971
2006
  sections.push('paradigm_orchestrate_inline({ task: "...", mode: "plan" })');
1972
2007
  sections.push("```");
1973
2008
  sections.push("");
2009
+ const workspaceSection = generateWorkspaceSection(files);
2010
+ if (workspaceSection) {
2011
+ sections.push(workspaceSection);
2012
+ }
1974
2013
  sections.push("## Flow-First Development");
1975
2014
  sections.push("");
1976
2015
  sections.push("**Define flows BEFORE implementing features that span multiple steps.**");
@@ -2231,6 +2270,7 @@ var AgentsAdapter = class {
2231
2270
  var agentsAdapter = new AgentsAdapter();
2232
2271
 
2233
2272
  // src/core/ide-adapters/index.ts
2273
+ import * as yaml2 from "js-yaml";
2234
2274
  var adapters = /* @__PURE__ */ new Map([
2235
2275
  ["cursor", cursorAdapter],
2236
2276
  ["copilot", copilotAdapter],
@@ -2328,11 +2368,33 @@ function loadParadigmFiles(rootDir) {
2328
2368
  }
2329
2369
  }
2330
2370
  }
2371
+ let workspace = void 0;
2372
+ const rawConfig = yaml2.load(fs6.readFileSync(configPath, "utf8"));
2373
+ const wsField = rawConfig.workspace;
2374
+ if (typeof wsField === "string") {
2375
+ const wsPath = path6.resolve(rootDir, wsField);
2376
+ if (fs6.existsSync(wsPath)) {
2377
+ try {
2378
+ const wsConfig = yaml2.load(fs6.readFileSync(wsPath, "utf8"));
2379
+ const wsDir = path6.dirname(wsPath);
2380
+ const currentName = wsConfig.members?.find(
2381
+ (m) => path6.resolve(wsDir, m.path) === rootDir
2382
+ )?.name || path6.basename(rootDir);
2383
+ workspace = {
2384
+ name: wsConfig.name,
2385
+ currentMember: currentName,
2386
+ members: wsConfig.members || []
2387
+ };
2388
+ } catch {
2389
+ }
2390
+ }
2391
+ }
2331
2392
  return {
2332
2393
  config,
2333
2394
  specs,
2334
2395
  docs,
2335
- projectName: path6.basename(rootDir)
2396
+ projectName: path6.basename(rootDir),
2397
+ workspace
2336
2398
  };
2337
2399
  }
2338
2400
  function syncToIDE(rootDir, ideName, files, force = false) {
@@ -0,0 +1,255 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/core/portal-compliance.ts
4
+ import * as fs from "fs";
5
+ import * as path from "path";
6
+ import * as yaml from "js-yaml";
7
+ import { execSync } from "child_process";
8
+ var SKIP_DIRECTORIES = [
9
+ "node_modules",
10
+ ".git",
11
+ "dist",
12
+ "build",
13
+ "coverage",
14
+ ".paradigm",
15
+ "vendor",
16
+ "__pycache__"
17
+ ];
18
+ function loadPortalConfig(rootDir) {
19
+ const portalPath = path.join(rootDir, "portal.yaml");
20
+ if (!fs.existsSync(portalPath)) {
21
+ return null;
22
+ }
23
+ try {
24
+ const content = fs.readFileSync(portalPath, "utf-8");
25
+ return yaml.load(content);
26
+ } catch {
27
+ return null;
28
+ }
29
+ }
30
+ function extractDeclaredGates(config) {
31
+ const gates = /* @__PURE__ */ new Set();
32
+ if (config.gates) {
33
+ for (const key of Object.keys(config.gates)) {
34
+ const gateName = key.startsWith("^") ? key.slice(1) : key;
35
+ gates.add(gateName);
36
+ }
37
+ }
38
+ if (config.routes) {
39
+ for (const routeConfig of Object.values(config.routes)) {
40
+ const gateList = Array.isArray(routeConfig) ? routeConfig : routeConfig.gates || [];
41
+ for (const gate of gateList) {
42
+ const gateName = gate.startsWith("^") ? gate.slice(1) : gate;
43
+ gates.add(gateName);
44
+ }
45
+ }
46
+ }
47
+ return Array.from(gates);
48
+ }
49
+ function findGateReferences(rootDir) {
50
+ const references = [];
51
+ const skipDirsArg = SKIP_DIRECTORIES.map((d) => `--exclude-dir=${d}`).join(" ");
52
+ try {
53
+ const symbolPattern = "\\^[a-zA-Z][a-zA-Z0-9_-]+";
54
+ const symbolResult = execSync(
55
+ `grep -rn ${skipDirsArg} -E "${symbolPattern}" "${rootDir}" 2>/dev/null || true`,
56
+ { encoding: "utf-8", maxBuffer: 10 * 1024 * 1024 }
57
+ );
58
+ for (const line of symbolResult.split("\n").filter(Boolean)) {
59
+ const match = line.match(/^(.+?):(\d+):(.*)$/);
60
+ if (match) {
61
+ const [, file, lineNum, context] = match;
62
+ const gateMatch = context.match(/\^([a-zA-Z][a-zA-Z0-9_-]+)/);
63
+ if (gateMatch) {
64
+ references.push({
65
+ gate: gateMatch[1],
66
+ file: path.relative(rootDir, file),
67
+ line: parseInt(lineNum, 10),
68
+ context: context.trim().slice(0, 100),
69
+ matchType: "symbol"
70
+ });
71
+ }
72
+ }
73
+ }
74
+ } catch {
75
+ }
76
+ const functionPatterns = [
77
+ { pattern: `checkGate\\s*\\(['"]([^'"]+)['"]`, type: "function" },
78
+ { pattern: `requireGate\\s*\\(['"]([^'"]+)['"]`, type: "function" },
79
+ { pattern: `gate:\\s*['"]([^'"]+)['"]`, type: "config" },
80
+ { pattern: `@Gate\\s*\\(['"]?([^'"\\)]+)['"]?\\)`, type: "function" }
81
+ ];
82
+ for (const { pattern, type } of functionPatterns) {
83
+ try {
84
+ const result = execSync(
85
+ `grep -rn ${skipDirsArg} -E "${pattern}" "${rootDir}" 2>/dev/null || true`,
86
+ { encoding: "utf-8", maxBuffer: 10 * 1024 * 1024 }
87
+ );
88
+ for (const line of result.split("\n").filter(Boolean)) {
89
+ const match = line.match(/^(.+?):(\d+):(.*)$/);
90
+ if (match) {
91
+ const [, file, lineNum, context] = match;
92
+ const gateMatch = context.match(new RegExp(pattern));
93
+ if (gateMatch && gateMatch[1]) {
94
+ const gateName = gateMatch[1].startsWith("^") ? gateMatch[1].slice(1) : gateMatch[1];
95
+ references.push({
96
+ gate: gateName,
97
+ file: path.relative(rootDir, file),
98
+ line: parseInt(lineNum, 10),
99
+ context: context.trim().slice(0, 100),
100
+ matchType: type
101
+ });
102
+ }
103
+ }
104
+ }
105
+ } catch {
106
+ }
107
+ }
108
+ return references;
109
+ }
110
+ function extractUniqueGates(references) {
111
+ return [...new Set(references.map((r) => r.gate))];
112
+ }
113
+ async function checkPortalCompliance(rootDir) {
114
+ const config = loadPortalConfig(rootDir);
115
+ if (!config) {
116
+ const references2 = findGateReferences(rootDir);
117
+ const usedGates2 = extractUniqueGates(references2);
118
+ if (usedGates2.length === 0) {
119
+ return {
120
+ status: "compliant",
121
+ declaredButUnused: [],
122
+ usedButUndeclared: [],
123
+ properlyDeclared: [],
124
+ suggestions: ["No portal.yaml found, and no gate references detected in code."],
125
+ references: []
126
+ };
127
+ }
128
+ return {
129
+ status: "violations",
130
+ declaredButUnused: [],
131
+ usedButUndeclared: usedGates2,
132
+ properlyDeclared: [],
133
+ suggestions: [
134
+ "Gate references found in code but no portal.yaml exists.",
135
+ "Create a portal.yaml file to declare these gates:",
136
+ ...usedGates2.map((g) => ` - ^${g}`),
137
+ "",
138
+ "Run: paradigm portal init"
139
+ ],
140
+ references: references2
141
+ };
142
+ }
143
+ const declaredGates = extractDeclaredGates(config);
144
+ const references = findGateReferences(rootDir);
145
+ const usedGates = extractUniqueGates(references);
146
+ const declaredSet = new Set(declaredGates);
147
+ const usedSet = new Set(usedGates);
148
+ const declaredButUnused = declaredGates.filter((g) => !usedSet.has(g));
149
+ const usedButUndeclared = usedGates.filter((g) => !declaredSet.has(g));
150
+ const properlyDeclared = declaredGates.filter((g) => usedSet.has(g));
151
+ const suggestions = [];
152
+ if (declaredButUnused.length > 0) {
153
+ suggestions.push("Gates declared but never referenced:");
154
+ for (const gate of declaredButUnused) {
155
+ suggestions.push(` - ^${gate} (consider removing from portal.yaml or implementing)`);
156
+ }
157
+ suggestions.push("");
158
+ }
159
+ if (usedButUndeclared.length > 0) {
160
+ suggestions.push("Gates used in code but not declared in portal.yaml:");
161
+ for (const gate of usedButUndeclared) {
162
+ suggestions.push(` - ^${gate} (add to portal.yaml with proper definition)`);
163
+ }
164
+ suggestions.push("");
165
+ }
166
+ let status = "compliant";
167
+ if (usedButUndeclared.length > 0) {
168
+ status = "violations";
169
+ } else if (declaredButUnused.length > 0) {
170
+ status = "warnings";
171
+ }
172
+ return {
173
+ status,
174
+ declaredButUnused,
175
+ usedButUndeclared,
176
+ properlyDeclared,
177
+ suggestions,
178
+ references
179
+ };
180
+ }
181
+ function formatComplianceReport(report) {
182
+ const lines = [];
183
+ const statusIcon = report.status === "compliant" ? "\u2713" : report.status === "warnings" ? "\u26A0" : "\u2717";
184
+ lines.push(`Portal Compliance: ${statusIcon} ${report.status.toUpperCase()}`);
185
+ lines.push("");
186
+ lines.push(`Properly Declared: ${report.properlyDeclared.length}`);
187
+ if (report.declaredButUnused.length > 0) {
188
+ lines.push(`Declared but Unused: ${report.declaredButUnused.length}`);
189
+ }
190
+ if (report.usedButUndeclared.length > 0) {
191
+ lines.push(`Used but Undeclared: ${report.usedButUndeclared.length}`);
192
+ }
193
+ lines.push("");
194
+ if (report.properlyDeclared.length > 0) {
195
+ lines.push("Gates in Use:");
196
+ for (const gate of report.properlyDeclared) {
197
+ lines.push(` \u2713 ^${gate}`);
198
+ }
199
+ lines.push("");
200
+ }
201
+ if (report.declaredButUnused.length > 0) {
202
+ lines.push("Unused Gates (declared but never referenced):");
203
+ for (const gate of report.declaredButUnused) {
204
+ lines.push(` \u26A0 ^${gate}`);
205
+ }
206
+ lines.push("");
207
+ }
208
+ if (report.usedButUndeclared.length > 0) {
209
+ lines.push("Undeclared Gates (used but not in portal.yaml):");
210
+ for (const gate of report.usedButUndeclared) {
211
+ lines.push(` \u2717 ^${gate}`);
212
+ const refs = report.references.filter((r) => r.gate === gate).slice(0, 3);
213
+ for (const ref of refs) {
214
+ lines.push(` at ${ref.file}:${ref.line}`);
215
+ }
216
+ }
217
+ lines.push("");
218
+ }
219
+ if (report.suggestions.length > 0 && report.status !== "compliant") {
220
+ lines.push("Suggestions:");
221
+ for (const suggestion of report.suggestions) {
222
+ if (suggestion) {
223
+ lines.push(` ${suggestion}`);
224
+ }
225
+ }
226
+ }
227
+ return lines.join("\n");
228
+ }
229
+ function getComplianceSummary(report) {
230
+ if (report.status === "compliant") {
231
+ return {
232
+ status: "ok",
233
+ message: `${report.properlyDeclared.length} gates properly declared`
234
+ };
235
+ }
236
+ if (report.status === "warnings") {
237
+ return {
238
+ status: "warn",
239
+ message: `${report.declaredButUnused.length} unused gates`
240
+ };
241
+ }
242
+ return {
243
+ status: "error",
244
+ message: `${report.usedButUndeclared.length} gates used but not declared`
245
+ };
246
+ }
247
+
248
+ export {
249
+ loadPortalConfig,
250
+ extractDeclaredGates,
251
+ findGateReferences,
252
+ checkPortalCompliance,
253
+ formatComplianceReport,
254
+ getComplianceSummary
255
+ };
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  SentinelStorage,
4
4
  v4_default
5
- } from "./chunk-ADOBV4PH.js";
5
+ } from "./chunk-UVI3OH3G.js";
6
6
 
7
7
  // ../sentinel/dist/chunk-VQ3SIN7S.js
8
8
  var DEFAULTS = {
@@ -8,7 +8,7 @@ import {
8
8
  syncToIDE,
9
9
  writeMcpConfig,
10
10
  writeNestedContexts
11
- } from "./chunk-2QNZ6PVD.js";
11
+ } from "./chunk-KB4XJWE3.js";
12
12
  import {
13
13
  log
14
14
  } from "./chunk-4NCFWYGG.js";