@x-code-cli/core 0.2.7 → 0.2.8
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.
|
@@ -57,7 +57,7 @@ ${FINAL_MESSAGE_CONTRACT_HEADER} Your output must be comprehensive enough that t
|
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
name: 'general-purpose',
|
|
60
|
-
description:
|
|
60
|
+
description: 'General-purpose agent for researching complex questions, searching for code, and executing multi-step tasks.',
|
|
61
61
|
prompt: `You are a general-purpose agent. You have access to the full tool set — read files, search code, run shell commands, and write/edit files when the task genuinely requires it. Complete the task fully, but don't gold-plate.
|
|
62
62
|
|
|
63
63
|
Guidelines:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"built-in.js","sourceRoot":"","sources":["../../../src/agent/sub-agents/built-in.ts"],"names":[],"mappings":"AAGA,MAAM,mBAAmB,GAAG;IAC1B,KAAK;IACL,MAAM;IACN,OAAO;IACP,MAAM;IACN,KAAK;IACL,KAAK;IACL,OAAO;IACP,MAAM;IACN,YAAY;IACZ,UAAU;IACV,WAAW;IACX,YAAY;IACZ,WAAW;IACX,iBAAiB;IACjB,eAAe;IACf,eAAe;IACf,GAAG;IACH,IAAI;IACJ,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;IACP,aAAa;IACb,cAAc;IACd,cAAc;IACd,WAAW;IACX,YAAY;CACb,CAAA;AAED,0EAA0E;AAC1E,kEAAkE;AAClE,2EAA2E;AAC3E,oEAAoE;AACpE,MAAM,6BAA6B,GACjC,4GAA4G,CAAA;AAE9G,MAAM,CAAC,MAAM,aAAa,GAAyB;IACjD;QACE,IAAI,EAAE,SAAS;QACf,WAAW,EACT,4HAA4H;QAC9H,MAAM,EAAE;;;;;;;;EAQV,6BAA6B;;;;;kGAKmE;QAC9F,KAAK,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC;QACvD,iBAAiB,EAAE,mBAAmB;QACtC,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,UAAU;KACnB;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"built-in.js","sourceRoot":"","sources":["../../../src/agent/sub-agents/built-in.ts"],"names":[],"mappings":"AAGA,MAAM,mBAAmB,GAAG;IAC1B,KAAK;IACL,MAAM;IACN,OAAO;IACP,MAAM;IACN,KAAK;IACL,KAAK;IACL,OAAO;IACP,MAAM;IACN,YAAY;IACZ,UAAU;IACV,WAAW;IACX,YAAY;IACZ,WAAW;IACX,iBAAiB;IACjB,eAAe;IACf,eAAe;IACf,GAAG;IACH,IAAI;IACJ,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;IACP,aAAa;IACb,cAAc;IACd,cAAc;IACd,WAAW;IACX,YAAY;CACb,CAAA;AAED,0EAA0E;AAC1E,kEAAkE;AAClE,2EAA2E;AAC3E,oEAAoE;AACpE,MAAM,6BAA6B,GACjC,4GAA4G,CAAA;AAE9G,MAAM,CAAC,MAAM,aAAa,GAAyB;IACjD;QACE,IAAI,EAAE,SAAS;QACf,WAAW,EACT,4HAA4H;QAC9H,MAAM,EAAE;;;;;;;;EAQV,6BAA6B;;;;;kGAKmE;QAC9F,KAAK,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC;QACvD,iBAAiB,EAAE,mBAAmB;QACtC,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,UAAU;KACnB;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,WAAW,EACT,8GAA8G;QAChH,MAAM,EAAE;;;;;;;;;;EAUV,6BAA6B;;;+FAGgE;QAC3F,KAAK,EAAE,CAAC,GAAG,CAAC;QACZ,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,UAAU;KACnB;IACD;QACE,IAAI,EAAE,MAAM;QACZ,WAAW,EACT,4GAA4G;QAC9G,MAAM,EAAE;;;;;;;;;;;;;6EAaiE;QACzE,KAAK,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC;QAC9C,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,UAAU;KACnB;IACD;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,mHAAmH;QACrH,MAAM,EAAE;;;;;;;;;;;;;;0FAc8E;QACtF,KAAK,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC;QACvD,iBAAiB,EAAE,mBAAmB;QACtC,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,UAAU;KACnB;CACF,CAAA"}
|
package/dist/tools/task.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../../src/tools/task.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAEvE;;;2DAG2D;AAC3D,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../../src/tools/task.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAEvE;;;2DAG2D;AAC3D,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,CAgE3E;AAED;4DAC4D;AAC5D,wBAAgB,cAAc,CAAC,QAAQ,EAAE,gBAAgB;;;;UAcxD"}
|
package/dist/tools/task.js
CHANGED
|
@@ -14,48 +14,46 @@ import { z } from 'zod';
|
|
|
14
14
|
export function buildTaskToolDescription(registry) {
|
|
15
15
|
const agents = registry.list();
|
|
16
16
|
const agentList = agents.map((a) => ` - ${a.name}: ${a.description}`).join('\n');
|
|
17
|
-
return `Launch a
|
|
17
|
+
return `Launch a new agent to handle complex, multi-step tasks autonomously.
|
|
18
|
+
|
|
19
|
+
The task tool launches specialized sub-agents (subprocesses) that autonomously handle complex tasks. Each agent type has specific capabilities and tools available to it. The sub-agent runs with its own message history and returns only its final conclusion — its intermediate tool calls never enter your context window, keeping the main conversation lean.
|
|
18
20
|
|
|
19
21
|
Available sub-agents:
|
|
20
22
|
${agentList}
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
Use the task tool when intermediate tool output isn't worth keeping in your context:
|
|
25
|
-
- **Research / exploration**: open-ended questions about the codebase ("where is X defined", "find all callers of Y", "what test patterns does this project use")
|
|
26
|
-
- **Code review**: reviewing pending changes or specific files for bugs, security issues, style violations
|
|
27
|
-
- **Implementation planning**: designing an approach that requires reading many files before writing any
|
|
28
|
-
- **Multi-step investigation**: tasks that need 3+ tool calls whose raw output you don't need to see — only the conclusion matters
|
|
24
|
+
When using the task tool, specify a subagent_type parameter to select which agent type to use.
|
|
29
25
|
|
|
30
|
-
|
|
26
|
+
When NOT to use the task tool:
|
|
27
|
+
- If you want to read a specific file path, use the readFile or glob tool instead of the task tool, to find the match more quickly
|
|
28
|
+
- If you are searching for a specific class definition like "class Foo", use the grep tool instead of the task tool, to find the match more quickly
|
|
29
|
+
- If you are searching for code within a specific file or set of 2-3 files, use the readFile tool instead of the task tool, to find the match more quickly
|
|
30
|
+
- Other tasks that are not related to the agent descriptions above
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
32
|
+
Usage notes:
|
|
33
|
+
- Always include a short description (3-5 words) summarizing what the agent will do
|
|
34
|
+
- Launch multiple agents concurrently whenever possible, to maximize performance; to do that, use a single message with multiple tool uses
|
|
35
|
+
- When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.
|
|
36
|
+
- Each task invocation starts fresh — provide a complete task description.
|
|
37
|
+
- The agent's outputs should generally be trusted
|
|
38
|
+
- Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, etc.), since it is not aware of the user's intent
|
|
39
|
+
- If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.
|
|
40
|
+
- If the user specifies that they want you to run agents "in parallel", you MUST send a single message with multiple task tool use content blocks. For example, if you need to launch both a code-reviewer agent and an explore agent in parallel, send a single message with both tool calls.
|
|
41
|
+
- NEVER launch multiple sub-agents in one turn if they could modify the same files or resources. Only run multiple sub-agents in parallel when their tasks are genuinely independent.
|
|
39
42
|
|
|
40
43
|
## Writing the prompt
|
|
41
44
|
|
|
42
|
-
Brief the
|
|
45
|
+
Brief the agent like a smart colleague who just walked into the room — it hasn't seen this conversation, doesn't know what you've tried, doesn't understand why this task matters.
|
|
43
46
|
- Explain what you're trying to accomplish and why.
|
|
44
47
|
- Describe what you've already learned or ruled out.
|
|
45
48
|
- Give enough context about the surrounding problem that the agent can make judgment calls rather than just following a narrow instruction.
|
|
46
|
-
- Include concrete details: file paths, function names, line numbers, error messages.
|
|
47
49
|
- If you need a short response, say so ("report in under 200 words").
|
|
48
|
-
-
|
|
50
|
+
- Lookups: hand over the exact command. Investigations: hand over the question — prescribed steps become dead weight when the premise is wrong.
|
|
49
51
|
|
|
50
52
|
Terse command-style prompts produce shallow, generic work.
|
|
51
53
|
|
|
52
54
|
**Never delegate understanding.** Don't write "based on your findings, fix the bug" or "based on the research, implement it." Those phrases push synthesis onto the agent instead of doing it yourself. Write prompts that prove you understood: include file paths, line numbers, what specifically to change.
|
|
53
55
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
NEVER launch multiple sub-agents in one turn if they could modify the same files or resources. Only run multiple sub-agents in parallel when their tasks are genuinely independent (e.g., two read-only research questions about different parts of the codebase).
|
|
57
|
-
|
|
58
|
-
## Example
|
|
56
|
+
Example usage:
|
|
59
57
|
|
|
60
58
|
<example>
|
|
61
59
|
user: "Can you check if there are any security issues in the auth module?"
|
package/dist/tools/task.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task.js","sourceRoot":"","sources":["../../src/tools/task.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,EAAE;AACF,sEAAsE;AACtE,kEAAkE;AAClE,gEAAgE;AAChE,kEAAkE;AAClE,mBAAmB;AACnB,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAA;AAEzB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB;;;2DAG2D;AAC3D,MAAM,UAAU,wBAAwB,CAAC,QAA0B;IACjE,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAA;IAC9B,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAEjF,OAAO
|
|
1
|
+
{"version":3,"file":"task.js","sourceRoot":"","sources":["../../src/tools/task.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,EAAE;AACF,sEAAsE;AACtE,kEAAkE;AAClE,gEAAgE;AAChE,kEAAkE;AAClE,mBAAmB;AACnB,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAA;AAEzB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB;;;2DAG2D;AAC3D,MAAM,UAAU,wBAAwB,CAAC,QAA0B;IACjE,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAA;IAC9B,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAEjF,OAAO;;;;;EAKP,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAsDA,CAAA;AACX,CAAC;AAED;4DAC4D;AAC5D,MAAM,UAAU,cAAc,CAAC,QAA0B;IACvD,OAAO,IAAI,CAAC;QACV,WAAW,EAAE,wBAAwB,CAAC,QAAQ,CAAC;QAC/C,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;YAC/E,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sCAAsC,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACvG,MAAM,EAAE,CAAC;iBACN,MAAM,EAAE;iBACR,QAAQ,CACP,wGAAwG,CACzG;SACJ,CAAC;QACF,qDAAqD;KACtD,CAAC,CAAA;AACJ,CAAC"}
|