@shadevkumar/agent-wrapped 0.4.0 → 0.4.1
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/dist/build.js +1 -0
- package/dist/files.js +21 -19
- package/dist/story/index.html +1 -1
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -15,6 +15,7 @@ const PUBLIC_HEAD = `<meta name="description" content="A year with AI coding age
|
|
|
15
15
|
<meta property="og:url" content="${PLAYER_URL}">
|
|
16
16
|
<meta property="og:type" content="website">
|
|
17
17
|
<meta name="twitter:card" content="summary_large_image">
|
|
18
|
+
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
|
|
18
19
|
<link rel="preload" href="/fonts/geist-normal.woff2" as="font" type="font/woff2" crossorigin>
|
|
19
20
|
<link rel="preload" href="/fonts/newsreader-italic.woff2" as="font" type="font/woff2" crossorigin>
|
|
20
21
|
<script>
|
package/dist/files.js
CHANGED
|
@@ -3,10 +3,8 @@ import { basename, join } from "node:path";
|
|
|
3
3
|
// Parse a JSONL file, skipping malformed lines. A missing file is empty.
|
|
4
4
|
// `keep` skips decoding lines that can't matter, which is most of a big log.
|
|
5
5
|
export function readJsonl(path, keep) {
|
|
6
|
-
if (!existsSync(path))
|
|
7
|
-
return [];
|
|
8
6
|
const rows = [];
|
|
9
|
-
for (const line of
|
|
7
|
+
for (const line of linesOf(path)) {
|
|
10
8
|
if (!line.trim() || (keep && !keep(line)))
|
|
11
9
|
continue;
|
|
12
10
|
try {
|
|
@@ -60,11 +58,27 @@ export function lastJsonLine(path, needle, accept) {
|
|
|
60
58
|
closeSync(fd);
|
|
61
59
|
}
|
|
62
60
|
}
|
|
63
|
-
// The first line containing `needle` that parses and passes `accept
|
|
64
|
-
// from the start a chunk at a time.
|
|
61
|
+
// The first line containing `needle` that parses and passes `accept`.
|
|
65
62
|
export function firstJsonLine(path, needle, accept) {
|
|
63
|
+
for (const line of linesOf(path)) {
|
|
64
|
+
if (!line.includes(needle))
|
|
65
|
+
continue;
|
|
66
|
+
try {
|
|
67
|
+
const row = JSON.parse(line);
|
|
68
|
+
if (row && accept(row))
|
|
69
|
+
return row;
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
// A malformed line; keep looking.
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
// A file's lines, read from the start a chunk at a time, so a log of any size
|
|
78
|
+
// fits in memory: Node can't hold more than about 512 MB as one string.
|
|
79
|
+
function* linesOf(path) {
|
|
66
80
|
if (!existsSync(path))
|
|
67
|
-
return
|
|
81
|
+
return;
|
|
68
82
|
const fd = openSync(path, "r");
|
|
69
83
|
try {
|
|
70
84
|
const chunk = 1 << 20;
|
|
@@ -77,21 +91,9 @@ export function firstJsonLine(path, needle, accept) {
|
|
|
77
91
|
// A line cut at the chunk edge waits for the next read. Split on bytes,
|
|
78
92
|
// so a character cut in half is never decoded.
|
|
79
93
|
const end = at + buf.length >= size ? data.length : data.lastIndexOf(0x0a) + 1;
|
|
80
|
-
|
|
81
|
-
if (!line.includes(needle))
|
|
82
|
-
continue;
|
|
83
|
-
try {
|
|
84
|
-
const row = JSON.parse(line);
|
|
85
|
-
if (row && accept(row))
|
|
86
|
-
return row;
|
|
87
|
-
}
|
|
88
|
-
catch {
|
|
89
|
-
// A malformed line; keep looking.
|
|
90
|
-
}
|
|
91
|
-
}
|
|
94
|
+
yield* data.subarray(0, end).toString("utf8").split("\n");
|
|
92
95
|
rest = data.subarray(end);
|
|
93
96
|
}
|
|
94
|
-
return null;
|
|
95
97
|
}
|
|
96
98
|
finally {
|
|
97
99
|
closeSync(fd);
|
package/dist/story/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
6
6
|
<title>Agent Wrapped 2026</title>
|
|
7
|
-
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%
|
|
7
|
+
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='t' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%2334363C'/%3E%3Cstop offset='1' stop-color='%23141518'/%3E%3C/linearGradient%3E%3ClinearGradient id='k' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23FBFBF8'/%3E%3Cstop offset='1' stop-color='%23E2E2DD'/%3E%3C/linearGradient%3E%3ClinearGradient id='s' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23A9AAA6'/%3E%3Cstop offset='1' stop-color='%237C7D7A'/%3E%3C/linearGradient%3E%3Cfilter id='f' x='-30%25' y='-30%25' width='160%25' height='160%25'%3E%3CfeGaussianBlur stdDeviation='2.4'/%3E%3C/filter%3E%3C/defs%3E%3Crect width='64' height='64' rx='14' fill='url(%23t)'/%3E%3Crect x='.5' y='.5' width='63' height='63' rx='13.5' fill='none' stroke='%23fff' stroke-opacity='.08'/%3E%3Crect x='11' y='16' width='42' height='40' rx='9' fill='%23000' opacity='.5' filter='url(%23f)'/%3E%3Crect x='10' y='14' width='44' height='40' rx='9' fill='url(%23s)'/%3E%3Crect x='10' y='10' width='44' height='40' rx='9' fill='url(%23k)'/%3E%3Crect x='10.5' y='10.5' width='43' height='39' rx='8.5' fill='none' stroke='%23fff' stroke-opacity='.9'/%3E%3Cpath d='M40 21v10.5H23.5M29 25.5l-6 6 6 6' fill='none' stroke='%2325272B' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E">
|
|
8
8
|
<!--HEAD-->
|
|
9
9
|
<style>
|
|
10
10
|
/*FONTS*/
|
package/package.json
CHANGED