@weave-kit/engine 0.10.0 → 1.0.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/CHANGELOG.md +240 -165
- package/README.md +40 -20
- package/dist/adapters/auth/index.d.ts +1 -1
- package/dist/adapters/auth/index.d.ts.map +1 -1
- package/dist/adapters/auth/index.js +1 -1
- package/dist/adapters/auth/index.js.map +1 -1
- package/dist/adapters/auth/source.d.ts +3 -0
- package/dist/adapters/auth/source.d.ts.map +1 -1
- package/dist/adapters/auth/source.js.map +1 -1
- package/dist/adapters/auth/subject.d.ts +6 -0
- package/dist/adapters/auth/subject.d.ts.map +1 -1
- package/dist/adapters/auth/subject.js +15 -0
- package/dist/adapters/auth/subject.js.map +1 -1
- package/dist/adapters/auth/verify.d.ts +2 -0
- package/dist/adapters/auth/verify.d.ts.map +1 -1
- package/dist/adapters/events/index.d.ts.map +1 -1
- package/dist/adapters/events/index.js +6 -1
- package/dist/adapters/events/index.js.map +1 -1
- package/dist/adapters/graphql/http.d.ts.map +1 -1
- package/dist/adapters/graphql/http.js +4 -2
- package/dist/adapters/graphql/http.js.map +1 -1
- package/dist/adapters/graphql/resolvers.d.ts.map +1 -1
- package/dist/adapters/graphql/resolvers.js +1 -0
- package/dist/adapters/graphql/resolvers.js.map +1 -1
- package/dist/adapters/graphql/security.d.ts.map +1 -1
- package/dist/adapters/graphql/security.js +14 -4
- package/dist/adapters/graphql/security.js.map +1 -1
- package/dist/adapters/graphql/types.d.ts +2 -0
- package/dist/adapters/graphql/types.d.ts.map +1 -1
- package/dist/adapters/mcp/generate.d.ts.map +1 -1
- package/dist/adapters/mcp/generate.js +3 -0
- package/dist/adapters/mcp/generate.js.map +1 -1
- package/dist/adapters/mcp/http.d.ts.map +1 -1
- package/dist/adapters/mcp/http.js +30 -7
- package/dist/adapters/mcp/http.js.map +1 -1
- package/dist/adapters/mcp/tools.d.ts.map +1 -1
- package/dist/adapters/mcp/tools.js +12 -1
- package/dist/adapters/mcp/tools.js.map +1 -1
- package/dist/adapters/mcp/types.d.ts +6 -0
- package/dist/adapters/mcp/types.d.ts.map +1 -1
- package/dist/adapters/mcp/types.js.map +1 -1
- package/dist/adapters/openapi/document.d.ts.map +1 -1
- package/dist/adapters/openapi/document.js +2 -1
- package/dist/adapters/openapi/document.js.map +1 -1
- package/dist/adapters/openapi/types.d.ts +1 -0
- package/dist/adapters/openapi/types.d.ts.map +1 -1
- package/dist/adapters/ops/index.d.ts.map +1 -1
- package/dist/adapters/ops/index.js +2 -1
- package/dist/adapters/ops/index.js.map +1 -1
- package/dist/adapters/rest/audit.d.ts.map +1 -1
- package/dist/adapters/rest/audit.js +14 -2
- package/dist/adapters/rest/audit.js.map +1 -1
- package/dist/adapters/rest/ingress.d.ts.map +1 -1
- package/dist/adapters/rest/ingress.js +4 -1
- package/dist/adapters/rest/ingress.js.map +1 -1
- package/dist/adapters/rest/plugin.d.ts.map +1 -1
- package/dist/adapters/rest/plugin.js +14 -5
- package/dist/adapters/rest/plugin.js.map +1 -1
- package/dist/adapters/rest/proxy.d.ts.map +1 -1
- package/dist/adapters/rest/proxy.js +4 -1
- package/dist/adapters/rest/proxy.js.map +1 -1
- package/dist/cli/commands/deploy.d.ts.map +1 -1
- package/dist/cli/commands/deploy.js +60 -1
- package/dist/cli/commands/deploy.js.map +1 -1
- package/dist/cli/commands/doctor.d.ts +6 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +159 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/migrate.d.ts.map +1 -1
- package/dist/cli/commands/migrate.js +13 -0
- package/dist/cli/commands/migrate.js.map +1 -1
- package/dist/cli/index.js +9 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/types/commands.d.ts +18 -0
- package/dist/cli/types/commands.d.ts.map +1 -1
- package/dist/cli/types/index.d.ts +3 -3
- package/dist/cli/types/index.d.ts.map +1 -1
- package/dist/cli/types/index.js +1 -1
- package/dist/cli/types/index.js.map +1 -1
- package/dist/cli/types/values.d.ts +9 -0
- package/dist/cli/types/values.d.ts.map +1 -1
- package/dist/cli/types/values.js +8 -0
- package/dist/cli/types/values.js.map +1 -1
- package/dist/core/audit/types.d.ts +23 -3
- package/dist/core/audit/types.d.ts.map +1 -1
- package/dist/core/audit/types.js.map +1 -1
- package/dist/core/i18n/ar.d.ts.map +1 -1
- package/dist/core/i18n/ar.js +3 -0
- package/dist/core/i18n/ar.js.map +1 -1
- package/dist/core/i18n/de.d.ts.map +1 -1
- package/dist/core/i18n/de.js +3 -0
- package/dist/core/i18n/de.js.map +1 -1
- package/dist/core/i18n/en.d.ts +3 -0
- package/dist/core/i18n/en.d.ts.map +1 -1
- package/dist/core/i18n/en.js +3 -0
- package/dist/core/i18n/en.js.map +1 -1
- package/dist/core/i18n/es.d.ts.map +1 -1
- package/dist/core/i18n/es.js +3 -0
- package/dist/core/i18n/es.js.map +1 -1
- package/dist/core/i18n/fr.d.ts.map +1 -1
- package/dist/core/i18n/fr.js +3 -0
- package/dist/core/i18n/fr.js.map +1 -1
- package/dist/core/i18n/hi.d.ts.map +1 -1
- package/dist/core/i18n/hi.js +3 -0
- package/dist/core/i18n/hi.js.map +1 -1
- package/dist/core/i18n/id.d.ts.map +1 -1
- package/dist/core/i18n/id.js +3 -0
- package/dist/core/i18n/id.js.map +1 -1
- package/dist/core/i18n/ja.d.ts.map +1 -1
- package/dist/core/i18n/ja.js +3 -0
- package/dist/core/i18n/ja.js.map +1 -1
- package/dist/core/i18n/ko.d.ts.map +1 -1
- package/dist/core/i18n/ko.js +3 -0
- package/dist/core/i18n/ko.js.map +1 -1
- package/dist/core/i18n/pt.d.ts.map +1 -1
- package/dist/core/i18n/pt.js +3 -0
- package/dist/core/i18n/pt.js.map +1 -1
- package/dist/core/i18n/ru.d.ts.map +1 -1
- package/dist/core/i18n/ru.js +3 -0
- package/dist/core/i18n/ru.js.map +1 -1
- package/dist/core/i18n/vi.d.ts.map +1 -1
- package/dist/core/i18n/vi.js +3 -0
- package/dist/core/i18n/vi.js.map +1 -1
- package/dist/core/i18n/zh-hant.d.ts.map +1 -1
- package/dist/core/i18n/zh-hant.js +3 -0
- package/dist/core/i18n/zh-hant.js.map +1 -1
- package/dist/core/i18n/zh.d.ts.map +1 -1
- package/dist/core/i18n/zh.js +3 -0
- package/dist/core/i18n/zh.js.map +1 -1
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/limiter/index.d.ts +1 -1
- package/dist/core/limiter/index.d.ts.map +1 -1
- package/dist/core/limiter/index.js +1 -1
- package/dist/core/limiter/index.js.map +1 -1
- package/dist/core/limiter/quota.d.ts +5 -0
- package/dist/core/limiter/quota.d.ts.map +1 -1
- package/dist/core/limiter/quota.js +7 -0
- package/dist/core/limiter/quota.js.map +1 -1
- package/dist/core/object/system-objects.d.ts.map +1 -1
- package/dist/core/object/system-objects.js +2 -0
- package/dist/core/object/system-objects.js.map +1 -1
- package/dist/core/object/validate/field.d.ts.map +1 -1
- package/dist/core/object/validate/field.js +4 -2
- package/dist/core/object/validate/field.js.map +1 -1
- package/dist/core/observability/index.d.ts +64 -0
- package/dist/core/observability/index.d.ts.map +1 -0
- package/dist/core/observability/index.js +41 -0
- package/dist/core/observability/index.js.map +1 -0
- package/dist/core/provider/identity/directory.d.ts +3 -0
- package/dist/core/provider/identity/directory.d.ts.map +1 -1
- package/dist/core/provider/identity/types.d.ts +2 -0
- package/dist/core/provider/identity/types.d.ts.map +1 -1
- package/dist/core/proxy/types.d.ts +3 -0
- package/dist/core/proxy/types.d.ts.map +1 -1
- package/dist/core/proxy/types.js.map +1 -1
- package/dist/core/rbac/rls.d.ts +3 -1
- package/dist/core/rbac/rls.d.ts.map +1 -1
- package/dist/core/rbac/rls.js +12 -1
- package/dist/core/rbac/rls.js.map +1 -1
- package/dist/core/rbac/rowScope.d.ts.map +1 -1
- package/dist/core/rbac/rowScope.js +15 -0
- package/dist/core/rbac/rowScope.js.map +1 -1
- package/dist/core/script/types.d.ts +2 -0
- package/dist/core/script/types.d.ts.map +1 -1
- package/dist/core/script/types.js.map +1 -1
- package/dist/core/storage/impact.d.ts +49 -0
- package/dist/core/storage/impact.d.ts.map +1 -0
- package/dist/core/storage/impact.js +130 -0
- package/dist/core/storage/impact.js.map +1 -0
- package/dist/core/storage/index.d.ts +2 -0
- package/dist/core/storage/index.d.ts.map +1 -1
- package/dist/core/storage/index.js +1 -0
- package/dist/core/storage/index.js.map +1 -1
- package/dist/core/storage/system-tables.d.ts +1 -0
- package/dist/core/storage/system-tables.d.ts.map +1 -1
- package/dist/core/storage/system-tables.js +38 -0
- package/dist/core/storage/system-tables.js.map +1 -1
- package/dist/core/tools/index.d.ts +2 -0
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +2 -0
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/pipeline.d.ts +25 -0
- package/dist/core/tools/pipeline.d.ts.map +1 -1
- package/dist/core/tools/types.d.ts +8 -0
- package/dist/core/tools/types.d.ts.map +1 -1
- package/dist/core/trace.d.ts +29 -0
- package/dist/core/trace.d.ts.map +1 -0
- package/dist/core/trace.js +41 -0
- package/dist/core/trace.js.map +1 -0
- package/dist/core/types/fields.d.ts +2 -0
- package/dist/core/types/fields.d.ts.map +1 -1
- package/dist/core/types/principal.d.ts +11 -3
- package/dist/core/types/principal.d.ts.map +1 -1
- package/dist/core/types/principal.js +19 -5
- package/dist/core/types/principal.js.map +1 -1
- package/dist/core/types/values.d.ts +3 -1
- package/dist/core/types/values.d.ts.map +1 -1
- package/dist/core/types/values.js +3 -1
- package/dist/core/types/values.js.map +1 -1
- package/dist/core/types/workflow.d.ts +7 -1
- package/dist/core/types/workflow.d.ts.map +1 -1
- package/dist/core/types/workflow.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/runtime/data-access/cursor.d.ts +2 -0
- package/dist/runtime/data-access/cursor.d.ts.map +1 -1
- package/dist/runtime/data-access/cursor.js +1 -1
- package/dist/runtime/data-access/cursor.js.map +1 -1
- package/dist/runtime/data-access/index.d.ts +2 -2
- package/dist/runtime/data-access/index.d.ts.map +1 -1
- package/dist/runtime/data-access/index.js +2 -2
- package/dist/runtime/data-access/index.js.map +1 -1
- package/dist/runtime/data-access/query-budget.d.ts.map +1 -1
- package/dist/runtime/data-access/query-budget.js +6 -3
- package/dist/runtime/data-access/query-budget.js.map +1 -1
- package/dist/runtime/data-access/query.d.ts +22 -0
- package/dist/runtime/data-access/query.d.ts.map +1 -1
- package/dist/runtime/data-access/query.js +121 -3
- package/dist/runtime/data-access/query.js.map +1 -1
- package/dist/runtime/data-access/rbac.d.ts +2 -0
- package/dist/runtime/data-access/rbac.d.ts.map +1 -1
- package/dist/runtime/data-access/rbac.js +29 -20
- package/dist/runtime/data-access/rbac.js.map +1 -1
- package/dist/runtime/data-access/sql-executor.d.ts +2 -0
- package/dist/runtime/data-access/sql-executor.d.ts.map +1 -1
- package/dist/runtime/data-access/sql-executor.js +3 -0
- package/dist/runtime/data-access/sql-executor.js.map +1 -1
- package/dist/runtime/data-access/types.d.ts +8 -0
- package/dist/runtime/data-access/types.d.ts.map +1 -1
- package/dist/runtime/data-access/types.js +5 -1
- package/dist/runtime/data-access/types.js.map +1 -1
- package/dist/runtime/engine.d.ts +43 -3
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +56 -17
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/tools/executor.d.ts +9 -1
- package/dist/runtime/tools/executor.d.ts.map +1 -1
- package/dist/runtime/tools/executor.js +84 -32
- package/dist/runtime/tools/executor.js.map +1 -1
- package/dist/subsystems/audit/index.d.ts +12 -1
- package/dist/subsystems/audit/index.d.ts.map +1 -1
- package/dist/subsystems/audit/index.js +16 -0
- package/dist/subsystems/audit/index.js.map +1 -1
- package/dist/subsystems/audit/store.d.ts.map +1 -1
- package/dist/subsystems/audit/store.js +32 -11
- package/dist/subsystems/audit/store.js.map +1 -1
- package/dist/subsystems/evidence/index.d.ts +2 -1
- package/dist/subsystems/evidence/index.d.ts.map +1 -1
- package/dist/subsystems/evidence/index.js +1 -1
- package/dist/subsystems/evidence/index.js.map +1 -1
- package/dist/subsystems/evidence/store.d.ts +7 -1
- package/dist/subsystems/evidence/store.d.ts.map +1 -1
- package/dist/subsystems/evidence/store.js +71 -3
- package/dist/subsystems/evidence/store.js.map +1 -1
- package/dist/subsystems/script/backend/types.d.ts +1 -0
- package/dist/subsystems/script/backend/types.d.ts.map +1 -1
- package/dist/subsystems/script/bridge.d.ts.map +1 -1
- package/dist/subsystems/script/bridge.js +7 -2
- package/dist/subsystems/script/bridge.js.map +1 -1
- package/dist/version.d.ts +8 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +8 -1
- package/dist/version.js.map +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,165 +1,240 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to `@weave-kit/engine`. Format follows [Keep a Changelog](https://keepachangelog.com/);
|
|
4
|
-
the project uses [Semantic Versioning](https://semver.org/).
|
|
5
|
-
|
|
6
|
-
## [0.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
- **
|
|
39
|
-
`
|
|
40
|
-
`
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
###
|
|
49
|
-
|
|
50
|
-
- **
|
|
51
|
-
|
|
52
|
-
- **
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
**
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
- **
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
- **
|
|
126
|
-
and
|
|
127
|
-
- **
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
- **
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
`
|
|
150
|
-
-
|
|
151
|
-
`
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
### Fixed
|
|
163
|
-
|
|
164
|
-
-
|
|
165
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@weave-kit/engine`. Format follows [Keep a Changelog](https://keepachangelog.com/);
|
|
4
|
+
the project uses [Semantic Versioning](https://semver.org/).
|
|
5
|
+
|
|
6
|
+
## [1.0.0]
|
|
7
|
+
|
|
8
|
+
The **G1 contract-freeze** release: the public surface (schema/workflow formats, REST routes, MCP tool
|
|
9
|
+
names, event types, error codes, data-access/RBAC contracts, package exports) is now frozen under
|
|
10
|
+
`CONTRACT_VERSION` (`1`) and evolves **additively** from here. It also lands multi-tenancy, the
|
|
11
|
+
observability seam and operational tooling.
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- **Multi-tenancy (row).** `EngineConfig.tenants = { enabled?, defaultTenant? }`; an object field
|
|
16
|
+
marked `"tenant": true` scopes every read/write to the subject's tenant — RBAC row scope (even for
|
|
17
|
+
`read: "all"`) + native RLS (`weavekit.tenant_id` GUC) + audit (`tenant_id`). The tenant is forced
|
|
18
|
+
on create and immutable on update (`object.tenant.immutable`); `withDefaultTenant` stamps a subject
|
|
19
|
+
that lacks one. Absent tenant = single-tenant (unchanged). Exported `principalTenantId`, `tenantOf`,
|
|
20
|
+
`scopedQuotaKey`, `ROW_SCOPE_MARKERS.TENANT`.
|
|
21
|
+
- **Contract freeze (G1).** `CONTRACT_VERSION` (exported from the package root; mirrored in
|
|
22
|
+
`GET /version` and the OpenAPI `info.x-contract-version`) plus a freeze gate test and the
|
|
23
|
+
contract-freeze / deprecation policy.
|
|
24
|
+
- **Observability seam.** `MetricsSink` / `TraceSink` + single-source `METRIC_NAMES`
|
|
25
|
+
(`core/observability`), injected via `EngineConfig.observability`; the engine emits request
|
|
26
|
+
latency/status, `rbac.deny` and `query.budget.reject`, and records spans. `core/trace.ts`
|
|
27
|
+
(`parseTraceparent`) parses the inbound W3C `traceparent`; the `traceId` threads through
|
|
28
|
+
audit / evidence / events. No-op default; no telemetry backend bundled.
|
|
29
|
+
- **`weave doctor` preflight** — read-only (connection, PostgreSQL compatibility, schema↔DB drift,
|
|
30
|
+
engine system tables, RLS role + sandbox), `--json` supported; `weave migrate --preflight` runs it
|
|
31
|
+
first and aborts on any failure.
|
|
32
|
+
- **`weave deploy plan` schema-impact analysis** (`analyzeImpact` / `SchemaImpact`): creates, column
|
|
33
|
+
adds, constraints, indexes, enum + RLS changes, a data-compat risk and an API-breaking flag, plus
|
|
34
|
+
the live schema revision and a **config-drift** flag.
|
|
35
|
+
- **Audit + evidence keyset cursor.** `AuditQuery.cursor` / `AuditQueryResult.nextCursor` and
|
|
36
|
+
`EvidenceQuery` / `EvidenceQueryResult` + `queryEvidence` (stable `(ts DESC, id DESC)` paging;
|
|
37
|
+
offset still supported).
|
|
38
|
+
- **Enterprise seams** documented and annotated (`@enterprise-reserved`): `AuditSink`,
|
|
39
|
+
`ApprovalsBackend`, `WorkflowTimerStore` / `WorkflowBackend`, `IdentityStore`,
|
|
40
|
+
`AuthSource` / `AuthVerifier`, `GuardrailPolicy`, `ProxyTargetResolver`, `MetricsSink` / `TraceSink`.
|
|
41
|
+
|
|
42
|
+
### Changed
|
|
43
|
+
|
|
44
|
+
- **GraphQL query cost is weighted by the list `limit`** (was a raw field count), matching the
|
|
45
|
+
documented behavior.
|
|
46
|
+
- Query-budget filter counting is robust against malformed `$or` groups.
|
|
47
|
+
|
|
48
|
+
### Fixed
|
|
49
|
+
|
|
50
|
+
- **System-principal audit `actorId` is `'system'`** again (matches the documented contract; the
|
|
51
|
+
specific capability is kept on the event's `meta.capability`).
|
|
52
|
+
- **Tenant write isolation**: `create` forces the tenant column to the subject's tenant, and `update`
|
|
53
|
+
rejects moving a row to another tenant (`object.tenant.immutable`).
|
|
54
|
+
- MCP argument-validation denials are audited under `tool.args.invalid` (not `mcp.tool.notFound`).
|
|
55
|
+
|
|
56
|
+
### Removed
|
|
57
|
+
|
|
58
|
+
- `EngineAuditConfig.retention` — the no-op placeholder is gone (retention / export / compliance are
|
|
59
|
+
the enterprise E2 layer).
|
|
60
|
+
|
|
61
|
+
## [0.11.0]
|
|
62
|
+
|
|
63
|
+
### Added
|
|
64
|
+
|
|
65
|
+
- **Agent Execution pipeline + Evidence.** A protocol-agnostic orchestrator (`runPipeline`,
|
|
66
|
+
`EXECUTION_STAGES` / `ExecutionPlan` / `Evidence` / `EvidenceSink`) runs one execution through
|
|
67
|
+
Plan → Validate → Authorize → Guardrail → Approval → Execute → Commit → Evidence. The custom-tool
|
|
68
|
+
executor and the data-access write path (`create`/`update`/`delete`, action
|
|
69
|
+
`object.<object>.<op>`) now share the same guardrail/approval gate, so REST / MCP generic CRUD /
|
|
70
|
+
GraphQL / script writes are all covered (previously only custom tools and workflow transitions
|
|
71
|
+
were). Tool arguments are validated against the declared `ToolJsonSchema` (`tool.args.invalid`).
|
|
72
|
+
Enable `evidence.enabled` to record one `weavekit_evidence` row per gated execution
|
|
73
|
+
(request/trace/schema-revision correlated). Additive — with no guardrail policies configured and
|
|
74
|
+
evidence disabled, behavior and queries are unchanged.
|
|
75
|
+
|
|
76
|
+
### Fixed
|
|
77
|
+
|
|
78
|
+
- Guardrail/approval is no longer bypassed by MCP generic CRUD and REST writes (new action
|
|
79
|
+
`object.<object>.<op>`).
|
|
80
|
+
|
|
81
|
+
## [0.10.0]
|
|
82
|
+
|
|
83
|
+
### Added
|
|
84
|
+
|
|
85
|
+
- **QueryBudget.** `EngineConfig.queryBudget` bounds a read/query across the engine:
|
|
86
|
+
rows / filters / sorts in data-access (all list paths), joins / SQL length / statement timeout in
|
|
87
|
+
restricted SQL (`this.db.query`), and GraphQL depth. Exported `QueryBudget` / `QUERY_BUDGET_DEFAULTS`
|
|
88
|
+
/ `resolveQueryBudget` / `assertQueryBudget` (`runtime/data-access/query-budget.ts`); a per-context
|
|
89
|
+
`DataAccessContext.budget` overrides the instance default. Additive — default limits only.
|
|
90
|
+
|
|
91
|
+
## [0.9.0]
|
|
92
|
+
|
|
93
|
+
A **breaking** consistency/authorization release. Read the **Breaking** section before upgrading.
|
|
94
|
+
|
|
95
|
+
### Breaking
|
|
96
|
+
|
|
97
|
+
- **`DataAccessContext.principal` is now required; the implicit `subject` field is removed.** The old
|
|
98
|
+
convention — omit `subject` and get unrestricted access — is gone, so a forgotten actor is now a
|
|
99
|
+
**compile error** instead of a silent RBAC bypass. Migrate:
|
|
100
|
+
- a user call → `principal: userPrincipal(subject)` (or a literal `{ kind: 'user', subject }`);
|
|
101
|
+
- an internal/seed/system call → `principal: systemPrincipal(SYSTEM_CAPABILITIES.INTERNAL_ADMIN)`
|
|
102
|
+
(or `{ kind: 'system', capability: 'internal.admin' }`).
|
|
103
|
+
`AccessPrincipal`, `userPrincipal`, `systemPrincipal` and `SYSTEM_CAPABILITIES` are exported from
|
|
104
|
+
the package root. `withRbac` passes through only for an explicit **system** principal.
|
|
105
|
+
|
|
106
|
+
### Added
|
|
107
|
+
|
|
108
|
+
- **Global schema revisions + atomic deploys.** New `weavekit_schema_revision` (append-only, anchored
|
|
109
|
+
on a deterministic aggregate `computeSchemaHash(files)`). `weave migrate` / `weave deploy apply` now
|
|
110
|
+
commit the DDL, the metadata cache and the schema revision in **one transaction** (serialized by an
|
|
111
|
+
advisory lock) — a failure rolls the whole deploy back. New CLI: `weave deploy plan` (read-only
|
|
112
|
+
preview + risk) and `weave deploy apply`.
|
|
113
|
+
- **Audit durability modes.** `subsystems.audit.mode`: `best-effort` (default, unchanged),
|
|
114
|
+
`transactional` (audit row written in the business transaction) and `durable` (transactional outbox
|
|
115
|
+
`weavekit_audit_outbox` + a crash-safe, at-least-once relay). New `AuditSink.recordInTx(event,
|
|
116
|
+
client)` seam; audit events gain `requestId` / `traceId` (new indexed columns).
|
|
117
|
+
- **Cursor pagination.** `FindOptions.cursor` + `FindResult.nextCursor` / `hasMore` (opaque keyset on
|
|
118
|
+
the single primary key). MCP `search_records` accepts `cursor` and returns `hasMore`/`nextCursor`;
|
|
119
|
+
offset remains supported.
|
|
120
|
+
- **Access principal types** (`core/types/principal.ts`): `AccessPrincipal`, `SYSTEM_CAPABILITIES`,
|
|
121
|
+
`userPrincipal`, `systemPrincipal`, `principalSubject`, `principalActorId`.
|
|
122
|
+
|
|
123
|
+
### Changed
|
|
124
|
+
|
|
125
|
+
- **MCP compiled-surface cache** key now includes a schema signature (registry-derived) and the
|
|
126
|
+
custom-tool set, and the cache is bounded — a schema/tool change no longer serves stale tools.
|
|
127
|
+
- **Workflow privileged operations** (`releaseWorkflowLock` / `workflowTodos` / `overrideWorkflow`)
|
|
128
|
+
are now guarded in the RBAC decorator (fail-closed read/update checks) instead of passing through.
|
|
129
|
+
|
|
130
|
+
### Fixed
|
|
131
|
+
|
|
132
|
+
- **Implicit-unrestricted holes** in the custom-tool base context and the transition guardrail
|
|
133
|
+
context: both now carry a user principal, so a tool/policy cannot read unrestricted by omission.
|
|
134
|
+
|
|
135
|
+
## [0.8.0]
|
|
136
|
+
|
|
137
|
+
### Added
|
|
138
|
+
|
|
139
|
+
- **GraphQL adapter (opt-in).** `adapters.graphql` compiles the same `schema.json` into a read/write
|
|
140
|
+
GraphQL endpoint (`/graphql`, POST + GET) that reuses the engine's RBAC / RLS / audit unchanged:
|
|
141
|
+
queries (`<object>` pages + `<object>_by_id`, with nested relations batched per request),
|
|
142
|
+
mutations (`create`/`update`/`delete` plus workflow `transition`), query hardening
|
|
143
|
+
(depth / complexity / alias limits), an operation allow list, and an introspection toggle.
|
|
144
|
+
Its only runtime dependency is `graphql@16` — the engine speaks GraphQL-over-HTTP itself
|
|
145
|
+
(`graphql-http` is not required). New CLI: `weave graphql:schema` emits the SDL offline. **Off by
|
|
146
|
+
default** (`adapters.graphql.enabled`).
|
|
147
|
+
- **Named enums (schema v6).** Declare an enum once in `enums/<name>.json` and reference it from any
|
|
148
|
+
field with `{ "type": "enum", "enumType": "<name>" }`. Values validate centrally, generate named
|
|
149
|
+
TypeScript unions (`weave types`), surface as shared OpenAPI `components.schemas` (with
|
|
150
|
+
`x-enumLabels`), and are listed with `weave enum:list` / `weave enum:check`; `weave field:add
|
|
151
|
+
--enum` wires a new field to an existing enum. The on-disk format is bumped to **v6**
|
|
152
|
+
(`SCHEMA_FORMAT_VERSION`); existing v5 files migrate on read (additive — run `weave schema:upgrade`
|
|
153
|
+
to stamp them).
|
|
154
|
+
|
|
155
|
+
### Changed
|
|
156
|
+
|
|
157
|
+
- **Uncategorized `SchemaError`s now map to HTTP 400** instead of falling through to 500. The error
|
|
158
|
+
space is dominated by request conditions (bad params/fields, RBAC, not-found); genuine server
|
|
159
|
+
faults keep 500 via an explicit set (`http.internal`, `data.schemaDrift`, and script runtime
|
|
160
|
+
failures `script.timeout` / `script.busy` / `script.compile` / `script.sandbox.unavailable`).
|
|
161
|
+
|
|
162
|
+
### Fixed
|
|
163
|
+
|
|
164
|
+
- **MCP session ↔ agent binding.** A follow-up request on an existing session now re-verifies that
|
|
165
|
+
the presented Bearer key is the one that established the session (compared by a non-secret SHA-256
|
|
166
|
+
fingerprint); a different key reusing a session id is rejected with `mcp.session.agentMismatch`.
|
|
167
|
+
The raw API key is no longer stored on the session or written to the audit log — audit `actorId`
|
|
168
|
+
is the credential fingerprint and the agent principal id stays in `meta`.
|
|
169
|
+
|
|
170
|
+
## [0.7.0]
|
|
171
|
+
|
|
172
|
+
### Added
|
|
173
|
+
|
|
174
|
+
- **Node 22 support.** The engine, CLI and scaffolded projects now run on Node **22+** (verified on
|
|
175
|
+
Node 22 and Node 24). `engines.node` is `>=22`; generated projects declare the same.
|
|
176
|
+
|
|
177
|
+
### Changed
|
|
178
|
+
|
|
179
|
+
- `isolated-vm` — the optional native dependency behind the script sandbox — is pinned to
|
|
180
|
+
**`^6.2.0`**, which ships prebuilt binaries for both Node 22 and Node 24 (7.x drops Node 22).
|
|
181
|
+
Behavior is unchanged (the sandbox, RPC bridge and timeout/`__done` handling are covered by the
|
|
182
|
+
same tests on both runtimes). Note: prebuilds are no longer published for Node 26 — on that
|
|
183
|
+
runtime the script sandbox may fall back to a source build.
|
|
184
|
+
|
|
185
|
+
## [0.6.0]
|
|
186
|
+
|
|
187
|
+
A breaking release. The data model, access control and workflow were reworked end to end. Read the
|
|
188
|
+
**Breaking** section before upgrading.
|
|
189
|
+
|
|
190
|
+
### Breaking
|
|
191
|
+
|
|
192
|
+
- **Record ids are the `record_key`.** A record's external id is now a single URL-safe string that
|
|
193
|
+
encodes the (possibly composite) primary key, surfaced as the read-only `weave_id` field. REST
|
|
194
|
+
`/{id}`, MCP `id` and batch `ids[]` all take this string — read it from a result or `describe_object`
|
|
195
|
+
instead of composing the raw primary key.
|
|
196
|
+
- **Field types are bucketed** into PG-native value types and engine-shipped custom types. `person`
|
|
197
|
+
was renamed to `user`; `SCALAR` was removed; `currency` accepts an optional ISO 4217 code (and an
|
|
198
|
+
optional `precision`); `json` now maps to PostgreSQL `json` — use `jsonb` for the old behavior. Run
|
|
199
|
+
`weave schema:upgrade`.
|
|
200
|
+
- **Row scopes add `department`** (`own | department | all`) plus a separate `manage` scope for writes,
|
|
201
|
+
and a scope column's ids can be `internal` (engine ids) or `external` (customer ids).
|
|
202
|
+
- **Identity directory** — the engine now owns `weavekit_user` / `weavekit_department`; sync an external
|
|
203
|
+
source with `weave sync:identity`, authenticate through a verifier, and manage users over the admin
|
|
204
|
+
REST surface.
|
|
205
|
+
- **`multiRelation` uses a link table** (real FK per side, `ON DELETE CASCADE`) instead of a column;
|
|
206
|
+
reads and filters are scoped to the targets the subject can read.
|
|
207
|
+
- **Workflow rewritten to a single-line node chain** (`workflow.json` format v2). v1 state-machine
|
|
208
|
+
files are linearized on read. Instance/step/workitem state lives in engine tables
|
|
209
|
+
(`weavekit_workflow_instances` / `_steps` / `_workitems`, plus locks/definitions/timers). New
|
|
210
|
+
REST + MCP surface; `weave workflow:migrate` was **removed**; the side-table column
|
|
211
|
+
`workflow_id` was renamed to `workflow_instance_id`; `weave migrate` drops and recreates the timer
|
|
212
|
+
table.
|
|
213
|
+
- **Engine-owned system tables + runtime zero-DDL.** All DDL is emitted by `weave migrate`; the runtime
|
|
214
|
+
never alters or drops customer columns (reads only).
|
|
215
|
+
- **Security hardening** — formula references respect RBAC, `details` children inherit (and can only
|
|
216
|
+
narrow) their parent's permissions, DDL literals are escaped, and script SQL is gated by an AST pass.
|
|
217
|
+
|
|
218
|
+
### Added
|
|
219
|
+
|
|
220
|
+
- Record-metadata side tables with `weave_*` virtual fields (`weave_id`, `weave_status`,
|
|
221
|
+
`weave_owner_id`, `weave_created_by`/`_modified_by`, `weave_created_time`/`_modified_time`,
|
|
222
|
+
`weave_workflow_instance_id`) — request them in `fields`, and they work in `filter` / `sort`.
|
|
223
|
+
- Field types: native PG enums for static `enum`s, data-driven `enum` options, `seq_no`, `uuid`,
|
|
224
|
+
`smallint`/`bigint`/`real`/`double`/`char`, numeric `precision`/`scale`, `json`/`jsonb`.
|
|
225
|
+
- Reverse-modeling: `weave introspect` handles composite primary keys and native enum/array columns;
|
|
226
|
+
`weave schema:map` reports schema↔column drift.
|
|
227
|
+
- Workflow actions `submit` / `approve` / `reject` / `forward` / `withdraw` / `cancel` / `reactivate`,
|
|
228
|
+
any-one / all approvals, node timeouts, an admin override, and definition write-back.
|
|
229
|
+
- `describe_object` exposes a field's resolved type `base`.
|
|
230
|
+
|
|
231
|
+
### Changed
|
|
232
|
+
|
|
233
|
+
- `weave migrate` registers content-addressed workflow definitions; instances pin the hash they started
|
|
234
|
+
under, so editing `workflow.json` only affects new records.
|
|
235
|
+
- Live `record.transitioned` events carry `from` / `to` / `action`.
|
|
236
|
+
|
|
237
|
+
### Fixed
|
|
238
|
+
|
|
239
|
+
- Correct row-scope parameter offset on `update` / `delete` / `transition`.
|
|
240
|
+
- `record_key` encoding is single-sourced in SQL (contract-tested).
|
package/README.md
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
<h1 align="center">Let AI agents operate your data — safely</h1>
|
|
2
2
|
|
|
3
|
-
Define your data model once in `schema.json`, and WeaveKit compiles it into PostgreSQL tables,
|
|
4
|
-
|
|
5
|
-
agents call with typed tools — never raw SQL. Self-hosted: your data
|
|
3
|
+
Define your data model once in `schema.json`, and WeaveKit compiles it into PostgreSQL tables, REST
|
|
4
|
+
and GraphQL APIs with row- and field-level RBAC, an immutable audit log with execution evidence, and
|
|
5
|
+
an MCP tool surface that AI agents call with typed tools — never raw SQL. Self-hosted: your data
|
|
6
|
+
stays in your database.
|
|
6
7
|
|
|
7
8
|
```
|
|
8
9
|
objects/leads/schema.json → Git commit (source of truth)
|
|
9
10
|
PostgreSQL tables + indexes + RLS
|
|
10
|
-
REST
|
|
11
|
-
MCP tools (per-identity surface + guardrails)
|
|
12
|
-
Immutable audit log
|
|
11
|
+
REST + GraphQL APIs (CRUD + RBAC)
|
|
12
|
+
MCP tools (per-identity surface + guardrails + approvals)
|
|
13
|
+
Immutable audit log + execution evidence
|
|
13
14
|
TypeScript types
|
|
14
15
|
```
|
|
15
16
|
|
|
@@ -29,8 +30,8 @@ objects/leads/schema.json → Git commit (source of truth)
|
|
|
29
30
|
- **Typed tools in minutes, not weeks** — hand-writing an MCP server (tools + permissions + audit)
|
|
30
31
|
for a few tables takes days; here it is a few `schema.json` files, and new fields or tables
|
|
31
32
|
extend the tool surface automatically.
|
|
32
|
-
- **More than MCP** — the same schema also drives
|
|
33
|
-
people and agents share one governed contract.
|
|
33
|
+
- **More than MCP** — the same schema also drives REST and GraphQL APIs and generated TypeScript
|
|
34
|
+
types, so people and agents share one governed contract.
|
|
34
35
|
- **Self-hosted** — the engine runs in your environment; no data leaves your database.
|
|
35
36
|
|
|
36
37
|
## How it works
|
|
@@ -52,23 +53,38 @@ write.
|
|
|
52
53
|
types. Declared in a project-local, Git-committed `field-types/` directory.
|
|
53
54
|
- **Named enums** — declare a shared enum once in `enums/` and reference it from any object by
|
|
54
55
|
`enumType`; every field shares one native PostgreSQL type and one set of per-value labels.
|
|
55
|
-
- **Governed REST API** — object CRUD with row-level (`all`/`own`/`
|
|
56
|
-
uniform error contract.
|
|
56
|
+
- **Governed REST API** — object CRUD with row-level (`all`/`own`/`department`) and field-level RBAC
|
|
57
|
+
and a uniform error contract.
|
|
57
58
|
- **MCP tool surface** — a streamable HTTP endpoint at `/mcp` with a per-identity tool surface and
|
|
58
59
|
guardrails.
|
|
59
60
|
- **GraphQL API** — an opt-in read/write GraphQL endpoint compiled from the same `schema.json`, with
|
|
60
61
|
nested relations, the same RBAC/audit, per-request batching and query hardening.
|
|
61
|
-
- **
|
|
62
|
+
- **Schema revisions & atomic deploys** — `weave deploy plan` previews the diff; `weave deploy apply`
|
|
63
|
+
commits the DDL, the metadata cache and a global **schema revision** in one transaction (no
|
|
64
|
+
half-applied deploys).
|
|
65
|
+
- **Agent execution pipeline** — every write and tool call runs through one
|
|
66
|
+
Plan → Validate → Authorize → Guardrail → Approval → Execute → Commit → Evidence pipeline, so
|
|
67
|
+
guardrails and approvals cover REST, MCP and GraphQL alike; enable `evidence` to record a
|
|
68
|
+
`weavekit_evidence` row per execution (correlated by request / trace / schema revision).
|
|
69
|
+
- **Query budget** — bound a read/query across the engine: rows, filters and sorts in data-access,
|
|
70
|
+
joins / SQL length / statement timeout in restricted SQL, and GraphQL depth.
|
|
71
|
+
- **Multi-tenancy (row)** — mark a field `"tenant": true` and every read/write is scoped to the
|
|
72
|
+
subject's tenant (RBAC row scope + PostgreSQL RLS + audit); single-tenant by default.
|
|
73
|
+
- **Audit log** — an immutable event log for data mutations, with durability modes
|
|
74
|
+
(`best-effort` / `transactional` / `durable`) and a keyset-cursor query.
|
|
75
|
+
- **Observability** — a low-level metrics/trace seam (`MetricsSink` / `TraceSink`, `METRIC_NAMES`)
|
|
76
|
+
that emits request latency, RBAC denials, query-budget rejects and W3C `traceparent`-correlated
|
|
77
|
+
spans; the engine ships a no-op default and brings no backend.
|
|
62
78
|
- **Sandboxed hooks** — `*.server.js` lifecycle hooks running in isolated workers.
|
|
63
79
|
- **Type generation** — object-level TypeScript types derived from the schema.
|
|
64
80
|
- **Live events** — an SSE stream with replay.
|
|
65
|
-
- **Operations** — health / readiness / version endpoints, request rate
|
|
66
|
-
structured logging.
|
|
81
|
+
- **Operations** — `weave doctor` preflight, health / readiness / version endpoints, request rate
|
|
82
|
+
limiting, CORS and structured logging.
|
|
67
83
|
|
|
68
84
|
## Requirements
|
|
69
85
|
|
|
70
86
|
- Node.js 22+
|
|
71
|
-
- PostgreSQL
|
|
87
|
+
- PostgreSQL 12+ (the engine's tested floor; `weave doctor` reports the version)
|
|
72
88
|
|
|
73
89
|
## Quick start
|
|
74
90
|
|
|
@@ -100,11 +116,11 @@ Full documentation: **[docs.weavekit.io/engine](https://docs.weavekit.io/engine)
|
|
|
100
116
|
|
|
101
117
|
- [Getting started](https://docs.weavekit.io/engine/guides/getting-started) — scaffold, migrate, run, consume
|
|
102
118
|
- [Git-versioned metadata](https://docs.weavekit.io/engine/guides/model/git-versioned-metadata) — your data model as reviewable Git commits
|
|
103
|
-
- [Schema guide](https://docs.weavekit.io/engine/guides/model/schema) · [RBAC](https://docs.weavekit.io/engine/guides/access/rbac) · [Formulas](https://docs.weavekit.io/engine/guides/model/formulas) · [Audit](https://docs.weavekit.io/engine/guides/platform/audit)
|
|
104
|
-
- [CLI reference](https://docs.weavekit.io/engine/guides/platform/cli) · [MCP](https://docs.weavekit.io/engine/guides/agents/mcp) · [Script hooks](https://docs.weavekit.io/engine/guides/automation/script-hooks)
|
|
105
|
-
- [Custom tools & guardrails](https://docs.weavekit.io/engine/guides/agents/custom-tools-and-guardrails) · [Custom field types](https://docs.weavekit.io/engine/reference/schema/custom-field-types) · [Quotas](https://docs.weavekit.io/engine/guides/automation/quotas) · [Inbound events](https://docs.weavekit.io/engine/guides/integration/ingress)
|
|
106
|
-
- [Public API & dependency budget](https://docs.weavekit.io/engine/reference/api/public-api)
|
|
107
|
-
- [Practices & operations](https://docs.weavekit.io/engine/practices/agent/existing-crm-to-mcp) — real integration and deployment walkthroughs
|
|
119
|
+
- [Schema guide](https://docs.weavekit.io/engine/guides/model/schema) · [RBAC](https://docs.weavekit.io/engine/guides/access/rbac) · [Multi-tenancy](https://docs.weavekit.io/engine/guides/access/multi-tenancy) · [Formulas](https://docs.weavekit.io/engine/guides/model/formulas) · [Audit](https://docs.weavekit.io/engine/guides/platform/audit)
|
|
120
|
+
- [CLI reference](https://docs.weavekit.io/engine/guides/platform/cli) · [Observability](https://docs.weavekit.io/engine/guides/platform/observability) · [MCP](https://docs.weavekit.io/engine/guides/agents/mcp) · [Execution & evidence](https://docs.weavekit.io/engine/guides/agents/execution-and-evidence) · [Script hooks](https://docs.weavekit.io/engine/guides/automation/script-hooks)
|
|
121
|
+
- [Custom tools & guardrails](https://docs.weavekit.io/engine/guides/agents/custom-tools-and-guardrails) · [Query budget](https://docs.weavekit.io/engine/guides/automation/query-budget) · [Custom field types](https://docs.weavekit.io/engine/reference/schema/custom-field-types) · [Quotas](https://docs.weavekit.io/engine/guides/automation/quotas) · [Inbound events](https://docs.weavekit.io/engine/guides/integration/ingress)
|
|
122
|
+
- [Public API & dependency budget](https://docs.weavekit.io/engine/reference/api/public-api) · [Enterprise seams](https://docs.weavekit.io/engine/reference/enterprise-seams) · [Contract freeze](https://docs.weavekit.io/engine/reference/contract-freeze)
|
|
123
|
+
- [Practices & operations](https://docs.weavekit.io/engine/practices/agent/existing-crm-to-mcp) · [Release checklist](https://docs.weavekit.io/engine/operations/release) — real integration and deployment walkthroughs
|
|
108
124
|
|
|
109
125
|
The Markdown sources live in [`docs/`](https://github.com/weavekit/engine/tree/main/docs).
|
|
110
126
|
|
|
@@ -135,6 +151,8 @@ await engine.app.listen({ port: 3000 });
|
|
|
135
151
|
| Command | Description |
|
|
136
152
|
| --- | --- |
|
|
137
153
|
| `weave migrate [--dry-run]` | State-diff migration + metadata cache + auto-commit |
|
|
154
|
+
| `weave deploy plan` / `weave deploy apply` | Preview / atomically apply schema changes and record a global schema revision |
|
|
155
|
+
| `weave doctor` | Read-only preflight (connection, PostgreSQL compatibility, drift, system tables, RLS + sandbox) |
|
|
138
156
|
| `weave dev [--port]` | Run with hot reload |
|
|
139
157
|
| `weave build` | Bundle the server entry (esbuild) |
|
|
140
158
|
| `weave test` | Proxy the project test suite |
|
|
@@ -152,7 +170,7 @@ await engine.app.listen({ port: 3000 });
|
|
|
152
170
|
| `weave field-type:check` | Validate registrations + schemas against the registry |
|
|
153
171
|
| `weave enum:list` | List declared named enums (`enums/<name>.json`) |
|
|
154
172
|
| `weave enum:check` | Validate enum declarations + schema references |
|
|
155
|
-
| `weave module:add` / `module:remove <name>` | Enable/disable an optional subsystem (audit/script) |
|
|
173
|
+
| `weave module:add` / `module:remove <name>` | Enable/disable an optional subsystem (audit/script/workflow) |
|
|
156
174
|
|
|
157
175
|
## Object-level types
|
|
158
176
|
|
|
@@ -174,8 +192,10 @@ const { rows } = await leads.find({ filter: { status: 'open' } });
|
|
|
174
192
|
npm install
|
|
175
193
|
npm run build # tsc → dist
|
|
176
194
|
npm test # unit + e2e (e2e needs DATABASE_URL)
|
|
195
|
+
npm run test:coverage # coverage gate on security-critical paths
|
|
177
196
|
npm run typecheck
|
|
178
197
|
npm run lint
|
|
198
|
+
node scripts/check-exports.mjs # verify package exports + contract names
|
|
179
199
|
```
|
|
180
200
|
|
|
181
201
|
Issues and pull requests are welcome. See [`AGENTS.md`](AGENTS.md) for architecture notes and
|
|
@@ -4,7 +4,7 @@ import { type AuthConfig, type Authenticator } from './source.js';
|
|
|
4
4
|
export type { Authenticator, AuthConfig, AuthResolver, AuthSource } from './source.js';
|
|
5
5
|
export { createAuth } from './source.js';
|
|
6
6
|
export type { AuthVerifier } from './verify.js';
|
|
7
|
-
export { createDirectoryAuthenticator, enforceSyncedIdentity } from './subject.js';
|
|
7
|
+
export { createDirectoryAuthenticator, enforceSyncedIdentity, withDefaultTenant } from './subject.js';
|
|
8
8
|
/**
|
|
9
9
|
* Resolve the Authorization header into a subject, or throw a 401-family
|
|
10
10
|
* {@link SchemaError}. Missing header → `auth.missingKey`; present but
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAc,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAE9E,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAc,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAE9E,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtG;;;;GAIG;AACH,wBAAsB,YAAY,CAChC,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,eAAe,CAAC,CAK1B;AAED,0FAA0F;AAC1F,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,UAAU,GAAG,aAAa,CAEpE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SchemaError } from '../../core/index.js';
|
|
2
2
|
import { createAuth } from './source.js';
|
|
3
3
|
export { createAuth } from './source.js';
|
|
4
|
-
export { createDirectoryAuthenticator, enforceSyncedIdentity } from './subject.js';
|
|
4
|
+
export { createDirectoryAuthenticator, enforceSyncedIdentity, withDefaultTenant } from './subject.js';
|
|
5
5
|
/**
|
|
6
6
|
* Resolve the Authorization header into a subject, or throw a 401-family
|
|
7
7
|
* {@link SchemaError}. Missing header → `auth.missingKey`; present but
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/auth/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAuC,MAAM,aAAa,CAAC;AAG9E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/auth/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAuC,MAAM,aAAa,CAAC;AAG9E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtG;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,aAA4B,EAC5B,MAA0B,EAC1B,MAAc;IAEd,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACpD,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,OAAO,CAAC;IACrC,IAAI,MAAM,KAAK,SAAS;QAAE,MAAM,IAAI,WAAW,CAAC,iBAAiB,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;IAC/E,MAAM,IAAI,WAAW,CAAC,iBAAiB,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;AACvD,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,kBAAkB,CAAC,MAAkB;IACnD,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -13,6 +13,9 @@ export type AuthResolver = (header: string | undefined) => IdentitySubject | nul
|
|
|
13
13
|
/**
|
|
14
14
|
* The authentication source: either a static key map or a resolver function.
|
|
15
15
|
* `source` is required whenever `auth` is configured (fail fast otherwise).
|
|
16
|
+
*
|
|
17
|
+
* Stable seam (`@enterprise-reserved`): SSO/OIDC/SAML is enterprise E1; the
|
|
18
|
+
* engine ships static-key and custom-resolver sources.
|
|
16
19
|
*/
|
|
17
20
|
export type AuthSource = Record<string, IdentitySubject> | AuthResolver;
|
|
18
21
|
/** authentication config — the single source of truth is `source` */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../src/adapters/auth/source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,+FAA+F;AAC/F,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,eAAe,GAAG,IAAI,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;CAC/F;AAED;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,eAAe,GAAG,IAAI,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;AAEpH
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../src/adapters/auth/source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,+FAA+F;AAC/F,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,eAAe,GAAG,IAAI,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;CAC/F;AAED;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,eAAe,GAAG,IAAI,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;AAEpH;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,YAAY,CAAC;AAExE,qEAAqE;AACrE,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,UAAU,CAAC;CACpB;AAED,gFAAgF;AAChF,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,aAAa,CAiB5D"}
|