@a-company/paradigm 3.9.0 → 3.11.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-Z35I5AYN.js} +5 -5
- package/dist/{assessment-loader-T4GPBHLB.js → assessment-loader-C5EOUM47.js} +0 -1
- package/dist/{chunk-Y4XZWCHK.js → chunk-24AAVLME.js} +8 -8
- package/dist/{chunk-4N6AYEEA.js → chunk-3TWXFFZ3.js} +1 -1
- package/dist/{chunk-5S5CF3ER.js → chunk-4ZO3ZOPM.js} +19 -2141
- package/dist/{chunk-6RNYVBSG.js → chunk-CP6IZGUN.js} +4 -4
- package/dist/{chunk-M2XMTJHQ.js → chunk-DS5QY37M.js} +201 -287
- package/dist/chunk-F6EJKLF4.js +4971 -0
- package/dist/chunk-MW5DMGBB.js +255 -0
- package/dist/{chunk-KFHK6EBI.js → chunk-OSYMVGWX.js} +59 -3
- package/dist/{chunk-GY5KO3YZ.js → chunk-RDPXBMHK.js} +1 -1
- package/dist/{chunk-ADOBV4PH.js → chunk-UVI3OH3G.js} +6 -2127
- package/dist/{diff-J6C5IHPV.js → diff-PZAYCIAE.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-3YQ55536.js} +1 -1
- 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 +77 -51
- package/dist/mcp.js +5502 -9984
- package/dist/{orchestrate-FAV64G2R.js → orchestrate-BGRFBGBH.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-6I6N6RNK.js} +36 -8
- package/dist/{spawn-EO7B2UM3.js → spawn-WGFJ5RQZ.js} +5 -5
- package/dist/{task-loader-GUX4KS6N.js → task-loader-7M2FCBX6.js} +0 -1
- package/dist/{team-6CCNANKE.js → team-AFOKQ7YQ.js} +6 -6
- package/dist/{triage-B5W6GZLT.js → triage-MKKIWBSW.js} +2 -2
- package/dist/workspace-VBTW7OYL.js +271 -0
- package/package.json +2 -1
- package/dist/chunk-HPC3JAUP.js +0 -42
- /package/dist/{chunk-CCG6KYBT.js → chunk-5N5LR2KS.js} +0 -0
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import {
|
|
3
3
|
BackgroundOrchestrator,
|
|
4
4
|
Orchestrator
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-24AAVLME.js";
|
|
6
6
|
import "./chunk-6QC3YGB6.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-6RNYVBSG.js";
|
|
9
|
-
import "./chunk-PBHIFAL4.js";
|
|
10
|
-
import "./chunk-CCG6KYBT.js";
|
|
7
|
+
import "./chunk-CP6IZGUN.js";
|
|
11
8
|
import {
|
|
12
9
|
loadAgentsManifest
|
|
13
10
|
} from "./chunk-PMXRGPRQ.js";
|
|
11
|
+
import "./chunk-PBHIFAL4.js";
|
|
12
|
+
import "./chunk-5N5LR2KS.js";
|
|
14
13
|
import "./chunk-6P4IFIK2.js";
|
|
15
14
|
import "./chunk-MRENOFTR.js";
|
|
16
15
|
import "./chunk-IRKUEJVW.js";
|
|
16
|
+
import "./chunk-MW5DMGBB.js";
|
|
17
17
|
import {
|
|
18
18
|
formatCost,
|
|
19
19
|
formatTokens
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
checkPortalCompliance,
|
|
4
|
+
formatComplianceReport
|
|
5
|
+
} from "./chunk-MW5DMGBB.js";
|
|
6
|
+
import "./chunk-MO4EEYFW.js";
|
|
7
|
+
|
|
8
|
+
// src/commands/portal-check.ts
|
|
9
|
+
import chalk from "chalk";
|
|
10
|
+
async function portalCheckCommand(options) {
|
|
11
|
+
const rootDir = process.cwd();
|
|
12
|
+
const report = await checkPortalCompliance(rootDir);
|
|
13
|
+
if (options.json) {
|
|
14
|
+
console.log(JSON.stringify({
|
|
15
|
+
status: report.status,
|
|
16
|
+
declaredButUnusedCount: report.declaredButUnused.length,
|
|
17
|
+
usedButUndeclaredCount: report.usedButUndeclared.length,
|
|
18
|
+
properlyDeclaredCount: report.properlyDeclared.length,
|
|
19
|
+
declaredButUnused: report.declaredButUnused,
|
|
20
|
+
usedButUndeclared: report.usedButUndeclared,
|
|
21
|
+
properlyDeclared: report.properlyDeclared
|
|
22
|
+
}));
|
|
23
|
+
} else {
|
|
24
|
+
const formatted = formatComplianceReport(report);
|
|
25
|
+
if (report.status === "compliant") {
|
|
26
|
+
console.log(chalk.green(`
|
|
27
|
+
${formatted}
|
|
28
|
+
`));
|
|
29
|
+
} else if (report.status === "warnings") {
|
|
30
|
+
console.log(chalk.yellow(`
|
|
31
|
+
${formatted}
|
|
32
|
+
`));
|
|
33
|
+
} else {
|
|
34
|
+
console.log(chalk.red(`
|
|
35
|
+
${formatted}
|
|
36
|
+
`));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
portalCheckCommand
|
|
42
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
checkPortalCompliance,
|
|
4
|
+
extractDeclaredGates,
|
|
5
|
+
findGateReferences,
|
|
6
|
+
formatComplianceReport,
|
|
7
|
+
getComplianceSummary,
|
|
8
|
+
loadPortalConfig
|
|
9
|
+
} from "./chunk-MW5DMGBB.js";
|
|
10
|
+
import "./chunk-MO4EEYFW.js";
|
|
11
|
+
export {
|
|
12
|
+
checkPortalCompliance,
|
|
13
|
+
extractDeclaredGates,
|
|
14
|
+
findGateReferences,
|
|
15
|
+
formatComplianceReport,
|
|
16
|
+
getComplianceSummary,
|
|
17
|
+
loadPortalConfig
|
|
18
|
+
};
|
|
@@ -9,7 +9,7 @@ async function sentinelCommand(path, options) {
|
|
|
9
9
|
const shouldOpen = options.open !== false;
|
|
10
10
|
console.log(chalk.cyan("\nStarting Sentinel...\n"));
|
|
11
11
|
try {
|
|
12
|
-
const { startServer } = await import("./server-
|
|
12
|
+
const { startServer } = await import("./server-3K3TTJH3.js");
|
|
13
13
|
console.log(chalk.gray(`Project: ${projectDir}`));
|
|
14
14
|
console.log(chalk.gray(`Port: ${port}`));
|
|
15
15
|
console.log();
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
teamInitCommand
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-3TWXFFZ3.js";
|
|
5
|
+
import "./chunk-24AAVLME.js";
|
|
6
6
|
import "./chunk-6QC3YGB6.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-6RNYVBSG.js";
|
|
9
|
-
import "./chunk-PBHIFAL4.js";
|
|
10
|
-
import "./chunk-CCG6KYBT.js";
|
|
7
|
+
import "./chunk-CP6IZGUN.js";
|
|
11
8
|
import {
|
|
12
9
|
agentsConfigured
|
|
13
10
|
} from "./chunk-PMXRGPRQ.js";
|
|
11
|
+
import "./chunk-PBHIFAL4.js";
|
|
12
|
+
import "./chunk-5N5LR2KS.js";
|
|
14
13
|
import {
|
|
15
14
|
hooksInstallCommand
|
|
16
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-DS5QY37M.js";
|
|
17
16
|
import {
|
|
18
17
|
initCommand
|
|
19
18
|
} from "./chunk-BC6XKMUA.js";
|
|
@@ -30,9 +29,10 @@ import "./chunk-IRKUEJVW.js";
|
|
|
30
29
|
import {
|
|
31
30
|
syncCommand
|
|
32
31
|
} from "./chunk-QHJGB5TV.js";
|
|
32
|
+
import "./chunk-MW5DMGBB.js";
|
|
33
33
|
import {
|
|
34
34
|
doctorCommand
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-OSYMVGWX.js";
|
|
36
36
|
import "./chunk-2QNZ6PVD.js";
|
|
37
37
|
import {
|
|
38
38
|
log
|
|
@@ -110,6 +110,34 @@ discipline: ${detected}`
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
+
{
|
|
114
|
+
const configPath = path.join(paradigmDir, "config.yaml");
|
|
115
|
+
if (fs.existsSync(configPath)) {
|
|
116
|
+
try {
|
|
117
|
+
const configContent = fs.readFileSync(configPath, "utf8");
|
|
118
|
+
const config = yaml.load(configContent);
|
|
119
|
+
if (!config.workspace) {
|
|
120
|
+
let searchDir = path.dirname(cwd);
|
|
121
|
+
for (let i = 0; i < 3; i++) {
|
|
122
|
+
const wsCandidate = path.join(searchDir, ".paradigm-workspace");
|
|
123
|
+
if (fs.existsSync(wsCandidate)) {
|
|
124
|
+
const relPath = path.relative(cwd, wsCandidate);
|
|
125
|
+
const updated = configContent.trimEnd() + `
|
|
126
|
+
workspace: "${relPath}"
|
|
127
|
+
`;
|
|
128
|
+
fs.writeFileSync(configPath, updated, "utf8");
|
|
129
|
+
console.log(chalk.green(` \u2713 Found workspace: ${chalk.cyan(relPath)} (added to config.yaml)`));
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
const parent = path.dirname(searchDir);
|
|
133
|
+
if (parent === searchDir) break;
|
|
134
|
+
searchDir = parent;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
} catch {
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
113
141
|
const teamConfigured = agentsConfigured(cwd);
|
|
114
142
|
if (!teamConfigured || options.force) {
|
|
115
143
|
console.log(chalk.cyan(" Step 2/6: Initializing team configuration..."));
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
AgentSpawner
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-PBHIFAL4.js";
|
|
6
|
-
import {
|
|
7
|
-
getBestProvider
|
|
8
|
-
} from "./chunk-CCG6KYBT.js";
|
|
4
|
+
} from "./chunk-CP6IZGUN.js";
|
|
9
5
|
import {
|
|
10
6
|
loadAgentsManifest
|
|
11
7
|
} from "./chunk-PMXRGPRQ.js";
|
|
8
|
+
import "./chunk-PBHIFAL4.js";
|
|
9
|
+
import {
|
|
10
|
+
getBestProvider
|
|
11
|
+
} from "./chunk-5N5LR2KS.js";
|
|
12
12
|
import {
|
|
13
13
|
formatTokens
|
|
14
14
|
} from "./chunk-5JGJACDU.js";
|
|
@@ -8,17 +8,17 @@ import {
|
|
|
8
8
|
teamModelsCommand,
|
|
9
9
|
teamResetCommand,
|
|
10
10
|
teamStatusCommand
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-3TWXFFZ3.js";
|
|
12
|
+
import "./chunk-24AAVLME.js";
|
|
13
13
|
import "./chunk-6QC3YGB6.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-6RNYVBSG.js";
|
|
16
|
-
import "./chunk-PBHIFAL4.js";
|
|
17
|
-
import "./chunk-CCG6KYBT.js";
|
|
14
|
+
import "./chunk-CP6IZGUN.js";
|
|
18
15
|
import "./chunk-PMXRGPRQ.js";
|
|
16
|
+
import "./chunk-PBHIFAL4.js";
|
|
17
|
+
import "./chunk-5N5LR2KS.js";
|
|
19
18
|
import "./chunk-6P4IFIK2.js";
|
|
20
19
|
import "./chunk-MRENOFTR.js";
|
|
21
20
|
import "./chunk-IRKUEJVW.js";
|
|
21
|
+
import "./chunk-MW5DMGBB.js";
|
|
22
22
|
import "./chunk-5JGJACDU.js";
|
|
23
23
|
import "./chunk-MO4EEYFW.js";
|
|
24
24
|
export {
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
StatsCalculator,
|
|
7
7
|
TimelineBuilder,
|
|
8
8
|
loadAllSeedPatterns
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RDPXBMHK.js";
|
|
10
10
|
import {
|
|
11
11
|
SentinelStorage
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-UVI3OH3G.js";
|
|
13
13
|
import "./chunk-MO4EEYFW.js";
|
|
14
14
|
|
|
15
15
|
// src/commands/triage/index.ts
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
indexCommand
|
|
4
|
+
} from "./chunk-UI3XXVJ6.js";
|
|
5
|
+
import "./chunk-AK5M6KJB.js";
|
|
6
|
+
import "./chunk-6P4IFIK2.js";
|
|
7
|
+
import "./chunk-MRENOFTR.js";
|
|
8
|
+
import "./chunk-IRKUEJVW.js";
|
|
9
|
+
import {
|
|
10
|
+
log
|
|
11
|
+
} from "./chunk-4NCFWYGG.js";
|
|
12
|
+
import "./chunk-MO4EEYFW.js";
|
|
13
|
+
|
|
14
|
+
// src/commands/workspace/index.ts
|
|
15
|
+
import * as fs from "fs";
|
|
16
|
+
import * as path from "path";
|
|
17
|
+
import chalk from "chalk";
|
|
18
|
+
import ora from "ora";
|
|
19
|
+
import * as yaml from "js-yaml";
|
|
20
|
+
async function workspaceInitCommand(options = {}) {
|
|
21
|
+
const cwd = process.cwd();
|
|
22
|
+
const workspaceFile = path.join(cwd, ".paradigm-workspace");
|
|
23
|
+
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"));
|
|
24
|
+
console.log(chalk.blue("\u2502") + chalk.white.bold(" paradigm workspace init ") + chalk.blue("\u2502"));
|
|
25
|
+
console.log(chalk.blue("\u2502") + chalk.gray(" Create a multi-project workspace ") + chalk.blue("\u2502"));
|
|
26
|
+
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"));
|
|
27
|
+
const tracker = log.command("workspace-init").start("Creating workspace", { cwd });
|
|
28
|
+
if (fs.existsSync(workspaceFile) && !options.force) {
|
|
29
|
+
console.log(chalk.yellow(" .paradigm-workspace already exists. Use --force to overwrite.\n"));
|
|
30
|
+
tracker.success("Workspace already exists");
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const parentDir = cwd;
|
|
34
|
+
const entries = fs.readdirSync(parentDir, { withFileTypes: true });
|
|
35
|
+
const members = [];
|
|
36
|
+
for (const entry of entries) {
|
|
37
|
+
if (!entry.isDirectory()) continue;
|
|
38
|
+
if (entry.name.startsWith(".") || entry.name === "node_modules") continue;
|
|
39
|
+
const dirPath = path.join(parentDir, entry.name);
|
|
40
|
+
const hasParadigm = fs.existsSync(path.join(dirPath, ".paradigm"));
|
|
41
|
+
const hasPurpose = fs.existsSync(path.join(dirPath, ".purpose"));
|
|
42
|
+
if (hasParadigm || hasPurpose) {
|
|
43
|
+
const role = detectProjectRole(entry.name, dirPath);
|
|
44
|
+
members.push({
|
|
45
|
+
name: entry.name,
|
|
46
|
+
path: `./${entry.name}`,
|
|
47
|
+
...role && { role }
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (members.length === 0) {
|
|
52
|
+
console.log(chalk.yellow(" No sibling projects with .paradigm/ or .purpose found."));
|
|
53
|
+
console.log(chalk.gray(" Create .purpose files in sibling directories first.\n"));
|
|
54
|
+
tracker.error("No projects found");
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const workspaceName = options.name || path.basename(cwd);
|
|
58
|
+
const config = {
|
|
59
|
+
version: "1.0",
|
|
60
|
+
name: workspaceName,
|
|
61
|
+
members
|
|
62
|
+
};
|
|
63
|
+
const yamlContent = yaml.dump(config, {
|
|
64
|
+
indent: 2,
|
|
65
|
+
lineWidth: 120,
|
|
66
|
+
noRefs: true,
|
|
67
|
+
sortKeys: false,
|
|
68
|
+
quotingType: '"'
|
|
69
|
+
});
|
|
70
|
+
fs.writeFileSync(workspaceFile, yamlContent, "utf8");
|
|
71
|
+
console.log(chalk.green(` Created .paradigm-workspace with ${members.length} members:
|
|
72
|
+
`));
|
|
73
|
+
for (const member of members) {
|
|
74
|
+
const roleTag = member.role ? chalk.gray(` [${member.role}]`) : "";
|
|
75
|
+
console.log(chalk.white(` ${member.name}`) + roleTag + chalk.gray(` \u2192 ${member.path}`));
|
|
76
|
+
}
|
|
77
|
+
console.log("");
|
|
78
|
+
console.log(chalk.white(" Next steps:"));
|
|
79
|
+
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"));
|
|
80
|
+
console.log(chalk.white(" 1. ") + chalk.gray("In each member project, add to ") + chalk.cyan(".paradigm/config.yaml") + chalk.gray(":"));
|
|
81
|
+
console.log(chalk.gray(" ") + chalk.cyan("workspace: ../.paradigm-workspace"));
|
|
82
|
+
console.log(chalk.white(" 2. ") + chalk.gray("Run ") + chalk.cyan("paradigm workspace reindex") + chalk.gray(" to build all indices"));
|
|
83
|
+
console.log(chalk.white(" 3. ") + chalk.gray("Use ") + chalk.cyan("includeWorkspace: true") + chalk.gray(" in MCP tools for cross-project search"));
|
|
84
|
+
console.log("");
|
|
85
|
+
tracker.success("Workspace created", { members: members.length });
|
|
86
|
+
}
|
|
87
|
+
async function workspaceStatusCommand(options = {}) {
|
|
88
|
+
const cwd = process.cwd();
|
|
89
|
+
const tracker = log.command("workspace-status").start("Getting workspace status");
|
|
90
|
+
const workspaceFile = findWorkspaceFile(cwd);
|
|
91
|
+
if (!workspaceFile) {
|
|
92
|
+
console.log(chalk.yellow("\n No .paradigm-workspace found in current or parent directory.\n"));
|
|
93
|
+
console.log(chalk.gray(" Run `paradigm workspace init` to create one.\n"));
|
|
94
|
+
tracker.error("No workspace found");
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const config = yaml.load(fs.readFileSync(workspaceFile, "utf8"));
|
|
98
|
+
const workspaceDir = path.dirname(workspaceFile);
|
|
99
|
+
if (options.json) {
|
|
100
|
+
const results = config.members.map((m) => getMemberStatus(workspaceDir, m));
|
|
101
|
+
console.log(JSON.stringify({ workspace: config.name, members: results }, null, 2));
|
|
102
|
+
tracker.success("Workspace status (JSON)");
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
console.log(chalk.blue(`
|
|
106
|
+
Workspace: ${chalk.white.bold(config.name)}`));
|
|
107
|
+
console.log(chalk.gray(` File: ${workspaceFile}`));
|
|
108
|
+
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"));
|
|
109
|
+
for (const member of config.members) {
|
|
110
|
+
const status = getMemberStatus(workspaceDir, member);
|
|
111
|
+
const icon = status.hasIndex ? chalk.green("\u2713") : chalk.yellow("\u25CB");
|
|
112
|
+
const roleTag = member.role ? chalk.gray(` [${member.role}]`) : "";
|
|
113
|
+
console.log(` ${icon} ${chalk.white.bold(member.name)}${roleTag}`);
|
|
114
|
+
console.log(chalk.gray(` Path: ${member.path}`));
|
|
115
|
+
if (status.hasIndex) {
|
|
116
|
+
console.log(chalk.gray(` Symbols: ${status.symbolCount}`));
|
|
117
|
+
console.log(chalk.gray(` Last indexed: ${status.lastIndexed || "unknown"}`));
|
|
118
|
+
} else {
|
|
119
|
+
console.log(chalk.yellow(` No scan-index.json \u2014 run paradigm scan in this project`));
|
|
120
|
+
}
|
|
121
|
+
console.log("");
|
|
122
|
+
}
|
|
123
|
+
tracker.success("Workspace status shown", { members: config.members.length });
|
|
124
|
+
}
|
|
125
|
+
async function workspaceReindexCommand(options = {}) {
|
|
126
|
+
const cwd = process.cwd();
|
|
127
|
+
const tracker = log.command("workspace-reindex").start("Reindexing workspace");
|
|
128
|
+
const workspaceFile = findWorkspaceFile(cwd);
|
|
129
|
+
if (!workspaceFile) {
|
|
130
|
+
console.log(chalk.yellow("\n No .paradigm-workspace found.\n"));
|
|
131
|
+
tracker.error("No workspace found");
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
const config = yaml.load(fs.readFileSync(workspaceFile, "utf8"));
|
|
135
|
+
const workspaceDir = path.dirname(workspaceFile);
|
|
136
|
+
console.log(chalk.blue(`
|
|
137
|
+
Reindexing workspace: ${chalk.white.bold(config.name)}
|
|
138
|
+
`));
|
|
139
|
+
const spinner = ora();
|
|
140
|
+
let totalSymbols = 0;
|
|
141
|
+
for (const member of config.members) {
|
|
142
|
+
const memberAbsPath = path.resolve(workspaceDir, member.path);
|
|
143
|
+
if (!fs.existsSync(memberAbsPath)) {
|
|
144
|
+
if (!options.quiet) {
|
|
145
|
+
console.log(chalk.yellow(` \u26A0 ${member.name}: directory not found at ${member.path}`));
|
|
146
|
+
}
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
if (!options.quiet) {
|
|
150
|
+
spinner.start(`Indexing ${member.name}...`);
|
|
151
|
+
}
|
|
152
|
+
try {
|
|
153
|
+
await indexCommand(memberAbsPath, { quiet: true });
|
|
154
|
+
const scanIndexPath = path.join(memberAbsPath, ".paradigm", "scan-index.json");
|
|
155
|
+
let symbolCount = 0;
|
|
156
|
+
if (fs.existsSync(scanIndexPath)) {
|
|
157
|
+
try {
|
|
158
|
+
const scanData = JSON.parse(fs.readFileSync(scanIndexPath, "utf8"));
|
|
159
|
+
const meta = scanData.$meta;
|
|
160
|
+
if (meta?.sources) {
|
|
161
|
+
symbolCount = (meta.sources.purposeFiles || 0) + (meta.sources.portalFiles || 0);
|
|
162
|
+
}
|
|
163
|
+
} catch {
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
totalSymbols += symbolCount;
|
|
167
|
+
if (!options.quiet) {
|
|
168
|
+
spinner.succeed(chalk.green(`${member.name}: indexed`));
|
|
169
|
+
}
|
|
170
|
+
} catch (e) {
|
|
171
|
+
if (!options.quiet) {
|
|
172
|
+
spinner.fail(chalk.red(`${member.name}: ${e.message}`));
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
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"));
|
|
177
|
+
console.log(chalk.green(` All members reindexed.`));
|
|
178
|
+
console.log("");
|
|
179
|
+
tracker.success("Workspace reindexed", { members: config.members.length, totalSymbols });
|
|
180
|
+
}
|
|
181
|
+
function findWorkspaceFile(startDir) {
|
|
182
|
+
let dir = startDir;
|
|
183
|
+
for (let i = 0; i < 5; i++) {
|
|
184
|
+
const candidate = path.join(dir, ".paradigm-workspace");
|
|
185
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
186
|
+
const parent = path.dirname(dir);
|
|
187
|
+
if (parent === dir) break;
|
|
188
|
+
dir = parent;
|
|
189
|
+
}
|
|
190
|
+
const configPath = path.join(startDir, ".paradigm", "config.yaml");
|
|
191
|
+
if (fs.existsSync(configPath)) {
|
|
192
|
+
try {
|
|
193
|
+
const config = yaml.load(fs.readFileSync(configPath, "utf8"));
|
|
194
|
+
if (typeof config?.workspace === "string") {
|
|
195
|
+
const wsPath = path.resolve(startDir, config.workspace);
|
|
196
|
+
if (fs.existsSync(wsPath)) return wsPath;
|
|
197
|
+
}
|
|
198
|
+
} catch {
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
function detectProjectRole(name, dirPath) {
|
|
204
|
+
const lowerName = name.toLowerCase();
|
|
205
|
+
if (lowerName.includes("api") || lowerName.includes("backend") || lowerName.includes("server")) {
|
|
206
|
+
return "api";
|
|
207
|
+
}
|
|
208
|
+
if (lowerName.includes("client") || lowerName.includes("frontend") || lowerName.includes("web") || lowerName.includes("app")) {
|
|
209
|
+
return "client";
|
|
210
|
+
}
|
|
211
|
+
if (lowerName.includes("shared") || lowerName.includes("common") || lowerName.includes("core")) {
|
|
212
|
+
return "shared";
|
|
213
|
+
}
|
|
214
|
+
if (lowerName.includes("lib") || lowerName.includes("packages")) {
|
|
215
|
+
return "lib";
|
|
216
|
+
}
|
|
217
|
+
if (lowerName.includes("service") || lowerName.includes("svc")) {
|
|
218
|
+
return "service";
|
|
219
|
+
}
|
|
220
|
+
const pkgPath = path.join(dirPath, "package.json");
|
|
221
|
+
if (fs.existsSync(pkgPath)) {
|
|
222
|
+
try {
|
|
223
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
224
|
+
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
225
|
+
if (deps["react"] || deps["vue"] || deps["@angular/core"] || deps["svelte"]) {
|
|
226
|
+
return "client";
|
|
227
|
+
}
|
|
228
|
+
if (deps["express"] || deps["fastify"] || deps["koa"] || deps["hono"]) {
|
|
229
|
+
return "api";
|
|
230
|
+
}
|
|
231
|
+
} catch {
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return void 0;
|
|
235
|
+
}
|
|
236
|
+
function getMemberStatus(workspaceDir, member) {
|
|
237
|
+
const memberAbsPath = path.resolve(workspaceDir, member.path);
|
|
238
|
+
const scanIndexPath = path.join(memberAbsPath, ".paradigm", "scan-index.json");
|
|
239
|
+
const result = {
|
|
240
|
+
name: member.name,
|
|
241
|
+
path: member.path,
|
|
242
|
+
role: member.role,
|
|
243
|
+
exists: fs.existsSync(memberAbsPath),
|
|
244
|
+
hasIndex: false,
|
|
245
|
+
symbolCount: 0,
|
|
246
|
+
lastIndexed: null
|
|
247
|
+
};
|
|
248
|
+
if (result.exists && fs.existsSync(scanIndexPath)) {
|
|
249
|
+
result.hasIndex = true;
|
|
250
|
+
try {
|
|
251
|
+
const scanData = JSON.parse(fs.readFileSync(scanIndexPath, "utf8"));
|
|
252
|
+
const meta = scanData.$meta;
|
|
253
|
+
if (meta) {
|
|
254
|
+
result.lastIndexed = meta.generatedAt || null;
|
|
255
|
+
for (const category of ["components", "flows", "gates", "signals", "aspects"]) {
|
|
256
|
+
const items = scanData[category];
|
|
257
|
+
if (items && typeof items === "object") {
|
|
258
|
+
result.symbolCount += Object.keys(items).length;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
} catch {
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
return result;
|
|
266
|
+
}
|
|
267
|
+
export {
|
|
268
|
+
workspaceInitCommand,
|
|
269
|
+
workspaceReindexCommand,
|
|
270
|
+
workspaceStatusCommand
|
|
271
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a-company/paradigm",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.11.0",
|
|
4
4
|
"description": "Unified CLI for Paradigm developer tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"open": "^10.0.3",
|
|
36
36
|
"ora": "^8.0.1",
|
|
37
37
|
"prompts": "^2.4.2",
|
|
38
|
+
"sql.js": "^1.10.3",
|
|
38
39
|
"zod": "^3.23.0"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
package/dist/chunk-HPC3JAUP.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
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
|
-
function loadPortalConfig(rootDir) {
|
|
8
|
-
const portalPath = path.join(rootDir, "portal.yaml");
|
|
9
|
-
if (!fs.existsSync(portalPath)) {
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
try {
|
|
13
|
-
const content = fs.readFileSync(portalPath, "utf-8");
|
|
14
|
-
return yaml.load(content);
|
|
15
|
-
} catch {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
function extractDeclaredGates(config) {
|
|
20
|
-
const gates = /* @__PURE__ */ new Set();
|
|
21
|
-
if (config.gates) {
|
|
22
|
-
for (const key of Object.keys(config.gates)) {
|
|
23
|
-
const gateName = key.startsWith("^") ? key.slice(1) : key;
|
|
24
|
-
gates.add(gateName);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
if (config.routes) {
|
|
28
|
-
for (const routeConfig of Object.values(config.routes)) {
|
|
29
|
-
const gateList = Array.isArray(routeConfig) ? routeConfig : routeConfig.gates || [];
|
|
30
|
-
for (const gate of gateList) {
|
|
31
|
-
const gateName = gate.startsWith("^") ? gate.slice(1) : gate;
|
|
32
|
-
gates.add(gateName);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return Array.from(gates);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export {
|
|
40
|
-
loadPortalConfig,
|
|
41
|
-
extractDeclaredGates
|
|
42
|
-
};
|
|
File without changes
|