duclaw-cli 1.8.34 → 1.8.35
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/dist/bundle.js +61 -4
- package/dist/main.js +1 -1
- package/dist/worker-main.js +1 -1
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -30242,7 +30242,7 @@ function printHelp() {
|
|
|
30242
30242
|
`);
|
|
30243
30243
|
}
|
|
30244
30244
|
function printVersion() {
|
|
30245
|
-
console.log(`duclaw-cli v${true ? "1.8.
|
|
30245
|
+
console.log(`duclaw-cli v${true ? "1.8.35" : "unknown"}`);
|
|
30246
30246
|
}
|
|
30247
30247
|
function getDuclawTemplate() {
|
|
30248
30248
|
return {
|
|
@@ -42304,6 +42304,23 @@ var departmentCreate = {
|
|
|
42304
42304
|
|
|
42305
42305
|
// src/tools/tools/department/DepartmentCommunicate.ts
|
|
42306
42306
|
var CEO_MAILBOX_ID = `manager`;
|
|
42307
|
+
var getActiveMailboxContext = (actorMailboxId, messageId) => {
|
|
42308
|
+
if (!messageId) return null;
|
|
42309
|
+
const db3 = createSqliteDB();
|
|
42310
|
+
const row = db3.prepare(
|
|
42311
|
+
`SELECT
|
|
42312
|
+
id,
|
|
42313
|
+
from_mailbox_id as fromMailboxId,
|
|
42314
|
+
to_mailbox_id as toMailboxId,
|
|
42315
|
+
origin_user_id as originUserId,
|
|
42316
|
+
origin_platform as originPlatform,
|
|
42317
|
+
thread_id as threadId
|
|
42318
|
+
FROM mailbox
|
|
42319
|
+
WHERE id = ?
|
|
42320
|
+
AND (from_mailbox_id = ? OR to_mailbox_id = ?)`
|
|
42321
|
+
).get(messageId, actorMailboxId, actorMailboxId);
|
|
42322
|
+
return row ?? null;
|
|
42323
|
+
};
|
|
42307
42324
|
var DESCRIPTION21 = `
|
|
42308
42325
|
\u5411\u90E8\u95E8\u6210\u5458\u53D1\u9001\u6D88\u606F\u6216\u6307\u4EE4\uFF0C\u662F\u516C\u53F8\u5185\u90E8\u5F02\u6B65\u534F\u4F5C\u901A\u4FE1\u6E20\u9053\u3002
|
|
42309
42326
|
|
|
@@ -42396,6 +42413,14 @@ var departmentCommunicate = {
|
|
|
42396
42413
|
if (!departmentAgentId) {
|
|
42397
42414
|
options.originUserId = userRequest.userId;
|
|
42398
42415
|
options.originPlatform = userRequest.platform;
|
|
42416
|
+
} else {
|
|
42417
|
+
const activeContext = getActiveMailboxContext(fromMailboxId, userRequest.requestId);
|
|
42418
|
+
if (activeContext) {
|
|
42419
|
+
options.originUserId = activeContext.originUserId;
|
|
42420
|
+
options.originPlatform = activeContext.originPlatform;
|
|
42421
|
+
options.threadId = activeContext.threadId || activeContext.id;
|
|
42422
|
+
options.parentMessageId = activeContext.id;
|
|
42423
|
+
}
|
|
42399
42424
|
}
|
|
42400
42425
|
try {
|
|
42401
42426
|
sendMessage2(fromMailboxId, toMailboxId, content, options);
|
|
@@ -46499,6 +46524,36 @@ var DESCRIPTION41 = `
|
|
|
46499
46524
|
1. \u5C06\u56DE\u590D\u5185\u5BB9\u53D1\u9001\u5230\u539F\u53D1\u9001\u8005\u7684\u90AE\u7BB1
|
|
46500
46525
|
2. \u5C06\u8BE5\u90AE\u4EF6\u6807\u8BB0\u4E3A\u5DF2\u5904\u7406\uFF08done\uFF09
|
|
46501
46526
|
`;
|
|
46527
|
+
var findUpstreamManagerMessage = (myMailboxId, threadId) => {
|
|
46528
|
+
if (!threadId) return null;
|
|
46529
|
+
const db3 = createSqliteDB();
|
|
46530
|
+
const row = db3.prepare(
|
|
46531
|
+
`SELECT
|
|
46532
|
+
id,
|
|
46533
|
+
from_mailbox_id as fromMailboxId,
|
|
46534
|
+
to_mailbox_id as toMailboxId,
|
|
46535
|
+
status
|
|
46536
|
+
FROM mailbox
|
|
46537
|
+
WHERE thread_id = ?
|
|
46538
|
+
AND from_mailbox_id = 'manager'
|
|
46539
|
+
AND to_mailbox_id = ?
|
|
46540
|
+
ORDER BY send_time ASC
|
|
46541
|
+
LIMIT 1`
|
|
46542
|
+
).get(threadId, myMailboxId);
|
|
46543
|
+
return row ?? null;
|
|
46544
|
+
};
|
|
46545
|
+
var buildUpstreamReminder = (myMailboxId, repliedToMailboxId, threadId) => {
|
|
46546
|
+
const member = getDepartmentMemberByMailboxId(myMailboxId);
|
|
46547
|
+
if (member?.role !== "department_head") return "";
|
|
46548
|
+
if (repliedToMailboxId === "manager") return "";
|
|
46549
|
+
const upstream = findUpstreamManagerMessage(myMailboxId, threadId);
|
|
46550
|
+
if (!upstream) return "";
|
|
46551
|
+
return [
|
|
46552
|
+
``,
|
|
46553
|
+
`[replyMailbox] \u63D0\u9192\uFF1A\u4F60\u521A\u521A\u56DE\u590D\u7684\u662F\u4E0B\u6E38\u6210\u5458 ${repliedToMailboxId}\uFF0C\u4F46\u672C\u7EBF\u7A0B\u7684\u4E0A\u6E38 manager \u90AE\u4EF6 ${upstream.id} \u4ECD\u9700\u8981\u4F60\u540C\u6B65\u6700\u7EC8\u9A8C\u6536/\u6C47\u603B\u3002`,
|
|
46554
|
+
`\u5982\u679C\u8FD9\u6B21\u56DE\u590D\u4EE3\u8868\u4EFB\u52A1\u5DF2\u5B8C\u6210\u6216\u5DF2\u9A8C\u6536\uFF0C\u8BF7\u7EE7\u7EED\u8C03\u7528 reply_mailbox(message_id="${upstream.id}", content="...")\uFF08\u82E5\u8BE5\u90AE\u4EF6\u4ECD\u5728 processing\uFF09\uFF0C\u6216 mailbox_followup(message_id="${upstream.id}", content="...", kind="partial_result") \u5C06\u7ED3\u679C\u540C\u6B65\u7ED9 manager\u3002`
|
|
46555
|
+
].join("\n");
|
|
46556
|
+
};
|
|
46502
46557
|
var replyMailbox = {
|
|
46503
46558
|
name: `reply_mailbox`,
|
|
46504
46559
|
description: DESCRIPTION41,
|
|
@@ -46573,7 +46628,8 @@ var replyMailbox = {
|
|
|
46573
46628
|
threadId: replyMsg.threadId || msg.threadId || msg.id
|
|
46574
46629
|
}
|
|
46575
46630
|
});
|
|
46576
|
-
|
|
46631
|
+
const upstreamReminder = buildUpstreamReminder(myMailboxId, msg.fromMailboxId, msg.threadId || msg.id);
|
|
46632
|
+
return `[replyMailbox] \u5DF2\u6B63\u5F0F\u56DE\u590D\u90AE\u4EF6 ${messageId}\uFF0C\u56DE\u590D\u6D88\u606F ${replyMsg.id} \u5DF2\u53D1\u9001\u5230 ${msg.fromMailboxId} \u7684\u90AE\u7BB1\uFF08thread: ${replyMsg.threadId}\uFF09${upstreamReminder}`;
|
|
46577
46633
|
}
|
|
46578
46634
|
};
|
|
46579
46635
|
|
|
@@ -46692,7 +46748,7 @@ var wakeDepartmentAgent = async (mailboxId, msgIds) => {
|
|
|
46692
46748
|
const workspacePath = department?.workpath;
|
|
46693
46749
|
const agentConfig = getDepartmentAgentConfig(void 0, member.focusOn, workspacePath, department?.name, member.role, member.name);
|
|
46694
46750
|
const agent = createAgent(agentConfig);
|
|
46695
|
-
const roleSpecificReminder = member.role === "department_head" ? `\u4F60\u662F Department Head\u3002\u8BFB\u53D6\u90AE\u4EF6\u540E\uFF0C\u5982\u679C\u8FD9\u662F\u590D\u6742\u6267\u884C\u5DE5\u4F5C\uFF08\u4F8B\u5982\u5199\u4EE3\u7801\u3001\u8BFB\u4EE3\u7801\u5B9A\u4F4D\u3001\u8DD1\u6D4B\u8BD5\u3001\u8C03\u8BD5\u3001\u90E8\u7F72\u3001\u5168\u9762\u9A8C\u8BC1\u6216\u751F\u6210\u590D\u6742\u4EA7\u7269\uFF09\uFF0C\u4E0D\u8981\u9ED8\u8BA4\u81EA\u5DF1\u4E0B\u573A\u6267\u884C\uFF1B\u5148\u7528 department_member_list \u67E5\u770B\u6210\u5458\uFF0C\u9009\u62E9\u6216\u521B\u5EFA\u5408\u9002 Executor\uFF0C\u5E76\u7528 department_communicate \u5206\u6D3E\u5177\u4F53\u4EFB\u52A1\u3002\u4F60\u8D1F\u8D23\u62C6\u89E3\u3001\u534F\u8C03\u3001\u8FFD\u95EE\u3001\u9A8C\u6536\u548C\u6C47\u603B\u3002` : `\u4F60\u662F Executor\u3002\u8BFB\u53D6\u90AE\u4EF6\u540E\u76F4\u63A5\u5904\u7406\u5206\u6D3E\u7ED9\u4F60\u7684\u5177\u4F53\u6267\u884C\u4EFB\u52A1\uFF1B\u4E0D\u8981\u5C1D\u8BD5\u67E5\u770B\u5B8C\u6574\u90E8\u95E8\u6210\u5458\u76EE\u5F55\u6216\u521B\u5EFA\u6210\u5458\u3002`;
|
|
46751
|
+
const roleSpecificReminder = member.role === "department_head" ? `\u4F60\u662F Department Head\u3002\u8BFB\u53D6\u90AE\u4EF6\u540E\uFF0C\u5982\u679C\u8FD9\u662F\u590D\u6742\u6267\u884C\u5DE5\u4F5C\uFF08\u4F8B\u5982\u5199\u4EE3\u7801\u3001\u8BFB\u4EE3\u7801\u5B9A\u4F4D\u3001\u8DD1\u6D4B\u8BD5\u3001\u8C03\u8BD5\u3001\u90E8\u7F72\u3001\u5168\u9762\u9A8C\u8BC1\u6216\u751F\u6210\u590D\u6742\u4EA7\u7269\uFF09\uFF0C\u4E0D\u8981\u9ED8\u8BA4\u81EA\u5DF1\u4E0B\u573A\u6267\u884C\uFF1B\u5148\u7528 department_member_list \u67E5\u770B\u6210\u5458\uFF0C\u9009\u62E9\u6216\u521B\u5EFA\u5408\u9002 Executor\uFF0C\u5E76\u7528 department_communicate \u5206\u6D3E\u5177\u4F53\u4EFB\u52A1\u3002\u4F60\u8D1F\u8D23\u62C6\u89E3\u3001\u534F\u8C03\u3001\u8FFD\u95EE\u3001\u9A8C\u6536\u548C\u6C47\u603B\u3002\u6536\u5230 Executor \u5B8C\u6210\u56DE\u4FE1\u5E76\u9A8C\u6536\u540E\uFF0C\u5FC5\u987B\u628A\u6700\u7EC8\u7ED3\u679C\u540C\u6B65\u7ED9\u4E0A\u6E38\u8BF7\u6C42\u65B9\uFF08\u901A\u5E38\u662F manager/CEO\uFF09\uFF1B\u53EA\u56DE\u590D Executor \u4E0D\u7B49\u4E8E\u5B8C\u6210\u5BF9\u4E0A\u6E38\u7684\u6C47\u62A5\u3002` : `\u4F60\u662F Executor\u3002\u8BFB\u53D6\u90AE\u4EF6\u540E\u76F4\u63A5\u5904\u7406\u5206\u6D3E\u7ED9\u4F60\u7684\u5177\u4F53\u6267\u884C\u4EFB\u52A1\uFF1B\u4E0D\u8981\u5C1D\u8BD5\u67E5\u770B\u5B8C\u6574\u90E8\u95E8\u6210\u5458\u76EE\u5F55\u6216\u521B\u5EFA\u6210\u5458\u3002`;
|
|
46696
46752
|
const request = {
|
|
46697
46753
|
platform: "mailbox",
|
|
46698
46754
|
userId: mailboxId,
|
|
@@ -46962,6 +47018,7 @@ ${workspacePath ? `
|
|
|
46962
47018
|
5. Executor \u672A\u56DE\u4FE1\u6216\u8FDB\u5EA6\u6162\uFF0C\u4E0D\u662F Department Head \u81EA\u5DF1\u4E0B\u573A\u5E72\u6D3B\u7684\u7406\u7531\uFF1B\u5E94\u901A\u8FC7 mailbox_followup \u6216 department_communicate \u8FFD\u95EE/\u8865\u5145\u4E0A\u4E0B\u6587\uFF0C\u5E76\u5411\u4E0A\u6E38\u8BF4\u660E\u6B63\u5728\u7B49\u5F85\u6267\u884C\u5C42\u7ED3\u679C\u3002
|
|
46963
47019
|
6. \u53EA\u6709\u5F53\u90AE\u4EF6\u660E\u786E\u8981\u6C42 Department Head \u4EB2\u81EA\u6267\u884C\u3001\u5F53\u524D\u90E8\u95E8\u6CA1\u6709\u53EF\u7528 Executor \u4E14\u77ED\u671F\u65E0\u6CD5\u521B\u5EFA\u3001\u6216 Executor \u660E\u786E\u5931\u8D25\u4E14\u4E0A\u6E38\u540C\u610F Head \u63A5\u7BA1\u65F6\uFF0CDepartment Head \u624D\u80FD\u4EB2\u81EA\u4F7F\u7528\u6267\u884C\u7C7B\u5DE5\u5177\u5B8C\u6210\u4E13\u4E1A\u6267\u884C\u3002
|
|
46964
47020
|
7. \u6536\u5230 Executor \u56DE\u4FE1\u540E\uFF0CDepartment Head \u5E94\u505A\u9A8C\u6536\u548C\u6C47\u603B\uFF1A\u5FC5\u8981\u65F6\u53EF\u4EE5\u68C0\u67E5\u5C11\u91CF\u5173\u952E\u8BC1\u636E\uFF0C\u4F46\u4E0D\u8981\u628A Executor \u7684\u5B8C\u6574\u6267\u884C\u804C\u8D23\u91CD\u65B0\u81EA\u5DF1\u505A\u4E00\u904D\u3002
|
|
47021
|
+
8. Department Head \u9A8C\u6536 Executor \u7ED3\u679C\u540E\uFF0C\u5FC5\u987B\u56DE\u5230\u4E0A\u6E38\u8BF7\u6C42\u7EBF\u7A0B\u5411\u539F\u53D1\u9001\u8005\u540C\u6B65\u6700\u7EC8\u7ED3\u8BBA\u3002\u82E5\u4E0A\u6E38\u662F manager/CEO\uFF0C\u4F7F\u7528\u539F manager \u90AE\u4EF6\u7684 message_id \u8C03\u7528 reply_mailbox \u6216 mailbox_followup\uFF1B\u4E0D\u8981\u53EA\u628A\u201C\u9A8C\u6536\u901A\u8FC7/\u5B8C\u6210\u6C47\u62A5\u201D\u56DE\u590D\u7ED9 Executor\uFF0C\u5426\u5219 CEO \u548C\u7528\u6237\u4E0D\u4F1A\u6536\u5230\u7ED3\u679C\u3002
|
|
46965
47022
|
</Department Head Delegation Rules>
|
|
46966
47023
|
|
|
46967
47024
|
<Task Execution>
|
|
@@ -51932,7 +51989,7 @@ var systemRoutes = new Hono2();
|
|
|
51932
51989
|
var startTime = Date.now();
|
|
51933
51990
|
systemRoutes.get("/system/info", (c) => {
|
|
51934
51991
|
return c.json({
|
|
51935
|
-
version: true ? "1.8.
|
|
51992
|
+
version: true ? "1.8.35" : "unknown",
|
|
51936
51993
|
uptime: Math.floor((Date.now() - startTime) / 1e3),
|
|
51937
51994
|
env: process.env.NODE_ENV || "development",
|
|
51938
51995
|
nodeVersion: process.version
|