computer-agents 2.2.0 → 2.4.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.
@@ -8,30 +8,26 @@
8
8
  * ```typescript
9
9
  * import { ComputerAgentsClient } from 'computer-agents';
10
10
  *
11
- * const client = new ComputerAgentsClient({
12
- * apiKey: process.env.COMPUTER_AGENTS_API_KEY
13
- * });
11
+ * const client = new ComputerAgentsClient();
14
12
  *
15
- * // Execute a task (simplest usage)
16
- * const result = await client.run('Create a REST API with Flask', {
17
- * environmentId: 'env_xxx',
18
- * onEvent: (event) => console.log(event.type)
19
- * });
13
+ * // Execute a task that's it. No setup needed.
14
+ * const result = await client.run('Create a REST API with Flask');
15
+ * console.log(result.content);
20
16
  *
21
- * // Or use the thread API for multi-turn conversations
22
- * const thread = await client.threads.create({
23
- * environmentId: 'env_xxx'
17
+ * // With streaming events
18
+ * const result2 = await client.run('Build a web scraper', {
19
+ * onEvent: (event) => console.log(event.type)
24
20
  * });
25
21
  *
26
- * const response = await client.threads.sendMessage(thread.id, {
27
- * content: 'Create a REST API',
28
- * onEvent: (event) => console.log(event)
22
+ * // Continue the conversation
23
+ * const followUp = await client.run('Add error handling', {
24
+ * threadId: result2.threadId
29
25
  * });
30
26
  * ```
31
27
  */
32
28
  import { ApiClientError } from './cloud/ApiClient';
33
29
  import type { ApiClientConfig } from './cloud/ApiClient';
34
- import { EnvironmentsResource, ThreadsResource, AgentsResource, BudgetResource, BillingResource, SchedulesResource, GitResource, FilesResource } from './cloud/resources';
30
+ import { EnvironmentsResource, ThreadsResource, AgentsResource, BudgetResource, BillingResource, SchedulesResource, TriggersResource, OrchestrationsResource, GitResource, FilesResource } from './cloud/resources';
35
31
  import type { HealthCheck, Metrics, Project, Environment, MessageStreamEvent } from './cloud/types';
36
32
  export { ApiClientError };
37
33
  export type { ApiClientConfig };
@@ -65,9 +61,10 @@ export interface ComputerAgentsClientConfig {
65
61
  */
66
62
  export interface RunOptions {
67
63
  /**
68
- * Environment ID to execute in (required)
64
+ * Environment ID to execute in.
65
+ * If not provided, a default environment is created automatically.
69
66
  */
70
- environmentId: string;
67
+ environmentId?: string;
71
68
  /**
72
69
  * Thread ID to continue (optional - creates new thread if not provided)
73
70
  */
@@ -234,6 +231,46 @@ export declare class ComputerAgentsClient {
234
231
  * ```
235
232
  */
236
233
  readonly schedules: SchedulesResource;
234
+ /**
235
+ * Event-driven triggers
236
+ *
237
+ * Create triggers that fire agents in response to events from
238
+ * GitHub, Slack, email, webhooks, and more.
239
+ *
240
+ * @example
241
+ * ```typescript
242
+ * const trigger = await client.triggers.create({
243
+ * name: 'On Push to Main',
244
+ * environmentId: 'env_xxx',
245
+ * source: 'github',
246
+ * event: 'push',
247
+ * filters: { branch: 'main' },
248
+ * action: { type: 'send_message', message: 'Run tests and report results' }
249
+ * });
250
+ * ```
251
+ */
252
+ readonly triggers: TriggersResource;
253
+ /**
254
+ * Agent-to-agent orchestration
255
+ *
256
+ * Create multi-agent workflows where agents collaborate in parallel,
257
+ * sequential, conditional, or map-reduce patterns.
258
+ *
259
+ * @example
260
+ * ```typescript
261
+ * const orch = await client.orchestrations.create({
262
+ * name: 'Code Review Pipeline',
263
+ * environmentId: 'env_xxx',
264
+ * strategy: 'sequential',
265
+ * steps: [
266
+ * { agentId: 'agent_lint', name: 'Lint' },
267
+ * { agentId: 'agent_test', name: 'Test' },
268
+ * { agentId: 'agent_review', name: 'Review' }
269
+ * ]
270
+ * });
271
+ * ```
272
+ */
273
+ readonly orchestrations: OrchestrationsResource;
237
274
  /**
238
275
  * Budget management
239
276
  *
@@ -276,25 +313,23 @@ export declare class ComputerAgentsClient {
276
313
  * Execute a task with automatic thread management
277
314
  *
278
315
  * This is the simplest way to run an agent task. It handles:
316
+ * - Auto-creating a default environment (if environmentId not provided)
279
317
  * - Creating a thread (if threadId not provided)
280
318
  * - Sending the message with SSE streaming
281
319
  * - Returning the result with thread ID for follow-ups
282
320
  *
283
321
  * @param task - The task to execute (e.g., "Create a REST API with Flask")
284
- * @param options - Execution options including environmentId (required)
322
+ * @param options - Execution options (all optional)
285
323
  * @returns The execution result with content and thread ID
286
324
  *
287
325
  * @example
288
326
  * ```typescript
289
- * // Simple one-shot execution
290
- * const result = await client.run('Create hello.py', {
291
- * environmentId: 'env_xxx'
292
- * });
327
+ * // Simplest usage — no setup needed
328
+ * const result = await client.run('Create hello.py');
293
329
  * console.log(result.content);
294
330
  *
295
331
  * // With streaming progress
296
332
  * const result = await client.run('Build a REST API', {
297
- * environmentId: 'env_xxx',
298
333
  * onEvent: (event) => {
299
334
  * if (event.type === 'response.item.completed') {
300
335
  * console.log(event.item);
@@ -304,28 +339,30 @@ export declare class ComputerAgentsClient {
304
339
  *
305
340
  * // Continue the conversation
306
341
  * const followUp = await client.run('Add authentication', {
307
- * environmentId: 'env_xxx',
308
342
  * threadId: result.threadId
309
343
  * });
344
+ *
345
+ * // Explicit environment
346
+ * const result = await client.run('Deploy', {
347
+ * environmentId: 'env_xxx'
348
+ * });
310
349
  * ```
311
350
  */
312
- run(task: string, options: RunOptions): Promise<RunResult>;
351
+ run(task: string, options?: RunOptions): Promise<RunResult>;
313
352
  /**
314
353
  * Quick setup with default environment
315
354
  *
316
355
  * Creates a default environment if none exists, returning both
317
356
  * the project and environment ready for execution.
318
357
  *
358
+ * Note: You usually don't need to call this directly. `run()` auto-creates
359
+ * a default environment when `environmentId` is omitted.
360
+ *
319
361
  * @example
320
362
  * ```typescript
321
363
  * const { project, environment } = await client.quickSetup({
322
364
  * internetAccess: true
323
365
  * });
324
- *
325
- * // Ready to execute
326
- * await client.run('Hello world!', {
327
- * environmentId: environment.id
328
- * });
329
366
  * ```
330
367
  */
331
368
  quickSetup(options?: {
@@ -9,24 +9,20 @@
9
9
  * ```typescript
10
10
  * import { ComputerAgentsClient } from 'computer-agents';
11
11
  *
12
- * const client = new ComputerAgentsClient({
13
- * apiKey: process.env.COMPUTER_AGENTS_API_KEY
14
- * });
12
+ * const client = new ComputerAgentsClient();
15
13
  *
16
- * // Execute a task (simplest usage)
17
- * const result = await client.run('Create a REST API with Flask', {
18
- * environmentId: 'env_xxx',
19
- * onEvent: (event) => console.log(event.type)
20
- * });
14
+ * // Execute a task that's it. No setup needed.
15
+ * const result = await client.run('Create a REST API with Flask');
16
+ * console.log(result.content);
21
17
  *
22
- * // Or use the thread API for multi-turn conversations
23
- * const thread = await client.threads.create({
24
- * environmentId: 'env_xxx'
18
+ * // With streaming events
19
+ * const result2 = await client.run('Build a web scraper', {
20
+ * onEvent: (event) => console.log(event.type)
25
21
  * });
26
22
  *
27
- * const response = await client.threads.sendMessage(thread.id, {
28
- * content: 'Create a REST API',
29
- * onEvent: (event) => console.log(event)
23
+ * // Continue the conversation
24
+ * const followUp = await client.run('Add error handling', {
25
+ * threadId: result2.threadId
30
26
  * });
31
27
  * ```
32
28
  */
@@ -160,6 +156,46 @@ class ComputerAgentsClient {
160
156
  * ```
161
157
  */
162
158
  schedules;
159
+ /**
160
+ * Event-driven triggers
161
+ *
162
+ * Create triggers that fire agents in response to events from
163
+ * GitHub, Slack, email, webhooks, and more.
164
+ *
165
+ * @example
166
+ * ```typescript
167
+ * const trigger = await client.triggers.create({
168
+ * name: 'On Push to Main',
169
+ * environmentId: 'env_xxx',
170
+ * source: 'github',
171
+ * event: 'push',
172
+ * filters: { branch: 'main' },
173
+ * action: { type: 'send_message', message: 'Run tests and report results' }
174
+ * });
175
+ * ```
176
+ */
177
+ triggers;
178
+ /**
179
+ * Agent-to-agent orchestration
180
+ *
181
+ * Create multi-agent workflows where agents collaborate in parallel,
182
+ * sequential, conditional, or map-reduce patterns.
183
+ *
184
+ * @example
185
+ * ```typescript
186
+ * const orch = await client.orchestrations.create({
187
+ * name: 'Code Review Pipeline',
188
+ * environmentId: 'env_xxx',
189
+ * strategy: 'sequential',
190
+ * steps: [
191
+ * { agentId: 'agent_lint', name: 'Lint' },
192
+ * { agentId: 'agent_test', name: 'Test' },
193
+ * { agentId: 'agent_review', name: 'Review' }
194
+ * ]
195
+ * });
196
+ * ```
197
+ */
198
+ orchestrations;
163
199
  /**
164
200
  * Budget management
165
201
  *
@@ -207,6 +243,11 @@ class ComputerAgentsClient {
207
243
  * @internal
208
244
  */
209
245
  projects;
246
+ /**
247
+ * Cached default environment ID (populated on first run without environmentId)
248
+ * @internal
249
+ */
250
+ _defaultEnvironmentId = null;
210
251
  constructor(config = {}) {
211
252
  // Get API key from config or environment variable
212
253
  const apiKey = config.apiKey
@@ -230,6 +271,8 @@ class ComputerAgentsClient {
230
271
  this.agents = new resources_1.AgentsResource(this.api);
231
272
  this.files = new resources_1.FilesResource(this.api);
232
273
  this.schedules = new resources_1.SchedulesResource(this.api);
274
+ this.triggers = new resources_1.TriggersResource(this.api);
275
+ this.orchestrations = new resources_1.OrchestrationsResource(this.api);
233
276
  this.budget = new resources_1.BudgetResource(this.api);
234
277
  this.billing = new resources_1.BillingResource(this.api);
235
278
  this.git = new resources_1.GitResource(this.api);
@@ -243,25 +286,23 @@ class ComputerAgentsClient {
243
286
  * Execute a task with automatic thread management
244
287
  *
245
288
  * This is the simplest way to run an agent task. It handles:
289
+ * - Auto-creating a default environment (if environmentId not provided)
246
290
  * - Creating a thread (if threadId not provided)
247
291
  * - Sending the message with SSE streaming
248
292
  * - Returning the result with thread ID for follow-ups
249
293
  *
250
294
  * @param task - The task to execute (e.g., "Create a REST API with Flask")
251
- * @param options - Execution options including environmentId (required)
295
+ * @param options - Execution options (all optional)
252
296
  * @returns The execution result with content and thread ID
253
297
  *
254
298
  * @example
255
299
  * ```typescript
256
- * // Simple one-shot execution
257
- * const result = await client.run('Create hello.py', {
258
- * environmentId: 'env_xxx'
259
- * });
300
+ * // Simplest usage — no setup needed
301
+ * const result = await client.run('Create hello.py');
260
302
  * console.log(result.content);
261
303
  *
262
304
  * // With streaming progress
263
305
  * const result = await client.run('Build a REST API', {
264
- * environmentId: 'env_xxx',
265
306
  * onEvent: (event) => {
266
307
  * if (event.type === 'response.item.completed') {
267
308
  * console.log(event.item);
@@ -271,17 +312,23 @@ class ComputerAgentsClient {
271
312
  *
272
313
  * // Continue the conversation
273
314
  * const followUp = await client.run('Add authentication', {
274
- * environmentId: 'env_xxx',
275
315
  * threadId: result.threadId
276
316
  * });
317
+ *
318
+ * // Explicit environment
319
+ * const result = await client.run('Deploy', {
320
+ * environmentId: 'env_xxx'
321
+ * });
277
322
  * ```
278
323
  */
279
- async run(task, options) {
324
+ async run(task, options = {}) {
325
+ // Auto-resolve environment if not provided
326
+ const environmentId = options.environmentId || await this._ensureDefaultEnvironment();
280
327
  // Create or reuse thread
281
328
  let threadId = options.threadId;
282
329
  if (!threadId) {
283
330
  const thread = await this.threads.create({
284
- environmentId: options.environmentId,
331
+ environmentId,
285
332
  });
286
333
  threadId = thread.id;
287
334
  }
@@ -298,22 +345,40 @@ class ComputerAgentsClient {
298
345
  run: result.run,
299
346
  };
300
347
  }
348
+ /**
349
+ * Return the cached default environment ID, creating one if needed.
350
+ * @internal
351
+ */
352
+ async _ensureDefaultEnvironment() {
353
+ if (this._defaultEnvironmentId) {
354
+ return this._defaultEnvironmentId;
355
+ }
356
+ const environments = await this.environments.list();
357
+ let environment = environments.find(e => e.isDefault);
358
+ if (!environment) {
359
+ environment = await this.environments.create({
360
+ name: 'default',
361
+ internetAccess: true,
362
+ isDefault: true,
363
+ });
364
+ }
365
+ this._defaultEnvironmentId = environment.id;
366
+ return this._defaultEnvironmentId;
367
+ }
301
368
  /**
302
369
  * Quick setup with default environment
303
370
  *
304
371
  * Creates a default environment if none exists, returning both
305
372
  * the project and environment ready for execution.
306
373
  *
374
+ * Note: You usually don't need to call this directly. `run()` auto-creates
375
+ * a default environment when `environmentId` is omitted.
376
+ *
307
377
  * @example
308
378
  * ```typescript
309
379
  * const { project, environment } = await client.quickSetup({
310
380
  * internetAccess: true
311
381
  * });
312
- *
313
- * // Ready to execute
314
- * await client.run('Hello world!', {
315
- * environmentId: environment.id
316
- * });
317
382
  * ```
318
383
  */
319
384
  async quickSetup(options = {})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AAc,SAAS,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO;QACX,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAU,UAAU,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,UAAU;QACR,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC;IAC/B,CAAC;CACF;AA5ZD,oDA4ZC;AASgC,2CAAW;AAKX,8CAAc"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Orchestrations Resource Manager
3
+ *
4
+ * Handles agent-to-agent orchestration including CRUD operations,
5
+ * running orchestrations, and tracking run status.
6
+ *
7
+ * Note: projectId is now embedded in the API key, so routes use
8
+ * simplified paths without /projects/:projectId prefix.
9
+ */
10
+ import type { ApiClient } from '../ApiClient';
11
+ import type { Orchestration, CreateOrchestrationParams, UpdateOrchestrationParams, OrchestrationRun } from '../types';
12
+ export declare class OrchestrationsResource {
13
+ private readonly client;
14
+ constructor(client: ApiClient);
15
+ /**
16
+ * Create a new orchestration
17
+ */
18
+ create(params: CreateOrchestrationParams): Promise<Orchestration>;
19
+ /**
20
+ * List all orchestrations
21
+ */
22
+ list(params?: {
23
+ environmentId?: string;
24
+ limit?: number;
25
+ offset?: number;
26
+ }): Promise<Orchestration[]>;
27
+ /**
28
+ * Get an orchestration by ID
29
+ */
30
+ get(orchestrationId: string): Promise<Orchestration>;
31
+ /**
32
+ * Update an orchestration
33
+ */
34
+ update(orchestrationId: string, params: UpdateOrchestrationParams): Promise<Orchestration>;
35
+ /**
36
+ * Delete an orchestration
37
+ */
38
+ delete(orchestrationId: string): Promise<void>;
39
+ /**
40
+ * Execute an orchestration
41
+ */
42
+ run(orchestrationId: string, options?: {
43
+ inputs?: Record<string, unknown>;
44
+ }): Promise<OrchestrationRun>;
45
+ /**
46
+ * Get a specific run
47
+ */
48
+ getRun(orchestrationId: string, runId: string): Promise<OrchestrationRun>;
49
+ /**
50
+ * List all runs for an orchestration
51
+ */
52
+ listRuns(orchestrationId: string, params?: {
53
+ limit?: number;
54
+ offset?: number;
55
+ }): Promise<OrchestrationRun[]>;
56
+ }
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ /**
3
+ * Orchestrations Resource Manager
4
+ *
5
+ * Handles agent-to-agent orchestration including CRUD operations,
6
+ * running orchestrations, and tracking run status.
7
+ *
8
+ * Note: projectId is now embedded in the API key, so routes use
9
+ * simplified paths without /projects/:projectId prefix.
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.OrchestrationsResource = void 0;
13
+ class OrchestrationsResource {
14
+ client;
15
+ constructor(client) {
16
+ this.client = client;
17
+ }
18
+ /**
19
+ * Create a new orchestration
20
+ */
21
+ async create(params) {
22
+ const response = await this.client.post(`/orchestrations`, params);
23
+ return response.orchestration;
24
+ }
25
+ /**
26
+ * List all orchestrations
27
+ */
28
+ async list(params) {
29
+ const response = await this.client.get(`/orchestrations`, params);
30
+ return response.data;
31
+ }
32
+ /**
33
+ * Get an orchestration by ID
34
+ */
35
+ async get(orchestrationId) {
36
+ const response = await this.client.get(`/orchestrations/${orchestrationId}`);
37
+ return response.orchestration;
38
+ }
39
+ /**
40
+ * Update an orchestration
41
+ */
42
+ async update(orchestrationId, params) {
43
+ const response = await this.client.patch(`/orchestrations/${orchestrationId}`, params);
44
+ return response.orchestration;
45
+ }
46
+ /**
47
+ * Delete an orchestration
48
+ */
49
+ async delete(orchestrationId) {
50
+ await this.client.delete(`/orchestrations/${orchestrationId}`);
51
+ }
52
+ // =========================================================================
53
+ // Orchestration Runs
54
+ // =========================================================================
55
+ /**
56
+ * Execute an orchestration
57
+ */
58
+ async run(orchestrationId, options) {
59
+ const response = await this.client.post(`/orchestrations/${orchestrationId}/runs`, options);
60
+ return response.run;
61
+ }
62
+ /**
63
+ * Get a specific run
64
+ */
65
+ async getRun(orchestrationId, runId) {
66
+ const response = await this.client.get(`/orchestrations/${orchestrationId}/runs/${runId}`);
67
+ return response.run;
68
+ }
69
+ /**
70
+ * List all runs for an orchestration
71
+ */
72
+ async listRuns(orchestrationId, params) {
73
+ const response = await this.client.get(`/orchestrations/${orchestrationId}/runs`, params);
74
+ return response.data;
75
+ }
76
+ }
77
+ exports.OrchestrationsResource = OrchestrationsResource;
78
+ //# sourceMappingURL=OrchestrationsResource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrchestrationsResource.js","sourceRoot":"","sources":["../../../src/cloud/resources/OrchestrationsResource.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAUH,MAAa,sBAAsB;IACJ;IAA7B,YAA6B,MAAiB;QAAjB,WAAM,GAAN,MAAM,CAAW;IAAG,CAAC;IAElD;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,MAAiC;QAC5C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CACrC,iBAAiB,EACjB,MAAM,CACP,CAAC;QACF,OAAO,QAAQ,CAAC,aAAa,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI,CACR,MAAoE;QAEpE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAKnC,iBAAiB,EAAE,MAAM,CAAC,CAAC;QAC9B,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CAAC,eAAuB;QAC/B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CACpC,mBAAmB,eAAe,EAAE,CACrC,CAAC;QACF,OAAO,QAAQ,CAAC,aAAa,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CACV,eAAuB,EACvB,MAAiC;QAEjC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CACtC,mBAAmB,eAAe,EAAE,EACpC,MAAM,CACP,CAAC;QACF,OAAO,QAAQ,CAAC,aAAa,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,eAAuB;QAClC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB,eAAe,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,4EAA4E;IAC5E,qBAAqB;IACrB,4EAA4E;IAE5E;;OAEG;IACH,KAAK,CAAC,GAAG,CACP,eAAuB,EACvB,OAA8C;QAE9C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CACrC,mBAAmB,eAAe,OAAO,EACzC,OAAO,CACR,CAAC;QACF,OAAO,QAAQ,CAAC,GAAG,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CACV,eAAuB,EACvB,KAAa;QAEb,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CACpC,mBAAmB,eAAe,SAAS,KAAK,EAAE,CACnD,CAAC;QACF,OAAO,QAAQ,CAAC,GAAG,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ,CACZ,eAAuB,EACvB,MAA4C;QAE5C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAKnC,mBAAmB,eAAe,OAAO,EAAE,MAAM,CAAC,CAAC;QACtD,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF;AA1GD,wDA0GC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Triggers Resource Manager
3
+ *
4
+ * Handles event-driven trigger management including CRUD operations,
5
+ * enable/disable control, testing, and execution history.
6
+ *
7
+ * Note: projectId is now embedded in the API key, so routes use
8
+ * simplified paths without /projects/:projectId prefix.
9
+ */
10
+ import type { ApiClient } from '../ApiClient';
11
+ import type { Trigger, CreateTriggerParams, UpdateTriggerParams, TriggerExecution } from '../types';
12
+ export declare class TriggersResource {
13
+ private readonly client;
14
+ constructor(client: ApiClient);
15
+ /**
16
+ * Create a new trigger
17
+ */
18
+ create(params: CreateTriggerParams): Promise<Trigger>;
19
+ /**
20
+ * List all triggers
21
+ */
22
+ list(params?: {
23
+ environmentId?: string;
24
+ enabled?: boolean;
25
+ limit?: number;
26
+ offset?: number;
27
+ }): Promise<Trigger[]>;
28
+ /**
29
+ * Get a trigger by ID
30
+ */
31
+ get(triggerId: string): Promise<Trigger>;
32
+ /**
33
+ * Update a trigger
34
+ */
35
+ update(triggerId: string, params: UpdateTriggerParams): Promise<Trigger>;
36
+ /**
37
+ * Delete a trigger
38
+ */
39
+ delete(triggerId: string): Promise<void>;
40
+ /**
41
+ * Enable a trigger
42
+ */
43
+ enable(triggerId: string): Promise<Trigger>;
44
+ /**
45
+ * Disable a trigger
46
+ */
47
+ disable(triggerId: string): Promise<Trigger>;
48
+ /**
49
+ * Test-fire a trigger with an optional payload
50
+ */
51
+ test(triggerId: string, payload?: Record<string, unknown>): Promise<TriggerExecution>;
52
+ /**
53
+ * List past executions for a trigger
54
+ */
55
+ listExecutions(triggerId: string, params?: {
56
+ limit?: number;
57
+ offset?: number;
58
+ }): Promise<TriggerExecution[]>;
59
+ }
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ /**
3
+ * Triggers Resource Manager
4
+ *
5
+ * Handles event-driven trigger management including CRUD operations,
6
+ * enable/disable control, testing, and execution history.
7
+ *
8
+ * Note: projectId is now embedded in the API key, so routes use
9
+ * simplified paths without /projects/:projectId prefix.
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.TriggersResource = void 0;
13
+ class TriggersResource {
14
+ client;
15
+ constructor(client) {
16
+ this.client = client;
17
+ }
18
+ /**
19
+ * Create a new trigger
20
+ */
21
+ async create(params) {
22
+ const response = await this.client.post(`/triggers`, params);
23
+ return response.trigger;
24
+ }
25
+ /**
26
+ * List all triggers
27
+ */
28
+ async list(params) {
29
+ const response = await this.client.get(`/triggers`, params);
30
+ return response.data;
31
+ }
32
+ /**
33
+ * Get a trigger by ID
34
+ */
35
+ async get(triggerId) {
36
+ const response = await this.client.get(`/triggers/${triggerId}`);
37
+ return response.trigger;
38
+ }
39
+ /**
40
+ * Update a trigger
41
+ */
42
+ async update(triggerId, params) {
43
+ const response = await this.client.patch(`/triggers/${triggerId}`, params);
44
+ return response.trigger;
45
+ }
46
+ /**
47
+ * Delete a trigger
48
+ */
49
+ async delete(triggerId) {
50
+ await this.client.delete(`/triggers/${triggerId}`);
51
+ }
52
+ // =========================================================================
53
+ // Trigger Control
54
+ // =========================================================================
55
+ /**
56
+ * Enable a trigger
57
+ */
58
+ async enable(triggerId) {
59
+ const response = await this.client.patch(`/triggers/${triggerId}/enable`);
60
+ return response.trigger;
61
+ }
62
+ /**
63
+ * Disable a trigger
64
+ */
65
+ async disable(triggerId) {
66
+ const response = await this.client.patch(`/triggers/${triggerId}/disable`);
67
+ return response.trigger;
68
+ }
69
+ /**
70
+ * Test-fire a trigger with an optional payload
71
+ */
72
+ async test(triggerId, payload) {
73
+ const response = await this.client.post(`/triggers/${triggerId}/test`, payload ? { payload } : undefined);
74
+ return response.execution;
75
+ }
76
+ // =========================================================================
77
+ // Execution History
78
+ // =========================================================================
79
+ /**
80
+ * List past executions for a trigger
81
+ */
82
+ async listExecutions(triggerId, params) {
83
+ const response = await this.client.get(`/triggers/${triggerId}/executions`, params);
84
+ return response.data;
85
+ }
86
+ }
87
+ exports.TriggersResource = TriggersResource;
88
+ //# sourceMappingURL=TriggersResource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TriggersResource.js","sourceRoot":"","sources":["../../../src/cloud/resources/TriggersResource.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAUH,MAAa,gBAAgB;IACE;IAA7B,YAA6B,MAAiB;QAAjB,WAAM,GAAN,MAAM,CAAW;IAAG,CAAC;IAElD;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,MAA2B;QACtC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CACrC,WAAW,EACX,MAAM,CAC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IAC1B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI,CAAC,SAAiB,EAAE,OAAiC;QAC7D,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CACrC,aAAa,SAAS,OAAO,EAC7B,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAClC,CAAC;QACF,OAAO,QAAQ,CAAC,SAAS,CAAC;IAC5B,CAAC;IAED,4EAA4E;IAC5E,oBAAoB;IACpB,4EAA4E;IAE5E;;OAEG;IACH,KAAK,CAAC,cAAc,CAClB,SAAiB,EACjB,MAA4C;QAE5C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAKnC,aAAa,SAAS,aAAa,EAAE,MAAM,CAAC,CAAC;QAChD,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF;AAlHD,4CAkHC"}
@@ -12,6 +12,8 @@ export { RunsResource } from './RunsResource';
12
12
  export { AgentsResource } from './AgentsResource';
13
13
  export { BudgetResource, BillingResource } from './BudgetResource';
14
14
  export { SchedulesResource } from './SchedulesResource';
15
+ export { TriggersResource } from './TriggersResource';
16
+ export { OrchestrationsResource } from './OrchestrationsResource';
15
17
  export { GitResource } from './GitResource';
16
18
  export { FilesResource } from './FilesResource';
17
19
  export type { EnvironmentFile, ListFilesResult, UploadFileParams, UploadFileResult, MoveFileParams, MoveFileResult, DeleteFileResult, CreateDirectoryResult, } from './FilesResource';
@@ -5,7 +5,7 @@
5
5
  * Export all resource managers for use in CloudClient.
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.FilesResource = exports.GitResource = exports.SchedulesResource = exports.BillingResource = exports.BudgetResource = exports.AgentsResource = exports.RunsResource = exports.ThreadsResource = exports.EnvironmentsResource = exports.ProjectsResource = void 0;
8
+ exports.FilesResource = exports.GitResource = exports.OrchestrationsResource = exports.TriggersResource = exports.SchedulesResource = exports.BillingResource = exports.BudgetResource = exports.AgentsResource = exports.RunsResource = exports.ThreadsResource = exports.EnvironmentsResource = exports.ProjectsResource = void 0;
9
9
  var ProjectsResource_1 = require("./ProjectsResource");
10
10
  Object.defineProperty(exports, "ProjectsResource", { enumerable: true, get: function () { return ProjectsResource_1.ProjectsResource; } });
11
11
  var EnvironmentsResource_1 = require("./EnvironmentsResource");
@@ -21,6 +21,10 @@ Object.defineProperty(exports, "BudgetResource", { enumerable: true, get: functi
21
21
  Object.defineProperty(exports, "BillingResource", { enumerable: true, get: function () { return BudgetResource_1.BillingResource; } });
22
22
  var SchedulesResource_1 = require("./SchedulesResource");
23
23
  Object.defineProperty(exports, "SchedulesResource", { enumerable: true, get: function () { return SchedulesResource_1.SchedulesResource; } });
24
+ var TriggersResource_1 = require("./TriggersResource");
25
+ Object.defineProperty(exports, "TriggersResource", { enumerable: true, get: function () { return TriggersResource_1.TriggersResource; } });
26
+ var OrchestrationsResource_1 = require("./OrchestrationsResource");
27
+ Object.defineProperty(exports, "OrchestrationsResource", { enumerable: true, get: function () { return OrchestrationsResource_1.OrchestrationsResource; } });
24
28
  var GitResource_1 = require("./GitResource");
25
29
  Object.defineProperty(exports, "GitResource", { enumerable: true, get: function () { return GitResource_1.GitResource; } });
26
30
  var FilesResource_1 = require("./FilesResource");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cloud/resources/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAE7B,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AAExB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,mDAAmE;AAA1D,gHAAA,cAAc,OAAA;AAAE,iHAAA,eAAe,OAAA;AACxC,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,iDAAgD;AAAvC,8GAAA,aAAa,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cloud/resources/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAE7B,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AAExB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,mDAAmE;AAA1D,gHAAA,cAAc,OAAA;AAAE,iHAAA,eAAe,OAAA;AACxC,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAC/B,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,iDAAgD;AAAvC,8GAAA,aAAa,OAAA"}
@@ -698,6 +698,103 @@ export interface UpdateScheduleParams {
698
698
  enabled?: boolean;
699
699
  metadata?: Record<string, unknown>;
700
700
  }
701
+ export type TriggerSource = 'github' | 'slack' | 'email' | 'webhook' | 'cron' | 'custom';
702
+ export interface TriggerAction {
703
+ type: 'send_message';
704
+ message?: string;
705
+ template?: string;
706
+ }
707
+ export interface Trigger {
708
+ id: string;
709
+ name: string;
710
+ environmentId: string;
711
+ agentId?: string;
712
+ source: TriggerSource;
713
+ event: string;
714
+ filters?: Record<string, unknown>;
715
+ action: TriggerAction;
716
+ enabled: boolean;
717
+ lastTriggeredAt?: number;
718
+ createdAt: number;
719
+ updatedAt: number;
720
+ }
721
+ export interface CreateTriggerParams {
722
+ name: string;
723
+ environmentId: string;
724
+ agentId?: string;
725
+ source: TriggerSource;
726
+ event: string;
727
+ filters?: Record<string, unknown>;
728
+ action: TriggerAction;
729
+ enabled?: boolean;
730
+ }
731
+ export interface UpdateTriggerParams {
732
+ name?: string;
733
+ agentId?: string;
734
+ event?: string;
735
+ filters?: Record<string, unknown>;
736
+ action?: TriggerAction;
737
+ enabled?: boolean;
738
+ }
739
+ export interface TriggerExecution {
740
+ id: string;
741
+ triggerId: string;
742
+ threadId: string;
743
+ event: Record<string, unknown>;
744
+ status: 'pending' | 'running' | 'completed' | 'failed';
745
+ createdAt: number;
746
+ }
747
+ export type OrchestrationStrategy = 'parallel' | 'sequential' | 'conditional' | 'map_reduce';
748
+ export interface OrchestrationStep {
749
+ id: string;
750
+ agentId: string;
751
+ name: string;
752
+ instructions?: string;
753
+ inputs?: Record<string, unknown>;
754
+ dependsOn?: string[];
755
+ condition?: string;
756
+ }
757
+ export interface Orchestration {
758
+ id: string;
759
+ name: string;
760
+ environmentId: string;
761
+ strategy: OrchestrationStrategy;
762
+ coordinatorAgentId?: string;
763
+ steps: OrchestrationStep[];
764
+ status: 'draft' | 'active' | 'archived';
765
+ createdAt: number;
766
+ updatedAt: number;
767
+ }
768
+ export interface CreateOrchestrationParams {
769
+ name: string;
770
+ environmentId: string;
771
+ strategy: OrchestrationStrategy;
772
+ coordinatorAgentId?: string;
773
+ steps: Omit<OrchestrationStep, 'id'>[];
774
+ }
775
+ export interface UpdateOrchestrationParams {
776
+ name?: string;
777
+ strategy?: OrchestrationStrategy;
778
+ coordinatorAgentId?: string;
779
+ steps?: Omit<OrchestrationStep, 'id'>[];
780
+ }
781
+ export interface OrchestrationStepResult {
782
+ stepId: string;
783
+ agentId: string;
784
+ status: 'pending' | 'running' | 'completed' | 'failed' | 'skipped';
785
+ output?: string;
786
+ error?: string;
787
+ durationMs?: number;
788
+ }
789
+ export interface OrchestrationRun {
790
+ id: string;
791
+ orchestrationId: string;
792
+ threadId: string;
793
+ status: 'pending' | 'running' | 'completed' | 'failed';
794
+ stepResults: OrchestrationStepResult[];
795
+ createdAt: number;
796
+ completedAt?: number;
797
+ }
701
798
  export interface HealthCheck {
702
799
  status: 'healthy' | 'unhealthy';
703
800
  timestamp: string;
package/dist/index.d.ts CHANGED
@@ -22,7 +22,7 @@
22
22
  */
23
23
  export { ComputerAgentsClient, CloudClient, TestbaseClient, ApiClientError, } from './ComputerAgentsClient';
24
24
  export type { ComputerAgentsClientConfig, RunOptions, RunResult, ApiClientConfig, } from './ComputerAgentsClient';
25
- export { ProjectsResource, EnvironmentsResource, ThreadsResource, RunsResource, AgentsResource, BudgetResource, BillingResource, SchedulesResource, GitResource, } from './cloud/resources';
25
+ export { ProjectsResource, EnvironmentsResource, ThreadsResource, RunsResource, AgentsResource, BudgetResource, BillingResource, SchedulesResource, TriggersResource, OrchestrationsResource, GitResource, } from './cloud/resources';
26
26
  export type { StreamEventCallback, SendMessageOptions, SendMessageResult, ListEnvironmentsParams, } from './cloud/resources';
27
- export type { PaginationParams, PaginatedResponse, ApiError, Project, CreateProjectParams, UpdateProjectParams, ProjectStats, ProjectType, ProjectSource, Environment, CreateEnvironmentParams, UpdateEnvironmentParams, EnvironmentStatus, EnvironmentVariable, McpServer, ContainerStatus, BuildResult, BuildStatus, BuildStatusResult, BuildLogsResult, TestBuildResult, DockerfileResult, ValidateDockerfileResult, RuntimeConfig, PackagesConfig, AvailableRuntimes, PackageType, InstallPackagesResult, StartContainerParams, StartContainerResult, Thread, CreateThreadParams, UpdateThreadParams, ListThreadsParams, SendMessageParams, ThreadMessage, ThreadStatus, AgentConfig, CopyThreadParams, SearchThreadsParams, SearchThreadResult, SearchThreadsResponse, ThreadLogEntry, ResearchSession, StreamEvent, MessageStreamEvent, ResponseStartedEvent, ResponseItemCompletedEvent, ResponseCompletedEvent, StreamCompletedEvent, StreamErrorEvent, Run, CreateRunParams, UpdateRunParams, ListRunsParams, RunStatus, RunLogEntry, RunDiff, TokenUsage, CloudAgent, CreateAgentParams, UpdateAgentParams, AgentModel, ReasoningEffort, DeepResearchModel, AgentBinary, BudgetStatus, CanExecuteResult, IncreaseBudgetParams, IncreaseBudgetResult, BillingRecord, ListBillingRecordsParams, BillingAccount, UsageStats, UsageStatsParams, FileEntry, ListFilesParams, UploadFileParams, CreateDirectoryParams, GitDiffFile, GitDiffResult, GitCommitParams, GitCommitResult, GitPushParams, GitPushResult, Schedule, CreateScheduleParams, UpdateScheduleParams, ScheduleType, HealthCheck, Metrics, } from './cloud/types';
27
+ export type { PaginationParams, PaginatedResponse, ApiError, Project, CreateProjectParams, UpdateProjectParams, ProjectStats, ProjectType, ProjectSource, Environment, CreateEnvironmentParams, UpdateEnvironmentParams, EnvironmentStatus, EnvironmentVariable, McpServer, ContainerStatus, BuildResult, BuildStatus, BuildStatusResult, BuildLogsResult, TestBuildResult, DockerfileResult, ValidateDockerfileResult, RuntimeConfig, PackagesConfig, AvailableRuntimes, PackageType, InstallPackagesResult, StartContainerParams, StartContainerResult, Thread, CreateThreadParams, UpdateThreadParams, ListThreadsParams, SendMessageParams, ThreadMessage, ThreadStatus, AgentConfig, CopyThreadParams, SearchThreadsParams, SearchThreadResult, SearchThreadsResponse, ThreadLogEntry, ResearchSession, StreamEvent, MessageStreamEvent, ResponseStartedEvent, ResponseItemCompletedEvent, ResponseCompletedEvent, StreamCompletedEvent, StreamErrorEvent, Run, CreateRunParams, UpdateRunParams, ListRunsParams, RunStatus, RunLogEntry, RunDiff, TokenUsage, CloudAgent, CreateAgentParams, UpdateAgentParams, AgentModel, ReasoningEffort, DeepResearchModel, AgentBinary, BudgetStatus, CanExecuteResult, IncreaseBudgetParams, IncreaseBudgetResult, BillingRecord, ListBillingRecordsParams, BillingAccount, UsageStats, UsageStatsParams, FileEntry, ListFilesParams, UploadFileParams, CreateDirectoryParams, GitDiffFile, GitDiffResult, GitCommitParams, GitCommitResult, GitPushParams, GitPushResult, Schedule, CreateScheduleParams, UpdateScheduleParams, ScheduleType, TriggerSource, Trigger, TriggerAction, CreateTriggerParams, UpdateTriggerParams, TriggerExecution, OrchestrationStrategy, OrchestrationStep, Orchestration, CreateOrchestrationParams, UpdateOrchestrationParams, OrchestrationRun, OrchestrationStepResult, HealthCheck, Metrics, } from './cloud/types';
28
28
  export { ApiClient } from './cloud/ApiClient';
package/dist/index.js CHANGED
@@ -22,7 +22,7 @@
22
22
  * ```
23
23
  */
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.ApiClient = exports.GitResource = exports.SchedulesResource = exports.BillingResource = exports.BudgetResource = exports.AgentsResource = exports.RunsResource = exports.ThreadsResource = exports.EnvironmentsResource = exports.ProjectsResource = exports.ApiClientError = exports.TestbaseClient = exports.CloudClient = exports.ComputerAgentsClient = void 0;
25
+ exports.ApiClient = exports.GitResource = exports.OrchestrationsResource = exports.TriggersResource = exports.SchedulesResource = exports.BillingResource = exports.BudgetResource = exports.AgentsResource = exports.RunsResource = exports.ThreadsResource = exports.EnvironmentsResource = exports.ProjectsResource = exports.ApiClientError = exports.TestbaseClient = exports.CloudClient = exports.ComputerAgentsClient = void 0;
26
26
  // ============================================================================
27
27
  // Main Client
28
28
  // ============================================================================
@@ -45,6 +45,8 @@ Object.defineProperty(exports, "AgentsResource", { enumerable: true, get: functi
45
45
  Object.defineProperty(exports, "BudgetResource", { enumerable: true, get: function () { return resources_1.BudgetResource; } });
46
46
  Object.defineProperty(exports, "BillingResource", { enumerable: true, get: function () { return resources_1.BillingResource; } });
47
47
  Object.defineProperty(exports, "SchedulesResource", { enumerable: true, get: function () { return resources_1.SchedulesResource; } });
48
+ Object.defineProperty(exports, "TriggersResource", { enumerable: true, get: function () { return resources_1.TriggersResource; } });
49
+ Object.defineProperty(exports, "OrchestrationsResource", { enumerable: true, get: function () { return resources_1.OrchestrationsResource; } });
48
50
  Object.defineProperty(exports, "GitResource", { enumerable: true, get: function () { return resources_1.GitResource; } });
49
51
  // ============================================================================
50
52
  // Low-level API Client (for advanced usage)
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;AAEH,+EA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+E;AAE/E,+CAA8C;AAArC,sGAAA,SAAS,OAAA"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "computer-agents",
3
3
  "repository": "https://github.com/computer-agents/computer-agents-sdk",
4
4
  "homepage": "https://computer-agents.com",
5
- "version": "2.2.0",
5
+ "version": "2.4.0",
6
6
  "description": "Official SDK for the Computer Agents Cloud API. Execute Claude-powered AI agents in isolated cloud containers.",
7
7
  "author": "Computer Agents",
8
8
  "main": "dist/index.js",