@bash0816/claude-code 2.1.153-4 → 2.1.154-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.
|
@@ -174,6 +174,13 @@
|
|
|
174
174
|
"entry_js_offset": 222525028,
|
|
175
175
|
"entry_end_offset": 237958345,
|
|
176
176
|
"status": "termux_verified"
|
|
177
|
+
},
|
|
178
|
+
"2.1.154": {
|
|
179
|
+
"wrapper_spec": "@anthropic-ai/claude-code@2.1.154",
|
|
180
|
+
"native_spec": "@anthropic-ai/claude-code-linux-arm64@2.1.154",
|
|
181
|
+
"entry_js_offset": 222957396,
|
|
182
|
+
"entry_end_offset": 238482842,
|
|
183
|
+
"status": "termux_verified"
|
|
177
184
|
}
|
|
178
185
|
}
|
|
179
186
|
}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
"canonical_package_name": "@bash0816/claude-code",
|
|
5
5
|
"canonical_manifest_url": "https://raw.githubusercontent.com/bash0816/ClaudeCode-Termux/main/config/claude-termux-release-manifest.json",
|
|
6
6
|
"canonical_repository_url": "https://github.com/bash0816/ClaudeCode-Termux",
|
|
7
|
-
"bridge_package_version": "2.1.
|
|
8
|
-
"default_native_version": "2.1.
|
|
9
|
-
"latest_audited_version": "2.1.
|
|
10
|
-
"latest_candidate_version": "2.1.
|
|
11
|
-
"previous_stable_version": "2.1.
|
|
7
|
+
"bridge_package_version": "2.1.154-1",
|
|
8
|
+
"default_native_version": "2.1.154",
|
|
9
|
+
"latest_audited_version": "2.1.154",
|
|
10
|
+
"latest_candidate_version": "2.1.154",
|
|
11
|
+
"previous_stable_version": "2.1.126",
|
|
12
12
|
"manifest_url": "https://raw.githubusercontent.com/bash0816/ClaudeCode-Termux/main/config/claude-termux-release-manifest.json"
|
|
13
13
|
}
|
|
@@ -75,38 +75,6 @@ function ensureEntryFile() {
|
|
|
75
75
|
|
|
76
76
|
function createFakeRequire(realRequire) {
|
|
77
77
|
const realChild = realRequire('child_process');
|
|
78
|
-
const realVm = realRequire('vm');
|
|
79
|
-
|
|
80
|
-
function injectBunIntoContext(context) {
|
|
81
|
-
if (!context || typeof context !== 'object') return context;
|
|
82
|
-
try {
|
|
83
|
-
if (!Object.prototype.hasOwnProperty.call(context, 'Bun')) {
|
|
84
|
-
Object.defineProperty(context, 'Bun', {
|
|
85
|
-
value: globalThis.Bun,
|
|
86
|
-
configurable: true,
|
|
87
|
-
writable: true,
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
} catch {}
|
|
91
|
-
return context;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (!realVm.__bunShimPatched) {
|
|
95
|
-
const origCreateContext = realVm.createContext.bind(realVm);
|
|
96
|
-
const origRunInNewContext = realVm.runInNewContext.bind(realVm);
|
|
97
|
-
realVm.createContext = (ctx, ...rest) => origCreateContext(injectBunIntoContext(ctx), ...rest);
|
|
98
|
-
realVm.runInNewContext = (code, ctx, ...rest) => origRunInNewContext(code, injectBunIntoContext(ctx), ...rest);
|
|
99
|
-
const ScriptProto = realVm.Script && realVm.Script.prototype;
|
|
100
|
-
if (ScriptProto && !ScriptProto.__bunShimPatched) {
|
|
101
|
-
const origRunInContext = ScriptProto.runInContext;
|
|
102
|
-
const origRunInNewCtx = ScriptProto.runInNewContext;
|
|
103
|
-
ScriptProto.runInContext = function(ctx, ...rest) { return origRunInContext.call(this, injectBunIntoContext(ctx), ...rest); };
|
|
104
|
-
ScriptProto.runInNewContext = function(ctx, ...rest) { return origRunInNewCtx.call(this, injectBunIntoContext(ctx), ...rest); };
|
|
105
|
-
Object.defineProperty(ScriptProto, '__bunShimPatched', { value: true });
|
|
106
|
-
}
|
|
107
|
-
Object.defineProperty(realVm, '__bunShimPatched', { value: true });
|
|
108
|
-
}
|
|
109
|
-
|
|
110
78
|
function rewriteArgs(args) {
|
|
111
79
|
if (
|
|
112
80
|
Array.isArray(args) &&
|
|
@@ -120,8 +88,6 @@ function createFakeRequire(realRequire) {
|
|
|
120
88
|
}
|
|
121
89
|
|
|
122
90
|
return function fakeRequire(id) {
|
|
123
|
-
if (id === 'vm') return realVm;
|
|
124
|
-
|
|
125
91
|
if (id === 'ws') {
|
|
126
92
|
class WS {
|
|
127
93
|
on() {}
|
|
@@ -153,321 +119,242 @@ function createFakeRequire(realRequire) {
|
|
|
153
119
|
};
|
|
154
120
|
}
|
|
155
121
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
const os = require('os');
|
|
161
|
-
const ansiPattern =
|
|
162
|
-
/[\u001B\u009B][[\]()#;?]*(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?(?:\u0007|\u001B\u005C|\u009C)|(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))/g;
|
|
163
|
-
|
|
164
|
-
function stripANSI(value) {
|
|
165
|
-
if (typeof value !== 'string' || value.length === 0) return '';
|
|
166
|
-
return value.replace(ansiPattern, '');
|
|
167
|
-
}
|
|
122
|
+
const ansiPattern =
|
|
123
|
+
/[\u001B\u009B][[\]()#;?]*(?:(?:(?:;[-a-zA-Z\d\/\#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/\#&.:=?%@~_]*)*)?(?:\u0007|\u001B\u005C|\u009C)|(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))/g;
|
|
124
|
+
const ansiPatternSingle = new RegExp(ansiPattern.source);
|
|
125
|
+
const debugBunShim = process.env.CLAUDE_TERMUX_DEBUG_BUN_SHIM === '1';
|
|
168
126
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
)
|
|
127
|
+
function stripANSI(text) {
|
|
128
|
+
if (typeof text !== 'string' || text.length === 0) return '';
|
|
129
|
+
return text.replace(ansiPattern, '');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function codePointWidth(codePoint) {
|
|
133
|
+
if (
|
|
134
|
+
codePoint <= 0x1f ||
|
|
135
|
+
(codePoint >= 0x7f && codePoint <= 0x9f) ||
|
|
136
|
+
(codePoint >= 0x300 && codePoint <= 0x36f) ||
|
|
137
|
+
(codePoint >= 0x200b && codePoint <= 0x200f) ||
|
|
138
|
+
codePoint === 0xfeff ||
|
|
139
|
+
(codePoint >= 0xfe00 && codePoint <= 0xfe0f)
|
|
140
|
+
) {
|
|
141
|
+
return 0;
|
|
178
142
|
}
|
|
179
143
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
144
|
+
if (
|
|
145
|
+
(codePoint >= 0x1100 && codePoint <= 0x115f) ||
|
|
146
|
+
(codePoint >= 0x2329 && codePoint <= 0x232a) ||
|
|
147
|
+
(codePoint >= 0x2e80 && codePoint <= 0xa4cf && codePoint !== 0x303f) ||
|
|
148
|
+
(codePoint >= 0xac00 && codePoint <= 0xd7a3) ||
|
|
149
|
+
(codePoint >= 0xf900 && codePoint <= 0xfaff) ||
|
|
150
|
+
(codePoint >= 0xfe10 && codePoint <= 0xfe19) ||
|
|
151
|
+
(codePoint >= 0xfe30 && codePoint <= 0xfe6f) ||
|
|
152
|
+
(codePoint >= 0xff00 && codePoint <= 0xff60) ||
|
|
153
|
+
(codePoint >= 0xffe0 && codePoint <= 0xffe6) ||
|
|
154
|
+
(codePoint >= 0x1f300 && codePoint <= 0x1faf8) ||
|
|
155
|
+
(codePoint >= 0x20000 && codePoint <= 0x3fffd)
|
|
156
|
+
) {
|
|
157
|
+
return 2;
|
|
194
158
|
}
|
|
195
159
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
160
|
+
return 1;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function stringWidth(value) {
|
|
164
|
+
const text = stripANSI(typeof value === 'string' ? value : String(value ?? ''));
|
|
165
|
+
let width = 0;
|
|
166
|
+
for (const char of text) {
|
|
167
|
+
const codePoint = char.codePointAt(0);
|
|
168
|
+
width += codePointWidth(codePoint);
|
|
205
169
|
}
|
|
170
|
+
return width;
|
|
171
|
+
}
|
|
206
172
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
173
|
+
function toHashBytes(value) {
|
|
174
|
+
if (Buffer.isBuffer(value)) return Buffer.from(value);
|
|
175
|
+
if (value instanceof Uint8Array) return Buffer.from(value.buffer, value.byteOffset, value.byteLength);
|
|
176
|
+
if (value instanceof ArrayBuffer) return Buffer.from(value);
|
|
177
|
+
if (ArrayBuffer.isView(value)) {
|
|
178
|
+
return Buffer.from(value.buffer, value.byteOffset, value.byteLength);
|
|
211
179
|
}
|
|
180
|
+
return Buffer.from(String(value ?? ''));
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function hashValue(value, seed = 0) {
|
|
184
|
+
const FNV_OFFSET_BASIS_64 = 0xcbf29ce484222325n;
|
|
185
|
+
const FNV_PRIME_64 = 0x100000001b3n;
|
|
186
|
+
const MASK_64 = 0xffffffffffffffffn;
|
|
187
|
+
|
|
188
|
+
const seedNumber = typeof seed === 'bigint' ? Number(seed) : Number(seed);
|
|
189
|
+
const seedValue = Number.isFinite(seedNumber) ? Math.trunc(seedNumber) : 0;
|
|
190
|
+
let result = BigInt.asUintN(64, FNV_OFFSET_BASIS_64 ^ BigInt(seedValue));
|
|
212
191
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
192
|
+
const bytes = toHashBytes(value);
|
|
193
|
+
for (const byte of bytes) {
|
|
194
|
+
result ^= BigInt(byte);
|
|
195
|
+
result = (result * FNV_PRIME_64) & MASK_64;
|
|
216
196
|
}
|
|
217
197
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
198
|
+
return BigInt(result);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function which(cmd) {
|
|
202
|
+
const fs = require('fs');
|
|
203
|
+
const path = require('path');
|
|
204
|
+
|
|
205
|
+
if (typeof cmd !== 'string' || cmd.length === 0) return null;
|
|
206
|
+
|
|
207
|
+
const isExecutable = candidate => {
|
|
208
|
+
try {
|
|
209
|
+
fs.accessSync(candidate, fs.constants.X_OK);
|
|
210
|
+
const stat = fs.statSync(candidate);
|
|
211
|
+
return stat.isFile();
|
|
212
|
+
} catch {
|
|
213
|
+
return false;
|
|
229
214
|
}
|
|
230
|
-
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
if (cmd.includes(path.sep)) {
|
|
218
|
+
return isExecutable(cmd) ? path.resolve(cmd) : null;
|
|
231
219
|
}
|
|
232
220
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
221
|
+
const searchPath = process.env.PATH || '';
|
|
222
|
+
for (const entry of searchPath.split(path.delimiter)) {
|
|
223
|
+
if (!entry) continue;
|
|
224
|
+
const candidate = path.join(entry, cmd);
|
|
225
|
+
if (isExecutable(candidate)) return candidate;
|
|
226
|
+
}
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
239
229
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
230
|
+
function wrapAnsi(str, columns, options) {
|
|
231
|
+
const input = typeof str === 'string' ? str : String(str ?? '');
|
|
232
|
+
const widthLimit = Number(columns);
|
|
233
|
+
if (!Number.isFinite(widthLimit) || widthLimit <= 0) return input;
|
|
244
234
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
stdioSpec = ['pipe', 'pipe', 'pipe'];
|
|
248
|
-
} else if (Array.isArray(options.stdio)) {
|
|
249
|
-
stdioSpec = options.stdio.map(s => resolveStdio(s, 'pipe'));
|
|
250
|
-
} else {
|
|
251
|
-
stdioSpec = [
|
|
252
|
-
resolveStdio(options.stdin, 'pipe'),
|
|
253
|
-
resolveStdio(options.stdout, 'pipe'),
|
|
254
|
-
resolveStdio(options.stderr, 'pipe'),
|
|
255
|
-
];
|
|
256
|
-
}
|
|
235
|
+
const wordWrap = !options || options.wordWrap !== false;
|
|
236
|
+
const hard = !!(options && options.hard);
|
|
257
237
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
detached: options.detached,
|
|
262
|
-
windowsHide: options.windowsHide,
|
|
263
|
-
stdio: stdioSpec,
|
|
264
|
-
});
|
|
238
|
+
if (!wordWrap || hard) {
|
|
239
|
+
const result = [];
|
|
240
|
+
let width = 0;
|
|
265
241
|
|
|
266
|
-
|
|
267
|
-
const
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
terminal.write = data => {
|
|
276
|
-
if (nodeChild.stdin && !nodeChild.stdin.destroyed) {
|
|
277
|
-
nodeChild.stdin.write(Buffer.isBuffer(data) ? data : Buffer.from(data));
|
|
242
|
+
for (let i = 0; i < input.length; ) {
|
|
243
|
+
const char = input[i];
|
|
244
|
+
|
|
245
|
+
if (char === '\u001b' || char === '\u009b') {
|
|
246
|
+
const match = input.slice(i).match(ansiPatternSingle);
|
|
247
|
+
if (match && match.index === 0) {
|
|
248
|
+
result.push(match[0]);
|
|
249
|
+
i += match[0].length;
|
|
250
|
+
continue;
|
|
278
251
|
}
|
|
279
|
-
|
|
280
|
-
};
|
|
281
|
-
}
|
|
252
|
+
}
|
|
282
253
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
254
|
+
if (char === '\n') {
|
|
255
|
+
result.push(char);
|
|
256
|
+
width = 0;
|
|
257
|
+
i += 1;
|
|
258
|
+
continue;
|
|
259
|
+
}
|
|
286
260
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
261
|
+
const codePoint = input.codePointAt(i);
|
|
262
|
+
const charText = String.fromCodePoint(codePoint);
|
|
263
|
+
const charWidth = codePointWidth(codePoint);
|
|
264
|
+
|
|
265
|
+
if (width > 0 && width + charWidth > widthLimit) {
|
|
266
|
+
result.push('\n');
|
|
267
|
+
width = 0;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
result.push(charText);
|
|
271
|
+
width += charWidth;
|
|
272
|
+
i += charText.length;
|
|
299
273
|
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
return nodeChild;
|
|
274
|
+
|
|
275
|
+
return result.join('');
|
|
303
276
|
}
|
|
304
277
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
278
|
+
const result = [];
|
|
279
|
+
let line = '';
|
|
280
|
+
let lineWidth = 0;
|
|
281
|
+
let pendingSpaces = '';
|
|
282
|
+
|
|
283
|
+
for (let i = 0; i < input.length; ) {
|
|
284
|
+
const char = input[i];
|
|
285
|
+
|
|
286
|
+
if (char === '\u001b' || char === '\u009b') {
|
|
287
|
+
const match = input.slice(i).match(ansiPatternSingle);
|
|
288
|
+
if (match && match.index === 0) {
|
|
289
|
+
line += match[0];
|
|
290
|
+
i += match[0].length;
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
315
293
|
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
294
|
+
|
|
295
|
+
if (char === '\n') {
|
|
296
|
+
if (line.length > 0) result.push(line);
|
|
297
|
+
result.push('\n');
|
|
298
|
+
line = '';
|
|
299
|
+
lineWidth = 0;
|
|
300
|
+
pendingSpaces = '';
|
|
301
|
+
i += 1;
|
|
302
|
+
continue;
|
|
319
303
|
}
|
|
320
|
-
|
|
321
|
-
|
|
304
|
+
|
|
305
|
+
const codePoint = input.codePointAt(i);
|
|
306
|
+
const charText = String.fromCodePoint(codePoint);
|
|
307
|
+
if (charText === ' ' || charText === '\t') {
|
|
308
|
+
pendingSpaces += charText;
|
|
309
|
+
i += charText.length;
|
|
310
|
+
continue;
|
|
322
311
|
}
|
|
323
|
-
}
|
|
324
312
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
data: undefined,
|
|
331
|
-
write(chunk) {
|
|
332
|
-
const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
333
|
-
const ok = socket.write(buffer);
|
|
334
|
-
return ok ? buffer.length : 0;
|
|
335
|
-
},
|
|
336
|
-
end(chunk) {
|
|
337
|
-
socket.end(chunk);
|
|
338
|
-
},
|
|
339
|
-
destroy(error) {
|
|
340
|
-
socket.destroy(error);
|
|
341
|
-
},
|
|
342
|
-
};
|
|
343
|
-
socket.on('data', chunk => {
|
|
344
|
-
if (options.socket && typeof options.socket.data === 'function') {
|
|
345
|
-
options.socket.data(connection, chunk);
|
|
346
|
-
}
|
|
347
|
-
});
|
|
348
|
-
socket.on('drain', () => {
|
|
349
|
-
if (options.socket && typeof options.socket.drain === 'function') {
|
|
350
|
-
options.socket.drain(connection);
|
|
351
|
-
}
|
|
352
|
-
});
|
|
353
|
-
socket.on('close', () => {
|
|
354
|
-
sockets.delete(socket);
|
|
355
|
-
if (options.socket && typeof options.socket.close === 'function') {
|
|
356
|
-
options.socket.close(connection);
|
|
357
|
-
}
|
|
358
|
-
});
|
|
359
|
-
socket.on('error', error => {
|
|
360
|
-
if (options.socket && typeof options.socket.error === 'function') {
|
|
361
|
-
options.socket.error(connection, error);
|
|
362
|
-
}
|
|
363
|
-
});
|
|
364
|
-
if (options.socket && typeof options.socket.open === 'function') {
|
|
365
|
-
options.socket.open(connection);
|
|
313
|
+
let end = i + charText.length;
|
|
314
|
+
while (end < input.length) {
|
|
315
|
+
const nextChar = input[end];
|
|
316
|
+
if (nextChar === '\n' || nextChar === ' ' || nextChar === '\t' || nextChar === '\u001b' || nextChar === '\u009b') {
|
|
317
|
+
break;
|
|
366
318
|
}
|
|
367
|
-
|
|
319
|
+
const nextCodePoint = input.codePointAt(end);
|
|
320
|
+
end += String.fromCodePoint(nextCodePoint).length;
|
|
321
|
+
}
|
|
368
322
|
|
|
369
|
-
|
|
323
|
+
const text = input.slice(i, end);
|
|
324
|
+
const textWidth = stringWidth(text);
|
|
325
|
+
const pendingWidth = pendingSpaces ? stringWidth(pendingSpaces) : 0;
|
|
370
326
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
if (closeConnections) {
|
|
379
|
-
for (const socket of sockets) socket.destroy();
|
|
380
|
-
}
|
|
381
|
-
},
|
|
382
|
-
};
|
|
383
|
-
}
|
|
327
|
+
if (lineWidth > 0 && lineWidth + pendingWidth + textWidth > widthLimit) {
|
|
328
|
+
result.push(line);
|
|
329
|
+
result.push('\n');
|
|
330
|
+
line = '';
|
|
331
|
+
lineWidth = 0;
|
|
332
|
+
pendingSpaces = '';
|
|
333
|
+
}
|
|
384
334
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
for (let index = 0; index < size; index += 1) {
|
|
391
|
-
const diff = (leftParts[index] || 0) - (rightParts[index] || 0);
|
|
392
|
-
if (diff !== 0) return diff > 0 ? 1 : -1;
|
|
393
|
-
}
|
|
394
|
-
return 0;
|
|
395
|
-
},
|
|
396
|
-
satisfies(version, range) {
|
|
397
|
-
const v = String(version).replace(/^[^0-9]*/, '');
|
|
398
|
-
const clean = String(range).trim();
|
|
399
|
-
const match = clean.match(/^([><=!^~]+)\s*([0-9][^\s]*)/);
|
|
400
|
-
if (!match) return true;
|
|
401
|
-
const [, op, rv] = match;
|
|
402
|
-
const cmp = semver.order(v, rv);
|
|
403
|
-
if (op === '>=' || op === '=>') return cmp >= 0;
|
|
404
|
-
if (op === '>') return cmp > 0;
|
|
405
|
-
if (op === '<=' || op === '=<') return cmp <= 0;
|
|
406
|
-
if (op === '<') return cmp < 0;
|
|
407
|
-
if (op === '==' || op === '=') return cmp === 0;
|
|
408
|
-
if (op === '!=') return cmp !== 0;
|
|
409
|
-
return true;
|
|
410
|
-
},
|
|
411
|
-
};
|
|
335
|
+
if (lineWidth > 0 && pendingSpaces) {
|
|
336
|
+
line += pendingSpaces;
|
|
337
|
+
lineWidth += pendingWidth;
|
|
338
|
+
}
|
|
339
|
+
pendingSpaces = '';
|
|
412
340
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
const result = {};
|
|
418
|
-
for (const line of lines) {
|
|
419
|
-
const m = line.match(/^([^:#]+):\s*(.*)$/);
|
|
420
|
-
if (m) result[m[1].trim()] = m[2].trim().replace(/^["']|["']$/g, '');
|
|
421
|
-
}
|
|
422
|
-
return result;
|
|
423
|
-
} catch { return {}; }
|
|
424
|
-
},
|
|
425
|
-
stringify(obj) {
|
|
426
|
-
try {
|
|
427
|
-
return Object.entries(obj || {}).map(([k, v]) => `${k}: ${v}`).join('\n') + '\n';
|
|
428
|
-
} catch { return ''; }
|
|
429
|
-
},
|
|
430
|
-
};
|
|
341
|
+
line += text;
|
|
342
|
+
lineWidth += textWidth;
|
|
343
|
+
i = end;
|
|
344
|
+
}
|
|
431
345
|
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
transformSync(code) { return typeof code === 'string' ? code : ''; }
|
|
435
|
-
scanImports(code) {
|
|
436
|
-
const imports = [];
|
|
437
|
-
const reStatic = /(?:^|[^.])import\s+(?:[^'"]+\s+from\s+)?['"]([^'"]+)['"]/gm;
|
|
438
|
-
const reDynamic = /import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
439
|
-
const reRequire = /require\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
440
|
-
let m;
|
|
441
|
-
while ((m = reStatic.exec(String(code))) !== null) imports.push({ path: m[1], kind: 'import-statement' });
|
|
442
|
-
while ((m = reDynamic.exec(String(code))) !== null) imports.push({ path: m[1], kind: 'dynamic-import' });
|
|
443
|
-
while ((m = reRequire.exec(String(code))) !== null) imports.push({ path: m[1], kind: 'require-call' });
|
|
444
|
-
return imports;
|
|
445
|
-
}
|
|
346
|
+
if (pendingSpaces && lineWidth > 0) {
|
|
347
|
+
line += pendingSpaces;
|
|
446
348
|
}
|
|
349
|
+
if (line.length > 0) result.push(line);
|
|
447
350
|
|
|
448
|
-
return
|
|
449
|
-
version: '1.1.8',
|
|
450
|
-
embeddedFiles: [],
|
|
451
|
-
gc: typeof global.gc === 'function' ? () => global.gc() : () => {},
|
|
452
|
-
generateHeapSnapshot: () => Buffer.alloc(0),
|
|
453
|
-
hash,
|
|
454
|
-
listen,
|
|
455
|
-
semver,
|
|
456
|
-
spawn,
|
|
457
|
-
stdin: process.stdin,
|
|
458
|
-
stripANSI,
|
|
459
|
-
stringWidth,
|
|
460
|
-
Terminal: TerminalShim,
|
|
461
|
-
Transpiler,
|
|
462
|
-
which,
|
|
463
|
-
wrapAnsi: value => String(value ?? ''),
|
|
464
|
-
YAML,
|
|
465
|
-
};
|
|
351
|
+
return result.join('');
|
|
466
352
|
}
|
|
467
353
|
|
|
468
354
|
async function main() {
|
|
469
355
|
const extractedFile = ensureEntryFile();
|
|
470
356
|
const code = fs.readFileSync(extractedFile, 'utf8');
|
|
357
|
+
const fn = eval('(' + code);
|
|
471
358
|
|
|
472
359
|
const originalArgv = process.argv.slice();
|
|
473
360
|
const originalExit = process.exit;
|
|
@@ -476,6 +363,7 @@ async function main() {
|
|
|
476
363
|
const originalGlobalBun = globalThis.Bun;
|
|
477
364
|
const asyncErrors = [];
|
|
478
365
|
|
|
366
|
+
const fakeRequire = createFakeRequire(require);
|
|
479
367
|
function onAsyncError(error) {
|
|
480
368
|
asyncErrors.push(error);
|
|
481
369
|
}
|
|
@@ -484,14 +372,29 @@ async function main() {
|
|
|
484
372
|
process.once('uncaughtException', onAsyncError);
|
|
485
373
|
process.once('unhandledRejection', onAsyncError);
|
|
486
374
|
Object.defineProperty(process.versions, 'bun', { value: '1.1.8', configurable: true });
|
|
487
|
-
|
|
488
|
-
|
|
375
|
+
const BunShim = {
|
|
376
|
+
version: '1.1.8',
|
|
377
|
+
stringWidth,
|
|
378
|
+
hash: hashValue,
|
|
379
|
+
which,
|
|
380
|
+
wrapAnsi,
|
|
381
|
+
stripANSI,
|
|
382
|
+
};
|
|
383
|
+
const BunProxy = new Proxy(BunShim, {
|
|
384
|
+
get(target, key, receiver) {
|
|
385
|
+
if (!(key in target) && typeof key !== 'symbol' && debugBunShim) {
|
|
386
|
+
console.error('[BunShim missing]', key);
|
|
387
|
+
}
|
|
388
|
+
return Reflect.get(target, key, receiver);
|
|
389
|
+
},
|
|
390
|
+
});
|
|
391
|
+
globalThis.Bun = BunProxy;
|
|
392
|
+
|
|
489
393
|
process.argv = ['node', extractedFile, ...argv];
|
|
490
394
|
process.exit = code => {
|
|
491
395
|
throw new RequestedExit(code);
|
|
492
396
|
};
|
|
493
397
|
|
|
494
|
-
const fn = eval('(' + code);
|
|
495
398
|
const moduleLike = { exports: {} };
|
|
496
399
|
const maybePromise = fn(moduleLike.exports, fakeRequire, moduleLike, extractedFile, workdir);
|
|
497
400
|
if (maybePromise && typeof maybePromise.then === 'function') await maybePromise;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bash0816/claude-code",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.154-1",
|
|
4
4
|
"description": "Termux-native Claude Code wrapper with audited native replay",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -17,6 +17,6 @@
|
|
|
17
17
|
"README.md"
|
|
18
18
|
],
|
|
19
19
|
"engines": {
|
|
20
|
-
"node": ">=
|
|
20
|
+
"node": ">=18"
|
|
21
21
|
}
|
|
22
22
|
}
|