@pouchy_ai/admin-sdk 0.39.0 → 0.39.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 CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  All notable changes to `@pouchy_ai/admin-sdk` are documented here.
4
4
 
5
+ ## 0.39.1 — 2026-09-28
6
+
7
+ Type corrections. The server's responses did not change; three return types
8
+ described fields it never sent (CR-1101).
9
+
10
+ - **`importUsers()`: `invalid` is a number**, the count of ids refused for
11
+ their shape, not `string[]`. Code that called `res.invalid.join()` threw.
12
+ The type also gains `requested` and `env`, which the server always sent.
13
+ - **`promoteAgent()` returns `{ prodRev, stagingRev }`.** It was typed
14
+ `{ prodRev, templateRev }`, so `templateRev` was always `undefined`.
15
+ - **`getRecentTraces()` types `degraded`** (`false | 'index' | 'error'`), plus
16
+ `sinceHours` and `window`. When `degraded` is not `false` the read failed,
17
+ and an empty `traces` does NOT mean "no runs".
18
+
19
+ If your code relied on the old types, the compiler will now point at it. Each
20
+ of those reads was already wrong at runtime.
21
+
5
22
  ## 0.39.0 — 2026-09-26
6
23
 
7
24
  - **`getUserWallet()` now types the figures, and a failed read throws.**
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const ADMIN_SDK_VERSION = "0.39.0";
1
+ export declare const ADMIN_SDK_VERSION = "0.39.1";
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
@@ -617,10 +617,12 @@ export interface AdminClient {
617
617
  }>;
618
618
  /** Promote the head to production: freezes the head as an archived version and
619
619
  * pins prodRev WITHOUT bumping the rev. Live instances re-resolve on their
620
- * next mint; test instances always run the head. */
620
+ * next mint; test instances always run the head. `stagingRev` equals
621
+ * `prodRev` right after a promote (0.39.1: this was typed `templateRev`,
622
+ * which the server never sent). */
621
623
  promoteAgent(agentId: string): Promise<{
622
624
  prodRev: number;
623
- templateRev: number;
625
+ stagingRev: number;
624
626
  }>;
625
627
  listKeys(): Promise<{
626
628
  keys: SecretKey[];
@@ -679,15 +681,19 @@ export interface AdminClient {
679
681
  traces: unknown[];
680
682
  }>;
681
683
  /** Batch-import end users from your own id list (idempotent per external id;
682
- * never meters MAU — imported users bill only when they actually mint). */
684
+ * never meters MAU — imported users bill only when they actually mint).
685
+ * `invalid` is a COUNT of ids refused for their shape (0.39.1: it was typed
686
+ * `string[]`, so `res.invalid.join()` threw). */
683
687
  importUsers(input: {
684
688
  externalUserIds: string[] | string;
685
689
  agentId?: string;
686
690
  env?: Env;
687
691
  }): Promise<{
692
+ requested: number;
688
693
  created: number;
689
694
  skipped: number;
690
- invalid: string[];
695
+ env: Env;
696
+ invalid: number;
691
697
  }>;
692
698
  /** GDPR data-portability export: registry, character state, memories, contacts. */
693
699
  exportUser(instanceId: string): Promise<Record<string, unknown>>;
@@ -1441,13 +1447,21 @@ export interface AdminClient {
1441
1447
  agentId: string;
1442
1448
  sinceHours?: number;
1443
1449
  }): Promise<Record<string, unknown>>;
1444
- /** Recent run rows project-wide (the failed-run browser). */
1450
+ /** Recent run rows project-wide (the failed-run browser). `degraded` other
1451
+ * than `false` means the READ failed (`'index'` a missing index, `'error'`
1452
+ * a fault): an empty `traces` is then NOT "no runs" and must not be shown as
1453
+ * one (0.39.1: the field was missing from this type). */
1445
1454
  getRecentTraces(params?: {
1446
1455
  agentId?: string;
1447
1456
  sinceHours?: number;
1448
1457
  errorsOnly?: boolean;
1449
1458
  limit?: number;
1450
1459
  }): Promise<{
1460
+ sinceHours: number;
1461
+ window: {
1462
+ sinceMs: number;
1463
+ };
1464
+ degraded: false | 'index' | 'error';
1451
1465
  traces: RecentTrace[];
1452
1466
  }>;
1453
1467
  /** Enabled platform voices for programmatic provisioning. Filter by gender /
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.39.0';
11
+ export const ADMIN_SDK_VERSION = '0.39.1';
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.39.0",
3
+ "version": "0.39.1",
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",