kiteline 0.0.0-stage → 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.
Files changed (71) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +70 -2
  3. package/dist/auth-YhkfTv6K.mjs +60 -0
  4. package/dist/banner-CXnDgf5p.mjs +1136 -0
  5. package/dist/cli.mjs +111 -0
  6. package/dist/package-CbMOnF6R.mjs +3 -0
  7. package/dist/service-BCgNAv2Z.mjs +193 -0
  8. package/dist/show-pairing-CTd0UfS1.mjs +30 -0
  9. package/dist/show-pairing-Zurbk9wK.mjs +1 -0
  10. package/dist/src-DSH8d4ZM.mjs +13895 -0
  11. package/dist/web/apple-touch-icon-180x180.png +0 -0
  12. package/dist/web/assets/IconBase.es-h0cGkmPy.js +9 -0
  13. package/dist/web/assets/MagnifyingGlass.es-CpSmmHxy.js +1 -0
  14. package/dist/web/assets/composer-WnPpY669.js +1 -0
  15. package/dist/web/assets/copy-button-DBETbWKF.js +1 -0
  16. package/dist/web/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
  17. package/dist/web/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
  18. package/dist/web/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
  19. package/dist/web/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  20. package/dist/web/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
  21. package/dist/web/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
  22. package/dist/web/assets/index-CA73h-Vn.css +1 -0
  23. package/dist/web/assets/index-CTAi3HIp.js +11 -0
  24. package/dist/web/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  25. package/dist/web/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  26. package/dist/web/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  27. package/dist/web/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  28. package/dist/web/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  29. package/dist/web/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  30. package/dist/web/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  31. package/dist/web/assets/lazy/core-CuC-kkU7.js +12 -0
  32. package/dist/web/assets/lazy/css-BGIxQoYs.js +1 -0
  33. package/dist/web/assets/lazy/css-DgaLhXQH.js +1 -0
  34. package/dist/web/assets/lazy/diff-woXpYk--.js +1 -0
  35. package/dist/web/assets/lazy/dockerfile-IyjqRm3v.js +1 -0
  36. package/dist/web/assets/lazy/engine-javascript-C30F4iNc.js +141 -0
  37. package/dist/web/assets/lazy/github-dark-default-DXG-b-1a.js +1 -0
  38. package/dist/web/assets/lazy/github-light-default-BXViO-2h.js +1 -0
  39. package/dist/web/assets/lazy/go-rLFTqkRN.js +1 -0
  40. package/dist/web/assets/lazy/html-CvFb5cGI.js +1 -0
  41. package/dist/web/assets/lazy/javascript-BzbQS41l.js +1 -0
  42. package/dist/web/assets/lazy/javascript-CpIGwZ_Y.js +1 -0
  43. package/dist/web/assets/lazy/json-qhed-kSA.js +1 -0
  44. package/dist/web/assets/lazy/jsx-Bz0zcwM4.js +1 -0
  45. package/dist/web/assets/lazy/markdown-BYOwaDjH.js +1 -0
  46. package/dist/web/assets/lazy/python-gzcpVVnB.js +1 -0
  47. package/dist/web/assets/lazy/rust-DpiIf5JO.js +1 -0
  48. package/dist/web/assets/lazy/shellscript-CLZ0U2zV.js +1 -0
  49. package/dist/web/assets/lazy/sql-CEbI0hMM.js +1 -0
  50. package/dist/web/assets/lazy/toml-CcmNWLt0.js +1 -0
  51. package/dist/web/assets/lazy/tsx-udAQXfEw.js +1 -0
  52. package/dist/web/assets/lazy/typescript-bsJCZSQ-.js +1 -0
  53. package/dist/web/assets/lazy/yaml-rwi0_p6S.js +1 -0
  54. package/dist/web/assets/new-D_XEbYrm.js +1 -0
  55. package/dist/web/assets/prefs-D6OSXuFe.js +1 -0
  56. package/dist/web/assets/routes-Csbxwlji.js +1 -0
  57. package/dist/web/assets/s._sessionId-BlR4dPFc.js +45 -0
  58. package/dist/web/assets/settings-DRpTnWMo.js +1 -0
  59. package/dist/web/assets/status-C7fEa4v1.js +1 -0
  60. package/dist/web/favicon.ico +0 -0
  61. package/dist/web/index.html +40 -0
  62. package/dist/web/logo.svg +12 -0
  63. package/dist/web/manifest.webmanifest +1 -0
  64. package/dist/web/maskable-icon-512x512.png +0 -0
  65. package/dist/web/pwa-192x192.png +0 -0
  66. package/dist/web/pwa-512x512.png +0 -0
  67. package/dist/web/pwa-64x64.png +0 -0
  68. package/dist/web/registerSW.js +1 -0
  69. package/dist/web/sw.js +1 -0
  70. package/dist/web/workbox-dcde9eb3.js +1 -0
  71. package/package.json +34 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sifen Fisaha
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,71 @@
1
- # Temporary Holding Version
1
+ <div align="center">
2
+ <img src="https://raw.githubusercontent.com/sifenfisaha/kiteline/master/apps/web/public/logo.svg" width="88" alt="" />
3
+ <h1>Kiteline</h1>
4
+ <p><strong>Your terminal, in your pocket.</strong><br />Drive Claude Code on your computer from your phone.</p>
5
+ <p><a href="https://kiteline.seefun.dev/">Website</a> · <a href="https://kiteline.seefun.dev/docs/">Docs</a> · <a href="#quick-start">Quick start</a></p>
6
+ </div>
2
7
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
8
+ <p align="center">
9
+ <img src="https://raw.githubusercontent.com/sifenfisaha/kiteline/master/docs/kiteline-demo.webp" width="880" alt="On the phone, Claude Code reads and searches the project, edits src/auth.ts, and runs the tests on its own in Auto mode; the line changes in the editor on the computer as the edit lands, and the reply arrives on the phone." />
10
+ </p>
11
+
12
+ Kiteline runs Claude Code on your computer and puts every session on your phone. Pick up where you left off, start something new, and approve what it does from wherever you are.
13
+
14
+ It's self-hosted: your phone talks straight to your computer, and Claude Code keeps running there with your files, your settings and your login.
15
+
16
+ ## What you can do
17
+
18
+ - **Every session, one list.** The ones you start from your phone and the ones you run in a terminal.
19
+ - **Pick up where you left off,** or start a new session in any project.
20
+ - **Watch it work.** Replies stream in, with every command and edit laid out step by step.
21
+ - **Approve from anywhere.** Allow, deny with a note, or always allow, right from your phone.
22
+ - **Your modes, your models, your effort.** Change how much it asks, which model it uses and how hard it thinks, mid-session. `/effort` works just like in the terminal.
23
+ - **Feels like an app.** Add it to your home screen, in light or dark.
24
+
25
+ ## Quick start
26
+
27
+ You need Node.js 22.18 or newer, and Claude Code signed in on the computer.
28
+
29
+ ```bash
30
+ npx kiteline --relay
31
+ ```
32
+
33
+ Scan the QR code it prints with your phone's camera, and you're in, on any network. `--relay` connects through Kiteline's relay, sealed end to end: it passes your sessions on without being able to read them. Leave it out to keep Kiteline to your own Wi-Fi, or [use Tailscale](https://kiteline.seefun.dev/docs/#tailscale).
34
+
35
+ To keep it running in the background, starting with your computer (Linux):
36
+
37
+ ```bash
38
+ npm install -g kiteline
39
+ kiteline service install --relay
40
+ ```
41
+
42
+ Everything else is in the **[docs](https://kiteline.seefun.dev/docs/)**:
43
+
44
+ - [Reach it from anywhere](https://kiteline.seefun.dev/docs/#anywhere), and [what the relay sees](https://kiteline.seefun.dev/docs/#relay-privacy)
45
+ - [Keep it running](https://kiteline.seefun.dev/docs/#always-on) all the time, even with the lid closed
46
+ - [Approvals](https://kiteline.seefun.dev/docs/#approve) and [permission modes](https://kiteline.seefun.dev/docs/#modes)
47
+ - [Configuration](https://kiteline.seefun.dev/docs/#config), [security](https://kiteline.seefun.dev/docs/#security) and [troubleshooting](https://kiteline.seefun.dev/docs/#troubleshooting)
48
+
49
+ ## Good to know
50
+
51
+ - **Treat the pairing link like a password.** Anyone who opens it can drive Claude Code on your computer. Don't open Kiteline's port to the internet; use `--relay` or Tailscale to reach it from elsewhere.
52
+ - **It uses Claude Code's own login,** your Claude plan or API key. Check that the way you use it fits your plan's terms.
53
+ - **Tested on Linux so far.** Reports from real phones, macOS and Windows are very welcome.
54
+
55
+ ## Contributing
56
+
57
+ ```bash
58
+ git clone https://github.com/sifenfisaha/kiteline.git && cd kiteline
59
+ pnpm install
60
+ pnpm dev # the server, the app and the website, reloading as you edit
61
+ pnpm check # lint and format
62
+ pnpm release # build the npm package into release/
63
+ ```
64
+
65
+ Issues and pull requests are welcome.
66
+
67
+ ## Credits
68
+
69
+ Built on [Better-T-Stack](https://github.com/AmanVarshney01/create-better-t-stack), with [Phosphor](https://phosphoricons.com) icons and [Inter](https://rsms.me/inter/). The demo is made with [Stageshow](https://benji.org/stageshow). The website's sky is a photo by [Nothing Ahead](https://www.pexels.com/@ian-panelo/) on [Pexels](https://www.pexels.com/photo/clouds-in-the-sky-8726326/), used under the [Pexels license](https://www.pexels.com/license/) rather than this project's MIT license.
70
+
71
+ Kiteline is an independent project, not made by or affiliated with Anthropic. [MIT](https://github.com/sifenfisaha/kiteline/blob/master/LICENSE) licensed.
@@ -0,0 +1,60 @@
1
+ import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
2
+ import { homedir } from "node:os";
3
+ import { join } from "node:path";
4
+ import { createHmac, randomBytes, timingSafeEqual } from "node:crypto";
5
+ // src/auth.ts
6
+ const DEVICE_COOKIE = "kiteline_device";
7
+ function kitelineHome(override) {
8
+ return override || join(homedir(), ".kiteline");
9
+ }
10
+ /**
11
+ * The pairing token lives in ~/.kiteline/auth.json (mode 600) so paired phones
12
+ * survive restarts. `--new-token` replaces it, which unpairs every device.
13
+ */
14
+ function loadToken(home, options) {
15
+ if (options.fixed) return options.fixed;
16
+ const file = join(home, "auth.json");
17
+ if (!options.rotate) try {
18
+ const stored = JSON.parse(readFileSync(file, "utf8"));
19
+ if (typeof stored.token === "string" && stored.token.length >= 16) return stored.token;
20
+ } catch {}
21
+ const token = randomBytes(18).toString("base64url");
22
+ mkdirSync(home, {
23
+ recursive: true,
24
+ mode: 448
25
+ });
26
+ writeFileSync(file, `${JSON.stringify({
27
+ token,
28
+ createdAt: (/* @__PURE__ */ new Date()).toISOString()
29
+ }, null, 2)}\n`, { mode: 384 });
30
+ return token;
31
+ }
32
+ /** What a paired device's cookie holds. Derived from the token, so a new token unpairs everyone. */
33
+ function deviceSecret(token) {
34
+ return createHmac("sha256", token).update("kiteline-device-v1").digest("base64url");
35
+ }
36
+ function safeEqual(a, b) {
37
+ const left = Buffer.from(a);
38
+ const right = Buffer.from(b);
39
+ return left.length === right.length && timingSafeEqual(left, right);
40
+ }
41
+ /** Slows down guessing: ten wrong codes from one address locks it out for ten minutes. */
42
+ var PairLimiter = class {
43
+ failures = /* @__PURE__ */ new Map();
44
+ blocked(key) {
45
+ const entry = this.failures.get(key);
46
+ return !!entry && entry.count >= 10 && entry.until > Date.now();
47
+ }
48
+ fail(key) {
49
+ const entry = this.failures.get(key);
50
+ const fresh = !entry || entry.until < Date.now();
51
+ this.failures.set(key, {
52
+ count: fresh ? 1 : entry.count + 1,
53
+ until: Date.now() + 6e5
54
+ });
55
+ }
56
+ clear(key) {
57
+ this.failures.delete(key);
58
+ }
59
+ };
60
+ export { loadToken as a, kitelineHome as i, PairLimiter as n, safeEqual as o, deviceSecret as r, DEVICE_COOKIE as t };