@pouchy_ai/admin-sdk 0.23.0 → 0.24.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 CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  All notable changes to `@pouchy_ai/admin-sdk` are documented here.
4
4
 
5
+ ## 0.24.0 — 2026-08-08
6
+
7
+ - **New method `synthesizeSpeech`** (additive; nothing renamed or removed):
8
+ `POST /v1/admin/utility/tts`. Text → a spoken-audio mp3 FILE, OUTSIDE the
9
+ companion and OUTSIDE a realtime `/call` — the audio sibling of `extractJson`.
10
+ Stateless (no session, no persona, no memory); the voice is a catalog id
11
+ (`std_…` / `hd_…`) or `providerVoiceId` from `listVoices()`, the same id used
12
+ for a call's voice, restricted to enabled catalog rows + the built-in OpenAI
13
+ roster. Returns `{ data: { audioBase64, mimeType, format, voiceId, provider,
14
+ model }, usage: { characterCount } }`; failures are typed
15
+ (`voice_not_found`, `text_too_long`, `unsupported_format`, `unavailable`,
16
+ `provider_error`). Synthesis bills on your provider account like the other
17
+ voice planes — no separate platform credit rate; bounded by an input cap +
18
+ a per-project rate limit.
19
+
5
20
  ## 0.23.0 — 2026-08-08
6
21
 
7
22
  - **`ChannelTransportType` grows 6 members** (additive; nothing renamed or
package/README.md CHANGED
@@ -153,6 +153,34 @@ 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), `provider_error` (502). Synthesis bills on your provider account
181
+ like the other voice planes — there is no separate platform credit rate; it is
182
+ bounded by an input cap and a per-project rate limit.
183
+
156
184
  Every skill knob (`setSkillRate`, `setSkillDailyCap`, `grantSkill`) returns
157
185
  `SkillKnobResult<T>` — the knob you set plus `reprovisioned` (instances the new
158
186
  def reached) and `truncated`. A knob only binds a running agent once the def
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const ADMIN_SDK_VERSION = "0.23.0";
1
+ export declare const ADMIN_SDK_VERSION = "0.24.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
@@ -711,6 +711,43 @@ 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), `provider_error` (502).
729
+ *
730
+ * Synthesis bills on your provider account (like the platform voice
731
+ * planes), bounded by an input cap and a per-project rate limit — there is
732
+ * no separate platform credit rate. */
733
+ synthesizeSpeech(input: {
734
+ text: string;
735
+ voice: string;
736
+ format?: 'mp3';
737
+ model?: string;
738
+ }): Promise<{
739
+ data: {
740
+ audioBase64: string;
741
+ mimeType: string;
742
+ format: 'mp3';
743
+ voiceId: string;
744
+ provider: 'openAI' | 'elevenLabs';
745
+ model: string;
746
+ };
747
+ usage: {
748
+ characterCount: number;
749
+ };
750
+ }>;
714
751
  deleteKnowledge(docId: string): Promise<{
715
752
  deleted: boolean;
716
753
  }>;
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.23.0';
11
+ export const ADMIN_SDK_VERSION = '0.24.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;
@@ -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.23.0",
3
+ "version": "0.24.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",