@gitterm/opencode-cloud 0.0.0-stage → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +81 -2
- package/dist/handoff.d.ts +43 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4192 -0
- package/dist/restore.d.ts +2 -0
- package/dist/snapshot.d.ts +33 -0
- package/package.json +49 -4
package/README.md
CHANGED
|
@@ -1,3 +1,82 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @gitterm/opencode-cloud
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Move your local [OpenCode](https://opencode.ai) session to a [GitTerm](https://gitterm.dev)
|
|
4
|
+
cloud workspace with one command, `/cloud`. Your conversation, commits, and (if you choose)
|
|
5
|
+
uncommitted changes go with it. Your local files stay as they are.
|
|
6
|
+
|
|
7
|
+
Formerly `@gitterm/opencode-plugin`. Want the agent to run commands remotely while the
|
|
8
|
+
session stays local? Use [`@gitterm/opencode-sandbox`](../opencode-sandbox/README.md).
|
|
9
|
+
|
|
10
|
+
## 1. Install
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
opencode plugin add @gitterm/opencode-cloud
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## 2. Sign in to GitTerm
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npm install -g @gitterm/cli
|
|
20
|
+
gitterm login
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
In GitTerm, add your model credentials and repository access first.
|
|
24
|
+
|
|
25
|
+
## 3. Use it
|
|
26
|
+
|
|
27
|
+
In a Git repository, stop the agent if it is running, then type:
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
/cloud
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
1. Choose whether to include uncommitted changes.
|
|
34
|
+
2. Review what will be uploaded and approve it. The workspace is billed while it runs.
|
|
35
|
+
3. Open the link to continue in the cloud.
|
|
36
|
+
|
|
37
|
+
Run `/cloud` again later to reconnect to the same workspace. **Pause or delete the
|
|
38
|
+
workspace in GitTerm when you are done.**
|
|
39
|
+
|
|
40
|
+
## Settings
|
|
41
|
+
|
|
42
|
+
All optional:
|
|
43
|
+
|
|
44
|
+
```jsonc
|
|
45
|
+
{
|
|
46
|
+
"plugins": [
|
|
47
|
+
{
|
|
48
|
+
"package": "@gitterm/opencode-cloud",
|
|
49
|
+
"options": {
|
|
50
|
+
"provider": { "type": "e2b" },
|
|
51
|
+
"connections": ["github"],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
| Option | What it does |
|
|
59
|
+
| ------------- | -------------------------------------------------------------------------- |
|
|
60
|
+
| `provider` | Cloud provider to use, for example `{ "type": "e2b" }` |
|
|
61
|
+
| `connections` | Saved GitTerm connections, for example `"github"` for private repositories |
|
|
62
|
+
| `name` | Workspace name; defaults to the conversation title |
|
|
63
|
+
| `persistent` | Keep storage between restarts, where the provider allows |
|
|
64
|
+
|
|
65
|
+
Self-hosting GitTerm? Sign in with `gitterm login --server https://gitterm.example.com`.
|
|
66
|
+
`/cloud` talks to the OpenCode server that holds your session. It finds OpenCode's background
|
|
67
|
+
service by itself. `opencode --standalone` uses a private server on a random port that `/cloud`
|
|
68
|
+
can't reach; instead run `opencode serve --port 4096`, open it with
|
|
69
|
+
`opencode --server http://127.0.0.1:4096`, and set `localServerUrl` to that address (and
|
|
70
|
+
`localServerPassword` to its password).
|
|
71
|
+
|
|
72
|
+
## Good to know
|
|
73
|
+
|
|
74
|
+
- Only the current conversation moves. Running processes, ignored files (such as `.env`),
|
|
75
|
+
and your global OpenCode settings do not.
|
|
76
|
+
- It is one way: later local edits are not sent, and cloud changes are not merged back.
|
|
77
|
+
Use Git to move work between them.
|
|
78
|
+
- GitTerm must be able to clone your repository's `origin`.
|
|
79
|
+
- The checkout and the conversation are each limited to 25 MiB. Submodules and merge
|
|
80
|
+
conflicts are not supported.
|
|
81
|
+
- Common secret files are blocked, but this is not full secret scanning. Check the
|
|
82
|
+
upload before you approve it.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type OpenCodeClient } from "@opencode/client";
|
|
2
|
+
import { type GittermClient, type WorkspaceProviderSelection, type WorkspaceRuntimeAccess } from "@gitterm/sdk";
|
|
3
|
+
export type HandoffOptions = {
|
|
4
|
+
serverUrl?: string;
|
|
5
|
+
token?: string;
|
|
6
|
+
provider?: WorkspaceProviderSelection;
|
|
7
|
+
persistent?: boolean;
|
|
8
|
+
name?: string;
|
|
9
|
+
connections?: string[];
|
|
10
|
+
localServerUrl?: string;
|
|
11
|
+
localServerPassword?: string;
|
|
12
|
+
};
|
|
13
|
+
export type HandoffRecord = {
|
|
14
|
+
attemptID: string;
|
|
15
|
+
sessionID: string;
|
|
16
|
+
phase: "creating" | "restoring" | "importing" | "ready" | "failed";
|
|
17
|
+
workspaceID?: string;
|
|
18
|
+
sourceDirectory: string;
|
|
19
|
+
head: string;
|
|
20
|
+
includeChanges: boolean;
|
|
21
|
+
sharedSessions: number;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
};
|
|
24
|
+
type FormFields = Parameters<OpenCodeClient["session"]["form"]["create"]>[0]["fields"];
|
|
25
|
+
export type HandoffDependencies = {
|
|
26
|
+
local: OpenCodeClient;
|
|
27
|
+
gitterm: GittermClient;
|
|
28
|
+
options: HandoffOptions;
|
|
29
|
+
signal: AbortSignal;
|
|
30
|
+
save(record: HandoffRecord): Promise<void>;
|
|
31
|
+
progress(text: string): Promise<void>;
|
|
32
|
+
};
|
|
33
|
+
export declare class HandoffCancelled extends Error {
|
|
34
|
+
constructor();
|
|
35
|
+
}
|
|
36
|
+
export declare function changePrompt(sharedCount: number): string;
|
|
37
|
+
export declare function askForm(client: OpenCodeClient, sessionID: string, title: string, fields: FormFields, signal: AbortSignal): Promise<Record<string, string | number | boolean | readonly string[]>>;
|
|
38
|
+
export declare function runtimeClient(runtime: WorkspaceRuntimeAccess): OpenCodeClient;
|
|
39
|
+
export declare function runRemoteShell(remote: OpenCodeClient, directory: string, command: string, signal: AbortSignal): Promise<void>;
|
|
40
|
+
export declare function importPayload(data: Awaited<ReturnType<OpenCodeClient["session"]["export"]>>, directory: string): Parameters<OpenCodeClient["session"]["import"]>[0];
|
|
41
|
+
export declare function handoffSession(sessionID: string, deps: HandoffDependencies): Promise<HandoffRecord>;
|
|
42
|
+
export declare function showConnection(local: OpenCodeClient, gitterm: GittermClient, record: HandoffRecord, signal: AbortSignal): Promise<void>;
|
|
43
|
+
export {};
|
package/dist/index.d.ts
ADDED