@raquezha/notrace 0.0.1 → 0.0.3
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/CHANGELOG.md +14 -0
- package/README.md +4 -2
- package/dist/{index.d.ts → notrace.d.ts} +1 -1
- package/dist/{index.js → notrace.js} +13 -1
- package/{index.ts → extensions/notrace.ts} +15 -2
- package/package.json +11 -5
- package/tsconfig.json +2 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# @raquezha/notrace
|
|
2
|
+
|
|
3
|
+
## 0.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2ab1520: Fix skill conflicts by auto-expanding skill collections in shell integration.
|
|
8
|
+
Standardize extension structure by moving entrypoints to conventional extensions/ directories. This allows Pi to auto-discover them and display clean labels (e.g., "noagy") without file extensions in the UI.
|
|
9
|
+
|
|
10
|
+
## 0.0.2
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 2673c7c: Declare Pi package resources, fix nosearch packaged skill lookup, and harden notrace HTML data embedding.
|
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# notrace
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Phase 0 / POC local-first interactive HTML Trace Viewer for the Pi Coding Agent. It captures execution traces for workflow debugging — LLM calls, tool executions, token usage, costs — and writes an interactive HTML report to your active task workspace at session end.
|
|
4
|
+
|
|
5
|
+
> **POC warning:** notrace is currently for local experimentation and RPIV observability research. It can capture prompts, tool payloads, outputs, local paths, and accidental secrets. Do not publish generated reports. Redaction, safer rendering, and configurable capture levels are planned follow-up work.
|
|
4
6
|
|
|
5
7
|
## Features
|
|
6
8
|
|
|
@@ -8,7 +10,7 @@ Zero-dependency, local-first interactive HTML Trace Viewer for the Pi Coding Age
|
|
|
8
10
|
- **Metrics dashboard**: Total tokens, input/output split, cache reads, cost (USD), duration
|
|
9
11
|
- **Clickable `file://` link**: Report path printed to console at session end for instant browser access
|
|
10
12
|
- **Active task aware**: Writes the report into `.workflow/tasks/<task>/notrace.html` when a task is active
|
|
11
|
-
- **
|
|
13
|
+
- **HTML report**: Intended to become fully self-contained/offline; Phase 0 still needs hardening
|
|
12
14
|
|
|
13
15
|
## Output
|
|
14
16
|
|
|
@@ -170,9 +170,21 @@ export default function (pi) {
|
|
|
170
170
|
}
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
|
+
function safeJsonForScript(value) {
|
|
174
|
+
return JSON.stringify(value).replace(/[<>&\u2028\u2029]/g, (char) => {
|
|
175
|
+
switch (char) {
|
|
176
|
+
case "<": return "\\u003c";
|
|
177
|
+
case ">": return "\\u003e";
|
|
178
|
+
case "&": return "\\u0026";
|
|
179
|
+
case "\u2028": return "\\u2028";
|
|
180
|
+
case "\u2029": return "\\u2029";
|
|
181
|
+
default: return char;
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
}
|
|
173
185
|
// Returns a self-contained premium HTML template incorporating the design tokens
|
|
174
186
|
function generateHtmlReport(data) {
|
|
175
|
-
const serializedData =
|
|
187
|
+
const serializedData = safeJsonForScript(data);
|
|
176
188
|
return `<!DOCTYPE html>
|
|
177
189
|
<html lang="en">
|
|
178
190
|
<head>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExtensionAPI } from "@
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { readFileSync, writeFileSync, mkdirSync, existsSync } from "node:fs";
|
|
3
3
|
import * as path from "node:path";
|
|
4
4
|
|
|
@@ -183,9 +183,22 @@ export default function (pi: ExtensionAPI) {
|
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
+
function safeJsonForScript(value: any): string {
|
|
187
|
+
return JSON.stringify(value).replace(/[<>&\u2028\u2029]/g, (char) => {
|
|
188
|
+
switch (char) {
|
|
189
|
+
case "<": return "\\u003c";
|
|
190
|
+
case ">": return "\\u003e";
|
|
191
|
+
case "&": return "\\u0026";
|
|
192
|
+
case "\u2028": return "\\u2028";
|
|
193
|
+
case "\u2029": return "\\u2029";
|
|
194
|
+
default: return char;
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
|
|
186
199
|
// Returns a self-contained premium HTML template incorporating the design tokens
|
|
187
200
|
function generateHtmlReport(data: any): string {
|
|
188
|
-
const serializedData =
|
|
201
|
+
const serializedData = safeJsonForScript(data);
|
|
189
202
|
|
|
190
203
|
return `<!DOCTYPE html>
|
|
191
204
|
<html lang="en">
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raquezha/notrace",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Zero-dependency, local-first interactive HTML Trace Viewer for the Pi Coding Agent",
|
|
5
|
-
"main": "dist/
|
|
6
|
-
"types": "dist/
|
|
5
|
+
"main": "dist/notrace.js",
|
|
6
|
+
"types": "dist/notrace.d.ts",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build": "tsc",
|
|
10
10
|
"prepare": "npm run build"
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@
|
|
13
|
+
"@earendil-works/pi-coding-agent": ">=0.74.0"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"typescript": "^5.0.0"
|
|
@@ -19,10 +19,16 @@
|
|
|
19
19
|
"pi-agent",
|
|
20
20
|
"observability",
|
|
21
21
|
"trace",
|
|
22
|
-
"telemetry"
|
|
22
|
+
"telemetry",
|
|
23
|
+
"pi-package"
|
|
23
24
|
],
|
|
24
25
|
"license": "MIT",
|
|
25
26
|
"publishConfig": {
|
|
26
27
|
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"pi": {
|
|
30
|
+
"extensions": [
|
|
31
|
+
"extensions"
|
|
32
|
+
]
|
|
27
33
|
}
|
|
28
34
|
}
|
package/tsconfig.json
CHANGED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
"moduleResolution": "NodeNext",
|
|
6
6
|
"declaration": true,
|
|
7
7
|
"outDir": "./dist",
|
|
8
|
+
"rootDir": "extensions",
|
|
8
9
|
"strict": true,
|
|
9
10
|
"esModuleInterop": true,
|
|
10
11
|
"skipLibCheck": true,
|
|
11
12
|
"forceConsistentCasingInFileNames": true
|
|
12
13
|
},
|
|
13
|
-
"include": ["
|
|
14
|
+
"include": ["extensions/notrace.ts"]
|
|
14
15
|
}
|