@qvac/harness 1.0.0-rc.11 → 1.0.0-rc.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +3 -1
  3. package/dist-lib/index.js +1 -2
  4. package/dist-lib/lib/agent/follow.js +9 -2
  5. package/dist-lib/lib/capabilities/completion-engine/actors/executing.js +13 -3
  6. package/dist-lib/lib/capabilities/completion-engine/actors/preparing.js +11 -6
  7. package/dist-lib/lib/capabilities/completion-engine/actors/retrieving.d.ts +2 -1
  8. package/dist-lib/lib/capabilities/completion-engine/actors/retrieving.js +19 -11
  9. package/dist-lib/lib/capabilities/completion-engine/actors/stream.d.ts +3 -2
  10. package/dist-lib/lib/capabilities/completion-engine/actors/stream.js +21 -3
  11. package/dist-lib/lib/capabilities/completion-engine/actors/streaming.js +11 -2
  12. package/dist-lib/lib/capabilities/completion-engine/actors/wrap-up.js +4 -0
  13. package/dist-lib/lib/capabilities/completion-engine/driver.js +2 -1
  14. package/dist-lib/lib/capabilities/completion-engine/engine.js +39 -23
  15. package/dist-lib/lib/capabilities/completion-engine/event-mailbox.d.ts +20 -0
  16. package/dist-lib/lib/capabilities/completion-engine/event-mailbox.js +110 -0
  17. package/dist-lib/lib/capabilities/completion-engine/loop.d.ts +1 -0
  18. package/dist-lib/lib/capabilities/completion-engine/model-round.d.ts +4 -1
  19. package/dist-lib/lib/capabilities/completion-engine/model-round.js +2 -0
  20. package/dist-lib/lib/capabilities/completion-engine/round.d.ts +11 -0
  21. package/dist-lib/lib/capabilities/completion-engine/round.js +41 -22
  22. package/dist-lib/lib/capabilities/completion-engine/turns.d.ts +3 -0
  23. package/dist-lib/lib/capabilities/completion-engine/turns.js +16 -0
  24. package/dist-lib/lib/capabilities/tool-failed-note.d.ts +1 -0
  25. package/dist-lib/lib/capabilities/tool-failed-note.js +1 -0
  26. package/dist-lib/lib/capabilities/tool-turns.d.ts +3 -1
  27. package/dist-lib/lib/capabilities/tool-turns.js +8 -1
  28. package/dist-lib/lib/connect.js +4 -2
  29. package/dist-lib/lib/contract/completion.d.ts +2 -1
  30. package/dist-lib/lib/contract/knowledge.d.ts +10 -0
  31. package/dist-lib/lib/fold/index.d.ts +3 -2
  32. package/dist-lib/lib/fold/index.js +7 -6
  33. package/dist-lib/lib/helpers/goal-check.d.ts +12 -0
  34. package/dist-lib/lib/helpers/goal-check.js +89 -7
  35. package/dist-lib/lib/helpers/html-helpers.js +9 -6
  36. package/dist-lib/lib/helpers/input-budget.d.ts +8 -0
  37. package/dist-lib/lib/helpers/input-budget.js +9 -0
  38. package/dist-lib/lib/machine/completion/actions/completion.d.ts +1 -1
  39. package/dist-lib/lib/machine/completion/actions/completion.js +34 -14
  40. package/dist-lib/lib/machine/completion/actions/tools.js +19 -1
  41. package/dist-lib/lib/machine/completion/rules.d.ts +1 -0
  42. package/dist-lib/lib/machine/completion/rules.js +14 -5
  43. package/dist-lib/lib/machine/completion/types.d.ts +3 -0
  44. package/dist-lib/lib/plugins/registry.d.ts +1 -0
  45. package/dist-lib/lib/plugins/registry.js +49 -10
  46. package/dist-lib/lib/residency/index.d.ts +1 -1
  47. package/dist-lib/lib/residency/index.js +4 -2
  48. package/dist-lib/lib/serve.js +56 -15
  49. package/dist-lib/lib/tools/files/glob.js +2 -2
  50. package/dist-lib/lib/tools/files/read-file.js +134 -15
  51. package/dist-lib/lib/tools/fs/walk.d.ts +1 -0
  52. package/dist-lib/lib/tools/fs/walk.js +2 -1
  53. package/dist-lib/lib/tools/http-request/truncate-response.js +11 -2
  54. package/dist-lib/lib/tools/http-request.js +28 -11
  55. package/dist-lib/lib/tools/office.d.ts +1 -1
  56. package/dist-lib/lib/tools/office.js +34 -12
  57. package/dist-lib/lib/wire.js +23 -3
  58. package/dist-lib/plugins/knowledge/index.js +1 -0
  59. package/dist-lib/plugins/knowledge/manifest.d.ts +29 -0
  60. package/dist-lib/plugins/knowledge/manifest.js +41 -0
  61. package/dist-lib/plugins/knowledge/search-tool.js +8 -8
  62. package/dist-lib/plugins/knowledge/store.d.ts +35 -7
  63. package/dist-lib/plugins/knowledge/store.js +335 -143
  64. package/dist-lib/plugins/mcp/call.js +10 -3
  65. package/dist-lib/plugins/mcp/protocol.d.ts +4 -1
  66. package/dist-lib/plugins/mcp/protocol.js +11 -10
  67. package/dist-lib/plugins/mcp/tool-listing.d.ts +6 -0
  68. package/dist-lib/plugins/mcp/tool-listing.js +97 -0
  69. package/dist-lib/plugins/music/generate-music.js +2 -2
  70. package/dist-lib/plugins/python/language.js +2 -2
  71. package/dist-lib/plugins/run-report/story.js +4 -1
  72. package/dist-lib/plugins/sandbox-windows/prebuilds/win32-arm64/qvac-sandbox.exe +0 -0
  73. package/dist-lib/plugins/sandbox-windows/prebuilds/win32-x64/qvac-sandbox.exe +0 -0
  74. package/dist-lib/schema/harness.js +4 -2
  75. package/dist-lib/spec/hrpc/messages.js +19 -4
  76. package/dist-lib/spec/hyperschema/index.js +19 -4
  77. package/dist-lib/spec/hyperschema/schema.json +12 -1
  78. package/dist-lib/spec/hyperschema/types.d.ts +2 -0
  79. package/package.json +9 -1
@@ -1,5 +1,7 @@
1
1
  import type { AbortSignal as BareAbortSignal } from 'bare-abort-controller';
2
2
  import type { ToolExecuteContext, ToolFetch } from '../../lib/contract/index.ts';
3
+ import { type ToolListing } from './tool-listing.ts';
4
+ import { type ResponseCoverage } from '../../lib/tools/http-request/truncate-response.ts';
3
5
  export declare const MCP_PROTOCOL_VERSION = "2025-03-26";
4
6
  export declare const TIMEOUT_MS = 30000;
5
7
  interface McpResponseBody {
@@ -19,8 +21,9 @@ export interface McpError {
19
21
  }
20
22
  export interface McpBody {
21
23
  body: string;
24
+ truncated?: ResponseCoverage;
22
25
  }
23
- export declare function flattenMcpResponse(body: string): McpError | McpBody;
26
+ export declare function flattenMcpResponse(body: string, ctx: ToolExecuteContext | undefined, listing?: ToolListing): McpError | McpBody;
24
27
  export declare function sessionKey(url: string, ctx: ToolExecuteContext | undefined, credentialKey?: string): string;
25
28
  export declare function getSession(key: string): string;
26
29
  export declare function deleteSession(key: string): void;
@@ -1,6 +1,8 @@
1
1
  import { isRecord } from '../../lib/guards.js';
2
2
  import { METADATA_METHODS } from '../../lib/helpers/mcp-methods.js';
3
3
  import { MAX_RESPONSE_CHARS } from '../../lib/tools/http-request/request.js';
4
+ import { listTools } from './tool-listing.js';
5
+ import { capResponseBody } from '../../lib/tools/http-request/truncate-response.js';
4
6
  export const MCP_PROTOCOL_VERSION = '2025-03-26';
5
7
  export const TIMEOUT_MS = 30_000;
6
8
  const PROTOCOL_METHODS = new Set([...METADATA_METHODS, 'tools/call']);
@@ -60,12 +62,7 @@ function decodePayload(body, contentType) {
60
62
  }
61
63
  }
62
64
  }
63
- try {
64
- return JSON.stringify(JSON.parse(payload), null, 2);
65
- }
66
- catch {
67
- return payload;
68
- }
65
+ return payload;
69
66
  }
70
67
  function asRecord(value) {
71
68
  return isRecord(value) && !Array.isArray(value) ? value : null;
@@ -88,28 +85,32 @@ function rpcErrorText(error) {
88
85
  }
89
86
  return `${message} ${JSON.stringify(error.data)}`.trim();
90
87
  }
91
- export function flattenMcpResponse(body) {
88
+ export function flattenMcpResponse(body, ctx, listing) {
92
89
  let parsed;
93
90
  try {
94
91
  parsed = JSON.parse(body);
95
92
  }
96
93
  catch {
97
- return { body: truncate(body) };
94
+ return capResponseBody(body, ctx);
98
95
  }
99
96
  const record = asRecord(parsed);
100
97
  if (!record) {
101
- return { body: truncate(body) };
98
+ return capResponseBody(body, ctx);
102
99
  }
103
100
  const rpcError = asRecord(record.error);
104
101
  if (rpcError) {
105
102
  return { error: truncate(rpcErrorText(rpcError) || body.trim()) };
106
103
  }
107
104
  const result = asRecord(record.result);
105
+ const tools = listing && result ? listTools(result, listing.names) : null;
106
+ if (tools !== null) {
107
+ return capResponseBody(tools, ctx);
108
+ }
108
109
  const text = contentText(result)?.trim();
109
110
  if (result?.isError === true) {
110
111
  return { error: truncate(text || body.trim()) };
111
112
  }
112
- return { body: truncate(text || body) };
113
+ return capResponseBody(text || body, ctx);
113
114
  }
114
115
  function truncate(text) {
115
116
  return text.length > MAX_RESPONSE_CHARS
@@ -0,0 +1,6 @@
1
+ export interface ToolListing {
2
+ readonly names: readonly string[] | null;
3
+ readonly params: Record<string, unknown> | undefined;
4
+ }
5
+ export declare function toolListing(params: Record<string, unknown> | undefined): ToolListing;
6
+ export declare function listTools(result: Record<string, unknown>, names: readonly string[] | null): string | null;
@@ -0,0 +1,97 @@
1
+ import { isRecord } from '../../lib/guards.js';
2
+ const SUMMARY_CHARS = 160;
3
+ const ENUM_VALUES = 12;
4
+ export function toolListing(params) {
5
+ if (!params || !('names' in params)) {
6
+ return { names: null, params };
7
+ }
8
+ const { names, ...rest } = params;
9
+ const list = (Array.isArray(names) ? names : [names]).filter((name) => typeof name === 'string');
10
+ return { names: list, params: Object.keys(rest).length > 0 ? rest : undefined };
11
+ }
12
+ export function listTools(result, names) {
13
+ const tools = Array.isArray(result.tools) ? result.tools.filter(isRecord) : null;
14
+ if (!tools) {
15
+ return null;
16
+ }
17
+ const cursor = typeof result.nextCursor === 'string' ? result.nextCursor : '';
18
+ return names ? describeTools(tools, names, cursor) : summarizeTools(tools, cursor);
19
+ }
20
+ function summarizeTools(tools, nextCursor) {
21
+ const lines = [
22
+ `${tools.length} tools. Call one with its name as \`method\` and its arguments as \`params\`; \`?\` marks an optional argument. For a tool's full description and schema, call tools/list with params {"names": ["<tool>"]}.`,
23
+ ...tools.map(toolLine)
24
+ ];
25
+ if (nextCursor) {
26
+ lines.push(`More tools: call tools/list with params {"cursor": ${JSON.stringify(nextCursor)}}.`);
27
+ }
28
+ return lines.join('\n');
29
+ }
30
+ function describeTools(tools, names, nextCursor) {
31
+ const listed = tools.map((tool) => String(tool.name));
32
+ const wanted = tools.filter((tool) => names.includes(String(tool.name)));
33
+ const missing = names.filter((name) => !listed.includes(name));
34
+ const described = wanted.map(({ name, description, inputSchema }) => ({
35
+ name,
36
+ description,
37
+ inputSchema: plainSchema(inputSchema)
38
+ }));
39
+ const lines = described.length > 0 ? [JSON.stringify(described)] : [];
40
+ if (missing.length > 0) {
41
+ lines.push(nextCursor
42
+ ? `Not on this page: ${missing.join(', ')}. Call tools/list with params ${JSON.stringify({ names: missing, cursor: nextCursor })}.`
43
+ : `No tool named ${missing.join(', ')}. The server lists: ${listed.join(', ')}.`);
44
+ }
45
+ return lines.join('\n');
46
+ }
47
+ function plainSchema(schema) {
48
+ if (!isRecord(schema)) {
49
+ return schema;
50
+ }
51
+ const { $schema, ...rest } = schema;
52
+ return rest;
53
+ }
54
+ function toolLine(tool) {
55
+ const schema = isRecord(tool.inputSchema) ? tool.inputSchema : {};
56
+ const required = new Set(Array.isArray(schema.required) ? schema.required : []);
57
+ const properties = isRecord(schema.properties) ? schema.properties : {};
58
+ const args = Object.entries(properties).map(([name, property]) => `${name}${required.has(name) ? '' : '?'}: ${typeOf(property)}`);
59
+ const about = summary(tool.description);
60
+ return `- ${String(tool.name)}(${args.join(', ')})${about ? `: ${about}` : ''}`;
61
+ }
62
+ function typeOf(property) {
63
+ if (!isRecord(property)) {
64
+ return 'any';
65
+ }
66
+ if (Array.isArray(property.enum)) {
67
+ const values = property.enum.slice(0, ENUM_VALUES).map((value) => JSON.stringify(value));
68
+ return [...values, ...(property.enum.length > ENUM_VALUES ? ['…'] : [])].join('|');
69
+ }
70
+ if (property.type === 'array') {
71
+ return `${typeOf(property.items)}[]`;
72
+ }
73
+ if (typeof property.type === 'string') {
74
+ return property.type;
75
+ }
76
+ if (Array.isArray(property.type)) {
77
+ return property.type.join('|');
78
+ }
79
+ const union = property.anyOf ?? property.oneOf;
80
+ return Array.isArray(union) ? union.map(typeOf).join('|') : 'any';
81
+ }
82
+ function summary(description) {
83
+ const text = typeof description === 'string' ? description.replace(/\s+/g, ' ').trim() : '';
84
+ if (!text) {
85
+ return '';
86
+ }
87
+ const sentences = text.split(/(?<=[.!?])\s+/);
88
+ let kept = '';
89
+ for (const sentence of sentences) {
90
+ const next = `${kept} ${sentence.trim()}`.trim();
91
+ if (next.length > SUMMARY_CHARS) {
92
+ break;
93
+ }
94
+ kept = next;
95
+ }
96
+ return kept || `${text.slice(0, SUMMARY_CHARS - 1)}…`;
97
+ }
@@ -366,9 +366,9 @@ function fileNameBase(value) {
366
366
  ?.toLowerCase()
367
367
  .replace(/\.wav$/i, '')
368
368
  .replace(/[^\p{L}\p{N}]+/gu, '-')
369
- .replace(/^-+|-+$/g, '')
369
+ .replace(/^-|-$/g, '')
370
370
  .slice(0, MAX_TITLE_CHARS)
371
- .replace(/-+$/, '');
371
+ .replace(/-$/, '');
372
372
  return stem || undefined;
373
373
  }
374
374
  function musicMeta(value) {
@@ -76,7 +76,7 @@ const TEXT = {
76
76
  }
77
77
  };
78
78
  function isPresent(value) {
79
- return value !== undefined && value !== null;
79
+ return value !== undefined && value !== null && !(Array.isArray(value) && value.length === 0);
80
80
  }
81
81
  function stringList(value) {
82
82
  if (!Array.isArray(value))
@@ -368,7 +368,7 @@ export function createPythonLanguage({ loadPyodide, network = pythonReachesNetwo
368
368
  if (packages && 'error' in packages) {
369
369
  return packages.error;
370
370
  }
371
- if (packages) {
371
+ if (packages?.length) {
372
372
  return PACKAGES_NEED_PYTHON_ERROR;
373
373
  }
374
374
  return isPresent(args.inputs) || isPresent(args.outputs) ? FILES_NEED_PYTHON_ERROR : null;
@@ -1,4 +1,5 @@
1
1
  import { isRecord } from '../../lib/guards.js';
2
+ import { TOOL_FAILED_NOTE } from '../../lib/capabilities/tool-failed-note.js';
2
3
  const TOOL_RESULT = /^\[Tool: (.+?) \((.+?)\)\]\n?/;
3
4
  export function story(input) {
4
5
  const teller = new Teller(input);
@@ -173,8 +174,10 @@ function request(content) {
173
174
  return text.replace(/^\[Current local time:[^\]]*\]\s*/, '').trim();
174
175
  }
175
176
  function parse(text) {
177
+ const note = `\n${TOOL_FAILED_NOTE}`;
178
+ const payload = text.endsWith(note) ? text.slice(0, -note.length) : text;
176
179
  try {
177
- return JSON.parse(text);
180
+ return JSON.parse(payload);
178
181
  }
179
182
  catch {
180
183
  return text;
@@ -881,7 +881,8 @@ export function registerHarnessTypes(ns) {
881
881
  fields: [
882
882
  { name: 'text', type: 'string', required: true },
883
883
  { name: 'scopes', type: 'string', array: true, required: true },
884
- { name: 'k', type: 'uint' }
884
+ { name: 'k', type: 'uint' },
885
+ { name: 'focus', type: 'string', array: true }
885
886
  ]
886
887
  });
887
888
  ns.register({
@@ -919,7 +920,8 @@ export function registerHarnessTypes(ns) {
919
920
  type: '@harness/knowledge-artifact-status',
920
921
  array: true,
921
922
  required: true
922
- }
923
+ },
924
+ { name: 'pending', type: 'uint' }
923
925
  ]
924
926
  });
925
927
  }
@@ -4049,24 +4049,28 @@ const encoding103 = {
4049
4049
 
4050
4050
  // @harness/knowledge-search-request.scopes
4051
4051
  const encoding104_1 = encoding4_4
4052
+ // @harness/knowledge-search-request.focus
4053
+ const encoding104_3 = encoding4_4
4052
4054
 
4053
4055
  // @harness/knowledge-search-request
4054
4056
  const encoding104 = {
4055
4057
  preencode(state, m) {
4056
4058
  c.string.preencode(state, m.text)
4057
4059
  encoding104_1.preencode(state, m.scopes)
4058
- state.end++ // max flag is 1 so always one byte
4060
+ state.end++ // max flag is 2 so always one byte
4059
4061
 
4060
4062
  if (version >= 23 && m.k) c.uint.preencode(state, m.k)
4063
+ if (version >= 23 && m.focus) encoding104_3.preencode(state, m.focus)
4061
4064
  },
4062
4065
  encode(state, m) {
4063
- const flags = (version >= 23 && m.k) ? 1 : 0
4066
+ const flags = ((version >= 23 && m.k) ? 1 : 0) | ((version >= 23 && m.focus) ? 2 : 0)
4064
4067
 
4065
4068
  c.string.encode(state, m.text)
4066
4069
  encoding104_1.encode(state, m.scopes)
4067
4070
  c.uint.encode(state, flags)
4068
4071
 
4069
4072
  if (version >= 23 && m.k) c.uint.encode(state, m.k)
4073
+ if (version >= 23 && m.focus) encoding104_3.encode(state, m.focus)
4070
4074
  },
4071
4075
  decode(state) {
4072
4076
  const r0 = c.string.decode(state)
@@ -4076,7 +4080,8 @@ const encoding104 = {
4076
4080
  return {
4077
4081
  text: r0,
4078
4082
  scopes: r1,
4079
- k: (version >= 23 && (flags & 1) !== 0) ? c.uint.decode(state) : 0
4083
+ k: (version >= 23 && (flags & 1) !== 0) ? c.uint.decode(state) : 0,
4084
+ focus: (version >= 23 && (flags & 2) !== 0) ? encoding104_3.decode(state) : null
4080
4085
  }
4081
4086
  }
4082
4087
  }
@@ -4187,24 +4192,34 @@ const encoding108 = {
4187
4192
  c.uint.preencode(state, m.dimensions)
4188
4193
  c.uint.preencode(state, m.chunks)
4189
4194
  encoding108_3.preencode(state, m.artifacts)
4195
+ state.end++ // max flag is 1 so always one byte
4196
+
4197
+ if (version >= 23 && m.pending) c.uint.preencode(state, m.pending)
4190
4198
  },
4191
4199
  encode(state, m) {
4200
+ const flags = (version >= 23 && m.pending) ? 1 : 0
4201
+
4192
4202
  c.string.encode(state, m.model)
4193
4203
  c.uint.encode(state, m.dimensions)
4194
4204
  c.uint.encode(state, m.chunks)
4195
4205
  encoding108_3.encode(state, m.artifacts)
4206
+ c.uint.encode(state, flags)
4207
+
4208
+ if (version >= 23 && m.pending) c.uint.encode(state, m.pending)
4196
4209
  },
4197
4210
  decode(state) {
4198
4211
  const r0 = c.string.decode(state)
4199
4212
  const r1 = c.uint.decode(state)
4200
4213
  const r2 = c.uint.decode(state)
4201
4214
  const r3 = encoding108_3.decode(state)
4215
+ const flags = c.uint.decode(state)
4202
4216
 
4203
4217
  return {
4204
4218
  model: r0,
4205
4219
  dimensions: r1,
4206
4220
  chunks: r2,
4207
- artifacts: r3
4221
+ artifacts: r3,
4222
+ pending: (version >= 23 && (flags & 1) !== 0) ? c.uint.decode(state) : 0
4208
4223
  }
4209
4224
  }
4210
4225
  }
@@ -4049,24 +4049,28 @@ const encoding103 = {
4049
4049
 
4050
4050
  // @harness/knowledge-search-request.scopes
4051
4051
  const encoding104_1 = encoding4_4
4052
+ // @harness/knowledge-search-request.focus
4053
+ const encoding104_3 = encoding4_4
4052
4054
 
4053
4055
  // @harness/knowledge-search-request
4054
4056
  const encoding104 = {
4055
4057
  preencode(state, m) {
4056
4058
  c.string.preencode(state, m.text)
4057
4059
  encoding104_1.preencode(state, m.scopes)
4058
- state.end++ // max flag is 1 so always one byte
4060
+ state.end++ // max flag is 2 so always one byte
4059
4061
 
4060
4062
  if (version >= 23 && m.k) c.uint.preencode(state, m.k)
4063
+ if (version >= 23 && m.focus) encoding104_3.preencode(state, m.focus)
4061
4064
  },
4062
4065
  encode(state, m) {
4063
- const flags = (version >= 23 && m.k) ? 1 : 0
4066
+ const flags = ((version >= 23 && m.k) ? 1 : 0) | ((version >= 23 && m.focus) ? 2 : 0)
4064
4067
 
4065
4068
  c.string.encode(state, m.text)
4066
4069
  encoding104_1.encode(state, m.scopes)
4067
4070
  c.uint.encode(state, flags)
4068
4071
 
4069
4072
  if (version >= 23 && m.k) c.uint.encode(state, m.k)
4073
+ if (version >= 23 && m.focus) encoding104_3.encode(state, m.focus)
4070
4074
  },
4071
4075
  decode(state) {
4072
4076
  const r0 = c.string.decode(state)
@@ -4076,7 +4080,8 @@ const encoding104 = {
4076
4080
  return {
4077
4081
  text: r0,
4078
4082
  scopes: r1,
4079
- k: (version >= 23 && (flags & 1) !== 0) ? c.uint.decode(state) : 0
4083
+ k: (version >= 23 && (flags & 1) !== 0) ? c.uint.decode(state) : 0,
4084
+ focus: (version >= 23 && (flags & 2) !== 0) ? encoding104_3.decode(state) : null
4080
4085
  }
4081
4086
  }
4082
4087
  }
@@ -4187,24 +4192,34 @@ const encoding108 = {
4187
4192
  c.uint.preencode(state, m.dimensions)
4188
4193
  c.uint.preencode(state, m.chunks)
4189
4194
  encoding108_3.preencode(state, m.artifacts)
4195
+ state.end++ // max flag is 1 so always one byte
4196
+
4197
+ if (version >= 23 && m.pending) c.uint.preencode(state, m.pending)
4190
4198
  },
4191
4199
  encode(state, m) {
4200
+ const flags = (version >= 23 && m.pending) ? 1 : 0
4201
+
4192
4202
  c.string.encode(state, m.model)
4193
4203
  c.uint.encode(state, m.dimensions)
4194
4204
  c.uint.encode(state, m.chunks)
4195
4205
  encoding108_3.encode(state, m.artifacts)
4206
+ c.uint.encode(state, flags)
4207
+
4208
+ if (version >= 23 && m.pending) c.uint.encode(state, m.pending)
4196
4209
  },
4197
4210
  decode(state) {
4198
4211
  const r0 = c.string.decode(state)
4199
4212
  const r1 = c.uint.decode(state)
4200
4213
  const r2 = c.uint.decode(state)
4201
4214
  const r3 = encoding108_3.decode(state)
4215
+ const flags = c.uint.decode(state)
4202
4216
 
4203
4217
  return {
4204
4218
  model: r0,
4205
4219
  dimensions: r1,
4206
4220
  chunks: r2,
4207
- artifacts: r3
4221
+ artifacts: r3,
4222
+ pending: (version >= 23 && (flags & 1) !== 0) ? c.uint.decode(state) : 0
4208
4223
  }
4209
4224
  }
4210
4225
  }
@@ -3302,6 +3302,12 @@
3302
3302
  "name": "k",
3303
3303
  "type": "uint",
3304
3304
  "version": 23
3305
+ },
3306
+ {
3307
+ "name": "focus",
3308
+ "array": true,
3309
+ "type": "string",
3310
+ "version": 23
3305
3311
  }
3306
3312
  ]
3307
3313
  },
@@ -3398,7 +3404,7 @@
3398
3404
  "name": "knowledge-status-response",
3399
3405
  "namespace": "harness",
3400
3406
  "compact": false,
3401
- "flagsPosition": -1,
3407
+ "flagsPosition": 4,
3402
3408
  "fields": [
3403
3409
  {
3404
3410
  "name": "model",
@@ -3424,6 +3430,11 @@
3424
3430
  "array": true,
3425
3431
  "type": "@harness/knowledge-artifact-status",
3426
3432
  "version": 23
3433
+ },
3434
+ {
3435
+ "name": "pending",
3436
+ "type": "uint",
3437
+ "version": 23
3427
3438
  }
3428
3439
  ]
3429
3440
  }
@@ -677,6 +677,7 @@ export interface HarnessKnowledgeSearchRequest {
677
677
  text: string
678
678
  scopes: string[]
679
679
  k?: number
680
+ focus?: string[] | null
680
681
  }
681
682
 
682
683
  export interface HarnessKnowledgeHit {
@@ -704,6 +705,7 @@ export interface HarnessKnowledgeStatusResponse {
704
705
  dimensions: number
705
706
  chunks: number
706
707
  artifacts: HarnessKnowledgeArtifactStatus[]
708
+ pending?: number
707
709
  }
708
710
 
709
711
  export interface SchemaTypes {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qvac/harness",
3
- "version": "1.0.0-rc.11",
3
+ "version": "1.0.0-rc.13",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "bare": ">=1.34.0",
@@ -184,6 +184,10 @@
184
184
  "types": "./dist-lib/lib/tools/http-request/request.d.ts",
185
185
  "default": "./dist-lib/lib/tools/http-request/request.js"
186
186
  },
187
+ "./lib/tools/http-request/truncate-response.ts": {
188
+ "types": "./dist-lib/lib/tools/http-request/truncate-response.d.ts",
189
+ "default": "./dist-lib/lib/tools/http-request/truncate-response.js"
190
+ },
187
191
  "./lib/tools/skills/mention.ts": {
188
192
  "types": "./dist-lib/lib/tools/skills/mention.d.ts",
189
193
  "default": "./dist-lib/lib/tools/skills/mention.js"
@@ -252,6 +256,10 @@
252
256
  "types": "./dist-lib/lib/tools/fs/write.d.ts",
253
257
  "default": "./dist-lib/lib/tools/fs/write.js"
254
258
  },
259
+ "./lib/capabilities/tool-failed-note.ts": {
260
+ "types": "./dist-lib/lib/capabilities/tool-failed-note.d.ts",
261
+ "default": "./dist-lib/lib/capabilities/tool-failed-note.js"
262
+ },
255
263
  "./lib/capabilities/tool-turns.ts": {
256
264
  "types": "./dist-lib/lib/capabilities/tool-turns.d.ts",
257
265
  "default": "./dist-lib/lib/capabilities/tool-turns.js"