@kenkaiiii/ggcoder 2.0.0 → 3.0.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/cli.js +12 -3
- package/dist/cli.js.map +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +1 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction/compactor.d.ts +8 -2
- package/dist/core/compaction/compactor.d.ts.map +1 -1
- package/dist/core/compaction/compactor.js +147 -18
- package/dist/core/compaction/compactor.js.map +1 -1
- package/dist/core/custom-commands.d.ts +13 -0
- package/dist/core/custom-commands.d.ts.map +1 -0
- package/dist/core/custom-commands.js +40 -0
- package/dist/core/custom-commands.js.map +1 -0
- package/dist/core/event-bus.d.ts +4 -0
- package/dist/core/event-bus.d.ts.map +1 -1
- package/dist/core/event-bus.js.map +1 -1
- package/dist/core/logger.d.ts +1 -0
- package/dist/core/logger.d.ts.map +1 -1
- package/dist/core/logger.js +6 -0
- package/dist/core/logger.js.map +1 -1
- package/dist/core/model-registry.d.ts +7 -0
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +21 -3
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/prompt-commands.d.ts +14 -0
- package/dist/core/prompt-commands.d.ts.map +1 -0
- package/dist/core/prompt-commands.js +475 -0
- package/dist/core/prompt-commands.js.map +1 -0
- package/dist/core/settings-manager.d.ts +2 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +3 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/system-prompt.d.ts.map +1 -1
- package/dist/system-prompt.js +9 -5
- package/dist/system-prompt.js.map +1 -1
- package/dist/ui/App.d.ts +15 -1
- package/dist/ui/App.d.ts.map +1 -1
- package/dist/ui/App.js +272 -24
- package/dist/ui/App.js.map +1 -1
- package/dist/ui/components/AssistantMessage.d.ts +2 -1
- package/dist/ui/components/AssistantMessage.d.ts.map +1 -1
- package/dist/ui/components/AssistantMessage.js +3 -2
- package/dist/ui/components/AssistantMessage.js.map +1 -1
- package/dist/ui/components/Banner.d.ts.map +1 -1
- package/dist/ui/components/Banner.js +27 -6
- package/dist/ui/components/Banner.js.map +1 -1
- package/dist/ui/components/CompactionNotice.d.ts +10 -0
- package/dist/ui/components/CompactionNotice.d.ts.map +1 -0
- package/dist/ui/components/CompactionNotice.js +31 -0
- package/dist/ui/components/CompactionNotice.js.map +1 -0
- package/dist/ui/components/Footer.d.ts +2 -1
- package/dist/ui/components/Footer.d.ts.map +1 -1
- package/dist/ui/components/Footer.js +9 -5
- package/dist/ui/components/Footer.js.map +1 -1
- package/dist/ui/components/InputArea.d.ts +7 -2
- package/dist/ui/components/InputArea.d.ts.map +1 -1
- package/dist/ui/components/InputArea.js +120 -8
- package/dist/ui/components/InputArea.js.map +1 -1
- package/dist/ui/components/SlashCommandMenu.d.ts +15 -0
- package/dist/ui/components/SlashCommandMenu.d.ts.map +1 -0
- package/dist/ui/components/SlashCommandMenu.js +32 -0
- package/dist/ui/components/SlashCommandMenu.js.map +1 -0
- package/dist/ui/components/StreamingArea.d.ts +2 -1
- package/dist/ui/components/StreamingArea.d.ts.map +1 -1
- package/dist/ui/components/StreamingArea.js +15 -3
- package/dist/ui/components/StreamingArea.js.map +1 -1
- package/dist/ui/components/SubAgentPanel.d.ts.map +1 -1
- package/dist/ui/components/SubAgentPanel.js +54 -16
- package/dist/ui/components/SubAgentPanel.js.map +1 -1
- package/dist/ui/components/ThinkingBlock.d.ts +11 -0
- package/dist/ui/components/ThinkingBlock.d.ts.map +1 -0
- package/dist/ui/components/ThinkingBlock.js +40 -0
- package/dist/ui/components/ThinkingBlock.js.map +1 -0
- package/dist/ui/components/ToolExecution.d.ts.map +1 -1
- package/dist/ui/components/ToolExecution.js +22 -5
- package/dist/ui/components/ToolExecution.js.map +1 -1
- package/dist/ui/components/UserMessage.d.ts +2 -1
- package/dist/ui/components/UserMessage.d.ts.map +1 -1
- package/dist/ui/components/UserMessage.js +4 -2
- package/dist/ui/components/UserMessage.js.map +1 -1
- package/dist/ui/hooks/useAgentLoop.d.ts +6 -3
- package/dist/ui/hooks/useAgentLoop.d.ts.map +1 -1
- package/dist/ui/hooks/useAgentLoop.js +1 -1
- package/dist/ui/hooks/useAgentLoop.js.map +1 -1
- package/dist/ui/render.d.ts.map +1 -1
- package/dist/ui/render.js +22 -2
- package/dist/ui/render.js.map +1 -1
- package/dist/ui/theme/dark.json +2 -1
- package/dist/ui/theme/light.json +2 -1
- package/dist/ui/theme/theme.d.ts +1 -0
- package/dist/ui/theme/theme.d.ts.map +1 -1
- package/dist/utils/image.d.ts +24 -0
- package/dist/utils/image.d.ts.map +1 -0
- package/dist/utils/image.js +137 -0
- package/dist/utils/image.js.map +1 -0
- package/package.json +3 -3
package/dist/core/logger.js
CHANGED
|
@@ -23,6 +23,8 @@ export function initLogger(filePath, meta) {
|
|
|
23
23
|
parts.push(`provider=${meta.provider}`);
|
|
24
24
|
if (meta?.model)
|
|
25
25
|
parts.push(`model=${meta.model}`);
|
|
26
|
+
if (meta?.thinking)
|
|
27
|
+
parts.push(`thinking=${meta.thinking}`);
|
|
26
28
|
log("INFO", "startup", parts.join(" "));
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
@@ -68,6 +70,8 @@ export function attachToEventBus(bus) {
|
|
|
68
70
|
stopReason,
|
|
69
71
|
inputTokens: String(usage.inputTokens),
|
|
70
72
|
outputTokens: String(usage.outputTokens),
|
|
73
|
+
...(usage.cacheRead != null && { cacheRead: String(usage.cacheRead) }),
|
|
74
|
+
...(usage.cacheWrite != null && { cacheWrite: String(usage.cacheWrite) }),
|
|
71
75
|
});
|
|
72
76
|
}));
|
|
73
77
|
unsubs.push(bus.on("agent_done", ({ totalTurns, totalUsage }) => {
|
|
@@ -75,6 +79,8 @@ export function attachToEventBus(bus) {
|
|
|
75
79
|
totalTurns: String(totalTurns),
|
|
76
80
|
inputTokens: String(totalUsage.inputTokens),
|
|
77
81
|
outputTokens: String(totalUsage.outputTokens),
|
|
82
|
+
...(totalUsage.cacheRead != null && { cacheRead: String(totalUsage.cacheRead) }),
|
|
83
|
+
...(totalUsage.cacheWrite != null && { cacheWrite: String(totalUsage.cacheWrite) }),
|
|
78
84
|
});
|
|
79
85
|
}));
|
|
80
86
|
unsubs.push(bus.on("error", ({ error }) => {
|
package/dist/core/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/core/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AAKzB,IAAI,EAAE,GAAkB,IAAI,CAAC;AAC7B,IAAI,aAAa,GAAmB,EAAE,CAAC;AAEvC;;;GAGG;AACH,MAAM,UAAU,UAAU,CACxB,QAAgB,EAChB,
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/core/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AAKzB,IAAI,EAAE,GAAkB,IAAI,CAAC;AAC7B,IAAI,aAAa,GAAmB,EAAE,CAAC;AAEvC;;;GAGG;AACH,MAAM,UAAU,UAAU,CACxB,QAAgB,EAChB,IAAiF;IAEjF,IAAI,EAAE,KAAK,IAAI;QAAE,OAAO;IACxB,IAAI,CAAC;QACH,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAClC,CAAC;IAAC,MAAM,CAAC;QACP,iDAAiD;QACjD,OAAO;IACT,CAAC;IACD,MAAM,KAAK,GAAG,CAAC,SAAS,CAAC,CAAC;IAC1B,IAAI,IAAI,EAAE,OAAO;QAAE,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;IACnD,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACtB,IAAI,IAAI,EAAE,QAAQ;QAAE,KAAK,CAAC,IAAI,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AE,mBAAmB,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC7E,CAAC,CAAC,CACH,CAAC;IAEF,aAAa,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,IAAI,EAAE,KAAK,IAAI;QAAE,OAAO;IACxB,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,uBAAuB,CAAC,CAAC;IACjD,IAAI,CAAC;QACH,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACnB,CAAC;IAAC,MAAM,CAAC;QACP,sBAAsB;IACxB,CAAC;IACD,EAAE,GAAG,IAAI,CAAC;IACV,KAAK,MAAM,KAAK,IAAI,aAAa,EAAE,CAAC;QAClC,KAAK,EAAE,CAAC;IACV,CAAC;IACD,aAAa,GAAG,EAAE,CAAC;AACrB,CAAC"}
|
|
@@ -13,4 +13,11 @@ export declare function getModel(id: string): ModelInfo | undefined;
|
|
|
13
13
|
export declare function getModelsForProvider(provider: Provider): ModelInfo[];
|
|
14
14
|
export declare function getDefaultModel(provider: Provider): ModelInfo;
|
|
15
15
|
export declare function getContextWindow(modelId: string): number;
|
|
16
|
+
/**
|
|
17
|
+
* Get the model to use for compaction summarization.
|
|
18
|
+
* - Anthropic: always Sonnet 4.6
|
|
19
|
+
* - OpenAI: cheapest (Codex Mini)
|
|
20
|
+
* - GLM / Moonshot: use the current model (no cheap alternative)
|
|
21
|
+
*/
|
|
22
|
+
export declare function getSummaryModel(provider: Provider, currentModelId: string): ModelInfo;
|
|
16
23
|
//# sourceMappingURL=model-registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-registry.d.ts","sourceRoot":"","sources":["../../src/core/model-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CA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,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAK7D;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGxD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,GAAG,SAAS,CAUrF"}
|
|
@@ -53,7 +53,7 @@ export const MODELS = [
|
|
|
53
53
|
provider: "glm",
|
|
54
54
|
contextWindow: 128_000,
|
|
55
55
|
maxOutputTokens: 16_384,
|
|
56
|
-
supportsThinking:
|
|
56
|
+
supportsThinking: true,
|
|
57
57
|
costTier: "medium",
|
|
58
58
|
},
|
|
59
59
|
{
|
|
@@ -62,7 +62,7 @@ export const MODELS = [
|
|
|
62
62
|
provider: "glm",
|
|
63
63
|
contextWindow: 128_000,
|
|
64
64
|
maxOutputTokens: 16_384,
|
|
65
|
-
supportsThinking:
|
|
65
|
+
supportsThinking: true,
|
|
66
66
|
costTier: "low",
|
|
67
67
|
},
|
|
68
68
|
// ── Moonshot (Kimi) ──────────────────────────────────────
|
|
@@ -72,7 +72,7 @@ export const MODELS = [
|
|
|
72
72
|
provider: "moonshot",
|
|
73
73
|
contextWindow: 128_000,
|
|
74
74
|
maxOutputTokens: 16_384,
|
|
75
|
-
supportsThinking:
|
|
75
|
+
supportsThinking: true,
|
|
76
76
|
costTier: "medium",
|
|
77
77
|
},
|
|
78
78
|
];
|
|
@@ -95,4 +95,22 @@ export function getContextWindow(modelId) {
|
|
|
95
95
|
const model = getModel(modelId);
|
|
96
96
|
return model?.contextWindow ?? 200_000;
|
|
97
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Get the model to use for compaction summarization.
|
|
100
|
+
* - Anthropic: always Sonnet 4.6
|
|
101
|
+
* - OpenAI: cheapest (Codex Mini)
|
|
102
|
+
* - GLM / Moonshot: use the current model (no cheap alternative)
|
|
103
|
+
*/
|
|
104
|
+
export function getSummaryModel(provider, currentModelId) {
|
|
105
|
+
if (provider === "anthropic") {
|
|
106
|
+
return MODELS.find((m) => m.id === "claude-sonnet-4-6");
|
|
107
|
+
}
|
|
108
|
+
if (provider === "openai") {
|
|
109
|
+
const low = getModelsForProvider(provider).find((m) => m.costTier === "low");
|
|
110
|
+
if (low)
|
|
111
|
+
return low;
|
|
112
|
+
}
|
|
113
|
+
// GLM, Moonshot, or fallback: use current model
|
|
114
|
+
return getModel(currentModelId) ?? getDefaultModel(provider);
|
|
115
|
+
}
|
|
98
116
|
//# sourceMappingURL=model-registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-registry.js","sourceRoot":"","sources":["../../src/core/model-registry.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,MAAM,MAAM,GAAgB;IACjC,0DAA0D;IAC1D;QACE,EAAE,EAAE,iBAAiB;QACrB,IAAI,EAAE,iBAAiB;QACvB,QAAQ,EAAE,WAAW;QACrB,aAAa,EAAE,OAAO;QACtB,eAAe,EAAE,OAAO;QACxB,gBAAgB,EAAE,IAAI;QACtB,QAAQ,EAAE,MAAM;KACjB;IACD;QACE,EAAE,EAAE,mBAAmB;QACvB,IAAI,EAAE,mBAAmB;QACzB,QAAQ,EAAE,WAAW;QACrB,aAAa,EAAE,OAAO;QACtB,eAAe,EAAE,MAAM;QACvB,gBAAgB,EAAE,IAAI;QACtB,QAAQ,EAAE,QAAQ;KACnB;IACD;QACE,EAAE,EAAE,2BAA2B;QAC/B,IAAI,EAAE,kBAAkB;QACxB,QAAQ,EAAE,WAAW;QACrB,aAAa,EAAE,OAAO;QACtB,eAAe,EAAE,MAAM;QACvB,gBAAgB,EAAE,IAAI;QACtB,QAAQ,EAAE,KAAK;KAChB;IACD,0DAA0D;IAC1D;QACE,EAAE,EAAE,eAAe;QACnB,IAAI,EAAE,eAAe;QACrB,QAAQ,EAAE,QAAQ;QAClB,aAAa,EAAE,OAAO;QACtB,eAAe,EAAE,OAAO;QACxB,gBAAgB,EAAE,IAAI;QACtB,QAAQ,EAAE,MAAM;KACjB;IACD;QACE,EAAE,EAAE,oBAAoB;QACxB,IAAI,EAAE,oBAAoB;QAC1B,QAAQ,EAAE,QAAQ;QAClB,aAAa,EAAE,OAAO;QACtB,eAAe,EAAE,OAAO;QACxB,gBAAgB,EAAE,IAAI;QACtB,QAAQ,EAAE,KAAK;KAChB;IACD,4DAA4D;IAC5D;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,KAAK;QACf,aAAa,EAAE,OAAO;QACtB,eAAe,EAAE,MAAM;QACvB,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"model-registry.js","sourceRoot":"","sources":["../../src/core/model-registry.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,MAAM,MAAM,GAAgB;IACjC,0DAA0D;IAC1D;QACE,EAAE,EAAE,iBAAiB;QACrB,IAAI,EAAE,iBAAiB;QACvB,QAAQ,EAAE,WAAW;QACrB,aAAa,EAAE,OAAO;QACtB,eAAe,EAAE,OAAO;QACxB,gBAAgB,EAAE,IAAI;QACtB,QAAQ,EAAE,MAAM;KACjB;IACD;QACE,EAAE,EAAE,mBAAmB;QACvB,IAAI,EAAE,mBAAmB;QACzB,QAAQ,EAAE,WAAW;QACrB,aAAa,EAAE,OAAO;QACtB,eAAe,EAAE,MAAM;QACvB,gBAAgB,EAAE,IAAI;QACtB,QAAQ,EAAE,QAAQ;KACnB;IACD;QACE,EAAE,EAAE,2BAA2B;QAC/B,IAAI,EAAE,kBAAkB;QACxB,QAAQ,EAAE,WAAW;QACrB,aAAa,EAAE,OAAO;QACtB,eAAe,EAAE,MAAM;QACvB,gBAAgB,EAAE,IAAI;QACtB,QAAQ,EAAE,KAAK;KAChB;IACD,0DAA0D;IAC1D;QACE,EAAE,EAAE,eAAe;QACnB,IAAI,EAAE,eAAe;QACrB,QAAQ,EAAE,QAAQ;QAClB,aAAa,EAAE,OAAO;QACtB,eAAe,EAAE,OAAO;QACxB,gBAAgB,E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 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt-template commands — slash commands that inject detailed prompts
|
|
3
|
+
* into the agent loop. Each command maps to a full prompt the agent executes.
|
|
4
|
+
*/
|
|
5
|
+
export interface PromptCommand {
|
|
6
|
+
name: string;
|
|
7
|
+
aliases: string[];
|
|
8
|
+
description: string;
|
|
9
|
+
prompt: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const PROMPT_COMMANDS: PromptCommand[];
|
|
12
|
+
/** Look up a prompt command by name or alias */
|
|
13
|
+
export declare function getPromptCommand(name: string): PromptCommand | undefined;
|
|
14
|
+
//# sourceMappingURL=prompt-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-commands.d.ts","sourceRoot":"","sources":["../../src/core/prompt-commands.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,eAAe,EAAE,aAAa,EAid1C,CAAC;AAEF,gDAAgD;AAChD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAExE"}
|
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt-template commands — slash commands that inject detailed prompts
|
|
3
|
+
* into the agent loop. Each command maps to a full prompt the agent executes.
|
|
4
|
+
*/
|
|
5
|
+
export const PROMPT_COMMANDS = [
|
|
6
|
+
{
|
|
7
|
+
name: "scan",
|
|
8
|
+
aliases: [],
|
|
9
|
+
description: "Find dead code, bugs, and security issues",
|
|
10
|
+
prompt: `Find quick wins in this codebase. Spawn 5 sub-agents in parallel using the subagent tool (call the subagent tool 5 times in a single response, each with a different task), each focusing on one area. Adapt each area to what's relevant for THIS project's stack and architecture.
|
|
11
|
+
|
|
12
|
+
**Agent 1 - Performance**: Inefficient algorithms, unnecessary work, missing early returns, blocking operations, things that scale poorly
|
|
13
|
+
|
|
14
|
+
**Agent 2 - Dead Weight**: Unused code, unreachable paths, stale comments/TODOs, obsolete files, imports to nowhere
|
|
15
|
+
|
|
16
|
+
**Agent 3 - Lurking Bugs**: Unhandled edge cases, missing error handling, resource leaks, race conditions, silent failures
|
|
17
|
+
|
|
18
|
+
**Agent 4 - Security**: Hardcoded secrets, injection risks, exposed sensitive data, overly permissive access, unsafe defaults
|
|
19
|
+
|
|
20
|
+
**Agent 5 - Dependencies & Config**: Unused packages, vulnerable dependencies, misconfigured settings, dead environment variables, orphaned config files
|
|
21
|
+
|
|
22
|
+
## The Only Valid Findings
|
|
23
|
+
|
|
24
|
+
A finding is ONLY valid if it falls into one of these categories:
|
|
25
|
+
|
|
26
|
+
1. **Dead** - Code that literally does nothing. Unused, unreachable, no-op.
|
|
27
|
+
2. **Broken** - Will cause errors, crashes, or wrong behavior. Not "might" - WILL.
|
|
28
|
+
3. **Dangerous** - Security holes, data exposure, resource exhaustion.
|
|
29
|
+
|
|
30
|
+
That's it. Three categories. If it doesn't fit, don't report it.
|
|
31
|
+
|
|
32
|
+
**NOT valid findings:**
|
|
33
|
+
- "This works but could be cleaner" - NO
|
|
34
|
+
- "Modern best practice suggests..." - NO
|
|
35
|
+
- "This is verbose/repetitive but functional" - NO
|
|
36
|
+
- "You could use X instead of Y" - NO
|
|
37
|
+
- "This isn't how I'd write it" - NO
|
|
38
|
+
|
|
39
|
+
If the code works, isn't dangerous, and does something - leave it alone.
|
|
40
|
+
|
|
41
|
+
## Output Format
|
|
42
|
+
|
|
43
|
+
For each finding:
|
|
44
|
+
\`\`\`
|
|
45
|
+
[DEAD/BROKEN/DANGEROUS] file:line - What it is
|
|
46
|
+
Impact: What happens if left unfixed
|
|
47
|
+
\`\`\`
|
|
48
|
+
|
|
49
|
+
Finding nothing is a valid outcome. Most codebases don't have easy wins - that's fine.`,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "verify",
|
|
53
|
+
aliases: [],
|
|
54
|
+
description: "Verify code against docs and best practices",
|
|
55
|
+
prompt: `Verify this codebase against current best practices and official documentation. Spawn 8 sub-agents in parallel using the subagent tool (call the subagent tool 8 times in a single response, each with a different task), each focusing on one category. Each agent must VERIFY findings using real code samples or official docs - no assumptions allowed.
|
|
56
|
+
|
|
57
|
+
**Agent 1 - Core Framework**: Detect the main framework, verify usage patterns against official documentation
|
|
58
|
+
|
|
59
|
+
**Agent 2 - Dependencies/Libraries**: Check if library APIs being used are current or deprecated. Verify against library documentation
|
|
60
|
+
|
|
61
|
+
**Agent 3 - Language Patterns**: Identify the primary language, verify idioms and patterns are current
|
|
62
|
+
|
|
63
|
+
**Agent 4 - Configuration**: Examine build tools, bundlers, linters, and config files. Verify settings against current tool documentation
|
|
64
|
+
|
|
65
|
+
**Agent 5 - Security Patterns**: Review auth, data handling, secrets management. Verify against current security guidance and OWASP recommendations
|
|
66
|
+
|
|
67
|
+
**Agent 6 - Testing**: Identify test framework in use, verify testing patterns match current library recommendations
|
|
68
|
+
|
|
69
|
+
**Agent 7 - API/Data Handling**: Review data fetching, state management, storage patterns. Verify against current patterns and framework docs
|
|
70
|
+
|
|
71
|
+
**Agent 8 - Error Handling**: Examine error handling patterns, verify they match library documentation
|
|
72
|
+
|
|
73
|
+
## Agent Workflow
|
|
74
|
+
|
|
75
|
+
Each agent MUST follow this process:
|
|
76
|
+
1. **Identify** - What's relevant in THIS project for your category
|
|
77
|
+
2. **Find** - Locate specific implementations in the codebase
|
|
78
|
+
3. **Verify** - Check against real code or official docs
|
|
79
|
+
4. **Report** - Only report when verified current practice differs from codebase
|
|
80
|
+
|
|
81
|
+
## The Only Valid Findings
|
|
82
|
+
|
|
83
|
+
A finding is ONLY valid if:
|
|
84
|
+
1. **OUTDATED** - Works but uses old patterns with verified better alternatives
|
|
85
|
+
2. **DEPRECATED** - Uses APIs marked deprecated in current official docs
|
|
86
|
+
3. **INCORRECT** - Implementation contradicts official documentation
|
|
87
|
+
|
|
88
|
+
**NOT valid findings:**
|
|
89
|
+
- "I think there's a better way" without verification - NO
|
|
90
|
+
- "This looks old" without proof - NO
|
|
91
|
+
- Style preferences or subjective improvements - NO
|
|
92
|
+
- Anything not verified via real code or official docs - NO
|
|
93
|
+
|
|
94
|
+
## Output Format
|
|
95
|
+
|
|
96
|
+
For each finding:
|
|
97
|
+
\`\`\`
|
|
98
|
+
[OUTDATED/DEPRECATED/INCORRECT] file:line - What it is
|
|
99
|
+
Current: How it's implemented now
|
|
100
|
+
Verified: What the correct/current approach is
|
|
101
|
+
Source: URL to official docs or evidence
|
|
102
|
+
\`\`\`
|
|
103
|
+
|
|
104
|
+
No findings is a valid outcome. If implementations match current practices, that's good news.`,
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: "research",
|
|
108
|
+
aliases: [],
|
|
109
|
+
description: "Research best tools, deps, and patterns",
|
|
110
|
+
prompt: `Research the best tools, dependencies, and architecture for this project.
|
|
111
|
+
|
|
112
|
+
First, if it's not clear what the project is building, ask me to describe the features, target platform, and any constraints. If you can infer this from the codebase, proceed directly.
|
|
113
|
+
|
|
114
|
+
Then spawn 6 sub-agents in parallel using the subagent tool (call the subagent tool 6 times in a single response, each with a different task). Every agent must verify ALL recommendations - no training-data assumptions allowed.
|
|
115
|
+
|
|
116
|
+
**Agent 1 - Project Scan**: Read the current working directory. Catalog what already exists: config files, installed deps, directory structure, language/framework already chosen. Report exactly what's in place.
|
|
117
|
+
|
|
118
|
+
**Agent 2 - Stack Validation**: Research whether the current framework/language is the best choice for this project. Compare top 2-3 alternatives on performance, ecosystem, and developer experience. Pick ONE winner with evidence.
|
|
119
|
+
|
|
120
|
+
**Agent 3 - Core Dependencies**: For EACH feature, find the single best library for this stack. Confirm latest stable versions. No outdated packages. Output: package name, version, one-line purpose.
|
|
121
|
+
|
|
122
|
+
**Agent 4 - Dev Tooling**: Research the best dev tooling for this stack: package manager, bundler, linter, formatter, test framework, type checker. Pick ONE per category with exact versions.
|
|
123
|
+
|
|
124
|
+
**Agent 5 - Architecture**: Find how real projects of this type structure their code. Look for directory layouts, file naming conventions, and key patterns. Output a concrete directory tree and list of patterns.
|
|
125
|
+
|
|
126
|
+
**Agent 6 - Config & Integration**: Research required config files for the chosen stack and tools. Cover: linter config, formatter config, TS/type config, env setup, CI/CD basics.
|
|
127
|
+
|
|
128
|
+
## Agent Rules
|
|
129
|
+
|
|
130
|
+
1. Every recommendation MUST be verified - no guessing
|
|
131
|
+
2. Confirm latest stable versions - do not assume version numbers
|
|
132
|
+
3. Pick ONE best option per category - no "you could also use X"
|
|
133
|
+
4. No prose, no hedging, no alternatives lists - decisive answers only
|
|
134
|
+
|
|
135
|
+
## Output
|
|
136
|
+
|
|
137
|
+
After all agents complete, synthesize findings into a single RESEARCH.md file:
|
|
138
|
+
|
|
139
|
+
\`\`\`markdown
|
|
140
|
+
# RESEARCH: [short project description]
|
|
141
|
+
Generated: [today's date]
|
|
142
|
+
Stack: [framework + language + runtime]
|
|
143
|
+
|
|
144
|
+
## INSTALL
|
|
145
|
+
[exact shell commands - copy-paste ready]
|
|
146
|
+
|
|
147
|
+
## DEPENDENCIES
|
|
148
|
+
| package | version | purpose |
|
|
149
|
+
[each purpose max 5 words]
|
|
150
|
+
|
|
151
|
+
## DEV DEPENDENCIES
|
|
152
|
+
| package | version | purpose |
|
|
153
|
+
|
|
154
|
+
## CONFIG FILES TO CREATE
|
|
155
|
+
### [filename]
|
|
156
|
+
[exact file contents or key settings]
|
|
157
|
+
|
|
158
|
+
## PROJECT STRUCTURE
|
|
159
|
+
[tree showing recommended directories]
|
|
160
|
+
|
|
161
|
+
## SETUP STEPS
|
|
162
|
+
1. [concrete action]
|
|
163
|
+
|
|
164
|
+
## KEY PATTERNS
|
|
165
|
+
[brief list of architectural patterns]
|
|
166
|
+
|
|
167
|
+
## SOURCES
|
|
168
|
+
[URLs used for verification]
|
|
169
|
+
\`\`\`
|
|
170
|
+
|
|
171
|
+
Write the file, then summarize what was researched.`,
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: "init",
|
|
175
|
+
aliases: [],
|
|
176
|
+
description: "Generate or update CLAUDE.md for this project",
|
|
177
|
+
prompt: `Generate or update a minimal CLAUDE.md with project structure, guidelines, and quality checks.
|
|
178
|
+
|
|
179
|
+
## Step 1: Check if CLAUDE.md Exists
|
|
180
|
+
|
|
181
|
+
If CLAUDE.md exists:
|
|
182
|
+
- Read the existing file
|
|
183
|
+
- Preserve custom sections the user may have added
|
|
184
|
+
- Update the structure, quality checks, and organization rules
|
|
185
|
+
|
|
186
|
+
If CLAUDE.md does NOT exist:
|
|
187
|
+
- Create a new one from scratch
|
|
188
|
+
|
|
189
|
+
## Step 2: Analyze Project (Use Sub-agents in Parallel)
|
|
190
|
+
|
|
191
|
+
Spawn 3 sub-agents in parallel using the subagent tool (call the subagent tool 3 times in a single response):
|
|
192
|
+
|
|
193
|
+
1. **Project Purpose Agent**: Analyze README, package.json description, main files to understand what the project does
|
|
194
|
+
2. **Directory Structure Agent**: Map out the folder structure and what each folder contains
|
|
195
|
+
3. **Tech Stack Agent**: Identify languages, frameworks, tools, dependencies
|
|
196
|
+
|
|
197
|
+
Wait for all sub-agents to complete, then synthesize the information.
|
|
198
|
+
|
|
199
|
+
## Step 3: Detect Project Type & Commands
|
|
200
|
+
|
|
201
|
+
Check for config files:
|
|
202
|
+
- package.json -> JavaScript/TypeScript (extract lint, typecheck, server scripts)
|
|
203
|
+
- pyproject.toml or requirements.txt -> Python
|
|
204
|
+
- go.mod -> Go
|
|
205
|
+
- Cargo.toml -> Rust
|
|
206
|
+
|
|
207
|
+
Extract linting commands, typechecking commands, and server start command (if applicable).
|
|
208
|
+
|
|
209
|
+
## Step 4: Generate Project Tree
|
|
210
|
+
|
|
211
|
+
Create a concise tree structure showing key directories and files with brief descriptions.
|
|
212
|
+
|
|
213
|
+
## Step 5: Generate or Update CLAUDE.md
|
|
214
|
+
|
|
215
|
+
Create CLAUDE.md with: project description, project structure tree, organization rules (one file per component, single responsibility), and zero-tolerance code quality checks with the exact commands for this project.
|
|
216
|
+
|
|
217
|
+
Keep total file under 100 lines. If updating, preserve any custom sections the user added.`,
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
name: "setup-lint",
|
|
221
|
+
aliases: [],
|
|
222
|
+
description: "Generate a /fix command for linting and typechecking",
|
|
223
|
+
prompt: `Detect the project type and generate a /fix command for linting and typechecking.
|
|
224
|
+
|
|
225
|
+
## Step 1: Detect Project Type
|
|
226
|
+
|
|
227
|
+
Check for config files:
|
|
228
|
+
- package.json -> JavaScript/TypeScript
|
|
229
|
+
- pyproject.toml or requirements.txt -> Python
|
|
230
|
+
- go.mod -> Go
|
|
231
|
+
- Cargo.toml -> Rust
|
|
232
|
+
- composer.json -> PHP
|
|
233
|
+
|
|
234
|
+
Read the relevant config file to understand the project structure.
|
|
235
|
+
|
|
236
|
+
## Step 2: Check Existing Tools
|
|
237
|
+
|
|
238
|
+
Based on the project type, check if linting/typechecking tools are already configured:
|
|
239
|
+
|
|
240
|
+
- **JS/TS**: eslint, prettier, typescript — check package.json scripts and config files
|
|
241
|
+
- **Python**: mypy, pylint, black, ruff — check dependencies and config files
|
|
242
|
+
- **Go**: go vet, gofmt, staticcheck
|
|
243
|
+
- **Rust**: clippy, rustfmt
|
|
244
|
+
|
|
245
|
+
## Step 3: Install Missing Tools (if needed)
|
|
246
|
+
|
|
247
|
+
Only install what's missing. Use the detected package manager.
|
|
248
|
+
|
|
249
|
+
## Step 4: Generate /fix Command
|
|
250
|
+
|
|
251
|
+
Create the directory \`.gg/commands/\` if it doesn't exist, then write \`.gg/commands/fix.md\`:
|
|
252
|
+
|
|
253
|
+
\`\`\`markdown
|
|
254
|
+
---
|
|
255
|
+
name: fix
|
|
256
|
+
description: Run typechecking and linting, then spawn parallel agents to fix all issues
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
Run all linting and typechecking tools, collect errors, group them by domain, and use the subagent tool to spawn parallel sub-agents to fix them.
|
|
260
|
+
|
|
261
|
+
## Step 1: Run Checks
|
|
262
|
+
|
|
263
|
+
[INSERT PROJECT-SPECIFIC COMMANDS — e.g. npm run lint, npm run typecheck, etc.]
|
|
264
|
+
|
|
265
|
+
## Step 2: Collect and Group Errors
|
|
266
|
+
|
|
267
|
+
Parse the output. Group errors by domain:
|
|
268
|
+
- **Type errors**: Issues from TypeScript, mypy, etc.
|
|
269
|
+
- **Lint errors**: Issues from eslint, pylint, ruff, clippy, etc.
|
|
270
|
+
- **Format errors**: Issues from prettier, black, rustfmt, gofmt
|
|
271
|
+
|
|
272
|
+
## Step 3: Spawn Parallel Agents
|
|
273
|
+
|
|
274
|
+
For each domain with issues, use the subagent tool to spawn a sub-agent to fix all errors in that domain.
|
|
275
|
+
|
|
276
|
+
## Step 4: Verify
|
|
277
|
+
|
|
278
|
+
After all agents complete, re-run all checks to verify all issues are resolved.
|
|
279
|
+
\`\`\`
|
|
280
|
+
|
|
281
|
+
Replace [INSERT PROJECT-SPECIFIC COMMANDS] with the actual commands for the detected project.
|
|
282
|
+
|
|
283
|
+
## Step 5: Confirm
|
|
284
|
+
|
|
285
|
+
Report what was detected, what was installed, and that /fix is now available.`,
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
name: "setup-commit",
|
|
289
|
+
aliases: [],
|
|
290
|
+
description: "Generate a /commit command with quality checks",
|
|
291
|
+
prompt: `Detect the project type and generate a /commit command that enforces quality checks before committing.
|
|
292
|
+
|
|
293
|
+
## Step 1: Detect Project and Extract Commands
|
|
294
|
+
|
|
295
|
+
Check for config files and extract the lint/typecheck commands:
|
|
296
|
+
- package.json -> Extract lint, typecheck scripts
|
|
297
|
+
- pyproject.toml -> Use mypy, pylint/ruff
|
|
298
|
+
- go.mod -> Use go vet, gofmt
|
|
299
|
+
- Cargo.toml -> Use cargo clippy, cargo fmt --check
|
|
300
|
+
|
|
301
|
+
## Step 2: Generate /commit Command
|
|
302
|
+
|
|
303
|
+
Create the directory \`.gg/commands/\` if it doesn't exist, then write \`.gg/commands/commit.md\`:
|
|
304
|
+
|
|
305
|
+
\`\`\`markdown
|
|
306
|
+
---
|
|
307
|
+
name: commit
|
|
308
|
+
description: Run checks, commit with AI message, and push
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
1. Run quality checks:
|
|
312
|
+
[PROJECT-SPECIFIC LINT/TYPECHECK COMMANDS]
|
|
313
|
+
Fix ALL errors before continuing. Use auto-fix commands where available.
|
|
314
|
+
|
|
315
|
+
2. Review changes: run git status and git diff --staged and git diff
|
|
316
|
+
|
|
317
|
+
3. Stage relevant files with git add (specific files, not -A)
|
|
318
|
+
|
|
319
|
+
4. Generate a commit message:
|
|
320
|
+
- Start with verb (Add/Update/Fix/Remove/Refactor)
|
|
321
|
+
- Be specific and concise, one line preferred
|
|
322
|
+
|
|
323
|
+
5. Commit and push:
|
|
324
|
+
git commit -m "your generated message"
|
|
325
|
+
git push
|
|
326
|
+
\`\`\`
|
|
327
|
+
|
|
328
|
+
Replace [PROJECT-SPECIFIC LINT/TYPECHECK COMMANDS] with the actual commands.
|
|
329
|
+
|
|
330
|
+
Keep the command file under 20 lines.
|
|
331
|
+
|
|
332
|
+
## Step 3: Confirm
|
|
333
|
+
|
|
334
|
+
Report that /commit is now available with quality checks and AI-generated commit messages.`,
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
name: "setup-tests",
|
|
338
|
+
aliases: [],
|
|
339
|
+
description: "Set up testing and generate a /test command",
|
|
340
|
+
prompt: `Set up comprehensive testing for this project and generate a /test command.
|
|
341
|
+
|
|
342
|
+
## Step 1: Analyze Project
|
|
343
|
+
|
|
344
|
+
Detect the project type, framework, and architecture. Identify all critical business logic that needs testing.
|
|
345
|
+
|
|
346
|
+
## Step 2: Determine Testing Strategy
|
|
347
|
+
|
|
348
|
+
Use these tools based on project type (2025-2026 best practices):
|
|
349
|
+
|
|
350
|
+
| Language | Unit/Integration | E2E | Notes |
|
|
351
|
+
|----------|------------------|-----|-------|
|
|
352
|
+
| JS/TS | Vitest (not Jest) | Playwright | Vitest is faster, native ESM/TS. Use Testing Library for components. |
|
|
353
|
+
| Python | pytest | Playwright | pytest-django for Django, httpx+pytest-asyncio for FastAPI. |
|
|
354
|
+
| Go | testing + testify | httptest | testcontainers-go for integration. Table-driven tests. |
|
|
355
|
+
| Rust | #[test] + rstest | axum-test | assert_cmd for CLI, proptest for property-based. |
|
|
356
|
+
| PHP | Pest 4 (Laravel) / PHPUnit 12 | Laravel Dusk | Pest preferred for Laravel. |
|
|
357
|
+
|
|
358
|
+
## Step 3: Set Up Testing Infrastructure
|
|
359
|
+
|
|
360
|
+
Spawn 4 sub-agents in parallel using the subagent tool (call the subagent tool 4 times in a single response):
|
|
361
|
+
|
|
362
|
+
**Agent 1 - Dependencies & Config**: Install test frameworks and create config files
|
|
363
|
+
**Agent 2 - Unit Tests**: Create comprehensive unit tests for all business logic, utilities, and core functions
|
|
364
|
+
**Agent 3 - Integration Tests**: Create integration tests for APIs, database operations, and service interactions
|
|
365
|
+
**Agent 4 - E2E Tests** (if applicable): Create end-to-end tests for critical user flows
|
|
366
|
+
|
|
367
|
+
Each agent should create COMPREHENSIVE tests covering all critical code paths - not just samples.
|
|
368
|
+
|
|
369
|
+
## Step 4: Verify and Generate /test Command
|
|
370
|
+
|
|
371
|
+
Run the tests to verify everything works. Fix any issues.
|
|
372
|
+
|
|
373
|
+
Then create the directory \`.gg/commands/\` if it doesn't exist and write \`.gg/commands/test.md\` with:
|
|
374
|
+
|
|
375
|
+
\`\`\`markdown
|
|
376
|
+
---
|
|
377
|
+
name: test
|
|
378
|
+
description: Run tests, then spawn parallel agents to fix failures
|
|
379
|
+
---
|
|
380
|
+
|
|
381
|
+
Run all tests for this project, collect failures, and use the subagent tool to spawn parallel sub-agents to fix them.
|
|
382
|
+
|
|
383
|
+
## Step 1: Run Tests
|
|
384
|
+
|
|
385
|
+
[PROJECT-SPECIFIC TEST COMMANDS with options for watch mode, coverage, filtering]
|
|
386
|
+
|
|
387
|
+
## Step 2: If Failures
|
|
388
|
+
|
|
389
|
+
For each failing test, use the subagent tool to spawn a sub-agent to fix the underlying issue (not the test).
|
|
390
|
+
|
|
391
|
+
## Step 3: Re-run
|
|
392
|
+
|
|
393
|
+
Re-run tests to verify all fixes.
|
|
394
|
+
\`\`\`
|
|
395
|
+
|
|
396
|
+
Replace placeholders with the actual test commands for this project.
|
|
397
|
+
|
|
398
|
+
## Step 5: Report
|
|
399
|
+
|
|
400
|
+
Summarize what was set up, how many tests were created, and that /test is now available.`,
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
name: "setup-update",
|
|
404
|
+
aliases: [],
|
|
405
|
+
description: "Generate an /update command for dependency updates",
|
|
406
|
+
prompt: `Detect the project type and generate an /update command for dependency updates and deprecation fixes.
|
|
407
|
+
|
|
408
|
+
## Step 1: Detect Project Type & Package Manager
|
|
409
|
+
|
|
410
|
+
Check for config files and lock files:
|
|
411
|
+
- package.json + package-lock.json -> npm
|
|
412
|
+
- package.json + yarn.lock -> yarn
|
|
413
|
+
- package.json + pnpm-lock.yaml -> pnpm
|
|
414
|
+
- pyproject.toml + poetry.lock -> poetry
|
|
415
|
+
- requirements.txt -> pip
|
|
416
|
+
- go.mod -> Go
|
|
417
|
+
- Cargo.toml -> Rust
|
|
418
|
+
|
|
419
|
+
## Step 2: Generate /update Command
|
|
420
|
+
|
|
421
|
+
Create the directory \`.gg/commands/\` if it doesn't exist, then write \`.gg/commands/update.md\`:
|
|
422
|
+
|
|
423
|
+
\`\`\`markdown
|
|
424
|
+
---
|
|
425
|
+
name: update
|
|
426
|
+
description: Update dependencies, fix deprecations and warnings
|
|
427
|
+
---
|
|
428
|
+
|
|
429
|
+
## Step 1: Check for Updates
|
|
430
|
+
|
|
431
|
+
[OUTDATED CHECK COMMAND for detected package manager]
|
|
432
|
+
|
|
433
|
+
## Step 2: Update Dependencies
|
|
434
|
+
|
|
435
|
+
[UPDATE COMMAND + SECURITY AUDIT]
|
|
436
|
+
|
|
437
|
+
## Step 3: Check for Deprecations & Warnings
|
|
438
|
+
|
|
439
|
+
Run a clean install and read ALL output carefully. Look for:
|
|
440
|
+
- Deprecation warnings
|
|
441
|
+
- Security vulnerabilities
|
|
442
|
+
- Peer dependency warnings
|
|
443
|
+
- Breaking changes
|
|
444
|
+
|
|
445
|
+
## Step 4: Fix Issues
|
|
446
|
+
|
|
447
|
+
For each warning/deprecation:
|
|
448
|
+
1. Research the recommended replacement or fix
|
|
449
|
+
2. Update code/dependencies accordingly
|
|
450
|
+
3. Re-run installation
|
|
451
|
+
4. Verify no warnings remain
|
|
452
|
+
|
|
453
|
+
## Step 5: Run Quality Checks
|
|
454
|
+
|
|
455
|
+
[PROJECT-SPECIFIC LINT/TYPECHECK COMMANDS]
|
|
456
|
+
|
|
457
|
+
Fix all errors before completing.
|
|
458
|
+
|
|
459
|
+
## Step 6: Verify Clean Install
|
|
460
|
+
|
|
461
|
+
Delete dependency folders/caches, run a fresh install, verify ZERO warnings/errors.
|
|
462
|
+
\`\`\`
|
|
463
|
+
|
|
464
|
+
Replace all placeholders with the actual commands for the detected project type and package manager.
|
|
465
|
+
|
|
466
|
+
## Step 3: Confirm
|
|
467
|
+
|
|
468
|
+
Report that /update is now available with dependency updates, security audits, and deprecation fixes.`,
|
|
469
|
+
},
|
|
470
|
+
];
|
|
471
|
+
/** Look up a prompt command by name or alias */
|
|
472
|
+
export function getPromptCommand(name) {
|
|
473
|
+
return PROMPT_COMMANDS.find((cmd) => cmd.name === name || cmd.aliases.includes(name));
|
|
474
|
+
}
|
|
475
|
+
//# sourceMappingURL=prompt-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-commands.js","sourceRoot":"","sources":["../../src/core/prompt-commands.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,MAAM,CAAC,MAAM,eAAe,GAAoB;IAC9C;QACE,IAAI,EAAE,MAAM;QACZ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AE,oDAAoD;QACjE,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sGA8D0F;KACnG;CACF,CAAC;AAEF,gDAAgD;AAChD,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,IAAI,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AACxF,CAAC"}
|
|
@@ -10,10 +10,12 @@ declare const SettingsSchema: z.ZodObject<{
|
|
|
10
10
|
}>>;
|
|
11
11
|
defaultModel: z.ZodOptional<z.ZodString>;
|
|
12
12
|
maxTokens: z.ZodDefault<z.ZodNumber>;
|
|
13
|
+
thinkingEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
13
14
|
thinkingLevel: z.ZodOptional<z.ZodEnum<{
|
|
14
15
|
low: "low";
|
|
15
16
|
medium: "medium";
|
|
16
17
|
high: "high";
|
|
18
|
+
max: "max";
|
|
17
19
|
}>>;
|
|
18
20
|
theme: z.ZodDefault<z.ZodEnum<{
|
|
19
21
|
dark: "dark";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-manager.d.ts","sourceRoot":"","sources":["../../src/core/settings-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,QAAA,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"settings-manager.d.ts","sourceRoot":"","sources":["../../src/core/settings-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;iBAYlB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,eAAO,MAAM,gBAAgB,EAAE,QAS9B,CAAC;AAIF,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAqC;IACrD,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAS;gBAEX,QAAQ,CAAC,EAAE,MAAM;IAIvB,IAAI,IAAI,OAAO,CAAC,QAAQ,CAAC;IAazB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAK3B,GAAG,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;IAI5C,GAAG,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9E,MAAM,IAAI,QAAQ;CAGnB"}
|