Something went wrong. Try again.
Fork of backnotprop/plannotator with reduced surface area
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758/** * Test script for Plannotator server * * Usage: * bun run tests/manual/test-server.ts [origin] * * Examples: * bun run tests/manual/test-server.ts # defaults to claude-code * bun run tests/manual/test-server.ts opencode # tests opencode origin * * Reads plan from stdin if provided, otherwise uses a sample plan. */
import { startPlannotatorServer, handleServerReady } from "@plannotator/server";
// @ts-ignore - Bun import attribute for textimport html from "../../apps/hook/dist/index.html" with { type: "text" };
const origin = process.argv[2] || "claude-code";const sharingEnabled = process.env.PLANNOTATOR_SHARE !== "disabled";
// Use sample plan (stdin reading was blocking)const plan = `# Test Plan: Sample Feature
## OverviewThis is a sample plan for testing the Plannotator UI.
## Implementation
\`\`\`typescriptfunction hello() { console.log("Hello, world!");}\`\`\`
## Checklist- [ ] Step 1- [ ] Step 2- [x] Step 3`;
console.error(`Starting Plannotator server with origin: ${origin}`);
const server = await startPlannotatorServer({ plan, origin, sharingEnabled, htmlContent: html as unknown as string, onReady: (url, isRemote, port) => handleServerReady(url, isRemote, port),});
const result = await server.waitForDecision();await Bun.sleep(1500);server.stop();
console.log(JSON.stringify(result, null, 2));process.exit(0);