francois 0.51.0 → 0.53.0

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/README.md CHANGED
@@ -3,9 +3,12 @@
3
3
  **Mission control for your Claude Code fleet** — installed without an installer.
4
4
 
5
5
  ```sh
6
- npm i -g francois
6
+ npm i -g francois --allowed-scripts=francois
7
7
  ```
8
8
 
9
+ `--allowed-scripts=francois` lets npm run this package's postinstall, which is
10
+ what installs the app — without it npm installs only the launcher.
11
+
9
12
  Then launch it **from the Start Menu, Launchpad or your applications menu** like
10
13
  any other app — or type `francois` in a terminal, whichever you prefer.
11
14
 
@@ -66,7 +69,7 @@ Environment: `FRANCOIS_SKIP_DOWNLOAD=1` skips the postinstall download,
66
69
 
67
70
  Node version managers keep global npm packages in separate directories. After
68
71
  switching Node versions, a shortcut or taskbar pin can still open the previous
69
- copy even though `npm i -g francois` updated the active one.
72
+ copy even though `npm i -g francois@latest --allowed-scripts=francois` updated the active one.
70
73
 
71
74
  Finish your sessions and quit Francois, then run `francois` in the terminal where
72
75
  you installed the update. Run `francois shortcut` there to refresh the desktop
package/bin/francois.js CHANGED
@@ -199,7 +199,7 @@ function main() {
199
199
  // run somewhere the desktop wasn't reachable (SSH, a container, a CI image).
200
200
  if (argv[0] === 'shortcut') {
201
201
  const record = readInstallRecord();
202
- if (!record) die('nothing is installed yet — run `npm i -g francois` first.');
202
+ if (!record) die('nothing is installed yet — run `npm i -g francois --allowed-scripts=francois` first.');
203
203
 
204
204
  if (argv.includes('--remove')) {
205
205
  desktop.remove(record);
@@ -239,7 +239,7 @@ function main() {
239
239
  'Build from source: https://github.com/antoine-gmnz/francois#build-from-source',
240
240
  );
241
241
  }
242
- die('the app payload is missing — reinstall with `npm i -g francois`.');
242
+ die('the app payload is missing — reinstall with `npm i -g francois@latest --allowed-scripts=francois`.');
243
243
  }
244
244
 
245
245
  warnIfWebView2Missing();
package/install.js CHANGED
@@ -3,7 +3,8 @@
3
3
 
4
4
  /**
5
5
  * postinstall — fetch this platform's Francois build from its GitHub release and
6
- * unpack it into vendor/.
6
+ * unpack it: into %LOCALAPPDATA%\francois on Windows (see payloadDir), vendor/
7
+ * elsewhere. vendor/ always holds the install record.
7
8
  *
8
9
  * Why this package exists at all: Windows SmartScreen and macOS Gatekeeper key
9
10
  * off the Mark-of-the-Web / com.apple.quarantine attribute that a *browser*
@@ -27,6 +28,8 @@ const desktop = require('./lib/desktop.js');
27
28
  const {
28
29
  VENDOR_DIR,
29
30
  assetKey,
31
+ payloadDir,
32
+ prunePayloads,
30
33
  readManifest,
31
34
  resolveExecutable,
32
35
  supportedList,
@@ -135,6 +138,26 @@ function extract(archive, dest) {
135
138
  }
136
139
  }
137
140
 
141
+ /**
142
+ * An empty directory to unpack into. vendor/ is ours to wipe; a per-version
143
+ * payload that cannot be wiped (a leftover process from the same version still
144
+ * holds it) is sidestepped with a suffixed sibling instead of failing the install.
145
+ */
146
+ function freshPayloadDir(dir) {
147
+ if (dir !== VENDOR_DIR) {
148
+ try {
149
+ fs.rmSync(dir, { recursive: true, force: true });
150
+ } catch {
151
+ dir = `${dir}-${Date.now()}`;
152
+ }
153
+ } else {
154
+ // The install record is rewritten below; the old payload goes.
155
+ fs.rmSync(dir, { recursive: true, force: true });
156
+ }
157
+ fs.mkdirSync(dir, { recursive: true });
158
+ return dir;
159
+ }
160
+
138
161
  async function main() {
139
162
  if (process.env.FRANCOIS_SKIP_DOWNLOAD) {
140
163
  log('FRANCOIS_SKIP_DOWNLOAD set — skipping the app download.');
@@ -154,7 +177,7 @@ async function main() {
154
177
  if (!manifest || !manifest.assets || !manifest.assets[key]) {
155
178
  fail(
156
179
  'this package has no release manifest, so there is nothing to download.\n' +
157
- 'That means it was not built by CI — install the published package with `npm i -g francois`.',
180
+ 'That means it was not built by CI — install the published package with `npm i -g francois --allowed-scripts=francois`.',
158
181
  );
159
182
  }
160
183
 
@@ -179,17 +202,17 @@ async function main() {
179
202
  );
180
203
  }
181
204
 
182
- fs.rmSync(VENDOR_DIR, { recursive: true, force: true });
183
205
  fs.mkdirSync(VENDOR_DIR, { recursive: true });
184
- extract(archive, VENDOR_DIR);
206
+ const target = freshPayloadDir(payloadDir({ version: manifest.appVersion, channel: manifest.channel }));
207
+ extract(archive, target);
185
208
 
186
209
  if (process.platform === 'darwin') {
187
210
  // Belt and braces: npm downloads never carry com.apple.quarantine, but a
188
211
  // user-supplied FRANCOIS_DOWNLOAD_BASE or a proxy could. Best-effort.
189
- spawnSync('xattr', ['-dr', 'com.apple.quarantine', VENDOR_DIR], { stdio: 'ignore' });
212
+ spawnSync('xattr', ['-dr', 'com.apple.quarantine', target], { stdio: 'ignore' });
190
213
  }
191
214
 
192
- const unpacked = resolveExecutable();
215
+ const unpacked = resolveExecutable(target);
193
216
  if (!unpacked) fail(`the ${asset.name} archive did not contain the app.`);
194
217
 
195
218
  // Register with the OS so Francois launches from the Start Menu / Launchpad /
@@ -214,6 +237,10 @@ async function main() {
214
237
  tag: manifest.tag,
215
238
  });
216
239
 
240
+ // Older versions' payloads, now that nothing points at them. Anything still
241
+ // pinned by a live process stays until the next install.
242
+ if (target !== VENDOR_DIR) prunePayloads(path.dirname(target), target);
243
+
217
244
  log('installed.');
218
245
  for (const note of integration.notes) log(` ${note}`);
219
246
  log(' terminal: francois');
package/lib/desktop.js CHANGED
@@ -23,6 +23,8 @@ const os = require('node:os');
23
23
  const path = require('node:path');
24
24
  const { spawnSync } = require('node:child_process');
25
25
 
26
+ const { windowsAppRoot } = require('./platform.js');
27
+
26
28
  const ICON_SOURCE = path.join(__dirname, '..', 'assets', 'icon.png');
27
29
 
28
30
  /**
@@ -177,11 +179,22 @@ function installWindows({ executable, productName, channel, appVersion, notes })
177
179
  if (!registered) notes.push('could not register the notification identity — toasts may not show.');
178
180
  }
179
181
 
180
- function removeWindows({ productName, channel }) {
182
+ function removeWindows({ productName, channel, localAppData }) {
181
183
  const shortcut = startMenuShortcut(productName);
182
184
  if (shortcut) fs.rmSync(shortcut, { force: true });
183
185
  attempt('reg', ['delete', uninstallRegistryKey(channel), '/f']);
184
186
  attempt('reg', ['delete', aumidRegistryKey(channel), '/f']);
187
+ // The payload lives outside the package (platform.windowsAppRoot), so npm
188
+ // deleting the package no longer takes the app with it. Last, and on its own:
189
+ // a still-running app keeps it locked, which must not undo the rest.
190
+ const root = windowsAppRoot(channel, localAppData);
191
+ if (root) {
192
+ try {
193
+ fs.rmSync(root, { recursive: true, force: true });
194
+ } catch {
195
+ // In use — left behind rather than failing the uninstall.
196
+ }
197
+ }
185
198
  }
186
199
 
187
200
  /** Single-quoted PowerShell literal — no expansion, '' escapes a quote. */
@@ -278,9 +291,16 @@ function install({
278
291
  }
279
292
 
280
293
  /** Undo install(). Safe to call when nothing was ever registered. */
281
- function remove({ bundle, productName, channel, platform = process.platform, home = os.homedir() }) {
294
+ function remove({
295
+ bundle,
296
+ productName,
297
+ channel,
298
+ platform = process.platform,
299
+ home = os.homedir(),
300
+ localAppData = process.env.LOCALAPPDATA,
301
+ }) {
282
302
  try {
283
- if (platform === 'win32') removeWindows({ productName, channel });
303
+ if (platform === 'win32') removeWindows({ productName, channel, localAppData });
284
304
  else if (platform === 'darwin') removeMacos({ bundle, home });
285
305
  else if (platform === 'linux') removeLinux({ channel, home });
286
306
  return true;
package/lib/platform.js CHANGED
@@ -66,6 +66,62 @@ function writeInstallRecord(record, vendorDir = VENDOR_DIR) {
66
66
  fs.writeFileSync(path.join(vendorDir, INSTALL_RECORD), `${JSON.stringify(record, null, 2)}\n`);
67
67
  }
68
68
 
69
+ /**
70
+ * Where the app itself lives on Windows: `%LOCALAPPDATA%\francois` (or
71
+ * `francois-dev`), NOT vendor/.
72
+ *
73
+ * npm replaces this package by renaming its directory, and on Windows a rename
74
+ * fails with EBUSY while ANY process holds a handle inside it. A running app's
75
+ * image is such a handle, and so is the working directory of every process it
76
+ * leaves behind — orphaned ConPTY `conhost.exe`s sat in vendor/ and turned every
77
+ * `npm i -g francois` after them into EBUSY. Outside the package, nothing the
78
+ * app does can block npm. null when LOCALAPPDATA is unset.
79
+ */
80
+ function windowsAppRoot(channel, localAppData = process.env.LOCALAPPDATA) {
81
+ if (!localAppData) return null;
82
+ return path.join(localAppData, channel === 'dev' ? 'francois-dev' : 'francois');
83
+ }
84
+
85
+ const PAYLOAD_PREFIX = 'app-';
86
+
87
+ /**
88
+ * The directory a version unpacks into. One per version, so a payload some
89
+ * leftover process still pins never blocks installing the next one — it is
90
+ * merely left for a later prune (see prunePayloads). Everywhere but Windows the
91
+ * payload stays in vendor/: nothing there holds a directory against a rename.
92
+ */
93
+ function payloadDir({ version, channel, platform = process.platform, localAppData = process.env.LOCALAPPDATA }) {
94
+ if (platform !== 'win32') return VENDOR_DIR;
95
+ const root = windowsAppRoot(channel, localAppData);
96
+ return root ? path.join(root, `${PAYLOAD_PREFIX}${version}`) : VENDOR_DIR;
97
+ }
98
+
99
+ /**
100
+ * Best-effort removal of every payload under `root` except `keep`. A payload
101
+ * still pinned by a live process fails to delete and is simply tried again on
102
+ * the next install. Returns the directories it removed.
103
+ */
104
+ function prunePayloads(root, keep) {
105
+ let entries;
106
+ try {
107
+ entries = fs.readdirSync(root);
108
+ } catch {
109
+ return [];
110
+ }
111
+ const removed = [];
112
+ for (const entry of entries) {
113
+ const dir = path.join(root, entry);
114
+ if (!entry.startsWith(PAYLOAD_PREFIX) || path.resolve(dir) === path.resolve(keep)) continue;
115
+ try {
116
+ fs.rmSync(dir, { recursive: true, force: true });
117
+ removed.push(dir);
118
+ } catch {
119
+ // Still in use — next install.
120
+ }
121
+ }
122
+ return removed;
123
+ }
124
+
69
125
  /**
70
126
  * Locate the runnable binary. Prefers what the postinstall recorded; falls back
71
127
  * to scanning vendor/ so a payload unpacked by hand still runs.
@@ -113,9 +169,12 @@ module.exports = {
113
169
  SUPPORTED,
114
170
  VENDOR_DIR,
115
171
  assetKey,
172
+ payloadDir,
173
+ prunePayloads,
116
174
  readInstallRecord,
117
175
  readManifest,
118
176
  resolveExecutable,
119
177
  supportedList,
178
+ windowsAppRoot,
120
179
  writeInstallRecord,
121
180
  };
package/manifest.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "repo": "antoine-gmnz/francois",
3
- "tag": "v0.51.0",
3
+ "tag": "v0.53.0",
4
4
  "channel": "stable",
5
- "appVersion": "0.51.0",
5
+ "appVersion": "0.53.0",
6
6
  "productName": "Francois",
7
7
  "assets": {
8
- "darwin-universal": { "name": "francois-darwin-universal.tar.gz", "sha256": "1ace5c4b79958b55ad2a5c7a9678867ff785d83ec3ee6dd57e6ea325e3a970ca" },
9
- "linux-x64": { "name": "francois-linux-x64.tar.gz", "sha256": "6fa46ee094200a780d25fd74b68091388504cf8c2e4f2a9ee1881fa1fc49a69c" },
10
- "win32-x64": { "name": "francois-win32-x64.zip", "sha256": "1f6a888c3d853d64415bbe671df499b61cd96a68d2e6b3552e1e8c47dc75e6c9" }
8
+ "darwin-universal": { "name": "francois-darwin-universal.tar.gz", "sha256": "7c976e51bffbb49e3f150e8a466f37ed269976df973d660bb0cd9dc5bfe7413c" },
9
+ "linux-x64": { "name": "francois-linux-x64.tar.gz", "sha256": "71795575e40088373405b21f09bbbb5e0cd67f438cbdc49a4135fff2f33842e2" },
10
+ "win32-x64": { "name": "francois-win32-x64.zip", "sha256": "1df4551aa59b9845bbbac0f41f071fed5c903a37afa397af6496de9aa5901273" }
11
11
  }
12
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "francois",
3
- "version": "0.51.0",
3
+ "version": "0.53.0",
4
4
  "description": "Mission control for your Claude Code fleet — installs the Francois desktop app without an installer.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "author": "Antoine Gimenez",