@cat-factory/orchestration 0.80.1 → 0.82.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/container.d.ts +13 -10
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +22 -0
- package/dist/container.js.map +1 -1
- package/dist/modules/execution/ExecutionService.d.ts +18 -31
- package/dist/modules/execution/ExecutionService.d.ts.map +1 -1
- package/dist/modules/execution/ExecutionService.js +40 -52
- package/dist/modules/execution/ExecutionService.js.map +1 -1
- package/dist/modules/execution/RunDispatcher.js +5 -5
- package/dist/modules/execution/RunDispatcher.js.map +1 -1
- package/dist/modules/execution/tester-infra.logic.d.ts +13 -27
- package/dist/modules/execution/tester-infra.logic.d.ts.map +1 -1
- package/dist/modules/execution/tester-infra.logic.js +14 -22
- package/dist/modules/execution/tester-infra.logic.js.map +1 -1
- package/dist/modules/settings/UserSettingsService.d.ts +29 -0
- package/dist/modules/settings/UserSettingsService.d.ts.map +1 -0
- package/dist/modules/settings/UserSettingsService.js +32 -0
- package/dist/modules/settings/UserSettingsService.js.map +1 -0
- package/package.json +11 -11
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { DEFAULT_USER_SETTINGS, } from '@cat-factory/contracts';
|
|
2
|
+
import { ValidationError } from '@cat-factory/kernel';
|
|
3
|
+
/**
|
|
4
|
+
* Per-user settings (today: the user-tier spend budget). Reads fall back to the
|
|
5
|
+
* built-in defaults when a user has never saved a row; updates are a full-replace of
|
|
6
|
+
* the supplied fields, mirroring the workspace-settings service.
|
|
7
|
+
*/
|
|
8
|
+
export class UserSettingsService {
|
|
9
|
+
deps;
|
|
10
|
+
constructor(deps) {
|
|
11
|
+
this.deps = deps;
|
|
12
|
+
}
|
|
13
|
+
async get(userId) {
|
|
14
|
+
return (await this.deps.userSettingsRepository.get(userId)) ?? DEFAULT_USER_SETTINGS;
|
|
15
|
+
}
|
|
16
|
+
async update(userId, input) {
|
|
17
|
+
const current = await this.get(userId);
|
|
18
|
+
const next = {
|
|
19
|
+
spendMonthlyLimit: 'spendMonthlyLimit' in input
|
|
20
|
+
? (input.spendMonthlyLimit ?? null)
|
|
21
|
+
: current.spendMonthlyLimit,
|
|
22
|
+
};
|
|
23
|
+
const cap = this.deps.resolveUserBudgetCap?.();
|
|
24
|
+
if (next.spendMonthlyLimit != null && cap != null && next.spendMonthlyLimit > cap) {
|
|
25
|
+
throw new ValidationError(`User monthly budget (${next.spendMonthlyLimit}) exceeds the operator cap (${cap}).`);
|
|
26
|
+
}
|
|
27
|
+
await this.deps.userSettingsRepository.upsert(userId, next);
|
|
28
|
+
this.deps.onUserBudgetChanged?.(userId);
|
|
29
|
+
return next;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=UserSettingsService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserSettingsService.js","sourceRoot":"","sources":["../../../src/modules/settings/UserSettingsService.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,GAGtB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAmBrD;;;;GAIG;AACH,MAAM,OAAO,mBAAmB;IACD,IAAI;IAAjC,YAA6B,IAAqC;oBAArC,IAAI;IAAoC,CAAC;IAEtE,KAAK,CAAC,GAAG,CAAC,MAAc;QACtB,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,qBAAqB,CAAA;IACtF,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAAc,EAAE,KAA8B;QACzD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QACtC,MAAM,IAAI,GAAiB;YACzB,iBAAiB,EACf,mBAAmB,IAAI,KAAK;gBAC1B,CAAC,CAAC,CAAC,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC;gBACnC,CAAC,CAAC,OAAO,CAAC,iBAAiB;SAChC,CAAA;QACD,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,CAAA;QAC9C,IAAI,IAAI,CAAC,iBAAiB,IAAI,IAAI,IAAI,GAAG,IAAI,IAAI,IAAI,IAAI,CAAC,iBAAiB,GAAG,GAAG,EAAE,CAAC;YAClF,MAAM,IAAI,eAAe,CACvB,wBAAwB,IAAI,CAAC,iBAAiB,+BAA+B,GAAG,IAAI,CACrF,CAAA;QACH,CAAC;QACD,MAAM,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QAC3D,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,MAAM,CAAC,CAAA;QACvC,OAAO,IAAI,CAAA;IACb,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/orchestration",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.82.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",
|
|
@@ -25,20 +25,20 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"ai": "^6.0.219",
|
|
28
|
-
"@cat-factory/agents": "0.40.
|
|
29
|
-
"@cat-factory/caching": "0.4.
|
|
30
|
-
"@cat-factory/contracts": "0.
|
|
31
|
-
"@cat-factory/integrations": "0.73.
|
|
32
|
-
"@cat-factory/kernel": "0.
|
|
33
|
-
"@cat-factory/prompt-fragments": "0.10.
|
|
34
|
-
"@cat-factory/sandbox": "0.9.
|
|
35
|
-
"@cat-factory/spend": "0.
|
|
36
|
-
"@cat-factory/workspaces": "0.
|
|
28
|
+
"@cat-factory/agents": "0.40.3",
|
|
29
|
+
"@cat-factory/caching": "0.4.18",
|
|
30
|
+
"@cat-factory/contracts": "0.109.0",
|
|
31
|
+
"@cat-factory/integrations": "0.73.3",
|
|
32
|
+
"@cat-factory/kernel": "0.100.0",
|
|
33
|
+
"@cat-factory/prompt-fragments": "0.10.16",
|
|
34
|
+
"@cat-factory/sandbox": "0.9.17",
|
|
35
|
+
"@cat-factory/spend": "0.11.0",
|
|
36
|
+
"@cat-factory/workspaces": "0.12.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"typescript": "7.0.1-rc",
|
|
40
40
|
"vitest": "^4.1.9",
|
|
41
|
-
"@cat-factory/sandbox-fixtures": "0.7.
|
|
41
|
+
"@cat-factory/sandbox-fixtures": "0.7.124"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "tsc -b tsconfig.build.json",
|