@ai-setting/roy-agent-core 1.7.31 → 1.7.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/dist/env/event-source/index.js +2 -2
- package/dist/env/index.js +3 -3
- package/dist/env/task/plugins/index.js +1 -1
- package/dist/index.js +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-vqexb6am.js → roy-agent-core-4csc7ars.js} +16 -4
- package/dist/shared/@ai-setting/{roy-agent-core-1ht06trt.js → roy-agent-core-4t6m600m.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-06wbc8km.js → roy-agent-core-9z6gcy77.js} +14 -1
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
larkCliHandler,
|
|
12
12
|
resolveBountyIMSystemPrompt,
|
|
13
13
|
timerHandler
|
|
14
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
14
|
+
} from "../../shared/@ai-setting/roy-agent-core-4csc7ars.js";
|
|
15
15
|
import"../../shared/@ai-setting/roy-agent-core-0nz53t5v.js";
|
|
16
16
|
import {
|
|
17
17
|
BUILT_IN_EVENT_SOURCE_TYPES,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
isValidEventSourceType,
|
|
23
23
|
validateEventSourceConfig
|
|
24
24
|
} from "../../shared/@ai-setting/roy-agent-core-ds5f75pg.js";
|
|
25
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
25
|
+
import"../../shared/@ai-setting/roy-agent-core-9z6gcy77.js";
|
|
26
26
|
import"../../shared/@ai-setting/roy-agent-core-1pg0fepg.js";
|
|
27
27
|
import"../../shared/@ai-setting/roy-agent-core-skqt40yy.js";
|
|
28
28
|
import"../../shared/@ai-setting/roy-agent-core-1df0grva.js";
|
package/dist/env/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseEnvironment
|
|
3
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
3
|
+
} from "../shared/@ai-setting/roy-agent-core-4t6m600m.js";
|
|
4
4
|
import {
|
|
5
5
|
TaskComponent
|
|
6
6
|
} from "../shared/@ai-setting/roy-agent-core-m09a4xwh.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
EventSourceComponent,
|
|
16
16
|
builtInHandlers,
|
|
17
17
|
larkCliHandler
|
|
18
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
18
|
+
} from "../shared/@ai-setting/roy-agent-core-4csc7ars.js";
|
|
19
19
|
import"../shared/@ai-setting/roy-agent-core-0nz53t5v.js";
|
|
20
20
|
import {
|
|
21
21
|
EventSourceInitHooks,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
isValidEventSourceType,
|
|
25
25
|
validateEventSourceConfig
|
|
26
26
|
} from "../shared/@ai-setting/roy-agent-core-ds5f75pg.js";
|
|
27
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
27
|
+
import"../shared/@ai-setting/roy-agent-core-9z6gcy77.js";
|
|
28
28
|
import"../shared/@ai-setting/roy-agent-core-1pg0fepg.js";
|
|
29
29
|
import"../shared/@ai-setting/roy-agent-core-skqt40yy.js";
|
|
30
30
|
import {
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
formatExtractorInput,
|
|
11
11
|
formatExtractorInputFromDescription,
|
|
12
12
|
parseExtractorOutput
|
|
13
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
13
|
+
} from "../../../shared/@ai-setting/roy-agent-core-9z6gcy77.js";
|
|
14
14
|
import"../../../shared/@ai-setting/roy-agent-core-1pg0fepg.js";
|
|
15
15
|
import"../../../shared/@ai-setting/roy-agent-core-skqt40yy.js";
|
|
16
16
|
import"../../../shared/@ai-setting/roy-agent-core-1df0grva.js";
|
package/dist/index.js
CHANGED
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
BaseEnvironment,
|
|
67
67
|
generateDescendingId,
|
|
68
68
|
generateId
|
|
69
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
69
|
+
} from "./shared/@ai-setting/roy-agent-core-4t6m600m.js";
|
|
70
70
|
import {
|
|
71
71
|
TaskComponent
|
|
72
72
|
} from "./shared/@ai-setting/roy-agent-core-m09a4xwh.js";
|
|
@@ -92,7 +92,7 @@ import {
|
|
|
92
92
|
larkCliHandler,
|
|
93
93
|
resolveBountyIMSystemPrompt,
|
|
94
94
|
timerHandler
|
|
95
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
95
|
+
} from "./shared/@ai-setting/roy-agent-core-4csc7ars.js";
|
|
96
96
|
import {
|
|
97
97
|
LogTraceComponent,
|
|
98
98
|
LogTraceConfigSchema
|
|
@@ -109,7 +109,7 @@ import {
|
|
|
109
109
|
import {
|
|
110
110
|
TaskTagPlugin,
|
|
111
111
|
createAutoTaskPlugin
|
|
112
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
112
|
+
} from "./shared/@ai-setting/roy-agent-core-9z6gcy77.js";
|
|
113
113
|
import {
|
|
114
114
|
TaskHookPoints
|
|
115
115
|
} from "./shared/@ai-setting/roy-agent-core-1pg0fepg.js";
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
TaskTagPlugin,
|
|
3
3
|
createLarkCliTaskNotifyHook,
|
|
4
4
|
createPerTaskGroupChatPlugin
|
|
5
|
-
} from "./roy-agent-core-
|
|
5
|
+
} from "./roy-agent-core-9z6gcy77.js";
|
|
6
6
|
import {
|
|
7
7
|
envKeyToConfigKey
|
|
8
8
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
@@ -906,7 +906,10 @@ function extractMetadata(rawEvent, eventType) {
|
|
|
906
906
|
const larkInnerEvent = event.event;
|
|
907
907
|
const header = larkInnerEvent?.header || event.header;
|
|
908
908
|
const sender = larkInnerEvent?.sender || event.sender;
|
|
909
|
-
|
|
909
|
+
let senderId = sender?.sender_id;
|
|
910
|
+
if (!senderId && typeof event.sender_id === "string") {
|
|
911
|
+
senderId = event.sender_id;
|
|
912
|
+
}
|
|
910
913
|
let messageData;
|
|
911
914
|
if (larkInnerEvent?.message) {
|
|
912
915
|
messageData = larkInnerEvent.message;
|
|
@@ -932,7 +935,9 @@ function extractMetadata(rawEvent, eventType) {
|
|
|
932
935
|
metadata.messageId = messageData.message_id;
|
|
933
936
|
metadata.messageType = messageData.message_type;
|
|
934
937
|
}
|
|
935
|
-
if (senderId) {
|
|
938
|
+
if (typeof senderId === "string") {
|
|
939
|
+
metadata.senderId = senderId;
|
|
940
|
+
} else if (senderId) {
|
|
936
941
|
metadata.senderId = senderId.open_id || senderId.user_id || senderId.union_id;
|
|
937
942
|
}
|
|
938
943
|
let recommendedAction;
|
|
@@ -947,6 +952,7 @@ function extractMetadata(rawEvent, eventType) {
|
|
|
947
952
|
});
|
|
948
953
|
}
|
|
949
954
|
const profile = event.profile;
|
|
955
|
+
const senderOpenId = typeof senderId === "string" ? senderId : senderId?.open_id;
|
|
950
956
|
const replyChannel = {
|
|
951
957
|
type: "lark-cli",
|
|
952
958
|
appId: metadata.appId,
|
|
@@ -954,7 +960,7 @@ function extractMetadata(rawEvent, eventType) {
|
|
|
954
960
|
chatId: messageData?.chat_id,
|
|
955
961
|
messageId: messageData?.message_id,
|
|
956
962
|
params: {
|
|
957
|
-
userId:
|
|
963
|
+
userId: senderOpenId
|
|
958
964
|
}
|
|
959
965
|
};
|
|
960
966
|
return { metadata, replyChannel, recommendedAction };
|
|
@@ -1367,6 +1373,12 @@ class LarkCliInstance {
|
|
|
1367
1373
|
const message = innerEvent?.message || event.message;
|
|
1368
1374
|
const sender = innerEvent?.sender || event.sender || message?.sender;
|
|
1369
1375
|
const senderId = sender?.sender_id;
|
|
1376
|
+
if (typeof event.sender_id === "string") {
|
|
1377
|
+
return event.sender_id;
|
|
1378
|
+
}
|
|
1379
|
+
if (typeof senderId === "string") {
|
|
1380
|
+
return senderId;
|
|
1381
|
+
}
|
|
1370
1382
|
return senderId?.open_id || senderId?.user_id || senderId?.union_id || "unknown";
|
|
1371
1383
|
}
|
|
1372
1384
|
buildReplyChannel(replyChannel) {
|
|
@@ -830,6 +830,7 @@ class PerTaskGroupChatPlugin {
|
|
|
830
830
|
descriptionTemplate: config.descriptionTemplate ?? "roy-agent task #{id} - #{project_path}",
|
|
831
831
|
botAppIds: config.botAppIds ?? [],
|
|
832
832
|
inviteUserIds: config.inviteUserIds ?? ["sender"],
|
|
833
|
+
defaultInviteUserIds: config.defaultInviteUserIds ?? [],
|
|
833
834
|
fallbackToMain: config.fallbackToMain ?? true,
|
|
834
835
|
operationThrottleMs: config.operationThrottleMs ?? 5000,
|
|
835
836
|
disableSubTaskSkip: config.disableSubTaskSkip ?? false,
|
|
@@ -1258,6 +1259,15 @@ ${opts.content}`;
|
|
|
1258
1259
|
}
|
|
1259
1260
|
resolveUserIds(replyChannel) {
|
|
1260
1261
|
const ids = new Set;
|
|
1262
|
+
if (this.config.defaultInviteUserIds && this.config.defaultInviteUserIds.length > 0) {
|
|
1263
|
+
for (const id of this.config.defaultInviteUserIds) {
|
|
1264
|
+
if (id && id !== "sender" && id.startsWith("ou_")) {
|
|
1265
|
+
ids.add(id);
|
|
1266
|
+
} else if (id && id !== "sender") {
|
|
1267
|
+
logger4.debug(`resolveUserIds[${this.pluginName}]: skip non-open_id in defaultInviteUserIds: "${id}"`);
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1261
1271
|
if (this.config.inviteUserIds && this.config.inviteUserIds.length > 0) {
|
|
1262
1272
|
for (const id of this.config.inviteUserIds) {
|
|
1263
1273
|
if (id !== "sender" && id)
|
|
@@ -1270,12 +1280,15 @@ ${opts.content}`;
|
|
|
1270
1280
|
ids.add(senderId);
|
|
1271
1281
|
}
|
|
1272
1282
|
}
|
|
1273
|
-
if (ids.size === 0) {
|
|
1283
|
+
if (ids.size === 0 && this.config.inviteUserIds?.includes("sender")) {
|
|
1274
1284
|
const alsUserId = getEnvContextOrEmpty().userId;
|
|
1275
1285
|
if (alsUserId && alsUserId.startsWith("ou_")) {
|
|
1276
1286
|
ids.add(alsUserId);
|
|
1277
1287
|
}
|
|
1278
1288
|
}
|
|
1289
|
+
if (isPluginDebugEnabled()) {
|
|
1290
|
+
logger4.debug(`resolveUserIds[${this.pluginName}]: ` + `defaultInviteUserIds=${JSON.stringify(this.config.defaultInviteUserIds)} ` + `inviteUserIds=${JSON.stringify(this.config.inviteUserIds)} ` + `replyChannel.userId=${replyChannel?.userId ?? "(none)"} ` + `→ final userIds=${JSON.stringify(Array.from(ids))}`);
|
|
1291
|
+
}
|
|
1279
1292
|
return Array.from(ids);
|
|
1280
1293
|
}
|
|
1281
1294
|
isSubTask(task) {
|