@pouchy_ai/admin-sdk 0.29.0 → 0.31.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,34 @@
2
2
 
3
3
  All notable changes to `@pouchy_ai/admin-sdk` are documented here.
4
4
 
5
+ ## 0.31.0 — 2026-09-05
6
+
7
+ - **`Agent.spawnSubtasks?`** and **`Agent.replyCues?`** (`ReplyCues`
8
+ exported) — two per-agent knobs the platform already accepts on
9
+ `PATCH /v1/projects/{id}/agents/{agentId}` and reports on the agent, typed
10
+ now instead of falling through the index signature. `spawnSubtasks` offers
11
+ the synthetic `spawn_subtasks` tool (default false, D-10); `replyCues`
12
+ opts the agent's text turns into `companion.audio` / `companion.expression`
13
+ (design #25). Additive.
14
+
15
+ ## 0.30.0 — 2026-09-04
16
+
17
+ - **`internal-a2a` leaves `ChannelTransportType`.** It was a placeholder the
18
+ platform's union and store knew and no adapter served — `createChannel`
19
+ answered 400 on it, which is why `CreatableChannelType` excluded it. The
20
+ platform retired the id (design #24 / F-04: the friend auto-reply is a
21
+ companion session SURFACE, not a transport), so the union no longer names it
22
+ and `CreatableChannelType` is now the whole union. A caller that referenced
23
+ the literal type gets a compile error, which is the point; nothing that ever
24
+ worked changes.
25
+
26
+ ## 0.29.1 — 2026-09-04
27
+
28
+ - **`story_contract_v4_write_disabled`** joins `ADMIN_ERROR_CODES` — a Story
29
+ Package publish that declares a `public: true` flag (Story Contract v4,
30
+ design #23) answers 409 with this code in an environment that has not
31
+ enabled v4 writes, the field intact. Vocabulary only; no method changed.
32
+
5
33
  ## 0.29.0 — 2026-08-31
6
34
 
7
35
  - **`setSkillAutoRunTools(slug, toolNames)` — the per-tool confirm exemptions
package/README.md CHANGED
@@ -308,15 +308,19 @@ createAdminClient({
308
308
  });
309
309
  ```
310
310
 
311
- `timeoutMs` defaults to **30s**, except for the four requests whose server
312
- handler declares `maxDuration: 300` and therefore answers only when the work is
311
+ `timeoutMs` defaults to **30s**, except for the requests whose server handler
312
+ declares `maxDuration: 300` and therefore answers only when the work is
313
313
  finished — `POST /knowledge`, `POST /knowledge/file`, `POST /knowledge/url`
314
- (chunk + summarize + embed, after OCR / Whisper / vision or a page fetch) and
315
- `DELETE /users/{instanceId}` (recursive GDPR erasure). Those default to **310s**
316
- (`LONG_WORK_TIMEOUT_MS`), so a client abort can only ever mean "the server really
317
- is hung", never "the server is still working" a shorter deadline there reports
318
- a failure for an ingest that is succeeding, and the retry it invites races the
319
- still-running first one.
314
+ (chunk + summarize + embed, after OCR / Whisper / vision or a page fetch),
315
+ `DELETE /users/{instanceId}` (recursive GDPR erasure) and
316
+ `POST /capabilities/{name}/test-action` (the Action protocol verifier makes
317
+ REAL deliveries to your endpoint, and an abort mid-test cannot undo the ones
318
+ already made). Those default to **310s** (`LONG_WORK_TIMEOUT_MS`), so a client
319
+ abort can only ever mean "the server really is hung", never "the server is
320
+ still working" — a shorter deadline there reports a failure for an ingest that
321
+ is succeeding, and the retry it invites races the still-running first one (or
322
+ re-runs a side-effecting test whose first verdict is never read). The list is
323
+ `LONG_WORK_REQUESTS`, exported, and a drift test binds it to the routes.
320
324
 
321
325
  Setting `timeoutMs` explicitly always wins and applies to **every** request, long
322
326
  or short. `requestDeadlineMs(method, path)` returns the default a given request
@@ -449,8 +453,8 @@ Reads (`GET`) are not covered by that bucket. `retryAfter` is available from
449
453
  | Escape hatch | `request(method, path, body?)` — any endpoint not yet typed |
450
454
 
451
455
  Channel types are checked at compile time: `createChannel` takes a
452
- `CreatableChannelType` (the platform's 82-transport union minus the adapterless
453
- `internal-a2a`), and `secret` is a named `ChannelSecretInput`. Per-transport
456
+ `CreatableChannelType` (the platform's 81-transport union every member has an
457
+ adapter since 0.30.0), and `secret` is a named `ChannelSecretInput`. Per-transport
454
458
  `secret.extra` fields are listed in <https://pouchy.ai/docs/channel-setup>.
455
459
 
456
460
  **Telegram and Discord register themselves.** On create — and again on a
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const ADMIN_SDK_VERSION = "0.29.0";
1
+ export declare const ADMIN_SDK_VERSION = "0.31.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
@@ -38,7 +38,8 @@ export interface AdminClientOptions {
38
38
  fetch?: typeof fetch;
39
39
  /** Per-request timeout in ms. Default 30s, EXCEPT the requests whose server
40
40
  * handler declares `maxDuration: 300` (knowledge ingest by text/file/url,
41
- * and the GDPR user delete), which default to
41
+ * the GDPR user delete, and the capability test-action verifier — the
42
+ * list is {@link LONG_WORK_REQUESTS}), which default to
42
43
  * {@link LONG_WORK_TIMEOUT_MS}. Setting this explicitly always wins and
43
44
  * applies to every request, long or short. A request that outlives its
44
45
  * deadline rejects with an AdminApiError(status 0).
@@ -59,7 +60,7 @@ export interface AdminClientOptions {
59
60
  * published: on this plane the status line never disambiguates, so two of the
60
61
  * durable-run routes answer 409 for two entirely different reasons each, with
61
62
  * different recoveries. `code` is the only thing that tells them apart. */
62
- export declare const ADMIN_ERROR_CODES: readonly ["story_contract_v2_write_disabled", "story_contract_v3_write_disabled", "episode_history_incomplete", "episode_ended", "idempotency_key_reused", "stale_deliberation", "deliberation_disabled", "deliberation_uncalibrated", "deliberation_not_enabled", "deliberation_candidates_exceeded", "schedule_limit_reached", "one_shot_spent", "ghost_row", "channel_limit_reached", "webhook_limit_reached", "run_limit_reached", "reembed_required", "run_terminal", "run_not_parked", "stale_token", "run_not_waiting", "event_mismatch"];
63
+ export declare const ADMIN_ERROR_CODES: readonly ["story_contract_v2_write_disabled", "story_contract_v3_write_disabled", "story_contract_v4_write_disabled", "episode_history_incomplete", "episode_ended", "idempotency_key_reused", "stale_deliberation", "deliberation_disabled", "deliberation_uncalibrated", "deliberation_not_enabled", "deliberation_candidates_exceeded", "schedule_limit_reached", "one_shot_spent", "ghost_row", "channel_limit_reached", "webhook_limit_reached", "run_limit_reached", "reembed_required", "run_terminal", "run_not_parked", "stale_token", "run_not_waiting", "event_mismatch"];
63
64
  /** `AdminApiError.code` values. The `(string & {})` arm keeps the type open for
64
65
  * codes newer than this SDK build while preserving autocomplete — same
65
66
  * doctrine as the companion SDK's `CompanionErrorCodeValue`. */
@@ -123,6 +124,16 @@ export interface AgentData {
123
124
  subscriptions?: string[];
124
125
  };
125
126
  }
127
+ /** Opt the agent's text turns into the two outbound cue events (design #25):
128
+ * `audio` → `companion.audio` (a TTS mp3 of the reply; `voiceId` picks the
129
+ * voice), `expression` → `companion.expression` (a VRM 1.0 preset read from
130
+ * the reply's tone). Neither delays the reply; neither fires on A2A or
131
+ * channel surfaces. */
132
+ export interface ReplyCues {
133
+ audio?: boolean;
134
+ expression?: boolean;
135
+ voiceId?: string;
136
+ }
126
137
  export interface Agent {
127
138
  agentId: string;
128
139
  name: string;
@@ -132,6 +143,12 @@ export interface Agent {
132
143
  modelTier?: ModelTier;
133
144
  /** Agent Data plane flags (see AgentData). */
134
145
  data?: AgentData;
146
+ /** Offer the synthetic `spawn_subtasks` tool on this agent's turns
147
+ * (concurrent headless workers under one persona). Default false since
148
+ * owner decision D-10 (2026-09-05). */
149
+ spawnSubtasks?: boolean;
150
+ /** Reply-cue opt-in (see ReplyCues). */
151
+ replyCues?: ReplyCues;
135
152
  templateRev: number;
136
153
  createdAt: string;
137
154
  [k: string]: unknown;
@@ -332,11 +349,12 @@ export interface DeliveryOutcome {
332
349
  * (`channels/types.ts`) — this package is standalone and cannot import it, so
333
350
  * `admin-sdk-channel-types.drift.test.ts` binds the two and fails CI if either
334
351
  * side gains a transport the other lacks. */
335
- export type ChannelTransportType = 'echo' | 'matrix' | 'telegram' | 'web' | 'activitypub' | 'internal-a2a' | 'discord' | 'slack' | 'nostr' | 'atproto' | 'sms' | 'email' | 'whatsapp' | 'messenger' | 'instagram' | 'line' | 'teams' | 'wechat' | 'wecom' | 'feishu' | 'dingtalk' | 'twitter' | 'xmpp' | 'qq' | 'kakao' | 'viber' | 'signal' | 'weibo' | 'alexa' | 'google-assistant' | 'voice' | 'onlyfans' | 'fansly' | 'fanvue' | 'imessage' | 'rcs' | 'intercom' | 'twitch' | 'zalo' | 'douyin' | 'kick' | 'reddit' | 'xmtp' | 'guilded' | 'youtube-live' | 'bilibili-live' | 'minecraft' | 'steam' | 'vk' | 'ok' | 'threads' | 'groupme' | 'threema' | 'mattermost' | 'rocketchat' | 'zulip' | 'farcaster' | 'tiktok' | 'crisp' | 'freshchat' | 'front' | 'gorgias' | 'kustomer' | 'helpscout' | 'livechat' | 'zohodesk' | 'hubspot' | 'zendesk' | 'salesforce' | 'webex' | 'chatwork' | 'google-chat' | 'zohocliq' | 'zoom' | 'line-works' | 'ringcentral' | 'vonage' | 'github' | 'gitlab' | 'bitbucket' | 'jira' | 'linear' | 'discourse';
336
- /** Transports `createChannel` accepts. `internal-a2a` is in the union but has
337
- * no adapter, so the server answers 400 excluding it here turns a runtime
338
- * rejection into a compile error. */
339
- export type CreatableChannelType = Exclude<ChannelTransportType, 'internal-a2a'>;
352
+ export type ChannelTransportType = 'echo' | 'matrix' | 'telegram' | 'web' | 'activitypub' | 'discord' | 'slack' | 'nostr' | 'atproto' | 'sms' | 'email' | 'whatsapp' | 'messenger' | 'instagram' | 'line' | 'teams' | 'wechat' | 'wecom' | 'feishu' | 'dingtalk' | 'twitter' | 'xmpp' | 'qq' | 'kakao' | 'viber' | 'signal' | 'weibo' | 'alexa' | 'google-assistant' | 'voice' | 'onlyfans' | 'fansly' | 'fanvue' | 'imessage' | 'rcs' | 'intercom' | 'twitch' | 'zalo' | 'douyin' | 'kick' | 'reddit' | 'xmtp' | 'guilded' | 'youtube-live' | 'bilibili-live' | 'minecraft' | 'steam' | 'vk' | 'ok' | 'threads' | 'groupme' | 'threema' | 'mattermost' | 'rocketchat' | 'zulip' | 'farcaster' | 'tiktok' | 'crisp' | 'freshchat' | 'front' | 'gorgias' | 'kustomer' | 'helpscout' | 'livechat' | 'zohodesk' | 'hubspot' | 'zendesk' | 'salesforce' | 'webex' | 'chatwork' | 'google-chat' | 'zohocliq' | 'zoom' | 'line-works' | 'ringcentral' | 'vonage' | 'github' | 'gitlab' | 'bitbucket' | 'jira' | 'linear' | 'discourse';
353
+ /** Transports `createChannel` accepts the whole union, since 0.30.0: the
354
+ * adapterless `internal-a2a` placeholder this type used to exclude was
355
+ * retired from the platform's union (design #24 / F-04). Kept as a named
356
+ * alias so existing imports compile unchanged. */
357
+ export type CreatableChannelType = ChannelTransportType;
340
358
  /** Credentials for a connector, sealed server-side as one AES-GCM blob.
341
359
  *
342
360
  * `extra` is where the transports needing more than a token live — Twitter
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.29.0';
11
+ export const ADMIN_SDK_VERSION = '0.31.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;
@@ -72,6 +72,7 @@ export function requestDeadlineMs(method, path) {
72
72
  export const ADMIN_ERROR_CODES = [
73
73
  'story_contract_v2_write_disabled',
74
74
  'story_contract_v3_write_disabled',
75
+ 'story_contract_v4_write_disabled',
75
76
  'episode_history_incomplete',
76
77
  'episode_ended',
77
78
  'idempotency_key_reused',
@@ -194,8 +195,9 @@ export function createAdminClient(opts) {
194
195
  throw new AdminApiError('no fetch available — pass opts.fetch on Node <18', 0);
195
196
  async function request(method, path, body) {
196
197
  // An explicit host `timeoutMs` always wins (JS SDK contract); otherwise
197
- // the deadline is sized to the ROUTE, so the four handlers that declare
198
- // `maxDuration: 300` are not cut at 30s while they are still working.
198
+ // the deadline is sized to the ROUTE, so the handlers that declare
199
+ // `maxDuration: 300` (LONG_WORK_REQUESTS) are not cut at 30s while they
200
+ // are still working.
199
201
  // `??` (not `||`) is deliberate: 0 is a SET value meaning "no deadline",
200
202
  // and it must not fall through to the route default.
201
203
  const timeoutMs = opts.timeoutMs ?? requestDeadlineMs(method, path);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pouchy_ai/admin-sdk",
3
- "version": "0.29.0",
3
+ "version": "0.31.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",