lowdown-proxy 0.1.12 → 0.1.14

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.
@@ -46,6 +46,12 @@ server.tool("compare_tools", "Compare multiple tools or agents by their recorded
46
46
  candidates: z.array(z.string()).min(2).max(5).describe("List of tool/agent identifiers to compare"),
47
47
  task_type: z.string().optional().describe("Filter by task type if you want task-specific comparison"),
48
48
  }, async ({ candidates, task_type }) => {
49
+ // compare_calls 로그 (fire-and-forget)
50
+ void fetch(`${BASE_URL}/api/compare-log`, {
51
+ method: "POST",
52
+ headers: { "Content-Type": "application/json" },
53
+ body: JSON.stringify({ candidates, task_type: task_type ?? null, node_id: NODE_ID }),
54
+ }).catch(() => { });
49
55
  // 후보들을 병렬로 조회 (task_type 있으면 필터 적용)
50
56
  const results = await Promise.all(candidates.map(async (target) => {
51
57
  try {
package/dist/proxy.js CHANGED
@@ -51,12 +51,28 @@ export function runProxy(opts) {
51
51
  const outcome = msg.error
52
52
  ? "failure"
53
53
  : "success";
54
+ let failure_type;
55
+ if (msg.error) {
56
+ const code = msg.error?.code;
57
+ const message = msg.error?.message ?? "";
58
+ if (code === -32602)
59
+ failure_type = "invalid_arguments";
60
+ else if (message.toLowerCase().includes("timeout"))
61
+ failure_type = "timeout";
62
+ else if (code === -32603)
63
+ failure_type = "server_error";
64
+ else if (code === -32000)
65
+ failure_type = "tool_error";
66
+ else
67
+ failure_type = "unknown";
68
+ }
54
69
  const record = {
55
70
  actor: opts.actor,
56
71
  target: opts.targetLabel,
57
72
  target_type: "tool",
58
73
  task_type: call.toolName ?? call.method,
59
74
  outcome,
75
+ failure_type,
60
76
  latency_ms,
61
77
  source: opts.source,
62
78
  node_id: nodeId,
package/dist/supabase.js CHANGED
@@ -38,6 +38,7 @@ export async function recordInteraction(record) {
38
38
  latency_ms: record.latency_ms ?? null,
39
39
  source: record.source ?? "organic",
40
40
  node_id: record.node_id ?? null,
41
+ failure_type: record.failure_type ?? null,
41
42
  });
42
43
  if (error && process.env.LOWDOWN_DEBUG) {
43
44
  console.error("[lowdown] interaction 기록 실패:", error.message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lowdown-proxy",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "mcpName": "io.github.PetShopBros/lowdown-proxy",
5
5
  "description": "Record and query AI agent/tool/service interactions. Shared interaction history for the multi-agent ecosystem.",
6
6
  "type": "module",