@kenkaiiii/ggcoder 0.0.3 → 1.0.4
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 +153 -31
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +5 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/agents.d.ts +32 -0
- package/dist/core/agents.d.ts.map +1 -0
- package/dist/core/agents.js +95 -0
- package/dist/core/agents.js.map +1 -0
- package/dist/core/compaction/compactor.d.ts +7 -0
- package/dist/core/compaction/compactor.d.ts.map +1 -1
- package/dist/core/compaction/compactor.js +32 -1
- package/dist/core/compaction/compactor.js.map +1 -1
- package/dist/core/compaction/compactor.test.d.ts +2 -0
- package/dist/core/compaction/compactor.test.d.ts.map +1 -0
- package/dist/core/compaction/compactor.test.js +116 -0
- package/dist/core/compaction/compactor.test.js.map +1 -0
- package/dist/core/compaction/token-estimator.test.d.ts +2 -0
- package/dist/core/compaction/token-estimator.test.d.ts.map +1 -0
- package/dist/core/compaction/token-estimator.test.js +115 -0
- package/dist/core/compaction/token-estimator.test.js.map +1 -0
- package/dist/core/event-bus.d.ts +14 -0
- package/dist/core/event-bus.d.ts.map +1 -1
- package/dist/core/event-bus.js +20 -0
- package/dist/core/event-bus.js.map +1 -1
- package/dist/modes/json-mode.d.ts +13 -0
- package/dist/modes/json-mode.d.ts.map +1 -0
- package/dist/modes/json-mode.js +70 -0
- package/dist/modes/json-mode.js.map +1 -0
- package/dist/tools/index.d.ts +8 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +10 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/subagent.d.ts +26 -0
- package/dist/tools/subagent.d.ts.map +1 -0
- package/dist/tools/subagent.js +163 -0
- package/dist/tools/subagent.js.map +1 -0
- package/dist/tools/truncate.test.d.ts +2 -0
- package/dist/tools/truncate.test.d.ts.map +1 -0
- package/dist/tools/truncate.test.js +100 -0
- package/dist/tools/truncate.test.js.map +1 -0
- package/dist/tools/web-fetch.d.ts +9 -0
- package/dist/tools/web-fetch.d.ts.map +1 -0
- package/dist/tools/web-fetch.js +50 -0
- package/dist/tools/web-fetch.js.map +1 -0
- package/dist/tools/write.test.d.ts +2 -0
- package/dist/tools/write.test.d.ts.map +1 -0
- package/dist/tools/write.test.js +84 -0
- package/dist/tools/write.test.js.map +1 -0
- package/dist/ui/App.d.ts +82 -1
- package/dist/ui/App.d.ts.map +1 -1
- package/dist/ui/App.js +209 -28
- package/dist/ui/App.js.map +1 -1
- package/dist/ui/components/ActivityIndicator.d.ts +12 -0
- package/dist/ui/components/ActivityIndicator.d.ts.map +1 -0
- package/dist/ui/components/ActivityIndicator.js +243 -0
- package/dist/ui/components/ActivityIndicator.js.map +1 -0
- package/dist/ui/components/AssistantMessage.js +1 -1
- package/dist/ui/components/AssistantMessage.js.map +1 -1
- package/dist/ui/components/Banner.d.ts +10 -0
- package/dist/ui/components/Banner.d.ts.map +1 -0
- package/dist/ui/components/Banner.js +34 -0
- package/dist/ui/components/Banner.js.map +1 -0
- package/dist/ui/components/Markdown.d.ts.map +1 -1
- package/dist/ui/components/Markdown.js +14 -9
- package/dist/ui/components/Markdown.js.map +1 -1
- package/dist/ui/components/ModelSelector.d.ts +5 -1
- package/dist/ui/components/ModelSelector.d.ts.map +1 -1
- package/dist/ui/components/ModelSelector.js +14 -8
- package/dist/ui/components/ModelSelector.js.map +1 -1
- package/dist/ui/components/ScrollableContent.d.ts +22 -0
- package/dist/ui/components/ScrollableContent.d.ts.map +1 -0
- package/dist/ui/components/ScrollableContent.js +44 -0
- package/dist/ui/components/ScrollableContent.js.map +1 -0
- package/dist/ui/components/SelectList.d.ts +2 -1
- package/dist/ui/components/SelectList.d.ts.map +1 -1
- package/dist/ui/components/SelectList.js +2 -2
- package/dist/ui/components/SelectList.js.map +1 -1
- package/dist/ui/components/ServerToolExecution.d.ts +16 -0
- package/dist/ui/components/ServerToolExecution.d.ts.map +1 -0
- package/dist/ui/components/ServerToolExecution.js +51 -0
- package/dist/ui/components/ServerToolExecution.js.map +1 -0
- package/dist/ui/components/StreamingArea.d.ts +1 -4
- package/dist/ui/components/StreamingArea.d.ts.map +1 -1
- package/dist/ui/components/StreamingArea.js +2 -42
- package/dist/ui/components/StreamingArea.js.map +1 -1
- package/dist/ui/components/SubAgentPanel.d.ts +22 -0
- package/dist/ui/components/SubAgentPanel.d.ts.map +1 -0
- package/dist/ui/components/SubAgentPanel.js +47 -0
- package/dist/ui/components/SubAgentPanel.js.map +1 -0
- package/dist/ui/components/ToolExecution.d.ts.map +1 -1
- package/dist/ui/components/ToolExecution.js +88 -11
- package/dist/ui/components/ToolExecution.js.map +1 -1
- package/dist/ui/hooks/useAgentLoop.d.ts +17 -2
- package/dist/ui/hooks/useAgentLoop.d.ts.map +1 -1
- package/dist/ui/hooks/useAgentLoop.js +133 -7
- package/dist/ui/hooks/useAgentLoop.js.map +1 -1
- package/dist/ui/hooks/useMouseScroll.d.ts.map +1 -0
- package/dist/ui/hooks/useMouseScroll.js.map +1 -0
- package/dist/ui/hooks/useScrollViewport.d.ts +25 -0
- package/dist/ui/hooks/useScrollViewport.d.ts.map +1 -0
- package/dist/ui/hooks/useScrollViewport.js +32 -0
- package/dist/ui/hooks/useScrollViewport.js.map +1 -0
- package/dist/ui/login.d.ts +3 -0
- package/dist/ui/login.d.ts.map +1 -0
- package/dist/ui/login.js +90 -0
- package/dist/ui/login.js.map +1 -0
- package/dist/ui/render.d.ts +12 -1
- package/dist/ui/render.d.ts.map +1 -1
- package/dist/ui/render.js +7 -0
- package/dist/ui/render.js.map +1 -1
- package/dist/ui/utils/highlight.d.ts +8 -0
- package/dist/ui/utils/highlight.d.ts.map +1 -0
- package/dist/ui/utils/highlight.js +49 -0
- package/dist/ui/utils/highlight.js.map +1 -0
- package/dist/ui/utils/item-heights.d.ts +17 -0
- package/dist/ui/utils/item-heights.d.ts.map +1 -0
- package/dist/ui/utils/item-heights.js +73 -0
- package/dist/ui/utils/item-heights.js.map +1 -0
- package/package.json +6 -4
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CompletedItem } from "../App.js";
|
|
2
|
+
/**
|
|
3
|
+
* Estimate the number of terminal lines a text string occupies
|
|
4
|
+
* when rendered into a given width.
|
|
5
|
+
*/
|
|
6
|
+
export declare function estimateWrappedLines(text: string, width: number): number;
|
|
7
|
+
/**
|
|
8
|
+
* Estimate the terminal height (in lines) of a completed item.
|
|
9
|
+
* Doesn't need to be pixel-perfect — close enough for viewport slicing.
|
|
10
|
+
*/
|
|
11
|
+
export declare function estimateItemHeight(item: CompletedItem, terminalWidth: number): number;
|
|
12
|
+
/**
|
|
13
|
+
* Compute cumulative heights for an array of items.
|
|
14
|
+
* Returns an array where cumulativeHeights[i] = total height of items[0..i].
|
|
15
|
+
*/
|
|
16
|
+
export declare function computeCumulativeHeights(items: CompletedItem[], terminalWidth: number): number[];
|
|
17
|
+
//# sourceMappingURL=item-heights.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-heights.d.ts","sourceRoot":"","sources":["../../../src/ui/utils/item-heights.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQxE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CA+CrF;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE,CAQhG"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estimate the number of terminal lines a text string occupies
|
|
3
|
+
* when rendered into a given width.
|
|
4
|
+
*/
|
|
5
|
+
export function estimateWrappedLines(text, width) {
|
|
6
|
+
if (!text || width <= 0)
|
|
7
|
+
return 1;
|
|
8
|
+
let total = 0;
|
|
9
|
+
const hardLines = text.split("\n");
|
|
10
|
+
for (const line of hardLines) {
|
|
11
|
+
total += Math.max(1, Math.ceil((line.length + 1) / width));
|
|
12
|
+
}
|
|
13
|
+
return total;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Estimate the terminal height (in lines) of a completed item.
|
|
17
|
+
* Doesn't need to be pixel-perfect — close enough for viewport slicing.
|
|
18
|
+
*/
|
|
19
|
+
export function estimateItemHeight(item, terminalWidth) {
|
|
20
|
+
// Content width accounting for margins/padding/prefixes
|
|
21
|
+
const contentWidth = Math.max(terminalWidth - 6, 20);
|
|
22
|
+
switch (item.kind) {
|
|
23
|
+
case "banner":
|
|
24
|
+
return 5;
|
|
25
|
+
case "user":
|
|
26
|
+
// marginTop(1) + prompt line(s)
|
|
27
|
+
return 1 + estimateWrappedLines(item.text, contentWidth);
|
|
28
|
+
case "assistant": {
|
|
29
|
+
// marginTop(1) + prefix + text lines
|
|
30
|
+
let h = 1;
|
|
31
|
+
if (item.thinking)
|
|
32
|
+
h += Math.min(estimateWrappedLines(item.thinking, contentWidth), 4);
|
|
33
|
+
if (item.text)
|
|
34
|
+
h += estimateWrappedLines(item.text, contentWidth);
|
|
35
|
+
return Math.max(h, 2);
|
|
36
|
+
}
|
|
37
|
+
case "tool_start":
|
|
38
|
+
// marginTop(1) + spinner line
|
|
39
|
+
return 2;
|
|
40
|
+
case "tool_done": {
|
|
41
|
+
// marginTop(1) + header + body (2-8 lines typically)
|
|
42
|
+
const resultLines = item.result ? item.result.split("\n").length : 0;
|
|
43
|
+
const bodyLines = Math.min(resultLines, 8);
|
|
44
|
+
return 2 + bodyLines;
|
|
45
|
+
}
|
|
46
|
+
case "error":
|
|
47
|
+
// marginTop(1) + error text
|
|
48
|
+
return 1 + estimateWrappedLines(item.message, contentWidth);
|
|
49
|
+
case "info":
|
|
50
|
+
// marginTop(1) + info text
|
|
51
|
+
return 1 + estimateWrappedLines(item.text, contentWidth);
|
|
52
|
+
case "duration":
|
|
53
|
+
// marginTop(1) + duration line
|
|
54
|
+
return 2;
|
|
55
|
+
case "subagent_group":
|
|
56
|
+
// header + one line per agent + some sub-lines
|
|
57
|
+
return 2 + item.agents.length * 2;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Compute cumulative heights for an array of items.
|
|
62
|
+
* Returns an array where cumulativeHeights[i] = total height of items[0..i].
|
|
63
|
+
*/
|
|
64
|
+
export function computeCumulativeHeights(items, terminalWidth) {
|
|
65
|
+
const heights = [];
|
|
66
|
+
let total = 0;
|
|
67
|
+
for (const item of items) {
|
|
68
|
+
total += estimateItemHeight(item, terminalWidth);
|
|
69
|
+
heights.push(total);
|
|
70
|
+
}
|
|
71
|
+
return heights;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=item-heights.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-heights.js","sourceRoot":"","sources":["../../../src/ui/utils/item-heights.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,KAAa;IAC9D,IAAI,CAAC,IAAI,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IAClC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnC,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7B,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,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CAAC;QACvB,CAAC;QAED,KAAK,OAAO;YACV,4BAA4B;YAC5B,OAAO,CAAC,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QAE9D,KAAK,MAAM;YACT,2BAA2B;YAC3B,OAAO,CAAC,GAAG,oBAAoB,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QAE3D,KAAK,UAAU;YACb,+BAA+B;YAC/B,OAAO,CAAC,CAAC;QAEX,KAAK,gBAAgB;YACnB,+CAA+C;YAC/C,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IACtC,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAsB,EAAE,aAAqB;IACpF,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,KAAK,IAAI,kBAAkB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QACjD,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kenkaiiii/ggcoder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI coding agent with OAuth authentication for Anthropic and OpenAI",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"chalk": "^5.6.2",
|
|
26
|
+
"cli-highlight": "^2.1.11",
|
|
26
27
|
"diff": "^8.0.3",
|
|
27
28
|
"fast-glob": "^3.3.3",
|
|
28
29
|
"ignore": "^7.0.5",
|
|
@@ -32,8 +33,8 @@
|
|
|
32
33
|
"react": "^19.2.4",
|
|
33
34
|
"strip-ansi": "^7.2.0",
|
|
34
35
|
"zod": "^4.3.6",
|
|
35
|
-
"@kenkaiiii/gg-agent": "
|
|
36
|
-
"@kenkaiiii/gg-ai": "
|
|
36
|
+
"@kenkaiiii/gg-agent": "1.0.4",
|
|
37
|
+
"@kenkaiiii/gg-ai": "1.0.4"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
40
|
"@types/node": "^25.3.3",
|
|
@@ -46,6 +47,7 @@
|
|
|
46
47
|
},
|
|
47
48
|
"scripts": {
|
|
48
49
|
"build": "tsc",
|
|
49
|
-
"check": "tsc --noEmit"
|
|
50
|
+
"check": "tsc --noEmit",
|
|
51
|
+
"test": "vitest run"
|
|
50
52
|
}
|
|
51
53
|
}
|