@toothfairyai/tfcode 2.4.3 → 2.5.0-beta.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.
Files changed (2) hide show
  1. package/package.json +13 -13
  2. package/postinstall.mjs +37 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toothfairyai/tfcode",
3
- "version": "2.4.3",
3
+ "version": "2.5.0-beta.0",
4
4
  "bin": {
5
5
  "tfcode": "./bin/tfcode.js"
6
6
  },
@@ -9,18 +9,18 @@
9
9
  },
10
10
  "license": "MIT",
11
11
  "optionalDependencies": {
12
- "@toothfairyai/tfcode-linux-arm64": "2.4.3",
13
- "@toothfairyai/tfcode-windows-x64": "2.4.3",
14
- "@toothfairyai/tfcode-linux-x64-baseline-musl": "2.4.3",
15
- "@toothfairyai/tfcode-darwin-x64-baseline": "2.4.3",
16
- "@toothfairyai/tfcode-linux-x64-musl": "2.4.3",
17
- "@toothfairyai/tfcode-windows-x64-baseline": "2.4.3",
18
- "@toothfairyai/tfcode-linux-arm64-musl": "2.4.3",
19
- "@toothfairyai/tfcode-windows-arm64": "2.4.3",
20
- "@toothfairyai/tfcode-linux-x64": "2.4.3",
21
- "@toothfairyai/tfcode-darwin-x64": "2.4.3",
22
- "@toothfairyai/tfcode-linux-x64-baseline": "2.4.3",
23
- "@toothfairyai/tfcode-darwin-arm64": "2.4.3"
12
+ "@toothfairyai/tfcode-linux-arm64": "2.5.0-beta.0",
13
+ "@toothfairyai/tfcode-windows-x64": "2.5.0-beta.0",
14
+ "@toothfairyai/tfcode-linux-x64-baseline-musl": "2.5.0-beta.0",
15
+ "@toothfairyai/tfcode-darwin-x64-baseline": "2.5.0-beta.0",
16
+ "@toothfairyai/tfcode-linux-x64-musl": "2.5.0-beta.0",
17
+ "@toothfairyai/tfcode-windows-x64-baseline": "2.5.0-beta.0",
18
+ "@toothfairyai/tfcode-linux-arm64-musl": "2.5.0-beta.0",
19
+ "@toothfairyai/tfcode-windows-arm64": "2.5.0-beta.0",
20
+ "@toothfairyai/tfcode-linux-x64": "2.5.0-beta.0",
21
+ "@toothfairyai/tfcode-darwin-x64": "2.5.0-beta.0",
22
+ "@toothfairyai/tfcode-linux-x64-baseline": "2.5.0-beta.0",
23
+ "@toothfairyai/tfcode-darwin-arm64": "2.5.0-beta.0"
24
24
  },
25
25
  "engines": {
26
26
  "node": ">=18"
package/postinstall.mjs CHANGED
@@ -139,6 +139,7 @@ async function downloadBinary() {
139
139
  fs.cpSync(srcAppDir, targetAppDir, { recursive: true })
140
140
  console.log("✓ Web app copied from platform package")
141
141
  }
142
+ copyComputerAssets(path.join(pkgDir, "bin"), binDir)
142
143
  } catch (e) {
143
144
  console.log(`! Could not copy web app: ${e.message}`)
144
145
  }
@@ -240,10 +241,31 @@ async function downloadBinary() {
240
241
  console.log("Installed web app")
241
242
  }
242
243
 
244
+ // Move bundled computer-use helpers (cliclick on macOS, if archived)
245
+ copyComputerAssets(tmpDir, binDir)
246
+
243
247
  // Cleanup
244
248
  fs.rmSync(tmpDir, { recursive: true, force: true })
245
249
  }
246
250
 
251
+ // Copy bundled computer-use helper binaries (e.g. cliclick on macOS) from a
252
+ // source bin dir into the installed bin dir, so `tfcode computer setup` finds
253
+ // them next to the binary without Homebrew/apt. No-op when absent. npm may
254
+ // strip the exec bit, so chmod the helpers back to 0755.
255
+ function copyComputerAssets(srcBinDir, dstBinDir) {
256
+ const srcComputer = path.join(srcBinDir, "computer")
257
+ if (!fs.existsSync(srcComputer)) return
258
+ const dstComputer = path.join(dstBinDir, "computer")
259
+ if (fs.existsSync(dstComputer)) fs.rmSync(dstComputer, { recursive: true, force: true })
260
+ fs.cpSync(srcComputer, dstComputer, { recursive: true })
261
+ for (const name of fs.readdirSync(dstComputer)) {
262
+ try {
263
+ fs.chmodSync(path.join(dstComputer, name), 0o755)
264
+ } catch {}
265
+ }
266
+ console.log("✓ Computer-use helpers copied from platform package")
267
+ }
268
+
247
269
  function setupBinary(sourcePath, platform) {
248
270
  const binDir = path.join(__dirname, "bin")
249
271
  const binaryName = platform === "windows" ? "tfcode.exe" : "tfcode"
@@ -271,6 +293,8 @@ function setupBinary(sourcePath, platform) {
271
293
  fs.cpSync(srcAppDir, targetAppDir, { recursive: true })
272
294
  console.log("Web app copied from platform package")
273
295
  }
296
+ // Also copy bundled computer-use helpers (cliclick on macOS) if present.
297
+ copyComputerAssets(sourceDir, binDir)
274
298
  }
275
299
 
276
300
  async function main() {
@@ -334,6 +358,19 @@ async function main() {
334
358
  console.log(" 4. Start coding:")
335
359
  console.log(" tfcode")
336
360
  console.log("")
361
+ // Optional feature — keep it short and clearly labeled so the coding-first
362
+ // Quick Start isn't noised up. Point npm installers at the one-command setup.
363
+ const cuPlatform = os.platform()
364
+ const cuHint =
365
+ cuPlatform === "darwin"
366
+ ? "a permissions dialog will appear (Accessibility & Screen Recording); cliclick is bundled."
367
+ : cuPlatform === "win32"
368
+ ? "no extra installs needed — pre-compiles the input helper."
369
+ : "installs xdotool + a screenshot tool via your package manager."
370
+ console.log(" Computer use (optional — control the OS GUI: mouse, keyboard, screen):")
371
+ console.log(" tfcode computer setup " + cuHint)
372
+ console.log(" tfcode computer doctor verify it works")
373
+ console.log("")
337
374
  console.log("Documentation: https://toothfairyai.com/developers/tfcode")
338
375
  console.log("")
339
376
  }