@parley-im/parley 0.2.3 → 0.2.5
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 +2 -2
- package/dist/server.js +2 -1
- package/package.json +3 -1
- package/web/app.css +120 -56
- package/web/chat.html +5 -3
- package/web/chat.js +58 -8
- package/web/ended.html +2 -2
- package/web/fonts/LICENSE-atkinson-hyperlegible-next.txt +93 -0
- package/web/fonts/LICENSE-bricolage-grotesque.txt +93 -0
- package/web/fonts/atkinson-hyperlegible-next-italic.woff2 +0 -0
- package/web/fonts/atkinson-hyperlegible-next.woff2 +0 -0
- package/web/fonts/bricolage-grotesque.woff2 +0 -0
- package/web/icon-180.png +0 -0
- package/web/icon.png +0 -0
- package/web/icon.svg +1 -1
- package/web/missing.html +2 -2
- package/web/panel.html +2 -2
- package/web/home.js +0 -552
package/README.md
CHANGED
|
@@ -96,7 +96,7 @@ Each reply records which model answered, on which login (`auth: "none"` means yo
|
|
|
96
96
|
| `src/mcp.ts` | `create_session`, `list_sessions`, `get_transcript`, `set_reply_limit`, `end_session` |
|
|
97
97
|
| `src/db.ts` | Each project's `.parley/parley.db` (sessions with keys, messages, turns), a folder per session with screenshots and `transcript.md`, and `~/.parley/projects.json` listing the projects |
|
|
98
98
|
| `web/` | Chat page, session view, control panel; parley.im serves the guest page's files from here too |
|
|
99
|
-
| `relay/` | parley.im: Worker, a Durable Object per linked computer, D1
|
|
99
|
+
| `relay/` | parley.im: Worker, a Durable Object per linked computer, D1 |
|
|
100
100
|
|
|
101
101
|
## Setup
|
|
102
102
|
|
|
@@ -122,7 +122,7 @@ Conversations live with their project, in `<project>/.parley/`: a database, and
|
|
|
122
122
|
|
|
123
123
|
## Running parley.im
|
|
124
124
|
|
|
125
|
-
`relay/` is a Cloudflare Worker (`wrangler.jsonc`) with a Durable Object per linked computer and a D1 database (`migrations/`). Signed out, `/`
|
|
125
|
+
`relay/` is a Cloudflare Worker (`wrangler.jsonc`) with a Durable Object per linked computer and a D1 database (`migrations/`). Signed out, `/` explains parley in plain words; signed in, it's your dashboard (open sessions, linked computers and whether they're online). `/docs` is the install guide; `/admin` is for admins (`ADMIN_EMAILS`): invites, the waitlist and who's in. Email goes through Cloudflare Email Service (the `EMAIL` binding, from `hello@parley.im`): a note when someone joins the waitlist (to them and the admins), when they're let in, and invites. Rate limits use the `LIMITS` binding. Secrets: `SESSION_SECRET` (random), `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET` (a Google OAuth web client with redirect URI `https://parley.im/auth/google/callback`).
|
|
126
126
|
|
|
127
127
|
```bash
|
|
128
128
|
cd relay
|
package/dist/server.js
CHANGED
|
@@ -21,6 +21,7 @@ const STATIC_TYPES = {
|
|
|
21
21
|
".css": "text/css; charset=utf-8",
|
|
22
22
|
".svg": "image/svg+xml",
|
|
23
23
|
".html": "text/html; charset=utf-8",
|
|
24
|
+
".woff2": "font/woff2",
|
|
24
25
|
};
|
|
25
26
|
// Two local servers: your control panel (and your view of each session), and
|
|
26
27
|
// local guest links for development or when you're not signed in. Shared
|
|
@@ -276,7 +277,7 @@ function sendFile(res, status, name) {
|
|
|
276
277
|
send(res, status, STATIC_TYPES[extname(name)], readFileSync(join(WEB, name)));
|
|
277
278
|
}
|
|
278
279
|
function sendStatic(res, name) {
|
|
279
|
-
if (!/^[a-z0-9-]+\.(js|css|svg|html)$/.test(name))
|
|
280
|
+
if (!/^(fonts\/)?[a-z0-9-]+\.(js|css|svg|html|woff2)$/.test(name))
|
|
280
281
|
return notFound(res);
|
|
281
282
|
const file = join(WEB, name);
|
|
282
283
|
if (!existsSync(file))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parley-im/parley",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Send someone a link. They talk to a read-only Claude or Codex in your project, on your computer, and you get everything they said.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude",
|
|
@@ -40,6 +40,8 @@
|
|
|
40
40
|
"zod": "^4.6.5"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
+
"@fontsource-variable/atkinson-hyperlegible-next": "^5.3.0",
|
|
44
|
+
"@fontsource-variable/bricolage-grotesque": "^5.3.0",
|
|
43
45
|
"@types/jsdom": "^30.0.0",
|
|
44
46
|
"@types/node": "^26.6.4",
|
|
45
47
|
"jsdom": "^29.1.1",
|
package/web/app.css
CHANGED
|
@@ -1,46 +1,64 @@
|
|
|
1
|
-
/* parley: one stylesheet for the guest chat, your session view
|
|
2
|
-
control panel.
|
|
3
|
-
|
|
1
|
+
/* parley: one stylesheet for the guest chat, your session view, your
|
|
2
|
+
control panel and parley.im. The Signal flag look: the code flag for P
|
|
3
|
+
(blue field, white square) as the mark, flag blue on sail, Bricolage
|
|
4
|
+
Grotesque for headlines and the wordmark, Atkinson Hyperlegible Next for
|
|
5
|
+
everything people read, and a monospace face only where it means
|
|
6
|
+
something (code, paths, the agent's activity, numbers). The fonts are
|
|
7
|
+
served from here, never from a font service, so guest pages only ever
|
|
8
|
+
talk to parley.im. */
|
|
9
|
+
|
|
10
|
+
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("/static/fonts/atkinson-hyperlegible-next.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
|
|
11
|
+
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("/static/fonts/atkinson-hyperlegible-next-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }
|
|
12
|
+
@font-face { font-family: "Bricolage Grotesque"; src: url("/static/fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
|
|
4
13
|
|
|
5
14
|
:root {
|
|
6
|
-
--bg: #
|
|
15
|
+
--bg: #f5f3ee; /* sail */
|
|
7
16
|
--panel: #ffffff;
|
|
8
|
-
--subtle: #
|
|
9
|
-
--hover: #
|
|
10
|
-
--line: #
|
|
11
|
-
--line-strong: #
|
|
12
|
-
--text: #
|
|
13
|
-
--muted: #
|
|
14
|
-
--faint: #
|
|
15
|
-
--accent: #
|
|
16
|
-
--accent-
|
|
17
|
+
--subtle: #eeebe4;
|
|
18
|
+
--hover: #e7e3d9;
|
|
19
|
+
--line: #e4e1d9;
|
|
20
|
+
--line-strong: #cfcbc1;
|
|
21
|
+
--text: #121c33; /* ink */
|
|
22
|
+
--muted: #5b6476;
|
|
23
|
+
--faint: #8b93a3;
|
|
24
|
+
--accent: #1f48b8; /* flag blue, for links and marks */
|
|
25
|
+
--accent-fill: #1f48b8; /* buttons and the flag itself */
|
|
26
|
+
--accent-soft: #e6ecfa;
|
|
17
27
|
--accent-ink: #ffffff;
|
|
18
|
-
--
|
|
28
|
+
--guest: #e6ecfa; /* your own messages */
|
|
29
|
+
--guest-ink: #23314f;
|
|
30
|
+
--brass: #d99a2b; /* small touches only */
|
|
31
|
+
--ok: #1e8a52;
|
|
19
32
|
--warn: #b7791f;
|
|
20
33
|
--danger: #c4302b;
|
|
21
|
-
--shadow: 0 1px 2px rgba(
|
|
22
|
-
--sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
34
|
+
--shadow: 0 1px 2px rgba(18, 28, 51, 0.05), 0 12px 32px -16px rgba(18, 28, 51, 0.22);
|
|
35
|
+
--sans: "Atkinson Hyperlegible Next", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
36
|
+
--display: "Bricolage Grotesque", var(--sans);
|
|
23
37
|
--mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
|
|
24
38
|
color-scheme: light;
|
|
25
39
|
}
|
|
26
40
|
@media (prefers-color-scheme: dark) {
|
|
27
41
|
:root:not([data-theme="light"]) {
|
|
28
|
-
--bg: #
|
|
29
|
-
--panel: #
|
|
30
|
-
--subtle: #
|
|
31
|
-
--hover: #
|
|
32
|
-
--line: #
|
|
33
|
-
--line-strong: #
|
|
34
|
-
--text: #
|
|
35
|
-
--muted: #
|
|
36
|
-
--faint: #
|
|
37
|
-
--accent: #
|
|
38
|
-
--accent-
|
|
39
|
-
--accent-
|
|
42
|
+
--bg: #0d1322; /* ink at night */
|
|
43
|
+
--panel: #141c2f;
|
|
44
|
+
--subtle: #1a2338;
|
|
45
|
+
--hover: #222c44;
|
|
46
|
+
--line: #232d45;
|
|
47
|
+
--line-strong: #33405e;
|
|
48
|
+
--text: #e8ecf4;
|
|
49
|
+
--muted: #9aa4b8;
|
|
50
|
+
--faint: #67718a;
|
|
51
|
+
--accent: #84a4f6;
|
|
52
|
+
--accent-fill: #3b6be8;
|
|
53
|
+
--accent-soft: #1c2a4d;
|
|
54
|
+
--accent-ink: #ffffff;
|
|
55
|
+
--guest: #1e2b4b;
|
|
56
|
+
--guest-ink: #dce5fa;
|
|
57
|
+
--brass: #e3ab45;
|
|
40
58
|
--ok: #3ccf7a;
|
|
41
59
|
--warn: #e3a948;
|
|
42
60
|
--danger: #ff6b63;
|
|
43
|
-
--shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0
|
|
61
|
+
--shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.7);
|
|
44
62
|
color-scheme: dark;
|
|
45
63
|
}
|
|
46
64
|
}
|
|
@@ -60,11 +78,19 @@ body {
|
|
|
60
78
|
.mono { font-family: var(--mono); font-size: 0.86em; }
|
|
61
79
|
a { color: inherit; }
|
|
62
80
|
button, input, textarea, select { font: inherit; color: inherit; }
|
|
81
|
+
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; }
|
|
63
82
|
|
|
64
83
|
/* ---------- shared pieces ---------- */
|
|
65
84
|
|
|
66
|
-
|
|
67
|
-
.mark
|
|
85
|
+
/* The mark: the code flag for P, a blue field with a white square. */
|
|
86
|
+
.mark { display: inline-block; width: 24px; height: 24px; flex: none; }
|
|
87
|
+
.mark svg { display: block; width: 100%; height: 100%; }
|
|
88
|
+
.mark .field { fill: var(--accent-fill); }
|
|
89
|
+
.mark .square { fill: #ffffff; }
|
|
90
|
+
/* The same flag, small, drawn in CSS: beside the interviewer's words, and
|
|
91
|
+
hoisting in turn while it writes. */
|
|
92
|
+
.flag { display: inline-block; flex: none; width: 13px; height: 13px; border-radius: 3px; box-shadow: inset 0 0 0 3.5px var(--accent-fill), inset 0 0 0 13px #ffffff; }
|
|
93
|
+
.wordmark { font-family: var(--display); font-weight: 700; letter-spacing: -0.025em; }
|
|
68
94
|
|
|
69
95
|
.topbar {
|
|
70
96
|
display: flex; align-items: center; gap: 10px; min-height: 52px;
|
|
@@ -72,10 +98,12 @@ button, input, textarea, select { font: inherit; color: inherit; }
|
|
|
72
98
|
border-bottom: 1px solid var(--line); background: var(--bg);
|
|
73
99
|
}
|
|
74
100
|
.crumbs { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1; }
|
|
75
|
-
.crumbs .product {
|
|
101
|
+
.crumbs .product { font-family: var(--display); font-weight: 700; letter-spacing: -0.025em; font-size: 17px; color: var(--text); }
|
|
76
102
|
.crumbs .slash { color: var(--faint); }
|
|
77
|
-
.brand { display: inline-flex; align-items: center; gap:
|
|
103
|
+
.brand { display: inline-flex; align-items: center; gap: 9px; color: inherit; text-decoration: none !important; font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -0.025em; }
|
|
78
104
|
.brand:hover .mark { filter: brightness(1.1); }
|
|
105
|
+
.lost .own { margin-top: 18px; font-size: 13px; color: var(--faint); }
|
|
106
|
+
.lost .own a { color: var(--accent); }
|
|
79
107
|
.crumbs .here { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
80
108
|
.crumbs a { text-decoration: none; }
|
|
81
109
|
.crumbs a:hover { text-decoration: underline; }
|
|
@@ -87,6 +115,15 @@ button, input, textarea, select { font: inherit; color: inherit; }
|
|
|
87
115
|
.dot.warn { background: var(--warn); }
|
|
88
116
|
.dot.off { background: var(--danger); }
|
|
89
117
|
@keyframes pulse { 50% { opacity: 0.35; } }
|
|
118
|
+
/* In a chat's header the status is a flag on its staff: flying when the
|
|
119
|
+
sender's computer is there, at half-mast (and red) when it isn't. */
|
|
120
|
+
.status .dot { position: relative; width: 12px; height: 15px; border-radius: 0; background: none; box-shadow: none; animation: none; }
|
|
121
|
+
.status .dot::before { content: ""; position: absolute; left: 0; top: 0; width: 2px; height: 15px; border-radius: 1px; background: var(--muted); }
|
|
122
|
+
.status .dot::after { content: ""; position: absolute; left: 2px; top: 0; width: 9px; height: 8px; border-radius: 0 2px 2px 0; background: var(--accent-fill); box-shadow: inset 0 0 0 2.5px var(--accent-fill), inset 0 0 0 9px #ffffff; transition: top 0.4s ease; }
|
|
123
|
+
.status .dot.off::after { top: 7px; box-shadow: inset 0 0 0 2.5px var(--danger), inset 0 0 0 9px #ffffff; }
|
|
124
|
+
.status .dot.warn::after { top: 7px; box-shadow: inset 0 0 0 2.5px var(--faint), inset 0 0 0 9px var(--bg); }
|
|
125
|
+
.status .dot.busy::after { animation: flutter 1.2s ease-in-out infinite; }
|
|
126
|
+
@keyframes flutter { 50% { transform: skewY(-8deg); } }
|
|
90
127
|
|
|
91
128
|
.btn {
|
|
92
129
|
display: inline-flex; align-items: center; justify-content: center; gap: 6px;
|
|
@@ -96,7 +133,7 @@ button, input, textarea, select { font: inherit; color: inherit; }
|
|
|
96
133
|
}
|
|
97
134
|
.btn:hover { background: var(--subtle); }
|
|
98
135
|
.btn:disabled { opacity: 0.5; cursor: default; }
|
|
99
|
-
.btn.primary { background: var(--
|
|
136
|
+
.btn.primary { background: var(--accent-fill); color: var(--accent-ink); border-color: var(--accent-fill); }
|
|
100
137
|
.btn.primary:hover { opacity: 0.88; }
|
|
101
138
|
.btn.danger { color: var(--danger); }
|
|
102
139
|
.btn.confirm { background: var(--danger); color: #fff; border-color: var(--danger); }
|
|
@@ -165,17 +202,21 @@ body:has(> .app) { overflow: hidden; overscroll-behavior: none; }
|
|
|
165
202
|
position: absolute; left: 0; top: 0; width: 14px; text-align: center;
|
|
166
203
|
font-family: var(--mono); font-size: 14px; line-height: 1.55;
|
|
167
204
|
}
|
|
168
|
-
.msg.agent::before { content: "
|
|
169
|
-
|
|
205
|
+
.msg.agent::before { content: ""; top: 5px; width: 13px; height: 13px; border-radius: 3px; box-shadow: inset 0 0 0 3.5px var(--accent-fill), inset 0 0 0 13px #ffffff; }
|
|
206
|
+
/* The interviewer's words are what people read: set for reading. */
|
|
207
|
+
.msg.agent .body { font-size: 16.5px; line-height: 1.6; }
|
|
208
|
+
/* Your own words are compact and plainly yours, on the right. */
|
|
209
|
+
.msg.guest { padding-left: 0; display: flex; flex-direction: column; align-items: flex-end; }
|
|
210
|
+
.msg.guest::before { content: none; }
|
|
170
211
|
.msg.error::before { content: "!"; color: var(--danger); font-weight: 700; }
|
|
171
212
|
.meta { font-size: 12px; color: var(--faint); margin-bottom: 2px; }
|
|
172
213
|
.meta .who { color: var(--muted); font-weight: 600; }
|
|
173
|
-
.msg.guest .bubble { background: var(--
|
|
214
|
+
.msg.guest .bubble { max-width: min(82%, 560px); background: var(--guest); color: var(--guest-ink); border-radius: 14px 14px 4px 14px; padding: 9px 13px; font-size: 15px; line-height: 1.45; }
|
|
174
215
|
.msg.guest .meta { display: none; }
|
|
175
216
|
/* Guests get just the conversation: no names or times on every message. */
|
|
176
217
|
.guest-view .msg .meta, .guest-view .msg .stamp { display: none; }
|
|
177
218
|
.guest-view .msg { margin-bottom: 16px; }
|
|
178
|
-
|
|
219
|
+
|
|
179
220
|
.msg.guest .stamp { font-size: 12px; color: var(--faint); margin-top: 4px; }
|
|
180
221
|
.msg.error .body { color: var(--danger); font-size: 14px; }
|
|
181
222
|
.msg.error .detail { margin-top: 6px; font-size: 12px; color: var(--muted); white-space: pre-wrap; word-break: break-word; }
|
|
@@ -216,23 +257,26 @@ body:has(> .app) { overflow: hidden; overscroll-behavior: none; }
|
|
|
216
257
|
.body th { background: var(--subtle); font-weight: 600; white-space: nowrap; }
|
|
217
258
|
.body tr:last-child td { border-bottom: 0; }
|
|
218
259
|
|
|
219
|
-
|
|
220
|
-
.thinking
|
|
260
|
+
/* Writing: three tiny flags hoisting in turn. */
|
|
261
|
+
.thinking { display: inline-flex; align-items: flex-end; gap: 5px; height: 22px; padding-top: 4px; }
|
|
262
|
+
.thinking span { width: 8px; height: 8px; border-radius: 2px; box-shadow: inset 0 0 0 2.5px var(--accent-fill), inset 0 0 0 8px #ffffff; animation: hoist 1.2s ease-in-out infinite; }
|
|
221
263
|
.thinking span:nth-child(2) { animation-delay: 0.15s; }
|
|
222
264
|
.thinking span:nth-child(3) { animation-delay: 0.3s; }
|
|
265
|
+
@keyframes hoist { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }
|
|
266
|
+
@media (prefers-reduced-motion: reduce) { .thinking span, .status .dot.busy::after { animation: none; } }
|
|
223
267
|
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
|
|
224
268
|
.cursor::after { content: ""; display: inline-block; width: 7px; height: 1.05em; background: var(--accent); margin-left: 3px; vertical-align: -3px; animation: blink 1s infinite; }
|
|
225
269
|
|
|
226
270
|
.dock { border-top: 1px solid var(--line); background: var(--bg); }
|
|
227
271
|
.dock .chat-inner { padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); }
|
|
228
|
-
.composer { border:
|
|
272
|
+
.composer { border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); }
|
|
229
273
|
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
|
|
230
274
|
/* The sender's computer (or this page's connection) is offline: nothing can
|
|
231
275
|
be sent until it's back, and it looks that way. */
|
|
232
276
|
.app.offline .composer, .app.offline .composer:focus-within { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }
|
|
233
277
|
.app.offline .prompt { color: var(--danger); }
|
|
234
278
|
.composer .row { display: flex; align-items: flex-end; gap: 2px; padding: 4px 4px 4px 12px; }
|
|
235
|
-
.prompt {
|
|
279
|
+
.prompt { display: none; }
|
|
236
280
|
textarea {
|
|
237
281
|
flex: 1; resize: none; border: 0; outline: 0; background: transparent;
|
|
238
282
|
padding: 8px 4px; min-height: 40px; line-height: 1.55; font-size: 16px;
|
|
@@ -254,8 +298,8 @@ textarea::placeholder { color: var(--faint); }
|
|
|
254
298
|
}
|
|
255
299
|
.icon-btn:hover { background: var(--subtle); color: var(--text); }
|
|
256
300
|
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
|
|
257
|
-
.send { background: var(--accent); color: var(--accent-ink); }
|
|
258
|
-
.send:hover { background: var(--accent); color: var(--accent-ink); opacity: 0.9; }
|
|
301
|
+
.send { background: var(--accent-fill); color: var(--accent-ink); border-radius: 11px; }
|
|
302
|
+
.send:hover { background: var(--accent-fill); color: var(--accent-ink); opacity: 0.9; }
|
|
259
303
|
.send:disabled { background: var(--subtle); color: var(--faint); cursor: default; opacity: 1; }
|
|
260
304
|
.attachments { display: flex; gap: 8px; padding: 10px 10px 0; flex-wrap: wrap; }
|
|
261
305
|
.thumb { position: relative; }
|
|
@@ -334,7 +378,7 @@ body.panel { overflow: auto; }
|
|
|
334
378
|
.trow.ended { color: var(--muted); }
|
|
335
379
|
.who-cell .name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
|
|
336
380
|
.who-cell .where { font-size: 12px; color: var(--muted); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
337
|
-
.badge { display: inline-block; padding: 0 7px; border-radius: 99px; font-size: 11px; font-weight: 600; line-height: 18px; background: var(--accent); color: var(--accent-ink); }
|
|
381
|
+
.badge { display: inline-block; padding: 0 7px; border-radius: 99px; font-size: 11px; font-weight: 600; line-height: 18px; background: var(--accent-fill); color: var(--accent-ink); }
|
|
338
382
|
.badge.soft { background: var(--subtle); color: var(--muted); border: 1px solid var(--line); }
|
|
339
383
|
.cell-muted { font-size: 13px; color: var(--muted); }
|
|
340
384
|
.num { font-family: var(--mono); font-size: 13px; }
|
|
@@ -431,15 +475,35 @@ body.panel { overflow: auto; }
|
|
|
431
475
|
/* Long details shorten instead of pushing the buttons off a phone screen. */
|
|
432
476
|
.trow.site-row .who-cell { min-width: 0; }
|
|
433
477
|
|
|
434
|
-
/* parley.im's front page:
|
|
435
|
-
|
|
436
|
-
.
|
|
437
|
-
.
|
|
438
|
-
.
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
478
|
+
/* parley.im's front page: what it is, in plain words, beside a glimpse of a
|
|
479
|
+
parley. */
|
|
480
|
+
.landing { max-width: 1080px; }
|
|
481
|
+
.front { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; padding: 8vh 0 24px; }
|
|
482
|
+
.front .intro { flex: 999 1 440px; min-width: 0; display: grid; gap: 18px; padding: 0; border: 0; background: none; margin: 0; font-size: inherit; color: inherit; }
|
|
483
|
+
.front h1 { font-size: clamp(36px, 6.4vw, 56px); line-height: 1.02; letter-spacing: -0.035em; margin: 0; }
|
|
484
|
+
.front .lede { font-size: 19px; line-height: 1.55; color: var(--muted); margin: 0; max-width: 34em; }
|
|
485
|
+
.front .cta { display: flex; gap: 8px; flex-wrap: wrap; }
|
|
486
|
+
.front .cta .btn { height: 46px; padding: 0 20px; border-radius: 11px; font-size: 16px; font-weight: 700; }
|
|
487
|
+
.front .cta .btn.ghost { color: var(--text); font-weight: 500; }
|
|
488
|
+
.front .fine { font-size: 14px; color: var(--muted); margin: 0; }
|
|
489
|
+
.glimpse {
|
|
490
|
+
flex: 1 1 320px; min-width: 0; display: grid; gap: 14px; padding: 20px; background: var(--panel);
|
|
491
|
+
border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
|
|
492
|
+
}
|
|
493
|
+
.glimpse .says { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-size: 16px; line-height: 1.55; }
|
|
494
|
+
.glimpse .says .flag { margin-top: 5px; }
|
|
495
|
+
.glimpse .reply { justify-self: end; max-width: 85%; padding: 8px 12px; background: var(--guest); color: var(--guest-ink); border-radius: 13px 13px 4px 13px; font-size: 14px; line-height: 1.45; }
|
|
496
|
+
.glimpse .writing { display: flex; gap: 10px; align-items: center; }
|
|
497
|
+
.glimpse .writing .thinking { padding: 0; height: 16px; }
|
|
498
|
+
.how { list-style: none; counter-reset: step; padding: 0; margin: 40px 0 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
|
|
499
|
+
.how li { counter-increment: step; border: 1px solid var(--line); border-radius: 16px; padding: 22px; background: var(--panel); display: grid; gap: 10px; align-content: start; }
|
|
500
|
+
.how li::before { content: counter(step); font-family: var(--display); font-weight: 700; color: var(--accent); font-size: 15px; }
|
|
501
|
+
.how h2 { font-size: 20px; margin: 0; }
|
|
502
|
+
.how p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); }
|
|
503
|
+
.how q { color: var(--text); }
|
|
504
|
+
.promises { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; margin: 40px 0 0; padding: 32px 0 48px; border-top: 1px solid var(--line-strong); }
|
|
505
|
+
.promises h3 { font-family: var(--sans); font-size: 16px; letter-spacing: 0; margin: 0 0 6px; }
|
|
506
|
+
.promises p { font-size: 15px; line-height: 1.55; color: var(--muted); margin: 0; }
|
|
507
|
+
@media (max-width: 720px) {
|
|
508
|
+
.front { padding-top: 5vh; gap: 32px; }
|
|
444
509
|
}
|
|
445
|
-
.stage canvas { position: absolute; inset: 0; display: block; }
|
package/web/chat.html
CHANGED
|
@@ -11,15 +11,17 @@
|
|
|
11
11
|
<meta property="og:description" content="{{PREVIEW_TEXT}}">
|
|
12
12
|
<meta property="og:site_name" content="parley">
|
|
13
13
|
<title>{{TITLE}}</title>
|
|
14
|
-
<link rel="icon" href="/static/icon.svg?v=
|
|
14
|
+
<link rel="icon" href="/static/icon.svg?v=3" type="image/svg+xml">
|
|
15
15
|
<link rel="stylesheet" href="/static/app.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
18
18
|
<div class="app">
|
|
19
19
|
<header class="topbar">
|
|
20
|
-
<span class="mark" aria-hidden="true"><svg viewBox="4 4 24 24"><g fill="currentColor" stroke="none"><circle cx="8" cy="10" r="2.2"/><rect x="12" y="8" width="12" height="4" rx="2"/><rect x="6" y="14" width="20" height="4" rx="2" opacity=".7"/><rect x="6" y="20" width="13" height="4" rx="2" opacity=".7"/></g></svg></span>
|
|
21
20
|
<nav class="crumbs" id="crumbs">
|
|
22
|
-
|
|
21
|
+
<!-- What parley is, in a new tab so the conversation stays put. -->
|
|
22
|
+
<a class="brand" id="home-link" href="https://parley.im" target="_blank" rel="noopener" title="parley: let people talk to your agent">
|
|
23
|
+
<span class="mark" aria-hidden="true"><svg viewBox="0 0 64 64"><rect class="field" width="64" height="64" rx="14"/><rect class="square" x="20" y="20" width="24" height="24" rx="2"/></svg></span><span class="product">parley</span>
|
|
24
|
+
</a><span class="slash">/</span><span class="here" id="project"> </span>
|
|
23
25
|
</nav>
|
|
24
26
|
<span class="status" id="status" hidden><span class="dot" id="status-dot"></span><span id="status-text"></span></span>
|
|
25
27
|
<span class="chip" id="chip" hidden></span>
|
package/web/chat.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
(function () {
|
|
2
2
|
const { base, owner, maxText, relay, sender, project: knownProject } = window.PARLEY;
|
|
3
|
+
// parley's own homepage: this site on parley.im links, parley.im on local ones.
|
|
4
|
+
const homeUrl = relay ? "/" : "https://parley.im";
|
|
5
|
+
document.getElementById("home-link")?.setAttribute("href", homeUrl);
|
|
3
6
|
const $ = (id) => document.getElementById(id);
|
|
4
7
|
const els = {
|
|
5
8
|
project: $("project"), crumbs: $("crumbs"), status: $("status"), statusDot: $("status-dot"), statusText: $("status-text"),
|
|
@@ -265,7 +268,8 @@
|
|
|
265
268
|
els.status.hidden = false;
|
|
266
269
|
let dot = "on";
|
|
267
270
|
let label = owner ? `${agentName()} · live` : speaker();
|
|
268
|
-
if (
|
|
271
|
+
if (idle) (dot = ""), (label = "paused");
|
|
272
|
+
else if (offline) (dot = "off"), (label = offlineWhy === "connection" ? "reconnecting" : "offline");
|
|
269
273
|
// A reply in progress shows as typing dots in the conversation; the
|
|
270
274
|
// header stays put.
|
|
271
275
|
else if (live && owner) (dot = "busy"), (label = `${agentName()} is replying`);
|
|
@@ -415,11 +419,15 @@
|
|
|
415
419
|
}
|
|
416
420
|
|
|
417
421
|
function showEnded() {
|
|
418
|
-
|
|
422
|
+
// For the guest, one quiet line about having their own.
|
|
423
|
+
const own = () =>
|
|
424
|
+
owner ? null : el("p", { className: "own" }, "Want people to talk to your agent? ", el("a", { href: homeUrl, target: "_blank", rel: "noopener", textContent: "Get parley" }));
|
|
425
|
+
showNote("This parley has ended", "Thanks for the feedback. The conversation isn't available here anymore.", own);
|
|
419
426
|
}
|
|
420
427
|
|
|
421
|
-
// Replaces the conversation with a note, for good.
|
|
422
|
-
|
|
428
|
+
// Replaces the conversation with a note, for good. `extra` makes anything
|
|
429
|
+
// to show under it.
|
|
430
|
+
function showNote(title, text, extra = () => null) {
|
|
423
431
|
if (ended) return;
|
|
424
432
|
ended = true;
|
|
425
433
|
clearLive();
|
|
@@ -427,12 +435,12 @@
|
|
|
427
435
|
els.status.hidden = true;
|
|
428
436
|
els.chip.hidden = true;
|
|
429
437
|
els.layout.textContent = "";
|
|
430
|
-
els.layout.append(el("div", { className: "lost inline", style: "flex:1" }, el("div", {}, markEl(), el("h1", { textContent: title }), el("p", { textContent: text }))));
|
|
438
|
+
els.layout.append(el("div", { className: "lost inline", style: "flex:1" }, el("div", {}, markEl(), el("h1", { textContent: title }), el("p", { textContent: text }), extra())));
|
|
431
439
|
}
|
|
432
440
|
|
|
433
441
|
function markEl() {
|
|
434
442
|
const span = el("span", { className: "mark" });
|
|
435
|
-
span.innerHTML = `<svg viewBox="
|
|
443
|
+
span.innerHTML = `<svg viewBox="0 0 64 64"><rect class="field" width="64" height="64" rx="14"/><rect class="square" x="20" y="20" width="24" height="24" rx="2"/></svg>`;
|
|
436
444
|
return span;
|
|
437
445
|
}
|
|
438
446
|
|
|
@@ -716,6 +724,7 @@
|
|
|
716
724
|
return body.ok ? p.resolve(body.result) : p.reject(problemError(body.status, body.error, body.message));
|
|
717
725
|
}
|
|
718
726
|
if (m.t === "evt") {
|
|
727
|
+
stirred = Date.now(); // a reply coming in counts as you being here
|
|
719
728
|
const item = await S.open(key, token, "evt", m.d);
|
|
720
729
|
if (loading) return early.push(item);
|
|
721
730
|
if (item.epoch !== epoch) return load();
|
|
@@ -756,7 +765,7 @@
|
|
|
756
765
|
for (const p of pending.values()) clearTimeout(p.timer), p.reject(connectionError());
|
|
757
766
|
pending.clear();
|
|
758
767
|
if (event.code === 4410) return h.ended();
|
|
759
|
-
if (ended) return;
|
|
768
|
+
if (ended || paused) return;
|
|
760
769
|
failures++;
|
|
761
770
|
// This page lost its own connection (a phone switching networks, or
|
|
762
771
|
// waking up); the sender's computer may be fine.
|
|
@@ -767,11 +776,42 @@
|
|
|
767
776
|
|
|
768
777
|
// Back from the background or back online: reconnect now, not on a timer.
|
|
769
778
|
const wake = () => {
|
|
770
|
-
if (!ended && document.visibilityState === "visible" && retry) connect();
|
|
779
|
+
if (!ended && !paused && document.visibilityState === "visible" && retry) connect();
|
|
771
780
|
};
|
|
772
781
|
document.addEventListener("visibilitychange", wake);
|
|
773
782
|
window.addEventListener("online", wake);
|
|
774
783
|
|
|
784
|
+
// A page left open and untouched lets its connection go (after 15
|
|
785
|
+
// minutes, or 5 in a background tab), so a forgotten tab doesn't hold on
|
|
786
|
+
// forever or show as "here" on the sender's dashboard. Anything you do
|
|
787
|
+
// brings it back, caught up.
|
|
788
|
+
const IDLE_MS = 15 * 60_000;
|
|
789
|
+
const HIDDEN_MS = 5 * 60_000;
|
|
790
|
+
let stirred = Date.now();
|
|
791
|
+
let hiddenAt = null;
|
|
792
|
+
let paused = false;
|
|
793
|
+
const stir = () => {
|
|
794
|
+
stirred = Date.now();
|
|
795
|
+
if (paused && !ended) {
|
|
796
|
+
paused = false;
|
|
797
|
+
h.idle(false);
|
|
798
|
+
connect();
|
|
799
|
+
}
|
|
800
|
+
};
|
|
801
|
+
for (const type of ["pointerdown", "keydown", "touchstart", "wheel", "focusin"]) addEventListener(type, stir, { passive: true, capture: true });
|
|
802
|
+
document.addEventListener("visibilitychange", () => {
|
|
803
|
+
hiddenAt = document.hidden ? Date.now() : null;
|
|
804
|
+
if (!document.hidden) stir();
|
|
805
|
+
});
|
|
806
|
+
setInterval(() => {
|
|
807
|
+
if (paused || ended || ws?.readyState !== WebSocket.OPEN || h.busy()) return;
|
|
808
|
+
if ((hiddenAt && Date.now() - hiddenAt > HIDDEN_MS) || Date.now() - stirred > IDLE_MS) {
|
|
809
|
+
paused = true;
|
|
810
|
+
h.idle(true);
|
|
811
|
+
ws.close(1000, "idle");
|
|
812
|
+
}
|
|
813
|
+
}, 30_000);
|
|
814
|
+
|
|
775
815
|
return {
|
|
776
816
|
async start(handlers) {
|
|
777
817
|
h = handlers;
|
|
@@ -833,6 +873,14 @@
|
|
|
833
873
|
toEnd();
|
|
834
874
|
}
|
|
835
875
|
|
|
876
|
+
// Paused: this page let its connection go while nobody was using it.
|
|
877
|
+
let idle = false;
|
|
878
|
+
function setIdle(on) {
|
|
879
|
+
idle = on;
|
|
880
|
+
paintStatus();
|
|
881
|
+
banner(on ? "Paused while you were away. Tap anywhere to pick up where you left off." : "");
|
|
882
|
+
}
|
|
883
|
+
|
|
836
884
|
// Offline means one of two things: the sender's computer (asleep, or
|
|
837
885
|
// parley isn't running), or this page's own connection.
|
|
838
886
|
let offlineWhy = null;
|
|
@@ -1040,6 +1088,8 @@
|
|
|
1040
1088
|
},
|
|
1041
1089
|
event: apply,
|
|
1042
1090
|
offline: setOffline,
|
|
1091
|
+
idle: setIdle,
|
|
1092
|
+
busy: () => !!live,
|
|
1043
1093
|
ended: showEnded,
|
|
1044
1094
|
missingKey: () =>
|
|
1045
1095
|
showNote("This link is incomplete", "The part after the # is missing, and it's the key to this conversation. Ask whoever sent it to send the whole link again."),
|
package/web/ended.html
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
6
|
<meta name="robots" content="noindex, nofollow">
|
|
7
7
|
<title>This parley has ended</title>
|
|
8
|
-
<link rel="icon" href="/static/icon.svg?v=
|
|
8
|
+
<link rel="icon" href="/static/icon.svg?v=3" type="image/svg+xml">
|
|
9
9
|
<link rel="stylesheet" href="/static/app.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div class="lost">
|
|
13
13
|
<div>
|
|
14
|
-
<span class="mark" aria-hidden="true"><svg viewBox="
|
|
14
|
+
<span class="mark" aria-hidden="true"><svg viewBox="0 0 64 64"><rect class="field" width="64" height="64" rx="14"/><rect class="square" x="20" y="20" width="24" height="24" rx="2"/></svg></span>
|
|
15
15
|
<h1>This parley has ended</h1>
|
|
16
16
|
<p>Thanks for the feedback. The conversation isn't available here anymore.</p>
|
|
17
17
|
</div>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2020-2024 The Atkinson Hyperlegible Next Project Authors (https://github.com/googlefonts/atkinson-hyperlegible-next) AtkinsonHyperlegibleNext-Italic[wght].ttf: Copyright 2020-2024 The Atkinson Hyperlegible Next Project Authors (https://github.com/googlefonts/atkinson-hyperlegible-next)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|