@kenkaiiii/ggcoder 4.3.61 → 4.3.63
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/cli.js +32 -3
- package/dist/cli.js.map +1 -1
- package/dist/core/pixel-fix-agent.d.ts +24 -0
- package/dist/core/pixel-fix-agent.d.ts.map +1 -0
- package/dist/core/pixel-fix-agent.js +49 -0
- package/dist/core/pixel-fix-agent.js.map +1 -0
- package/dist/core/pixel-fix.d.ts.map +1 -1
- package/dist/core/pixel-fix.js +2 -12
- package/dist/core/pixel-fix.js.map +1 -1
- package/dist/core/pixel.d.ts +19 -0
- package/dist/core/pixel.d.ts.map +1 -1
- package/dist/core/pixel.js +118 -4
- package/dist/core/pixel.js.map +1 -1
- package/dist/core/pixel.test.js +69 -1
- package/dist/core/pixel.test.js.map +1 -1
- package/dist/ui/pixel.d.ts +17 -0
- package/dist/ui/pixel.d.ts.map +1 -0
- package/dist/ui/pixel.js +210 -0
- package/dist/ui/pixel.js.map +1 -0
- package/dist/ui/pixel.test.d.ts +2 -0
- package/dist/ui/pixel.test.d.ts.map +1 -0
- package/dist/ui/pixel.test.js +127 -0
- package/dist/ui/pixel.test.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { renderScreen } from "./pixel.js";
|
|
3
|
+
function strip(s) {
|
|
4
|
+
// Strip ANSI escape sequences for assertion readability.
|
|
5
|
+
// eslint-disable-next-line no-control-regex
|
|
6
|
+
return s.replace(/\[[0-9;]*m/g, "");
|
|
7
|
+
}
|
|
8
|
+
const empty = { entries: [], unreachable: [], hasProjects: false };
|
|
9
|
+
const noErrors = {
|
|
10
|
+
entries: [],
|
|
11
|
+
unreachable: [],
|
|
12
|
+
hasProjects: true,
|
|
13
|
+
};
|
|
14
|
+
const mixed = {
|
|
15
|
+
hasProjects: true,
|
|
16
|
+
unreachable: [],
|
|
17
|
+
entries: [
|
|
18
|
+
{
|
|
19
|
+
errorId: "err_1",
|
|
20
|
+
projectId: "proj_a",
|
|
21
|
+
projectName: "alpha",
|
|
22
|
+
projectPath: "/p/a",
|
|
23
|
+
status: "open",
|
|
24
|
+
type: "TypeError",
|
|
25
|
+
message: "Cannot read 'name' of undefined",
|
|
26
|
+
occurrences: 47,
|
|
27
|
+
recurrenceCount: 0,
|
|
28
|
+
location: "/p/a/src/UserCard.tsx:42",
|
|
29
|
+
branch: null,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
errorId: "err_2",
|
|
33
|
+
projectId: "proj_a",
|
|
34
|
+
projectName: "alpha",
|
|
35
|
+
projectPath: "/p/a",
|
|
36
|
+
status: "awaiting_review",
|
|
37
|
+
type: "RangeError",
|
|
38
|
+
message: "Bad index",
|
|
39
|
+
occurrences: 1,
|
|
40
|
+
recurrenceCount: 2,
|
|
41
|
+
location: "/p/a/src/api.ts:7",
|
|
42
|
+
branch: "fix/pixel-err_2",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
errorId: "err_3",
|
|
46
|
+
projectId: "proj_b",
|
|
47
|
+
projectName: "beta",
|
|
48
|
+
projectPath: "/p/b",
|
|
49
|
+
status: "failed",
|
|
50
|
+
type: "SyntaxError",
|
|
51
|
+
message: "Unexpected token",
|
|
52
|
+
occurrences: 3,
|
|
53
|
+
recurrenceCount: 0,
|
|
54
|
+
location: "/p/b/src/parse.ts:18",
|
|
55
|
+
branch: null,
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
};
|
|
59
|
+
describe("renderScreen", () => {
|
|
60
|
+
it("renders the standard ggcoder banner with the 'Pixel' label", () => {
|
|
61
|
+
const out = strip(renderScreen(empty, 0));
|
|
62
|
+
expect(out).toContain("GG Coder");
|
|
63
|
+
expect(out).toContain("Pixel");
|
|
64
|
+
expect(out).toContain("By Ken Kai");
|
|
65
|
+
});
|
|
66
|
+
it("shows the install hint when no projects are registered", () => {
|
|
67
|
+
const out = strip(renderScreen(empty, 0));
|
|
68
|
+
expect(out).toContain("No projects registered");
|
|
69
|
+
expect(out).toContain("ggcoder pixel install");
|
|
70
|
+
});
|
|
71
|
+
it("shows a clean-state message when projects exist but no errors", () => {
|
|
72
|
+
const out = strip(renderScreen(noErrors, 0));
|
|
73
|
+
expect(out).toContain("No open errors");
|
|
74
|
+
});
|
|
75
|
+
it("renders project headers and rows with status badges", () => {
|
|
76
|
+
const out = strip(renderScreen(mixed, 0));
|
|
77
|
+
expect(out).toContain("alpha");
|
|
78
|
+
expect(out).toContain("beta");
|
|
79
|
+
expect(out).toContain("OPEN");
|
|
80
|
+
expect(out).toContain("REVIEW");
|
|
81
|
+
expect(out).toContain("FAILED");
|
|
82
|
+
expect(out).toContain("TypeError");
|
|
83
|
+
expect(out).toContain("/p/a/src/UserCard.tsx:42");
|
|
84
|
+
});
|
|
85
|
+
it("marks the selected row with the ❯ chevron", () => {
|
|
86
|
+
const out0 = strip(renderScreen(mixed, 0));
|
|
87
|
+
const out2 = strip(renderScreen(mixed, 2));
|
|
88
|
+
expect(out0.split("\n").find((l) => l.includes("TypeError"))).toContain("❯");
|
|
89
|
+
expect(out2.split("\n").find((l) => l.includes("SyntaxError"))).toContain("❯");
|
|
90
|
+
});
|
|
91
|
+
it("includes occurrence count and recurrence indicator", () => {
|
|
92
|
+
const out = strip(renderScreen(mixed, 0));
|
|
93
|
+
expect(out).toContain("×47");
|
|
94
|
+
expect(out).toContain("↻2"); // recurrence on err_2
|
|
95
|
+
});
|
|
96
|
+
it("shows footer with nav hints when entries exist", () => {
|
|
97
|
+
const out = strip(renderScreen(mixed, 0));
|
|
98
|
+
expect(out).toContain("↑↓ navigate");
|
|
99
|
+
expect(out).toContain("Enter fix");
|
|
100
|
+
expect(out).toContain("Esc close");
|
|
101
|
+
});
|
|
102
|
+
it("shows only Esc-close hint when no entries", () => {
|
|
103
|
+
const out = strip(renderScreen(noErrors, 0));
|
|
104
|
+
expect(out).toContain("Esc close");
|
|
105
|
+
expect(out).not.toContain("Enter fix");
|
|
106
|
+
});
|
|
107
|
+
it("flags unreachable backends with a red bullet", () => {
|
|
108
|
+
const data = {
|
|
109
|
+
hasProjects: true,
|
|
110
|
+
entries: [],
|
|
111
|
+
unreachable: ["client-x"],
|
|
112
|
+
};
|
|
113
|
+
const out = strip(renderScreen(data, 0));
|
|
114
|
+
expect(out).toContain("✗ client-x: backend unreachable");
|
|
115
|
+
});
|
|
116
|
+
it("groups errors by project — alpha rows precede beta rows", () => {
|
|
117
|
+
const out = strip(renderScreen(mixed, 0));
|
|
118
|
+
const alphaIdx = out.indexOf("alpha");
|
|
119
|
+
const betaIdx = out.indexOf("beta");
|
|
120
|
+
const typeErrIdx = out.indexOf("TypeError");
|
|
121
|
+
const syntaxErrIdx = out.indexOf("SyntaxError");
|
|
122
|
+
expect(alphaIdx).toBeLessThan(typeErrIdx);
|
|
123
|
+
expect(typeErrIdx).toBeLessThan(betaIdx);
|
|
124
|
+
expect(betaIdx).toBeLessThan(syntaxErrIdx);
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
//# sourceMappingURL=pixel.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pixel.test.js","sourceRoot":"","sources":["../../src/ui/pixel.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1C,SAAS,KAAK,CAAC,CAAS;IACtB,yDAAyD;IACzD,4CAA4C;IAC5C,OAAO,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,KAAK,GAAqB,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;AAErF,MAAM,QAAQ,GAAqB;IACjC,OAAO,EAAE,EAAE;IACX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QAC1C,MAAM,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACzC,MAAM,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kenkaiiii/ggcoder",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.63",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI coding agent with OAuth authentication for Anthropic and OpenAI",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"string-width": "^8.2.0",
|
|
38
38
|
"wrap-ansi": "^10.0.0",
|
|
39
39
|
"zod": "^4.3.6",
|
|
40
|
-
"@kenkaiiii/gg-
|
|
41
|
-
"@kenkaiiii/gg-pixel": "4.3.61",
|
|
40
|
+
"@kenkaiiii/gg-ai": "4.3.63",
|
|
42
41
|
"@kenkaiiii/ggcoder-eyes": "0.1.2",
|
|
43
|
-
"@kenkaiiii/gg-
|
|
42
|
+
"@kenkaiiii/gg-agent": "4.3.63",
|
|
43
|
+
"@kenkaiiii/gg-pixel": "4.3.63"
|
|
44
44
|
},
|
|
45
45
|
"optionalDependencies": {
|
|
46
46
|
"@huggingface/transformers": "^3.6.0",
|