@oxy.so/contracts 2.1.0 → 3.0.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 (57) hide show
  1. package/dist/cjs/.tsbuildinfo +1 -1
  2. package/dist/cjs/accountEmail.js +79 -0
  3. package/dist/cjs/deviceBoot.js +2 -2
  4. package/dist/cjs/deviceSession.js +73 -16
  5. package/dist/cjs/identity.js +1 -3
  6. package/dist/cjs/identityLink.js +92 -0
  7. package/dist/cjs/identityProof.js +6 -29
  8. package/dist/cjs/index.js +82 -65
  9. package/dist/cjs/reputation.js +10 -55
  10. package/dist/cjs/signIn.js +304 -0
  11. package/dist/esm/.tsbuildinfo +1 -1
  12. package/dist/esm/accountEmail.js +76 -0
  13. package/dist/esm/deviceBoot.js +2 -2
  14. package/dist/esm/deviceSession.js +72 -15
  15. package/dist/esm/identity.js +1 -3
  16. package/dist/esm/identityLink.js +87 -0
  17. package/dist/esm/identityProof.js +6 -29
  18. package/dist/esm/index.js +13 -16
  19. package/dist/esm/reputation.js +9 -54
  20. package/dist/esm/signIn.js +299 -0
  21. package/dist/types/.tsbuildinfo +1 -1
  22. package/dist/types/accountEmail.d.ts +90 -0
  23. package/dist/types/agency.d.ts +2 -2
  24. package/dist/types/deviceBoot.d.ts +2 -2
  25. package/dist/types/deviceSession.d.ts +131 -19
  26. package/dist/types/externalIdentity.d.ts +4 -4
  27. package/dist/types/identity.d.ts +4 -8
  28. package/dist/types/identityLink.d.ts +146 -0
  29. package/dist/types/identityProof.d.ts +15 -42
  30. package/dist/types/index.d.ts +10 -12
  31. package/dist/types/inference/accountBilling.d.ts +2 -2
  32. package/dist/types/inference/embeddings.d.ts +16 -16
  33. package/dist/types/inference/entitlement.d.ts +2 -2
  34. package/dist/types/inference/errors.d.ts +8 -8
  35. package/dist/types/inference/inbox.d.ts +8 -8
  36. package/dist/types/inference/providerConnection.d.ts +20 -20
  37. package/dist/types/inference/request.d.ts +16 -16
  38. package/dist/types/inference/streamEvents.d.ts +20 -20
  39. package/dist/types/keyRecovery.d.ts +4 -4
  40. package/dist/types/oauth.d.ts +16 -16
  41. package/dist/types/reputation.d.ts +32 -127
  42. package/dist/types/sessionStatus.d.ts +2 -2
  43. package/dist/types/signIn.d.ts +717 -0
  44. package/dist/types/userResponse.d.ts +2 -2
  45. package/package.json +1 -1
  46. package/dist/cjs/identityMove.js +0 -156
  47. package/dist/cjs/identityRecovery.js +0 -51
  48. package/dist/cjs/webIdentityCarrier.js +0 -181
  49. package/dist/cjs/webauthn.js +0 -85
  50. package/dist/esm/identityMove.js +0 -148
  51. package/dist/esm/identityRecovery.js +0 -48
  52. package/dist/esm/webIdentityCarrier.js +0 -178
  53. package/dist/esm/webauthn.js +0 -82
  54. package/dist/types/identityMove.d.ts +0 -185
  55. package/dist/types/identityRecovery.d.ts +0 -246
  56. package/dist/types/webIdentityCarrier.d.ts +0 -1130
  57. package/dist/types/webauthn.d.ts +0 -285
@@ -1,246 +0,0 @@
1
- /**
2
- * Signed-out recovery contract (ADR 0024 D5) — get an EXISTING account back from
3
- * its root alone, with no passkey, session or email.
4
- *
5
- * 1. `POST /identity/recovery/challenge` → a one-use challenge. It says nothing
6
- * about any account.
7
- * 2. The holder derives the root locally from recovery material (12/24 words or a
8
- * raw key) and signs `recover_account_start` over that challenge:
9
- * `POST /identity/recovery/start { publicKey, proof }`. Only a valid proof
10
- * learns which account the root belongs to; the response carries passkey
11
- * registration options for THAT account and a short-lived ticket.
12
- * 3. The holder creates the passkey, seals the root under it (PRF), and signs
13
- * `recover_account_complete` over the registration challenge and the envelope
14
- * digest: `POST /identity/recovery/complete`. The passkey, the envelope and a
15
- * session are created in one transaction.
16
- *
17
- * The recovery material and the root never leave the holder. Platform-agnostic —
18
- * zod only, ESM-safe.
19
- */
20
- import { z } from 'zod';
21
- /** A recovery attempt lives this long between steps. */
22
- export declare const IDENTITY_RECOVERY_TTL_MS: number;
23
- export interface IdentityRecoveryChallengeResponse {
24
- /** 32 bytes, lowercase hex. */
25
- challenge: string;
26
- /** Unix milliseconds. */
27
- expiresAt: number;
28
- }
29
- export declare const identityRecoveryChallengeResponseSchema: z.ZodType<IdentityRecoveryChallengeResponse>;
30
- export declare const identityRecoveryStartRequestSchema: z.ZodObject<{
31
- publicKey: z.ZodString;
32
- /** `recover_account_start`, subject `root:<publicKey>`, actor `anonymous`. */
33
- proof: z.ZodObject<{
34
- v: z.ZodLiteral<2>;
35
- challenge: z.ZodString;
36
- expiresAt: z.ZodNumber;
37
- signature: z.ZodString;
38
- }, "strip", z.ZodTypeAny, {
39
- expiresAt: number;
40
- signature: string;
41
- v: 2;
42
- challenge: string;
43
- }, {
44
- expiresAt: number;
45
- signature: string;
46
- v: 2;
47
- challenge: string;
48
- }>;
49
- }, "strict", z.ZodTypeAny, {
50
- publicKey: string;
51
- proof: {
52
- expiresAt: number;
53
- signature: string;
54
- v: 2;
55
- challenge: string;
56
- };
57
- }, {
58
- publicKey: string;
59
- proof: {
60
- expiresAt: number;
61
- signature: string;
62
- v: 2;
63
- challenge: string;
64
- };
65
- }>;
66
- export type IdentityRecoveryStartRequest = z.infer<typeof identityRecoveryStartRequestSchema>;
67
- export interface IdentityRecoveryStartResponse {
68
- /** Opaque, one-use; presented once to `complete`. */
69
- ticket: string;
70
- accountId: string;
71
- username: string | null;
72
- /** `PublicKeyCredentialCreationOptionsJSON` for the account's new passkey. */
73
- registrationOptions: Record<string, unknown>;
74
- /** Unix milliseconds. */
75
- expiresAt: number;
76
- }
77
- export declare const identityRecoveryCompleteRequestSchema: z.ZodObject<{
78
- ticket: z.ZodString;
79
- /** The browser `RegistrationResponseJSON`, verified by the API's WebAuthn library. */
80
- response: z.ZodRecord<z.ZodString, z.ZodUnknown>;
81
- /** The root sealed under the new passkey — exactly one wrap, for that credential. */
82
- envelope: z.ZodEffects<z.ZodObject<{
83
- version: z.ZodLiteral<2>;
84
- algorithm: z.ZodLiteral<"xchacha20poly1305">;
85
- publicKey: z.ZodString;
86
- secretKind: z.ZodEnum<["mnemonic-entropy", "raw-private-key"]>;
87
- secretNonce: z.ZodString;
88
- sealedSecret: z.ZodString;
89
- wraps: z.ZodArray<z.ZodObject<{
90
- credentialId: z.ZodString;
91
- nonce: z.ZodString;
92
- wrappedKey: z.ZodString;
93
- createdAt: z.ZodString;
94
- rpId: z.ZodString;
95
- verifiedAt: z.ZodOptional<z.ZodString>;
96
- }, "strip", z.ZodTypeAny, {
97
- credentialId: string;
98
- createdAt: string;
99
- nonce: string;
100
- wrappedKey: string;
101
- rpId: string;
102
- verifiedAt?: string | undefined;
103
- }, {
104
- credentialId: string;
105
- createdAt: string;
106
- nonce: string;
107
- wrappedKey: string;
108
- rpId: string;
109
- verifiedAt?: string | undefined;
110
- }>, "many">;
111
- }, "strip", z.ZodTypeAny, {
112
- version: 2;
113
- publicKey: string;
114
- algorithm: "xchacha20poly1305";
115
- secretKind: "mnemonic-entropy" | "raw-private-key";
116
- secretNonce: string;
117
- sealedSecret: string;
118
- wraps: {
119
- credentialId: string;
120
- createdAt: string;
121
- nonce: string;
122
- wrappedKey: string;
123
- rpId: string;
124
- verifiedAt?: string | undefined;
125
- }[];
126
- }, {
127
- version: 2;
128
- publicKey: string;
129
- algorithm: "xchacha20poly1305";
130
- secretKind: "mnemonic-entropy" | "raw-private-key";
131
- secretNonce: string;
132
- sealedSecret: string;
133
- wraps: {
134
- credentialId: string;
135
- createdAt: string;
136
- nonce: string;
137
- wrappedKey: string;
138
- rpId: string;
139
- verifiedAt?: string | undefined;
140
- }[];
141
- }>, {
142
- version: 2;
143
- publicKey: string;
144
- algorithm: "xchacha20poly1305";
145
- secretKind: "mnemonic-entropy" | "raw-private-key";
146
- secretNonce: string;
147
- sealedSecret: string;
148
- wraps: {
149
- credentialId: string;
150
- createdAt: string;
151
- nonce: string;
152
- wrappedKey: string;
153
- rpId: string;
154
- verifiedAt?: string | undefined;
155
- }[];
156
- }, {
157
- version: 2;
158
- publicKey: string;
159
- algorithm: "xchacha20poly1305";
160
- secretKind: "mnemonic-entropy" | "raw-private-key";
161
- secretNonce: string;
162
- sealedSecret: string;
163
- wraps: {
164
- credentialId: string;
165
- createdAt: string;
166
- nonce: string;
167
- wrappedKey: string;
168
- rpId: string;
169
- verifiedAt?: string | undefined;
170
- }[];
171
- }>;
172
- /** `recover_account_complete`, subject = account id, actor `credential:<id>`, challenge = registration challenge (hex). */
173
- proof: z.ZodObject<{
174
- v: z.ZodLiteral<2>;
175
- challenge: z.ZodString;
176
- expiresAt: z.ZodNumber;
177
- signature: z.ZodString;
178
- }, "strip", z.ZodTypeAny, {
179
- expiresAt: number;
180
- signature: string;
181
- v: 2;
182
- challenge: string;
183
- }, {
184
- expiresAt: number;
185
- signature: string;
186
- v: 2;
187
- challenge: string;
188
- }>;
189
- deviceName: z.ZodOptional<z.ZodString>;
190
- deviceFingerprint: z.ZodOptional<z.ZodString>;
191
- }, "strict", z.ZodTypeAny, {
192
- proof: {
193
- expiresAt: number;
194
- signature: string;
195
- v: 2;
196
- challenge: string;
197
- };
198
- envelope: {
199
- version: 2;
200
- publicKey: string;
201
- algorithm: "xchacha20poly1305";
202
- secretKind: "mnemonic-entropy" | "raw-private-key";
203
- secretNonce: string;
204
- sealedSecret: string;
205
- wraps: {
206
- credentialId: string;
207
- createdAt: string;
208
- nonce: string;
209
- wrappedKey: string;
210
- rpId: string;
211
- verifiedAt?: string | undefined;
212
- }[];
213
- };
214
- response: Record<string, unknown>;
215
- ticket: string;
216
- deviceName?: string | undefined;
217
- deviceFingerprint?: string | undefined;
218
- }, {
219
- proof: {
220
- expiresAt: number;
221
- signature: string;
222
- v: 2;
223
- challenge: string;
224
- };
225
- envelope: {
226
- version: 2;
227
- publicKey: string;
228
- algorithm: "xchacha20poly1305";
229
- secretKind: "mnemonic-entropy" | "raw-private-key";
230
- secretNonce: string;
231
- sealedSecret: string;
232
- wraps: {
233
- credentialId: string;
234
- createdAt: string;
235
- nonce: string;
236
- wrappedKey: string;
237
- rpId: string;
238
- verifiedAt?: string | undefined;
239
- }[];
240
- };
241
- response: Record<string, unknown>;
242
- ticket: string;
243
- deviceName?: string | undefined;
244
- deviceFingerprint?: string | undefined;
245
- }>;
246
- export type IdentityRecoveryCompleteRequest = z.infer<typeof identityRecoveryCompleteRequestSchema>;