@oxy.so/contracts 5.7.0 → 5.8.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.
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /**
3
+ * Oxy Console first-run onboarding constants, without Zod. Schemas:
4
+ * `../consoleOnboarding.ts`.
5
+ *
6
+ * Part of `@oxy.so/contracts/client`: never import `zod` here (see `./check.ts`).
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.CONSOLE_USE_CASES = exports.CONSOLE_TERMS_VERSION = void 0;
10
+ /**
11
+ * The version of the Console terms a person accepts. A date string: bump it
12
+ * when the terms change and every person is asked to accept again. The API
13
+ * refuses any other version, and the Console shows the acceptance step while
14
+ * the version a person accepted differs from this one.
15
+ */
16
+ exports.CONSOLE_TERMS_VERSION = '2026-10-22';
17
+ /** What a person says they came to Oxy Console to do. A closed set. */
18
+ exports.CONSOLE_USE_CASES = [
19
+ 'build-with-api',
20
+ 'ai-models',
21
+ 'publish-apps',
22
+ 'billing-credits',
23
+ 'explore-platform',
24
+ ];
@@ -32,9 +32,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
32
32
  Object.defineProperty(exports, "__esModule", { value: true });
33
33
  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.isPlainTextTitle = exports.accountTitleCheck = exports.accountNamePolicyForKind = exports.ACCOUNT_TITLE_MAX_LENGTH = exports.ACCOUNT_TITLE_DISALLOWED_SOURCE = exports.ACCOUNT_NAME_POLICY_BY_KIND = exports.newlyAddedRetiredCategories = exports.kindAcceptsAccountCategories = exports.isSelectableAccountCategoryId = exports.isOperatorSwitchTargetKind = exports.isMemberOperatedKind = 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;
34
34
  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 = exports.deviceJoinCodeResponseCheck = exports.deviceBackgroundCredentialResponseCheck = exports.activeTokenCheck = exports.SESSION_ACCOUNTS_CHANGED_EVENT = exports.deviceDirectorySyncCheck = exports.deviceDirectoryCheck = exports.deviceActivateResponseCheck = void 0;
35
- 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 = exports.productSubscriptionCancellationResultCheck = exports.productPlanCheckoutRequestCheck = exports.productPlanCatalogueCheck = exports.personalPlanCheckoutResultCheck = exports.personalPlanCheckoutRequestCheck = exports.personalPlanCatalogueCheck = exports.cancelProductSubscriptionCheck = void 0;
36
- 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 = exports.isSecondFactorRequired = exports.isEmailSignInChooseAccount = exports.emailSignInStartResponseCheck = exports.emailSignInPendingCheck = exports.emailSignInLinkResponseCheck = exports.emailSignInChooseAccountCheck = exports.TOTP_PERIOD_SECONDS = void 0;
37
- exports.FREE_USER_PROFILE_COLOR_PRESETS = exports.USER_PROFILE_COLOR_PRESETS = exports.USER_PROFILE_COLORS = exports.appAttestKeyResponseCheck = exports.appAssertionResponseCheck = void 0;
35
+ 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.CONSOLE_USE_CASES = exports.CONSOLE_TERMS_VERSION = 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.SUPERVISION_CHANGED_EVENT = 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 = exports.productSubscriptionCancellationResultCheck = exports.productPlanCheckoutRequestCheck = exports.productPlanCatalogueCheck = exports.personalPlanCheckoutResultCheck = exports.personalPlanCheckoutRequestCheck = exports.personalPlanCatalogueCheck = exports.cancelProductSubscriptionCheck = void 0;
36
+ 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 = 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 = void 0;
37
+ exports.FREE_USER_PROFILE_COLOR_PRESETS = exports.USER_PROFILE_COLOR_PRESETS = exports.USER_PROFILE_COLORS = exports.appAttestKeyResponseCheck = exports.appAssertionResponseCheck = exports.appAssertionChallengeResponseCheck = exports.OXY_APP_ASSERTION_TYPE = exports.OXY_APP_ASSERTION_TTL_SECONDS = void 0;
38
38
  var check_1 = require("./check");
39
39
  Object.defineProperty(exports, "ContractCheckError", { enumerable: true, get: function () { return check_1.ContractCheckError; } });
40
40
  Object.defineProperty(exports, "checkContract", { enumerable: true, get: function () { return check_1.checkContract; } });
@@ -170,6 +170,7 @@ var safety_1 = require("./safety");
170
170
  Object.defineProperty(exports, "PURCHASE_APPROVAL_STATUSES", { enumerable: true, get: function () { return safety_1.PURCHASE_APPROVAL_STATUSES; } });
171
171
  Object.defineProperty(exports, "SAFETY_POLICY_VERSION", { enumerable: true, get: function () { return safety_1.SAFETY_POLICY_VERSION; } });
172
172
  Object.defineProperty(exports, "SUPERVISED_ACTIONS", { enumerable: true, get: function () { return safety_1.SUPERVISED_ACTIONS; } });
173
+ Object.defineProperty(exports, "SUPERVISION_CHANGED_EVENT", { enumerable: true, get: function () { return safety_1.SUPERVISION_CHANGED_EVENT; } });
173
174
  Object.defineProperty(exports, "SUPERVISION_CONSENT_VERSION", { enumerable: true, get: function () { return safety_1.SUPERVISION_CONSENT_VERSION; } });
174
175
  Object.defineProperty(exports, "SUPERVISION_INVITATION_STATUSES", { enumerable: true, get: function () { return safety_1.SUPERVISION_INVITATION_STATUSES; } });
175
176
  Object.defineProperty(exports, "SUPERVISION_STATUSES", { enumerable: true, get: function () { return safety_1.SUPERVISION_STATUSES; } });
@@ -191,6 +192,9 @@ Object.defineProperty(exports, "supervisionReviewInputCheck", { enumerable: true
191
192
  Object.defineProperty(exports, "supervisionStateCheck", { enumerable: true, get: function () { return safety_1.supervisionStateCheck; } });
192
193
  var sessionStatus_1 = require("./sessionStatus");
193
194
  Object.defineProperty(exports, "publicApplicationCheck", { enumerable: true, get: function () { return sessionStatus_1.publicApplicationCheck; } });
195
+ var consoleOnboarding_1 = require("./consoleOnboarding");
196
+ Object.defineProperty(exports, "CONSOLE_TERMS_VERSION", { enumerable: true, get: function () { return consoleOnboarding_1.CONSOLE_TERMS_VERSION; } });
197
+ Object.defineProperty(exports, "CONSOLE_USE_CASES", { enumerable: true, get: function () { return consoleOnboarding_1.CONSOLE_USE_CASES; } });
194
198
  var signIn_1 = require("./signIn");
195
199
  Object.defineProperty(exports, "EMAIL_ACCOUNTS_MAX", { enumerable: true, get: function () { return signIn_1.EMAIL_ACCOUNTS_MAX; } });
196
200
  Object.defineProperty(exports, "EMAIL_SIGNIN_CHOICE_TTL_MS", { enumerable: true, get: function () { return signIn_1.EMAIL_SIGNIN_CHOICE_TTL_MS; } });
@@ -10,7 +10,7 @@
10
10
  * Part of `@oxy.so/contracts/client`: never import `zod` here (see `./check.ts`).
11
11
  */
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.purchaseReviewInputCheck = exports.purchaseApprovalListCheck = exports.purchaseApprovalCheck = exports.safetyOrganizationsResponseCheck = exports.safetyOrganizationsInputCheck = exports.safetyPeopleResponseCheck = exports.safetyPeopleInputCheck = exports.supervisionReviewInputCheck = exports.supervisionContactInputCheck = exports.supervisionAcceptInputCheck = exports.supervisionInviteInputCheck = exports.supervisionContactsResponseCheck = exports.supervisionStateCheck = exports.supervisionInvitationCheck = exports.profileAccessDecisionCheck = exports.profileAccessInputCheck = exports.PURCHASE_APPROVAL_STATUSES = exports.SUPERVISION_INVITATION_STATUSES = exports.SUPERVISION_STATUSES = exports.SUPERVISION_CONSENT_VERSION = exports.SAFETY_POLICY_VERSION = exports.SUPERVISED_ACTIONS = void 0;
13
+ exports.purchaseReviewInputCheck = exports.purchaseApprovalListCheck = exports.purchaseApprovalCheck = exports.safetyOrganizationsResponseCheck = exports.safetyOrganizationsInputCheck = exports.safetyPeopleResponseCheck = exports.safetyPeopleInputCheck = exports.supervisionReviewInputCheck = exports.supervisionContactInputCheck = exports.supervisionAcceptInputCheck = exports.supervisionInviteInputCheck = exports.supervisionContactsResponseCheck = exports.supervisionStateCheck = exports.supervisionInvitationCheck = exports.profileAccessDecisionCheck = exports.profileAccessInputCheck = exports.PURCHASE_APPROVAL_STATUSES = exports.SUPERVISION_CHANGED_EVENT = exports.SUPERVISION_INVITATION_STATUSES = exports.SUPERVISION_STATUSES = exports.SUPERVISION_CONSENT_VERSION = exports.SAFETY_POLICY_VERSION = exports.SUPERVISED_ACTIONS = void 0;
14
14
  const check_1 = require("./check");
15
15
  const organizations_1 = require("./organizations");
16
16
  const signIn_1 = require("./signIn");
@@ -20,6 +20,14 @@ exports.SAFETY_POLICY_VERSION = '2';
20
20
  exports.SUPERVISION_CONSENT_VERSION = '1';
21
21
  exports.SUPERVISION_STATUSES = ['active', 'orphaned', 'ended'];
22
22
  exports.SUPERVISION_INVITATION_STATUSES = ['pending', 'accepted', 'cancelled'];
23
+ /**
24
+ * Token-free Socket.IO signal emitted to room `user:<accountId>` whenever that
25
+ * account's supervision state (`GET /safety/supervision`) changes: an invitation
26
+ * is created, cancelled or accepted, or supervision is transferred or ended. It
27
+ * carries no payload; a client refetches its own state. The state it refreshes
28
+ * is advisory: the server enforces supervision on every request regardless.
29
+ */
30
+ exports.SUPERVISION_CHANGED_EVENT = 'supervision_changed';
23
31
  exports.PURCHASE_APPROVAL_STATUSES = [
24
32
  'pending',
25
33
  'approved',
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ /**
3
+ * Oxy Console first-run onboarding — the wire contract.
4
+ *
5
+ * Acceptance belongs to the PERSON, not to a workspace: one record per user,
6
+ * whichever account they are acting as. Two steps, in order: accept the
7
+ * current terms (with the adult acknowledgement), then say what the Console is
8
+ * for, or skip. A skip stores an empty list and still counts as answered.
9
+ *
10
+ * Platform-agnostic — zod only. ESM-safe (no `require()`).
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.saveConsoleUseCasesInputSchema = exports.CONSOLE_USE_CASE_DESCRIPTION_MAX_LENGTH = exports.acceptConsoleTermsInputSchema = exports.consoleOnboardingStateSchema = exports.consoleUseCaseIdSchema = exports.CONSOLE_USE_CASES = exports.CONSOLE_TERMS_VERSION = void 0;
14
+ const zod_1 = require("zod");
15
+ const consoleOnboarding_1 = require("./client/consoleOnboarding");
16
+ var consoleOnboarding_2 = require("./client/consoleOnboarding");
17
+ Object.defineProperty(exports, "CONSOLE_TERMS_VERSION", { enumerable: true, get: function () { return consoleOnboarding_2.CONSOLE_TERMS_VERSION; } });
18
+ Object.defineProperty(exports, "CONSOLE_USE_CASES", { enumerable: true, get: function () { return consoleOnboarding_2.CONSOLE_USE_CASES; } });
19
+ exports.consoleUseCaseIdSchema = zod_1.z.enum(consoleOnboarding_1.CONSOLE_USE_CASES);
20
+ /** `GET /console/onboarding`. A person with no record gets the empty state. */
21
+ exports.consoleOnboardingStateSchema = zod_1.z.object({
22
+ /** The terms version the person accepted, or null when none. */
23
+ termsVersion: zod_1.z.string().nullable(),
24
+ termsAcceptedAt: zod_1.z.string().nullable(),
25
+ /** True when `termsVersion` is the current {@link CONSOLE_TERMS_VERSION}. */
26
+ termsCurrent: zod_1.z.boolean(),
27
+ marketingOptIn: zod_1.z.boolean(),
28
+ useCases: zod_1.z.array(exports.consoleUseCaseIdSchema),
29
+ /** The person's own words about their use cases, or null. */
30
+ useCaseDescription: zod_1.z.string().nullable(),
31
+ /** True once the person picked options or skipped. */
32
+ useCasesAnswered: zod_1.z.boolean(),
33
+ });
34
+ /** `POST /console/onboarding/terms`. */
35
+ exports.acceptConsoleTermsInputSchema = zod_1.z.object({
36
+ version: zod_1.z.string().min(1).max(64),
37
+ adultAcknowledged: zod_1.z.literal(true),
38
+ /** Understands the account may be suspended or terminated for violating the AUP/Terms. */
39
+ aupAcknowledged: zod_1.z.literal(true),
40
+ marketingOptIn: zod_1.z.boolean(),
41
+ });
42
+ /** `POST /console/onboarding/use-cases`. Empty means the person skipped. */
43
+ exports.CONSOLE_USE_CASE_DESCRIPTION_MAX_LENGTH = 2000;
44
+ exports.saveConsoleUseCasesInputSchema = zod_1.z.object({
45
+ /** Optional free text; trimmed, and blank counts as absent. */
46
+ description: zod_1.z.string().trim().max(exports.CONSOLE_USE_CASE_DESCRIPTION_MAX_LENGTH).optional(),
47
+ useCases: zod_1.z
48
+ .array(exports.consoleUseCaseIdSchema)
49
+ .max(consoleOnboarding_1.CONSOLE_USE_CASES.length)
50
+ .transform((ids) => [...new Set(ids)]),
51
+ });
package/dist/cjs/index.js CHANGED
@@ -860,6 +860,7 @@ __exportStar(require("./accountAccess"), exports);
860
860
  __exportStar(require("./notifications"), exports);
861
861
  __exportStar(require("./email/messages"), exports);
862
862
  __exportStar(require("./stickers"), exports);
863
+ __exportStar(require("./consoleOnboarding"), exports);
863
864
  var access_1 = require("./products/access");
864
865
  Object.defineProperty(exports, "productDefinitionSchema", { enumerable: true, get: function () { return access_1.productDefinitionSchema; } });
865
866
  Object.defineProperty(exports, "subjectProductAccessQuerySchema", { enumerable: true, get: function () { return access_1.subjectProductAccessQuerySchema; } });
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.supervisionInviteInputSchema = exports.safetyErrorSchema = exports.SAFETY_ERROR_CODES = exports.cancelPurchaseSchema = exports.confirmPurchaseSchema = exports.reservePurchaseSchema = exports.purchaseApprovalListSchema = exports.purchaseApprovalSummarySchema = exports.purchaseApprovalSchema = exports.purchaseEffectsSchema = exports.purchaseApprovalLineSchema = exports.supervisionContactsResponseSchema = exports.supervisionStateSchema = exports.supervisionContactSchema = exports.supervisionInvitationSchema = exports.supervisionSchema = exports.safetyRequesterSchema = exports.messagingSessionsResponseSchema = exports.messagingSessionsInputSchema = exports.messageAccessBatchResponseSchema = exports.deliveryAccessBatchInputSchema = exports.messageAccessBatchInputSchema = exports.deliveryAccessInputSchema = exports.contentAccessBatchResponseSchema = exports.contentAccessBatchInputSchema = exports.publicationPoliciesResponseSchema = exports.publicationPoliciesInputSchema = exports.publicationPolicySchema = exports.contentAccessInputSchema = exports.CONTENT_CLASSIFICATIONS = exports.contactAccessResponseSchema = exports.contactAccessInputSchema = exports.messageAccessInputSchema = exports.MESSAGE_ACCESS_MAX_INPUT_BYTES = exports.MESSAGE_ACCESS_MAX_PARTICIPANT_SLOTS = exports.MESSAGE_ACCESS_MAX_SUPERVISED_PARTICIPANTS = exports.MESSAGE_ACCESS_MAX_PARTICIPANTS = exports.MESSAGE_ACCESS_MAX_RESOURCES = exports.profileAccessBatchResponseSchema = exports.profileAccessBatchInputSchema = exports.safetyDecisionSchema = exports.SAFETY_DECISION_REASONS = exports.profileAccessDecisionSchema = exports.profileAccessInputSchema = exports.SUPERVISION_STATUSES = exports.SUPERVISION_INVITATION_STATUSES = exports.SUPERVISION_CONSENT_VERSION = exports.SUPERVISED_ACTIONS = exports.SAFETY_POLICY_VERSION = exports.PURCHASE_APPROVAL_STATUSES = void 0;
4
- exports.safetyOrganizationsResponseSchema = exports.safetyOrganizationsInputSchema = exports.safetyOrganizationIdentitySchema = exports.safetyPeopleResponseSchema = exports.safetyPeopleInputSchema = exports.safetyPersonSchema = exports.safetySessionValidationSchema = exports.safetySessionInputSchema = exports.purchaseReviewInputSchema = exports.supervisionReviewInputSchema = exports.supervisionContactInputSchema = exports.supervisionAcceptInputSchema = void 0;
3
+ exports.safetyErrorSchema = exports.SAFETY_ERROR_CODES = exports.cancelPurchaseSchema = exports.confirmPurchaseSchema = exports.reservePurchaseSchema = exports.purchaseApprovalListSchema = exports.purchaseApprovalSummarySchema = exports.purchaseApprovalSchema = exports.purchaseEffectsSchema = exports.purchaseApprovalLineSchema = exports.supervisionContactsResponseSchema = exports.supervisionStateSchema = exports.supervisionContactSchema = exports.supervisionInvitationSchema = exports.supervisionSchema = exports.safetyRequesterSchema = exports.messagingSessionsResponseSchema = exports.messagingSessionsInputSchema = exports.messageAccessBatchResponseSchema = exports.deliveryAccessBatchInputSchema = exports.messageAccessBatchInputSchema = exports.deliveryAccessInputSchema = exports.contentAccessBatchResponseSchema = exports.contentAccessBatchInputSchema = exports.publicationPoliciesResponseSchema = exports.publicationPoliciesInputSchema = exports.publicationPolicySchema = exports.contentAccessInputSchema = exports.CONTENT_CLASSIFICATIONS = exports.contactAccessResponseSchema = exports.contactAccessInputSchema = exports.messageAccessInputSchema = exports.MESSAGE_ACCESS_MAX_INPUT_BYTES = exports.MESSAGE_ACCESS_MAX_PARTICIPANT_SLOTS = exports.MESSAGE_ACCESS_MAX_SUPERVISED_PARTICIPANTS = exports.MESSAGE_ACCESS_MAX_PARTICIPANTS = exports.MESSAGE_ACCESS_MAX_RESOURCES = exports.profileAccessBatchResponseSchema = exports.profileAccessBatchInputSchema = exports.safetyDecisionSchema = exports.SAFETY_DECISION_REASONS = exports.profileAccessDecisionSchema = exports.profileAccessInputSchema = exports.SUPERVISION_STATUSES = exports.SUPERVISION_INVITATION_STATUSES = exports.SUPERVISION_CONSENT_VERSION = exports.SUPERVISION_CHANGED_EVENT = exports.SUPERVISED_ACTIONS = exports.SAFETY_POLICY_VERSION = exports.PURCHASE_APPROVAL_STATUSES = void 0;
4
+ exports.safetyOrganizationsResponseSchema = exports.safetyOrganizationsInputSchema = exports.safetyOrganizationIdentitySchema = exports.safetyPeopleResponseSchema = exports.safetyPeopleInputSchema = exports.safetyPersonSchema = exports.safetySessionValidationSchema = exports.safetySessionInputSchema = exports.purchaseReviewInputSchema = exports.supervisionReviewInputSchema = exports.supervisionContactInputSchema = exports.supervisionAcceptInputSchema = exports.supervisionInviteInputSchema = void 0;
5
5
  const zod_1 = require("zod");
6
6
  const accountSubject_1 = require("./accountSubject");
7
7
  // The Zod-free half of this contract lives in `./client/` (`@oxy.so/contracts/client`);
@@ -10,6 +10,7 @@ const safety_1 = require("./client/safety");
10
10
  Object.defineProperty(exports, "PURCHASE_APPROVAL_STATUSES", { enumerable: true, get: function () { return safety_1.PURCHASE_APPROVAL_STATUSES; } });
11
11
  Object.defineProperty(exports, "SAFETY_POLICY_VERSION", { enumerable: true, get: function () { return safety_1.SAFETY_POLICY_VERSION; } });
12
12
  Object.defineProperty(exports, "SUPERVISED_ACTIONS", { enumerable: true, get: function () { return safety_1.SUPERVISED_ACTIONS; } });
13
+ Object.defineProperty(exports, "SUPERVISION_CHANGED_EVENT", { enumerable: true, get: function () { return safety_1.SUPERVISION_CHANGED_EVENT; } });
13
14
  Object.defineProperty(exports, "SUPERVISION_CONSENT_VERSION", { enumerable: true, get: function () { return safety_1.SUPERVISION_CONSENT_VERSION; } });
14
15
  Object.defineProperty(exports, "SUPERVISION_INVITATION_STATUSES", { enumerable: true, get: function () { return safety_1.SUPERVISION_INVITATION_STATUSES; } });
15
16
  Object.defineProperty(exports, "SUPERVISION_STATUSES", { enumerable: true, get: function () { return safety_1.SUPERVISION_STATUSES; } });
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Oxy Console first-run onboarding constants, without Zod. Schemas:
3
+ * `../consoleOnboarding.ts`.
4
+ *
5
+ * Part of `@oxy.so/contracts/client`: never import `zod` here (see `./check.ts`).
6
+ */
7
+ /**
8
+ * The version of the Console terms a person accepts. A date string: bump it
9
+ * when the terms change and every person is asked to accept again. The API
10
+ * refuses any other version, and the Console shows the acceptance step while
11
+ * the version a person accepted differs from this one.
12
+ */
13
+ export const CONSOLE_TERMS_VERSION = '2026-10-22';
14
+ /** What a person says they came to Oxy Console to do. A closed set. */
15
+ export const CONSOLE_USE_CASES = [
16
+ 'build-with-api',
17
+ 'ai-models',
18
+ 'publish-apps',
19
+ 'billing-credits',
20
+ 'explore-platform',
21
+ ];
@@ -31,8 +31,9 @@ export { ORGANIZATION_ALIAS_KINDS, ORGANIZATION_CLAIM_DECISIONS, ORGANIZATION_CL
31
31
  export { cancelProductSubscriptionCheck, personalPlanCatalogueCheck, personalPlanCheckoutRequestCheck, personalPlanCheckoutResultCheck, productPlanCatalogueCheck, productPlanCheckoutRequestCheck, productSubscriptionCancellationResultCheck, productSubscriptionRenewalRequestCheck, productSubscriptionsResponseCheck, subjectProductAccessCheck, subjectProductAccessQueryCheck, subscriptionCreditGrantsResponseCheck, } from './products.js';
32
32
  export { recommendationRequestCheck } from './recommendations.js';
33
33
  export { isFullReputationBalance } from './reputation.js';
34
- export { PURCHASE_APPROVAL_STATUSES, SAFETY_POLICY_VERSION, SUPERVISED_ACTIONS, SUPERVISION_CONSENT_VERSION, SUPERVISION_INVITATION_STATUSES, SUPERVISION_STATUSES, profileAccessDecisionCheck, profileAccessInputCheck, purchaseApprovalCheck, purchaseApprovalListCheck, purchaseReviewInputCheck, safetyOrganizationsInputCheck, safetyOrganizationsResponseCheck, safetyPeopleInputCheck, safetyPeopleResponseCheck, supervisionAcceptInputCheck, supervisionContactInputCheck, supervisionContactsResponseCheck, supervisionInvitationCheck, supervisionInviteInputCheck, supervisionReviewInputCheck, supervisionStateCheck, } from './safety.js';
34
+ export { PURCHASE_APPROVAL_STATUSES, SAFETY_POLICY_VERSION, SUPERVISED_ACTIONS, SUPERVISION_CHANGED_EVENT, SUPERVISION_CONSENT_VERSION, SUPERVISION_INVITATION_STATUSES, SUPERVISION_STATUSES, profileAccessDecisionCheck, profileAccessInputCheck, purchaseApprovalCheck, purchaseApprovalListCheck, purchaseReviewInputCheck, safetyOrganizationsInputCheck, safetyOrganizationsResponseCheck, safetyPeopleInputCheck, safetyPeopleResponseCheck, supervisionAcceptInputCheck, supervisionContactInputCheck, supervisionContactsResponseCheck, supervisionInvitationCheck, supervisionInviteInputCheck, supervisionReviewInputCheck, supervisionStateCheck, } from './safety.js';
35
35
  export { publicApplicationCheck } from './sessionStatus.js';
36
+ export { CONSOLE_TERMS_VERSION, CONSOLE_USE_CASES, } from './consoleOnboarding.js';
36
37
  export { EMAIL_ACCOUNTS_MAX, EMAIL_SIGNIN_CHOICE_TTL_MS, EMAIL_SIGNIN_LINK_TTL_MS, EMAIL_SIGNIN_LONG_CODE_ALPHABET, EMAIL_SIGNIN_LONG_CODE_LENGTH, PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH, REAUTH_ACTIONS, SIGNIN_SECOND_FACTOR_MAX_ATTEMPTS, SIGNIN_SECOND_FACTOR_TTL_MS, SIGN_IN_ERROR_CODES, TOTP_BACKUP_CODE_COUNT, TOTP_DIGITS, TOTP_PERIOD_SECONDS, emailSignInChooseAccountCheck, emailSignInLinkResponseCheck, emailSignInPendingCheck, emailSignInStartResponseCheck, isEmailSignInChooseAccount, isSecondFactorRequired, normalizeEmailSignInCode, reauthProofCheck, secondFactorRequiredCheck, signInMethodsCheck, totpBackupCodesResponseCheck, totpEnrollResponseCheck, } from './signIn.js';
37
38
  export { BOT_USERNAME_INVALID_MESSAGE, BOT_USERNAME_SUFFIX, NUMERIC_USERNAME_MESSAGE, RESERVED_USERNAMES, RESERVED_USERNAME_MESSAGE, USERNAME_INVALID_MESSAGE, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN_SOURCE, applyBotUsernameSuffix, botUsernameCheck, stripDisallowedUsernameCharacters, usernameCheck, usernameCheckForAccountKind, } from './username.js';
38
39
  export { userNameCheck } from './userResponse.js';
@@ -17,6 +17,14 @@ export const SAFETY_POLICY_VERSION = '2';
17
17
  export const SUPERVISION_CONSENT_VERSION = '1';
18
18
  export const SUPERVISION_STATUSES = ['active', 'orphaned', 'ended'];
19
19
  export const SUPERVISION_INVITATION_STATUSES = ['pending', 'accepted', 'cancelled'];
20
+ /**
21
+ * Token-free Socket.IO signal emitted to room `user:<accountId>` whenever that
22
+ * account's supervision state (`GET /safety/supervision`) changes: an invitation
23
+ * is created, cancelled or accepted, or supervision is transferred or ended. It
24
+ * carries no payload; a client refetches its own state. The state it refreshes
25
+ * is advisory: the server enforces supervision on every request regardless.
26
+ */
27
+ export const SUPERVISION_CHANGED_EVENT = 'supervision_changed';
20
28
  export const PURCHASE_APPROVAL_STATUSES = [
21
29
  'pending',
22
30
  'approved',
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Oxy Console first-run onboarding — the wire contract.
3
+ *
4
+ * Acceptance belongs to the PERSON, not to a workspace: one record per user,
5
+ * whichever account they are acting as. Two steps, in order: accept the
6
+ * current terms (with the adult acknowledgement), then say what the Console is
7
+ * for, or skip. A skip stores an empty list and still counts as answered.
8
+ *
9
+ * Platform-agnostic — zod only. ESM-safe (no `require()`).
10
+ */
11
+ import { z } from 'zod';
12
+ import { CONSOLE_USE_CASES } from './client/consoleOnboarding.js';
13
+ export { CONSOLE_TERMS_VERSION, CONSOLE_USE_CASES, } from './client/consoleOnboarding.js';
14
+ export const consoleUseCaseIdSchema = z.enum(CONSOLE_USE_CASES);
15
+ /** `GET /console/onboarding`. A person with no record gets the empty state. */
16
+ export const consoleOnboardingStateSchema = z.object({
17
+ /** The terms version the person accepted, or null when none. */
18
+ termsVersion: z.string().nullable(),
19
+ termsAcceptedAt: z.string().nullable(),
20
+ /** True when `termsVersion` is the current {@link CONSOLE_TERMS_VERSION}. */
21
+ termsCurrent: z.boolean(),
22
+ marketingOptIn: z.boolean(),
23
+ useCases: z.array(consoleUseCaseIdSchema),
24
+ /** The person's own words about their use cases, or null. */
25
+ useCaseDescription: z.string().nullable(),
26
+ /** True once the person picked options or skipped. */
27
+ useCasesAnswered: z.boolean(),
28
+ });
29
+ /** `POST /console/onboarding/terms`. */
30
+ export const acceptConsoleTermsInputSchema = z.object({
31
+ version: z.string().min(1).max(64),
32
+ adultAcknowledged: z.literal(true),
33
+ /** Understands the account may be suspended or terminated for violating the AUP/Terms. */
34
+ aupAcknowledged: z.literal(true),
35
+ marketingOptIn: z.boolean(),
36
+ });
37
+ /** `POST /console/onboarding/use-cases`. Empty means the person skipped. */
38
+ export const CONSOLE_USE_CASE_DESCRIPTION_MAX_LENGTH = 2000;
39
+ export const saveConsoleUseCasesInputSchema = z.object({
40
+ /** Optional free text; trimmed, and blank counts as absent. */
41
+ description: z.string().trim().max(CONSOLE_USE_CASE_DESCRIPTION_MAX_LENGTH).optional(),
42
+ useCases: z
43
+ .array(consoleUseCaseIdSchema)
44
+ .max(CONSOLE_USE_CASES.length)
45
+ .transform((ids) => [...new Set(ids)]),
46
+ });
package/dist/esm/index.js CHANGED
@@ -193,6 +193,7 @@ export * from './accountAccess.js';
193
193
  export * from './notifications.js';
194
194
  export * from './email/messages.js';
195
195
  export * from './stickers.js';
196
+ export * from './consoleOnboarding.js';
196
197
  export { productDefinitionSchema, subjectProductAccessQuerySchema, productBenefitSchema, productOfferSchema, productSubscriptionSourceSchema, productAccessGrantSchema, subjectProductGrantSnapshotSchema, productOfferSegmentSchema, subjectProductAccessSchema, } from './products/access.js';
197
198
  export { meteredGenerationSchema } from './inference/economics.js';
198
199
  export { canonicalCapabilityJson, inputSatisfiesCapabilityLimits, isLoopbackOrigin, } from './capabilityBindings.js';
@@ -2,11 +2,11 @@ import { z } from 'zod';
2
2
  import { accountActorChainSchema } from './accountSubject.js';
3
3
  // The Zod-free half of this contract lives in `./client/` (`@oxy.so/contracts/client`);
4
4
  // its vocabularies are re-exported here so the root entry is unchanged.
5
- import { PURCHASE_APPROVAL_STATUSES, SAFETY_POLICY_VERSION, SUPERVISED_ACTIONS, SUPERVISION_CONSENT_VERSION, SUPERVISION_INVITATION_STATUSES, SUPERVISION_STATUSES, } from './client/safety.js';
5
+ import { PURCHASE_APPROVAL_STATUSES, SAFETY_POLICY_VERSION, SUPERVISED_ACTIONS, SUPERVISION_CHANGED_EVENT, SUPERVISION_CONSENT_VERSION, SUPERVISION_INVITATION_STATUSES, SUPERVISION_STATUSES, } from './client/safety.js';
6
6
  import { ORGANIZATION_TYPES } from './organizations.js';
7
7
  import { reauthProofSchema } from './signIn.js';
8
8
  import { userResponseSchema } from './userResponse.js';
9
- export { PURCHASE_APPROVAL_STATUSES, SAFETY_POLICY_VERSION, SUPERVISED_ACTIONS, SUPERVISION_CONSENT_VERSION, SUPERVISION_INVITATION_STATUSES, SUPERVISION_STATUSES, };
9
+ export { PURCHASE_APPROVAL_STATUSES, SAFETY_POLICY_VERSION, SUPERVISED_ACTIONS, SUPERVISION_CHANGED_EVENT, SUPERVISION_CONSENT_VERSION, SUPERVISION_INVITATION_STATUSES, SUPERVISION_STATUSES, };
10
10
  /** The requester is authenticated by the bearer; applications cannot submit viewer IDs. */
11
11
  export const profileAccessInputSchema = z
12
12
  .object({ subjectAccountId: z.string().min(1).max(128) })
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Oxy Console first-run onboarding constants, without Zod. Schemas:
3
+ * `../consoleOnboarding.ts`.
4
+ *
5
+ * Part of `@oxy.so/contracts/client`: never import `zod` here (see `./check.ts`).
6
+ */
7
+ /**
8
+ * The version of the Console terms a person accepts. A date string: bump it
9
+ * when the terms change and every person is asked to accept again. The API
10
+ * refuses any other version, and the Console shows the acceptance step while
11
+ * the version a person accepted differs from this one.
12
+ */
13
+ export declare const CONSOLE_TERMS_VERSION = "2026-10-22";
14
+ /** What a person says they came to Oxy Console to do. A closed set. */
15
+ export declare const CONSOLE_USE_CASES: readonly ["build-with-api", "ai-models", "publish-apps", "billing-credits", "explore-platform"];
16
+ export type ConsoleUseCaseId = (typeof CONSOLE_USE_CASES)[number];
@@ -31,8 +31,9 @@ export { ORGANIZATION_ALIAS_KINDS, ORGANIZATION_CLAIM_DECISIONS, ORGANIZATION_CL
31
31
  export { cancelProductSubscriptionCheck, personalPlanCatalogueCheck, personalPlanCheckoutRequestCheck, personalPlanCheckoutResultCheck, productPlanCatalogueCheck, productPlanCheckoutRequestCheck, productSubscriptionCancellationResultCheck, productSubscriptionRenewalRequestCheck, productSubscriptionsResponseCheck, subjectProductAccessCheck, subjectProductAccessQueryCheck, subscriptionCreditGrantsResponseCheck, } from './products';
32
32
  export { recommendationRequestCheck } from './recommendations';
33
33
  export { isFullReputationBalance } from './reputation';
34
- export { PURCHASE_APPROVAL_STATUSES, SAFETY_POLICY_VERSION, SUPERVISED_ACTIONS, SUPERVISION_CONSENT_VERSION, SUPERVISION_INVITATION_STATUSES, SUPERVISION_STATUSES, profileAccessDecisionCheck, profileAccessInputCheck, purchaseApprovalCheck, purchaseApprovalListCheck, purchaseReviewInputCheck, safetyOrganizationsInputCheck, safetyOrganizationsResponseCheck, safetyPeopleInputCheck, safetyPeopleResponseCheck, supervisionAcceptInputCheck, supervisionContactInputCheck, supervisionContactsResponseCheck, supervisionInvitationCheck, supervisionInviteInputCheck, supervisionReviewInputCheck, supervisionStateCheck, } from './safety';
34
+ export { PURCHASE_APPROVAL_STATUSES, SAFETY_POLICY_VERSION, SUPERVISED_ACTIONS, SUPERVISION_CHANGED_EVENT, SUPERVISION_CONSENT_VERSION, SUPERVISION_INVITATION_STATUSES, SUPERVISION_STATUSES, profileAccessDecisionCheck, profileAccessInputCheck, purchaseApprovalCheck, purchaseApprovalListCheck, purchaseReviewInputCheck, safetyOrganizationsInputCheck, safetyOrganizationsResponseCheck, safetyPeopleInputCheck, safetyPeopleResponseCheck, supervisionAcceptInputCheck, supervisionContactInputCheck, supervisionContactsResponseCheck, supervisionInvitationCheck, supervisionInviteInputCheck, supervisionReviewInputCheck, supervisionStateCheck, } from './safety';
35
35
  export { publicApplicationCheck } from './sessionStatus';
36
+ export { CONSOLE_TERMS_VERSION, CONSOLE_USE_CASES, type ConsoleUseCaseId, } from './consoleOnboarding';
36
37
  export { EMAIL_ACCOUNTS_MAX, EMAIL_SIGNIN_CHOICE_TTL_MS, EMAIL_SIGNIN_LINK_TTL_MS, EMAIL_SIGNIN_LONG_CODE_ALPHABET, EMAIL_SIGNIN_LONG_CODE_LENGTH, PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH, REAUTH_ACTIONS, SIGNIN_SECOND_FACTOR_MAX_ATTEMPTS, SIGNIN_SECOND_FACTOR_TTL_MS, SIGN_IN_ERROR_CODES, TOTP_BACKUP_CODE_COUNT, TOTP_DIGITS, TOTP_PERIOD_SECONDS, emailSignInChooseAccountCheck, emailSignInLinkResponseCheck, emailSignInPendingCheck, emailSignInStartResponseCheck, isEmailSignInChooseAccount, isSecondFactorRequired, normalizeEmailSignInCode, reauthProofCheck, secondFactorRequiredCheck, signInMethodsCheck, totpBackupCodesResponseCheck, totpEnrollResponseCheck, } from './signIn';
37
38
  export { BOT_USERNAME_INVALID_MESSAGE, BOT_USERNAME_SUFFIX, NUMERIC_USERNAME_MESSAGE, RESERVED_USERNAMES, RESERVED_USERNAME_MESSAGE, USERNAME_INVALID_MESSAGE, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN_SOURCE, applyBotUsernameSuffix, botUsernameCheck, stripDisallowedUsernameCharacters, usernameCheck, usernameCheckForAccountKind, } from './username';
38
39
  export { userNameCheck } from './userResponse';
@@ -15,6 +15,14 @@ export declare const SAFETY_POLICY_VERSION: "2";
15
15
  export declare const SUPERVISION_CONSENT_VERSION: "1";
16
16
  export declare const SUPERVISION_STATUSES: readonly ["active", "orphaned", "ended"];
17
17
  export declare const SUPERVISION_INVITATION_STATUSES: readonly ["pending", "accepted", "cancelled"];
18
+ /**
19
+ * Token-free Socket.IO signal emitted to room `user:<accountId>` whenever that
20
+ * account's supervision state (`GET /safety/supervision`) changes: an invitation
21
+ * is created, cancelled or accepted, or supervision is transferred or ended. It
22
+ * carries no payload; a client refetches its own state. The state it refreshes
23
+ * is advisory: the server enforces supervision on every request regardless.
24
+ */
25
+ export declare const SUPERVISION_CHANGED_EVENT = "supervision_changed";
18
26
  export declare const PURCHASE_APPROVAL_STATUSES: readonly ["pending", "approved", "rejected", "reserved", "confirmed", "cancelled"];
19
27
  export declare const profileAccessInputCheck: Check<{
20
28
  subjectAccountId: string;
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Oxy Console first-run onboarding — the wire contract.
3
+ *
4
+ * Acceptance belongs to the PERSON, not to a workspace: one record per user,
5
+ * whichever account they are acting as. Two steps, in order: accept the
6
+ * current terms (with the adult acknowledgement), then say what the Console is
7
+ * for, or skip. A skip stores an empty list and still counts as answered.
8
+ *
9
+ * Platform-agnostic — zod only. ESM-safe (no `require()`).
10
+ */
11
+ import { z } from 'zod';
12
+ export { CONSOLE_TERMS_VERSION, CONSOLE_USE_CASES, type ConsoleUseCaseId, } from './client/consoleOnboarding';
13
+ export declare const consoleUseCaseIdSchema: z.ZodEnum<["build-with-api", "ai-models", "publish-apps", "billing-credits", "explore-platform"]>;
14
+ /** `GET /console/onboarding`. A person with no record gets the empty state. */
15
+ export declare const consoleOnboardingStateSchema: z.ZodObject<{
16
+ /** The terms version the person accepted, or null when none. */
17
+ termsVersion: z.ZodNullable<z.ZodString>;
18
+ termsAcceptedAt: z.ZodNullable<z.ZodString>;
19
+ /** True when `termsVersion` is the current {@link CONSOLE_TERMS_VERSION}. */
20
+ termsCurrent: z.ZodBoolean;
21
+ marketingOptIn: z.ZodBoolean;
22
+ useCases: z.ZodArray<z.ZodEnum<["build-with-api", "ai-models", "publish-apps", "billing-credits", "explore-platform"]>, "many">;
23
+ /** The person's own words about their use cases, or null. */
24
+ useCaseDescription: z.ZodNullable<z.ZodString>;
25
+ /** True once the person picked options or skipped. */
26
+ useCasesAnswered: z.ZodBoolean;
27
+ }, "strip", z.ZodTypeAny, {
28
+ termsVersion: string | null;
29
+ termsAcceptedAt: string | null;
30
+ termsCurrent: boolean;
31
+ marketingOptIn: boolean;
32
+ useCases: ("build-with-api" | "ai-models" | "publish-apps" | "billing-credits" | "explore-platform")[];
33
+ useCaseDescription: string | null;
34
+ useCasesAnswered: boolean;
35
+ }, {
36
+ termsVersion: string | null;
37
+ termsAcceptedAt: string | null;
38
+ termsCurrent: boolean;
39
+ marketingOptIn: boolean;
40
+ useCases: ("build-with-api" | "ai-models" | "publish-apps" | "billing-credits" | "explore-platform")[];
41
+ useCaseDescription: string | null;
42
+ useCasesAnswered: boolean;
43
+ }>;
44
+ export type ConsoleOnboardingState = z.infer<typeof consoleOnboardingStateSchema>;
45
+ /** `POST /console/onboarding/terms`. */
46
+ export declare const acceptConsoleTermsInputSchema: z.ZodObject<{
47
+ version: z.ZodString;
48
+ adultAcknowledged: z.ZodLiteral<true>;
49
+ /** Understands the account may be suspended or terminated for violating the AUP/Terms. */
50
+ aupAcknowledged: z.ZodLiteral<true>;
51
+ marketingOptIn: z.ZodBoolean;
52
+ }, "strip", z.ZodTypeAny, {
53
+ version: string;
54
+ marketingOptIn: boolean;
55
+ adultAcknowledged: true;
56
+ aupAcknowledged: true;
57
+ }, {
58
+ version: string;
59
+ marketingOptIn: boolean;
60
+ adultAcknowledged: true;
61
+ aupAcknowledged: true;
62
+ }>;
63
+ export type AcceptConsoleTermsInput = z.infer<typeof acceptConsoleTermsInputSchema>;
64
+ /** `POST /console/onboarding/use-cases`. Empty means the person skipped. */
65
+ export declare const CONSOLE_USE_CASE_DESCRIPTION_MAX_LENGTH = 2000;
66
+ export declare const saveConsoleUseCasesInputSchema: z.ZodObject<{
67
+ /** Optional free text; trimmed, and blank counts as absent. */
68
+ description: z.ZodOptional<z.ZodString>;
69
+ useCases: z.ZodEffects<z.ZodArray<z.ZodEnum<["build-with-api", "ai-models", "publish-apps", "billing-credits", "explore-platform"]>, "many">, ("build-with-api" | "ai-models" | "publish-apps" | "billing-credits" | "explore-platform")[], ("build-with-api" | "ai-models" | "publish-apps" | "billing-credits" | "explore-platform")[]>;
70
+ }, "strip", z.ZodTypeAny, {
71
+ useCases: ("build-with-api" | "ai-models" | "publish-apps" | "billing-credits" | "explore-platform")[];
72
+ description?: string | undefined;
73
+ }, {
74
+ useCases: ("build-with-api" | "ai-models" | "publish-apps" | "billing-credits" | "explore-platform")[];
75
+ description?: string | undefined;
76
+ }>;
77
+ export type SaveConsoleUseCasesInput = z.input<typeof saveConsoleUseCasesInputSchema>;
@@ -121,6 +121,7 @@ export * from './accountAccess';
121
121
  export * from './notifications';
122
122
  export * from './email/messages';
123
123
  export * from './stickers';
124
+ export * from './consoleOnboarding';
124
125
  export { productDefinitionSchema, subjectProductAccessQuerySchema, productBenefitSchema, productOfferSchema, productSubscriptionSourceSchema, productAccessGrantSchema, subjectProductGrantSnapshotSchema, productOfferSegmentSchema, subjectProductAccessSchema, } from './products/access';
125
126
  export type { ProductDefinition, SubjectProductAccessQuery, SubjectProductGrantSnapshot, ProductBenefit, ProductOffer, ProductSubscriptionSource, ProductAccessGrant, ProductOfferSegment, SubjectProductAccess, } from './products/access';
126
127
  export { meteredGenerationSchema, type MeteredGeneration } from './inference/economics';
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { PURCHASE_APPROVAL_STATUSES, SAFETY_POLICY_VERSION, SUPERVISED_ACTIONS, SUPERVISION_CONSENT_VERSION, SUPERVISION_INVITATION_STATUSES, SUPERVISION_STATUSES } from './client/safety';
3
- export { PURCHASE_APPROVAL_STATUSES, SAFETY_POLICY_VERSION, SUPERVISED_ACTIONS, SUPERVISION_CONSENT_VERSION, SUPERVISION_INVITATION_STATUSES, SUPERVISION_STATUSES, };
2
+ import { PURCHASE_APPROVAL_STATUSES, SAFETY_POLICY_VERSION, SUPERVISED_ACTIONS, SUPERVISION_CHANGED_EVENT, SUPERVISION_CONSENT_VERSION, SUPERVISION_INVITATION_STATUSES, SUPERVISION_STATUSES } from './client/safety';
3
+ export { PURCHASE_APPROVAL_STATUSES, SAFETY_POLICY_VERSION, SUPERVISED_ACTIONS, SUPERVISION_CHANGED_EVENT, SUPERVISION_CONSENT_VERSION, SUPERVISION_INVITATION_STATUSES, SUPERVISION_STATUSES, };
4
4
  /** The requester is authenticated by the bearer; applications cannot submit viewer IDs. */
5
5
  export declare const profileAccessInputSchema: z.ZodObject<{
6
6
  subjectAccountId: z.ZodString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxy.so/contracts",
3
- "version": "5.7.0",
3
+ "version": "5.8.0",
4
4
  "description": "OxyHQ API contracts — single source of truth for request/response Zod schemas and inferred types, shared by the backend and the client SDKs",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -77,7 +77,6 @@
77
77
  "typescript": "tsc --noEmit",
78
78
  "test": "jest --passWithNoTests",
79
79
  "lint": "biome lint --error-on-warnings ./src",
80
- "prepublishOnly": "node ../../scripts/assert-bun-publish.mjs && bun run clean && bun run build",
81
80
  "generate:profile-colors": "node scripts/generate-profile-colors.mjs",
82
81
  "check:profile-colors": "node scripts/generate-profile-colors.mjs --check"
83
82
  },
@@ -88,6 +87,6 @@
88
87
  "@types/node": "^20.19.43",
89
88
  "jest": "^30.5.1",
90
89
  "typescript": "^5.9.2",
91
- "@oxy.so/bloom": "12.0.0"
90
+ "@oxy.so/bloom": "15.18.0"
92
91
  }
93
92
  }