thatgfsj-code 0.7.7 → 0.7.8
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/cmd/index.js +1 -1
- package/dist/prompts/index.d.ts +1 -1
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +28 -23
- package/dist/prompts/index.js.map +1 -1
- package/dist/tui/components/Header.js +1 -1
- package/package.json +1 -1
- package/src/cmd/index.tsx +1 -1
- package/src/prompts/index.ts +32 -23
- package/src/tui/components/Header.tsx +1 -1
package/dist/cmd/index.js
CHANGED
|
@@ -24,7 +24,7 @@ process.on('unhandledRejection', (reason) => {
|
|
|
24
24
|
program
|
|
25
25
|
.name('gfcode')
|
|
26
26
|
.description('Thatgfsj Code - AI Coding Assistant')
|
|
27
|
-
.version('0.7.
|
|
27
|
+
.version('0.7.8')
|
|
28
28
|
.argument('[prompt]', 'Task to execute (omit to start interactive mode)')
|
|
29
29
|
.option('-m, --model <model>', 'Specify model')
|
|
30
30
|
.option('-i, --interactive', 'Force interactive mode')
|
package/dist/prompts/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare class SystemPromptBuilder {
|
|
|
19
19
|
private buildEnvironment;
|
|
20
20
|
private buildPermissionMode;
|
|
21
21
|
/**
|
|
22
|
-
* Read
|
|
22
|
+
* Read project instruction files (generic, works for any user)
|
|
23
23
|
*/
|
|
24
24
|
private buildProjectInstructions;
|
|
25
25
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,c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AAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IACzB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,IAAI;CACzD"}
|
package/dist/prompts/index.js
CHANGED
|
@@ -75,48 +75,53 @@ export class SystemPromptBuilder {
|
|
|
75
75
|
return `## Permission Mode\n\nCurrent mode: ${mode}\n\n${explanations[mode] || ''}`;
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
|
-
* Read
|
|
78
|
+
* Read project instruction files (generic, works for any user)
|
|
79
79
|
*/
|
|
80
80
|
buildProjectInstructions() {
|
|
81
81
|
if (!this.config.includeProjectMd)
|
|
82
82
|
return '';
|
|
83
83
|
const cwd = this.config.cwd;
|
|
84
84
|
const home = process.env.USERPROFILE || process.env.HOME || '';
|
|
85
|
-
//
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
join(cwd, 'AGENTS.md'),
|
|
91
|
-
join(cwd, 'Codex.md'),
|
|
92
|
-
join(cwd, '.Codex.md'),
|
|
93
|
-
join(cwd, 'CODEX.md'),
|
|
94
|
-
join(cwd, '.codex.md'),
|
|
95
|
-
// User-level
|
|
96
|
-
join(home, '.claude', 'CLAUDE.md'),
|
|
97
|
-
join(home, '.claude', 'SKILLS.md'),
|
|
98
|
-
join(home, '.Codex', 'SKILLS.md'),
|
|
99
|
-
join(home, '.Codex', 'AGENTS.md'),
|
|
100
|
-
join(home, '.agents', 'AGENTS.md'),
|
|
85
|
+
// Project-level files (any project can have these)
|
|
86
|
+
const projectFiles = [
|
|
87
|
+
'CLAUDE.md', '.claude.md', 'AGENTS.md',
|
|
88
|
+
'Codex.md', '.Codex.md', 'CODEX.md', '.codex.md',
|
|
89
|
+
'CONVENTIONS.md', 'CONTRIBUTING.md',
|
|
101
90
|
];
|
|
91
|
+
// User-level files (in home directory)
|
|
92
|
+
const userDirs = ['.claude', '.Codex', '.agents'];
|
|
93
|
+
const userFiles = ['CLAUDE.md', 'SKILLS.md', 'AGENTS.md', 'CONVENTIONS.md'];
|
|
94
|
+
const paths = [];
|
|
95
|
+
// Project-level
|
|
96
|
+
for (const f of projectFiles) {
|
|
97
|
+
paths.push(join(cwd, f));
|
|
98
|
+
}
|
|
99
|
+
// User-level
|
|
100
|
+
for (const dir of userDirs) {
|
|
101
|
+
for (const f of userFiles) {
|
|
102
|
+
paths.push(join(home, dir, f));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
102
105
|
const sections = [];
|
|
106
|
+
const MAX_LEN = 3000;
|
|
103
107
|
for (const path of paths) {
|
|
104
108
|
if (existsSync(path)) {
|
|
105
109
|
try {
|
|
106
|
-
|
|
110
|
+
let content = readFileSync(path, 'utf-8').trim();
|
|
107
111
|
if (content) {
|
|
108
112
|
const filename = path.split(/[/\\]/).pop();
|
|
109
|
-
|
|
113
|
+
if (content.length > MAX_LEN) {
|
|
114
|
+
content = content.slice(0, MAX_LEN) + '\n... (truncated)';
|
|
115
|
+
}
|
|
116
|
+
sections.push(`[${filename}]\n${content}`);
|
|
110
117
|
}
|
|
111
118
|
}
|
|
112
|
-
catch {
|
|
113
|
-
// Skip unreadable files
|
|
114
|
-
}
|
|
119
|
+
catch { }
|
|
115
120
|
}
|
|
116
121
|
}
|
|
117
122
|
if (sections.length === 0)
|
|
118
123
|
return '';
|
|
119
|
-
return `##
|
|
124
|
+
return `## User Configuration\n\n${sections.join('\n\n')}`;
|
|
120
125
|
}
|
|
121
126
|
/**
|
|
122
127
|
* Auto-inject recent NWT history into system prompt
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAY5B,MAAM,OAAO,mBAAmB;IACtB,MAAM,CAA+B;I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,CAAC,CAAC;QAC9D,OAAO,sBAAsB,GAAG,EAAE,CAAC;IACrC,CAAC;IAED,QAAQ,CAAC,KAAa,IAAU,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC;IACzE,MAAM,CAAC,GAAW,IAAU,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC;IACjE,iBAAiB,CAAC,IAA+B,IAAU,IAAI,CAAC,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC;CAC7G"}
|
|
@@ -3,6 +3,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Box, Text } from 'ink';
|
|
5
5
|
export const Header = React.memo(function Header({ provider, model }) {
|
|
6
|
-
return (_jsxs(Box, { flexDirection: "column", marginBottom: 0, children: [_jsxs(Box, { justifyContent: "space-between", width: "100%", children: [_jsxs(Box, { children: [_jsx(Text, { color: "#06B6D4", bold: true, children: " \u26A1 " }), _jsx(Text, { color: "#22D3EE", bold: true, children: "THATGFSJ CODE" }), _jsx(Text, { dimColor: true, children: " v0.7.
|
|
6
|
+
return (_jsxs(Box, { flexDirection: "column", marginBottom: 0, children: [_jsxs(Box, { justifyContent: "space-between", width: "100%", children: [_jsxs(Box, { children: [_jsx(Text, { color: "#06B6D4", bold: true, children: " \u26A1 " }), _jsx(Text, { color: "#22D3EE", bold: true, children: "THATGFSJ CODE" }), _jsx(Text, { dimColor: true, children: " v0.7.8" })] }), _jsxs(Box, { children: [_jsxs(Text, { color: "#06B6D4", bold: true, children: [" ", provider, " "] }), _jsx(Text, { dimColor: true, children: "/" }), _jsxs(Text, { color: "#22D3EE", children: [" ", model, " "] })] })] }), _jsx(Text, { color: "#374151", children: '─'.repeat(80) })] }));
|
|
7
7
|
});
|
|
8
8
|
//# sourceMappingURL=Header.js.map
|
package/package.json
CHANGED
package/src/cmd/index.tsx
CHANGED
|
@@ -28,7 +28,7 @@ process.on('unhandledRejection', (reason) => {
|
|
|
28
28
|
program
|
|
29
29
|
.name('gfcode')
|
|
30
30
|
.description('Thatgfsj Code - AI Coding Assistant')
|
|
31
|
-
.version('0.7.
|
|
31
|
+
.version('0.7.8')
|
|
32
32
|
.argument('[prompt]', 'Task to execute (omit to start interactive mode)')
|
|
33
33
|
.option('-m, --model <model>', 'Specify model')
|
|
34
34
|
.option('-i, --interactive', 'Force interactive mode')
|
package/src/prompts/index.ts
CHANGED
|
@@ -95,7 +95,7 @@ export class SystemPromptBuilder {
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
/**
|
|
98
|
-
* Read
|
|
98
|
+
* Read project instruction files (generic, works for any user)
|
|
99
99
|
*/
|
|
100
100
|
private buildProjectInstructions(): string {
|
|
101
101
|
if (!this.config.includeProjectMd) return '';
|
|
@@ -103,42 +103,51 @@ export class SystemPromptBuilder {
|
|
|
103
103
|
const cwd = this.config.cwd;
|
|
104
104
|
const home = process.env.USERPROFILE || process.env.HOME || '';
|
|
105
105
|
|
|
106
|
-
//
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
join(cwd, 'AGENTS.md'),
|
|
112
|
-
join(cwd, 'Codex.md'),
|
|
113
|
-
join(cwd, '.Codex.md'),
|
|
114
|
-
join(cwd, 'CODEX.md'),
|
|
115
|
-
join(cwd, '.codex.md'),
|
|
116
|
-
// User-level
|
|
117
|
-
join(home, '.claude', 'CLAUDE.md'),
|
|
118
|
-
join(home, '.claude', 'SKILLS.md'),
|
|
119
|
-
join(home, '.Codex', 'SKILLS.md'),
|
|
120
|
-
join(home, '.Codex', 'AGENTS.md'),
|
|
121
|
-
join(home, '.agents', 'AGENTS.md'),
|
|
106
|
+
// Project-level files (any project can have these)
|
|
107
|
+
const projectFiles = [
|
|
108
|
+
'CLAUDE.md', '.claude.md', 'AGENTS.md',
|
|
109
|
+
'Codex.md', '.Codex.md', 'CODEX.md', '.codex.md',
|
|
110
|
+
'CONVENTIONS.md', 'CONTRIBUTING.md',
|
|
122
111
|
];
|
|
123
112
|
|
|
113
|
+
// User-level files (in home directory)
|
|
114
|
+
const userDirs = ['.claude', '.Codex', '.agents'];
|
|
115
|
+
const userFiles = ['CLAUDE.md', 'SKILLS.md', 'AGENTS.md', 'CONVENTIONS.md'];
|
|
116
|
+
|
|
117
|
+
const paths: string[] = [];
|
|
118
|
+
|
|
119
|
+
// Project-level
|
|
120
|
+
for (const f of projectFiles) {
|
|
121
|
+
paths.push(join(cwd, f));
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// User-level
|
|
125
|
+
for (const dir of userDirs) {
|
|
126
|
+
for (const f of userFiles) {
|
|
127
|
+
paths.push(join(home, dir, f));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
124
131
|
const sections: string[] = [];
|
|
132
|
+
const MAX_LEN = 3000;
|
|
125
133
|
|
|
126
134
|
for (const path of paths) {
|
|
127
135
|
if (existsSync(path)) {
|
|
128
136
|
try {
|
|
129
|
-
|
|
137
|
+
let content = readFileSync(path, 'utf-8').trim();
|
|
130
138
|
if (content) {
|
|
131
139
|
const filename = path.split(/[/\\]/).pop();
|
|
132
|
-
|
|
140
|
+
if (content.length > MAX_LEN) {
|
|
141
|
+
content = content.slice(0, MAX_LEN) + '\n... (truncated)';
|
|
142
|
+
}
|
|
143
|
+
sections.push(`[${filename}]\n${content}`);
|
|
133
144
|
}
|
|
134
|
-
} catch {
|
|
135
|
-
// Skip unreadable files
|
|
136
|
-
}
|
|
145
|
+
} catch {}
|
|
137
146
|
}
|
|
138
147
|
}
|
|
139
148
|
|
|
140
149
|
if (sections.length === 0) return '';
|
|
141
|
-
return `##
|
|
150
|
+
return `## User Configuration\n\n${sections.join('\n\n')}`;
|
|
142
151
|
}
|
|
143
152
|
|
|
144
153
|
/**
|
|
@@ -14,7 +14,7 @@ export const Header = React.memo(function Header({ provider, model }: Props) {
|
|
|
14
14
|
<Box>
|
|
15
15
|
<Text color="#06B6D4" bold> ⚡ </Text>
|
|
16
16
|
<Text color="#22D3EE" bold>THATGFSJ CODE</Text>
|
|
17
|
-
<Text dimColor> v0.7.
|
|
17
|
+
<Text dimColor> v0.7.8</Text>
|
|
18
18
|
</Box>
|
|
19
19
|
<Box>
|
|
20
20
|
<Text color="#06B6D4" bold> {provider} </Text>
|