pairpod 0.1.0 → 0.3.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/dist/index.js CHANGED
@@ -4,11 +4,24 @@ import { start } from "./start.js";
4
4
  const HELP = `pairpod — run terminals & Claude sessions from Telegram
5
5
 
6
6
  Usage:
7
- pairpod onboard Configure the bot (token, allowlist, port, vault key)
8
- pairpod start Start the tunnel + bot (one command)
9
- pairpod start --no-tunnel Start the bot only (use the existing MINIAPP_URL)
7
+ pairpod onboard Configure the bot (token, allowlist, port, vault key)
8
+ pairpod start Start the tunnel + bot (one command)
9
+ pairpod start --no-tunnel Start the bot only (use the existing MINIAPP_URL)
10
+ pairpod start --host-mode true Allow host pods this run (a shell on the bot machine)
10
11
 
11
12
  Config lives in ~/.pairpod/ (override with PAIRPOD_HOME).`;
13
+ function hostModeFlag(args) {
14
+ const i = args.findIndex((a) => a === "--host-mode" || a.startsWith("--host-mode="));
15
+ if (i === -1)
16
+ return undefined;
17
+ const arg = args[i];
18
+ const value = arg.includes("=") ? arg.slice(arg.indexOf("=") + 1) : args[i + 1];
19
+ if (value !== "true" && value !== "false") {
20
+ console.error("--host-mode expects true or false");
21
+ process.exit(1);
22
+ }
23
+ return value;
24
+ }
12
25
  async function main() {
13
26
  const [cmd, ...rest] = process.argv.slice(2);
14
27
  switch (cmd) {
@@ -16,7 +29,7 @@ async function main() {
16
29
  await onboard();
17
30
  break;
18
31
  case "start":
19
- await start(!rest.includes("--no-tunnel"));
32
+ await start(!rest.includes("--no-tunnel"), hostModeFlag(rest));
20
33
  break;
21
34
  case undefined:
22
35
  case "help":
package/dist/onboard.js CHANGED
@@ -29,6 +29,12 @@ export async function onboard() {
29
29
  validate: (v) => (/^\d+$/.test(v) ? undefined : "Must be a number"),
30
30
  });
31
31
  cancelled(port);
32
+ p.note("Host pods open an UNSANDBOXED shell on this machine — full access to its files,\nprocesses, and any keys it holds. Docker and SSH pods are isolated; Host is not.\nLeave this off unless you specifically need a shell on the bot host itself.", "⚠ Host mode");
33
+ const hostMode = await p.confirm({
34
+ message: "Enable Host mode (unsandboxed shell on the bot machine)?",
35
+ initialValue: existing.HOST_MODE === "true",
36
+ });
37
+ cancelled(hostMode);
32
38
  const hadKey = Boolean(existing.PAIRPOD_VAULT_KEY);
33
39
  const vaultKey = existing.PAIRPOD_VAULT_KEY || crypto.randomBytes(32).toString("base64");
34
40
  const s = p.spinner();
@@ -38,6 +44,7 @@ export async function onboard() {
38
44
  TELEGRAM_ALLOWED_USERNAMES: usernames.trim(),
39
45
  PORT: port,
40
46
  PAIRPOD_VAULT_KEY: vaultKey,
47
+ HOST_MODE: hostMode ? "true" : "false",
41
48
  });
42
49
  s.stop(`Wrote ${ENV_PATH}`);
43
50
  p.note(`${hadKey ? "Kept existing" : "Generated a new"} vault key (AES-256-GCM, stored in your .env).`, "Credential vault");
package/dist/start.js CHANGED
@@ -46,12 +46,14 @@ function startTunnel(port) {
46
46
  }, 30000);
47
47
  });
48
48
  }
49
- export async function start(useTunnel) {
49
+ export async function start(useTunnel, hostMode) {
50
50
  const env = { ...process.env, ...readEnv() };
51
51
  if (!env.TELEGRAM_BOT_TOKEN) {
52
52
  console.error("Not configured yet. Run: pairpod onboard");
53
53
  process.exit(1);
54
54
  }
55
+ if (hostMode !== undefined)
56
+ env.HOST_MODE = hostMode;
55
57
  const port = env.PORT || "40002";
56
58
  const children = [];
57
59
  let shuttingDown = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pairpod",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Run terminals and Claude Code sessions from your phone via a Telegram bot, on Docker, SSH, or host backends.",
@@ -34,7 +34,7 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "@clack/prompts": "^0.7.0",
37
- "pairpod-bot": "0.1.0"
37
+ "pairpod-bot": "0.3.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/node": "^22.0.0"