@qvac/harness 0.2.9 → 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.
Files changed (57) hide show
  1. package/README.md +15 -7
  2. package/dist/harness.bundle +11 -62
  3. package/dist/prebuilds-manifest.json +0 -8
  4. package/dist-lib/index.d.ts +16 -1
  5. package/dist-lib/index.js +31 -1
  6. package/dist-lib/lib/capabilities/completion.d.ts +1 -0
  7. package/dist-lib/lib/capabilities/completion.js +66 -9
  8. package/dist-lib/lib/capabilities/detect-language.d.ts +11 -0
  9. package/dist-lib/lib/capabilities/detect-language.js +13 -0
  10. package/dist-lib/lib/capabilities/invoke.d.ts +15 -0
  11. package/dist-lib/lib/capabilities/invoke.js +33 -0
  12. package/dist-lib/lib/connect.d.ts +4 -1
  13. package/dist-lib/lib/connect.js +51 -22
  14. package/dist-lib/lib/contract-types.d.ts +21 -0
  15. package/dist-lib/lib/docx/index.js +4 -27
  16. package/dist-lib/lib/hooks/built-in/index.d.ts +1 -0
  17. package/dist-lib/lib/hooks/built-in/index.js +1 -0
  18. package/dist-lib/lib/hooks/built-in/sandbox.d.ts +5 -0
  19. package/dist-lib/lib/hooks/built-in/sandbox.js +45 -0
  20. package/dist-lib/lib/hooks/built-in/skill-catalog.js +7 -2
  21. package/dist-lib/lib/hooks/registry.js +2 -1
  22. package/dist-lib/lib/hooks/types.d.ts +1 -0
  23. package/dist-lib/lib/office/index.d.ts +6 -0
  24. package/dist-lib/lib/office/index.js +38 -0
  25. package/dist-lib/lib/office/pptx.d.ts +1 -0
  26. package/dist-lib/lib/office/pptx.js +26 -0
  27. package/dist-lib/lib/office/python.d.ts +7 -0
  28. package/dist-lib/lib/office/python.js +32 -0
  29. package/dist-lib/lib/office/xlsx.d.ts +1 -0
  30. package/dist-lib/lib/office/xlsx.js +26 -0
  31. package/dist-lib/lib/serve.js +32 -4
  32. package/dist-lib/lib/tools/edit-image.js +1 -1
  33. package/dist-lib/lib/tools/generate-image.js +1 -1
  34. package/dist-lib/lib/tools/generate-music.js +1 -1
  35. package/dist-lib/lib/tools/http-request.js +4 -4
  36. package/dist-lib/lib/tools/mcp-call.js +3 -3
  37. package/dist-lib/lib/tools/skill.js +4 -2
  38. package/dist-lib/lib/tools/skills/auth-resolver.d.ts +1 -0
  39. package/dist-lib/lib/tools/skills/auth-resolver.js +59 -29
  40. package/dist-lib/lib/tools/skills/manifest-parse.d.ts +1 -0
  41. package/dist-lib/lib/tools/skills/manifest-parse.js +92 -1
  42. package/dist-lib/lib/tools/skills/manifest.d.ts +12 -0
  43. package/dist-lib/lib/tools/toolsets.d.ts +1 -0
  44. package/dist-lib/lib/tools/toolsets.js +1 -0
  45. package/dist-lib/lib/tools/weather-lookup.js +9 -3
  46. package/dist-lib/lib/tools/web-fetch.js +18 -5
  47. package/dist-lib/lib/tools/web-search.js +5 -2
  48. package/dist-lib/schema/harness.js +54 -4
  49. package/dist-lib/spec/bind.js +3 -0
  50. package/dist-lib/spec/calls.js +1 -0
  51. package/dist-lib/spec/hrpc/hrpc.json +13 -0
  52. package/dist-lib/spec/hrpc/index.js +15 -3
  53. package/dist-lib/spec/hrpc/messages.js +207 -13
  54. package/dist-lib/spec/hyperschema/index.js +207 -13
  55. package/dist-lib/spec/hyperschema/schema.json +163 -1
  56. package/dist-lib/spec/hyperschema/types.d.ts +43 -2
  57. package/package.json +7 -2
@@ -1,12 +1,12 @@
1
1
  // This file is autogenerated by the hyperschema compiler
2
- // Schema Version: 9
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
9
+ const VERSION = 11
10
10
 
11
11
  // eslint-disable-next-line no-unused-vars
12
12
  let version = VERSION
@@ -143,7 +143,8 @@ const encoding4 = {
143
143
  (m.imageWidth ? 8192 : 0) |
144
144
  (m.imageHeight ? 16384 : 0) |
145
145
  ((version >= 5 && m.approvalMode) ? 32768 : 0) |
146
- ((version >= 5 && m.disabledToolsets) ? 65536 : 0)
146
+ ((version >= 5 && m.disabledToolsets) ? 65536 : 0) |
147
+ ((version >= 10 && m.sandboxMode) ? 131072 : 0)
147
148
 
148
149
  c.uint.preencode(state, flags)
149
150
 
@@ -183,7 +184,8 @@ const encoding4 = {
183
184
  (m.imageWidth ? 8192 : 0) |
184
185
  (m.imageHeight ? 16384 : 0) |
185
186
  ((version >= 5 && m.approvalMode) ? 32768 : 0) |
186
- ((version >= 5 && m.disabledToolsets) ? 65536 : 0)
187
+ ((version >= 5 && m.disabledToolsets) ? 65536 : 0) |
188
+ ((version >= 10 && m.sandboxMode) ? 131072 : 0)
187
189
 
188
190
  c.uint.encode(state, flags)
189
191
 
@@ -225,7 +227,8 @@ const encoding4 = {
225
227
  imageWidth: (flags & 8192) !== 0 ? c.uint.decode(state) : 0,
226
228
  imageHeight: (flags & 16384) !== 0 ? c.uint.decode(state) : 0,
227
229
  approvalMode: (version >= 5 && (flags & 32768) !== 0) ? encoding59.decode(state) : null,
228
- disabledToolsets: (version >= 5 && (flags & 65536) !== 0) ? encoding4_16.decode(state) : null
230
+ disabledToolsets: (version >= 5 && (flags & 65536) !== 0) ? encoding4_16.decode(state) : null,
231
+ sandboxMode: (version >= 10 && (flags & 131072) !== 0)
229
232
  }
230
233
  }
231
234
  }
@@ -383,13 +386,14 @@ const encoding10_enum = {
383
386
  "fetch-result": 'fetch-result',
384
387
  "rag-result": 'rag-result',
385
388
  "question-result": 'question-result',
386
- "drive-result": 'drive-result'
389
+ "drive-result": 'drive-result',
390
+ invoke: 'invoke'
387
391
  }
388
392
 
389
393
  // @harness/completion-frame-type enum
390
394
  const encoding10 = {
391
395
  preencode (state, m) {
392
- state.end++ // max enum is 7 so always one byte
396
+ state.end++ // max enum is 8 so always one byte
393
397
  },
394
398
  encode (state, m) {
395
399
  switch (m) {
@@ -414,6 +418,9 @@ const encoding10 = {
414
418
  case 'drive-result':
415
419
  c.uint.encode(state, 7)
416
420
  break
421
+ case 'invoke':
422
+ c.uint.encode(state, 8)
423
+ break
417
424
  default:
418
425
  throw new Error('Unknown enum')
419
426
  }
@@ -434,6 +441,8 @@ const encoding10 = {
434
441
  return 'question-result'
435
442
  case 7:
436
443
  return 'drive-result'
444
+ case 8:
445
+ return 'invoke'
437
446
  default: return null
438
447
  }
439
448
  }
@@ -479,7 +488,9 @@ const encoding11 = {
479
488
  ((version >= 5 && m.grantedDrives) ? 4194304 : 0) |
480
489
  ((version >= 5 && m.payload) ? 8388608 : 0) |
481
490
  ((version >= 5 && m.grantedWriteDirs) ? 16777216 : 0) |
482
- ((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)
483
494
 
484
495
  encoding10.preencode(state, m.type)
485
496
  c.uint.preencode(state, flags)
@@ -507,6 +518,8 @@ const encoding11 = {
507
518
  if (version >= 5 && m.grantedDrives) encoding11_23.preencode(state, m.grantedDrives)
508
519
  if (version >= 5 && m.payload) c.json.preencode(state, m.payload)
509
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)
510
523
  },
511
524
  encode(state, m) {
512
525
  const flags =
@@ -535,7 +548,9 @@ const encoding11 = {
535
548
  ((version >= 5 && m.grantedDrives) ? 4194304 : 0) |
536
549
  ((version >= 5 && m.payload) ? 8388608 : 0) |
537
550
  ((version >= 5 && m.grantedWriteDirs) ? 16777216 : 0) |
538
- ((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)
539
554
 
540
555
  encoding10.encode(state, m.type)
541
556
  c.uint.encode(state, flags)
@@ -563,6 +578,8 @@ const encoding11 = {
563
578
  if (version >= 5 && m.grantedDrives) encoding11_23.encode(state, m.grantedDrives)
564
579
  if (version >= 5 && m.payload) c.json.encode(state, m.payload)
565
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)
566
583
  },
567
584
  decode(state) {
568
585
  const r0 = encoding10.decode(state)
@@ -595,7 +612,9 @@ const encoding11 = {
595
612
  grantedDrives: (version >= 5 && (flags & 4194304) !== 0) ? encoding11_23.decode(state) : null,
596
613
  payload: (version >= 5 && (flags & 8388608) !== 0) ? c.json.decode(state) : null,
597
614
  grantedWriteDirs: (version >= 5 && (flags & 16777216) !== 0) ? encoding11_25.decode(state) : null,
598
- 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
599
618
  }
600
619
  }
601
620
  }
@@ -2142,7 +2161,8 @@ const encoding50 = {
2142
2161
  (m.steps ? 16 : 0) |
2143
2162
  (m.configSteps ? 32 : 0) |
2144
2163
  (m.fields ? 64 : 0) |
2145
- (m.satisfied ? 128 : 0)
2164
+ (m.satisfied ? 128 : 0) |
2165
+ ((version >= 11 && m.oauth) ? 256 : 0)
2146
2166
 
2147
2167
  encoding49.preencode(state, m.kind)
2148
2168
  c.string.preencode(state, m.label)
@@ -2155,6 +2175,7 @@ const encoding50 = {
2155
2175
  if (m.steps) encoding50_6.preencode(state, m.steps)
2156
2176
  if (m.configSteps) encoding50_7.preencode(state, m.configSteps)
2157
2177
  if (m.fields) encoding50_8.preencode(state, m.fields)
2178
+ if (version >= 11 && m.oauth) encoding50_10.preencode(state, m.oauth)
2158
2179
  },
2159
2180
  encode(state, m) {
2160
2181
  const flags =
@@ -2165,7 +2186,8 @@ const encoding50 = {
2165
2186
  (m.steps ? 16 : 0) |
2166
2187
  (m.configSteps ? 32 : 0) |
2167
2188
  (m.fields ? 64 : 0) |
2168
- (m.satisfied ? 128 : 0)
2189
+ (m.satisfied ? 128 : 0) |
2190
+ ((version >= 11 && m.oauth) ? 256 : 0)
2169
2191
 
2170
2192
  encoding49.encode(state, m.kind)
2171
2193
  c.string.encode(state, m.label)
@@ -2178,6 +2200,7 @@ const encoding50 = {
2178
2200
  if (m.steps) encoding50_6.encode(state, m.steps)
2179
2201
  if (m.configSteps) encoding50_7.encode(state, m.configSteps)
2180
2202
  if (m.fields) encoding50_8.encode(state, m.fields)
2203
+ if (version >= 11 && m.oauth) encoding50_10.encode(state, m.oauth)
2181
2204
  },
2182
2205
  decode(state) {
2183
2206
  const r0 = encoding49.decode(state)
@@ -2194,7 +2217,8 @@ const encoding50 = {
2194
2217
  steps: (flags & 16) !== 0 ? encoding50_6.decode(state) : null,
2195
2218
  configSteps: (flags & 32) !== 0 ? encoding50_7.decode(state) : null,
2196
2219
  fields: (flags & 64) !== 0 ? encoding50_8.decode(state) : null,
2197
- satisfied: (flags & 128) !== 0
2220
+ satisfied: (flags & 128) !== 0,
2221
+ oauth: (version >= 11 && (flags & 256) !== 0) ? encoding50_10.decode(state) : null
2198
2222
  }
2199
2223
  }
2200
2224
  }
@@ -2905,12 +2929,172 @@ const encoding77 = {
2905
2929
  }
2906
2930
  }
2907
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
+
2908
3090
  // @harness/completion-frame.grantedDrives, deferred due to recusive use
2909
3091
  const encoding11_23 = c.array(c.frame(encoding60))
2910
3092
  // @harness/skill.setupV2, deferred due to recusive use
2911
3093
  const encoding28_14 = c.frame(encoding51)
2912
3094
  // @harness/capability-response.memoryBudget, deferred due to recusive use
2913
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)
2914
3098
 
2915
3099
  function setVersion(v) {
2916
3100
  version = v
@@ -3119,6 +3303,16 @@ function getEncoding(name) {
3119
3303
  return encoding76
3120
3304
  case '@harness/kv-cache-delete-request':
3121
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
3122
3316
  default:
3123
3317
  throw new Error('Encoder not found ' + name)
3124
3318
  }