@paraharness/claude 0.1.0 → 0.2.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 +2 -2
- package/dist/builders/claude-model-options.d.ts +2 -2
- package/dist/builders/claude-model-options.d.ts.map +1 -1
- package/dist/builders/claude-namespace-contract.d.ts +3 -3
- package/dist/builders/claude-namespace-contract.d.ts.map +1 -1
- package/dist/builders/create-claude-model-builder.d.ts +6 -6
- package/dist/builders/create-claude-model-builder.d.ts.map +1 -1
- package/dist/builders/create-claude-model-builder.js +13 -12
- package/dist/builders/create-claude-model-builder.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -33,12 +33,12 @@ const seatA = claude.cliAccount('seat-a').configDir('~/.claude-seat-a');
|
|
|
33
33
|
const apiFallback = claude.cliAccount('api-fallback').apiKey(P.env('ANTHROPIC_API_KEY'));
|
|
34
34
|
|
|
35
35
|
const claudeSeats = P.pool('claude-seats')
|
|
36
|
-
.
|
|
36
|
+
.with(seatA)
|
|
37
37
|
.strategy('soonest-reset')
|
|
38
38
|
.fallback(apiFallback);
|
|
39
39
|
|
|
40
40
|
const opus = claude
|
|
41
|
-
.model('
|
|
41
|
+
.model('claude-opus-4-6', { effort: 'high' })
|
|
42
42
|
.accountPool(claudeSeats);
|
|
43
43
|
|
|
44
44
|
const reviewer = P.agent('reviewer')
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* extended thinking effort budget applied across turns.
|
|
6
6
|
*/
|
|
7
7
|
export interface ClaudeModelOptions {
|
|
8
|
-
/** Anthropic wire model identifier (such as `'claude-sonnet-4-6'`
|
|
9
|
-
readonly id
|
|
8
|
+
/** Optional Anthropic wire model identifier (defaults to `alias`, such as `'claude-sonnet-4-6'`). */
|
|
9
|
+
readonly id?: string;
|
|
10
10
|
/** Optional reasoning effort level controlling extended thinking budget allocation. */
|
|
11
11
|
readonly effort?: 'low' | 'medium' | 'high';
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-model-options.d.ts","sourceRoot":"","sources":["../../src/builders/claude-model-options.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,
|
|
1
|
+
{"version":3,"file":"claude-model-options.d.ts","sourceRoot":"","sources":["../../src/builders/claude-model-options.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,qGAAqG;IACrG,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,uFAAuF;IACvF,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;CAC7C"}
|
|
@@ -37,13 +37,13 @@ export interface ClaudeNamespace {
|
|
|
37
37
|
*
|
|
38
38
|
* Supports `.accountPool(pool)` / `.pool(pool)` and `.effort(level)` before compiling to `ClaudeModelNode`.
|
|
39
39
|
*
|
|
40
|
-
* @param {string} alias
|
|
41
|
-
* @param {ClaudeModelOptions} options - Anthropic model identifier and
|
|
40
|
+
* @param {string} alias - Logical model alias (such as `'sonnet'` or `'claude-sonnet-4-6'`).
|
|
41
|
+
* @param {ClaudeModelOptions} [options] - Optional Anthropic model identifier (`defaults to alias`) and thinking effort.
|
|
42
42
|
*
|
|
43
43
|
* @returns {ClaudeModelBuilder} Fluent builder for the Claude model node.
|
|
44
44
|
*
|
|
45
45
|
* @throws {Error} If `alias` or `options.id` is empty or whitespace-only.
|
|
46
46
|
*/
|
|
47
|
-
model(alias: string, options
|
|
47
|
+
model(alias: string, options?: ClaudeModelOptions): ClaudeModelBuilder;
|
|
48
48
|
}
|
|
49
49
|
//# sourceMappingURL=claude-namespace-contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-namespace-contract.d.ts","sourceRoot":"","sources":["../../src/builders/claude-namespace-contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;;OAUG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,wBAAwB,CAAC;IAEjD;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,wBAAwB,CAAC;IAE9C;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"claude-namespace-contract.d.ts","sourceRoot":"","sources":["../../src/builders/claude-namespace-contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;;OAUG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,wBAAwB,CAAC;IAEjD;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,wBAAwB,CAAC;IAE9C;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,kBAAkB,CAAC;CACxE"}
|
|
@@ -4,16 +4,16 @@ import type { ClaudeModelOptions } from './claude-model-options.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* Creates an immutable `ClaudeModelBuilder` for an Anthropic Claude model configuration.
|
|
6
6
|
*
|
|
7
|
-
* Validates that both `alias` and `options
|
|
8
|
-
* passive `ClaudeModelNode` without performing network or environment I/O.
|
|
7
|
+
* Validates that both `alias` and the resolved `modelId` (`options?.id ?? alias`) are non-empty
|
|
8
|
+
* strings and compiles to a frozen passive `ClaudeModelNode` without performing network or environment I/O.
|
|
9
9
|
*
|
|
10
|
-
* @param {string} alias
|
|
11
|
-
* @param {ClaudeModelOptions} options -
|
|
12
|
-
* @param {PoolNode<ClaudeAccountSeatNode> | undefined} accountPool - Optional compiled pool of Claude account seats.
|
|
10
|
+
* @param {string} alias - Logical alias of the model.
|
|
11
|
+
* @param {ClaudeModelOptions} [options] - Optional provider model identifier and effort level.
|
|
12
|
+
* @param {PoolNode<ClaudeAccountSeatNode> | undefined} [accountPool] - Optional compiled pool of Claude account seats.
|
|
13
13
|
*
|
|
14
14
|
* @returns {ClaudeModelBuilder} Immutable builder compiling to `ClaudeModelNode`.
|
|
15
15
|
*
|
|
16
16
|
* @throws {Error} If `alias` or `options.id` is empty or whitespace-only.
|
|
17
17
|
*/
|
|
18
|
-
export declare function createClaudeModelBuilder(alias: string, options
|
|
18
|
+
export declare function createClaudeModelBuilder(alias: string, options?: ClaudeModelOptions, accountPool?: PoolNode<ClaudeAccountSeatNode>): ClaudeModelBuilder;
|
|
19
19
|
//# sourceMappingURL=create-claude-model-builder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-claude-model-builder.d.ts","sourceRoot":"","sources":["../../src/builders/create-claude-model-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,qBAAqB,EAG1B,KAAK,QAAQ,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"create-claude-model-builder.d.ts","sourceRoot":"","sources":["../../src/builders/create-claude-model-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,qBAAqB,EAG1B,KAAK,QAAQ,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,kBAAkB,EAC5B,WAAW,CAAC,EAAE,QAAQ,CAAC,qBAAqB,CAAC,GAC5C,kBAAkB,CAwCpB"}
|
|
@@ -2,12 +2,12 @@ import { extractAST, } from '@paraharness/core';
|
|
|
2
2
|
/**
|
|
3
3
|
* Creates an immutable `ClaudeModelBuilder` for an Anthropic Claude model configuration.
|
|
4
4
|
*
|
|
5
|
-
* Validates that both `alias` and `options
|
|
6
|
-
* passive `ClaudeModelNode` without performing network or environment I/O.
|
|
5
|
+
* Validates that both `alias` and the resolved `modelId` (`options?.id ?? alias`) are non-empty
|
|
6
|
+
* strings and compiles to a frozen passive `ClaudeModelNode` without performing network or environment I/O.
|
|
7
7
|
*
|
|
8
|
-
* @param {string} alias
|
|
9
|
-
* @param {ClaudeModelOptions} options -
|
|
10
|
-
* @param {PoolNode<ClaudeAccountSeatNode> | undefined} accountPool - Optional compiled pool of Claude account seats.
|
|
8
|
+
* @param {string} alias - Logical alias of the model.
|
|
9
|
+
* @param {ClaudeModelOptions} [options] - Optional provider model identifier and effort level.
|
|
10
|
+
* @param {PoolNode<ClaudeAccountSeatNode> | undefined} [accountPool] - Optional compiled pool of Claude account seats.
|
|
11
11
|
*
|
|
12
12
|
* @returns {ClaudeModelBuilder} Immutable builder compiling to `ClaudeModelNode`.
|
|
13
13
|
*
|
|
@@ -17,28 +17,29 @@ export function createClaudeModelBuilder(alias, options, accountPool) {
|
|
|
17
17
|
if (alias.trim().length === 0) {
|
|
18
18
|
throw new Error('Claude model alias must be a non-empty string.');
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
const resolvedModelId = options?.id ?? alias;
|
|
21
|
+
if (resolvedModelId.trim().length === 0) {
|
|
21
22
|
throw new Error(`Claude model '${alias}' options.id must be a non-empty string.`);
|
|
22
23
|
}
|
|
23
24
|
const astNode = Object.freeze({
|
|
24
25
|
type: 'claude:model',
|
|
25
26
|
vendor: 'anthropic',
|
|
26
27
|
alias,
|
|
27
|
-
modelId:
|
|
28
|
-
effort: options
|
|
28
|
+
modelId: resolvedModelId,
|
|
29
|
+
effort: options?.effort,
|
|
29
30
|
accountPool,
|
|
30
31
|
});
|
|
31
32
|
return Object.freeze({
|
|
32
33
|
alias,
|
|
33
|
-
modelId:
|
|
34
|
+
modelId: resolvedModelId,
|
|
34
35
|
effort(level) {
|
|
35
|
-
return createClaudeModelBuilder(alias, { id:
|
|
36
|
+
return createClaudeModelBuilder(alias, { id: resolvedModelId, effort: level }, accountPool);
|
|
36
37
|
},
|
|
37
38
|
accountPool(pool) {
|
|
38
|
-
return createClaudeModelBuilder(alias, options, extractAST(pool));
|
|
39
|
+
return createClaudeModelBuilder(alias, { id: resolvedModelId, effort: options?.effort }, extractAST(pool));
|
|
39
40
|
},
|
|
40
41
|
pool(pool) {
|
|
41
|
-
return createClaudeModelBuilder(alias, options, extractAST(pool));
|
|
42
|
+
return createClaudeModelBuilder(alias, { id: resolvedModelId, effort: options?.effort }, extractAST(pool));
|
|
42
43
|
},
|
|
43
44
|
toAST() {
|
|
44
45
|
return astNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-claude-model-builder.js","sourceRoot":"","sources":["../../src/builders/create-claude-model-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,GAKX,MAAM,mBAAmB,CAAC;AAI3B;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,wBAAwB,CACtC,KAAa,EACb,
|
|
1
|
+
{"version":3,"file":"create-claude-model-builder.js","sourceRoot":"","sources":["../../src/builders/create-claude-model-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,GAKX,MAAM,mBAAmB,CAAC;AAI3B;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,wBAAwB,CACtC,KAAa,EACb,OAA4B,EAC5B,WAA6C;IAE7C,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IACD,MAAM,eAAe,GAAG,OAAO,EAAE,EAAE,IAAI,KAAK,CAAC;IAC7C,IAAI,eAAe,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,iBAAiB,KAAK,0CAA0C,CAAC,CAAC;IACpF,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAkB;QAC7C,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE,WAAW;QACnB,KAAK;QACL,OAAO,EAAE,eAAe;QACxB,MAAM,EAAE,OAAO,EAAE,MAAM;QACvB,WAAW;KACZ,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,MAAM,CAAqB;QACvC,KAAK;QACL,OAAO,EAAE,eAAe;QACxB,MAAM,CAAC,KAAgC;YACrC,OAAO,wBAAwB,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,WAAW,CAAC,CAAC;QAC9F,CAAC;QACD,WAAW,CAAC,IAAmD;YAC7D,OAAO,wBAAwB,CAC7B,KAAK,EACL,EAAE,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAChD,UAAU,CAAC,IAAI,CAAC,CACjB,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,IAAmD;YACtD,OAAO,wBAAwB,CAC7B,KAAK,EACL,EAAE,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAChD,UAAU,CAAC,IAAI,CAAC,CACjB,CAAC;QACJ,CAAC;QACD,KAAK;YACH,OAAO,OAAO,CAAC;QACjB,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraharness/claude",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Anthropic Claude ModelDriver and AST builders for Paraharness supporting API key and CLI OAuth subscription seats, KV prefix caching, and thinking signature preservation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"paraharness",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@anthropic-ai/sdk": "^1.6.0",
|
|
47
47
|
"zod": "^4.6.7",
|
|
48
|
-
"@paraharness/core": "0.
|
|
48
|
+
"@paraharness/core": "0.2.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/node": "^22.9.0",
|