@cat-factory/worker 0.129.0 → 0.131.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/index.d.ts.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/container-assembly.d.ts.map +1 -1
- package/dist/infrastructure/container-assembly.js +43 -28
- package/dist/infrastructure/container-assembly.js.map +1 -1
- package/dist/infrastructure/container-shared-services.d.ts +49 -0
- package/dist/infrastructure/container-shared-services.d.ts.map +1 -0
- package/dist/infrastructure/container-shared-services.js +130 -0
- package/dist/infrastructure/container-shared-services.js.map +1 -0
- package/dist/infrastructure/container.d.ts +60 -3
- package/dist/infrastructure/container.d.ts.map +1 -1
- package/dist/infrastructure/container.js +53 -117
- package/dist/infrastructure/container.js.map +1 -1
- package/dist/infrastructure/repositories/D1FoundationalServiceRepository.d.ts +38 -0
- package/dist/infrastructure/repositories/D1FoundationalServiceRepository.d.ts.map +1 -0
- package/dist/infrastructure/repositories/D1FoundationalServiceRepository.js +280 -0
- package/dist/infrastructure/repositories/D1FoundationalServiceRepository.js.map +1 -0
- package/dist/infrastructure/repositories/D1WorkspaceSettingsRepository.d.ts.map +1 -1
- package/dist/infrastructure/repositories/D1WorkspaceSettingsRepository.js +9 -4
- package/dist/infrastructure/repositories/D1WorkspaceSettingsRepository.js.map +1 -1
- package/dist/infrastructure/workflows/ExecutionWorkflow.d.ts.map +1 -1
- package/dist/infrastructure/workflows/ExecutionWorkflow.js +110 -84
- package/dist/infrastructure/workflows/ExecutionWorkflow.js.map +1 -1
- package/migrations/0073_foundational_services.sql +84 -0
- package/migrations/0073_workspace_metadata.sql +9 -0
- package/package.json +18 -18
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
-- Foundational services (docs/initiatives/foundational-services.md).
|
|
2
|
+
-- A tiered catalog of shared capabilities (file storage, notifications, audit …) that a
|
|
3
|
+
-- designed system is expected to CONSUME rather than rebuild. Rows are scoped by an
|
|
4
|
+
-- (owner_kind, owner_id) pair — an account id or a workspace id — exactly like the
|
|
5
|
+
-- prompt-fragment library, so one table backs both tenancy tiers and a workspace tombstone
|
|
6
|
+
-- can suppress an inherited account service.
|
|
7
|
+
--
|
|
8
|
+
-- Identity and DOCUMENTS are deliberately separate tables. The Architect's catalog read runs
|
|
9
|
+
-- on every design dispatch and must never load a contract body (an OpenAPI document routinely
|
|
10
|
+
-- runs to hundreds of kilobytes, one per service); only the consumer steps, for only the
|
|
11
|
+
-- services the design declared, read `api_contracts.body`. Keeping them apart makes that a
|
|
12
|
+
-- property of the schema rather than a discipline every caller has to remember.
|
|
13
|
+
|
|
14
|
+
CREATE TABLE foundational_services (
|
|
15
|
+
service_id TEXT NOT NULL, -- the slug an Architect names in its design
|
|
16
|
+
owner_kind TEXT NOT NULL, -- 'account' | 'workspace'
|
|
17
|
+
owner_id TEXT NOT NULL,
|
|
18
|
+
name TEXT NOT NULL,
|
|
19
|
+
summary TEXT NOT NULL, -- one line; the catalog's relevance signal
|
|
20
|
+
description TEXT NOT NULL DEFAULT '', -- what it does, when to use it, what it does NOT cover
|
|
21
|
+
capabilities TEXT NOT NULL DEFAULT '[]', -- JSON string[] of capability tags
|
|
22
|
+
source_id TEXT, -- → foundational_service_sources.id (repo-sourced)
|
|
23
|
+
source_path TEXT,
|
|
24
|
+
pinned_commit TEXT, -- head commit the service dir was synced at
|
|
25
|
+
created_at INTEGER NOT NULL,
|
|
26
|
+
updated_at INTEGER NOT NULL,
|
|
27
|
+
deleted_at INTEGER, -- tombstone (removed upstream / suppressed by tier)
|
|
28
|
+
PRIMARY KEY (owner_kind, owner_id, service_id)
|
|
29
|
+
);
|
|
30
|
+
CREATE INDEX idx_foundational_services_owner
|
|
31
|
+
ON foundational_services (owner_kind, owner_id) WHERE deleted_at IS NULL;
|
|
32
|
+
CREATE INDEX idx_foundational_services_source
|
|
33
|
+
ON foundational_services (source_id) WHERE deleted_at IS NULL;
|
|
34
|
+
|
|
35
|
+
CREATE TABLE api_contracts (
|
|
36
|
+
owner_kind TEXT NOT NULL,
|
|
37
|
+
owner_id TEXT NOT NULL,
|
|
38
|
+
service_id TEXT NOT NULL,
|
|
39
|
+
contract_id TEXT NOT NULL, -- slug within the service (the file basename)
|
|
40
|
+
format TEXT NOT NULL, -- 'openapi' | 'toad-contract' | 'lokalise-api-contract'
|
|
41
|
+
title TEXT NOT NULL,
|
|
42
|
+
body TEXT NOT NULL, -- the document verbatim (never read by the catalog)
|
|
43
|
+
-- Operations indexed ONCE at write time, so the catalog can show an agent what the interface
|
|
44
|
+
-- offers without loading a body. JSON string[]; empty for the TypeScript formats.
|
|
45
|
+
operations TEXT NOT NULL DEFAULT '[]',
|
|
46
|
+
omitted_operations INTEGER NOT NULL DEFAULT 0,
|
|
47
|
+
source_path TEXT, -- repo provenance; null for a direct upload
|
|
48
|
+
source_sha TEXT,
|
|
49
|
+
created_at INTEGER NOT NULL,
|
|
50
|
+
updated_at INTEGER NOT NULL,
|
|
51
|
+
PRIMARY KEY (owner_kind, owner_id, service_id, contract_id)
|
|
52
|
+
);
|
|
53
|
+
-- The catalog's manifest read (whole tier, no bodies) and the lazy read (a set of service ids)
|
|
54
|
+
-- both ride this index.
|
|
55
|
+
CREATE INDEX idx_api_contracts_owner
|
|
56
|
+
ON api_contracts (owner_kind, owner_id, service_id);
|
|
57
|
+
|
|
58
|
+
CREATE TABLE foundational_service_sources (
|
|
59
|
+
id TEXT NOT NULL PRIMARY KEY,
|
|
60
|
+
owner_kind TEXT NOT NULL,
|
|
61
|
+
owner_id TEXT NOT NULL,
|
|
62
|
+
repo_owner TEXT NOT NULL,
|
|
63
|
+
repo_name TEXT NOT NULL,
|
|
64
|
+
git_ref TEXT NOT NULL DEFAULT 'HEAD',
|
|
65
|
+
-- 'directory' scans <dir_path>/<service>/; 'files' reads an explicit path list for ONE service.
|
|
66
|
+
mode TEXT NOT NULL DEFAULT 'directory',
|
|
67
|
+
-- The scanned subtree ('directory'), or the linked files' deepest common directory ('files').
|
|
68
|
+
-- Either way it is what the single head-commit staleness probe anchors on.
|
|
69
|
+
dir_path TEXT NOT NULL DEFAULT '',
|
|
70
|
+
file_paths TEXT NOT NULL DEFAULT '[]', -- JSON string[]; 'files' mode only
|
|
71
|
+
service_id TEXT, -- 'files' mode only: the service they describe
|
|
72
|
+
service_name TEXT,
|
|
73
|
+
service_summary TEXT,
|
|
74
|
+
last_synced_commit TEXT,
|
|
75
|
+
last_synced_at INTEGER,
|
|
76
|
+
created_at INTEGER NOT NULL,
|
|
77
|
+
deleted_at INTEGER,
|
|
78
|
+
UNIQUE (owner_kind, owner_id, repo_owner, repo_name, git_ref, dir_path)
|
|
79
|
+
);
|
|
80
|
+
CREATE INDEX idx_foundational_sources_owner
|
|
81
|
+
ON foundational_service_sources (owner_kind, owner_id) WHERE deleted_at IS NULL;
|
|
82
|
+
-- The autorefresh sweep drains the oldest-synced live sources in bounded batches.
|
|
83
|
+
CREATE INDEX idx_foundational_sources_stale
|
|
84
|
+
ON foundational_service_sources (last_synced_at) WHERE deleted_at IS NULL;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
-- Custom workspace metadata: the values for the metadata FIELDS a deployment declares in
|
|
2
|
+
-- its app (an external-tool URL resolver reads them to open the tool already scoped to this
|
|
3
|
+
-- workspace). One JSON object per workspace on the existing settings row rather than a table
|
|
4
|
+
-- of key/value pairs: the whole bag is always read together, always written together, and is
|
|
5
|
+
-- bounded (64 entries) by the contract.
|
|
6
|
+
--
|
|
7
|
+
-- Nullable with no default, which is how every other JSON column on this table spells "no
|
|
8
|
+
-- value" (`task_limit_per_type`); the repository reads a missing/garbled blob as `{}`.
|
|
9
|
+
ALTER TABLE workspace_settings ADD COLUMN metadata TEXT;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/worker",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.131.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,22 +42,22 @@
|
|
|
42
42
|
"pino": "^10.3.1",
|
|
43
43
|
"valibot": "^1.4.2",
|
|
44
44
|
"workers-ai-provider": "^4.0.0",
|
|
45
|
-
"@cat-factory/agents": "0.
|
|
46
|
-
"@cat-factory/caching": "0.
|
|
47
|
-
"@cat-factory/
|
|
48
|
-
"@cat-factory/
|
|
49
|
-
"@cat-factory/
|
|
50
|
-
"@cat-factory/
|
|
51
|
-
"@cat-factory/
|
|
52
|
-
"@cat-factory/
|
|
53
|
-
"@cat-factory/
|
|
54
|
-
"@cat-factory/
|
|
55
|
-
"@cat-factory/
|
|
56
|
-
"@cat-factory/orchestration": "0.
|
|
57
|
-
"@cat-factory/prompt-fragments": "0.15.
|
|
58
|
-
"@cat-factory/provider-cloudflare": "0.7.
|
|
59
|
-
"@cat-factory/server": "0.
|
|
60
|
-
"@cat-factory/spend": "0.12.
|
|
45
|
+
"@cat-factory/agents": "0.96.1",
|
|
46
|
+
"@cat-factory/caching": "0.12.1",
|
|
47
|
+
"@cat-factory/contracts": "0.205.0",
|
|
48
|
+
"@cat-factory/consensus": "0.13.14",
|
|
49
|
+
"@cat-factory/eks": "0.1.188",
|
|
50
|
+
"@cat-factory/gates": "0.8.34",
|
|
51
|
+
"@cat-factory/gitlab": "0.14.17",
|
|
52
|
+
"@cat-factory/integrations": "0.113.9",
|
|
53
|
+
"@cat-factory/kernel": "0.204.0",
|
|
54
|
+
"@cat-factory/observability-otel": "0.4.31",
|
|
55
|
+
"@cat-factory/observability-langfuse": "0.9.31",
|
|
56
|
+
"@cat-factory/orchestration": "0.180.0",
|
|
57
|
+
"@cat-factory/prompt-fragments": "0.15.28",
|
|
58
|
+
"@cat-factory/provider-cloudflare": "0.7.340",
|
|
59
|
+
"@cat-factory/server": "0.188.1",
|
|
60
|
+
"@cat-factory/spend": "0.12.135"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@cloudflare/vitest-pool-workers": "^0.18.8",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"typescript": "7.0.2",
|
|
66
66
|
"vitest": "^4.1.10",
|
|
67
67
|
"wrangler": "^4.114.0",
|
|
68
|
-
"@cat-factory/conformance": "0.
|
|
68
|
+
"@cat-factory/conformance": "0.18.0"
|
|
69
69
|
},
|
|
70
70
|
"scripts": {
|
|
71
71
|
"build": "tsc -b tsconfig.build.json",
|