@flovialabs/sdk 0.1.18 → 0.1.20
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 +32 -0
- package/README.md +17 -5
- package/dist/cli.js +65 -3
- package/dist/client.d.ts +21 -2
- package/dist/client.js +76 -3
- package/dist/types.d.ts +23 -2
- package/dist/types.js +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.20 (2026-11-06)
|
|
4
|
+
|
|
5
|
+
- Docs: the `retryRateLimited` option and the README "Retries" section said generations are never resent. Only `client.generate()` and `flovia_runway` are never resent; generation tools called through `client.call()` can be resent once after a refusal with `executed: "no"` (same operation ID, nothing ran or was charged). Behaviour is unchanged.
|
|
6
|
+
- CLI: `flovia generate --op` with a malformed id (not 8-128 of A-Z a-z 0-9 _ . : -) is now a usage error (exit 2), refused before the allowance notice and the confirmation. It used to exit 1 as if Flovia had refused it; nothing was sent either way.
|
|
7
|
+
- `client.keyCaps()`, `client.setKeyCaps()` and `flovia key-caps [set <key-id> --day <usd|none> --month <usd|none>]` read or set each API key's own daily (UTC day) and monthly (UTC month) spending cap in US dollars (#2638). A cap counts only what the key spends from the purchased balance and plan credit; calls the free allowance pays for are never capped. A call over its key's cap is refused with `key_cap_reached`; nothing is sent or charged, and other keys and sign-ins keep working. Setting caps needs a key that allows all services. `flovia status` shows capped keys when the relay reports them. A cap must be whole cents from $0 to $1,000,000; any other value is refused before anything is sent.
|
|
8
|
+
- A refused account request (`spendMode`, `acceptConsent`, banked resets) now keeps the relay's `explanation.next_step` as `nextStep`, and the CLI prints it. It used to be dropped, for example for `account_key_required`.
|
|
9
|
+
- Expect contract `2026-10-07.198`. Reply changes since `.182` that the SDK passes through unchanged:
|
|
10
|
+
- New public refusal code `elevenlabs_terms_required` (`.198`): new ElevenLabs speech generation needs the account owner to accept ElevenLabs' business-use terms in Console first. Nothing is sent or charged; never accept on the user's behalf or retry automatically. Replays of existing results are unchanged.
|
|
11
|
+
- `flovia_firecrawl`'s input schema in tools/list is split by `action` (`oneOf`, `.197`): `scrape` (the default when `action` is left out) lists `url` as required, and `list` needs no `url`. What the relay accepts and refuses is unchanged. `flovia tools flovia_firecrawl` builds its example from the `scrape` option.
|
|
12
|
+
- `flovia_firecrawl` scrape and `flovia_contextdev` reads no longer need `operation_id` (`.196`). Without one, the relay makes a new one for that call, so a repeat is a new lookup; send your own `operation_id` to reopen a call for free. Other tools are unchanged.
|
|
13
|
+
- A context.dev page that cannot be read is refused as `answer_not_relayed`, and a QuickNode reply that carries an upstream JSON-RPC error is refused as `rpc_error` (`.195`). Both used to come back as `upstream_unavailable`; accounting is unchanged.
|
|
14
|
+
- HyperEVM state reads at a selector other than `latest` add a note: `block` is the requested selector, not independently verified historical state (`.194`). The request and accounting are unchanged; this does not establish that the node ignored the selector.
|
|
15
|
+
- QuickNode `eth_getLogs` results that are too large come back as whole log entries with `result_count`, `result_total` and `last_block` when at least one entry fits. Follow the returned note: start from `last_block + 1` when every log of the last block is included; start from `last_block` and drop repeated logs when the cut is inside that block. If one block alone is too large, narrow the address or topics instead of repeating the same range.
|
|
16
|
+
- `usage_today.by_endpoint` also lists text generations and Runway jobs; `count` stays lookups only. `flovia usage` leaves generation rows out of the lookups table and prints separate Gemini, MiniMax and Runway summary lines. Per-row dollar amounts are rounded up, so use the reply's total instead of summing rows.
|
|
17
|
+
- Zerion positions and DeFi positions with `page_size` return the top entries by value and report `items_omitted`. Without `page_size` they return everything; transactions still default to 10.
|
|
18
|
+
- context.dev pages that cannot be read settle at 0 with `not_relayed_reason: "page_unreadable"`.
|
|
19
|
+
- `flovia_search` is available on the hosted relay.
|
|
20
|
+
- New MCP tool `flovia_quote` (`.190`): the most one data-tool call with the same arguments can charge, without sending or charging anything. Accounts without an active plan see the call's share of their free windows; plan members see whether plan credit can cover it. US dollar amounts appear only outside free-only mode, for accounts with a purchased balance or eligible plan credit.
|
|
21
|
+
- `flovia_gemini` replies carry `status` and `incomplete_details` (`.193`), like `flovia_openai` and `flovia_minimax`: `status: "incomplete"` with `incomplete_details.reason` (for example `max_output_tokens`) means the answer was cut off.
|
|
22
|
+
- `client.spendMode()` and `flovia spend-mode [free-only | allow-paid]` read or set the account's spend mode (#2738). In free-only mode, calls never use the purchased balance or plan credit. When the free allowance cannot cover a call, Flovia refuses it with `free_only_exhausted`, sends nothing and charges nothing. Setting the mode needs a key that allows all services. `flovia status` shows the mode when the relay reports it.
|
|
23
|
+
- CLI: a value-taking option followed by another option of the same command (for example `flovia usage --since --json`) is now a usage error (exit 2) and sends nothing. It used to take the second option as the value. A value that really starts with `--` can still be passed as `--name=--value`.
|
|
24
|
+
- `baseUrl` / `--base-url` with a query (`?`) or fragment (`#`) is now refused before anything is sent (`invalid_base_url`). The request path used to be appended after the query.
|
|
25
|
+
|
|
26
|
+
## 0.1.19
|
|
27
|
+
|
|
28
|
+
- Expect contract `2026-10-07.182`. context.dev input refusals include a fixed `refusal_detail` or `url_problem` and a matching correction hint. URL privacy restrictions remain unchanged.
|
|
29
|
+
- Contract `2026-10-07.181`: MiniMax generation replies include `lookup_id: "minimax:<generation_id>"`. An `operation_conflict` names the original `generation_id` and explains how to reopen it for free; do not generate again with a new operation ID without the user's decision.
|
|
30
|
+
|
|
31
|
+
- 次版の想定契約を`2026-10-07.180`に更新。`flovia_status`の`fal`欄に、今日のジョブ数・状態別件数と購入残高から精算した額を追加する。plan credit・無料枠・未精算の予約は購入分に含めない。
|
|
32
|
+
- 次版の想定契約を`2026-10-07.179`に更新。`flovia_endpoints`の返答に、Nansenの終了chainの日付・対象・状態を示す`chain_retirements`欄を追加した契約に合わせる。
|
|
33
|
+
- `timeoutMs` must be more than 0 and at most 2147483647 ms, and `--timeout` at most 2147483 seconds (about 24.8 days). Longer values used to overflow Node's timer, so every request timed out after about 1 ms and was reported as `timeout` with `executed: "unknown"`. They are now refused before anything is sent (`invalid_timeout`, or a usage error in the CLI).
|
|
34
|
+
|
|
3
35
|
## 0.1.18
|
|
4
36
|
|
|
5
37
|
- `flovia doctor [--client <name>] [--network]` checks, read-only, the Flovia entry in each client's personal settings: its URL, sign-in or key mode, and whether the key file is readable or the environment variable is set. It never writes, runs a client/helper or prints a key. Only the exact installer helper for the selected key path is checked; unknown helpers and unsafe environment references require manual inspection without key reads or network calls for that entry. A sign-in entry gets that client's command to sign in again after a revoked or expired sign-in. `--network` checks `/mcp` and accepts only Flovia-format keys for `flovia_status`; fetch and reply reading share the existing timeout. The exit code is 1 when a check fails. TOML/YAML inspection covers limited line-based forms, not a full parser.
|
package/README.md
CHANGED
|
@@ -10,9 +10,17 @@ 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
|
+
npm install --save-exact @flovialabs/sdk@0.1.20
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
+
## 0.1.20 release notes
|
|
17
|
+
|
|
18
|
+
This release expects contract `2026-10-07.198`. It adds `client.spendMode()` / `flovia spend-mode` for free-only mode and `client.keyCaps()` / `client.setKeyCaps()` / `flovia key-caps` for per-key daily and monthly spending caps. Relay replies since `.182` add the `flovia_quote` tool, Gemini `status` / `incomplete_details`, whole-entry QuickNode log results, generation rows in usage breakdowns, Firecrawl and context.dev reads without an `operation_id`, and the `elevenlabs_terms_required` refusal. The CLI now refuses malformed operation ids, a missing option value, and a base URL with a query or fragment before sending anything. Provider availability follows the Relay's current configuration.
|
|
19
|
+
|
|
20
|
+
## 0.1.19 release notes
|
|
21
|
+
|
|
22
|
+
This release expects contract `2026-10-07.182`, whose Relay replies include context.dev input-refusal details, MiniMax lookup IDs and conflict-recovery guidance, Nansen chain-retirement notices, and fal job counts with settled purchased-balance spend. The SDK also refuses timeout values that would overflow Node's timer before sending a request. Provider availability follows the Relay's current configuration.
|
|
23
|
+
|
|
16
24
|
## 0.1.18 release notes
|
|
17
25
|
|
|
18
26
|
This release expects contract `2026-10-07.178`. It adds `flovia install --client` and the read-only `flovia doctor` command, lists up to 30 days of your usage history, and exports optional `ForUser` / `ReplyCharge` types for replies that include charge information. A missing charge is not zero. Replay and job snapshots must not be added as new calls. Earlier releases remain unchanged.
|
|
@@ -246,13 +254,13 @@ Do not answer these automatically from code or from an agent.
|
|
|
246
254
|
|
|
247
255
|
## Retries
|
|
248
256
|
|
|
249
|
-
-
|
|
250
|
-
- With `new FloviaClient({ retryRateLimited: true })`, a tool call refused with `rate_limited`, `too_many_in_parallel` or `reservation_changed` and `executed: "no"` is resent once, unchanged, after `retry_after_seconds` (at least 1 s, at most 60 s). Off by default.
|
|
257
|
+
- `client.generate()` (the HTTP generation route) is never resent automatically.
|
|
258
|
+
- With `new FloviaClient({ retryRateLimited: true })`, a tool call refused with `rate_limited`, `too_many_in_parallel` or `reservation_changed` and `executed: "no"` is resent once, unchanged (same `operation_id`), after `retry_after_seconds` (at least 1 s, at most 60 s). Off by default. This covers generation tools called through `client.call()` (`flovia_openai`, `flovia_gemini`, `flovia_minimax`, `flovia_fal`) too: such a refusal means nothing ran and nothing was charged. `flovia_runway` is never resent.
|
|
251
259
|
- Anything with `executed: "unknown"` is not resent.
|
|
252
260
|
|
|
253
261
|
## Timeouts
|
|
254
262
|
|
|
255
|
-
Each request times out after 300 seconds by default (a long generation can take minutes). Change it with `timeoutMs
|
|
263
|
+
Each request times out after 300 seconds by default (a long generation can take minutes). Change it with `timeoutMs` (more than 0, at most 2147483647 ms; `--timeout` at most 2147483 seconds). A timeout throws `FloviaError` with code `timeout` and `executed: "unknown"`.
|
|
256
264
|
|
|
257
265
|
A lost or unreadable reply is also `executed: "unknown"`, even after HTTP 200. Keep the saved operation ID and request; do not start another operation to recover the answer. A retired operation is never treated as proof that nothing ran.
|
|
258
266
|
|
|
@@ -279,11 +287,15 @@ npx flovia resets # saved resets and both free windows (read-
|
|
|
279
287
|
npx flovia resets use 42 --yes # use saved reset 42 (cannot be undone)
|
|
280
288
|
npx flovia consent # current notice version, your yes and the notice text (read-only)
|
|
281
289
|
npx flovia consent accept relay-consent-19 --yes # your own yes to the version just shown (same as Console)
|
|
290
|
+
npx flovia key-caps # each key's daily and monthly spending cap and use (read-only; unreleased)
|
|
291
|
+
npx flovia key-caps set <key-id> --day 5 --month none # cap one key; a call over it is refused, nothing charged (unreleased; see CHANGELOG)
|
|
292
|
+
npx flovia spend-mode # free-only or allow-paid (read-only; unreleased)
|
|
293
|
+
npx flovia spend-mode free-only # never use the purchased balance or plan credit (unreleased; see CHANGELOG)
|
|
282
294
|
npx flovia agents-md # a short note for CLAUDE.md or AGENTS.md
|
|
283
295
|
npx flovia help
|
|
284
296
|
npx flovia --version
|
|
285
297
|
```
|
|
286
|
-
These commands run after installing `@flovialabs/sdk` in the current project. Without a local installation, specify the package: `npx --package=@flovialabs/sdk@0.1.
|
|
298
|
+
These commands run after installing `@flovialabs/sdk` in the current project. Without a local installation, specify the package: `npx --package=@flovialabs/sdk@0.1.20 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.
|
|
287
299
|
|
|
288
300
|
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.
|
|
289
301
|
|
package/dist/cli.js
CHANGED
|
@@ -10,6 +10,7 @@ import { dirname } from "node:path";
|
|
|
10
10
|
import { createInterface } from "node:readline/promises";
|
|
11
11
|
import { fileURLToPath } from "node:url";
|
|
12
12
|
import { FloviaClient, FloviaError, newOperationId } from "./index.js";
|
|
13
|
+
import { OPERATION_ID } from "./client.js";
|
|
13
14
|
import { INSTALL_AUTH, INSTALL_CLIENTS, InstallRefusal, mergeJson, mergeYaml, planInstall } from "./install.js";
|
|
14
15
|
import { inspect, renderDoctor, settingsPath, settle } from "./doctor.js";
|
|
15
16
|
/** Exclusive creation: a failed write may leave a private partial file, never overwrite or delete an existing path. */
|
|
@@ -35,6 +36,8 @@ const COMMANDS = {
|
|
|
35
36
|
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 } },
|
|
36
37
|
resets: { usage: "resets [use <id> --yes]", about: "check saved resets (read-only), or use one to restart both free windows", flags: { "--yes": false } },
|
|
37
38
|
consent: { usage: "consent [accept <version> --yes]", about: "read Flovia's current notice and your answer, or record your own yes to it", flags: { "--yes": false } },
|
|
39
|
+
"key-caps": { usage: "key-caps [set <key-id> --day <usd|none> --month <usd|none>]", about: "read or set each API key's own daily and monthly spending cap", flags: { "--day": true, "--month": true } },
|
|
40
|
+
"spend-mode": { usage: "spend-mode [free-only | allow-paid]", about: "read or set whether calls may spend purchased or plan credit", flags: {} },
|
|
38
41
|
install: { usage: "install --client NAME [--auth oauth|key] [--dry-run] [--force]", about: "add Flovia to one client's settings; never writes the key", flags: { "--client": true, "--auth": true, "--dry-run": false, "--force": false } },
|
|
39
42
|
doctor: { usage: "doctor [--client NAME] [--network]", about: "check clients' Flovia settings (read-only; never prints the key)", flags: { "--client": true, "--network": false } },
|
|
40
43
|
"agents-md": { usage: "agents-md", about: "a short Flovia note to paste into CLAUDE.md or AGENTS.md (no network)", flags: {} },
|
|
@@ -87,7 +90,9 @@ function placeholder(name, s) {
|
|
|
87
90
|
}
|
|
88
91
|
/** Required properties plus Exa/Firecrawl's default-operation inputs, which are conditional in the schema. */
|
|
89
92
|
export function exampleCall(tool, schema) {
|
|
90
|
-
|
|
93
|
+
// A schema split by action (oneOf, e.g. flovia_firecrawl, #2617): the example uses the option whose action is the default.
|
|
94
|
+
const top = obj(schema), options = Array.isArray(top["oneOf"]) ? top["oneOf"].map(obj) : [];
|
|
95
|
+
const s = options.find((o) => obj(obj(o["properties"])["action"])["default"] !== undefined) ?? options[0] ?? top, props = obj(s["properties"]), required = Array.isArray(s["required"]) ? s["required"].map(String) : [];
|
|
91
96
|
const defaults = tool === "flovia_exa" ? ["action", "query", "operation_id"] : tool === "flovia_firecrawl" ? ["action", "url", "operation_id"] : [];
|
|
92
97
|
const fields = [...new Set([...required, ...defaults.filter((k) => Object.hasOwn(props, k))])];
|
|
93
98
|
const args = Object.fromEntries(fields.map((k) => [k, placeholder(k, obj(props[k]))]));
|
|
@@ -154,7 +159,9 @@ export function parse(argv) {
|
|
|
154
159
|
continue;
|
|
155
160
|
}
|
|
156
161
|
const value = eq > 0 ? a.slice(eq + 1) : rest[++i];
|
|
157
|
-
|
|
162
|
+
// The next word is another option of this command, not a value (`--since --json`); `--name=--x` still passes a literal value.
|
|
163
|
+
const next = eq > 0 || value === undefined ? undefined : value.slice(0, value.indexOf("=") > 0 ? value.indexOf("=") : undefined);
|
|
164
|
+
if (value === undefined || (next !== undefined && next.startsWith("-") && Object.hasOwn(known, next)))
|
|
158
165
|
throw new Usage(`${command}: ${name} needs a value. Usage: flovia ${spec.usage}`);
|
|
159
166
|
flags.set(name, value);
|
|
160
167
|
}
|
|
@@ -247,6 +254,12 @@ export function renderStatus(s, expected, now = Date.now()) {
|
|
|
247
254
|
for (const [name, w] of [["free 5-hour", s.five_hour], ["free week", s.week]])
|
|
248
255
|
lines.push(`${label(name)}${pct(w?.used_pct)} used${w?.resets_at ? `, resets ${when(w.resets_at, now)}` : name === "free 5-hour" ? ", not started" : ""}`);
|
|
249
256
|
lines.push(`${label("purchased balance")}${String(s["purchased_balance_display"] ?? "-")}`);
|
|
257
|
+
// An older relay, or an account with no capped key, omits api_key_caps; nothing is shown then.
|
|
258
|
+
for (const c of Array.isArray(s["api_key_caps"]) ? s["api_key_caps"] : [])
|
|
259
|
+
lines.push(`${label(`key cap${c["this_key"] === true ? " (this key)" : ""}`)}${String(c["name"])}: today $${String(c["day_used_usd"])} of ${c["day_cap_usd"] === null ? "none" : `$${String(c["day_cap_usd"])}`}, month $${String(c["month_used_usd"])} of ${c["month_cap_usd"] === null ? "none" : `$${String(c["month_cap_usd"])}`}`);
|
|
260
|
+
// An older relay omits spend_mode; nothing is shown then.
|
|
261
|
+
if (typeof s["spend_mode"] === "string")
|
|
262
|
+
lines.push(`${label("spend mode")}${String(s["spend_mode"]).startsWith("free_only") ? "free-only (purchased balance and plan credit are never used)" : "allow-paid"}`);
|
|
250
263
|
// An older relay omits banked_resets; nothing is shown then.
|
|
251
264
|
const banked = obj(s["banked_resets"]), n = banked["available"];
|
|
252
265
|
if (typeof n === "number" && n > 0)
|
|
@@ -276,12 +289,25 @@ export function renderUsage(u, today = false, now = Date.now()) {
|
|
|
276
289
|
const bySource = new Map();
|
|
277
290
|
for (const e of Array.isArray(u["by_endpoint"]) ? u["by_endpoint"] : []) {
|
|
278
291
|
const x = obj(e), name = String(x["provider"]);
|
|
292
|
+
if (x["endpoint"] === "generation")
|
|
293
|
+
continue; // generations are listed below, not as lookups (#2824)
|
|
279
294
|
bySource.set(name, (bySource.get(name) ?? 0) + Number(x["count"] ?? 0));
|
|
280
295
|
}
|
|
281
296
|
if (bySource.size)
|
|
282
297
|
lines.push("", table([["source", "lookups"], ...[...bySource].map(([n, count]) => [n, String(count)])]).trimEnd());
|
|
283
298
|
const g = obj(u["generations"]);
|
|
284
299
|
lines.push("", `generations: ${String(g["operations"] ?? 0)} (completed ${String(g["completed"] ?? 0)}, incomplete ${String(g["incomplete"] ?? 0)}, unknown ${String(g["unknown"] ?? 0)}), ${String(g["free_display"] ?? "-")} of the weekly free allowance, purchased ${String(g["bought_display"] ?? "-")} (included in total)`);
|
|
300
|
+
for (const [field, name, states] of [
|
|
301
|
+
["gemini_generations", "Gemini text generations", ["completed", "incomplete", "unknown"]],
|
|
302
|
+
["minimax_generations", "MiniMax text generations", ["completed", "incomplete", "unknown"]],
|
|
303
|
+
["runway_generations", "Runway jobs", ["completed", "failed", "unknown", "reserved", "submitted"]],
|
|
304
|
+
]) {
|
|
305
|
+
if (u[field] === undefined || u[field] === null)
|
|
306
|
+
continue;
|
|
307
|
+
const summary = obj(u[field]);
|
|
308
|
+
const counts = states.map(state => `${state} ${String(summary[state] ?? "-")}`).join(", ");
|
|
309
|
+
lines.push("", `${name}: ${String(summary["operations"] ?? "-")} (${counts}), ${String(summary["free_display"] ?? "-")} of the weekly free allowance, purchased ${String(summary["bought_display"] ?? "-")} (included in total)`);
|
|
310
|
+
}
|
|
285
311
|
if (u.has_more)
|
|
286
312
|
lines.push("", `more lookups: rerun flovia usage with the same --key-file and --base-url options, adding --since ${String(u["since"])} --cursor ${String(u.next_cursor)}`);
|
|
287
313
|
return lines.join("\n") + "\n";
|
|
@@ -385,7 +411,8 @@ export async function run(argv, io) {
|
|
|
385
411
|
let recoveryLimit;
|
|
386
412
|
let recoveryEffort;
|
|
387
413
|
try {
|
|
388
|
-
|
|
414
|
+
// Seconds; the SDK's longest timer is 2^31 - 1 ms, so the CLI stops at 2147483 s.
|
|
415
|
+
const timeout = positiveInt("--timeout", str(p.flags.get("--timeout")), 2_147_483);
|
|
389
416
|
const baseUrl = str(p.flags.get("--base-url"));
|
|
390
417
|
// The key is read only after the command's own arguments are checked, so a usage mistake shows the usage line first.
|
|
391
418
|
const connect = async () => {
|
|
@@ -483,6 +510,38 @@ export async function run(argv, io) {
|
|
|
483
510
|
out(a.outcome === "recorded" ? `Recorded: yes to ${a.version}.\n` : `Already answered yes to ${a.version}; nothing changed.\n`);
|
|
484
511
|
return 0;
|
|
485
512
|
}
|
|
513
|
+
case "key-caps": {
|
|
514
|
+
const [action, id, extra] = p.positional, cap = (v) => v === "none" ? null : v !== undefined && /^\d{1,7}(\.\d{1,2})?$/.test(v) && Number(v) <= 1_000_000 ? Number(v) : undefined;
|
|
515
|
+
const day = cap(str(p.flags.get("--day"))), month = cap(str(p.flags.get("--month")));
|
|
516
|
+
if (action === undefined ? p.flags.has("--day") || p.flags.has("--month")
|
|
517
|
+
: action !== "set" || id === undefined || !/^[0-9a-f]{32}$/.test(id) || extra !== undefined || day === undefined || month === undefined)
|
|
518
|
+
throw new Usage("Usage: flovia key-caps [set <key-id> --day <usd|none> --month <usd|none>] (the key id from flovia key-caps)");
|
|
519
|
+
const client = await connect(), r = action === undefined ? await waitFor(() => client.keyCaps())
|
|
520
|
+
: await waitFor(() => client.setKeyCaps(id, { day_usd: day, month_usd: month }));
|
|
521
|
+
if (json) {
|
|
522
|
+
print(r);
|
|
523
|
+
return 0;
|
|
524
|
+
}
|
|
525
|
+
if ("outcome" in r)
|
|
526
|
+
out(r.outcome === "set" ? "Set. A call over its key's cap is refused; nothing is sent or charged.\n" : "No active key with that id; nothing changed.\n");
|
|
527
|
+
const usd = (v) => v === null ? "none" : `$${v}`;
|
|
528
|
+
for (const k of r.keys)
|
|
529
|
+
out(`${k.id} ${k.name}${k.last_four ? ` (…${k.last_four})` : ""}${k.current ? " [this key]" : ""}\n services: ${k.services === "all" ? "all" : k.services.join(", ")}\n`
|
|
530
|
+
+ ` today (UTC): $${k.day_used_usd} of ${usd(k.day_cap_usd)}; this month: $${k.month_used_usd} of ${usd(k.month_cap_usd)}\n`);
|
|
531
|
+
return "outcome" in r && r.outcome !== "set" ? 1 : 0;
|
|
532
|
+
}
|
|
533
|
+
case "spend-mode": {
|
|
534
|
+
const [arg, extra] = p.positional, mode = arg === undefined ? undefined : arg === "free-only" ? "free_only" : arg === "allow-paid" ? "allow_paid" : null;
|
|
535
|
+
if (mode === null || extra !== undefined)
|
|
536
|
+
throw new Usage("Usage: flovia spend-mode [free-only | allow-paid]");
|
|
537
|
+
const client = await connect(), m = await waitFor(() => client.spendMode(mode));
|
|
538
|
+
if (json)
|
|
539
|
+
print({ mode: m });
|
|
540
|
+
else
|
|
541
|
+
out(m === "free_only" ? "spend mode: free-only. Calls use only the free allowance; past it they are refused and nothing is charged.\n"
|
|
542
|
+
: "spend mode: allow-paid. Past the free allowance, plan credit or the purchased balance pays.\n");
|
|
543
|
+
return 0;
|
|
544
|
+
}
|
|
486
545
|
case "usage": {
|
|
487
546
|
const since = str(p.flags.get("--since")), days = positiveInt("--days", str(p.flags.get("--days")), 30), cursor = str(p.flags.get("--cursor"));
|
|
488
547
|
if (since !== undefined && days !== undefined)
|
|
@@ -558,6 +617,9 @@ export async function run(argv, io) {
|
|
|
558
617
|
const op = str(p.flags.get("--op")), fresh = p.flags.has("--new-op");
|
|
559
618
|
if ((op === undefined) === !fresh)
|
|
560
619
|
throw new Usage("generate: pass --op ID (to resend, the same id) or --new-op (to make one); exactly one of them");
|
|
620
|
+
// Checked before the notice and the confirmation: the SDK would refuse it anyway, and nothing would be sent.
|
|
621
|
+
if (op !== undefined && !OPERATION_ID.test(op))
|
|
622
|
+
throw new Usage("generate: --op must be 8-128 of A-Z a-z 0-9 _ . : - (the id you saved, or use --new-op)");
|
|
561
623
|
const [text, extra] = p.positional;
|
|
562
624
|
if (text === undefined || extra !== undefined)
|
|
563
625
|
throw new Usage(`Usage: flovia ${COMMANDS["generate"]?.usage}`);
|
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Generation, type GenerationRequest, type StatusReply, type ToolReply, type UsageTodayArgs, type UsageTodayReply, type BankedResets, type BankedResetUse, type ConsentState, type ConsentAccept } from "./types.js";
|
|
1
|
+
import { type Generation, type GenerationRequest, type StatusReply, type ToolReply, type UsageTodayArgs, type UsageTodayReply, type BankedResets, type BankedResetUse, type ConsentState, type ConsentAccept, type KeyCaps, type KeyCapsSet, type SpendMode } from "./types.js";
|
|
2
2
|
export interface FloviaClientOptions {
|
|
3
3
|
/** A Flovia key (flv_...). Defaults to the FLOVIA_KEY environment variable. Never logged. */
|
|
4
4
|
apiKey?: string;
|
|
@@ -11,7 +11,9 @@ export interface FloviaClientOptions {
|
|
|
11
11
|
fetch?: (request: Request) => Promise<Response>;
|
|
12
12
|
/**
|
|
13
13
|
* Resend a tool call once, unchanged (same operation_id), after rate_limited, too_many_in_parallel or reservation_changed with executed
|
|
14
|
-
* "no", when the wait is at most 60 s; it waits at least 1 s. Off by default.
|
|
14
|
+
* "no", when the wait is at most 60 s; it waits at least 1 s. Off by default. It applies to every call() tool except flovia_runway, so a
|
|
15
|
+
* refused generation tool (flovia_openai, flovia_gemini, flovia_minimax, flovia_fal) can be resent once: only after a refusal where nothing
|
|
16
|
+
* ran and nothing was charged. generate() (HTTP) is never resent automatically.
|
|
15
17
|
*/
|
|
16
18
|
retryRateLimited?: boolean;
|
|
17
19
|
/** Called once when flovia_status reports another contract version. Defaults to console.warn. */
|
|
@@ -22,6 +24,8 @@ export interface ToolInfo {
|
|
|
22
24
|
description?: string;
|
|
23
25
|
inputSchema: Record<string, unknown>;
|
|
24
26
|
}
|
|
27
|
+
/** The relay's operation_id shape: 8-128 of A-Z a-z 0-9 _ . : - */
|
|
28
|
+
export declare const OPERATION_ID: RegExp;
|
|
25
29
|
/** A new operation_id. Save it with the request before sending, so a lost reply can be reopened with the same id. */
|
|
26
30
|
export declare const newOperationId: () => string;
|
|
27
31
|
export declare class FloviaClient {
|
|
@@ -46,6 +50,21 @@ export declare class FloviaClient {
|
|
|
46
50
|
* never answer for them. An older version is refused and nothing is recorded; a repeat changes nothing.
|
|
47
51
|
*/
|
|
48
52
|
acceptConsent(version: string): Promise<ConsentAccept>;
|
|
53
|
+
/** Each active key's own daily and monthly spending cap and its use (US dollars), and its services. Read-only. */
|
|
54
|
+
keyCaps(): Promise<KeyCaps>;
|
|
55
|
+
/**
|
|
56
|
+
* Set one key's daily (UTC day) and monthly (UTC month) caps in US dollars, both at once; null removes one. A call over its key's cap is
|
|
57
|
+
* refused (key_cap_reached) and nothing is sent or charged. Needs a key that allows all services. Setting caps is the account owner's own step.
|
|
58
|
+
*/
|
|
59
|
+
setKeyCaps(keyId: string, caps: {
|
|
60
|
+
day_usd: number | null;
|
|
61
|
+
month_usd: number | null;
|
|
62
|
+
}): Promise<KeyCapsSet>;
|
|
63
|
+
/**
|
|
64
|
+
* The account's spend mode, or set it (mode given): free_only never spends the purchased balance or plan credit; past the free use a call
|
|
65
|
+
* is refused (free_only_exhausted) and nothing is sent or charged. Setting it is the account owner's own step; an agent must never set it for them.
|
|
66
|
+
*/
|
|
67
|
+
spendMode(mode?: SpendMode): Promise<SpendMode>;
|
|
49
68
|
/** tools/list: the tools this key is offered, with their input schemas. */
|
|
50
69
|
listTools(): Promise<ToolInfo[]>;
|
|
51
70
|
/** 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
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { FloviaError } from "./errors.js";
|
|
2
2
|
import { EXPECTED_CONTRACT_VERSION } from "./types.js";
|
|
3
3
|
/** The relay's operation_id shape: 8-128 of A-Z a-z 0-9 _ . : - */
|
|
4
|
-
const OPERATION_ID = /^[A-Za-z0-9_.:-]{8,128}$/;
|
|
4
|
+
export const OPERATION_ID = /^[A-Za-z0-9_.:-]{8,128}$/;
|
|
5
5
|
const RESEND_CODES = new Set(["rate_limited", "too_many_in_parallel", "reservation_changed"]);
|
|
6
6
|
const MAX_RESEND_WAIT_S = 60;
|
|
7
|
+
/** The longest timer delay Node accepts (2^31 - 1 ms). */
|
|
8
|
+
const MAX_TIMEOUT_MS = 2_147_483_647;
|
|
7
9
|
/** A new operation_id. Save it with the request before sending, so a lost reply can be reopened with the same id. */
|
|
8
10
|
export const newOperationId = () => `op_${crypto.randomUUID()}`;
|
|
9
11
|
const envKey = () => globalThis.process?.env?.["FLOVIA_KEY"];
|
|
@@ -30,6 +32,11 @@ async function readReply(r, operationId, makeError, sse = false) {
|
|
|
30
32
|
message: timeout ? "Timed out while reading the reply." : `Unexpected reply (HTTP ${r.status}).`, nextStep: operationId ? SAME_OPERATION : null });
|
|
31
33
|
}
|
|
32
34
|
}
|
|
35
|
+
/** The relay's own next step on a refused account request (explanation.next_step), when it sent one. */
|
|
36
|
+
const relayNextStep = (body) => {
|
|
37
|
+
const e = body["explanation"];
|
|
38
|
+
return e !== null && typeof e === "object" && !Array.isArray(e) && typeof e.next_step === "string" ? e.next_step : null;
|
|
39
|
+
};
|
|
33
40
|
export class FloviaClient {
|
|
34
41
|
#key;
|
|
35
42
|
#base;
|
|
@@ -56,11 +63,18 @@ export class FloviaClient {
|
|
|
56
63
|
const local = ["localhost", "127.0.0.1", "[::1]"].includes(url.hostname);
|
|
57
64
|
if (url.protocol !== "https:" && !(url.protocol === "http:" && local))
|
|
58
65
|
throw new FloviaError({ code: "invalid_base_url", executed: "no", message: "baseUrl / --base-url must be https (plain http only for localhost, 127.0.0.1 or [::1])." });
|
|
66
|
+
// A query or fragment would sit before the request path ("…?x=1/mcp"), so it is refused rather than guessed at.
|
|
67
|
+
if (url.search || url.hash || /[?#]/.test(base))
|
|
68
|
+
throw new FloviaError({ code: "invalid_base_url", executed: "no", message: "baseUrl / --base-url must not contain a query (?) or fragment (#)." });
|
|
59
69
|
this.#base = base.replace(/\/+$/, "");
|
|
60
70
|
if (options.accessToken && (url.origin !== "https://dev.api.flovia.dev" || url.username || url.password))
|
|
61
71
|
throw new FloviaError({ code: "invalid_base_url", executed: "no", message: "accessToken requires https://dev.api.flovia.dev." });
|
|
62
72
|
this.#accessToken = options.accessToken;
|
|
63
|
-
|
|
73
|
+
const timeoutMs = options.timeoutMs ?? 300_000;
|
|
74
|
+
// Node's timers hold a signed 32-bit delay; a longer AbortSignal.timeout fires after 1 ms and would abort every request at once.
|
|
75
|
+
if (!Number.isInteger(timeoutMs) || timeoutMs <= 0 || timeoutMs > MAX_TIMEOUT_MS)
|
|
76
|
+
throw new FloviaError({ code: "invalid_timeout", executed: "no", message: `timeoutMs must be a whole number from 1 to ${MAX_TIMEOUT_MS} ms (about 24.8 days).` });
|
|
77
|
+
this.#timeoutMs = timeoutMs;
|
|
64
78
|
this.#fetch = options.fetch ?? ((r) => fetch(r));
|
|
65
79
|
this.#resend = options.retryRateLimited ?? false;
|
|
66
80
|
// eslint-disable-next-line no-console -- versions only, never the key
|
|
@@ -225,6 +239,65 @@ export class FloviaClient {
|
|
|
225
239
|
throw this.#error({ code: "invalid_reply", status: r.status, executed: "unknown", message: "The consent reply was not in the expected form.", nextStep: check });
|
|
226
240
|
return { outcome: body["outcome"], version: body.version, answered_version: body.answered_version, needed: body.needed, updated: body.updated, notice: body.notice };
|
|
227
241
|
}
|
|
242
|
+
/** Each active key's own daily and monthly spending cap and its use (US dollars), and its services. Read-only. */
|
|
243
|
+
async keyCaps() {
|
|
244
|
+
const r = await this.#send("/account/key-caps", null, {}, null, "GET");
|
|
245
|
+
const body = await this.#account(r, null);
|
|
246
|
+
if (!Array.isArray(body["keys"]))
|
|
247
|
+
throw this.#error({ code: "invalid_reply", status: r.status, executed: "no", message: "The key-caps reply was not in the expected form.", nextStep: null });
|
|
248
|
+
return { keys: body["keys"] };
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Set one key's daily (UTC day) and monthly (UTC month) caps in US dollars, both at once; null removes one. A call over its key's cap is
|
|
252
|
+
* refused (key_cap_reached) and nothing is sent or charged. Needs a key that allows all services. Setting caps is the account owner's own step.
|
|
253
|
+
*/
|
|
254
|
+
async setKeyCaps(keyId, caps) {
|
|
255
|
+
// The relay's own rule: whole cents, $0 to $1,000,000.
|
|
256
|
+
const ok = (v) => v === null || (typeof v === "number" && Number.isFinite(v) && v >= 0 && v <= 1_000_000 && Math.abs(v * 100 - Math.round(v * 100)) < 1e-6);
|
|
257
|
+
if (typeof keyId !== "string" || !/^[0-9a-f]{32}$/.test(keyId) || !ok(caps?.day_usd) || !ok(caps?.month_usd))
|
|
258
|
+
throw new FloviaError({ code: "invalid_request", executed: "no", message: "Pass a key id from keyCaps() and day_usd and month_usd as US dollars or null." });
|
|
259
|
+
const check = "It may have changed. Run keyCaps() (flovia key-caps) to see the current caps.";
|
|
260
|
+
const unknown = (e) => this.#error({ code: e.code, status: e.status, executed: "unknown", message: e.message,
|
|
261
|
+
nextStep: e.nextStep && e.executed !== "unknown" ? `${check} ${e.nextStep}` : check });
|
|
262
|
+
let r;
|
|
263
|
+
try {
|
|
264
|
+
r = await this.#send("/account/key-caps", { key_id: keyId, day_usd: caps.day_usd, month_usd: caps.month_usd });
|
|
265
|
+
}
|
|
266
|
+
// The relay rechecks the key after the write, so a 401 does not prove that nothing changed.
|
|
267
|
+
catch (e) {
|
|
268
|
+
throw e instanceof FloviaError && (e.executed === "unknown" || e.status === 401) ? unknown(e) : e;
|
|
269
|
+
}
|
|
270
|
+
const body = await this.#account(r, check);
|
|
271
|
+
if (!Array.isArray(body["keys"]) || (body["outcome"] !== "set" && body["outcome"] !== "not_found"))
|
|
272
|
+
throw this.#error({ code: "invalid_reply", status: r.status, executed: "unknown", message: "The key-caps reply was not in the expected form.", nextStep: check });
|
|
273
|
+
return { outcome: body["outcome"], keys: body["keys"] };
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* The account's spend mode, or set it (mode given): free_only never spends the purchased balance or plan credit; past the free use a call
|
|
277
|
+
* is refused (free_only_exhausted) and nothing is sent or charged. Setting it is the account owner's own step; an agent must never set it for them.
|
|
278
|
+
*/
|
|
279
|
+
async spendMode(mode) {
|
|
280
|
+
if (mode !== undefined && mode !== "free_only" && mode !== "allow_paid")
|
|
281
|
+
throw new FloviaError({ code: "invalid_request", executed: "no", message: "mode must be free_only or allow_paid." });
|
|
282
|
+
const check = "It may have changed. Run spendMode() (flovia spend-mode) to see the current mode.";
|
|
283
|
+
const unknown = (e) => this.#error({ code: e.code, status: e.status, executed: "unknown", message: e.message,
|
|
284
|
+
nextStep: e.nextStep && e.executed !== "unknown" ? `${check} ${e.nextStep}` : check });
|
|
285
|
+
let r;
|
|
286
|
+
if (mode === undefined)
|
|
287
|
+
r = await this.#send("/account/spend-mode", null, {}, null, "GET");
|
|
288
|
+
// The relay rechecks the key after the write, so a 401 does not prove that nothing changed.
|
|
289
|
+
else
|
|
290
|
+
try {
|
|
291
|
+
r = await this.#send("/account/spend-mode", { mode });
|
|
292
|
+
}
|
|
293
|
+
catch (e) {
|
|
294
|
+
throw e instanceof FloviaError && (e.executed === "unknown" || e.status === 401) ? unknown(e) : e;
|
|
295
|
+
}
|
|
296
|
+
const body = await this.#account(r, mode === undefined ? null : check);
|
|
297
|
+
if (body["mode"] !== "free_only" && body["mode"] !== "allow_paid")
|
|
298
|
+
throw this.#error({ code: "invalid_reply", status: r.status, executed: mode === undefined ? "no" : "unknown", message: "The spend-mode reply was not in the expected form.", nextStep: mode === undefined ? null : check });
|
|
299
|
+
return body["mode"];
|
|
300
|
+
}
|
|
228
301
|
async #account(r, unknownStep) {
|
|
229
302
|
let body;
|
|
230
303
|
try {
|
|
@@ -236,7 +309,7 @@ export class FloviaClient {
|
|
|
236
309
|
if (r.status === 200)
|
|
237
310
|
return body;
|
|
238
311
|
throw this.#error({ code: typeof body["error"] === "string" ? body["error"] : `http_${r.status}`, status: r.status, executed: r.status >= 500 && unknownStep !== null ? "unknown" : "no",
|
|
239
|
-
message: typeof body["message"] === "string" ? body["message"] : `HTTP ${r.status}`, nextStep: r.status >= 500 ? unknownStep :
|
|
312
|
+
message: typeof body["message"] === "string" ? body["message"] : `HTTP ${r.status}`, nextStep: r.status >= 500 ? unknownStep : relayNextStep(body) });
|
|
240
313
|
}
|
|
241
314
|
/** tools/list: the tools this key is offered, with their input schemas. */
|
|
242
315
|
async listTools() {
|
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.
|
|
2
|
+
export declare const EXPECTED_CONTRACT_VERSION = "2026-10-07.198";
|
|
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", "provider_not_allowed", "account_key_required", "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_month", "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", "relay_internal_unknown", "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", "elevenlabs_terms_required", "provider_not_allowed", "account_key_required", "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_month", "window_week", "over_week", "free_only_exhausted", "key_cap_reached", "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", "relay_internal_unknown", "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";
|
|
@@ -128,3 +128,24 @@ export interface ConsentState {
|
|
|
128
128
|
export interface ConsentAccept extends ConsentState {
|
|
129
129
|
outcome: "recorded" | "unchanged";
|
|
130
130
|
}
|
|
131
|
+
/** One active key in GET /account/key-caps: its own daily (UTC day) and monthly (UTC month) cap and use, in US dollars (null cap: none). */
|
|
132
|
+
export interface KeyCap {
|
|
133
|
+
id: string;
|
|
134
|
+
name: string;
|
|
135
|
+
last_four: string | null;
|
|
136
|
+
current: boolean;
|
|
137
|
+
services: "all" | string[];
|
|
138
|
+
day_cap_usd: string | null;
|
|
139
|
+
day_used_usd: string;
|
|
140
|
+
month_cap_usd: string | null;
|
|
141
|
+
month_used_usd: string;
|
|
142
|
+
}
|
|
143
|
+
export interface KeyCaps {
|
|
144
|
+
keys: KeyCap[];
|
|
145
|
+
}
|
|
146
|
+
/** "set": both caps were written. "not_found": no active key with that id; nothing changed. */
|
|
147
|
+
export interface KeyCapsSet extends KeyCaps {
|
|
148
|
+
outcome: "set" | "not_found";
|
|
149
|
+
}
|
|
150
|
+
/** GET/POST /account/spend-mode: free_only never spends the purchased balance or plan credit. */
|
|
151
|
+
export type SpendMode = "free_only" | "allow_paid";
|
package/dist/types.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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.
|
|
2
|
+
export const EXPECTED_CONTRACT_VERSION = "2026-10-07.198";
|
|
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",
|
|
6
|
-
"provider_not_allowed", "account_key_required", "endpoint_unknown", "endpoint_disabled", "read_only", "not_relayed", "key_in_query", "secret_in_input", "invalid_body", "body_too_large",
|
|
6
|
+
"elevenlabs_terms_required", "provider_not_allowed", "account_key_required", "endpoint_unknown", "endpoint_disabled", "read_only", "not_relayed", "key_in_query", "secret_in_input", "invalid_body", "body_too_large",
|
|
7
7
|
"answer_too_large", "answer_precision_unsafe", "answer_not_relayed", "request_text_too_long",
|
|
8
|
-
"over_max_credits", "window_5h", "window_month", "window_week", "over_week", "free_limited", "free_needs_email", "free_not_granted", "global_cap",
|
|
8
|
+
"over_max_credits", "window_5h", "window_month", "window_week", "over_week", "free_only_exhausted", "key_cap_reached", "free_limited", "free_needs_email", "free_not_granted", "global_cap",
|
|
9
9
|
"flovia_paused", "rate_limited", "too_many_in_parallel", "reservation_changed",
|
|
10
10
|
"operation_conflict", "operation_pending", "relay_internal_error", "relay_internal_unknown", "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",
|
package/package.json
CHANGED