@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.
- package/dist/{accept-orchestration-DIGPJVUR.js → accept-orchestration-YKMKMWGA.js} +5 -5
- package/dist/{assessment-loader-T4GPBHLB.js → assessment-loader-C5EOUM47.js} +0 -1
- package/dist/{chunk-4N6AYEEA.js → chunk-4PEQHWD7.js} +1 -1
- package/dist/{chunk-5S5CF3ER.js → chunk-4ZO3ZOPM.js} +19 -2141
- package/dist/chunk-C3BK3E23.js +268 -0
- package/dist/{chunk-Y4XZWCHK.js → chunk-CQFNTBFJ.js} +8 -8
- package/dist/{chunk-KFHK6EBI.js → chunk-CYGHL7PQ.js} +63 -7
- package/dist/{chunk-M2XMTJHQ.js → chunk-DS5QY37M.js} +201 -287
- package/dist/chunk-F6EJKLF4.js +4971 -0
- package/dist/{chunk-6RNYVBSG.js → chunk-JQYGPVLQ.js} +4 -4
- package/dist/{chunk-BC6XKMUA.js → chunk-K34C7NAN.js} +4 -4
- package/dist/{chunk-2QNZ6PVD.js → chunk-KB4XJWE3.js} +63 -1
- package/dist/chunk-MW5DMGBB.js +255 -0
- package/dist/{chunk-GY5KO3YZ.js → chunk-RDPXBMHK.js} +1 -1
- package/dist/{chunk-QHJGB5TV.js → chunk-RP6TZYGE.js} +1 -1
- package/dist/{chunk-ADOBV4PH.js → chunk-UVI3OH3G.js} +6 -2127
- package/dist/{diff-J6C5IHPV.js → diff-4FV7T35U.js} +5 -5
- package/dist/{dist-OLFOTUHS.js → dist-6SX5ZKKF.js} +2 -2
- package/dist/{dist-OMY7U6NR.js → dist-YB7T54QE.js} +1 -2
- package/dist/{doctor-TQYRF7KK.js → doctor-2KM5HOK6.js} +3 -3
- package/dist/drift-FH2UY64B.js +251 -0
- package/dist/{flow-7JUH6D4H.js → flow-MCKPJGRJ.js} +1 -1
- package/dist/{habits-ZJBAL4HD.js → habits-NC2TRMRV.js} +2 -2
- package/dist/{hooks-DLZEYHI3.js → hooks-JXYHVGIN.js} +1 -1
- package/dist/index.js +87 -61
- package/dist/mcp.js +5502 -9984
- package/dist/{orchestrate-FAV64G2R.js → orchestrate-IV54FMHD.js} +5 -5
- package/dist/{plugin-update-checker-TWBWUSAG.js → plugin-update-checker-S3W4BUJO.js} +0 -1
- package/dist/portal-check-2HI4FFD6.js +42 -0
- package/dist/portal-compliance-KQCTAQTJ.js +18 -0
- package/dist/{providers-NQ67LO2Z.js → providers-IONB4YRJ.js} +1 -1
- package/dist/reindex-ZM6J53UP.js +11 -0
- package/dist/{sentinel-KDIGZWKT.js → sentinel-BGCISNIK.js} +1 -1
- package/dist/{server-NN7WDAZJ.js → server-3K3TTJH3.js} +1 -1
- package/dist/{shift-KJWSJLWN.js → shift-G2ZCIR5Q.js} +158 -19
- package/dist/{spawn-EO7B2UM3.js → spawn-7SDONTJN.js} +3 -3
- package/dist/{summary-E2PU4UN2.js → summary-F46FRO3Y.js} +1 -1
- package/dist/{sync-5VJPZQNX.js → sync-4CNRHUWX.js} +3 -3
- package/dist/{sync-llms-7QDA3ZWC.js → sync-llms-MCWB37HN.js} +2 -2
- package/dist/{task-loader-GUX4KS6N.js → task-loader-7M2FCBX6.js} +0 -1
- package/dist/{team-6CCNANKE.js → team-XUZBPIFZ.js} +6 -6
- package/dist/{triage-B5W6GZLT.js → triage-MKKIWBSW.js} +2 -2
- package/dist/{upgrade-RBSE4M6I.js → upgrade-HGF4MBGV.js} +1 -1
- package/dist/{watch-PAEH6MOG.js → watch-CL2PPS2K.js} +1 -1
- package/dist/workspace-7CWY4IWV.js +20 -0
- package/package.json +2 -1
- package/dist/chunk-HPC3JAUP.js +0 -42
- /package/dist/{chunk-CCG6KYBT.js → chunk-5N5LR2KS.js} +0 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
indexCommand
|
|
4
|
+
} from "./chunk-UI3XXVJ6.js";
|
|
5
|
+
import {
|
|
6
|
+
log
|
|
7
|
+
} from "./chunk-4NCFWYGG.js";
|
|
8
|
+
|
|
9
|
+
// src/commands/workspace/index.ts
|
|
10
|
+
import * as fs from "fs";
|
|
11
|
+
import * as path from "path";
|
|
12
|
+
import chalk from "chalk";
|
|
13
|
+
import ora from "ora";
|
|
14
|
+
import * as yaml from "js-yaml";
|
|
15
|
+
async function workspaceInitCommand(options = {}) {
|
|
16
|
+
const cwd = process.cwd();
|
|
17
|
+
const workspaceFile = path.join(cwd, ".paradigm-workspace");
|
|
18
|
+
console.log(chalk.blue("\n\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"));
|
|
19
|
+
console.log(chalk.blue("\u2502") + chalk.white.bold(" paradigm workspace init ") + chalk.blue("\u2502"));
|
|
20
|
+
console.log(chalk.blue("\u2502") + chalk.gray(" Create a multi-project workspace ") + chalk.blue("\u2502"));
|
|
21
|
+
console.log(chalk.blue("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n"));
|
|
22
|
+
const tracker = log.command("workspace-init").start("Creating workspace", { cwd });
|
|
23
|
+
if (fs.existsSync(workspaceFile) && !options.force) {
|
|
24
|
+
console.log(chalk.yellow(" .paradigm-workspace already exists. Use --force to overwrite.\n"));
|
|
25
|
+
tracker.success("Workspace already exists");
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const parentDir = cwd;
|
|
29
|
+
const entries = fs.readdirSync(parentDir, { withFileTypes: true });
|
|
30
|
+
const members = [];
|
|
31
|
+
for (const entry of entries) {
|
|
32
|
+
if (!entry.isDirectory()) continue;
|
|
33
|
+
if (entry.name.startsWith(".") || entry.name === "node_modules") continue;
|
|
34
|
+
const dirPath = path.join(parentDir, entry.name);
|
|
35
|
+
const hasParadigm = fs.existsSync(path.join(dirPath, ".paradigm"));
|
|
36
|
+
const hasPurpose = fs.existsSync(path.join(dirPath, ".purpose"));
|
|
37
|
+
if (hasParadigm || hasPurpose) {
|
|
38
|
+
const role = detectProjectRole(entry.name, dirPath);
|
|
39
|
+
members.push({
|
|
40
|
+
name: entry.name,
|
|
41
|
+
path: `./${entry.name}`,
|
|
42
|
+
...role && { role }
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (members.length === 0) {
|
|
47
|
+
console.log(chalk.yellow(" No sibling projects with .paradigm/ or .purpose found."));
|
|
48
|
+
console.log(chalk.gray(" Create .purpose files in sibling directories first.\n"));
|
|
49
|
+
tracker.error("No projects found");
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const workspaceName = options.name || path.basename(cwd);
|
|
53
|
+
const config = {
|
|
54
|
+
version: "1.0",
|
|
55
|
+
name: workspaceName,
|
|
56
|
+
members
|
|
57
|
+
};
|
|
58
|
+
const yamlContent = yaml.dump(config, {
|
|
59
|
+
indent: 2,
|
|
60
|
+
lineWidth: 120,
|
|
61
|
+
noRefs: true,
|
|
62
|
+
sortKeys: false,
|
|
63
|
+
quotingType: '"'
|
|
64
|
+
});
|
|
65
|
+
fs.writeFileSync(workspaceFile, yamlContent, "utf8");
|
|
66
|
+
console.log(chalk.green(` Created .paradigm-workspace with ${members.length} members:
|
|
67
|
+
`));
|
|
68
|
+
for (const member of members) {
|
|
69
|
+
const roleTag = member.role ? chalk.gray(` [${member.role}]`) : "";
|
|
70
|
+
console.log(chalk.white(` ${member.name}`) + roleTag + chalk.gray(` \u2192 ${member.path}`));
|
|
71
|
+
}
|
|
72
|
+
console.log("");
|
|
73
|
+
console.log(chalk.white(" Next steps:"));
|
|
74
|
+
console.log(chalk.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
75
|
+
console.log(chalk.white(" 1. ") + chalk.gray("In each member project, add to ") + chalk.cyan(".paradigm/config.yaml") + chalk.gray(":"));
|
|
76
|
+
console.log(chalk.gray(" ") + chalk.cyan("workspace: ../.paradigm-workspace"));
|
|
77
|
+
console.log(chalk.white(" 2. ") + chalk.gray("Run ") + chalk.cyan("paradigm workspace reindex") + chalk.gray(" to build all indices"));
|
|
78
|
+
console.log(chalk.white(" 3. ") + chalk.gray("Use ") + chalk.cyan("includeWorkspace: true") + chalk.gray(" in MCP tools for cross-project search"));
|
|
79
|
+
console.log("");
|
|
80
|
+
tracker.success("Workspace created", { members: members.length });
|
|
81
|
+
}
|
|
82
|
+
async function workspaceStatusCommand(options = {}) {
|
|
83
|
+
const cwd = process.cwd();
|
|
84
|
+
const tracker = log.command("workspace-status").start("Getting workspace status");
|
|
85
|
+
const workspaceFile = findWorkspaceFile(cwd);
|
|
86
|
+
if (!workspaceFile) {
|
|
87
|
+
console.log(chalk.yellow("\n No .paradigm-workspace found in current or parent directory.\n"));
|
|
88
|
+
console.log(chalk.gray(" Run `paradigm workspace init` to create one.\n"));
|
|
89
|
+
tracker.error("No workspace found");
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const config = yaml.load(fs.readFileSync(workspaceFile, "utf8"));
|
|
93
|
+
const workspaceDir = path.dirname(workspaceFile);
|
|
94
|
+
if (options.json) {
|
|
95
|
+
const results = config.members.map((m) => getMemberStatus(workspaceDir, m));
|
|
96
|
+
console.log(JSON.stringify({ workspace: config.name, members: results }, null, 2));
|
|
97
|
+
tracker.success("Workspace status (JSON)");
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
console.log(chalk.blue(`
|
|
101
|
+
Workspace: ${chalk.white.bold(config.name)}`));
|
|
102
|
+
console.log(chalk.gray(` File: ${workspaceFile}`));
|
|
103
|
+
console.log(chalk.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n"));
|
|
104
|
+
for (const member of config.members) {
|
|
105
|
+
const status = getMemberStatus(workspaceDir, member);
|
|
106
|
+
const icon = status.hasIndex ? chalk.green("\u2713") : chalk.yellow("\u25CB");
|
|
107
|
+
const roleTag = member.role ? chalk.gray(` [${member.role}]`) : "";
|
|
108
|
+
console.log(` ${icon} ${chalk.white.bold(member.name)}${roleTag}`);
|
|
109
|
+
console.log(chalk.gray(` Path: ${member.path}`));
|
|
110
|
+
if (status.hasIndex) {
|
|
111
|
+
console.log(chalk.gray(` Symbols: ${status.symbolCount}`));
|
|
112
|
+
console.log(chalk.gray(` Last indexed: ${status.lastIndexed || "unknown"}`));
|
|
113
|
+
} else {
|
|
114
|
+
console.log(chalk.yellow(` No scan-index.json \u2014 run paradigm scan in this project`));
|
|
115
|
+
}
|
|
116
|
+
console.log("");
|
|
117
|
+
}
|
|
118
|
+
tracker.success("Workspace status shown", { members: config.members.length });
|
|
119
|
+
}
|
|
120
|
+
async function workspaceReindexCommand(options = {}) {
|
|
121
|
+
const cwd = process.cwd();
|
|
122
|
+
const tracker = log.command("workspace-reindex").start("Reindexing workspace");
|
|
123
|
+
const workspaceFile = findWorkspaceFile(cwd);
|
|
124
|
+
if (!workspaceFile) {
|
|
125
|
+
console.log(chalk.yellow("\n No .paradigm-workspace found.\n"));
|
|
126
|
+
tracker.error("No workspace found");
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const config = yaml.load(fs.readFileSync(workspaceFile, "utf8"));
|
|
130
|
+
const workspaceDir = path.dirname(workspaceFile);
|
|
131
|
+
console.log(chalk.blue(`
|
|
132
|
+
Reindexing workspace: ${chalk.white.bold(config.name)}
|
|
133
|
+
`));
|
|
134
|
+
const spinner = ora();
|
|
135
|
+
let totalSymbols = 0;
|
|
136
|
+
for (const member of config.members) {
|
|
137
|
+
const memberAbsPath = path.resolve(workspaceDir, member.path);
|
|
138
|
+
if (!fs.existsSync(memberAbsPath)) {
|
|
139
|
+
if (!options.quiet) {
|
|
140
|
+
console.log(chalk.yellow(` \u26A0 ${member.name}: directory not found at ${member.path}`));
|
|
141
|
+
}
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
if (!options.quiet) {
|
|
145
|
+
spinner.start(`Indexing ${member.name}...`);
|
|
146
|
+
}
|
|
147
|
+
try {
|
|
148
|
+
await indexCommand(memberAbsPath, { quiet: true });
|
|
149
|
+
const scanIndexPath = path.join(memberAbsPath, ".paradigm", "scan-index.json");
|
|
150
|
+
let symbolCount = 0;
|
|
151
|
+
if (fs.existsSync(scanIndexPath)) {
|
|
152
|
+
try {
|
|
153
|
+
const scanData = JSON.parse(fs.readFileSync(scanIndexPath, "utf8"));
|
|
154
|
+
const meta = scanData.$meta;
|
|
155
|
+
if (meta?.sources) {
|
|
156
|
+
symbolCount = (meta.sources.purposeFiles || 0) + (meta.sources.portalFiles || 0);
|
|
157
|
+
}
|
|
158
|
+
} catch {
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
totalSymbols += symbolCount;
|
|
162
|
+
if (!options.quiet) {
|
|
163
|
+
spinner.succeed(chalk.green(`${member.name}: indexed`));
|
|
164
|
+
}
|
|
165
|
+
} catch (e) {
|
|
166
|
+
if (!options.quiet) {
|
|
167
|
+
spinner.fail(chalk.red(`${member.name}: ${e.message}`));
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
console.log(chalk.gray("\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
172
|
+
console.log(chalk.green(` All members reindexed.`));
|
|
173
|
+
console.log("");
|
|
174
|
+
tracker.success("Workspace reindexed", { members: config.members.length, totalSymbols });
|
|
175
|
+
}
|
|
176
|
+
function findWorkspaceFile(startDir) {
|
|
177
|
+
let dir = startDir;
|
|
178
|
+
for (let i = 0; i < 5; i++) {
|
|
179
|
+
const candidate = path.join(dir, ".paradigm-workspace");
|
|
180
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
181
|
+
const parent = path.dirname(dir);
|
|
182
|
+
if (parent === dir) break;
|
|
183
|
+
dir = parent;
|
|
184
|
+
}
|
|
185
|
+
const configPath = path.join(startDir, ".paradigm", "config.yaml");
|
|
186
|
+
if (fs.existsSync(configPath)) {
|
|
187
|
+
try {
|
|
188
|
+
const config = yaml.load(fs.readFileSync(configPath, "utf8"));
|
|
189
|
+
if (typeof config?.workspace === "string") {
|
|
190
|
+
const wsPath = path.resolve(startDir, config.workspace);
|
|
191
|
+
if (fs.existsSync(wsPath)) return wsPath;
|
|
192
|
+
}
|
|
193
|
+
} catch {
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
function detectProjectRole(name, dirPath) {
|
|
199
|
+
const lowerName = name.toLowerCase();
|
|
200
|
+
if (lowerName.includes("api") || lowerName.includes("backend") || lowerName.includes("server")) {
|
|
201
|
+
return "api";
|
|
202
|
+
}
|
|
203
|
+
if (lowerName.includes("client") || lowerName.includes("frontend") || lowerName.includes("web") || lowerName.includes("app")) {
|
|
204
|
+
return "client";
|
|
205
|
+
}
|
|
206
|
+
if (lowerName.includes("shared") || lowerName.includes("common") || lowerName.includes("core")) {
|
|
207
|
+
return "shared";
|
|
208
|
+
}
|
|
209
|
+
if (lowerName.includes("lib") || lowerName.includes("packages")) {
|
|
210
|
+
return "lib";
|
|
211
|
+
}
|
|
212
|
+
if (lowerName.includes("service") || lowerName.includes("svc")) {
|
|
213
|
+
return "service";
|
|
214
|
+
}
|
|
215
|
+
const pkgPath = path.join(dirPath, "package.json");
|
|
216
|
+
if (fs.existsSync(pkgPath)) {
|
|
217
|
+
try {
|
|
218
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
219
|
+
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
220
|
+
if (deps["react"] || deps["vue"] || deps["@angular/core"] || deps["svelte"]) {
|
|
221
|
+
return "client";
|
|
222
|
+
}
|
|
223
|
+
if (deps["express"] || deps["fastify"] || deps["koa"] || deps["hono"]) {
|
|
224
|
+
return "api";
|
|
225
|
+
}
|
|
226
|
+
} catch {
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
return void 0;
|
|
230
|
+
}
|
|
231
|
+
function getMemberStatus(workspaceDir, member) {
|
|
232
|
+
const memberAbsPath = path.resolve(workspaceDir, member.path);
|
|
233
|
+
const scanIndexPath = path.join(memberAbsPath, ".paradigm", "scan-index.json");
|
|
234
|
+
const result = {
|
|
235
|
+
name: member.name,
|
|
236
|
+
path: member.path,
|
|
237
|
+
role: member.role,
|
|
238
|
+
exists: fs.existsSync(memberAbsPath),
|
|
239
|
+
hasIndex: false,
|
|
240
|
+
symbolCount: 0,
|
|
241
|
+
lastIndexed: null
|
|
242
|
+
};
|
|
243
|
+
if (result.exists && fs.existsSync(scanIndexPath)) {
|
|
244
|
+
result.hasIndex = true;
|
|
245
|
+
try {
|
|
246
|
+
const scanData = JSON.parse(fs.readFileSync(scanIndexPath, "utf8"));
|
|
247
|
+
const meta = scanData.$meta;
|
|
248
|
+
if (meta) {
|
|
249
|
+
result.lastIndexed = meta.generatedAt || null;
|
|
250
|
+
for (const category of ["components", "flows", "gates", "signals", "aspects"]) {
|
|
251
|
+
const items = scanData[category];
|
|
252
|
+
if (items && typeof items === "object") {
|
|
253
|
+
result.symbolCount += Object.keys(items).length;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
} catch {
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return result;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export {
|
|
264
|
+
workspaceInitCommand,
|
|
265
|
+
workspaceStatusCommand,
|
|
266
|
+
workspaceReindexCommand,
|
|
267
|
+
detectProjectRole
|
|
268
|
+
};
|
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
import {
|
|
3
3
|
suggestAgentsForTask
|
|
4
4
|
} from "./chunk-6QC3YGB6.js";
|
|
5
|
-
import {
|
|
6
|
-
extractDeclaredGates,
|
|
7
|
-
loadPortalConfig
|
|
8
|
-
} from "./chunk-HPC3JAUP.js";
|
|
9
5
|
import {
|
|
10
6
|
AgentSpawner,
|
|
11
7
|
extractSymbols
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import {
|
|
14
|
-
AuditLogger
|
|
15
|
-
} from "./chunk-PBHIFAL4.js";
|
|
8
|
+
} from "./chunk-JQYGPVLQ.js";
|
|
16
9
|
import {
|
|
17
10
|
loadAgentsManifest
|
|
18
11
|
} from "./chunk-PMXRGPRQ.js";
|
|
12
|
+
import {
|
|
13
|
+
AuditLogger
|
|
14
|
+
} from "./chunk-PBHIFAL4.js";
|
|
19
15
|
import {
|
|
20
16
|
buildSymbolIndex,
|
|
21
17
|
getReferencesTo,
|
|
22
18
|
searchSymbols
|
|
23
19
|
} from "./chunk-6P4IFIK2.js";
|
|
20
|
+
import {
|
|
21
|
+
extractDeclaredGates,
|
|
22
|
+
loadPortalConfig
|
|
23
|
+
} from "./chunk-MW5DMGBB.js";
|
|
24
24
|
import {
|
|
25
25
|
calculateCost
|
|
26
26
|
} from "./chunk-5JGJACDU.js";
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import {
|
|
3
3
|
detectIDE,
|
|
4
4
|
getAdapter
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import {
|
|
7
|
-
log
|
|
8
|
-
} from "./chunk-4NCFWYGG.js";
|
|
5
|
+
} from "./chunk-KB4XJWE3.js";
|
|
9
6
|
import {
|
|
10
7
|
parseParadigmConfig
|
|
11
8
|
} from "./chunk-YO6DVTL7.js";
|
|
9
|
+
import {
|
|
10
|
+
log
|
|
11
|
+
} from "./chunk-4NCFWYGG.js";
|
|
12
12
|
|
|
13
13
|
// src/commands/doctor.ts
|
|
14
14
|
import * as fs from "fs";
|
|
@@ -39,10 +39,10 @@ async function doctorCommand(options = {}) {
|
|
|
39
39
|
status: "ok",
|
|
40
40
|
message: "Directory exists"
|
|
41
41
|
});
|
|
42
|
-
const
|
|
43
|
-
if (fs.existsSync(
|
|
42
|
+
const configPath2 = path.join(paradigmDir, "config.yaml");
|
|
43
|
+
if (fs.existsSync(configPath2)) {
|
|
44
44
|
try {
|
|
45
|
-
const content = fs.readFileSync(
|
|
45
|
+
const content = fs.readFileSync(configPath2, "utf8");
|
|
46
46
|
parseParadigmConfig(content);
|
|
47
47
|
results.push({
|
|
48
48
|
name: ".paradigm/config.yaml",
|
|
@@ -217,6 +217,48 @@ async function doctorCommand(options = {}) {
|
|
|
217
217
|
fix: "paradigm init"
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
|
+
const configPath = path.join(paradigmDir, "config.yaml");
|
|
221
|
+
if (fs.existsSync(configPath)) {
|
|
222
|
+
try {
|
|
223
|
+
const configContent = fs.readFileSync(configPath, "utf8");
|
|
224
|
+
const { parse } = await import("./dist-JOHRYQUA.js");
|
|
225
|
+
const config = parse(configContent);
|
|
226
|
+
const purposeRequired = config?.["purpose-required"];
|
|
227
|
+
if (purposeRequired && Array.isArray(purposeRequired)) {
|
|
228
|
+
const missingDirs = [];
|
|
229
|
+
for (const entry of purposeRequired) {
|
|
230
|
+
if (!entry.pattern) continue;
|
|
231
|
+
const { glob } = await import("glob");
|
|
232
|
+
const matches = await glob(entry.pattern, { cwd, nodir: false });
|
|
233
|
+
for (const match of matches) {
|
|
234
|
+
const fullPath = path.join(cwd, match);
|
|
235
|
+
try {
|
|
236
|
+
const stat = fs.statSync(fullPath);
|
|
237
|
+
if (stat.isDirectory() && !fs.existsSync(path.join(fullPath, ".purpose"))) {
|
|
238
|
+
missingDirs.push(match);
|
|
239
|
+
}
|
|
240
|
+
} catch {
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (missingDirs.length > 0) {
|
|
245
|
+
results.push({
|
|
246
|
+
name: "Purpose-required",
|
|
247
|
+
status: "warn",
|
|
248
|
+
message: `${missingDirs.length} director${missingDirs.length === 1 ? "y" : "ies"} missing .purpose: ${missingDirs.join(", ")}`,
|
|
249
|
+
fix: "Create .purpose files with paradigm_purpose_init + paradigm_purpose_add_component"
|
|
250
|
+
});
|
|
251
|
+
} else {
|
|
252
|
+
results.push({
|
|
253
|
+
name: "Purpose-required",
|
|
254
|
+
status: "ok",
|
|
255
|
+
message: "All required directories have .purpose files"
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
} catch {
|
|
260
|
+
}
|
|
261
|
+
}
|
|
220
262
|
const clarificationMarkerRegex = /\[NEEDS CLARIFICATION:\s*[^\]]+\]/gi;
|
|
221
263
|
let clarificationCount = 0;
|
|
222
264
|
function findPurposeFilesRecursive(dir) {
|
|
@@ -292,6 +334,20 @@ async function doctorCommand(options = {}) {
|
|
|
292
334
|
});
|
|
293
335
|
}
|
|
294
336
|
}
|
|
337
|
+
if (fs.existsSync(portalPath)) {
|
|
338
|
+
try {
|
|
339
|
+
const { checkPortalCompliance, getComplianceSummary } = await import("./portal-compliance-KQCTAQTJ.js");
|
|
340
|
+
const complianceReport = await checkPortalCompliance(cwd);
|
|
341
|
+
const summary = getComplianceSummary(complianceReport);
|
|
342
|
+
results.push({
|
|
343
|
+
name: "Portal compliance",
|
|
344
|
+
status: summary.status,
|
|
345
|
+
message: summary.message,
|
|
346
|
+
fix: summary.status !== "ok" ? "paradigm portal check" : void 0
|
|
347
|
+
});
|
|
348
|
+
} catch {
|
|
349
|
+
}
|
|
350
|
+
}
|
|
295
351
|
const flowsPath = path.join(paradigmDir, "flows.yaml");
|
|
296
352
|
if (fs.existsSync(flowsPath)) {
|
|
297
353
|
try {
|