Files
OmniRoute/open-sse/executors/uc/constants.ts
Armin Anton” ∴ 530096a3be feat(providers): add UC (uncensored.com) — persona (un-metered) + direct (metered) (#11513)
Adds uncensored.com as two OpenAI-compatible providers mirroring UC's own surfaces: uc, the persona/subscription side over WebSocket with a durable Clerk credential minting a short-lived per-connect token (no API key, un-metered), as a full multimodal port — chat, tools, vision, doc-RAG, image, video, TTS; and uc-direct, the metered Developer API over REST with X-api-key. Same underlying models, two billing surfaces.

Reconciled on merge. 57 files conflicted; only seven carried UC content, the rest was drift from the older release line and took the tip's side.

- executors/index.ts: the tip has since refactored the executor map to lazy dynamic imports, so uc is registered in that shape. uc-direct needs no entry — it routes through the default OpenAI-compatible executor.
- imageGeneration.ts: the branch still carried the retired designerWeb import alongside ucImage; kept only the UC one.
- config/providers/index.ts, webSessionCredentials.ts and web-cookie.ts resolved additively against the MaxAI entries #11461 put on the tip an hour earlier.
- web-cookie.ts: the uc entry declared no serviceKinds, required since #11392, so provider validation would have thrown at load. Declared ["llm"]. uc-direct already declared it at the end of its own entry — an earlier pass of mine added a second one after id and TypeScript caught the duplicate (TS1117); the author's placement is what shipped.

Every count was measured against the merged tree rather than taken from the branch, and all three would have been wrong: reserved prefixes are 406, not 399; APIKEY_PROVIDERS is 237, not 234; providers are 355. PROVIDER_REFERENCE.md regenerated, the count updated across README/AGENTS.md/llm.txt and its 42 mirrors, package.json and 6 SVGs — every changed line in the protected surfaces is a digit substitution and nothing else, verified by masking digits and comparing the removed and added sets (90 lines each, identical). The executor-map golden snapshot went 134 -> 135.

The branch's file-size-baseline.json predates #12411's ratchet re-tightening and was discarded rather than merged; imageGeneration.ts (+12 for the uc-image format branch) was entered against the current baseline under a _rebaseline annotation, and no other cap moves.

Verified: typecheck:core clean, check:provider-consistency OK (271 REGISTRY entries, 355 canonical providers), check:docs-counts exit 0, check-file-size OK, check:cycles OK, 119/119 across the PR's test files, and 2/2 executor-map-golden.

Thanks @arminanton — two providers for two real billing surfaces, rather than one entry pretending to be both, is the right modelling.
2026-09-02 02:23:33 -03:00

60 lines
2.5 KiB
TypeScript

/**
* UC (uncensored.com) PERSONA path — wire constants.
*
* UC is a consumer subscription app (uncensored.com) whose un-metered "persona"
* chat runs over a WebSocket to its inference backend. There is no public API on
* this path: auth is a short-lived Clerk `__session` JWT minted from a durable
* `__client` cookie, passed as the `?token=` query param on the socket URL.
*
* All values below are capture-confirmed (UC-PERSONA-WS-OMNIROUTE-SPEC.md /
* UC-AUTH-AND-EMAIL-LOGIN.md) and match the proven reference client.
*/
/** Clerk Frontend API host (auth: token mint, session touch, email sign-in). */
export const UC_CLERK_FAPI = "https://clerk.uncensored.com";
/** Clerk JS version echoed as `?_clerk_js_version` on every Clerk call. */
export const UC_CLERK_JS_VERSION = "5.127.1";
/** Clerk API version echoed as `?__clerk_api_version` on sign-in calls. */
export const UC_CLERK_API_VERSION = "2025-11-10";
/** Origin the UC web app sends; Clerk + the WS backend both check it. */
export const UC_ORIGIN = "https://uncensored.com";
/** WebSocket inference backend base (persona/non-direct + direct both ride this). */
export const UC_WS_HOST = "wss://internal-6.pubyar.com/ws";
/**
* Synthetic base URL for the registry entry. UC persona has no HTTP chat
* endpoint (it is a WebSocket), so this is a marker the executor recognizes; it
* is never fetched. Mirrors the muse-spark-web pattern of a nominal baseUrl.
*/
export const UC_BASE_URL = "https://internal-6.pubyar.com";
/** Refresh a 60s `__session` JWT this many seconds before its `exp`. */
export const UC_TOKEN_REFRESH_SKEW_S = 8;
/** Default per-turn WebSocket timeout (ms). */
export const UC_WS_TIMEOUT_MS = 120_000;
/** The web app version string the persona frame carries. */
export const UC_APP_VERSION = "1.0.0-web";
/**
* TTS (text-to-speech) WebSocket backend base. Distinct host from the persona
* chat WS (pubyar.com); the full URL is `${UC_TTS_WS_HOST}/{uid}?token={jwt}`.
* Same Clerk-JWT-in-query-param auth + `Origin: https://uncensored.com`
* handshake header as the chat socket (see UC-MEDIA-GENERATION.md).
*/
export const UC_TTS_WS_HOST = "wss://tts-stream.chatuncensored.ai";
/** Default UC TTS voice (capture-confirmed; others presumably exist). */
export const UC_TTS_DEFAULT_VOICE = "jade";
/** Default UC TTS model tier carried in the `start` frame. */
export const UC_TTS_DEFAULT_MODEL = "default";
/** Default per-request UC TTS WebSocket timeout (ms). */
export const UC_TTS_WS_TIMEOUT_MS = 120_000;