@flovialabs/sdk 0.1.6 → 0.1.7

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,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.1.7
6
+
7
+ - 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.
8
+
5
9
  ## 0.1.6
6
10
 
7
11
  - 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.7
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.7 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flovialabs/sdk",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
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",