@qvac/harness 1.0.0-rc.16 → 1.0.0-rc.18
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/CHANGELOG.md +139 -2
- package/dist-lib/index.d.ts +6 -2
- package/dist-lib/index.js +17 -3
- package/dist-lib/lib/capabilities/completion-engine/actors/executing.d.ts +2 -1
- package/dist-lib/lib/capabilities/completion-engine/actors/executing.js +28 -3
- package/dist-lib/lib/capabilities/completion-engine/actors/execution-plan.js +1 -0
- package/dist-lib/lib/capabilities/completion-engine/actors/inspecting.d.ts +1 -1
- package/dist-lib/lib/capabilities/completion-engine/actors/inspecting.js +13 -8
- package/dist-lib/lib/capabilities/completion-engine/actors/preparing.js +6 -3
- package/dist-lib/lib/capabilities/completion-engine/actors/run-prepare.js +1 -1
- package/dist-lib/lib/capabilities/completion-engine/actors/skill-step.js +2 -2
- package/dist-lib/lib/capabilities/completion-engine/durable.d.ts +2 -1
- package/dist-lib/lib/capabilities/completion-engine/durable.js +7 -1
- package/dist-lib/lib/capabilities/completion-engine/loop.d.ts +2 -1
- package/dist-lib/lib/capabilities/completion-engine/operations.js +28 -9
- package/dist-lib/lib/capabilities/completion-engine/ports.js +3 -2
- package/dist-lib/lib/capabilities/completion-engine/prepare-step.d.ts +3 -1
- package/dist-lib/lib/capabilities/completion-engine/session.d.ts +1 -0
- package/dist-lib/lib/capabilities/completion-engine/session.js +1 -0
- package/dist-lib/lib/capabilities/completion-engine/tool-execution.js +2 -1
- package/dist-lib/lib/capabilities/completion-engine/turns.js +5 -2
- package/dist-lib/lib/capabilities/enhance.js +3 -3
- package/dist-lib/lib/capabilities/sdk-tool.d.ts +1 -1
- package/dist-lib/lib/capabilities/sdk-tool.js +3 -2
- package/dist-lib/lib/capabilities/skill-entry.d.ts +9 -1
- package/dist-lib/lib/capabilities/skill-entry.js +11 -7
- package/dist-lib/lib/capabilities/tool-turns.d.ts +5 -0
- package/dist-lib/lib/capabilities/tool-turns.js +24 -27
- package/dist-lib/lib/client/index.js +3 -2
- package/dist-lib/lib/connect.d.ts +2 -0
- package/dist-lib/lib/connect.js +33 -3
- package/dist-lib/lib/contract/completion.d.ts +14 -0
- package/dist-lib/lib/contract/exec.d.ts +1 -0
- package/dist-lib/lib/contract/ocr.d.ts +4 -0
- package/dist-lib/lib/contract/run.d.ts +8 -0
- package/dist-lib/lib/contract-types.d.ts +4 -1
- package/dist-lib/lib/errors.d.ts +4 -0
- package/dist-lib/lib/errors.js +5 -1
- package/dist-lib/lib/guards.d.ts +2 -0
- package/dist-lib/lib/guards.js +7 -0
- package/dist-lib/lib/hardware/capability-probe.js +10 -7
- package/dist-lib/lib/hardware/gpu-probe-addon.js +26 -11
- package/dist-lib/lib/hardware/gpu-stats.native.cjs +17 -1
- package/dist-lib/lib/helpers/completion-params.d.ts +2 -1
- package/dist-lib/lib/helpers/completion-params.js +16 -1
- package/dist-lib/lib/helpers/control-tokens.d.ts +3 -0
- package/dist-lib/lib/helpers/control-tokens.js +25 -0
- package/dist-lib/lib/machine/completion/actions/completion.js +34 -5
- package/dist-lib/lib/machine/completion/actions/tools.js +4 -1
- package/dist-lib/lib/machine/completion/rules.d.ts +2 -0
- package/dist-lib/lib/machine/completion/rules.js +7 -0
- package/dist-lib/lib/machine/completion/types.d.ts +6 -0
- package/dist-lib/lib/machine/index.d.ts +2 -1
- package/dist-lib/lib/machine/index.js +2 -1
- package/dist-lib/lib/no-redirect-fetch-impl.d.ts +1 -1
- package/dist-lib/lib/no-redirect-fetch-impl.js +13 -7
- package/dist-lib/lib/office/engine/xlsx/sheet.js +10 -4
- package/dist-lib/lib/plugins/registry.d.ts +3 -0
- package/dist-lib/lib/plugins/registry.js +15 -1
- package/dist-lib/lib/plugins/require-bare.d.ts +1 -0
- package/dist-lib/lib/plugins/require-bare.js +13 -0
- package/dist-lib/lib/run-log/request-codec.js +2 -2
- package/dist-lib/lib/serve.js +38 -1
- package/dist-lib/lib/sidecar/index.d.ts +1 -1
- package/dist-lib/lib/sidecar/index.js +5 -6
- package/dist-lib/lib/skills-host/index.js +13 -8
- package/dist-lib/lib/spawn.d.ts +2 -0
- package/dist-lib/lib/spawn.js +5 -3
- package/dist-lib/lib/tools/ask-user.d.ts +2 -0
- package/dist-lib/lib/tools/ask-user.js +137 -0
- package/dist-lib/lib/tools/attachments/delivered.d.ts +5 -0
- package/dist-lib/lib/tools/attachments/delivered.js +16 -0
- package/dist-lib/lib/tools/attachments/fetched-file.d.ts +32 -0
- package/dist-lib/lib/tools/attachments/fetched-file.js +134 -0
- package/dist-lib/lib/tools/exec.js +2 -1
- package/dist-lib/lib/tools/fs/document-text.js +3 -26
- package/dist-lib/lib/tools/http-request/request.d.ts +2 -2
- package/dist-lib/lib/tools/http-request/request.js +1 -1
- package/dist-lib/lib/tools/http-request.d.ts +1 -0
- package/dist-lib/lib/tools/http-request.js +54 -3
- package/dist-lib/lib/tools/index.d.ts +3 -1
- package/dist-lib/lib/tools/index.js +6 -2
- package/dist-lib/lib/tools/office.js +20 -12
- package/dist-lib/lib/tools/pdf/pages.d.ts +12 -0
- package/dist-lib/lib/tools/pdf/pages.js +28 -0
- package/dist-lib/lib/tools/pdf.js +24 -9
- package/dist-lib/lib/tools/skills/bundled-dir.d.ts +5 -1
- package/dist-lib/lib/tools/skills/bundled-dir.js +23 -20
- package/dist-lib/lib/tools/skills/catalog.d.ts +1 -1
- package/dist-lib/lib/tools/skills/catalog.js +1 -1
- package/dist-lib/lib/tools/skills/overlay-crud.d.ts +3 -3
- package/dist-lib/lib/tools/skills/overlay-crud.js +4 -4
- package/dist-lib/lib/tools/skills/scope-key.d.ts +1 -0
- package/dist-lib/lib/tools/skills/scope-key.js +4 -0
- package/dist-lib/lib/tools/web-fetch.js +41 -130
- package/dist-lib/plugins/knowledge/index.js +3 -3
- package/dist-lib/plugins/mcp/call.js +5 -1
- package/dist-lib/plugins/mcp/protocol.d.ts +6 -1
- package/dist-lib/plugins/mcp/protocol.js +2 -2
- package/dist-lib/plugins/ocr/reading-order.js +151 -4
- package/dist-lib/plugins/python/bare-floor.d.ts +1 -0
- package/dist-lib/plugins/python/bare-floor.js +2 -0
- package/dist-lib/plugins/python/index.d.ts +1 -0
- package/dist-lib/plugins/python/index.js +1 -0
- package/dist-lib/plugins/python/language.js +9 -8
- package/dist-lib/plugins/python/python-adapter.d.ts +4 -0
- package/dist-lib/plugins/python/python-adapter.js +26 -0
- package/dist-lib/plugins/python/worker/client.js +1 -1
- package/dist-lib/plugins/python/worker/entry.js +2 -8
- package/dist-lib/plugins/python/worker/preload.d.ts +1 -0
- package/dist-lib/plugins/python/worker/preload.js +2 -0
- package/dist-lib/plugins/python/worker/spawn.js +1 -1
- package/dist-lib/plugins/sandbox-windows/prebuilds/win32-arm64/qvac-sandbox.exe +0 -0
- package/dist-lib/plugins/sandbox-windows/prebuilds/win32-x64/qvac-sandbox.exe +0 -0
- package/dist-lib/plugins/weather/lookup.js +1 -0
- package/dist-lib/schema/harness.js +17 -0
- 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 +32 -0
- package/dist-lib/spec/hyperschema/index.js +32 -0
- package/dist-lib/spec/hyperschema/schema.json +40 -0
- package/dist-lib/spec/hyperschema/types.d.ts +12 -0
- package/package.json +18 -9
|
@@ -3,28 +3,43 @@ import { classifyGpu } from './gpu-classify.js';
|
|
|
3
3
|
import { IGPU_LIE_THRESHOLD, sharedRamBudget } from './parsers.js';
|
|
4
4
|
const GpuDeviceSchema = z.object({
|
|
5
5
|
name: z.string(),
|
|
6
|
-
videoMemoryBytes: z.number()
|
|
6
|
+
videoMemoryBytes: z.number(),
|
|
7
|
+
kind: z.enum(['integrated', 'discrete']).optional()
|
|
7
8
|
});
|
|
8
9
|
const StatsSchema = z.object({
|
|
9
10
|
memory: z.object({ totalBytes: z.number() }).optional(),
|
|
10
11
|
gpu: z.object({ devices: z.array(GpuDeviceSchema) }).optional()
|
|
11
12
|
});
|
|
13
|
+
function deviceClass(device) {
|
|
14
|
+
const byName = classifyGpu(device.name);
|
|
15
|
+
if (byName === 'software') {
|
|
16
|
+
return byName;
|
|
17
|
+
}
|
|
18
|
+
return device.kind ?? byName;
|
|
19
|
+
}
|
|
12
20
|
function classifyBestDevice(devices, systemRamBytes) {
|
|
13
21
|
for (const device of devices) {
|
|
14
|
-
|
|
15
|
-
if (cls === 'software') {
|
|
22
|
+
if (deviceClass(device) !== 'discrete') {
|
|
16
23
|
continue;
|
|
17
24
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return { ...sharedRamBudget(systemRamBytes), source: 'integrated', gpuClass: 'integrated' };
|
|
22
|
-
}
|
|
23
|
-
return { totalBytes: vram, availableBytes: vram, source: 'vram', gpuClass: 'discrete' };
|
|
25
|
+
const vram = device.videoMemoryBytes;
|
|
26
|
+
if (vram > systemRamBytes * IGPU_LIE_THRESHOLD) {
|
|
27
|
+
return { ...sharedRamBudget(systemRamBytes), source: 'integrated', gpuClass: 'integrated' };
|
|
24
28
|
}
|
|
29
|
+
return { totalBytes: vram, availableBytes: vram, source: 'vram', gpuClass: 'discrete' };
|
|
25
30
|
}
|
|
26
31
|
return null;
|
|
27
32
|
}
|
|
33
|
+
function integratedBudget(devices, totalRamBytes) {
|
|
34
|
+
const shared = sharedRamBudget(totalRamBytes);
|
|
35
|
+
const addressable = devices
|
|
36
|
+
.filter((device) => device.kind === 'integrated')
|
|
37
|
+
.map((device) => device.videoMemoryBytes);
|
|
38
|
+
const availableBytes = addressable.length > 0
|
|
39
|
+
? Math.min(shared.availableBytes, Math.max(...addressable))
|
|
40
|
+
: shared.availableBytes;
|
|
41
|
+
return { ...shared, availableBytes, source: 'integrated', gpuClass: 'integrated' };
|
|
42
|
+
}
|
|
28
43
|
export function probeWithAddon(rawStats, systemRamBytes) {
|
|
29
44
|
const parsed = StatsSchema.safeParse(rawStats);
|
|
30
45
|
if (!parsed.success) {
|
|
@@ -39,8 +54,8 @@ export function probeWithAddon(rawStats, systemRamBytes) {
|
|
|
39
54
|
if (best) {
|
|
40
55
|
return best;
|
|
41
56
|
}
|
|
42
|
-
if (devices.every((device) =>
|
|
57
|
+
if (devices.every((device) => deviceClass(device) === 'software')) {
|
|
43
58
|
return { ...sharedRamBudget(totalRamBytes), source: 'software' };
|
|
44
59
|
}
|
|
45
|
-
return
|
|
60
|
+
return integratedBudget(devices, totalRamBytes);
|
|
46
61
|
}
|
|
@@ -3,6 +3,18 @@ const os = require('os')
|
|
|
3
3
|
// lazy: the addon drags the graphics stack (and on Linux a second LLVM) into its importer
|
|
4
4
|
let GPUInfo
|
|
5
5
|
|
|
6
|
+
function deviceKind(gpu, gpuType) {
|
|
7
|
+
if (gpu.unifiedMemory === true || gpu.type === gpuType.INTEGRATED) {
|
|
8
|
+
return 'integrated'
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (gpu.type === gpuType.DEDICATED || gpu.type === gpuType.EXTERNAL) {
|
|
12
|
+
return 'discrete'
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return undefined
|
|
16
|
+
}
|
|
17
|
+
|
|
6
18
|
// system RAM is here to catch integrated-GPU lies
|
|
7
19
|
exports.readSystemStats = function readSystemStats() {
|
|
8
20
|
try {
|
|
@@ -11,7 +23,11 @@ exports.readSystemStats = function readSystemStats() {
|
|
|
11
23
|
try {
|
|
12
24
|
const devices = [...info]
|
|
13
25
|
.filter((gpu) => typeof gpu.memory === 'number' && gpu.name)
|
|
14
|
-
.map((gpu) => ({
|
|
26
|
+
.map((gpu) => ({
|
|
27
|
+
name: gpu.name,
|
|
28
|
+
videoMemoryBytes: gpu.memory,
|
|
29
|
+
kind: deviceKind(gpu, GPUInfo.constants.gpuType)
|
|
30
|
+
}))
|
|
15
31
|
if (devices.length === 0) {
|
|
16
32
|
return null
|
|
17
33
|
}
|
|
@@ -3,5 +3,6 @@ export type CompletionParams = Parameters<CompletionSdk['completion']>[0];
|
|
|
3
3
|
interface CompletionParamsInput extends Omit<CompletionParams, 'stream' | 'history'> {
|
|
4
4
|
history: Message[];
|
|
5
5
|
}
|
|
6
|
-
export declare function completionParams(
|
|
6
|
+
export declare function completionParams(input: CompletionParamsInput): CompletionParams;
|
|
7
|
+
export declare function sentParams({ modelId, history, tools, generationParams, responseFormat, toolDialect, kvCache }: CompletionParamsInput): CompletionParams;
|
|
7
8
|
export {};
|
|
@@ -1,7 +1,22 @@
|
|
|
1
|
+
import { defuseTemplateTokens, mapStrings } from './control-tokens.js';
|
|
1
2
|
function isSdkMessage(turn) {
|
|
2
3
|
return turn.toolCalls !== null && turn.toolCallId !== null;
|
|
3
4
|
}
|
|
4
|
-
|
|
5
|
+
function defused(turn) {
|
|
6
|
+
if (turn.role === 'assistant') {
|
|
7
|
+
return turn;
|
|
8
|
+
}
|
|
9
|
+
const content = defuseTemplateTokens(turn.content);
|
|
10
|
+
return content === turn.content ? turn : { ...turn, content };
|
|
11
|
+
}
|
|
12
|
+
export function completionParams(input) {
|
|
13
|
+
return sentParams({
|
|
14
|
+
...input,
|
|
15
|
+
history: input.history.map(defused),
|
|
16
|
+
tools: input.tools && mapStrings(input.tools, defuseTemplateTokens)
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export function sentParams({ modelId, history, tools, generationParams, responseFormat, toolDialect, kvCache }) {
|
|
5
20
|
return {
|
|
6
21
|
modelId,
|
|
7
22
|
history: history.map((turn) => isSdkMessage(turn)
|
|
@@ -4,4 +4,7 @@ export declare function endsTurn(token: string): boolean;
|
|
|
4
4
|
export declare function controlTokenIndex(text: string): number;
|
|
5
5
|
export declare function truncateAtControlToken(text: string): string;
|
|
6
6
|
export declare function stripControlTokens(text: string): string;
|
|
7
|
+
export declare function defuseTemplateTokens(text: string): string;
|
|
8
|
+
export declare function restoreTemplateTokens(text: string): string;
|
|
9
|
+
export declare function mapStrings<Value>(value: Value, map: (text: string) => string): Value;
|
|
7
10
|
export declare function stopAtControlToken(tokens: AsyncIterable<string>, onStop?: (token: string) => void): AsyncGenerator<string>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { firstMarker, markers, strip, truncateAt } from 'asenion/guards';
|
|
2
2
|
import { scanner } from 'asenion/scan';
|
|
3
|
+
import { isRecord } from '../guards.js';
|
|
3
4
|
export const STOP_MARKERS = [...markers.controlTokens, ...markers.scaffold];
|
|
4
5
|
const [SCAFFOLD_OPENING] = markers.scaffold;
|
|
5
6
|
export const RUNAWAY_STOP_SEQUENCES = [SCAFFOLD_OPENING];
|
|
@@ -15,6 +16,30 @@ export function truncateAtControlToken(text) {
|
|
|
15
16
|
export function stripControlTokens(text) {
|
|
16
17
|
return strip(truncateAt(text, markers.scaffold), markers.controlTokens);
|
|
17
18
|
}
|
|
19
|
+
const TOKEN_REST = String.raw `\|\w+\|>||[^|<>]+|>|(?:start|end)_of_turn>|\/?(?:tool_call|tool_response|think)>|tts_\w+>`;
|
|
20
|
+
const WORD_JOINER = '\u2060';
|
|
21
|
+
const TEMPLATE_TOKEN = new RegExp(`<(?=${TOKEN_REST})`, 'g');
|
|
22
|
+
const DEFUSED_TOKEN = new RegExp(`<${WORD_JOINER}(?=${TOKEN_REST})`, 'g');
|
|
23
|
+
export function defuseTemplateTokens(text) {
|
|
24
|
+
return text.replace(TEMPLATE_TOKEN, `<${WORD_JOINER}`);
|
|
25
|
+
}
|
|
26
|
+
export function restoreTemplateTokens(text) {
|
|
27
|
+
return text.replace(DEFUSED_TOKEN, '<');
|
|
28
|
+
}
|
|
29
|
+
export function mapStrings(value, map) {
|
|
30
|
+
return mapped(value, map);
|
|
31
|
+
}
|
|
32
|
+
function mapped(value, map) {
|
|
33
|
+
if (typeof value === 'string') {
|
|
34
|
+
return map(value);
|
|
35
|
+
}
|
|
36
|
+
if (Array.isArray(value)) {
|
|
37
|
+
return value.map((item) => mapped(item, map));
|
|
38
|
+
}
|
|
39
|
+
return isRecord(value)
|
|
40
|
+
? Object.fromEntries(Object.entries(value).map(([key, item]) => [key, mapped(item, map)]))
|
|
41
|
+
: value;
|
|
42
|
+
}
|
|
18
43
|
export async function* stopAtControlToken(tokens, onStop) {
|
|
19
44
|
const safe = scanner({ stop: STOP_MARKERS });
|
|
20
45
|
for await (const token of tokens) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { hasRoundsLeft, stuckResult } from '../guards/retry.js';
|
|
2
2
|
import { asksChecks, asksDeliverable, asksRun, citesPassed, deliverableAsk, deliverableChecked, existenceOnly, GOAL_CASES_ASK, GOAL_REVIEW_ASK, MAX_GOAL_CHECKS, MAX_PROOF_ASKS, mergeChecks, namedChecks, runAsk } from '../../../helpers/goal-check.js';
|
|
3
|
-
import { activate, applyHistorySplice, applySplice, casesDue, checksMet, foldMetrics, goalMet, goalTokensLeft, nudgeWithChecks, nudgeWithPlan, retainFailureResults, settledSince } from '../rules.js';
|
|
3
|
+
import { activate, applyHistorySplice, applySplice, casesDue, checksMet, foldMetrics, goalMet, goalTokensLeft, imagesShownNote, MAX_SHOWN_IMAGES, nudgeWithChecks, nudgeWithPlan, retainFailureResults, settledSince } from '../rules.js';
|
|
4
4
|
export function startInitialRound({ context, params }) {
|
|
5
5
|
return applyPreparation(context, params);
|
|
6
6
|
}
|
|
@@ -102,13 +102,32 @@ function closeFailureMemo(context) {
|
|
|
102
102
|
}
|
|
103
103
|
function endToolRound(context, { last = false } = {}) {
|
|
104
104
|
return {
|
|
105
|
-
history: [
|
|
105
|
+
history: [
|
|
106
|
+
...context.history,
|
|
107
|
+
...showing(continuation(context, { last }), context.shownThisRound ?? [])
|
|
108
|
+
],
|
|
106
109
|
steering: [],
|
|
107
110
|
delivered: context.delivered || context.deliveryEndsRun,
|
|
108
111
|
deliveredThisRound: false,
|
|
109
|
-
deliveryEndsRun: false
|
|
112
|
+
deliveryEndsRun: false,
|
|
113
|
+
shownThisRound: undefined
|
|
110
114
|
};
|
|
111
115
|
}
|
|
116
|
+
function showing(turns, images) {
|
|
117
|
+
const last = turns.at(-1);
|
|
118
|
+
const shown = images.slice(0, MAX_SHOWN_IMAGES);
|
|
119
|
+
if (!shown.length || !last || !('role' in last)) {
|
|
120
|
+
return turns;
|
|
121
|
+
}
|
|
122
|
+
return [
|
|
123
|
+
...turns.slice(0, -1),
|
|
124
|
+
{
|
|
125
|
+
...last,
|
|
126
|
+
content: `${last.content}\n${imagesShownNote(shown.map(({ fileName }) => fileName))}`,
|
|
127
|
+
attachments: shown.map(({ path }) => ({ path }))
|
|
128
|
+
}
|
|
129
|
+
];
|
|
130
|
+
}
|
|
112
131
|
function continuation(context, { last = false } = {}) {
|
|
113
132
|
const { plan } = context;
|
|
114
133
|
return context.steering.length
|
|
@@ -333,10 +352,20 @@ function swapStandingNudge(context) {
|
|
|
333
352
|
if (!last || !standing || !('role' in last) || !('role' in standing)) {
|
|
334
353
|
return {};
|
|
335
354
|
}
|
|
336
|
-
if (last.role !== 'user' || last.content
|
|
355
|
+
if (last.role !== 'user' || !last.content.startsWith(standing.content)) {
|
|
356
|
+
return {};
|
|
357
|
+
}
|
|
358
|
+
const note = last.content.slice(standing.content.length);
|
|
359
|
+
const wrapUp = continuation(context, { last: true });
|
|
360
|
+
if (!note) {
|
|
361
|
+
return { history: [...context.history.slice(0, -1), ...wrapUp] };
|
|
362
|
+
}
|
|
363
|
+
const [turn] = wrapUp;
|
|
364
|
+
if (!last.attachments?.length || wrapUp.length !== 1 || !turn || !('role' in turn)) {
|
|
337
365
|
return {};
|
|
338
366
|
}
|
|
339
|
-
|
|
367
|
+
const shown = { ...turn, content: `${turn.content}${note}`, attachments: last.attachments };
|
|
368
|
+
return { history: [...context.history.slice(0, -1), shown] };
|
|
340
369
|
}
|
|
341
370
|
export function wrapMuteCompletion(args) {
|
|
342
371
|
const turns = args.params.cutOff
|
|
@@ -148,7 +148,10 @@ function roundResult(context, payload) {
|
|
|
148
148
|
return {
|
|
149
149
|
answer: context.answer ?? payload.answer ?? null,
|
|
150
150
|
deliveredThisRound: context.deliveredThisRound || payload.delivered === true,
|
|
151
|
-
deliveryEndsRun: context.deliveryEndsRun || payload.deliveryEndsRun === true
|
|
151
|
+
deliveryEndsRun: context.deliveryEndsRun || payload.deliveryEndsRun === true,
|
|
152
|
+
shownThisRound: payload.shown
|
|
153
|
+
? [...(context.shownThisRound ?? []), ...payload.shown]
|
|
154
|
+
: context.shownThisRound
|
|
152
155
|
};
|
|
153
156
|
}
|
|
154
157
|
function unchangedRound(context, payload) {
|
|
@@ -9,7 +9,9 @@ export declare const MAX_BLOCKED_REPEATS = 3;
|
|
|
9
9
|
export declare const MAX_UNCHANGED_RESULTS = 3;
|
|
10
10
|
export declare const MAX_ROUND_REPEATS = 3;
|
|
11
11
|
export declare const MAX_ROUND_CALLS = 32;
|
|
12
|
+
export declare const MAX_SHOWN_IMAGES = 4;
|
|
12
13
|
export declare function nudgeWithPlan(nudge: string, plan: readonly PlanStep[]): string;
|
|
14
|
+
export declare function imagesShownNote(fileNames: readonly string[]): string;
|
|
13
15
|
export declare function goalMet(context: Readonly<CompletionContext>): boolean;
|
|
14
16
|
export declare function casesDue(context: Readonly<CompletionContext>): boolean;
|
|
15
17
|
export declare function checksMet({ plan, goal }: Readonly<CompletionContext>): boolean;
|
|
@@ -15,6 +15,7 @@ export const MAX_BLOCKED_REPEATS = 3;
|
|
|
15
15
|
export const MAX_UNCHANGED_RESULTS = 3;
|
|
16
16
|
export const MAX_ROUND_REPEATS = 3;
|
|
17
17
|
export const MAX_ROUND_CALLS = 32;
|
|
18
|
+
export const MAX_SHOWN_IMAGES = 4;
|
|
18
19
|
const PLAN_MARKS = {
|
|
19
20
|
pending: '[ ]',
|
|
20
21
|
in_progress: '[>]',
|
|
@@ -27,6 +28,12 @@ export function nudgeWithPlan(nudge, plan) {
|
|
|
27
28
|
const lines = plan.map(({ step, status }) => `${PLAN_MARKS[status]} ${step}`);
|
|
28
29
|
return `${nudge}\nPlan:\n${lines.join('\n')}`;
|
|
29
30
|
}
|
|
31
|
+
export function imagesShownNote(fileNames) {
|
|
32
|
+
const named = fileNames.map((name) => `"${name}"`).join(', ');
|
|
33
|
+
return fileNames.length === 1
|
|
34
|
+
? `[The image at the start of this turn is ${named}, which a tool above attached. You can see it: use what it shows, with no tool to open it.]`
|
|
35
|
+
: `[The images at the start of this turn are ${named}, which tools above attached. You can see them: use what they show, with no tool to open them.]`;
|
|
36
|
+
}
|
|
30
37
|
function isDone(step) {
|
|
31
38
|
return step.status === 'done';
|
|
32
39
|
}
|
|
@@ -131,6 +131,10 @@ export interface ApprovalGate {
|
|
|
131
131
|
approver: boolean;
|
|
132
132
|
call: ApprovalCall;
|
|
133
133
|
}
|
|
134
|
+
export interface ShownImage {
|
|
135
|
+
path: string;
|
|
136
|
+
fileName: string;
|
|
137
|
+
}
|
|
134
138
|
export interface ToolDonePayload {
|
|
135
139
|
deniedKey?: string;
|
|
136
140
|
webSearch?: boolean;
|
|
@@ -155,6 +159,7 @@ export interface ToolDonePayload {
|
|
|
155
159
|
answer?: string;
|
|
156
160
|
delivered?: boolean;
|
|
157
161
|
deliveryEndsRun?: boolean;
|
|
162
|
+
shown?: ShownImage[];
|
|
158
163
|
durationMs?: number;
|
|
159
164
|
activate?: string;
|
|
160
165
|
plan?: PlanStep[];
|
|
@@ -340,6 +345,7 @@ export interface CompletionContext {
|
|
|
340
345
|
delivered: boolean;
|
|
341
346
|
deliveredThisRound: boolean;
|
|
342
347
|
deliveryEndsRun: boolean;
|
|
348
|
+
shownThisRound?: ShownImage[];
|
|
343
349
|
activated: string[];
|
|
344
350
|
outcome: RunOutcome | 'failed' | null;
|
|
345
351
|
metrics: CompletionMetrics;
|
|
@@ -491,9 +491,10 @@ export declare class CompletionMachine {
|
|
|
491
491
|
static cutShort: typeof cutShort;
|
|
492
492
|
static atContextBoundary: typeof atContextBoundary;
|
|
493
493
|
static MAX_ROUND_CALLS: number;
|
|
494
|
+
static MAX_SHOWN_IMAGES: number;
|
|
494
495
|
static MAX_ROUND_REPEATS: number;
|
|
495
496
|
}
|
|
496
497
|
export type { MachineDefinitionNode } from './definition.ts';
|
|
497
498
|
export type { EmptyCompletionContextOptions } from './completion/context.ts';
|
|
498
499
|
export type { CompletionActorLogic, CompletionParent, InvocationInput, Stage } from './completion/ports.ts';
|
|
499
|
-
export type { CompletionContext, RunPolicy, CompletionActorOutput, CompletionActorOutputs, EngineEvent } from './completion/types.ts';
|
|
500
|
+
export type { CompletionContext, RunPolicy, CompletionActorOutput, CompletionActorOutputs, EngineEvent, ShownImage } from './completion/types.ts';
|
|
@@ -2,7 +2,7 @@ import { goalStatus } from './completion/actions/completion.js';
|
|
|
2
2
|
import { PLAN_MODE_REFUSAL } from './completion/actions/tools.js';
|
|
3
3
|
import { emptyCompletionContext } from './completion/context.js';
|
|
4
4
|
import { createCompletionMachine } from './completion/machine.js';
|
|
5
|
-
import { atContextBoundary, cutOffMessage, cutShort, MAX_ROUND_CALLS, MAX_ROUND_REPEATS, runsUnasked } from './completion/rules.js';
|
|
5
|
+
import { atContextBoundary, cutOffMessage, cutShort, MAX_ROUND_CALLS, MAX_ROUND_REPEATS, MAX_SHOWN_IMAGES, runsUnasked } from './completion/rules.js';
|
|
6
6
|
import { MACHINE_VERSION } from './completion/version.js';
|
|
7
7
|
import { completionMachineDefinition, transitionName } from './definition.js';
|
|
8
8
|
export class CompletionMachine {
|
|
@@ -18,5 +18,6 @@ export class CompletionMachine {
|
|
|
18
18
|
static cutShort = cutShort;
|
|
19
19
|
static atContextBoundary = atContextBoundary;
|
|
20
20
|
static MAX_ROUND_CALLS = MAX_ROUND_CALLS;
|
|
21
|
+
static MAX_SHOWN_IMAGES = MAX_SHOWN_IMAGES;
|
|
21
22
|
static MAX_ROUND_REPEATS = MAX_ROUND_REPEATS;
|
|
22
23
|
}
|
|
@@ -25,7 +25,7 @@ export interface NoRedirectFetchInit {
|
|
|
25
25
|
addEventListener(type: 'abort', listener: () => void): void;
|
|
26
26
|
};
|
|
27
27
|
validatedAddresses?: readonly string[] | undefined;
|
|
28
|
-
maxBytes?: number;
|
|
28
|
+
maxBytes?: number | ((contentType: string) => number);
|
|
29
29
|
truncate?: boolean;
|
|
30
30
|
idleTimeoutMs?: number;
|
|
31
31
|
}
|
|
@@ -32,6 +32,13 @@ export function runNoRedirectFetch(request, url, init = {}) {
|
|
|
32
32
|
const method = init.method ?? 'GET';
|
|
33
33
|
const req = request(url, { method, headers, validatedAddresses: init.validatedAddresses }, (res) => {
|
|
34
34
|
armIdle();
|
|
35
|
+
const responseHeaders = {};
|
|
36
|
+
for (const [name, value] of Object.entries(res.headers)) {
|
|
37
|
+
responseHeaders[name.toLowerCase()] = String(value);
|
|
38
|
+
}
|
|
39
|
+
const maxBytes = typeof init.maxBytes === 'function'
|
|
40
|
+
? init.maxBytes(contentTypeOf(responseHeaders))
|
|
41
|
+
: init.maxBytes;
|
|
35
42
|
const chunks = [];
|
|
36
43
|
let received = 0;
|
|
37
44
|
let settled = false;
|
|
@@ -40,10 +47,6 @@ export function runNoRedirectFetch(request, url, init = {}) {
|
|
|
40
47
|
return;
|
|
41
48
|
settled = true;
|
|
42
49
|
const body = b4a.concat(chunks);
|
|
43
|
-
const responseHeaders = {};
|
|
44
|
-
for (const [name, value] of Object.entries(res.headers)) {
|
|
45
|
-
responseHeaders[name.toLowerCase()] = String(value);
|
|
46
|
-
}
|
|
47
50
|
resolve({
|
|
48
51
|
status: res.statusCode,
|
|
49
52
|
headers: {
|
|
@@ -63,9 +66,9 @@ export function runNoRedirectFetch(request, url, init = {}) {
|
|
|
63
66
|
res.on('data', (chunk) => {
|
|
64
67
|
armIdle();
|
|
65
68
|
received += chunk.byteLength;
|
|
66
|
-
if (
|
|
69
|
+
if (maxBytes !== undefined && received > maxBytes) {
|
|
67
70
|
if (init.truncate) {
|
|
68
|
-
const allowed = chunk.byteLength - (received -
|
|
71
|
+
const allowed = chunk.byteLength - (received - maxBytes);
|
|
69
72
|
if (allowed > 0) {
|
|
70
73
|
chunks.push(chunk.subarray(0, allowed));
|
|
71
74
|
}
|
|
@@ -73,7 +76,7 @@ export function runNoRedirectFetch(request, url, init = {}) {
|
|
|
73
76
|
req.destroy();
|
|
74
77
|
return;
|
|
75
78
|
}
|
|
76
|
-
const err = new HarnessError('RESPONSE_TOO_LARGE', [
|
|
79
|
+
const err = new HarnessError('RESPONSE_TOO_LARGE', [maxBytes]);
|
|
77
80
|
req.destroy(err);
|
|
78
81
|
fail(err);
|
|
79
82
|
return;
|
|
@@ -116,3 +119,6 @@ export function runNoRedirectFetch(request, url, init = {}) {
|
|
|
116
119
|
req.end();
|
|
117
120
|
});
|
|
118
121
|
}
|
|
122
|
+
function contentTypeOf(headers) {
|
|
123
|
+
return (headers['content-type'] ?? '').split(';')[0]?.trim().toLowerCase() ?? '';
|
|
124
|
+
}
|
|
@@ -93,7 +93,7 @@ export function isoToSerial(value, date1904) {
|
|
|
93
93
|
return { serial, time: match[4] !== undefined };
|
|
94
94
|
}
|
|
95
95
|
function formulaError(input, why) {
|
|
96
|
-
return new DocsError('INVALID_FORMULA', `${JSON.stringify(input)} is not a formula (${why}); to store it as text
|
|
96
|
+
return new DocsError('INVALID_FORMULA', `${JSON.stringify(input)} is not a formula (${why}); to store it as text write ${JSON.stringify(`'${input}`)}`);
|
|
97
97
|
}
|
|
98
98
|
function parenthesisProblem(body) {
|
|
99
99
|
let depth = 0;
|
|
@@ -140,15 +140,18 @@ function isCellValue(value) {
|
|
|
140
140
|
typeof value === 'boolean' ||
|
|
141
141
|
(typeof value === 'number' && Number.isFinite(value)));
|
|
142
142
|
}
|
|
143
|
-
function normalizeText(input) {
|
|
143
|
+
function normalizeText(input, style = {}) {
|
|
144
144
|
if (input.length > 32767) {
|
|
145
145
|
throw new DocsError('INVALID_VALUE', 'a cell holds at most 32767 characters');
|
|
146
146
|
}
|
|
147
|
+
if (input.startsWith("'=")) {
|
|
148
|
+
return { content: true, value: input.slice(1), style };
|
|
149
|
+
}
|
|
147
150
|
if (input.length > 1 && input.startsWith('=')) {
|
|
148
151
|
checkFormula(input);
|
|
149
|
-
return { content: true, formula: input, style
|
|
152
|
+
return { content: true, formula: input, style };
|
|
150
153
|
}
|
|
151
|
-
return { content: true, value: input, style
|
|
154
|
+
return { content: true, value: input, style };
|
|
152
155
|
}
|
|
153
156
|
function normalizeObject(input) {
|
|
154
157
|
const { value, formula, date, ...style } = input;
|
|
@@ -175,6 +178,9 @@ function normalizeObject(input) {
|
|
|
175
178
|
if (!isCellValue(value)) {
|
|
176
179
|
throw new DocsError('INVALID_VALUE', 'value must be a string, a finite number, a boolean or null');
|
|
177
180
|
}
|
|
181
|
+
if (typeof value === 'string') {
|
|
182
|
+
return normalizeText(value, style);
|
|
183
|
+
}
|
|
178
184
|
return { content: true, value, style };
|
|
179
185
|
}
|
|
180
186
|
function normalize(input) {
|
|
@@ -87,6 +87,8 @@ export declare class PluginRegistry {
|
|
|
87
87
|
private readonly _buildsExec;
|
|
88
88
|
private readonly _deniedRoots;
|
|
89
89
|
private readonly _loaded;
|
|
90
|
+
private readonly _order;
|
|
91
|
+
private readonly _addons;
|
|
90
92
|
private readonly _held;
|
|
91
93
|
private readonly _services;
|
|
92
94
|
private readonly _cleanupErrors;
|
|
@@ -103,6 +105,7 @@ export declare class PluginRegistry {
|
|
|
103
105
|
constructor(plugins: readonly HarnessPlugin[], options?: PluginRegistryOptions);
|
|
104
106
|
static loadAddons(owner: string, addons?: AddonLoaders): Promise<void>;
|
|
105
107
|
static requirePeers(plugin: string, peers: PeerResolvers): void;
|
|
108
|
+
static requireBare(plugin: string, floor: string): void;
|
|
106
109
|
start(reserved: Iterable<string>, { fetch, publish }?: PluginStartOptions): Promise<StartedPlugins>;
|
|
107
110
|
add(plugin: HarnessPlugin): Promise<void>;
|
|
108
111
|
remove(name: string): Promise<void>;
|
|
@@ -3,6 +3,7 @@ import { Policy } from '../policy/index.js';
|
|
|
3
3
|
import { canonicalDenyRoots, defaultRealpath } from '../tools/fs/scope.js';
|
|
4
4
|
import { TOOLSETS } from '../tools/toolsets.js';
|
|
5
5
|
import { loadAddons } from './addons.js';
|
|
6
|
+
import { requireBare } from './require-bare.js';
|
|
6
7
|
import { requirePeers } from '../helpers/require-peers.js';
|
|
7
8
|
import { PluginRuntime } from './runtime.js';
|
|
8
9
|
const API_VERSION = 1;
|
|
@@ -249,6 +250,8 @@ export class PluginRegistry {
|
|
|
249
250
|
_buildsExec;
|
|
250
251
|
_deniedRoots;
|
|
251
252
|
_loaded = [];
|
|
253
|
+
_order;
|
|
254
|
+
_addons = new Map();
|
|
252
255
|
_held = [];
|
|
253
256
|
_services = new Map();
|
|
254
257
|
_cleanupErrors = [];
|
|
@@ -271,6 +274,7 @@ export class PluginRegistry {
|
|
|
271
274
|
for (const plugin of order) {
|
|
272
275
|
validated(plugin);
|
|
273
276
|
}
|
|
277
|
+
this._order = order;
|
|
274
278
|
const runtime = new PluginRuntime(order.map((plugin) => this._plugin(plugin, 0, (loaded) => this._loaded.push(loaded))));
|
|
275
279
|
for (const [name, value] of core) {
|
|
276
280
|
provideService(runtime.ctx, name, value);
|
|
@@ -287,6 +291,9 @@ export class PluginRegistry {
|
|
|
287
291
|
static requirePeers(plugin, peers) {
|
|
288
292
|
requirePeers(`@qvac/harness/plugins/${plugin}`, peers);
|
|
289
293
|
}
|
|
294
|
+
static requireBare(plugin, floor) {
|
|
295
|
+
requireBare(`@qvac/harness/plugins/${plugin}`, floor);
|
|
296
|
+
}
|
|
290
297
|
start(reserved, { fetch, publish } = {}) {
|
|
291
298
|
if (this._closing) {
|
|
292
299
|
return Promise.reject(new Error('Plugin registry is closing or closed'));
|
|
@@ -296,6 +303,11 @@ export class PluginRegistry {
|
|
|
296
303
|
this._reserved = new Set(reserved);
|
|
297
304
|
this._fetch = fetch;
|
|
298
305
|
this._publish = publish;
|
|
306
|
+
for (const plugin of this._order) {
|
|
307
|
+
const loading = loadAddons(`plugin '${plugin.name}'`, plugin.addons);
|
|
308
|
+
loading.catch(noop);
|
|
309
|
+
this._addons.set(plugin, loading);
|
|
310
|
+
}
|
|
299
311
|
this._starting = this._runtime.ready().then(() => this._started());
|
|
300
312
|
return this._starting;
|
|
301
313
|
}
|
|
@@ -392,7 +404,9 @@ export class PluginRegistry {
|
|
|
392
404
|
for (const name of plugin.needs ?? []) {
|
|
393
405
|
readService(ctx, name);
|
|
394
406
|
}
|
|
395
|
-
|
|
407
|
+
const loading = this._addons.get(plugin) ?? loadAddons(`plugin '${plugin.name}'`, plugin.addons);
|
|
408
|
+
this._addons.delete(plugin);
|
|
409
|
+
await loading;
|
|
396
410
|
const onDispose = (dispose) => this._ownDispose(ctx, plugin.name, dispose);
|
|
397
411
|
const fetch = this._fetch ? this._fetch(undefined, anywhere) : unfetched;
|
|
398
412
|
const deniedRoots = Object.freeze(await canonicalDenyRoots(this._deniedRoots, defaultRealpath));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function requireBare(subject: string, floor: string): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function requireBare(subject, floor) {
|
|
2
|
+
const running = globalThis.Bare?.version;
|
|
3
|
+
if (running === undefined || !olderThan(running.replace(/^v/, ''), floor)) {
|
|
4
|
+
return;
|
|
5
|
+
}
|
|
6
|
+
throw new Error(`${subject} needs Bare ${floor} or later, and this is Bare ${running}`);
|
|
7
|
+
}
|
|
8
|
+
function olderThan(version, floor) {
|
|
9
|
+
const have = version.split('.').map((part) => parseInt(part, 10));
|
|
10
|
+
const need = floor.split('.').map((part) => parseInt(part, 10));
|
|
11
|
+
const differs = need.findIndex((part, i) => have[i] !== part);
|
|
12
|
+
return differs !== -1 && have[differs] < need[differs];
|
|
13
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import crypto from 'crypto';
|
|
2
|
-
import {
|
|
2
|
+
import { sentParams } from '../helpers/completion-params.js';
|
|
3
3
|
import { isRecord } from '../guards.js';
|
|
4
4
|
import { compactRequestHistory, materializeRequestHistory } from './history-codec.js';
|
|
5
5
|
export function toolsRef(tools) {
|
|
@@ -58,7 +58,7 @@ export class RequestDecoder {
|
|
|
58
58
|
const history = [...this.previous.slice(0, record.keep), ...appended];
|
|
59
59
|
this.previous = history;
|
|
60
60
|
const { modelId, generationParams, responseFormat, toolDialect, kvCache } = record.params;
|
|
61
|
-
return
|
|
61
|
+
return sentParams({
|
|
62
62
|
modelId,
|
|
63
63
|
history,
|
|
64
64
|
tools: record.tools && this.tools(record.tools),
|
package/dist-lib/lib/serve.js
CHANGED
|
@@ -182,6 +182,9 @@ function startPayloadFrom(value) {
|
|
|
182
182
|
if (value.roundCut === true) {
|
|
183
183
|
payload.roundCut = true;
|
|
184
184
|
}
|
|
185
|
+
if (value.showImage === true) {
|
|
186
|
+
payload.showImage = true;
|
|
187
|
+
}
|
|
185
188
|
if (value.runLog === null) {
|
|
186
189
|
payload.runLog = null;
|
|
187
190
|
}
|
|
@@ -365,6 +368,13 @@ export function serveHarness(stream, harness) {
|
|
|
365
368
|
text: await harness.transcribe({ model: model ?? '', audio: audio ?? b4a.alloc(0) })
|
|
366
369
|
};
|
|
367
370
|
},
|
|
371
|
+
ocrRead: async ({ width, height, data }) => {
|
|
372
|
+
if (!harness.ocrRead) {
|
|
373
|
+
throw new HarnessError('CAPABILITY_UNSUPPORTED', ['ocr']);
|
|
374
|
+
}
|
|
375
|
+
const image = { width: width ?? 0, height: height ?? 0, data: data ?? b4a.alloc(0) };
|
|
376
|
+
return { text: await harness.ocrRead({ image }) };
|
|
377
|
+
},
|
|
368
378
|
detectLanguage: async ({ text, topK }) => {
|
|
369
379
|
if (!harness.detectLanguage) {
|
|
370
380
|
throw new HarnessError('CAPABILITY_UNSUPPORTED', ['detectLanguage']);
|
|
@@ -646,6 +656,7 @@ function completion(harness) {
|
|
|
646
656
|
const pending = new Map();
|
|
647
657
|
const pendingAttach = new Map();
|
|
648
658
|
const pendingFetch = new Map();
|
|
659
|
+
const pendingShow = new Map();
|
|
649
660
|
const pendingQuestion = new Map();
|
|
650
661
|
const pendingDrive = new Map();
|
|
651
662
|
const pendingRunLog = new Map();
|
|
@@ -671,6 +682,10 @@ function completion(harness) {
|
|
|
671
682
|
reject(new HarnessError('CLIENT_GONE'));
|
|
672
683
|
}
|
|
673
684
|
pendingFetch.clear();
|
|
685
|
+
for (const { reject } of pendingShow.values()) {
|
|
686
|
+
reject(new HarnessError('CLIENT_GONE'));
|
|
687
|
+
}
|
|
688
|
+
pendingShow.clear();
|
|
674
689
|
for (const { resolve } of pendingQuestion.values()) {
|
|
675
690
|
resolve(null);
|
|
676
691
|
}
|
|
@@ -735,6 +750,13 @@ function completion(harness) {
|
|
|
735
750
|
if (typeof frame.callId !== 'string') {
|
|
736
751
|
return;
|
|
737
752
|
}
|
|
753
|
+
const shown = pendingShow.get(frame.callId);
|
|
754
|
+
if (shown) {
|
|
755
|
+
pendingShow.delete(frame.callId);
|
|
756
|
+
return frame.message
|
|
757
|
+
? shown.reject(new Error(frame.message))
|
|
758
|
+
: shown.resolve(frame.path || null);
|
|
759
|
+
}
|
|
738
760
|
const waiter = pendingFetch.get(frame.callId);
|
|
739
761
|
pendingFetch.delete(frame.callId);
|
|
740
762
|
if (!waiter) {
|
|
@@ -984,6 +1006,20 @@ function completion(harness) {
|
|
|
984
1006
|
meta: meta === true ? true : undefined
|
|
985
1007
|
});
|
|
986
1008
|
}),
|
|
1009
|
+
showImage: startPayload.showImage
|
|
1010
|
+
? ({ attachmentId }) => controller.signal.aborted
|
|
1011
|
+
? Promise.reject(new HarnessError('CLIENT_GONE'))
|
|
1012
|
+
: new Promise((resolve, reject) => {
|
|
1013
|
+
const callId = String(calls++);
|
|
1014
|
+
pendingShow.set(callId, { resolve, reject });
|
|
1015
|
+
events.push({
|
|
1016
|
+
type: 'fetch-ask',
|
|
1017
|
+
callId,
|
|
1018
|
+
attachmentId,
|
|
1019
|
+
payload: { show: true }
|
|
1020
|
+
});
|
|
1021
|
+
})
|
|
1022
|
+
: undefined,
|
|
987
1023
|
progress: (update) => {
|
|
988
1024
|
events.push(update
|
|
989
1025
|
? { type: 'progress', percentage: update.percentage }
|
|
@@ -998,7 +1034,8 @@ function completion(harness) {
|
|
|
998
1034
|
type: 'question-ask',
|
|
999
1035
|
callId,
|
|
1000
1036
|
question: question.question,
|
|
1001
|
-
options: question.options
|
|
1037
|
+
options: question.options,
|
|
1038
|
+
payload: question.form
|
|
1002
1039
|
});
|
|
1003
1040
|
})
|
|
1004
1041
|
};
|
|
@@ -11,7 +11,7 @@ import { type ImageClamps, type ImageModelSet, type MusicClamps } from '../model
|
|
|
11
11
|
export interface SidecarContext {
|
|
12
12
|
pluginOptions: HarnessPluginOptions;
|
|
13
13
|
sdkStorage: SdkStorage;
|
|
14
|
-
skillsDir: string;
|
|
14
|
+
skillsDir: string | undefined;
|
|
15
15
|
skillCatalog: SkillCatalogEntry[] | undefined;
|
|
16
16
|
credentialStore: CredentialStoreFn | undefined;
|
|
17
17
|
imageModel: string | ImageModelSet | undefined;
|