humanish 0.115.0 → 0.116.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/CHANGELOG.md +22 -0
- package/README.md +7 -6
- package/TELEMETRY.md +6 -0
- package/dist/actors/codex/app-server-ui.js +11 -4
- package/dist/actors/computer-use/loop/debrief.js +61 -27
- package/dist/actors/scripted-browser/steps.js +6 -5
- package/dist/analysis/analysis-limits.d.ts +35 -0
- package/dist/analysis/analysis-limits.js +41 -0
- package/dist/analysis/validation.js +14 -21
- package/dist/cli/commands/analyze.js +2 -1
- package/dist/cli/commands/notes.js +2 -1
- package/dist/cli/commands/run-signals.js +5 -1
- package/dist/cli/commands/runs.js +2 -1
- package/dist/cli/commands/setup.js +3 -3
- package/dist/cli/commands/study-format.d.ts +5 -2
- package/dist/cli/commands/study-format.js +29 -9
- package/dist/cli/commands/study-route-computer-use.js +2 -2
- package/dist/cli/commands/study-route-scripted.js +1 -1
- package/dist/cli/commands/tui.js +59 -17
- package/dist/cli/doctor.js +9 -2
- package/dist/cli/findings-text.d.ts +5 -0
- package/dist/cli/findings-text.js +169 -0
- package/dist/cli/findings.d.ts +0 -4
- package/dist/cli/findings.js +5 -167
- package/dist/cli/io.js +6 -1
- package/dist/cli/update-check.js +4 -1
- package/dist/comms/connections.js +4 -3
- package/dist/comms/setup.js +18 -12
- package/dist/evidence/redaction.js +9 -1
- package/dist/evidence/secret-scrub.d.ts +15 -5
- package/dist/evidence/secret-scrub.js +67 -9
- package/dist/feedback/draft.js +1 -1
- package/dist/feedback/export-bundle.js +18 -14
- package/dist/feedback/feedback.js +25 -7
- package/dist/guest/desktop-keys.js +59 -5
- package/dist/keys/key-resolution.d.ts +9 -0
- package/dist/keys/key-resolution.js +60 -48
- package/dist/keys/key-status.d.ts +2 -0
- package/dist/keys/key-status.js +9 -16
- package/dist/observer/pinned-files.js +1 -1
- package/dist/observer/render.js +3 -2
- package/dist/observer-app.html +7 -7
- package/dist/routes/computer-use/bundle-parts.d.ts +4 -4
- package/dist/routes/computer-use/bundle-parts.js +2 -2
- package/dist/routes/computer-use/bundle.d.ts +4 -5
- package/dist/routes/computer-use/bundle.js +1 -3
- package/dist/routes/computer-use/fanout-records.js +10 -11
- package/dist/routes/computer-use/live-phase.d.ts +1 -1
- package/dist/routes/computer-use/live-phase.js +0 -1
- package/dist/routes/computer-use/participant-execution.d.ts +3 -2
- package/dist/routes/computer-use/participant-runs.d.ts +6 -2
- package/dist/routes/computer-use/participant-runs.js +9 -5
- package/dist/routes/computer-use/plan.d.ts +3 -0
- package/dist/routes/computer-use/plan.js +14 -11
- package/dist/routes/computer-use/rerun-selection.js +2 -2
- package/dist/routes/computer-use/result.js +3 -6
- package/dist/routes/computer-use/setup.d.ts +4 -6
- package/dist/routes/computer-use/setup.js +2 -6
- package/dist/routes/computer-use/single-bundle.d.ts +4 -5
- package/dist/routes/computer-use/single-bundle.js +22 -25
- package/dist/routes/computer-use/subject-projection.d.ts +4 -8
- package/dist/routes/computer-use/subject-projection.js +9 -31
- package/dist/routes/computer-use/types.d.ts +4 -41
- package/dist/routes/scripted/scenario.js +28 -12
- package/dist/routes/scripted/session-result.js +6 -3
- package/dist/routes/shared-world/bundle-records.js +2 -8
- package/dist/routes/shared-world/participant-specs.d.ts +0 -2
- package/dist/routes/shared-world/participant-specs.js +1 -20
- package/dist/routes/shared-world/plan.d.ts +3 -0
- package/dist/routes/shared-world/plan.js +23 -3
- package/dist/routes/shared-world/setup.js +2 -2
- package/dist/routes/terminal/ledger.d.ts +9 -9
- package/dist/routes/terminal/ledger.js +63 -40
- package/dist/routes/terminal/live-finish.js +7 -10
- package/dist/routes/terminal/plan.d.ts +3 -0
- package/dist/routes/terminal/plan.js +8 -5
- package/dist/routes/terminal/token-usage.d.ts +1 -2
- package/dist/routes/terminal/token-usage.js +4 -6
- package/dist/routes/terminal/types.d.ts +9 -1
- package/dist/run/bundle-shape.js +6 -1
- package/dist/run/bundle.d.ts +5 -3
- package/dist/run/contained-output.d.ts +53 -5
- package/dist/run/contained-output.js +141 -42
- package/dist/run/detail.d.ts +2 -1
- package/dist/run/detail.js +12 -7
- package/dist/run/escape-sequences.d.ts +11 -0
- package/dist/run/escape-sequences.js +93 -0
- package/dist/run/evidence-files.d.ts +8 -8
- package/dist/run/evidence-files.js +19 -23
- package/dist/run/locate.d.ts +32 -3
- package/dist/run/locate.js +45 -40
- package/dist/run/notes.d.ts +0 -8
- package/dist/run/notes.js +5 -51
- package/dist/run/outcomes.d.ts +24 -0
- package/dist/run/outcomes.js +19 -0
- package/dist/run/paths.d.ts +2 -0
- package/dist/run/paths.js +5 -1
- package/dist/run/preflight-receipts.js +13 -8
- package/dist/run/project.js +7 -4
- package/dist/run/reclaim-outcomes.d.ts +8 -6
- package/dist/run/reclaim-outcomes.js +10 -6
- package/dist/run/reclaim.d.ts +5 -0
- package/dist/run/reclaim.js +43 -16
- package/dist/run/run-clock.d.ts +50 -0
- package/dist/run/run-clock.js +66 -0
- package/dist/run/run.js +5 -2
- package/dist/run/sandbox-ids.d.ts +7 -2
- package/dist/run/sandbox-ids.js +27 -11
- package/dist/run/secrets.d.ts +2 -1
- package/dist/run/secrets.js +18 -22
- package/dist/run/stored-runs.js +14 -7
- package/dist/run/transient-comms-secrets.js +6 -17
- package/dist/run-study.js +22 -13
- package/dist/study/adapter-scorer-loader.js +6 -4
- package/dist/study/discover.js +9 -6
- package/dist/study/init-paths.js +7 -5
- package/dist/study/persona-resolve.d.ts +2 -2
- package/dist/study/persona-resolve.js +9 -5
- package/dist/study/plan-types.d.ts +2 -2
- package/dist/study/plan.d.ts +5 -3
- package/dist/study/plan.js +18 -9
- package/dist/study/preflight-probes.js +11 -3
- package/dist/study/preflight.js +9 -5
- package/dist/study/summary.d.ts +8 -2
- package/dist/study/summary.js +20 -22
- package/dist/study/warnings.d.ts +19 -12
- package/dist/study/warnings.js +38 -17
- package/dist/substrates/e2b/connection.d.ts +12 -0
- package/dist/substrates/e2b/connection.js +35 -0
- package/dist/substrates/e2b/desktop-executor.d.ts +1 -3
- package/dist/substrates/e2b/desktop-executor.js +42 -9
- package/dist/substrates/e2b/lifetime.d.ts +24 -4
- package/dist/substrates/e2b/lifetime.js +41 -4
- package/dist/substrates/e2b/sandbox.d.ts +4 -3
- package/dist/substrates/e2b/sandbox.js +13 -18
- package/dist/substrates/e2b/sdk.d.ts +20 -9
- package/dist/substrates/local/capacity.d.ts +18 -2
- package/dist/substrates/local/capacity.js +21 -2
- package/dist/substrates/local/runtime-host.js +21 -14
- package/dist/substrates/local/runtime.js +3 -11
- package/dist/tui/contract.d.ts +30 -5
- package/dist/tui/contract.js +4 -1
- package/dist/tui-app.js +149 -147
- package/dist/verify/artifacts.d.ts +9 -2
- package/dist/verify/artifacts.js +37 -13
- package/dist/verify/liveness.js +19 -5
- package/dist/verify/verify.js +54 -27
- package/docs/architecture/guest-desktop.md +7 -2
- package/docs/architecture/state-driven-executor.md +4 -2
- package/docs/contracts/run-bundle.md +18 -10
- package/docs/contracts/schemas.md +27 -18
- package/docs/contracts/study-analysis.md +10 -1
- package/docs/product/automatic-analysis.md +7 -1
- package/package.json +2 -2
|
@@ -4,7 +4,7 @@ import { tmpdir } from "node:os";
|
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { promisify } from "node:util";
|
|
6
6
|
import { cli } from "../../cli/invocation.js";
|
|
7
|
-
import {
|
|
7
|
+
import { limaVmSize, machineSize, vmSizeProblem, } from "./capacity.js";
|
|
8
8
|
import { plural } from "../../run/text.js";
|
|
9
9
|
const exec = promisify(execFile);
|
|
10
10
|
export const LIMA_INSTANCE = "humanish-runtime";
|
|
@@ -124,22 +124,18 @@ export async function limaStatus(options = {}) {
|
|
|
124
124
|
export async function prepareLima(options = {}, progress) {
|
|
125
125
|
const status = await limaStatus(options);
|
|
126
126
|
const mac = machineSize(options.machine);
|
|
127
|
-
const current = status
|
|
128
|
-
? defaultVmSize(mac)
|
|
129
|
-
: { memoryGiB: status.size.memoryBytes / 1024 ** 3, cpus: status.size.cpus };
|
|
130
|
-
const size = { ...current, ...options.size };
|
|
127
|
+
const current = limaVmSize(status, mac);
|
|
131
128
|
if (options.size !== undefined) {
|
|
129
|
+
const size = sizeToApply(current, options.size);
|
|
132
130
|
const problem = vmSizeProblem(size, mac);
|
|
133
131
|
if (problem !== undefined)
|
|
134
132
|
throw new Error(problem);
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
await resizeLima(size, status.ready, options, progress);
|
|
142
|
-
return;
|
|
133
|
+
// An existing VM whose size Lima did not list gets the asked-for size without a comparison.
|
|
134
|
+
const differs = current === undefined || size.cpus !== current.cpus || size.memoryGiB !== current.memoryGiB;
|
|
135
|
+
if (status.exists && differs) {
|
|
136
|
+
await resizeLima(size, status.ready, options, progress);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
143
139
|
}
|
|
144
140
|
if (status.ready)
|
|
145
141
|
return;
|
|
@@ -153,7 +149,7 @@ export async function prepareLima(options = {}, progress) {
|
|
|
153
149
|
const work = await mkdtemp(path.join(tmpdir(), "humanish-lima-"));
|
|
154
150
|
try {
|
|
155
151
|
const file = path.join(work, "host.yaml");
|
|
156
|
-
await writeFile(file, limaTemplate(size), { mode: 0o600 });
|
|
152
|
+
await writeFile(file, limaTemplate(sizeToApply(current, options.size)), { mode: 0o600 });
|
|
157
153
|
await hostExec("limactl", ["start", "--tty=false", "--name", LIMA_INSTANCE, file], options, 15 * 60_000);
|
|
158
154
|
}
|
|
159
155
|
finally {
|
|
@@ -161,6 +157,17 @@ export async function prepareLima(options = {}, progress) {
|
|
|
161
157
|
}
|
|
162
158
|
}
|
|
163
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* The size to create or resize the VM at: the asked-for values over the VM's current size. Only an
|
|
162
|
+
* existing VM that lists no size has no current size, so there a value not asked for is unknown.
|
|
163
|
+
*/
|
|
164
|
+
function sizeToApply(current, asked = {}) {
|
|
165
|
+
const memoryGiB = asked.memoryGiB ?? current?.memoryGiB;
|
|
166
|
+
const cpus = asked.cpus ?? current?.cpus;
|
|
167
|
+
if (memoryGiB === undefined || cpus === undefined)
|
|
168
|
+
throw new Error(`limactl lists no size for the humanish Lima VM, so humanish cannot tell which ${memoryGiB === undefined ? "--memory" : "--cpus"} to keep. Run ${cli("runtime setup --memory <GiB> --cpus <n>")} with both values.`);
|
|
169
|
+
return { memoryGiB, cpus };
|
|
170
|
+
}
|
|
164
171
|
/** Lima changes the memory and CPUs of a stopped instance only. Running desktops keep it running. */
|
|
165
172
|
async function resizeLima(size, running, options, progress) {
|
|
166
173
|
if (running) {
|
|
@@ -6,24 +6,16 @@ import path from "node:path";
|
|
|
6
6
|
import { Readable, Transform } from "node:stream";
|
|
7
7
|
import { pipeline } from "node:stream/promises";
|
|
8
8
|
import { LOCAL_MEDIA_RUNTIME_RELEASES, LOCAL_RUNTIME_RELEASES } from "./runtime-release.js";
|
|
9
|
-
import {
|
|
9
|
+
import { limaCapacity, localCapacity, machineSize, } from "./capacity.js";
|
|
10
10
|
import { limaStatus, loadRuntimeArchive, prepareLima, runtimeArchitecture, runtimeDocker, runtimeExec, usesLima, } from "./runtime-host.js";
|
|
11
11
|
import { cli } from "../../cli/invocation.js";
|
|
12
12
|
const docker = async (args, options) => (await runtimeDocker(args, options)).stdout.trim();
|
|
13
13
|
const runtimeRelease = (options) => options.release ??
|
|
14
14
|
(options.media ? LOCAL_MEDIA_RUNTIME_RELEASES : LOCAL_RUNTIME_RELEASES)[runtimeArchitecture(options) ?? "amd64"];
|
|
15
|
-
/** Desktops the
|
|
15
|
+
/** Desktops the Lima VM holds (or setup would create), or this Linux machine. */
|
|
16
16
|
function runtimeCapacity(options, lima) {
|
|
17
|
-
if (lima === undefined)
|
|
18
|
-
return localCapacity("linux-host", machineSize(options.machine));
|
|
19
17
|
const machine = machineSize(options.machine);
|
|
20
|
-
|
|
21
|
-
return localCapacity("lima-vm", lima.size, { machine });
|
|
22
|
-
// An existing VM whose size Lima did not list has an unknown size, which no default replaces.
|
|
23
|
-
if (lima.exists)
|
|
24
|
-
return undefined;
|
|
25
|
-
const planned = defaultVmSize(machine);
|
|
26
|
-
return localCapacity("lima-vm", { memoryBytes: planned.memoryGiB * 1024 ** 3, cpus: planned.cpus }, { planned: true, machine });
|
|
18
|
+
return lima === undefined ? localCapacity("linux-host", machine) : limaCapacity(lima, machine);
|
|
27
19
|
}
|
|
28
20
|
/**
|
|
29
21
|
* How many desktops the local runtime holds, read without starting anything. Undefined when the
|
package/dist/tui/contract.d.ts
CHANGED
|
@@ -14,6 +14,13 @@ import type { CommsRecoveryEntry } from "../comms/lease-store.js";
|
|
|
14
14
|
interface TuiVersionInfo {
|
|
15
15
|
cli: string;
|
|
16
16
|
}
|
|
17
|
+
/** One provider key as `humanish keys` lists it. Never its value. */
|
|
18
|
+
export interface TuiKeyStatus {
|
|
19
|
+
name: string;
|
|
20
|
+
set: boolean;
|
|
21
|
+
/** The line `humanish keys` prints for this key: what it is for, and its source or how to add it. */
|
|
22
|
+
line: string;
|
|
23
|
+
}
|
|
17
24
|
/**
|
|
18
25
|
* What the surface may do to the project. Deliberately a small, explicit list rather than a handle
|
|
19
26
|
* to the whole library: the set of verbs a stakeholder surface can perform should be readable in
|
|
@@ -36,6 +43,10 @@ export interface TuiCapabilities {
|
|
|
36
43
|
message: string;
|
|
37
44
|
}>;
|
|
38
45
|
};
|
|
46
|
+
/** The provider keys `humanish keys` lists, in its order. A key is entered through the host. */
|
|
47
|
+
keys?: {
|
|
48
|
+
status(): Promise<TuiKeyStatus[]>;
|
|
49
|
+
};
|
|
39
50
|
/** Read every run in the project, cheapest source first. */
|
|
40
51
|
readRunIndex(cwd: string, options?: ReadRunIndexOptions): Promise<RunIndexResult>;
|
|
41
52
|
/**
|
|
@@ -82,8 +93,11 @@ export interface TuiCapabilities {
|
|
|
82
93
|
initProject(cwd: string): Promise<TuiActionResult>;
|
|
83
94
|
}
|
|
84
95
|
export interface TuiOptions {
|
|
85
|
-
/**
|
|
86
|
-
|
|
96
|
+
/**
|
|
97
|
+
* Return to the keys list or the email connection after the host-owned hidden prompt has
|
|
98
|
+
* finished, showing `connectionNotice`.
|
|
99
|
+
*/
|
|
100
|
+
initialScreen?: "keys" | "connections";
|
|
87
101
|
connectionNotice?: string;
|
|
88
102
|
/** The project the surface is reading. Already resolved by the CLI. */
|
|
89
103
|
cwd: string;
|
|
@@ -100,18 +114,29 @@ export interface TuiOptions {
|
|
|
100
114
|
exitAfterFirstFrame?: boolean;
|
|
101
115
|
}
|
|
102
116
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
117
|
+
* A key the person asked to enter. The surface unmounts, the host asks for the value with hidden
|
|
118
|
+
* input and stores it, then mounts the surface again on `initialScreen`.
|
|
105
119
|
*/
|
|
106
120
|
export type TuiHandoff = {
|
|
107
121
|
action: "agentmail-key";
|
|
122
|
+
} | {
|
|
123
|
+
action: "provider-key";
|
|
124
|
+
name: string;
|
|
108
125
|
};
|
|
126
|
+
/**
|
|
127
|
+
* Start the surface. Resolves with the process exit code when the operator quits, or with a key
|
|
128
|
+
* handoff; the TUI owns the screen until then, so the CLI must not write to stdout while this is
|
|
129
|
+
* pending.
|
|
130
|
+
*/
|
|
109
131
|
export type StartTui = (options: TuiOptions) => Promise<number | TuiHandoff>;
|
|
110
132
|
/** The shape `dist/tui-app.js` exports. Asserted at the load boundary in cli/commands/tui.ts. */
|
|
111
133
|
export interface TuiModule {
|
|
112
134
|
startTui: StartTui;
|
|
113
135
|
}
|
|
114
|
-
/**
|
|
136
|
+
/**
|
|
137
|
+
* Node version the Ink runtime requires: ink 8.0.0, which tui/package.json pins, declares
|
|
138
|
+
* `engines.node` `>=22`.
|
|
139
|
+
*/
|
|
115
140
|
export declare const TUI_MIN_NODE_MAJOR = 22;
|
|
116
141
|
/**
|
|
117
142
|
* Whether this runtime can host the surface. Kept here, beside the reason, so the CLI's refusal and
|
package/dist/tui/contract.js
CHANGED
|
@@ -13,7 +13,10 @@
|
|
|
13
13
|
// It also makes the UI testable without a terminal: a test hands `startTui` a fake index and reads
|
|
14
14
|
// the frames back.
|
|
15
15
|
import { cli } from "../cli/invocation.js";
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Node version the Ink runtime requires: ink 8.0.0, which tui/package.json pins, declares
|
|
18
|
+
* `engines.node` `>=22`.
|
|
19
|
+
*/
|
|
17
20
|
export const TUI_MIN_NODE_MAJOR = 22;
|
|
18
21
|
/**
|
|
19
22
|
* Whether this runtime can host the surface. Kept here, beside the reason, so the CLI's refusal and
|