@theokit/sdk 2.29.0 → 2.30.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.
@@ -1466,4 +1466,4 @@ interface GenerateRunResult<O> {
1466
1466
  };
1467
1467
  }
1468
1468
 
1469
- export { type SDKImageDimension as $, type AgentConversationTurn as A, type RunEvent as B, type CustomTool as C, type DoomLoopThresholds as D, type RunEventSink as E, type RunGitInfo as F, type GenerateOptions as G, type RunOperation as H, type ImageBlock as I, type RunPermissionDeniedEvent as J, type RunRateLimitEvent as K, type RunStatus as L, type ModelSelection as M, type RunTaskCompletedEvent as N, type OutputProcessorContext as O, type Processor as P, type RunTaskStartedEvent as Q, type RunResult as R, type SDKMessage as S, type ToolResultContentBlock as T, type RunTaskUpdatedEvent as U, type RunToCompletionOptions as V, type RunToCompletionResult as W, type RunToolProgressEvent as X, type RunTripwireEvent as Y, type SDKAssistantMessage as Z, type SDKImage as _, type McpServerConfig as a, type SDKObjectDelta as a0, type SDKRequestMessage as a1, type SDKStatusMessage as a2, type SDKSystemMessage as a3, type SDKTaskMessage as a4, type SDKThinkingMessage as a5, type SDKToolUseMessage as a6, type SDKUserMessage as a7, type SDKUserMessageEvent as a8, type SendOptions as a9, type UserMessageAppendedUpdate as aA, emitRunEvent as aB, type ShellCommand as aa, type ShellConversationTurn as ab, type ShellOutput as ac, type ShellOutputDeltaUpdate as ad, type StepCompletedUpdate as ae, type StepStartedUpdate as af, type StreamToCompletionResult as ag, type SummaryCompletedUpdate as ah, type SummaryStartedUpdate as ai, type SummaryUpdate as aj, type TextBlock as ak, type TextDeltaUpdate as al, type ThinkingCompletedUpdate as am, type ThinkingDeltaUpdate as an, type ThinkingMessage as ao, type TokenDeltaUpdate as ap, type TokenUsage as aq, type ToolCall as ar, type ToolCallCompletedUpdate as as, type ToolCallStartedUpdate as at, type ToolContextMessage as au, type ToolResult as av, type ToolResultGuardOptions as aw, type ToolUseBlock as ax, type TurnEndedUpdate as ay, type UserMessage as az, type Run as b, type MessageOrigin as c, type AssistantMessage as d, type CompletionCheck as e, type CompletionCheckResult as f, type ConversationStep as g, type ConversationTurn as h, type CostBreakdown as i, type CostSource as j, type CostStatus as k, type GenerateRunResult as l, type InputProcessorContext as m, type InteractionUpdate as n, type McpAuthConfig as o, type McpHttpServerConfig as p, type McpOAuthConfig as q, type McpStdioServerConfig as r, type ModelParameterValue as s, type PartialToolCallUpdate as t, type ProcessorControls as u, type ProcessorTripwire as v, type ProcessorViolation as w, type RunCompactBoundaryEvent as x, type RunCompletionCheckEvent as y, type RunErrorDetail as z };
1469
+ export { type SDKImageDimension as $, type AgentConversationTurn as A, type RunEvent as B, type CustomTool as C, type DoomLoopThresholds as D, type RunEventSink as E, type RunGitInfo as F, type GenerateOptions as G, type RunOperation as H, type ImageBlock as I, type RunPermissionDeniedEvent as J, type RunRateLimitEvent as K, type RunStatus as L, type ModelSelection as M, type RunTaskCompletedEvent as N, type OutputProcessorContext as O, type Processor as P, type RunTaskStartedEvent as Q, type RunResult as R, type SDKMessage as S, type ToolResultContentBlock as T, type RunTaskUpdatedEvent as U, type RunToCompletionOptions as V, type RunToCompletionResult as W, type RunToolProgressEvent as X, type RunTripwireEvent as Y, type SDKAssistantMessage as Z, type SDKImage as _, type McpServerConfig as a, type SDKObjectDelta as a0, type SDKRequestMessage as a1, type SDKStatusMessage as a2, type SDKSystemMessage as a3, type SDKTaskMessage as a4, type SDKThinkingMessage as a5, type SDKToolUseMessage as a6, type SDKUserMessage as a7, type SDKUserMessageEvent as a8, type SendOptions as a9, type UserMessageAppendedUpdate as aA, emitRunEvent as aB, type ShellCommand as aa, type ShellConversationTurn as ab, type ShellOutput as ac, type ShellOutputDeltaUpdate as ad, type StepCompletedUpdate as ae, type StepStartedUpdate as af, type StreamToCompletionResult as ag, type SummaryCompletedUpdate as ah, type SummaryStartedUpdate as ai, type SummaryUpdate as aj, type TextBlock as ak, type TextDeltaUpdate as al, type ThinkingCompletedUpdate as am, type ThinkingDeltaUpdate as an, type ThinkingMessage as ao, type TokenDeltaUpdate as ap, type TokenUsage as aq, type ToolCall as ar, type ToolCallCompletedUpdate as as, type ToolCallStartedUpdate as at, type ToolContextMessage as au, type ToolResult as av, type ToolResultGuardOptions as aw, type ToolUseBlock as ax, type TurnEndedUpdate as ay, type UserMessage as az, type Run as b, type AssistantMessage as c, type CompletionCheck as d, type CompletionCheckResult as e, type ConversationStep as f, type ConversationTurn as g, type CostBreakdown as h, type CostSource as i, type CostStatus as j, type GenerateRunResult as k, type InputProcessorContext as l, type InteractionUpdate as m, type McpAuthConfig as n, type McpHttpServerConfig as o, type McpOAuthConfig as p, type McpStdioServerConfig as q, type MessageOrigin as r, type ModelParameterValue as s, type PartialToolCallUpdate as t, type ProcessorControls as u, type ProcessorTripwire as v, type ProcessorViolation as w, type RunCompactBoundaryEvent as x, type RunCompletionCheckEvent as y, type RunErrorDetail as z };
@@ -1466,4 +1466,4 @@ interface GenerateRunResult<O> {
1466
1466
  };
1467
1467
  }
1468
1468
 
1469
- export { type SDKImageDimension as $, type AgentConversationTurn as A, type RunEvent as B, type CustomTool as C, type DoomLoopThresholds as D, type RunEventSink as E, type RunGitInfo as F, type GenerateOptions as G, type RunOperation as H, type ImageBlock as I, type RunPermissionDeniedEvent as J, type RunRateLimitEvent as K, type RunStatus as L, type ModelSelection as M, type RunTaskCompletedEvent as N, type OutputProcessorContext as O, type Processor as P, type RunTaskStartedEvent as Q, type RunResult as R, type SDKMessage as S, type ToolResultContentBlock as T, type RunTaskUpdatedEvent as U, type RunToCompletionOptions as V, type RunToCompletionResult as W, type RunToolProgressEvent as X, type RunTripwireEvent as Y, type SDKAssistantMessage as Z, type SDKImage as _, type McpServerConfig as a, type SDKObjectDelta as a0, type SDKRequestMessage as a1, type SDKStatusMessage as a2, type SDKSystemMessage as a3, type SDKTaskMessage as a4, type SDKThinkingMessage as a5, type SDKToolUseMessage as a6, type SDKUserMessage as a7, type SDKUserMessageEvent as a8, type SendOptions as a9, type UserMessageAppendedUpdate as aA, emitRunEvent as aB, type ShellCommand as aa, type ShellConversationTurn as ab, type ShellOutput as ac, type ShellOutputDeltaUpdate as ad, type StepCompletedUpdate as ae, type StepStartedUpdate as af, type StreamToCompletionResult as ag, type SummaryCompletedUpdate as ah, type SummaryStartedUpdate as ai, type SummaryUpdate as aj, type TextBlock as ak, type TextDeltaUpdate as al, type ThinkingCompletedUpdate as am, type ThinkingDeltaUpdate as an, type ThinkingMessage as ao, type TokenDeltaUpdate as ap, type TokenUsage as aq, type ToolCall as ar, type ToolCallCompletedUpdate as as, type ToolCallStartedUpdate as at, type ToolContextMessage as au, type ToolResult as av, type ToolResultGuardOptions as aw, type ToolUseBlock as ax, type TurnEndedUpdate as ay, type UserMessage as az, type Run as b, type MessageOrigin as c, type AssistantMessage as d, type CompletionCheck as e, type CompletionCheckResult as f, type ConversationStep as g, type ConversationTurn as h, type CostBreakdown as i, type CostSource as j, type CostStatus as k, type GenerateRunResult as l, type InputProcessorContext as m, type InteractionUpdate as n, type McpAuthConfig as o, type McpHttpServerConfig as p, type McpOAuthConfig as q, type McpStdioServerConfig as r, type ModelParameterValue as s, type PartialToolCallUpdate as t, type ProcessorControls as u, type ProcessorTripwire as v, type ProcessorViolation as w, type RunCompactBoundaryEvent as x, type RunCompletionCheckEvent as y, type RunErrorDetail as z };
1469
+ export { type SDKImageDimension as $, type AgentConversationTurn as A, type RunEvent as B, type CustomTool as C, type DoomLoopThresholds as D, type RunEventSink as E, type RunGitInfo as F, type GenerateOptions as G, type RunOperation as H, type ImageBlock as I, type RunPermissionDeniedEvent as J, type RunRateLimitEvent as K, type RunStatus as L, type ModelSelection as M, type RunTaskCompletedEvent as N, type OutputProcessorContext as O, type Processor as P, type RunTaskStartedEvent as Q, type RunResult as R, type SDKMessage as S, type ToolResultContentBlock as T, type RunTaskUpdatedEvent as U, type RunToCompletionOptions as V, type RunToCompletionResult as W, type RunToolProgressEvent as X, type RunTripwireEvent as Y, type SDKAssistantMessage as Z, type SDKImage as _, type McpServerConfig as a, type SDKObjectDelta as a0, type SDKRequestMessage as a1, type SDKStatusMessage as a2, type SDKSystemMessage as a3, type SDKTaskMessage as a4, type SDKThinkingMessage as a5, type SDKToolUseMessage as a6, type SDKUserMessage as a7, type SDKUserMessageEvent as a8, type SendOptions as a9, type UserMessageAppendedUpdate as aA, emitRunEvent as aB, type ShellCommand as aa, type ShellConversationTurn as ab, type ShellOutput as ac, type ShellOutputDeltaUpdate as ad, type StepCompletedUpdate as ae, type StepStartedUpdate as af, type StreamToCompletionResult as ag, type SummaryCompletedUpdate as ah, type SummaryStartedUpdate as ai, type SummaryUpdate as aj, type TextBlock as ak, type TextDeltaUpdate as al, type ThinkingCompletedUpdate as am, type ThinkingDeltaUpdate as an, type ThinkingMessage as ao, type TokenDeltaUpdate as ap, type TokenUsage as aq, type ToolCall as ar, type ToolCallCompletedUpdate as as, type ToolCallStartedUpdate as at, type ToolContextMessage as au, type ToolResult as av, type ToolResultGuardOptions as aw, type ToolUseBlock as ax, type TurnEndedUpdate as ay, type UserMessage as az, type Run as b, type AssistantMessage as c, type CompletionCheck as d, type CompletionCheckResult as e, type ConversationStep as f, type ConversationTurn as g, type CostBreakdown as h, type CostSource as i, type CostStatus as j, type GenerateRunResult as k, type InputProcessorContext as l, type InteractionUpdate as m, type McpAuthConfig as n, type McpHttpServerConfig as o, type McpOAuthConfig as p, type McpStdioServerConfig as q, type MessageOrigin as r, type ModelParameterValue as s, type PartialToolCallUpdate as t, type ProcessorControls as u, type ProcessorTripwire as v, type ProcessorViolation as w, type RunCompactBoundaryEvent as x, type RunCompletionCheckEvent as y, type RunErrorDetail as z };
@@ -1,3 +1,4 @@
1
+ import type { Workflow } from "../workflow.js";
1
2
  import type { AgentOptions } from "./agent.js";
2
3
  import type { SDKUserMessage } from "./run.js";
3
4
  /**
@@ -18,11 +19,12 @@ export type CronRuntime = "local" | "cloud";
18
19
  */
19
20
  export type CronJobStatus = "scheduled" | "running" | "paused" | "errored";
20
21
  /**
21
- * Persistent cron-scheduled invocation of the Theo agent.
22
+ * Persistent cron-scheduled invocation of the Theo agent or a workflow.
22
23
  *
23
- * Exactly one of {@link CronJob.agent} (ephemeral agent created on each fire)
24
- * or {@link CronJob.agentId} (bound to an existing agent for context
25
- * continuity) is set.
24
+ * Exactly one target is set: {@link CronJob.agent} (ephemeral agent created on
25
+ * each fire), {@link CronJob.agentId} (bound to an existing agent for context
26
+ * continuity), or {@link CronJob.workflow} (a committed workflow run per fire;
27
+ * SE35). Agent targets carry a `message`; a workflow target carries `inputData`.
26
28
  *
27
29
  * @public
28
30
  */
@@ -33,17 +35,25 @@ export interface CronJob {
33
35
  cron: string;
34
36
  /** IANA timezone identifier. Defaults to `"UTC"`. */
35
37
  timezone?: string;
36
- /** Message sent to the agent on each fire. */
37
- message: string | SDKUserMessage;
38
- /** Ephemeral agent options. Mutually exclusive with `agentId`. */
38
+ /** Message sent to the agent on each fire. Present for agent targets; absent for a workflow target. */
39
+ message?: string | SDKUserMessage;
40
+ /** Ephemeral agent options. Mutually exclusive with `agentId`/`workflow`. */
39
41
  agent?: AgentOptions;
40
- /** ID of an existing agent to reuse for context continuity. Mutually exclusive with `agent`. */
42
+ /** ID of an existing agent to reuse for context continuity. Mutually exclusive with `agent`/`workflow`. */
41
43
  agentId?: string;
44
+ /**
45
+ * SE35 — a committed {@link Workflow} run on each fire (`workflow.run(inputData)`).
46
+ * Mutually exclusive with `agent`/`agentId`. Held in-memory (local runtime only —
47
+ * a workflow instance cannot cross the cloud process boundary). ADR 0014.
48
+ */
49
+ workflow?: Workflow;
50
+ /** SE35 — input passed to `workflow.run(inputData)` on each fire. Workflow targets only. */
51
+ inputData?: unknown;
42
52
  /** Whether the scheduler will fire this job on schedule. */
43
53
  enabled: boolean;
44
54
  /** Current status. */
45
55
  status: CronJobStatus;
46
- /** Runtime that hosts this job. Inferred from `agent`/`agentId` at create time. */
56
+ /** Runtime that hosts this job. Inferred from `agent`/`agentId`/`workflow` at create time (a `workflow` target is always `local`). */
47
57
  runtime: CronRuntime;
48
58
  /** Unix ms of the last successful fire, if any. */
49
59
  lastRunAt?: number;
@@ -55,17 +65,24 @@ export interface CronJob {
55
65
  /**
56
66
  * Options for `Cron.create()`.
57
67
  *
58
- * Pass `agent` for an ephemeral agent created fresh on each fire, OR
59
- * `agentId` to reuse an existing agent (preserves conversation context across
60
- * fires). Setting both is a `ConfigurationError`.
68
+ * Pass exactly ONE target: `agent` (ephemeral agent fresh per fire), `agentId`
69
+ * (reuse an existing agent preserves conversation context), or `workflow`
70
+ * (SE35 — run a committed workflow per fire). Agent targets REQUIRE `message`;
71
+ * a workflow target takes `inputData` and MUST NOT set `message`. Violations are
72
+ * a `ConfigurationError`.
61
73
  *
62
74
  * @public
63
75
  */
64
76
  export interface CronCreateOptions {
65
77
  cron: string;
66
- message: string | SDKUserMessage;
78
+ /** Message for an agent target. Required with `agent`/`agentId`; forbidden with `workflow`. */
79
+ message?: string | SDKUserMessage;
67
80
  agent?: AgentOptions;
68
81
  agentId?: string;
82
+ /** SE35 — a committed {@link Workflow} to run per fire. Mutually exclusive with `agent`/`agentId`. */
83
+ workflow?: Workflow;
84
+ /** SE35 — input for `workflow.run(inputData)`. Workflow targets only. */
85
+ inputData?: unknown;
69
86
  name?: string;
70
87
  timezone?: string;
71
88
  /** Defaults to `true`. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theokit/sdk",
3
- "version": "2.29.0",
3
+ "version": "2.30.0",
4
4
  "description": "TypeScript SDK for the Theo agent harness — same surface, local or cloud.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/usetheo/theokit-sdk#readme",