@pouchy_ai/admin-sdk 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 +28 -0
- package/README.md +2 -2
- package/dist/index.d.ts +52 -31
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@pouchy_ai/admin-sdk` are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.4.1 — 2026-07-16
|
|
6
|
+
|
|
7
|
+
Type-shape corrections — several method signatures had drifted from the live
|
|
8
|
+
`/v1/admin` routes, so a caller trusting the types built request bodies the
|
|
9
|
+
server rejects or read response fields that don't exist. No runtime code
|
|
10
|
+
changed (the client is a generic proxy); these are type + doc fixes.
|
|
11
|
+
|
|
12
|
+
- **`createSchedule`** now requires `externalUserId` + `prompt` alongside
|
|
13
|
+
`agentId` and schedules by `intervalMinutes`/`runAt` — the old `{ agentId,
|
|
14
|
+
cron, prompt? }` was unusable (there is no `cron` field; the server 400s
|
|
15
|
+
without `externalUserId`). Return is `{ schedule: { id } }` (was
|
|
16
|
+
`scheduleId`).
|
|
17
|
+
- **`ingestKnowledge`** input is `{ text, name?, kind?, locale? }` — the old
|
|
18
|
+
`title`/`url` fields were silently ignored by the server.
|
|
19
|
+
- **`getUserWallet`** returns `{ hasWallet, balance: string | null }` (a prose
|
|
20
|
+
balance string), not `{ balance: number, address }`.
|
|
21
|
+
- **`createKey`** returns `{ key: string, record }` (plaintext token in `key`);
|
|
22
|
+
the README example logged the nonexistent `key.token`.
|
|
23
|
+
- **`getUsage`** returns `{ usage }` and **`getBilling`** returns `{ billing,
|
|
24
|
+
ledger }` (both were typed flat); the README `usage.mau` example is fixed.
|
|
25
|
+
- **Channels** methods return `connector`/`connectors` (was `channel`), and
|
|
26
|
+
`deleteChannel`/`deleteSchedule` return `{ ok }` (was `{ deleted }`).
|
|
27
|
+
- **`listUsers`** params are `{ external_user_id?, external_user_prefix? }`
|
|
28
|
+
(the old `{ q, limit }` were no-ops; the server hard-caps at 100).
|
|
29
|
+
- **`updateSkill`** generic return is `Record<string, unknown>` (it echoes only
|
|
30
|
+
the changed knob) — prefer the typed `setSkillRate`/`setSkillDailyCap`/
|
|
31
|
+
`grantSkill` conveniences, which were already correct.
|
|
32
|
+
|
|
5
33
|
## 0.4.0 — 2026-07-13
|
|
6
34
|
|
|
7
35
|
Full skill-lifecycle parity — the two knobs the dashboard grew (a runaway
|
package/README.md
CHANGED
|
@@ -35,10 +35,10 @@ await admin.updateAgent(agent.agentId, { status: 'published' });
|
|
|
35
35
|
|
|
36
36
|
// Mint a secret key for your backend to open end-user sessions with
|
|
37
37
|
const { key } = await admin.createKey({ label: 'prod-backend', env: 'live' });
|
|
38
|
-
console.log(key
|
|
38
|
+
console.log(key); // the plaintext token — shown ONCE
|
|
39
39
|
|
|
40
40
|
// Read this month's usage
|
|
41
|
-
const usage = await admin.getUsage();
|
|
41
|
+
const { usage } = await admin.getUsage();
|
|
42
42
|
console.log(usage.mau, '/', usage.mauLimit, 'MAU');
|
|
43
43
|
|
|
44
44
|
// Equip an agent with ANY skill — including a docs-only skill.md that has no
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const ADMIN_SDK_VERSION = "0.4.
|
|
1
|
+
export declare const ADMIN_SDK_VERSION = "0.4.1";
|
|
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. */
|
|
@@ -127,15 +127,14 @@ export interface AdminClient {
|
|
|
127
127
|
listKeys(): Promise<{
|
|
128
128
|
keys: SecretKey[];
|
|
129
129
|
}>;
|
|
130
|
+
/** Mint a secret key. `key` is the plaintext token, returned ONCE; `record`
|
|
131
|
+
* is the stored metadata (no plaintext). */
|
|
130
132
|
createKey(input: {
|
|
131
133
|
label?: string;
|
|
132
134
|
env?: Env;
|
|
133
135
|
}): Promise<{
|
|
134
|
-
key:
|
|
135
|
-
|
|
136
|
-
token: string;
|
|
137
|
-
env: Env;
|
|
138
|
-
};
|
|
136
|
+
key: string;
|
|
137
|
+
record: SecretKey;
|
|
139
138
|
}>;
|
|
140
139
|
revokeKey(keyId: string): Promise<{
|
|
141
140
|
revoked: boolean;
|
|
@@ -152,9 +151,11 @@ export interface AdminClient {
|
|
|
152
151
|
graceUntil: string | null;
|
|
153
152
|
};
|
|
154
153
|
}>;
|
|
154
|
+
/** List end-user instances. Filter by exact external id or by prefix (the
|
|
155
|
+
* server ignores any other query param and hard-caps the page at 100). */
|
|
155
156
|
listUsers(params?: {
|
|
156
|
-
|
|
157
|
-
|
|
157
|
+
external_user_id?: string;
|
|
158
|
+
external_user_prefix?: string;
|
|
158
159
|
}): Promise<{
|
|
159
160
|
users: Instance[];
|
|
160
161
|
}>;
|
|
@@ -164,9 +165,12 @@ export interface AdminClient {
|
|
|
164
165
|
deleteUser(instanceId: string): Promise<{
|
|
165
166
|
deleted: boolean;
|
|
166
167
|
}>;
|
|
168
|
+
/** The instance companion's wallet. `balance` is a human-readable prose
|
|
169
|
+
* string (e.g. "Wallet balance: … (~$X total)."), or null when the instance
|
|
170
|
+
* has no wallet — NOT a number, and there is no address field. */
|
|
167
171
|
getUserWallet(instanceId: string): Promise<{
|
|
168
|
-
|
|
169
|
-
|
|
172
|
+
hasWallet: boolean;
|
|
173
|
+
balance: string | null;
|
|
170
174
|
}>;
|
|
171
175
|
getUserTraces(instanceId: string): Promise<{
|
|
172
176
|
traces: unknown[];
|
|
@@ -199,10 +203,13 @@ export interface AdminClient {
|
|
|
199
203
|
listKnowledge(): Promise<{
|
|
200
204
|
docs: unknown[];
|
|
201
205
|
}>;
|
|
206
|
+
/** Ingest a knowledge doc. `text` is required; `name`/`kind`/`locale` are the
|
|
207
|
+
* server's fields (an earlier `title`/`url` shape was silently ignored). */
|
|
202
208
|
ingestKnowledge(input: {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
209
|
+
text: string;
|
|
210
|
+
name?: string;
|
|
211
|
+
kind?: string;
|
|
212
|
+
locale?: string;
|
|
206
213
|
}): Promise<{
|
|
207
214
|
doc: {
|
|
208
215
|
docId: string;
|
|
@@ -228,11 +235,12 @@ export interface AdminClient {
|
|
|
228
235
|
version: number;
|
|
229
236
|
};
|
|
230
237
|
}>;
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
238
|
+
/** Generic PATCH of a skill's knobs. The response echoes only the knob(s)
|
|
239
|
+
* you changed (e.g. `{ ratePerMin }`, `{ maxCallsPerDay, reprovisioned }`,
|
|
240
|
+
* `{ freeHttp, grantedDomains, reprovisioned }`) — prefer the typed
|
|
241
|
+
* conveniences (setSkillRate / setSkillDailyCap / grantSkill) for a precise
|
|
242
|
+
* return type. */
|
|
243
|
+
updateSkill(slug: string, patch: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
236
244
|
/** Set a skill's per-minute call budget (1..120; null restores the default). */
|
|
237
245
|
setSkillRate(slug: string, ratePerMin: number | null): Promise<{
|
|
238
246
|
ratePerMin: number | null;
|
|
@@ -286,37 +294,44 @@ export interface AdminClient {
|
|
|
286
294
|
deleted: boolean;
|
|
287
295
|
}>;
|
|
288
296
|
listChannels(): Promise<{
|
|
289
|
-
|
|
297
|
+
connectors: unknown[];
|
|
290
298
|
}>;
|
|
291
299
|
createChannel(input: {
|
|
292
300
|
type: string;
|
|
293
301
|
agentId: string;
|
|
294
302
|
config?: Record<string, unknown>;
|
|
295
303
|
}): Promise<{
|
|
296
|
-
|
|
304
|
+
connector: {
|
|
297
305
|
id: string;
|
|
298
306
|
};
|
|
299
307
|
inboundUrl: string;
|
|
300
308
|
}>;
|
|
301
309
|
getChannel(channelId: string): Promise<{
|
|
302
|
-
|
|
310
|
+
connector: unknown;
|
|
303
311
|
}>;
|
|
304
312
|
updateChannel(channelId: string, patch: Record<string, unknown>): Promise<{
|
|
305
|
-
|
|
313
|
+
connector: unknown;
|
|
306
314
|
}>;
|
|
307
315
|
deleteChannel(channelId: string): Promise<{
|
|
308
|
-
|
|
316
|
+
ok: boolean;
|
|
309
317
|
}>;
|
|
310
318
|
listSchedules(): Promise<{
|
|
311
319
|
schedules: unknown[];
|
|
312
320
|
}>;
|
|
321
|
+
/** 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`. */
|
|
313
325
|
createSchedule(input: {
|
|
314
326
|
agentId: string;
|
|
315
|
-
|
|
316
|
-
prompt
|
|
327
|
+
externalUserId: string;
|
|
328
|
+
prompt: string;
|
|
329
|
+
intervalMinutes?: number;
|
|
330
|
+
runAt?: string;
|
|
331
|
+
deliverTo?: unknown;
|
|
317
332
|
}): Promise<{
|
|
318
333
|
schedule: {
|
|
319
|
-
|
|
334
|
+
id: string;
|
|
320
335
|
};
|
|
321
336
|
}>;
|
|
322
337
|
getSchedule(scheduleId: string): Promise<{
|
|
@@ -326,7 +341,7 @@ export interface AdminClient {
|
|
|
326
341
|
schedule: unknown;
|
|
327
342
|
}>;
|
|
328
343
|
deleteSchedule(scheduleId: string): Promise<{
|
|
329
|
-
|
|
344
|
+
ok: boolean;
|
|
330
345
|
}>;
|
|
331
346
|
listWebhooks(): Promise<{
|
|
332
347
|
webhooks: unknown[];
|
|
@@ -363,11 +378,17 @@ export interface AdminClient {
|
|
|
363
378
|
testWebhook(webhookId: string): Promise<DeliveryOutcome>;
|
|
364
379
|
/** Manually re-send a recorded delivery's original body, re-signed. */
|
|
365
380
|
redeliverWebhook(deliveryId: string): Promise<DeliveryOutcome>;
|
|
366
|
-
getUsage(): Promise<
|
|
381
|
+
getUsage(): Promise<{
|
|
382
|
+
usage: MonthUsage;
|
|
383
|
+
}>;
|
|
367
384
|
getBilling(): Promise<{
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
385
|
+
billing: {
|
|
386
|
+
plan: string;
|
|
387
|
+
effectivePlan: string;
|
|
388
|
+
mauLimit: number;
|
|
389
|
+
periodEnd?: string;
|
|
390
|
+
};
|
|
391
|
+
ledger: unknown;
|
|
371
392
|
}>;
|
|
372
393
|
getTracesSummary(params?: {
|
|
373
394
|
agentId?: string;
|
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.
|
|
11
|
+
export const ADMIN_SDK_VERSION = '0.4.1';
|
|
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. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pouchy_ai/admin-sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
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",
|