@remote-logger/sdk 0.1.6 → 0.1.7

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/SKILL.md CHANGED
@@ -113,8 +113,13 @@ SELECT timestamp, group, level, message FROM logs.entries WHERE trace_id = 'req-
113
113
 
114
114
  -- Recent logs from a specific group
115
115
  SELECT timestamp, level, message FROM logs.entries WHERE group = 'auth' ORDER BY timestamp DESC LIMIT 50
116
+
117
+ -- Error with source context (see the original code around the error)
118
+ SELECT timestamp, message, stack, source_context FROM logs.entries WHERE level = 'ERROR' AND source_context IS NOT NULL ORDER BY timestamp DESC LIMIT 5
116
119
  ```
117
120
 
121
+ **Tip:** When investigating production errors, include `source_context` in your SELECT. It contains the original source code around the error line (resolved from source maps at ingestion time), so you can see exactly what code triggered the error without needing to open the file.
122
+
118
123
  ### Table Schema
119
124
 
120
125
  ```
@@ -127,6 +132,7 @@ message String -- log content
127
132
  stack Nullable(String) -- stack trace (resolved via source maps if available)
128
133
  error_type String -- exception class name
129
134
  release_id String -- build release ID (for source map resolution)
135
+ source_context String -- JSON: { file, line, code: { "lineNum": "source line" } } — original source around the error
130
136
  metadata JSON -- arbitrary structured data
131
137
  ```
132
138
 
package/dist/vite.js CHANGED
@@ -44,6 +44,7 @@ function collectMapFiles(dir) {
44
44
  return results;
45
45
  }
46
46
  var sharedReleaseId = null;
47
+ var uploadedOutDirs = /* @__PURE__ */ new Set();
47
48
  function remoteLoggerPlugin(options) {
48
49
  if (!sharedReleaseId) sharedReleaseId = (0, import_crypto.randomUUID)();
49
50
  const releaseId = sharedReleaseId;
@@ -69,6 +70,8 @@ function remoteLoggerPlugin(options) {
69
70
  async closeBundle() {
70
71
  if (skip) return;
71
72
  const outDir = resolvedConfig.build.outDir;
73
+ if (uploadedOutDirs.has(outDir)) return;
74
+ uploadedOutDirs.add(outDir);
72
75
  const mapFiles = collectMapFiles(outDir);
73
76
  if (mapFiles.length === 0) {
74
77
  console.log("[RemoteLogger] No source map files found, skipping upload");
package/dist/vite.mjs CHANGED
@@ -22,6 +22,7 @@ function collectMapFiles(dir) {
22
22
  return results;
23
23
  }
24
24
  var sharedReleaseId = null;
25
+ var uploadedOutDirs = /* @__PURE__ */ new Set();
25
26
  function remoteLoggerPlugin(options) {
26
27
  if (!sharedReleaseId) sharedReleaseId = randomUUID();
27
28
  const releaseId = sharedReleaseId;
@@ -47,6 +48,8 @@ function remoteLoggerPlugin(options) {
47
48
  async closeBundle() {
48
49
  if (skip) return;
49
50
  const outDir = resolvedConfig.build.outDir;
51
+ if (uploadedOutDirs.has(outDir)) return;
52
+ uploadedOutDirs.add(outDir);
50
53
  const mapFiles = collectMapFiles(outDir);
51
54
  if (mapFiles.length === 0) {
52
55
  console.log("[RemoteLogger] No source map files found, skipping upload");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remote-logger/sdk",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "JavaScript SDK for Remote Logger",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",