@agentfield/sdk 0.1.143-rc.4 → 0.1.143-rc.5
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 +42 -7
- package/dist/index.js +669 -126
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1623,11 +1623,11 @@ interface SkillOptions {
|
|
|
1623
1623
|
|
|
1624
1624
|
interface HarnessConfig {
|
|
1625
1625
|
/**
|
|
1626
|
-
* Coding agent provider. Defaults to `
|
|
1626
|
+
* Coding agent provider. Defaults to `codeaf`, AgentField's native harness.
|
|
1627
1627
|
* When unset, `AGENTFIELD_HARNESS_PROVIDER` is consulted before the default.
|
|
1628
1628
|
* An explicit value always wins.
|
|
1629
1629
|
*/
|
|
1630
|
-
provider?: 'aforge' | 'claude-code' | 'codex' | 'gemini' | 'opencode' | 'pi' | 'omp';
|
|
1630
|
+
provider?: 'codeaf' | 'aforge' | 'claude-code' | 'codex' | 'gemini' | 'opencode' | 'pi' | 'omp';
|
|
1631
1631
|
/** Model identifier. Empty means the provider's own default. */
|
|
1632
1632
|
model?: string;
|
|
1633
1633
|
/**
|
|
@@ -1647,6 +1647,7 @@ interface HarnessConfig {
|
|
|
1647
1647
|
env?: Record<string, string>;
|
|
1648
1648
|
cwd?: string;
|
|
1649
1649
|
projectDir?: string;
|
|
1650
|
+
codeafBin?: string;
|
|
1650
1651
|
aforgeBin?: string;
|
|
1651
1652
|
codexBin?: string;
|
|
1652
1653
|
geminiBin?: string;
|
|
@@ -1656,7 +1657,7 @@ interface HarnessConfig {
|
|
|
1656
1657
|
}
|
|
1657
1658
|
interface HarnessOptions {
|
|
1658
1659
|
/**
|
|
1659
|
-
* Coding agent provider. Defaults to `
|
|
1660
|
+
* Coding agent provider. Defaults to `codeaf`, AgentField's native harness.
|
|
1660
1661
|
* When unset, `AGENTFIELD_HARNESS_PROVIDER` is consulted before the default.
|
|
1661
1662
|
* An explicit value always wins.
|
|
1662
1663
|
*/
|
|
@@ -1680,6 +1681,7 @@ interface HarnessOptions {
|
|
|
1680
1681
|
env?: Record<string, string>;
|
|
1681
1682
|
cwd?: string;
|
|
1682
1683
|
projectDir?: string;
|
|
1684
|
+
codeafBin?: string;
|
|
1683
1685
|
aforgeBin?: string;
|
|
1684
1686
|
codexBin?: string;
|
|
1685
1687
|
geminiBin?: string;
|
|
@@ -1708,6 +1710,8 @@ interface Metrics {
|
|
|
1708
1710
|
}
|
|
1709
1711
|
type FailureType = 'none' | 'crash' | 'timeout' | 'api_error' | 'no_output' | 'schema';
|
|
1710
1712
|
interface RawResult {
|
|
1713
|
+
/** Actual adapter used, including alias resolution and legacy fallback. */
|
|
1714
|
+
provider?: string;
|
|
1711
1715
|
result?: string;
|
|
1712
1716
|
messages: Array<Record<string, unknown>>;
|
|
1713
1717
|
metrics: Metrics;
|
|
@@ -1717,6 +1721,8 @@ interface RawResult {
|
|
|
1717
1721
|
returnCode?: number;
|
|
1718
1722
|
}
|
|
1719
1723
|
interface HarnessResult {
|
|
1724
|
+
/** Actual provider used for this run. */
|
|
1725
|
+
provider?: string;
|
|
1720
1726
|
result?: string;
|
|
1721
1727
|
parsed?: unknown;
|
|
1722
1728
|
isError: boolean;
|
|
@@ -1998,6 +2004,7 @@ type RunnerOptions = Omit<HarnessOptions, 'schema'> & {
|
|
|
1998
2004
|
maxDelay?: number;
|
|
1999
2005
|
backoffFactor?: number;
|
|
2000
2006
|
projectDir?: string;
|
|
2007
|
+
codeafBin?: string;
|
|
2001
2008
|
aforgeBin?: string;
|
|
2002
2009
|
codexBin?: string;
|
|
2003
2010
|
geminiBin?: string;
|
|
@@ -2020,6 +2027,12 @@ declare class HarnessRunner {
|
|
|
2020
2027
|
|
|
2021
2028
|
type Environment = Readonly<Record<string, string | undefined>>;
|
|
2022
2029
|
declare const PROVIDER_SPECS: {
|
|
2030
|
+
readonly codeaf: {
|
|
2031
|
+
readonly binary: "codeaf";
|
|
2032
|
+
readonly versionArgs: readonly ["version"];
|
|
2033
|
+
readonly installCommand: "af codeaf ensure";
|
|
2034
|
+
readonly authEnvVars: readonly ["OPENROUTER_API_KEY"];
|
|
2035
|
+
};
|
|
2023
2036
|
readonly aforge: {
|
|
2024
2037
|
readonly binary: "aforge";
|
|
2025
2038
|
readonly versionArgs: readonly ["version"];
|
|
@@ -2064,7 +2077,7 @@ declare const PROVIDER_SPECS: {
|
|
|
2064
2077
|
};
|
|
2065
2078
|
};
|
|
2066
2079
|
type HarnessProviderName = keyof typeof PROVIDER_SPECS;
|
|
2067
|
-
declare const SUPPORTED_PROVIDER_NAMES: readonly ("gemini" | "aforge" | "claude-code" | "codex" | "opencode" | "pi" | "omp")[];
|
|
2080
|
+
declare const SUPPORTED_PROVIDER_NAMES: readonly ("gemini" | "codeaf" | "aforge" | "claude-code" | "codex" | "opencode" | "pi" | "omp")[];
|
|
2068
2081
|
interface ProviderHealth {
|
|
2069
2082
|
provider: HarnessProviderName;
|
|
2070
2083
|
binary: string | null;
|
|
@@ -2937,16 +2950,38 @@ declare function splitModelVariant(model: unknown): ModelVariant;
|
|
|
2937
2950
|
declare function resolveModelAndVariant(options: Record<string, unknown>): ModelVariant;
|
|
2938
2951
|
|
|
2939
2952
|
declare const SUPPORTED_PROVIDERS: ReadonlySet<string>;
|
|
2940
|
-
declare const DEFAULT_HARNESS_PROVIDER = "
|
|
2953
|
+
declare const DEFAULT_HARNESS_PROVIDER = "codeaf";
|
|
2941
2954
|
declare const HARNESS_PROVIDER_ENV_VAR = "AGENTFIELD_HARNESS_PROVIDER";
|
|
2942
2955
|
/**
|
|
2943
2956
|
* Applies harness provider precedence: an explicit name wins, then
|
|
2944
|
-
* AGENTFIELD_HARNESS_PROVIDER, then DEFAULT_HARNESS_PROVIDER ("
|
|
2957
|
+
* AGENTFIELD_HARNESS_PROVIDER, then DEFAULT_HARNESS_PROVIDER ("codeaf").
|
|
2945
2958
|
* Blank / whitespace-only values are treated as unset.
|
|
2946
2959
|
*/
|
|
2947
2960
|
declare function resolveProviderName(explicit?: string): string;
|
|
2948
2961
|
declare function buildProvider(config: HarnessConfig): Promise<HarnessProvider>;
|
|
2949
2962
|
|
|
2963
|
+
/**
|
|
2964
|
+
* Aforge CLI provider. `exec` is the default direct one-shot entry point; set
|
|
2965
|
+
* `AGENTFIELD_AFORGE_COMMAND=do` to opt into Aforge's routed workflow.
|
|
2966
|
+
*/
|
|
2967
|
+
declare class AforgeProvider implements HarnessProvider {
|
|
2968
|
+
private readonly deadline?;
|
|
2969
|
+
private readonly bin;
|
|
2970
|
+
constructor(bin?: string, deadline?: number | undefined);
|
|
2971
|
+
execute(prompt: string, options: Record<string, unknown>): Promise<RawResult>;
|
|
2972
|
+
private executeImpl;
|
|
2973
|
+
}
|
|
2974
|
+
|
|
2975
|
+
declare const CODEAF_DEFAULT_MODEL = "~deepseek/deepseek-v4-flash-latest";
|
|
2976
|
+
/** Canonical CodeAF headless adapter, with lazy managed installation and legacy fallback. */
|
|
2977
|
+
declare class CodeafProvider implements HarnessProvider {
|
|
2978
|
+
private readonly bin?;
|
|
2979
|
+
private readonly alias;
|
|
2980
|
+
constructor(bin?: string | undefined, alias?: boolean);
|
|
2981
|
+
execute(prompt: string, options: Record<string, unknown>): Promise<RawResult>;
|
|
2982
|
+
private executeImpl;
|
|
2983
|
+
}
|
|
2984
|
+
|
|
2950
2985
|
/**
|
|
2951
2986
|
* Canonical execution status utilities for the AgentField TypeScript SDK.
|
|
2952
2987
|
*
|
|
@@ -3283,4 +3318,4 @@ declare function simulateSchedule<R>(handler: (ctx: SimulatedContext) => R | Pro
|
|
|
3283
3318
|
*/
|
|
3284
3319
|
declare function loadFixture(source: string): Record<string, unknown>;
|
|
3285
3320
|
|
|
3286
|
-
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, DEFAULT_TOOL_CALL_LIMIT_REACHED, 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 MessageSource, type Metrics, type ModelVariant, type MultimodalContent, MultimodalResponse, OpenRouterMediaProvider, type OpenRouterMediaProviderOptions, PauseClock, PauseManager, type Payload, PayloadEncryptionError, type PromptTemplates, type ProviderHealth, RateLimitError, type RateLimiterOptions, type RawExecutionContext, type RawResult, RealtimeSession, type ReasonerCapability, ReasonerContext, type ReasonerDefinition, type ReasonerHandler, type ReasonerOptions, type RequestApprovalPayload, type ResolvedPromptTemplates, 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, TRACE_SOURCE_ASSISTANT, TRACE_SOURCE_TOOL_ERROR, TRACE_SOURCE_TOOL_LIMIT, TRACE_SOURCE_TOOL_RESULT, TRACE_SOURCE_TOOL_SYSTEM_PROMPT, TRACE_SOURCE_USER, Text, type ToolCallConfig, type ToolCallRecord, type ToolCallTrace, type ToolErrorFormatter, type ToolResultFormatter, type ToolsOption, type TracedMessage, 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, defaultToolErrorFormatter, defaultToolResultFormatter, 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, resolvePromptTemplates, resolveProviderName, scheduleTrigger, serializeExecutionLogEntry, simulateSchedule, simulateTrigger, splitModelVariant, text, triggerToPayload, unwrapEnvelope, usageSummaryOrNull, validateSessionTransport, videoFromBase64, videoFromBuffer, videoFromFile, videoFromUrl };
|
|
3321
|
+
export { ACTIVE_STATUSES, AIClient, type AIConfig, type AIEmbeddingOptions, type AIRequestOptions, type AIStream, type AIToolRequestOptions, AforgeProvider, 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, CODEAF_DEFAULT_MODEL, CodeafProvider, type CompactCapability, type CompactDiscoveryResponse, type CostEntry, type CostEntryInit, CostTracker, DEFAULT_HARNESS_PROVIDER, DEFAULT_TOOL_CALL_LIMIT_REACHED, 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 MessageSource, type Metrics, type ModelVariant, type MultimodalContent, MultimodalResponse, OpenRouterMediaProvider, type OpenRouterMediaProviderOptions, PauseClock, PauseManager, type Payload, PayloadEncryptionError, type PromptTemplates, type ProviderHealth, RateLimitError, type RateLimiterOptions, type RawExecutionContext, type RawResult, RealtimeSession, type ReasonerCapability, ReasonerContext, type ReasonerDefinition, type ReasonerHandler, type ReasonerOptions, type RequestApprovalPayload, type ResolvedPromptTemplates, 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, TRACE_SOURCE_ASSISTANT, TRACE_SOURCE_TOOL_ERROR, TRACE_SOURCE_TOOL_LIMIT, TRACE_SOURCE_TOOL_RESULT, TRACE_SOURCE_TOOL_SYSTEM_PROMPT, TRACE_SOURCE_USER, Text, type ToolCallConfig, type ToolCallRecord, type ToolCallTrace, type ToolErrorFormatter, type ToolResultFormatter, type ToolsOption, type TracedMessage, 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, defaultToolErrorFormatter, defaultToolResultFormatter, 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, resolvePromptTemplates, resolveProviderName, scheduleTrigger, serializeExecutionLogEntry, simulateSchedule, simulateTrigger, splitModelVariant, text, triggerToPayload, unwrapEnvelope, usageSummaryOrNull, validateSessionTransport, videoFromBase64, videoFromBuffer, videoFromFile, videoFromUrl };
|