@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.
Files changed (98) hide show
  1. package/dist/cjs/.tsbuildinfo +1 -1
  2. package/dist/cjs/accountGraph.js +5 -3
  3. package/dist/cjs/agency.js +178 -96
  4. package/dist/cjs/agentKeys.js +80 -26
  5. package/dist/cjs/capabilityBindings.js +2 -2
  6. package/dist/cjs/capabilityInvocation.js +3 -1
  7. package/dist/cjs/commonsSignIn.js +2 -2
  8. package/dist/cjs/deviceSession.js +5 -1
  9. package/dist/cjs/email/messages.js +70 -4
  10. package/dist/cjs/emailAgentContext.js +16 -8
  11. package/dist/cjs/externalIdentity.js +30 -12
  12. package/dist/cjs/identity.js +14 -6
  13. package/dist/cjs/identityLink.js +7 -2
  14. package/dist/cjs/identityProof.js +2 -1
  15. package/dist/cjs/index.js +5 -3
  16. package/dist/cjs/inference/catalogue.js +2 -12
  17. package/dist/cjs/inference/decisions.js +102 -83
  18. package/dist/cjs/inference/economics.js +15 -5
  19. package/dist/cjs/inference/embeddings.js +44 -6
  20. package/dist/cjs/inference/inbox.js +33 -2
  21. package/dist/cjs/inference/providerConnection.js +21 -6
  22. package/dist/cjs/inference/realtime.js +114 -107
  23. package/dist/cjs/inference/scopedExecution.js +12 -12
  24. package/dist/cjs/inference/usage.js +2 -9
  25. package/dist/cjs/notifications.js +25 -5
  26. package/dist/cjs/oauth.js +30 -14
  27. package/dist/cjs/oxyRecordTypes.js +2 -2
  28. package/dist/cjs/products/access.js +146 -57
  29. package/dist/cjs/products/billing.js +71 -17
  30. package/dist/cjs/products/checkout.js +24 -6
  31. package/dist/cjs/products/plans.js +22 -7
  32. package/dist/cjs/recommendations.js +4 -6
  33. package/dist/cjs/reputation.js +3 -6
  34. package/dist/cjs/sessionStatus.js +1 -6
  35. package/dist/cjs/signIn.js +17 -4
  36. package/dist/cjs/transparency.js +3 -1
  37. package/dist/cjs/updates.js +2 -4
  38. package/dist/cjs/userResponse.js +27 -7
  39. package/dist/cjs/username.js +3 -1
  40. package/dist/esm/.tsbuildinfo +1 -1
  41. package/dist/esm/accountGraph.js +5 -3
  42. package/dist/esm/agency.js +178 -96
  43. package/dist/esm/agentKeys.js +80 -26
  44. package/dist/esm/capabilityBindings.js +2 -2
  45. package/dist/esm/capabilityInvocation.js +3 -1
  46. package/dist/esm/commonsSignIn.js +2 -2
  47. package/dist/esm/deviceSession.js +5 -1
  48. package/dist/esm/email/messages.js +69 -3
  49. package/dist/esm/emailAgentContext.js +16 -8
  50. package/dist/esm/externalIdentity.js +30 -12
  51. package/dist/esm/identity.js +14 -6
  52. package/dist/esm/identityLink.js +7 -2
  53. package/dist/esm/identityProof.js +2 -1
  54. package/dist/esm/index.js +7 -7
  55. package/dist/esm/inference/aliaModelRelease.js +1 -1
  56. package/dist/esm/inference/catalogue.js +3 -13
  57. package/dist/esm/inference/decisions.js +108 -89
  58. package/dist/esm/inference/economics.js +16 -6
  59. package/dist/esm/inference/embeddings.js +44 -6
  60. package/dist/esm/inference/inbox.js +32 -1
  61. package/dist/esm/inference/providerConnection.js +21 -6
  62. package/dist/esm/inference/realtime.js +123 -116
  63. package/dist/esm/inference/scopedExecution.js +15 -15
  64. package/dist/esm/inference/usage.js +2 -9
  65. package/dist/esm/notifications.js +25 -5
  66. package/dist/esm/oauth.js +30 -14
  67. package/dist/esm/oxyRecordTypes.js +2 -2
  68. package/dist/esm/products/access.js +146 -57
  69. package/dist/esm/products/billing.js +71 -17
  70. package/dist/esm/products/checkout.js +24 -6
  71. package/dist/esm/products/plans.js +22 -7
  72. package/dist/esm/recommendations.js +4 -6
  73. package/dist/esm/reputation.js +3 -6
  74. package/dist/esm/sessionStatus.js +1 -6
  75. package/dist/esm/signIn.js +17 -4
  76. package/dist/esm/transparency.js +3 -1
  77. package/dist/esm/updates.js +2 -4
  78. package/dist/esm/userResponse.js +27 -7
  79. package/dist/esm/username.js +3 -1
  80. package/dist/types/.tsbuildinfo +1 -1
  81. package/dist/types/accountGraph.d.ts +1 -1
  82. package/dist/types/commonsSignIn.d.ts +2 -2
  83. package/dist/types/email/messages.d.ts +208 -2
  84. package/dist/types/identity.d.ts +1 -1
  85. package/dist/types/index.d.ts +8 -8
  86. package/dist/types/inference/decisions.d.ts +1 -1
  87. package/dist/types/inference/inbox.d.ts +129 -5
  88. package/dist/types/inference/realtime.d.ts +1 -1
  89. package/dist/types/inference/scopedExecution.d.ts +1 -1
  90. package/dist/types/moderationReputation.d.ts +1 -1
  91. package/dist/types/oxyRecordTypes.d.ts +2 -2
  92. package/dist/types/products/access.d.ts +102 -102
  93. package/dist/types/products/checkout.d.ts +3 -3
  94. package/dist/types/products/plans.d.ts +40 -40
  95. package/dist/types/reputation.d.ts +4 -4
  96. package/dist/types/updates.d.ts +1 -1
  97. package/dist/types/userResponse.d.ts +22 -23
  98. package/package.json +1 -2
@@ -36,7 +36,7 @@ function valuesAtPath(input, path) {
36
36
  return [];
37
37
  current = next;
38
38
  }
39
- return current.flatMap((value) => Array.isArray(value) ? value : [value]);
39
+ return current.flatMap((value) => (Array.isArray(value) ? value : [value]));
40
40
  }
41
41
  /** Enforces the signed per-action bounds before a domain handler runs. */
42
42
  function inputSatisfiesCapabilityLimits(tool, input, limits) {
@@ -48,7 +48,7 @@ function inputSatisfiesCapabilityLimits(tool, input, limits) {
48
48
  return false;
49
49
  if (typeof limit.value === 'number') {
50
50
  const maximum = limit.value;
51
- if (!actualValues.every((actual) => (typeof actual === 'number' && Number.isFinite(actual) && actual <= maximum)))
51
+ if (!actualValues.every((actual) => typeof actual === 'number' && Number.isFinite(actual) && actual <= maximum))
52
52
  return false;
53
53
  continue;
54
54
  }
@@ -146,7 +146,9 @@ function matchCatalogInvocation(tools, method, path) {
146
146
  function resolveCatalogInvocation(catalog, tool, args) {
147
147
  const remaining = { ...args };
148
148
  const path = tool.invocation.path.replace(/\{(\w+)\}/g, (_match, parameter) => {
149
- const value = Object.prototype.hasOwnProperty.call(remaining, parameter) ? remaining[parameter] : undefined;
149
+ const value = Object.prototype.hasOwnProperty.call(remaining, parameter)
150
+ ? remaining[parameter]
151
+ : undefined;
150
152
  delete remaining[parameter];
151
153
  if (value === undefined || value === null || value === '') {
152
154
  throw new Error(`Missing required path parameter: ${parameter}`);
@@ -33,8 +33,8 @@ exports.IDENTITY_APPROVAL_PUSH_CHANNEL = exports.commonsDenyReasonSchema = expor
33
33
  const zod_1 = require("zod");
34
34
  /**
35
35
  * The closed set, as a value — consumed directly where a runtime list is
36
- * required (e.g. the Mongoose `enum` of `AuthSession.deniedReason`, which is
37
- * the storage-level guarantee that an unauthenticated caller can never write
36
+ * required (e.g. the `enum` of the `auth_sessions.denied_reason` column, which
37
+ * is the storage-level guarantee that an unauthenticated caller can never write
38
38
  * free-form text into the field).
39
39
  */
40
40
  exports.COMMONS_DENY_REASONS = ['declined', 'not_me'];
@@ -214,7 +214,11 @@ exports.deviceJoinCodeResponseSchema = zod_1.z.object({
214
214
  */
215
215
  exports.deviceJoinRequestSchema = zod_1.z.object({
216
216
  code: zod_1.z.string().min(1).max(256),
217
- codeVerifier: zod_1.z.string().min(43).max(128).regex(/^[A-Za-z0-9._~-]+$/),
217
+ codeVerifier: zod_1.z
218
+ .string()
219
+ .min(43)
220
+ .max(128)
221
+ .regex(/^[A-Za-z0-9._~-]+$/),
218
222
  clientId: zod_1.z.string().min(1).max(256),
219
223
  redirectUri: zod_1.z.string().url().max(2048),
220
224
  });
@@ -21,7 +21,7 @@
21
21
  * Platform-agnostic — zod only, no react/react-native/expo.
22
22
  */
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
- exports.rfcMessageIdSchema = exports.RFC_MESSAGE_ID_PATTERN = exports.emailOutboxSchema = exports.emailContactSchema = exports.emailBundledInboxSchema = exports.emailBundleSchema = exports.emailFilterSchema = exports.emailFilterActionSchema = exports.emailFilterConditionSchema = exports.emailLabelSchema = exports.emailSystemLabelSchema = exports.emailUserLabelSchema = exports.emailMailboxSchema = exports.emailMessageSchema = exports.emailMessageHighlightSchema = exports.emailMessageCardSchema = exports.emailMessageFlagsSchema = exports.emailAttachmentSchema = exports.emailMessageAddressSchema = exports.EMAIL_OUTBOX_STATUSES = exports.EMAIL_FILTER_ACTION_TYPES = exports.EMAIL_FILTER_CONDITION_OPERATORS = exports.EMAIL_FILTER_CONDITION_FIELDS = exports.MESSAGE_CARD_TYPES = void 0;
24
+ exports.rfcMessageIdSchema = exports.RFC_MESSAGE_ID_PATTERN = exports.emailOutboxSchema = exports.emailContactSchema = exports.emailBundledInboxSchema = exports.emailBundleSchema = exports.emailFilterSchema = exports.emailFilterActionSchema = exports.emailFilterConditionSchema = exports.emailLabelSchema = exports.emailSystemLabelSchema = exports.emailUserLabelSchema = exports.emailMailboxSchema = exports.emailMessageSchema = exports.emailMessageDeliverySchema = exports.emailMessageHighlightSchema = exports.emailMessageCardSchema = exports.emailMessageFlagsSchema = exports.emailAttachmentSchema = exports.emailMessageAddressSchema = exports.EMAIL_DELIVERY_ERROR_CODES = exports.EMAIL_DELIVERY_STATES = exports.EMAIL_OUTBOX_STATUSES = exports.EMAIL_FILTER_ACTION_TYPES = exports.EMAIL_FILTER_CONDITION_OPERATORS = exports.EMAIL_FILTER_CONDITION_FIELDS = exports.MESSAGE_CARD_TYPES = void 0;
25
25
  const zod_1 = require("zod");
26
26
  /** An ISO-8601 instant as `Date.prototype.toJSON` writes it. */
27
27
  const isoInstant = zod_1.z.string().datetime();
@@ -29,7 +29,13 @@ const isoInstant = zod_1.z.string().datetime();
29
29
  /** Structured data cards the AI extractor can emit. */
30
30
  exports.MESSAGE_CARD_TYPES = ['trip', 'purchase', 'event', 'bill', 'package'];
31
31
  /** What a mail-rule condition looks at. */
32
- exports.EMAIL_FILTER_CONDITION_FIELDS = ['from', 'to', 'subject', 'has-attachment', 'size'];
32
+ exports.EMAIL_FILTER_CONDITION_FIELDS = [
33
+ 'from',
34
+ 'to',
35
+ 'subject',
36
+ 'has-attachment',
37
+ 'size',
38
+ ];
33
39
  /** How a mail-rule condition compares. */
34
40
  exports.EMAIL_FILTER_CONDITION_OPERATORS = [
35
41
  'contains',
@@ -51,7 +57,42 @@ exports.EMAIL_FILTER_ACTION_TYPES = [
51
57
  'forward',
52
58
  ];
53
59
  /** Lifecycle of a durable outbound delivery. */
54
- exports.EMAIL_OUTBOX_STATUSES = ['pending', 'processing', 'sent', 'failed', 'cancelled'];
60
+ exports.EMAIL_OUTBOX_STATUSES = [
61
+ 'pending',
62
+ 'processing',
63
+ 'sent',
64
+ 'failed',
65
+ 'cancelled',
66
+ ];
67
+ /**
68
+ * Where a message the user sent stands, as its Sent copy reports it.
69
+ *
70
+ * A send is filed in Sent the moment the API accepts it and handed to the relay
71
+ * afterwards, so being in Sent no longer means having left. `sent` means the
72
+ * relay took it; `retrying` means an attempt failed and another is scheduled;
73
+ * `failed` means nothing more will happen on its own.
74
+ */
75
+ exports.EMAIL_DELIVERY_STATES = ['sending', 'retrying', 'sent', 'failed'];
76
+ /**
77
+ * Why a delivery is retrying or failed, in words a client can translate.
78
+ *
79
+ * - `relay_unavailable`: the relay did not answer or answered 4xx (transient).
80
+ * - `relay_unconfigured`: this server has no relay; an operator must fix it.
81
+ * - `relay_auth`: the relay rejected Oxy's credential; an operator must fix it.
82
+ * - `rejected`: the relay refused this message with a 5xx.
83
+ * - `retries_exhausted`: it stayed `relay_unavailable` for the whole budget.
84
+ * - `bounced`: the relay took it, then a recipient's server refused it.
85
+ * - `cancelled`: the sender stopped it.
86
+ */
87
+ exports.EMAIL_DELIVERY_ERROR_CODES = [
88
+ 'relay_unavailable',
89
+ 'relay_unconfigured',
90
+ 'relay_auth',
91
+ 'rejected',
92
+ 'retries_exhausted',
93
+ 'bounced',
94
+ 'cancelled',
95
+ ];
55
96
  // ─── Messages ───────────────────────────────────────────────────────
56
97
  /** One addressee. A header without a display name carries `name: ''`. */
57
98
  exports.emailMessageAddressSchema = zod_1.z.object({
@@ -91,6 +132,22 @@ exports.emailMessageHighlightSchema = zod_1.z.object({
91
132
  value: zod_1.z.string(),
92
133
  label: zod_1.z.string(),
93
134
  });
135
+ /**
136
+ * The delivery of a message the user sent. `error` is the relay's own words;
137
+ * `errorCode` is the same failure in the vocabulary above, and is `null` when
138
+ * there is nothing to explain — or when a newer server names a reason this
139
+ * client does not know yet, which then still reads as a delivery.
140
+ * `nextAttemptAt` is set only while `retrying`.
141
+ */
142
+ exports.emailMessageDeliverySchema = zod_1.z.object({
143
+ state: zod_1.z.enum(exports.EMAIL_DELIVERY_STATES),
144
+ attempts: zod_1.z.number().int(),
145
+ maxAttempts: zod_1.z.number().int(),
146
+ nextAttemptAt: isoInstant.nullable(),
147
+ error: zod_1.z.string().nullable(),
148
+ errorCode: zod_1.z.enum(exports.EMAIL_DELIVERY_ERROR_CODES).nullable().catch(null),
149
+ updatedAt: isoInstant,
150
+ });
94
151
  /**
95
152
  * A stored message as every `/email` read returns it.
96
153
  *
@@ -141,6 +198,12 @@ exports.emailMessageSchema = zod_1.z.object({
141
198
  /** Present only on list reads that walked the thread. */
142
199
  threadCount: zod_1.z.number().int().optional(),
143
200
  threadParticipants: zod_1.z.array(zod_1.z.string()).optional(),
201
+ /**
202
+ * Present only on a message the user sent through Oxy since delivery was
203
+ * tracked; absent on received mail. A delivery this client cannot read is
204
+ * dropped rather than allowed to drop the message with it.
205
+ */
206
+ delivery: exports.emailMessageDeliverySchema.optional().catch(undefined),
144
207
  });
145
208
  // ─── Mailboxes and labels ───────────────────────────────────────────
146
209
  exports.emailMailboxSchema = zod_1.z.object({
@@ -177,7 +240,10 @@ exports.emailSystemLabelSchema = zod_1.z.object({
177
240
  order: zod_1.z.number().int(),
178
241
  system: zod_1.z.literal(true),
179
242
  });
180
- exports.emailLabelSchema = zod_1.z.discriminatedUnion('system', [exports.emailUserLabelSchema, exports.emailSystemLabelSchema]);
243
+ exports.emailLabelSchema = zod_1.z.discriminatedUnion('system', [
244
+ exports.emailUserLabelSchema,
245
+ exports.emailSystemLabelSchema,
246
+ ]);
181
247
  // ─── Rules, bundles, contacts, outbox ───────────────────────────────
182
248
  exports.emailFilterConditionSchema = zod_1.z.object({
183
249
  field: zod_1.z.enum(exports.EMAIL_FILTER_CONDITION_FIELDS),
@@ -2,18 +2,23 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.emailAgentContextSchema = exports.emailContextMessageSchema = exports.emailContextMailboxSchema = exports.emailContextAddressSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- exports.emailContextAddressSchema = zod_1.z.object({
5
+ exports.emailContextAddressSchema = zod_1.z
6
+ .object({
6
7
  name: zod_1.z.string().optional(),
7
8
  address: zod_1.z.string().email(),
8
- }).strict();
9
- exports.emailContextMailboxSchema = zod_1.z.object({
9
+ })
10
+ .strict();
11
+ exports.emailContextMailboxSchema = zod_1.z
12
+ .object({
10
13
  mailboxId: zod_1.z.string().min(1),
11
14
  name: zod_1.z.string(),
12
15
  path: zod_1.z.string(),
13
16
  totalMessages: zod_1.z.number().int().nonnegative(),
14
17
  unseenMessages: zod_1.z.number().int().nonnegative(),
15
- }).strict();
16
- exports.emailContextMessageSchema = zod_1.z.object({
18
+ })
19
+ .strict();
20
+ exports.emailContextMessageSchema = zod_1.z
21
+ .object({
17
22
  messageId: zod_1.z.string().min(1),
18
23
  mailboxId: zod_1.z.string().min(1),
19
24
  from: exports.emailContextAddressSchema,
@@ -21,12 +26,15 @@ exports.emailContextMessageSchema = zod_1.z.object({
21
26
  receivedAt: zod_1.z.string().datetime(),
22
27
  seen: zod_1.z.boolean(),
23
28
  answered: zod_1.z.boolean(),
24
- }).strict();
25
- exports.emailAgentContextSchema = zod_1.z.object({
29
+ })
30
+ .strict();
31
+ exports.emailAgentContextSchema = zod_1.z
32
+ .object({
26
33
  accountId: zod_1.z.string().min(1),
27
34
  resourceMailboxId: zod_1.z.string().min(1).nullable(),
28
35
  generatedAt: zod_1.z.string().datetime(),
29
36
  mailboxes: zod_1.z.array(exports.emailContextMailboxSchema),
30
37
  recentUnread: zod_1.z.array(exports.emailContextMessageSchema),
31
38
  needsResponse: zod_1.z.array(exports.emailContextMessageSchema),
32
- }).strict();
39
+ })
40
+ .strict();
@@ -17,13 +17,16 @@ exports.externalIdentityReferenceSchema = zod_1.z.object({
17
17
  transportAcct: zod_1.z.string().min(1),
18
18
  sourceUserId: zod_1.z.string().min(1),
19
19
  });
20
- exports.resolveExternalIdentityRequestSchema = zod_1.z.object({
20
+ exports.resolveExternalIdentityRequestSchema = zod_1.z
21
+ .object({
21
22
  actorUri: zod_1.z.string().min(1).max(2048).optional(),
22
23
  handle: zod_1.z.string().min(1).max(2048).optional(),
23
24
  transportAcct: zod_1.z.string().max(320).optional(),
24
25
  protocol: exports.externalIdentityProtocolSchema.optional(),
25
- }).refine(value => Boolean(value.actorUri) !== Boolean(value.handle), 'Exactly one actorUri or handle is required');
26
- exports.resolveExternalIdentityResponseSchema = zod_1.z.object({
26
+ })
27
+ .refine((value) => Boolean(value.actorUri) !== Boolean(value.handle), 'Exactly one actorUri or handle is required');
28
+ exports.resolveExternalIdentityResponseSchema = zod_1.z
29
+ .object({
27
30
  user: userResponse_1.userResponseSchema.extend({
28
31
  id: zod_1.z.string().min(1),
29
32
  username: zod_1.z.string().min(1),
@@ -34,20 +37,35 @@ exports.resolveExternalIdentityResponseSchema = zod_1.z.object({
34
37
  externalIdentity: exports.externalIdentityReferenceSchema.extend({ userId: zod_1.z.string() }),
35
38
  externalIdentities: zod_1.z.array(exports.externalIdentityReferenceSchema),
36
39
  redirectedUserIds: zod_1.z.array(zod_1.z.string()),
37
- }).superRefine((value, context) => {
40
+ })
41
+ .superRefine((value, context) => {
38
42
  if (value.externalIdentity.userId !== value.user.id) {
39
- context.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ['externalIdentity', 'userId'], message: 'Canonical user id does not match profile' });
43
+ context.addIssue({
44
+ code: zod_1.z.ZodIssueCode.custom,
45
+ path: ['externalIdentity', 'userId'],
46
+ message: 'Canonical user id does not match profile',
47
+ });
40
48
  }
41
- if (!value.externalIdentities.some(identity => identity.actorUri === value.externalIdentity.actorUri
42
- && identity.canonicalAcct === value.externalIdentity.canonicalAcct
43
- && identity.sourceUserId === value.externalIdentity.sourceUserId)) {
44
- context.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ['externalIdentity'], message: 'Resolved source is absent from authoritative identities' });
49
+ if (!value.externalIdentities.some((identity) => identity.actorUri === value.externalIdentity.actorUri &&
50
+ identity.canonicalAcct === value.externalIdentity.canonicalAcct &&
51
+ identity.sourceUserId === value.externalIdentity.sourceUserId)) {
52
+ context.addIssue({
53
+ code: zod_1.z.ZodIssueCode.custom,
54
+ path: ['externalIdentity'],
55
+ message: 'Resolved source is absent from authoritative identities',
56
+ });
45
57
  }
46
- if (!value.externalIdentities.some(identity => identity.canonicalAcct === value.user.username)) {
47
- context.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ['user', 'username'], message: 'Profile handle is not an authoritative identity' });
58
+ if (!value.externalIdentities.some((identity) => identity.canonicalAcct === value.user.username)) {
59
+ context.addIssue({
60
+ code: zod_1.z.ZodIssueCode.custom,
61
+ path: ['user', 'username'],
62
+ message: 'Profile handle is not an authoritative identity',
63
+ });
48
64
  }
49
65
  });
50
- exports.lookupExternalIdentitiesRequestSchema = zod_1.z.object({ identifiers: zod_1.z.array(zod_1.z.string().min(1).max(2048)).min(1).max(100) });
66
+ exports.lookupExternalIdentitiesRequestSchema = zod_1.z.object({
67
+ identifiers: zod_1.z.array(zod_1.z.string().min(1).max(2048)).min(1).max(100),
68
+ });
51
69
  exports.lookupExternalIdentitiesResponseSchema = zod_1.z.object({
52
70
  identities: zod_1.z.array(zod_1.z.object({
53
71
  identifier: zod_1.z.string(),
@@ -176,21 +176,29 @@ const resourceOriginHostSchema = zod_1.z
176
176
  .string()
177
177
  .trim()
178
178
  .toLowerCase()
179
- .pipe(zod_1.z.string().min(1).max(253).regex(/^(?!-)[a-z0-9-]{1,63}(?<!-)(?:\.(?!-)[a-z0-9-]{1,63}(?<!-))+$/, 'originHost must be a public DNS hostname without scheme, port or path'));
179
+ .pipe(zod_1.z
180
+ .string()
181
+ .min(1)
182
+ .max(253)
183
+ .regex(/^(?!-)[a-z0-9-]{1,63}(?<!-)(?:\.(?!-)[a-z0-9-]{1,63}(?<!-))+$/, 'originHost must be a public DNS hostname without scheme, port or path'));
180
184
  /** Clarity resource-server request to bind a site to Oxy domain authority. */
181
- exports.resourceDomainOwnershipRequestSchema = zod_1.z.object({
185
+ exports.resourceDomainOwnershipRequestSchema = zod_1.z
186
+ .object({
182
187
  accountId: zod_1.z.string().min(1).max(128),
183
188
  verifiedDomainId: zod_1.z.string().min(1).max(128),
184
189
  originHost: resourceOriginHostSchema,
185
- }).strict();
186
- exports.resourceDomainOwnershipResponseSchema = zod_1.z.object({
190
+ })
191
+ .strict();
192
+ exports.resourceDomainOwnershipResponseSchema = zod_1.z
193
+ .object({
187
194
  verified: zod_1.z.boolean(),
188
195
  accountId: zod_1.z.string().min(1).max(128),
189
196
  verifiedDomainId: zod_1.z.string().min(1).max(128),
190
197
  originHost: resourceOriginHostSchema,
191
198
  verifiedAt: zod_1.z.string().datetime().optional(),
192
199
  method: zod_1.z.enum(['dns-txt', 'well-known']).optional(),
193
- }).strict();
200
+ })
201
+ .strict();
194
202
  /**
195
203
  * The instructions the API returns when a domain verification is requested. The
196
204
  * caller may prove ownership EITHER by publishing the `dns` TXT record OR by
@@ -257,7 +265,7 @@ exports.exportFinancialSectionSchema = zod_1.z.object({
257
265
  reservations: zod_1.z.array(exports.exportUsageReservationSchema),
258
266
  });
259
267
  exports.exportBundleSchema = zod_1.z.object({
260
- '$schema': zod_1.z.string(),
268
+ $schema: zod_1.z.string(),
261
269
  exportedAt: zod_1.z.string(),
262
270
  did: zod_1.z.string(),
263
271
  didDocument: exports.didDocumentSchema,
@@ -36,7 +36,10 @@ exports.IDENTITY_LINK_STATUSES = ['pending', 'signed', 'completed', 'cancelled']
36
36
  exports.IDENTITY_LINK_QR_PREFIX = 'oxycommons://link';
37
37
  const LINK_ID = /^[0-9a-f]{32}$/;
38
38
  const CHALLENGE = /^[0-9a-f]{64}$/;
39
- exports.identityLinkIdSchema = zod_1.z.string().trim().regex(LINK_ID, 'linkId must be 32 lowercase hex characters');
39
+ exports.identityLinkIdSchema = zod_1.z
40
+ .string()
41
+ .trim()
42
+ .regex(LINK_ID, 'linkId must be 32 lowercase hex characters');
40
43
  /** The QR auth.oxy.so shows: the request's id and the challenge Commons signs. */
41
44
  function buildIdentityLinkQrPayload(linkId, challenge) {
42
45
  return `${exports.IDENTITY_LINK_QR_PREFIX}?id=${linkId}&c=${challenge}`;
@@ -89,4 +92,6 @@ exports.identityLinkProofRequestSchema = zod_1.z
89
92
  * code just sent to its email for this link (`reauth`, plus its authenticator
90
93
  * code when it has one).
91
94
  */
92
- exports.identityLinkCompleteRequestSchema = zod_1.z.object({ reauth: signIn_1.emailReauthProofSchema }).strict();
95
+ exports.identityLinkCompleteRequestSchema = zod_1.z
96
+ .object({ reauth: signIn_1.emailReauthProofSchema })
97
+ .strict();
@@ -87,7 +87,8 @@ function buildIdentityProofMessage(claims) {
87
87
  if (claims.payloadDigest !== null && !HEX_DIGEST.test(claims.payloadDigest)) {
88
88
  throw new Error('identity proof: payloadDigest must be a lowercase SHA-256 hex digest');
89
89
  }
90
- if (claims.expectedRevision !== null && (!Number.isSafeInteger(claims.expectedRevision) || claims.expectedRevision < 0)) {
90
+ if (claims.expectedRevision !== null &&
91
+ (!Number.isSafeInteger(claims.expectedRevision) || claims.expectedRevision < 0)) {
91
92
  throw new Error('identity proof: expectedRevision must be a non-negative integer');
92
93
  }
93
94
  if (!CHALLENGE.test(claims.challenge))
package/dist/cjs/index.js CHANGED
@@ -37,8 +37,8 @@ exports.inferenceStreamDeltaEventSchema = exports.inferenceStreamStartEventSchem
37
37
  exports.realtimeItemDoneEventSchema = exports.realtimeItemAddedEventSchema = exports.realtimeCommandAcceptedEventSchema = exports.realtimeSessionResumedEventSchema = exports.realtimeSessionUpdatedEventSchema = exports.realtimeSessionCreatedEventSchema = exports.realtimeClientCommandSchema = exports.realtimeSessionCloseCommandSchema = exports.realtimeSessionResumeCommandSchema = exports.realtimeResponseCancelCommandSchema = exports.realtimeResponseCreateCommandSchema = exports.realtimeInputAudioClearCommandSchema = exports.realtimeInputAudioCommitCommandSchema = exports.realtimeInputAudioAppendCommandSchema = exports.realtimeItemTruncateCommandSchema = exports.realtimeItemDeleteCommandSchema = exports.realtimeItemCreateCommandSchema = exports.realtimeSessionUpdateCommandSchema = exports.realtimeResponseParametersSchema = exports.realtimeConversationItemSchema = exports.realtimeContentPartSchema = exports.realtimeSessionRequestSchema = exports.realtimeClientMetadataSchema = exports.realtimeSessionLimitsSchema = exports.realtimeSessionConfigUpdateSchema = exports.realtimeSessionConfigSchema = exports.realtimeTranslationSchema = exports.realtimeInputTranscriptionSchema = exports.realtimeTurnDetectionSchema = exports.realtimeOutputModalitySchema = exports.realtimeAudioFormatSchema = exports.realtimeResponseIdSchema = exports.realtimeItemIdSchema = exports.realtimeCommandIdSchema = exports.MAX_REALTIME_RESUME_WINDOW_MS = exports.MAX_REALTIME_SESSION_AUDIO_BYTES = exports.MAX_REALTIME_SESSION_DURATION_MS = exports.MAX_REALTIME_AUDIO_FRAME_BASE64_LENGTH = exports.inferenceStreamEventSchema = exports.inferenceStreamDoneEventSchema = exports.inferenceFinishReasonSchema = exports.inferenceStreamErrorEventSchema = exports.inferenceStreamRouteSwitchEventSchema = exports.inferenceRouteSwitchReasonSchema = exports.inferenceRouteSwitchDetailSchema = exports.inferenceStreamUsageEventSchema = exports.inferenceStreamToolCallEventSchema = exports.inferenceStreamAudioEventSchema = exports.MAX_INFERENCE_AUDIO_BYTES = exports.inferenceAudioMediaTypeSchema = void 0;
38
38
  exports.providerCredentialValidationOperationSchema = exports.kaanaCredentialValidationOutcomeSchema = exports.kaanaCredentialValidationFailureCodeSchema = exports.kaanaCredentialValidationOutcomeStateSchema = exports.kaanaCredentialValidationTaskSchema = exports.kaanaCredentialOutcomeSchema = exports.kaanaCredentialConflictOutcomeSchema = exports.kaanaCredentialAppliedOutcomeSchema = exports.kaanaCredentialOutcomeRequestSchema = exports.kaanaCredentialRevokeOutcomeRequestSchema = exports.kaanaCredentialRotateOutcomeRequestSchema = exports.kaanaCredentialCreateOutcomeRequestSchema = exports.kaanaCredentialMutationSchema = exports.kaanaCredentialRevokeMutationSchema = exports.kaanaCredentialRotateMutationSchema = exports.kaanaCredentialCreateMutationSchema = exports.kaanaCredentialIdentitySchema = exports.kaanaCredentialOperationActionSchema = exports.kaanaCredentialOperationIdSchema = exports.kaanaCredentialHandleSchema = exports.providerConnectionScopeSchema = exports.usageRefundSchema = exports.usageRefundReasonSchema = exports.usageRefundSubjectSchema = exports.usageReceiptSchema = exports.normalizedUsageReportSchema = exports.inferenceRequestOutcomeSchema = exports.usageReservationSchema = exports.usageReservationStatusSchema = exports.usageReservationRequestSchema = exports.realtimeServerEventSchema = exports.realtimeSessionClosedEventSchema = exports.realtimeSessionCloseReasonSchema = exports.realtimeErrorEventSchema = exports.realtimeResponseDoneEventSchema = exports.realtimeResponseStatusSchema = exports.realtimeToolCallEventSchema = exports.realtimeTextDeltaEventSchema = exports.realtimeTranscriptDoneEventSchema = exports.realtimeTranscriptDeltaEventSchema = exports.realtimeTranscriptSourceSchema = exports.realtimeOutputAudioDoneEventSchema = exports.realtimeOutputAudioDeltaEventSchema = exports.realtimeResponseCreatedEventSchema = exports.realtimeInputAudioClearedEventSchema = exports.realtimeInputAudioCommittedEventSchema = exports.realtimeSpeechStoppedEventSchema = exports.realtimeSpeechStartedEventSchema = exports.realtimeItemTruncatedEventSchema = exports.realtimeItemDeletedEventSchema = void 0;
39
39
  exports.capabilityPackageSchema = exports.autonomyLevelSchema = exports.CAPABILITY_PACKAGES = exports.AUTONOMY_LEVELS = exports.costCenterUsageSchema = exports.providerCostSourceSchema = exports.PROVIDER_COST_SOURCES = exports.inferenceEconomicTreatmentSchema = exports.INFERENCE_ECONOMIC_TREATMENTS = exports.productEntitlementSchema = exports.costCenterSpendSchema = exports.costCenterSchema = exports.costCenterStatusSchema = exports.COST_CENTER_STATUSES = exports.payAsYouGoEntitlementSchema = exports.productPlanSchema = exports.planAllowanceSchema = exports.LIVE_PRODUCT_PLAN_STATUSES = exports.productPlanStatusSchema = exports.PRODUCT_PLAN_STATUSES = exports.reconciliationReportSchema = exports.reconciliationRunSchema = exports.reconciliationDiscrepancySchema = exports.reconciliationRunStatusSchema = exports.RECONCILIATION_RUN_STATUSES = exports.reconciliationDiscrepancyKindSchema = exports.RECONCILIATION_DISCREPANCY_KINDS = exports.autoRechargeAttemptSchema = exports.autoRechargeStatusSchema = exports.AUTO_RECHARGE_STATUSES = exports.externalPaymentSchema = exports.externalPaymentKindSchema = exports.EXTERNAL_PAYMENT_KINDS = exports.externalPaymentProviderSchema = exports.EXTERNAL_PAYMENT_PROVIDERS = exports.billingInvoiceSchema = exports.billingInvoiceStatusSchema = exports.BILLING_INVOICE_STATUSES = exports.accountBillingStateSchema = exports.billingProfileSchema = exports.autoRechargeSchema = exports.billingProfileStatusSchema = exports.BILLING_PROFILE_STATUSES = exports.billingModeSchema = exports.BILLING_MODES = exports.providerConnectionSchema = exports.providerConnectionStatusSchema = exports.providerConnectionValidationSchema = exports.providerCredentialCustodyStateSchema = exports.providerCredentialValidationDeploymentSchema = void 0;
40
- exports.decisionResultSchema = exports.decisionAnswerSchema = exports.decisionRequestSchema = exports.decisionInputSchema = exports.decisionQuestionSchema = exports.decisionEffortSchema = exports.inboxInferenceStreamEventSchema = exports.inboxThreadSummaryResponseSchema = exports.inboxSmartRepliesResponseSchema = exports.inboxNaturalSearchResponseSchema = exports.inboxInferenceTextResponseSchema = exports.inboxMessageInferenceParamsSchema = exports.inboxNaturalSearchRequestSchema = exports.inboxDailyBriefRequestSchema = exports.inboxComposeRequestSchema = exports.emailAgentContextSchema = exports.emailContextMessageSchema = exports.emailContextMailboxSchema = exports.emailContextAddressSchema = exports.resolveCatalogInvocation = exports.matchCatalogInvocation = exports.findOverlappingCatalogInvocations = exports.catalogInvocationTemplatesEquivalent = exports.catalogInvocationsOverlap = exports.catalogInvocationPathParameters = exports.normalizedAppEventSchema = exports.catalogRegistrationSchema = exports.appCapabilityCatalogSchema = exports.catalogEventSchema = exports.catalogToolSchema = exports.auditEventSchema = exports.auditResultSchema = exports.policyDecisionSchema = exports.invocationPrincipalSchema = exports.capabilityTicketClaimsSchema = exports.automationDefinitionSchema = exports.automationDataFlowSchema = exports.automationActorSelectionSchema = exports.automationTriggerSchema = exports.delegationGrantSchema = exports.capabilityTicketRequestSchema = exports.capabilityCoordinatorSchema = exports.executionAuthorizationRefSchema = exports.capabilityCatalogBindingSchema = exports.grantLimitSchema = exports.toolGrantOverrideSchema = exports.resourceRefSchema = exports.foregroundExecutionAuthorizationInputSchema = exports.executionActorRefSchema = exports.actorRefSchema = void 0;
41
- exports.personalPlanCatalogueSchema = exports.personalPlanDisplayPriceSchema = exports.productSubscriptionCancellationResultSchema = exports.cancelProductSubscriptionSchema = exports.subscriptionCreditGrantsResponseSchema = exports.subscriptionCreditGrantSchema = exports.productSubscriptionsResponseSchema = exports.productSubscriptionSummarySchema = exports.isLoopbackOrigin = exports.inputSatisfiesCapabilityLimits = exports.canonicalCapabilityJson = exports.meteredGenerationSchema = exports.subjectProductAccessSchema = exports.productOfferSegmentSchema = exports.subjectProductGrantSnapshotSchema = exports.productAccessGrantSchema = exports.productSubscriptionSourceSchema = exports.productOfferSchema = exports.productBenefitSchema = exports.subjectProductAccessQuerySchema = exports.productDefinitionSchema = exports.privateAutoInferenceRequestSchema = exports.privateAutoOperationId = exports.privateAutoInputSchema = exports.privateAutoExecutionSchema = exports.privateAutoSourceApprovalSchema = exports.privateAutoPrincipalSchema = exports.PRIVATE_AUTO_QUESTION = exports.PRIVATE_AUTO_INSTRUCTIONS = exports.PRIVATE_AUTO_LIMITS = exports.PRIVATE_AUTO_REQUEST_ENVELOPE_VERSION = exports.PRIVATE_AUTO_EXECUTION_CONTRACT_VERSION = exports.scopedInferenceRequestSchema = exports.canonicalScopedExecutionJson = exports.scopedExecutionSchema = exports.scopedExecutionAudienceSchema = exports.SCOPED_REQUEST_ENVELOPE_VERSION = exports.SCOPED_EXECUTION_CONTRACT_VERSION = exports.decisionAnswersMatch = exports.decisionFitsGateway = exports.decisionInputBudget = exports.decisionFailureSchema = exports.decisionSuccessSchema = void 0;
40
+ exports.decisionRequestSchema = exports.decisionInputSchema = exports.decisionQuestionSchema = exports.decisionEffortSchema = exports.inboxInferenceStreamEventSchema = exports.inboxThreadSummaryResponseSchema = exports.inboxSmartRepliesResponseSchema = exports.inboxNaturalSearchResponseSchema = exports.inboxInferenceTextResponseSchema = exports.inboxMessageInferenceParamsSchema = exports.inboxNaturalSearchRequestSchema = exports.INBOX_DAILY_BRIEF_SECTIONS = exports.inboxDailyBriefResponseSchema = exports.inboxDailyBriefRequestSchema = exports.inboxComposeRequestSchema = exports.emailAgentContextSchema = exports.emailContextMessageSchema = exports.emailContextMailboxSchema = exports.emailContextAddressSchema = exports.resolveCatalogInvocation = exports.matchCatalogInvocation = exports.findOverlappingCatalogInvocations = exports.catalogInvocationTemplatesEquivalent = exports.catalogInvocationsOverlap = exports.catalogInvocationPathParameters = exports.normalizedAppEventSchema = exports.catalogRegistrationSchema = exports.appCapabilityCatalogSchema = exports.catalogEventSchema = exports.catalogToolSchema = exports.auditEventSchema = exports.auditResultSchema = exports.policyDecisionSchema = exports.invocationPrincipalSchema = exports.capabilityTicketClaimsSchema = exports.automationDefinitionSchema = exports.automationDataFlowSchema = exports.automationActorSelectionSchema = exports.automationTriggerSchema = exports.delegationGrantSchema = exports.capabilityTicketRequestSchema = exports.capabilityCoordinatorSchema = exports.executionAuthorizationRefSchema = exports.capabilityCatalogBindingSchema = exports.grantLimitSchema = exports.toolGrantOverrideSchema = exports.resourceRefSchema = exports.foregroundExecutionAuthorizationInputSchema = exports.executionActorRefSchema = exports.actorRefSchema = void 0;
41
+ exports.personalPlanCatalogueSchema = exports.personalPlanDisplayPriceSchema = exports.productSubscriptionCancellationResultSchema = exports.cancelProductSubscriptionSchema = exports.subscriptionCreditGrantsResponseSchema = exports.subscriptionCreditGrantSchema = exports.productSubscriptionsResponseSchema = exports.productSubscriptionSummarySchema = exports.isLoopbackOrigin = exports.inputSatisfiesCapabilityLimits = exports.canonicalCapabilityJson = exports.meteredGenerationSchema = exports.subjectProductAccessSchema = exports.productOfferSegmentSchema = exports.subjectProductGrantSnapshotSchema = exports.productAccessGrantSchema = exports.productSubscriptionSourceSchema = exports.productOfferSchema = exports.productBenefitSchema = exports.subjectProductAccessQuerySchema = exports.productDefinitionSchema = exports.privateAutoInferenceRequestSchema = exports.privateAutoOperationId = exports.privateAutoInputSchema = exports.privateAutoExecutionSchema = exports.privateAutoSourceApprovalSchema = exports.privateAutoPrincipalSchema = exports.PRIVATE_AUTO_QUESTION = exports.PRIVATE_AUTO_INSTRUCTIONS = exports.PRIVATE_AUTO_LIMITS = exports.PRIVATE_AUTO_REQUEST_ENVELOPE_VERSION = exports.PRIVATE_AUTO_EXECUTION_CONTRACT_VERSION = exports.scopedInferenceRequestSchema = exports.canonicalScopedExecutionJson = exports.scopedExecutionSchema = exports.scopedExecutionAudienceSchema = exports.SCOPED_REQUEST_ENVELOPE_VERSION = exports.SCOPED_EXECUTION_CONTRACT_VERSION = exports.decisionAnswersMatch = exports.decisionFitsGateway = exports.decisionInputBudget = exports.decisionFailureSchema = exports.decisionSuccessSchema = exports.decisionResultSchema = exports.decisionAnswerSchema = void 0;
42
42
  var accountGraph_1 = require("./accountGraph");
43
43
  Object.defineProperty(exports, "ACCOUNT_KINDS", { enumerable: true, get: function () { return accountGraph_1.ACCOUNT_KINDS; } });
44
44
  Object.defineProperty(exports, "accountKindSchema", { enumerable: true, get: function () { return accountGraph_1.accountKindSchema; } });
@@ -182,7 +182,7 @@ Object.defineProperty(exports, "credentialIssueResultSchema", { enumerable: true
182
182
  Object.defineProperty(exports, "credentialListResultSchema", { enumerable: true, get: function () { return civic_1.credentialListResultSchema; } });
183
183
  Object.defineProperty(exports, "credentialVerifyResultSchema", { enumerable: true, get: function () { return civic_1.credentialVerifyResultSchema; } });
184
184
  var reputation_1 = require("./reputation");
185
- // Closed value sets — shared by the API's mongoose enums, the API's request
185
+ // Closed value sets — shared by the API's column enums, the API's request
186
186
  // validation, and the SDK's unions, so a new category/tier/status cannot be
187
187
  // added on one side only.
188
188
  Object.defineProperty(exports, "REPUTATION_CATEGORIES", { enumerable: true, get: function () { return reputation_1.REPUTATION_CATEGORIES; } });
@@ -794,6 +794,8 @@ Object.defineProperty(exports, "emailAgentContextSchema", { enumerable: true, ge
794
794
  var inbox_1 = require("./inference/inbox");
795
795
  Object.defineProperty(exports, "inboxComposeRequestSchema", { enumerable: true, get: function () { return inbox_1.inboxComposeRequestSchema; } });
796
796
  Object.defineProperty(exports, "inboxDailyBriefRequestSchema", { enumerable: true, get: function () { return inbox_1.inboxDailyBriefRequestSchema; } });
797
+ Object.defineProperty(exports, "inboxDailyBriefResponseSchema", { enumerable: true, get: function () { return inbox_1.inboxDailyBriefResponseSchema; } });
798
+ Object.defineProperty(exports, "INBOX_DAILY_BRIEF_SECTIONS", { enumerable: true, get: function () { return inbox_1.INBOX_DAILY_BRIEF_SECTIONS; } });
797
799
  Object.defineProperty(exports, "inboxNaturalSearchRequestSchema", { enumerable: true, get: function () { return inbox_1.inboxNaturalSearchRequestSchema; } });
798
800
  Object.defineProperty(exports, "inboxMessageInferenceParamsSchema", { enumerable: true, get: function () { return inbox_1.inboxMessageInferenceParamsSchema; } });
799
801
  Object.defineProperty(exports, "inboxInferenceTextResponseSchema", { enumerable: true, get: function () { return inbox_1.inboxInferenceTextResponseSchema; } });
@@ -37,13 +37,7 @@ const priceVersion_1 = require("./priceVersion");
37
37
  /* Shared catalogue vocabulary */
38
38
  /* -------------------------------------------------------------------------- */
39
39
  /** Input/request modalities; structured decisions are an output, never an input. */
40
- exports.inferenceModalitySchema = zod_1.z.enum([
41
- 'text',
42
- 'image',
43
- 'audio',
44
- 'video',
45
- 'embedding',
46
- ]);
40
+ exports.inferenceModalitySchema = zod_1.z.enum(['text', 'image', 'audio', 'video', 'embedding']);
47
41
  /** Declared model outputs, separate from request/input modalities. */
48
42
  exports.inferenceOutputModalitySchema = zod_1.z.enum([
49
43
  ...exports.inferenceModalitySchema.options,
@@ -120,11 +114,7 @@ exports.inferenceApiFormatSchema = zod_1.z.enum([
120
114
  * transcribes committed input audio.
121
115
  * - `translation` — live speech-to-speech translation into one target language.
122
116
  */
123
- exports.realtimeSessionKindSchema = zod_1.z.enum([
124
- 'conversation',
125
- 'transcription',
126
- 'translation',
127
- ]);
117
+ exports.realtimeSessionKindSchema = zod_1.z.enum(['conversation', 'transcription', 'translation']);
128
118
  /**
129
119
  * How a realtime session is carried. One member today: a WebSocket, whose every
130
120
  * frame is one JSON message (see `realtime.ts`). WebRTC and SIP are separate