@cat-factory/orchestration 0.209.0 → 0.210.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 (56) hide show
  1. package/dist/container/modules.d.ts.map +1 -1
  2. package/dist/container/modules.js +13 -1
  3. package/dist/container/modules.js.map +1 -1
  4. package/dist/index.d.ts +3 -1
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +2 -1
  7. package/dist/index.js.map +1 -1
  8. package/dist/modules/board/BoardService.d.ts +36 -7
  9. package/dist/modules/board/BoardService.d.ts.map +1 -1
  10. package/dist/modules/board/BoardService.js +47 -7
  11. package/dist/modules/board/BoardService.js.map +1 -1
  12. package/dist/modules/board/publicBoardReads.d.ts +8 -3
  13. package/dist/modules/board/publicBoardReads.d.ts.map +1 -1
  14. package/dist/modules/board/publicBoardReads.js +7 -2
  15. package/dist/modules/board/publicBoardReads.js.map +1 -1
  16. package/dist/modules/board/riskPolicySelectionGuard.d.ts +34 -0
  17. package/dist/modules/board/riskPolicySelectionGuard.d.ts.map +1 -0
  18. package/dist/modules/board/riskPolicySelectionGuard.js +40 -0
  19. package/dist/modules/board/riskPolicySelectionGuard.js.map +1 -0
  20. package/dist/modules/boardScan/BoardScanService.d.ts.map +1 -1
  21. package/dist/modules/boardScan/BoardScanService.js +7 -13
  22. package/dist/modules/boardScan/BoardScanService.js.map +1 -1
  23. package/dist/modules/execution/DocInterviewController.d.ts.map +1 -1
  24. package/dist/modules/execution/DocInterviewController.js +14 -0
  25. package/dist/modules/execution/DocInterviewController.js.map +1 -1
  26. package/dist/modules/execution/ExecutionService.d.ts +25 -0
  27. package/dist/modules/execution/ExecutionService.d.ts.map +1 -1
  28. package/dist/modules/execution/ExecutionService.js +29 -4
  29. package/dist/modules/execution/ExecutionService.js.map +1 -1
  30. package/dist/modules/execution/InitiativeInterviewController.d.ts.map +1 -1
  31. package/dist/modules/execution/InitiativeInterviewController.js +27 -0
  32. package/dist/modules/execution/InitiativeInterviewController.js.map +1 -1
  33. package/dist/modules/execution/InterviewGateController.d.ts +66 -1
  34. package/dist/modules/execution/InterviewGateController.d.ts.map +1 -1
  35. package/dist/modules/execution/InterviewGateController.js +11 -6
  36. package/dist/modules/execution/InterviewGateController.js.map +1 -1
  37. package/dist/modules/execution/MergeResolver.d.ts.map +1 -1
  38. package/dist/modules/execution/MergeResolver.js +1 -2
  39. package/dist/modules/execution/MergeResolver.js.map +1 -1
  40. package/dist/modules/execution/RunMergePolicy.d.ts +7 -2
  41. package/dist/modules/execution/RunMergePolicy.d.ts.map +1 -1
  42. package/dist/modules/execution/RunMergePolicy.js +13 -26
  43. package/dist/modules/execution/RunMergePolicy.js.map +1 -1
  44. package/dist/modules/execution/followUp.logic.d.ts +19 -0
  45. package/dist/modules/execution/followUp.logic.d.ts.map +1 -1
  46. package/dist/modules/execution/followUp.logic.js +20 -1
  47. package/dist/modules/execution/followUp.logic.js.map +1 -1
  48. package/dist/modules/execution/step-park.logic.d.ts +24 -0
  49. package/dist/modules/execution/step-park.logic.d.ts.map +1 -1
  50. package/dist/modules/execution/step-park.logic.js +26 -0
  51. package/dist/modules/execution/step-park.logic.js.map +1 -1
  52. package/dist/modules/merge/riskPolicyResolution.d.ts +28 -0
  53. package/dist/modules/merge/riskPolicyResolution.d.ts.map +1 -0
  54. package/dist/modules/merge/riskPolicyResolution.js +34 -0
  55. package/dist/modules/merge/riskPolicyResolution.js.map +1 -0
  56. package/package.json +12 -12
@@ -1 +1 @@
1
- {"version":3,"file":"followUp.logic.js","sourceRoot":"","sources":["../../../src/modules/execution/followUp.logic.ts"],"names":[],"mappings":"AAEA,qFAAqF;AACrF,yFAAyF;AACzF,0FAA0F;AAC1F,yFAAyF;AACzF,2FAA2F;AAC3F,iDAAiD;AAEjD,yEAAyE;AACzE,MAAM,CAAC,MAAM,uBAAuB,GAAG,OAAO,CAAA;AAE9C,4FAA4F;AAC5F,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAA;AAE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K,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC,eAAe,EAAE,CAAC,CAAA;QACjF,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAChB,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,KAAK,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAA;QAC3D,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;YACxB,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;YAChE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC,CAAA;QACtC,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAChB,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAA;AACnC,CAAC"}
@@ -20,4 +20,28 @@ export type DedicatedParkSurface = 'input-gate' | 'requirements-review' | 'clari
20
20
  * do — the same short-circuit as the fork park, one step earlier.
21
21
  */
22
22
  export declare function dedicatedParkSurface(instance: Pick<ExecutionInstance, 'inputGate'>, step: PipelineStep, registry: AgentKindRegistry): DedicatedParkSurface | null;
23
+ /**
24
+ * Whether a step is currently HOLDING the run on a human: parked on the generic decision-wait,
25
+ * whichever surface owns it. Says nothing about WHOSE park it is (that is
26
+ * {@link dedicatedParkSurface}'s answer), only that this step is the one stopped.
27
+ *
28
+ * Stated once because three callers ask it and each would otherwise spell it out: the interview
29
+ * gate resolving which of a run's steps its resume acts on, the same gate re-finding that step
30
+ * inside its CAS callback, and the public decision projection deciding whether a run has an
31
+ * interview to offer. Two of those three run against a snapshot the third took, so a spelling
32
+ * that drifted would answer differently about one step.
33
+ */
34
+ export declare function stepAwaitsDecision(step: PipelineStep): boolean;
35
+ /**
36
+ * The step a run is parked on an INTERVIEW gate at, with its index, or null.
37
+ *
38
+ * Keyed off the `interview-gate` TRAIT rather than a list of interviewer kinds, exactly as the
39
+ * dispatcher's own routing is: a deployment that registers its own interviewer carries the trait
40
+ * and is found here with no edit. A run carries at most one such park at a time (a parked run runs
41
+ * no other step), so the first match is the answer.
42
+ */
43
+ export declare function findParkedInterviewStep(instance: Pick<ExecutionInstance, 'steps'>, registry: AgentKindRegistry): {
44
+ step: PipelineStep;
45
+ index: number;
46
+ } | null;
23
47
  //# sourceMappingURL=step-park.logic.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"step-park.logic.d.ts","sourceRoot":"","sources":["../../../src/modules/execution/step-park.logic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,EAAE,KAAK,iBAAiB,EAAkC,MAAM,qBAAqB,CAAA;AAkC5F;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAC5B,YAAY,GACZ,qBAAqB,GACrB,gBAAgB,GAChB,YAAY,GACZ,YAAY,GACZ,qBAAqB,GACrB,WAAW,GACX,eAAe,GACf,YAAY,GACZ,eAAe,CAAA;AAEnB;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,IAAI,CAAC,iBAAiB,EAAE,WAAW,CAAC,EAC9C,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE,iBAAiB,GAC1B,oBAAoB,GAAG,IAAI,CAwB7B"}
1
+ {"version":3,"file":"step-park.logic.d.ts","sourceRoot":"","sources":["../../../src/modules/execution/step-park.logic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,EAAE,KAAK,iBAAiB,EAAkC,MAAM,qBAAqB,CAAA;AAkC5F;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAC5B,YAAY,GACZ,qBAAqB,GACrB,gBAAgB,GAChB,YAAY,GACZ,YAAY,GACZ,qBAAqB,GACrB,WAAW,GACX,eAAe,GACf,YAAY,GACZ,eAAe,CAAA;AAEnB;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,IAAI,CAAC,iBAAiB,EAAE,WAAW,CAAC,EAC9C,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE,iBAAiB,GAC1B,oBAAoB,GAAG,IAAI,CAwB7B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAE9D;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,EAC1C,QAAQ,EAAE,iBAAiB,GAC1B;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAK9C"}
@@ -40,4 +40,30 @@ export function dedicatedParkSurface(instance, step, registry) {
40
40
  }
41
41
  return null;
42
42
  }
43
+ /**
44
+ * Whether a step is currently HOLDING the run on a human: parked on the generic decision-wait,
45
+ * whichever surface owns it. Says nothing about WHOSE park it is (that is
46
+ * {@link dedicatedParkSurface}'s answer), only that this step is the one stopped.
47
+ *
48
+ * Stated once because three callers ask it and each would otherwise spell it out: the interview
49
+ * gate resolving which of a run's steps its resume acts on, the same gate re-finding that step
50
+ * inside its CAS callback, and the public decision projection deciding whether a run has an
51
+ * interview to offer. Two of those three run against a snapshot the third took, so a spelling
52
+ * that drifted would answer differently about one step.
53
+ */
54
+ export function stepAwaitsDecision(step) {
55
+ return step.state === 'waiting_decision' && step.approval?.status === 'pending';
56
+ }
57
+ /**
58
+ * The step a run is parked on an INTERVIEW gate at, with its index, or null.
59
+ *
60
+ * Keyed off the `interview-gate` TRAIT rather than a list of interviewer kinds, exactly as the
61
+ * dispatcher's own routing is: a deployment that registers its own interviewer carries the trait
62
+ * and is found here with no edit. A run carries at most one such park at a time (a parked run runs
63
+ * no other step), so the first match is the answer.
64
+ */
65
+ export function findParkedInterviewStep(instance, registry) {
66
+ const index = instance.steps.findIndex((s) => hasTrait(s.agentKind, INTERVIEW_GATE_TRAIT, registry) && stepAwaitsDecision(s));
67
+ return index < 0 ? null : { step: instance.steps[index], index };
68
+ }
43
69
  //# sourceMappingURL=step-park.logic.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"step-park.logic.js","sourceRoot":"","sources":["../../../src/modules/execution/step-park.logic.ts"],"names":[],"mappings":"AACA,OAAO,EAA0B,QAAQ,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC5F,OAAO,EACL,kCAAkC,EAClC,yBAAyB,EACzB,qBAAqB,EACrB,kCAAkC,EAClC,8BAA8B,EAC9B,yBAAyB,GAC1B,MAAM,eAAe,CAAA;AA4CtB;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,oBAAoB,CAClC,QAA8C,EAC9C,IAAkB,EAClB,QAA2B;IAE3B,IAAI,QAAQ,CAAC,SAAS,EAAE,MAAM,KAAK,SAAS;QAAE,OAAO,YAAY,CAAA;IACjE,IAAI,IAAI,CAAC,SAAS,KAAK,8BAA8B;QAAE,OAAO,qBAAqB,CAAA;IACnF,IAAI,IAAI,CAAC,SAAS,KAAK,yBAAyB;QAAE,OAAO,gBAAgB,CAAA;IACzE,IACE,IAAI,CAAC,SAAS,KAAK,kCAAkC;QACrD,IAAI,CAAC,SAAS,KAAK,kCAAkC,EACrD,CAAC;QACD,OAAO,YAAY,CAAA;IACrB,CAAC;IACD,IAAI,IAAI,CAAC,SAAS,KAAK,qBAAqB;QAAE,OAAO,YAAY,CAAA;IACjE,IAAI,IAAI,CAAC,SAAS,KAAK,yBAAyB;QAAE,OAAO,qBAAqB,CAAA;IAC9E,IAAI,QAAQ,CAAC,IAAI,CAAC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C,EAAE,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAE,EAAE,KAAK,EAAE,CAAA;AACnE,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { GroupCacheHandle, RiskPolicy, RiskPolicyCacheValue } from '@cat-factory/kernel';
2
+ import type { RiskPolicyRepository } from '@cat-factory/kernel';
3
+ import type { ResolvedRunRiskPolicy } from '../execution/policy-types.js';
4
+ /** Reads one preset row, possibly through a cache slice. */
5
+ export type RiskPolicyRead = (key: string, load: () => Promise<RiskPolicy | null>) => Promise<RiskPolicy | null>;
6
+ /** Read straight from the repository, for the paths with no cache slice wired to read through. */
7
+ export declare const directRiskPolicyRead: RiskPolicyRead;
8
+ /**
9
+ * Read through the `AppCaches.riskPolicy` slice, grouped by workspace (one preset write drops the
10
+ * whole library) and keyed per resolved id, so a task's pick and the workspace default cache
11
+ * separately. A null (deleted id / unseeded default) caches as a VALUE and still falls through,
12
+ * exactly as an uncached read would. That is what the `RiskPolicyCacheValue` wrapper is for.
13
+ */
14
+ export declare function cachedRiskPolicyRead(cache: GroupCacheHandle<RiskPolicyCacheValue> | undefined, workspaceId: string): RiskPolicyRead;
15
+ /**
16
+ * Resolve the preset governing `riskPolicyId` in a workspace.
17
+ *
18
+ * An ABSENT repository is not a hole to guard: with no preset library there is nothing for a task
19
+ * to point at, so every task in the deployment is governed by {@link DEFAULT_RISK_POLICY}, whose
20
+ * role layer is empty and therefore holds nobody to anything.
21
+ */
22
+ export declare function resolveRiskPolicy(input: {
23
+ repository: RiskPolicyRepository | undefined;
24
+ workspaceId: string;
25
+ riskPolicyId: string | null | undefined;
26
+ read?: RiskPolicyRead;
27
+ }): Promise<ResolvedRunRiskPolicy>;
28
+ //# sourceMappingURL=riskPolicyResolution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"riskPolicyResolution.d.ts","sourceRoot":"","sources":["../../../src/modules/merge/riskPolicyResolution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC7F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAE/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAkBzE,4DAA4D;AAC5D,MAAM,MAAM,cAAc,GAAG,CAC3B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,KACnC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAA;AAE/B,kGAAkG;AAClG,eAAO,MAAM,oBAAoB,EAAE,cAAuC,CAAA;AAE1E;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,gBAAgB,CAAC,oBAAoB,CAAC,GAAG,SAAS,EACzD,WAAW,EAAE,MAAM,GAClB,cAAc,CAIhB;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE;IAC7C,UAAU,EAAE,oBAAoB,GAAG,SAAS,CAAA;IAC5C,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IACvC,IAAI,CAAC,EAAE,cAAc,CAAA;CACtB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAWjC"}
@@ -0,0 +1,34 @@
1
+ import { DEFAULT_RISK_POLICY } from '@cat-factory/kernel';
2
+ /** Read straight from the repository, for the paths with no cache slice wired to read through. */
3
+ export const directRiskPolicyRead = (_key, load) => load();
4
+ /**
5
+ * Read through the `AppCaches.riskPolicy` slice, grouped by workspace (one preset write drops the
6
+ * whole library) and keyed per resolved id, so a task's pick and the workspace default cache
7
+ * separately. A null (deleted id / unseeded default) caches as a VALUE and still falls through,
8
+ * exactly as an uncached read would. That is what the `RiskPolicyCacheValue` wrapper is for.
9
+ */
10
+ export function cachedRiskPolicyRead(cache, workspaceId) {
11
+ if (!cache)
12
+ return directRiskPolicyRead;
13
+ return async (key, load) => (await cache.get(key, workspaceId, async () => ({ policy: await load() }))).policy;
14
+ }
15
+ /**
16
+ * Resolve the preset governing `riskPolicyId` in a workspace.
17
+ *
18
+ * An ABSENT repository is not a hole to guard: with no preset library there is nothing for a task
19
+ * to point at, so every task in the deployment is governed by {@link DEFAULT_RISK_POLICY}, whose
20
+ * role layer is empty and therefore holds nobody to anything.
21
+ */
22
+ export async function resolveRiskPolicy(input) {
23
+ const { repository, workspaceId, riskPolicyId } = input;
24
+ if (!repository)
25
+ return DEFAULT_RISK_POLICY;
26
+ const read = input.read ?? directRiskPolicyRead;
27
+ if (riskPolicyId) {
28
+ const picked = await read(`picked:${riskPolicyId}`, () => repository.get(workspaceId, riskPolicyId));
29
+ if (picked)
30
+ return picked;
31
+ }
32
+ return (await read('default', () => repository.getDefault(workspaceId))) ?? DEFAULT_RISK_POLICY;
33
+ }
34
+ //# sourceMappingURL=riskPolicyResolution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"riskPolicyResolution.js","sourceRoot":"","sources":["../../../src/modules/merge/riskPolicyResolution.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAyBzD,kGAAkG;AAClG,MAAM,CAAC,MAAM,oBAAoB,GAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAA;AAE1E;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAyD,EACzD,WAAmB;IAEnB,IAAI,CAAC,KAAK;QAAE,OAAO,oBAAoB,CAAA;IACvC,OAAO,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,CACzB,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;AACtF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,KAKvC;IACC,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,KAAK,CAAA;IACvD,IAAI,CAAC,UAAU;QAAE,OAAO,mBAAmB,CAAA;IAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,oBAAoB,CAAA;IAC/C,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,YAAY,EAAE,EAAE,GAAG,EAAE,CACvD,UAAU,CAAC,GAAG,CAAC,WAAW,EAAE,YAAY,CAAC,CAC1C,CAAA;QACD,IAAI,MAAM;YAAE,OAAO,MAAM,CAAA;IAC3B,CAAC;IACD,OAAO,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,mBAAmB,CAAA;AACjG,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cat-factory/orchestration",
3
- "version": "0.209.0",
3
+ "version": "0.210.0",
4
4
  "description": "Delivery-workflow engine for the Agent Architecture Board (execution, bootstrap, pipelines, board, boardScan, requirements, and composition root).",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,21 +24,21 @@
24
24
  "access": "public"
25
25
  },
26
26
  "dependencies": {
27
- "ai": "^7.0.47",
28
- "@cat-factory/agents": "0.112.2",
29
- "@cat-factory/caching": "0.14.22",
30
- "@cat-factory/contracts": "0.242.0",
31
- "@cat-factory/integrations": "0.129.0",
32
- "@cat-factory/kernel": "0.241.0",
33
- "@cat-factory/prompt-fragments": "0.15.68",
34
- "@cat-factory/sandbox": "0.11.63",
35
- "@cat-factory/spend": "0.15.4",
36
- "@cat-factory/workspaces": "0.21.56"
27
+ "ai": "^7.0.51",
28
+ "@cat-factory/agents": "0.112.4",
29
+ "@cat-factory/caching": "0.14.24",
30
+ "@cat-factory/contracts": "0.243.0",
31
+ "@cat-factory/integrations": "0.130.0",
32
+ "@cat-factory/kernel": "0.242.0",
33
+ "@cat-factory/prompt-fragments": "0.15.69",
34
+ "@cat-factory/sandbox": "0.11.65",
35
+ "@cat-factory/spend": "0.15.6",
36
+ "@cat-factory/workspaces": "0.21.58"
37
37
  },
38
38
  "devDependencies": {
39
39
  "typescript": "7.0.2",
40
40
  "vitest": "^4.1.10",
41
- "@cat-factory/sandbox-fixtures": "0.7.276"
41
+ "@cat-factory/sandbox-fixtures": "0.7.277"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "tsc -b tsconfig.build.json",