humanish 0.116.0 → 0.118.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 +40 -0
- package/dist/actors/codex/restricted-participant-policy.d.ts +0 -2
- package/dist/actors/codex/restricted-participant-policy.js +4 -32
- package/dist/actors/codex/restricted-participant.d.ts +5 -0
- package/dist/actors/codex/restricted-participant.js +3 -2
- package/dist/actors/computer-use/actor.d.ts +4 -0
- package/dist/actors/computer-use/actor.js +2 -0
- package/dist/actors/computer-use/loop/actions.d.ts +4 -4
- package/dist/actors/computer-use/loop/actions.js +25 -18
- package/dist/actors/computer-use/loop/session.d.ts +3 -0
- package/dist/actors/computer-use/loop/session.js +9 -1
- package/dist/actors/computer-use/loop/trace.js +1 -0
- package/dist/actors/computer-use/loop/types.d.ts +16 -14
- package/dist/actors/computer-use/loop.d.ts +1 -1
- package/dist/actors/computer-use/loop.js +1 -1
- package/dist/actors/computer-use/wait.d.ts +74 -0
- package/dist/actors/computer-use/wait.js +100 -0
- package/dist/actors/contract.d.ts +14 -0
- package/dist/analysis/admission.d.ts +7 -2
- package/dist/analysis/admission.js +12 -3
- package/dist/analysis/automatic-config.d.ts +6 -1
- package/dist/analysis/automatic-config.js +12 -11
- package/dist/analysis/execute.d.ts +19 -7
- package/dist/analysis/execute.js +55 -17
- package/dist/browser-control/protocol.d.ts +86 -6
- package/dist/browser-control/protocol.js +13 -6
- package/dist/cli/commands/analyze.js +2 -1
- package/dist/cli/commands/study-format.js +8 -11
- package/dist/cli/commands/study-route-computer-use.js +2 -2
- package/dist/cli/commands/study-route-scripted.js +2 -2
- package/dist/cli/commands/study-route-shared-world.js +5 -3
- package/dist/cli/commands/study-route-terminal.js +2 -2
- package/dist/cli/commands/study-run.js +3 -3
- package/dist/cli/commands/study.js +2 -2
- package/dist/cli/doctor.js +11 -1
- package/dist/cli/io.js +3 -2
- package/dist/comms/lease-store.d.ts +1 -1
- package/dist/comms/lease-store.js +3 -2
- package/dist/comms/receiving-types.d.ts +2 -0
- package/dist/comms/receiving-types.js +2 -0
- package/dist/guest/desktop-executor.js +3 -1
- package/dist/observer-app.html +7 -7
- package/dist/routes/computer-use/e2b-desktop/prepare.js +40 -31
- package/dist/routes/computer-use/fanout-bundle.js +2 -1
- package/dist/routes/computer-use/fanout-records.js +2 -1
- package/dist/routes/computer-use/local-vm.js +5 -2
- package/dist/routes/computer-use/participant-model.js +9 -0
- package/dist/routes/computer-use/participant-runs.js +3 -9
- package/dist/routes/computer-use/plan.d.ts +3 -1
- package/dist/routes/computer-use/plan.js +29 -9
- package/dist/routes/computer-use/single-bundle.js +7 -4
- package/dist/routes/computer-use/subject-projection.js +2 -0
- package/dist/routes/computer-use/types.d.ts +1 -1
- package/dist/routes/scripted/plan.d.ts +4 -1
- package/dist/routes/scripted/plan.js +25 -2
- package/dist/routes/scripted/setup.js +1 -4
- package/dist/routes/scripted/types.d.ts +1 -1
- package/dist/routes/shared-world/participant-specs.js +2 -2
- package/dist/routes/shared-world/plan.d.ts +3 -1
- package/dist/routes/shared-world/plan.js +39 -7
- package/dist/routes/shared-world/route.js +2 -2
- package/dist/routes/terminal/live-sandbox.d.ts +1 -1
- package/dist/routes/terminal/live-sandbox.js +14 -11
- package/dist/routes/terminal/sandbox.d.ts +4 -3
- package/dist/routes/terminal/sandbox.js +5 -5
- package/dist/run/bundle-shape.js +2 -1
- package/dist/run/bundle.d.ts +5 -3
- package/dist/run/projection.js +7 -2
- package/dist/run/route-shell.js +10 -5
- package/dist/run/subject-name.d.ts +11 -0
- package/dist/run/subject-name.js +11 -0
- package/dist/study/automatic-analysis-plan.d.ts +28 -0
- package/dist/study/automatic-analysis-plan.js +57 -0
- package/dist/study/composition-rules.js +1 -1
- package/dist/study/config.js +10 -21
- package/dist/study/doctor.js +17 -3
- package/dist/study/keys.d.ts +2 -0
- package/dist/study/keys.js +2 -0
- package/dist/study/migrate/v2.js +2 -1
- package/dist/study/parse/actors.d.ts +1 -1
- package/dist/study/parse/actors.js +9 -1
- package/dist/study/parse/front.d.ts +1 -1
- package/dist/study/parse/front.js +7 -1
- package/dist/study/plan-base.d.ts +2 -0
- package/dist/study/plan-base.js +3 -0
- package/dist/study/plan-participants.d.ts +4 -0
- package/dist/study/plan-participants.js +6 -5
- package/dist/study/plan-types.d.ts +8 -3
- package/dist/study/plan.d.ts +4 -4
- package/dist/study/plan.js +21 -12
- package/dist/study/preflight-result.js +2 -2
- package/dist/study/preflight.d.ts +2 -1
- package/dist/study/preflight.js +12 -3
- package/dist/study/routing.d.ts +5 -4
- package/dist/study/routing.js +16 -7
- package/dist/study/summary.d.ts +3 -3
- package/dist/study/summary.js +3 -5
- package/dist/study/types.d.ts +14 -0
- package/dist/study/validation.d.ts +7 -2
- package/dist/study/validation.js +30 -14
- package/dist/study/warnings.js +12 -0
- package/dist/subject/serve.d.ts +3 -0
- package/dist/subject/serve.js +4 -1
- package/dist/substrates/detached.js +14 -7
- package/dist/substrates/e2b/desktop-executor.d.ts +0 -2
- package/dist/substrates/e2b/desktop-executor.js +3 -3
- package/dist/substrates/e2b/lifetime.d.ts +75 -4
- package/dist/substrates/e2b/lifetime.js +134 -10
- package/dist/substrates/e2b/subject-sandbox.js +2 -6
- package/dist/tui-app.js +119 -118
- package/dist/verify/artifacts.d.ts +19 -4
- package/dist/verify/artifacts.js +39 -8
- package/dist/verify/verify.js +6 -15
- package/docs/architecture/browser-control.md +10 -4
- package/docs/contracts/run-bundle.md +7 -6
- package/docs/contracts/schemas.md +33 -19
- package/docs/contracts/study-analysis.md +2 -2
- package/docs/principles/invariants-and-defaults.md +1 -1
- package/docs/product/automatic-analysis.md +4 -3
- package/package.json +2 -2
package/dist/cli/doctor.js
CHANGED
|
@@ -4,7 +4,7 @@ import { existsSync } from "node:fs";
|
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { DOCTOR_KEYS, probeKeySources, } from "../keys/key-resolution.js";
|
|
6
6
|
import { desktopPeerAdvice, humanishInstall, } from "../substrates/e2b/peer-install.js";
|
|
7
|
-
import { describeSandboxCeiling, sandboxCeiling } from "../substrates/e2b/lifetime.js";
|
|
7
|
+
import { concurrentSandboxes, describeConcurrentSandboxes, describeSandboxCeiling, sandboxCeiling, } from "../substrates/e2b/lifetime.js";
|
|
8
8
|
import { nodeSupportsTui, terminalSurfaceMessage, TUI_BUNDLE_URL } from "../tui/contract.js";
|
|
9
9
|
import { detectLocalAgents, localAgentDoctorMessage, localAgentReady, NO_LOCAL_AGENT_MESSAGE, } from "../actors/local-agent/cli.js";
|
|
10
10
|
import { leftoverClaudeTranscripts } from "../actors/local-agent/claude-participant.js";
|
|
@@ -97,6 +97,7 @@ export async function doctor(cwdInput, options = {}) {
|
|
|
97
97
|
...(await projectChecks(projectRoot)),
|
|
98
98
|
await desktopSdkCheck(setup),
|
|
99
99
|
sandboxCeilingCheck(env),
|
|
100
|
+
concurrentSandboxesCheck(env),
|
|
100
101
|
terminalSurfaceCheck(),
|
|
101
102
|
...versionCheck(env),
|
|
102
103
|
...localAgentChecks(agents),
|
|
@@ -198,6 +199,15 @@ function sandboxCeilingCheck(env) {
|
|
|
198
199
|
const ceiling = sandboxCeiling(env);
|
|
199
200
|
return { name: "e2b sandbox ceiling", ok: ceiling.ok, message: describeSandboxCeiling(ceiling) };
|
|
200
201
|
}
|
|
202
|
+
/** How many sandboxes the E2B planners run at once, and where that number came from. */
|
|
203
|
+
function concurrentSandboxesCheck(env) {
|
|
204
|
+
const limit = concurrentSandboxes(env);
|
|
205
|
+
return {
|
|
206
|
+
name: "e2b concurrent sandboxes",
|
|
207
|
+
ok: limit.ok,
|
|
208
|
+
message: describeConcurrentSandboxes(limit),
|
|
209
|
+
};
|
|
210
|
+
}
|
|
201
211
|
/**
|
|
202
212
|
* The optional peer dep every live browser and terminal route needs. `npx -y humanish` does not
|
|
203
213
|
* pull optional peers, so without this check an adopter's first live run fails on it, safely and at
|
package/dist/cli/io.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { automaticAnalysisSucceeded, } from "../analysis/automatic-completion.js";
|
|
2
1
|
import { costRefusal, refusedCost } from "../analysis/admission.js";
|
|
3
2
|
import { Command, Option } from "commander";
|
|
4
3
|
import { loadEnvFile, recordDotenvNames } from "../keys/env-file.js";
|
|
5
4
|
import { discoverProviderKeys } from "../keys/key-resolution.js";
|
|
6
5
|
import { deriveRunFacts } from "./telemetry.js";
|
|
7
6
|
import { warnAndQueue, withQueuedWarnings } from "./deprecations.js";
|
|
7
|
+
import { PARTICIPANT_LIMIT_SKIP, PARTICIPANT_LIMIT_SKIP_TEXT, studyAnalysisSucceeded, } from "../study/automatic-analysis-plan.js";
|
|
8
8
|
import { forTerminal } from "../routes/terminal/encoding.js";
|
|
9
9
|
import { cli } from "./invocation.js";
|
|
10
10
|
export const CLI_RESPONSE_SCHEMA = "humanish.cli-response.v1";
|
|
@@ -295,6 +295,7 @@ const ANALYSIS_REASON_TEXT = {
|
|
|
295
295
|
AUTOMATIC_ANALYSIS_BUSY: "skipped because another analysis is running",
|
|
296
296
|
AUTOMATIC_ANALYSIS_ADMISSION_REFUSED: "refused before it started: its configuration, question, evidence or cost did not pass admission",
|
|
297
297
|
AUTOMATIC_ANALYSIS_CLEANUP_UNCONFIRMED: "not started because the run's cleanup was not confirmed",
|
|
298
|
+
[PARTICIPANT_LIMIT_SKIP]: PARTICIPANT_LIMIT_SKIP_TEXT,
|
|
298
299
|
AUTOMATIC_ANALYSIS_REUSED: "complete, reusing an earlier analysis of the same evidence",
|
|
299
300
|
AUTOMATIC_ANALYSIS_LIMITATIONS: "partial, because it covered only part of the evidence",
|
|
300
301
|
AUTOMATIC_ANALYSIS_ADMISSION_EXCEEDED: "partial, because it went over its estimated cost or output",
|
|
@@ -320,5 +321,5 @@ export function automaticAnalysisEnvelope(result) {
|
|
|
320
321
|
!("ok" in result))
|
|
321
322
|
return result;
|
|
322
323
|
const run = result;
|
|
323
|
-
return { ...run, runOk: run.ok, ok: run.ok &&
|
|
324
|
+
return { ...run, runOk: run.ok, ok: run.ok && studyAnalysisSucceeded(run) };
|
|
324
325
|
}
|
|
@@ -6,6 +6,7 @@ import { homedir, hostname } from "node:os";
|
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { isRecord } from "../run/type-guards.js";
|
|
8
8
|
import { isReceivingProviderId } from "./providers.js";
|
|
9
|
+
import { MAX_RECEIVING_INBOXES, } from "./receiving-types.js";
|
|
9
10
|
const SCHEMA = "humanish.comms-lease-journal.v1";
|
|
10
11
|
const MAX_BYTES = 1_048_576;
|
|
11
12
|
const UUID = /^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$/;
|
|
@@ -117,7 +118,7 @@ function parseJournal(text) {
|
|
|
117
118
|
!safeString(value.updatedAt) ||
|
|
118
119
|
!Array.isArray(value.leases) ||
|
|
119
120
|
value.leases.length < 1 ||
|
|
120
|
-
value.leases.length >
|
|
121
|
+
value.leases.length > MAX_RECEIVING_INBOXES)
|
|
121
122
|
fail();
|
|
122
123
|
const participants = new Set();
|
|
123
124
|
const leaseIds = new Set();
|
|
@@ -470,7 +471,7 @@ export class CommsLeaseStore {
|
|
|
470
471
|
!KEY_ENV.test(options.apiKeyEnv) ||
|
|
471
472
|
!validReceivingIdentity(options.identity) ||
|
|
472
473
|
options.participants.length < 1 ||
|
|
473
|
-
options.participants.length >
|
|
474
|
+
options.participants.length > MAX_RECEIVING_INBOXES ||
|
|
474
475
|
new Set(options.participants).size !== options.participants.length ||
|
|
475
476
|
options.participants.some((id) => !LOCAL_ID.test(id)))
|
|
476
477
|
fail();
|
|
@@ -3,6 +3,8 @@ import type { ReceivingProviderId } from "./providers.js";
|
|
|
3
3
|
import type { CommsInlineImage } from "./types.js";
|
|
4
4
|
/** authenticate() rejects with this code when the credential cannot acquire fresh inboxes. */
|
|
5
5
|
export declare const RECEIVING_SCOPE_UNSUPPORTED = "comms_scope_unsupported";
|
|
6
|
+
/** The most inboxes one run leases, one per participant; the lease journal holds this many. */
|
|
7
|
+
export declare const MAX_RECEIVING_INBOXES = 64;
|
|
6
8
|
export interface ReceivingContext {
|
|
7
9
|
signal?: AbortSignal;
|
|
8
10
|
timeoutMs?: number;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
/** authenticate() rejects with this code when the credential cannot acquire fresh inboxes. */
|
|
2
2
|
export const RECEIVING_SCOPE_UNSUPPORTED = "comms_scope_unsupported";
|
|
3
|
+
/** The most inboxes one run leases, one per participant; the lease journal holds this many. */
|
|
4
|
+
export const MAX_RECEIVING_INBOXES = 64;
|
|
3
5
|
export const COMMS_RECEIVING_SCHEMA = "humanish.comms-receiving.v2";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { perceptualSignature } from "../evidence/frame-signature.js";
|
|
2
2
|
import { setTimeout as delay } from "node:timers/promises";
|
|
3
|
+
import { CUA_WAIT_LIMITS } from "../actors/computer-use/wait.js";
|
|
3
4
|
import { BROWSER_CONTROL_LIMITS, validateBrowserControlAction, validateBrowserControlPng, } from "../browser-control/protocol.js";
|
|
4
5
|
import { ComputerUseExecutorError, isComputerUseExecutorError, } from "../actors/computer-use/executor-error.js";
|
|
5
6
|
import { xdotoolChord, xdotoolHeldModifiers } from "./desktop-keys.js";
|
|
@@ -104,8 +105,9 @@ async function executeAction(context, state, value, callerSignal) {
|
|
|
104
105
|
throw error;
|
|
105
106
|
}
|
|
106
107
|
}
|
|
108
|
+
// The loop sends every wait with its length; planWait owns the lengths.
|
|
107
109
|
if (action.kind === "wait")
|
|
108
|
-
await delay(action.ms ??
|
|
110
|
+
await delay(action.ms ?? CUA_WAIT_LIMITS.settleMs, undefined, { signal });
|
|
109
111
|
for (const command of commands) {
|
|
110
112
|
assertOpen(state, signal, progress.dispatched);
|
|
111
113
|
// No await between authority check and the native port invocation.
|