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