@namzu/anthropic 3.1.0 → 3.1.1

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 (72) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/package.json +12 -2
  3. package/dist/__tests__/anthropic.test.d.ts +0 -2
  4. package/dist/__tests__/anthropic.test.d.ts.map +0 -1
  5. package/dist/__tests__/anthropic.test.js +0 -425
  6. package/dist/__tests__/anthropic.test.js.map +0 -1
  7. package/dist/__tests__/background-delegation.live.test.d.ts +0 -2
  8. package/dist/__tests__/background-delegation.live.test.d.ts.map +0 -1
  9. package/dist/__tests__/background-delegation.live.test.js +0 -212
  10. package/dist/__tests__/background-delegation.live.test.js.map +0 -1
  11. package/dist/__tests__/block-shape-guard.test.d.ts +0 -2
  12. package/dist/__tests__/block-shape-guard.test.d.ts.map +0 -1
  13. package/dist/__tests__/block-shape-guard.test.js +0 -218
  14. package/dist/__tests__/block-shape-guard.test.js.map +0 -1
  15. package/dist/__tests__/cache-anchors.test.d.ts +0 -2
  16. package/dist/__tests__/cache-anchors.test.d.ts.map +0 -1
  17. package/dist/__tests__/cache-anchors.test.js +0 -220
  18. package/dist/__tests__/cache-anchors.test.js.map +0 -1
  19. package/dist/__tests__/citations.test.d.ts +0 -2
  20. package/dist/__tests__/citations.test.d.ts.map +0 -1
  21. package/dist/__tests__/citations.test.js +0 -189
  22. package/dist/__tests__/citations.test.js.map +0 -1
  23. package/dist/__tests__/content-blocks.test.d.ts +0 -2
  24. package/dist/__tests__/content-blocks.test.d.ts.map +0 -1
  25. package/dist/__tests__/content-blocks.test.js +0 -131
  26. package/dist/__tests__/content-blocks.test.js.map +0 -1
  27. package/dist/__tests__/document-input.test.d.ts +0 -2
  28. package/dist/__tests__/document-input.test.d.ts.map +0 -1
  29. package/dist/__tests__/document-input.test.js +0 -98
  30. package/dist/__tests__/document-input.test.js.map +0 -1
  31. package/dist/__tests__/effort-levels-are-askable.test.d.ts +0 -2
  32. package/dist/__tests__/effort-levels-are-askable.test.d.ts.map +0 -1
  33. package/dist/__tests__/effort-levels-are-askable.test.js +0 -74
  34. package/dist/__tests__/effort-levels-are-askable.test.js.map +0 -1
  35. package/dist/__tests__/error-taxonomy.test.d.ts +0 -16
  36. package/dist/__tests__/error-taxonomy.test.d.ts.map +0 -1
  37. package/dist/__tests__/error-taxonomy.test.js +0 -242
  38. package/dist/__tests__/error-taxonomy.test.js.map +0 -1
  39. package/dist/__tests__/reasoning-close.test.d.ts +0 -2
  40. package/dist/__tests__/reasoning-close.test.d.ts.map +0 -1
  41. package/dist/__tests__/reasoning-close.test.js +0 -219
  42. package/dist/__tests__/reasoning-close.test.js.map +0 -1
  43. package/dist/__tests__/thinking-capability.test.d.ts +0 -2
  44. package/dist/__tests__/thinking-capability.test.d.ts.map +0 -1
  45. package/dist/__tests__/thinking-capability.test.js +0 -206
  46. package/dist/__tests__/thinking-capability.test.js.map +0 -1
  47. package/dist/__tests__/thinking-contract.live.test.d.ts +0 -2
  48. package/dist/__tests__/thinking-contract.live.test.d.ts.map +0 -1
  49. package/dist/__tests__/thinking-contract.live.test.js +0 -97
  50. package/dist/__tests__/thinking-contract.live.test.js.map +0 -1
  51. package/dist/__tests__/thinking-request-body.test.d.ts +0 -2
  52. package/dist/__tests__/thinking-request-body.test.d.ts.map +0 -1
  53. package/dist/__tests__/thinking-request-body.test.js +0 -90
  54. package/dist/__tests__/thinking-request-body.test.js.map +0 -1
  55. package/dist/__tests__/wire-contract.live.test.d.ts +0 -2
  56. package/dist/__tests__/wire-contract.live.test.d.ts.map +0 -1
  57. package/dist/__tests__/wire-contract.live.test.js +0 -272
  58. package/dist/__tests__/wire-contract.live.test.js.map +0 -1
  59. package/src/__tests__/anthropic.test.ts +0 -490
  60. package/src/__tests__/background-delegation.live.test.ts +0 -243
  61. package/src/__tests__/block-shape-guard.test.ts +0 -256
  62. package/src/__tests__/cache-anchors.test.ts +0 -262
  63. package/src/__tests__/citations.test.ts +0 -218
  64. package/src/__tests__/content-blocks.test.ts +0 -153
  65. package/src/__tests__/document-input.test.ts +0 -131
  66. package/src/__tests__/effort-levels-are-askable.test.ts +0 -86
  67. package/src/__tests__/error-taxonomy.test.ts +0 -274
  68. package/src/__tests__/reasoning-close.test.ts +0 -262
  69. package/src/__tests__/thinking-capability.test.ts +0 -235
  70. package/src/__tests__/thinking-contract.live.test.ts +0 -125
  71. package/src/__tests__/thinking-request-body.test.ts +0 -111
  72. package/src/__tests__/wire-contract.live.test.ts +0 -331
@@ -1,98 +0,0 @@
1
- import { describe, expect, it, vi } from 'vitest';
2
- import { ANTHROPIC_CAPABILITIES, AnthropicProvider } from '../client.js';
3
- /**
4
- * The driver declared `supportsDocuments: true` and had no document branch.
5
- *
6
- * Every attachment was mapped as an image block carrying the attachment's
7
- * media type, so a PDF went up as `{ type: 'image', source: { media_type:
8
- * 'application/pdf' } }` — a shape the API rejects. The capability set said
9
- * documents worked, the SDK carried a `DocumentAttachment` type with a page
10
- * of documentation about why native handling is worth having, and the one
11
- * line that would have used it was never written.
12
- *
13
- * The native block is not a nicety: it buys page structure, the provider's
14
- * own extraction, and the citations that make an answer checkable.
15
- */
16
- const PDF = 'JVBERi0xLjQKJSVFT0Y=';
17
- function providerCapturing(seen) {
18
- const provider = new AnthropicProvider({ apiKey: 'test-key' });
19
- provider.client = {
20
- messages: {
21
- create: vi.fn(async (body) => {
22
- seen.body = body;
23
- return (async function* () {
24
- yield { type: 'message_start', message: { id: 'msg_1' } };
25
- yield { type: 'message_delta', delta: { stop_reason: 'end_turn' } };
26
- })();
27
- }),
28
- },
29
- };
30
- return provider;
31
- }
32
- async function bodyFor(params) {
33
- const seen = {};
34
- const provider = providerCapturing(seen);
35
- for await (const _chunk of provider.chatStream({
36
- model: 'm',
37
- messages: [{ role: 'user', content: 'summarize this' }],
38
- ...params,
39
- })) {
40
- // drain
41
- }
42
- return seen.body ?? {};
43
- }
44
- /** The first user message's content blocks, as sent. */
45
- function blocksOf(body) {
46
- const messages = body.messages;
47
- return messages[0]?.content;
48
- }
49
- function withAttachments(attachments) {
50
- return {
51
- messages: [{ role: 'user', content: 'summarize this', attachments }],
52
- };
53
- }
54
- describe('a document attachment reaches the wire as a document', () => {
55
- it('sends a document block, not an image block', async () => {
56
- const body = await bodyFor(withAttachments([{ type: 'document', data: PDF, mediaType: 'application/pdf' }]));
57
- const doc = blocksOf(body).find((b) => b.type === 'document');
58
- expect(doc?.source).toEqual({ type: 'base64', media_type: 'application/pdf', data: PDF });
59
- // The bug in one assertion: it used to be an image block.
60
- expect(blocksOf(body).some((b) => b.type === 'image')).toBe(false);
61
- });
62
- it('keeps the prose ahead of the document', async () => {
63
- const body = await bodyFor(withAttachments([{ type: 'document', data: PDF, mediaType: 'application/pdf' }]));
64
- expect(blocksOf(body)[0]).toMatchObject({ type: 'text', text: 'summarize this' });
65
- });
66
- it('carries the name so the model can refer to the file', async () => {
67
- const body = await bodyFor(withAttachments([
68
- { type: 'document', data: PDF, mediaType: 'application/pdf', name: 'lease.pdf' },
69
- ]));
70
- expect(blocksOf(body).find((b) => b.type === 'document')?.title).toBe('lease.pdf');
71
- });
72
- it('omits the title when the caller supplied no name', async () => {
73
- const body = await bodyFor(withAttachments([{ type: 'document', data: PDF, mediaType: 'application/pdf' }]));
74
- expect(blocksOf(body).find((b) => b.type === 'document')).not.toHaveProperty('title');
75
- });
76
- it('still maps an image attachment as an image', async () => {
77
- const body = await bodyFor(withAttachments([{ type: 'image', data: 'AAAA', mediaType: 'image/png' }]));
78
- expect(blocksOf(body).find((b) => b.type === 'image')?.source).toEqual({
79
- type: 'base64',
80
- media_type: 'image/png',
81
- data: 'AAAA',
82
- });
83
- expect(blocksOf(body).some((b) => b.type === 'document')).toBe(false);
84
- });
85
- it('carries both kinds in one message, in the order given', async () => {
86
- const body = await bodyFor(withAttachments([
87
- { type: 'document', data: PDF, mediaType: 'application/pdf' },
88
- { type: 'image', data: 'AAAA', mediaType: 'image/png' },
89
- ]));
90
- expect(blocksOf(body).map((b) => b.type)).toEqual(['text', 'document', 'image']);
91
- });
92
- });
93
- describe('the capability claim matches the mapper', () => {
94
- it('declares document support, which is now true', () => {
95
- expect(ANTHROPIC_CAPABILITIES.supportsDocuments).toBe(true);
96
- });
97
- });
98
- //# sourceMappingURL=document-input.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"document-input.test.js","sourceRoot":"","sources":["../../src/__tests__/document-input.test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAEjD,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAExE;;;;;;;;;;;;GAYG;AAEH,MAAM,GAAG,GAAG,sBAAsB,CAAA;AAElC,SAAS,iBAAiB,CAAC,IAAwC;IAClE,MAAM,QAAQ,GAAG,IAAI,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAE7D;IAAC,QAAqE,CAAC,MAAM,GAAG;QAChF,QAAQ,EAAE;YACT,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,IAA6B,EAAE,EAAE;gBACrD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;gBAChB,OAAO,CAAC,KAAK,SAAS,CAAC;oBACtB,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAA;oBACzD,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,CAAA;gBACpE,CAAC,CAAC,EAAE,CAAA;YACL,CAAC,CAAC;SACF;KACD,CAAA;IACD,OAAO,QAAQ,CAAA;AAChB,CAAC;AAED,KAAK,UAAU,OAAO,CAAC,MAAqC;IAC3D,MAAM,IAAI,GAAuC,EAAE,CAAA;IACnD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,IAAI,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AC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAA;IACjF,CAAC,CAAC,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,QAAQ,CAAC,yCAAyC,EAAE,GAAG,EAAE;IACxD,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACvD,MAAM,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5D,CAAC,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=effort-levels-are-askable.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"effort-levels-are-askable.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/effort-levels-are-askable.test.ts"],"names":[],"mappings":""}
@@ -1,74 +0,0 @@
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
@@ -1 +0,0 @@
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,eAAe,CAAC,iBAAiB,CAAC,CAAA;QAEnD,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;QACjC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;QACvC,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;QACjC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;QAEnC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,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C1C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,oEAAoE,EAAE,GAAG,EAAE;QAC7E,uEAAuE;QACvE,mEAAmE;QACnE,kCAAkC;QAClC,MAAM,CAAC,GAAG,QAAQ,EAAE,CAAA;QACpB,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IACpF,CAAC,CAAC,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,QAAQ,CAAC,kDAAkD,EAAE,GAAG,EAAE;IACjE,EAAE,CAAC,6DAA6D,EAAE,KAAK,IAAI,EAAE;QAC5E,gEAAgE;QAChE,oEAAoE;QACpE,qDAAqD;QACrD,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAA;QAEzC,MAAM,CAAC,OAAO,KAAK,CAAC,yBAAyB,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QAC/D,MAAM,UAAU,GAAG,KAAK,CAAC,yBAAyB,CAAC,eAAe,CAAC,CAAA;QACnE,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;QACnD,MAAM,CAAC,OAAO,UAAU,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IACrD,CAAC,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"}
@@ -1,16 +0,0 @@
1
- /**
2
- * Provider error taxonomy — Anthropic driver.
3
- *
4
- * The driver hands the request to the vendor SDK and lets whatever the SDK
5
- * rejects with escape verbatim (`RateLimitError`, `BadRequestError`, …).
6
- * Those are vendor types: a caller cannot classify them without importing
7
- * `@anthropic-ai/sdk`, so nothing downstream can distinguish a throttle
8
- * from a context overflow from a bad request.
9
- *
10
- * Transport seam: `AnthropicConfig.baseURL` — the tests point the SDK at a
11
- * loopback server that answers with a scripted status/headers/body. This
12
- * exercises the REAL vendor client (including its own internal retries,
13
- * which this group must not disturb).
14
- */
15
- export {};
16
- //# sourceMappingURL=error-taxonomy.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error-taxonomy.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/error-taxonomy.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
@@ -1,242 +0,0 @@
1
- /**
2
- * Provider error taxonomy — Anthropic driver.
3
- *
4
- * The driver hands the request to the vendor SDK and lets whatever the SDK
5
- * rejects with escape verbatim (`RateLimitError`, `BadRequestError`, …).
6
- * Those are vendor types: a caller cannot classify them without importing
7
- * `@anthropic-ai/sdk`, so nothing downstream can distinguish a throttle
8
- * from a context overflow from a bad request.
9
- *
10
- * Transport seam: `AnthropicConfig.baseURL` — the tests point the SDK at a
11
- * loopback server that answers with a scripted status/headers/body. This
12
- * exercises the REAL vendor client (including its own internal retries,
13
- * which this group must not disturb).
14
- */
15
- import { createServer } from 'node:http';
16
- import { afterEach, describe, expect, it } from 'vitest';
17
- import { AnthropicProvider } from '../client.js';
18
- /** Obviously fake, non-functional token — present only as a leak probe. */
19
- const FAKE_CREDENTIAL = 'sk-ant-FAKE-DO-NOT-USE-0000';
20
- let server;
21
- afterEach(async () => {
22
- if (server) {
23
- await new Promise((resolve) => server?.close(() => resolve()));
24
- server = undefined;
25
- }
26
- });
27
- /** Boot a loopback endpoint that answers every request with `reply`. */
28
- async function startEndpoint(reply) {
29
- server = createServer((_req, res) => {
30
- res.writeHead(reply.status, {
31
- 'Content-Type': 'application/json',
32
- ...(reply.headers ?? {}),
33
- });
34
- res.end(reply.body);
35
- });
36
- await new Promise((resolve) => server?.listen(0, '127.0.0.1', () => resolve()));
37
- const { port } = server.address();
38
- return `http://127.0.0.1:${port}`;
39
- }
40
- /** Boot a loopback endpoint that streams `frames` as an SSE 200 response. */
41
- async function startSseEndpoint(frames) {
42
- server = createServer((_req, res) => {
43
- res.writeHead(200, {
44
- 'Content-Type': 'text/event-stream',
45
- 'Cache-Control': 'no-cache',
46
- Connection: 'keep-alive',
47
- });
48
- res.end(`${frames.join('\n\n')}\n\n`);
49
- });
50
- await new Promise((resolve) => server?.listen(0, '127.0.0.1', () => resolve()));
51
- const { port } = server.address();
52
- return `http://127.0.0.1:${port}`;
53
- }
54
- async function captureChatStreamError(reply) {
55
- const baseURL = await startEndpoint(reply);
56
- // maxRetries is deliberately NOT set: this group classifies errors and
57
- // must leave the vendor SDK's own retry behaviour exactly as it is.
58
- const provider = new AnthropicProvider({
59
- apiKey: 'test-key',
60
- model: 'claude-sonnet-4-5-20250929',
61
- baseURL,
62
- });
63
- try {
64
- for await (const _chunk of provider.chatStream({
65
- model: 'claude-sonnet-4-5-20250929',
66
- messages: [{ role: 'user', content: 'hi' }],
67
- })) {
68
- // drain
69
- }
70
- }
71
- catch (err) {
72
- return err;
73
- }
74
- throw new Error('expected chatStream to throw');
75
- }
76
- async function captureProviderError(provider, signal) {
77
- try {
78
- for await (const _chunk of provider.chatStream({
79
- model: 'claude-sonnet-4-5-20250929',
80
- messages: [{ role: 'user', content: 'hi' }],
81
- signal,
82
- })) {
83
- // drain
84
- }
85
- }
86
- catch (err) {
87
- return err;
88
- }
89
- throw new Error('expected chatStream to throw');
90
- }
91
- describe('@namzu/anthropic — provider error taxonomy', () => {
92
- it('(a) 429 with `retry-after: 2` throws a throttle-classified error carrying retryAfterMs', async () => {
93
- const err = await captureChatStreamError({
94
- status: 429,
95
- headers: { 'retry-after': '2' },
96
- body: JSON.stringify({
97
- type: 'error',
98
- error: { type: 'rate_limit_error', message: 'slow' },
99
- }),
100
- });
101
- expect(err).toMatchObject({
102
- name: 'ProviderRequestError',
103
- kind: 'throttle',
104
- status: 429,
105
- retryAfterMs: 2000,
106
- providerId: 'anthropic',
107
- });
108
- }, 60_000);
109
- it("(c) 400 whose body says the prompt is too long classifies as 'context_overflow'", async () => {
110
- const err = await captureChatStreamError({
111
- status: 400,
112
- body: JSON.stringify({
113
- type: 'error',
114
- error: {
115
- type: 'invalid_request_error',
116
- message: 'prompt is too long: 305231 tokens > 200000 maximum',
117
- },
118
- }),
119
- });
120
- expect(err).toMatchObject({
121
- name: 'ProviderRequestError',
122
- kind: 'context_overflow',
123
- status: 400,
124
- providerId: 'anthropic',
125
- });
126
- }, 30_000);
127
- it("(c) 400 that is not an overflow classifies as 'bad_request'", async () => {
128
- const err = await captureChatStreamError({
129
- status: 400,
130
- body: JSON.stringify({
131
- type: 'error',
132
- error: {
133
- type: 'invalid_request_error',
134
- message: 'messages: at least one message required',
135
- },
136
- }),
137
- });
138
- expect(err).toMatchObject({
139
- name: 'ProviderRequestError',
140
- kind: 'bad_request',
141
- status: 400,
142
- providerId: 'anthropic',
143
- });
144
- }, 30_000);
145
- it("(auth) 401 classifies as 'auth'", async () => {
146
- const err = await captureChatStreamError({
147
- status: 401,
148
- body: JSON.stringify({
149
- type: 'error',
150
- error: { type: 'authentication_error', message: 'invalid x-api-key' },
151
- }),
152
- });
153
- expect(err).toMatchObject({
154
- name: 'ProviderRequestError',
155
- kind: 'auth',
156
- status: 401,
157
- providerId: 'anthropic',
158
- });
159
- }, 30_000);
160
- it("529 (upstream overload) classifies as 'server'", async () => {
161
- const err = await captureChatStreamError({
162
- status: 529,
163
- body: JSON.stringify({
164
- type: 'error',
165
- error: { type: 'overloaded_error', message: 'Overloaded' },
166
- }),
167
- });
168
- expect(err).toMatchObject({
169
- name: 'ProviderRequestError',
170
- kind: 'server',
171
- status: 529,
172
- providerId: 'anthropic',
173
- });
174
- }, 60_000);
175
- it("MID-STREAM: an `event: error` frame after a 200 classifies as 'server'", async () => {
176
- // The vendor SDK's SSE reader throws its own `APIError` for an
177
- // `event: error` frame (core/streaming: `if (sse.event === 'error')`),
178
- // so the driver's event switch never sees it — the vendor error escapes
179
- // the driver unclassified, with the frame body interpolated.
180
- const baseURL = await startSseEndpoint([
181
- 'event: message_start\ndata: {"type":"message_start","message":{"id":"msg_1","usage":{"input_tokens":5,"output_tokens":0}}}',
182
- 'event: content_block_delta\ndata: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"partial"}}',
183
- 'event: error\ndata: {"type":"error","error":{"type":"overloaded_error","message":"Overloaded"}}',
184
- ]);
185
- const provider = new AnthropicProvider({
186
- apiKey: 'test-key',
187
- model: 'claude-sonnet-4-5-20250929',
188
- baseURL,
189
- });
190
- let caught;
191
- try {
192
- for await (const _chunk of provider.chatStream({
193
- model: 'claude-sonnet-4-5-20250929',
194
- messages: [{ role: 'user', content: 'hi' }],
195
- })) {
196
- // drain
197
- }
198
- }
199
- catch (err) {
200
- caught = err;
201
- }
202
- expect(caught).toMatchObject({
203
- name: 'ProviderRequestError',
204
- kind: 'server',
205
- providerId: 'anthropic',
206
- });
207
- }, 30_000);
208
- it('(d) SECURITY: a credential echoed back in a 401 body never reaches the thrown message', async () => {
209
- const err = await captureChatStreamError({
210
- status: 401,
211
- body: JSON.stringify({
212
- type: 'error',
213
- error: {
214
- type: 'authentication_error',
215
- message: `invalid x-api-key ${FAKE_CREDENTIAL}`,
216
- },
217
- }),
218
- });
219
- expect(err.message).not.toContain(FAKE_CREDENTIAL);
220
- expect(JSON.stringify(err)).not.toContain(FAKE_CREDENTIAL);
221
- expect('cause' in err).toBe(false);
222
- }, 30_000);
223
- it('preserves the caller abort reason when the SDK replaces the error object', async () => {
224
- const controller = new AbortController();
225
- const reason = new Error('user stopped');
226
- const sdkAbort = Object.assign(new Error('request aborted'), {
227
- name: 'APIUserAbortError',
228
- });
229
- controller.abort(reason);
230
- const provider = new AnthropicProvider({
231
- apiKey: 'test-key',
232
- model: 'claude-sonnet-4-5-20250929',
233
- });
234
- provider.client = {
235
- messages: { create: async () => Promise.reject(sdkAbort) },
236
- };
237
- const err = await captureProviderError(provider, controller.signal);
238
- expect(sdkAbort).not.toBe(reason);
239
- expect(err).toBe(reason);
240
- });
241
- });
242
- //# sourceMappingURL=error-taxonomy.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error-tax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C,CAAA;QACxB,MAAM,QAAQ,GAAG,IAAI,iBAAiB,CAAC;YACtC,MAAM,EAAE,UAAU;YAClB,KAAK,EAAE,4BAA4B;SACnC,CAAC,CACD;QAAC,QAA2C,CAAC,MAAM,GAAG;YACtD,QAAQ,EAAE,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;SAC1D,CAAA;QAED,MAAM,GAAG,GAAG,MAAM,oBAAoB,CAAC,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,CAAA;QAEnE,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACjC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACzB,CAAC,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=reasoning-close.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reasoning-close.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/reasoning-close.test.ts"],"names":[],"mappings":""}