@pouchy_ai/admin-sdk 0.17.0 → 0.18.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 CHANGED
@@ -2,6 +2,36 @@
2
2
 
3
3
  All notable changes to `@pouchy_ai/admin-sdk` are documented here.
4
4
 
5
+ ## 0.18.0 — 2026-08-07
6
+
7
+ - **`extractJson` takes `reasoningEffort`, and its server default moved to
8
+ `'low'`.** 0.17.0 shipped the endpoint running on the shared one-shot floor of
9
+ `'minimal'`, and nothing could change it — the request accepted a `model` but
10
+ not a thinking budget, so an integrator who noticed the quality had no lever
11
+ short of swapping models.
12
+
13
+ It is measured, not theoretical. An A/B over 26 utterances against an
14
+ integrator's own extractor agreed on kind for all 22 inputs carrying a SINGLE
15
+ directive, and diverged on exactly the two carrying more than one:
16
+ 「以后别叫我宝贝,叫我老板」 came back labelled by its leading clause (a
17
+ boundary) instead of its operative one (a nickname), and 「叫我阿凯,别剧透,
18
+ 我不喜欢虐心结局」 merged three directives into two. In both the summary text
19
+ was correct and complete — only the segmentation collapsed, and in both the
20
+ earlier-appearing kind absorbed the later one. That is the signature of a
21
+ budget that can write one good sentence but cannot deliberate over how many
22
+ items there are, which is exactly what an extraction endpoint is for.
23
+
24
+ `'minimal'` restores 0.17.0's behaviour if you want the cheapest, fastest
25
+ extraction; raise it further when one input can carry several directives at
26
+ once. `AdminReasoningEffort` is exported. Additive — every 0.17.0 call
27
+ compiles unchanged — but note the DEFAULT moved, so extraction calls that pass
28
+ nothing now think one notch harder and cost slightly more.
29
+
30
+ A domain precedence rule ("a nickname wins over a boundary when the user says
31
+ what to call them") still belongs in YOUR schema's `description`, not in this
32
+ endpoint: it forwards your schema verbatim and holds no opinion about your
33
+ vocabulary.
34
+
5
35
  ## 0.17.0 — 2026-08-07
6
36
 
7
37
  - **New `extractJson()` — structured JSON output, outside the companion.**
package/README.md CHANGED
@@ -89,6 +89,63 @@ inside the provider's structured-output subset (root object,
89
89
  `strict: false` for schemas outside it — you still get JSON mode plus
90
90
  server-side validation.
91
91
 
92
+ #### `reasoningEffort` — matters most when one input carries several directives
93
+
94
+ `reasoningEffort` (`'minimal' | 'low' | 'medium' | 'high'`, default `'low'`) is
95
+ the thinking budget. It is worth a moment because extraction fails at the cheap
96
+ tier in a specific, easy-to-miss way: **the summary comes out right and the
97
+ segmentation collapses.**
98
+
99
+ Measured over 26 utterances against an integrator's own extractor, the previous
100
+ floor (`'minimal'`) agreed on kind for all 22 inputs carrying a SINGLE
101
+ directive, then diverged on both inputs carrying more than one — 「以后别叫我宝
102
+ 贝,叫我老板」 labelled by its leading clause (a boundary) rather than its
103
+ operative one (a nickname), and 「叫我阿凯,别剧透,我不喜欢虐心结局」 merged
104
+ three directives into two. In each case the item's own text mentioned every
105
+ clause; only the count and the label were wrong, which is exactly the failure a
106
+ schema check cannot catch.
107
+
108
+ Pass `'minimal'` for the cheapest, fastest extraction when each input carries at
109
+ most one directive. Raise it above the default when the split matters more than
110
+ the latency.
111
+
112
+ Precedence between YOUR kinds — "a nickname wins over a boundary when the user
113
+ also says what to call them" — belongs in the schema's `description`, not here:
114
+ this endpoint forwards your schema verbatim and holds no opinion about your
115
+ vocabulary.
116
+
117
+ ```ts
118
+ const { data } = await admin.extractJson<{ items: { kind: string; summary: string }[] }>({
119
+ content: '以后别叫我宝贝,叫我老板',
120
+ reasoningEffort: 'low',
121
+ schema: {
122
+ type: 'object',
123
+ additionalProperties: false,
124
+ required: ['items'],
125
+ properties: {
126
+ items: {
127
+ type: 'array',
128
+ items: {
129
+ type: 'object',
130
+ additionalProperties: false,
131
+ required: ['kind', 'summary'],
132
+ properties: {
133
+ kind: {
134
+ type: 'string',
135
+ enum: ['nickname', 'boundary', 'preference'],
136
+ // The precedence rule lives HERE, in your vocabulary's own words.
137
+ description:
138
+ 'One directive per item — never merge two of different kinds. If the user says what to CALL them (even alongside what not to), the item is `nickname` and the rejected form goes in the summary; `boundary` is only for a prohibition with no replacement.'
139
+ },
140
+ summary: { type: 'string' }
141
+ }
142
+ }
143
+ }
144
+ }
145
+ }
146
+ });
147
+ ```
148
+
92
149
  Failures are typed rather than prose, so the recoveries are distinguishable:
93
150
  `schema_invalid` (400 — fix the schema; retrying verbatim cannot help),
94
151
  `unavailable` (5xx — transient, back off), and `invalid_json` (502 — a
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const ADMIN_SDK_VERSION = "0.17.0";
1
+ export declare const ADMIN_SDK_VERSION = "0.18.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
@@ -436,6 +436,10 @@ export type SkillKnobResult<T> = T & {
436
436
  reprovisioned: number;
437
437
  truncated: boolean;
438
438
  };
439
+ /** Thinking budget for `extractJson`, cheapest first. Mirrors the server's
440
+ * vocabulary; an unknown value is refused with a 400 by the endpoint rather
441
+ * than forwarded to the provider. */
442
+ export type AdminReasoningEffort = 'minimal' | 'low' | 'medium' | 'high';
439
443
  export interface AdminClient {
440
444
  listAgents(): Promise<{
441
445
  agents: Agent[];
@@ -679,6 +683,17 @@ export interface AdminClient {
679
683
  * completion arrived but did not parse or did not satisfy the schema; the
680
684
  * error carries `raw`, the text actually returned).
681
685
  *
686
+ * `reasoningEffort` is the thinking budget, default `'low'`. It matters more
687
+ * than it sounds for extraction: the shared one-shot floor is `'minimal'`,
688
+ * and an A/B over 26 utterances found that floor agreed on kind for all 22
689
+ * inputs carrying a SINGLE directive, then diverged on both inputs carrying
690
+ * more than one — labelling "以后别叫我宝贝,叫我老板" by its leading clause
691
+ * (a boundary) rather than its operative one (a nickname), and merging three
692
+ * directives into two. The summary text was correct both times; only the
693
+ * segmentation collapsed. Raise it when one input can carry several
694
+ * directives at once and the split matters more than the latency; pass
695
+ * `'minimal'` for the cheapest, fastest extraction.
696
+ *
682
697
  * Tokens roll into the project's month usage like any other model call. */
683
698
  extractJson<T = unknown>(input: {
684
699
  schema: Record<string, unknown>;
@@ -687,6 +702,7 @@ export interface AdminClient {
687
702
  strict?: boolean;
688
703
  model?: string;
689
704
  schemaName?: string;
705
+ reasoningEffort?: AdminReasoningEffort;
690
706
  }): Promise<{
691
707
  data: T;
692
708
  raw: string;
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.17.0';
11
+ export const ADMIN_SDK_VERSION = '0.18.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.17.0",
3
+ "version": "0.18.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",