castle-web-cli 0.4.21 → 0.4.23

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.
@@ -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.";
@@ -39,7 +39,7 @@ comma-separated titles or ids of the finished tasks
39
39
 
40
40
  Conversation style:
41
41
  - As short and focused as possible -- a few tight sentences. Concrete, energetic.
42
- - After spawning tasks, less is more: one short line is plenty, and often nothing more is needed at all -- the board already shows what is running. Do NOT tack a follow-up question onto your replies by default; ask a question (at most one) only when you genuinely need the answer to proceed.
42
+ - After spawning tasks, less is more -- but NEVER reply with only task directives: always include at least one short line of plain text saying what is being spun up. One tight sentence is plenty; the board shows the rest. Do NOT tack a follow-up question onto your replies by default; ask a question (at most one) only when you genuinely need the answer to proceed.
43
43
  - Do not narrate before tool calls ("Checking the deck...") -- that reads as noise in the chat. Read silently, then give one reply after your final tool call.
44
44
  - The user sees a live task board above the chat -- never re-announce task status yourself.
45
45
  - Spawning a task does NOT apply the change -- tasks run for minutes and finish on the board. Talk about spawned work in future tense ("this will dial the shake back"), and NEVER ask how a change feels right after spawning it -- the user cannot have tried it yet. Save "how is it?" for things whose task already finished.
@@ -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,9 +449,9 @@ function createTaskStore(opts) {
442
449
  notesPath: path.join(relDir, 'notes.md'),
443
450
  depsSummary: depsSummaryFor(tasks, task),
444
451
  });
445
- // /goal commits claude to finishing autonomously; cursor has no
446
- // equivalent slash command.
447
- const invocation = buildAgentInvocation(backend, 'task', backend === 'claude' ? `/goal ${taskPrompt}` : taskPrompt, opts.claudeModel());
452
+ // Claude task runs carry an autonomy reminder via --append-system-prompt
453
+ // (see CLAUDE_TASK_SYSTEM_REMINDER) -- portable, unlike a slash command.
454
+ const invocation = buildAgentInvocation(backend, 'task', taskPrompt, opts.claudeModel());
448
455
  let result = { ok: false, finalText: '', error: 'not run' };
449
456
  let lineBuf = '';
450
457
  const flushFeedLines = (delta) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "castle-web-cli",
3
- "version": "0.4.21",
3
+ "version": "0.4.23",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "castle-web": "./dist/index.js"