@townco/agent 0.1.112 → 0.1.114
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/acp-server/adapter.js +63 -43
- package/dist/acp-server/http.js +21 -0
- package/dist/runner/langchain/index.js +139 -114
- package/dist/runner/langchain/tools/subagent-connections.d.ts +7 -22
- package/dist/runner/langchain/tools/subagent-connections.js +26 -50
- package/dist/runner/langchain/tools/subagent.js +137 -378
- package/dist/runner/session-context.d.ts +18 -0
- package/dist/runner/session-context.js +35 -0
- package/dist/telemetry/setup.js +21 -5
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/dist/runner/langchain/tools/artifacts.d.ts +0 -68
- package/dist/runner/langchain/tools/artifacts.js +0 -474
- package/dist/runner/langchain/tools/conversation_search.d.ts +0 -22
- package/dist/runner/langchain/tools/conversation_search.js +0 -137
- package/dist/runner/langchain/tools/generate_image.d.ts +0 -47
- package/dist/runner/langchain/tools/generate_image.js +0 -175
- package/dist/runner/langchain/tools/port-utils.d.ts +0 -8
- package/dist/runner/langchain/tools/port-utils.js +0 -35
package/dist/telemetry/setup.js
CHANGED
|
@@ -12,7 +12,9 @@ import { BatchLogRecordProcessor, LoggerProvider, } from "@opentelemetry/sdk-log
|
|
|
12
12
|
import { BatchSpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
13
13
|
import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
|
|
14
14
|
import { ATTR_SERVICE_NAME } from "@opentelemetry/semantic-conventions";
|
|
15
|
+
import { createLogger } from "../logger.js";
|
|
15
16
|
import { configureTelemetry } from "./index.js";
|
|
17
|
+
const logger = createLogger("telemetry");
|
|
16
18
|
/**
|
|
17
19
|
* Initialize OpenTelemetry with OTLP exporter
|
|
18
20
|
* Call this early in your application startup
|
|
@@ -32,10 +34,15 @@ export function initializeOpenTelemetry(options = {}) {
|
|
|
32
34
|
console.log(`OTLP base endpoint: ${otlpEndpoint}`);
|
|
33
35
|
console.log(`OTLP trace URL: ${traceUrl}`);
|
|
34
36
|
// Quick connectivity test
|
|
35
|
-
|
|
37
|
+
const healthUrl = `${otlpEndpoint.replace(/\/$/, "")}/health`;
|
|
38
|
+
fetch(healthUrl)
|
|
36
39
|
.then((r) => r.json())
|
|
37
|
-
.then((d) =>
|
|
38
|
-
.catch((e) =>
|
|
40
|
+
.then((d) => logger.info("OTLP server reachable", { url: healthUrl, response: d }))
|
|
41
|
+
.catch((e) => logger.error("OTLP server not reachable", {
|
|
42
|
+
url: healthUrl,
|
|
43
|
+
error: e.message,
|
|
44
|
+
code: e.code,
|
|
45
|
+
}));
|
|
39
46
|
}
|
|
40
47
|
const provider = new NodeTracerProvider({
|
|
41
48
|
resource: new Resource({
|
|
@@ -76,7 +83,11 @@ export function initializeOpenTelemetry(options = {}) {
|
|
|
76
83
|
// Don't log timeout errors at all - they're false positives
|
|
77
84
|
}
|
|
78
85
|
else {
|
|
79
|
-
|
|
86
|
+
logger.error("Failed to export spans", {
|
|
87
|
+
url: traceUrl,
|
|
88
|
+
error: result.error?.message ?? String(result.error),
|
|
89
|
+
code: result.error?.code,
|
|
90
|
+
});
|
|
80
91
|
}
|
|
81
92
|
}
|
|
82
93
|
resultCallback(result);
|
|
@@ -147,7 +158,12 @@ export function initializeOpenTelemetry(options = {}) {
|
|
|
147
158
|
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
148
159
|
if (!errorMsg.includes("timed out") &&
|
|
149
160
|
!errorMsg.includes("Request timed out")) {
|
|
150
|
-
|
|
161
|
+
logger.error("Error flushing telemetry", {
|
|
162
|
+
traceUrl,
|
|
163
|
+
logUrl,
|
|
164
|
+
error: errorMsg,
|
|
165
|
+
code: error?.code,
|
|
166
|
+
});
|
|
151
167
|
}
|
|
152
168
|
}
|
|
153
169
|
};
|