@jbaehova/onthego 0.3.0 → 0.3.1
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
|
@@ -9,12 +9,12 @@ No ONTHEGO account or central server is needed. SSH connects your devices. Insta
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
npm install -g @jbaehova/onthego@^0.3.
|
|
12
|
+
npm install -g @jbaehova/onthego@^0.3.1
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
The npm package includes binaries for macOS arm64/amd64 and Linux arm64/amd64. Git and OpenSSH are required. Node.js is needed only for the npm launcher. Install the same ONTHEGO version on both devices.
|
|
16
16
|
|
|
17
|
-
You can also build from source with Go 1.
|
|
17
|
+
You can also build from source with Go 1.26 or newer (the build selects Go 1.27.2):
|
|
18
18
|
|
|
19
19
|
```sh
|
|
20
20
|
git clone https://github.com/peerproblem/onthego.git
|
|
@@ -91,12 +91,13 @@ The default selection is sessions active in the last seven days. Choose a narrow
|
|
|
91
91
|
onthego push laptop --session <id>
|
|
92
92
|
onthego push laptop --session-days 2
|
|
93
93
|
onthego push laptop --all-sessions
|
|
94
|
-
onthego pull laptop --sessions
|
|
94
|
+
onthego pull laptop --no-sessions
|
|
95
|
+
onthego pull laptop --session-conflict skip
|
|
95
96
|
```
|
|
96
97
|
|
|
97
|
-
Malformed completed JSONL lines exclude that session with a warning. An incomplete final line is discarded with a warning. These histories do not stop the workspace handoff.
|
|
98
|
+
Malformed completed JSONL lines exclude that session with a warning. An incomplete final line is discarded with a warning. These histories do not stop the workspace handoff. An explicitly requested ID that cannot be found fails before packaging. `--no-sessions` skips session discovery and leaves receiving agent homes untouched.
|
|
98
99
|
|
|
99
|
-
Identical sessions are skipped. Incoming extensions update an older destination, while a newer destination is kept. Divergent sessions keep the destination and save the incoming history in private `~/.onthego/conflicts/` storage by default. `--
|
|
100
|
+
Identical sessions are skipped. Incoming extensions update an older destination, while a newer destination is kept. Divergent sessions keep the destination and save the incoming history in private `~/.onthego/conflicts/` storage by default. `--session-conflict keep-both`, `--session-conflict theirs`, and `--session-conflict skip` make the policy explicit. Conflict copies remain until you review and remove them. Plaintext staging copies are removed after import. If an adapter cannot write its destination, the workspace still arrives and its authenticated inbound histories are retained in a private `session-recovery-*` directory under ONTHEGO state. The warning prints its location. `status` reports pending recovery. Retry the same package or run `onthego sessions recover --session-conflict keep-both` to import only the saved sessions while preserving subsequent workspace edits. JSON reports `sessions.status: "recovery_needed"` until recovery succeeds. The deprecated `--sessions` alias still works and warns; it only chooses a conflict policy.
|
|
100
101
|
|
|
101
102
|
Concurrent workspace edits require a deliberate decision. ONTHEGO checks Git handoff ancestry and the destination's captured workspace state. `--replace` applies incoming managed files after retaining a Git backup; a different project ID is always rejected.
|
|
102
103
|
|
|
@@ -106,7 +107,7 @@ onthego undo
|
|
|
106
107
|
onthego backups prune --keep 3
|
|
107
108
|
```
|
|
108
109
|
|
|
109
|
-
The newest five Git backups are retained automatically. Explicitly included supplemental secrets stay outside Git objects; their backup contents are encrypted under the private ONTHEGO state directory. Unmanaged `node_modules`, caches, and local environment files are not copied into backups. Undo restores the backed-up managed state and clears the delivery baseline, since restoring old work does not prove that another device has received it. Use Git to reconcile intentional concurrent development.
|
|
110
|
+
The newest five Git backups are retained automatically. Explicitly included supplemental secrets stay outside Git objects; their backup contents are encrypted under the private ONTHEGO state directory. Unmanaged `node_modules`, caches, and local environment files are not copied into backups. Undo restores the backed-up managed state and clears the delivery baseline, since restoring old work does not prove that another device has received it. Backup listing, pruning and undo remain available even if `.onthego.yaml` is missing or invalid. Use Git to reconcile intentional concurrent development.
|
|
110
111
|
|
|
111
112
|
## Configuration
|
|
112
113
|
|
|
@@ -141,7 +142,9 @@ onthego push laptop --include scratch/notes.txt
|
|
|
141
142
|
onthego push laptop --include-secret .env
|
|
142
143
|
```
|
|
143
144
|
|
|
144
|
-
Explicitly selected files remain managed across subsequent handoffs, including deletions. Do not opt in credentials that must stay device-local.
|
|
145
|
+
Explicitly selected files remain managed across subsequent handoffs, including deletions. Do not opt in credentials that must stay device-local. Adding a managed supplemental file to `exclude` stops future transfer and leaves the receiving copy in place with a warning. Source deletions still propagate. Project exclusions override previously remembered secret selections; explicitly combining an excluded path with `--include-secret` fails.
|
|
146
|
+
|
|
147
|
+
Credential filenames such as `.npmrc` and `.netrc` are excluded from automatic selection. `--include-secret .npmrc` carries an allowed file in the encrypted supplemental payload, outside Git objects. Names such as `tokenizer.ts`, `docs-secret-santa.md`, and `design.key` are ordinary project files, not secret candidates.
|
|
145
148
|
|
|
146
149
|
## Portable snapshots
|
|
147
150
|
|
|
@@ -172,10 +175,28 @@ Offline exports retain pending receipts for up to 30 days, bounded to 64 per wor
|
|
|
172
175
|
| `inspect` | Preview file selection and excluded secret candidates. |
|
|
173
176
|
| `doctor [device]` | Check prerequisites, CLI versions, and optional peer access. |
|
|
174
177
|
| `snapshot pack/restore` | Create or receive an offline package. |
|
|
178
|
+
| `sessions recover` | Retry saved native histories without changing the workspace. |
|
|
175
179
|
| `backups list/prune`, `undo` | Inspect, limit, or restore Git backups. |
|
|
176
180
|
| `identity`, `config path`, `version` | Inspect public identity and installation. |
|
|
177
181
|
|
|
178
|
-
`--json` emits structured results and errors. `--verbose` reports transfer phases on stderr.
|
|
182
|
+
Text output escapes control characters in filenames and session IDs. Suggested commands for these unusual names use Bash/Zsh quoting. `--json` emits structured results and errors. `--verbose` reports transfer phases on stderr. Dry-run validates local options and previews files plus selected sessions. Its `not_checked` field lists `peer` and `destination_conflict`.
|
|
183
|
+
|
|
184
|
+
| Exit status | Public error codes |
|
|
185
|
+
| --- | --- |
|
|
186
|
+
| 0 | Success, including delivered workspaces with pending session recovery |
|
|
187
|
+
| 1 | `E_INTERNAL` |
|
|
188
|
+
| 2 | `E_INPUT` |
|
|
189
|
+
| 3 | `E_PRECONDITION`, `E_UNSUPPORTED_GIT`, `E_SECRET_POLICY`, `E_SESSION_FORMAT` |
|
|
190
|
+
| 4 | `E_TARGET_AUTH`, `E_TARGET_UNAVAILABLE` |
|
|
191
|
+
| 5 | `E_PACKAGE_INVALID`, `E_RESTORE_FAILED` |
|
|
192
|
+
| 6 | `E_GENERATION_CONFLICT`, `E_SOURCE_CHANGED` |
|
|
193
|
+
| 130 | `E_CANCELED` |
|
|
194
|
+
|
|
195
|
+
## Upgrading to 0.3.1
|
|
196
|
+
|
|
197
|
+
Upgrade both devices together. Snapshot schema 3 adds signed `retained_paths` and `payload_sizes`; 0.3.1 reads schema 2 and 3, while older receivers reject schema 3. Peer transfers require the `snapshot-v3` and `session-scope` capabilities. Project policy and handoff receipt schemas remain 2; session recovery uses a separate state file.
|
|
198
|
+
|
|
199
|
+
If you transferred an untracked credential file such as `.npmrc` with 0.3.0 or earlier, rotate its tokens. Those bytes can remain in the source and receiving repositories' Git objects through retained WIP history. This update prevents new automatic capture but does not remove existing objects; Git garbage collection alone does not remove referenced history. See the [0.3.1 release notes](docs/releases/0.3.1.md).
|
|
179
200
|
|
|
180
201
|
## Development
|
|
181
202
|
|
package/npm/bin/onthego.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const {
|
|
3
|
+
const { spawn } = require("node:child_process");
|
|
4
4
|
const { existsSync } = require("node:fs");
|
|
5
5
|
const path = require("node:path");
|
|
6
6
|
|
|
@@ -24,13 +24,39 @@ if (!existsSync(binary)) {
|
|
|
24
24
|
process.exit(1);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
const
|
|
27
|
+
const child = spawn(binary, process.argv.slice(2), {
|
|
28
28
|
stdio: "inherit",
|
|
29
29
|
env: process.env,
|
|
30
|
+
// Supported platforms are POSIX. A separate group prevents a terminal or
|
|
31
|
+
// group signal from reaching the child both directly and via forwarding.
|
|
32
|
+
// Keep the child referenced so this launcher always waits for cleanup.
|
|
33
|
+
detached: true,
|
|
30
34
|
});
|
|
31
35
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
const handlers = new Map();
|
|
37
|
+
for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
|
|
38
|
+
const forward = () => child.kill(signal);
|
|
39
|
+
handlers.set(signal, forward);
|
|
40
|
+
process.on(signal, forward);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function removeHandlers() {
|
|
44
|
+
for (const [signal, handler] of handlers) {
|
|
45
|
+
process.removeListener(signal, handler);
|
|
46
|
+
}
|
|
35
47
|
}
|
|
36
|
-
|
|
48
|
+
|
|
49
|
+
child.once("error", (error) => {
|
|
50
|
+
removeHandlers();
|
|
51
|
+
process.stderr.write(`${error.message}\n`);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
child.once("exit", (code, signal) => {
|
|
56
|
+
removeHandlers();
|
|
57
|
+
if (signal) {
|
|
58
|
+
process.kill(process.pid, signal);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
process.exit(code ?? 1);
|
|
62
|
+
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|