@agentfield/sdk 0.1.141-rc.1 → 0.1.141-rc.3
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/dist/index.d.ts +88 -2
- package/dist/index.js +341 -87
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1913,6 +1913,91 @@ declare class HarnessRunner {
|
|
|
1913
1913
|
private sleep;
|
|
1914
1914
|
}
|
|
1915
1915
|
|
|
1916
|
+
type Environment = Readonly<Record<string, string | undefined>>;
|
|
1917
|
+
declare const PROVIDER_SPECS: {
|
|
1918
|
+
readonly aforge: {
|
|
1919
|
+
readonly binary: "aforge";
|
|
1920
|
+
readonly versionArgs: readonly ["version"];
|
|
1921
|
+
readonly installCommand: "af aforge ensure";
|
|
1922
|
+
readonly authEnvVars: readonly ["OPENROUTER_API_KEY"];
|
|
1923
|
+
};
|
|
1924
|
+
readonly 'claude-code': {
|
|
1925
|
+
readonly binary: null;
|
|
1926
|
+
readonly versionArgs: readonly [];
|
|
1927
|
+
readonly installCommand: "npm install @anthropic-ai/claude-agent-sdk";
|
|
1928
|
+
readonly authEnvVars: readonly ["ANTHROPIC_API_KEY"];
|
|
1929
|
+
};
|
|
1930
|
+
readonly codex: {
|
|
1931
|
+
readonly binary: "codex";
|
|
1932
|
+
readonly versionArgs: readonly ["--version"];
|
|
1933
|
+
readonly installCommand: "npm install -g @openai/codex";
|
|
1934
|
+
readonly authEnvVars: readonly ["OPENAI_API_KEY"];
|
|
1935
|
+
};
|
|
1936
|
+
readonly gemini: {
|
|
1937
|
+
readonly binary: "gemini";
|
|
1938
|
+
readonly versionArgs: readonly ["--version"];
|
|
1939
|
+
readonly installCommand: "npm install -g @google/gemini-cli";
|
|
1940
|
+
readonly authEnvVars: readonly ["GEMINI_API_KEY", "GOOGLE_API_KEY"];
|
|
1941
|
+
};
|
|
1942
|
+
readonly omp: {
|
|
1943
|
+
readonly binary: "omp";
|
|
1944
|
+
readonly versionArgs: readonly ["--version"];
|
|
1945
|
+
readonly installCommand: "curl -fsSL https://omp.sh/install | sh";
|
|
1946
|
+
readonly authEnvVars: readonly ["OPENROUTER_API_KEY", "ANTHROPIC_API_KEY", "OPENAI_API_KEY", "GEMINI_API_KEY", "GOOGLE_API_KEY"];
|
|
1947
|
+
};
|
|
1948
|
+
readonly opencode: {
|
|
1949
|
+
readonly binary: "opencode";
|
|
1950
|
+
readonly versionArgs: readonly ["--version"];
|
|
1951
|
+
readonly installCommand: "curl -fsSL https://opencode.ai/install | bash";
|
|
1952
|
+
readonly authEnvVars: readonly [];
|
|
1953
|
+
};
|
|
1954
|
+
readonly pi: {
|
|
1955
|
+
readonly binary: "pi";
|
|
1956
|
+
readonly versionArgs: readonly ["--version"];
|
|
1957
|
+
readonly installCommand: "npm install -g --ignore-scripts @earendil-works/pi-coding-agent";
|
|
1958
|
+
readonly authEnvVars: readonly ["OPENROUTER_API_KEY", "ANTHROPIC_API_KEY", "OPENAI_API_KEY", "GEMINI_API_KEY", "GOOGLE_API_KEY"];
|
|
1959
|
+
};
|
|
1960
|
+
};
|
|
1961
|
+
type HarnessProviderName = keyof typeof PROVIDER_SPECS;
|
|
1962
|
+
declare const SUPPORTED_PROVIDER_NAMES: readonly ("aforge" | "claude-code" | "codex" | "gemini" | "opencode" | "pi" | "omp")[];
|
|
1963
|
+
interface ProviderHealth {
|
|
1964
|
+
provider: HarnessProviderName;
|
|
1965
|
+
binary: string | null;
|
|
1966
|
+
installed: boolean;
|
|
1967
|
+
version: string | null;
|
|
1968
|
+
auth: 'configured' | 'unknown';
|
|
1969
|
+
usable: boolean;
|
|
1970
|
+
installCommand: string;
|
|
1971
|
+
authEnvVars: readonly string[];
|
|
1972
|
+
issues: readonly string[];
|
|
1973
|
+
}
|
|
1974
|
+
declare class HarnessProviderUnavailable extends Error {
|
|
1975
|
+
readonly provider: string;
|
|
1976
|
+
readonly binary: string;
|
|
1977
|
+
readonly installCommand: string;
|
|
1978
|
+
readonly missingAuthEnv: readonly string[];
|
|
1979
|
+
constructor(provider: string, options: {
|
|
1980
|
+
binary: string;
|
|
1981
|
+
installCommand: string;
|
|
1982
|
+
missingAuthEnv?: readonly string[];
|
|
1983
|
+
});
|
|
1984
|
+
}
|
|
1985
|
+
type BinaryResolver = (binary: string, env: Environment) => string | undefined;
|
|
1986
|
+
/** Receives the resolved binary path followed by the provider's version arguments. */
|
|
1987
|
+
type VersionProbe = (command: string[]) => Promise<string>;
|
|
1988
|
+
type WrapperProbe = (provider: 'claude-code') => Promise<boolean>;
|
|
1989
|
+
interface HarnessDoctorOptions {
|
|
1990
|
+
/** Environment values used for the offline check (binary discovery and the authentication signal). */
|
|
1991
|
+
env?: Environment;
|
|
1992
|
+
resolveBinary?: BinaryResolver;
|
|
1993
|
+
versionProbe?: VersionProbe;
|
|
1994
|
+
wrapperProbe?: WrapperProbe;
|
|
1995
|
+
}
|
|
1996
|
+
/** Resolve an executable without invoking it, mirroring `shutil.which`. */
|
|
1997
|
+
declare function findExecutable(binary: string, env?: Environment): string | undefined;
|
|
1998
|
+
declare function ensureCliAvailable(provider: string, binary: string, resolveBinary?: BinaryResolver, env?: Environment): string;
|
|
1999
|
+
declare function harnessDoctor(providers?: readonly string[], options?: HarnessDoctorOptions): Promise<ProviderHealth[]>;
|
|
2000
|
+
|
|
1916
2001
|
type TurnDetection = {
|
|
1917
2002
|
create_response?: boolean;
|
|
1918
2003
|
interrupt_response?: boolean;
|
|
@@ -2066,6 +2151,7 @@ declare class Agent {
|
|
|
2066
2151
|
getExecutionLogger(): ExecutionLogger;
|
|
2067
2152
|
getHarnessRunner(): Promise<HarnessRunner>;
|
|
2068
2153
|
harness(prompt: string, options?: HarnessOptions): Promise<HarnessResult>;
|
|
2154
|
+
harnessDoctor(providers?: readonly string[]): Promise<ProviderHealth[]>;
|
|
2069
2155
|
/**
|
|
2070
2156
|
* Record a harness run's token/cost usage into the current execution's
|
|
2071
2157
|
* tracker. Mirrors the Python SDK's `_record_harness_usage`: a no-op when
|
|
@@ -2745,7 +2831,7 @@ declare function splitModelVariant(model: unknown): ModelVariant;
|
|
|
2745
2831
|
*/
|
|
2746
2832
|
declare function resolveModelAndVariant(options: Record<string, unknown>): ModelVariant;
|
|
2747
2833
|
|
|
2748
|
-
declare const SUPPORTED_PROVIDERS:
|
|
2834
|
+
declare const SUPPORTED_PROVIDERS: ReadonlySet<string>;
|
|
2749
2835
|
declare const DEFAULT_HARNESS_PROVIDER = "aforge";
|
|
2750
2836
|
declare const HARNESS_PROVIDER_ENV_VAR = "AGENTFIELD_HARNESS_PROVIDER";
|
|
2751
2837
|
/**
|
|
@@ -3092,4 +3178,4 @@ declare function simulateSchedule<R>(handler: (ctx: SimulatedContext) => R | Pro
|
|
|
3092
3178
|
*/
|
|
3093
3179
|
declare function loadFixture(source: string): Record<string, unknown>;
|
|
3094
3180
|
|
|
3095
|
-
export { ACTIVE_STATUSES, AIClient, type AIConfig, type AIEmbeddingOptions, type AIRequestOptions, type AIStream, type AIToolRequestOptions, Agent, type AgentCapability, type AgentConfig, type AgentHandler, AgentRouter, type AgentRouterOptions, type AgentState, ApprovalClient, type ApprovalDecision, type ApprovalRequestResponse, ApprovalResult, type ApprovalStatusResponse, Audio, type AudioOutput, type AudioRequest, type AuditTrailExport, type AuditTrailFilters, type Awaitable, CANONICAL_STATUSES, type CompactCapability, type CompactDiscoveryResponse, type CostEntry, type CostEntryInit, CostTracker, DEFAULT_HARNESS_PROVIDER, DIDAuthenticator, type DIDIdentity, type DIDIdentityPackage, type DIDRegistrationRequest, type DIDRegistrationResponse, type DeploymentType, DidClient, DidInterface, DidManager, type DidResolver, type DiscoveryFormat, type DiscoveryOptions, type DiscoveryPagination, type DiscoveryResponse, type DiscoveryResult, type EventTriggerBinding, type EventTriggerSpec, ExecutionContext, type ExecutionCredential, type ExecutionLogAttributes, type ExecutionLogBatchPayload, type ExecutionLogContext, type ExecutionLogEmitOptions, type ExecutionLogEntry, type ExecutionLogLevel, type ExecutionLogTransport, type ExecutionLogTransportPayload, type ExecutionLogWireEntry, ExecutionLogger, type ExecutionLoggerOptions, type ExecutionMetadata, ExecutionStatus, type ExecutionStatusValue, File, type FileOutput, type GenerateCredentialOptions, type GenerateCredentialParams, HARNESS_PROVIDER_ENV_VAR, HEADER_CALLER_DID, HEADER_DID_NONCE, HEADER_DID_SIGNATURE, HEADER_DID_TIMESTAMP, type HarnessConfig, type HarnessOptions, type HarnessProvider, type HarnessResult, HarnessRunner, type HealthStatus, Image, type ImageOutput, type ImageRequest, JWE_ALG, JWE_ENC, KEY_AGREEMENT_TYPE, MODEL_VARIANT_SEP, type MediaProvider, MediaProviderError, type MediaResponse, MediaRouter, type MemoryChangeEvent, MemoryClient, MemoryClientBase, type MemoryConfig, MemoryEventClient, type MemoryEventHandler, type MemoryEventHistoryOptions, type MemoryEventSubscriptionOptions, MemoryInterface, type MemoryRequestMetadata, type MemoryRequestOptions, type MemoryScope, type MemoryWatchHandler, type Metrics, type ModelVariant, type MultimodalContent, MultimodalResponse, OpenRouterMediaProvider, type OpenRouterMediaProviderOptions, PauseClock, PauseManager, type Payload, PayloadEncryptionError, RateLimitError, type RateLimiterOptions, type RawExecutionContext, type RawResult, RealtimeSession, type ReasonerCapability, ReasonerContext, type ReasonerDefinition, type ReasonerHandler, type ReasonerOptions, type RequestApprovalPayload, SUPPORTED_PROVIDERS, SUPPORTED_SESSION_TRANSPORTS, type ScheduleTriggerBinding, type ScheduleTriggerSpec, type ServerlessAdapter, type ServerlessEvent, type ServerlessResponse, type SessionDefinition, type SessionOptions, type SessionProvider, type SessionTransport, type SessionTransportCapability, SessionTransportError, type SessionTurn, type SimulateScheduleOptions, type SimulateTriggerOptions, type SimulatedContext, type SkillCapability, SkillContext, type SkillDefinition, type SkillHandler, type SkillOptions, StatelessRateLimiter, TERMINAL_STATUSES, Text, type ToolCallConfig, type ToolCallRecord, type ToolCallTrace, type ToolsOption, type TriggerBinding, type TriggerContext, type TriggerEnvelope, type TurnDetection, USAGE_ENVELOPE_KEY, type UnwrapResult, type UsageEntryWire, type UsageSummaryWire, type VectorSearchOptions, type VectorSearchResult, Video, type VideoFrameImage, type VideoInputReference, type VideoRequest, type WaitForApprovalOptions, type WorkflowCredential, type WorkflowMetadata, type WorkflowProgressOptions, WorkflowReporter, type ZodSchema, applyTriggerTransform, attachUsageToSyncResult, audioFromBase64, audioFromBuffer, audioFromFile, audioFromUrl, audioMediaType, buildProvider, buildSessionDefinition, buildToolConfig, capabilitiesToTools, capabilityToMetadataTool, capabilityToTool, createExecutionLogger, createHarnessResult, createMetrics, createMultimodalResponse, createRawResult, decrypt, decryptToString, deriveProvider, encryptForDid, encryptToJwk, eventTrigger, executeToolCallLoop, extractKeyAgreementJwk, fileFromBase64, fileFromBuffer, fileFromPath, fileFromUrl, generateX25519KeyPair, getCurrentContext, getCurrentSkillContext, guessUrlMimeType, imageFromBase64, imageFromBuffer, imageFromFile, imageFromUrl, installApprovalWebhookRoute, isActive, isExecutionLogBatchPayload, isTerminal, isTriggerEnvelope, loadFixture, normalizeExecutionLogEntry, normalizeSessionTransportValue, normalizeStatus, normalizeTurnDetection, resolveModelAndVariant, resolveProviderName, scheduleTrigger, serializeExecutionLogEntry, simulateSchedule, simulateTrigger, splitModelVariant, text, triggerToPayload, unwrapEnvelope, usageSummaryOrNull, validateSessionTransport, videoFromBase64, videoFromBuffer, videoFromFile, videoFromUrl };
|
|
3181
|
+
export { ACTIVE_STATUSES, AIClient, type AIConfig, type AIEmbeddingOptions, type AIRequestOptions, type AIStream, type AIToolRequestOptions, Agent, type AgentCapability, type AgentConfig, type AgentHandler, AgentRouter, type AgentRouterOptions, type AgentState, ApprovalClient, type ApprovalDecision, type ApprovalRequestResponse, ApprovalResult, type ApprovalStatusResponse, Audio, type AudioOutput, type AudioRequest, type AuditTrailExport, type AuditTrailFilters, type Awaitable, type BinaryResolver, CANONICAL_STATUSES, type CompactCapability, type CompactDiscoveryResponse, type CostEntry, type CostEntryInit, CostTracker, DEFAULT_HARNESS_PROVIDER, DIDAuthenticator, type DIDIdentity, type DIDIdentityPackage, type DIDRegistrationRequest, type DIDRegistrationResponse, type DeploymentType, DidClient, DidInterface, DidManager, type DidResolver, type DiscoveryFormat, type DiscoveryOptions, type DiscoveryPagination, type DiscoveryResponse, type DiscoveryResult, type EventTriggerBinding, type EventTriggerSpec, ExecutionContext, type ExecutionCredential, type ExecutionLogAttributes, type ExecutionLogBatchPayload, type ExecutionLogContext, type ExecutionLogEmitOptions, type ExecutionLogEntry, type ExecutionLogLevel, type ExecutionLogTransport, type ExecutionLogTransportPayload, type ExecutionLogWireEntry, ExecutionLogger, type ExecutionLoggerOptions, type ExecutionMetadata, ExecutionStatus, type ExecutionStatusValue, File, type FileOutput, type GenerateCredentialOptions, type GenerateCredentialParams, HARNESS_PROVIDER_ENV_VAR, HEADER_CALLER_DID, HEADER_DID_NONCE, HEADER_DID_SIGNATURE, HEADER_DID_TIMESTAMP, type HarnessConfig, type HarnessDoctorOptions, type HarnessOptions, type HarnessProvider, type HarnessProviderName, HarnessProviderUnavailable, type HarnessResult, HarnessRunner, type HealthStatus, Image, type ImageOutput, type ImageRequest, JWE_ALG, JWE_ENC, KEY_AGREEMENT_TYPE, MODEL_VARIANT_SEP, type MediaProvider, MediaProviderError, type MediaResponse, MediaRouter, type MemoryChangeEvent, MemoryClient, MemoryClientBase, type MemoryConfig, MemoryEventClient, type MemoryEventHandler, type MemoryEventHistoryOptions, type MemoryEventSubscriptionOptions, MemoryInterface, type MemoryRequestMetadata, type MemoryRequestOptions, type MemoryScope, type MemoryWatchHandler, type Metrics, type ModelVariant, type MultimodalContent, MultimodalResponse, OpenRouterMediaProvider, type OpenRouterMediaProviderOptions, PauseClock, PauseManager, type Payload, PayloadEncryptionError, type ProviderHealth, RateLimitError, type RateLimiterOptions, type RawExecutionContext, type RawResult, RealtimeSession, type ReasonerCapability, ReasonerContext, type ReasonerDefinition, type ReasonerHandler, type ReasonerOptions, type RequestApprovalPayload, SUPPORTED_PROVIDERS, SUPPORTED_PROVIDER_NAMES, SUPPORTED_SESSION_TRANSPORTS, type ScheduleTriggerBinding, type ScheduleTriggerSpec, type ServerlessAdapter, type ServerlessEvent, type ServerlessResponse, type SessionDefinition, type SessionOptions, type SessionProvider, type SessionTransport, type SessionTransportCapability, SessionTransportError, type SessionTurn, type SimulateScheduleOptions, type SimulateTriggerOptions, type SimulatedContext, type SkillCapability, SkillContext, type SkillDefinition, type SkillHandler, type SkillOptions, StatelessRateLimiter, TERMINAL_STATUSES, Text, type ToolCallConfig, type ToolCallRecord, type ToolCallTrace, type ToolsOption, type TriggerBinding, type TriggerContext, type TriggerEnvelope, type TurnDetection, USAGE_ENVELOPE_KEY, type UnwrapResult, type UsageEntryWire, type UsageSummaryWire, type VectorSearchOptions, type VectorSearchResult, type VersionProbe, Video, type VideoFrameImage, type VideoInputReference, type VideoRequest, type WaitForApprovalOptions, type WorkflowCredential, type WorkflowMetadata, type WorkflowProgressOptions, WorkflowReporter, type WrapperProbe, type ZodSchema, applyTriggerTransform, attachUsageToSyncResult, audioFromBase64, audioFromBuffer, audioFromFile, audioFromUrl, audioMediaType, buildProvider, buildSessionDefinition, buildToolConfig, capabilitiesToTools, capabilityToMetadataTool, capabilityToTool, createExecutionLogger, createHarnessResult, createMetrics, createMultimodalResponse, createRawResult, decrypt, decryptToString, deriveProvider, encryptForDid, encryptToJwk, ensureCliAvailable, eventTrigger, executeToolCallLoop, extractKeyAgreementJwk, fileFromBase64, fileFromBuffer, fileFromPath, fileFromUrl, findExecutable, generateX25519KeyPair, getCurrentContext, getCurrentSkillContext, guessUrlMimeType, harnessDoctor, imageFromBase64, imageFromBuffer, imageFromFile, imageFromUrl, installApprovalWebhookRoute, isActive, isExecutionLogBatchPayload, isTerminal, isTriggerEnvelope, loadFixture, normalizeExecutionLogEntry, normalizeSessionTransportValue, normalizeStatus, normalizeTurnDetection, resolveModelAndVariant, resolveProviderName, scheduleTrigger, serializeExecutionLogEntry, simulateSchedule, simulateTrigger, splitModelVariant, text, triggerToPayload, unwrapEnvelope, usageSummaryOrNull, validateSessionTransport, videoFromBase64, videoFromBuffer, videoFromFile, videoFromUrl };
|