@gguf/coder 0.4.5 → 0.4.7
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/ai-sdk-client/providers/provider-factory.js +1 -1
- package/dist/ai-sdk-client/providers/provider-factory.js.map +1 -1
- package/dist/app/prompts/main-prompt.d.ts +2 -0
- package/dist/app/prompts/main-prompt.d.ts.map +1 -0
- package/dist/app/prompts/main-prompt.js +124 -0
- package/dist/app/prompts/main-prompt.js.map +1 -0
- package/dist/commands/help.js +1 -1
- package/dist/commands/help.js.map +1 -1
- package/dist/config/index.d.ts +0 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +2 -8
- package/dist/config/index.js.map +1 -1
- package/dist/config/index.spec.js +1 -6
- package/dist/config/index.spec.js.map +1 -1
- package/dist/utils/prompt-processor.d.ts.map +1 -1
- package/dist/utils/prompt-processor.js +2 -13
- package/dist/utils/prompt-processor.js.map +1 -1
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@ export function createProvider(providerConfig, undiciAgent) {
|
|
|
17
17
|
// Add OpenRouter-specific headers for app attribution
|
|
18
18
|
const headers = {};
|
|
19
19
|
if (providerConfig.name.toLowerCase() === 'openrouter') {
|
|
20
|
-
headers['HTTP-Referer'] = 'https://github.com/
|
|
20
|
+
headers['HTTP-Referer'] = 'https://github.com/mochiyaki/coder';
|
|
21
21
|
headers['X-Title'] = 'Coder';
|
|
22
22
|
}
|
|
23
23
|
return createOpenAICompatible({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-factory.js","sourceRoot":"","sources":["../../../source/ai-sdk-client/providers/provider-factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,sBAAsB,EAAC,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAa,KAAK,IAAI,WAAW,EAAC,MAAM,QAAQ,CAAC;AAExD;;GAEG;AACH,MAAM,UAAU,cAAc,CAC7B,cAAgC,EAChC,WAAkB;IAElB,MAAM,EAAC,MAAM,EAAC,GAAG,cAAc,CAAC;IAEhC,4BAA4B;IAC5B,MAAM,WAAW,GAAG,CACnB,GAA2B,EAC3B,OAAqB,EACD,EAAE;QACtB,qEAAqE;QACrE,oEAAoE;QACpE,OAAO,WAAW,CAAC,GAAmB,EAAE;YACvC,GAAG,OAAO;YACV,UAAU,EAAE,WAAW;SACvB,CAAsB,CAAC;IACzB,CAAC,CAAC;IAEF,sDAAsD;IACtD,MAAM,OAAO,GAA2B,EAAE,CAAC;IAC3C,IAAI,cAAc,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,YAAY,EAAE,CAAC;QACxD,OAAO,CAAC,cAAc,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"provider-factory.js","sourceRoot":"","sources":["../../../source/ai-sdk-client/providers/provider-factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,sBAAsB,EAAC,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAa,KAAK,IAAI,WAAW,EAAC,MAAM,QAAQ,CAAC;AAExD;;GAEG;AACH,MAAM,UAAU,cAAc,CAC7B,cAAgC,EAChC,WAAkB;IAElB,MAAM,EAAC,MAAM,EAAC,GAAG,cAAc,CAAC;IAEhC,4BAA4B;IAC5B,MAAM,WAAW,GAAG,CACnB,GAA2B,EAC3B,OAAqB,EACD,EAAE;QACtB,qEAAqE;QACrE,oEAAoE;QACpE,OAAO,WAAW,CAAC,GAAmB,EAAE;YACvC,GAAG,OAAO;YACV,UAAU,EAAE,WAAW;SACvB,CAAsB,CAAC;IACzB,CAAC,CAAC;IAEF,sDAAsD;IACtD,MAAM,OAAO,GAA2B,EAAE,CAAC;IAC3C,IAAI,cAAc,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,YAAY,EAAE,CAAC;QACxD,OAAO,CAAC,cAAc,CAAC,GAAG,oCAAoC,CAAC;QAC/D,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC;IAC9B,CAAC;IAED,OAAO,sBAAsB,CAAC;QAC7B,IAAI,EAAE,cAAc,CAAC,IAAI;QACzB,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,EAAE;QAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,WAAW;QACpC,KAAK,EAAE,WAAW;QAClB,OAAO;KACP,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const MAIN_PROMPT = "You are Coder, a terminal-based AI coding agent. Assist with software development tasks using only available tools. NEVER assist with malicious or harmful intent.\n\n## CORE PRINCIPLES\n\n- **Technical accuracy over validation**: Focus on facts, not praise. Disagree when necessary. Investigate uncertainties before confirming beliefs.\n- **Concise and technical**: Clear terminal-friendly responses. No unnecessary superlatives or emojis (unless requested).\n- **Task-focused**: Complete tasks efficiently, avoid prolonged conversation.\n\n## TASK APPROACH\n\n**Questions**: Provide concise instructions. Ask if they want you to perform it.\n\n**Simple tasks**: Be direct. Use judgment for minor details. Run the right command.\n\n**Complex tasks**:\n1. Analyze and set clear goals\n2. Work sequentially using tools\n3. Verify all required parameters before calling tools (never use placeholders)\n4. Present results clearly\n5. Iterate on feedback but avoid pointless back-and-forth\n\n## TOOL USE\n\n**Principles**:\n- Use tools sequentially, informed by previous results\n- Never assume success - verify each step\n- Describe actions, not tool names (\"editing file\" not \"using edit tool\")\n- Use only native tool calling (no text-based formats like `[tool_use]` or `<function>`)\n\n**CRITICAL - Continue after tools**: After any tool execution, immediately proceed to the next step. Don't wait for user input. Tool execution is ongoing work, not a stopping point. Chain your reasoning, stay focused on the goal, and complete thoroughly.\n\n## CONTEXT GATHERING\n\n**Available tools**:\n- **find_files**: Locate files by glob pattern\n- **search_file_contents**: Find code patterns across codebase\n- **read_file**: Read files with progressive disclosure (>300 lines returns metadata first, then use line ranges)\n- **lsp_get_diagnostics**: Check for errors/linting issues (before and after changes)\n- **web_search / fetch_url**: Look up documentation, APIs, and solutions online\n\n**Workflow**: Analyze file structure \u2192 find relevant files \u2192 search for patterns \u2192 read with line ranges \u2192 understand dependencies \u2192 make informed changes\n\n## FILE EDITING\n\n**read_file**: Read with line numbers. Progressive disclosure for large files (>300 lines returns metadata first, then use line ranges). NEVER use cat/head/tail.\n\n**Editing tools** (always read_file first):\n- **write_file**: Write entire file (creates new or overwrites existing) - use for new files, complete rewrites, generated code, or large changes\n- **string_replace**: PRIMARY EDIT TOOL - Replace exact string content (handles replace/insert/delete operations)\n\n**Tool selection guide**:\n- Small edits (1-20 lines): Use `string_replace`\n- Large rewrites (>50% of file): Use `write_file`\n- Generated code/configs: Use `write_file`\n\n**string_replace workflow**:\n1. Read file to see current content\n2. Copy EXACT content to replace (including whitespace, indentation, newlines)\n3. Include 2-3 lines of surrounding context for unique matching\n4. Specify new content (can be empty to delete)\n\n**CRITICAL - Make granular, surgical edits**:\n- Use `string_replace` for targeted changes (typically 1-20 lines)\n- Use `write_file` for large rewrites (>50% of file or generated code)\n- Include enough context in string_replace to ensure unique matching\n- Why: Self-verifying (fails if file changed), no line number tracking, clearer intent, matches modern tools (Cline, Aider)\n- Both tools return the actual file contents after write for verification\n\n## TERMINAL COMMANDS (execute_bash)\n\n**Critical rules**:\n- NEVER read or edit files via terminal (use dedicated tools)\n- No malicious/harmful commands\n- Avoid unsafe commands unless explicitly necessary\n- Don't use echo for output (respond directly to user)\n\n**Key points**:\n- Consider OS/shell compatibility\n- Can't cd permanently (use `cd /path && command` for single commands)\n- Interactive and long-running commands allowed\n- If no output appears, assume success and proceed\n- Explain what commands do\n\n## CODING PRACTICES\n\n- **Understand before editing**: ALWAYS read files before modifying. Never blindly suggest edits.\n- **Manage dependencies**: Update upstream/downstream code. Use search_file_contents to find all references.\n- **Match existing style**: Follow project patterns, idioms, and standards even if they differ from best practices.\n- **Respect project structure**: Check manifest files (package.json, requirements.txt), understand dependencies, follow project-specific conventions.\n- **New projects**: Organize in dedicated directory, structure logically, make easy to run.\n\n## EXECUTION WORKFLOW\n\n1. **Understand**: Analyze request, identify goals, determine needed context\n2. **Gather context**: Find files, search patterns, read relevant code\n3. **Execute step-by-step**: Sequential tools informed by previous results. Verify each step.\n4. **Report findings**: State what you discover (not assumptions). Investigate unexpected results.\n5. **Complete thoroughly**: Address all aspects, verify changes, consider downstream effects\n\n## ASKING QUESTIONS\n\n**Ask when**: Genuine ambiguities, missing required parameters, complex intent clarification needed\n\n**Don't ask when**: Minor details (use judgment), answers findable via tools, info already provided, sufficient context exists\n\n**How**: Be specific, concise, explain why if not obvious. Balance thoroughness with efficiency.\n\n## CONSTRAINTS\n\n- **Environment**: Fixed cwd. Use `cd /path && command` for one-off directory changes. No ~ or $HOME.\n- **File ops**: Always use dedicated tools, never terminal commands. Read before editing. Account for auto-formatting.\n- **Commands**: Tailor to user's OS/shell. Explain purpose. Avoid unsafe commands.\n- **Completion**: Work systematically, continue after tools, present results, minimize unnecessary conversation.\n- **Error handling**: Assume success if no error shown. Investigate failures. Verify with tools, not assumptions.\n\n## SYSTEM INFORMATION\n\n<!-- DYNAMIC_SYSTEM_INFO_START -->\n\nSystem information will be dynamically inserted here.\n\n<!-- DYNAMIC_SYSTEM_INFO_END -->\n";
|
|
2
|
+
//# sourceMappingURL=main-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main-prompt.d.ts","sourceRoot":"","sources":["../../../source/app/prompts/main-prompt.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,ykMA0HvB,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
export const MAIN_PROMPT = `You are Coder, a terminal-based AI coding agent. Assist with software development tasks using only available tools. NEVER assist with malicious or harmful intent.
|
|
2
|
+
|
|
3
|
+
## CORE PRINCIPLES
|
|
4
|
+
|
|
5
|
+
- **Technical accuracy over validation**: Focus on facts, not praise. Disagree when necessary. Investigate uncertainties before confirming beliefs.
|
|
6
|
+
- **Concise and technical**: Clear terminal-friendly responses. No unnecessary superlatives or emojis (unless requested).
|
|
7
|
+
- **Task-focused**: Complete tasks efficiently, avoid prolonged conversation.
|
|
8
|
+
|
|
9
|
+
## TASK APPROACH
|
|
10
|
+
|
|
11
|
+
**Questions**: Provide concise instructions. Ask if they want you to perform it.
|
|
12
|
+
|
|
13
|
+
**Simple tasks**: Be direct. Use judgment for minor details. Run the right command.
|
|
14
|
+
|
|
15
|
+
**Complex tasks**:
|
|
16
|
+
1. Analyze and set clear goals
|
|
17
|
+
2. Work sequentially using tools
|
|
18
|
+
3. Verify all required parameters before calling tools (never use placeholders)
|
|
19
|
+
4. Present results clearly
|
|
20
|
+
5. Iterate on feedback but avoid pointless back-and-forth
|
|
21
|
+
|
|
22
|
+
## TOOL USE
|
|
23
|
+
|
|
24
|
+
**Principles**:
|
|
25
|
+
- Use tools sequentially, informed by previous results
|
|
26
|
+
- Never assume success - verify each step
|
|
27
|
+
- Describe actions, not tool names ("editing file" not "using edit tool")
|
|
28
|
+
- Use only native tool calling (no text-based formats like \`[tool_use]\` or \`<function>\`)
|
|
29
|
+
|
|
30
|
+
**CRITICAL - Continue after tools**: After any tool execution, immediately proceed to the next step. Don't wait for user input. Tool execution is ongoing work, not a stopping point. Chain your reasoning, stay focused on the goal, and complete thoroughly.
|
|
31
|
+
|
|
32
|
+
## CONTEXT GATHERING
|
|
33
|
+
|
|
34
|
+
**Available tools**:
|
|
35
|
+
- **find_files**: Locate files by glob pattern
|
|
36
|
+
- **search_file_contents**: Find code patterns across codebase
|
|
37
|
+
- **read_file**: Read files with progressive disclosure (>300 lines returns metadata first, then use line ranges)
|
|
38
|
+
- **lsp_get_diagnostics**: Check for errors/linting issues (before and after changes)
|
|
39
|
+
- **web_search / fetch_url**: Look up documentation, APIs, and solutions online
|
|
40
|
+
|
|
41
|
+
**Workflow**: Analyze file structure → find relevant files → search for patterns → read with line ranges → understand dependencies → make informed changes
|
|
42
|
+
|
|
43
|
+
## FILE EDITING
|
|
44
|
+
|
|
45
|
+
**read_file**: Read with line numbers. Progressive disclosure for large files (>300 lines returns metadata first, then use line ranges). NEVER use cat/head/tail.
|
|
46
|
+
|
|
47
|
+
**Editing tools** (always read_file first):
|
|
48
|
+
- **write_file**: Write entire file (creates new or overwrites existing) - use for new files, complete rewrites, generated code, or large changes
|
|
49
|
+
- **string_replace**: PRIMARY EDIT TOOL - Replace exact string content (handles replace/insert/delete operations)
|
|
50
|
+
|
|
51
|
+
**Tool selection guide**:
|
|
52
|
+
- Small edits (1-20 lines): Use \`string_replace\`
|
|
53
|
+
- Large rewrites (>50% of file): Use \`write_file\`
|
|
54
|
+
- Generated code/configs: Use \`write_file\`
|
|
55
|
+
|
|
56
|
+
**string_replace workflow**:
|
|
57
|
+
1. Read file to see current content
|
|
58
|
+
2. Copy EXACT content to replace (including whitespace, indentation, newlines)
|
|
59
|
+
3. Include 2-3 lines of surrounding context for unique matching
|
|
60
|
+
4. Specify new content (can be empty to delete)
|
|
61
|
+
|
|
62
|
+
**CRITICAL - Make granular, surgical edits**:
|
|
63
|
+
- Use \`string_replace\` for targeted changes (typically 1-20 lines)
|
|
64
|
+
- Use \`write_file\` for large rewrites (>50% of file or generated code)
|
|
65
|
+
- Include enough context in string_replace to ensure unique matching
|
|
66
|
+
- Why: Self-verifying (fails if file changed), no line number tracking, clearer intent, matches modern tools (Cline, Aider)
|
|
67
|
+
- Both tools return the actual file contents after write for verification
|
|
68
|
+
|
|
69
|
+
## TERMINAL COMMANDS (execute_bash)
|
|
70
|
+
|
|
71
|
+
**Critical rules**:
|
|
72
|
+
- NEVER read or edit files via terminal (use dedicated tools)
|
|
73
|
+
- No malicious/harmful commands
|
|
74
|
+
- Avoid unsafe commands unless explicitly necessary
|
|
75
|
+
- Don't use echo for output (respond directly to user)
|
|
76
|
+
|
|
77
|
+
**Key points**:
|
|
78
|
+
- Consider OS/shell compatibility
|
|
79
|
+
- Can't cd permanently (use \`cd /path && command\` for single commands)
|
|
80
|
+
- Interactive and long-running commands allowed
|
|
81
|
+
- If no output appears, assume success and proceed
|
|
82
|
+
- Explain what commands do
|
|
83
|
+
|
|
84
|
+
## CODING PRACTICES
|
|
85
|
+
|
|
86
|
+
- **Understand before editing**: ALWAYS read files before modifying. Never blindly suggest edits.
|
|
87
|
+
- **Manage dependencies**: Update upstream/downstream code. Use search_file_contents to find all references.
|
|
88
|
+
- **Match existing style**: Follow project patterns, idioms, and standards even if they differ from best practices.
|
|
89
|
+
- **Respect project structure**: Check manifest files (package.json, requirements.txt), understand dependencies, follow project-specific conventions.
|
|
90
|
+
- **New projects**: Organize in dedicated directory, structure logically, make easy to run.
|
|
91
|
+
|
|
92
|
+
## EXECUTION WORKFLOW
|
|
93
|
+
|
|
94
|
+
1. **Understand**: Analyze request, identify goals, determine needed context
|
|
95
|
+
2. **Gather context**: Find files, search patterns, read relevant code
|
|
96
|
+
3. **Execute step-by-step**: Sequential tools informed by previous results. Verify each step.
|
|
97
|
+
4. **Report findings**: State what you discover (not assumptions). Investigate unexpected results.
|
|
98
|
+
5. **Complete thoroughly**: Address all aspects, verify changes, consider downstream effects
|
|
99
|
+
|
|
100
|
+
## ASKING QUESTIONS
|
|
101
|
+
|
|
102
|
+
**Ask when**: Genuine ambiguities, missing required parameters, complex intent clarification needed
|
|
103
|
+
|
|
104
|
+
**Don't ask when**: Minor details (use judgment), answers findable via tools, info already provided, sufficient context exists
|
|
105
|
+
|
|
106
|
+
**How**: Be specific, concise, explain why if not obvious. Balance thoroughness with efficiency.
|
|
107
|
+
|
|
108
|
+
## CONSTRAINTS
|
|
109
|
+
|
|
110
|
+
- **Environment**: Fixed cwd. Use \`cd /path && command\` for one-off directory changes. No ~ or $HOME.
|
|
111
|
+
- **File ops**: Always use dedicated tools, never terminal commands. Read before editing. Account for auto-formatting.
|
|
112
|
+
- **Commands**: Tailor to user's OS/shell. Explain purpose. Avoid unsafe commands.
|
|
113
|
+
- **Completion**: Work systematically, continue after tools, present results, minimize unnecessary conversation.
|
|
114
|
+
- **Error handling**: Assume success if no error shown. Investigate failures. Verify with tools, not assumptions.
|
|
115
|
+
|
|
116
|
+
## SYSTEM INFORMATION
|
|
117
|
+
|
|
118
|
+
<!-- DYNAMIC_SYSTEM_INFO_START -->
|
|
119
|
+
|
|
120
|
+
System information will be dynamically inserted here.
|
|
121
|
+
|
|
122
|
+
<!-- DYNAMIC_SYSTEM_INFO_END -->
|
|
123
|
+
`;
|
|
124
|
+
//# sourceMappingURL=main-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main-prompt.js","sourceRoot":"","sources":["../../../source/app/prompts/main-prompt.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0H1B,CAAC"}
|
package/dist/commands/help.js
CHANGED
|
@@ -30,7 +30,7 @@ async function getPackageVersion() {
|
|
|
30
30
|
function Help({ version, commands, }) {
|
|
31
31
|
const boxWidth = useTerminalWidth();
|
|
32
32
|
const { colors } = useTheme();
|
|
33
|
-
return (_jsxs(TitledBox, { title: "/help", width: boxWidth, borderColor: colors.primary, paddingX: 2, paddingY: 1, flexDirection: "column", marginBottom: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { color: colors.primary, bold: true, children: ["Coder \u2013 ", version] }) }), _jsx(Text, { color: colors.white, children: "A local-
|
|
33
|
+
return (_jsxs(TitledBox, { title: "/help", width: boxWidth, borderColor: colors.primary, paddingX: 2, paddingY: 1, flexDirection: "column", marginBottom: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { color: colors.primary, bold: true, children: ["Coder \u2013 ", version] }) }), _jsx(Text, { color: colors.white, children: "A first local-based CLI coding agent that brings the power of agentic coding tools like Claude Code, Gemini CLI and etc., to local models or controlled APIs." }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: colors.secondary, children: "Always review model responses, especially when running code. Models have read access to files in the current directory and can run commands and edit files with your permission. *Might need to hit ENTER after task/command execution for retrieving input from terminal." }) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: colors.primary, bold: true, children: "Common Tasks:" }) }), _jsxs(Text, { color: colors.white, children: [' ', "\u2022 Ask questions about your codebase ", '>', " How does foo.py work?"] }), _jsxs(Text, { color: colors.white, children: [" \u2022 Edit files ", '>', " Update bar.ts to..."] }), _jsxs(Text, { color: colors.white, children: [" \u2022 Fix errors ", '>', " cargo build"] }), _jsxs(Text, { color: colors.white, children: [" \u2022 Run commands ", '>', " /help"] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: colors.primary, bold: true, children: "Commands:" }) }), commands.length === 0 ? (_jsx(Text, { color: colors.white, children: " No commands available." })) : (commands.map((cmd, index) => (_jsxs(Text, { color: colors.white, children: [' ', "\u2022 /", cmd.name, " - ", cmd.description] }, index))))] }));
|
|
34
34
|
}
|
|
35
35
|
export const helpCommand = {
|
|
36
36
|
name: 'help',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../source/commands/help.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAC1C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAC,aAAa,EAAC,MAAM,KAAK,CAAC;AAClC,OAAO,EAAC,eAAe,EAAC,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAC,SAAS,EAAC,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAC,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAC;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GA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wBAAgB,SAAS,IAAI,MAAM,CAOlC;AAGD,eAAO,MAAM,MAAM,QAIjB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/config/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAkBvD,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,CAAC;AAGrD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAyC7D;AAkDD,eAAO,IAAI,SAAS,WAAkB,CAAC;AAGvC,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAID,wBAAgB,SAAS,IAAI,MAAM,CAOlC;AAGD,eAAO,MAAM,MAAM,QAIjB,CAAC"}
|
package/dist/config/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
|
|
2
2
|
import { homedir } from 'os';
|
|
3
|
-
import {
|
|
4
|
-
import { fileURLToPath } from 'url';
|
|
3
|
+
import { join } from 'path';
|
|
5
4
|
import { substituteEnvVars } from '../config/env-substitution.js';
|
|
6
5
|
import { getConfigPath } from '../config/paths.js';
|
|
7
6
|
import { loadPreferences } from '../config/preferences.js';
|
|
@@ -116,10 +115,5 @@ export const colors = new Proxy({}, {
|
|
|
116
115
|
return getColors()[prop];
|
|
117
116
|
},
|
|
118
117
|
});
|
|
119
|
-
//
|
|
120
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
121
|
-
const __dirname = dirname(__filename);
|
|
122
|
-
// Go up from dist/config to package root, then to source/app/prompts/main-prompt.md
|
|
123
|
-
// This works because source/app/prompts/main-prompt.md is included in the package.json files array
|
|
124
|
-
export const promptPath = join(__dirname, '../../source/app/prompts/main-prompt.md');
|
|
118
|
+
// output
|
|
125
119
|
//# sourceMappingURL=index.js.map
|
package/dist/config/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAW,IAAI,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,QAAQ,CAAC;AAE3C,6EAA6E;AAC7E,mEAAmE;AACnE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;AAC5C,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;IACzB,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAChE,OAAO,CAAC,MAAM,CAAC,KAAK,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC;IAClC,IAAI,CAAC;QACJ,OAAO,CAAC,EAAE,IAAI,EAAE,OA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,CAAC,KAAK,CAAC,SAAS,IAAI,EAAE;gBAC9C,UAAU,EAAE,aAAa,CAAC,KAAK,CAAC,UAAU,IAAI,EAAE;aAChD,CAAC;QACH,CAAC;IACF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,UAAU,CACT,qCAAqC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAC7F,CAAC;IACH,CAAC;IAED,OAAO,EAAE,CAAC;AACX,CAAC;AAED,MAAM,CAAC,IAAI,SAAS,GAAG,aAAa,EAAE,CAAC;AAEvC,8EAA8E;AAC9E,MAAM,UAAU,eAAe;IAC9B,SAAS,GAAG,aAAa,EAAE,CAAC;AAC7B,CAAC;AAED,IAAI,YAAY,GAAkB,IAAI,CAAC;AAEvC,MAAM,UAAU,SAAS;IACxB,IAAI,CAAC,YAAY,EAAE,CAAC;QACnB,MAAM,WAAW,GAAG,eAAe,EAAE,CAAC;QACtC,MAAM,aAAa,GAAG,WAAW,CAAC,aAAa,IAAI,YAAY,CAAC;QAChE,YAAY,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,YAAY,CAAC;AACrB,CAAC;AAED,wFAAwF;AACxF,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,EAAY,EAAE;IAC7C,GAAG,CAAC,OAAO,EAAE,IAAI;QAChB,OAAO,SAAS,EAAE,CAAC,IAAoB,CAAC,CAAC;IAC1C,CAAC;CACD,CAAC,CAAC;AAEH,SAAS"}
|
|
@@ -90,12 +90,7 @@ test('default config file contains valid JSON', t => {
|
|
|
90
90
|
rmSync(configPath, { force: true });
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
|
-
|
|
94
|
-
// Dynamic import to get the promptPath
|
|
95
|
-
const { promptPath } = await import('./index.js');
|
|
96
|
-
t.true(promptPath.includes('main-prompt.md'), 'promptPath should point to main-prompt.md');
|
|
97
|
-
t.true(promptPath.includes('source/app/prompts'), 'promptPath should include source/app/prompts directory');
|
|
98
|
-
});
|
|
93
|
+
// output
|
|
99
94
|
test('loadAppConfig handles malformed JSON gracefully', async (t) => {
|
|
100
95
|
const fileName = 'malformed-config.json';
|
|
101
96
|
const configPath = getClosestConfigFile(fileName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../source/config/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../source/config/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,IAAI,MAAM,KAAK,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE5E,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;AAE/B,oCAAoC;AACpC,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,cAAc,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAE3D,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;IAChB,wBAAwB;IACxB,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AACzC,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE;IACtB,0BAA0B;IAC1B,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACzB,MAAM,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,E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AC,+CAA+C,CAAC,CAAC;IACzD,CAAC;YAAS,CAAC;QACV,WAAW;QACX,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC5B,MAAM,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACrC,CAAC;IACF,CAAC;AACF,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,+CAA+C,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IAC/D,0DAA0D;IAC1D,uDAAuD;IACvD,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAElC,IAAI,CAAC;QACJ,4DAA4D;QAC5D,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEvB,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC;QACvD,eAAe,EAAE,CAAC;QAClB,CAAC,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;IAC9D,CAAC;YAAS,CAAC;QACV,6BAA6B;QAC7B,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAC5B,CAAC;AACF,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-processor.d.ts","sourceRoot":"","sources":["../../source/utils/prompt-processor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"prompt-processor.d.ts","sourceRoot":"","sources":["../../source/utils/prompt-processor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAqEjD;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAuB9C;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAqD7D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'fs';
|
|
2
2
|
import { homedir, platform, release } from 'os';
|
|
3
3
|
import { join } from 'path';
|
|
4
|
-
import {
|
|
4
|
+
import { MAIN_PROMPT } from '../app/prompts/main-prompt.js';
|
|
5
5
|
import { PlaceholderType } from '../types/hooks.js';
|
|
6
6
|
import { getLogger } from './logging/index.js';
|
|
7
7
|
/**
|
|
@@ -64,18 +64,7 @@ function injectSystemInfo(prompt) {
|
|
|
64
64
|
* Process the main prompt template by injecting system info
|
|
65
65
|
*/
|
|
66
66
|
export function processPromptTemplate() {
|
|
67
|
-
let systemPrompt =
|
|
68
|
-
// Load base prompt
|
|
69
|
-
if (existsSync(promptPath)) {
|
|
70
|
-
try {
|
|
71
|
-
systemPrompt = readFileSync(promptPath, 'utf-8');
|
|
72
|
-
}
|
|
73
|
-
catch (error) {
|
|
74
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
75
|
-
const logger = getLogger();
|
|
76
|
-
logger.warn(`Failed to load system prompt from ${promptPath}: ${errorMessage}`);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
67
|
+
let systemPrompt = MAIN_PROMPT;
|
|
79
68
|
// Inject system information
|
|
80
69
|
systemPrompt = injectSystemInfo(systemPrompt);
|
|
81
70
|
// Check for AGENTS.md in current working directory and append it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-processor.js","sourceRoot":"","sources":["../../source/utils/prompt-processor.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"prompt-processor.js","sourceRoot":"","sources":["../../source/utils/prompt-processor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,g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