@stigmer/server 3.27.2 → 3.28.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/README.md +2 -0
- package/dist/authorization/authorizer.d.ts +3 -3
- package/dist/authorization/authorizer.js +3 -3
- package/dist/authorization/derived-tuples.js +6 -1
- package/dist/authorization/derived-tuples.js.map +1 -1
- package/dist/authorization/evaluator.d.ts +9 -10
- package/dist/authorization/evaluator.d.ts.map +1 -1
- 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 +29 -18
- package/dist/authorization/list-read-scope.js.map +1 -1
- package/dist/authorization/model/bindings.d.ts +41 -0
- package/dist/authorization/model/bindings.d.ts.map +1 -0
- package/dist/authorization/model/bindings.js +89 -0
- package/dist/authorization/model/bindings.js.map +1 -0
- package/dist/authorization/model/data/authorization-model.json +3114 -0
- package/dist/authorization/model/default-of.d.ts +2 -2
- package/dist/authorization/model/execution-viewer.d.ts +3 -0
- package/dist/authorization/model/execution-viewer.d.ts.map +1 -0
- package/dist/authorization/model/execution-viewer.js +50 -0
- package/dist/authorization/model/execution-viewer.js.map +1 -0
- package/dist/authorization/model/index.d.ts +33 -21
- package/dist/authorization/model/index.d.ts.map +1 -1
- package/dist/authorization/model/index.js +74 -52
- package/dist/authorization/model/index.js.map +1 -1
- package/dist/authorization/model/openfga-json.d.ts +18 -0
- package/dist/authorization/model/openfga-json.d.ts.map +1 -0
- package/dist/authorization/model/openfga-json.js +266 -0
- package/dist/authorization/model/openfga-json.js.map +1 -0
- package/dist/authorization/model/rewrite.d.ts +39 -67
- package/dist/authorization/model/rewrite.d.ts.map +1 -1
- package/dist/authorization/model/rewrite.js +1 -117
- package/dist/authorization/model/rewrite.js.map +1 -1
- package/dist/authorization/strict-json.d.ts +20 -0
- package/dist/authorization/strict-json.d.ts.map +1 -0
- package/dist/authorization/strict-json.js +45 -0
- package/dist/authorization/strict-json.js.map +1 -0
- package/dist/boot/compose.d.ts.map +1 -1
- package/dist/boot/compose.js +9 -7
- package/dist/boot/compose.js.map +1 -1
- package/dist/domain/workflowexecution/list-index.d.ts +1 -1
- package/dist/extensions/list-read-scope.d.ts +18 -2
- package/dist/extensions/list-read-scope.d.ts.map +1 -1
- package/dist/extensions/list-read-scope.js +20 -1
- package/dist/extensions/list-read-scope.js.map +1 -1
- package/dist/index.d.ts +7 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -5
- package/dist/index.js.map +1 -1
- package/package.json +7 -6
- package/src/authorization/README.md +41 -34
- package/src/authorization/__tests__/authorizer.test.ts +5 -14
- package/src/authorization/__tests__/derived-tuples.test.ts +29 -27
- package/src/authorization/__tests__/evaluator.test.ts +53 -160
- package/src/authorization/__tests__/facts.test.ts +5 -11
- package/src/authorization/__tests__/list-read-scope.measure.test.ts +12 -20
- package/src/authorization/__tests__/list-read-scope.test.ts +15 -14
- package/src/authorization/__tests__/organization-directory.test.ts +2 -2
- package/src/authorization/__tests__/store-test-kit.ts +246 -0
- package/src/authorization/__tests__/store-tests.test.ts +91 -223
- package/src/authorization/__tests__/support.ts +30 -2
- package/src/authorization/__tests__/throwaway-model.ts +75 -0
- package/src/authorization/__tests__/wire-permissions.test.ts +141 -107
- package/src/authorization/authorizer.ts +3 -3
- package/src/authorization/derived-tuples.ts +7 -2
- package/src/authorization/evaluator.ts +8 -10
- package/src/authorization/list-read-scope.ts +37 -22
- package/src/authorization/model/__tests__/openfga-json.test.ts +353 -0
- package/src/authorization/model/__tests__/registry.test.ts +102 -276
- package/src/authorization/model/bindings.ts +131 -0
- package/src/authorization/model/data/authorization-model.json +3114 -0
- package/src/authorization/model/default-of.ts +2 -2
- package/src/authorization/model/execution-viewer.ts +56 -0
- package/src/authorization/model/index.ts +81 -72
- package/src/authorization/model/openfga-json.ts +310 -0
- package/src/authorization/model/rewrite.ts +39 -188
- package/src/authorization/strict-json.ts +52 -0
- package/src/boot/compose.ts +9 -7
- package/src/extensions/__tests__/built-in-authorization-composed.test.ts +3 -6
- package/src/extensions/list-read-scope.ts +30 -3
- package/src/index.ts +15 -44
- package/dist/authorization/model/agent.d.ts +0 -2
- package/dist/authorization/model/agent.d.ts.map +0 -1
- package/dist/authorization/model/agent.js +0 -43
- package/dist/authorization/model/agent.js.map +0 -1
- package/dist/authorization/model/agent_channel.d.ts +0 -2
- package/dist/authorization/model/agent_channel.d.ts.map +0 -1
- package/dist/authorization/model/agent_channel.js +0 -39
- package/dist/authorization/model/agent_channel.js.map +0 -1
- package/dist/authorization/model/agent_execution.d.ts +0 -2
- package/dist/authorization/model/agent_execution.d.ts.map +0 -1
- package/dist/authorization/model/agent_execution.js +0 -25
- package/dist/authorization/model/agent_execution.js.map +0 -1
- package/dist/authorization/model/agent_instance.d.ts +0 -2
- package/dist/authorization/model/agent_instance.d.ts.map +0 -1
- package/dist/authorization/model/agent_instance.js +0 -48
- package/dist/authorization/model/agent_instance.js.map +0 -1
- package/dist/authorization/model/agent_share.d.ts +0 -2
- package/dist/authorization/model/agent_share.d.ts.map +0 -1
- package/dist/authorization/model/agent_share.js +0 -29
- package/dist/authorization/model/agent_share.js.map +0 -1
- package/dist/authorization/model/api_key.d.ts +0 -2
- package/dist/authorization/model/api_key.d.ts.map +0 -1
- package/dist/authorization/model/api_key.js +0 -27
- package/dist/authorization/model/api_key.js.map +0 -1
- package/dist/authorization/model/artifact.d.ts +0 -2
- package/dist/authorization/model/artifact.d.ts.map +0 -1
- package/dist/authorization/model/artifact.js +0 -27
- package/dist/authorization/model/artifact.js.map +0 -1
- package/dist/authorization/model/channel_app.d.ts +0 -2
- package/dist/authorization/model/channel_app.d.ts.map +0 -1
- package/dist/authorization/model/channel_app.js +0 -28
- package/dist/authorization/model/channel_app.js.map +0 -1
- package/dist/authorization/model/environment.d.ts +0 -2
- package/dist/authorization/model/environment.d.ts.map +0 -1
- package/dist/authorization/model/environment.js +0 -33
- package/dist/authorization/model/environment.js.map +0 -1
- package/dist/authorization/model/execution_context.d.ts +0 -2
- package/dist/authorization/model/execution_context.d.ts.map +0 -1
- package/dist/authorization/model/execution_context.js +0 -19
- package/dist/authorization/model/execution_context.js.map +0 -1
- package/dist/authorization/model/iam_policy.d.ts +0 -2
- package/dist/authorization/model/iam_policy.d.ts.map +0 -1
- package/dist/authorization/model/iam_policy.js +0 -31
- package/dist/authorization/model/iam_policy.js.map +0 -1
- package/dist/authorization/model/identity_account.d.ts +0 -2
- package/dist/authorization/model/identity_account.d.ts.map +0 -1
- package/dist/authorization/model/identity_account.js +0 -25
- package/dist/authorization/model/identity_account.js.map +0 -1
- package/dist/authorization/model/mcp_server.d.ts +0 -2
- package/dist/authorization/model/mcp_server.d.ts.map +0 -1
- package/dist/authorization/model/mcp_server.js +0 -38
- package/dist/authorization/model/mcp_server.js.map +0 -1
- package/dist/authorization/model/memory.d.ts +0 -2
- package/dist/authorization/model/memory.d.ts.map +0 -1
- package/dist/authorization/model/memory.js +0 -26
- package/dist/authorization/model/memory.js.map +0 -1
- package/dist/authorization/model/oauth_app.d.ts +0 -2
- package/dist/authorization/model/oauth_app.d.ts.map +0 -1
- package/dist/authorization/model/oauth_app.js +0 -31
- package/dist/authorization/model/oauth_app.js.map +0 -1
- package/dist/authorization/model/organization.d.ts +0 -2
- package/dist/authorization/model/organization.d.ts.map +0 -1
- package/dist/authorization/model/organization.js +0 -58
- package/dist/authorization/model/organization.js.map +0 -1
- package/dist/authorization/model/platform_client.d.ts +0 -2
- package/dist/authorization/model/platform_client.d.ts.map +0 -1
- package/dist/authorization/model/platform_client.js +0 -31
- package/dist/authorization/model/platform_client.js.map +0 -1
- package/dist/authorization/model/plugin.d.ts +0 -2
- package/dist/authorization/model/plugin.d.ts.map +0 -1
- package/dist/authorization/model/plugin.js +0 -45
- package/dist/authorization/model/plugin.js.map +0 -1
- package/dist/authorization/model/schedule.d.ts +0 -2
- package/dist/authorization/model/schedule.d.ts.map +0 -1
- package/dist/authorization/model/schedule.js +0 -34
- package/dist/authorization/model/schedule.js.map +0 -1
- package/dist/authorization/model/session.d.ts +0 -2
- package/dist/authorization/model/session.d.ts.map +0 -1
- package/dist/authorization/model/session.js +0 -38
- package/dist/authorization/model/session.js.map +0 -1
- package/dist/authorization/model/skill.d.ts +0 -2
- package/dist/authorization/model/skill.d.ts.map +0 -1
- package/dist/authorization/model/skill.js +0 -39
- package/dist/authorization/model/skill.js.map +0 -1
- package/dist/authorization/model/workflow.d.ts +0 -2
- package/dist/authorization/model/workflow.d.ts.map +0 -1
- package/dist/authorization/model/workflow.js +0 -39
- package/dist/authorization/model/workflow.js.map +0 -1
- package/dist/authorization/model/workflow_execution.d.ts +0 -2
- package/dist/authorization/model/workflow_execution.d.ts.map +0 -1
- package/dist/authorization/model/workflow_execution.js +0 -33
- package/dist/authorization/model/workflow_execution.js.map +0 -1
- package/dist/authorization/model/workflow_instance.d.ts +0 -2
- package/dist/authorization/model/workflow_instance.d.ts.map +0 -1
- package/dist/authorization/model/workflow_instance.js +0 -96
- package/dist/authorization/model/workflow_instance.js.map +0 -1
- package/dist/authorization/store-test-kit.d.ts +0 -62
- package/dist/authorization/store-test-kit.d.ts.map +0 -1
- package/dist/authorization/store-test-kit.js +0 -265
- package/dist/authorization/store-test-kit.js.map +0 -1
- package/src/authorization/__tests__/enterprise-model.ts +0 -59
- package/src/authorization/__tests__/fixtures/fga/agent-channel-owner.fga.yaml +0 -112
- package/src/authorization/__tests__/fixtures/fga/agent-instance-creation.fga.yaml +0 -177
- package/src/authorization/__tests__/fixtures/fga/agent-share-owner.fga.yaml +0 -109
- package/src/authorization/__tests__/fixtures/fga/artifact-org-and-owner.fga.yaml +0 -128
- package/src/authorization/__tests__/fixtures/fga/blueprint-private-visibility.fga.yaml +0 -318
- package/src/authorization/__tests__/fixtures/fga/channel-app-owner.fga.yaml +0 -125
- package/src/authorization/__tests__/fixtures/fga/channel-participation.fga.yaml +0 -201
- package/src/authorization/__tests__/fixtures/fga/channel-session-visibility.fga.yaml +0 -187
- package/src/authorization/__tests__/fixtures/fga/default-instance-inheritance.fga.yaml +0 -214
- package/src/authorization/__tests__/fixtures/fga/mcp-server-authoring.fga.yaml +0 -129
- package/src/authorization/__tests__/fixtures/fga/memory-subject-only.fga.yaml +0 -72
- package/src/authorization/__tests__/fixtures/fga/org-admin-owner-inheritance.fga.yaml +0 -308
- package/src/authorization/__tests__/fixtures/fga/org-shared-environment.fga.yaml +0 -144
- package/src/authorization/__tests__/fixtures/fga/platform-visibility.fga.yaml +0 -199
- package/src/authorization/__tests__/fixtures/fga/provider-standing-viewer.fga.yaml +0 -40
- package/src/authorization/__tests__/fixtures/fga/reserved-label-writer.fga.yaml +0 -41
- package/src/authorization/__tests__/fixtures/fga/schedule-owner.fga.yaml +0 -113
- package/src/authorization/__tests__/fixtures/fga/schedule-session-visibility.fga.yaml +0 -214
- package/src/authorization/__tests__/fixtures/fga/session-personal-resource.fga.yaml +0 -117
- package/src/authorization/__tests__/fixtures/fga/workflow-execution-sharing.fga.yaml +0 -190
- package/src/authorization/model/agent.ts +0 -64
- package/src/authorization/model/agent_channel.ts +0 -57
- package/src/authorization/model/agent_execution.ts +0 -33
- package/src/authorization/model/agent_instance.ts +0 -66
- package/src/authorization/model/agent_share.ts +0 -40
- package/src/authorization/model/api_key.ts +0 -28
- package/src/authorization/model/artifact.ts +0 -38
- package/src/authorization/model/channel_app.ts +0 -39
- package/src/authorization/model/environment.ts +0 -48
- package/src/authorization/model/execution_context.ts +0 -20
- package/src/authorization/model/iam_policy.ts +0 -42
- package/src/authorization/model/identity_account.ts +0 -26
- package/src/authorization/model/mcp_server.ts +0 -59
- package/src/authorization/model/memory.ts +0 -27
- package/src/authorization/model/oauth_app.ts +0 -43
- package/src/authorization/model/organization.ts +0 -59
- package/src/authorization/model/platform_client.ts +0 -43
- package/src/authorization/model/plugin.ts +0 -66
- package/src/authorization/model/schedule.ts +0 -49
- package/src/authorization/model/session.ts +0 -50
- package/src/authorization/model/skill.ts +0 -60
- package/src/authorization/model/workflow.ts +0 -60
- package/src/authorization/model/workflow_execution.ts +0 -46
- package/src/authorization/model/workflow_instance.ts +0 -125
- package/src/authorization/store-test-kit.ts +0 -395
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/agentic/environment.fga — a member's credential
|
|
3
|
-
* store: owner-only writes (no admin arm), an org-visibility axis capped
|
|
4
|
-
* at the organization (`kind_meta` supports_org only — no public
|
|
5
|
-
* wildcard on the viewer line, and the evaluator would ignore one), and
|
|
6
|
-
* `can_read_secrets: creator`, the one verb that stays with the person
|
|
7
|
-
* who typed the values whatever the visibility, standing on the creator
|
|
8
|
-
* tuple `kind_meta` flags with requires_creator_tuple.
|
|
9
|
-
*/
|
|
10
|
-
import { EnvironmentSchema } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/api_pb";
|
|
11
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
computed,
|
|
15
|
-
declareKind,
|
|
16
|
-
direct,
|
|
17
|
-
objectOf,
|
|
18
|
-
union,
|
|
19
|
-
usersetOf,
|
|
20
|
-
} from "./rewrite.js";
|
|
21
|
-
|
|
22
|
-
export const environmentDeclaration = declareKind({
|
|
23
|
-
kind: ApiResourceKind.environment,
|
|
24
|
-
schema: EnvironmentSchema,
|
|
25
|
-
source: "fga/model/agentic/environment.fga",
|
|
26
|
-
relations: [
|
|
27
|
-
["organization", direct(objectOf("organization"))],
|
|
28
|
-
["creator", direct(objectOf("identity_account"))],
|
|
29
|
-
["owner", direct(objectOf("identity_account"))],
|
|
30
|
-
[
|
|
31
|
-
"viewer",
|
|
32
|
-
union(
|
|
33
|
-
direct(
|
|
34
|
-
objectOf("identity_account"),
|
|
35
|
-
usersetOf("organization", "member"),
|
|
36
|
-
usersetOf("organization", "viewer"),
|
|
37
|
-
),
|
|
38
|
-
computed("owner"),
|
|
39
|
-
),
|
|
40
|
-
],
|
|
41
|
-
["can_view", computed("viewer")],
|
|
42
|
-
["can_edit", computed("owner")],
|
|
43
|
-
["can_delete", computed("owner")],
|
|
44
|
-
["can_read_secrets", computed("creator")],
|
|
45
|
-
["can_grant_access", computed("owner")],
|
|
46
|
-
["can_view_access", computed("viewer")],
|
|
47
|
-
],
|
|
48
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/agentic/execution_context.fga — a run's working
|
|
3
|
-
* state, owner-only and unscoped (`kind_meta` OWNER_ONLY): two verbs,
|
|
4
|
-
* both `owner`, and no access list to grant on.
|
|
5
|
-
*/
|
|
6
|
-
import { ExecutionContextSchema } from "@stigmer/protos/ai/stigmer/agentic/executioncontext/v1/api_pb";
|
|
7
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
8
|
-
|
|
9
|
-
import { computed, declareKind, direct, objectOf } from "./rewrite.js";
|
|
10
|
-
|
|
11
|
-
export const executionContextDeclaration = declareKind({
|
|
12
|
-
kind: ApiResourceKind.execution_context,
|
|
13
|
-
schema: ExecutionContextSchema,
|
|
14
|
-
source: "fga/model/agentic/execution_context.fga",
|
|
15
|
-
relations: [
|
|
16
|
-
["owner", direct(objectOf("identity_account"))],
|
|
17
|
-
["can_view", computed("owner")],
|
|
18
|
-
["can_edit", computed("owner")],
|
|
19
|
-
],
|
|
20
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/iam/iam_policy.fga — the access-list row as an
|
|
3
|
-
* object of the model: its organization's admins own and view it. Declared
|
|
4
|
-
* for completeness of the transcript set (the drift compare reads every
|
|
5
|
-
* open-source file); no wire check targets it — the IamPolicy RPCs
|
|
6
|
-
* authorize against the policy's RESOURCE (`can_grant_access` on the
|
|
7
|
-
* organization; `get` loads the row and asks about what it names), and the
|
|
8
|
-
* tuple lifecycle writes nothing for it.
|
|
9
|
-
*/
|
|
10
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
11
|
-
import { IamPolicySchema } from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/api_pb";
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
computed,
|
|
15
|
-
declareKind,
|
|
16
|
-
direct,
|
|
17
|
-
from,
|
|
18
|
-
objectOf,
|
|
19
|
-
union,
|
|
20
|
-
} from "./rewrite.js";
|
|
21
|
-
|
|
22
|
-
export const iamPolicyDeclaration = declareKind({
|
|
23
|
-
kind: ApiResourceKind.iam_policy,
|
|
24
|
-
schema: IamPolicySchema,
|
|
25
|
-
source: "fga/model/iam/iam_policy.fga",
|
|
26
|
-
relations: [
|
|
27
|
-
["organization", direct(objectOf("organization"))],
|
|
28
|
-
[
|
|
29
|
-
"owner",
|
|
30
|
-
union(
|
|
31
|
-
direct(objectOf("identity_account")),
|
|
32
|
-
from("admin", "organization"),
|
|
33
|
-
),
|
|
34
|
-
],
|
|
35
|
-
["viewer", from("admin", "organization")],
|
|
36
|
-
["can_view", computed("viewer")],
|
|
37
|
-
["can_edit", computed("owner")],
|
|
38
|
-
["can_delete", computed("owner")],
|
|
39
|
-
["can_grant_access", computed("owner")],
|
|
40
|
-
["can_view_access", computed("viewer")],
|
|
41
|
-
],
|
|
42
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/iam/identity_account.fga — a person's own
|
|
3
|
-
* record: every verb is `owner`, and the owner is the account itself
|
|
4
|
-
* (`kind_meta` attribution SELF, so the derivation writes
|
|
5
|
-
* `identity_account:<id>#owner@identity_account:<id>`). No organization
|
|
6
|
-
* link and no admin arm: an admin manages members through IamPolicy rows
|
|
7
|
-
* on the organization, never through the account row.
|
|
8
|
-
*/
|
|
9
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
10
|
-
import { IdentityAccountSchema } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/api_pb";
|
|
11
|
-
|
|
12
|
-
import { computed, declareKind, direct, objectOf } from "./rewrite.js";
|
|
13
|
-
|
|
14
|
-
export const identityAccountDeclaration = declareKind({
|
|
15
|
-
kind: ApiResourceKind.identity_account,
|
|
16
|
-
schema: IdentityAccountSchema,
|
|
17
|
-
source: "fga/model/iam/identity_account.fga",
|
|
18
|
-
relations: [
|
|
19
|
-
["owner", direct(objectOf("identity_account"))],
|
|
20
|
-
["can_view", computed("owner")],
|
|
21
|
-
["can_edit", computed("owner")],
|
|
22
|
-
["can_delete", computed("owner")],
|
|
23
|
-
["can_grant_access", computed("owner")],
|
|
24
|
-
["can_view_access", computed("owner")],
|
|
25
|
-
],
|
|
26
|
-
});
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/agentic/mcp_server.fga — a blueprint with three
|
|
3
|
-
* read-side verbs: `can_use`, `can_clone` and `can_connect` (the OAuth
|
|
4
|
-
* connect lane's gate), all `viewer`. `team#member` on `viewer` is the
|
|
5
|
-
* Enterprise team grant, which no open-source tuple ever names.
|
|
6
|
-
*/
|
|
7
|
-
import { McpServerSchema } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/api_pb";
|
|
8
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
computed,
|
|
12
|
-
declareKind,
|
|
13
|
-
direct,
|
|
14
|
-
from,
|
|
15
|
-
objectOf,
|
|
16
|
-
union,
|
|
17
|
-
usersetOf,
|
|
18
|
-
} from "./rewrite.js";
|
|
19
|
-
|
|
20
|
-
export const mcpServerDeclaration = declareKind({
|
|
21
|
-
kind: ApiResourceKind.mcp_server,
|
|
22
|
-
schema: McpServerSchema,
|
|
23
|
-
source: "fga/model/agentic/mcp_server.fga",
|
|
24
|
-
relations: [
|
|
25
|
-
["organization", direct(objectOf("organization"))],
|
|
26
|
-
[
|
|
27
|
-
"owner",
|
|
28
|
-
union(
|
|
29
|
-
direct(objectOf("identity_account")),
|
|
30
|
-
from("admin", "organization"),
|
|
31
|
-
),
|
|
32
|
-
],
|
|
33
|
-
[
|
|
34
|
-
"platform_viewer",
|
|
35
|
-
direct(usersetOf("identity_provider", "platform_user")),
|
|
36
|
-
],
|
|
37
|
-
[
|
|
38
|
-
"viewer",
|
|
39
|
-
union(
|
|
40
|
-
direct(
|
|
41
|
-
objectOf("identity_account"),
|
|
42
|
-
usersetOf("organization", "member"),
|
|
43
|
-
usersetOf("organization", "viewer"),
|
|
44
|
-
usersetOf("team", "member"),
|
|
45
|
-
),
|
|
46
|
-
computed("owner"),
|
|
47
|
-
computed("platform_viewer"),
|
|
48
|
-
),
|
|
49
|
-
],
|
|
50
|
-
["can_view", computed("viewer")],
|
|
51
|
-
["can_edit", computed("owner")],
|
|
52
|
-
["can_delete", computed("owner")],
|
|
53
|
-
["can_use", computed("viewer")],
|
|
54
|
-
["can_clone", computed("viewer")],
|
|
55
|
-
["can_connect", computed("viewer")],
|
|
56
|
-
["can_grant_access", computed("owner")],
|
|
57
|
-
["can_view_access", computed("viewer")],
|
|
58
|
-
],
|
|
59
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/agentic/memory.fga — subject-only: the person a
|
|
3
|
-
* memory is ABOUT is its one principal (no owner, no creator, no
|
|
4
|
-
* visibility, nothing grantable; `kind_meta` attribution NONE with
|
|
5
|
-
* `subject` as an additional parent on `spec.subject_identity_account_id`).
|
|
6
|
-
* Organization admins govern the organization's memory switch and never
|
|
7
|
-
* read content, in the contract's own words. A row whose subject field is
|
|
8
|
-
* empty derives no principal at all — the derivation's rule for an
|
|
9
|
-
* absent parent — and is then nobody's under this evaluator.
|
|
10
|
-
*/
|
|
11
|
-
import { MemorySchema } from "@stigmer/protos/ai/stigmer/agentic/memory/v1/api_pb";
|
|
12
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
13
|
-
|
|
14
|
-
import { computed, declareKind, direct, objectOf } from "./rewrite.js";
|
|
15
|
-
|
|
16
|
-
export const memoryDeclaration = declareKind({
|
|
17
|
-
kind: ApiResourceKind.memory,
|
|
18
|
-
schema: MemorySchema,
|
|
19
|
-
source: "fga/model/agentic/memory.fga",
|
|
20
|
-
relations: [
|
|
21
|
-
["organization", direct(objectOf("organization"))],
|
|
22
|
-
["subject", direct(objectOf("identity_account"))],
|
|
23
|
-
["can_view", computed("subject")],
|
|
24
|
-
["can_edit", computed("subject")],
|
|
25
|
-
["can_delete", computed("subject")],
|
|
26
|
-
],
|
|
27
|
-
});
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/iam/oauth_app.fga — an organization-scoped kind
|
|
3
|
-
* whose `owner` has NO admin arm while its `viewer` does (platform_client
|
|
4
|
-
* shares the shape, for the same reason): the file's
|
|
5
|
-
* "administrative visibility" for the organization's admins over a
|
|
6
|
-
* registration that holds vendor client credentials, with change and
|
|
7
|
-
* deletion the creator's (or an explicit grant's) alone, and no public
|
|
8
|
-
* level at all.
|
|
9
|
-
*/
|
|
10
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
11
|
-
import { OAuthAppSchema } from "@stigmer/protos/ai/stigmer/iam/oauthapp/v1/api_pb";
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
computed,
|
|
15
|
-
declareKind,
|
|
16
|
-
direct,
|
|
17
|
-
from,
|
|
18
|
-
objectOf,
|
|
19
|
-
union,
|
|
20
|
-
} from "./rewrite.js";
|
|
21
|
-
|
|
22
|
-
export const oauthAppDeclaration = declareKind({
|
|
23
|
-
kind: ApiResourceKind.oauth_app,
|
|
24
|
-
schema: OAuthAppSchema,
|
|
25
|
-
source: "fga/model/iam/oauth_app.fga",
|
|
26
|
-
relations: [
|
|
27
|
-
["organization", direct(objectOf("organization"))],
|
|
28
|
-
["owner", direct(objectOf("identity_account"))],
|
|
29
|
-
[
|
|
30
|
-
"viewer",
|
|
31
|
-
union(
|
|
32
|
-
direct(objectOf("identity_account")),
|
|
33
|
-
computed("owner"),
|
|
34
|
-
from("admin", "organization"),
|
|
35
|
-
),
|
|
36
|
-
],
|
|
37
|
-
["can_view", computed("viewer")],
|
|
38
|
-
["can_edit", computed("owner")],
|
|
39
|
-
["can_delete", computed("owner")],
|
|
40
|
-
["can_grant_access", computed("owner")],
|
|
41
|
-
["can_view_access", computed("viewer")],
|
|
42
|
-
],
|
|
43
|
-
});
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/tenancy/organization.fga — the root of the
|
|
3
|
-
* model: no parent, the four roles as a ladder (`owner ⊂ admin ⊂ member
|
|
4
|
-
* ⊂ viewer`, each `[identity_account] or <the rung above>`), and every
|
|
5
|
-
* `can_create_*` an organization gates.
|
|
6
|
-
*
|
|
7
|
-
* In open source the `[identity_account]` tuples of this type ARE the
|
|
8
|
-
* IamPolicy rows: 2b's role lifecycle writes the creator's `owner` row and
|
|
9
|
-
* the grant path writes every other role, so the tuple source reads them
|
|
10
|
-
* from the IamPolicyStore and the derivation writes no owner tuple for
|
|
11
|
-
* this kind (derived-tuples.ts). `guest` is the cloud's anonymous
|
|
12
|
-
* share-link visitor; no open-source lane mints one (claim check C5), so
|
|
13
|
-
* the relation resolves to nothing and `can_create_session: member or
|
|
14
|
-
* guest` is `member` here — the transcript still carries the line.
|
|
15
|
-
* `can_create_team` is carried the same way: open source serves no Team
|
|
16
|
-
* kind, so nothing here asks it.
|
|
17
|
-
*/
|
|
18
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
19
|
-
import { OrganizationSchema } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/api_pb";
|
|
20
|
-
|
|
21
|
-
import { computed, declareKind, direct, objectOf, union } from "./rewrite.js";
|
|
22
|
-
|
|
23
|
-
export const organizationDeclaration = declareKind({
|
|
24
|
-
kind: ApiResourceKind.organization,
|
|
25
|
-
schema: OrganizationSchema,
|
|
26
|
-
source: "fga/model/tenancy/organization.fga",
|
|
27
|
-
relations: [
|
|
28
|
-
["owner", direct(objectOf("identity_account"))],
|
|
29
|
-
["admin", union(direct(objectOf("identity_account")), computed("owner"))],
|
|
30
|
-
["member", union(direct(objectOf("identity_account")), computed("admin"))],
|
|
31
|
-
["viewer", union(direct(objectOf("identity_account")), computed("member"))],
|
|
32
|
-
["guest", direct(objectOf("identity_account"))],
|
|
33
|
-
["can_view", computed("viewer")],
|
|
34
|
-
["can_edit", computed("admin")],
|
|
35
|
-
["can_delete", computed("owner")],
|
|
36
|
-
["can_manage_members", computed("admin")],
|
|
37
|
-
["can_assign_roles", computed("owner")],
|
|
38
|
-
["can_create_agent", computed("admin")],
|
|
39
|
-
["can_create_workflow", computed("admin")],
|
|
40
|
-
["can_create_session", union(computed("member"), computed("guest"))],
|
|
41
|
-
["can_create_environment", computed("member")],
|
|
42
|
-
["can_create_skill", computed("admin")],
|
|
43
|
-
["can_create_plugin", computed("admin")],
|
|
44
|
-
["can_create_mcp_server", computed("admin")],
|
|
45
|
-
["can_create_idp", computed("admin")],
|
|
46
|
-
["can_create_identity_account", computed("admin")],
|
|
47
|
-
["can_create_oauth_app", computed("admin")],
|
|
48
|
-
["can_create_platform_client", computed("admin")],
|
|
49
|
-
["can_create_channel_app", computed("admin")],
|
|
50
|
-
["can_create_execution_in", union(computed("member"), computed("guest"))],
|
|
51
|
-
["can_create_agent_share", computed("admin")],
|
|
52
|
-
["can_create_agent_instance", computed("member")],
|
|
53
|
-
["can_create_team", computed("admin")],
|
|
54
|
-
["can_grant_access", computed("admin")],
|
|
55
|
-
["can_view_access", computed("viewer")],
|
|
56
|
-
["can_view_billing", computed("viewer")],
|
|
57
|
-
["can_manage_billing", computed("admin")],
|
|
58
|
-
],
|
|
59
|
-
});
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/iam/platform_client.fga — relation for relation
|
|
3
|
-
* the oauth_app shape: organization-scoped, an `owner` with no admin arm
|
|
4
|
-
* and a `viewer` that has one. A platform client holds credential material,
|
|
5
|
-
* so the model is restricted: its creator (the owner) edits, deletes,
|
|
6
|
-
* rotates and grants; the organization's admins may view it; ordinary
|
|
7
|
-
* members have no access at all, which is why listByOrg narrows through
|
|
8
|
-
* the list read scope. There is no public level.
|
|
9
|
-
*/
|
|
10
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
11
|
-
import { PlatformClientSchema } from "@stigmer/protos/ai/stigmer/iam/platformclient/v1/api_pb";
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
computed,
|
|
15
|
-
declareKind,
|
|
16
|
-
direct,
|
|
17
|
-
from,
|
|
18
|
-
objectOf,
|
|
19
|
-
union,
|
|
20
|
-
} from "./rewrite.js";
|
|
21
|
-
|
|
22
|
-
export const platformClientDeclaration = declareKind({
|
|
23
|
-
kind: ApiResourceKind.platform_client,
|
|
24
|
-
schema: PlatformClientSchema,
|
|
25
|
-
source: "fga/model/iam/platform_client.fga",
|
|
26
|
-
relations: [
|
|
27
|
-
["organization", direct(objectOf("organization"))],
|
|
28
|
-
["owner", direct(objectOf("identity_account"))],
|
|
29
|
-
[
|
|
30
|
-
"viewer",
|
|
31
|
-
union(
|
|
32
|
-
direct(objectOf("identity_account")),
|
|
33
|
-
computed("owner"),
|
|
34
|
-
from("admin", "organization"),
|
|
35
|
-
),
|
|
36
|
-
],
|
|
37
|
-
["can_view", computed("viewer")],
|
|
38
|
-
["can_edit", computed("owner")],
|
|
39
|
-
["can_delete", computed("owner")],
|
|
40
|
-
["can_grant_access", computed("owner")],
|
|
41
|
-
["can_view_access", computed("viewer")],
|
|
42
|
-
],
|
|
43
|
-
});
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/agentic/plugin.fga — the unit of install, shaped
|
|
3
|
-
* exactly like a skill: an organization-owned blueprint whose owner is the
|
|
4
|
-
* installer (and, through the organization, its admins), whose viewers are
|
|
5
|
-
* the org's members and viewers and the platform viewer. Its verbs are the blueprint set: `can_view`, `can_edit`
|
|
6
|
-
* (visibility), `can_delete` (uninstall), `can_grant_access`,
|
|
7
|
-
* `can_view_access`; `can_use` is carried as the model's word for
|
|
8
|
-
* "install from" though no wire permission names it yet. `team#member` on
|
|
9
|
-
* `viewer` is the Enterprise team grant, which no open-source tuple ever
|
|
10
|
-
* names.
|
|
11
|
-
*
|
|
12
|
-
* The members a plugin materialises are NOT reached through this type:
|
|
13
|
-
* each is an ordinary skill, MCP server, agent or workflow with its own
|
|
14
|
-
* tuples, written by its own chain as the installing caller.
|
|
15
|
-
*/
|
|
16
|
-
import { PluginSchema } from "@stigmer/protos/ai/stigmer/agentic/plugin/v1/api_pb";
|
|
17
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
18
|
-
|
|
19
|
-
import {
|
|
20
|
-
computed,
|
|
21
|
-
declareKind,
|
|
22
|
-
direct,
|
|
23
|
-
from,
|
|
24
|
-
objectOf,
|
|
25
|
-
union,
|
|
26
|
-
usersetOf,
|
|
27
|
-
} from "./rewrite.js";
|
|
28
|
-
|
|
29
|
-
export const pluginDeclaration = declareKind({
|
|
30
|
-
kind: ApiResourceKind.plugin,
|
|
31
|
-
schema: PluginSchema,
|
|
32
|
-
source: "fga/model/agentic/plugin.fga",
|
|
33
|
-
relations: [
|
|
34
|
-
["organization", direct(objectOf("organization"))],
|
|
35
|
-
[
|
|
36
|
-
"owner",
|
|
37
|
-
union(
|
|
38
|
-
direct(objectOf("identity_account")),
|
|
39
|
-
from("admin", "organization"),
|
|
40
|
-
),
|
|
41
|
-
],
|
|
42
|
-
[
|
|
43
|
-
"platform_viewer",
|
|
44
|
-
direct(usersetOf("identity_provider", "platform_user")),
|
|
45
|
-
],
|
|
46
|
-
[
|
|
47
|
-
"viewer",
|
|
48
|
-
union(
|
|
49
|
-
direct(
|
|
50
|
-
objectOf("identity_account"),
|
|
51
|
-
usersetOf("organization", "member"),
|
|
52
|
-
usersetOf("organization", "viewer"),
|
|
53
|
-
usersetOf("team", "member"),
|
|
54
|
-
),
|
|
55
|
-
computed("owner"),
|
|
56
|
-
computed("platform_viewer"),
|
|
57
|
-
),
|
|
58
|
-
],
|
|
59
|
-
["can_view", computed("viewer")],
|
|
60
|
-
["can_edit", computed("owner")],
|
|
61
|
-
["can_delete", computed("owner")],
|
|
62
|
-
["can_use", computed("viewer")],
|
|
63
|
-
["can_grant_access", computed("owner")],
|
|
64
|
-
["can_view_access", computed("viewer")],
|
|
65
|
-
],
|
|
66
|
-
});
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/agentic/schedule.fga — a scheduled run's
|
|
3
|
-
* definition, admin-owned like a blueprint and viewable by its owners and
|
|
4
|
-
* explicit grantees. The sessions its fires create name it back through
|
|
5
|
-
* `session#schedule`, a link the cloud writes and this edition does not
|
|
6
|
-
* (session.ts); the schedule's own relations are unaffected. An explicit
|
|
7
|
-
* grant may name an Enterprise team (`team#member`), which no open-source
|
|
8
|
-
* tuple ever does.
|
|
9
|
-
*/
|
|
10
|
-
import { ScheduleSchema } from "@stigmer/protos/ai/stigmer/agentic/schedule/v1/api_pb";
|
|
11
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
computed,
|
|
15
|
-
declareKind,
|
|
16
|
-
direct,
|
|
17
|
-
from,
|
|
18
|
-
objectOf,
|
|
19
|
-
union,
|
|
20
|
-
usersetOf,
|
|
21
|
-
} from "./rewrite.js";
|
|
22
|
-
|
|
23
|
-
export const scheduleDeclaration = declareKind({
|
|
24
|
-
kind: ApiResourceKind.schedule,
|
|
25
|
-
schema: ScheduleSchema,
|
|
26
|
-
source: "fga/model/agentic/schedule.fga",
|
|
27
|
-
relations: [
|
|
28
|
-
["organization", direct(objectOf("organization"))],
|
|
29
|
-
[
|
|
30
|
-
"owner",
|
|
31
|
-
union(
|
|
32
|
-
direct(objectOf("identity_account")),
|
|
33
|
-
from("admin", "organization"),
|
|
34
|
-
),
|
|
35
|
-
],
|
|
36
|
-
[
|
|
37
|
-
"viewer",
|
|
38
|
-
union(
|
|
39
|
-
direct(objectOf("identity_account"), usersetOf("team", "member")),
|
|
40
|
-
computed("owner"),
|
|
41
|
-
),
|
|
42
|
-
],
|
|
43
|
-
["can_view", computed("viewer")],
|
|
44
|
-
["can_edit", computed("owner")],
|
|
45
|
-
["can_delete", computed("owner")],
|
|
46
|
-
["can_grant_access", computed("owner")],
|
|
47
|
-
["can_view_access", computed("viewer")],
|
|
48
|
-
],
|
|
49
|
-
});
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/agentic/session.fga — a personal resource: the
|
|
3
|
-
* owner and explicit grantees, and NO admin arm anywhere ("private
|
|
4
|
-
* conversations that admins have no business accessing", the file's own
|
|
5
|
-
* words). Three parent links beside the organization: `agent_instance`,
|
|
6
|
-
* `channel` and `schedule`. None is a `kind_meta` fact — the cloud's
|
|
7
|
-
* channel and schedule lanes write them — so on this edition the
|
|
8
|
-
* derivation produces no such tuple and `viewer from channel` / `viewer
|
|
9
|
-
* from schedule` resolve to nobody; the lines stand in the transcript
|
|
10
|
-
* because they are the model's, and a scheduled run reaches its creator
|
|
11
|
-
* through the fire caller's stamp on the session instead.
|
|
12
|
-
*/
|
|
13
|
-
import { SessionSchema } from "@stigmer/protos/ai/stigmer/agentic/session/v1/api_pb";
|
|
14
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
computed,
|
|
18
|
-
declareKind,
|
|
19
|
-
direct,
|
|
20
|
-
from,
|
|
21
|
-
objectOf,
|
|
22
|
-
union,
|
|
23
|
-
} from "./rewrite.js";
|
|
24
|
-
|
|
25
|
-
export const sessionDeclaration = declareKind({
|
|
26
|
-
kind: ApiResourceKind.session,
|
|
27
|
-
schema: SessionSchema,
|
|
28
|
-
source: "fga/model/agentic/session.fga",
|
|
29
|
-
relations: [
|
|
30
|
-
["organization", direct(objectOf("organization"))],
|
|
31
|
-
["agent_instance", direct(objectOf("agent_instance"))],
|
|
32
|
-
["channel", direct(objectOf("agent_channel"))],
|
|
33
|
-
["schedule", direct(objectOf("schedule"))],
|
|
34
|
-
["owner", direct(objectOf("identity_account"))],
|
|
35
|
-
["viewer", union(direct(objectOf("identity_account")), computed("owner"))],
|
|
36
|
-
[
|
|
37
|
-
"can_view",
|
|
38
|
-
union(
|
|
39
|
-
computed("viewer"),
|
|
40
|
-
from("viewer", "channel"),
|
|
41
|
-
from("viewer", "schedule"),
|
|
42
|
-
),
|
|
43
|
-
],
|
|
44
|
-
["can_edit", computed("owner")],
|
|
45
|
-
["can_delete", computed("owner")],
|
|
46
|
-
["can_create_execution_in", computed("viewer")],
|
|
47
|
-
["can_grant_access", computed("owner")],
|
|
48
|
-
["can_view_access", computed("viewer")],
|
|
49
|
-
],
|
|
50
|
-
});
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/agentic/skill.fga — a blueprint whose verbs are
|
|
3
|
-
* `can_use` and `can_clone` rather than `can_execute`. Only `can_view`,
|
|
4
|
-
* `can_edit`, `can_delete`, `can_grant_access` and `can_view_access` are
|
|
5
|
-
* in the wire's IamPermission vocabulary; the others are the model's and
|
|
6
|
-
* are carried so the transcript is the file. `team#member` on `viewer` is
|
|
7
|
-
* the Enterprise team grant, which no open-source tuple ever names.
|
|
8
|
-
*/
|
|
9
|
-
import { SkillSchema } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/api_pb";
|
|
10
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
computed,
|
|
14
|
-
declareKind,
|
|
15
|
-
direct,
|
|
16
|
-
from,
|
|
17
|
-
objectOf,
|
|
18
|
-
union,
|
|
19
|
-
usersetOf,
|
|
20
|
-
} from "./rewrite.js";
|
|
21
|
-
|
|
22
|
-
export const skillDeclaration = declareKind({
|
|
23
|
-
kind: ApiResourceKind.skill,
|
|
24
|
-
schema: SkillSchema,
|
|
25
|
-
source: "fga/model/agentic/skill.fga",
|
|
26
|
-
relations: [
|
|
27
|
-
["organization", direct(objectOf("organization"))],
|
|
28
|
-
[
|
|
29
|
-
"owner",
|
|
30
|
-
union(
|
|
31
|
-
direct(objectOf("identity_account")),
|
|
32
|
-
from("admin", "organization"),
|
|
33
|
-
),
|
|
34
|
-
],
|
|
35
|
-
[
|
|
36
|
-
"platform_viewer",
|
|
37
|
-
direct(usersetOf("identity_provider", "platform_user")),
|
|
38
|
-
],
|
|
39
|
-
[
|
|
40
|
-
"viewer",
|
|
41
|
-
union(
|
|
42
|
-
direct(
|
|
43
|
-
objectOf("identity_account"),
|
|
44
|
-
usersetOf("organization", "member"),
|
|
45
|
-
usersetOf("organization", "viewer"),
|
|
46
|
-
usersetOf("team", "member"),
|
|
47
|
-
),
|
|
48
|
-
computed("owner"),
|
|
49
|
-
computed("platform_viewer"),
|
|
50
|
-
),
|
|
51
|
-
],
|
|
52
|
-
["can_view", computed("viewer")],
|
|
53
|
-
["can_edit", computed("owner")],
|
|
54
|
-
["can_delete", computed("owner")],
|
|
55
|
-
["can_use", computed("viewer")],
|
|
56
|
-
["can_clone", computed("viewer")],
|
|
57
|
-
["can_grant_access", computed("owner")],
|
|
58
|
-
["can_view_access", computed("viewer")],
|
|
59
|
-
],
|
|
60
|
-
});
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/agentic/workflow.fga — the agent's shape
|
|
3
|
-
* without `can_create_instance` (a workflow instance is created through
|
|
4
|
-
* the workflow-instance lane, gated by the organization). Kept as its own
|
|
5
|
-
* transcript, not a shared "blueprint" helper, so the file-by-file drift
|
|
6
|
-
* compare sees exactly this file's lines. `team#member` on `viewer` is the
|
|
7
|
-
* Enterprise team grant, which no open-source tuple ever names.
|
|
8
|
-
*/
|
|
9
|
-
import { WorkflowSchema } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/api_pb";
|
|
10
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
computed,
|
|
14
|
-
declareKind,
|
|
15
|
-
direct,
|
|
16
|
-
from,
|
|
17
|
-
objectOf,
|
|
18
|
-
union,
|
|
19
|
-
usersetOf,
|
|
20
|
-
} from "./rewrite.js";
|
|
21
|
-
|
|
22
|
-
export const workflowDeclaration = declareKind({
|
|
23
|
-
kind: ApiResourceKind.workflow,
|
|
24
|
-
schema: WorkflowSchema,
|
|
25
|
-
source: "fga/model/agentic/workflow.fga",
|
|
26
|
-
relations: [
|
|
27
|
-
["organization", direct(objectOf("organization"))],
|
|
28
|
-
[
|
|
29
|
-
"owner",
|
|
30
|
-
union(
|
|
31
|
-
direct(objectOf("identity_account")),
|
|
32
|
-
from("admin", "organization"),
|
|
33
|
-
),
|
|
34
|
-
],
|
|
35
|
-
[
|
|
36
|
-
"platform_viewer",
|
|
37
|
-
direct(usersetOf("identity_provider", "platform_user")),
|
|
38
|
-
],
|
|
39
|
-
[
|
|
40
|
-
"viewer",
|
|
41
|
-
union(
|
|
42
|
-
direct(
|
|
43
|
-
objectOf("identity_account"),
|
|
44
|
-
usersetOf("organization", "member"),
|
|
45
|
-
usersetOf("organization", "viewer"),
|
|
46
|
-
usersetOf("team", "member"),
|
|
47
|
-
),
|
|
48
|
-
computed("owner"),
|
|
49
|
-
computed("platform_viewer"),
|
|
50
|
-
),
|
|
51
|
-
],
|
|
52
|
-
["can_view", computed("viewer")],
|
|
53
|
-
["can_edit", computed("owner")],
|
|
54
|
-
["can_delete", computed("owner")],
|
|
55
|
-
["can_execute", computed("viewer")],
|
|
56
|
-
["can_clone", computed("viewer")],
|
|
57
|
-
["can_grant_access", computed("owner")],
|
|
58
|
-
["can_view_access", computed("viewer")],
|
|
59
|
-
],
|
|
60
|
-
});
|