castle-web-cli 0.4.22 → 0.4.24
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/agent-prompts.d.ts +1 -0
- package/dist/agent-prompts.js +3 -0
- package/dist/agent.js +10 -3
- package/package.json +1 -1
package/dist/agent-prompts.d.ts
CHANGED
|
@@ -29,3 +29,4 @@ export declare function buildTaskPrompt(opts: {
|
|
|
29
29
|
notesPath: string;
|
|
30
30
|
depsSummary?: string;
|
|
31
31
|
}): string;
|
|
32
|
+
export declare const CLAUDE_TASK_SYSTEM_REMINDER = "Castle background task agent: work autonomously to completion -- never pause to ask questions or wait for confirmation; finish the task end-to-end, then stop. Prefer the quickest viable change that fully does the job.";
|
package/dist/agent-prompts.js
CHANGED
|
@@ -108,3 +108,6 @@ Operating rules:
|
|
|
108
108
|
- If you are truly blocked, write the blocker to the notes file and stop rather than guessing wildly.
|
|
109
109
|
- Never touch files under .castle/ other than those two paths.`;
|
|
110
110
|
}
|
|
111
|
+
// Appended to claude task agents' system prompt (portable replacement for the
|
|
112
|
+
// machine-specific /goal slash command): commit to autonomous completion.
|
|
113
|
+
export const CLAUDE_TASK_SYSTEM_REMINDER = 'Castle background task agent: work autonomously to completion -- never pause to ask questions or wait for confirmation; finish the task end-to-end, then stop. Prefer the quickest viable change that fully does the job.';
|
package/dist/agent.js
CHANGED
|
@@ -20,7 +20,7 @@ import * as path from 'path';
|
|
|
20
20
|
import { nanoid } from 'nanoid';
|
|
21
21
|
import { WebSocketServer } from 'ws';
|
|
22
22
|
import { rawDataToString } from './ide.js';
|
|
23
|
-
import { buildRouterPrompt, buildTaskPrompt, userTurnInstruction, } from './agent-prompts.js';
|
|
23
|
+
import { buildRouterPrompt, buildTaskPrompt, userTurnInstruction, CLAUDE_TASK_SYSTEM_REMINDER, } from './agent-prompts.js';
|
|
24
24
|
export const AGENT_WS_PATH = '/__castle/agent';
|
|
25
25
|
export const AGENT_ATTACHMENT_PREFIX = '/__castle/agent/attachments/';
|
|
26
26
|
const DEFAULT_SETTINGS = { router: 'claude', tasks: 'claude', claudeModel: 'opus' };
|
|
@@ -49,6 +49,13 @@ function buildAgentInvocation(backend, role, prompt, claudeModel) {
|
|
|
49
49
|
claudeModel,
|
|
50
50
|
'--effort',
|
|
51
51
|
'medium',
|
|
52
|
+
// Keep runs independent of the machine's user config: no user plugins
|
|
53
|
+
// (LSP servers etc.), no user MCP servers. CLAUDE.md auto-discovery
|
|
54
|
+
// and OAuth still work.
|
|
55
|
+
'--settings',
|
|
56
|
+
'{"enabledPlugins": {}}',
|
|
57
|
+
'--strict-mcp-config',
|
|
58
|
+
...(role === 'task' ? ['--append-system-prompt', CLAUDE_TASK_SYSTEM_REMINDER] : []),
|
|
52
59
|
prompt,
|
|
53
60
|
],
|
|
54
61
|
};
|
|
@@ -442,8 +449,8 @@ function createTaskStore(opts) {
|
|
|
442
449
|
notesPath: path.join(relDir, 'notes.md'),
|
|
443
450
|
depsSummary: depsSummaryFor(tasks, task),
|
|
444
451
|
});
|
|
445
|
-
//
|
|
446
|
-
//
|
|
452
|
+
// Claude task runs get /goal (claude code's built-in commit-to-completion
|
|
453
|
+
// command) plus the system-prompt autonomy reminder.
|
|
447
454
|
const invocation = buildAgentInvocation(backend, 'task', backend === 'claude' ? `/goal ${taskPrompt}` : taskPrompt, opts.claudeModel());
|
|
448
455
|
let result = { ok: false, finalText: '', error: 'not run' };
|
|
449
456
|
let lineBuf = '';
|