mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-30 05:43:55 +00:00
3.1 KiB
3.1 KiB
tfcode Progress Summary
Goal
Build and deploy tfcode - ToothFairyAI's official AI coding agent, a fork of opencode.
Completed Tasks
- ✅ Implemented ToothFairyAI branding (logo, colors, strings)
- ✅ Created ToothFairyAI provider with dynamic model fetching
- ✅ Synced tools/agents/skills from ToothFairyAI workspace
- ✅ Filtered models to only
deploymentType: "serverless" - ✅ Implemented the
/predictionsendpoint for ToothFairyAI provider - ✅ Added
tfcode setupcommand to persist credentials - ✅ Fixed npm installation flow (v1.0.4)
- Binary now included in main npm package
- Postinstall script checks if binary exists before downloading
- ESM-compatible module resolution for npm fallback
- Wrapper script fixed to look for binary in correct location
Current Status
Working: npm installation flow is now fully functional. Users can install via:
npm install @toothfairyai/tfcode
The binary is included in the main package, making installation instant without needing to download from Gitea or copy from optionalDependencies.
Next Steps
- Build all platform binaries (12 targets: linux/darwin/windows × arm64/x64 × baseline/musl)
- Test on different platforms (currently only darwin-arm64 is tested)
- Create Gitea releases for backup download mechanism
- Consider making Gitea repo public for transparency
Technical Details
npm Package Structure
The published package includes:
bin/tfcode- The actual binary (92MB)bin/tfcode.js- Wrapper script that spawns the binarypostinstall.mjs- Installation script (checks for binary, downloads if missing, installs Python SDK)package.json- Package metadataLICENSE- MIT license
Installation Flow
- npm installs main package + optionalDependencies
- npm extracts files to
node_modules/@toothfairyai/tfcode/ - postinstall runs:
- Checks if binary already exists (✓ for darwin-arm64)
- If not, tries to download from Gitea
- If that fails, copies from optionalDependencies
- Installs Python SDK for TF integration
- User can run
tfcodecommand
Key Fixes in v1.0.4
- Postinstall script: Fixed duplicate variable declaration (
binaryName) - Postinstall script: Added early return if binary already exists
- Postinstall script: Fixed ESM module resolution (replaced
require.resolvewithimport.meta.resolve) - Publish script: Copy current platform binary to main package
- Wrapper script: Fixed binary path (removed extra
bin/directory)
Testing
# Fresh installation test
rm -rf /tmp/tfcode-test && mkdir /tmp/tfcode-test
cd /tmp/tfcode-test && npm init -y
npm install @toothfairyai/tfcode
node_modules/.bin/tfcode --version # Should output: 1.0.4
Version History
- 1.0.4: Fixed npm installation flow, binary included in main package
- 1.0.3: Initial npm publication (broken installation)
- 1.0.2: Earlier testing versions
- 1.0.0: Initial release
Credentials (Testing Only)
- workspace_id:
6586b7e6-683e-4ee6-a6cf-24c19729b5ff - api_key:
EWZooLROIS57EVW3BKGu7Pv6LNe4D6m4gkDjukx3 - region:
dev