humanish 0.77.0 → 0.79.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/dist/run.d.ts CHANGED
@@ -749,6 +749,18 @@ export interface RunBundle {
749
749
  desktopBrowser?: {
750
750
  requested: "default" | "chrome" | "chromium" | "firefox";
751
751
  resolved?: string;
752
+ /**
753
+ * Synthetic media devices the browser was launched with (#509): the camera feed's origin and
754
+ * in-sandbox path, how the permission dialog is answered, and the exact flags.
755
+ */
756
+ media?: {
757
+ camera?: {
758
+ source: "synthetic" | "file";
759
+ file: string;
760
+ };
761
+ permission: "prompt" | "granted";
762
+ flags: string[];
763
+ };
752
764
  };
753
765
  /**
754
766
  * Optional lineage for a run that intentionally re-executes selected lanes from a prior
@@ -1146,6 +1158,15 @@ export declare function readReview(cwdInput: string, runInput: string): Promise<
1146
1158
  path: string;
1147
1159
  runId: string;
1148
1160
  })>;
1161
+ /**
1162
+ * The @e2b/desktop release that stopped holding a background command's event stream open after
1163
+ * the command was launched (its 2.3.1 changelog, 2026-06-08). On older releases the CLI process
1164
+ * stayed alive minutes past a run's written result on one socket to the provider (#581, measured
1165
+ * 2026-09-04 on 2.2.3: twelve minutes).
1166
+ */
1167
+ export declare const DESKTOP_SDK_FLOOR = "2.3.1";
1168
+ /** The advisory `doctor` attaches to an installed desktop SDK older than the floor, else undefined. */
1169
+ export declare function desktopSdkAdvisory(version: string | undefined): string | undefined;
1149
1170
  export declare function doctor(cwdInput: string): Promise<DoctorResult>;
1150
1171
  /** Resolve "latest" or an explicit run id to its prepared artifact paths. Exported for the
1151
1172
  * reclaim command (#358), which must locate a run WITHOUT trusting anything but the managed dir. */
package/dist/run.js CHANGED
@@ -2979,6 +2979,40 @@ export async function readReview(cwdInput, runInput) {
2979
2979
  runId: path.basename(runPaths.absoluteRunRoot)
2980
2980
  };
2981
2981
  }
2982
+ /**
2983
+ * The @e2b/desktop release that stopped holding a background command's event stream open after
2984
+ * the command was launched (its 2.3.1 changelog, 2026-06-08). On older releases the CLI process
2985
+ * stayed alive minutes past a run's written result on one socket to the provider (#581, measured
2986
+ * 2026-09-04 on 2.2.3: twelve minutes).
2987
+ */
2988
+ export const DESKTOP_SDK_FLOOR = "2.3.1";
2989
+ /** The advisory `doctor` attaches to an installed desktop SDK older than the floor, else undefined. */
2990
+ export function desktopSdkAdvisory(version) {
2991
+ if (version === undefined)
2992
+ return undefined;
2993
+ const parse = (value) => value.split(".").slice(0, 3).map((part) => Number.parseInt(part, 10));
2994
+ const have = parse(version);
2995
+ const floor = parse(DESKTOP_SDK_FLOOR);
2996
+ if (have.length < 3 || have.some((part) => !Number.isFinite(part)))
2997
+ return undefined;
2998
+ const older = have[0] < floor[0]
2999
+ || (have[0] === floor[0] && (have[1] < floor[1] || (have[1] === floor[1] && have[2] < floor[2])));
3000
+ return older
3001
+ ? `@e2b/desktop ${version} is older than ${DESKTOP_SDK_FLOOR}, which stopped holding a background command stream open after a run (the CLI stayed alive minutes past its result, #581). Update with \`npm i -D @e2b/desktop@latest\`.`
3002
+ : undefined;
3003
+ }
3004
+ /** The version of the @e2b/desktop that `import("@e2b/desktop")` resolves to from here, if readable. */
3005
+ async function installedDesktopSdkVersion() {
3006
+ try {
3007
+ const { createRequire } = await import("node:module");
3008
+ const manifest = createRequire(import.meta.url).resolve("@e2b/desktop/package.json");
3009
+ const parsed = JSON.parse(await readFile(manifest, "utf8"));
3010
+ return typeof parsed.version === "string" ? parsed.version : undefined;
3011
+ }
3012
+ catch {
3013
+ return undefined;
3014
+ }
3015
+ }
2982
3016
  export async function doctor(cwdInput) {
2983
3017
  const cwd = path.resolve(cwdInput);
2984
3018
  const cwdOk = await validateCwd(cwd).then((error) => error === null).catch(() => false);
@@ -3047,11 +3081,13 @@ export async function doctor(cwdInput) {
3047
3081
  return false;
3048
3082
  }
3049
3083
  });
3084
+ const version = present ? await installedDesktopSdkVersion() : undefined;
3085
+ const advisory = desktopSdkAdvisory(version);
3050
3086
  return {
3051
3087
  name: "e2b desktop sdk",
3052
3088
  ok: present,
3053
3089
  message: present
3054
- ? "optional peer @e2b/desktop is installed; live desktop lanes can launch"
3090
+ ? `optional peer @e2b/desktop ${version ?? "(version unread)"} is installed; live desktop lanes can launch${advisory === undefined ? "" : `. ${advisory}`}`
3055
3091
  : "optional peer @e2b/desktop is NOT installed — dry runs work, but any live desktop lane will fail closed. Install it with `npm i -D @e2b/desktop`."
3056
3092
  };
3057
3093
  })(),
@@ -3869,11 +3905,13 @@ function hasStopWhenObservationEvidence(items, screenshotCount) {
3869
3905
  && item.screenshotRef.path.length > 0);
3870
3906
  if (!hasScreenshot)
3871
3907
  return false;
3908
+ // A matched stopWhen, or a declared dwell window that ended the session (#510): both are
3909
+ // structured, harness-owned completion, with frames behind them.
3872
3910
  return items.some((item) => isRecord(item)
3873
3911
  && item.kind === "notice"
3874
3912
  && item.status === "matched"
3875
3913
  && typeof item.title === "string"
3876
- && item.title.startsWith("stopWhen matched"));
3914
+ && (item.title.startsWith("stopWhen matched") || item.title === "dwell window complete"));
3877
3915
  }
3878
3916
  function actorVerdictConsistencyFindings(bundle) {
3879
3917
  if (bundle.mode !== "live" || bundle.review.verdict !== "pass") {