@stigmer/server 3.27.1 → 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.
Files changed (245) hide show
  1. package/README.md +2 -0
  2. package/dist/authorization/authorizer.d.ts +7 -5
  3. package/dist/authorization/authorizer.d.ts.map +1 -1
  4. package/dist/authorization/authorizer.js +7 -5
  5. package/dist/authorization/authorizer.js.map +1 -1
  6. package/dist/authorization/derived-tuples.d.ts +3 -1
  7. package/dist/authorization/derived-tuples.d.ts.map +1 -1
  8. package/dist/authorization/derived-tuples.js +52 -2
  9. package/dist/authorization/derived-tuples.js.map +1 -1
  10. package/dist/authorization/evaluator.d.ts +9 -10
  11. package/dist/authorization/evaluator.d.ts.map +1 -1
  12. package/dist/authorization/evaluator.js.map +1 -1
  13. package/dist/authorization/list-read-scope.d.ts.map +1 -1
  14. package/dist/authorization/list-read-scope.js +29 -18
  15. package/dist/authorization/list-read-scope.js.map +1 -1
  16. package/dist/authorization/model/bindings.d.ts +41 -0
  17. package/dist/authorization/model/bindings.d.ts.map +1 -0
  18. package/dist/authorization/model/bindings.js +89 -0
  19. package/dist/authorization/model/bindings.js.map +1 -0
  20. package/dist/authorization/model/data/authorization-model.json +3114 -0
  21. package/dist/authorization/model/default-of.d.ts +2 -2
  22. package/dist/authorization/model/execution-viewer.d.ts +3 -0
  23. package/dist/authorization/model/execution-viewer.d.ts.map +1 -0
  24. package/dist/authorization/model/execution-viewer.js +50 -0
  25. package/dist/authorization/model/execution-viewer.js.map +1 -0
  26. package/dist/authorization/model/index.d.ts +33 -21
  27. package/dist/authorization/model/index.d.ts.map +1 -1
  28. package/dist/authorization/model/index.js +74 -52
  29. package/dist/authorization/model/index.js.map +1 -1
  30. package/dist/authorization/model/openfga-json.d.ts +18 -0
  31. package/dist/authorization/model/openfga-json.d.ts.map +1 -0
  32. package/dist/authorization/model/openfga-json.js +266 -0
  33. package/dist/authorization/model/openfga-json.js.map +1 -0
  34. package/dist/authorization/model/rewrite.d.ts +39 -67
  35. package/dist/authorization/model/rewrite.d.ts.map +1 -1
  36. package/dist/authorization/model/rewrite.js +1 -117
  37. package/dist/authorization/model/rewrite.js.map +1 -1
  38. package/dist/authorization/strict-json.d.ts +20 -0
  39. package/dist/authorization/strict-json.d.ts.map +1 -0
  40. package/dist/authorization/strict-json.js +45 -0
  41. package/dist/authorization/strict-json.js.map +1 -0
  42. package/dist/boot/compose.d.ts.map +1 -1
  43. package/dist/boot/compose.js +9 -7
  44. package/dist/boot/compose.js.map +1 -1
  45. package/dist/boot/list-indexes.d.ts.map +1 -1
  46. package/dist/boot/list-indexes.js +6 -0
  47. package/dist/boot/list-indexes.js.map +1 -1
  48. package/dist/domain/iampolicy/list-index.d.ts +2 -0
  49. package/dist/domain/iampolicy/list-index.d.ts.map +1 -0
  50. package/dist/domain/iampolicy/list-index.js +32 -0
  51. package/dist/domain/iampolicy/list-index.js.map +1 -0
  52. package/dist/domain/iampolicy/resource-store.d.ts.map +1 -1
  53. package/dist/domain/iampolicy/resource-store.js +24 -11
  54. package/dist/domain/iampolicy/resource-store.js.map +1 -1
  55. package/dist/domain/workflowexecution/list-index.d.ts +1 -1
  56. package/dist/extensions/list-read-scope.d.ts +20 -3
  57. package/dist/extensions/list-read-scope.d.ts.map +1 -1
  58. package/dist/extensions/list-read-scope.js +22 -2
  59. package/dist/extensions/list-read-scope.js.map +1 -1
  60. package/dist/index.d.ts +8 -8
  61. package/dist/index.d.ts.map +1 -1
  62. package/dist/index.js +20 -5
  63. package/dist/index.js.map +1 -1
  64. package/package.json +7 -6
  65. package/src/authorization/README.md +48 -39
  66. package/src/authorization/__tests__/authorizer.test.ts +5 -14
  67. package/src/authorization/__tests__/derived-tuples.test.ts +192 -17
  68. package/src/authorization/__tests__/evaluator.test.ts +53 -160
  69. package/src/authorization/__tests__/facts.test.ts +5 -11
  70. package/src/authorization/__tests__/list-read-scope.measure.test.ts +424 -62
  71. package/src/authorization/__tests__/list-read-scope.test.ts +15 -14
  72. package/src/authorization/__tests__/organization-directory.test.ts +2 -2
  73. package/src/authorization/__tests__/store-test-kit.ts +246 -0
  74. package/src/authorization/__tests__/store-tests.test.ts +91 -223
  75. package/src/authorization/__tests__/support.ts +30 -2
  76. package/src/authorization/__tests__/throwaway-model.ts +75 -0
  77. package/src/authorization/__tests__/wire-permissions.test.ts +141 -107
  78. package/src/authorization/authorizer.ts +7 -5
  79. package/src/authorization/derived-tuples.ts +105 -16
  80. package/src/authorization/evaluator.ts +8 -10
  81. package/src/authorization/list-read-scope.ts +37 -22
  82. package/src/authorization/model/__tests__/openfga-json.test.ts +353 -0
  83. package/src/authorization/model/__tests__/registry.test.ts +102 -276
  84. package/src/authorization/model/bindings.ts +131 -0
  85. package/src/authorization/model/data/authorization-model.json +3114 -0
  86. package/src/authorization/model/default-of.ts +2 -2
  87. package/src/authorization/model/execution-viewer.ts +56 -0
  88. package/src/authorization/model/index.ts +81 -72
  89. package/src/authorization/model/openfga-json.ts +310 -0
  90. package/src/authorization/model/rewrite.ts +39 -188
  91. package/src/authorization/strict-json.ts +52 -0
  92. package/src/boot/__tests__/list-indexes.test.ts +4 -0
  93. package/src/boot/compose.ts +9 -7
  94. package/src/boot/list-indexes.ts +6 -0
  95. package/src/domain/iampolicy/__tests__/resource-store.test.ts +65 -5
  96. package/src/domain/iampolicy/list-index.ts +33 -0
  97. package/src/domain/iampolicy/resource-store.ts +24 -11
  98. package/src/extensions/__tests__/built-in-authorization-composed.test.ts +3 -6
  99. package/src/extensions/list-read-scope.ts +32 -4
  100. package/src/index.ts +20 -44
  101. package/dist/authorization/model/agent.d.ts +0 -2
  102. package/dist/authorization/model/agent.d.ts.map +0 -1
  103. package/dist/authorization/model/agent.js +0 -43
  104. package/dist/authorization/model/agent.js.map +0 -1
  105. package/dist/authorization/model/agent_channel.d.ts +0 -2
  106. package/dist/authorization/model/agent_channel.d.ts.map +0 -1
  107. package/dist/authorization/model/agent_channel.js +0 -39
  108. package/dist/authorization/model/agent_channel.js.map +0 -1
  109. package/dist/authorization/model/agent_execution.d.ts +0 -2
  110. package/dist/authorization/model/agent_execution.d.ts.map +0 -1
  111. package/dist/authorization/model/agent_execution.js +0 -25
  112. package/dist/authorization/model/agent_execution.js.map +0 -1
  113. package/dist/authorization/model/agent_instance.d.ts +0 -2
  114. package/dist/authorization/model/agent_instance.d.ts.map +0 -1
  115. package/dist/authorization/model/agent_instance.js +0 -48
  116. package/dist/authorization/model/agent_instance.js.map +0 -1
  117. package/dist/authorization/model/agent_share.d.ts +0 -2
  118. package/dist/authorization/model/agent_share.d.ts.map +0 -1
  119. package/dist/authorization/model/agent_share.js +0 -29
  120. package/dist/authorization/model/agent_share.js.map +0 -1
  121. package/dist/authorization/model/api_key.d.ts +0 -2
  122. package/dist/authorization/model/api_key.d.ts.map +0 -1
  123. package/dist/authorization/model/api_key.js +0 -27
  124. package/dist/authorization/model/api_key.js.map +0 -1
  125. package/dist/authorization/model/artifact.d.ts +0 -2
  126. package/dist/authorization/model/artifact.d.ts.map +0 -1
  127. package/dist/authorization/model/artifact.js +0 -27
  128. package/dist/authorization/model/artifact.js.map +0 -1
  129. package/dist/authorization/model/channel_app.d.ts +0 -2
  130. package/dist/authorization/model/channel_app.d.ts.map +0 -1
  131. package/dist/authorization/model/channel_app.js +0 -28
  132. package/dist/authorization/model/channel_app.js.map +0 -1
  133. package/dist/authorization/model/environment.d.ts +0 -2
  134. package/dist/authorization/model/environment.d.ts.map +0 -1
  135. package/dist/authorization/model/environment.js +0 -33
  136. package/dist/authorization/model/environment.js.map +0 -1
  137. package/dist/authorization/model/execution_context.d.ts +0 -2
  138. package/dist/authorization/model/execution_context.d.ts.map +0 -1
  139. package/dist/authorization/model/execution_context.js +0 -19
  140. package/dist/authorization/model/execution_context.js.map +0 -1
  141. package/dist/authorization/model/iam_policy.d.ts +0 -2
  142. package/dist/authorization/model/iam_policy.d.ts.map +0 -1
  143. package/dist/authorization/model/iam_policy.js +0 -31
  144. package/dist/authorization/model/iam_policy.js.map +0 -1
  145. package/dist/authorization/model/identity_account.d.ts +0 -2
  146. package/dist/authorization/model/identity_account.d.ts.map +0 -1
  147. package/dist/authorization/model/identity_account.js +0 -25
  148. package/dist/authorization/model/identity_account.js.map +0 -1
  149. package/dist/authorization/model/mcp_server.d.ts +0 -2
  150. package/dist/authorization/model/mcp_server.d.ts.map +0 -1
  151. package/dist/authorization/model/mcp_server.js +0 -38
  152. package/dist/authorization/model/mcp_server.js.map +0 -1
  153. package/dist/authorization/model/memory.d.ts +0 -2
  154. package/dist/authorization/model/memory.d.ts.map +0 -1
  155. package/dist/authorization/model/memory.js +0 -26
  156. package/dist/authorization/model/memory.js.map +0 -1
  157. package/dist/authorization/model/oauth_app.d.ts +0 -2
  158. package/dist/authorization/model/oauth_app.d.ts.map +0 -1
  159. package/dist/authorization/model/oauth_app.js +0 -31
  160. package/dist/authorization/model/oauth_app.js.map +0 -1
  161. package/dist/authorization/model/organization.d.ts +0 -2
  162. package/dist/authorization/model/organization.d.ts.map +0 -1
  163. package/dist/authorization/model/organization.js +0 -58
  164. package/dist/authorization/model/organization.js.map +0 -1
  165. package/dist/authorization/model/platform_client.d.ts +0 -2
  166. package/dist/authorization/model/platform_client.d.ts.map +0 -1
  167. package/dist/authorization/model/platform_client.js +0 -31
  168. package/dist/authorization/model/platform_client.js.map +0 -1
  169. package/dist/authorization/model/plugin.d.ts +0 -2
  170. package/dist/authorization/model/plugin.d.ts.map +0 -1
  171. package/dist/authorization/model/plugin.js +0 -45
  172. package/dist/authorization/model/plugin.js.map +0 -1
  173. package/dist/authorization/model/schedule.d.ts +0 -2
  174. package/dist/authorization/model/schedule.d.ts.map +0 -1
  175. package/dist/authorization/model/schedule.js +0 -34
  176. package/dist/authorization/model/schedule.js.map +0 -1
  177. package/dist/authorization/model/session.d.ts +0 -2
  178. package/dist/authorization/model/session.d.ts.map +0 -1
  179. package/dist/authorization/model/session.js +0 -38
  180. package/dist/authorization/model/session.js.map +0 -1
  181. package/dist/authorization/model/skill.d.ts +0 -2
  182. package/dist/authorization/model/skill.d.ts.map +0 -1
  183. package/dist/authorization/model/skill.js +0 -39
  184. package/dist/authorization/model/skill.js.map +0 -1
  185. package/dist/authorization/model/workflow.d.ts +0 -2
  186. package/dist/authorization/model/workflow.d.ts.map +0 -1
  187. package/dist/authorization/model/workflow.js +0 -39
  188. package/dist/authorization/model/workflow.js.map +0 -1
  189. package/dist/authorization/model/workflow_execution.d.ts +0 -2
  190. package/dist/authorization/model/workflow_execution.d.ts.map +0 -1
  191. package/dist/authorization/model/workflow_execution.js +0 -33
  192. package/dist/authorization/model/workflow_execution.js.map +0 -1
  193. package/dist/authorization/model/workflow_instance.d.ts +0 -2
  194. package/dist/authorization/model/workflow_instance.d.ts.map +0 -1
  195. package/dist/authorization/model/workflow_instance.js +0 -96
  196. package/dist/authorization/model/workflow_instance.js.map +0 -1
  197. package/dist/authorization/store-test-kit.d.ts +0 -62
  198. package/dist/authorization/store-test-kit.d.ts.map +0 -1
  199. package/dist/authorization/store-test-kit.js +0 -265
  200. package/dist/authorization/store-test-kit.js.map +0 -1
  201. package/src/authorization/__tests__/fixtures/fga/agent-channel-owner.fga.yaml +0 -112
  202. package/src/authorization/__tests__/fixtures/fga/agent-instance-creation.fga.yaml +0 -177
  203. package/src/authorization/__tests__/fixtures/fga/agent-share-owner.fga.yaml +0 -109
  204. package/src/authorization/__tests__/fixtures/fga/artifact-org-and-owner.fga.yaml +0 -128
  205. package/src/authorization/__tests__/fixtures/fga/blueprint-private-visibility.fga.yaml +0 -318
  206. package/src/authorization/__tests__/fixtures/fga/channel-app-owner.fga.yaml +0 -125
  207. package/src/authorization/__tests__/fixtures/fga/channel-participation.fga.yaml +0 -201
  208. package/src/authorization/__tests__/fixtures/fga/channel-session-visibility.fga.yaml +0 -187
  209. package/src/authorization/__tests__/fixtures/fga/default-instance-inheritance.fga.yaml +0 -214
  210. package/src/authorization/__tests__/fixtures/fga/mcp-server-authoring.fga.yaml +0 -129
  211. package/src/authorization/__tests__/fixtures/fga/memory-subject-only.fga.yaml +0 -72
  212. package/src/authorization/__tests__/fixtures/fga/org-admin-owner-inheritance.fga.yaml +0 -308
  213. package/src/authorization/__tests__/fixtures/fga/org-shared-environment.fga.yaml +0 -144
  214. package/src/authorization/__tests__/fixtures/fga/platform-visibility.fga.yaml +0 -199
  215. package/src/authorization/__tests__/fixtures/fga/provider-standing-viewer.fga.yaml +0 -40
  216. package/src/authorization/__tests__/fixtures/fga/reserved-label-writer.fga.yaml +0 -41
  217. package/src/authorization/__tests__/fixtures/fga/schedule-owner.fga.yaml +0 -113
  218. package/src/authorization/__tests__/fixtures/fga/schedule-session-visibility.fga.yaml +0 -214
  219. package/src/authorization/__tests__/fixtures/fga/session-personal-resource.fga.yaml +0 -117
  220. package/src/authorization/__tests__/fixtures/fga/workflow-execution-sharing.fga.yaml +0 -190
  221. package/src/authorization/model/agent.ts +0 -64
  222. package/src/authorization/model/agent_channel.ts +0 -57
  223. package/src/authorization/model/agent_execution.ts +0 -33
  224. package/src/authorization/model/agent_instance.ts +0 -66
  225. package/src/authorization/model/agent_share.ts +0 -40
  226. package/src/authorization/model/api_key.ts +0 -28
  227. package/src/authorization/model/artifact.ts +0 -38
  228. package/src/authorization/model/channel_app.ts +0 -39
  229. package/src/authorization/model/environment.ts +0 -48
  230. package/src/authorization/model/execution_context.ts +0 -20
  231. package/src/authorization/model/iam_policy.ts +0 -42
  232. package/src/authorization/model/identity_account.ts +0 -26
  233. package/src/authorization/model/mcp_server.ts +0 -59
  234. package/src/authorization/model/memory.ts +0 -27
  235. package/src/authorization/model/oauth_app.ts +0 -43
  236. package/src/authorization/model/organization.ts +0 -59
  237. package/src/authorization/model/platform_client.ts +0 -43
  238. package/src/authorization/model/plugin.ts +0 -66
  239. package/src/authorization/model/schedule.ts +0 -49
  240. package/src/authorization/model/session.ts +0 -50
  241. package/src/authorization/model/skill.ts +0 -60
  242. package/src/authorization/model/workflow.ts +0 -60
  243. package/src/authorization/model/workflow_execution.ts +0 -46
  244. package/src/authorization/model/workflow_instance.ts +0 -125
  245. package/src/authorization/store-test-kit.ts +0 -395
@@ -131,7 +131,10 @@ import type { ApiResourceAudit } from "@stigmer/protos/ai/stigmer/commons/apires
131
131
  // protos and each other, so there is no cycle. Deliberate — one resolver
132
132
  // for the tuple writer, the point-check driver and the list reader beats
133
133
  // a copy in the seam.
134
- import { inheritedAuthorizationParentOf } from "../pipeline/apiresource-meta.js";
134
+ import {
135
+ inheritedAuthorizationParentOf,
136
+ kindEnumName,
137
+ } from "../pipeline/apiresource-meta.js";
135
138
  import { rowAuthorizationFactsOf } from "../pipeline/steps/authorization-facts.js";
136
139
 
137
140
  import type { CallerIdentity } from "./identity.js";
@@ -192,8 +195,9 @@ export interface ListReadScope {
192
195
  * `caller` is never the `internal` class: `restrictListByReadScope`,
193
196
  * the one consumption idiom, answers that class before any driver is
194
197
  * asked (the header's contract line). A driver that is offered it has
195
- * been reached around the idiom and should refuse loudly rather than
196
- * evaluate the server as a person (the built-in driver does).
198
+ * been reached around the idiom and refuses with
199
+ * `InternalCallerOfferedError` rather than evaluate the server as a
200
+ * person.
197
201
  */
198
202
  restrictListEntries(
199
203
  caller: CallerIdentity,
@@ -202,6 +206,29 @@ export interface ListReadScope {
202
206
  ): Promise<ReadonlySet<string>>;
203
207
  }
204
208
 
209
+ /**
210
+ * The restrict verb's refusal of the `internal` class (its doc above):
211
+ * thrown by a driver that is offered the server acting as itself, which
212
+ * `restrictListByReadScope` answers before any driver is asked. Being
213
+ * offered it means a list lane reached the driver around that idiom, and
214
+ * evaluating the server as a person would answer a quiet short list, the
215
+ * failure stigmer#1207 fixed. It is a consumer bug, never a denial (a
216
+ * denial is an empty set): the lane faults and the pipeline answers its
217
+ * sanitized INTERNAL. One type for every edition's driver, so each refuses
218
+ * the class the same way.
219
+ */
220
+ export class InternalCallerOfferedError extends Error {
221
+ readonly kind: ApiResourceKind;
222
+
223
+ constructor(kind: ApiResourceKind) {
224
+ super(
225
+ `the internal caller class was offered to the list scope for kind '${kindEnumName(kind)}' — the shared helper answers that class before any driver; a list lane reached the driver around it`,
226
+ );
227
+ this.name = "InternalCallerOfferedError";
228
+ this.kind = kind;
229
+ }
230
+ }
231
+
205
232
  /**
206
233
  * The shape every stored API resource message presents to the shared
207
234
  * helper — the metadata fields the scope's candidates are built from, the
@@ -224,7 +251,8 @@ export interface ScopedListResource {
224
251
  /**
225
252
  * The ONE consumption idiom for post-scan lanes (the shared-step
226
253
  * discipline of pipeline/steps/authorization-tuples.ts, rendered as a
227
- * helper because half the lanes are direct handlers):
254
+ * helper because half the lanes are direct handlers; on the barrel, so a
255
+ * composition's lane over its own table narrows the same way):
228
256
  *
229
257
  * - no scope composed → the input array unchanged (byte-identity;
230
258
  * `requestOrg` deliberately not consulted — the OSS single-tenant
package/src/index.ts CHANGED
@@ -10,6 +10,12 @@
10
10
  * to this file are owner-visible surface changes, extended only through
11
11
  * gates (the DD-005 review property: a surface change is a one-file diff).
12
12
  *
13
+ * One data file is published beside it, through its own exports entry:
14
+ * `@stigmer/server/authorization-model.json`, the compiled authorization
15
+ * model (OpenFGA's JSON, generated from fga/model, whose README states the
16
+ * file's contract). Every edition reads those bytes: this server
17
+ * evaluates them, and an edition that runs OpenFGA applies them.
18
+ *
13
19
  * The surface is exactly what the ratified architecture names (blueprint
14
20
  * 20260826.02/03 §1) and the parameter types those entries force:
15
21
  * - the compose entry and config loading (composeServer + its options'
@@ -224,56 +230,26 @@ export {
224
230
  canSign,
225
231
  platformTokenKeyRingFromPem,
226
232
  } from "./platformtoken/key-ring.js";
227
- // The built-in authorizer's model seams: the kind
228
- // declarations (transcripts of the cloud's `.fga` files), the evaluator,
229
- // and the OpenFGA store-test kit — exported so the cloud's drift test
230
- // compares the live model against the transcripts and runs its live
231
- // store tests through the evaluator, both from the published package.
232
- // The drivers themselves are composed by the root and are not exported.
233
- export type {
234
- DerivedRelation,
235
- KindDeclaration,
236
- Rewrite,
237
- SubjectType,
238
- } from "./authorization/model/rewrite.js";
239
- export type { Model } from "./authorization/model/index.js";
240
- export {
241
- builtInModel,
242
- declarationFor,
243
- newModel,
244
- } from "./authorization/model/index.js";
245
- export type {
246
- ObjectRef,
247
- Person,
248
- Subject,
249
- Tuple,
250
- TupleSource,
251
- } from "./authorization/tuples.js";
252
- export type { EvaluationFault } from "./authorization/evaluator.js";
253
- export {
254
- AuthorizationEvaluationError,
255
- MAX_RESOLUTION_DEPTH,
256
- checkRelation,
257
- } from "./authorization/evaluator.js";
258
- export type {
259
- StoreTestCase,
260
- StoreTestDocument,
261
- StoreTestKit,
262
- StoreTestSkip,
263
- StoreTestSkipReason,
264
- } from "./authorization/store-test-kit.js";
265
- export {
266
- parseStoreTestDocument,
267
- storeTestCases,
268
- } from "./authorization/store-test-kit.js";
269
233
  // The kinds whose missing row the built-in authorizer denies instead of
270
- // answering not-found — the cloud's probe exemption over the open-source
271
- // tier; exported so the cloud's drift test pins the two sets equal.
234
+ // answering not-found: exported so a composition that authorizes with its
235
+ // own engine and probes existence itself pins its exemptions to this set.
236
+ // The model the authorizer evaluates is not exported as code: it is the
237
+ // data subpath `@stigmer/server/authorization-model.json` (this file's
238
+ // header).
272
239
  export { NOT_FOUND_EXEMPT_KINDS } from "./authorization/authorizer.js";
273
240
  export type {
274
241
  ListReadScope,
275
242
  ListEntryMeta,
276
243
  } from "./extensions/list-read-scope.js";
244
+ // The one consumption idiom of the list read scope for post-scan list lanes:
245
+ // exported so a list lane a composition serves from its own table narrows
246
+ // its rows exactly as the library's lanes do, instead of building each
247
+ // candidate's authorization facts by hand.
248
+ export { restrictListByReadScope } from "./extensions/list-read-scope.js";
249
+ // The seam's refusal of the `internal` caller class on the restrict verb,
250
+ // which that idiom answers before any driver is asked: exported so a
251
+ // composition's driver refuses the class exactly as the built-in one does.
252
+ export { InternalCallerOfferedError } from "./extensions/list-read-scope.js";
277
253
  // The stigmer-cloud#572 seam: the identity a schedule fire acts as
278
254
  // (drivers.scheduleFireCaller) — the composition mints it per fire; the
279
255
  // RunStarter propagates it through the R5 in-process header. A mint that
@@ -1,2 +0,0 @@
1
- export declare const agentDeclaration: import("./rewrite.js").KindDeclaration;
2
- //# sourceMappingURL=agent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/authorization/model/agent.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,gBAAgB,wCAuC3B,CAAC"}
@@ -1,43 +0,0 @@
1
- /**
2
- * Transcript of fga/model/agentic/agent.fga — a blueprint: owned by its
3
- * creator and by the organization's admins (`admin from organization`),
4
- * read by whoever the visibility axis lets in. The `organization#member`
5
- * and `organization#viewer` usersets on `viewer` are the org-visibility
6
- * tuple's two shapes (the cloud writes `#viewer` since cloud#257; `#member`
7
- * is the legacy shape it still honours), and `platform_viewer` is an
8
- * identity-provider userset no open-source tuple ever names. `team#member`
9
- * is the Enterprise team grant; open source serves no team, so no tuple
10
- * here ever names one.
11
- */
12
- import { AgentSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
13
- import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
14
- import { computed, declareKind, direct, from, objectOf, union, usersetOf, } from "./rewrite.js";
15
- export const agentDeclaration = declareKind({
16
- kind: ApiResourceKind.agent,
17
- schema: AgentSchema,
18
- source: "fga/model/agentic/agent.fga",
19
- relations: [
20
- ["organization", direct(objectOf("organization"))],
21
- [
22
- "owner",
23
- union(direct(objectOf("identity_account")), from("admin", "organization")),
24
- ],
25
- [
26
- "platform_viewer",
27
- direct(usersetOf("identity_provider", "platform_user")),
28
- ],
29
- [
30
- "viewer",
31
- union(direct(objectOf("identity_account"), usersetOf("organization", "member"), usersetOf("organization", "viewer"), usersetOf("team", "member")), computed("owner"), computed("platform_viewer")),
32
- ],
33
- ["can_view", computed("viewer")],
34
- ["can_edit", computed("owner")],
35
- ["can_delete", computed("owner")],
36
- ["can_execute", computed("viewer")],
37
- ["can_create_instance", computed("can_execute")],
38
- ["can_clone", computed("viewer")],
39
- ["can_grant_access", computed("owner")],
40
- ["can_view_access", computed("viewer")],
41
- ],
42
- });
43
- //# sourceMappingURL=agent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../src/authorization/model/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,oDAAoD,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAEtH,OAAO,EACL,QAAQ,EACR,WAAW,EACX,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,SAAS,GACV,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAC;IAC1C,IAAI,EAAE,eAAe,CAAC,KAAK;IAC3B,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,6BAA6B;IACrC,SAAS,EAAE;QACT,CAAC,cAAc,EAAE,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;QAClD;YACE,OAAO;YACP,KAAK,CACH,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,EACpC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAC9B;SACF;QACD;YACE,iBAAiB;YACjB,MAAM,CAAC,SAAS,CAAC,mBAAmB,EAAE,eAAe,CAAC,CAAC;SACxD;QACD;YACE,QAAQ;YACR,KAAK,CACH,MAAM,CACJ,QAAQ,CAAC,kBAAkB,CAAC,EAC5B,SAAS,CAAC,cAAc,EAAE,QAAQ,CAAC,EACnC,SAAS,CAAC,cAAc,EAAE,QAAQ,CAAC,EACnC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAC5B,EACD,QAAQ,CAAC,OAAO,CAAC,EACjB,QAAQ,CAAC,iBAAiB,CAAC,CAC5B;SACF;QACD,CAAC,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAChC,CAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC,YAAY,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC,aAAa,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACnC,CAAC,qBAAqB,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;QAChD,CAAC,WAAW,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC,kBAAkB,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC,iBAAiB,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;KACxC;CACF,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const agentChannelDeclaration: import("./rewrite.js").KindDeclaration;
2
- //# sourceMappingURL=agent_channel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent_channel.d.ts","sourceRoot":"","sources":["../../../src/authorization/model/agent_channel.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,uBAAuB,wCAkClC,CAAC"}
@@ -1,39 +0,0 @@
1
- /**
2
- * Transcript of fga/model/agentic/agent_channel.fga — a channel binding,
3
- * admin-owned like a blueprint, with `participant` as the one relation
4
- * between owner and viewer: the conversation-participation role
5
- * (reply and takeover without configuration authority), grantable as a
6
- * role on this kind alone. Every owner participates; every participant
7
- * views. Both grantable relations may name an Enterprise team
8
- * (`team#member`), which no open-source tuple ever does.
9
- */
10
- import { AgentChannelSchema } from "@stigmer/protos/ai/stigmer/agentic/agentchannel/v1/api_pb";
11
- import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
12
- import { computed, declareKind, direct, from, objectOf, union, usersetOf, } from "./rewrite.js";
13
- export const agentChannelDeclaration = declareKind({
14
- kind: ApiResourceKind.agent_channel,
15
- schema: AgentChannelSchema,
16
- source: "fga/model/agentic/agent_channel.fga",
17
- relations: [
18
- ["organization", direct(objectOf("organization"))],
19
- [
20
- "owner",
21
- union(direct(objectOf("identity_account")), from("admin", "organization")),
22
- ],
23
- [
24
- "participant",
25
- union(direct(objectOf("identity_account"), usersetOf("team", "member")), computed("owner")),
26
- ],
27
- [
28
- "viewer",
29
- union(direct(objectOf("identity_account"), usersetOf("team", "member")), computed("participant")),
30
- ],
31
- ["can_view", computed("viewer")],
32
- ["can_edit", computed("owner")],
33
- ["can_delete", computed("owner")],
34
- ["can_participate", computed("participant")],
35
- ["can_grant_access", computed("owner")],
36
- ["can_view_access", computed("viewer")],
37
- ],
38
- });
39
- //# sourceMappingURL=agent_channel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent_channel.js","sourceRoot":"","sources":["../../../src/authorization/model/agent_channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,2DAA2D,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAEtH,OAAO,EACL,QAAQ,EACR,WAAW,EACX,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,SAAS,GACV,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,uBAAuB,GAAG,WAAW,CAAC;IACjD,IAAI,EAAE,eAAe,CAAC,aAAa;IACnC,MAAM,EAAE,kBAAkB;IAC1B,MAAM,EAAE,qCAAqC;IAC7C,SAAS,EAAE;QACT,CAAC,cAAc,EAAE,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;QAClD;YACE,OAAO;YACP,KAAK,CACH,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,EACpC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAC9B;SACF;QACD;YACE,aAAa;YACb,KAAK,CACH,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,EACjE,QAAQ,CAAC,OAAO,CAAC,CAClB;SACF;QACD;YACE,QAAQ;YACR,KAAK,CACH,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,EACjE,QAAQ,CAAC,aAAa,CAAC,CACxB;SACF;QACD,CAAC,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAChC,CAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC,YAAY,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC,iBAAiB,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;QAC5C,CAAC,kBAAkB,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC,iBAAiB,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;KACxC;CACF,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const agentExecutionDeclaration: import("./rewrite.js").KindDeclaration;
2
- //# sourceMappingURL=agent_execution.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent_execution.d.ts","sourceRoot":"","sources":["../../../src/authorization/model/agent_execution.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,yBAAyB,wCAWpC,CAAC"}
@@ -1,25 +0,0 @@
1
- /**
2
- * Transcript of fga/model/agentic/agent_execution.fga — a run is its
3
- * session's: no owner tuple of its own (`kind_meta` attribution
4
- * INHERITED), every relation a hop through `session`, which the
5
- * derivation writes from `spec.session_id`. `can_view: viewer or
6
- * can_view from session` walks a parent PERMISSION whose own arms include
7
- * the session's channel and schedule hops; the evaluator resolves those
8
- * on the session's declaration, so this file needs no knowledge of them.
9
- */
10
- import { AgentExecutionSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
11
- import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
12
- import { computed, declareKind, direct, from, objectOf, union, } from "./rewrite.js";
13
- export const agentExecutionDeclaration = declareKind({
14
- kind: ApiResourceKind.agent_execution,
15
- schema: AgentExecutionSchema,
16
- source: "fga/model/agentic/agent_execution.fga",
17
- relations: [
18
- ["session", direct(objectOf("session"))],
19
- ["owner", from("owner", "session")],
20
- ["viewer", union(from("viewer", "session"), computed("owner"))],
21
- ["can_view", union(computed("viewer"), from("can_view", "session"))],
22
- ["can_edit", computed("owner")],
23
- ],
24
- });
25
- //# sourceMappingURL=agent_execution.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent_execution.js","sourceRoot":"","sources":["../../../src/authorization/model/agent_execution.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAEtH,OAAO,EACL,QAAQ,EACR,WAAW,EACX,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,KAAK,GACN,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,yBAAyB,GAAG,WAAW,CAAC;IACnD,IAAI,EAAE,eAAe,CAAC,eAAe;IACrC,MAAM,EAAE,oBAAoB;IAC5B,MAAM,EAAE,uCAAuC;IAC/C,SAAS,EAAE;QACT,CAAC,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;QACxC,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACnC,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QAC/D,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;QACpE,CAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;KAChC;CACF,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const agentInstanceDeclaration: import("./rewrite.js").KindDeclaration;
2
- //# sourceMappingURL=agent_instance.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent_instance.d.ts","sourceRoot":"","sources":["../../../src/authorization/model/agent_instance.ts"],"names":[],"mappings":"AA0BA,eAAO,MAAM,wBAAwB,wCAuCnC,CAAC"}
@@ -1,48 +0,0 @@
1
- /**
2
- * Transcript of fga/model/agentic/agent_instance.fga — a person's
3
- * configuration of an agent: owner-only in every write (no admin arm,
4
- * unlike the blueprint), readable through its own visibility axis or, for
5
- * the system-managed default instance, through the blueprint's whole
6
- * viewer set (`viewer from default_of`; default-of.ts). `agent` is the
7
- * parent link written on every instance for tracking and walked by
8
- * nothing; `default_of` is the derived link written on the default
9
- * instance alone. `team#member` on `viewer` is the Enterprise team grant,
10
- * which no open-source tuple ever names.
11
- */
12
- import { AgentSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
13
- import { AgentInstanceSchema } from "@stigmer/protos/ai/stigmer/agentic/agentinstance/v1/api_pb";
14
- import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
15
- import { defaultOfBlueprint } from "./default-of.js";
16
- import { computed, declareKind, direct, from, objectOf, union, usersetOf, } from "./rewrite.js";
17
- export const agentInstanceDeclaration = declareKind({
18
- kind: ApiResourceKind.agent_instance,
19
- schema: AgentInstanceSchema,
20
- source: "fga/model/agentic/agent_instance.fga",
21
- relations: [
22
- ["organization", direct(objectOf("organization"))],
23
- ["agent", direct(objectOf("agent"))],
24
- ["default_of", direct(objectOf("agent"))],
25
- ["owner", direct(objectOf("identity_account"))],
26
- [
27
- "viewer",
28
- union(direct(objectOf("identity_account"), usersetOf("organization", "member"), usersetOf("organization", "viewer"), usersetOf("team", "member")), computed("owner"), from("viewer", "default_of")),
29
- ],
30
- ["can_view", computed("viewer")],
31
- ["can_execute", computed("can_view")],
32
- ["can_edit", computed("owner")],
33
- ["can_delete", computed("owner")],
34
- ["can_grant_access", computed("owner")],
35
- ["can_view_access", computed("viewer")],
36
- ],
37
- derived: [
38
- [
39
- "default_of",
40
- defaultOfBlueprint({
41
- kind: ApiResourceKind.agent,
42
- schema: AgentSchema,
43
- defaultInstanceIdOf: (agent) => agent.status?.defaultInstanceId ?? "",
44
- }),
45
- ],
46
- ],
47
- });
48
- //# sourceMappingURL=agent_instance.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent_instance.js","sourceRoot":"","sources":["../../../src/authorization/model/agent_instance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,oDAAoD,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4DAA4D,CAAC;AACjG,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAEtH,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EACL,QAAQ,EACR,WAAW,EACX,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,SAAS,GACV,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAW,CAAC;IAClD,IAAI,EAAE,eAAe,CAAC,cAAc;IACpC,MAAM,EAAE,mBAAmB;IAC3B,MAAM,EAAE,sCAAsC;IAC9C,SAAS,EAAE;QACT,CAAC,cAAc,EAAE,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;QAClD,CAAC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QACpC,CAAC,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QACzC,CAAC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC;QAC/C;YACE,QAAQ;YACR,KAAK,CACH,MAAM,CACJ,QAAQ,CAAC,kBAAkB,CAAC,EAC5B,SAAS,CAAC,cAAc,EAAE,QAAQ,CAAC,EACnC,SAAS,CAAC,cAAc,EAAE,QAAQ,CAAC,EACnC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAC5B,EACD,QAAQ,CAAC,OAAO,CAAC,EACjB,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,CAC7B;SACF;QACD,CAAC,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAChC,CAAC,aAAa,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;QACrC,CAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC,YAAY,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC,kBAAkB,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC,iBAAiB,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;KACxC;IACD,OAAO,EAAE;QACP;YACE,YAAY;YACZ,kBAAkB,CAAC;gBACjB,IAAI,EAAE,eAAe,CAAC,KAAK;gBAC3B,MAAM,EAAE,WAAW;gBACnB,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,iBAAiB,IAAI,EAAE;aACtE,CAAC;SACH;KACF;CACF,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const agentShareDeclaration: import("./rewrite.js").KindDeclaration;
2
- //# sourceMappingURL=agent_share.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent_share.d.ts","sourceRoot":"","sources":["../../../src/authorization/model/agent_share.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,qBAAqB,wCAoBhC,CAAC"}
@@ -1,29 +0,0 @@
1
- /**
2
- * Transcript of fga/model/agentic/agent_share.fga — a share link's
3
- * configuration row, admin-owned; its anonymous visitors are the cloud's
4
- * `guest` credential on the organization, a class no open-source lane
5
- * mints, so on this edition a share is visible to its owners and explicit
6
- * grantees only.
7
- */
8
- import { AgentShareSchema } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/api_pb";
9
- import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
10
- import { computed, declareKind, direct, from, objectOf, union, } from "./rewrite.js";
11
- export const agentShareDeclaration = declareKind({
12
- kind: ApiResourceKind.agent_share,
13
- schema: AgentShareSchema,
14
- source: "fga/model/agentic/agent_share.fga",
15
- relations: [
16
- ["organization", direct(objectOf("organization"))],
17
- [
18
- "owner",
19
- union(direct(objectOf("identity_account")), from("admin", "organization")),
20
- ],
21
- ["viewer", union(direct(objectOf("identity_account")), computed("owner"))],
22
- ["can_view", computed("viewer")],
23
- ["can_edit", computed("owner")],
24
- ["can_delete", computed("owner")],
25
- ["can_grant_access", computed("owner")],
26
- ["can_view_access", computed("viewer")],
27
- ],
28
- });
29
- //# sourceMappingURL=agent_share.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent_share.js","sourceRoot":"","sources":["../../../src/authorization/model/agent_share.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yDAAyD,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAEtH,OAAO,EACL,QAAQ,EACR,WAAW,EACX,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,KAAK,GACN,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAAC;IAC/C,IAAI,EAAE,eAAe,CAAC,WAAW;IACjC,MAAM,EAAE,gBAAgB;IACxB,MAAM,EAAE,mCAAmC;IAC3C,SAAS,EAAE;QACT,CAAC,cAAc,EAAE,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;QAClD;YACE,OAAO;YACP,KAAK,CACH,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,EACpC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAC9B;SACF;QACD,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QAC1E,CAAC,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAChC,CAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC,YAAY,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC,kBAAkB,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC,iBAAiB,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;KACxC;CACF,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const apiKeyDeclaration: import("./rewrite.js").KindDeclaration;
2
- //# sourceMappingURL=api_key.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api_key.d.ts","sourceRoot":"","sources":["../../../src/authorization/model/api_key.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,iBAAiB,wCAe5B,CAAC"}
@@ -1,27 +0,0 @@
1
- /**
2
- * Transcript of fga/model/iam/api_key.fga — a credential, owner-only in
3
- * every verb: no organization link (`kind_meta` scope OWNER_ONLY) and no
4
- * admin arm, so the key a person minted is theirs to view, rotate, revoke
5
- * and use, and nobody else's. `can_rotate`, `can_revoke` and `can_use` are
6
- * the file's own verbs; the wire vocabulary names only the first three.
7
- */
8
- import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
9
- import { ApiKeySchema } from "@stigmer/protos/ai/stigmer/iam/apikey/v1/api_pb";
10
- import { computed, declareKind, direct, objectOf } from "./rewrite.js";
11
- export const apiKeyDeclaration = declareKind({
12
- kind: ApiResourceKind.api_key,
13
- schema: ApiKeySchema,
14
- source: "fga/model/iam/api_key.fga",
15
- relations: [
16
- ["owner", direct(objectOf("identity_account"))],
17
- ["can_view", computed("owner")],
18
- ["can_edit", computed("owner")],
19
- ["can_delete", computed("owner")],
20
- ["can_rotate", computed("owner")],
21
- ["can_revoke", computed("owner")],
22
- ["can_use", computed("owner")],
23
- ["can_grant_access", computed("owner")],
24
- ["can_view_access", computed("owner")],
25
- ],
26
- });
27
- //# sourceMappingURL=api_key.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api_key.js","sourceRoot":"","sources":["../../../src/authorization/model/api_key.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AACtH,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAE/E,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEvE,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC;IAC3C,IAAI,EAAE,eAAe,CAAC,OAAO;IAC7B,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,2BAA2B;IACnC,SAAS,EAAE;QACT,CAAC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC;QAC/C,CAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC,YAAY,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC,YAAY,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC,YAAY,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC9B,CAAC,kBAAkB,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC,iBAAiB,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;KACvC;CACF,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const artifactDeclaration: import("./rewrite.js").KindDeclaration;
2
- //# sourceMappingURL=artifact.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"artifact.d.ts","sourceRoot":"","sources":["../../../src/authorization/model/artifact.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,mBAAmB,wCAiB9B,CAAC"}
@@ -1,27 +0,0 @@
1
- /**
2
- * Transcript of fga/model/agentic/artifact.fga — an organization's shared
3
- * output: read by its creator and by every organization viewer (`viewer
4
- * from organization`, no visibility tuple involved — the kind has no
5
- * visibility axis), edited by the organization's admins alone (the
6
- * creator does NOT edit through `owner`), and with no `can_delete` line
7
- * at all. The wire annotates only `can_view` and `can_edit` on it.
8
- */
9
- import { ArtifactSchema } from "@stigmer/protos/ai/stigmer/agentic/artifact/v1/api_pb";
10
- import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
11
- import { computed, declareKind, direct, from, objectOf, union, } from "./rewrite.js";
12
- export const artifactDeclaration = declareKind({
13
- kind: ApiResourceKind.artifact,
14
- schema: ArtifactSchema,
15
- source: "fga/model/agentic/artifact.fga",
16
- relations: [
17
- ["organization", direct(objectOf("organization"))],
18
- ["owner", direct(objectOf("identity_account"))],
19
- [
20
- "viewer",
21
- union(direct(objectOf("identity_account")), from("viewer", "organization")),
22
- ],
23
- ["can_view", union(computed("owner"), computed("viewer"))],
24
- ["can_edit", from("admin", "organization")],
25
- ],
26
- });
27
- //# sourceMappingURL=artifact.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"artifact.js","sourceRoot":"","sources":["../../../src/authorization/model/artifact.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,uDAAuD,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAEtH,OAAO,EACL,QAAQ,EACR,WAAW,EACX,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,KAAK,GACN,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAAC;IAC7C,IAAI,EAAE,eAAe,CAAC,QAAQ;IAC9B,MAAM,EAAE,cAAc;IACtB,MAAM,EAAE,gCAAgC;IACxC,SAAS,EAAE;QACT,CAAC,cAAc,EAAE,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;QAClD,CAAC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC;QAC/C;YACE,QAAQ;YACR,KAAK,CACH,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,EACpC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAC/B;SACF;QACD,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC1D,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;KAC5C;CACF,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const channelAppDeclaration: import("./rewrite.js").KindDeclaration;
2
- //# sourceMappingURL=channel_app.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"channel_app.d.ts","sourceRoot":"","sources":["../../../src/authorization/model/channel_app.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,qBAAqB,wCAoBhC,CAAC"}
@@ -1,28 +0,0 @@
1
- /**
2
- * Transcript of fga/model/agentic/channel_app.fga — a messaging-platform
3
- * app registration, admin-owned, viewable by its owners and explicit
4
- * grantees: the same shape as agent_share, kept as its own file so the
5
- * drift compare reads this file's lines.
6
- */
7
- import { ChannelAppSchema } from "@stigmer/protos/ai/stigmer/agentic/channelapp/v1/api_pb";
8
- import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
9
- import { computed, declareKind, direct, from, objectOf, union, } from "./rewrite.js";
10
- export const channelAppDeclaration = declareKind({
11
- kind: ApiResourceKind.channel_app,
12
- schema: ChannelAppSchema,
13
- source: "fga/model/agentic/channel_app.fga",
14
- relations: [
15
- ["organization", direct(objectOf("organization"))],
16
- [
17
- "owner",
18
- union(direct(objectOf("identity_account")), from("admin", "organization")),
19
- ],
20
- ["viewer", union(direct(objectOf("identity_account")), computed("owner"))],
21
- ["can_view", computed("viewer")],
22
- ["can_edit", computed("owner")],
23
- ["can_delete", computed("owner")],
24
- ["can_grant_access", computed("owner")],
25
- ["can_view_access", computed("viewer")],
26
- ],
27
- });
28
- //# sourceMappingURL=channel_app.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"channel_app.js","sourceRoot":"","sources":["../../../src/authorization/model/channel_app.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yDAAyD,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAEtH,OAAO,EACL,QAAQ,EACR,WAAW,EACX,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,KAAK,GACN,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAAC;IAC/C,IAAI,EAAE,eAAe,CAAC,WAAW;IACjC,MAAM,EAAE,gBAAgB;IACxB,MAAM,EAAE,mCAAmC;IAC3C,SAAS,EAAE;QACT,CAAC,cAAc,EAAE,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;QAClD;YACE,OAAO;YACP,KAAK,CACH,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,EACpC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAC9B;SACF;QACD,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QAC1E,CAAC,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAChC,CAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC,YAAY,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC,kBAAkB,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC,iBAAiB,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;KACxC;CACF,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const environmentDeclaration: import("./rewrite.js").KindDeclaration;
2
- //# sourceMappingURL=environment.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../src/authorization/model/environment.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,sBAAsB,wCA0BjC,CAAC"}
@@ -1,33 +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
- import { computed, declareKind, direct, objectOf, union, usersetOf, } from "./rewrite.js";
13
- export const environmentDeclaration = declareKind({
14
- kind: ApiResourceKind.environment,
15
- schema: EnvironmentSchema,
16
- source: "fga/model/agentic/environment.fga",
17
- relations: [
18
- ["organization", direct(objectOf("organization"))],
19
- ["creator", direct(objectOf("identity_account"))],
20
- ["owner", direct(objectOf("identity_account"))],
21
- [
22
- "viewer",
23
- union(direct(objectOf("identity_account"), usersetOf("organization", "member"), usersetOf("organization", "viewer")), computed("owner")),
24
- ],
25
- ["can_view", computed("viewer")],
26
- ["can_edit", computed("owner")],
27
- ["can_delete", computed("owner")],
28
- ["can_read_secrets", computed("creator")],
29
- ["can_grant_access", computed("owner")],
30
- ["can_view_access", computed("viewer")],
31
- ],
32
- });
33
- //# sourceMappingURL=environment.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../src/authorization/model/environment.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0DAA0D,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAEtH,OAAO,EACL,QAAQ,EACR,WAAW,EACX,MAAM,EACN,QAAQ,EACR,KAAK,EACL,SAAS,GACV,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC;IAChD,IAAI,EAAE,eAAe,CAAC,WAAW;IACjC,MAAM,EAAE,iBAAiB;IACzB,MAAM,EAAE,mCAAmC;IAC3C,SAAS,EAAE;QACT,CAAC,cAAc,EAAE,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;QAClD,CAAC,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC;QACjD,CAAC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC;QAC/C;YACE,QAAQ;YACR,KAAK,CACH,MAAM,CACJ,QAAQ,CAAC,kBAAkB,CAAC,EAC5B,SAAS,CAAC,cAAc,EAAE,QAAQ,CAAC,EACnC,SAAS,CAAC,cAAc,EAAE,QAAQ,CAAC,CACpC,EACD,QAAQ,CAAC,OAAO,CAAC,CAClB;SACF;QACD,CAAC,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAChC,CAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC,YAAY,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC,kBAAkB,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;QACzC,CAAC,kBAAkB,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC,iBAAiB,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;KACxC;CACF,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const executionContextDeclaration: import("./rewrite.js").KindDeclaration;
2
- //# sourceMappingURL=execution_context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"execution_context.d.ts","sourceRoot":"","sources":["../../../src/authorization/model/execution_context.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,2BAA2B,wCAStC,CAAC"}
@@ -1,19 +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
- import { computed, declareKind, direct, objectOf } from "./rewrite.js";
9
- export const executionContextDeclaration = declareKind({
10
- kind: ApiResourceKind.execution_context,
11
- schema: ExecutionContextSchema,
12
- source: "fga/model/agentic/execution_context.fga",
13
- relations: [
14
- ["owner", direct(objectOf("identity_account"))],
15
- ["can_view", computed("owner")],
16
- ["can_edit", computed("owner")],
17
- ],
18
- });
19
- //# sourceMappingURL=execution_context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"execution_context.js","sourceRoot":"","sources":["../../../src/authorization/model/execution_context.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,+DAA+D,CAAC;AACvG,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAEtH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEvE,MAAM,CAAC,MAAM,2BAA2B,GAAG,WAAW,CAAC;IACrD,IAAI,EAAE,eAAe,CAAC,iBAAiB;IACvC,MAAM,EAAE,sBAAsB;IAC9B,MAAM,EAAE,yCAAyC;IACjD,SAAS,EAAE;QACT,CAAC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC;QAC/C,CAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;KAChC;CACF,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const iamPolicyDeclaration: import("./rewrite.js").KindDeclaration;
2
- //# sourceMappingURL=iam_policy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"iam_policy.d.ts","sourceRoot":"","sources":["../../../src/authorization/model/iam_policy.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,oBAAoB,wCAoB/B,CAAC"}