@qvac/harness 0.8.11 → 0.8.13
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 +139 -1
- package/dist-lib/index.d.ts +1 -0
- package/dist-lib/index.js +16 -8
- package/dist-lib/lib/capabilities/completion.d.ts +9 -1
- package/dist-lib/lib/capabilities/completion.js +87 -25
- package/dist-lib/lib/capabilities/preview-model-source.d.ts +7 -1
- package/dist-lib/lib/capabilities/preview-model-source.js +80 -22
- package/dist-lib/lib/capabilities/tool-search.d.ts +4 -0
- package/dist-lib/lib/capabilities/tool-search.js +9 -0
- package/dist-lib/lib/capabilities/tool-selection.d.ts +3 -1
- package/dist-lib/lib/capabilities/tool-selection.js +3 -2
- package/dist-lib/lib/connect.js +3 -2
- package/dist-lib/lib/contract-types.d.ts +1 -0
- package/dist-lib/lib/errors.d.ts +4 -0
- package/dist-lib/lib/errors.js +6 -0
- package/dist-lib/lib/hardware/cpu-placement.d.ts +8 -0
- package/dist-lib/lib/hardware/cpu-placement.js +48 -0
- package/dist-lib/lib/models/custom-model-cache.d.ts +1 -0
- package/dist-lib/lib/models/custom-model-cache.js +3 -0
- package/dist-lib/lib/models/gguf-header.d.ts +11 -0
- package/dist-lib/lib/models/gguf-header.js +203 -15
- package/dist-lib/lib/models/kv-cache.d.ts +2 -0
- package/dist-lib/lib/models/kv-cache.js +8 -0
- package/dist-lib/lib/models/llm-presets.d.ts +2 -1
- package/dist-lib/lib/models/llm-presets.js +2 -2
- package/dist-lib/lib/models/model-handle.d.ts +1 -0
- package/dist-lib/lib/models/model-pool.d.ts +6 -1
- package/dist-lib/lib/models/model-pool.js +22 -10
- package/dist-lib/lib/models/model-source.d.ts +1 -0
- package/dist-lib/lib/models/model-source.js +20 -3
- package/dist-lib/lib/no-redirect-fetch-impl.d.ts +1 -0
- package/dist-lib/lib/no-redirect-fetch-impl.js +32 -1
- package/dist-lib/lib/prompt.d.ts +2 -1
- package/dist-lib/lib/prompt.js +12 -12
- package/dist-lib/lib/serve.js +3 -2
- package/dist-lib/lib/tools/edit-image.js +4 -3
- package/dist-lib/lib/tools/exec/adapters/python/attachments.d.ts +1 -0
- package/dist-lib/lib/tools/exec/adapters/python/attachments.js +11 -0
- package/dist-lib/lib/tools/exec/obsidian/guidance.js +2 -2
- package/dist-lib/lib/tools/exec/obsidian/vault-read.js +17 -16
- package/dist-lib/lib/tools/generate-image.js +4 -3
- package/dist-lib/lib/tools/http-request/request.d.ts +3 -1
- package/dist-lib/lib/tools/http-request/request.js +2 -1
- package/dist-lib/lib/tools/http-request/truncate-response.d.ts +17 -1
- package/dist-lib/lib/tools/http-request/truncate-response.js +51 -9
- package/dist-lib/lib/tools/http-request.js +13 -6
- package/dist-lib/lib/tools/mcp-call.js +1 -0
- package/dist-lib/lib/tools/office/ops.d.ts +1 -0
- package/dist-lib/lib/tools/office/ops.js +5 -1
- package/dist-lib/lib/tools/office.d.ts +1 -0
- package/dist-lib/lib/tools/office.js +197 -35
- package/dist-lib/lib/tools/operations/compile.js +4 -4
- package/dist-lib/lib/tools/pdf/build.d.ts +5 -1
- package/dist-lib/lib/tools/pdf/build.js +31 -6
- package/dist-lib/lib/tools/pdf.js +17 -2
- package/dist-lib/lib/tools/skills/credential-check.d.ts +1 -0
- package/dist-lib/lib/tools/skills/credential-check.js +1 -0
- package/dist-lib/lib/tools/skills/manifest-parse.js +27 -3
- package/dist-lib/lib/tools/skills/manifest.d.ts +1 -0
- package/dist-lib/schema/harness.js +2 -1
- package/dist-lib/spec/hrpc/messages.js +8 -5
- package/dist-lib/spec/hyperschema/index.js +8 -5
- package/dist-lib/spec/hyperschema/schema.json +6 -1
- package/dist-lib/spec/hyperschema/types.d.ts +2 -1
- package/package.json +5 -5
|
@@ -68,6 +68,7 @@ async function runCheck(key, check, { skill, credentialStore, agentId, fetchImpl
|
|
|
68
68
|
const response = await fetchImpl(check.url, {
|
|
69
69
|
method: check.method ?? 'GET',
|
|
70
70
|
headers: headers,
|
|
71
|
+
body: check.body,
|
|
71
72
|
signal: controller.signal
|
|
72
73
|
});
|
|
73
74
|
const rejected = response.status === 401 || response.status === 403 || (await hasMcpAuthError(response));
|
|
@@ -5,9 +5,9 @@ export function parseManifestBlock(block, key = 'metadata') {
|
|
|
5
5
|
return {};
|
|
6
6
|
}
|
|
7
7
|
const oc = json.openclaw;
|
|
8
|
-
const requires = readRequires(oc.requires);
|
|
9
|
-
const install = readInstall(oc.install);
|
|
10
8
|
const setup = readSetup(oc.setup);
|
|
9
|
+
const requires = deriveCredentialChecks(readRequires(oc.requires), setup);
|
|
10
|
+
const install = readInstall(oc.install);
|
|
11
11
|
return {
|
|
12
12
|
requires,
|
|
13
13
|
install,
|
|
@@ -127,11 +127,35 @@ function readCredentialChecks(v) {
|
|
|
127
127
|
out[key] = {
|
|
128
128
|
url: check.url,
|
|
129
129
|
method: typeof check.method === 'string' ? check.method : undefined,
|
|
130
|
-
headers
|
|
130
|
+
headers,
|
|
131
|
+
body: typeof check.body === 'string' ? check.body : undefined
|
|
131
132
|
};
|
|
132
133
|
}
|
|
133
134
|
return Object.keys(out).length > 0 ? out : undefined;
|
|
134
135
|
}
|
|
136
|
+
function deriveCredentialChecks(requires, setup) {
|
|
137
|
+
const derived = {};
|
|
138
|
+
for (const route of setup?.routes ?? []) {
|
|
139
|
+
const verify = route.oauth?.verify;
|
|
140
|
+
const key = route.credentialKey;
|
|
141
|
+
if (route.kind !== 'oauth' || !key || !verify || requires?.credentialChecks?.[key]) {
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
const accept = 'application/json, text/event-stream';
|
|
145
|
+
derived[key] = {
|
|
146
|
+
url: verify.url,
|
|
147
|
+
method: verify.method ?? (verify.body ? 'POST' : 'GET'),
|
|
148
|
+
body: verify.body,
|
|
149
|
+
headers: verify.body
|
|
150
|
+
? { Accept: accept, 'Content-Type': 'application/json' }
|
|
151
|
+
: { Accept: accept }
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
if (Object.keys(derived).length === 0) {
|
|
155
|
+
return requires;
|
|
156
|
+
}
|
|
157
|
+
return { ...requires, credentialChecks: { ...requires?.credentialChecks, ...derived } };
|
|
158
|
+
}
|
|
135
159
|
function readStringRecord(v) {
|
|
136
160
|
if (!isObj(v))
|
|
137
161
|
return undefined;
|
|
@@ -41,7 +41,8 @@ export function registerHarnessTypes(ns) {
|
|
|
41
41
|
fields: [
|
|
42
42
|
{ name: 'role', type: '@harness/message-role', required: true },
|
|
43
43
|
{ name: 'content', type: 'string', required: true },
|
|
44
|
-
{ name: 'attachments', type: '@harness/message-attachment', array: true }
|
|
44
|
+
{ name: 'attachments', type: '@harness/message-attachment', array: true },
|
|
45
|
+
{ name: 'sentAt', type: 'uint' }
|
|
45
46
|
]
|
|
46
47
|
});
|
|
47
48
|
ns.register({
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// This file is autogenerated by the hyperschema compiler
|
|
2
|
-
// Schema Version:
|
|
2
|
+
// Schema Version: 22
|
|
3
3
|
/* eslint-disable camelcase */
|
|
4
4
|
/* eslint-disable quotes */
|
|
5
5
|
/* eslint-disable space-before-function-paren */
|
|
6
6
|
|
|
7
7
|
import { c } from 'hyperschema/runtime'
|
|
8
8
|
|
|
9
|
-
const VERSION =
|
|
9
|
+
const VERSION = 22
|
|
10
10
|
|
|
11
11
|
// eslint-disable-next-line no-unused-vars
|
|
12
12
|
let version = VERSION
|
|
@@ -303,18 +303,20 @@ const encoding7 = {
|
|
|
303
303
|
preencode(state, m) {
|
|
304
304
|
encoding5.preencode(state, m.role)
|
|
305
305
|
c.string.preencode(state, m.content)
|
|
306
|
-
state.end++ // max flag is
|
|
306
|
+
state.end++ // max flag is 2 so always one byte
|
|
307
307
|
|
|
308
308
|
if (m.attachments) encoding7_2.preencode(state, m.attachments)
|
|
309
|
+
if (version >= 22 && m.sentAt) c.uint.preencode(state, m.sentAt)
|
|
309
310
|
},
|
|
310
311
|
encode(state, m) {
|
|
311
|
-
const flags = m.attachments ? 1 : 0
|
|
312
|
+
const flags = (m.attachments ? 1 : 0) | ((version >= 22 && m.sentAt) ? 2 : 0)
|
|
312
313
|
|
|
313
314
|
encoding5.encode(state, m.role)
|
|
314
315
|
c.string.encode(state, m.content)
|
|
315
316
|
c.uint.encode(state, flags)
|
|
316
317
|
|
|
317
318
|
if (m.attachments) encoding7_2.encode(state, m.attachments)
|
|
319
|
+
if (version >= 22 && m.sentAt) c.uint.encode(state, m.sentAt)
|
|
318
320
|
},
|
|
319
321
|
decode(state) {
|
|
320
322
|
const r0 = encoding5.decode(state)
|
|
@@ -324,7 +326,8 @@ const encoding7 = {
|
|
|
324
326
|
return {
|
|
325
327
|
role: r0,
|
|
326
328
|
content: r1,
|
|
327
|
-
attachments: (flags & 1) !== 0 ? encoding7_2.decode(state) : null
|
|
329
|
+
attachments: (flags & 1) !== 0 ? encoding7_2.decode(state) : null,
|
|
330
|
+
sentAt: (version >= 22 && (flags & 2) !== 0) ? c.uint.decode(state) : 0
|
|
328
331
|
}
|
|
329
332
|
}
|
|
330
333
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// This file is autogenerated by the hyperschema compiler
|
|
2
|
-
// Schema Version:
|
|
2
|
+
// Schema Version: 22
|
|
3
3
|
/* eslint-disable camelcase */
|
|
4
4
|
/* eslint-disable quotes */
|
|
5
5
|
/* eslint-disable space-before-function-paren */
|
|
6
6
|
|
|
7
7
|
import { c } from 'hyperschema/runtime'
|
|
8
8
|
|
|
9
|
-
const VERSION =
|
|
9
|
+
const VERSION = 22
|
|
10
10
|
|
|
11
11
|
// eslint-disable-next-line no-unused-vars
|
|
12
12
|
let version = VERSION
|
|
@@ -303,18 +303,20 @@ const encoding7 = {
|
|
|
303
303
|
preencode(state, m) {
|
|
304
304
|
encoding5.preencode(state, m.role)
|
|
305
305
|
c.string.preencode(state, m.content)
|
|
306
|
-
state.end++ // max flag is
|
|
306
|
+
state.end++ // max flag is 2 so always one byte
|
|
307
307
|
|
|
308
308
|
if (m.attachments) encoding7_2.preencode(state, m.attachments)
|
|
309
|
+
if (version >= 22 && m.sentAt) c.uint.preencode(state, m.sentAt)
|
|
309
310
|
},
|
|
310
311
|
encode(state, m) {
|
|
311
|
-
const flags = m.attachments ? 1 : 0
|
|
312
|
+
const flags = (m.attachments ? 1 : 0) | ((version >= 22 && m.sentAt) ? 2 : 0)
|
|
312
313
|
|
|
313
314
|
encoding5.encode(state, m.role)
|
|
314
315
|
c.string.encode(state, m.content)
|
|
315
316
|
c.uint.encode(state, flags)
|
|
316
317
|
|
|
317
318
|
if (m.attachments) encoding7_2.encode(state, m.attachments)
|
|
319
|
+
if (version >= 22 && m.sentAt) c.uint.encode(state, m.sentAt)
|
|
318
320
|
},
|
|
319
321
|
decode(state) {
|
|
320
322
|
const r0 = encoding5.decode(state)
|
|
@@ -324,7 +326,8 @@ const encoding7 = {
|
|
|
324
326
|
return {
|
|
325
327
|
role: r0,
|
|
326
328
|
content: r1,
|
|
327
|
-
attachments: (flags & 1) !== 0 ? encoding7_2.decode(state) : null
|
|
329
|
+
attachments: (flags & 1) !== 0 ? encoding7_2.decode(state) : null,
|
|
330
|
+
sentAt: (version >= 22 && (flags & 2) !== 0) ? c.uint.decode(state) : 0
|
|
328
331
|
}
|
|
329
332
|
}
|
|
330
333
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version":
|
|
2
|
+
"version": 22,
|
|
3
3
|
"schema": [
|
|
4
4
|
{
|
|
5
5
|
"name": "empty",
|
|
@@ -220,6 +220,11 @@
|
|
|
220
220
|
"array": true,
|
|
221
221
|
"type": "@harness/message-attachment",
|
|
222
222
|
"version": 1
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"name": "sentAt",
|
|
226
|
+
"type": "uint",
|
|
227
|
+
"version": 22
|
|
223
228
|
}
|
|
224
229
|
]
|
|
225
230
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// This file is autogenerated by hyperschema-ts
|
|
2
|
-
// Schema version:
|
|
2
|
+
// Schema version: 22
|
|
3
3
|
// Do not edit manually.
|
|
4
4
|
|
|
5
5
|
export interface HarnessEmpty {
|
|
@@ -44,6 +44,7 @@ export interface HarnessMessage {
|
|
|
44
44
|
role: HarnessMessageRole
|
|
45
45
|
content: string
|
|
46
46
|
attachments?: HarnessMessageAttachment[] | null
|
|
47
|
+
sentAt?: number
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
export interface HarnessResource {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qvac/harness",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"bare": ">=1.34.0"
|
|
@@ -785,10 +785,10 @@
|
|
|
785
785
|
},
|
|
786
786
|
"dependencies": {
|
|
787
787
|
"@qvac/error": "^0.1.1",
|
|
788
|
-
"@qvac/inference": "^0.
|
|
788
|
+
"@qvac/inference": "^0.22.0",
|
|
789
789
|
"@qvac/langdetect-text": "^0.1.2",
|
|
790
790
|
"@qvac/logging": "0.1.1",
|
|
791
|
-
"@qvac/sdk": "^0.
|
|
791
|
+
"@qvac/sdk": "^0.22.0",
|
|
792
792
|
"@qvac/skills": "^0.1.16",
|
|
793
793
|
"@xmldom/xmldom": "^0.9.12",
|
|
794
794
|
"asenion": "^0.1.0",
|
|
@@ -819,7 +819,7 @@
|
|
|
819
819
|
"bare-stream": "^2.13.3",
|
|
820
820
|
"bare-subprocess": "^6.1.0",
|
|
821
821
|
"bare-supervisor": "^0.1.1",
|
|
822
|
-
"bare-tls": "^3.1.
|
|
822
|
+
"bare-tls": "^3.1.13",
|
|
823
823
|
"bare-tty": "^5.1.2",
|
|
824
824
|
"bare-url": "^2.4.5",
|
|
825
825
|
"bare-worker": "^4.5.0",
|
|
@@ -861,7 +861,7 @@
|
|
|
861
861
|
"patchedDependencies": {
|
|
862
862
|
"pyodide@314.0.2": "patches/pyodide@314.0.2.patch",
|
|
863
863
|
"localwatch@1.4.3": "patches/localwatch@1.4.3.patch",
|
|
864
|
-
"@qvac/inference@0.
|
|
864
|
+
"@qvac/inference@0.22.0": "patches/@qvac%2Finference@0.22.0.patch"
|
|
865
865
|
},
|
|
866
866
|
"repository": {
|
|
867
867
|
"type": "git",
|