@stigmer/server 3.18.1-dev.20260919070736 → 3.19.1-dev.20260920100552
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/authorization/model/index.d.ts +1 -1
- package/dist/authorization/model/index.d.ts.map +1 -1
- package/dist/authorization/model/index.js +0 -2
- package/dist/authorization/model/index.js.map +1 -1
- package/dist/authorization/model/organization.d.ts.map +1 -1
- package/dist/authorization/model/organization.js +0 -1
- package/dist/authorization/model/organization.js.map +1 -1
- package/dist/boot/compose.d.ts.map +1 -1
- package/dist/boot/compose.js +2 -15
- package/dist/boot/compose.js.map +1 -1
- package/dist/boot/inprocess.d.ts +2 -13
- package/dist/boot/inprocess.d.ts.map +1 -1
- package/dist/boot/inprocess.js +6 -16
- package/dist/boot/inprocess.js.map +1 -1
- package/dist/domain/agentexecution/lifecycle.js +1 -1
- package/dist/domain/agentexecution/lifecycle.js.map +1 -1
- package/dist/domain/mcpserver/initiate-oauth-connect.d.ts.map +1 -1
- package/dist/domain/mcpserver/initiate-oauth-connect.js +22 -1
- package/dist/domain/mcpserver/initiate-oauth-connect.js.map +1 -1
- package/dist/domain/workflow/registry/data/task-kind-registry.json +0 -1
- package/dist/domain/workflowexecution/lifecycle.js +1 -1
- package/dist/domain/workflowexecution/lifecycle.js.map +1 -1
- package/dist/pipeline/interceptors/auth.d.ts +1 -1
- package/dist/pipeline/interceptors/auth.js +1 -1
- package/dist/query/search/registry.d.ts +3 -5
- package/dist/query/search/registry.d.ts.map +1 -1
- package/dist/query/search/registry.js +3 -7
- package/dist/query/search/registry.js.map +1 -1
- package/dist/sandbox/kubernetes.d.ts.map +1 -1
- package/dist/sandbox/kubernetes.js +8 -1
- package/dist/sandbox/kubernetes.js.map +1 -1
- package/dist/sandbox/provisioner.d.ts +20 -5
- package/dist/sandbox/provisioner.d.ts.map +1 -1
- package/dist/sandbox/provisioner.js.map +1 -1
- package/dist/sandbox/steps.d.ts +22 -8
- package/dist/sandbox/steps.d.ts.map +1 -1
- package/dist/sandbox/steps.js +17 -12
- package/dist/sandbox/steps.js.map +1 -1
- package/dist/store/postgres/migrations.d.ts +3 -1
- package/dist/store/postgres/migrations.d.ts.map +1 -1
- package/dist/store/postgres/migrations.js +19 -1
- package/dist/store/postgres/migrations.js.map +1 -1
- package/dist/store/sqlite/migrations.d.ts +3 -1
- package/dist/store/sqlite/migrations.d.ts.map +1 -1
- package/dist/store/sqlite/migrations.js +22 -1
- package/dist/store/sqlite/migrations.js.map +1 -1
- package/package.json +6 -6
- package/src/authorization/__tests__/derived-tuples.test.ts +1 -1
- package/src/authorization/__tests__/fixtures/fga/org-admin-owner-inheritance.fga.yaml +5 -5
- package/src/authorization/__tests__/wire-permissions.test.ts +0 -1
- package/src/authorization/model/__tests__/registry.test.ts +0 -9
- package/src/authorization/model/index.ts +1 -3
- package/src/authorization/model/organization.ts +0 -1
- package/src/boot/compose.ts +2 -15
- package/src/boot/inprocess.ts +8 -29
- package/src/domain/agentexecution/lifecycle.ts +1 -1
- package/src/domain/iampolicy/__tests__/role-lifecycle.test.ts +0 -1
- package/src/domain/mcpserver/__tests__/oauth-handshake.test.ts +1 -1
- package/src/domain/mcpserver/initiate-oauth-connect.ts +21 -1
- package/src/domain/workflow/registry/data/task-kind-registry.json +0 -1
- package/src/domain/workflowexecution/lifecycle.ts +1 -1
- package/src/pipeline/__tests__/router-transport.test.ts +1 -1
- package/src/pipeline/interceptors/auth.ts +1 -1
- package/src/query/__tests__/query-services.test.ts +16 -18
- package/src/query/search/__tests__/criteria.test.ts +3 -6
- package/src/query/search/__tests__/query-store.test.ts +21 -21
- package/src/query/search/registry.ts +3 -7
- package/src/sandbox/__tests__/docker.integration.test.ts +2 -0
- package/src/sandbox/__tests__/kubernetes.test.ts +10 -2
- package/src/sandbox/__tests__/local-process.integration.test.ts +3 -0
- package/src/sandbox/__tests__/steps.test.ts +72 -19
- package/src/sandbox/kubernetes.ts +8 -1
- package/src/sandbox/provisioner.ts +20 -5
- package/src/sandbox/steps.ts +29 -12
- package/src/store/postgres/__tests__/migrations.test.ts +23 -4
- package/src/store/postgres/migrations.ts +20 -1
- package/src/store/sqlite/__tests__/migrations.test.ts +26 -2
- package/src/store/sqlite/migrations.ts +23 -1
- package/dist/authorization/model/project.d.ts +0 -2
- package/dist/authorization/model/project.d.ts.map +0 -1
- package/dist/authorization/model/project.js +0 -32
- package/dist/authorization/model/project.js.map +0 -1
- package/dist/domain/project/controller.d.ts +0 -48
- package/dist/domain/project/controller.d.ts.map +0 -1
- package/dist/domain/project/controller.js +0 -192
- package/dist/domain/project/controller.js.map +0 -1
- package/dist/domain/project/reconcile.d.ts +0 -77
- package/dist/domain/project/reconcile.d.ts.map +0 -1
- package/dist/domain/project/reconcile.js +0 -179
- package/dist/domain/project/reconcile.js.map +0 -1
- package/dist/domain/project/search-extractor.d.ts +0 -3
- package/dist/domain/project/search-extractor.d.ts.map +0 -1
- package/dist/domain/project/search-extractor.js +0 -43
- package/dist/domain/project/search-extractor.js.map +0 -1
- package/src/authorization/model/project.ts +0 -47
- package/src/domain/project/__tests__/project.composed.test.ts +0 -381
- package/src/domain/project/__tests__/reconcile.test.ts +0 -447
- package/src/domain/project/controller.ts +0 -387
- package/src/domain/project/reconcile.ts +0 -296
- package/src/domain/project/search-extractor.ts +0 -71
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export const SCHEMA_VERSION_1 = 1;
|
|
2
2
|
export const SCHEMA_VERSION_2 = 2;
|
|
3
3
|
export const SCHEMA_VERSION_3 = 3;
|
|
4
|
+
/** v4: the rows of the removed Project kind deleted. */
|
|
5
|
+
export const SCHEMA_VERSION_4 = 4;
|
|
4
6
|
/** Target version for new databases. */
|
|
5
|
-
export const CURRENT_SCHEMA_VERSION =
|
|
7
|
+
export const CURRENT_SCHEMA_VERSION = SCHEMA_VERSION_4;
|
|
6
8
|
/**
|
|
7
9
|
* Advisory lock key for the migration chain. Arbitrary but stable 64-bit
|
|
8
10
|
* value, derived from ASCII "STGMR1" — collisions with other advisory-lock
|
|
@@ -29,6 +31,7 @@ export async function runMigrations(client) {
|
|
|
29
31
|
[SCHEMA_VERSION_1, migrateToV1],
|
|
30
32
|
[SCHEMA_VERSION_2, migrateToV2],
|
|
31
33
|
[SCHEMA_VERSION_3, migrateToV3],
|
|
34
|
+
[SCHEMA_VERSION_4, migrateToV4],
|
|
32
35
|
];
|
|
33
36
|
for (const [version, migrate] of chain) {
|
|
34
37
|
if (currentVersion < version) {
|
|
@@ -239,4 +242,19 @@ async function migrateToV3(client) {
|
|
|
239
242
|
CREATE INDEX idx_oauth_grant_resource ON oauth_grant (resource_id, org_id);
|
|
240
243
|
`);
|
|
241
244
|
}
|
|
245
|
+
/**
|
|
246
|
+
* v4: the Project kind (kind 60, id prefix "prj") was removed from the
|
|
247
|
+
* contract, so a database seeded by an earlier release may hold rows no
|
|
248
|
+
* code can read, list or delete any more. The chain's first data
|
|
249
|
+
* migration, and the same shape as the sqlite driver's v9: rows deleted,
|
|
250
|
+
* not archived (the audit table is the version history of kinds the
|
|
251
|
+
* server serves), keyed on the enum NAME the kind column holds
|
|
252
|
+
* (proto-fields.ts apiResourceKindName), the search index left to boot's
|
|
253
|
+
* RebuildIndex. Member rows the Project once listed are ordinary
|
|
254
|
+
* resources of their own kinds and stay.
|
|
255
|
+
*/
|
|
256
|
+
async function migrateToV4(client) {
|
|
257
|
+
await client.query(`DELETE FROM resources WHERE kind = 'project'`);
|
|
258
|
+
await client.query(`DELETE FROM resource_audit WHERE kind = 'project'`);
|
|
259
|
+
}
|
|
242
260
|
//# sourceMappingURL=migrations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrations.js","sourceRoot":"","sources":["../../../src/store/postgres/migrations.ts"],"names":[],"mappings":"AAwCA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAClC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAClC,MAAM,CAAC,MAAM,gBAAgB,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M,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;IACnE,MAAM,MAAM,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;AAC1E,CAAC"}
|
|
@@ -41,8 +41,10 @@ export declare const SCHEMA_VERSION_6 = 6;
|
|
|
41
41
|
export declare const SCHEMA_VERSION_7 = 7;
|
|
42
42
|
/** v8: the by-resource grant-teardown index (the C3 channel installer). */
|
|
43
43
|
export declare const SCHEMA_VERSION_8 = 8;
|
|
44
|
+
/** v9: the rows of the removed Project kind deleted. */
|
|
45
|
+
export declare const SCHEMA_VERSION_9 = 9;
|
|
44
46
|
/** Target version for new databases. */
|
|
45
|
-
export declare const CURRENT_SCHEMA_VERSION =
|
|
47
|
+
export declare const CURRENT_SCHEMA_VERSION = 9;
|
|
46
48
|
/** Applies all pending migrations in order. */
|
|
47
49
|
export declare function runMigrations(db: DatabaseSync): void;
|
|
48
50
|
/** Current schema version; 0 when none has been recorded yet. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../../src/store/sqlite/migrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,gFAAgF;AAChF,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,2EAA2E;AAC3E,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC,wCAAwC;AACxC,eAAO,MAAM,sBAAsB,IAAmB,CAAC;AAEvD,+CAA+C;AAC/C,wBAAgB,aAAa,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../../src/store/sqlite/migrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,gFAAgF;AAChF,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,2EAA2E;AAC3E,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,wDAAwD;AACxD,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC,wCAAwC;AACxC,eAAO,MAAM,sBAAsB,IAAmB,CAAC;AAEvD,+CAA+C;AAC/C,wBAAgB,aAAa,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CA2BpD;AAED,iEAAiE;AACjE,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,YAAY,GAAG,MAAM,CAKzD"}
|
|
@@ -8,8 +8,10 @@ export const SCHEMA_VERSION_6 = 6;
|
|
|
8
8
|
export const SCHEMA_VERSION_7 = 7;
|
|
9
9
|
/** v8: the by-resource grant-teardown index (the C3 channel installer). */
|
|
10
10
|
export const SCHEMA_VERSION_8 = 8;
|
|
11
|
+
/** v9: the rows of the removed Project kind deleted. */
|
|
12
|
+
export const SCHEMA_VERSION_9 = 9;
|
|
11
13
|
/** Target version for new databases. */
|
|
12
|
-
export const CURRENT_SCHEMA_VERSION =
|
|
14
|
+
export const CURRENT_SCHEMA_VERSION = SCHEMA_VERSION_9;
|
|
13
15
|
/** Applies all pending migrations in order. */
|
|
14
16
|
export function runMigrations(db) {
|
|
15
17
|
db.exec(`
|
|
@@ -28,6 +30,7 @@ export function runMigrations(db) {
|
|
|
28
30
|
[SCHEMA_VERSION_6, migrateToV6],
|
|
29
31
|
[SCHEMA_VERSION_7, migrateToV7],
|
|
30
32
|
[SCHEMA_VERSION_8, migrateToV8],
|
|
33
|
+
[SCHEMA_VERSION_9, migrateToV9],
|
|
31
34
|
];
|
|
32
35
|
for (const [version, migrate] of chain) {
|
|
33
36
|
if (currentVersion < version) {
|
|
@@ -288,4 +291,22 @@ function migrateToV8(db) {
|
|
|
288
291
|
CREATE INDEX IF NOT EXISTS idx_oauth_grant_resource ON oauth_grant(resource_id, org_id);
|
|
289
292
|
`);
|
|
290
293
|
}
|
|
294
|
+
/**
|
|
295
|
+
* v9: the Project kind (kind 60, id prefix "prj") was removed from the
|
|
296
|
+
* contract, so a database seeded by an earlier release may hold rows no
|
|
297
|
+
* code can read, list or delete any more. Rows are deleted, not archived:
|
|
298
|
+
* the audit table is the version history of kinds the server serves, and
|
|
299
|
+
* bytes of a kind nothing will ever decode are not history. The kind
|
|
300
|
+
* column holds the enum NAME (proto-fields.ts apiResourceKindName), which
|
|
301
|
+
* is why the literal string works after the enum value is gone. The search
|
|
302
|
+
* index is not touched here: boot's RebuildIndex clears it and re-indexes
|
|
303
|
+
* only the registered kinds. Member rows the Project once listed are
|
|
304
|
+
* ordinary resources of their own kinds and stay.
|
|
305
|
+
*/
|
|
306
|
+
function migrateToV9(db) {
|
|
307
|
+
db.exec(`
|
|
308
|
+
DELETE FROM resources WHERE kind = 'project';
|
|
309
|
+
DELETE FROM resource_audit WHERE kind = 'project';
|
|
310
|
+
`);
|
|
311
|
+
}
|
|
291
312
|
//# sourceMappingURL=migrations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrations.js","sourceRoot":"","sources":["../../../src/store/sqlite/migrations.ts"],"names":[],"mappings":"AAkCA,MAAM,CAAC,MAAM,gBAAg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;;;;;;GAiDP,CAAC,CAAC;IAEH,sEAAsE;IACtE,qEAAqE;IACrE,sEAAsE;IACtE,kEAAkE;IAClE,KAAK,MAAM,KAAK,IAAI;QAClB,yEAAyE;QACzE,uFAAuF;KACxF,EAAE,CAAC;QACF,IAAI,CAAC;YACH,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC;QAAC,MAAM,CAAC;YACP,wEAAwE;QAC1E,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAS,WAAW,CAAC,EAAgB;IACnC,EAAE,CAAC,IAAI,CAAC;;GAEP,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,WAAW,CAAC,EAAgB;IACnC,EAAE,CAAC,IAAI,CAAC;;;GAGP,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stigmer/server",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.19.1-dev.20260920100552",
|
|
4
4
|
"description": "The Stigmer OSS control plane as a composable library: composeServer, the extension registry and the driver seams a composition builds on. The self-contained deployable of the same server is @stigmer/server-slim.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -62,11 +62,11 @@
|
|
|
62
62
|
"@connectrpc/connect-node": "^2.0.0",
|
|
63
63
|
"@kubernetes/client-node": "2.0.0",
|
|
64
64
|
"@opentelemetry/api": "^1.9.0",
|
|
65
|
-
"@stigmer/outbound": "3.
|
|
66
|
-
"@stigmer/plugin-package": "3.
|
|
67
|
-
"@stigmer/protos": "3.
|
|
68
|
-
"@stigmer/temporal-codecs": "3.
|
|
69
|
-
"@stigmer/zip-structure": "3.
|
|
65
|
+
"@stigmer/outbound": "3.19.1-dev.20260920100552",
|
|
66
|
+
"@stigmer/plugin-package": "3.19.1-dev.20260920100552",
|
|
67
|
+
"@stigmer/protos": "3.19.1-dev.20260920100552",
|
|
68
|
+
"@stigmer/temporal-codecs": "3.19.1-dev.20260920100552",
|
|
69
|
+
"@stigmer/zip-structure": "3.19.1-dev.20260920100552",
|
|
70
70
|
"@temporalio/activity": "1.16.2",
|
|
71
71
|
"@temporalio/client": "1.16.2",
|
|
72
72
|
"@temporalio/common": "1.16.2",
|
|
@@ -189,7 +189,7 @@ describe("deriveTuples — the cloud driver's shapes, from the row", () => {
|
|
|
189
189
|
});
|
|
190
190
|
|
|
191
191
|
it("kinds with no visibility axis derive no viewer tuple at any level — their audience is the model's own line", () => {
|
|
192
|
-
for (const type of ["artifact", "schedule", "
|
|
192
|
+
for (const type of ["artifact", "schedule", "session"]) {
|
|
193
193
|
expect(
|
|
194
194
|
derivedFor(type, {
|
|
195
195
|
visibility: ApiResourceVisibility.visibility_org,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# Store tests for org-admin owner inheritance (T08).
|
|
6
6
|
#
|
|
7
7
|
# Blueprint kinds — agent, agent_share, agent_channel, channel_app,
|
|
8
|
-
# schedule, skill, workflow,
|
|
8
|
+
# schedule, skill, workflow, plugin — compose org admins into `owner`:
|
|
9
9
|
#
|
|
10
10
|
# define owner: [identity_account] or admin from organization
|
|
11
11
|
#
|
|
@@ -94,10 +94,10 @@ tuples:
|
|
|
94
94
|
object: workflow:carols-flow
|
|
95
95
|
- user: organization:acme
|
|
96
96
|
relation: organization
|
|
97
|
-
object:
|
|
97
|
+
object: plugin:carols-plugin
|
|
98
98
|
- user: identity_account:carol
|
|
99
99
|
relation: owner
|
|
100
|
-
object:
|
|
100
|
+
object: plugin:carols-plugin
|
|
101
101
|
|
|
102
102
|
# --- carol's personal resources (organization tuple present, so a
|
|
103
103
|
# wrongly-added inheritance WOULD resolve — these must stay denied) ---
|
|
@@ -186,7 +186,7 @@ tests:
|
|
|
186
186
|
can_delete: true
|
|
187
187
|
can_grant_access: true
|
|
188
188
|
- user: identity_account:ana
|
|
189
|
-
object:
|
|
189
|
+
object: plugin:carols-plugin
|
|
190
190
|
assertions:
|
|
191
191
|
can_view: true
|
|
192
192
|
can_edit: true
|
|
@@ -257,7 +257,7 @@ tests:
|
|
|
257
257
|
can_edit: false
|
|
258
258
|
can_delete: false
|
|
259
259
|
- user: identity_account:zara
|
|
260
|
-
object:
|
|
260
|
+
object: plugin:carols-plugin
|
|
261
261
|
assertions:
|
|
262
262
|
can_view: false
|
|
263
263
|
can_edit: false
|
|
@@ -35,7 +35,6 @@ const DECLARED_KINDS = [
|
|
|
35
35
|
ApiResourceKind.api_key,
|
|
36
36
|
ApiResourceKind.oauth_app,
|
|
37
37
|
ApiResourceKind.organization,
|
|
38
|
-
ApiResourceKind.project,
|
|
39
38
|
ApiResourceKind.agent,
|
|
40
39
|
ApiResourceKind.agent_channel,
|
|
41
40
|
ApiResourceKind.agent_share,
|
|
@@ -99,7 +98,6 @@ const WIRE_PERMISSIONS_BY_TYPE: Readonly<
|
|
|
99
98
|
"can_view",
|
|
100
99
|
"can_edit",
|
|
101
100
|
"can_delete",
|
|
102
|
-
"can_create_project",
|
|
103
101
|
"can_create_agent",
|
|
104
102
|
"can_create_workflow",
|
|
105
103
|
"can_create_session",
|
|
@@ -118,13 +116,6 @@ const WIRE_PERMISSIONS_BY_TYPE: Readonly<
|
|
|
118
116
|
"can_view_billing",
|
|
119
117
|
"can_manage_billing",
|
|
120
118
|
],
|
|
121
|
-
project: [
|
|
122
|
-
"can_view",
|
|
123
|
-
"can_edit",
|
|
124
|
-
"can_delete",
|
|
125
|
-
"can_grant_access",
|
|
126
|
-
"can_view_access",
|
|
127
|
-
],
|
|
128
119
|
agent: [
|
|
129
120
|
"can_view",
|
|
130
121
|
"can_edit",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* chain past the depth bound) and for the cloud's drift test, which
|
|
13
13
|
* builds a model from the live `.fga` files and compares.
|
|
14
14
|
*
|
|
15
|
-
* Registered: every kind of the open-source tier — the twenty-
|
|
15
|
+
* Registered: every kind of the open-source tier — the twenty-three
|
|
16
16
|
* `kind_meta.tier: open_source` members — and nothing else. The four
|
|
17
17
|
* files `fga.mod` lists that have no declaration here (`platform`,
|
|
18
18
|
* `identity_provider`, `platform_client`, `invitation`) are kinds this
|
|
@@ -39,7 +39,6 @@ import { memoryDeclaration } from "./memory.js";
|
|
|
39
39
|
import { oauthAppDeclaration } from "./oauth_app.js";
|
|
40
40
|
import { organizationDeclaration } from "./organization.js";
|
|
41
41
|
import { pluginDeclaration } from "./plugin.js";
|
|
42
|
-
import { projectDeclaration } from "./project.js";
|
|
43
42
|
import type { KindDeclaration } from "./rewrite.js";
|
|
44
43
|
import { scheduleDeclaration } from "./schedule.js";
|
|
45
44
|
import { sessionDeclaration } from "./session.js";
|
|
@@ -79,7 +78,6 @@ export const builtInModel: Model = newModel([
|
|
|
79
78
|
apiKeyDeclaration,
|
|
80
79
|
oauthAppDeclaration,
|
|
81
80
|
organizationDeclaration,
|
|
82
|
-
projectDeclaration,
|
|
83
81
|
agentDeclaration,
|
|
84
82
|
agentChannelDeclaration,
|
|
85
83
|
agentShareDeclaration,
|
|
@@ -33,7 +33,6 @@ export const organizationDeclaration = declareKind({
|
|
|
33
33
|
["can_delete", computed("owner")],
|
|
34
34
|
["can_manage_members", computed("admin")],
|
|
35
35
|
["can_assign_roles", computed("owner")],
|
|
36
|
-
["can_create_project", computed("admin")],
|
|
37
36
|
["can_create_agent", computed("admin")],
|
|
38
37
|
["can_create_workflow", computed("admin")],
|
|
39
38
|
["can_create_session", union(computed("member"), computed("guest"))],
|
package/src/boot/compose.ts
CHANGED
|
@@ -112,7 +112,6 @@ import { registerOrganizationServices } from "../domain/organization/controller.
|
|
|
112
112
|
import { registerMcpServerServices } from "../domain/mcpserver/controller.js";
|
|
113
113
|
import { registerPlatformServices } from "../domain/platform/controller.js";
|
|
114
114
|
import { SERVER_VERSION } from "../domain/platform/version.js";
|
|
115
|
-
import { registerProjectServices } from "../domain/project/controller.js";
|
|
116
115
|
import { registerSessionServices } from "../domain/session/controller.js";
|
|
117
116
|
import { registerPluginServices } from "../domain/plugin/controller.js";
|
|
118
117
|
import { PLUGIN_ARTIFACT_KEY_PREFIX } from "../domain/plugin/constants.js";
|
|
@@ -1494,22 +1493,10 @@ export async function composeServer(
|
|
|
1494
1493
|
logger,
|
|
1495
1494
|
authorizer,
|
|
1496
1495
|
});
|
|
1497
|
-
// Project registers after all four reconciled kinds (agent, workflow,
|
|
1498
|
-
// mcpserver, skill) — the last Class A domain. The lazy deleter
|
|
1499
|
-
// provider replaces Go's SetReconciliationService late-bind
|
|
1500
|
-
// (server.go 478 registration + 635–648 injection): orphan deletes
|
|
1501
|
-
// route through the in-process command clients' FULL pipelines.
|
|
1502
|
-
registerProjectServices(router, {
|
|
1503
|
-
store,
|
|
1504
|
-
logger,
|
|
1505
|
-
authorizer,
|
|
1506
|
-
authorizationLifecycle,
|
|
1507
|
-
orphanDeleter: () => requireInProcess().projectOrphanDeleter,
|
|
1508
|
-
});
|
|
1509
1496
|
// The two CQRS query services register between the domains and the
|
|
1510
1497
|
// github/platform tail, mirroring Go's registration order
|
|
1511
|
-
// (server.go:
|
|
1512
|
-
//
|
|
1498
|
+
// (server.go: organization 487 → search 493 → activity 513 →
|
|
1499
|
+
// github 524 → platform 530).
|
|
1513
1500
|
registerSearchServices(router, { handler: searchHandler, logger });
|
|
1514
1501
|
registerActivityServices(router, { handler: activityHandler, logger });
|
|
1515
1502
|
// GitHub broker: config-only, no store (Go server.go 524–528).
|
package/src/boot/inprocess.ts
CHANGED
|
@@ -74,7 +74,6 @@ import type { PluginMaterializer } from "../domain/plugin/materialize/ports.js";
|
|
|
74
74
|
import { UpdateVisibilityInputSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
75
75
|
import type { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
76
76
|
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
77
|
-
import type { OrphanDeleter } from "../domain/project/reconcile.js";
|
|
78
77
|
import type { ExecutionStatusWriter } from "../temporal/agentexecution/activities.js";
|
|
79
78
|
import type { ScheduleExecutionCreator } from "../temporal/schedule/run-starter.js";
|
|
80
79
|
import { buildInterceptorChain } from "../pipeline/chain.js";
|
|
@@ -126,15 +125,6 @@ export interface InProcessClients {
|
|
|
126
125
|
readonly workflowExecutionContextCreator: WorkflowExecutionContextCreator;
|
|
127
126
|
readonly workflowExecutionApprovalForwarder: AgentExecutionApprovalForwarder;
|
|
128
127
|
readonly workflowExecutionFileDecisionForwarder: AgentExecutionFileDecisionForwarder;
|
|
129
|
-
/**
|
|
130
|
-
* The project reconciler's orphan-delete edge (server.go 635-648: Go's
|
|
131
|
-
* DownstreamClients + ResourceDeleterAdapter). Go retains the four full
|
|
132
|
-
* CRUD client interfaces; the reconciler uses ONLY Delete, so this
|
|
133
|
-
* surface exposes only the delete routing — every orphan delete runs the
|
|
134
|
-
* owning domain's FULL pipeline (referential blocks included) through
|
|
135
|
-
* the same interceptor chain as an external delete.
|
|
136
|
-
*/
|
|
137
|
-
readonly projectOrphanDeleter: OrphanDeleter;
|
|
138
128
|
/**
|
|
139
129
|
* The schedule clock's fire edge (server.go 581: the RunStarter's
|
|
140
130
|
* in-process agentexecution client): every fire — cron tick or manual
|
|
@@ -153,7 +143,7 @@ export interface InProcessClients {
|
|
|
153
143
|
* broadcast) and carry the internal caller class this transport's
|
|
154
144
|
* position 1 stamps. The worker builds no identity of its own: server
|
|
155
145
|
* code acting on its own behalf rides this lane, where the class is
|
|
156
|
-
* minted — exactly like the schedule clock
|
|
146
|
+
* minted — exactly like the schedule clock above.
|
|
157
147
|
*/
|
|
158
148
|
readonly executionStatusWriter: ExecutionStatusWriter;
|
|
159
149
|
/**
|
|
@@ -163,8 +153,7 @@ export interface InProcessClients {
|
|
|
163
153
|
* delete) AS THE INSTALLING CALLER (the asCaller call options), so a
|
|
164
154
|
* materialised skill is attributed to the user who installed it and
|
|
165
155
|
* carries the plugin's reserved labels by the in-process origin the
|
|
166
|
-
* guards pass structurally.
|
|
167
|
-
* switch, shared.
|
|
156
|
+
* guards pass structurally.
|
|
168
157
|
*/
|
|
169
158
|
readonly pluginMaterializer: PluginMaterializer;
|
|
170
159
|
}
|
|
@@ -391,15 +380,6 @@ export function createInProcessClients(
|
|
|
391
380
|
executionStatusWriter: {
|
|
392
381
|
updateStatus: (input) => agentExecutionCommand.updateStatus(input),
|
|
393
382
|
},
|
|
394
|
-
// The project reconciler's delete routing — Go's
|
|
395
|
-
// ResourceDeleterAdapter.Delete switch (execution_engine.go:75-92).
|
|
396
|
-
// The unsupported-kind default is defense-in-depth kept for Go parity:
|
|
397
|
-
// the reconciler's slug resolver rejects unsupported kinds before any
|
|
398
|
-
// delete is attempted, in both editions. Log-only surface: reconcile
|
|
399
|
-
// failures never reach the wire.
|
|
400
|
-
projectOrphanDeleter: {
|
|
401
|
-
delete: (kind, resourceId) => deleteByKind(kind, resourceId),
|
|
402
|
-
},
|
|
403
383
|
pluginMaterializer: {
|
|
404
384
|
pushSkill: (request, caller) =>
|
|
405
385
|
skillCommand.push(request, asCaller(caller)),
|
|
@@ -417,13 +397,12 @@ export function createInProcessClients(
|
|
|
417
397
|
};
|
|
418
398
|
|
|
419
399
|
/**
|
|
420
|
-
* Delete routing for the four
|
|
421
|
-
*
|
|
422
|
-
*
|
|
423
|
-
*
|
|
424
|
-
*
|
|
425
|
-
*
|
|
426
|
-
* before any delete is attempted.
|
|
400
|
+
* Delete routing for the four member kinds a plugin materialises, used
|
|
401
|
+
* by the plugin controller as the installing caller. Every member delete
|
|
402
|
+
* runs the owning domain's FULL pipeline (referential blocks included)
|
|
403
|
+
* through the same interceptor chain as an external delete. The
|
|
404
|
+
* unsupported-kind default is defense-in-depth: the plugin's member
|
|
405
|
+
* reader refuses unsupported kinds before any delete is attempted.
|
|
427
406
|
*/
|
|
428
407
|
async function deleteByKind(
|
|
429
408
|
kind: ApiResourceKind,
|
|
@@ -208,7 +208,6 @@ describe("onResourceCreated: the creator owns the organization", () => {
|
|
|
208
208
|
ApiResourceKind.workflow,
|
|
209
209
|
ApiResourceKind.session,
|
|
210
210
|
ApiResourceKind.identity_account,
|
|
211
|
-
ApiResourceKind.project,
|
|
212
211
|
])(
|
|
213
212
|
"writes nothing for kind %s even under DIRECT attribution — a per-resource owner row is the grant the scope keeps Enterprise",
|
|
214
213
|
async (kind) => {
|
|
@@ -343,7 +343,7 @@ describe("initiateOAuthConnect", () => {
|
|
|
343
343
|
await expectCode(
|
|
344
344
|
command.initiateOAuthConnect({ mcpServerId: id, org: ORG }),
|
|
345
345
|
Code.FailedPrecondition,
|
|
346
|
-
"does not advertise a registration_endpoint for DCR",
|
|
346
|
+
"does not advertise a registration_endpoint for DCR: 127.0.0.1:",
|
|
347
347
|
);
|
|
348
348
|
mockAs.reset();
|
|
349
349
|
});
|
|
@@ -201,8 +201,15 @@ async function initiateDcr(
|
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
if (metadata.registrationEndpoint === "") {
|
|
204
|
+
// A login server without RFC 7591 registration cannot take a client
|
|
205
|
+
// Stigmer mints on the spot; the sentence keeps its opening (the
|
|
206
|
+
// conformance suite's pin before this clause joined it) and tells the
|
|
207
|
+
// user the one thing that helps: an OAuth app registered with the
|
|
208
|
+
// vendor, referenced from the server's definition.
|
|
204
209
|
throw failedPreconditionError(
|
|
205
|
-
`MCP server at ${serverUrl} does not advertise a registration_endpoint for DCR
|
|
210
|
+
`MCP server at ${serverUrl} does not advertise a registration_endpoint for DCR: ` +
|
|
211
|
+
`${loginServerHost(metadata, serverUrl)} does not allow automatic client registration, so this server needs ` +
|
|
212
|
+
"an OAuth app registered with the vendor and referenced from its definition (auth.oauth_app_ref)",
|
|
206
213
|
);
|
|
207
214
|
}
|
|
208
215
|
|
|
@@ -280,6 +287,19 @@ async function initiateDcr(
|
|
|
280
287
|
};
|
|
281
288
|
}
|
|
282
289
|
|
|
290
|
+
/** The login server a user must register with: its metadata's issuer, else its authorization endpoint, else the URL we asked. */
|
|
291
|
+
function loginServerHost(metadata: { issuer: string; authorizationEndpoint: string }, serverUrl: string): string {
|
|
292
|
+
for (const candidate of [metadata.issuer, metadata.authorizationEndpoint, serverUrl]) {
|
|
293
|
+
try {
|
|
294
|
+
const host = new URL(candidate).host;
|
|
295
|
+
if (host !== "") return host;
|
|
296
|
+
} catch {
|
|
297
|
+
// Not a URL; try the next candidate.
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return serverUrl;
|
|
301
|
+
}
|
|
302
|
+
|
|
283
303
|
async function initiateVendorOAuth(
|
|
284
304
|
deps: McpServerConnectDeps,
|
|
285
305
|
mcpServer: McpServer,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Spike SP-B (D2 spike register): `createRouterTransport` traverses the
|
|
3
3
|
* FULL interceptor chain on in-process calls.
|
|
4
4
|
*
|
|
5
|
-
* Why this matters: Go serves internal calls (
|
|
5
|
+
* Why this matters: Go serves internal calls (plugin member deletes,
|
|
6
6
|
* cascades, schedule RunStarter creates) through the same *grpc.Server over
|
|
7
7
|
* an in-memory bufconn precisely so validation parity holds — an internal
|
|
8
8
|
* call is validated exactly like an external one. The TS equivalent is
|
|
@@ -346,7 +346,7 @@ export function encodeInProcessCaller(caller: CallerIdentity): string {
|
|
|
346
346
|
* while transport-trust arms (the reserved-label guard) still see
|
|
347
347
|
* the server-composed origin.
|
|
348
348
|
* - MINTED: no propagated identity — the daemon-origin default (the
|
|
349
|
-
* schedule clock
|
|
349
|
+
* schedule clock): the internal caller class
|
|
350
350
|
* carrying the operator's identity fields, so audit stamps on
|
|
351
351
|
* daemon writes stay byte-identical to the pre-R5 posture. The
|
|
352
352
|
* Authorize step treats the internal class as the in-process
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
* historically returned UNIMPLEMENTED for activity), synchronous
|
|
6
6
|
* index-on-write feeds search over the wire, the protovalidate
|
|
7
7
|
* interceptor answers the two InvalidArgument arms, and BOOT-TIME
|
|
8
|
-
* RebuildIndex makes pre-existing rows
|
|
9
|
-
* adopted database, whose domain is not yet ported (#16) — searchable
|
|
8
|
+
* RebuildIndex makes pre-existing rows on an adopted database searchable
|
|
10
9
|
* with zero pipeline writes (DD-D/DD-F).
|
|
11
10
|
*/
|
|
12
11
|
import { mkdtempSync, rmSync } from "node:fs";
|
|
@@ -21,11 +20,11 @@ import { createGrpcTransport } from "@connectrpc/connect-node";
|
|
|
21
20
|
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
22
21
|
|
|
23
22
|
import { ActivityQueryController } from "@stigmer/protos/ai/stigmer/activity/v1/query_pb";
|
|
23
|
+
import { SkillSchema } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/api_pb";
|
|
24
24
|
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
25
25
|
import { SearchService } from "@stigmer/protos/ai/stigmer/search/v1/query_pb";
|
|
26
26
|
import { OrganizationSchema } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/api_pb";
|
|
27
27
|
import { OrganizationCommandController } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/command_pb";
|
|
28
|
-
import { ProjectSchema } from "@stigmer/protos/ai/stigmer/tenancy/project/v1/api_pb";
|
|
29
28
|
|
|
30
29
|
import { loadConfig } from "../../boot/config.js";
|
|
31
30
|
import { composeServer } from "../../boot/compose.js";
|
|
@@ -146,9 +145,8 @@ describe("boot-time RebuildIndex (DD-D/DD-F)", () => {
|
|
|
146
145
|
dir = mkdtempSync(path.join(tmpdir(), "query-rebuild-test-"));
|
|
147
146
|
// Pre-seed the database DIRECTLY — resource rows only, no index
|
|
148
147
|
// writes — the adopted-database shape: rows exist, the FTS index
|
|
149
|
-
// knows nothing about them.
|
|
150
|
-
//
|
|
151
|
-
// 13-kind registry can make it searchable.
|
|
148
|
+
// knows nothing about them. Only the boot rebuild through the
|
|
149
|
+
// registry can make such a row searchable.
|
|
152
150
|
const dbPath = path.join(dir, "stigmer.db");
|
|
153
151
|
const seedStore = SqliteStore.open(dbPath);
|
|
154
152
|
await seedStore.saveResource(
|
|
@@ -163,17 +161,17 @@ describe("boot-time RebuildIndex (DD-D/DD-F)", () => {
|
|
|
163
161
|
}),
|
|
164
162
|
);
|
|
165
163
|
await seedStore.saveResource(
|
|
166
|
-
ApiResourceKind.
|
|
167
|
-
"
|
|
168
|
-
|
|
169
|
-
create(
|
|
164
|
+
ApiResourceKind.skill,
|
|
165
|
+
"skl_adopted",
|
|
166
|
+
SkillSchema,
|
|
167
|
+
create(SkillSchema, {
|
|
170
168
|
metadata: {
|
|
171
|
-
id: "
|
|
172
|
-
name: "adopted-
|
|
173
|
-
slug: "adopted-
|
|
169
|
+
id: "skl_adopted",
|
|
170
|
+
name: "adopted-skill",
|
|
171
|
+
slug: "adopted-skill",
|
|
174
172
|
org: "preboot",
|
|
175
173
|
},
|
|
176
|
-
spec: { description: "a
|
|
174
|
+
spec: { description: "a skill from the Go era" },
|
|
177
175
|
status: {
|
|
178
176
|
audit: { specAudit: { createdAt: { seconds: 1_700_000_000n } } },
|
|
179
177
|
},
|
|
@@ -201,11 +199,11 @@ describe("boot-time RebuildIndex (DD-D/DD-F)", () => {
|
|
|
201
199
|
});
|
|
202
200
|
expect(orgs.entries.map((entry) => entry.id)).toContain("preboot");
|
|
203
201
|
|
|
204
|
-
const
|
|
205
|
-
kinds: [ApiResourceKind.
|
|
202
|
+
const skills = await search.search({
|
|
203
|
+
kinds: [ApiResourceKind.skill],
|
|
206
204
|
org: "preboot",
|
|
207
205
|
});
|
|
208
|
-
expect(
|
|
209
|
-
expect(
|
|
206
|
+
expect(skills.entries.map((entry) => entry.id)).toEqual(["skl_adopted"]);
|
|
207
|
+
expect(skills.entries[0]?.description).toBe("a skill from the Go era");
|
|
210
208
|
});
|
|
211
209
|
});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* normalization (trimming, clamps), the 500-char boundary, the three-mode
|
|
4
4
|
* contract, and the #440 arm — named-but-unsearchable kinds yield an EMPTY
|
|
5
5
|
* effective set, never a discover fallback. The kind_meta derivation is
|
|
6
|
-
* pinned here too: 13 searchable kinds
|
|
6
|
+
* pinned here too: the 13 searchable kinds.
|
|
7
7
|
*/
|
|
8
8
|
import { describe, expect, it } from "vitest";
|
|
9
9
|
|
|
@@ -42,18 +42,15 @@ function criteria(overrides?: {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
describe("searchIndexedKinds derivation (kind_meta)", () => {
|
|
45
|
-
it("derives exactly the
|
|
45
|
+
it("derives exactly the 13 searchable kinds, plugin included", () => {
|
|
46
46
|
// Go's SearchableKinds map, pinned by its invariant test against the
|
|
47
|
-
// same kind_meta derivation.
|
|
48
|
-
// domain ports with #16 — RebuildIndex on an adopted Go database
|
|
49
|
-
// must be able to re-index existing project rows.
|
|
47
|
+
// same kind_meta derivation.
|
|
50
48
|
expect([...searchIndexedKinds()].sort((a, b) => a - b)).toEqual(
|
|
51
49
|
[
|
|
52
50
|
ApiResourceKind.agent,
|
|
53
51
|
ApiResourceKind.skill,
|
|
54
52
|
ApiResourceKind.mcp_server,
|
|
55
53
|
ApiResourceKind.workflow,
|
|
56
|
-
ApiResourceKind.project,
|
|
57
54
|
ApiResourceKind.environment,
|
|
58
55
|
ApiResourceKind.session,
|
|
59
56
|
ApiResourceKind.agent_execution,
|