@botbotgo/agent-harness 0.0.145 → 0.0.146

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.
@@ -90,12 +90,19 @@ export type RuntimeSnapshotSkill = {
90
90
  path: string;
91
91
  description?: string;
92
92
  };
93
+ export type RuntimeSnapshotTracing = {
94
+ enabled: boolean;
95
+ correlationId: string;
96
+ tags?: string[];
97
+ metadata?: Record<string, unknown>;
98
+ };
93
99
  export type RuntimeSnapshot = {
94
100
  agentId: string;
95
101
  model?: RuntimeSnapshotModel;
96
102
  tools: RuntimeSnapshotTool[];
97
103
  skills: RuntimeSnapshotSkill[];
98
104
  memory: string[];
105
+ tracing?: RuntimeSnapshotTracing;
99
106
  };
100
107
  export type MemoryCandidate = {
101
108
  content: string;
@@ -1 +1 @@
1
- export declare const AGENT_HARNESS_VERSION = "0.0.144";
1
+ export declare const AGENT_HARNESS_VERSION = "0.0.145";
@@ -1 +1 @@
1
- export const AGENT_HARNESS_VERSION = "0.0.144";
1
+ export const AGENT_HARNESS_VERSION = "0.0.145";
@@ -1,5 +1,7 @@
1
1
  import type { CompiledAgentBinding, RuntimeSnapshot } from "../../../contracts/types.js";
2
- export declare function buildRunRuntimeSnapshot(binding: CompiledAgentBinding): RuntimeSnapshot;
2
+ export declare function buildRunRuntimeSnapshot(binding: CompiledAgentBinding, options?: {
3
+ runId?: string;
4
+ }): RuntimeSnapshot;
3
5
  export declare function consumeRunInspectionUpstreamEvent(input: {
4
6
  event: unknown;
5
7
  currentAgentId: string;
@@ -6,8 +6,38 @@ function asObject(value) {
6
6
  function readStringArray(value) {
7
7
  return Array.isArray(value) ? value.filter((item) => typeof item === "string" && item.trim().length > 0) : [];
8
8
  }
9
- export function buildRunRuntimeSnapshot(binding) {
9
+ function readTracingConfig(binding) {
10
+ const deepAgentTracing = asObject(binding.harnessRuntime?.deepagent?.passthrough)?.tracing;
11
+ const langchainTracing = asObject(binding.harnessRuntime?.langchain?.passthrough)?.tracing;
12
+ const legacyDeepAgentTracing = asObject(binding.deepAgentParams?.passthrough)?.tracing;
13
+ const legacyLangChainTracing = asObject(binding.langchainAgentParams?.passthrough)?.tracing;
14
+ return (asObject(langchainTracing) ??
15
+ asObject(deepAgentTracing) ??
16
+ asObject(legacyLangChainTracing) ??
17
+ asObject(legacyDeepAgentTracing) ??
18
+ null);
19
+ }
20
+ function buildRuntimeSnapshotTracing(binding, runId) {
21
+ const tracing = readTracingConfig(binding);
22
+ if (!tracing) {
23
+ return undefined;
24
+ }
25
+ const enabled = tracing.enabled !== false;
26
+ if (!enabled || !runId) {
27
+ return undefined;
28
+ }
29
+ const tags = readStringArray(tracing.tags);
30
+ const metadata = asObject(tracing.metadata);
31
+ return {
32
+ enabled: true,
33
+ correlationId: runId,
34
+ ...(tags.length > 0 ? { tags } : {}),
35
+ ...(metadata && Object.keys(metadata).length > 0 ? { metadata: { ...metadata } } : {}),
36
+ };
37
+ }
38
+ export function buildRunRuntimeSnapshot(binding, options) {
10
39
  const model = getBindingPrimaryModel(binding);
40
+ const tracing = buildRuntimeSnapshotTracing(binding, options?.runId);
11
41
  const init = typeof model?.init === "object" && model.init ? model.init : {};
12
42
  const baseUrl = typeof init.baseUrl === "string" && init.baseUrl.trim().length > 0
13
43
  ? init.baseUrl.trim()
@@ -37,6 +67,7 @@ export function buildRunRuntimeSnapshot(binding) {
37
67
  };
38
68
  }),
39
69
  memory: getBindingMemorySources(binding),
70
+ ...(tracing ? { tracing } : {}),
40
71
  };
41
72
  }
42
73
  function maybeAppendAgent(chain, agentId) {
@@ -14,7 +14,7 @@ export async function ensureThreadStarted(runtime, input) {
14
14
  const startedAt = createdAt;
15
15
  const currentAgentId = selectedAgentId;
16
16
  const delegationChain = [selectedAgentId];
17
- const runtimeSnapshot = buildRunRuntimeSnapshot(binding);
17
+ const runtimeSnapshot = buildRunRuntimeSnapshot(binding, { runId });
18
18
  const userMessage = {
19
19
  role: "user",
20
20
  content: normalizeMessageContent(message),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbotgo/agent-harness",
3
- "version": "0.0.145",
3
+ "version": "0.0.146",
4
4
  "description": "Workspace runtime for multi-agent applications",
5
5
  "type": "module",
6
6
  "packageManager": "npm@10.9.2",