@alia.onl/server 1.0.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.
- package/CHANGELOG.md +28 -0
- package/LICENSE +202 -0
- package/NOTICE +15 -0
- package/README.md +135 -0
- package/dist/index.cjs +291 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +236 -0
- package/dist/index.d.ts +236 -0
- package/dist/index.js +283 -0
- package/dist/index.js.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/errors.ts","../src/stream.ts","../src/client.ts"],"names":["value"],"mappings":";;;AAiDO,IAAM,eAAA,GAAN,cAA8B,KAAA,CAAM;AAAA,EAChC,OAAA;AAAA,EACA,KAAA;AAAA,EAET,WAAA,CAAY,OAAA,EAA4B,KAAA,GAAwB,EAAC,EAAG;AAClE,IAAA,KAAA,CAAM,CAAA,+BAAA,EAAkC,OAAO,CAAA,CAAE,CAAA;AACjD,IAAA,IAAA,CAAK,IAAA,GAAO,iBAAA;AACZ,IAAA,IAAA,CAAK,OAAA,GAAU,OAAA;AACf,IAAA,IAAA,CAAK,KAAA,GAAQ,KAAA;AAAA,EACf;AACF;AAUO,IAAM,gBAAA,GAAN,cAA+B,KAAA,CAAM;AAAA,EACjC,MAAA;AAAA,EACA,IAAA;AAAA,EAET,WAAA,CAAY,MAAA,EAAgB,IAAA,GAAsB,IAAA,EAAM;AACtD,IAAA,KAAA,CAAM,CAAA,eAAA,EAAkB,MAAM,CAAA,CAAE,CAAA;AAChC,IAAA,IAAA,CAAK,IAAA,GAAO,kBAAA;AACZ,IAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AACd,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AAAA,EACd;AACF;AAGO,IAAM,cAAA,GAAN,cAA6B,KAAA,CAAM;AAAA,EACxC,WAAA,CAAY,UAAU,8BAAA,EAAgC;AACpD,IAAA,KAAA,CAAM,OAAO,CAA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ACxC,GAAI,KAAK,MAAA,KAAW,MAAA,GAAY,EAAC,GAAI,EAAE,MAAA,EAAQ,IAAA,CAAK,MAAA;AAAO,KAC5D,CAAA;AAAA,EACH;AACF;AAGA,SAAS,UAAU,OAAA,EAA6D;AAC9E,EAAA,MAAM,EAAE,QAAA,EAAU,KAAA,EAAO,GAAG,MAAK,GAAI,OAAA;AACrC,EAAA,MAAM,IAAA,GAAgC,EAAE,GAAG,KAAA,EAAM;AACjD,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,KAAK,KAAK,MAAA,CAAO,OAAA,CAAQ,IAAI,CAAA,EAAG;AAC/C,IAAA,IAAI,KAAA,KAAU,MAAA,EAAW,IAAA,CAAK,GAAG,CAAA,GAAI,KAAA;AAAA,EACvC;AACA,EAAA,IAAA,CAAK,QAAA,GAAW,QAAA;AAChB,EAAA,IAAA,CAAK,MAAA,GAAS,IAAA;AACd,EAAA,OAAO,IAAA;AACT;AAGO,SAAS,sBAAA,CAAuB,OAAA,GAAmC,EAAC,EAAqB;AAC9F,EAAA,OAAO,IAAI,iBAAiB,OAAO,CAAA;AACrC","file":"index.cjs","sourcesContent":["/**\n * The SHAPE of a stream chunk this client could not read — never its content.\n *\n * A consumer logs this verbatim. The assistant's text, the person's prompt and\n * any upstream message are deliberately absent: what a reader needs in order to\n * fix a protocol mismatch is which keys arrived, not what they said.\n */\nexport interface AliaChunkShape {\n /** The chunk's top-level keys, capped, when it parsed as a JSON object. */\n readonly keys?: readonly string[];\n /** `choices.length`, or the `typeof` when `choices` was not an array. */\n readonly choices?: number | string;\n /** `error.code` / `error.type` when the chunk carried an error object. */\n readonly errorCode?: string;\n /** The SSE `event:` name the frame carried, when it had one. */\n readonly event?: string;\n /** `typeof` the parsed value, when it was not a JSON object. */\n readonly valueType?: string;\n}\n\n/**\n * Why a stream could not be read. Every one of these is a protocol mismatch\n * between this client and the server, not an answer the server gave.\n */\nexport type AliaStreamFailure =\n /** The response was 2xx but not `text/event-stream`. */\n | 'not_event_stream'\n /** The response was 2xx, SSE, and had no readable body. */\n | 'no_body'\n /** A `data:` payload was not JSON. */\n | 'malformed_json'\n /** A chunk parsed, but is neither an OpenAI chunk nor an error payload. */\n | 'unexpected_chunk'\n /** A choice arrived without a `delta` object. */\n | 'choice_without_delta'\n /** `delta.content` was present and not a string. */\n | 'content_not_string'\n /** The body ended before `data: [DONE]`. */\n | 'truncated'\n /** The stream exceeded this client's byte or frame limits. */\n | 'oversized';\n\n/**\n * The stream itself could not be read.\n *\n * Distinct from {@link AliaRequestError}, which means the server answered and\n * said no. This one means the bytes did not match the protocol, and it always\n * carries the shape that broke it so the mismatch is nameable from a log line.\n */\nexport class AliaStreamError extends Error {\n readonly failure: AliaStreamFailure;\n readonly shape: AliaChunkShape;\n\n constructor(failure: AliaStreamFailure, shape: AliaChunkShape = {}) {\n super(`Alia stream could not be read: ${failure}`);\n this.name = 'AliaStreamError';\n this.failure = failure;\n this.shape = shape;\n }\n}\n\n/**\n * Alia answered with a non-2xx status.\n *\n * `code` is the machine-readable code from the body when the body was small\n * JSON that carried one — `code` or `error.code`. The body's prose is NOT\n * retained: an upstream message is not a consumer's to show, and a client that\n * keeps it invites a product surface to print it.\n */\nexport class AliaRequestError extends Error {\n readonly status: number;\n readonly code: string | null;\n\n constructor(status: number, code: string | null = null) {\n super(`Alia responded ${status}`);\n this.name = 'AliaRequestError';\n this.status = status;\n this.code = code;\n }\n}\n\n/** The caller's `AbortSignal` fired. `name` is `AbortError`, as fetch's is. */\nexport class AliaAbortError extends Error {\n constructor(message = 'The Alia stream was aborted.') {\n super(message);\n this.name = 'AbortError';\n }\n}\n\nconst MAX_SHAPE_KEYS = 12;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** Describe a parsed chunk without repeating anything it said. */\nexport function describeChunk(value: unknown, event?: string): AliaChunkShape {\n const named = event === undefined || event === '' ? {} : { event };\n if (!isRecord(value)) return { ...named, valueType: value === null ? 'null' : typeof value };\n\n const error = isRecord(value.error) ? value.error : undefined;\n const errorCode =\n error === undefined\n ? undefined\n : typeof error.code === 'string'\n ? error.code\n : typeof error.type === 'string'\n ? error.type\n : undefined;\n\n return {\n ...named,\n keys: Object.keys(value).slice(0, MAX_SHAPE_KEYS),\n choices: Array.isArray(value.choices) ? value.choices.length : typeof value.choices,\n ...(errorCode === undefined ? {} : { errorCode }),\n };\n}\n\nexport { isRecord };\n","import {\n AliaAbortError,\n AliaStreamError,\n describeChunk,\n isRecord,\n type AliaChunkShape,\n} from './errors.js';\nimport type { AliaStreamEvent } from './events.js';\n\n/** Ceilings, not tuning knobs: a runaway stream must end as an error, not as RAM. */\nconst MAX_STREAM_BYTES = 32 * 1024 * 1024;\nconst MAX_FRAME_BYTES = 4 * 1024 * 1024;\n\n/** SSE's default event type. A frame naming it is an ordinary data frame. */\nconst DEFAULT_EVENT_NAME = 'message';\n\nexport interface ReadAliaEventStreamOptions {\n readonly signal?: AbortSignal;\n}\n\nfunction asOptionalRecord(value: unknown): Readonly<Record<string, unknown>> | undefined {\n return isRecord(value) ? value : undefined;\n}\n\nfunction asStringOrNull(value: unknown): string | null {\n return typeof value === 'string' ? value : null;\n}\n\n/** Turn one parsed `data:` payload into zero or more events. */\nfunction* eventsFromChunk(value: unknown, shape: () => AliaChunkShape): Generator<AliaStreamEvent> {\n if (!isRecord(value)) throw new AliaStreamError('unexpected_chunk', shape());\n\n // An in-stream error payload. Alia writes `[DONE]` straight after it, so this\n // yields rather than returns: the terminal event still arrives, and a consumer\n // that stops on the error simply never asks for it.\n if (isRecord(value.error)) {\n const error = value.error;\n yield {\n type: 'error',\n code: asStringOrNull(error.code),\n message: typeof error.message === 'string' ? error.message : 'Alia ended the stream with an error.',\n errorType: asStringOrNull(error.type),\n param: asStringOrNull(error.param),\n };\n return;\n }\n\n if (!Array.isArray(value.choices)) throw new AliaStreamError('unexpected_chunk', shape());\n\n // A usage-only frame (`stream_options.include_usage`) carries no choices.\n const meta = asOptionalRecord(value.alia_meta);\n\n for (const rawChoice of value.choices) {\n if (!isRecord(rawChoice) || !isRecord(rawChoice.delta)) {\n throw new AliaStreamError('choice_without_delta', shape());\n }\n const delta = rawChoice.delta;\n\n if (delta.content !== undefined && delta.content !== null) {\n if (typeof delta.content !== 'string') throw new AliaStreamError('content_not_string', shape());\n yield { type: 'text', text: delta.content, ...(meta === undefined ? {} : { meta }) };\n }\n if (typeof delta.reasoning === 'string' && delta.reasoning !== '') {\n yield { type: 'reasoning', text: delta.reasoning };\n }\n if (typeof rawChoice.finish_reason === 'string') {\n yield { type: 'finish', reason: rawChoice.finish_reason, ...(meta === undefined ? {} : { meta }) };\n }\n }\n}\n\ninterface Frame {\n readonly event: string;\n readonly data: string;\n}\n\n/**\n * Read Alia's SSE body as typed events.\n *\n * Exported for a consumer that already holds a `Response` — the client below is\n * this function plus the request and its status handling. The generator owns the\n * reader: leaving the loop early (a `break`, a thrown consumer) cancels it.\n */\nexport async function* readAliaEventStream(\n body: ReadableStream<Uint8Array>,\n options: ReadAliaEventStreamOptions = {},\n): AsyncGenerator<AliaStreamEvent, void, undefined> {\n const { signal } = options;\n const reader = body.getReader();\n const onAbort = (): void => {\n void reader.cancel().catch(() => undefined);\n };\n signal?.addEventListener('abort', onAbort, { once: true });\n\n const decoder = new TextDecoder('utf-8');\n let buffer = '';\n let eventName = '';\n let dataLines: string[] = [];\n let totalBytes = 0;\n let sawDone = false;\n\n const takeFrame = (): Frame | null => {\n const event = eventName;\n const lines = dataLines;\n eventName = '';\n dataLines = [];\n if (lines.length === 0) return null;\n return { event, data: lines.join('\\n') };\n };\n\n /** One complete frame → events. Returns false once `[DONE]` has been seen. */\n function* dispatch(frame: Frame): Generator<AliaStreamEvent> {\n const named = frame.event !== '' && frame.event !== DEFAULT_EVENT_NAME;\n\n if (!named && frame.data === '[DONE]') {\n sawDone = true;\n yield { type: 'done' };\n return;\n }\n\n let value: unknown;\n try {\n value = JSON.parse(frame.data) as unknown;\n } catch {\n throw new AliaStreamError('malformed_json', { ...(named ? { event: frame.event } : {}) });\n }\n\n if (named) {\n yield { type: 'event', event: frame.event, data: value };\n return;\n }\n yield* eventsFromChunk(value, () => describeChunk(value));\n }\n\n const consumeLine = function* (rawLine: string): Generator<AliaStreamEvent> {\n const line = rawLine.endsWith('\\r') ? rawLine.slice(0, -1) : rawLine;\n if (line === '') {\n const frame = takeFrame();\n if (frame !== null) yield* dispatch(frame);\n return;\n }\n if (line.startsWith(':')) return;\n\n const separator = line.indexOf(':');\n const field = separator === -1 ? line : line.slice(0, separator);\n let value = separator === -1 ? '' : line.slice(separator + 1);\n if (value.startsWith(' ')) value = value.slice(1);\n\n if (field === 'event') eventName = value;\n else if (field === 'data') dataLines.push(value);\n // `id` and `retry` are SSE's own and carry nothing Alia uses; anything else\n // is an unknown field, which the SSE spec requires be ignored.\n };\n\n try {\n for (;;) {\n if (signal?.aborted) throw new AliaAbortError();\n const { done, value } = await reader.read();\n if (signal?.aborted) throw new AliaAbortError();\n\n if (value !== undefined) {\n totalBytes += value.byteLength;\n if (totalBytes > MAX_STREAM_BYTES) throw new AliaStreamError('oversized');\n }\n buffer += decoder.decode(value, { stream: !done });\n\n let newline = buffer.indexOf('\\n');\n while (newline !== -1) {\n const line = buffer.slice(0, newline);\n buffer = buffer.slice(newline + 1);\n yield* consumeLine(line);\n if (sawDone) return;\n newline = buffer.indexOf('\\n');\n }\n if (buffer.length > MAX_FRAME_BYTES) throw new AliaStreamError('oversized');\n\n if (done) break;\n }\n\n // A body that ends without its blank line still holds a complete frame.\n if (buffer !== '') {\n yield* consumeLine(buffer);\n if (sawDone) return;\n }\n const trailing = takeFrame();\n if (trailing !== null) {\n yield* dispatch(trailing);\n if (sawDone) return;\n }\n\n // Reaching here means the body ended with no `[DONE]`. The answer is\n // incomplete and saying so is the whole point: a truncated turn that reads\n // as a successful short one is indistinguishable from a real short one.\n throw new AliaStreamError('truncated');\n } finally {\n signal?.removeEventListener('abort', onAbort);\n await reader.cancel().catch(() => undefined);\n reader.releaseLock();\n }\n}\n","import { AliaRequestError, AliaStreamError, isRecord } from './errors.js';\nimport type { AliaStreamEvent } from './events.js';\nimport { readAliaEventStream } from './stream.js';\n\n/** Alia's public product API. */\nexport const ALIA_API_URL = 'https://api.alia.onl';\n\n/** Alia's permanent, OpenAI-compatible chat path (ADR 0010). */\nconst CHAT_COMPLETIONS_PATH = '/v1/chat/completions';\n\n/** How much of a non-2xx body is read to look for a machine-readable code. */\nconst MAX_ERROR_BODY_BYTES = 4096;\n\nexport type AliaHeaders = Readonly<Record<string, string>>;\n\nexport interface AliaChatMessage {\n readonly role: 'system' | 'user' | 'assistant' | 'tool';\n readonly content: string;\n}\n\n/**\n * One turn. `stream` is not an option: this client only streams, which is why\n * it can promise that every byte lands in a typed event.\n */\nexport interface AliaChatCompletionRequest {\n readonly messages: readonly AliaChatMessage[];\n /** The Alia agent this turn runs as. */\n readonly agentId?: string;\n /** A routing-profile id. Omit it and Alia picks the product default. */\n readonly model?: string;\n readonly conversationId?: string;\n readonly reasoningEffort?: string;\n readonly webSearch?: boolean;\n readonly deepResearch?: boolean;\n readonly clientContext?: string;\n /**\n * Anything else the product route accepts. Merged UNDER the fields above, so\n * a typed field always wins and `stream` can never be turned off.\n */\n readonly extra?: Readonly<Record<string, unknown>>;\n}\n\nexport interface AliaServerClientOptions {\n /** e.g. `https://api.alia.onl`. A trailing slash is ignored. */\n readonly baseUrl?: string;\n /**\n * The calling product's Oxy service token — the bearer Oxy bills. A function\n * is called once per turn, for a credential that rotates.\n */\n readonly token?: string | (() => string | Promise<string>);\n /**\n * Extra headers. A function is called once per turn, which is what a one-use\n * header such as `X-Oxy-Requester-Assertion` needs: Oxy consumes each\n * assertion, so it must be minted per request and never cached.\n */\n readonly headers?: AliaHeaders | (() => AliaHeaders | Promise<AliaHeaders>);\n /** Injected for tests. Defaults to the global `fetch`. */\n readonly fetch?: typeof fetch;\n /** Override the chat path. Defaults to `/v1/chat/completions`. */\n readonly path?: string;\n}\n\nexport interface AliaStreamInit {\n readonly signal?: AbortSignal;\n /** This turn's bearer, overriding the client's. */\n readonly token?: string;\n /** This turn's extra headers, merged over the client's. */\n readonly headers?: AliaHeaders;\n}\n\nasync function resolve<T>(source: T | (() => T | Promise<T>) | undefined): Promise<T | undefined> {\n return typeof source === 'function' ? await (source as () => T | Promise<T>)() : source;\n}\n\n/** The machine-readable code from an error body, and nothing else from it. */\nasync function codeFromErrorBody(response: Response): Promise<string | null> {\n try {\n const reader = response.body?.getReader();\n if (reader === undefined) return null;\n const decoder = new TextDecoder('utf-8');\n let text = '';\n try {\n while (text.length < MAX_ERROR_BODY_BYTES) {\n const { done, value } = await reader.read();\n if (done) break;\n text += decoder.decode(value, { stream: true });\n }\n } finally {\n await reader.cancel().catch(() => undefined);\n }\n const value: unknown = JSON.parse(text);\n if (!isRecord(value)) return null;\n if (typeof value.code === 'string') return value.code;\n if (isRecord(value.error) && typeof value.error.code === 'string') return value.error.code;\n return null;\n } catch {\n return null;\n }\n}\n\n/**\n * A backend's client for Alia's product API.\n *\n * It exists because every consumer that called Alia from a server wrote the same\n * SSE parser, and each one got a different subset of the wire right. Alia writes\n * OpenAI-shaped chunks, named product events, synthetic recovery chunks carrying\n * `alia_meta`, in-stream error payloads and a terminal `[DONE]` — five shapes,\n * of which a hand-rolled reader typically handles two and silently drops the\n * one that matters when something is wrong.\n *\n * Node 22+. No React, no DOM beyond `fetch` and `ReadableStream`.\n */\nexport class AliaServerClient {\n readonly #baseUrl: string;\n readonly #path: string;\n readonly #token: AliaServerClientOptions['token'];\n readonly #headers: AliaServerClientOptions['headers'];\n readonly #fetch: typeof fetch;\n\n constructor(options: AliaServerClientOptions = {}) {\n this.#baseUrl = (options.baseUrl ?? ALIA_API_URL).replace(/\\/+$/, '');\n this.#path = options.path ?? CHAT_COMPLETIONS_PATH;\n this.#token = options.token;\n this.#headers = options.headers;\n this.#fetch = options.fetch ?? fetch;\n }\n\n /** The absolute URL this client posts to. */\n get url(): string {\n return `${this.#baseUrl}${this.#path}`;\n }\n\n /**\n * Start one turn.\n *\n * Resolves once Alia has answered with a 2xx `text/event-stream`; the events\n * arrive as they are written. Throws {@link AliaRequestError} for a non-2xx\n * answer and {@link AliaStreamError} when the response is not a stream this\n * client can read.\n */\n async stream(\n request: AliaChatCompletionRequest,\n init: AliaStreamInit = {},\n ): Promise<AsyncIterable<AliaStreamEvent>> {\n const [token, headers] = await Promise.all([\n init.token === undefined ? resolve(this.#token) : init.token,\n resolve(this.#headers),\n ]);\n\n const response = await this.#fetch(this.url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Accept: 'text/event-stream',\n ...(token === undefined ? {} : { Authorization: `Bearer ${token}` }),\n ...headers,\n ...init.headers,\n },\n body: JSON.stringify(buildBody(request)),\n ...(init.signal === undefined ? {} : { signal: init.signal }),\n });\n\n if (!response.ok) {\n throw new AliaRequestError(response.status, await codeFromErrorBody(response));\n }\n\n const mime = response.headers.get('content-type')?.split(';', 1)[0]?.trim().toLowerCase();\n if (mime !== 'text/event-stream') {\n await response.body?.cancel().catch(() => undefined);\n throw new AliaStreamError('not_event_stream', { valueType: mime ?? 'none' });\n }\n if (!response.body) throw new AliaStreamError('no_body');\n\n return readAliaEventStream(response.body, {\n ...(init.signal === undefined ? {} : { signal: init.signal }),\n });\n }\n}\n\n/** The wire body: declared fields only, undefined dropped, `stream` pinned on. */\nfunction buildBody(request: AliaChatCompletionRequest): Record<string, unknown> {\n const { messages, extra, ...rest } = request;\n const body: Record<string, unknown> = { ...extra };\n for (const [key, value] of Object.entries(rest)) {\n if (value !== undefined) body[key] = value;\n }\n body.messages = messages;\n body.stream = true;\n return body;\n}\n\n/** Convenience factory, for callers that would rather not write `new`. */\nexport function createAliaServerClient(options: AliaServerClientOptions = {}): AliaServerClient {\n return new AliaServerClient(options);\n}\n"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The typed events one Alia turn produces.
|
|
3
|
+
*
|
|
4
|
+
* Every byte Alia writes on `POST /v1/chat/completions` lands in exactly one of
|
|
5
|
+
* these, or the read fails loudly with an {@link AliaStreamError}. There is no
|
|
6
|
+
* third outcome — no "unrecognised, carry on" — because that is what a
|
|
7
|
+
* hand-rolled parser gets wrong: a consumer that skips what it does not
|
|
8
|
+
* understand drops an error payload and reports an empty answer.
|
|
9
|
+
*/
|
|
10
|
+
type AliaStreamEvent = AliaTextEvent | AliaReasoningEvent | AliaNamedEvent | AliaFinishEvent | AliaErrorEvent | AliaDoneEvent;
|
|
11
|
+
/**
|
|
12
|
+
* One `choices[0].delta.content` delta, verbatim.
|
|
13
|
+
*
|
|
14
|
+
* Deltas are never merged or re-chunked. A consumer that reassembles markers
|
|
15
|
+
* spanning chunk boundaries relies on the bytes arriving exactly as sent.
|
|
16
|
+
*/
|
|
17
|
+
interface AliaTextEvent {
|
|
18
|
+
readonly type: 'text';
|
|
19
|
+
readonly text: string;
|
|
20
|
+
/**
|
|
21
|
+
* The chunk's `alia_meta`, when it had one. Alia sets it on a SYNTHETIC
|
|
22
|
+
* message — the stand-in text written when a provider died mid-turn — so a
|
|
23
|
+
* consumer can tell a real answer from a recovery notice.
|
|
24
|
+
*/
|
|
25
|
+
readonly meta?: Readonly<Record<string, unknown>>;
|
|
26
|
+
}
|
|
27
|
+
/** One `choices[0].delta.reasoning` delta. */
|
|
28
|
+
interface AliaReasoningEvent {
|
|
29
|
+
readonly type: 'reasoning';
|
|
30
|
+
readonly text: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A named Alia product event: `alia.agent_turn`, `alia.tool_result`,
|
|
34
|
+
* `alia.research_progress`, `alia.plan_preview`, and whatever the product adds
|
|
35
|
+
* next. `data` is the frame's parsed JSON, unvalidated on purpose — this client
|
|
36
|
+
* is the transport, and the product's event schemas are versioned in the
|
|
37
|
+
* payload (`eventVersion`) rather than pinned here.
|
|
38
|
+
*/
|
|
39
|
+
interface AliaNamedEvent {
|
|
40
|
+
readonly type: 'event';
|
|
41
|
+
readonly event: string;
|
|
42
|
+
readonly data: unknown;
|
|
43
|
+
}
|
|
44
|
+
/** A `finish_reason` chunk — the turn's last content-bearing frame. */
|
|
45
|
+
interface AliaFinishEvent {
|
|
46
|
+
readonly type: 'finish';
|
|
47
|
+
readonly reason: string;
|
|
48
|
+
readonly meta?: Readonly<Record<string, unknown>>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Alia wrote an error INTO the stream and is about to end it.
|
|
52
|
+
*
|
|
53
|
+
* This is an event rather than a throw because it is the server's answer, not a
|
|
54
|
+
* transport fault: `code` is the server's own, and it is the thing a consumer
|
|
55
|
+
* maps to what it tells a person. `{"error":{"code":"agent_unavailable"}}` was
|
|
56
|
+
* invisible for hours in a consumer that had no branch for it.
|
|
57
|
+
*/
|
|
58
|
+
interface AliaErrorEvent {
|
|
59
|
+
readonly type: 'error';
|
|
60
|
+
readonly code: string | null;
|
|
61
|
+
readonly message: string;
|
|
62
|
+
readonly errorType: string | null;
|
|
63
|
+
readonly param: string | null;
|
|
64
|
+
}
|
|
65
|
+
/** `data: [DONE]`. The stream is complete; nothing follows it. */
|
|
66
|
+
interface AliaDoneEvent {
|
|
67
|
+
readonly type: 'done';
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Alia's public product API. */
|
|
71
|
+
declare const ALIA_API_URL = "https://api.alia.onl";
|
|
72
|
+
type AliaHeaders = Readonly<Record<string, string>>;
|
|
73
|
+
interface AliaChatMessage {
|
|
74
|
+
readonly role: 'system' | 'user' | 'assistant' | 'tool';
|
|
75
|
+
readonly content: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* One turn. `stream` is not an option: this client only streams, which is why
|
|
79
|
+
* it can promise that every byte lands in a typed event.
|
|
80
|
+
*/
|
|
81
|
+
interface AliaChatCompletionRequest {
|
|
82
|
+
readonly messages: readonly AliaChatMessage[];
|
|
83
|
+
/** The Alia agent this turn runs as. */
|
|
84
|
+
readonly agentId?: string;
|
|
85
|
+
/** A routing-profile id. Omit it and Alia picks the product default. */
|
|
86
|
+
readonly model?: string;
|
|
87
|
+
readonly conversationId?: string;
|
|
88
|
+
readonly reasoningEffort?: string;
|
|
89
|
+
readonly webSearch?: boolean;
|
|
90
|
+
readonly deepResearch?: boolean;
|
|
91
|
+
readonly clientContext?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Anything else the product route accepts. Merged UNDER the fields above, so
|
|
94
|
+
* a typed field always wins and `stream` can never be turned off.
|
|
95
|
+
*/
|
|
96
|
+
readonly extra?: Readonly<Record<string, unknown>>;
|
|
97
|
+
}
|
|
98
|
+
interface AliaServerClientOptions {
|
|
99
|
+
/** e.g. `https://api.alia.onl`. A trailing slash is ignored. */
|
|
100
|
+
readonly baseUrl?: string;
|
|
101
|
+
/**
|
|
102
|
+
* The calling product's Oxy service token — the bearer Oxy bills. A function
|
|
103
|
+
* is called once per turn, for a credential that rotates.
|
|
104
|
+
*/
|
|
105
|
+
readonly token?: string | (() => string | Promise<string>);
|
|
106
|
+
/**
|
|
107
|
+
* Extra headers. A function is called once per turn, which is what a one-use
|
|
108
|
+
* header such as `X-Oxy-Requester-Assertion` needs: Oxy consumes each
|
|
109
|
+
* assertion, so it must be minted per request and never cached.
|
|
110
|
+
*/
|
|
111
|
+
readonly headers?: AliaHeaders | (() => AliaHeaders | Promise<AliaHeaders>);
|
|
112
|
+
/** Injected for tests. Defaults to the global `fetch`. */
|
|
113
|
+
readonly fetch?: typeof fetch;
|
|
114
|
+
/** Override the chat path. Defaults to `/v1/chat/completions`. */
|
|
115
|
+
readonly path?: string;
|
|
116
|
+
}
|
|
117
|
+
interface AliaStreamInit {
|
|
118
|
+
readonly signal?: AbortSignal;
|
|
119
|
+
/** This turn's bearer, overriding the client's. */
|
|
120
|
+
readonly token?: string;
|
|
121
|
+
/** This turn's extra headers, merged over the client's. */
|
|
122
|
+
readonly headers?: AliaHeaders;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* A backend's client for Alia's product API.
|
|
126
|
+
*
|
|
127
|
+
* It exists because every consumer that called Alia from a server wrote the same
|
|
128
|
+
* SSE parser, and each one got a different subset of the wire right. Alia writes
|
|
129
|
+
* OpenAI-shaped chunks, named product events, synthetic recovery chunks carrying
|
|
130
|
+
* `alia_meta`, in-stream error payloads and a terminal `[DONE]` — five shapes,
|
|
131
|
+
* of which a hand-rolled reader typically handles two and silently drops the
|
|
132
|
+
* one that matters when something is wrong.
|
|
133
|
+
*
|
|
134
|
+
* Node 22+. No React, no DOM beyond `fetch` and `ReadableStream`.
|
|
135
|
+
*/
|
|
136
|
+
declare class AliaServerClient {
|
|
137
|
+
#private;
|
|
138
|
+
constructor(options?: AliaServerClientOptions);
|
|
139
|
+
/** The absolute URL this client posts to. */
|
|
140
|
+
get url(): string;
|
|
141
|
+
/**
|
|
142
|
+
* Start one turn.
|
|
143
|
+
*
|
|
144
|
+
* Resolves once Alia has answered with a 2xx `text/event-stream`; the events
|
|
145
|
+
* arrive as they are written. Throws {@link AliaRequestError} for a non-2xx
|
|
146
|
+
* answer and {@link AliaStreamError} when the response is not a stream this
|
|
147
|
+
* client can read.
|
|
148
|
+
*/
|
|
149
|
+
stream(request: AliaChatCompletionRequest, init?: AliaStreamInit): Promise<AsyncIterable<AliaStreamEvent>>;
|
|
150
|
+
}
|
|
151
|
+
/** Convenience factory, for callers that would rather not write `new`. */
|
|
152
|
+
declare function createAliaServerClient(options?: AliaServerClientOptions): AliaServerClient;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* The SHAPE of a stream chunk this client could not read — never its content.
|
|
156
|
+
*
|
|
157
|
+
* A consumer logs this verbatim. The assistant's text, the person's prompt and
|
|
158
|
+
* any upstream message are deliberately absent: what a reader needs in order to
|
|
159
|
+
* fix a protocol mismatch is which keys arrived, not what they said.
|
|
160
|
+
*/
|
|
161
|
+
interface AliaChunkShape {
|
|
162
|
+
/** The chunk's top-level keys, capped, when it parsed as a JSON object. */
|
|
163
|
+
readonly keys?: readonly string[];
|
|
164
|
+
/** `choices.length`, or the `typeof` when `choices` was not an array. */
|
|
165
|
+
readonly choices?: number | string;
|
|
166
|
+
/** `error.code` / `error.type` when the chunk carried an error object. */
|
|
167
|
+
readonly errorCode?: string;
|
|
168
|
+
/** The SSE `event:` name the frame carried, when it had one. */
|
|
169
|
+
readonly event?: string;
|
|
170
|
+
/** `typeof` the parsed value, when it was not a JSON object. */
|
|
171
|
+
readonly valueType?: string;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Why a stream could not be read. Every one of these is a protocol mismatch
|
|
175
|
+
* between this client and the server, not an answer the server gave.
|
|
176
|
+
*/
|
|
177
|
+
type AliaStreamFailure =
|
|
178
|
+
/** The response was 2xx but not `text/event-stream`. */
|
|
179
|
+
'not_event_stream'
|
|
180
|
+
/** The response was 2xx, SSE, and had no readable body. */
|
|
181
|
+
| 'no_body'
|
|
182
|
+
/** A `data:` payload was not JSON. */
|
|
183
|
+
| 'malformed_json'
|
|
184
|
+
/** A chunk parsed, but is neither an OpenAI chunk nor an error payload. */
|
|
185
|
+
| 'unexpected_chunk'
|
|
186
|
+
/** A choice arrived without a `delta` object. */
|
|
187
|
+
| 'choice_without_delta'
|
|
188
|
+
/** `delta.content` was present and not a string. */
|
|
189
|
+
| 'content_not_string'
|
|
190
|
+
/** The body ended before `data: [DONE]`. */
|
|
191
|
+
| 'truncated'
|
|
192
|
+
/** The stream exceeded this client's byte or frame limits. */
|
|
193
|
+
| 'oversized';
|
|
194
|
+
/**
|
|
195
|
+
* The stream itself could not be read.
|
|
196
|
+
*
|
|
197
|
+
* Distinct from {@link AliaRequestError}, which means the server answered and
|
|
198
|
+
* said no. This one means the bytes did not match the protocol, and it always
|
|
199
|
+
* carries the shape that broke it so the mismatch is nameable from a log line.
|
|
200
|
+
*/
|
|
201
|
+
declare class AliaStreamError extends Error {
|
|
202
|
+
readonly failure: AliaStreamFailure;
|
|
203
|
+
readonly shape: AliaChunkShape;
|
|
204
|
+
constructor(failure: AliaStreamFailure, shape?: AliaChunkShape);
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Alia answered with a non-2xx status.
|
|
208
|
+
*
|
|
209
|
+
* `code` is the machine-readable code from the body when the body was small
|
|
210
|
+
* JSON that carried one — `code` or `error.code`. The body's prose is NOT
|
|
211
|
+
* retained: an upstream message is not a consumer's to show, and a client that
|
|
212
|
+
* keeps it invites a product surface to print it.
|
|
213
|
+
*/
|
|
214
|
+
declare class AliaRequestError extends Error {
|
|
215
|
+
readonly status: number;
|
|
216
|
+
readonly code: string | null;
|
|
217
|
+
constructor(status: number, code?: string | null);
|
|
218
|
+
}
|
|
219
|
+
/** The caller's `AbortSignal` fired. `name` is `AbortError`, as fetch's is. */
|
|
220
|
+
declare class AliaAbortError extends Error {
|
|
221
|
+
constructor(message?: string);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
interface ReadAliaEventStreamOptions {
|
|
225
|
+
readonly signal?: AbortSignal;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Read Alia's SSE body as typed events.
|
|
229
|
+
*
|
|
230
|
+
* Exported for a consumer that already holds a `Response` — the client below is
|
|
231
|
+
* this function plus the request and its status handling. The generator owns the
|
|
232
|
+
* reader: leaving the loop early (a `break`, a thrown consumer) cancels it.
|
|
233
|
+
*/
|
|
234
|
+
declare function readAliaEventStream(body: ReadableStream<Uint8Array>, options?: ReadAliaEventStreamOptions): AsyncGenerator<AliaStreamEvent, void, undefined>;
|
|
235
|
+
|
|
236
|
+
export { ALIA_API_URL, AliaAbortError, type AliaChatCompletionRequest, type AliaChatMessage, type AliaChunkShape, type AliaDoneEvent, type AliaErrorEvent, type AliaFinishEvent, type AliaHeaders, type AliaNamedEvent, type AliaReasoningEvent, AliaRequestError, AliaServerClient, type AliaServerClientOptions, AliaStreamError, type AliaStreamEvent, type AliaStreamFailure, type AliaStreamInit, type AliaTextEvent, type ReadAliaEventStreamOptions, createAliaServerClient, readAliaEventStream };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The typed events one Alia turn produces.
|
|
3
|
+
*
|
|
4
|
+
* Every byte Alia writes on `POST /v1/chat/completions` lands in exactly one of
|
|
5
|
+
* these, or the read fails loudly with an {@link AliaStreamError}. There is no
|
|
6
|
+
* third outcome — no "unrecognised, carry on" — because that is what a
|
|
7
|
+
* hand-rolled parser gets wrong: a consumer that skips what it does not
|
|
8
|
+
* understand drops an error payload and reports an empty answer.
|
|
9
|
+
*/
|
|
10
|
+
type AliaStreamEvent = AliaTextEvent | AliaReasoningEvent | AliaNamedEvent | AliaFinishEvent | AliaErrorEvent | AliaDoneEvent;
|
|
11
|
+
/**
|
|
12
|
+
* One `choices[0].delta.content` delta, verbatim.
|
|
13
|
+
*
|
|
14
|
+
* Deltas are never merged or re-chunked. A consumer that reassembles markers
|
|
15
|
+
* spanning chunk boundaries relies on the bytes arriving exactly as sent.
|
|
16
|
+
*/
|
|
17
|
+
interface AliaTextEvent {
|
|
18
|
+
readonly type: 'text';
|
|
19
|
+
readonly text: string;
|
|
20
|
+
/**
|
|
21
|
+
* The chunk's `alia_meta`, when it had one. Alia sets it on a SYNTHETIC
|
|
22
|
+
* message — the stand-in text written when a provider died mid-turn — so a
|
|
23
|
+
* consumer can tell a real answer from a recovery notice.
|
|
24
|
+
*/
|
|
25
|
+
readonly meta?: Readonly<Record<string, unknown>>;
|
|
26
|
+
}
|
|
27
|
+
/** One `choices[0].delta.reasoning` delta. */
|
|
28
|
+
interface AliaReasoningEvent {
|
|
29
|
+
readonly type: 'reasoning';
|
|
30
|
+
readonly text: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A named Alia product event: `alia.agent_turn`, `alia.tool_result`,
|
|
34
|
+
* `alia.research_progress`, `alia.plan_preview`, and whatever the product adds
|
|
35
|
+
* next. `data` is the frame's parsed JSON, unvalidated on purpose — this client
|
|
36
|
+
* is the transport, and the product's event schemas are versioned in the
|
|
37
|
+
* payload (`eventVersion`) rather than pinned here.
|
|
38
|
+
*/
|
|
39
|
+
interface AliaNamedEvent {
|
|
40
|
+
readonly type: 'event';
|
|
41
|
+
readonly event: string;
|
|
42
|
+
readonly data: unknown;
|
|
43
|
+
}
|
|
44
|
+
/** A `finish_reason` chunk — the turn's last content-bearing frame. */
|
|
45
|
+
interface AliaFinishEvent {
|
|
46
|
+
readonly type: 'finish';
|
|
47
|
+
readonly reason: string;
|
|
48
|
+
readonly meta?: Readonly<Record<string, unknown>>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Alia wrote an error INTO the stream and is about to end it.
|
|
52
|
+
*
|
|
53
|
+
* This is an event rather than a throw because it is the server's answer, not a
|
|
54
|
+
* transport fault: `code` is the server's own, and it is the thing a consumer
|
|
55
|
+
* maps to what it tells a person. `{"error":{"code":"agent_unavailable"}}` was
|
|
56
|
+
* invisible for hours in a consumer that had no branch for it.
|
|
57
|
+
*/
|
|
58
|
+
interface AliaErrorEvent {
|
|
59
|
+
readonly type: 'error';
|
|
60
|
+
readonly code: string | null;
|
|
61
|
+
readonly message: string;
|
|
62
|
+
readonly errorType: string | null;
|
|
63
|
+
readonly param: string | null;
|
|
64
|
+
}
|
|
65
|
+
/** `data: [DONE]`. The stream is complete; nothing follows it. */
|
|
66
|
+
interface AliaDoneEvent {
|
|
67
|
+
readonly type: 'done';
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Alia's public product API. */
|
|
71
|
+
declare const ALIA_API_URL = "https://api.alia.onl";
|
|
72
|
+
type AliaHeaders = Readonly<Record<string, string>>;
|
|
73
|
+
interface AliaChatMessage {
|
|
74
|
+
readonly role: 'system' | 'user' | 'assistant' | 'tool';
|
|
75
|
+
readonly content: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* One turn. `stream` is not an option: this client only streams, which is why
|
|
79
|
+
* it can promise that every byte lands in a typed event.
|
|
80
|
+
*/
|
|
81
|
+
interface AliaChatCompletionRequest {
|
|
82
|
+
readonly messages: readonly AliaChatMessage[];
|
|
83
|
+
/** The Alia agent this turn runs as. */
|
|
84
|
+
readonly agentId?: string;
|
|
85
|
+
/** A routing-profile id. Omit it and Alia picks the product default. */
|
|
86
|
+
readonly model?: string;
|
|
87
|
+
readonly conversationId?: string;
|
|
88
|
+
readonly reasoningEffort?: string;
|
|
89
|
+
readonly webSearch?: boolean;
|
|
90
|
+
readonly deepResearch?: boolean;
|
|
91
|
+
readonly clientContext?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Anything else the product route accepts. Merged UNDER the fields above, so
|
|
94
|
+
* a typed field always wins and `stream` can never be turned off.
|
|
95
|
+
*/
|
|
96
|
+
readonly extra?: Readonly<Record<string, unknown>>;
|
|
97
|
+
}
|
|
98
|
+
interface AliaServerClientOptions {
|
|
99
|
+
/** e.g. `https://api.alia.onl`. A trailing slash is ignored. */
|
|
100
|
+
readonly baseUrl?: string;
|
|
101
|
+
/**
|
|
102
|
+
* The calling product's Oxy service token — the bearer Oxy bills. A function
|
|
103
|
+
* is called once per turn, for a credential that rotates.
|
|
104
|
+
*/
|
|
105
|
+
readonly token?: string | (() => string | Promise<string>);
|
|
106
|
+
/**
|
|
107
|
+
* Extra headers. A function is called once per turn, which is what a one-use
|
|
108
|
+
* header such as `X-Oxy-Requester-Assertion` needs: Oxy consumes each
|
|
109
|
+
* assertion, so it must be minted per request and never cached.
|
|
110
|
+
*/
|
|
111
|
+
readonly headers?: AliaHeaders | (() => AliaHeaders | Promise<AliaHeaders>);
|
|
112
|
+
/** Injected for tests. Defaults to the global `fetch`. */
|
|
113
|
+
readonly fetch?: typeof fetch;
|
|
114
|
+
/** Override the chat path. Defaults to `/v1/chat/completions`. */
|
|
115
|
+
readonly path?: string;
|
|
116
|
+
}
|
|
117
|
+
interface AliaStreamInit {
|
|
118
|
+
readonly signal?: AbortSignal;
|
|
119
|
+
/** This turn's bearer, overriding the client's. */
|
|
120
|
+
readonly token?: string;
|
|
121
|
+
/** This turn's extra headers, merged over the client's. */
|
|
122
|
+
readonly headers?: AliaHeaders;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* A backend's client for Alia's product API.
|
|
126
|
+
*
|
|
127
|
+
* It exists because every consumer that called Alia from a server wrote the same
|
|
128
|
+
* SSE parser, and each one got a different subset of the wire right. Alia writes
|
|
129
|
+
* OpenAI-shaped chunks, named product events, synthetic recovery chunks carrying
|
|
130
|
+
* `alia_meta`, in-stream error payloads and a terminal `[DONE]` — five shapes,
|
|
131
|
+
* of which a hand-rolled reader typically handles two and silently drops the
|
|
132
|
+
* one that matters when something is wrong.
|
|
133
|
+
*
|
|
134
|
+
* Node 22+. No React, no DOM beyond `fetch` and `ReadableStream`.
|
|
135
|
+
*/
|
|
136
|
+
declare class AliaServerClient {
|
|
137
|
+
#private;
|
|
138
|
+
constructor(options?: AliaServerClientOptions);
|
|
139
|
+
/** The absolute URL this client posts to. */
|
|
140
|
+
get url(): string;
|
|
141
|
+
/**
|
|
142
|
+
* Start one turn.
|
|
143
|
+
*
|
|
144
|
+
* Resolves once Alia has answered with a 2xx `text/event-stream`; the events
|
|
145
|
+
* arrive as they are written. Throws {@link AliaRequestError} for a non-2xx
|
|
146
|
+
* answer and {@link AliaStreamError} when the response is not a stream this
|
|
147
|
+
* client can read.
|
|
148
|
+
*/
|
|
149
|
+
stream(request: AliaChatCompletionRequest, init?: AliaStreamInit): Promise<AsyncIterable<AliaStreamEvent>>;
|
|
150
|
+
}
|
|
151
|
+
/** Convenience factory, for callers that would rather not write `new`. */
|
|
152
|
+
declare function createAliaServerClient(options?: AliaServerClientOptions): AliaServerClient;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* The SHAPE of a stream chunk this client could not read — never its content.
|
|
156
|
+
*
|
|
157
|
+
* A consumer logs this verbatim. The assistant's text, the person's prompt and
|
|
158
|
+
* any upstream message are deliberately absent: what a reader needs in order to
|
|
159
|
+
* fix a protocol mismatch is which keys arrived, not what they said.
|
|
160
|
+
*/
|
|
161
|
+
interface AliaChunkShape {
|
|
162
|
+
/** The chunk's top-level keys, capped, when it parsed as a JSON object. */
|
|
163
|
+
readonly keys?: readonly string[];
|
|
164
|
+
/** `choices.length`, or the `typeof` when `choices` was not an array. */
|
|
165
|
+
readonly choices?: number | string;
|
|
166
|
+
/** `error.code` / `error.type` when the chunk carried an error object. */
|
|
167
|
+
readonly errorCode?: string;
|
|
168
|
+
/** The SSE `event:` name the frame carried, when it had one. */
|
|
169
|
+
readonly event?: string;
|
|
170
|
+
/** `typeof` the parsed value, when it was not a JSON object. */
|
|
171
|
+
readonly valueType?: string;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Why a stream could not be read. Every one of these is a protocol mismatch
|
|
175
|
+
* between this client and the server, not an answer the server gave.
|
|
176
|
+
*/
|
|
177
|
+
type AliaStreamFailure =
|
|
178
|
+
/** The response was 2xx but not `text/event-stream`. */
|
|
179
|
+
'not_event_stream'
|
|
180
|
+
/** The response was 2xx, SSE, and had no readable body. */
|
|
181
|
+
| 'no_body'
|
|
182
|
+
/** A `data:` payload was not JSON. */
|
|
183
|
+
| 'malformed_json'
|
|
184
|
+
/** A chunk parsed, but is neither an OpenAI chunk nor an error payload. */
|
|
185
|
+
| 'unexpected_chunk'
|
|
186
|
+
/** A choice arrived without a `delta` object. */
|
|
187
|
+
| 'choice_without_delta'
|
|
188
|
+
/** `delta.content` was present and not a string. */
|
|
189
|
+
| 'content_not_string'
|
|
190
|
+
/** The body ended before `data: [DONE]`. */
|
|
191
|
+
| 'truncated'
|
|
192
|
+
/** The stream exceeded this client's byte or frame limits. */
|
|
193
|
+
| 'oversized';
|
|
194
|
+
/**
|
|
195
|
+
* The stream itself could not be read.
|
|
196
|
+
*
|
|
197
|
+
* Distinct from {@link AliaRequestError}, which means the server answered and
|
|
198
|
+
* said no. This one means the bytes did not match the protocol, and it always
|
|
199
|
+
* carries the shape that broke it so the mismatch is nameable from a log line.
|
|
200
|
+
*/
|
|
201
|
+
declare class AliaStreamError extends Error {
|
|
202
|
+
readonly failure: AliaStreamFailure;
|
|
203
|
+
readonly shape: AliaChunkShape;
|
|
204
|
+
constructor(failure: AliaStreamFailure, shape?: AliaChunkShape);
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Alia answered with a non-2xx status.
|
|
208
|
+
*
|
|
209
|
+
* `code` is the machine-readable code from the body when the body was small
|
|
210
|
+
* JSON that carried one — `code` or `error.code`. The body's prose is NOT
|
|
211
|
+
* retained: an upstream message is not a consumer's to show, and a client that
|
|
212
|
+
* keeps it invites a product surface to print it.
|
|
213
|
+
*/
|
|
214
|
+
declare class AliaRequestError extends Error {
|
|
215
|
+
readonly status: number;
|
|
216
|
+
readonly code: string | null;
|
|
217
|
+
constructor(status: number, code?: string | null);
|
|
218
|
+
}
|
|
219
|
+
/** The caller's `AbortSignal` fired. `name` is `AbortError`, as fetch's is. */
|
|
220
|
+
declare class AliaAbortError extends Error {
|
|
221
|
+
constructor(message?: string);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
interface ReadAliaEventStreamOptions {
|
|
225
|
+
readonly signal?: AbortSignal;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Read Alia's SSE body as typed events.
|
|
229
|
+
*
|
|
230
|
+
* Exported for a consumer that already holds a `Response` — the client below is
|
|
231
|
+
* this function plus the request and its status handling. The generator owns the
|
|
232
|
+
* reader: leaving the loop early (a `break`, a thrown consumer) cancels it.
|
|
233
|
+
*/
|
|
234
|
+
declare function readAliaEventStream(body: ReadableStream<Uint8Array>, options?: ReadAliaEventStreamOptions): AsyncGenerator<AliaStreamEvent, void, undefined>;
|
|
235
|
+
|
|
236
|
+
export { ALIA_API_URL, AliaAbortError, type AliaChatCompletionRequest, type AliaChatMessage, type AliaChunkShape, type AliaDoneEvent, type AliaErrorEvent, type AliaFinishEvent, type AliaHeaders, type AliaNamedEvent, type AliaReasoningEvent, AliaRequestError, AliaServerClient, type AliaServerClientOptions, AliaStreamError, type AliaStreamEvent, type AliaStreamFailure, type AliaStreamInit, type AliaTextEvent, type ReadAliaEventStreamOptions, createAliaServerClient, readAliaEventStream };
|