@qvac/harness 0.2.10 → 0.2.12
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/harness.bundle +10 -9
- package/dist-lib/index.d.ts +16 -1
- package/dist-lib/index.js +31 -1
- package/dist-lib/lib/capabilities/detect-language.d.ts +11 -0
- package/dist-lib/lib/capabilities/detect-language.js +13 -0
- package/dist-lib/lib/capabilities/invoke.d.ts +15 -0
- package/dist-lib/lib/capabilities/invoke.js +33 -0
- package/dist-lib/lib/connect.d.ts +4 -1
- package/dist-lib/lib/connect.js +49 -21
- package/dist-lib/lib/contract-types.d.ts +20 -0
- package/dist-lib/lib/hooks/built-in/sandbox.js +3 -1
- package/dist-lib/lib/serve.js +32 -4
- package/dist-lib/lib/tools/http-request.js +1 -1
- package/dist-lib/lib/tools/skills/manifest-parse.d.ts +1 -0
- package/dist-lib/lib/tools/skills/manifest-parse.js +92 -1
- package/dist-lib/lib/tools/skills/manifest.d.ts +12 -0
- package/dist-lib/lib/tools/web-fetch.js +12 -2
- package/dist-lib/schema/harness.js +52 -3
- package/dist-lib/spec/bind.js +3 -0
- package/dist-lib/spec/calls.js +1 -0
- package/dist-lib/spec/hrpc/hrpc.json +13 -0
- package/dist-lib/spec/hrpc/index.js +15 -3
- package/dist-lib/spec/hrpc/messages.js +201 -10
- package/dist-lib/spec/hyperschema/index.js +201 -10
- package/dist-lib/spec/hyperschema/schema.json +158 -1
- package/dist-lib/spec/hyperschema/types.d.ts +42 -2
- package/package.json +3 -2
|
@@ -69,7 +69,8 @@ export function registerHarnessTypes(ns) {
|
|
|
69
69
|
'fetch-result',
|
|
70
70
|
'rag-result',
|
|
71
71
|
'question-result',
|
|
72
|
-
'drive-result'
|
|
72
|
+
'drive-result',
|
|
73
|
+
'invoke'
|
|
73
74
|
],
|
|
74
75
|
strings: true
|
|
75
76
|
});
|
|
@@ -109,7 +110,9 @@ export function registerHarnessTypes(ns) {
|
|
|
109
110
|
{ name: 'grantedDrives', type: '@harness/granted-drive', array: true },
|
|
110
111
|
{ name: 'payload', type: 'json' },
|
|
111
112
|
{ name: 'grantedWriteDirs', type: 'string', array: true },
|
|
112
|
-
{ name: 'captureInferenceCalls', type: 'bool' }
|
|
113
|
+
{ name: 'captureInferenceCalls', type: 'bool' },
|
|
114
|
+
{ name: 'capability', type: 'string' },
|
|
115
|
+
{ name: 'arguments', type: 'json' }
|
|
113
116
|
]
|
|
114
117
|
});
|
|
115
118
|
ns.register({
|
|
@@ -459,6 +462,25 @@ export function registerHarnessTypes(ns) {
|
|
|
459
462
|
name: 'transcribe-response',
|
|
460
463
|
fields: [{ name: 'text', type: 'string', required: true }]
|
|
461
464
|
});
|
|
465
|
+
ns.register({
|
|
466
|
+
name: 'detect-language-request',
|
|
467
|
+
fields: [
|
|
468
|
+
{ name: 'text', type: 'string', required: true },
|
|
469
|
+
{ name: 'topK', type: 'uint' }
|
|
470
|
+
]
|
|
471
|
+
});
|
|
472
|
+
ns.register({
|
|
473
|
+
name: 'detected-language',
|
|
474
|
+
fields: [
|
|
475
|
+
{ name: 'code', type: 'string', required: true },
|
|
476
|
+
{ name: 'language', type: 'string', required: true },
|
|
477
|
+
{ name: 'probability', type: 'float64' }
|
|
478
|
+
]
|
|
479
|
+
});
|
|
480
|
+
ns.register({
|
|
481
|
+
name: 'detect-language-response',
|
|
482
|
+
fields: [{ name: 'languages', type: '@harness/detected-language', array: true, required: true }]
|
|
483
|
+
});
|
|
462
484
|
ns.register({
|
|
463
485
|
name: 'speak-request',
|
|
464
486
|
fields: [
|
|
@@ -507,7 +529,8 @@ export function registerHarnessTypes(ns) {
|
|
|
507
529
|
{ name: 'steps', type: 'string', array: true },
|
|
508
530
|
{ name: 'configSteps', type: 'string', array: true },
|
|
509
531
|
{ name: 'fields', type: '@harness/skill-setup-field', array: true },
|
|
510
|
-
{ name: 'satisfied', type: 'bool' }
|
|
532
|
+
{ name: 'satisfied', type: 'bool' },
|
|
533
|
+
{ name: 'oauth', type: '@harness/skill-oauth-config' }
|
|
511
534
|
]
|
|
512
535
|
});
|
|
513
536
|
ns.register({
|
|
@@ -614,6 +637,27 @@ export function registerHarnessTypes(ns) {
|
|
|
614
637
|
name: 'kv-cache-delete-request',
|
|
615
638
|
fields: [{ name: 'kvCacheKey', type: 'string', required: true }]
|
|
616
639
|
});
|
|
640
|
+
ns.register({
|
|
641
|
+
name: 'skill-oauth-param',
|
|
642
|
+
fields: [
|
|
643
|
+
{ name: 'key', type: 'string', required: true },
|
|
644
|
+
{ name: 'value', type: 'string', required: true }
|
|
645
|
+
]
|
|
646
|
+
});
|
|
647
|
+
ns.register({
|
|
648
|
+
name: 'skill-oauth-config',
|
|
649
|
+
fields: [
|
|
650
|
+
{ name: 'stateKey', type: 'string', required: true },
|
|
651
|
+
{ name: 'authUrl', type: 'string', required: true },
|
|
652
|
+
{ name: 'tokenUrl', type: 'string', required: true },
|
|
653
|
+
{ name: 'tokenAuth', type: 'string', required: true },
|
|
654
|
+
{ name: 'scopes', type: 'string', array: true },
|
|
655
|
+
{ name: 'extraAuthParams', type: '@harness/skill-oauth-param', array: true },
|
|
656
|
+
{ name: 'registrationEndpoint', type: 'string' },
|
|
657
|
+
{ name: 'port', type: 'uint' },
|
|
658
|
+
{ name: 'sharedIosSession', type: 'bool' }
|
|
659
|
+
]
|
|
660
|
+
});
|
|
617
661
|
}
|
|
618
662
|
export function registerHarnessApi(api) {
|
|
619
663
|
api.register({
|
|
@@ -756,4 +800,9 @@ export function registerHarnessApi(api) {
|
|
|
756
800
|
request: { name: '@harness/kv-cache-delete-request', stream: false },
|
|
757
801
|
response: { name: '@harness/kv-cache-deletion-response', stream: false }
|
|
758
802
|
});
|
|
803
|
+
api.register({
|
|
804
|
+
name: 'detect-language',
|
|
805
|
+
request: { name: '@harness/detect-language-request', stream: false },
|
|
806
|
+
response: { name: '@harness/detect-language-response', stream: false }
|
|
807
|
+
});
|
|
759
808
|
}
|
package/dist-lib/spec/bind.js
CHANGED
package/dist-lib/spec/calls.js
CHANGED
|
@@ -38,5 +38,6 @@ export function harnessClient(rpc) {
|
|
|
38
38
|
copySkillForEdit: (input) => rpc.copySkillForEdit(input),
|
|
39
39
|
deleteOverlaySkill: (input) => rpc.deleteOverlaySkill(input),
|
|
40
40
|
deleteKvCache: (input) => rpc.deleteKvCache(input),
|
|
41
|
+
detectLanguage: (input) => rpc.detectLanguage(input),
|
|
41
42
|
};
|
|
42
43
|
}
|
|
@@ -364,6 +364,19 @@
|
|
|
364
364
|
"stream": false
|
|
365
365
|
},
|
|
366
366
|
"version": 1
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"id": 28,
|
|
370
|
+
"name": "@harness/detect-language",
|
|
371
|
+
"request": {
|
|
372
|
+
"name": "@harness/detect-language-request",
|
|
373
|
+
"stream": false
|
|
374
|
+
},
|
|
375
|
+
"response": {
|
|
376
|
+
"name": "@harness/detect-language-response",
|
|
377
|
+
"stream": false
|
|
378
|
+
},
|
|
379
|
+
"version": 1
|
|
367
380
|
}
|
|
368
381
|
]
|
|
369
382
|
}
|
|
@@ -61,7 +61,9 @@ const methods = new Map([
|
|
|
61
61
|
['@harness/delete-overlay-skill', 26],
|
|
62
62
|
[26, '@harness/delete-overlay-skill'],
|
|
63
63
|
['@harness/delete-kv-cache', 27],
|
|
64
|
-
[27, '@harness/delete-kv-cache']
|
|
64
|
+
[27, '@harness/delete-kv-cache'],
|
|
65
|
+
['@harness/detect-language', 28],
|
|
66
|
+
[28, '@harness/detect-language']
|
|
65
67
|
])
|
|
66
68
|
|
|
67
69
|
class HRPC {
|
|
@@ -96,7 +98,8 @@ class HRPC {
|
|
|
96
98
|
['@harness/write-skill-file', getEncoding('@harness/write-skill-request')],
|
|
97
99
|
['@harness/copy-skill-for-edit', getEncoding('@harness/skill-name-request')],
|
|
98
100
|
['@harness/delete-overlay-skill', getEncoding('@harness/skill-name-request')],
|
|
99
|
-
['@harness/delete-kv-cache', getEncoding('@harness/kv-cache-delete-request')]
|
|
101
|
+
['@harness/delete-kv-cache', getEncoding('@harness/kv-cache-delete-request')],
|
|
102
|
+
['@harness/detect-language', getEncoding('@harness/detect-language-request')]
|
|
100
103
|
])
|
|
101
104
|
this._responseEncodings = new Map([
|
|
102
105
|
['@harness/completion', getEncoding('@harness/completion-event')],
|
|
@@ -126,7 +129,8 @@ class HRPC {
|
|
|
126
129
|
['@harness/write-skill-file', getEncoding('@harness/ok-response')],
|
|
127
130
|
['@harness/copy-skill-for-edit', getEncoding('@harness/copy-skill-response')],
|
|
128
131
|
['@harness/delete-overlay-skill', getEncoding('@harness/delete-skill-response')],
|
|
129
|
-
['@harness/delete-kv-cache', getEncoding('@harness/kv-cache-deletion-response')]
|
|
132
|
+
['@harness/delete-kv-cache', getEncoding('@harness/kv-cache-deletion-response')],
|
|
133
|
+
['@harness/detect-language', getEncoding('@harness/detect-language-response')]
|
|
130
134
|
])
|
|
131
135
|
this._rpc = new RPC(stream, async (req) => {
|
|
132
136
|
const command = methods.get(req.command)
|
|
@@ -336,6 +340,10 @@ class HRPC {
|
|
|
336
340
|
return this._call('@harness/delete-kv-cache', args)
|
|
337
341
|
}
|
|
338
342
|
|
|
343
|
+
async detectLanguage(args) {
|
|
344
|
+
return this._call('@harness/detect-language', args)
|
|
345
|
+
}
|
|
346
|
+
|
|
339
347
|
onCompletion(responseFn) {
|
|
340
348
|
this._handlers['@harness/completion'] = responseFn
|
|
341
349
|
}
|
|
@@ -448,6 +456,10 @@ class HRPC {
|
|
|
448
456
|
this._handlers['@harness/delete-kv-cache'] = responseFn
|
|
449
457
|
}
|
|
450
458
|
|
|
459
|
+
onDetectLanguage(responseFn) {
|
|
460
|
+
this._handlers['@harness/detect-language'] = responseFn
|
|
461
|
+
}
|
|
462
|
+
|
|
451
463
|
_requestIsStream(command) {
|
|
452
464
|
return [
|
|
453
465
|
'@harness/completion',
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// This file is autogenerated by the hyperschema compiler
|
|
2
|
-
// Schema Version:
|
|
2
|
+
// Schema Version: 11
|
|
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 = 11
|
|
10
10
|
|
|
11
11
|
// eslint-disable-next-line no-unused-vars
|
|
12
12
|
let version = VERSION
|
|
@@ -386,13 +386,14 @@ const encoding10_enum = {
|
|
|
386
386
|
"fetch-result": 'fetch-result',
|
|
387
387
|
"rag-result": 'rag-result',
|
|
388
388
|
"question-result": 'question-result',
|
|
389
|
-
"drive-result": 'drive-result'
|
|
389
|
+
"drive-result": 'drive-result',
|
|
390
|
+
invoke: 'invoke'
|
|
390
391
|
}
|
|
391
392
|
|
|
392
393
|
// @harness/completion-frame-type enum
|
|
393
394
|
const encoding10 = {
|
|
394
395
|
preencode (state, m) {
|
|
395
|
-
state.end++ // max enum is
|
|
396
|
+
state.end++ // max enum is 8 so always one byte
|
|
396
397
|
},
|
|
397
398
|
encode (state, m) {
|
|
398
399
|
switch (m) {
|
|
@@ -417,6 +418,9 @@ const encoding10 = {
|
|
|
417
418
|
case 'drive-result':
|
|
418
419
|
c.uint.encode(state, 7)
|
|
419
420
|
break
|
|
421
|
+
case 'invoke':
|
|
422
|
+
c.uint.encode(state, 8)
|
|
423
|
+
break
|
|
420
424
|
default:
|
|
421
425
|
throw new Error('Unknown enum')
|
|
422
426
|
}
|
|
@@ -437,6 +441,8 @@ const encoding10 = {
|
|
|
437
441
|
return 'question-result'
|
|
438
442
|
case 7:
|
|
439
443
|
return 'drive-result'
|
|
444
|
+
case 8:
|
|
445
|
+
return 'invoke'
|
|
440
446
|
default: return null
|
|
441
447
|
}
|
|
442
448
|
}
|
|
@@ -482,7 +488,9 @@ const encoding11 = {
|
|
|
482
488
|
((version >= 5 && m.grantedDrives) ? 4194304 : 0) |
|
|
483
489
|
((version >= 5 && m.payload) ? 8388608 : 0) |
|
|
484
490
|
((version >= 5 && m.grantedWriteDirs) ? 16777216 : 0) |
|
|
485
|
-
((version >= 9 && m.captureInferenceCalls) ? 33554432 : 0)
|
|
491
|
+
((version >= 9 && m.captureInferenceCalls) ? 33554432 : 0) |
|
|
492
|
+
((version >= 11 && m.capability) ? 67108864 : 0) |
|
|
493
|
+
((version >= 11 && m.arguments) ? 134217728 : 0)
|
|
486
494
|
|
|
487
495
|
encoding10.preencode(state, m.type)
|
|
488
496
|
c.uint.preencode(state, flags)
|
|
@@ -510,6 +518,8 @@ const encoding11 = {
|
|
|
510
518
|
if (version >= 5 && m.grantedDrives) encoding11_23.preencode(state, m.grantedDrives)
|
|
511
519
|
if (version >= 5 && m.payload) c.json.preencode(state, m.payload)
|
|
512
520
|
if (version >= 5 && m.grantedWriteDirs) encoding11_25.preencode(state, m.grantedWriteDirs)
|
|
521
|
+
if (version >= 11 && m.capability) c.string.preencode(state, m.capability)
|
|
522
|
+
if (version >= 11 && m.arguments) c.json.preencode(state, m.arguments)
|
|
513
523
|
},
|
|
514
524
|
encode(state, m) {
|
|
515
525
|
const flags =
|
|
@@ -538,7 +548,9 @@ const encoding11 = {
|
|
|
538
548
|
((version >= 5 && m.grantedDrives) ? 4194304 : 0) |
|
|
539
549
|
((version >= 5 && m.payload) ? 8388608 : 0) |
|
|
540
550
|
((version >= 5 && m.grantedWriteDirs) ? 16777216 : 0) |
|
|
541
|
-
((version >= 9 && m.captureInferenceCalls) ? 33554432 : 0)
|
|
551
|
+
((version >= 9 && m.captureInferenceCalls) ? 33554432 : 0) |
|
|
552
|
+
((version >= 11 && m.capability) ? 67108864 : 0) |
|
|
553
|
+
((version >= 11 && m.arguments) ? 134217728 : 0)
|
|
542
554
|
|
|
543
555
|
encoding10.encode(state, m.type)
|
|
544
556
|
c.uint.encode(state, flags)
|
|
@@ -566,6 +578,8 @@ const encoding11 = {
|
|
|
566
578
|
if (version >= 5 && m.grantedDrives) encoding11_23.encode(state, m.grantedDrives)
|
|
567
579
|
if (version >= 5 && m.payload) c.json.encode(state, m.payload)
|
|
568
580
|
if (version >= 5 && m.grantedWriteDirs) encoding11_25.encode(state, m.grantedWriteDirs)
|
|
581
|
+
if (version >= 11 && m.capability) c.string.encode(state, m.capability)
|
|
582
|
+
if (version >= 11 && m.arguments) c.json.encode(state, m.arguments)
|
|
569
583
|
},
|
|
570
584
|
decode(state) {
|
|
571
585
|
const r0 = encoding10.decode(state)
|
|
@@ -598,7 +612,9 @@ const encoding11 = {
|
|
|
598
612
|
grantedDrives: (version >= 5 && (flags & 4194304) !== 0) ? encoding11_23.decode(state) : null,
|
|
599
613
|
payload: (version >= 5 && (flags & 8388608) !== 0) ? c.json.decode(state) : null,
|
|
600
614
|
grantedWriteDirs: (version >= 5 && (flags & 16777216) !== 0) ? encoding11_25.decode(state) : null,
|
|
601
|
-
captureInferenceCalls: (version >= 9 && (flags & 33554432) !== 0)
|
|
615
|
+
captureInferenceCalls: (version >= 9 && (flags & 33554432) !== 0),
|
|
616
|
+
capability: (version >= 11 && (flags & 67108864) !== 0) ? c.string.decode(state) : null,
|
|
617
|
+
arguments: (version >= 11 && (flags & 134217728) !== 0) ? c.json.decode(state) : null
|
|
602
618
|
}
|
|
603
619
|
}
|
|
604
620
|
}
|
|
@@ -2145,7 +2161,8 @@ const encoding50 = {
|
|
|
2145
2161
|
(m.steps ? 16 : 0) |
|
|
2146
2162
|
(m.configSteps ? 32 : 0) |
|
|
2147
2163
|
(m.fields ? 64 : 0) |
|
|
2148
|
-
(m.satisfied ? 128 : 0)
|
|
2164
|
+
(m.satisfied ? 128 : 0) |
|
|
2165
|
+
((version >= 11 && m.oauth) ? 256 : 0)
|
|
2149
2166
|
|
|
2150
2167
|
encoding49.preencode(state, m.kind)
|
|
2151
2168
|
c.string.preencode(state, m.label)
|
|
@@ -2158,6 +2175,7 @@ const encoding50 = {
|
|
|
2158
2175
|
if (m.steps) encoding50_6.preencode(state, m.steps)
|
|
2159
2176
|
if (m.configSteps) encoding50_7.preencode(state, m.configSteps)
|
|
2160
2177
|
if (m.fields) encoding50_8.preencode(state, m.fields)
|
|
2178
|
+
if (version >= 11 && m.oauth) encoding50_10.preencode(state, m.oauth)
|
|
2161
2179
|
},
|
|
2162
2180
|
encode(state, m) {
|
|
2163
2181
|
const flags =
|
|
@@ -2168,7 +2186,8 @@ const encoding50 = {
|
|
|
2168
2186
|
(m.steps ? 16 : 0) |
|
|
2169
2187
|
(m.configSteps ? 32 : 0) |
|
|
2170
2188
|
(m.fields ? 64 : 0) |
|
|
2171
|
-
(m.satisfied ? 128 : 0)
|
|
2189
|
+
(m.satisfied ? 128 : 0) |
|
|
2190
|
+
((version >= 11 && m.oauth) ? 256 : 0)
|
|
2172
2191
|
|
|
2173
2192
|
encoding49.encode(state, m.kind)
|
|
2174
2193
|
c.string.encode(state, m.label)
|
|
@@ -2181,6 +2200,7 @@ const encoding50 = {
|
|
|
2181
2200
|
if (m.steps) encoding50_6.encode(state, m.steps)
|
|
2182
2201
|
if (m.configSteps) encoding50_7.encode(state, m.configSteps)
|
|
2183
2202
|
if (m.fields) encoding50_8.encode(state, m.fields)
|
|
2203
|
+
if (version >= 11 && m.oauth) encoding50_10.encode(state, m.oauth)
|
|
2184
2204
|
},
|
|
2185
2205
|
decode(state) {
|
|
2186
2206
|
const r0 = encoding49.decode(state)
|
|
@@ -2197,7 +2217,8 @@ const encoding50 = {
|
|
|
2197
2217
|
steps: (flags & 16) !== 0 ? encoding50_6.decode(state) : null,
|
|
2198
2218
|
configSteps: (flags & 32) !== 0 ? encoding50_7.decode(state) : null,
|
|
2199
2219
|
fields: (flags & 64) !== 0 ? encoding50_8.decode(state) : null,
|
|
2200
|
-
satisfied: (flags & 128) !== 0
|
|
2220
|
+
satisfied: (flags & 128) !== 0,
|
|
2221
|
+
oauth: (version >= 11 && (flags & 256) !== 0) ? encoding50_10.decode(state) : null
|
|
2201
2222
|
}
|
|
2202
2223
|
}
|
|
2203
2224
|
}
|
|
@@ -2908,12 +2929,172 @@ const encoding77 = {
|
|
|
2908
2929
|
}
|
|
2909
2930
|
}
|
|
2910
2931
|
|
|
2932
|
+
// @harness/detect-language-request
|
|
2933
|
+
const encoding78 = {
|
|
2934
|
+
preencode(state, m) {
|
|
2935
|
+
c.string.preencode(state, m.text)
|
|
2936
|
+
state.end++ // max flag is 1 so always one byte
|
|
2937
|
+
|
|
2938
|
+
if (version >= 11 && m.topK) c.uint.preencode(state, m.topK)
|
|
2939
|
+
},
|
|
2940
|
+
encode(state, m) {
|
|
2941
|
+
const flags = (version >= 11 && m.topK) ? 1 : 0
|
|
2942
|
+
|
|
2943
|
+
c.string.encode(state, m.text)
|
|
2944
|
+
c.uint.encode(state, flags)
|
|
2945
|
+
|
|
2946
|
+
if (version >= 11 && m.topK) c.uint.encode(state, m.topK)
|
|
2947
|
+
},
|
|
2948
|
+
decode(state) {
|
|
2949
|
+
const r0 = c.string.decode(state)
|
|
2950
|
+
const flags = c.uint.decode(state)
|
|
2951
|
+
|
|
2952
|
+
return {
|
|
2953
|
+
text: r0,
|
|
2954
|
+
topK: (version >= 11 && (flags & 1) !== 0) ? c.uint.decode(state) : 0
|
|
2955
|
+
}
|
|
2956
|
+
}
|
|
2957
|
+
}
|
|
2958
|
+
|
|
2959
|
+
// @harness/detected-language
|
|
2960
|
+
const encoding79 = {
|
|
2961
|
+
preencode(state, m) {
|
|
2962
|
+
c.string.preencode(state, m.code)
|
|
2963
|
+
c.string.preencode(state, m.language)
|
|
2964
|
+
state.end++ // max flag is 1 so always one byte
|
|
2965
|
+
|
|
2966
|
+
if (version >= 11 && m.probability) c.float64.preencode(state, m.probability)
|
|
2967
|
+
},
|
|
2968
|
+
encode(state, m) {
|
|
2969
|
+
const flags = (version >= 11 && m.probability) ? 1 : 0
|
|
2970
|
+
|
|
2971
|
+
c.string.encode(state, m.code)
|
|
2972
|
+
c.string.encode(state, m.language)
|
|
2973
|
+
c.uint.encode(state, flags)
|
|
2974
|
+
|
|
2975
|
+
if (version >= 11 && m.probability) c.float64.encode(state, m.probability)
|
|
2976
|
+
},
|
|
2977
|
+
decode(state) {
|
|
2978
|
+
const r0 = c.string.decode(state)
|
|
2979
|
+
const r1 = c.string.decode(state)
|
|
2980
|
+
const flags = c.uint.decode(state)
|
|
2981
|
+
|
|
2982
|
+
return {
|
|
2983
|
+
code: r0,
|
|
2984
|
+
language: r1,
|
|
2985
|
+
probability: (version >= 11 && (flags & 1) !== 0) ? c.float64.decode(state) : 0
|
|
2986
|
+
}
|
|
2987
|
+
}
|
|
2988
|
+
}
|
|
2989
|
+
|
|
2990
|
+
// @harness/detect-language-response.languages
|
|
2991
|
+
const encoding80_0 = c.array(c.frame(encoding79))
|
|
2992
|
+
|
|
2993
|
+
// @harness/detect-language-response
|
|
2994
|
+
const encoding80 = {
|
|
2995
|
+
preencode(state, m) {
|
|
2996
|
+
encoding80_0.preencode(state, m.languages)
|
|
2997
|
+
},
|
|
2998
|
+
encode(state, m) {
|
|
2999
|
+
encoding80_0.encode(state, m.languages)
|
|
3000
|
+
},
|
|
3001
|
+
decode(state) {
|
|
3002
|
+
const r0 = encoding80_0.decode(state)
|
|
3003
|
+
|
|
3004
|
+
return {
|
|
3005
|
+
languages: r0
|
|
3006
|
+
}
|
|
3007
|
+
}
|
|
3008
|
+
}
|
|
3009
|
+
|
|
3010
|
+
// @harness/skill-oauth-param
|
|
3011
|
+
const encoding81 = {
|
|
3012
|
+
preencode(state, m) {
|
|
3013
|
+
c.string.preencode(state, m.key)
|
|
3014
|
+
c.string.preencode(state, m.value)
|
|
3015
|
+
},
|
|
3016
|
+
encode(state, m) {
|
|
3017
|
+
c.string.encode(state, m.key)
|
|
3018
|
+
c.string.encode(state, m.value)
|
|
3019
|
+
},
|
|
3020
|
+
decode(state) {
|
|
3021
|
+
const r0 = c.string.decode(state)
|
|
3022
|
+
const r1 = c.string.decode(state)
|
|
3023
|
+
|
|
3024
|
+
return {
|
|
3025
|
+
key: r0,
|
|
3026
|
+
value: r1
|
|
3027
|
+
}
|
|
3028
|
+
}
|
|
3029
|
+
}
|
|
3030
|
+
|
|
3031
|
+
// @harness/skill-oauth-config.scopes
|
|
3032
|
+
const encoding82_4 = encoding4_4
|
|
3033
|
+
// @harness/skill-oauth-config.extraAuthParams
|
|
3034
|
+
const encoding82_5 = c.array(c.frame(encoding81))
|
|
3035
|
+
|
|
3036
|
+
// @harness/skill-oauth-config
|
|
3037
|
+
const encoding82 = {
|
|
3038
|
+
preencode(state, m) {
|
|
3039
|
+
c.string.preencode(state, m.stateKey)
|
|
3040
|
+
c.string.preencode(state, m.authUrl)
|
|
3041
|
+
c.string.preencode(state, m.tokenUrl)
|
|
3042
|
+
c.string.preencode(state, m.tokenAuth)
|
|
3043
|
+
state.end++ // max flag is 16 so always one byte
|
|
3044
|
+
|
|
3045
|
+
if (version >= 11 && m.scopes) encoding82_4.preencode(state, m.scopes)
|
|
3046
|
+
if (version >= 11 && m.extraAuthParams) encoding82_5.preencode(state, m.extraAuthParams)
|
|
3047
|
+
if (version >= 11 && m.registrationEndpoint) c.string.preencode(state, m.registrationEndpoint)
|
|
3048
|
+
if (version >= 11 && m.port) c.uint.preencode(state, m.port)
|
|
3049
|
+
},
|
|
3050
|
+
encode(state, m) {
|
|
3051
|
+
const flags =
|
|
3052
|
+
((version >= 11 && m.scopes) ? 1 : 0) |
|
|
3053
|
+
((version >= 11 && m.extraAuthParams) ? 2 : 0) |
|
|
3054
|
+
((version >= 11 && m.registrationEndpoint) ? 4 : 0) |
|
|
3055
|
+
((version >= 11 && m.port) ? 8 : 0) |
|
|
3056
|
+
((version >= 11 && m.sharedIosSession) ? 16 : 0)
|
|
3057
|
+
|
|
3058
|
+
c.string.encode(state, m.stateKey)
|
|
3059
|
+
c.string.encode(state, m.authUrl)
|
|
3060
|
+
c.string.encode(state, m.tokenUrl)
|
|
3061
|
+
c.string.encode(state, m.tokenAuth)
|
|
3062
|
+
c.uint.encode(state, flags)
|
|
3063
|
+
|
|
3064
|
+
if (version >= 11 && m.scopes) encoding82_4.encode(state, m.scopes)
|
|
3065
|
+
if (version >= 11 && m.extraAuthParams) encoding82_5.encode(state, m.extraAuthParams)
|
|
3066
|
+
if (version >= 11 && m.registrationEndpoint) c.string.encode(state, m.registrationEndpoint)
|
|
3067
|
+
if (version >= 11 && m.port) c.uint.encode(state, m.port)
|
|
3068
|
+
},
|
|
3069
|
+
decode(state) {
|
|
3070
|
+
const r0 = c.string.decode(state)
|
|
3071
|
+
const r1 = c.string.decode(state)
|
|
3072
|
+
const r2 = c.string.decode(state)
|
|
3073
|
+
const r3 = c.string.decode(state)
|
|
3074
|
+
const flags = c.uint.decode(state)
|
|
3075
|
+
|
|
3076
|
+
return {
|
|
3077
|
+
stateKey: r0,
|
|
3078
|
+
authUrl: r1,
|
|
3079
|
+
tokenUrl: r2,
|
|
3080
|
+
tokenAuth: r3,
|
|
3081
|
+
scopes: (version >= 11 && (flags & 1) !== 0) ? encoding82_4.decode(state) : null,
|
|
3082
|
+
extraAuthParams: (version >= 11 && (flags & 2) !== 0) ? encoding82_5.decode(state) : null,
|
|
3083
|
+
registrationEndpoint: (version >= 11 && (flags & 4) !== 0) ? c.string.decode(state) : null,
|
|
3084
|
+
port: (version >= 11 && (flags & 8) !== 0) ? c.uint.decode(state) : 0,
|
|
3085
|
+
sharedIosSession: (version >= 11 && (flags & 16) !== 0)
|
|
3086
|
+
}
|
|
3087
|
+
}
|
|
3088
|
+
}
|
|
3089
|
+
|
|
2911
3090
|
// @harness/completion-frame.grantedDrives, deferred due to recusive use
|
|
2912
3091
|
const encoding11_23 = c.array(c.frame(encoding60))
|
|
2913
3092
|
// @harness/skill.setupV2, deferred due to recusive use
|
|
2914
3093
|
const encoding28_14 = c.frame(encoding51)
|
|
2915
3094
|
// @harness/capability-response.memoryBudget, deferred due to recusive use
|
|
2916
3095
|
const encoding42_2 = c.frame(encoding57)
|
|
3096
|
+
// @harness/skill-setup-route-v2.oauth, deferred due to recusive use
|
|
3097
|
+
const encoding50_10 = c.frame(encoding82)
|
|
2917
3098
|
|
|
2918
3099
|
function setVersion(v) {
|
|
2919
3100
|
version = v
|
|
@@ -3122,6 +3303,16 @@ function getEncoding(name) {
|
|
|
3122
3303
|
return encoding76
|
|
3123
3304
|
case '@harness/kv-cache-delete-request':
|
|
3124
3305
|
return encoding77
|
|
3306
|
+
case '@harness/detect-language-request':
|
|
3307
|
+
return encoding78
|
|
3308
|
+
case '@harness/detected-language':
|
|
3309
|
+
return encoding79
|
|
3310
|
+
case '@harness/detect-language-response':
|
|
3311
|
+
return encoding80
|
|
3312
|
+
case '@harness/skill-oauth-param':
|
|
3313
|
+
return encoding81
|
|
3314
|
+
case '@harness/skill-oauth-config':
|
|
3315
|
+
return encoding82
|
|
3125
3316
|
default:
|
|
3126
3317
|
throw new Error('Encoder not found ' + name)
|
|
3127
3318
|
}
|