wolfpack-mcp 1.0.89 → 1.0.90
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.
|
@@ -428,6 +428,12 @@ export const AGENT_BUILDER_TOOLS = [
|
|
|
428
428
|
properties: {
|
|
429
429
|
agent_id: { type: 'string', description: 'Agent profile ID' },
|
|
430
430
|
task_id: { type: 'string', description: 'Task ID to run' },
|
|
431
|
+
prompt: {
|
|
432
|
+
type: 'string',
|
|
433
|
+
description: "Extra instructions for this run only, appended to the task's saved prompt. " +
|
|
434
|
+
'The task still runs as written — this is added after it, and the task is not changed. ' +
|
|
435
|
+
'Omit it to run the task exactly as saved.',
|
|
436
|
+
},
|
|
431
437
|
project_slug: { type: 'string', description: 'Project to scope the session to (optional)' },
|
|
432
438
|
git_ref: {
|
|
433
439
|
type: 'string',
|
|
@@ -1110,13 +1116,14 @@ export async function handleAgentBuilderTool(name, args, client) {
|
|
|
1110
1116
|
.object({
|
|
1111
1117
|
agent_id: z.string(),
|
|
1112
1118
|
task_id: z.string(),
|
|
1119
|
+
prompt: z.string().optional(),
|
|
1113
1120
|
project_slug: z.string().optional(),
|
|
1114
1121
|
git_ref: z.string().optional(),
|
|
1115
1122
|
pr_number: z.number().int().positive().optional(),
|
|
1116
1123
|
org_slug: orgSlugField,
|
|
1117
1124
|
})
|
|
1118
1125
|
.parse(args);
|
|
1119
|
-
const result = await client.runAgentTask(parsed.agent_id, parsed.task_id, parsed.project_slug, resolveOrg(parsed), parsed.git_ref, parsed.pr_number);
|
|
1126
|
+
const result = await client.runAgentTask(parsed.agent_id, parsed.task_id, parsed.project_slug, resolveOrg(parsed), parsed.git_ref, parsed.pr_number, parsed.prompt);
|
|
1120
1127
|
return {
|
|
1121
1128
|
content: [
|
|
1122
1129
|
{
|
|
@@ -74,3 +74,27 @@ describe('per-task model pin over MCP (#2034)', () => {
|
|
|
74
74
|
expect(updateAgentTask.mock.calls[0][2]).toEqual({ prompt: 'Analyse the transcript twice.' });
|
|
75
75
|
});
|
|
76
76
|
});
|
|
77
|
+
// #2048 — run_agent_task can add instructions for one run without editing the
|
|
78
|
+
// task. The prompt is the 7th argument of client.runAgentTask, so these assert
|
|
79
|
+
// on the position as well as the value.
|
|
80
|
+
describe('extra instructions on a task run over MCP (#2048)', () => {
|
|
81
|
+
const runClient = () => {
|
|
82
|
+
const runAgentTask = vi.fn().mockResolvedValue({ entryId: 'e1', position: 0, executing: true });
|
|
83
|
+
return { client: { runAgentTask }, runAgentTask };
|
|
84
|
+
};
|
|
85
|
+
it('advertises the prompt argument as an addition, not a replacement', () => {
|
|
86
|
+
const properties = toolNamed('run_agent_task').inputSchema.properties;
|
|
87
|
+
expect(properties.prompt.description).toContain("appended to the task's saved prompt");
|
|
88
|
+
});
|
|
89
|
+
it('sends the extra instructions with the run', async () => {
|
|
90
|
+
const { client, runAgentTask } = runClient();
|
|
91
|
+
await handleAgentBuilderTool('run_agent_task', { agent_id: 'agent-1', task_id: 'task-1', prompt: 'Only cover last week.' }, client);
|
|
92
|
+
expect(runAgentTask.mock.calls[0][1]).toBe('task-1');
|
|
93
|
+
expect(runAgentTask.mock.calls[0][6]).toBe('Only cover last week.');
|
|
94
|
+
});
|
|
95
|
+
it('sends none when the caller only wants the task as saved', async () => {
|
|
96
|
+
const { client, runAgentTask } = runClient();
|
|
97
|
+
await handleAgentBuilderTool('run_agent_task', { agent_id: 'agent-1', task_id: 'task-1' }, client);
|
|
98
|
+
expect(runAgentTask.mock.calls[0][6]).toBeUndefined();
|
|
99
|
+
});
|
|
100
|
+
});
|
package/dist/client.js
CHANGED
|
@@ -748,8 +748,9 @@ export class WolfpackClient {
|
|
|
748
748
|
async updateAgentTask(agentId, taskId, body, orgSlug) {
|
|
749
749
|
return this.api.patch(this.withOrgSlug(`/agents/${agentId}/tasks/${taskId}`, orgSlug), body);
|
|
750
750
|
}
|
|
751
|
-
|
|
752
|
-
|
|
751
|
+
/** `prompt` is appended to the task's saved prompt for this run only (#2048). */
|
|
752
|
+
async runAgentTask(agentId, taskId, teamSlug, orgSlug, gitRef, prNumber, prompt) {
|
|
753
|
+
return this.api.post(this.withOrgSlug(`/agents/${agentId}/tasks/${taskId}/run`, orgSlug), { teamSlug, gitRef, prNumber, prompt });
|
|
753
754
|
}
|
|
754
755
|
// ─── Agent Builder: Queue ──────────────────────────────────────────────────
|
|
755
756
|
async listAgentQueue(agentId, status, orgSlug) {
|