@keel_flow/runtime 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/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/agent-runtime.d.ts +8 -0
- package/dist/agent-runtime.d.ts.map +1 -0
- package/dist/agent-runtime.js +9 -0
- package/dist/agent-runtime.js.map +1 -0
- package/dist/client.d.ts +15 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +16 -0
- package/dist/client.js.map +1 -0
- package/dist/cost.d.ts +3 -0
- package/dist/cost.d.ts.map +1 -0
- package/dist/cost.js +52 -0
- package/dist/cost.js.map +1 -0
- package/dist/dispatch-subagent.d.ts +24 -0
- package/dist/dispatch-subagent.d.ts.map +1 -0
- package/dist/dispatch-subagent.js +90 -0
- package/dist/dispatch-subagent.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/provider.d.ts +55 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +18 -0
- package/dist/provider.js.map +1 -0
- package/dist/providers/anthropic.d.ts +9 -0
- package/dist/providers/anthropic.d.ts.map +1 -0
- package/dist/providers/anthropic.js +116 -0
- package/dist/providers/anthropic.js.map +1 -0
- package/dist/providers/claude-bridge.d.ts +20 -0
- package/dist/providers/claude-bridge.d.ts.map +1 -0
- package/dist/providers/claude-bridge.js +109 -0
- package/dist/providers/claude-bridge.js.map +1 -0
- package/dist/providers/openai-compatible.d.ts +9 -0
- package/dist/providers/openai-compatible.d.ts.map +1 -0
- package/dist/providers/openai-compatible.js +171 -0
- package/dist/providers/openai-compatible.js.map +1 -0
- package/dist/run-agent.d.ts +43 -0
- package/dist/run-agent.d.ts.map +1 -0
- package/dist/run-agent.js +318 -0
- package/dist/run-agent.js.map +1 -0
- package/dist/spec-checker/__fixtures__/mock-provider.d.ts +20 -0
- package/dist/spec-checker/__fixtures__/mock-provider.d.ts.map +1 -0
- package/dist/spec-checker/__fixtures__/mock-provider.js +34 -0
- package/dist/spec-checker/__fixtures__/mock-provider.js.map +1 -0
- package/dist/spec-checker/adversarial.d.ts +15 -0
- package/dist/spec-checker/adversarial.d.ts.map +1 -0
- package/dist/spec-checker/adversarial.js +77 -0
- package/dist/spec-checker/adversarial.js.map +1 -0
- package/dist/spec-checker/aggregate.d.ts +17 -0
- package/dist/spec-checker/aggregate.d.ts.map +1 -0
- package/dist/spec-checker/aggregate.js +25 -0
- package/dist/spec-checker/aggregate.js.map +1 -0
- package/dist/spec-checker/bias.d.ts +16 -0
- package/dist/spec-checker/bias.d.ts.map +1 -0
- package/dist/spec-checker/bias.js +26 -0
- package/dist/spec-checker/bias.js.map +1 -0
- package/dist/spec-checker/bidirectional.d.ts +21 -0
- package/dist/spec-checker/bidirectional.d.ts.map +1 -0
- package/dist/spec-checker/bidirectional.js +97 -0
- package/dist/spec-checker/bidirectional.js.map +1 -0
- package/dist/spec-checker/calibration.d.ts +15 -0
- package/dist/spec-checker/calibration.d.ts.map +1 -0
- package/dist/spec-checker/calibration.js +58 -0
- package/dist/spec-checker/calibration.js.map +1 -0
- package/dist/spec-checker/claims.d.ts +26 -0
- package/dist/spec-checker/claims.d.ts.map +1 -0
- package/dist/spec-checker/claims.js +104 -0
- package/dist/spec-checker/claims.js.map +1 -0
- package/dist/spec-checker/index.d.ts +40 -0
- package/dist/spec-checker/index.d.ts.map +1 -0
- package/dist/spec-checker/index.js +308 -0
- package/dist/spec-checker/index.js.map +1 -0
- package/dist/spec-checker/prompts.d.ts +11 -0
- package/dist/spec-checker/prompts.d.ts.map +1 -0
- package/dist/spec-checker/prompts.js +11 -0
- package/dist/spec-checker/prompts.js.map +1 -0
- package/dist/spec-checker/rubric.d.ts +14 -0
- package/dist/spec-checker/rubric.d.ts.map +1 -0
- package/dist/spec-checker/rubric.js +68 -0
- package/dist/spec-checker/rubric.js.map +1 -0
- package/dist/spec-checker/score.d.ts +16 -0
- package/dist/spec-checker/score.d.ts.map +1 -0
- package/dist/spec-checker/score.js +45 -0
- package/dist/spec-checker/score.js.map +1 -0
- package/dist/spec-checker/shim.d.ts +4 -0
- package/dist/spec-checker/shim.d.ts.map +1 -0
- package/dist/spec-checker/shim.js +69 -0
- package/dist/spec-checker/shim.js.map +1 -0
- package/dist/spec-checker.d.ts +4 -0
- package/dist/spec-checker.d.ts.map +1 -0
- package/dist/spec-checker.js +2 -0
- package/dist/spec-checker.js.map +1 -0
- package/dist/tools.d.ts +6 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +18 -0
- package/dist/tools.js.map +1 -0
- package/package.json +45 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 jglasskatz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @keel_flow/runtime
|
|
2
|
+
|
|
3
|
+
Agent execution layer: pluggable `ModelProvider` abstraction (`createProvider`, supports `anthropic` and `openai-compatible` kinds covering OpenAI, DeepSeek, Kimi, Together, Groq, Ollama), multi-turn tool-calling loop (`runAgent`), spec compliance checker (`createSpecChecker`), provider-aware cost computation (`computeCost`), agent runtime lifecycle (`defineAgentRuntime`), and sub-agent dispatch (`dispatchSubAgent`).
|
|
4
|
+
|
|
5
|
+
Part of the [Keel](https://github.com/jglasskatz/keel) framework.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
npm install @keel_flow/runtime
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## License
|
|
14
|
+
|
|
15
|
+
MIT
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Agent, KnowledgeBase } from "@keel_flow/core";
|
|
2
|
+
import type { ToolDefinition } from "./tools.js";
|
|
3
|
+
import type { RunResult } from "./run-agent.js";
|
|
4
|
+
export interface AgentRuntime {
|
|
5
|
+
invoke(prompt: string, kb?: KnowledgeBase | undefined): Promise<RunResult>;
|
|
6
|
+
}
|
|
7
|
+
export declare function defineAgentRuntime(agent: Agent, tools: ToolDefinition[]): AgentRuntime;
|
|
8
|
+
//# sourceMappingURL=agent-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-runtime.d.ts","sourceRoot":"","sources":["../src/agent-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,aAAa,GAAG,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;CAC5E;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,cAAc,EAAE,GACtB,YAAY,CAMd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-runtime.js","sourceRoot":"","sources":["../src/agent-runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAQ1C,MAAM,UAAU,kBAAkB,CAChC,KAAY,EACZ,KAAuB;IAEvB,OAAO;QACL,MAAM,CAAC,MAAc,EAAE,EAA8B;YACnD,OAAO,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;QAC9D,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Anthropic from "@anthropic-ai/sdk";
|
|
2
|
+
export declare const DEFAULT_MODEL = "claude-sonnet-4-6";
|
|
3
|
+
export interface ClientOptions {
|
|
4
|
+
apiKey?: string | undefined;
|
|
5
|
+
model?: string | undefined;
|
|
6
|
+
}
|
|
7
|
+
export interface AnthropicClient {
|
|
8
|
+
client: Anthropic;
|
|
9
|
+
model: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Use createProvider({ kind: "anthropic", apiKey }) from ./provider.js instead.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createAnthropicClient(opts?: ClientOptions): AnthropicClient;
|
|
15
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAE1C,eAAO,MAAM,aAAa,sBAAsB,CAAC;AAEjD,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,CAAC,EAAE,aAAa,GAAG,eAAe,CAW3E"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Anthropic from "@anthropic-ai/sdk";
|
|
2
|
+
export const DEFAULT_MODEL = "claude-sonnet-4-6";
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use createProvider({ kind: "anthropic", apiKey }) from ./provider.js instead.
|
|
5
|
+
*/
|
|
6
|
+
export function createAnthropicClient(opts) {
|
|
7
|
+
const apiKey = opts?.apiKey ?? process.env["ANTHROPIC_API_KEY"];
|
|
8
|
+
if (!apiKey) {
|
|
9
|
+
throw new Error("Anthropic API key not found — set ANTHROPIC_API_KEY in your environment or pass opts.apiKey");
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
client: new Anthropic({ apiKey }),
|
|
13
|
+
model: opts?.model ?? DEFAULT_MODEL,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAE1C,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAAC;AAYjD;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAoB;IACxD,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IAChE,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,6FAA6F,CAC9F,CAAC;IACJ,CAAC;IACD,OAAO;QACL,MAAM,EAAE,IAAI,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACjC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,aAAa;KACpC,CAAC;AACJ,CAAC"}
|
package/dist/cost.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cost.d.ts","sourceRoot":"","sources":["../src/cost.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAmBlD,wBAAgB,WAAW,CACzB,eAAe,EAAE,MAAM,GAAG,YAAY,EACtC,kBAAkB,EAAE,MAAM,GAAG,MAAM,EACnC,mBAAmB,EAAE,MAAM,EAC3B,YAAY,CAAC,EAAE,MAAM,GACpB,MAAM,CAoCR"}
|
package/dist/cost.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Approximate rates per 1M tokens in USD.
|
|
2
|
+
// Move to a remote config when pricing changes frequently.
|
|
3
|
+
const COST_MAP = {
|
|
4
|
+
"anthropic:claude-sonnet-4-6": { input: 3, output: 15 },
|
|
5
|
+
"anthropic:claude-opus-4-7": { input: 15, output: 75 },
|
|
6
|
+
"openai-compatible:gpt-4o": { input: 2.5, output: 10 },
|
|
7
|
+
"openai-compatible:gpt-4o-mini": { input: 0.15, output: 0.6 },
|
|
8
|
+
"openai-compatible:deepseek-chat": { input: 0.27, output: 1.1 },
|
|
9
|
+
"openai-compatible:kimi-k2": { input: 0.5, output: 1.5 },
|
|
10
|
+
// legacy key without provider prefix for backward compat
|
|
11
|
+
"claude-sonnet-4-6": { input: 3, output: 15 },
|
|
12
|
+
};
|
|
13
|
+
const OPENAI_FALLBACK = { input: 5, output: 15 };
|
|
14
|
+
const FREE = { input: 0, output: 0 };
|
|
15
|
+
const ANTHROPIC_DEFAULT = { input: 3, output: 15 };
|
|
16
|
+
export function computeCost(providerOrModel, modelOrInputTokens, inputOrOutputTokens, outputTokens) {
|
|
17
|
+
let provider;
|
|
18
|
+
let model;
|
|
19
|
+
let input;
|
|
20
|
+
let output;
|
|
21
|
+
if (typeof modelOrInputTokens === "string") {
|
|
22
|
+
// new 4-arg signature: (provider, model, inputTokens, outputTokens)
|
|
23
|
+
provider = providerOrModel;
|
|
24
|
+
model = modelOrInputTokens;
|
|
25
|
+
input = inputOrOutputTokens;
|
|
26
|
+
output = outputTokens ?? 0;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
// legacy 3-arg signature: (model, inputTokens, outputTokens)
|
|
30
|
+
provider = "anthropic";
|
|
31
|
+
model = providerOrModel;
|
|
32
|
+
input = modelOrInputTokens;
|
|
33
|
+
output = inputOrOutputTokens;
|
|
34
|
+
}
|
|
35
|
+
const providerKey = `${provider}:${model}`;
|
|
36
|
+
let rates = COST_MAP[providerKey] ?? COST_MAP[model];
|
|
37
|
+
if (!rates) {
|
|
38
|
+
if (provider === "anthropic") {
|
|
39
|
+
rates = ANTHROPIC_DEFAULT;
|
|
40
|
+
}
|
|
41
|
+
else if (provider === "openai-compatible") {
|
|
42
|
+
// local/ollama models are free
|
|
43
|
+
const isLocal = model.includes("llama") || model.includes("ollama") || model.includes("mistral");
|
|
44
|
+
rates = isLocal ? FREE : OPENAI_FALLBACK;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
rates = FREE;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return (input * rates.input + output * rates.output) / 1_000_000;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=cost.js.map
|
package/dist/cost.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cost.js","sourceRoot":"","sources":["../src/cost.ts"],"names":[],"mappings":"AAEA,0C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I,CAAC,CAAC;IAC7B,CAAC;SAAM,CAAC;QACN,6DAA6D;QAC7D,QAAQ,GAAG,WAAW,CAAC;QACvB,KAAK,GAAG,eAAe,CAAC;QACxB,KAAK,GAAG,kBAAkB,CAAC;QAC3B,MAAM,GAAG,mBAAmB,CAAC;IAC/B,CAAC;IAED,MAAM,WAAW,GAAG,GAAG,QAAQ,IAAI,KAAK,EAAE,CAAC;IAC3C,IAAI,KAAK,GAAG,QAAQ,CAAC,WAAW,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC;IAErD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,IAAI,QAAQ,KAAK,WAAW,EAAE,CAAC;YAC7B,KAAK,GAAG,iBAAiB,CAAC;QAC5B,CAAC;aAAM,IAAI,QAAQ,KAAK,mBAAmB,EAAE,CAAC;YAC5C,+BAA+B;YAC/B,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YACjG,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC;QAC3C,CAAC;aAAM,CAAC;YACN,KAAK,GAAG,IAAI,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { TelemetryEmitter } from "@keel_flow/telemetry";
|
|
2
|
+
import type { ModelProvider } from "./provider.js";
|
|
3
|
+
import type { ToolDefinition } from "./tools.js";
|
|
4
|
+
export interface SubAgentDispatchOpts {
|
|
5
|
+
parentSessionId: string;
|
|
6
|
+
context: string;
|
|
7
|
+
task: string;
|
|
8
|
+
systemPrompt: string;
|
|
9
|
+
tools: ToolDefinition[];
|
|
10
|
+
provider: ModelProvider;
|
|
11
|
+
model?: string;
|
|
12
|
+
maxIterations?: number;
|
|
13
|
+
telemetry?: TelemetryEmitter;
|
|
14
|
+
parentTelemetry?: TelemetryEmitter;
|
|
15
|
+
}
|
|
16
|
+
export interface SubAgentResult {
|
|
17
|
+
childSessionId: string;
|
|
18
|
+
finalMessage: string;
|
|
19
|
+
toolCalls: number;
|
|
20
|
+
iterations: number;
|
|
21
|
+
stopReason: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function dispatchSubAgent(opts: SubAgentDispatchOpts): Promise<SubAgentResult>;
|
|
24
|
+
//# sourceMappingURL=dispatch-subagent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatch-subagent.d.ts","sourceRoot":"","sources":["../src/dispatch-subagent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAG7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAgBjD,MAAM,WAAW,oBAAoB;IACnC,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,QAAQ,EAAE,aAAa,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,eAAe,CAAC,EAAE,gBAAgB,CAAC;CACpC;AAED,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC,cAAc,CAAC,CA+EzB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { defineAgent } from "@keel_flow/core";
|
|
3
|
+
import { runAgent } from "./run-agent.js";
|
|
4
|
+
const SUMMARY_RETURN_CONTRACT = "\n\nReturn format (mandatory): end your final message with a fenced block " +
|
|
5
|
+
"that begins with a line `## SUMMARY` and stays under ~1500 tokens. Include: " +
|
|
6
|
+
"files changed, decisions, open issues, verify status. The orchestrator sees " +
|
|
7
|
+
"ONLY this block — everything above it is discarded.";
|
|
8
|
+
const SUMMARY_FENCE = /^[ \t]*##[ \t]+SUMMARY[ \t]*$/m;
|
|
9
|
+
function extractSummary(finalText) {
|
|
10
|
+
const match = SUMMARY_FENCE.exec(finalText);
|
|
11
|
+
if (!match)
|
|
12
|
+
return finalText;
|
|
13
|
+
return finalText.slice(match.index).trim();
|
|
14
|
+
}
|
|
15
|
+
export async function dispatchSubAgent(opts) {
|
|
16
|
+
const childSessionId = randomUUID();
|
|
17
|
+
if (opts.parentTelemetry) {
|
|
18
|
+
opts.parentTelemetry.emit({
|
|
19
|
+
sessionId: opts.parentSessionId,
|
|
20
|
+
parentEventId: null,
|
|
21
|
+
workspaceId: null,
|
|
22
|
+
triggeredBy: { kind: "user" },
|
|
23
|
+
kind: "sub-agent.start",
|
|
24
|
+
payload: {
|
|
25
|
+
childSessionId,
|
|
26
|
+
context: opts.context,
|
|
27
|
+
task: opts.task,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const childAgent = defineAgent({
|
|
32
|
+
id: `sub-agent:${opts.context}`,
|
|
33
|
+
description: `Sub-agent scoped to bounded context ${opts.context}`,
|
|
34
|
+
tools: opts.tools.map((t) => t.config.id),
|
|
35
|
+
prompt: opts.systemPrompt + SUMMARY_RETURN_CONTRACT,
|
|
36
|
+
...(opts.model ? { model: opts.model } : {}),
|
|
37
|
+
});
|
|
38
|
+
try {
|
|
39
|
+
const result = await runAgent({
|
|
40
|
+
agent: childAgent.config,
|
|
41
|
+
tools: opts.tools,
|
|
42
|
+
prompt: opts.task,
|
|
43
|
+
provider: opts.provider,
|
|
44
|
+
...(opts.model ? { model: opts.model } : {}),
|
|
45
|
+
...(opts.maxIterations !== undefined ? { maxIterations: opts.maxIterations } : {}),
|
|
46
|
+
...(opts.telemetry ? { telemetry: opts.telemetry } : {}),
|
|
47
|
+
});
|
|
48
|
+
if (opts.parentTelemetry) {
|
|
49
|
+
opts.parentTelemetry.emit({
|
|
50
|
+
sessionId: opts.parentSessionId,
|
|
51
|
+
parentEventId: null,
|
|
52
|
+
workspaceId: null,
|
|
53
|
+
triggeredBy: { kind: "user" },
|
|
54
|
+
kind: "sub-agent.complete",
|
|
55
|
+
payload: {
|
|
56
|
+
childSessionId,
|
|
57
|
+
iterations: result.iterations,
|
|
58
|
+
stopReason: result.stopReason,
|
|
59
|
+
finalText: result.finalText,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
const summary = extractSummary(result.finalText);
|
|
64
|
+
return {
|
|
65
|
+
childSessionId,
|
|
66
|
+
finalMessage: summary,
|
|
67
|
+
toolCalls: result.toolCalls.length,
|
|
68
|
+
iterations: result.iterations,
|
|
69
|
+
stopReason: result.stopReason,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
if (opts.parentTelemetry) {
|
|
74
|
+
opts.parentTelemetry.emit({
|
|
75
|
+
sessionId: opts.parentSessionId,
|
|
76
|
+
parentEventId: null,
|
|
77
|
+
workspaceId: null,
|
|
78
|
+
triggeredBy: { kind: "user" },
|
|
79
|
+
kind: "sub-agent.fail",
|
|
80
|
+
payload: {
|
|
81
|
+
childSessionId,
|
|
82
|
+
context: opts.context,
|
|
83
|
+
error: err instanceof Error ? err.message : String(err),
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
throw err;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=dispatch-subagent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatch-subagent.js","sourceRoot":"","sources":["../src/dispatch-subagent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI1C,MAAM,uBAAuB,GAC3B,4EAA4E;IAC5E,8EAA8E;IAC9E,8EAA8E;IAC9E,qDAAqD,CAAC;AAExD,MAAM,aAAa,GAAG,gCAAgC,CAAC;AAEvD,SAAS,cAAc,CAAC,SAAiB;IACvC,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC5C,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAC7B,OAAO,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;AAC7C,CAAC;AAuBD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,IAA0B;IAE1B,MAAM,cAAc,GAAG,UAAU,EAAE,CAAC;IAEpC,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;QACzB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;YACxB,SAAS,EAAE,IAAI,CAAC,eAAe;YAC/B,aAAa,EAAE,IAAI;YACnB,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;YAC7B,IAAI,EAAE,iBAAiB;YACvB,OAAO,EAAE;gBACP,cAAc;gBACd,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,IAAI,EAAE,IAAI,CAAC,IAAI;aAChB;S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,EAAE,IAAI;gBACnB,WAAW,EAAE,IAAI;gBACjB,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;gBAC7B,IAAI,EAAE,oBAAoB;gBAC1B,OAAO,EAAE;oBACP,cAAc;oBACd,UAAU,EAAE,MAAM,CAAC,UAAU;oBAC7B,UAAU,EAAE,MAAM,CAAC,UAAU;oBAC7B,SAAS,EAAE,MAAM,CAAC,SAAS;iBAC5B;aACF,CAAC,CAAC;QACL,CAAC;QAED,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAEjD,OAAO;YACL,cAAc;YACd,YAAY,EAAE,OAAO;YACrB,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,MAAM;YAClC,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;gBACxB,SAAS,EAAE,IAAI,CAAC,eAAe;gBAC/B,aAAa,EAAE,IAAI;gBACnB,WAAW,EAAE,IAAI;gBACjB,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;gBAC7B,IAAI,EAAE,gBAAgB;gBACtB,OAAO,EAAE;oBACP,cAAc;oBACd,OAAO,EAAE,IAAI,CAAC,OAAO;oBACrB,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;iBACxD;aACF,CAAC,CAAC;QACL,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { createAnthropicClient } from "./client.js";
|
|
2
|
+
export type { ClientOptions, AnthropicClient } from "./client.js";
|
|
3
|
+
export { createProvider } from "./provider.js";
|
|
4
|
+
export { ClaudeBridgeProvider, ClaudeBridgeUnsupportedError } from "./providers/claude-bridge.js";
|
|
5
|
+
export type { ProviderKind, ProviderConfig, ModelProvider, NormalizedMessage, NormalizedBlock, NormalizedTool, NormalizedRequest, NormalizedResponse, } from "./provider.js";
|
|
6
|
+
export { runAgent } from "./run-agent.js";
|
|
7
|
+
export type { RunAgentArgs, RunResult, ToolCallRecord, UsageEvent } from "./run-agent.js";
|
|
8
|
+
export { computeCost } from "./cost.js";
|
|
9
|
+
export { createSpecChecker, toGateCheck, decomposeSpec, judgeClaims, judgeOneClaim, bidirectionalCheck, adversarialPass, runWithPositionSwap, aggregateVerdict, loadCalibration, } from "./spec-checker.js";
|
|
10
|
+
export type { SpecCheckerOptions, SpecCheckArgs, SpecCheckResult, SpecChecker, SpecCheckerCallable, CalibrationReport, LoadCalibrationOpts, } from "./spec-checker.js";
|
|
11
|
+
export { defineAgentRuntime } from "./agent-runtime.js";
|
|
12
|
+
export type { AgentRuntime } from "./agent-runtime.js";
|
|
13
|
+
export { dispatchSubAgent } from "./dispatch-subagent.js";
|
|
14
|
+
export type { SubAgentDispatchOpts, SubAgentResult, } from "./dispatch-subagent.js";
|
|
15
|
+
export type { ToolDefinition } from "./tools.js";
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAClG,YAAY,EACV,YAAY,EACZ,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE1F,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EACV,oBAAoB,EACpB,cAAc,GACf,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { createAnthropicClient } from "./client.js";
|
|
2
|
+
export { createProvider } from "./provider.js";
|
|
3
|
+
export { ClaudeBridgeProvider, ClaudeBridgeUnsupportedError } from "./providers/claude-bridge.js";
|
|
4
|
+
export { runAgent } from "./run-agent.js";
|
|
5
|
+
export { computeCost } from "./cost.js";
|
|
6
|
+
export { createSpecChecker, toGateCheck, decomposeSpec, judgeClaims, judgeOneClaim, bidirectionalCheck, adversarialPass, runWithPositionSwap, aggregateVerdict, loadCalibration, } from "./spec-checker.js";
|
|
7
|
+
export { defineAgentRuntime } from "./agent-runtime.js";
|
|
8
|
+
export { dispatchSubAgent } from "./dispatch-subagent.js";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGpD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAYlG,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAW3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export type ProviderKind = "anthropic" | "openai-compatible" | "claude-bridge";
|
|
2
|
+
export interface ProviderConfig {
|
|
3
|
+
kind: ProviderKind;
|
|
4
|
+
apiKey: string;
|
|
5
|
+
baseURL?: string;
|
|
6
|
+
defaultModel?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface NormalizedMessage {
|
|
10
|
+
role: "user" | "assistant";
|
|
11
|
+
content: NormalizedBlock[];
|
|
12
|
+
}
|
|
13
|
+
export type NormalizedBlock = {
|
|
14
|
+
type: "text";
|
|
15
|
+
text: string;
|
|
16
|
+
} | {
|
|
17
|
+
type: "tool_use";
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
input: unknown;
|
|
21
|
+
} | {
|
|
22
|
+
type: "tool_result";
|
|
23
|
+
toolUseId: string;
|
|
24
|
+
content: string;
|
|
25
|
+
};
|
|
26
|
+
export interface NormalizedTool {
|
|
27
|
+
name: string;
|
|
28
|
+
description: string;
|
|
29
|
+
inputSchema: object;
|
|
30
|
+
}
|
|
31
|
+
export interface NormalizedRequest {
|
|
32
|
+
system: string;
|
|
33
|
+
messages: NormalizedMessage[];
|
|
34
|
+
tools?: NormalizedTool[];
|
|
35
|
+
toolChoice?: "auto" | "any" | {
|
|
36
|
+
name: string;
|
|
37
|
+
};
|
|
38
|
+
maxTokens?: number;
|
|
39
|
+
model: string;
|
|
40
|
+
}
|
|
41
|
+
export interface NormalizedResponse {
|
|
42
|
+
content: NormalizedBlock[];
|
|
43
|
+
stopReason: "end_turn" | "tool_use" | "max_tokens" | "stop_sequence";
|
|
44
|
+
usage: {
|
|
45
|
+
inputTokens: number;
|
|
46
|
+
outputTokens: number;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export interface ModelProvider {
|
|
50
|
+
kind: ProviderKind;
|
|
51
|
+
defaultModel: string;
|
|
52
|
+
generate(req: NormalizedRequest): Promise<NormalizedResponse>;
|
|
53
|
+
}
|
|
54
|
+
export declare function createProvider(config: ProviderConfig): ModelProvider;
|
|
55
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,mBAAmB,GAAG,eAAe,CAAC;AAE/E,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,GAAG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CAAC,MAAM,EAAE,cAAc,GAAG,aAAa,CAapE"}
|
package/dist/provider.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AnthropicProvider } from "./providers/anthropic.js";
|
|
2
|
+
import { OpenAICompatibleProvider } from "./providers/openai-compatible.js";
|
|
3
|
+
import { ClaudeBridgeProvider } from "./providers/claude-bridge.js";
|
|
4
|
+
export function createProvider(config) {
|
|
5
|
+
if (config.kind === "anthropic") {
|
|
6
|
+
return new AnthropicProvider(config);
|
|
7
|
+
}
|
|
8
|
+
if (config.kind === "openai-compatible") {
|
|
9
|
+
return new OpenAICompatibleProvider(config);
|
|
10
|
+
}
|
|
11
|
+
if (config.kind === "claude-bridge") {
|
|
12
|
+
return new ClaudeBridgeProvider(config);
|
|
13
|
+
}
|
|
14
|
+
// exhaustiveness check
|
|
15
|
+
const _ = config.kind;
|
|
16
|
+
throw new Error(`Unknown provider kind: ${String(_)}`);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AA+CA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,MAAM,UAAU,cAAc,CAAC,MAAsB;IACnD,IAAI,MAAM,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAChC,OAAO,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,KAAK,mBAAmB,EAAE,CAAC;QACxC,OAAO,IAAI,wBAAwB,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;QACpC,OAAO,IAAI,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC1C,CAAC;IACD,uBAAuB;IACvB,MAAM,CAAC,GAAU,MAAM,CAAC,IAAI,CAAC;IAC7B,MAAM,IAAI,KAAK,CAAC,0BAA0B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ModelProvider, NormalizedRequest, NormalizedResponse, ProviderConfig } from "../provider.js";
|
|
2
|
+
export declare class AnthropicProvider implements ModelProvider {
|
|
3
|
+
readonly kind: "anthropic";
|
|
4
|
+
readonly defaultModel: string;
|
|
5
|
+
private readonly client;
|
|
6
|
+
constructor(config: ProviderConfig);
|
|
7
|
+
generate(req: NormalizedRequest): Promise<NormalizedResponse>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=anthropic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../src/providers/anthropic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,kBAAkB,EAAmB,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE5H,qBAAa,iBAAkB,YAAW,aAAa;IACrD,QAAQ,CAAC,IAAI,EAAG,WAAW,CAAU;IACrC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;gBAEvB,MAAM,EAAE,cAAc;IAS5B,QAAQ,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAgGpE"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import Anthropic from "@anthropic-ai/sdk";
|
|
2
|
+
export class AnthropicProvider {
|
|
3
|
+
kind = "anthropic";
|
|
4
|
+
defaultModel;
|
|
5
|
+
client;
|
|
6
|
+
constructor(config) {
|
|
7
|
+
const apiKey = config.apiKey || process.env["ANTHROPIC_API_KEY"] || "";
|
|
8
|
+
if (!apiKey) {
|
|
9
|
+
throw new Error("Anthropic API key required — pass apiKey or set ANTHROPIC_API_KEY");
|
|
10
|
+
}
|
|
11
|
+
this.client = new Anthropic({ apiKey });
|
|
12
|
+
this.defaultModel = config.defaultModel ?? "claude-sonnet-4-6";
|
|
13
|
+
}
|
|
14
|
+
async generate(req) {
|
|
15
|
+
const tools = req.tools && req.tools.length > 0
|
|
16
|
+
? req.tools.map((t) => ({
|
|
17
|
+
name: t.name,
|
|
18
|
+
description: t.description,
|
|
19
|
+
input_schema: {
|
|
20
|
+
type: "object",
|
|
21
|
+
...t.inputSchema,
|
|
22
|
+
},
|
|
23
|
+
}))
|
|
24
|
+
: undefined;
|
|
25
|
+
let tool_choice;
|
|
26
|
+
if (req.toolChoice === "any") {
|
|
27
|
+
tool_choice = { type: "any" };
|
|
28
|
+
}
|
|
29
|
+
else if (req.toolChoice === "auto") {
|
|
30
|
+
tool_choice = { type: "auto" };
|
|
31
|
+
}
|
|
32
|
+
else if (req.toolChoice && typeof req.toolChoice === "object") {
|
|
33
|
+
tool_choice = { type: "tool", name: req.toolChoice.name };
|
|
34
|
+
}
|
|
35
|
+
const messages = req.messages.map((m) => {
|
|
36
|
+
if (m.role === "user") {
|
|
37
|
+
const userBlocks = [];
|
|
38
|
+
const textParts = [];
|
|
39
|
+
for (const block of m.content) {
|
|
40
|
+
if (block.type === "tool_result") {
|
|
41
|
+
userBlocks.push({
|
|
42
|
+
type: "tool_result",
|
|
43
|
+
tool_use_id: block.toolUseId,
|
|
44
|
+
content: block.content,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
else if (block.type === "text") {
|
|
48
|
+
textParts.push({ type: "text", text: block.text });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (userBlocks.length > 0) {
|
|
52
|
+
return { role: "user", content: userBlocks };
|
|
53
|
+
}
|
|
54
|
+
if (textParts.length === 1 && textParts[0]) {
|
|
55
|
+
return { role: "user", content: textParts[0].text };
|
|
56
|
+
}
|
|
57
|
+
return { role: "user", content: textParts };
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
const assistantBlocks = [];
|
|
61
|
+
for (const block of m.content) {
|
|
62
|
+
if (block.type === "text") {
|
|
63
|
+
assistantBlocks.push({ type: "text", text: block.text });
|
|
64
|
+
}
|
|
65
|
+
else if (block.type === "tool_use") {
|
|
66
|
+
assistantBlocks.push({
|
|
67
|
+
type: "tool_use",
|
|
68
|
+
id: block.id,
|
|
69
|
+
name: block.name,
|
|
70
|
+
input: block.input,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return { role: "assistant", content: assistantBlocks };
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
const response = await this.client.messages.create({
|
|
78
|
+
model: req.model,
|
|
79
|
+
system: req.system,
|
|
80
|
+
messages,
|
|
81
|
+
max_tokens: req.maxTokens ?? 4096,
|
|
82
|
+
...(tools ? { tools } : {}),
|
|
83
|
+
...(tool_choice ? { tool_choice } : {}),
|
|
84
|
+
});
|
|
85
|
+
const content = response.content.map((block) => {
|
|
86
|
+
if (block.type === "text") {
|
|
87
|
+
return { type: "text", text: block.text };
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
type: "tool_use",
|
|
91
|
+
id: block.id,
|
|
92
|
+
name: block.name,
|
|
93
|
+
input: block.input,
|
|
94
|
+
};
|
|
95
|
+
});
|
|
96
|
+
const stopReason = mapStopReason(response.stop_reason);
|
|
97
|
+
return {
|
|
98
|
+
content,
|
|
99
|
+
stopReason,
|
|
100
|
+
usage: {
|
|
101
|
+
inputTokens: response.usage.input_tokens,
|
|
102
|
+
outputTokens: response.usage.output_tokens,
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function mapStopReason(reason) {
|
|
108
|
+
if (reason === "tool_use")
|
|
109
|
+
return "tool_use";
|
|
110
|
+
if (reason === "max_tokens")
|
|
111
|
+
return "max_tokens";
|
|
112
|
+
if (reason === "stop_sequence")
|
|
113
|
+
return "stop_sequence";
|
|
114
|
+
return "end_turn";
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=anthropic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropic.js","sourceRoot":"","sources":["../../src/providers/anthropic.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAG1C,MAAM,OAAO,iBAAiB;IACnB,IAAI,GAAG,WAAoB,CAAC;IAC5B,YAAY,CAAS;IACb,MAAM,CAAY;IAEnC,YAAY,MAAsB;QAChC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAC;QACvE,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;QACvF,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,IAAI,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QACxC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,IAAI,mBAAmB,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,GAAsB;QACnC,MAAM,KAAK,GACT,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;YAC/B,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBACpB,IAAI,EAAE,CAAC,CAAC,IAAI;gBACZ,WAAW,EAAE,CAAC,CAAC,WAAW;gBAC1B,YAAY,EAAE;oBACZ,IAAI,EAAE,QAAiB;oBACvB,GAAI,CAAC,CAAC,WAA4D;iBACnE;aACF,CAAC,CAAC;YACL,CAAC,CAAC,SAAS,CAAC;QAEhB,IAAI,WAAiF,CAAC;QACtF,I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CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3B,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACxC,CAAC,CAAC;QAEH,MAAM,OAAO,GAAsB,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YAChE,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;gBAC1B,OAAO,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;YACrD,CAAC;YACD,OAAO;gBACL,IAAI,EAAE,UAAmB;gBACzB,EAAE,EAAE,KAAK,CAAC,EAAE;gBACZ,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,KAAK,EAAE,KAAK,CAAC,KAAK;aACnB,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,MAAM,UAAU,GAAG,aAAa,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAEvD,OAAO;YACL,OAAO;YACP,UAAU;YACV,KAAK,EAAE;gBACL,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,YAAY;gBACxC,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,aAAa;aAC3C;SACF,CAAC;IACJ,CAAC;CACF;AAED,SAAS,aAAa,CACpB,MAAqB;IAErB,IAAI,MAAM,KAAK,UAAU;QAAE,OAAO,UAAU,CAAC;IAC7C,IAAI,MAAM,KAAK,YAAY;QAAE,OAAO,YAAY,CAAC;IACjD,IAAI,MAAM,KAAK,eAAe;QAAE,OAAO,eAAe,CAAC;IACvD,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ModelProvider, NormalizedRequest, NormalizedResponse, ProviderConfig } from "../provider.js";
|
|
2
|
+
export declare class ClaudeBridgeUnsupportedError extends Error {
|
|
3
|
+
constructor(detail: string);
|
|
4
|
+
}
|
|
5
|
+
interface BridgeQueryParams {
|
|
6
|
+
prompt: string;
|
|
7
|
+
options: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
export type BridgeQueryFn = (params: BridgeQueryParams) => AsyncIterable<{
|
|
10
|
+
type: string;
|
|
11
|
+
} & Record<string, unknown>>;
|
|
12
|
+
export declare class ClaudeBridgeProvider implements ModelProvider {
|
|
13
|
+
readonly kind: "claude-bridge";
|
|
14
|
+
readonly defaultModel: string;
|
|
15
|
+
private readonly queryFn;
|
|
16
|
+
constructor(config: ProviderConfig, queryFn?: BridgeQueryFn);
|
|
17
|
+
generate(req: NormalizedRequest): Promise<NormalizedResponse>;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=claude-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-bridge.d.ts","sourceRoot":"","sources":["../../src/providers/claude-bridge.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EAEb,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACf,MAAM,gBAAgB,CAAC;AAExB,qBAAa,4BAA6B,SAAQ,KAAK;gBACzC,MAAM,EAAE,MAAM;CAM3B;AAYD,UAAU,iBAAiB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,iBAAiB,KAAK,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AA+CrH,qBAAa,oBAAqB,YAAW,aAAa;IACxD,QAAQ,CAAC,IAAI,EAAG,eAAe,CAAU;IACzC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+B;gBAE3C,MAAM,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,aAAa;IAKrD,QAAQ,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAsDpE"}
|