@odingard/guardian-sdk 0.0.0-stage → 0.2.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 (58) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +302 -2
  3. package/dist/contracts.js +9865 -0
  4. package/dist/index.js +14437 -0
  5. package/dist/public-catalog.v1.json +6915 -0
  6. package/dist-dts/catalog.d.ts +14 -0
  7. package/dist-dts/client.d.ts +130 -0
  8. package/dist-dts/contracts/action-pack.d.ts +464 -0
  9. package/dist-dts/contracts/action-parameters.d.ts +34 -0
  10. package/dist-dts/contracts/action-registry.d.ts +287 -0
  11. package/dist-dts/contracts/action.d.ts +2358 -0
  12. package/dist-dts/contracts/agent-state.d.ts +386 -0
  13. package/dist-dts/contracts/api.d.ts +78 -0
  14. package/dist-dts/contracts/approval.d.ts +425 -0
  15. package/dist-dts/contracts/assurance.d.ts +60 -0
  16. package/dist-dts/contracts/authority-graph.d.ts +294 -0
  17. package/dist-dts/contracts/authority-state.d.ts +108 -0
  18. package/dist-dts/contracts/authority.d.ts +339 -0
  19. package/dist-dts/contracts/billing.d.ts +32 -0
  20. package/dist-dts/contracts/calendar.d.ts +146 -0
  21. package/dist-dts/contracts/canonical-json.d.ts +4 -0
  22. package/dist-dts/contracts/capability.d.ts +28 -0
  23. package/dist-dts/contracts/commerce.d.ts +133 -0
  24. package/dist-dts/contracts/denial.d.ts +648 -0
  25. package/dist-dts/contracts/digest.d.ts +2 -0
  26. package/dist-dts/contracts/email.d.ts +45 -0
  27. package/dist-dts/contracts/evidence.d.ts +1087 -0
  28. package/dist-dts/contracts/execution.d.ts +1732 -0
  29. package/dist-dts/contracts/files.d.ts +61 -0
  30. package/dist-dts/contracts/identifiers.d.ts +49 -0
  31. package/dist-dts/contracts/index.d.ts +41 -0
  32. package/dist-dts/contracts/intent.d.ts +335 -0
  33. package/dist-dts/contracts/lineage.d.ts +218 -0
  34. package/dist-dts/contracts/local.d.ts +101 -0
  35. package/dist-dts/contracts/multi-principal.d.ts +292 -0
  36. package/dist-dts/contracts/multiparty.d.ts +169 -0
  37. package/dist-dts/contracts/obligation.d.ts +196 -0
  38. package/dist-dts/contracts/plan.d.ts +67 -0
  39. package/dist-dts/contracts/policy-simulation.d.ts +681 -0
  40. package/dist-dts/contracts/prerequisite.d.ts +147 -0
  41. package/dist-dts/contracts/protected-data.d.ts +160 -0
  42. package/dist-dts/contracts/receipt.d.ts +3126 -0
  43. package/dist-dts/contracts/resource-claims.d.ts +146 -0
  44. package/dist-dts/contracts/runtime.d.ts +111 -0
  45. package/dist-dts/contracts/safety-envelope.d.ts +287 -0
  46. package/dist-dts/contracts/sequence.d.ts +132 -0
  47. package/dist-dts/contracts/sources.d.ts +191 -0
  48. package/dist-dts/contracts/tools.d.ts +232 -0
  49. package/dist-dts/contracts/transaction.d.ts +360 -0
  50. package/dist-dts/contracts-entry.d.ts +1 -0
  51. package/dist-dts/embedded.d.ts +58 -0
  52. package/dist-dts/evidence/evidence.d.ts +25 -0
  53. package/dist-dts/evidence/receipt.d.ts +61 -0
  54. package/dist-dts/index.d.ts +5 -0
  55. package/dist-dts/lifecycle.d.ts +25 -0
  56. package/dist-dts/proposal.d.ts +41 -0
  57. package/dist-dts/receipts.d.ts +37 -0
  58. package/package.json +56 -4
@@ -0,0 +1,218 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * WO-025: guardian.lineage.v1 — derived-data lineage contract
4
+ * (GUA-AUTHORITY-OS-001 §17–20).
5
+ *
6
+ * Every data object records a human/policy-declared classification plus the
7
+ * lineage that produced it (sources, derivations, declared transformation
8
+ * records). Propagation is pure and deterministic:
9
+ *
10
+ * effectiveClassification(object) =
11
+ * the recorded resultClassification of the object's declared
12
+ * transformation, when one exists;
13
+ * otherwise the maximum of its own declared classification and the
14
+ * effective classification of every recorded source.
15
+ *
16
+ * A model/agent assertion NEVER changes classification — the only path to a
17
+ * narrower result is a declared transformation record bound into the stored
18
+ * object (and into the material digest of the action that registered it).
19
+ * Missing lineage for a classified source fails closed.
20
+ */
21
+ export declare const LINEAGE_CONTRACT_SCHEMA = "guardian.lineage.v1";
22
+ /** Ordered data classification lattice (lowest → highest). */
23
+ export declare const DataClassificationSchema: z.ZodEnum<{
24
+ financial: "financial";
25
+ internal: "internal";
26
+ public: "public";
27
+ pii: "pii";
28
+ phi: "phi";
29
+ credential: "credential";
30
+ confidential: "confidential";
31
+ }>;
32
+ export type DataClassification = z.infer<typeof DataClassificationSchema>;
33
+ export declare const CLASSIFICATION_RANK: Record<DataClassification, number>;
34
+ export declare function maxClassification(a: DataClassification, b: DataClassification): DataClassification;
35
+ export declare function classificationExceeds(value: DataClassification, ceiling: DataClassification): boolean;
36
+ export declare const DataSensitivitySchema: z.ZodEnum<{
37
+ low: "low";
38
+ moderate: "moderate";
39
+ high: "high";
40
+ }>;
41
+ export type DataSensitivity = z.infer<typeof DataSensitivitySchema>;
42
+ /** A declared, policy-defined transformation record (§19). */
43
+ export declare const DataTransformationSchema: z.ZodObject<{
44
+ type: z.ZodString;
45
+ resultClassification: z.ZodEnum<{
46
+ financial: "financial";
47
+ internal: "internal";
48
+ public: "public";
49
+ pii: "pii";
50
+ phi: "phi";
51
+ credential: "credential";
52
+ confidential: "confidential";
53
+ }>;
54
+ }, z.core.$strict>;
55
+ export type DataTransformation = z.infer<typeof DataTransformationSchema>;
56
+ /** Upstream reference: another data object or the action that produced it. */
57
+ export declare const DataSourceRefSchema: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "DataObjectId", "out">, z.core.$ZodBranded<z.ZodString, "RequestId", "out">]>;
58
+ export type DataSourceRef = z.infer<typeof DataSourceRefSchema>;
59
+ export declare const DataObjectSchema: z.ZodObject<{
60
+ schema: z.ZodLiteral<"guardian.lineage.v1">;
61
+ dataObjectId: z.core.$ZodBranded<z.ZodString, "DataObjectId", "out">;
62
+ owner: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
63
+ classification: z.ZodEnum<{
64
+ financial: "financial";
65
+ internal: "internal";
66
+ public: "public";
67
+ pii: "pii";
68
+ phi: "phi";
69
+ credential: "credential";
70
+ confidential: "confidential";
71
+ }>;
72
+ sources: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "DataObjectId", "out">, z.core.$ZodBranded<z.ZodString, "RequestId", "out">]>>>;
73
+ derivations: z.ZodDefault<z.ZodArray<z.core.$ZodBranded<z.ZodString, "DataObjectId", "out">>>;
74
+ transformations: z.ZodDefault<z.ZodArray<z.ZodObject<{
75
+ type: z.ZodString;
76
+ resultClassification: z.ZodEnum<{
77
+ financial: "financial";
78
+ internal: "internal";
79
+ public: "public";
80
+ pii: "pii";
81
+ phi: "phi";
82
+ credential: "credential";
83
+ confidential: "confidential";
84
+ }>;
85
+ }, z.core.$strict>>>;
86
+ sensitivity: z.ZodEnum<{
87
+ low: "low";
88
+ moderate: "moderate";
89
+ high: "high";
90
+ }>;
91
+ authorizedUses: z.ZodDefault<z.ZodArray<z.ZodString>>;
92
+ authorizedDisclosures: z.ZodDefault<z.ZodArray<z.ZodString>>;
93
+ retentionSeconds: z.ZodOptional<z.ZodNumber>;
94
+ expiryEpochMs: z.ZodOptional<z.ZodNumber>;
95
+ createdAt: z.ZodNumber;
96
+ }, z.core.$strict>;
97
+ export type DataObject = z.infer<typeof DataObjectSchema>;
98
+ /** Lineage policy declared on guardian.intent.v1 (`lineage` field). */
99
+ export declare const LineagePolicySchema: z.ZodObject<{
100
+ maxClassification: z.ZodOptional<z.ZodEnum<{
101
+ financial: "financial";
102
+ internal: "internal";
103
+ public: "public";
104
+ pii: "pii";
105
+ phi: "phi";
106
+ credential: "credential";
107
+ confidential: "confidential";
108
+ }>>;
109
+ requireApprovalAbove: z.ZodOptional<z.ZodEnum<{
110
+ financial: "financial";
111
+ internal: "internal";
112
+ public: "public";
113
+ pii: "pii";
114
+ phi: "phi";
115
+ credential: "credential";
116
+ confidential: "confidential";
117
+ }>>;
118
+ }, z.core.$strict>;
119
+ export type LineagePolicy = z.infer<typeof LineagePolicySchema>;
120
+ export declare const LineageEventKindSchema: z.ZodEnum<{
121
+ transform: "transform";
122
+ derive: "derive";
123
+ export: "export";
124
+ share: "share";
125
+ violation: "violation";
126
+ }>;
127
+ export type LineageEventKind = z.infer<typeof LineageEventKindSchema>;
128
+ export declare const LineageEventSchema: z.ZodObject<{
129
+ lineageEventId: z.core.$ZodBranded<z.ZodString, "LineageEventId", "out">;
130
+ dataObjectId: z.core.$ZodBranded<z.ZodString, "DataObjectId", "out">;
131
+ kind: z.ZodEnum<{
132
+ transform: "transform";
133
+ derive: "derive";
134
+ export: "export";
135
+ share: "share";
136
+ violation: "violation";
137
+ }>;
138
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
139
+ createdAt: z.ZodNumber;
140
+ }, z.core.$strict>;
141
+ export type LineageEvent = z.infer<typeof LineageEventSchema>;
142
+ export type LineageResolution = {
143
+ ok: true;
144
+ effectiveClassification: DataClassification;
145
+ sourceRefs: readonly DataSourceRef[];
146
+ expired: boolean;
147
+ } | {
148
+ ok: false;
149
+ reason: "missing";
150
+ dataObjectId: string;
151
+ } | {
152
+ ok: false;
153
+ reason: "cycle";
154
+ dataObjectId: string;
155
+ };
156
+ /**
157
+ * Resolve the effective classification of a data object over its recorded
158
+ * lineage. `resolve` is the read-only data-object port; it must return null
159
+ * for unrecorded ids so missing lineage fails closed.
160
+ */
161
+ export declare function effectiveClassification(object: DataObject, resolve: (dataObjectId: string) => DataObject | null | undefined, nowEpochMs: number): LineageResolution;
162
+ /**
163
+ * Async variant of `effectiveClassification` for the gateway: resolves the
164
+ * root object through the injected read-only port, then walks upstream.
165
+ * Missing lineage for a classified source fails closed ("missing").
166
+ */
167
+ export declare function resolveDataObjectLineage(dataObjectId: string, get: (id: string) => Promise<DataObject | null | undefined>, nowEpochMs: number): Promise<LineageResolution>;
168
+ export declare const LineageMatchOutcomeSchema: z.ZodObject<{
169
+ dataObjectId: z.core.$ZodBranded<z.ZodString, "DataObjectId", "out">;
170
+ effectiveClassification: z.ZodEnum<{
171
+ financial: "financial";
172
+ internal: "internal";
173
+ public: "public";
174
+ pii: "pii";
175
+ phi: "phi";
176
+ credential: "credential";
177
+ confidential: "confidential";
178
+ }>;
179
+ effect: z.ZodEnum<{
180
+ allowed: "allowed";
181
+ deny: "deny";
182
+ require_approval: "require_approval";
183
+ }>;
184
+ expired: z.ZodBoolean;
185
+ }, z.core.$strict>;
186
+ export type LineageMatchOutcome = z.infer<typeof LineageMatchOutcomeSchema>;
187
+ /**
188
+ * Evaluate a declared lineage policy over resolved objects. Pure: reports
189
+ * deny | require_approval | allowed with deterministic rule refs and never
190
+ * mutates authority.
191
+ */
192
+ export declare function evaluateLineagePolicy(policy: LineagePolicy | undefined, resolved: readonly {
193
+ dataObjectId: string;
194
+ resolution: LineageResolution;
195
+ }[]): {
196
+ verdict: "deny";
197
+ ruleId: string;
198
+ outcomes: LineageMatchOutcome[];
199
+ } | {
200
+ verdict: "require_approval";
201
+ ruleId: string;
202
+ outcomes: LineageMatchOutcome[];
203
+ } | {
204
+ verdict: "allowed";
205
+ outcomes: LineageMatchOutcome[];
206
+ };
207
+ /** Deterministic id for a data object registered by a derive/transform action. */
208
+ export declare function derivedDataObjectId(input: {
209
+ tenantId: string;
210
+ actionRef: string;
211
+ }): string;
212
+ /** Deterministic id for a recorded lineage event row. */
213
+ export declare function lineageEventId(input: {
214
+ tenantId: string;
215
+ actionRef: string;
216
+ dataObjectId: string;
217
+ kind: LineageEventKind;
218
+ }): string;
@@ -0,0 +1,101 @@
1
+ import { z } from "zod";
2
+ export declare const LOCAL_EXEC_PARAMETERS_SCHEMA_ID = "odingard.guardian.local.exec.v1";
3
+ export declare const LOCAL_EGRESS_PARAMETERS_SCHEMA_ID = "odingard.guardian.local.egress.v1";
4
+ export declare const LOCAL_BROWSE_PARAMETERS_SCHEMA_ID = "odingard.guardian.local.browse.v1";
5
+ export declare const LocalExecParametersV1Schema: z.ZodObject<{
6
+ schema: z.ZodLiteral<"odingard.guardian.local.exec.v1">;
7
+ connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
8
+ command: z.ZodString;
9
+ cwd: z.ZodOptional<z.ZodString>;
10
+ }, z.core.$strict>;
11
+ export type LocalExecParametersV1 = z.infer<typeof LocalExecParametersV1Schema>;
12
+ export declare const LocalEgressParametersV1Schema: z.ZodObject<{
13
+ schema: z.ZodLiteral<"odingard.guardian.local.egress.v1">;
14
+ connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
15
+ url: z.ZodString;
16
+ method: z.ZodDefault<z.ZodEnum<{
17
+ GET: "GET";
18
+ HEAD: "HEAD";
19
+ POST: "POST";
20
+ PUT: "PUT";
21
+ PATCH: "PATCH";
22
+ DELETE: "DELETE";
23
+ OPTIONS: "OPTIONS";
24
+ }>>;
25
+ }, z.core.$strict>;
26
+ export type LocalEgressParametersV1 = z.infer<typeof LocalEgressParametersV1Schema>;
27
+ export declare const LocalBrowseParametersV1Schema: z.ZodObject<{
28
+ schema: z.ZodLiteral<"odingard.guardian.local.browse.v1">;
29
+ connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
30
+ url: z.ZodString;
31
+ }, z.core.$strict>;
32
+ export type LocalBrowseParametersV1 = z.infer<typeof LocalBrowseParametersV1Schema>;
33
+ export declare const LocalCommandClassSchema: z.ZodEnum<{
34
+ routine: "routine";
35
+ publish: "publish";
36
+ destructive: "destructive";
37
+ }>;
38
+ export type LocalCommandClass = z.infer<typeof LocalCommandClassSchema>;
39
+ /**
40
+ * Deterministic shell command classifier for local.exec mediation.
41
+ *
42
+ * The mediator routes each intercepted command to the class-scoped action
43
+ * (local.exec / local.exec.publish / local.exec.destroy); the definition's
44
+ * validateBinding re-derives the class from the same function, so an agent
45
+ * cannot smuggle a destructive command through a lower-class action.
46
+ *
47
+ * Semantics (kept deliberately small and auditable):
48
+ * - The command is split on `&&`, `||`, `;`, `|`, and newlines; the result is
49
+ * the MOST restrictive class of any segment.
50
+ * - Leading `NAME=value` assignments and `sudo`/`doas`/`env`/`nice`/`ionice`/
51
+ * `nohup`/`timeout`/`time` wrappers (plus their flag arguments) are stripped
52
+ * so `sudo rm -rf /` still classifies on `rm`.
53
+ * - Anything the classifier cannot fully inspect fails conservative:
54
+ * a nested shell (`bash`, `sh -c`, `zsh`), `eval`, `exec`, `source`, inline
55
+ * interpreters (`python -c`, `node -e`, …) and `xargs` are destructive;
56
+ * command substitution `$(...)` / backticks and output redirections raise
57
+ * the floor to publish; unknown programs are publish.
58
+ * - `destructive` programs (rm, dd, mkfs, shred, kill*, shutdown, iptables,
59
+ * `terraform destroy|apply`, `kubectl delete`, `docker rm|prune`, …) and
60
+ * destructive git forms (`git reset`, `git clean`, `git push --force`,
61
+ * `git branch -D`) are destructive.
62
+ * - `publish` programs are outbound mutations: network tools (curl, wget,
63
+ * ssh, scp, rsync, gh, browsers), package installs (`npm install`), and
64
+ * git subcommands that mutate or reach a remote (push, commit, merge, …).
65
+ * - `routine` is a closed list of dev-toolchain and read-only utilities
66
+ * (build/test/lint commands, ls/cat/grep/find/ps, `npm test`, read-only
67
+ * git subcommands like status/log/diff).
68
+ */
69
+ export declare function classifyLocalCommand(command: string): LocalCommandClass;
70
+ type BindingResult = Readonly<{
71
+ ok: true;
72
+ }> | Readonly<{
73
+ ok: false;
74
+ reasonCode: string;
75
+ }>;
76
+ type LocalConnectionFacts = Readonly<{
77
+ provider: string;
78
+ endpointAllowlist?: readonly string[];
79
+ }>;
80
+ /**
81
+ * The class-scoped binding for local.exec*: the classified command must equal
82
+ * the action's declared class. Re-derived here so a misrouted action id (e.g.
83
+ * a destructive command proposed as `local.exec`) fails closed.
84
+ */
85
+ export declare function localExecBinding(expected: LocalCommandClass): (input: {
86
+ params: LocalExecParametersV1;
87
+ connection: LocalConnectionFacts;
88
+ }) => BindingResult;
89
+ export declare function localEndpointBinding(input: {
90
+ params: {
91
+ url: string;
92
+ };
93
+ connection: LocalConnectionFacts;
94
+ }): BindingResult;
95
+ export declare function localExecVerificationProjection(input: LocalExecParametersV1): unknown;
96
+ export declare function localExecEnvelopeProjection(input: LocalExecParametersV1): unknown;
97
+ export declare function localEgressVerificationProjection(input: LocalEgressParametersV1): unknown;
98
+ export declare function localEgressEnvelopeProjection(input: LocalEgressParametersV1): unknown;
99
+ export declare function localBrowseVerificationProjection(input: LocalBrowseParametersV1): unknown;
100
+ export declare function localBrowseEnvelopeProjection(input: LocalBrowseParametersV1): unknown;
101
+ export {};
@@ -0,0 +1,292 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * WO-019 — multi-principal authority relationships.
4
+ *
5
+ * A shared scope groups principals into a household or team. Memberships carry
6
+ * three independent axes, never blended:
7
+ * - principalClass: what authority the principal may hold (a child never
8
+ * holds adult-scope authority);
9
+ * - role: what the member may DO inside the scope (approve vs only view);
10
+ * - relationshipKind: descriptive family/workspace label carried for display
11
+ * and audit; it never confers authority by itself.
12
+ *
13
+ * Scope kinds are deliberately limited to household/team: organization-level
14
+ * directory management is enterprise IAM and out of scope (WO-019 stop
15
+ * condition).
16
+ */
17
+ export declare const PrincipalClassSchema: z.ZodEnum<{
18
+ adult: "adult";
19
+ child: "child";
20
+ }>;
21
+ export declare const ScopeKindSchema: z.ZodEnum<{
22
+ household: "household";
23
+ team: "team";
24
+ }>;
25
+ export declare const RelationshipKindSchema: z.ZodEnum<{
26
+ child: "child";
27
+ spouse: "spouse";
28
+ parent: "parent";
29
+ caregiver: "caregiver";
30
+ workspace: "workspace";
31
+ }>;
32
+ export declare const ScopeMemberRoleSchema: z.ZodEnum<{
33
+ owner: "owner";
34
+ approver: "approver";
35
+ viewer: "viewer";
36
+ }>;
37
+ /**
38
+ * Step-up levels a single human can present. "multi-approver" is a required
39
+ * level only — no single human can present it; it is satisfied by a quorum of
40
+ * distinct approvers (WO-019 step-up ladder).
41
+ */
42
+ export declare const StepUpLevelSchema: z.ZodEnum<{
43
+ tap: "tap";
44
+ passkey: "passkey";
45
+ biometric: "biometric";
46
+ "second-device": "second-device";
47
+ "multi-approver": "multi-approver";
48
+ }>;
49
+ /** The factor one human actually presents with a decision. */
50
+ export declare const ApprovalFactorSchema: z.ZodEnum<{
51
+ tap: "tap";
52
+ passkey: "passkey";
53
+ biometric: "biometric";
54
+ "second-device": "second-device";
55
+ }>;
56
+ /** Ordering of the single-human step-up levels, lowest first. */
57
+ export declare const APPROVAL_FACTOR_RANK: Record<z.infer<typeof ApprovalFactorSchema>, number>;
58
+ /**
59
+ * Ordering of the step-up levels an approval may require, lowest first;
60
+ * "multi-approver" sits above every single-human factor.
61
+ */
62
+ export declare const STEP_UP_LEVEL_RANK: Record<z.infer<typeof StepUpLevelSchema>, number>;
63
+ /** The stricter of two required step-up levels. */
64
+ export declare function strictestStepUpLevel(current: z.infer<typeof StepUpLevelSchema>, candidate: z.infer<typeof StepUpLevelSchema>): z.infer<typeof StepUpLevelSchema>;
65
+ /**
66
+ * True when the presented factor meets the required step-up level.
67
+ * "multi-approver" can never be met by one presented factor — it is satisfied
68
+ * by the endorsement quorum the approval service enforces.
69
+ */
70
+ export declare function approvalFactorSatisfies(presented: z.infer<typeof ApprovalFactorSchema>, required: z.infer<typeof StepUpLevelSchema>): boolean;
71
+ export declare const SharedScopeSchema: z.ZodObject<{
72
+ schemaVersion: z.ZodLiteral<1>;
73
+ scopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
74
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
75
+ kind: z.ZodEnum<{
76
+ household: "household";
77
+ team: "team";
78
+ }>;
79
+ label: z.ZodString;
80
+ status: z.ZodEnum<{
81
+ active: "active";
82
+ dissolved: "dissolved";
83
+ }>;
84
+ version: z.ZodNumber;
85
+ createdAtEpochMs: z.ZodNumber;
86
+ createdByPrincipalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
87
+ }, z.core.$strict>;
88
+ export declare const ScopeMembershipSchema: z.ZodObject<{
89
+ schemaVersion: z.ZodLiteral<1>;
90
+ membershipId: z.core.$ZodBranded<z.ZodString, "MembershipId", "out">;
91
+ scopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
92
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
93
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
94
+ principalClass: z.ZodEnum<{
95
+ adult: "adult";
96
+ child: "child";
97
+ }>;
98
+ role: z.ZodEnum<{
99
+ owner: "owner";
100
+ approver: "approver";
101
+ viewer: "viewer";
102
+ }>;
103
+ relationshipKind: z.ZodEnum<{
104
+ child: "child";
105
+ spouse: "spouse";
106
+ parent: "parent";
107
+ caregiver: "caregiver";
108
+ workspace: "workspace";
109
+ }>;
110
+ status: z.ZodEnum<{
111
+ active: "active";
112
+ removed: "removed";
113
+ }>;
114
+ version: z.ZodNumber;
115
+ addedAtEpochMs: z.ZodNumber;
116
+ addedByPrincipalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
117
+ }, z.core.$strict>;
118
+ /** Links one member's agent into the scope so co-principals can see/decide. */
119
+ export declare const ScopeAgentLinkSchema: z.ZodObject<{
120
+ schemaVersion: z.ZodLiteral<1>;
121
+ scopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
122
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
123
+ agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
124
+ ownerPrincipalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
125
+ status: z.ZodEnum<{
126
+ active: "active";
127
+ unlinked: "unlinked";
128
+ }>;
129
+ version: z.ZodNumber;
130
+ linkedAtEpochMs: z.ZodNumber;
131
+ linkedByPrincipalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
132
+ }, z.core.$strict>;
133
+ /**
134
+ * Per-scope approval policy: the step-up level and approver quorum every new
135
+ * approval on a linked agent must satisfy. factorByRiskClass can raise (never
136
+ * lower) the level for higher-risk actions.
137
+ */
138
+ export declare const ScopeApprovalPolicySchema: z.ZodObject<{
139
+ schemaVersion: z.ZodLiteral<1>;
140
+ scopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
141
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
142
+ requiredFactor: z.ZodEnum<{
143
+ tap: "tap";
144
+ passkey: "passkey";
145
+ biometric: "biometric";
146
+ "second-device": "second-device";
147
+ "multi-approver": "multi-approver";
148
+ }>;
149
+ requiredApprovals: z.ZodNumber;
150
+ factorByRiskClass: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
151
+ R0: "R0";
152
+ R1: "R1";
153
+ R2: "R2";
154
+ R3: "R3";
155
+ R4: "R4";
156
+ R5: "R5";
157
+ }>, z.ZodEnum<{
158
+ tap: "tap";
159
+ passkey: "passkey";
160
+ biometric: "biometric";
161
+ "second-device": "second-device";
162
+ "multi-approver": "multi-approver";
163
+ }>>>;
164
+ status: z.ZodEnum<{
165
+ active: "active";
166
+ }>;
167
+ version: z.ZodNumber;
168
+ updatedAtEpochMs: z.ZodNumber;
169
+ updatedByPrincipalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
170
+ approvalStructure: z.ZodOptional<z.ZodObject<{
171
+ schema: z.ZodLiteral<"guardian.multiparty.v1">;
172
+ structureId: z.ZodString;
173
+ members: z.ZodArray<z.ZodObject<{
174
+ memberId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
175
+ roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
176
+ }, z.core.$strict>>;
177
+ requirement: z.ZodDiscriminatedUnion<[z.ZodObject<{
178
+ kind: z.ZodLiteral<"single">;
179
+ memberId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
180
+ }, z.core.$strict>, z.ZodObject<{
181
+ kind: z.ZodLiteral<"nOfM">;
182
+ n: z.ZodNumber;
183
+ members: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>;
184
+ }, z.core.$strict>, z.ZodObject<{
185
+ kind: z.ZodLiteral<"unanimous">;
186
+ members: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>;
187
+ }, z.core.$strict>, z.ZodObject<{
188
+ kind: z.ZodLiteral<"roleQuorum">;
189
+ role: z.ZodString;
190
+ n: z.ZodNumber;
191
+ m: z.ZodNumber;
192
+ }, z.core.$strict>], "kind">;
193
+ specificRequired: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>>;
194
+ veto: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>>;
195
+ separationOfDuties: z.ZodOptional<z.ZodObject<{
196
+ mutuallyExclusive: z.ZodArray<z.ZodArray<z.ZodString>>;
197
+ }, z.core.$strict>>;
198
+ temporaryApprovers: z.ZodOptional<z.ZodArray<z.ZodObject<{
199
+ memberId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
200
+ expiresAtEpochMs: z.ZodNumber;
201
+ }, z.core.$strict>>>;
202
+ delegatedApprovers: z.ZodOptional<z.ZodArray<z.ZodObject<{
203
+ memberId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
204
+ delegatedBy: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
205
+ }, z.core.$strict>>>;
206
+ emergencyApprovers: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>>;
207
+ coolingPeriod: z.ZodOptional<z.ZodObject<{
208
+ seconds: z.ZodNumber;
209
+ }, z.core.$strict>>;
210
+ }, z.core.$strict>>;
211
+ }, z.core.$strict>;
212
+ /**
213
+ * The requirement resolved when an approval is opened on a scope-linked agent:
214
+ * the bound approver set, the required step-up level, and the quorum. It is
215
+ * frozen into the approval binding at creation so consent cannot widen later.
216
+ */
217
+ export declare const ApprovalRequirementSchema: z.ZodObject<{
218
+ scopeId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "ScopeId", "out">>;
219
+ eligiblePrincipalIds: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>;
220
+ requiredFactor: z.ZodEnum<{
221
+ tap: "tap";
222
+ passkey: "passkey";
223
+ biometric: "biometric";
224
+ "second-device": "second-device";
225
+ "multi-approver": "multi-approver";
226
+ }>;
227
+ requiredApprovals: z.ZodNumber;
228
+ structure: z.ZodOptional<z.ZodObject<{
229
+ schema: z.ZodLiteral<"guardian.multiparty.v1">;
230
+ structureId: z.ZodString;
231
+ members: z.ZodArray<z.ZodObject<{
232
+ memberId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
233
+ roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
234
+ }, z.core.$strict>>;
235
+ requirement: z.ZodDiscriminatedUnion<[z.ZodObject<{
236
+ kind: z.ZodLiteral<"single">;
237
+ memberId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
238
+ }, z.core.$strict>, z.ZodObject<{
239
+ kind: z.ZodLiteral<"nOfM">;
240
+ n: z.ZodNumber;
241
+ members: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>;
242
+ }, z.core.$strict>, z.ZodObject<{
243
+ kind: z.ZodLiteral<"unanimous">;
244
+ members: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>;
245
+ }, z.core.$strict>, z.ZodObject<{
246
+ kind: z.ZodLiteral<"roleQuorum">;
247
+ role: z.ZodString;
248
+ n: z.ZodNumber;
249
+ m: z.ZodNumber;
250
+ }, z.core.$strict>], "kind">;
251
+ specificRequired: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>>;
252
+ veto: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>>;
253
+ separationOfDuties: z.ZodOptional<z.ZodObject<{
254
+ mutuallyExclusive: z.ZodArray<z.ZodArray<z.ZodString>>;
255
+ }, z.core.$strict>>;
256
+ temporaryApprovers: z.ZodOptional<z.ZodArray<z.ZodObject<{
257
+ memberId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
258
+ expiresAtEpochMs: z.ZodNumber;
259
+ }, z.core.$strict>>>;
260
+ delegatedApprovers: z.ZodOptional<z.ZodArray<z.ZodObject<{
261
+ memberId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
262
+ delegatedBy: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
263
+ }, z.core.$strict>>>;
264
+ emergencyApprovers: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>>;
265
+ coolingPeriod: z.ZodOptional<z.ZodObject<{
266
+ seconds: z.ZodNumber;
267
+ }, z.core.$strict>>;
268
+ }, z.core.$strict>>;
269
+ }, z.core.$strict>;
270
+ /** One approver's recorded assent toward a multi-approver quorum. */
271
+ export declare const ApprovalEndorsementSchema: z.ZodObject<{
272
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
273
+ factor: z.ZodEnum<{
274
+ tap: "tap";
275
+ passkey: "passkey";
276
+ biometric: "biometric";
277
+ "second-device": "second-device";
278
+ }>;
279
+ atEpochMs: z.ZodNumber;
280
+ }, z.core.$strict>;
281
+ export type PrincipalClass = z.infer<typeof PrincipalClassSchema>;
282
+ export type ScopeKind = z.infer<typeof ScopeKindSchema>;
283
+ export type RelationshipKind = z.infer<typeof RelationshipKindSchema>;
284
+ export type ScopeMemberRole = z.infer<typeof ScopeMemberRoleSchema>;
285
+ export type StepUpLevel = z.infer<typeof StepUpLevelSchema>;
286
+ export type ApprovalFactor = z.infer<typeof ApprovalFactorSchema>;
287
+ export type SharedScope = z.infer<typeof SharedScopeSchema>;
288
+ export type ScopeMembership = z.infer<typeof ScopeMembershipSchema>;
289
+ export type ScopeAgentLink = z.infer<typeof ScopeAgentLinkSchema>;
290
+ export type ScopeApprovalPolicy = z.infer<typeof ScopeApprovalPolicySchema>;
291
+ export type ApprovalRequirement = z.infer<typeof ApprovalRequirementSchema>;
292
+ export type ApprovalEndorsement = z.infer<typeof ApprovalEndorsementSchema>;