townmouse 0.0.0-stage → 0.2.1
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/CHANGELOG.md +126 -0
- package/DESIGN.md +169 -0
- package/LICENSE +661 -0
- package/README.md +368 -2
- package/SECURITY.md +57 -0
- package/TOWNMOUSE.md +91 -0
- package/assets/brand/mascot/README.md +23 -0
- package/assets/brand/mascot/townmouse-aristocrat.png +0 -0
- package/assets/brand/mascot/townmouse-icon.svg +1 -0
- package/assets/brand/mascot/townmouse-monocled.png +0 -0
- package/bin/townmouse +68 -0
- package/docs/PACKAGING.md +275 -0
- package/docs/browser-workspace.md +184 -0
- package/docs/panes.md +252 -0
- package/native/TownmouseApp.swift +108 -0
- package/package.json +89 -4
- package/public/apple-touch-icon.png +0 -0
- package/public/brand/floydslabs-credit.png +0 -0
- package/public/brand/floydslabs-credit.webp +0 -0
- package/public/brand/townmouse-aristocrat.webp +0 -0
- package/public/brand/townmouse-monocled.webp +0 -0
- package/public/clipboard-text.mjs +5 -0
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/favicon.svg +1 -0
- package/public/features/autosave.mjs +76 -0
- package/public/features/clipboard.mjs +69 -0
- package/public/features/command-palette.mjs +181 -0
- package/public/features/desktop-palette.mjs +19 -0
- package/public/features/export.mjs +37 -0
- package/public/features/file-drop.mjs +77 -0
- package/public/features/floating-palette.mjs +113 -0
- package/public/features/fontsize.mjs +72 -0
- package/public/features/haptic-keys.mjs +42 -0
- package/public/features/history-undo.mjs +102 -0
- package/public/features/keepalive.mjs +36 -0
- package/public/features/keybar-config.mjs +70 -0
- package/public/features/keyboard-shortcuts.mjs +74 -0
- package/public/features/links.mjs +139 -0
- package/public/features/multi-window-sync.mjs +74 -0
- package/public/features/osc-bridge.mjs +59 -0
- package/public/features/phone-landscape-focus.mjs +157 -0
- package/public/features/recent-commands.mjs +100 -0
- package/public/features/search.mjs +134 -0
- package/public/features/session-lock.mjs +96 -0
- package/public/features/session-manager.mjs +149 -0
- package/public/features/settings-sync.mjs +77 -0
- package/public/features/shortcut-help.mjs +85 -0
- package/public/features/smart-completions.mjs +101 -0
- package/public/features/smart-suggest.mjs +124 -0
- package/public/features/snippets.mjs +85 -0
- package/public/features/split-view.mjs +102 -0
- package/public/features/status-metrics.mjs +114 -0
- package/public/features/stylus-support.mjs +124 -0
- package/public/features/swipe-history.mjs +141 -0
- package/public/features/swipe-sessions.mjs +85 -0
- package/public/features/tab-reorder.mjs +62 -0
- package/public/features/theme-system.mjs +51 -0
- package/public/features/toast-status.mjs +118 -0
- package/public/features/two-finger-menu.mjs +87 -0
- package/public/features/voice-input.mjs +244 -0
- package/public/features/wake-fullscreen.mjs +67 -0
- package/public/features/window-title.mjs +40 -0
- package/public/features/zoom.mjs +80 -0
- package/public/icon-128.png +0 -0
- package/public/icon-180.png +0 -0
- package/public/icon-192.png +0 -0
- package/public/icon-48.png +0 -0
- package/public/icon-512-maskable.png +0 -0
- package/public/icon-512.png +0 -0
- package/public/icon.svg +1 -0
- package/public/index.html +1765 -0
- package/public/input-chunks.mjs +22 -0
- package/public/input-guard.mjs +210 -0
- package/public/manifest.json +56 -0
- package/public/panes.css +1257 -0
- package/public/panes.html +208 -0
- package/public/panes.mjs +2625 -0
- package/public/service-worker.js +67 -0
- package/public/workspace.css +1447 -0
- package/public/workspace.mjs +1475 -0
- package/scripts/install-service.sh +269 -0
- package/scripts/node-runtime.sh +138 -0
- package/scripts/panes +439 -0
- package/scripts/prepare-native.sh +35 -0
- package/scripts/run-hooks +69 -0
- package/scripts/t1.sh +113 -0
- package/scripts/uninstall-service.sh +49 -0
- package/src/agent-guide.js +260 -0
- package/src/attachments.js +128 -0
- package/src/browser-dom.js +545 -0
- package/src/browser-workspace.js +1246 -0
- package/src/chrome-resolve.js +80 -0
- package/src/pty-permissions.js +99 -0
- package/src/regex-worker.js +13 -0
- package/src/replay-text.js +189 -0
- package/src/request-boundary.js +58 -0
- package/src/safe-regex.js +87 -0
- package/src/server.js +1122 -0
- package/src/shell-resolve.js +42 -0
- package/src/static-deps.js +61 -0
- package/src/workspace-panes.js +1099 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/* Townmouse service worker — offline shell only. */
|
|
2
|
+
const CACHE_NAME = 'townmouse-shell-v1';
|
|
3
|
+
const OFFLINE_ASSETS = [
|
|
4
|
+
'/',
|
|
5
|
+
'/index.html',
|
|
6
|
+
'/manifest.json',
|
|
7
|
+
'/favicon.svg',
|
|
8
|
+
'/icon.svg',
|
|
9
|
+
'/favicon-16x16.png',
|
|
10
|
+
'/favicon-32x32.png',
|
|
11
|
+
'/apple-touch-icon.png',
|
|
12
|
+
'/icon-180.png',
|
|
13
|
+
'/icon-192.png',
|
|
14
|
+
'/icon-512.png',
|
|
15
|
+
'/icon-512-maskable.png',
|
|
16
|
+
'/brand/townmouse-aristocrat.webp',
|
|
17
|
+
'/brand/townmouse-monocled.webp',
|
|
18
|
+
'/brand/floydslabs-credit.webp',
|
|
19
|
+
'/input-guard.mjs',
|
|
20
|
+
'/node_modules/@xterm/xterm/css/xterm.css',
|
|
21
|
+
'/node_modules/@xterm/xterm/lib/xterm.mjs',
|
|
22
|
+
'/node_modules/@xterm/addon-fit/lib/addon-fit.mjs',
|
|
23
|
+
'/node_modules/@xterm/addon-web-links/lib/addon-web-links.mjs'
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
self.addEventListener('install', (event) => {
|
|
27
|
+
event.waitUntil(
|
|
28
|
+
caches.open(CACHE_NAME).then((cache) => cache.addAll(OFFLINE_ASSETS)).then(() => self.skipWaiting())
|
|
29
|
+
);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
self.addEventListener('activate', (event) => {
|
|
33
|
+
event.waitUntil((async () => {
|
|
34
|
+
// Retire caches from the TerminalOne-branded shell.
|
|
35
|
+
const keys = await caches.keys();
|
|
36
|
+
await Promise.all(keys.filter((key) => key.startsWith('terminalone-shell-')).map((key) => caches.delete(key)));
|
|
37
|
+
await self.clients.claim();
|
|
38
|
+
})());
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
self.addEventListener('fetch', (event) => {
|
|
42
|
+
if (event.request.method !== 'GET') return;
|
|
43
|
+
const url = new URL(event.request.url);
|
|
44
|
+
if (url.origin !== self.location.origin || !OFFLINE_ASSETS.includes(url.pathname)) return;
|
|
45
|
+
// Always try the server first so an installed PWA receives input fixes.
|
|
46
|
+
// Only shell assets may fall back to cache; a failed API call or module
|
|
47
|
+
// request must never receive index.html in place of its actual response.
|
|
48
|
+
event.respondWith(
|
|
49
|
+
(async () => {
|
|
50
|
+
try {
|
|
51
|
+
const response = await fetch(event.request);
|
|
52
|
+
if (response.ok) {
|
|
53
|
+
try {
|
|
54
|
+
const cache = await caches.open(CACHE_NAME);
|
|
55
|
+
await cache.put(event.request, response.clone());
|
|
56
|
+
} catch { /* Cache limits must not hide a successful online response. */ }
|
|
57
|
+
}
|
|
58
|
+
return response;
|
|
59
|
+
} catch {
|
|
60
|
+
try {
|
|
61
|
+
const cache = await caches.open(CACHE_NAME);
|
|
62
|
+
return await cache.match(event.request) || Response.error();
|
|
63
|
+
} catch { return Response.error(); }
|
|
64
|
+
}
|
|
65
|
+
})()
|
|
66
|
+
);
|
|
67
|
+
});
|