Skip to content

Service process improvements #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
52b585f
IntelliJ extension basics
jonah-iden Mar 28, 2025
a9c7c10
basic updating and highlighting in editor
jonah-iden Mar 28, 2025
0cb7d84
working editing
jonah-iden Mar 31, 2025
db87f72
some ui for the extension
jonah-iden Mar 31, 2025
f910cb4
further progress with virtual file system
jonah-iden Apr 4, 2025
be556dd
multiple fixes for joining
jonah-iden Apr 9, 2025
efba682
fixed to new authentication method
jonah-iden Apr 11, 2025
40196fb
basic ui and different colors for peers plus other smaller changes
jonah-iden Apr 23, 2025
49e0740
disposable fixes and other smaller fixes
jonah-iden Apr 24, 2025
6028cfe
build fix after rebase
jonah-iden Apr 24, 2025
5e7edbb
follow ui
jonah-iden Apr 25, 2025
50c0ab1
improvements for follow
jonah-iden May 7, 2025
5f29d23
bettter authentication service
jonah-iden May 13, 2025
609d8ee
updated Service process generic message api
jonah-iden May 15, 2025
bcf613e
fylsystem sync changes
jonah-iden May 16, 2025
666724a
smaller filesytem synch changes
jonah-iden May 20, 2025
c60428b
working virtual fily system synch
jonah-iden May 20, 2025
38e36d4
working closing project on session close and deleting of the temporar…
jonah-iden May 21, 2025
498fdad
some fixes for hosting session and some renames
jonah-iden May 22, 2025
d6a82dc
working write file
jonah-iden May 23, 2025
f9935c3
small file system improvements
jonah-iden May 26, 2025
02d1d28
loading dialog for creating room
jonah-iden May 27, 2025
d672865
fix small sharing issue
jonah-iden May 27, 2025
067ca27
status bar widget and other smaller fixes
jonah-iden May 28, 2025
24974e6
moved intelliJ package to own repository
jonah-iden May 28, 2025
2b819f6
fixed service-process-test and added readme
jonah-iden May 30, 2025
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
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true

[*.xml]
indent_size = 2

[*.yml]
indent_size = 2

Expand Down
6 changes: 6 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach to Service Process",
"port": 23698,
},
{
"type": "node",
"request": "launch",
Expand Down
74 changes: 74 additions & 0 deletions packages/open-collaboration-service-process/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Open Collaboration Service Process

Open Collaboration Tools is a collection of open source tools, libraries and extensions for live-sharing of IDE contents, designed to boost remote teamwork with open technologies. For more information about this project, please [read the announcement](https://www.typefox.io/blog/open-collaboration-tools-announcement/).

This package is a standalone Node.js application, which helps to simplify integration of OCT with non-TypeScript environments, by providing a stdin/stdout based [JSON-RPC](https://www.jsonrpc.org/) API.

It takes over encryption, session lifecycle management, and includes Yjs integration for collision-free real-time editing of documents,
so client applications do not need to implement these complex features themselves.

## Usage

### Starting the Service Process

Start the process by either using [Node.js](https://nodejs.org) to call `process.js` or use a prebuilt executable:

```sh
node ./lib/process.js --server-address http://localhost:8100 --auth-token <your-auth-token>
```

- `--server-address` (**required**): The address of the collaboration server to connect to (e.g., `https://api.open-collab.tools`).
- `--auth-token` (**optional**): The authentication token to use for the session, if saved by the application from a previous login

### Communication Protocol

All communication happens via JSON-RPC 2.0 messages over stdin/stdout.
See [messages.ts](src/messages.ts) for service process specific awarness or lifecycle messages. Other messages follow the open-collaboration-protocol.

For specific examples see `service.process.test.ts` or the [IntellIj integration](https://github.com/eclipse-oct/oct-intellij)

### Sending and Receiving Binary Data

- For efficient document and file transfer, binary data is supported.
- Use the `BinaryData` type for parameters or results that contain binary content.
- Binary data is encoded as base64-encoded [MessagePack](https://msgpack.org/) in the `data` field of a `BinaryData` object.

#### Example: Sending Binary Data

```json
{
"jsonrpc": "2.0",
"id": 1,
"method": "awareness/getDocumentContent",
"params": ["path/to/file"]
}
```

The response will be:

```json
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"type": "binaryData",
"data": "<base64-encoded-messagepack>"
}
}
```

Or sending Binary Data as a Parameter:

```json
{
"jsonrpc": "2.0",
"id": 2,
"method": "fileSystem/writeFile",
"params": [
{
"type": "binaryData",
"data": "<base64-encoded-messagepack>"
}
]
}
```
Loading