@pouchy_ai/admin-sdk 0.23.0 → 0.24.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 +30 -0
- package/dist/index.d.ts +39 -1
- package/dist/index.js +2 -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.24.1 — 2026-08-08
|
|
6
|
+
|
|
7
|
+
- **Docs-only correction for `synthesizeSpeech`** (no code change): the rate
|
|
8
|
+
limit on `/v1/admin/utility/tts` is the shared **per-IP** utility bucket,
|
|
9
|
+
not per-project — the 0.24.0 notes (and the README/docstring) claimed
|
|
10
|
+
per-project keying the server never had (CR-404). Also documents that
|
|
11
|
+
`unavailable` (503) now additionally covers a temporarily unreachable voice
|
|
12
|
+
catalog (retry), and that a `model` from the other provider's namespace is
|
|
13
|
+
silently ignored in favour of the provider default (server-side CR-404/
|
|
14
|
+
CR-410 fixes; an unknown model within the right namespace still surfaces as
|
|
15
|
+
`provider_error` 502).
|
|
16
|
+
|
|
17
|
+
## 0.24.0 — 2026-08-08
|
|
18
|
+
|
|
19
|
+
- **New method `synthesizeSpeech`** (additive; nothing renamed or removed):
|
|
20
|
+
`POST /v1/admin/utility/tts`. Text → a spoken-audio mp3 FILE, OUTSIDE the
|
|
21
|
+
companion and OUTSIDE a realtime `/call` — the audio sibling of `extractJson`.
|
|
22
|
+
Stateless (no session, no persona, no memory); the voice is a catalog id
|
|
23
|
+
(`std_…` / `hd_…`) or `providerVoiceId` from `listVoices()`, the same id used
|
|
24
|
+
for a call's voice, restricted to enabled catalog rows + the built-in OpenAI
|
|
25
|
+
roster. Returns `{ data: { audioBase64, mimeType, format, voiceId, provider,
|
|
26
|
+
model }, usage: { characterCount } }`; failures are typed
|
|
27
|
+
(`voice_not_found`, `text_too_long`, `unsupported_format`, `unavailable`,
|
|
28
|
+
`provider_error`). Synthesis bills on your provider account like the other
|
|
29
|
+
voice planes — no separate platform credit rate; bounded by an input cap +
|
|
30
|
+
a rate limit (documented at release as per-project; corrected in 0.24.1 —
|
|
31
|
+
the bucket keys per client IP).
|
|
32
|
+
|
|
5
33
|
## 0.23.0 — 2026-08-08
|
|
6
34
|
|
|
7
35
|
- **`ChannelTransportType` grows 6 members** (additive; nothing renamed or
|
package/README.md
CHANGED
|
@@ -153,6 +153,35 @@ completion arrived but did not parse or satisfy the schema; the error carries
|
|
|
153
153
|
`raw`, the text actually returned). Tokens roll into the project's month usage
|
|
154
154
|
like any other model call.
|
|
155
155
|
|
|
156
|
+
### Spoken audio — use `synthesizeSpeech`, not `/call`
|
|
157
|
+
|
|
158
|
+
The audio sibling of `extractJson`: text → a downloadable **mp3 file**, OUTSIDE
|
|
159
|
+
the companion and OUTSIDE a realtime call. `/call` is live ConvAI (a WebRTC
|
|
160
|
+
session); when you need an audio **file** for a headless / Ops job — a reference
|
|
161
|
+
clip for a downstream video / lip-sync API, a pre-rendered notification — this
|
|
162
|
+
is the stateless path.
|
|
163
|
+
|
|
164
|
+
```ts
|
|
165
|
+
const { data, usage } = await admin.synthesizeSpeech({
|
|
166
|
+
text: 'Hey — just wanted to share this moment with you.',
|
|
167
|
+
voice: 'hd_ByhETIclHirOlWnWKhHc' // a catalog id OR providerVoiceId from listVoices()
|
|
168
|
+
});
|
|
169
|
+
// data.audioBase64 is the mp3 — decode and persist it (never hand a provider URL
|
|
170
|
+
// to a client). In Node: Buffer.from(data.audioBase64, 'base64'); in a browser:
|
|
171
|
+
// Uint8Array.from(atob(data.audioBase64), (c) => c.charCodeAt(0)).
|
|
172
|
+
console.log(data.mimeType, data.voiceId, data.provider, usage.characterCount);
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
`voice` is the **same id you pass to a call's voice** (from `listVoices()`),
|
|
176
|
+
restricted to enabled catalog rows plus the built-in OpenAI roster — so the Ops
|
|
177
|
+
sample and the live call use one authoritative voice. Only `mp3` is produced in
|
|
178
|
+
v1. Failures are typed: `voice_not_found` (404), `text_too_long` (413),
|
|
179
|
+
`unsupported_format` (400), `unavailable` (503 — no TTS provider configured for
|
|
180
|
+
that voice, or the voice catalog is temporarily unreachable; retry),
|
|
181
|
+
`provider_error` (502). Synthesis bills on your provider account
|
|
182
|
+
like the other voice planes — there is no separate platform credit rate; it is
|
|
183
|
+
bounded by an input cap and the shared per-IP utility rate limit.
|
|
184
|
+
|
|
156
185
|
Every skill knob (`setSkillRate`, `setSkillDailyCap`, `grantSkill`) returns
|
|
157
186
|
`SkillKnobResult<T>` — the knob you set plus `reprovisioned` (instances the new
|
|
158
187
|
def reached) and `truncated`. A knob only binds a running agent once the def
|
|
@@ -307,6 +336,7 @@ Reads (`GET`) are not covered by that bucket. `retryAfter` is available from
|
|
|
307
336
|
| Data capabilities | `listCapabilities` (heads + MASKED signing status) · `publishCapability` (TYPED `CapabilityDeclaration`; immutable next version, idempotent on content) · `setCapabilityDisabled` (per-capability live revoke) · `listCapabilityVersions` (history; rollback = republish an old declaration) · `testReadCapability` · `testActionCapability({ confirmDuplicates: true, … })` (REAL deliveries incl. intentional duplicates — 428 without consent) · `listActionExecutions` (the durable Action journal, incl. `authorizedBy: 'automation'`) · `listEventReceipts` (receipts + wake trail) |
|
|
308
337
|
| Webhooks | `listWebhooks` · `createWebhook` · `updateWebhook` · `rotateWebhookSecret` · `deleteWebhook` · `testWebhook` · `redeliverWebhook` |
|
|
309
338
|
| Reporting | `getUsage` · `getUsageHistory` · `getBilling` · `getTracesSummary` · `getRecentTraces` · `getLogs` · `getProject` · `updateProject` |
|
|
339
|
+
| Utilities | `extractJson` (structured JSON from prose, schema-shaped) · `synthesizeSpeech` (short TTS clip in a catalog voice, base64 mp3) |
|
|
310
340
|
| Escape hatch | `request(method, path, body?)` — any endpoint not yet typed |
|
|
311
341
|
|
|
312
342
|
Channel types are checked at compile time: `createChannel` takes a
|
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.24.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
|
|
@@ -711,6 +711,44 @@ export interface AdminClient {
|
|
|
711
711
|
completionTokens: number;
|
|
712
712
|
};
|
|
713
713
|
}>;
|
|
714
|
+
/** Text → a spoken-audio FILE, OUTSIDE the companion and OUTSIDE a realtime
|
|
715
|
+
* call. The audio sibling of `extractJson`: stateless (no session, no
|
|
716
|
+
* persona, no memory), one synthesis call, a downloadable clip back. Use it
|
|
717
|
+
* for headless / Ops audio — e.g. a reference clip for a downstream
|
|
718
|
+
* video / lip-sync API — where `/call` (live ConvAI) does not fit.
|
|
719
|
+
*
|
|
720
|
+
* `voice` is a catalog id (`std_…` / `hd_…`) or a `providerVoiceId` from
|
|
721
|
+
* `listVoices()` — the SAME id you pass to a call's voice — restricted to
|
|
722
|
+
* enabled catalog rows plus the built-in OpenAI roster. `data.audioBase64`
|
|
723
|
+
* is the mp3 bytes; decode and persist them (never hand a provider URL to a
|
|
724
|
+
* client). Only `mp3` is produced in v1.
|
|
725
|
+
*
|
|
726
|
+
* Failures are typed, not audio: `voice_not_found` (404),
|
|
727
|
+
* `text_too_long` (413), `unsupported_format` (400), `unavailable` (503 —
|
|
728
|
+
* no TTS provider configured for that voice, or the voice catalog is
|
|
729
|
+
* temporarily unreachable; retry), `provider_error` (502).
|
|
730
|
+
*
|
|
731
|
+
* Synthesis bills on your provider account (like the platform voice
|
|
732
|
+
* planes), bounded by an input cap and the shared per-IP utility rate
|
|
733
|
+
* limit — there is no separate platform credit rate. */
|
|
734
|
+
synthesizeSpeech(input: {
|
|
735
|
+
text: string;
|
|
736
|
+
voice: string;
|
|
737
|
+
format?: 'mp3';
|
|
738
|
+
model?: string;
|
|
739
|
+
}): Promise<{
|
|
740
|
+
data: {
|
|
741
|
+
audioBase64: string;
|
|
742
|
+
mimeType: string;
|
|
743
|
+
format: 'mp3';
|
|
744
|
+
voiceId: string;
|
|
745
|
+
provider: 'openAI' | 'elevenLabs';
|
|
746
|
+
model: string;
|
|
747
|
+
};
|
|
748
|
+
usage: {
|
|
749
|
+
characterCount: number;
|
|
750
|
+
};
|
|
751
|
+
}>;
|
|
714
752
|
deleteKnowledge(docId: string): Promise<{
|
|
715
753
|
deleted: boolean;
|
|
716
754
|
}>;
|
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.24.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;
|
|
@@ -248,6 +248,7 @@ export function createAdminClient(opts) {
|
|
|
248
248
|
ingestKnowledgeUrl: (input) => request('POST', '/knowledge/url', input),
|
|
249
249
|
searchKnowledge: (query) => request('POST', '/knowledge/search', { query }),
|
|
250
250
|
extractJson: (input) => request('POST', '/utility/json', input),
|
|
251
|
+
synthesizeSpeech: (input) => request('POST', '/utility/tts', input),
|
|
251
252
|
deleteKnowledge: (id) => request('DELETE', `/knowledge/${encodeURIComponent(id)}`),
|
|
252
253
|
listSkills: () => request('GET', '/skills'),
|
|
253
254
|
installSkill: (input) => request('POST', '/skills', input),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pouchy_ai/admin-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.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",
|