@qvac/harness 0.7.2 → 0.8.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/CHANGELOG.md +70 -1
- package/NOTICE.md +16 -0
- package/dist-lib/lib/capabilities/completion.d.ts +1 -0
- package/dist-lib/lib/capabilities/completion.js +46 -8
- package/dist-lib/lib/capabilities/tool-turns.d.ts +3 -0
- package/dist-lib/lib/capabilities/tool-turns.js +7 -0
- package/dist-lib/lib/context-window.js +2 -2
- package/dist-lib/lib/helpers/run-outcome.d.ts +4 -1
- package/dist-lib/lib/helpers/run-outcome.js +14 -8
- package/dist-lib/lib/helpers/tool-call-markup.js +4 -4
- package/dist-lib/lib/hooks/built-in/arg-repair.js +7 -0
- package/dist-lib/lib/office/engine/codes.d.ts +62 -0
- package/dist-lib/lib/office/engine/codes.js +61 -0
- package/dist-lib/lib/office/engine/docx/document.d.ts +216 -0
- package/dist-lib/lib/office/engine/docx/document.js +1152 -0
- package/dist-lib/lib/office/engine/docx/index.d.ts +7 -0
- package/dist-lib/lib/office/engine/docx/index.js +8 -0
- package/dist-lib/lib/office/engine/docx/styles.d.ts +31 -0
- package/dist-lib/lib/office/engine/docx/styles.js +173 -0
- package/dist-lib/lib/office/engine/docx/template.d.ts +18 -0
- package/dist-lib/lib/office/engine/docx/template.js +133 -0
- package/dist-lib/lib/office/engine/docx/text.d.ts +55 -0
- package/dist-lib/lib/office/engine/docx/text.js +538 -0
- package/dist-lib/lib/office/engine/drawingml/chart.d.ts +63 -0
- package/dist-lib/lib/office/engine/drawingml/chart.js +539 -0
- package/dist-lib/lib/office/engine/drawingml/text.d.ts +35 -0
- package/dist-lib/lib/office/engine/drawingml/text.js +352 -0
- package/dist-lib/lib/office/engine/errors.d.ts +6 -0
- package/dist-lib/lib/office/engine/errors.js +12 -0
- package/dist-lib/lib/office/engine/image.d.ts +8 -0
- package/dist-lib/lib/office/engine/image.js +48 -0
- package/dist-lib/lib/office/engine/index.d.ts +12 -0
- package/dist-lib/lib/office/engine/index.js +7 -0
- package/dist-lib/lib/office/engine/opc/content-types.d.ts +17 -0
- package/dist-lib/lib/office/engine/opc/content-types.js +74 -0
- package/dist-lib/lib/office/engine/opc/media.d.ts +13 -0
- package/dist-lib/lib/office/engine/opc/media.js +11 -0
- package/dist-lib/lib/office/engine/opc/package.d.ts +51 -0
- package/dist-lib/lib/office/engine/opc/package.js +324 -0
- package/dist-lib/lib/office/engine/opc/paths.d.ts +7 -0
- package/dist-lib/lib/office/engine/opc/paths.js +46 -0
- package/dist-lib/lib/office/engine/opc/properties.d.ts +7 -0
- package/dist-lib/lib/office/engine/opc/properties.js +75 -0
- package/dist-lib/lib/office/engine/opc/relationships.d.ts +23 -0
- package/dist-lib/lib/office/engine/opc/relationships.js +65 -0
- package/dist-lib/lib/office/engine/opc/zip.d.ts +15 -0
- package/dist-lib/lib/office/engine/opc/zip.js +264 -0
- package/dist-lib/lib/office/engine/pptx/fit.d.ts +12 -0
- package/dist-lib/lib/office/engine/pptx/fit.js +37 -0
- package/dist-lib/lib/office/engine/pptx/index.d.ts +8 -0
- package/dist-lib/lib/office/engine/pptx/index.js +8 -0
- package/dist-lib/lib/office/engine/pptx/inherit.d.ts +29 -0
- package/dist-lib/lib/office/engine/pptx/inherit.js +155 -0
- package/dist-lib/lib/office/engine/pptx/notes.d.ts +5 -0
- package/dist-lib/lib/office/engine/pptx/notes.js +85 -0
- package/dist-lib/lib/office/engine/pptx/presentation.d.ts +54 -0
- package/dist-lib/lib/office/engine/pptx/presentation.js +749 -0
- package/dist-lib/lib/office/engine/pptx/read.d.ts +9 -0
- package/dist-lib/lib/office/engine/pptx/read.js +66 -0
- package/dist-lib/lib/office/engine/pptx/shapes.d.ts +52 -0
- package/dist-lib/lib/office/engine/pptx/shapes.js +276 -0
- package/dist-lib/lib/office/engine/pptx/slides.d.ts +27 -0
- package/dist-lib/lib/office/engine/pptx/slides.js +123 -0
- package/dist-lib/lib/office/engine/pptx/template.d.ts +20 -0
- package/dist-lib/lib/office/engine/pptx/template.js +391 -0
- package/dist-lib/lib/office/engine/pptx/types.d.ts +120 -0
- package/dist-lib/lib/office/engine/pptx/types.js +1 -0
- package/dist-lib/lib/office/engine/units.d.ts +3 -0
- package/dist-lib/lib/office/engine/units.js +12 -0
- package/dist-lib/lib/office/engine/utf8.d.ts +2 -0
- package/dist-lib/lib/office/engine/utf8.js +103 -0
- package/dist-lib/lib/office/engine/xlsx/formula.d.ts +49 -0
- package/dist-lib/lib/office/engine/xlsx/formula.js +381 -0
- package/dist-lib/lib/office/engine/xlsx/index.d.ts +8 -0
- package/dist-lib/lib/office/engine/xlsx/index.js +8 -0
- package/dist-lib/lib/office/engine/xlsx/refs.d.ts +22 -0
- package/dist-lib/lib/office/engine/xlsx/refs.js +82 -0
- package/dist-lib/lib/office/engine/xlsx/reshape.d.ts +21 -0
- package/dist-lib/lib/office/engine/xlsx/reshape.js +424 -0
- package/dist-lib/lib/office/engine/xlsx/sheet.d.ts +108 -0
- package/dist-lib/lib/office/engine/xlsx/sheet.js +662 -0
- package/dist-lib/lib/office/engine/xlsx/strings.d.ts +15 -0
- package/dist-lib/lib/office/engine/xlsx/strings.js +93 -0
- package/dist-lib/lib/office/engine/xlsx/styles.d.ts +38 -0
- package/dist-lib/lib/office/engine/xlsx/styles.js +369 -0
- package/dist-lib/lib/office/engine/xlsx/template.d.ts +7 -0
- package/dist-lib/lib/office/engine/xlsx/template.js +54 -0
- package/dist-lib/lib/office/engine/xlsx/workbook.d.ts +161 -0
- package/dist-lib/lib/office/engine/xlsx/workbook.js +850 -0
- package/dist-lib/lib/office/engine/xlsx/write.d.ts +2 -0
- package/dist-lib/lib/office/engine/xlsx/write.js +42 -0
- package/dist-lib/lib/office/engine/xml.d.ts +45 -0
- package/dist-lib/lib/office/engine/xml.js +258 -0
- package/dist-lib/lib/tools/exec/scope.d.ts +2 -0
- package/dist-lib/lib/tools/exec/scope.js +33 -2
- package/dist-lib/lib/tools/pdf/build.d.ts +43 -0
- package/dist-lib/lib/tools/pdf/build.js +150 -0
- package/dist-lib/lib/tools/pdf/images.d.ts +7 -0
- package/dist-lib/lib/tools/pdf/images.js +82 -0
- package/dist-lib/lib/tools/pdf/request.d.ts +63 -0
- package/dist-lib/lib/tools/pdf/request.js +335 -0
- package/dist-lib/lib/tools/pdf.d.ts +6 -0
- package/dist-lib/lib/tools/pdf.js +302 -0
- package/dist-lib/lib/tools/skill.js +14 -0
- package/dist-lib/lib/tools/weather-lookup/geocode.d.ts +26 -0
- package/dist-lib/lib/tools/weather-lookup/geocode.js +110 -0
- package/dist-lib/lib/tools/weather-lookup/place.js +5 -1
- package/dist-lib/lib/tools/weather-lookup.d.ts +2 -1
- package/dist-lib/lib/tools/weather-lookup.js +115 -84
- package/package.json +29 -1
- package/worker/harness-sidecar.mjs +3 -1
|
@@ -4,12 +4,13 @@ import { lookupHost } from '../dns-lookup.js';
|
|
|
4
4
|
import { errorMessage } from '../guards.js';
|
|
5
5
|
import { isRedirectStatus } from './http-request/request.js';
|
|
6
6
|
import { resolveOutboundUrl } from './url-guard.js';
|
|
7
|
+
import { choose, geocode, GEOCODE_TIMEOUT_MS, GEOCODER_HOST } from './weather-lookup/geocode.js';
|
|
7
8
|
import { checkQualifier, cityMatches, describePlace, qualifierOf } from './weather-lookup/place.js';
|
|
8
9
|
import { placeOf, renderReport, WeatherJsonSchema } from './weather-lookup/report.js';
|
|
9
10
|
const WEATHER_HOST = 'wttr.in';
|
|
10
11
|
const LOOKUP_TIMEOUT_MS = 15_000;
|
|
11
12
|
const MAX_BODY_BYTES = 400_000;
|
|
12
|
-
export function createWeatherLookupTool({ fetch
|
|
13
|
+
export function createWeatherLookupTool({ fetch = noRedirectFetch, resolveHost = lookupHost, geocodeTimeoutMs = GEOCODE_TIMEOUT_MS } = {}) {
|
|
13
14
|
return {
|
|
14
15
|
name: 'weather_lookup',
|
|
15
16
|
toolset: 'http-request',
|
|
@@ -17,7 +18,8 @@ export function createWeatherLookupTool({ fetch: fetchImpl, resolveHost = lookup
|
|
|
17
18
|
autoApprove: true,
|
|
18
19
|
description: 'Look up the current weather and a three-day forecast for a place, via wttr.in. ' +
|
|
19
20
|
'Returns the place the service resolved on its first line, then the conditions now and ' +
|
|
20
|
-
'one line per day. Use it for any question about weather, temperature or forecast.'
|
|
21
|
+
'one line per day. Use it for any question about weather, temperature or forecast. ' +
|
|
22
|
+
'When a name matches several places it answers with a question listing them.',
|
|
21
23
|
parameters: {
|
|
22
24
|
type: 'object',
|
|
23
25
|
properties: {
|
|
@@ -30,93 +32,122 @@ export function createWeatherLookupTool({ fetch: fetchImpl, resolveHost = lookup
|
|
|
30
32
|
required: ['location']
|
|
31
33
|
},
|
|
32
34
|
effect: () => 'read',
|
|
33
|
-
resource: () => ({ kind: 'host', label: WEATHER_HOST }),
|
|
34
|
-
|
|
35
|
-
const raw = args.location;
|
|
36
|
-
if (typeof raw !== 'string' || raw.trim().length === 0) {
|
|
37
|
-
return { error: 'location must be a non-empty string' };
|
|
38
|
-
}
|
|
39
|
-
const location = raw.trim();
|
|
40
|
-
if (ctx?.signal?.aborted) {
|
|
41
|
-
return { error: 'weather_lookup cancelled' };
|
|
42
|
-
}
|
|
43
|
-
const url = new URL(`https://${WEATHER_HOST}/${encodeURIComponent(location)}?format=j1`);
|
|
44
|
-
const fetch = fetchImpl ?? noRedirectFetch;
|
|
45
|
-
const controller = new AbortController();
|
|
46
|
-
const timeout = setTimeout(() => controller.abort(undefined), LOOKUP_TIMEOUT_MS);
|
|
47
|
-
const onCallerAbort = () => controller.abort(undefined);
|
|
48
|
-
ctx?.signal?.addEventListener('abort', onCallerAbort);
|
|
49
|
-
try {
|
|
50
|
-
const check = await resolveOutboundUrl(url, resolveHost, ctx?.signal);
|
|
51
|
-
if (check.blocked) {
|
|
52
|
-
return { error: check.blocked };
|
|
53
|
-
}
|
|
54
|
-
const response = await fetch(url, {
|
|
55
|
-
method: 'GET',
|
|
56
|
-
headers: { Accept: 'application/json' },
|
|
57
|
-
signal: controller.signal,
|
|
58
|
-
redirect: 'manual',
|
|
59
|
-
validatedAddresses: check.addresses,
|
|
60
|
-
maxBytes: MAX_BODY_BYTES
|
|
61
|
-
});
|
|
62
|
-
if (isRedirectStatus(response.status)) {
|
|
63
|
-
return { error: `${WEATHER_HOST} redirected the lookup for "${location}"` };
|
|
64
|
-
}
|
|
65
|
-
const body = await response.text();
|
|
66
|
-
if (/location not found/i.test(body)) {
|
|
67
|
-
return { content: notFound(location) };
|
|
68
|
-
}
|
|
69
|
-
if (response.status !== 200) {
|
|
70
|
-
return { error: unavailable(`it answered HTTP ${response.status}`), code: 'transport' };
|
|
71
|
-
}
|
|
72
|
-
let json;
|
|
73
|
-
try {
|
|
74
|
-
json = WeatherJsonSchema.parse(JSON.parse(body));
|
|
75
|
-
}
|
|
76
|
-
catch {
|
|
77
|
-
return { error: unavailable('it did not return a forecast') };
|
|
78
|
-
}
|
|
79
|
-
const place = placeOf(json);
|
|
80
|
-
if (place === null) {
|
|
81
|
-
return { content: notFound(location) };
|
|
82
|
-
}
|
|
83
|
-
const qualifier = qualifierOf(location);
|
|
84
|
-
const verdict = qualifier === null ? null : checkQualifier(qualifier, place);
|
|
85
|
-
const named = cityMatches(location, place);
|
|
86
|
-
if (verdict === 'contradiction' && !named) {
|
|
87
|
-
return {
|
|
88
|
-
content: `No such place: "${location}". ${WEATHER_HOST} resolved it to ` +
|
|
89
|
-
`${describePlace(place)}, which is somewhere else.`
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
const verified = qualifier === null ? named : verdict === 'match';
|
|
93
|
-
return { content: renderReport(json, place, { asked: location, verified }) };
|
|
94
|
-
}
|
|
95
|
-
catch (err) {
|
|
96
|
-
if (ctx?.signal?.aborted) {
|
|
97
|
-
return { error: 'weather_lookup cancelled' };
|
|
98
|
-
}
|
|
99
|
-
if (controller.signal.aborted) {
|
|
100
|
-
return {
|
|
101
|
-
error: `weather_lookup timed out after ${LOOKUP_TIMEOUT_MS} ms`,
|
|
102
|
-
code: 'timeout'
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
return {
|
|
106
|
-
error: unavailable(errorMessage(err)),
|
|
107
|
-
code: 'transport'
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
finally {
|
|
111
|
-
clearTimeout(timeout);
|
|
112
|
-
ctx?.signal?.removeEventListener('abort', onCallerAbort);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
35
|
+
resource: () => ({ kind: 'host', label: `${GEOCODER_HOST}, ${WEATHER_HOST}` }),
|
|
36
|
+
execute: (args, ctx) => execute(args.location, ctx?.signal, { fetch, resolveHost, timeoutMs: geocodeTimeoutMs })
|
|
115
37
|
};
|
|
116
38
|
}
|
|
39
|
+
async function execute(raw, callerSignal, deps) {
|
|
40
|
+
if (typeof raw !== 'string' || raw.trim().length === 0) {
|
|
41
|
+
return { error: 'location must be a non-empty string' };
|
|
42
|
+
}
|
|
43
|
+
const location = raw.trim();
|
|
44
|
+
if (callerSignal?.aborted) {
|
|
45
|
+
return { error: 'weather_lookup cancelled' };
|
|
46
|
+
}
|
|
47
|
+
const controller = new AbortController();
|
|
48
|
+
const timeout = setTimeout(() => controller.abort(undefined), LOOKUP_TIMEOUT_MS);
|
|
49
|
+
const onCallerAbort = () => controller.abort(undefined);
|
|
50
|
+
callerSignal?.addEventListener('abort', onCallerAbort);
|
|
51
|
+
try {
|
|
52
|
+
return await lookup(location, { ...deps, signal: controller.signal });
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
return failure(err, controller.signal, callerSignal);
|
|
56
|
+
}
|
|
57
|
+
finally {
|
|
58
|
+
clearTimeout(timeout);
|
|
59
|
+
callerSignal?.removeEventListener('abort', onCallerAbort);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async function lookup(location, request) {
|
|
63
|
+
const city = (location.split(',')[0] ?? '').trim();
|
|
64
|
+
const candidates = city.length === 0 ? [] : await geocode(city, request);
|
|
65
|
+
const choice = choose(city, qualifierOf(location), candidates);
|
|
66
|
+
if (choice === null) {
|
|
67
|
+
return byName(location, request);
|
|
68
|
+
}
|
|
69
|
+
if ('contenders' in choice) {
|
|
70
|
+
return reply(which(city, choice.contenders));
|
|
71
|
+
}
|
|
72
|
+
return byCoordinates(location, choice, request);
|
|
73
|
+
}
|
|
74
|
+
async function byCoordinates(location, { place, verified }, request) {
|
|
75
|
+
const fetched = await forecast(`${place.latitude},${place.longitude}`, location, request);
|
|
76
|
+
if (!('json' in fetched)) {
|
|
77
|
+
return fetched;
|
|
78
|
+
}
|
|
79
|
+
return { content: renderReport(fetched.json, place, { asked: location, verified }) };
|
|
80
|
+
}
|
|
81
|
+
async function byName(location, request) {
|
|
82
|
+
const fetched = await forecast(encodeURIComponent(location), location, request);
|
|
83
|
+
if (!('json' in fetched)) {
|
|
84
|
+
return fetched;
|
|
85
|
+
}
|
|
86
|
+
const place = placeOf(fetched.json);
|
|
87
|
+
if (place === null) {
|
|
88
|
+
return reply(notFound(location));
|
|
89
|
+
}
|
|
90
|
+
const qualifier = qualifierOf(location);
|
|
91
|
+
const verdict = qualifier === null ? null : checkQualifier(qualifier, place);
|
|
92
|
+
const named = cityMatches(location, place);
|
|
93
|
+
if (verdict === 'contradiction' && !named) {
|
|
94
|
+
return reply(`No such place: "${location}". ${WEATHER_HOST} resolved it to ` +
|
|
95
|
+
`${describePlace(place)}, which is somewhere else.`);
|
|
96
|
+
}
|
|
97
|
+
const verified = qualifier === null ? named : verdict === 'match';
|
|
98
|
+
return { content: renderReport(fetched.json, place, { asked: location, verified }) };
|
|
99
|
+
}
|
|
100
|
+
async function forecast(path, location, request) {
|
|
101
|
+
const url = new URL(`https://${WEATHER_HOST}/${path}?format=j1`);
|
|
102
|
+
const check = await resolveOutboundUrl(url, request.resolveHost, request.signal);
|
|
103
|
+
if (check.blocked) {
|
|
104
|
+
return { error: check.blocked };
|
|
105
|
+
}
|
|
106
|
+
const response = await request.fetch(url, {
|
|
107
|
+
method: 'GET',
|
|
108
|
+
headers: { Accept: 'application/json' },
|
|
109
|
+
signal: request.signal,
|
|
110
|
+
redirect: 'manual',
|
|
111
|
+
validatedAddresses: check.addresses,
|
|
112
|
+
maxBytes: MAX_BODY_BYTES
|
|
113
|
+
});
|
|
114
|
+
if (isRedirectStatus(response.status)) {
|
|
115
|
+
return { error: `${WEATHER_HOST} redirected the lookup for "${location}"` };
|
|
116
|
+
}
|
|
117
|
+
return readForecast(response.status, await response.text(), location);
|
|
118
|
+
}
|
|
119
|
+
function readForecast(status, body, location) {
|
|
120
|
+
if (/location not found/i.test(body)) {
|
|
121
|
+
return reply(notFound(location));
|
|
122
|
+
}
|
|
123
|
+
if (status !== 200) {
|
|
124
|
+
return { error: unavailable(`it answered HTTP ${status}`), code: 'transport' };
|
|
125
|
+
}
|
|
126
|
+
try {
|
|
127
|
+
return { json: WeatherJsonSchema.parse(JSON.parse(body)) };
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
return { error: unavailable('it did not return a forecast') };
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function failure(err, signal, callerSignal) {
|
|
134
|
+
if (callerSignal?.aborted) {
|
|
135
|
+
return { error: 'weather_lookup cancelled' };
|
|
136
|
+
}
|
|
137
|
+
if (signal.aborted) {
|
|
138
|
+
return { error: `weather_lookup timed out after ${LOOKUP_TIMEOUT_MS} ms`, code: 'timeout' };
|
|
139
|
+
}
|
|
140
|
+
return { error: unavailable(errorMessage(err)), code: 'transport' };
|
|
141
|
+
}
|
|
117
142
|
function unavailable(reason) {
|
|
118
143
|
return `The weather service could not be reached: ${reason}.`;
|
|
119
144
|
}
|
|
145
|
+
function reply(content) {
|
|
146
|
+
return { content, answer: true };
|
|
147
|
+
}
|
|
120
148
|
function notFound(location) {
|
|
121
149
|
return `No such place: "${location}". ${WEATHER_HOST} does not know it.`;
|
|
122
150
|
}
|
|
151
|
+
function which(city, places) {
|
|
152
|
+
return `Which ${city}: ${places.map(describePlace).join('; ')}?`;
|
|
153
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qvac/harness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"bare": ">=1.34.0"
|
|
@@ -478,6 +478,22 @@
|
|
|
478
478
|
"types": "./dist-lib/lib/tools/outbound-guard.d.ts",
|
|
479
479
|
"default": "./dist-lib/lib/tools/outbound-guard.js"
|
|
480
480
|
},
|
|
481
|
+
"./lib/tools/pdf.ts": {
|
|
482
|
+
"types": "./dist-lib/lib/tools/pdf.d.ts",
|
|
483
|
+
"default": "./dist-lib/lib/tools/pdf.js"
|
|
484
|
+
},
|
|
485
|
+
"./lib/tools/pdf/build.ts": {
|
|
486
|
+
"types": "./dist-lib/lib/tools/pdf/build.d.ts",
|
|
487
|
+
"default": "./dist-lib/lib/tools/pdf/build.js"
|
|
488
|
+
},
|
|
489
|
+
"./lib/tools/pdf/images.ts": {
|
|
490
|
+
"types": "./dist-lib/lib/tools/pdf/images.d.ts",
|
|
491
|
+
"default": "./dist-lib/lib/tools/pdf/images.js"
|
|
492
|
+
},
|
|
493
|
+
"./lib/tools/pdf/request.ts": {
|
|
494
|
+
"types": "./dist-lib/lib/tools/pdf/request.d.ts",
|
|
495
|
+
"default": "./dist-lib/lib/tools/pdf/request.js"
|
|
496
|
+
},
|
|
481
497
|
"./lib/tools/private-ip.ts": {
|
|
482
498
|
"types": "./dist-lib/lib/tools/private-ip.d.ts",
|
|
483
499
|
"default": "./dist-lib/lib/tools/private-ip.js"
|
|
@@ -606,6 +622,10 @@
|
|
|
606
622
|
"types": "./dist-lib/lib/tools/weather-lookup.d.ts",
|
|
607
623
|
"default": "./dist-lib/lib/tools/weather-lookup.js"
|
|
608
624
|
},
|
|
625
|
+
"./lib/tools/weather-lookup/geocode.ts": {
|
|
626
|
+
"types": "./dist-lib/lib/tools/weather-lookup/geocode.d.ts",
|
|
627
|
+
"default": "./dist-lib/lib/tools/weather-lookup/geocode.js"
|
|
628
|
+
},
|
|
609
629
|
"./lib/tools/weather-lookup/place.ts": {
|
|
610
630
|
"types": "./dist-lib/lib/tools/weather-lookup/place.d.ts",
|
|
611
631
|
"default": "./dist-lib/lib/tools/weather-lookup/place.js"
|
|
@@ -712,6 +732,11 @@
|
|
|
712
732
|
"types": "@qvac/sdk",
|
|
713
733
|
"bare": "@qvac/inference",
|
|
714
734
|
"default": "@qvac/sdk"
|
|
735
|
+
},
|
|
736
|
+
"#zlib": {
|
|
737
|
+
"types": "bare-zlib",
|
|
738
|
+
"bare": "bare-zlib",
|
|
739
|
+
"default": "zlib"
|
|
715
740
|
}
|
|
716
741
|
},
|
|
717
742
|
"dependencies": {
|
|
@@ -719,6 +744,7 @@
|
|
|
719
744
|
"@qvac/langdetect-text": "0.1.2",
|
|
720
745
|
"@qvac/sdk": "0.20.0",
|
|
721
746
|
"@qvac/skills": "0.1.9",
|
|
747
|
+
"@xmldom/xmldom": "^0.9.12",
|
|
722
748
|
"asenion": "^0.1.0",
|
|
723
749
|
"b4a": "^1.9.0",
|
|
724
750
|
"bare-abort-controller": "^1.1.2",
|
|
@@ -739,6 +765,7 @@
|
|
|
739
765
|
"bare-net": "^2.3.2",
|
|
740
766
|
"bare-os": "^3.9.1",
|
|
741
767
|
"bare-path": "^3.0.1",
|
|
768
|
+
"bare-pdfium": "^1.6.0",
|
|
742
769
|
"bare-process": "4.4.1",
|
|
743
770
|
"bare-sidecar": "0.5.7",
|
|
744
771
|
"bare-storage": "^1.1.0",
|
|
@@ -750,6 +777,7 @@
|
|
|
750
777
|
"bare-tty": "^5.1.2",
|
|
751
778
|
"bare-url": "^2.4.5",
|
|
752
779
|
"bare-worker": "^4.5.0",
|
|
780
|
+
"bare-zlib": "^1.4.1",
|
|
753
781
|
"compact-encoding": "^3.4.0",
|
|
754
782
|
"hrpc": "^4.3.0",
|
|
755
783
|
"hyperschema": "^1.23.0",
|
|
@@ -21,6 +21,7 @@ import { createGrepTool } from '../dist-lib/lib/tools/grep.js'
|
|
|
21
21
|
import { createHttpRequestTool } from '../dist-lib/lib/tools/http-request.js'
|
|
22
22
|
import { createMcpCallTool } from '../dist-lib/lib/tools/mcp-call.js'
|
|
23
23
|
import { compileOperationTools } from '../dist-lib/lib/tools/operations/compile.js'
|
|
24
|
+
import { createPdfTool } from '../dist-lib/lib/tools/pdf.js'
|
|
24
25
|
import { createReadFilesTool } from '../dist-lib/lib/tools/read-files.js'
|
|
25
26
|
import { createSkillTool } from '../dist-lib/lib/tools/skill.js'
|
|
26
27
|
import { ensureBundledSkillsDir } from '../dist-lib/lib/tools/skills/bundled-dir.js'
|
|
@@ -132,7 +133,8 @@ export default async function start(ipc, ready) {
|
|
|
132
133
|
createFileGlobTool({ deniedRoots }),
|
|
133
134
|
createGrepTool({ deniedRoots }),
|
|
134
135
|
createCreateDocumentsTool({ deniedRoots }),
|
|
135
|
-
createEditDocumentsTool({ deniedRoots })
|
|
136
|
+
createEditDocumentsTool({ deniedRoots }),
|
|
137
|
+
createPdfTool()
|
|
136
138
|
]
|
|
137
139
|
if (skillCatalog) {
|
|
138
140
|
tools.push(...compileOperationTools(skillCatalog, { httpRequestTool, mcpCallTool }))
|