@axlsdk/axl 0.16.1 → 0.17.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/dist/index.cjs +158 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +159 -10
- package/dist/index.d.ts +159 -10
- package/dist/index.js +149 -22
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -2035,6 +2035,23 @@ declare class Session {
|
|
|
2035
2035
|
fork(newId: string): Promise<Session>;
|
|
2036
2036
|
}
|
|
2037
2037
|
|
|
2038
|
+
/**
|
|
2039
|
+
* Function exported from an eval module that overrides the default
|
|
2040
|
+
* `runtime.execute(workflow, input)` behavior. The runtime injects itself as
|
|
2041
|
+
* the second argument so user code can call `runtime.createContext()` etc.
|
|
2042
|
+
*
|
|
2043
|
+
* Returns `{ output, cost?, metadata? }` — cost and metadata are optional and
|
|
2044
|
+
* fall back to values derived from `runtime.trackExecution()` when omitted.
|
|
2045
|
+
*
|
|
2046
|
+
* Single source of truth for the eval-execution contract; consumed by
|
|
2047
|
+
* `registerEval`, `getRegisteredEval`, the `axl-eval` CLI, and
|
|
2048
|
+
* `@axlsdk/studio`'s eval-loader.
|
|
2049
|
+
*/
|
|
2050
|
+
type EvalExecuteWorkflow = (input: unknown, runtime?: AxlRuntime) => Promise<{
|
|
2051
|
+
output: unknown;
|
|
2052
|
+
cost?: number;
|
|
2053
|
+
metadata?: Record<string, unknown>;
|
|
2054
|
+
}>;
|
|
2038
2055
|
type ExecuteOptions = {
|
|
2039
2056
|
metadata?: Record<string, unknown>;
|
|
2040
2057
|
/** Handler for tool approval requests. When provided, tools with `requireApproval` resolve
|
|
@@ -2198,10 +2215,7 @@ declare class AxlRuntime extends EventEmitter {
|
|
|
2198
2215
|
* An optional `executeWorkflow` function can override the default behavior
|
|
2199
2216
|
* of calling `runtime.execute()`.
|
|
2200
2217
|
*/
|
|
2201
|
-
registerEval(name: string, config: unknown, executeWorkflow?:
|
|
2202
|
-
output: unknown;
|
|
2203
|
-
cost?: number;
|
|
2204
|
-
}>): void;
|
|
2218
|
+
registerEval(name: string, config: unknown, executeWorkflow?: EvalExecuteWorkflow): void;
|
|
2205
2219
|
/** Get metadata about all registered evals. */
|
|
2206
2220
|
getRegisteredEvals(): Array<{
|
|
2207
2221
|
name: string;
|
|
@@ -2212,11 +2226,7 @@ declare class AxlRuntime extends EventEmitter {
|
|
|
2212
2226
|
/** Get a registered eval config by name. */
|
|
2213
2227
|
getRegisteredEval(name: string): {
|
|
2214
2228
|
config: unknown;
|
|
2215
|
-
executeWorkflow?:
|
|
2216
|
-
output: unknown;
|
|
2217
|
-
cost?: number;
|
|
2218
|
-
metadata?: Record<string, unknown>;
|
|
2219
|
-
}>;
|
|
2229
|
+
executeWorkflow?: EvalExecuteWorkflow;
|
|
2220
2230
|
} | undefined;
|
|
2221
2231
|
/** Run a registered eval by name. */
|
|
2222
2232
|
runRegisteredEval(name: string, options?: {
|
|
@@ -2433,6 +2443,145 @@ declare class AxlRuntime extends EventEmitter {
|
|
|
2433
2443
|
private updateHandoffDuration;
|
|
2434
2444
|
}
|
|
2435
2445
|
|
|
2446
|
+
/**
|
|
2447
|
+
* Module-export resolution helpers for dynamically-imported user modules.
|
|
2448
|
+
*
|
|
2449
|
+
* Walks the ESM/CJS interop chain so consumers see the same shape regardless
|
|
2450
|
+
* of how Node loaded the file. The original motivating bug: `axl-eval` looked
|
|
2451
|
+
* up `executeWorkflow` as `mod.executeWorkflow` only, but tsx-loading a `.ts`
|
|
2452
|
+
* file in a CJS package puts named exports on `mod.default.executeWorkflow`,
|
|
2453
|
+
* so the lookup silently fell back to identity passthrough — producing
|
|
2454
|
+
* all-zero scores in CI.
|
|
2455
|
+
*
|
|
2456
|
+
* Use these helpers (not hand-rolled `mod.default ?? mod` walks) at every
|
|
2457
|
+
* dynamic-import call site to keep default and named lookups symmetric.
|
|
2458
|
+
*
|
|
2459
|
+
* @internal Not part of the public SDK surface — exported only so the eval
|
|
2460
|
+
* CLI and Studio middleware can share one implementation.
|
|
2461
|
+
*/
|
|
2462
|
+
/**
|
|
2463
|
+
* Resolve the AxlRuntime from a dynamically imported config module.
|
|
2464
|
+
* Handles ESM default exports, CJS-to-ESM interop wrapping, and named exports.
|
|
2465
|
+
*
|
|
2466
|
+
* Module shapes handled:
|
|
2467
|
+
* - ESM `export default runtime` → `mod.default` is the runtime
|
|
2468
|
+
* - CJS compiled from `export default runtime` → `mod.default.default` is the runtime
|
|
2469
|
+
* - CJS `module.exports = runtime` → `mod.default` is the runtime
|
|
2470
|
+
* - Named `export { runtime }` → `mod.runtime` is the runtime
|
|
2471
|
+
*
|
|
2472
|
+
* @internal
|
|
2473
|
+
*/
|
|
2474
|
+
declare function resolveRuntime(mod: Record<string, unknown>): unknown;
|
|
2475
|
+
/**
|
|
2476
|
+
* Look up the default-ish export from a dynamically imported module. Walks
|
|
2477
|
+
* the ESM/CJS interop chain plus a `config` named-export fallback that some
|
|
2478
|
+
* eval modules use.
|
|
2479
|
+
*
|
|
2480
|
+
* Module shapes handled:
|
|
2481
|
+
* - ESM `export default cfg`: `mod.default`
|
|
2482
|
+
* - CJS-wrapped-as-ESM: `mod.default.default`
|
|
2483
|
+
* - Named `export const config = cfg`: `mod.config`
|
|
2484
|
+
* - Bare module value: `mod`
|
|
2485
|
+
*
|
|
2486
|
+
* Mirrors the chain `pickExport()` walks for named exports — keep them in
|
|
2487
|
+
* sync so resolution is symmetric.
|
|
2488
|
+
*
|
|
2489
|
+
* @internal
|
|
2490
|
+
*/
|
|
2491
|
+
declare function pickDefault<T>(mod: Record<string, unknown>): T;
|
|
2492
|
+
/**
|
|
2493
|
+
* Look up a named export from a dynamically imported module, walking the
|
|
2494
|
+
* ESM/CJS interop chain symmetrically with `resolveRuntime` and `pickDefault`.
|
|
2495
|
+
*
|
|
2496
|
+
* Module shapes handled:
|
|
2497
|
+
* - ESM: `mod[key]`
|
|
2498
|
+
* - CJS-wrapped-as-ESM: `mod.default[key]` (tsx/ts compiled to CJS)
|
|
2499
|
+
* - CJS double-wrap: `mod.default.default[key]` (rare interop edge)
|
|
2500
|
+
*
|
|
2501
|
+
* Without this helper, named exports would be silently invisible whenever the
|
|
2502
|
+
* module loads as CJS (e.g. a `.ts` file in a package without `"type": "module"`),
|
|
2503
|
+
* even though the default export resolves correctly via the chain walk.
|
|
2504
|
+
*
|
|
2505
|
+
* `null`-valued exports are treated as "absent" (the `??` chain falls through),
|
|
2506
|
+
* matching how a missing export presents at the language level. Callers that
|
|
2507
|
+
* need to distinguish "explicitly null" from "missing" should not use this helper.
|
|
2508
|
+
*
|
|
2509
|
+
* @internal
|
|
2510
|
+
*/
|
|
2511
|
+
declare function pickExport<T>(mod: Record<string, unknown>, key: string): T | undefined;
|
|
2512
|
+
|
|
2513
|
+
/**
|
|
2514
|
+
* Shared CLI helpers for `@axlsdk/eval` and `@axlsdk/studio`. Hosted in core
|
|
2515
|
+
* so a fix to (e.g.) the tsx loader registration applies to both consumers
|
|
2516
|
+
* atomically — same anti-drift reasoning as `module-resolve.ts`.
|
|
2517
|
+
*
|
|
2518
|
+
* Not exported from the package index intentionally — these are loader-level
|
|
2519
|
+
* utilities, not part of the runtime/agent API. Consumers re-export the
|
|
2520
|
+
* pieces they need from their own `cli-utils` modules.
|
|
2521
|
+
*
|
|
2522
|
+
* @internal
|
|
2523
|
+
*/
|
|
2524
|
+
/**
|
|
2525
|
+
* Filenames searched (in order) when no `--config` is passed. Both `axl-eval`
|
|
2526
|
+
* and `axl-studio` walk this list — kept here so adding a new candidate
|
|
2527
|
+
* (e.g. `axl.config.cts`) takes effect everywhere.
|
|
2528
|
+
*
|
|
2529
|
+
* @internal
|
|
2530
|
+
*/
|
|
2531
|
+
declare const CONFIG_CANDIDATES: string[];
|
|
2532
|
+
/**
|
|
2533
|
+
* Find an `axl.config.*` file in `cwd`, returning the absolute path of the
|
|
2534
|
+
* first match in `CONFIG_CANDIDATES` order. Returns `undefined` if none exist.
|
|
2535
|
+
*
|
|
2536
|
+
* @internal
|
|
2537
|
+
*/
|
|
2538
|
+
declare function findConfig(cwd: string): string | undefined;
|
|
2539
|
+
/**
|
|
2540
|
+
* Returns true if the file is TypeScript and needs tsx to load.
|
|
2541
|
+
*
|
|
2542
|
+
* @internal
|
|
2543
|
+
*/
|
|
2544
|
+
declare function needsTsxLoader(filePath: string): boolean;
|
|
2545
|
+
/**
|
|
2546
|
+
* Import a module by file path, activating tsx's loader for `.ts`/`.tsx`
|
|
2547
|
+
* files. Throws an actionable error if tsx is needed but not installed —
|
|
2548
|
+
* preventing Node's cryptic `Unknown file extension '.ts'` from leaking
|
|
2549
|
+
* to the user.
|
|
2550
|
+
*
|
|
2551
|
+
* @internal
|
|
2552
|
+
*/
|
|
2553
|
+
declare function importModule(filePath: string, _parentURL?: string): Promise<Record<string, unknown>>;
|
|
2554
|
+
/**
|
|
2555
|
+
* Minimal glob expander. Both axl-eval (CLI args) and axl-studio's
|
|
2556
|
+
* eval-loader (`evals: '...'` middleware option) walk this so a user gets
|
|
2557
|
+
* identical behavior whether they invoke the CLI or mount the middleware.
|
|
2558
|
+
*
|
|
2559
|
+
* Supported forms:
|
|
2560
|
+
* - `dir/*.eval.ts` — match files in dir/
|
|
2561
|
+
* - `dir/.../*.eval.ts` — recursively match under dir/ (use `**\/*.eval.ts`)
|
|
2562
|
+
* - `**\/*.eval.ts` — recursively match under cwd
|
|
2563
|
+
*
|
|
2564
|
+
* Multi-segment `**` (e.g. `a/**\/b/**\/*.ts`) is not supported — deliberate
|
|
2565
|
+
* scope limit; users with that need can pre-expand themselves.
|
|
2566
|
+
*
|
|
2567
|
+
* @internal
|
|
2568
|
+
*/
|
|
2569
|
+
declare function expandGlob(pattern: string, cwd: string): string[];
|
|
2570
|
+
/**
|
|
2571
|
+
* Add custom Node.js import conditions process-wide via `module.register()`.
|
|
2572
|
+
* Used by `--conditions development` in monorepos whose package.json
|
|
2573
|
+
* `exports` use a `development` condition to point at `.ts` source instead
|
|
2574
|
+
* of built `dist`.
|
|
2575
|
+
*
|
|
2576
|
+
* Caveat: ESM-only. CJS `require()` chains bypass the hook. Files tsx
|
|
2577
|
+
* compiles to CJS (`.cts`, or `.ts` in a package without
|
|
2578
|
+
* `"type": "module"`) issue `require()` calls that don't see the extra
|
|
2579
|
+
* conditions — workaround is to add `"type": "module"` or rename to `.mts`.
|
|
2580
|
+
*
|
|
2581
|
+
* @internal
|
|
2582
|
+
*/
|
|
2583
|
+
declare function registerConditions(conditions: string[]): Promise<void>;
|
|
2584
|
+
|
|
2436
2585
|
/**
|
|
2437
2586
|
* Shared helpers for working with `AxlEvent` streams.
|
|
2438
2587
|
*
|
|
@@ -3074,4 +3223,4 @@ declare class NoopSpanManager implements SpanManager {
|
|
|
3074
3223
|
*/
|
|
3075
3224
|
declare function createSpanManager(config?: TelemetryConfig): Promise<SpanManager>;
|
|
3076
3225
|
|
|
3077
|
-
export { AXL_EVENT_TYPES, type Agent, type AgentCallEndData, type AgentCallInfo, type AgentCallParams, type AgentCallStartData, type AgentConfig, AnthropicProvider, type AnyWorkflow, type AskOptions, type AskScoped, type AwaitHumanData, type AwaitHumanOptions, type AwaitHumanResolvedData, type AxlConfig, AxlError, type AxlEvent, type AxlEventBase, type AxlEventOf, type AxlEventType, AxlRuntime, AxlStream, BudgetExceededError, type BudgetOptions, type BudgetResult, COST_BEARING_LEAF_TYPES, type CallbackMeta, type ChatMessage, type ChatOptions, type CheckpointEventData, type CreateContextOptions, type DelegateData, type DelegateOptions, type Effort, type EmbedResult, type EmbedUsage, type Embedder, type EvalHistoryEntry, type ExecuteOptions, type ExecutionInfo, type ExecutionState, GeminiProvider, type GuardrailBlockHandler, type GuardrailData, GuardrailError, type GuardrailResult, type GuardrailsConfig, type HandoffDescriptor, type HandoffRecord, type HandoffReturnData, type HandoffStartData, type HumanDecision, InMemoryVectorStore, type InputGuardrail, type MapOptions, MaxTurnsError, McpManager, type McpServer, type McpServerConfig, type McpToolDefinition, type McpToolResult, type MemoryConfig, type MemoryEventData, MemoryManager, MemoryStore, NoConsensus, NoopSpanManager, OpenAIEmbedder, OpenAIProvider, OpenAIResponsesProvider, type OutputGuardrail, type OutputValidator, type PendingDecision, type Provider, type ProviderAdapter, ProviderRegistry, type ProviderResponse, QuorumNotMet, REDACTED, REDACTION_RULES, type RaceOptions, type RecallOptions, type RecallResult, RedisStore, type RememberOptions, type RememberResult, type ResolvedThinkingOptions, type Result, type RetryPolicy, SQLiteStore, type SchemaCheckData, Session, type SessionOptions, type SpanHandle, type SpanManager, type SpawnOptions, SqliteVectorStore, type StateStore, type StreamChunk, type TelemetryConfig, TimeoutError, type Tool, type ToolApprovalData, type ToolCallData, type ToolCallMessage, type ToolCallStartData, type ToolChoice, type ToolConfig, ToolDenied, type ToolDeniedData, type ToolHooks, type ValidateData, type ValidateResult, ValidationError, type VectorEntry, type VectorResult, type VectorStore, type VerifyData, VerifyError, type VerifyOptions, type VerifyRetry, type VoteOptions, type Workflow, type WorkflowConfig, WorkflowContext, type WorkflowContextInit, type WorkflowEndData, type WorkflowStartData, agent, createSpanManager, defineConfig, eventCostContribution, extractJson, isCostBearingLeaf, isRootLevel, parsePartialJson, redactEvent, resolveThinkingOptions, tool, workflow, zodToJsonSchema };
|
|
3226
|
+
export { AXL_EVENT_TYPES, type Agent, type AgentCallEndData, type AgentCallInfo, type AgentCallParams, type AgentCallStartData, type AgentConfig, AnthropicProvider, type AnyWorkflow, type AskOptions, type AskScoped, type AwaitHumanData, type AwaitHumanOptions, type AwaitHumanResolvedData, type AxlConfig, AxlError, type AxlEvent, type AxlEventBase, type AxlEventOf, type AxlEventType, AxlRuntime, AxlStream, BudgetExceededError, type BudgetOptions, type BudgetResult, CONFIG_CANDIDATES, COST_BEARING_LEAF_TYPES, type CallbackMeta, type ChatMessage, type ChatOptions, type CheckpointEventData, type CreateContextOptions, type DelegateData, type DelegateOptions, type Effort, type EmbedResult, type EmbedUsage, type Embedder, type EvalExecuteWorkflow, type EvalHistoryEntry, type ExecuteOptions, type ExecutionInfo, type ExecutionState, GeminiProvider, type GuardrailBlockHandler, type GuardrailData, GuardrailError, type GuardrailResult, type GuardrailsConfig, type HandoffDescriptor, type HandoffRecord, type HandoffReturnData, type HandoffStartData, type HumanDecision, InMemoryVectorStore, type InputGuardrail, type MapOptions, MaxTurnsError, McpManager, type McpServer, type McpServerConfig, type McpToolDefinition, type McpToolResult, type MemoryConfig, type MemoryEventData, MemoryManager, MemoryStore, NoConsensus, NoopSpanManager, OpenAIEmbedder, OpenAIProvider, OpenAIResponsesProvider, type OutputGuardrail, type OutputValidator, type PendingDecision, type Provider, type ProviderAdapter, ProviderRegistry, type ProviderResponse, QuorumNotMet, REDACTED, REDACTION_RULES, type RaceOptions, type RecallOptions, type RecallResult, RedisStore, type RememberOptions, type RememberResult, type ResolvedThinkingOptions, type Result, type RetryPolicy, SQLiteStore, type SchemaCheckData, Session, type SessionOptions, type SpanHandle, type SpanManager, type SpawnOptions, SqliteVectorStore, type StateStore, type StreamChunk, type TelemetryConfig, TimeoutError, type Tool, type ToolApprovalData, type ToolCallData, type ToolCallMessage, type ToolCallStartData, type ToolChoice, type ToolConfig, ToolDenied, type ToolDeniedData, type ToolHooks, type ValidateData, type ValidateResult, ValidationError, type VectorEntry, type VectorResult, type VectorStore, type VerifyData, VerifyError, type VerifyOptions, type VerifyRetry, type VoteOptions, type Workflow, type WorkflowConfig, WorkflowContext, type WorkflowContextInit, type WorkflowEndData, type WorkflowStartData, agent, createSpanManager, defineConfig, eventCostContribution, expandGlob, extractJson, findConfig, importModule, isCostBearingLeaf, isRootLevel, needsTsxLoader, parsePartialJson, pickDefault, pickExport, redactEvent, registerConditions, resolveRuntime, resolveThinkingOptions, tool, workflow, zodToJsonSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -2035,6 +2035,23 @@ declare class Session {
|
|
|
2035
2035
|
fork(newId: string): Promise<Session>;
|
|
2036
2036
|
}
|
|
2037
2037
|
|
|
2038
|
+
/**
|
|
2039
|
+
* Function exported from an eval module that overrides the default
|
|
2040
|
+
* `runtime.execute(workflow, input)` behavior. The runtime injects itself as
|
|
2041
|
+
* the second argument so user code can call `runtime.createContext()` etc.
|
|
2042
|
+
*
|
|
2043
|
+
* Returns `{ output, cost?, metadata? }` — cost and metadata are optional and
|
|
2044
|
+
* fall back to values derived from `runtime.trackExecution()` when omitted.
|
|
2045
|
+
*
|
|
2046
|
+
* Single source of truth for the eval-execution contract; consumed by
|
|
2047
|
+
* `registerEval`, `getRegisteredEval`, the `axl-eval` CLI, and
|
|
2048
|
+
* `@axlsdk/studio`'s eval-loader.
|
|
2049
|
+
*/
|
|
2050
|
+
type EvalExecuteWorkflow = (input: unknown, runtime?: AxlRuntime) => Promise<{
|
|
2051
|
+
output: unknown;
|
|
2052
|
+
cost?: number;
|
|
2053
|
+
metadata?: Record<string, unknown>;
|
|
2054
|
+
}>;
|
|
2038
2055
|
type ExecuteOptions = {
|
|
2039
2056
|
metadata?: Record<string, unknown>;
|
|
2040
2057
|
/** Handler for tool approval requests. When provided, tools with `requireApproval` resolve
|
|
@@ -2198,10 +2215,7 @@ declare class AxlRuntime extends EventEmitter {
|
|
|
2198
2215
|
* An optional `executeWorkflow` function can override the default behavior
|
|
2199
2216
|
* of calling `runtime.execute()`.
|
|
2200
2217
|
*/
|
|
2201
|
-
registerEval(name: string, config: unknown, executeWorkflow?:
|
|
2202
|
-
output: unknown;
|
|
2203
|
-
cost?: number;
|
|
2204
|
-
}>): void;
|
|
2218
|
+
registerEval(name: string, config: unknown, executeWorkflow?: EvalExecuteWorkflow): void;
|
|
2205
2219
|
/** Get metadata about all registered evals. */
|
|
2206
2220
|
getRegisteredEvals(): Array<{
|
|
2207
2221
|
name: string;
|
|
@@ -2212,11 +2226,7 @@ declare class AxlRuntime extends EventEmitter {
|
|
|
2212
2226
|
/** Get a registered eval config by name. */
|
|
2213
2227
|
getRegisteredEval(name: string): {
|
|
2214
2228
|
config: unknown;
|
|
2215
|
-
executeWorkflow?:
|
|
2216
|
-
output: unknown;
|
|
2217
|
-
cost?: number;
|
|
2218
|
-
metadata?: Record<string, unknown>;
|
|
2219
|
-
}>;
|
|
2229
|
+
executeWorkflow?: EvalExecuteWorkflow;
|
|
2220
2230
|
} | undefined;
|
|
2221
2231
|
/** Run a registered eval by name. */
|
|
2222
2232
|
runRegisteredEval(name: string, options?: {
|
|
@@ -2433,6 +2443,145 @@ declare class AxlRuntime extends EventEmitter {
|
|
|
2433
2443
|
private updateHandoffDuration;
|
|
2434
2444
|
}
|
|
2435
2445
|
|
|
2446
|
+
/**
|
|
2447
|
+
* Module-export resolution helpers for dynamically-imported user modules.
|
|
2448
|
+
*
|
|
2449
|
+
* Walks the ESM/CJS interop chain so consumers see the same shape regardless
|
|
2450
|
+
* of how Node loaded the file. The original motivating bug: `axl-eval` looked
|
|
2451
|
+
* up `executeWorkflow` as `mod.executeWorkflow` only, but tsx-loading a `.ts`
|
|
2452
|
+
* file in a CJS package puts named exports on `mod.default.executeWorkflow`,
|
|
2453
|
+
* so the lookup silently fell back to identity passthrough — producing
|
|
2454
|
+
* all-zero scores in CI.
|
|
2455
|
+
*
|
|
2456
|
+
* Use these helpers (not hand-rolled `mod.default ?? mod` walks) at every
|
|
2457
|
+
* dynamic-import call site to keep default and named lookups symmetric.
|
|
2458
|
+
*
|
|
2459
|
+
* @internal Not part of the public SDK surface — exported only so the eval
|
|
2460
|
+
* CLI and Studio middleware can share one implementation.
|
|
2461
|
+
*/
|
|
2462
|
+
/**
|
|
2463
|
+
* Resolve the AxlRuntime from a dynamically imported config module.
|
|
2464
|
+
* Handles ESM default exports, CJS-to-ESM interop wrapping, and named exports.
|
|
2465
|
+
*
|
|
2466
|
+
* Module shapes handled:
|
|
2467
|
+
* - ESM `export default runtime` → `mod.default` is the runtime
|
|
2468
|
+
* - CJS compiled from `export default runtime` → `mod.default.default` is the runtime
|
|
2469
|
+
* - CJS `module.exports = runtime` → `mod.default` is the runtime
|
|
2470
|
+
* - Named `export { runtime }` → `mod.runtime` is the runtime
|
|
2471
|
+
*
|
|
2472
|
+
* @internal
|
|
2473
|
+
*/
|
|
2474
|
+
declare function resolveRuntime(mod: Record<string, unknown>): unknown;
|
|
2475
|
+
/**
|
|
2476
|
+
* Look up the default-ish export from a dynamically imported module. Walks
|
|
2477
|
+
* the ESM/CJS interop chain plus a `config` named-export fallback that some
|
|
2478
|
+
* eval modules use.
|
|
2479
|
+
*
|
|
2480
|
+
* Module shapes handled:
|
|
2481
|
+
* - ESM `export default cfg`: `mod.default`
|
|
2482
|
+
* - CJS-wrapped-as-ESM: `mod.default.default`
|
|
2483
|
+
* - Named `export const config = cfg`: `mod.config`
|
|
2484
|
+
* - Bare module value: `mod`
|
|
2485
|
+
*
|
|
2486
|
+
* Mirrors the chain `pickExport()` walks for named exports — keep them in
|
|
2487
|
+
* sync so resolution is symmetric.
|
|
2488
|
+
*
|
|
2489
|
+
* @internal
|
|
2490
|
+
*/
|
|
2491
|
+
declare function pickDefault<T>(mod: Record<string, unknown>): T;
|
|
2492
|
+
/**
|
|
2493
|
+
* Look up a named export from a dynamically imported module, walking the
|
|
2494
|
+
* ESM/CJS interop chain symmetrically with `resolveRuntime` and `pickDefault`.
|
|
2495
|
+
*
|
|
2496
|
+
* Module shapes handled:
|
|
2497
|
+
* - ESM: `mod[key]`
|
|
2498
|
+
* - CJS-wrapped-as-ESM: `mod.default[key]` (tsx/ts compiled to CJS)
|
|
2499
|
+
* - CJS double-wrap: `mod.default.default[key]` (rare interop edge)
|
|
2500
|
+
*
|
|
2501
|
+
* Without this helper, named exports would be silently invisible whenever the
|
|
2502
|
+
* module loads as CJS (e.g. a `.ts` file in a package without `"type": "module"`),
|
|
2503
|
+
* even though the default export resolves correctly via the chain walk.
|
|
2504
|
+
*
|
|
2505
|
+
* `null`-valued exports are treated as "absent" (the `??` chain falls through),
|
|
2506
|
+
* matching how a missing export presents at the language level. Callers that
|
|
2507
|
+
* need to distinguish "explicitly null" from "missing" should not use this helper.
|
|
2508
|
+
*
|
|
2509
|
+
* @internal
|
|
2510
|
+
*/
|
|
2511
|
+
declare function pickExport<T>(mod: Record<string, unknown>, key: string): T | undefined;
|
|
2512
|
+
|
|
2513
|
+
/**
|
|
2514
|
+
* Shared CLI helpers for `@axlsdk/eval` and `@axlsdk/studio`. Hosted in core
|
|
2515
|
+
* so a fix to (e.g.) the tsx loader registration applies to both consumers
|
|
2516
|
+
* atomically — same anti-drift reasoning as `module-resolve.ts`.
|
|
2517
|
+
*
|
|
2518
|
+
* Not exported from the package index intentionally — these are loader-level
|
|
2519
|
+
* utilities, not part of the runtime/agent API. Consumers re-export the
|
|
2520
|
+
* pieces they need from their own `cli-utils` modules.
|
|
2521
|
+
*
|
|
2522
|
+
* @internal
|
|
2523
|
+
*/
|
|
2524
|
+
/**
|
|
2525
|
+
* Filenames searched (in order) when no `--config` is passed. Both `axl-eval`
|
|
2526
|
+
* and `axl-studio` walk this list — kept here so adding a new candidate
|
|
2527
|
+
* (e.g. `axl.config.cts`) takes effect everywhere.
|
|
2528
|
+
*
|
|
2529
|
+
* @internal
|
|
2530
|
+
*/
|
|
2531
|
+
declare const CONFIG_CANDIDATES: string[];
|
|
2532
|
+
/**
|
|
2533
|
+
* Find an `axl.config.*` file in `cwd`, returning the absolute path of the
|
|
2534
|
+
* first match in `CONFIG_CANDIDATES` order. Returns `undefined` if none exist.
|
|
2535
|
+
*
|
|
2536
|
+
* @internal
|
|
2537
|
+
*/
|
|
2538
|
+
declare function findConfig(cwd: string): string | undefined;
|
|
2539
|
+
/**
|
|
2540
|
+
* Returns true if the file is TypeScript and needs tsx to load.
|
|
2541
|
+
*
|
|
2542
|
+
* @internal
|
|
2543
|
+
*/
|
|
2544
|
+
declare function needsTsxLoader(filePath: string): boolean;
|
|
2545
|
+
/**
|
|
2546
|
+
* Import a module by file path, activating tsx's loader for `.ts`/`.tsx`
|
|
2547
|
+
* files. Throws an actionable error if tsx is needed but not installed —
|
|
2548
|
+
* preventing Node's cryptic `Unknown file extension '.ts'` from leaking
|
|
2549
|
+
* to the user.
|
|
2550
|
+
*
|
|
2551
|
+
* @internal
|
|
2552
|
+
*/
|
|
2553
|
+
declare function importModule(filePath: string, _parentURL?: string): Promise<Record<string, unknown>>;
|
|
2554
|
+
/**
|
|
2555
|
+
* Minimal glob expander. Both axl-eval (CLI args) and axl-studio's
|
|
2556
|
+
* eval-loader (`evals: '...'` middleware option) walk this so a user gets
|
|
2557
|
+
* identical behavior whether they invoke the CLI or mount the middleware.
|
|
2558
|
+
*
|
|
2559
|
+
* Supported forms:
|
|
2560
|
+
* - `dir/*.eval.ts` — match files in dir/
|
|
2561
|
+
* - `dir/.../*.eval.ts` — recursively match under dir/ (use `**\/*.eval.ts`)
|
|
2562
|
+
* - `**\/*.eval.ts` — recursively match under cwd
|
|
2563
|
+
*
|
|
2564
|
+
* Multi-segment `**` (e.g. `a/**\/b/**\/*.ts`) is not supported — deliberate
|
|
2565
|
+
* scope limit; users with that need can pre-expand themselves.
|
|
2566
|
+
*
|
|
2567
|
+
* @internal
|
|
2568
|
+
*/
|
|
2569
|
+
declare function expandGlob(pattern: string, cwd: string): string[];
|
|
2570
|
+
/**
|
|
2571
|
+
* Add custom Node.js import conditions process-wide via `module.register()`.
|
|
2572
|
+
* Used by `--conditions development` in monorepos whose package.json
|
|
2573
|
+
* `exports` use a `development` condition to point at `.ts` source instead
|
|
2574
|
+
* of built `dist`.
|
|
2575
|
+
*
|
|
2576
|
+
* Caveat: ESM-only. CJS `require()` chains bypass the hook. Files tsx
|
|
2577
|
+
* compiles to CJS (`.cts`, or `.ts` in a package without
|
|
2578
|
+
* `"type": "module"`) issue `require()` calls that don't see the extra
|
|
2579
|
+
* conditions — workaround is to add `"type": "module"` or rename to `.mts`.
|
|
2580
|
+
*
|
|
2581
|
+
* @internal
|
|
2582
|
+
*/
|
|
2583
|
+
declare function registerConditions(conditions: string[]): Promise<void>;
|
|
2584
|
+
|
|
2436
2585
|
/**
|
|
2437
2586
|
* Shared helpers for working with `AxlEvent` streams.
|
|
2438
2587
|
*
|
|
@@ -3074,4 +3223,4 @@ declare class NoopSpanManager implements SpanManager {
|
|
|
3074
3223
|
*/
|
|
3075
3224
|
declare function createSpanManager(config?: TelemetryConfig): Promise<SpanManager>;
|
|
3076
3225
|
|
|
3077
|
-
export { AXL_EVENT_TYPES, type Agent, type AgentCallEndData, type AgentCallInfo, type AgentCallParams, type AgentCallStartData, type AgentConfig, AnthropicProvider, type AnyWorkflow, type AskOptions, type AskScoped, type AwaitHumanData, type AwaitHumanOptions, type AwaitHumanResolvedData, type AxlConfig, AxlError, type AxlEvent, type AxlEventBase, type AxlEventOf, type AxlEventType, AxlRuntime, AxlStream, BudgetExceededError, type BudgetOptions, type BudgetResult, COST_BEARING_LEAF_TYPES, type CallbackMeta, type ChatMessage, type ChatOptions, type CheckpointEventData, type CreateContextOptions, type DelegateData, type DelegateOptions, type Effort, type EmbedResult, type EmbedUsage, type Embedder, type EvalHistoryEntry, type ExecuteOptions, type ExecutionInfo, type ExecutionState, GeminiProvider, type GuardrailBlockHandler, type GuardrailData, GuardrailError, type GuardrailResult, type GuardrailsConfig, type HandoffDescriptor, type HandoffRecord, type HandoffReturnData, type HandoffStartData, type HumanDecision, InMemoryVectorStore, type InputGuardrail, type MapOptions, MaxTurnsError, McpManager, type McpServer, type McpServerConfig, type McpToolDefinition, type McpToolResult, type MemoryConfig, type MemoryEventData, MemoryManager, MemoryStore, NoConsensus, NoopSpanManager, OpenAIEmbedder, OpenAIProvider, OpenAIResponsesProvider, type OutputGuardrail, type OutputValidator, type PendingDecision, type Provider, type ProviderAdapter, ProviderRegistry, type ProviderResponse, QuorumNotMet, REDACTED, REDACTION_RULES, type RaceOptions, type RecallOptions, type RecallResult, RedisStore, type RememberOptions, type RememberResult, type ResolvedThinkingOptions, type Result, type RetryPolicy, SQLiteStore, type SchemaCheckData, Session, type SessionOptions, type SpanHandle, type SpanManager, type SpawnOptions, SqliteVectorStore, type StateStore, type StreamChunk, type TelemetryConfig, TimeoutError, type Tool, type ToolApprovalData, type ToolCallData, type ToolCallMessage, type ToolCallStartData, type ToolChoice, type ToolConfig, ToolDenied, type ToolDeniedData, type ToolHooks, type ValidateData, type ValidateResult, ValidationError, type VectorEntry, type VectorResult, type VectorStore, type VerifyData, VerifyError, type VerifyOptions, type VerifyRetry, type VoteOptions, type Workflow, type WorkflowConfig, WorkflowContext, type WorkflowContextInit, type WorkflowEndData, type WorkflowStartData, agent, createSpanManager, defineConfig, eventCostContribution, extractJson, isCostBearingLeaf, isRootLevel, parsePartialJson, redactEvent, resolveThinkingOptions, tool, workflow, zodToJsonSchema };
|
|
3226
|
+
export { AXL_EVENT_TYPES, type Agent, type AgentCallEndData, type AgentCallInfo, type AgentCallParams, type AgentCallStartData, type AgentConfig, AnthropicProvider, type AnyWorkflow, type AskOptions, type AskScoped, type AwaitHumanData, type AwaitHumanOptions, type AwaitHumanResolvedData, type AxlConfig, AxlError, type AxlEvent, type AxlEventBase, type AxlEventOf, type AxlEventType, AxlRuntime, AxlStream, BudgetExceededError, type BudgetOptions, type BudgetResult, CONFIG_CANDIDATES, COST_BEARING_LEAF_TYPES, type CallbackMeta, type ChatMessage, type ChatOptions, type CheckpointEventData, type CreateContextOptions, type DelegateData, type DelegateOptions, type Effort, type EmbedResult, type EmbedUsage, type Embedder, type EvalExecuteWorkflow, type EvalHistoryEntry, type ExecuteOptions, type ExecutionInfo, type ExecutionState, GeminiProvider, type GuardrailBlockHandler, type GuardrailData, GuardrailError, type GuardrailResult, type GuardrailsConfig, type HandoffDescriptor, type HandoffRecord, type HandoffReturnData, type HandoffStartData, type HumanDecision, InMemoryVectorStore, type InputGuardrail, type MapOptions, MaxTurnsError, McpManager, type McpServer, type McpServerConfig, type McpToolDefinition, type McpToolResult, type MemoryConfig, type MemoryEventData, MemoryManager, MemoryStore, NoConsensus, NoopSpanManager, OpenAIEmbedder, OpenAIProvider, OpenAIResponsesProvider, type OutputGuardrail, type OutputValidator, type PendingDecision, type Provider, type ProviderAdapter, ProviderRegistry, type ProviderResponse, QuorumNotMet, REDACTED, REDACTION_RULES, type RaceOptions, type RecallOptions, type RecallResult, RedisStore, type RememberOptions, type RememberResult, type ResolvedThinkingOptions, type Result, type RetryPolicy, SQLiteStore, type SchemaCheckData, Session, type SessionOptions, type SpanHandle, type SpanManager, type SpawnOptions, SqliteVectorStore, type StateStore, type StreamChunk, type TelemetryConfig, TimeoutError, type Tool, type ToolApprovalData, type ToolCallData, type ToolCallMessage, type ToolCallStartData, type ToolChoice, type ToolConfig, ToolDenied, type ToolDeniedData, type ToolHooks, type ValidateData, type ValidateResult, ValidationError, type VectorEntry, type VectorResult, type VectorStore, type VerifyData, VerifyError, type VerifyOptions, type VerifyRetry, type VoteOptions, type Workflow, type WorkflowConfig, WorkflowContext, type WorkflowContextInit, type WorkflowEndData, type WorkflowStartData, agent, createSpanManager, defineConfig, eventCostContribution, expandGlob, extractJson, findConfig, importModule, isCostBearingLeaf, isRootLevel, needsTsxLoader, parsePartialJson, pickDefault, pickExport, redactEvent, registerConditions, resolveRuntime, resolveThinkingOptions, tool, workflow, zodToJsonSchema };
|