@inflexa-ai/harness 0.42.1 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/agents/conversation-agent.js +5 -1
- package/dist/agents/sandbox/drug-repurposing-agent.js +1 -0
- package/dist/agents/sandbox/shared.d.ts +1 -6
- package/dist/agents/sandbox/shared.js +3 -16
- package/dist/agents/sandbox/types.d.ts +1 -1
- package/dist/app/chat-turn.js +13 -1
- package/dist/config/environment-stores.d.ts +4 -2
- package/dist/contracts/chat-events.d.ts +9 -1
- package/dist/contracts/chat-frame.d.ts +3 -3
- package/dist/contracts/chat-frame.js +8 -3
- package/dist/contracts/chat-parts.d.ts +4 -1
- package/dist/contracts/data-profile.d.ts +4 -6
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/report-blocks.d.ts +1364 -75
- package/dist/contracts/report-blocks.js +221 -29
- package/dist/contracts/report-reference.js +1 -1
- package/dist/contracts/schemas/chat-events.d.ts +13 -0
- package/dist/contracts/schemas/chat-events.js +5 -0
- package/dist/contracts/schemas/chat-parts.d.ts +2 -2
- package/dist/contracts/schemas/index.d.ts +1 -1
- package/dist/contracts/schemas/index.js +1 -1
- package/dist/execution/input-signature.d.ts +7 -13
- package/dist/execution/input-signature.js +0 -0
- package/dist/execution/run-canceler.d.ts +3 -2
- package/dist/execution/run-canceler.js +3 -2
- package/dist/execution/run-event-stream.d.ts +16 -2
- package/dist/execution/run-event-stream.js +54 -3
- package/dist/index.d.ts +1 -8
- package/dist/index.js +5 -16
- package/dist/input-scan/enrich.d.ts +0 -2
- package/dist/input-scan/enrich.js +0 -1
- package/dist/lib/metrics.js +6 -7
- package/dist/lib/otel-spans.d.ts +4 -9
- package/dist/lib/otel-spans.js +3 -8
- package/dist/loop/run-agent.d.ts +4 -2
- package/dist/loop/run-agent.js +38 -23
- package/dist/memory/thread-history.d.ts +1 -1
- package/dist/prompts/report-session.d.ts +1 -1
- package/dist/prompts/report-session.js +17 -0
- package/dist/prompts/sandbox/drug-repurposing-agent.d.ts +1 -1
- package/dist/prompts/sandbox/drug-repurposing-agent.js +7 -0
- package/dist/provenance/exec-frame.d.ts +1 -1
- package/dist/report-model/authoring-grammar.d.ts +416 -17
- package/dist/report-model/authoring-grammar.js +25 -4
- package/dist/report-model/block-walk.d.ts +20 -4
- package/dist/report-model/block-walk.js +64 -7
- package/dist/report-model/draft-finish.d.ts +6 -2
- package/dist/report-model/draft-finish.js +6 -1
- package/dist/report-model/production-resolver.d.ts +8 -0
- package/dist/report-model/production-resolver.js +1 -1
- package/dist/report-model/validate.d.ts +20 -10
- package/dist/report-model/validate.js +29 -13
- package/dist/report-render/chart-export.d.ts +52 -0
- package/dist/report-render/chart-export.js +192 -0
- package/dist/report-render/chart-presets.d.ts +46 -47
- package/dist/report-render/chart-presets.js +31 -101
- package/dist/report-render/chart-renderers.d.ts +163 -0
- package/dist/report-render/chart-renderers.js +1055 -0
- package/dist/report-render/chart-toolbox.d.ts +124 -0
- package/dist/report-render/chart-toolbox.js +595 -0
- package/dist/report-render/chart.d.ts +60 -27
- package/dist/report-render/chart.js +2323 -524
- package/dist/report-render/design.d.ts +476 -16
- package/dist/report-render/design.js +390 -56
- package/dist/report-render/figures/common.d.ts +321 -0
- package/dist/report-render/figures/common.js +759 -0
- package/dist/report-render/figures/dendrogram.d.ts +36 -0
- package/dist/report-render/figures/dendrogram.js +130 -0
- package/dist/report-render/figures/dense.d.ts +111 -0
- package/dist/report-render/figures/dense.js +204 -0
- package/dist/report-render/figures/dotplot.d.ts +28 -0
- package/dist/report-render/figures/dotplot.js +234 -0
- package/dist/report-render/figures/embedding.d.ts +43 -0
- package/dist/report-render/figures/embedding.js +360 -0
- package/dist/report-render/figures/equal-units.d.ts +101 -0
- package/dist/report-render/figures/equal-units.js +215 -0
- package/dist/report-render/figures/forest.d.ts +20 -0
- package/dist/report-render/figures/forest.js +398 -0
- package/dist/report-render/figures/gsea.d.ts +30 -0
- package/dist/report-render/figures/gsea.js +391 -0
- package/dist/report-render/figures/heatmap.d.ts +40 -0
- package/dist/report-render/figures/heatmap.js +395 -0
- package/dist/report-render/figures/index.d.ts +135 -0
- package/dist/report-render/figures/index.js +100 -0
- package/dist/report-render/figures/km.d.ts +16 -0
- package/dist/report-render/figures/km.js +406 -0
- package/dist/report-render/figures/label-room.d.ts +130 -0
- package/dist/report-render/figures/label-room.js +341 -0
- package/dist/report-render/figures/locuszoom.d.ts +50 -0
- package/dist/report-render/figures/locuszoom.js +675 -0
- package/dist/report-render/figures/lollipop.d.ts +16 -0
- package/dist/report-render/figures/lollipop.js +247 -0
- package/dist/report-render/figures/ma.d.ts +20 -0
- package/dist/report-render/figures/ma.js +114 -0
- package/dist/report-render/figures/manhattan.d.ts +60 -0
- package/dist/report-render/figures/manhattan.js +343 -0
- package/dist/report-render/figures/oncoprint.d.ts +41 -0
- package/dist/report-render/figures/oncoprint.js +420 -0
- package/dist/report-render/figures/pca.d.ts +37 -0
- package/dist/report-render/figures/pca.js +241 -0
- package/dist/report-render/figures/qq.d.ts +30 -0
- package/dist/report-render/figures/qq.js +182 -0
- package/dist/report-render/figures/roc.d.ts +17 -0
- package/dist/report-render/figures/roc.js +116 -0
- package/dist/report-render/figures/sankey.d.ts +48 -0
- package/dist/report-render/figures/sankey.js +353 -0
- package/dist/report-render/figures/upset.d.ts +60 -0
- package/dist/report-render/figures/upset.js +316 -0
- package/dist/report-render/figures/volcano.d.ts +25 -0
- package/dist/report-render/figures/volcano.js +166 -0
- package/dist/report-render/hybrid-svg.d.ts +75 -0
- package/dist/report-render/hybrid-svg.js +504 -0
- package/dist/report-render/number-format.d.ts +19 -0
- package/dist/report-render/number-format.js +25 -1
- package/dist/report-render/page.d.ts +41 -4
- package/dist/report-render/page.js +247 -12
- package/dist/report-render/render.d.ts +13 -4
- package/dist/report-render/render.js +37 -6
- package/dist/report-render/types.d.ts +23 -2
- package/dist/report-render/value-bridge.d.ts +38 -3
- package/dist/report-render/value-bridge.js +137 -6
- package/dist/report-render/views/chart-view.d.ts +42 -6
- package/dist/report-render/views/chart-view.js +70 -9
- package/dist/report-render/views/page-view.js +9 -10
- package/dist/runtime/assemble.js +2 -2
- package/dist/sandbox/client.d.ts +23 -32
- package/dist/sandbox/client.js +3 -11
- package/dist/sandbox/create-sandbox.d.ts +9 -24
- package/dist/sandbox/create-sandbox.js +15 -30
- package/dist/sandbox/docker-client.d.ts +12 -22
- package/dist/sandbox/docker-client.js +29 -43
- package/dist/sandbox/exec.d.ts +58 -0
- package/dist/sandbox/exec.js +197 -0
- package/dist/sandbox/identity.d.ts +5 -5
- package/dist/sandbox/identity.js +7 -10
- package/dist/sandbox/k8s-client.d.ts +4 -10
- package/dist/sandbox/k8s-client.js +5 -12
- package/dist/sandbox/liveness.d.ts +5 -12
- package/dist/sandbox/liveness.js +5 -12
- package/dist/sandbox/notification-sweep.d.ts +4 -7
- package/dist/sandbox/notification-sweep.js +4 -7
- package/dist/sandbox/reaper.d.ts +3 -3
- package/dist/sandbox/reaper.js +3 -3
- package/dist/sandbox/sandbox-error.d.ts +10 -11
- package/dist/sandbox/sandbox-error.js +10 -11
- package/dist/sandbox/sandbox-step-translate.d.ts +1 -1
- package/dist/sandbox/sandbox-step-translate.js +1 -1
- package/dist/sandbox/types.d.ts +31 -99
- package/dist/sandbox/types.js +17 -84
- package/dist/state/active-sandboxes.d.ts +7 -32
- package/dist/state/active-sandboxes.js +11 -46
- package/dist/state/index.d.ts +1 -2
- package/dist/state/index.js +1 -1
- package/dist/state/migrations/20261005120000_drop_the_active_exec_tracking.d.ts +7 -0
- package/dist/state/migrations/20261005120000_drop_the_active_exec_tracking.js +12 -0
- package/dist/state/migrations/index.js +2 -0
- package/dist/state/schema.d.ts +1 -5
- package/dist/state/schema.js +1 -6
- package/dist/state/step-executions.js +1 -2
- package/dist/tasks/data-profile.js +7 -20
- package/dist/tasks/derive-table-exec.d.ts +4 -14
- package/dist/tasks/derive-table-exec.js +9 -24
- package/dist/tasks/extract-values.d.ts +2 -2
- package/dist/tasks/extract-values.js +4 -7
- package/dist/tools/bio/index.d.ts +2 -0
- package/dist/tools/bio/index.js +3 -0
- package/dist/tools/bio/keys.d.ts +11 -0
- package/dist/tools/bio/keys.js +15 -0
- package/dist/tools/bio/search-clinical-trials.d.ts +1 -1
- package/dist/tools/bio/search-patents.d.ts +46 -0
- package/dist/tools/bio/search-patents.js +134 -0
- package/dist/tools/bio/search-regulatory-approvals.d.ts +49 -0
- package/dist/tools/bio/search-regulatory-approvals.js +158 -0
- package/dist/tools/define-tool.d.ts +56 -13
- package/dist/tools/define-tool.js +28 -1
- package/dist/tools/execute-analysis.js +3 -3
- package/dist/tools/lib/amass-client.d.ts +586 -0
- package/dist/tools/lib/amass-client.js +492 -0
- package/dist/tools/lib/amass-config.d.ts +2 -0
- package/dist/tools/lib/amass-config.js +10 -0
- package/dist/tools/report-session/derive-table.d.ts +8 -9
- package/dist/tools/report-session/derive-table.js +3 -4
- package/dist/tools/report-session/preview-report.js +4 -49
- package/dist/tools/sandbox/list-available-packages.d.ts +1 -1
- package/dist/tools/sandbox/list-available-packages.js +5 -4
- package/dist/tools/workspace/edit-file.d.ts +5 -4
- package/dist/tools/workspace/edit-file.js +10 -13
- package/dist/tools/workspace/execute-command.d.ts +27 -42
- package/dist/tools/workspace/execute-command.js +42 -38
- package/dist/tools/workspace/index.d.ts +5 -6
- package/dist/tools/workspace/index.js +5 -6
- package/dist/tools/workspace/mutator.d.ts +43 -8
- package/dist/tools/workspace/mutator.js +45 -34
- package/dist/tools/workspace/run-exec.d.ts +3 -12
- package/dist/tools/workspace/run-exec.js +7 -24
- package/dist/tools/workspace/scan-inputs.d.ts +0 -3
- package/dist/tools/workspace/scan-inputs.js +0 -1
- package/dist/tools/workspace/write-file.d.ts +12 -3
- package/dist/tools/workspace/write-file.js +17 -13
- package/dist/workflows/sandbox-step.d.ts +7 -11
- package/dist/workflows/sandbox-step.js +24 -27
- package/package.json +3 -1
- package/dist/sandbox/await-exec.d.ts +0 -143
- package/dist/sandbox/await-exec.js +0 -417
- package/dist/sandbox/deliver-exec-event.d.ts +0 -25
- package/dist/sandbox/deliver-exec-event.js +0 -29
- package/dist/sandbox/digest.d.ts +0 -14
- package/dist/sandbox/digest.js +0 -17
- package/dist/sandbox/exec-id.d.ts +0 -12
- package/dist/sandbox/exec-id.js +0 -20
- package/dist/sandbox/hmac.d.ts +0 -62
- package/dist/sandbox/hmac.js +0 -72
- package/dist/sandbox/submit-exec.d.ts +0 -38
- package/dist/sandbox/submit-exec.js +0 -80
- package/dist/sandbox/watchdog.d.ts +0 -71
- package/dist/sandbox/watchdog.js +0 -161
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* captures its deps and calls `defineTool`.
|
|
9
9
|
*
|
|
10
10
|
* `ToolContext` carries only request-scoped values every tool may need
|
|
11
|
-
* (`invocationId`, `session`, `signal`, `emit`, `
|
|
11
|
+
* (`invocationId`, `session`, `signal`, `emit`, `ask`, `turnUsage`) — no pool, no sandbox, no
|
|
12
12
|
* logger. The error contract: an expected
|
|
13
13
|
* outcome ("not found", "no results") stays in the ok channel as a data
|
|
14
14
|
* variant (`ok({ found: false })`); an unexpected failure is an `err(ToolError)`
|
|
@@ -19,7 +19,7 @@ import type { Result } from "neverthrow";
|
|
|
19
19
|
import { z } from "zod";
|
|
20
20
|
import type { AgentSession } from "../auth/types.js";
|
|
21
21
|
import type { AgentRunUsage } from "../loop/metrics.js";
|
|
22
|
-
import type { EmitFn
|
|
22
|
+
import type { EmitFn } from "../loop/types.js";
|
|
23
23
|
import type { AskApproval, AskRequest } from "./approval/contract.js";
|
|
24
24
|
export type { EmitFn };
|
|
25
25
|
/**
|
|
@@ -35,7 +35,13 @@ export interface ToolError {
|
|
|
35
35
|
readonly retryable: boolean;
|
|
36
36
|
readonly cause?: unknown;
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
/**
|
|
39
|
+
* How the loop runs a tool call. `step` (the default) wraps the whole call in
|
|
40
|
+
* one durable step, thus a replay returns the cached result and never runs the
|
|
41
|
+
* body again. `inline` runs the call with no step, for a tool whose effects are
|
|
42
|
+
* not durable work.
|
|
43
|
+
*/
|
|
44
|
+
export type ToolExecutionMode = "step" | "inline";
|
|
39
45
|
/** Runtime guard — does a `Result`'s error value carry the `ToolError` shape? */
|
|
40
46
|
export declare function isToolError(value: unknown): value is ToolError;
|
|
41
47
|
/**
|
|
@@ -78,13 +84,37 @@ export declare function withToolResultImages<T extends object>(value: T, images:
|
|
|
78
84
|
* in the same shape.
|
|
79
85
|
*/
|
|
80
86
|
export declare function readToolResultImages(value: unknown): ToolResultImage[];
|
|
87
|
+
/**
|
|
88
|
+
* The reserved key that carries the call record on a tool ok value.
|
|
89
|
+
*
|
|
90
|
+
* A call record is what a call leaves for process-local state, for example the
|
|
91
|
+
* lineage collector of a sandbox step. A replay returns the cached result of a
|
|
92
|
+
* step-mode call and never runs its body, thus a side effect of the body on
|
|
93
|
+
* such state is lost on recovery. The record goes into the cached dispatch
|
|
94
|
+
* instead, and the loop hands it to `foldCallRecord` after the call settles, on
|
|
95
|
+
* the first run and on each replay alike.
|
|
96
|
+
*
|
|
97
|
+
* It is a symbol, thus `JSON.stringify` omits it and the model never reads it.
|
|
98
|
+
* The record itself must be plain JSON, because the step cache serializes it.
|
|
99
|
+
*/
|
|
100
|
+
export declare const toolCallRecordKey: unique symbol;
|
|
101
|
+
/** A tool ok value that carries a call record under the reserved key. */
|
|
102
|
+
export type WithToolCallRecord<T, R> = T & {
|
|
103
|
+
readonly [toolCallRecordKey]: R;
|
|
104
|
+
};
|
|
105
|
+
/** The type of the call record that a tool ok type carries. A variant with no record contributes nothing. */
|
|
106
|
+
export type ToolCallRecordOf<Output> = Output extends {
|
|
107
|
+
readonly [toolCallRecordKey]: infer R;
|
|
108
|
+
} ? R : never;
|
|
109
|
+
/** Attach a call record to a tool ok value. The value keeps its own fields. */
|
|
110
|
+
export declare function withToolCallRecord<T extends object, R>(value: T, record: R): WithToolCallRecord<T, R>;
|
|
111
|
+
/** Read the call record that a tool ok value carries, or `undefined` when it carries none. */
|
|
112
|
+
export declare function readToolCallRecord(value: unknown): unknown;
|
|
81
113
|
/**
|
|
82
114
|
* The request-scoped values passed to every tool's `execute`. No injected
|
|
83
115
|
* dependencies (see the harness-durable-runtime spec) — invocation identity,
|
|
84
|
-
* `session`, `signal`, `emit`, the `
|
|
85
|
-
*
|
|
86
|
-
* tool uses to wrap its own durable work, the `ask` user-approval seam, and the
|
|
87
|
-
* turn's usage accumulator a sub-agent-running tool hands to its child loop.
|
|
116
|
+
* `session`, `signal`, `emit`, the `ask` user-approval seam, and the turn's
|
|
117
|
+
* usage accumulator a sub-agent-running tool hands to its child loop.
|
|
88
118
|
*/
|
|
89
119
|
export interface ToolContext {
|
|
90
120
|
/** Stable identity of this AI SDK tool call. Redelivery preserves it; a new
|
|
@@ -93,11 +123,6 @@ export interface ToolContext {
|
|
|
93
123
|
readonly session: AgentSession;
|
|
94
124
|
readonly signal: AbortSignal;
|
|
95
125
|
readonly emit: EmitFn;
|
|
96
|
-
/**
|
|
97
|
-
* Wrap durable work in a replay-cached step. The loop namespaces the name
|
|
98
|
-
* under the tool's own step name, so a tool just passes a short local label.
|
|
99
|
-
*/
|
|
100
|
-
readonly runStep: RunStep;
|
|
101
126
|
/**
|
|
102
127
|
* Pause for an explicit user decision on a concrete action. Resolves with the
|
|
103
128
|
* approval (`once`/`always`) or throws `AskRejectedError` on denial. Resolves
|
|
@@ -117,7 +142,7 @@ export interface ToolContext {
|
|
|
117
142
|
}
|
|
118
143
|
/**
|
|
119
144
|
* A packaged tool: identity, the Zod input contract, the emitted AI SDK input
|
|
120
|
-
* schema, execution mode, the optional
|
|
145
|
+
* schema, execution mode, the optional hooks, and the executor.
|
|
121
146
|
*/
|
|
122
147
|
export interface Tool<Input = unknown, Output = unknown> {
|
|
123
148
|
readonly id: string;
|
|
@@ -129,6 +154,11 @@ export interface Tool<Input = unknown, Output = unknown> {
|
|
|
129
154
|
describeCall?(input: Input): string;
|
|
130
155
|
/** See {@link ToolDefinition.describeResult}. Absent when the tool declares none. */
|
|
131
156
|
describeResult?(input: Input, result: Output): string;
|
|
157
|
+
/**
|
|
158
|
+
* See {@link ToolDefinition.foldCallRecord}. The record arrives untyped: the
|
|
159
|
+
* loop passes back only what the `execute` of the same tool attached.
|
|
160
|
+
*/
|
|
161
|
+
foldCallRecord?(record: unknown): void;
|
|
132
162
|
execute(input: Input, ctx: ToolContext): Promise<Result<Output, ToolError>>;
|
|
133
163
|
}
|
|
134
164
|
export interface ToolDefinition<Schema extends z.ZodType, Output> {
|
|
@@ -199,6 +229,19 @@ export interface ToolDefinition<Schema extends z.ZodType, Output> {
|
|
|
199
229
|
* The hook never reaches the model.
|
|
200
230
|
*/
|
|
201
231
|
readonly describeResult?: (input: z.infer<Schema>, result: Output) => string;
|
|
232
|
+
/**
|
|
233
|
+
* Fold the call record of one settled call into process-local state. The
|
|
234
|
+
* record is the one that `execute` attached with `withToolCallRecord`.
|
|
235
|
+
*
|
|
236
|
+
* The loop runs the hook after the round settles, in the order of the tool
|
|
237
|
+
* calls, on the first run and on each replay alike. Thus state that a
|
|
238
|
+
* replay rebuilds from scratch sees the same records in the same order. A
|
|
239
|
+
* call whose ok value carries no record, and a failed call, never reach it.
|
|
240
|
+
*
|
|
241
|
+
* The hook is synchronous. It must never fail a call: the call has settled,
|
|
242
|
+
* and its result may already be cached. The loop logs a throw and goes on.
|
|
243
|
+
*/
|
|
244
|
+
readonly foldCallRecord?: (record: ToolCallRecordOf<Output>) => void;
|
|
202
245
|
execute(input: z.infer<Schema>, ctx: ToolContext): Promise<Result<Output, ToolError>>;
|
|
203
246
|
}
|
|
204
247
|
/**
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* captures its deps and calls `defineTool`.
|
|
9
9
|
*
|
|
10
10
|
* `ToolContext` carries only request-scoped values every tool may need
|
|
11
|
-
* (`invocationId`, `session`, `signal`, `emit`, `
|
|
11
|
+
* (`invocationId`, `session`, `signal`, `emit`, `ask`, `turnUsage`) — no pool, no sandbox, no
|
|
12
12
|
* logger. The error contract: an expected
|
|
13
13
|
* outcome ("not found", "no results") stays in the ok channel as a data
|
|
14
14
|
* variant (`ok({ found: false })`); an unexpected failure is an `err(ToolError)`
|
|
@@ -62,6 +62,30 @@ export function readToolResultImages(value) {
|
|
|
62
62
|
const entries = Array.isArray(carried) ? carried : [carried];
|
|
63
63
|
return entries.filter(isToolResultImage);
|
|
64
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* The reserved key that carries the call record on a tool ok value.
|
|
67
|
+
*
|
|
68
|
+
* A call record is what a call leaves for process-local state, for example the
|
|
69
|
+
* lineage collector of a sandbox step. A replay returns the cached result of a
|
|
70
|
+
* step-mode call and never runs its body, thus a side effect of the body on
|
|
71
|
+
* such state is lost on recovery. The record goes into the cached dispatch
|
|
72
|
+
* instead, and the loop hands it to `foldCallRecord` after the call settles, on
|
|
73
|
+
* the first run and on each replay alike.
|
|
74
|
+
*
|
|
75
|
+
* It is a symbol, thus `JSON.stringify` omits it and the model never reads it.
|
|
76
|
+
* The record itself must be plain JSON, because the step cache serializes it.
|
|
77
|
+
*/
|
|
78
|
+
export const toolCallRecordKey = Symbol("toolCallRecord");
|
|
79
|
+
/** Attach a call record to a tool ok value. The value keeps its own fields. */
|
|
80
|
+
export function withToolCallRecord(value, record) {
|
|
81
|
+
return { ...value, [toolCallRecordKey]: record };
|
|
82
|
+
}
|
|
83
|
+
/** Read the call record that a tool ok value carries, or `undefined` when it carries none. */
|
|
84
|
+
export function readToolCallRecord(value) {
|
|
85
|
+
if (typeof value !== "object" || value === null)
|
|
86
|
+
return undefined;
|
|
87
|
+
return value[toolCallRecordKey];
|
|
88
|
+
}
|
|
65
89
|
/**
|
|
66
90
|
* Package a `Tool`. The emitted JSON Schema must have a top-level
|
|
67
91
|
* `"type": "object"` — model tool calling rejects anything else. A `z.discriminatedUnion`
|
|
@@ -95,6 +119,9 @@ export function defineTool(def) {
|
|
|
95
119
|
// declares no result hook carries no key, thus "has a hook" is one
|
|
96
120
|
// property check on either side.
|
|
97
121
|
...(typeof def.describeResult === "function" ? { describeResult: def.describeResult } : {}),
|
|
122
|
+
// The loop passes back only a record that this tool's `execute`
|
|
123
|
+
// attached, thus the record has the declared type.
|
|
124
|
+
...(typeof def.foldCallRecord === "function" ? { foldCallRecord: def.foldCallRecord } : {}),
|
|
98
125
|
execute: def.execute,
|
|
99
126
|
};
|
|
100
127
|
}
|
|
@@ -274,7 +274,7 @@ export function buildAdHocPlan(request, route, createdAt = new Date().toISOStrin
|
|
|
274
274
|
* would pay a file read on every ad hoc launch to learn nothing — while the
|
|
275
275
|
* router, with no resolution, already keeps every entry that parses.
|
|
276
276
|
*/
|
|
277
|
-
function adHocPackageResolver(deps) {
|
|
277
|
+
function adHocPackageResolver(deps, analysisId) {
|
|
278
278
|
if (!deps.farmLockFile && !deps.imagePackagesFile && !deps.readPoolInventory)
|
|
279
279
|
return undefined;
|
|
280
280
|
const inventory = {
|
|
@@ -283,7 +283,7 @@ function adHocPackageResolver(deps) {
|
|
|
283
283
|
...(deps.readPoolInventory === undefined ? {} : { readPoolInventory: deps.readPoolInventory }),
|
|
284
284
|
};
|
|
285
285
|
return async (names) => {
|
|
286
|
-
const read = await readInventorySections(inventory);
|
|
286
|
+
const read = await readInventorySections(inventory, analysisId);
|
|
287
287
|
// An inventory that cannot answer must not drop a name: the router
|
|
288
288
|
// keeps every parsed entry, and the link pass judges at launch.
|
|
289
289
|
if (read.kind === "unavailable")
|
|
@@ -296,7 +296,7 @@ async function persistedAdHocPlan(deps, args) {
|
|
|
296
296
|
const existing = unwrapOrThrow(await loadPlan(deps.pool, args.planId, { analysisId: args.analysisId }));
|
|
297
297
|
if (existing)
|
|
298
298
|
return validateStoredPlan(existing, args.planId);
|
|
299
|
-
const resolvePackages = adHocPackageResolver(deps);
|
|
299
|
+
const resolvePackages = adHocPackageResolver(deps, args.analysisId);
|
|
300
300
|
const route = await routeAdHocRequest({
|
|
301
301
|
provider: deps.utilityProvider,
|
|
302
302
|
model: deps.utilityModel,
|