@gitterm/opencode-cloud 0.0.0-stage → 0.1.4

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 CHANGED
@@ -1,3 +1,84 @@
1
- # Temporary Holding Version
1
+ # @gitterm/opencode-cloud
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
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
+ Requires OpenCode 2.2.6 or newer.
13
+
14
+ ```sh
15
+ opencode plugin add @gitterm/opencode-cloud
16
+ ```
17
+
18
+ ## 2. Sign in to GitTerm
19
+
20
+ ```sh
21
+ npm install -g @gitterm/cli
22
+ gitterm login
23
+ ```
24
+
25
+ In GitTerm, add your model credentials and repository access first.
26
+
27
+ ## 3. Use it
28
+
29
+ In a Git repository, stop the agent and finish or stop its background jobs, then type:
30
+
31
+ ```text
32
+ /cloud
33
+ ```
34
+
35
+ 1. Choose whether to include uncommitted changes.
36
+ 2. Review what will be uploaded and approve it. The workspace is billed while it runs.
37
+ 3. Open the link to continue in the cloud.
38
+
39
+ Run `/cloud` again later to reconnect to the same workspace. **Pause or delete the
40
+ workspace in GitTerm when you are done.**
41
+
42
+ ## Settings
43
+
44
+ All optional:
45
+
46
+ ```jsonc
47
+ {
48
+ "plugins": [
49
+ {
50
+ "package": "@gitterm/opencode-cloud",
51
+ "options": {
52
+ "provider": { "type": "e2b" },
53
+ "connections": ["github"],
54
+ },
55
+ },
56
+ ],
57
+ }
58
+ ```
59
+
60
+ | Option | What it does |
61
+ | ------------- | -------------------------------------------------------------------------- |
62
+ | `provider` | Cloud provider to use, for example `{ "type": "e2b" }` |
63
+ | `connections` | Saved GitTerm connections, for example `"github"` for private repositories |
64
+ | `name` | Workspace name; defaults to the conversation title |
65
+ | `persistent` | Keep storage between restarts, where the provider allows |
66
+
67
+ Self-hosting GitTerm? Sign in with `gitterm login --server https://gitterm.example.com`.
68
+ `/cloud` talks to the OpenCode server that holds your session. It finds OpenCode's background
69
+ service by itself. `opencode --standalone` uses a private server on a random port that `/cloud`
70
+ can't reach; instead run `opencode serve --port 4096`, open it with
71
+ `opencode --server http://127.0.0.1:4096`, and set `localServerUrl` to that address (and
72
+ `localServerPassword` to its password).
73
+
74
+ ## Good to know
75
+
76
+ - Only the current conversation moves. Running processes, ignored files (such as `.env`),
77
+ and your global OpenCode settings do not.
78
+ - It is one way: later local edits are not sent, and cloud changes are not merged back.
79
+ Use Git to move work between them.
80
+ - GitTerm must be able to clone your repository's `origin`.
81
+ - The checkout and the conversation are each limited to 25 MiB. Submodules and merge
82
+ conflicts are not supported.
83
+ - Common secret files are blocked, but this is not full secret scanning. Check the
84
+ 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 {};
@@ -0,0 +1,3 @@
1
+ import { Plugin } from "@opencode/plugin";
2
+ export declare const GittermCloudPlugin: Plugin.Plugin;
3
+ export default GittermCloudPlugin;