@pouchy_ai/admin-sdk 0.38.0 → 0.39.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 +12 -0
- package/README.md +1 -1
- package/dist/index.d.ts +21 -6
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@pouchy_ai/admin-sdk` are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.39.0 — 2026-09-26
|
|
6
|
+
|
|
7
|
+
- **`getUserWallet()` now types the figures, and a failed read throws.**
|
|
8
|
+
Admin API 1.18.0 returns `balances` (`{ currency, amount }[]`, decimal
|
|
9
|
+
strings) and `totalUsd` beside the prose `balance`, typed here as the new
|
|
10
|
+
exported `UserWallet`. Both fields are optional because an older server does
|
|
11
|
+
not send them. Before 1.18.0, a wallet service that could not be read
|
|
12
|
+
answered 200 `{ hasWallet: true, balance: "Could not fetch the wallet balance
|
|
13
|
+
right now." }`, which looked like a balance. The server now answers 503, so
|
|
14
|
+
the call throws an `AdminApiError` with `status: 503`; retry it.
|
|
15
|
+
`balance` is unchanged, so code that displays it keeps working.
|
|
16
|
+
|
|
5
17
|
## 0.38.0 — 2026-09-25
|
|
6
18
|
|
|
7
19
|
- **`ADMIN_ERROR_CODES` gains `subscription_exists`** (409). `POST
|
package/README.md
CHANGED
|
@@ -465,7 +465,7 @@ Reads (`GET`) are not covered by that bucket. `retryAfter` is available from
|
|
|
465
465
|
| Agent versions | `listAgentVersions` · `getAgentVersion` · `diffAgentVersions({ from?, to? })` · `rollbackAgent` · `getAgentPromotion` · `promoteAgent` (staging→prod) |
|
|
466
466
|
| Voices | `listVoices({ gender?, age?, locale? })` — catalog for programmatic voice selection (each `CatalogVoice` carries `age`) |
|
|
467
467
|
| Secret keys | `listKeys` · `createKey` · `revokeKey` · `rotateKey` (24 h grace) |
|
|
468
|
-
| End users | `listUsers({ limit?, cursor? })` (cursor-paginated — the response's `nextCursor` feeds the next page; filter variants: `external_user_id` / `external_user_prefix`) · `setUserSuspended` · `deleteUser` · `getUserWallet` · `getUserTraces` · `importUsers` · `exportUser` · `getUserSessions` · `getUserTurns` |
|
|
468
|
+
| End users | `listUsers({ limit?, cursor? })` (cursor-paginated — the response's `nextCursor` feeds the next page; filter variants: `external_user_id` / `external_user_prefix`) · `setUserSuspended` · `deleteUser` · `getUserWallet` (`balances` / `totalUsd` for the figures; `balance` is prose) · `getUserTraces` · `importUsers` · `exportUser` · `getUserSessions` · `getUserTurns` |
|
|
469
469
|
| Knowledge | `listKnowledge` · `ingestKnowledge` · `ingestKnowledgeFile` (PDF/audio/video/image) · `ingestKnowledgeUrl` (web page) · `searchKnowledge` (recall probe) · `deleteKnowledge` |
|
|
470
470
|
| Skills | `listSkills` · `installSkill` · `updateSkill` · `setSkillRate` · `setSkillDailyCap` · `grantSkill` (free-HTTP) · `setSkillAutoRunTools` (免确认工具 — required to arm an MCP skill on an instance) · `compileSkill` (prose→tools) · `uninstallSkill` · `importAgentPlugin` / `exportAgentPlugin` (Agent Plugins 1.0.0 interop) |
|
|
471
471
|
| Credentials | `listCredentials` · `putCredentials` · `deleteCredentials` |
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const ADMIN_SDK_VERSION = "0.
|
|
1
|
+
export declare const ADMIN_SDK_VERSION = "0.39.0";
|
|
2
2
|
export declare const DEFAULT_BASE_URL = "https://pouchy.ai/v1/admin";
|
|
3
3
|
/** Deadline for the routes whose server handler declares `maxDuration: 300` —
|
|
4
4
|
* the server's own ceiling plus headroom, so a client abort can only ever mean
|
|
@@ -325,6 +325,22 @@ export interface UsageCreditEnforcement {
|
|
|
325
325
|
* running on `standard`; a free-plan ceiling refuses NEW sessions). */
|
|
326
326
|
effect: string;
|
|
327
327
|
}
|
|
328
|
+
/** One end user's wallet, as `getUserWallet` returns it. */
|
|
329
|
+
export interface UserWallet {
|
|
330
|
+
hasWallet: boolean;
|
|
331
|
+
/** Human-readable prose, or null when there is no wallet. NOT a number. */
|
|
332
|
+
balance: string | null;
|
|
333
|
+
/** Nonzero per-currency balances; `amount` is a decimal string such as
|
|
334
|
+
* "5.83", never atomic units. Admin API 1.18.0+, present when
|
|
335
|
+
* `hasWallet` is true. */
|
|
336
|
+
balances?: {
|
|
337
|
+
currency: string;
|
|
338
|
+
amount: string;
|
|
339
|
+
}[];
|
|
340
|
+
/** USD total (the allowed stablecoins are USD-pegged 1:1). Admin API
|
|
341
|
+
* 1.18.0+, present when `hasWallet` is true. */
|
|
342
|
+
totalUsd?: number;
|
|
343
|
+
}
|
|
328
344
|
/** The credit meter with both scopes named (admin API 1.14.0+). Read this, not
|
|
329
345
|
* `usage.credits / usage.creditLimit`: that divides THIS project's figure by
|
|
330
346
|
* the ACCOUNT's allowance and understates consumption on any multi-project
|
|
@@ -655,11 +671,10 @@ export interface AdminClient {
|
|
|
655
671
|
}>;
|
|
656
672
|
/** The instance companion's wallet. `balance` is a human-readable prose
|
|
657
673
|
* string (e.g. "Wallet balance: … (~$X total)."), or null when the instance
|
|
658
|
-
* has no wallet — NOT a number, and there is no address field.
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
}>;
|
|
674
|
+
* has no wallet — NOT a number, and there is no address field. Read
|
|
675
|
+
* `balances` / `totalUsd` for the figures (admin API 1.18.0; absent from an
|
|
676
|
+
* older server). A wallet service that cannot be read throws a 503. */
|
|
677
|
+
getUserWallet(instanceId: string): Promise<UserWallet>;
|
|
663
678
|
getUserTraces(instanceId: string): Promise<{
|
|
664
679
|
traces: unknown[];
|
|
665
680
|
}>;
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// import { createAdminClient } from '@pouchy_ai/admin-sdk';
|
|
9
9
|
// const admin = createAdminClient({ adminKey: process.env.POUCHY_ADMIN_KEY! });
|
|
10
10
|
// const { agents } = await admin.listAgents();
|
|
11
|
-
export const ADMIN_SDK_VERSION = '0.
|
|
11
|
+
export const ADMIN_SDK_VERSION = '0.39.0';
|
|
12
12
|
export const DEFAULT_BASE_URL = 'https://pouchy.ai/v1/admin';
|
|
13
13
|
/** Default per-request timeout (ms). A hung upstream otherwise never rejects. */
|
|
14
14
|
const DEFAULT_TIMEOUT_MS = 30_000;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pouchy_ai/admin-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.0",
|
|
4
4
|
"description": "Typed TypeScript client for the Pouchy Admin API \u2014 manage agents, keys, end users, knowledge, skills, channels, schedules, webhooks and credentials headlessly, with a project Admin key.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|