@kommander/broski 0.1.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/README.md +57 -0
- package/bin/broski.mjs +26 -0
- package/dist/main.js +8838 -0
- package/package.json +42 -0
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# broski
|
|
2
|
+
|
|
3
|
+
Private text conversations with your msg-bot agents, in an OpenTUI/Solid terminal.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
bun x @kommander/broski --gateway URL
|
|
7
|
+
npx @kommander/broski --gateway URL
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Replace `URL` with the HTTPS origin supplied by your gateway operator. A gateway
|
|
11
|
+
is mandatory; this package contains no service address or credentials. HTTPS is
|
|
12
|
+
required, including local testing. The npm package is `@kommander/broski`;
|
|
13
|
+
the installed executable is `broski`.
|
|
14
|
+
|
|
15
|
+
## Login And Keys
|
|
16
|
+
|
|
17
|
+
Press Enter in the Console OAuth dialog. Open the displayed verification URL in
|
|
18
|
+
your browser and enter the displayed code. Your Console user must already be
|
|
19
|
+
linked to your msg-bot account. Login requires a configured gateway; no model API
|
|
20
|
+
key or administrator token can substitute for Console messaging authorization.
|
|
21
|
+
|
|
22
|
+
- Tab switches between the bot sidebar and message input.
|
|
23
|
+
- Up/Down selects a bot; Enter returns to its input.
|
|
24
|
+
- Enter sends a text message.
|
|
25
|
+
- Ctrl+N creates a bot, subject to the gateway's fleet quotas.
|
|
26
|
+
- Ctrl+L signs out and opens login; Ctrl+R refreshes bot status.
|
|
27
|
+
- Escape closes a dialog; Ctrl+Q or Ctrl+C exits.
|
|
28
|
+
|
|
29
|
+
Use a terminal at least 50 columns by 16 rows. Tokens stay in process memory and
|
|
30
|
+
are not written to disk. Local transcripts are plaintext private files under
|
|
31
|
+
`~/.local/state/console-chat/`, separated by gateway and authenticated account,
|
|
32
|
+
limited to 2,000 entries and 8 MB per account. Protect your local account and backups.
|
|
33
|
+
|
|
34
|
+
The configured HTTPS gateway is your trust root. Its discovery response identifies
|
|
35
|
+
one Console authority; device/token URLs are derived from that authority, and
|
|
36
|
+
verification URLs must stay on its HTTPS origin. Redirects are rejected. The client
|
|
37
|
+
uses Console's public JSON device grant and holds its own access token, not the
|
|
38
|
+
manager's account credentials. Expiry requires login again. Ctrl+L clears the local
|
|
39
|
+
token and closes the stream; it does not revoke the token at Console or delete local history.
|
|
40
|
+
|
|
41
|
+
The gateway retains only bounded in-memory pending replies, with an initial
|
|
42
|
+
delivery plus at most three retries. Reconnect does not recover a server history;
|
|
43
|
+
gateway restart loses pending replies. Messages are deduplicated locally before
|
|
44
|
+
REST ACK. An uncertain send keeps its message ID for an explicit retry.
|
|
45
|
+
|
|
46
|
+
## Runtime
|
|
47
|
+
|
|
48
|
+
Supported package targets: Linux and macOS, x64 and arm64. Node >=22.18 can launch
|
|
49
|
+
the package; Bun >=1.3 can run it directly. OpenTUI 0.5.3's Node FFI is not yet
|
|
50
|
+
implemented, so the Node launcher uses a pinned, package-local optional Bun binary.
|
|
51
|
+
It never downloads code itself, shells out to a global `bun`, or needs Bun on PATH.
|
|
52
|
+
Do not omit optional dependencies. Linux x64 Node and Bun terminal paths have been
|
|
53
|
+
smoke-tested; other declared native targets require platform release checks.
|
|
54
|
+
|
|
55
|
+
No token, private text, or backend error body is intentionally logged. Terminal
|
|
56
|
+
control sequences are stripped before rendering. This is a text-only DM client,
|
|
57
|
+
not an agent administration console.
|
package/bin/broski.mjs
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
if (process.versions.bun) {
|
|
7
|
+
try { await import("../dist/main.js"); }
|
|
8
|
+
catch { process.stderr.write("broski could not start. Check terminal and native optional dependencies.\n"); process.exitCode = 1; }
|
|
9
|
+
} else {
|
|
10
|
+
// OpenTUI 0.5.3's Node FFI is a placeholder. Never assume a global Bun executable.
|
|
11
|
+
try {
|
|
12
|
+
const platform = process.platform;
|
|
13
|
+
if (!["linux", "darwin"].includes(platform) || !["x64", "arm64"].includes(process.arch)) throw new Error("Unsupported platform");
|
|
14
|
+
const arch = process.arch === "arm64" ? "aarch64" : "x64";
|
|
15
|
+
const musl = platform === "linux" && !process.report.getReport().header.glibcVersionRuntime ? "-musl" : "";
|
|
16
|
+
const baseline = arch === "x64" ? "-baseline" : "";
|
|
17
|
+
const executable = createRequire(import.meta.url).resolve(`@oven/bun-${platform}-${arch}${musl}${baseline}/bin/bun`);
|
|
18
|
+
const child = spawn(executable, [fileURLToPath(import.meta.url), ...process.argv.slice(2)], { stdio: "inherit" });
|
|
19
|
+
for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) process.on(signal, () => child.kill(signal));
|
|
20
|
+
child.on("error", () => { process.stderr.write("Packaged terminal runtime could not start.\n"); process.exitCode = 1; });
|
|
21
|
+
child.on("exit", (code, signal) => { process.exitCode = code ?? (signal ? 1 : 0); });
|
|
22
|
+
} catch {
|
|
23
|
+
process.stderr.write("broski needs its native optional dependencies. Install without --omit=optional on Linux or macOS x64/arm64.\n");
|
|
24
|
+
process.exitCode = 1;
|
|
25
|
+
}
|
|
26
|
+
}
|