Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/morphcloud-client-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Release Morph Cloud Client

on:
push:
tags:
- 'morphcloud-client-v*'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write
id-token: write # allows trusted publishing to NPM

defaults:
run:
working-directory: clients/morphcloud

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Node.js 24.x
uses: actions/setup-node@v6
with:
node-version: 24.x

- name: Validate tag version
id: version
run: |
TAG_VERSION="${GITHUB_REF#refs/tags/typescript-client-v}"
PACKAGE_VERSION=$(node -p "require('./package.json').version")

echo "Tag version: $TAG_VERSION"
echo "Current package version: $PACKAGE_VERSION"

if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
echo "Error: Tag version ($TAG_VERSION) does not match package.json version ($PACKAGE_VERSION)"
exit 1
fi

echo "✓ Tag version matches package.json version"
echo "VERSION=$PACKAGE_VERSION" >> $GITHUB_OUTPUT

- name: Install dependencies
working-directory: clients/typescript
run: npm install

- name: Build
run: npm run build

- name: Publish to npm
run: npm publish

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: typescript-client-v${{ steps.version.outputs.VERSION }}
name: TypeScript Client v${{ steps.version.outputs.VERSION }}
body: |
Published package [@nuanced-dev/lsp-morphcloud](https://www.npmjs.com/package/@nuanced-dev/lsp-morphcloud) to NPM.

### Installation

```bash
npm install -g @nuanced-dev/lsp-morphcloud@${{ steps.version.outputs.VERSION }}
```

### Changes

See [CHANGELOG.md](${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/clients/morphcloud/CHANGELOG.md) for details.
draft: false
prerelease: false
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -330,3 +330,30 @@ jobs:

- name: Lint
run: npm run lint

morphcloud-client-check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x, 22.x, 24.x]
defaults:
run:
working-directory: clients/morphcloud
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Lint
run: npm run lint
1 change: 1 addition & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ See [architecture](docs/architecture.md) documentation for more details.

| Path | Description |
|-------------------|-------------------------------------------------------------------|
| `clients` | Clients, each in their own subdirectory |
| `crates/common` | Shared logic between the proxy and wrapper |
| `crates/proxy` | Proxy service code |
| `crates/wrapper` | Wrapper service code |
Expand Down
1 change: 1 addition & 0 deletions clients/morphcloud/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin/**/* filter=lfs diff=lfs merge=lfs -text
12 changes: 12 additions & 0 deletions clients/morphcloud/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# NPM
dist/
node_modules/

# Archives
*.tar.gz
*.tgz
*.zip

# Keep everything in bin (MUST come after exclusion rules!)
!bin/**

10 changes: 10 additions & 0 deletions clients/morphcloud/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.0] - 2025-01-21

Initial release.
73 changes: 73 additions & 0 deletions clients/morphcloud/DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Development

## Repo layout

| Path | Description |
|-------------------|----------------------------------------------|
| `src/` | TypeScript client (CLI + library) |
| `scripts/` | Project-level scripts |
| `tests/` | Unified test suite |

## Requirements

- Recent Node.js version installed
- A [Morph Cloud](https://cloud.morph.so) account, and an API token in the `MORPH_API_KEY` environment variable.

## Local development

**Building:**

Build the source:

```bash
npm run build
```

Lint and format the source:

```bash
npm run lint:fix
```

Run the CLI from source:

```bash
npm run dev
```

## Mutagen

This project uses Mutagen for file syncing. It uses an isolated configuration so it does not interfere with other uses of Mutagen on the system.

To run `mutagen` with the right configuration to see the file syncs created by this project, run:

```bash
scripts/mutagen.sh
```

We use a [modified](https://github.com/nuanced-dev/mutagen/tree/hendrikvanantwerpen/custom-ssh-config) Mutagen version. The binaries are shipped as part of the NPM package.

If these need changing:

- Run `go run scripts/build.go --mode=release-slim` in a Mutagen checkout
- Run `scripts/updarte-mutagen-assets.sh /path/to/mutagen/checkout`

## Release

Follow these steps to release a new version:

1. Open a branch for the new release.

1. Update the package version in `package.json` to the desired new version.

1. Update the [changelog](CHANGELOG.md) to include an entry for the new version.

1. Run the release script:

```bash
scripts/release.sh
```

The release script pushes a tag to GitHub that will trigger the release workflow. The release workflow publishes the NPM package and creates a GitHub release for the new version.

1. If releases are successful, merge the release branch.
22 changes: 22 additions & 0 deletions clients/morphcloud/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT License

Copyright (c) Agentic Corporation
Copyright (c) Nuanced

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
74 changes: 74 additions & 0 deletions clients/morphcloud/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Nuanced LSP Morph Cloud Client

This is a client to run Nuanced LSP remotely on [Morph Cloud](https://cloud.morph.so).

_Note that this client is experimental and not considered stable!_

**Current features:**

- Run Nuanced LSP instances for a workspace remotely in the Morph Cloud.
- Sync files from the local workspace to the remote instance.
- Resume a previous LSP instance for the same workspace for fast startup.

**Known issues:**

- File syncs are sometimes not properly resumed, in which case the workspace instance needs to be recreated.
- Morph Cloud retains snapshots for instances that have been deleted. These snapshots do not inherit the metadata of the instance and we currently cannot clean them up.

**Future possibilities:**

- Use instances from other branches of the same repo to improve cold start time. For example, if an instance is available for the main branch, feature branches could start from that and reuse existing state as much as possible.
- Support creating multiple, named, service snapshots with different resource or languages preloaded.

## Requirements

- Recent Node.js version installed
- A [Morph Cloud](https://cloud.morph.so) account, and an API token in the `MORPH_API_KEY` environment variable.

## Quick start

**Create the service snapshot:**

```bash
nuanced-lsp-morphcloud service create
```

This creates the base snapshot from which the workspace instances are spawned.

**Check service status:**

```bash
nuanced-lsp-morphcloud service status
```

**Delete service snapshot:**

```bash
nuanced-lsp-morphcloud service delete
```

This can be useful if you want to recreate the service snapshot. The old snapshot must be removed first.

**Start a remove LSP server for a workspace:**

```bash
nuanced-lsp-morphcloud workspace server /path/to/workspace
```

**Check workspace status:**

```bash
nuanced-lsp-morphcloud workspace status /path/to/workspace
```

**Remove a workspace status:**

```bash
nuanced-lsp-morphcloud workspace delete /path/to/workspace
```

This can be useful if you want to recreate the workspace instance.

## License

This work is licensed under the terms of the MIT license. For a copy, see [LICENSE](LICENSE) or <https://opensource.org/licenses/MIT>.
3 changes: 3 additions & 0 deletions clients/morphcloud/bin/mutagen/darwin_arm64/mutagen
Git LFS file not shown
Git LFS file not shown
3 changes: 3 additions & 0 deletions clients/morphcloud/bin/mutagen/darwin_x64/mutagen
Git LFS file not shown
Git LFS file not shown
3 changes: 3 additions & 0 deletions clients/morphcloud/bin/mutagen/linux_arm64/mutagen
Git LFS file not shown
Git LFS file not shown
3 changes: 3 additions & 0 deletions clients/morphcloud/bin/mutagen/linux_x64/mutagen
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
3 changes: 3 additions & 0 deletions clients/morphcloud/bin/mutagen/windows_x64/mutagen.exe
Git LFS file not shown
Empty file.
Loading
Loading