@townco/agent 0.1.48 → 0.1.50

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/index.ts CHANGED
@@ -2,8 +2,23 @@ import { basename } from "node:path";
2
2
  import { createLogger } from "@townco/core";
3
3
  import { makeHttpTransport, makeStdioTransport } from "./acp-server";
4
4
  import type { AgentDefinition } from "./definition";
5
+ import { initializeOpenTelemetryFromEnv } from "./telemetry/setup.js";
5
6
  import { makeSubagentsTool } from "./utils";
6
7
 
8
+ // Re-export telemetry configuration for library users
9
+ export { configureTelemetry, type TelemetryConfig } from "./telemetry/index.js";
10
+ export {
11
+ initializeOpenTelemetry,
12
+ initializeOpenTelemetryFromEnv,
13
+ type TelemetrySetupOptions,
14
+ } from "./telemetry/setup.js";
15
+
16
+ // Configure OpenTelemetry if enabled via environment variable
17
+ // Example: ENABLE_TELEMETRY=true bun run index.ts stdio
18
+ if (process.env.ENABLE_TELEMETRY === "true") {
19
+ initializeOpenTelemetryFromEnv();
20
+ }
21
+
7
22
  const logger = createLogger("agent-index");
8
23
 
9
24
  const exampleAgent: AgentDefinition = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@townco/agent",
3
- "version": "0.1.48",
3
+ "version": "0.1.50",
4
4
  "type": "module",
5
5
  "module": "index.ts",
6
6
  "files": [
@@ -35,6 +35,10 @@
35
35
  "import": "./dist/storage/index.js",
36
36
  "types": "./dist/storage/index.d.ts"
37
37
  },
38
+ "./telemetry": {
39
+ "import": "./dist/telemetry/index.js",
40
+ "types": "./dist/telemetry/index.d.ts"
41
+ },
38
42
  "./utils": {
39
43
  "import": "./dist/utils/index.js",
40
44
  "types": "./dist/utils/index.d.ts"
@@ -44,7 +48,8 @@
44
48
  "build": "tsc && cp -r scaffold/templates dist/scaffold/",
45
49
  "check": "tsc --noEmit",
46
50
  "start": "bun index.ts stdio",
47
- "start-http": "PORT=3100 bun index.ts http"
51
+ "start-http": "PORT=3100 bun index.ts http",
52
+ "start-http:telemetry": "ENABLE_TELEMETRY=true PORT=3100 bun index.ts http"
48
53
  },
49
54
  "dependencies": {
50
55
  "@agentclientprotocol/sdk": "^0.5.1",
@@ -56,11 +61,22 @@
56
61
  "@langchain/google-genai": "^1.0.3",
57
62
  "@langchain/google-vertexai": "^1.0.3",
58
63
  "@langchain/mcp-adapters": "^1.0.0",
59
- "@townco/core": "0.0.21",
60
- "@townco/gui-template": "0.1.40",
61
- "@townco/tui-template": "0.1.40",
62
- "@townco/tsconfig": "0.1.40",
63
- "@townco/ui": "0.1.43",
64
+ "@opentelemetry/api": "^1.9.0",
65
+ "@opentelemetry/api-logs": "^0.56.0",
66
+ "@opentelemetry/core": "^1.28.0",
67
+ "@opentelemetry/exporter-logs-otlp-http": "^0.56.0",
68
+ "@opentelemetry/exporter-trace-otlp-http": "^0.56.0",
69
+ "@opentelemetry/instrumentation": "^0.56.0",
70
+ "@opentelemetry/resources": "^1.28.0",
71
+ "@opentelemetry/sdk-logs": "^0.56.0",
72
+ "@opentelemetry/sdk-trace-base": "^1.28.0",
73
+ "@opentelemetry/sdk-trace-node": "^1.28.0",
74
+ "@opentelemetry/semantic-conventions": "^1.28.0",
75
+ "@townco/core": "0.0.23",
76
+ "@townco/gui-template": "0.1.42",
77
+ "@townco/tui-template": "0.1.42",
78
+ "@townco/tsconfig": "0.1.42",
79
+ "@townco/ui": "0.1.45",
64
80
  "exa-js": "^2.0.0",
65
81
  "hono": "^4.10.4",
66
82
  "langchain": "^1.0.3",