@pouchy_ai/admin-sdk 0.15.1 → 0.16.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/README.md +8 -0
- package/dist/index.d.ts +32 -15
- package/dist/index.js +1 -1
- 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.16.0 — 2026-08-06
|
|
6
|
+
|
|
7
|
+
- **Catches the package up to a server change that already shipped.**
|
|
8
|
+
`PATCH /skills/{slug}` with `{ ratePerMin }` used to be the only skill knob
|
|
9
|
+
that did not push the updated def to the project's running instances — and the
|
|
10
|
+
per-minute budget is read off each instance's provisioned def, not the record
|
|
11
|
+
the PATCH writes, so a rate you set persisted, echoed back on read, and reached
|
|
12
|
+
**no running agent** until an unrelated persona edit bumped the agent's
|
|
13
|
+
`templateRev`. That was fixed server-side, and every knob now also returns
|
|
14
|
+
`truncated`. This package still typed the old shapes — `setSkillRate` as
|
|
15
|
+
`Promise<{ ratePerMin }>`, the other two without `truncated` — so the typed
|
|
16
|
+
client was asserting a contract the server had already stopped honouring.
|
|
17
|
+
|
|
18
|
+
- **New `SkillKnobResult<T>` — every skill knob returns `reprovisioned` and
|
|
19
|
+
`truncated`.** `setSkillRate`, `setSkillDailyCap` and `grantSkill` now share
|
|
20
|
+
one result shape. `truncated: true` means the re-push swept its cap (100
|
|
21
|
+
agents / 200 instances) and the remainder were NOT refreshed — and they do not
|
|
22
|
+
catch up on their next session, they keep the OLD def until a persona edit
|
|
23
|
+
bumps `templateRev`. **A revoking call that returns `truncated: true` is a
|
|
24
|
+
PARTIAL revocation**; re-issue it or make a persona edit before treating it as
|
|
25
|
+
complete.
|
|
26
|
+
|
|
27
|
+
Additive and backward compatible: the previously-returned fields are all still
|
|
28
|
+
present with the same names and types, so existing destructuring keeps
|
|
29
|
+
compiling. Only widen your own annotations if you had hand-written the old
|
|
30
|
+
return types.
|
|
31
|
+
|
|
5
32
|
## 0.15.1 — 2026-08-03
|
|
6
33
|
|
|
7
34
|
- **Docs fix: `MonthUsage.mauLimit` prescribed a call that does not compile.**
|
package/README.md
CHANGED
|
@@ -58,6 +58,14 @@ console.log(`armed — ${armed.reprovisioned} running instance(s) updated`);
|
|
|
58
58
|
// The agent can now drive the API from the skill's prose via http_request.
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
+
Every skill knob (`setSkillRate`, `setSkillDailyCap`, `grantSkill`) returns
|
|
62
|
+
`SkillKnobResult<T>` — the knob you set plus `reprovisioned` (instances the new
|
|
63
|
+
def reached) and `truncated`. A knob only binds a running agent once the def
|
|
64
|
+
reaches its instance, so `truncated: true` means the sweep hit its cap (100
|
|
65
|
+
agents / 200 instances) and the remainder still hold the **old** def; they do
|
|
66
|
+
not catch up on their next session. Treat a *revoking* call that returns
|
|
67
|
+
`truncated: true` as a partial revocation and re-issue it.
|
|
68
|
+
|
|
61
69
|
## Options
|
|
62
70
|
|
|
63
71
|
```ts
|
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.16.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
|
|
@@ -421,6 +421,21 @@ export interface AdminRun {
|
|
|
421
421
|
createdAt: string;
|
|
422
422
|
updatedAt: string;
|
|
423
423
|
}
|
|
424
|
+
/** What every skill-knob PATCH reports about the re-push, on top of the knob it
|
|
425
|
+
* echoes. A knob only takes effect on a running agent once the def reaches its
|
|
426
|
+
* instance, so these two fields are the outcome, not decoration.
|
|
427
|
+
*
|
|
428
|
+
* `reprovisioned` — instances refreshed by this call.
|
|
429
|
+
* `truncated` — the sweep hit a cap (100 agents / 200 instances) and the
|
|
430
|
+
* remainder were NOT refreshed. They do not catch up on their next session:
|
|
431
|
+
* they keep the OLD def until a persona edit bumps the agent's templateRev. So
|
|
432
|
+
* a revoking call (e.g. clearing a grant) that returns `truncated: true` is a
|
|
433
|
+
* PARTIAL revocation — re-issue it, or make a persona edit, before treating it
|
|
434
|
+
* as complete. */
|
|
435
|
+
export type SkillKnobResult<T> = T & {
|
|
436
|
+
reprovisioned: number;
|
|
437
|
+
truncated: boolean;
|
|
438
|
+
};
|
|
424
439
|
export interface AdminClient {
|
|
425
440
|
listAgents(): Promise<{
|
|
426
441
|
agents: Agent[];
|
|
@@ -656,23 +671,26 @@ export interface AdminClient {
|
|
|
656
671
|
version: number;
|
|
657
672
|
};
|
|
658
673
|
}>;
|
|
659
|
-
/** Generic PATCH of a skill's knobs. The response echoes
|
|
660
|
-
*
|
|
661
|
-
* `
|
|
662
|
-
*
|
|
663
|
-
*
|
|
674
|
+
/** Generic PATCH of a skill's knobs. The response echoes the knob(s) you
|
|
675
|
+
* changed plus the re-push outcome every knob now carries
|
|
676
|
+
* (`reprovisioned`, `truncated`) — prefer the typed conveniences
|
|
677
|
+
* (setSkillRate / setSkillDailyCap / grantSkill) for a precise return
|
|
678
|
+
* type. */
|
|
664
679
|
updateSkill(slug: string, patch: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
665
|
-
/** Set a skill's per-minute call budget (1..120; null restores the default).
|
|
666
|
-
|
|
680
|
+
/** Set a skill's per-minute call budget (1..120; null restores the default).
|
|
681
|
+
* Re-pushes the def to running instances — the limiter reads the budget off
|
|
682
|
+
* each instance's provisioned def, so a saved rate that was not re-pushed
|
|
683
|
+
* reached no running agent (server-side fix; this signature now carries the
|
|
684
|
+
* outcome the other knobs already returned). */
|
|
685
|
+
setSkillRate(slug: string, ratePerMin: number | null): Promise<SkillKnobResult<{
|
|
667
686
|
ratePerMin: number | null;
|
|
668
|
-
}
|
|
687
|
+
}>>;
|
|
669
688
|
/** Set a skill's opt-in daily call ceiling — max HTTP calls per rolling 24h
|
|
670
689
|
* (1..20000; null clears it, leaving only the per-minute cap). A runaway
|
|
671
690
|
* guard for autonomous outbound. Re-pushes the def to running instances. */
|
|
672
|
-
setSkillDailyCap(slug: string, maxCallsPerDay: number | null): Promise<{
|
|
691
|
+
setSkillDailyCap(slug: string, maxCallsPerDay: number | null): Promise<SkillKnobResult<{
|
|
673
692
|
maxCallsPerDay: number | null;
|
|
674
|
-
|
|
675
|
-
}>;
|
|
693
|
+
}>>;
|
|
676
694
|
/** Compile a docs-only skill's prose (curl snippets / endpoint tables) into
|
|
677
695
|
* declared `http` tools via a one-shot LLM, then re-install the result
|
|
678
696
|
* (safety gate + version archive → reversible via rollback). Each tool is
|
|
@@ -694,11 +712,10 @@ export interface AdminClient {
|
|
|
694
712
|
grantSkill(slug: string, grant: {
|
|
695
713
|
freeHttp: boolean;
|
|
696
714
|
grantedDomains?: string[];
|
|
697
|
-
}): Promise<{
|
|
715
|
+
}): Promise<SkillKnobResult<{
|
|
698
716
|
freeHttp: boolean;
|
|
699
717
|
grantedDomains: string[];
|
|
700
|
-
|
|
701
|
-
}>;
|
|
718
|
+
}>>;
|
|
702
719
|
uninstallSkill(slug: string): Promise<{
|
|
703
720
|
deleted: boolean;
|
|
704
721
|
}>;
|
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.16.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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pouchy_ai/admin-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.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",
|