la-machina-engine 0.3.0 → 0.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.
package/dist/index.d.cts CHANGED
@@ -4,6 +4,108 @@ import { ContentBlockParam, MessageParam } from '@anthropic-ai/sdk/resources/mes
4
4
  import { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
5
5
  import { JSONRPCMessage } from '@modelcontextprotocol/sdk/types.js';
6
6
 
7
+ /**
8
+ * Public types for the `ApiCall` built-in tool (Plan 020).
9
+ *
10
+ * All names are suffixed `V1`. A future incompatible change ships as
11
+ * `V2` alongside, never in place — users of the V1 shapes never have
12
+ * to migrate.
13
+ *
14
+ * The `ApiAuthV1` union is the engine's pluggable-auth protocol:
15
+ * - `none` / `bearer` / `header` / `basic` are first-class; the
16
+ * engine resolves them from the `env` map at dispatch time.
17
+ * - `custom` hands full control to a caller-supplied resolver,
18
+ * which is where OAuth-refresh, HMAC signing, JWT minting, and
19
+ * other dynamic schemes live.
20
+ *
21
+ * Secret values themselves never appear in these types. The `*Ref`
22
+ * fields are opaque lookup keys into the env map (for built-ins) or
23
+ * identifiers the resolver interprets (for `custom`).
24
+ */
25
+ type ApiHttpMethodV1 = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
26
+ type ApiAuthV1 = {
27
+ readonly type: 'none';
28
+ } | {
29
+ readonly type: 'bearer';
30
+ readonly tokenRef: string;
31
+ } | {
32
+ readonly type: 'header';
33
+ readonly name: string;
34
+ readonly valueRef: string;
35
+ } | {
36
+ readonly type: 'basic';
37
+ readonly userRef: string;
38
+ readonly passRef: string;
39
+ } | {
40
+ readonly type: 'custom';
41
+ readonly id: string;
42
+ };
43
+ interface ApiServiceV1 {
44
+ /** Stable enum value the model picks. Must be non-empty. */
45
+ readonly name: string;
46
+ /** Optional short description of the service; appears in the tool description. */
47
+ readonly description?: string;
48
+ /** Base URL prepended to the model-supplied path. No trailing slash required. */
49
+ readonly baseUrl: string;
50
+ /** Default: `{ type: 'none' }`. */
51
+ readonly auth?: ApiAuthV1;
52
+ /**
53
+ * Path allowlist. String entries match by `.startsWith()`; RegExp
54
+ * entries by `.test()`. Empty / undefined = any path allowed.
55
+ */
56
+ readonly allowedPaths?: ReadonlyArray<string | RegExp>;
57
+ /** HTTP methods permitted. Empty / undefined = any of the ApiHttpMethodV1 set. */
58
+ readonly allowedMethods?: readonly ApiHttpMethodV1[];
59
+ /** Default headers merged into every request (can be overridden by auth headers). */
60
+ readonly defaultHeaders?: Readonly<Record<string, string>>;
61
+ /** Request body size cap in bytes (after JSON.stringify). Default 256 KB. */
62
+ readonly maxBodyBytes?: number;
63
+ }
64
+ /** Context the engine hands to `ApiAuthResolverV1` on every dispatch. */
65
+ interface ApiResolverCtxV1 {
66
+ readonly serviceName: string;
67
+ readonly method: ApiHttpMethodV1;
68
+ readonly path: string;
69
+ }
70
+ /**
71
+ * Caller-supplied auth resolver. Called once per ApiCall dispatch
72
+ * for `custom` auth types, or for built-in types when the caller
73
+ * supplies their own resolver (it wins over the engine's built-in
74
+ * env lookup).
75
+ *
76
+ * Must return the exact HTTP headers to attach to the outgoing
77
+ * fetch. The engine merges these after default + user headers, so
78
+ * resolver-returned headers always win.
79
+ */
80
+ type ApiAuthResolverV1 = (auth: ApiAuthV1, ctx: ApiResolverCtxV1) => Promise<Readonly<Record<string, string>>>;
81
+ /** Payload for the `onRequest` observability hook. No secrets. */
82
+ interface ApiRequestEventV1 {
83
+ readonly service: string;
84
+ readonly method: ApiHttpMethodV1;
85
+ readonly path: string;
86
+ }
87
+ /** Payload for the `onResponse` observability hook. No secrets. */
88
+ interface ApiResponseEventV1 extends ApiRequestEventV1 {
89
+ readonly status: number;
90
+ readonly latencyMs: number;
91
+ readonly bytesIn: number;
92
+ }
93
+ /**
94
+ * Fully-resolved runtime api config. `env`, `resolveAuth`, and the
95
+ * hook callbacks live HERE (runtime-only) rather than on the Zod-
96
+ * validated ResolvedConfig, so they can't leak through schema
97
+ * serialization. See Plan 020 §2.
98
+ */
99
+ interface ResolvedApiConfigV1 {
100
+ readonly services: readonly ApiServiceV1[];
101
+ readonly env?: Readonly<Record<string, string>> | undefined;
102
+ readonly resolveAuth?: ApiAuthResolverV1 | undefined;
103
+ readonly onRequest?: ((e: ApiRequestEventV1) => void | Promise<void>) | undefined;
104
+ readonly onResponse?: ((e: ApiResponseEventV1) => void | Promise<void>) | undefined;
105
+ /** Response body size cap in bytes. Default 100 KB. */
106
+ readonly maxResponseBytes?: number | undefined;
107
+ }
108
+
7
109
  /**
8
110
  * StorageAdapter — abstract filesystem interface for la-machina-engine.
9
111
  *
@@ -468,6 +570,24 @@ interface Tool$1<TSchema extends z.ZodTypeAny = z.ZodTypeAny> {
468
570
  * under `exactOptionalPropertyTypes`.
469
571
  */
470
572
  isConcurrencySafe?: ((input: unknown) => boolean) | undefined;
573
+ /**
574
+ * Declares that this tool needs Node-only capabilities
575
+ * (`node:child_process`, the real filesystem, stdio-based MCP, etc.)
576
+ * When true AND the runtime can't support them, the engine replaces
577
+ * this tool with a capability stub (see `src/tools/capabilityStub.ts`)
578
+ * that returns a structured `isError` result instead of crashing.
579
+ *
580
+ * Leave undefined / false for tools that work anywhere (Read, Write,
581
+ * WebFetch, http-based MCP). Default: false.
582
+ */
583
+ readonly requiresNode?: boolean;
584
+ /**
585
+ * Internal marker set by `capabilityStub()` so the agent-loop's
586
+ * runner-handoff check (Plan 019 §4) can distinguish a stubbed tool
587
+ * from a real one without reflecting on the implementation.
588
+ * Do not set this manually.
589
+ */
590
+ readonly isCapabilityStub?: boolean;
471
591
  execute(input: z.infer<TSchema>, context: ToolContext): Promise<ToolResult>;
472
592
  }
473
593
  /**
@@ -848,6 +968,42 @@ interface ResolvedLoggingConfig {
848
968
  readonly level: LogLevel;
849
969
  readonly sink: LogSink;
850
970
  }
971
+ /**
972
+ * Built-in ApiCall tool config (Plan 020).
973
+ *
974
+ * When `services` is non-empty, the engine auto-registers the
975
+ * `ApiCall` tool so the model can call tenant-configured external
976
+ * HTTP APIs without ever seeing credentials.
977
+ *
978
+ * `env`, `resolveAuth`, and the hook callbacks are INTENTIONALLY
979
+ * omitted from the Zod schema — they are runtime-only fields
980
+ * carried alongside ResolvedConfig. This structural split is the
981
+ * non-persistence guarantee: `JSON.stringify` of the schema-parsed
982
+ * config can never leak secrets.
983
+ */
984
+ interface ResolvedApiConfig {
985
+ readonly services: readonly ApiServiceV1[];
986
+ readonly env?: Readonly<Record<string, string>> | undefined;
987
+ readonly resolveAuth?: ApiAuthResolverV1 | undefined;
988
+ readonly onRequest?: ((e: ApiRequestEventV1) => void | Promise<void>) | undefined;
989
+ readonly onResponse?: ((e: ApiResponseEventV1) => void | Promise<void>) | undefined;
990
+ readonly maxResponseBytes?: number | undefined;
991
+ }
992
+ /**
993
+ * Runner handoff config (Plan 019). When set, async runs on a
994
+ * restricted runtime (e.g. Cloudflare Workers) can hand off the run
995
+ * to a Node-side runner process via a single `POST { runId }` to
996
+ * `url`, authenticated with a bearer token (`secret`).
997
+ *
998
+ * Absent means no handoff ever happens — sync runs degrade via
999
+ * capability stubs, and async runs degrade the same way.
1000
+ */
1001
+ interface ResolvedRunnerConfig {
1002
+ /** Runner HTTP endpoint (e.g. `https://my-runner.example.com/continue`). */
1003
+ readonly url: string;
1004
+ /** Shared bearer token the engine sends in `Authorization: Bearer <secret>`. */
1005
+ readonly secret: string;
1006
+ }
851
1007
  interface ResolvedConfig {
852
1008
  readonly model: ResolvedModelConfig;
853
1009
  readonly storage: ResolvedStorageConfig;
@@ -864,6 +1020,15 @@ interface ResolvedConfig {
864
1020
  readonly compaction: ResolvedCompactionConfig;
865
1021
  readonly coordinator: ResolvedCoordinatorConfig;
866
1022
  readonly orchestrator: ResolvedOrchestratorConfig;
1023
+ /** Optional runner handoff config (Plan 019). Absent = no handoff. */
1024
+ readonly runner?: ResolvedRunnerConfig | undefined;
1025
+ /**
1026
+ * Optional built-in ApiCall tool config (Plan 020). When set, the
1027
+ * `ApiCall` tool is auto-registered. Env + callbacks are runtime-
1028
+ * only fields — excluded from `ResolvedConfigSchema` to prevent
1029
+ * secret serialization.
1030
+ */
1031
+ readonly api?: ResolvedApiConfig | undefined;
867
1032
  }
868
1033
 
869
1034
  type DeepPartial<T> = T extends readonly unknown[] ? T : T extends object ? {
@@ -1650,6 +1815,20 @@ interface RunOptions {
1650
1815
  * by the `SkillPage` tool.
1651
1816
  */
1652
1817
  readonly skills?: ReadonlyArray<SkillOverride> | undefined;
1818
+ /**
1819
+ * Per-run ApiCall override (Plan 020). When any field is present,
1820
+ * it overrides the matching field on `config.api`. Typical
1821
+ * multi-tenant usage: one engine instance, each run passes its
1822
+ * tenant's services + env via this field. Env + callbacks live
1823
+ * here (runtime-only) and are never serialized.
1824
+ */
1825
+ readonly api?: {
1826
+ readonly services?: ReadonlyArray<ApiServiceV1>;
1827
+ readonly env?: Readonly<Record<string, string>>;
1828
+ readonly resolveAuth?: ApiAuthResolverV1;
1829
+ readonly onRequest?: (e: ApiRequestEventV1) => void | Promise<void>;
1830
+ readonly onResponse?: (e: ApiResponseEventV1) => void | Promise<void>;
1831
+ } | undefined;
1653
1832
  }
1654
1833
  interface TokenUsage {
1655
1834
  readonly input: number;
@@ -1674,7 +1853,7 @@ interface TokenUsage {
1674
1853
  * Kept in the union so the v0.2 change is backwards-compatible (no type
1675
1854
  * narrowing in callers that already switch on the full set).
1676
1855
  */
1677
- type PauseReason = 'gate_required' | 'subagent_gate_required' | 'max_turns' | 'explicit' | 'timeout';
1856
+ type PauseReason = 'gate_required' | 'subagent_gate_required' | 'handoff_to_runner' | 'max_turns' | 'explicit' | 'timeout';
1678
1857
  interface RunSnapshot {
1679
1858
  readonly version: 1;
1680
1859
  readonly status: 'paused';
@@ -1744,6 +1923,18 @@ interface ResumeOptions {
1744
1923
  * consistent. Overrides are not persisted in the snapshot.
1745
1924
  */
1746
1925
  readonly skills?: ReadonlyArray<SkillOverride> | undefined;
1926
+ /**
1927
+ * Per-resume ApiCall override (Plan 020). Mirrors `RunOptions.api`.
1928
+ * Pass the same env you used on start() — credentials are never
1929
+ * persisted in the snapshot, so callers must re-supply them.
1930
+ */
1931
+ readonly api?: {
1932
+ readonly services?: ReadonlyArray<ApiServiceV1>;
1933
+ readonly env?: Readonly<Record<string, string>>;
1934
+ readonly resolveAuth?: ApiAuthResolverV1;
1935
+ readonly onRequest?: (e: ApiRequestEventV1) => void | Promise<void>;
1936
+ readonly onResponse?: (e: ApiResponseEventV1) => void | Promise<void>;
1937
+ } | undefined;
1747
1938
  }
1748
1939
 
1749
1940
  /**
@@ -1820,6 +2011,13 @@ interface ResponseMeta {
1820
2011
  readonly pendingToolCall?: RunSnapshot['pendingToolCall'];
1821
2012
  readonly pauseReason?: PauseReason;
1822
2013
  readonly transcript?: TranscriptLocation;
2014
+ /**
2015
+ * Plan 019 — names of tools whose capability-stub fired during this
2016
+ * run (deduped). Callers can detect "this run ran against a runtime
2017
+ * that couldn't execute these tools" and retry as async with a
2018
+ * runner configured. Absent when no stub fired.
2019
+ */
2020
+ readonly capabilitiesMissing?: readonly string[];
1823
2021
  /** Additional context-specific fields (e.g., activity, lastTool, cancelled). */
1824
2022
  readonly [key: string]: unknown;
1825
2023
  }
@@ -1840,6 +2038,8 @@ declare function toResponse(result: RunResult, extra: {
1840
2038
  nodeId: string;
1841
2039
  durationMs: number;
1842
2040
  logPath?: string;
2041
+ /** Plan 019 — capability-stub names observed during the run. */
2042
+ capabilitiesMissing?: readonly string[];
1843
2043
  }): EngineResponse;
1844
2044
 
1845
2045
  /**
@@ -2044,8 +2244,20 @@ declare class Engine {
2044
2244
  private readonly backgroundExecutor;
2045
2245
  private readonly webhookDispatcher;
2046
2246
  constructor(config: ResolvedConfig, internals?: EngineInternals);
2047
- run(options: RunOptions): Promise<EngineResponse>;
2048
- resume(options: ResumeOptions): Promise<EngineResponse>;
2247
+ /**
2248
+ * Run a task synchronously to completion. The `_internal` parameter is
2249
+ * reserved for the engine's own async wrappers (`start`, `resumeAsync`)
2250
+ * to request runner handoff (Plan 019) — external callers must leave
2251
+ * it unset. Sync callers never hand off; if they hit a Node-only tool
2252
+ * on a restricted runtime, the capability stub returns an error and
2253
+ * the model adapts.
2254
+ */
2255
+ run(options: RunOptions, _internal?: {
2256
+ handoffToRunner?: boolean;
2257
+ }): Promise<EngineResponse>;
2258
+ resume(options: ResumeOptions, _internal?: {
2259
+ handoffToRunner?: boolean;
2260
+ }): Promise<EngineResponse>;
2049
2261
  /**
2050
2262
  * Load a paused snapshot from storage using runId (and optional nodeId).
2051
2263
  * If nodeId is not provided, finds the most recently paused node.
@@ -2105,6 +2317,18 @@ declare class Engine {
2105
2317
  recoverOrphanedRuns(opts?: {
2106
2318
  staleThresholdMs?: number;
2107
2319
  }): Promise<readonly RunState[]>;
2320
+ /**
2321
+ * When the response indicates the run paused for runner handoff, POST
2322
+ * `{ runId }` to the configured runner URL. On success, return the
2323
+ * response unchanged — state stays `paused` and the runner will flip
2324
+ * it to `done` (or `failed`) on its side. On POST failure, convert
2325
+ * the response to `failed` with `ERR_RUNNER_UNREACHABLE` so the
2326
+ * caller sees a terminal state instead of a silent hang.
2327
+ *
2328
+ * Called only from `start()` / `resumeAsync()`. Sync `run()` never
2329
+ * produces a `handoff_to_runner` pause (see `_internal.handoffToRunner`).
2330
+ */
2331
+ private maybeHandoffToRunner;
2108
2332
  private maybeFireWebhook;
2109
2333
  private dispatchWebhookWithRetries;
2110
2334
  /**
@@ -2185,6 +2409,17 @@ declare class Engine {
2185
2409
  * - else → undefined (SkillPage tool not registered)
2186
2410
  */
2187
2411
  private resolveSkillSource;
2412
+ /**
2413
+ * Plan 020 — resolve the effective ApiCall config for a run.
2414
+ *
2415
+ * Precedence (each field independently):
2416
+ * RunOptions.api.X > config.api.X
2417
+ *
2418
+ * If neither side provides any services, returns undefined so the
2419
+ * tool isn't registered at all. Env + resolveAuth + hooks flow
2420
+ * through untouched — they never hit the Zod schema.
2421
+ */
2422
+ private resolveApiConfig;
2188
2423
  /**
2189
2424
  * Build a throttled heartbeat callback for agentLoop's `onProgress` hook.
2190
2425
  *
@@ -2450,6 +2685,37 @@ declare class RunTimeoutError extends EngineError {
2450
2685
  constructor(timeoutMs: number);
2451
2686
  }
2452
2687
 
2688
+ /**
2689
+ * Capability stub — replaces a Node-only tool with a placeholder that
2690
+ * returns a structured `isError` result when invoked in a runtime that
2691
+ * can't execute it (e.g. Cloudflare Workers for Bash / stdio MCP).
2692
+ *
2693
+ * The stub preserves the original tool's name and description so the
2694
+ * model still sees the tool in its toolset and can decide whether to
2695
+ * call it. When called, the stub returns a clear message naming the
2696
+ * tool and pointing at the runner-handoff escape hatch (Plan 019).
2697
+ *
2698
+ * In async runs with `config.runner` configured, the agent loop
2699
+ * intercepts stub invocations BEFORE they execute and pauses the run
2700
+ * with `pauseReason: 'handoff_to_runner'` so a Node-side runner can
2701
+ * resume it. In sync runs (or async runs with no runner configured),
2702
+ * the stub's `execute` actually runs and the model adapts its answer.
2703
+ */
2704
+
2705
+ /**
2706
+ * Build a stub tool that mirrors `original.name` and `original.description`
2707
+ * but returns an `isError` result when invoked. Used by the engine when
2708
+ * a tool declares `requiresNode: true` and `canSpawnProcesses()` is false.
2709
+ */
2710
+ declare function capabilityStub(original: Pick<Tool$1, 'name' | 'description'>): Tool$1;
2711
+ /**
2712
+ * Convenience: given a tool, return the real tool when the runtime can
2713
+ * execute it, otherwise a capability stub standing in for it. Callers
2714
+ * that already know the spawn-availability flag (e.g. engine.ts which
2715
+ * caches it) pass it directly instead of re-probing.
2716
+ */
2717
+ declare function withCapabilityCheck(tool: Tool$1, spawnAvailable: boolean): Tool$1;
2718
+
2453
2719
  /**
2454
2720
  * Structured JSON output — schema injection, parsing, validation.
2455
2721
  *
@@ -2947,6 +3213,43 @@ declare class InlineSkillSource implements SkillSource {
2947
3213
  private assertUrlAllowed;
2948
3214
  }
2949
3215
 
3216
+ /**
3217
+ * ApiCall — built-in tool for calling tenant-configured external
3218
+ * HTTP APIs without the model ever seeing credentials (Plan 020).
3219
+ *
3220
+ * The caller describes a set of `ApiServiceV1`s, supplies an `env`
3221
+ * map of credential values (or a `resolveAuth` callback for dynamic
3222
+ * auth), and this factory returns a `Tool` ready to register. The
3223
+ * model picks a service from a closed-over enum + issues a request;
3224
+ * the tool resolves auth, enforces per-service allowlists, fetches,
3225
+ * and returns the response. Credentials live only in the closure —
3226
+ * never in input, output, or any engine-persisted surface.
3227
+ *
3228
+ * Safety rails (all enforced per-call, first failure wins):
3229
+ * 1. `service` must be in the closed enum.
3230
+ * 2. Method must pass `allowedMethods` if set.
3231
+ * 3. Path must match an `allowedPaths` entry if set.
3232
+ * 4. Request body cannot exceed `maxBodyBytes` (default 256 KB).
3233
+ * 5. Model-supplied headers cannot override auth headers (the
3234
+ * sanitizer strips case-insensitive collisions).
3235
+ *
3236
+ * Response body is size-capped at `maxResponseBytes` (default 100 KB)
3237
+ * with a trailing truncation marker.
3238
+ */
3239
+
3240
+ interface CreateApiCallToolOptions {
3241
+ readonly services: readonly ApiServiceV1[];
3242
+ readonly env?: Readonly<Record<string, string>>;
3243
+ readonly resolveAuth?: ApiAuthResolverV1;
3244
+ readonly fetch?: typeof globalThis.fetch;
3245
+ readonly maxResponseBytes?: number;
3246
+ readonly onRequest?: (e: ApiRequestEventV1) => void | Promise<void>;
3247
+ readonly onResponse?: (e: ApiResponseEventV1) => void | Promise<void>;
3248
+ readonly toolName?: string;
3249
+ readonly toolDescription?: string;
3250
+ }
3251
+ declare function createApiCallTool(opts: CreateApiCallToolOptions): Tool$1;
3252
+
2950
3253
  /**
2951
3254
  * Runtime detection — determines whether the engine is running in
2952
3255
  * Node.js or a restricted runtime (Cloudflare Workers, etc.)
@@ -3584,4 +3887,4 @@ declare const ENGINE_VERSION = "0.0.0";
3584
3887
  */
3585
3888
  declare function initEngine(user?: UserConfig): Engine;
3586
3889
 
3587
- export { AISdkAdapter, type AgentDefinition, AnthropicAdapter, ApiError, AuthError, type BackgroundAgentResult, type BackgroundExecutor, BindingHttpTransport, type BuildSystemPromptOptions, ConfigError, DEFAULT_SAMPLING_MAX_DEPTH, ENGINE_VERSION, Engine, EngineError, type EngineInternals, type EngineResponse, type EngineStorage, type Engram, type EngramConfidence, type EngramKind, type EngramScope, type EngramSource, type Entry, type Episode, EpisodicMemory, type FileSnapshot, type FileStat, type FlushPolicy, type GateBeforeToolHook, type GateDecision$1 as GateDecision, Hippocampus, InlineSkillSource, type LoadedSkill, LocalStorageAdapter, type LogEntry, type LogLevel, type LogSink, type Logger, type LoopProgress, MAX_ATTEMPTS, type McpCallResult, McpClient, McpConnectionError, type McpInstructionDelta, McpManager, McpProtocolError, type McpServerState, McpTimeoutError, type McpToolDef, type MemoryMode, type MemoryScope, type ModelAdapter, type ModelMessage, type ModelProvider, type ModelToolDefinition, NodeBackgroundExecutor, type NormalizedEvent, NotImplementedError, type OrchestrateOptions, type OrchestratorResult, type PauseReason, type PermissionAction, type PermissionDecision, type PermissionMode, type PermissionPolicy, type PermissionRule, type Plan, PlanSchema, type PlanStep, PlanStepSchema, type PostRunEvent, type PostRunHook, type PostToolCallEvent$1 as PostToolCallEvent, type PostToolCallHook, type PostTurnEvent, type PostTurnHook, type PreRunEvent, type PreRunHook, type PreToolCallEvent$1 as PreToolCallEvent, type PreToolCallHook, type PreTurnEvent, type PreTurnHook, R2BindingStorageAdapter, type R2BucketBinding, type R2ClientConfig, R2StorageAdapter, RETRY_DELAYS_MS, RateLimitError, type ResolvedAgentsConfig, type ResolvedConfig, type ResolvedCoordinatorConfig, type ResolvedExecutionConfig, type ResolvedHooksConfig, type ResolvedLoggingConfig, type ResolvedMcpConfig, type ResolvedMcpHttpServerConfig, type ResolvedMcpServerConfig, type ResolvedMcpSseServerConfig, type ResolvedMcpStdioServerConfig, type ResolvedMemoryConfig, type ResolvedModelConfig, type ResolvedOrchestratorConfig, type ResolvedPermissionsConfig, type ResolvedR2Config, type ResolvedSkill, type ResolvedSkillsConfig, type ResolvedStorageConfig, type ResolvedToolsConfig, type ResolvedTranscriptConfig, type ResponseError, type ResponseMeta, type ResumeAsyncOptions, type ResumeOptions, type RetryPolicy, type RunOptions, type RunProgress, type RunResult, type RunSnapshot, type RunState, RunStateManager, type RunStatus, RunTimeoutError, type RuntimeKind, SAFE_TOOL_ALLOWLIST, type SamplingContext, type SamplingHandler, type SamplingMessage, type SamplingModelPreferences, type SamplingRequest, type SamplingResponse, type SamplingTextBlock, type SerializedAgent, type SkillOverride, type SkillPageOverride, type SkillSource, type SmartMemory, type SmartMemoryConfig, type SpawnResult, type StartOptions, type StepResult, type StepStatus, type StopHook, type StopHookEvent, type StopHookResult, type StorageAdapter, StorageError, type StorageProvider, StorageSkillSource, StreamIncompleteError, StreamParseError, type StreamRequest, StreamingToolExecutor, SubagentRegistry, type SubagentRegistryOptions, type TokenUsage, type Tool$1 as Tool, type ToolContext, ToolRegistry, type ToolResult, type TranscriptLocation, type TranscriptMeta, type TranscriptStatus, type UserConfig, type WaitForOptions, type WebhookConfig, type WebhookDelivery, WebhookDispatcher, type WebhookEvent, type WebhookOptions, adaptMcpTool, buildForkedMessages, buildPermissionPolicy, buildSchemaPrompt, buildSystemPrompt, buildWorkerAgent, canSpawnProcesses, createLogger, createModelAdapter, createSendMessageTool, createSkillPageTool, createSmartMemory, defaultSamplingHandler, defineTool, detectRuntime, getCoordinatorBasePrompt, getCoordinatorSystemPrompt, hasProcessLifecycle, initEngine, isCoordinatorMode, isInForkChild, isSafeTool, loadAgents, loadSkills, matchesRule, mcpToolName, orchestrate, parsePlan, parseRule, parseRules, partitionToolCalls, restoreSnapshot, runWithRetry, signPayload, snapshotFiles, synthesizeSpec, toResponse, tryParseJSON, validateOutput };
3890
+ export { AISdkAdapter, type AgentDefinition, AnthropicAdapter, type ApiAuthResolverV1, type ApiAuthV1, ApiError, type ApiHttpMethodV1, type ApiRequestEventV1, type ApiResolverCtxV1, type ApiResponseEventV1, type ApiServiceV1, AuthError, type BackgroundAgentResult, type BackgroundExecutor, BindingHttpTransport, type BuildSystemPromptOptions, ConfigError, type CreateApiCallToolOptions, DEFAULT_SAMPLING_MAX_DEPTH, ENGINE_VERSION, Engine, EngineError, type EngineInternals, type EngineResponse, type EngineStorage, type Engram, type EngramConfidence, type EngramKind, type EngramScope, type EngramSource, type Entry, type Episode, EpisodicMemory, type FileSnapshot, type FileStat, type FlushPolicy, type GateBeforeToolHook, type GateDecision$1 as GateDecision, Hippocampus, InlineSkillSource, type LoadedSkill, LocalStorageAdapter, type LogEntry, type LogLevel, type LogSink, type Logger, type LoopProgress, MAX_ATTEMPTS, type McpCallResult, McpClient, McpConnectionError, type McpInstructionDelta, McpManager, McpProtocolError, type McpServerState, McpTimeoutError, type McpToolDef, type MemoryMode, type MemoryScope, type ModelAdapter, type ModelMessage, type ModelProvider, type ModelToolDefinition, NodeBackgroundExecutor, type NormalizedEvent, NotImplementedError, type OrchestrateOptions, type OrchestratorResult, type PauseReason, type PermissionAction, type PermissionDecision, type PermissionMode, type PermissionPolicy, type PermissionRule, type Plan, PlanSchema, type PlanStep, PlanStepSchema, type PostRunEvent, type PostRunHook, type PostToolCallEvent$1 as PostToolCallEvent, type PostToolCallHook, type PostTurnEvent, type PostTurnHook, type PreRunEvent, type PreRunHook, type PreToolCallEvent$1 as PreToolCallEvent, type PreToolCallHook, type PreTurnEvent, type PreTurnHook, R2BindingStorageAdapter, type R2BucketBinding, type R2ClientConfig, R2StorageAdapter, RETRY_DELAYS_MS, RateLimitError, type ResolvedAgentsConfig, type ResolvedApiConfig, type ResolvedApiConfigV1, type ResolvedConfig, type ResolvedCoordinatorConfig, type ResolvedExecutionConfig, type ResolvedHooksConfig, type ResolvedLoggingConfig, type ResolvedMcpConfig, type ResolvedMcpHttpServerConfig, type ResolvedMcpServerConfig, type ResolvedMcpSseServerConfig, type ResolvedMcpStdioServerConfig, type ResolvedMemoryConfig, type ResolvedModelConfig, type ResolvedOrchestratorConfig, type ResolvedPermissionsConfig, type ResolvedR2Config, type ResolvedRunnerConfig, type ResolvedSkill, type ResolvedSkillsConfig, type ResolvedStorageConfig, type ResolvedToolsConfig, type ResolvedTranscriptConfig, type ResponseError, type ResponseMeta, type ResumeAsyncOptions, type ResumeOptions, type RetryPolicy, type RunOptions, type RunProgress, type RunResult, type RunSnapshot, type RunState, RunStateManager, type RunStatus, RunTimeoutError, type RuntimeKind, SAFE_TOOL_ALLOWLIST, type SamplingContext, type SamplingHandler, type SamplingMessage, type SamplingModelPreferences, type SamplingRequest, type SamplingResponse, type SamplingTextBlock, type SerializedAgent, type SkillOverride, type SkillPageOverride, type SkillSource, type SmartMemory, type SmartMemoryConfig, type SpawnResult, type StartOptions, type StepResult, type StepStatus, type StopHook, type StopHookEvent, type StopHookResult, type StorageAdapter, StorageError, type StorageProvider, StorageSkillSource, StreamIncompleteError, StreamParseError, type StreamRequest, StreamingToolExecutor, SubagentRegistry, type SubagentRegistryOptions, type TokenUsage, type Tool$1 as Tool, type ToolContext, ToolRegistry, type ToolResult, type TranscriptLocation, type TranscriptMeta, type TranscriptStatus, type UserConfig, type WaitForOptions, type WebhookConfig, type WebhookDelivery, WebhookDispatcher, type WebhookEvent, type WebhookOptions, adaptMcpTool, buildForkedMessages, buildPermissionPolicy, buildSchemaPrompt, buildSystemPrompt, buildWorkerAgent, canSpawnProcesses, capabilityStub, createApiCallTool, createLogger, createModelAdapter, createSendMessageTool, createSkillPageTool, createSmartMemory, defaultSamplingHandler, defineTool, detectRuntime, getCoordinatorBasePrompt, getCoordinatorSystemPrompt, hasProcessLifecycle, initEngine, isCoordinatorMode, isInForkChild, isSafeTool, loadAgents, loadSkills, matchesRule, mcpToolName, orchestrate, parsePlan, parseRule, parseRules, partitionToolCalls, restoreSnapshot, runWithRetry, signPayload, snapshotFiles, synthesizeSpec, toResponse, tryParseJSON, validateOutput, withCapabilityCheck };