@cat-factory/worker 0.48.1 → 0.49.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/infrastructure/repositories/D1MergePresetRepository.d.ts.map +1 -1
- package/dist/infrastructure/repositories/D1MergePresetRepository.js +7 -3
- package/dist/infrastructure/repositories/D1MergePresetRepository.js.map +1 -1
- package/migrations/0027_merge_preset_versioning.sql +15 -0
- package/package.json +15 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"D1MergePresetRepository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1MergePresetRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAA2B,MAAM,wBAAwB,CAAA;AAC3F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"D1MergePresetRepository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1MergePresetRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAA2B,MAAM,wBAAwB,CAAA;AAC3F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAwC3D;;;;;GAKG;AACH,qBAAa,uBAAwB,YAAW,qBAAqB;IACnE,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAY;IAE/B,YAAY,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,UAAU,CAAA;KAAE,EAErC;IAEK,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAM/E;IAEK,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAQ/D;IAEK,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAU1E;IAEK,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsD7E;IAEK,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAO3D;CACF"}
|
|
@@ -11,7 +11,9 @@ function rowToPreset(row) {
|
|
|
11
11
|
releaseWatchWindowMinutes: row.release_watch_window_minutes,
|
|
12
12
|
releaseMaxAttempts: row.release_max_attempts,
|
|
13
13
|
humanReviewGraceMinutes: row.human_review_grace_minutes,
|
|
14
|
+
autoMergeEnabled: row.auto_merge_enabled === 1,
|
|
14
15
|
isDefault: row.is_default === 1,
|
|
16
|
+
...(row.version != null ? { version: row.version } : {}),
|
|
15
17
|
createdAt: row.created_at,
|
|
16
18
|
};
|
|
17
19
|
}
|
|
@@ -64,8 +66,8 @@ export class D1MergePresetRepository {
|
|
|
64
66
|
(workspace_id, id, name, max_complexity, max_risk, max_impact, ci_max_attempts,
|
|
65
67
|
max_requirement_iterations, max_requirement_concern_allowed,
|
|
66
68
|
release_watch_window_minutes, release_max_attempts, human_review_grace_minutes,
|
|
67
|
-
is_default, created_at)
|
|
68
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
69
|
+
auto_merge_enabled, version, is_default, created_at)
|
|
70
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
69
71
|
ON CONFLICT (workspace_id, id) DO UPDATE SET
|
|
70
72
|
name = excluded.name,
|
|
71
73
|
max_complexity = excluded.max_complexity,
|
|
@@ -77,8 +79,10 @@ export class D1MergePresetRepository {
|
|
|
77
79
|
release_watch_window_minutes = excluded.release_watch_window_minutes,
|
|
78
80
|
release_max_attempts = excluded.release_max_attempts,
|
|
79
81
|
human_review_grace_minutes = excluded.human_review_grace_minutes,
|
|
82
|
+
auto_merge_enabled = excluded.auto_merge_enabled,
|
|
83
|
+
version = excluded.version,
|
|
80
84
|
is_default = excluded.is_default`)
|
|
81
|
-
.bind(workspaceId, preset.id, preset.name, preset.maxComplexity, preset.maxRisk, preset.maxImpact, preset.ciMaxAttempts, preset.maxRequirementIterations, preset.maxRequirementConcernAllowed, preset.releaseWatchWindowMinutes, preset.releaseMaxAttempts, preset.humanReviewGraceMinutes, preset.isDefault ? 1 : 0, preset.createdAt)
|
|
85
|
+
.bind(workspaceId, preset.id, preset.name, preset.maxComplexity, preset.maxRisk, preset.maxImpact, preset.ciMaxAttempts, preset.maxRequirementIterations, preset.maxRequirementConcernAllowed, preset.releaseWatchWindowMinutes, preset.releaseMaxAttempts, preset.humanReviewGraceMinutes, preset.autoMergeEnabled ? 1 : 0, preset.version ?? null, preset.isDefault ? 1 : 0, preset.createdAt)
|
|
82
86
|
.run();
|
|
83
87
|
}
|
|
84
88
|
async remove(workspaceId, id) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"D1MergePresetRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1MergePresetRepository.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"D1MergePresetRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1MergePresetRepository.ts"],"names":[],"mappings":"AAsBA,SAAS,WAAW,CAAC,GAAmB;IACtC,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,aAAa,EAAE,GAAG,CAAC,cAAc;QACjC,OAAO,EAAE,GAAG,CAAC,QAAQ;QACrB,SAAS,EAAE,GAAG,CAAC,UAAU;QACzB,aAAa,EAAE,GAAG,CAAC,eAAe;QAClC,wBAAwB,EAAE,GAAG,CAAC,0BAA0B;QACxD,4BAA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E,EAAE,CAAC;aACrB,GAAG,EAAE,CAAA;IACV,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
-- Merge-preset versioning + the auto-merge kill switch.
|
|
2
|
+
--
|
|
3
|
+
-- `auto_merge_enabled` lets a preset disable auto-merge outright (the built-in
|
|
4
|
+
-- "Manual review only" preset, and any custom preset that opts in): the `merger`
|
|
5
|
+
-- step then routes every PR to a human review instead of auto-merging. Defaults to
|
|
6
|
+
-- 1 (the historical behaviour: auto-merge a within-threshold, explained assessment).
|
|
7
|
+
--
|
|
8
|
+
-- `version` is the monotonic catalog version for a BUILT-IN preset (`seedMergePresets()`),
|
|
9
|
+
-- so the SPA can detect a stale persisted copy and offer a reseed. NULL on user-created
|
|
10
|
+
-- presets (not version-tracked) and on rows persisted before this column existed (the
|
|
11
|
+
-- app treats NULL as 0).
|
|
12
|
+
ALTER TABLE merge_threshold_presets
|
|
13
|
+
ADD COLUMN auto_merge_enabled INTEGER NOT NULL DEFAULT 1;
|
|
14
|
+
ALTER TABLE merge_threshold_presets
|
|
15
|
+
ADD COLUMN version INTEGER;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/worker",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.49.0",
|
|
4
4
|
"description": "Reusable Cloudflare Worker library (Hono + D1) exposing the Agent Architecture Board core: the `createApp()` Hono factory, the default fetch/scheduled/queue handler, and the Durable Object + Workflow classes. Deployments (see deploy/backend) supply the wrangler.toml + config and re-export these.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -42,19 +42,19 @@
|
|
|
42
42
|
"pino": "^10.3.1",
|
|
43
43
|
"valibot": "^1.4.2",
|
|
44
44
|
"workers-ai-provider": "^3.2.1",
|
|
45
|
-
"@cat-factory/agents": "0.24.
|
|
46
|
-
"@cat-factory/consensus": "0.7.
|
|
47
|
-
"@cat-factory/contracts": "0.
|
|
48
|
-
"@cat-factory/gates": "0.2.
|
|
49
|
-
"@cat-factory/gitlab": "0.4.
|
|
50
|
-
"@cat-factory/integrations": "0.
|
|
51
|
-
"@cat-factory/kernel": "0.
|
|
52
|
-
"@cat-factory/observability-langfuse": "0.7.
|
|
53
|
-
"@cat-factory/orchestration": "0.
|
|
54
|
-
"@cat-factory/prompt-fragments": "0.9.
|
|
55
|
-
"@cat-factory/provider-cloudflare": "0.7.
|
|
56
|
-
"@cat-factory/server": "0.
|
|
57
|
-
"@cat-factory/spend": "0.10.
|
|
45
|
+
"@cat-factory/agents": "0.24.8",
|
|
46
|
+
"@cat-factory/consensus": "0.7.96",
|
|
47
|
+
"@cat-factory/contracts": "0.69.0",
|
|
48
|
+
"@cat-factory/gates": "0.2.49",
|
|
49
|
+
"@cat-factory/gitlab": "0.4.19",
|
|
50
|
+
"@cat-factory/integrations": "0.47.1",
|
|
51
|
+
"@cat-factory/kernel": "0.63.0",
|
|
52
|
+
"@cat-factory/observability-langfuse": "0.7.92",
|
|
53
|
+
"@cat-factory/orchestration": "0.51.0",
|
|
54
|
+
"@cat-factory/prompt-fragments": "0.9.23",
|
|
55
|
+
"@cat-factory/provider-cloudflare": "0.7.96",
|
|
56
|
+
"@cat-factory/server": "0.58.0",
|
|
57
|
+
"@cat-factory/spend": "0.10.53"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@cloudflare/vitest-pool-workers": "^0.16.20",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"typescript": "7.0.1-rc",
|
|
63
63
|
"vitest": "^4.1.9",
|
|
64
64
|
"wrangler": "^4.105.0",
|
|
65
|
-
"@cat-factory/conformance": "0.9.
|
|
65
|
+
"@cat-factory/conformance": "0.9.60"
|
|
66
66
|
},
|
|
67
67
|
"scripts": {
|
|
68
68
|
"build": "tsc -b tsconfig.build.json",
|