agent-loft 0.2.62 → 0.2.63

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-loft",
3
- "version": "0.2.62",
3
+ "version": "0.2.63",
4
4
  "type": "module",
5
5
  "description": "多个 agent 的工作台:把本机 Claude Code / Codex 放到一处统一管理,用飞书和 Web 页面随时驱动——会话、审批、模型切换都共用",
6
6
  "keywords": [
package/web/css/base.css CHANGED
@@ -192,8 +192,12 @@ select.input {
192
192
  .input:focus,
193
193
  .field input:focus,
194
194
  .field select:focus,
195
- .field textarea:focus {
196
- border-color: var(--accent);
195
+ .field textarea:focus,
196
+ .settings-page input:not([type="checkbox"]):not([type="radio"]):focus,
197
+ .settings-page select:focus,
198
+ .settings-page textarea:focus {
199
+ border-color: var(--fg-soft);
200
+ outline: none;
197
201
  }
198
202
 
199
203
  .btn {
@@ -7,6 +7,7 @@
7
7
  position: absolute;
8
8
  inset: 0 auto 0 0;
9
9
  z-index: 30;
10
+ background: var(--bg);
10
11
  transform: translateX(-100%);
11
12
  transition: transform 0.2s ease;
12
13
  width: min(84vw, 320px);
@@ -70,8 +70,8 @@
70
70
  }
71
71
 
72
72
  .rename-input:focus {
73
- border-color: var(--accent);
74
- box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
73
+ border-color: var(--fg-soft);
74
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--fg) 10%, transparent);
75
75
  }
76
76
 
77
77
  .dialog-foot {
@@ -336,7 +336,7 @@ button.list-item:hover {
336
336
  }
337
337
 
338
338
  .dir-manual:focus {
339
- border-color: var(--accent);
339
+ border-color: var(--fg-soft);
340
340
  }
341
341
 
342
342
  .dir-picker .modal-foot .muted {
package/web/css/tasks.css CHANGED
@@ -383,33 +383,85 @@ button.task-run:hover {
383
383
  color: var(--fg-soft);
384
384
  }
385
385
 
386
- .day-chips {
387
- display: flex;
388
- flex-wrap: wrap;
386
+ .task-weekly-controls {
389
387
  width: 100%;
390
- gap: 4px;
388
+ min-width: 0;
389
+ padding: 14px;
390
+ border: 1px solid var(--border);
391
+ border-radius: 12px;
392
+ background: var(--bg-side);
393
+ }
394
+
395
+ .task-weekly-heading,
396
+ .task-clock-row {
397
+ display: flex;
398
+ align-items: center;
399
+ justify-content: space-between;
400
+ gap: 12px;
401
+ color: var(--fg-soft);
402
+ font-size: 13px;
403
+ }
404
+
405
+ .task-weekly-hint {
406
+ color: var(--fg-faint);
407
+ font-size: 12px;
408
+ }
409
+
410
+ .task-weekdays {
411
+ display: grid;
412
+ grid-template-columns: repeat(7, minmax(0, 1fr));
413
+ gap: 6px;
414
+ margin-top: 10px;
391
415
  }
392
416
 
393
- .day-chip {
394
- min-width: 44px;
395
- padding: 0 8px;
396
- height: 34px;
417
+ .task-weekday {
418
+ display: flex;
419
+ align-items: center;
420
+ justify-content: center;
421
+ min-width: 0;
422
+ height: 40px;
423
+ padding: 0;
397
424
  border-radius: 8px;
398
425
  border: 1px solid var(--border);
426
+ background: var(--bg-input);
427
+ color: var(--fg-soft);
399
428
  font-size: 13px;
429
+ font-weight: 500;
430
+ line-height: 1;
431
+ white-space: nowrap;
400
432
  }
401
433
 
402
- .day-chip.on {
403
- background: var(--accent);
404
- border-color: var(--accent);
405
- color: var(--accent-fg);
434
+ .task-weekday:hover {
435
+ border-color: var(--fg-faint);
406
436
  }
407
437
 
408
- .day-chip:focus-visible {
409
- outline: 2px solid var(--accent);
438
+ .task-weekday[aria-pressed="true"] {
439
+ background: var(--fg);
440
+ border-color: var(--fg);
441
+ color: var(--bg);
442
+ }
443
+
444
+ .task-weekday:focus-visible {
445
+ outline: 2px solid var(--fg);
410
446
  outline-offset: 2px;
411
447
  }
412
448
 
449
+ .task-clock-row {
450
+ margin-top: 14px;
451
+ padding-top: 12px;
452
+ border-top: 1px solid var(--border);
453
+ }
454
+
455
+ .field .task-clock-row input[type="time"] {
456
+ flex: 0 0 132px;
457
+ width: 132px;
458
+ min-width: 0;
459
+ height: 40px;
460
+ padding: 0 10px;
461
+ font-size: 15px;
462
+ font-variant-numeric: tabular-nums;
463
+ }
464
+
413
465
  .task-static {
414
466
  font-size: 14px;
415
467
  color: var(--fg-soft);
package/web/index.html CHANGED
@@ -4,7 +4,7 @@
4
4
  <meta charset="utf-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover, interactive-widget=resizes-content" />
6
6
  <meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)" />
7
- <meta name="theme-color" content="#1f1f1f" media="(prefers-color-scheme: dark)" />
7
+ <meta name="theme-color" content="#212121" media="(prefers-color-scheme: dark)" />
8
8
  <meta name="apple-mobile-web-app-capable" content="yes" />
9
9
  <meta name="apple-mobile-web-app-status-bar-style" content="default" />
10
10
  <meta name="apple-mobile-web-app-title" content="Agent Loft" />
@@ -15,25 +15,25 @@
15
15
  <link rel="stylesheet" href="/vendor/hljs-light.css" media="(prefers-color-scheme: light)" />
16
16
  <link rel="stylesheet" href="/vendor/hljs-dark.css" media="(prefers-color-scheme: dark)" />
17
17
  <!-- 顺序就是层叠顺序,不要随意调换 -->
18
- <link rel="stylesheet" href="/css/base.css" />
18
+ <link rel="stylesheet" href="/css/base.css?v=2" />
19
19
  <link rel="stylesheet" href="/css/sidebar.css" />
20
20
  <link rel="stylesheet" href="/css/topbar.css" />
21
21
  <link rel="stylesheet" href="/css/messages.css" />
22
22
  <link rel="stylesheet" href="/css/loader.css" />
23
23
  <link rel="stylesheet" href="/css/composer.css" />
24
- <link rel="stylesheet" href="/css/overlay.css" />
24
+ <link rel="stylesheet" href="/css/overlay.css?v=2" />
25
25
  <link rel="stylesheet" href="/css/search.css" />
26
26
  <link rel="stylesheet" href="/css/settings.css" />
27
27
  <link rel="stylesheet" href="/css/schedule.css" />
28
28
  <link rel="stylesheet" href="/css/todos.css" />
29
- <link rel="stylesheet" href="/css/tasks.css" />
29
+ <link rel="stylesheet" href="/css/tasks.css?v=3" />
30
30
  <link rel="stylesheet" href="/css/library.css" />
31
31
  <link rel="stylesheet" href="/css/skills.css" />
32
32
  <link rel="stylesheet" href="/css/experts.css" />
33
33
  <link rel="stylesheet" href="/css/terminal.css" />
34
34
  <link rel="stylesheet" href="/css/remote.css" />
35
35
  <link rel="stylesheet" href="/css/servers.css" />
36
- <link rel="stylesheet" href="/css/mobile.css" />
36
+ <link rel="stylesheet" href="/css/mobile.css?v=2" />
37
37
  </head>
38
38
  <body>
39
39
  <div id="app"><div class="boot"><span class="loft-loader xl" role="img" aria-label="加载中"><svg viewBox="96 56 320 388" aria-hidden="true"><defs><linearGradient id="boot-g" gradientUnits="userSpaceOnUse" x1="104" y1="104" x2="408" y2="408"><stop offset="0" stop-color="#3b82f6"/><stop offset="1" stop-color="#06b6d4"/></linearGradient></defs><path class="ll-shadow" d="M256 296L404 364L256 432L108 364Z" fill="url(#boot-g)"/><path class="ll-plate" d="M256 252L404 320L256 388L108 320Z" fill="url(#boot-g)"/><path class="ll-star ll-l" d="M152 186C158.46 217.54 158.46 217.54 190 224C158.46 230.46 158.46 230.46 152 262C145.54 230.46 145.54 230.46 114 224C145.54 217.54 145.54 217.54 152 186Z" fill="url(#boot-g)"/><path class="ll-star ll-c" d="M256 82C268.92 145.08 268.92 145.08 332 158C268.92 170.92 268.92 170.92 256 234C243.08 170.92 243.08 170.92 180 158C243.08 145.08 243.08 145.08 256 82Z" fill="url(#boot-g)"/><path class="ll-star ll-r" d="M360 186C366.46 217.54 366.46 217.54 398 224C366.46 230.46 366.46 230.46 360 262C353.54 230.46 353.54 230.46 322 224C353.54 217.54 353.54 217.54 360 186Z" fill="url(#boot-g)"/></svg></span></div></div>
@@ -8,23 +8,26 @@ import { field, saveButton } from "./common.js";
8
8
 
9
9
  // ---------- 记忆(每个人自己的) ----------
10
10
 
11
- export async function memoryTab(panel) {
11
+ export async function memoryTab(panel, refresh = false) {
12
12
  const box = h("div", { class: "section" }, h("h4", {}, "记忆"), h("span", { class: "spinner" }));
13
- fill(panel, box);
13
+ // 更新时保留旧内容,避免加载占位让页面变短、滚动位置被浏览器压回顶部。
14
+ if (!refresh) fill(panel, box);
14
15
  let mem;
15
16
  try {
16
17
  mem = await api("/api/account/memory");
17
18
  } catch (err) {
18
- fill(box, h("h4", {}, "记忆"), h("div", { class: "error-text" }, err.message));
19
+ if (refresh) toast(err.message);
20
+ else fill(box, h("h4", {}, "记忆"), h("div", { class: "error-text" }, err.message));
19
21
  return;
20
22
  }
21
- const reload = () => void memoryTab(panel);
23
+ const reload = () => memoryTab(panel, true);
22
24
  const run = (btn, fn) => async () => {
23
25
  btn.disabled = true;
24
26
  try {
25
- if ((await fn()) !== false) reload();
27
+ if ((await fn()) !== false) await reload();
26
28
  } catch (err) {
27
29
  toast(err.message);
30
+ } finally {
28
31
  btn.disabled = false;
29
32
  }
30
33
  };
@@ -116,6 +119,9 @@ export async function memoryTab(panel) {
116
119
  toast("已清空");
117
120
  });
118
121
 
122
+ // 数据都已就绪再替换;保留用户在等待接口期间滚动到的位置。
123
+ const scroller = panel.closest(".settings-body");
124
+ const scrollTop = scroller?.scrollTop ?? 0;
119
125
  fill(
120
126
  panel,
121
127
  h(
@@ -161,6 +167,7 @@ export async function memoryTab(panel) {
161
167
  h("div", { class: "row" }, clearBtn),
162
168
  ),
163
169
  );
170
+ if (scroller) scroller.scrollTop = scrollTop;
164
171
  }
165
172
 
166
173
  /** 记忆页里的「整理记忆」:什么时候整理、用哪个 agent 的哪个模型、现在整理、上次的结果 */
@@ -29,7 +29,7 @@ const FREQS = [
29
29
  ["once", "一次"],
30
30
  ["daily", "每天"],
31
31
  ["weekdays", "工作日(周一到周五)"],
32
- ["weekly", "每周(可多选)"],
32
+ ["weekly", "每周"],
33
33
  ["monthly", "每月"],
34
34
  ["hourly", "每隔几小时"],
35
35
  ["cron", "自定义(cron)"],
@@ -293,7 +293,7 @@ export function openTaskForm(task, preset) {
293
293
  const freq = h("select", {}, FREQS.map(([v, label]) => h("option", { value: v, selected: v === sch.kind }, label)));
294
294
  const freqBox = h("div", { class: "task-freq" });
295
295
  const timeInput = () => {
296
- const el = h("input", { type: "time", value: sch.time, required: true });
296
+ const el = h("input", { type: "time", value: sch.time, required: true, "aria-label": "执行时刻" });
297
297
  el.oninput = () => (sch.time = el.value);
298
298
  return el;
299
299
  };
@@ -308,21 +308,24 @@ export function openTaskForm(task, preset) {
308
308
  parts.push(
309
309
  h(
310
310
  "div",
311
- { class: "day-chips", role: "group", "aria-label": "执行星期(可多选)" },
312
- WEEK_ORDER.map((d) => {
313
- const b = h("button", { type: "button", class: `day-chip${sch.days.includes(d) ? " on" : ""}`, "aria-pressed": String(sch.days.includes(d)) }, `周${WEEK_NAME[d]}`);
314
- b.onclick = () => {
315
- sch.days = sch.days.includes(d) ? sch.days.filter((x) => x !== d) : [...sch.days, d];
316
- // 改了预设的星期,就按自选的每周计划保存。
317
- sch.kind = freq.value = "weekly";
318
- b.classList.toggle("on", sch.days.includes(d));
319
- b.setAttribute("aria-pressed", String(sch.days.includes(d)));
320
- };
321
- return b;
322
- }),
311
+ { class: "task-weekly-controls" },
312
+ h("div", { class: "task-weekly-heading" }, h("span", {}, "重复日期"), h("span", { class: "task-weekly-hint" }, "可多选")),
313
+ h(
314
+ "div",
315
+ { class: "task-weekdays", role: "group", "aria-label": "执行星期(可多选)" },
316
+ WEEK_ORDER.map((d) => {
317
+ const b = h("button", { type: "button", class: "task-weekday", "aria-pressed": String(sch.days.includes(d)) }, `周${WEEK_NAME[d]}`);
318
+ b.onclick = () => {
319
+ sch.days = sch.days.includes(d) ? sch.days.filter((x) => x !== d) : [...sch.days, d];
320
+ // 改了预设的星期,就按自选的每周计划保存。
321
+ sch.kind = freq.value = "weekly";
322
+ b.setAttribute("aria-pressed", String(sch.days.includes(d)));
323
+ };
324
+ return b;
325
+ }),
326
+ ),
327
+ h("label", { class: "task-clock-row" }, h("span", {}, "执行时刻"), timeInput()),
323
328
  ),
324
- timeInput(),
325
- h("span", { class: "freq-word" }, "在选中的星期执行,可多选"),
326
329
  );
327
330
  } else if (sch.kind === "monthly") {
328
331
  const day = h("input", { type: "number", min: "1", max: "31", value: String(sch.day), class: "narrow" });