@letmeknow/cli 0.11.0 → 0.12.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
@@ -7,10 +7,10 @@ End-to-end encrypted chats and shared documents for AI agents and people. An age
7
7
  Any machine with Node runs it with no install step. Start with the skill, the instructions for agents:
8
8
 
9
9
  ```bash
10
- npx -y @letmeknow/cli@0.11 skill
10
+ npx -y @letmeknow/cli@0.12 skill
11
11
  ```
12
12
 
13
- `@letmeknow/cli` provides the `letmeknow` command, and git's remote helper `git-remote-lmk` once installed (`npm i -g @letmeknow/cli`), with a prebuilt binary for Linux (x64, arm64), macOS (arm64, x64) and Windows (x64). The same binaries are on [Releases](https://github.com/spoj/letmeknow/releases).
13
+ `@letmeknow/cli` provides the `letmeknow` command, with a prebuilt binary for Linux (x64, arm64), macOS (arm64, x64) and Windows (x64). For git groups, install it (`npm i -g @letmeknow/cli`) and run once `git config --global alias.remote-lmk '!letmeknow git-remote-lmk'`, which makes `letmeknow` git's remote helper for `lmk::` remotes. The same binaries are on [Releases](https://github.com/spoj/letmeknow/releases).
14
14
 
15
15
  ```bash
16
16
  letmeknow listen --name "Matthew's agent, repo X" # the session process; keep it running, it prints events as JSON lines
@@ -39,7 +39,7 @@ It prints its membership address, `<key>@https://chat.example.com`. Sessions use
39
39
 
40
40
  - `crates/`: the Rust workspace. `session` is the `letmeknow` binary (CLI and session process); `kind-doc` is the doc kind's plugin, `letmeknow-kind-doc`, and the browser's in-page doc plugin; `kind-git` is the git kind's plugin, `letmeknow-kind-git`, with git's remote helper `git-remote-lmk`, and the browser's display-only git plugin; `node` is one member's logic, shared by the CLI and the browser; `core` (MLS groups, identities, invites), `net` (peers and files over iroh), `membership` (logs and their services), `proto` (wire formats), `serve` (`letmeknow serve`), and `web` (the browser's WebAssembly bindings).
41
41
  - `web/`: the browser client; `npm run build` writes `web/dist`.
42
- - `npm/cli/`: the npm launchers, which run the prebuilt `letmeknow` and `git-remote-lmk`; the plugins letmeknow ships are beside them.
42
+ - `npm/cli/`: the npm launcher, which runs the prebuilt `letmeknow`; the plugins and git's remote helper letmeknow ships are beside it.
43
43
  - `deploy/`: letmeknow.dev's deployment.
44
44
  - `test/e2e.py`: the end-to-end test, against a local `letmeknow serve`; `--no-browser` skips the browser client.
45
45
 
package/bin/letmeknow.js CHANGED
@@ -1,2 +1,30 @@
1
1
  #!/usr/bin/env node
2
- require("./launch.js")("letmeknow");
2
+ const { spawn } = require("node:child_process");
3
+ const fs = require("node:fs");
4
+ const path = require("node:path");
5
+
6
+ const target = `${process.platform}-${process.arch}`;
7
+ let binary;
8
+ try {
9
+ binary = require.resolve(`@letmeknow/${target}/bin/letmeknow${process.platform === "win32" ? ".exe" : ""}`);
10
+ } catch {
11
+ console.error(`letmeknow: no prebuilt binary for ${target}; see https://github.com/spoj/letmeknow`);
12
+ process.exit(1);
13
+ }
14
+ // The binary, and the plugins and git helper beside it, which it runs, must be executable.
15
+ const bin = path.dirname(binary);
16
+ for (const file of fs.readdirSync(bin)) {
17
+ try {
18
+ fs.accessSync(path.join(bin, file), fs.constants.X_OK);
19
+ } catch {
20
+ fs.chmodSync(path.join(bin, file), 0o755);
21
+ }
22
+ }
23
+
24
+ const child = spawn(binary, process.argv.slice(2), { stdio: "inherit" });
25
+ for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) process.on(signal, () => child.kill(signal));
26
+ child.on("error", error => {
27
+ console.error(`letmeknow: ${error.message}`);
28
+ process.exit(1);
29
+ });
30
+ child.on("exit", (code, signal) => process.exit(code ?? (signal ? 1 : 0)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letmeknow/cli",
3
- "version": "0.11.0",
3
+ "version": "0.12.1",
4
4
  "description": "End-to-end encrypted chats and documents for agents and their people",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -8,8 +8,7 @@
8
8
  "url": "git+https://github.com/spoj/letmeknow.git"
9
9
  },
10
10
  "bin": {
11
- "letmeknow": "bin/letmeknow.js",
12
- "git-remote-lmk": "bin/git-remote-lmk.js"
11
+ "letmeknow": "bin/letmeknow.js"
13
12
  },
14
13
  "files": [
15
14
  "bin"
@@ -18,10 +17,10 @@
18
17
  "node": ">=18"
19
18
  },
20
19
  "optionalDependencies": {
21
- "@letmeknow/darwin-arm64": "0.11.0",
22
- "@letmeknow/darwin-x64": "0.11.0",
23
- "@letmeknow/linux-arm64": "0.11.0",
24
- "@letmeknow/linux-x64": "0.11.0",
25
- "@letmeknow/win32-x64": "0.11.0"
20
+ "@letmeknow/darwin-arm64": "0.12.1",
21
+ "@letmeknow/darwin-x64": "0.12.1",
22
+ "@letmeknow/linux-arm64": "0.12.1",
23
+ "@letmeknow/linux-x64": "0.12.1",
24
+ "@letmeknow/win32-x64": "0.12.1"
26
25
  }
27
26
  }
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- require("./launch.js")("git-remote-lmk");
package/bin/launch.js DELETED
@@ -1,32 +0,0 @@
1
- const { spawn } = require("node:child_process");
2
- const fs = require("node:fs");
3
- const path = require("node:path");
4
-
5
- /** Runs one of the prebuilt executables of this platform's package: `letmeknow`, or git's remote helper `git-remote-lmk`. */
6
- module.exports = name => {
7
- const target = `${process.platform}-${process.arch}`;
8
- let binary;
9
- try {
10
- binary = require.resolve(`@letmeknow/${target}/bin/${name}${process.platform === "win32" ? ".exe" : ""}`);
11
- } catch {
12
- console.error(`${name}: no prebuilt binary for ${target}; see https://github.com/spoj/letmeknow`);
13
- process.exit(1);
14
- }
15
- // The binary and the plugins beside it, which it runs, must be executable.
16
- const bin = path.dirname(binary);
17
- for (const file of fs.readdirSync(bin)) {
18
- try {
19
- fs.accessSync(path.join(bin, file), fs.constants.X_OK);
20
- } catch {
21
- fs.chmodSync(path.join(bin, file), 0o755);
22
- }
23
- }
24
-
25
- const child = spawn(binary, process.argv.slice(2), { stdio: "inherit" });
26
- for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) process.on(signal, () => child.kill(signal));
27
- child.on("error", error => {
28
- console.error(`${name}: ${error.message}`);
29
- process.exit(1);
30
- });
31
- child.on("exit", (code, signal) => process.exit(code ?? (signal ? 1 : 0)));
32
- };