martty 0.2.32 → 0.2.34

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/lib/tui-theme.js CHANGED
@@ -7,7 +7,7 @@
7
7
  * flushed from `bindNotify`.
8
8
  */
9
9
 
10
- import { mkdirSync, readFileSync, writeFileSync } from 'node:fs'
10
+ import { mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs'
11
11
  import { dirname, isAbsolute } from 'node:path'
12
12
  import { CORDIS_METHODS } from './cordis-protocol.js'
13
13
 
@@ -92,7 +92,12 @@ function writePreferred(settingsPath, id) {
92
92
  const settings = readSettings(settingsPath)
93
93
  settings.theme = id
94
94
  mkdirSync(dirname(settingsPath), { recursive: true })
95
- writeFileSync(settingsPath, `${JSON.stringify(settings, null, 2)}\n`)
95
+ // Atomic write (temp + rename), matching harnesses.writeSettings: a
96
+ // crash mid-write must never leave a truncated settings.json behind —
97
+ // every later launch would otherwise start from an unreadable file.
98
+ const temporary = `${settingsPath}.${process.pid}.${Date.now()}.tmp`
99
+ writeFileSync(temporary, `${JSON.stringify(settings, null, 2)}\n`)
100
+ renameSync(temporary, settingsPath)
96
101
  }
97
102
 
98
103
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "martty",
3
- "version": "0.2.32",
3
+ "version": "0.2.34",
4
4
  "description": "Terminal-native ACP client UI; Cordis client tree, any ACP agent",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -75,7 +75,7 @@
75
75
  },
76
76
  "dependencies": {
77
77
  "@deepseek-ai/cordis": "^4.0.1",
78
- "@openma/deepseek-harness-acp": "0.4.27"
78
+ "@openma/deepseek-harness-acp": "0.4.29"
79
79
  },
80
80
  "devDependencies": {
81
81
  "@deepseek-ai/dsh": "0.1.1-rc.2"
Binary file
Binary file
Binary file
Binary file
Binary file