dsh-multigameassistant 2.0.1 → 2.0.2
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 +1 -1
- package/lib/analyzer.js +2 -2
- package/lib/{chunk-BNGDT7YT.js → chunk-I5AFAEXG.js} +471 -75
- package/lib/{chunk-J46OASOG.js → chunk-NWM5ZN7E.js} +1 -1
- package/lib/{chunk-ZQ6KFVEO.js → chunk-OPV336S5.js} +312 -58
- package/lib/{chunk-HPQCV6WO.js → chunk-QAP7IYBS.js} +172 -25
- package/lib/{chunk-D7JEXAT5.js → chunk-ZR74PFWR.js} +2 -2
- package/lib/emulator.js +1 -1
- package/lib/feishu.js +3 -3
- package/lib/game-intel.js +194 -27
- package/lib/gateway.js +2 -2
- package/lib/guard.js +1 -1
- package/lib/intervene.js +8 -6
- 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 +1 -1
- package/skills/game-intel.md +2 -0
- package/web/assets/index-9SCfW_a1.js +241 -0
- package/web/assets/index-9SCfW_a1.js.map +1 -0
- package/web/assets/index-BodAAefM.css +1 -0
- package/web/index.html +2 -2
- package/web/assets/index-Baf6Mpe9.js +0 -235
- package/web/assets/index-Baf6Mpe9.js.map +0 -1
- package/web/assets/index-BfVFC1Ik.css +0 -1
|
@@ -15829,12 +15829,32 @@ var Activity = external_exports.object({
|
|
|
15829
15829
|
kind: external_exports.string().optional(),
|
|
15830
15830
|
/** What it is about, from the data site. */
|
|
15831
15831
|
description: external_exports.string().optional(),
|
|
15832
|
-
/**
|
|
15832
|
+
/**
|
|
15833
|
+
* Its picture (fetch it with `games/image`). Unless the user chose a source
|
|
15834
|
+
* (`chosen`), by rank: what the user set, then what a source gives (data
|
|
15835
|
+
* sites, then web pages), then the screenshot the agent read it from.
|
|
15836
|
+
*/
|
|
15833
15837
|
cover: external_exports.string().optional(),
|
|
15834
15838
|
/** The source whose dates are shown: a data site, else the newest web page the agent read. */
|
|
15835
15839
|
site: external_exports.object({ source: external_exports.string(), name: external_exports.string(), at: external_exports.number() }).optional(),
|
|
15836
|
-
/** Every source that lists it (data sites, web pages the agent read), with
|
|
15837
|
-
sources: external_exports.array(external_exports.object({
|
|
15840
|
+
/** Every source that lists it (data sites, web pages the agent read), with what each says. */
|
|
15841
|
+
sources: external_exports.array(external_exports.object({
|
|
15842
|
+
id: external_exports.string(),
|
|
15843
|
+
name: external_exports.string(),
|
|
15844
|
+
at: external_exports.number(),
|
|
15845
|
+
web: external_exports.boolean(),
|
|
15846
|
+
startsAt: external_exports.number().optional(),
|
|
15847
|
+
endsAt: external_exports.number().optional(),
|
|
15848
|
+
shopEndsAt: external_exports.number().optional(),
|
|
15849
|
+
cover: external_exports.string().optional()
|
|
15850
|
+
})).optional(),
|
|
15851
|
+
/**
|
|
15852
|
+
* The source the user picked for the picture and the dates (`games/activity/source`):
|
|
15853
|
+
* a source's id, `OWN_SOURCE` or `SCREEN_SOURCE`. Absent: the default order.
|
|
15854
|
+
*/
|
|
15855
|
+
chosen: external_exports.string().optional(),
|
|
15856
|
+
/** Which source each shown value comes from, in the same ids as `chosen`. */
|
|
15857
|
+
shown: external_exports.object({ cover: external_exports.string().optional(), startsAt: external_exports.string().optional(), endsAt: external_exports.string().optional() }).optional(),
|
|
15838
15858
|
/** Read from the game screen by the agent. */
|
|
15839
15859
|
screen: external_exports.object({
|
|
15840
15860
|
at: external_exports.number(),
|
|
@@ -15864,8 +15884,16 @@ var Activity = external_exports.object({
|
|
|
15864
15884
|
* those fields beat every source, and a refresh never changes or drops them.
|
|
15865
15885
|
* An activity with no `sources` and no `screen` is one the user added.
|
|
15866
15886
|
*/
|
|
15867
|
-
own: external_exports.object({
|
|
15887
|
+
own: external_exports.object({
|
|
15888
|
+
at: external_exports.number(),
|
|
15889
|
+
fields: external_exports.array(external_exports.enum(["name", "startsAt", "endsAt", "kind", "description", "url", "cover"])),
|
|
15890
|
+
startsAt: external_exports.number().optional(),
|
|
15891
|
+
endsAt: external_exports.number().optional(),
|
|
15892
|
+
cover: external_exports.string().optional()
|
|
15893
|
+
}).optional()
|
|
15868
15894
|
});
|
|
15895
|
+
var OWN_SOURCE = "@own";
|
|
15896
|
+
var SCREEN_SOURCE = "@screen";
|
|
15869
15897
|
var MAX_ACTIVITY_IMAGE_BASE64 = 112e5;
|
|
15870
15898
|
var ActivityImage = external_exports.object({
|
|
15871
15899
|
mediaType: external_exports.enum(["image/png", "image/jpeg", "image/gif", "image/webp", "image/avif"]),
|
|
@@ -16092,6 +16120,16 @@ var GamesRequests = {
|
|
|
16092
16120
|
}),
|
|
16093
16121
|
result: Activity
|
|
16094
16122
|
},
|
|
16123
|
+
/**
|
|
16124
|
+
* Which source an event's picture and dates come from: a source's id,
|
|
16125
|
+
* `OWN_SOURCE` or `SCREEN_SOURCE`; `null` goes back to the default order.
|
|
16126
|
+
* What that source does not say still comes from the default order.
|
|
16127
|
+
*/
|
|
16128
|
+
"games/activity/source": {
|
|
16129
|
+
capability: GAMES_CAPABILITY,
|
|
16130
|
+
params: external_exports.object({ activityId: external_exports.string(), source: external_exports.string().nullable() }),
|
|
16131
|
+
result: Activity
|
|
16132
|
+
},
|
|
16095
16133
|
/** Take back everything the user wrote on an event: the sources' word shows again; one only the user added goes. */
|
|
16096
16134
|
"games/activity/reset": {
|
|
16097
16135
|
capability: GAMES_CAPABILITY,
|
|
@@ -16307,26 +16345,39 @@ var SkillsNotifications = {
|
|
|
16307
16345
|
// packages/protocol/lib/persona.js
|
|
16308
16346
|
var PERSONA_CAPABILITY = "persona";
|
|
16309
16347
|
var PersonaStyle = external_exports.enum(["default", "concise", "patient", "lively", "buddy", "butler"]);
|
|
16348
|
+
var PeerStyle = external_exports.enum(["plain", "same"]);
|
|
16310
16349
|
var Persona = external_exports.object({
|
|
16311
16350
|
style: PersonaStyle,
|
|
16312
|
-
/** What the agent calls itself. */
|
|
16313
|
-
name: external_exports.string().max(20).optional(),
|
|
16314
16351
|
/** How it addresses the user ("主人", "指挥官"…). */
|
|
16315
16352
|
callUser: external_exports.string().max(20).optional(),
|
|
16316
16353
|
/** Anything else, in the user's words. */
|
|
16317
|
-
custom: external_exports.string().optional()
|
|
16354
|
+
custom: external_exports.string().optional(),
|
|
16355
|
+
peerStyle: PeerStyle.optional()
|
|
16356
|
+
});
|
|
16357
|
+
var PersonaOverride = Persona.partial().extend({
|
|
16358
|
+
/** What the agent calls itself. */
|
|
16359
|
+
name: external_exports.string().max(20).optional()
|
|
16360
|
+
});
|
|
16361
|
+
var PersonaSettings = external_exports.object({
|
|
16362
|
+
persona: Persona,
|
|
16363
|
+
agents: external_exports.record(external_exports.string(), PersonaOverride)
|
|
16364
|
+
});
|
|
16365
|
+
var PersonaAnswer = PersonaSettings.extend({
|
|
16366
|
+
/** The text added to the system prompt with nothing of an agent's own, for the settings page to show. */
|
|
16367
|
+
prompt: external_exports.string(),
|
|
16368
|
+
/** The same, as it is for each agent, by id. */
|
|
16369
|
+
prompts: external_exports.record(external_exports.string(), external_exports.string())
|
|
16318
16370
|
});
|
|
16319
16371
|
var PersonaRequests = {
|
|
16320
16372
|
"persona/get": {
|
|
16321
16373
|
capability: PERSONA_CAPABILITY,
|
|
16322
16374
|
params: external_exports.object({}),
|
|
16323
|
-
|
|
16324
|
-
result: external_exports.object({ persona: Persona, prompt: external_exports.string() })
|
|
16375
|
+
result: PersonaAnswer
|
|
16325
16376
|
},
|
|
16326
16377
|
"persona/set": {
|
|
16327
16378
|
capability: PERSONA_CAPABILITY,
|
|
16328
|
-
params:
|
|
16329
|
-
result:
|
|
16379
|
+
params: PersonaSettings,
|
|
16380
|
+
result: PersonaAnswer
|
|
16330
16381
|
}
|
|
16331
16382
|
};
|
|
16332
16383
|
|
|
@@ -16975,8 +17026,22 @@ var ModelSelection = external_exports.object({
|
|
|
16975
17026
|
reasoningEffort: external_exports.string().optional()
|
|
16976
17027
|
});
|
|
16977
17028
|
var AGENTS_CAPABILITY = "agents";
|
|
17029
|
+
var ThreadMessage = external_exports.object({
|
|
17030
|
+
/** Who said it, by name. */
|
|
17031
|
+
from: external_exports.string(),
|
|
17032
|
+
/** `question` waits for an answer; `update` only informs, and reaches the other side at once; `done` is the conclusion. */
|
|
17033
|
+
kind: external_exports.enum(["question", "answer", "update", "done"]),
|
|
17034
|
+
text: external_exports.string(),
|
|
17035
|
+
at: external_exports.number()
|
|
17036
|
+
});
|
|
16978
17037
|
var HandOff = external_exports.object({
|
|
16979
17038
|
id: external_exports.string(),
|
|
17039
|
+
/** What the two have said since the work was handed over (docs/design/agent-roles.md §14.3). */
|
|
17040
|
+
messages: external_exports.array(ThreadMessage).optional(),
|
|
17041
|
+
/** The agents the work has passed through, first asker first (ids); a chain does not come back on itself. */
|
|
17042
|
+
chain: external_exports.array(external_exports.string()).optional(),
|
|
17043
|
+
/** The hand-off this one was opened from inside of. */
|
|
17044
|
+
parent: external_exports.string().optional(),
|
|
16980
17045
|
/** The conversation that asked, where the reply goes back. */
|
|
16981
17046
|
fromSession: external_exports.string(),
|
|
16982
17047
|
/** 助手's `agent_delegate` call that asked; absent: the app asked (`by`). */
|
|
@@ -16989,7 +17054,8 @@ var HandOff = external_exports.object({
|
|
|
16989
17054
|
title: external_exports.string(),
|
|
16990
17055
|
task: external_exports.string(),
|
|
16991
17056
|
expecting: external_exports.string().optional(),
|
|
16992
|
-
|
|
17057
|
+
/** `waiting`: the agent doing it asked something and waits for the answer. */
|
|
17058
|
+
state: external_exports.enum(["running", "waiting", "done", "failed"]),
|
|
16993
17059
|
/** Its reply; for a failure, why. */
|
|
16994
17060
|
reply: external_exports.string().optional(),
|
|
16995
17061
|
startedAt: external_exports.number(),
|
|
@@ -17125,7 +17191,19 @@ var Requests = {
|
|
|
17125
17191
|
params: external_exports.object({ sessionId: external_exports.string() }),
|
|
17126
17192
|
result: external_exports.object({ items: external_exports.array(HandOff) })
|
|
17127
17193
|
},
|
|
17194
|
+
/** Stop a sub-agent's current work (the parent's own turn goes on). */
|
|
17195
|
+
"subagents/stop": {
|
|
17196
|
+
capability: AGENTS_CAPABILITY,
|
|
17197
|
+
params: external_exports.object({ sessionId: external_exports.string() }),
|
|
17198
|
+
result: Accepted
|
|
17199
|
+
},
|
|
17128
17200
|
/** One hand-off, for the page that shows what the two agents said. */
|
|
17201
|
+
/** All that two agents have said to each other, oldest first: one conversation, whatever each thread was about. */
|
|
17202
|
+
"handoffs/between": {
|
|
17203
|
+
capability: AGENTS_CAPABILITY,
|
|
17204
|
+
params: external_exports.object({ a: external_exports.string(), b: external_exports.string() }),
|
|
17205
|
+
result: external_exports.object({ items: external_exports.array(HandOff) })
|
|
17206
|
+
},
|
|
17129
17207
|
"handoffs/get": {
|
|
17130
17208
|
capability: AGENTS_CAPABILITY,
|
|
17131
17209
|
params: external_exports.object({ id: external_exports.string() }),
|
|
@@ -17473,15 +17551,24 @@ function classify(value) {
|
|
|
17473
17551
|
// packages/protocol/lib/handoff-notes.js
|
|
17474
17552
|
var BY_YOU = "\u4F60";
|
|
17475
17553
|
var QUIET = "\uFF08\u4E0D\u7528\u544A\u8BC9\u7528\u6237\uFF09";
|
|
17554
|
+
var wordsOf = (text) => text.replace(/[^\p{Script=Han}a-zA-Z0-9]/gu, "");
|
|
17476
17555
|
function isQuiet(text) {
|
|
17477
|
-
return text
|
|
17478
|
-
}
|
|
17479
|
-
var RETURNS = "\uFF08\
|
|
17480
|
-
|
|
17556
|
+
return wordsOf(text) === wordsOf(QUIET);
|
|
17557
|
+
}
|
|
17558
|
+
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";
|
|
17559
|
+
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";
|
|
17560
|
+
var THREAD_LINE = /^(这件事的线索是 (\S+):做的过程中要问清楚什么,用 agent_message 问,thread 填它;不要猜。)$/;
|
|
17561
|
+
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`;
|
|
17562
|
+
var PAST_LINE = /^(你和.{1,20}之前的来往,/;
|
|
17563
|
+
var PAST_END = "\uFF09";
|
|
17564
|
+
function taskMessage(by, title, body, returns = false, thread, past) {
|
|
17481
17565
|
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`;
|
|
17566
|
+
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`]];
|
|
17567
|
+
if (past !== void 0 && past.lines.length > 0)
|
|
17568
|
+
notes.push([PAST_HEAD(past.who), ...past.lines, PAST_END].join("\n"));
|
|
17482
17569
|
return `${head}
|
|
17483
|
-
${
|
|
17484
|
-
`
|
|
17570
|
+
${notes.map((n) => `${n}
|
|
17571
|
+
`).join("")}
|
|
17485
17572
|
${body}`;
|
|
17486
17573
|
}
|
|
17487
17574
|
function parseTask(text) {
|
|
@@ -17490,23 +17577,69 @@ function parseTask(text) {
|
|
|
17490
17577
|
const theirs = mine === null ? /^(([^():]{1,20})交给你的事:(.*))$/.exec(first) : null;
|
|
17491
17578
|
if (mine === null && theirs === null)
|
|
17492
17579
|
return void 0;
|
|
17493
|
-
const returns = rest[0] === RETURNS;
|
|
17580
|
+
const returns = rest[0] === RETURNS || rest[0] === RETURNS_BEFORE;
|
|
17581
|
+
const after = returns ? rest.slice(1) : rest;
|
|
17582
|
+
const thread = THREAD_LINE.exec(after[0] ?? "")?.[1];
|
|
17583
|
+
const next = thread === void 0 ? after : after.slice(1);
|
|
17584
|
+
const pastEnd = PAST_LINE.test(next[0] ?? "") ? next.indexOf(PAST_END) : -1;
|
|
17494
17585
|
return {
|
|
17495
17586
|
by: mine !== null ? BY_YOU : theirs[1],
|
|
17496
17587
|
title: mine !== null ? mine[1] : theirs[2],
|
|
17497
17588
|
returns,
|
|
17498
|
-
|
|
17499
|
-
|
|
17589
|
+
...thread === void 0 ? {} : { thread },
|
|
17590
|
+
body: next.slice(pastEnd + 1).join("\n").trim()
|
|
17591
|
+
};
|
|
17592
|
+
}
|
|
17593
|
+
var THREAD_WORDS = { question: "\u95EE\u4F60", answer: "\u56DE\u7B54\u4E86\u4F60", update: "\u544A\u8BC9\u4F60" };
|
|
17594
|
+
function threadTail(kind, thread, reader, closed) {
|
|
17595
|
+
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`;
|
|
17596
|
+
if (closed) {
|
|
17597
|
+
if (kind === "question")
|
|
17598
|
+
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`;
|
|
17599
|
+
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";
|
|
17600
|
+
}
|
|
17601
|
+
if (kind === "question")
|
|
17602
|
+
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`;
|
|
17603
|
+
if (kind === "answer" || reader === "worker")
|
|
17604
|
+
return "\uFF08\u63A5\u7740\u505A\u8FD9\u4EF6\u4E8B\u3002\uFF09";
|
|
17605
|
+
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";
|
|
17606
|
+
}
|
|
17607
|
+
function threadMessage(input) {
|
|
17608
|
+
const head = `\uFF08\u300C${input.from}\u300D\u5728\u7EBF\u7D22 ${input.thread} \u91CC${THREAD_WORDS[input.kind]}\uFF1A${oneLine(input.title)}\uFF09`;
|
|
17609
|
+
return `${head}
|
|
17610
|
+
|
|
17611
|
+
${input.text.trim()}
|
|
17612
|
+
|
|
17613
|
+
${threadTail(input.kind, input.thread, input.reader ?? "worker", input.closed === true)}`;
|
|
17614
|
+
}
|
|
17615
|
+
function parseThreadNote(text) {
|
|
17616
|
+
const [first = "", ...rest] = text.split("\n");
|
|
17617
|
+
const head = /^(「([^」]+)」在线索 (\S+) 里(问你|回答了你|告诉你):(.*))$/.exec(first);
|
|
17618
|
+
if (head === null)
|
|
17619
|
+
return void 0;
|
|
17620
|
+
const body = rest.join("\n").trim();
|
|
17621
|
+
const end = body.lastIndexOf("\n\n\uFF08");
|
|
17622
|
+
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() };
|
|
17500
17623
|
}
|
|
17501
17624
|
function relayMessage(input) {
|
|
17502
17625
|
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`;
|
|
17503
|
-
const tail = 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`;
|
|
17626
|
+
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`;
|
|
17627
|
+
const asked = input.consulted !== void 0 && input.consulted.length > 0 ? `
|
|
17628
|
+
|
|
17629
|
+
\uFF08\u505A\u8FD9\u4EF6\u4E8B\u65F6\u5B83\u8FD8\u95EE\u4E86\uFF1A${input.consulted.join("\u3001")}\u3002\uFF09` : "";
|
|
17504
17630
|
return `${head}
|
|
17505
17631
|
|
|
17506
|
-
${input.reply.trim()}
|
|
17632
|
+
${input.reply.trim()}${asked}
|
|
17507
17633
|
|
|
17508
17634
|
${tail}`;
|
|
17509
17635
|
}
|
|
17636
|
+
function threadsBetween(all, a, b) {
|
|
17637
|
+
return all.filter((h) => {
|
|
17638
|
+
const from = h.chain?.at(-2);
|
|
17639
|
+
const to = h.chain?.at(-1);
|
|
17640
|
+
return from === a && to === b || from === b && to === a;
|
|
17641
|
+
});
|
|
17642
|
+
}
|
|
17510
17643
|
function parseRelay(text) {
|
|
17511
17644
|
const [first = "", ...rest] = text.split("\n");
|
|
17512
17645
|
const head = /^(「([^」]+)」(交回了|没有做完)([^()]{1,20}?)交给它的事:(.*))$/.exec(first);
|
|
@@ -17519,16 +17652,22 @@ function parseRelay(text) {
|
|
|
17519
17652
|
function oneLine(text) {
|
|
17520
17653
|
return text.replace(/\s+/g, " ").replace(/[()]/g, (m) => m === "\uFF08" ? "(" : ")").trim();
|
|
17521
17654
|
}
|
|
17655
|
+
var REMINDER_NOTE = /\n\n(这是你在线索 \S+ 上定的提醒:[^)]*)$/;
|
|
17656
|
+
function threadReminder(prompt, thread, by) {
|
|
17657
|
+
return `${prompt}
|
|
17658
|
+
|
|
17659
|
+
\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`;
|
|
17660
|
+
}
|
|
17522
17661
|
function reminderPrompts(text) {
|
|
17523
17662
|
const single = /^\[SCHEDULE REMINDER\]\n[\s\S]*?^reminder_prompt_json: (.*)$/m.exec(text);
|
|
17524
17663
|
if (single !== null)
|
|
17525
|
-
return [jsonString(single[1])];
|
|
17664
|
+
return [jsonString(single[1]).replace(REMINDER_NOTE, "")];
|
|
17526
17665
|
const batch = /^\[SCHEDULE REMINDER BATCH\]\n[\s\S]*?^reminders_json: (.*)$/m.exec(text);
|
|
17527
17666
|
if (batch === null)
|
|
17528
17667
|
return void 0;
|
|
17529
17668
|
try {
|
|
17530
17669
|
const items = JSON.parse(batch[1]);
|
|
17531
|
-
return items.map((item) => String(item.reminder_prompt ?? "")).filter((p) => p !== "");
|
|
17670
|
+
return items.map((item) => String(item.reminder_prompt ?? "").replace(REMINDER_NOTE, "")).filter((p) => p !== "");
|
|
17532
17671
|
} catch {
|
|
17533
17672
|
return [];
|
|
17534
17673
|
}
|
|
@@ -17765,6 +17904,8 @@ export {
|
|
|
17765
17904
|
AgentTaskRun,
|
|
17766
17905
|
INTERVENE_CAPABILITY,
|
|
17767
17906
|
GAMES_CAPABILITY,
|
|
17907
|
+
OWN_SOURCE,
|
|
17908
|
+
SCREEN_SOURCE,
|
|
17768
17909
|
OWN_IMAGE,
|
|
17769
17910
|
SHOT_IMAGE,
|
|
17770
17911
|
GamesSettings,
|
|
@@ -17780,6 +17921,7 @@ export {
|
|
|
17780
17921
|
SKILLHUB_CAPABILITY,
|
|
17781
17922
|
PERSONA_CAPABILITY,
|
|
17782
17923
|
Persona,
|
|
17924
|
+
PersonaSettings,
|
|
17783
17925
|
COMPACTION_CAPABILITY,
|
|
17784
17926
|
DEFAULT_COMPACTION_THRESHOLD,
|
|
17785
17927
|
CompactionSettings,
|
|
@@ -17796,11 +17938,16 @@ export {
|
|
|
17796
17938
|
expandSlash,
|
|
17797
17939
|
parseGitHubLink,
|
|
17798
17940
|
BY_YOU,
|
|
17941
|
+
QUIET,
|
|
17799
17942
|
isQuiet,
|
|
17800
17943
|
taskMessage,
|
|
17801
17944
|
parseTask,
|
|
17945
|
+
threadMessage,
|
|
17946
|
+
parseThreadNote,
|
|
17802
17947
|
relayMessage,
|
|
17948
|
+
threadsBetween,
|
|
17803
17949
|
parseRelay,
|
|
17950
|
+
threadReminder,
|
|
17804
17951
|
reminderPrompts,
|
|
17805
17952
|
reminderLine,
|
|
17806
17953
|
UPDATE_RULE
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
globToRegExp,
|
|
4
4
|
renderTask,
|
|
5
5
|
require_dist
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NWM5ZN7E.js";
|
|
7
7
|
import {
|
|
8
8
|
RUNS_CAPABILITY,
|
|
9
9
|
ScriptId,
|
|
10
10
|
external_exports
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-QAP7IYBS.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-I5AFAEXG.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-OPV336S5.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-QAP7IYBS.js";
|
|
26
26
|
import {
|
|
27
27
|
__commonJS,
|
|
28
28
|
__require,
|