agent-orchestrator-mcp-server 0.4.6 → 0.5.0
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/README.md +16 -16
- package/package.json +1 -1
- package/shared/orchestrator-client/orchestrator-client.d.ts +3 -0
- package/shared/orchestrator-client/orchestrator-client.integration-mock.js +9 -0
- package/shared/orchestrator-client/orchestrator-client.js +11 -1
- package/shared/tools/action-session.d.ts +21 -7
- package/shared/tools/action-session.js +71 -4
- package/shared/tools/action-trigger.d.ts +2 -2
- package/shared/tools/get-configs.js +3 -0
- package/shared/tools/get-session.d.ts +1 -1
- package/shared/tools/get-session.js +15 -2
- package/shared/tools/manage-enqueued-messages.d.ts +2 -2
- package/shared/tools/start-session.d.ts +7 -7
- package/shared/tools/start-session.js +5 -2
- package/shared/types.d.ts +2 -0
package/README.md
CHANGED
|
@@ -21,22 +21,22 @@ MCP server for PulseMCP's agent-orchestrator: a Claude Code + MCP-powered agent-
|
|
|
21
21
|
|
|
22
22
|
### Tools
|
|
23
23
|
|
|
24
|
-
| Tool | Tool Group | Read/Write | Description
|
|
25
|
-
| -------------------------- | ------------- | ---------- |
|
|
26
|
-
| `quick_search_sessions` | sessions | read | Quick title-based search/list sessions with optional ID lookup, title query, and status filter
|
|
27
|
-
| `get_session` | sessions | read | Get detailed session info with optional logs, transcripts, and transcript format (text/json)
|
|
28
|
-
| `get_configs` | sessions | read | Fetch all static configuration (MCP servers, agent roots, stop conditions)
|
|
29
|
-
| `get_transcript_archive` | sessions | read | Get download URL and metadata for the transcript archive zip file
|
|
30
|
-
| `start_session` | sessions | write | Create and start a new agent session
|
|
31
|
-
| `action_session` | sessions | write | Perform actions: follow_up, pause, restart, archive, unarchive, change_mcp_servers, fork, refresh, refresh_all, update_notes, toggle_favorite, bulk_archive |
|
|
32
|
-
| `manage_enqueued_messages` | sessions | write | Manage session message queue: list, get, create, update, delete, reorder, interrupt
|
|
33
|
-
| `get_notifications` | notifications | read | Get/list notifications and badge count
|
|
34
|
-
| `send_push_notification` | notifications | write | Send a push notification about a session needing human attention
|
|
35
|
-
| `action_notification` | notifications | write | Mark read, mark all read, dismiss, dismiss all read notifications
|
|
36
|
-
| `search_triggers` | triggers | read | Search/list automation triggers with optional channel info
|
|
37
|
-
| `action_trigger` | triggers | write | Create, update, delete, toggle automation triggers
|
|
38
|
-
| `get_system_health` | health | read | Get system health report and optional CLI status
|
|
39
|
-
| `action_health` | health | write | System maintenance: cleanup_processes, retry_sessions, archive_old, cli_refresh, cli_clear_cache
|
|
24
|
+
| Tool | Tool Group | Read/Write | Description |
|
|
25
|
+
| -------------------------- | ------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
26
|
+
| `quick_search_sessions` | sessions | read | Quick title-based search/list sessions with optional ID lookup, title query, and status filter |
|
|
27
|
+
| `get_session` | sessions | read | Get detailed session info with optional logs, transcripts, and transcript format (text/json) |
|
|
28
|
+
| `get_configs` | sessions | read | Fetch all static configuration (MCP servers, agent roots, stop conditions) |
|
|
29
|
+
| `get_transcript_archive` | sessions | read | Get download URL and metadata for the transcript archive zip file |
|
|
30
|
+
| `start_session` | sessions | write | Create and start a new agent session |
|
|
31
|
+
| `action_session` | sessions | write | Perform actions: follow_up, pause, restart, archive, unarchive, change_mcp_servers, change_model, fork, refresh, refresh_all, update_notes, update_title, toggle_favorite, bulk_archive |
|
|
32
|
+
| `manage_enqueued_messages` | sessions | write | Manage session message queue: list, get, create, update, delete, reorder, interrupt |
|
|
33
|
+
| `get_notifications` | notifications | read | Get/list notifications and badge count |
|
|
34
|
+
| `send_push_notification` | notifications | write | Send a push notification about a session needing human attention |
|
|
35
|
+
| `action_notification` | notifications | write | Mark read, mark all read, dismiss, dismiss all read notifications |
|
|
36
|
+
| `search_triggers` | triggers | read | Search/list automation triggers with optional channel info |
|
|
37
|
+
| `action_trigger` | triggers | write | Create, update, delete, toggle automation triggers |
|
|
38
|
+
| `get_system_health` | health | read | Get system health report and optional CLI status |
|
|
39
|
+
| `action_health` | health | write | System maintenance: cleanup_processes, retry_sessions, archive_old, cli_refresh, cli_clear_cache |
|
|
40
40
|
|
|
41
41
|
### Resources
|
|
42
42
|
|
package/package.json
CHANGED
|
@@ -17,6 +17,7 @@ export interface RawAgentRoot {
|
|
|
17
17
|
default?: boolean;
|
|
18
18
|
default_mcp_servers?: string[];
|
|
19
19
|
default_skills?: string[];
|
|
20
|
+
default_model?: string;
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* Maps a raw API agent root to the normalized AgentRootInfo interface.
|
|
@@ -53,6 +54,7 @@ export interface IAgentOrchestratorClient {
|
|
|
53
54
|
pauseSession(id: string | number): Promise<SessionActionResponse>;
|
|
54
55
|
restartSession(id: string | number): Promise<SessionActionResponse>;
|
|
55
56
|
changeMcpServers(id: string | number, mcp_servers: string[]): Promise<Session>;
|
|
57
|
+
changeModel(id: string | number, model: string): Promise<Session>;
|
|
56
58
|
listLogs(sessionId: string | number, options?: {
|
|
57
59
|
level?: LogLevel;
|
|
58
60
|
page?: number;
|
|
@@ -175,6 +177,7 @@ export declare class AgentOrchestratorClient implements IAgentOrchestratorClient
|
|
|
175
177
|
pauseSession(id: string | number): Promise<SessionActionResponse>;
|
|
176
178
|
restartSession(id: string | number): Promise<SessionActionResponse>;
|
|
177
179
|
changeMcpServers(id: string | number, mcp_servers: string[]): Promise<Session>;
|
|
180
|
+
changeModel(id: string | number, model: string): Promise<Session>;
|
|
178
181
|
listLogs(sessionId: string | number, options?: {
|
|
179
182
|
level?: LogLevel;
|
|
180
183
|
page?: number;
|
|
@@ -247,6 +247,15 @@ export function createIntegrationMockOrchestratorClient(initialMockData) {
|
|
|
247
247
|
session.updated_at = new Date().toISOString();
|
|
248
248
|
return session;
|
|
249
249
|
},
|
|
250
|
+
async changeModel(id, model) {
|
|
251
|
+
const session = mockData.sessions?.find((s) => s.id === Number(id) || s.slug === String(id));
|
|
252
|
+
if (!session) {
|
|
253
|
+
throw new Error(`API Error (404): Session not found`);
|
|
254
|
+
}
|
|
255
|
+
session.config = { ...session.config, model };
|
|
256
|
+
session.updated_at = new Date().toISOString();
|
|
257
|
+
return session;
|
|
258
|
+
},
|
|
250
259
|
async listLogs(sessionId, options) {
|
|
251
260
|
let logs = (mockData.logs || []).filter((l) => l.session_id === Number(sessionId));
|
|
252
261
|
if (options?.level) {
|
|
@@ -19,6 +19,7 @@ export function mapAgentRoot(raw) {
|
|
|
19
19
|
default_stop_condition: raw.default_stop_condition,
|
|
20
20
|
default_mcp_servers: raw.default_mcp_servers,
|
|
21
21
|
default_skills: raw.default_skills,
|
|
22
|
+
default_model: raw.default_model,
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
25
|
/** Default timeout for API requests in milliseconds */
|
|
@@ -177,7 +178,10 @@ export class AgentOrchestratorClient {
|
|
|
177
178
|
return response.session;
|
|
178
179
|
}
|
|
179
180
|
async createSession(data) {
|
|
180
|
-
|
|
181
|
+
// Remap `skills` to `catalog_skills` for the API (Rails strong params expects `catalog_skills`)
|
|
182
|
+
const { skills, ...rest } = data;
|
|
183
|
+
const body = skills !== undefined ? { ...rest, catalog_skills: skills } : rest;
|
|
184
|
+
const response = await this.request('POST', '/sessions', body);
|
|
181
185
|
return response.session;
|
|
182
186
|
}
|
|
183
187
|
async updateSession(id, data) {
|
|
@@ -210,6 +214,12 @@ export class AgentOrchestratorClient {
|
|
|
210
214
|
});
|
|
211
215
|
return response.session;
|
|
212
216
|
}
|
|
217
|
+
async changeModel(id, model) {
|
|
218
|
+
const response = await this.request('PATCH', `/sessions/${id}/model`, {
|
|
219
|
+
model,
|
|
220
|
+
});
|
|
221
|
+
return response.session;
|
|
222
|
+
}
|
|
213
223
|
// Logs
|
|
214
224
|
async listLogs(sessionId, options) {
|
|
215
225
|
return this.request('GET', `/sessions/${sessionId}/logs`, undefined, options);
|
|
@@ -3,25 +3,31 @@ import { z } from 'zod';
|
|
|
3
3
|
import type { IAgentOrchestratorClient } from '../orchestrator-client/orchestrator-client.js';
|
|
4
4
|
export declare const ActionSessionSchema: z.ZodObject<{
|
|
5
5
|
session_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
6
|
-
action: z.ZodEnum<["follow_up", "pause", "restart", "archive", "unarchive", "change_mcp_servers", "fork", "refresh", "refresh_all", "update_notes", "toggle_favorite", "bulk_archive"]>;
|
|
6
|
+
action: z.ZodEnum<["follow_up", "pause", "restart", "archive", "unarchive", "change_mcp_servers", "change_model", "fork", "refresh", "refresh_all", "update_notes", "update_title", "toggle_favorite", "bulk_archive"]>;
|
|
7
7
|
prompt: z.ZodOptional<z.ZodString>;
|
|
8
8
|
mcp_servers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
9
|
+
model: z.ZodOptional<z.ZodString>;
|
|
9
10
|
message_index: z.ZodOptional<z.ZodNumber>;
|
|
10
11
|
session_notes: z.ZodOptional<z.ZodString>;
|
|
11
12
|
session_ids: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
13
|
+
title: z.ZodOptional<z.ZodString>;
|
|
12
14
|
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
action: "follow_up" | "pause" | "restart" | "archive" | "unarchive" | "change_mcp_servers" | "fork" | "refresh" | "refresh_all" | "update_notes" | "toggle_favorite" | "bulk_archive";
|
|
14
|
-
mcp_servers?: string[] | undefined;
|
|
15
|
+
action: "follow_up" | "pause" | "restart" | "archive" | "unarchive" | "change_mcp_servers" | "change_model" | "fork" | "refresh" | "refresh_all" | "update_notes" | "update_title" | "toggle_favorite" | "bulk_archive";
|
|
15
16
|
prompt?: string | undefined;
|
|
17
|
+
title?: string | undefined;
|
|
18
|
+
mcp_servers?: string[] | undefined;
|
|
16
19
|
session_id?: string | number | undefined;
|
|
20
|
+
model?: string | undefined;
|
|
17
21
|
message_index?: number | undefined;
|
|
18
22
|
session_notes?: string | undefined;
|
|
19
23
|
session_ids?: number[] | undefined;
|
|
20
24
|
}, {
|
|
21
|
-
action: "follow_up" | "pause" | "restart" | "archive" | "unarchive" | "change_mcp_servers" | "fork" | "refresh" | "refresh_all" | "update_notes" | "toggle_favorite" | "bulk_archive";
|
|
22
|
-
mcp_servers?: string[] | undefined;
|
|
25
|
+
action: "follow_up" | "pause" | "restart" | "archive" | "unarchive" | "change_mcp_servers" | "change_model" | "fork" | "refresh" | "refresh_all" | "update_notes" | "update_title" | "toggle_favorite" | "bulk_archive";
|
|
23
26
|
prompt?: string | undefined;
|
|
27
|
+
title?: string | undefined;
|
|
28
|
+
mcp_servers?: string[] | undefined;
|
|
24
29
|
session_id?: string | number | undefined;
|
|
30
|
+
model?: string | undefined;
|
|
25
31
|
message_index?: number | undefined;
|
|
26
32
|
session_notes?: string | undefined;
|
|
27
33
|
session_ids?: number[] | undefined;
|
|
@@ -40,8 +46,8 @@ export declare function actionSessionTool(_server: Server, clientFactory: () =>
|
|
|
40
46
|
};
|
|
41
47
|
action: {
|
|
42
48
|
type: string;
|
|
43
|
-
enum: readonly ["follow_up", "pause", "restart", "archive", "unarchive", "change_mcp_servers", "fork", "refresh", "refresh_all", "update_notes", "toggle_favorite", "bulk_archive"];
|
|
44
|
-
description: "Action to perform: \"follow_up\", \"pause\", \"restart\", \"archive\", \"unarchive\", \"change_mcp_servers\", \"fork\", \"refresh\", \"refresh_all\", \"update_notes\", \"toggle_favorite\", \"bulk_archive\"";
|
|
49
|
+
enum: readonly ["follow_up", "pause", "restart", "archive", "unarchive", "change_mcp_servers", "change_model", "fork", "refresh", "refresh_all", "update_notes", "update_title", "toggle_favorite", "bulk_archive"];
|
|
50
|
+
description: "Action to perform: \"follow_up\", \"pause\", \"restart\", \"archive\", \"unarchive\", \"change_mcp_servers\", \"change_model\", \"fork\", \"refresh\", \"refresh_all\", \"update_notes\", \"update_title\", \"toggle_favorite\", \"bulk_archive\"";
|
|
45
51
|
};
|
|
46
52
|
prompt: {
|
|
47
53
|
type: string;
|
|
@@ -54,6 +60,10 @@ export declare function actionSessionTool(_server: Server, clientFactory: () =>
|
|
|
54
60
|
};
|
|
55
61
|
description: "Required for \"change_mcp_servers\" action. Array of MCP server names to set for the session.";
|
|
56
62
|
};
|
|
63
|
+
model: {
|
|
64
|
+
type: string;
|
|
65
|
+
description: "Required for \"change_model\" action. The model identifier to use (e.g., \"opus\", \"sonnet\").";
|
|
66
|
+
};
|
|
57
67
|
message_index: {
|
|
58
68
|
type: string;
|
|
59
69
|
description: "Required for \"fork\" action. The transcript message index to fork from.";
|
|
@@ -69,6 +79,10 @@ export declare function actionSessionTool(_server: Server, clientFactory: () =>
|
|
|
69
79
|
};
|
|
70
80
|
description: "Required for \"bulk_archive\" action. Array of session IDs to archive.";
|
|
71
81
|
};
|
|
82
|
+
title: {
|
|
83
|
+
type: string;
|
|
84
|
+
description: "Required for \"update_title\" action. The new title for the session.";
|
|
85
|
+
};
|
|
72
86
|
};
|
|
73
87
|
required: string[];
|
|
74
88
|
};
|
|
@@ -2,12 +2,14 @@ import { z } from 'zod';
|
|
|
2
2
|
import { parseAllowedAgentRoots } from '../allowed-agent-roots.js';
|
|
3
3
|
const PARAM_DESCRIPTIONS = {
|
|
4
4
|
session_id: 'Session ID (numeric) or slug (string). Required for most actions. Not required for "refresh_all" and "bulk_archive".',
|
|
5
|
-
action: 'Action to perform: "follow_up", "pause", "restart", "archive", "unarchive", "change_mcp_servers", "fork", "refresh", "refresh_all", "update_notes", "toggle_favorite", "bulk_archive"',
|
|
5
|
+
action: 'Action to perform: "follow_up", "pause", "restart", "archive", "unarchive", "change_mcp_servers", "change_model", "fork", "refresh", "refresh_all", "update_notes", "update_title", "toggle_favorite", "bulk_archive"',
|
|
6
6
|
prompt: 'Required for "follow_up" action. The prompt to send to the agent. Not used for other actions.',
|
|
7
7
|
mcp_servers: 'Required for "change_mcp_servers" action. Array of MCP server names to set for the session.',
|
|
8
|
+
model: 'Required for "change_model" action. The model identifier to use (e.g., "opus", "sonnet").',
|
|
8
9
|
message_index: 'Required for "fork" action. The transcript message index to fork from.',
|
|
9
10
|
session_notes: 'Required for "update_notes" action. The notes text to set on the session.',
|
|
10
11
|
session_ids: 'Required for "bulk_archive" action. Array of session IDs to archive.',
|
|
12
|
+
title: 'Required for "update_title" action. The new title for the session.',
|
|
11
13
|
};
|
|
12
14
|
const ACTION_ENUM = [
|
|
13
15
|
'follow_up',
|
|
@@ -16,10 +18,12 @@ const ACTION_ENUM = [
|
|
|
16
18
|
'archive',
|
|
17
19
|
'unarchive',
|
|
18
20
|
'change_mcp_servers',
|
|
21
|
+
'change_model',
|
|
19
22
|
'fork',
|
|
20
23
|
'refresh',
|
|
21
24
|
'refresh_all',
|
|
22
25
|
'update_notes',
|
|
26
|
+
'update_title',
|
|
23
27
|
'toggle_favorite',
|
|
24
28
|
'bulk_archive',
|
|
25
29
|
];
|
|
@@ -28,9 +32,11 @@ export const ActionSessionSchema = z.object({
|
|
|
28
32
|
action: z.enum(ACTION_ENUM).describe(PARAM_DESCRIPTIONS.action),
|
|
29
33
|
prompt: z.string().optional().describe(PARAM_DESCRIPTIONS.prompt),
|
|
30
34
|
mcp_servers: z.array(z.string()).optional().describe(PARAM_DESCRIPTIONS.mcp_servers),
|
|
35
|
+
model: z.string().optional().describe(PARAM_DESCRIPTIONS.model),
|
|
31
36
|
message_index: z.number().optional().describe(PARAM_DESCRIPTIONS.message_index),
|
|
32
37
|
session_notes: z.string().optional().describe(PARAM_DESCRIPTIONS.session_notes),
|
|
33
38
|
session_ids: z.array(z.number()).optional().describe(PARAM_DESCRIPTIONS.session_ids),
|
|
39
|
+
title: z.string().optional().describe(PARAM_DESCRIPTIONS.title),
|
|
34
40
|
});
|
|
35
41
|
const TOOL_DESCRIPTION = `Perform an action on an agent session.
|
|
36
42
|
|
|
@@ -41,18 +47,21 @@ const TOOL_DESCRIPTION = `Perform an action on an agent session.
|
|
|
41
47
|
- **archive**: Archive a session (marks as completed)
|
|
42
48
|
- **unarchive**: Restore an archived session to idle "needs_input" status
|
|
43
49
|
- **change_mcp_servers**: Update the MCP servers for a session (requires "mcp_servers" parameter)
|
|
50
|
+
- **change_model**: Update the model for a session (requires "model" parameter, e.g., "opus", "sonnet")
|
|
44
51
|
- **fork**: Fork a session from a specific transcript message (requires "message_index")
|
|
45
52
|
- **refresh**: Refresh a single session's status from the execution provider
|
|
46
53
|
- **refresh_all**: Refresh all active sessions (no session_id needed)
|
|
47
54
|
- **update_notes**: Update the notes on a session (requires "session_notes")
|
|
55
|
+
- **update_title**: Update the title of a session (requires "title")
|
|
48
56
|
- **toggle_favorite**: Toggle favorite status on a session
|
|
49
57
|
- **bulk_archive**: Archive multiple sessions at once (requires "session_ids", no session_id needed)
|
|
50
58
|
|
|
51
59
|
**Use cases:**
|
|
52
60
|
- Provide additional instructions to an agent
|
|
53
61
|
- Control session lifecycle (pause, restart, fork, refresh)
|
|
54
|
-
- Organize sessions (archive, unarchive, bulk_archive, toggle_favorite, update_notes)
|
|
55
|
-
- Reconfigure session MCP server access
|
|
62
|
+
- Organize sessions (archive, unarchive, bulk_archive, toggle_favorite, update_notes, update_title)
|
|
63
|
+
- Reconfigure session MCP server access
|
|
64
|
+
- Change the model used by a session`;
|
|
56
65
|
export function actionSessionTool(_server, clientFactory) {
|
|
57
66
|
return {
|
|
58
67
|
name: 'action_session',
|
|
@@ -78,6 +87,10 @@ export function actionSessionTool(_server, clientFactory) {
|
|
|
78
87
|
items: { type: 'string' },
|
|
79
88
|
description: PARAM_DESCRIPTIONS.mcp_servers,
|
|
80
89
|
},
|
|
90
|
+
model: {
|
|
91
|
+
type: 'string',
|
|
92
|
+
description: PARAM_DESCRIPTIONS.model,
|
|
93
|
+
},
|
|
81
94
|
message_index: {
|
|
82
95
|
type: 'number',
|
|
83
96
|
description: PARAM_DESCRIPTIONS.message_index,
|
|
@@ -91,6 +104,10 @@ export function actionSessionTool(_server, clientFactory) {
|
|
|
91
104
|
items: { type: 'number' },
|
|
92
105
|
description: PARAM_DESCRIPTIONS.session_ids,
|
|
93
106
|
},
|
|
107
|
+
title: {
|
|
108
|
+
type: 'string',
|
|
109
|
+
description: PARAM_DESCRIPTIONS.title,
|
|
110
|
+
},
|
|
94
111
|
},
|
|
95
112
|
required: ['action'],
|
|
96
113
|
},
|
|
@@ -98,7 +115,7 @@ export function actionSessionTool(_server, clientFactory) {
|
|
|
98
115
|
try {
|
|
99
116
|
const validatedArgs = ActionSessionSchema.parse(args);
|
|
100
117
|
const client = clientFactory();
|
|
101
|
-
const { session_id, action, prompt, mcp_servers, message_index, session_notes, session_ids, } = validatedArgs;
|
|
118
|
+
const { session_id, action, prompt, mcp_servers, model, message_index, session_notes, session_ids, title, } = validatedArgs;
|
|
102
119
|
// Actions that require session_id
|
|
103
120
|
const requiresSessionId = [
|
|
104
121
|
'follow_up',
|
|
@@ -107,9 +124,11 @@ export function actionSessionTool(_server, clientFactory) {
|
|
|
107
124
|
'archive',
|
|
108
125
|
'unarchive',
|
|
109
126
|
'change_mcp_servers',
|
|
127
|
+
'change_model',
|
|
110
128
|
'fork',
|
|
111
129
|
'refresh',
|
|
112
130
|
'update_notes',
|
|
131
|
+
'update_title',
|
|
113
132
|
'toggle_favorite',
|
|
114
133
|
];
|
|
115
134
|
if (requiresSessionId.includes(action) && !session_id) {
|
|
@@ -147,6 +166,18 @@ export function actionSessionTool(_server, clientFactory) {
|
|
|
147
166
|
isError: true,
|
|
148
167
|
};
|
|
149
168
|
}
|
|
169
|
+
// Validate that model is provided for change_model action
|
|
170
|
+
if (action === 'change_model' && !model) {
|
|
171
|
+
return {
|
|
172
|
+
content: [
|
|
173
|
+
{
|
|
174
|
+
type: 'text',
|
|
175
|
+
text: 'Error: The "model" parameter is required for the "change_model" action.',
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
isError: true,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
150
181
|
// Block change_mcp_servers when ALLOWED_AGENT_ROOTS is active
|
|
151
182
|
if (action === 'change_mcp_servers' && parseAllowedAgentRoots() !== null) {
|
|
152
183
|
return {
|
|
@@ -183,6 +214,18 @@ export function actionSessionTool(_server, clientFactory) {
|
|
|
183
214
|
isError: true,
|
|
184
215
|
};
|
|
185
216
|
}
|
|
217
|
+
// Validate update_title requires title
|
|
218
|
+
if (action === 'update_title' && !title) {
|
|
219
|
+
return {
|
|
220
|
+
content: [
|
|
221
|
+
{
|
|
222
|
+
type: 'text',
|
|
223
|
+
text: 'Error: The "title" parameter is required for the "update_title" action.',
|
|
224
|
+
},
|
|
225
|
+
],
|
|
226
|
+
isError: true,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
186
229
|
// Validate bulk_archive requires session_ids
|
|
187
230
|
if (action === 'bulk_archive' && (!session_ids || session_ids.length === 0)) {
|
|
188
231
|
return {
|
|
@@ -285,6 +328,19 @@ export function actionSessionTool(_server, clientFactory) {
|
|
|
285
328
|
result = lines.join('\n');
|
|
286
329
|
break;
|
|
287
330
|
}
|
|
331
|
+
case 'change_model': {
|
|
332
|
+
const session = await client.changeModel(session_id, model);
|
|
333
|
+
const sessionModel = session.config?.model;
|
|
334
|
+
const lines = [
|
|
335
|
+
`## Model Updated`,
|
|
336
|
+
'',
|
|
337
|
+
`- **Session ID:** ${session.id}`,
|
|
338
|
+
`- **Title:** ${session.title}`,
|
|
339
|
+
`- **Model:** ${sessionModel || '(default)'}`,
|
|
340
|
+
];
|
|
341
|
+
result = lines.join('\n');
|
|
342
|
+
break;
|
|
343
|
+
}
|
|
288
344
|
case 'fork': {
|
|
289
345
|
const response = await client.forkSession(session_id, message_index);
|
|
290
346
|
const lines = [
|
|
@@ -336,6 +392,17 @@ export function actionSessionTool(_server, clientFactory) {
|
|
|
336
392
|
result = lines.join('\n');
|
|
337
393
|
break;
|
|
338
394
|
}
|
|
395
|
+
case 'update_title': {
|
|
396
|
+
const session = await client.updateSession(session_id, { title: title });
|
|
397
|
+
const lines = [
|
|
398
|
+
`## Session Title Updated`,
|
|
399
|
+
'',
|
|
400
|
+
`- **Session ID:** ${session.id}`,
|
|
401
|
+
`- **Title:** ${session.title}`,
|
|
402
|
+
];
|
|
403
|
+
result = lines.join('\n');
|
|
404
|
+
break;
|
|
405
|
+
}
|
|
339
406
|
case 'toggle_favorite': {
|
|
340
407
|
const session = await client.toggleFavorite(session_id);
|
|
341
408
|
const lines = [
|
|
@@ -16,11 +16,11 @@ export declare const ActionTriggerSchema: z.ZodObject<{
|
|
|
16
16
|
}, "strip", z.ZodTypeAny, {
|
|
17
17
|
action: "create" | "update" | "delete" | "toggle";
|
|
18
18
|
status?: "enabled" | "disabled" | undefined;
|
|
19
|
+
stop_condition?: string | undefined;
|
|
19
20
|
mcp_servers?: string[] | undefined;
|
|
20
21
|
trigger_type?: "slack" | "schedule" | undefined;
|
|
21
22
|
name?: string | undefined;
|
|
22
23
|
id?: number | undefined;
|
|
23
|
-
stop_condition?: string | undefined;
|
|
24
24
|
agent_root_name?: string | undefined;
|
|
25
25
|
prompt_template?: string | undefined;
|
|
26
26
|
reuse_session?: boolean | undefined;
|
|
@@ -28,11 +28,11 @@ export declare const ActionTriggerSchema: z.ZodObject<{
|
|
|
28
28
|
}, {
|
|
29
29
|
action: "create" | "update" | "delete" | "toggle";
|
|
30
30
|
status?: "enabled" | "disabled" | undefined;
|
|
31
|
+
stop_condition?: string | undefined;
|
|
31
32
|
mcp_servers?: string[] | undefined;
|
|
32
33
|
trigger_type?: "slack" | "schedule" | undefined;
|
|
33
34
|
name?: string | undefined;
|
|
34
35
|
id?: number | undefined;
|
|
35
|
-
stop_condition?: string | undefined;
|
|
36
36
|
agent_root_name?: string | undefined;
|
|
37
37
|
prompt_template?: string | undefined;
|
|
38
38
|
reuse_session?: boolean | undefined;
|
|
@@ -160,6 +160,9 @@ function formatAgentRoot(lines, root) {
|
|
|
160
160
|
if (root.default_skills && root.default_skills.length > 0) {
|
|
161
161
|
lines.push(`- **Default Skills:** ${root.default_skills.map((s) => `\`${s}\``).join(', ')}`);
|
|
162
162
|
}
|
|
163
|
+
if (root.default_model) {
|
|
164
|
+
lines.push(`- **Default Model:** \`${root.default_model}\``);
|
|
165
|
+
}
|
|
163
166
|
lines.push('');
|
|
164
167
|
}
|
|
165
168
|
function formatStopCondition(lines, condition) {
|
|
@@ -46,7 +46,7 @@ export declare function getSessionTool(_server: Server, clientFactory: () => IAg
|
|
|
46
46
|
};
|
|
47
47
|
include_transcript: {
|
|
48
48
|
type: string;
|
|
49
|
-
description: "Include the full transcript
|
|
49
|
+
description: "Include the full transcript inline. Default: false. WARNING: can be very large and may overwhelm your context window. When false, the transcript file path is returned instead so you can grep/tail it efficiently (see tool description for tips).";
|
|
50
50
|
};
|
|
51
51
|
transcript_format: {
|
|
52
52
|
type: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
const PARAM_DESCRIPTIONS = {
|
|
3
3
|
id: 'Session ID (numeric) or slug (string). Examples: "1", "fix-auth-bug-20250115"',
|
|
4
|
-
include_transcript: 'Include the full transcript
|
|
4
|
+
include_transcript: 'Include the full transcript inline. Default: false. WARNING: can be very large and may overwhelm your context window. When false, the transcript file path is returned instead so you can grep/tail it efficiently (see tool description for tips).',
|
|
5
5
|
transcript_format: 'Format for transcript retrieval: "text" (human-readable) or "json" (structured). Only used when include_transcript is true. When specified, fetches transcript via dedicated endpoint instead of inline.',
|
|
6
6
|
include_logs: 'Include logs for the session. Default: false. Use logs_page and logs_per_page for pagination.',
|
|
7
7
|
logs_page: 'Page number for logs pagination. Default: 1',
|
|
@@ -35,10 +35,12 @@ export const GetSessionSchema = z.object({
|
|
|
35
35
|
const TOOL_DESCRIPTION = `Get detailed information about a specific agent session.
|
|
36
36
|
|
|
37
37
|
**Returns:** Complete session details including status, configuration, metadata, and optionally:
|
|
38
|
-
- Full session transcript
|
|
38
|
+
- Full session transcript (WARNING: can be very large)
|
|
39
39
|
- Session logs (paginated)
|
|
40
40
|
- Subagent transcripts (paginated)
|
|
41
41
|
|
|
42
|
+
**Transcript access:** By default (include_transcript=false), the response includes the transcript file path instead of the full content. You can then efficiently grep, tail, or read specific sections of that file — for example, read the last ~100 lines to see the most recent messages. This avoids overwhelming your context window with massive transcripts.
|
|
43
|
+
|
|
42
44
|
**Use cases:**
|
|
43
45
|
- View detailed session information
|
|
44
46
|
- Check session status and progress (use transcript to determine if a "needs_input" session has completed its task or needs follow-up)
|
|
@@ -72,6 +74,9 @@ function formatSessionDetails(session, includeTranscript) {
|
|
|
72
74
|
if (session.mcp_servers && session.mcp_servers.length > 0) {
|
|
73
75
|
lines.push(`- **MCP Servers:** ${session.mcp_servers.join(', ')}`);
|
|
74
76
|
}
|
|
77
|
+
if (session.catalog_skills && session.catalog_skills.length > 0) {
|
|
78
|
+
lines.push(`- **Skills:** ${session.catalog_skills.join(', ')}`);
|
|
79
|
+
}
|
|
75
80
|
if (session.prompt) {
|
|
76
81
|
lines.push('');
|
|
77
82
|
lines.push('### Current Prompt');
|
|
@@ -114,6 +119,14 @@ function formatSessionDetails(session, includeTranscript) {
|
|
|
114
119
|
lines.push(session.transcript);
|
|
115
120
|
lines.push('```');
|
|
116
121
|
}
|
|
122
|
+
// When transcript is not included inline, provide file path hints for efficient access
|
|
123
|
+
if (!includeTranscript && session.session_id) {
|
|
124
|
+
lines.push('');
|
|
125
|
+
lines.push('### Transcript File');
|
|
126
|
+
lines.push(`- **Path pattern:** \`~/.claude/projects/*/${session.session_id}.jsonl\``);
|
|
127
|
+
lines.push(`- **Find exact path:** \`ls ~/.claude/projects/*/${session.session_id}.jsonl\``);
|
|
128
|
+
lines.push('- **Tip:** Once you have the exact path, read the last ~100 lines to see the most recent messages, or grep for specific keywords. This avoids loading the entire transcript into your context window.');
|
|
129
|
+
}
|
|
117
130
|
return lines.join('\n');
|
|
118
131
|
}
|
|
119
132
|
function formatLogs(logs, pagination) {
|
|
@@ -15,8 +15,8 @@ export declare const ManageEnqueuedMessagesSchema: z.ZodObject<{
|
|
|
15
15
|
action: "list" | "get" | "create" | "update" | "delete" | "reorder" | "interrupt";
|
|
16
16
|
per_page?: number | undefined;
|
|
17
17
|
page?: number | undefined;
|
|
18
|
-
content?: string | undefined;
|
|
19
18
|
stop_condition?: string | undefined;
|
|
19
|
+
content?: string | undefined;
|
|
20
20
|
message_id?: number | undefined;
|
|
21
21
|
position?: number | undefined;
|
|
22
22
|
}, {
|
|
@@ -24,8 +24,8 @@ export declare const ManageEnqueuedMessagesSchema: z.ZodObject<{
|
|
|
24
24
|
action: "list" | "get" | "create" | "update" | "delete" | "reorder" | "interrupt";
|
|
25
25
|
per_page?: number | undefined;
|
|
26
26
|
page?: number | undefined;
|
|
27
|
-
content?: string | undefined;
|
|
28
27
|
stop_condition?: string | undefined;
|
|
28
|
+
content?: string | undefined;
|
|
29
29
|
message_id?: number | undefined;
|
|
30
30
|
position?: number | undefined;
|
|
31
31
|
}>;
|
|
@@ -17,30 +17,30 @@ export declare const StartSessionSchema: z.ZodObject<{
|
|
|
17
17
|
custom_metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
18
18
|
}, "strip", z.ZodTypeAny, {
|
|
19
19
|
agent_type?: string | undefined;
|
|
20
|
-
|
|
21
|
-
title?: string | undefined;
|
|
20
|
+
skills?: string[] | undefined;
|
|
22
21
|
prompt?: string | undefined;
|
|
23
22
|
git_root?: string | undefined;
|
|
24
23
|
branch?: string | undefined;
|
|
25
24
|
subdirectory?: string | undefined;
|
|
25
|
+
title?: string | undefined;
|
|
26
26
|
slug?: string | undefined;
|
|
27
27
|
stop_condition?: string | undefined;
|
|
28
28
|
execution_provider?: "local_filesystem" | "remote_sandbox" | undefined;
|
|
29
|
-
|
|
29
|
+
mcp_servers?: string[] | undefined;
|
|
30
30
|
config?: Record<string, unknown> | undefined;
|
|
31
31
|
custom_metadata?: Record<string, unknown> | undefined;
|
|
32
32
|
}, {
|
|
33
33
|
agent_type?: string | undefined;
|
|
34
|
-
|
|
35
|
-
title?: string | undefined;
|
|
34
|
+
skills?: string[] | undefined;
|
|
36
35
|
prompt?: string | undefined;
|
|
37
36
|
git_root?: string | undefined;
|
|
38
37
|
branch?: string | undefined;
|
|
39
38
|
subdirectory?: string | undefined;
|
|
39
|
+
title?: string | undefined;
|
|
40
40
|
slug?: string | undefined;
|
|
41
41
|
stop_condition?: string | undefined;
|
|
42
42
|
execution_provider?: "local_filesystem" | "remote_sandbox" | undefined;
|
|
43
|
-
|
|
43
|
+
mcp_servers?: string[] | undefined;
|
|
44
44
|
config?: Record<string, unknown> | undefined;
|
|
45
45
|
custom_metadata?: Record<string, unknown> | undefined;
|
|
46
46
|
}>;
|
|
@@ -99,7 +99,7 @@ export declare function startSessionTool(_server: Server, clientFactory: () => I
|
|
|
99
99
|
items: {
|
|
100
100
|
type: string;
|
|
101
101
|
};
|
|
102
|
-
description: "List of skill names to enable for this session. Example: [\"discovery-classify\", \"publish-and-pr\"]";
|
|
102
|
+
description: "List of skill names to enable for this session. Always include the agent root's default_skills from get_configs as the starting point — omitting skills means the session gets none. Add extras as needed; removing a default should be rare and intentional. Example: [\"discovery-classify\", \"publish-and-pr\"]";
|
|
103
103
|
};
|
|
104
104
|
config: {
|
|
105
105
|
type: string;
|
|
@@ -21,7 +21,7 @@ const PARAM_DESCRIPTIONS = {
|
|
|
21
21
|
stop_condition: 'Stop condition ID from get_configs (e.g. "pr_merged"). The description is automatically resolved and passed to the agent as context.',
|
|
22
22
|
execution_provider: 'Execution environment. Options: "local_filesystem" (runs locally), "remote_sandbox" (runs in isolated sandbox). Default: "local_filesystem"',
|
|
23
23
|
mcp_servers: 'List of MCP server names to enable for this session. Example: ["github-development", "slack"]',
|
|
24
|
-
skills: 'List of skill names to enable for this session. Example: ["discovery-classify", "publish-and-pr"]',
|
|
24
|
+
skills: 'List of skill names to enable for this session. Always include the agent root\'s default_skills from get_configs as the starting point — omitting skills means the session gets none. Add extras as needed; removing a default should be rare and intentional. Example: ["discovery-classify", "publish-and-pr"]',
|
|
25
25
|
config: 'Additional configuration as a JSON object.',
|
|
26
26
|
custom_metadata: 'User-defined metadata as a JSON object. Useful for tracking tickets, projects, etc.',
|
|
27
27
|
};
|
|
@@ -53,7 +53,10 @@ const TOOL_DESCRIPTION = `Start a new agent session in the Agent Orchestrator.
|
|
|
53
53
|
- If a prompt is provided, the agent job is automatically queued to start
|
|
54
54
|
- If no prompt is provided, creates a clone-only session that can be started later with action_session
|
|
55
55
|
|
|
56
|
-
**Defaults from Agent Roots:** When starting a session that matches a preconfigured agent root (from \`get_configs\`), the agent root defines \`default_mcp_servers
|
|
56
|
+
**Defaults from Agent Roots:** When starting a session that matches a preconfigured agent root (from \`get_configs\`), the agent root defines \`default_mcp_servers\`, \`default_skills\`, and optionally a \`default_stop_condition\`. Omitting \`mcp_servers\` or \`skills\` means the session gets NONE — there is no automatic fallback to defaults.
|
|
57
|
+
|
|
58
|
+
- **MCP servers:** Start with \`default_mcp_servers\`. Drop servers the task doesn't need (least-privilege). Add extras when the task requires tools beyond the defaults. When \`ALLOWED_AGENT_ROOTS\` is active, you cannot add servers beyond the defaults.
|
|
59
|
+
- **Skills:** Start with \`default_skills\`. You can freely add skills beyond the defaults. Removing a default skill should be rare and intentional — only when you have a specific reason, like replacing a skill with a more capable variant that covers the same ground. Skills are lightweight text files with no blast radius, so keeping all defaults costs nothing.
|
|
57
60
|
|
|
58
61
|
**Use cases:**
|
|
59
62
|
- Start a new agent task on a repository
|
package/shared/types.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export interface Session {
|
|
|
23
23
|
execution_provider: string;
|
|
24
24
|
stop_condition: string | null;
|
|
25
25
|
mcp_servers: string[];
|
|
26
|
+
catalog_skills?: string[];
|
|
26
27
|
config: Record<string, unknown>;
|
|
27
28
|
metadata: Record<string, unknown>;
|
|
28
29
|
custom_metadata: Record<string, unknown>;
|
|
@@ -115,6 +116,7 @@ export interface AgentRootInfo {
|
|
|
115
116
|
default_stop_condition?: string;
|
|
116
117
|
default_mcp_servers?: string[];
|
|
117
118
|
default_skills?: string[];
|
|
119
|
+
default_model?: string;
|
|
118
120
|
}
|
|
119
121
|
export interface StopConditionInfo {
|
|
120
122
|
id: string;
|