@lucasygu/redbook 0.3.1 → 0.3.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/SKILL.md CHANGED
@@ -3,7 +3,7 @@ description: Search, read, analyze, and automate Xiaohongshu (小红书) content
3
3
  allowed-tools: Bash, Read, Write, Glob, Grep
4
4
  # OpenClaw / ClawHub metadata (clawhub install redbook)
5
5
  name: redbook
6
- version: 0.2.0
6
+ version: 0.3.3
7
7
  metadata:
8
8
  openclaw:
9
9
  requires:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucasygu/redbook",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "CLI tool for Xiaohongshu (Red Note) - read and post via private API",
5
5
  "type": "module",
6
6
  "main": "./dist/lib/client.js",
@@ -92,10 +92,52 @@ function patchSweetCookieTimeout() {
92
92
  }
93
93
  }
94
94
 
95
+ /**
96
+ * Patch node:sqlite BigInt overflow on Node < 24.4.
97
+ *
98
+ * Chrome stores expires_utc as microseconds since 1601 — values like
99
+ * 13448382439000000 exceed Number.MAX_SAFE_INTEGER. Node < 24.4 lacks
100
+ * the `readBigInts` option, so node:sqlite throws instead of returning
101
+ * a BigInt. Casting to TEXT in the SQL avoids the overflow; the existing
102
+ * JS code already handles string values via tryParseInt/normalizeExpiration.
103
+ */
104
+ function patchSweetCookieBigInt() {
105
+ const target = join(
106
+ PACKAGE_ROOT,
107
+ 'node_modules',
108
+ '@steipete',
109
+ 'sweet-cookie',
110
+ 'dist',
111
+ 'providers',
112
+ 'chromeSqlite',
113
+ 'shared.js'
114
+ );
115
+
116
+ if (!existsSync(target)) return;
117
+
118
+ try {
119
+ const content = readFileSync(target, 'utf-8');
120
+ const needle = 'SELECT name, value, host_key, path, expires_utc, samesite, encrypted_value,';
121
+ if (!content.includes(needle)) {
122
+ // Already patched or upstream fixed
123
+ return;
124
+ }
125
+ const patched = content.replace(
126
+ needle,
127
+ 'SELECT name, value, host_key, path, CAST(expires_utc AS TEXT) AS expires_utc, samesite, encrypted_value,'
128
+ );
129
+ writeFileSync(target, patched, 'utf-8');
130
+ console.log('[redbook] Patched sweet-cookie BigInt overflow (CAST expires_utc).');
131
+ } catch (err) {
132
+ console.log(`[redbook] Warning: could not patch sweet-cookie BigInt: ${err.message}`);
133
+ }
134
+ }
135
+
95
136
  function main() {
96
137
  console.log('[redbook] Running post-install...');
97
138
  const success = setupClaudeSkill();
98
139
  patchSweetCookieTimeout();
140
+ patchSweetCookieBigInt();
99
141
  console.log('');
100
142
  console.log('[redbook] Installation complete!');
101
143
  if (success) {