bernard-agent 0.4.0 → 0.5.1
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 +69 -14
- package/THIRD-PARTY-NOTICES +212 -0
- package/dist/agent.d.ts +32 -3
- package/dist/agent.js +59 -11
- package/dist/agent.js.map +1 -1
- package/dist/config.d.ts +67 -0
- package/dist/config.js +103 -22
- package/dist/config.js.map +1 -1
- package/dist/context.d.ts +7 -0
- package/dist/context.js +4 -0
- package/dist/context.js.map +1 -1
- package/dist/cron/cli.d.ts +6 -0
- package/dist/cron/cli.js +8 -0
- package/dist/cron/cli.js.map +1 -1
- package/dist/cron/client.d.ts +9 -0
- package/dist/cron/client.js +9 -0
- package/dist/cron/client.js.map +1 -1
- package/dist/cron/daemon.js +8 -0
- package/dist/cron/daemon.js.map +1 -1
- package/dist/cron/log-store.d.ts +18 -0
- package/dist/cron/log-store.js +22 -7
- package/dist/cron/log-store.js.map +1 -1
- package/dist/cron/notify.d.ts +7 -0
- package/dist/cron/notify.js +16 -0
- package/dist/cron/notify.js.map +1 -1
- package/dist/cron/runner.d.ts +11 -0
- package/dist/cron/runner.js +63 -13
- package/dist/cron/runner.js.map +1 -1
- package/dist/cron/scheduler.d.ts +16 -0
- package/dist/cron/scheduler.js +16 -0
- package/dist/cron/scheduler.js.map +1 -1
- package/dist/cron/store.d.ts +32 -0
- package/dist/cron/store.js +51 -24
- package/dist/cron/store.js.map +1 -1
- package/dist/cron/types.d.ts +19 -0
- package/dist/domains.d.ts +15 -0
- package/dist/domains.js +19 -0
- package/dist/domains.js.map +1 -1
- package/dist/embeddings.d.ts +9 -3
- package/dist/embeddings.js +55 -10
- package/dist/embeddings.js.map +1 -1
- package/dist/facts-cli.d.ts +14 -0
- package/dist/facts-cli.js +51 -0
- package/dist/facts-cli.js.map +1 -1
- package/dist/history.d.ts +8 -0
- package/dist/history.js +14 -9
- package/dist/history.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +22 -1
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +6 -0
- package/dist/logger.js +6 -0
- package/dist/logger.js.map +1 -1
- package/dist/mcp.d.ts +87 -0
- package/dist/mcp.js +106 -25
- package/dist/mcp.js.map +1 -1
- package/dist/memory-context.d.ts +4 -0
- package/dist/memory-context.js +4 -2
- package/dist/memory-context.js.map +1 -1
- package/dist/memory.d.ts +17 -0
- package/dist/memory.js +23 -7
- package/dist/memory.js.map +1 -1
- package/dist/migrate.d.ts +13 -0
- package/dist/migrate.js +209 -0
- package/dist/migrate.js.map +1 -0
- package/dist/output.d.ts +45 -0
- package/dist/output.js +61 -0
- package/dist/output.js.map +1 -1
- package/dist/paths.d.ts +23 -0
- package/dist/paths.js +82 -0
- package/dist/paths.js.map +1 -0
- package/dist/providers/index.d.ts +7 -0
- package/dist/providers/index.js +7 -0
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/types.d.ts +4 -0
- package/dist/rag-query.d.ts +20 -0
- package/dist/rag-query.js +69 -3
- package/dist/rag-query.js.map +1 -1
- package/dist/rag-worker.js.map +1 -1
- package/dist/rag.d.ts +27 -0
- package/dist/rag.js +29 -19
- package/dist/rag.js.map +1 -1
- package/dist/repl.d.ts +6 -0
- package/dist/repl.js +147 -9
- package/dist/repl.js.map +1 -1
- package/dist/routines.d.ts +49 -0
- package/dist/routines.js +172 -0
- package/dist/routines.js.map +1 -0
- package/dist/setup.d.ts +5 -0
- package/dist/setup.js +7 -1
- package/dist/setup.js.map +1 -1
- package/dist/theme.d.ts +41 -0
- package/dist/theme.js +25 -0
- package/dist/theme.js.map +1 -1
- package/dist/tools/cron-logs.d.ts +6 -0
- package/dist/tools/cron-logs.js +6 -0
- package/dist/tools/cron-logs.js.map +1 -1
- package/dist/tools/cron.d.ts +7 -0
- package/dist/tools/cron.js +7 -0
- package/dist/tools/cron.js.map +1 -1
- package/dist/tools/datetime.d.ts +1 -0
- package/dist/tools/datetime.js +1 -0
- package/dist/tools/datetime.js.map +1 -1
- package/dist/tools/index.d.ts +10 -336
- package/dist/tools/index.js +11 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/mcp-url.d.ts +6 -0
- package/dist/tools/mcp-url.js +6 -0
- package/dist/tools/mcp-url.js.map +1 -1
- package/dist/tools/mcp.d.ts +6 -0
- package/dist/tools/mcp.js +6 -0
- package/dist/tools/mcp.js.map +1 -1
- package/dist/tools/memory.d.ts +14 -0
- package/dist/tools/memory.js +16 -1
- package/dist/tools/memory.js.map +1 -1
- package/dist/tools/routine.d.ts +35 -0
- package/dist/tools/routine.js +93 -0
- package/dist/tools/routine.js.map +1 -0
- package/dist/tools/shell.d.ts +15 -1
- package/dist/tools/shell.js +15 -1
- package/dist/tools/shell.js.map +1 -1
- package/dist/tools/subagent.d.ts +18 -1
- package/dist/tools/subagent.js +18 -1
- package/dist/tools/subagent.js.map +1 -1
- package/dist/tools/time.d.ts +19 -0
- package/dist/tools/time.js +19 -0
- package/dist/tools/time.js.map +1 -1
- package/dist/tools/types.d.ts +6 -0
- package/dist/tools/wait.d.ts +3 -0
- package/dist/tools/wait.js +3 -0
- package/dist/tools/wait.js.map +1 -1
- package/dist/tools/web.d.ts +6 -0
- package/dist/tools/web.js +20 -43
- package/dist/tools/web.js.map +1 -1
- package/dist/update.d.ts +5 -0
- package/dist/update.js +4 -5
- package/dist/update.js.map +1 -1
- package/package.json +4 -3
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,339 +1,13 @@
|
|
|
1
1
|
import type { ToolOptions } from './types.js';
|
|
2
2
|
import type { MemoryStore } from '../memory.js';
|
|
3
|
+
import type { RoutineStore } from '../routines.js';
|
|
3
4
|
export type { ToolOptions } from './types.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
command?: string | undefined;
|
|
14
|
-
key?: string | undefined;
|
|
15
|
-
env?: Record<string, string> | undefined;
|
|
16
|
-
args?: string[] | undefined;
|
|
17
|
-
}, {
|
|
18
|
-
action: "list" | "add" | "remove" | "get";
|
|
19
|
-
command?: string | undefined;
|
|
20
|
-
key?: string | undefined;
|
|
21
|
-
env?: Record<string, string> | undefined;
|
|
22
|
-
args?: string[] | undefined;
|
|
23
|
-
}>, string> & {
|
|
24
|
-
execute: (args: {
|
|
25
|
-
action: "list" | "add" | "remove" | "get";
|
|
26
|
-
command?: string | undefined;
|
|
27
|
-
key?: string | undefined;
|
|
28
|
-
env?: Record<string, string> | undefined;
|
|
29
|
-
args?: string[] | undefined;
|
|
30
|
-
}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
31
|
-
};
|
|
32
|
-
mcp_add_url: import("ai").Tool<import("zod").ZodObject<{
|
|
33
|
-
key: import("zod").ZodString;
|
|
34
|
-
url: import("zod").ZodString;
|
|
35
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
36
|
-
key: string;
|
|
37
|
-
url: string;
|
|
38
|
-
}, {
|
|
39
|
-
key: string;
|
|
40
|
-
url: string;
|
|
41
|
-
}>, string> & {
|
|
42
|
-
execute: (args: {
|
|
43
|
-
key: string;
|
|
44
|
-
url: string;
|
|
45
|
-
}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
46
|
-
};
|
|
47
|
-
web_read: import("ai").Tool<import("zod").ZodObject<{
|
|
48
|
-
url: import("zod").ZodString;
|
|
49
|
-
selector: import("zod").ZodOptional<import("zod").ZodString>;
|
|
50
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
51
|
-
url: string;
|
|
52
|
-
selector?: string | undefined;
|
|
53
|
-
}, {
|
|
54
|
-
url: string;
|
|
55
|
-
selector?: string | undefined;
|
|
56
|
-
}>, string> & {
|
|
57
|
-
execute: (args: {
|
|
58
|
-
url: string;
|
|
59
|
-
selector?: string | undefined;
|
|
60
|
-
}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
61
|
-
};
|
|
62
|
-
wait: import("ai").Tool<import("zod").ZodObject<{
|
|
63
|
-
seconds: import("zod").ZodNumber;
|
|
64
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
65
|
-
seconds: number;
|
|
66
|
-
}, {
|
|
67
|
-
seconds: number;
|
|
68
|
-
}>, string> & {
|
|
69
|
-
execute: (args: {
|
|
70
|
-
seconds: number;
|
|
71
|
-
}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
72
|
-
};
|
|
73
|
-
time_range: import("ai").Tool<import("zod").ZodObject<{
|
|
74
|
-
start: import("zod").ZodNumber;
|
|
75
|
-
end: import("zod").ZodNumber;
|
|
76
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
77
|
-
start: number;
|
|
78
|
-
end: number;
|
|
79
|
-
}, {
|
|
80
|
-
start: number;
|
|
81
|
-
end: number;
|
|
82
|
-
}>, string> & {
|
|
83
|
-
execute: (args: {
|
|
84
|
-
start: number;
|
|
85
|
-
end: number;
|
|
86
|
-
}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
87
|
-
};
|
|
88
|
-
time_range_total: import("ai").Tool<import("zod").ZodObject<{
|
|
89
|
-
ranges: import("zod").ZodArray<import("zod").ZodObject<{
|
|
90
|
-
start: import("zod").ZodNumber;
|
|
91
|
-
end: import("zod").ZodNumber;
|
|
92
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
93
|
-
start: number;
|
|
94
|
-
end: number;
|
|
95
|
-
}, {
|
|
96
|
-
start: number;
|
|
97
|
-
end: number;
|
|
98
|
-
}>, "many">;
|
|
99
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
100
|
-
ranges: {
|
|
101
|
-
start: number;
|
|
102
|
-
end: number;
|
|
103
|
-
}[];
|
|
104
|
-
}, {
|
|
105
|
-
ranges: {
|
|
106
|
-
start: number;
|
|
107
|
-
end: number;
|
|
108
|
-
}[];
|
|
109
|
-
}>, string> & {
|
|
110
|
-
execute: (args: {
|
|
111
|
-
ranges: {
|
|
112
|
-
start: number;
|
|
113
|
-
end: number;
|
|
114
|
-
}[];
|
|
115
|
-
}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
116
|
-
};
|
|
117
|
-
cron_logs_list: import("ai").Tool<import("zod").ZodObject<{
|
|
118
|
-
job_id: import("zod").ZodString;
|
|
119
|
-
limit: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
120
|
-
offset: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
121
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
122
|
-
job_id: string;
|
|
123
|
-
limit: number;
|
|
124
|
-
offset: number;
|
|
125
|
-
}, {
|
|
126
|
-
job_id: string;
|
|
127
|
-
limit?: number | undefined;
|
|
128
|
-
offset?: number | undefined;
|
|
129
|
-
}>, string> & {
|
|
130
|
-
execute: (args: {
|
|
131
|
-
job_id: string;
|
|
132
|
-
limit: number;
|
|
133
|
-
offset: number;
|
|
134
|
-
}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
135
|
-
};
|
|
136
|
-
cron_logs_get: import("ai").Tool<import("zod").ZodObject<{
|
|
137
|
-
job_id: import("zod").ZodString;
|
|
138
|
-
run_id: import("zod").ZodString;
|
|
139
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
140
|
-
job_id: string;
|
|
141
|
-
run_id: string;
|
|
142
|
-
}, {
|
|
143
|
-
job_id: string;
|
|
144
|
-
run_id: string;
|
|
145
|
-
}>, string> & {
|
|
146
|
-
execute: (args: {
|
|
147
|
-
job_id: string;
|
|
148
|
-
run_id: string;
|
|
149
|
-
}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
150
|
-
};
|
|
151
|
-
cron_logs_summary: import("ai").Tool<import("zod").ZodObject<{
|
|
152
|
-
job_id: import("zod").ZodString;
|
|
153
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
154
|
-
job_id: string;
|
|
155
|
-
}, {
|
|
156
|
-
job_id: string;
|
|
157
|
-
}>, string> & {
|
|
158
|
-
execute: (args: {
|
|
159
|
-
job_id: string;
|
|
160
|
-
}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
161
|
-
};
|
|
162
|
-
cron_logs_cleanup: import("ai").Tool<import("zod").ZodObject<{
|
|
163
|
-
job_id: import("zod").ZodString;
|
|
164
|
-
action: import("zod").ZodEnum<["rotate", "delete"]>;
|
|
165
|
-
keep: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
166
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
167
|
-
action: "delete" | "rotate";
|
|
168
|
-
job_id: string;
|
|
169
|
-
keep: number;
|
|
170
|
-
}, {
|
|
171
|
-
action: "delete" | "rotate";
|
|
172
|
-
job_id: string;
|
|
173
|
-
keep?: number | undefined;
|
|
174
|
-
}>, string> & {
|
|
175
|
-
execute: (args: {
|
|
176
|
-
action: "delete" | "rotate";
|
|
177
|
-
job_id: string;
|
|
178
|
-
keep: number;
|
|
179
|
-
}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
180
|
-
};
|
|
181
|
-
cron_create: import("ai").Tool<import("zod").ZodObject<{
|
|
182
|
-
name: import("zod").ZodString;
|
|
183
|
-
schedule: import("zod").ZodString;
|
|
184
|
-
prompt: import("zod").ZodString;
|
|
185
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
186
|
-
name: string;
|
|
187
|
-
schedule: string;
|
|
188
|
-
prompt: string;
|
|
189
|
-
}, {
|
|
190
|
-
name: string;
|
|
191
|
-
schedule: string;
|
|
192
|
-
prompt: string;
|
|
193
|
-
}>, string> & {
|
|
194
|
-
execute: (args: {
|
|
195
|
-
name: string;
|
|
196
|
-
schedule: string;
|
|
197
|
-
prompt: string;
|
|
198
|
-
}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
199
|
-
};
|
|
200
|
-
cron_list: import("ai").Tool<import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>, string> & {
|
|
201
|
-
execute: (args: {}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
202
|
-
};
|
|
203
|
-
cron_run: import("ai").Tool<import("zod").ZodObject<{
|
|
204
|
-
id: import("zod").ZodString;
|
|
205
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
206
|
-
id: string;
|
|
207
|
-
}, {
|
|
208
|
-
id: string;
|
|
209
|
-
}>, string> & {
|
|
210
|
-
execute: (args: {
|
|
211
|
-
id: string;
|
|
212
|
-
}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
213
|
-
};
|
|
214
|
-
cron_get: import("ai").Tool<import("zod").ZodObject<{
|
|
215
|
-
id: import("zod").ZodString;
|
|
216
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
217
|
-
id: string;
|
|
218
|
-
}, {
|
|
219
|
-
id: string;
|
|
220
|
-
}>, string> & {
|
|
221
|
-
execute: (args: {
|
|
222
|
-
id: string;
|
|
223
|
-
}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
224
|
-
};
|
|
225
|
-
cron_update: import("ai").Tool<import("zod").ZodObject<{
|
|
226
|
-
id: import("zod").ZodString;
|
|
227
|
-
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
228
|
-
schedule: import("zod").ZodOptional<import("zod").ZodString>;
|
|
229
|
-
prompt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
230
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
231
|
-
id: string;
|
|
232
|
-
name?: string | undefined;
|
|
233
|
-
schedule?: string | undefined;
|
|
234
|
-
prompt?: string | undefined;
|
|
235
|
-
}, {
|
|
236
|
-
id: string;
|
|
237
|
-
name?: string | undefined;
|
|
238
|
-
schedule?: string | undefined;
|
|
239
|
-
prompt?: string | undefined;
|
|
240
|
-
}>, string> & {
|
|
241
|
-
execute: (args: {
|
|
242
|
-
id: string;
|
|
243
|
-
name?: string | undefined;
|
|
244
|
-
schedule?: string | undefined;
|
|
245
|
-
prompt?: string | undefined;
|
|
246
|
-
}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
247
|
-
};
|
|
248
|
-
cron_delete: import("ai").Tool<import("zod").ZodObject<{
|
|
249
|
-
id: import("zod").ZodString;
|
|
250
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
251
|
-
id: string;
|
|
252
|
-
}, {
|
|
253
|
-
id: string;
|
|
254
|
-
}>, string> & {
|
|
255
|
-
execute: (args: {
|
|
256
|
-
id: string;
|
|
257
|
-
}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
258
|
-
};
|
|
259
|
-
cron_enable: import("ai").Tool<import("zod").ZodObject<{
|
|
260
|
-
id: import("zod").ZodString;
|
|
261
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
262
|
-
id: string;
|
|
263
|
-
}, {
|
|
264
|
-
id: string;
|
|
265
|
-
}>, string> & {
|
|
266
|
-
execute: (args: {
|
|
267
|
-
id: string;
|
|
268
|
-
}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
269
|
-
};
|
|
270
|
-
cron_disable: import("ai").Tool<import("zod").ZodObject<{
|
|
271
|
-
id: import("zod").ZodString;
|
|
272
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
273
|
-
id: string;
|
|
274
|
-
}, {
|
|
275
|
-
id: string;
|
|
276
|
-
}>, string> & {
|
|
277
|
-
execute: (args: {
|
|
278
|
-
id: string;
|
|
279
|
-
}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
280
|
-
};
|
|
281
|
-
cron_status: import("ai").Tool<import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>, string> & {
|
|
282
|
-
execute: (args: {}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
283
|
-
};
|
|
284
|
-
cron_bounce: import("ai").Tool<import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>, string> & {
|
|
285
|
-
execute: (args: {}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
286
|
-
};
|
|
287
|
-
shell: import("ai").Tool<import("zod").ZodObject<{
|
|
288
|
-
command: import("zod").ZodString;
|
|
289
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
290
|
-
command: string;
|
|
291
|
-
}, {
|
|
292
|
-
command: string;
|
|
293
|
-
}>, import("./types.js").ShellResult> & {
|
|
294
|
-
execute: (args: {
|
|
295
|
-
command: string;
|
|
296
|
-
}, options: import("ai").ToolExecutionOptions) => PromiseLike<import("./types.js").ShellResult>;
|
|
297
|
-
};
|
|
298
|
-
memory: import("ai").Tool<import("zod").ZodObject<{
|
|
299
|
-
action: import("zod").ZodEnum<["list", "read", "write", "delete"]>;
|
|
300
|
-
key: import("zod").ZodOptional<import("zod").ZodString>;
|
|
301
|
-
content: import("zod").ZodOptional<import("zod").ZodString>;
|
|
302
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
303
|
-
action: "list" | "read" | "write" | "delete";
|
|
304
|
-
key?: string | undefined;
|
|
305
|
-
content?: string | undefined;
|
|
306
|
-
}, {
|
|
307
|
-
action: "list" | "read" | "write" | "delete";
|
|
308
|
-
key?: string | undefined;
|
|
309
|
-
content?: string | undefined;
|
|
310
|
-
}>, string> & {
|
|
311
|
-
execute: (args: {
|
|
312
|
-
action: "list" | "read" | "write" | "delete";
|
|
313
|
-
key?: string | undefined;
|
|
314
|
-
content?: string | undefined;
|
|
315
|
-
}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
316
|
-
};
|
|
317
|
-
scratch: import("ai").Tool<import("zod").ZodObject<{
|
|
318
|
-
action: import("zod").ZodEnum<["list", "read", "write", "delete"]>;
|
|
319
|
-
key: import("zod").ZodOptional<import("zod").ZodString>;
|
|
320
|
-
content: import("zod").ZodOptional<import("zod").ZodString>;
|
|
321
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
322
|
-
action: "list" | "read" | "write" | "delete";
|
|
323
|
-
key?: string | undefined;
|
|
324
|
-
content?: string | undefined;
|
|
325
|
-
}, {
|
|
326
|
-
action: "list" | "read" | "write" | "delete";
|
|
327
|
-
key?: string | undefined;
|
|
328
|
-
content?: string | undefined;
|
|
329
|
-
}>, string> & {
|
|
330
|
-
execute: (args: {
|
|
331
|
-
action: "list" | "read" | "write" | "delete";
|
|
332
|
-
key?: string | undefined;
|
|
333
|
-
content?: string | undefined;
|
|
334
|
-
}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
335
|
-
};
|
|
336
|
-
datetime: import("ai").Tool<import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>, string> & {
|
|
337
|
-
execute: (args: {}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
338
|
-
};
|
|
339
|
-
};
|
|
5
|
+
/**
|
|
6
|
+
* Assembles the complete tool registry for the agent.
|
|
7
|
+
*
|
|
8
|
+
* @param options - Shell execution options (timeout, dangerous-command confirmation callback).
|
|
9
|
+
* @param memoryStore - Persistent and scratch memory backing store.
|
|
10
|
+
* @param mcpTools - Optional MCP-provided tools to merge into the registry.
|
|
11
|
+
* @returns A flat record of all available AI SDK tools keyed by tool name.
|
|
12
|
+
*/
|
|
13
|
+
export declare function createTools(options: ToolOptions, memoryStore: MemoryStore, mcpTools?: Record<string, any>, routineStore?: RoutineStore): Record<string, any>;
|
package/dist/tools/index.js
CHANGED
|
@@ -11,11 +11,21 @@ const mcp_js_1 = require("./mcp.js");
|
|
|
11
11
|
const mcp_url_js_1 = require("./mcp-url.js");
|
|
12
12
|
const web_js_1 = require("./web.js");
|
|
13
13
|
const wait_js_1 = require("./wait.js");
|
|
14
|
-
|
|
14
|
+
const routine_js_1 = require("./routine.js");
|
|
15
|
+
/**
|
|
16
|
+
* Assembles the complete tool registry for the agent.
|
|
17
|
+
*
|
|
18
|
+
* @param options - Shell execution options (timeout, dangerous-command confirmation callback).
|
|
19
|
+
* @param memoryStore - Persistent and scratch memory backing store.
|
|
20
|
+
* @param mcpTools - Optional MCP-provided tools to merge into the registry.
|
|
21
|
+
* @returns A flat record of all available AI SDK tools keyed by tool name.
|
|
22
|
+
*/
|
|
23
|
+
function createTools(options, memoryStore, mcpTools, routineStore) {
|
|
15
24
|
return {
|
|
16
25
|
shell: (0, shell_js_1.createShellTool)(options),
|
|
17
26
|
memory: (0, memory_js_1.createMemoryTool)(memoryStore),
|
|
18
27
|
scratch: (0, memory_js_1.createScratchTool)(memoryStore),
|
|
28
|
+
routine: (0, routine_js_1.createRoutineTool)(routineStore),
|
|
19
29
|
datetime: (0, datetime_js_1.createDateTimeTool)(),
|
|
20
30
|
...(0, cron_js_1.createCronTools)(),
|
|
21
31
|
...(0, cron_logs_js_1.createCronLogTools)(),
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":";;AAyBA,kCAqBC;AA9CD,yCAA6C;AAC7C,2CAAkE;AAClE,+CAAmD;AACnD,uCAA4C;AAC5C,iDAAoD;AACpD,uCAA4C;AAC5C,qCAA+C;AAC/C,6CAAmD;AACnD,qCAA6C;AAC7C,uCAA2C;AAC3C,6CAAiD;AAOjD;;;;;;;GAOG;AACH,SAAgB,WAAW,CACzB,OAAoB,EACpB,WAAwB,EACxB,QAA8B,EAC9B,YAA2B;IAE3B,OAAO;QACL,KAAK,EAAE,IAAA,0BAAe,EAAC,OAAO,CAAC;QAC/B,MAAM,EAAE,IAAA,4BAAgB,EAAC,WAAW,CAAC;QACrC,OAAO,EAAE,IAAA,6BAAiB,EAAC,WAAW,CAAC;QACvC,OAAO,EAAE,IAAA,8BAAiB,EAAC,YAAY,CAAC;QACxC,QAAQ,EAAE,IAAA,gCAAkB,GAAE;QAC9B,GAAG,IAAA,yBAAe,GAAE;QACpB,GAAG,IAAA,iCAAkB,GAAE;QACvB,GAAG,IAAA,yBAAe,GAAE;QACpB,UAAU,EAAE,IAAA,4BAAmB,GAAE;QACjC,WAAW,EAAE,IAAA,gCAAmB,GAAE;QAClC,QAAQ,EAAE,IAAA,0BAAiB,GAAE;QAC7B,IAAI,EAAE,IAAA,wBAAc,GAAE;QACtB,GAAG,QAAQ;KACZ,CAAC;AACJ,CAAC"}
|
package/dist/tools/mcp-url.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Creates the tool for adding URL-based (SSE/HTTP) MCP servers.
|
|
4
|
+
*
|
|
5
|
+
* Unlike {@link createMCPConfigTool}, this tool is specialized for URL endpoints
|
|
6
|
+
* rather than local stdio processes. Changes require a Bernard restart.
|
|
7
|
+
*/
|
|
2
8
|
export declare function createMCPAddUrlTool(): import("ai").Tool<z.ZodObject<{
|
|
3
9
|
key: z.ZodString;
|
|
4
10
|
url: z.ZodString;
|
package/dist/tools/mcp-url.js
CHANGED
|
@@ -4,6 +4,12 @@ exports.createMCPAddUrlTool = createMCPAddUrlTool;
|
|
|
4
4
|
const ai_1 = require("ai");
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const mcp_js_1 = require("../mcp.js");
|
|
7
|
+
/**
|
|
8
|
+
* Creates the tool for adding URL-based (SSE/HTTP) MCP servers.
|
|
9
|
+
*
|
|
10
|
+
* Unlike {@link createMCPConfigTool}, this tool is specialized for URL endpoints
|
|
11
|
+
* rather than local stdio processes. Changes require a Bernard restart.
|
|
12
|
+
*/
|
|
7
13
|
function createMCPAddUrlTool() {
|
|
8
14
|
return (0, ai_1.tool)({
|
|
9
15
|
description: 'Add a URL-based MCP server (SSE or HTTP endpoint). Use this when given an MCP server URL. Changes take effect after restarting Bernard.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-url.js","sourceRoot":"","sources":["../../src/tools/mcp-url.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"mcp-url.js","sourceRoot":"","sources":["../../src/tools/mcp-url.ts"],"names":[],"mappings":";;AAUA,kDAmBC;AA7BD,2BAA0B;AAC1B,6BAAwB;AACxB,sCAA4C;AAE5C;;;;;GAKG;AACH,SAAgB,mBAAmB;IACjC,OAAO,IAAA,SAAI,EAAC;QACV,WAAW,EACT,yIAAyI;QAC3I,UAAU,EAAE,OAAC,CAAC,MAAM,CAAC;YACnB,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;YACtE,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0DAA0D,CAAC;SACrF,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAmB,EAAE;YAC/C,IAAI,CAAC;gBACH,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAE,KAAe,CAAC,CAAC,CAAE,KAAe,CAAC;gBACxE,IAAA,wBAAe,EAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;gBAChC,OAAO,6BAA6B,GAAG,YAAY,GAAG,kBAAkB,IAAI,gDAAgD,CAAC;YAC/H,CAAC;YAAC,OAAO,GAAY,EAAE,CAAC;gBACtB,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC7D,OAAO,wBAAwB,GAAG,EAAE,CAAC;YACvC,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/dist/tools/mcp.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Creates the MCP server configuration tool for managing stdio-based MCP servers.
|
|
4
|
+
*
|
|
5
|
+
* Supports add, remove, list, and get actions. Configuration changes require
|
|
6
|
+
* a Bernard restart to take effect.
|
|
7
|
+
*/
|
|
2
8
|
export declare function createMCPConfigTool(): import("ai").Tool<z.ZodObject<{
|
|
3
9
|
action: z.ZodEnum<["list", "add", "remove", "get"]>;
|
|
4
10
|
key: z.ZodOptional<z.ZodString>;
|
package/dist/tools/mcp.js
CHANGED
|
@@ -4,6 +4,12 @@ exports.createMCPConfigTool = createMCPConfigTool;
|
|
|
4
4
|
const ai_1 = require("ai");
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const mcp_js_1 = require("../mcp.js");
|
|
7
|
+
/**
|
|
8
|
+
* Creates the MCP server configuration tool for managing stdio-based MCP servers.
|
|
9
|
+
*
|
|
10
|
+
* Supports add, remove, list, and get actions. Configuration changes require
|
|
11
|
+
* a Bernard restart to take effect.
|
|
12
|
+
*/
|
|
7
13
|
function createMCPConfigTool() {
|
|
8
14
|
return (0, ai_1.tool)({
|
|
9
15
|
description: 'Manage MCP server configuration. Add, remove, list, or inspect MCP servers. Changes take effect after restarting Bernard.',
|
package/dist/tools/mcp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/tools/mcp.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/tools/mcp.ts"],"names":[],"mappings":";;AAUA,kDAoHC;AA9HD,2BAA0B;AAC1B,6BAAwB;AACxB,sCAAwF;AAExF;;;;;GAKG;AACH,SAAgB,mBAAmB;IACjC,OAAO,IAAA,SAAI,EAAC;QACV,WAAW,EACT,2HAA2H;QAC7H,UAAU,EAAE,OAAC,CAAC,MAAM,CAAC;YACnB,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CAAC;YAClF,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iD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EAAE,CAAC;oBACxC,CAAC;gBACH,CAAC;gBAED;oBACE,OAAO,mBAAmB,MAAM,EAAE,CAAC;YACvC,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/dist/tools/memory.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { MemoryStore } from '../memory.js';
|
|
3
|
+
/**
|
|
4
|
+
* Creates the persistent memory tool backed by on-disk markdown files.
|
|
5
|
+
*
|
|
6
|
+
* Supports list, read, write, and delete actions for cross-session recall.
|
|
7
|
+
*
|
|
8
|
+
* @param memoryStore - The backing MemoryStore instance.
|
|
9
|
+
*/
|
|
3
10
|
export declare function createMemoryTool(memoryStore: MemoryStore): import("ai").Tool<z.ZodObject<{
|
|
4
11
|
action: z.ZodEnum<["list", "read", "write", "delete"]>;
|
|
5
12
|
key: z.ZodOptional<z.ZodString>;
|
|
@@ -19,6 +26,13 @@ export declare function createMemoryTool(memoryStore: MemoryStore): import("ai")
|
|
|
19
26
|
content?: string | undefined;
|
|
20
27
|
}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
21
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* Creates the session-scoped scratch-pad tool for tracking intermediate work.
|
|
31
|
+
*
|
|
32
|
+
* Scratch notes survive context compression but are discarded when the session ends.
|
|
33
|
+
*
|
|
34
|
+
* @param memoryStore - The backing MemoryStore instance.
|
|
35
|
+
*/
|
|
22
36
|
export declare function createScratchTool(memoryStore: MemoryStore): import("ai").Tool<z.ZodObject<{
|
|
23
37
|
action: z.ZodEnum<["list", "read", "write", "delete"]>;
|
|
24
38
|
key: z.ZodOptional<z.ZodString>;
|
package/dist/tools/memory.js
CHANGED
|
@@ -4,9 +4,17 @@ exports.createMemoryTool = createMemoryTool;
|
|
|
4
4
|
exports.createScratchTool = createScratchTool;
|
|
5
5
|
const ai_1 = require("ai");
|
|
6
6
|
const zod_1 = require("zod");
|
|
7
|
+
const paths_js_1 = require("../paths.js");
|
|
8
|
+
/**
|
|
9
|
+
* Creates the persistent memory tool backed by on-disk markdown files.
|
|
10
|
+
*
|
|
11
|
+
* Supports list, read, write, and delete actions for cross-session recall.
|
|
12
|
+
*
|
|
13
|
+
* @param memoryStore - The backing MemoryStore instance.
|
|
14
|
+
*/
|
|
7
15
|
function createMemoryTool(memoryStore) {
|
|
8
16
|
return (0, ai_1.tool)({
|
|
9
|
-
description:
|
|
17
|
+
description: `Persistent memory that survives across sessions. Use this to remember user preferences, project knowledge, or anything worth recalling later. Stored as files on disk at ${paths_js_1.MEMORY_DIR}.`,
|
|
10
18
|
parameters: zod_1.z.object({
|
|
11
19
|
action: zod_1.z.enum(['list', 'read', 'write', 'delete']).describe('The action to perform'),
|
|
12
20
|
key: zod_1.z.string().optional().describe('The memory key (required for read/write/delete)'),
|
|
@@ -50,6 +58,13 @@ function createMemoryTool(memoryStore) {
|
|
|
50
58
|
},
|
|
51
59
|
});
|
|
52
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Creates the session-scoped scratch-pad tool for tracking intermediate work.
|
|
63
|
+
*
|
|
64
|
+
* Scratch notes survive context compression but are discarded when the session ends.
|
|
65
|
+
*
|
|
66
|
+
* @param memoryStore - The backing MemoryStore instance.
|
|
67
|
+
*/
|
|
53
68
|
function createScratchTool(memoryStore) {
|
|
54
69
|
return (0, ai_1.tool)({
|
|
55
70
|
description: 'Session scratch notes for tracking complex task progress, intermediate findings, and working plans. These notes survive context compression but are discarded when the session ends. Use this to keep track of multi-step work within a single session.',
|
package/dist/tools/memory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/tools/memory.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/tools/memory.ts"],"names":[],"mappings":";;AAYA,4CAsCC;AASD,8CAuCC;AAlGD,2BAA0B;AAC1B,6BAAwB;AAExB,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
+
import { z } from 'zod';
|
|
2
|
+
import { RoutineStore } from '../routines.js';
|
|
3
|
+
/**
|
|
4
|
+
* Creates the routine management tool for saving and retrieving reusable multi-step workflows.
|
|
5
|
+
*
|
|
6
|
+
* Routines are named procedures (deploy, release, onboarding, etc.) that the user can
|
|
7
|
+
* teach Bernard and later invoke via `/{routine-id}` in the REPL.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createRoutineTool(routineStore?: RoutineStore): import("ai").Tool<z.ZodObject<{
|
|
10
|
+
action: z.ZodEnum<["create", "update", "list", "read", "delete"]>;
|
|
11
|
+
id: z.ZodOptional<z.ZodString>;
|
|
12
|
+
name: z.ZodOptional<z.ZodString>;
|
|
13
|
+
description: z.ZodOptional<z.ZodString>;
|
|
14
|
+
content: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
action: "list" | "read" | "delete" | "update" | "create";
|
|
17
|
+
content?: string | undefined;
|
|
18
|
+
name?: string | undefined;
|
|
19
|
+
id?: string | undefined;
|
|
20
|
+
description?: string | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
action: "list" | "read" | "delete" | "update" | "create";
|
|
23
|
+
content?: string | undefined;
|
|
24
|
+
name?: string | undefined;
|
|
25
|
+
id?: string | undefined;
|
|
26
|
+
description?: string | undefined;
|
|
27
|
+
}>, string> & {
|
|
28
|
+
execute: (args: {
|
|
29
|
+
action: "list" | "read" | "delete" | "update" | "create";
|
|
30
|
+
content?: string | undefined;
|
|
31
|
+
name?: string | undefined;
|
|
32
|
+
id?: string | undefined;
|
|
33
|
+
description?: string | undefined;
|
|
34
|
+
}, options: import("ai").ToolExecutionOptions) => PromiseLike<string>;
|
|
35
|
+
};
|