agent-orchestrator-mcp-server 0.8.2 → 0.8.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-orchestrator-mcp-server",
3
- "version": "0.8.2",
3
+ "version": "0.8.5",
4
4
  "description": "Local implementation of agent-orchestrator MCP server",
5
5
  "main": "build/index.js",
6
6
  "type": "module",
@@ -32,14 +32,14 @@ export declare function mapAgentRoot(raw: RawAgentRoot): AgentRootInfo;
32
32
  export interface IAgentOrchestratorClient {
33
33
  listSessions(options?: {
34
34
  status?: SessionStatus;
35
- agent_type?: string;
35
+ agent_runtime?: string;
36
36
  show_archived?: boolean;
37
37
  page?: number;
38
38
  per_page?: number;
39
39
  }): Promise<SessionsResponse>;
40
40
  searchSessions(query: string, options?: {
41
41
  status?: SessionStatus;
42
- agent_type?: string;
42
+ agent_runtime?: string;
43
43
  show_archived?: boolean;
44
44
  page?: number;
45
45
  per_page?: number;
@@ -159,14 +159,14 @@ export declare class AgentOrchestratorClient implements IAgentOrchestratorClient
159
159
  private requestText;
160
160
  listSessions(options?: {
161
161
  status?: SessionStatus;
162
- agent_type?: string;
162
+ agent_runtime?: string;
163
163
  show_archived?: boolean;
164
164
  page?: number;
165
165
  per_page?: number;
166
166
  }): Promise<SessionsResponse>;
167
167
  searchSessions(query: string, options?: {
168
168
  status?: SessionStatus;
169
- agent_type?: string;
169
+ agent_runtime?: string;
170
170
  show_archived?: boolean;
171
171
  page?: number;
172
172
  per_page?: number;
@@ -14,7 +14,7 @@ export function createIntegrationMockOrchestratorClient(initialMockData) {
14
14
  slug: 'test-session-1',
15
15
  title: 'Test Session 1',
16
16
  status: 'running',
17
- agent_type: 'claude_code',
17
+ agent_runtime: 'claude_code',
18
18
  prompt: 'Test prompt',
19
19
  git_root: 'https://github.com/example/repo.git',
20
20
  branch: 'main',
@@ -75,8 +75,8 @@ export function createIntegrationMockOrchestratorClient(initialMockData) {
75
75
  if (options?.status) {
76
76
  sessions = sessions.filter((s) => s.status === options.status);
77
77
  }
78
- if (options?.agent_type) {
79
- sessions = sessions.filter((s) => s.agent_type === options.agent_type);
78
+ if (options?.agent_runtime) {
79
+ sessions = sessions.filter((s) => s.agent_runtime === options.agent_runtime);
80
80
  }
81
81
  if (!options?.show_archived) {
82
82
  sessions = sessions.filter((s) => s.status !== 'archived');
@@ -138,7 +138,7 @@ export function createIntegrationMockOrchestratorClient(initialMockData) {
138
138
  slug: data.slug || null,
139
139
  title: data.title || 'New Session',
140
140
  status: 'waiting',
141
- agent_type: data.agent_type || 'claude_code',
141
+ agent_runtime: data.agent_runtime || 'claude_code',
142
142
  prompt: data.prompt || null,
143
143
  git_root: data.git_root || null,
144
144
  branch: data.branch || 'main',
@@ -54,7 +54,7 @@ function formatSessionDetails(session, includeTranscript) {
54
54
  '### Basic Information',
55
55
  `- **ID:** ${session.id}`,
56
56
  `- **Status:** ${session.status}`,
57
- `- **Agent Type:** ${session.agent_type}`,
57
+ `- **Agent Runtime:** ${session.agent_runtime}`,
58
58
  ];
59
59
  if (session.slug)
60
60
  lines.push(`- **Slug:** ${session.slug}`);
@@ -5,14 +5,14 @@ export declare const QuickSearchSessionsSchema: z.ZodObject<{
5
5
  id: z.ZodOptional<z.ZodNumber>;
6
6
  query: z.ZodOptional<z.ZodString>;
7
7
  status: z.ZodOptional<z.ZodEnum<["waiting", "running", "needs_input", "failed", "archived"]>>;
8
- agent_type: z.ZodOptional<z.ZodString>;
8
+ agent_runtime: z.ZodOptional<z.ZodString>;
9
9
  show_archived: z.ZodOptional<z.ZodBoolean>;
10
10
  page: z.ZodOptional<z.ZodNumber>;
11
11
  per_page: z.ZodOptional<z.ZodNumber>;
12
12
  }, "strip", z.ZodTypeAny, {
13
13
  per_page?: number | undefined;
14
14
  status?: "waiting" | "running" | "needs_input" | "failed" | "archived" | undefined;
15
- agent_type?: string | undefined;
15
+ agent_runtime?: string | undefined;
16
16
  show_archived?: boolean | undefined;
17
17
  page?: number | undefined;
18
18
  id?: number | undefined;
@@ -20,7 +20,7 @@ export declare const QuickSearchSessionsSchema: z.ZodObject<{
20
20
  }, {
21
21
  per_page?: number | undefined;
22
22
  status?: "waiting" | "running" | "needs_input" | "failed" | "archived" | undefined;
23
- agent_type?: string | undefined;
23
+ agent_runtime?: string | undefined;
24
24
  show_archived?: boolean | undefined;
25
25
  page?: number | undefined;
26
26
  id?: number | undefined;
@@ -46,9 +46,9 @@ export declare function quickSearchSessionsTool(_server: Server, clientFactory:
46
46
  enum: string[];
47
47
  description: "Filter results by status. Options: \"waiting\", \"running\", \"needs_input\", \"failed\", \"archived\"";
48
48
  };
49
- agent_type: {
49
+ agent_runtime: {
50
50
  type: string;
51
- description: "Filter results by agent type.";
51
+ description: "Filter results by agent runtime.";
52
52
  };
53
53
  show_archived: {
54
54
  type: string;
@@ -3,7 +3,7 @@ const PARAM_DESCRIPTIONS = {
3
3
  id: 'Get a specific session by ID. When provided, other filters are ignored.',
4
4
  query: 'Search query to find sessions. Matches against session title only — this is a simple title search, not a full-text or semantic search. Leave empty to list all sessions.',
5
5
  status: 'Filter results by status. Options: "waiting", "running", "needs_input", "failed", "archived"',
6
- agent_type: 'Filter results by agent type.',
6
+ agent_runtime: 'Filter results by agent runtime.',
7
7
  show_archived: 'Include archived sessions in results. Default: false',
8
8
  page: 'Page number for pagination. Default: 1',
9
9
  per_page: 'Number of results per page (1-100). Default: 25',
@@ -15,7 +15,7 @@ export const QuickSearchSessionsSchema = z.object({
15
15
  .enum(['waiting', 'running', 'needs_input', 'failed', 'archived'])
16
16
  .optional()
17
17
  .describe(PARAM_DESCRIPTIONS.status),
18
- agent_type: z.string().optional().describe(PARAM_DESCRIPTIONS.agent_type),
18
+ agent_runtime: z.string().optional().describe(PARAM_DESCRIPTIONS.agent_runtime),
19
19
  show_archived: z.boolean().optional().describe(PARAM_DESCRIPTIONS.show_archived),
20
20
  page: z.number().min(1).optional().describe(PARAM_DESCRIPTIONS.page),
21
21
  per_page: z.number().min(1).max(100).optional().describe(PARAM_DESCRIPTIONS.per_page),
@@ -45,7 +45,7 @@ function formatSession(session) {
45
45
  `### ${session.title} (ID: ${session.id})`,
46
46
  '',
47
47
  `- **Status:** ${session.status}`,
48
- `- **Agent Type:** ${session.agent_type}`,
48
+ `- **Agent Runtime:** ${session.agent_runtime}`,
49
49
  ];
50
50
  if (session.slug)
51
51
  lines.push(`- **Slug:** ${session.slug}`);
@@ -87,9 +87,9 @@ export function quickSearchSessionsTool(_server, clientFactory) {
87
87
  enum: ['waiting', 'running', 'needs_input', 'failed', 'archived'],
88
88
  description: PARAM_DESCRIPTIONS.status,
89
89
  },
90
- agent_type: {
90
+ agent_runtime: {
91
91
  type: 'string',
92
- description: PARAM_DESCRIPTIONS.agent_type,
92
+ description: PARAM_DESCRIPTIONS.agent_runtime,
93
93
  },
94
94
  show_archived: {
95
95
  type: 'boolean',
@@ -132,7 +132,7 @@ export function quickSearchSessionsTool(_server, clientFactory) {
132
132
  // Use search endpoint (title-only search, no content search)
133
133
  const response = await client.searchSessions(validatedArgs.query, {
134
134
  status: validatedArgs.status,
135
- agent_type: validatedArgs.agent_type,
135
+ agent_runtime: validatedArgs.agent_runtime,
136
136
  show_archived: validatedArgs.show_archived,
137
137
  page: validatedArgs.page,
138
138
  per_page: validatedArgs.per_page,
@@ -144,7 +144,7 @@ export function quickSearchSessionsTool(_server, clientFactory) {
144
144
  // Use list endpoint
145
145
  const response = await client.listSessions({
146
146
  status: validatedArgs.status,
147
- agent_type: validatedArgs.agent_type,
147
+ agent_runtime: validatedArgs.agent_runtime,
148
148
  show_archived: validatedArgs.show_archived,
149
149
  page: validatedArgs.page,
150
150
  per_page: validatedArgs.per_page,
@@ -2,7 +2,7 @@ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
2
2
  import { z } from 'zod';
3
3
  import type { IAgentOrchestratorClient } from '../orchestrator-client/orchestrator-client.js';
4
4
  export declare const StartSessionSchema: z.ZodObject<{
5
- agent_type: z.ZodOptional<z.ZodString>;
5
+ agent_runtime: z.ZodOptional<z.ZodString>;
6
6
  prompt: z.ZodOptional<z.ZodString>;
7
7
  agent_root: z.ZodOptional<z.ZodString>;
8
8
  title: z.ZodOptional<z.ZodString>;
@@ -16,7 +16,7 @@ export declare const StartSessionSchema: z.ZodObject<{
16
16
  custom_metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
17
17
  auto_compact_window: z.ZodOptional<z.ZodNumber>;
18
18
  }, "strip", z.ZodTypeAny, {
19
- agent_type?: string | undefined;
19
+ agent_runtime?: string | undefined;
20
20
  skills?: string[] | undefined;
21
21
  plugins?: string[] | undefined;
22
22
  prompt?: string | undefined;
@@ -30,7 +30,7 @@ export declare const StartSessionSchema: z.ZodObject<{
30
30
  custom_metadata?: Record<string, unknown> | undefined;
31
31
  auto_compact_window?: number | undefined;
32
32
  }, {
33
- agent_type?: string | undefined;
33
+ agent_runtime?: string | undefined;
34
34
  skills?: string[] | undefined;
35
35
  plugins?: string[] | undefined;
36
36
  prompt?: string | undefined;
@@ -50,9 +50,9 @@ export declare function startSessionTool(_server: Server, clientFactory: () => I
50
50
  inputSchema: {
51
51
  type: "object";
52
52
  properties: {
53
- agent_type: {
53
+ agent_runtime: {
54
54
  type: string;
55
- description: "Agent type for the session. Currently only \"claude_code\" is supported. Default: \"claude_code\"";
55
+ description: "Per-spawn agent runtime override. When omitted, the session adopts the agent_root's default_runtime, falling back to \"claude_code\". Currently only \"claude_code\" is registered.";
56
56
  };
57
57
  prompt: {
58
58
  type: string;
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { parseAllowedAgentRoots, validateAgentRootConstraints } from '../allowed-agent-roots.js';
3
3
  import { getConfigsCache, setConfigsCache } from '../cache/configs-cache.js';
4
4
  const PARAM_DESCRIPTIONS = {
5
- agent_type: 'Agent type for the session. Currently only "claude_code" is supported. Default: "claude_code"',
5
+ agent_runtime: 'Per-spawn agent runtime override. When omitted, the session adopts the agent_root\'s default_runtime, falling back to "claude_code". Currently only "claude_code" is registered.',
6
6
  prompt: 'Initial prompt for the agent. If provided, the agent job is automatically queued. Omit for a clone-only session.',
7
7
  agent_root: 'Agent root name from get_configs. The API resolves git_root, branch, subdirectory, default_model, and other defaults from the agent root configuration. Always pass this so the session inherits the correct repository, model, and settings.',
8
8
  title: 'STRONGLY RECOMMENDED: Always set a title — treat it as effectively required. ' +
@@ -25,7 +25,7 @@ const PARAM_DESCRIPTIONS = {
25
25
  'Compaction thrashing is currently the only known reason to set this preemptively.',
26
26
  };
27
27
  export const StartSessionSchema = z.object({
28
- agent_type: z.string().optional().describe(PARAM_DESCRIPTIONS.agent_type),
28
+ agent_runtime: z.string().optional().describe(PARAM_DESCRIPTIONS.agent_runtime),
29
29
  prompt: z.string().optional().describe(PARAM_DESCRIPTIONS.prompt),
30
30
  agent_root: z.string().optional().describe(PARAM_DESCRIPTIONS.agent_root),
31
31
  title: z.string().optional().describe(PARAM_DESCRIPTIONS.title),
@@ -71,9 +71,9 @@ export function startSessionTool(_server, clientFactory) {
71
71
  inputSchema: {
72
72
  type: 'object',
73
73
  properties: {
74
- agent_type: {
74
+ agent_runtime: {
75
75
  type: 'string',
76
- description: PARAM_DESCRIPTIONS.agent_type,
76
+ description: PARAM_DESCRIPTIONS.agent_runtime,
77
77
  },
78
78
  prompt: {
79
79
  type: 'string',
@@ -114,6 +114,14 @@ This guidance does NOT apply when waking at a known wall-clock time (e.g., "9am
114
114
  2. As a side effect of creating the trigger, the AO API transitions the session to sleeping (waiting) status — immediately if currently \`needs_input\`, or after the current turn ends if currently \`running\`.
115
115
  3. At the scheduled time, the trigger resumes the session with the provided prompt.
116
116
 
117
+ **End your conversation turn after scheduling.** Two mechanisms together make wake delivery durable:
118
+ 1. **Auto-sleep** — ending your turn transitions the requester from \`running\` to \`waiting\`, where the trigger resumes it directly at the scheduled time.
119
+ 2. **Cross-turn queuing** — if the scheduled time arrives while the requester is still in \`running\` (the turn hadn't ended yet), the wake-up prompt is durably queued onto the requester via \`enqueued_messages\` and picked up at the next turn boundary by AO's pre-pause handoff. It is NOT silently dropped.
120
+
121
+ You should still end your turn promptly — queuing is the safety net, not a substitute for ending the turn.
122
+
123
+ **Wake-ups override \`enqueue_messages: false\`.** For ordinary triggers (Slack, recurring schedules), \`enqueue_messages: false\` means "don't barge a busy session." Wake-ups are one-shot signals, not recurring drumbeats, so they queue onto a running requester regardless of that flag.
124
+
117
125
  **⚠️ Sibling-destroy semantics when paired with state-change wakes.** If this \`wake_me_up_later\` trigger is acting as a deadline backstop alongside \`wake_me_up_when_session_changes_state\` triggers (the recommended triple-wake + deadline pattern), the AO firing path destroys ALL of the requester's other one-time wakes whenever any one of them fires — and that cuts both ways:
118
126
  - If a state-change trigger fires first, this deadline backstop is destroyed (not pending in the background).
119
127
  - If THIS deadline fires first (e.g., a hung watched session never transitioned), all the companion state-change watchers are destroyed.
@@ -206,12 +214,12 @@ export function wakeMeUpLaterTool(_server, clientFactory) {
206
214
  // The Rails Trigger model requires agent_root_name, but for per-session
207
215
  // wake-up triggers (reuse_session + last_session_id + one-time schedule)
208
216
  // the value is never used to spawn a session — the target session is
209
- // always reused. Prefer the canonical metadata value. The agent_type
217
+ // always reused. Prefer the canonical metadata value. The agent_runtime
210
218
  // fallback is a best-effort for pre-migration sessions without an
211
- // agent_root_key; if agent_type isn't a registered agent root, the
219
+ // agent_root_key; if agent_runtime isn't a registered agent root, the
212
220
  // createTrigger call will fail loudly with a 422 rather than proceed
213
221
  // with a bad value — which is what we want.
214
- const agentRootName = session.metadata?.agent_root_key || session.agent_type;
222
+ const agentRootName = session.metadata?.agent_root_key || session.agent_runtime;
215
223
  let trigger;
216
224
  try {
217
225
  trigger = await client.createTrigger({
@@ -252,7 +260,7 @@ export function wakeMeUpLaterTool(_server, clientFactory) {
252
260
  '',
253
261
  '**You must end your conversation turn now.** The session will be automatically transitioned to waiting (immediately if currently needs_input; after the current turn ends if currently running) and resumed at the scheduled time with the provided prompt.',
254
262
  '',
255
- '⚠️ **Warning:** If you do not end your conversation turn, the session may still be running when the scheduled wake-up fires. A wake-up cannot be delivered to a session that is not in a wakeable (sleeping/waiting) state it will be silently dropped, and you will never receive it.',
263
+ "ℹ️ **Cross-turn safety net:** If the scheduled wake-up fires before you end this turn, the wake-up prompt is durably queued onto the session via `enqueued_messages` and processed at the next turn boundary by AO's pre-pause handoff — it is NOT silently dropped. Still end your turn promptly; queuing is the safety net, not a substitute for ending the turn.",
256
264
  '',
257
265
  '**Sibling-destroy reminder:** if this trigger is paired with `wake_me_up_when_session_changes_state` triggers (the triple-wake + deadline pattern), whichever wake fires first destroys ALL the others belonging to this requester. If this deadline fires while the watched session is still progressing, the woken-up turn must re-register the state-change watchers AND a new deadline before going back to sleep — the originals are gone.',
258
266
  ];
@@ -56,7 +56,13 @@ Concretely, in a woken-up turn that determines the watched session has not actua
56
56
  3. When the watched session transitions to the matching state, the trigger fires and resumes the requester with the provided prompt. The trigger then auto-deletes (one-shot).
57
57
  4. If the requester is manually resumed first, the pending trigger is consumed (won't fire). If the watched session is archived without ever transitioning to the matching state (e.g., you only scheduled \`session_needs_input\` and it went straight to \`archived\`), the trigger is cleaned up — and you'll only wake when your deadline backstop fires.
58
58
 
59
- **You must end your conversation turn after calling this tool** so the auto-sleep can take effect. If your turn keeps running, the requester will not be in a wakeable state when the watched session transitions, and the wake-up will be silently dropped. When scheduling multiple triggers (the typical triple-wake + deadline pattern), call this tool repeatedly within the same turn — the auto-sleep is idempotent and only takes effect once the turn ends.`;
59
+ **End your conversation turn after scheduling.** Two mechanisms together make wake delivery durable:
60
+ 1. **Auto-sleep** — ending your turn transitions the requester from \`running\` to \`waiting\`, where the trigger resumes it directly when the watched event fires.
61
+ 2. **Cross-turn queuing** — if the watched event fires while the requester is still in \`running\` (the turn hadn't ended yet when the watched event happened), the wake-up prompt is durably queued onto the requester via \`enqueued_messages\` and picked up at the next turn boundary by AO's pre-pause handoff. It is NOT silently dropped.
62
+
63
+ You should still end your turn promptly — queuing is the safety net, not a substitute for ending the turn. When scheduling multiple triggers (the typical triple-wake + deadline pattern), call this tool repeatedly within the same turn before ending it.
64
+
65
+ **Wake-ups override \`enqueue_messages: false\`.** For ordinary triggers (Slack, recurring schedules), \`enqueue_messages: false\` means "don't barge a busy session." Wake-ups are one-shot signals, not recurring drumbeats, so they queue onto a running requester regardless of that flag.`;
60
66
  export function wakeMeUpWhenSessionChangesStateTool(_server, clientFactory) {
61
67
  return {
62
68
  name: 'wake_me_up_when_session_changes_state',
@@ -223,9 +229,9 @@ export function wakeMeUpWhenSessionChangesStateTool(_server, clientFactory) {
223
229
  // The Rails Trigger model requires agent_root_name, but for per-session
224
230
  // wake-up triggers (reuse_session + last_session_id + one-time event)
225
231
  // the value is never used to spawn a session — the target session is
226
- // always reused. Prefer the canonical metadata value with agent_type as
232
+ // always reused. Prefer the canonical metadata value with agent_runtime as
227
233
  // a legacy fallback (matches wake_me_up_later behavior).
228
- const agentRootName = session.metadata?.agent_root_key || session.agent_type;
234
+ const agentRootName = session.metadata?.agent_root_key || session.agent_runtime;
229
235
  let trigger;
230
236
  try {
231
237
  trigger = await client.createTrigger({
@@ -267,7 +273,7 @@ export function wakeMeUpWhenSessionChangesStateTool(_server, clientFactory) {
267
273
  '',
268
274
  '**You must end your conversation turn now.** The requester session will be automatically transitioned to waiting (immediately if currently needs_input; after the current turn ends if currently running) and resumed when the watched session transitions to the matching state.',
269
275
  '',
270
- '⚠️ **Warning:** If you do not end your conversation turn, the requester may still be running when the watched session transitions. A wake-up cannot be delivered to a session that is not in a wakeable (sleeping/waiting) state it will be silently dropped, and you will never receive it.',
276
+ "ℹ️ **Cross-turn safety net:** If the watched session transitions before you end this turn, the wake-up prompt is durably queued onto the requester via `enqueued_messages` and processed at the next turn boundary by AO's pre-pause handoff — it is NOT silently dropped. Still end your turn promptly; queuing is the safety net, not a substitute for ending the turn.",
271
277
  '',
272
278
  '**One-shot:** the trigger auto-deletes after firing. If you want to wake on the next transition too, schedule another trigger from the woken-up turn.',
273
279
  '',
package/shared/types.d.ts CHANGED
@@ -15,7 +15,7 @@ export interface Session {
15
15
  slug: string | null;
16
16
  title: string;
17
17
  status: SessionStatus;
18
- agent_type: string;
18
+ agent_runtime: string;
19
19
  prompt: string | null;
20
20
  git_root: string | null;
21
21
  branch: string | null;
@@ -135,7 +135,7 @@ export interface SendPushNotificationResponse {
135
135
  session_id: number;
136
136
  }
137
137
  export interface CreateSessionRequest {
138
- agent_type?: string;
138
+ agent_runtime?: string;
139
139
  prompt?: string;
140
140
  git_root?: string;
141
141
  branch?: string;