agent-loft 0.2.31 → 0.2.32
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 +8 -3
- package/package.json +1 -1
- package/src/agents/claude/driver.ts +10 -6
- package/src/agents/claude/session.ts +30 -5
- package/src/agents/codex/session.ts +27 -6
- package/src/channels/web/api.ts +4 -0
- package/src/channels/web/http.ts +2 -2
- package/src/channels/web/server.ts +8 -0
- package/src/channels/web/skills-api.ts +225 -0
- package/src/core/chat-mode.ts +3 -3
- package/src/core/command-catalog.ts +8 -1
- package/src/core/commands.ts +3 -0
- package/src/core/hub.ts +54 -5
- package/src/core/personal.ts +3 -1
- package/src/core/skill-runtime.ts +359 -0
- package/src/core/skills-bridge.ts +288 -0
- package/src/core/skills.ts +675 -0
- package/src/core/tasks-bridge.ts +5 -1
- package/src/core/tasks-mcp.ts +11 -0
- package/src/core/types.ts +20 -1
- package/src/core/zip.ts +98 -0
- package/src/main.ts +4 -0
- package/src/mcp/tasks-server.ts +125 -4
- package/web/css/skills.css +368 -0
- package/web/index.html +1 -0
- package/web/lib/dom.js +1 -0
- package/web/lib/ws.js +4 -0
- package/web/state.js +1 -1
- package/web/views/composer.js +15 -3
- package/web/views/layout.js +10 -0
- package/web/views/mention.js +193 -0
- package/web/views/messages.js +2 -2
- package/web/views/sidebar.js +1 -0
- package/web/views/skills.js +703 -0
- package/web/views/tasks.js +11 -2
- package/web/views/topbar.js +3 -3
package/web/views/tasks.js
CHANGED
|
@@ -8,6 +8,7 @@ import { agentLabel, closeSide, renderSidebar } from "./sidebar.js";
|
|
|
8
8
|
import { baseName, renderTopbar, usableAgents } from "./topbar.js";
|
|
9
9
|
import { openConversation } from "./messages.js";
|
|
10
10
|
import { changeCwd } from "./conv-actions.js";
|
|
11
|
+
import { attachMention } from "./mention.js";
|
|
11
12
|
|
|
12
13
|
// ---------- 定时任务页 ----------
|
|
13
14
|
// 到点让 agent 按提示词干活,结果回到一条对话里;「有需要才提醒」时由 agent 判断这次要不要打扰你。
|
|
@@ -281,8 +282,16 @@ export function openTaskForm(task, preset) {
|
|
|
281
282
|
const src = task ?? preset ?? {};
|
|
282
283
|
const agents = usableAgents();
|
|
283
284
|
const title = h("input", { value: src.title ?? "", maxlength: "60", placeholder: "比如:检查 agent-loft 更新" });
|
|
284
|
-
const prompt = h("textarea", { rows: 5, maxlength: "4000", placeholder: "到点让 agent
|
|
285
|
+
const prompt = h("textarea", { rows: 5, maxlength: "4000", placeholder: "到点让 agent 做什么。写成完整的指令:那时你多半不在,它没法再问你。可以用 @ 指定技能。" });
|
|
285
286
|
prompt.value = src.prompt ?? "";
|
|
287
|
+
// @ 技能:和输入框一样,到点时服务端认提示词里的 @name
|
|
288
|
+
const mentionMenu = h("div", { class: "slash-menu below", hidden: true });
|
|
289
|
+
const mention = attachMention(prompt, mentionMenu);
|
|
290
|
+
prompt.addEventListener("input", () => void mention.update());
|
|
291
|
+
prompt.addEventListener("blur", () => setTimeout(mention.close, 150));
|
|
292
|
+
prompt.addEventListener("keydown", (e) => {
|
|
293
|
+
if (mention.keydown(e)) e.preventDefault();
|
|
294
|
+
});
|
|
286
295
|
|
|
287
296
|
// ---- 频率 ----
|
|
288
297
|
const sch = { kind: "daily", time: "09:00", days: [1], day: 1, every: 2, minute: 0, expr: "0 9 * * *", at: Date.now() + 3600_000, ...(src.schedule ?? {}) };
|
|
@@ -405,7 +414,7 @@ export function openTaskForm(task, preset) {
|
|
|
405
414
|
"div",
|
|
406
415
|
{ class: "modal-body task-form" },
|
|
407
416
|
field("名称", title),
|
|
408
|
-
field("要做的事", prompt, "
|
|
417
|
+
field("要做的事", h("div", { class: "mention-wrap" }, prompt, mentionMenu), "需要对比的写清楚怎么判断,比如「和上次的结果比」「版本号比当前的新才算更新」。输入 @ 可以指定这次要用的技能。"),
|
|
409
418
|
field("频率", h("div", { class: "task-freq-row" }, freq, freqBox), freqHint),
|
|
410
419
|
field("提醒", notify),
|
|
411
420
|
target ? field("结果发到", target) : field("结果发到", h("div", { class: "task-static" }, task?.convKey ? `专用对话「${task.convTitle || "对话"}」` : "专用对话(第一次运行时新建,之后都发到这条)")),
|
package/web/views/topbar.js
CHANGED
|
@@ -12,14 +12,14 @@ import { changeCwd, deleteConv, doAction, forkConversation, openModelPicker, ren
|
|
|
12
12
|
|
|
13
13
|
export function renderTopbar() {
|
|
14
14
|
const c = S.current ? S.convs.get(S.current) : null;
|
|
15
|
-
//
|
|
16
|
-
const tasks = S.view === "tasks";
|
|
15
|
+
// 定时任务页、技能页:只有标题,模式切换、「更多」都是对话用的
|
|
16
|
+
const tasks = S.view === "tasks" || S.view === "skills";
|
|
17
17
|
fill(ui.topbar,
|
|
18
18
|
h("button", { class: "icon-btn menu-btn", onclick: openSide, title: "会话列表" }, icon("menu")),
|
|
19
19
|
h(
|
|
20
20
|
"div",
|
|
21
21
|
{ class: "top-title" },
|
|
22
|
-
tasks ? h("span", { class: "conv-name" }, "定时任务") : c ? h("span", { class: "conv-name", title: convTitle(c) }, convTitle(c)) : null,
|
|
22
|
+
tasks ? h("span", { class: "conv-name" }, S.view === "skills" ? "技能" : "定时任务") : c ? h("span", { class: "conv-name", title: convTitle(c) }, convTitle(c)) : null,
|
|
23
23
|
),
|
|
24
24
|
tasks ? null : ui.modeSlot,
|
|
25
25
|
tasks ? null : h("button", { class: "icon-btn top-more", title: "更多", onclick: (e) => openTopMore(e.currentTarget) }, icon("more")),
|