@pouchy_ai/admin-sdk 0.24.2 → 0.25.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 +15 -0
- package/dist/index.d.ts +8 -3
- package/dist/index.js +4 -2
- package/package.json +1 -1
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.25.0 — 2026-08-09
|
|
6
|
+
|
|
7
|
+
- **`ADMIN_ERROR_CODES` gains the two schedule-PATCH refusals** (additive;
|
|
8
|
+
nothing renamed or removed): `one_shot_spent` (409 — this one-shot schedule
|
|
9
|
+
already fired; create a new one instead of re-enabling it) and `ghost_row`
|
|
10
|
+
(409 — a legacy incomplete row that can never fire; delete it and create a
|
|
11
|
+
new schedule). Both have been emitted by `updateSchedule` refusals on the
|
|
12
|
+
server (`one_shot_spent` for a long time, `ghost_row` since the ghost-row
|
|
13
|
+
guard landed) but were absent from every published vocabulary — an
|
|
14
|
+
integrator switching on `AdminApiError.code` per this package's own advice
|
|
15
|
+
fell through on codes no doc named. `updateSchedule`'s docstring now lists
|
|
16
|
+
all three 409 codes. Existing `code` handling is unaffected — the type was
|
|
17
|
+
already open (`string & {}`), so this widens autocomplete/docs, not the
|
|
18
|
+
wire.
|
|
19
|
+
|
|
5
20
|
## 0.24.2 — 2026-08-08
|
|
6
21
|
|
|
7
22
|
- **Docs-only: `extractJson` failure vocabulary gains `request_invalid`**
|
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.25.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
|
|
@@ -59,7 +59,7 @@ export interface AdminClientOptions {
|
|
|
59
59
|
* published: on this plane the status line never disambiguates, so two of the
|
|
60
60
|
* durable-run routes answer 409 for two entirely different reasons each, with
|
|
61
61
|
* different recoveries. `code` is the only thing that tells them apart. */
|
|
62
|
-
export declare const ADMIN_ERROR_CODES: readonly ["schedule_limit_reached", "channel_limit_reached", "webhook_limit_reached", "run_limit_reached", "reembed_required", "run_terminal", "run_not_parked", "stale_token", "run_not_waiting", "event_mismatch"];
|
|
62
|
+
export declare const ADMIN_ERROR_CODES: readonly ["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
63
|
/** `AdminApiError.code` values. The `(string & {})` arm keeps the type open for
|
|
64
64
|
* codes newer than this SDK build while preserving autocomplete — same
|
|
65
65
|
* doctrine as the companion SDK's `CompanionErrorCodeValue`. */
|
|
@@ -69,7 +69,7 @@ export type AdminErrorCode = (typeof ADMIN_ERROR_CODES)[number] | (string & {});
|
|
|
69
69
|
* backoff in SECONDS on a 429 (undefined on every other failure); `code` is the
|
|
70
70
|
* server's machine tag when it named one (undefined otherwise).
|
|
71
71
|
*
|
|
72
|
-
* Why `code` exists: the Admin API's
|
|
72
|
+
* Why `code` exists: the Admin API's machine-readable failures are ALL on
|
|
73
73
|
* 409, so `status` cannot separate them and this package used to discard the
|
|
74
74
|
* one field that can. Two routes are the point — `resumeRun` answers 409 for
|
|
75
75
|
* `run_not_parked` (someone already decided; re-read, do not retry) or
|
|
@@ -925,6 +925,11 @@ export interface AdminClient {
|
|
|
925
925
|
getSchedule(scheduleId: string): Promise<{
|
|
926
926
|
schedule: unknown;
|
|
927
927
|
}>;
|
|
928
|
+
/** PATCH a schedule. Re-enabling can refuse with 409 — switch on
|
|
929
|
+
* `AdminApiError.code`: `one_shot_spent` (this one-shot already fired;
|
|
930
|
+
* create a new schedule), `ghost_row` (a legacy incomplete row that can
|
|
931
|
+
* never fire; delete it), or `schedule_limit_reached` (the enabled-count
|
|
932
|
+
* ceiling). */
|
|
928
933
|
updateSchedule(scheduleId: string, patch: Record<string, unknown>): Promise<{
|
|
929
934
|
schedule: unknown;
|
|
930
935
|
}>;
|
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.25.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;
|
|
@@ -71,6 +71,8 @@ export function requestDeadlineMs(method, path) {
|
|
|
71
71
|
* different recoveries. `code` is the only thing that tells them apart. */
|
|
72
72
|
export const ADMIN_ERROR_CODES = [
|
|
73
73
|
'schedule_limit_reached',
|
|
74
|
+
'one_shot_spent',
|
|
75
|
+
'ghost_row',
|
|
74
76
|
'channel_limit_reached',
|
|
75
77
|
'webhook_limit_reached',
|
|
76
78
|
'run_limit_reached',
|
|
@@ -86,7 +88,7 @@ export const ADMIN_ERROR_CODES = [
|
|
|
86
88
|
* backoff in SECONDS on a 429 (undefined on every other failure); `code` is the
|
|
87
89
|
* server's machine tag when it named one (undefined otherwise).
|
|
88
90
|
*
|
|
89
|
-
* Why `code` exists: the Admin API's
|
|
91
|
+
* Why `code` exists: the Admin API's machine-readable failures are ALL on
|
|
90
92
|
* 409, so `status` cannot separate them and this package used to discard the
|
|
91
93
|
* one field that can. Two routes are the point — `resumeRun` answers 409 for
|
|
92
94
|
* `run_not_parked` (someone already decided; re-read, do not retry) or
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pouchy_ai/admin-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.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",
|