@inkeep/agents-sdk 0.0.0-dev-20260212152525 → 0.0.0-dev-20260212161550

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/dist/agent.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { ScheduledTrigger, ScheduledTriggerInterface } from "./scheduled-trigger.js";
1
2
  import { Trigger, TriggerInterface } from "./trigger.js";
2
3
  import { AgentConfig, AgentInterface, AllDelegateInputInterface, GenerateOptions, MessageInput, ModelSettings, RunResult, StreamResponse, SubAgentInterface, subAgentTeamAgentInterface } from "./types.js";
3
4
  import { AgentStopWhen, FullAgentDefinition, StatusUpdateSettings } from "@inkeep/agents-core";
@@ -22,6 +23,8 @@ declare class Agent implements AgentInterface {
22
23
  private stopWhen?;
23
24
  private triggers;
24
25
  private triggerMap;
26
+ private scheduledTriggers;
27
+ private scheduledTriggerMap;
25
28
  constructor(config: AgentConfig);
26
29
  /**
27
30
  * Set or update the configuration (tenantId, projectId and apiUrl)
@@ -93,6 +96,14 @@ declare class Agent implements AgentInterface {
93
96
  */
94
97
  addTrigger(...triggers: TriggerInterface[]): void;
95
98
  /**
99
+ * Get all scheduled triggers for this agent
100
+ */
101
+ getScheduledTriggers(): Record<string, ScheduledTrigger>;
102
+ /**
103
+ * Add one or more scheduled triggers to the agent at runtime
104
+ */
105
+ addScheduledTrigger(...triggers: ScheduledTriggerInterface[]): void;
106
+ /**
96
107
  * Get the agent ID
97
108
  */
98
109
  getId(): string;
package/dist/agent.js CHANGED
@@ -28,6 +28,8 @@ var Agent = class {
28
28
  stopWhen;
29
29
  triggers = [];
30
30
  triggerMap = /* @__PURE__ */ new Map();
31
+ scheduledTriggers = [];
32
+ scheduledTriggerMap = /* @__PURE__ */ new Map();
31
33
  constructor(config) {
32
34
  this.defaultSubAgent = config.defaultSubAgent;
33
35
  this.tenantId = "default";
@@ -46,6 +48,8 @@ var Agent = class {
46
48
  this.agentMap = new Map(this.subAgents.map((agent$1) => [agent$1.getId(), agent$1]));
47
49
  this.triggers = resolveGetter(config.triggers) || [];
48
50
  this.triggerMap = new Map(this.triggers.map((trigger) => [trigger.getId(), trigger]));
51
+ this.scheduledTriggers = resolveGetter(config.scheduledTriggers) || [];
52
+ this.scheduledTriggerMap = new Map(this.scheduledTriggers.map((trigger) => [trigger.getId(), trigger]));
49
53
  if (this.defaultSubAgent) {
50
54
  if (!this.subAgents.some((agent$1) => agent$1.getId() === this.defaultSubAgent?.getId())) this.subAgents.push(this.defaultSubAgent);
51
55
  this.agentMap.set(this.defaultSubAgent.getId(), this.defaultSubAgent);
@@ -56,7 +60,8 @@ var Agent = class {
56
60
  tenantId: this.tenantId,
57
61
  agentCount: this.subAgents.length,
58
62
  defaultSubAgent: this.defaultSubAgent?.getName(),
59
- triggerCount: this.triggers.length
63
+ triggerCount: this.triggers.length,
64
+ scheduledTriggerCount: this.scheduledTriggers.length
60
65
  }, "Agent initialized");
61
66
  }
62
67
  /**
@@ -241,6 +246,8 @@ var Agent = class {
241
246
  inputSchema: processedInputSchema
242
247
  };
243
248
  }
249
+ const scheduledTriggersObject = {};
250
+ for (const [triggerId, trigger] of this.scheduledTriggerMap.entries()) scheduledTriggersObject[triggerId] = trigger.getConfig();
244
251
  return {
245
252
  id: this.agentId,
246
253
  name: this.agentName,
@@ -252,6 +259,7 @@ var Agent = class {
252
259
  ...Object.keys(functionToolsObject).length > 0 && { functionTools: functionToolsObject },
253
260
  ...Object.keys(functionsObject).length > 0 && { functions: functionsObject },
254
261
  triggers: triggersObject,
262
+ scheduledTriggers: scheduledTriggersObject,
255
263
  models: this.models,
256
264
  stopWhen: this.stopWhen,
257
265
  statusUpdates: processedStatusUpdates,
@@ -480,6 +488,28 @@ var Agent = class {
480
488
  }
481
489
  }
482
490
  /**
491
+ * Get all scheduled triggers for this agent
492
+ */
493
+ getScheduledTriggers() {
494
+ const scheduledTriggersObject = {};
495
+ for (const [id, trigger] of this.scheduledTriggerMap.entries()) scheduledTriggersObject[id] = trigger;
496
+ return scheduledTriggersObject;
497
+ }
498
+ /**
499
+ * Add one or more scheduled triggers to the agent at runtime
500
+ */
501
+ addScheduledTrigger(...triggers) {
502
+ for (const trigger of triggers) {
503
+ this.scheduledTriggers.push(trigger);
504
+ this.scheduledTriggerMap.set(trigger.getId(), trigger);
505
+ logger.info({
506
+ agentId: this.agentId,
507
+ scheduledTriggerId: trigger.getId(),
508
+ scheduledTriggerName: trigger.getName()
509
+ }, "Scheduled trigger added to agent");
510
+ }
511
+ }
512
+ /**
483
513
  * Get the agent ID
484
514
  */
485
515
  getId() {
@@ -1,3 +1,4 @@
1
+ import { ScheduledTrigger } from "./scheduled-trigger.js";
1
2
  import { Trigger } from "./trigger.js";
2
3
  import { ArtifactComponent } from "./artifact-component.js";
3
4
  import { Tool } from "./tool.js";
@@ -9,7 +10,7 @@ import { AgentConfig, FunctionToolConfig, SubAgentConfig } from "./types.js";
9
10
  import { Agent } from "./agent.js";
10
11
  import { Project, ProjectConfig } from "./project.js";
11
12
  import { StatusComponent as StatusComponent$1 } from "./status-component.js";
12
- import { CredentialReferenceApiInsert, MCPToolConfig, TriggerApiInsert } from "@inkeep/agents-core";
13
+ import { CredentialReferenceApiInsert, MCPToolConfig, ScheduledTriggerInsert, TriggerApiInsert } from "@inkeep/agents-core";
13
14
 
14
15
  //#region src/builderFunctions.d.ts
15
16
 
@@ -368,5 +369,47 @@ declare function functionTool(config: FunctionToolConfig): FunctionTool;
368
369
  declare function trigger(config: Omit<TriggerApiInsert, "id"> & {
369
370
  id?: string;
370
371
  }): Trigger;
372
+ /**
373
+ * Creates a scheduled trigger for time-based agent execution.
374
+ *
375
+ * Scheduled triggers allow agents to be invoked on a schedule using cron expressions
376
+ * or at a specific one-time date/time.
377
+ *
378
+ * @param config - Scheduled trigger configuration
379
+ * @returns A ScheduledTrigger instance
380
+ *
381
+ * @example
382
+ * ```typescript
383
+ * // Daily report at 9 AM
384
+ * const dailyReport = scheduledTrigger({
385
+ * name: 'Daily Report',
386
+ * cronExpression: '0 9 * * *',
387
+ * messageTemplate: 'Generate the daily report for {{date}}',
388
+ * payload: { date: '{{now}}' },
389
+ * });
390
+ *
391
+ * // One-time migration task
392
+ * const migrationTask = scheduledTrigger({
393
+ * name: 'Migration Task',
394
+ * runAt: '2024-12-31T23:59:59Z',
395
+ * messageTemplate: 'Run the end-of-year migration',
396
+ * maxRetries: 5,
397
+ * timeoutSeconds: 600,
398
+ * });
399
+ *
400
+ * // Hourly health check with retry configuration
401
+ * const healthCheck = scheduledTrigger({
402
+ * name: 'Hourly Health Check',
403
+ * cronExpression: '0 * * * *',
404
+ * messageTemplate: 'Check system health',
405
+ * maxRetries: 3,
406
+ * retryDelaySeconds: 30,
407
+ * timeoutSeconds: 120,
408
+ * });
409
+ * ```
410
+ */
411
+ declare function scheduledTrigger(config: Omit<ScheduledTriggerInsert, "id"> & {
412
+ id?: string;
413
+ }): ScheduledTrigger;
371
414
  //#endregion
372
- export { agent, agentMcp, artifactComponent, credential, dataComponent, functionTool, mcpServer, mcpTool, project, statusComponent, subAgent, trigger };
415
+ export { agent, agentMcp, artifactComponent, credential, dataComponent, functionTool, mcpServer, mcpTool, project, scheduledTrigger, statusComponent, subAgent, trigger };
@@ -4,6 +4,7 @@ import { Agent } from "./agent.js";
4
4
  import { ArtifactComponent } from "./artifact-component.js";
5
5
  import { DataComponent } from "./data-component.js";
6
6
  import { Project } from "./project.js";
7
+ import { ScheduledTrigger } from "./scheduled-trigger.js";
7
8
  import { StatusComponent as StatusComponent$1 } from "./status-component.js";
8
9
  import { Tool } from "./tool.js";
9
10
  import { SubAgent } from "./subAgent.js";
@@ -451,6 +452,48 @@ function trigger(config) {
451
452
  }
452
453
  return new Trigger(config);
453
454
  }
455
+ /**
456
+ * Creates a scheduled trigger for time-based agent execution.
457
+ *
458
+ * Scheduled triggers allow agents to be invoked on a schedule using cron expressions
459
+ * or at a specific one-time date/time.
460
+ *
461
+ * @param config - Scheduled trigger configuration
462
+ * @returns A ScheduledTrigger instance
463
+ *
464
+ * @example
465
+ * ```typescript
466
+ * // Daily report at 9 AM
467
+ * const dailyReport = scheduledTrigger({
468
+ * name: 'Daily Report',
469
+ * cronExpression: '0 9 * * *',
470
+ * messageTemplate: 'Generate the daily report for {{date}}',
471
+ * payload: { date: '{{now}}' },
472
+ * });
473
+ *
474
+ * // One-time migration task
475
+ * const migrationTask = scheduledTrigger({
476
+ * name: 'Migration Task',
477
+ * runAt: '2024-12-31T23:59:59Z',
478
+ * messageTemplate: 'Run the end-of-year migration',
479
+ * maxRetries: 5,
480
+ * timeoutSeconds: 600,
481
+ * });
482
+ *
483
+ * // Hourly health check with retry configuration
484
+ * const healthCheck = scheduledTrigger({
485
+ * name: 'Hourly Health Check',
486
+ * cronExpression: '0 * * * *',
487
+ * messageTemplate: 'Check system health',
488
+ * maxRetries: 3,
489
+ * retryDelaySeconds: 30,
490
+ * timeoutSeconds: 120,
491
+ * });
492
+ * ```
493
+ */
494
+ function scheduledTrigger(config) {
495
+ return new ScheduledTrigger(config);
496
+ }
454
497
 
455
498
  //#endregion
456
- export { agent, agentMcp, artifactComponent, credential, dataComponent, functionTool, mcpServer, mcpTool, project, statusComponent, subAgent, trigger };
499
+ export { agent, agentMcp, artifactComponent, credential, dataComponent, functionTool, mcpServer, mcpTool, project, scheduledTrigger, statusComponent, subAgent, trigger };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { ScheduledTrigger, ScheduledTriggerConfig, ScheduledTriggerInterface } from "./scheduled-trigger.js";
1
2
  import { Trigger, TriggerConfig, TriggerInterface } from "./trigger.js";
2
3
  import { ArtifactComponent, ArtifactComponentInterface } from "./artifact-component.js";
3
4
  import { Tool } from "./tool.js";
@@ -9,7 +10,7 @@ import { FunctionTool } from "./function-tool.js";
9
10
  import { AgentConfig, AgentError, AgentInterface, AgentResponse, AgentTool, AllDelegateInputInterface, AllDelegateOutputInterface, AssistantMessage, BuilderAgentConfig, BuilderRelationConfig, BuilderToolConfig, ExternalAgentInterface, FetchDefinitionConfig, FunctionToolConfig, GenerateOptions, MCPToolConfig, MaxTurnsExceededError, Message, MessageInput, ModelSettings, RequestSchemaConfig, RequestSchemaDefinition, RunResult, ServerConfig, SkillDefinition, SkillReference, StreamEvent, StreamResponse, SubAgentCanUseType, SubAgentConfig, SubAgentInterface, SystemMessage, ToolCall, ToolConfig, ToolExecutionError, ToolMessage, ToolResult, TransferConfig, TransferError, UserMessage, subAgentExternalAgentInterface, subAgentTeamAgentInterface } from "./types.js";
10
11
  import { Project } from "./project.js";
11
12
  import { StatusComponent, StatusComponentInterface } from "./status-component.js";
12
- import { agent, agentMcp, artifactComponent, credential, dataComponent, functionTool, mcpServer, mcpTool, project, statusComponent, subAgent, trigger } from "./builderFunctions.js";
13
+ import { agent, agentMcp, artifactComponent, credential, dataComponent, functionTool, mcpServer, mcpTool, project, scheduledTrigger, statusComponent, subAgent, trigger } from "./builderFunctions.js";
13
14
  import { CredentialProviderConfig, CredentialProviderType, CredentialStore, CustomCredentialConfig, InkeepCredentialProvider, KeychainCredentialConfig, MemoryCredentialConfig, NangoCredentialConfig, createCredentialProvider } from "./credential-provider.js";
14
15
  import { CredentialReference, ExtractCredentialIds, UnionCredentialIds, credentialRef, isCredentialReference } from "./credential-ref.js";
15
16
  import { createEnvironmentSettings, registerEnvironmentSettings } from "./environment-settings.js";
@@ -19,4 +20,4 @@ import { Runner, raceAgents, run, stream } from "./runner.js";
19
20
  import { loadSkills } from "./skill-loader.js";
20
21
  import { ConsoleTelemetryProvider, InkeepTelemetryProvider, NoOpTelemetryProvider, OpenTelemetryConfig, SpanOptions, SpanStatus, SpanStatusType, TelemetryConfig, TelemetryLogger, TelemetryMetrics, TelemetryProvider, TelemetrySpan, TelemetryTracer, createConsoleTelemetryProvider, createNoOpTelemetryProvider, createOpenTelemetryProvider, getGlobalTelemetryProvider, setGlobalTelemetryProvider } from "./telemetry-provider.js";
21
22
  import { ANTHROPIC_MODELS, GOOGLE_MODELS, OPENAI_MODELS, SignatureSource, SignatureVerificationConfig, SignedComponent } from "@inkeep/agents-core";
22
- export { ANTHROPIC_MODELS, AgentConfig, AgentError, AgentInterface, AgentResponse, AgentTool, AllDelegateInputInterface, AllDelegateOutputInterface, ArtifactComponent, type ArtifactComponentInterface, AssistantMessage, BuilderAgentConfig, BuilderRelationConfig, BuilderToolConfig, ConsoleTelemetryProvider, type CredentialProviderConfig, type CredentialProviderType, type CredentialReference, type CredentialStore, type CustomCredentialConfig, DataComponent, type DataComponentInterface, EvaluationClient, type EvaluationClientConfig, ExternalAgent, ExternalAgentInterface, type ExtractCredentialIds, FetchDefinitionConfig, FunctionTool, FunctionToolConfig, GOOGLE_MODELS, GenerateOptions, InkeepCredentialProvider, InkeepTelemetryProvider, type KeychainCredentialConfig, MCPToolConfig, MaxTurnsExceededError, type MemoryCredentialConfig, Message, MessageInput, ModelSettings, type NangoCredentialConfig, NoOpTelemetryProvider, OPENAI_MODELS, type OpenTelemetryConfig, Project, RequestSchemaConfig, RequestSchemaDefinition, RunResult, Runner, ServerConfig, type SignatureSource, type SignatureVerificationConfig, type SignedComponent, SkillDefinition, SkillReference, type SpanOptions, SpanStatus, type SpanStatusType, StatusComponent, type StatusComponentInterface, StreamEvent, StreamResponse, SubAgent, SubAgentCanUseType, SubAgentConfig, SubAgentInterface, SystemMessage, type TelemetryConfig, type TelemetryLogger, type TelemetryMetrics, type TelemetryProvider, type TelemetrySpan, type TelemetryTracer, Tool, ToolCall, ToolConfig, ToolExecutionError, ToolMessage, ToolResult, TransferConfig, TransferError, Trigger, type TriggerConfig, type TriggerInterface, type UnionCredentialIds, UserMessage, agent, agentMcp, artifactComponent, createConsoleTelemetryProvider, createCredentialProvider, createEnvironmentSettings, createFullProjectViaAPI, createNoOpTelemetryProvider, createOpenTelemetryProvider, credential, credentialRef, dataComponent, deleteFullProjectViaAPI, evaluationClient, externalAgent, externalAgents, functionTool, getFullProjectViaAPI, getGlobalTelemetryProvider, isCredentialReference, loadSkills, mcpServer, mcpTool, project, raceAgents, registerEnvironmentSettings, run, setGlobalTelemetryProvider, statusComponent, stream, subAgent, subAgentExternalAgentInterface, subAgentTeamAgentInterface, transfer, trigger, updateFullProjectViaAPI };
23
+ export { ANTHROPIC_MODELS, AgentConfig, AgentError, AgentInterface, AgentResponse, AgentTool, AllDelegateInputInterface, AllDelegateOutputInterface, ArtifactComponent, type ArtifactComponentInterface, AssistantMessage, BuilderAgentConfig, BuilderRelationConfig, BuilderToolConfig, ConsoleTelemetryProvider, type CredentialProviderConfig, type CredentialProviderType, type CredentialReference, type CredentialStore, type CustomCredentialConfig, DataComponent, type DataComponentInterface, EvaluationClient, type EvaluationClientConfig, ExternalAgent, ExternalAgentInterface, type ExtractCredentialIds, FetchDefinitionConfig, FunctionTool, FunctionToolConfig, GOOGLE_MODELS, GenerateOptions, InkeepCredentialProvider, InkeepTelemetryProvider, type KeychainCredentialConfig, MCPToolConfig, MaxTurnsExceededError, type MemoryCredentialConfig, Message, MessageInput, ModelSettings, type NangoCredentialConfig, NoOpTelemetryProvider, OPENAI_MODELS, type OpenTelemetryConfig, Project, RequestSchemaConfig, RequestSchemaDefinition, RunResult, Runner, ScheduledTrigger, type ScheduledTriggerConfig, type ScheduledTriggerInterface, ServerConfig, type SignatureSource, type SignatureVerificationConfig, type SignedComponent, SkillDefinition, SkillReference, type SpanOptions, SpanStatus, type SpanStatusType, StatusComponent, type StatusComponentInterface, StreamEvent, StreamResponse, SubAgent, SubAgentCanUseType, SubAgentConfig, SubAgentInterface, SystemMessage, type TelemetryConfig, type TelemetryLogger, type TelemetryMetrics, type TelemetryProvider, type TelemetrySpan, type TelemetryTracer, Tool, ToolCall, ToolConfig, ToolExecutionError, ToolMessage, ToolResult, TransferConfig, TransferError, Trigger, type TriggerConfig, type TriggerInterface, type UnionCredentialIds, UserMessage, agent, agentMcp, artifactComponent, createConsoleTelemetryProvider, createCredentialProvider, createEnvironmentSettings, createFullProjectViaAPI, createNoOpTelemetryProvider, createOpenTelemetryProvider, credential, credentialRef, dataComponent, deleteFullProjectViaAPI, evaluationClient, externalAgent, externalAgents, functionTool, getFullProjectViaAPI, getGlobalTelemetryProvider, isCredentialReference, loadSkills, mcpServer, mcpTool, project, raceAgents, registerEnvironmentSettings, run, scheduledTrigger, setGlobalTelemetryProvider, statusComponent, stream, subAgent, subAgentExternalAgentInterface, subAgentTeamAgentInterface, transfer, trigger, updateFullProjectViaAPI };
package/dist/index.js CHANGED
@@ -3,11 +3,12 @@ import { FunctionTool } from "./function-tool.js";
3
3
  import { ArtifactComponent } from "./artifact-component.js";
4
4
  import { DataComponent } from "./data-component.js";
5
5
  import { Project } from "./project.js";
6
+ import { ScheduledTrigger } from "./scheduled-trigger.js";
6
7
  import { StatusComponent } from "./status-component.js";
7
8
  import { Tool } from "./tool.js";
8
9
  import { SubAgent } from "./subAgent.js";
9
10
  import { Trigger } from "./trigger.js";
10
- import { agent, agentMcp, artifactComponent, credential, dataComponent, functionTool, mcpServer, mcpTool, project, statusComponent, subAgent, trigger } from "./builderFunctions.js";
11
+ import { agent, agentMcp, artifactComponent, credential, dataComponent, functionTool, mcpServer, mcpTool, project, scheduledTrigger, statusComponent, subAgent, trigger } from "./builderFunctions.js";
11
12
  import { transfer } from "./builders.js";
12
13
  import { InkeepCredentialProvider, createCredentialProvider } from "./credential-provider.js";
13
14
  import { credentialRef, isCredentialReference } from "./credential-ref.js";
@@ -19,4 +20,4 @@ import { loadSkills } from "./skill-loader.js";
19
20
  import { ConsoleTelemetryProvider, InkeepTelemetryProvider, NoOpTelemetryProvider, SpanStatus, createConsoleTelemetryProvider, createNoOpTelemetryProvider, createOpenTelemetryProvider, getGlobalTelemetryProvider, setGlobalTelemetryProvider } from "./telemetry-provider.js";
20
21
  import { ANTHROPIC_MODELS, GOOGLE_MODELS, OPENAI_MODELS } from "@inkeep/agents-core";
21
22
 
22
- export { ANTHROPIC_MODELS, ArtifactComponent, ConsoleTelemetryProvider, DataComponent, EvaluationClient, ExternalAgent, FunctionTool, GOOGLE_MODELS, InkeepCredentialProvider, InkeepTelemetryProvider, NoOpTelemetryProvider, OPENAI_MODELS, Project, Runner, SpanStatus, StatusComponent, SubAgent, Tool, Trigger, agent, agentMcp, artifactComponent, createConsoleTelemetryProvider, createCredentialProvider, createEnvironmentSettings, createFullProjectViaAPI, createNoOpTelemetryProvider, createOpenTelemetryProvider, credential, credentialRef, dataComponent, deleteFullProjectViaAPI, evaluationClient, externalAgent, externalAgents, functionTool, getFullProjectViaAPI, getGlobalTelemetryProvider, isCredentialReference, loadSkills, mcpServer, mcpTool, project, raceAgents, registerEnvironmentSettings, run, setGlobalTelemetryProvider, statusComponent, stream, subAgent, transfer, trigger, updateFullProjectViaAPI };
23
+ export { ANTHROPIC_MODELS, ArtifactComponent, ConsoleTelemetryProvider, DataComponent, EvaluationClient, ExternalAgent, FunctionTool, GOOGLE_MODELS, InkeepCredentialProvider, InkeepTelemetryProvider, NoOpTelemetryProvider, OPENAI_MODELS, Project, Runner, ScheduledTrigger, SpanStatus, StatusComponent, SubAgent, Tool, Trigger, agent, agentMcp, artifactComponent, createConsoleTelemetryProvider, createCredentialProvider, createEnvironmentSettings, createFullProjectViaAPI, createNoOpTelemetryProvider, createOpenTelemetryProvider, credential, credentialRef, dataComponent, deleteFullProjectViaAPI, evaluationClient, externalAgent, externalAgents, functionTool, getFullProjectViaAPI, getGlobalTelemetryProvider, isCredentialReference, loadSkills, mcpServer, mcpTool, project, raceAgents, registerEnvironmentSettings, run, scheduledTrigger, setGlobalTelemetryProvider, statusComponent, stream, subAgent, transfer, trigger, updateFullProjectViaAPI };
@@ -0,0 +1,43 @@
1
+ import { ScheduledTriggerInsert } from "@inkeep/agents-core";
2
+
3
+ //#region src/scheduled-trigger.d.ts
4
+ type ScheduledTriggerConfig = Omit<ScheduledTriggerInsert, "id"> & {
5
+ id?: string;
6
+ };
7
+ interface ScheduledTriggerInterface {
8
+ getId(): string;
9
+ getName(): string;
10
+ getConfig(): Omit<ScheduledTriggerInsert, "id"> & {
11
+ id: string;
12
+ };
13
+ with(config: Partial<ScheduledTriggerConfig>): ScheduledTrigger;
14
+ }
15
+ declare class ScheduledTrigger implements ScheduledTriggerInterface {
16
+ private config;
17
+ private id;
18
+ constructor(config: ScheduledTriggerConfig);
19
+ getId(): string;
20
+ getName(): string;
21
+ getConfig(): Omit<ScheduledTriggerInsert, "id"> & {
22
+ id: string;
23
+ };
24
+ /**
25
+ * Creates a new ScheduledTrigger with the given configuration overrides.
26
+ *
27
+ * @param config - Partial configuration to override
28
+ * @returns A new ScheduledTrigger instance with the merged configuration
29
+ *
30
+ * @example
31
+ * ```typescript
32
+ * const trigger = new ScheduledTrigger({
33
+ * name: 'Daily Report',
34
+ * cronExpression: '0 9 * * *',
35
+ * messageTemplate: 'Generate daily report for {{date}}',
36
+ * });
37
+ * const disabled = trigger.with({ enabled: false });
38
+ * ```
39
+ */
40
+ with(config: Partial<ScheduledTriggerConfig>): ScheduledTrigger;
41
+ }
42
+ //#endregion
43
+ export { ScheduledTrigger, ScheduledTriggerConfig, ScheduledTriggerInterface };
@@ -0,0 +1,56 @@
1
+ import { generateIdFromName } from "./utils/generateIdFromName.js";
2
+ import { getLogger } from "@inkeep/agents-core";
3
+
4
+ //#region src/scheduled-trigger.ts
5
+ const logger = getLogger("scheduled-trigger");
6
+ var ScheduledTrigger = class ScheduledTrigger {
7
+ config;
8
+ id;
9
+ constructor(config) {
10
+ this.id = config.id || generateIdFromName(config.name);
11
+ this.config = {
12
+ ...config,
13
+ id: this.id
14
+ };
15
+ logger.info({
16
+ scheduledTriggerId: this.getId(),
17
+ scheduledTriggerName: config.name,
18
+ cronExpression: config.cronExpression,
19
+ runAt: config.runAt
20
+ }, "ScheduledTrigger constructor initialized");
21
+ }
22
+ getId() {
23
+ return this.id;
24
+ }
25
+ getName() {
26
+ return this.config.name;
27
+ }
28
+ getConfig() {
29
+ return this.config;
30
+ }
31
+ /**
32
+ * Creates a new ScheduledTrigger with the given configuration overrides.
33
+ *
34
+ * @param config - Partial configuration to override
35
+ * @returns A new ScheduledTrigger instance with the merged configuration
36
+ *
37
+ * @example
38
+ * ```typescript
39
+ * const trigger = new ScheduledTrigger({
40
+ * name: 'Daily Report',
41
+ * cronExpression: '0 9 * * *',
42
+ * messageTemplate: 'Generate daily report for {{date}}',
43
+ * });
44
+ * const disabled = trigger.with({ enabled: false });
45
+ * ```
46
+ */
47
+ with(config) {
48
+ return new ScheduledTrigger({
49
+ ...this.config,
50
+ ...config
51
+ });
52
+ }
53
+ };
54
+
55
+ //#endregion
56
+ export { ScheduledTrigger };
package/dist/types.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { ScheduledTriggerInterface } from "./scheduled-trigger.js";
1
2
  import { TriggerInterface } from "./trigger.js";
2
3
  import { ArtifactComponentInterface } from "./artifact-component.js";
3
4
  import { Tool } from "./tool.js";
@@ -212,6 +213,7 @@ interface AgentConfig {
212
213
  };
213
214
  statusUpdates?: StatusUpdateSettings;
214
215
  triggers?: () => TriggerInterface[];
216
+ scheduledTriggers?: () => ScheduledTriggerInterface[];
215
217
  }
216
218
  declare class AgentError extends Error {
217
219
  code?: string | undefined;
@@ -319,4 +321,4 @@ interface BuilderAgentConfig {
319
321
  relations?: BuilderRelationConfig[];
320
322
  }
321
323
  //#endregion
322
- export { AgentConfig, AgentError, AgentInterface, AgentResponse, AgentTool, AllDelegateInputInterface, AllDelegateOutputInterface, AssistantMessage, BuilderAgentConfig, BuilderRelationConfig, BuilderToolConfig, ExternalAgentInterface, FetchDefinitionConfig, type FunctionToolConfig, GenerateOptions, MCPToolConfig, MaxTurnsExceededError, Message, MessageInput, type ModelSettings, RequestSchemaConfig, RequestSchemaDefinition, RunResult, ServerConfig, SkillDefinition, SkillReference, StreamEvent, StreamResponse, SubAgentCanUseType, SubAgentConfig, SubAgentInterface, SystemMessage, ToolCall, ToolConfig, ToolExecutionError, ToolMessage, ToolResult, TransferConfig, TransferError, type TriggerInterface, UserMessage, subAgentExternalAgentInterface, subAgentTeamAgentInterface };
324
+ export { AgentConfig, AgentError, AgentInterface, AgentResponse, AgentTool, AllDelegateInputInterface, AllDelegateOutputInterface, AssistantMessage, BuilderAgentConfig, BuilderRelationConfig, BuilderToolConfig, ExternalAgentInterface, FetchDefinitionConfig, type FunctionToolConfig, GenerateOptions, MCPToolConfig, MaxTurnsExceededError, Message, MessageInput, type ModelSettings, RequestSchemaConfig, RequestSchemaDefinition, RunResult, type ScheduledTriggerInterface, ServerConfig, SkillDefinition, SkillReference, StreamEvent, StreamResponse, SubAgentCanUseType, SubAgentConfig, SubAgentInterface, SystemMessage, ToolCall, ToolConfig, ToolExecutionError, ToolMessage, ToolResult, TransferConfig, TransferError, type TriggerInterface, UserMessage, subAgentExternalAgentInterface, subAgentTeamAgentInterface };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-sdk",
3
- "version": "0.0.0-dev-20260212152525",
3
+ "version": "0.0.0-dev-20260212161550",
4
4
  "description": "Agents SDK for building and managing agents in the Inkeep Agent Framework",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -17,7 +17,7 @@
17
17
  "js-yaml": "^4.1.0",
18
18
  "typescript": "^5.3.3",
19
19
  "zod": "^4.3.6",
20
- "@inkeep/agents-core": "^0.0.0-dev-20260212152525"
20
+ "@inkeep/agents-core": "^0.0.0-dev-20260212161550"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@types/js-yaml": "^4.0.9",