@oxyhq/contracts 0.26.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/cjs/.tsbuildinfo +1 -1
  2. package/dist/cjs/accountGraph.js +4 -3
  3. package/dist/cjs/index.js +186 -1
  4. package/dist/cjs/inference/accountBilling.js +334 -0
  5. package/dist/cjs/inference/attribution.js +106 -0
  6. package/dist/cjs/inference/catalogue.js +482 -0
  7. package/dist/cjs/inference/entitlement.js +217 -0
  8. package/dist/cjs/inference/errors.js +210 -0
  9. package/dist/cjs/inference/identifiers.js +197 -0
  10. package/dist/cjs/inference/money.js +188 -0
  11. package/dist/cjs/inference/priceVersion.js +110 -0
  12. package/dist/cjs/inference/providerConnection.js +142 -0
  13. package/dist/cjs/inference/request.js +288 -0
  14. package/dist/cjs/inference/routingPolicy.js +213 -0
  15. package/dist/cjs/inference/streamEvents.js +219 -0
  16. package/dist/cjs/inference/usage.js +297 -0
  17. package/dist/cjs/inference/version.js +85 -0
  18. package/dist/esm/.tsbuildinfo +1 -1
  19. package/dist/esm/accountGraph.js +4 -3
  20. package/dist/esm/index.js +54 -0
  21. package/dist/esm/inference/accountBilling.js +331 -0
  22. package/dist/esm/inference/attribution.js +103 -0
  23. package/dist/esm/inference/catalogue.js +479 -0
  24. package/dist/esm/inference/entitlement.js +214 -0
  25. package/dist/esm/inference/errors.js +207 -0
  26. package/dist/esm/inference/identifiers.js +194 -0
  27. package/dist/esm/inference/money.js +185 -0
  28. package/dist/esm/inference/priceVersion.js +107 -0
  29. package/dist/esm/inference/providerConnection.js +139 -0
  30. package/dist/esm/inference/request.js +285 -0
  31. package/dist/esm/inference/routingPolicy.js +210 -0
  32. package/dist/esm/inference/streamEvents.js +216 -0
  33. package/dist/esm/inference/usage.js +294 -0
  34. package/dist/esm/inference/version.js +82 -0
  35. package/dist/types/.tsbuildinfo +1 -1
  36. package/dist/types/accountGraph.d.ts +6 -5
  37. package/dist/types/index.d.ts +27 -0
  38. package/dist/types/inference/accountBilling.d.ts +738 -0
  39. package/dist/types/inference/attribution.d.ts +176 -0
  40. package/dist/types/inference/catalogue.d.ts +1612 -0
  41. package/dist/types/inference/entitlement.d.ts +519 -0
  42. package/dist/types/inference/errors.d.ts +206 -0
  43. package/dist/types/inference/identifiers.d.ts +157 -0
  44. package/dist/types/inference/money.d.ts +185 -0
  45. package/dist/types/inference/priceVersion.d.ts +182 -0
  46. package/dist/types/inference/providerConnection.d.ts +297 -0
  47. package/dist/types/inference/request.d.ts +2364 -0
  48. package/dist/types/inference/routingPolicy.d.ts +426 -0
  49. package/dist/types/inference/streamEvents.d.ts +906 -0
  50. package/dist/types/inference/usage.d.ts +1139 -0
  51. package/dist/types/inference/version.d.ts +82 -0
  52. package/package.json +1 -1
@@ -12,8 +12,8 @@ import { z } from 'zod';
12
12
  *
13
13
  * `personal` is the only kind minted by signup and the only one that carries
14
14
  * its own credentials; every other kind is a child account created under a
15
- * parent and operated through `account_members`. The API schema, the Mongoose
16
- * model and the SDK all derive from this list rather than restating it, so a
15
+ * parent and operated through `account_members`. The API schema, the Drizzle
16
+ * table and the SDK all derive from this list rather than restating it, so a
17
17
  * new kind is one edit here instead of four literals that can drift.
18
18
  */
19
19
  export type AccountKind = 'personal' | 'organization' | 'project' | 'bot' | 'channel';
@@ -24,9 +24,10 @@ export type AccountKind = 'personal' | 'organization' | 'project' | 'bot' | 'cha
24
24
  * `db/schema/users.ts` mirrors to keep the `users_kind_check` CHECK honest.
25
25
  *
26
26
  * Deriving the union from the array instead would cost nothing here and be paid
27
- * by consumers: `kind` travels into `@oxyhq/services` through
28
- * `SwitchableAccount`, where an indexed-access type is materially more
29
- * expensive to check than a literal union.
27
+ * by consumers: `kind` travels into `@oxyhq/services` on every device-directory
28
+ * context (`deviceContextSchema.kind` `DeviceContext` the switcher rows),
29
+ * and an indexed-access type is materially more expensive to check there than a
30
+ * literal union.
30
31
  */
31
32
  export declare const ACCOUNT_KINDS: readonly ["personal", "organization", "project", "bot", "channel"];
32
33
  /** `never` while `ACCOUNT_KINDS` covers the union. */
@@ -60,3 +60,30 @@ export { devicePairingStatusSchema, deviceTransferInitRequestSchema, deviceTrans
60
60
  export type { DevicePairingStatus, DeviceTransferInitRequest, DeviceTransferInitResponse, DeviceTransferInfoResponse, DeviceTransferApproveRequest, DeviceTransferApproveResponse, DeviceTransferDenyResponse, } from './devicePairing';
61
61
  export { transparencyCheckpointSignatureSchema, transparencyAnchorSchema, transparencyCheckpointSchema, transparencyInclusionProofSchema, transparencyCheckpointListSchema, } from './transparency';
62
62
  export type { TransparencyCheckpointSignature, TransparencyAnchor, TransparencyCheckpoint, TransparencyInclusionProof, TransparencyCheckpointList, } from './transparency';
63
+ export { INFERENCE_CONTRACT_VERSION, } from './inference/version';
64
+ export { oxyAccountIdSchema, delegatedUserIdSchema, oxyApplicationIdSchema, oxyCredentialIdSchema, requestIdSchema, generationIdSchema, idempotencyKeySchema, inferenceEnvironmentSchema, inferenceTimestampSchema, inferenceDateSchema, inferenceHttpsUrlSchema, publisherSlugSchema, modelSlugSchema, modelIdSchema, modelRevisionLabelSchema, modelReferenceSchema, routingProfileSlugSchema, inferenceProviderSlugSchema, deploymentIdSchema, inferenceRegionSchema, RESERVED_ALIA_PUBLISHER, } from './inference/identifiers';
65
+ export type { OxyAccountId, DelegatedUserId, InferenceEnvironment, ModelReference, ModelId, } from './inference/identifiers';
66
+ export { currencyCodeSchema, INFERENCE_MONEY_SCALE, exactDecimalSchema, moneySchema, USAGE_UNITS, usageUnitSchema, USAGE_SOURCES, usageSourceSchema, usageQuantitySchema, unitPriceSchema, } from './inference/money';
67
+ export type { CurrencyCode, ExactDecimal, Money, UsageUnit, UsageSource, UsageQuantity, UnitPrice, } from './inference/money';
68
+ export { INFERENCE_SCOPES, inferenceScopeSchema, billingPrincipalSchema, authenticatedPrincipalSchema, inferenceAttributionSchema, } from './inference/attribution';
69
+ export type { InferenceScope, BillingPrincipal, AuthenticatedPrincipal, InferenceAttribution, } from './inference/attribution';
70
+ export { INFERENCE_ERROR_CODES, NON_RETRYABLE_INFERENCE_ERROR_CODES, inferenceErrorCodeSchema, upstreamErrorCategorySchema, safeErrorTextSchema, providerErrorPassthroughSchema, inferenceErrorSchema, } from './inference/errors';
71
+ export type { InferenceErrorCode, UpstreamErrorCategory, ProviderErrorPassthrough, InferenceError, } from './inference/errors';
72
+ export { priceVersionStatusSchema, priceVersionSchema, priceSnapshotSchema, } from './inference/priceVersion';
73
+ export type { PriceVersionStatus, PriceVersion, PriceSnapshot, } from './inference/priceVersion';
74
+ export { inferenceModalitySchema, modelCapabilitiesSchema, modelLicenseSchema, modelProvenanceSchema, inferenceDataPolicySchema, availabilityScopeSchema, commercialPermissionSchema, modelDeprecationSchema, modelEvaluationResultSchema, modelSafetyMetadataSchema, modelPublisherSchema, catalogueModelSchema, modelRevisionSchema, inferenceProviderSchema, modelDeploymentSchema, routingProfileCandidateSchema, routingProfileSchema, cataloguePublisherSummarySchema, catalogueServingProviderSummarySchema, modelCatalogueEntrySchema, } from './inference/catalogue';
75
+ export type { InferenceModality, ModelCapabilities, ModelLicense, ModelProvenance, InferenceDataPolicy, AvailabilityScope, CommercialPermission, ModelDeprecation, ModelEvaluationResult, ModelSafetyMetadata, ModelPublisher, CatalogueModel, ModelRevision, InferenceProvider, ModelDeployment, RoutingProfileCandidate, RoutingProfile, CataloguePublisherSummary, CatalogueServingProviderSummary, ModelCatalogueEntry, } from './inference/catalogue';
76
+ export { routingTargetSchema, routingPolicyScopeSchema, routingFallbackPolicySchema, routingPolicySchema, routingPolicyReferenceSchema, } from './inference/routingPolicy';
77
+ export type { RoutingTarget, RoutingPolicyScope, RoutingFallbackPolicy, RoutingPolicy, RoutingPolicyReference, } from './inference/routingPolicy';
78
+ export { inferenceContentSourceSchema, inferenceContentPartSchema, inferenceToolCallSchema, inferenceMessageRoleSchema, inferenceMessageSchema, inferenceInputSchema, samplingParametersSchema, toolDefinitionSchema, toolChoiceSchema, responseFormatSchema, clientRequestMetadataSchema, inferenceRequestSchema, } from './inference/request';
79
+ export type { InferenceContentSource, InferenceContentPart, InferenceToolCall, InferenceMessageRole, InferenceMessage, InferenceInput, SamplingParameters, ToolDefinition, ToolChoice, ResponseFormat, ClientRequestMetadata, InferenceRequest, } from './inference/request';
80
+ export { inferenceStreamStartEventSchema, inferenceStreamDeltaEventSchema, inferenceStreamToolCallEventSchema, inferenceStreamUsageEventSchema, inferenceRouteSwitchDetailSchema, inferenceRouteSwitchReasonSchema, inferenceStreamRouteSwitchEventSchema, inferenceStreamErrorEventSchema, inferenceFinishReasonSchema, inferenceStreamDoneEventSchema, inferenceStreamEventSchema, } from './inference/streamEvents';
81
+ export type { InferenceStreamStartEvent, InferenceStreamDeltaEvent, InferenceStreamToolCallEvent, InferenceStreamUsageEvent, InferenceRouteSwitchDetail, InferenceRouteSwitchReason, InferenceStreamRouteSwitchEvent, InferenceStreamErrorEvent, InferenceFinishReason, InferenceStreamDoneEvent, InferenceStreamEvent, } from './inference/streamEvents';
82
+ export { usageReservationRequestSchema, usageReservationStatusSchema, usageReservationSchema, inferenceRequestOutcomeSchema, normalizedUsageReportSchema, usageReceiptSchema, usageRefundSubjectSchema, usageRefundReasonSchema, usageRefundSchema, } from './inference/usage';
83
+ export type { UsageReservationRequest, UsageReservationStatus, UsageReservation, InferenceRequestOutcome, NormalizedUsageReport, UsageReceipt, UsageRefundSubject, UsageRefundReason, UsageRefund, } from './inference/usage';
84
+ export { providerConnectionScopeSchema, providerSecretReferenceSchema, providerConnectionValidationSchema, providerConnectionStatusSchema, providerConnectionSchema, } from './inference/providerConnection';
85
+ export type { ProviderConnectionScope, ProviderConnectionValidation, ProviderConnectionStatus, ProviderConnection, } from './inference/providerConnection';
86
+ export { BILLING_MODES, billingModeSchema, BILLING_PROFILE_STATUSES, billingProfileStatusSchema, autoRechargeSchema, billingProfileSchema, accountBillingStateSchema, BILLING_INVOICE_STATUSES, billingInvoiceStatusSchema, billingInvoiceSchema, EXTERNAL_PAYMENT_PROVIDERS, externalPaymentProviderSchema, EXTERNAL_PAYMENT_KINDS, externalPaymentKindSchema, externalPaymentSchema, AUTO_RECHARGE_STATUSES, autoRechargeStatusSchema, autoRechargeAttemptSchema, RECONCILIATION_DISCREPANCY_KINDS, reconciliationDiscrepancyKindSchema, RECONCILIATION_RUN_STATUSES, reconciliationRunStatusSchema, reconciliationDiscrepancySchema, reconciliationRunSchema, reconciliationReportSchema, } from './inference/accountBilling';
87
+ export type { BillingMode, BillingProfileStatus, AutoRecharge, BillingProfile, AccountBillingState, BillingInvoiceStatus, BillingInvoice, ExternalPaymentProvider, ExternalPaymentKind, ExternalPayment, AutoRechargeStatus, AutoRechargeAttempt, ReconciliationDiscrepancyKind, ReconciliationRunStatus, ReconciliationDiscrepancy, ReconciliationRun, ReconciliationReport, } from './inference/accountBilling';
88
+ export { PRODUCT_PLAN_STATUSES, productPlanStatusSchema, LIVE_PRODUCT_PLAN_STATUSES, planAllowanceSchema, productPlanSchema, payAsYouGoEntitlementSchema, COST_CENTER_STATUSES, costCenterStatusSchema, costCenterSchema, costCenterSpendSchema, productEntitlementSchema, } from './inference/entitlement';
89
+ export type { ProductPlanStatus, PlanAllowance, ProductPlan, PayAsYouGoEntitlement, CostCenterStatus, CostCenter, CostCenterSpend, ProductEntitlement, } from './inference/entitlement';