@xemahq/authorization-internal-api-client 0.4.20 → 0.4.27

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 (110) hide show
  1. package/dist/custom-fetch.js +56 -4
  2. package/dist/endpoints/agents/agents.d.ts +7 -1
  3. package/dist/endpoints/agents/agents.js +18 -1
  4. package/dist/endpoints/capability-authority-requests/capability-authority-requests.d.ts +24 -0
  5. package/dist/endpoints/capability-authority-requests/capability-authority-requests.js +89 -0
  6. package/dist/endpoints/roles/roles.d.ts +1 -6
  7. package/dist/endpoints/roles/roles.js +1 -17
  8. package/dist/index.d.ts +1 -0
  9. package/dist/index.js +1 -0
  10. package/dist/models/addRoleGrantDto.d.ts +8 -2
  11. package/dist/models/addTeamMemberDto.d.ts +1 -0
  12. package/dist/models/agentReachTier.d.ts +1 -1
  13. package/dist/models/assignRoleDto.d.ts +9 -2
  14. package/dist/models/authorizationCheckRequestDto.d.ts +24 -6
  15. package/dist/models/authorizationReasonDto.d.ts +1 -0
  16. package/dist/models/authorizationSuggestionDto.d.ts +11 -2
  17. package/dist/models/capabilityAuthorityRequestDto.d.ts +29 -0
  18. package/dist/models/capabilityAuthorityRequestDtoDataArrayEnvelope.d.ts +9 -0
  19. package/dist/models/capabilityAuthorityRequestDtoDataEnvelope.d.ts +9 -0
  20. package/dist/models/capabilityAuthorityRequestDtoDisposition.d.ts +14 -0
  21. package/dist/models/capabilityAuthorityRequestDtoDisposition.js +13 -0
  22. package/dist/models/capabilityAuthorityRequestDtoOutcome.d.ts +16 -0
  23. package/dist/models/capabilityAuthorityRequestDtoOutcome.js +15 -0
  24. package/dist/models/capabilityAuthorityRequestDtoRefusal.d.ts +14 -0
  25. package/dist/models/capabilityAuthorityRequestDtoRefusal.js +13 -0
  26. package/dist/models/{errorDetailsDtoDetails.d.ts → capabilityAuthorityRequestsControllerGetByIdParams.d.ts} +3 -6
  27. package/dist/models/capabilityAuthorityRequestsControllerListForSubjectParams.d.ts +10 -0
  28. package/dist/models/createExecutionEnvironmentDto.d.ts +9 -2
  29. package/dist/models/createGrantDto.d.ts +17 -4
  30. package/dist/models/createRoleDto.d.ts +3 -0
  31. package/dist/models/createTeamDto.d.ts +10 -2
  32. package/dist/models/environmentCeilingSource.d.ts +1 -1
  33. package/dist/models/environmentsControllerFindBySlugParams.d.ts +1 -0
  34. package/dist/models/environmentsControllerListParams.d.ts +1 -0
  35. package/dist/models/environmentsControllerRemoveParams.d.ts +1 -0
  36. package/dist/models/environmentsControllerUpdateParams.d.ts +1 -0
  37. package/dist/models/exactResourceAuthorityDto.d.ts +8 -2
  38. package/dist/models/exactResourceBindingDto.d.ts +8 -2
  39. package/dist/models/executionEnvironmentResponseDto.d.ts +1 -1
  40. package/dist/models/grantConstraintsDto.d.ts +6 -1
  41. package/dist/models/grantsControllerListParams.d.ts +10 -0
  42. package/dist/models/index.d.ts +15 -8
  43. package/dist/models/index.js +15 -8
  44. package/dist/models/listRegisteredResourcesDto.d.ts +4 -1
  45. package/dist/models/listVisibleResourcesDto.d.ts +8 -2
  46. package/dist/models/openCapabilityAuthorityRequestDto.d.ts +35 -0
  47. package/dist/models/openCapabilityAuthorityRequestDtoSubjectKind.d.ts +21 -0
  48. package/dist/models/openCapabilityAuthorityRequestDtoSubjectKind.js +20 -0
  49. package/dist/models/outputRouteAuthorityDto.d.ts +10 -2
  50. package/dist/models/outputRouteRevisionDto.d.ts +10 -2
  51. package/dist/models/policyActingAgentDto.d.ts +14 -0
  52. package/dist/models/policyActingAgentDtoKind.d.ts +9 -0
  53. package/dist/models/{orgRole.js → policyActingAgentDtoKind.js} +3 -5
  54. package/dist/models/policyActingForDto.d.ts +8 -0
  55. package/dist/models/policyBiomeDto.d.ts +2 -0
  56. package/dist/models/policyCallerDto.d.ts +4 -0
  57. package/dist/models/policyCapabilityDto.d.ts +5 -1
  58. package/dist/models/policyCheckRequestDto.d.ts +53 -3
  59. package/dist/models/policyDecisionDto.d.ts +8 -2
  60. package/dist/models/policyEnvironmentDto.d.ts +4 -1
  61. package/dist/models/policyObligationDto.d.ts +9 -2
  62. package/dist/models/policyResourceDto.d.ts +4 -1
  63. package/dist/models/policyRouteHintDto.d.ts +1 -0
  64. package/dist/models/policySpaceRefDto.d.ts +7 -0
  65. package/dist/models/policySubjectRefDto.d.ts +1 -0
  66. package/dist/models/previewOutputRouteImpactDto.d.ts +1 -0
  67. package/dist/models/problemDetailsDto.d.ts +28 -0
  68. package/dist/models/problemDetailsDto.js +2 -0
  69. package/dist/models/problemFieldIssueDto.d.ts +10 -0
  70. package/dist/models/problemFieldIssueDto.js +7 -0
  71. package/dist/models/provisionAgentRequestDto.d.ts +12 -3
  72. package/dist/models/provisionedCapabilityDto.d.ts +4 -1
  73. package/dist/models/recordAgentReachTierRequestDto.d.ts +21 -0
  74. package/dist/models/recordAgentReachTierRequestDto.js +2 -0
  75. package/dist/models/registerResourceOwnershipDto.d.ts +16 -4
  76. package/dist/models/registerResourceRevisionDto.d.ts +16 -4
  77. package/dist/models/registeredResourceRevisionDto.d.ts +8 -2
  78. package/dist/models/relationshipsControllerListParams.d.ts +4 -0
  79. package/dist/models/replaceResourceOwnershipDto.d.ts +8 -2
  80. package/dist/models/requestOutputRouteRetirementDto.d.ts +4 -1
  81. package/dist/models/requestOutputRouteRevisionReleaseDto.d.ts +14 -3
  82. package/dist/models/requestOutputRouteRollbackDto.d.ts +5 -1
  83. package/dist/models/resolveExactOutputRouteDto.d.ts +1 -0
  84. package/dist/models/resolveOutputRouteChannelDto.d.ts +1 -0
  85. package/dist/models/resourceShareRefDto.d.ts +8 -2
  86. package/dist/models/resourceSubjectRefDto.d.ts +4 -1
  87. package/dist/models/rolesControllerListParams.d.ts +3 -0
  88. package/dist/models/rollbackExecutionEnvironmentDto.d.ts +5 -2
  89. package/dist/models/subjectRefDto.d.ts +4 -1
  90. package/dist/models/teamsControllerListParams.d.ts +2 -0
  91. package/dist/models/updateExecutionEnvironmentDto.d.ts +1 -0
  92. package/dist/models/updateGrantDto.d.ts +5 -1
  93. package/dist/models/updateRoleDto.d.ts +1 -0
  94. package/dist/models/updateTeamDto.d.ts +1 -0
  95. package/dist/models/upsertCredentialDefaultDto.d.ts +16 -4
  96. package/package.json +26 -2
  97. package/dist/models/errorDetailsDto.d.ts +0 -10
  98. package/dist/models/errorPayloadDto.d.ts +0 -11
  99. package/dist/models/errorResponseDto.d.ts +0 -9
  100. package/dist/models/orgRole.d.ts +0 -14
  101. package/dist/models/orgRoleSyncDto.d.ts +0 -16
  102. package/dist/models/orgRoleSyncResultDto.d.ts +0 -9
  103. package/dist/models/orgRoleSyncResultDtoDataEnvelope.d.ts +0 -9
  104. /package/dist/models/{errorDetailsDto.js → capabilityAuthorityRequestDto.js} +0 -0
  105. /package/dist/models/{errorPayloadDto.js → capabilityAuthorityRequestDtoDataArrayEnvelope.js} +0 -0
  106. /package/dist/models/{errorResponseDto.js → capabilityAuthorityRequestDtoDataEnvelope.js} +0 -0
  107. /package/dist/models/{errorDetailsDtoDetails.js → capabilityAuthorityRequestsControllerGetByIdParams.js} +0 -0
  108. /package/dist/models/{orgRoleSyncResultDto.js → capabilityAuthorityRequestsControllerListForSubjectParams.js} +0 -0
  109. /package/dist/models/{orgRoleSyncDto.js → openCapabilityAuthorityRequestDto.js} +0 -0
  110. /package/dist/models/{orgRoleSyncResultDtoDataEnvelope.js → policyActingAgentDto.js} +0 -0
@@ -3,7 +3,7 @@
3
3
  * Authorization API
4
4
  * OpenAPI spec version: 0.1.1
5
5
  */
6
- import type { AgentReachTier } from './agentReachTier.js';
6
+ import type { PolicyActingAgentDto } from './policyActingAgentDto.js';
7
7
  import type { PolicyActingForDto } from './policyActingForDto.js';
8
8
  import type { PolicyBiomeDto } from './policyBiomeDto.js';
9
9
  import type { PolicyCallerDto } from './policyCallerDto.js';
@@ -16,8 +16,11 @@ import type { PolicySpaceRefDto } from './policySpaceRefDto.js';
16
16
  import type { PolicySubjectRefDto } from './policySubjectRefDto.js';
17
17
  import type { SessionParticipantRole } from './sessionParticipantRole.js';
18
18
  export interface PolicyCheckRequestDto {
19
+ /** @minLength 1 */
19
20
  id: string;
21
+ /** @minLength 1 */
20
22
  requestId: string;
23
+ /** @minLength 1 */
21
24
  traceId: string;
22
25
  subject: PolicySubjectRefDto;
23
26
  caller: PolicyCallerDto;
@@ -28,9 +31,56 @@ export interface PolicyCheckRequestDto {
28
31
  resource?: PolicyResourceDto;
29
32
  constraints?: PolicyConstraintsDto;
30
33
  actorChain?: PolicyActingForDto[];
34
+ /**
35
+ * Opaque credential-binding id already selected for this invocation. Carried
36
+ * on the kernel envelope (a re-checked / replayed context round-trips it), so
37
+ * the wire must accept it. NEVER a secret. The PDP re-resolves the binding
38
+ * itself via the precedence ladder and returns it on `PolicyDecision` — it
39
+ * does not trust an inbound value.
40
+ * @minLength 1
41
+ */
31
42
  credentialBindingId?: string;
32
- /** The agent's permission CEILING — ordered supersets `sandbox ⊂ as-owner ⊂ connected ⊂ full`. Intersected with the agent's armed tools and its owner's authority at resolution, so it can only RESTRICT, never amplify. Absent ⇒ `as-owner`. */
33
- reachTier?: AgentReachTier;
43
+ /**
44
+ * WHICH AGENT is acting — an IDENTITY, never an authority value.
45
+ *
46
+ * ── WHAT IT REPLACED, AND WHY THAT FIELD IS GONE (04-critical-defects B5) ──
47
+ *
48
+ * `reachTier` used to be declared here: the acting agent's permission
49
+ * CEILING, taken off the request body. This endpoint is fenced by
50
+ * `ServiceActorGuard`, so any platform service token could name one — and the
51
+ * tier is not narrowing-only. `connected` turns a DENY into an ALLOW for
52
+ * integration-reach capabilities and `full` LIFTS the delegation clamp, so a
53
+ * caller could ask this service to stop attenuating an agent to its
54
+ * delegators. That is the caller-supplied security input
55
+ * `.claude/rules/public-and-internal-route-guarding.md` forbids outright.
56
+ *
57
+ * The property is DELETED rather than ignored, and the deletion is the
58
+ * enforcement: the canonical pipe runs `forbidNonWhitelisted: true`, so a
59
+ * body still carrying `reachTier` is a `400 property reachTier should not
60
+ * exist`. There is no path that accepts it and drops it quietly.
61
+ *
62
+ * ── THE ANSWER IS RESOLVED HERE, FROM THIS SERVICE'S OWN RECORDS ──────────
63
+ *
64
+ * `AuthorizationService.resolveEffectiveReachTier` reads the ceiling from
65
+ * `agent_reach_tier_projection` — LOCAL rows keyed by the agent slug this
66
+ * field carries. A caller naming another agent therefore gets THAT agent's
67
+ * declaration, never one it invented, and a caller naming no agent gets the
68
+ * platform default.
69
+ *
70
+ * ── WHY THE AGENT NEEDS ITS OWN FIELD AND `subject` WILL NOT DO ───────────
71
+ *
72
+ * `subject` names the agent only on an AUTONOMOUS invocation. A DELEGATED one
73
+ * arrives as `subject = { kind: user, id: <owner> }` — the agent acts as its
74
+ * owner — so the acting agent is not on the envelope at all, and a ceiling
75
+ * keyed on `subject.id` silently stops applying the moment a human is in the
76
+ * session. That is precisely the path where a `sandbox` agent must stay
77
+ * sandboxed.
78
+ *
79
+ * Stamped by the surface that owns the agent's identity from its own verified
80
+ * credential (the MCP bridge-token claims), forwarded in-process by
81
+ * `xema-capability-router`, and never supplied by an agent.
82
+ */
83
+ actingAgent?: PolicyActingAgentDto;
34
84
  /** Role the acting subject holds in the originating agent session. Precedence `owner > editor > viewer`. Absent for non-session invocations (workflow steps, service calls). */
35
85
  participantRole?: SessionParticipantRole;
36
86
  /** The acting agent's capability aperture (kernel `CapabilityAperture`): `{ kind: "unrestricted" }` or `{ kind: "armed", refs: string[] }`. Enforced at the capability-router funnel, carried here for the audit trail. */
@@ -9,11 +9,17 @@ import type { PolicyObligationDto } from './policyObligationDto.js';
9
9
  import type { PolicyRouteHintDto } from './policyRouteHintDto.js';
10
10
  export interface PolicyDecisionDto {
11
11
  kind: PolicyDecisionKind;
12
- /** Stable wire-code denial reason from the OPA bundle / authorization-api decision matrix. Free-form here; closed by the bundle. Surfaced verbatim in audit + capability-router error envelopes. */
12
+ /**
13
+ * Stable wire-code denial reason from the OPA bundle / authorization-api decision matrix. Free-form here; closed by the bundle. Surfaced verbatim in audit + capability-router error envelopes.
14
+ * @minLength 1
15
+ */
13
16
  reason?: string;
14
17
  obligations?: PolicyObligationDto[];
15
18
  routeHints?: PolicyRouteHintDto;
16
- /** Credential binding the executing gateway MUST use to resolve the external credential for this invocation. Present ONLY on an `allow` for a capability that declares an `externalServiceRef`. Opaque id — never a secret; the broker re-validates it before reading custody. */
19
+ /**
20
+ * Credential binding the executing gateway MUST use to resolve the external credential for this invocation. Present ONLY on an `allow` for a capability that declares an `externalServiceRef`. Opaque id — never a secret; the broker re-validates it before reading custody.
21
+ * @minLength 1
22
+ */
17
23
  credentialBindingId?: string;
18
24
  /** Which precedence tier supplied `credentialBindingId` (explicit grant > capability default > project default > org default). Populated iff `credentialBindingId` is present. */
19
25
  credentialPrecedenceApplied?: CredentialPrecedenceSource;
@@ -5,7 +5,10 @@
5
5
  */
6
6
  import type { ExecutionEnvironmentKind } from './executionEnvironmentKind.js';
7
7
  export interface PolicyEnvironmentDto {
8
- /** environment:<slug> ref string. */
8
+ /**
9
+ * environment:<slug> ref string.
10
+ * @minLength 1
11
+ */
9
12
  id: string;
10
13
  /** Closed set of built-in execution-environment classifications. Environment IDENTITY is a separate `environment:<slug>` ref — an org-custom environment carries its own slug there, and is still classified by one of these kinds. */
11
14
  kind: ExecutionEnvironmentKind;
@@ -10,13 +10,20 @@ import type { RunnerKind } from './runnerKind.js';
10
10
  export interface PolicyObligationDto {
11
11
  kind: PolicyObligationKind;
12
12
  runnerKind?: RunnerKind;
13
+ /** @minLength 1 */
13
14
  approverRole?: string;
14
15
  maxDurationSeconds?: number;
15
16
  maxCostUsd?: number;
16
17
  maxClassification?: DataClassification;
17
18
  residency?: DataResidency;
18
- /** Egress allowlist patterns (wildcard host or https:// URL-prefix). Present only when kind=egress-allowlist. */
19
+ /**
20
+ * Egress allowlist patterns (wildcard host or https:// URL-prefix). Present only when kind=egress-allowlist.
21
+ * @items.minLength 1
22
+ */
19
23
  allow?: string[];
20
- /** Egress blocklist patterns; a match denies even if `allow` matched. Present only when kind=egress-allowlist. */
24
+ /**
25
+ * Egress blocklist patterns; a match denies even if `allow` matched. Present only when kind=egress-allowlist.
26
+ * @items.minLength 1
27
+ */
21
28
  deny?: string[];
22
29
  }
@@ -5,7 +5,10 @@
5
5
  */
6
6
  import type { DataClassification } from './dataClassification.js';
7
7
  export interface PolicyResourceDto {
8
- /** Canonical `xema://<Space>/resource/<type>/<id>[@version]` address naming the instance this invocation targets. Exact Agent bindings always carry the version. The server answers `400 RESOURCE_REF_MALFORMED` for any other shape. Omit the whole `resource` block for a verb-only check; do not send a placeholder. */
8
+ /**
9
+ * Canonical `xema://<Space>/resource/<type>/<id>[@version]` address naming the instance this invocation targets. Exact Agent bindings always carry the version. The server answers `400 RESOURCE_REF_MALFORMED` for any other shape. Omit the whole `resource` block for a verb-only check; do not send a placeholder.
10
+ * @minLength 1
11
+ */
9
12
  ref: string;
10
13
  /** The classification the target resource carries. OMIT IT when the producer has none to declare — the effective classification is then the Space floor alone, and the request still gets the resource-ownership clamp. Omitting the whole `resource` block is NOT the same thing: that downgrades the call to a verb-only check and discards the ownership clamp. Never send a placeholder value. */
11
14
  classification?: DataClassification;
@@ -8,6 +8,7 @@ import type { RunnerKind } from './runnerKind.js';
8
8
  export interface PolicyRouteHintDto {
9
9
  requiredRunnerLabels?: PolicyRouteHintDtoRequiredRunnerLabels;
10
10
  preferredRunnerKind?: RunnerKind;
11
+ /** @minLength 1 */
11
12
  requiredRegion?: string;
12
13
  requireCustomerEdge?: boolean;
13
14
  }
@@ -6,11 +6,18 @@
6
6
  import type { SpaceKind } from './spaceKind.js';
7
7
  export interface PolicySpaceRefDto {
8
8
  tier: SpaceKind;
9
+ /** @minLength 1 */
9
10
  orgId?: string;
11
+ /** @minLength 1 */
10
12
  projectId?: string;
13
+ /** @minLength 1 */
11
14
  appId?: string;
15
+ /** @minLength 1 */
12
16
  sessionId?: string;
17
+ /** @minLength 1 */
13
18
  biomeId?: string;
19
+ /** @minLength 1 */
14
20
  userId?: string;
21
+ /** @minLength 1 */
15
22
  path?: string;
16
23
  }
@@ -7,6 +7,7 @@ import type { PolicyActingForDto } from './policyActingForDto.js';
7
7
  import type { SubjectKind } from './subjectKind.js';
8
8
  export interface PolicySubjectRefDto {
9
9
  kind: SubjectKind;
10
+ /** @minLength 1 */
10
11
  id: string;
11
12
  roles?: string[];
12
13
  actingFor?: PolicyActingForDto;
@@ -4,6 +4,7 @@
4
4
  * OpenAPI spec version: 0.1.1
5
5
  */
6
6
  export interface PreviewOutputRouteImpactDto {
7
+ /** @minLength 1 */
7
8
  ref: string;
8
9
  /** @pattern ^[a-z][a-z0-9-]{0,62}$ */
9
10
  channel: string;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Generated by @xemahq/api-client-generator — do not edit manually.
3
+ * Authorization API
4
+ * OpenAPI spec version: 0.1.1
5
+ */
6
+ import type { ProblemFieldIssueDto } from './problemFieldIssueDto.js';
7
+ /**
8
+ * RFC 9457 problem document. The declared members are the reserved core; extension members are TOP-LEVEL and OPEN, owned by the refusing plane.
9
+ */
10
+ export interface ProblemDetailsDto {
11
+ /** Absolute URI identifying the refusal TYPE. Derived one-to-one from `code`, so a caller may branch on either and can never be told two different things. Never `about:blank`. */
12
+ type: string;
13
+ /** Short, human-readable, and STABLE for a given `type`. Never per-occurrence — that is `detail`. */
14
+ title: string;
15
+ /** The HTTP status code, repeated in the body so a logged document is self-contained. */
16
+ status: number;
17
+ /** SCREAMING_SNAKE_CASE. The machine-branchable refusal, and the value a policy rule, a retry predicate and a UI branch all name. */
18
+ code: string;
19
+ /** Human-readable and specific to THIS occurrence. */
20
+ detail?: string;
21
+ /** URI reference identifying the occurrence — a request path, a run, a row. */
22
+ instance?: string;
23
+ /** W3C trace-context trace-id, present when the caller sent a `traceparent`. Omitted rather than invented when it did not. */
24
+ traceId?: string;
25
+ /** Field-level issues, when the refusal is about the request body. */
26
+ errors?: ProblemFieldIssueDto[];
27
+ [key: string]: unknown;
28
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Generated by @xemahq/api-client-generator — do not edit manually.
3
+ * Authorization API
4
+ * OpenAPI spec version: 0.1.1
5
+ */
6
+ export interface ProblemFieldIssueDto {
7
+ /** RFC 6901 JSON Pointer into the request body. Root is "/". */
8
+ pointer: string;
9
+ detail: string;
10
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by @xemahq/api-client-generator — do not edit manually.
4
+ * Authorization API
5
+ * OpenAPI spec version: 0.1.1
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,11 +5,20 @@
5
5
  */
6
6
  import type { AgentReachTier } from './agentReachTier.js';
7
7
  export interface ProvisionAgentRequestDto {
8
- /** Organization the agent + its capability grants are scoped to. */
8
+ /**
9
+ * Organization the agent + its capability grants are scoped to.
10
+ * @minLength 1
11
+ */
9
12
  orgId: string;
10
- /** The agent subject ref the grants are written for (subjectKind=agent). */
13
+ /**
14
+ * The agent subject ref the grants are written for (subjectKind=agent).
15
+ * @minLength 1
16
+ */
11
17
  agentSubjectRef: string;
12
- /** The owning user subject ref. Auto-grant requires the OWNER to currently hold the capability (a full, non-pending grant in the agent's environment). */
18
+ /**
19
+ * The owning user subject ref. Auto-grant requires the OWNER to currently hold the capability (a full, non-pending grant in the agent's environment).
20
+ * @minLength 1
21
+ */
13
22
  ownerSubjectRef: string;
14
23
  /** The agent reach-tier ceiling. Selects the execution environment the owner-held check + grants resolve under. */
15
24
  reachTier: AgentReachTier;
@@ -8,7 +8,10 @@ import type { AgentProvisionReason } from './agentProvisionReason.js';
8
8
  import type { CapabilityRiskTier } from './capabilityRiskTier.js';
9
9
  import type { ExecutionEnvironmentKind } from './executionEnvironmentKind.js';
10
10
  export interface ProvisionedCapabilityDto {
11
- /** The canonical CapabilityRef this entry describes. */
11
+ /**
12
+ * The canonical CapabilityRef this entry describes.
13
+ * @minLength 1
14
+ */
12
15
  capability: string;
13
16
  decision: AgentProvisionDecision;
14
17
  reason: AgentProvisionReason;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Generated by @xemahq/api-client-generator — do not edit manually.
3
+ * Authorization API
4
+ * OpenAPI spec version: 0.1.1
5
+ */
6
+ import type { AgentReachTier } from './agentReachTier.js';
7
+ export interface RecordAgentReachTierRequestDto {
8
+ /**
9
+ * Organization that OWNS the agent, or `null` when the agent is GLOBALLY owned (system-seeded or biome-contributed) and its ceiling applies in every org. The field must be PRESENT either way — an omitted `orgId` is refused rather than read as global, because global is the wider scope.
10
+ * @minLength 1
11
+ * @nullable
12
+ */
13
+ orgId: string | null;
14
+ /**
15
+ * The agent's stable composition SLUG — the same identity its capability grants are written under, and the same identity a policy-check envelope carries on `actingAgent`.
16
+ * @minLength 1
17
+ */
18
+ agentSlug: string;
19
+ /** The agent's permission CEILING — ordered supersets `sandbox ⊂ as-owner ⊂ connected ⊂ full`. Intersected with the agent's armed tools and its owner's authority at resolution, so it can only RESTRICT, never amplify. */
20
+ reachTier: AgentReachTier;
21
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -7,15 +7,27 @@ import type { ResourceShareRefDto } from './resourceShareRefDto.js';
7
7
  import type { ResourceSubjectRefDto } from './resourceSubjectRefDto.js';
8
8
  import type { ResourceVisibilityPattern } from './resourceVisibilityPattern.js';
9
9
  export interface RegisterResourceOwnershipDto {
10
- /** Resource kind/type slug. */
10
+ /**
11
+ * Resource kind/type slug.
12
+ * @minLength 1
13
+ */
11
14
  resourceType: string;
12
- /** Resource instance id. */
15
+ /**
16
+ * Resource instance id.
17
+ * @minLength 1
18
+ */
13
19
  resourceId: string;
14
20
  /** Instance visibility pattern. The PDP ANDs the verb verdict with the ownership check resolved per this pattern. */
15
21
  visibility: ResourceVisibilityPattern;
16
- /** The `xema://` SPACE that owns the instance — an ADDRESS, which this service expands into the owner SUBJECTS its own vocabulary resolves it to (`xema://orgs/<id>` → the org-owner and org-admin role usersets; `xema://users/<id>` → that user). A producer knows the owning Space (`App.ownerSpaceUri`, `Skill.ownerSpaceUri`) and CANNOT know which subjects it resolves to, because those role instances are this service's own rows. Refused (400 `RESOURCE_OWNER_SPACE_NOT_ADMISSIBLE`) when the address is unparseable, names a tier the resource kind does not admit, names another organisation, or names a tier with no owner-subject expansion. May be combined with `owners`; the effective owner set is the UNION, de-duplicated. At least one of the two must yield an owner. */
22
+ /**
23
+ * The `xema://` SPACE that owns the instance — an ADDRESS, which this service expands into the owner SUBJECTS its own vocabulary resolves it to (`xema://orgs/<id>` → the org-owner and org-admin role usersets; `xema://users/<id>` → that user). A producer knows the owning Space (`App.ownerSpaceUri`, `Skill.ownerSpaceUri`) and CANNOT know which subjects it resolves to, because those role instances are this service's own rows. Refused (400 `RESOURCE_OWNER_SPACE_NOT_ADMISSIBLE`) when the address is unparseable, names a tier the resource kind does not admit, names another organisation, or names a tier with no owner-subject expansion. May be combined with `owners`; the effective owner set is the UNION, de-duplicated. At least one of the two must yield an owner.
24
+ * @minLength 1
25
+ */
17
26
  ownerSpaceUri?: string;
18
- /** Subjects that OWN the instance (full visibility), named explicitly. OPTIONAL only because `ownerSpaceUri` is the other way to say it — the service still refuses a request that yields no owner at all, so the ≥ 1-owner rule is unchanged. It moved from the DTO to the service because validation runs BEFORE the expansion and therefore cannot see the owners the address produces. */
27
+ /**
28
+ * Subjects that OWN the instance (full visibility), named explicitly. OPTIONAL only because `ownerSpaceUri` is the other way to say it — the service still refuses a request that yields no owner at all, so the ≥ 1-owner rule is unchanged. It moved from the DTO to the service because validation runs BEFORE the expansion and therefore cannot see the owners the address produces.
29
+ * @minItems 1
30
+ */
19
31
  owners?: ResourceSubjectRefDto[];
20
32
  /** Subjects explicitly granted visibility, each at a LEVEL and with an optional expiry. */
21
33
  explicitShares?: ResourceShareRefDto[];
@@ -5,13 +5,25 @@
5
5
  */
6
6
  import type { DataClassification } from './dataClassification.js';
7
7
  export interface RegisterResourceRevisionDto {
8
- /** Canonical version-pinned Xema Resource ref. The first slug segment is the registered resource kind. */
8
+ /**
9
+ * Canonical version-pinned Xema Resource ref. The first slug segment is the registered resource kind.
10
+ * @minLength 1
11
+ */
9
12
  ref: string;
10
- /** Lowercase SHA-256 of the immutable revision metadata. */
13
+ /**
14
+ * Lowercase SHA-256 of the immutable revision metadata.
15
+ * @pattern SHA256_HEX
16
+ */
11
17
  contentHash: string;
12
- /** Canonical OwnerSpace key produced by formatOwnerSpaceKey. It must carry the caller tenant fence. */
18
+ /**
19
+ * Canonical OwnerSpace key produced by formatOwnerSpaceKey. It must carry the caller tenant fence.
20
+ * @minLength 1
21
+ */
13
22
  ownerSpaceKey: string;
14
23
  classification: DataClassification;
15
- /** Canonical capability ref the unified Decision must evaluate. */
24
+ /**
25
+ * Canonical capability ref the unified Decision must evaluate.
26
+ * @minLength 1
27
+ */
16
28
  decisionCapabilityRef: string;
17
29
  }
@@ -5,9 +5,15 @@
5
5
  */
6
6
  import type { DataClassification } from './dataClassification.js';
7
7
  export interface RegisteredResourceRevisionDto {
8
- /** Canonical version-pinned Xema Resource ref. The first slug segment is the registered resource kind. */
8
+ /**
9
+ * Canonical version-pinned Xema Resource ref. The first slug segment is the registered resource kind.
10
+ * @minLength 1
11
+ */
9
12
  ref: string;
10
- /** Lowercase SHA-256 of the immutable revision metadata. */
13
+ /**
14
+ * Lowercase SHA-256 of the immutable revision metadata.
15
+ * @pattern SHA256_HEX
16
+ */
11
17
  contentHash: string;
12
18
  orgId: string;
13
19
  resourceType: string;
@@ -8,6 +8,7 @@ import type { SubjectKind } from './subjectKind.js';
8
8
  export type RelationshipsControllerListParams = {
9
9
  /**
10
10
  * Filter to relationships within a single organization.
11
+ * @minLength 1
11
12
  */
12
13
  orgId?: string;
13
14
  /**
@@ -16,14 +17,17 @@ export type RelationshipsControllerListParams = {
16
17
  subjectKind?: SubjectKind;
17
18
  /**
18
19
  * Filter by subject ref (the user-id half of the tuple).
20
+ * @minLength 1
19
21
  */
20
22
  subjectRef?: string;
21
23
  /**
22
24
  * Filter by the canonical CapabilityRef the object encodes.
25
+ * @minLength 1
23
26
  */
24
27
  capability?: string;
25
28
  /**
26
29
  * Filter by the environment slug the capability object is scoped to.
30
+ * @minLength 1
27
31
  */
28
32
  environment?: string;
29
33
  /**
@@ -9,9 +9,15 @@ import type { ResourceVisibilityPattern } from './resourceVisibilityPattern.js';
9
9
  export interface ReplaceResourceOwnershipDto {
10
10
  /** Instance visibility pattern. The PDP ANDs the verb verdict with the ownership check resolved per this pattern. */
11
11
  visibility: ResourceVisibilityPattern;
12
- /** The `xema://` SPACE that owns the instance — an ADDRESS, which this service expands into the owner SUBJECTS its own vocabulary resolves it to (`xema://orgs/<id>` → the org-owner and org-admin role usersets; `xema://users/<id>` → that user). A producer knows the owning Space (`App.ownerSpaceUri`, `Skill.ownerSpaceUri`) and CANNOT know which subjects it resolves to, because those role instances are this service's own rows. Refused (400 `RESOURCE_OWNER_SPACE_NOT_ADMISSIBLE`) when the address is unparseable, names a tier the resource kind does not admit, names another organisation, or names a tier with no owner-subject expansion. May be combined with `owners`; the effective owner set is the UNION, de-duplicated. At least one of the two must yield an owner. */
12
+ /**
13
+ * The `xema://` SPACE that owns the instance — an ADDRESS, which this service expands into the owner SUBJECTS its own vocabulary resolves it to (`xema://orgs/<id>` → the org-owner and org-admin role usersets; `xema://users/<id>` → that user). A producer knows the owning Space (`App.ownerSpaceUri`, `Skill.ownerSpaceUri`) and CANNOT know which subjects it resolves to, because those role instances are this service's own rows. Refused (400 `RESOURCE_OWNER_SPACE_NOT_ADMISSIBLE`) when the address is unparseable, names a tier the resource kind does not admit, names another organisation, or names a tier with no owner-subject expansion. May be combined with `owners`; the effective owner set is the UNION, de-duplicated. At least one of the two must yield an owner.
14
+ * @minLength 1
15
+ */
13
16
  ownerSpaceUri?: string;
14
- /** Subjects that OWN the instance (full visibility), named explicitly. OPTIONAL only because `ownerSpaceUri` is the other way to say it — the service still refuses a request that yields no owner at all, so the ≥ 1-owner rule is unchanged. It moved from the DTO to the service because validation runs BEFORE the expansion and therefore cannot see the owners the address produces. */
17
+ /**
18
+ * Subjects that OWN the instance (full visibility), named explicitly. OPTIONAL only because `ownerSpaceUri` is the other way to say it — the service still refuses a request that yields no owner at all, so the ≥ 1-owner rule is unchanged. It moved from the DTO to the service because validation runs BEFORE the expansion and therefore cannot see the owners the address produces.
19
+ * @minItems 1
20
+ */
15
21
  owners?: ResourceSubjectRefDto[];
16
22
  /** Subjects explicitly granted visibility, each at a LEVEL and with an optional expiry. */
17
23
  explicitShares?: ResourceShareRefDto[];
@@ -11,6 +11,9 @@ export interface RequestOutputRouteRetirementDto {
11
11
  * @maximum 2147483647
12
12
  */
13
13
  expectedChannelVersion: number;
14
- /** @maxLength 2048 */
14
+ /**
15
+ * @minLength 1
16
+ * @maxLength 2048
17
+ */
15
18
  reason: string;
16
19
  }
@@ -8,16 +8,24 @@ import type { DataClassification } from './dataClassification.js';
8
8
  import type { OutputRouteDestinationKind } from './outputRouteDestinationKind.js';
9
9
  import type { RequestOutputRouteRevisionReleaseDtoAllowedOutputSchema } from './requestOutputRouteRevisionReleaseDtoAllowedOutputSchema.js';
10
10
  export interface RequestOutputRouteRevisionReleaseDto {
11
- /** Canonical versioned OutputRoute identity. */
11
+ /**
12
+ * Canonical versioned OutputRoute identity.
13
+ * @minLength 1
14
+ */
12
15
  ref: string;
16
+ /** @minLength 1 */
13
17
  ownerSpaceKey: string;
14
18
  destinationKind: OutputRouteDestinationKind;
15
- /** Secret-free destination identity. Credentials are resolved only by the destination service. */
19
+ /**
20
+ * Secret-free destination identity. Credentials are resolved only by the destination service.
21
+ * @minLength 1
22
+ */
16
23
  destinationRef: string;
17
24
  classification: DataClassification;
18
25
  /** JSON Schema for the only output shape this route accepts. */
19
26
  allowedOutputSchema: RequestOutputRouteRevisionReleaseDtoAllowedOutputSchema;
20
27
  sideEffectClass: CapabilityEffectClass;
28
+ /** @minLength 1 */
21
29
  decisionCapabilityRef: string;
22
30
  /** @pattern ^[a-z][a-z0-9-]{0,62}$ */
23
31
  channel: string;
@@ -26,6 +34,9 @@ export interface RequestOutputRouteRevisionReleaseDto {
26
34
  * @maximum 2147483647
27
35
  */
28
36
  expectedChannelVersion: number;
29
- /** @maxLength 2048 */
37
+ /**
38
+ * @minLength 1
39
+ * @maxLength 2048
40
+ */
30
41
  reason: string;
31
42
  }
@@ -11,7 +11,11 @@ export interface RequestOutputRouteRollbackDto {
11
11
  * @maximum 2147483647
12
12
  */
13
13
  expectedChannelVersion: number;
14
- /** @maxLength 2048 */
14
+ /**
15
+ * @minLength 1
16
+ * @maxLength 2048
17
+ */
15
18
  reason: string;
19
+ /** @minLength 1 */
16
20
  priorReleaseSetId: string;
17
21
  }
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import type { ResourceSubjectRefDto } from './resourceSubjectRefDto.js';
7
7
  export interface ResolveExactOutputRouteDto {
8
+ /** @minLength 1 */
8
9
  ref: string;
9
10
  subject: ResourceSubjectRefDto;
10
11
  }
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import type { ResourceSubjectRefDto } from './resourceSubjectRefDto.js';
7
7
  export interface ResolveOutputRouteChannelDto {
8
+ /** @minLength 1 */
8
9
  routeId: string;
9
10
  /** @pattern ^[a-z][a-z0-9-]{0,62}$ */
10
11
  channel: string;
@@ -6,9 +6,15 @@
6
6
  import type { SubjectKind } from './subjectKind.js';
7
7
  export interface ResourceShareRefDto {
8
8
  kind: SubjectKind;
9
- /** Subject id (the `<id>` in `<kind>:<id>`). */
9
+ /**
10
+ * Subject id (the `<id>` in `<kind>:<id>`).
11
+ * @minLength 1
12
+ */
10
13
  ref: string;
11
- /** The resource kind's own name for the level this share confers. Levels are declared per kind (a document has `viewer < editor < manager`; a mailbox's `editor` is not a meaningful authority) and are totally ordered with monotone verb expansion. OMITTED means the LOWEST level the kind declares — never the highest. */
14
+ /**
15
+ * The resource kind's own name for the level this share confers. Levels are declared per kind (a document has `viewer < editor < manager`; a mailbox's `editor` is not a meaningful authority) and are totally ordered with monotone verb expansion. OMITTED means the LOWEST level the kind declares — never the highest.
16
+ * @minLength 1
17
+ */
12
18
  level?: string;
13
19
  /** ISO-8601 instant after which the share stops granting. Enforced by an OpenFGA condition evaluated at DECISION time, not by a sweeper — a sweeper leaves a window in which a lapsed share still passes. Omitted means the share does not expire. An instant in the past is a 400. */
14
20
  expiresAt?: string;
@@ -6,6 +6,9 @@
6
6
  import type { SubjectKind } from './subjectKind.js';
7
7
  export interface ResourceSubjectRefDto {
8
8
  kind: SubjectKind;
9
- /** Subject id (the `<id>` in `<kind>:<id>`). */
9
+ /**
10
+ * Subject id (the `<id>` in `<kind>:<id>`).
11
+ * @minLength 1
12
+ */
10
13
  ref: string;
11
14
  }
@@ -4,6 +4,9 @@
4
4
  * OpenAPI spec version: 0.1.1
5
5
  */
6
6
  export type RolesControllerListParams = {
7
+ /**
8
+ * @minLength 1
9
+ */
7
10
  orgId: string;
8
11
  /**
9
12
  * Include kernel-seeded built-in roles (default true).
@@ -4,8 +4,11 @@
4
4
  * OpenAPI spec version: 0.1.1
5
5
  */
6
6
  export interface RollbackExecutionEnvironmentDto {
7
- /** Immutable prior generic ReleaseSet identifier. */
7
+ /**
8
+ * Immutable prior generic ReleaseSet identifier.
9
+ * @minLength 1
10
+ */
8
11
  priorReleaseSetId: string;
9
- /** True selects this tenant's built-in override channel; false selects the identity default/stable channel. */
12
+ /** Selects the OWNER of the release address to roll back, never a channel. True rolls back this org's restriction OF a built-in; false rolls back the environment's own identity — an installation-wide built-in under the global owner, or this org's own custom environment. All three addresses are published on the `stable` channel (owner ruling D-09-3), and they stay distinct because the release pointer is keyed on the owner. */
10
13
  tenantOverride: boolean;
11
14
  }
@@ -7,6 +7,9 @@ import type { SubjectKind } from './subjectKind.js';
7
7
  export interface SubjectRefDto {
8
8
  /** Discriminator over the kinds of subject that may hold a grant. */
9
9
  kind: SubjectKind;
10
- /** Opaque ref for the subject; authorization-api owns interpretation per `kind`. */
10
+ /**
11
+ * Opaque ref for the subject; authorization-api owns interpretation per `kind`.
12
+ * @minLength 1
13
+ */
11
14
  ref: string;
12
15
  }
@@ -6,10 +6,12 @@
6
6
  export type TeamsControllerListParams = {
7
7
  /**
8
8
  * Required — teams are always listed within a single org.
9
+ * @minLength 1
9
10
  */
10
11
  orgId: string;
11
12
  /**
12
13
  * Filter to the direct children of this parent team id.
14
+ * @minLength 1
13
15
  */
14
16
  parentTeamId?: string;
15
17
  };
@@ -8,6 +8,7 @@ import type { UpdateExecutionEnvironmentDtoAllowedCapabilitiesItem } from './upd
8
8
  import type { UpdateExecutionEnvironmentDtoApprovalRulesItem } from './updateExecutionEnvironmentDtoApprovalRulesItem.js';
9
9
  import type { UpdateExecutionEnvironmentDtoRuntimeLimits } from './updateExecutionEnvironmentDtoRuntimeLimits.js';
10
10
  export interface UpdateExecutionEnvironmentDto {
11
+ /** @minLength 1 */
11
12
  description?: string;
12
13
  /** Per-environment capability allow-list (`CapabilityPolicy[]`). */
13
14
  allowedCapabilities?: UpdateExecutionEnvironmentDtoAllowedCapabilitiesItem[];