@oxyhq/contracts 0.30.0 → 0.32.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.
@@ -207,8 +207,66 @@ export declare const createAccountRequestSchema: z.ZodObject<{
207
207
  bio: z.ZodOptional<z.ZodString>;
208
208
  avatar: z.ZodOptional<z.ZodString>;
209
209
  description: z.ZodOptional<z.ZodString>;
210
+ /**
211
+ * A named color preset KEY (`"blue"`, `"mint"`, …), never a hex value.
212
+ *
213
+ * Here at CREATION for the reason `isPrivateAccount` is, in miniature: for a
214
+ * managed account the color is a visual identity, and an account that is
215
+ * discoverable without one and acquires it on a second request is a face that
216
+ * changes by itself. One statement, one row, born looking like what its owner
217
+ * chose.
218
+ *
219
+ * The VALUE is checked in the API rather than here. The vocabulary is
220
+ * `USER_COLOR_PRESETS`, which is declared next to the `users_color_check` CHECK
221
+ * that is rendered from it — pinning the list a second time in this package
222
+ * would be a second source of truth for what the database accepts, and the two
223
+ * would drift apart silently. What this shape does is keep an over-long or
224
+ * non-string value from reaching the service at all.
225
+ */
226
+ color: z.ZodOptional<z.ZodString>;
210
227
  /** Ordered, PRIMARY FIRST — see rule 2 above {@link ACCOUNT_CATEGORY_IDS}. */
211
228
  accountCategories: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodEnum<["news", "politics", "business", "startup", "finance", "crypto", "marketplace", "retail", "real_estate", "agency", "landlord", "cooperative", "architecture", "technology", "software", "ai", "security", "automation", "science", "education", "books", "health", "fitness", "sports", "gaming", "music", "film", "podcast", "art", "photography", "comedy", "food", "travel", "fashion", "home_garden", "diy", "automotive", "animals", "family", "nonprofit", "government", "community", "activism", "environment", "religion", "other"]>, "many">, ("news" | "politics" | "business" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "nonprofit" | "government" | "community" | "activism" | "environment" | "religion" | "other")[], ("news" | "politics" | "business" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "nonprofit" | "government" | "community" | "activism" | "environment" | "religion" | "other")[]>>;
229
+ /**
230
+ * Create the account already opted OUT of discovery.
231
+ *
232
+ * ## Why this belongs at CREATION and not only on the privacy route
233
+ *
234
+ * Every account is born discoverable: the column defaults to `false` and
235
+ * nothing on the create path wrote it, so a new account appears in people
236
+ * search the instant it exists. For a human signing themselves up that is the
237
+ * right default and it is NOT changed here. For an account a program creates
238
+ * on someone's behalf — an agent, an unlaunched project, an organization for
239
+ * something not yet announced — it publishes the thing before its owner ever
240
+ * decided to.
241
+ *
242
+ * The alternative is a second call right after create, which is a window in
243
+ * which the account IS public, and a window whose closing depends on a second
244
+ * request succeeding. A field here has neither: one statement, one row, born
245
+ * in the state the caller asked for.
246
+ *
247
+ * ## It reuses the existing flag deliberately
248
+ *
249
+ * This is `privacy_is_private_account`, the same one `PUT /users/:id/privacy`
250
+ * toggles — not a new "published" column. A second visibility flag would be a
251
+ * second source of truth for one question, and the two would disagree.
252
+ *
253
+ * Inherited semantics, stated because reusing a flag means inheriting ALL of
254
+ * it: the account is kept out of people search, out of the follow-graph lists
255
+ * (`followers` / `following` / `mutuals`), out of `/similar` and out of the
256
+ * recommendation candidate pools, and its non-public, non-unlisted media
257
+ * becomes follower-gated. It does NOT hide the profile from someone who knows
258
+ * the handle, and it carries NO follow-approval flow — following is immediate
259
+ * and unilateral whatever this says, so nothing here creates a request queue
260
+ * nobody attends.
261
+ *
262
+ * ## Not conditioned on `kind`, on purpose
263
+ *
264
+ * The same reasoning as `accountCategories` above: this object does not
265
+ * refine on kind, and an unlaunched organization has exactly the problem an
266
+ * unpublished agent does. The discovery predicate never reads `kind`, so the
267
+ * remedy must not either.
268
+ */
269
+ isPrivateAccount: z.ZodOptional<z.ZodBoolean>;
212
270
  }, "strip", z.ZodTypeAny, {
213
271
  kind: "organization" | "project" | "bot" | "channel";
214
272
  username: string;
@@ -221,7 +279,9 @@ export declare const createAccountRequestSchema: z.ZodObject<{
221
279
  bio?: string | undefined;
222
280
  avatar?: string | undefined;
223
281
  description?: string | undefined;
282
+ color?: string | undefined;
224
283
  accountCategories?: ("news" | "politics" | "business" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "nonprofit" | "government" | "community" | "activism" | "environment" | "religion" | "other")[] | undefined;
284
+ isPrivateAccount?: boolean | undefined;
225
285
  }, {
226
286
  kind: "organization" | "project" | "bot" | "channel";
227
287
  username: string;
@@ -234,6 +294,8 @@ export declare const createAccountRequestSchema: z.ZodObject<{
234
294
  bio?: string | undefined;
235
295
  avatar?: string | undefined;
236
296
  description?: string | undefined;
297
+ color?: string | undefined;
237
298
  accountCategories?: ("news" | "politics" | "business" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "nonprofit" | "government" | "community" | "activism" | "environment" | "religion" | "other")[] | undefined;
299
+ isPrivateAccount?: boolean | undefined;
238
300
  }>;
239
301
  export type CreateAccountRequest = z.infer<typeof createAccountRequestSchema>;
@@ -77,13 +77,15 @@ export { routingTargetSchema, routingPolicyScopeSchema, routingFallbackPolicySch
77
77
  export type { RoutingTarget, RoutingPolicyScope, RoutingFallbackPolicy, RoutingPolicy, RoutingPolicyReference, AuthorizedRoute, } from './inference/routingPolicy';
78
78
  export { aliaReleaseArtifactSchema, aliaReleaseSignatureSchema, aliaModelReleaseManifestSchema, } from './inference/aliaModelRelease';
79
79
  export type { AliaReleaseArtifact, AliaReleaseSignature, AliaModelReleaseManifest, } from './inference/aliaModelRelease';
80
+ export { modelDistributionMethodSchema, modelSystemicRiskTierSchema, trainingComputeFlopsSchema, SYSTEMIC_RISK_COMPUTE_THRESHOLD_FLOPS, modelDownstreamDocumentationSchema, modelGpaiDocumentationSchema, modelLineDeclarationSchema, modelReleaseIngestionRequestSchema, modelReleaseIngestionResultSchema, modelDocumentationSchema, } from './inference/modelDocumentation';
81
+ export type { ModelDistributionMethod, ModelSystemicRiskTier, ModelDownstreamDocumentation, ModelGpaiDocumentation, ModelLineDeclaration, ModelReleaseIngestionRequest, ModelReleaseIngestionResult, ModelDocumentation, } from './inference/modelDocumentation';
80
82
  export { inferenceContentSourceSchema, inferenceContentPartSchema, inferenceToolCallSchema, inferenceMessageRoleSchema, inferenceMessageSchema, inferenceInputSchema, samplingParametersSchema, toolDefinitionSchema, toolChoiceSchema, responseFormatSchema, clientRequestMetadataSchema, inferenceRequestSchema, } from './inference/request';
81
83
  export type { InferenceContentSource, InferenceContentPart, InferenceToolCall, InferenceMessageRole, InferenceMessage, InferenceInput, SamplingParameters, ToolDefinition, ToolChoice, ResponseFormat, ClientRequestMetadata, InferenceRequest, } from './inference/request';
82
84
  export { inferenceStreamStartEventSchema, inferenceStreamDeltaEventSchema, inferenceStreamToolCallEventSchema, inferenceStreamUsageEventSchema, inferenceRouteSwitchDetailSchema, inferenceRouteSwitchReasonSchema, inferenceStreamRouteSwitchEventSchema, inferenceStreamErrorEventSchema, inferenceFinishReasonSchema, inferenceStreamDoneEventSchema, inferenceStreamEventSchema, } from './inference/streamEvents';
83
85
  export type { InferenceStreamStartEvent, InferenceStreamDeltaEvent, InferenceStreamToolCallEvent, InferenceStreamUsageEvent, InferenceRouteSwitchDetail, InferenceRouteSwitchReason, InferenceStreamRouteSwitchEvent, InferenceStreamErrorEvent, InferenceFinishReason, InferenceStreamDoneEvent, InferenceStreamEvent, } from './inference/streamEvents';
84
86
  export { usageReservationRequestSchema, usageReservationStatusSchema, usageReservationSchema, inferenceRequestOutcomeSchema, normalizedUsageReportSchema, usageReceiptSchema, usageRefundSubjectSchema, usageRefundReasonSchema, usageRefundSchema, } from './inference/usage';
85
87
  export type { UsageReservationRequest, UsageReservationStatus, UsageReservation, InferenceRequestOutcome, NormalizedUsageReport, UsageReceipt, UsageRefundSubject, UsageRefundReason, UsageRefund, } from './inference/usage';
86
- export { providerConnectionScopeSchema, providerSecretReferenceSchema, providerConnectionValidationSchema, providerConnectionStatusSchema, providerConnectionSchema, } from './inference/providerConnection';
88
+ export { PROVIDER_SECRET_REFERENCE_NAMESPACE, providerConnectionScopeSchema, providerSecretReferenceSchema, providerConnectionValidationSchema, providerConnectionStatusSchema, providerConnectionSchema, } from './inference/providerConnection';
87
89
  export type { ProviderConnectionScope, ProviderConnectionValidation, ProviderConnectionStatus, ProviderConnection, } from './inference/providerConnection';
88
90
  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';
89
91
  export type { BillingMode, BillingProfileStatus, AutoRecharge, BillingProfile, AccountBillingState, BillingInvoiceStatus, BillingInvoice, ExternalPaymentProvider, ExternalPaymentKind, ExternalPayment, AutoRechargeStatus, AutoRechargeAttempt, ReconciliationDiscrepancyKind, ReconciliationRunStatus, ReconciliationDiscrepancy, ReconciliationRun, ReconciliationReport, } from './inference/accountBilling';
@@ -35,14 +35,22 @@
35
35
  * bounded: ingestion is a release-time operation an operator retries once Oxy
36
36
  * takes the newer contract, not a served request that becomes unsettleable.
37
37
  *
38
- * ## What is deliberately NOT here
38
+ * ## The ingestion path, which this file used to say did not exist
39
+ *
40
+ * It does now: `POST /inference/admin/model-releases`, defined by
41
+ * `modelReleaseIngestionRequestSchema` in `modelDocumentation.ts`. This shape is
42
+ * unchanged — the request COMPOSES it, alongside two records that are Oxy's own
43
+ * rather than the signer's (the GPAI documentation and the capability sheet a
44
+ * manifest does not carry), precisely so the bytes a signature covers stay
45
+ * exactly the bytes described here.
39
46
  *
40
- * **No HTTP write path.** The catalogue's emptiness is currently a safety
41
- * property `scripts/seed-inference-catalogue.ts` refuses to invent a licence
42
- * or a retention flag because "a plausible invented value in a catalogue is
43
- * worse than an absent one" and a staff write path into it with nothing to
44
- * ingest is an unexercised hazard. The schema lands; the endpoint waits for a
45
- * real manifest to ingest.
47
+ * The earlier objection was that a staff write path into an empty catalogue is
48
+ * an unexercised hazard. What answers it is containment rather than emptiness: an
49
+ * ingested revision lands with `is_current = false` and no deployment, so nothing
50
+ * it creates is servable or listed, and a route still needs an approved
51
+ * contract/legal review before any customer can select it.
52
+ *
53
+ * ## What is deliberately NOT here
46
54
  *
47
55
  * **No `payloadDigest` field.** The signature is over the canonical
48
56
  * serialization of this manifest with `signatures` removed, and a verifier
@@ -64,7 +72,11 @@
64
72
  * custody, rotation and revocation consequences. So `keyId` is an OPAQUE
65
73
  * identifier and this file names no registry that resolves it: either answer
66
74
  * fits, and neither is presupposed. Until it is answered a manifest can be
67
- * parsed and cannot be verified, which is the second reason no endpoint ships.
75
+ * parsed and cannot be VERIFIED, so the ingestion path records no verification
76
+ * finding at all: it stores the signatures and the manifest as received, and the
77
+ * authority for the ingest is the staff member who performed it. A nullable
78
+ * `verified` column nothing ever writes would read, to whoever scanned the table
79
+ * later, as a check that ran.
68
80
  *
69
81
  * Decided in: docs/adr/0008-catalogue-concept-separation.md,
70
82
  * docs/adr/0017-authorized-routes-in-the-envelope.md, issue #972 §12.