@syntero/orca-cli 1.3.2 → 1.3.3
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/assistant/anthropic.js +1 -1
- package/dist/assistant/anthropic.js.map +1 -1
- package/dist/assistant/helpers.js +1 -1
- package/dist/assistant/helpers.js.map +1 -1
- package/dist/assistant/openai.js +1 -1
- package/dist/assistant/openai.js.map +1 -1
- package/dist/assistant/prompts.d.ts.map +1 -1
- package/dist/assistant/prompts.js +41 -34
- package/dist/assistant/prompts.js.map +1 -1
- package/dist/assistant/types.d.ts +1 -1
- package/dist/assistant/types.d.ts.map +1 -1
- package/dist/tools/auth-tools.d.ts +26 -0
- package/dist/tools/auth-tools.d.ts.map +1 -0
- package/dist/tools/auth-tools.js +53 -0
- package/dist/tools/auth-tools.js.map +1 -0
- package/dist/tools/command.d.ts +28 -0
- package/dist/tools/command.d.ts.map +1 -0
- package/dist/tools/command.js +76 -0
- package/dist/tools/command.js.map +1 -0
- package/dist/tools/database.d.ts +19 -0
- package/dist/tools/database.d.ts.map +1 -0
- package/dist/tools/database.js +90 -0
- package/dist/tools/database.js.map +1 -0
- package/dist/tools/deployment.d.ts +195 -0
- package/dist/tools/deployment.d.ts.map +1 -0
- package/dist/tools/deployment.js +324 -0
- package/dist/tools/deployment.js.map +1 -0
- package/dist/tools/docker.d.ts +51 -0
- package/dist/tools/docker.d.ts.map +1 -0
- package/dist/tools/docker.js +68 -0
- package/dist/tools/docker.js.map +1 -0
- package/dist/tools/env.d.ts +18 -0
- package/dist/tools/env.d.ts.map +1 -0
- package/dist/tools/env.js +52 -0
- package/dist/tools/env.js.map +1 -0
- package/dist/tools/filesystem.d.ts +77 -0
- package/dist/tools/filesystem.d.ts.map +1 -0
- package/dist/tools/filesystem.js +138 -0
- package/dist/tools/filesystem.js.map +1 -0
- package/dist/tools/handler.d.ts +5 -0
- package/dist/tools/handler.d.ts.map +1 -0
- package/dist/tools/handler.js +51 -0
- package/dist/tools/handler.js.map +1 -0
- package/dist/tools/index.d.ts +462 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +38 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/shared.d.ts +21 -0
- package/dist/tools/shared.d.ts.map +1 -0
- package/dist/tools/shared.js +75 -0
- package/dist/tools/shared.js.map +1 -0
- package/dist/tools/types.d.ts +2 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +3 -0
- package/dist/tools/types.js.map +1 -0
- package/package.json +1 -1
- package/dist/tools.d.ts +0 -908
- package/dist/tools.d.ts.map +0 -1
- package/dist/tools.js +0 -774
- package/dist/tools.js.map +0 -1
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tools module — barrel file.
|
|
3
|
+
* Aggregates tool definitions from domain submodules and re-exports
|
|
4
|
+
* the central handleToolCall dispatcher plus shared types.
|
|
5
|
+
*/
|
|
6
|
+
export { detectDangerousCommand, checkCommand, allCategoriesApproved, type DangerousCommand, type DangerCheckResult, type RiskLevel, } from './types.js';
|
|
7
|
+
export { runCommand } from './command.js';
|
|
8
|
+
export { handleToolCall } from './handler.js';
|
|
9
|
+
export declare const TOOLS_ANTHROPIC: ({
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
input_schema: {
|
|
13
|
+
type: string;
|
|
14
|
+
properties: {
|
|
15
|
+
command: {
|
|
16
|
+
type: string;
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
gist: {
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
required: string[];
|
|
25
|
+
};
|
|
26
|
+
} | {
|
|
27
|
+
name: string;
|
|
28
|
+
description: string;
|
|
29
|
+
input_schema: {
|
|
30
|
+
type: string;
|
|
31
|
+
properties: {
|
|
32
|
+
path: {
|
|
33
|
+
type: string;
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
tail: {
|
|
37
|
+
type: string;
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
40
|
+
pattern?: undefined;
|
|
41
|
+
case_insensitive?: undefined;
|
|
42
|
+
context_lines?: undefined;
|
|
43
|
+
};
|
|
44
|
+
required: string[];
|
|
45
|
+
};
|
|
46
|
+
} | {
|
|
47
|
+
name: string;
|
|
48
|
+
description: string;
|
|
49
|
+
input_schema: {
|
|
50
|
+
type: string;
|
|
51
|
+
properties: {
|
|
52
|
+
path: {
|
|
53
|
+
type: string;
|
|
54
|
+
description: string;
|
|
55
|
+
};
|
|
56
|
+
tail?: undefined;
|
|
57
|
+
pattern?: undefined;
|
|
58
|
+
case_insensitive?: undefined;
|
|
59
|
+
context_lines?: undefined;
|
|
60
|
+
};
|
|
61
|
+
required: string[];
|
|
62
|
+
};
|
|
63
|
+
} | {
|
|
64
|
+
name: string;
|
|
65
|
+
description: string;
|
|
66
|
+
input_schema: {
|
|
67
|
+
type: string;
|
|
68
|
+
properties: {
|
|
69
|
+
pattern: {
|
|
70
|
+
type: string;
|
|
71
|
+
description: string;
|
|
72
|
+
};
|
|
73
|
+
path: {
|
|
74
|
+
type: string;
|
|
75
|
+
description: string;
|
|
76
|
+
};
|
|
77
|
+
case_insensitive: {
|
|
78
|
+
type: string;
|
|
79
|
+
description: string;
|
|
80
|
+
};
|
|
81
|
+
context_lines: {
|
|
82
|
+
type: string;
|
|
83
|
+
description: string;
|
|
84
|
+
};
|
|
85
|
+
tail?: undefined;
|
|
86
|
+
};
|
|
87
|
+
required: string[];
|
|
88
|
+
};
|
|
89
|
+
} | {
|
|
90
|
+
name: string;
|
|
91
|
+
description: string;
|
|
92
|
+
input_schema: {
|
|
93
|
+
type: string;
|
|
94
|
+
properties: {
|
|
95
|
+
show_all: {
|
|
96
|
+
type: string;
|
|
97
|
+
description: string;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
} | {
|
|
102
|
+
name: string;
|
|
103
|
+
description: string;
|
|
104
|
+
input_schema: {
|
|
105
|
+
type: string;
|
|
106
|
+
properties: {
|
|
107
|
+
query: {
|
|
108
|
+
type: string;
|
|
109
|
+
description: string;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
required: string[];
|
|
113
|
+
};
|
|
114
|
+
} | {
|
|
115
|
+
name: string;
|
|
116
|
+
description: string;
|
|
117
|
+
input_schema: {
|
|
118
|
+
type: string;
|
|
119
|
+
properties: {
|
|
120
|
+
container: {
|
|
121
|
+
type: string;
|
|
122
|
+
description: string;
|
|
123
|
+
};
|
|
124
|
+
pattern: {
|
|
125
|
+
type: string;
|
|
126
|
+
description: string;
|
|
127
|
+
};
|
|
128
|
+
case_insensitive: {
|
|
129
|
+
type: string;
|
|
130
|
+
description: string;
|
|
131
|
+
};
|
|
132
|
+
context_lines: {
|
|
133
|
+
type: string;
|
|
134
|
+
description: string;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
required: string[];
|
|
138
|
+
};
|
|
139
|
+
} | {
|
|
140
|
+
name: string;
|
|
141
|
+
description: string;
|
|
142
|
+
input_schema: {
|
|
143
|
+
type: string;
|
|
144
|
+
properties: {};
|
|
145
|
+
required?: undefined;
|
|
146
|
+
};
|
|
147
|
+
} | {
|
|
148
|
+
name: string;
|
|
149
|
+
description: string;
|
|
150
|
+
input_schema: {
|
|
151
|
+
type: string;
|
|
152
|
+
properties: {};
|
|
153
|
+
required: never[];
|
|
154
|
+
};
|
|
155
|
+
} | {
|
|
156
|
+
name: string;
|
|
157
|
+
description: string;
|
|
158
|
+
input_schema: {
|
|
159
|
+
type: string;
|
|
160
|
+
properties: {
|
|
161
|
+
target_dir: {
|
|
162
|
+
type: string;
|
|
163
|
+
description: string;
|
|
164
|
+
};
|
|
165
|
+
path?: undefined;
|
|
166
|
+
event?: undefined;
|
|
167
|
+
version?: undefined;
|
|
168
|
+
previous_version?: undefined;
|
|
169
|
+
status?: undefined;
|
|
170
|
+
notes?: undefined;
|
|
171
|
+
limit?: undefined;
|
|
172
|
+
include_prerelease?: undefined;
|
|
173
|
+
org_id?: undefined;
|
|
174
|
+
};
|
|
175
|
+
required: string[];
|
|
176
|
+
};
|
|
177
|
+
} | {
|
|
178
|
+
name: string;
|
|
179
|
+
description: string;
|
|
180
|
+
input_schema: {
|
|
181
|
+
type: string;
|
|
182
|
+
properties: {
|
|
183
|
+
path: {
|
|
184
|
+
type: string;
|
|
185
|
+
description: string;
|
|
186
|
+
};
|
|
187
|
+
target_dir?: undefined;
|
|
188
|
+
event?: undefined;
|
|
189
|
+
version?: undefined;
|
|
190
|
+
previous_version?: undefined;
|
|
191
|
+
status?: undefined;
|
|
192
|
+
notes?: undefined;
|
|
193
|
+
limit?: undefined;
|
|
194
|
+
include_prerelease?: undefined;
|
|
195
|
+
org_id?: undefined;
|
|
196
|
+
};
|
|
197
|
+
required: string[];
|
|
198
|
+
};
|
|
199
|
+
} | {
|
|
200
|
+
name: string;
|
|
201
|
+
description: string;
|
|
202
|
+
input_schema: {
|
|
203
|
+
type: string;
|
|
204
|
+
properties: {
|
|
205
|
+
event: {
|
|
206
|
+
type: string;
|
|
207
|
+
enum: string[];
|
|
208
|
+
description: string;
|
|
209
|
+
};
|
|
210
|
+
version: {
|
|
211
|
+
type: string;
|
|
212
|
+
description: string;
|
|
213
|
+
};
|
|
214
|
+
previous_version: {
|
|
215
|
+
type: string;
|
|
216
|
+
description: string;
|
|
217
|
+
};
|
|
218
|
+
status: {
|
|
219
|
+
type: string;
|
|
220
|
+
enum: string[];
|
|
221
|
+
description: string;
|
|
222
|
+
};
|
|
223
|
+
notes: {
|
|
224
|
+
type: string;
|
|
225
|
+
description: string;
|
|
226
|
+
};
|
|
227
|
+
target_dir?: undefined;
|
|
228
|
+
path?: undefined;
|
|
229
|
+
limit?: undefined;
|
|
230
|
+
include_prerelease?: undefined;
|
|
231
|
+
org_id?: undefined;
|
|
232
|
+
};
|
|
233
|
+
required: string[];
|
|
234
|
+
};
|
|
235
|
+
} | {
|
|
236
|
+
name: string;
|
|
237
|
+
description: string;
|
|
238
|
+
input_schema: {
|
|
239
|
+
type: string;
|
|
240
|
+
properties: {
|
|
241
|
+
org_id: {
|
|
242
|
+
type: string;
|
|
243
|
+
description: string;
|
|
244
|
+
};
|
|
245
|
+
target_dir?: undefined;
|
|
246
|
+
path?: undefined;
|
|
247
|
+
event?: undefined;
|
|
248
|
+
version?: undefined;
|
|
249
|
+
previous_version?: undefined;
|
|
250
|
+
status?: undefined;
|
|
251
|
+
notes?: undefined;
|
|
252
|
+
limit?: undefined;
|
|
253
|
+
include_prerelease?: undefined;
|
|
254
|
+
};
|
|
255
|
+
required: string[];
|
|
256
|
+
};
|
|
257
|
+
})[];
|
|
258
|
+
export declare const TOOLS_OPENAI: {
|
|
259
|
+
type: "function";
|
|
260
|
+
function: {
|
|
261
|
+
name: string;
|
|
262
|
+
description: string;
|
|
263
|
+
parameters: {
|
|
264
|
+
type: string;
|
|
265
|
+
properties: {
|
|
266
|
+
command: {
|
|
267
|
+
type: string;
|
|
268
|
+
description: string;
|
|
269
|
+
};
|
|
270
|
+
gist: {
|
|
271
|
+
type: string;
|
|
272
|
+
description: string;
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
required: string[];
|
|
276
|
+
} | {
|
|
277
|
+
type: string;
|
|
278
|
+
properties: {
|
|
279
|
+
path: {
|
|
280
|
+
type: string;
|
|
281
|
+
description: string;
|
|
282
|
+
};
|
|
283
|
+
tail: {
|
|
284
|
+
type: string;
|
|
285
|
+
description: string;
|
|
286
|
+
};
|
|
287
|
+
pattern?: undefined;
|
|
288
|
+
case_insensitive?: undefined;
|
|
289
|
+
context_lines?: undefined;
|
|
290
|
+
};
|
|
291
|
+
required: string[];
|
|
292
|
+
} | {
|
|
293
|
+
type: string;
|
|
294
|
+
properties: {
|
|
295
|
+
path: {
|
|
296
|
+
type: string;
|
|
297
|
+
description: string;
|
|
298
|
+
};
|
|
299
|
+
tail?: undefined;
|
|
300
|
+
pattern?: undefined;
|
|
301
|
+
case_insensitive?: undefined;
|
|
302
|
+
context_lines?: undefined;
|
|
303
|
+
};
|
|
304
|
+
required: string[];
|
|
305
|
+
} | {
|
|
306
|
+
type: string;
|
|
307
|
+
properties: {
|
|
308
|
+
pattern: {
|
|
309
|
+
type: string;
|
|
310
|
+
description: string;
|
|
311
|
+
};
|
|
312
|
+
path: {
|
|
313
|
+
type: string;
|
|
314
|
+
description: string;
|
|
315
|
+
};
|
|
316
|
+
case_insensitive: {
|
|
317
|
+
type: string;
|
|
318
|
+
description: string;
|
|
319
|
+
};
|
|
320
|
+
context_lines: {
|
|
321
|
+
type: string;
|
|
322
|
+
description: string;
|
|
323
|
+
};
|
|
324
|
+
tail?: undefined;
|
|
325
|
+
};
|
|
326
|
+
required: string[];
|
|
327
|
+
} | {
|
|
328
|
+
type: string;
|
|
329
|
+
properties: {
|
|
330
|
+
show_all: {
|
|
331
|
+
type: string;
|
|
332
|
+
description: string;
|
|
333
|
+
};
|
|
334
|
+
};
|
|
335
|
+
} | {
|
|
336
|
+
type: string;
|
|
337
|
+
properties: {
|
|
338
|
+
query: {
|
|
339
|
+
type: string;
|
|
340
|
+
description: string;
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
required: string[];
|
|
344
|
+
} | {
|
|
345
|
+
type: string;
|
|
346
|
+
properties: {
|
|
347
|
+
container: {
|
|
348
|
+
type: string;
|
|
349
|
+
description: string;
|
|
350
|
+
};
|
|
351
|
+
pattern: {
|
|
352
|
+
type: string;
|
|
353
|
+
description: string;
|
|
354
|
+
};
|
|
355
|
+
case_insensitive: {
|
|
356
|
+
type: string;
|
|
357
|
+
description: string;
|
|
358
|
+
};
|
|
359
|
+
context_lines: {
|
|
360
|
+
type: string;
|
|
361
|
+
description: string;
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
required: string[];
|
|
365
|
+
} | {
|
|
366
|
+
type: string;
|
|
367
|
+
properties: {};
|
|
368
|
+
required?: undefined;
|
|
369
|
+
} | {
|
|
370
|
+
type: string;
|
|
371
|
+
properties: {};
|
|
372
|
+
required: never[];
|
|
373
|
+
} | {
|
|
374
|
+
type: string;
|
|
375
|
+
properties: {
|
|
376
|
+
target_dir: {
|
|
377
|
+
type: string;
|
|
378
|
+
description: string;
|
|
379
|
+
};
|
|
380
|
+
path?: undefined;
|
|
381
|
+
event?: undefined;
|
|
382
|
+
version?: undefined;
|
|
383
|
+
previous_version?: undefined;
|
|
384
|
+
status?: undefined;
|
|
385
|
+
notes?: undefined;
|
|
386
|
+
limit?: undefined;
|
|
387
|
+
include_prerelease?: undefined;
|
|
388
|
+
org_id?: undefined;
|
|
389
|
+
};
|
|
390
|
+
required: string[];
|
|
391
|
+
} | {
|
|
392
|
+
type: string;
|
|
393
|
+
properties: {
|
|
394
|
+
path: {
|
|
395
|
+
type: string;
|
|
396
|
+
description: string;
|
|
397
|
+
};
|
|
398
|
+
target_dir?: undefined;
|
|
399
|
+
event?: undefined;
|
|
400
|
+
version?: undefined;
|
|
401
|
+
previous_version?: undefined;
|
|
402
|
+
status?: undefined;
|
|
403
|
+
notes?: undefined;
|
|
404
|
+
limit?: undefined;
|
|
405
|
+
include_prerelease?: undefined;
|
|
406
|
+
org_id?: undefined;
|
|
407
|
+
};
|
|
408
|
+
required: string[];
|
|
409
|
+
} | {
|
|
410
|
+
type: string;
|
|
411
|
+
properties: {
|
|
412
|
+
event: {
|
|
413
|
+
type: string;
|
|
414
|
+
enum: string[];
|
|
415
|
+
description: string;
|
|
416
|
+
};
|
|
417
|
+
version: {
|
|
418
|
+
type: string;
|
|
419
|
+
description: string;
|
|
420
|
+
};
|
|
421
|
+
previous_version: {
|
|
422
|
+
type: string;
|
|
423
|
+
description: string;
|
|
424
|
+
};
|
|
425
|
+
status: {
|
|
426
|
+
type: string;
|
|
427
|
+
enum: string[];
|
|
428
|
+
description: string;
|
|
429
|
+
};
|
|
430
|
+
notes: {
|
|
431
|
+
type: string;
|
|
432
|
+
description: string;
|
|
433
|
+
};
|
|
434
|
+
target_dir?: undefined;
|
|
435
|
+
path?: undefined;
|
|
436
|
+
limit?: undefined;
|
|
437
|
+
include_prerelease?: undefined;
|
|
438
|
+
org_id?: undefined;
|
|
439
|
+
};
|
|
440
|
+
required: string[];
|
|
441
|
+
} | {
|
|
442
|
+
type: string;
|
|
443
|
+
properties: {
|
|
444
|
+
org_id: {
|
|
445
|
+
type: string;
|
|
446
|
+
description: string;
|
|
447
|
+
};
|
|
448
|
+
target_dir?: undefined;
|
|
449
|
+
path?: undefined;
|
|
450
|
+
event?: undefined;
|
|
451
|
+
version?: undefined;
|
|
452
|
+
previous_version?: undefined;
|
|
453
|
+
status?: undefined;
|
|
454
|
+
notes?: undefined;
|
|
455
|
+
limit?: undefined;
|
|
456
|
+
include_prerelease?: undefined;
|
|
457
|
+
};
|
|
458
|
+
required: string[];
|
|
459
|
+
};
|
|
460
|
+
};
|
|
461
|
+
}[];
|
|
462
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,qBAAqB,EACrB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,SAAS,GACf,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAY9C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAQ3B,CAAC;AAGF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAOtB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tools module — barrel file.
|
|
3
|
+
* Aggregates tool definitions from domain submodules and re-exports
|
|
4
|
+
* the central handleToolCall dispatcher plus shared types.
|
|
5
|
+
*/
|
|
6
|
+
// Re-export types
|
|
7
|
+
export { detectDangerousCommand, checkCommand, allCategoriesApproved, } from './types.js';
|
|
8
|
+
// Re-export handler functions used externally
|
|
9
|
+
export { runCommand } from './command.js';
|
|
10
|
+
export { handleToolCall } from './handler.js';
|
|
11
|
+
// Import tool definition arrays from each domain module
|
|
12
|
+
import { COMMAND_TOOLS } from './command.js';
|
|
13
|
+
import { FILESYSTEM_TOOLS } from './filesystem.js';
|
|
14
|
+
import { ENV_TOOLS } from './env.js';
|
|
15
|
+
import { DATABASE_TOOLS } from './database.js';
|
|
16
|
+
import { DOCKER_TOOLS } from './docker.js';
|
|
17
|
+
import { AUTH_TOOLS } from './auth-tools.js';
|
|
18
|
+
import { DEPLOYMENT_TOOLS } from './deployment.js';
|
|
19
|
+
// Tool definitions for Anthropic format
|
|
20
|
+
export const TOOLS_ANTHROPIC = [
|
|
21
|
+
...COMMAND_TOOLS,
|
|
22
|
+
...FILESYSTEM_TOOLS,
|
|
23
|
+
...ENV_TOOLS,
|
|
24
|
+
...DATABASE_TOOLS,
|
|
25
|
+
...DOCKER_TOOLS,
|
|
26
|
+
...AUTH_TOOLS,
|
|
27
|
+
...DEPLOYMENT_TOOLS,
|
|
28
|
+
];
|
|
29
|
+
// Convert to OpenAI format
|
|
30
|
+
export const TOOLS_OPENAI = TOOLS_ANTHROPIC.map((tool) => ({
|
|
31
|
+
type: 'function',
|
|
32
|
+
function: {
|
|
33
|
+
name: tool.name,
|
|
34
|
+
description: tool.description,
|
|
35
|
+
parameters: tool.input_schema,
|
|
36
|
+
},
|
|
37
|
+
}));
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,kBAAkB;AAClB,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,qBAAqB,GAItB,MAAM,YAAY,CAAC;AAEpB,8CAA8C;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,wDAAwD;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,wCAAwC;AACxC,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,GAAG,aAAa;IAChB,GAAG,gBAAgB;IACnB,GAAG,SAAS;IACZ,GAAG,cAAc;IACjB,GAAG,YAAY;IACf,GAAG,UAAU;IACb,GAAG,gBAAgB;CACpB,CAAC;AAEF,2BAA2B;AAC3B,MAAM,CAAC,MAAM,YAAY,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACzD,IAAI,EAAE,UAAmB;IACzB,QAAQ,EAAE;QACR,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,UAAU,EAAE,IAAI,CAAC,YAAY;KAC9B;CACF,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve a path relative to deployment directory.
|
|
3
|
+
*/
|
|
4
|
+
export declare function resolvePath(filePath: string): string;
|
|
5
|
+
/**
|
|
6
|
+
* Make an HTTPS GET request and return the parsed JSON response.
|
|
7
|
+
*/
|
|
8
|
+
export declare function httpsGetJson(url: string, headers: Record<string, string>): Promise<Record<string, unknown>>;
|
|
9
|
+
/**
|
|
10
|
+
* Format file mode (permissions) as a string like 'drwxr-xr-x'.
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatMode(mode: number, isDir: boolean, isLink: boolean): string;
|
|
13
|
+
/**
|
|
14
|
+
* Format file size in human-readable format.
|
|
15
|
+
*/
|
|
16
|
+
export declare function formatSize(size: number): string;
|
|
17
|
+
/**
|
|
18
|
+
* Format date in ls-like format.
|
|
19
|
+
*/
|
|
20
|
+
export declare function formatDate(date: Date): string;
|
|
21
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/tools/shared.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGpD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA0B3G;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAchF;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAO7C"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import * as https from 'https';
|
|
3
|
+
import { getDeploymentDir } from '../settings.js';
|
|
4
|
+
/**
|
|
5
|
+
* Resolve a path relative to deployment directory.
|
|
6
|
+
*/
|
|
7
|
+
export function resolvePath(filePath) {
|
|
8
|
+
const p = path.isAbsolute(filePath) ? filePath : path.join(getDeploymentDir(), filePath);
|
|
9
|
+
return p;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Make an HTTPS GET request and return the parsed JSON response.
|
|
13
|
+
*/
|
|
14
|
+
export function httpsGetJson(url, headers) {
|
|
15
|
+
return new Promise((resolve, reject) => {
|
|
16
|
+
const parsedUrl = new URL(url);
|
|
17
|
+
const options = {
|
|
18
|
+
hostname: parsedUrl.hostname,
|
|
19
|
+
port: parsedUrl.port || 443,
|
|
20
|
+
path: parsedUrl.pathname + parsedUrl.search,
|
|
21
|
+
method: 'GET',
|
|
22
|
+
headers,
|
|
23
|
+
};
|
|
24
|
+
const req = https.request(options, (res) => {
|
|
25
|
+
let data = '';
|
|
26
|
+
res.on('data', (chunk) => { data += chunk; });
|
|
27
|
+
res.on('end', () => {
|
|
28
|
+
try {
|
|
29
|
+
resolve(JSON.parse(data));
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
reject(new Error(`Invalid JSON response from ${url}: ${data.substring(0, 200)}`));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
req.on('error', (err) => reject(err));
|
|
37
|
+
req.end();
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Format file mode (permissions) as a string like 'drwxr-xr-x'.
|
|
42
|
+
*/
|
|
43
|
+
export function formatMode(mode, isDir, isLink) {
|
|
44
|
+
const typeChar = isLink ? 'l' : isDir ? 'd' : '-';
|
|
45
|
+
const perms = [
|
|
46
|
+
(mode & 0o400) ? 'r' : '-',
|
|
47
|
+
(mode & 0o200) ? 'w' : '-',
|
|
48
|
+
(mode & 0o100) ? 'x' : '-',
|
|
49
|
+
(mode & 0o040) ? 'r' : '-',
|
|
50
|
+
(mode & 0o020) ? 'w' : '-',
|
|
51
|
+
(mode & 0o010) ? 'x' : '-',
|
|
52
|
+
(mode & 0o004) ? 'r' : '-',
|
|
53
|
+
(mode & 0o002) ? 'w' : '-',
|
|
54
|
+
(mode & 0o001) ? 'x' : '-',
|
|
55
|
+
].join('');
|
|
56
|
+
return typeChar + perms;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Format file size in human-readable format.
|
|
60
|
+
*/
|
|
61
|
+
export function formatSize(size) {
|
|
62
|
+
return size.toString().padStart(8);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Format date in ls-like format.
|
|
66
|
+
*/
|
|
67
|
+
export function formatDate(date) {
|
|
68
|
+
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
69
|
+
const month = months[date.getMonth()];
|
|
70
|
+
const day = date.getDate().toString().padStart(2);
|
|
71
|
+
const hours = date.getHours().toString().padStart(2, '0');
|
|
72
|
+
const mins = date.getMinutes().toString().padStart(2, '0');
|
|
73
|
+
return `${month} ${day} ${hours}:${mins}`;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/tools/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAA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AAiB,EACtB,KAAK,SAAS,GACf,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/tools/types.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,qBAAqB,GAItB,MAAM,0BAA0B,CAAC"}
|