@vite-plugin-opencode-assistant/shared 1.0.63 → 1.0.64
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/es/file-log-watcher.mjs
CHANGED
|
@@ -68,11 +68,16 @@ function readLogFile(options) {
|
|
|
68
68
|
const lines = content.split("\n").filter((line) => line.trim());
|
|
69
69
|
const entries = [];
|
|
70
70
|
const sinceDate = since ? new Date(since) : null;
|
|
71
|
+
let lastTimestamp = null;
|
|
71
72
|
for (const line of lines) {
|
|
73
|
+
const parsedTimestamp = parseLogTimestamp(line);
|
|
74
|
+
if (parsedTimestamp) {
|
|
75
|
+
lastTimestamp = parsedTimestamp;
|
|
76
|
+
}
|
|
72
77
|
const entry = {
|
|
73
78
|
level: detectLogLevel(line),
|
|
74
79
|
message: line,
|
|
75
|
-
timestamp:
|
|
80
|
+
timestamp: parsedTimestamp || lastTimestamp || (/* @__PURE__ */ new Date()).toISOString(),
|
|
76
81
|
source: `file:${name}`
|
|
77
82
|
};
|
|
78
83
|
if (sinceDate && new Date(entry.timestamp) < sinceDate) {
|
package/lib/file-log-watcher.cjs
CHANGED
|
@@ -101,11 +101,16 @@ function readLogFile(options) {
|
|
|
101
101
|
const lines = content.split("\n").filter((line) => line.trim());
|
|
102
102
|
const entries = [];
|
|
103
103
|
const sinceDate = since ? new Date(since) : null;
|
|
104
|
+
let lastTimestamp = null;
|
|
104
105
|
for (const line of lines) {
|
|
106
|
+
const parsedTimestamp = parseLogTimestamp(line);
|
|
107
|
+
if (parsedTimestamp) {
|
|
108
|
+
lastTimestamp = parsedTimestamp;
|
|
109
|
+
}
|
|
105
110
|
const entry = {
|
|
106
111
|
level: detectLogLevel(line),
|
|
107
112
|
message: line,
|
|
108
|
-
timestamp:
|
|
113
|
+
timestamp: parsedTimestamp || lastTimestamp || (/* @__PURE__ */ new Date()).toISOString(),
|
|
109
114
|
source: `file:${name}`
|
|
110
115
|
};
|
|
111
116
|
if (sinceDate && new Date(entry.timestamp) < sinceDate) {
|