@tracemarketplace/cli 0.0.3 → 0.0.4

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/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@tracemarketplace/cli",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "bin": {
6
- "trace": "dist/cli.js"
6
+ "tracemp": "dist/cli.js"
7
7
  },
8
8
  "scripts": {
9
9
  "build": "tsc",
@@ -4,7 +4,7 @@ import { join } from "path";
4
4
  import chalk from "chalk";
5
5
  import ora from "ora";
6
6
  import inquirer from "inquirer";
7
- import { extractClaudeCode, extractCodex, extractCursor } from "@tracemarketplace/shared";
7
+ import { extractClaudeCode, extractCodex, extractCursor, redactTrace } from "@tracemarketplace/shared";
8
8
  import { loadConfig } from "../config.js";
9
9
  import { ApiClient } from "../api-client.js";
10
10
  import { findFiles, CURSOR_DB_PATH } from "../sessions.js";
@@ -154,8 +154,9 @@ export async function submitCommand(opts: SubmitOptions): Promise<void> {
154
154
  const client = new ApiClient(config.serverUrl, config.apiKey);
155
155
 
156
156
  try {
157
+ const home = homedir();
157
158
  const result = (await client.post("/api/v1/traces/batch", {
158
- traces,
159
+ traces: traces.map((t) => redactTrace(t, { homeDir: home })),
159
160
  source_tool: tools[0] ?? "mixed",
160
161
  })) as {
161
162
  submission_id: string;
package/src/submitter.ts CHANGED
@@ -3,7 +3,8 @@
3
3
  * Shared by auto-submit (hook), submit (batch), and daemon (watch).
4
4
  */
5
5
  import { readFile } from "fs/promises";
6
- import { extractClaudeCode, extractCodex, extractCursor } from "@tracemarketplace/shared";
6
+ import { homedir } from "os";
7
+ import { extractClaudeCode, extractCodex, extractCursor, redactTrace } from "@tracemarketplace/shared";
7
8
  import { ApiClient } from "./api-client.js";
8
9
  import { CURSOR_DB_PATH } from "./sessions.js";
9
10
  import type { Config } from "./config.js";
@@ -62,10 +63,11 @@ export async function submitCursorSession(
62
63
  }
63
64
 
64
65
  async function submitTrace(trace: Awaited<ReturnType<typeof extractClaudeCode>>, config: Config): Promise<SubmitResult> {
66
+ const clean = redactTrace(trace, { homeDir: homedir() });
65
67
  const client = new ApiClient(config.serverUrl, config.apiKey);
66
68
  try {
67
69
  const result = await client.post("/api/v1/traces/batch", {
68
- traces: [trace],
70
+ traces: [clean],
69
71
  source_tool: trace.source_tool,
70
72
  }) as {
71
73
  accepted: number;
@@ -79,7 +81,7 @@ async function submitTrace(trace: Awaited<ReturnType<typeof extractClaudeCode>>,
79
81
  accepted: result.accepted > 0,
80
82
  superseded: result.superseded > 0,
81
83
  duplicate: result.duplicate > 0,
82
- turnCount: trace.turn_count,
84
+ turnCount: clean.turn_count,
83
85
  payoutCents: first?.payout_cents ?? 0,
84
86
  traceId: first?.trace_id ?? null,
85
87
  };