@webywz/agent-trace 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +116 -2
- package/dist/args.d.ts +16 -0
- package/dist/args.d.ts.map +1 -0
- package/dist/args.js +120 -0
- package/dist/args.js.map +1 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +107 -0
- package/dist/cli.js.map +1 -0
- package/dist/color.d.ts +15 -0
- package/dist/color.d.ts.map +1 -0
- package/dist/color.js +29 -0
- package/dist/color.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/parse/event.d.ts +5 -0
- package/dist/parse/event.d.ts.map +1 -0
- package/dist/parse/event.js +204 -0
- package/dist/parse/event.js.map +1 -0
- package/dist/parse/generic.d.ts +4 -0
- package/dist/parse/generic.d.ts.map +1 -0
- package/dist/parse/generic.js +62 -0
- package/dist/parse/generic.js.map +1 -0
- package/dist/parse/index.d.ts +8 -0
- package/dist/parse/index.d.ts.map +1 -0
- package/dist/parse/index.js +71 -0
- package/dist/parse/index.js.map +1 -0
- package/dist/parse/jsonl.d.ts +8 -0
- package/dist/parse/jsonl.d.ts.map +1 -0
- package/dist/parse/jsonl.js +85 -0
- package/dist/parse/jsonl.js.map +1 -0
- package/dist/parse/langchain.d.ts +4 -0
- package/dist/parse/langchain.d.ts.map +1 -0
- package/dist/parse/langchain.js +348 -0
- package/dist/parse/langchain.js.map +1 -0
- package/dist/parse/openai.d.ts +4 -0
- package/dist/parse/openai.d.ts.map +1 -0
- package/dist/parse/openai.js +344 -0
- package/dist/parse/openai.js.map +1 -0
- package/dist/read-input.d.ts +5 -0
- package/dist/read-input.d.ts.map +1 -0
- package/dist/read-input.js +20 -0
- package/dist/read-input.js.map +1 -0
- package/dist/render/spicy.d.ts +4 -0
- package/dist/render/spicy.d.ts.map +1 -0
- package/dist/render/spicy.js +144 -0
- package/dist/render/spicy.js.map +1 -0
- package/dist/render/timeline.d.ts +4 -0
- package/dist/render/timeline.d.ts.map +1 -0
- package/dist/render/timeline.js +179 -0
- package/dist/render/timeline.js.map +1 -0
- package/dist/stats.d.ts +3 -0
- package/dist/stats.d.ts.map +1 -0
- package/dist/stats.js +64 -0
- package/dist/stats.js.map +1 -0
- package/dist/types.d.ts +49 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/util.d.ts +17 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +185 -0
- package/dist/util.js.map +1 -0
- package/examples/generic.json +29 -0
- package/examples/langchain.json +55 -0
- package/examples/openai.json +29 -0
- package/examples/run.jsonl +19 -0
- package/package.json +59 -4
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "chatcmpl-demo",
|
|
3
|
+
"object": "chat.completion",
|
|
4
|
+
"created": 1793277663,
|
|
5
|
+
"model": "gpt-4.1-mini",
|
|
6
|
+
"choices": [
|
|
7
|
+
{
|
|
8
|
+
"index": 0,
|
|
9
|
+
"message": {
|
|
10
|
+
"role": "assistant",
|
|
11
|
+
"content": "I'll search flights, then compare prices.",
|
|
12
|
+
"tool_calls": [
|
|
13
|
+
{
|
|
14
|
+
"id": "call_search",
|
|
15
|
+
"type": "function",
|
|
16
|
+
"function": {
|
|
17
|
+
"name": "search_flights",
|
|
18
|
+
"arguments": "{\"origin\":\"SFO\",\"dest\":\"NRT\",\"date\":\"2026-11-05\"}"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"usage": {
|
|
26
|
+
"prompt_tokens": 214,
|
|
27
|
+
"completion_tokens": 38
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{"ts":"2026-10-29T12:01:03.120Z","role":"user","content":"The login test is flaky on CI. Fix it. Do not sleep() your way out."}
|
|
2
|
+
{"ts":"2026-10-29T12:01:03.890Z","type":"thought","content":"I'll read the spec and the auth module, then look for a race — not a missing timeout."}
|
|
3
|
+
{"ts":"2026-10-29T12:01:04.010Z","type":"tool_call","name":"read_file","args":{"path":"test/login.spec.ts"}}
|
|
4
|
+
{"ts":"2026-10-29T12:01:04.180Z","type":"tool_result","name":"read_file","content":"it('logs in', async () => { await page.fill('#email', user); await page.click('button[type=submit]'); await page.waitForTimeout(500); expect(await page.innerText('h1')).toBe('Dashboard'); });"}
|
|
5
|
+
{"ts":"2026-10-29T12:01:04.410Z","type":"tool_call","name":"read_file","args":{"path":"src/auth.ts"}}
|
|
6
|
+
{"ts":"2026-10-29T12:01:04.540Z","type":"tool_result","name":"read_file","content":"export async function login(req) { const session = await sessions.create(req.user); res.cookie('sid', session.id); /* cookie is set after redirect is queued */}"}
|
|
7
|
+
{"ts":"2026-10-29T12:01:05.020Z","type":"thought","content":"The test waits 500ms and hopes the cookie lands. That's the flake. I'll wait for the dashboard heading instead, and set the cookie before redirect."}
|
|
8
|
+
{"ts":"2026-10-29T12:01:05.200Z","type":"tool_call","name":"edit_file","args":{"path":"src/auth.ts","patch":"set cookie before redirect"}}
|
|
9
|
+
{"ts":"2026-10-29T12:01:05.330Z","type":"tool_result","name":"edit_file","content":"patched src/auth.ts (+6 -4)"}
|
|
10
|
+
{"ts":"2026-10-29T12:01:05.510Z","type":"tool_call","name":"edit_file","args":{"path":"test/login.spec.ts","patch":"replace waitForTimeout(500) with waitForURL('/dashboard')"}}
|
|
11
|
+
{"ts":"2026-10-29T12:01:05.640Z","type":"tool_result","name":"edit_file","content":"patched test/login.spec.ts (+3 -2)"}
|
|
12
|
+
{"ts":"2026-10-29T12:01:05.800Z","type":"tool_call","name":"run_tests","args":{"cmd":"npx playwright test test/login.spec.ts --repeat-each=8"}}
|
|
13
|
+
{"ts":"2026-10-29T12:01:12.410Z","type":"error","name":"run_tests","error":"1 failed · login.spec.ts:12: cookie sid missing on first navigation (repeat 3/8)"}
|
|
14
|
+
{"ts":"2026-10-29T12:01:12.880Z","type":"thought","content":"Still racing: the redirect fires before Set-Cookie is flushed. Wait for the cookie, not the URL."}
|
|
15
|
+
{"ts":"2026-10-29T12:01:13.040Z","type":"tool_call","name":"edit_file","args":{"path":"test/login.spec.ts","patch":"await page.waitForFunction(() => document.cookie.includes('sid='))"}}
|
|
16
|
+
{"ts":"2026-10-29T12:01:13.190Z","type":"tool_result","name":"edit_file","content":"patched test/login.spec.ts (+4 -1)"}
|
|
17
|
+
{"ts":"2026-10-29T12:01:13.310Z","type":"tool_call","name":"run_tests","args":{"cmd":"npx playwright test test/login.spec.ts --repeat-each=8"}}
|
|
18
|
+
{"ts":"2026-10-29T12:01:18.020Z","type":"tool_result","name":"run_tests","content":"12 passed (8 repeats of login + 4 siblings)"}
|
|
19
|
+
{"ts":"2026-10-29T12:01:18.400Z","role":"assistant","content":"The flake was a cookie/redirect race, not a slow page. Cookie is now set before redirect; the test waits for `sid` instead of `waitForTimeout(500)`. 8 repeats are green.","usage":{"prompt_tokens":1840,"completion_tokens":96}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webywz/agent-trace",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Turn messy agent run logs into a readable timeline.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"agent-trace": "dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"examples",
|
|
20
|
+
"LICENSE",
|
|
21
|
+
"README.md"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsc",
|
|
25
|
+
"test": "tsx --test test/*.test.ts",
|
|
26
|
+
"dev": "tsx src/cli.ts",
|
|
27
|
+
"prepublishOnly": "npm test && npm run build && node -e \"require('fs').chmodSync('dist/cli.js',0o755)\""
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=18"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/webywz/agent-trace.git"
|
|
38
|
+
},
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/webywz/agent-trace/issues"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/webywz/agent-trace#readme",
|
|
43
|
+
"keywords": [
|
|
44
|
+
"agent",
|
|
45
|
+
"trace",
|
|
46
|
+
"timeline",
|
|
47
|
+
"openai",
|
|
48
|
+
"langchain",
|
|
49
|
+
"jsonl",
|
|
50
|
+
"cli",
|
|
51
|
+
"llm",
|
|
52
|
+
"tool-calls"
|
|
53
|
+
],
|
|
54
|
+
"author": "webywz",
|
|
55
|
+
"license": "MIT",
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@types/node": "^22.10.2",
|
|
58
|
+
"tsx": "^4.19.2",
|
|
59
|
+
"typescript": "^5.7.2"
|
|
60
|
+
}
|
|
61
|
+
}
|