@qoniai/qoni 0.4.0 → 0.4.1
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 +40 -4
- package/README.md +7 -13
- package/README.zh-CN.md +7 -13
- package/dist/index.cjs +9 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/qoni-sdk/SKILL.md +6 -6
- package/skills/qoni-sdk/agents/openai.yaml +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,42 @@ compatible fixes.
|
|
|
8
8
|
|
|
9
9
|
## Unreleased
|
|
10
10
|
|
|
11
|
+
### Breaking
|
|
12
|
+
|
|
13
|
+
- Rename the public SDK constructor from its previous longer name to `Qoni`.
|
|
14
|
+
The previous constructor export has been removed.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- The default Qoni host is now `https://dashboard.qoni.ai` (was
|
|
19
|
+
`https://anima.eazo.ai/dashboard`). Callers that never passed an explicit `host`
|
|
20
|
+
reach a different control plane after upgrading. Note that the new default has
|
|
21
|
+
no `/dashboard` path segment — pass `host` explicitly for private or local
|
|
22
|
+
deployments.
|
|
23
|
+
- Service resolution no longer fetches the runtime-config document to answer a
|
|
24
|
+
Qoni base URL. It never read the result for that service, but it did require
|
|
25
|
+
the fetch to succeed, so an unavailable discovery endpoint failed every Qoni
|
|
26
|
+
call. Discovery is still fetched lazily for `genauth` / `gumem` / `webagent`,
|
|
27
|
+
which do read it.
|
|
28
|
+
- Signed Qoni requests always stay on the configured control-plane host. Service
|
|
29
|
+
resolution no longer follows `eakBaseUrl` from the runtime config for the
|
|
30
|
+
Qoni service, because AK/SK signatures are scoped to that endpoint and a
|
|
31
|
+
cross-origin runtime URL can strip `Authorization` on redirect or disclose
|
|
32
|
+
credentials to an unintended origin.
|
|
33
|
+
- `unstableRequest()` without a `token` now signs the call with AK/SK instead of
|
|
34
|
+
sending it unauthenticated. Caller-supplied `authorization`, `content-type`,
|
|
35
|
+
`date` and `x-authing-*` headers are dropped so they cannot corrupt the
|
|
36
|
+
signature.
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
39
|
+
|
|
40
|
+
- The previous default host was unreachable for SDK API calls. A client created
|
|
41
|
+
as `new Qoni({ accessKey, secretKey })` now reaches the live control plane.
|
|
42
|
+
- Abandoning an event iterator no longer leaks its connection. Leaving
|
|
43
|
+
`for await (const event of run.events())` through a `break` now cancels the
|
|
44
|
+
response body before releasing the reader lock, returning the socket to the
|
|
45
|
+
connection pool.
|
|
46
|
+
|
|
11
47
|
### Added
|
|
12
48
|
|
|
13
49
|
- `RunHandle.events()` and `wait()` accept `onWireEvent` and `onReconnect`
|
|
@@ -23,8 +59,8 @@ compatible fixes.
|
|
|
23
59
|
### Breaking
|
|
24
60
|
|
|
25
61
|
- Rename the package from its previous product name to `@qoniai/qoni`.
|
|
26
|
-
- Rename the primary constructor and all branded exports to `
|
|
27
|
-
|
|
62
|
+
- Rename the primary constructor and all branded exports to `Qoni` and the
|
|
63
|
+
corresponding `Qoni*` types, constants, and error classes.
|
|
28
64
|
- Rename the product namespace to `client.qoni` and environment variables to
|
|
29
65
|
`QONI_*`. The current server wire contract remains unchanged: SDK gateway
|
|
30
66
|
routes stay under `/api/v3/eak/*`, delegation tokens retain
|
|
@@ -207,7 +243,7 @@ Initial public release of `@qoniai/qoni`.
|
|
|
207
243
|
|
|
208
244
|
### What ships
|
|
209
245
|
|
|
210
|
-
- Server-side `
|
|
246
|
+
- Server-side `Qoni` constructor for Qoni Agent delegation and product
|
|
211
247
|
runtime calls.
|
|
212
248
|
- Runtime service discovery from the Qoni Console gateway through
|
|
213
249
|
`GET /api/v3/eak/runtime-config`.
|
|
@@ -226,7 +262,7 @@ Initial public release of `@qoniai/qoni`.
|
|
|
226
262
|
|
|
227
263
|
### Compatibility
|
|
228
264
|
|
|
229
|
-
- `Qoni`
|
|
265
|
+
- `Qoni` is the public SDK constructor.
|
|
230
266
|
- `delegateAgent` and `completeDelegateAgent` remain available as deprecated
|
|
231
267
|
aliases for older integrations, but new integrations should use
|
|
232
268
|
`delegateToken`.
|
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Agents that perform real work need more than a backend API key. They need a user
|
|
|
19
19
|
|
|
20
20
|
Qoni keeps that model small:
|
|
21
21
|
|
|
22
|
-
- One SDK entry: `new
|
|
22
|
+
- One SDK entry: `new Qoni({ accessKey, secretKey })`.
|
|
23
23
|
- One discovery path: `host` can override the Qoni Console/SDK gateway for private or local deployments, and the SDK reads downstream runtime URLs from `/api/v3/eak/runtime-config`.
|
|
24
24
|
- One delegation entry: call `delegateToken`; silent mode returns `data.token`, while interactive mode returns an authorization URL and later completes on your server.
|
|
25
25
|
- One management path: call `genauth.users.*`, and the SDK exchanges AK/SK for a GenAuth management token before calling GenAuth v3 users APIs.
|
|
@@ -59,8 +59,8 @@ The package ships both ESM and CommonJS builds with TypeScript types, so either
|
|
|
59
59
|
import style works:
|
|
60
60
|
|
|
61
61
|
```ts
|
|
62
|
-
import {
|
|
63
|
-
const {
|
|
62
|
+
import { Qoni } from "@qoniai/qoni"; // ESM / TypeScript
|
|
63
|
+
const { Qoni } = require("@qoniai/qoni"); // CommonJS
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
## AI Skill
|
|
@@ -87,9 +87,9 @@ Start with a server-side SDK instance. AK/SK stays on your trusted server for bo
|
|
|
87
87
|
|
|
88
88
|
```ts
|
|
89
89
|
import fs from "node:fs";
|
|
90
|
-
import {
|
|
90
|
+
import { Qoni } from "@qoniai/qoni";
|
|
91
91
|
|
|
92
|
-
const qoni = new
|
|
92
|
+
const qoni = new Qoni({
|
|
93
93
|
accessKey: process.env.QONI_ACCESS_KEY!,
|
|
94
94
|
secretKey: process.env.QONI_SECRET_KEY!,
|
|
95
95
|
});
|
|
@@ -472,7 +472,7 @@ const sameMonitor = await qoni.track.attach(monitor.id, { token });
|
|
|
472
472
|
### GenAuth User Context and Management
|
|
473
473
|
|
|
474
474
|
```ts
|
|
475
|
-
const client = new
|
|
475
|
+
const client = new Qoni({
|
|
476
476
|
accessKey: process.env.QONI_ACCESS_KEY!,
|
|
477
477
|
secretKey: process.env.QONI_SECRET_KEY!,
|
|
478
478
|
});
|
|
@@ -499,7 +499,7 @@ const created = await client.genauth.users.create({
|
|
|
499
499
|
### Client
|
|
500
500
|
|
|
501
501
|
```ts
|
|
502
|
-
const qoni = new
|
|
502
|
+
const qoni = new Qoni({
|
|
503
503
|
accessKey: process.env.QONI_ACCESS_KEY!,
|
|
504
504
|
secretKey: process.env.QONI_SECRET_KEY!,
|
|
505
505
|
timeoutMs: 30_000,
|
|
@@ -524,12 +524,6 @@ const qoni = new QoniAgentKit({
|
|
|
524
524
|
> `wait()` timeout does not stop the run; it keeps executing server-side and
|
|
525
525
|
> you can `attach()` to it again.
|
|
526
526
|
|
|
527
|
-
`Qoni` is also exported as a short alias:
|
|
528
|
-
|
|
529
|
-
```ts
|
|
530
|
-
import { Qoni, QoniAgentKit } from "@qoniai/qoni";
|
|
531
|
-
```
|
|
532
|
-
|
|
533
527
|
### Namespaces
|
|
534
528
|
|
|
535
529
|
| Namespace | Methods |
|
package/README.zh-CN.md
CHANGED
|
@@ -14,7 +14,7 @@ AK/SK 必须只保存在可信服务端,不能下发到浏览器、移动端
|
|
|
14
14
|
|
|
15
15
|
Qoni 把 Agent 授权模型收敛成几个稳定边界:
|
|
16
16
|
|
|
17
|
-
- 一个 SDK 入口:`new
|
|
17
|
+
- 一个 SDK 入口:`new Qoni({ accessKey, secretKey })`。
|
|
18
18
|
- 一条发现路径:`host` 可在私有化或本地部署中覆盖 Qoni Console/SDK 网关,SDK 通过 `/api/v3/eak/runtime-config` 获取 GenAuth、GUMem、WebAgent 等运行时地址。
|
|
19
19
|
- 一个授权入口:调用 `delegateToken`;silent 模式直接返回 `data.token`,interactive 模式返回授权 URL,之后由业务服务端完成兑换。
|
|
20
20
|
- 一条管理面路径:调用 `genauth.users.*`,SDK 会先用 AK/SK 换取 GenAuth management token,再调用 GenAuth v3 users API。
|
|
@@ -52,8 +52,8 @@ yarn add @qoniai/qoni
|
|
|
52
52
|
包同时发布 ESM 和 CommonJS 两套构建(都带 TypeScript 类型),两种引入方式都可用:
|
|
53
53
|
|
|
54
54
|
```ts
|
|
55
|
-
import {
|
|
56
|
-
const {
|
|
55
|
+
import { Qoni } from "@qoniai/qoni"; // ESM / TypeScript
|
|
56
|
+
const { Qoni } = require("@qoniai/qoni"); // CommonJS
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
## AI Skill
|
|
@@ -80,9 +80,9 @@ npm 包中包含 `skills/` 目录,但推荐仍使用上面的 GitHub 仓库安
|
|
|
80
80
|
|
|
81
81
|
```ts
|
|
82
82
|
import fs from "node:fs";
|
|
83
|
-
import {
|
|
83
|
+
import { Qoni } from "@qoniai/qoni";
|
|
84
84
|
|
|
85
|
-
const qoni = new
|
|
85
|
+
const qoni = new Qoni({
|
|
86
86
|
accessKey: process.env.QONI_ACCESS_KEY!,
|
|
87
87
|
secretKey: process.env.QONI_SECRET_KEY!,
|
|
88
88
|
});
|
|
@@ -442,7 +442,7 @@ const sameMonitor = await qoni.track.attach(monitor.id, { token });
|
|
|
442
442
|
### GenAuth 用户上下文与用户管理
|
|
443
443
|
|
|
444
444
|
```ts
|
|
445
|
-
const client = new
|
|
445
|
+
const client = new Qoni({
|
|
446
446
|
accessKey: process.env.QONI_ACCESS_KEY!,
|
|
447
447
|
secretKey: process.env.QONI_SECRET_KEY!,
|
|
448
448
|
});
|
|
@@ -469,7 +469,7 @@ const created = await client.genauth.users.create({
|
|
|
469
469
|
### Client
|
|
470
470
|
|
|
471
471
|
```ts
|
|
472
|
-
const qoni = new
|
|
472
|
+
const qoni = new Qoni({
|
|
473
473
|
accessKey: process.env.QONI_ACCESS_KEY!,
|
|
474
474
|
secretKey: process.env.QONI_SECRET_KEY!,
|
|
475
475
|
timeoutMs: 30_000,
|
|
@@ -486,12 +486,6 @@ const qoni = new QoniAgentKit({
|
|
|
486
486
|
|
|
487
487
|
> **`timeoutMs` 不会限制长任务。** 它只作用于单次一次性 HTTP 请求(委托、`status()`、单个 POST)。事件流(`events()` / `wait()`)**不受它约束**——流的响应头一到,这个单次计时器就被清掉了,所以一个跑一小时的 Deep Research 在默认 30s 客户端超时下也能正常流式。要限制等待时长用 `wait({ timeoutMs })`;不传则 `wait()` 一直等到终态。`wait()` 超时**不会停止 run**——它在服务端继续跑,可以再 `attach()` 回去。
|
|
488
488
|
|
|
489
|
-
兼容导出:
|
|
490
|
-
|
|
491
|
-
```ts
|
|
492
|
-
import { Qoni, QoniAgentKit } from "@qoniai/qoni";
|
|
493
|
-
```
|
|
494
|
-
|
|
495
489
|
### 命名空间
|
|
496
490
|
|
|
497
491
|
| 命名空间 | 方法 |
|
package/dist/index.cjs
CHANGED
|
@@ -25,8 +25,7 @@ __export(index_exports, {
|
|
|
25
25
|
InteractionStatuses: () => InteractionStatuses,
|
|
26
26
|
InteractionTypes: () => InteractionTypes,
|
|
27
27
|
MonitorHandle: () => MonitorHandle,
|
|
28
|
-
Qoni: () =>
|
|
29
|
-
QoniAgentKit: () => QoniAgentKit,
|
|
28
|
+
Qoni: () => Qoni,
|
|
30
29
|
QoniAuthError: () => QoniAuthError,
|
|
31
30
|
QoniDelegationRequiredError: () => QoniDelegationRequiredError,
|
|
32
31
|
QoniError: () => QoniError,
|
|
@@ -1958,8 +1957,8 @@ function renameKeys5(value, mapping) {
|
|
|
1958
1957
|
}
|
|
1959
1958
|
|
|
1960
1959
|
// src/client.ts
|
|
1961
|
-
var DEFAULT_QONI_HOST = "https://
|
|
1962
|
-
var
|
|
1960
|
+
var DEFAULT_QONI_HOST = "https://dashboard.qoni.ai";
|
|
1961
|
+
var Qoni = class {
|
|
1963
1962
|
constructor(options) {
|
|
1964
1963
|
this.options = options;
|
|
1965
1964
|
const accessKey = options.accessKey ?? options.accessKeyId;
|
|
@@ -2317,7 +2316,11 @@ var QoniAgentKit = class {
|
|
|
2317
2316
|
const finalEvent = parseSSEEvent(buffer);
|
|
2318
2317
|
if (finalEvent) yield finalEvent;
|
|
2319
2318
|
} finally {
|
|
2320
|
-
reader.
|
|
2319
|
+
await reader.cancel().catch(() => void 0);
|
|
2320
|
+
try {
|
|
2321
|
+
reader.releaseLock();
|
|
2322
|
+
} catch {
|
|
2323
|
+
}
|
|
2321
2324
|
}
|
|
2322
2325
|
}
|
|
2323
2326
|
async fetchWithTimeout(input, init, signal, opts) {
|
|
@@ -2351,8 +2354,8 @@ var QoniAgentKit = class {
|
|
|
2351
2354
|
async baseUrlFor(service) {
|
|
2352
2355
|
const explicit = this.explicitBaseUrlFor(service);
|
|
2353
2356
|
if (explicit) return explicit;
|
|
2354
|
-
const runtime = await this.runtimeConfig();
|
|
2355
2357
|
if (service === "qoni") return this.host;
|
|
2358
|
+
const runtime = await this.runtimeConfig();
|
|
2356
2359
|
const hostOrigin = originBaseUrl(this.host);
|
|
2357
2360
|
if (service === "genauth") return runtime.genauthBaseUrl ?? hostOrigin;
|
|
2358
2361
|
if (service === "gumem") return runtime.gumemBaseUrl ?? hostOrigin;
|
|
@@ -2894,7 +2897,6 @@ function errorName(error) {
|
|
|
2894
2897
|
InteractionTypes,
|
|
2895
2898
|
MonitorHandle,
|
|
2896
2899
|
Qoni,
|
|
2897
|
-
QoniAgentKit,
|
|
2898
2900
|
QoniAuthError,
|
|
2899
2901
|
QoniDelegationRequiredError,
|
|
2900
2902
|
QoniError,
|