@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/package.json
CHANGED
package/skills/qoni-sdk/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: qoni-sdk
|
|
3
|
-
description: Use when building, testing, debugging, or documenting Node.js integrations with @qoniai/qoni,
|
|
3
|
+
description: Use when building, testing, debugging, or documenting Node.js integrations with @qoniai/qoni, the Qoni constructor, AK/SK credentials, delegateToken, GenAuth currentUser/userInfo/introspection/user management, Qoni runtime-config discovery, GUMem, WebAgent, Web Search, Do Anything, Deep Research, Track, OBO product token exchange, or local .genauth.localhost SDK flows.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Qoni SDK
|
|
@@ -15,12 +15,12 @@ description: Use when building, testing, debugging, or documenting Node.js integ
|
|
|
15
15
|
|
|
16
16
|
## Core Contract
|
|
17
17
|
|
|
18
|
-
Use `@qoniai/qoni` from trusted server-side Node.js code. Keep AK/SK on the server and create one reusable `
|
|
18
|
+
Use `@qoniai/qoni` from trusted server-side Node.js code. Keep AK/SK on the server and create one reusable `Qoni`. For silent runtime product calls, resolve a real GenAuth user id from the credential-bound userpool, call `delegateToken`, then pass `delegation.data.token` explicitly to every product capability call. For interactive runtime authorization, call `delegateToken({ mode: "interactive", redirectUri, state, agent, scopes })` from the server without exposing AK/SK; redirect the user to `authorizationUrl`, then handle the business callback server-side with `completeDelegateToken({ grantId, code, state })` to receive the token. For GenAuth user management, call `qoni.genauth.users.*`; the SDK exchanges AK/SK for a standard GenAuth management token internally and does not require `QONI_USER_ID`.
|
|
19
19
|
|
|
20
20
|
```ts
|
|
21
|
-
import {
|
|
21
|
+
import { Qoni, QoniScopes } from "@qoniai/qoni";
|
|
22
22
|
|
|
23
|
-
const qoni = new
|
|
23
|
+
const qoni = new Qoni({
|
|
24
24
|
accessKey: process.env.QONI_ACCESS_KEY!,
|
|
25
25
|
secretKey: process.env.QONI_SECRET_KEY!,
|
|
26
26
|
host: process.env.QONI_HOST, // Qoni Console/SDK gateway; optional in hosted Qoni.
|
|
@@ -91,7 +91,7 @@ const completed = await qoni.completeDelegateToken({
|
|
|
91
91
|
});
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
-
`
|
|
94
|
+
`delegateAgent` and `completeDelegateAgent` remain deprecated compatibility names. Use `completeDelegateToken` for interactive callbacks; the current callback contract is `{ grantId, code, state }`, not the old `{ code, state }` shape.
|
|
95
95
|
|
|
96
96
|
## Runtime Discovery
|
|
97
97
|
|
|
@@ -318,7 +318,7 @@ For skill or docs changes that teach integration, also validate from a fresh con
|
|
|
318
318
|
1. Pack the current SDK into a temporary directory with `pnpm pack --pack-destination <tmp-dir>`.
|
|
319
319
|
2. Create a clean Node.js 18+ TypeScript project outside the SDK repo.
|
|
320
320
|
3. Install the packed tarball.
|
|
321
|
-
4. Add a small mocked integration that imports from `@qoniai/qoni`, constructs `
|
|
321
|
+
4. Add a small mocked integration that imports from `@qoniai/qoni`, constructs `Qoni`, returns runtime-config from `host`, calls `delegateToken`, passes `delegation.data.token` to GUMem/WebAgent calls, and asserts product token exchange plus WebAgent tenant routing. Also cover `genauth.users.list()` by mocking `POST /api/v3/eak/genauth/admin-token` with body `{}` and a returned `userPoolId`.
|
|
322
322
|
5. Run the consumer project's typecheck and test command.
|
|
323
323
|
|
|
324
324
|
Prefer mocked fetch-based tests for normal verification. Use real GenAuth/GUMem/WebAgent services only for explicit smoke tests, and never hard-code real secrets in repository files.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "Qoni SDK"
|
|
3
3
|
short_description: "Integrate Qoni SDK delegation and product APIs"
|
|
4
|
-
default_prompt: "Use $qoni-sdk to build or debug a Node.js @qoniai/qoni integration with
|
|
4
|
+
default_prompt: "Use $qoni-sdk to build or debug a Node.js @qoniai/qoni integration with Qoni, delegateToken, runtime-config discovery, and GUMem/WebAgent product calls."
|