@hue-run/sdk 0.9.0 → 0.11.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/CLI.md +240 -49
- package/ENVIRONMENTS.md +48 -9
- package/EVALUATIONS.md +41 -21
- package/README.md +70 -30
- package/dist/cli/eval-direct.d.ts +12 -1
- package/dist/cli/eval-direct.js +145 -33
- package/dist/cli/eval.d.ts +28 -1
- package/dist/cli/eval.js +504 -81
- package/dist/cli/listen.d.ts +76 -0
- package/dist/cli/listen.js +816 -0
- package/dist/cli/mcp.d.ts +65 -7
- package/dist/cli/mcp.js +271 -73
- package/dist/client.d.ts +7 -4
- package/dist/client.js +36 -10
- package/dist/evals/checkpoint.d.ts +15 -1
- package/dist/evals/checkpoint.js +34 -3
- package/dist/evals/client.d.ts +24 -4
- package/dist/evals/client.js +92 -38
- package/dist/evals/environment-target.d.ts +18 -3
- package/dist/evals/environment-target.js +22 -10
- package/dist/evals/exit-cleanup.d.ts +4 -0
- package/dist/evals/exit-cleanup.js +26 -0
- package/dist/evals/files.d.ts +69 -3
- package/dist/evals/files.js +255 -42
- package/dist/evals/json.js +116 -9
- package/dist/evals/local-worker.d.ts +21 -3
- package/dist/evals/local-worker.js +14 -0
- package/dist/evals/runner.d.ts +45 -0
- package/dist/evals/runner.js +199 -21
- package/dist/evals/scenarios.d.ts +7 -5
- package/dist/evals/scenarios.js +71 -14
- package/dist/evals/scorer-publication.js +58 -3
- package/dist/evals/simulation.d.ts +17 -4
- package/dist/evals/simulation.js +8 -0
- package/dist/evals/types.d.ts +48 -0
- package/dist/evals/verdicts.d.ts +26 -2
- package/dist/evals/verdicts.js +72 -9
- package/dist/evals.d.ts +4 -3
- package/dist/evals.js +2 -2
- package/dist/inline-files.d.ts +4 -0
- package/dist/inline-files.js +48 -17
- package/dist/provider-tools.d.ts +12 -1
- package/dist/provider-tools.js +192 -106
- package/dist/safety.d.ts +7 -1
- package/dist/safety.js +9 -7
- package/dist/setup/cli.js +31 -8
- package/dist/setup/peers.d.ts +13 -0
- package/dist/setup/peers.js +44 -0
- package/dist/snapshot.d.ts +2 -2
- package/dist/snapshot.js +47 -12
- package/dist/tool-definitions.d.ts +18 -0
- package/dist/tool-definitions.js +232 -0
- package/dist/transport.js +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/cli/eval.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { ExperimentCase, LocalFile } from "../evals/types.js";
|
|
2
2
|
import { TargetResult } from "../evals/types.js";
|
|
3
3
|
import { type SimulationTargetContext } from "../evals/simulation.js";
|
|
4
|
+
import { type ExperimentVerdicts } from "../evals/verdicts.js";
|
|
4
5
|
import type { JsonValue } from "../types.js";
|
|
5
6
|
/** Adapter contract: the module's `default` or `runMyAgent` export. */
|
|
6
|
-
export type EvalAdapter = (inputs: JsonValue, context: SimulationTargetContext) => JsonValue | undefined | Promise<JsonValue | undefined>;
|
|
7
|
+
export type EvalAdapter = (inputs: JsonValue, context: SimulationTargetContext) => JsonValue | TargetResult | undefined | Promise<JsonValue | TargetResult | undefined>;
|
|
7
8
|
/**
|
|
8
9
|
* Context of a direct (file) case: pinned input files in, generated documents out. The same
|
|
9
10
|
* adapter module serves both modes; `mode` tells it which context it received.
|
|
@@ -20,6 +21,32 @@ export interface DirectTargetContext {
|
|
|
20
21
|
signal?: AbortSignal;
|
|
21
22
|
}
|
|
22
23
|
export type DirectEvalAdapter = (inputs: JsonValue, context: DirectTargetContext) => JsonValue | TargetResult | undefined | Promise<JsonValue | TargetResult | undefined>;
|
|
24
|
+
export interface Output {
|
|
25
|
+
/** Human progress lines: stdout normally, stderr with --json. */
|
|
26
|
+
log(line: string): void;
|
|
27
|
+
/** Diagnostics; always stderr. */
|
|
28
|
+
error(line: string): void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Spawns the agent command once in its own process group and returns its trimmed stdout. A
|
|
32
|
+
* timeout or Ctrl+C stops the agent the shell started, not only the shell: a survivor would still
|
|
33
|
+
* hold a world token and could write after Hue recorded the case as failed. The group is signalled
|
|
34
|
+
* even once the shell has exited, since a compound command's agent can outlive it, and a stopped
|
|
35
|
+
* command settles only when nothing in the group is left. A command that exits normally but
|
|
36
|
+
* leaves processes behind has them stopped the same way before it settles, so none can touch its
|
|
37
|
+
* outputs while they are collected. Once the group is found empty it is never signalled again,
|
|
38
|
+
* since its ID could be reused. Windows has no process group to signal, so the child alone is
|
|
39
|
+
* stopped there.
|
|
40
|
+
*/
|
|
41
|
+
export declare function spawnAgentCommand(command: string, options: {
|
|
42
|
+
cwd?: string;
|
|
43
|
+
env: Record<string, string | undefined>;
|
|
44
|
+
stdin?: string;
|
|
45
|
+
timeoutSeconds: number;
|
|
46
|
+
signal?: AbortSignal;
|
|
47
|
+
}): Promise<string>;
|
|
48
|
+
export declare function renderTable(verdicts: ExperimentVerdicts, output: Output): void;
|
|
49
|
+
export declare function explain(error: unknown): string;
|
|
23
50
|
/**
|
|
24
51
|
* `hue eval`: runs a local adapter or command against a Scenario or eval set through
|
|
25
52
|
* `runSimulation`, or registers it as an outbound worker through `runLocalAgent`.
|