@oxy.so/contracts 4.11.0-oxy-one.0 → 4.11.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/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/accountGraph.js +5 -3
- package/dist/cjs/agency.js +178 -96
- package/dist/cjs/agentKeys.js +80 -26
- package/dist/cjs/capabilityBindings.js +2 -2
- package/dist/cjs/capabilityInvocation.js +3 -1
- package/dist/cjs/commonsSignIn.js +2 -2
- package/dist/cjs/deviceSession.js +5 -1
- package/dist/cjs/email/messages.js +70 -4
- package/dist/cjs/emailAgentContext.js +16 -8
- package/dist/cjs/externalIdentity.js +30 -12
- package/dist/cjs/identity.js +14 -6
- package/dist/cjs/identityLink.js +7 -2
- package/dist/cjs/identityProof.js +2 -1
- package/dist/cjs/index.js +5 -3
- package/dist/cjs/inference/catalogue.js +2 -12
- package/dist/cjs/inference/decisions.js +102 -83
- package/dist/cjs/inference/economics.js +15 -5
- package/dist/cjs/inference/embeddings.js +44 -6
- package/dist/cjs/inference/inbox.js +33 -2
- package/dist/cjs/inference/providerConnection.js +21 -6
- package/dist/cjs/inference/realtime.js +114 -107
- package/dist/cjs/inference/scopedExecution.js +12 -12
- package/dist/cjs/inference/usage.js +2 -9
- package/dist/cjs/notifications.js +25 -5
- package/dist/cjs/oauth.js +30 -14
- package/dist/cjs/oxyRecordTypes.js +2 -2
- package/dist/cjs/products/access.js +146 -57
- package/dist/cjs/products/billing.js +71 -17
- package/dist/cjs/products/checkout.js +24 -6
- package/dist/cjs/products/plans.js +22 -7
- package/dist/cjs/recommendations.js +4 -6
- package/dist/cjs/reputation.js +3 -6
- package/dist/cjs/sessionStatus.js +1 -6
- package/dist/cjs/signIn.js +17 -4
- package/dist/cjs/transparency.js +3 -1
- package/dist/cjs/updates.js +2 -4
- package/dist/cjs/userResponse.js +27 -7
- package/dist/cjs/username.js +3 -1
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/accountGraph.js +5 -3
- package/dist/esm/agency.js +178 -96
- package/dist/esm/agentKeys.js +80 -26
- package/dist/esm/capabilityBindings.js +2 -2
- package/dist/esm/capabilityInvocation.js +3 -1
- package/dist/esm/commonsSignIn.js +2 -2
- package/dist/esm/deviceSession.js +5 -1
- package/dist/esm/email/messages.js +69 -3
- package/dist/esm/emailAgentContext.js +16 -8
- package/dist/esm/externalIdentity.js +30 -12
- package/dist/esm/identity.js +14 -6
- package/dist/esm/identityLink.js +7 -2
- package/dist/esm/identityProof.js +2 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/inference/aliaModelRelease.js +1 -1
- package/dist/esm/inference/catalogue.js +3 -13
- package/dist/esm/inference/decisions.js +108 -89
- package/dist/esm/inference/economics.js +16 -6
- package/dist/esm/inference/embeddings.js +44 -6
- package/dist/esm/inference/inbox.js +32 -1
- package/dist/esm/inference/providerConnection.js +21 -6
- package/dist/esm/inference/realtime.js +123 -116
- package/dist/esm/inference/scopedExecution.js +15 -15
- package/dist/esm/inference/usage.js +2 -9
- package/dist/esm/notifications.js +25 -5
- package/dist/esm/oauth.js +30 -14
- package/dist/esm/oxyRecordTypes.js +2 -2
- package/dist/esm/products/access.js +146 -57
- package/dist/esm/products/billing.js +71 -17
- package/dist/esm/products/checkout.js +24 -6
- package/dist/esm/products/plans.js +22 -7
- package/dist/esm/recommendations.js +4 -6
- package/dist/esm/reputation.js +3 -6
- package/dist/esm/sessionStatus.js +1 -6
- package/dist/esm/signIn.js +17 -4
- package/dist/esm/transparency.js +3 -1
- package/dist/esm/updates.js +2 -4
- package/dist/esm/userResponse.js +27 -7
- package/dist/esm/username.js +3 -1
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/accountGraph.d.ts +1 -1
- package/dist/types/commonsSignIn.d.ts +2 -2
- package/dist/types/email/messages.d.ts +208 -2
- package/dist/types/identity.d.ts +1 -1
- package/dist/types/index.d.ts +8 -8
- package/dist/types/inference/decisions.d.ts +1 -1
- package/dist/types/inference/inbox.d.ts +129 -5
- package/dist/types/inference/realtime.d.ts +1 -1
- package/dist/types/inference/scopedExecution.d.ts +1 -1
- package/dist/types/moderationReputation.d.ts +1 -1
- package/dist/types/oxyRecordTypes.d.ts +2 -2
- package/dist/types/products/access.d.ts +102 -102
- package/dist/types/products/checkout.d.ts +3 -3
- package/dist/types/products/plans.d.ts +40 -40
- package/dist/types/reputation.d.ts +4 -4
- package/dist/types/updates.d.ts +1 -1
- package/dist/types/userResponse.d.ts +22 -23
- package/package.json +1 -2
|
@@ -31,7 +31,7 @@ function valuesAtPath(input, path) {
|
|
|
31
31
|
return [];
|
|
32
32
|
current = next;
|
|
33
33
|
}
|
|
34
|
-
return current.flatMap((value) => Array.isArray(value) ? value : [value]);
|
|
34
|
+
return current.flatMap((value) => (Array.isArray(value) ? value : [value]));
|
|
35
35
|
}
|
|
36
36
|
/** Enforces the signed per-action bounds before a domain handler runs. */
|
|
37
37
|
export function inputSatisfiesCapabilityLimits(tool, input, limits) {
|
|
@@ -43,7 +43,7 @@ export function inputSatisfiesCapabilityLimits(tool, input, limits) {
|
|
|
43
43
|
return false;
|
|
44
44
|
if (typeof limit.value === 'number') {
|
|
45
45
|
const maximum = limit.value;
|
|
46
|
-
if (!actualValues.every((actual) =>
|
|
46
|
+
if (!actualValues.every((actual) => typeof actual === 'number' && Number.isFinite(actual) && actual <= maximum))
|
|
47
47
|
return false;
|
|
48
48
|
continue;
|
|
49
49
|
}
|
|
@@ -138,7 +138,9 @@ export function matchCatalogInvocation(tools, method, path) {
|
|
|
138
138
|
export function resolveCatalogInvocation(catalog, tool, args) {
|
|
139
139
|
const remaining = { ...args };
|
|
140
140
|
const path = tool.invocation.path.replace(/\{(\w+)\}/g, (_match, parameter) => {
|
|
141
|
-
const value = Object.prototype.hasOwnProperty.call(remaining, parameter)
|
|
141
|
+
const value = Object.prototype.hasOwnProperty.call(remaining, parameter)
|
|
142
|
+
? remaining[parameter]
|
|
143
|
+
: undefined;
|
|
142
144
|
delete remaining[parameter];
|
|
143
145
|
if (value === undefined || value === null || value === '') {
|
|
144
146
|
throw new Error(`Missing required path parameter: ${parameter}`);
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
import { z } from 'zod';
|
|
31
31
|
/**
|
|
32
32
|
* The closed set, as a value — consumed directly where a runtime list is
|
|
33
|
-
* required (e.g. the
|
|
34
|
-
* the storage-level guarantee that an unauthenticated caller can never write
|
|
33
|
+
* required (e.g. the `enum` of the `auth_sessions.denied_reason` column, which
|
|
34
|
+
* is the storage-level guarantee that an unauthenticated caller can never write
|
|
35
35
|
* free-form text into the field).
|
|
36
36
|
*/
|
|
37
37
|
export const COMMONS_DENY_REASONS = ['declined', 'not_me'];
|
|
@@ -211,7 +211,11 @@ export const deviceJoinCodeResponseSchema = z.object({
|
|
|
211
211
|
*/
|
|
212
212
|
export const deviceJoinRequestSchema = z.object({
|
|
213
213
|
code: z.string().min(1).max(256),
|
|
214
|
-
codeVerifier: z
|
|
214
|
+
codeVerifier: z
|
|
215
|
+
.string()
|
|
216
|
+
.min(43)
|
|
217
|
+
.max(128)
|
|
218
|
+
.regex(/^[A-Za-z0-9._~-]+$/),
|
|
215
219
|
clientId: z.string().min(1).max(256),
|
|
216
220
|
redirectUri: z.string().url().max(2048),
|
|
217
221
|
});
|
|
@@ -26,7 +26,13 @@ const isoInstant = z.string().datetime();
|
|
|
26
26
|
/** Structured data cards the AI extractor can emit. */
|
|
27
27
|
export const MESSAGE_CARD_TYPES = ['trip', 'purchase', 'event', 'bill', 'package'];
|
|
28
28
|
/** What a mail-rule condition looks at. */
|
|
29
|
-
export const EMAIL_FILTER_CONDITION_FIELDS = [
|
|
29
|
+
export const EMAIL_FILTER_CONDITION_FIELDS = [
|
|
30
|
+
'from',
|
|
31
|
+
'to',
|
|
32
|
+
'subject',
|
|
33
|
+
'has-attachment',
|
|
34
|
+
'size',
|
|
35
|
+
];
|
|
30
36
|
/** How a mail-rule condition compares. */
|
|
31
37
|
export const EMAIL_FILTER_CONDITION_OPERATORS = [
|
|
32
38
|
'contains',
|
|
@@ -48,7 +54,42 @@ export const EMAIL_FILTER_ACTION_TYPES = [
|
|
|
48
54
|
'forward',
|
|
49
55
|
];
|
|
50
56
|
/** Lifecycle of a durable outbound delivery. */
|
|
51
|
-
export const EMAIL_OUTBOX_STATUSES = [
|
|
57
|
+
export const EMAIL_OUTBOX_STATUSES = [
|
|
58
|
+
'pending',
|
|
59
|
+
'processing',
|
|
60
|
+
'sent',
|
|
61
|
+
'failed',
|
|
62
|
+
'cancelled',
|
|
63
|
+
];
|
|
64
|
+
/**
|
|
65
|
+
* Where a message the user sent stands, as its Sent copy reports it.
|
|
66
|
+
*
|
|
67
|
+
* A send is filed in Sent the moment the API accepts it and handed to the relay
|
|
68
|
+
* afterwards, so being in Sent no longer means having left. `sent` means the
|
|
69
|
+
* relay took it; `retrying` means an attempt failed and another is scheduled;
|
|
70
|
+
* `failed` means nothing more will happen on its own.
|
|
71
|
+
*/
|
|
72
|
+
export const EMAIL_DELIVERY_STATES = ['sending', 'retrying', 'sent', 'failed'];
|
|
73
|
+
/**
|
|
74
|
+
* Why a delivery is retrying or failed, in words a client can translate.
|
|
75
|
+
*
|
|
76
|
+
* - `relay_unavailable`: the relay did not answer or answered 4xx (transient).
|
|
77
|
+
* - `relay_unconfigured`: this server has no relay; an operator must fix it.
|
|
78
|
+
* - `relay_auth`: the relay rejected Oxy's credential; an operator must fix it.
|
|
79
|
+
* - `rejected`: the relay refused this message with a 5xx.
|
|
80
|
+
* - `retries_exhausted`: it stayed `relay_unavailable` for the whole budget.
|
|
81
|
+
* - `bounced`: the relay took it, then a recipient's server refused it.
|
|
82
|
+
* - `cancelled`: the sender stopped it.
|
|
83
|
+
*/
|
|
84
|
+
export const EMAIL_DELIVERY_ERROR_CODES = [
|
|
85
|
+
'relay_unavailable',
|
|
86
|
+
'relay_unconfigured',
|
|
87
|
+
'relay_auth',
|
|
88
|
+
'rejected',
|
|
89
|
+
'retries_exhausted',
|
|
90
|
+
'bounced',
|
|
91
|
+
'cancelled',
|
|
92
|
+
];
|
|
52
93
|
// ─── Messages ───────────────────────────────────────────────────────
|
|
53
94
|
/** One addressee. A header without a display name carries `name: ''`. */
|
|
54
95
|
export const emailMessageAddressSchema = z.object({
|
|
@@ -88,6 +129,22 @@ export const emailMessageHighlightSchema = z.object({
|
|
|
88
129
|
value: z.string(),
|
|
89
130
|
label: z.string(),
|
|
90
131
|
});
|
|
132
|
+
/**
|
|
133
|
+
* The delivery of a message the user sent. `error` is the relay's own words;
|
|
134
|
+
* `errorCode` is the same failure in the vocabulary above, and is `null` when
|
|
135
|
+
* there is nothing to explain — or when a newer server names a reason this
|
|
136
|
+
* client does not know yet, which then still reads as a delivery.
|
|
137
|
+
* `nextAttemptAt` is set only while `retrying`.
|
|
138
|
+
*/
|
|
139
|
+
export const emailMessageDeliverySchema = z.object({
|
|
140
|
+
state: z.enum(EMAIL_DELIVERY_STATES),
|
|
141
|
+
attempts: z.number().int(),
|
|
142
|
+
maxAttempts: z.number().int(),
|
|
143
|
+
nextAttemptAt: isoInstant.nullable(),
|
|
144
|
+
error: z.string().nullable(),
|
|
145
|
+
errorCode: z.enum(EMAIL_DELIVERY_ERROR_CODES).nullable().catch(null),
|
|
146
|
+
updatedAt: isoInstant,
|
|
147
|
+
});
|
|
91
148
|
/**
|
|
92
149
|
* A stored message as every `/email` read returns it.
|
|
93
150
|
*
|
|
@@ -138,6 +195,12 @@ export const emailMessageSchema = z.object({
|
|
|
138
195
|
/** Present only on list reads that walked the thread. */
|
|
139
196
|
threadCount: z.number().int().optional(),
|
|
140
197
|
threadParticipants: z.array(z.string()).optional(),
|
|
198
|
+
/**
|
|
199
|
+
* Present only on a message the user sent through Oxy since delivery was
|
|
200
|
+
* tracked; absent on received mail. A delivery this client cannot read is
|
|
201
|
+
* dropped rather than allowed to drop the message with it.
|
|
202
|
+
*/
|
|
203
|
+
delivery: emailMessageDeliverySchema.optional().catch(undefined),
|
|
141
204
|
});
|
|
142
205
|
// ─── Mailboxes and labels ───────────────────────────────────────────
|
|
143
206
|
export const emailMailboxSchema = z.object({
|
|
@@ -174,7 +237,10 @@ export const emailSystemLabelSchema = z.object({
|
|
|
174
237
|
order: z.number().int(),
|
|
175
238
|
system: z.literal(true),
|
|
176
239
|
});
|
|
177
|
-
export const emailLabelSchema = z.discriminatedUnion('system', [
|
|
240
|
+
export const emailLabelSchema = z.discriminatedUnion('system', [
|
|
241
|
+
emailUserLabelSchema,
|
|
242
|
+
emailSystemLabelSchema,
|
|
243
|
+
]);
|
|
178
244
|
// ─── Rules, bundles, contacts, outbox ───────────────────────────────
|
|
179
245
|
export const emailFilterConditionSchema = z.object({
|
|
180
246
|
field: z.enum(EMAIL_FILTER_CONDITION_FIELDS),
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export const emailContextAddressSchema = z
|
|
2
|
+
export const emailContextAddressSchema = z
|
|
3
|
+
.object({
|
|
3
4
|
name: z.string().optional(),
|
|
4
5
|
address: z.string().email(),
|
|
5
|
-
})
|
|
6
|
-
|
|
6
|
+
})
|
|
7
|
+
.strict();
|
|
8
|
+
export const emailContextMailboxSchema = z
|
|
9
|
+
.object({
|
|
7
10
|
mailboxId: z.string().min(1),
|
|
8
11
|
name: z.string(),
|
|
9
12
|
path: z.string(),
|
|
10
13
|
totalMessages: z.number().int().nonnegative(),
|
|
11
14
|
unseenMessages: z.number().int().nonnegative(),
|
|
12
|
-
})
|
|
13
|
-
|
|
15
|
+
})
|
|
16
|
+
.strict();
|
|
17
|
+
export const emailContextMessageSchema = z
|
|
18
|
+
.object({
|
|
14
19
|
messageId: z.string().min(1),
|
|
15
20
|
mailboxId: z.string().min(1),
|
|
16
21
|
from: emailContextAddressSchema,
|
|
@@ -18,12 +23,15 @@ export const emailContextMessageSchema = z.object({
|
|
|
18
23
|
receivedAt: z.string().datetime(),
|
|
19
24
|
seen: z.boolean(),
|
|
20
25
|
answered: z.boolean(),
|
|
21
|
-
})
|
|
22
|
-
|
|
26
|
+
})
|
|
27
|
+
.strict();
|
|
28
|
+
export const emailAgentContextSchema = z
|
|
29
|
+
.object({
|
|
23
30
|
accountId: z.string().min(1),
|
|
24
31
|
resourceMailboxId: z.string().min(1).nullable(),
|
|
25
32
|
generatedAt: z.string().datetime(),
|
|
26
33
|
mailboxes: z.array(emailContextMailboxSchema),
|
|
27
34
|
recentUnread: z.array(emailContextMessageSchema),
|
|
28
35
|
needsResponse: z.array(emailContextMessageSchema),
|
|
29
|
-
})
|
|
36
|
+
})
|
|
37
|
+
.strict();
|
|
@@ -14,13 +14,16 @@ export const externalIdentityReferenceSchema = z.object({
|
|
|
14
14
|
transportAcct: z.string().min(1),
|
|
15
15
|
sourceUserId: z.string().min(1),
|
|
16
16
|
});
|
|
17
|
-
export const resolveExternalIdentityRequestSchema = z
|
|
17
|
+
export const resolveExternalIdentityRequestSchema = z
|
|
18
|
+
.object({
|
|
18
19
|
actorUri: z.string().min(1).max(2048).optional(),
|
|
19
20
|
handle: z.string().min(1).max(2048).optional(),
|
|
20
21
|
transportAcct: z.string().max(320).optional(),
|
|
21
22
|
protocol: externalIdentityProtocolSchema.optional(),
|
|
22
|
-
})
|
|
23
|
-
|
|
23
|
+
})
|
|
24
|
+
.refine((value) => Boolean(value.actorUri) !== Boolean(value.handle), 'Exactly one actorUri or handle is required');
|
|
25
|
+
export const resolveExternalIdentityResponseSchema = z
|
|
26
|
+
.object({
|
|
24
27
|
user: userResponseSchema.extend({
|
|
25
28
|
id: z.string().min(1),
|
|
26
29
|
username: z.string().min(1),
|
|
@@ -31,20 +34,35 @@ export const resolveExternalIdentityResponseSchema = z.object({
|
|
|
31
34
|
externalIdentity: externalIdentityReferenceSchema.extend({ userId: z.string() }),
|
|
32
35
|
externalIdentities: z.array(externalIdentityReferenceSchema),
|
|
33
36
|
redirectedUserIds: z.array(z.string()),
|
|
34
|
-
})
|
|
37
|
+
})
|
|
38
|
+
.superRefine((value, context) => {
|
|
35
39
|
if (value.externalIdentity.userId !== value.user.id) {
|
|
36
|
-
context.addIssue({
|
|
40
|
+
context.addIssue({
|
|
41
|
+
code: z.ZodIssueCode.custom,
|
|
42
|
+
path: ['externalIdentity', 'userId'],
|
|
43
|
+
message: 'Canonical user id does not match profile',
|
|
44
|
+
});
|
|
37
45
|
}
|
|
38
|
-
if (!value.externalIdentities.some(identity => identity.actorUri === value.externalIdentity.actorUri
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
context.addIssue({
|
|
46
|
+
if (!value.externalIdentities.some((identity) => identity.actorUri === value.externalIdentity.actorUri &&
|
|
47
|
+
identity.canonicalAcct === value.externalIdentity.canonicalAcct &&
|
|
48
|
+
identity.sourceUserId === value.externalIdentity.sourceUserId)) {
|
|
49
|
+
context.addIssue({
|
|
50
|
+
code: z.ZodIssueCode.custom,
|
|
51
|
+
path: ['externalIdentity'],
|
|
52
|
+
message: 'Resolved source is absent from authoritative identities',
|
|
53
|
+
});
|
|
42
54
|
}
|
|
43
|
-
if (!value.externalIdentities.some(identity => identity.canonicalAcct === value.user.username)) {
|
|
44
|
-
context.addIssue({
|
|
55
|
+
if (!value.externalIdentities.some((identity) => identity.canonicalAcct === value.user.username)) {
|
|
56
|
+
context.addIssue({
|
|
57
|
+
code: z.ZodIssueCode.custom,
|
|
58
|
+
path: ['user', 'username'],
|
|
59
|
+
message: 'Profile handle is not an authoritative identity',
|
|
60
|
+
});
|
|
45
61
|
}
|
|
46
62
|
});
|
|
47
|
-
export const lookupExternalIdentitiesRequestSchema = z.object({
|
|
63
|
+
export const lookupExternalIdentitiesRequestSchema = z.object({
|
|
64
|
+
identifiers: z.array(z.string().min(1).max(2048)).min(1).max(100),
|
|
65
|
+
});
|
|
48
66
|
export const lookupExternalIdentitiesResponseSchema = z.object({
|
|
49
67
|
identities: z.array(z.object({
|
|
50
68
|
identifier: z.string(),
|
package/dist/esm/identity.js
CHANGED
|
@@ -173,21 +173,29 @@ const resourceOriginHostSchema = z
|
|
|
173
173
|
.string()
|
|
174
174
|
.trim()
|
|
175
175
|
.toLowerCase()
|
|
176
|
-
.pipe(z
|
|
176
|
+
.pipe(z
|
|
177
|
+
.string()
|
|
178
|
+
.min(1)
|
|
179
|
+
.max(253)
|
|
180
|
+
.regex(/^(?!-)[a-z0-9-]{1,63}(?<!-)(?:\.(?!-)[a-z0-9-]{1,63}(?<!-))+$/, 'originHost must be a public DNS hostname without scheme, port or path'));
|
|
177
181
|
/** Clarity resource-server request to bind a site to Oxy domain authority. */
|
|
178
|
-
export const resourceDomainOwnershipRequestSchema = z
|
|
182
|
+
export const resourceDomainOwnershipRequestSchema = z
|
|
183
|
+
.object({
|
|
179
184
|
accountId: z.string().min(1).max(128),
|
|
180
185
|
verifiedDomainId: z.string().min(1).max(128),
|
|
181
186
|
originHost: resourceOriginHostSchema,
|
|
182
|
-
})
|
|
183
|
-
|
|
187
|
+
})
|
|
188
|
+
.strict();
|
|
189
|
+
export const resourceDomainOwnershipResponseSchema = z
|
|
190
|
+
.object({
|
|
184
191
|
verified: z.boolean(),
|
|
185
192
|
accountId: z.string().min(1).max(128),
|
|
186
193
|
verifiedDomainId: z.string().min(1).max(128),
|
|
187
194
|
originHost: resourceOriginHostSchema,
|
|
188
195
|
verifiedAt: z.string().datetime().optional(),
|
|
189
196
|
method: z.enum(['dns-txt', 'well-known']).optional(),
|
|
190
|
-
})
|
|
197
|
+
})
|
|
198
|
+
.strict();
|
|
191
199
|
/**
|
|
192
200
|
* The instructions the API returns when a domain verification is requested. The
|
|
193
201
|
* caller may prove ownership EITHER by publishing the `dns` TXT record OR by
|
|
@@ -254,7 +262,7 @@ export const exportFinancialSectionSchema = z.object({
|
|
|
254
262
|
reservations: z.array(exportUsageReservationSchema),
|
|
255
263
|
});
|
|
256
264
|
export const exportBundleSchema = z.object({
|
|
257
|
-
|
|
265
|
+
$schema: z.string(),
|
|
258
266
|
exportedAt: z.string(),
|
|
259
267
|
did: z.string(),
|
|
260
268
|
didDocument: didDocumentSchema,
|
package/dist/esm/identityLink.js
CHANGED
|
@@ -31,7 +31,10 @@ export const IDENTITY_LINK_STATUSES = ['pending', 'signed', 'completed', 'cancel
|
|
|
31
31
|
export const IDENTITY_LINK_QR_PREFIX = 'oxycommons://link';
|
|
32
32
|
const LINK_ID = /^[0-9a-f]{32}$/;
|
|
33
33
|
const CHALLENGE = /^[0-9a-f]{64}$/;
|
|
34
|
-
export const identityLinkIdSchema = z
|
|
34
|
+
export const identityLinkIdSchema = z
|
|
35
|
+
.string()
|
|
36
|
+
.trim()
|
|
37
|
+
.regex(LINK_ID, 'linkId must be 32 lowercase hex characters');
|
|
35
38
|
/** The QR auth.oxy.so shows: the request's id and the challenge Commons signs. */
|
|
36
39
|
export function buildIdentityLinkQrPayload(linkId, challenge) {
|
|
37
40
|
return `${IDENTITY_LINK_QR_PREFIX}?id=${linkId}&c=${challenge}`;
|
|
@@ -84,4 +87,6 @@ export const identityLinkProofRequestSchema = z
|
|
|
84
87
|
* code just sent to its email for this link (`reauth`, plus its authenticator
|
|
85
88
|
* code when it has one).
|
|
86
89
|
*/
|
|
87
|
-
export const identityLinkCompleteRequestSchema = z
|
|
90
|
+
export const identityLinkCompleteRequestSchema = z
|
|
91
|
+
.object({ reauth: emailReauthProofSchema })
|
|
92
|
+
.strict();
|
|
@@ -82,7 +82,8 @@ export function buildIdentityProofMessage(claims) {
|
|
|
82
82
|
if (claims.payloadDigest !== null && !HEX_DIGEST.test(claims.payloadDigest)) {
|
|
83
83
|
throw new Error('identity proof: payloadDigest must be a lowercase SHA-256 hex digest');
|
|
84
84
|
}
|
|
85
|
-
if (claims.expectedRevision !== null &&
|
|
85
|
+
if (claims.expectedRevision !== null &&
|
|
86
|
+
(!Number.isSafeInteger(claims.expectedRevision) || claims.expectedRevision < 0)) {
|
|
86
87
|
throw new Error('identity proof: expectedRevision must be a non-negative integer');
|
|
87
88
|
}
|
|
88
89
|
if (!CHALLENGE.test(claims.challenge))
|
package/dist/esm/index.js
CHANGED
|
@@ -45,7 +45,7 @@ publicCardSchema, signedPublicCardSchema, realLifeAttestationRecordSchema, realL
|
|
|
45
45
|
// Verifiable Credentials (Fase 4 — NEW)
|
|
46
46
|
credentialRecordSchema, verifiableCredentialResponseSchema, credentialIssueResultSchema, credentialListResultSchema, credentialVerifyResultSchema, } from './civic.js';
|
|
47
47
|
export {
|
|
48
|
-
// Closed value sets — shared by the API's
|
|
48
|
+
// Closed value sets — shared by the API's column enums, the API's request
|
|
49
49
|
// validation, and the SDK's unions, so a new category/tier/status cannot be
|
|
50
50
|
// added on one side only.
|
|
51
51
|
REPUTATION_CATEGORIES, REPUTATION_TRANSACTION_STATUSES, TRUST_TIERS, REPUTATION_TARGET_ENTITY_TYPES, REPUTATION_INFLUENCE_CONTEXTS,
|
|
@@ -180,7 +180,7 @@ INFERENCE_ECONOMIC_TREATMENTS, inferenceEconomicTreatmentSchema, PROVIDER_COST_S
|
|
|
180
180
|
export { AUTONOMY_LEVELS, CAPABILITY_PACKAGES, autonomyLevelSchema, capabilityPackageSchema, actorRefSchema, executionActorRefSchema, foregroundExecutionAuthorizationInputSchema, resourceRefSchema, toolGrantOverrideSchema, grantLimitSchema, capabilityCatalogBindingSchema, executionAuthorizationRefSchema, capabilityCoordinatorSchema, capabilityTicketRequestSchema, delegationGrantSchema, automationTriggerSchema, automationActorSelectionSchema, automationDataFlowSchema, automationDefinitionSchema, capabilityTicketClaimsSchema, invocationPrincipalSchema, policyDecisionSchema, auditResultSchema, auditEventSchema, catalogToolSchema, catalogEventSchema, appCapabilityCatalogSchema, catalogRegistrationSchema, normalizedAppEventSchema, } from './agency.js';
|
|
181
181
|
export { catalogInvocationPathParameters, catalogInvocationsOverlap, catalogInvocationTemplatesEquivalent, findOverlappingCatalogInvocations, matchCatalogInvocation, resolveCatalogInvocation, } from './capabilityInvocation.js';
|
|
182
182
|
export { emailContextAddressSchema, emailContextMailboxSchema, emailContextMessageSchema, emailAgentContextSchema, } from './emailAgentContext.js';
|
|
183
|
-
export { inboxComposeRequestSchema, inboxDailyBriefRequestSchema, inboxNaturalSearchRequestSchema, inboxMessageInferenceParamsSchema, inboxInferenceTextResponseSchema, inboxNaturalSearchResponseSchema, inboxSmartRepliesResponseSchema, inboxThreadSummaryResponseSchema, inboxInferenceStreamEventSchema, } from './inference/inbox.js';
|
|
183
|
+
export { inboxComposeRequestSchema, inboxDailyBriefRequestSchema, inboxDailyBriefResponseSchema, INBOX_DAILY_BRIEF_SECTIONS, inboxNaturalSearchRequestSchema, inboxMessageInferenceParamsSchema, inboxInferenceTextResponseSchema, inboxNaturalSearchResponseSchema, inboxSmartRepliesResponseSchema, inboxThreadSummaryResponseSchema, inboxInferenceStreamEventSchema, } from './inference/inbox.js';
|
|
184
184
|
export * from './externalIdentity.js';
|
|
185
185
|
export * from './linkedAccounts.js';
|
|
186
186
|
export * from './federationInstanceFetch.js';
|
|
@@ -188,14 +188,14 @@ export * from './notifications.js';
|
|
|
188
188
|
export * from './email/messages.js';
|
|
189
189
|
export * from './stickers.js';
|
|
190
190
|
export { decisionEffortSchema, decisionQuestionSchema, decisionInputSchema, decisionRequestSchema, decisionAnswerSchema, decisionResultSchema, decisionSuccessSchema, decisionFailureSchema, decisionInputBudget, decisionFitsGateway, decisionAnswersMatch, } from './inference/decisions.js';
|
|
191
|
-
export { SCOPED_EXECUTION_CONTRACT_VERSION, SCOPED_REQUEST_ENVELOPE_VERSION, scopedExecutionAudienceSchema, scopedExecutionSchema, canonicalScopedExecutionJson } from './inference/scopedExecution.js';
|
|
191
|
+
export { SCOPED_EXECUTION_CONTRACT_VERSION, SCOPED_REQUEST_ENVELOPE_VERSION, scopedExecutionAudienceSchema, scopedExecutionSchema, canonicalScopedExecutionJson, } from './inference/scopedExecution.js';
|
|
192
192
|
export { scopedInferenceRequestSchema } from './inference/request.js';
|
|
193
193
|
export { PRIVATE_AUTO_EXECUTION_CONTRACT_VERSION, PRIVATE_AUTO_REQUEST_ENVELOPE_VERSION, PRIVATE_AUTO_LIMITS, PRIVATE_AUTO_INSTRUCTIONS, PRIVATE_AUTO_QUESTION, privateAutoPrincipalSchema, privateAutoSourceApprovalSchema, privateAutoExecutionSchema, privateAutoInputSchema, privateAutoOperationId, } from './inference/privateAutoExecution.js';
|
|
194
194
|
export { privateAutoInferenceRequestSchema } from './inference/request.js';
|
|
195
195
|
export { productDefinitionSchema, subjectProductAccessQuerySchema, productBenefitSchema, productOfferSchema, productSubscriptionSourceSchema, productAccessGrantSchema, subjectProductGrantSnapshotSchema, productOfferSegmentSchema, subjectProductAccessSchema, } from './products/access.js';
|
|
196
|
-
export { meteredGenerationSchema } from
|
|
197
|
-
export { canonicalCapabilityJson, inputSatisfiesCapabilityLimits, isLoopbackOrigin } from './capabilityBindings.js';
|
|
196
|
+
export { meteredGenerationSchema } from './inference/economics.js';
|
|
197
|
+
export { canonicalCapabilityJson, inputSatisfiesCapabilityLimits, isLoopbackOrigin, } from './capabilityBindings.js';
|
|
198
198
|
export * from './agentKeys.js';
|
|
199
|
-
export { productSubscriptionSummarySchema, productSubscriptionsResponseSchema, subscriptionCreditGrantSchema, subscriptionCreditGrantsResponseSchema, cancelProductSubscriptionSchema, productSubscriptionCancellationResultSchema } from './products/billing.js';
|
|
200
|
-
export { personalPlanDisplayPriceSchema, personalPlanCatalogueSchema } from './products/plans.js';
|
|
199
|
+
export { productSubscriptionSummarySchema, productSubscriptionsResponseSchema, subscriptionCreditGrantSchema, subscriptionCreditGrantsResponseSchema, cancelProductSubscriptionSchema, productSubscriptionCancellationResultSchema, } from './products/billing.js';
|
|
200
|
+
export { personalPlanDisplayPriceSchema, personalPlanCatalogueSchema, } from './products/plans.js';
|
|
201
201
|
export * from './products/checkout.js';
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
* docs/adr/0017-authorized-routes-in-the-envelope.md, issue #972 §12.
|
|
83
83
|
*/
|
|
84
84
|
import { z } from 'zod';
|
|
85
|
-
import { modelLicenseSchema, modelProvenanceSchema, modelRevisionSchema
|
|
85
|
+
import { modelLicenseSchema, modelProvenanceSchema, modelRevisionSchema } from './catalogue.js';
|
|
86
86
|
import { inferenceTimestampSchema, RESERVED_ALIA_PUBLISHER, sha256DigestSchema, } from './identifiers.js';
|
|
87
87
|
/**
|
|
88
88
|
* One artifact of a release, by path and digest.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { scopedExecutionAudienceSchema } from
|
|
1
|
+
import { scopedExecutionAudienceSchema } from './scopedExecution.js';
|
|
2
2
|
/**
|
|
3
3
|
* The canonical model catalogue.
|
|
4
4
|
*
|
|
@@ -34,13 +34,7 @@ import { priceSnapshotSchema } from './priceVersion.js';
|
|
|
34
34
|
/* Shared catalogue vocabulary */
|
|
35
35
|
/* -------------------------------------------------------------------------- */
|
|
36
36
|
/** Input/request modalities; structured decisions are an output, never an input. */
|
|
37
|
-
export const inferenceModalitySchema = z.enum([
|
|
38
|
-
'text',
|
|
39
|
-
'image',
|
|
40
|
-
'audio',
|
|
41
|
-
'video',
|
|
42
|
-
'embedding',
|
|
43
|
-
]);
|
|
37
|
+
export const inferenceModalitySchema = z.enum(['text', 'image', 'audio', 'video', 'embedding']);
|
|
44
38
|
/** Declared model outputs, separate from request/input modalities. */
|
|
45
39
|
export const inferenceOutputModalitySchema = z.enum([
|
|
46
40
|
...inferenceModalitySchema.options,
|
|
@@ -117,11 +111,7 @@ export const inferenceApiFormatSchema = z.enum([
|
|
|
117
111
|
* transcribes committed input audio.
|
|
118
112
|
* - `translation` — live speech-to-speech translation into one target language.
|
|
119
113
|
*/
|
|
120
|
-
export const realtimeSessionKindSchema = z.enum([
|
|
121
|
-
'conversation',
|
|
122
|
-
'transcription',
|
|
123
|
-
'translation',
|
|
124
|
-
]);
|
|
114
|
+
export const realtimeSessionKindSchema = z.enum(['conversation', 'transcription', 'translation']);
|
|
125
115
|
/**
|
|
126
116
|
* How a realtime session is carried. One member today: a WebSocket, whose every
|
|
127
117
|
* frame is one JSON message (see `realtime.ts`). WebRTC and SIP are separate
|