Self-improving AI Employees for everyone
Python ai-agentsai-employeeai-employeesassistantautonomous-agentsco-employeescompanygrok-botinstinctloop-agentsmuseown-your-datapersonalself-hosted
Fix npm publish: use OIDC trusted publishing, build all services, reduce package size
trohitg2b4eb377d730
diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.ymlindex bef5814b..3d64393e 100644--- a/.github/workflows/npm-publish.yml+++ b/.github/workflows/npm-publish.yml@@ -1,27 +1,23 @@-# Publish to npm registry when a version tag is pushed+# Publish to npm registry using OIDC Trusted Publishing+# No npm token required - uses GitHub OIDC authentication#-# NOTE: npm now requires Granular Access Tokens (classic tokens revoked)-# - Granular tokens require 2FA and expire after 90 days max-# - Create token at: https://www.npmjs.com/settings/YOUR_USERNAME/tokens-# - Select "Granular Access Token" with publish permissions for this package-# - Add as NPM_TOKEN secret in GitHub repo settings-# - Remember to rotate before expiry (max 90 days)+# Setup: Go to npmjs.com → Package Settings → Trusted Publishers+# Add: Owner: trohitg, Repo: MachinaOS, Workflow: npm-publish.yml+#+# Reference: https://docs.npmjs.com/trusted-publishers/name: Publish to npmon:- # Trigger on version tags (e.g., v0.0.1, v1.2.3)push:tags:- 'v*.*.*'- # Also trigger on published releasesrelease:types: [published]- # Allow manual triggerworkflow_dispatch:jobs:- publish-npm:+ publish:runs-on: ubuntu-latestpermissions:contents: read@@ -36,16 +32,21 @@ jobs:node-version: '20'registry-url: 'https://registry.npmjs.org'- - name: Install root dependencies- run: npm ci+ - name: Setup Python+ uses: actions/setup-python@v5+ with:+ python-version: '3.12'++ - name: Setup Go+ uses: actions/setup-go@v5+ with:+ go-version: '1.21'- - name: Install client dependencies- run: cd client && npm ci+ - name: Install uv+ run: curl -LsSf https://astral.sh/uv/install.sh | sh && echo "$HOME/.cargo/bin" >> $GITHUB_PATH- - name: Build client- run: cd client && npm run build+ - name: Build all services+ run: npm run build- name: Publish to npm- run: npm publish --access public- env:- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}+ run: npm publish --access public --provenancediff --git a/.npmignore b/.npmignoreindex 1898b3d4..573c88c8 100644--- a/.npmignore+++ b/.npmignore@@ -1,3 +1,7 @@+# ===========================================+# npmignore - Files to exclude from npm package+# ===========================================+# Git.git/.gitignore@@ -7,30 +11,40 @@.env.env.*!.env.template++# Database files*.db*.sqlite*.db-journal*.db-shm*.db-wal-data/-# Python virtual environment-.venv/-venv/+# Python cache and virtual env (all locations)__pycache__/+**/__pycache__/*.pyc+**/*.pyc*.pyo+**/*.pyo+.venv/+venv/+**/.venv/+**/venv/*.egg-info/-# Node modules (installed on user's machine)+# Server data directories+server/data/++# Node modules (all locations)node_modules/**/node_modules/-client/node_modules/-server/whatsapp-rpc/node_modules/# Vite cache+.vite/**/.vite/-client/.vite/++# Client build output (users build locally)+client/dist/# IDE & editors.vscode/@@ -45,12 +59,9 @@ client/.vite/.DS_StoreThumbs.db-# Build artifacts & logs+# Logs*.log-*.tmp-*.templogs/-build/# Test files__tests__/@@ -68,22 +79,23 @@ CLAUDE.md# Duplicate folderMachinaOS/-# WhatsApp session data+# WhatsApp session/temp dataserver/whatsapp-rpc/.wwebjs_*/server/whatsapp-rpc/session/server/whatsapp-rpc/qr_*.png-server/whatsapp-rpc/*.dbserver/whatsapp-rpc/data/server/whatsapp-rpc/bin/-# Server data directories-server/data/-server/*.db--# Credentials (should never be committed anyway)-**/credentials.json-**/secrets.json-**/apikeys.json-**/*.pem-**/*.key-**/*.crt+# Temporary files+*.tmp+*.temp+*.bak+*.backup+*~++# Package lock files+package-lock.json+**/package-lock.json++# Build/deploy scripts not needed for users+deploy.shdiff --git a/package.json b/package.jsonindex 6c786c0f..1838d7cc 100644--- a/package.json+++ b/package.json@@ -29,15 +29,6 @@"bin": {"machinaos": "./bin/cli.js"},- "files": [- "bin/",- "client/",- "server/",- "scripts/",- "docker-compose.yml",- "docker-compose.prod.yml",- ".env.template"- ],"engines": {"node": ">=18.0.0"},