@flovialabs/sdk 0.1.6 → 0.1.8

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,14 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.1.8
6
+
7
+ - Expect relay contract `2026-10-07.135`, which adds optional `fresh` input for Exa and Firecrawl. Identical requests by the same user can reuse a completed answer for 15 minutes; `fresh: true` asks for a new lookup. Recovery with the same operation id stays unchanged.
8
+
9
+ ## 0.1.7
10
+
11
+ - Requests carry `X-Flovia-Client: flovia-sdk` (the CLI: `flovia-cli`), so Flovia can count SDK and CLI use apart from other clients. Only the name is sent, never a version or an id.
12
+
5
13
  ## 0.1.6
6
14
 
7
15
  - Interactive `status`, `usage`, `tools` and `call` show elapsed waiting time on stderr, as `generate` already does. JSON output stays quiet.
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.6
13
+ npm install --save-exact @flovialabs/sdk@0.1.8
14
14
  ```
15
15
 
16
16
  ## Your key
@@ -228,7 +228,7 @@ npx flovia generate --op sdk-example-0001 --max-output 1000 --reasoning-effort l
228
228
  npx flovia help
229
229
  npx flovia --version
230
230
  ```
231
- These commands run after installing `@flovialabs/sdk` in the current project. Without a local installation, specify the package: `npx --package=@flovialabs/sdk@0.1.6 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.
231
+ These commands run after installing `@flovialabs/sdk` in the current project. Without a local installation, specify the package: `npx --package=@flovialabs/sdk@0.1.8 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.
232
232
 
233
233
  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.
234
234
 
package/dist/cli.js CHANGED
@@ -270,7 +270,7 @@ export async function run(argv, io) {
270
270
  key = await readKey(p, io);
271
271
  return new FloviaClient({ apiKey: key, ...(baseUrl !== undefined ? { baseUrl } : {}), ...(timeout ? { timeoutMs: timeout * 1000 } : {}),
272
272
  ...(accessToken ? { accessToken } : {}),
273
- ...(io.fetch ? { fetch: io.fetch } : {}), onContractMismatch: (expected) => { mismatch = expected; } });
273
+ fetch: (r) => { r.headers.set("X-Flovia-Client", "flovia-cli"); return (io.fetch ?? fetch)(r); }, onContractMismatch: (expected) => { mismatch = expected; } });
274
274
  };
275
275
  switch (p.command) {
276
276
  case "status": {
package/dist/client.js CHANGED
@@ -81,7 +81,8 @@ export class FloviaClient {
81
81
  let r;
82
82
  try {
83
83
  const request = new Request(this.#base + path, { method: "POST", redirect: "error", body: JSON.stringify(body), signal: AbortSignal.timeout(this.#timeoutMs),
84
- headers: { Authorization: `Bearer ${this.#key}`, "Content-Type": "application/json", ...headers,
84
+ // The family only, so the relay can count SDK calls apart from other clients; never a version or an id.
85
+ headers: { Authorization: `Bearer ${this.#key}`, "Content-Type": "application/json", "X-Flovia-Client": "flovia-sdk", ...headers,
85
86
  ...(this.#accessToken ? { "Cf-Access-Token": this.#accessToken } : {}) } });
86
87
  r = await this.#fetch(request);
87
88
  }
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
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.134";
2
+ export declare const EXPECTED_CONTRACT_VERSION = "2026-10-07.135";
3
3
  /** Every public explanation.code (the relay's contract). A provider's own HTTP error is `http_<status>`. */
4
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", "global_cap", "flovia_paused", "rate_limited", "too_many_in_parallel", "reservation_changed", "operation_conflict", "operation_pending", "upstream_unknown", "upstream_unavailable", "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}`;
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.134";
2
+ export const EXPECTED_CONTRACT_VERSION = "2026-10-07.135";
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",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flovialabs/sdk",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
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",