@pouchy_ai/admin-sdk 0.40.1 → 0.42.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 +27 -0
- package/dist/index.d.ts +14 -2
- package/dist/index.js +9 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@pouchy_ai/admin-sdk` are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.42.0 — 2026-10-08
|
|
6
|
+
|
|
7
|
+
- **`getRecentTraces({ from, to })`: a custom window by UTC day** (admin API
|
|
8
|
+
1.19.0). The run browser could only look back from now (`sinceHours`); a
|
|
9
|
+
window that ends in the past (last Tuesday's failures) had no expression.
|
|
10
|
+
`from` / `to` are inclusive UTC days, given together, within the 30-day trace
|
|
11
|
+
retention — older is a 400, never an empty list that reads as "no runs".
|
|
12
|
+
`window.untilMs` (exclusive) is typed and present on such a window.
|
|
13
|
+
`sinceHours` alone behaves as before. Additive.
|
|
14
|
+
- **`getUsageHistory()` rows carry `credits`** — the credits charged that
|
|
15
|
+
month (the pooled account figure on `scope: 'account'`), typed as optional
|
|
16
|
+
because an older server does not send it.
|
|
17
|
+
|
|
18
|
+
## 0.41.0 — 2026-10-02
|
|
19
|
+
|
|
20
|
+
- **Three world session-mint codes join `ADMIN_ERROR_CODES`.** `POST
|
|
21
|
+
/v1/sessions` with a `world` block used to answer all three membership
|
|
22
|
+
conflicts with one sentence and no `code`, telling the caller to start a
|
|
23
|
+
fresh `world_instance`. Each now carries its own 409 code:
|
|
24
|
+
`world_actor_conflict` (the role in this world instance is bound to a
|
|
25
|
+
different agent, registry instance or key environment — mint with the ones
|
|
26
|
+
that first entered it), `world_revision_mismatch` and
|
|
27
|
+
`world_provider_mismatch` (both a race between two concurrent first mints of
|
|
28
|
+
one world instance — retry the mint). A worldline whose project merely
|
|
29
|
+
edited or promoted the role's agent, or republished one of its
|
|
30
|
+
capabilities, is no longer refused at all. Additive; no method changed.
|
|
31
|
+
|
|
5
32
|
## 0.40.1 — 2026-09-30
|
|
6
33
|
|
|
7
34
|
- **A 2xx whose body cannot be read now rejects with `AdminApiError`.** It
|
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.42.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", "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", "subscription_exists"];
|
|
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", "subscription_exists", "world_actor_conflict", "world_revision_mismatch", "world_provider_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`. */
|
|
@@ -373,6 +373,9 @@ export interface MonthUsageHistoryEntry {
|
|
|
373
373
|
mau: number;
|
|
374
374
|
mauTest: number;
|
|
375
375
|
sessions: number;
|
|
376
|
+
/** 0.42.0 (admin API 1.19.0): credits charged that month. Absent from an
|
|
377
|
+
* older server. */
|
|
378
|
+
credits?: number;
|
|
376
379
|
[k: string]: unknown;
|
|
377
380
|
}
|
|
378
381
|
export interface AuditRow {
|
|
@@ -1461,12 +1464,21 @@ export interface AdminClient {
|
|
|
1461
1464
|
getRecentTraces(params?: {
|
|
1462
1465
|
agentId?: string;
|
|
1463
1466
|
sinceHours?: number;
|
|
1467
|
+
/** 0.42.0 (admin API 1.19.0): a custom window by UTC day, inclusive,
|
|
1468
|
+
* both required together. Run traces are kept 30 days, so `from` must
|
|
1469
|
+
* fall within the last 30 UTC days — older is a 400, not an empty list.
|
|
1470
|
+
* `sinceHours` is ignored when these are given. */
|
|
1471
|
+
from?: string;
|
|
1472
|
+
to?: string;
|
|
1464
1473
|
errorsOnly?: boolean;
|
|
1465
1474
|
limit?: number;
|
|
1466
1475
|
}): Promise<{
|
|
1467
1476
|
sinceHours: number;
|
|
1477
|
+
/** `untilMs` (exclusive) is present only on a custom window ending
|
|
1478
|
+
* before now. */
|
|
1468
1479
|
window: {
|
|
1469
1480
|
sinceMs: number;
|
|
1481
|
+
untilMs?: number;
|
|
1470
1482
|
};
|
|
1471
1483
|
degraded: false | 'index' | 'error';
|
|
1472
1484
|
traces: RecentTrace[];
|
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.42.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;
|
|
@@ -100,7 +100,14 @@ export const ADMIN_ERROR_CODES = [
|
|
|
100
100
|
// 0.38.0 — checkout on an account that already pays through a live
|
|
101
101
|
// subscription. Recovery: POST /v1/projects/{id}/billing/upgrade, which moves
|
|
102
102
|
// that subscription to the new price instead of opening a second one.
|
|
103
|
-
'subscription_exists'
|
|
103
|
+
'subscription_exists',
|
|
104
|
+
// 0.41.0 — the three world session-mint conflicts (`POST /v1/sessions` with
|
|
105
|
+
// `world`). `world_actor_conflict`: the role is bound to a different agent,
|
|
106
|
+
// registry instance or key environment. The other two are races between
|
|
107
|
+
// two concurrent FIRST mints of one world instance; retry the mint.
|
|
108
|
+
'world_actor_conflict',
|
|
109
|
+
'world_revision_mismatch',
|
|
110
|
+
'world_provider_mismatch'
|
|
104
111
|
];
|
|
105
112
|
/** Thrown on any non-2xx response AND on a transport failure that never reached
|
|
106
113
|
* the server (network / DNS / timeout), which carries `status: 0`. `status` is
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pouchy_ai/admin-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.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",
|