fix: remove all console.log/warn to avoid breaking TUI
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "opencode-agentlens",
|
||||
"version": "0.1.5",
|
||||
"version": "0.1.6",
|
||||
"description": "OpenCode plugin for AgentLens — trace your coding agent's decisions, tool calls, and sessions",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
|
||||
@@ -22,11 +22,10 @@ const plugin: Plugin = async ({ project, directory, worktree }) => {
|
||||
const config = loadConfig();
|
||||
|
||||
if (!config.enabled || !config.apiKey) {
|
||||
console.log("[agentlens] Plugin disabled — missing AGENTLENS_API_KEY");
|
||||
return {};
|
||||
}
|
||||
|
||||
console.log(`[agentlens] Plugin enabled — endpoint: ${config.endpoint}`);
|
||||
|
||||
|
||||
init({
|
||||
apiKey: config.apiKey,
|
||||
@@ -62,7 +61,7 @@ const plugin: Plugin = async ({ project, directory, worktree }) => {
|
||||
worktree,
|
||||
title: info?.["title"] as string | undefined,
|
||||
});
|
||||
console.log(`[agentlens] Session started: ${sessionId}`);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +106,7 @@ const plugin: Plugin = async ({ project, directory, worktree }) => {
|
||||
if (sessionId) {
|
||||
state.endSession(sessionId);
|
||||
await flush();
|
||||
console.log(`[agentlens] Session ended and flushed: ${sessionId}`);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,9 +156,7 @@ const plugin: Plugin = async ({ project, directory, worktree }) => {
|
||||
directory,
|
||||
worktree,
|
||||
});
|
||||
console.log(
|
||||
`[agentlens] Auto-created session from tool call: ${input.sessionID}`,
|
||||
);
|
||||
|
||||
}
|
||||
state.startToolCall(
|
||||
input.callID,
|
||||
@@ -186,9 +183,7 @@ const plugin: Plugin = async ({ project, directory, worktree }) => {
|
||||
directory,
|
||||
worktree,
|
||||
});
|
||||
console.log(
|
||||
`[agentlens] Auto-created session from chat.message: ${input.sessionID}`,
|
||||
);
|
||||
|
||||
}
|
||||
if (input.model) {
|
||||
state.recordLLMCall(input.sessionID, {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "agentlens-sdk",
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.3",
|
||||
"description": "AgentLens TypeScript SDK — Agent observability that traces decisions, not just API calls.",
|
||||
"type": "module",
|
||||
"main": "./dist/index.cjs",
|
||||
|
||||
@@ -68,15 +68,9 @@ export class BatchTransport {
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
const text = await response.text().catch(() => "");
|
||||
console.warn(
|
||||
`AgentLens: Failed to send traces (HTTP ${response.status}): ${text.slice(0, 200)}`,
|
||||
);
|
||||
await response.text().catch(() => "");
|
||||
}
|
||||
} catch (error: unknown) {
|
||||
const message =
|
||||
error instanceof Error ? error.message : String(error);
|
||||
console.warn(`AgentLens: Failed to send traces: ${message}`);
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user