compact-agent 1.24.2 → 1.25.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/README.md +123 -281
- package/bin/ecc-hooks.cjs +394 -394
- package/dist/codemaps.js +3 -2
- package/dist/codemaps.js.map +1 -1
- package/dist/config.d.ts +17 -0
- package/dist/config.js +89 -5
- package/dist/config.js.map +1 -1
- package/dist/cost-tracker.js +1 -1
- package/dist/ecc.js +10 -10
- package/dist/ecc.js.map +1 -1
- package/dist/hooks.js +3 -3
- package/dist/hooks.js.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/learning.js +1 -1
- package/dist/login.js +1 -1
- package/dist/memory.js +1 -1
- package/dist/mempalace/index.d.ts +6 -2
- package/dist/mempalace/index.js +10 -3
- package/dist/mempalace/index.js.map +1 -1
- package/dist/mempalace/store.d.ts +2 -2
- package/dist/mempalace/store.js +5 -5
- package/dist/mempalace/store.js.map +1 -1
- package/dist/mempalace/types.d.ts +4 -4
- package/dist/mempalace/types.js +2 -2
- package/dist/package-detect.d.ts +2 -2
- package/dist/package-detect.js +8 -6
- package/dist/package-detect.js.map +1 -1
- package/dist/rules.js +795 -795
- package/dist/rules.js.map +1 -1
- package/dist/sessions.js +1 -1
- package/dist/skills.js +1 -1
- package/dist/stitch.js +132 -132
- package/dist/system-prompt.js +85 -85
- package/dist/theme.js +1 -1
- package/dist/theme.js.map +1 -1
- package/dist/tools/stitch.d.ts +1 -1
- package/dist/users.js +1 -1
- package/dist/walkthrough.js +111 -111
- package/package.json +73 -68
- package/resources/ecc/skills/repo-scan/SKILL.md +15 -15
package/dist/rules.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../src/rules.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MA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;IACrE,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,0DAA0D,CAAC,CAAC,CAAC;IACnF,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC"}
|
package/dist/sessions.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Session persistence — save, resume, list, delete conversations.
|
|
3
|
-
* Stores sessions as JSON files in ~/.
|
|
3
|
+
* Stores sessions as JSON files in ~/.compact-agent/sessions/
|
|
4
4
|
*/
|
|
5
5
|
import { readFileSync, writeFileSync, readdirSync, unlinkSync, mkdirSync, existsSync } from 'node:fs';
|
|
6
6
|
import { join } from 'node:path';
|
package/dist/skills.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Skills system — reusable prompt templates extracted from instincts or git history.
|
|
3
|
-
* Data stored in ~/.
|
|
3
|
+
* Data stored in ~/.compact-agent/skills/
|
|
4
4
|
*/
|
|
5
5
|
import { readFileSync, writeFileSync, readdirSync, mkdirSync, existsSync, unlinkSync } from 'node:fs';
|
|
6
6
|
import { join } from 'node:path';
|
package/dist/stitch.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* gemini-extension commands/stitch.toml — intent routing between
|
|
12
12
|
* "enhance a prompt" and "use the assistant" modes.
|
|
13
13
|
*
|
|
14
|
-
* Auth: API key only, stored at ~/.
|
|
14
|
+
* Auth: API key only, stored at ~/.compact-agent/stitch.json. ADC auth
|
|
15
15
|
* (Google Cloud) would require gcloud + the OAuth dance — out of scope
|
|
16
16
|
* for now. Get a key from https://stitch.withgoogle.com/ → profile menu
|
|
17
17
|
* → Stitch Settings → API Keys → Create Key.
|
|
@@ -106,27 +106,27 @@ export async function callStitchMcp(req) {
|
|
|
106
106
|
* (async via runQuery) so we don't need to make handleSlashCommand async.
|
|
107
107
|
*/
|
|
108
108
|
export function buildStitchToolsPrompt() {
|
|
109
|
-
return `# Stitch — list available MCP tools
|
|
110
|
-
|
|
111
|
-
Call the \`stitch\` tool with:
|
|
112
|
-
|
|
113
|
-
\`\`\`json
|
|
114
|
-
{ "method": "tools/list" }
|
|
115
|
-
\`\`\`
|
|
116
|
-
|
|
117
|
-
The response will be \`{ tools: [{ name, description, inputSchema }, ...] }\`.
|
|
118
|
-
|
|
119
|
-
Then render the catalog as a clean Markdown table with columns:
|
|
120
|
-
- **name** (exact string the user types)
|
|
121
|
-
- **description** (first line, trimmed)
|
|
122
|
-
- **required args** (comma-separated list from inputSchema.required, or "—")
|
|
123
|
-
|
|
124
|
-
If the call fails (non-ok response), report the HTTP status and error
|
|
125
|
-
message verbatim and suggest:
|
|
126
|
-
- Check the API key is valid (\`/stitch-status\`)
|
|
127
|
-
- Re-set it via \`/stitch-config <api-key>\`
|
|
128
|
-
- Confirm internet reachability
|
|
129
|
-
|
|
109
|
+
return `# Stitch — list available MCP tools
|
|
110
|
+
|
|
111
|
+
Call the \`stitch\` tool with:
|
|
112
|
+
|
|
113
|
+
\`\`\`json
|
|
114
|
+
{ "method": "tools/list" }
|
|
115
|
+
\`\`\`
|
|
116
|
+
|
|
117
|
+
The response will be \`{ tools: [{ name, description, inputSchema }, ...] }\`.
|
|
118
|
+
|
|
119
|
+
Then render the catalog as a clean Markdown table with columns:
|
|
120
|
+
- **name** (exact string the user types)
|
|
121
|
+
- **description** (first line, trimmed)
|
|
122
|
+
- **required args** (comma-separated list from inputSchema.required, or "—")
|
|
123
|
+
|
|
124
|
+
If the call fails (non-ok response), report the HTTP status and error
|
|
125
|
+
message verbatim and suggest:
|
|
126
|
+
- Check the API key is valid (\`/stitch-status\`)
|
|
127
|
+
- Re-set it via \`/stitch-config <api-key>\`
|
|
128
|
+
- Confirm internet reachability
|
|
129
|
+
|
|
130
130
|
Do not invoke any tools other than \`stitch\`. Do not edit any files.`;
|
|
131
131
|
}
|
|
132
132
|
// ── Status ──────────────────────────────────────────────
|
|
@@ -161,116 +161,116 @@ export function printStitchStatus() {
|
|
|
161
161
|
*/
|
|
162
162
|
export function buildStitchPrompt(query) {
|
|
163
163
|
const safeQuery = query.replace(/`/g, '\\`');
|
|
164
|
-
return `# Stitch Intelligent Interface
|
|
165
|
-
|
|
166
|
-
You are the Stitch interface inside Compact Agent. Stitch is Google's AI
|
|
167
|
-
UI/UX design and code generation tool (https://stitch.withgoogle.com/).
|
|
168
|
-
Connect via the \`stitch\` tool, which wraps the Stitch MCP server at
|
|
169
|
-
https://stitch.googleapis.com/mcp.
|
|
170
|
-
|
|
171
|
-
Call shape:
|
|
172
|
-
|
|
173
|
-
{ "method": "tools/call", "name": "<tool>", "arguments": { ... } }
|
|
174
|
-
|
|
175
|
-
Use \`{ "method": "tools/list" }\` only if you encounter a tool-not-found
|
|
176
|
-
error — the catalog below is the authoritative list from the upstream
|
|
177
|
-
reference docs.
|
|
178
|
-
|
|
179
|
-
The user's query is: "${safeQuery}"
|
|
180
|
-
|
|
181
|
-
## Intent classification
|
|
182
|
-
|
|
183
|
-
Does the user want to **Enhance / Improve** a design prompt?
|
|
184
|
-
* **YES** (triggers: "enhance", "refine", "make this better"): PROTOCOL A.
|
|
185
|
-
* **NO** (any other Stitch operation): PROTOCOL B.
|
|
186
|
-
|
|
187
|
-
## PROTOCOL A: ENHANCE
|
|
188
|
-
|
|
189
|
-
1. \`web_fetch\` https://discuss.ai.google.dev/t/stitch-prompt-guide/83844
|
|
190
|
-
for the Stitch Effective Prompting Guide. Read it.
|
|
191
|
-
2. Generate a snake_case filename for the topic (e.g. \`podcast_landing_page.md\`).
|
|
192
|
-
3. Rewrite the user's intent into a polished prompt following the guide.
|
|
193
|
-
4. \`write_file\` to save it to that filename in the CWD.
|
|
194
|
-
5. Reply: "✨ Enhanced prompt saved to \`[filename]\`."
|
|
195
|
-
|
|
196
|
-
## PROTOCOL B: ASSISTANT
|
|
197
|
-
|
|
198
|
-
Use the catalog below. **Project Management** + **Screen Management** are
|
|
199
|
-
read-only and fast. **AI Generation** + **Design Systems** mutate state and
|
|
200
|
-
can take **a few minutes** — do NOT retry on connection errors; instead
|
|
201
|
-
poll \`get_screen\` after a few minutes to see if it completed.
|
|
202
|
-
|
|
203
|
-
### Domain model
|
|
204
|
-
|
|
205
|
-
- A user owns **projects** (a project is a container of UI work).
|
|
206
|
-
- Each project has many **screens**. A screen has an image + full HTML/
|
|
207
|
-
Tailwind document.
|
|
208
|
-
- Screens can share a **design system** (theme, components, tokens).
|
|
209
|
-
- Resource names follow Google Cloud format: \`projects/{projectId}\` and
|
|
210
|
-
\`projects/{projectId}/screens/{screenId}\`.
|
|
211
|
-
|
|
212
|
-
### Project Management
|
|
213
|
-
|
|
214
|
-
\`create_project\` (writes) — Create a new project.
|
|
215
|
-
\`get_project\` (read-only) — Args: \`{ name: "projects/{projectId}" }\`.
|
|
216
|
-
\`list_projects\` (read-only) — Args: \`{}\` or omit.
|
|
217
|
-
|
|
218
|
-
### Screen Management
|
|
219
|
-
|
|
220
|
-
\`list_screens\` (read-only) — Args: \`{ projectId: "<id-no-prefix>" }\`.
|
|
221
|
-
Returns an array of Screen objects.
|
|
222
|
-
\`get_screen\` (read-only) — Prefer \`{ name: "projects/{p}/screens/{s}" }\`.
|
|
223
|
-
Legacy \`projectId\` + \`screenId\` (deprecated, no prefixes) are also
|
|
224
|
-
accepted; currently all three may be required together.
|
|
225
|
-
|
|
226
|
-
### AI Generation (destructive, slow — minutes per call)
|
|
227
|
-
|
|
228
|
-
\`generate_screen_from_text\` — Generates a new screen from a text prompt.
|
|
229
|
-
Args: \`{ projectId, prompt, deviceType?, modelId? }\`.
|
|
230
|
-
- \`deviceType\` enum: \`DEVICE_TYPE_UNSPECIFIED\` | \`MOBILE\` | \`DESKTOP\` |
|
|
231
|
-
\`TABLET\` | \`AGNOSTIC\`. Default unspecified.
|
|
232
|
-
- \`modelId\` enum: \`MODEL_ID_UNSPECIFIED\` | \`GEMINI_3_PRO\` |
|
|
233
|
-
\`GEMINI_3_FLASH\`. Default unspecified (server picks Flash).
|
|
234
|
-
- If the response \`output_components\` field contains suggestions,
|
|
235
|
-
present them to the user. If accepted, call this tool AGAIN with the
|
|
236
|
-
chosen suggestion as the new \`prompt\`.
|
|
237
|
-
- This call takes **a few minutes**. Avoid retrying on connection
|
|
238
|
-
errors — they don't necessarily mean failure. Instead, poll
|
|
239
|
-
\`get_screen\` after a few minutes.
|
|
240
|
-
|
|
241
|
-
\`edit_screens\` — Edits existing screens with a text prompt.
|
|
242
|
-
Args: \`{ projectId, selectedScreenIds: [string], prompt, deviceType? }\`.
|
|
243
|
-
Same minutes-long behavior as \`generate_screen_from_text\`.
|
|
244
|
-
|
|
245
|
-
\`generate_variants\` — Produces alternate variants of a screen.
|
|
246
|
-
|
|
247
|
-
### Design Systems
|
|
248
|
-
|
|
249
|
-
\`create_design_system\` (writes) — Create a new design system.
|
|
250
|
-
\`update_design_system\` (writes) — Update an existing one.
|
|
251
|
-
\`list_design_systems\` (read-only) — List available design systems.
|
|
252
|
-
\`apply_design_system\` (writes) — Apply a design system to screens.
|
|
253
|
-
|
|
254
|
-
## Rules
|
|
255
|
-
|
|
256
|
-
1. **Don't retry slow AI calls.** If \`generate_screen_from_text\` or
|
|
257
|
-
\`edit_screens\` returns a network/timeout error, the work is likely
|
|
258
|
-
still progressing on the server. Wait, then call \`get_screen\` to
|
|
259
|
-
check status. Mention this to the user so they don't get impatient.
|
|
260
|
-
|
|
261
|
-
2. **Surface suggestions.** When \`generate_screen_from_text\` returns
|
|
262
|
-
\`output_components\` with prompt suggestions, list them for the user
|
|
263
|
-
in a numbered list and ask which to use.
|
|
264
|
-
|
|
265
|
-
3. **Resource names over deprecated IDs.** Prefer the \`name\` form
|
|
266
|
-
(\`projects/{p}\` or \`projects/{p}/screens/{s}\`) over bare \`projectId\`
|
|
267
|
-
when both are accepted.
|
|
268
|
-
|
|
269
|
-
4. **Read-only vs destructive matters.** Use read-only tools liberally to
|
|
270
|
-
explore. Confirm before generating/editing if the user wasn't explicit.
|
|
271
|
-
|
|
272
|
-
5. **Respond with structure.** Lists → Markdown tables. Generated screens
|
|
273
|
-
→ screen id + brief description + offer to fetch with \`get_screen\`.
|
|
164
|
+
return `# Stitch Intelligent Interface
|
|
165
|
+
|
|
166
|
+
You are the Stitch interface inside Compact Agent. Stitch is Google's AI
|
|
167
|
+
UI/UX design and code generation tool (https://stitch.withgoogle.com/).
|
|
168
|
+
Connect via the \`stitch\` tool, which wraps the Stitch MCP server at
|
|
169
|
+
https://stitch.googleapis.com/mcp.
|
|
170
|
+
|
|
171
|
+
Call shape:
|
|
172
|
+
|
|
173
|
+
{ "method": "tools/call", "name": "<tool>", "arguments": { ... } }
|
|
174
|
+
|
|
175
|
+
Use \`{ "method": "tools/list" }\` only if you encounter a tool-not-found
|
|
176
|
+
error — the catalog below is the authoritative list from the upstream
|
|
177
|
+
reference docs.
|
|
178
|
+
|
|
179
|
+
The user's query is: "${safeQuery}"
|
|
180
|
+
|
|
181
|
+
## Intent classification
|
|
182
|
+
|
|
183
|
+
Does the user want to **Enhance / Improve** a design prompt?
|
|
184
|
+
* **YES** (triggers: "enhance", "refine", "make this better"): PROTOCOL A.
|
|
185
|
+
* **NO** (any other Stitch operation): PROTOCOL B.
|
|
186
|
+
|
|
187
|
+
## PROTOCOL A: ENHANCE
|
|
188
|
+
|
|
189
|
+
1. \`web_fetch\` https://discuss.ai.google.dev/t/stitch-prompt-guide/83844
|
|
190
|
+
for the Stitch Effective Prompting Guide. Read it.
|
|
191
|
+
2. Generate a snake_case filename for the topic (e.g. \`podcast_landing_page.md\`).
|
|
192
|
+
3. Rewrite the user's intent into a polished prompt following the guide.
|
|
193
|
+
4. \`write_file\` to save it to that filename in the CWD.
|
|
194
|
+
5. Reply: "✨ Enhanced prompt saved to \`[filename]\`."
|
|
195
|
+
|
|
196
|
+
## PROTOCOL B: ASSISTANT
|
|
197
|
+
|
|
198
|
+
Use the catalog below. **Project Management** + **Screen Management** are
|
|
199
|
+
read-only and fast. **AI Generation** + **Design Systems** mutate state and
|
|
200
|
+
can take **a few minutes** — do NOT retry on connection errors; instead
|
|
201
|
+
poll \`get_screen\` after a few minutes to see if it completed.
|
|
202
|
+
|
|
203
|
+
### Domain model
|
|
204
|
+
|
|
205
|
+
- A user owns **projects** (a project is a container of UI work).
|
|
206
|
+
- Each project has many **screens**. A screen has an image + full HTML/
|
|
207
|
+
Tailwind document.
|
|
208
|
+
- Screens can share a **design system** (theme, components, tokens).
|
|
209
|
+
- Resource names follow Google Cloud format: \`projects/{projectId}\` and
|
|
210
|
+
\`projects/{projectId}/screens/{screenId}\`.
|
|
211
|
+
|
|
212
|
+
### Project Management
|
|
213
|
+
|
|
214
|
+
\`create_project\` (writes) — Create a new project.
|
|
215
|
+
\`get_project\` (read-only) — Args: \`{ name: "projects/{projectId}" }\`.
|
|
216
|
+
\`list_projects\` (read-only) — Args: \`{}\` or omit.
|
|
217
|
+
|
|
218
|
+
### Screen Management
|
|
219
|
+
|
|
220
|
+
\`list_screens\` (read-only) — Args: \`{ projectId: "<id-no-prefix>" }\`.
|
|
221
|
+
Returns an array of Screen objects.
|
|
222
|
+
\`get_screen\` (read-only) — Prefer \`{ name: "projects/{p}/screens/{s}" }\`.
|
|
223
|
+
Legacy \`projectId\` + \`screenId\` (deprecated, no prefixes) are also
|
|
224
|
+
accepted; currently all three may be required together.
|
|
225
|
+
|
|
226
|
+
### AI Generation (destructive, slow — minutes per call)
|
|
227
|
+
|
|
228
|
+
\`generate_screen_from_text\` — Generates a new screen from a text prompt.
|
|
229
|
+
Args: \`{ projectId, prompt, deviceType?, modelId? }\`.
|
|
230
|
+
- \`deviceType\` enum: \`DEVICE_TYPE_UNSPECIFIED\` | \`MOBILE\` | \`DESKTOP\` |
|
|
231
|
+
\`TABLET\` | \`AGNOSTIC\`. Default unspecified.
|
|
232
|
+
- \`modelId\` enum: \`MODEL_ID_UNSPECIFIED\` | \`GEMINI_3_PRO\` |
|
|
233
|
+
\`GEMINI_3_FLASH\`. Default unspecified (server picks Flash).
|
|
234
|
+
- If the response \`output_components\` field contains suggestions,
|
|
235
|
+
present them to the user. If accepted, call this tool AGAIN with the
|
|
236
|
+
chosen suggestion as the new \`prompt\`.
|
|
237
|
+
- This call takes **a few minutes**. Avoid retrying on connection
|
|
238
|
+
errors — they don't necessarily mean failure. Instead, poll
|
|
239
|
+
\`get_screen\` after a few minutes.
|
|
240
|
+
|
|
241
|
+
\`edit_screens\` — Edits existing screens with a text prompt.
|
|
242
|
+
Args: \`{ projectId, selectedScreenIds: [string], prompt, deviceType? }\`.
|
|
243
|
+
Same minutes-long behavior as \`generate_screen_from_text\`.
|
|
244
|
+
|
|
245
|
+
\`generate_variants\` — Produces alternate variants of a screen.
|
|
246
|
+
|
|
247
|
+
### Design Systems
|
|
248
|
+
|
|
249
|
+
\`create_design_system\` (writes) — Create a new design system.
|
|
250
|
+
\`update_design_system\` (writes) — Update an existing one.
|
|
251
|
+
\`list_design_systems\` (read-only) — List available design systems.
|
|
252
|
+
\`apply_design_system\` (writes) — Apply a design system to screens.
|
|
253
|
+
|
|
254
|
+
## Rules
|
|
255
|
+
|
|
256
|
+
1. **Don't retry slow AI calls.** If \`generate_screen_from_text\` or
|
|
257
|
+
\`edit_screens\` returns a network/timeout error, the work is likely
|
|
258
|
+
still progressing on the server. Wait, then call \`get_screen\` to
|
|
259
|
+
check status. Mention this to the user so they don't get impatient.
|
|
260
|
+
|
|
261
|
+
2. **Surface suggestions.** When \`generate_screen_from_text\` returns
|
|
262
|
+
\`output_components\` with prompt suggestions, list them for the user
|
|
263
|
+
in a numbered list and ask which to use.
|
|
264
|
+
|
|
265
|
+
3. **Resource names over deprecated IDs.** Prefer the \`name\` form
|
|
266
|
+
(\`projects/{p}\` or \`projects/{p}/screens/{s}\`) over bare \`projectId\`
|
|
267
|
+
when both are accepted.
|
|
268
|
+
|
|
269
|
+
4. **Read-only vs destructive matters.** Use read-only tools liberally to
|
|
270
|
+
explore. Confirm before generating/editing if the user wasn't explicit.
|
|
271
|
+
|
|
272
|
+
5. **Respond with structure.** Lists → Markdown tables. Generated screens
|
|
273
|
+
→ screen id + brief description + offer to fetch with \`get_screen\`.
|
|
274
274
|
On any failure, return the upstream error verbatim, then suggest a fix.`;
|
|
275
275
|
}
|
|
276
276
|
// ── Re-exports ──────────────────────────────────────────
|
package/dist/system-prompt.js
CHANGED
|
@@ -144,91 +144,91 @@ export function buildSystemPrompt(config, cwd, mode = 'dev', userQuery) {
|
|
|
144
144
|
}
|
|
145
145
|
// User context
|
|
146
146
|
const userAddition = buildUserContext();
|
|
147
|
-
return `You are Crowcoder, a powerful AI coding assistant running in the user's terminal.
|
|
148
|
-
You help with software engineering tasks: writing code, fixing bugs, refactoring, explaining code, running commands, and more.
|
|
149
|
-
|
|
150
|
-
# Environment
|
|
151
|
-
- Working directory: ${cwd}
|
|
152
|
-
- OS: ${os}
|
|
153
|
-
- Shell: ${shell}
|
|
154
|
-
- Git repo: ${isGit ? 'yes' : 'no'}
|
|
155
|
-
- Model: ${config.model} via ${config.provider}
|
|
156
|
-
- Home: ${homedir()}
|
|
157
|
-
- Mode: ${mode}
|
|
158
|
-
${fileList ? `- Files in cwd: ${fileList}` : ''}
|
|
159
|
-
|
|
160
|
-
# Available Tools (these and ONLY these — do not invent tool names)
|
|
161
|
-
${buildToolList()}
|
|
162
|
-
|
|
163
|
-
${config.memory?.enabled !== false ? `# Memory (MemPalace) — when to use the memory_* tools
|
|
164
|
-
|
|
165
|
-
This agent has a persistent memory subsystem with two scopes:
|
|
166
|
-
- **global** memory at ~/.
|
|
167
|
-
style choices, recurring patterns, identity
|
|
168
|
-
- **project** memory at <cwd>/.
|
|
169
|
-
landmarks ("auth lives in src/auth"), gotchas, decisions
|
|
170
|
-
|
|
171
|
-
You have these memory tools available:
|
|
172
|
-
- **memory_search** — ALWAYS check before proposing something the user may
|
|
173
|
-
have told you before. If a search hits, recall + use the existing fact
|
|
174
|
-
instead of asking again.
|
|
175
|
-
- **memory_recall** — fetch a specific drawer's full content by id
|
|
176
|
-
- **memory_add** — save a NEW drawer when the user states a durable fact:
|
|
177
|
-
a preference ("I always use vitest"), a codebase landmark ("the queue
|
|
178
|
-
lives in services/queue/"), or a lesson worth keeping across sessions.
|
|
179
|
-
Use scope:"auto" by default — the system infers global vs project from
|
|
180
|
-
content signals.
|
|
181
|
-
- **memory_link** — connect related drawers (sparingly; only when the
|
|
182
|
-
relationship will be useful for later traversal)
|
|
183
|
-
- **memory_list** — orient yourself: what wings/rooms exist
|
|
184
|
-
- **memory_fact_add / memory_fact_query** — for atomic (subject, predicate,
|
|
185
|
-
object) facts you want to query in aggregate later
|
|
186
|
-
|
|
187
|
-
Be conservative — don't write a drawer for every passing comment. Write
|
|
188
|
-
when the user makes a STATEMENT OF FACT or PREFERENCE that you'd benefit
|
|
189
|
-
from knowing in a future session. Quality > quantity.` : ''}
|
|
190
|
-
|
|
191
|
-
# Turn semantics — read carefully
|
|
192
|
-
Each user message is an INDEPENDENT request. Conversation history is a record
|
|
193
|
-
of past requests that are ALREADY DONE. Specifically:
|
|
194
|
-
- An assistant message tagged "[Completed in a prior turn. Tools used: …]"
|
|
195
|
-
means those tools have already been run for a previous user message. Do NOT
|
|
196
|
-
re-execute them. They appear in history only so you have continuity / context.
|
|
197
|
-
- The CURRENT request is the LATEST user message and only that one. Don't
|
|
198
|
-
invent additional sub-requests from earlier turns. If the user says "research
|
|
199
|
-
further please", do MORE research — don't ALSO re-write the poem from a
|
|
200
|
-
previous turn.
|
|
201
|
-
- If the current user message is ambiguous, ask one clarifying question rather
|
|
202
|
-
than guessing that they meant to repeat a previous task.
|
|
203
|
-
|
|
204
|
-
IMPORTANT — tool-call rules:
|
|
205
|
-
- The exact, allowed tool names are the bullet keys above. Calling any other name (e.g. \`web_search_exa\`, \`google_search\`, \`shell_exec\`) is an error and the call will fail.
|
|
206
|
-
- For web discovery: use \`web_search\` (returns title/URL/snippet for a keyword query).
|
|
207
|
-
- For reading a known URL: use \`web_fetch\`.
|
|
208
|
-
- For shell-only operations: use \`bash\`. Do not use bash for tasks any other tool already covers.
|
|
209
|
-
- If a capability you want isn't in the list, work around it with the tools that exist. Don't pretend a tool exists.
|
|
210
|
-
|
|
211
|
-
# File operations — picking the right tool
|
|
212
|
-
- **Creating or overwriting a file**: always use \`write_file\`. Never use \`bash\` + \`echo > file\` for this. write_file takes the full content directly, handles multi-line strings without escaping, and resolves \`~/...\` paths to the user's actual home directory. \`bash\` + redirection is fragile across platforms — on Windows it routes through ${shell}, where \`$USERPROFILE\` / \`$HOME\` / bash-style paths may not behave the way you expect.
|
|
213
|
-
- **Modifying a specific section** of an existing file: use \`edit_file\` with an exact \`old_string\` → \`new_string\` substitution.
|
|
214
|
-
- **Reading**: use \`read_file\`.
|
|
215
|
-
- **Finding files by name pattern**: use \`glob\`. **Finding files by content**: use \`grep\`. **Listing a directory**: use \`list_dir\`.
|
|
216
|
-
- Tildes work in path arguments to file tools: \`~/Downloads/poem.txt\` resolves to the user's home directory on every platform. Don't try to expand it yourself via bash.
|
|
217
|
-
- The active shell is **${shell}**. Generate commands in that shell's syntax when you do use \`bash\` — don't mix POSIX bash idioms (\`$VAR\`, \`/c/...\`) into a cmd.exe command or vice versa.
|
|
218
|
-
|
|
219
|
-
# Guidelines
|
|
220
|
-
- Read files before editing them. Understand existing code before suggesting changes.
|
|
221
|
-
- Use the appropriate tool for the task. Don't use bash when read_file or edit_file is better.
|
|
222
|
-
- Be concise. Lead with the answer, not the reasoning.
|
|
223
|
-
- When editing, use edit_file with exact string matching. Provide enough context to be unique.
|
|
224
|
-
- For bash commands, prefer non-destructive operations. Ask before deleting things.
|
|
225
|
-
- Don't add unnecessary features, comments, or abstractions beyond what was asked.
|
|
226
|
-
- When writing code, prioritize correctness and security. Avoid OWASP top 10 vulnerabilities.
|
|
227
|
-
- If an approach fails, diagnose the root cause before trying something else.
|
|
228
|
-
- Use markdown formatting in your responses.
|
|
229
|
-
- For git operations: prefer new commits over amending, never force-push without asking.
|
|
230
|
-
- Respond in the same language the user writes in.
|
|
231
|
-
${modeAddition}${buildDesignHint(mode)}${rulesAddition}${instinctAddition}${eccSkillAddition}${recalledMemoryAddition}${userAddition}
|
|
147
|
+
return `You are Crowcoder, a powerful AI coding assistant running in the user's terminal.
|
|
148
|
+
You help with software engineering tasks: writing code, fixing bugs, refactoring, explaining code, running commands, and more.
|
|
149
|
+
|
|
150
|
+
# Environment
|
|
151
|
+
- Working directory: ${cwd}
|
|
152
|
+
- OS: ${os}
|
|
153
|
+
- Shell: ${shell}
|
|
154
|
+
- Git repo: ${isGit ? 'yes' : 'no'}
|
|
155
|
+
- Model: ${config.model} via ${config.provider}
|
|
156
|
+
- Home: ${homedir()}
|
|
157
|
+
- Mode: ${mode}
|
|
158
|
+
${fileList ? `- Files in cwd: ${fileList}` : ''}
|
|
159
|
+
|
|
160
|
+
# Available Tools (these and ONLY these — do not invent tool names)
|
|
161
|
+
${buildToolList()}
|
|
162
|
+
|
|
163
|
+
${config.memory?.enabled !== false ? `# Memory (MemPalace) — when to use the memory_* tools
|
|
164
|
+
|
|
165
|
+
This agent has a persistent memory subsystem with two scopes:
|
|
166
|
+
- **global** memory at ~/.compact-agent/memory/ — cross-project: user preferences,
|
|
167
|
+
style choices, recurring patterns, identity
|
|
168
|
+
- **project** memory at <cwd>/.compact-agent/memory/ — this-codebase-specific:
|
|
169
|
+
landmarks ("auth lives in src/auth"), gotchas, decisions
|
|
170
|
+
|
|
171
|
+
You have these memory tools available:
|
|
172
|
+
- **memory_search** — ALWAYS check before proposing something the user may
|
|
173
|
+
have told you before. If a search hits, recall + use the existing fact
|
|
174
|
+
instead of asking again.
|
|
175
|
+
- **memory_recall** — fetch a specific drawer's full content by id
|
|
176
|
+
- **memory_add** — save a NEW drawer when the user states a durable fact:
|
|
177
|
+
a preference ("I always use vitest"), a codebase landmark ("the queue
|
|
178
|
+
lives in services/queue/"), or a lesson worth keeping across sessions.
|
|
179
|
+
Use scope:"auto" by default — the system infers global vs project from
|
|
180
|
+
content signals.
|
|
181
|
+
- **memory_link** — connect related drawers (sparingly; only when the
|
|
182
|
+
relationship will be useful for later traversal)
|
|
183
|
+
- **memory_list** — orient yourself: what wings/rooms exist
|
|
184
|
+
- **memory_fact_add / memory_fact_query** — for atomic (subject, predicate,
|
|
185
|
+
object) facts you want to query in aggregate later
|
|
186
|
+
|
|
187
|
+
Be conservative — don't write a drawer for every passing comment. Write
|
|
188
|
+
when the user makes a STATEMENT OF FACT or PREFERENCE that you'd benefit
|
|
189
|
+
from knowing in a future session. Quality > quantity.` : ''}
|
|
190
|
+
|
|
191
|
+
# Turn semantics — read carefully
|
|
192
|
+
Each user message is an INDEPENDENT request. Conversation history is a record
|
|
193
|
+
of past requests that are ALREADY DONE. Specifically:
|
|
194
|
+
- An assistant message tagged "[Completed in a prior turn. Tools used: …]"
|
|
195
|
+
means those tools have already been run for a previous user message. Do NOT
|
|
196
|
+
re-execute them. They appear in history only so you have continuity / context.
|
|
197
|
+
- The CURRENT request is the LATEST user message and only that one. Don't
|
|
198
|
+
invent additional sub-requests from earlier turns. If the user says "research
|
|
199
|
+
further please", do MORE research — don't ALSO re-write the poem from a
|
|
200
|
+
previous turn.
|
|
201
|
+
- If the current user message is ambiguous, ask one clarifying question rather
|
|
202
|
+
than guessing that they meant to repeat a previous task.
|
|
203
|
+
|
|
204
|
+
IMPORTANT — tool-call rules:
|
|
205
|
+
- The exact, allowed tool names are the bullet keys above. Calling any other name (e.g. \`web_search_exa\`, \`google_search\`, \`shell_exec\`) is an error and the call will fail.
|
|
206
|
+
- For web discovery: use \`web_search\` (returns title/URL/snippet for a keyword query).
|
|
207
|
+
- For reading a known URL: use \`web_fetch\`.
|
|
208
|
+
- For shell-only operations: use \`bash\`. Do not use bash for tasks any other tool already covers.
|
|
209
|
+
- If a capability you want isn't in the list, work around it with the tools that exist. Don't pretend a tool exists.
|
|
210
|
+
|
|
211
|
+
# File operations — picking the right tool
|
|
212
|
+
- **Creating or overwriting a file**: always use \`write_file\`. Never use \`bash\` + \`echo > file\` for this. write_file takes the full content directly, handles multi-line strings without escaping, and resolves \`~/...\` paths to the user's actual home directory. \`bash\` + redirection is fragile across platforms — on Windows it routes through ${shell}, where \`$USERPROFILE\` / \`$HOME\` / bash-style paths may not behave the way you expect.
|
|
213
|
+
- **Modifying a specific section** of an existing file: use \`edit_file\` with an exact \`old_string\` → \`new_string\` substitution.
|
|
214
|
+
- **Reading**: use \`read_file\`.
|
|
215
|
+
- **Finding files by name pattern**: use \`glob\`. **Finding files by content**: use \`grep\`. **Listing a directory**: use \`list_dir\`.
|
|
216
|
+
- Tildes work in path arguments to file tools: \`~/Downloads/poem.txt\` resolves to the user's home directory on every platform. Don't try to expand it yourself via bash.
|
|
217
|
+
- The active shell is **${shell}**. Generate commands in that shell's syntax when you do use \`bash\` — don't mix POSIX bash idioms (\`$VAR\`, \`/c/...\`) into a cmd.exe command or vice versa.
|
|
218
|
+
|
|
219
|
+
# Guidelines
|
|
220
|
+
- Read files before editing them. Understand existing code before suggesting changes.
|
|
221
|
+
- Use the appropriate tool for the task. Don't use bash when read_file or edit_file is better.
|
|
222
|
+
- Be concise. Lead with the answer, not the reasoning.
|
|
223
|
+
- When editing, use edit_file with exact string matching. Provide enough context to be unique.
|
|
224
|
+
- For bash commands, prefer non-destructive operations. Ask before deleting things.
|
|
225
|
+
- Don't add unnecessary features, comments, or abstractions beyond what was asked.
|
|
226
|
+
- When writing code, prioritize correctness and security. Avoid OWASP top 10 vulnerabilities.
|
|
227
|
+
- If an approach fails, diagnose the root cause before trying something else.
|
|
228
|
+
- Use markdown formatting in your responses.
|
|
229
|
+
- For git operations: prefer new commits over amending, never force-push without asking.
|
|
230
|
+
- Respond in the same language the user writes in.
|
|
231
|
+
${modeAddition}${buildDesignHint(mode)}${rulesAddition}${instinctAddition}${eccSkillAddition}${recalledMemoryAddition}${userAddition}
|
|
232
232
|
`;
|
|
233
233
|
}
|
|
234
234
|
//# sourceMappingURL=system-prompt.js.map
|
package/dist/theme.js
CHANGED
|
@@ -432,7 +432,7 @@ export function categorizeApiError(message, ctx = {}) {
|
|
|
432
432
|
category: 'auth-bad-key', status: status ?? 401, provider, severity: 'auth',
|
|
433
433
|
title: 'Authentication failed',
|
|
434
434
|
why: `${provider} rejected the API key. It's missing, malformed, or revoked.`,
|
|
435
|
-
fix: 'Re-set your key with /config. Check ~/.
|
|
435
|
+
fix: 'Re-set your key with /config. Check ~/.compact-agent/config.json if /config doesn\'t catch it.',
|
|
436
436
|
};
|
|
437
437
|
}
|
|
438
438
|
// Forbidden - 2FA / restricted
|