@qvac/harness 0.3.0 → 0.3.2

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 (68) hide show
  1. package/CHANGELOG.md +262 -0
  2. package/dist/harness.bundle +15 -11
  3. package/dist-lib/index.d.ts +1 -1
  4. package/dist-lib/lib/capabilities/completion.d.ts +5 -1
  5. package/dist-lib/lib/capabilities/completion.js +20 -8
  6. package/dist-lib/lib/helpers/tool-call-markup.js +15 -7
  7. package/dist-lib/lib/no-redirect-fetch-impl.d.ts +3 -2
  8. package/dist-lib/lib/no-redirect-fetch-impl.js +4 -1
  9. package/dist-lib/lib/tools/exec/adapters/adapter.d.ts +5 -1
  10. package/dist-lib/lib/tools/exec/adapters/python/distributions.d.ts +1 -0
  11. package/dist-lib/lib/tools/exec/adapters/python/distributions.js +4 -0
  12. package/dist-lib/lib/tools/exec/adapters/python/guarded-fetch.d.ts +72 -0
  13. package/dist-lib/lib/tools/exec/adapters/python/guarded-fetch.js +222 -0
  14. package/dist-lib/lib/tools/exec/adapters/python/interrupt-timer.d.ts +5 -0
  15. package/dist-lib/lib/tools/exec/adapters/python/interrupt-timer.js +29 -0
  16. package/dist-lib/lib/tools/exec/adapters/python/loader.js +2 -1
  17. package/dist-lib/lib/tools/exec/adapters/python/module-distributions.d.ts +1 -0
  18. package/dist-lib/lib/tools/exec/adapters/python/module-distributions.js +52 -0
  19. package/dist-lib/lib/tools/exec/adapters/python/named-hosts.d.ts +2 -0
  20. package/dist-lib/lib/tools/exec/adapters/python/named-hosts.js +15 -0
  21. package/dist-lib/lib/tools/exec/adapters/python/net-shim.d.ts +2 -0
  22. package/dist-lib/lib/tools/exec/adapters/python/net-shim.js +148 -0
  23. package/dist-lib/lib/tools/exec/adapters/python/output-policy.js +13 -1
  24. package/dist-lib/lib/tools/exec/adapters/python/pyodide.d.ts +4 -1
  25. package/dist-lib/lib/tools/exec/adapters/python/pyodide.js +42 -7
  26. package/dist-lib/lib/tools/exec/adapters/python/python-adapter.d.ts +9 -3
  27. package/dist-lib/lib/tools/exec/adapters/python/python-adapter.js +137 -21
  28. package/dist-lib/lib/tools/exec/adapters/python/run-session.d.ts +5 -0
  29. package/dist-lib/lib/tools/exec/adapters/python/run-session.js +33 -8
  30. package/dist-lib/lib/tools/exec/adapters/python/wheels.d.ts +6 -0
  31. package/dist-lib/lib/tools/exec/adapters/python/wheels.js +17 -3
  32. package/dist-lib/lib/tools/exec/adapters/python/worker/client.d.ts +2 -1
  33. package/dist-lib/lib/tools/exec/adapters/python/worker/client.js +16 -3
  34. package/dist-lib/lib/tools/exec/adapters/python/worker/entry.js +15 -2
  35. package/dist-lib/lib/tools/exec/adapters/python/worker/protocol.d.ts +6 -0
  36. package/dist-lib/lib/tools/exec/adapters/python/worker/protocol.js +6 -2
  37. package/dist-lib/lib/tools/exec/adapters/python/worker/spawn-bare.d.ts +1 -0
  38. package/dist-lib/lib/tools/exec/adapters/python/worker/spawn-bare.js +8 -0
  39. package/dist-lib/lib/tools/exec/adapters/python/worker/spawn-node.d.ts +1 -0
  40. package/dist-lib/lib/tools/exec/adapters/python/worker/spawn-node.js +8 -0
  41. package/dist-lib/lib/tools/exec/adapters/shell/shell-adapter.js +7 -1
  42. package/dist-lib/lib/tools/exec/shell-guidance.d.ts +10 -0
  43. package/dist-lib/lib/tools/exec/shell-guidance.js +123 -0
  44. package/dist-lib/lib/tools/exec/video-tools.d.ts +5 -0
  45. package/dist-lib/lib/tools/exec/video-tools.js +40 -0
  46. package/dist-lib/lib/tools/exec.d.ts +2 -1
  47. package/dist-lib/lib/tools/exec.js +93 -33
  48. package/dist-lib/lib/tools/http-request/truncate-response.d.ts +1 -0
  49. package/dist-lib/lib/tools/http-request/truncate-response.js +1 -1
  50. package/dist-lib/lib/tools/http-request.js +4 -1
  51. package/dist-lib/lib/tools/operations/builders.d.ts +1 -1
  52. package/dist-lib/lib/tools/operations/builders.js +9 -0
  53. package/dist-lib/lib/tools/operations/compile.js +41 -18
  54. package/dist-lib/lib/tools/operations/decoders.d.ts +6 -0
  55. package/dist-lib/lib/tools/operations/decoders.js +82 -0
  56. package/dist-lib/lib/tools/operations/manifest.d.ts +16 -2
  57. package/dist-lib/lib/tools/operations/manifest.js +6 -1
  58. package/dist-lib/lib/tools/skill.d.ts +3 -0
  59. package/dist-lib/lib/tools/skill.js +38 -5
  60. package/dist-lib/lib/tools/skills/manifest-parse.js +43 -1
  61. package/dist-lib/lib/tools/skills/manifest.d.ts +13 -0
  62. package/dist-lib/schema/harness.js +20 -1
  63. package/dist-lib/spec/hrpc/messages.js +93 -5
  64. package/dist-lib/spec/hyperschema/index.js +93 -5
  65. package/dist-lib/spec/hyperschema/schema.json +66 -1
  66. package/dist-lib/spec/hyperschema/types.d.ts +18 -1
  67. package/package.json +40 -2
  68. package/wheels/manifest.json +15 -0
@@ -223,6 +223,46 @@ function readAuthParams(v) {
223
223
  const out = Object.fromEntries(Object.entries(record).filter(([key]) => !OAUTH_RESERVED_PARAMS.has(key)));
224
224
  return Object.keys(out).length > 0 ? out : undefined;
225
225
  }
226
+ const OAUTH_ERROR_CODE = /^[a-z0-9_]+$/;
227
+ function siteOf(url) {
228
+ return new URL(url).hostname.split('.').slice(-2).join('.');
229
+ }
230
+ function readVerifyRule(v) {
231
+ if (!isObj(v) || typeof v.error !== 'string' || !OAUTH_ERROR_CODE.test(v.error))
232
+ return undefined;
233
+ const status = Array.isArray(v.status)
234
+ ? v.status.filter((s) => Number.isInteger(s) && s >= 100 && s < 600)
235
+ : [];
236
+ const field = typeof v.field === 'string' && v.field.length > 0 ? v.field : undefined;
237
+ if (status.length === 0 && !field)
238
+ return undefined;
239
+ return {
240
+ error: v.error,
241
+ ...(status.length > 0 ? { status } : {}),
242
+ ...(field ? { field } : {}),
243
+ ...(field && typeof v.notEqual === 'string' ? { notEqual: v.notEqual } : {})
244
+ };
245
+ }
246
+ function readVerify(v, tokenUrl) {
247
+ if (!isObj(v))
248
+ return undefined;
249
+ const url = httpsUrl(v.url);
250
+ if (!url || siteOf(url) !== siteOf(tokenUrl))
251
+ return undefined;
252
+ if (v.method !== undefined && v.method !== null && v.method !== 'GET' && v.method !== 'POST') {
253
+ return undefined;
254
+ }
255
+ const reject = Array.isArray(v.reject) ? v.reject.flatMap((r) => readVerifyRule(r) ?? []) : [];
256
+ if (reject.length === 0)
257
+ return undefined;
258
+ const body = typeof v.body === 'string' ? v.body : isObj(v.body) ? JSON.stringify(v.body) : undefined;
259
+ return {
260
+ url,
261
+ ...(v.method === 'GET' || v.method === 'POST' ? { method: v.method } : {}),
262
+ ...(body !== undefined ? { body } : {}),
263
+ reject
264
+ };
265
+ }
226
266
  function readOAuth(v) {
227
267
  if (!isObj(v))
228
268
  return undefined;
@@ -240,6 +280,7 @@ function readOAuth(v) {
240
280
  return undefined;
241
281
  const extraAuthParams = readAuthParams(v.extraAuthParams);
242
282
  const registrationEndpoint = httpsUrl(v.registrationEndpoint);
283
+ const verify = readVerify(v.verify, tokenUrl);
243
284
  return {
244
285
  stateKey: v.stateKey,
245
286
  authUrl,
@@ -249,7 +290,8 @@ function readOAuth(v) {
249
290
  ...(extraAuthParams ? { extraAuthParams } : {}),
250
291
  ...(registrationEndpoint ? { registrationEndpoint } : {}),
251
292
  ...(isPort(v.port) ? { port: v.port } : {}),
252
- ...(typeof v.sharedIosSession === 'boolean' ? { sharedIosSession: v.sharedIosSession } : {})
293
+ ...(typeof v.sharedIosSession === 'boolean' ? { sharedIosSession: v.sharedIosSession } : {}),
294
+ ...(verify ? { verify } : {})
253
295
  };
254
296
  }
255
297
  export function toWireSetup(setup) {
@@ -39,6 +39,19 @@ export interface SkillOAuthConfig {
39
39
  readonly registrationEndpoint?: string;
40
40
  readonly port?: number;
41
41
  readonly sharedIosSession?: boolean;
42
+ readonly verify?: SkillOAuthVerify;
43
+ }
44
+ export interface SkillOAuthVerify {
45
+ readonly url: string;
46
+ readonly method?: 'GET' | 'POST';
47
+ readonly body?: string;
48
+ readonly reject: readonly SkillOAuthVerifyRule[];
49
+ }
50
+ export interface SkillOAuthVerifyRule {
51
+ readonly error: string;
52
+ readonly status?: readonly number[];
53
+ readonly field?: string;
54
+ readonly notEqual?: string;
42
55
  }
43
56
  export interface SkillSetupRoute {
44
57
  readonly kind: 'oauth' | 'token' | 'install' | 'picker' | 'instructions';
@@ -645,6 +645,24 @@ export function registerHarnessTypes(ns) {
645
645
  { name: 'value', type: 'string', required: true }
646
646
  ]
647
647
  });
648
+ ns.register({
649
+ name: 'skill-oauth-verify-rule',
650
+ fields: [
651
+ { name: 'error', type: 'string', required: true },
652
+ { name: 'status', type: 'uint', array: true },
653
+ { name: 'field', type: 'string' },
654
+ { name: 'notEqual', type: 'string' }
655
+ ]
656
+ });
657
+ ns.register({
658
+ name: 'skill-oauth-verify',
659
+ fields: [
660
+ { name: 'url', type: 'string', required: true },
661
+ { name: 'method', type: 'string' },
662
+ { name: 'body', type: 'string' },
663
+ { name: 'reject', type: '@harness/skill-oauth-verify-rule', array: true }
664
+ ]
665
+ });
648
666
  ns.register({
649
667
  name: 'skill-oauth-config',
650
668
  fields: [
@@ -656,7 +674,8 @@ export function registerHarnessTypes(ns) {
656
674
  { name: 'extraAuthParams', type: '@harness/skill-oauth-param', array: true },
657
675
  { name: 'registrationEndpoint', type: 'string' },
658
676
  { name: 'port', type: 'uint' },
659
- { name: 'sharedIosSession', type: 'bool' }
677
+ { name: 'sharedIosSession', type: 'bool' },
678
+ { name: 'verify', type: '@harness/skill-oauth-verify' }
660
679
  ]
661
680
  });
662
681
  }
@@ -1,12 +1,12 @@
1
1
  // This file is autogenerated by the hyperschema compiler
2
- // Schema Version: 12
2
+ // Schema Version: 13
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 = 12
9
+ const VERSION = 13
10
10
 
11
11
  // eslint-disable-next-line no-unused-vars
12
12
  let version = VERSION
@@ -3045,12 +3045,13 @@ const encoding82 = {
3045
3045
  c.string.preencode(state, m.authUrl)
3046
3046
  c.string.preencode(state, m.tokenUrl)
3047
3047
  c.string.preencode(state, m.tokenAuth)
3048
- state.end++ // max flag is 16 so always one byte
3048
+ state.end++ // max flag is 32 so always one byte
3049
3049
 
3050
3050
  if (version >= 11 && m.scopes) encoding82_4.preencode(state, m.scopes)
3051
3051
  if (version >= 11 && m.extraAuthParams) encoding82_5.preencode(state, m.extraAuthParams)
3052
3052
  if (version >= 11 && m.registrationEndpoint) c.string.preencode(state, m.registrationEndpoint)
3053
3053
  if (version >= 11 && m.port) c.uint.preencode(state, m.port)
3054
+ if (version >= 13 && m.verify) encoding82_9.preencode(state, m.verify)
3054
3055
  },
3055
3056
  encode(state, m) {
3056
3057
  const flags =
@@ -3058,7 +3059,8 @@ const encoding82 = {
3058
3059
  ((version >= 11 && m.extraAuthParams) ? 2 : 0) |
3059
3060
  ((version >= 11 && m.registrationEndpoint) ? 4 : 0) |
3060
3061
  ((version >= 11 && m.port) ? 8 : 0) |
3061
- ((version >= 11 && m.sharedIosSession) ? 16 : 0)
3062
+ ((version >= 11 && m.sharedIosSession) ? 16 : 0) |
3063
+ ((version >= 13 && m.verify) ? 32 : 0)
3062
3064
 
3063
3065
  c.string.encode(state, m.stateKey)
3064
3066
  c.string.encode(state, m.authUrl)
@@ -3070,6 +3072,7 @@ const encoding82 = {
3070
3072
  if (version >= 11 && m.extraAuthParams) encoding82_5.encode(state, m.extraAuthParams)
3071
3073
  if (version >= 11 && m.registrationEndpoint) c.string.encode(state, m.registrationEndpoint)
3072
3074
  if (version >= 11 && m.port) c.uint.encode(state, m.port)
3075
+ if (version >= 13 && m.verify) encoding82_9.encode(state, m.verify)
3073
3076
  },
3074
3077
  decode(state) {
3075
3078
  const r0 = c.string.decode(state)
@@ -3087,7 +3090,86 @@ const encoding82 = {
3087
3090
  extraAuthParams: (version >= 11 && (flags & 2) !== 0) ? encoding82_5.decode(state) : null,
3088
3091
  registrationEndpoint: (version >= 11 && (flags & 4) !== 0) ? c.string.decode(state) : null,
3089
3092
  port: (version >= 11 && (flags & 8) !== 0) ? c.uint.decode(state) : 0,
3090
- sharedIosSession: (version >= 11 && (flags & 16) !== 0)
3093
+ sharedIosSession: (version >= 11 && (flags & 16) !== 0),
3094
+ verify: (version >= 13 && (flags & 32) !== 0) ? encoding82_9.decode(state) : null
3095
+ }
3096
+ }
3097
+ }
3098
+
3099
+ // @harness/skill-oauth-verify-rule.status
3100
+ const encoding83_1 = c.array(c.uint)
3101
+
3102
+ // @harness/skill-oauth-verify-rule
3103
+ const encoding83 = {
3104
+ preencode(state, m) {
3105
+ c.string.preencode(state, m.error)
3106
+ state.end++ // max flag is 4 so always one byte
3107
+
3108
+ if (version >= 13 && m.status) encoding83_1.preencode(state, m.status)
3109
+ if (version >= 13 && m.field) c.string.preencode(state, m.field)
3110
+ if (version >= 13 && m.notEqual) c.string.preencode(state, m.notEqual)
3111
+ },
3112
+ encode(state, m) {
3113
+ const flags =
3114
+ ((version >= 13 && m.status) ? 1 : 0) |
3115
+ ((version >= 13 && m.field) ? 2 : 0) |
3116
+ ((version >= 13 && m.notEqual) ? 4 : 0)
3117
+
3118
+ c.string.encode(state, m.error)
3119
+ c.uint.encode(state, flags)
3120
+
3121
+ if (version >= 13 && m.status) encoding83_1.encode(state, m.status)
3122
+ if (version >= 13 && m.field) c.string.encode(state, m.field)
3123
+ if (version >= 13 && m.notEqual) c.string.encode(state, m.notEqual)
3124
+ },
3125
+ decode(state) {
3126
+ const r0 = c.string.decode(state)
3127
+ const flags = c.uint.decode(state)
3128
+
3129
+ return {
3130
+ error: r0,
3131
+ status: (version >= 13 && (flags & 1) !== 0) ? encoding83_1.decode(state) : null,
3132
+ field: (version >= 13 && (flags & 2) !== 0) ? c.string.decode(state) : null,
3133
+ notEqual: (version >= 13 && (flags & 4) !== 0) ? c.string.decode(state) : null
3134
+ }
3135
+ }
3136
+ }
3137
+
3138
+ // @harness/skill-oauth-verify.reject
3139
+ const encoding84_3 = c.array(c.frame(encoding83))
3140
+
3141
+ // @harness/skill-oauth-verify
3142
+ const encoding84 = {
3143
+ preencode(state, m) {
3144
+ c.string.preencode(state, m.url)
3145
+ state.end++ // max flag is 4 so always one byte
3146
+
3147
+ if (version >= 13 && m.method) c.string.preencode(state, m.method)
3148
+ if (version >= 13 && m.body) c.string.preencode(state, m.body)
3149
+ if (version >= 13 && m.reject) encoding84_3.preencode(state, m.reject)
3150
+ },
3151
+ encode(state, m) {
3152
+ const flags =
3153
+ ((version >= 13 && m.method) ? 1 : 0) |
3154
+ ((version >= 13 && m.body) ? 2 : 0) |
3155
+ ((version >= 13 && m.reject) ? 4 : 0)
3156
+
3157
+ c.string.encode(state, m.url)
3158
+ c.uint.encode(state, flags)
3159
+
3160
+ if (version >= 13 && m.method) c.string.encode(state, m.method)
3161
+ if (version >= 13 && m.body) c.string.encode(state, m.body)
3162
+ if (version >= 13 && m.reject) encoding84_3.encode(state, m.reject)
3163
+ },
3164
+ decode(state) {
3165
+ const r0 = c.string.decode(state)
3166
+ const flags = c.uint.decode(state)
3167
+
3168
+ return {
3169
+ url: r0,
3170
+ method: (version >= 13 && (flags & 1) !== 0) ? c.string.decode(state) : null,
3171
+ body: (version >= 13 && (flags & 2) !== 0) ? c.string.decode(state) : null,
3172
+ reject: (version >= 13 && (flags & 4) !== 0) ? encoding84_3.decode(state) : null
3091
3173
  }
3092
3174
  }
3093
3175
  }
@@ -3100,6 +3182,8 @@ const encoding28_14 = c.frame(encoding51)
3100
3182
  const encoding42_2 = c.frame(encoding57)
3101
3183
  // @harness/skill-setup-route-v2.oauth, deferred due to recusive use
3102
3184
  const encoding50_10 = c.frame(encoding82)
3185
+ // @harness/skill-oauth-config.verify, deferred due to recusive use
3186
+ const encoding82_9 = c.frame(encoding84)
3103
3187
 
3104
3188
  function setVersion(v) {
3105
3189
  version = v
@@ -3318,6 +3402,10 @@ function getEncoding(name) {
3318
3402
  return encoding81
3319
3403
  case '@harness/skill-oauth-config':
3320
3404
  return encoding82
3405
+ case '@harness/skill-oauth-verify-rule':
3406
+ return encoding83
3407
+ case '@harness/skill-oauth-verify':
3408
+ return encoding84
3321
3409
  default:
3322
3410
  throw new Error('Encoder not found ' + name)
3323
3411
  }
@@ -1,12 +1,12 @@
1
1
  // This file is autogenerated by the hyperschema compiler
2
- // Schema Version: 12
2
+ // Schema Version: 13
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 = 12
9
+ const VERSION = 13
10
10
 
11
11
  // eslint-disable-next-line no-unused-vars
12
12
  let version = VERSION
@@ -3045,12 +3045,13 @@ const encoding82 = {
3045
3045
  c.string.preencode(state, m.authUrl)
3046
3046
  c.string.preencode(state, m.tokenUrl)
3047
3047
  c.string.preencode(state, m.tokenAuth)
3048
- state.end++ // max flag is 16 so always one byte
3048
+ state.end++ // max flag is 32 so always one byte
3049
3049
 
3050
3050
  if (version >= 11 && m.scopes) encoding82_4.preencode(state, m.scopes)
3051
3051
  if (version >= 11 && m.extraAuthParams) encoding82_5.preencode(state, m.extraAuthParams)
3052
3052
  if (version >= 11 && m.registrationEndpoint) c.string.preencode(state, m.registrationEndpoint)
3053
3053
  if (version >= 11 && m.port) c.uint.preencode(state, m.port)
3054
+ if (version >= 13 && m.verify) encoding82_9.preencode(state, m.verify)
3054
3055
  },
3055
3056
  encode(state, m) {
3056
3057
  const flags =
@@ -3058,7 +3059,8 @@ const encoding82 = {
3058
3059
  ((version >= 11 && m.extraAuthParams) ? 2 : 0) |
3059
3060
  ((version >= 11 && m.registrationEndpoint) ? 4 : 0) |
3060
3061
  ((version >= 11 && m.port) ? 8 : 0) |
3061
- ((version >= 11 && m.sharedIosSession) ? 16 : 0)
3062
+ ((version >= 11 && m.sharedIosSession) ? 16 : 0) |
3063
+ ((version >= 13 && m.verify) ? 32 : 0)
3062
3064
 
3063
3065
  c.string.encode(state, m.stateKey)
3064
3066
  c.string.encode(state, m.authUrl)
@@ -3070,6 +3072,7 @@ const encoding82 = {
3070
3072
  if (version >= 11 && m.extraAuthParams) encoding82_5.encode(state, m.extraAuthParams)
3071
3073
  if (version >= 11 && m.registrationEndpoint) c.string.encode(state, m.registrationEndpoint)
3072
3074
  if (version >= 11 && m.port) c.uint.encode(state, m.port)
3075
+ if (version >= 13 && m.verify) encoding82_9.encode(state, m.verify)
3073
3076
  },
3074
3077
  decode(state) {
3075
3078
  const r0 = c.string.decode(state)
@@ -3087,7 +3090,86 @@ const encoding82 = {
3087
3090
  extraAuthParams: (version >= 11 && (flags & 2) !== 0) ? encoding82_5.decode(state) : null,
3088
3091
  registrationEndpoint: (version >= 11 && (flags & 4) !== 0) ? c.string.decode(state) : null,
3089
3092
  port: (version >= 11 && (flags & 8) !== 0) ? c.uint.decode(state) : 0,
3090
- sharedIosSession: (version >= 11 && (flags & 16) !== 0)
3093
+ sharedIosSession: (version >= 11 && (flags & 16) !== 0),
3094
+ verify: (version >= 13 && (flags & 32) !== 0) ? encoding82_9.decode(state) : null
3095
+ }
3096
+ }
3097
+ }
3098
+
3099
+ // @harness/skill-oauth-verify-rule.status
3100
+ const encoding83_1 = c.array(c.uint)
3101
+
3102
+ // @harness/skill-oauth-verify-rule
3103
+ const encoding83 = {
3104
+ preencode(state, m) {
3105
+ c.string.preencode(state, m.error)
3106
+ state.end++ // max flag is 4 so always one byte
3107
+
3108
+ if (version >= 13 && m.status) encoding83_1.preencode(state, m.status)
3109
+ if (version >= 13 && m.field) c.string.preencode(state, m.field)
3110
+ if (version >= 13 && m.notEqual) c.string.preencode(state, m.notEqual)
3111
+ },
3112
+ encode(state, m) {
3113
+ const flags =
3114
+ ((version >= 13 && m.status) ? 1 : 0) |
3115
+ ((version >= 13 && m.field) ? 2 : 0) |
3116
+ ((version >= 13 && m.notEqual) ? 4 : 0)
3117
+
3118
+ c.string.encode(state, m.error)
3119
+ c.uint.encode(state, flags)
3120
+
3121
+ if (version >= 13 && m.status) encoding83_1.encode(state, m.status)
3122
+ if (version >= 13 && m.field) c.string.encode(state, m.field)
3123
+ if (version >= 13 && m.notEqual) c.string.encode(state, m.notEqual)
3124
+ },
3125
+ decode(state) {
3126
+ const r0 = c.string.decode(state)
3127
+ const flags = c.uint.decode(state)
3128
+
3129
+ return {
3130
+ error: r0,
3131
+ status: (version >= 13 && (flags & 1) !== 0) ? encoding83_1.decode(state) : null,
3132
+ field: (version >= 13 && (flags & 2) !== 0) ? c.string.decode(state) : null,
3133
+ notEqual: (version >= 13 && (flags & 4) !== 0) ? c.string.decode(state) : null
3134
+ }
3135
+ }
3136
+ }
3137
+
3138
+ // @harness/skill-oauth-verify.reject
3139
+ const encoding84_3 = c.array(c.frame(encoding83))
3140
+
3141
+ // @harness/skill-oauth-verify
3142
+ const encoding84 = {
3143
+ preencode(state, m) {
3144
+ c.string.preencode(state, m.url)
3145
+ state.end++ // max flag is 4 so always one byte
3146
+
3147
+ if (version >= 13 && m.method) c.string.preencode(state, m.method)
3148
+ if (version >= 13 && m.body) c.string.preencode(state, m.body)
3149
+ if (version >= 13 && m.reject) encoding84_3.preencode(state, m.reject)
3150
+ },
3151
+ encode(state, m) {
3152
+ const flags =
3153
+ ((version >= 13 && m.method) ? 1 : 0) |
3154
+ ((version >= 13 && m.body) ? 2 : 0) |
3155
+ ((version >= 13 && m.reject) ? 4 : 0)
3156
+
3157
+ c.string.encode(state, m.url)
3158
+ c.uint.encode(state, flags)
3159
+
3160
+ if (version >= 13 && m.method) c.string.encode(state, m.method)
3161
+ if (version >= 13 && m.body) c.string.encode(state, m.body)
3162
+ if (version >= 13 && m.reject) encoding84_3.encode(state, m.reject)
3163
+ },
3164
+ decode(state) {
3165
+ const r0 = c.string.decode(state)
3166
+ const flags = c.uint.decode(state)
3167
+
3168
+ return {
3169
+ url: r0,
3170
+ method: (version >= 13 && (flags & 1) !== 0) ? c.string.decode(state) : null,
3171
+ body: (version >= 13 && (flags & 2) !== 0) ? c.string.decode(state) : null,
3172
+ reject: (version >= 13 && (flags & 4) !== 0) ? encoding84_3.decode(state) : null
3091
3173
  }
3092
3174
  }
3093
3175
  }
@@ -3100,6 +3182,8 @@ const encoding28_14 = c.frame(encoding51)
3100
3182
  const encoding42_2 = c.frame(encoding57)
3101
3183
  // @harness/skill-setup-route-v2.oauth, deferred due to recusive use
3102
3184
  const encoding50_10 = c.frame(encoding82)
3185
+ // @harness/skill-oauth-config.verify, deferred due to recusive use
3186
+ const encoding82_9 = c.frame(encoding84)
3103
3187
 
3104
3188
  function setVersion(v) {
3105
3189
  version = v
@@ -3318,6 +3402,10 @@ function getEncoding(name) {
3318
3402
  return encoding81
3319
3403
  case '@harness/skill-oauth-config':
3320
3404
  return encoding82
3405
+ case '@harness/skill-oauth-verify-rule':
3406
+ return encoding83
3407
+ case '@harness/skill-oauth-verify':
3408
+ return encoding84
3321
3409
  default:
3322
3410
  throw new Error('Encoder not found ' + name)
3323
3411
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 12,
2
+ "version": 13,
3
3
  "schema": [
4
4
  {
5
5
  "name": "empty",
@@ -2486,6 +2486,71 @@
2486
2486
  "name": "sharedIosSession",
2487
2487
  "type": "bool",
2488
2488
  "version": 11
2489
+ },
2490
+ {
2491
+ "name": "verify",
2492
+ "type": "@harness/skill-oauth-verify",
2493
+ "version": 13
2494
+ }
2495
+ ]
2496
+ },
2497
+ {
2498
+ "name": "skill-oauth-verify-rule",
2499
+ "namespace": "harness",
2500
+ "compact": false,
2501
+ "flagsPosition": 1,
2502
+ "fields": [
2503
+ {
2504
+ "name": "error",
2505
+ "required": true,
2506
+ "type": "string",
2507
+ "version": 13
2508
+ },
2509
+ {
2510
+ "name": "status",
2511
+ "array": true,
2512
+ "type": "uint",
2513
+ "version": 13
2514
+ },
2515
+ {
2516
+ "name": "field",
2517
+ "type": "string",
2518
+ "version": 13
2519
+ },
2520
+ {
2521
+ "name": "notEqual",
2522
+ "type": "string",
2523
+ "version": 13
2524
+ }
2525
+ ]
2526
+ },
2527
+ {
2528
+ "name": "skill-oauth-verify",
2529
+ "namespace": "harness",
2530
+ "compact": false,
2531
+ "flagsPosition": 1,
2532
+ "fields": [
2533
+ {
2534
+ "name": "url",
2535
+ "required": true,
2536
+ "type": "string",
2537
+ "version": 13
2538
+ },
2539
+ {
2540
+ "name": "method",
2541
+ "type": "string",
2542
+ "version": 13
2543
+ },
2544
+ {
2545
+ "name": "body",
2546
+ "type": "string",
2547
+ "version": 13
2548
+ },
2549
+ {
2550
+ "name": "reject",
2551
+ "array": true,
2552
+ "type": "@harness/skill-oauth-verify-rule",
2553
+ "version": 13
2489
2554
  }
2490
2555
  ]
2491
2556
  }
@@ -1,5 +1,5 @@
1
1
  // This file is autogenerated by hyperschema-ts
2
- // Schema version: 12
2
+ // Schema version: 13
3
3
  // Do not edit manually.
4
4
 
5
5
  export interface HarnessEmpty {
@@ -514,6 +514,21 @@ export interface HarnessSkillOauthConfig {
514
514
  registrationEndpoint?: string | null
515
515
  port?: number
516
516
  sharedIosSession?: boolean
517
+ verify?: HarnessSkillOauthVerify | null
518
+ }
519
+
520
+ export interface HarnessSkillOauthVerifyRule {
521
+ error: string
522
+ status?: number[] | null
523
+ field?: string | null
524
+ notEqual?: string | null
525
+ }
526
+
527
+ export interface HarnessSkillOauthVerify {
528
+ url: string
529
+ method?: string | null
530
+ body?: string | null
531
+ reject?: HarnessSkillOauthVerifyRule[] | null
517
532
  }
518
533
 
519
534
  export interface SchemaTypes {
@@ -600,4 +615,6 @@ export interface SchemaTypes {
600
615
  "@harness/detect-language-response": HarnessDetectLanguageResponse
601
616
  "@harness/skill-oauth-param": HarnessSkillOauthParam
602
617
  "@harness/skill-oauth-config": HarnessSkillOauthConfig
618
+ "@harness/skill-oauth-verify-rule": HarnessSkillOauthVerifyRule
619
+ "@harness/skill-oauth-verify": HarnessSkillOauthVerify
603
620
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qvac/harness",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "type": "module",
5
5
  "description": "An AI harness implementing generate(context) via @qvac/sdk. Knows nothing about workbench, hyperdb, or chunks — just inference in, events out.",
6
6
  "exports": {
@@ -212,6 +212,18 @@
212
212
  "types": "./dist-lib/lib/tools/exec/adapters/python/create-effect.d.ts",
213
213
  "default": "./dist-lib/lib/tools/exec/adapters/python/create-effect.js"
214
214
  },
215
+ "./lib/tools/exec/adapters/python/distributions.ts": {
216
+ "types": "./dist-lib/lib/tools/exec/adapters/python/distributions.d.ts",
217
+ "default": "./dist-lib/lib/tools/exec/adapters/python/distributions.js"
218
+ },
219
+ "./lib/tools/exec/adapters/python/guarded-fetch.ts": {
220
+ "types": "./dist-lib/lib/tools/exec/adapters/python/guarded-fetch.d.ts",
221
+ "default": "./dist-lib/lib/tools/exec/adapters/python/guarded-fetch.js"
222
+ },
223
+ "./lib/tools/exec/adapters/python/interrupt-timer.ts": {
224
+ "types": "./dist-lib/lib/tools/exec/adapters/python/interrupt-timer.d.ts",
225
+ "default": "./dist-lib/lib/tools/exec/adapters/python/interrupt-timer.js"
226
+ },
215
227
  "./lib/tools/exec/adapters/python/loader.ts": {
216
228
  "types": "./dist-lib/lib/tools/exec/adapters/python/loader.d.ts",
217
229
  "default": "./dist-lib/lib/tools/exec/adapters/python/loader.js"
@@ -220,6 +232,18 @@
220
232
  "types": "./dist-lib/lib/tools/exec/adapters/python/memfs.d.ts",
221
233
  "default": "./dist-lib/lib/tools/exec/adapters/python/memfs.js"
222
234
  },
235
+ "./lib/tools/exec/adapters/python/module-distributions.ts": {
236
+ "types": "./dist-lib/lib/tools/exec/adapters/python/module-distributions.d.ts",
237
+ "default": "./dist-lib/lib/tools/exec/adapters/python/module-distributions.js"
238
+ },
239
+ "./lib/tools/exec/adapters/python/named-hosts.ts": {
240
+ "types": "./dist-lib/lib/tools/exec/adapters/python/named-hosts.d.ts",
241
+ "default": "./dist-lib/lib/tools/exec/adapters/python/named-hosts.js"
242
+ },
243
+ "./lib/tools/exec/adapters/python/net-shim.ts": {
244
+ "types": "./dist-lib/lib/tools/exec/adapters/python/net-shim.d.ts",
245
+ "default": "./dist-lib/lib/tools/exec/adapters/python/net-shim.js"
246
+ },
223
247
  "./lib/tools/exec/adapters/python/output-policy.ts": {
224
248
  "types": "./dist-lib/lib/tools/exec/adapters/python/output-policy.d.ts",
225
249
  "default": "./dist-lib/lib/tools/exec/adapters/python/output-policy.js"
@@ -328,6 +352,14 @@
328
352
  "types": "./dist-lib/lib/tools/exec/shell-argv.d.ts",
329
353
  "default": "./dist-lib/lib/tools/exec/shell-argv.js"
330
354
  },
355
+ "./lib/tools/exec/shell-guidance.ts": {
356
+ "types": "./dist-lib/lib/tools/exec/shell-guidance.d.ts",
357
+ "default": "./dist-lib/lib/tools/exec/shell-guidance.js"
358
+ },
359
+ "./lib/tools/exec/video-tools.ts": {
360
+ "types": "./dist-lib/lib/tools/exec/video-tools.d.ts",
361
+ "default": "./dist-lib/lib/tools/exec/video-tools.js"
362
+ },
331
363
  "./lib/tools/file-glob.ts": {
332
364
  "types": "./dist-lib/lib/tools/file-glob.d.ts",
333
365
  "default": "./dist-lib/lib/tools/file-glob.js"
@@ -412,6 +444,10 @@
412
444
  "types": "./dist-lib/lib/tools/operations/compile.d.ts",
413
445
  "default": "./dist-lib/lib/tools/operations/compile.js"
414
446
  },
447
+ "./lib/tools/operations/decoders.ts": {
448
+ "types": "./dist-lib/lib/tools/operations/decoders.d.ts",
449
+ "default": "./dist-lib/lib/tools/operations/decoders.js"
450
+ },
415
451
  "./lib/tools/operations/gmail-message.ts": {
416
452
  "types": "./dist-lib/lib/tools/operations/gmail-message.d.ts",
417
453
  "default": "./dist-lib/lib/tools/operations/gmail-message.js"
@@ -661,7 +697,7 @@
661
697
  "@qvac/inference": "0.19.0",
662
698
  "@qvac/langdetect-text": "0.1.2",
663
699
  "@qvac/sdk": "0.19.0",
664
- "@qvac/skills": "^0.1.6",
700
+ "@qvac/skills": "0.1.7",
665
701
  "asenion": "^0.1.0",
666
702
  "b4a": "^1.8.1",
667
703
  "bare-abort-controller": "^1.1.2",
@@ -720,7 +756,9 @@
720
756
  "corestore": "^7.11.0",
721
757
  "holepunch-types": "^0.2.1",
722
758
  "hyperdrive": "^13.3.3",
759
+ "jsdom": "~30.0.1",
723
760
  "lunte": "^1.8.3",
761
+ "mermaid": "~11.16.1",
724
762
  "prettier": "^3.6.2",
725
763
  "prettier-config-holepunch": "^2.0.0",
726
764
  "prettytap": "^0.2.0",
@@ -3,6 +3,9 @@
3
3
  "packages": {
4
4
  "fpdf2": {
5
5
  "version": "2.8.8",
6
+ "imports": [
7
+ "fpdf"
8
+ ],
6
9
  "pypi": [
7
10
  "defusedxml-0.7.1-py2.py3-none-any.whl",
8
11
  "fpdf2-2.8.8-py3-none-any.whl"
@@ -14,6 +17,9 @@
14
17
  },
15
18
  "pypdf": {
16
19
  "version": "6.15.0",
20
+ "imports": [
21
+ "pypdf"
22
+ ],
17
23
  "pypi": [
18
24
  "pypdf-6.15.0-py3-none-any.whl"
19
25
  ],
@@ -21,6 +27,9 @@
21
27
  },
22
28
  "openpyxl": {
23
29
  "version": "3.1.5",
30
+ "imports": [
31
+ "openpyxl"
32
+ ],
24
33
  "pypi": [
25
34
  "et_xmlfile-2.0.0-py3-none-any.whl",
26
35
  "openpyxl-3.1.5-py2.py3-none-any.whl"
@@ -29,6 +38,9 @@
29
38
  },
30
39
  "python-docx": {
31
40
  "version": "1.2.0",
41
+ "imports": [
42
+ "docx"
43
+ ],
32
44
  "pypi": [
33
45
  "python_docx-1.2.0-py3-none-any.whl"
34
46
  ],
@@ -39,6 +51,9 @@
39
51
  },
40
52
  "python-pptx": {
41
53
  "version": "1.0.2",
54
+ "imports": [
55
+ "pptx"
56
+ ],
42
57
  "pypi": [
43
58
  "xlsxwriter-3.2.9-py3-none-any.whl",
44
59
  "python_pptx-1.0.2-py3-none-any.whl"