@aaac/runtime 0.1.23 → 0.1.24
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/adapters/adk-sdk.d.ts +1 -1
- package/dist/adapters/claude-agent-sdk.d.ts +1 -1
- package/dist/adapters/mock.d.ts +1 -1
- package/dist/adapters/openai-agents-sdk.d.ts +1 -1
- package/dist/index.d.ts +3 -31
- package/dist/index.js +48 -6
- package/dist/index.js.map +1 -1
- package/dist/{task-runner-DzLAb3UC.d.ts → task-runner-Bl3SZfft.d.ts} +46 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as SdkAdapter, G as GuardrailHooks, C as CacheConfig, A as AdapterSendOptions, a as AgentExecutionRequest, M as MemoryRef } from '../task-runner-
|
|
1
|
+
import { S as SdkAdapter, G as GuardrailHooks, C as CacheConfig, A as AdapterSendOptions, a as AgentExecutionRequest, M as MemoryRef } from '../task-runner-Bl3SZfft.js';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import '../context-DKkamYX_.js';
|
|
4
4
|
import '@aaac/observability';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as SdkAdapter, G as GuardrailHooks, C as CacheConfig, A as AdapterSendOptions, a as AgentExecutionRequest, M as MemoryRef, T as TokenUsage } from '../task-runner-
|
|
1
|
+
import { S as SdkAdapter, G as GuardrailHooks, C as CacheConfig, A as AdapterSendOptions, a as AgentExecutionRequest, M as MemoryRef, T as TokenUsage } from '../task-runner-Bl3SZfft.js';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import '../context-DKkamYX_.js';
|
|
4
4
|
import '@aaac/observability';
|
package/dist/adapters/mock.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as SdkAdapter, A as AdapterSendOptions, M as MemoryRef } from '../task-runner-
|
|
1
|
+
import { S as SdkAdapter, A as AdapterSendOptions, M as MemoryRef } from '../task-runner-Bl3SZfft.js';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import '../context-DKkamYX_.js';
|
|
4
4
|
import '@aaac/observability';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as SdkAdapter, G as GuardrailHooks, C as CacheConfig, A as AdapterSendOptions, a as AgentExecutionRequest, M as MemoryRef } from '../task-runner-
|
|
1
|
+
import { S as SdkAdapter, G as GuardrailHooks, C as CacheConfig, A as AdapterSendOptions, a as AgentExecutionRequest, M as MemoryRef } from '../task-runner-Bl3SZfft.js';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import '../context-DKkamYX_.js';
|
|
4
4
|
import '@aaac/observability';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as ObserverEmitFn, b as TaskContext, c as TaskOutcome, d as AgentContractLike, e as TaskContractLike, P as PromptBuilderOptions, W as WorkflowResult, S as SdkAdapter, f as WorkflowRegistries, H as HandoffInput, g as StepCompleteEvent, h as StepResult, D as DelegateStep, i as GuardrailRuleData, j as MemoryStore, M as MemoryRef,
|
|
2
|
-
export {
|
|
1
|
+
import { O as ObserverEmitFn, b as TaskContext, c as TaskOutcome, d as AgentContractLike, e as TaskContractLike, P as PromptBuilderOptions, W as WorkflowResult, S as SdkAdapter, f as WorkflowRegistries, H as HandoffInput, g as StepCompleteEvent, h as StepResult, D as DelegateStep, i as GuardrailRuleData, j as MemoryStore, M as MemoryRef, k as SdkFunctionTool, G as GuardrailHooks, R as ResolvedComponent, l as ArtifactBindingConfig, m as RunToolchainChecksOptions, n as TaskRunResult, L as LibraryToolRegistry, o as ResolvedToolchain, p as LibraryToolDefinition, q as HookResponse, r as GuardrailCheckResult } from './task-runner-Bl3SZfft.js';
|
|
2
|
+
export { s as AdapterOrFactory, A as AdapterSendOptions, a as AgentExecutionRequest, t as AgentProgressEvent, B as BoundResolveOptions, u as BoundResolver, C as CacheConfig, v as CandidateAgent, w as ConvergenceEnvelope, x as ConvergenceEnvelopePayload, E as EnvelopeParams, y as EvaluateStep, z as GateStep, F as GuardrailCheckFunctions, I as GuardrailRule, J as HookContext, K as InMemoryStore, N as InnerSpanOptions, Q as ModelAwareSdkAdapterFactory, U as ModelClass, V as ModelMappingConfig, X as ModelResolver, Y as ModelResolverOptions, Z as ReceiveSpec, _ as ResolvedModel, $ as RetryDecision, a0 as SdkAdapterFactory, a1 as SplitPrompt, a2 as TaskRunOptions, T as TokenUsage, a3 as ToolchainCheckResult, a4 as ToolchainManifest, a5 as ToolchainManifestSchema, a6 as WorkflowContractLike, a7 as WorkflowInvocation, a8 as WorkflowRunOptions, a9 as WorkflowStep, aa as buildCandidateAgents, ab as buildGateEvaluationPrompt, ac as buildPerAgentGuardrails, ad as buildRetryFollowUp, ae as buildSdkFunctionTools, af as buildSplitTaskPrompt, ag as buildTaskPrompt, ah as createExecutionEnvelope, ai as createGuardrailHooks, aj as createGuardrailHooksForAgent, ak as createGuardrailHooksFromRules, al as createLibraryToolRegistry, am as createModelResolver, an as createRegistryFromSdkTools, ao as deriveToolchainsForAgents, ap as emitIterationClose, aq as emitIterationMetric, ar as emitIterationOpen, as as emitLlmTurnClose, at as emitLlmTurnOpen, au as emitSessionClose, av as emitSessionOpen, aw as emitSubagentClose, ax as emitSubagentOpen, ay as emitToolExecClose, az as emitToolExecOpen, aA as emitToolchainClose, aB as emitToolchainOpen, aC as extractStructuredResult, aD as getBlockingViolations, aE as getEffectiveGuardrailIds, aF as getGuardrailRulesForAgent, aG as getWarnings, aH as guardrailContextToRuleData, aI as hasBlockingViolation, aJ as parseGateEvaluationResponse, aK as renderAgentSystemPrompt, aL as runTask, aM as runToolchainChecks, aN as runWorkflow, aO as zodSchemaToPromptDescription, aP as zodSchemaToYamlExample } from './task-runner-Bl3SZfft.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { OperationIR, ComponentIR } from '@aaac/contracts';
|
|
5
5
|
import { ResolvedConfig } from './generator/index.js';
|
|
@@ -355,34 +355,6 @@ declare class AgentLogWriter {
|
|
|
355
355
|
}>;
|
|
356
356
|
}
|
|
357
357
|
|
|
358
|
-
/**
|
|
359
|
-
* Library Tool → SDK Function Tool conversion.
|
|
360
|
-
*
|
|
361
|
-
* Converts LibraryToolDefinition entries into SDK-native function tools
|
|
362
|
-
* that each adapter can register with its respective LLM SDK.
|
|
363
|
-
*
|
|
364
|
-
* Each adapter receives tools in its native format:
|
|
365
|
-
* - Claude Agent SDK: MCP tool via createSdkMcpServer + tool()
|
|
366
|
-
* - OpenAI Agents SDK: function tool object
|
|
367
|
-
* - Google ADK: FunctionDeclaration tool
|
|
368
|
-
*/
|
|
369
|
-
|
|
370
|
-
/**
|
|
371
|
-
* Adapter-agnostic function tool descriptor. Adapters convert this
|
|
372
|
-
* into their SDK-specific tool format.
|
|
373
|
-
*/
|
|
374
|
-
interface SdkFunctionTool {
|
|
375
|
-
name: string;
|
|
376
|
-
description: string;
|
|
377
|
-
inputSchema: Record<string, unknown>;
|
|
378
|
-
handler: (args: Record<string, unknown>) => Promise<string>;
|
|
379
|
-
}
|
|
380
|
-
/**
|
|
381
|
-
* Build adapter-agnostic function tool descriptors from a LibraryToolRegistry.
|
|
382
|
-
* Each tool's handler calls registry.execute() and serialises the result.
|
|
383
|
-
*/
|
|
384
|
-
declare function buildSdkFunctionTools(registry: LibraryToolRegistry): SdkFunctionTool[];
|
|
385
|
-
|
|
386
358
|
/**
|
|
387
359
|
* Analyzer Bridge — integrates artifact-contracts-analyzer as a standard
|
|
388
360
|
* runtime tool provider.
|
|
@@ -891,4 +863,4 @@ declare function executePrompt(message: string, ir: ComponentIR, binding: Runtim
|
|
|
891
863
|
/** Package version string. */
|
|
892
864
|
declare const version: string;
|
|
893
865
|
|
|
894
|
-
export { type AaacInvocationContext, type AaacObserver, type AaacPolicy, type AaacRuntime, AgentContractLike, AgentLogWriter, type AgentLogWriterOptions, type AgentPlugin, type AnalyzeImpactInput, type AnalyzerBridge, type AnalyzerBridgeOptions, ArtifactBindingConfig, type ArtifactResolveOptions, type ArtifactResolveResult, type BuildCallGraphInput, type ComponentScope, type CreateAdapterOptions, type CreateComponentScopeOptions, type CreateProjectRuntimeOptions, DelegateStep, type DslContext, DslValidationError, type EvaluateGuardrailOptions, type EvaluateGuardrailResult, type ExecuteOptions, type ExecuteTaskOptions, type ExecuteWorkflowOptions, FileMemoryStore, type GenerateContextPackInput, type GuardStatusOptions, type GuardStatusResult, GuardrailCheckResult, GuardrailHooks, type GuardrailListEntry, type GuardrailResult, GuardrailRuleData, HandoffInput, HookResponse, LibraryToolDefinition, LibraryToolRegistry, type ListGuardrailsOptions, type ListGuardrailsResult, type LoadDslOptions, MemoryRef, MemoryStore, type MemoryStoreEntry, type NavigationContext, type NavigationContextOptions, ObserverEmitFn, type OperationHandler, type OperationMemoryRefConfig, type OperationToolDef, PROJECT_CONFIG_FILENAME, type PermissionMode, type PluginLoadResult, PluginRegistry, type ProcessEditOptions, type ProcessTaskOptions, type ProcessWorkflowOptions, type ProgressSink, type ProgressSinkOptions, type ProjectRuntime, type PromptBuilderArgs, PromptBuilderOptions, type PromptExecuteOptions, type PromptResult, type RequiredEntities, type ResolvedAdapterSelection, ResolvedComponent, ResolvedToolchain, type RunLogEvent, RunToolchainChecksOptions, type Runtime, type RuntimeBinding, type RuntimeConfig, SdkAdapter,
|
|
866
|
+
export { type AaacInvocationContext, type AaacObserver, type AaacPolicy, type AaacRuntime, AgentContractLike, AgentLogWriter, type AgentLogWriterOptions, type AgentPlugin, type AnalyzeImpactInput, type AnalyzerBridge, type AnalyzerBridgeOptions, ArtifactBindingConfig, type ArtifactResolveOptions, type ArtifactResolveResult, type BuildCallGraphInput, type ComponentScope, type CreateAdapterOptions, type CreateComponentScopeOptions, type CreateProjectRuntimeOptions, DelegateStep, type DslContext, DslValidationError, type EvaluateGuardrailOptions, type EvaluateGuardrailResult, type ExecuteOptions, type ExecuteTaskOptions, type ExecuteWorkflowOptions, FileMemoryStore, type GenerateContextPackInput, type GuardStatusOptions, type GuardStatusResult, GuardrailCheckResult, GuardrailHooks, type GuardrailListEntry, type GuardrailResult, GuardrailRuleData, HandoffInput, HookResponse, LibraryToolDefinition, LibraryToolRegistry, type ListGuardrailsOptions, type ListGuardrailsResult, type LoadDslOptions, MemoryRef, MemoryStore, type MemoryStoreEntry, type NavigationContext, type NavigationContextOptions, ObserverEmitFn, type OperationHandler, type OperationMemoryRefConfig, type OperationToolDef, PROJECT_CONFIG_FILENAME, type PermissionMode, type PluginLoadResult, PluginRegistry, type ProcessEditOptions, type ProcessTaskOptions, type ProcessWorkflowOptions, type ProgressSink, type ProgressSinkOptions, type ProjectRuntime, type PromptBuilderArgs, PromptBuilderOptions, type PromptExecuteOptions, type PromptResult, type RequiredEntities, type ResolvedAdapterSelection, ResolvedComponent, ResolvedToolchain, type RunLogEvent, RunToolchainChecksOptions, type Runtime, type RuntimeBinding, type RuntimeConfig, SdkAdapter, SdkFunctionTool, StepCompleteEvent, StepResult, TaskContext, TaskContractLike, type TaskHookContext, TaskOutcome, TaskRunResult, WorkflowBuilder, type WorkflowHookContext, WorkflowRegistries, WorkflowResult, buildGuardrailRulesFromDsl, buildNavigationContext, buildRegistriesFromDsl, createAdapter, createAnalyzerBridge, createComponentScope, createProgressSink, createProjectRuntime, createRuntime, createRuntimeBinding, emitProcessEdit, emitProcessTaskClose, emitProcessTaskOpen, emitProcessWorkflowClose, emitProcessWorkflowOpen, evaluateGuardrail, executePrompt, executeTask, executeWorkflow, findProjectConfig, guardStatus, isContextPack, jsonSchemaToZod, listGuardrails, loadDslContext, loadPlugins, loadPluginsFromDirectory, loadPluginsFromPaths, operationsToTools, parseRouterResponse, pluginRegistry, renderContextPackPrompt, resolveArtifacts, version };
|
package/dist/index.js
CHANGED
|
@@ -1215,7 +1215,8 @@ function resolveInvocation(invocation) {
|
|
|
1215
1215
|
onOptionalStep: invocation.hooks?.onOptionalStep,
|
|
1216
1216
|
progressOutput: invocation.progressOutput,
|
|
1217
1217
|
observer: invocation.observer,
|
|
1218
|
-
toolchain: invocation.toolchain
|
|
1218
|
+
toolchain: invocation.toolchain,
|
|
1219
|
+
libraryTools: invocation.libraryTools
|
|
1219
1220
|
}
|
|
1220
1221
|
};
|
|
1221
1222
|
}
|
|
@@ -1362,7 +1363,8 @@ async function runWorkflow(adapterOrFactory, workflowIdOrInvocation, optionsOrRe
|
|
|
1362
1363
|
handoffSchemas: registries?.handoffSchemas,
|
|
1363
1364
|
progressOutput: options.progressOutput,
|
|
1364
1365
|
observer: options.observer,
|
|
1365
|
-
parentSpanId: iterationSpanId ?? sessionSpanId
|
|
1366
|
+
parentSpanId: iterationSpanId ?? sessionSpanId,
|
|
1367
|
+
libraryTools: options.libraryTools
|
|
1366
1368
|
});
|
|
1367
1369
|
return {
|
|
1368
1370
|
step_index: i,
|
|
@@ -1422,11 +1424,9 @@ async function runWorkflow(adapterOrFactory, workflowIdOrInvocation, optionsOrRe
|
|
|
1422
1424
|
handoffSchemas: registries?.handoffSchemas,
|
|
1423
1425
|
retry: step.retry,
|
|
1424
1426
|
progressOutput: options.progressOutput,
|
|
1425
|
-
// ── Phase 1-2: Observer Bridge ────────────────────────────────────────
|
|
1426
|
-
// Thread observer and session span ID so task-runner can emit agent.subagent
|
|
1427
|
-
// spans correlated to this session (parent_run_id → parentSpanId).
|
|
1428
1427
|
observer: options.observer,
|
|
1429
|
-
parentSpanId: sessionSpanId
|
|
1428
|
+
parentSpanId: sessionSpanId,
|
|
1429
|
+
libraryTools: options.libraryTools
|
|
1430
1430
|
});
|
|
1431
1431
|
return {
|
|
1432
1432
|
step_index: i,
|
|
@@ -2756,6 +2756,38 @@ function createLibraryToolRegistry() {
|
|
|
2756
2756
|
}
|
|
2757
2757
|
};
|
|
2758
2758
|
}
|
|
2759
|
+
function createRegistryFromSdkTools(tools) {
|
|
2760
|
+
const handlers = /* @__PURE__ */ new Map();
|
|
2761
|
+
const definitions = /* @__PURE__ */ new Map();
|
|
2762
|
+
for (const tool of tools) {
|
|
2763
|
+
handlers.set(tool.name, tool);
|
|
2764
|
+
definitions.set(tool.name, {
|
|
2765
|
+
toolId: tool.name,
|
|
2766
|
+
description: tool.description,
|
|
2767
|
+
module: "__inline__",
|
|
2768
|
+
exportName: "__handler__",
|
|
2769
|
+
inputSchema: tool.inputSchema
|
|
2770
|
+
});
|
|
2771
|
+
}
|
|
2772
|
+
return {
|
|
2773
|
+
register(def) {
|
|
2774
|
+
definitions.set(def.toolId, def);
|
|
2775
|
+
},
|
|
2776
|
+
get(toolId) {
|
|
2777
|
+
return definitions.get(toolId);
|
|
2778
|
+
},
|
|
2779
|
+
getAll() {
|
|
2780
|
+
return [...definitions.values()];
|
|
2781
|
+
},
|
|
2782
|
+
async execute(toolId, input) {
|
|
2783
|
+
const handler = handlers.get(toolId);
|
|
2784
|
+
if (handler) {
|
|
2785
|
+
return handler.handler(input ?? {});
|
|
2786
|
+
}
|
|
2787
|
+
throw new Error(`Library tool not found: ${toolId}`);
|
|
2788
|
+
}
|
|
2789
|
+
};
|
|
2790
|
+
}
|
|
2759
2791
|
|
|
2760
2792
|
// src/lib/adapter-factory.ts
|
|
2761
2793
|
var ADAPTER_PACKAGES = {
|
|
@@ -2883,6 +2915,11 @@ function injectGuardrailHooks(adapterOptions, execCtx, targetAgentId) {
|
|
|
2883
2915
|
adapterOptions.guardrailHooks = createGuardrailHooksFromRules(rules);
|
|
2884
2916
|
}
|
|
2885
2917
|
}
|
|
2918
|
+
function buildAnalyzerToolRegistry() {
|
|
2919
|
+
const bridge = createAnalyzerBridge({ projectRoot: process.cwd() });
|
|
2920
|
+
const tools = bridge.buildAnalyzerTools();
|
|
2921
|
+
return createRegistryFromSdkTools(tools);
|
|
2922
|
+
}
|
|
2886
2923
|
async function executeTask(taskId, options) {
|
|
2887
2924
|
const execCtx = await resolveExecutionContext(options, { tasks: [taskId] });
|
|
2888
2925
|
const targetAgentId = execCtx.registries.taskRegistry?.[taskId]?.target_agent;
|
|
@@ -2895,6 +2932,7 @@ async function executeTask(taskId, options) {
|
|
|
2895
2932
|
const progressSink = createProgressSink(
|
|
2896
2933
|
options.logFile ? { stderr: true, file: resolve3(options.logFile), naming: "single" } : { stderr: true }
|
|
2897
2934
|
);
|
|
2935
|
+
const analyzerTools = buildAnalyzerToolRegistry();
|
|
2898
2936
|
try {
|
|
2899
2937
|
if (options.hooks?.beforeTask) {
|
|
2900
2938
|
await options.hooks.beforeTask({ adapter, registries: execCtx.registries, taskId });
|
|
@@ -2904,6 +2942,7 @@ async function executeTask(taskId, options) {
|
|
|
2904
2942
|
maxRetries: options.maxRetries ?? 0,
|
|
2905
2943
|
progressOutput: progressSink,
|
|
2906
2944
|
observer: options.observer,
|
|
2945
|
+
libraryTools: analyzerTools,
|
|
2907
2946
|
...execCtx.registries
|
|
2908
2947
|
});
|
|
2909
2948
|
if (options.hooks?.afterTask) {
|
|
@@ -2925,6 +2964,7 @@ async function executeWorkflow(workflowId, options) {
|
|
|
2925
2964
|
const progressSink = createProgressSink(
|
|
2926
2965
|
options.logFile ? { stderr: true, file: resolve3(options.logFile), naming: "single" } : { stderr: true }
|
|
2927
2966
|
);
|
|
2967
|
+
const analyzerTools = buildAnalyzerToolRegistry();
|
|
2928
2968
|
try {
|
|
2929
2969
|
if (options.hooks?.beforeWorkflow) {
|
|
2930
2970
|
await options.hooks.beforeWorkflow({ adapter, registries: execCtx.registries, workflowId });
|
|
@@ -2936,6 +2976,7 @@ async function executeWorkflow(workflowId, options) {
|
|
|
2936
2976
|
progressOutput: progressSink,
|
|
2937
2977
|
observer: options.observer,
|
|
2938
2978
|
toolchain: options.toolchain,
|
|
2979
|
+
libraryTools: analyzerTools,
|
|
2939
2980
|
runtime: {
|
|
2940
2981
|
maxFollowUps: options.maxFollowUps ?? 2,
|
|
2941
2982
|
maxRetries: options.maxRetries ?? 0
|
|
@@ -3661,6 +3702,7 @@ export {
|
|
|
3661
3702
|
createModelResolver,
|
|
3662
3703
|
createProgressSink,
|
|
3663
3704
|
createProjectRuntime,
|
|
3705
|
+
createRegistryFromSdkTools,
|
|
3664
3706
|
createRuntime,
|
|
3665
3707
|
createRuntimeBinding,
|
|
3666
3708
|
deriveToolchainsForAgents,
|