@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qoniai/qoni",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Unified Node.js SDK for Qoni Agent delegation, GUMem memory, and WebAgent automation.",
5
5
  "homepage": "https://github.com/QONIAI/qoni-sdk-node#readme",
6
6
  "bugs": {
@@ -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, QoniAgentKit/Qoni, 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.
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 `QoniAgentKit`. 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`.
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 { QoniAgentKit, QoniScopes } from "@qoniai/qoni";
21
+ import { Qoni, QoniScopes } from "@qoniai/qoni";
22
22
 
23
- const qoni = new QoniAgentKit({
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
- `Qoni` is a short alias for `QoniAgentKit`. `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.
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 `QoniAgentKit`, 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`.
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 QoniAgentKit, delegateToken, runtime-config discovery, and GUMem/WebAgent product calls."
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."