@townco/agent 0.1.73 → 0.1.75
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 +44 -5
- package/dist/acp-server/http.js +29 -13
- package/dist/runner/agent-runner.d.ts +11 -1
- package/dist/runner/hooks/predefined/tool-response-compactor.js +73 -19
- package/dist/runner/langchain/index.js +80 -31
- package/dist/runner/langchain/model-factory.js +6 -9
- package/dist/runner/langchain/otel-callbacks.d.ts +7 -1
- package/dist/runner/langchain/otel-callbacks.js +80 -20
- package/dist/runner/langchain/tools/filesystem.js +15 -0
- package/dist/runner/langchain/tools/subagent.js +89 -79
- package/dist/runner/langchain/tools/todo.js +4 -0
- package/dist/runner/langchain/tools/web_search.d.ts +24 -0
- package/dist/runner/langchain/tools/web_search.js +42 -11
- package/dist/runner/tool-loader.d.ts +10 -0
- package/dist/runner/tool-loader.js +1 -0
- package/dist/runner/tools.d.ts +2 -2
- package/dist/runner/tools.js +1 -0
- package/dist/telemetry/index.d.ts +5 -0
- package/dist/telemetry/index.js +8 -0
- package/dist/telemetry/setup.js +10 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/tool.d.ts +5 -0
- package/dist/utils/tool.js +1 -0
- package/package.json +6 -6
package/dist/telemetry/index.js
CHANGED
|
@@ -40,6 +40,14 @@ class AgentTelemetry {
|
|
|
40
40
|
...attributes,
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Remove a base attribute
|
|
45
|
+
* @param key - Attribute key to remove
|
|
46
|
+
*/
|
|
47
|
+
clearBaseAttribute(key) {
|
|
48
|
+
const { [key]: _, ...rest } = this.baseAttributes;
|
|
49
|
+
this.baseAttributes = rest;
|
|
50
|
+
}
|
|
43
51
|
/**
|
|
44
52
|
* Start a new span
|
|
45
53
|
* @param name - Span name
|
package/dist/telemetry/setup.js
CHANGED
|
@@ -68,10 +68,12 @@ export function initializeOpenTelemetry(options = {}) {
|
|
|
68
68
|
// false "Request timed out" errors. The export usually succeeds anyway.
|
|
69
69
|
// Only log non-timeout errors as actual errors.
|
|
70
70
|
const errorMsg = result.error?.message ?? "";
|
|
71
|
-
if (errorMsg.includes("timed out")
|
|
71
|
+
if (errorMsg.includes("timed out") ||
|
|
72
|
+
errorMsg.includes("Request timed out")) {
|
|
72
73
|
if (debug) {
|
|
73
|
-
console.log(`⚠️ Export reported timeout (Bun http bug - data
|
|
74
|
+
console.log(`⚠️ Export reported timeout (Bun http bug - data successfully sent)`);
|
|
74
75
|
}
|
|
76
|
+
// Don't log timeout errors at all - they're false positives
|
|
75
77
|
}
|
|
76
78
|
else {
|
|
77
79
|
console.error(`❌ Failed to export spans:`, result.error);
|
|
@@ -141,7 +143,12 @@ export function initializeOpenTelemetry(options = {}) {
|
|
|
141
143
|
}
|
|
142
144
|
}
|
|
143
145
|
catch (error) {
|
|
144
|
-
|
|
146
|
+
// Filter out Bun HTTP timeout errors - they're false positives
|
|
147
|
+
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
148
|
+
if (!errorMsg.includes("timed out") &&
|
|
149
|
+
!errorMsg.includes("Request timed out")) {
|
|
150
|
+
console.error("Error flushing telemetry:", error);
|
|
151
|
+
}
|
|
145
152
|
}
|
|
146
153
|
};
|
|
147
154
|
return { provider, loggerProvider, shutdown };
|