humanish 0.120.1 → 0.122.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 (67) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/actors/computer-use/actor.d.ts +3 -0
  3. package/dist/actors/computer-use/actor.js +1 -0
  4. package/dist/actors/computer-use/loop/backstop.d.ts +6 -1
  5. package/dist/actors/computer-use/loop/backstop.js +13 -1
  6. package/dist/actors/computer-use/loop/clock.d.ts +20 -0
  7. package/dist/actors/computer-use/loop/clock.js +64 -0
  8. package/dist/actors/computer-use/loop/ending.d.ts +1 -1
  9. package/dist/actors/computer-use/loop/session.d.ts +1 -1
  10. package/dist/actors/computer-use/loop/session.js +2 -1
  11. package/dist/actors/computer-use/loop/types.d.ts +16 -0
  12. package/dist/actors/computer-use/loop.d.ts +1 -1
  13. package/dist/actors/computer-use/loop.js +43 -8
  14. package/dist/actors/computer-use/wait.d.ts +3 -2
  15. package/dist/actors/computer-use/wait.js +5 -4
  16. package/dist/actors/contract.d.ts +3 -3
  17. package/dist/actors/contract.js +3 -0
  18. package/dist/actors/stop-cause.js +1 -0
  19. package/dist/cli/commands/study-format.js +25 -4
  20. package/dist/routes/computer-use/bundle.d.ts +3 -1
  21. package/dist/routes/computer-use/bundle.js +2 -1
  22. package/dist/routes/computer-use/diagnostics.d.ts +1 -1
  23. package/dist/routes/computer-use/diagnostics.js +4 -0
  24. package/dist/routes/computer-use/fanout-bundle.d.ts +2 -3
  25. package/dist/routes/computer-use/fanout-bundle.js +22 -14
  26. package/dist/routes/computer-use/live-phase.d.ts +1 -2
  27. package/dist/routes/computer-use/live-phase.js +2 -4
  28. package/dist/routes/computer-use/participant-deps.d.ts +1 -1
  29. package/dist/routes/computer-use/participant-deps.js +3 -1
  30. package/dist/routes/computer-use/participant-execution.d.ts +9 -14
  31. package/dist/routes/computer-use/participant-execution.js +102 -89
  32. package/dist/routes/computer-use/participant-model.js +17 -0
  33. package/dist/routes/computer-use/participant-runs.d.ts +11 -1
  34. package/dist/routes/computer-use/participant-runs.js +31 -4
  35. package/dist/routes/computer-use/plan.js +8 -1
  36. package/dist/routes/computer-use/result.js +57 -9
  37. package/dist/routes/computer-use/setup.d.ts +1 -1
  38. package/dist/routes/computer-use/single-bundle.d.ts +3 -0
  39. package/dist/routes/computer-use/single-bundle.js +3 -2
  40. package/dist/routes/computer-use/types.d.ts +33 -7
  41. package/dist/routes/shared-world/provisioned.js +2 -2
  42. package/dist/run/host-suspension.d.ts +56 -0
  43. package/dist/run/host-suspension.js +106 -0
  44. package/dist/run/judge.d.ts +1 -1
  45. package/dist/run/outcomes.js +3 -1
  46. package/dist/run/run.d.ts +15 -2
  47. package/dist/run/run.js +15 -8
  48. package/dist/run/status.d.ts +8 -2
  49. package/dist/run/status.js +11 -8
  50. package/dist/study/arrivals.d.ts +52 -5
  51. package/dist/study/arrivals.js +105 -15
  52. package/dist/study/keys.d.ts +6 -0
  53. package/dist/study/keys.js +4 -0
  54. package/dist/study/migrate/v2.js +8 -5
  55. package/dist/study/parse/actors.d.ts +1 -1
  56. package/dist/study/parse/actors.js +33 -4
  57. package/dist/study/plan-participants.d.ts +10 -1
  58. package/dist/study/plan-participants.js +10 -1
  59. package/dist/study/preflight.js +11 -1
  60. package/dist/study/study-deps.d.ts +6 -0
  61. package/dist/study/types.d.ts +26 -0
  62. package/dist/study/validation.d.ts +3 -2
  63. package/dist/study/validation.js +22 -4
  64. package/dist/tui-app.js +35 -35
  65. package/docs/contracts/run-bundle.md +20 -1
  66. package/docs/contracts/schemas.md +24 -3
  67. package/package.json +1 -1
@@ -37,8 +37,9 @@ export declare function cloneTargetValidationReason(config: StudyConfig): string
37
37
  /** Refuse a claimed output bound when the route cannot pass it to the first-party provider. */
38
38
  export declare function outputTokenLimitValidationReason(config: StudyConfig): string | null;
39
39
  /**
40
- * Refuse a wait field out of range, or an idle wait longer than the longest wait. On a route whose
41
- * participants take no wait actions the fields are inert (warnings.ts).
40
+ * Refuse a wait field out of range, or an idle wait longer than the longest wait: the actor's, and
41
+ * each participant's own idleWaitMs under actor.maxWaitMs. On a route whose participants take no
42
+ * wait actions the fields are inert (warnings.ts).
42
43
  */
43
44
  export declare function waitLimitValidationReason(config: StudyConfig): string | null;
44
45
  /**
@@ -6,7 +6,7 @@ import { isHttpUrl, isLoopbackUrl } from "./parse/subject.js";
6
6
  import { declaredTargets } from "./plan-participants.js";
7
7
  import { actorResolvesToComputerUse, computerUseParticipantCount, participantCountReason, registeredComputerUseActors, resolveEntryUrl, isComputerUseComposition, isScriptedBrowserComposition, isSharedWorldComposition, isTerminalProductComposition, } from "./routing.js";
8
8
  import { participantList } from "./study-fields.js";
9
- import { isStartAfterMs, rosterStartsReason, startAfterMessage } from "./arrivals.js";
9
+ import { isStartAfterMs, rosterStartsReason, startAfterMessage, windowReason } from "./arrivals.js";
10
10
  /**
11
11
  * Cross-validate the computer-use fan-out declaration (`per-lane-worlds`). Returns the failure
12
12
  * message, or null when valid. The parser enforces it, and runStudyWith checks it again for a config
@@ -82,6 +82,9 @@ function rosterStructuralValidationReason(config) {
82
82
  if (entry.startAfterMs !== undefined && !isStartAfterMs(entry.startAfterMs)) {
83
83
  return startAfterMessage(`participants[${index}].startAfterMs`);
84
84
  }
85
+ const window = windowReason(entry, `participants[${index}]`);
86
+ if (window !== undefined)
87
+ return window;
85
88
  const id = entry.id;
86
89
  if (id === undefined) {
87
90
  continue;
@@ -107,6 +110,10 @@ function rosterStructuralValidationReason(config) {
107
110
  * runStudyWith takes a config that skipped the parser.
108
111
  */
109
112
  export function sharedWorldValidationReason(config) {
113
+ // The subject sandbox's deadline assumes every participant runs for execution.timeoutMs.
114
+ const ending = participantList(config)?.findIndex((entry) => entry?.endAfterMs !== undefined);
115
+ if (ending !== undefined && ending >= 0)
116
+ return `participants[${ending}].endAfterMs ends a participant at a set time on route: computer-use only. A shared-world participant runs for execution.timeoutMs; remove endAfterMs and windDownMs.`;
110
117
  return config.subject.source === "app-url"
111
118
  ? externalPublicSharedWorldValidationReason(config)
112
119
  : concurrentSharedWorldValidationReason(config);
@@ -250,11 +257,22 @@ export function outputTokenLimitValidationReason(config) {
250
257
  return null;
251
258
  }
252
259
  /**
253
- * Refuse a wait field out of range, or an idle wait longer than the longest wait. On a route whose
254
- * participants take no wait actions the fields are inert (warnings.ts).
260
+ * Refuse a wait field out of range, or an idle wait longer than the longest wait: the actor's, and
261
+ * each participant's own idleWaitMs under actor.maxWaitMs. On a route whose participants take no
262
+ * wait actions the fields are inert (warnings.ts).
255
263
  */
256
264
  export function waitLimitValidationReason(config) {
257
- return config.actor === undefined ? null : waitFieldsReason(config.actor, "actor.");
265
+ const actorReason = config.actor === undefined ? null : waitFieldsReason(config.actor, "actor.");
266
+ if (actorReason !== null)
267
+ return actorReason;
268
+ for (const [index, entry] of (participantList(config) ?? []).entries()) {
269
+ if (entry?.idleWaitMs === undefined)
270
+ continue;
271
+ const reason = waitFieldsReason({ idleWaitMs: entry.idleWaitMs, maxWaitMs: config.actor?.maxWaitMs }, `participants[${index}].`, "actor.");
272
+ if (reason !== null)
273
+ return reason;
274
+ }
275
+ return null;
258
276
  }
259
277
  /**
260
278
  * Shared-world participants share one live app, so at least two must be live at once. The