@qvac/harness 0.2.10 → 0.3.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/dist/harness.bundle +13 -11
- package/dist-lib/index.d.ts +26 -1
- package/dist-lib/index.js +94 -3
- package/dist-lib/lib/capabilities/completion.d.ts +2 -0
- 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/enhance.d.ts +10 -0
- package/dist-lib/lib/capabilities/enhance.js +29 -0
- package/dist-lib/lib/capabilities/invoke.d.ts +24 -0
- package/dist-lib/lib/capabilities/invoke.js +57 -0
- package/dist-lib/lib/connect.d.ts +4 -1
- package/dist-lib/lib/connect.js +50 -21
- package/dist-lib/lib/contract-types.d.ts +21 -0
- package/dist-lib/lib/helpers/clean-answer.d.ts +1 -0
- package/dist-lib/lib/helpers/clean-answer.js +16 -0
- package/dist-lib/lib/helpers/load-stall.d.ts +6 -0
- package/dist-lib/lib/helpers/load-stall.js +24 -0
- package/dist-lib/lib/hooks/built-in/sandbox.js +3 -1
- package/dist-lib/lib/models/model-pool.d.ts +6 -0
- package/dist-lib/lib/models/model-pool.js +12 -0
- package/dist-lib/lib/models/nmt-catalog.d.ts +34 -0
- package/dist-lib/lib/models/nmt-catalog.js +166 -0
- package/dist-lib/lib/serve.js +33 -4
- package/dist-lib/lib/tools/generate-image.js +2 -25
- 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/translate.d.ts +78 -0
- package/dist-lib/lib/tools/translate.js +228 -0
- package/dist-lib/lib/tools/web-fetch.js +12 -2
- package/dist-lib/schema/harness.js +53 -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 +206 -10
- package/dist-lib/spec/hyperschema/index.js +206 -10
- package/dist-lib/spec/hyperschema/schema.json +163 -1
- package/dist-lib/spec/hyperschema/types.d.ts +43 -2
- package/package.json +8 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// This file is autogenerated by the hyperschema compiler
|
|
2
|
-
// Schema Version:
|
|
2
|
+
// Schema Version: 12
|
|
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 = 12
|
|
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,10 @@ 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) |
|
|
494
|
+
((version >= 12 && m.enhance) ? 268435456 : 0)
|
|
486
495
|
|
|
487
496
|
encoding10.preencode(state, m.type)
|
|
488
497
|
c.uint.preencode(state, flags)
|
|
@@ -510,6 +519,9 @@ const encoding11 = {
|
|
|
510
519
|
if (version >= 5 && m.grantedDrives) encoding11_23.preencode(state, m.grantedDrives)
|
|
511
520
|
if (version >= 5 && m.payload) c.json.preencode(state, m.payload)
|
|
512
521
|
if (version >= 5 && m.grantedWriteDirs) encoding11_25.preencode(state, m.grantedWriteDirs)
|
|
522
|
+
if (version >= 11 && m.capability) c.string.preencode(state, m.capability)
|
|
523
|
+
if (version >= 11 && m.arguments) c.json.preencode(state, m.arguments)
|
|
524
|
+
if (version >= 12 && m.enhance) c.string.preencode(state, m.enhance)
|
|
513
525
|
},
|
|
514
526
|
encode(state, m) {
|
|
515
527
|
const flags =
|
|
@@ -538,7 +550,10 @@ const encoding11 = {
|
|
|
538
550
|
((version >= 5 && m.grantedDrives) ? 4194304 : 0) |
|
|
539
551
|
((version >= 5 && m.payload) ? 8388608 : 0) |
|
|
540
552
|
((version >= 5 && m.grantedWriteDirs) ? 16777216 : 0) |
|
|
541
|
-
((version >= 9 && m.captureInferenceCalls) ? 33554432 : 0)
|
|
553
|
+
((version >= 9 && m.captureInferenceCalls) ? 33554432 : 0) |
|
|
554
|
+
((version >= 11 && m.capability) ? 67108864 : 0) |
|
|
555
|
+
((version >= 11 && m.arguments) ? 134217728 : 0) |
|
|
556
|
+
((version >= 12 && m.enhance) ? 268435456 : 0)
|
|
542
557
|
|
|
543
558
|
encoding10.encode(state, m.type)
|
|
544
559
|
c.uint.encode(state, flags)
|
|
@@ -566,6 +581,9 @@ const encoding11 = {
|
|
|
566
581
|
if (version >= 5 && m.grantedDrives) encoding11_23.encode(state, m.grantedDrives)
|
|
567
582
|
if (version >= 5 && m.payload) c.json.encode(state, m.payload)
|
|
568
583
|
if (version >= 5 && m.grantedWriteDirs) encoding11_25.encode(state, m.grantedWriteDirs)
|
|
584
|
+
if (version >= 11 && m.capability) c.string.encode(state, m.capability)
|
|
585
|
+
if (version >= 11 && m.arguments) c.json.encode(state, m.arguments)
|
|
586
|
+
if (version >= 12 && m.enhance) c.string.encode(state, m.enhance)
|
|
569
587
|
},
|
|
570
588
|
decode(state) {
|
|
571
589
|
const r0 = encoding10.decode(state)
|
|
@@ -598,7 +616,10 @@ const encoding11 = {
|
|
|
598
616
|
grantedDrives: (version >= 5 && (flags & 4194304) !== 0) ? encoding11_23.decode(state) : null,
|
|
599
617
|
payload: (version >= 5 && (flags & 8388608) !== 0) ? c.json.decode(state) : null,
|
|
600
618
|
grantedWriteDirs: (version >= 5 && (flags & 16777216) !== 0) ? encoding11_25.decode(state) : null,
|
|
601
|
-
captureInferenceCalls: (version >= 9 && (flags & 33554432) !== 0)
|
|
619
|
+
captureInferenceCalls: (version >= 9 && (flags & 33554432) !== 0),
|
|
620
|
+
capability: (version >= 11 && (flags & 67108864) !== 0) ? c.string.decode(state) : null,
|
|
621
|
+
arguments: (version >= 11 && (flags & 134217728) !== 0) ? c.json.decode(state) : null,
|
|
622
|
+
enhance: (version >= 12 && (flags & 268435456) !== 0) ? c.string.decode(state) : null
|
|
602
623
|
}
|
|
603
624
|
}
|
|
604
625
|
}
|
|
@@ -2145,7 +2166,8 @@ const encoding50 = {
|
|
|
2145
2166
|
(m.steps ? 16 : 0) |
|
|
2146
2167
|
(m.configSteps ? 32 : 0) |
|
|
2147
2168
|
(m.fields ? 64 : 0) |
|
|
2148
|
-
(m.satisfied ? 128 : 0)
|
|
2169
|
+
(m.satisfied ? 128 : 0) |
|
|
2170
|
+
((version >= 11 && m.oauth) ? 256 : 0)
|
|
2149
2171
|
|
|
2150
2172
|
encoding49.preencode(state, m.kind)
|
|
2151
2173
|
c.string.preencode(state, m.label)
|
|
@@ -2158,6 +2180,7 @@ const encoding50 = {
|
|
|
2158
2180
|
if (m.steps) encoding50_6.preencode(state, m.steps)
|
|
2159
2181
|
if (m.configSteps) encoding50_7.preencode(state, m.configSteps)
|
|
2160
2182
|
if (m.fields) encoding50_8.preencode(state, m.fields)
|
|
2183
|
+
if (version >= 11 && m.oauth) encoding50_10.preencode(state, m.oauth)
|
|
2161
2184
|
},
|
|
2162
2185
|
encode(state, m) {
|
|
2163
2186
|
const flags =
|
|
@@ -2168,7 +2191,8 @@ const encoding50 = {
|
|
|
2168
2191
|
(m.steps ? 16 : 0) |
|
|
2169
2192
|
(m.configSteps ? 32 : 0) |
|
|
2170
2193
|
(m.fields ? 64 : 0) |
|
|
2171
|
-
(m.satisfied ? 128 : 0)
|
|
2194
|
+
(m.satisfied ? 128 : 0) |
|
|
2195
|
+
((version >= 11 && m.oauth) ? 256 : 0)
|
|
2172
2196
|
|
|
2173
2197
|
encoding49.encode(state, m.kind)
|
|
2174
2198
|
c.string.encode(state, m.label)
|
|
@@ -2181,6 +2205,7 @@ const encoding50 = {
|
|
|
2181
2205
|
if (m.steps) encoding50_6.encode(state, m.steps)
|
|
2182
2206
|
if (m.configSteps) encoding50_7.encode(state, m.configSteps)
|
|
2183
2207
|
if (m.fields) encoding50_8.encode(state, m.fields)
|
|
2208
|
+
if (version >= 11 && m.oauth) encoding50_10.encode(state, m.oauth)
|
|
2184
2209
|
},
|
|
2185
2210
|
decode(state) {
|
|
2186
2211
|
const r0 = encoding49.decode(state)
|
|
@@ -2197,7 +2222,8 @@ const encoding50 = {
|
|
|
2197
2222
|
steps: (flags & 16) !== 0 ? encoding50_6.decode(state) : null,
|
|
2198
2223
|
configSteps: (flags & 32) !== 0 ? encoding50_7.decode(state) : null,
|
|
2199
2224
|
fields: (flags & 64) !== 0 ? encoding50_8.decode(state) : null,
|
|
2200
|
-
satisfied: (flags & 128) !== 0
|
|
2225
|
+
satisfied: (flags & 128) !== 0,
|
|
2226
|
+
oauth: (version >= 11 && (flags & 256) !== 0) ? encoding50_10.decode(state) : null
|
|
2201
2227
|
}
|
|
2202
2228
|
}
|
|
2203
2229
|
}
|
|
@@ -2908,12 +2934,172 @@ const encoding77 = {
|
|
|
2908
2934
|
}
|
|
2909
2935
|
}
|
|
2910
2936
|
|
|
2937
|
+
// @harness/detect-language-request
|
|
2938
|
+
const encoding78 = {
|
|
2939
|
+
preencode(state, m) {
|
|
2940
|
+
c.string.preencode(state, m.text)
|
|
2941
|
+
state.end++ // max flag is 1 so always one byte
|
|
2942
|
+
|
|
2943
|
+
if (version >= 11 && m.topK) c.uint.preencode(state, m.topK)
|
|
2944
|
+
},
|
|
2945
|
+
encode(state, m) {
|
|
2946
|
+
const flags = (version >= 11 && m.topK) ? 1 : 0
|
|
2947
|
+
|
|
2948
|
+
c.string.encode(state, m.text)
|
|
2949
|
+
c.uint.encode(state, flags)
|
|
2950
|
+
|
|
2951
|
+
if (version >= 11 && m.topK) c.uint.encode(state, m.topK)
|
|
2952
|
+
},
|
|
2953
|
+
decode(state) {
|
|
2954
|
+
const r0 = c.string.decode(state)
|
|
2955
|
+
const flags = c.uint.decode(state)
|
|
2956
|
+
|
|
2957
|
+
return {
|
|
2958
|
+
text: r0,
|
|
2959
|
+
topK: (version >= 11 && (flags & 1) !== 0) ? c.uint.decode(state) : 0
|
|
2960
|
+
}
|
|
2961
|
+
}
|
|
2962
|
+
}
|
|
2963
|
+
|
|
2964
|
+
// @harness/detected-language
|
|
2965
|
+
const encoding79 = {
|
|
2966
|
+
preencode(state, m) {
|
|
2967
|
+
c.string.preencode(state, m.code)
|
|
2968
|
+
c.string.preencode(state, m.language)
|
|
2969
|
+
state.end++ // max flag is 1 so always one byte
|
|
2970
|
+
|
|
2971
|
+
if (version >= 11 && m.probability) c.float64.preencode(state, m.probability)
|
|
2972
|
+
},
|
|
2973
|
+
encode(state, m) {
|
|
2974
|
+
const flags = (version >= 11 && m.probability) ? 1 : 0
|
|
2975
|
+
|
|
2976
|
+
c.string.encode(state, m.code)
|
|
2977
|
+
c.string.encode(state, m.language)
|
|
2978
|
+
c.uint.encode(state, flags)
|
|
2979
|
+
|
|
2980
|
+
if (version >= 11 && m.probability) c.float64.encode(state, m.probability)
|
|
2981
|
+
},
|
|
2982
|
+
decode(state) {
|
|
2983
|
+
const r0 = c.string.decode(state)
|
|
2984
|
+
const r1 = c.string.decode(state)
|
|
2985
|
+
const flags = c.uint.decode(state)
|
|
2986
|
+
|
|
2987
|
+
return {
|
|
2988
|
+
code: r0,
|
|
2989
|
+
language: r1,
|
|
2990
|
+
probability: (version >= 11 && (flags & 1) !== 0) ? c.float64.decode(state) : 0
|
|
2991
|
+
}
|
|
2992
|
+
}
|
|
2993
|
+
}
|
|
2994
|
+
|
|
2995
|
+
// @harness/detect-language-response.languages
|
|
2996
|
+
const encoding80_0 = c.array(c.frame(encoding79))
|
|
2997
|
+
|
|
2998
|
+
// @harness/detect-language-response
|
|
2999
|
+
const encoding80 = {
|
|
3000
|
+
preencode(state, m) {
|
|
3001
|
+
encoding80_0.preencode(state, m.languages)
|
|
3002
|
+
},
|
|
3003
|
+
encode(state, m) {
|
|
3004
|
+
encoding80_0.encode(state, m.languages)
|
|
3005
|
+
},
|
|
3006
|
+
decode(state) {
|
|
3007
|
+
const r0 = encoding80_0.decode(state)
|
|
3008
|
+
|
|
3009
|
+
return {
|
|
3010
|
+
languages: r0
|
|
3011
|
+
}
|
|
3012
|
+
}
|
|
3013
|
+
}
|
|
3014
|
+
|
|
3015
|
+
// @harness/skill-oauth-param
|
|
3016
|
+
const encoding81 = {
|
|
3017
|
+
preencode(state, m) {
|
|
3018
|
+
c.string.preencode(state, m.key)
|
|
3019
|
+
c.string.preencode(state, m.value)
|
|
3020
|
+
},
|
|
3021
|
+
encode(state, m) {
|
|
3022
|
+
c.string.encode(state, m.key)
|
|
3023
|
+
c.string.encode(state, m.value)
|
|
3024
|
+
},
|
|
3025
|
+
decode(state) {
|
|
3026
|
+
const r0 = c.string.decode(state)
|
|
3027
|
+
const r1 = c.string.decode(state)
|
|
3028
|
+
|
|
3029
|
+
return {
|
|
3030
|
+
key: r0,
|
|
3031
|
+
value: r1
|
|
3032
|
+
}
|
|
3033
|
+
}
|
|
3034
|
+
}
|
|
3035
|
+
|
|
3036
|
+
// @harness/skill-oauth-config.scopes
|
|
3037
|
+
const encoding82_4 = encoding4_4
|
|
3038
|
+
// @harness/skill-oauth-config.extraAuthParams
|
|
3039
|
+
const encoding82_5 = c.array(c.frame(encoding81))
|
|
3040
|
+
|
|
3041
|
+
// @harness/skill-oauth-config
|
|
3042
|
+
const encoding82 = {
|
|
3043
|
+
preencode(state, m) {
|
|
3044
|
+
c.string.preencode(state, m.stateKey)
|
|
3045
|
+
c.string.preencode(state, m.authUrl)
|
|
3046
|
+
c.string.preencode(state, m.tokenUrl)
|
|
3047
|
+
c.string.preencode(state, m.tokenAuth)
|
|
3048
|
+
state.end++ // max flag is 16 so always one byte
|
|
3049
|
+
|
|
3050
|
+
if (version >= 11 && m.scopes) encoding82_4.preencode(state, m.scopes)
|
|
3051
|
+
if (version >= 11 && m.extraAuthParams) encoding82_5.preencode(state, m.extraAuthParams)
|
|
3052
|
+
if (version >= 11 && m.registrationEndpoint) c.string.preencode(state, m.registrationEndpoint)
|
|
3053
|
+
if (version >= 11 && m.port) c.uint.preencode(state, m.port)
|
|
3054
|
+
},
|
|
3055
|
+
encode(state, m) {
|
|
3056
|
+
const flags =
|
|
3057
|
+
((version >= 11 && m.scopes) ? 1 : 0) |
|
|
3058
|
+
((version >= 11 && m.extraAuthParams) ? 2 : 0) |
|
|
3059
|
+
((version >= 11 && m.registrationEndpoint) ? 4 : 0) |
|
|
3060
|
+
((version >= 11 && m.port) ? 8 : 0) |
|
|
3061
|
+
((version >= 11 && m.sharedIosSession) ? 16 : 0)
|
|
3062
|
+
|
|
3063
|
+
c.string.encode(state, m.stateKey)
|
|
3064
|
+
c.string.encode(state, m.authUrl)
|
|
3065
|
+
c.string.encode(state, m.tokenUrl)
|
|
3066
|
+
c.string.encode(state, m.tokenAuth)
|
|
3067
|
+
c.uint.encode(state, flags)
|
|
3068
|
+
|
|
3069
|
+
if (version >= 11 && m.scopes) encoding82_4.encode(state, m.scopes)
|
|
3070
|
+
if (version >= 11 && m.extraAuthParams) encoding82_5.encode(state, m.extraAuthParams)
|
|
3071
|
+
if (version >= 11 && m.registrationEndpoint) c.string.encode(state, m.registrationEndpoint)
|
|
3072
|
+
if (version >= 11 && m.port) c.uint.encode(state, m.port)
|
|
3073
|
+
},
|
|
3074
|
+
decode(state) {
|
|
3075
|
+
const r0 = c.string.decode(state)
|
|
3076
|
+
const r1 = c.string.decode(state)
|
|
3077
|
+
const r2 = c.string.decode(state)
|
|
3078
|
+
const r3 = c.string.decode(state)
|
|
3079
|
+
const flags = c.uint.decode(state)
|
|
3080
|
+
|
|
3081
|
+
return {
|
|
3082
|
+
stateKey: r0,
|
|
3083
|
+
authUrl: r1,
|
|
3084
|
+
tokenUrl: r2,
|
|
3085
|
+
tokenAuth: r3,
|
|
3086
|
+
scopes: (version >= 11 && (flags & 1) !== 0) ? encoding82_4.decode(state) : null,
|
|
3087
|
+
extraAuthParams: (version >= 11 && (flags & 2) !== 0) ? encoding82_5.decode(state) : null,
|
|
3088
|
+
registrationEndpoint: (version >= 11 && (flags & 4) !== 0) ? c.string.decode(state) : null,
|
|
3089
|
+
port: (version >= 11 && (flags & 8) !== 0) ? c.uint.decode(state) : 0,
|
|
3090
|
+
sharedIosSession: (version >= 11 && (flags & 16) !== 0)
|
|
3091
|
+
}
|
|
3092
|
+
}
|
|
3093
|
+
}
|
|
3094
|
+
|
|
2911
3095
|
// @harness/completion-frame.grantedDrives, deferred due to recusive use
|
|
2912
3096
|
const encoding11_23 = c.array(c.frame(encoding60))
|
|
2913
3097
|
// @harness/skill.setupV2, deferred due to recusive use
|
|
2914
3098
|
const encoding28_14 = c.frame(encoding51)
|
|
2915
3099
|
// @harness/capability-response.memoryBudget, deferred due to recusive use
|
|
2916
3100
|
const encoding42_2 = c.frame(encoding57)
|
|
3101
|
+
// @harness/skill-setup-route-v2.oauth, deferred due to recusive use
|
|
3102
|
+
const encoding50_10 = c.frame(encoding82)
|
|
2917
3103
|
|
|
2918
3104
|
function setVersion(v) {
|
|
2919
3105
|
version = v
|
|
@@ -3122,6 +3308,16 @@ function getEncoding(name) {
|
|
|
3122
3308
|
return encoding76
|
|
3123
3309
|
case '@harness/kv-cache-delete-request':
|
|
3124
3310
|
return encoding77
|
|
3311
|
+
case '@harness/detect-language-request':
|
|
3312
|
+
return encoding78
|
|
3313
|
+
case '@harness/detected-language':
|
|
3314
|
+
return encoding79
|
|
3315
|
+
case '@harness/detect-language-response':
|
|
3316
|
+
return encoding80
|
|
3317
|
+
case '@harness/skill-oauth-param':
|
|
3318
|
+
return encoding81
|
|
3319
|
+
case '@harness/skill-oauth-config':
|
|
3320
|
+
return encoding82
|
|
3125
3321
|
default:
|
|
3126
3322
|
throw new Error('Encoder not found ' + name)
|
|
3127
3323
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// This file is autogenerated by the hyperschema compiler
|
|
2
|
-
// Schema Version:
|
|
2
|
+
// Schema Version: 12
|
|
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 = 12
|
|
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,10 @@ 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) |
|
|
494
|
+
((version >= 12 && m.enhance) ? 268435456 : 0)
|
|
486
495
|
|
|
487
496
|
encoding10.preencode(state, m.type)
|
|
488
497
|
c.uint.preencode(state, flags)
|
|
@@ -510,6 +519,9 @@ const encoding11 = {
|
|
|
510
519
|
if (version >= 5 && m.grantedDrives) encoding11_23.preencode(state, m.grantedDrives)
|
|
511
520
|
if (version >= 5 && m.payload) c.json.preencode(state, m.payload)
|
|
512
521
|
if (version >= 5 && m.grantedWriteDirs) encoding11_25.preencode(state, m.grantedWriteDirs)
|
|
522
|
+
if (version >= 11 && m.capability) c.string.preencode(state, m.capability)
|
|
523
|
+
if (version >= 11 && m.arguments) c.json.preencode(state, m.arguments)
|
|
524
|
+
if (version >= 12 && m.enhance) c.string.preencode(state, m.enhance)
|
|
513
525
|
},
|
|
514
526
|
encode(state, m) {
|
|
515
527
|
const flags =
|
|
@@ -538,7 +550,10 @@ const encoding11 = {
|
|
|
538
550
|
((version >= 5 && m.grantedDrives) ? 4194304 : 0) |
|
|
539
551
|
((version >= 5 && m.payload) ? 8388608 : 0) |
|
|
540
552
|
((version >= 5 && m.grantedWriteDirs) ? 16777216 : 0) |
|
|
541
|
-
((version >= 9 && m.captureInferenceCalls) ? 33554432 : 0)
|
|
553
|
+
((version >= 9 && m.captureInferenceCalls) ? 33554432 : 0) |
|
|
554
|
+
((version >= 11 && m.capability) ? 67108864 : 0) |
|
|
555
|
+
((version >= 11 && m.arguments) ? 134217728 : 0) |
|
|
556
|
+
((version >= 12 && m.enhance) ? 268435456 : 0)
|
|
542
557
|
|
|
543
558
|
encoding10.encode(state, m.type)
|
|
544
559
|
c.uint.encode(state, flags)
|
|
@@ -566,6 +581,9 @@ const encoding11 = {
|
|
|
566
581
|
if (version >= 5 && m.grantedDrives) encoding11_23.encode(state, m.grantedDrives)
|
|
567
582
|
if (version >= 5 && m.payload) c.json.encode(state, m.payload)
|
|
568
583
|
if (version >= 5 && m.grantedWriteDirs) encoding11_25.encode(state, m.grantedWriteDirs)
|
|
584
|
+
if (version >= 11 && m.capability) c.string.encode(state, m.capability)
|
|
585
|
+
if (version >= 11 && m.arguments) c.json.encode(state, m.arguments)
|
|
586
|
+
if (version >= 12 && m.enhance) c.string.encode(state, m.enhance)
|
|
569
587
|
},
|
|
570
588
|
decode(state) {
|
|
571
589
|
const r0 = encoding10.decode(state)
|
|
@@ -598,7 +616,10 @@ const encoding11 = {
|
|
|
598
616
|
grantedDrives: (version >= 5 && (flags & 4194304) !== 0) ? encoding11_23.decode(state) : null,
|
|
599
617
|
payload: (version >= 5 && (flags & 8388608) !== 0) ? c.json.decode(state) : null,
|
|
600
618
|
grantedWriteDirs: (version >= 5 && (flags & 16777216) !== 0) ? encoding11_25.decode(state) : null,
|
|
601
|
-
captureInferenceCalls: (version >= 9 && (flags & 33554432) !== 0)
|
|
619
|
+
captureInferenceCalls: (version >= 9 && (flags & 33554432) !== 0),
|
|
620
|
+
capability: (version >= 11 && (flags & 67108864) !== 0) ? c.string.decode(state) : null,
|
|
621
|
+
arguments: (version >= 11 && (flags & 134217728) !== 0) ? c.json.decode(state) : null,
|
|
622
|
+
enhance: (version >= 12 && (flags & 268435456) !== 0) ? c.string.decode(state) : null
|
|
602
623
|
}
|
|
603
624
|
}
|
|
604
625
|
}
|
|
@@ -2145,7 +2166,8 @@ const encoding50 = {
|
|
|
2145
2166
|
(m.steps ? 16 : 0) |
|
|
2146
2167
|
(m.configSteps ? 32 : 0) |
|
|
2147
2168
|
(m.fields ? 64 : 0) |
|
|
2148
|
-
(m.satisfied ? 128 : 0)
|
|
2169
|
+
(m.satisfied ? 128 : 0) |
|
|
2170
|
+
((version >= 11 && m.oauth) ? 256 : 0)
|
|
2149
2171
|
|
|
2150
2172
|
encoding49.preencode(state, m.kind)
|
|
2151
2173
|
c.string.preencode(state, m.label)
|
|
@@ -2158,6 +2180,7 @@ const encoding50 = {
|
|
|
2158
2180
|
if (m.steps) encoding50_6.preencode(state, m.steps)
|
|
2159
2181
|
if (m.configSteps) encoding50_7.preencode(state, m.configSteps)
|
|
2160
2182
|
if (m.fields) encoding50_8.preencode(state, m.fields)
|
|
2183
|
+
if (version >= 11 && m.oauth) encoding50_10.preencode(state, m.oauth)
|
|
2161
2184
|
},
|
|
2162
2185
|
encode(state, m) {
|
|
2163
2186
|
const flags =
|
|
@@ -2168,7 +2191,8 @@ const encoding50 = {
|
|
|
2168
2191
|
(m.steps ? 16 : 0) |
|
|
2169
2192
|
(m.configSteps ? 32 : 0) |
|
|
2170
2193
|
(m.fields ? 64 : 0) |
|
|
2171
|
-
(m.satisfied ? 128 : 0)
|
|
2194
|
+
(m.satisfied ? 128 : 0) |
|
|
2195
|
+
((version >= 11 && m.oauth) ? 256 : 0)
|
|
2172
2196
|
|
|
2173
2197
|
encoding49.encode(state, m.kind)
|
|
2174
2198
|
c.string.encode(state, m.label)
|
|
@@ -2181,6 +2205,7 @@ const encoding50 = {
|
|
|
2181
2205
|
if (m.steps) encoding50_6.encode(state, m.steps)
|
|
2182
2206
|
if (m.configSteps) encoding50_7.encode(state, m.configSteps)
|
|
2183
2207
|
if (m.fields) encoding50_8.encode(state, m.fields)
|
|
2208
|
+
if (version >= 11 && m.oauth) encoding50_10.encode(state, m.oauth)
|
|
2184
2209
|
},
|
|
2185
2210
|
decode(state) {
|
|
2186
2211
|
const r0 = encoding49.decode(state)
|
|
@@ -2197,7 +2222,8 @@ const encoding50 = {
|
|
|
2197
2222
|
steps: (flags & 16) !== 0 ? encoding50_6.decode(state) : null,
|
|
2198
2223
|
configSteps: (flags & 32) !== 0 ? encoding50_7.decode(state) : null,
|
|
2199
2224
|
fields: (flags & 64) !== 0 ? encoding50_8.decode(state) : null,
|
|
2200
|
-
satisfied: (flags & 128) !== 0
|
|
2225
|
+
satisfied: (flags & 128) !== 0,
|
|
2226
|
+
oauth: (version >= 11 && (flags & 256) !== 0) ? encoding50_10.decode(state) : null
|
|
2201
2227
|
}
|
|
2202
2228
|
}
|
|
2203
2229
|
}
|
|
@@ -2908,12 +2934,172 @@ const encoding77 = {
|
|
|
2908
2934
|
}
|
|
2909
2935
|
}
|
|
2910
2936
|
|
|
2937
|
+
// @harness/detect-language-request
|
|
2938
|
+
const encoding78 = {
|
|
2939
|
+
preencode(state, m) {
|
|
2940
|
+
c.string.preencode(state, m.text)
|
|
2941
|
+
state.end++ // max flag is 1 so always one byte
|
|
2942
|
+
|
|
2943
|
+
if (version >= 11 && m.topK) c.uint.preencode(state, m.topK)
|
|
2944
|
+
},
|
|
2945
|
+
encode(state, m) {
|
|
2946
|
+
const flags = (version >= 11 && m.topK) ? 1 : 0
|
|
2947
|
+
|
|
2948
|
+
c.string.encode(state, m.text)
|
|
2949
|
+
c.uint.encode(state, flags)
|
|
2950
|
+
|
|
2951
|
+
if (version >= 11 && m.topK) c.uint.encode(state, m.topK)
|
|
2952
|
+
},
|
|
2953
|
+
decode(state) {
|
|
2954
|
+
const r0 = c.string.decode(state)
|
|
2955
|
+
const flags = c.uint.decode(state)
|
|
2956
|
+
|
|
2957
|
+
return {
|
|
2958
|
+
text: r0,
|
|
2959
|
+
topK: (version >= 11 && (flags & 1) !== 0) ? c.uint.decode(state) : 0
|
|
2960
|
+
}
|
|
2961
|
+
}
|
|
2962
|
+
}
|
|
2963
|
+
|
|
2964
|
+
// @harness/detected-language
|
|
2965
|
+
const encoding79 = {
|
|
2966
|
+
preencode(state, m) {
|
|
2967
|
+
c.string.preencode(state, m.code)
|
|
2968
|
+
c.string.preencode(state, m.language)
|
|
2969
|
+
state.end++ // max flag is 1 so always one byte
|
|
2970
|
+
|
|
2971
|
+
if (version >= 11 && m.probability) c.float64.preencode(state, m.probability)
|
|
2972
|
+
},
|
|
2973
|
+
encode(state, m) {
|
|
2974
|
+
const flags = (version >= 11 && m.probability) ? 1 : 0
|
|
2975
|
+
|
|
2976
|
+
c.string.encode(state, m.code)
|
|
2977
|
+
c.string.encode(state, m.language)
|
|
2978
|
+
c.uint.encode(state, flags)
|
|
2979
|
+
|
|
2980
|
+
if (version >= 11 && m.probability) c.float64.encode(state, m.probability)
|
|
2981
|
+
},
|
|
2982
|
+
decode(state) {
|
|
2983
|
+
const r0 = c.string.decode(state)
|
|
2984
|
+
const r1 = c.string.decode(state)
|
|
2985
|
+
const flags = c.uint.decode(state)
|
|
2986
|
+
|
|
2987
|
+
return {
|
|
2988
|
+
code: r0,
|
|
2989
|
+
language: r1,
|
|
2990
|
+
probability: (version >= 11 && (flags & 1) !== 0) ? c.float64.decode(state) : 0
|
|
2991
|
+
}
|
|
2992
|
+
}
|
|
2993
|
+
}
|
|
2994
|
+
|
|
2995
|
+
// @harness/detect-language-response.languages
|
|
2996
|
+
const encoding80_0 = c.array(c.frame(encoding79))
|
|
2997
|
+
|
|
2998
|
+
// @harness/detect-language-response
|
|
2999
|
+
const encoding80 = {
|
|
3000
|
+
preencode(state, m) {
|
|
3001
|
+
encoding80_0.preencode(state, m.languages)
|
|
3002
|
+
},
|
|
3003
|
+
encode(state, m) {
|
|
3004
|
+
encoding80_0.encode(state, m.languages)
|
|
3005
|
+
},
|
|
3006
|
+
decode(state) {
|
|
3007
|
+
const r0 = encoding80_0.decode(state)
|
|
3008
|
+
|
|
3009
|
+
return {
|
|
3010
|
+
languages: r0
|
|
3011
|
+
}
|
|
3012
|
+
}
|
|
3013
|
+
}
|
|
3014
|
+
|
|
3015
|
+
// @harness/skill-oauth-param
|
|
3016
|
+
const encoding81 = {
|
|
3017
|
+
preencode(state, m) {
|
|
3018
|
+
c.string.preencode(state, m.key)
|
|
3019
|
+
c.string.preencode(state, m.value)
|
|
3020
|
+
},
|
|
3021
|
+
encode(state, m) {
|
|
3022
|
+
c.string.encode(state, m.key)
|
|
3023
|
+
c.string.encode(state, m.value)
|
|
3024
|
+
},
|
|
3025
|
+
decode(state) {
|
|
3026
|
+
const r0 = c.string.decode(state)
|
|
3027
|
+
const r1 = c.string.decode(state)
|
|
3028
|
+
|
|
3029
|
+
return {
|
|
3030
|
+
key: r0,
|
|
3031
|
+
value: r1
|
|
3032
|
+
}
|
|
3033
|
+
}
|
|
3034
|
+
}
|
|
3035
|
+
|
|
3036
|
+
// @harness/skill-oauth-config.scopes
|
|
3037
|
+
const encoding82_4 = encoding4_4
|
|
3038
|
+
// @harness/skill-oauth-config.extraAuthParams
|
|
3039
|
+
const encoding82_5 = c.array(c.frame(encoding81))
|
|
3040
|
+
|
|
3041
|
+
// @harness/skill-oauth-config
|
|
3042
|
+
const encoding82 = {
|
|
3043
|
+
preencode(state, m) {
|
|
3044
|
+
c.string.preencode(state, m.stateKey)
|
|
3045
|
+
c.string.preencode(state, m.authUrl)
|
|
3046
|
+
c.string.preencode(state, m.tokenUrl)
|
|
3047
|
+
c.string.preencode(state, m.tokenAuth)
|
|
3048
|
+
state.end++ // max flag is 16 so always one byte
|
|
3049
|
+
|
|
3050
|
+
if (version >= 11 && m.scopes) encoding82_4.preencode(state, m.scopes)
|
|
3051
|
+
if (version >= 11 && m.extraAuthParams) encoding82_5.preencode(state, m.extraAuthParams)
|
|
3052
|
+
if (version >= 11 && m.registrationEndpoint) c.string.preencode(state, m.registrationEndpoint)
|
|
3053
|
+
if (version >= 11 && m.port) c.uint.preencode(state, m.port)
|
|
3054
|
+
},
|
|
3055
|
+
encode(state, m) {
|
|
3056
|
+
const flags =
|
|
3057
|
+
((version >= 11 && m.scopes) ? 1 : 0) |
|
|
3058
|
+
((version >= 11 && m.extraAuthParams) ? 2 : 0) |
|
|
3059
|
+
((version >= 11 && m.registrationEndpoint) ? 4 : 0) |
|
|
3060
|
+
((version >= 11 && m.port) ? 8 : 0) |
|
|
3061
|
+
((version >= 11 && m.sharedIosSession) ? 16 : 0)
|
|
3062
|
+
|
|
3063
|
+
c.string.encode(state, m.stateKey)
|
|
3064
|
+
c.string.encode(state, m.authUrl)
|
|
3065
|
+
c.string.encode(state, m.tokenUrl)
|
|
3066
|
+
c.string.encode(state, m.tokenAuth)
|
|
3067
|
+
c.uint.encode(state, flags)
|
|
3068
|
+
|
|
3069
|
+
if (version >= 11 && m.scopes) encoding82_4.encode(state, m.scopes)
|
|
3070
|
+
if (version >= 11 && m.extraAuthParams) encoding82_5.encode(state, m.extraAuthParams)
|
|
3071
|
+
if (version >= 11 && m.registrationEndpoint) c.string.encode(state, m.registrationEndpoint)
|
|
3072
|
+
if (version >= 11 && m.port) c.uint.encode(state, m.port)
|
|
3073
|
+
},
|
|
3074
|
+
decode(state) {
|
|
3075
|
+
const r0 = c.string.decode(state)
|
|
3076
|
+
const r1 = c.string.decode(state)
|
|
3077
|
+
const r2 = c.string.decode(state)
|
|
3078
|
+
const r3 = c.string.decode(state)
|
|
3079
|
+
const flags = c.uint.decode(state)
|
|
3080
|
+
|
|
3081
|
+
return {
|
|
3082
|
+
stateKey: r0,
|
|
3083
|
+
authUrl: r1,
|
|
3084
|
+
tokenUrl: r2,
|
|
3085
|
+
tokenAuth: r3,
|
|
3086
|
+
scopes: (version >= 11 && (flags & 1) !== 0) ? encoding82_4.decode(state) : null,
|
|
3087
|
+
extraAuthParams: (version >= 11 && (flags & 2) !== 0) ? encoding82_5.decode(state) : null,
|
|
3088
|
+
registrationEndpoint: (version >= 11 && (flags & 4) !== 0) ? c.string.decode(state) : null,
|
|
3089
|
+
port: (version >= 11 && (flags & 8) !== 0) ? c.uint.decode(state) : 0,
|
|
3090
|
+
sharedIosSession: (version >= 11 && (flags & 16) !== 0)
|
|
3091
|
+
}
|
|
3092
|
+
}
|
|
3093
|
+
}
|
|
3094
|
+
|
|
2911
3095
|
// @harness/completion-frame.grantedDrives, deferred due to recusive use
|
|
2912
3096
|
const encoding11_23 = c.array(c.frame(encoding60))
|
|
2913
3097
|
// @harness/skill.setupV2, deferred due to recusive use
|
|
2914
3098
|
const encoding28_14 = c.frame(encoding51)
|
|
2915
3099
|
// @harness/capability-response.memoryBudget, deferred due to recusive use
|
|
2916
3100
|
const encoding42_2 = c.frame(encoding57)
|
|
3101
|
+
// @harness/skill-setup-route-v2.oauth, deferred due to recusive use
|
|
3102
|
+
const encoding50_10 = c.frame(encoding82)
|
|
2917
3103
|
|
|
2918
3104
|
function setVersion(v) {
|
|
2919
3105
|
version = v
|
|
@@ -3122,6 +3308,16 @@ function getEncoding(name) {
|
|
|
3122
3308
|
return encoding76
|
|
3123
3309
|
case '@harness/kv-cache-delete-request':
|
|
3124
3310
|
return encoding77
|
|
3311
|
+
case '@harness/detect-language-request':
|
|
3312
|
+
return encoding78
|
|
3313
|
+
case '@harness/detected-language':
|
|
3314
|
+
return encoding79
|
|
3315
|
+
case '@harness/detect-language-response':
|
|
3316
|
+
return encoding80
|
|
3317
|
+
case '@harness/skill-oauth-param':
|
|
3318
|
+
return encoding81
|
|
3319
|
+
case '@harness/skill-oauth-config':
|
|
3320
|
+
return encoding82
|
|
3125
3321
|
default:
|
|
3126
3322
|
throw new Error('Encoder not found ' + name)
|
|
3127
3323
|
}
|