@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.
@@ -43,6 +43,34 @@ declare class InMemoryStore implements MemoryStore {
43
43
  delete(ref: MemoryRef): Promise<void>;
44
44
  }
45
45
 
46
+ /**
47
+ * Library Tool → SDK Function Tool conversion.
48
+ *
49
+ * Converts LibraryToolDefinition entries into SDK-native function tools
50
+ * that each adapter can register with its respective LLM SDK.
51
+ *
52
+ * Each adapter receives tools in its native format:
53
+ * - Claude Agent SDK: MCP tool via createSdkMcpServer + tool()
54
+ * - OpenAI Agents SDK: function tool object
55
+ * - Google ADK: FunctionDeclaration tool
56
+ */
57
+
58
+ /**
59
+ * Adapter-agnostic function tool descriptor. Adapters convert this
60
+ * into their SDK-specific tool format.
61
+ */
62
+ interface SdkFunctionTool {
63
+ name: string;
64
+ description: string;
65
+ inputSchema: Record<string, unknown>;
66
+ handler: (args: Record<string, unknown>) => Promise<string>;
67
+ }
68
+ /**
69
+ * Build adapter-agnostic function tool descriptors from a LibraryToolRegistry.
70
+ * Each tool's handler calls registry.execute() and serialises the result.
71
+ */
72
+ declare function buildSdkFunctionTools(registry: LibraryToolRegistry): SdkFunctionTool[];
73
+
46
74
  interface LibraryToolDefinition {
47
75
  toolId: string;
48
76
  description: string;
@@ -58,6 +86,12 @@ interface LibraryToolRegistry {
58
86
  execute(toolId: string, input: unknown): Promise<unknown>;
59
87
  }
60
88
  declare function createLibraryToolRegistry(): LibraryToolRegistry;
89
+ /**
90
+ * Create a LibraryToolRegistry backed by pre-built SdkFunctionTool handlers.
91
+ * Unlike createLibraryToolRegistry (which resolves tools via dynamic import),
92
+ * this variant delegates execute() directly to the tool's in-process handler.
93
+ */
94
+ declare function createRegistryFromSdkTools(tools: SdkFunctionTool[]): LibraryToolRegistry;
61
95
 
62
96
  /**
63
97
  * SDK Guardrail Hook Bridge — generic adapter from guardrail check functions
@@ -535,6 +569,12 @@ interface WorkflowRunOptions {
535
569
  * artifactsPath/cwd/policy actions).
536
570
  */
537
571
  toolchain?: RunToolchainChecksOptions;
572
+ /**
573
+ * In-process library tools to register with every task in this workflow.
574
+ * Passed through to each runTask() call. Adapters convert these to their
575
+ * native tool format (Claude MCP, OpenAI function tools, ADK tools).
576
+ */
577
+ libraryTools?: LibraryToolRegistry;
538
578
  }
539
579
  /** Typed handoff envelope for workflow input. */
540
580
  interface HandoffInput<TType extends string = string, TPayload = unknown> {
@@ -589,6 +629,11 @@ interface WorkflowInvocation<THandoffType extends string = string, TPayload = un
589
629
  * OBSERVATION ONLY — never changes the workflow outcome.
590
630
  */
591
631
  toolchain?: RunToolchainChecksOptions;
632
+ /**
633
+ * In-process library tools to register with every task in this workflow.
634
+ * Created once per execution and shared across all steps.
635
+ */
636
+ libraryTools?: LibraryToolRegistry;
592
637
  }
593
638
  interface StepResult {
594
639
  step_index: number;
@@ -1105,4 +1150,4 @@ declare function runTask(adapter: SdkAdapter, taskId: string, context: TaskConte
1105
1150
  libraryTools?: LibraryToolRegistry;
1106
1151
  }): Promise<TaskRunResult>;
1107
1152
 
1108
- export { type SdkAdapterFactory as $, type AdapterSendOptions as A, type BoundResolveOptions as B, type CacheConfig as C, type DelegateStep as D, type EnvelopeParams as E, type GuardrailRule as F, type GuardrailHooks as G, type HandoffInput as H, type HookContext as I, InMemoryStore as J, type InnerSpanOptions as K, type LibraryToolRegistry as L, type MemoryRef as M, type ModelAwareSdkAdapterFactory as N, type ObserverEmitFn as O, type PromptBuilderOptions as P, type ModelClass as Q, type ResolvedComponent as R, type SdkAdapter as S, type TokenUsage as T, type ModelMappingConfig as U, type ModelResolver as V, type WorkflowResult as W, type ModelResolverOptions as X, type ReceiveSpec as Y, type ResolvedModel as Z, type RetryDecision as _, type AgentExecutionRequest as a, type SplitPrompt as a0, type TaskRunOptions as a1, type ToolchainCheckResult as a2, type ToolchainManifest as a3, ToolchainManifestSchema as a4, type WorkflowContractLike as a5, type WorkflowInvocation as a6, type WorkflowRunOptions as a7, type WorkflowStep as a8, buildCandidateAgents as a9, getBlockingViolations as aA, getEffectiveGuardrailIds as aB, getGuardrailRulesForAgent as aC, getWarnings as aD, guardrailContextToRuleData as aE, hasBlockingViolation as aF, parseGateEvaluationResponse as aG, renderAgentSystemPrompt as aH, runTask as aI, runToolchainChecks as aJ, runWorkflow as aK, zodSchemaToPromptDescription as aL, zodSchemaToYamlExample as aM, buildGateEvaluationPrompt as aa, buildPerAgentGuardrails as ab, buildRetryFollowUp as ac, buildSplitTaskPrompt as ad, buildTaskPrompt as ae, createExecutionEnvelope as af, createGuardrailHooks as ag, createGuardrailHooksForAgent as ah, createGuardrailHooksFromRules as ai, createLibraryToolRegistry as aj, createModelResolver as ak, deriveToolchainsForAgents as al, emitIterationClose as am, emitIterationMetric as an, emitIterationOpen as ao, emitLlmTurnClose as ap, emitLlmTurnOpen as aq, emitSessionClose as ar, emitSessionOpen as as, emitSubagentClose as at, emitSubagentOpen as au, emitToolExecClose as av, emitToolExecOpen as aw, emitToolchainClose as ax, emitToolchainOpen as ay, extractStructuredResult as az, type TaskContext as b, type TaskOutcome as c, type AgentContractLike as d, type TaskContractLike as e, type WorkflowRegistries as f, type StepCompleteEvent as g, type StepResult as h, type GuardrailRuleData as i, type MemoryStore as j, type ArtifactBindingConfig as k, type RunToolchainChecksOptions as l, type TaskRunResult as m, type ResolvedToolchain as n, type LibraryToolDefinition as o, type HookResponse as p, type GuardrailCheckResult as q, type AdapterOrFactory as r, type AgentProgressEvent as s, BoundResolver as t, type CandidateAgent as u, type ConvergenceEnvelope as v, type ConvergenceEnvelopePayload as w, type EvaluateStep as x, type GateStep as y, type GuardrailCheckFunctions as z };
1153
+ export { type RetryDecision as $, type AdapterSendOptions as A, type BoundResolveOptions as B, type CacheConfig as C, type DelegateStep as D, type EnvelopeParams as E, type GuardrailCheckFunctions as F, type GuardrailHooks as G, type HandoffInput as H, type GuardrailRule as I, type HookContext as J, InMemoryStore as K, type LibraryToolRegistry as L, type MemoryRef as M, type InnerSpanOptions as N, type ObserverEmitFn as O, type PromptBuilderOptions as P, type ModelAwareSdkAdapterFactory as Q, type ResolvedComponent as R, type SdkAdapter as S, type TokenUsage as T, type ModelClass as U, type ModelMappingConfig as V, type WorkflowResult as W, type ModelResolver as X, type ModelResolverOptions as Y, type ReceiveSpec as Z, type ResolvedModel as _, type AgentExecutionRequest as a, type SdkAdapterFactory as a0, type SplitPrompt as a1, type TaskRunOptions as a2, type ToolchainCheckResult as a3, type ToolchainManifest as a4, ToolchainManifestSchema as a5, type WorkflowContractLike as a6, type WorkflowInvocation as a7, type WorkflowRunOptions as a8, type WorkflowStep as a9, emitToolchainClose as aA, emitToolchainOpen as aB, extractStructuredResult as aC, getBlockingViolations as aD, getEffectiveGuardrailIds as aE, getGuardrailRulesForAgent as aF, getWarnings as aG, guardrailContextToRuleData as aH, hasBlockingViolation as aI, parseGateEvaluationResponse as aJ, renderAgentSystemPrompt as aK, runTask as aL, runToolchainChecks as aM, runWorkflow as aN, zodSchemaToPromptDescription as aO, zodSchemaToYamlExample as aP, buildCandidateAgents as aa, buildGateEvaluationPrompt as ab, buildPerAgentGuardrails as ac, buildRetryFollowUp as ad, buildSdkFunctionTools as ae, buildSplitTaskPrompt as af, buildTaskPrompt as ag, createExecutionEnvelope as ah, createGuardrailHooks as ai, createGuardrailHooksForAgent as aj, createGuardrailHooksFromRules as ak, createLibraryToolRegistry as al, createModelResolver as am, createRegistryFromSdkTools as an, deriveToolchainsForAgents as ao, emitIterationClose as ap, emitIterationMetric as aq, emitIterationOpen as ar, emitLlmTurnClose as as, emitLlmTurnOpen as at, emitSessionClose as au, emitSessionOpen as av, emitSubagentClose as aw, emitSubagentOpen as ax, emitToolExecClose as ay, emitToolExecOpen as az, type TaskContext as b, type TaskOutcome as c, type AgentContractLike as d, type TaskContractLike as e, type WorkflowRegistries as f, type StepCompleteEvent as g, type StepResult as h, type GuardrailRuleData as i, type MemoryStore as j, type SdkFunctionTool as k, type ArtifactBindingConfig as l, type RunToolchainChecksOptions as m, type TaskRunResult as n, type ResolvedToolchain as o, type LibraryToolDefinition as p, type HookResponse as q, type GuardrailCheckResult as r, type AdapterOrFactory as s, type AgentProgressEvent as t, BoundResolver as u, type CandidateAgent as v, type ConvergenceEnvelope as w, type ConvergenceEnvelopePayload as x, type EvaluateStep as y, type GateStep as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aaac/runtime",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "Runtime SDK for the AaaC toolchain",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",