zames_pro 2.53.0 → 2.53.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/attachments.js +2 -1
- package/dist/config.js +10 -3
- package/dist/i18n.js +1 -1
- package/dist/self-review.js +2 -1
- package/dist/undo.js +4 -1
- package/package.json +1 -2
package/dist/attachments.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from 'fs/promises';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import os from 'os';
|
|
4
|
+
import { existsSync } from 'fs';
|
|
4
5
|
import { createHash } from 'crypto';
|
|
5
6
|
import { execFileSync } from 'child_process';
|
|
6
7
|
import { extractPathToken } from './path-token.js';
|
|
@@ -233,7 +234,7 @@ export function windowsReachable() {
|
|
|
233
234
|
if (process.platform !== 'linux')
|
|
234
235
|
return false;
|
|
235
236
|
try {
|
|
236
|
-
return
|
|
237
|
+
return existsSync('/mnt/c/Windows');
|
|
237
238
|
}
|
|
238
239
|
catch {
|
|
239
240
|
return false;
|
package/dist/config.js
CHANGED
|
@@ -10,6 +10,13 @@ const HOME_CONFIG = path.join(ZAMES_HOME, 'config.json');
|
|
|
10
10
|
export function projectConfigPath() {
|
|
11
11
|
return path.join(process.cwd(), '.zamesrc.json');
|
|
12
12
|
}
|
|
13
|
+
// Write via a temp file + rename so a crash or Ctrl+C mid-write can never
|
|
14
|
+
// leave a truncated/broken config (it is read at every startup).
|
|
15
|
+
function atomicWriteJson(file, value) {
|
|
16
|
+
const tmp = `${file}.tmp-${process.pid}`;
|
|
17
|
+
fs.writeFileSync(tmp, JSON.stringify(value, null, 2) + '\n', 'utf-8');
|
|
18
|
+
fs.renameSync(tmp, file);
|
|
19
|
+
}
|
|
13
20
|
export const DEFAULTS = {
|
|
14
21
|
maxIterations: 0,
|
|
15
22
|
// Headless by default: the browser runs without a visible window. Set
|
|
@@ -426,7 +433,7 @@ export function readConfigFile(file) {
|
|
|
426
433
|
catch (e) {
|
|
427
434
|
const err = e;
|
|
428
435
|
if (err.code !== 'ENOENT') {
|
|
429
|
-
throw new Error(
|
|
436
|
+
throw new Error(`failed to read ${file}: ${err.message}`);
|
|
430
437
|
}
|
|
431
438
|
}
|
|
432
439
|
return {};
|
|
@@ -444,7 +451,7 @@ export function writeConfigValue(scope, key, raw) {
|
|
|
444
451
|
const data = readConfigFile(file);
|
|
445
452
|
setByPath(data, key, value);
|
|
446
453
|
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
447
|
-
|
|
454
|
+
atomicWriteJson(file, data);
|
|
448
455
|
return { value, file };
|
|
449
456
|
}
|
|
450
457
|
/** Reset a setting to the default (remove the key from the file). */
|
|
@@ -467,7 +474,7 @@ export function resetConfigValue(scope, key) {
|
|
|
467
474
|
if (cur)
|
|
468
475
|
delete cur[parts[parts.length - 1]];
|
|
469
476
|
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
470
|
-
|
|
477
|
+
atomicWriteJson(file, data);
|
|
471
478
|
return file;
|
|
472
479
|
}
|
|
473
480
|
// 'PROJECT_CONFIG' stays a getter so existing callers that only DISPLAY the
|
package/dist/i18n.js
CHANGED
|
@@ -26,7 +26,7 @@ export function normalizeLocale(v) {
|
|
|
26
26
|
return DEFAULT_LOCALE;
|
|
27
27
|
}
|
|
28
28
|
// String catalog. Key -> { ru, en }. If a key is missing — we return the key itself.
|
|
29
|
-
const CATALOG = {
|
|
29
|
+
export const CATALOG = {
|
|
30
30
|
'app.tagline': {
|
|
31
31
|
ru: 'агент поверх chat.deepseek.com через Playwright',
|
|
32
32
|
en: 'coding agent over chat.deepseek.com via Playwright',
|
package/dist/self-review.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import fs from 'fs/promises';
|
|
3
|
+
import { readdirSync } from 'fs';
|
|
3
4
|
import { theme, divider } from './theme.js';
|
|
4
5
|
import { translate, DEFAULT_LOCALE } from './i18n.js';
|
|
5
6
|
import { fileURLToPath } from 'url';
|
|
@@ -13,7 +14,7 @@ function resolveSrcDir() {
|
|
|
13
14
|
const candidates = [__dirname, path.join(__dirname, '..', 'src')];
|
|
14
15
|
for (const dir of candidates) {
|
|
15
16
|
try {
|
|
16
|
-
const entries =
|
|
17
|
+
const entries = readdirSync(dir);
|
|
17
18
|
if (entries.some((e) => e.endsWith('.ts')))
|
|
18
19
|
return dir;
|
|
19
20
|
}
|
package/dist/undo.js
CHANGED
|
@@ -22,7 +22,10 @@ export class UndoStore {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
async _writeIndex(history) {
|
|
25
|
-
|
|
25
|
+
// Atomic write: a crash mid-write must not corrupt the undo history.
|
|
26
|
+
const tmp = `${INDEX}.tmp-${process.pid}`;
|
|
27
|
+
await fs.writeFile(tmp, JSON.stringify(history, null, 2));
|
|
28
|
+
await fs.rename(tmp, INDEX);
|
|
26
29
|
}
|
|
27
30
|
async backup(filePath) {
|
|
28
31
|
if (!this.enabled)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zames_pro",
|
|
3
|
-
"version": "2.53.
|
|
3
|
+
"version": "2.53.1",
|
|
4
4
|
"description": "Terminal coding agent over chat.deepseek.com via Playwright",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
"chalk": "^5.3.0",
|
|
46
46
|
"cli-highlight": "^2.1.11",
|
|
47
47
|
"markdansi": "^0.3.4",
|
|
48
|
-
"marked": "^15.0.12",
|
|
49
48
|
"ora": "^8.0.1",
|
|
50
49
|
"playwright": "^1.48.0"
|
|
51
50
|
},
|