@deepstrike/sdk 0.2.52 → 0.2.60
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 +28 -28
- package/dist/agent-ir.d.ts +103 -0
- package/dist/agent-ir.js +134 -0
- package/dist/agent.d.ts +67 -0
- package/dist/agent.js +36 -0
- package/dist/collaboration/harness.js +1 -1
- package/dist/collaboration/modes/creator-verifier.d.ts +2 -7
- package/dist/collaboration/modes/creator-verifier.js +4 -6
- package/dist/collaboration/pool.d.ts +8 -20
- package/dist/collaboration/pool.js +27 -97
- package/dist/compat/anthropic/mcp.d.ts +15 -0
- package/dist/compat/anthropic/mcp.js +10 -0
- package/dist/compat/openai/agent.d.ts +34 -0
- package/dist/compat/openai/agent.js +24 -0
- package/dist/governance.d.ts +1 -17
- package/dist/governance.js +1 -34
- package/dist/guardrail.d.ts +6 -0
- package/dist/guardrail.js +1 -0
- package/dist/handoff-target.d.ts +12 -0
- package/dist/handoff-target.js +1 -0
- package/dist/harness/manifest.js +0 -4
- package/dist/index.d.ts +19 -7
- package/dist/index.js +8 -5
- package/dist/kernel.d.ts +2 -20
- package/dist/knowledge/public.d.ts +29 -0
- package/dist/knowledge/public.js +1 -0
- package/dist/mcp-server.d.ts +28 -0
- package/dist/mcp-server.js +1 -0
- package/dist/memory/agent.d.ts +2 -2
- package/dist/memory/agent.js +2 -2
- package/dist/memory/durable.d.ts +16 -0
- package/dist/memory/durable.js +46 -0
- package/dist/memory/in-memory-store.d.ts +9 -7
- package/dist/memory/in-memory-store.js +8 -2
- package/dist/memory/protocols.d.ts +22 -4
- package/dist/memory/public.d.ts +4 -3
- package/dist/memory/public.js +3 -2
- package/dist/providers/anthropic-adapter.d.ts +47 -0
- package/dist/providers/anthropic-adapter.js +444 -0
- package/dist/providers/anthropic-compatible.d.ts +2 -3
- package/dist/providers/anthropic-compatible.js +8 -5
- package/dist/providers/anthropic.d.ts +19 -23
- package/dist/providers/anthropic.js +169 -395
- package/dist/providers/base.js +43 -3
- package/dist/providers/capability-router.d.ts +29 -0
- package/dist/providers/capability-router.js +43 -0
- package/dist/providers/catalog.d.ts +16 -4
- package/dist/providers/catalog.js +112 -21
- package/dist/providers/content-normalization.d.ts +57 -0
- package/dist/providers/content-normalization.js +238 -0
- package/dist/providers/content-policy.d.ts +16 -0
- package/dist/providers/content-policy.js +39 -0
- package/dist/providers/credentials.d.ts +83 -0
- package/dist/providers/credentials.js +190 -0
- package/dist/providers/endpoints.d.ts +137 -0
- package/dist/providers/endpoints.js +128 -0
- package/dist/providers/factories.js +9 -3
- package/dist/providers/gemini-adapter.d.ts +33 -0
- package/dist/providers/gemini-adapter.js +272 -0
- package/dist/providers/gemini.d.ts +16 -3
- package/dist/providers/gemini.js +97 -195
- package/dist/providers/model-catalog.d.ts +37 -0
- package/dist/providers/model-catalog.js +62 -0
- package/dist/providers/model-registry.d.ts +98 -0
- package/dist/providers/model-registry.js +315 -0
- package/dist/providers/ollama-adapter.d.ts +65 -0
- package/dist/providers/ollama-adapter.js +188 -0
- package/dist/providers/ollama.d.ts +9 -4
- package/dist/providers/ollama.js +96 -109
- package/dist/providers/openai-chat-dialects.d.ts +154 -0
- package/dist/providers/openai-chat-dialects.js +179 -0
- package/dist/providers/openai-chat.d.ts +46 -18
- package/dist/providers/openai-chat.js +418 -51
- package/dist/providers/openai-responses-adapter.d.ts +42 -0
- package/dist/providers/openai-responses-adapter.js +341 -0
- package/dist/providers/openai-responses.d.ts +14 -33
- package/dist/providers/openai-responses.js +131 -264
- package/dist/providers/openai.d.ts +29 -76
- package/dist/providers/openai.js +195 -292
- package/dist/providers/protocol-adapter.d.ts +34 -0
- package/dist/providers/protocol-adapter.js +9 -0
- package/dist/providers/protocol-capabilities.d.ts +34 -0
- package/dist/providers/protocol-capabilities.js +44 -0
- package/dist/providers/provider-error.d.ts +31 -0
- package/dist/providers/provider-error.js +149 -0
- package/dist/providers/public.d.ts +26 -3
- package/dist/providers/public.js +13 -1
- package/dist/providers/registry.d.ts +7 -6
- package/dist/providers/registry.js +47 -20
- package/dist/providers/request-plan.d.ts +86 -0
- package/dist/providers/request-plan.js +175 -0
- package/dist/providers/usage-normalizer.d.ts +48 -0
- package/dist/providers/usage-normalizer.js +96 -0
- package/dist/providers/vendor-profiles.d.ts +2 -15
- package/dist/providers/vendor-profiles.js +14 -60
- package/dist/runtime/canonical-kernel-step.d.ts +1 -2
- package/dist/runtime/canonical-kernel-step.js +47 -12
- package/dist/runtime/context-policy.d.ts +10 -12
- package/dist/runtime/context-policy.js +6 -8
- package/dist/runtime/durable-content.d.ts +50 -0
- package/dist/runtime/durable-content.js +159 -0
- package/dist/runtime/execution-plane.d.ts +2 -2
- package/dist/runtime/execution-plane.js +2 -2
- package/dist/runtime/kernel-event-log.js +0 -1
- package/dist/runtime/kernel-step.d.ts +0 -1
- package/dist/runtime/kernel-step.js +4 -2
- package/dist/runtime/mcp-proxy-plane.d.ts +25 -1
- package/dist/runtime/mcp-proxy-plane.js +44 -6
- package/dist/runtime/output-schema.d.ts +1 -2
- package/dist/runtime/provider-replay.d.ts +1 -1
- package/dist/runtime/provider-replay.js +12 -27
- package/dist/runtime/reactive-session.d.ts +1 -1
- package/dist/runtime/reactive-session.js +2 -3
- package/dist/runtime/run-group.d.ts +1 -1
- package/dist/runtime/runner.d.ts +26 -40
- package/dist/runtime/runner.js +145 -63
- package/dist/runtime/session-log.d.ts +8 -1
- package/dist/runtime/session-log.js +42 -2
- package/dist/runtime/session-repair.d.ts +1 -1
- package/dist/runtime/session-repair.js +1 -1
- package/dist/runtime/sub-agent-orchestrator.d.ts +1 -1
- package/dist/runtime/sub-agent-orchestrator.js +8 -11
- package/dist/runtime/workflow-control-flow.d.ts +0 -4
- package/dist/runtime/workflow-control-flow.js +0 -16
- package/dist/session.d.ts +11 -0
- package/dist/session.js +1 -0
- package/dist/skill.d.ts +17 -0
- package/dist/skill.js +16 -0
- package/dist/skills/loader.d.ts +3 -0
- package/dist/tools/errors.d.ts +1 -3
- package/dist/tools/errors.js +1 -3
- package/dist/tools/index.d.ts +3 -0
- package/dist/types/agent.d.ts +21 -9
- package/dist/types/agent.js +30 -4
- package/dist/types.d.ts +128 -13
- package/package.json +3 -3
- package/dist/providers/deepseek.d.ts +0 -46
- package/dist/providers/deepseek.js +0 -97
- package/dist/providers/glm.d.ts +0 -25
- package/dist/providers/glm.js +0 -48
- package/dist/providers/kimi.d.ts +0 -23
- package/dist/providers/kimi.js +0 -30
- package/dist/providers/minimax.d.ts +0 -49
- package/dist/providers/minimax.js +0 -98
- package/dist/providers/profiles.d.ts +0 -1992
- package/dist/providers/profiles.js +0 -796
- package/dist/providers/qwen.d.ts +0 -38
- package/dist/providers/qwen.js +0 -97
|
@@ -9,15 +9,14 @@ import { type AnthropicVendorProfile } from "./vendor-profiles.js";
|
|
|
9
9
|
* `<Vendor>AnthropicProvider` subclasses that existed only to carry that config.
|
|
10
10
|
*
|
|
11
11
|
* Adding a new Anthropic-compatible vendor is now "add a profile" — no new
|
|
12
|
-
* provider class is required
|
|
13
|
-
* kept only for backward compatibility / `instanceof` checks).
|
|
12
|
+
* provider class is required.
|
|
14
13
|
*/
|
|
15
14
|
export declare class AnthropicCompatibleProvider extends AnthropicProvider {
|
|
16
15
|
private readonly vendorProfile;
|
|
17
16
|
constructor(profile: AnthropicVendorProfile, apiKey: string, model?: string, retry?: {
|
|
18
17
|
maxRetries: number;
|
|
19
18
|
baseDelay: number;
|
|
20
|
-
}, baseURL?: string);
|
|
19
|
+
}, baseURL?: string, runtimePolicy?: RuntimePolicy);
|
|
21
20
|
protected providerName(): string;
|
|
22
21
|
runtimePolicy(): RuntimePolicy;
|
|
23
22
|
}
|
|
@@ -8,15 +8,18 @@ import { anthropicVendorBaseURL } from "./vendor-profiles.js";
|
|
|
8
8
|
* `<Vendor>AnthropicProvider` subclasses that existed only to carry that config.
|
|
9
9
|
*
|
|
10
10
|
* Adding a new Anthropic-compatible vendor is now "add a profile" — no new
|
|
11
|
-
* provider class is required
|
|
12
|
-
* kept only for backward compatibility / `instanceof` checks).
|
|
11
|
+
* provider class is required.
|
|
13
12
|
*/
|
|
14
13
|
export class AnthropicCompatibleProvider extends AnthropicProvider {
|
|
15
14
|
vendorProfile;
|
|
16
|
-
constructor(profile, apiKey, model, retry, baseURL) {
|
|
17
|
-
super(
|
|
15
|
+
constructor(profile, apiKey, model, retry, baseURL, runtimePolicy) {
|
|
16
|
+
super({
|
|
17
|
+
apiKey,
|
|
18
|
+
model: model ?? profile.defaultModel,
|
|
19
|
+
retry,
|
|
18
20
|
baseURL: baseURL ?? anthropicVendorBaseURL(profile),
|
|
19
21
|
authMode: "api-key",
|
|
22
|
+
runtimePolicy,
|
|
20
23
|
});
|
|
21
24
|
this.vendorProfile = profile;
|
|
22
25
|
}
|
|
@@ -24,6 +27,6 @@ export class AnthropicCompatibleProvider extends AnthropicProvider {
|
|
|
24
27
|
return this.vendorProfile.providerId;
|
|
25
28
|
}
|
|
26
29
|
runtimePolicy() {
|
|
27
|
-
return
|
|
30
|
+
return super.runtimePolicy();
|
|
28
31
|
}
|
|
29
32
|
}
|
|
@@ -1,46 +1,42 @@
|
|
|
1
|
-
import type { Message, ProviderDescriptor, ProviderReplay, ProviderRunState, RenderedContext,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
authMode?: "api-key" | "bearer";
|
|
5
|
-
}
|
|
6
|
-
/** Options-object form for `AnthropicProvider` — the recommended constructor shape. */
|
|
7
|
-
export interface AnthropicProviderConfig extends AnthropicProviderOptions {
|
|
1
|
+
import type { LLMProvider, Message, PromptMeasurement, ProviderDescriptor, ProviderReplay, ProviderRunState, RenderedContext, RuntimePolicy, StreamEvent, ToolSchema } from "../types.js";
|
|
2
|
+
import { type CanonicalAdapterInput } from "./content-normalization.js";
|
|
3
|
+
export interface AnthropicProviderConfig {
|
|
8
4
|
apiKey: string;
|
|
9
5
|
model?: string;
|
|
10
6
|
retry?: {
|
|
11
7
|
maxRetries: number;
|
|
12
8
|
baseDelay: number;
|
|
13
9
|
};
|
|
10
|
+
baseURL?: string;
|
|
11
|
+
authMode?: "api-key" | "bearer";
|
|
12
|
+
runtimePolicy?: RuntimePolicy;
|
|
14
13
|
}
|
|
14
|
+
type ResolvedAnthropicRuntime = CanonicalAdapterInput["resolved"];
|
|
15
15
|
export declare class AnthropicProvider implements LLMProvider {
|
|
16
16
|
private client;
|
|
17
17
|
private circuit;
|
|
18
18
|
private maxRetries;
|
|
19
19
|
private baseDelay;
|
|
20
20
|
protected readonly model: string;
|
|
21
|
-
private
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
private readonly adapter;
|
|
22
|
+
private readonly nativeAssistantBlocks;
|
|
23
|
+
private readonly resolvedRuntimePolicy;
|
|
24
|
+
private readonly directNativeTokenCounting;
|
|
25
|
+
private resolvedRuntime?;
|
|
26
|
+
constructor(config: AnthropicProviderConfig);
|
|
26
27
|
runtimePolicy(): RuntimePolicy;
|
|
27
|
-
/** Identity advertised in the descriptor; overridden by Anthropic-compatible vendors
|
|
28
|
+
/** Identity advertised in the descriptor; overridden by Anthropic-compatible vendors. */
|
|
28
29
|
protected providerName(): string;
|
|
29
30
|
descriptor(): ProviderDescriptor;
|
|
31
|
+
bindResolvedRuntime(resolved: ResolvedAnthropicRuntime): void;
|
|
30
32
|
peekProviderReplay(message: Pick<Message, "content" | "toolCalls">): ProviderReplay | undefined;
|
|
31
33
|
seedProviderReplay(message: Pick<Message, "content" | "toolCalls">, replay: ProviderReplay): void;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
* only when the system blocks won't carry one (`anchorCache`). When structured
|
|
35
|
-
* system blocks are present, their breakpoints already cache the tools prefix
|
|
36
|
-
* (tools render before system), so a redundant tool breakpoint would only burn
|
|
37
|
-
* one of Anthropic's 4 cache_control slots — slots the message history needs.
|
|
38
|
-
*/
|
|
39
|
-
private buildTools;
|
|
34
|
+
private adapterInput;
|
|
35
|
+
private buildPlan;
|
|
40
36
|
complete(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>): Promise<Message>;
|
|
37
|
+
/** Native measurement belongs to the verified official endpoint, not the wire protocol. */
|
|
38
|
+
countTokens(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>): Promise<PromptMeasurement>;
|
|
41
39
|
stream(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>, _state?: ProviderRunState, signal?: AbortSignal): AsyncIterable<StreamEvent>;
|
|
42
|
-
private requestExtensions;
|
|
43
|
-
private hasBetas;
|
|
44
40
|
private createMessage;
|
|
45
41
|
private streamMessage;
|
|
46
42
|
private buildSystem;
|