daedalus-cli 3.30.2 → 3.30.3
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/CHANGELOG.md +7 -0
- package/dist/commands/enhance.d.ts +1 -1
- package/dist/commands/enhance.d.ts.map +1 -1
- package/dist/commands/enhance.js +30 -2
- package/dist/commands/enhance.js.map +1 -1
- package/dist/commands/enhance.test.js +24 -0
- package/dist/commands/enhance.test.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [3.30.3](https://github.com/bgill55/daedalus/compare/v3.30.2...v3.30.3) (2026-08-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **enhance:** preserve user intent mode — don't expand a proposal ask into an implement mandate ([#122](https://github.com/bgill55/daedalus/issues/122)) ([e15f8d7](https://github.com/bgill55/daedalus/commit/e15f8d76027890ddea2be0d5d7cbe1008520d379))
|
|
7
|
+
|
|
1
8
|
## [3.30.2](https://github.com/bgill55/daedalus/compare/v3.30.1...v3.30.2) (2026-08-16)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Command, CommandContext } from './types.js';
|
|
2
|
-
export declare const ENHANCE_SYSTEM_PROMPT = "You are an expert prompt engineer for AI coding agents. \nExpand the user's raw or casual request into a crisp, high-yield engineering prompt for Daedalus.\nRules for the generated prompt:\n1. Frame the prompt as a direct action command instructing the agent to perform the task and write out its completed report.\n2. Instruct the agent to inspect relevant files and codebase context using tools before writing.\n3. Require the agent to deliver a fully populated report formatted in Markdown with headers, filled-in comparison tables, and bullet points.\n4. NEVER output empty Markdown templates, empty table rows (e.g. \"| Aspect | | |\"), or bracketed placeholders (e.g. \"[dependency]\", \"[what it does]\"). Instead, write clear instructions ordering the agent to analyze the code and populate those sections with actual findings.\n5. Return ONLY the final enhanced prompt text without meta-commentary, introductory remarks, or surrounding quote marks.\n6. If the user's request already contains tool-call markup (e.g. `<tool_call>`, `<function=...>`), code fences, or XML-like tags, DO NOT copy that structured markup into the output. Rephrase the request as a clean natural-language instruction that a coding agent can act on directly. The enhanced prompt must be plain prose/Markdown an agent can execute \u2014 never raw tool-call XML.";
|
|
2
|
+
export declare const ENHANCE_SYSTEM_PROMPT = "You are an expert prompt engineer for AI coding agents. \nExpand the user's raw or casual request into a crisp, high-yield engineering prompt for Daedalus.\nRules for the generated prompt:\n1. Frame the prompt as a direct action command instructing the agent to perform the task and write out its completed report.\n2. Instruct the agent to inspect relevant files and codebase context using tools before writing.\n3. Require the agent to deliver a fully populated report formatted in Markdown with headers, filled-in comparison tables, and bullet points.\n4. NEVER output empty Markdown templates, empty table rows (e.g. \"| Aspect | | |\"), or bracketed placeholders (e.g. \"[dependency]\", \"[what it does]\"). Instead, write clear instructions ordering the agent to analyze the code and populate those sections with actual findings.\n5. Return ONLY the final enhanced prompt text without meta-commentary, introductory remarks, or surrounding quote marks.\n6. If the user's request already contains tool-call markup (e.g. `<tool_call>`, `<function=...>`), code fences, or XML-like tags, DO NOT copy that structured markup into the output. Rephrase the request as a clean natural-language instruction that a coding agent can act on directly. The enhanced prompt must be plain prose/Markdown an agent can execute \u2014 never raw tool-call XML.\n7. PRESERVE THE USER'S INTENT MODE. If the user's request is a proposal, ideation, brainstorm, design, or discussion ask (e.g. \"come up with ideas\", \"propose\", \"what are some options\", \"brainstorm\", \"think about how to\", \"suggest approaches\", \"architecture review\"), the enhanced prompt MUST remain a proposal/analysis ask. Do NOT reframe it as an implement/build command, and do NOT inject execution-scope deliverables such as \"implement the following\", \"deliver a comprehensive Markdown report with sprint breakdowns and file modifications\", \"manageable sprints\", or \"populate all sections with actual implementation plans\". If the user wants implementation, they will say so \u2014 your job is to make the proposal sharper and more specific, not to expand a question into a build order. Conversely, if the request IS a direct implementation task, keep Rule 1-3 as written.";
|
|
3
3
|
export declare function enhancePrompt(rawPrompt: string, ctx: CommandContext): Promise<string>;
|
|
4
4
|
export declare const enhanceCommand: Command;
|
|
5
5
|
//# sourceMappingURL=enhance.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enhance.d.ts","sourceRoot":"","sources":["../../src/commands/enhance.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE1D,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"enhance.d.ts","sourceRoot":"","sources":["../../src/commands/enhance.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE1D,eAAO,MAAM,qBAAqB,wsEASq0B,CAAC;AA8Bx2B,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAiC3F;AAED,eAAO,MAAM,cAAc,EAAE,OAgE5B,CAAC"}
|
package/dist/commands/enhance.js
CHANGED
|
@@ -11,7 +11,34 @@ Rules for the generated prompt:
|
|
|
11
11
|
3. Require the agent to deliver a fully populated report formatted in Markdown with headers, filled-in comparison tables, and bullet points.
|
|
12
12
|
4. NEVER output empty Markdown templates, empty table rows (e.g. "| Aspect | | |"), or bracketed placeholders (e.g. "[dependency]", "[what it does]"). Instead, write clear instructions ordering the agent to analyze the code and populate those sections with actual findings.
|
|
13
13
|
5. Return ONLY the final enhanced prompt text without meta-commentary, introductory remarks, or surrounding quote marks.
|
|
14
|
-
6. If the user's request already contains tool-call markup (e.g. \`<tool_call>\`, \`<function=...>\`), code fences, or XML-like tags, DO NOT copy that structured markup into the output. Rephrase the request as a clean natural-language instruction that a coding agent can act on directly. The enhanced prompt must be plain prose/Markdown an agent can execute — never raw tool-call XML
|
|
14
|
+
6. If the user's request already contains tool-call markup (e.g. \`<tool_call>\`, \`<function=...>\`), code fences, or XML-like tags, DO NOT copy that structured markup into the output. Rephrase the request as a clean natural-language instruction that a coding agent can act on directly. The enhanced prompt must be plain prose/Markdown an agent can execute — never raw tool-call XML.
|
|
15
|
+
7. PRESERVE THE USER'S INTENT MODE. If the user's request is a proposal, ideation, brainstorm, design, or discussion ask (e.g. "come up with ideas", "propose", "what are some options", "brainstorm", "think about how to", "suggest approaches", "architecture review"), the enhanced prompt MUST remain a proposal/analysis ask. Do NOT reframe it as an implement/build command, and do NOT inject execution-scope deliverables such as "implement the following", "deliver a comprehensive Markdown report with sprint breakdowns and file modifications", "manageable sprints", or "populate all sections with actual implementation plans". If the user wants implementation, they will say so — your job is to make the proposal sharper and more specific, not to expand a question into a build order. Conversely, if the request IS a direct implementation task, keep Rule 1-3 as written.`;
|
|
16
|
+
// Intent-mode markers. If the RAW request contains a proposal/brainstorm marker, the
|
|
17
|
+
// enhanced prompt must stay a proposal and must not be expanded into an implementation
|
|
18
|
+
// mandate. Used by stripModeViolation to defend against an enhancer that ignores Rule 7.
|
|
19
|
+
const PROPOSAL_INTENT_RE = /\b(ideas?|propose|proposal|brainstorm|suggest (approaches|ideas|options)|think (outside|about|of)|what (are|would|could)|options|approaches|design (a )?(review|doc)|architecture review|outside the box|how (might|could|should) we)\b/i;
|
|
20
|
+
// Phrases that signal the enhancer illegally escalated a proposal into a build mandate.
|
|
21
|
+
// Global flag: a single enhanced prompt can contain several mandate phrases that must all
|
|
22
|
+
// be stripped (e.g. "implement the following" AND "manageable sprints" AND "specific file modifications").
|
|
23
|
+
const IMPLEMENT_MANDATE_RE = /\b(implement (the )?(following|these|in )|manageable sprints?|sprint breakdown|deliver a comprehensive (markdown )?report|file modifications required|specific file modifications|detailed comparison tables showing current (state|vs)|populate all sections with actual (implementation|analysis)|implementation readiness statement|proceed with implementing)\b/gi;
|
|
24
|
+
/**
|
|
25
|
+
* Backstop for Rule 7: if the raw request is a proposal/ideation ask but the enhancer
|
|
26
|
+
* still expanded it into an implement/build mandate (added sprint breakdowns, "implement
|
|
27
|
+
* the following", "file modifications", etc.), strip those execution-scope phrases so the
|
|
28
|
+
* enhanced prompt stays a proposal the user can vet before any build happens. This prevents
|
|
29
|
+
* the /prompt enhancer from silently turning "propose 3-5 ideas" into "implement these in
|
|
30
|
+
* sprints and deliver a full report" — which the execution turn then obeys as a build order.
|
|
31
|
+
*/
|
|
32
|
+
function stripModeViolation(rawPrompt, enhanced) {
|
|
33
|
+
if (!PROPOSAL_INTENT_RE.test(rawPrompt))
|
|
34
|
+
return enhanced;
|
|
35
|
+
if (!IMPLEMENT_MANDATE_RE.test(enhanced))
|
|
36
|
+
return enhanced;
|
|
37
|
+
return enhanced
|
|
38
|
+
.replace(IMPLEMENT_MANDATE_RE, (m) => '') // remove the illegal mandate phrases
|
|
39
|
+
.replace(/\n{3,}/g, '\n\n') // collapse the gaps left behind
|
|
40
|
+
.trim();
|
|
41
|
+
}
|
|
15
42
|
export async function enhancePrompt(rawPrompt, ctx) {
|
|
16
43
|
const fullPrompt = `${ENHANCE_SYSTEM_PROMPT}\n\nUser request to enhance: "${rawPrompt}"`;
|
|
17
44
|
try {
|
|
@@ -31,7 +58,8 @@ export async function enhancePrompt(rawPrompt, ctx) {
|
|
|
31
58
|
// structured input instead of producing natural-language. Strip any such
|
|
32
59
|
// markup so the displayed/enhanced prompt is always plain prose an agent
|
|
33
60
|
// can execute (see bug where /enhance returned <tool_call><function=read_file>).
|
|
34
|
-
|
|
61
|
+
const stripped = stripToolCallMarkup(res.trim());
|
|
62
|
+
return stripModeViolation(rawPrompt, stripped);
|
|
35
63
|
}
|
|
36
64
|
}
|
|
37
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enhance.js","sourceRoot":"","sources":["../../src/commands/enhance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACl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AC;wBACrC,MAAM,cAAc,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,cAAc,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;oBACrE,CAAC;oBACD,aAAa,EAAE,CAAC;gBAClB,CAAC;qBAAM,CAAC;oBACN,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;gBACzD,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC,CAAC;YACtD,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -30,6 +30,30 @@ describe('enhanceCommand', () => {
|
|
|
30
30
|
expect(messages).toEqual([{ role: 'system', content: 'sys' }]);
|
|
31
31
|
expect(mockCallModel).toHaveBeenCalledTimes(1);
|
|
32
32
|
});
|
|
33
|
+
it('preserves proposal intent: does not expand "ideas" ask into an implement mandate', async () => {
|
|
34
|
+
// Regression: /prompt enhancer turned "come up with 3-5 ideas" into "implement these
|
|
35
|
+
// in manageable sprints and deliver a comprehensive report" — which the execution turn
|
|
36
|
+
// then obeyed as a build order, spiraling into a config-thrash death loop.
|
|
37
|
+
const mockCallModel = vi.fn().mockResolvedValue('Act as Daedalus and IMPLEMENT the following UI/UX enhancements in manageable sprints. ' +
|
|
38
|
+
'Deliver a comprehensive Markdown report with sprint breakdowns and specific file modifications. ' +
|
|
39
|
+
'Populate all sections with actual implementation plans. Proceed with implementing Sprint 1.1.');
|
|
40
|
+
const mockCtx = { callModelWithFallback: mockCallModel };
|
|
41
|
+
const result = await enhancePrompt('come up with 3-5 ideas to make this project outstanding', mockCtx);
|
|
42
|
+
// The implement mandate must be stripped; the output stays a proposal/analysis ask.
|
|
43
|
+
expect(result).not.toMatch(/implement the following/i);
|
|
44
|
+
expect(result).not.toMatch(/manageable sprints?/i);
|
|
45
|
+
expect(result).not.toMatch(/specific file modifications/i);
|
|
46
|
+
expect(result).not.toMatch(/proceed with implementing/i);
|
|
47
|
+
expect(result).not.toMatch(/deliver a comprehensive (markdown )?report/i);
|
|
48
|
+
});
|
|
49
|
+
it('does NOT strip implement-scope language when the raw request is a real build task', async () => {
|
|
50
|
+
// A genuine implementation ask should keep its execution scope — the guard only fires
|
|
51
|
+
// for proposal/ideation raw requests.
|
|
52
|
+
const mockCallModel = vi.fn().mockResolvedValue('Implement the following: add a /api/health route and run npm run build to verify.');
|
|
53
|
+
const mockCtx = { callModelWithFallback: mockCallModel };
|
|
54
|
+
const result = await enhancePrompt('add a health check route and verify the build', mockCtx);
|
|
55
|
+
expect(result).toMatch(/implement the following/i);
|
|
56
|
+
});
|
|
33
57
|
it('enhanceCommand asks for prompt if empty and handles user response', async () => {
|
|
34
58
|
const askLineMock = vi.fn()
|
|
35
59
|
.mockResolvedValueOnce('review server.ts') // raw prompt input
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enhance.test.js","sourceRoot":"","sources":["../../src/commands/enhance.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE7D,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACnD,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC7C,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QACnD,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QACnD,MAAM,CAAC,cAAc,CAAC,WAAW,CA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