@flovialabs/sdk 0.1.12 → 0.1.14
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 +10 -0
- package/README.md +3 -3
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +4 -2
- package/dist/types.d.ts +2 -2
- package/dist/types.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.1.14
|
|
6
|
+
|
|
7
|
+
- Expect contract `2026-10-07.149`; `FloviaCode` and `PUBLIC_CODES` include `relay_internal_error`.
|
|
8
|
+
- 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.
|
|
9
|
+
- 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.
|
|
10
|
+
|
|
11
|
+
## 0.1.13
|
|
12
|
+
|
|
13
|
+
- 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.
|
|
14
|
+
|
|
5
15
|
## 0.1.12
|
|
6
16
|
|
|
7
17
|
- Expect contract `2026-10-07.146`: Flovia can look up public X posts (recent search and counts, one post and its quote posts, an account's recent posts); the tool is closed unless Flovia offers it.
|
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
|
+
npm install --save-exact @flovialabs/sdk@0.1.14
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Your key
|
|
@@ -234,7 +234,7 @@ npx flovia agents-md # a short note for CLAUDE.md or AGENTS.md
|
|
|
234
234
|
npx flovia help
|
|
235
235
|
npx flovia --version
|
|
236
236
|
```
|
|
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.
|
|
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.14 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
238
|
|
|
239
239
|
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
240
|
|
|
@@ -244,7 +244,7 @@ For a data lookup, save its JSON object (including your chosen `operation_id`) i
|
|
|
244
244
|
flovia call flovia_coingecko - < request.json
|
|
245
245
|
```
|
|
246
246
|
|
|
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.
|
|
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). 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
248
|
|
|
249
249
|
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
250
|
|
package/dist/cli.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface Io {
|
|
|
16
16
|
waiting?: () => () => void;
|
|
17
17
|
}
|
|
18
18
|
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
|
-
/**
|
|
19
|
+
/** Required properties plus Exa/Firecrawl's default-operation inputs, which are conditional in the schema. */
|
|
20
20
|
export declare function exampleCall(tool: string, schema: unknown): string;
|
|
21
21
|
export declare function help(command?: string): string;
|
|
22
22
|
export interface Parsed {
|
package/dist/cli.js
CHANGED
|
@@ -65,10 +65,12 @@ function placeholder(name, s) {
|
|
|
65
65
|
const type = Array.isArray(s.type) ? s.type[0] : s.type;
|
|
66
66
|
return type === "integer" || type === "number" ? 1 : type === "boolean" ? false : type === "array" ? [] : type === "object" ? {} : `<${name}>`;
|
|
67
67
|
}
|
|
68
|
-
/**
|
|
68
|
+
/** Required properties plus Exa/Firecrawl's default-operation inputs, which are conditional in the schema. */
|
|
69
69
|
export function exampleCall(tool, schema) {
|
|
70
70
|
const s = obj(schema), props = obj(s["properties"]), required = Array.isArray(s["required"]) ? s["required"].map(String) : [];
|
|
71
|
-
const
|
|
71
|
+
const defaults = tool === "flovia_exa" ? ["action", "query", "operation_id"] : tool === "flovia_firecrawl" ? ["action", "url", "operation_id"] : [];
|
|
72
|
+
const fields = [...new Set([...required, ...defaults.filter((k) => Object.hasOwn(props, k))])];
|
|
73
|
+
const args = Object.fromEntries(fields.map((k) => [k, placeholder(k, obj(props[k]))]));
|
|
72
74
|
const lines = ["", "Example (replace the placeholders):", ` flovia call ${tool} '${JSON.stringify(args).replaceAll("'", "'\\''")}'`,
|
|
73
75
|
"Or from a saved file:", ` flovia call ${tool} - < request.json`];
|
|
74
76
|
if (Object.hasOwn(props, "operation_id"))
|
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.149";
|
|
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.
|
|
2
|
+
export const EXPECTED_CONTRACT_VERSION = "2026-10-07.149";
|
|
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