@pouchy_ai/admin-sdk 0.4.1 → 0.4.2

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,36 @@
2
2
 
3
3
  All notable changes to `@pouchy_ai/admin-sdk` are documented here.
4
4
 
5
+ ## 0.4.2 — 2026-07-16
6
+
7
+ The rest of the 0.4.1 drift class — four more response/input shapes that lied
8
+ about the live routes, caught by comparing every method against its
9
+ `/v1/admin` handler. Type + doc fixes only (the client is a generic proxy).
10
+
11
+ - **`listCredentials`** returns `{ enabled, skills }` (vault status + which
12
+ skill slugs hold credentials) — the old `{ credentials }` key never existed,
13
+ so `res.credentials` was always `undefined`. `putCredentials` returns
14
+ `{ ok, skill, entries }`.
15
+ - **`updateProject`** returns what changed — `{ renamed?, name?, archived? }` —
16
+ not `{ project: { projectId } }` (that key never existed on PATCH).
17
+ - **`createSchedule.runAt`** is **epoch milliseconds** (number), not an ISO
18
+ string — the server type-checks `typeof runAt === 'number'` and silently
19
+ drops a string (your "one-shot" 400s, or becomes recurring if
20
+ `intervalMinutes` was also set). Input also gains the server's `env?`.
21
+ - **`SecretKey.displayPrefix`** — the stored-key metadata field is
22
+ `displayPrefix`, not `prefix` (affects `listKeys`/`createKey`/`rotateKey`
23
+ consumers); `lastUsedAt`/`revokedAt` marked optional as stored.
24
+ - **`getTracesSummary`** now requires `agentId` — the server 400s without it,
25
+ so the old all-optional signature compiled calls that always fail.
26
+ - **`createChannel`** input gains `env?` + `secret?` (connector credentials) —
27
+ the closed object literal blocked fields the server accepts, so test-env /
28
+ secret-bearing connectors were unreachable through the typed method.
29
+ - **`getBilling().billing.periodEnd`** is `string | null` (always present).
30
+
31
+ Also in this release: `GET /v1/admin/openapi` (the machine-readable spec this
32
+ SDK mirrors) was rewritten against the live routes — it still described the
33
+ pre-0.4.1 contract, so generated clients inherited every bug above.
34
+
5
35
  ## 0.4.1 — 2026-07-16
6
36
 
7
37
  Type-shape corrections — several method signatures had drifted from the live
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const ADMIN_SDK_VERSION = "0.4.1";
1
+ export declare const ADMIN_SDK_VERSION = "0.4.2";
2
2
  export declare const DEFAULT_BASE_URL = "https://pouchy.ai/v1/admin";
3
3
  export interface AdminClientOptions {
4
4
  /** A project Admin key (`pchy_admin_…`) from the dashboard Admin Keys page. */
@@ -32,10 +32,13 @@ export interface SecretKey {
32
32
  keyId: string;
33
33
  label: string;
34
34
  env: Env;
35
- prefix: string;
35
+ /** The key's display prefix (e.g. `pchy_live_ab12…`) — the server never
36
+ * returns the plaintext after mint. */
37
+ displayPrefix: string;
36
38
  createdAt: string;
37
- lastUsedAt: string | null;
38
- revokedAt: string | null;
39
+ lastUsedAt?: string | null;
40
+ revokedAt?: string | null;
41
+ [k: string]: unknown;
39
42
  }
40
43
  export interface Instance {
41
44
  instanceId: string;
@@ -75,6 +78,8 @@ export interface CatalogVoice {
75
78
  previewUrl?: string;
76
79
  /** Present on tagged rows; filter with listVoices({ gender }). */
77
80
  gender?: 'female' | 'male' | 'neutral';
81
+ /** Present on tagged rows; filter with listVoices({ age }). */
82
+ age?: 'young' | 'middle_aged' | 'old';
78
83
  /** Locales this voice suits; ABSENT = unrestricted. */
79
84
  locales?: string[];
80
85
  }
@@ -281,14 +286,20 @@ export interface AdminClient {
281
286
  uninstallSkill(slug: string): Promise<{
282
287
  deleted: boolean;
283
288
  }>;
289
+ /** Secret-free vault metadata: `enabled` says whether the deployment has a
290
+ * vault at all; `skills` lists which skill slugs hold credentials (values
291
+ * are never returned by any endpoint). */
284
292
  listCredentials(): Promise<{
285
- credentials: unknown[];
293
+ enabled: boolean;
294
+ skills: unknown[];
286
295
  }>;
287
296
  putCredentials(input: {
288
297
  skill: string;
289
298
  credentials: Record<string, unknown>;
290
299
  }): Promise<{
291
300
  ok: boolean;
301
+ skill: string;
302
+ entries: number;
292
303
  }>;
293
304
  deleteCredentials(skill: string): Promise<{
294
305
  deleted: boolean;
@@ -299,7 +310,11 @@ export interface AdminClient {
299
310
  createChannel(input: {
300
311
  type: string;
301
312
  agentId: string;
313
+ env?: Env;
302
314
  config?: Record<string, unknown>;
315
+ /** Connector credentials (bot token, signing secret, …) — stored
316
+ * encrypted, never returned. */
317
+ secret?: Record<string, unknown>;
303
318
  }): Promise<{
304
319
  connector: {
305
320
  id: string;
@@ -319,15 +334,17 @@ export interface AdminClient {
319
334
  schedules: unknown[];
320
335
  }>;
321
336
  /** Create a schedule. `externalUserId` and `prompt` are required alongside
322
- * `agentId`; the schedule fires by `intervalMinutes` (recurring) or `runAt`
323
- * (one-shot ISO time)there is NO cron field. Returns the stored record,
324
- * whose id lives on `.id`. */
337
+ * `agentId`; the schedule fires by `intervalMinutes` (recurring, >=5) or
338
+ * `runAt` (one-shot **epoch milliseconds**an ISO string is silently
339
+ * ignored by the server) there is NO cron field. Returns the stored
340
+ * record, whose id lives on `.id`. */
325
341
  createSchedule(input: {
326
342
  agentId: string;
327
343
  externalUserId: string;
328
344
  prompt: string;
329
345
  intervalMinutes?: number;
330
- runAt?: string;
346
+ runAt?: number;
347
+ env?: Env;
331
348
  deliverTo?: unknown;
332
349
  }): Promise<{
333
350
  schedule: {
@@ -386,12 +403,14 @@ export interface AdminClient {
386
403
  plan: string;
387
404
  effectivePlan: string;
388
405
  mauLimit: number;
389
- periodEnd?: string;
406
+ periodEnd: string | null;
390
407
  };
391
408
  ledger: unknown;
392
409
  }>;
393
- getTracesSummary(params?: {
394
- agentId?: string;
410
+ /** Aggregate trace analytics. `agentId` is REQUIRED — the server 400s
411
+ * without it. */
412
+ getTracesSummary(params: {
413
+ agentId: string;
395
414
  sinceHours?: number;
396
415
  }): Promise<Record<string, unknown>>;
397
416
  /** Recent run rows project-wide (the failed-run browser). */
@@ -403,11 +422,12 @@ export interface AdminClient {
403
422
  }): Promise<{
404
423
  traces: RecentTrace[];
405
424
  }>;
406
- /** Enabled platform voices for programmatic provisioning. Filter by gender
407
- * (explicitly tagged rows only) and/or locale (rows listing it, or with no
408
- * locale list = unrestricted). */
425
+ /** Enabled platform voices for programmatic provisioning. Filter by gender /
426
+ * age (explicitly tagged rows only) and/or locale (rows listing it, or with
427
+ * no locale list = unrestricted). */
409
428
  listVoices(params?: {
410
429
  gender?: 'female' | 'male' | 'neutral';
430
+ age?: 'young' | 'middle_aged' | 'old';
411
431
  locale?: string;
412
432
  }): Promise<{
413
433
  voices: CatalogVoice[];
@@ -424,13 +444,15 @@ export interface AdminClient {
424
444
  archived?: boolean;
425
445
  };
426
446
  }>;
447
+ /** Rename / archive the project. The response echoes only what changed —
448
+ * `{ renamed, name }` and/or `{ archived }` — there is no `project` key. */
427
449
  updateProject(patch: {
428
450
  name?: string;
429
451
  archived?: boolean;
430
452
  }): Promise<{
431
- project: {
432
- projectId: string;
433
- };
453
+ renamed?: boolean;
454
+ name?: string;
455
+ archived?: boolean;
434
456
  }>;
435
457
  /** Escape hatch: call any endpoint the typed methods don't cover yet. */
436
458
  request<T = unknown>(method: string, path: string, body?: unknown): Promise<T>;
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.4.1';
11
+ export const ADMIN_SDK_VERSION = '0.4.2';
12
12
  export const DEFAULT_BASE_URL = 'https://pouchy.ai/v1/admin';
13
13
  /** Thrown on any non-2xx response. `status` is the HTTP status; `message` is the
14
14
  * server's `error` string when present. */
@@ -104,7 +104,7 @@ export function createAdminClient(opts) {
104
104
  redeliverWebhook: (id) => request('POST', `/webhooks/deliveries/${encodeURIComponent(id)}/redeliver`),
105
105
  getUsage: () => request('GET', '/usage'),
106
106
  getBilling: () => request('GET', '/billing'),
107
- getTracesSummary: (params = {}) => request('GET', `/traces/summary${qs(params)}`),
107
+ getTracesSummary: (params) => request('GET', `/traces/summary${qs(params)}`),
108
108
  getRecentTraces: (params = {}) => request('GET', `/traces/recent${qs({ ...params, errorsOnly: params.errorsOnly ? '1' : undefined })}`),
109
109
  listVoices: (params = {}) => request('GET', `/voice-catalog${qs(params)}`),
110
110
  getLogs: (params = {}) => request('GET', `/logs${qs(params)}`),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pouchy_ai/admin-sdk",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Typed TypeScript client for the Pouchy Admin API — 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",