@cat-factory/contracts 0.308.0 → 0.309.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 (48) hide show
  1. package/dist/agent-presentation.d.ts +16 -2
  2. package/dist/agent-presentation.d.ts.map +1 -1
  3. package/dist/agent-presentation.js +7 -0
  4. package/dist/agent-presentation.js.map +1 -1
  5. package/dist/companion-state.d.ts +90 -0
  6. package/dist/companion-state.d.ts.map +1 -0
  7. package/dist/companion-state.js +84 -0
  8. package/dist/companion-state.js.map +1 -0
  9. package/dist/entities.d.ts +1 -1
  10. package/dist/execution.d.ts +4 -82
  11. package/dist/execution.d.ts.map +1 -1
  12. package/dist/execution.js +4 -50
  13. package/dist/execution.js.map +1 -1
  14. package/dist/index.d.ts +1 -0
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +1 -0
  17. package/dist/index.js.map +1 -1
  18. package/dist/pipeline-purpose-vocabulary.d.ts +8 -3
  19. package/dist/pipeline-purpose-vocabulary.d.ts.map +1 -1
  20. package/dist/pipeline-purpose-vocabulary.js +14 -2
  21. package/dist/pipeline-purpose-vocabulary.js.map +1 -1
  22. package/dist/pipeline-purpose.d.ts +20 -12
  23. package/dist/pipeline-purpose.d.ts.map +1 -1
  24. package/dist/pipeline-purpose.js +79 -23
  25. package/dist/pipeline-purpose.js.map +1 -1
  26. package/dist/requests.d.ts +2 -2
  27. package/dist/routes/agent-runs.d.ts +2 -0
  28. package/dist/routes/agent-runs.d.ts.map +1 -1
  29. package/dist/routes/bug-hunt.d.ts +2 -0
  30. package/dist/routes/bug-hunt.d.ts.map +1 -1
  31. package/dist/routes/execution.d.ts +9 -0
  32. package/dist/routes/execution.d.ts.map +1 -1
  33. package/dist/routes/human-review.d.ts +1 -0
  34. package/dist/routes/human-review.d.ts.map +1 -1
  35. package/dist/routes/human-test.d.ts +5 -0
  36. package/dist/routes/human-test.d.ts.map +1 -1
  37. package/dist/routes/pipelines.d.ts +8 -8
  38. package/dist/routes/visual-confirm.d.ts +3 -0
  39. package/dist/routes/visual-confirm.d.ts.map +1 -1
  40. package/dist/routes/workspaces.d.ts +6 -4
  41. package/dist/routes/workspaces.d.ts.map +1 -1
  42. package/dist/snapshot.d.ts +3 -2
  43. package/dist/snapshot.d.ts.map +1 -1
  44. package/dist/visual-pipeline.d.ts +24 -1
  45. package/dist/visual-pipeline.d.ts.map +1 -1
  46. package/dist/visual-pipeline.js +44 -3
  47. package/dist/visual-pipeline.js.map +1 -1
  48. package/package.json +1 -1
@@ -1,15 +1,21 @@
1
1
  import { resolveFrontendServePort } from './frontend.js';
2
+ import { stepConditionSatisfied } from './step-conditions.js';
2
3
  // ---------------------------------------------------------------------------
3
4
  // Visual-pipeline gating (shared by the SPA surface + the backend run-start gate).
4
5
  //
5
6
  // A "visual" pipeline exercises a rendered UI — it either drives a real browser
6
7
  // against a running frontend (`tester-ui`) or parks for a human to review the
7
8
  // captured screenshots vs the task's reference designs (`visual-confirmation`).
8
- // Such a pipeline only makes sense where there IS a UI to exercise: a `frontend`
9
+ // Such a step only makes sense where there IS a UI to exercise: a `frontend`
9
10
  // frame (it owns the app under test), or a frame a `frontend` frame links to (the
10
11
  // linked frontend is the UI a change to that service is validated through). The SPA
11
12
  // uses these predicates to surface visual pipelines only where they can run; the
12
13
  // backend gates a run start on the SAME rule so the guarantee holds server-side.
14
+ //
15
+ // What a pipeline LISTS and what a run REACHES are two questions, and the gate wants the
16
+ // second: a visual step scoped to a frontend service (`stepOptions[i].condition`) excuses
17
+ // itself from a backend run before it dispatches, which is what lets one build preset carry
18
+ // both testers. See `pipelineRunsVisualStep`.
13
19
  // ---------------------------------------------------------------------------
14
20
  /**
15
21
  * The agent kind that drives a real browser against a running frontend and captures a
@@ -25,9 +31,44 @@ export const UI_TESTER_AGENT_KIND = 'tester-ui';
25
31
  export const VISUAL_CONFIRM_AGENT_KIND = 'visual-confirmation';
26
32
  /** The visual step kinds: a pipeline carrying any of these is a "visual" pipeline. */
27
33
  export const VISUAL_STEP_KINDS = [UI_TESTER_AGENT_KIND, VISUAL_CONFIRM_AGENT_KIND];
28
- /** Whether a pipeline includes any visual step (`tester-ui` / `visual-confirmation`). */
34
+ /**
35
+ * Whether an agent kind drives a rendered UI. Reads {@link VISUAL_STEP_KINDS} rather than
36
+ * re-spelling the disjunction, so a third visual kind added to that list is seen by both
37
+ * predicates below instead of leaving the frame gate quietly offering a UI-driving pipeline on a
38
+ * frame with no UI.
39
+ */
40
+ function isVisualStepKind(kind) {
41
+ return VISUAL_STEP_KINDS.includes(kind);
42
+ }
43
+ /**
44
+ * Whether a pipeline includes any visual step (`tester-ui` / `visual-confirmation`) AT ALL,
45
+ * conditional ones included. The question for a caller asking whether the pipeline could ever
46
+ * drive a browser (run start resolves the frontend bindings off it). A caller deciding whether
47
+ * a pipeline may run HERE wants {@link pipelineRunsVisualStep} instead.
48
+ */
29
49
  export function pipelineHasVisualStep(pipeline) {
30
- return pipeline.agentKinds.some((kind) => kind === UI_TESTER_AGENT_KIND || kind === VISUAL_CONFIRM_AGENT_KIND);
50
+ return pipeline.agentKinds.some(isVisualStepKind);
51
+ }
52
+ /**
53
+ * Whether a run of `scope` would actually REACH a visual step: the steps that are enabled and
54
+ * whose run condition (`stepOptions[i].condition`) the scope admits. This is the question the
55
+ * frame gate below has to ask, and it is NOT the same as "does the pipeline list one".
56
+ *
57
+ * Since the build ladder carries the CONDITIONAL tester pair, every build preset lists a
58
+ * `tester-ui` scoped to `serviceScope: 'frontend'`. On a backend service that step is skipped
59
+ * before it dispatches, so the pipeline demands no UI and the run starts fine — which is exactly
60
+ * what run admission concludes, filtering the chain through the same two rules before it reaches
61
+ * the frame gate. Asking the coarse question there instead hides every build rung from every
62
+ * picker on every non-frontend service.
63
+ *
64
+ * An UNRESOLVABLE scope (neither half set: a block under no service frame) admits every
65
+ * condition, the fail-safe direction `stepConditionSatisfied` takes throughout: the visual step
66
+ * would run, so the frame gate gets to refuse it rather than a condition quietly excusing it.
67
+ */
68
+ export function pipelineRunsVisualStep(pipeline, scope) {
69
+ return pipeline.agentKinds.some((kind, i) => isVisualStepKind(kind) &&
70
+ pipeline.enabled?.[i] !== false &&
71
+ stepConditionSatisfied(pipeline.stepOptions?.[i]?.condition, scope));
31
72
  }
32
73
  /**
33
74
  * Whether a visual pipeline may run on a task under `frame`. A visual step needs a UI to
@@ -1 +1 @@
1
- {"version":3,"file":"visual-pipeline.js","sourceRoot":"","sources":["../src/visual-pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAA;AAGxD,8EAA8E;AAC9E,mFAAmF;AACnF,EAAE;AACF,gFAAgF;AAChF,8EAA8E;AAC9E,gFAAgF;AAChF,iFAAiF;AACjF,kFAAkF;AAClF,oFAAoF;AACpF,iFAAiF;AACjF,iFAAiF;AACjF,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,CAAA;AAE/C;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,qBAAqB,CAAA;AAE9D,sFAAsF;AACtF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,oBAAoB,EAAE,yBAAyB,CAAU,CAAA;AAE3F,yFAAyF;AACzF,MAAM,UAAU,qBAAqB,CAAC,QAAsC;IAC1E,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,CAC7B,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,oBAAoB,IAAI,IAAI,KAAK,yBAAyB,CAC9E,CAAA;AACH,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,yBAAyB,CACvC,KAAoD,EACpD,MAAmE;IAEnE,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAA;IACxB,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,IAAI,CAAA;IAC1C,OAAO,MAAM,CAAC,IAAI,CAChB,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC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ACzF,CAAC;IACD,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,EAAE,CAAA;AAC5B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cat-factory/contracts",
3
- "version": "0.308.0",
3
+ "version": "0.309.0",
4
4
  "description": "Valibot wire contract shared between the Agent Architecture Board frontend and backend.",
5
5
  "repository": {
6
6
  "type": "git",