@pouchy_ai/admin-sdk 0.10.0 → 0.11.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 +16 -0
- package/README.md +6 -0
- package/dist/index.d.ts +73 -2
- package/dist/index.js +13 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@pouchy_ai/admin-sdk` are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.11.0 — 2026-08-01
|
|
6
|
+
|
|
7
|
+
- **Data capabilities, headless.** Six new methods over the `/v1/admin/capabilities`
|
|
8
|
+
mirror: `listCapabilities` (heads + masked signing status — the `pcsk_`
|
|
9
|
+
plaintext is issued once on the owner plane and is never readable through any
|
|
10
|
+
API), `publishCapability` (immutable next version; idempotent on content),
|
|
11
|
+
`setCapabilityDisabled` (per-capability live revoke — live both directions,
|
|
12
|
+
pinned reconciliations unaffected), `listCapabilityVersions` (append-only
|
|
13
|
+
history; rollback = republishing an old declaration as the next version),
|
|
14
|
+
`testReadCapability`, and `testActionCapability` (the four-phase Action
|
|
15
|
+
protocol verifier; the server refuses without `confirmDuplicates: true`
|
|
16
|
+
because phases B/C intentionally re-deliver the same `actionId`).
|
|
17
|
+
- `POST /capabilities/{name}/test-action` joins `LONG_WORK_REQUESTS`: the
|
|
18
|
+
verifier makes real round-trips to YOUR endpoint, and aborting mid-test
|
|
19
|
+
cannot undo phase A's side effect — so the default deadline is the long one.
|
|
20
|
+
|
|
5
21
|
## 0.10.0 — 2026-07-29
|
|
6
22
|
|
|
7
23
|
- **`AdminApiError.code` — the Admin API's machine-readable failure tag.** The
|
package/README.md
CHANGED
|
@@ -203,6 +203,7 @@ Channel types are checked at compile time: `createChannel` takes a
|
|
|
203
203
|
`CreatableChannelType` (the platform's 31-transport union minus the adapterless
|
|
204
204
|
`internal-a2a`), and `secret` is a named `ChannelSecretInput`. Per-transport
|
|
205
205
|
`secret.extra` fields are listed in <https://pouchy.ai/docs/channel-setup>.
|
|
206
|
+
| Data capabilities | `listCapabilities` (heads + MASKED signing status) · `publishCapability` (immutable next version, idempotent on content) · `setCapabilityDisabled` (per-capability live revoke) · `listCapabilityVersions` (history; rollback = republish an old declaration) · `testReadCapability` · `testActionCapability({ confirmDuplicates: true, … })` (REAL deliveries incl. intentional duplicates — 428 without consent) |
|
|
206
207
|
| Webhooks | `listWebhooks` · `createWebhook` · `updateWebhook` · `rotateWebhookSecret` · `deleteWebhook` · `testWebhook` · `redeliverWebhook` |
|
|
207
208
|
| Reporting | `getUsage` · `getBilling` · `getTracesSummary` · `getRecentTraces` · `getLogs` · `getProject` · `updateProject` |
|
|
208
209
|
| Escape hatch | `request(method, path, body?)` — any endpoint not yet typed |
|
|
@@ -231,6 +232,11 @@ const { run } = await admin.createRun({
|
|
|
231
232
|
console.log(run.id, run.status); // → 'queued'
|
|
232
233
|
```
|
|
233
234
|
|
|
235
|
+
A `subtask_fanout` step runs at most **4** subtasks (`input.subtasks`).
|
|
236
|
+
Declaring more is a **400** naming the cap rather than a silent trim — split
|
|
237
|
+
the remainder into a second fan-out step. Entries without a non-empty `goal`
|
|
238
|
+
are ignored and do not count against the cap.
|
|
239
|
+
|
|
234
240
|
When a run reaches a `human_approval` step it **parks**: it holds no lease and
|
|
235
241
|
leaves the platform's due window, so nothing will move it until you answer.
|
|
236
242
|
You learn about it either way — the `agent.run_awaiting` webhook pushes the
|
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.11.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
|
|
@@ -623,7 +623,12 @@ export interface AdminClient {
|
|
|
623
623
|
* turn carrying `goal`. Step ids must be unique and match
|
|
624
624
|
* `[A-Za-z0-9_-]{1,64}`; `kind` is one of `agent_turn`, `subtask_fanout`,
|
|
625
625
|
* `human_approval`, `await_event`. Answers **202**, not 201: the run is
|
|
626
|
-
* accepted and has not run yet.
|
|
626
|
+
* accepted and has not run yet.
|
|
627
|
+
*
|
|
628
|
+
* A `subtask_fanout` step runs at most **4** subtasks (`input.subtasks`).
|
|
629
|
+
* Declaring more is a **400** naming the cap, not a silent trim — split the
|
|
630
|
+
* remainder into a second fan-out step. Entries without a non-empty `goal`
|
|
631
|
+
* are ignored and do not count against the cap. */
|
|
627
632
|
createRun(input: {
|
|
628
633
|
agentId: string;
|
|
629
634
|
externalUserId: string;
|
|
@@ -686,6 +691,72 @@ export interface AdminClient {
|
|
|
686
691
|
event: string;
|
|
687
692
|
status: string;
|
|
688
693
|
}>;
|
|
694
|
+
/** Capability heads + MASKED signing status (key IDs and rotation state
|
|
695
|
+
* only — the `pcsk_` plaintext is issued ONCE on the owner plane and is
|
|
696
|
+
* never readable through any API). */
|
|
697
|
+
listCapabilities(): Promise<{
|
|
698
|
+
capabilities: Array<{
|
|
699
|
+
capabilityId: string;
|
|
700
|
+
name: string;
|
|
701
|
+
kind: string;
|
|
702
|
+
latestVersion: number;
|
|
703
|
+
disabled?: boolean;
|
|
704
|
+
}>;
|
|
705
|
+
signing: {
|
|
706
|
+
activeKeyId: string;
|
|
707
|
+
previousKeyId: string | null;
|
|
708
|
+
} | null;
|
|
709
|
+
}>;
|
|
710
|
+
/** Publish the next IMMUTABLE revision. Idempotent on content: an unchanged
|
|
711
|
+
* manifest returns the existing version with `created: false`; different
|
|
712
|
+
* bytes mint version+1 and never rewrite an old one. Publishing is NOT
|
|
713
|
+
* revocation — the per-agent data flags and `setCapabilityDisabled` are
|
|
714
|
+
* the live levers. */
|
|
715
|
+
publishCapability(declaration: Record<string, unknown>): Promise<{
|
|
716
|
+
revision: {
|
|
717
|
+
capabilityId: string;
|
|
718
|
+
version: number;
|
|
719
|
+
revisionHash: string;
|
|
720
|
+
};
|
|
721
|
+
created: boolean;
|
|
722
|
+
}>;
|
|
723
|
+
/** Per-capability live revoke: flips the head's `disabled` bit. Live in
|
|
724
|
+
* BOTH directions on the next resolution — existing sessions lose it from
|
|
725
|
+
* their next turn, new plans/ingress see honest absence; a reconciliation
|
|
726
|
+
* pinned to a revision keeps reconciling. */
|
|
727
|
+
setCapabilityDisabled(name: string, disabled: boolean): Promise<{
|
|
728
|
+
name: string;
|
|
729
|
+
disabled: boolean;
|
|
730
|
+
}>;
|
|
731
|
+
/** Full version history, newest first, WITH declaration bodies. There is no
|
|
732
|
+
* rollback verb: restoring vN = `publishCapability(versions[i].declaration)`,
|
|
733
|
+
* which mints it as the NEXT version (history stays append-only). */
|
|
734
|
+
listCapabilityVersions(name: string): Promise<{
|
|
735
|
+
versions: Array<{
|
|
736
|
+
version: number;
|
|
737
|
+
revisionHash: string;
|
|
738
|
+
publishedAt: string;
|
|
739
|
+
declaration: Record<string, unknown>;
|
|
740
|
+
}>;
|
|
741
|
+
}>;
|
|
742
|
+
/** View integration test: real pinned revision + production signer; returns
|
|
743
|
+
* the curated rows exactly as an agent would see them, the menu/model
|
|
744
|
+
* bytes, and DECODED (never signed, never replayable) claims. */
|
|
745
|
+
testReadCapability(name: string, input?: {
|
|
746
|
+
externalUserId?: string;
|
|
747
|
+
filters?: Record<string, unknown>;
|
|
748
|
+
}): Promise<Record<string, unknown>>;
|
|
749
|
+
/** Action protocol verifier — four phases (connectivity, duplicate
|
|
750
|
+
* same-intent, mismatch, reconcile) against your REAL endpoint, including
|
|
751
|
+
* intentional duplicate deliveries of one actionId; the server refuses
|
|
752
|
+
* (428) without `confirmDuplicates: true`. Phase outcomes use production
|
|
753
|
+
* vocabulary (committed/rejected/unknown) SEPARATELY from protocol
|
|
754
|
+
* verdicts — "Protocol: PASS, outcome: unknown" is a valid result. */
|
|
755
|
+
testActionCapability(name: string, input: {
|
|
756
|
+
confirmDuplicates: true;
|
|
757
|
+
args?: Record<string, unknown>;
|
|
758
|
+
externalUserId?: string;
|
|
759
|
+
}): Promise<Record<string, unknown>>;
|
|
689
760
|
listWebhooks(): Promise<{
|
|
690
761
|
webhooks: unknown[];
|
|
691
762
|
}>;
|
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.11.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;
|
|
@@ -44,7 +44,12 @@ export const LONG_WORK_REQUESTS = [
|
|
|
44
44
|
// GDPR erasure: recursive delete of the instance's whole users/** subtree
|
|
45
45
|
// plus the top-level social graph. A client abort here is the worst of the
|
|
46
46
|
// four — the operator is left not knowing whether the wipe completed.
|
|
47
|
-
{ method: 'DELETE', path: /^\/users\/[^/]+$/ }
|
|
47
|
+
{ method: 'DELETE', path: /^\/users\/[^/]+$/ },
|
|
48
|
+
// The Action protocol verifier makes REAL deliveries to the developer's
|
|
49
|
+
// endpoint (four phases incl. reconcile) — network round-trips we don't
|
|
50
|
+
// control the latency of. An abort mid-test also cannot undo phase A's
|
|
51
|
+
// side effect, so waiting is strictly better than cutting.
|
|
52
|
+
{ method: 'POST', path: /^\/capabilities\/[^/]+\/test-action$/ }
|
|
48
53
|
];
|
|
49
54
|
/** The deadline a given request runs under when the host set no `timeoutMs`.
|
|
50
55
|
* Exported so the contract is assertable without timing anything. */
|
|
@@ -281,6 +286,12 @@ export function createAdminClient(opts) {
|
|
|
281
286
|
cancelRun: (id) => request('DELETE', `/runs/${encodeURIComponent(id)}`),
|
|
282
287
|
resumeRun: (id, input) => request('POST', `/runs/${encodeURIComponent(id)}/resume`, input),
|
|
283
288
|
signalRun: (id, input) => request('POST', `/runs/${encodeURIComponent(id)}/signal`, input),
|
|
289
|
+
listCapabilities: () => request('GET', '/capabilities'),
|
|
290
|
+
publishCapability: (declaration) => request('POST', '/capabilities', declaration),
|
|
291
|
+
setCapabilityDisabled: (name, disabled) => request('PATCH', `/capabilities/${encodeURIComponent(name)}`, { disabled }),
|
|
292
|
+
listCapabilityVersions: (name) => request('GET', `/capabilities/${encodeURIComponent(name)}/versions`),
|
|
293
|
+
testReadCapability: (name, input = {}) => request('POST', `/capabilities/${encodeURIComponent(name)}/test-read`, input),
|
|
294
|
+
testActionCapability: (name, input) => request('POST', `/capabilities/${encodeURIComponent(name)}/test-action`, input),
|
|
284
295
|
listWebhooks: () => request('GET', '/webhooks'),
|
|
285
296
|
createWebhook: (input) => request('POST', '/webhooks', input),
|
|
286
297
|
deleteWebhook: (id) => request('DELETE', `/webhooks/${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.11.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",
|