@cat-factory/worker 0.13.3 → 0.13.4
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/D1RequirementReviewRepository.d.ts.map +1 -1
- package/dist/infrastructure/repositories/D1RequirementReviewRepository.js +14 -10
- package/dist/infrastructure/repositories/D1RequirementReviewRepository.js.map +1 -1
- package/migrations/0009_requirement_recommendations.sql +6 -0
- package/package.json +13 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"D1RequirementReviewRepository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1RequirementReviewRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAA;AACtE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"D1RequirementReviewRepository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1RequirementReviewRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAA;AACtE,OAAO,KAAK,EAEV,iBAAiB,EAElB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AA0C3D;;;;;GAKG;AACH,qBAAa,6BAA8B,YAAW,2BAA2B;IAC/E,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAY;IAE/B,YAAY,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,UAAU,CAAA;KAAE,EAErC;IAEK,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAUxF;IAEK,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAM5E;IAEK,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiC1E;IAEK,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKvE;CACF"}
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
1
|
+
function parseJsonArray(raw) {
|
|
2
|
+
if (!raw)
|
|
3
|
+
return [];
|
|
3
4
|
try {
|
|
4
|
-
const parsed = JSON.parse(
|
|
5
|
-
|
|
6
|
-
items = parsed;
|
|
5
|
+
const parsed = JSON.parse(raw);
|
|
6
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
7
7
|
}
|
|
8
8
|
catch {
|
|
9
|
-
|
|
9
|
+
return [];
|
|
10
10
|
}
|
|
11
|
+
}
|
|
12
|
+
function rowToReview(row) {
|
|
11
13
|
return {
|
|
12
14
|
id: row.id,
|
|
13
15
|
blockId: row.block_id,
|
|
14
16
|
status: row.status,
|
|
15
|
-
items,
|
|
17
|
+
items: parseJsonArray(row.items),
|
|
16
18
|
model: row.model,
|
|
17
19
|
incorporatedRequirements: row.incorporated_requirements,
|
|
18
20
|
iteration: row.iteration,
|
|
19
21
|
maxIterations: row.max_iterations,
|
|
22
|
+
recommendations: parseJsonArray(row.recommendations),
|
|
20
23
|
createdAt: row.created_at,
|
|
21
24
|
updatedAt: row.updated_at,
|
|
22
25
|
};
|
|
@@ -52,8 +55,8 @@ export class D1RequirementReviewRepository {
|
|
|
52
55
|
await this.db
|
|
53
56
|
.prepare(`INSERT INTO requirement_reviews
|
|
54
57
|
(workspace_id, id, block_id, status, items, model, incorporated_requirements,
|
|
55
|
-
iteration, max_iterations, created_at, updated_at)
|
|
56
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
58
|
+
iteration, max_iterations, recommendations, created_at, updated_at)
|
|
59
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
57
60
|
ON CONFLICT (workspace_id, id) DO UPDATE SET
|
|
58
61
|
block_id = excluded.block_id,
|
|
59
62
|
status = excluded.status,
|
|
@@ -62,8 +65,9 @@ export class D1RequirementReviewRepository {
|
|
|
62
65
|
incorporated_requirements = excluded.incorporated_requirements,
|
|
63
66
|
iteration = excluded.iteration,
|
|
64
67
|
max_iterations = excluded.max_iterations,
|
|
68
|
+
recommendations = excluded.recommendations,
|
|
65
69
|
updated_at = excluded.updated_at`)
|
|
66
|
-
.bind(workspaceId, review.id, review.blockId, review.status, JSON.stringify(review.items), review.model, review.incorporatedRequirements, review.iteration ?? 1, review.maxIterations ?? 1, review.createdAt, review.updatedAt)
|
|
70
|
+
.bind(workspaceId, review.id, review.blockId, review.status, JSON.stringify(review.items), review.model, review.incorporatedRequirements, review.iteration ?? 1, review.maxIterations ?? 1, JSON.stringify(review.recommendations ?? []), review.createdAt, review.updatedAt)
|
|
67
71
|
.run();
|
|
68
72
|
}
|
|
69
73
|
async deleteByBlock(workspaceId, blockId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"D1RequirementReviewRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1RequirementReviewRepository.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"D1RequirementReviewRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1RequirementReviewRepository.ts"],"names":[],"mappings":"AAsBA,SAAS,cAAc,CAAI,GAA8B;IACvD,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAA;IACnB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAC9B,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAE,MAAc,CAAC,CAAC,CAAC,EAAE,CAAA;IACrD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAA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AI,CAAA;IACtC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,WAAmB,EAAE,MAAyB;QACzD,MAAM,IAAI,CAAC,EAAE;aACV,OAAO,CACN;;;;;;;;;;;;;4CAaoC,CACrC;aACA,IAAI,CACH,WAAW,EACX,MAAM,CAAC,EAAE,EACT,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,MAAM,EACb,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,EAC5B,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,wBAAwB,EAC/B,MAAM,CAAC,SAAS,IAAI,CAAC,EACrB,MAAM,CAAC,aAAa,IAAI,CAAC,EACzB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,eAAe,IAAI,EAAE,CAAC,EAC5C,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,SAAS,CACjB;aACA,GAAG,EAAE,CAAA;IACV,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,WAAmB,EAAE,OAAe;QACtD,MAAM,IAAI,CAAC,EAAE;aACV,OAAO,CAAC,yEAAyE,CAAC;aAClF,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC;aAC1B,GAAG,EAAE,CAAA;IACV,CAAC;CACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
-- Requirement-Writer recommendations: a first-class JSON collection on a requirements
|
|
2
|
+
-- review (NOT on items, which churn each re-review). Each entry snapshots its source
|
|
3
|
+
-- finding by title/detail, carries the suggested answer text, an accept/reject status, an
|
|
4
|
+
-- optional re-request note, and an optional `groundedInFragment` marker when the answer was
|
|
5
|
+
-- taken straight from a best-practice fragment. Pre-1.0: existing rows default to '[]'.
|
|
6
|
+
ALTER TABLE requirement_reviews ADD COLUMN recommendations TEXT NOT NULL DEFAULT '[]';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/worker",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.4",
|
|
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",
|
|
@@ -39,17 +39,17 @@
|
|
|
39
39
|
"pino": "^10.3.1",
|
|
40
40
|
"valibot": "^1.4.1",
|
|
41
41
|
"workers-ai-provider": "^3.2.0",
|
|
42
|
-
"@cat-factory/
|
|
43
|
-
"@cat-factory/
|
|
44
|
-
"@cat-factory/
|
|
45
|
-
"@cat-factory/integrations": "0.12.
|
|
46
|
-
"@cat-factory/kernel": "0.16.
|
|
47
|
-
"@cat-factory/observability-langfuse": "0.7.
|
|
48
|
-
"@cat-factory/orchestration": "0.11.
|
|
49
|
-
"@cat-factory/
|
|
50
|
-
"@cat-factory/
|
|
51
|
-
"@cat-factory/
|
|
52
|
-
"@cat-factory/
|
|
42
|
+
"@cat-factory/consensus": "0.7.23",
|
|
43
|
+
"@cat-factory/contracts": "0.17.1",
|
|
44
|
+
"@cat-factory/agents": "0.11.13",
|
|
45
|
+
"@cat-factory/integrations": "0.12.4",
|
|
46
|
+
"@cat-factory/kernel": "0.16.2",
|
|
47
|
+
"@cat-factory/observability-langfuse": "0.7.21",
|
|
48
|
+
"@cat-factory/orchestration": "0.11.1",
|
|
49
|
+
"@cat-factory/spend": "0.8.15",
|
|
50
|
+
"@cat-factory/server": "0.17.2",
|
|
51
|
+
"@cat-factory/prompt-fragments": "0.7.14",
|
|
52
|
+
"@cat-factory/provider-cloudflare": "0.7.23"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@cloudflare/vitest-pool-workers": "^0.16.19",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"typescript": "7.0.1-rc",
|
|
58
58
|
"vitest": "^4.1.9",
|
|
59
59
|
"wrangler": "^4.104.0",
|
|
60
|
-
"@cat-factory/conformance": "0.7.
|
|
60
|
+
"@cat-factory/conformance": "0.7.23"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"build": "tsc -b tsconfig.build.json",
|