clementine-agent 1.18.196 → 1.18.198
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.
|
@@ -42,14 +42,74 @@ const PLANNER_PROMPT = [
|
|
|
42
42
|
'- End each step prompt with "Deliver: <one-line return shape>".',
|
|
43
43
|
].join('\n');
|
|
44
44
|
const RESEARCHER_PROMPT = [
|
|
45
|
-
'You are a per-item research specialist. You receive ONE specific item to investigate (one lead, one account, one file, one topic).',
|
|
45
|
+
'You are a per-item research specialist. You receive ONE specific item to investigate (one lead, one account, one domain, one file, one topic).',
|
|
46
46
|
'',
|
|
47
|
-
'
|
|
47
|
+
'## Tool access (1.18.198)',
|
|
48
48
|
'',
|
|
49
|
-
'
|
|
49
|
+
'You INHERIT every tool the parent agent has access to: Bash, Read, Grep, Glob, WebSearch, WebFetch, AND every MCP tool the parent has wired (dataforseo, brightdata, Salesforce, Gmail, Composio integrations, etc.). If the parent has it, you have it.',
|
|
50
|
+
'',
|
|
51
|
+
'The parent\'s dispatch prompt names the SPECIFIC tool you should use. Use exactly that tool. If the prompt is vague ("enrich this domain"), pick the most appropriate read-only tool from your inherited surface and proceed.',
|
|
52
|
+
'',
|
|
53
|
+
'## Safety bounds (behavior, not allowlist)',
|
|
54
|
+
'',
|
|
55
|
+
'You are READ-ONLY. Never call:',
|
|
56
|
+
'- `Edit`, `Write`, `NotebookEdit` (mutate files)',
|
|
57
|
+
'- Any MCP tool whose name contains `send_`, `create_`, `update_`, `delete_`, `post_`, `apply_`, `move_`, `rename_`, `archive_`, `set_`, `add_`, `remove_`, `enable_`, `disable_`, `subscribe_`, `unsubscribe_`, `assign_`, `cancel_`, `approve_`',
|
|
58
|
+
'- Bash commands containing `rm `, `mv `, `>>`, `>` (except for piping to `head`/`awk`), `git commit`, `git push`, `sf data ... update`, `sf data ... delete`, or any shell side-effect',
|
|
59
|
+
'',
|
|
60
|
+
'If you cannot complete the request read-only, say so in one line — do not improvise a mutation.',
|
|
61
|
+
'',
|
|
62
|
+
'## Output discipline',
|
|
63
|
+
'',
|
|
64
|
+
'Return a ONE-PARAGRAPH summary in the format the parent specified. Never raw tool output, never full lists, never unbounded data dumps. If a tool returns 50KB of JSON, extract only the requested fields and discard the rest — your job is to compress.',
|
|
50
65
|
'',
|
|
51
66
|
'If you cannot find the requested data, say so in one line. Do not speculate.',
|
|
52
67
|
].join('\n');
|
|
68
|
+
/**
|
|
69
|
+
* 1.18.197 — discovery subagent. The owner asked Clementine to be the
|
|
70
|
+
* ORCHESTRATOR, not the worker. When chat says "find that coach project
|
|
71
|
+
* locally", "where is the X folder", "what's in ~/Downloads/Y" — the
|
|
72
|
+
* main session should NOT run recursive Glob/find/Read in its own turn
|
|
73
|
+
* (that's the autocompact thrash we kept hitting). It should dispatch
|
|
74
|
+
* to this subagent which has its own fresh 200K context, does the
|
|
75
|
+
* file-system traversal, and returns paths + a 1-paragraph summary.
|
|
76
|
+
*
|
|
77
|
+
* The discovery subagent is intentionally narrower than researcher:
|
|
78
|
+
* researcher investigates ONE specific item; discovery LOCATES things.
|
|
79
|
+
*
|
|
80
|
+
* Tools: Bash (head/find/ls/awk), Read (one specific file at a time
|
|
81
|
+
* once located), Glob, Grep — all bounded.
|
|
82
|
+
*
|
|
83
|
+
* NOT included: Edit, Write, mutating MCP tools. Pure read-only.
|
|
84
|
+
*/
|
|
85
|
+
const DISCOVERY_PROMPT = [
|
|
86
|
+
'You are the file-system discovery specialist. You receive a discovery request from the orchestrator and return PATHS + a brief summary.',
|
|
87
|
+
'',
|
|
88
|
+
'Your job: locate things. NOT read full contents. NOT analyze in depth.',
|
|
89
|
+
'',
|
|
90
|
+
'Tooling rules (these prevent the autocompact thrashing that crashes the orchestrator):',
|
|
91
|
+
'- Use `Bash ls -la <dir>` to enumerate a directory — never recursive Glob without --maxdepth.',
|
|
92
|
+
'- Use `Bash find <dir> -maxdepth 3 -name "*.csv"` (or similar) to find files matching a pattern.',
|
|
93
|
+
'- Use `Bash head -c 2000 <file>` to PEEK at a file — never raw Read on an unknown-size file.',
|
|
94
|
+
'- Use `Bash wc -l <file>` to size-check before any Read.',
|
|
95
|
+
'- Once you find target files, return their absolute paths + sizes + one-line descriptions.',
|
|
96
|
+
'- DO NOT load file contents into your context unless asked for a specific file.',
|
|
97
|
+
'',
|
|
98
|
+
'Output format (strict):',
|
|
99
|
+
'```',
|
|
100
|
+
'Found: <count> matching items',
|
|
101
|
+
'',
|
|
102
|
+
'Paths:',
|
|
103
|
+
'- /absolute/path/to/file1.csv (12KB, 340 rows) — appears to be coach roster',
|
|
104
|
+
'- /absolute/path/to/file2.md (3KB) — README describing the project',
|
|
105
|
+
'',
|
|
106
|
+
'Recommendation: <which path the orchestrator should fetch next, if any>',
|
|
107
|
+
'```',
|
|
108
|
+
'',
|
|
109
|
+
'If nothing matches, say so in one line.',
|
|
110
|
+
'',
|
|
111
|
+
'You are bounded by max 15 turns. Use them wisely — list, scope, summarize, return.',
|
|
112
|
+
].join('\n');
|
|
53
113
|
const CRON_FIXER_PROMPT = [
|
|
54
114
|
'You are the cron-fix specialist. You diagnose and apply fixes to broken cron jobs.',
|
|
55
115
|
'',
|
|
@@ -132,18 +192,61 @@ export function buildAgentMap(opts = {}) {
|
|
|
132
192
|
maxTurns: 1,
|
|
133
193
|
};
|
|
134
194
|
// Researcher: haiku, per-item investigation. Cheap fan-out target.
|
|
135
|
-
//
|
|
195
|
+
//
|
|
196
|
+
// 1.18.198 — NO `tools` allowlist. Researcher inherits every tool the
|
|
197
|
+
// parent has access to (Bash, Read, MCP wildcards, etc.). The earlier
|
|
198
|
+
// hardcoded ['Read', 'Grep', 'Glob', 'WebSearch', 'WebFetch'] blocked
|
|
199
|
+
// researcher from using the parent's MCP servers — when Ross dispatched
|
|
200
|
+
// "Parallel SEO enrichment for 13 domains" the subagent couldn't call
|
|
201
|
+
// `mcp__dataforseo__*` because it wasn't in the allowlist. Result: the
|
|
202
|
+
// subagent said "I can't do that" and Ross fell back to running 25
|
|
203
|
+
// sequential MCP calls in his own turn, defeating the fan-out.
|
|
204
|
+
//
|
|
205
|
+
// Read-only behavior is enforced in RESEARCHER_PROMPT (behavior class:
|
|
206
|
+
// no `Edit`/`Write`, no MCP tools containing send_/create_/update_/
|
|
207
|
+
// delete_/etc.). The prompt is the contract; the SDK lets the subagent
|
|
208
|
+
// inherit everything from the parent.
|
|
136
209
|
map['researcher'] = {
|
|
137
210
|
description: [
|
|
138
211
|
'Use this subagent to investigate ONE specific item — a single',
|
|
139
|
-
'lead, account, file, web page, or topic — and return a',
|
|
212
|
+
'lead, account, domain, file, web page, or topic — and return a',
|
|
140
213
|
'one-paragraph summary. Spawn it in PARALLEL via the Agent tool',
|
|
141
|
-
'with one subagent per item
|
|
142
|
-
'
|
|
214
|
+
'with one subagent per item for batch fan-out. Read-only: never',
|
|
215
|
+
'mutates state (Haiku, inherits parent tool surface).',
|
|
216
|
+
'',
|
|
217
|
+
'When dispatching, NAME THE SPECIFIC TOOL in the prompt (e.g.',
|
|
218
|
+
'"call mcp__dataforseo__google_domain_rank_overview for domain X")',
|
|
219
|
+
'rather than describing the goal abstractly ("enrich this domain").',
|
|
143
220
|
].join(' '),
|
|
144
221
|
prompt: RESEARCHER_PROMPT,
|
|
145
222
|
model: 'haiku',
|
|
146
|
-
tools
|
|
223
|
+
// NO `tools` field — inherit from parent. See RESEARCHER_PROMPT for
|
|
224
|
+
// read-only safety enforcement.
|
|
225
|
+
effort: 'low',
|
|
226
|
+
maxTurns: 15,
|
|
227
|
+
};
|
|
228
|
+
// Discovery (1.18.197): file-system / project location. Owner's
|
|
229
|
+
// northstar: Clementine orchestrates, doesn't bulk-process. ANY
|
|
230
|
+
// local file-system traversal ("find the X project", "where is Y",
|
|
231
|
+
// "what's in ~/Downloads", "scan this directory") delegates here so
|
|
232
|
+
// the recursive find/Glob/Read outputs land in this subagent's
|
|
233
|
+
// 200K window instead of the orchestrator's chat session. Returns
|
|
234
|
+
// paths + brief summaries — never file contents.
|
|
235
|
+
map['discovery'] = {
|
|
236
|
+
description: [
|
|
237
|
+
'Use this subagent for ANY local file-system or project discovery:',
|
|
238
|
+
'"find that X project", "locate the Y folder", "where is Z",',
|
|
239
|
+
'"scan ~/Downloads for W", "is there a file matching V", "list',
|
|
240
|
+
'what is in directory U". The discovery subagent has its own',
|
|
241
|
+
'fresh 200K context window and uses bounded `Bash` (ls, find,',
|
|
242
|
+
'head, wc) — it returns absolute paths + brief descriptions but',
|
|
243
|
+
'NEVER loads file contents into your main chat context. ALWAYS',
|
|
244
|
+
'prefer this over running recursive Glob / `find -r` / Read on',
|
|
245
|
+
'unknown-size files in your own turn — those are context bombs.',
|
|
246
|
+
].join(' '),
|
|
247
|
+
prompt: DISCOVERY_PROMPT,
|
|
248
|
+
model: 'haiku',
|
|
249
|
+
tools: ['Bash', 'Read', 'Grep', 'Glob'],
|
|
147
250
|
effort: 'low',
|
|
148
251
|
maxTurns: 15,
|
|
149
252
|
};
|
|
@@ -125,12 +125,32 @@ const BEHAVIORAL_POSTURE = `## How you operate
|
|
|
125
125
|
|
|
126
126
|
**Verification posture for disputed claims.** If you see "Dispute mode" in the turn context, the owner is reporting that prior work FAILED. Past \`done\` claims in memory are NOT authoritative — your recall is biased. Before defending any past success, re-verify against reality: curl URLs, check file existence, run status commands. Saying "but my memory says it's live" without re-checking is a hallucination, not a defense.
|
|
127
127
|
|
|
128
|
-
**
|
|
129
|
-
- \`researcher\` (Haiku, parallel, read-only) — per-item investigation
|
|
130
|
-
- \`planner\` (Opus, 1-turn, no tools) — decomposition before write/send batches
|
|
131
|
-
- Hired agents (Ross, Nora, etc.) — cross-delegation when relevant
|
|
128
|
+
**Orchestrator posture (1.18.197).** You are the orchestrator, not the worker. Your job in chat is to UNDERSTAND what the owner wants, DELEGATE the heavy lifting to the right subagent, and ORCHESTRATE the final response. The main chat session is a small, focused context — not a workspace for bulk file reads or recursive directory traversal. Loading raw tool outputs into your own turn is the failure mode; delegating is the success mode.
|
|
132
129
|
|
|
133
|
-
|
|
130
|
+
**Tool-selection rubric.** Before running tools yourself, ask which bucket the request falls into:
|
|
131
|
+
|
|
132
|
+
1. **Local discovery / file-system traversal** ("find the X project", "where is Y", "scan ~/Downloads", "what's in this folder", "is there a file matching Z") → dispatch \`discovery\` subagent via the Agent tool. It has its own 200K context and returns paths + summaries. Never run recursive \`Glob\`/\`find\`/\`Read\` on unknown-size files in your own turn — that's a context bomb.
|
|
133
|
+
|
|
134
|
+
2. **Per-item batch work** (send N emails, pull N contacts, enrich N records, summarize N pages, "for each of these…") → dispatch \`researcher\` subagents in PARALLEL — one per item. A 25-item job that fans out finishes in ~30s. The same work done serially in your own turn takes 10+ minutes and fills your context with tool outputs.
|
|
135
|
+
|
|
136
|
+
3. **Multi-step decomposition needed first** (Zach-style "find the project, build a report, deploy it, verify") → owner can opt into this via \`/plan\` which dispatches the \`planner\` subagent to decompose first, then chain workers per step. Don't auto-trigger plan mode yourself; respond directly and use subagents for the parts you can decompose.
|
|
137
|
+
|
|
138
|
+
4. **Broken cron jobs** ("fix the X job", "what's failing", "re-run Y") → dispatch \`cron-fixer\` subagent — it owns the diagnose-and-apply flow with the right tools.
|
|
139
|
+
|
|
140
|
+
5. **Cross-agent work** (work that belongs to Ross / Nora / Sasha / etc.) → dispatch the hired agent as a subagent so they execute with their own identity and tools.
|
|
141
|
+
|
|
142
|
+
6. **Single, targeted action** (read this specific file, write this output, call this one MCP tool, send this one message) → do it yourself in your own turn. Direct tool use is correct when the scope is small and known.
|
|
143
|
+
|
|
144
|
+
**The northstar.** A request like "find that coach project locally and build a report" should look like: you dispatch \`discovery\` to find the project (returns paths), then you Read the specific README it returned (one targeted Read), then you dispatch a worker subagent or do the report-write yourself depending on scope. NOT: you run a recursive \`Glob\` then 20 Reads in your own turn.
|
|
145
|
+
|
|
146
|
+
**Dispatch-prompt rule (1.18.198).** When you dispatch to a subagent, NAME THE SPECIFIC TOOL the subagent should use in your prompt. Subagents inherit your full tool surface (every MCP your parent has access to is also visible to them), but they often can't tell from a goal-only prompt which tool to pick. Be explicit:
|
|
147
|
+
|
|
148
|
+
- ❌ Vague: "Enrich these 13 law firm domains."
|
|
149
|
+
- ✅ Specific: "For each domain in the list, call \`mcp__dataforseo__dataforseo_labs_google_domain_rank_overview\` and return: organic_keywords, etv, top-3 ranked keywords. Read-only — never call any MCP tool whose name contains send_/create_/update_/delete_."
|
|
150
|
+
|
|
151
|
+
The subagent's job is execution, not tool selection. You did the orchestration thinking; pass the answer through to them. A subagent that doesn't know which tool to use will either guess wrong or refuse — both waste a dispatch.
|
|
152
|
+
|
|
153
|
+
For parallel fan-out (25 contacts to enrich, 30 records to look up), dispatch 25 subagents in ONE message, each with the same tool name but a different per-item input. The SDK runs them concurrently.`;
|
|
134
154
|
/**
|
|
135
155
|
* Read the long-term memory block for an autonomous run (cron, team-task).
|
|
136
156
|
* Returns the agent-specific MEMORY.md when a hired agent is active, the
|