@qverisai/sdk 0.1.2 → 0.3.0
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 +33 -0
- package/LICENSE +1 -1
- package/README.md +129 -216
- package/dist/client.d.ts +116 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +334 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +25 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +34 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +14 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -260
- package/dist/index.js.map +1 -1
- package/dist/integrations/ai.d.ts +768 -0
- package/dist/integrations/ai.d.ts.map +1 -0
- package/dist/integrations/ai.js +87 -0
- package/dist/integrations/ai.js.map +1 -0
- package/dist/retry.d.ts +42 -0
- package/dist/retry.d.ts.map +1 -0
- package/dist/retry.js +63 -0
- package/dist/retry.js.map +1 -0
- package/dist/types.d.ts +266 -62
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +3 -2
- package/dist/types.js.map +1 -1
- package/package.json +72 -55
- package/dist/api/client.d.ts +0 -147
- package/dist/api/client.d.ts.map +0 -1
- package/dist/api/client.js +0 -201
- package/dist/api/client.js.map +0 -1
- package/dist/tools/execute.d.ts +0 -89
- package/dist/tools/execute.d.ts.map +0 -1
- package/dist/tools/execute.js +0 -73
- package/dist/tools/execute.js.map +0 -1
- package/dist/tools/get-by-ids.d.ts +0 -69
- package/dist/tools/get-by-ids.d.ts.map +0 -1
- package/dist/tools/get-by-ids.js +0 -55
- package/dist/tools/get-by-ids.js.map +0 -1
- package/dist/tools/search.d.ts +0 -71
- package/dist/tools/search.d.ts.map +0 -1
- package/dist/tools/search.js +0 -53
- package/dist/tools/search.js.map +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@qverisai/sdk` are documented here.
|
|
4
|
+
|
|
5
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow [Semantic Versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.3.0] - 2026-07-09
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Vercel AI SDK adapter: `getQverisTools(qveris)` from `@qverisai/sdk/ai` returns `qveris_discover` / `qveris_inspect` / `qveris_call` tools for `generateText`/`streamText` (`ai` and `zod` as optional peer dependencies). ([#134])
|
|
14
|
+
- Rate-limited (`429`) and transient (`503`) responses are retried automatically: honors `Retry-After`, otherwise exponential backoff with jitter, bounded by the `maxRetries` config option (default 3; `0` disables); `rateLimitRetryCount` exposes the backoff. ([#143])
|
|
15
|
+
|
|
16
|
+
## [0.2.0] - 2026-07-06
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- First release of the typed QVeris REST client: `discover` / `inspect` / `call` / `credits` / `usage` / `ledger`, zero dependencies (native fetch, Node 18+). ([#106])
|
|
21
|
+
- Wire semantics aligned with the Python SDK and MCP server: success-envelope unwrapping, region auto-detection from the key prefix, structured `QverisApiError` with observability context.
|
|
22
|
+
- Response types cover category objects, capability descriptors, `why_recommended`, and `expected_cost`.
|
|
23
|
+
|
|
24
|
+
### Note
|
|
25
|
+
|
|
26
|
+
- `0.1.x` under this npm name was an early MCP-focused SDK, superseded by `@qverisai/mcp`.
|
|
27
|
+
|
|
28
|
+
[Unreleased]: https://github.com/QVerisAI/qveris-agent-toolkit/compare/js-sdk-v0.3.0...HEAD
|
|
29
|
+
[0.3.0]: https://github.com/QVerisAI/qveris-agent-toolkit/compare/js-sdk-v0.2.0...js-sdk-v0.3.0
|
|
30
|
+
[0.2.0]: https://github.com/QVerisAI/qveris-agent-toolkit/releases/tag/js-sdk-v0.2.0
|
|
31
|
+
[#143]: https://github.com/QVerisAI/qveris-agent-toolkit/pull/143
|
|
32
|
+
[#134]: https://github.com/QVerisAI/qveris-agent-toolkit/pull/134
|
|
33
|
+
[#106]: https://github.com/QVerisAI/qveris-agent-toolkit/issues/106
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,216 +1,129 @@
|
|
|
1
|
-
# @qverisai/sdk
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
"tool_ids": ["openweathermap.weather.execute.v1", "worldbank_refined.search_indicators.v1"],
|
|
131
|
-
"search_id": "abcd1234-ab12-ab12-ab12-abcdef123456"
|
|
132
|
-
}
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
## Session Management
|
|
136
|
-
|
|
137
|
-
Providing a consistent `session_id` in a same user session in any tool call enables:
|
|
138
|
-
- Consistent user tracking across multiple tool calls
|
|
139
|
-
- Better analytics and usage patterns
|
|
140
|
-
- Improved tool recommendations over time
|
|
141
|
-
|
|
142
|
-
If not provided, the SDK automatically generates and maintains a session ID for the lifetime of the server process. However, this result in a much larger granularity of user sessions.
|
|
143
|
-
|
|
144
|
-
## Response Handling
|
|
145
|
-
|
|
146
|
-
### Successful Execution
|
|
147
|
-
|
|
148
|
-
```json
|
|
149
|
-
{
|
|
150
|
-
"execution_id": "abcd1234-ab12-ab12-ab12-abcdef123456",
|
|
151
|
-
"tool_id": "openweathermap.weather.execute.v1",
|
|
152
|
-
"success": true,
|
|
153
|
-
"result": {
|
|
154
|
-
"data": {
|
|
155
|
-
"temperature": 15.5,
|
|
156
|
-
"humidity": 72,
|
|
157
|
-
"description": "partly cloudy"
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
"execution_time": 0.847
|
|
161
|
-
}
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
### Large Responses
|
|
165
|
-
|
|
166
|
-
When tool output exceeds `max_response_size`, you'll receive:
|
|
167
|
-
|
|
168
|
-
```json
|
|
169
|
-
{
|
|
170
|
-
"result": {
|
|
171
|
-
"message": "Result content is too long...",
|
|
172
|
-
"truncated_content": "[[1678233600000, \"22198.56...",
|
|
173
|
-
"full_content_file_url": "https://..."
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
The `full_content_file_url` is valid for 120 minutes.
|
|
179
|
-
|
|
180
|
-
## Environment Variables
|
|
181
|
-
|
|
182
|
-
| Variable | Required | Description |
|
|
183
|
-
|----------|----------|-------------|
|
|
184
|
-
| `QVERIS_API_KEY` | ✓ | Your Qveris API key |
|
|
185
|
-
|
|
186
|
-
## Requirements
|
|
187
|
-
|
|
188
|
-
- Node.js 18.0.0 or higher
|
|
189
|
-
- A valid Qveris API key
|
|
190
|
-
|
|
191
|
-
## Development
|
|
192
|
-
|
|
193
|
-
```bash
|
|
194
|
-
# Clone the repository
|
|
195
|
-
git clone https://github.com/qverisai/sdk.git
|
|
196
|
-
cd sdk
|
|
197
|
-
|
|
198
|
-
# Install dependencies
|
|
199
|
-
npm install
|
|
200
|
-
|
|
201
|
-
# Build
|
|
202
|
-
npm build
|
|
203
|
-
|
|
204
|
-
# Run locally
|
|
205
|
-
QVERIS_API_KEY=your-key node dist/index.js
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
## License
|
|
209
|
-
|
|
210
|
-
MIT © [QverisAI](https://github.com/qverisai)
|
|
211
|
-
|
|
212
|
-
## Support
|
|
213
|
-
|
|
214
|
-
- 🐛 [Issue Tracker](https://github.com/qverisai/sdk/issues)
|
|
215
|
-
- 💬 Contact: contact@qveris.ai
|
|
216
|
-
|
|
1
|
+
# @qverisai/sdk
|
|
2
|
+
|
|
3
|
+
TypeScript SDK for [QVeris](https://qveris.ai) — the Agent External Data & Tool Harness. Discover, inspect and call 1000+ ranked external data & tool capabilities with unified billing and usage audit. No per-provider API keys required.
|
|
4
|
+
|
|
5
|
+
- **Typed end to end** — response types aligned with the public OpenAPI contract (categories, capabilities, `why_recommended`, `expected_cost`, billing)
|
|
6
|
+
- **Zero dependencies** — native `fetch`, Node.js 18+
|
|
7
|
+
- **Same wire semantics** as the [Python SDK](https://pypi.org/project/qveris/) and the [MCP server](https://www.npmjs.com/package/@qverisai/mcp)
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @qverisai/sdk
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Quickstart
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { Qveris } from '@qverisai/sdk';
|
|
19
|
+
|
|
20
|
+
const qveris = new Qveris({ apiKey: process.env.QVERIS_API_KEY! });
|
|
21
|
+
// or: const qveris = Qveris.fromEnv();
|
|
22
|
+
|
|
23
|
+
// 1. Discover — free, returns ranked capabilities
|
|
24
|
+
const found = await qveris.discover('stock price market data API', { limit: 5 });
|
|
25
|
+
for (const tool of found.results) {
|
|
26
|
+
console.log(tool.tool_id, '—', tool.why_recommended);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// 2. Inspect — free, current parameter schemas
|
|
30
|
+
const detail = await qveris.inspect(found.results[0].tool_id, {
|
|
31
|
+
searchId: found.search_id,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// 3. Call — billed in credits; response includes pre-settlement billing
|
|
35
|
+
const outcome = await qveris.call(found.results[0].tool_id, {
|
|
36
|
+
searchId: found.search_id,
|
|
37
|
+
parameters: { symbol: 'AAPL' },
|
|
38
|
+
});
|
|
39
|
+
console.log(outcome.success, outcome.result);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Audit
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
// Final charge status for an execution
|
|
46
|
+
const usage = await qveris.usage({ execution_id: outcome.execution_id });
|
|
47
|
+
|
|
48
|
+
// Credit balance movements
|
|
49
|
+
const ledger = await qveris.ledger({ direction: 'consume', summary: true });
|
|
50
|
+
|
|
51
|
+
// Current balance
|
|
52
|
+
const credits = await qveris.credits();
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Configuration
|
|
56
|
+
|
|
57
|
+
| Option / env var | Description |
|
|
58
|
+
| --- | --- |
|
|
59
|
+
| `apiKey` / `QVERIS_API_KEY` | Required. Create one at [qveris.ai](https://qveris.ai/account?page=api-keys) (global) or [qveris.cn](https://qveris.cn/account?page=api-keys) (China) |
|
|
60
|
+
| `baseUrl` / `QVERIS_BASE_URL` | Override API base URL (highest priority) |
|
|
61
|
+
| `QVERIS_REGION` | Force region: `global` or `cn`. Otherwise auto-detected from the key prefix (`sk-cn-…` → China) |
|
|
62
|
+
| `timeoutMs` | Default request timeout (30s; `call` defaults to 120s) |
|
|
63
|
+
| `maxRetries` | Retries for rate-limited (429) / transient (503) responses (default 3; `0` disables) |
|
|
64
|
+
|
|
65
|
+
## Rate limiting & retries
|
|
66
|
+
|
|
67
|
+
The client transparently retries rate-limited (`429`) and transient (`503`) responses: it honors the `Retry-After` header when present, otherwise backs off exponentially with full jitter. Each wait is capped and retries are bounded by `maxRetries`, so a call never hangs.
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
const qveris = new Qveris({ apiKey: process.env.QVERIS_API_KEY!, maxRetries: 5 });
|
|
71
|
+
// ... after some calls under load:
|
|
72
|
+
qveris.rateLimitRetryCount; // how many times it backed off (pressure, not failures)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Set `maxRetries: 0` to disable. Rate-limit backoff is retried pressure rather than failure — read `rateLimitRetryCount` to observe it instead of treating the retried `429`s as errors.
|
|
76
|
+
|
|
77
|
+
## Errors
|
|
78
|
+
|
|
79
|
+
All failures throw `QverisApiError` (an `Error` subclass) with `status`, `details`, and an `observability` object (operation, endpoint, request id) for diagnostics:
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
import { QverisApiError } from '@qverisai/sdk';
|
|
83
|
+
|
|
84
|
+
try {
|
|
85
|
+
await qveris.call('some.tool.v1', { parameters: {} });
|
|
86
|
+
} catch (err) {
|
|
87
|
+
if (err instanceof QverisApiError && err.status === 402) {
|
|
88
|
+
// insufficient credits — err.message includes the purchase link
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Framework integrations
|
|
94
|
+
|
|
95
|
+
Expose the QVeris workflow as [Vercel AI SDK](https://sdk.vercel.ai) tools. `ai` and `zod` are peer dependencies:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
npm install @qverisai/sdk ai zod
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
import { generateText } from 'ai';
|
|
103
|
+
import { openai } from '@ai-sdk/openai';
|
|
104
|
+
import { Qveris } from '@qverisai/sdk';
|
|
105
|
+
import { getQverisTools } from '@qverisai/sdk/ai';
|
|
106
|
+
|
|
107
|
+
const qveris = new Qveris({ apiKey: process.env.QVERIS_API_KEY! });
|
|
108
|
+
const { text } = await generateText({
|
|
109
|
+
model: openai('gpt-4o'),
|
|
110
|
+
tools: getQverisTools(qveris), // qveris_discover / qveris_inspect / qveris_call
|
|
111
|
+
maxSteps: 6,
|
|
112
|
+
prompt: 'Find a stock quote capability and quote AAPL.',
|
|
113
|
+
});
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Version history note
|
|
117
|
+
|
|
118
|
+
Versions `0.1.x` of this npm package were an early MCP-focused SDK, since superseded by [`@qverisai/mcp`](https://www.npmjs.com/package/@qverisai/mcp). The typed REST client documented here starts at **`0.2.0`**.
|
|
119
|
+
|
|
120
|
+
## Related
|
|
121
|
+
|
|
122
|
+
- [QVeris CLI](https://www.npmjs.com/package/@qverisai/cli) — `qveris discover / inspect / call / usage / ledger`
|
|
123
|
+
- [QVeris MCP server](https://www.npmjs.com/package/@qverisai/mcp) — for Claude, Cursor and other MCP clients
|
|
124
|
+
- [Python SDK](https://pypi.org/project/qveris/)
|
|
125
|
+
- [REST API docs](https://github.com/QVerisAI/qveris-agent-toolkit/blob/main/docs/en-US/rest-api.md)
|
|
126
|
+
|
|
127
|
+
## License
|
|
128
|
+
|
|
129
|
+
MIT
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QVeris API client.
|
|
3
|
+
*
|
|
4
|
+
* A lightweight, dependency-free typed client for the QVeris REST API using
|
|
5
|
+
* native fetch (Node.js 18+). Handles authentication, region resolution,
|
|
6
|
+
* success-envelope unwrapping, timeouts, and error normalization.
|
|
7
|
+
*
|
|
8
|
+
* The wire semantics mirror the Python SDK (`qveris` on PyPI) and the MCP
|
|
9
|
+
* server (`@qverisai/mcp`).
|
|
10
|
+
*
|
|
11
|
+
* @module client
|
|
12
|
+
*/
|
|
13
|
+
import type { ApiError, CreditsLedgerRequest, CreditsLedgerResponse, CreditsResponse, ExecuteResponse, QverisClientConfig, SearchResponse, UsageEventsResponse, UsageHistoryRequest } from './types.js';
|
|
14
|
+
/** Options for {@link Qveris.discover}. */
|
|
15
|
+
export interface DiscoverOptions {
|
|
16
|
+
/** Maximum number of results (1-100, server default 20) */
|
|
17
|
+
limit?: number;
|
|
18
|
+
/** Session identifier for tracking */
|
|
19
|
+
sessionId?: string;
|
|
20
|
+
/** Per-request timeout override in milliseconds */
|
|
21
|
+
timeoutMs?: number;
|
|
22
|
+
}
|
|
23
|
+
/** Options for {@link Qveris.inspect}. */
|
|
24
|
+
export interface InspectOptions {
|
|
25
|
+
/** The search_id from the discover call that returned the tool(s) */
|
|
26
|
+
searchId?: string;
|
|
27
|
+
/** Session identifier for tracking */
|
|
28
|
+
sessionId?: string;
|
|
29
|
+
/** Per-request timeout override in milliseconds */
|
|
30
|
+
timeoutMs?: number;
|
|
31
|
+
}
|
|
32
|
+
/** Options for {@link Qveris.call}. */
|
|
33
|
+
export interface CallOptions {
|
|
34
|
+
/** Key-value parameters matching the tool's parameter schema */
|
|
35
|
+
parameters: Record<string, unknown>;
|
|
36
|
+
/** The search_id from the discover call that returned this tool */
|
|
37
|
+
searchId?: string;
|
|
38
|
+
/** Session identifier for tracking */
|
|
39
|
+
sessionId?: string;
|
|
40
|
+
/** Max response bytes before truncation (-1 for no limit, server default 20480) */
|
|
41
|
+
maxResponseSize?: number;
|
|
42
|
+
/** Per-request timeout override in milliseconds (default 120s) */
|
|
43
|
+
timeoutMs?: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* QVeris API client.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* import { Qveris } from '@qverisai/sdk';
|
|
51
|
+
*
|
|
52
|
+
* const qveris = new Qveris({ apiKey: process.env.QVERIS_API_KEY! });
|
|
53
|
+
*
|
|
54
|
+
* const found = await qveris.discover('stock price market data API', { limit: 5 });
|
|
55
|
+
* const tool = found.results[0];
|
|
56
|
+
*
|
|
57
|
+
* const outcome = await qveris.call(tool.tool_id, {
|
|
58
|
+
* searchId: found.search_id,
|
|
59
|
+
* parameters: { symbol: 'AAPL' },
|
|
60
|
+
* });
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare class Qveris {
|
|
64
|
+
private readonly apiKey;
|
|
65
|
+
private readonly baseUrl;
|
|
66
|
+
private readonly defaultTimeoutMs;
|
|
67
|
+
private readonly maxRetries;
|
|
68
|
+
private rateLimitRetries;
|
|
69
|
+
constructor(config: QverisClientConfig);
|
|
70
|
+
/**
|
|
71
|
+
* How many times the client has backed off on a rate-limited (429) /
|
|
72
|
+
* transient (503) response so far. Rate-limit backoff is retried pressure,
|
|
73
|
+
* not failure — observe this rather than counting the retried responses.
|
|
74
|
+
*/
|
|
75
|
+
get rateLimitRetryCount(): number;
|
|
76
|
+
/** Sleep for `ms` (a seam so tests can stub out the wait). */
|
|
77
|
+
private sleep;
|
|
78
|
+
/**
|
|
79
|
+
* Create a client from the QVERIS_API_KEY environment variable.
|
|
80
|
+
* Region is auto-detected from the key prefix (sk-cn-xxx -> cn), or
|
|
81
|
+
* overridden via QVERIS_REGION / QVERIS_BASE_URL.
|
|
82
|
+
*/
|
|
83
|
+
static fromEnv(overrides?: Omit<QverisClientConfig, 'apiKey'>): Qveris;
|
|
84
|
+
/**
|
|
85
|
+
* Discover capabilities from a natural-language query. Free.
|
|
86
|
+
*/
|
|
87
|
+
discover(query: string, options?: DiscoverOptions): Promise<SearchResponse>;
|
|
88
|
+
/**
|
|
89
|
+
* Inspect capabilities by id to get current parameter schemas. Free.
|
|
90
|
+
* An empty id list resolves locally without a network request.
|
|
91
|
+
*/
|
|
92
|
+
inspect(toolIds: string | string[], options?: InspectOptions): Promise<SearchResponse>;
|
|
93
|
+
/**
|
|
94
|
+
* Call a capability. The response may include pre-settlement billing;
|
|
95
|
+
* final charges are reflected in usage() and ledger().
|
|
96
|
+
*/
|
|
97
|
+
call(toolId: string, options: CallOptions): Promise<ExecuteResponse>;
|
|
98
|
+
/** Get current credit balance and bucket details. */
|
|
99
|
+
credits(): Promise<CreditsResponse>;
|
|
100
|
+
/** Query request-level usage audit history. */
|
|
101
|
+
usage(filters?: UsageHistoryRequest): Promise<UsageEventsResponse>;
|
|
102
|
+
/** Query final credits ledger entries. */
|
|
103
|
+
ledger(filters?: CreditsLedgerRequest): Promise<CreditsLedgerResponse>;
|
|
104
|
+
/**
|
|
105
|
+
* Makes an authenticated HTTP request and unwraps success envelopes.
|
|
106
|
+
*/
|
|
107
|
+
private request;
|
|
108
|
+
/**
|
|
109
|
+
* Unwrap `{status: "success", data: ...}` envelopes; raw payloads pass
|
|
110
|
+
* through. A failure envelope throws before any result parsing, matching
|
|
111
|
+
* the Python SDK behavior.
|
|
112
|
+
*/
|
|
113
|
+
private unwrapEnvelope;
|
|
114
|
+
}
|
|
115
|
+
export type { ApiError };
|
|
116
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAWH,OAAO,KAAK,EAEV,QAAQ,EAGR,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAoCpB,2CAA2C;AAC3C,MAAM,WAAW,eAAe;IAC9B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,0CAA0C;AAC1C,MAAM,WAAW,cAAc;IAC7B,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,uCAAuC;AACvC,MAAM,WAAW,WAAW;IAC1B,gEAAgE;IAChE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mFAAmF;IACnF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,gBAAgB,CAAK;gBAEjB,MAAM,EAAE,kBAAkB;IActC;;;;OAIG;IACH,IAAI,mBAAmB,IAAI,MAAM,CAEhC;IAED,8DAA8D;YAChD,KAAK;IAKnB;;;;OAIG;IACH,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,QAAQ,CAAC,GAAG,MAAM;IAYtE;;OAEG;IACG,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;IAcrF;;;OAGG;IACG,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,cAAc,CAAC;IAkBhG;;;OAGG;IACG,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC;IAiB1E,qDAAqD;IAC/C,OAAO,IAAI,OAAO,CAAC,eAAe,CAAC;IAIzC,+CAA+C;IACzC,KAAK,CAAC,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAW5E,0CAA0C;IACpC,MAAM,CAAC,OAAO,GAAE,oBAAyB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAWhF;;OAEG;YACW,OAAO;IA2IrB;;;;OAIG;IACH,OAAO,CAAC,cAAc;CAqBvB;AAkCD,YAAY,EAAE,QAAQ,EAAE,CAAC"}
|