@kevin5251984/guild 0.2.21 → 0.2.23

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.
@@ -0,0 +1,26 @@
1
+ import { Service, type Context } from "cordis";
2
+ import { CRON_TICK_MS } from "../cron-schedule.ts";
3
+ import { executeCronjob, tickCronJobs } from "../cron.ts";
4
+ import { guildEnvOf } from "../start.ts";
5
+
6
+ export class CronService extends Service {
7
+ static inject = ["store", "tools"];
8
+
9
+ constructor(ctx: Context) {
10
+ super(ctx, "cron");
11
+ ctx.tools.register("cronjob", (args, toolCtx) =>
12
+ executeCronjob(this.ctx.store.guild, args, toolCtx),
13
+ );
14
+ const tick = () => {
15
+ void tickCronJobs(this.ctx.store.guild, guildEnvOf(this.ctx));
16
+ };
17
+ const interval = setInterval(tick, CRON_TICK_MS);
18
+ interval.unref();
19
+ ctx.effect(() => () => clearInterval(interval));
20
+ const boot = setTimeout(tick, 1500);
21
+ boot.unref();
22
+ ctx.effect(() => () => clearTimeout(boot));
23
+ }
24
+ }
25
+
26
+ export default CronService;
@@ -257,6 +257,57 @@ body.resizing-sidebar iframe { pointer-events: none; }
257
257
  font-size: 0.72rem;
258
258
  letter-spacing: 0.12em;
259
259
  }
260
+ .nav-sec {
261
+ display: flex;
262
+ flex-direction: column;
263
+ min-height: 0;
264
+ }
265
+ .nav-sec[data-nav-sec="dms"],
266
+ .nav-sec[data-nav-sec="cron"] {
267
+ flex: 1 1 0;
268
+ }
269
+ .nav-sec.folded {
270
+ flex: 0 0 auto;
271
+ }
272
+ .nav-sec.folded .navlist,
273
+ .nav-sec.folded .create-row {
274
+ display: none !important;
275
+ }
276
+ .sec-fold {
277
+ display: flex;
278
+ align-items: center;
279
+ gap: 6px;
280
+ flex: 1;
281
+ min-width: 0;
282
+ margin: 0;
283
+ padding: 0;
284
+ border: 0;
285
+ background: transparent;
286
+ color: inherit;
287
+ font: inherit;
288
+ letter-spacing: inherit;
289
+ font-weight: inherit;
290
+ text-shadow: inherit;
291
+ text-align: left;
292
+ cursor: pointer;
293
+ }
294
+ .sec-fold:hover { color: var(--text); }
295
+ .sec-chev {
296
+ display: inline-block;
297
+ width: 0.9em;
298
+ flex: none;
299
+ font-size: 0.8em;
300
+ line-height: 1;
301
+ transition: transform var(--press-ms) var(--ease-out);
302
+ }
303
+ .nav-sec.folded .sec-chev { transform: rotate(-90deg); }
304
+ .nav-empty {
305
+ list-style: none;
306
+ margin: 0;
307
+ padding: 0.35rem 0.9rem 0.7rem;
308
+ color: var(--muted);
309
+ font-size: 0.78rem;
310
+ }
260
311
  .add-ch {
261
312
  margin: 0;
262
313
  width: 22px;
@@ -367,6 +418,7 @@ body.resizing-sidebar iframe { pointer-events: none; }
367
418
  }
368
419
  @media (prefers-reduced-motion: reduce) {
369
420
  .busy-flash { animation: none; }
421
+ .sec-chev { transition: none; }
370
422
  }
371
423
  .navlist a.nav-row:hover { background: var(--lift); }
372
424
  .navlist a.nav-row.on { background: var(--bubble); }
@@ -648,6 +700,8 @@ body.grok .sidebar .section-h {
648
700
  font-weight: 700;
649
701
  text-shadow: 0 1px 0 #0008;
650
702
  }
703
+ body.grok .sidebar .sec-fold:hover { color: #F4E3A4; }
704
+ body.grok .sidebar .nav-empty { color: #B08960; }
651
705
  body.grok .sidebar .add-ch {
652
706
  color: var(--pin);
653
707
  border-radius: 2px;
@@ -890,7 +944,8 @@ body.grok #channels li.nav-quest:has(a.on) .notice-party .members-stack .avatar,
890
944
  body.grok #channels li.nav-quest:hover .notice-party .members-stack .avatar {
891
945
  border-color: var(--plaque-on);
892
946
  }
893
- body.grok #dms.navlist {
947
+ body.grok #dms.navlist,
948
+ body.grok #cron-nav.navlist {
894
949
  flex-grow: 1;
895
950
  flex-shrink: 1;
896
951
  flex-basis: 0;
@@ -901,25 +956,30 @@ body.grok #dms.navlist {
901
956
  scrollbar-width: thin;
902
957
  scrollbar-color: #8A623C transparent;
903
958
  }
904
- body.grok #dms a.nav-row {
959
+ body.grok #dms a.nav-row,
960
+ body.grok #cron-nav a.nav-row {
905
961
  color: #F0E2C8;
906
962
  border-radius: 2px;
907
963
  border: 1px solid transparent;
908
964
  background: color-mix(in srgb, #16100B 35%, transparent);
909
965
  }
910
- body.grok #dms a.nav-row:hover {
966
+ body.grok #dms a.nav-row:hover,
967
+ body.grok #cron-nav a.nav-row:hover {
911
968
  background: color-mix(in srgb, #EDE6D6 12%, transparent);
912
969
  border-color: color-mix(in srgb, var(--board-edge) 45%, transparent);
913
970
  }
914
- body.grok #dms a.nav-row.on {
971
+ body.grok #dms a.nav-row.on,
972
+ body.grok #cron-nav a.nav-row.on {
915
973
  background: color-mix(in srgb, #EDE6D6 18%, transparent);
916
974
  border-color: color-mix(in srgb, var(--pin) 40%, transparent);
917
975
  }
918
- body.grok #dms .nav-chip {
976
+ body.grok #dms .nav-chip,
977
+ body.grok #cron-nav .nav-chip {
919
978
  color: #E8C48A;
920
979
  background: #16100B;
921
980
  }
922
- body.grok #dms .busy-flash { box-shadow: 0 0 0 2px #16100B; }
981
+ body.grok #dms .busy-flash,
982
+ body.grok #cron-nav .busy-flash { box-shadow: 0 0 0 2px #16100B; }
923
983
  body.grok .sidebar .side-foot {
924
984
  position: absolute;
925
985
  left: 0;
@@ -1578,7 +1638,8 @@ a.invite-btn:hover { text-decoration: none; }
1578
1638
  min-height: 240px;
1579
1639
  height: 360px;
1580
1640
  border: 0;
1581
- background: #fff;
1641
+ background: transparent;
1642
+ color-scheme: dark;
1582
1643
  border-radius: 0 0 12px 12px;
1583
1644
  }
1584
1645
  .assistant-text .md-html-preview[data-view="code"] .md-html-frame { display: none; }
@@ -2937,6 +2998,38 @@ dialog p { margin: 0 0 0.8rem; color: var(--muted); font-size: 0.9rem; }
2937
2998
  color: var(--muted);
2938
2999
  font-size: 0.8rem;
2939
3000
  }
3001
+ .cron-list {
3002
+ display: flex;
3003
+ flex-direction: column;
3004
+ gap: 8px;
3005
+ max-height: 40vh;
3006
+ overflow: auto;
3007
+ margin: 0 0 1rem;
3008
+ }
3009
+ .cron-row {
3010
+ display: grid;
3011
+ grid-template-columns: 1fr auto;
3012
+ gap: 8px;
3013
+ padding: 8px 10px;
3014
+ border: 1px solid var(--line);
3015
+ border-radius: 12px;
3016
+ background: var(--fill);
3017
+ }
3018
+ .cron-row b { display: block; font-size: 0.92rem; }
3019
+ .cron-row span { color: var(--muted); font-size: 0.78rem; }
3020
+ .cron-row .cron-acts { display: flex; gap: 4px; align-items: center; }
3021
+ .cron-row .cron-acts button {
3022
+ margin: 0;
3023
+ padding: 0.15rem 0.45rem;
3024
+ font-size: 0.72rem;
3025
+ }
3026
+ #cron-dialog label { display: block; margin: 0.6rem 0 0.2rem; font-size: 0.8rem; color: var(--muted); }
3027
+ #cron-dialog input,
3028
+ #cron-dialog select,
3029
+ #cron-dialog textarea {
3030
+ width: 100%;
3031
+ box-sizing: border-box;
3032
+ }
2940
3033
  .dialog-actions { display: flex; justify-content: flex-end; gap: 0.4rem; }
2941
3034
  .dialog-actions button {
2942
3035
  margin: 0;
@@ -3113,13 +3206,23 @@ dialog p { margin: 0 0 0.8rem; color: var(--muted); font-size: 0.9rem; }
3113
3206
  line-height: 1.45;
3114
3207
  }
3115
3208
  .traj-empty { color: #8b8b8b; padding: 1.2rem; }
3209
+ .md-img-link {
3210
+ display: inline-block;
3211
+ max-width: 22rem;
3212
+ margin: 0.45rem 0;
3213
+ line-height: 0;
3214
+ border-radius: 12px;
3215
+ }
3116
3216
  .md-img,
3117
3217
  .row-card.image .md-img {
3118
3218
  display: block;
3119
- max-width: min(100%, 48rem);
3219
+ max-width: 22rem;
3220
+ max-height: min(16rem, 40vh);
3221
+ width: auto;
3120
3222
  height: auto;
3223
+ object-fit: contain;
3121
3224
  border-radius: 12px;
3122
- margin: 0.45rem 0;
3225
+ margin: 0;
3123
3226
  background: #111;
3124
3227
  }
3125
3228
  .row-card.image .term-out {