humanish 0.93.1 → 0.95.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.
Files changed (99) hide show
  1. package/README.md +26 -3
  2. package/dist/automatic-analysis-completion.d.ts +1 -1
  3. package/dist/automatic-analysis-completion.js +2 -2
  4. package/dist/automatic-analysis-completion.js.map +1 -1
  5. package/dist/automatic-analysis-config.d.ts +3 -0
  6. package/dist/automatic-analysis-config.js +6 -3
  7. package/dist/automatic-analysis-config.js.map +1 -1
  8. package/dist/automatic-study-analysis.d.ts +2 -0
  9. package/dist/automatic-study-analysis.js +8 -2
  10. package/dist/automatic-study-analysis.js.map +1 -1
  11. package/dist/comms-catch-host.js +33 -4
  12. package/dist/comms-catch-host.js.map +1 -1
  13. package/dist/comms-connections.d.ts +50 -0
  14. package/dist/comms-connections.js +123 -0
  15. package/dist/comms-connections.js.map +1 -0
  16. package/dist/comms-email-catch.d.ts +2 -1
  17. package/dist/comms-email-catch.js +5 -2
  18. package/dist/comms-email-catch.js.map +1 -1
  19. package/dist/comms-fake-inbox.d.ts +1 -1
  20. package/dist/comms-fake-inbox.js +15 -12
  21. package/dist/comms-fake-inbox.js.map +1 -1
  22. package/dist/comms-images.d.ts +7 -0
  23. package/dist/comms-images.js +39 -0
  24. package/dist/comms-images.js.map +1 -0
  25. package/dist/comms-inbox.d.ts +7 -1
  26. package/dist/comms-inbox.js +120 -21
  27. package/dist/comms-inbox.js.map +1 -1
  28. package/dist/comms-sandbox-catch.d.ts +1 -1
  29. package/dist/comms-sandbox-catch.js +60 -11
  30. package/dist/comms-sandbox-catch.js.map +1 -1
  31. package/dist/comms-types.d.ts +9 -0
  32. package/dist/concurrent-shared-world-lab.js +6 -3
  33. package/dist/concurrent-shared-world-lab.js.map +1 -1
  34. package/dist/cua-actor-lab.js +25 -12
  35. package/dist/cua-actor-lab.js.map +1 -1
  36. package/dist/doctor-lab.d.ts +23 -0
  37. package/dist/doctor-lab.js +70 -0
  38. package/dist/doctor-lab.js.map +1 -0
  39. package/dist/e2b-terminal-lab.js +5 -2
  40. package/dist/e2b-terminal-lab.js.map +1 -1
  41. package/dist/export.js +35 -18
  42. package/dist/export.js.map +1 -1
  43. package/dist/first-run-path.js +5 -4
  44. package/dist/first-run-path.js.map +1 -1
  45. package/dist/init.js +5 -7
  46. package/dist/init.js.map +1 -1
  47. package/dist/key-resolution.d.ts +1 -1
  48. package/dist/key-resolution.js +6 -4
  49. package/dist/key-resolution.js.map +1 -1
  50. package/dist/lab-config.d.ts +8 -3
  51. package/dist/lab-config.js +36 -8
  52. package/dist/lab-config.js.map +1 -1
  53. package/dist/lab-preflight.js +1 -1
  54. package/dist/lab-preflight.js.map +1 -1
  55. package/dist/lab-summary.d.ts +2 -2
  56. package/dist/lab-summary.js +11 -7
  57. package/dist/lab-summary.js.map +1 -1
  58. package/dist/local-agent-cli.d.ts +7 -3
  59. package/dist/local-agent-cli.js +75 -16
  60. package/dist/local-agent-cli.js.map +1 -1
  61. package/dist/observer-app.html +6 -6
  62. package/dist/observer.d.ts +6 -0
  63. package/dist/observer.js +11 -2
  64. package/dist/observer.js.map +1 -1
  65. package/dist/program.d.ts +2 -0
  66. package/dist/program.js +148 -82
  67. package/dist/program.js.map +1 -1
  68. package/dist/run.d.ts +6 -1
  69. package/dist/run.js +33 -19
  70. package/dist/run.js.map +1 -1
  71. package/dist/scripted-browser-lab.js +5 -2
  72. package/dist/scripted-browser-lab.js.map +1 -1
  73. package/dist/secret-prompt.d.ts +2 -0
  74. package/dist/secret-prompt.js +36 -0
  75. package/dist/secret-prompt.js.map +1 -0
  76. package/dist/shared-world-lab.js +5 -2
  77. package/dist/shared-world-lab.js.map +1 -1
  78. package/dist/study-analysis-engine.d.ts +5 -0
  79. package/dist/study-analysis-engine.js +11 -2
  80. package/dist/study-analysis-engine.js.map +1 -1
  81. package/dist/study-analysis-provider.d.ts +1 -1
  82. package/dist/study-analysis-provider.js +33 -3
  83. package/dist/study-analysis-provider.js.map +1 -1
  84. package/dist/study-analysis-service.d.ts +2 -0
  85. package/dist/study-analysis-service.js +4 -2
  86. package/dist/study-analysis-service.js.map +1 -1
  87. package/dist/tui-app.js +121 -121
  88. package/dist/tui-contract.d.ts +13 -1
  89. package/dist/tui-contract.js.map +1 -1
  90. package/docs/architecture/comms-inbox.md +78 -0
  91. package/docs/contracts/schemas.md +33 -5
  92. package/docs/contracts/study-analysis.md +11 -1
  93. package/docs/goals/current.md +6 -6
  94. package/docs/product/automatic-analysis.md +13 -4
  95. package/docs/ramp/README.md +14 -3
  96. package/docs/release/0.94.0-reliability.md +48 -0
  97. package/docs/release/0.95.0-connections-setup.md +38 -0
  98. package/package.json +6 -2
  99. package/skills/humanish/SKILL.md +28 -7
package/dist/run.d.ts CHANGED
@@ -6,6 +6,7 @@ import { type CapturedGitState } from "./core/git-state.js";
6
6
  import type { E2BDesktopModule } from "./e2b-desktop-launch.js";
7
7
  import { type PreparedRunArtifactPaths } from "./run-paths.js";
8
8
  import { type RunLabProvenance } from "./run-status.js";
9
+ import { type DetectLocalAgentsOptions } from "./local-agent-cli.js";
9
10
  export declare const RUN_BUNDLE_SCHEMA = "humanish.run-bundle.v1";
10
11
  export declare const SHARED_WORLD_SCHEMA = "humanish.shared-world.v1";
11
12
  export declare const REVIEW_SCHEMA = "humanish.review.v1";
@@ -1226,7 +1227,11 @@ export declare function readReview(cwdInput: string, runInput: string): Promise<
1226
1227
  export declare const DESKTOP_SDK_FLOOR = "2.3.1";
1227
1228
  /** The advisory `doctor` attaches to an installed desktop SDK older than the floor, else undefined. */
1228
1229
  export declare function desktopSdkAdvisory(version: string | undefined): string | undefined;
1229
- export declare function doctor(cwdInput: string): Promise<DoctorResult>;
1230
+ export declare function doctor(cwdInput: string, options?: {
1231
+ lab?: string;
1232
+ env?: NodeJS.ProcessEnv;
1233
+ localAgents?: DetectLocalAgentsOptions;
1234
+ }): Promise<DoctorResult>;
1230
1235
  /** Resolve "latest" or an explicit run id to its prepared artifact paths. Exported for the
1231
1236
  * reclaim command (#358), which must locate a run WITHOUT trusting anything but the managed dir. */
1232
1237
  export declare function resolveRunPath(cwd: string, runInput: string): Promise<PreparedRunArtifactPaths | null>;
package/dist/run.js CHANGED
@@ -30,6 +30,7 @@ import { probeKeySources } from "./key-resolution.js";
30
30
  import { beginRunStatus, withRunStatusScope } from "./run-status.js";
31
31
  import { nodeSupportsTui, terminalSurfaceMessage, tuiBundleUrl } from "./tui-contract.js";
32
32
  import { detectLocalAgents, localAgentDoctorMessage } from "./local-agent-cli.js";
33
+ import { labSetupChecks } from "./doctor-lab.js";
33
34
  import { assertPreparedSelectedOutputDirectory, assertSafeOutputPathSegment, bindExistingManagedHumanishOutputDirectory, prepareContainedOutputDirectory, prepareContainedOutputDirectoryRoot, prepareContainedOutputFile, prepareSelectedOutputDirectory, readContainedRegularFile, writeContainedOutputFile, writePreparedRunLatestPointer } from "./selected-output-paths.js";
34
35
  export const RUN_BUNDLE_SCHEMA = "humanish.run-bundle.v1";
35
36
  export const SHARED_WORLD_SCHEMA = "humanish.shared-world.v1";
@@ -3122,7 +3123,7 @@ async function installedDesktopSdkVersion() {
3122
3123
  return undefined;
3123
3124
  }
3124
3125
  }
3125
- export async function doctor(cwdInput) {
3126
+ export async function doctor(cwdInput, options = {}) {
3126
3127
  const cwd = path.resolve(cwdInput);
3127
3128
  const cwdOk = await validateCwd(cwd).then((error) => error === null).catch(() => false);
3128
3129
  if (!cwdOk) {
@@ -3155,17 +3156,32 @@ export async function doctor(cwdInput) {
3155
3156
  return false;
3156
3157
  }
3157
3158
  };
3159
+ const env = options.env ?? process.env;
3160
+ const agents = await detectLocalAgents({ ...options.localAgents, env });
3161
+ const probes = await probeKeySources(["OPENAI_API_KEY", "E2B_API_KEY", "GH_TOKEN", "CODEX_API_KEY"], { cwd, env });
3162
+ const setup = options.lab ? await labSetupChecks({ cwd, lab: options.lab, env, agents,
3163
+ keyPresent: name => probes.some(probe => probe.name === name && probe.source !== null) }) : undefined;
3158
3164
  const checks = [
3159
3165
  {
3160
3166
  name: "target cwd",
3161
3167
  ok: true,
3162
3168
  message: "target directory exists"
3163
3169
  },
3164
- {
3165
- name: "package.json",
3166
- ok: await safeCheck(async () => await readImplicitProjectFile(projectRoot, "package.json") !== null),
3167
- message: "package.json is present and safe to read"
3168
- },
3170
+ await (async () => {
3171
+ try {
3172
+ const contents = await readImplicitProjectFile(projectRoot, "package.json");
3173
+ return {
3174
+ name: "package.json",
3175
+ ok: true,
3176
+ message: contents === null
3177
+ ? "package.json is absent; it is optional for Humanish, so npm-script integration is skipped"
3178
+ : "package.json is present and safe to read"
3179
+ };
3180
+ }
3181
+ catch {
3182
+ return { name: "package.json", ok: false, message: "package.json could not be safely read" };
3183
+ }
3184
+ })(),
3169
3185
  {
3170
3186
  name: "humanish source",
3171
3187
  ok: await safeCheck(() => implicitProjectDirectoryExists(projectRoot, "humanish")),
@@ -3194,10 +3210,11 @@ export async function doctor(cwdInput) {
3194
3210
  const advisory = desktopSdkAdvisory(version);
3195
3211
  return {
3196
3212
  name: "e2b desktop sdk",
3197
- ok: present,
3213
+ ok: present || setup?.desktop === false,
3198
3214
  message: present
3199
- ? `optional peer @e2b/desktop ${version ?? "(version unread)"} is installed; live desktop lanes can launch${advisory === undefined ? "" : `. ${advisory}`}`
3200
- : "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`."
3215
+ ? `optional peer @e2b/desktop ${version ?? "(version unread)"} is installed; provider access is not tested${advisory === undefined ? "" : `. ${advisory}`}`
3216
+ : setup?.desktop === false ? "optional peer @e2b/desktop is absent; not required by the selected route"
3217
+ : "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`."
3201
3218
  };
3202
3219
  })(),
3203
3220
  // The stakeholder surface (#455). Reported as capability, never as a gate: the TUI is optional,
@@ -3230,32 +3247,29 @@ export async function doctor(cwdInput) {
3230
3247
  // "go make an API key" is where most people trying humanish stop, and a developer very often
3231
3248
  // already has one of these signed in.
3232
3249
  ...await (async () => {
3233
- const found = await detectLocalAgents();
3234
- return [{ name: "local agents", ok: true, message: localAgentDoctorMessage(found) }];
3250
+ return [{ name: "local agents", ok: true, message: localAgentDoctorMessage(agents) }];
3235
3251
  })(),
3236
3252
  // Provider-key discovery (#436): which source supplies each live-run key, through the same
3237
3253
  // chain a live command resolves (env/--env-file, project overlay, vendor stores, the
3238
3254
  // humanish user store). Values never appear; sources and fill commands do.
3239
3255
  ...await (async () => {
3240
- const probes = await probeKeySources(["OPENAI_API_KEY", "E2B_API_KEY", "GH_TOKEN"], {
3241
- cwd,
3242
- env: process.env
3243
- });
3244
3256
  return probes.map((probe) => {
3245
3257
  const present = probe.source !== null;
3246
3258
  // GH_TOKEN is needed only for private clone subjects, so its absence is informational.
3247
- const required = probe.name !== "GH_TOKEN";
3259
+ const required = setup ? setup.keys.includes(probe.name) : probe.name === "E2B_API_KEY"
3260
+ || probe.name === "OPENAI_API_KEY" && !agents.some(agent => agent.authStatus === "authenticated");
3248
3261
  return {
3249
3262
  name: `key ${probe.name}`,
3250
3263
  ok: present || !required,
3251
3264
  message: present
3252
- ? `supplied by ${probe.source}`
3265
+ ? `supplied by ${probe.source}; presence only, validity not tested`
3253
3266
  : required
3254
3267
  ? `missing from every source — ${probe.hint}`
3255
- : `missing (needed only for private clone subjects) — ${probe.hint}`
3268
+ : `not required for ${setup ? "the selected participant route" : "every route"}; ${probe.hint}`
3256
3269
  };
3257
3270
  });
3258
- })()
3271
+ })(),
3272
+ ...(setup?.checks ?? [{ name: "setup route", ok: true, message: "General capabilities only. Use humanish doctor --lab <lab> for the selected participant's requirements and separate analysis readiness." }])
3259
3273
  ];
3260
3274
  return {
3261
3275
  schema: DOCTOR_SCHEMA,