pi-durable-bot 0.6.1 → 0.7.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 (65) hide show
  1. package/CHANGELOG.md +27 -2
  2. package/README.md +47 -21
  3. package/dist/agent/resources.js +12 -1
  4. package/dist/agent/resources.js.map +1 -1
  5. package/dist/bot/bot.js +54 -5
  6. package/dist/bot/bot.js.map +1 -1
  7. package/dist/bot/prompt.js +13 -3
  8. package/dist/bot/prompt.js.map +1 -1
  9. package/dist/channels/discord/index.js +202 -20
  10. package/dist/channels/discord/index.js.map +1 -1
  11. package/dist/channels/slack/index.js +314 -16
  12. package/dist/channels/slack/index.js.map +1 -1
  13. package/dist/channels/telegram/index.js +21 -2
  14. package/dist/channels/telegram/index.js.map +1 -1
  15. package/dist/cli/agent.js +20 -1
  16. package/dist/cli/agent.js.map +1 -1
  17. package/dist/cli/commands.js +28 -4
  18. package/dist/cli/commands.js.map +1 -1
  19. package/dist/cli/pages.js +44 -0
  20. package/dist/cli/pages.js.map +1 -0
  21. package/dist/core/channel.js +4 -1
  22. package/dist/core/channel.js.map +1 -1
  23. package/dist/core/env-file.js +23 -6
  24. package/dist/core/env-file.js.map +1 -1
  25. package/dist/core/forms.js +16 -0
  26. package/dist/core/forms.js.map +1 -0
  27. package/dist/gateway/errors.js +3 -0
  28. package/dist/gateway/errors.js.map +1 -1
  29. package/dist/gateway/forms.js +99 -0
  30. package/dist/gateway/forms.js.map +1 -0
  31. package/dist/gateway/gateway.js +23 -1
  32. package/dist/gateway/gateway.js.map +1 -1
  33. package/dist/gateway/log.js +7 -5
  34. package/dist/gateway/log.js.map +1 -1
  35. package/dist/gateway/waker.js +23 -8
  36. package/dist/gateway/waker.js.map +1 -1
  37. package/dist/main.js +7 -1
  38. package/dist/main.js.map +1 -1
  39. package/dist/pages/cloudflared.js +149 -0
  40. package/dist/pages/cloudflared.js.map +1 -0
  41. package/dist/pages/files.js +244 -0
  42. package/dist/pages/files.js.map +1 -0
  43. package/dist/pages/host.js +268 -0
  44. package/dist/pages/host.js.map +1 -0
  45. package/dist/pages/secret-page.js +71 -0
  46. package/dist/pages/secret-page.js.map +1 -0
  47. package/dist/pages/server.js +305 -0
  48. package/dist/pages/server.js.map +1 -0
  49. package/dist/pages/settings.js +71 -0
  50. package/dist/pages/settings.js.map +1 -0
  51. package/dist/pages/store.js +492 -0
  52. package/dist/pages/store.js.map +1 -0
  53. package/dist/pages/tunnel.js +271 -0
  54. package/dist/pages/tunnel.js.map +1 -0
  55. package/kit/pots.css +473 -0
  56. package/kit/pots.js +627 -0
  57. package/package.json +13 -3
  58. package/pi-package/skills/pots-setup/SKILL.md +15 -0
  59. package/{docs/channels/discord.md → skills/discord-channel/SKILL.md} +55 -2
  60. package/skills/pages/SKILL.md +242 -0
  61. package/skills/slack-channel/SKILL.md +126 -0
  62. package/skills/telegram-channel/SKILL.md +89 -0
  63. package/docs/channels/slack.md +0 -70
  64. package/docs/channels/telegram.md +0 -50
  65. /package/{docs/channels → skills/slack-channel}/slack-app-manifest.yaml +0 -0
package/kit/pots.css ADDED
@@ -0,0 +1,473 @@
1
+ /*
2
+ * Pots page kit: a plain, readable look for pages that bots write. Phone first, light and dark. Plain HTML looks right
3
+ * without classes; the few classes are listed in the pages skill (skills/pages/SKILL.md).
4
+ */
5
+
6
+ :root {
7
+ color-scheme: light dark;
8
+ --pots-bg: #f7f7f5;
9
+ --pots-surface: #ffffff;
10
+ --pots-text: #1d1d1f;
11
+ --pots-muted: #5f6368;
12
+ --pots-border: #dcdcd7;
13
+ --pots-accent: #1f7a70;
14
+ --pots-accent-text: #ffffff;
15
+ --pots-accent-soft: #e3f1ee;
16
+ --pots-good: #1e7d3a;
17
+ --pots-good-soft: #e5f4e9;
18
+ --pots-bad: #b3261e;
19
+ --pots-bad-soft: #fbe9e7;
20
+ --pots-warn-soft: #fff4d6;
21
+ --pots-code-bg: #efefeb;
22
+ --pots-radius: 10px;
23
+ --pots-font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
24
+ --pots-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
25
+ }
26
+
27
+ @media (prefers-color-scheme: dark) {
28
+ :root {
29
+ --pots-bg: #141516;
30
+ --pots-surface: #1d1f21;
31
+ --pots-text: #e8e8e6;
32
+ --pots-muted: #a2a6ab;
33
+ --pots-border: #34373a;
34
+ --pots-accent: #4fb3a5;
35
+ --pots-accent-text: #0c1a18;
36
+ --pots-accent-soft: #1b3330;
37
+ --pots-good: #6cc58a;
38
+ --pots-good-soft: #18301f;
39
+ --pots-bad: #f08a80;
40
+ --pots-bad-soft: #3a1f1c;
41
+ --pots-warn-soft: #3a3118;
42
+ --pots-code-bg: #26292c;
43
+ }
44
+ }
45
+
46
+ *,
47
+ *::before,
48
+ *::after {
49
+ box-sizing: border-box;
50
+ }
51
+
52
+ html {
53
+ -webkit-text-size-adjust: 100%;
54
+ text-size-adjust: 100%;
55
+ }
56
+
57
+ body {
58
+ margin: 0;
59
+ padding: 16px;
60
+ background: var(--pots-bg);
61
+ color: var(--pots-text);
62
+ font: 17px/1.55 var(--pots-font);
63
+ overflow-wrap: break-word;
64
+ }
65
+
66
+ main,
67
+ .pots-page {
68
+ max-width: 44rem;
69
+ margin: 0 auto;
70
+ padding-bottom: 48px;
71
+ }
72
+
73
+ @media (min-width: 720px) {
74
+ body {
75
+ padding: 32px 24px;
76
+ }
77
+ }
78
+
79
+ /* ---- Text ---- */
80
+
81
+ h1,
82
+ h2,
83
+ h3,
84
+ h4 {
85
+ line-height: 1.25;
86
+ margin: 1.6em 0 0.5em;
87
+ }
88
+ h1 {
89
+ font-size: 1.7rem;
90
+ margin-top: 0.4em;
91
+ }
92
+ h2 {
93
+ font-size: 1.3rem;
94
+ }
95
+ h3 {
96
+ font-size: 1.1rem;
97
+ }
98
+ p,
99
+ ul,
100
+ ol,
101
+ blockquote,
102
+ pre,
103
+ table,
104
+ figure {
105
+ margin: 0 0 1em;
106
+ }
107
+ ul,
108
+ ol {
109
+ padding-left: 1.4em;
110
+ }
111
+ li + li {
112
+ margin-top: 0.25em;
113
+ }
114
+ a {
115
+ color: var(--pots-accent);
116
+ text-underline-offset: 2px;
117
+ }
118
+ hr {
119
+ border: 0;
120
+ border-top: 1px solid var(--pots-border);
121
+ margin: 2em 0;
122
+ }
123
+ img,
124
+ svg,
125
+ video,
126
+ canvas {
127
+ max-width: 100%;
128
+ height: auto;
129
+ }
130
+ blockquote {
131
+ margin-left: 0;
132
+ padding: 0.2em 0 0.2em 1em;
133
+ border-left: 3px solid var(--pots-border);
134
+ color: var(--pots-muted);
135
+ }
136
+ code,
137
+ kbd,
138
+ pre {
139
+ font-family: var(--pots-mono);
140
+ font-size: 0.9em;
141
+ }
142
+ code {
143
+ background: var(--pots-code-bg);
144
+ padding: 0.1em 0.35em;
145
+ border-radius: 5px;
146
+ }
147
+ pre {
148
+ background: var(--pots-code-bg);
149
+ padding: 12px 14px;
150
+ border-radius: var(--pots-radius);
151
+ overflow-x: auto;
152
+ }
153
+ pre code {
154
+ background: none;
155
+ padding: 0;
156
+ }
157
+ small,
158
+ .pots-muted {
159
+ color: var(--pots-muted);
160
+ }
161
+
162
+ /* ---- Tables: they scroll sideways on a phone instead of squeezing ---- */
163
+
164
+ table {
165
+ display: block;
166
+ max-width: 100%;
167
+ overflow-x: auto;
168
+ border-collapse: collapse;
169
+ font-size: 0.95em;
170
+ }
171
+ th,
172
+ td {
173
+ padding: 8px 12px;
174
+ border-bottom: 1px solid var(--pots-border);
175
+ text-align: left;
176
+ vertical-align: top;
177
+ }
178
+ th {
179
+ font-weight: 600;
180
+ white-space: nowrap;
181
+ }
182
+ td.pots-num,
183
+ th.pots-num {
184
+ text-align: right;
185
+ font-variant-numeric: tabular-nums;
186
+ }
187
+
188
+ /* ---- Blocks ---- */
189
+
190
+ .pots-card {
191
+ background: var(--pots-surface);
192
+ border: 1px solid var(--pots-border);
193
+ border-radius: var(--pots-radius);
194
+ padding: 16px;
195
+ margin: 0 0 16px;
196
+ }
197
+ .pots-note {
198
+ background: var(--pots-accent-soft);
199
+ border-radius: var(--pots-radius);
200
+ padding: 12px 16px;
201
+ margin: 0 0 16px;
202
+ }
203
+ .pots-note.pots-warn {
204
+ background: var(--pots-warn-soft);
205
+ }
206
+ .pots-row {
207
+ display: flex;
208
+ flex-wrap: wrap;
209
+ gap: 12px;
210
+ }
211
+ .pots-row > * {
212
+ flex: 1 1 12rem;
213
+ }
214
+ .pots-badge {
215
+ display: inline-block;
216
+ padding: 0.1em 0.6em;
217
+ border-radius: 999px;
218
+ background: var(--pots-code-bg);
219
+ font-size: 0.85em;
220
+ }
221
+ .pots-badge.pots-good {
222
+ background: var(--pots-good-soft);
223
+ color: var(--pots-good);
224
+ }
225
+ .pots-badge.pots-bad {
226
+ background: var(--pots-bad-soft);
227
+ color: var(--pots-bad);
228
+ }
229
+
230
+ /* ---- Forms ---- */
231
+
232
+ form[data-pots] [data-pots-question],
233
+ fieldset {
234
+ background: var(--pots-surface);
235
+ border: 1px solid var(--pots-border);
236
+ border-radius: var(--pots-radius);
237
+ padding: 14px 16px 16px;
238
+ margin: 0 0 16px;
239
+ min-width: 0;
240
+ }
241
+ fieldset [data-pots-question],
242
+ [data-pots-question] fieldset {
243
+ border: 0;
244
+ padding: 0;
245
+ background: none;
246
+ }
247
+ legend {
248
+ float: left;
249
+ width: 100%;
250
+ padding: 0;
251
+ margin: 0 0 10px;
252
+ font-weight: 600;
253
+ }
254
+ legend + * {
255
+ clear: both;
256
+ }
257
+ [data-pots-question] > h2:first-child,
258
+ [data-pots-question] > h3:first-child,
259
+ [data-pots-question] > h4:first-child {
260
+ margin-top: 0;
261
+ }
262
+
263
+ label {
264
+ display: block;
265
+ font-weight: 600;
266
+ }
267
+ label + label {
268
+ margin-top: 8px;
269
+ }
270
+
271
+ /* A choice: the whole row is the tap target. */
272
+ label:has(> input[type="radio"]),
273
+ label:has(> input[type="checkbox"]),
274
+ .pots-choice {
275
+ display: flex;
276
+ align-items: center;
277
+ gap: 12px;
278
+ min-height: 48px;
279
+ padding: 10px 14px;
280
+ border: 1px solid var(--pots-border);
281
+ border-radius: var(--pots-radius);
282
+ background: var(--pots-bg);
283
+ font-weight: 400;
284
+ cursor: pointer;
285
+ }
286
+ label:has(> input[type="radio"]:checked),
287
+ label:has(> input[type="checkbox"]:checked) {
288
+ border-color: var(--pots-accent);
289
+ background: var(--pots-accent-soft);
290
+ }
291
+ label:has(> input:focus-visible) {
292
+ outline: 2px solid var(--pots-accent);
293
+ outline-offset: 2px;
294
+ }
295
+ input[type="radio"],
296
+ input[type="checkbox"] {
297
+ width: 20px;
298
+ height: 20px;
299
+ margin: 0;
300
+ flex: none;
301
+ accent-color: var(--pots-accent);
302
+ }
303
+
304
+ /* Approve or reject: two buttons side by side. */
305
+ .pots-approve {
306
+ display: flex;
307
+ gap: 10px;
308
+ margin: 8px 0;
309
+ }
310
+ .pots-approve label {
311
+ flex: 1 1 0;
312
+ justify-content: center;
313
+ margin: 0;
314
+ font-weight: 600;
315
+ }
316
+ .pots-approve label:has(input[value="approve"]:checked) {
317
+ border-color: var(--pots-good);
318
+ background: var(--pots-good-soft);
319
+ color: var(--pots-good);
320
+ }
321
+ .pots-approve label:has(input[value="reject"]:checked) {
322
+ border-color: var(--pots-bad);
323
+ background: var(--pots-bad-soft);
324
+ color: var(--pots-bad);
325
+ }
326
+
327
+ input:not([type="radio"], [type="checkbox"], [type="submit"], [type="button"], [type="range"], [type="color"]),
328
+ select,
329
+ textarea {
330
+ display: block;
331
+ width: 100%;
332
+ margin-top: 6px;
333
+ padding: 10px 12px;
334
+ /* 16px or more, so phones do not zoom in on the field. */
335
+ font: 400 17px/1.4 var(--pots-font);
336
+ color: var(--pots-text);
337
+ background: var(--pots-bg);
338
+ border: 1px solid var(--pots-border);
339
+ border-radius: 8px;
340
+ }
341
+ textarea {
342
+ min-height: 6em;
343
+ resize: vertical;
344
+ }
345
+ input:focus,
346
+ select:focus,
347
+ textarea:focus {
348
+ outline: 2px solid var(--pots-accent);
349
+ outline-offset: 1px;
350
+ border-color: var(--pots-accent);
351
+ }
352
+
353
+ /* A comment on a section: closed until someone wants to write one. */
354
+ details.pots-comment {
355
+ margin-top: 10px;
356
+ }
357
+ details.pots-comment > summary {
358
+ display: inline-block;
359
+ cursor: pointer;
360
+ color: var(--pots-accent);
361
+ font-weight: 600;
362
+ padding: 6px 0;
363
+ list-style: none;
364
+ }
365
+ details.pots-comment > summary::-webkit-details-marker {
366
+ display: none;
367
+ }
368
+ details.pots-comment > summary::before {
369
+ content: "+ ";
370
+ }
371
+ details.pots-comment[open] > summary::before {
372
+ content: "− ";
373
+ }
374
+
375
+ button,
376
+ input[type="submit"],
377
+ input[type="button"] {
378
+ display: inline-flex;
379
+ align-items: center;
380
+ justify-content: center;
381
+ min-height: 48px;
382
+ padding: 10px 22px;
383
+ border: 1px solid transparent;
384
+ border-radius: var(--pots-radius);
385
+ background: var(--pots-accent);
386
+ color: var(--pots-accent-text);
387
+ font: 600 17px/1.2 var(--pots-font);
388
+ cursor: pointer;
389
+ }
390
+ form button[type="submit"],
391
+ form button:not([type]),
392
+ form input[type="submit"] {
393
+ width: 100%;
394
+ margin-top: 8px;
395
+ }
396
+ @media (min-width: 720px) {
397
+ form button[type="submit"],
398
+ form button:not([type]),
399
+ form input[type="submit"] {
400
+ width: auto;
401
+ }
402
+ }
403
+ button.pots-secondary {
404
+ background: transparent;
405
+ color: var(--pots-accent);
406
+ border-color: var(--pots-border);
407
+ }
408
+ button:disabled,
409
+ input:disabled,
410
+ select:disabled,
411
+ textarea:disabled {
412
+ opacity: 0.6;
413
+ cursor: default;
414
+ }
415
+
416
+ /* What happened to the answers, written by pots.js. */
417
+ [data-pots-status] {
418
+ margin: 12px 0 0;
419
+ font-weight: 600;
420
+ }
421
+ [data-pots-status]:empty {
422
+ display: none;
423
+ }
424
+ [data-pots-status][data-state="done"] {
425
+ color: var(--pots-good);
426
+ }
427
+ [data-pots-status][data-state="failed"] {
428
+ color: var(--pots-bad);
429
+ }
430
+ [data-pots-status][data-state="retrying"],
431
+ [data-pots-status][data-state="sending"] {
432
+ color: var(--pots-muted);
433
+ }
434
+ form[data-pots-state="done"] [data-pots-question],
435
+ form[data-pots-state="gone"] [data-pots-question] {
436
+ opacity: 0.75;
437
+ }
438
+
439
+ /* "This page has changed", from pots.js. */
440
+ .pots-banner {
441
+ position: sticky;
442
+ top: 0;
443
+ z-index: 10;
444
+ display: flex;
445
+ align-items: center;
446
+ justify-content: space-between;
447
+ gap: 12px;
448
+ margin: 0 0 16px;
449
+ padding: 10px 16px;
450
+ background: var(--pots-warn-soft);
451
+ border: 1px solid var(--pots-border);
452
+ border-radius: var(--pots-radius);
453
+ }
454
+ .pots-banner button {
455
+ min-height: 40px;
456
+ padding: 6px 16px;
457
+ }
458
+
459
+ [data-pots-error]::before {
460
+ content: "Could not load this part of the page.";
461
+ display: block;
462
+ color: var(--pots-bad);
463
+ }
464
+
465
+ @media print {
466
+ body {
467
+ background: none;
468
+ }
469
+ form button,
470
+ .pots-banner {
471
+ display: none;
472
+ }
473
+ }