codeloop 0.1.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/commands/configure.d.ts +2 -0
- package/dist/commands/configure.d.ts.map +1 -0
- package/dist/commands/configure.js +97 -0
- package/dist/commands/configure.js.map +1 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +241 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/login.d.ts +2 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +60 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/signup.d.ts +2 -0
- package/dist/commands/signup.d.ts.map +1 -0
- package/dist/commands/signup.js +62 -0
- package/dist/commands/signup.js.map +1 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +82 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/templates/claude-agents.d.ts +5 -0
- package/dist/templates/claude-agents.d.ts.map +1 -0
- package/dist/templates/claude-agents.js +59 -0
- package/dist/templates/claude-agents.js.map +1 -0
- package/dist/templates/claude-prompts.d.ts +4 -0
- package/dist/templates/claude-prompts.d.ts.map +1 -0
- package/dist/templates/claude-prompts.js +41 -0
- package/dist/templates/claude-prompts.js.map +1 -0
- package/dist/templates/config.d.ts +2 -0
- package/dist/templates/config.d.ts.map +1 -0
- package/dist/templates/config.js +32 -0
- package/dist/templates/config.js.map +1 -0
- package/dist/templates/cursor-rules.d.ts +7 -0
- package/dist/templates/cursor-rules.d.ts.map +1 -0
- package/dist/templates/cursor-rules.js +179 -0
- package/dist/templates/cursor-rules.js.map +1 -0
- package/dist/templates/cursor-skills.d.ts +5 -0
- package/dist/templates/cursor-skills.d.ts.map +1 -0
- package/dist/templates/cursor-skills.js +157 -0
- package/dist/templates/cursor-skills.js.map +1 -0
- package/dist/templates/mcp-config.d.ts +23 -0
- package/dist/templates/mcp-config.d.ts.map +1 -0
- package/dist/templates/mcp-config.js +23 -0
- package/dist/templates/mcp-config.js.map +1 -0
- package/dist/templates/specs.d.ts +4 -0
- package/dist/templates/specs.d.ts.map +1 -0
- package/dist/templates/specs.js +68 -0
- package/dist/templates/specs.js.map +1 -0
- package/dist/utils/api-client.d.ts +64 -0
- package/dist/utils/api-client.d.ts.map +1 -0
- package/dist/utils/api-client.js +66 -0
- package/dist/utils/api-client.js.map +1 -0
- package/dist/utils/detect-project.d.ts +6 -0
- package/dist/utils/detect-project.d.ts.map +1 -0
- package/dist/utils/detect-project.js +51 -0
- package/dist/utils/detect-project.js.map +1 -0
- package/dist/utils/file-writer.d.ts +3 -0
- package/dist/utils/file-writer.d.ts.map +1 -0
- package/dist/utils/file-writer.js +19 -0
- package/dist/utils/file-writer.js.map +1 -0
- package/dist/utils/key-storage.d.ts +5 -0
- package/dist/utils/key-storage.d.ts.map +1 -0
- package/dist/utils/key-storage.js +93 -0
- package/dist/utils/key-storage.js.map +1 -0
- package/dist/utils/ui.d.ts +7 -0
- package/dist/utils/ui.d.ts.map +1 -0
- package/dist/utils/ui.js +24 -0
- package/dist/utils/ui.js.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-config.d.ts","sourceRoot":"","sources":["../../src/templates/mcp-config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB;;;;;;;;;;CAU7B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;CAU7B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const CURSOR_MCP_CONFIG = {
|
|
2
|
+
mcpServers: {
|
|
3
|
+
codeloop: {
|
|
4
|
+
command: "npx",
|
|
5
|
+
args: ["-y", "codeloop-mcp-server"],
|
|
6
|
+
env: {
|
|
7
|
+
CODELOOP_API_KEY: "${CODELOOP_API_KEY}",
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
export const CLAUDE_MCP_CONFIG = {
|
|
13
|
+
mcpServers: {
|
|
14
|
+
codeloop: {
|
|
15
|
+
command: "npx",
|
|
16
|
+
args: ["-y", "codeloop-mcp-server"],
|
|
17
|
+
env: {
|
|
18
|
+
CODELOOP_API_KEY: "${CODELOOP_API_KEY}",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=mcp-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-config.js","sourceRoot":"","sources":["../../src/templates/mcp-config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,CAAC,IAAI,EAAE,qBAAqB,CAAC;YACnC,GAAG,EAAE;gBACH,gBAAgB,EAAE,qBAAqB;aACxC;SACF;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,CAAC,IAAI,EAAE,qBAAqB,CAAC;YACnC,GAAG,EAAE;gBACH,gBAAgB,EAAE,qBAAqB;aACxC;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const SPEC_TEMPLATE = "# Section: [Section Name]\n\n## Goal\n[What this section implements]\n\n## User Stories\n- As a [user type], I want to [action] so that [benefit]\n\n## Requirements\n- [ ] [Requirement 1]\n- [ ] [Requirement 2]\n- [ ] [Requirement 3]\n\n## UI/UX Notes\n[Design constraints, responsive behavior, states to handle]\n\n## Dependencies\n- Depends on: [list section IDs this depends on]\n- Shared services: [list any shared services this section uses or creates]\n\n## Out of Scope\n[What this section does NOT cover]\n";
|
|
2
|
+
export declare const ACCEPTANCE_TEMPLATE = "# Acceptance Criteria: [Section Name]\n\n## Functional Criteria\n- [ ] [Criterion 1 \u2014 what the section must do]\n- [ ] [Criterion 2]\n- [ ] [Criterion 3]\n\n## Non-Functional Criteria\n- [ ] Loading states appear for async operations\n- [ ] Error states are handled with user-friendly messages\n- [ ] Responsive on mobile and desktop viewports\n- [ ] No critical accessibility issues\n\n## Test Evidence Required\n- [ ] Unit tests pass for core logic\n- [ ] Integration tests pass for key flows\n- [ ] Screenshots captured at configured viewports\n- [ ] No runtime errors in logs\n";
|
|
3
|
+
export declare const UX_CHECKLIST_TEMPLATE = "# UX Checklist: [Section Name]\n\n## Visual Quality\n- [ ] Fonts render correctly at all sizes\n- [ ] Colors match design system tokens\n- [ ] Spacing is consistent with design grid\n- [ ] Icons are crisp and appropriately sized\n\n## Interaction\n- [ ] Buttons have hover and active states\n- [ ] Forms validate inline\n- [ ] Loading indicators appear for async actions\n- [ ] Error messages are clear and actionable\n\n## Responsiveness\n- [ ] Mobile (375px): layout adapts, no horizontal scroll\n- [ ] Tablet (768px): layout uses available space\n- [ ] Desktop (1440px): content is centered and readable\n\n## Accessibility\n- [ ] Color contrast meets WCAG AA\n- [ ] Touch targets are at least 44x44px\n- [ ] Interactive elements are keyboard-accessible\n- [ ] Screen reader labels are present\n";
|
|
4
|
+
//# sourceMappingURL=specs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specs.d.ts","sourceRoot":"","sources":["../../src/templates/specs.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,ugBAsBzB,CAAC;AAEF,eAAO,MAAM,mBAAmB,+kBAkB/B,CAAC;AAEF,eAAO,MAAM,qBAAqB,myBAwBjC,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export const SPEC_TEMPLATE = `# Section: [Section Name]
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
[What this section implements]
|
|
5
|
+
|
|
6
|
+
## User Stories
|
|
7
|
+
- As a [user type], I want to [action] so that [benefit]
|
|
8
|
+
|
|
9
|
+
## Requirements
|
|
10
|
+
- [ ] [Requirement 1]
|
|
11
|
+
- [ ] [Requirement 2]
|
|
12
|
+
- [ ] [Requirement 3]
|
|
13
|
+
|
|
14
|
+
## UI/UX Notes
|
|
15
|
+
[Design constraints, responsive behavior, states to handle]
|
|
16
|
+
|
|
17
|
+
## Dependencies
|
|
18
|
+
- Depends on: [list section IDs this depends on]
|
|
19
|
+
- Shared services: [list any shared services this section uses or creates]
|
|
20
|
+
|
|
21
|
+
## Out of Scope
|
|
22
|
+
[What this section does NOT cover]
|
|
23
|
+
`;
|
|
24
|
+
export const ACCEPTANCE_TEMPLATE = `# Acceptance Criteria: [Section Name]
|
|
25
|
+
|
|
26
|
+
## Functional Criteria
|
|
27
|
+
- [ ] [Criterion 1 — what the section must do]
|
|
28
|
+
- [ ] [Criterion 2]
|
|
29
|
+
- [ ] [Criterion 3]
|
|
30
|
+
|
|
31
|
+
## Non-Functional Criteria
|
|
32
|
+
- [ ] Loading states appear for async operations
|
|
33
|
+
- [ ] Error states are handled with user-friendly messages
|
|
34
|
+
- [ ] Responsive on mobile and desktop viewports
|
|
35
|
+
- [ ] No critical accessibility issues
|
|
36
|
+
|
|
37
|
+
## Test Evidence Required
|
|
38
|
+
- [ ] Unit tests pass for core logic
|
|
39
|
+
- [ ] Integration tests pass for key flows
|
|
40
|
+
- [ ] Screenshots captured at configured viewports
|
|
41
|
+
- [ ] No runtime errors in logs
|
|
42
|
+
`;
|
|
43
|
+
export const UX_CHECKLIST_TEMPLATE = `# UX Checklist: [Section Name]
|
|
44
|
+
|
|
45
|
+
## Visual Quality
|
|
46
|
+
- [ ] Fonts render correctly at all sizes
|
|
47
|
+
- [ ] Colors match design system tokens
|
|
48
|
+
- [ ] Spacing is consistent with design grid
|
|
49
|
+
- [ ] Icons are crisp and appropriately sized
|
|
50
|
+
|
|
51
|
+
## Interaction
|
|
52
|
+
- [ ] Buttons have hover and active states
|
|
53
|
+
- [ ] Forms validate inline
|
|
54
|
+
- [ ] Loading indicators appear for async actions
|
|
55
|
+
- [ ] Error messages are clear and actionable
|
|
56
|
+
|
|
57
|
+
## Responsiveness
|
|
58
|
+
- [ ] Mobile (375px): layout adapts, no horizontal scroll
|
|
59
|
+
- [ ] Tablet (768px): layout uses available space
|
|
60
|
+
- [ ] Desktop (1440px): content is centered and readable
|
|
61
|
+
|
|
62
|
+
## Accessibility
|
|
63
|
+
- [ ] Color contrast meets WCAG AA
|
|
64
|
+
- [ ] Touch targets are at least 44x44px
|
|
65
|
+
- [ ] Interactive elements are keyboard-accessible
|
|
66
|
+
- [ ] Screen reader labels are present
|
|
67
|
+
`;
|
|
68
|
+
//# sourceMappingURL=specs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specs.js","sourceRoot":"","sources":["../../src/templates/specs.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;CAsB5B,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;CAkBlC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;CAwBpC,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export interface SignupResponse {
|
|
2
|
+
user_id: string;
|
|
3
|
+
api_key: string;
|
|
4
|
+
trial_expires_at: string;
|
|
5
|
+
}
|
|
6
|
+
export interface LoginResponse {
|
|
7
|
+
token: string;
|
|
8
|
+
user: {
|
|
9
|
+
id: string;
|
|
10
|
+
email: string;
|
|
11
|
+
name: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface ApiKeyValidation {
|
|
15
|
+
valid: boolean;
|
|
16
|
+
status: "active" | "expired" | "over_limit" | "rate_limited" | "invalid";
|
|
17
|
+
plan: "trial" | "solo" | "team" | "enterprise";
|
|
18
|
+
usage: {
|
|
19
|
+
verification_runs: {
|
|
20
|
+
used: number;
|
|
21
|
+
limit: number;
|
|
22
|
+
};
|
|
23
|
+
visual_reviews: {
|
|
24
|
+
used: number;
|
|
25
|
+
limit: number;
|
|
26
|
+
};
|
|
27
|
+
design_comparisons: {
|
|
28
|
+
used: number;
|
|
29
|
+
limit: number;
|
|
30
|
+
};
|
|
31
|
+
recommendations: {
|
|
32
|
+
used: number;
|
|
33
|
+
limit: number;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
expires_at: string | null;
|
|
37
|
+
message?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface CreateKeyResponse {
|
|
40
|
+
api_key: string;
|
|
41
|
+
key_id: string;
|
|
42
|
+
}
|
|
43
|
+
export interface UsageSummary {
|
|
44
|
+
plan: string;
|
|
45
|
+
period: {
|
|
46
|
+
start: string;
|
|
47
|
+
end: string;
|
|
48
|
+
};
|
|
49
|
+
usage: Record<string, {
|
|
50
|
+
used: number;
|
|
51
|
+
limit: number;
|
|
52
|
+
}>;
|
|
53
|
+
}
|
|
54
|
+
export declare class ApiError extends Error {
|
|
55
|
+
status: number;
|
|
56
|
+
code: string;
|
|
57
|
+
constructor(message: string, status: number, code?: string);
|
|
58
|
+
}
|
|
59
|
+
export declare function signup(email: string, password: string, name: string): Promise<SignupResponse>;
|
|
60
|
+
export declare function login(email: string, password: string): Promise<LoginResponse>;
|
|
61
|
+
export declare function validateApiKey(apiKey: string): Promise<ApiKeyValidation>;
|
|
62
|
+
export declare function createKey(token: string, name?: string): Promise<CreateKeyResponse>;
|
|
63
|
+
export declare function getUsageSummary(token: string): Promise<UsageSummary>;
|
|
64
|
+
//# sourceMappingURL=api-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../../src/utils/api-client.ts"],"names":[],"mappings":"AAEA,MAAM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,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACxD;AAED,qBAAa,QAAS,SAAQ,KAAK;IAGxB,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,MAAM;gBAFnB,OAAO,EAAE,MAAM,EACR,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,MAAkB;CAKlC;AA8CD,wBAAsB,MAAM,CAC1B,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,cAAc,CAAC,CAKzB;AAED,wBAAsB,KAAK,CACzB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,aAAa,CAAC,CAKxB;AAED,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,gBAAgB,CAAC,CAM3B;AAED,wBAAsB,SAAS,CAC7B,KAAK,EAAE,MAAM,EACb,IAAI,GAAE,MAA4B,GACjC,OAAO,CAAC,iBAAiB,CAAC,CAM5B;AAED,wBAAsB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAE1E"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const BACKEND_URL = "https://api.codeloop.tech";
|
|
2
|
+
export class ApiError extends Error {
|
|
3
|
+
status;
|
|
4
|
+
code;
|
|
5
|
+
constructor(message, status, code = "UNKNOWN") {
|
|
6
|
+
super(message);
|
|
7
|
+
this.status = status;
|
|
8
|
+
this.code = code;
|
|
9
|
+
this.name = "ApiError";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
async function apiFetch(path, options = {}) {
|
|
13
|
+
const { method = "GET", body, token } = options;
|
|
14
|
+
const headers = {
|
|
15
|
+
"Content-Type": "application/json",
|
|
16
|
+
};
|
|
17
|
+
if (token) {
|
|
18
|
+
headers["Authorization"] = `Bearer ${token}`;
|
|
19
|
+
}
|
|
20
|
+
let response;
|
|
21
|
+
try {
|
|
22
|
+
response = await fetch(`${BACKEND_URL}${path}`, {
|
|
23
|
+
method,
|
|
24
|
+
headers,
|
|
25
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
throw new ApiError("Could not connect to CodeLoop servers. Check your internet connection.", 0, "NETWORK_ERROR");
|
|
30
|
+
}
|
|
31
|
+
const data = await response.json();
|
|
32
|
+
if (!response.ok) {
|
|
33
|
+
throw new ApiError(data.error || data.message || `Request failed (${response.status})`, response.status, data.code || "UNKNOWN");
|
|
34
|
+
}
|
|
35
|
+
return data;
|
|
36
|
+
}
|
|
37
|
+
export async function signup(email, password, name) {
|
|
38
|
+
return apiFetch("/v1/auth/signup", {
|
|
39
|
+
method: "POST",
|
|
40
|
+
body: { email, password, name },
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
export async function login(email, password) {
|
|
44
|
+
return apiFetch("/v1/auth/login", {
|
|
45
|
+
method: "POST",
|
|
46
|
+
body: { email, password },
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export async function validateApiKey(apiKey) {
|
|
50
|
+
return apiFetch("/v1/auth/validate", {
|
|
51
|
+
method: "POST",
|
|
52
|
+
token: apiKey,
|
|
53
|
+
body: { api_key: apiKey },
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
export async function createKey(token, name = "CLI-generated key") {
|
|
57
|
+
return apiFetch("/v1/keys", {
|
|
58
|
+
method: "POST",
|
|
59
|
+
token,
|
|
60
|
+
body: { name },
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
export async function getUsageSummary(token) {
|
|
64
|
+
return apiFetch("/v1/usage/summary", { token });
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=api-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../../src/utils/api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SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC/C,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,wBAAgB,aAAa,CAAC,GAAG,GAAE,MAAsB,GAAG,WAAW,CAmDtE"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "fs";
|
|
2
|
+
import { join } from "path";
|
|
3
|
+
export function detectProject(cwd = process.cwd()) {
|
|
4
|
+
const frameworks = [];
|
|
5
|
+
if (existsSync(join(cwd, "pubspec.yaml"))) {
|
|
6
|
+
frameworks.push("Flutter");
|
|
7
|
+
return { type: "flutter", frameworks };
|
|
8
|
+
}
|
|
9
|
+
const pkgPath = join(cwd, "package.json");
|
|
10
|
+
if (existsSync(pkgPath)) {
|
|
11
|
+
try {
|
|
12
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
13
|
+
const allDeps = {
|
|
14
|
+
...pkg.dependencies,
|
|
15
|
+
...pkg.devDependencies,
|
|
16
|
+
};
|
|
17
|
+
if (allDeps["next"])
|
|
18
|
+
frameworks.push("Next.js");
|
|
19
|
+
if (allDeps["react"] && !allDeps["next"])
|
|
20
|
+
frameworks.push("React");
|
|
21
|
+
if (allDeps["vue"])
|
|
22
|
+
frameworks.push("Vue");
|
|
23
|
+
if (allDeps["svelte"] || allDeps["@sveltejs/kit"])
|
|
24
|
+
frameworks.push("Svelte");
|
|
25
|
+
if (allDeps["@angular/core"])
|
|
26
|
+
frameworks.push("Angular");
|
|
27
|
+
if (allDeps["react-native"]) {
|
|
28
|
+
frameworks.push("React Native");
|
|
29
|
+
return { type: "mobile", frameworks };
|
|
30
|
+
}
|
|
31
|
+
if (frameworks.length > 0) {
|
|
32
|
+
return { type: "web", frameworks };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
// Invalid package.json
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (existsSync(join(cwd, "Podfile")) ||
|
|
40
|
+
existsSync(join(cwd, "build.gradle")) ||
|
|
41
|
+
existsSync(join(cwd, "build.gradle.kts"))) {
|
|
42
|
+
if (existsSync(join(cwd, "Podfile")))
|
|
43
|
+
frameworks.push("iOS (CocoaPods)");
|
|
44
|
+
if (existsSync(join(cwd, "build.gradle")) ||
|
|
45
|
+
existsSync(join(cwd, "build.gradle.kts")))
|
|
46
|
+
frameworks.push("Android (Gradle)");
|
|
47
|
+
return { type: "mobile", frameworks };
|
|
48
|
+
}
|
|
49
|
+
return { type: "unknown", frameworks };
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=detect-project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-project.js","sourceRoot":"","sources":["../../src/utils/detect-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAO5B,MAAM,UAAU,aAAa,CAAC,MAAc,OAAO,CAAC,GAAG,EAAE;IACvD,MAAM,UAAU,GAAa,EAAE,CAAC;IAEhC,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC;QAC1C,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC3B,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;IACzC,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IAC1C,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;YACvD,MAAM,OAAO,GAAG;gBACd,GAAG,GAAG,CAAC,YAAY;gBACnB,GAAG,GAAG,CAAC,eAAe;aACvB,CAAC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,CAAC,CAAC;YACrC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;YAEzC,UAAU,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QACtC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;IACxC,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-writer.d.ts","sourceRoot":"","sources":["../../src/utils/file-writer.ts"],"names":[],"mappings":"AAGA,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,OAAe,GACrB,OAAO,CAAC,OAAO,CAAC,CAYlB;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAI/C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, writeFileSync } from "fs";
|
|
2
|
+
import { dirname } from "path";
|
|
3
|
+
export async function writeFileSafe(filePath, content, force = false) {
|
|
4
|
+
const dir = dirname(filePath);
|
|
5
|
+
if (!existsSync(dir)) {
|
|
6
|
+
mkdirSync(dir, { recursive: true });
|
|
7
|
+
}
|
|
8
|
+
if (existsSync(filePath) && !force) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
writeFileSync(filePath, content, "utf-8");
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
export function ensureDir(dirPath) {
|
|
15
|
+
if (!existsSync(dirPath)) {
|
|
16
|
+
mkdirSync(dirPath, { recursive: true });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=file-writer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-writer.js","sourceRoot":"","sources":["../../src/utils/file-writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,QAAgB,EAChB,OAAe,EACf,QAAiB,KAAK;IAEtB,MAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC9B,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACrB,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QACnC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1C,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,OAAe;IACvC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACzB,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function findApiKey(cwd?: string): string | null;
|
|
2
|
+
export declare function saveToShellProfile(apiKey: string): string;
|
|
3
|
+
export declare function saveToConfig(apiKey: string, cwd?: string): Promise<string>;
|
|
4
|
+
export declare function promptSaveLocation(apiKey: string): Promise<void>;
|
|
5
|
+
//# sourceMappingURL=key-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key-storage.d.ts","sourceRoot":"","sources":["../../src/utils/key-storage.ts"],"names":[],"mappings":"AAMA,wBAAgB,UAAU,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM,GAAG,IAAI,CAkBrE;AAYD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAkBzD;AAED,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,GAAG,GAAE,MAAsB,GAC1B,OAAO,CAAC,MAAM,CAAC,CAejB;AAED,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkCtE"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { existsSync, readFileSync, writeFileSync, appendFileSync } from "fs";
|
|
2
|
+
import { join } from "path";
|
|
3
|
+
import { homedir } from "os";
|
|
4
|
+
import { select } from "@inquirer/prompts";
|
|
5
|
+
import { writeFileSafe } from "./file-writer.js";
|
|
6
|
+
export function findApiKey(cwd = process.cwd()) {
|
|
7
|
+
if (process.env.CODELOOP_API_KEY) {
|
|
8
|
+
return process.env.CODELOOP_API_KEY.trim();
|
|
9
|
+
}
|
|
10
|
+
const configPath = join(cwd, ".codeloop", "config.json");
|
|
11
|
+
if (existsSync(configPath)) {
|
|
12
|
+
try {
|
|
13
|
+
const config = JSON.parse(readFileSync(configPath, "utf-8"));
|
|
14
|
+
if (config.api_key && config.api_key.trim() !== "") {
|
|
15
|
+
return config.api_key.trim();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
// Invalid config
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
function detectShellProfile() {
|
|
25
|
+
const home = homedir();
|
|
26
|
+
const candidates = [".zshrc", ".bashrc", ".bash_profile"];
|
|
27
|
+
for (const name of candidates) {
|
|
28
|
+
const path = join(home, name);
|
|
29
|
+
if (existsSync(path))
|
|
30
|
+
return path;
|
|
31
|
+
}
|
|
32
|
+
return join(home, ".zshrc");
|
|
33
|
+
}
|
|
34
|
+
export function saveToShellProfile(apiKey) {
|
|
35
|
+
const profilePath = detectShellProfile();
|
|
36
|
+
const exportLine = `\nexport CODELOOP_API_KEY="${apiKey}"\n`;
|
|
37
|
+
if (existsSync(profilePath)) {
|
|
38
|
+
const content = readFileSync(profilePath, "utf-8");
|
|
39
|
+
if (content.includes("CODELOOP_API_KEY")) {
|
|
40
|
+
const updated = content.replace(/export CODELOOP_API_KEY="[^"]*"/, `export CODELOOP_API_KEY="${apiKey}"`);
|
|
41
|
+
writeFileSync(profilePath, updated, "utf-8");
|
|
42
|
+
return profilePath;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
appendFileSync(profilePath, exportLine, "utf-8");
|
|
46
|
+
return profilePath;
|
|
47
|
+
}
|
|
48
|
+
export async function saveToConfig(apiKey, cwd = process.cwd()) {
|
|
49
|
+
const configPath = join(cwd, ".codeloop", "config.json");
|
|
50
|
+
let config = {};
|
|
51
|
+
if (existsSync(configPath)) {
|
|
52
|
+
try {
|
|
53
|
+
config = JSON.parse(readFileSync(configPath, "utf-8"));
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
// Start fresh
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
config.api_key = apiKey;
|
|
60
|
+
await writeFileSafe(configPath, JSON.stringify(config, null, 2) + "\n", true);
|
|
61
|
+
return configPath;
|
|
62
|
+
}
|
|
63
|
+
export async function promptSaveLocation(apiKey) {
|
|
64
|
+
const choice = await select({
|
|
65
|
+
message: "Where to save the API key?",
|
|
66
|
+
choices: [
|
|
67
|
+
{
|
|
68
|
+
name: `Shell profile (~/${detectShellProfile().split("/").pop()})`,
|
|
69
|
+
value: "shell",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: ".codeloop/config.json (this project only)",
|
|
73
|
+
value: "config",
|
|
74
|
+
},
|
|
75
|
+
{ name: "Both", value: "both" },
|
|
76
|
+
{ name: "Skip (I'll configure it manually)", value: "skip" },
|
|
77
|
+
],
|
|
78
|
+
});
|
|
79
|
+
if (choice === "shell" || choice === "both") {
|
|
80
|
+
const profilePath = saveToShellProfile(apiKey);
|
|
81
|
+
const profileName = profilePath.split("/").pop();
|
|
82
|
+
console.log(` Added to ~/${profileName}`);
|
|
83
|
+
console.log(` Run: source ~/${profileName} (or restart your terminal)\n`);
|
|
84
|
+
}
|
|
85
|
+
if (choice === "config" || choice === "both") {
|
|
86
|
+
await saveToConfig(apiKey);
|
|
87
|
+
console.log(" Saved to .codeloop/config.json\n");
|
|
88
|
+
}
|
|
89
|
+
if (choice === "skip") {
|
|
90
|
+
console.log(' Set it manually: export CODELOOP_API_KEY="' + apiKey + '"\n');
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=key-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key-storage.js","sourceRoot":"","sources":["../../src/utils/key-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,UAAU,UAAU,CAAC,MAAc,OAAO,CAAC,GAAG,EAAE;IACpD,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;QACjC,OAAO,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;IAC7C,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;IACzD,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;YAC7D,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM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C,MAAM,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;QACjD,OAAO,CAAC,GAAG,CAAC,gBAAgB,WAAW,EAAE,CAAC,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,mBAAmB,WAAW,+BAA+B,CAAC,CAAC;IAC7E,CAAC;IAED,IAAI,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QAC7C,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;IACpD,CAAC;IAED,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,OAAO,CAAC,GAAG,CACT,8CAA8C,GAAG,MAAM,GAAG,KAAK,CAChE,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function printBox(title: string): void;
|
|
2
|
+
export declare function printSuccess(msg: string): void;
|
|
3
|
+
export declare function printError(msg: string): void;
|
|
4
|
+
export declare function printWarning(msg: string): void;
|
|
5
|
+
export declare function printApiKey(apiKey: string): void;
|
|
6
|
+
export declare function printInfo(msg: string): void;
|
|
7
|
+
//# sourceMappingURL=ui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/utils/ui.ts"],"names":[],"mappings":"AAEA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAK5C;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE9C;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE5C;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE9C;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAKhD;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE3C"}
|
package/dist/utils/ui.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
export function printBox(title) {
|
|
3
|
+
const line = "─".repeat(title.length + 6);
|
|
4
|
+
console.log(`\n ┌${line}┐`);
|
|
5
|
+
console.log(` │ ${chalk.bold(title)} │`);
|
|
6
|
+
console.log(` └${line}┘\n`);
|
|
7
|
+
}
|
|
8
|
+
export function printSuccess(msg) {
|
|
9
|
+
console.log(` ${chalk.green("✓")} ${msg}`);
|
|
10
|
+
}
|
|
11
|
+
export function printError(msg) {
|
|
12
|
+
console.log(` ${chalk.red("✗")} ${msg}`);
|
|
13
|
+
}
|
|
14
|
+
export function printWarning(msg) {
|
|
15
|
+
console.log(` ${chalk.yellow("⚠")} ${msg}`);
|
|
16
|
+
}
|
|
17
|
+
export function printApiKey(apiKey) {
|
|
18
|
+
console.log(`\n Your API key ${chalk.dim("(shown ONCE — copy it now)")}:\n`);
|
|
19
|
+
console.log(` ${chalk.cyan.bold(apiKey)}\n`);
|
|
20
|
+
}
|
|
21
|
+
export function printInfo(msg) {
|
|
22
|
+
console.log(` ${chalk.blue("ℹ")} ${msg}`);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=ui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/utils/ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,UAAU,QAAQ,CAAC,KAAa;IACpC,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC1C,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,CAAC;IAC7B,OAAO,CAAC,GAAG,CAAC,SAAS,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,MAAc;IACxC,OAAO,CAAC,GAAG,CACT,oBAAoB,KAAK,CAAC,GAAG,CAAC,4BAA4B,CAAC,KAAK,CACjE,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;AAC7C,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "codeloop",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CLI tool for CodeLoop — automated verification for AI coding agents",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"codeloop": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"dev": "tsc --watch",
|
|
17
|
+
"test": "vitest run",
|
|
18
|
+
"lint": "tsc --noEmit && eslint src/",
|
|
19
|
+
"prepublishOnly": "npm run build"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"codeloop",
|
|
23
|
+
"mcp",
|
|
24
|
+
"cursor",
|
|
25
|
+
"claude-code",
|
|
26
|
+
"testing",
|
|
27
|
+
"verification",
|
|
28
|
+
"ai-coding",
|
|
29
|
+
"cli"
|
|
30
|
+
],
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"commander": "^13.1.0",
|
|
34
|
+
"@inquirer/prompts": "^7.5.0",
|
|
35
|
+
"chalk": "^5.4.1",
|
|
36
|
+
"ora": "^8.2.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"typescript": "^5.8.3",
|
|
40
|
+
"@types/node": "^22.15.3",
|
|
41
|
+
"vitest": "^3.1.2"
|
|
42
|
+
}
|
|
43
|
+
}
|