diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 628de29..4da73c5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,10 +1,10 @@ # Publish: build + npm release executor. Triggered by a vX.Y.Z tag, or # dispatched by release.yml after it tags a version. # -# Matrix-builds postagent-core for the four supported targets (darwin -# arm64/x64, linux x64/arm64-gnu), drops each binary into its platform -# package, builds the postagent JS bundle, and publishes all five packages -# to npm. Does not touch version numbers — that is release.yml's job. +# Matrix-builds postagent-core for all supported targets (darwin +# arm64/x64, linux x64/arm64-gnu, windows x64), drops each binary into its +# platform package, builds the postagent JS bundle, and publishes all +# packages to npm. Does not touch version numbers — that is release.yml's job. name: Publish @@ -39,6 +39,10 @@ jobs: runner: ubuntu-latest package: postagent-linux-arm64-gnu binary: postagent-core + - target: x86_64-pc-windows-msvc + runner: windows-latest + package: postagent-win32-x64 + binary: postagent-core.exe runs-on: ${{ matrix.runner }} @@ -92,6 +96,7 @@ jobs: for pkg in postagent-darwin-arm64 postagent-darwin-x64 postagent-linux-x64-gnu postagent-linux-arm64-gnu; do cp artifacts/$pkg/* packages/$pkg/bin/ done + cp artifacts/postagent-win32-x64/* packages/postagent-win32-x64/bin/ chmod +x packages/postagent-darwin-*/bin/postagent-core chmod +x packages/postagent-linux-*/bin/postagent-core @@ -103,7 +108,7 @@ jobs: - name: Publish platform packages run: | - for pkg in postagent-darwin-arm64 postagent-darwin-x64 postagent-linux-x64-gnu postagent-linux-arm64-gnu; do + for pkg in postagent-darwin-arm64 postagent-darwin-x64 postagent-linux-x64-gnu postagent-linux-arm64-gnu postagent-win32-x64; do pnpm --filter $pkg publish --no-git-checks --access public done env: diff --git a/README.md b/README.md index f5d5905..c52585e 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,31 @@ No more installing a new MCP server or CLI for each app your agent uses. Postage ## Install +Supports macOS (ARM64/x64), Linux (x64/ARM64), and Windows (x64). + ```bash npm install -g postagent ``` +### Build from source (Windows) + +On Windows, if the prebuilt binary is unavailable, you can compile from source: + +```bash +# 1. Install Rust: https://rustup.rs +# 2. Clone and build the native binary +git clone https://github.com/actionbook/postagent.git +cd postagent +cargo build --release --manifest-path packages/postagent-core/Cargo.toml + +# 3. Place the binary where the CLI expects it +mkdir -p packages/postagent-win32-x64/bin +copy packages\postagent-core\target\release\postagent-core.exe packages\postagent-win32-x64\bin\ + +# 4. Link for development +npm install -g . +``` + ## Quickstart Postagent is meant to be driven by an agent, not by you. After installing, just tell your agent it has `postagent` available, then send it a task — for example: diff --git a/packages/postagent-win32-x64/CHANGELOG.md b/packages/postagent-win32-x64/CHANGELOG.md new file mode 100644 index 0000000..bb3d528 --- /dev/null +++ b/packages/postagent-win32-x64/CHANGELOG.md @@ -0,0 +1,7 @@ +# postagent-win32-x64 + +## 0.3.2 + +### Patch Changes + +- Initial Windows x64 native binary support. diff --git a/packages/postagent-win32-x64/bin/.gitkeep b/packages/postagent-win32-x64/bin/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/packages/postagent-win32-x64/package.json b/packages/postagent-win32-x64/package.json new file mode 100644 index 0000000..720d6ab --- /dev/null +++ b/packages/postagent-win32-x64/package.json @@ -0,0 +1,23 @@ +{ + "name": "postagent-win32-x64", + "version": "0.3.2", + "description": "Postagent CLI native binary for Windows x64", + "os": [ + "win32" + ], + "cpu": [ + "x64" + ], + "bin": { + "postagent-core": "bin/postagent-core.exe" + }, + "files": [ + "bin/postagent-core.exe" + ], + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/actionbook/postagent.git", + "directory": "packages/postagent-win32-x64" + } +} diff --git a/packages/postagent/package.json b/packages/postagent/package.json index a332bef..3559052 100644 --- a/packages/postagent/package.json +++ b/packages/postagent/package.json @@ -33,6 +33,7 @@ "postagent-darwin-arm64": "workspace:*", "postagent-darwin-x64": "workspace:*", "postagent-linux-x64-gnu": "workspace:*", - "postagent-linux-arm64-gnu": "workspace:*" + "postagent-linux-arm64-gnu": "workspace:*", + "postagent-win32-x64": "workspace:*" } } diff --git a/packages/postagent/scripts/postinstall.cjs b/packages/postagent/scripts/postinstall.cjs index cf992e6..9baf00d 100644 --- a/packages/postagent/scripts/postinstall.cjs +++ b/packages/postagent/scripts/postinstall.cjs @@ -10,6 +10,7 @@ const PLATFORM_PACKAGES = { "darwin-x64": "postagent-darwin-x64", "linux-x64": "postagent-linux-x64-gnu", "linux-arm64": "postagent-linux-arm64-gnu", + "win32-x64": "postagent-win32-x64", }; function resolvePackageDir(packageName) { @@ -34,9 +35,14 @@ function main() { const packageDir = resolvePackageDir(packageName); if (!packageDir) return; - const binaryPath = path.join(packageDir, "bin", "postagent-core"); + const binaryName = process.platform === "win32" ? "postagent-core.exe" : "postagent-core"; + const binaryPath = path.join(packageDir, "bin", binaryName); if (fs.existsSync(binaryPath)) { - fs.chmodSync(binaryPath, 0o755); + try { + fs.chmodSync(binaryPath, 0o755); + } catch { + // chmod is a no-op on Windows; ignore the error + } } } diff --git a/packages/postagent/src/bin-resolve.ts b/packages/postagent/src/bin-resolve.ts index 658c535..08ce364 100644 --- a/packages/postagent/src/bin-resolve.ts +++ b/packages/postagent/src/bin-resolve.ts @@ -8,6 +8,7 @@ const PLATFORM_PACKAGES: Record = { "darwin-x64": "postagent-darwin-x64", "linux-x64": "postagent-linux-x64-gnu", "linux-arm64": "postagent-linux-arm64-gnu", + "win32-x64": "postagent-win32-x64", }; const require = createRequire(import.meta.url); @@ -48,7 +49,7 @@ export function resolveBinary(): string { process.exit(1); } - const binaryName = "postagent-core"; + const binaryName = process.platform === "win32" ? "postagent-core.exe" : "postagent-core"; const packageDir = resolvePackageDir(packageName); if (!packageDir) {