@theokit/agents 0.28.0 → 0.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.
@@ -104,6 +104,32 @@ type PolicyHandler = (user: {
104
104
  roles: string[];
105
105
  }) => boolean;
106
106
 
107
+ type CheckpointStrategy = 'after-tool-call' | 'after-iteration' | 'manual';
108
+ type CheckpointStorage = 'memory' | 'filesystem' | 'drizzle' | 'redis';
109
+ interface CheckpointOptions {
110
+ /** Where to persist checkpoints. */
111
+ storage?: CheckpointStorage;
112
+ /** When to auto-checkpoint (default: 'after-tool-call'). */
113
+ strategy?: CheckpointStrategy;
114
+ /** Maximum checkpoints to retain per run (rolling window). */
115
+ maxCheckpoints?: number;
116
+ /** Time-to-live in ms before checkpoints expire (default: 3_600_000 = 1h). */
117
+ ttl?: number;
118
+ }
119
+ /** Serializable checkpoint state. */
120
+ interface CheckpointState {
121
+ id: string;
122
+ runId: string;
123
+ agentName: string;
124
+ step: number;
125
+ messages: unknown[];
126
+ toolResults: unknown[];
127
+ createdAt: number;
128
+ resumeToken: string;
129
+ }
130
+ declare function Checkpoint(options?: CheckpointOptions): ClassDecorator;
131
+ declare function getCheckpointConfig(target: Function): CheckpointOptions | undefined;
132
+
107
133
  /** Stored `@Compaction` declaration (resolved + validated at `AgentRunner.build()`). */
108
134
  interface CompactionDecoratorConfig {
109
135
  /** Strategy name (e.g. `'token-budget'`). Validated at resolve time. */
@@ -158,6 +184,20 @@ declare function resolveSessionId(strategy: SessionStrategy, platform: string, s
158
184
  topicId?: string;
159
185
  }): string;
160
186
 
187
+ type TimeoutAction = 'abort' | 'proceed' | 'retry';
188
+ interface HumanInTheLoopOptions {
189
+ /** Question shown to the human approver. */
190
+ question: string;
191
+ /** Timeout in milliseconds before onTimeout fires (default: 300_000 = 5 min). */
192
+ timeout?: number;
193
+ /** Action when timeout expires (default: 'abort'). */
194
+ onTimeout?: TimeoutAction;
195
+ /** Show the tool input to the approver (default: true). */
196
+ showInput?: boolean;
197
+ }
198
+ declare function HumanInTheLoop(options: HumanInTheLoopOptions): MethodDecorator;
199
+ declare function getHumanInTheLoopConfig(target: Function, propertyKey: string | symbol): HumanInTheLoopOptions | undefined;
200
+
161
201
  interface McpServerConfig {
162
202
  /** Command to start the MCP server. */
163
203
  command: string;
@@ -217,4 +257,4 @@ interface SkillsOptions {
217
257
  declare function Skills(namesOrOptions: string[] | SkillsOptions): ClassDecorator;
218
258
  declare function getSkillsConfig(target: Function): SkillsOptions | undefined;
219
259
 
220
- export { type AgentOptions as A, type BudgetOptions as B, Compaction as C, getProjectContextConfig as D, getSkillsConfig as E, resolveSessionId as F, Gateway as G, type IndexStrategy as I, MCP as M, type PlatformName as P, type ReasoningEffort as R, type SessionStrategy as S, type ToolOptions as T, type ApprovalOptions as a, type CompactionDecoratorConfig as b, type ContextCompactionStrategy as c, ContextWindow as d, type ContextWindowOptions as e, type GatewayOptions as f, type MainLoopMeta as g, type MainLoopOptions as h, type McpServerConfig as i, type McpServersMap as j, Memory as k, type MemoryOptions as l, type MemoryProvider as m, type MemoryScope as n, type PolicyHandler as o, ProjectContext as p, type ProjectContextOptions as q, type RelevanceStrategy as r, Skills as s, type SkillsOptions as t, type ToolboxOptions as u, getCompactionConfig as v, getContextWindowConfig as w, getGatewayConfig as x, getMcpConfig as y, getMemoryConfig as z };
260
+ export { type AgentOptions as A, type BudgetOptions as B, Checkpoint as C, type ToolOptions as D, type ToolboxOptions as E, getCheckpointConfig as F, Gateway as G, HumanInTheLoop as H, type IndexStrategy as I, getCompactionConfig as J, getContextWindowConfig as K, getGatewayConfig as L, MCP as M, getHumanInTheLoopConfig as N, getMcpConfig as O, type PlatformName as P, getMemoryConfig as Q, type ReasoningEffort as R, type SessionStrategy as S, type TimeoutAction as T, getProjectContextConfig as U, getSkillsConfig as V, resolveSessionId as W, type ApprovalOptions as a, type CheckpointOptions as b, type CheckpointState as c, type CheckpointStorage as d, type CheckpointStrategy as e, Compaction as f, type CompactionDecoratorConfig as g, type ContextCompactionStrategy as h, ContextWindow as i, type ContextWindowOptions as j, type GatewayOptions as k, type HumanInTheLoopOptions as l, type MainLoopMeta as m, type MainLoopOptions as n, type McpServerConfig as o, type McpServersMap as p, Memory as q, type MemoryOptions as r, type MemoryProvider as s, type MemoryScope as t, type PolicyHandler as u, ProjectContext as v, type ProjectContextOptions as w, type RelevanceStrategy as x, Skills as y, type SkillsOptions as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theokit/agents",
3
- "version": "0.28.0",
3
+ "version": "0.30.0",
4
4
  "description": "Unified decorator runtime — AI agents as first-class citizens of the TheoKit pipeline. @Agent() compiles to SDK Agent.create(), @Tool() compiles to defineTool().",
5
5
  "type": "module",
6
6
  "sideEffects": false,