@lelouchhe/webagent 0.3.0 → 0.4.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/README.md +58 -23
- package/bin/webagent.mjs +119 -8
- package/config.toml +96 -3
- package/dist/index.html +64 -41
- package/dist/js/app.GSAIYHML.js +4 -0
- package/dist/js/chunk.AJZBJBMO.js +1 -0
- package/dist/js/chunk.CGWFHJI2.js +76 -0
- package/dist/js/chunk.D4ZYHJAM.js +1 -0
- package/dist/js/chunk.VZXGXFNN.js +5 -0
- package/dist/js/login.PYIK52HN.js +1 -0
- package/dist/js/viewer.6DT53STL.js +1 -0
- package/dist/login.html +49 -0
- package/dist/share-viewer.00gubshk.css +114 -0
- package/dist/share-viewer.html +53 -0
- package/dist/styles.012p32dz.css +1443 -0
- package/dist/sw.js +79 -27
- package/dist/theme-init.js +6 -0
- package/lib/agent-detect.js +110 -0
- package/lib/atomic-write.js +50 -0
- package/lib/attachment-dispatch.js +86 -0
- package/lib/attachment-interceptor.js +130 -0
- package/lib/attachment-labels.js +139 -0
- package/lib/attachments.js +154 -0
- package/lib/auth-middleware.js +102 -0
- package/lib/auth-store.js +269 -0
- package/lib/auth.js +89 -0
- package/lib/bootstrap.js +70 -0
- package/lib/bridge.js +244 -93
- package/lib/client-registry.js +60 -0
- package/lib/config.js +123 -9
- package/lib/daemon.js +175 -41
- package/lib/event-handler.js +209 -91
- package/lib/log-fmt.js +67 -0
- package/lib/log.js +83 -0
- package/lib/message-cleanup.js +48 -0
- package/lib/mode-bucket.js +62 -0
- package/lib/preflight.js +195 -0
- package/lib/push-service.js +338 -45
- package/lib/routes.js +1202 -144
- package/lib/server.js +149 -33
- package/lib/session-manager.js +164 -18
- package/lib/session-state.js +160 -0
- package/lib/sessions-anchor.js +28 -0
- package/lib/share/cleanup.js +45 -0
- package/lib/share/routes.js +972 -0
- package/lib/share/sanitize.js +179 -0
- package/lib/sse-manager.js +94 -8
- package/lib/sse-ticket.js +45 -0
- package/lib/startup-checks.js +94 -0
- package/lib/store.js +624 -30
- package/lib/title-service.js +42 -9
- package/lib/tokens.js +50 -0
- package/lib/types.js +23 -0
- package/package.json +38 -4
- package/dist/js/app.2562YGRO.js +0 -10
- package/dist/styles.008ve1hx.css +0 -669
- package/lib/shared/constants.js +0 -17
package/dist/login.html
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>Sign in — webagent</title>
|
|
7
|
+
<link rel="icon" href="/icons/icon.svg" type="image/svg+xml" />
|
|
8
|
+
<link rel="manifest" href="/manifest.json" />
|
|
9
|
+
<meta
|
|
10
|
+
name="theme-color"
|
|
11
|
+
content="#0d1117"
|
|
12
|
+
media="(prefers-color-scheme: dark)"
|
|
13
|
+
/>
|
|
14
|
+
<meta
|
|
15
|
+
name="theme-color"
|
|
16
|
+
content="#ffffff"
|
|
17
|
+
media="(prefers-color-scheme: light)"
|
|
18
|
+
/>
|
|
19
|
+
<script src="/theme-init.js"></script>
|
|
20
|
+
<link rel="stylesheet" href="/styles.012p32dz.css" />
|
|
21
|
+
</head>
|
|
22
|
+
<body class="login-page">
|
|
23
|
+
<div class="login-card">
|
|
24
|
+
<h1>>_ webagent</h1>
|
|
25
|
+
<p>
|
|
26
|
+
Paste your access token to sign in. Tokens are stored on this device
|
|
27
|
+
only.
|
|
28
|
+
</p>
|
|
29
|
+
<form id="login-form">
|
|
30
|
+
<input
|
|
31
|
+
id="token-input"
|
|
32
|
+
type="password"
|
|
33
|
+
placeholder="wat_..."
|
|
34
|
+
autocomplete="current-password"
|
|
35
|
+
autocorrect="off"
|
|
36
|
+
autocapitalize="none"
|
|
37
|
+
spellcheck="false"
|
|
38
|
+
/>
|
|
39
|
+
<div id="error" class="error" role="alert"></div>
|
|
40
|
+
<button id="submit-btn" type="submit">Sign in</button>
|
|
41
|
+
</form>
|
|
42
|
+
<p class="hint">
|
|
43
|
+
Don't have a token? Run
|
|
44
|
+
<code>webagent --create-token <name></code> on the server.
|
|
45
|
+
</p>
|
|
46
|
+
</div>
|
|
47
|
+
<script type="module" src="/js/login.PYIK52HN.js"></script>
|
|
48
|
+
</body>
|
|
49
|
+
</html>
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/* Share viewer shell styles. Adds on top of main styles.css. */
|
|
2
|
+
|
|
3
|
+
.share-viewer #header {
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.share-viewer .share-badge {
|
|
8
|
+
display: inline-block;
|
|
9
|
+
margin-left: 0.5em;
|
|
10
|
+
padding: 0 0.4em;
|
|
11
|
+
border: 1px solid var(--fg-dim, #888);
|
|
12
|
+
border-radius: 2px;
|
|
13
|
+
font-size: 0.8em;
|
|
14
|
+
text-transform: uppercase;
|
|
15
|
+
letter-spacing: 0.1em;
|
|
16
|
+
opacity: 0.8;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.share-viewer #messages {
|
|
20
|
+
padding-bottom: 4em;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.share-viewer #share-footer {
|
|
24
|
+
position: fixed;
|
|
25
|
+
bottom: 0;
|
|
26
|
+
left: 0;
|
|
27
|
+
right: 0;
|
|
28
|
+
padding: 0.5em 1em;
|
|
29
|
+
background: var(--bg, #0d1117);
|
|
30
|
+
border-top: 1px solid var(--border, #333);
|
|
31
|
+
font-size: 0.85em;
|
|
32
|
+
z-index: 10;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.share-viewer .share-footer-inner {
|
|
36
|
+
display: flex;
|
|
37
|
+
/* Byline-style status line: author · time · powered-by, all on one
|
|
38
|
+
row when there's room; flex-wrap drops them to additional rows when
|
|
39
|
+
not, preserving order. Pure CSS: no @media query, the breakpoint
|
|
40
|
+
emerges from the items' intrinsic widths. */
|
|
41
|
+
flex-wrap: wrap;
|
|
42
|
+
align-items: baseline;
|
|
43
|
+
gap: 0.3em 0.6em;
|
|
44
|
+
max-width: 960px;
|
|
45
|
+
margin: 0 auto;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Hide author/meta entirely while empty (loading state, or no
|
|
49
|
+
display_name). :empty matches when textContent is "". */
|
|
50
|
+
.share-viewer .share-footer-author:empty,
|
|
51
|
+
.share-viewer .share-footer-meta:empty {
|
|
52
|
+
display: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Bullet separator: placed AFTER a non-empty element rather than before
|
|
56
|
+
the next one. Two consequences:
|
|
57
|
+
1. The bullet inherits color from its host element (gray author / gray
|
|
58
|
+
meta), so it can never appear in the link's green.
|
|
59
|
+
2. :not(:empty) makes the bullet auto-disappear during loading and
|
|
60
|
+
whenever a slot has no content — no orphan bullets, no JS coordination.
|
|
61
|
+
Display: inline-block stops the meta span's dotted underline from
|
|
62
|
+
bleeding onto the bullet (text-decoration only blocks at non-inline
|
|
63
|
+
formatting contexts). */
|
|
64
|
+
.share-viewer .share-footer-author:not(:empty)::after,
|
|
65
|
+
.share-viewer .share-footer-meta:not(:empty)::after {
|
|
66
|
+
content: " ·";
|
|
67
|
+
opacity: 0.5;
|
|
68
|
+
margin-left: 0.05em;
|
|
69
|
+
display: inline-block;
|
|
70
|
+
text-decoration: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.share-viewer .share-footer-author {
|
|
74
|
+
opacity: 0.85;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.share-viewer .share-footer-promo {
|
|
78
|
+
/* Visible link: green accent (matches the >_ logo) + persistent
|
|
79
|
+
underline. No external-link icon — this app's terminal aesthetic
|
|
80
|
+
uses underline as the sole click affordance. */
|
|
81
|
+
color: var(--green);
|
|
82
|
+
text-decoration: underline;
|
|
83
|
+
text-underline-offset: 2px;
|
|
84
|
+
}
|
|
85
|
+
.share-viewer .share-footer-promo:hover,
|
|
86
|
+
.share-viewer .share-footer-promo:focus-visible {
|
|
87
|
+
filter: brightness(1.2);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.share-viewer .share-footer-meta {
|
|
91
|
+
opacity: 0.6;
|
|
92
|
+
font-family: var(--mono, monospace);
|
|
93
|
+
/* Subtle dotted underline + help cursor signals "hover for more" —
|
|
94
|
+
the tooltip reveals the exact UTC timestamp behind the relative
|
|
95
|
+
label ("5m ago" → "2026-04-28 05:19 UTC"). */
|
|
96
|
+
text-decoration: underline dotted;
|
|
97
|
+
text-underline-offset: 2px;
|
|
98
|
+
cursor: help;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.share-gone {
|
|
102
|
+
max-width: 40em;
|
|
103
|
+
margin: 4em auto;
|
|
104
|
+
padding: 2em;
|
|
105
|
+
text-align: center;
|
|
106
|
+
border: 1px solid var(--border, #333);
|
|
107
|
+
border-radius: 4px;
|
|
108
|
+
font-size: 1.2em;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.share-viewer .msg-body.md pre,
|
|
112
|
+
.share-viewer .msg-body.md code {
|
|
113
|
+
overflow-x: auto;
|
|
114
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>shared session — >_</title>
|
|
7
|
+
<link rel="icon" href="/icons/icon.svg" type="image/svg+xml" />
|
|
8
|
+
<meta
|
|
9
|
+
name="theme-color"
|
|
10
|
+
content="#0d1117"
|
|
11
|
+
media="(prefers-color-scheme: dark)"
|
|
12
|
+
/>
|
|
13
|
+
<meta
|
|
14
|
+
name="theme-color"
|
|
15
|
+
content="#ffffff"
|
|
16
|
+
media="(prefers-color-scheme: light)"
|
|
17
|
+
/>
|
|
18
|
+
<meta name="robots" content="noindex, nofollow" />
|
|
19
|
+
<link rel="stylesheet" href="/s/_/styles.012p32dz.css" />
|
|
20
|
+
<link rel="stylesheet" href="/s/_/share-viewer.00gubshk.css" />
|
|
21
|
+
<link rel="modulepreload" href="/s/_/chunk.CGWFHJI2.js">
|
|
22
|
+
<link rel="modulepreload" href="/s/_/chunk.AJZBJBMO.js">
|
|
23
|
+
</head>
|
|
24
|
+
<body class="share-viewer">
|
|
25
|
+
<div id="header">
|
|
26
|
+
<div class="header-side header-left">
|
|
27
|
+
<span class="logo">>_</span>
|
|
28
|
+
<span class="share-badge">shared</span>
|
|
29
|
+
</div>
|
|
30
|
+
<span id="session-info" class="status"></span>
|
|
31
|
+
<div class="header-side header-right">
|
|
32
|
+
<button id="theme-btn" title="Toggle theme">◑</button>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div id="messages"></div>
|
|
37
|
+
|
|
38
|
+
<footer id="share-footer">
|
|
39
|
+
<div class="share-footer-inner">
|
|
40
|
+
<span class="share-footer-author"></span>
|
|
41
|
+
<span class="share-footer-meta"></span>
|
|
42
|
+
<a
|
|
43
|
+
class="share-footer-promo"
|
|
44
|
+
href="https://github.com/LelouchHe/webagent"
|
|
45
|
+
target="_blank"
|
|
46
|
+
rel="noopener noreferrer"
|
|
47
|
+
>powered by webagent</a
|
|
48
|
+
>
|
|
49
|
+
</div>
|
|
50
|
+
</footer>
|
|
51
|
+
<script type="module" src="/s/_/viewer.6DT53STL.js"></script>
|
|
52
|
+
</body>
|
|
53
|
+
</html>
|