@aaac/runtime 0.1.20 → 0.1.22

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.
@@ -285,6 +285,38 @@ declare function emitIterationClose(observer: ObserverEmitFn | undefined, spanId
285
285
  * Emit an evaluate.metric instant event when an evaluate step terminates.
286
286
  */
287
287
  declare function emitIterationMetric(observer: ObserverEmitFn | undefined, parentSpanId: string | undefined, evaluateTaskId: string, totalIterations: number, terminalOutcome: string): void;
288
+ /** Options forwarded from task-runner to adapters for inner turn-level spans. */
289
+ interface InnerSpanOptions {
290
+ observer?: ObserverEmitFn;
291
+ parentSpanId?: string;
292
+ }
293
+ /**
294
+ * Emit an agent.llm_turn open span when a new LLM turn begins.
295
+ *
296
+ * Returns the spanId emitted (= generated UUIDv7).
297
+ * Returns undefined when observer is undefined (no-op).
298
+ */
299
+ declare function emitLlmTurnOpen(observer: ObserverEmitFn | undefined, parentSpanId: string | undefined, turnNumber: number, model?: string): string | undefined;
300
+ /**
301
+ * Emit an agent.llm_turn close span.
302
+ */
303
+ declare function emitLlmTurnClose(observer: ObserverEmitFn | undefined, spanId: string, turnNumber: number, durationMs: number, tokenAttrs?: {
304
+ inputTokens?: number;
305
+ outputTokens?: number;
306
+ cacheHitTokens?: number;
307
+ toolCallsCount?: number;
308
+ }): void;
309
+ /**
310
+ * Emit an agent.tool_exec open span when a tool execution begins.
311
+ *
312
+ * Returns the spanId emitted (= generated UUIDv7).
313
+ * Returns undefined when observer is undefined (no-op).
314
+ */
315
+ declare function emitToolExecOpen(observer: ObserverEmitFn | undefined, parentSpanId: string | undefined, toolName: string, inputSummary: string, turnNumber: number): string | undefined;
316
+ /**
317
+ * Emit an agent.tool_exec close span.
318
+ */
319
+ declare function emitToolExecClose(observer: ObserverEmitFn | undefined, spanId: string, toolName: string, durationMs: number): void;
288
320
  /**
289
321
  * Emit a toolchain.execution open span when a toolchain tool is invoked.
290
322
  *
@@ -867,6 +899,17 @@ interface AdapterSendOptions {
867
899
  * function tools, ADK tools). I/O is validated against the tool's schemas.
868
900
  */
869
901
  libraryTools?: LibraryToolRegistry;
902
+ /**
903
+ * Optional observer emit function for inner turn-level spans
904
+ * (agent.llm_turn, agent.tool_exec). When undefined, adapters skip
905
+ * instrumentation entirely (no-op).
906
+ */
907
+ observer?: ObserverEmitFn;
908
+ /**
909
+ * Parent span ID for inner turn-level spans. Typically the subagent span ID
910
+ * so that LLM turn and tool execution spans are correlated as children.
911
+ */
912
+ parentSpanId?: string;
870
913
  }
871
914
  /**
872
915
  * Rich execution request for adapters that need more than a prompt string.
@@ -1048,4 +1091,4 @@ declare function runTask(adapter: SdkAdapter, taskId: string, context: TaskConte
1048
1091
  libraryTools?: LibraryToolRegistry;
1049
1092
  }): Promise<TaskRunResult>;
1050
1093
 
1051
- export { type TaskRunOptions as $, type AdapterSendOptions as A, type BoundResolveOptions as B, type CacheConfig as C, type DelegateStep as D, type EnvelopeParams as E, type HookContext as F, type GuardrailHooks as G, type HandoffInput as H, InMemoryStore as I, type ModelAwareSdkAdapterFactory as J, type ModelClass as K, type LibraryToolRegistry as L, type MemoryRef as M, type ModelMappingConfig as N, type ObserverEmitFn as O, type PromptBuilderOptions as P, type ModelResolver as Q, type ResolvedComponent as R, type SdkAdapter as S, type TaskContext as T, type ModelResolverOptions as U, type ReceiveSpec as V, type WorkflowResult as W, type ResolvedModel as X, type RetryDecision as Y, type SdkAdapterFactory as Z, type SplitPrompt as _, type AgentExecutionRequest as a, type ToolchainCheckResult as a0, type ToolchainManifest as a1, ToolchainManifestSchema as a2, type WorkflowContractLike as a3, type WorkflowInvocation as a4, type WorkflowRunOptions as a5, type WorkflowStep as a6, buildCandidateAgents as a7, buildGateEvaluationPrompt as a8, buildPerAgentGuardrails as a9, parseGateEvaluationResponse as aA, renderAgentSystemPrompt as aB, runTask as aC, runToolchainChecks as aD, runWorkflow as aE, zodSchemaToPromptDescription as aF, zodSchemaToYamlExample as aG, buildRetryFollowUp as aa, buildSplitTaskPrompt as ab, buildTaskPrompt as ac, createExecutionEnvelope as ad, createGuardrailHooks as ae, createGuardrailHooksForAgent as af, createGuardrailHooksFromRules as ag, createLibraryToolRegistry as ah, createModelResolver as ai, deriveToolchainsForAgents as aj, emitIterationClose as ak, emitIterationMetric as al, emitIterationOpen as am, emitSessionClose as an, emitSessionOpen as ao, emitSubagentClose as ap, emitSubagentOpen as aq, emitToolchainClose as ar, emitToolchainOpen as as, extractStructuredResult as at, getBlockingViolations as au, getEffectiveGuardrailIds as av, getGuardrailRulesForAgent as aw, getWarnings as ax, guardrailContextToRuleData as ay, hasBlockingViolation as az, type TaskOutcome as b, type AgentContractLike as c, type TaskContractLike as d, type WorkflowRegistries as e, type StepCompleteEvent as f, type StepResult as g, type GuardrailRuleData as h, type MemoryStore as i, type ArtifactBindingConfig as j, type RunToolchainChecksOptions as k, type TaskRunResult as l, type ResolvedToolchain as m, type LibraryToolDefinition as n, type HookResponse as o, type GuardrailCheckResult as p, type AdapterOrFactory as q, type AgentProgressEvent as r, BoundResolver as s, type CandidateAgent as t, type ConvergenceEnvelope as u, type ConvergenceEnvelopePayload as v, type EvaluateStep as w, type GateStep as x, type GuardrailCheckFunctions as y, type GuardrailRule as z };
1094
+ export { type SplitPrompt as $, type AdapterSendOptions as A, type BoundResolveOptions as B, type CacheConfig as C, type DelegateStep as D, type EnvelopeParams as E, type HookContext as F, type GuardrailHooks as G, type HandoffInput as H, InMemoryStore as I, type InnerSpanOptions as J, type ModelAwareSdkAdapterFactory as K, type LibraryToolRegistry as L, type MemoryRef as M, type ModelClass as N, type ObserverEmitFn as O, type PromptBuilderOptions as P, type ModelMappingConfig as Q, type ResolvedComponent as R, type SdkAdapter as S, type TaskContext as T, type ModelResolver as U, type ModelResolverOptions as V, type WorkflowResult as W, type ReceiveSpec as X, type ResolvedModel as Y, type RetryDecision as Z, type SdkAdapterFactory as _, type AgentExecutionRequest as a, type TaskRunOptions as a0, type ToolchainCheckResult as a1, type ToolchainManifest as a2, ToolchainManifestSchema as a3, type WorkflowContractLike as a4, type WorkflowInvocation as a5, type WorkflowRunOptions as a6, type WorkflowStep as a7, buildCandidateAgents as a8, buildGateEvaluationPrompt as a9, getEffectiveGuardrailIds as aA, getGuardrailRulesForAgent as aB, getWarnings as aC, guardrailContextToRuleData as aD, hasBlockingViolation as aE, parseGateEvaluationResponse as aF, renderAgentSystemPrompt as aG, runTask as aH, runToolchainChecks as aI, runWorkflow as aJ, zodSchemaToPromptDescription as aK, zodSchemaToYamlExample as aL, buildPerAgentGuardrails as aa, buildRetryFollowUp as ab, buildSplitTaskPrompt as ac, buildTaskPrompt as ad, createExecutionEnvelope as ae, createGuardrailHooks as af, createGuardrailHooksForAgent as ag, createGuardrailHooksFromRules as ah, createLibraryToolRegistry as ai, createModelResolver as aj, deriveToolchainsForAgents as ak, emitIterationClose as al, emitIterationMetric as am, emitIterationOpen as an, emitLlmTurnClose as ao, emitLlmTurnOpen as ap, emitSessionClose as aq, emitSessionOpen as ar, emitSubagentClose as as, emitSubagentOpen as at, emitToolExecClose as au, emitToolExecOpen as av, emitToolchainClose as aw, emitToolchainOpen as ax, extractStructuredResult as ay, getBlockingViolations as az, type TaskOutcome as b, type AgentContractLike as c, type TaskContractLike as d, type WorkflowRegistries as e, type StepCompleteEvent as f, type StepResult as g, type GuardrailRuleData as h, type MemoryStore as i, type ArtifactBindingConfig as j, type RunToolchainChecksOptions as k, type TaskRunResult as l, type ResolvedToolchain as m, type LibraryToolDefinition as n, type HookResponse as o, type GuardrailCheckResult as p, type AdapterOrFactory as q, type AgentProgressEvent as r, BoundResolver as s, type CandidateAgent as t, type ConvergenceEnvelope as u, type ConvergenceEnvelopePayload as v, type EvaluateStep as w, type GateStep as x, type GuardrailCheckFunctions as y, type GuardrailRule as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aaac/runtime",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "description": "Runtime SDK for the AaaC toolchain",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",