@aeye/anthropic 0.0.0-stage → 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/README.md +109 -3
- package/aeye-anthropic.md +109 -0
- package/dist/anthropic.d.ts +349 -0
- package/dist/anthropic.d.ts.map +1 -0
- package/dist/anthropic.js +726 -0
- package/dist/anthropic.js.map +1 -0
- package/dist/convert.d.ts +263 -0
- package/dist/convert.d.ts.map +1 -0
- package/dist/convert.js +808 -0
- package/dist/convert.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/models.d.ts +136 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +80 -0
- package/dist/models.js.map +1 -0
- package/dist/retry.d.ts +104 -0
- package/dist/retry.d.ts.map +1 -0
- package/dist/retry.js +181 -0
- package/dist/retry.js.map +1 -0
- package/dist/types.d.ts +45 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +72 -0
- package/dist/types.js.map +1 -0
- package/package.json +74 -4
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Errors the Anthropic provider throws.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Base error for the Anthropic provider, with the underlying error as its
|
|
6
|
+
* cause.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* throw new ProviderError('anthropic', 'Invalid model specified', originalError);
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare class ProviderError extends Error {
|
|
14
|
+
provider: string;
|
|
15
|
+
cause?: Error | undefined;
|
|
16
|
+
constructor(provider: string, message: string, cause?: Error | undefined);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The API key was rejected (401) or lacks permission (403).
|
|
20
|
+
*/
|
|
21
|
+
export declare class ProviderAuthError extends ProviderError {
|
|
22
|
+
constructor(provider: string, cause?: Error);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Rate limited (429) or overloaded (529) after every retry, with the wait
|
|
26
|
+
* the API asked for when it said.
|
|
27
|
+
*/
|
|
28
|
+
export declare class RateLimitError extends ProviderError {
|
|
29
|
+
retryAfter?: number | undefined;
|
|
30
|
+
constructor(provider: string, message: string, retryAfter?: number | undefined, cause?: Error);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A spend limit was reached (a 429 that waiting doesn't fix).
|
|
34
|
+
*/
|
|
35
|
+
export declare class ProviderQuotaError extends ProviderError {
|
|
36
|
+
constructor(provider: string, cause?: Error);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The prompt is longer than the model's context window.
|
|
40
|
+
*/
|
|
41
|
+
export declare class ContextWindowError extends ProviderError {
|
|
42
|
+
contextWindow?: number | undefined;
|
|
43
|
+
constructor(provider: string, message: string, contextWindow?: number | undefined, cause?: Error);
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;GAQG;AACH,qBAAa,aAAc,SAAQ,KAAK;IAG7B,QAAQ,EAAE,MAAM;IAGhB,KAAK,CAAC,EAAE,KAAK;gBAHb,QAAQ,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,EAER,KAAK,CAAC,EAAE,KAAK,YAAA;CAKvB;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,aAAa;gBACtC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAI5C;AAED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,aAAa;IAKtC,UAAU,CAAC,EAAE,MAAM;gBAH1B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EAER,UAAU,CAAC,EAAE,MAAM,YAAA,EAC1B,KAAK,CAAC,EAAE,KAAK;CAKhB;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,aAAa;gBACvC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAI5C;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,aAAa;IAK1C,aAAa,CAAC,EAAE,MAAM;gBAH7B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EAER,aAAa,CAAC,EAAE,MAAM,YAAA,EAC7B,KAAK,CAAC,EAAE,KAAK;CAKhB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Errors the Anthropic provider throws.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Base error for the Anthropic provider, with the underlying error as its
|
|
6
|
+
* cause.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* throw new ProviderError('anthropic', 'Invalid model specified', originalError);
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export class ProviderError extends Error {
|
|
14
|
+
provider;
|
|
15
|
+
cause;
|
|
16
|
+
constructor(
|
|
17
|
+
// The provider identifier
|
|
18
|
+
provider, message,
|
|
19
|
+
// Original error that caused this provider error
|
|
20
|
+
cause) {
|
|
21
|
+
super(`[${provider}] ${message}`);
|
|
22
|
+
this.provider = provider;
|
|
23
|
+
this.cause = cause;
|
|
24
|
+
this.name = 'ProviderError';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The API key was rejected (401) or lacks permission (403).
|
|
29
|
+
*/
|
|
30
|
+
export class ProviderAuthError extends ProviderError {
|
|
31
|
+
constructor(provider, cause) {
|
|
32
|
+
super(provider, 'Authentication failed', cause);
|
|
33
|
+
this.name = 'ProviderAuthError';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Rate limited (429) or overloaded (529) after every retry, with the wait
|
|
38
|
+
* the API asked for when it said.
|
|
39
|
+
*/
|
|
40
|
+
export class RateLimitError extends ProviderError {
|
|
41
|
+
retryAfter;
|
|
42
|
+
constructor(provider, message,
|
|
43
|
+
// Seconds to wait before retrying, from `retry-after`
|
|
44
|
+
retryAfter, cause) {
|
|
45
|
+
super(provider, message, cause);
|
|
46
|
+
this.retryAfter = retryAfter;
|
|
47
|
+
this.name = 'RateLimitError';
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A spend limit was reached (a 429 that waiting doesn't fix).
|
|
52
|
+
*/
|
|
53
|
+
export class ProviderQuotaError extends ProviderError {
|
|
54
|
+
constructor(provider, cause) {
|
|
55
|
+
super(provider, 'Spend limit reached', cause);
|
|
56
|
+
this.name = 'ProviderQuotaError';
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The prompt is longer than the model's context window.
|
|
61
|
+
*/
|
|
62
|
+
export class ContextWindowError extends ProviderError {
|
|
63
|
+
contextWindow;
|
|
64
|
+
constructor(provider, message,
|
|
65
|
+
// The context window in tokens, when the error says
|
|
66
|
+
contextWindow, cause) {
|
|
67
|
+
super(provider, message, cause);
|
|
68
|
+
this.contextWindow = contextWindow;
|
|
69
|
+
this.name = 'ContextWindowError';
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;GAQG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IAG7B;IAGA;IALT;IACE,0BAA0B;IACnB,QAAgB,EACvB,OAAe;IACf,iDAAiD;IAC1C,KAAa;QAEpB,KAAK,CAAC,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC,CAAC;QAL3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
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.11.0",
|
|
4
|
+
"description": "@aeye Anthropic - Claude (Anthropic Messages API) integration for @aeye",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"require": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"default": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc",
|
|
23
|
+
"test": "jest",
|
|
24
|
+
"test:unit": "jest --testPathIgnorePatterns=__integration__",
|
|
25
|
+
"test:integration": "jest --testPathPattern=__integration__",
|
|
26
|
+
"test:coverage": "jest --coverage --testPathIgnorePatterns=__integration__",
|
|
27
|
+
"test:watch": "jest --watch",
|
|
28
|
+
"clean": "rimraf dist tsconfig.tsbuildinfo",
|
|
29
|
+
"typecheck": "tsc --noEmit",
|
|
30
|
+
"live:matrix": "tsx scripts/live-matrix.ts && npm run live:measured",
|
|
31
|
+
"live:report": "tsx scripts/live-report.ts ../../docs/plans/anthropic-measured-2026-11.md",
|
|
32
|
+
"live:models": "tsx scripts/list-models.ts",
|
|
33
|
+
"live:measured": "npm run models:measured -w @aeye/models -- anthropic"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"ai",
|
|
37
|
+
"anthropic",
|
|
38
|
+
"claude",
|
|
39
|
+
"typescript"
|
|
40
|
+
],
|
|
41
|
+
"author": "ClickerMonkey",
|
|
42
|
+
"license": "GPL-3.0",
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "https://github.com/ClickerMonkey/aeye.git",
|
|
46
|
+
"directory": "packages/anthropic"
|
|
47
|
+
},
|
|
48
|
+
"files": [
|
|
49
|
+
"dist",
|
|
50
|
+
"README.md",
|
|
51
|
+
"LICENSE",
|
|
52
|
+
"aeye-*.md"
|
|
53
|
+
],
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@aeye/ai": "^0.11.0",
|
|
56
|
+
"@aeye/core": "^0.11.0",
|
|
57
|
+
"@anthropic-ai/sdk": "^1.14.0"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@types/jest": "^30.0.0",
|
|
61
|
+
"@types/node": "^24.10.1",
|
|
62
|
+
"jest": "^30.2.0",
|
|
63
|
+
"ts-jest": "^29.4.5",
|
|
64
|
+
"typescript": "^5.9.3"
|
|
65
|
+
},
|
|
66
|
+
"publishConfig": {
|
|
67
|
+
"access": "public"
|
|
68
|
+
},
|
|
69
|
+
"engines": {
|
|
70
|
+
"node": ">=22.0.0"
|
|
71
|
+
},
|
|
72
|
+
"homepage": "https://github.com/ClickerMonkey/aeye#readme",
|
|
73
|
+
"bugs": {
|
|
74
|
+
"url": "https://github.com/ClickerMonkey/aeye/issues"
|
|
75
|
+
}
|
|
76
|
+
}
|