An open-source, faster Devin alternative
TypeScript
feat: publish OpenComputer packages together (#617)
Mohamed Habibdf9662ae6a1c
diff --git a/.github/workflows/publish-opencomputer-cli.yml b/.github/workflows/publish-opencomputer-cli.ymldeleted file mode 100644index b623f05c..00000000--- a/.github/workflows/publish-opencomputer-cli.yml+++ /dev/null@@ -1,67 +0,0 @@-name: Publish OpenComputer CLI--on:- pull_request:- paths:- - 'cli/**'- - '.github/workflows/publish-opencomputer-cli.yml'- push:- branches: [main]- paths:- - 'cli/**'- - '.github/workflows/publish-opencomputer-cli.yml'- workflow_dispatch:--concurrency:- group: publish-opencomputer-cli- cancel-in-progress: false--defaults:- run:- working-directory: cli--jobs:- publish:- name: Test, build & publish to npm- runs-on: ubuntu-latest- permissions:- contents: read- id-token: write- steps:- - uses: actions/checkout@v4-- - uses: actions/setup-node@v4- with:- node-version: '22'- registry-url: 'https://registry.npmjs.org'- cache: npm- cache-dependency-path: cli/package-lock.json-- - name: Install dependencies- run: npm ci-- - name: Test and build- run: npm test-- - name: Check if this exact version is already published- if: github.event_name != 'pull_request'- id: check- run: |- LOCAL_VERSION=$(node -p "require('./package.json').version")- if LOOKUP=$(npm view "@opencomputer/cli@$LOCAL_VERSION" version 2>&1); then- echo "skip=true" >> "$GITHUB_OUTPUT"- echo "Version $LOCAL_VERSION is already published; skipping."- elif [[ "$LOOKUP" == *"E404"* ]]; then- echo "skip=false" >> "$GITHUB_OUTPUT"- echo "Publishing version $LOCAL_VERSION."- else- echo "npm registry lookup failed; refusing to assume that the version is unpublished." >&2- echo "$LOOKUP" >&2- exit 1- fi-- - name: Publish- if: github.event_name != 'pull_request' && steps.check.outputs.skip == 'false'- run: npm publish --provenance --access public- env:- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}diff --git a/.github/workflows/publish-opencomputer-create-start.yml b/.github/workflows/publish-opencomputer-create-start.ymldeleted file mode 100644index 1d4702e6..00000000--- a/.github/workflows/publish-opencomputer-create-start.yml+++ /dev/null@@ -1,67 +0,0 @@-name: Publish OpenComputer Starter--on:- pull_request:- paths:- - 'create-start/**'- - '.github/workflows/publish-opencomputer-create-start.yml'- push:- branches: [main]- paths:- - 'create-start/**'- - '.github/workflows/publish-opencomputer-create-start.yml'- workflow_dispatch:--concurrency:- group: publish-opencomputer-create-start- cancel-in-progress: false--defaults:- run:- working-directory: create-start--jobs:- publish:- name: Test & publish to npm- runs-on: ubuntu-latest- permissions:- contents: read- id-token: write- steps:- - uses: actions/checkout@v4-- - uses: actions/setup-node@v4- with:- node-version: '22'- registry-url: 'https://registry.npmjs.org'- cache: npm- cache-dependency-path: create-start/package-lock.json-- - name: Install dependencies- run: npm ci-- - name: Test- run: npm test-- - name: Check if this exact version is already published- if: github.event_name != 'pull_request'- id: check- run: |- LOCAL_VERSION=$(node -p "require('./package.json').version")- if LOOKUP=$(npm view "@opencomputer/create-start@$LOCAL_VERSION" version 2>&1); then- echo "skip=true" >> "$GITHUB_OUTPUT"- echo "Version $LOCAL_VERSION is already published; skipping."- elif [[ "$LOOKUP" == *"E404"* ]]; then- echo "skip=false" >> "$GITHUB_OUTPUT"- echo "Publishing version $LOCAL_VERSION."- else- echo "npm registry lookup failed; refusing to assume that the version is unpublished." >&2- echo "$LOOKUP" >&2- exit 1- fi-- - name: Publish- if: github.event_name != 'pull_request' && steps.check.outputs.skip == 'false'- run: npm publish --provenance --access public- env:- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}diff --git a/.github/workflows/publish-opencomputer-packages.yml b/.github/workflows/publish-opencomputer-packages.ymlnew file mode 100644index 00000000..b4704966--- /dev/null+++ b/.github/workflows/publish-opencomputer-packages.yml@@ -0,0 +1,90 @@+name: Publish OpenComputer packages++on:+ pull_request:+ paths:+ - 'agent/**'+ - 'cli/**'+ - 'create-start/**'+ - '.github/workflows/publish-opencomputer-packages.yml'+ push:+ branches: [main]+ paths:+ - 'agent/**'+ - 'cli/**'+ - 'create-start/**'+ - '.github/workflows/publish-opencomputer-packages.yml'+ workflow_dispatch:++concurrency:+ group: publish-opencomputer-packages+ cancel-in-progress: false++jobs:+ publish:+ name: Test, build, and publish packages+ runs-on: ubuntu-latest+ permissions:+ contents: read+ id-token: write+ steps:+ - uses: actions/checkout@v4++ - uses: actions/setup-node@v4+ with:+ node-version: '22'+ registry-url: 'https://registry.npmjs.org'+ cache: npm+ cache-dependency-path: |+ agent/package-lock.json+ cli/package-lock.json+ create-start/package-lock.json++ - name: Install and build agent package+ working-directory: agent+ run: |+ npm ci+ npm run build++ - name: Install and test CLI package+ working-directory: cli+ run: |+ npm ci+ npm test++ - name: Install and test starter package+ working-directory: create-start+ run: |+ npm ci+ npm test++ - name: Publish packages in dependency order+ if: github.event_name != 'pull_request'+ env:+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}+ shell: bash+ run: |+ set -euo pipefail++ publish_if_needed() {+ local directory="$1"+ local package_name="$2"+ local version+ local lookup++ version="$(node -p "require('./${directory}/package.json').version")"+ if lookup="$(npm view "${package_name}@${version}" version 2>&1)"; then+ echo "${package_name}@${version} is already published; skipping."+ elif [[ "${lookup}" == *"E404"* ]]; then+ echo "Publishing ${package_name}@${version}."+ (cd "${directory}" && npm publish --provenance --access public)+ else+ echo "npm registry lookup failed for ${package_name}@${version}; refusing to publish." >&2+ echo "${lookup}" >&2+ return 1+ fi+ }++ publish_if_needed agent @opencomputer/agent+ publish_if_needed cli @opencomputer/cli+ publish_if_needed create-start @opencomputer/create-startdiff --git a/agent/package-lock.json b/agent/package-lock.jsonindex f200d7aa..0bcf7ad1 100644--- a/agent/package-lock.json+++ b/agent/package-lock.json@@ -1,12 +1,12 @@{"name": "@opencomputer/agent",- "version": "0.3.0",+ "version": "0.3.1","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "@opencomputer/agent",- "version": "0.3.0",+ "version": "0.3.1","devDependencies": {"typescript": "^5.9.0"},diff --git a/agent/package.json b/agent/package.jsonindex 1485d0d4..e3609ba7 100644--- a/agent/package.json+++ b/agent/package.json@@ -1,6 +1,6 @@{"name": "@opencomputer/agent",- "version": "0.3.0",+ "version": "0.3.1","description": "Reactive agent authoring API for OpenComputer.","type": "module","main": "./dist/index.js",diff --git a/cli/package-lock.json b/cli/package-lock.jsonindex 83a3c4d7..d46ed76c 100644--- a/cli/package-lock.json+++ b/cli/package-lock.json@@ -1,12 +1,12 @@{"name": "@opencomputer/cli",- "version": "0.4.7",+ "version": "0.4.8","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "@opencomputer/cli",- "version": "0.4.7",+ "version": "0.4.8","dependencies": {"@opencode-ai/sdk": "1.18.4","ai": "^7.0.45",diff --git a/cli/package.json b/cli/package.jsonindex 6d01cb3f..327cdd9c 100644--- a/cli/package.json+++ b/cli/package.json@@ -1,6 +1,6 @@{"name": "@opencomputer/cli",- "version": "0.4.7",+ "version": "0.4.8","description": "Build, test, connect, deploy, and share OpenComputer agents as code.","type": "module","bin": {diff --git a/cli/src/project.test.ts b/cli/src/project.test.tsindex 6ae53aa8..30dde48d 100644--- a/cli/src/project.test.ts+++ b/cli/src/project.test.ts@@ -54,8 +54,8 @@ test("init creates a multi-agent-ready project and React hello world app", async};assert.equal(packageJSON.scripts.dev, "opencomputer dev");assert.equal(packageJSON.scripts["dev:web"], "vite");- assert.equal(packageJSON.dependencies["@opencomputer/agent"], "^0.3.0");- assert.equal(packageJSON.devDependencies["@opencomputer/cli"], "^0.4.7");+ assert.equal(packageJSON.dependencies["@opencomputer/agent"], "^0.3.1");+ assert.equal(packageJSON.devDependencies["@opencomputer/cli"], "^0.4.8");assert.ok(packageJSON.devDependencies["@types/node"]);const viteConfig = await readFile(resolve(root, "vite.config.ts"), "utf8");assert.match(viteConfig, /command === "serve"/);diff --git a/cli/src/project.ts b/cli/src/project.tsindex c1e0c373..22617076 100644--- a/cli/src/project.ts+++ b/cli/src/project.ts@@ -501,12 +501,12 @@ export default function Agent() {deploy: "opencomputer deploy",},dependencies: {- "@opencomputer/agent": "^0.3.0",+ "@opencomputer/agent": "^0.3.1",react: "^19.2.0","react-dom": "^19.2.0",},devDependencies: {- "@opencomputer/cli": "^0.4.7",+ "@opencomputer/cli": "^0.4.8","@types/node": "^24.0.0","@types/react": "^19.2.0","@types/react-dom": "^19.2.0",diff --git a/create-start/package-lock.json b/create-start/package-lock.jsonindex d90a1395..8b9351fc 100644--- a/create-start/package-lock.json+++ b/create-start/package-lock.json@@ -1,14 +1,14 @@{"name": "@opencomputer/create-start",- "version": "0.1.2",+ "version": "0.1.3","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "@opencomputer/create-start",- "version": "0.1.2",+ "version": "0.1.3","dependencies": {- "@opencomputer/cli": "^0.4.6"+ "@opencomputer/cli": "^0.4.7"},"bin": {"create-start": "index.js"@@ -75,9 +75,9 @@}},"node_modules/@opencomputer/cli": {- "version": "0.4.6",- "resolved": "https://registry.npmjs.org/@opencomputer/cli/-/cli-0.4.6.tgz",- "integrity": "sha512-yNU9yT0kC/tD72LaCt2/M3B3o1VhavZZlmJdw9yevdOUYHuSvFg2JFekxAp95Rv+SXsoOGFWpagxedfTL5sLaw==",+ "version": "0.4.7",+ "resolved": "https://registry.npmjs.org/@opencomputer/cli/-/cli-0.4.7.tgz",+ "integrity": "sha512-Fp2iOo8QZmEq6np/18n70wyPoK1Kv5NAK2NHLXMMqFWgFARpDKCJqMmc3yzEVR13FBA6jhGauvDX7bxIA+qFDA==","dependencies": {"@opencode-ai/sdk": "1.18.4","ai": "^7.0.45",diff --git a/create-start/package.json b/create-start/package.jsonindex 16a8ce61..c905b67b 100644--- a/create-start/package.json+++ b/create-start/package.json@@ -1,6 +1,6 @@{"name": "@opencomputer/create-start",- "version": "0.1.2",+ "version": "0.1.3","description": "Create a hello-world OpenComputer agent application.","type": "module","bin": {@@ -18,7 +18,7 @@"node": ">=22.0.0"},"dependencies": {- "@opencomputer/cli": "^0.4.6"+ "@opencomputer/cli": "^0.4.7"},"publishConfig": {"access": "public"