@pouchy_ai/admin-sdk 0.33.0 → 0.36.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 +69 -0
- package/dist/index.d.ts +27 -6
- package/dist/index.js +6 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,75 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@pouchy_ai/admin-sdk` are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.36.0 — 2026-09-12
|
|
6
|
+
|
|
7
|
+
- **`deleteChannel` reports what happened to the PROVIDER registration**, and
|
|
8
|
+
takes `{ deprovision: false }` to suppress it. Admin API 1.13.0. Additive:
|
|
9
|
+
the option is optional and the response field is new.
|
|
10
|
+
|
|
11
|
+
Create has registered telegram/discord connectors with their provider since
|
|
12
|
+
1.6.0 (`setWebhook` / the slash command). Delete never unregistered — and the
|
|
13
|
+
asymmetry was worse than an omission, because the delete also destroys the
|
|
14
|
+
stored bot token, so afterwards nothing on the server side could ever do it.
|
|
15
|
+
The bot kept pushing every message it could see to a dead inbound URL, which
|
|
16
|
+
on a fail-closed rate-limited prefix also keeps spending the project's
|
|
17
|
+
limiter quota.
|
|
18
|
+
|
|
19
|
+
Surfaced by an integrator asking whether `DELETE` called `deleteWebhook` —
|
|
20
|
+
the shape of question that is worth answering by reading the code.
|
|
21
|
+
|
|
22
|
+
- `ChannelProvisionCode` gains `webhook_deleted`, `command_deleted` and
|
|
23
|
+
`command_absent`. The union is closed and a published member is never removed,
|
|
24
|
+
so handle an unknown code as informational. `command_absent` is a **skip**,
|
|
25
|
+
not an ok: the Discord command was already gone, and "we removed it" versus
|
|
26
|
+
"there was nothing to remove" are different facts about the provider.
|
|
27
|
+
|
|
28
|
+
## 0.35.0 — 2026-09-10
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
- **Four story-package codes join `ADMIN_ERROR_CODES`**, and two of them were
|
|
33
|
+
already on the wire without being in it. `has_pins` and `pins_unknown` are
|
|
34
|
+
the two 409s of `DELETE …/story-packages/{packageId}` (world API 1.35.0):
|
|
35
|
+
an environment revision has pinned this package, versus the package predates
|
|
36
|
+
the pin stamp so whether one points at it is UNKNOWN and is not guessed. They
|
|
37
|
+
shipped through the same VARIABLE indirection that hid
|
|
38
|
+
`story_contract_v2_write_disabled` — the route forwarded `result.reason` as
|
|
39
|
+
`code`, so the vocabulary census could not see them; the route spells them
|
|
40
|
+
out now.
|
|
41
|
+
|
|
42
|
+
`story_package_limit` and `story_package_documents_limit` are the two ceiling
|
|
43
|
+
refusals, newly carrying a code at all. An integrator reported asserting on
|
|
44
|
+
the refusal SENTENCES because they were the only observation point for the
|
|
45
|
+
quota — which made a copy edit a breaking change for them and a number change
|
|
46
|
+
harmless, the exact inversion of what either should cost. The codes retire
|
|
47
|
+
the prose parsing.
|
|
48
|
+
|
|
49
|
+
Distinguishing the two delete refusals matters because their outs differ:
|
|
50
|
+
`has_pins` sends you to an environment, `pins_unknown` sends you to disable.
|
|
51
|
+
|
|
52
|
+
## 0.34.0 — 2026-09-08
|
|
53
|
+
|
|
54
|
+
### Fixed
|
|
55
|
+
|
|
56
|
+
- **`instructions`, `knowledgeDocIds` and `agentCardExtras` were dropped by the
|
|
57
|
+
agent create/update surface, so setting any of them answered `200` and did
|
|
58
|
+
nothing.** `agent-input.ts` maps a request body onto `createAgent`/
|
|
59
|
+
`updateAgent` with an object literal that enumerates its fields, and three
|
|
60
|
+
fields the store accepts had fallen out of it — on BOTH management surfaces
|
|
61
|
+
(`/v1/admin/agents` and `/v1/projects/{id}/agents`) and therefore the
|
|
62
|
+
Dashboard too, which PATCHes the latter. `instructions` was dead the day it
|
|
63
|
+
shipped; the Dashboard's knowledge-scope picker has been a silent no-op for
|
|
64
|
+
as long as it has existed; `agentCardExtras` is documented for the DeJoy
|
|
65
|
+
integration and was unreachable over HTTP. Server-side fix — no SDK change
|
|
66
|
+
was needed to make them work.
|
|
67
|
+
|
|
68
|
+
### Added
|
|
69
|
+
|
|
70
|
+
- `Agent.knowledgeDocIds?: string[]` — typed alongside `instructions`, so the
|
|
71
|
+
two fields this release un-drops are both discoverable from the SDK rather
|
|
72
|
+
than only from the API reference.
|
|
73
|
+
|
|
5
74
|
## 0.33.0 — 2026-09-08
|
|
6
75
|
|
|
7
76
|
### Added
|
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.36.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
|
|
@@ -60,7 +60,7 @@ export interface AdminClientOptions {
|
|
|
60
60
|
* published: on this plane the status line never disambiguates, so two of the
|
|
61
61
|
* durable-run routes answer 409 for two entirely different reasons each, with
|
|
62
62
|
* different recoveries. `code` is the only thing that tells them apart. */
|
|
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
|
+
export declare const ADMIN_ERROR_CODES: readonly ["story_contract_v2_write_disabled", "story_contract_v3_write_disabled", "story_contract_v4_write_disabled", "has_pins", "pins_unknown", "story_package_limit", "story_package_documents_limit", "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"];
|
|
64
64
|
/** `AdminApiError.code` values. The `(string & {})` arm keeps the type open for
|
|
65
65
|
* codes newer than this SDK build while preserving autocomplete — same
|
|
66
66
|
* doctrine as the companion SDK's `CompanionErrorCodeValue`. */
|
|
@@ -165,6 +165,9 @@ export interface Agent {
|
|
|
165
165
|
* (concurrent headless workers under one persona). Default false since
|
|
166
166
|
* owner decision D-10 (2026-09-05). */
|
|
167
167
|
spawnSubtasks?: boolean;
|
|
168
|
+
/** Restrict this agent's project-knowledge recall to the named documents
|
|
169
|
+
* (`[]` clears). Read live off the agent row every turn — no rev bump. */
|
|
170
|
+
knowledgeDocIds?: string[];
|
|
168
171
|
/** Grant `chat.instructions` on this agent's session mints, so a turn may
|
|
169
172
|
* carry an `instructions` field — developer-authored rules for THAT turn,
|
|
170
173
|
* joined to the prompt and never scored as user speech by inbound
|
|
@@ -398,13 +401,15 @@ export interface ChannelSecretInput {
|
|
|
398
401
|
extra?: Record<string, string>;
|
|
399
402
|
}
|
|
400
403
|
/** Outcome class of the provider registration the server performs on create,
|
|
401
|
-
*
|
|
402
|
-
*
|
|
404
|
+
* on a rotate / secret replacement, and — from admin API 1.13.0 — the
|
|
405
|
+
* UNregistration it performs on delete. Mirrors the server's
|
|
406
|
+
* `ProvisionStatus` (`channels/provision.ts`);
|
|
407
|
+
* `admin-sdk-provision.drift.test.ts` binds them. */
|
|
403
408
|
export type ChannelProvisionStatus = 'ok' | 'skipped' | 'failed';
|
|
404
409
|
/** Machine-readable reason for a `ChannelProvisionResult`. The server treats
|
|
405
410
|
* this vocabulary as part of the response contract (the dashboard keys its
|
|
406
411
|
* copy off it), so branch on `code`, never on `detail`. */
|
|
407
|
-
export type ChannelProvisionCode = 'webhook_set' | 'command_registered' | 'unsupported_type' | 'no_token' | 'no_inbound_url' | 'not_requested' | 'invalid_command_name' | 'app_lookup_failed' | 'upstream_rejected' | 'upstream_unreachable';
|
|
412
|
+
export type ChannelProvisionCode = 'webhook_set' | 'command_registered' | 'unsupported_type' | 'no_token' | 'no_inbound_url' | 'not_requested' | 'invalid_command_name' | 'app_lookup_failed' | 'upstream_rejected' | 'upstream_unreachable' | 'webhook_deleted' | 'command_deleted' | 'command_absent';
|
|
408
413
|
/** What the provider said when the server registered this connector for you.
|
|
409
414
|
*
|
|
410
415
|
* Registration is an enrichment on top of a durable write: the connector
|
|
@@ -1080,8 +1085,24 @@ export interface AdminClient {
|
|
|
1080
1085
|
* transport, when not suppressed with `autoProvision: false`. */
|
|
1081
1086
|
provision?: ChannelProvisionResult;
|
|
1082
1087
|
}>;
|
|
1083
|
-
|
|
1088
|
+
/** Delete a connector — and, for telegram/discord, UNREGISTER it with the
|
|
1089
|
+
* provider first (admin API 1.13.0).
|
|
1090
|
+
*
|
|
1091
|
+
* The ordering is the point: the delete also destroys the stored bot token,
|
|
1092
|
+
* so an unregistration skipped at that moment can never be done afterwards
|
|
1093
|
+
* from the server side — the bot would keep pushing every message it can see
|
|
1094
|
+
* to a dead inbound URL, and only whoever holds the token could stop it.
|
|
1095
|
+
*
|
|
1096
|
+
* Same contract as create-side registration: the connector is removed
|
|
1097
|
+
* whether or not the provider answers, and a `failed` outcome carries
|
|
1098
|
+
* `manualCommand`. Pass `deprovision: false` to keep the provider
|
|
1099
|
+
* registration (for a caller who manages the bot webhook themselves). */
|
|
1100
|
+
deleteChannel(channelId: string, options?: {
|
|
1101
|
+
deprovision?: false;
|
|
1102
|
+
}): Promise<{
|
|
1084
1103
|
ok: boolean;
|
|
1104
|
+
/** Absent for a transport with no provider registration. */
|
|
1105
|
+
deprovision?: ChannelProvisionResult;
|
|
1085
1106
|
}>;
|
|
1086
1107
|
listSchedules(): Promise<{
|
|
1087
1108
|
schedules: unknown[];
|
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.36.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;
|
|
@@ -73,6 +73,10 @@ export const ADMIN_ERROR_CODES = [
|
|
|
73
73
|
'story_contract_v2_write_disabled',
|
|
74
74
|
'story_contract_v3_write_disabled',
|
|
75
75
|
'story_contract_v4_write_disabled',
|
|
76
|
+
'has_pins',
|
|
77
|
+
'pins_unknown',
|
|
78
|
+
'story_package_limit',
|
|
79
|
+
'story_package_documents_limit',
|
|
76
80
|
'episode_history_incomplete',
|
|
77
81
|
'episode_ended',
|
|
78
82
|
'idempotency_key_reused',
|
|
@@ -330,7 +334,7 @@ export function createAdminClient(opts) {
|
|
|
330
334
|
createChannel: (input) => request('POST', '/channels', input),
|
|
331
335
|
getChannel: (id) => request('GET', `/channels/${encodeURIComponent(id)}`),
|
|
332
336
|
updateChannel: (id, patch) => request('PATCH', `/channels/${encodeURIComponent(id)}`, patch),
|
|
333
|
-
deleteChannel: (id) => request('DELETE', `/channels/${encodeURIComponent(id)}`),
|
|
337
|
+
deleteChannel: (id, options) => request('DELETE', `/channels/${encodeURIComponent(id)}${options?.deprovision === false ? '?deprovision=false' : ''}`),
|
|
334
338
|
listSchedules: () => request('GET', '/schedules'),
|
|
335
339
|
createSchedule: (input) => request('POST', '/schedules', input),
|
|
336
340
|
getSchedule: (id) => request('GET', `/schedules/${encodeURIComponent(id)}`),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pouchy_ai/admin-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.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",
|