kenzoboard 0.1.4 → 0.1.6
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/index.js +40 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4696,6 +4696,40 @@ function runCodex(cli, args) {
|
|
|
4696
4696
|
stdio: ["ignore", "pipe", "pipe"]
|
|
4697
4697
|
});
|
|
4698
4698
|
}
|
|
4699
|
+
function verifyMcpServer(args, fluxDir) {
|
|
4700
|
+
const input = [
|
|
4701
|
+
JSON.stringify({
|
|
4702
|
+
jsonrpc: "2.0",
|
|
4703
|
+
id: 1,
|
|
4704
|
+
method: "initialize",
|
|
4705
|
+
params: {
|
|
4706
|
+
protocolVersion: "2024-11-05",
|
|
4707
|
+
capabilities: {},
|
|
4708
|
+
clientInfo: { name: "kenzoboard-connect", version: "0.0.0" }
|
|
4709
|
+
}
|
|
4710
|
+
}),
|
|
4711
|
+
JSON.stringify({ jsonrpc: "2.0", method: "notifications/initialized", params: {} }),
|
|
4712
|
+
JSON.stringify({ jsonrpc: "2.0", id: 2, method: "tools/list", params: {} })
|
|
4713
|
+
].join(`
|
|
4714
|
+
`) + `
|
|
4715
|
+
`;
|
|
4716
|
+
const output2 = execFileSync(args[0], args.slice(1), {
|
|
4717
|
+
input,
|
|
4718
|
+
encoding: "utf-8",
|
|
4719
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
4720
|
+
timeout: 30000,
|
|
4721
|
+
env: {
|
|
4722
|
+
...process.env,
|
|
4723
|
+
FLUX_DIR: fluxDir
|
|
4724
|
+
}
|
|
4725
|
+
});
|
|
4726
|
+
const responses = output2.split(`
|
|
4727
|
+
`).map((line) => line.trim()).filter(Boolean).map((line) => JSON.parse(line));
|
|
4728
|
+
const tools = responses.find((response) => response.id === 2)?.result?.tools;
|
|
4729
|
+
if (!tools?.some((tool) => tool.name === "list_ready_tasks")) {
|
|
4730
|
+
throw new Error("MCP server started, but did not expose the expected Kenzo task tools.");
|
|
4731
|
+
}
|
|
4732
|
+
}
|
|
4699
4733
|
async function connectCodexCommand(flags) {
|
|
4700
4734
|
const workspace = await ensureKenzoWorkspace();
|
|
4701
4735
|
const cli = resolveCodexCli();
|
|
@@ -4719,10 +4753,11 @@ async function connectCodexCommand(flags) {
|
|
|
4719
4753
|
...packageArgs
|
|
4720
4754
|
];
|
|
4721
4755
|
try {
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4756
|
+
verifyMcpServer(packageArgs, workspace.fluxDir);
|
|
4757
|
+
try {
|
|
4758
|
+
runCodex(cli, ["mcp", "get", serverName]);
|
|
4759
|
+
runCodex(cli, ["mcp", "remove", serverName]);
|
|
4760
|
+
} catch {}
|
|
4726
4761
|
runCodex(cli, addArgs);
|
|
4727
4762
|
const result = runCodex(cli, ["mcp", "get", serverName]);
|
|
4728
4763
|
if (!result.includes(serverName) || !result.includes(packageArgs[0])) {
|
|
@@ -4731,6 +4766,7 @@ async function connectCodexCommand(flags) {
|
|
|
4731
4766
|
console.log(`${c2.green}${c2.bold}Codex is connected to Kenzo.${c2.reset}`);
|
|
4732
4767
|
console.log(`Server: ${serverName}`);
|
|
4733
4768
|
console.log(`Workspace: ${workspace.fluxDir}`);
|
|
4769
|
+
console.log("MCP tools: verified");
|
|
4734
4770
|
console.log("");
|
|
4735
4771
|
console.log(`${c2.bold}Try this in Codex:${c2.reset}`);
|
|
4736
4772
|
console.log(" Use Kenzo to pick the next ready task, implement it, and mark it done.");
|