@stigmer/server 3.23.0 → 3.23.1-dev.20260923075205
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/authorizer.d.ts +4 -8
- package/dist/authorization/authorizer.d.ts.map +1 -1
- package/dist/authorization/authorizer.js +5 -9
- package/dist/authorization/authorizer.js.map +1 -1
- package/dist/authorization/derived-tuples.d.ts.map +1 -1
- package/dist/authorization/derived-tuples.js +10 -25
- package/dist/authorization/derived-tuples.js.map +1 -1
- package/dist/authorization/evaluator.d.ts +7 -8
- package/dist/authorization/evaluator.d.ts.map +1 -1
- package/dist/authorization/evaluator.js +4 -20
- package/dist/authorization/evaluator.js.map +1 -1
- package/dist/authorization/list-read-scope.d.ts.map +1 -1
- package/dist/authorization/list-read-scope.js +5 -9
- package/dist/authorization/list-read-scope.js.map +1 -1
- package/dist/authorization/model/agent.d.ts.map +1 -1
- package/dist/authorization/model/agent.js +4 -5
- package/dist/authorization/model/agent.js.map +1 -1
- package/dist/authorization/model/agent_instance.d.ts.map +1 -1
- package/dist/authorization/model/agent_instance.js +2 -2
- package/dist/authorization/model/agent_instance.js.map +1 -1
- package/dist/authorization/model/mcp_server.d.ts.map +1 -1
- package/dist/authorization/model/mcp_server.js +2 -2
- package/dist/authorization/model/mcp_server.js.map +1 -1
- package/dist/authorization/model/plugin.d.ts.map +1 -1
- package/dist/authorization/model/plugin.js +3 -4
- package/dist/authorization/model/plugin.js.map +1 -1
- package/dist/authorization/model/rewrite.d.ts +8 -10
- package/dist/authorization/model/rewrite.d.ts.map +1 -1
- package/dist/authorization/model/rewrite.js +0 -3
- package/dist/authorization/model/rewrite.js.map +1 -1
- package/dist/authorization/model/skill.d.ts.map +1 -1
- package/dist/authorization/model/skill.js +2 -2
- package/dist/authorization/model/skill.js.map +1 -1
- package/dist/authorization/model/workflow.d.ts.map +1 -1
- package/dist/authorization/model/workflow.js +2 -2
- package/dist/authorization/model/workflow.js.map +1 -1
- package/dist/authorization/model/workflow_instance.d.ts.map +1 -1
- package/dist/authorization/model/workflow_instance.js +2 -2
- package/dist/authorization/model/workflow_instance.js.map +1 -1
- package/dist/authorization/organization-directory.d.ts.map +1 -1
- package/dist/authorization/organization-directory.js +2 -3
- package/dist/authorization/organization-directory.js.map +1 -1
- package/dist/authorization/store-test-kit.d.ts +0 -6
- package/dist/authorization/store-test-kit.d.ts.map +1 -1
- package/dist/authorization/store-test-kit.js +16 -62
- package/dist/authorization/store-test-kit.js.map +1 -1
- package/dist/authorization/tuples.d.ts +13 -32
- package/dist/authorization/tuples.d.ts.map +1 -1
- package/dist/authorization/tuples.js +3 -11
- package/dist/authorization/tuples.js.map +1 -1
- package/dist/domain/agent/controller.d.ts.map +1 -1
- package/dist/domain/agent/controller.js +4 -4
- package/dist/domain/agent/controller.js.map +1 -1
- package/dist/domain/agentchannel/controller.d.ts.map +1 -1
- package/dist/domain/agentchannel/controller.js +3 -1
- package/dist/domain/agentchannel/controller.js.map +1 -1
- package/dist/domain/agentexecution/controller.d.ts.map +1 -1
- package/dist/domain/agentexecution/controller.js +3 -1
- package/dist/domain/agentexecution/controller.js.map +1 -1
- package/dist/domain/agentinstance/controller.d.ts.map +1 -1
- package/dist/domain/agentinstance/controller.js +3 -4
- package/dist/domain/agentinstance/controller.js.map +1 -1
- package/dist/domain/agentshare/constants.d.ts +6 -11
- package/dist/domain/agentshare/constants.d.ts.map +1 -1
- package/dist/domain/agentshare/constants.js +8 -16
- package/dist/domain/agentshare/constants.js.map +1 -1
- package/dist/domain/agentshare/controller.d.ts.map +1 -1
- package/dist/domain/agentshare/controller.js +3 -1
- package/dist/domain/agentshare/controller.js.map +1 -1
- package/dist/domain/agentshare/steps.d.ts +18 -25
- package/dist/domain/agentshare/steps.d.ts.map +1 -1
- package/dist/domain/agentshare/steps.js +41 -142
- package/dist/domain/agentshare/steps.js.map +1 -1
- package/dist/domain/environment/controller.d.ts.map +1 -1
- package/dist/domain/environment/controller.js +2 -3
- package/dist/domain/environment/controller.js.map +1 -1
- package/dist/domain/executioncontext/controller.d.ts.map +1 -1
- package/dist/domain/executioncontext/controller.js +2 -1
- package/dist/domain/executioncontext/controller.js.map +1 -1
- package/dist/domain/mcpserver/controller.d.ts.map +1 -1
- package/dist/domain/mcpserver/controller.js +3 -4
- package/dist/domain/mcpserver/controller.js.map +1 -1
- package/dist/domain/plugin/controller.d.ts.map +1 -1
- package/dist/domain/plugin/controller.js +1 -3
- package/dist/domain/plugin/controller.js.map +1 -1
- package/dist/domain/plugin/push.d.ts +7 -5
- package/dist/domain/plugin/push.d.ts.map +1 -1
- package/dist/domain/plugin/push.js +8 -14
- package/dist/domain/plugin/push.js.map +1 -1
- package/dist/domain/schedule/controller.d.ts.map +1 -1
- package/dist/domain/schedule/controller.js +3 -1
- package/dist/domain/schedule/controller.js.map +1 -1
- package/dist/domain/session/controller.d.ts.map +1 -1
- package/dist/domain/session/controller.js +3 -2
- package/dist/domain/session/controller.js.map +1 -1
- package/dist/domain/skill/controller.d.ts.map +1 -1
- package/dist/domain/skill/controller.js +0 -2
- package/dist/domain/skill/controller.js.map +1 -1
- package/dist/domain/workflow/agent-call-references.d.ts +54 -0
- package/dist/domain/workflow/agent-call-references.d.ts.map +1 -0
- package/dist/domain/workflow/agent-call-references.js +97 -0
- package/dist/domain/workflow/agent-call-references.js.map +1 -0
- package/dist/domain/workflow/controller.d.ts.map +1 -1
- package/dist/domain/workflow/controller.js +14 -6
- package/dist/domain/workflow/controller.js.map +1 -1
- package/dist/domain/workflow/registry/data/task-kind-registry.json +1 -1
- package/dist/domain/workflow/validation/task-config-constraints.d.ts +10 -1
- package/dist/domain/workflow/validation/task-config-constraints.d.ts.map +1 -1
- package/dist/domain/workflow/validation/task-config-constraints.js +3 -2
- package/dist/domain/workflow/validation/task-config-constraints.js.map +1 -1
- package/dist/domain/workflowexecution/controller.d.ts.map +1 -1
- package/dist/domain/workflowexecution/controller.js +4 -2
- package/dist/domain/workflowexecution/controller.js.map +1 -1
- package/dist/domain/workflowinstance/controller.d.ts.map +1 -1
- package/dist/domain/workflowinstance/controller.js +3 -4
- package/dist/domain/workflowinstance/controller.js.map +1 -1
- package/dist/extensions/authorization-queries.d.ts +6 -5
- package/dist/extensions/authorization-queries.d.ts.map +1 -1
- package/dist/extensions/list-read-scope.d.ts +1 -1
- package/dist/extensions/resource-authorization.d.ts +3 -2
- package/dist/extensions/resource-authorization.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/pipeline/apiresource-meta.d.ts +12 -3
- package/dist/pipeline/apiresource-meta.d.ts.map +1 -1
- package/dist/pipeline/apiresource-meta.js +21 -10
- package/dist/pipeline/apiresource-meta.js.map +1 -1
- package/dist/pipeline/steps/authorization-tuples.d.ts +9 -3
- package/dist/pipeline/steps/authorization-tuples.d.ts.map +1 -1
- package/dist/pipeline/steps/authorization-tuples.js +9 -11
- package/dist/pipeline/steps/authorization-tuples.js.map +1 -1
- package/dist/pipeline/steps/references.d.ts +178 -20
- package/dist/pipeline/steps/references.d.ts.map +1 -1
- package/dist/pipeline/steps/references.js +344 -43
- package/dist/pipeline/steps/references.js.map +1 -1
- package/dist/query/search/controller.js +0 -1
- package/dist/query/search/controller.js.map +1 -1
- package/dist/query/search/criteria.d.ts +1 -5
- package/dist/query/search/criteria.d.ts.map +1 -1
- package/dist/query/search/criteria.js +3 -13
- package/dist/query/search/criteria.js.map +1 -1
- package/dist/query/search/handler.d.ts +5 -4
- package/dist/query/search/handler.d.ts.map +1 -1
- package/dist/query/search/handler.js +7 -6
- package/dist/query/search/handler.js.map +1 -1
- package/dist/query/search/query-store.d.ts.map +1 -1
- package/dist/query/search/query-store.js +0 -2
- package/dist/query/search/query-store.js.map +1 -1
- package/dist/store/interface.d.ts +3 -6
- package/dist/store/interface.d.ts.map +1 -1
- package/dist/store/interface.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 +35 -1
- package/dist/store/postgres/migrations.js.map +1 -1
- package/dist/store/postgres/store.d.ts.map +1 -1
- package/dist/store/postgres/store.js +4 -9
- package/dist/store/postgres/store.js.map +1 -1
- package/dist/store/public-visibility-retired.d.ts +67 -0
- package/dist/store/public-visibility-retired.d.ts.map +1 -0
- package/dist/store/public-visibility-retired.js +55 -0
- package/dist/store/public-visibility-retired.js.map +1 -0
- 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 +36 -1
- package/dist/store/sqlite/migrations.js.map +1 -1
- package/dist/store/sqlite/store.d.ts.map +1 -1
- package/dist/store/sqlite/store.js +4 -8
- package/dist/store/sqlite/store.js.map +1 -1
- package/package.json +6 -6
- package/src/authorization/README.md +24 -26
- package/src/authorization/__tests__/authorizer.test.ts +10 -9
- package/src/authorization/__tests__/derived-tuples.test.ts +4 -11
- package/src/authorization/__tests__/evaluator.test.ts +14 -73
- package/src/authorization/__tests__/facts.test.ts +2 -2
- package/src/authorization/__tests__/fixtures/fga/agent-instance-creation.fga.yaml +19 -27
- package/src/authorization/__tests__/fixtures/fga/blueprint-private-visibility.fga.yaml +6 -98
- package/src/authorization/__tests__/fixtures/fga/default-instance-inheritance.fga.yaml +4 -61
- package/src/authorization/__tests__/fixtures/fga/mcp-server-authoring.fga.yaml +1 -15
- package/src/authorization/__tests__/fixtures/fga/org-admin-owner-inheritance.fga.yaml +1 -21
- package/src/authorization/__tests__/fixtures/fga/platform-visibility.fga.yaml +1 -25
- package/src/authorization/__tests__/fixtures/fga/workflow-execution-sharing.fga.yaml +1 -3
- package/src/authorization/__tests__/list-read-scope.test.ts +18 -17
- package/src/authorization/__tests__/store-tests.test.ts +2 -6
- package/src/authorization/__tests__/tuples.test.ts +12 -11
- package/src/authorization/authorizer.ts +4 -9
- package/src/authorization/derived-tuples.ts +14 -31
- package/src/authorization/evaluator.ts +8 -44
- package/src/authorization/list-read-scope.ts +5 -11
- package/src/authorization/model/agent.ts +2 -5
- package/src/authorization/model/agent_instance.ts +0 -2
- package/src/authorization/model/mcp_server.ts +0 -2
- package/src/authorization/model/plugin.ts +1 -4
- package/src/authorization/model/rewrite.ts +8 -13
- package/src/authorization/model/skill.ts +0 -2
- package/src/authorization/model/workflow.ts +0 -2
- package/src/authorization/model/workflow_instance.ts +0 -2
- package/src/authorization/organization-directory.ts +1 -3
- package/src/authorization/store-test-kit.ts +16 -75
- package/src/authorization/tuples.ts +16 -39
- package/src/domain/agent/__tests__/agent.test.ts +11 -4
- package/src/domain/agent/controller.ts +7 -7
- package/src/domain/agentchannel/__tests__/agentchannel.test.ts +223 -48
- package/src/domain/agentchannel/controller.ts +6 -1
- package/src/domain/agentexecution/controller.ts +6 -1
- package/src/domain/agentinstance/controller.ts +6 -12
- package/src/domain/agentshare/__tests__/agentshare.test.ts +196 -172
- package/src/domain/agentshare/__tests__/create-authorization.test.ts +16 -31
- package/src/domain/agentshare/constants.ts +14 -26
- package/src/domain/agentshare/controller.ts +6 -1
- package/src/domain/agentshare/steps.ts +41 -194
- package/src/domain/environment/controller.ts +5 -8
- package/src/domain/executioncontext/controller.ts +5 -1
- package/src/domain/mcpserver/__tests__/mcpserver.test.ts +115 -28
- package/src/domain/mcpserver/__tests__/oauth-handshake.test.ts +53 -18
- package/src/domain/mcpserver/controller.ts +6 -12
- package/src/domain/plugin/controller.ts +1 -8
- package/src/domain/plugin/push.ts +8 -16
- package/src/domain/schedule/controller.ts +6 -1
- package/src/domain/session/controller.ts +12 -4
- package/src/domain/skill/controller.ts +0 -7
- package/src/domain/workflow/__tests__/agent-call-references.test.ts +222 -0
- package/src/domain/workflow/agent-call-references.ts +157 -0
- package/src/domain/workflow/controller.ts +28 -10
- package/src/domain/workflow/registry/data/task-kind-registry.json +1 -1
- package/src/domain/workflow/validation/task-config-constraints.ts +7 -3
- package/src/domain/workflowexecution/controller.ts +7 -2
- package/src/domain/workflowinstance/controller.ts +6 -12
- package/src/extensions/__tests__/built-in-authorization-composed.test.ts +32 -19
- package/src/extensions/__tests__/extension-composition.test.ts +4 -4
- package/src/extensions/__tests__/list-read-scope-composed.test.ts +9 -6
- package/src/extensions/authorization-queries.ts +6 -5
- package/src/extensions/list-read-scope.ts +1 -1
- package/src/extensions/resource-authorization.ts +3 -5
- package/src/index.ts +0 -1
- package/src/pipeline/__tests__/supports-visibility.test.ts +112 -0
- package/src/pipeline/apiresource-meta.ts +21 -10
- package/src/pipeline/steps/__tests__/authorization-tuples.test.ts +18 -31
- package/src/pipeline/steps/__tests__/references.test.ts +703 -0
- package/src/pipeline/steps/authorization-tuples.ts +9 -11
- package/src/pipeline/steps/references.ts +578 -70
- package/src/query/search/__tests__/criteria.test.ts +0 -4
- package/src/query/search/__tests__/query-store.test.ts +11 -40
- package/src/query/search/controller.ts +0 -1
- package/src/query/search/criteria.ts +0 -14
- package/src/query/search/handler.ts +6 -7
- package/src/query/search/query-store.ts +0 -2
- package/src/store/__tests__/public-visibility-retired.test.ts +127 -0
- package/src/store/__tests__/store-contract.ts +6 -51
- package/src/store/interface.ts +3 -6
- package/src/store/postgres/__tests__/migrations.test.ts +187 -6
- package/src/store/postgres/__tests__/store-contract.test.ts +0 -2
- package/src/store/postgres/migrations.ts +48 -1
- package/src/store/postgres/store.ts +4 -11
- package/src/store/public-visibility-retired.ts +119 -0
- package/src/store/sqlite/__tests__/migrations.test.ts +191 -5
- package/src/store/sqlite/migrations.ts +45 -1
- package/src/store/sqlite/store.ts +4 -10
- package/dist/pipeline/steps/visibility-gates.d.ts +0 -27
- package/dist/pipeline/steps/visibility-gates.d.ts.map +0 -1
- package/dist/pipeline/steps/visibility-gates.js +0 -139
- package/dist/pipeline/steps/visibility-gates.js.map +0 -1
- package/src/authorization/__tests__/fixtures/fga/cross-org-share-creation.fga.yaml +0 -98
- package/src/authorization/__tests__/fixtures/fga/public-visibility-setter.fga.yaml +0 -52
- package/src/pipeline/steps/__tests__/visibility-gates.test.ts +0 -187
- package/src/pipeline/steps/visibility-gates.ts +0 -174
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The tuple vocabulary of the built-in authorizer — the OpenFGA notions
|
|
3
3
|
* the cloud's model is written in (object, relation, subject; a subject
|
|
4
|
-
* being an object
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* being an object or a userset `type:id#relation`), typed once so the
|
|
5
|
+
* evaluator, the derivation and the store-test kit speak one language. The
|
|
6
|
+
* model declares no wildcard subject and no condition: every reader of a
|
|
7
|
+
* row is an account or the holder of a relation on an object, which is
|
|
8
|
+
* why a check needs no context parameter. Nothing here is
|
|
7
9
|
* stored: open source derives every tuple from a row (derived-tuples.ts)
|
|
8
10
|
* or reads it from an IamPolicy row, and this module only names what a
|
|
9
11
|
* tuple IS.
|
|
@@ -18,28 +20,18 @@
|
|
|
18
20
|
* The type is named here; the construction (`personFor`, `resolvePerson`)
|
|
19
21
|
* is person.ts's, so this module stays vocabulary with no I/O.
|
|
20
22
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* and the
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* catalog. The parameter is required so a caller states which posture it
|
|
28
|
-
* is in; there is no default because either one is wrong for the other.
|
|
29
|
-
*
|
|
30
|
-
* The string forms (`agent:x`, `organization:acme#viewer`,
|
|
31
|
-
* `identity_account:*`) are the notation the cloud's store tests and the
|
|
32
|
-
* IamPolicy proto both use; parse and format are here so the kit and the
|
|
33
|
-
* tests never spell them a second way.
|
|
23
|
+
* The string forms (`agent:x`, `organization:acme#viewer`) are the
|
|
24
|
+
* notation the cloud's store tests and the IamPolicy proto both use; parse
|
|
25
|
+
* and format are here so the kit and the tests never spell them a second
|
|
26
|
+
* way. The wildcard notation `type:*` is refused by the parser: the model
|
|
27
|
+
* has no line that admits one, so a fixture or a policy that spells it is
|
|
28
|
+
* a mistake to surface, never a subject to carry.
|
|
34
29
|
*/
|
|
35
30
|
import type { Message } from "@bufbuild/protobuf";
|
|
36
31
|
|
|
37
32
|
/** The FGA type name of the kind every person is: `identity_account:<id>`. */
|
|
38
33
|
export const ACCOUNT_TYPE = "identity_account";
|
|
39
34
|
|
|
40
|
-
/** The one condition the model declares; it guards the public wildcard. */
|
|
41
|
-
export const ALLOW_PUBLIC_CONDITION = "allow_public";
|
|
42
|
-
|
|
43
35
|
/** `type:id` — an object of the model. */
|
|
44
36
|
export interface ObjectRef {
|
|
45
37
|
readonly type: string;
|
|
@@ -55,12 +47,6 @@ export type Subject =
|
|
|
55
47
|
readonly form: "userset";
|
|
56
48
|
readonly object: ObjectRef;
|
|
57
49
|
readonly relation: string;
|
|
58
|
-
}
|
|
59
|
-
/** `type:*` — every object of the type, honoured only when its condition holds. */
|
|
60
|
-
| {
|
|
61
|
-
readonly form: "wildcard";
|
|
62
|
-
readonly type: string;
|
|
63
|
-
readonly condition: string | undefined;
|
|
64
50
|
};
|
|
65
51
|
|
|
66
52
|
export interface Tuple {
|
|
@@ -97,11 +83,6 @@ export interface Person {
|
|
|
97
83
|
readonly aliases: ReadonlySet<string>;
|
|
98
84
|
}
|
|
99
85
|
|
|
100
|
-
/** The condition parameters of a check (the module header). */
|
|
101
|
-
export interface CheckContext {
|
|
102
|
-
readonly allow: boolean;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
86
|
// ---------------------------------------------------------------------------
|
|
106
87
|
// The string notation.
|
|
107
88
|
// ---------------------------------------------------------------------------
|
|
@@ -120,10 +101,8 @@ export function formatObjectRef(object: ObjectRef): string {
|
|
|
120
101
|
}
|
|
121
102
|
|
|
122
103
|
/**
|
|
123
|
-
* `type:id
|
|
124
|
-
*
|
|
125
|
-
* says so (the store tests carry it on the tuple, the derivation attaches
|
|
126
|
-
* the model's).
|
|
104
|
+
* `type:id` or `type:id#relation` → Subject. `type:*` is refused (the
|
|
105
|
+
* module header): no line of the model admits a wildcard subject.
|
|
127
106
|
*/
|
|
128
107
|
export function parseSubject(text: string): Subject {
|
|
129
108
|
const hash = text.indexOf("#");
|
|
@@ -136,7 +115,9 @@ export function parseSubject(text: string): Subject {
|
|
|
136
115
|
}
|
|
137
116
|
const object = parseObjectRef(text);
|
|
138
117
|
if (object.id === "*") {
|
|
139
|
-
|
|
118
|
+
throw new Error(
|
|
119
|
+
`wildcard subject '${text}' is not admitted: the model declares no wildcard line`,
|
|
120
|
+
);
|
|
140
121
|
}
|
|
141
122
|
return { form: "object", object };
|
|
142
123
|
}
|
|
@@ -147,10 +128,6 @@ export function formatSubject(subject: Subject): string {
|
|
|
147
128
|
return formatObjectRef(subject.object);
|
|
148
129
|
case "userset":
|
|
149
130
|
return `${formatObjectRef(subject.object)}#${subject.relation}`;
|
|
150
|
-
case "wildcard":
|
|
151
|
-
return subject.condition === undefined
|
|
152
|
-
? `${subject.type}:*`
|
|
153
|
-
: `${subject.type}:* with ${subject.condition}`;
|
|
154
131
|
default: {
|
|
155
132
|
const exhaustive: never = subject;
|
|
156
133
|
throw new Error(`unknown subject form: ${JSON.stringify(exhaustive)}`);
|
|
@@ -131,8 +131,10 @@ function agentInput(overrides?: {
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
/**
|
|
134
|
-
* Seeds an MCP server straight into the store — the
|
|
135
|
-
*
|
|
134
|
+
* Seeds an MCP server straight into the store — the agent pipelines only
|
|
135
|
+
* need the row. Org-visible, the level the mcpserver create chain would
|
|
136
|
+
* have stamped: an org-visible agent may reference it under the reference
|
|
137
|
+
* floor, as it would a server created through the API.
|
|
136
138
|
*/
|
|
137
139
|
async function seedMcpServer(opts: {
|
|
138
140
|
id: string;
|
|
@@ -155,6 +157,7 @@ async function seedMcpServer(opts: {
|
|
|
155
157
|
name: opts.slug,
|
|
156
158
|
slug: opts.slug,
|
|
157
159
|
org: opts.org ?? ORG,
|
|
160
|
+
visibility: ApiResourceVisibility.visibility_org,
|
|
158
161
|
},
|
|
159
162
|
spec: { env: opts.env ?? {} },
|
|
160
163
|
status: connected
|
|
@@ -309,11 +312,11 @@ describe("agent enabled-tools validation (#402)", () => {
|
|
|
309
312
|
});
|
|
310
313
|
|
|
311
314
|
describe("agent cascade delete (oss#611)", () => {
|
|
312
|
-
it("sweeps ALL instances by spec.agent_id (cross-org included), deletes same-org shares, keeps cross-org
|
|
315
|
+
it("sweeps ALL instances by spec.agent_id (cross-org included), deletes same-org shares, keeps a stored cross-org share", async () => {
|
|
313
316
|
const agent = await command.create(
|
|
314
317
|
agentInput({
|
|
315
318
|
name: "Cascade Target",
|
|
316
|
-
visibility: ApiResourceVisibility.
|
|
319
|
+
visibility: ApiResourceVisibility.visibility_org,
|
|
317
320
|
}),
|
|
318
321
|
);
|
|
319
322
|
const agentId = agent.metadata!.id;
|
|
@@ -355,6 +358,10 @@ describe("agent cascade delete (oss#611)", () => {
|
|
|
355
358
|
AgentShareSchema,
|
|
356
359
|
sameOrgShare,
|
|
357
360
|
);
|
|
361
|
+
// A share in another organization is a row no create admits any more
|
|
362
|
+
// (a share's agent lives in the share's organization); one written
|
|
363
|
+
// before that rule is still another organization's row, and the
|
|
364
|
+
// cascade leaves it as it always did.
|
|
358
365
|
const crossOrgShare = create(AgentShareSchema, {
|
|
359
366
|
metadata: { id: "ash_cross_org", name: "cross-org-share", org: "globex" },
|
|
360
367
|
spec: {
|
|
@@ -42,10 +42,6 @@ import {
|
|
|
42
42
|
newAuthorizeResolvedTargetStep,
|
|
43
43
|
} from "../../pipeline/steps/authorize-resolved-target.js";
|
|
44
44
|
import { newGuardReservedLabelsStep } from "../../pipeline/steps/guard-reserved-labels.js";
|
|
45
|
-
import {
|
|
46
|
-
newAuthorizeVisibilityTransitionStep,
|
|
47
|
-
newGuardPublicVisibilityStep,
|
|
48
|
-
} from "../../pipeline/steps/visibility-gates.js";
|
|
49
45
|
import {
|
|
50
46
|
newBuildNewStateStep,
|
|
51
47
|
setAuditFieldsForUpdate,
|
|
@@ -77,6 +73,8 @@ import {
|
|
|
77
73
|
newLoadTargetStep,
|
|
78
74
|
} from "../../pipeline/steps/load-target.js";
|
|
79
75
|
import {
|
|
76
|
+
collectSpecReferences,
|
|
77
|
+
newGuardReferenceFloorOnEscalationStep,
|
|
80
78
|
newNormalizeReferencesStep,
|
|
81
79
|
newValidateReferencesStep,
|
|
82
80
|
} from "../../pipeline/steps/references.js";
|
|
@@ -168,7 +166,6 @@ async function createAgent(
|
|
|
168
166
|
.addStep(newResolveSlugStep())
|
|
169
167
|
.addStep(newCheckDuplicateStep(deps.store))
|
|
170
168
|
.addStep(newBuildNewStateStep())
|
|
171
|
-
.addStep(newGuardPublicVisibilityStep(deps.authorizer))
|
|
172
169
|
.addStep(newGuardReservedLabelsStep(deps.authorizer))
|
|
173
170
|
.addStep(newNormalizeReferencesStep())
|
|
174
171
|
.addStep(newValidateReferencesStep(deps.store))
|
|
@@ -361,10 +358,13 @@ async function updateVisibility(
|
|
|
361
358
|
)
|
|
362
359
|
.addStep(newRecordVisibilityBeforeUpdateStep(UPDATE_VISIBILITY_AGENT_KEY))
|
|
363
360
|
.addStep(newValidateVisibilityUpdateStep())
|
|
361
|
+
// The reference floor's second door: an agent may not be raised above
|
|
362
|
+
// the skills and MCP servers it runs with.
|
|
364
363
|
.addStep(
|
|
365
|
-
|
|
364
|
+
newGuardReferenceFloorOnEscalationStep(
|
|
365
|
+
deps.store,
|
|
366
366
|
UPDATE_VISIBILITY_AGENT_KEY,
|
|
367
|
-
|
|
367
|
+
[(row) => collectSpecReferences(AgentSchema, row)],
|
|
368
368
|
),
|
|
369
369
|
)
|
|
370
370
|
.addStep(newSetAgentVisibilityStep())
|