@oxy.so/contracts 4.23.0 → 4.25.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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizedAppEventSchema = exports.catalogRegistrationSchema = exports.appCapabilityCatalogSchema = exports.CATALOG_INTERNAL_TRANSPORTS = exports.catalogFeatureSchema = exports.catalogEventSchema = exports.catalogToolSchema = exports.auditEventSchema = exports.auditResultSchema = exports.policyDecisionSchema = exports.invocationPrincipalSchema = exports.capabilityTicketClaimsSchema = exports.automationDefinitionSchema = exports.automationDataFlowSchema = exports.automationActorSelectionSchema = exports.automationTriggerSchema = exports.agentRequesterCeilingSchema = exports.agentRequesterCeilingWriteSchema = exports.AGENT_REQUESTER_CEILING_AUTONOMY = exports.delegationGrantSchema = exports.capabilityTicketRequestSchema = exports.capabilityCoordinatorSchema = exports.executionAuthorizationRefSchema = exports.capabilityCatalogBindingSchema = exports.grantLimitSchema = exports.toolGrantOverrideSchema = exports.resourceRefSchema = exports.foregroundExecutionAuthorizationInputSchema = exports.executionActorRefSchema = exports.actorRefSchema = exports.capabilityPackageSchema = exports.CAPABILITY_PACKAGES = exports.autonomyLevelSchema = exports.AUTONOMY_LEVELS = void 0;
3
+ exports.normalizedAppEventSchema = exports.catalogRegistrationSchema = exports.appCapabilityCatalogSchema = exports.CATALOG_INTERNAL_TRANSPORTS = exports.catalogFeatureSchema = exports.catalogEventSchema = exports.catalogToolSchema = exports.auditEventSchema = exports.auditResultSchema = exports.policyDecisionSchema = exports.invocationPrincipalSchema = exports.capabilityTicketClaimsSchema = exports.automationDefinitionSchema = exports.automationDataFlowSchema = exports.automationActorSelectionSchema = exports.automationTriggerSchema = exports.agentAvailabilitySchema = exports.applicationAgentSchema = exports.applicationAgentWriteSchema = exports.applicationAgentAvailabilitySchema = exports.APPLICATION_AGENT_AVAILABILITIES = exports.agentRequesterCeilingSchema = exports.agentRequesterCeilingWriteSchema = exports.AGENT_REQUESTER_CEILING_AUTONOMY = exports.delegationGrantSchema = exports.capabilityTicketRequestSchema = exports.capabilityCoordinatorSchema = exports.executionAuthorizationRefSchema = exports.capabilityCatalogBindingSchema = exports.grantLimitSchema = exports.toolGrantOverrideSchema = exports.resourceRefSchema = exports.foregroundExecutionAuthorizationInputSchema = exports.executionActorRefSchema = exports.actorRefSchema = exports.capabilityPackageSchema = exports.CAPABILITY_PACKAGES = exports.autonomyLevelSchema = exports.AUTONOMY_LEVELS = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const capabilityInvocation_1 = require("./capabilityInvocation");
6
6
  const nonEmptyStringSchema = zod_1.z.string().trim().min(1);
@@ -172,6 +172,38 @@ exports.agentRequesterCeilingSchema = exports.agentRequesterCeilingWriteSchema
172
172
  updatedAt: zod_1.z.string().datetime(),
173
173
  })
174
174
  .strict();
175
+ /**
176
+ * Where an application's own agent opens (ADR 0044): `anywhere`, or only in
177
+ * sessions that belong to that application (`own_application`). An agent with
178
+ * no application row is available anywhere.
179
+ */
180
+ exports.APPLICATION_AGENT_AVAILABILITIES = ['anywhere', 'own_application'];
181
+ exports.applicationAgentAvailabilitySchema = zod_1.z.enum(exports.APPLICATION_AGENT_AVAILABILITIES);
182
+ /** What Oxy staff write for one of an application's agents. */
183
+ exports.applicationAgentWriteSchema = zod_1.z
184
+ .object({ availability: exports.applicationAgentAvailabilitySchema })
185
+ .strict();
186
+ /** One row of the application registry's agents: an agent is one application's. */
187
+ exports.applicationAgentSchema = exports.applicationAgentWriteSchema
188
+ .extend({
189
+ applicationId: identifierSchema,
190
+ agentAccountId: identifierSchema,
191
+ createdByUserId: identifierSchema.nullable(),
192
+ createdAt: zod_1.z.string().datetime(),
193
+ updatedAt: zod_1.z.string().datetime(),
194
+ })
195
+ .strict();
196
+ /**
197
+ * `GET /capabilities/agent-availability/:agentAccountId`: the sessions an agent
198
+ * is reachable from. `anywhere: false` lists the applications whose sessions
199
+ * (the session validation answer's `applicationId`) may reach it.
200
+ */
201
+ exports.agentAvailabilitySchema = zod_1.z.discriminatedUnion('anywhere', [
202
+ zod_1.z.object({ anywhere: zod_1.z.literal(true) }).strict(),
203
+ zod_1.z
204
+ .object({ anywhere: zod_1.z.literal(false), applicationIds: zod_1.z.array(identifierSchema).min(1) })
205
+ .strict(),
206
+ ]);
175
207
  exports.automationTriggerSchema = zod_1.z.discriminatedUnion('type', [
176
208
  zod_1.z.object({ type: zod_1.z.literal('manual') }).strict(),
177
209
  zod_1.z
@@ -0,0 +1,201 @@
1
+ "use strict";
2
+ /**
3
+ * App assertions (ADR 0045): how an Oxy app proves which app it is.
4
+ *
5
+ * ## The registry
6
+ *
7
+ * Each application may declare how it is recognised, written only by Oxy staff
8
+ * through the application administration lane
9
+ * (`PUT /applications/:appId/recognition`): its exact `https://` web origins,
10
+ * its Android package and signing certificates, and its iOS team and bundle.
11
+ * A platform it does not declare can never assert it.
12
+ *
13
+ * ## The exchange
14
+ *
15
+ * With the person's own bearer, the app asks `POST /apps/assertions` for an
16
+ * `OXY-APP+JWT` naming the application, and proves itself by platform: on the
17
+ * web the browser's `Origin`; on Android a Play Integrity token whose request
18
+ * hash is a challenge from `POST /apps/assertions/challenge`; on iOS an App
19
+ * Attest assertion over such a challenge, made with a key registered through
20
+ * `POST /apps/attest-keys`. The assertion lives five minutes and names the
21
+ * person (`sub`) and the session (`sid`) it was issued to.
22
+ *
23
+ * The Zod-free half (vocabularies, header name, response checks) is
24
+ * `./client/appAssertions.ts`.
25
+ */
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.appAssertionResponseSchema = exports.appAssertionRequestSchema = exports.appAttestKeyResponseSchema = exports.appAttestKeyRequestSchema = exports.appAttestKeyIdSchema = exports.appAssertionChallengeResponseSchema = exports.appAssertionChallengeRequestSchema = exports.applicationRecognitionSchema = exports.applicationRecognitionWriteSchema = exports.applicationIosRecognitionSchema = exports.applicationAndroidRecognitionSchema = exports.appleBundleIdSchema = exports.appleTeamIdSchema = exports.signingCertSha256Schema = exports.androidPackageNameSchema = exports.applicationWebOriginSchema = exports.appAssertionErrorCodeSchema = exports.appAssertionPlatformSchema = exports.OXY_APP_ASSERTION_TYPE = exports.OXY_APP_ASSERTION_TTL_SECONDS = exports.OXY_APP_ASSERTION_HEADER = exports.OXY_APP_ASSERTION_AUDIENCE = exports.APP_ASSERTION_PLATFORMS = exports.APP_ASSERTION_ERROR_CODES = exports.APP_ASSERTION_CHALLENGE_PURPOSES = void 0;
28
+ exports.isExactHttpsOrigin = isExactHttpsOrigin;
29
+ const zod_1 = require("zod");
30
+ const appAssertions_1 = require("./client/appAssertions");
31
+ Object.defineProperty(exports, "APP_ASSERTION_CHALLENGE_PURPOSES", { enumerable: true, get: function () { return appAssertions_1.APP_ASSERTION_CHALLENGE_PURPOSES; } });
32
+ Object.defineProperty(exports, "APP_ASSERTION_ERROR_CODES", { enumerable: true, get: function () { return appAssertions_1.APP_ASSERTION_ERROR_CODES; } });
33
+ Object.defineProperty(exports, "APP_ASSERTION_PLATFORMS", { enumerable: true, get: function () { return appAssertions_1.APP_ASSERTION_PLATFORMS; } });
34
+ Object.defineProperty(exports, "OXY_APP_ASSERTION_AUDIENCE", { enumerable: true, get: function () { return appAssertions_1.OXY_APP_ASSERTION_AUDIENCE; } });
35
+ Object.defineProperty(exports, "OXY_APP_ASSERTION_HEADER", { enumerable: true, get: function () { return appAssertions_1.OXY_APP_ASSERTION_HEADER; } });
36
+ Object.defineProperty(exports, "OXY_APP_ASSERTION_TTL_SECONDS", { enumerable: true, get: function () { return appAssertions_1.OXY_APP_ASSERTION_TTL_SECONDS; } });
37
+ Object.defineProperty(exports, "OXY_APP_ASSERTION_TYPE", { enumerable: true, get: function () { return appAssertions_1.OXY_APP_ASSERTION_TYPE; } });
38
+ const applicationIdSchema = zod_1.z.string().trim().min(1).max(255);
39
+ const base64Url32Schema = zod_1.z.string().regex(/^[A-Za-z0-9_-]{43}$/);
40
+ const base64Schema = (max) => zod_1.z
41
+ .string()
42
+ .min(4)
43
+ .max(max)
44
+ .regex(/^[A-Za-z0-9+/]+={0,2}$/);
45
+ exports.appAssertionPlatformSchema = zod_1.z.enum(appAssertions_1.APP_ASSERTION_PLATFORMS);
46
+ exports.appAssertionErrorCodeSchema = zod_1.z.enum(appAssertions_1.APP_ASSERTION_ERROR_CODES);
47
+ // ---------------------------------------------------------------------------
48
+ // Registry
49
+ // ---------------------------------------------------------------------------
50
+ /** True for an exact origin: `https:`, no path, query, fragment or credentials, in canonical form. */
51
+ function isExactHttpsOrigin(value) {
52
+ try {
53
+ const url = new URL(value);
54
+ return url.protocol === 'https:' && url.origin === value;
55
+ }
56
+ catch {
57
+ return false;
58
+ }
59
+ }
60
+ /** An exact `https://` origin, in the form a browser sends in `Origin` (`https://mention.earth`). */
61
+ exports.applicationWebOriginSchema = zod_1.z
62
+ .string()
63
+ .max(255)
64
+ .refine(isExactHttpsOrigin, 'Must be an exact https origin, as a browser sends it');
65
+ /** A Java-style Android application id, at least two segments. */
66
+ exports.androidPackageNameSchema = zod_1.z
67
+ .string()
68
+ .max(255)
69
+ .regex(/^[A-Za-z][A-Za-z0-9_]*(?:\.[A-Za-z][A-Za-z0-9_]*)+$/, 'Must be an Android package name');
70
+ /** A signing certificate's SHA-256, 64 lowercase hex characters (keytool's digest without colons). */
71
+ exports.signingCertSha256Schema = zod_1.z
72
+ .string()
73
+ .regex(/^[0-9a-f]{64}$/, 'Must be 64 lowercase hex characters');
74
+ /** An Apple Developer team id. */
75
+ exports.appleTeamIdSchema = zod_1.z.string().regex(/^[A-Z0-9]{10}$/, 'Must be an Apple team id');
76
+ /** An Apple bundle id. */
77
+ exports.appleBundleIdSchema = zod_1.z
78
+ .string()
79
+ .max(255)
80
+ .regex(/^[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)+$/, 'Must be an Apple bundle id');
81
+ const unique = (values) => new Set(values).size === values.length;
82
+ exports.applicationAndroidRecognitionSchema = zod_1.z
83
+ .object({
84
+ packageName: exports.androidPackageNameSchema,
85
+ signingCertSha256: zod_1.z
86
+ .array(exports.signingCertSha256Schema)
87
+ .min(1)
88
+ .max(10)
89
+ .refine(unique, 'Certificates must be unique'),
90
+ })
91
+ .strict();
92
+ exports.applicationIosRecognitionSchema = zod_1.z
93
+ .object({ teamId: exports.appleTeamIdSchema, bundleId: exports.appleBundleIdSchema })
94
+ .strict();
95
+ /**
96
+ * What Oxy staff write for an application: the whole declaration, replaced at
97
+ * once. `null` and `[]` declare nothing for that platform.
98
+ */
99
+ exports.applicationRecognitionWriteSchema = zod_1.z
100
+ .object({
101
+ webOrigins: zod_1.z
102
+ .array(exports.applicationWebOriginSchema)
103
+ .max(20)
104
+ .refine(unique, 'Origins must be unique'),
105
+ android: exports.applicationAndroidRecognitionSchema.nullable(),
106
+ ios: exports.applicationIosRecognitionSchema.nullable(),
107
+ })
108
+ .strict();
109
+ /** An application's recognition as the registry holds it; `updatedAt` is `null` when none was written. */
110
+ exports.applicationRecognitionSchema = exports.applicationRecognitionWriteSchema
111
+ .extend({
112
+ applicationId: applicationIdSchema,
113
+ updatedAt: zod_1.z.string().datetime().nullable(),
114
+ })
115
+ .strict();
116
+ // ---------------------------------------------------------------------------
117
+ // The exchange
118
+ // ---------------------------------------------------------------------------
119
+ /** `POST /apps/assertions/challenge`: a single-use challenge for a device proof. */
120
+ exports.appAssertionChallengeRequestSchema = zod_1.z.discriminatedUnion('platform', [
121
+ zod_1.z.object({ applicationId: applicationIdSchema, platform: zod_1.z.literal('android') }).strict(),
122
+ zod_1.z
123
+ .object({
124
+ applicationId: applicationIdSchema,
125
+ platform: zod_1.z.literal('ios'),
126
+ purpose: zod_1.z.enum(appAssertions_1.APP_ASSERTION_CHALLENGE_PURPOSES),
127
+ })
128
+ .strict(),
129
+ ]);
130
+ /**
131
+ * The challenge, and `requestHash`: what the device signs or hands to Play
132
+ * Integrity, binding the challenge to this application, platform, purpose and
133
+ * session. `cloudProjectNumber` is the Google Cloud project Play Integrity
134
+ * tokens are requested for (Android only).
135
+ */
136
+ exports.appAssertionChallengeResponseSchema = zod_1.z
137
+ .object({
138
+ challenge: base64Url32Schema,
139
+ requestHash: base64Url32Schema,
140
+ expiresAt: zod_1.z.string().datetime(),
141
+ cloudProjectNumber: zod_1.z
142
+ .string()
143
+ .regex(/^[0-9]{1,20}$/)
144
+ .optional(),
145
+ })
146
+ .strict();
147
+ /** An App Attest key id: the standard base64 of the SHA-256 of the key. */
148
+ exports.appAttestKeyIdSchema = zod_1.z.string().regex(/^[A-Za-z0-9+/]{43}=$/);
149
+ /** `POST /apps/attest-keys`: register an App Attest key, attested over a `attest_key` challenge. */
150
+ exports.appAttestKeyRequestSchema = zod_1.z
151
+ .object({
152
+ applicationId: applicationIdSchema,
153
+ keyId: exports.appAttestKeyIdSchema,
154
+ challenge: base64Url32Schema,
155
+ attestation: base64Schema(32768),
156
+ })
157
+ .strict();
158
+ exports.appAttestKeyResponseSchema = zod_1.z.object({ keyId: exports.appAttestKeyIdSchema }).strict();
159
+ /**
160
+ * `POST /apps/assertions`. The body names the application and the platform;
161
+ * the proof is the platform's: none on the web (the browser's `Origin` is), a
162
+ * Play Integrity token on Android, an App Attest assertion on iOS, each over a
163
+ * challenge minted for `assertion`.
164
+ */
165
+ exports.appAssertionRequestSchema = zod_1.z.discriminatedUnion('platform', [
166
+ zod_1.z.object({ applicationId: applicationIdSchema, platform: zod_1.z.literal('web') }).strict(),
167
+ zod_1.z
168
+ .object({
169
+ applicationId: applicationIdSchema,
170
+ platform: zod_1.z.literal('android'),
171
+ proof: zod_1.z
172
+ .object({
173
+ challenge: base64Url32Schema,
174
+ integrityToken: zod_1.z.string().min(1).max(16384),
175
+ })
176
+ .strict(),
177
+ })
178
+ .strict(),
179
+ zod_1.z
180
+ .object({
181
+ applicationId: applicationIdSchema,
182
+ platform: zod_1.z.literal('ios'),
183
+ proof: zod_1.z
184
+ .object({
185
+ challenge: base64Url32Schema,
186
+ keyId: exports.appAttestKeyIdSchema,
187
+ assertion: base64Schema(4096),
188
+ })
189
+ .strict(),
190
+ })
191
+ .strict(),
192
+ ]);
193
+ /** The assertion, and what it says. Send it as {@link OXY_APP_ASSERTION_HEADER}. */
194
+ exports.appAssertionResponseSchema = zod_1.z
195
+ .object({
196
+ assertion: zod_1.z.string().regex(/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/),
197
+ applicationId: zod_1.z.string().regex(/^\S{1,255}$/),
198
+ platform: exports.appAssertionPlatformSchema,
199
+ expiresAt: zod_1.z.string().datetime(),
200
+ })
201
+ .strict();
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ /**
3
+ * App assertions (ADR 0045), without Zod. Schemas: `../appAssertions.ts`.
4
+ *
5
+ * An Oxy app proves which app it is by trading platform evidence (the browser's
6
+ * `Origin`, a Play Integrity verdict, an App Attest assertion) for a short-lived
7
+ * `OXY-APP+JWT` signed by Oxy. A service that needs to know the app reads it
8
+ * from {@link OXY_APP_ASSERTION_HEADER} and verifies it against Oxy's JWKS
9
+ * (`verifyAppAssertion` in `@oxy.so/core/server`).
10
+ *
11
+ * Part of `@oxy.so/contracts/client`: never import `zod` here (see `./check.ts`).
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.appAssertionResponseCheck = exports.appAttestKeyResponseCheck = exports.appAssertionChallengeResponseCheck = exports.APP_ASSERTION_ERROR_CODES = exports.OXY_APP_ASSERTION_TTL_SECONDS = exports.OXY_APP_ASSERTION_HEADER = exports.OXY_APP_ASSERTION_AUDIENCE = exports.OXY_APP_ASSERTION_TYPE = exports.APP_ASSERTION_CHALLENGE_PURPOSES = exports.APP_ASSERTION_PLATFORMS = void 0;
15
+ const check_1 = require("./check");
16
+ /** How an app proves itself: the browser's origin, Play Integrity, or App Attest. */
17
+ exports.APP_ASSERTION_PLATFORMS = ['web', 'android', 'ios'];
18
+ /**
19
+ * What a device challenge is spent on: an assertion, or (iOS only) registering
20
+ * an App Attest key. A challenge minted for one is refused for the other.
21
+ */
22
+ exports.APP_ASSERTION_CHALLENGE_PURPOSES = ['assertion', 'attest_key'];
23
+ /** The JOSE `typ` of an app assertion. No other Oxy token carries it. */
24
+ exports.OXY_APP_ASSERTION_TYPE = 'OXY-APP+JWT';
25
+ /** The `aud` of every app assertion. */
26
+ exports.OXY_APP_ASSERTION_AUDIENCE = 'oxy-apps';
27
+ /** The request header an app (or an SDK acting for it) sends the assertion in. */
28
+ exports.OXY_APP_ASSERTION_HEADER = 'X-Oxy-App-Assertion';
29
+ /** Oxy signs an app assertion for exactly this long. */
30
+ exports.OXY_APP_ASSERTION_TTL_SECONDS = 300;
31
+ /**
32
+ * Why Oxy refused an app assertion, a challenge or an App Attest key. The API
33
+ * answers `{ error: <code>, message }`.
34
+ *
35
+ * - `application_unavailable`: no active application has that id.
36
+ * - `session_other_application`: the bearer's session belongs to another application.
37
+ * - `platform_not_registered`: the application declares no recognition for that platform.
38
+ * - `origin_not_registered`: the request's `Origin` is not one of the application's web origins.
39
+ * - `challenge_invalid`: the challenge is unknown, used, expired, or minted for something else.
40
+ * - `integrity_refused`: the Play Integrity verdict does not name this app, a registered
41
+ * certificate, a Play-recognised install and this challenge.
42
+ * - `integrity_unconfigured` / `integrity_unavailable`: Oxy cannot ask Google (503).
43
+ * - `attest_key_unknown`: no App Attest key with that id is registered for the app; attest a new one.
44
+ * - `attest_key_exists`: that App Attest key is already registered.
45
+ * - `attestation_invalid`: the App Attest attestation does not verify.
46
+ * - `assertion_invalid`: the App Attest assertion does not verify, or its counter did not advance.
47
+ * - `signing_unavailable`: Oxy cannot sign (503).
48
+ */
49
+ exports.APP_ASSERTION_ERROR_CODES = [
50
+ 'application_unavailable',
51
+ 'session_other_application',
52
+ 'platform_not_registered',
53
+ 'origin_not_registered',
54
+ 'challenge_invalid',
55
+ 'integrity_refused',
56
+ 'integrity_unconfigured',
57
+ 'integrity_unavailable',
58
+ 'attest_key_unknown',
59
+ 'attest_key_exists',
60
+ 'attestation_invalid',
61
+ 'assertion_invalid',
62
+ 'signing_unavailable',
63
+ ];
64
+ /** 32 random bytes, base64url: a challenge, or the SHA-256 it is bound into. */
65
+ const BASE64URL_32 = /^[A-Za-z0-9_-]{43}$/;
66
+ /** An App Attest key id: the standard base64 of a SHA-256. */
67
+ const APP_ATTEST_KEY_ID = /^[A-Za-z0-9+/]{43}=$/;
68
+ exports.appAssertionChallengeResponseCheck = (0, check_1.exact)()((0, check_1.strictObject)({
69
+ challenge: (0, check_1.string)((0, check_1.pattern)(BASE64URL_32)),
70
+ requestHash: (0, check_1.string)((0, check_1.pattern)(BASE64URL_32)),
71
+ expiresAt: (0, check_1.string)(check_1.datetime),
72
+ cloudProjectNumber: (0, check_1.optional)((0, check_1.string)((0, check_1.pattern)(/^[0-9]{1,20}$/))),
73
+ }));
74
+ exports.appAttestKeyResponseCheck = (0, check_1.exact)()((0, check_1.strictObject)({ keyId: (0, check_1.string)((0, check_1.pattern)(APP_ATTEST_KEY_ID)) }));
75
+ exports.appAssertionResponseCheck = (0, check_1.exact)()((0, check_1.strictObject)({
76
+ assertion: (0, check_1.string)((0, check_1.pattern)(/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/)),
77
+ applicationId: (0, check_1.string)((0, check_1.pattern)(/^\S{1,255}$/)),
78
+ platform: (0, check_1.oneOf)(exports.APP_ASSERTION_PLATFORMS),
79
+ expiresAt: (0, check_1.string)(check_1.datetime),
80
+ }));
@@ -15,11 +15,25 @@
15
15
  * behaviour by `__tests__/clientChecks.parity.test.ts`. Types are not repeated
16
16
  * here; import them from `@oxy.so/contracts` with `import type`.
17
17
  */
18
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ var desc = Object.getOwnPropertyDescriptor(m, k);
21
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
22
+ desc = { enumerable: true, get: function() { return m[k]; } };
23
+ }
24
+ Object.defineProperty(o, k2, desc);
25
+ }) : (function(o, m, k, k2) {
26
+ if (k2 === undefined) k2 = k;
27
+ o[k2] = m[k];
28
+ }));
29
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
30
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
31
+ };
18
32
  Object.defineProperty(exports, "__esModule", { value: true });
19
33
  exports.deviceJoinCodeResponseCheck = exports.deviceBackgroundCredentialResponseCheck = exports.activeTokenCheck = exports.SESSION_ACCOUNTS_CHANGED_EVENT = exports.deviceDirectorySyncCheck = exports.deviceDirectoryCheck = exports.deviceActivateResponseCheck = exports.signedRecordEnvelopeCheck = exports.externalIdentityReferenceCheck = exports.loginResultCheck = exports.isLoopbackOrigin = exports.executeAgentKeyOperationCheck = exports.agentVerifyRequestCheck = exports.agentProofClaimsCheck = exports.agentKeyOperationResultCheck = exports.agentKeyOperationCheck = exports.agentKeyOperationChallengeCheck = exports.agentKeyListResponseCheck = exports.agentChallengeRequestCheck = exports.AGENT_PROOF_TTL_MS = exports.AGENT_PROOF_AUDIENCE = exports.AGENT_PROOF_ACTIONS = exports.ACCOUNT_AUTH_METHODS = exports.emailVerificationStartResponseCheck = exports.emailVerificationConfirmResponseCheck = exports.emailTicketCheck = exports.emailAddressCheck = exports.EMAIL_VERIFICATION_PURPOSES = exports.EMAIL_VERIFICATION_ERROR_CODES = exports.EMAIL_TICKET_TTL_MS = exports.EMAIL_CODE_TTL_MS = exports.EMAIL_CODE_MAX_ATTEMPTS = exports.EMAIL_CODE_LENGTH = exports.newlyAddedRetiredCategories = exports.kindAcceptsAccountCategories = exports.isSelectableAccountCategoryId = exports.isOperatorSwitchTargetKind = exports.isDelegatedActAsEligibleKind = exports.isAccountKind = exports.SELECTABLE_ACCOUNT_CATEGORY_IDS = exports.RETIRED_ACCOUNT_CATEGORY_IDS = exports.MAX_ACCOUNT_CATEGORIES = exports.CHILD_ACCOUNT_KINDS = exports.ACCOUNT_KINDS = exports.ACCOUNT_CATEGORY_KINDS = exports.ACCOUNT_CATEGORY_IDS = exports.parseContract = exports.formatCheckPath = exports.checkContract = exports.ContractCheckError = void 0;
20
34
  exports.productSubscriptionCancellationResultCheck = exports.productPlanCheckoutRequestCheck = exports.productPlanCatalogueCheck = exports.personalPlanCheckoutResultCheck = exports.personalPlanCheckoutRequestCheck = exports.personalPlanCatalogueCheck = exports.cancelProductSubscriptionCheck = exports.updateOrganizationCheck = exports.organizationNameCheck = exports.organizationListCheck = exports.organizationImportBatchResultCheck = exports.organizationExternalResolutionCheck = exports.organizationExternalCheck = exports.organizationCurationResultCheck = exports.organizationClaimReviewCheck = exports.organizationClaimListCheck = exports.organizationClaimInputCheck = exports.organizationClaimDetailCheck = exports.organizationClaimCheck = exports.organizationCheck = exports.organizationBatchCheck = exports.createOrganizationCheck = exports.ORGANIZATION_TYPES = exports.ORGANIZATION_STATUSES = exports.ORGANIZATION_NAME_MAX_LENGTH = exports.ORGANIZATION_ERROR_CODES = exports.ORGANIZATION_CLAIM_STATUSES = exports.ORGANIZATION_CLAIM_DECISIONS = exports.ORGANIZATION_ALIAS_KINDS = exports.canonicalJson = exports.buildIdentityProofMessage = exports.IDENTITY_PROOF_VERSION = exports.IDENTITY_PROOF_DOMAIN = exports.IDENTITY_PROOF_CHALLENGE_TTL_MS = exports.IDENTITY_PROOF_AUDIENCE = exports.IDENTITY_PROOF_ACTION_VALUES = exports.IDENTITY_PROOF_ACTIONS = exports.IDENTITY_ERROR_CODES = exports.parseIdentityLinkQrPayload = exports.identityLinkStateCheck = exports.identityLinkCreateResponseCheck = exports.buildIdentityLinkQrPayload = exports.IDENTITY_LINK_STATUSES = exports.IDENTITY_LINK_QR_PREFIX = exports.sessionAccountsChangedEventCheck = exports.deviceTokenMintResponseCheck = exports.deviceSessionSyncCheck = exports.deviceSessionStateCheck = exports.deviceRegisterResponseCheck = exports.deviceJoinResponseCheck = void 0;
21
35
  exports.isSecondFactorRequired = exports.isEmailSignInChooseAccount = exports.emailSignInStartResponseCheck = exports.emailSignInPendingCheck = exports.emailSignInLinkResponseCheck = exports.emailSignInChooseAccountCheck = exports.TOTP_PERIOD_SECONDS = exports.TOTP_DIGITS = exports.TOTP_BACKUP_CODE_COUNT = exports.SIGN_IN_ERROR_CODES = exports.SIGNIN_SECOND_FACTOR_TTL_MS = exports.SIGNIN_SECOND_FACTOR_MAX_ATTEMPTS = exports.REAUTH_ACTIONS = exports.PASSWORD_MIN_LENGTH = exports.PASSWORD_MAX_LENGTH = exports.EMAIL_SIGNIN_LONG_CODE_LENGTH = exports.EMAIL_SIGNIN_LONG_CODE_ALPHABET = exports.EMAIL_SIGNIN_LINK_TTL_MS = exports.EMAIL_SIGNIN_CHOICE_TTL_MS = exports.EMAIL_ACCOUNTS_MAX = exports.publicApplicationCheck = exports.supervisionStateCheck = exports.supervisionReviewInputCheck = exports.supervisionInviteInputCheck = exports.supervisionInvitationCheck = exports.supervisionContactsResponseCheck = exports.supervisionContactInputCheck = exports.supervisionAcceptInputCheck = exports.safetyPeopleResponseCheck = exports.safetyPeopleInputCheck = exports.safetyOrganizationsResponseCheck = exports.safetyOrganizationsInputCheck = exports.purchaseReviewInputCheck = exports.purchaseApprovalListCheck = exports.purchaseApprovalCheck = exports.profileAccessInputCheck = exports.profileAccessDecisionCheck = exports.SUPERVISION_STATUSES = exports.SUPERVISION_INVITATION_STATUSES = exports.SUPERVISION_CONSENT_VERSION = exports.SUPERVISED_ACTIONS = exports.SAFETY_POLICY_VERSION = exports.PURCHASE_APPROVAL_STATUSES = exports.isFullReputationBalance = exports.recommendationRequestCheck = exports.subscriptionCreditGrantsResponseCheck = exports.subjectProductAccessQueryCheck = exports.subjectProductAccessCheck = exports.productSubscriptionsResponseCheck = exports.productSubscriptionRenewalRequestCheck = void 0;
22
- exports.isRightsClaim = exports.isErasureRequest = exports.OPEN_CONTENT_CLAIM_STATES = exports.ERASURE_REQUEST_DEADLINE_DAYS = exports.COUNTER_NOTICE_STATEMENTS = exports.COUNTER_NOTICE_STATEMENT_VERSION = exports.CONTENT_CLAIM_STATES = exports.CONTENT_CLAIM_REFERENCE_PATTERN = exports.CONTENT_CLAIM_LIMITS = exports.CONTENT_CLAIM_KINDS = exports.CONTENT_CLAIM_ERROR_CODES = exports.CONTENT_CLAIM_COUNTER_NOTICE_LIMITS = exports.CLOSED_CONTENT_CLAIM_STATES = exports.CLAIMANT_RELATIONSHIPS = exports.userNameCheck = exports.usernameCheckForAccountKind = exports.usernameCheck = exports.stripDisallowedUsernameCharacters = exports.botUsernameCheck = exports.applyBotUsernameSuffix = exports.USERNAME_PATTERN_SOURCE = exports.USERNAME_MIN_LENGTH = exports.USERNAME_MAX_LENGTH = exports.USERNAME_INVALID_MESSAGE = exports.RESERVED_USERNAME_MESSAGE = exports.RESERVED_USERNAMES = exports.NUMERIC_USERNAME_MESSAGE = exports.BOT_USERNAME_SUFFIX = exports.BOT_USERNAME_INVALID_MESSAGE = exports.totpEnrollResponseCheck = exports.totpBackupCodesResponseCheck = exports.signInMethodsCheck = exports.secondFactorRequiredCheck = exports.reauthProofCheck = exports.normalizeEmailSignInCode = void 0;
36
+ exports.appAttestKeyResponseCheck = exports.appAssertionResponseCheck = exports.appAssertionChallengeResponseCheck = exports.OXY_APP_ASSERTION_TYPE = exports.OXY_APP_ASSERTION_TTL_SECONDS = exports.OXY_APP_ASSERTION_HEADER = exports.OXY_APP_ASSERTION_AUDIENCE = exports.APP_ASSERTION_PLATFORMS = exports.APP_ASSERTION_ERROR_CODES = exports.APP_ASSERTION_CHALLENGE_PURPOSES = exports.isRightsClaim = exports.isErasureRequest = exports.OPEN_CONTENT_CLAIM_STATES = exports.ERASURE_REQUEST_DEADLINE_DAYS = exports.COUNTER_NOTICE_STATEMENTS = exports.COUNTER_NOTICE_STATEMENT_VERSION = exports.CONTENT_CLAIM_STATES = exports.CONTENT_CLAIM_REFERENCE_PATTERN = exports.CONTENT_CLAIM_LIMITS = exports.CONTENT_CLAIM_KINDS = exports.CONTENT_CLAIM_ERROR_CODES = exports.CONTENT_CLAIM_COUNTER_NOTICE_LIMITS = exports.CLOSED_CONTENT_CLAIM_STATES = exports.CLAIMANT_RELATIONSHIPS = exports.userNameCheck = exports.usernameCheckForAccountKind = exports.usernameCheck = exports.stripDisallowedUsernameCharacters = exports.botUsernameCheck = exports.applyBotUsernameSuffix = exports.USERNAME_PATTERN_SOURCE = exports.USERNAME_MIN_LENGTH = exports.USERNAME_MAX_LENGTH = exports.USERNAME_INVALID_MESSAGE = exports.RESERVED_USERNAME_MESSAGE = exports.RESERVED_USERNAMES = exports.NUMERIC_USERNAME_MESSAGE = exports.BOT_USERNAME_SUFFIX = exports.BOT_USERNAME_INVALID_MESSAGE = exports.totpEnrollResponseCheck = exports.totpBackupCodesResponseCheck = exports.signInMethodsCheck = exports.secondFactorRequiredCheck = exports.reauthProofCheck = exports.normalizeEmailSignInCode = void 0;
23
37
  var check_1 = require("./check");
24
38
  Object.defineProperty(exports, "ContractCheckError", { enumerable: true, get: function () { return check_1.ContractCheckError; } });
25
39
  Object.defineProperty(exports, "checkContract", { enumerable: true, get: function () { return check_1.checkContract; } });
@@ -227,3 +241,15 @@ Object.defineProperty(exports, "ERASURE_REQUEST_DEADLINE_DAYS", { enumerable: tr
227
241
  Object.defineProperty(exports, "OPEN_CONTENT_CLAIM_STATES", { enumerable: true, get: function () { return contentClaims_1.OPEN_CONTENT_CLAIM_STATES; } });
228
242
  Object.defineProperty(exports, "isErasureRequest", { enumerable: true, get: function () { return contentClaims_1.isErasureRequest; } });
229
243
  Object.defineProperty(exports, "isRightsClaim", { enumerable: true, get: function () { return contentClaims_1.isRightsClaim; } });
244
+ var appAssertions_1 = require("./appAssertions");
245
+ Object.defineProperty(exports, "APP_ASSERTION_CHALLENGE_PURPOSES", { enumerable: true, get: function () { return appAssertions_1.APP_ASSERTION_CHALLENGE_PURPOSES; } });
246
+ Object.defineProperty(exports, "APP_ASSERTION_ERROR_CODES", { enumerable: true, get: function () { return appAssertions_1.APP_ASSERTION_ERROR_CODES; } });
247
+ Object.defineProperty(exports, "APP_ASSERTION_PLATFORMS", { enumerable: true, get: function () { return appAssertions_1.APP_ASSERTION_PLATFORMS; } });
248
+ Object.defineProperty(exports, "OXY_APP_ASSERTION_AUDIENCE", { enumerable: true, get: function () { return appAssertions_1.OXY_APP_ASSERTION_AUDIENCE; } });
249
+ Object.defineProperty(exports, "OXY_APP_ASSERTION_HEADER", { enumerable: true, get: function () { return appAssertions_1.OXY_APP_ASSERTION_HEADER; } });
250
+ Object.defineProperty(exports, "OXY_APP_ASSERTION_TTL_SECONDS", { enumerable: true, get: function () { return appAssertions_1.OXY_APP_ASSERTION_TTL_SECONDS; } });
251
+ Object.defineProperty(exports, "OXY_APP_ASSERTION_TYPE", { enumerable: true, get: function () { return appAssertions_1.OXY_APP_ASSERTION_TYPE; } });
252
+ Object.defineProperty(exports, "appAssertionChallengeResponseCheck", { enumerable: true, get: function () { return appAssertions_1.appAssertionChallengeResponseCheck; } });
253
+ Object.defineProperty(exports, "appAssertionResponseCheck", { enumerable: true, get: function () { return appAssertions_1.appAssertionResponseCheck; } });
254
+ Object.defineProperty(exports, "appAttestKeyResponseCheck", { enumerable: true, get: function () { return appAssertions_1.appAttestKeyResponseCheck; } });
255
+ __exportStar(require("../products/one"), exports);
package/dist/cjs/index.js CHANGED
@@ -37,9 +37,9 @@ exports.inferenceToolCallSchema = exports.inferenceContentPartSchema = exports.i
37
37
  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 = exports.inferenceStreamDeltaEventSchema = exports.inferenceStreamStartEventSchema = exports.inferenceAudioOutputParametersSchema = exports.inferenceSpeechParametersSchema = exports.inferenceRequestSchema = exports.clientRequestMetadataSchema = exports.responseFormatSchema = exports.toolChoiceSchema = exports.toolDefinitionSchema = exports.inferenceReasoningSchema = exports.samplingParametersSchema = exports.inferenceInputSchema = exports.inferenceMessageSchema = exports.inferenceMessageRoleSchema = void 0;
38
38
  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 = 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 = void 0;
39
39
  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 = 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 = void 0;
40
- exports.resolveCatalogInvocation = exports.matchCatalogInvocation = exports.findOverlappingCatalogInvocations = exports.catalogInvocationTemplatesEquivalent = exports.catalogInvocationsOverlap = exports.catalogInvocationPathParameters = exports.normalizedAppEventSchema = exports.catalogRegistrationSchema = exports.appCapabilityCatalogSchema = exports.CATALOG_INTERNAL_TRANSPORTS = exports.catalogFeatureSchema = exports.catalogEventSchema = exports.catalogToolSchema = exports.auditEventSchema = exports.auditResultSchema = exports.policyDecisionSchema = exports.invocationPrincipalSchema = exports.capabilityTicketClaimsSchema = exports.automationDefinitionSchema = exports.automationDataFlowSchema = exports.automationActorSelectionSchema = exports.automationTriggerSchema = exports.agentRequesterCeilingSchema = exports.agentRequesterCeilingWriteSchema = exports.AGENT_REQUESTER_CEILING_AUTONOMY = exports.delegationGrantSchema = exports.capabilityTicketRequestSchema = exports.capabilityCoordinatorSchema = exports.executionAuthorizationRefSchema = exports.capabilityCatalogBindingSchema = exports.grantLimitSchema = exports.toolGrantOverrideSchema = exports.resourceRefSchema = exports.foregroundExecutionAuthorizationInputSchema = exports.executionActorRefSchema = exports.actorRefSchema = 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 = void 0;
41
- 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 = 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 = void 0;
42
- exports.serviceTokenOptionsSchema = exports.serviceTokenScopesSchema = exports.productPlanCatalogueSchema = 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 = void 0;
40
+ exports.catalogInvocationPathParameters = exports.normalizedAppEventSchema = exports.catalogRegistrationSchema = exports.appCapabilityCatalogSchema = exports.CATALOG_INTERNAL_TRANSPORTS = exports.catalogFeatureSchema = exports.catalogEventSchema = exports.catalogToolSchema = exports.auditEventSchema = exports.auditResultSchema = exports.policyDecisionSchema = exports.invocationPrincipalSchema = exports.capabilityTicketClaimsSchema = exports.automationDefinitionSchema = exports.automationDataFlowSchema = exports.automationActorSelectionSchema = exports.automationTriggerSchema = exports.agentAvailabilitySchema = exports.applicationAgentSchema = exports.applicationAgentWriteSchema = exports.applicationAgentAvailabilitySchema = exports.APPLICATION_AGENT_AVAILABILITIES = exports.agentRequesterCeilingSchema = exports.agentRequesterCeilingWriteSchema = exports.AGENT_REQUESTER_CEILING_AUTONOMY = exports.delegationGrantSchema = exports.capabilityTicketRequestSchema = exports.capabilityCoordinatorSchema = exports.executionAuthorizationRefSchema = exports.capabilityCatalogBindingSchema = exports.grantLimitSchema = exports.toolGrantOverrideSchema = exports.resourceRefSchema = exports.foregroundExecutionAuthorizationInputSchema = exports.executionActorRefSchema = exports.actorRefSchema = 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 = void 0;
41
+ 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 = 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 = void 0;
42
+ exports.serviceTokenOptionsSchema = exports.serviceTokenScopesSchema = exports.productPlanCatalogueSchema = 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 = void 0;
43
43
  var accountGraph_1 = require("./accountGraph");
44
44
  Object.defineProperty(exports, "ACCOUNT_KINDS", { enumerable: true, get: function () { return accountGraph_1.ACCOUNT_KINDS; } });
45
45
  Object.defineProperty(exports, "accountKindSchema", { enumerable: true, get: function () { return accountGraph_1.accountKindSchema; } });
@@ -785,6 +785,11 @@ Object.defineProperty(exports, "delegationGrantSchema", { enumerable: true, get:
785
785
  Object.defineProperty(exports, "AGENT_REQUESTER_CEILING_AUTONOMY", { enumerable: true, get: function () { return agency_1.AGENT_REQUESTER_CEILING_AUTONOMY; } });
786
786
  Object.defineProperty(exports, "agentRequesterCeilingWriteSchema", { enumerable: true, get: function () { return agency_1.agentRequesterCeilingWriteSchema; } });
787
787
  Object.defineProperty(exports, "agentRequesterCeilingSchema", { enumerable: true, get: function () { return agency_1.agentRequesterCeilingSchema; } });
788
+ Object.defineProperty(exports, "APPLICATION_AGENT_AVAILABILITIES", { enumerable: true, get: function () { return agency_1.APPLICATION_AGENT_AVAILABILITIES; } });
789
+ Object.defineProperty(exports, "applicationAgentAvailabilitySchema", { enumerable: true, get: function () { return agency_1.applicationAgentAvailabilitySchema; } });
790
+ Object.defineProperty(exports, "applicationAgentWriteSchema", { enumerable: true, get: function () { return agency_1.applicationAgentWriteSchema; } });
791
+ Object.defineProperty(exports, "applicationAgentSchema", { enumerable: true, get: function () { return agency_1.applicationAgentSchema; } });
792
+ Object.defineProperty(exports, "agentAvailabilitySchema", { enumerable: true, get: function () { return agency_1.agentAvailabilitySchema; } });
788
793
  Object.defineProperty(exports, "automationTriggerSchema", { enumerable: true, get: function () { return agency_1.automationTriggerSchema; } });
789
794
  Object.defineProperty(exports, "automationActorSelectionSchema", { enumerable: true, get: function () { return agency_1.automationActorSelectionSchema; } });
790
795
  Object.defineProperty(exports, "automationDataFlowSchema", { enumerable: true, get: function () { return agency_1.automationDataFlowSchema; } });
@@ -901,3 +906,5 @@ Object.defineProperty(exports, "serviceTokenScopesSchema", { enumerable: true, g
901
906
  Object.defineProperty(exports, "serviceTokenOptionsSchema", { enumerable: true, get: function () { return serviceToken_1.serviceTokenOptionsSchema; } });
902
907
  __exportStar(require("./applicationRoles"), exports);
903
908
  __exportStar(require("./contentClaims"), exports);
909
+ __exportStar(require("./appAssertions"), exports);
910
+ __exportStar(require("./products/one"), exports);
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OXY_ONE_APP_SUBSCRIPTIONS = exports.OXY_ONE_CREATOR_PLANS = exports.OXY_ONE_BUSINESS_PLANS = exports.OXY_ONE_FAMILY_PLANS = exports.OXY_ONE_PERSONAL_PLANS = exports.OXY_ONE_AUDIENCE_THEMES = exports.OXY_ONE_FAMILY_MEMBERS = exports.OXY_ONE_ANNUAL_DISCOUNT = void 0;
4
+ exports.getOnePlans = getOnePlans;
5
+ exports.onePlanQuote = onePlanQuote;
6
+ exports.OXY_ONE_ANNUAL_DISCOUNT = 20;
7
+ exports.OXY_ONE_FAMILY_MEMBERS = 6;
8
+ exports.OXY_ONE_AUDIENCE_THEMES = {
9
+ personal: 'one-plans-theme',
10
+ creator: 'one-creator-theme',
11
+ business: 'one-professional-theme',
12
+ };
13
+ /** Approved prices and credits; proposed storage capacities for the bundle design.
14
+ * USD minor units; credits renew monthly even on annual plans. Free 2 GB and Go 20 GB follow
15
+ * the new product direction; existing backend quotas are not changed here. */
16
+ exports.OXY_ONE_PERSONAL_PLANS = {
17
+ Free: { monthlyPrice: 0, monthlyCredits: 0, creditDiscount: 0, storageGB: 2 },
18
+ Go: { monthlyPrice: 1500, monthlyCredits: 4000, creditDiscount: 5, storageGB: 20 },
19
+ Pro: { monthlyPrice: 2999, monthlyCredits: 10000, creditDiscount: 10, storageGB: 100 },
20
+ Max: { monthlyPrice: 9900, monthlyCredits: 50000, creditDiscount: 15, storageGB: 500 },
21
+ Ultra: { monthlyPrice: 40000, monthlyCredits: 200000, creditDiscount: 20, storageGB: 2000 },
22
+ };
23
+ /** A family quota belongs to the whole group, never multiplied by member count. */
24
+ exports.OXY_ONE_FAMILY_PLANS = {
25
+ Go: { monthlyPrice: 2500, monthlyCredits: 8000, creditDiscount: 5, storageGB: 40 },
26
+ Pro: { monthlyPrice: 4900, monthlyCredits: 20000, creditDiscount: 10, storageGB: 200 },
27
+ Max: { monthlyPrice: 16900, monthlyCredits: 100000, creditDiscount: 15, storageGB: 1000 },
28
+ Ultra: { monthlyPrice: 59900, monthlyCredits: 300000, creditDiscount: 20, storageGB: 4000 },
29
+ };
30
+ exports.OXY_ONE_BUSINESS_PLANS = {
31
+ Go: {
32
+ monthlyPrice: 3900,
33
+ monthlySeatPrice: 900,
34
+ monthlyCredits: 8000,
35
+ creditsPerSeat: 2000,
36
+ creditDiscount: 15,
37
+ storageGB: 20,
38
+ storagePerSeatGB: 5,
39
+ },
40
+ Pro: {
41
+ monthlyPrice: 9999,
42
+ monthlySeatPrice: 1900,
43
+ monthlyCredits: 25000,
44
+ creditsPerSeat: 5000,
45
+ creditDiscount: 25,
46
+ storageGB: 100,
47
+ storagePerSeatGB: 10,
48
+ },
49
+ Max: {
50
+ monthlyPrice: 19900,
51
+ monthlySeatPrice: 2900,
52
+ monthlyCredits: 60000,
53
+ creditsPerSeat: 8000,
54
+ creditDiscount: 30,
55
+ storageGB: 500,
56
+ storagePerSeatGB: 25,
57
+ },
58
+ Ultra: {
59
+ monthlyPrice: 59900,
60
+ monthlySeatPrice: 4900,
61
+ monthlyCredits: 200000,
62
+ creditsPerSeat: 15000,
63
+ creditDiscount: 35,
64
+ storageGB: 2000,
65
+ storagePerSeatGB: 50,
66
+ },
67
+ };
68
+ /** Verification, basic app access and model access are not subscription gates. */
69
+ exports.OXY_ONE_CREATOR_PLANS = {
70
+ Go: { monthlyPrice: 2900, monthlyCredits: 10000, creditDiscount: 10, storageGB: 20 },
71
+ Pro: { monthlyPrice: 6900, monthlyCredits: 25000, creditDiscount: 15, storageGB: 100 },
72
+ Max: { monthlyPrice: 14900, monthlyCredits: 60000, creditDiscount: 20, storageGB: 500 },
73
+ Ultra: { monthlyPrice: 49900, monthlyCredits: 250000, creditDiscount: 25, storageGB: 2000 },
74
+ };
75
+ function getOnePlans(audience, mode = 'individual') {
76
+ const plans = audience === 'business'
77
+ ? exports.OXY_ONE_BUSINESS_PLANS
78
+ : audience === 'creator'
79
+ ? exports.OXY_ONE_CREATOR_PLANS
80
+ : mode === 'family'
81
+ ? exports.OXY_ONE_FAMILY_PLANS
82
+ : exports.OXY_ONE_PERSONAL_PLANS;
83
+ return Object.entries(plans).map(([name, plan]) => ({ name, ...plan }));
84
+ }
85
+ /** Each product owns its tier names; an Oxy One level selects an app subscription.
86
+ * Bundle inclusion is a proposal and does not activate product entitlements. */
87
+ exports.OXY_ONE_APP_SUBSCRIPTIONS = {
88
+ alia: { name: 'Alia', tiers: { Free: null, Go: 'Go', Pro: 'Pro', Max: 'Max', Ultra: 'Ultra' } },
89
+ // Product-owned names; these bundle mappings remain a proposal.
90
+ mention: {
91
+ name: 'Mention',
92
+ tiers: { Free: null, Go: 'Plus', Pro: 'Plus', Max: 'Plus', Ultra: 'Plus' },
93
+ },
94
+ mercaria: {
95
+ name: 'Mercaria',
96
+ tiers: { Free: null, Go: 'Go', Pro: 'Plus', Max: 'Plus', Ultra: 'Ultra' },
97
+ creatorTiers: { Free: null, Go: 'Creator', Pro: 'Creator', Max: 'Creator', Ultra: 'Creator' },
98
+ },
99
+ noted: { name: 'Noted', tiers: { Free: null, Go: '+', Pro: '+', Max: '+', Ultra: '+' } },
100
+ clarity: {
101
+ name: 'Clarity',
102
+ tiers: { Free: null, Go: null, Pro: 'Plus', Max: 'Plus', Ultra: 'Plus' },
103
+ },
104
+ schedio: {
105
+ name: 'Schedio',
106
+ tiers: { Free: null, Go: null, Pro: 'Plus', Max: 'Plus', Ultra: 'Plus' },
107
+ },
108
+ inbox: {
109
+ name: 'Inbox',
110
+ tiers: { Free: null, Go: null, Pro: 'Plus', Max: 'Plus', Ultra: 'Plus' },
111
+ },
112
+ homiio: {
113
+ name: 'Homiio',
114
+ tiers: { Free: null, Go: 'Plus', Pro: 'Plus', Max: 'Plus', Ultra: 'Plus' },
115
+ },
116
+ };
117
+ /** Annual rounding follows the billable base and per-seat line items. */
118
+ function onePlanQuote(plan, period, seats) {
119
+ const annual = (value) => Math.round(value * 12 * (1 - exports.OXY_ONE_ANNUAL_DISCOUNT / 100));
120
+ const baseAnnual = annual(plan.monthlyPrice);
121
+ const seatAnnual = plan.monthlySeatPrice === undefined ? undefined : annual(plan.monthlySeatPrice);
122
+ const known = plan.monthlySeatPrice === undefined || seats !== undefined;
123
+ const totalAnnual = known ? baseAnnual + (seatAnnual ?? 0) * (seats ?? 0) : undefined;
124
+ return {
125
+ baseMonthly: period === 'annual' ? Math.round(baseAnnual / 12) : plan.monthlyPrice,
126
+ seatMonthly: seatAnnual === undefined
127
+ ? undefined
128
+ : period === 'annual'
129
+ ? Math.round(seatAnnual / 12)
130
+ : plan.monthlySeatPrice,
131
+ totalMonthly: totalAnnual === undefined
132
+ ? undefined
133
+ : period === 'annual'
134
+ ? Math.round(totalAnnual / 12)
135
+ : plan.monthlyPrice + (plan.monthlySeatPrice ?? 0) * (seats ?? 0),
136
+ totalAnnual,
137
+ storageGB: known ? plan.storageGB + (plan.storagePerSeatGB ?? 0) * (seats ?? 0) : undefined,
138
+ monthlyCredits: known
139
+ ? plan.monthlyCredits + (plan.creditsPerSeat ?? 0) * (seats ?? 0)
140
+ : undefined,
141
+ };
142
+ }
@@ -169,6 +169,38 @@ export const agentRequesterCeilingSchema = agentRequesterCeilingWriteSchema
169
169
  updatedAt: z.string().datetime(),
170
170
  })
171
171
  .strict();
172
+ /**
173
+ * Where an application's own agent opens (ADR 0044): `anywhere`, or only in
174
+ * sessions that belong to that application (`own_application`). An agent with
175
+ * no application row is available anywhere.
176
+ */
177
+ export const APPLICATION_AGENT_AVAILABILITIES = ['anywhere', 'own_application'];
178
+ export const applicationAgentAvailabilitySchema = z.enum(APPLICATION_AGENT_AVAILABILITIES);
179
+ /** What Oxy staff write for one of an application's agents. */
180
+ export const applicationAgentWriteSchema = z
181
+ .object({ availability: applicationAgentAvailabilitySchema })
182
+ .strict();
183
+ /** One row of the application registry's agents: an agent is one application's. */
184
+ export const applicationAgentSchema = applicationAgentWriteSchema
185
+ .extend({
186
+ applicationId: identifierSchema,
187
+ agentAccountId: identifierSchema,
188
+ createdByUserId: identifierSchema.nullable(),
189
+ createdAt: z.string().datetime(),
190
+ updatedAt: z.string().datetime(),
191
+ })
192
+ .strict();
193
+ /**
194
+ * `GET /capabilities/agent-availability/:agentAccountId`: the sessions an agent
195
+ * is reachable from. `anywhere: false` lists the applications whose sessions
196
+ * (the session validation answer's `applicationId`) may reach it.
197
+ */
198
+ export const agentAvailabilitySchema = z.discriminatedUnion('anywhere', [
199
+ z.object({ anywhere: z.literal(true) }).strict(),
200
+ z
201
+ .object({ anywhere: z.literal(false), applicationIds: z.array(identifierSchema).min(1) })
202
+ .strict(),
203
+ ]);
172
204
  export const automationTriggerSchema = z.discriminatedUnion('type', [
173
205
  z.object({ type: z.literal('manual') }).strict(),
174
206
  z