codeloop 0.1.16 → 0.1.18
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/LICENSE +21 -0
- package/README.md +76 -0
- package/dist/commands/baseline.d.ts +3 -0
- package/dist/commands/baseline.d.ts.map +1 -0
- package/dist/commands/baseline.js +63 -0
- package/dist/commands/baseline.js.map +1 -0
- package/dist/commands/dashboard.d.ts +9 -0
- package/dist/commands/dashboard.d.ts.map +1 -0
- package/dist/commands/dashboard.js +54 -0
- package/dist/commands/dashboard.js.map +1 -0
- package/dist/commands/doctor.d.ts +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +104 -10
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/install-cursor-extension.d.ts +15 -0
- package/dist/commands/install-cursor-extension.d.ts.map +1 -0
- package/dist/commands/install-cursor-extension.js +136 -0
- package/dist/commands/install-cursor-extension.js.map +1 -0
- package/dist/commands/verify.d.ts +31 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +153 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/index.js +102 -2
- package/dist/index.js.map +1 -1
- package/dist/templates/claude-agents.d.ts +1 -4
- package/dist/templates/claude-agents.d.ts.map +1 -1
- package/dist/templates/claude-agents.js +1 -341
- package/dist/templates/claude-agents.js.map +1 -1
- package/dist/templates/claude-prompts.d.ts +1 -3
- package/dist/templates/claude-prompts.d.ts.map +1 -1
- package/dist/templates/claude-prompts.js +1 -44
- package/dist/templates/claude-prompts.js.map +1 -1
- package/dist/templates/config.d.ts +1 -1
- package/dist/templates/config.d.ts.map +1 -1
- package/dist/templates/config.js +1 -31
- package/dist/templates/config.js.map +1 -1
- package/dist/templates/cursor-rules.d.ts +1 -7
- package/dist/templates/cursor-rules.d.ts.map +1 -1
- package/dist/templates/cursor-rules.js +1 -684
- package/dist/templates/cursor-rules.js.map +1 -1
- package/dist/templates/cursor-skills.d.ts +1 -4
- package/dist/templates/cursor-skills.d.ts.map +1 -1
- package/dist/templates/cursor-skills.js +1 -156
- package/dist/templates/cursor-skills.js.map +1 -1
- package/dist/templates/global-rules.d.ts +1 -37
- package/dist/templates/global-rules.d.ts.map +1 -1
- package/dist/templates/global-rules.js +1 -164
- package/dist/templates/global-rules.js.map +1 -1
- package/dist/templates/mcp-config.d.ts +1 -31
- package/dist/templates/mcp-config.d.ts.map +1 -1
- package/dist/templates/mcp-config.js +1 -68
- package/dist/templates/mcp-config.js.map +1 -1
- package/dist/templates/specs.d.ts +1 -3
- package/dist/templates/specs.d.ts.map +1 -1
- package/dist/templates/specs.js +1 -67
- package/dist/templates/specs.js.map +1 -1
- package/package.json +26 -3
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `codeloop verify` and `codeloop gate` — CLI wrappers around the MCP
|
|
3
|
+
* server's JSON-RPC tools. With `--json`, prints a single JSON envelope
|
|
4
|
+
* to stdout (suitable for jq parsing in CI). All human-friendly output
|
|
5
|
+
* is sent to stderr in --json mode so stdout stays clean.
|
|
6
|
+
*/
|
|
7
|
+
export interface RunMcpToolOptions {
|
|
8
|
+
toolName: string;
|
|
9
|
+
args: Record<string, unknown>;
|
|
10
|
+
cwd?: string;
|
|
11
|
+
env?: Record<string, string>;
|
|
12
|
+
timeoutMs?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function runMcpTool({ toolName, args, cwd, env, timeoutMs, }: RunMcpToolOptions): Promise<unknown>;
|
|
15
|
+
interface VerifyOptions {
|
|
16
|
+
scope?: "full" | "affected";
|
|
17
|
+
platform?: string;
|
|
18
|
+
json?: boolean;
|
|
19
|
+
projectDir?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function verifyCommand(opts: VerifyOptions): Promise<void>;
|
|
22
|
+
interface GateOptions {
|
|
23
|
+
sectionId?: string;
|
|
24
|
+
threshold?: number;
|
|
25
|
+
json?: boolean;
|
|
26
|
+
projectDir?: string;
|
|
27
|
+
runId?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare function gateCommand(opts: GateOptions): Promise<void>;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../src/commands/verify.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAiBH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,UAAU,CAAC,EAC/B,QAAQ,EACR,IAAI,EACJ,GAAG,EACH,GAAG,EACH,SAAmB,GACpB,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CA0GtC;AAED,UAAU,aAAa;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CA2BtE;AAED,UAAU,WAAW;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBlE"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `codeloop verify` and `codeloop gate` — CLI wrappers around the MCP
|
|
3
|
+
* server's JSON-RPC tools. With `--json`, prints a single JSON envelope
|
|
4
|
+
* to stdout (suitable for jq parsing in CI). All human-friendly output
|
|
5
|
+
* is sent to stderr in --json mode so stdout stays clean.
|
|
6
|
+
*/
|
|
7
|
+
import { spawn } from "node:child_process";
|
|
8
|
+
import { resolve } from "node:path";
|
|
9
|
+
export async function runMcpTool({ toolName, args, cwd, env, timeoutMs = 600_000, }) {
|
|
10
|
+
const initRequest = {
|
|
11
|
+
jsonrpc: "2.0",
|
|
12
|
+
id: 1,
|
|
13
|
+
method: "initialize",
|
|
14
|
+
params: {
|
|
15
|
+
protocolVersion: "2024-11-05",
|
|
16
|
+
capabilities: {},
|
|
17
|
+
clientInfo: { name: "codeloop-cli", version: "0.1.16" },
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
const callRequest = {
|
|
21
|
+
jsonrpc: "2.0",
|
|
22
|
+
id: 2,
|
|
23
|
+
method: "tools/call",
|
|
24
|
+
params: { name: toolName, arguments: args },
|
|
25
|
+
};
|
|
26
|
+
return new Promise((resolvePromise, rejectPromise) => {
|
|
27
|
+
const child = spawn("codeloop-mcp-server", [], {
|
|
28
|
+
cwd: cwd ? resolve(cwd) : process.cwd(),
|
|
29
|
+
env: { ...process.env, ...(env ?? {}) },
|
|
30
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
31
|
+
});
|
|
32
|
+
let stdoutBuf = "";
|
|
33
|
+
let stderrBuf = "";
|
|
34
|
+
let settled = false;
|
|
35
|
+
const timer = setTimeout(() => {
|
|
36
|
+
if (settled)
|
|
37
|
+
return;
|
|
38
|
+
settled = true;
|
|
39
|
+
child.kill("SIGKILL");
|
|
40
|
+
rejectPromise(new Error(`MCP tool "${toolName}" timed out after ${timeoutMs}ms`));
|
|
41
|
+
}, timeoutMs);
|
|
42
|
+
child.stdout.on("data", (chunk) => {
|
|
43
|
+
stdoutBuf += chunk.toString("utf-8");
|
|
44
|
+
// JSON-RPC frames are newline-delimited. Once we see the response
|
|
45
|
+
// for id 2, we have what we need.
|
|
46
|
+
const lines = stdoutBuf.split("\n");
|
|
47
|
+
for (const line of lines) {
|
|
48
|
+
const trimmed = line.trim();
|
|
49
|
+
if (!trimmed.startsWith("{"))
|
|
50
|
+
continue;
|
|
51
|
+
try {
|
|
52
|
+
const msg = JSON.parse(trimmed);
|
|
53
|
+
if (msg.id === 2) {
|
|
54
|
+
clearTimeout(timer);
|
|
55
|
+
settled = true;
|
|
56
|
+
child.stdin.end();
|
|
57
|
+
child.kill();
|
|
58
|
+
if (msg.error) {
|
|
59
|
+
rejectPromise(new Error(`MCP error: ${msg.error.message} (code ${msg.error.code})`));
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
const result = msg.result;
|
|
63
|
+
const textBlock = result?.content?.find((c) => c.type === "text");
|
|
64
|
+
if (textBlock?.text) {
|
|
65
|
+
try {
|
|
66
|
+
resolvePromise(JSON.parse(textBlock.text));
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
resolvePromise(textBlock.text);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
resolvePromise(result);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
// Partial frame — keep buffering.
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
child.stderr.on("data", (chunk) => {
|
|
85
|
+
stderrBuf += chunk.toString("utf-8");
|
|
86
|
+
});
|
|
87
|
+
child.on("error", (err) => {
|
|
88
|
+
if (settled)
|
|
89
|
+
return;
|
|
90
|
+
settled = true;
|
|
91
|
+
clearTimeout(timer);
|
|
92
|
+
rejectPromise(new Error(`Failed to spawn codeloop-mcp-server: ${err.message}. Is it installed? (npm i -g codeloop-mcp-server)`));
|
|
93
|
+
});
|
|
94
|
+
child.on("close", (code) => {
|
|
95
|
+
if (settled)
|
|
96
|
+
return;
|
|
97
|
+
settled = true;
|
|
98
|
+
clearTimeout(timer);
|
|
99
|
+
rejectPromise(new Error(`codeloop-mcp-server exited with code ${code} before responding.\nstderr: ${stderrBuf.slice(-2000)}`));
|
|
100
|
+
});
|
|
101
|
+
child.stdin.write(JSON.stringify(initRequest) + "\n");
|
|
102
|
+
child.stdin.write(JSON.stringify(callRequest) + "\n");
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
export async function verifyCommand(opts) {
|
|
106
|
+
const result = (await runMcpTool({
|
|
107
|
+
toolName: "codeloop_verify",
|
|
108
|
+
args: {
|
|
109
|
+
scope: opts.scope ?? "full",
|
|
110
|
+
platform: opts.platform ?? "auto",
|
|
111
|
+
...(opts.projectDir ? { project_dir: resolve(opts.projectDir) } : {}),
|
|
112
|
+
},
|
|
113
|
+
}));
|
|
114
|
+
if (opts.json) {
|
|
115
|
+
process.stdout.write(JSON.stringify(result) + "\n");
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
console.log(`Run ID: ${result.run_id ?? "<unknown>"}`);
|
|
119
|
+
console.log(`Pass / Fail / Warning: ${result.pass_count}/${result.fail_count}/${result.warning_count}`);
|
|
120
|
+
console.log(`Confidence: ${result.confidence}`);
|
|
121
|
+
console.log(`Summary: ${result.summary}`);
|
|
122
|
+
if (typeof result.next_recommended_action === "string") {
|
|
123
|
+
console.log(`Next: ${result.next_recommended_action}`);
|
|
124
|
+
}
|
|
125
|
+
const failed = Number(result.fail_count ?? 0);
|
|
126
|
+
if (failed > 0) {
|
|
127
|
+
process.exitCode = 1;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
export async function gateCommand(opts) {
|
|
131
|
+
const result = (await runMcpTool({
|
|
132
|
+
toolName: "codeloop_gate_check",
|
|
133
|
+
args: {
|
|
134
|
+
...(opts.sectionId ? { section_id: opts.sectionId } : {}),
|
|
135
|
+
...(opts.runId ? { run_id: opts.runId } : {}),
|
|
136
|
+
...(opts.threshold ? { confidence_threshold: opts.threshold } : {}),
|
|
137
|
+
...(opts.projectDir ? { project_dir: resolve(opts.projectDir) } : {}),
|
|
138
|
+
},
|
|
139
|
+
}));
|
|
140
|
+
if (opts.json) {
|
|
141
|
+
process.stdout.write(JSON.stringify(result) + "\n");
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
console.log(`Status: ${result.status ?? result.gate_status}`);
|
|
145
|
+
console.log(`Confidence: ${result.confidence}`);
|
|
146
|
+
if (result.reasoning)
|
|
147
|
+
console.log(`Reasoning: ${result.reasoning}`);
|
|
148
|
+
const status = String(result.status ?? result.gate_status ?? "");
|
|
149
|
+
if (status !== "ready_for_review" && status !== "passed") {
|
|
150
|
+
process.exitCode = 1;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=verify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../../src/commands/verify.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsBpC,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,EAC/B,QAAQ,EACR,IAAI,EACJ,GAAG,EACH,GAAG,EACH,SAAS,GAAG,OAAO,GACD;IAClB,MAAM,WAAW,GAAG;QAClB,OAAO,EAAE,KAAc;QACvB,EAAE,EAAE,CAAC;QACL,MAAM,EAAE,YAAY;QACpB,MAAM,EAAE;YACN,eAAe,EAAE,YAAY;YAC7B,YAAY,EAAE,EAAE;YAChB,UAAU,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE;SACxD;KACF,CAAC;IACF,MAAM,WAAW,GAAG;QAClB,OAAO,EAAE,KAAc;QACvB,EAAE,EAAE,CAAC;QACL,MAAM,EAAE,YAAY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
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
2
5
|
import { Command } from "commander";
|
|
3
6
|
import { signupCommand } from "./commands/signup.js";
|
|
4
7
|
import { loginCommand } from "./commands/login.js";
|
|
@@ -9,11 +12,15 @@ import { configureCommand } from "./commands/configure.js";
|
|
|
9
12
|
import { designFetchCommand, designCompareCommand } from "./commands/design.js";
|
|
10
13
|
import { cursorRuleCommand } from "./commands/cursor-rule.js";
|
|
11
14
|
import { doctorCommand } from "./commands/doctor.js";
|
|
15
|
+
import { installCursorExtensionCommand } from "./commands/install-cursor-extension.js";
|
|
16
|
+
import { dashboardCommand } from "./commands/dashboard.js";
|
|
17
|
+
import { baselineApproveCommand, baselineStatusCommand } from "./commands/baseline.js";
|
|
18
|
+
import { verifyCommand, gateCommand } from "./commands/verify.js";
|
|
12
19
|
const program = new Command();
|
|
13
20
|
program
|
|
14
21
|
.name("codeloop")
|
|
15
22
|
.description("CodeLoop — automated verification for AI coding agents")
|
|
16
|
-
.version(
|
|
23
|
+
.version(readPackageVersion());
|
|
17
24
|
program
|
|
18
25
|
.command("signup")
|
|
19
26
|
.description("Create a new CodeLoop account and get an API key")
|
|
@@ -72,6 +79,99 @@ program
|
|
|
72
79
|
program
|
|
73
80
|
.command("doctor")
|
|
74
81
|
.description("Diagnose the CodeLoop activation chain — verify global MCP, agent rules, and project config")
|
|
75
|
-
.action(() =>
|
|
82
|
+
.action(async () => {
|
|
83
|
+
await doctorCommand();
|
|
84
|
+
});
|
|
85
|
+
program
|
|
86
|
+
.command("install-cursor-extension")
|
|
87
|
+
.description("Download and install the CodeLoop Cursor .vsix extension (auto-installs the User Rule)")
|
|
88
|
+
.option("--vsix <path>", "Install a specific .vsix file instead of the latest GitHub release")
|
|
89
|
+
.option("--channel <channel>", "Release channel: stable | preview", "stable")
|
|
90
|
+
.option("--from-marketplace", "Install from the Cursor / VS Code extension marketplace by extension ID (falls back to GitHub release if unavailable)")
|
|
91
|
+
.option("--marketplace-id <id>", "Override the marketplace publisher.extension id", "codelooptech.codeloop-cursor-extension")
|
|
92
|
+
.action((options) => installCursorExtensionCommand(options));
|
|
93
|
+
program
|
|
94
|
+
.command("dashboard")
|
|
95
|
+
.description("Open the local CodeLoop dashboard for run artifacts (screenshots, video, gate scores)")
|
|
96
|
+
.option("--port <port>", "Port to listen on", "3737")
|
|
97
|
+
.option("--host <host>", "Host to bind to", "127.0.0.1")
|
|
98
|
+
.option("--share", "Print cloudflared tunnel hint for sharing the dashboard publicly")
|
|
99
|
+
.option("--no-open", "Do not auto-open the system browser")
|
|
100
|
+
.action((options) => dashboardCommand(options));
|
|
101
|
+
const baseline = program
|
|
102
|
+
.command("baseline")
|
|
103
|
+
.description("Manage visual baseline governance (approve, status)");
|
|
104
|
+
baseline
|
|
105
|
+
.command("approve")
|
|
106
|
+
.description("Approve the most recent pending baseline change")
|
|
107
|
+
.action(() => baselineApproveCommand());
|
|
108
|
+
baseline
|
|
109
|
+
.command("status")
|
|
110
|
+
.description("Show baseline change log summary")
|
|
111
|
+
.action(() => baselineStatusCommand());
|
|
112
|
+
program
|
|
113
|
+
.command("verify")
|
|
114
|
+
.description("Run the CodeLoop verification suite (build, tests, lint, screenshots)")
|
|
115
|
+
.option("--scope <scope>", "Verification scope: full | affected", "full")
|
|
116
|
+
.option("--platform <platform>", "Platform hint: auto | web | mobile | api", "auto")
|
|
117
|
+
.option("--project-dir <path>", "Project directory (default: cwd)")
|
|
118
|
+
.option("--json", "Emit a single JSON envelope to stdout (suppresses human output)")
|
|
119
|
+
.action(async (options) => {
|
|
120
|
+
try {
|
|
121
|
+
await verifyCommand(options);
|
|
122
|
+
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
if (options.json) {
|
|
125
|
+
process.stdout.write(JSON.stringify({ error: err instanceof Error ? err.message : String(err) }) + "\n");
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
129
|
+
}
|
|
130
|
+
process.exitCode = 2;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
program
|
|
134
|
+
.command("gate")
|
|
135
|
+
.description("Run the CodeLoop quality gate check on the latest run")
|
|
136
|
+
.option("-s, --section-id <id>", "Section identifier from the active plan")
|
|
137
|
+
.option("--run-id <id>", "Specific run id to gate (defaults to latest)")
|
|
138
|
+
.option("--threshold <num>", "Confidence threshold (0-100)", (v) => parseInt(v, 10))
|
|
139
|
+
.option("--project-dir <path>", "Project directory (default: cwd)")
|
|
140
|
+
.option("--json", "Emit a single JSON envelope to stdout (suppresses human output)")
|
|
141
|
+
.action(async (options) => {
|
|
142
|
+
try {
|
|
143
|
+
await gateCommand(options);
|
|
144
|
+
}
|
|
145
|
+
catch (err) {
|
|
146
|
+
if (options.json) {
|
|
147
|
+
process.stdout.write(JSON.stringify({ error: err instanceof Error ? err.message : String(err) }) + "\n");
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
151
|
+
}
|
|
152
|
+
process.exitCode = 2;
|
|
153
|
+
}
|
|
154
|
+
});
|
|
76
155
|
program.parse();
|
|
156
|
+
function readPackageVersion() {
|
|
157
|
+
// dist/index.js → ../package.json (sits one level above dist/ in the published tarball)
|
|
158
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
159
|
+
const candidates = [
|
|
160
|
+
join(here, "..", "package.json"),
|
|
161
|
+
join(here, "..", "..", "package.json"),
|
|
162
|
+
];
|
|
163
|
+
for (const candidate of candidates) {
|
|
164
|
+
try {
|
|
165
|
+
const raw = readFileSync(candidate, "utf-8");
|
|
166
|
+
const parsed = JSON.parse(raw);
|
|
167
|
+
if (parsed.name === "codeloop" && typeof parsed.version === "string") {
|
|
168
|
+
return parsed.version;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
// try the next candidate
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return "0.0.0-unknown";
|
|
176
|
+
}
|
|
77
177
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB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I,CAAC,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC;QAChC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC;KACvC,CAAC;IACF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YAC7C,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAwC,CAAC;YACtE,IAAI,MAAM,CAAC,IAAI,KAAK,UAAU,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;gBACrE,OAAO,MAAM,CAAC,OAAO,CAAC;YACxB,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,yBAAyB;QAC3B,CAAC;IACH,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC"}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare const CODELOOP_QA_MD = "You are a QA verification specialist. Run CodeLoop visual review,\nvideo capture, and design comparison. Report structured issues with severity,\nevidence, and fix hints.\n\nFor UI projects, you MUST always perform ALL three:\n1. Screenshot review (codeloop_capture_screenshot for every page + codeloop_visual_review) \u2014 static per-page correctness\n2. Video capture review \u2014 codeloop_start_recording \u2192 use codeloop_interact to interact with EVERY\n element on every page (click, type, fill forms, test auth, validate errors, scroll, hover, drag)\n \u2192 codeloop_stop_recording \u2192 codeloop_interaction_replay \u2014 dynamic flow, transitions, animations\n3. Development log generation \u2014 codeloop_generate_dev_report \u2192 docs/DEVELOPMENT_LOG.md\n\nThe video MUST show the app changing state through active interaction using codeloop_interact.\nA recording of a static page is NOT valid evidence. The gate_check will REJECT static videos.\n\nUse codeloop_interact for ALL interactions \u2014 do NOT use raw osascript/PowerShell/xdotool.\ncodeloop_interact works on all platforms: macOS, Windows, Linux, browser (Playwright),\nAndroid emulator (adb), iOS Simulator (simctl), and supports Maestro flow generation.\n\nCRITICAL \u2014 WINDOW FOCUS (especially on single-monitor setups):\n- codeloop_capture_screenshot: ALWAYS pass app_name so the app is brought to front for capture\n- codeloop_start_recording: ALWAYS pass app_name (required) \u2014 brings app to front\n- codeloop_interact: AUTOMATICALLY brings the app to front before each interaction \u2014 this ensures\n interactions always hit the app window, NOT the IDE, even when the IDE regains focus between calls\n- codeloop_stop_recording: AUTOMATICALLY restores the IDE to front after recording stops\nWithout these focus switches, on single-monitor setups the IDE stays in front and all\nscreenshots/interactions capture the IDE instead of the app.\n";
|
|
3
|
-
export declare const CODELOOP_ADVISOR_MD = "You are an infrastructure and tooling advisor. Use CodeLoop\nrecommendation tools to suggest the best tools based on the\nproject stack, budget, and constraints. Always explain your\nreasoning and include tradeoffs.\n";
|
|
4
|
-
export declare const CLAUDE_MD = "# CodeLoop Integration\n\nCodeLoop provides automated verification for AI-generated code via MCP tools. Follow these rules to ensure code quality.\n\n## After implementing or modifying any feature:\n1. Call codeloop_verify to run all checks on the current project\n2. Read the structured output carefully \u2014 trust deterministic results first, visual diffs second, model opinions third\n3. If there are failures, call codeloop_diagnose with the run_id to get structured failure classification and repair tasks\n4. Fix ONLY the confirmed issues listed in the repair tasks \u2014 do not guess or fix unrelated code\n5. After fixing, call codeloop_verify again to confirm the fixes worked\n6. Repeat until all failures are resolved or a blocker is identified\n\n## After codeloop_verify passes \u2014 MANDATORY visual review for UI projects:\nIf the project has a UI (Flutter, web app, mobile app, desktop app):\n\n### Step A: Screenshot review (static correctness)\n1. Build and run the app\n2. Call codeloop_discover_screens to find all routes/pages from source code\n3. Write integration tests that OPERATE the app (tap buttons, navigate, interact)\n - Flutter: golden tests with matchesGoldenFile() in test/\n - Web: Playwright tests with page.screenshot()\n - Mobile: Maestro flows (auto-capture screenshots)\n4. Run codeloop_verify \u2014 it runs integration tests and collects screenshots\n5. Call codeloop_visual_review to analyze ALL captured screenshots\n6. Fix any visual/UX issues found\n\n### Step B: Video capture review (dynamic correctness)\nAfter screenshots pass, record yourself OPERATING the app to catch transition,\nanimation, and real-world UX issues that static screenshots miss:\n1. Build and launch the app (if not already running)\n2. Call codeloop_start_recording with target_type=\"browser\" for web apps. CodeLoop auto-launches\n a headed Playwright browser and sets app_name automatically. For desktop apps, pass app_name\n matching the process name. For mobile, use target_type=\"android_emulator\" or \"ios_simulator\".\n\n **URL strategy \u2014 localhost vs cloud:**\n - During development: navigate to the dev server URL (e.g., http://localhost:3000)\n - After deployment: navigate to the production URL\n - If the dev server is not running, start it first before recording\n - target_type auto-detects from the project when omitted\n\n3. While recording is active, use codeloop_interact to interact with EVERY element in the app.\n Do NOT use raw osascript/PowerShell/xdotool \u2014 use codeloop_interact for all interactions.\n target_type is auto-detected from the active recording, so you can omit it.\n The video MUST show real interactions, not a still image. Follow this MANDATORY checklist:\n\n A. **Navigation** \u2014 visit EVERY page/route. After each navigation, verify the page loaded\n (not 404). Use navigate_url action. Wait 2s between navigations.\n\n B. **Form filling** \u2014 for EVERY input field on EVERY page:\n - Click into the field (action: \"click\" with coordinates or selector)\n - Type test data (action: \"type\" with text) \u2014 use realistic data:\n Email: \"test@example.com\", Password: \"TestPass123!\", Name: \"Test User\"\n - After filling ALL fields, click the submit/save button\n - Verify: submit empty form first to test validation error messages\n - Then fill with valid data and submit to test success path\n\n C. **Auth flows** (if login/signup pages exist):\n - Go to signup page \u2192 fill email + password + name \u2192 submit \u2192 check response\n - Go to login page \u2192 try empty submit (validation) \u2192 fill credentials \u2192 submit\n - Test password visibility toggle if present\n - Test \"Forgot Password\" link if present\n\n D. **Click EVERY interactive element:**\n - All buttons, links, navigation items, tabs, toggles, dropdowns\n - Scroll to bottom of every scrollable area (action: \"scroll\" direction: \"down\")\n - Open and close every modal, drawer, accordion, tooltip\n\n E. **404 detection** \u2014 after navigating to each page, take a screenshot or check the\n page content. If any page shows 404/error/blank, report it as a critical issue.\n\n F. **Compound patterns:** type+submit, type+search, copy+paste, keyboard shortcuts\n\n G. **Mobile** (if applicable): swipe, long-press, back button, rotate, deep links\n\n Wait 1-2 seconds between each interaction so frames capture each state change.\n4. Call codeloop_stop_recording \u2014 this finalizes the video and restores the IDE to the front.\n5. Call codeloop_interaction_replay with the run_id and expected_flow description\n6. Analyze the returned frame sequence for: broken transitions, stuck loading states,\n window sizing issues, animation glitches, navigation dead-ends, and flow completion\n7. Fix any dynamic UX issues found\n8. ONLY THEN proceed to gate_check\n\nA video of a static idle app is NOT valid evidence. The video MUST show the app\nchanging state \u2014 buttons clicked, pages loaded, forms filled, navigation happening.\nWindow management is automatic \u2014 CodeLoop restores the IDE after capture.\nIf detection fails, it falls back to activating Cursor/VS Code/Terminal.\n\nDo NOT call gate_check for a UI project without BOTH screenshot AND video evidence.\n\n## DESIGN COMPARISON (MANDATORY WHEN REFERENCES EXIST)\n\nIf the project has any reference designs, design comparison is MANDATORY and BLOCKS gate_check until every screen passes:\n- Files under `designs/` ending in .png, .jpg, .jpeg, or .webp (subfolders treated as viewports)\n- A `.codeloop/figma.json` config (Figma frames are fetched automatically when FIGMA_API_TOKEN is set)\n\nWorkflow:\n1. After codeloop_verify captures screenshots, call codeloop_design_compare with mode=\"all\"\n - Auto-discovers every reference under designs/ and designs/<viewport>/\n - Fetches Figma frames listed in .codeloop/figma.json when a token is configured\n - Writes artifacts/runs/<run>/design_compare_summary.json + per-screen diff PNGs\n2. The MCP response returns reference, actual, and diff images for the worst-scoring screens\n for you to assess visually (layout, typography, colors, spacing, hierarchy).\n3. If any screen scores below config.design_match_threshold (default 0.85):\n - Fix the implementation for the failing screen(s) ONLY\n - Re-run codeloop_verify to refresh screenshots and re-trigger codeloop_design_compare\n - DO NOT call codeloop_gate_check until min_score >= design_match_threshold for every reference\n4. The design_compare_evidence gate is a BLOCKER. gate_check returns continue_fixing until\n every reference matches.\n\nSingle-screen mode: pass mode=\"single\", reference_image_path, and screen_name when the user\nasks to compare ONE specific screen.\n\nFigma sync: pass figma_file_url (and optionally figma_token) so frames are pulled before\ncomparison. Or run `codeloop design fetch --file <figma-url>` from the terminal once and\nlet MCP read the local files.\n\n## THE CODELOOP AUTO-FIX LOOP (MANDATORY)\n\nThis is an AUTOMATIC loop. You do NOT ask the user for permission to continue.\nYou do NOT stop and report partial progress. You keep going until the gate passes.\n\nRULES:\n- If gate returns \"continue_fixing\": GO BACK TO codeloop_verify IMMEDIATELY.\n Do NOT ask the user. Do NOT report partial results. Just fix and re-verify.\n- If gate returns \"escalate\": STOP and report blockers to the user.\n Only escalate after 8 failed fix attempts OR a true blocker.\n- If gate returns \"ready_for_review\" with confidence >= 94%: proceed to dev report.\n- Maximum loop iterations: 15. After 15 loops without reaching 94%, escalate.\n\n## Before marking any task or feature as complete:\n1. Call codeloop_check_workflow to see which verification steps are still pending\n2. Complete ALL pending steps listed by codeloop_check_workflow\n3. Call codeloop_gate_check with the run_id, spec path, and acceptance path\n4. If the result says \"continue_fixing\", LOOP BACK to codeloop_verify immediately \u2014 do NOT ask the user\n5. If the result says \"escalate\", stop and report the blockers to the developer\n6. Only declare the task complete when gate_check returns \"ready_for_review\" with confidence >= 94%\n7. Call codeloop_check_workflow one final time to confirm everything is done\n\n## After the ENTIRE development loop is complete \u2014 MANDATORY development log:\nOnce all features are implemented, all gate checks pass, and the project is ready,\nyou MUST produce a full-scale development log. This is NOT optional.\n\n1. Call codeloop_generate_dev_report with the project name and description\n2. Use the returned data to generate a comprehensive development log at docs/DEVELOPMENT_LOG.md\n3. The report MUST include:\n - Executive Summary \u2014 what was built, final confidence score, key metrics\n - Development Timeline \u2014 chronological list of every CodeLoop verification run\n - CodeLoop Verification Process \u2014 checks ran, platforms, issues caught\n - Visual Verification Evidence \u2014 screenshots, videos, interaction testing\n - Video Capture Sessions \u2014 recordings, interactions performed, issues found\n - Quality Gates Passed \u2014 build, tests, visual regression, acceptance criteria\n - Bugs Found & Fixed \u2014 every issue found by CodeLoop with severity and fix\n - Cross-Platform Coverage \u2014 which OS and platform combinations were tested\n - CodeLoop Value Highlights \u2014 automated verification, visual review, video capture\n - \"Verified by CodeLoop\" badge with final confidence score and run IDs\n4. Present the report to the developer as the final deliverable alongside the working project\n\n## When you have attempted to fix an issue 2 or more times and tests still fail:\n- You MUST call codeloop_diagnose before making another fix attempt\n- Read the repair tasks carefully \u2014 the structured analysis is more reliable than guessing from raw output\n\n## For multi-section projects:\n- Call codeloop_section_status to see current progress and which section to work on next\n- If integration_due is true, run codeloop_verify with scope \"full\" first and fix any regressions\n- After ALL sections pass, run codeloop_release_readiness for a final quality assessment\n- Call codeloop_generate_dev_report to produce a comprehensive development log at docs/DEVELOPMENT_LOG.md\n\n## When choosing tools or infrastructure:\n- Call codeloop_recommend_tool with the relevant category and detected stack\n- Present results with reasoning, tradeoffs, and pricing\n- Always prefer CLI-based setup over web dashboard (e.g., `vercel login`, `heroku login`, `firebase login`)\n- Guide the user through CLI installation and authentication when needed\n- Verify CLI auth with a status command after login (e.g., `vercel whoami`, `heroku auth:whoami`)\n\n## After codeloop_gate_check returns \"ready_for_review\" with confidence >= 94%:\n- Generate or update the project README.md with:\n - Project description and key features\n - Prerequisites and setup instructions\n - How to run locally\n - How to run tests\n - Architecture overview (key directories and files)\n - CodeLoop verification: \"Verified by CodeLoop (run_id: {id}). Confidence: {score}%. Gates passed: {list}. Tests: {passed}/{total} passed.\"\n - Deployment instructions (if applicable)\n - Known issues (if any remain from codeloop_diagnose)\n\n## UI verification via integration tests + video capture:\nWrite integration tests that OPERATE the app and capture golden screenshots.\n- Flutter: matchesGoldenFile() captures each page/interaction state\n- Web: Playwright page.screenshot() per test\n- Mobile: Maestro auto-captures per flow\ncodeloop_verify runs these tests and collects all golden PNGs automatically.\ncodeloop_visual_review returns them as images for analysis.\n\nAfter screenshot review, actively operate the app while recording:\n- Call codeloop_start_recording with target_type=\"browser\" for web apps (auto-launches Playwright,\n auto-sets app_name). For desktop apps, pass app_name. For mobile, use target_type as needed.\n- URL strategy: use localhost during dev (e.g., http://localhost:3000), production URL after deploy.\n If dev server is not running, start it first. target_type auto-detects from project when omitted.\n- Use codeloop_interact for ALL interactions \u2014 target_type is auto-detected from the active recording:\n **Web apps (all use selector-based Playwright \u2014 no coordinate guessing):**\n click, double_click, right_click, hover, type, keystroke, hotkey, scroll, drag_drop,\n type_and_submit, type_and_tab, fill_form, select_option, toggle, upload_file,\n navigate_url, navigate_back, navigate_forward, wait, sequence\n **Desktop native apps (coordinate-based + OS accessibility):**\n click, double_click, right_click, hover, type, keystroke, hotkey, scroll, drag_drop,\n long_press, win_ui_inspect, win_ui_automate, sequence\n **Mobile apps (ADB/simctl + Maestro):**\n click, type, keystroke, swipe, long_press, back_button, home_button, deep_link,\n launch_app, clear_app_data, grant_permission, rotate_device, biometric_auth,\n mock_location, simulate_network, maestro_flow, sequence\n- Do NOT use raw osascript/PowerShell/xdotool \u2014 always use codeloop_interact\n- Wait 1-2s between interactions; use codeloop_capture_screenshot (with app_name) to verify each worked\n- A static video is NOT valid \u2014 the video must show state changes\n- Call codeloop_stop_recording (finalizes video + logs, restores IDE to front)\n- Call codeloop_interaction_replay to extract frames, app logs, and analyze the flow\n The AI correlates visual frames with runtime log errors for comprehensive analysis\n\n**App logs:** CodeLoop automatically captures app runtime logs during video recording:\n- Flutter apps: flutter logs output\n- Android: adb logcat filtered to the app\n- iOS Simulator: simctl log stream\n- Native macOS: log stream --process\n- Web: browser console events via Playwright\n- Backend: dev server stdout/stderr\nThese logs are included in the interaction_replay analysis so you can correlate\nvisual frames with runtime errors, warnings, and exceptions.\n\n## Terminal authorization:\n- Common development commands (flutter, npm, git, brew, etc.) are pre-authorized via permissions.allow\n- If a command is blocked, check the allow-list in .claude/settings.local.json\n- For Cursor users: before running your first command, tell the user:\n \"To avoid clicking 'Run' on every command, enable Cursor Auto-Run:\n Cmd+Shift+J \u2192 Features \u2192 Terminal \u2192 Auto-Run Mode \u2192 Yolo\"\n- For service provider CLIs: install via the recommended package manager, then authenticate\n\n## Never:\n- Mark a task complete without evidence from codeloop_gate_check\n- Skip visual review (screenshots + video) for a project that has a user interface\n- Skip video capture \u2014 screenshots alone miss transitions, animations, and flow bugs\n- Skip the development log \u2014 codeloop_generate_dev_report MUST be called when the loop completes\n- Let a recording run idle \u2014 the video MUST show active interaction with every UI element\n- Ignore codeloop_verify results\n- Modify files outside the allowed_file_scope from repair tasks\n- Continue fixing after 8 failed repair attempts \u2014 escalate instead\n- Produce a video that only shows a static page \u2014 every interactive element must be exercised\n\n## Development lifecycle \u2014 complete workflow:\nEvery CodeLoop-powered development session follows this mandatory lifecycle:\n1. Implement \u2192 write/modify code\n2. Verify \u2192 codeloop_verify (tests, lint, build)\n3. Diagnose \u2192 codeloop_diagnose (if failures)\n4. Fix \u2192 repair confirmed issues only \u2192 LOOP BACK to step 2\n5. Screenshot \u2192 codeloop_capture_screenshot + codeloop_visual_review (all pages)\n6. Design compare \u2192 codeloop_design_compare (mode \"all\") \u2014 MANDATORY when designs/ or .codeloop/figma.json exist\n7. Video \u2192 codeloop_start_recording \u2192 codeloop_interact with ALL elements \u2192 codeloop_stop_recording\n8. Replay \u2192 codeloop_interaction_replay (analyze frames + logs)\n9. Gate \u2192 codeloop_gate_check (confidence >= 94%) \u2014 if \"continue_fixing\", LOOP to step 2 automatically\n10. Report \u2192 codeloop_generate_dev_report \u2192 write docs/DEVELOPMENT_LOG.md\n11. Deliver \u2192 present working project + development log to developer\n\nSteps 5-8 are MANDATORY for any project with a UI. Step 6 is MANDATORY whenever\nreferences exist. Step 10 is MANDATORY for every project.\nThe loop between steps 2-9 is AUTOMATIC. Do NOT ask the user between iterations.\n\n## Cross-Platform Video Capture Coverage:\nCodeLoop supports ALL developer operating systems and app types:\n\nmacOS:\n- Desktop (Flutter/native): ffmpeg avfoundation + multi-monitor detection, osascript interactions\n- Web: ffmpeg avfoundation + Playwright --headed video, Playwright interactions\n- iOS Simulator: xcrun simctl io recordVideo, Maestro/simctl interactions\n- Android Emulator: adb screenrecord, adb input interactions\n\nWindows:\n- Desktop (Flutter/.NET): ffmpeg gdigrab + window bounds, PowerShell user32.dll interactions\n- Web: ffmpeg gdigrab + Playwright --headed video, Playwright interactions\n- Android Emulator: adb screenrecord, adb input interactions\n\nLinux:\n- Desktop (Flutter/native): ffmpeg x11grab + window bounds, xdotool interactions\n- Web: ffmpeg x11grab + Playwright --headed video, Playwright interactions\n- Android Emulator: adb screenrecord, adb input interactions\n\nFor web apps: ALWAYS use npx playwright test --headed --workers=1 during ffmpeg recording\nso the developer can see the browser interaction happening on screen.\n";
|
|
1
|
+
export * from "@codelooptech/shared/templates/claude-agents";
|
|
5
2
|
//# sourceMappingURL=claude-agents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-agents.d.ts","sourceRoot":"","sources":["../../src/templates/claude-agents.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"claude-agents.d.ts","sourceRoot":"","sources":["../../src/templates/claude-agents.ts"],"names":[],"mappings":"AAAA,cAAc,8CAA8C,CAAC"}
|