@neutrome/lilsdk 0.4.4 → 0.4.6

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/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  High-level TypeScript SDK for transport-neutral model authoring on top of `@neutrome/lil-engine`.
4
4
 
5
5
  ```ts
6
- import { createTwoPassExecutor, type Executor } from "@neutrome/lilsdk";
6
+ import type { Executor } from "@neutrome/lilsdk";
7
7
  import { retry } from "@neutrome/lilsdk/loops";
8
8
  import {
9
9
  observeExecutionStream,
@@ -20,11 +20,7 @@ This package owns:
20
20
  - `@neutrome/lilsdk/tools`: `connectTools` tool-call loop
21
21
  - `@neutrome/lilsdk/stream`: stream observation and output helpers
22
22
  - `@neutrome/lilsdk/loops`: `retry`, `fallback`, and `createGoalExecutor` control-flow helpers
23
- - `@neutrome/lilsdk/managed/twoPassExecutor`: `createTwoPassExecutor` and model invocation helpers
24
- - multi-pass authoring primitives used by virtual models
25
-
26
- The root export is intentionally small: SDK contracts plus the most common
27
- high-level two-pass executor helper.
23
+ The root export is intentionally small: SDK contracts.
28
24
 
29
25
  It intentionally does not own HTTP routing, provider credentials, target
30
26
  resolution, or provider JSON conversion. Those live in `@neutrome/open-ai-router`
@@ -0,0 +1,103 @@
1
+ ## API Report File for "neutrome"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import type { Program } from '@neutrome/lil-engine';
8
+
9
+ // @public (undocumented)
10
+ type Cache_2 = {
11
+ get(key: string): Promise<string | null>;
12
+ put(key: string, value: string, options?: CachePutOptions): Promise<void>;
13
+ delete(key: string): Promise<void>;
14
+ };
15
+ export { Cache_2 as Cache }
16
+
17
+ // @public (undocumented)
18
+ export type CachePutOptions = {
19
+ expiration?: number;
20
+ expirationTtl?: number;
21
+ };
22
+
23
+ // @public (undocumented)
24
+ export function createExecutionEvent(input: ExecutionEventInput): ExecutionEvent;
25
+
26
+ // @public (undocumented)
27
+ export type ExecutionEvent = {
28
+ kind: string;
29
+ requestId: string;
30
+ executionId: string;
31
+ timestamp: string;
32
+ parentExecutionId?: string;
33
+ target?: {
34
+ kind: "provider" | "executor";
35
+ id: string;
36
+ };
37
+ errorKind?: string;
38
+ data?: Record<string, unknown>;
39
+ };
40
+
41
+ // @public (undocumented)
42
+ export type ExecutionEventInput = Omit<ExecutionEvent, "timestamp"> & {
43
+ timestamp?: string;
44
+ };
45
+
46
+ // @public (undocumented)
47
+ export type Executor = {
48
+ execute(request: Program, ctx: ExecutorContext): Promise<Program>;
49
+ stream(request: Program, ctx: ExecutorContext): AsyncIterable<Program>;
50
+ };
51
+
52
+ // Warning: (ae-forgotten-export) The symbol "RuntimeContext" needs to be exported by the entry point index.d.ts
53
+ //
54
+ // @public (undocumented)
55
+ export type ExecutorContext = RuntimeContext & {
56
+ requestId: string;
57
+ executionId: string;
58
+ parentExecutionId?: string;
59
+ };
60
+
61
+ // @public (undocumented)
62
+ export type ExecutorInput = string | Executor;
63
+
64
+ // @public (undocumented)
65
+ export type OutputSink = {
66
+ write(chunk: Program): void | Promise<void>;
67
+ close(): void | Promise<void>;
68
+ };
69
+
70
+ // @public (undocumented)
71
+ export type ProgramTransform = {
72
+ name: string;
73
+ capabilities: TransformCapability[];
74
+ apply(program: Program, ctx: TransformContext): Program | Promise<Program>;
75
+ };
76
+
77
+ // @public (undocumented)
78
+ type RuntimeContext = {
79
+ cache: Cache_2;
80
+ invoke(executor: ExecutorInput, request: Program): Promise<Program>;
81
+ invokeStream(executor: ExecutorInput, request: Program): AsyncIterable<Program>;
82
+ observe(event: ExecutionEvent): void;
83
+ signal: AbortSignal;
84
+ };
85
+
86
+ // @public (undocumented)
87
+ export type Tool = {
88
+ name: string;
89
+ description: string;
90
+ schema: Record<string, unknown>;
91
+ systemPromptFragment?: string;
92
+ execute(args: Record<string, unknown>, ctx: ExecutorContext): Promise<string>;
93
+ };
94
+
95
+ // @public (undocumented)
96
+ export type TransformCapability = "read_messages" | "write_messages" | "write_config" | "write_tools" | "drop_content" | "provider_extension";
97
+
98
+ // @public (undocumented)
99
+ export type TransformContext = RuntimeContext;
100
+
101
+ // (No @packageDocumentation comment for this package)
102
+
103
+ ```
@@ -0,0 +1,108 @@
1
+ ## API Report File for "neutrome"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { Program } from '@neutrome/lil-engine';
8
+
9
+ // @public (undocumented)
10
+ type Cache_2 = {
11
+ get(key: string): Promise<string | null>;
12
+ put(key: string, value: string, options?: CachePutOptions): Promise<void>;
13
+ delete(key: string): Promise<void>;
14
+ };
15
+
16
+ // @public (undocumented)
17
+ type CachePutOptions = {
18
+ expiration?: number;
19
+ expirationTtl?: number;
20
+ };
21
+
22
+ // Warning: (ae-forgotten-export) The symbol "Executor" needs to be exported by the entry point index.d.ts
23
+ //
24
+ // @public (undocumented)
25
+ export function createGoalExecutor(options: GoalExecutorOptions): Executor;
26
+
27
+ // @public (undocumented)
28
+ type ExecutionEvent = {
29
+ kind: string;
30
+ requestId: string;
31
+ executionId: string;
32
+ timestamp: string;
33
+ parentExecutionId?: string;
34
+ target?: {
35
+ kind: "provider" | "executor";
36
+ id: string;
37
+ };
38
+ errorKind?: string;
39
+ data?: Record<string, unknown>;
40
+ };
41
+
42
+ // @public (undocumented)
43
+ type Executor = {
44
+ execute(request: Program, ctx: ExecutorContext): Promise<Program>;
45
+ stream(request: Program, ctx: ExecutorContext): AsyncIterable<Program>;
46
+ };
47
+
48
+ // Warning: (ae-forgotten-export) The symbol "RuntimeContext" needs to be exported by the entry point index.d.ts
49
+ //
50
+ // @public (undocumented)
51
+ type ExecutorContext = RuntimeContext & {
52
+ requestId: string;
53
+ executionId: string;
54
+ parentExecutionId?: string;
55
+ };
56
+
57
+ // @public (undocumented)
58
+ type ExecutorInput = string | Executor;
59
+
60
+ // Warning: (ae-forgotten-export) The symbol "ExecutorInput" needs to be exported by the entry point index.d.ts
61
+ //
62
+ // @public (undocumented)
63
+ export function fallback(executors: readonly ExecutorInput[], options?: FallbackOptions): Executor;
64
+
65
+ // @public (undocumented)
66
+ export type FallbackOptions = {
67
+ shouldFallback?: (error: unknown, executorIndex: number) => boolean | Promise<boolean>;
68
+ onFallback?: (error: unknown, executorIndex: number) => void | Promise<void>;
69
+ };
70
+
71
+ // @public (undocumented)
72
+ export type GoalExecutorOptions = {
73
+ draft: ExecutorInput;
74
+ review: ExecutorInput;
75
+ refine: (request: Program, answer: Program, review: Program, attempt: number) => Program | Promise<Program>;
76
+ satisfied: (review: Program, attempt: number) => boolean | Promise<boolean>;
77
+ maxIterations?: number;
78
+ };
79
+
80
+ // @public (undocumented)
81
+ export function retry(executor: ExecutorInput, options?: RetryOptions): Executor;
82
+
83
+ // @public (undocumented)
84
+ export type RetryOptions = {
85
+ attempts?: number;
86
+ shouldRetry?: (error: unknown, attempt: number) => boolean | Promise<boolean>;
87
+ onRetry?: (error: unknown, attempt: number) => void | Promise<void>;
88
+ };
89
+
90
+ // @public (undocumented)
91
+ type RuntimeContext = {
92
+ cache: Cache_2;
93
+ invoke(executor: ExecutorInput, request: Program): Promise<Program>;
94
+ invokeStream(executor: ExecutorInput, request: Program): AsyncIterable<Program>;
95
+ observe(event: ExecutionEvent): void;
96
+ signal: AbortSignal;
97
+ };
98
+
99
+ // Warnings were encountered during analysis:
100
+ //
101
+ // .reference-build/types/neutrome-lilsdk/src/types.d.ts:25:5 - (ae-forgotten-export) The symbol "CachePutOptions" needs to be exported by the entry point index.d.ts
102
+ // .reference-build/types/neutrome-lilsdk/src/types.d.ts:29:5 - (ae-forgotten-export) The symbol "Cache_2" needs to be exported by the entry point index.d.ts
103
+ // .reference-build/types/neutrome-lilsdk/src/types.d.ts:32:5 - (ae-forgotten-export) The symbol "ExecutionEvent" needs to be exported by the entry point index.d.ts
104
+ // .reference-build/types/neutrome-lilsdk/src/types.d.ts:47:5 - (ae-forgotten-export) The symbol "ExecutorContext" needs to be exported by the entry point index.d.ts
105
+
106
+ // (No @packageDocumentation comment for this package)
107
+
108
+ ```
@@ -0,0 +1,102 @@
1
+ ## API Report File for "neutrome"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import type { Program } from '@neutrome/lil-engine';
8
+ import { ProgramAttachment } from '@neutrome/lil-engine';
9
+
10
+ // @public (undocumented)
11
+ export type AttachmentReaderRule = {
12
+ mimeTypes: readonly string[];
13
+ executor: ExecutorInput;
14
+ };
15
+
16
+ // @public (undocumented)
17
+ export type AttachmentToTextOptions = {
18
+ systemPrompt?: string;
19
+ cacheKey?: (attachment: ProgramAttachment, ctx: ExecutorContext) => string;
20
+ };
21
+
22
+ // @public (undocumented)
23
+ type Cache_2 = {
24
+ get(key: string): Promise<string | null>;
25
+ put(key: string, value: string, options?: CachePutOptions): Promise<void>;
26
+ delete(key: string): Promise<void>;
27
+ };
28
+
29
+ // @public (undocumented)
30
+ type CachePutOptions = {
31
+ expiration?: number;
32
+ expirationTtl?: number;
33
+ };
34
+
35
+ // @public (undocumented)
36
+ export type CapabilitiesExecutorOptions = {
37
+ enabledIterations?: number;
38
+ cacheKey?: (ctx: ExecutorContext) => string;
39
+ skipPrefixes?: readonly string[];
40
+ };
41
+
42
+ // Warning: (ae-forgotten-export) The symbol "Executor" needs to be exported by the entry point index.d.ts
43
+ //
44
+ // @public (undocumented)
45
+ export function createAttachmentToTextExecutor(inner: ExecutorInput, rules: readonly AttachmentReaderRule[], options?: AttachmentToTextOptions): Executor;
46
+
47
+ // @public (undocumented)
48
+ export function createCapabilitiesExecutor(inner: ExecutorInput, options?: CapabilitiesExecutorOptions): Executor;
49
+
50
+ // @public (undocumented)
51
+ type ExecutionEvent = {
52
+ kind: string;
53
+ requestId: string;
54
+ executionId: string;
55
+ timestamp: string;
56
+ parentExecutionId?: string;
57
+ target?: {
58
+ kind: "provider" | "executor";
59
+ id: string;
60
+ };
61
+ errorKind?: string;
62
+ data?: Record<string, unknown>;
63
+ };
64
+
65
+ // @public (undocumented)
66
+ type Executor = {
67
+ execute(request: Program, ctx: ExecutorContext): Promise<Program>;
68
+ stream(request: Program, ctx: ExecutorContext): AsyncIterable<Program>;
69
+ };
70
+
71
+ // Warning: (ae-forgotten-export) The symbol "RuntimeContext" needs to be exported by the entry point index.d.ts
72
+ //
73
+ // @public (undocumented)
74
+ type ExecutorContext = RuntimeContext & {
75
+ requestId: string;
76
+ executionId: string;
77
+ parentExecutionId?: string;
78
+ };
79
+
80
+ // @public (undocumented)
81
+ type ExecutorInput = string | Executor;
82
+
83
+ // @public (undocumented)
84
+ type RuntimeContext = {
85
+ cache: Cache_2;
86
+ invoke(executor: ExecutorInput, request: Program): Promise<Program>;
87
+ invokeStream(executor: ExecutorInput, request: Program): AsyncIterable<Program>;
88
+ observe(event: ExecutionEvent): void;
89
+ signal: AbortSignal;
90
+ };
91
+
92
+ // Warnings were encountered during analysis:
93
+ //
94
+ // .reference-build/types/neutrome-lilsdk/src/managed/attachment-to-text.d.ts:5:5 - (ae-forgotten-export) The symbol "ExecutorInput" needs to be exported by the entry point index.d.ts
95
+ // .reference-build/types/neutrome-lilsdk/src/managed/attachment-to-text.d.ts:9:5 - (ae-forgotten-export) The symbol "ExecutorContext" needs to be exported by the entry point index.d.ts
96
+ // .reference-build/types/neutrome-lilsdk/src/types.d.ts:25:5 - (ae-forgotten-export) The symbol "CachePutOptions" needs to be exported by the entry point index.d.ts
97
+ // .reference-build/types/neutrome-lilsdk/src/types.d.ts:29:5 - (ae-forgotten-export) The symbol "Cache_2" needs to be exported by the entry point index.d.ts
98
+ // .reference-build/types/neutrome-lilsdk/src/types.d.ts:32:5 - (ae-forgotten-export) The symbol "ExecutionEvent" needs to be exported by the entry point index.d.ts
99
+
100
+ // (No @packageDocumentation comment for this package)
101
+
102
+ ```
@@ -0,0 +1,39 @@
1
+ ## API Report File for "neutrome"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { Instruction } from '@neutrome/lil-engine';
8
+ import { Program } from '@neutrome/lil-engine';
9
+
10
+ // @public (undocumented)
11
+ export function all(program: Program, callback: (instruction: Instruction, index: number, program: Program) => boolean): boolean;
12
+
13
+ // @public (undocumented)
14
+ export function any(program: Program, callback: (instruction: Instruction, index: number, program: Program) => boolean): boolean;
15
+
16
+ // @public (undocumented)
17
+ export function filter(program: Program, callback: (instruction: Instruction, index: number, program: Program) => boolean): Program;
18
+
19
+ // @public (undocumented)
20
+ export function find(program: Program, needle: Instruction): Instruction | undefined;
21
+
22
+ // @public (undocumented)
23
+ export function has(program: Program, needle: Instruction): boolean;
24
+
25
+ // @public (undocumented)
26
+ export function indexOf(program: Program, needle: Instruction): number;
27
+
28
+ // @public (undocumented)
29
+ export function map(program: Program, callback: (instruction: Instruction, index: number, program: Program) => Instruction): Program;
30
+
31
+ // @public (undocumented)
32
+ export function reduce<T>(program: Program, callback: (accumulator: T, instruction: Instruction, index: number, program: Program) => T, initialValue: T): T;
33
+
34
+ // @public (undocumented)
35
+ export function walk(program: Program, callback: (instruction: Instruction, index: number, program: Program) => void): void;
36
+
37
+ // (No @packageDocumentation comment for this package)
38
+
39
+ ```
@@ -0,0 +1,55 @@
1
+ ## API Report File for "neutrome"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { Program } from '@neutrome/lil-engine';
8
+
9
+ // @public (undocumented)
10
+ export function completeStream(reason?: string): Program;
11
+
12
+ // @public (undocumented)
13
+ export type ObservedExecution = {
14
+ mode: "text";
15
+ transcript: string;
16
+ emittedText: boolean;
17
+ } | {
18
+ mode: "tool";
19
+ transcript: string;
20
+ emittedText: boolean;
21
+ chunks: Program[];
22
+ };
23
+
24
+ // @public (undocumented)
25
+ export function observeExecutionStream(source: AsyncIterable<Program>, hooks?: StreamObservationHooks): Promise<ObservedExecution>;
26
+
27
+ // @public (undocumented)
28
+ type OutputSink = {
29
+ write(chunk: Program): void | Promise<void>;
30
+ close(): void | Promise<void>;
31
+ };
32
+
33
+ // @public (undocumented)
34
+ export type StreamObservationHooks = {
35
+ onTextStart?: () => void;
36
+ onTextChunk?: (text: string, chunk: Program) => void;
37
+ };
38
+
39
+ // @public (undocumented)
40
+ export function streamReasoningDelta(text: string): Program;
41
+
42
+ // @public
43
+ export function streamStage(source: AsyncIterable<Program>): AsyncGenerator<Program>;
44
+
45
+ // @public (undocumented)
46
+ export function streamTextResponse(text: string): Program[];
47
+
48
+ // Warning: (ae-forgotten-export) The symbol "OutputSink" needs to be exported by the entry point index.d.ts
49
+ //
50
+ // @public (undocumented)
51
+ export function writeReasoning(sink: OutputSink, text: string): Promise<void>;
52
+
53
+ // (No @packageDocumentation comment for this package)
54
+
55
+ ```
@@ -0,0 +1,46 @@
1
+ ## API Report File for "neutrome"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { Program } from '@neutrome/lil-engine';
8
+
9
+ // @public (undocumented)
10
+ export function appendAssistantMessage(program: Program, text: string): Program;
11
+
12
+ // @public (undocumented)
13
+ export function appendToolInteraction(program: Program, interaction: ToolInteraction): Program;
14
+
15
+ // @public (undocumented)
16
+ export function appendUserMessage(program: Program, text: string): Program;
17
+
18
+ // @public (undocumented)
19
+ export function createModelProgram(model: string): Program;
20
+
21
+ // @public (undocumented)
22
+ export function makeMessage(role: TextMessageRole, text: string): Program;
23
+
24
+ // @public (undocumented)
25
+ export function makeToolCall(name: string, args?: unknown, callId?: string): Program;
26
+
27
+ // @public (undocumented)
28
+ export function makeToolResponse(callId: string, result: unknown): Program;
29
+
30
+ // @public (undocumented)
31
+ export function prependSystemPrompt(program: Program, text: string): Program;
32
+
33
+ // @public (undocumented)
34
+ export type TextMessageRole = "system" | "user" | "assistant";
35
+
36
+ // @public (undocumented)
37
+ export type ToolInteraction = {
38
+ callId: string;
39
+ name: string;
40
+ args?: unknown;
41
+ result: unknown;
42
+ };
43
+
44
+ // (No @packageDocumentation comment for this package)
45
+
46
+ ```
@@ -0,0 +1,103 @@
1
+ ## API Report File for "neutrome"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import type { Program } from '@neutrome/lil-engine';
8
+
9
+ // @public (undocumented)
10
+ type Cache_2 = {
11
+ get(key: string): Promise<string | null>;
12
+ put(key: string, value: string, options?: CachePutOptions): Promise<void>;
13
+ delete(key: string): Promise<void>;
14
+ };
15
+
16
+ // @public (undocumented)
17
+ type CachePutOptions = {
18
+ expiration?: number;
19
+ expirationTtl?: number;
20
+ };
21
+
22
+ // Warning: (ae-forgotten-export) The symbol "Tool" needs to be exported by the entry point tools.d.ts
23
+ // Warning: (ae-forgotten-export) The symbol "ExecutorInput" needs to be exported by the entry point tools.d.ts
24
+ // Warning: (ae-forgotten-export) The symbol "Executor" needs to be exported by the entry point tools.d.ts
25
+ //
26
+ // @public (undocumented)
27
+ export function connectTools(tools: Tool[], inner: ExecutorInput, options?: WithToolsOptions): Executor;
28
+
29
+ // @public (undocumented)
30
+ type ExecutionEvent = {
31
+ kind: string;
32
+ requestId: string;
33
+ executionId: string;
34
+ timestamp: string;
35
+ parentExecutionId?: string;
36
+ target?: {
37
+ kind: "provider" | "executor";
38
+ id: string;
39
+ };
40
+ errorKind?: string;
41
+ data?: Record<string, unknown>;
42
+ };
43
+
44
+ // @public (undocumented)
45
+ type Executor = {
46
+ execute(request: Program, ctx: ExecutorContext): Promise<Program>;
47
+ stream(request: Program, ctx: ExecutorContext): AsyncIterable<Program>;
48
+ };
49
+
50
+ // Warning: (ae-forgotten-export) The symbol "RuntimeContext" needs to be exported by the entry point tools.d.ts
51
+ //
52
+ // @public (undocumented)
53
+ type ExecutorContext = RuntimeContext & {
54
+ requestId: string;
55
+ executionId: string;
56
+ parentExecutionId?: string;
57
+ };
58
+
59
+ // @public (undocumented)
60
+ type ExecutorInput = string | Executor;
61
+
62
+ // @public (undocumented)
63
+ type RuntimeContext = {
64
+ cache: Cache_2;
65
+ invoke(executor: ExecutorInput, request: Program): Promise<Program>;
66
+ invokeStream(executor: ExecutorInput, request: Program): AsyncIterable<Program>;
67
+ observe(event: ExecutionEvent): void;
68
+ signal: AbortSignal;
69
+ };
70
+
71
+ // @public (undocumented)
72
+ type Tool = {
73
+ name: string;
74
+ description: string;
75
+ schema: Record<string, unknown>;
76
+ systemPromptFragment?: string;
77
+ execute(args: Record<string, unknown>, ctx: ExecutorContext): Promise<string>;
78
+ };
79
+
80
+ // @public (undocumented)
81
+ export class ToolArgumentsError extends Error {
82
+ constructor(toolName: string, argumentsText: string);
83
+ // (undocumented)
84
+ readonly argumentsText: string;
85
+ // (undocumented)
86
+ readonly toolName: string;
87
+ }
88
+
89
+ // @public (undocumented)
90
+ export type WithToolsOptions = {
91
+ maxIterations?: number;
92
+ };
93
+
94
+ // Warnings were encountered during analysis:
95
+ //
96
+ // .reference-build/types/neutrome-lilsdk/src/types.d.ts:25:5 - (ae-forgotten-export) The symbol "CachePutOptions" needs to be exported by the entry point tools.d.ts
97
+ // .reference-build/types/neutrome-lilsdk/src/types.d.ts:29:5 - (ae-forgotten-export) The symbol "Cache_2" needs to be exported by the entry point tools.d.ts
98
+ // .reference-build/types/neutrome-lilsdk/src/types.d.ts:32:5 - (ae-forgotten-export) The symbol "ExecutionEvent" needs to be exported by the entry point tools.d.ts
99
+ // .reference-build/types/neutrome-lilsdk/src/types.d.ts:47:5 - (ae-forgotten-export) The symbol "ExecutorContext" needs to be exported by the entry point tools.d.ts
100
+
101
+ // (No @packageDocumentation comment for this package)
102
+
103
+ ```
@@ -0,0 +1,103 @@
1
+ ## API Report File for "neutrome"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import type { Program } from '@neutrome/lil-engine';
8
+
9
+ // @public (undocumented)
10
+ type Cache_2 = {
11
+ get(key: string): Promise<string | null>;
12
+ put(key: string, value: string, options?: CachePutOptions): Promise<void>;
13
+ delete(key: string): Promise<void>;
14
+ };
15
+ export { Cache_2 as Cache }
16
+
17
+ // @public (undocumented)
18
+ export type CachePutOptions = {
19
+ expiration?: number;
20
+ expirationTtl?: number;
21
+ };
22
+
23
+ // @public (undocumented)
24
+ export function createExecutionEvent(input: ExecutionEventInput): ExecutionEvent;
25
+
26
+ // @public (undocumented)
27
+ export type ExecutionEvent = {
28
+ kind: string;
29
+ requestId: string;
30
+ executionId: string;
31
+ timestamp: string;
32
+ parentExecutionId?: string;
33
+ target?: {
34
+ kind: "provider" | "executor";
35
+ id: string;
36
+ };
37
+ errorKind?: string;
38
+ data?: Record<string, unknown>;
39
+ };
40
+
41
+ // @public (undocumented)
42
+ export type ExecutionEventInput = Omit<ExecutionEvent, "timestamp"> & {
43
+ timestamp?: string;
44
+ };
45
+
46
+ // @public (undocumented)
47
+ export type Executor = {
48
+ execute(request: Program, ctx: ExecutorContext): Promise<Program>;
49
+ stream(request: Program, ctx: ExecutorContext): AsyncIterable<Program>;
50
+ };
51
+
52
+ // Warning: (ae-forgotten-export) The symbol "RuntimeContext" needs to be exported by the entry point types.d.ts
53
+ //
54
+ // @public (undocumented)
55
+ export type ExecutorContext = RuntimeContext & {
56
+ requestId: string;
57
+ executionId: string;
58
+ parentExecutionId?: string;
59
+ };
60
+
61
+ // @public (undocumented)
62
+ export type ExecutorInput = string | Executor;
63
+
64
+ // @public (undocumented)
65
+ export type OutputSink = {
66
+ write(chunk: Program): void | Promise<void>;
67
+ close(): void | Promise<void>;
68
+ };
69
+
70
+ // @public (undocumented)
71
+ export type ProgramTransform = {
72
+ name: string;
73
+ capabilities: TransformCapability[];
74
+ apply(program: Program, ctx: TransformContext): Program | Promise<Program>;
75
+ };
76
+
77
+ // @public (undocumented)
78
+ type RuntimeContext = {
79
+ cache: Cache_2;
80
+ invoke(executor: ExecutorInput, request: Program): Promise<Program>;
81
+ invokeStream(executor: ExecutorInput, request: Program): AsyncIterable<Program>;
82
+ observe(event: ExecutionEvent): void;
83
+ signal: AbortSignal;
84
+ };
85
+
86
+ // @public (undocumented)
87
+ export type Tool = {
88
+ name: string;
89
+ description: string;
90
+ schema: Record<string, unknown>;
91
+ systemPromptFragment?: string;
92
+ execute(args: Record<string, unknown>, ctx: ExecutorContext): Promise<string>;
93
+ };
94
+
95
+ // @public (undocumented)
96
+ export type TransformCapability = "read_messages" | "write_messages" | "write_config" | "write_tools" | "drop_content" | "provider_extension";
97
+
98
+ // @public (undocumented)
99
+ export type TransformContext = RuntimeContext;
100
+
101
+ // (No @packageDocumentation comment for this package)
102
+
103
+ ```