dsh-multigameassistant 2.0.3 → 2.0.4
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/cordis.patch.yml +7 -2
- package/lib/analyzer.js +2 -2
- package/lib/{chunk-AWZ4O7BY.js → chunk-4PNYIZVU.js} +5 -2
- package/lib/{chunk-ZXD4IYZP.js → chunk-IZENRXQ6.js} +1104 -174
- package/lib/{chunk-IH3K4QPN.js → chunk-SA72K6M2.js} +269 -156
- package/lib/{chunk-C6HSCWNE.js → chunk-UOVFYP7C.js} +2 -2
- package/lib/{chunk-OQZ2XZVP.js → chunk-XHP3SLMO.js} +1 -1
- package/lib/emulator.js +1 -1
- package/lib/feishu.js +3 -3
- package/lib/game-intel.js +5 -5
- package/lib/gateway.js +2 -2
- package/lib/guard.js +1 -1
- package/lib/intervene.js +3 -3
- package/lib/low-context.js +100 -0
- package/lib/monitor.js +3 -3
- package/lib/notify.js +3 -3
- package/lib/orchestrator.js +5 -5
- package/lib/qqbot.js +3 -3
- package/lib/runner.js +3 -3
- package/lib/scheduler.js +1 -1
- package/lib/script-registry.js +5 -5
- package/package.json +2 -1
- package/web/assets/index-BqeCz6LB.css +1 -0
- package/web/assets/index-CCaVm9ks.js +242 -0
- package/web/assets/index-CCaVm9ks.js.map +1 -0
- package/web/index.html +2 -2
- package/web/assets/index-BVPmzXp6.js +0 -241
- package/web/assets/index-BVPmzXp6.js.map +0 -1
- package/web/assets/index-Dwlpk_7H.css +0 -1
|
@@ -16345,6 +16345,142 @@ var SkillsNotifications = {
|
|
|
16345
16345
|
"skills/changed": external_exports.object({})
|
|
16346
16346
|
};
|
|
16347
16347
|
|
|
16348
|
+
// packages/protocol/lib/handoff-notes.js
|
|
16349
|
+
var BY_YOU = "\u4F60";
|
|
16350
|
+
var QUIET = "\uFF08\u4E0D\u7528\u544A\u8BC9\u7528\u6237\uFF09";
|
|
16351
|
+
var wordsOf = (text) => text.replace(/[^\p{Script=Han}a-zA-Z0-9]/gu, "");
|
|
16352
|
+
function isQuiet(text) {
|
|
16353
|
+
return wordsOf(text) === wordsOf(QUIET);
|
|
16354
|
+
}
|
|
16355
|
+
var RETURNS = "\uFF08\u4F60\u8FD9\u4E00\u8F6E\u7684\u6700\u540E\u4E00\u6BB5\u56DE\u590D\u4F1A\u4F5C\u4E3A\u7ED3\u8BBA\u4EA4\u56DE\u53BB\u3002\u5728\u90A3\u4E4B\u524D\u8981\u8BA9\u5BF9\u65B9\u77E5\u9053\u7684\uFF0C\u7528 agent_message \u7684 update \u8BF4\uFF0C\u9A6C\u4E0A\u9001\u5230\uFF0C\u8BF4\u51E0\u6B21\u90FD\u884C\uFF1B\u4EA4\u56DE\u7ED3\u8BBA\u4EE5\u540E\u8FD8\u6709\u8BDD\uFF0C\u540C\u6837\u53D1\u5230\u8FD9\u6761\u7EBF\u7D22\uFF1A\u4F60\u7684\u666E\u901A\u56DE\u590D\u5BF9\u65B9\u770B\u4E0D\u5230\u3002\uFF09";
|
|
16356
|
+
var RETURNS_BEFORE = "\uFF08\u505A\u5B8C\u540E\u4F60\u8FD9\u4E00\u8F6E\u7684\u6700\u540E\u4E00\u6BB5\u56DE\u590D\u4F1A\u539F\u6837\u4EA4\u56DE\u53BB\uFF1A\u628A\u7ED3\u8BBA\u5199\u5728\u90A3\u91CC\u3002\uFF09";
|
|
16357
|
+
var THREAD_LINE = /^(这件事的线索是 (\S+):做的过程中要问清楚什么,用 agent_message 问,thread 填它;不要猜。)$/;
|
|
16358
|
+
var PAST_HEAD = (who) => `\uFF08\u4F60\u548C${who}\u4E4B\u524D\u7684\u6765\u5F80\uFF0C\u4ECE\u65E7\u5230\u65B0\u3002\u53EF\u80FD\u5DF2\u7ECF\u8FC7\u65F6\uFF1B\u8981\u770B\u5B8C\u6574\u7684\uFF0C\u7528 agent_threads \u5E26 id\uFF1A`;
|
|
16359
|
+
var PAST_LINE = /^(你和.{1,20}之前的来往,/;
|
|
16360
|
+
var PAST_END = "\uFF09";
|
|
16361
|
+
function taskMessage(by, title, body, returns = false, thread, past) {
|
|
16362
|
+
const head = by === BY_YOU ? `\uFF08\u4F60\u5728\u8F6F\u4EF6\u91CC\u70B9\u7684\uFF1A${oneLine(title)}\uFF09` : `\uFF08${by}\u4EA4\u7ED9\u4F60\u7684\u4E8B\uFF1A${oneLine(title)}\uFF09`;
|
|
16363
|
+
const notes = [...returns ? [RETURNS] : [], ...thread === void 0 ? [] : [`\uFF08\u8FD9\u4EF6\u4E8B\u7684\u7EBF\u7D22\u662F ${thread}\uFF1A\u505A\u7684\u8FC7\u7A0B\u4E2D\u8981\u95EE\u6E05\u695A\u4EC0\u4E48\uFF0C\u7528 agent_message \u95EE\uFF0Cthread \u586B\u5B83\uFF1B\u4E0D\u8981\u731C\u3002\uFF09`]];
|
|
16364
|
+
if (past !== void 0 && past.lines.length > 0)
|
|
16365
|
+
notes.push([PAST_HEAD(past.who), ...past.lines, PAST_END].join("\n"));
|
|
16366
|
+
return `${head}
|
|
16367
|
+
${notes.map((n) => `${n}
|
|
16368
|
+
`).join("")}
|
|
16369
|
+
${body}`;
|
|
16370
|
+
}
|
|
16371
|
+
function parseTask(text) {
|
|
16372
|
+
const [first = "", ...rest] = text.split("\n");
|
|
16373
|
+
const mine = /^(你在软件里点的:(.*))$/.exec(first);
|
|
16374
|
+
const theirs = mine === null ? /^(([^():]{1,20})交给你的事:(.*))$/.exec(first) : null;
|
|
16375
|
+
if (mine === null && theirs === null)
|
|
16376
|
+
return void 0;
|
|
16377
|
+
const returns = rest[0] === RETURNS || rest[0] === RETURNS_BEFORE;
|
|
16378
|
+
const after = returns ? rest.slice(1) : rest;
|
|
16379
|
+
const thread = THREAD_LINE.exec(after[0] ?? "")?.[1];
|
|
16380
|
+
const next = thread === void 0 ? after : after.slice(1);
|
|
16381
|
+
const pastEnd = PAST_LINE.test(next[0] ?? "") ? next.indexOf(PAST_END) : -1;
|
|
16382
|
+
return {
|
|
16383
|
+
by: mine !== null ? BY_YOU : theirs[1],
|
|
16384
|
+
title: mine !== null ? mine[1] : theirs[2],
|
|
16385
|
+
returns,
|
|
16386
|
+
...thread === void 0 ? {} : { thread },
|
|
16387
|
+
body: next.slice(pastEnd + 1).join("\n").trim()
|
|
16388
|
+
};
|
|
16389
|
+
}
|
|
16390
|
+
var THREAD_WORDS = { question: "\u95EE\u4F60", answer: "\u56DE\u7B54\u4E86\u4F60", update: "\u544A\u8BC9\u4F60" };
|
|
16391
|
+
function threadTail(kind, thread, reader, closed) {
|
|
16392
|
+
const person = `\u770B\u60C5\u51B5\u544A\u8BC9\u7528\u6237\uFF1A\u6709\u7528\u6237\u8BE5\u77E5\u9053\u7684\uFF0C\u4E00\u4E24\u53E5\u8BDD\u8BF4\u8981\u70B9\uFF1B\u6CA1\u6709\u7684\u8BDD\u6574\u6BB5\u56DE\u590D\u53EA\u5199\u300C${QUIET}\u300D\u3002`;
|
|
16393
|
+
if (closed) {
|
|
16394
|
+
if (kind === "question")
|
|
16395
|
+
return `\uFF08\u8FD9\u4EF6\u4E8B\u5DF2\u7ECF\u4EA4\u56DE\u4E86\uFF0C\u8FD9\u662F\u540E\u9762\u7684\u8BDD\u3002\u8981\u56DE\u7B54\u7684\u8BDD\u7528 agent_message\uFF1Athread \u586B ${thread}\uFF0Ckind \u586B answer\uFF0C\u4F60\u7684\u666E\u901A\u56DE\u590D\u5BF9\u65B9\u770B\u4E0D\u5230\u3002\uFF09`;
|
|
16396
|
+
return reader === "main" ? `\uFF08\u8FD9\u4EF6\u4E8B\u5DF2\u7ECF\u4EA4\u56DE\u4E86\uFF0C\u8FD9\u662F\u540E\u9762\u8865\u7684\u8BDD\uFF0C\u4E0D\u7528\u56DE\u5B83\u3002${person}\uFF09` : "\uFF08\u8FD9\u4EF6\u4E8B\u5DF2\u7ECF\u4EA4\u56DE\u4E86\uFF0C\u8FD9\u662F\u540E\u9762\u8865\u7684\u8BDD\uFF0C\u4E0D\u7528\u56DE\u5B83\u3002\uFF09";
|
|
16397
|
+
}
|
|
16398
|
+
if (kind === "question")
|
|
16399
|
+
return `\uFF08\u5BF9\u65B9\u5728\u7B49\uFF1A\u5148\u56DE\u7B54\u5B83\uFF0C\u518D\u63A5\u7740\u505A\u624B\u4E0A\u7684\u4E8B\u3002\u7528 agent_message \u56DE\u7B54\uFF1Athread \u586B ${thread}\uFF0Ckind \u586B answer\u3002\u4F60\u8FD9\u4E00\u8F6E\u7684\u6700\u540E\u4E00\u6BB5\u56DE\u590D\u4E5F\u7B97\u56DE\u7B54\u3002\u8981\u7B49\u7528\u6237\u51B3\u5B9A\u7684\u8BDD\uFF0C\u5148\u7528 kind: update \u8BF4\u4E00\u58F0\uFF0C\u7B49\u6709\u4E86\u7ED3\u679C\u518D\u56DE\u7B54\u3002\uFF09`;
|
|
16400
|
+
if (kind === "answer" || reader === "worker")
|
|
16401
|
+
return "\uFF08\u63A5\u7740\u505A\u8FD9\u4EF6\u4E8B\u3002\uFF09";
|
|
16402
|
+
return reader === "main" ? `\uFF08\u5B83\u8FD8\u5728\u505A\uFF0C\u8FD9\u662F\u8FC7\u7A0B\u4E2D\u544A\u8BC9\u4F60\u7684\uFF0C\u4E0D\u7528\u56DE\u5B83\u3002${person}\uFF09` : "\uFF08\u5B83\u8FD8\u5728\u505A\uFF0C\u8FD9\u662F\u8FC7\u7A0B\u4E2D\u544A\u8BC9\u4F60\u7684\uFF0C\u4E0D\u7528\u56DE\u5B83\uFF1A\u63A5\u7740\u505A\u4F60\u624B\u4E0A\u7684\u4E8B\u3002\uFF09";
|
|
16403
|
+
}
|
|
16404
|
+
function threadMessage(input) {
|
|
16405
|
+
const head = `\uFF08\u300C${input.from}\u300D\u5728\u7EBF\u7D22 ${input.thread} \u91CC${THREAD_WORDS[input.kind]}\uFF1A${oneLine(input.title)}\uFF09`;
|
|
16406
|
+
return `${head}
|
|
16407
|
+
|
|
16408
|
+
${input.text.trim()}
|
|
16409
|
+
|
|
16410
|
+
${threadTail(input.kind, input.thread, input.reader ?? "worker", input.closed === true)}`;
|
|
16411
|
+
}
|
|
16412
|
+
function parseThreadNote(text) {
|
|
16413
|
+
const [first = "", ...rest] = text.split("\n");
|
|
16414
|
+
const head = /^(「([^」]+)」在线索 (\S+) 里(问你|回答了你|告诉你):(.*))$/.exec(first);
|
|
16415
|
+
if (head === null)
|
|
16416
|
+
return void 0;
|
|
16417
|
+
const body = rest.join("\n").trim();
|
|
16418
|
+
const end = body.lastIndexOf("\n\n\uFF08");
|
|
16419
|
+
return { from: head[1], thread: head[2], kind: head[3] === "\u95EE\u4F60" ? "question" : head[3] === "\u544A\u8BC9\u4F60" ? "update" : "answer", title: head[4], text: (end === -1 ? body : body.slice(0, end)).trim() };
|
|
16420
|
+
}
|
|
16421
|
+
function relayMessage(input) {
|
|
16422
|
+
const head = `\uFF08\u300C${input.agent}\u300D${input.ok ? "\u4EA4\u56DE\u4E86" : "\u6CA1\u6709\u505A\u5B8C"}${input.asker}\u4EA4\u7ED9\u5B83\u7684\u4E8B\uFF1A${oneLine(input.title)}\uFF09`;
|
|
16423
|
+
const tail = input.toLead === true ? input.ok ? "\uFF08\u8FD9\u662F\u4F60\u95EE\u5B83\u7684\u7ED3\u679C\uFF1A\u63A5\u7740\u505A\u4F60\u624B\u4E0A\u7684\u4E8B\uFF0C\u628A\u5B83\u7528\u5230\u4F60\u7684\u7ED3\u8BBA\u91CC\u3002\uFF09" : "\uFF08\u5B83\u6CA1\u505A\u6210\uFF1A\u63A5\u7740\u505A\u4F60\u624B\u4E0A\u7684\u4E8B\uFF0C\u80FD\u7ED5\u8FC7\u53BB\u5C31\u7ED5\u8FC7\u53BB\uFF0C\u7ED5\u4E0D\u8FC7\u53BB\u5C31\u5728\u4F60\u7684\u7ED3\u8BBA\u91CC\u8BF4\u6E05\u695A\u3002\uFF09" : input.ok ? `\uFF08\u770B\u60C5\u51B5\u544A\u8BC9\u7528\u6237\uFF1A\u6709\u7528\u6237\u8BE5\u77E5\u9053\u6216\u8981\u505A\u7684\uFF0C\u7528\u4E00\u4E24\u53E5\u8BDD\u8BF4\u8981\u70B9\uFF0C\u5B8C\u6574\u8FC7\u7A0B\u5728\u300C${input.agent}\u300D\u7684\u5BF9\u8BDD\u91CC\uFF1B\u6CA1\u6709\u7684\u8BDD\u6574\u6BB5\u56DE\u590D\u53EA\u5199\u300C${QUIET}\u300D\u3002\u8FD8\u8981\u522B\u7684 agent \u63A5\u7740\u505A\u7684\uFF0C\u53EF\u4EE5\u518D\u4EA4\u3002\uFF09` : `\uFF08\u544A\u8BC9\u7528\u6237\u54EA\u91CC\u6CA1\u505A\u6210\u3001\u4E3A\u4EC0\u4E48\uFF1B\u9700\u8981\u7684\u8BDD\u6362\u4E2A\u8BF4\u6CD5\u518D\u4EA4\u4E00\u6B21\uFF0C\u6216\u8005\u95EE\u7528\u6237\u3002\uFF09`;
|
|
16424
|
+
const asked = input.consulted !== void 0 && input.consulted.length > 0 ? `
|
|
16425
|
+
|
|
16426
|
+
\uFF08\u505A\u8FD9\u4EF6\u4E8B\u65F6\u5B83\u8FD8\u95EE\u4E86\uFF1A${input.consulted.join("\u3001")}\u3002\uFF09` : "";
|
|
16427
|
+
return `${head}
|
|
16428
|
+
|
|
16429
|
+
${input.reply.trim()}${asked}
|
|
16430
|
+
|
|
16431
|
+
${tail}`;
|
|
16432
|
+
}
|
|
16433
|
+
function threadsBetween(all, a, b) {
|
|
16434
|
+
return all.filter((h) => {
|
|
16435
|
+
const from = h.chain?.at(-2);
|
|
16436
|
+
const to = h.chain?.at(-1);
|
|
16437
|
+
return from === a && to === b || from === b && to === a;
|
|
16438
|
+
});
|
|
16439
|
+
}
|
|
16440
|
+
function parseRelay(text) {
|
|
16441
|
+
const [first = "", ...rest] = text.split("\n");
|
|
16442
|
+
const head = /^(「([^」]+)」(交回了|没有做完)([^()]{1,20}?)交给它的事:(.*))$/.exec(first);
|
|
16443
|
+
if (head === null)
|
|
16444
|
+
return void 0;
|
|
16445
|
+
const body = rest.join("\n").trim();
|
|
16446
|
+
const end = body.lastIndexOf("\n\n\uFF08");
|
|
16447
|
+
return { agent: head[1], ok: head[2] === "\u4EA4\u56DE\u4E86", asker: head[3], title: head[4], reply: (end === -1 ? body : body.slice(0, end)).trim() };
|
|
16448
|
+
}
|
|
16449
|
+
function oneLine(text) {
|
|
16450
|
+
return text.replace(/\s+/g, " ").replace(/[()]/g, (m) => m === "\uFF08" ? "(" : ")").trim();
|
|
16451
|
+
}
|
|
16452
|
+
var REMINDER_NOTE = /\n\n(这是你在线索 \S+ 上定的提醒:[^)]*)$/;
|
|
16453
|
+
function threadReminder(prompt, thread, by) {
|
|
16454
|
+
return `${prompt}
|
|
16455
|
+
|
|
16456
|
+
\uFF08\u8FD9\u662F\u4F60\u5728\u7EBF\u7D22 ${thread} \u4E0A\u5B9A\u7684\u63D0\u9192\uFF1A\u8981\u8BA9${by}\u77E5\u9053\u7684\uFF0C\u5230\u70B9\u540E\u7528 agent_message \u53D1\u7ED9\u5B83\uFF0Cthread \u586B ${thread}\uFF0Ckind \u586B update\uFF1B\u4F60\u7684\u666E\u901A\u56DE\u590D\u5B83\u770B\u4E0D\u5230\u3002\uFF09`;
|
|
16457
|
+
}
|
|
16458
|
+
function reminderPrompts(text) {
|
|
16459
|
+
const single = /^\[SCHEDULE REMINDER\]\n[\s\S]*?^reminder_prompt_json: (.*)$/m.exec(text);
|
|
16460
|
+
if (single !== null)
|
|
16461
|
+
return [jsonString(single[1]).replace(REMINDER_NOTE, "")];
|
|
16462
|
+
const batch = /^\[SCHEDULE REMINDER BATCH\]\n[\s\S]*?^reminders_json: (.*)$/m.exec(text);
|
|
16463
|
+
if (batch === null)
|
|
16464
|
+
return void 0;
|
|
16465
|
+
try {
|
|
16466
|
+
const items = JSON.parse(batch[1]);
|
|
16467
|
+
return items.map((item) => String(item.reminder_prompt ?? "").replace(REMINDER_NOTE, "")).filter((p) => p !== "");
|
|
16468
|
+
} catch {
|
|
16469
|
+
return [];
|
|
16470
|
+
}
|
|
16471
|
+
}
|
|
16472
|
+
function reminderLine(prompts) {
|
|
16473
|
+
return prompts.length === 0 ? "\u5B9A\u65F6\u63D0\u9192" : `\u5B9A\u65F6\u63D0\u9192\uFF1A${prompts.map((p) => oneLine(p)).join("\uFF1B")}`;
|
|
16474
|
+
}
|
|
16475
|
+
function jsonString(json2) {
|
|
16476
|
+
try {
|
|
16477
|
+
const value = JSON.parse(json2);
|
|
16478
|
+
return typeof value === "string" ? value : json2;
|
|
16479
|
+
} catch {
|
|
16480
|
+
return json2;
|
|
16481
|
+
}
|
|
16482
|
+
}
|
|
16483
|
+
|
|
16348
16484
|
// packages/protocol/lib/persona.js
|
|
16349
16485
|
var PERSONA_CAPABILITY = "persona";
|
|
16350
16486
|
var PersonaStyle = external_exports.enum(["default", "concise", "patient", "lively", "buddy", "butler"]);
|
|
@@ -16371,6 +16507,34 @@ var PersonaAnswer = PersonaSettings.extend({
|
|
|
16371
16507
|
/** The same, as it is for each agent, by id. */
|
|
16372
16508
|
prompts: external_exports.record(external_exports.string(), external_exports.string())
|
|
16373
16509
|
});
|
|
16510
|
+
var STYLE_TEXT = {
|
|
16511
|
+
default: "",
|
|
16512
|
+
concise: "\u56DE\u7B54\u7B80\u77ED\u76F4\u63A5\uFF1A\u5148\u7ED9\u7ED3\u8BBA\uFF0C\u518D\u7ED9\u5FC5\u8981\u7684\u7EC6\u8282\uFF1B\u5C11\u5BD2\u6684\uFF0C\u4E0D\u7528\u8868\u60C5\u3002",
|
|
16513
|
+
patient: "\u8010\u5FC3\u3001\u8BB2\u6E05\u695A\uFF1A\u6BCF\u4E00\u6B65\u8BF4\u660E\u4E3A\u4EC0\u4E48\u8FD9\u4E48\u505A\uFF0C\u7528\u5BF9\u65B9\u542C\u5F97\u61C2\u7684\u8BDD\uFF0C\u50CF\u6559\u4E00\u4E2A\u521A\u63A5\u89E6\u7684\u4EBA\u3002",
|
|
16514
|
+
lively: "\u8BED\u6C14\u8F7B\u677E\u6D3B\u6CFC\uFF0C\u53EF\u4EE5\u7528\u4E00\u70B9\u8BED\u6C14\u8BCD\u548C\u8868\u60C5\uFF0C\u4F46\u4FE1\u606F\u8981\u51C6\u786E\u3001\u4E0D\u5570\u55E6\u3002",
|
|
16515
|
+
buddy: "\u50CF\u4E00\u8D77\u73A9\u6E38\u620F\u7684\u8001\u670B\u53CB\u90A3\u6837\u8BF4\u8BDD\uFF1A\u719F\u6089\u6E38\u620F\u91CC\u7684\u8BF4\u6CD5\uFF0C\u53EF\u4EE5\u9002\u5F53\u5410\u69FD\u548C\u9F13\u52B1\uFF0C\u4F46\u4E0D\u5938\u5F20\u3001\u4E0D\u6CB9\u817B\u3002",
|
|
16516
|
+
butler: "\u50CF\u4E00\u4F4D\u7A33\u91CD\u5468\u5230\u7684\u7BA1\u5BB6\uFF1A\u793C\u8C8C\u3001\u6761\u7406\u6E05\u695A\uFF0C\u4E3B\u52A8\u6C47\u62A5\u8FDB\u5EA6\u548C\u9700\u8981\u5BF9\u65B9\u51B3\u5B9A\u7684\u4E8B\u3002"
|
|
16517
|
+
};
|
|
16518
|
+
function personaOf(settings, agentId) {
|
|
16519
|
+
const own = Object.entries(settings.agents[agentId] ?? {}).filter(([, value]) => value !== void 0);
|
|
16520
|
+
return { ...settings.persona, ...Object.fromEntries(own) };
|
|
16521
|
+
}
|
|
16522
|
+
function personaPrompt(p) {
|
|
16523
|
+
const lines = [];
|
|
16524
|
+
if (p.name !== void 0 && p.name.trim() !== "")
|
|
16525
|
+
lines.push(`\u4F60\u7684\u540D\u5B57\u662F\u300C${p.name.trim()}\u300D\uFF0C\u81EA\u79F0\u65F6\u7528\u8FD9\u4E2A\u540D\u5B57\u3002`);
|
|
16526
|
+
if (p.callUser !== void 0 && p.callUser.trim() !== "")
|
|
16527
|
+
lines.push(`\u79F0\u547C\u7528\u6237\u4E3A\u300C${p.callUser.trim()}\u300D\u3002`);
|
|
16528
|
+
if (STYLE_TEXT[p.style] !== "")
|
|
16529
|
+
lines.push(STYLE_TEXT[p.style]);
|
|
16530
|
+
if (p.custom !== void 0 && p.custom.trim() !== "")
|
|
16531
|
+
lines.push(`\u7528\u6237\u5BF9\u4F60\u8BF4\u8BDD\u65B9\u5F0F\u7684\u8981\u6C42\uFF1A${p.custom.trim()}`);
|
|
16532
|
+
if (lines.length === 0)
|
|
16533
|
+
return "";
|
|
16534
|
+
lines.push(p.peerStyle === "same" ? "\u548C\u5176\u4ED6 agent \u8BF4\u8BDD\u65F6\u4E5F\u7528\u8FD9\u4E2A\u65B9\u5F0F\u3002" : "\u4E0A\u9762\u662F\u5BF9\u7528\u6237\u8BF4\u8BDD\u7684\u65B9\u5F0F\u3002\u548C\u5176\u4ED6 agent \u8BF4\u8BDD\uFF08agent_delegate\u3001agent_message\u3001\u4EA4\u56DE\u53BB\u7684\u7ED3\u8BBA\uFF09\u7528\u5E73\u5B9E\u7684\u8BDD\uFF0C\u76F4\u63A5\u8BF4\u4E8B\uFF0C\u4E0D\u7528\u4EBA\u8BBE\u548C\u79F0\u547C\uFF1A\u5B83\u4EEC\u8981\u8BFB\u7684\u662F\u5185\u5BB9\u3002");
|
|
16535
|
+
lines.push(`\u8F6F\u4EF6\u7EA6\u5B9A\u7684\u56FA\u5B9A\u5199\u6CD5\uFF08\u6BD4\u5982\u300C${QUIET}\u300D\u8FD9\u4E00\u53E5\u3001\u7EBF\u7D22\u7F16\u53F7\u3001\u5DE5\u5177\u7684\u53C2\u6570\uFF09\u4E00\u5B57\u4E0D\u5DEE\u7167\u5199\uFF0C\u4E0D\u52A0\u8BED\u6C14\u8BCD\u548C\u8868\u60C5\u3002`);
|
|
16536
|
+
return ["# \u56DE\u590D\u98CE\u683C", ...lines, "\u8FD9\u4E9B\u53EA\u5F71\u54CD\u4F60\u8BF4\u8BDD\u7684\u65B9\u5F0F\uFF0C\u4E0D\u6539\u53D8\u505A\u4E8B\u7684\u89C4\u5219\uFF1A\u786E\u8BA4\u3001\u5B89\u5168\u9650\u5236\u548C\u4E0D\u80FD\u505A\u7684\u4E8B\u90FD\u7167\u65E7\uFF1B\u5728\u98DE\u4E66\u91CC\u56DE\u590D\u4E5F\u4E00\u6837\u3002"].join("\n");
|
|
16537
|
+
}
|
|
16374
16538
|
var PersonaRequests = {
|
|
16375
16539
|
"persona/get": {
|
|
16376
16540
|
capability: PERSONA_CAPABILITY,
|
|
@@ -16387,13 +16551,16 @@ var PersonaRequests = {
|
|
|
16387
16551
|
// packages/protocol/lib/compaction.js
|
|
16388
16552
|
var COMPACTION_CAPABILITY = "compaction";
|
|
16389
16553
|
var DEFAULT_COMPACTION_THRESHOLD = 80;
|
|
16390
|
-
var MIN_COMPACTION_THRESHOLD =
|
|
16391
|
-
var MAX_COMPACTION_THRESHOLD =
|
|
16554
|
+
var MIN_COMPACTION_THRESHOLD = 5;
|
|
16555
|
+
var MAX_COMPACTION_THRESHOLD = 100;
|
|
16556
|
+
var LOW_CONTEXT_WINDOW_MS = 12 * 60 * 6e4;
|
|
16392
16557
|
var CompactionSettings = external_exports.object({
|
|
16393
16558
|
/** Compact by itself when the conversation is long; off: a too-long conversation fails until compacted by hand. */
|
|
16394
16559
|
auto: external_exports.boolean(),
|
|
16395
16560
|
/** How full the context window gets before compacting, in percent. */
|
|
16396
|
-
threshold: external_exports.number().int().min(MIN_COMPACTION_THRESHOLD).max(MAX_COMPACTION_THRESHOLD)
|
|
16561
|
+
threshold: external_exports.number().int().min(MIN_COMPACTION_THRESHOLD).max(MAX_COMPACTION_THRESHOLD),
|
|
16562
|
+
/** Low-context mode: keep only the last 12 hours and the summary in the context. */
|
|
16563
|
+
lowContext: external_exports.boolean()
|
|
16397
16564
|
});
|
|
16398
16565
|
var State = external_exports.object({ settings: CompactionSettings, applied: CompactionSettings });
|
|
16399
16566
|
var CompactionRequests = {
|
|
@@ -16409,6 +16576,68 @@ var CompactionRequests = {
|
|
|
16409
16576
|
}
|
|
16410
16577
|
};
|
|
16411
16578
|
|
|
16579
|
+
// packages/protocol/lib/memory.js
|
|
16580
|
+
var MEMORY_CAPABILITY = "memory";
|
|
16581
|
+
var SHARED_MEMORY = "shared";
|
|
16582
|
+
var MemoryKind = external_exports.enum(["profile", "journal"]);
|
|
16583
|
+
var MAX_MEMORY_TEXT = 600;
|
|
16584
|
+
var MemoryEntry = external_exports.object({
|
|
16585
|
+
id: external_exports.string(),
|
|
16586
|
+
kind: MemoryKind,
|
|
16587
|
+
/** `shared`, or the id of the agent whose own it is. */
|
|
16588
|
+
scope: external_exports.string(),
|
|
16589
|
+
text: external_exports.string(),
|
|
16590
|
+
/** ISO time it was written, and last changed. */
|
|
16591
|
+
createdAt: external_exports.string(),
|
|
16592
|
+
updatedAt: external_exports.string(),
|
|
16593
|
+
/** Who wrote it: an agent id, `user` (设置 → 记忆), or `auto` (read back from a conversation). */
|
|
16594
|
+
by: external_exports.string()
|
|
16595
|
+
});
|
|
16596
|
+
var MemoryAutoSettings = external_exports.object({
|
|
16597
|
+
auto: external_exports.boolean(),
|
|
16598
|
+
/** Same shape as ModelSelection (methods.ts), which imports this file. */
|
|
16599
|
+
model: external_exports.object({ provider: external_exports.string(), model: external_exports.string(), reasoningEffort: external_exports.string().optional() }).nullable()
|
|
16600
|
+
});
|
|
16601
|
+
var MemoryText = external_exports.string().trim().min(1).max(MAX_MEMORY_TEXT);
|
|
16602
|
+
var MemoryRequests = {
|
|
16603
|
+
"memory/list": {
|
|
16604
|
+
capability: MEMORY_CAPABILITY,
|
|
16605
|
+
params: external_exports.object({}),
|
|
16606
|
+
/** Newest first. */
|
|
16607
|
+
result: external_exports.object({ items: external_exports.array(MemoryEntry) })
|
|
16608
|
+
},
|
|
16609
|
+
"memory/add": {
|
|
16610
|
+
capability: MEMORY_CAPABILITY,
|
|
16611
|
+
params: external_exports.object({ kind: MemoryKind, scope: external_exports.string().min(1).max(64), text: MemoryText }),
|
|
16612
|
+
result: external_exports.object({ item: MemoryEntry })
|
|
16613
|
+
},
|
|
16614
|
+
"memory/update": {
|
|
16615
|
+
capability: MEMORY_CAPABILITY,
|
|
16616
|
+
params: external_exports.object({ id: external_exports.string(), text: MemoryText, kind: MemoryKind.optional(), scope: external_exports.string().min(1).max(64).optional() }),
|
|
16617
|
+
result: external_exports.object({ item: MemoryEntry })
|
|
16618
|
+
},
|
|
16619
|
+
"memory/auto/get": {
|
|
16620
|
+
capability: MEMORY_CAPABILITY,
|
|
16621
|
+
params: external_exports.object({}),
|
|
16622
|
+
/** `forced`: on whatever `auto` says, because low-context mode is on (compaction.ts). */
|
|
16623
|
+
result: MemoryAutoSettings.extend({ forced: external_exports.boolean().optional() })
|
|
16624
|
+
},
|
|
16625
|
+
"memory/auto/set": {
|
|
16626
|
+
capability: MEMORY_CAPABILITY,
|
|
16627
|
+
params: MemoryAutoSettings,
|
|
16628
|
+
result: MemoryAutoSettings
|
|
16629
|
+
},
|
|
16630
|
+
"memory/remove": {
|
|
16631
|
+
capability: MEMORY_CAPABILITY,
|
|
16632
|
+
params: external_exports.object({ id: external_exports.string() }),
|
|
16633
|
+
result: external_exports.object({ removed: external_exports.boolean() })
|
|
16634
|
+
}
|
|
16635
|
+
};
|
|
16636
|
+
var MemoryNotifications = {
|
|
16637
|
+
/** An entry was written, changed or forgotten; re-read `memory/list`. */
|
|
16638
|
+
"memory/changed": external_exports.object({})
|
|
16639
|
+
};
|
|
16640
|
+
|
|
16412
16641
|
// packages/protocol/lib/runs.js
|
|
16413
16642
|
var RUNS_CAPABILITY = "runs";
|
|
16414
16643
|
var RunState = external_exports.enum(["starting", "running", "stopping", "succeeded", "failed", "cancelled"]);
|
|
@@ -17141,6 +17370,16 @@ var PromptImage = external_exports.object({
|
|
|
17141
17370
|
data: external_exports.string().min(1).max(MAX_IMAGE_BASE64).regex(/^[A-Za-z0-9+/]+={0,2}$/, "base64 without a data: prefix"),
|
|
17142
17371
|
name: external_exports.string().max(200).optional()
|
|
17143
17372
|
});
|
|
17373
|
+
var ReleaseNote = external_exports.object({
|
|
17374
|
+
version: external_exports.string(),
|
|
17375
|
+
/** The release's own title, when it has one. */
|
|
17376
|
+
title: external_exports.string().optional(),
|
|
17377
|
+
publishedAt: external_exports.string().optional(),
|
|
17378
|
+
/** Its page on GitHub. */
|
|
17379
|
+
url: external_exports.string(),
|
|
17380
|
+
/** Markdown. */
|
|
17381
|
+
body: external_exports.string()
|
|
17382
|
+
});
|
|
17144
17383
|
var Empty2 = external_exports.object({});
|
|
17145
17384
|
var Accepted = external_exports.object({ accepted: external_exports.literal(true) });
|
|
17146
17385
|
var Requests = {
|
|
@@ -17389,14 +17628,15 @@ var Requests = {
|
|
|
17389
17628
|
/**
|
|
17390
17629
|
* The plugin package's newest release on GitHub, if newer than this one (a pre-release only for a
|
|
17391
17630
|
* pre-release). `onNpm`: npm already serves it under the plugin's name (a release is live there only
|
|
17392
|
-
* once approved); undefined when npm could not be asked.
|
|
17631
|
+
* once approved); undefined when npm could not be asked. `notes`: what each release from this one up
|
|
17632
|
+
* to it brings (its GitHub Release text), newest first. Only the plugin package checks here.
|
|
17393
17633
|
*/
|
|
17394
17634
|
"about/checkUpdate": {
|
|
17395
17635
|
capability: "about",
|
|
17396
17636
|
params: Empty2,
|
|
17397
17637
|
result: external_exports.object({
|
|
17398
17638
|
current: external_exports.string(),
|
|
17399
|
-
latest: external_exports.object({ version: external_exports.string(), prerelease: external_exports.boolean(), notesUrl: external_exports.string(), onNpm: external_exports.boolean().optional() }).optional(),
|
|
17639
|
+
latest: external_exports.object({ version: external_exports.string(), prerelease: external_exports.boolean(), notesUrl: external_exports.string(), onNpm: external_exports.boolean().optional(), notes: external_exports.array(ReleaseNote).optional() }).optional(),
|
|
17400
17640
|
checkedAt: external_exports.number()
|
|
17401
17641
|
})
|
|
17402
17642
|
},
|
|
@@ -17477,7 +17717,8 @@ var Requests = {
|
|
|
17477
17717
|
...SkillsRequests,
|
|
17478
17718
|
...SkillHubRequests,
|
|
17479
17719
|
...PersonaRequests,
|
|
17480
|
-
...CompactionRequests
|
|
17720
|
+
...CompactionRequests,
|
|
17721
|
+
...MemoryRequests
|
|
17481
17722
|
};
|
|
17482
17723
|
var SessionsChanged = external_exports.discriminatedUnion("kind", [
|
|
17483
17724
|
external_exports.object({ kind: external_exports.literal("upsert"), item: SessionItem.partial().extend({ id: external_exports.string() }) }),
|
|
@@ -17533,7 +17774,8 @@ var Notifications = {
|
|
|
17533
17774
|
...GamesNotifications,
|
|
17534
17775
|
...PermissionsNotifications,
|
|
17535
17776
|
...QuestionsNotifications,
|
|
17536
|
-
...InstancesNotifications
|
|
17777
|
+
...InstancesNotifications,
|
|
17778
|
+
...MemoryNotifications
|
|
17537
17779
|
};
|
|
17538
17780
|
var ErrorCode = {
|
|
17539
17781
|
ParseError: -32700,
|
|
@@ -17574,142 +17816,6 @@ function classify(value) {
|
|
|
17574
17816
|
return "invalid";
|
|
17575
17817
|
}
|
|
17576
17818
|
|
|
17577
|
-
// packages/protocol/lib/handoff-notes.js
|
|
17578
|
-
var BY_YOU = "\u4F60";
|
|
17579
|
-
var QUIET = "\uFF08\u4E0D\u7528\u544A\u8BC9\u7528\u6237\uFF09";
|
|
17580
|
-
var wordsOf = (text) => text.replace(/[^\p{Script=Han}a-zA-Z0-9]/gu, "");
|
|
17581
|
-
function isQuiet(text) {
|
|
17582
|
-
return wordsOf(text) === wordsOf(QUIET);
|
|
17583
|
-
}
|
|
17584
|
-
var RETURNS = "\uFF08\u4F60\u8FD9\u4E00\u8F6E\u7684\u6700\u540E\u4E00\u6BB5\u56DE\u590D\u4F1A\u4F5C\u4E3A\u7ED3\u8BBA\u4EA4\u56DE\u53BB\u3002\u5728\u90A3\u4E4B\u524D\u8981\u8BA9\u5BF9\u65B9\u77E5\u9053\u7684\uFF0C\u7528 agent_message \u7684 update \u8BF4\uFF0C\u9A6C\u4E0A\u9001\u5230\uFF0C\u8BF4\u51E0\u6B21\u90FD\u884C\uFF1B\u4EA4\u56DE\u7ED3\u8BBA\u4EE5\u540E\u8FD8\u6709\u8BDD\uFF0C\u540C\u6837\u53D1\u5230\u8FD9\u6761\u7EBF\u7D22\uFF1A\u4F60\u7684\u666E\u901A\u56DE\u590D\u5BF9\u65B9\u770B\u4E0D\u5230\u3002\uFF09";
|
|
17585
|
-
var RETURNS_BEFORE = "\uFF08\u505A\u5B8C\u540E\u4F60\u8FD9\u4E00\u8F6E\u7684\u6700\u540E\u4E00\u6BB5\u56DE\u590D\u4F1A\u539F\u6837\u4EA4\u56DE\u53BB\uFF1A\u628A\u7ED3\u8BBA\u5199\u5728\u90A3\u91CC\u3002\uFF09";
|
|
17586
|
-
var THREAD_LINE = /^(这件事的线索是 (\S+):做的过程中要问清楚什么,用 agent_message 问,thread 填它;不要猜。)$/;
|
|
17587
|
-
var PAST_HEAD = (who) => `\uFF08\u4F60\u548C${who}\u4E4B\u524D\u7684\u6765\u5F80\uFF0C\u4ECE\u65E7\u5230\u65B0\u3002\u53EF\u80FD\u5DF2\u7ECF\u8FC7\u65F6\uFF1B\u8981\u770B\u5B8C\u6574\u7684\uFF0C\u7528 agent_threads \u5E26 id\uFF1A`;
|
|
17588
|
-
var PAST_LINE = /^(你和.{1,20}之前的来往,/;
|
|
17589
|
-
var PAST_END = "\uFF09";
|
|
17590
|
-
function taskMessage(by, title, body, returns = false, thread, past) {
|
|
17591
|
-
const head = by === BY_YOU ? `\uFF08\u4F60\u5728\u8F6F\u4EF6\u91CC\u70B9\u7684\uFF1A${oneLine(title)}\uFF09` : `\uFF08${by}\u4EA4\u7ED9\u4F60\u7684\u4E8B\uFF1A${oneLine(title)}\uFF09`;
|
|
17592
|
-
const notes = [...returns ? [RETURNS] : [], ...thread === void 0 ? [] : [`\uFF08\u8FD9\u4EF6\u4E8B\u7684\u7EBF\u7D22\u662F ${thread}\uFF1A\u505A\u7684\u8FC7\u7A0B\u4E2D\u8981\u95EE\u6E05\u695A\u4EC0\u4E48\uFF0C\u7528 agent_message \u95EE\uFF0Cthread \u586B\u5B83\uFF1B\u4E0D\u8981\u731C\u3002\uFF09`]];
|
|
17593
|
-
if (past !== void 0 && past.lines.length > 0)
|
|
17594
|
-
notes.push([PAST_HEAD(past.who), ...past.lines, PAST_END].join("\n"));
|
|
17595
|
-
return `${head}
|
|
17596
|
-
${notes.map((n) => `${n}
|
|
17597
|
-
`).join("")}
|
|
17598
|
-
${body}`;
|
|
17599
|
-
}
|
|
17600
|
-
function parseTask(text) {
|
|
17601
|
-
const [first = "", ...rest] = text.split("\n");
|
|
17602
|
-
const mine = /^(你在软件里点的:(.*))$/.exec(first);
|
|
17603
|
-
const theirs = mine === null ? /^(([^():]{1,20})交给你的事:(.*))$/.exec(first) : null;
|
|
17604
|
-
if (mine === null && theirs === null)
|
|
17605
|
-
return void 0;
|
|
17606
|
-
const returns = rest[0] === RETURNS || rest[0] === RETURNS_BEFORE;
|
|
17607
|
-
const after = returns ? rest.slice(1) : rest;
|
|
17608
|
-
const thread = THREAD_LINE.exec(after[0] ?? "")?.[1];
|
|
17609
|
-
const next = thread === void 0 ? after : after.slice(1);
|
|
17610
|
-
const pastEnd = PAST_LINE.test(next[0] ?? "") ? next.indexOf(PAST_END) : -1;
|
|
17611
|
-
return {
|
|
17612
|
-
by: mine !== null ? BY_YOU : theirs[1],
|
|
17613
|
-
title: mine !== null ? mine[1] : theirs[2],
|
|
17614
|
-
returns,
|
|
17615
|
-
...thread === void 0 ? {} : { thread },
|
|
17616
|
-
body: next.slice(pastEnd + 1).join("\n").trim()
|
|
17617
|
-
};
|
|
17618
|
-
}
|
|
17619
|
-
var THREAD_WORDS = { question: "\u95EE\u4F60", answer: "\u56DE\u7B54\u4E86\u4F60", update: "\u544A\u8BC9\u4F60" };
|
|
17620
|
-
function threadTail(kind, thread, reader, closed) {
|
|
17621
|
-
const person = `\u770B\u60C5\u51B5\u544A\u8BC9\u7528\u6237\uFF1A\u6709\u7528\u6237\u8BE5\u77E5\u9053\u7684\uFF0C\u4E00\u4E24\u53E5\u8BDD\u8BF4\u8981\u70B9\uFF1B\u6CA1\u6709\u7684\u8BDD\u6574\u6BB5\u56DE\u590D\u53EA\u5199\u300C${QUIET}\u300D\u3002`;
|
|
17622
|
-
if (closed) {
|
|
17623
|
-
if (kind === "question")
|
|
17624
|
-
return `\uFF08\u8FD9\u4EF6\u4E8B\u5DF2\u7ECF\u4EA4\u56DE\u4E86\uFF0C\u8FD9\u662F\u540E\u9762\u7684\u8BDD\u3002\u8981\u56DE\u7B54\u7684\u8BDD\u7528 agent_message\uFF1Athread \u586B ${thread}\uFF0Ckind \u586B answer\uFF0C\u4F60\u7684\u666E\u901A\u56DE\u590D\u5BF9\u65B9\u770B\u4E0D\u5230\u3002\uFF09`;
|
|
17625
|
-
return reader === "main" ? `\uFF08\u8FD9\u4EF6\u4E8B\u5DF2\u7ECF\u4EA4\u56DE\u4E86\uFF0C\u8FD9\u662F\u540E\u9762\u8865\u7684\u8BDD\uFF0C\u4E0D\u7528\u56DE\u5B83\u3002${person}\uFF09` : "\uFF08\u8FD9\u4EF6\u4E8B\u5DF2\u7ECF\u4EA4\u56DE\u4E86\uFF0C\u8FD9\u662F\u540E\u9762\u8865\u7684\u8BDD\uFF0C\u4E0D\u7528\u56DE\u5B83\u3002\uFF09";
|
|
17626
|
-
}
|
|
17627
|
-
if (kind === "question")
|
|
17628
|
-
return `\uFF08\u5BF9\u65B9\u5728\u7B49\uFF1A\u5148\u56DE\u7B54\u5B83\uFF0C\u518D\u63A5\u7740\u505A\u624B\u4E0A\u7684\u4E8B\u3002\u7528 agent_message \u56DE\u7B54\uFF1Athread \u586B ${thread}\uFF0Ckind \u586B answer\u3002\u4F60\u8FD9\u4E00\u8F6E\u7684\u6700\u540E\u4E00\u6BB5\u56DE\u590D\u4E5F\u7B97\u56DE\u7B54\u3002\u8981\u7B49\u7528\u6237\u51B3\u5B9A\u7684\u8BDD\uFF0C\u5148\u7528 kind: update \u8BF4\u4E00\u58F0\uFF0C\u7B49\u6709\u4E86\u7ED3\u679C\u518D\u56DE\u7B54\u3002\uFF09`;
|
|
17629
|
-
if (kind === "answer" || reader === "worker")
|
|
17630
|
-
return "\uFF08\u63A5\u7740\u505A\u8FD9\u4EF6\u4E8B\u3002\uFF09";
|
|
17631
|
-
return reader === "main" ? `\uFF08\u5B83\u8FD8\u5728\u505A\uFF0C\u8FD9\u662F\u8FC7\u7A0B\u4E2D\u544A\u8BC9\u4F60\u7684\uFF0C\u4E0D\u7528\u56DE\u5B83\u3002${person}\uFF09` : "\uFF08\u5B83\u8FD8\u5728\u505A\uFF0C\u8FD9\u662F\u8FC7\u7A0B\u4E2D\u544A\u8BC9\u4F60\u7684\uFF0C\u4E0D\u7528\u56DE\u5B83\uFF1A\u63A5\u7740\u505A\u4F60\u624B\u4E0A\u7684\u4E8B\u3002\uFF09";
|
|
17632
|
-
}
|
|
17633
|
-
function threadMessage(input) {
|
|
17634
|
-
const head = `\uFF08\u300C${input.from}\u300D\u5728\u7EBF\u7D22 ${input.thread} \u91CC${THREAD_WORDS[input.kind]}\uFF1A${oneLine(input.title)}\uFF09`;
|
|
17635
|
-
return `${head}
|
|
17636
|
-
|
|
17637
|
-
${input.text.trim()}
|
|
17638
|
-
|
|
17639
|
-
${threadTail(input.kind, input.thread, input.reader ?? "worker", input.closed === true)}`;
|
|
17640
|
-
}
|
|
17641
|
-
function parseThreadNote(text) {
|
|
17642
|
-
const [first = "", ...rest] = text.split("\n");
|
|
17643
|
-
const head = /^(「([^」]+)」在线索 (\S+) 里(问你|回答了你|告诉你):(.*))$/.exec(first);
|
|
17644
|
-
if (head === null)
|
|
17645
|
-
return void 0;
|
|
17646
|
-
const body = rest.join("\n").trim();
|
|
17647
|
-
const end = body.lastIndexOf("\n\n\uFF08");
|
|
17648
|
-
return { from: head[1], thread: head[2], kind: head[3] === "\u95EE\u4F60" ? "question" : head[3] === "\u544A\u8BC9\u4F60" ? "update" : "answer", title: head[4], text: (end === -1 ? body : body.slice(0, end)).trim() };
|
|
17649
|
-
}
|
|
17650
|
-
function relayMessage(input) {
|
|
17651
|
-
const head = `\uFF08\u300C${input.agent}\u300D${input.ok ? "\u4EA4\u56DE\u4E86" : "\u6CA1\u6709\u505A\u5B8C"}${input.asker}\u4EA4\u7ED9\u5B83\u7684\u4E8B\uFF1A${oneLine(input.title)}\uFF09`;
|
|
17652
|
-
const tail = input.toLead === true ? input.ok ? "\uFF08\u8FD9\u662F\u4F60\u95EE\u5B83\u7684\u7ED3\u679C\uFF1A\u63A5\u7740\u505A\u4F60\u624B\u4E0A\u7684\u4E8B\uFF0C\u628A\u5B83\u7528\u5230\u4F60\u7684\u7ED3\u8BBA\u91CC\u3002\uFF09" : "\uFF08\u5B83\u6CA1\u505A\u6210\uFF1A\u63A5\u7740\u505A\u4F60\u624B\u4E0A\u7684\u4E8B\uFF0C\u80FD\u7ED5\u8FC7\u53BB\u5C31\u7ED5\u8FC7\u53BB\uFF0C\u7ED5\u4E0D\u8FC7\u53BB\u5C31\u5728\u4F60\u7684\u7ED3\u8BBA\u91CC\u8BF4\u6E05\u695A\u3002\uFF09" : input.ok ? `\uFF08\u770B\u60C5\u51B5\u544A\u8BC9\u7528\u6237\uFF1A\u6709\u7528\u6237\u8BE5\u77E5\u9053\u6216\u8981\u505A\u7684\uFF0C\u7528\u4E00\u4E24\u53E5\u8BDD\u8BF4\u8981\u70B9\uFF0C\u5B8C\u6574\u8FC7\u7A0B\u5728\u300C${input.agent}\u300D\u7684\u5BF9\u8BDD\u91CC\uFF1B\u6CA1\u6709\u7684\u8BDD\u6574\u6BB5\u56DE\u590D\u53EA\u5199\u300C${QUIET}\u300D\u3002\u8FD8\u8981\u522B\u7684 agent \u63A5\u7740\u505A\u7684\uFF0C\u53EF\u4EE5\u518D\u4EA4\u3002\uFF09` : `\uFF08\u544A\u8BC9\u7528\u6237\u54EA\u91CC\u6CA1\u505A\u6210\u3001\u4E3A\u4EC0\u4E48\uFF1B\u9700\u8981\u7684\u8BDD\u6362\u4E2A\u8BF4\u6CD5\u518D\u4EA4\u4E00\u6B21\uFF0C\u6216\u8005\u95EE\u7528\u6237\u3002\uFF09`;
|
|
17653
|
-
const asked = input.consulted !== void 0 && input.consulted.length > 0 ? `
|
|
17654
|
-
|
|
17655
|
-
\uFF08\u505A\u8FD9\u4EF6\u4E8B\u65F6\u5B83\u8FD8\u95EE\u4E86\uFF1A${input.consulted.join("\u3001")}\u3002\uFF09` : "";
|
|
17656
|
-
return `${head}
|
|
17657
|
-
|
|
17658
|
-
${input.reply.trim()}${asked}
|
|
17659
|
-
|
|
17660
|
-
${tail}`;
|
|
17661
|
-
}
|
|
17662
|
-
function threadsBetween(all, a, b) {
|
|
17663
|
-
return all.filter((h) => {
|
|
17664
|
-
const from = h.chain?.at(-2);
|
|
17665
|
-
const to = h.chain?.at(-1);
|
|
17666
|
-
return from === a && to === b || from === b && to === a;
|
|
17667
|
-
});
|
|
17668
|
-
}
|
|
17669
|
-
function parseRelay(text) {
|
|
17670
|
-
const [first = "", ...rest] = text.split("\n");
|
|
17671
|
-
const head = /^(「([^」]+)」(交回了|没有做完)([^()]{1,20}?)交给它的事:(.*))$/.exec(first);
|
|
17672
|
-
if (head === null)
|
|
17673
|
-
return void 0;
|
|
17674
|
-
const body = rest.join("\n").trim();
|
|
17675
|
-
const end = body.lastIndexOf("\n\n\uFF08");
|
|
17676
|
-
return { agent: head[1], ok: head[2] === "\u4EA4\u56DE\u4E86", asker: head[3], title: head[4], reply: (end === -1 ? body : body.slice(0, end)).trim() };
|
|
17677
|
-
}
|
|
17678
|
-
function oneLine(text) {
|
|
17679
|
-
return text.replace(/\s+/g, " ").replace(/[()]/g, (m) => m === "\uFF08" ? "(" : ")").trim();
|
|
17680
|
-
}
|
|
17681
|
-
var REMINDER_NOTE = /\n\n(这是你在线索 \S+ 上定的提醒:[^)]*)$/;
|
|
17682
|
-
function threadReminder(prompt, thread, by) {
|
|
17683
|
-
return `${prompt}
|
|
17684
|
-
|
|
17685
|
-
\uFF08\u8FD9\u662F\u4F60\u5728\u7EBF\u7D22 ${thread} \u4E0A\u5B9A\u7684\u63D0\u9192\uFF1A\u8981\u8BA9${by}\u77E5\u9053\u7684\uFF0C\u5230\u70B9\u540E\u7528 agent_message \u53D1\u7ED9\u5B83\uFF0Cthread \u586B ${thread}\uFF0Ckind \u586B update\uFF1B\u4F60\u7684\u666E\u901A\u56DE\u590D\u5B83\u770B\u4E0D\u5230\u3002\uFF09`;
|
|
17686
|
-
}
|
|
17687
|
-
function reminderPrompts(text) {
|
|
17688
|
-
const single = /^\[SCHEDULE REMINDER\]\n[\s\S]*?^reminder_prompt_json: (.*)$/m.exec(text);
|
|
17689
|
-
if (single !== null)
|
|
17690
|
-
return [jsonString(single[1]).replace(REMINDER_NOTE, "")];
|
|
17691
|
-
const batch = /^\[SCHEDULE REMINDER BATCH\]\n[\s\S]*?^reminders_json: (.*)$/m.exec(text);
|
|
17692
|
-
if (batch === null)
|
|
17693
|
-
return void 0;
|
|
17694
|
-
try {
|
|
17695
|
-
const items = JSON.parse(batch[1]);
|
|
17696
|
-
return items.map((item) => String(item.reminder_prompt ?? "").replace(REMINDER_NOTE, "")).filter((p) => p !== "");
|
|
17697
|
-
} catch {
|
|
17698
|
-
return [];
|
|
17699
|
-
}
|
|
17700
|
-
}
|
|
17701
|
-
function reminderLine(prompts) {
|
|
17702
|
-
return prompts.length === 0 ? "\u5B9A\u65F6\u63D0\u9192" : `\u5B9A\u65F6\u63D0\u9192\uFF1A${prompts.map((p) => oneLine(p)).join("\uFF1B")}`;
|
|
17703
|
-
}
|
|
17704
|
-
function jsonString(json2) {
|
|
17705
|
-
try {
|
|
17706
|
-
const value = JSON.parse(json2);
|
|
17707
|
-
return typeof value === "string" ? value : json2;
|
|
17708
|
-
} catch {
|
|
17709
|
-
return json2;
|
|
17710
|
-
}
|
|
17711
|
-
}
|
|
17712
|
-
|
|
17713
17819
|
// packages/protocol/lib/tools.js
|
|
17714
17820
|
function summarizeToolArgs(args) {
|
|
17715
17821
|
try {
|
|
@@ -17945,12 +18051,32 @@ export {
|
|
|
17945
18051
|
SKILL_NAME,
|
|
17946
18052
|
MAX_SKILL_NAME,
|
|
17947
18053
|
SKILLHUB_CAPABILITY,
|
|
18054
|
+
BY_YOU,
|
|
18055
|
+
isQuiet,
|
|
18056
|
+
taskMessage,
|
|
18057
|
+
parseTask,
|
|
18058
|
+
threadMessage,
|
|
18059
|
+
parseThreadNote,
|
|
18060
|
+
relayMessage,
|
|
18061
|
+
threadsBetween,
|
|
18062
|
+
parseRelay,
|
|
18063
|
+
threadReminder,
|
|
18064
|
+
reminderPrompts,
|
|
18065
|
+
reminderLine,
|
|
17948
18066
|
PERSONA_CAPABILITY,
|
|
17949
18067
|
Persona,
|
|
17950
18068
|
PersonaSettings,
|
|
18069
|
+
personaOf,
|
|
18070
|
+
personaPrompt,
|
|
17951
18071
|
COMPACTION_CAPABILITY,
|
|
17952
18072
|
DEFAULT_COMPACTION_THRESHOLD,
|
|
18073
|
+
LOW_CONTEXT_WINDOW_MS,
|
|
17953
18074
|
CompactionSettings,
|
|
18075
|
+
MEMORY_CAPABILITY,
|
|
18076
|
+
SHARED_MEMORY,
|
|
18077
|
+
MemoryKind,
|
|
18078
|
+
MAX_MEMORY_TEXT,
|
|
18079
|
+
MemoryEntry,
|
|
17954
18080
|
RUNS_CAPABILITY,
|
|
17955
18081
|
DEEPSEEK_API_KEY,
|
|
17956
18082
|
AGENTS_CAPABILITY,
|
|
@@ -17963,18 +18089,5 @@ export {
|
|
|
17963
18089
|
optimizeScriptPrompt,
|
|
17964
18090
|
expandSlash,
|
|
17965
18091
|
parseGitHubLink,
|
|
17966
|
-
BY_YOU,
|
|
17967
|
-
QUIET,
|
|
17968
|
-
isQuiet,
|
|
17969
|
-
taskMessage,
|
|
17970
|
-
parseTask,
|
|
17971
|
-
threadMessage,
|
|
17972
|
-
parseThreadNote,
|
|
17973
|
-
relayMessage,
|
|
17974
|
-
threadsBetween,
|
|
17975
|
-
parseRelay,
|
|
17976
|
-
threadReminder,
|
|
17977
|
-
reminderPrompts,
|
|
17978
|
-
reminderLine,
|
|
17979
18092
|
UPDATE_RULE
|
|
17980
18093
|
};
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
globToRegExp,
|
|
4
4
|
renderTask,
|
|
5
5
|
require_dist
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XHP3SLMO.js";
|
|
7
7
|
import {
|
|
8
8
|
RUNS_CAPABILITY,
|
|
9
9
|
ScriptId,
|
|
10
10
|
external_exports
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-SA72K6M2.js";
|
|
12
12
|
import {
|
|
13
13
|
__toESM
|
|
14
14
|
} from "./chunk-2UFLGPDY.js";
|
package/lib/emulator.js
CHANGED
package/lib/feishu.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createRequire as __adgCreateRequire } from 'node:module'; import { dirn
|
|
|
2
2
|
import {
|
|
3
3
|
replyMarkdown,
|
|
4
4
|
replyPlain
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-4PNYIZVU.js";
|
|
6
6
|
import {
|
|
7
7
|
require_extension,
|
|
8
8
|
require_permessage_deflate,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
require_subprotocol,
|
|
13
13
|
require_websocket,
|
|
14
14
|
require_websocket_server
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-IZENRXQ6.js";
|
|
16
16
|
import {
|
|
17
17
|
writeFileAtomic
|
|
18
18
|
} from "./chunk-CCAB6XXZ.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
FeishuPending,
|
|
23
23
|
FeishuSettings,
|
|
24
24
|
external_exports
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-SA72K6M2.js";
|
|
26
26
|
import {
|
|
27
27
|
__commonJS,
|
|
28
28
|
__require,
|
package/lib/game-intel.js
CHANGED
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
GAME_MANIFEST_FILE,
|
|
8
8
|
GameManifest,
|
|
9
9
|
parseGameManifest
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-XHP3SLMO.js";
|
|
11
11
|
import {
|
|
12
12
|
sessionConversations
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-4PNYIZVU.js";
|
|
14
|
+
import "./chunk-IZENRXQ6.js";
|
|
15
15
|
import {
|
|
16
16
|
writeFileAtomic
|
|
17
17
|
} from "./chunk-CCAB6XXZ.js";
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
SHOT_IMAGE,
|
|
25
25
|
external_exports,
|
|
26
26
|
taskMessage
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-SA72K6M2.js";
|
|
28
28
|
import "./chunk-2UFLGPDY.js";
|
|
29
29
|
|
|
30
30
|
// packages/game-intel/lib/index.js
|
|
@@ -1622,7 +1622,7 @@ var GAME_ROLE = {
|
|
|
1622
1622
|
order: 20,
|
|
1623
1623
|
titles: ["\u6E38\u620F\u4FE1\u606F", "\u6E38\u620F\u8D44\u8BAF", "\u6DFB\u52A0\u6E38\u620F", "\u65E5\u62A5"],
|
|
1624
1624
|
// Games and their screens, and what scripts ran (for the daily report); no installing, runs or pipelines.
|
|
1625
|
-
tools: ["game_*", "screen_*", "window_*", "emulator_status", "emulator_start", "script_list", "script_runs", "system_info", "skill_focus", "skill_save"],
|
|
1625
|
+
tools: ["game_*", "screen_*", "window_*", "emulator_status", "emulator_start", "script_list", "script_tasks", "script_runs", "system_info", "skill_focus", "skill_save"],
|
|
1626
1626
|
duty: [
|
|
1627
1627
|
"# \u4F60\u7684\u89D2\u8272\uFF1A\u6E38\u620F",
|
|
1628
1628
|
"\u4F60\u662F MultiGameAssistant \u7684\u300C\u6E38\u620F\u300Dagent\uFF1A\u8BFB\u6E38\u620F\u7684\u6D3B\u52A8\u3001\u8D44\u8BAF\u548C\u8FDB\u5EA6\u5E76\u8BB0\u4E0B\u6765\uFF08game_record\uFF09\uFF0C\u5199\u65E5\u62A5\uFF0C\u6DFB\u52A0\u6E38\u620F\u3002",
|
package/lib/gateway.js
CHANGED
|
@@ -17,9 +17,9 @@ import {
|
|
|
17
17
|
copyLabel,
|
|
18
18
|
lib_default,
|
|
19
19
|
streamFacts
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-IZENRXQ6.js";
|
|
21
21
|
import "./chunk-CCAB6XXZ.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-SA72K6M2.js";
|
|
23
23
|
import "./chunk-2UFLGPDY.js";
|
|
24
24
|
export {
|
|
25
25
|
AGENT_PRESET,
|
package/lib/guard.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __adgCreateRequire } from 'node:module'; import { dirname as __adgDirname } from 'node:path'; import { fileURLToPath as __adgFileURLToPath } from 'node:url'; const require = __adgCreateRequire(import.meta.url); const __filename = __adgFileURLToPath(import.meta.url); const __dirname = __adgDirname(__filename);
|
|
2
2
|
import {
|
|
3
3
|
GUARD_CAPABILITY
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SA72K6M2.js";
|
|
5
5
|
import "./chunk-2UFLGPDY.js";
|
|
6
6
|
|
|
7
7
|
// packages/guard/lib/index.js
|
package/lib/intervene.js
CHANGED
|
@@ -2,8 +2,8 @@ import { createRequire as __adgCreateRequire } from 'node:module'; import { dirn
|
|
|
2
2
|
import {
|
|
3
3
|
finalText,
|
|
4
4
|
sessionConversations
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-4PNYIZVU.js";
|
|
6
|
+
import "./chunk-IZENRXQ6.js";
|
|
7
7
|
import {
|
|
8
8
|
writeFileAtomic
|
|
9
9
|
} from "./chunk-CCAB6XXZ.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
INTERVENE_CAPABILITY,
|
|
12
12
|
UPDATE_RULE,
|
|
13
13
|
external_exports
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-SA72K6M2.js";
|
|
15
15
|
import "./chunk-2UFLGPDY.js";
|
|
16
16
|
|
|
17
17
|
// packages/intervene/lib/index.js
|