@nightowne/tas-cli 3.0.1 → 3.0.2

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/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  All notable changes to TAS (Telegram as Storage) will be documented in this file.
4
4
 
5
+ ## [3.0.2] - 2026-09-25
6
+
7
+ ### Fixed — Apple Silicon install recovery
8
+ - **Optional native source recovery** — if the legacy optional addon fails before TAS can patch it on arm64, postinstall restores only its source without lifecycle scripts, then rebuilds it against the user's installed macFUSE library. Failed rebuilds still leave every non-mount TAS command usable.
9
+
5
10
  ## [3.0.1] - 2026-09-25
6
11
 
7
12
  ### Fixed — current macFUSE mount support (#4)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nightowne/tas-cli",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "Experimental local-first encrypted file transport over Telegram bots with resumable chunks, index recovery, and FUSE mount",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -84,6 +84,23 @@ function getDarwinLibraryDirectory (packageRoot) {
84
84
  }
85
85
  }
86
86
 
87
+ function installOptionalFuseNative (packageRoot) {
88
+ const npmCli = process.env.npm_execpath
89
+ if (!npmCli) return { ok: false, reason: 'npm did not provide its install executable' }
90
+
91
+ const install = childProcess.spawnSync(
92
+ process.execPath,
93
+ [npmCli, 'install', 'fuse-native@2.2.6', '--no-save', '--ignore-scripts', '--no-package-lock'],
94
+ {
95
+ cwd: packageRoot,
96
+ stdio: 'inherit',
97
+ env: { ...process.env, npm_config_ignore_scripts: 'true' }
98
+ }
99
+ )
100
+ if (install.status !== 0) return { ok: false, reason: 'could not restore optional fuse-native source' }
101
+ return { ok: true }
102
+ }
103
+
87
104
  function validateMacFuseNativeBinding ({
88
105
  packageRoot = path.resolve(__dirname, '..', '..'),
89
106
  exists = fs.existsSync,
@@ -184,8 +201,20 @@ function installMacFuseAdapter ({
184
201
  return { skipped: true, ...installation }
185
202
  }
186
203
 
187
- const fuseNativeDir = getFuseNativeDirectory(packageRoot)
188
- const darwinLibraryDir = getDarwinLibraryDirectory(packageRoot)
204
+ let fuseNativeDir = getFuseNativeDirectory(packageRoot)
205
+ let darwinLibraryDir = getDarwinLibraryDirectory(packageRoot)
206
+ if (!fuseNativeDir || !darwinLibraryDir) {
207
+ // The legacy optional addon can fail to build on arm64 before our root
208
+ // postinstall runs. Restore its source without lifecycle scripts, then
209
+ // patch and rebuild it against the system macFUSE library below.
210
+ const restored = installOptionalFuseNative(packageRoot)
211
+ if (!restored.ok) {
212
+ log.warn(`[tas] macOS FUSE was not built: ${restored.reason}`)
213
+ return { ready: false, reason: restored.reason }
214
+ }
215
+ fuseNativeDir = getFuseNativeDirectory(packageRoot)
216
+ darwinLibraryDir = getDarwinLibraryDirectory(packageRoot)
217
+ }
189
218
  if (!fuseNativeDir || !darwinLibraryDir) {
190
219
  const reason = 'optional fuse-native dependencies are not installed'
191
220
  log.warn(`[tas] macOS FUSE was not built: ${reason}`)
@@ -228,6 +257,7 @@ module.exports = {
228
257
  MACFUSE_BUNDLE,
229
258
  findMacFuseInstallation,
230
259
  getFuseNativeDirectory,
260
+ installOptionalFuseNative,
231
261
  validateMacFuseNativeBinding,
232
262
  installMacFuseAdapter
233
263
  }