@datnguyennnx/localterm 0.0.15

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 (107) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +72 -0
  3. package/bin/localterm.mjs +2 -0
  4. package/dist/commands/restart.d.ts +9 -0
  5. package/dist/commands/restart.d.ts.map +1 -0
  6. package/dist/commands/restart.js +50 -0
  7. package/dist/commands/restart.js.map +1 -0
  8. package/dist/commands/start.d.ts +11 -0
  9. package/dist/commands/start.d.ts.map +1 -0
  10. package/dist/commands/start.js +163 -0
  11. package/dist/commands/start.js.map +1 -0
  12. package/dist/commands/status.d.ts +2 -0
  13. package/dist/commands/status.d.ts.map +1 -0
  14. package/dist/commands/status.js +34 -0
  15. package/dist/commands/status.js.map +1 -0
  16. package/dist/commands/stop.d.ts +2 -0
  17. package/dist/commands/stop.d.ts.map +1 -0
  18. package/dist/commands/stop.js +52 -0
  19. package/dist/commands/stop.js.map +1 -0
  20. package/dist/constants.d.ts +27 -0
  21. package/dist/constants.d.ts.map +1 -0
  22. package/dist/constants.js +27 -0
  23. package/dist/constants.js.map +1 -0
  24. package/dist/errors.d.ts +101 -0
  25. package/dist/errors.d.ts.map +1 -0
  26. package/dist/errors.js +164 -0
  27. package/dist/errors.js.map +1 -0
  28. package/dist/index.d.ts +2 -0
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.js +67 -0
  31. package/dist/index.js.map +1 -0
  32. package/dist/paths.d.ts +5 -0
  33. package/dist/paths.d.ts.map +1 -0
  34. package/dist/paths.js +7 -0
  35. package/dist/paths.js.map +1 -0
  36. package/dist/state.d.ts +8 -0
  37. package/dist/state.d.ts.map +1 -0
  38. package/dist/state.js +67 -0
  39. package/dist/state.js.map +1 -0
  40. package/dist/utils/build-daemon-args.d.ts +9 -0
  41. package/dist/utils/build-daemon-args.d.ts.map +1 -0
  42. package/dist/utils/build-daemon-args.js +12 -0
  43. package/dist/utils/build-daemon-args.js.map +1 -0
  44. package/dist/utils/cli-entry.d.ts +2 -0
  45. package/dist/utils/cli-entry.d.ts.map +1 -0
  46. package/dist/utils/cli-entry.js +5 -0
  47. package/dist/utils/cli-entry.js.map +1 -0
  48. package/dist/utils/parse-port-option.d.ts +2 -0
  49. package/dist/utils/parse-port-option.d.ts.map +1 -0
  50. package/dist/utils/parse-port-option.js +14 -0
  51. package/dist/utils/parse-port-option.js.map +1 -0
  52. package/dist/utils/poll-for-daemon-ready.d.ts +22 -0
  53. package/dist/utils/poll-for-daemon-ready.d.ts.map +1 -0
  54. package/dist/utils/poll-for-daemon-ready.js +36 -0
  55. package/dist/utils/poll-for-daemon-ready.js.map +1 -0
  56. package/dist/utils/read-package-version.d.ts +2 -0
  57. package/dist/utils/read-package-version.d.ts.map +1 -0
  58. package/dist/utils/read-package-version.js +12 -0
  59. package/dist/utils/read-package-version.js.map +1 -0
  60. package/dist/utils/report-cli-error.d.ts +3 -0
  61. package/dist/utils/report-cli-error.d.ts.map +1 -0
  62. package/dist/utils/report-cli-error.js +19 -0
  63. package/dist/utils/report-cli-error.js.map +1 -0
  64. package/dist/utils/run-start-preflight.d.ts +3 -0
  65. package/dist/utils/run-start-preflight.d.ts.map +1 -0
  66. package/dist/utils/run-start-preflight.js +26 -0
  67. package/dist/utils/run-start-preflight.js.map +1 -0
  68. package/dist/utils/sleep.d.ts +2 -0
  69. package/dist/utils/sleep.d.ts.map +1 -0
  70. package/dist/utils/sleep.js +2 -0
  71. package/dist/utils/sleep.js.map +1 -0
  72. package/dist/utils/spawn-daemon.d.ts +9 -0
  73. package/dist/utils/spawn-daemon.d.ts.map +1 -0
  74. package/dist/utils/spawn-daemon.js +13 -0
  75. package/dist/utils/spawn-daemon.js.map +1 -0
  76. package/dist/utils/verify-pid-is-localterm.d.ts +4 -0
  77. package/dist/utils/verify-pid-is-localterm.d.ts.map +1 -0
  78. package/dist/utils/verify-pid-is-localterm.js +37 -0
  79. package/dist/utils/verify-pid-is-localterm.js.map +1 -0
  80. package/package.json +67 -0
  81. package/terminal/assets/geist-mono-cyrillic-400-normal-BPBWmzPh.woff +0 -0
  82. package/terminal/assets/geist-mono-cyrillic-400-normal-Ce5q_31Z.woff2 +0 -0
  83. package/terminal/assets/geist-mono-cyrillic-500-normal-CJBLNVQT.woff2 +0 -0
  84. package/terminal/assets/geist-mono-cyrillic-500-normal-mNhfPmgl.woff +0 -0
  85. package/terminal/assets/geist-mono-cyrillic-600-normal-CGND36d7.woff2 +0 -0
  86. package/terminal/assets/geist-mono-cyrillic-600-normal-DrylrLu6.woff +0 -0
  87. package/terminal/assets/geist-mono-latin-400-normal-CoULgQGM.woff +0 -0
  88. package/terminal/assets/geist-mono-latin-400-normal-LC9RFr9I.woff2 +0 -0
  89. package/terminal/assets/geist-mono-latin-500-normal-D3o2eNa9.woff2 +0 -0
  90. package/terminal/assets/geist-mono-latin-500-normal-DOxI7kZ4.woff +0 -0
  91. package/terminal/assets/geist-mono-latin-600-normal-DQQBcVN0.woff2 +0 -0
  92. package/terminal/assets/geist-mono-latin-600-normal-DsVeri3b.woff +0 -0
  93. package/terminal/assets/geist-mono-latin-ext-400-normal-Cgks_Qgx.woff2 +0 -0
  94. package/terminal/assets/geist-mono-latin-ext-400-normal-CxNRRMGd.woff +0 -0
  95. package/terminal/assets/geist-mono-latin-ext-500-normal-CQcGuCNt.woff2 +0 -0
  96. package/terminal/assets/geist-mono-latin-ext-500-normal-diTenJ8L.woff +0 -0
  97. package/terminal/assets/geist-mono-latin-ext-600-normal-CJwYYto2.woff2 +0 -0
  98. package/terminal/assets/geist-mono-latin-ext-600-normal-EvIRCXgu.woff +0 -0
  99. package/terminal/assets/index-CuLnEIy7.css +1 -0
  100. package/terminal/assets/index-Ds9TDhiN.js +121 -0
  101. package/terminal/assets/index-Ds9TDhiN.js.map +1 -0
  102. package/terminal/icons/icon-192.png +0 -0
  103. package/terminal/icons/icon-512.png +0 -0
  104. package/terminal/icons/icon.svg +11 -0
  105. package/terminal/index.html +38 -0
  106. package/terminal/manifest.webmanifest +37 -0
  107. package/terminal/sw.js +79 -0
Binary file
Binary file
@@ -0,0 +1,11 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
2
+ <rect width="24" height="24" fill="#f4f4f5" />
3
+ <path
4
+ d="M7 9 11 12 7 15 M13 15 H17"
5
+ fill="none"
6
+ stroke="#10b981"
7
+ stroke-width="2"
8
+ stroke-linecap="round"
9
+ stroke-linejoin="round"
10
+ />
11
+ </svg>
@@ -0,0 +1,38 @@
1
+ <!doctype html>
2
+ <html lang="en" class="dark">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta
6
+ name="viewport"
7
+ content="width=device-width, initial-scale=1.0, viewport-fit=cover, interactive-widget=resizes-content"
8
+ />
9
+ <meta name="color-scheme" content="dark light" />
10
+ <meta name="robots" content="noindex, nofollow" />
11
+ <meta name="description" content="A local browser-based terminal hub." />
12
+ <meta name="theme-color" content="#101010" />
13
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
14
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
15
+ <link
16
+ rel="stylesheet"
17
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
18
+ />
19
+ <link
20
+ rel="icon"
21
+ type="image/svg+xml"
22
+ href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cstyle%3Esvg{color:%23101010}@media(prefers-color-scheme:dark){svg{color:%23ededed}}%3C/style%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='m6 8 4 4-4 4M12 16h6'/%3E%3C/svg%3E"
23
+ />
24
+ <link rel="manifest" href="/manifest.webmanifest" />
25
+ <link rel="apple-touch-icon" href="/icons/icon-192.png" />
26
+ <meta name="application-name" content="localterm" />
27
+ <meta name="mobile-web-app-capable" content="yes" />
28
+ <meta name="apple-mobile-web-app-capable" content="yes" />
29
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
30
+ <meta name="apple-mobile-web-app-title" content="localterm" />
31
+ <title>localterm</title>
32
+ <script type="module" crossorigin src="/assets/index-Ds9TDhiN.js"></script>
33
+ <link rel="stylesheet" crossorigin href="/assets/index-CuLnEIy7.css">
34
+ </head>
35
+ <body>
36
+ <div id="root"></div>
37
+ </body>
38
+ </html>
@@ -0,0 +1,37 @@
1
+ {
2
+ "id": "/",
3
+ "name": "localterm",
4
+ "short_name": "localterm",
5
+ "description": "Local browser-based terminal hub",
6
+ "start_url": "/",
7
+ "scope": "/",
8
+ "display": "standalone",
9
+ "display_override": ["window-controls-overlay", "standalone"],
10
+ "background_color": "#101010",
11
+ "theme_color": "#101010",
12
+ "orientation": "any",
13
+ "lang": "en",
14
+ "dir": "auto",
15
+ "categories": ["developer", "productivity", "utilities"],
16
+ "launch_handler": { "client_mode": "navigate-existing" },
17
+ "icons": [
18
+ {
19
+ "src": "/icons/icon.svg",
20
+ "sizes": "any",
21
+ "type": "image/svg+xml",
22
+ "purpose": "any"
23
+ },
24
+ {
25
+ "src": "/icons/icon-192.png",
26
+ "sizes": "192x192",
27
+ "type": "image/png",
28
+ "purpose": "any maskable"
29
+ },
30
+ {
31
+ "src": "/icons/icon-512.png",
32
+ "sizes": "512x512",
33
+ "type": "image/png",
34
+ "purpose": "any maskable"
35
+ }
36
+ ]
37
+ }
package/terminal/sw.js ADDED
@@ -0,0 +1,79 @@
1
+ const SHELL_VERSION = "aeae33093dfe";
2
+ const PRECACHE_URLS = JSON.parse("[\"/\",\"/assets/geist-mono-cyrillic-400-normal-BPBWmzPh.woff\",\"/assets/geist-mono-cyrillic-400-normal-Ce5q_31Z.woff2\",\"/assets/geist-mono-cyrillic-500-normal-CJBLNVQT.woff2\",\"/assets/geist-mono-cyrillic-500-normal-mNhfPmgl.woff\",\"/assets/geist-mono-cyrillic-600-normal-CGND36d7.woff2\",\"/assets/geist-mono-cyrillic-600-normal-DrylrLu6.woff\",\"/assets/geist-mono-latin-400-normal-CoULgQGM.woff\",\"/assets/geist-mono-latin-400-normal-LC9RFr9I.woff2\",\"/assets/geist-mono-latin-500-normal-D3o2eNa9.woff2\",\"/assets/geist-mono-latin-500-normal-DOxI7kZ4.woff\",\"/assets/geist-mono-latin-600-normal-DQQBcVN0.woff2\",\"/assets/geist-mono-latin-600-normal-DsVeri3b.woff\",\"/assets/geist-mono-latin-ext-400-normal-Cgks_Qgx.woff2\",\"/assets/geist-mono-latin-ext-400-normal-CxNRRMGd.woff\",\"/assets/geist-mono-latin-ext-500-normal-CQcGuCNt.woff2\",\"/assets/geist-mono-latin-ext-500-normal-diTenJ8L.woff\",\"/assets/geist-mono-latin-ext-600-normal-CJwYYto2.woff2\",\"/assets/geist-mono-latin-ext-600-normal-EvIRCXgu.woff\",\"/assets/index-CuLnEIy7.css\",\"/assets/index-Ds9TDhiN.js\",\"/icons/icon-192.png\",\"/icons/icon-512.png\",\"/icons/icon.svg\",\"/manifest.webmanifest\"]");
3
+ const CACHE_PREFIX = "localterm-shell-v";
4
+ const PRECACHE = `${CACHE_PREFIX}${SHELL_VERSION}`;
5
+ const SHELL_URL = "/";
6
+
7
+ const isShellAsset = (request, url) =>
8
+ request.method === "GET" &&
9
+ url.origin === self.location.origin &&
10
+ !url.pathname.startsWith("/api/") &&
11
+ url.pathname !== "/ws";
12
+
13
+ const fromCacheOrNetwork = async (request) => {
14
+ const cache = await caches.open(PRECACHE);
15
+ const cached = await cache.match(request);
16
+ if (cached) return cached;
17
+ const fresh = await fetch(request);
18
+ if (fresh.ok) await cache.put(request, fresh.clone());
19
+ return fresh;
20
+ };
21
+
22
+ self.addEventListener("install", (event) => {
23
+ event.waitUntil(
24
+ (async () => {
25
+ const cache = await caches.open(PRECACHE);
26
+ await Promise.all(
27
+ PRECACHE_URLS.map(async (url) => {
28
+ try {
29
+ await cache.add(url);
30
+ } catch {
31
+ // A deploy can replace hashed assets while an older worker is installing.
32
+ }
33
+ }),
34
+ );
35
+ await self.skipWaiting();
36
+ })(),
37
+ );
38
+ });
39
+
40
+ self.addEventListener("activate", (event) => {
41
+ event.waitUntil(
42
+ (async () => {
43
+ const keys = await caches.keys();
44
+ await Promise.all(
45
+ keys
46
+ .filter((key) => key.startsWith(CACHE_PREFIX) && key !== PRECACHE)
47
+ .map((key) => caches.delete(key)),
48
+ );
49
+ await self.clients.claim();
50
+ })(),
51
+ );
52
+ });
53
+
54
+ self.addEventListener("fetch", (event) => {
55
+ const { request } = event;
56
+ const url = new URL(request.url);
57
+ if (!isShellAsset(request, url)) return;
58
+
59
+ if (request.mode === "navigate") {
60
+ event.respondWith(
61
+ (async () => {
62
+ try {
63
+ const fresh = await fetch(request);
64
+ if (fresh.ok) {
65
+ const cache = await caches.open(PRECACHE);
66
+ await cache.put(SHELL_URL, fresh.clone());
67
+ }
68
+ return fresh;
69
+ } catch {
70
+ const cache = await caches.open(PRECACHE);
71
+ return (await cache.match(SHELL_URL)) || (await cache.match(request)) || Response.error();
72
+ }
73
+ })(),
74
+ );
75
+ return;
76
+ }
77
+
78
+ event.respondWith(fromCacheOrNetwork(request).catch(() => Response.error()));
79
+ });