@neutrome/lilsdk 0.4.6 → 0.5.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/README.md +24 -17
- package/etc/api/index.api.md +96 -103
- package/etc/api/loops.api.md +108 -108
- package/etc/api/managed.api.md +102 -102
- package/etc/api/primitives.api.md +39 -39
- package/etc/api/stream.api.md +46 -55
- package/etc/api/tools.api.md +103 -103
- package/package.json +8 -10
- package/src/index.ts +41 -15
- package/src/loops/goal.ts +111 -0
- package/src/loops/index.ts +41 -110
- package/src/loops/shared.ts +27 -0
- package/src/managed/attachment-to-text.ts +35 -11
- package/src/managed/capabilities.ts +42 -22
- package/src/observe.ts +21 -6
- package/src/output.ts +13 -25
- package/src/primitives/index.ts +69 -0
- package/src/stream/index.ts +2 -6
- package/src/stream/stages.ts +15 -11
- package/src/tools-support.ts +9 -3
- package/src/tools.ts +36 -19
- package/src/types.ts +129 -4
- package/test/lilsdk-ts.test.ts +47 -45
- package/test/tools.test.ts +22 -20
- package/etc/api/synthetic.api.md +0 -46
- package/etc/api/types.api.md +0 -103
- package/src/synthetic/index.ts +0 -134
package/etc/api/managed.api.md
CHANGED
|
@@ -1,102 +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
|
|
11
|
-
export type AttachmentReaderRule = {
|
|
12
|
-
mimeTypes: readonly string[];
|
|
13
|
-
executor: ExecutorInput;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
// @public
|
|
17
|
-
export type AttachmentToTextOptions = {
|
|
18
|
-
systemPrompt?: string;
|
|
19
|
-
cacheKey?: (attachment: ProgramAttachment, ctx: ExecutorContext) => string;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
// @public
|
|
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
|
|
30
|
-
type CachePutOptions = {
|
|
31
|
-
expiration?: number;
|
|
32
|
-
expirationTtl?: number;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
// @public
|
|
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
|
|
45
|
-
export function createAttachmentToTextExecutor(inner: ExecutorInput, rules: readonly AttachmentReaderRule[], options?: AttachmentToTextOptions): Executor;
|
|
46
|
-
|
|
47
|
-
// @public
|
|
48
|
-
export function createCapabilitiesExecutor(inner: ExecutorInput, options?: CapabilitiesExecutorOptions): Executor;
|
|
49
|
-
|
|
50
|
-
// @public
|
|
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
|
|
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
|
|
74
|
-
type ExecutorContext = RuntimeContext & {
|
|
75
|
-
requestId: string;
|
|
76
|
-
executionId: string;
|
|
77
|
-
parentExecutionId?: string;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
// @public
|
|
81
|
-
type ExecutorInput = string | Executor;
|
|
82
|
-
|
|
83
|
-
// @public
|
|
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:
|
|
95
|
-
// .reference-build/types/neutrome-lilsdk/src/managed/attachment-to-text.d.ts:
|
|
96
|
-
// .reference-build/types/neutrome-lilsdk/src/types.d.ts:
|
|
97
|
-
// .reference-build/types/neutrome-lilsdk/src/types.d.ts:
|
|
98
|
-
// .reference-build/types/neutrome-lilsdk/src/types.d.ts:
|
|
99
|
-
|
|
100
|
-
// (No @packageDocumentation comment for this package)
|
|
101
|
-
|
|
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
|
|
11
|
+
export type AttachmentReaderRule = {
|
|
12
|
+
mimeTypes: readonly string[];
|
|
13
|
+
executor: ExecutorInput;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// @public
|
|
17
|
+
export type AttachmentToTextOptions = {
|
|
18
|
+
systemPrompt?: string;
|
|
19
|
+
cacheKey?: (attachment: ProgramAttachment, ctx: ExecutorContext) => string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// @public
|
|
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
|
|
30
|
+
type CachePutOptions = {
|
|
31
|
+
expiration?: number;
|
|
32
|
+
expirationTtl?: number;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// @public
|
|
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
|
|
45
|
+
export function createAttachmentToTextExecutor(inner: ExecutorInput, rules: readonly AttachmentReaderRule[], options?: AttachmentToTextOptions): Executor;
|
|
46
|
+
|
|
47
|
+
// @public
|
|
48
|
+
export function createCapabilitiesExecutor(inner: ExecutorInput, options?: CapabilitiesExecutorOptions): Executor;
|
|
49
|
+
|
|
50
|
+
// @public
|
|
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
|
|
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
|
|
74
|
+
type ExecutorContext = RuntimeContext & {
|
|
75
|
+
requestId: string;
|
|
76
|
+
executionId: string;
|
|
77
|
+
parentExecutionId?: string;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// @public
|
|
81
|
+
type ExecutorInput = string | Executor;
|
|
82
|
+
|
|
83
|
+
// @public
|
|
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:8: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:15: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:42: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:55: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:77: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
|
+
```
|
|
@@ -1,39 +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
|
|
11
|
-
export function all(program: Program, callback: (instruction: Instruction, index: number, program: Program) => boolean): boolean;
|
|
12
|
-
|
|
13
|
-
// @public
|
|
14
|
-
export function any(program: Program, callback: (instruction: Instruction, index: number, program: Program) => boolean): boolean;
|
|
15
|
-
|
|
16
|
-
// @public
|
|
17
|
-
export function filter(program: Program, callback: (instruction: Instruction, index: number, program: Program) => boolean): Program;
|
|
18
|
-
|
|
19
|
-
// @public
|
|
20
|
-
export function find(program: Program, needle: Instruction): Instruction | undefined;
|
|
21
|
-
|
|
22
|
-
// @public
|
|
23
|
-
export function has(program: Program, needle: Instruction): boolean;
|
|
24
|
-
|
|
25
|
-
// @public
|
|
26
|
-
export function indexOf(program: Program, needle: Instruction): number;
|
|
27
|
-
|
|
28
|
-
// @public
|
|
29
|
-
export function map(program: Program, callback: (instruction: Instruction, index: number, program: Program) => Instruction): Program;
|
|
30
|
-
|
|
31
|
-
// @public
|
|
32
|
-
export function reduce<T>(program: Program, callback: (accumulator: T, instruction: Instruction, index: number, program: Program) => T, initialValue: T): T;
|
|
33
|
-
|
|
34
|
-
// @public
|
|
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
|
-
```
|
|
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
|
|
11
|
+
export function all(program: Program, callback: (instruction: Instruction, index: number, program: Program) => boolean): boolean;
|
|
12
|
+
|
|
13
|
+
// @public
|
|
14
|
+
export function any(program: Program, callback: (instruction: Instruction, index: number, program: Program) => boolean): boolean;
|
|
15
|
+
|
|
16
|
+
// @public
|
|
17
|
+
export function filter(program: Program, callback: (instruction: Instruction, index: number, program: Program) => boolean): Program;
|
|
18
|
+
|
|
19
|
+
// @public
|
|
20
|
+
export function find(program: Program, needle: Instruction): Instruction | undefined;
|
|
21
|
+
|
|
22
|
+
// @public
|
|
23
|
+
export function has(program: Program, needle: Instruction): boolean;
|
|
24
|
+
|
|
25
|
+
// @public
|
|
26
|
+
export function indexOf(program: Program, needle: Instruction): number;
|
|
27
|
+
|
|
28
|
+
// @public
|
|
29
|
+
export function map(program: Program, callback: (instruction: Instruction, index: number, program: Program) => Instruction): Program;
|
|
30
|
+
|
|
31
|
+
// @public
|
|
32
|
+
export function reduce<T>(program: Program, callback: (accumulator: T, instruction: Instruction, index: number, program: Program) => T, initialValue: T): T;
|
|
33
|
+
|
|
34
|
+
// @public
|
|
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
|
+
```
|
package/etc/api/stream.api.md
CHANGED
|
@@ -1,55 +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
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// @public
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
//
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
```
|
|
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
|
|
10
|
+
export type ObservedExecution = {
|
|
11
|
+
mode: "text";
|
|
12
|
+
transcript: string;
|
|
13
|
+
emittedText: boolean;
|
|
14
|
+
} | {
|
|
15
|
+
mode: "tool";
|
|
16
|
+
transcript: string;
|
|
17
|
+
emittedText: boolean;
|
|
18
|
+
chunks: Program[];
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// @public
|
|
22
|
+
export function observeExecutionStream(source: AsyncIterable<Program>, hooks?: StreamObservationHooks): Promise<ObservedExecution>;
|
|
23
|
+
|
|
24
|
+
// @public
|
|
25
|
+
type OutputSink = {
|
|
26
|
+
write(chunk: Program): void | Promise<void>;
|
|
27
|
+
close(): void | Promise<void>;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// @public
|
|
31
|
+
export type StreamObservationHooks = {
|
|
32
|
+
onTextStart?: () => void;
|
|
33
|
+
onTextChunk?: (text: string, chunk: Program) => void;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// @public
|
|
37
|
+
export function streamStage(source: AsyncIterable<Program>): AsyncGenerator<Program>;
|
|
38
|
+
|
|
39
|
+
// Warning: (ae-forgotten-export) The symbol "OutputSink" needs to be exported by the entry point index.d.ts
|
|
40
|
+
//
|
|
41
|
+
// @public
|
|
42
|
+
export function writeThinking(sink: OutputSink, text: string): Promise<void>;
|
|
43
|
+
|
|
44
|
+
// (No @packageDocumentation comment for this package)
|
|
45
|
+
|
|
46
|
+
```
|
package/etc/api/tools.api.md
CHANGED
|
@@ -1,103 +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
|
|
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
|
|
17
|
-
type CachePutOptions = {
|
|
18
|
-
expiration?: number;
|
|
19
|
-
expirationTtl?: number;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
// Warning: (ae-forgotten-export) The symbol "
|
|
23
|
-
// Warning: (ae-forgotten-export) The symbol "
|
|
24
|
-
// Warning: (ae-forgotten-export) The symbol "Executor" needs to be exported by the entry point tools.d.ts
|
|
25
|
-
//
|
|
26
|
-
// @public
|
|
27
|
-
export function
|
|
28
|
-
|
|
29
|
-
// @public
|
|
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
|
|
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
|
|
53
|
-
type ExecutorContext = RuntimeContext & {
|
|
54
|
-
requestId: string;
|
|
55
|
-
executionId: string;
|
|
56
|
-
parentExecutionId?: string;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
// @public
|
|
60
|
-
type ExecutorInput = string | Executor;
|
|
61
|
-
|
|
62
|
-
// @public
|
|
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
|
|
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
|
|
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
|
|
90
|
-
export type
|
|
91
|
-
maxIterations?: number;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
// Warnings were encountered during analysis:
|
|
95
|
-
//
|
|
96
|
-
// .reference-build/types/neutrome-lilsdk/src/types.d.ts:
|
|
97
|
-
// .reference-build/types/neutrome-lilsdk/src/types.d.ts:
|
|
98
|
-
// .reference-build/types/neutrome-lilsdk/src/types.d.ts:
|
|
99
|
-
// .reference-build/types/neutrome-lilsdk/src/types.d.ts:
|
|
100
|
-
|
|
101
|
-
// (No @packageDocumentation comment for this package)
|
|
102
|
-
|
|
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
|
|
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
|
|
17
|
+
type CachePutOptions = {
|
|
18
|
+
expiration?: number;
|
|
19
|
+
expirationTtl?: number;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// Warning: (ae-forgotten-export) The symbol "ExecutorInput" needs to be exported by the entry point tools.d.ts
|
|
23
|
+
// Warning: (ae-forgotten-export) The symbol "Tool" 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
|
|
27
|
+
export function createToolsExecutor(inner: ExecutorInput, tools: Tool[], options?: ToolsExecutorOptions): Executor;
|
|
28
|
+
|
|
29
|
+
// @public
|
|
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
|
|
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
|
|
53
|
+
type ExecutorContext = RuntimeContext & {
|
|
54
|
+
requestId: string;
|
|
55
|
+
executionId: string;
|
|
56
|
+
parentExecutionId?: string;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// @public
|
|
60
|
+
type ExecutorInput = string | Executor;
|
|
61
|
+
|
|
62
|
+
// @public
|
|
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
|
|
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
|
|
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
|
|
90
|
+
export type ToolsExecutorOptions = {
|
|
91
|
+
maxIterations?: number;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
// Warnings were encountered during analysis:
|
|
95
|
+
//
|
|
96
|
+
// .reference-build/types/neutrome-lilsdk/src/types.d.ts:42: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:55: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:77: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:131: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
|
+
```
|
package/package.json
CHANGED
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neutrome/lilsdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./src/index.ts",
|
|
7
|
-
"./types": "./src/types.ts",
|
|
8
7
|
"./primitives": "./src/primitives/index.ts",
|
|
9
|
-
"./synthetic": "./src/synthetic/index.ts",
|
|
10
8
|
"./stream": "./src/stream/index.ts",
|
|
11
9
|
"./tools": "./src/tools.ts",
|
|
12
10
|
"./loops": "./src/loops/index.ts",
|
|
13
11
|
"./managed": "./src/managed/index.ts"
|
|
14
12
|
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"test": "vitest run",
|
|
15
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
16
|
+
"npm:publish": "pnpm publish --no-git-checks"
|
|
17
|
+
},
|
|
15
18
|
"dependencies": {
|
|
16
|
-
"@neutrome/lil-engine": "
|
|
19
|
+
"@neutrome/lil-engine": "workspace:*"
|
|
17
20
|
},
|
|
18
21
|
"devDependencies": {
|
|
19
22
|
"@types/node": "^25.9.3",
|
|
20
23
|
"typescript": "^6.0.3",
|
|
21
24
|
"vitest": "^4.1.6"
|
|
22
|
-
},
|
|
23
|
-
"scripts": {
|
|
24
|
-
"test": "vitest run",
|
|
25
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
26
|
-
"npm:publish": "pnpm publish --no-git-checks"
|
|
27
25
|
}
|
|
28
|
-
}
|
|
26
|
+
}
|