// Test logical analysis of the project
import { spawn } from 'child_process';
const logicConcepts = [
// Project Architecture Logic
"P and Q", // P: Project has modular design, Q: Project is extensible
// Phase Progression Logic
"(P implies Q) and (Q implies R) and R", // P: Phase 3 complete, Q: Ready for Phase 4, R: System stable
// Protocol Implementation Logic
"(J implies N) and J", // J: JSON-RPC implemented, N: Notifications handled
// System Integration Logic
"(S and P) implies T", // S: Syllogistic, P: Propositional, T: Three systems integrated
];
async function analyzeProjectLogic(concepts) {
for (let i = 0; i < concepts.length; i++) {
const concept = concepts[i];
console.log(`\nAnalyzing: ${concept}`);
await testLogic(concept, 'validate');
await testLogic(concept, 'formalize');
// Wait between tests
await new Promise(resolve => setTimeout(resolve, 1000));
}
}
function testLogic(input, operation) {
return new Promise((resolve) => {
const mcpServer = spawn('node', ['--max-old-space-size=4096', './dist/index.js'], {
cwd: process.cwd(),
stdio: ['pipe', 'pipe', 'pipe']
});
const request = {
jsonrpc: "2.0",
method: "tools/call",
params: {
name: "logic-thinking",
arguments: {
system: "propositional",
operation: operation,
input: input,
format: "natural"
}
},
id: 1
};
mcpServer.stdout.on('data', (data) => {
const response = data.toString();
if (response.includes('"jsonrpc"')) {
try {
const parsed = JSON.parse(response);
if (parsed.result && parsed.result.content) {
console.log(` ${operation}:`, parsed.result.content[0].text);
}
} catch (e) {}
}
});
setTimeout(() => {
mcpServer.stdin.write(JSON.stringify(request) + '\n');
setTimeout(() => {
mcpServer.kill('SIGINT');
resolve();
}, 1500);
}, 500);
});
}
analyzeProjectLogic(logicConcepts).catch(console.error);