tryharness 0.1.0 → 0.2.0
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/cli.mjs +15 -4
- package/package.json +6 -3
package/cli.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// tryharness: thin bootstrap. The real logic lives on the Harness server and is fetched
|
|
3
3
|
// fresh on every run, so this package never needs republishing to pick up improvements
|
|
4
|
-
// (a cached copy in ~/.harness runs when offline).
|
|
4
|
+
// (a cached copy in ~/.harness runs when offline). Works on Node 18+ — when the runtime
|
|
5
|
+
// lacks a built-in WebSocket (added in Node 22), the bundled `ws` package fills it in,
|
|
6
|
+
// which is why scripts run IN-PROCESS here instead of being spawned. Commands:
|
|
5
7
|
// npx tryharness pair this machine + set up every detected agent
|
|
6
8
|
// npx tryharness bridge start the task bridge (after pairing)
|
|
7
9
|
// npx tryharness backfill re-import recent Claude Code sessions
|
|
@@ -9,7 +11,7 @@
|
|
|
9
11
|
import fs from "node:fs";
|
|
10
12
|
import path from "node:path";
|
|
11
13
|
import os from "node:os";
|
|
12
|
-
import {
|
|
14
|
+
import { pathToFileURL } from "node:url";
|
|
13
15
|
|
|
14
16
|
const HARNESS_DIR = path.join(os.homedir(), ".harness");
|
|
15
17
|
const COMMANDS = {
|
|
@@ -50,5 +52,14 @@ try {
|
|
|
50
52
|
console.error("could not refresh from " + origin + " - running the cached copy");
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
// Older LTS Node (18/20): provide WebSocket from the bundled `ws` package so the bridge
|
|
56
|
+
// works everywhere npx does.
|
|
57
|
+
if (typeof globalThis.WebSocket === "undefined") {
|
|
58
|
+
const { WebSocket } = await import("ws");
|
|
59
|
+
globalThis.WebSocket = WebSocket;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Run the script in-process (so the polyfill above applies), with argv shaped exactly
|
|
63
|
+
// as a direct `node <script> <args>` run would see it.
|
|
64
|
+
process.argv = [process.argv[0], dest, ...command.args, ...argv];
|
|
65
|
+
await import(pathToFileURL(dest).href);
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tryharness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Connect this machine to Harness: pair with a code, link your coding agents (Claude Code, Codex, opencode, pi), share session history, and accept delegated tasks.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"tryharness": "cli.mjs"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
9
|
"engines": {
|
|
10
|
-
"node": ">=
|
|
10
|
+
"node": ">=18"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
13
|
"cli.mjs",
|
|
@@ -19,5 +19,8 @@
|
|
|
19
19
|
"claude-code"
|
|
20
20
|
],
|
|
21
21
|
"homepage": "https://tryharness.ai",
|
|
22
|
-
"license": "MIT"
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"ws": "^8.18.0"
|
|
25
|
+
}
|
|
23
26
|
}
|