@xandout/libra-harness 0.1.119 → 0.1.120
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/extensions/loader.d.ts +10 -10
- package/dist/extensions/loader.js +10 -10
- package/package.json +2 -65
- package/dist/extensions/auto-steer/extension.d.ts +0 -46
- package/dist/extensions/auto-steer/extension.d.ts.map +0 -1
- package/dist/extensions/auto-steer/extension.js +0 -52
- package/dist/extensions/auto-steer/extension.js.map +0 -1
- package/dist/extensions/auto-steer/extension.json +0 -7
- package/dist/extensions/auto-steer/index.d.ts +0 -3
- package/dist/extensions/auto-steer/index.d.ts.map +0 -1
- package/dist/extensions/auto-steer/index.js +0 -2
- package/dist/extensions/auto-steer/index.js.map +0 -1
- package/dist/extensions/emoji/extension.d.ts +0 -20
- package/dist/extensions/emoji/extension.d.ts.map +0 -1
- package/dist/extensions/emoji/extension.js +0 -22
- package/dist/extensions/emoji/extension.js.map +0 -1
- package/dist/extensions/emoji/extension.json +0 -7
- package/dist/extensions/emoji/index.d.ts +0 -3
- package/dist/extensions/emoji/index.d.ts.map +0 -1
- package/dist/extensions/emoji/index.js +0 -2
- package/dist/extensions/emoji/index.js.map +0 -1
- package/dist/extensions/filesystem/extension.d.ts +0 -53
- package/dist/extensions/filesystem/extension.d.ts.map +0 -1
- package/dist/extensions/filesystem/extension.js +0 -350
- package/dist/extensions/filesystem/extension.js.map +0 -1
- package/dist/extensions/filesystem/extension.json +0 -6
- package/dist/extensions/filesystem/extension.test.d.ts +0 -2
- package/dist/extensions/filesystem/extension.test.d.ts.map +0 -1
- package/dist/extensions/filesystem/extension.test.js +0 -387
- package/dist/extensions/filesystem/extension.test.js.map +0 -1
- package/dist/extensions/filesystem/index.d.ts +0 -2
- package/dist/extensions/filesystem/index.d.ts.map +0 -1
- package/dist/extensions/filesystem/index.js +0 -2
- package/dist/extensions/filesystem/index.js.map +0 -1
- package/dist/extensions/keyword-extractor/extension.d.ts +0 -53
- package/dist/extensions/keyword-extractor/extension.d.ts.map +0 -1
- package/dist/extensions/keyword-extractor/extension.js +0 -61
- package/dist/extensions/keyword-extractor/extension.js.map +0 -1
- package/dist/extensions/keyword-extractor/extension.json +0 -6
- package/dist/extensions/keyword-extractor/extension.test.d.ts +0 -2
- package/dist/extensions/keyword-extractor/extension.test.d.ts.map +0 -1
- package/dist/extensions/keyword-extractor/extension.test.js +0 -105
- package/dist/extensions/keyword-extractor/extension.test.js.map +0 -1
- package/dist/extensions/keyword-extractor/index.d.ts +0 -5
- package/dist/extensions/keyword-extractor/index.d.ts.map +0 -1
- package/dist/extensions/keyword-extractor/index.js +0 -3
- package/dist/extensions/keyword-extractor/index.js.map +0 -1
- package/dist/extensions/keyword-extractor/nlp.d.ts +0 -68
- package/dist/extensions/keyword-extractor/nlp.d.ts.map +0 -1
- package/dist/extensions/keyword-extractor/nlp.js +0 -156
- package/dist/extensions/keyword-extractor/nlp.js.map +0 -1
- package/dist/extensions/keyword-extractor/nlp.test.d.ts +0 -2
- package/dist/extensions/keyword-extractor/nlp.test.d.ts.map +0 -1
- package/dist/extensions/keyword-extractor/nlp.test.js +0 -176
- package/dist/extensions/keyword-extractor/nlp.test.js.map +0 -1
- package/dist/extensions/logger/extension.d.ts +0 -52
- package/dist/extensions/logger/extension.d.ts.map +0 -1
- package/dist/extensions/logger/extension.js +0 -68
- package/dist/extensions/logger/extension.js.map +0 -1
- package/dist/extensions/logger/extension.json +0 -7
- package/dist/extensions/logger/index.d.ts +0 -3
- package/dist/extensions/logger/index.d.ts.map +0 -1
- package/dist/extensions/logger/index.js +0 -2
- package/dist/extensions/logger/index.js.map +0 -1
- package/dist/extensions/mcp/extension.d.ts +0 -63
- package/dist/extensions/mcp/extension.d.ts.map +0 -1
- package/dist/extensions/mcp/extension.js +0 -437
- package/dist/extensions/mcp/extension.js.map +0 -1
- package/dist/extensions/mcp/extension.json +0 -7
- package/dist/extensions/mcp/extension.test.d.ts +0 -2
- package/dist/extensions/mcp/extension.test.d.ts.map +0 -1
- package/dist/extensions/mcp/extension.test.js +0 -286
- package/dist/extensions/mcp/extension.test.js.map +0 -1
- package/dist/extensions/mcp/index.d.ts +0 -3
- package/dist/extensions/mcp/index.d.ts.map +0 -1
- package/dist/extensions/mcp/index.js +0 -2
- package/dist/extensions/mcp/index.js.map +0 -1
- package/dist/extensions/mem-session/extension.d.ts +0 -24
- package/dist/extensions/mem-session/extension.d.ts.map +0 -1
- package/dist/extensions/mem-session/extension.js +0 -49
- package/dist/extensions/mem-session/extension.js.map +0 -1
- package/dist/extensions/mem-session/extension.json +0 -6
- package/dist/extensions/mem-session/index.d.ts +0 -2
- package/dist/extensions/mem-session/index.d.ts.map +0 -1
- package/dist/extensions/mem-session/index.js +0 -2
- package/dist/extensions/mem-session/index.js.map +0 -1
- package/dist/extensions/memory/extension.d.ts +0 -54
- package/dist/extensions/memory/extension.d.ts.map +0 -1
- package/dist/extensions/memory/extension.js +0 -143
- package/dist/extensions/memory/extension.js.map +0 -1
- package/dist/extensions/memory/extension.json +0 -7
- package/dist/extensions/memory/index.d.ts +0 -4
- package/dist/extensions/memory/index.d.ts.map +0 -1
- package/dist/extensions/memory/index.js +0 -3
- package/dist/extensions/memory/index.js.map +0 -1
- package/dist/extensions/memory/llm-extractor.d.ts +0 -42
- package/dist/extensions/memory/llm-extractor.d.ts.map +0 -1
- package/dist/extensions/memory/llm-extractor.js +0 -86
- package/dist/extensions/memory/llm-extractor.js.map +0 -1
- package/dist/extensions/memory/types.d.ts +0 -142
- package/dist/extensions/memory/types.d.ts.map +0 -1
- package/dist/extensions/memory/types.js +0 -2
- package/dist/extensions/memory/types.js.map +0 -1
- package/dist/extensions/otel/extension.d.ts +0 -57
- package/dist/extensions/otel/extension.d.ts.map +0 -1
- package/dist/extensions/otel/extension.js +0 -253
- package/dist/extensions/otel/extension.js.map +0 -1
- package/dist/extensions/otel/extension.json +0 -7
- package/dist/extensions/otel/extension.test.d.ts +0 -2
- package/dist/extensions/otel/extension.test.d.ts.map +0 -1
- package/dist/extensions/otel/extension.test.js +0 -399
- package/dist/extensions/otel/extension.test.js.map +0 -1
- package/dist/extensions/otel/index.d.ts +0 -4
- package/dist/extensions/otel/index.d.ts.map +0 -1
- package/dist/extensions/otel/index.js +0 -3
- package/dist/extensions/otel/index.js.map +0 -1
- package/dist/extensions/otel/jsonl-span-exporter.d.ts +0 -60
- package/dist/extensions/otel/jsonl-span-exporter.d.ts.map +0 -1
- package/dist/extensions/otel/jsonl-span-exporter.js +0 -134
- package/dist/extensions/otel/jsonl-span-exporter.js.map +0 -1
- package/dist/extensions/scripts/extension.d.ts +0 -180
- package/dist/extensions/scripts/extension.d.ts.map +0 -1
- package/dist/extensions/scripts/extension.js +0 -618
- package/dist/extensions/scripts/extension.js.map +0 -1
- package/dist/extensions/scripts/extension.json +0 -7
- package/dist/extensions/scripts/extension.test.d.ts +0 -2
- package/dist/extensions/scripts/extension.test.d.ts.map +0 -1
- package/dist/extensions/scripts/extension.test.js +0 -552
- package/dist/extensions/scripts/extension.test.js.map +0 -1
- package/dist/extensions/scripts/index.d.ts +0 -3
- package/dist/extensions/scripts/index.d.ts.map +0 -1
- package/dist/extensions/scripts/index.js +0 -2
- package/dist/extensions/scripts/index.js.map +0 -1
- package/dist/extensions/structured-output/extension.d.ts +0 -9
- package/dist/extensions/structured-output/extension.d.ts.map +0 -1
- package/dist/extensions/structured-output/extension.js +0 -93
- package/dist/extensions/structured-output/extension.js.map +0 -1
- package/dist/extensions/structured-output/extension.json +0 -7
- package/dist/extensions/structured-output/index.d.ts +0 -3
- package/dist/extensions/structured-output/index.d.ts.map +0 -1
- package/dist/extensions/structured-output/index.js +0 -2
- package/dist/extensions/structured-output/index.js.map +0 -1
- package/dist/extensions/timestamp/extension.d.ts +0 -11
- package/dist/extensions/timestamp/extension.d.ts.map +0 -1
- package/dist/extensions/timestamp/extension.js +0 -21
- package/dist/extensions/timestamp/extension.js.map +0 -1
- package/dist/extensions/timestamp/extension.json +0 -6
- package/dist/extensions/timestamp/index.d.ts +0 -2
- package/dist/extensions/timestamp/index.d.ts.map +0 -1
- package/dist/extensions/timestamp/index.js +0 -2
- package/dist/extensions/timestamp/index.js.map +0 -1
- package/dist/extensions/token-stats/extension.d.ts +0 -50
- package/dist/extensions/token-stats/extension.d.ts.map +0 -1
- package/dist/extensions/token-stats/extension.js +0 -99
- package/dist/extensions/token-stats/extension.js.map +0 -1
- package/dist/extensions/token-stats/extension.json +0 -7
- package/dist/extensions/token-stats/extension.test.d.ts +0 -2
- package/dist/extensions/token-stats/extension.test.d.ts.map +0 -1
- package/dist/extensions/token-stats/extension.test.js +0 -197
- package/dist/extensions/token-stats/extension.test.js.map +0 -1
- package/dist/extensions/token-stats/index.d.ts +0 -3
- package/dist/extensions/token-stats/index.d.ts.map +0 -1
- package/dist/extensions/token-stats/index.js +0 -2
- package/dist/extensions/token-stats/index.js.map +0 -1
- package/dist/extensions/tool-buffer/extension.d.ts +0 -89
- package/dist/extensions/tool-buffer/extension.d.ts.map +0 -1
- package/dist/extensions/tool-buffer/extension.js +0 -182
- package/dist/extensions/tool-buffer/extension.js.map +0 -1
- package/dist/extensions/tool-buffer/extension.json +0 -7
- package/dist/extensions/tool-buffer/extension.test.d.ts +0 -2
- package/dist/extensions/tool-buffer/extension.test.d.ts.map +0 -1
- package/dist/extensions/tool-buffer/extension.test.js +0 -549
- package/dist/extensions/tool-buffer/extension.test.js.map +0 -1
- package/dist/extensions/tool-buffer/index.d.ts +0 -3
- package/dist/extensions/tool-buffer/index.d.ts.map +0 -1
- package/dist/extensions/tool-buffer/index.js +0 -2
- package/dist/extensions/tool-buffer/index.js.map +0 -1
- package/dist/extensions/weather-tool/extension.d.ts +0 -22
- package/dist/extensions/weather-tool/extension.d.ts.map +0 -1
- package/dist/extensions/weather-tool/extension.js +0 -33
- package/dist/extensions/weather-tool/extension.js.map +0 -1
- package/dist/extensions/weather-tool/extension.json +0 -7
- package/dist/extensions/weather-tool/index.d.ts +0 -3
- package/dist/extensions/weather-tool/index.d.ts.map +0 -1
- package/dist/extensions/weather-tool/index.js +0 -2
- package/dist/extensions/weather-tool/index.js.map +0 -1
|
@@ -5,21 +5,21 @@ import type { Extension } from '../extension.js';
|
|
|
5
5
|
* Computed at runtime from `import.meta.url`, so it always resolves to
|
|
6
6
|
* the correct location regardless of where libra is installed.
|
|
7
7
|
*
|
|
8
|
-
* Use with {@link loadExtensions} to load built-in extensions (
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* Use with {@link loadExtensions} to load built-in extensions (disk-session,
|
|
9
|
+
* code-tools, streaming, skills) alongside your own local extensions in a
|
|
10
|
+
* single call:
|
|
11
11
|
*
|
|
12
12
|
* ```typescript
|
|
13
|
-
* import { loadExtensions, sharedExtensionsDir } from '@xandout/libra-harness/
|
|
13
|
+
* import { loadExtensions, sharedExtensionsDir } from '@xandout/libra-harness/extensions';
|
|
14
14
|
*
|
|
15
15
|
* const loaded = await loadExtensions(
|
|
16
16
|
* [sharedExtensionsDir, './extensions'],
|
|
17
|
-
* { skillsDirs: './skills'
|
|
17
|
+
* { skillsDirs: './skills' },
|
|
18
18
|
* );
|
|
19
19
|
* ```
|
|
20
20
|
*
|
|
21
21
|
* For simpler cases, you can also import individual extensions directly:
|
|
22
|
-
* `import {
|
|
22
|
+
* `import { createDiskSessionExtension } from '@xandout/libra-harness/extensions/disk-session'`.
|
|
23
23
|
*/
|
|
24
24
|
export declare const sharedExtensionsDir: string;
|
|
25
25
|
/**
|
|
@@ -149,12 +149,12 @@ export type ExtensionInput = string | ExtensionFactory | Extension;
|
|
|
149
149
|
*
|
|
150
150
|
* @example
|
|
151
151
|
* // Mix built-in factories with local directory discovery.
|
|
152
|
-
* import {
|
|
153
|
-
* import {
|
|
152
|
+
* import { createDiskSessionExtension } from '@xandout/libra-harness/extensions/disk-session';
|
|
153
|
+
* import { createStreamingExtension } from '@xandout/libra-harness/extensions/streaming';
|
|
154
154
|
*
|
|
155
155
|
* const loaded = await loadExtensions(
|
|
156
|
-
* [
|
|
157
|
-
* {
|
|
156
|
+
* [createDiskSessionExtension, createStreamingExtension, './extensions'],
|
|
157
|
+
* { skillsDirs: './skills' },
|
|
158
158
|
* );
|
|
159
159
|
*
|
|
160
160
|
* @example
|
|
@@ -7,21 +7,21 @@ import { pathToFileURL, fileURLToPath } from 'node:url';
|
|
|
7
7
|
* Computed at runtime from `import.meta.url`, so it always resolves to
|
|
8
8
|
* the correct location regardless of where libra is installed.
|
|
9
9
|
*
|
|
10
|
-
* Use with {@link loadExtensions} to load built-in extensions (
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* Use with {@link loadExtensions} to load built-in extensions (disk-session,
|
|
11
|
+
* code-tools, streaming, skills) alongside your own local extensions in a
|
|
12
|
+
* single call:
|
|
13
13
|
*
|
|
14
14
|
* ```typescript
|
|
15
|
-
* import { loadExtensions, sharedExtensionsDir } from '@xandout/libra-harness/
|
|
15
|
+
* import { loadExtensions, sharedExtensionsDir } from '@xandout/libra-harness/extensions';
|
|
16
16
|
*
|
|
17
17
|
* const loaded = await loadExtensions(
|
|
18
18
|
* [sharedExtensionsDir, './extensions'],
|
|
19
|
-
* { skillsDirs: './skills'
|
|
19
|
+
* { skillsDirs: './skills' },
|
|
20
20
|
* );
|
|
21
21
|
* ```
|
|
22
22
|
*
|
|
23
23
|
* For simpler cases, you can also import individual extensions directly:
|
|
24
|
-
* `import {
|
|
24
|
+
* `import { createDiskSessionExtension } from '@xandout/libra-harness/extensions/disk-session'`.
|
|
25
25
|
*/
|
|
26
26
|
export const sharedExtensionsDir = fileURLToPath(new URL('.', import.meta.url));
|
|
27
27
|
/** Entry-point filenames tried in order. */
|
|
@@ -170,12 +170,12 @@ export async function loadExtension(discovered, config) {
|
|
|
170
170
|
*
|
|
171
171
|
* @example
|
|
172
172
|
* // Mix built-in factories with local directory discovery.
|
|
173
|
-
* import {
|
|
174
|
-
* import {
|
|
173
|
+
* import { createDiskSessionExtension } from '@xandout/libra-harness/extensions/disk-session';
|
|
174
|
+
* import { createStreamingExtension } from '@xandout/libra-harness/extensions/streaming';
|
|
175
175
|
*
|
|
176
176
|
* const loaded = await loadExtensions(
|
|
177
|
-
* [
|
|
178
|
-
* {
|
|
177
|
+
* [createDiskSessionExtension, createStreamingExtension, './extensions'],
|
|
178
|
+
* { skillsDirs: './skills' },
|
|
179
179
|
* );
|
|
180
180
|
*
|
|
181
181
|
* @example
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xandout/libra-harness",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.120",
|
|
4
4
|
"description": "A small, composable, hookable agent harness. Library-first.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -38,30 +38,10 @@
|
|
|
38
38
|
"types": "./dist/openai-provider/index.d.ts",
|
|
39
39
|
"import": "./dist/openai-provider/index.js"
|
|
40
40
|
},
|
|
41
|
-
"./extensions/logger": {
|
|
42
|
-
"types": "./dist/extensions/logger/index.d.ts",
|
|
43
|
-
"import": "./dist/extensions/logger/index.js"
|
|
44
|
-
},
|
|
45
41
|
"./extensions/disk-session": {
|
|
46
42
|
"types": "./dist/extensions/disk-session/index.d.ts",
|
|
47
43
|
"import": "./dist/extensions/disk-session/index.js"
|
|
48
44
|
},
|
|
49
|
-
"./extensions/mem-session": {
|
|
50
|
-
"types": "./dist/extensions/mem-session/index.d.ts",
|
|
51
|
-
"import": "./dist/extensions/mem-session/index.js"
|
|
52
|
-
},
|
|
53
|
-
"./extensions/timestamp": {
|
|
54
|
-
"types": "./dist/extensions/timestamp/index.d.ts",
|
|
55
|
-
"import": "./dist/extensions/timestamp/index.js"
|
|
56
|
-
},
|
|
57
|
-
"./extensions/emoji": {
|
|
58
|
-
"types": "./dist/extensions/emoji/index.d.ts",
|
|
59
|
-
"import": "./dist/extensions/emoji/index.js"
|
|
60
|
-
},
|
|
61
|
-
"./extensions/weather-tool": {
|
|
62
|
-
"types": "./dist/extensions/weather-tool/index.d.ts",
|
|
63
|
-
"import": "./dist/extensions/weather-tool/index.js"
|
|
64
|
-
},
|
|
65
45
|
"./extensions/code-tools": {
|
|
66
46
|
"types": "./dist/extensions/code-tools/index.d.ts",
|
|
67
47
|
"import": "./dist/extensions/code-tools/index.js"
|
|
@@ -70,46 +50,10 @@
|
|
|
70
50
|
"types": "./dist/extensions/streaming/index.d.ts",
|
|
71
51
|
"import": "./dist/extensions/streaming/index.js"
|
|
72
52
|
},
|
|
73
|
-
"./extensions/structured-output": {
|
|
74
|
-
"types": "./dist/extensions/structured-output/index.d.ts",
|
|
75
|
-
"import": "./dist/extensions/structured-output/index.js"
|
|
76
|
-
},
|
|
77
|
-
"./extensions/mcp": {
|
|
78
|
-
"types": "./dist/extensions/mcp/index.d.ts",
|
|
79
|
-
"import": "./dist/extensions/mcp/index.js"
|
|
80
|
-
},
|
|
81
53
|
"./extensions/skills": {
|
|
82
54
|
"types": "./dist/extensions/skills/index.d.ts",
|
|
83
55
|
"import": "./dist/extensions/skills/index.js"
|
|
84
56
|
},
|
|
85
|
-
"./extensions/auto-steer": {
|
|
86
|
-
"types": "./dist/extensions/auto-steer/index.d.ts",
|
|
87
|
-
"import": "./dist/extensions/auto-steer/index.js"
|
|
88
|
-
},
|
|
89
|
-
"./extensions/filesystem": {
|
|
90
|
-
"types": "./dist/extensions/filesystem/index.d.ts",
|
|
91
|
-
"import": "./dist/extensions/filesystem/index.js"
|
|
92
|
-
},
|
|
93
|
-
"./extensions/keyword-extractor": {
|
|
94
|
-
"types": "./dist/extensions/keyword-extractor/index.d.ts",
|
|
95
|
-
"import": "./dist/extensions/keyword-extractor/index.js"
|
|
96
|
-
},
|
|
97
|
-
"./extensions/otel": {
|
|
98
|
-
"types": "./dist/extensions/otel/index.d.ts",
|
|
99
|
-
"import": "./dist/extensions/otel/index.js"
|
|
100
|
-
},
|
|
101
|
-
"./extensions/tool-buffer": {
|
|
102
|
-
"types": "./dist/extensions/tool-buffer/index.d.ts",
|
|
103
|
-
"import": "./dist/extensions/tool-buffer/index.js"
|
|
104
|
-
},
|
|
105
|
-
"./extensions/token-stats": {
|
|
106
|
-
"types": "./dist/extensions/token-stats/index.d.ts",
|
|
107
|
-
"import": "./dist/extensions/token-stats/index.js"
|
|
108
|
-
},
|
|
109
|
-
"./extensions/scripts": {
|
|
110
|
-
"types": "./dist/extensions/scripts/index.d.ts",
|
|
111
|
-
"import": "./dist/extensions/scripts/index.js"
|
|
112
|
-
},
|
|
113
57
|
"./skills": {
|
|
114
58
|
"types": "./dist/extensions/skills/index.d.ts",
|
|
115
59
|
"import": "./dist/extensions/skills/index.js"
|
|
@@ -125,14 +69,6 @@
|
|
|
125
69
|
"./streaming": {
|
|
126
70
|
"types": "./dist/extensions/streaming/index.d.ts",
|
|
127
71
|
"import": "./dist/extensions/streaming/index.js"
|
|
128
|
-
},
|
|
129
|
-
"./mcp": {
|
|
130
|
-
"types": "./dist/extensions/mcp/index.d.ts",
|
|
131
|
-
"import": "./dist/extensions/mcp/index.js"
|
|
132
|
-
},
|
|
133
|
-
"./logger": {
|
|
134
|
-
"types": "./dist/extensions/logger/index.d.ts",
|
|
135
|
-
"import": "./dist/extensions/logger/index.js"
|
|
136
72
|
}
|
|
137
73
|
},
|
|
138
74
|
"files": [
|
|
@@ -192,6 +128,7 @@
|
|
|
192
128
|
"@ai-sdk/google": "^4.0.39",
|
|
193
129
|
"@ai-sdk/openai": "^4.0.36",
|
|
194
130
|
"@ai-sdk/provider": "^4.0.7",
|
|
131
|
+
"ai": "^7.0.84",
|
|
195
132
|
"wink-eng-lite-web-model": "^1.8.1",
|
|
196
133
|
"wink-nlp": "^2.4.0"
|
|
197
134
|
},
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { Extension } from '../../extension.js';
|
|
2
|
-
/**
|
|
3
|
-
* Config for the auto-steer extension.
|
|
4
|
-
*/
|
|
5
|
-
export interface AutoSteerConfig {
|
|
6
|
-
/**
|
|
7
|
-
* The max iterations the agent is configured for. The extension steers
|
|
8
|
-
* at `threshold` iterations before this limit. Default: 25 (matching
|
|
9
|
-
* the agent's default).
|
|
10
|
-
*/
|
|
11
|
-
maxIterations?: number;
|
|
12
|
-
/**
|
|
13
|
-
* How many iterations before the limit to steer. Default: 3.
|
|
14
|
-
* With maxIterations=25 and threshold=3, the steer fires at iteration 22.
|
|
15
|
-
*/
|
|
16
|
-
threshold?: number;
|
|
17
|
-
/**
|
|
18
|
-
* The steering message to inject. Default: a prompt to wrap up.
|
|
19
|
-
*/
|
|
20
|
-
steerMessage?: string;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Create an auto-steer extension.
|
|
24
|
-
*
|
|
25
|
-
* Watches iteration count and steers the agent to wrap up when it's
|
|
26
|
-
* approaching the max iterations limit. This prevents the agent from
|
|
27
|
-
* hitting the limit with no response — instead of silently running out
|
|
28
|
-
* of turns, the agent gets a nudge like "You're running low on turns,
|
|
29
|
-
* summarize and respond now."
|
|
30
|
-
*
|
|
31
|
-
* Tracks iterations by counting `afterLLM` hook calls per turn. The
|
|
32
|
-
* count resets on each `beforeTurn`.
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```typescript
|
|
36
|
-
* import { createAutoSteerExtension } from '@xandout/libra-harness/extras/auto-steer';
|
|
37
|
-
*
|
|
38
|
-
* const autoSteer = createAutoSteerExtension({
|
|
39
|
-
* maxIterations: 15,
|
|
40
|
-
* threshold: 3,
|
|
41
|
-
* });
|
|
42
|
-
* agent.use(autoSteer);
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
export default function createAutoSteerExtension(config?: AutoSteerConfig): Extension;
|
|
46
|
-
//# sourceMappingURL=extension.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../../src/extensions/auto-steer/extension.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAC9C,MAAM,CAAC,EAAE,eAAe,GACvB,SAAS,CA+BX"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create an auto-steer extension.
|
|
3
|
-
*
|
|
4
|
-
* Watches iteration count and steers the agent to wrap up when it's
|
|
5
|
-
* approaching the max iterations limit. This prevents the agent from
|
|
6
|
-
* hitting the limit with no response — instead of silently running out
|
|
7
|
-
* of turns, the agent gets a nudge like "You're running low on turns,
|
|
8
|
-
* summarize and respond now."
|
|
9
|
-
*
|
|
10
|
-
* Tracks iterations by counting `afterLLM` hook calls per turn. The
|
|
11
|
-
* count resets on each `beforeTurn`.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```typescript
|
|
15
|
-
* import { createAutoSteerExtension } from '@xandout/libra-harness/extras/auto-steer';
|
|
16
|
-
*
|
|
17
|
-
* const autoSteer = createAutoSteerExtension({
|
|
18
|
-
* maxIterations: 15,
|
|
19
|
-
* threshold: 3,
|
|
20
|
-
* });
|
|
21
|
-
* agent.use(autoSteer);
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export default function createAutoSteerExtension(config) {
|
|
25
|
-
const maxIter = config?.maxIterations ?? 25;
|
|
26
|
-
const threshold = config?.threshold ?? 3;
|
|
27
|
-
const steerAt = maxIter - threshold;
|
|
28
|
-
const message = config?.steerMessage ??
|
|
29
|
-
"You're running low on turns. Stop calling tools and respond to the user now with what you have so far. Be concise.";
|
|
30
|
-
let iterationCount = 0;
|
|
31
|
-
let steered = false;
|
|
32
|
-
return {
|
|
33
|
-
name: 'auto-steer',
|
|
34
|
-
priority: 90,
|
|
35
|
-
install(agent) {
|
|
36
|
-
// Reset counter at the start of each turn.
|
|
37
|
-
agent.hook('beforeTurn', 'auto-steer', async () => {
|
|
38
|
-
iterationCount = 0;
|
|
39
|
-
steered = false;
|
|
40
|
-
});
|
|
41
|
-
// Count LLM calls and steer when approaching the limit.
|
|
42
|
-
agent.hook('afterLLM', 'auto-steer', async (ctx) => {
|
|
43
|
-
iterationCount++;
|
|
44
|
-
if (!steered && iterationCount >= steerAt) {
|
|
45
|
-
steered = true;
|
|
46
|
-
ctx.turn.steer(message);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=extension.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../../../src/extensions/auto-steer/extension.ts"],"names":[],"mappings":"AAuBA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAC9C,MAAwB;IAExB,MAAM,OAAO,GAAG,MAAM,EAAE,aAAa,IAAI,EAAE,CAAC;IAC5C,MAAM,SAAS,GAAG,MAAM,EAAE,SAAS,IAAI,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;IACpC,MAAM,OAAO,GAAG,MAAM,EAAE,YAAY;QAClC,oHAAoH,CAAC;IAEvH,IAAI,cAAc,GAAG,CAAC,CAAC;IACvB,IAAI,OAAO,GAAG,KAAK,CAAC;IAEpB,OAAO;QACL,IAAI,EAAE,YAAY;QAClB,QAAQ,EAAE,EAAE;QACZ,OAAO,CAAC,KAAK;YACX,2CAA2C;YAC3C,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,YAAY,EAAE,KAAK,IAAI,EAAE;gBAChD,cAAc,GAAG,CAAC,CAAC;gBACnB,OAAO,GAAG,KAAK,CAAC;YAClB,CAAC,CAAC,CAAC;YAEH,wDAAwD;YACxD,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;gBACjD,cAAc,EAAE,CAAC;gBAEjB,IAAI,CAAC,OAAO,IAAI,cAAc,IAAI,OAAO,EAAE,CAAC;oBAC1C,OAAO,GAAG,IAAI,CAAC;oBACf,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC1B,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extensions/auto-steer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AACrE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/extensions/auto-steer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Extension } from '../../extension.js';
|
|
2
|
-
/**
|
|
3
|
-
* Config for the emoji extension.
|
|
4
|
-
*
|
|
5
|
-
* Passed by the extension loader from the host's config object.
|
|
6
|
-
* The key `emojiPrefix` should be declared in extension.json's `configKeys`.
|
|
7
|
-
*/
|
|
8
|
-
export interface EmojiExtensionConfig {
|
|
9
|
-
/** Prefix to prepend to each response. Default: "✨ ". */
|
|
10
|
-
emojiPrefix?: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* emoji extension — decorates the final response with a leading emoji.
|
|
14
|
-
*
|
|
15
|
-
* Demonstrates the simplest possible factory extension: a single
|
|
16
|
-
* `beforeResponse` hook that mutates the outgoing message. Accepts an
|
|
17
|
-
* optional `emojiPrefix` via config (default: `"✨ "`).
|
|
18
|
-
*/
|
|
19
|
-
export default function createEmojiExtension(config?: EmojiExtensionConfig): Extension;
|
|
20
|
-
//# sourceMappingURL=extension.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../../src/extensions/emoji/extension.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC1C,MAAM,CAAC,EAAE,oBAAoB,GAC5B,SAAS,CAaX"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* emoji extension — decorates the final response with a leading emoji.
|
|
3
|
-
*
|
|
4
|
-
* Demonstrates the simplest possible factory extension: a single
|
|
5
|
-
* `beforeResponse` hook that mutates the outgoing message. Accepts an
|
|
6
|
-
* optional `emojiPrefix` via config (default: `"✨ "`).
|
|
7
|
-
*/
|
|
8
|
-
export default function createEmojiExtension(config) {
|
|
9
|
-
const prefix = config?.emojiPrefix ?? '\u2728 ';
|
|
10
|
-
return {
|
|
11
|
-
name: 'emoji',
|
|
12
|
-
priority: 0,
|
|
13
|
-
install(agent) {
|
|
14
|
-
agent.hook('beforeResponse', 'emoji', async (ctx) => {
|
|
15
|
-
if (ctx.turn.response?.message) {
|
|
16
|
-
ctx.turn.response.message = `${prefix}${ctx.turn.response.message}`;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=extension.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../../../src/extensions/emoji/extension.ts"],"names":[],"mappings":"AAaA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC1C,MAA6B;IAE7B,MAAM,MAAM,GAAG,MAAM,EAAE,WAAW,IAAI,SAAS,CAAC;IAChD,OAAO;QACL,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,CAAC;QACX,OAAO,CAAC,KAAK;YACX,KAAK,CAAC,IAAI,CAAC,gBAAgB,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;gBAClD,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC;oBAC/B,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,GAAG,GAAG,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;gBACtE,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extensions/emoji/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/extensions/emoji/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { Extension } from '@xandout/libra-harness';
|
|
2
|
-
/** A named sandboxed directory. */
|
|
3
|
-
export interface SandboxDir {
|
|
4
|
-
/** Display name the agent sees in paths (e.g. "downloads", "workspace"). */
|
|
5
|
-
name: string;
|
|
6
|
-
/** Absolute or relative path to the directory on disk. */
|
|
7
|
-
path: string;
|
|
8
|
-
}
|
|
9
|
-
export interface FilesystemConfig {
|
|
10
|
-
/**
|
|
11
|
-
* Named sandboxed directories. Each is presented to the agent by its
|
|
12
|
-
* display name. Paths from the agent are prefixed with the name
|
|
13
|
-
* (e.g. "downloads/report.txt").
|
|
14
|
-
*/
|
|
15
|
-
directories: SandboxDir[];
|
|
16
|
-
/**
|
|
17
|
-
* Max file size for read operations (bytes). Default: 1MB.
|
|
18
|
-
* Files larger than this return a metadata-only response.
|
|
19
|
-
*/
|
|
20
|
-
maxReadSize?: number;
|
|
21
|
-
/**
|
|
22
|
-
* Tool name prefix. Default: 'fs'.
|
|
23
|
-
*/
|
|
24
|
-
toolPrefix?: string;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Create a filesystem extension that exposes controlled read/write
|
|
28
|
-
* access to one or more sandboxed directories. All paths are resolved
|
|
29
|
-
* relative to a sandbox directory — path traversal (../) is blocked.
|
|
30
|
-
*
|
|
31
|
-
* When multiple directories are configured, paths are prefixed with
|
|
32
|
-
* the directory's display name (e.g. "downloads/report.txt"). The
|
|
33
|
-
* agent sees the available directory names in the tool descriptions
|
|
34
|
-
* and in `fs_list` output.
|
|
35
|
-
*
|
|
36
|
-
* Tools provided:
|
|
37
|
-
* - `fs_read` — read a file's content (text or base64 for binary)
|
|
38
|
-
* - `fs_write` — write text content to a file
|
|
39
|
-
* - `fs_list` — list files in a directory (or list sandboxes if no path)
|
|
40
|
-
* - `fs_delete` — delete a file or empty directory
|
|
41
|
-
* - `fs_info` — get file metadata (size, type, modified time)
|
|
42
|
-
*
|
|
43
|
-
* The `fs_save_bytes` internal helper is exposed on the extension
|
|
44
|
-
* object so other extensions can save binary content to the sandbox
|
|
45
|
-
* without going through the LLM.
|
|
46
|
-
*/
|
|
47
|
-
export default function createFilesystemExtension(config: FilesystemConfig): Extension & {
|
|
48
|
-
/** Save raw bytes to a sandbox. Used by other extensions. */
|
|
49
|
-
saveBytes(path: string, data: Buffer, mimetype?: string): string;
|
|
50
|
-
/** Resolve a sandbox-relative path to an absolute path. */
|
|
51
|
-
resolvePath(path: string): string;
|
|
52
|
-
};
|
|
53
|
-
//# sourceMappingURL=extension.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../../src/extensions/filesystem/extension.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,mCAAmC;AACnC,MAAM,WAAW,UAAU;IACzB,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAOD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAC/C,MAAM,EAAE,gBAAgB,GACvB,SAAS,GAAG;IACb,6DAA6D;IAC7D,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjE,2DAA2D;IAC3D,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACnC,CA2WA"}
|