@kya-os/consent 0.2.1 → 0.2.3

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 (132) hide show
  1. package/README.md +128 -0
  2. package/dist/bundle/index.d.ts +38 -36
  3. package/dist/bundle/index.d.ts.map +1 -1
  4. package/dist/bundle/index.js +35 -33
  5. package/dist/bundle/index.js.map +1 -1
  6. package/dist/bundle/inline.d.ts.map +1 -1
  7. package/dist/bundle/inline.js +4 -4
  8. package/dist/bundle/inline.js.map +1 -1
  9. package/dist/bundle/shell.d.ts +7 -0
  10. package/dist/bundle/shell.d.ts.map +1 -1
  11. package/dist/bundle/shell.js +5 -0
  12. package/dist/bundle/shell.js.map +1 -1
  13. package/dist/cjs/bundle/index.js +4 -1
  14. package/dist/cjs/bundle/index.js.map +1 -1
  15. package/dist/cjs/bundle/inline.js +4 -4
  16. package/dist/cjs/bundle/inline.js.map +1 -1
  17. package/dist/cjs/bundle/shell.js +5 -0
  18. package/dist/cjs/bundle/shell.js.map +1 -1
  19. package/dist/cjs/components/consent-agent-header.js +15 -9
  20. package/dist/cjs/components/consent-agent-header.js.map +1 -1
  21. package/dist/cjs/components/consent-capabilities-screen.js +40 -78
  22. package/dist/cjs/components/consent-capabilities-screen.js.map +1 -1
  23. package/dist/cjs/components/consent-headline.js +138 -0
  24. package/dist/cjs/components/consent-headline.js.map +1 -0
  25. package/dist/cjs/components/consent-otp-input.js +35 -18
  26. package/dist/cjs/components/consent-otp-input.js.map +1 -1
  27. package/dist/cjs/components/index.js +3 -1
  28. package/dist/cjs/components/index.js.map +1 -1
  29. package/dist/cjs/components/mcp-consent.js +42 -1
  30. package/dist/cjs/components/mcp-consent.js.map +1 -1
  31. package/dist/cjs/copy/tokens.js +16 -1
  32. package/dist/cjs/copy/tokens.js.map +1 -1
  33. package/dist/cjs/identity/agent-identity.js +314 -0
  34. package/dist/cjs/identity/agent-identity.js.map +1 -0
  35. package/dist/cjs/identity/documents.js +212 -0
  36. package/dist/cjs/identity/documents.js.map +1 -0
  37. package/dist/cjs/identity/entity-card.js +128 -0
  38. package/dist/cjs/identity/entity-card.js.map +1 -0
  39. package/dist/cjs/identity/index.js +31 -0
  40. package/dist/cjs/identity/index.js.map +1 -0
  41. package/dist/cjs/identity/resolve.js +122 -0
  42. package/dist/cjs/identity/resolve.js.map +1 -0
  43. package/dist/cjs/identity/schemas.js +88 -0
  44. package/dist/cjs/identity/schemas.js.map +1 -0
  45. package/dist/cjs/index.js +3 -1
  46. package/dist/cjs/index.js.map +1 -1
  47. package/dist/cjs/mcp-app/inline.js +2 -2
  48. package/dist/cjs/mcp-app/inline.js.map +1 -1
  49. package/dist/cjs/mcp-app/types.js +1 -1
  50. package/dist/cjs/popup/launcher.js +3 -3
  51. package/dist/cjs/react/index.js +141 -25
  52. package/dist/cjs/react/index.js.map +1 -1
  53. package/dist/cjs/templates/index.js +1 -1
  54. package/dist/cjs/types/index.js +1 -1
  55. package/dist/components/consent-agent-header.d.ts +3 -1
  56. package/dist/components/consent-agent-header.d.ts.map +1 -1
  57. package/dist/components/consent-agent-header.js +15 -9
  58. package/dist/components/consent-agent-header.js.map +1 -1
  59. package/dist/components/consent-capabilities-screen.d.ts +13 -3
  60. package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
  61. package/dist/components/consent-capabilities-screen.js +40 -78
  62. package/dist/components/consent-capabilities-screen.js.map +1 -1
  63. package/dist/components/consent-headline.d.ts +42 -0
  64. package/dist/components/consent-headline.d.ts.map +1 -0
  65. package/dist/components/consent-headline.js +135 -0
  66. package/dist/components/consent-headline.js.map +1 -0
  67. package/dist/components/consent-otp-input.d.ts +7 -2
  68. package/dist/components/consent-otp-input.d.ts.map +1 -1
  69. package/dist/components/consent-otp-input.js +35 -18
  70. package/dist/components/consent-otp-input.js.map +1 -1
  71. package/dist/components/index.d.ts +18 -17
  72. package/dist/components/index.d.ts.map +1 -1
  73. package/dist/components/index.js +18 -17
  74. package/dist/components/index.js.map +1 -1
  75. package/dist/components/mcp-consent.d.ts +16 -0
  76. package/dist/components/mcp-consent.d.ts.map +1 -1
  77. package/dist/components/mcp-consent.js +42 -1
  78. package/dist/components/mcp-consent.js.map +1 -1
  79. package/dist/consent.js +493 -100
  80. package/dist/consent.min.js +244 -232
  81. package/dist/copy/tokens.d.ts +16 -1
  82. package/dist/copy/tokens.d.ts.map +1 -1
  83. package/dist/copy/tokens.js +16 -1
  84. package/dist/copy/tokens.js.map +1 -1
  85. package/dist/identity/agent-identity.d.ts +199 -0
  86. package/dist/identity/agent-identity.d.ts.map +1 -0
  87. package/dist/identity/agent-identity.js +305 -0
  88. package/dist/identity/agent-identity.js.map +1 -0
  89. package/dist/identity/documents.d.ts +63 -0
  90. package/dist/identity/documents.d.ts.map +1 -0
  91. package/dist/identity/documents.js +206 -0
  92. package/dist/identity/documents.js.map +1 -0
  93. package/dist/identity/entity-card.d.ts +80 -0
  94. package/dist/identity/entity-card.d.ts.map +1 -0
  95. package/dist/identity/entity-card.js +119 -0
  96. package/dist/identity/entity-card.js.map +1 -0
  97. package/dist/identity/index.d.ts +15 -0
  98. package/dist/identity/index.d.ts.map +1 -0
  99. package/dist/identity/index.js +15 -0
  100. package/dist/identity/index.js.map +1 -0
  101. package/dist/identity/resolve.d.ts +31 -0
  102. package/dist/identity/resolve.d.ts.map +1 -0
  103. package/dist/identity/resolve.js +119 -0
  104. package/dist/identity/resolve.js.map +1 -0
  105. package/dist/identity/schemas.d.ts +404 -0
  106. package/dist/identity/schemas.d.ts.map +1 -0
  107. package/dist/identity/schemas.js +84 -0
  108. package/dist/identity/schemas.js.map +1 -0
  109. package/dist/index.d.ts +2 -1
  110. package/dist/index.d.ts.map +1 -1
  111. package/dist/index.js +3 -1
  112. package/dist/index.js.map +1 -1
  113. package/dist/kya-os/index.d.ts +55 -0
  114. package/dist/kya-os/index.d.ts.map +1 -0
  115. package/dist/kya-os/index.js +235 -0
  116. package/dist/kya-os/index.js.map +1 -0
  117. package/dist/mcp-app/inline.d.ts.map +1 -1
  118. package/dist/mcp-app/inline.js +2 -2
  119. package/dist/mcp-app/inline.js.map +1 -1
  120. package/dist/mcp-app/types.d.ts +1 -1
  121. package/dist/mcp-app/types.js +1 -1
  122. package/dist/popup/launcher.d.ts +3 -3
  123. package/dist/popup/launcher.js +3 -3
  124. package/dist/react/index.d.ts +108 -22
  125. package/dist/react/index.d.ts.map +1 -1
  126. package/dist/react/index.js +151 -35
  127. package/dist/react/index.js.map +1 -1
  128. package/dist/templates/index.d.ts +1 -1
  129. package/dist/templates/index.js +1 -1
  130. package/dist/types/index.d.ts +1 -1
  131. package/dist/types/index.js +1 -1
  132. package/package.json +41 -6
@@ -0,0 +1,404 @@
1
+ /**
2
+ * The zod schemas for agent identity, for hosts.
3
+ *
4
+ * Kept apart from the modules the components import, so the browser bundle
5
+ * stays free of zod. The screen reads an identity with the lighter check in
6
+ * `./agent-identity.ts`; a host validates the whole identity here, before it
7
+ * renders the page.
8
+ *
9
+ * @module identity/schemas
10
+ */
11
+ import { z } from "zod";
12
+ import { type AgentIdentity } from "./agent-identity.js";
13
+ /**
14
+ * Validates the Entity Card fields the consent screen reads and keeps every
15
+ * other field, so a full KYA-OS card round-trips.
16
+ */
17
+ export declare const ConsentEntityCardSchema: z.ZodObject<{
18
+ id: z.ZodString;
19
+ entityType: z.ZodEnum<["mcp", "agent", "client", "verifier", "human"]>;
20
+ name: z.ZodEffects<z.ZodString, string, string>;
21
+ responsibleParty: z.ZodOptional<z.ZodString>;
22
+ principal: z.ZodOptional<z.ZodString>;
23
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
24
+ name: z.ZodString;
25
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
26
+ name: z.ZodString;
27
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
28
+ name: z.ZodString;
29
+ }, z.ZodTypeAny, "passthrough">>]>, "many">>;
30
+ delegationRef: z.ZodOptional<z.ZodString>;
31
+ cimd: z.ZodOptional<z.ZodObject<{
32
+ clientId: z.ZodString;
33
+ jwksUri: z.ZodString;
34
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
35
+ clientId: z.ZodString;
36
+ jwksUri: z.ZodString;
37
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
38
+ clientId: z.ZodString;
39
+ jwksUri: z.ZodString;
40
+ }, z.ZodTypeAny, "passthrough">>>;
41
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
42
+ id: z.ZodString;
43
+ entityType: z.ZodEnum<["mcp", "agent", "client", "verifier", "human"]>;
44
+ name: z.ZodEffects<z.ZodString, string, string>;
45
+ responsibleParty: z.ZodOptional<z.ZodString>;
46
+ principal: z.ZodOptional<z.ZodString>;
47
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
48
+ name: z.ZodString;
49
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
50
+ name: z.ZodString;
51
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
52
+ name: z.ZodString;
53
+ }, z.ZodTypeAny, "passthrough">>]>, "many">>;
54
+ delegationRef: z.ZodOptional<z.ZodString>;
55
+ cimd: z.ZodOptional<z.ZodObject<{
56
+ clientId: z.ZodString;
57
+ jwksUri: z.ZodString;
58
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
59
+ clientId: z.ZodString;
60
+ jwksUri: z.ZodString;
61
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
62
+ clientId: z.ZodString;
63
+ jwksUri: z.ZodString;
64
+ }, z.ZodTypeAny, "passthrough">>>;
65
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
66
+ id: z.ZodString;
67
+ entityType: z.ZodEnum<["mcp", "agent", "client", "verifier", "human"]>;
68
+ name: z.ZodEffects<z.ZodString, string, string>;
69
+ responsibleParty: z.ZodOptional<z.ZodString>;
70
+ principal: z.ZodOptional<z.ZodString>;
71
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
72
+ name: z.ZodString;
73
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
74
+ name: z.ZodString;
75
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
76
+ name: z.ZodString;
77
+ }, z.ZodTypeAny, "passthrough">>]>, "many">>;
78
+ delegationRef: z.ZodOptional<z.ZodString>;
79
+ cimd: z.ZodOptional<z.ZodObject<{
80
+ clientId: z.ZodString;
81
+ jwksUri: z.ZodString;
82
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
83
+ clientId: z.ZodString;
84
+ jwksUri: z.ZodString;
85
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
86
+ clientId: z.ZodString;
87
+ jwksUri: z.ZodString;
88
+ }, z.ZodTypeAny, "passthrough">>>;
89
+ }, z.ZodTypeAny, "passthrough">>;
90
+ export declare const AgentIdentityVerificationSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
91
+ verifier: z.ZodOptional<z.ZodString>;
92
+ checkedAt: z.ZodOptional<z.ZodString>;
93
+ status: z.ZodLiteral<"verified">;
94
+ did: z.ZodString;
95
+ method: z.ZodEnum<["holder-proof", "cimd-key"]>;
96
+ conformanceLevel: z.ZodOptional<z.ZodEnum<["L1", "L2", "L3"]>>;
97
+ }, "strip", z.ZodTypeAny, {
98
+ did: string;
99
+ status: "verified";
100
+ method: "holder-proof" | "cimd-key";
101
+ verifier?: string | undefined;
102
+ conformanceLevel?: "L1" | "L2" | "L3" | undefined;
103
+ checkedAt?: string | undefined;
104
+ }, {
105
+ did: string;
106
+ status: "verified";
107
+ method: "holder-proof" | "cimd-key";
108
+ verifier?: string | undefined;
109
+ conformanceLevel?: "L1" | "L2" | "L3" | undefined;
110
+ checkedAt?: string | undefined;
111
+ }>, z.ZodObject<{
112
+ verifier: z.ZodOptional<z.ZodString>;
113
+ checkedAt: z.ZodOptional<z.ZodString>;
114
+ status: z.ZodLiteral<"domain">;
115
+ domain: z.ZodString;
116
+ }, "strip", z.ZodTypeAny, {
117
+ domain: string;
118
+ status: "domain";
119
+ verifier?: string | undefined;
120
+ checkedAt?: string | undefined;
121
+ }, {
122
+ domain: string;
123
+ status: "domain";
124
+ verifier?: string | undefined;
125
+ checkedAt?: string | undefined;
126
+ }>, z.ZodObject<{
127
+ verifier: z.ZodOptional<z.ZodString>;
128
+ checkedAt: z.ZodOptional<z.ZodString>;
129
+ status: z.ZodLiteral<"unverified">;
130
+ reason: z.ZodOptional<z.ZodString>;
131
+ }, "strip", z.ZodTypeAny, {
132
+ status: "unverified";
133
+ verifier?: string | undefined;
134
+ checkedAt?: string | undefined;
135
+ reason?: string | undefined;
136
+ }, {
137
+ status: "unverified";
138
+ verifier?: string | undefined;
139
+ checkedAt?: string | undefined;
140
+ reason?: string | undefined;
141
+ }>]>;
142
+ /** Validates an `AgentIdentity`, with the limits `AgentMetadata` sets. */
143
+ export declare const AgentIdentitySchema: z.ZodObject<{
144
+ card: z.ZodEffects<z.ZodObject<{
145
+ id: z.ZodString;
146
+ entityType: z.ZodEnum<["mcp", "agent", "client", "verifier", "human"]>;
147
+ name: z.ZodEffects<z.ZodString, string, string>;
148
+ responsibleParty: z.ZodOptional<z.ZodString>;
149
+ principal: z.ZodOptional<z.ZodString>;
150
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
151
+ name: z.ZodString;
152
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
153
+ name: z.ZodString;
154
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
155
+ name: z.ZodString;
156
+ }, z.ZodTypeAny, "passthrough">>]>, "many">>;
157
+ delegationRef: z.ZodOptional<z.ZodString>;
158
+ cimd: z.ZodOptional<z.ZodObject<{
159
+ clientId: z.ZodString;
160
+ jwksUri: z.ZodString;
161
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
162
+ clientId: z.ZodString;
163
+ jwksUri: z.ZodString;
164
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
165
+ clientId: z.ZodString;
166
+ jwksUri: z.ZodString;
167
+ }, z.ZodTypeAny, "passthrough">>>;
168
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
169
+ id: z.ZodString;
170
+ entityType: z.ZodEnum<["mcp", "agent", "client", "verifier", "human"]>;
171
+ name: z.ZodEffects<z.ZodString, string, string>;
172
+ responsibleParty: z.ZodOptional<z.ZodString>;
173
+ principal: z.ZodOptional<z.ZodString>;
174
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
175
+ name: z.ZodString;
176
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
177
+ name: z.ZodString;
178
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
179
+ name: z.ZodString;
180
+ }, z.ZodTypeAny, "passthrough">>]>, "many">>;
181
+ delegationRef: z.ZodOptional<z.ZodString>;
182
+ cimd: z.ZodOptional<z.ZodObject<{
183
+ clientId: z.ZodString;
184
+ jwksUri: z.ZodString;
185
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
186
+ clientId: z.ZodString;
187
+ jwksUri: z.ZodString;
188
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
189
+ clientId: z.ZodString;
190
+ jwksUri: z.ZodString;
191
+ }, z.ZodTypeAny, "passthrough">>>;
192
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
193
+ id: z.ZodString;
194
+ entityType: z.ZodEnum<["mcp", "agent", "client", "verifier", "human"]>;
195
+ name: z.ZodEffects<z.ZodString, string, string>;
196
+ responsibleParty: z.ZodOptional<z.ZodString>;
197
+ principal: z.ZodOptional<z.ZodString>;
198
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
199
+ name: z.ZodString;
200
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
201
+ name: z.ZodString;
202
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
203
+ name: z.ZodString;
204
+ }, z.ZodTypeAny, "passthrough">>]>, "many">>;
205
+ delegationRef: z.ZodOptional<z.ZodString>;
206
+ cimd: z.ZodOptional<z.ZodObject<{
207
+ clientId: z.ZodString;
208
+ jwksUri: z.ZodString;
209
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
210
+ clientId: z.ZodString;
211
+ jwksUri: z.ZodString;
212
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
213
+ clientId: z.ZodString;
214
+ jwksUri: z.ZodString;
215
+ }, z.ZodTypeAny, "passthrough">>>;
216
+ }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
217
+ id: z.ZodString;
218
+ entityType: z.ZodEnum<["mcp", "agent", "client", "verifier", "human"]>;
219
+ name: z.ZodEffects<z.ZodString, string, string>;
220
+ responsibleParty: z.ZodOptional<z.ZodString>;
221
+ principal: z.ZodOptional<z.ZodString>;
222
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
223
+ name: z.ZodString;
224
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
225
+ name: z.ZodString;
226
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
227
+ name: z.ZodString;
228
+ }, z.ZodTypeAny, "passthrough">>]>, "many">>;
229
+ delegationRef: z.ZodOptional<z.ZodString>;
230
+ cimd: z.ZodOptional<z.ZodObject<{
231
+ clientId: z.ZodString;
232
+ jwksUri: z.ZodString;
233
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
234
+ clientId: z.ZodString;
235
+ jwksUri: z.ZodString;
236
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
237
+ clientId: z.ZodString;
238
+ jwksUri: z.ZodString;
239
+ }, z.ZodTypeAny, "passthrough">>>;
240
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
241
+ id: z.ZodString;
242
+ entityType: z.ZodEnum<["mcp", "agent", "client", "verifier", "human"]>;
243
+ name: z.ZodEffects<z.ZodString, string, string>;
244
+ responsibleParty: z.ZodOptional<z.ZodString>;
245
+ principal: z.ZodOptional<z.ZodString>;
246
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
247
+ name: z.ZodString;
248
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
249
+ name: z.ZodString;
250
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
251
+ name: z.ZodString;
252
+ }, z.ZodTypeAny, "passthrough">>]>, "many">>;
253
+ delegationRef: z.ZodOptional<z.ZodString>;
254
+ cimd: z.ZodOptional<z.ZodObject<{
255
+ clientId: z.ZodString;
256
+ jwksUri: z.ZodString;
257
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
258
+ clientId: z.ZodString;
259
+ jwksUri: z.ZodString;
260
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
261
+ clientId: z.ZodString;
262
+ jwksUri: z.ZodString;
263
+ }, z.ZodTypeAny, "passthrough">>>;
264
+ }, z.ZodTypeAny, "passthrough">>;
265
+ verification: z.ZodOptional<z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
266
+ verifier: z.ZodOptional<z.ZodString>;
267
+ checkedAt: z.ZodOptional<z.ZodString>;
268
+ status: z.ZodLiteral<"verified">;
269
+ did: z.ZodString;
270
+ method: z.ZodEnum<["holder-proof", "cimd-key"]>;
271
+ conformanceLevel: z.ZodOptional<z.ZodEnum<["L1", "L2", "L3"]>>;
272
+ }, "strip", z.ZodTypeAny, {
273
+ did: string;
274
+ status: "verified";
275
+ method: "holder-proof" | "cimd-key";
276
+ verifier?: string | undefined;
277
+ conformanceLevel?: "L1" | "L2" | "L3" | undefined;
278
+ checkedAt?: string | undefined;
279
+ }, {
280
+ did: string;
281
+ status: "verified";
282
+ method: "holder-proof" | "cimd-key";
283
+ verifier?: string | undefined;
284
+ conformanceLevel?: "L1" | "L2" | "L3" | undefined;
285
+ checkedAt?: string | undefined;
286
+ }>, z.ZodObject<{
287
+ verifier: z.ZodOptional<z.ZodString>;
288
+ checkedAt: z.ZodOptional<z.ZodString>;
289
+ status: z.ZodLiteral<"domain">;
290
+ domain: z.ZodString;
291
+ }, "strip", z.ZodTypeAny, {
292
+ domain: string;
293
+ status: "domain";
294
+ verifier?: string | undefined;
295
+ checkedAt?: string | undefined;
296
+ }, {
297
+ domain: string;
298
+ status: "domain";
299
+ verifier?: string | undefined;
300
+ checkedAt?: string | undefined;
301
+ }>, z.ZodObject<{
302
+ verifier: z.ZodOptional<z.ZodString>;
303
+ checkedAt: z.ZodOptional<z.ZodString>;
304
+ status: z.ZodLiteral<"unverified">;
305
+ reason: z.ZodOptional<z.ZodString>;
306
+ }, "strip", z.ZodTypeAny, {
307
+ status: "unverified";
308
+ verifier?: string | undefined;
309
+ checkedAt?: string | undefined;
310
+ reason?: string | undefined;
311
+ }, {
312
+ status: "unverified";
313
+ verifier?: string | undefined;
314
+ checkedAt?: string | undefined;
315
+ reason?: string | undefined;
316
+ }>]>>;
317
+ vendor: z.ZodOptional<z.ZodString>;
318
+ surfaceLabel: z.ZodOptional<z.ZodString>;
319
+ logoUrl: z.ZodOptional<z.ZodString>;
320
+ connectedAt: z.ZodOptional<z.ZodString>;
321
+ }, "strip", z.ZodTypeAny, {
322
+ card: {
323
+ name: string;
324
+ id: string;
325
+ entityType: "mcp" | "agent" | "client" | "verifier" | "human";
326
+ capabilities?: (string | z.objectOutputType<{
327
+ name: z.ZodString;
328
+ }, z.ZodTypeAny, "passthrough">)[] | undefined;
329
+ responsibleParty?: string | undefined;
330
+ principal?: string | undefined;
331
+ delegationRef?: string | undefined;
332
+ cimd?: z.objectOutputType<{
333
+ clientId: z.ZodString;
334
+ jwksUri: z.ZodString;
335
+ }, z.ZodTypeAny, "passthrough"> | undefined;
336
+ } & {
337
+ [k: string]: unknown;
338
+ };
339
+ verification?: {
340
+ did: string;
341
+ status: "verified";
342
+ method: "holder-proof" | "cimd-key";
343
+ verifier?: string | undefined;
344
+ conformanceLevel?: "L1" | "L2" | "L3" | undefined;
345
+ checkedAt?: string | undefined;
346
+ } | {
347
+ domain: string;
348
+ status: "domain";
349
+ verifier?: string | undefined;
350
+ checkedAt?: string | undefined;
351
+ } | {
352
+ status: "unverified";
353
+ verifier?: string | undefined;
354
+ checkedAt?: string | undefined;
355
+ reason?: string | undefined;
356
+ } | undefined;
357
+ connectedAt?: string | undefined;
358
+ vendor?: string | undefined;
359
+ surfaceLabel?: string | undefined;
360
+ logoUrl?: string | undefined;
361
+ }, {
362
+ card: {
363
+ name: string;
364
+ id: string;
365
+ entityType: "mcp" | "agent" | "client" | "verifier" | "human";
366
+ capabilities?: (string | z.objectInputType<{
367
+ name: z.ZodString;
368
+ }, z.ZodTypeAny, "passthrough">)[] | undefined;
369
+ responsibleParty?: string | undefined;
370
+ principal?: string | undefined;
371
+ delegationRef?: string | undefined;
372
+ cimd?: z.objectInputType<{
373
+ clientId: z.ZodString;
374
+ jwksUri: z.ZodString;
375
+ }, z.ZodTypeAny, "passthrough"> | undefined;
376
+ } & {
377
+ [k: string]: unknown;
378
+ };
379
+ verification?: {
380
+ did: string;
381
+ status: "verified";
382
+ method: "holder-proof" | "cimd-key";
383
+ verifier?: string | undefined;
384
+ conformanceLevel?: "L1" | "L2" | "L3" | undefined;
385
+ checkedAt?: string | undefined;
386
+ } | {
387
+ domain: string;
388
+ status: "domain";
389
+ verifier?: string | undefined;
390
+ checkedAt?: string | undefined;
391
+ } | {
392
+ status: "unverified";
393
+ verifier?: string | undefined;
394
+ checkedAt?: string | undefined;
395
+ reason?: string | undefined;
396
+ } | undefined;
397
+ connectedAt?: string | undefined;
398
+ vendor?: string | undefined;
399
+ surfaceLabel?: string | undefined;
400
+ logoUrl?: string | undefined;
401
+ }>;
402
+ /** Validate an `AgentIdentity`. @throws {AgentIdentityError} */
403
+ export declare function parseAgentIdentity(value: unknown): AgentIdentity;
404
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/identity/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAKL,KAAK,aAAa,EACnB,MAAM,qBAAqB,CAAC;AAO7B;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAqBpB,CAAC;AAOjB,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkB1C,CAAC;AAEH,0EAA0E;AAC1E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW9B,CAAC;AAEH,gEAAgE;AAChE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,CAUhE"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * The zod schemas for agent identity, for hosts.
3
+ *
4
+ * Kept apart from the modules the components import, so the browser bundle
5
+ * stays free of zod. The screen reads an identity with the lighter check in
6
+ * `./agent-identity.ts`; a host validates the whole identity here, before it
7
+ * renders the page.
8
+ *
9
+ * @module identity/schemas
10
+ */
11
+ import { z } from "zod";
12
+ import { CONFORMANCE_LEVELS, MAX_DID_LENGTH, MAX_VERIFICATION_REASON, AgentIdentityError, } from "./agent-identity.js";
13
+ import { ENTITY_DID_PATTERN, ENTITY_TYPES } from "./entity-card.js";
14
+ const EntityDidSchema = z
15
+ .string()
16
+ .regex(ENTITY_DID_PATTERN, "Must be a did:key or did:web DID");
17
+ /**
18
+ * Validates the Entity Card fields the consent screen reads and keeps every
19
+ * other field, so a full KYA-OS card round-trips.
20
+ */
21
+ export const ConsentEntityCardSchema = z
22
+ .object({
23
+ id: EntityDidSchema,
24
+ entityType: z.enum(ENTITY_TYPES),
25
+ name: z.string().refine((name) => name.trim().length > 0, "Required"),
26
+ responsibleParty: EntityDidSchema.optional(),
27
+ principal: EntityDidSchema.optional(),
28
+ capabilities: z
29
+ .array(z.union([
30
+ z.string().min(1),
31
+ z.object({ name: z.string().min(1) }).passthrough(),
32
+ ]))
33
+ .optional(),
34
+ delegationRef: z.string().min(1).optional(),
35
+ cimd: z
36
+ .object({ clientId: z.string().min(1), jwksUri: z.string().min(1) })
37
+ .passthrough()
38
+ .optional(),
39
+ })
40
+ .passthrough();
41
+ const VerificationMetaSchema = {
42
+ verifier: z.string().min(1).max(80).optional(),
43
+ checkedAt: z.string().datetime().optional(),
44
+ };
45
+ export const AgentIdentityVerificationSchema = z.discriminatedUnion("status", [
46
+ z.object({
47
+ status: z.literal("verified"),
48
+ did: EntityDidSchema.max(MAX_DID_LENGTH),
49
+ method: z.enum(["holder-proof", "cimd-key"]),
50
+ conformanceLevel: z.enum(CONFORMANCE_LEVELS).optional(),
51
+ ...VerificationMetaSchema,
52
+ }),
53
+ z.object({
54
+ status: z.literal("domain"),
55
+ domain: z.string().min(1).max(260),
56
+ ...VerificationMetaSchema,
57
+ }),
58
+ z.object({
59
+ status: z.literal("unverified"),
60
+ reason: z.string().max(MAX_VERIFICATION_REASON).optional(),
61
+ ...VerificationMetaSchema,
62
+ }),
63
+ ]);
64
+ /** Validates an `AgentIdentity`, with the limits `AgentMetadata` sets. */
65
+ export const AgentIdentitySchema = z.object({
66
+ // A long card name is fine: the tile cuts it to fit.
67
+ card: ConsentEntityCardSchema.refine((card) => card.id.length <= MAX_DID_LENGTH, { message: `A DID is at most ${MAX_DID_LENGTH} characters`, path: ["id"] }),
68
+ verification: AgentIdentityVerificationSchema.optional(),
69
+ vendor: z.string().max(80).optional(),
70
+ surfaceLabel: z.string().max(40).optional(),
71
+ logoUrl: z.string().url().optional(),
72
+ connectedAt: z.string().datetime().optional(),
73
+ });
74
+ /** Validate an `AgentIdentity`. @throws {AgentIdentityError} */
75
+ export function parseAgentIdentity(value) {
76
+ const parsed = AgentIdentitySchema.safeParse(value);
77
+ if (!parsed.success) {
78
+ const issue = parsed.error.issues[0];
79
+ const where = issue?.path.length ? `${issue.path.join(".")}: ` : "";
80
+ throw new AgentIdentityError(`agentIdentity: ${where}${issue?.message ?? "invalid"}`);
81
+ }
82
+ return parsed.data;
83
+ }
84
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/identity/schemas.ts"],"names":[],"mappings":"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"}
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * @kya-os/consent
3
3
  *
4
4
  * Canonical consent page types, styles, defaults, and utilities.
5
- * Single source of truth for both MCP-I runtime rendering and Checkpoint WYSIWYG preview.
5
+ * Single source of truth for both server-side rendering and the dashboard WYSIWYG preview.
6
6
  *
7
7
  * @module @kya-os/consent
8
8
  */
@@ -20,4 +20,5 @@ export * from "./capabilities/index.js";
20
20
  export * from "./cedar/index.js";
21
21
  export * from "./copy/index.js";
22
22
  export * from "./popup/index.js";
23
+ export * from "./identity/index.js";
23
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,cAAc,kBAAkB,CAAC;AAGjC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,sBAAsB,CAAC;AAGrC,OAAO,EACL,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAG7D,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAG5B,cAAc,yBAAyB,CAAC;AAGxC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,cAAc,kBAAkB,CAAC;AAGjC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,sBAAsB,CAAC;AAGrC,OAAO,EACL,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAG7D,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAG5B,cAAc,yBAAyB,CAAC;AAGxC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * @kya-os/consent
3
3
  *
4
4
  * Canonical consent page types, styles, defaults, and utilities.
5
- * Single source of truth for both MCP-I runtime rendering and Checkpoint WYSIWYG preview.
5
+ * Single source of truth for both server-side rendering and the dashboard WYSIWYG preview.
6
6
  *
7
7
  * @module @kya-os/consent
8
8
  */
@@ -33,4 +33,6 @@ export * from "./cedar/index.js";
33
33
  export * from "./copy/index.js";
34
34
  // Re-export popup launcher (consumed by runtime adapters)
35
35
  export * from "./popup/index.js";
36
+ // Re-export agent identity in the KYA-OS Entity Card shape
37
+ export * from "./identity/index.js";
36
38
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,sBAAsB;AACtB,2EAA2E;AAC3E,cAAc,kBAAkB,CAAC;AAEjC,wBAAwB;AACxB,cAAc,oBAAoB,CAAC;AAEnC,0BAA0B;AAC1B,cAAc,sBAAsB,CAAC;AAErC,uBAAuB;AACvB,cAAc,mBAAmB,CAAC;AAElC,qCAAqC;AACrC,cAAc,uBAAuB,CAAC;AAEtC,mCAAmC;AACnC,cAAc,qBAAqB,CAAC;AAEpC,0BAA0B;AAC1B,cAAc,sBAAsB,CAAC;AAErC,2DAA2D;AAC3D,OAAO,EACL,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC;AAG3B,iEAAiE;AACjE,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAE5B,gCAAgC;AAChC,cAAc,yBAAyB,CAAC;AAExC,4DAA4D;AAC5D,cAAc,kBAAkB,CAAC;AAEjC,wCAAwC;AACxC,cAAc,iBAAiB,CAAC;AAEhC,0DAA0D;AAC1D,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,sBAAsB;AACtB,2EAA2E;AAC3E,cAAc,kBAAkB,CAAC;AAEjC,wBAAwB;AACxB,cAAc,oBAAoB,CAAC;AAEnC,0BAA0B;AAC1B,cAAc,sBAAsB,CAAC;AAErC,uBAAuB;AACvB,cAAc,mBAAmB,CAAC;AAElC,qCAAqC;AACrC,cAAc,uBAAuB,CAAC;AAEtC,mCAAmC;AACnC,cAAc,qBAAqB,CAAC;AAEpC,0BAA0B;AAC1B,cAAc,sBAAsB,CAAC;AAErC,2DAA2D;AAC3D,OAAO,EACL,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC;AAG3B,iEAAiE;AACjE,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAE5B,gCAAgC;AAChC,cAAc,yBAAyB,CAAC;AAExC,4DAA4D;AAC5D,cAAc,kBAAkB,CAAC;AAEjC,wCAAwC;AACxC,cAAc,iBAAiB,CAAC;AAEhC,0DAA0D;AAC1D,cAAc,kBAAkB,CAAC;AAEjC,2DAA2D;AAC3D,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * The KYA-OS verifier for agent identities: the reference
3
+ * `AgentIdentityVerifier`, built on `@kya-os/mcp/card`.
4
+ *
5
+ * It says `verified` only when all of these hold:
6
+ *
7
+ * 1. The card is a `did:web` card, resolved from the DID's own DID document
8
+ * (`resolveCard`), never taken from the presented document. A `did:key`
9
+ * card has no home, so its name is whatever its maker wrote; it is never
10
+ * verified here.
11
+ * 2. `verifyCard` passes: not revoked, and every accountability or
12
+ * attestation claim the card makes holds.
13
+ * 3. The requester proved it holds the card's key for this request: a
14
+ * holder-of-key proof signed by a key the DID document publishes,
15
+ * addressed to `audience` and never seen before, or a CIMD client the
16
+ * authorization server authenticated with `private_key_jwt`, when that
17
+ * client is the card's own (the same `client_id` and `jwks_uri` as
18
+ * `card.cimd`) and its CIMD document is bound to the DID
19
+ * (`verifyCimdBind`).
20
+ *
21
+ * A card is public, so presenting one proves nothing on its own: without
22
+ * step 3 the result is at most `domain`, when the host fetched the document
23
+ * from the card's own domain.
24
+ *
25
+ * Needs the optional peer dependency `@kya-os/mcp`. Runs on the server.
26
+ *
27
+ * @module @kya-os/consent/kya-os
28
+ */
29
+ import { type ConsumeNonceIfFresh, type SafeFetch, type VerifyCardDeps } from "@kya-os/mcp/card";
30
+ import { type AgentIdentityVerifier } from "../identity/agent-identity.js";
31
+ /** The `verifyCard` checks a host can add, on top of the key proof. */
32
+ export type KyaOsCardChecks = Pick<VerifyCardDeps, "capabilityVerifier" | "attestationVerifier" | "accountabilityVerifier" | "statusListChecker" | "trustedIssuers">;
33
+ export interface KyaOsAgentVerifierOptions {
34
+ /**
35
+ * Fetches DID documents and cards. Use `createSafeFetch()` from
36
+ * `@kya-os/mcp/card`: it refuses private and loopback addresses.
37
+ */
38
+ fetch: SafeFetch;
39
+ /** This host's DID. A holder-of-key proof must be addressed to it. */
40
+ audience: string;
41
+ /**
42
+ * Records each proof nonce and refuses a replay, such as
43
+ * `new InMemoryNonceCache().consume` from `@kya-os/mcp/card`.
44
+ */
45
+ consumeNonceIfFresh: ConsumeNonceIfFresh;
46
+ /** Extra card checks: capability attestations, accountability, revocation. */
47
+ checks?: KyaOsCardChecks;
48
+ /** Names this verifier in its results. Defaults to `kya-os`. */
49
+ name?: string;
50
+ /** Clock in epoch milliseconds, for tests. */
51
+ now?: () => number;
52
+ }
53
+ /** The reference KYA-OS `AgentIdentityVerifier`. */
54
+ export declare function createKyaOsAgentVerifier(options: KyaOsAgentVerifierOptions): AgentIdentityVerifier;
55
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/kya-os/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAOL,KAAK,mBAAmB,EAExB,KAAK,SAAS,EACd,KAAK,cAAc,EAEpB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAIL,KAAK,qBAAqB,EAI3B,MAAM,+BAA+B,CAAC;AAOvC,uEAAuE;AACvE,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,cAAc,EACZ,oBAAoB,GACpB,qBAAqB,GACrB,wBAAwB,GACxB,mBAAmB,GACnB,gBAAgB,CACnB,CAAC;AAEF,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,8EAA8E;IAC9E,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAED,oDAAoD;AACpD,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,yBAAyB,GACjC,qBAAqB,CAoIvB"}