@aaac/runtime 0.1.4 → 0.1.6

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.
@@ -0,0 +1,7 @@
1
+ import {
2
+ jsonSchemaToZod
3
+ } from "./chunk-ET6TGQRT.js";
4
+ export {
5
+ jsonSchemaToZod
6
+ };
7
+ //# sourceMappingURL=schema-converter-LACA7P4O.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -42,6 +42,22 @@ declare class InMemoryStore implements MemoryStore {
42
42
  delete(ref: MemoryRef): Promise<void>;
43
43
  }
44
44
 
45
+ interface LibraryToolDefinition {
46
+ toolId: string;
47
+ description: string;
48
+ module: string;
49
+ exportName: string;
50
+ inputSchema?: Record<string, unknown>;
51
+ outputSchema?: Record<string, unknown>;
52
+ }
53
+ interface LibraryToolRegistry {
54
+ register(def: LibraryToolDefinition): void;
55
+ get(toolId: string): LibraryToolDefinition | undefined;
56
+ getAll(): LibraryToolDefinition[];
57
+ execute(toolId: string, input: unknown): Promise<unknown>;
58
+ }
59
+ declare function createLibraryToolRegistry(): LibraryToolRegistry;
60
+
45
61
  /**
46
62
  * Candidate Agents — backend-neutral bridge for LLM-internal routing (model B)
47
63
  *
@@ -108,6 +124,7 @@ declare function buildCandidateAgents(agentRegistry: Record<string, AgentContrac
108
124
  * - Generate ExecutionEnvelope (run_id = UUIDv7) for every task/workflow execution
109
125
  * - Emit agent.session (open/close) for runWorkflow() — root run span
110
126
  * - Emit agent.subagent (open/close) for runTask() — handoff/task span
127
+ * - Emit toolchain.execution (open/close) for toolchain tool invocations
111
128
  * - Observer is OPTIONAL — all emit* functions are no-ops when observer is undefined
112
129
  *
113
130
  * No circular dependency: @aaac/observability does NOT import @aaac/runtime.
@@ -181,6 +198,17 @@ declare function emitSubagentOpen(observer: ObserverEmitFn | undefined, envelope
181
198
  * event-catalog.md §2.2 — optional: agent.duration_ms, agent.status, token_usage, cost_usd
182
199
  */
183
200
  declare function emitSubagentClose(observer: ObserverEmitFn | undefined, spanId: string, envelope: ExecutionEnvelope, durationMs: number, status: string, agentRole: string): void;
201
+ /**
202
+ * Emit a toolchain.execution open span when a toolchain tool is invoked.
203
+ *
204
+ * Returns the spanId emitted (= generated UUIDv7).
205
+ * Returns undefined when observer is undefined (no-op).
206
+ */
207
+ declare function emitToolchainOpen(observer: ObserverEmitFn | undefined, parentSpanId: string | undefined, toolchainId: string, operation: string, artifactIds: string[], componentId?: string): string | undefined;
208
+ /**
209
+ * Emit a toolchain.execution close span.
210
+ */
211
+ declare function emitToolchainClose(observer: ObserverEmitFn | undefined, spanId: string, toolchainId: string, operation: string, durationMs: number, status: "success" | "failure", errorMessage?: string): void;
184
212
 
185
213
  /**
186
214
  * Task Runner — runs a single DSL task via an SDK agent
@@ -309,6 +337,12 @@ interface AdapterSendOptions {
309
337
  * The task's final output is still validated against the handoff schema.
310
338
  */
311
339
  allowDynamicWorkflow?: boolean;
340
+ /**
341
+ * In-process library tools to register with the SDK as function tools.
342
+ * Adapters convert these to their native tool format (Claude MCP, OpenAI
343
+ * function tools, ADK tools). I/O is validated against the tool's schemas.
344
+ */
345
+ libraryTools?: LibraryToolRegistry;
312
346
  }
313
347
  /**
314
348
  * Rich execution request for adapters that need more than a prompt string.
@@ -487,6 +521,7 @@ declare function runTask(adapter: SdkAdapter, taskId: string, context: TaskConte
487
521
  fix_task: string;
488
522
  revalidate_task?: string;
489
523
  };
524
+ libraryTools?: LibraryToolRegistry;
490
525
  }): Promise<TaskRunResult>;
491
526
 
492
- export { type AdapterSendOptions as A, type CacheConfig as C, type EnvelopeParams as E, InMemoryStore as I, type MemoryRef as M, type ObserverEmitFn as O, type PromptBuilderOptions as P, type RetryDecision as R, type SdkAdapter as S, type TaskOutcome as T, type AgentExecutionRequest as a, type TaskContractLike as b, type AgentContractLike as c, type TaskContext as d, type MemoryStore as e, type TaskRunResult as f, type AgentProgressEvent as g, type CandidateAgent as h, type SplitPrompt as i, type TaskRunOptions as j, buildCandidateAgents as k, buildRetryFollowUp as l, buildSplitTaskPrompt as m, buildTaskPrompt as n, createExecutionEnvelope as o, emitSessionClose as p, emitSessionOpen as q, emitSubagentClose as r, emitSubagentOpen as s, extractStructuredResult as t, renderAgentSystemPrompt as u, runTask as v, zodSchemaToYamlExample as w, zodSchemaToPromptDescription as z };
527
+ export { type AdapterSendOptions as A, zodSchemaToPromptDescription as B, type CacheConfig as C, zodSchemaToYamlExample as D, type EnvelopeParams as E, InMemoryStore as I, type LibraryToolRegistry as L, type MemoryRef as M, type ObserverEmitFn as O, type PromptBuilderOptions as P, type RetryDecision as R, type SdkAdapter as S, type TaskOutcome as T, type AgentExecutionRequest as a, type TaskContractLike as b, type AgentContractLike as c, type TaskContext as d, type MemoryStore as e, type TaskRunResult as f, type LibraryToolDefinition as g, type AgentProgressEvent as h, type CandidateAgent as i, type SplitPrompt as j, type TaskRunOptions as k, buildCandidateAgents as l, buildRetryFollowUp as m, buildSplitTaskPrompt as n, buildTaskPrompt as o, createExecutionEnvelope as p, createLibraryToolRegistry as q, emitSessionClose as r, emitSessionOpen as s, emitSubagentClose as t, emitSubagentOpen as u, emitToolchainClose as v, emitToolchainOpen as w, extractStructuredResult as x, renderAgentSystemPrompt as y, runTask as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aaac/runtime",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Runtime SDK for the AAAC toolchain",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -56,6 +56,7 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "@aaac/contracts": "*",
59
+ "@aaac/toolchain": "*",
59
60
  "@aaac/observability": "*",
60
61
  "agent-contracts": "^0.35.0",
61
62
  "commander": "^12.1.0",