@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.
- package/LICENSE +201 -0
- package/README.md +302 -2
- package/dist/contracts.js +9865 -0
- package/dist/index.js +14437 -0
- package/dist/public-catalog.v1.json +6915 -0
- package/dist-dts/catalog.d.ts +14 -0
- package/dist-dts/client.d.ts +130 -0
- package/dist-dts/contracts/action-pack.d.ts +464 -0
- package/dist-dts/contracts/action-parameters.d.ts +34 -0
- package/dist-dts/contracts/action-registry.d.ts +287 -0
- package/dist-dts/contracts/action.d.ts +2358 -0
- package/dist-dts/contracts/agent-state.d.ts +386 -0
- package/dist-dts/contracts/api.d.ts +78 -0
- package/dist-dts/contracts/approval.d.ts +425 -0
- package/dist-dts/contracts/assurance.d.ts +60 -0
- package/dist-dts/contracts/authority-graph.d.ts +294 -0
- package/dist-dts/contracts/authority-state.d.ts +108 -0
- package/dist-dts/contracts/authority.d.ts +339 -0
- package/dist-dts/contracts/billing.d.ts +32 -0
- package/dist-dts/contracts/calendar.d.ts +146 -0
- package/dist-dts/contracts/canonical-json.d.ts +4 -0
- package/dist-dts/contracts/capability.d.ts +28 -0
- package/dist-dts/contracts/commerce.d.ts +133 -0
- package/dist-dts/contracts/denial.d.ts +648 -0
- package/dist-dts/contracts/digest.d.ts +2 -0
- package/dist-dts/contracts/email.d.ts +45 -0
- package/dist-dts/contracts/evidence.d.ts +1087 -0
- package/dist-dts/contracts/execution.d.ts +1732 -0
- package/dist-dts/contracts/files.d.ts +61 -0
- package/dist-dts/contracts/identifiers.d.ts +49 -0
- package/dist-dts/contracts/index.d.ts +41 -0
- package/dist-dts/contracts/intent.d.ts +335 -0
- package/dist-dts/contracts/lineage.d.ts +218 -0
- package/dist-dts/contracts/local.d.ts +101 -0
- package/dist-dts/contracts/multi-principal.d.ts +292 -0
- package/dist-dts/contracts/multiparty.d.ts +169 -0
- package/dist-dts/contracts/obligation.d.ts +196 -0
- package/dist-dts/contracts/plan.d.ts +67 -0
- package/dist-dts/contracts/policy-simulation.d.ts +681 -0
- package/dist-dts/contracts/prerequisite.d.ts +147 -0
- package/dist-dts/contracts/protected-data.d.ts +160 -0
- package/dist-dts/contracts/receipt.d.ts +3126 -0
- package/dist-dts/contracts/resource-claims.d.ts +146 -0
- package/dist-dts/contracts/runtime.d.ts +111 -0
- package/dist-dts/contracts/safety-envelope.d.ts +287 -0
- package/dist-dts/contracts/sequence.d.ts +132 -0
- package/dist-dts/contracts/sources.d.ts +191 -0
- package/dist-dts/contracts/tools.d.ts +232 -0
- package/dist-dts/contracts/transaction.d.ts +360 -0
- package/dist-dts/contracts-entry.d.ts +1 -0
- package/dist-dts/embedded.d.ts +58 -0
- package/dist-dts/evidence/evidence.d.ts +25 -0
- package/dist-dts/evidence/receipt.d.ts +61 -0
- package/dist-dts/index.d.ts +5 -0
- package/dist-dts/lifecycle.d.ts +25 -0
- package/dist-dts/proposal.d.ts +41 -0
- package/dist-dts/receipts.d.ts +37 -0
- package/package.json +56 -4
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* WO-016 — parameter + projection contracts for the internal "guardian"
|
|
4
|
+
* provider: delegation (agent.spawn/delegate/terminate), memory governance
|
|
5
|
+
* (memory.*), identity/security mutations, and runtime/model/configure
|
|
6
|
+
* changes. Everything is a canonical envelope over generic primitives —
|
|
7
|
+
* no kernel branches (GUA-UNIVERSAL-001, K15).
|
|
8
|
+
*/
|
|
9
|
+
export declare const GUARDIAN_PROVIDER = "guardian";
|
|
10
|
+
export declare const GUARDIAN_PROFILE = "guardian-agent-v1";
|
|
11
|
+
export declare const GUARDIAN_RESOURCE_TYPE = "guardian-agent";
|
|
12
|
+
/** Memory key namespaces the agent can never write. Authority only ever
|
|
13
|
+
* lives in grants/writs — `authority.*` keys would pretend otherwise, so
|
|
14
|
+
* binding rejects them outright (prompt-injection-via-memory → DENY). */
|
|
15
|
+
export declare const MEMORY_RESERVED_PREFIX = "authority.";
|
|
16
|
+
/** Entries the human marks as authority-affecting; only memory.modify
|
|
17
|
+
* (ask-posture) may touch them — never memory.write/delete/share. */
|
|
18
|
+
export declare const MEMORY_GOVERNED_PREFIX = "governed.";
|
|
19
|
+
/** Narrowing fields a delegated edge may carry — the same monetary shape
|
|
20
|
+
* human-facing grants accept (mirrors control-plane grant constraints). */
|
|
21
|
+
export declare const DelegatedConstraintsSchema: z.ZodObject<{
|
|
22
|
+
maxValueCents: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
askAboveValueCents: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
merchantAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25
|
+
categoryAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
26
|
+
recurrence: z.ZodOptional<z.ZodEnum<{
|
|
27
|
+
never: "never";
|
|
28
|
+
allowed: "allowed";
|
|
29
|
+
}>>;
|
|
30
|
+
budgetIds: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "BudgetId", "out">>>;
|
|
31
|
+
}, z.core.$strict>;
|
|
32
|
+
export type DelegatedConstraints = z.infer<typeof DelegatedConstraintsSchema>;
|
|
33
|
+
declare const DelegatedEdgeSchema: z.ZodObject<{
|
|
34
|
+
targetConnectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
35
|
+
mode: z.ZodEnum<{
|
|
36
|
+
allow: "allow";
|
|
37
|
+
ask: "ask";
|
|
38
|
+
}>;
|
|
39
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
40
|
+
constraints: z.ZodOptional<z.ZodObject<{
|
|
41
|
+
maxValueCents: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
askAboveValueCents: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
merchantAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
44
|
+
categoryAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
45
|
+
recurrence: z.ZodOptional<z.ZodEnum<{
|
|
46
|
+
never: "never";
|
|
47
|
+
allowed: "allowed";
|
|
48
|
+
}>>;
|
|
49
|
+
budgetIds: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "BudgetId", "out">>>;
|
|
50
|
+
}, z.core.$strict>>;
|
|
51
|
+
expiresAtEpochMs: z.ZodNumber;
|
|
52
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, z.core.$strict>;
|
|
54
|
+
export declare const AgentSpawnParametersV1Schema: z.ZodObject<{
|
|
55
|
+
schema: z.ZodLiteral<"odingard.guardian.agent.spawn.v1">;
|
|
56
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
57
|
+
name: z.ZodString;
|
|
58
|
+
runtime: z.ZodOptional<z.ZodString>;
|
|
59
|
+
model: z.ZodOptional<z.ZodString>;
|
|
60
|
+
}, z.core.$strict>;
|
|
61
|
+
export type AgentSpawnParametersV1 = z.infer<typeof AgentSpawnParametersV1Schema>;
|
|
62
|
+
export declare const AgentDelegateParametersV1Schema: z.ZodObject<{
|
|
63
|
+
schema: z.ZodLiteral<"odingard.guardian.agent.delegate.v1">;
|
|
64
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
65
|
+
childAgentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
66
|
+
delegations: z.ZodArray<z.ZodObject<{
|
|
67
|
+
targetConnectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
68
|
+
mode: z.ZodEnum<{
|
|
69
|
+
allow: "allow";
|
|
70
|
+
ask: "ask";
|
|
71
|
+
}>;
|
|
72
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
73
|
+
constraints: z.ZodOptional<z.ZodObject<{
|
|
74
|
+
maxValueCents: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
askAboveValueCents: z.ZodOptional<z.ZodNumber>;
|
|
76
|
+
merchantAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
77
|
+
categoryAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
78
|
+
recurrence: z.ZodOptional<z.ZodEnum<{
|
|
79
|
+
never: "never";
|
|
80
|
+
allowed: "allowed";
|
|
81
|
+
}>>;
|
|
82
|
+
budgetIds: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "BudgetId", "out">>>;
|
|
83
|
+
}, z.core.$strict>>;
|
|
84
|
+
expiresAtEpochMs: z.ZodNumber;
|
|
85
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
86
|
+
}, z.core.$strict>>;
|
|
87
|
+
}, z.core.$strict>;
|
|
88
|
+
export type AgentDelegateParametersV1 = z.infer<typeof AgentDelegateParametersV1Schema>;
|
|
89
|
+
export type DelegatedEdgeV1 = z.infer<typeof DelegatedEdgeSchema>;
|
|
90
|
+
export declare const AgentTerminateParametersV1Schema: z.ZodObject<{
|
|
91
|
+
schema: z.ZodLiteral<"odingard.guardian.agent.terminate.v1">;
|
|
92
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
93
|
+
childAgentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
94
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
95
|
+
}, z.core.$strict>;
|
|
96
|
+
export type AgentTerminateParametersV1 = z.infer<typeof AgentTerminateParametersV1Schema>;
|
|
97
|
+
export declare const MemoryReadParametersV1Schema: z.ZodObject<{
|
|
98
|
+
schema: z.ZodLiteral<"odingard.guardian.memory.read.v1">;
|
|
99
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
100
|
+
key: z.ZodString;
|
|
101
|
+
}, z.core.$strict>;
|
|
102
|
+
export type MemoryReadParametersV1 = z.infer<typeof MemoryReadParametersV1Schema>;
|
|
103
|
+
export declare const MemoryWriteParametersV1Schema: z.ZodObject<{
|
|
104
|
+
schema: z.ZodLiteral<"odingard.guardian.memory.write.v1">;
|
|
105
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
106
|
+
key: z.ZodString;
|
|
107
|
+
content: z.ZodString;
|
|
108
|
+
}, z.core.$strict>;
|
|
109
|
+
export type MemoryWriteParametersV1 = z.infer<typeof MemoryWriteParametersV1Schema>;
|
|
110
|
+
export declare const MemoryModifyParametersV1Schema: z.ZodObject<{
|
|
111
|
+
schema: z.ZodLiteral<"odingard.guardian.memory.modify.v1">;
|
|
112
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
113
|
+
key: z.ZodString;
|
|
114
|
+
content: z.ZodString;
|
|
115
|
+
}, z.core.$strict>;
|
|
116
|
+
export type MemoryModifyParametersV1 = z.infer<typeof MemoryModifyParametersV1Schema>;
|
|
117
|
+
export declare const MemoryDeleteParametersV1Schema: z.ZodObject<{
|
|
118
|
+
schema: z.ZodLiteral<"odingard.guardian.memory.delete.v1">;
|
|
119
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
120
|
+
key: z.ZodString;
|
|
121
|
+
}, z.core.$strict>;
|
|
122
|
+
export type MemoryDeleteParametersV1 = z.infer<typeof MemoryDeleteParametersV1Schema>;
|
|
123
|
+
export declare const MemoryShareParametersV1Schema: z.ZodObject<{
|
|
124
|
+
schema: z.ZodLiteral<"odingard.guardian.memory.share.v1">;
|
|
125
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
126
|
+
key: z.ZodString;
|
|
127
|
+
audience: z.ZodEnum<{
|
|
128
|
+
principal: "principal";
|
|
129
|
+
}>;
|
|
130
|
+
}, z.core.$strict>;
|
|
131
|
+
export type MemoryShareParametersV1 = z.infer<typeof MemoryShareParametersV1Schema>;
|
|
132
|
+
export declare const PasswordChangeParametersV1Schema: z.ZodObject<{
|
|
133
|
+
schema: z.ZodLiteral<"odingard.guardian.password.change.v1">;
|
|
134
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
135
|
+
rotationId: z.ZodString;
|
|
136
|
+
}, z.core.$strict>;
|
|
137
|
+
export type PasswordChangeParametersV1 = z.infer<typeof PasswordChangeParametersV1Schema>;
|
|
138
|
+
export declare const MfaChangeParametersV1Schema: z.ZodObject<{
|
|
139
|
+
schema: z.ZodLiteral<"odingard.guardian.mfa.change.v1">;
|
|
140
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
141
|
+
mode: z.ZodEnum<{
|
|
142
|
+
enable: "enable";
|
|
143
|
+
disable: "disable";
|
|
144
|
+
rotate: "rotate";
|
|
145
|
+
}>;
|
|
146
|
+
}, z.core.$strict>;
|
|
147
|
+
export type MfaChangeParametersV1 = z.infer<typeof MfaChangeParametersV1Schema>;
|
|
148
|
+
export declare const RecoveryChangeParametersV1Schema: z.ZodObject<{
|
|
149
|
+
schema: z.ZodLiteral<"odingard.guardian.recovery.change.v1">;
|
|
150
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
151
|
+
channel: z.ZodEnum<{
|
|
152
|
+
none: "none";
|
|
153
|
+
email: "email";
|
|
154
|
+
}>;
|
|
155
|
+
}, z.core.$strict>;
|
|
156
|
+
export type RecoveryChangeParametersV1 = z.infer<typeof RecoveryChangeParametersV1Schema>;
|
|
157
|
+
export declare const TrustedDeviceAddParametersV1Schema: z.ZodObject<{
|
|
158
|
+
schema: z.ZodLiteral<"odingard.guardian.trusted_device.add.v1">;
|
|
159
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
160
|
+
deviceFingerprint: z.ZodString;
|
|
161
|
+
label: z.ZodString;
|
|
162
|
+
}, z.core.$strict>;
|
|
163
|
+
export type TrustedDeviceAddParametersV1 = z.infer<typeof TrustedDeviceAddParametersV1Schema>;
|
|
164
|
+
export declare const ApiKeyCreateParametersV1Schema: z.ZodObject<{
|
|
165
|
+
schema: z.ZodLiteral<"odingard.guardian.api_key.create.v1">;
|
|
166
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
167
|
+
label: z.ZodString;
|
|
168
|
+
scopes: z.ZodArray<z.ZodString>;
|
|
169
|
+
}, z.core.$strict>;
|
|
170
|
+
export type ApiKeyCreateParametersV1 = z.infer<typeof ApiKeyCreateParametersV1Schema>;
|
|
171
|
+
export declare const RuntimeChangeParametersV1Schema: z.ZodObject<{
|
|
172
|
+
schema: z.ZodLiteral<"odingard.guardian.runtime.change.v1">;
|
|
173
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
174
|
+
runtime: z.ZodString;
|
|
175
|
+
}, z.core.$strict>;
|
|
176
|
+
export type RuntimeChangeParametersV1 = z.infer<typeof RuntimeChangeParametersV1Schema>;
|
|
177
|
+
export declare const ModelChangeParametersV1Schema: z.ZodObject<{
|
|
178
|
+
schema: z.ZodLiteral<"odingard.guardian.model.change.v1">;
|
|
179
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
180
|
+
model: z.ZodString;
|
|
181
|
+
}, z.core.$strict>;
|
|
182
|
+
export type ModelChangeParametersV1 = z.infer<typeof ModelChangeParametersV1Schema>;
|
|
183
|
+
export declare const AgentConfigureParametersV1Schema: z.ZodObject<{
|
|
184
|
+
schema: z.ZodLiteral<"odingard.guardian.agent.configure.v1">;
|
|
185
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
186
|
+
key: z.ZodString;
|
|
187
|
+
value: z.ZodString;
|
|
188
|
+
}, z.core.$strict>;
|
|
189
|
+
export type AgentConfigureParametersV1 = z.infer<typeof AgentConfigureParametersV1Schema>;
|
|
190
|
+
export declare const AgentMessageParametersV1Schema: z.ZodObject<{
|
|
191
|
+
schema: z.ZodLiteral<"odingard.guardian.agent.message.v1">;
|
|
192
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
193
|
+
toAgentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
194
|
+
payload: z.ZodString;
|
|
195
|
+
}, z.core.$strict>;
|
|
196
|
+
export type AgentMessageParametersV1 = z.infer<typeof AgentMessageParametersV1Schema>;
|
|
197
|
+
export declare const AgentShareContextParametersV1Schema: z.ZodObject<{
|
|
198
|
+
schema: z.ZodLiteral<"odingard.guardian.agent.share_context.v1">;
|
|
199
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
200
|
+
toAgentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
201
|
+
contextRef: z.ZodString;
|
|
202
|
+
}, z.core.$strict>;
|
|
203
|
+
export type AgentShareContextParametersV1 = z.infer<typeof AgentShareContextParametersV1Schema>;
|
|
204
|
+
export declare const AgentShareMemoryParametersV1Schema: z.ZodObject<{
|
|
205
|
+
schema: z.ZodLiteral<"odingard.guardian.agent.share_memory.v1">;
|
|
206
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
207
|
+
toAgentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
208
|
+
memoryRef: z.ZodString;
|
|
209
|
+
}, z.core.$strict>;
|
|
210
|
+
export type AgentShareMemoryParametersV1 = z.infer<typeof AgentShareMemoryParametersV1Schema>;
|
|
211
|
+
export declare const AgentTransferTaskParametersV1Schema: z.ZodObject<{
|
|
212
|
+
schema: z.ZodLiteral<"odingard.guardian.agent.transfer_task.v1">;
|
|
213
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
214
|
+
toAgentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
215
|
+
taskId: z.core.$ZodBranded<z.ZodString, "TaskId", "out">;
|
|
216
|
+
}, z.core.$strict>;
|
|
217
|
+
export type AgentTransferTaskParametersV1 = z.infer<typeof AgentTransferTaskParametersV1Schema>;
|
|
218
|
+
export declare const AgentTransferCapabilityParametersV1Schema: z.ZodObject<{
|
|
219
|
+
schema: z.ZodLiteral<"odingard.guardian.agent.transfer_capability.v1">;
|
|
220
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
221
|
+
toAgentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
222
|
+
capabilityRef: z.ZodObject<{
|
|
223
|
+
capabilityId: z.core.$ZodBranded<z.ZodString, "CapabilityId", "out">;
|
|
224
|
+
requestId: z.core.$ZodBranded<z.ZodString, "RequestId", "out">;
|
|
225
|
+
}, z.core.$strict>;
|
|
226
|
+
}, z.core.$strict>;
|
|
227
|
+
export type AgentTransferCapabilityParametersV1 = z.infer<typeof AgentTransferCapabilityParametersV1Schema>;
|
|
228
|
+
export declare const AGENT_STATE_PARAMETERS_KINDS: {
|
|
229
|
+
readonly "agent.spawn": "odingard.guardian.agent.spawn.v1";
|
|
230
|
+
readonly "agent.delegate": "odingard.guardian.agent.delegate.v1";
|
|
231
|
+
readonly "agent.terminate": "odingard.guardian.agent.terminate.v1";
|
|
232
|
+
readonly "agent.message": "odingard.guardian.agent.message.v1";
|
|
233
|
+
readonly "agent.share_context": "odingard.guardian.agent.share_context.v1";
|
|
234
|
+
readonly "agent.share_memory": "odingard.guardian.agent.share_memory.v1";
|
|
235
|
+
readonly "agent.transfer_task": "odingard.guardian.agent.transfer_task.v1";
|
|
236
|
+
readonly "agent.transfer_capability": "odingard.guardian.agent.transfer_capability.v1";
|
|
237
|
+
readonly "memory.read": "odingard.guardian.memory.read.v1";
|
|
238
|
+
readonly "memory.write": "odingard.guardian.memory.write.v1";
|
|
239
|
+
readonly "memory.modify": "odingard.guardian.memory.modify.v1";
|
|
240
|
+
readonly "memory.delete": "odingard.guardian.memory.delete.v1";
|
|
241
|
+
readonly "memory.share": "odingard.guardian.memory.share.v1";
|
|
242
|
+
readonly "password.change": "odingard.guardian.password.change.v1";
|
|
243
|
+
readonly "mfa.change": "odingard.guardian.mfa.change.v1";
|
|
244
|
+
readonly "recovery.change": "odingard.guardian.recovery.change.v1";
|
|
245
|
+
readonly "trusted_device.add": "odingard.guardian.trusted_device.add.v1";
|
|
246
|
+
readonly "api_key.create": "odingard.guardian.api_key.create.v1";
|
|
247
|
+
readonly "runtime.change": "odingard.guardian.runtime.change.v1";
|
|
248
|
+
readonly "model.change": "odingard.guardian.model.change.v1";
|
|
249
|
+
readonly "agent.configure": "odingard.guardian.agent.configure.v1";
|
|
250
|
+
};
|
|
251
|
+
export type AgentStateActionId = keyof typeof AGENT_STATE_PARAMETERS_KINDS;
|
|
252
|
+
/** Schema registry used by the adapter's parse + the connector's codec. */
|
|
253
|
+
export declare const AGENT_STATE_PARAMETER_SCHEMAS: {
|
|
254
|
+
readonly "agent.spawn": z.ZodObject<{
|
|
255
|
+
schema: z.ZodLiteral<"odingard.guardian.agent.spawn.v1">;
|
|
256
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
257
|
+
name: z.ZodString;
|
|
258
|
+
runtime: z.ZodOptional<z.ZodString>;
|
|
259
|
+
model: z.ZodOptional<z.ZodString>;
|
|
260
|
+
}, z.core.$strict>;
|
|
261
|
+
readonly "agent.delegate": z.ZodObject<{
|
|
262
|
+
schema: z.ZodLiteral<"odingard.guardian.agent.delegate.v1">;
|
|
263
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
264
|
+
childAgentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
265
|
+
delegations: z.ZodArray<z.ZodObject<{
|
|
266
|
+
targetConnectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
267
|
+
mode: z.ZodEnum<{
|
|
268
|
+
allow: "allow";
|
|
269
|
+
ask: "ask";
|
|
270
|
+
}>;
|
|
271
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
272
|
+
constraints: z.ZodOptional<z.ZodObject<{
|
|
273
|
+
maxValueCents: z.ZodOptional<z.ZodNumber>;
|
|
274
|
+
askAboveValueCents: z.ZodOptional<z.ZodNumber>;
|
|
275
|
+
merchantAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
276
|
+
categoryAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
277
|
+
recurrence: z.ZodOptional<z.ZodEnum<{
|
|
278
|
+
never: "never";
|
|
279
|
+
allowed: "allowed";
|
|
280
|
+
}>>;
|
|
281
|
+
budgetIds: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "BudgetId", "out">>>;
|
|
282
|
+
}, z.core.$strict>>;
|
|
283
|
+
expiresAtEpochMs: z.ZodNumber;
|
|
284
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
285
|
+
}, z.core.$strict>>;
|
|
286
|
+
}, z.core.$strict>;
|
|
287
|
+
readonly "agent.terminate": z.ZodObject<{
|
|
288
|
+
schema: z.ZodLiteral<"odingard.guardian.agent.terminate.v1">;
|
|
289
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
290
|
+
childAgentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
291
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
292
|
+
}, z.core.$strict>;
|
|
293
|
+
readonly "memory.read": z.ZodObject<{
|
|
294
|
+
schema: z.ZodLiteral<"odingard.guardian.memory.read.v1">;
|
|
295
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
296
|
+
key: z.ZodString;
|
|
297
|
+
}, z.core.$strict>;
|
|
298
|
+
readonly "memory.write": z.ZodObject<{
|
|
299
|
+
schema: z.ZodLiteral<"odingard.guardian.memory.write.v1">;
|
|
300
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
301
|
+
key: z.ZodString;
|
|
302
|
+
content: z.ZodString;
|
|
303
|
+
}, z.core.$strict>;
|
|
304
|
+
readonly "memory.modify": z.ZodObject<{
|
|
305
|
+
schema: z.ZodLiteral<"odingard.guardian.memory.modify.v1">;
|
|
306
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
307
|
+
key: z.ZodString;
|
|
308
|
+
content: z.ZodString;
|
|
309
|
+
}, z.core.$strict>;
|
|
310
|
+
readonly "memory.delete": z.ZodObject<{
|
|
311
|
+
schema: z.ZodLiteral<"odingard.guardian.memory.delete.v1">;
|
|
312
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
313
|
+
key: z.ZodString;
|
|
314
|
+
}, z.core.$strict>;
|
|
315
|
+
readonly "memory.share": z.ZodObject<{
|
|
316
|
+
schema: z.ZodLiteral<"odingard.guardian.memory.share.v1">;
|
|
317
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
318
|
+
key: z.ZodString;
|
|
319
|
+
audience: z.ZodEnum<{
|
|
320
|
+
principal: "principal";
|
|
321
|
+
}>;
|
|
322
|
+
}, z.core.$strict>;
|
|
323
|
+
readonly "password.change": z.ZodObject<{
|
|
324
|
+
schema: z.ZodLiteral<"odingard.guardian.password.change.v1">;
|
|
325
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
326
|
+
rotationId: z.ZodString;
|
|
327
|
+
}, z.core.$strict>;
|
|
328
|
+
readonly "mfa.change": z.ZodObject<{
|
|
329
|
+
schema: z.ZodLiteral<"odingard.guardian.mfa.change.v1">;
|
|
330
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
331
|
+
mode: z.ZodEnum<{
|
|
332
|
+
enable: "enable";
|
|
333
|
+
disable: "disable";
|
|
334
|
+
rotate: "rotate";
|
|
335
|
+
}>;
|
|
336
|
+
}, z.core.$strict>;
|
|
337
|
+
readonly "recovery.change": z.ZodObject<{
|
|
338
|
+
schema: z.ZodLiteral<"odingard.guardian.recovery.change.v1">;
|
|
339
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
340
|
+
channel: z.ZodEnum<{
|
|
341
|
+
none: "none";
|
|
342
|
+
email: "email";
|
|
343
|
+
}>;
|
|
344
|
+
}, z.core.$strict>;
|
|
345
|
+
readonly "trusted_device.add": z.ZodObject<{
|
|
346
|
+
schema: z.ZodLiteral<"odingard.guardian.trusted_device.add.v1">;
|
|
347
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
348
|
+
deviceFingerprint: z.ZodString;
|
|
349
|
+
label: z.ZodString;
|
|
350
|
+
}, z.core.$strict>;
|
|
351
|
+
readonly "api_key.create": z.ZodObject<{
|
|
352
|
+
schema: z.ZodLiteral<"odingard.guardian.api_key.create.v1">;
|
|
353
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
354
|
+
label: z.ZodString;
|
|
355
|
+
scopes: z.ZodArray<z.ZodString>;
|
|
356
|
+
}, z.core.$strict>;
|
|
357
|
+
readonly "runtime.change": z.ZodObject<{
|
|
358
|
+
schema: z.ZodLiteral<"odingard.guardian.runtime.change.v1">;
|
|
359
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
360
|
+
runtime: z.ZodString;
|
|
361
|
+
}, z.core.$strict>;
|
|
362
|
+
readonly "model.change": z.ZodObject<{
|
|
363
|
+
schema: z.ZodLiteral<"odingard.guardian.model.change.v1">;
|
|
364
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
365
|
+
model: z.ZodString;
|
|
366
|
+
}, z.core.$strict>;
|
|
367
|
+
readonly "agent.configure": z.ZodObject<{
|
|
368
|
+
schema: z.ZodLiteral<"odingard.guardian.agent.configure.v1">;
|
|
369
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
370
|
+
key: z.ZodString;
|
|
371
|
+
value: z.ZodString;
|
|
372
|
+
}, z.core.$strict>;
|
|
373
|
+
};
|
|
374
|
+
/**
|
|
375
|
+
* WO-025: the subset of agent-state actions wired into the adapter's
|
|
376
|
+
* parse/commit path (the agent-to-agent actions are registered + governed
|
|
377
|
+
* at the gateway but not wired here).
|
|
378
|
+
*/
|
|
379
|
+
export type AgentStateWiredActionId = keyof typeof AGENT_STATE_PARAMETER_SCHEMAS;
|
|
380
|
+
/** Canonical verification projection: digest-bound action + material facts. */
|
|
381
|
+
export declare function agentStateProjection(action: AgentStateActionId, params: {
|
|
382
|
+
connectionId: string;
|
|
383
|
+
} & Record<string, unknown>): unknown;
|
|
384
|
+
/** Deterministic plan digest for the adapter's bounded plan store. */
|
|
385
|
+
export declare function agentStateCallDigest(action: AgentStateActionId, params: unknown): string;
|
|
386
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ApiRequestMethodSchema: z.ZodEnum<{
|
|
3
|
+
GET: "GET";
|
|
4
|
+
HEAD: "HEAD";
|
|
5
|
+
POST: "POST";
|
|
6
|
+
PUT: "PUT";
|
|
7
|
+
PATCH: "PATCH";
|
|
8
|
+
DELETE: "DELETE";
|
|
9
|
+
}>;
|
|
10
|
+
export type ApiRequestMethod = z.infer<typeof ApiRequestMethodSchema>;
|
|
11
|
+
export declare const API_REQUEST_BODY_MAX_LENGTH = 16384;
|
|
12
|
+
export declare const API_REQUEST_MAX_HEADERS = 32;
|
|
13
|
+
export declare const API_RESPONSE_BODY_CAPTURE_MAX_BYTES: number;
|
|
14
|
+
export declare const API_RESPONSE_BODY_PREVIEW_MAX_LENGTH = 256;
|
|
15
|
+
export declare const API_ENDPOINT_ALLOWLIST_MAX_ENTRIES = 64;
|
|
16
|
+
export declare function isSafeApiHeaderValue(value: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Canonicalizes an https request URL. Returns null when the URL is not a
|
|
19
|
+
* plain https absolute URL (userinfo, fragments, non-default ports left
|
|
20
|
+
* unnormalized are rejected or normalized here). Query parameters are
|
|
21
|
+
* sorted so two submissions of the same request canonicalize identically.
|
|
22
|
+
*/
|
|
23
|
+
export declare function canonicalizeApiRequestUrl(value: string): string | null;
|
|
24
|
+
export declare const ApiRequestUrlSchema: z.ZodString;
|
|
25
|
+
export declare const ApiRequestHeaderSchema: z.ZodObject<{
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
value: z.ZodString;
|
|
28
|
+
}, z.core.$strict>;
|
|
29
|
+
export declare const ApiRequestParametersV1Schema: z.ZodObject<{
|
|
30
|
+
schema: z.ZodLiteral<"odingard.guardian.api.request.v1">;
|
|
31
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
32
|
+
method: z.ZodEnum<{
|
|
33
|
+
GET: "GET";
|
|
34
|
+
HEAD: "HEAD";
|
|
35
|
+
POST: "POST";
|
|
36
|
+
PUT: "PUT";
|
|
37
|
+
PATCH: "PATCH";
|
|
38
|
+
DELETE: "DELETE";
|
|
39
|
+
}>;
|
|
40
|
+
url: z.ZodString;
|
|
41
|
+
headers: z.ZodArray<z.ZodObject<{
|
|
42
|
+
name: z.ZodString;
|
|
43
|
+
value: z.ZodString;
|
|
44
|
+
}, z.core.$strict>>;
|
|
45
|
+
body: z.ZodOptional<z.ZodString>;
|
|
46
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$strict>;
|
|
48
|
+
export type ApiRequestParametersV1 = z.infer<typeof ApiRequestParametersV1Schema>;
|
|
49
|
+
export declare function apiVerificationProjection(input: ApiRequestParametersV1): Readonly<{
|
|
50
|
+
domain: "odingard.guardian.api-projection.v1";
|
|
51
|
+
connectionId: string & z.core.$brand<"ConnectionId">;
|
|
52
|
+
method: "GET" | "HEAD" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
53
|
+
url: string;
|
|
54
|
+
headersDigest: string;
|
|
55
|
+
bodyDigest: string | null;
|
|
56
|
+
idempotencyKey: string | null;
|
|
57
|
+
}>;
|
|
58
|
+
/**
|
|
59
|
+
* api.request has a single verification level: the envelope and the content
|
|
60
|
+
* projection are the same canonical request. The post-commit envelope digest
|
|
61
|
+
* therefore equals the projection digest.
|
|
62
|
+
*/
|
|
63
|
+
export declare function apiEnvelopeProjection(input: ApiRequestParametersV1): Readonly<{
|
|
64
|
+
domain: "odingard.guardian.api-projection.v1";
|
|
65
|
+
connectionId: string & z.core.$brand<"ConnectionId">;
|
|
66
|
+
method: "GET" | "HEAD" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
67
|
+
url: string;
|
|
68
|
+
headersDigest: string;
|
|
69
|
+
bodyDigest: string | null;
|
|
70
|
+
idempotencyKey: string | null;
|
|
71
|
+
}>;
|
|
72
|
+
export declare function isSafeAllowlistEntry(value: string): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Fail-closed allowlist match: the request URL must equal an allowlist entry
|
|
75
|
+
* or extend it at a path boundary. Entries are canonical https URL prefixes
|
|
76
|
+
* such as "https://api.github.com/repos/odingard/".
|
|
77
|
+
*/
|
|
78
|
+
export declare function apiEndpointWithinAllowlist(canonicalUrl: string, allowlist: readonly string[]): boolean;
|