humanish 0.112.0 → 0.113.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 +19 -0
- package/README.md +11 -0
- package/TELEMETRY.md +21 -0
- package/dist/actors/codex/restricted-participant-policy.d.ts +21 -1
- package/dist/actors/codex/restricted-participant-policy.js +20 -2
- package/dist/actors/codex/restricted-participant.d.ts +1 -1
- package/dist/actors/codex/restricted-participant.js +2 -1
- package/dist/actors/computer-use/loop/debrief.d.ts +12 -4
- package/dist/actors/computer-use/loop/debrief.js +57 -20
- package/dist/actors/computer-use/loop/ending.d.ts +5 -2
- package/dist/actors/computer-use/loop/impressions.d.ts +14 -0
- package/dist/actors/computer-use/loop/impressions.js +40 -0
- package/dist/actors/computer-use/loop/session.d.ts +3 -1
- package/dist/actors/computer-use/loop/session.js +2 -0
- package/dist/actors/computer-use/loop/trace.js +2 -0
- package/dist/actors/computer-use/loop/types.d.ts +8 -1
- package/dist/actors/computer-use/loop.d.ts +2 -1
- package/dist/actors/computer-use/loop.js +15 -3
- package/dist/actors/computer-use/openai-conversation.d.ts +9 -4
- package/dist/actors/computer-use/openai-conversation.js +53 -24
- package/dist/actors/computer-use/openai-provider.js +18 -12
- package/dist/actors/contract.d.ts +43 -3
- package/dist/actors/contract.js +13 -0
- package/dist/analysis/evidence-sources.d.ts +3 -1
- package/dist/analysis/evidence-sources.js +10 -1
- package/dist/analysis/evidence.js +2 -2
- package/dist/analysis/execute.d.ts +1 -1
- package/dist/analysis/execute.js +3 -1
- package/dist/cli/commands/runs.js +33 -10
- package/dist/cli/commands/setup.js +95 -6
- package/dist/cli/commands/study-format.js +7 -4
- package/dist/cli/commands/study.js +1 -1
- package/dist/cli/commands/tui.js +1 -1
- package/dist/cli/doctor.d.ts +2 -0
- package/dist/cli/doctor.js +18 -0
- package/dist/cli/io.d.ts +2 -0
- package/dist/cli/program.js +35 -1
- package/dist/cli/secret-prompt.d.ts +5 -1
- package/dist/cli/secret-prompt.js +6 -2
- package/dist/cli/update-check-worker.d.ts +1 -0
- package/dist/cli/update-check-worker.js +5 -0
- package/dist/cli/update-check.d.ts +46 -0
- package/dist/cli/update-check.js +203 -0
- package/dist/feedback/draft.js +18 -0
- package/dist/keys/key-resolution.js +2 -0
- package/dist/keys/key-status.d.ts +37 -0
- package/dist/keys/key-status.js +68 -0
- package/dist/observer-app.html +4 -4
- package/dist/routes/computer-use/local-vm.js +9 -2
- package/dist/routes/computer-use/participant-desktop.d.ts +6 -0
- package/dist/routes/computer-use/participant-execution.js +9 -1
- package/dist/routes/computer-use/rerun-selection.js +23 -21
- package/dist/routes/computer-use/result.js +3 -2
- package/dist/routes/computer-use/self-report.js +7 -1
- package/dist/routes/computer-use/setup.js +14 -0
- package/dist/routes/computer-use/types.d.ts +4 -1
- package/dist/routes/shared-world/bundle-records.js +8 -7
- package/dist/routes/shared-world/bundle.js +1 -1
- package/dist/run/detail.js +4 -4
- package/dist/run/participant-caption.d.ts +2 -1
- package/dist/run/participant-caption.js +11 -1
- package/dist/run/participant-records.d.ts +3 -1
- package/dist/run/participant-records.js +6 -0
- package/dist/run-study.js +17 -1
- package/dist/study/discover.js +6 -1
- package/dist/study/doctor.d.ts +2 -0
- package/dist/study/doctor.js +45 -7
- package/dist/study/init-templates.js +10 -5
- package/dist/study/plan.js +3 -2
- package/dist/study/preflight-result.d.ts +1 -0
- package/dist/study/preflight-result.js +1 -1
- package/dist/study/preflight.d.ts +2 -0
- package/dist/study/preflight.js +54 -14
- package/dist/study/warnings.d.ts +5 -0
- package/dist/study/warnings.js +79 -2
- package/dist/substrates/local/capacity.d.ts +75 -0
- package/dist/substrates/local/capacity.js +143 -0
- package/dist/substrates/local/firecracker-desktop.d.ts +8 -0
- package/dist/substrates/local/firecracker-desktop.js +34 -3
- package/dist/substrates/local/runtime-host.d.ts +16 -3
- package/dist/substrates/local/runtime-host.js +49 -4
- package/dist/substrates/local/runtime.d.ts +10 -0
- package/dist/substrates/local/runtime.js +44 -5
- package/dist/tui-app.js +58 -58
- package/docs/architecture/actor-contract.md +20 -6
- package/docs/contracts/feedback.md +8 -1
- package/docs/contracts/schemas.md +57 -34
- package/docs/contracts/study-analysis.md +15 -0
- package/package.json +1 -1
- package/skills/humanish/SKILL.md +21 -10
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { LocalFirecrackerAssets } from "./firecracker-desktop.js";
|
|
2
|
+
import { type LocalCapacity, type VmSize } from "./capacity.js";
|
|
2
3
|
import { type RuntimeHostOptions } from "./runtime-host.js";
|
|
3
4
|
export interface LocalRuntimeRelease {
|
|
4
5
|
url: string;
|
|
@@ -11,13 +12,22 @@ export interface LocalRuntimeStatus {
|
|
|
11
12
|
installed: boolean;
|
|
12
13
|
message: string;
|
|
13
14
|
assets?: LocalFirecrackerAssets;
|
|
15
|
+
/** How many desktops fit, when the VM or this machine could be read. */
|
|
16
|
+
capacity?: LocalCapacity;
|
|
14
17
|
}
|
|
15
18
|
interface RuntimeOptions extends RuntimeHostOptions {
|
|
16
19
|
media?: boolean;
|
|
20
|
+
/** The Lima VM size `runtime setup --memory --cpus` asks for. Macs only. */
|
|
21
|
+
size?: Partial<VmSize>;
|
|
17
22
|
progress?: (message: string) => void;
|
|
18
23
|
/** Explicit source-build/test override; never provided by a participant. */
|
|
19
24
|
release?: LocalRuntimeRelease;
|
|
20
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* How many desktops the local runtime holds, read without starting anything. Undefined when the
|
|
28
|
+
* host cannot be read, such as a Mac without Lima: preparing the runtime reports that.
|
|
29
|
+
*/
|
|
30
|
+
export declare function localRuntimeCapacity(options?: RuntimeHostOptions): Promise<LocalCapacity | undefined>;
|
|
21
31
|
/** Read-only host and cache inspection. Never pulls an image or starts a container. */
|
|
22
32
|
export declare function localRuntimeStatus(options?: RuntimeOptions): Promise<LocalRuntimeStatus>;
|
|
23
33
|
/** Docker owns the installed image/cache. The archive is verified before docker load. */
|
|
@@ -6,30 +6,67 @@ 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 { defaultVmSize, localCapacity, machineSize, } from "./capacity.js";
|
|
9
10
|
import { limaStatus, loadRuntimeArchive, prepareLima, runtimeArchitecture, runtimeDocker, runtimeExec, usesLima, } from "./runtime-host.js";
|
|
10
11
|
import { cli } from "../../cli/invocation.js";
|
|
11
12
|
const docker = async (args, options) => (await runtimeDocker(args, options)).stdout.trim();
|
|
12
13
|
const runtimeRelease = (options) => options.release ??
|
|
13
14
|
(options.media ? LOCAL_MEDIA_RUNTIME_RELEASES : LOCAL_RUNTIME_RELEASES)[runtimeArchitecture(options) ?? "amd64"];
|
|
15
|
+
/** Desktops the existing Lima VM holds, the VM setup would create, or this Linux machine. */
|
|
16
|
+
function runtimeCapacity(options, lima) {
|
|
17
|
+
if (lima === undefined)
|
|
18
|
+
return localCapacity("linux-host", machineSize(options.machine));
|
|
19
|
+
const machine = machineSize(options.machine);
|
|
20
|
+
if (lima.size !== undefined)
|
|
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 });
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* How many desktops the local runtime holds, read without starting anything. Undefined when the
|
|
30
|
+
* host cannot be read, such as a Mac without Lima: preparing the runtime reports that.
|
|
31
|
+
*/
|
|
32
|
+
export async function localRuntimeCapacity(options = {}) {
|
|
33
|
+
if (runtimeArchitecture(options) === undefined)
|
|
34
|
+
return undefined;
|
|
35
|
+
if (!usesLima(options))
|
|
36
|
+
return runtimeCapacity(options, undefined);
|
|
37
|
+
try {
|
|
38
|
+
return runtimeCapacity(options, await limaStatus(options));
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
14
44
|
/** Read-only host and cache inspection. Never pulls an image or starts a container. */
|
|
15
45
|
export async function localRuntimeStatus(options = {}) {
|
|
16
|
-
const architecture = runtimeArchitecture(options)
|
|
46
|
+
const architecture = runtimeArchitecture(options);
|
|
17
47
|
if (!architecture)
|
|
18
48
|
return {
|
|
19
49
|
ok: false,
|
|
20
50
|
installed: false,
|
|
21
51
|
message: "Local browsers need Linux x64 or an M3-or-newer Mac with Lima.",
|
|
22
52
|
};
|
|
23
|
-
|
|
53
|
+
let lima;
|
|
54
|
+
if (usesLima(options)) {
|
|
24
55
|
try {
|
|
25
|
-
|
|
26
|
-
if (!status.ready)
|
|
27
|
-
return { ok: true, installed: false, message: status.message };
|
|
56
|
+
lima = await limaStatus(options);
|
|
28
57
|
}
|
|
29
58
|
catch (error) {
|
|
30
59
|
return { ok: false, installed: false, message: error.message };
|
|
31
60
|
}
|
|
32
61
|
}
|
|
62
|
+
const capacity = runtimeCapacity(options, lima);
|
|
63
|
+
const sized = capacity === undefined ? {} : { capacity };
|
|
64
|
+
if (lima !== undefined && !lima.ready)
|
|
65
|
+
return { ok: true, installed: false, message: lima.message, ...sized };
|
|
66
|
+
return { ...(await engineStatus(options, architecture, lima !== undefined)), ...sized };
|
|
67
|
+
}
|
|
68
|
+
/** The Docker engine, devices and cached image the desktops run on. */
|
|
69
|
+
async function engineStatus(options, architecture, lima) {
|
|
33
70
|
const env = options.env ?? process.env;
|
|
34
71
|
if (!lima && env.DOCKER_HOST && !env.DOCKER_HOST.startsWith("unix://")) {
|
|
35
72
|
return {
|
|
@@ -142,6 +179,8 @@ export async function localRuntimeStatus(options = {}) {
|
|
|
142
179
|
export async function prepareLocalRuntime(options = {}) {
|
|
143
180
|
if (!runtimeArchitecture(options))
|
|
144
181
|
throw new Error((await localRuntimeStatus(options)).message);
|
|
182
|
+
if (options.size !== undefined && !usesLima(options))
|
|
183
|
+
throw new Error("--memory and --cpus size the humanish Lima VM, which runs only on a Mac. On Linux, desktops use this machine's memory and CPUs directly.");
|
|
145
184
|
if (usesLima(options))
|
|
146
185
|
await prepareLima(options, options.progress);
|
|
147
186
|
const before = await localRuntimeStatus(options);
|