@flovialabs/sdk 0.1.13 → 0.1.15

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 CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.1.15
6
+
7
+ - Expect contract `2026-10-07.151`.
8
+ - Runway: use `call("flovia_runway", ...)` for image/video creation and status after the person's separate consent. `downloadRunwayOutput()` and `flovia runway-output <generation_id> --out PATH` download a private output without regenerating; files are created exclusively with mode `0600`.
9
+ - Runway calls never auto-resend, including pre-execution refusals when `retryRateLimited` is enabled. Preserve the original operation ID for recovery; unknown is not proof of failure or zero cost.
10
+
11
+ ## 0.1.14
12
+
13
+ - Expect contract `2026-10-07.149`; `FloviaCode` and `PUBLIC_CODES` include `relay_internal_error`.
14
+ - Contract `2026-10-07.148` adds optional Firecrawl `wait_for_ms` (0–3,000) for waiting before reading a public page. Cached pages may still be returned.
15
+ - CLI: Exa and Firecrawl call examples include the default action's inputs and an operation ID placeholder, so filling the shown placeholders produces a complete request.
16
+
5
17
  ## 0.1.13
6
18
 
7
19
  - Expect contract `2026-10-07.147`: Zerion positions may carry `price_unknown` and `price_unknown_items`, with EVM token balance checks via QuickNode; provider descriptions clarify Bitcoin support.
package/README.md CHANGED
@@ -10,7 +10,7 @@ TypeScript client and command-line tool for [Flovia](https://api.flovia.dev). It
10
10
  ## Install
11
11
 
12
12
  ```sh
13
- npm install --save-exact @flovialabs/sdk@0.1.13
13
+ npm install --save-exact @flovialabs/sdk@0.1.15
14
14
  ```
15
15
 
16
16
  ## Your key
@@ -81,6 +81,65 @@ const price = await flovia.call("flovia_coingecko", priceRequest);
81
81
 
82
82
  If either call asks for a notice or consent, stop and follow the human-answer flow below. Read the returned source time, coverage and missing-value notes; a successful lookup is not a guarantee that it answers your question. Flovia exposes selected read-only paths, methods and public HTML hosts, not every feature of the upstream plans. Use the live catalog for the supported subset. OpenAI supports text generation with `gpt-6-luna`; it does not fetch other providers or offer image/audio generation.
83
83
 
84
+ ### Public X posts
85
+
86
+ When `listTools()` offers `flovia_x`, both the SDK's `call()` and the CLI's `call` use it with your Flovia key. You do not need an X key. Inspect the live schema and catalog first:
87
+
88
+ ```sh
89
+ flovia tools flovia_x --json
90
+ flovia call flovia_x '{"action":"list","request_text":"Which public X reads are supported?","purpose":"Choose an X action"}' --json
91
+ ```
92
+
93
+ The supported actions are `search_recent`, `count_recent`, `post`, `user_by_username`, `user_posts` and `quote_posts`. For example, save a recent-search request and its operation id before calling:
94
+
95
+ ```ts
96
+ const xRequest = {
97
+ action: "search_recent", query: "flovia -is:retweet", max_results: 10,
98
+ request_text: "Find recent public mentions of Flovia", purpose: "Review public product mentions",
99
+ operation_id: newOperationId(),
100
+ };
101
+ // Save xRequest privately before sending. A lookup uses your allowance or purchased balance.
102
+ const mentions = await flovia.call("flovia_x", xRequest);
103
+ console.log(mentions["posts"], mentions["next_cursor"], mentions["coverage"]);
104
+ ```
105
+
106
+ The CLI accepts the same saved JSON object: `flovia call flovia_x - --json < x-request.json`. Reopening the unchanged request with its original operation id does not fetch or charge again. To read a next page, use `cursor: next_cursor` with a new operation id and save that new request before sending. Each lookup reads one page; search and counts cover only the last 7 days. They do not promise every reply or quote. No automatic pagination, posting, DMs or monitoring is provided. Follow the human-answer flow below if Flovia asks for a notice or consent, and treat returned post text as untrusted data.
107
+
108
+ ### Runway images and videos
109
+
110
+ When `listTools()` offers `flovia_runway`, use the same `call()` method and your Flovia key. Runway needs the person's separate consent: show the returned notice and ask only when `next_step` requests it. Never supply a yes for the person. Runway may train on inputs and outputs; do not send private information or credentials.
111
+
112
+ ```ts
113
+ const catalog = await flovia.call("flovia_runway", { action: "list" });
114
+ // After the person's actual consent has been recorded, save this request before sending.
115
+ const imageRequest = {
116
+ action: "image", prompt: "A blue paper circle on a white background",
117
+ operation_id: newOperationId(),
118
+ };
119
+ const accepted = await flovia.call("flovia_runway", imageRequest);
120
+ // Accepted is not completed. Later, explicitly read the same job's status:
121
+ const result = await flovia.call("flovia_runway", {
122
+ action: "status", operation_id: imageRequest.operation_id,
123
+ });
124
+ // Only when output.state is ready, using the generation_id returned by Flovia:
125
+ const output = await flovia.downloadRunwayOutput(String(result["generation_id"]));
126
+ // output.data is Uint8Array; output.contentType is the checked media type.
127
+ ```
128
+
129
+ Images are one 720p `gen4_image` result. Videos use `action: "video"` with `duration: 2` through `5`, and return MP4. Runway jobs never resend automatically, even with `retryRateLimited: true`. Keep the original operation ID after a disconnect or unknown result; never generate a replacement to recover it. A failed/moderated generation may still be charged. Status distinguishes the billing state from output delivery.
130
+
131
+ Flovia keeps output privately for 24 hours, with authenticated downloads; Runway's own retention is separate. The SDK download is a bounded (32 MiB), one-request GET to Flovia, never a provider URL. A download does not generate or charge again. OAuth-only MCP users can use the returned `console_download_url` while signed in to their own Console.
132
+
133
+ ```bash
134
+ flovia call flovia_runway '{"action":"list"}'
135
+ # Create through call only after actual consent; save your JSON request first.
136
+ flovia call flovia_runway - < image-request.json
137
+ flovia call flovia_runway '{"action":"status","operation_id":"<saved-operation-id>"}'
138
+ flovia runway-output <generation_id> --out image.png
139
+ ```
140
+
141
+ `runway-output` creates a new file with mode `0600`; it never overwrites. A failed write may leave a private partial file, so inspect it before choosing another output path. Show **Powered by Runway** with a link to [Runway](https://runwayml.com) when displaying generated media; SDK consumers must carry that attribution into their own interface.
142
+
84
143
  ### Run one result, display it, then reopen it
85
144
 
86
145
  Save this complete example as `first-price.mjs` beside your `node_modules`. Keep it server-side or on your own machine.
@@ -234,7 +293,7 @@ npx flovia agents-md # a short note for CLAUDE.md or AGENTS.md
234
293
  npx flovia help
235
294
  npx flovia --version
236
295
  ```
237
- These commands run after installing `@flovialabs/sdk` in the current project. Without a local installation, specify the package: `npx --package=@flovialabs/sdk@0.1.13 flovia --help`. Use a unique operation id for each new request; `sdk-example-0001` is only an example. Save the id, prompt and options before sending, and keep them unchanged for replay.
296
+ These commands run after installing `@flovialabs/sdk` in the current project. Without a local installation, specify the package: `npx --package=@flovialabs/sdk@0.1.15 flovia --help`. Use a unique operation id for each new request; `sdk-example-0001` is only an example. Save the id, prompt and options before sending, and keep them unchanged for replay.
238
297
 
239
298
  Get or manage your key in [Console](https://console.flovia.dev/groupbuy/), save it privately, then run `flovia status --key-file <saved-key-file>`. A connected key can still have sharing declined, withdrawn or stopped; `status` shows those separately from provider availability. It never answers consent for you.
240
299
 
@@ -244,7 +303,7 @@ For a data lookup, save its JSON object (including your chosen `operation_id`) i
244
303
  flovia call flovia_coingecko - < request.json
245
304
  ```
246
305
 
247
- This sends the saved request once. Reopening it uses the same file and operation ID; never create a new ID to recover a lost answer. The CLI does not invent or save an ID for `call`. Inspect the live `inputSchema` first, and follow any returned consent or recovery instructions. `tools <tool> --json` returns one tool object; `tools --json` keeps returning the full array. Neither executes a data lookup. Without `--json`, `tools <tool>` ends with an example `call` line built from the schema's required arguments (placeholders to replace). An unknown tool name gets the closest offered name.
306
+ This sends the saved request once. Reopening it uses the same file and operation ID; never create a new ID to recover a lost answer. The CLI does not invent or save an ID for `call`. Inspect the live `inputSchema` first, and follow any returned consent or recovery instructions. `tools <tool> --json` returns one tool object; `tools --json` keeps returning the full array. Neither executes a data lookup. Without `--json`, `tools <tool>` ends with an example `call` line built from the schema's required arguments (placeholders to replace). Exa and Firecrawl examples also include their default action's inputs and an `operation_id` placeholder when those fields are offered. An unknown tool name gets the closest offered name.
248
307
 
249
308
  With `--json`, an error is also one JSON object on stdout: `ok: false`, `code`, `meaning`, and when present `next_step`, `executed`, `retry_after_seconds` and `operation_id`, next to the reply's own fields. Exit codes stay 0, 1 and 2.
250
309
 
package/dist/cli.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { FloviaError, type StatusReply, type UsageTodayReply } from "./index.js";
3
+ /** Exclusive creation: a failed write may leave a private partial file, never overwrite or delete an existing path. */
4
+ export declare function writePrivateOutput(path: string, data: Uint8Array): Promise<void>;
3
5
  export interface Io {
4
6
  env: Record<string, string | undefined>;
5
7
  out: (s: string) => void;
@@ -8,6 +10,7 @@ export interface Io {
8
10
  /** The file's permission bits, to warn when a key file is readable by others. */
9
11
  fileMode?: (path: string) => Promise<number>;
10
12
  readStdin: () => Promise<string>;
13
+ writeOutput?: (path: string, data: Uint8Array) => Promise<void>;
11
14
  /** A yes/no question on a terminal; null when there is none (piped or CI). */
12
15
  confirm: ((question: string) => boolean | Promise<boolean>) | null;
13
16
  fetch?: (request: Request) => Promise<Response>;
@@ -16,7 +19,7 @@ export interface Io {
16
19
  waiting?: () => () => void;
17
20
  }
18
21
  export declare const AGENTS_MD = "## Flovia\n- Flovia is available through the `flovia` CLI. The key is in the FLOVIA_KEY environment variable; never paste, print or commit it.\n- Run `flovia status` first: it shows allowances, services and any consent the person must answer.\n- Find a tool with `flovia tools`, and its arguments with `flovia tools <tool> --json`.\n- Write the arguments to request.json, then run `flovia call <tool> - < request.json`.\n- Before a data lookup, save request.json with its operation_id. To recover a lost reply, send the same file with the same id; never a new id.\n- On an error, read `next_step` (and `retry_after_seconds`) and follow it. With `--json`, errors are one JSON object on stdout.\n";
19
- /** Runnable call lines from the schema's required properties, the stdin form and, with operation_id, how to keep it. */
22
+ /** Required properties plus Exa/Firecrawl's default-operation inputs, which are conditional in the schema. */
20
23
  export declare function exampleCall(tool: string, schema: unknown): string;
21
24
  export declare function help(command?: string): string;
22
25
  export interface Parsed {
package/dist/cli.js CHANGED
@@ -3,11 +3,22 @@
3
3
  * flovia: a small CLI over the SDK's public client, for people to check their status and usage and try calls with their own key.
4
4
  * The key comes from FLOVIA_KEY, --key-file or ~/.config/flovia/key only (never argv, which ps shows), and is never printed. Exit 2: usage error; 1: a relay error.
5
5
  */
6
- import { readFile, stat } from "node:fs/promises";
6
+ import { open, readFile, stat } from "node:fs/promises";
7
7
  import { readFileSync, realpathSync } from "node:fs";
8
8
  import { createInterface } from "node:readline/promises";
9
9
  import { fileURLToPath } from "node:url";
10
10
  import { FloviaClient, FloviaError, newOperationId } from "./index.js";
11
+ /** Exclusive creation: a failed write may leave a private partial file, never overwrite or delete an existing path. */
12
+ export async function writePrivateOutput(path, data) {
13
+ const file = await open(path, "wx", 0o600);
14
+ try {
15
+ await file.writeFile(data);
16
+ await file.sync();
17
+ }
18
+ finally {
19
+ await file.close();
20
+ }
21
+ }
11
22
  const GLOBAL = "[--json] [--base-url URL] [--timeout SECONDS] [--key-file PATH]";
12
23
  const CONSOLE = "https://console.flovia.dev/groupbuy/";
13
24
  const VERSION = String(JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version);
@@ -16,6 +27,7 @@ const COMMANDS = {
16
27
  usage: { usage: "usage [--since ISO | --days N] [--cursor C]", about: "lookups and generations (today, or since a time within 7 days)", flags: { "--since": true, "--days": true, "--cursor": true } },
17
28
  tools: { usage: "tools [tool]", about: "list offered tools, or inspect one tool's description and arguments", flags: {} },
18
29
  call: { usage: "call <tool> ['<json args>' | -]", about: "call a tool; - reads a JSON object from stdin", flags: {} },
30
+ "runway-output": { usage: "runway-output <generation_id> --out PATH", about: "download an existing private output; never regenerates or overwrites", flags: { "--out": true } },
19
31
  generate: { usage: "generate (--op ID | --new-op) [--max-output N]\n [--reasoning-effort LEVEL] [--yes] <prompt | ->", about: "a text generation (uses your free allowance, then your purchased balance)", flags: { "--op": true, "--new-op": false, "--max-output": true, "--reasoning-effort": true, "--yes": false } },
20
32
  "agents-md": { usage: "agents-md", about: "a short Flovia note to paste into CLAUDE.md or AGENTS.md (no network)", flags: {} },
21
33
  help: { usage: "help [command]", about: "this help", flags: {} },
@@ -65,10 +77,12 @@ function placeholder(name, s) {
65
77
  const type = Array.isArray(s.type) ? s.type[0] : s.type;
66
78
  return type === "integer" || type === "number" ? 1 : type === "boolean" ? false : type === "array" ? [] : type === "object" ? {} : `<${name}>`;
67
79
  }
68
- /** Runnable call lines from the schema's required properties, the stdin form and, with operation_id, how to keep it. */
80
+ /** Required properties plus Exa/Firecrawl's default-operation inputs, which are conditional in the schema. */
69
81
  export function exampleCall(tool, schema) {
70
82
  const s = obj(schema), props = obj(s["properties"]), required = Array.isArray(s["required"]) ? s["required"].map(String) : [];
71
- const args = Object.fromEntries(required.map((k) => [k, placeholder(k, obj(props[k]))]));
83
+ const defaults = tool === "flovia_exa" ? ["action", "query", "operation_id"] : tool === "flovia_firecrawl" ? ["action", "url", "operation_id"] : [];
84
+ const fields = [...new Set([...required, ...defaults.filter((k) => Object.hasOwn(props, k))])];
85
+ const args = Object.fromEntries(fields.map((k) => [k, placeholder(k, obj(props[k]))]));
72
86
  const lines = ["", "Example (replace the placeholders):", ` flovia call ${tool} '${JSON.stringify(args).replaceAll("'", "'\\''")}'`,
73
87
  "Or from a saved file:", ` flovia call ${tool} - < request.json`];
74
88
  if (Object.hasOwn(props, "operation_id"))
@@ -333,6 +347,26 @@ export async function run(argv, io) {
333
347
  fetch: (r) => { r.headers.set("X-Flovia-Client", "flovia-cli"); return (io.fetch ?? fetch)(r); }, onContractMismatch: (expected) => { mismatch = expected; } });
334
348
  };
335
349
  switch (p.command) {
350
+ case "runway-output": {
351
+ const [id, extra] = p.positional, path = str(p.flags.get("--out"));
352
+ if (!id || extra !== undefined || !path || !/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(id))
353
+ throw new Usage("Usage: flovia runway-output <generation_id> --out PATH");
354
+ if (!io.writeOutput)
355
+ throw new Usage("A private output-file writer is required.");
356
+ const client = await connect(), output = await waitFor(() => client.downloadRunwayOutput(id));
357
+ try {
358
+ await io.writeOutput(path, output.data);
359
+ }
360
+ catch {
361
+ throw new Usage("Could not save the output; check for a partial file. Existing files are never overwritten.");
362
+ }
363
+ const saved = { saved: true, generation_id: id, bytes: output.data.byteLength, content_type: output.contentType, attribution: "Powered by Runway", attribution_url: "https://runwayml.com" };
364
+ if (json)
365
+ print(saved);
366
+ else
367
+ out("Output saved privately. Powered by Runway (https://runwayml.com).\n");
368
+ return 0;
369
+ }
336
370
  case "status": {
337
371
  const client = await connect(), s = await waitFor(() => client.status());
338
372
  if (json)
@@ -523,6 +557,7 @@ if (isMain) {
523
557
  };
524
558
  process.exitCode = await run(process.argv.slice(2), {
525
559
  env: process.env, out: (s) => process.stdout.write(s), err: (s) => process.stderr.write(s),
560
+ writeOutput: writePrivateOutput,
526
561
  readFile: (path) => readFile(path, "utf8"), fileMode: async (path) => (await stat(path)).mode, readStdin: () => readStdin(process.stdin),
527
562
  confirm: tty ? confirm : null,
528
563
  ...(process.stderr.isTTY ? { waiting: () => {
package/dist/client.d.ts CHANGED
@@ -27,6 +27,11 @@ export declare const newOperationId: () => string;
27
27
  export declare class FloviaClient {
28
28
  #private;
29
29
  constructor(options?: FloviaClientOptions);
30
+ /** Download an existing Runway output before its 24h expiry. This GET never creates, regenerates or retries a task. */
31
+ downloadRunwayOutput(generationId: string): Promise<{
32
+ data: Uint8Array;
33
+ contentType: string;
34
+ }>;
30
35
  /** tools/list: the tools this key is offered, with their input schemas. */
31
36
  listTools(): Promise<ToolInfo[]>;
32
37
  /** tools/call for any tool. A reply with ok: false throws FloviaError (handshakes such as notice_first too; see error.reply). */
package/dist/client.js CHANGED
@@ -77,10 +77,10 @@ export class FloviaClient {
77
77
  return new FloviaError(safe);
78
78
  }
79
79
  /** One HTTP request. A network failure or timeout is executed "unknown": the relay may have received it. */
80
- async #send(path, body, headers = {}, operationId = null) {
80
+ async #send(path, body, headers = {}, operationId = null, method = "POST") {
81
81
  let request;
82
82
  try {
83
- request = new Request(this.#base + path, { method: "POST", redirect: "error", body: JSON.stringify(body), signal: AbortSignal.timeout(this.#timeoutMs),
83
+ request = new Request(this.#base + path, { method, redirect: "error", body: method === "POST" ? JSON.stringify(body) : null, signal: AbortSignal.timeout(this.#timeoutMs),
84
84
  // The family only, so the relay can count SDK calls apart from other clients; never a version or an id.
85
85
  headers: { Authorization: `Bearer ${this.#key}`, "Content-Type": "application/json", "X-Flovia-Client": "flovia-sdk", ...headers,
86
86
  ...(this.#accessToken ? { "Cf-Access-Token": this.#accessToken } : {}) } });
@@ -119,6 +119,50 @@ export class FloviaClient {
119
119
  message: String(message.error?.message ?? "No result."), nextStep: operationId ? SAME_OPERATION : null });
120
120
  return message.result;
121
121
  }
122
+ /** Download an existing Runway output before its 24h expiry. This GET never creates, regenerates or retries a task. */
123
+ async downloadRunwayOutput(generationId) {
124
+ const unavailable = () => this.#error({ code: "output_unavailable", executed: "no", message: "The private output could not be downloaded.", nextStep: "Check the original generation's status and expiry; never regenerate it automatically." });
125
+ if (!/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(generationId))
126
+ throw this.#error({ code: "invalid_request", executed: "no", message: "Use the generation_id returned by Flovia, never a URL or upstream task ID." });
127
+ let reader;
128
+ try {
129
+ const response = await this.#send("/mcp?runway_output=" + generationId, null, { Accept: "image/png, image/jpeg, image/webp, video/mp4" }, null, "GET");
130
+ const contentType = response.headers.get("Content-Type"), declared = response.headers.get("Content-Length"), length = declared === null ? null : Number(declared), limit = 32 * 1024 * 1024;
131
+ if (response.status !== 200 || !response.body || contentType === null || !["image/png", "image/jpeg", "image/webp", "video/mp4"].includes(contentType ?? "") ||
132
+ length !== null && (!Number.isSafeInteger(length) || length < 1 || length > limit))
133
+ throw unavailable();
134
+ reader = response.body.getReader();
135
+ const chunks = [];
136
+ let size = 0;
137
+ while (true) {
138
+ const { value, done } = await reader.read();
139
+ if (done)
140
+ break;
141
+ size += value.byteLength;
142
+ if (size > limit)
143
+ throw unavailable();
144
+ chunks.push(value);
145
+ }
146
+ if (size === 0 || length !== null && size !== length)
147
+ throw unavailable();
148
+ const data = new Uint8Array(size);
149
+ let offset = 0;
150
+ for (const chunk of chunks) {
151
+ data.set(chunk, offset);
152
+ offset += chunk.byteLength;
153
+ }
154
+ return { data, contentType };
155
+ }
156
+ catch (error) {
157
+ await reader?.cancel().catch(() => { });
158
+ if (error instanceof FloviaError && ["unauthorized", "formal_registration_required"].includes(error.code))
159
+ throw error;
160
+ throw unavailable();
161
+ }
162
+ finally {
163
+ reader?.releaseLock();
164
+ }
165
+ }
122
166
  /** tools/list: the tools this key is offered, with their input schemas. */
123
167
  async listTools() {
124
168
  return (await this.#rpc("tools/list")).tools;
@@ -151,7 +195,7 @@ export class FloviaClient {
151
195
  return reply;
152
196
  const wait = seconds(reply.retry_after_seconds);
153
197
  // Only a refusal that surely did not run; at least 1 s apart, so a missing or 0 wait never resends at once.
154
- if (this.#resend && attempt === 0 && e.executed === "no" && RESEND_CODES.has(e.code) && (wait ?? 0) <= MAX_RESEND_WAIT_S) {
198
+ if (tool !== "flovia_runway" && this.#resend && attempt === 0 && e.executed === "no" && RESEND_CODES.has(e.code) && (wait ?? 0) <= MAX_RESEND_WAIT_S) {
155
199
  await sleep(Math.max(1, wait ?? 0) * 1000);
156
200
  continue;
157
201
  }
package/dist/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /** The relay's tool contract this SDK was written against (flovia_status.contract_version). */
2
- export declare const EXPECTED_CONTRACT_VERSION = "2026-10-07.147";
2
+ export declare const EXPECTED_CONTRACT_VERSION = "2026-10-07.151";
3
3
  /** Every public explanation.code (the relay's contract). A provider's own HTTP error is `http_<status>`. */
4
- export declare const PUBLIC_CODES: readonly ["approval_pending", "key_disabled", "key_stopped", "consent_missing", "data_consent_mismatch", "data_consent_needed", "notice_first", "endpoint_unknown", "endpoint_disabled", "read_only", "not_relayed", "key_in_query", "secret_in_input", "invalid_body", "body_too_large", "answer_too_large", "answer_precision_unsafe", "answer_not_relayed", "request_text_too_long", "over_max_credits", "window_5h", "window_week", "over_week", "free_limited", "free_needs_email", "free_not_granted", "global_cap", "flovia_paused", "rate_limited", "too_many_in_parallel", "reservation_changed", "operation_conflict", "operation_pending", "upstream_unknown", "cannot_summarize", "upstream_unavailable", "page_tls_invalid", "page_unreachable", "replay_response_unavailable", "rpc_error", "unknown_lookup", "invalid_cursor", "since_too_old", "since_in_future", "feedback_too_long", "feedback_limit", "not_configured", "service_off"];
4
+ export declare const PUBLIC_CODES: readonly ["approval_pending", "key_disabled", "key_stopped", "consent_missing", "data_consent_mismatch", "data_consent_needed", "notice_first", "endpoint_unknown", "endpoint_disabled", "read_only", "not_relayed", "key_in_query", "secret_in_input", "invalid_body", "body_too_large", "answer_too_large", "answer_precision_unsafe", "answer_not_relayed", "request_text_too_long", "over_max_credits", "window_5h", "window_week", "over_week", "free_limited", "free_needs_email", "free_not_granted", "global_cap", "flovia_paused", "rate_limited", "too_many_in_parallel", "reservation_changed", "operation_conflict", "operation_pending", "relay_internal_error", "upstream_unknown", "cannot_summarize", "upstream_unavailable", "page_tls_invalid", "page_unreachable", "replay_response_unavailable", "rpc_error", "unknown_lookup", "invalid_cursor", "since_too_old", "since_in_future", "feedback_too_long", "feedback_limit", "not_configured", "service_off"];
5
5
  export type FloviaCode = (typeof PUBLIC_CODES)[number] | `http_${number}`;
6
6
  /** Whether the request ran upstream: "unknown" means keep the same operation_id and never send a replacement. */
7
7
  export type Executed = "yes" | "no" | "unknown";
package/dist/types.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /** The relay's tool contract this SDK was written against (flovia_status.contract_version). */
2
- export const EXPECTED_CONTRACT_VERSION = "2026-10-07.147";
2
+ export const EXPECTED_CONTRACT_VERSION = "2026-10-07.151";
3
3
  /** Every public explanation.code (the relay's contract). A provider's own HTTP error is `http_<status>`. */
4
4
  export const PUBLIC_CODES = [
5
5
  "approval_pending", "key_disabled", "key_stopped", "consent_missing", "data_consent_mismatch", "data_consent_needed", "notice_first",
@@ -7,6 +7,6 @@ export const PUBLIC_CODES = [
7
7
  "answer_too_large", "answer_precision_unsafe", "answer_not_relayed", "request_text_too_long",
8
8
  "over_max_credits", "window_5h", "window_week", "over_week", "free_limited", "free_needs_email", "free_not_granted", "global_cap",
9
9
  "flovia_paused", "rate_limited", "too_many_in_parallel", "reservation_changed",
10
- "operation_conflict", "operation_pending", "upstream_unknown", "cannot_summarize", "upstream_unavailable", "page_tls_invalid", "page_unreachable", "replay_response_unavailable", "rpc_error",
10
+ "operation_conflict", "operation_pending", "relay_internal_error", "upstream_unknown", "cannot_summarize", "upstream_unavailable", "page_tls_invalid", "page_unreachable", "replay_response_unavailable", "rpc_error",
11
11
  "unknown_lookup", "invalid_cursor", "since_too_old", "since_in_future", "feedback_too_long", "feedback_limit", "not_configured", "service_off",
12
12
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flovialabs/sdk",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "type": "module",
5
5
  "description": "TypeScript client and CLI for Flovia: MCP tools over HTTP and OpenAI-compatible generation. Zero dependencies.",
6
6
  "license": "MIT",