@namzu/anthropic 3.0.0 → 3.1.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.
Files changed (32) hide show
  1. package/CHANGELOG.md +99 -0
  2. package/dist/__tests__/background-delegation.live.test.d.ts +2 -0
  3. package/dist/__tests__/background-delegation.live.test.d.ts.map +1 -0
  4. package/dist/__tests__/background-delegation.live.test.js +212 -0
  5. package/dist/__tests__/background-delegation.live.test.js.map +1 -0
  6. package/dist/__tests__/effort-levels-are-askable.test.d.ts +2 -0
  7. package/dist/__tests__/effort-levels-are-askable.test.d.ts.map +1 -0
  8. package/dist/__tests__/effort-levels-are-askable.test.js +74 -0
  9. package/dist/__tests__/effort-levels-are-askable.test.js.map +1 -0
  10. package/dist/__tests__/thinking-capability.test.js +6 -1
  11. package/dist/__tests__/thinking-capability.test.js.map +1 -1
  12. package/dist/__tests__/wire-contract.live.test.js +102 -16
  13. package/dist/__tests__/wire-contract.live.test.js.map +1 -1
  14. package/dist/client.d.ts +15 -1
  15. package/dist/client.d.ts.map +1 -1
  16. package/dist/client.js +25 -1
  17. package/dist/client.js.map +1 -1
  18. package/dist/index.d.ts +2 -0
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +8 -0
  21. package/dist/index.js.map +1 -1
  22. package/dist/thinking-capability.d.ts.map +1 -1
  23. package/dist/thinking-capability.js +23 -2
  24. package/dist/thinking-capability.js.map +1 -1
  25. package/package.json +2 -2
  26. package/src/__tests__/background-delegation.live.test.ts +243 -0
  27. package/src/__tests__/effort-levels-are-askable.test.ts +86 -0
  28. package/src/__tests__/thinking-capability.test.ts +6 -1
  29. package/src/__tests__/wire-contract.live.test.ts +111 -17
  30. package/src/client.ts +28 -1
  31. package/src/index.ts +18 -0
  32. package/src/thinking-capability.ts +23 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,104 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 585a592: A caller can ask which effort levels a model accepts.
8
+
9
+ The answer existed, was modelled carefully, and was reachable only from inside
10
+ one driver. That matters because effort is **refused, not clamped**: a level a
11
+ model does not have makes the vendor reject the request, so a control offering
12
+ the wrong one produces a run that fails at the start rather than a quieter one.
13
+
14
+ Every option open to a caller without the answer was bad. Offering all five
15
+ breaks some models. Offering the intersection hides `xhigh` and `max` from every
16
+ model that has them, which is most of the reason to build such a control. And
17
+ copying the table looks fine and is worst: the ceiling has moved twice already,
18
+ so a copy goes stale on the next model and goes stale **silently**, surfacing as
19
+ a vendor rejection rather than a failing build.
20
+
21
+ **New optional `LLMProvider.effortLevelsFor(model, thinking?)`.** Three states,
22
+ each meaning something different: the method absent means the driver has no
23
+ effort concept at all and setting one will be refused; an empty array means the
24
+ driver implements effort and this model has none; a non-empty array is the set
25
+ to offer.
26
+
27
+ **`thinking` is a parameter, and that is the point.** At least one model family
28
+ accepts a narrower set while thinking is disabled than while it is on — so an
29
+ API returning two sibling arrays invites a caller to render a picker from one
30
+ and send the other, a combination the vendor rejects, on exactly one family.
31
+ Passing the configuration you will actually send makes that unspellable: there
32
+ is one answer and it is the one for your request.
33
+
34
+ The driver's implementation shares the same two resolution steps the request
35
+ path uses, so a caller's picker and the request it produces cannot disagree.
36
+
37
+ `@namzu/anthropic` also now exports `resolveThinkingCapability`,
38
+ `resolveThinkingBody`, `resolveEffort` and their types, for a caller that needs
39
+ the fuller picture — whether thinking can be switched off at all, not only which
40
+ effort levels apply. Prefer `effortLevelsFor` where it suffices: it is
41
+ provider-agnostic and cannot return the wrong one of the two sets.
42
+
43
+ Separately, the live wire-contract suite now retries a transient status rather
44
+ than reporting it as a contract failure. A 529 says the service is busy and
45
+ answers nothing about whether a schema is expressible — so a test named "every
46
+ shipped tool is expressible on this wire" was claiming something the run had not
47
+ established. That cost two manual re-runs in one day to discover the wire had no
48
+ opinion.
49
+
50
+ ## 3.0.1
51
+
52
+ ### Patch Changes
53
+
54
+ - 062624c: `effort` can be set on a run — and so, for the first time, can `thinking`.
55
+
56
+ `effort` was on the provider params, exported, and read by a driver that wrote
57
+ it to the wire, and nothing in the kernel ever set it. Every request went out at
58
+ the model's default, which reads as "this model ignores effort" rather than
59
+ "nobody plumbed it through".
60
+
61
+ `AgentRunConfig` gains `effort`, a sibling of `thinking` rather than a field
62
+ inside it — on some models the two are independent controls that apply together,
63
+ and nesting would make that combination unsayable. It is run-level rather than
64
+ per-step because the provider documents that changing effort between requests
65
+ does not preserve a cached prefix, so a value that moves between steps buys a
66
+ different answer shape at the cost of the cache on every step that changes it.
67
+
68
+ **`thinking` turned out to have the same defect, and had shipped with it.** It
69
+ was settable only through `drainQuery`. Every ergonomic entry point — `runAgent`,
70
+ `ReactiveAgent`, `SupervisorAgent`, and the agent manager's bare-config branch —
71
+ builds its run config by hand-listing fields, so a field nobody remembered to add
72
+ is dropped in silence, with no cast to blame and no error to see. A caller could
73
+ set `thinking` on an agent config and get a run that never asked for it. Both
74
+ fields now live on `BaseAgentConfig` and are forwarded by all four.
75
+
76
+ This was found by watching an actual HTTP body from a real run. The unit tests
77
+ passed throughout, because they drive the kernel directly, and the kernel was
78
+ never the half that was broken.
79
+
80
+ **A driver that cannot honour `effort` now refuses rather than dropping it**,
81
+ the rule `thinking` already had. Effort is the worse silence of the two: a
82
+ dropped `thinking` leaves an empty reasoning list someone might notice, while a
83
+ dropped `effort` leaves a perfectly ordinary answer, so a run requested at `max`
84
+ is indistinguishable from one at the default — including in what it cost.
85
+ Nothing existing breaks, because the field could not be set until now.
86
+
87
+ Two driver-side corrections ride along, both verified against the live wire:
88
+
89
+ - The preview model's capability row claimed all five effort levels. It takes
90
+ `max` and not `xhigh`. That model is not reachable from the tenant the live
91
+ suite runs against, so the row is sourced from the reference rather than
92
+ measured — but the pairing itself is now measured, on a model that has it:
93
+ `claude-sonnet-4-6` answers `xhigh` with _"This model does not support effort
94
+ level 'xhigh'. Supported levels: high, low, max, medium"_ and accepts `max`.
95
+ Reading the levels as a ladder, where anything taking the top rung takes the
96
+ one below, is what produced the wrong row.
97
+ - `output_config` is now merged rather than assigned. It is a shared envelope on
98
+ that wire — a structured-output format and a task budget live in it too — so
99
+ assigning meant whoever wired the next one would silently delete effort, or
100
+ have effort delete theirs, depending only on which line ran last.
101
+
3
102
  ## 3.0.0
4
103
 
5
104
  ### Major Changes
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=background-delegation.live.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"background-delegation.live.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/background-delegation.live.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,212 @@
1
+ import { CompletionInbox, ToolRegistry, buildCoordinatorTools, drainQuery, runAgent, } from '@namzu/sdk';
2
+ import { describe, expect, it } from 'vitest';
3
+ import { AnthropicProvider } from '../client.js';
4
+ /**
5
+ * Does a real model actually receive a worker it stopped waiting for?
6
+ *
7
+ * Everything else about this mechanism is tested against fakes: the inbox
8
+ * queues what nobody claimed, the tools claim what they deliver, the loop
9
+ * drains the rest into the transcript. All of it can be true and the feature
10
+ * still useless, because the part that decides whether it works is whether a
11
+ * MODEL reads the notification and acts on it — and no fake can answer that.
12
+ *
13
+ * So this runs the whole thing against the live API: a real supervisor model,
14
+ * a real worker model, a background launch, and an assertion that the answer
15
+ * the supervisor finally gives contains something only the worker knew.
16
+ *
17
+ * The gateway here is deliberately hand-rolled over `runAgent` rather than
18
+ * the kernel's `LocalTaskGateway`. That is the shape a host implements, so it
19
+ * doubles as proof that the inbox needs nothing from a gateway beyond the
20
+ * `onTaskCompleted` every gateway already has.
21
+ *
22
+ * Skipped without a key. Run with:
23
+ *
24
+ * ANTHROPIC_API_KEY=… pnpm --filter @namzu/anthropic test
25
+ */
26
+ const KEY = process.env.ANTHROPIC_API_KEY;
27
+ const MODEL = process.env.NAMZU_WIRE_TEST_MODEL ?? 'claude-haiku-4-5';
28
+ /** The fact only the worker can know, so its presence proves delivery. */
29
+ const SECRET = 'PELICAN-7731';
30
+ function provider() {
31
+ return new AnthropicProvider({ apiKey: KEY, model: MODEL });
32
+ }
33
+ /**
34
+ * A host-shaped gateway: spawns a real child run per task and announces it.
35
+ *
36
+ * Nothing here is kernel code. It implements `TaskGateway` the way an
37
+ * embedding application does, which is the point — the inbox attaches to it
38
+ * unchanged.
39
+ */
40
+ function liveGateway() {
41
+ const handles = new Map();
42
+ const settled = new Map();
43
+ const listeners = new Set();
44
+ let seq = 0;
45
+ return {
46
+ async createTask({ agentId, prompt }) {
47
+ seq += 1;
48
+ const taskId = `tsk_live_${seq}`;
49
+ const handle = {
50
+ taskId: taskId,
51
+ agentId,
52
+ state: 'running',
53
+ createdAt: Date.now(),
54
+ };
55
+ handles.set(taskId, handle);
56
+ settled.set(taskId, runAgent({
57
+ provider: provider(),
58
+ model: MODEL,
59
+ prompt,
60
+ instructions: 'Answer in one short sentence. Do not explain yourself.',
61
+ maxIterations: 2,
62
+ tokenBudget: 20_000,
63
+ }).then((run) => {
64
+ const done = {
65
+ ...handle,
66
+ state: 'completed',
67
+ completedAt: Date.now(),
68
+ result: {
69
+ status: 'completed',
70
+ result: run.output ?? '',
71
+ },
72
+ };
73
+ handles.set(taskId, done);
74
+ for (const cb of listeners)
75
+ cb(done);
76
+ return done;
77
+ }));
78
+ return handle;
79
+ },
80
+ waitForTask: async (taskId) => {
81
+ const pending = settled.get(taskId);
82
+ if (!pending)
83
+ throw new Error(`no task ${taskId}`);
84
+ return pending;
85
+ },
86
+ continueTask: async () => undefined,
87
+ cancelTask: () => undefined,
88
+ getTask: (taskId) => handles.get(taskId),
89
+ listTasks: () => [...handles.values()],
90
+ onTaskCompleted: (cb) => {
91
+ listeners.add(cb);
92
+ return () => listeners.delete(cb);
93
+ },
94
+ };
95
+ }
96
+ describe.skipIf(!KEY)('a background worker reaches a real supervisor', () => {
97
+ it('delivers the result through the transcript, with no polling', async () => {
98
+ const gateway = liveGateway();
99
+ const inbox = new CompletionInbox();
100
+ inbox.attach(gateway);
101
+ const tools = new ToolRegistry();
102
+ for (const tool of buildCoordinatorTools({
103
+ gateway,
104
+ completionInbox: inbox,
105
+ workingDirectory: process.cwd(),
106
+ allowedAgentIds: ['lookup'],
107
+ })) {
108
+ tools.register(tool);
109
+ }
110
+ const run = await drainQuery({
111
+ provider: provider(),
112
+ tools,
113
+ completionInbox: inbox,
114
+ agentId: 'supervisor',
115
+ agentName: 'Supervisor',
116
+ messages: [
117
+ {
118
+ role: 'user',
119
+ content: [
120
+ 'Delegate to the "lookup" agent, in the BACKGROUND (background: true), this exact prompt:',
121
+ `"Reply with exactly this token and nothing else: ${SECRET}"`,
122
+ '',
123
+ 'Do not wait for it with wait_for_task and do not list tasks in a loop.',
124
+ 'After launching it, just say "launched" and stop.',
125
+ 'Its result will arrive on its own; when it does, reply with the token you received.',
126
+ ].join('\n'),
127
+ timestamp: Date.now(),
128
+ },
129
+ ],
130
+ workingDirectory: process.cwd(),
131
+ runConfig: {
132
+ model: MODEL,
133
+ timeoutMs: 180_000,
134
+ tokenBudget: 200_000,
135
+ maxIterations: 6,
136
+ maxResponseTokens: 1_024,
137
+ },
138
+ sessionId: 'ses_live_delegation',
139
+ threadId: 'thd_live_delegation',
140
+ projectId: 'prj_live_delegation',
141
+ tenantId: 'tnt_live_delegation',
142
+ });
143
+ const transcript = run.messages
144
+ .filter((m) => m.role === 'user')
145
+ .map((m) => (typeof m.content === 'string' ? m.content : JSON.stringify(m.content)))
146
+ .join('\n');
147
+ // 1. The notification actually landed in the supervisor's transcript.
148
+ expect(transcript, 'no task-notification reached the transcript').toContain('task-notification');
149
+ expect(transcript).toContain(SECRET);
150
+ // 2. The model read it. This is the half no fake can establish: the
151
+ // worker's token appears in the supervisor's own final answer, and
152
+ // the supervisor never had it any other way.
153
+ expect(run.result ?? '', 'the supervisor never used what it was told').toContain(SECRET);
154
+ // 3. It got there without polling, which is the whole complaint the
155
+ // fix answers — `agent_task_list` in a sleep loop was the only move
156
+ // on the board before this.
157
+ const listCalls = (run.steps ?? [])
158
+ .flatMap((s) => s.toolCalls ?? [])
159
+ .filter((c) => c.function.name === 'agent_task_list');
160
+ expect(listCalls.length, 'the model still had to poll').toBe(0);
161
+ }, 300_000);
162
+ it('still delivers the result inline when the launch is not backgrounded', async () => {
163
+ // The path `dc16d58` protects: a blocking launch answers as its own
164
+ // tool_result, and must NOT also arrive as an envelope.
165
+ const gateway = liveGateway();
166
+ const inbox = new CompletionInbox();
167
+ inbox.attach(gateway);
168
+ const tools = new ToolRegistry();
169
+ for (const tool of buildCoordinatorTools({
170
+ gateway,
171
+ completionInbox: inbox,
172
+ workingDirectory: process.cwd(),
173
+ allowedAgentIds: ['lookup'],
174
+ })) {
175
+ tools.register(tool);
176
+ }
177
+ const run = await drainQuery({
178
+ provider: provider(),
179
+ tools,
180
+ completionInbox: inbox,
181
+ agentId: 'supervisor',
182
+ agentName: 'Supervisor',
183
+ messages: [
184
+ {
185
+ role: 'user',
186
+ content: `Use create_task on the "lookup" agent with this prompt: "Reply with exactly this token and nothing else: ${SECRET}". Do NOT set background. Then report the token it returned.`,
187
+ timestamp: Date.now(),
188
+ },
189
+ ],
190
+ workingDirectory: process.cwd(),
191
+ runConfig: {
192
+ model: MODEL,
193
+ timeoutMs: 180_000,
194
+ tokenBudget: 200_000,
195
+ maxIterations: 6,
196
+ maxResponseTokens: 1_024,
197
+ },
198
+ sessionId: 'ses_live_delegation',
199
+ threadId: 'thd_live_delegation',
200
+ projectId: 'prj_live_delegation',
201
+ tenantId: 'tnt_live_delegation',
202
+ });
203
+ expect(run.result ?? '').toContain(SECRET);
204
+ const transcript = run.messages
205
+ .filter((m) => m.role === 'user')
206
+ .map((m) => (typeof m.content === 'string' ? m.content : JSON.stringify(m.content)))
207
+ .join('\n');
208
+ // Delivered once, as a tool_result — no duplicate envelope.
209
+ expect(transcript, 'the blocking result was announced a second time').not.toContain('task-notification');
210
+ }, 300_000);
211
+ });
212
+ //# sourceMappingURL=background-delegation.live.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"background-delegation.live.test.js","sourceRoot":"","sources":["../../src/__tests__/background-delegation.live.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,YAAY,EACZ,qBAAqB,EACrB,UAAU,EACV,QAAQ,GACR,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAA;AACzC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,kBAAkB,CAAA;AAErE,0EAA0E;AAC1E,MAAM,MAAM,GAAG,cAAc,CAAA;AAE7B,SAAS,QAAQ;IAChB,OAAO,IAAI,iBAAiB,CAAC,EAAE,MAAM,EAAE,GAAa,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;AACtE,CAAC;AAED;;;;;;GAMG;AACH,SAAS,WAAW;IACnB,MAAM,OAAO,GAAG,IAAI,GAAG,EAAsB,CAAA;IAC7C,MAAM,OAAO,GAAG,IAAI,GAAG,EAA+B,CAAA;IACtD,MAAM,SAAS,GAAG,IAAI,GAAG,EAA2B,CAAA;IACpD,IAAI,GAAG,GAAG,CAAC,CAAA;IAEX,OAAO;QACN,KAAK,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE;YACnC,GAAG,IAAI,CAAC,CAAA;YACR,MAAM,MAAM,GAAG,YAAY,GAAG,EAAE,CAAA;YAChC,MAAM,MAAM,GAAe;gBAC1B,MAAM,EAAE,MAA8B;gBACtC,OAAO;gBACP,KAAK,EAAE,SAAS;gBAChB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;aACrB,CAAA;YACD,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,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AQ,EAAE,qBAAqB;SAC/B,CAAC,CAAA;QAEF,MAAM,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;QAE1C,MAAM,UAAU,GAAG,GAAG,CAAC,QAAQ;aAC7B,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC;aAChC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;aACnF,IAAI,CAAC,IAAI,CAAC,CAAA;QAEZ,4DAA4D;QAC5D,MAAM,CAAC,UAAU,EAAE,iDAAiD,CAAC,CAAC,GAAG,CAAC,SAAS,CAClF,mBAAmB,CACnB,CAAA;IACF,CAAC,EAAE,OAAO,CAAC,CAAA;AACZ,CAAC,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=effort-levels-are-askable.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"effort-levels-are-askable.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/effort-levels-are-askable.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,74 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { AnthropicProvider } from '../client.js';
3
+ /**
4
+ * A caller building an effort control has to offer the levels a model actually
5
+ * accepts, and only those, because effort is REFUSED rather than clamped: a
6
+ * level a model does not have makes the vendor reject the request, so a picker
7
+ * offering the wrong one produces a run that fails at the start.
8
+ *
9
+ * The driver already knew the answer and kept it to itself. Every option open
10
+ * to a caller without it was bad: offer all five and break some models, offer
11
+ * the intersection and hide the levels that are most of the reason to build the
12
+ * control, or copy the table — which looks fine and is worst, because the
13
+ * ceiling has moved twice and a copy goes stale SILENTLY, surfacing as a vendor
14
+ * rejection rather than a failing build.
15
+ */
16
+ const provider = () => new AnthropicProvider({ apiKey: 'sk-ant-test', model: 'claude-sonnet-5' });
17
+ describe('a caller can ask which levels a model takes', () => {
18
+ it('answers per model rather than per provider', () => {
19
+ // Three eras, three different answers. If this ever collapses to one
20
+ // set, the method has been reduced to a constant and the question it
21
+ // exists to answer has stopped being asked.
22
+ const p = provider();
23
+ const modern = p.effortLevelsFor('claude-opus-5');
24
+ const midRange = p.effortLevelsFor('claude-sonnet-4-6');
25
+ const legacy = p.effortLevelsFor('claude-opus-4-5');
26
+ expect(modern).toContain('xhigh');
27
+ expect(midRange).not.toContain('xhigh');
28
+ expect(midRange).toContain('max');
29
+ expect(legacy).not.toContain('max');
30
+ const distinct = new Set([modern, midRange, legacy].map((s) => [...s].sort().join(',')));
31
+ expect(distinct.size, 'the three eras must not answer alike').toBe(3);
32
+ });
33
+ it('reports an empty set rather than nothing for a model with no levels', () => {
34
+ // A real answer, and different from the method being absent. Absent
35
+ // means the driver has no effort concept at all; empty means it does
36
+ // and this model has none.
37
+ expect(provider().effortLevelsFor('claude-haiku-4-5')).toEqual([]);
38
+ });
39
+ });
40
+ describe('the answer depends on the thinking configuration you will send', () => {
41
+ it('narrows for the family that caps effort while thinking is off', () => {
42
+ // The trap this signature exists to remove. A caller reading a single
43
+ // `effort` array, rendering a picker, and then also sending
44
+ // `thinking: disabled` produces a combination the vendor rejects — on
45
+ // exactly one family, which is why it survives casual testing.
46
+ const p = provider();
47
+ const withThinking = p.effortLevelsFor('claude-opus-5', { type: 'adaptive' });
48
+ const withoutThinking = p.effortLevelsFor('claude-opus-5', { type: 'disabled' });
49
+ expect(withThinking).toContain('max');
50
+ expect(withoutThinking).not.toContain('max');
51
+ expect(withoutThinking).not.toContain('xhigh');
52
+ expect(withoutThinking).toContain('high');
53
+ });
54
+ it('does not narrow for a sibling that accepts the full set either way', () => {
55
+ // Measured, not inferred: the cap belongs to one family, and a version
56
+ // comparison of "5 and later" would have caught this model too and
57
+ // hidden levels the wire honours.
58
+ const p = provider();
59
+ expect(p.effortLevelsFor('claude-sonnet-5', { type: 'disabled' })).toContain('max');
60
+ });
61
+ });
62
+ describe('the resolver is reachable for the fuller picture', () => {
63
+ it('is exported from the package entry, not only its own module', async () => {
64
+ // The whole report was that the answer existed and could not be
65
+ // reached. A caller that also needs to know whether thinking can be
66
+ // switched off at all reads the capability directly.
67
+ const entry = await import('../index.js');
68
+ expect(typeof entry.resolveThinkingCapability).toBe('function');
69
+ const capability = entry.resolveThinkingCapability('claude-opus-5');
70
+ expect(capability.effort.length).toBeGreaterThan(0);
71
+ expect(typeof capability.canDisable).toBe('boolean');
72
+ });
73
+ });
74
+ //# sourceMappingURL=effort-levels-are-askable.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"effort-levels-are-askable.test.js","sourceRoot":"","sources":["../../src/__tests__/effort-levels-are-askable.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD;;;;;;;;;;;;GAYG;AAEH,MAAM,QAAQ,GAAG,GAAsB,EAAE,CACxC,IAAI,iBAAiB,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC,CAAA;AAE3E,QAAQ,CAAC,6CAA6C,EAAE,GAAG,EAAE;IAC5D,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QACrD,qEAAqE;QACrE,qEAAqE;QACrE,4CAA4C;QAC5C,MAAM,CAAC,GAAG,QAAQ,EAAE,CAAA;QACpB,MAAM,MAAM,GAAG,CAAC,CAAC,eAAe,CAAC,eAAe,CAAC,CAAA;QACjD,MAAM,QAAQ,GAAG,CAAC,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAA;QACvD,MAAM,MAAM,GAAG,CAAC,CAAC,eA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AAC,CAAA;IACrD,CAAC,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"}
@@ -30,7 +30,12 @@ const TABLE = [
30
30
  // Always-on families: thinking cannot be switched off at any version.
31
31
  ['claude-fable-5', true, false, false, ALL, ALL],
32
32
  ['claude-mythos-5', true, false, false, ALL, ALL],
33
- ['claude-mythos-preview', true, true, false, ALL, ALL],
33
+ // The preview takes `max` and NOT `xhigh`, which is the pairing it is easy
34
+ // to assume away — the reference says outright that some models supporting
35
+ // `max` do not support `xhigh`, and this is one. Reading the levels as a
36
+ // ladder is what put ALL on this row originally, and a ladder reading sends
37
+ // a level the wire rejects.
38
+ ['claude-mythos-preview', true, true, false, NO_XHIGH, NO_XHIGH],
34
39
  // 4.7 and later: adaptive only, and it can still be disabled.
35
40
  ['claude-opus-5', true, false, true, ALL, CAPPED],
36
41
  ['claude-sonnet-5', true, false, true, ALL, ALL],
@@ -1 +1 @@
1
- {"version":3,"file":"thinking-capability.test.js","sourceRoot":"","sources":["../../src/__tests__/thinking-capability.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EACN,aAAa,EACb,mBAAmB,EACnB,yBAAyB,GACzB,MAAM,2BAA2B,CAAA;AAElC;;;;;;;;;;GAUG;AAEH,MAAM,GAAG,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;AACrD,gEAAgE;AAChE,MAAM,QAAQ,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;AACjD,uBAAuB;AACvB,MAAM,IAAI,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;AACtC,MAAM,IAAI,GAAa,EAAE,CAAA;AAEzB;;;;;;;GAOG;AACH,MAAM,MAAM,GAAG,IAAI,CAAA,CAAC,4BAA4B;AAChD,MAA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ACzE,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,aAAa,EAAE,CAAA;QAC3E,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACxE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC/C,MAAM,KAAK,GAAG,yBAAyB,CAAC,eAAe,CAAC,CAAA;QACxD,KAAK,MAAM,KAAK,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAU,EAAE,CAAC;YACxE,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC7E,CAAC;IACF,CAAC,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"}
@@ -26,24 +26,52 @@ import { findDraft07Only, findStrictSchemaViolations, getBuiltinTools, renderToo
26
26
  */
27
27
  const KEY = process.env.ANTHROPIC_API_KEY;
28
28
  const MODEL = process.env.NAMZU_WIRE_TEST_MODEL ?? 'claude-haiku-4-5';
29
+ /**
30
+ * Statuses that mean "ask again", not "this request is wrong".
31
+ *
32
+ * These tests assert a CONTRACT: that a given schema is or is not expressible
33
+ * on this wire. A 529 says the service is busy and answers nothing about the
34
+ * schema — so reporting it as a contract failure claims something the run did
35
+ * not establish. That happened twice in one day, and both times cost a manual
36
+ * re-run to discover the wire had no opinion.
37
+ *
38
+ * Retried rather than reported inconclusive because a test that sometimes
39
+ * declines to check is a test nobody trusts, and the retry is cheap: these
40
+ * requests set `max_tokens: 1` and are rejected or accepted at validation.
41
+ */
42
+ const TRANSIENT = new Set([429, 500, 502, 503, 529]);
43
+ async function post(body) {
44
+ let last = { ok: false, status: 0, message: 'no attempt made' };
45
+ for (let attempt = 1; attempt <= 4; attempt += 1) {
46
+ const res = await fetch('https://api.anthropic.com/v1/messages', {
47
+ method: 'POST',
48
+ headers: {
49
+ 'x-api-key': KEY,
50
+ 'anthropic-version': '2023-06-01',
51
+ 'content-type': 'application/json',
52
+ },
53
+ body: JSON.stringify(body),
54
+ });
55
+ const parsed = await res.json().catch(() => ({}));
56
+ const message = parsed?.error?.message ??
57
+ (res.ok ? '' : 'unknown');
58
+ last = { ok: res.ok, status: res.status, message };
59
+ if (!TRANSIENT.has(res.status))
60
+ return last;
61
+ await new Promise((resolve) => setTimeout(resolve, 1_500 * attempt));
62
+ }
63
+ // Exhausted. Returned rather than thrown so the assertion names the status
64
+ // — a bare failure here reads as a rejected schema, which is the confusion
65
+ // this whole helper exists to prevent.
66
+ return last;
67
+ }
29
68
  async function offerTools(tools) {
30
- const res = await fetch('https://api.anthropic.com/v1/messages', {
31
- method: 'POST',
32
- headers: {
33
- 'x-api-key': KEY,
34
- 'anthropic-version': '2023-06-01',
35
- 'content-type': 'application/json',
36
- },
37
- body: JSON.stringify({
38
- model: MODEL,
39
- max_tokens: 1,
40
- messages: [{ role: 'user', content: 'hi' }],
41
- tools,
42
- }),
69
+ return post({
70
+ model: MODEL,
71
+ max_tokens: 1,
72
+ messages: [{ role: 'user', content: 'hi' }],
73
+ tools,
43
74
  });
44
- const body = await res.json().catch(() => ({}));
45
- const message = body?.error?.message ?? (res.ok ? '' : 'unknown');
46
- return { ok: res.ok, status: res.status, message };
47
75
  }
48
76
  /** A tool as this driver would put it on the wire. */
49
77
  function wireTool(name, schema, strict) {
@@ -165,6 +193,64 @@ describe.skipIf(!KEY)('the strict subset is what the deny-list says it is', () =
165
193
  expect(result.message).toMatch(/2020-12/);
166
194
  }, 180_000);
167
195
  });
196
+ describe.skipIf(!KEY)('the positional shape a bridged tool now emits', () => {
197
+ it('is accepted once converted', async () => {
198
+ // The MCP adapter emits a tuple ONLY where the server pinned the arity
199
+ // and closed the tail, because that renders as bounded `prefixItems`.
200
+ // The narrowness is the design rather than caution: a tool schema this
201
+ // wire refuses fails the WHOLE request instead of degrading one tool,
202
+ // so a faithful conversion it will not take is strictly worse than a
203
+ // lossy one it will.
204
+ //
205
+ // The refusal half of this pair is already asserted above, on the
206
+ // unconverted spelling — so this says something the sweep does not:
207
+ // that the shape we CHOSE to emit is one the wire takes.
208
+ const pinned = {
209
+ type: 'object',
210
+ properties: {
211
+ pair: {
212
+ type: 'array',
213
+ minItems: 2,
214
+ maxItems: 2,
215
+ items: [{ type: 'string' }, { type: 'number' }],
216
+ },
217
+ },
218
+ required: ['pair'],
219
+ additionalProperties: false,
220
+ };
221
+ const result = await offerTools([wireTool('pinned_pair', pinned, false)]);
222
+ expect(result.ok, result.message).toBe(true);
223
+ }, 180_000);
224
+ });
225
+ describe.skipIf(!KEY)('effort is a per-model SET, and this wire says so itself', () => {
226
+ // Through the same retrying helper: a 529 here would read as "this model
227
+ // refuses that level", which is the exact claim these tests exist to make
228
+ // and the exact claim an overloaded service cannot support.
229
+ const withEffort = (model, effort) => post({
230
+ model,
231
+ max_tokens: 16,
232
+ messages: [{ role: 'user', content: 'Say OK.' }],
233
+ output_config: { effort },
234
+ });
235
+ it('takes all five levels on a model the table says has all five', async () => {
236
+ for (const effort of ['low', 'medium', 'high', 'xhigh', 'max']) {
237
+ const result = await withEffort('claude-sonnet-5', effort);
238
+ expect(result.ok, `${effort}: ${result.message}`).toBe(true);
239
+ }
240
+ }, 180_000);
241
+ it('refuses a level a model lacks, and names the set it has', async () => {
242
+ // The pairing the capability table exists to express: `max` WITHOUT
243
+ // `xhigh`. A boolean could not have said this, and reading the levels
244
+ // as a ladder — where anything taking the top rung takes the one below
245
+ // — gets it backwards. That reading is how a row in that table came to
246
+ // claim a level this wire rejects.
247
+ const refused = await withEffort('claude-sonnet-4-6', 'xhigh');
248
+ expect(refused.ok).toBe(false);
249
+ expect(refused.message).toContain('xhigh');
250
+ const accepted = await withEffort('claude-sonnet-4-6', 'max');
251
+ expect(accepted.ok, accepted.message).toBe(true);
252
+ }, 180_000);
253
+ });
168
254
  describe('what can be checked without a key', () => {
169
255
  it('leaves no draft-07-only construct in any shipped tool', () => {
170
256
  // The offline half of the same guarantee, so a contributor without a