offsite 0.0.4 → 0.0.6

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.
Files changed (87) hide show
  1. package/README.md +7 -6
  2. package/apps/server/dist/main.mjs +17 -9
  3. package/apps/server/dist/main.mjs.map +1 -1
  4. package/apps/web/dist/apple-touch-icon.png +0 -0
  5. package/apps/web/dist/assets/{angular-html-prQpjz7s.js → angular-html-B53hPuXT.js} +1 -1
  6. package/apps/web/dist/assets/{angular-ts-BE4HJ5Uh.js → angular-ts--nhprFvo.js} +1 -1
  7. package/apps/web/dist/assets/{apl-CJ-NIQ-7.js → apl-BMZ6gSxk.js} +1 -1
  8. package/apps/web/dist/assets/{astro-CVkyXRVY.js → astro-BTM15MDF.js} +1 -1
  9. package/apps/web/dist/assets/{blade-CQFMHse_.js → blade-Dr8Nx-1X.js} +1 -1
  10. package/apps/web/dist/assets/{c-gqNWYRL8.js → c-CYWvPMKX.js} +1 -1
  11. package/apps/web/dist/assets/{chapel-CQ9_BV4j.js → chapel-C8sB6Foh.js} +1 -1
  12. package/apps/web/dist/assets/{cobol-D-9v184m.js → cobol-FnuKKfgs.js} +1 -1
  13. package/apps/web/dist/assets/{coffee-BE0tIOLL.js → coffee-DJrh6kIB.js} +1 -1
  14. package/apps/web/dist/assets/{cpp-CzOLC-NF.js → cpp-BLAvrTU1.js} +1 -1
  15. package/apps/web/dist/assets/{crystal-f1GcBNi_.js → crystal-BthZctDJ.js} +1 -1
  16. package/apps/web/dist/assets/{css-DlqRAumc.js → css-DjklwMwW.js} +1 -1
  17. package/apps/web/dist/assets/{edge-DQkkPJaW.js → edge-BunAX5o-.js} +1 -1
  18. package/apps/web/dist/assets/{elixir-ClG78o74.js → elixir-DgeksfSS.js} +1 -1
  19. package/apps/web/dist/assets/{elm-DZDmCmuw.js → elm-l1eWnD1P.js} +1 -1
  20. package/apps/web/dist/assets/{erb-B1mu0-DN.js → erb-JKFWiSFc.js} +1 -1
  21. package/apps/web/dist/assets/{git-rebase-x1gs-rK2.js → git-rebase-AsNqLj-a.js} +1 -1
  22. package/apps/web/dist/assets/{glimmer-js-Cjos1igW.js → glimmer-js-B8iwahHO.js} +1 -1
  23. package/apps/web/dist/assets/{glimmer-ts-CrR-PFvn.js → glimmer-ts-7zfF4XN6.js} +1 -1
  24. package/apps/web/dist/assets/{glsl-DR0G8e99.js → glsl-BJka2Ayq.js} +1 -1
  25. package/apps/web/dist/assets/{graphql-DKmrBZt7.js → graphql-7lx4uUDH.js} +1 -1
  26. package/apps/web/dist/assets/{hack-Brs_j9Xv.js → hack-Jm3cv9jc.js} +1 -1
  27. package/apps/web/dist/assets/{haml-8Lc-lF96.js → haml-Csl_BhoG.js} +1 -1
  28. package/apps/web/dist/assets/{handlebars-Ds8WdPdv.js → handlebars-CFp1rmy8.js} +1 -1
  29. package/apps/web/dist/assets/{html-C0gvYDho.js → html-D_zffrV4.js} +1 -1
  30. package/apps/web/dist/assets/{html-derivative-CU9dkErg.js → html-derivative-B-pqZuPW.js} +1 -1
  31. package/apps/web/dist/assets/{http-BE0w0Fty.js → http-CU_emOoa.js} +1 -1
  32. package/apps/web/dist/assets/{hurl-DqZk6YcW.js → hurl-BRBJ1eQP.js} +1 -1
  33. package/apps/web/dist/assets/index-CJuLsqhP.js +1148 -0
  34. package/apps/web/dist/assets/{java-PSSQ0YmM.js → java-DWuVSV9c.js} +1 -1
  35. package/apps/web/dist/assets/{javascript-Ci3r4rzs.js → javascript-CPq3YNXl.js} +1 -1
  36. package/apps/web/dist/assets/{jinja-lLTko9Wl.js → jinja-Cwr4gaQT.js} +1 -1
  37. package/apps/web/dist/assets/{jison-1BpHD5UK.js → jison-tIc7kJPc.js} +1 -1
  38. package/apps/web/dist/assets/{json-BAUn76M4.js → json-CuLUmV8d.js} +1 -1
  39. package/apps/web/dist/assets/{jsx-B8sFp1vz.js → jsx-c0vioNM-.js} +1 -1
  40. package/apps/web/dist/assets/{julia-C4TZ4EL9.js → julia-DL1_3nCX.js} +1 -1
  41. package/apps/web/dist/assets/{just-D5qIrqkp.js → just-Dz1Oq8ln.js} +1 -1
  42. package/apps/web/dist/assets/{latex-BL7XYxFg.js → latex-BtJjjmHB.js} +1 -1
  43. package/apps/web/dist/assets/{liquid-DBx9Hq7B.js → liquid-CUxfxikC.js} +1 -1
  44. package/apps/web/dist/assets/{lua-BqjicQyd.js → lua-FURW1z3g.js} +1 -1
  45. package/apps/web/dist/assets/{marko-CHgy7yaY.js → marko-D33gqJht.js} +1 -1
  46. package/apps/web/dist/assets/{mdc-DOloBwb8.js → mdc-rJL-euOm.js} +1 -1
  47. package/apps/web/dist/assets/{nginx-g7I1HPwV.js → nginx-CChB1oIE.js} +1 -1
  48. package/apps/web/dist/assets/{nim-O6zJV1LD.js → nim-C3VcT8nQ.js} +1 -1
  49. package/apps/web/dist/assets/{org-HLg4-757.js → org-CX9ySstM.js} +1 -1
  50. package/apps/web/dist/assets/{perl-B3cDKTai.js → perl-BmdWqdcq.js} +1 -1
  51. package/apps/web/dist/assets/{php-2eDApoU3.js → php-CMtd7vHw.js} +1 -1
  52. package/apps/web/dist/assets/{pug-itzGn-nK.js → pug-DRlx8d5w.js} +1 -1
  53. package/apps/web/dist/assets/{qml-sU0VtUmf.js → qml-WYwqwy0P.js} +1 -1
  54. package/apps/web/dist/assets/{r-C6mhPqgr.js → r-C1yAXCUm.js} +1 -1
  55. package/apps/web/dist/assets/{razor-CSzRtbW7.js → razor-RKu7WkDv.js} +1 -1
  56. package/apps/web/dist/assets/{regexp-BmdBJRV9.js → regexp-DuLU1P7q.js} +1 -1
  57. package/apps/web/dist/assets/{rst-BRxUd6sp.js → rst-CmK0AAXk.js} +1 -1
  58. package/apps/web/dist/assets/{ruby-CQHHOfmX.js → ruby-DwgaoIUu.js} +1 -1
  59. package/apps/web/dist/assets/{sas-DlaL8b25.js → sas-iTrXuHXc.js} +1 -1
  60. package/apps/web/dist/assets/{scss-Cc71ABWp.js → scss-CEysq-zA.js} +1 -1
  61. package/apps/web/dist/assets/{shellscript-CzA_LIIm.js → shellscript-B0mTpBTm.js} +1 -1
  62. package/apps/web/dist/assets/{shellsession-DESJlgp3.js → shellsession-BuzD9EVx.js} +1 -1
  63. package/apps/web/dist/assets/{soy-Nkvq88YN.js → soy-ClDsFuFk.js} +1 -1
  64. package/apps/web/dist/assets/{sql-CtPxrO7T.js → sql-Dc1h3orO.js} +1 -1
  65. package/apps/web/dist/assets/{stata-BacEfVTr.js → stata-l31dxrtC.js} +1 -1
  66. package/apps/web/dist/assets/{surrealql-CYW10JNe.js → surrealql-x6LM7pkl.js} +1 -1
  67. package/apps/web/dist/assets/{svelte-D3_tCKGs.js → svelte-CtkYFYuK.js} +1 -1
  68. package/apps/web/dist/assets/{templ-BGKIfY_b.js → templ-DHMinkR-.js} +1 -1
  69. package/apps/web/dist/assets/{tex-BkkYOaXX.js → tex-CXbWoQMY.js} +1 -1
  70. package/apps/web/dist/assets/{ts-tags-B02tnbpZ.js → ts-tags-BikYq-3m.js} +1 -1
  71. package/apps/web/dist/assets/{tsx-D3MB1IUf.js → tsx-zHJnYG9T.js} +1 -1
  72. package/apps/web/dist/assets/{twig-CPhw2wGK.js → twig-DKCfiSr9.js} +1 -1
  73. package/apps/web/dist/assets/{typescript-B7U4faGm.js → typescript-K9TDgxRD.js} +1 -1
  74. package/apps/web/dist/assets/{typst-CN9EZswy.js → typst-BpXkFpDR.js} +1 -1
  75. package/apps/web/dist/assets/{vue-YH8dfjo_.js → vue-BYYRFXPM.js} +1 -1
  76. package/apps/web/dist/assets/{vue-html-NwX2xzgp.js → vue-html-BR347tzO.js} +1 -1
  77. package/apps/web/dist/assets/{vue-vine-DoRmnjLj.js → vue-vine-Jv4OHYgW.js} +1 -1
  78. package/apps/web/dist/assets/{xml-DgfgLpPc.js → xml-DuYGU-7M.js} +1 -1
  79. package/apps/web/dist/assets/{xsl-CEwQRUK_.js → xsl-B950Zbyt.js} +1 -1
  80. package/apps/web/dist/assets/{yaml-CEFOzF95.js → yaml-XFYTn8dR.js} +1 -1
  81. package/apps/web/dist/icon-192.png +0 -0
  82. package/apps/web/dist/icon-512.png +0 -0
  83. package/apps/web/dist/icon-maskable-512.png +0 -0
  84. package/apps/web/dist/index.html +3 -1
  85. package/apps/web/dist/sw.js +1 -92
  86. package/package.json +1 -1
  87. package/apps/web/dist/assets/index-rgKS_aMw.js +0 -1148
package/README.md CHANGED
@@ -20,12 +20,13 @@ Then open the pairing link it prints. It pairs this browser with the server, so
20
20
  | `offsite pair` | Makes a pairing token for another browser and prints its links. `--name` labels it |
21
21
  | `offsite unpair` | Lists paired browsers so you can pick which to unpair |
22
22
 
23
- | Flag | Default | What it sets |
24
- | ----------- | ------------ | -------------------------------------------- |
25
- | `--host` | `127.0.0.1` | Address to listen on |
26
- | `--port` | `47841` | Port to listen on |
27
- | `--dir` | `~/.offsite` | Folder for settings and accounts |
28
- | `--no-auth` | auth on | Accept connections without the pairing token |
23
+ | Flag | Default | What it sets |
24
+ | ----------- | ------------ | ------------------------------------------------------------ |
25
+ | `--host` | `127.0.0.1` | Address to listen on |
26
+ | `--port` | `47841` | Port to listen on |
27
+ | `--dir` | `~/.offsite` | Folder for settings and accounts |
28
+ | `--no-auth` | auth on | Accept connections without the pairing token |
29
+ | `--no-pair` | pair on | Don't create a pairing token or print pairing links on start |
29
30
 
30
31
  Pairing tokens stay in `tokens.json` inside `--dir`. A running offsite disconnects an unpaired browser within seconds.
31
32
 
@@ -47,7 +47,7 @@ function broadcast(event) {
47
47
  //#region src/args.ts
48
48
  let command = "web";
49
49
  let name = null;
50
- const program = new Command("offsite").description("Starts the server and the web app").option("--host <host>", "Address to listen on", "127.0.0.1").option("--port <port>", "Port to listen on", "47841").option("--dir <dir>", "Folder for settings and accounts", path.join(os.homedir(), ".offsite")).option("--no-auth", "Accept connections without the pairing token");
50
+ const program = new Command("offsite").description("Starts the server and the web app").option("--host <host>", "Address to listen on", "127.0.0.1").option("--port <port>", "Port to listen on", "47841").option("--dir <dir>", "Folder for settings and accounts", path.join(os.homedir(), ".offsite")).option("--no-auth", "Accept connections without the pairing token").option("--no-pair", "Don't create a pairing token or print pairing links");
51
51
  program.command("web", { isDefault: true }).description("Starts the server and the web app, same as offsite");
52
52
  program.command("serve").description("Starts only the server, without the web app").action(() => {
53
53
  command = "serve";
@@ -85,15 +85,18 @@ function lock() {
85
85
  if (!hasCode(error, "EEXIST")) throw error;
86
86
  }
87
87
  let content;
88
+ let modified;
88
89
  try {
89
90
  content = readFileSync(lockFile, "utf8");
91
+ modified = statSync(lockFile).mtimeMs;
90
92
  } catch (error) {
91
93
  if (hasCode(error, "ENOENT")) return lock();
92
94
  throw error;
93
95
  }
94
96
  const pid = Number(content);
95
- if (!Number.isInteger(pid) || pid < 1) throw new Error(`invalid pid ${JSON.stringify(content)} in ${lockFile}`);
96
- if (pid !== process.pid && isRunning(pid)) {
97
+ const validPid = Number.isInteger(pid) && pid > 0;
98
+ const writtenThisBoot = modified > Date.now() - os.uptime() * 1e3;
99
+ if (validPid && writtenThisBoot && pid !== process.pid && isRunning(pid)) {
97
100
  consola.error(`offsite is already running for ${home} (pid ${pid})`);
98
101
  process.exit(1);
99
102
  }
@@ -3787,7 +3790,7 @@ var Run = class {
3787
3790
  return;
3788
3791
  }
3789
3792
  case "result": {
3790
- if (message.subtype !== "success") this.add(notice(message.errors.join("\n") || message.subtype));
3793
+ if (message.subtype !== "success" && message.terminal_reason !== "aborted_streaming" && message.terminal_reason !== "aborted_tools") this.add(notice(message.errors.filter((error) => !error.startsWith("[ede_diagnostic]")).join("\n") || message.subtype));
3791
3794
  this.finishTurn();
3792
3795
  const usage = this.model === null ? void 0 : message.modelUsage[this.model];
3793
3796
  if (this.context !== null && usage !== void 0) this.context = {
@@ -5649,7 +5652,7 @@ if (findClaude() === null) {
5649
5652
  process.exit(1);
5650
5653
  }
5651
5654
  const publicDir = path.join(import.meta.dirname, "..", "..", "web", "dist");
5652
- const token = args.auth ? firstToken() : null;
5655
+ const token = args.auth && args.pair ? firstToken() : null;
5653
5656
  const server = createServer((request, response) => {
5654
5657
  const url = new URL(request.url ?? "/", "http://localhost");
5655
5658
  if (url.pathname === "/version") {
@@ -5691,10 +5694,15 @@ if (args.auth) setInterval(() => {
5691
5694
  }, UNPAIR_CHECK);
5692
5695
  server.listen(port, args.host, () => {
5693
5696
  startPush(`${args.host}:${port}`);
5694
- const links = pairingLinks(token);
5695
- if (args.command === "web") console.log(`offsite is running at ${links.local}`);
5696
- console.log(`Open it on ${HOSTED_APP}: ${links.hosted}`);
5697
- if (token === null) console.warn("auth is off; anyone who can reach this port can control this machine");
5697
+ if (args.pair) {
5698
+ const links = pairingLinks(token);
5699
+ if (args.command === "web") console.log(`offsite is running at ${links.local}`);
5700
+ console.log(`Open it on ${HOSTED_APP}: ${links.hosted}`);
5701
+ } else {
5702
+ console.log(`offsite is running at ${address}`);
5703
+ console.log(`Open it on ${HOSTED_APP}`);
5704
+ }
5705
+ if (!args.auth) console.warn("auth is off; anyone who can reach this port can control this machine");
5698
5706
  });
5699
5707
  process.on("SIGINT", stop);
5700
5708
  process.on("SIGTERM", stop);