pi-durable-bot 0.7.2 → 0.8.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.
Files changed (57) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +10 -2
  3. package/dist/agent/agent.js +2 -1
  4. package/dist/agent/agent.js.map +1 -1
  5. package/dist/agent/scopes.js +267 -0
  6. package/dist/agent/scopes.js.map +1 -0
  7. package/dist/agent/screen.js +37 -2
  8. package/dist/agent/screen.js.map +1 -1
  9. package/dist/bot/bot.js +58 -11
  10. package/dist/bot/bot.js.map +1 -1
  11. package/dist/bot/definition.js +7 -0
  12. package/dist/bot/definition.js.map +1 -1
  13. package/dist/bot/prompt.js +26 -9
  14. package/dist/bot/prompt.js.map +1 -1
  15. package/dist/cli/bots.js +69 -5
  16. package/dist/cli/bots.js.map +1 -1
  17. package/dist/cli/chat.js +59 -4
  18. package/dist/cli/chat.js.map +1 -1
  19. package/dist/cli/commands.js +23 -2
  20. package/dist/cli/commands.js.map +1 -1
  21. package/dist/cli/init.js +4 -19
  22. package/dist/cli/init.js.map +1 -1
  23. package/dist/cli/pages.js +25 -6
  24. package/dist/cli/pages.js.map +1 -1
  25. package/dist/cli/service.js +30 -1
  26. package/dist/cli/service.js.map +1 -1
  27. package/dist/main.js +8 -0
  28. package/dist/main.js.map +1 -1
  29. package/dist/pages/desktop-page.js +293 -0
  30. package/dist/pages/desktop-page.js.map +1 -0
  31. package/dist/pages/desktop.js +672 -0
  32. package/dist/pages/desktop.js.map +1 -0
  33. package/dist/pages/host.js +55 -2
  34. package/dist/pages/host.js.map +1 -1
  35. package/dist/pages/rfb.js +389 -0
  36. package/dist/pages/rfb.js.map +1 -0
  37. package/dist/pages/server.js +172 -1
  38. package/dist/pages/server.js.map +1 -1
  39. package/dist/pages/store.js +26 -4
  40. package/dist/pages/store.js.map +1 -1
  41. package/docs/for-agents.md +17 -2
  42. package/kit/desktop/desktop.css +1010 -0
  43. package/kit/desktop/desktop.js +1421 -0
  44. package/kit/desktop/novnc/AUTHORS +13 -0
  45. package/kit/desktop/novnc/LICENSE.BSD-2-Clause +22 -0
  46. package/kit/desktop/novnc/LICENSE.BSD-3-Clause +24 -0
  47. package/kit/desktop/novnc/LICENSE.MPL-2.0 +373 -0
  48. package/kit/desktop/novnc/LICENSE.OFL-1.1 +91 -0
  49. package/kit/desktop/novnc/LICENSE.pako +21 -0
  50. package/kit/desktop/novnc/LICENSE.txt +62 -0
  51. package/kit/desktop/novnc.js +14404 -0
  52. package/package.json +5 -5
  53. package/skills/desktop-page/SKILL.md +153 -0
  54. package/skills/discord-channel/SKILL.md +6 -6
  55. package/skills/pages/SKILL.md +9 -4
  56. package/skills/slack-channel/SKILL.md +8 -7
  57. package/skills/telegram-channel/SKILL.md +4 -4
@@ -0,0 +1,293 @@
1
+ const escape = (text) => text.replace(/[&<>"']/g, (char) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" })[char]);
2
+ /** The person's language: the first of the browser's languages that Pots has words for, else English. */
3
+ export function pickLang(acceptLanguage) {
4
+ const ranges = (acceptLanguage ?? "")
5
+ .split(",")
6
+ .map((part) => {
7
+ const [tag, ...params] = part.trim().toLowerCase().split(";");
8
+ const q = Number(params.find((param) => param.trim().startsWith("q="))?.trim().slice(2) ?? 1);
9
+ return { tag: tag ?? "", q: Number.isFinite(q) ? q : 0 };
10
+ })
11
+ .filter((range) => range.tag && range.q > 0)
12
+ .sort((a, b) => b.q - a.q);
13
+ for (const { tag } of ranges) {
14
+ if (tag === "zh" || tag.startsWith("zh-"))
15
+ return "zh";
16
+ if (tag === "en" || tag.startsWith("en-"))
17
+ return "en";
18
+ }
19
+ return "en";
20
+ }
21
+ /** The page's words. {bot}, {time}, {n} and the like are filled in where they are used. */
22
+ const WORDS = {
23
+ en: {
24
+ title: "{bot}'s desktop",
25
+ asks: "{bot} needs you for one step",
26
+ linkUntil: "The link works until {time}",
27
+ afterStart: "{n} minutes after Start",
28
+ whatTitle: "What this link can do",
29
+ what: "It controls the whole desktop of {bot}'s computer, with every site signed in there. Nothing shows before you press Start, and only the first device that presses Start can use the link.",
30
+ tunnel: "The picture goes through Cloudflare's free tunnel: Cloudflare can see the screen and what you type.",
31
+ start: "Start",
32
+ continue: "Continue",
33
+ fineResize: "When you start, {bot}'s desktop takes the shape of your screen if it can, and goes back when you hand it back.",
34
+ fineWhole: "When you start, you see {bot}'s whole desktop.",
35
+ elsewhere: "This link is open on another device. Only the device that pressed Start first can use it.",
36
+ busy: "Someone is using this desktop through another link right now. Try again when they are done.",
37
+ unreachable: "Pots could not reach {bot}'s desktop, and has told {bot}. Try again in a moment.",
38
+ network: "No connection to {bot}. Check your network and try again.",
39
+ noscript: "This page needs JavaScript.",
40
+ connecting: "Connecting…",
41
+ reconnecting: "Reconnecting…",
42
+ task: "What to do",
43
+ fold: "Fold",
44
+ hintMeta: "The link ends at {time} · only this device can use it",
45
+ zoom: "Zoomed in {n}× · tap for the whole screen",
46
+ gestures: "Tap = click · drag with two fingers = scroll · pinch = zoom",
47
+ keyboard: "Keyboard",
48
+ more: "More",
49
+ done: "Done",
50
+ typeInto: "To {bot}:",
51
+ hideTyped: "Hide what I type",
52
+ enter: "Enter",
53
+ closeKeyboard: "Close the keyboard",
54
+ upright: "Typing is easier with the phone upright.",
55
+ hintPassword: "Tap the password field on the screen, then the keyboard button.",
56
+ hintCode: "Tap the code field on the screen, then the keyboard button.",
57
+ hintText: "Tap the field on the screen, then the keyboard button.",
58
+ esc: "Esc",
59
+ tab: "Tab",
60
+ backspace: "Delete",
61
+ selectAll: "Select all",
62
+ paste: "Paste",
63
+ reconnect: "Reconnect",
64
+ trackpad: "Trackpad",
65
+ trackpadNote: "A finger moves the mouse, for small targets",
66
+ picture: "Picture",
67
+ fitPhone: "Fit phone",
68
+ fitWindow: "Fit window",
69
+ whole: "Whole",
70
+ actual: "1:1",
71
+ cannotRow: "I can't do it, hand back",
72
+ handBackTitle: "Hand back to {bot}?",
73
+ handBackNote: "{bot} will check this step with a screenshot, then carry on.",
74
+ notePlaceholder: "Anything for {bot}? (optional) For example: the code went to my email",
75
+ handBackDone: "✓ Done, hand back",
76
+ handBackCannot: "I can't do it, hand back ({bot} will try another way)",
77
+ keepGoing: "Keep going",
78
+ fullscreen: "Full screen",
79
+ typeClipboard: "Type my clipboard",
80
+ keys: "Send keys",
81
+ keysHintMac: "The keyboard types straight in · ⌘C and ⌘V become Ctrl+C and Ctrl+V · ⌘⇧V types your clipboard",
82
+ keysHint: "The keyboard types straight in",
83
+ oneMinute: "1 minute left",
84
+ noResize: "This desktop keeps its own size. Pinch to zoom in and out.",
85
+ clipboardEmpty: "The clipboard is empty.",
86
+ clipboardDenied: "The browser did not let the page read the clipboard.",
87
+ typed: "Typed {n} characters",
88
+ failed: "Could not do that: {reason}",
89
+ endedDone: "Handed back to {bot}",
90
+ endedDoneText: "You can close this page. {bot} will tell you in the chat how it went.",
91
+ endedCannot: "Handed back to {bot}",
92
+ endedCannotText: "{bot} knows you could not do this step, and will try another way. You can close this page.",
93
+ restored: "The desktop has its own size again.",
94
+ endedExpired: "This link has ended",
95
+ endedExpiredText: "Ask {bot} for a new link if you still need the desktop.",
96
+ endedRevoked: "{bot} took this link back",
97
+ endedRevokedText: "Ask {bot} for a new link if you still need the desktop.",
98
+ notFound: "This link does not work",
99
+ notFoundText: "It may have ended, or been taken back.",
100
+ },
101
+ zh: {
102
+ title: "{bot} 的桌面",
103
+ asks: "{bot} 需要你帮一步",
104
+ linkUntil: "链接 {time} 后失效",
105
+ afterStart: "开始后有 {n} 分钟",
106
+ whatTitle: "这个链接能做什么",
107
+ what: "能操作 {bot} 电脑的整个桌面,包括上面已登录的网站。按「开始」前不显示任何画面;只有第一个按「开始」的设备能用。",
108
+ tunnel: "画面经过 Cloudflare 的免费通道,Cloudflare 能看到画面和你打的字。",
109
+ start: "开始",
110
+ continue: "继续",
111
+ fineResize: "开始后,{bot} 的桌面会尽量改成你屏幕的形状,交还时改回来",
112
+ fineWhole: "开始后会显示 {bot} 的整个桌面",
113
+ elsewhere: "这个链接已经在另一台设备上打开了。只有第一个按「开始」的设备能用。",
114
+ busy: "现在有人在用另一个链接操作这台桌面,等他们用完再试。",
115
+ unreachable: "Pots 连不上 {bot} 的桌面,已经告诉 {bot} 了。稍后再试。",
116
+ network: "连不上 {bot},检查网络后再试。",
117
+ noscript: "这个页面需要 JavaScript。",
118
+ connecting: "正在连接…",
119
+ reconnecting: "正在重连…",
120
+ task: "要做什么",
121
+ fold: "收起",
122
+ hintMeta: "链接 {time} 后失效 · 只有这台设备能用",
123
+ zoom: "已放大 {n}× · 点一下看整屏",
124
+ gestures: "点 = 点击 · 双指拖 = 滚动 · 双指捏 = 放大",
125
+ keyboard: "键盘",
126
+ more: "更多",
127
+ done: "完成",
128
+ typeInto: "打进 {bot}:",
129
+ hideTyped: "遮住我打的字",
130
+ enter: "回车",
131
+ closeKeyboard: "收起键盘",
132
+ upright: "竖着拿更好打字",
133
+ hintPassword: "先点画面里的密码框,再点键盘按钮。",
134
+ hintCode: "先点画面里的验证码框,再点键盘按钮。",
135
+ hintText: "先点画面里的输入框,再点键盘按钮。",
136
+ esc: "Esc",
137
+ tab: "Tab",
138
+ backspace: "删除",
139
+ selectAll: "全选",
140
+ paste: "粘贴",
141
+ reconnect: "重连",
142
+ trackpad: "触控板模式",
143
+ trackpadNote: "手指滑动移动鼠标,适合点很小的东西",
144
+ picture: "画面",
145
+ fitPhone: "匹配手机",
146
+ fitWindow: "匹配窗口",
147
+ whole: "整屏",
148
+ actual: "1:1",
149
+ cannotRow: "我做不了,交还",
150
+ handBackTitle: "交还给 {bot}?",
151
+ handBackNote: "{bot} 会截图检查这一步,然后接着做。",
152
+ notePlaceholder: "想告诉 {bot} 的话(可不填),比如「验证码发到了我邮箱」",
153
+ handBackDone: "✓ 做完了,交还",
154
+ handBackCannot: "做不了,交还({bot} 会换别的办法)",
155
+ keepGoing: "再看看",
156
+ fullscreen: "全屏",
157
+ typeClipboard: "把我的剪贴板打进去",
158
+ keys: "发送组合键",
159
+ keysHintMac: "键盘直接打进去 · ⌘C / ⌘V 自动换成 Ctrl+C / Ctrl+V · ⌘⇧V 打出你的剪贴板",
160
+ keysHint: "键盘直接打进去",
161
+ oneMinute: "还剩 1 分钟",
162
+ noResize: "这台桌面不能改大小。双指捏合可以放大缩小。",
163
+ clipboardEmpty: "剪贴板是空的。",
164
+ clipboardDenied: "浏览器不让这个页面读剪贴板。",
165
+ typed: "已打 {n} 个字",
166
+ failed: "没做成:{reason}",
167
+ endedDone: "已交还给 {bot}",
168
+ endedDoneText: "可以关掉这个页面了。{bot} 会在聊天里告诉你结果。",
169
+ endedCannot: "已交还给 {bot}",
170
+ endedCannotText: "{bot} 知道你做不了这一步,会换别的办法。可以关掉这个页面了。",
171
+ restored: "桌面已改回原来的大小。",
172
+ endedExpired: "这个链接已失效",
173
+ endedExpiredText: "还需要的话,请 {bot} 再发一个链接。",
174
+ endedRevoked: "{bot} 收回了这个链接",
175
+ endedRevokedText: "还需要的话,请 {bot} 再发一个链接。",
176
+ notFound: "这个链接不能用",
177
+ notFoundText: "它可能已经失效,或者被收回了。",
178
+ },
179
+ };
180
+ const fill = (text, values) => text.replace(/\{(\w+)\}/g, (all, key) => values[key] ?? all);
181
+ /**
182
+ * The headers of the desktop page and its answers: its scripts and styles come from this address only, it talks only
183
+ * to this address (also by WebSocket, which some browsers do not count as 'self'), no page can frame it, and no other
184
+ * window keeps a handle on it.
185
+ */
186
+ export function desktopHeaders(hosts) {
187
+ const socket = [...new Set(hosts.filter((host) => !!host && /^[A-Za-z0-9.:[\]-]+$/.test(host)))].map((host) => ` wss://${host} ws://${host}`).join("");
188
+ return {
189
+ "content-security-policy": `default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' data: blob:; connect-src 'self'${socket}; frame-ancestors 'none'; base-uri 'none'; form-action 'none'`,
190
+ "x-frame-options": "DENY",
191
+ "cross-origin-opener-policy": "same-origin",
192
+ "cache-control": "no-store",
193
+ "x-robots-tag": "noindex, nofollow",
194
+ };
195
+ }
196
+ /** A line that starts with a number or a bullet, such as "1.", "2)", "(3)", "①" or "- ": the mark, and the rest. */
197
+ const STEP = /^\s*(\d{1,2}[.)、)::](?!\d)|[((]\d{1,2}[))]|[\u2460-\u2473\u2776-\u2793]|[-*•·–](?=\s))\s*(\S.*)$/;
198
+ /**
199
+ * The bot's text as HTML, for the start screen and the page's panel: a paragraph per line as the bot wrote it, and a
200
+ * line that starts with a number or a bullet hangs under its mark, so steps read as a list.
201
+ */
202
+ export function textHtml(text) {
203
+ return text
204
+ .replace(/\r\n?/g, "\n")
205
+ .trim()
206
+ .split("\n")
207
+ .map((line) => {
208
+ const step = STEP.exec(line);
209
+ if (step)
210
+ return `<p class="step"><span class="n">${escape(step[1])}</span><span>${escape(step[2])}</span></p>`;
211
+ return line.trim() ? `<p>${escape(line.trimEnd())}</p>` : `<p class="gap"></p>`;
212
+ })
213
+ .join("");
214
+ }
215
+ /** Text of more than one line, or longer than about two lines of a phone, reads better in the regular weight. */
216
+ export function isLongText(text) {
217
+ const trimmed = text.trim();
218
+ if (trimmed.includes("\n"))
219
+ return true;
220
+ let width = 0;
221
+ // A Chinese, Japanese or Korean character is about as wide as two Latin letters.
222
+ for (const char of trimmed)
223
+ width += /[\u1100-\u11ff\u2e80-\u9fff\uac00-\ud7af\uf900-\ufaff\uff00-\uffef]/.test(char) ? 2 : 1;
224
+ return width > 90;
225
+ }
226
+ /** The kit's folder, relative to a desktop link's page (/d/<token>/), which keeps any path a proxy puts in front. */
227
+ const KIT = "../../__pots/kit/desktop/";
228
+ function page(lang, title, body, head = "") {
229
+ return `<!doctype html>
230
+ <html lang="${lang === "zh" ? "zh-CN" : "en"}">
231
+ <head>
232
+ <meta charset="utf-8">
233
+ <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover, interactive-widget=overlays-content">
234
+ <meta name="referrer" content="no-referrer">
235
+ <meta name="robots" content="noindex, nofollow">
236
+ <meta name="color-scheme" content="light dark">
237
+ <title>${escape(title)}</title>
238
+ <link rel="stylesheet" href="${KIT}desktop.css">
239
+ ${head}</head>
240
+ <body>
241
+ ${body}
242
+ </body>
243
+ </html>
244
+ `;
245
+ }
246
+ /** The page of a link that is open or started: the start screen, and the script that does the rest. */
247
+ export function renderDesktopPage(view, botName, options) {
248
+ const words = Object.fromEntries(Object.entries(WORDS[options.lang]).map(([key, text]) => [key, fill(text, { bot: botName })]));
249
+ // The page says it only when it is so; the script has no use for it.
250
+ const { tunnel, ...scriptWords } = words;
251
+ const facts = {
252
+ bot: botName,
253
+ lang: options.lang,
254
+ text: view.text,
255
+ input: view.input,
256
+ area: view.area,
257
+ minutes: view.minutes,
258
+ remote: options.remote,
259
+ words: scriptWords,
260
+ };
261
+ // JSON in a script element that does not run: "<" is escaped so the text cannot end the element.
262
+ const json = JSON.stringify(facts).replace(/</g, "\\u003c");
263
+ const initial = escape(botName.trim().charAt(0).toUpperCase() || "P");
264
+ return page(options.lang, words.title, `<script type="application/json" id="pots-facts">${json}</script>
265
+ <main id="start" class="page">
266
+ <div class="who"><span class="ava" aria-hidden="true">${initial}</span><span>${escape(words.asks)}</span></div>
267
+ <div class="ask words${isLongText(view.text) ? " long" : ""}" id="ask">${textHtml(view.text)}</div>
268
+ <div class="meta" id="start-meta"></div>
269
+ <details class="fold"><summary>${escape(words.whatTitle)}</summary><p>${escape(words.what)}${options.quickTunnel ? ` ${escape(tunnel)}` : ""}</p></details>
270
+ <noscript><p class="msg">${escape(words.noscript)}</p></noscript>
271
+ <div class="go">
272
+ <p class="msg" id="start-msg" role="alert"></p>
273
+ <button type="button" class="big" id="start-button" disabled>${escape(words.start)}</button>
274
+ <p class="fine">${escape(view.resizable ? words.fineResize : words.fineWhole)}</p>
275
+ </div>
276
+ </main>`, `<link rel="modulepreload" href="${KIT}novnc.js">\n<script type="module" src="${KIT}desktop.js"></script>\n`);
277
+ }
278
+ /** The page of a link that ended, or of none. */
279
+ export function renderDesktopEnded(state, botName, lang) {
280
+ const words = WORDS[lang];
281
+ const [title, text] = state === "done"
282
+ ? [words.endedDone, words.endedDoneText]
283
+ : state === "cannot"
284
+ ? [words.endedCannot, words.endedCannotText]
285
+ : state === "expired"
286
+ ? [words.endedExpired, words.endedExpiredText]
287
+ : state === "revoked"
288
+ ? [words.endedRevoked, words.endedRevokedText]
289
+ : [words.notFound, words.notFoundText];
290
+ const values = { bot: botName || "the bot" };
291
+ return page(lang, fill(title, values), `<main class="page ended"><div class="check ${state === "done" || state === "cannot" ? "good" : "gone"}" aria-hidden="true"></div><h1>${escape(fill(title, values))}</h1><p class="meta">${escape(fill(text, values))}</p></main>`);
292
+ }
293
+ //# sourceMappingURL=desktop-page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"desktop-page.js","sourceRoot":"","sources":["../../src/pages/desktop-page.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,IAAI,CAAE,CAAC,CAAC;AAEtJ,yGAAyG;AACzG,MAAM,UAAU,QAAQ,CAAC,cAAkC;IACzD,MAAM,MAAM,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC;SAClC,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACZ,MAAM,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9D,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,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