agent-orchestrator-mcp-server 0.7.13 → 0.7.15

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.7.13",
3
+ "version": "0.7.15",
4
4
  "description": "Local implementation of agent-orchestrator MCP server",
5
5
  "main": "build/index.js",
6
6
  "type": "module",
@@ -611,18 +611,24 @@ export function createIntegrationMockOrchestratorClient(initialMockData) {
611
611
  const trigger = {
612
612
  id,
613
613
  name: 'Test Trigger',
614
- trigger_type: 'schedule',
615
614
  status: 'enabled',
616
615
  agent_root_name: 'mcp-servers',
617
616
  prompt_template: 'Test prompt',
618
617
  stop_condition: null,
619
618
  reuse_session: false,
620
619
  mcp_servers: [],
621
- configuration: {},
622
- schedule_description: 'Every day',
620
+ conditions: [
621
+ {
622
+ id: id * 10,
623
+ condition_type: 'schedule',
624
+ configuration: { interval: 1, unit: 'days', time: '09:00', timezone: 'UTC' },
625
+ description: 'Every day',
626
+ last_triggered_at: null,
627
+ last_polled_at: null,
628
+ },
629
+ ],
623
630
  last_session_id: null,
624
631
  last_triggered_at: null,
625
- last_polled_at: null,
626
632
  sessions_created_count: 0,
627
633
  created_at: new Date().toISOString(),
628
634
  updated_at: new Date().toISOString(),
@@ -630,42 +636,52 @@ export function createIntegrationMockOrchestratorClient(initialMockData) {
630
636
  return { trigger, recent_sessions: [] };
631
637
  },
632
638
  async createTrigger(data) {
639
+ const conditions = (data.trigger_conditions_attributes ?? []).map((c, i) => ({
640
+ id: i + 1,
641
+ condition_type: c.condition_type,
642
+ configuration: c.configuration,
643
+ description: `${c.condition_type} condition`,
644
+ last_triggered_at: null,
645
+ last_polled_at: null,
646
+ }));
633
647
  return {
634
648
  id: 1,
635
649
  name: data.name,
636
- trigger_type: data.trigger_type || 'schedule',
637
650
  status: data.status || 'enabled',
638
651
  agent_root_name: data.agent_root_name,
639
652
  prompt_template: data.prompt_template,
640
653
  stop_condition: data.stop_condition || null,
641
654
  reuse_session: data.reuse_session || false,
642
655
  mcp_servers: data.mcp_servers || [],
643
- configuration: data.configuration || {},
644
- schedule_description: null,
656
+ conditions,
645
657
  last_session_id: data.last_session_id ?? null,
646
658
  last_triggered_at: null,
647
- last_polled_at: null,
648
659
  sessions_created_count: 0,
649
660
  created_at: new Date().toISOString(),
650
661
  updated_at: new Date().toISOString(),
651
662
  };
652
663
  },
653
664
  async updateTrigger(id, data) {
665
+ const conditions = (data.trigger_conditions_attributes ?? []).map((c, i) => ({
666
+ id: i + 1,
667
+ condition_type: c.condition_type,
668
+ configuration: c.configuration,
669
+ description: `${c.condition_type} condition`,
670
+ last_triggered_at: null,
671
+ last_polled_at: null,
672
+ }));
654
673
  return {
655
674
  id,
656
675
  name: data.name || 'Updated Trigger',
657
- trigger_type: data.trigger_type || 'schedule',
658
676
  status: data.status || 'enabled',
659
677
  agent_root_name: data.agent_root_name || 'mcp-servers',
660
678
  prompt_template: data.prompt_template || 'Test prompt',
661
679
  stop_condition: data.stop_condition || null,
662
680
  reuse_session: data.reuse_session || false,
663
681
  mcp_servers: data.mcp_servers || [],
664
- configuration: data.configuration || {},
665
- schedule_description: null,
682
+ conditions,
666
683
  last_session_id: null,
667
684
  last_triggered_at: null,
668
- last_polled_at: null,
669
685
  sessions_created_count: 0,
670
686
  created_at: new Date().toISOString(),
671
687
  updated_at: new Date().toISOString(),
@@ -678,18 +694,15 @@ export function createIntegrationMockOrchestratorClient(initialMockData) {
678
694
  return {
679
695
  id,
680
696
  name: 'Toggled Trigger',
681
- trigger_type: 'schedule',
682
697
  status: 'disabled',
683
698
  agent_root_name: 'mcp-servers',
684
699
  prompt_template: 'Test prompt',
685
700
  stop_condition: null,
686
701
  reuse_session: false,
687
702
  mcp_servers: [],
688
- configuration: {},
689
- schedule_description: null,
703
+ conditions: [],
690
704
  last_session_id: null,
691
705
  last_triggered_at: null,
692
- last_polled_at: null,
693
706
  sessions_created_count: 0,
694
707
  created_at: new Date().toISOString(),
695
708
  updated_at: new Date().toISOString(),
@@ -356,7 +356,11 @@ export class AgentOrchestratorClient {
356
356
  }
357
357
  // Triggers
358
358
  async listTriggers(options) {
359
- return this.request('GET', '/triggers', undefined, options);
359
+ const { trigger_type, ...rest } = options ?? {};
360
+ return this.request('GET', '/triggers', undefined, {
361
+ ...rest,
362
+ ...(trigger_type !== undefined && { condition_type: trigger_type }),
363
+ });
360
364
  }
361
365
  async getTrigger(id) {
362
366
  return this.request('GET', `/triggers/${id}`);
@@ -108,12 +108,14 @@ export function actionTriggerTool(_server, clientFactory) {
108
108
  mcp_servers: validated.mcp_servers,
109
109
  configuration: validated.configuration,
110
110
  });
111
+ const conditionTypes = (trigger.conditions ?? []).map((c) => c.condition_type);
112
+ const typeSummary = conditionTypes.length > 0 ? Array.from(new Set(conditionTypes)).join(', ') : '(none)';
111
113
  result = [
112
114
  '## Trigger Created',
113
115
  '',
114
116
  `- **ID:** ${trigger.id}`,
115
117
  `- **Name:** ${trigger.name}`,
116
- `- **Type:** ${trigger.trigger_type}`,
118
+ `- **Conditions:** ${typeSummary}`,
117
119
  `- **Status:** ${trigger.status}`,
118
120
  `- **Agent Root:** ${trigger.agent_root_name}`,
119
121
  ].join('\n');
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  import type { IAgentOrchestratorClient } from '../orchestrator-client/orchestrator-client.js';
4
4
  export declare const SearchTriggersSchema: z.ZodObject<{
5
5
  id: z.ZodOptional<z.ZodNumber>;
6
- trigger_type: z.ZodOptional<z.ZodEnum<["slack", "schedule"]>>;
6
+ trigger_type: z.ZodOptional<z.ZodEnum<["slack", "schedule", "ao_event"]>>;
7
7
  status: z.ZodOptional<z.ZodEnum<["enabled", "disabled"]>>;
8
8
  include_channels: z.ZodOptional<z.ZodBoolean>;
9
9
  page: z.ZodOptional<z.ZodNumber>;
@@ -12,14 +12,14 @@ export declare const SearchTriggersSchema: z.ZodObject<{
12
12
  per_page?: number | undefined;
13
13
  status?: "enabled" | "disabled" | undefined;
14
14
  page?: number | undefined;
15
- trigger_type?: "slack" | "schedule" | undefined;
15
+ trigger_type?: "slack" | "schedule" | "ao_event" | undefined;
16
16
  id?: number | undefined;
17
17
  include_channels?: boolean | undefined;
18
18
  }, {
19
19
  per_page?: number | undefined;
20
20
  status?: "enabled" | "disabled" | undefined;
21
21
  page?: number | undefined;
22
- trigger_type?: "slack" | "schedule" | undefined;
22
+ trigger_type?: "slack" | "schedule" | "ao_event" | undefined;
23
23
  id?: number | undefined;
24
24
  include_channels?: boolean | undefined;
25
25
  }>;
@@ -35,7 +35,7 @@ export declare function searchTriggersTool(_server: Server, clientFactory: () =>
35
35
  };
36
36
  trigger_type: {
37
37
  type: string;
38
- enum: string[];
38
+ enum: readonly ["slack", "schedule", "ao_event"];
39
39
  description: string;
40
40
  };
41
41
  status: {
@@ -1,7 +1,8 @@
1
1
  import { z } from 'zod';
2
+ const TRIGGER_TYPE_VALUES = ['slack', 'schedule', 'ao_event'];
2
3
  export const SearchTriggersSchema = z.object({
3
4
  id: z.number().optional(),
4
- trigger_type: z.enum(['slack', 'schedule']).optional(),
5
+ trigger_type: z.enum(TRIGGER_TYPE_VALUES).optional(),
5
6
  status: z.enum(['enabled', 'disabled']).optional(),
6
7
  include_channels: z.boolean().optional(),
7
8
  page: z.number().min(1).optional(),
@@ -14,10 +15,31 @@ const TOOL_DESCRIPTION = `Search and list automation triggers.
14
15
  - **List**: List triggers with optional filters (trigger_type, status, pagination)
15
16
  - **Include channels**: Set include_channels=true to also list available Slack channels (useful when creating Slack triggers)
16
17
 
18
+ **Filterable trigger types:**
19
+ - **slack**: Triggers fired by Slack messages
20
+ - **schedule**: Recurring or one-time scheduled triggers
21
+ - **ao_event**: Triggers fired by internal AO state transitions (e.g., a session entering needs_input or failed). These back the \`wake_me_up_when_session_changes_state\` tool.
22
+
23
+ A trigger may have multiple conditions (OR semantics) — filtering by trigger_type returns triggers that have at least one condition of that type.
24
+
17
25
  **Use cases:**
18
- - View configured automations (scheduled tasks, Slack integrations)
26
+ - View configured automations (scheduled tasks, Slack integrations, ao_event waiters)
19
27
  - Check trigger status and execution history
20
28
  - Discover available Slack channels for new triggers`;
29
+ // Returns a deduped, ordered list of condition types present on a trigger.
30
+ function summarizeConditionTypes(conditions) {
31
+ if (!conditions || conditions.length === 0)
32
+ return '(none)';
33
+ const seen = new Set();
34
+ const ordered = [];
35
+ for (const c of conditions) {
36
+ if (!seen.has(c.condition_type)) {
37
+ seen.add(c.condition_type);
38
+ ordered.push(c.condition_type);
39
+ }
40
+ }
41
+ return ordered.join(', ');
42
+ }
21
43
  export function searchTriggersTool(_server, clientFactory) {
22
44
  return {
23
45
  name: 'search_triggers',
@@ -31,8 +53,8 @@ export function searchTriggersTool(_server, clientFactory) {
31
53
  },
32
54
  trigger_type: {
33
55
  type: 'string',
34
- enum: ['slack', 'schedule'],
35
- description: 'Filter by trigger type.',
56
+ enum: TRIGGER_TYPE_VALUES,
57
+ description: "Filter to triggers having at least one condition of this type. Maps to the API's `condition_type` query parameter.",
36
58
  },
37
59
  status: {
38
60
  type: 'string',
@@ -64,22 +86,30 @@ export function searchTriggersTool(_server, clientFactory) {
64
86
  `## Trigger: ${t.name}`,
65
87
  '',
66
88
  `- **ID:** ${t.id}`,
67
- `- **Type:** ${t.trigger_type}`,
89
+ `- **Conditions:** ${summarizeConditionTypes(t.conditions)}`,
68
90
  `- **Status:** ${t.status}`,
69
91
  `- **Agent Root:** ${t.agent_root_name}`,
70
92
  `- **Reuse Session:** ${t.reuse_session ? 'Yes' : 'No'}`,
71
- `- **MCP Servers:** ${t.mcp_servers.length > 0 ? t.mcp_servers.join(', ') : '(none)'}`,
93
+ `- **MCP Servers:** ${t.mcp_servers && t.mcp_servers.length > 0 ? t.mcp_servers.join(', ') : '(none)'}`,
72
94
  ];
73
95
  if (t.stop_condition)
74
96
  lines.push(`- **Stop Condition:** ${t.stop_condition}`);
75
- if (t.schedule_description)
76
- lines.push(`- **Schedule:** ${t.schedule_description}`);
77
97
  lines.push(`- **Sessions Created:** ${t.sessions_created_count}`);
78
98
  if (t.last_triggered_at)
79
99
  lines.push(`- **Last Triggered:** ${t.last_triggered_at}`);
80
100
  lines.push('', '### Prompt Template', '```', t.prompt_template, '```');
81
- if (t.configuration && Object.keys(t.configuration).length > 0) {
82
- lines.push('', '### Configuration', '```json', JSON.stringify(t.configuration, null, 2), '```');
101
+ if (t.conditions && t.conditions.length > 0) {
102
+ lines.push('', '### Conditions');
103
+ t.conditions.forEach((c) => {
104
+ lines.push(`- **${c.condition_type}** — ${c.description}`);
105
+ if (c.configuration && Object.keys(c.configuration).length > 0) {
106
+ lines.push(' ```json');
107
+ JSON.stringify(c.configuration, null, 2)
108
+ .split('\n')
109
+ .forEach((line) => lines.push(` ${line}`));
110
+ lines.push(' ```');
111
+ }
112
+ });
83
113
  }
84
114
  if (response.recent_sessions && response.recent_sessions.length > 0) {
85
115
  lines.push('', '### Recent Sessions');
@@ -104,9 +134,12 @@ export function searchTriggersTool(_server, clientFactory) {
104
134
  lines.push(`## Triggers (${response.pagination.total_count} total, page ${response.pagination.page} of ${response.pagination.total_pages})`, '');
105
135
  response.triggers.forEach((t) => {
106
136
  lines.push(`### ${t.name} (ID: ${t.id})`);
107
- lines.push(`- **Type:** ${t.trigger_type} | **Status:** ${t.status} | **Sessions:** ${t.sessions_created_count}`);
108
- if (t.schedule_description)
109
- lines.push(`- **Schedule:** ${t.schedule_description}`);
137
+ lines.push(`- **Conditions:** ${summarizeConditionTypes(t.conditions)} | **Status:** ${t.status} | **Sessions:** ${t.sessions_created_count}`);
138
+ if (t.conditions && t.conditions.length > 0) {
139
+ t.conditions.forEach((c) => {
140
+ lines.push(` - ${c.description}`);
141
+ });
142
+ }
110
143
  lines.push('');
111
144
  });
112
145
  }
@@ -14,6 +14,7 @@ export declare const StartSessionSchema: z.ZodObject<{
14
14
  plugins: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
15
15
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
16
16
  custom_metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
17
+ auto_compact_window: z.ZodOptional<z.ZodNumber>;
17
18
  }, "strip", z.ZodTypeAny, {
18
19
  agent_type?: string | undefined;
19
20
  skills?: string[] | undefined;
@@ -27,6 +28,7 @@ export declare const StartSessionSchema: z.ZodObject<{
27
28
  agent_root?: string | undefined;
28
29
  config?: Record<string, unknown> | undefined;
29
30
  custom_metadata?: Record<string, unknown> | undefined;
31
+ auto_compact_window?: number | undefined;
30
32
  }, {
31
33
  agent_type?: string | undefined;
32
34
  skills?: string[] | undefined;
@@ -40,6 +42,7 @@ export declare const StartSessionSchema: z.ZodObject<{
40
42
  agent_root?: string | undefined;
41
43
  config?: Record<string, unknown> | undefined;
42
44
  custom_metadata?: Record<string, unknown> | undefined;
45
+ auto_compact_window?: number | undefined;
43
46
  }>;
44
47
  export declare function startSessionTool(_server: Server, clientFactory: () => IAgentOrchestratorClient): {
45
48
  name: string;
@@ -105,6 +108,10 @@ export declare function startSessionTool(_server: Server, clientFactory: () => I
105
108
  type: string;
106
109
  description: "User-defined metadata as a JSON object. Useful for tracking tickets, projects, etc.";
107
110
  };
111
+ auto_compact_window: {
112
+ type: string;
113
+ description: string;
114
+ };
108
115
  };
109
116
  required: never[];
110
117
  };
@@ -18,6 +18,11 @@ const PARAM_DESCRIPTIONS = {
18
18
  plugins: 'List of plugin names to enable for this session. Plugins extend agent capabilities with additional integrations. Example: ["my-plugin"]',
19
19
  config: 'Additional configuration as a JSON object.',
20
20
  custom_metadata: 'User-defined metadata as a JSON object. Useful for tracking tickets, projects, etc.',
21
+ auto_compact_window: 'Optional per-session auto-compact (context) window override, in tokens. ' +
22
+ '**You should generally rely on the default of 200,000** — omit this parameter and the API default applies. ' +
23
+ 'Only override in the rare situation where the spawned session is suffering from compaction thrashing because it ' +
24
+ "doesn't have enough space to work — in that case, retry with `1000000` (1 million tokens). " +
25
+ 'Compaction thrashing is currently the only known reason to set this preemptively.',
21
26
  };
22
27
  export const StartSessionSchema = z.object({
23
28
  agent_type: z.string().optional().describe(PARAM_DESCRIPTIONS.agent_type),
@@ -35,6 +40,7 @@ export const StartSessionSchema = z.object({
35
40
  plugins: z.array(z.string()).optional().describe(PARAM_DESCRIPTIONS.plugins),
36
41
  config: z.record(z.unknown()).optional().describe(PARAM_DESCRIPTIONS.config),
37
42
  custom_metadata: z.record(z.unknown()).optional().describe(PARAM_DESCRIPTIONS.custom_metadata),
43
+ auto_compact_window: z.number().int().optional().describe(PARAM_DESCRIPTIONS.auto_compact_window),
38
44
  });
39
45
  const TOOL_DESCRIPTION = `Start a new agent session in the Agent Orchestrator.
40
46
 
@@ -117,6 +123,10 @@ export function startSessionTool(_server, clientFactory) {
117
123
  type: 'object',
118
124
  description: PARAM_DESCRIPTIONS.custom_metadata,
119
125
  },
126
+ auto_compact_window: {
127
+ type: 'integer',
128
+ description: PARAM_DESCRIPTIONS.auto_compact_window,
129
+ },
120
130
  },
121
131
  required: [],
122
132
  },
package/shared/types.d.ts CHANGED
@@ -150,6 +150,7 @@ export interface CreateSessionRequest {
150
150
  agent_root?: string;
151
151
  config?: Record<string, unknown>;
152
152
  custom_metadata?: Record<string, unknown>;
153
+ auto_compact_window?: number;
153
154
  }
154
155
  export interface UpdateSessionRequest {
155
156
  title?: string;
@@ -214,23 +215,31 @@ export interface EnqueuedMessageInterruptResponse {
214
215
  session: Session;
215
216
  message: string;
216
217
  }
217
- export type TriggerType = 'slack' | 'schedule';
218
+ export type TriggerConditionType = 'slack' | 'schedule' | 'ao_event';
219
+ export type TriggerType = TriggerConditionType;
218
220
  export type TriggerStatus = 'enabled' | 'disabled';
221
+ export interface TriggerCondition {
222
+ id: number;
223
+ condition_type: TriggerConditionType;
224
+ configuration: Record<string, unknown>;
225
+ description: string;
226
+ last_triggered_at: string | null;
227
+ last_polled_at: string | null;
228
+ }
219
229
  export interface Trigger {
220
230
  id: number;
221
231
  name: string;
222
- trigger_type: TriggerType;
223
232
  status: TriggerStatus;
224
233
  agent_root_name: string;
225
234
  prompt_template: string;
226
235
  stop_condition: string | null;
227
236
  reuse_session: boolean;
237
+ enqueue_messages?: boolean;
238
+ resuscitate_archived?: boolean;
228
239
  mcp_servers: string[];
229
- configuration: Record<string, unknown>;
230
- schedule_description: string | null;
240
+ conditions: TriggerCondition[];
231
241
  last_session_id: number | null;
232
242
  last_triggered_at: string | null;
233
- last_polled_at: string | null;
234
243
  sessions_created_count: number;
235
244
  created_at: string;
236
245
  updated_at: string;
@@ -252,31 +261,32 @@ export interface TriggerChannelsResponse {
252
261
  }>;
253
262
  }
254
263
  export interface TriggerConditionAttributes {
255
- condition_type: 'slack' | 'schedule' | 'ao_event';
264
+ condition_type: TriggerConditionType;
256
265
  configuration: Record<string, unknown>;
257
266
  }
258
267
  export interface CreateTriggerRequest {
259
268
  name: string;
260
- trigger_type?: TriggerType;
261
269
  agent_root_name: string;
262
270
  prompt_template: string;
263
271
  status?: TriggerStatus;
264
272
  stop_condition?: string;
265
273
  reuse_session?: boolean;
266
274
  mcp_servers?: string[];
267
- configuration?: Record<string, unknown>;
268
275
  last_session_id?: number;
269
276
  trigger_conditions_attributes?: TriggerConditionAttributes[];
277
+ trigger_type?: TriggerConditionType;
278
+ configuration?: Record<string, unknown>;
270
279
  }
271
280
  export interface UpdateTriggerRequest {
272
281
  name?: string;
273
- trigger_type?: TriggerType;
274
282
  agent_root_name?: string;
275
283
  prompt_template?: string;
276
284
  status?: TriggerStatus;
277
285
  stop_condition?: string;
278
286
  reuse_session?: boolean;
279
287
  mcp_servers?: string[];
288
+ trigger_conditions_attributes?: TriggerConditionAttributes[];
289
+ trigger_type?: TriggerConditionType;
280
290
  configuration?: Record<string, unknown>;
281
291
  }
282
292
  export interface Notification {