evolcore 0.0.43-test.0 → 0.0.43-test.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/CHANGELOG.md +31 -2
- package/README.md +22 -0
- package/dist/agents/claude-runner.js +26 -2
- package/dist/agents/codex/app-server-client.js +12 -0
- package/dist/agents/codex-runner.js +49 -8
- package/dist/agents/ecagent-runner.js +26 -9
- package/dist/agents/gemini-runner.js +15 -12
- package/dist/agents/tool-time-context.js +55 -0
- package/dist/aun/aid/client.js +1 -1
- package/dist/aun/menu/client.js +1 -1
- package/dist/aun/model-headers.js +17 -0
- package/dist/aun/msg/p2p.js +3 -0
- package/dist/channels/aun.js +484 -43
- package/dist/channels/builtin-plugins.js +16 -11
- package/dist/channels/dingtalk.js +83 -31
- package/dist/channels/feishu.js +29 -13
- package/dist/channels/qqbot.js +32 -11
- package/dist/channels/wechat.js +13 -3
- package/dist/channels/wecom.js +67 -27
- package/dist/cli/agent-command.js +3 -86
- package/dist/cli/agent-create.js +22 -6
- package/dist/cli/agent.js +1 -79
- package/dist/cli/aun-commands.js +1 -0
- package/dist/cli/config.js +1 -1
- package/dist/cli/daemon-commands.js +47 -2
- package/dist/cli/data-command.js +9 -1
- package/dist/cli/debug-mode.js +1 -1
- package/dist/cli/diag.js +1 -1
- package/dist/cli/directory.js +77 -64
- package/dist/cli/getmeta-command.js +1 -1
- package/dist/cli/index.js +79 -22
- package/dist/cli/init.js +1 -23
- package/dist/cli/link-rules.js +1 -1
- package/dist/cli/managed-command-guard.js +0 -1
- package/dist/cli/pa-workspace-command.js +36 -2
- package/dist/cli/peer.js +1 -1
- package/dist/cli/restart-monitor.js +17 -3
- package/dist/cli/role.js +1 -1
- package/dist/cli/session-command.js +1 -1
- package/dist/cli/stats.js +2 -2
- package/dist/cli/thread-command.js +1 -1
- package/dist/cli/watch-msg.js +1 -1
- package/dist/config/access-policy.js +1 -0
- package/dist/config/config-field-policy.js +2 -2
- package/dist/config/config-manager.js +7 -0
- package/dist/config/role-schema.js +4 -3
- package/dist/config/role-service.js +3 -3
- package/dist/config-store.js +75 -4
- package/dist/core/agent-ipc-registration.js +16 -59
- package/dist/core/agent-runtime.js +2 -1
- package/dist/core/auth/authorization-audit.js +52 -14
- package/dist/core/auth/operation-authorizer.js +0 -11
- package/dist/core/auth/operation-catalog.js +0 -18
- package/dist/core/channel-loader.js +152 -16
- package/dist/core/command/agent-control.js +2 -1
- package/dist/core/command/cli-intent-parser.js +0 -8
- package/dist/core/command/command-handler.js +17 -46
- package/dist/core/command/connect-menu.js +7 -3
- package/dist/core/command/menu-catalog.js +3 -2
- package/dist/core/command/menu-handler.js +51 -8
- package/dist/core/command/menu-protocol.js +20 -0
- package/dist/core/command/slash-handler.js +101 -40
- package/dist/core/daemon-file-cache.js +3 -3
- package/dist/core/evolagent-registry.js +5 -4
- package/dist/core/evolagent.js +5 -8
- package/dist/core/handoff/argv-parse.js +115 -0
- package/dist/core/handoff/ipc-registration.js +1 -1
- package/dist/core/ipc-registration.js +19 -2
- package/dist/core/memory/consolidation.js +8 -1
- package/dist/core/memory/relation-sweep.js +20 -8
- package/dist/core/message/aun-ipc-sender.js +28 -1
- package/dist/core/message/contact-admission.js +548 -0
- package/dist/core/message/im-renderer.js +69 -10
- package/dist/core/message/message-admission.js +28 -3
- package/dist/core/message/message-bridge.js +46 -5
- package/dist/core/message/message-utils.js +0 -5
- package/dist/core/message/peer-mode.js +44 -10
- package/dist/core/message/response-engine.js +268 -69
- package/dist/core/message/retry-scheduler.js +4 -0
- package/dist/core/permission/ec-command-parser.js +1 -28
- package/dist/core/permission/readonly-shell-query.js +34 -8
- package/dist/core/permission/tool-policy.js +50 -5
- package/dist/core/role/runtime-policy.js +14 -2
- package/dist/core/session/session-manager.js +9 -1
- package/dist/core/soul.js +66 -0
- package/dist/core/system-session/memory.js +2 -2
- package/dist/directory/contact-admission-paths.js +9 -0
- package/dist/directory/owner-directory-admission.js +128 -29
- package/dist/directory/owner-directory-cache.js +364 -50
- package/dist/directory/owner-directory-identity.js +60 -0
- package/dist/directory/owner-directory-markdown.js +120 -47
- package/dist/directory/owner-directory-policy.js +108 -0
- package/dist/directory/owner-directory-query-operation.js +219 -32
- package/dist/directory/owner-directory-remarks.js +29 -2
- package/dist/directory/owner-directory-search.js +50 -18
- package/dist/directory/owner-directory-store.js +150 -30
- package/dist/eck/kit-renderer.js +12 -5
- package/dist/eck/manifest-engine.js +55 -6
- package/dist/eck/message-renderer.js +5 -2
- package/dist/eck/paactive-context.js +45 -0
- package/dist/ecweb/basic-settings-service.js +2 -2
- package/dist/ecweb/message-context-service.js +24 -16
- package/dist/index.js +9 -5
- package/dist/ipc.js +1 -1
- package/dist/paths.js +26 -0
- package/dist/response-system/config-resolver.js +1 -1
- package/dist/response-system/engines/v1/index.js +4 -1
- package/dist/response-system/engines/v1/paactive-flow.js +18 -0
- package/dist/response-system/modes/single-session/index.js +7 -2
- package/dist/trigger/scheduler.js +3 -5
- package/dist/trigger/validation.js +4 -0
- package/dist/utils/error-utils.js +5 -2
- package/dist/utils/logger.js +13 -4
- package/dist/utils/npm-ops.js +2 -2
- package/dist/utils/windows-autostart.js +1 -1
- package/ecagent/dist/agent-loop.js +43 -1
- package/kits/docs/INDEX.md +1 -0
- package/kits/docs/context-assembly.md +21 -6
- package/kits/docs/eck_templates/INDEX.template.md +1 -2
- package/kits/docs/evolcore/INDEX.md +1 -1
- package/kits/docs/evolcore/agent-create.md +5 -5
- package/kits/docs/evolcore/agent.md +4 -9
- package/kits/docs/evolcore/directory.md +137 -0
- package/kits/docs/evolcore/menu-protocol.md +55 -0
- package/kits/docs/evolcore/response.md +7 -1
- package/kits/docs/evolcore/tool-authorization.md +1 -1
- package/kits/docs/evolcore/trigger.md +4 -0
- package/kits/docs/prompt-loading-architecture.md +6 -2
- package/kits/eck_manifest.auxiliary.json +1 -0
- package/kits/eck_manifest.json +57 -4
- package/kits/eck_manifest.memory.json +67 -3
- package/kits/eck_manifest.paactive.json +528 -0
- package/kits/eck_message_manifest.paactive.json +233 -0
- package/kits/rules/01-overview.md +2 -2
- package/kits/rules/03-identity.md +10 -9
- package/kits/rules/05-venue.md +2 -4
- package/kits/rules/06-channel.md +1 -1
- package/kits/schemas/_meta.json +31 -3
- package/kits/schemas/agent-config.schema.18.json +5 -0
- package/kits/schemas/agent-config.schema.19.json +924 -0
- package/kits/schemas/relation-config.schema.12.json +289 -0
- package/kits/schemas/role-config.schema.2.json +215 -0
- package/kits/skills/ec-skill/scripts/cli.mjs +3 -2
- package/kits/skills/ec-trigger/SKILL.md +4 -4
- package/kits/skills/personal-assistant/SKILL.md +109 -53
- package/kits/skills/personal-assistant/references/02-bootstrap.md +73 -30
- package/kits/skills/personal-assistant/scripts/clean.mjs +35 -18
- package/kits/skills/personal-assistant/scripts/init.mjs +41 -2
- package/kits/skills/personal-assistant/scripts/lib/persona.mjs +185 -0
- package/kits/skills/personal-assistant/scripts/migrate.mjs +55 -4
- package/kits/skills/personal-assistant/scripts/pa.mjs +173 -0
- package/kits/skills/personal-assistant/scripts/uninstall.mjs +130 -0
- package/kits/skills/personal-assistant/templates/persona-section.md +3 -3
- package/kits/templates/message-fragments/handoff-request-to-target.md +1 -1
- package/kits/templates/message-fragments/paactive/item.md +3 -0
- package/kits/templates/soul/00-GUIDE.md +61 -0
- package/kits/templates/soul/01-identity.md +5 -0
- package/kits/templates/soul/02-persona.md +11 -0
- package/kits/templates/soul/03-duties.md +5 -0
- package/kits/templates/soul/04-working-style.md +5 -0
- package/kits/templates/system-fragments/bootstrap.md +7 -7
- package/kits/templates/system-fragments/commands.md +3 -2
- package/kits/templates/system-fragments/directory-contacts.md +9 -0
- package/kits/templates/system-fragments/memory.md +1 -1
- package/kits/templates/system-fragments/paactive/channel.md +25 -0
- package/kits/templates/system-fragments/paactive/reply.md +25 -0
- package/kits/templates/system-fragments/paactive/session.md +32 -0
- package/kits/templates/system-fragments/personal-assistant.md +65 -0
- package/package.json +4 -3
- package/dist/cli/handoff-command.js +0 -353
- package/dist/directory/owner-directory-remark-operation.js +0 -147
- package/kits/docs/evolcore/self-summary.md +0 -29
package/dist/channels/wecom.js
CHANGED
|
@@ -485,6 +485,7 @@ export class WecomChannel {
|
|
|
485
485
|
config;
|
|
486
486
|
client = null;
|
|
487
487
|
connectionState = 'idle';
|
|
488
|
+
connectionGeneration = 0;
|
|
488
489
|
lastConnectionError;
|
|
489
490
|
messageHandler = null;
|
|
490
491
|
seenMessages = new Map();
|
|
@@ -551,11 +552,16 @@ export class WecomChannel {
|
|
|
551
552
|
}
|
|
552
553
|
}
|
|
553
554
|
async connectOnce() {
|
|
555
|
+
this.lifecycle?.assertActive();
|
|
556
|
+
const generation = ++this.connectionGeneration;
|
|
554
557
|
const { botId, secret } = this.config;
|
|
555
558
|
if (!botId || !secret) {
|
|
556
559
|
throw new Error('WeCom botId/secret not configured');
|
|
557
560
|
}
|
|
558
|
-
const sdk = await requireOptional('@wecom/aibot-node-sdk');
|
|
561
|
+
const sdk = await requireOptional('@wecom/aibot-node-sdk', false);
|
|
562
|
+
if (generation !== this.connectionGeneration)
|
|
563
|
+
throw new Error('wecom connection cancelled');
|
|
564
|
+
this.lifecycle?.assertActive();
|
|
559
565
|
this.connectionState = 'connecting';
|
|
560
566
|
this.lastConnectionError = undefined;
|
|
561
567
|
const client = new sdk.WSClient({
|
|
@@ -662,11 +668,18 @@ export class WecomChannel {
|
|
|
662
668
|
}
|
|
663
669
|
throw error;
|
|
664
670
|
}
|
|
671
|
+
if (generation !== this.connectionGeneration || this.client !== client
|
|
672
|
+
|| (this.lifecycle && this.lifecycle.state !== 'active')) {
|
|
673
|
+
this.removeClientListeners(client);
|
|
674
|
+
client.disconnect();
|
|
675
|
+
return;
|
|
676
|
+
}
|
|
665
677
|
// Hourly cleanup of old dedup entries
|
|
666
678
|
this.startCleanupTask();
|
|
667
679
|
logger.info('[WeCom] Channel connected');
|
|
668
680
|
}
|
|
669
681
|
async disconnect() {
|
|
682
|
+
this.connectionGeneration++;
|
|
670
683
|
this.connectionState = 'idle';
|
|
671
684
|
this.cancelAuthenticationWait?.(new Error('WeCom connection cancelled'));
|
|
672
685
|
if (this.cleanupInterval) {
|
|
@@ -706,6 +719,12 @@ export class WecomChannel {
|
|
|
706
719
|
: setInterval(cleanup, 60 * 60 * 1000);
|
|
707
720
|
}
|
|
708
721
|
listenClient(client, event, listener) {
|
|
722
|
+
const callback = listener;
|
|
723
|
+
listener = (...args) => {
|
|
724
|
+
if (this.client !== client || (this.lifecycle && this.lifecycle.state !== 'active'))
|
|
725
|
+
return;
|
|
726
|
+
callback(...args);
|
|
727
|
+
};
|
|
709
728
|
client.on(event, listener);
|
|
710
729
|
const listeners = this.clientListeners.get(client) ?? [];
|
|
711
730
|
listeners.push({ event, listener });
|
|
@@ -720,7 +739,11 @@ export class WecomChannel {
|
|
|
720
739
|
client.off(event, listener);
|
|
721
740
|
}
|
|
722
741
|
onMessage(handler) {
|
|
723
|
-
this.messageHandler =
|
|
742
|
+
this.messageHandler = async (event) => {
|
|
743
|
+
if (this.lifecycle && this.lifecycle.state !== 'active')
|
|
744
|
+
return;
|
|
745
|
+
await handler(event);
|
|
746
|
+
};
|
|
724
747
|
}
|
|
725
748
|
onProjectPathRequest(provider) {
|
|
726
749
|
this.projectPathProvider = provider;
|
|
@@ -782,6 +805,8 @@ export class WecomChannel {
|
|
|
782
805
|
async waitForAuthentication(client, timeoutMs) {
|
|
783
806
|
if (this.connectionState === 'authenticated')
|
|
784
807
|
return;
|
|
808
|
+
if (this.client !== client || this.lifecycle?.signal.aborted)
|
|
809
|
+
throw new Error('WeCom connection cancelled');
|
|
785
810
|
await new Promise((resolve, reject) => {
|
|
786
811
|
let settled = false;
|
|
787
812
|
const finish = (error) => {
|
|
@@ -792,6 +817,7 @@ export class WecomChannel {
|
|
|
792
817
|
client.off('authenticated', onAuthenticated);
|
|
793
818
|
client.off('error', onError);
|
|
794
819
|
client.off('disconnected', onDisconnected);
|
|
820
|
+
this.lifecycle?.signal.removeEventListener('abort', onAbort);
|
|
795
821
|
if (this.cancelAuthenticationWait === cancel)
|
|
796
822
|
this.cancelAuthenticationWait = undefined;
|
|
797
823
|
if (error)
|
|
@@ -800,6 +826,7 @@ export class WecomChannel {
|
|
|
800
826
|
resolve();
|
|
801
827
|
};
|
|
802
828
|
const cancel = (error) => finish(error);
|
|
829
|
+
const onAbort = () => cancel(new Error('WeCom connection cancelled'));
|
|
803
830
|
const onAuthenticated = () => finish();
|
|
804
831
|
const onError = (error) => {
|
|
805
832
|
if (isWecomAuthError(error))
|
|
@@ -813,7 +840,10 @@ export class WecomChannel {
|
|
|
813
840
|
client.on('error', onError);
|
|
814
841
|
client.on('disconnected', onDisconnected);
|
|
815
842
|
this.cancelAuthenticationWait = cancel;
|
|
816
|
-
|
|
843
|
+
this.lifecycle?.signal.addEventListener('abort', onAbort, { once: true });
|
|
844
|
+
if (this.lifecycle?.signal.aborted)
|
|
845
|
+
onAbort();
|
|
846
|
+
else if (this.connectionState === 'authenticated')
|
|
817
847
|
finish();
|
|
818
848
|
});
|
|
819
849
|
}
|
|
@@ -877,6 +907,13 @@ export class WecomChannel {
|
|
|
877
907
|
}
|
|
878
908
|
// ── Inbound message handling ──────────────────────────────────────────────
|
|
879
909
|
async handleIncoming(frame) {
|
|
910
|
+
const generation = this.connectionGeneration;
|
|
911
|
+
const isCurrent = () => generation === this.connectionGeneration
|
|
912
|
+
&& (!this.lifecycle || this.lifecycle.state === 'active');
|
|
913
|
+
const dispatchMessage = async (event) => {
|
|
914
|
+
if (isCurrent())
|
|
915
|
+
await this.messageHandler?.(event);
|
|
916
|
+
};
|
|
880
917
|
const body = frame?.body;
|
|
881
918
|
if (!body)
|
|
882
919
|
return;
|
|
@@ -904,14 +941,17 @@ export class WecomChannel {
|
|
|
904
941
|
if (!this.messageHandler)
|
|
905
942
|
return;
|
|
906
943
|
// 首次交互欢迎消息(使用共享帮助函数)
|
|
907
|
-
await sendWelcomeIfNeeded(this.welcomeManager, userid, channelId, (id, text) =>
|
|
944
|
+
await sendWelcomeIfNeeded(this.welcomeManager, userid, channelId, async (id, text) => { if (isCurrent())
|
|
945
|
+
await this.sendMessage(id, text); }, 'WeCom');
|
|
946
|
+
if (!isCurrent())
|
|
947
|
+
return;
|
|
908
948
|
if (msgtype === 'text') {
|
|
909
949
|
const text = body.text?.content?.trim();
|
|
910
950
|
if (!text)
|
|
911
951
|
return;
|
|
912
952
|
const quote = await this.processQuote(body.quote, channelId);
|
|
913
953
|
const content = quote.prefix ? `${quote.prefix}\n${text}` : text;
|
|
914
|
-
await
|
|
954
|
+
await dispatchMessage({
|
|
915
955
|
channelId, content, chatType: chatTypeNorm,
|
|
916
956
|
peerId: userid, messageId: msgId,
|
|
917
957
|
images: quote.images.length > 0 ? quote.images : undefined,
|
|
@@ -919,28 +959,28 @@ export class WecomChannel {
|
|
|
919
959
|
});
|
|
920
960
|
}
|
|
921
961
|
else if (msgtype === 'image') {
|
|
922
|
-
await this.handleImageMessage(body, channelId, chatTypeNorm, userid, msgId, replyContext);
|
|
962
|
+
await this.handleImageMessage(body, channelId, chatTypeNorm, userid, msgId, replyContext, dispatchMessage);
|
|
923
963
|
}
|
|
924
964
|
else if (msgtype === 'voice') {
|
|
925
965
|
const voiceText = body.voice?.content?.trim();
|
|
926
966
|
if (voiceText) {
|
|
927
|
-
await
|
|
967
|
+
await dispatchMessage({
|
|
928
968
|
channelId, content: voiceText, chatType: chatTypeNorm,
|
|
929
969
|
peerId: userid, messageId: msgId, replyContext,
|
|
930
970
|
});
|
|
931
971
|
}
|
|
932
972
|
}
|
|
933
973
|
else if (msgtype === 'file') {
|
|
934
|
-
await this.handleFileMessage(body, channelId, chatTypeNorm, userid, msgId, replyContext);
|
|
974
|
+
await this.handleFileMessage(body, channelId, chatTypeNorm, userid, msgId, replyContext, dispatchMessage);
|
|
935
975
|
}
|
|
936
976
|
else if (msgtype === 'video') {
|
|
937
|
-
await this.handleVideoMessage(body, channelId, chatTypeNorm, userid, msgId, replyContext);
|
|
977
|
+
await this.handleVideoMessage(body, channelId, chatTypeNorm, userid, msgId, replyContext, dispatchMessage);
|
|
938
978
|
}
|
|
939
979
|
else if (msgtype === 'mixed') {
|
|
940
|
-
await this.handleMixedMessage(body, channelId, chatTypeNorm, userid, msgId, replyContext);
|
|
980
|
+
await this.handleMixedMessage(body, channelId, chatTypeNorm, userid, msgId, replyContext, dispatchMessage);
|
|
941
981
|
}
|
|
942
982
|
else {
|
|
943
|
-
await
|
|
983
|
+
await dispatchMessage({
|
|
944
984
|
channelId,
|
|
945
985
|
content: `[不支持的消息类型: ${msgtype}]`,
|
|
946
986
|
chatType: chatTypeNorm, peerId: userid, messageId: msgId, replyContext,
|
|
@@ -1019,12 +1059,12 @@ export class WecomChannel {
|
|
|
1019
1059
|
}
|
|
1020
1060
|
return result;
|
|
1021
1061
|
}
|
|
1022
|
-
async handleImageMessage(body, channelId, chatType, peerId, msgId, replyContext) {
|
|
1062
|
+
async handleImageMessage(body, channelId, chatType, peerId, msgId, replyContext, dispatchMessage = this.messageHandler) {
|
|
1023
1063
|
const imageUrl = body.image?.url;
|
|
1024
1064
|
const aeskey = body.image?.aeskey;
|
|
1025
1065
|
if (!imageUrl) {
|
|
1026
1066
|
logger.warn('[WeCom] Image message without url');
|
|
1027
|
-
await
|
|
1067
|
+
await dispatchMessage({
|
|
1028
1068
|
channelId, content: '[图片下载失败:缺少下载链接]',
|
|
1029
1069
|
chatType, peerId, messageId: msgId, replyContext,
|
|
1030
1070
|
});
|
|
@@ -1034,7 +1074,7 @@ export class WecomChannel {
|
|
|
1034
1074
|
const media = await this.downloadInboundMedia(imageUrl, aeskey);
|
|
1035
1075
|
const image = await bufferToInboundImage(media.buffer, { filename: media.filename });
|
|
1036
1076
|
if (image) {
|
|
1037
|
-
await
|
|
1077
|
+
await dispatchMessage({
|
|
1038
1078
|
channelId,
|
|
1039
1079
|
content: '用户发送了一张图片,请分析这张图片的内容。',
|
|
1040
1080
|
chatType, peerId, messageId: msgId,
|
|
@@ -1043,7 +1083,7 @@ export class WecomChannel {
|
|
|
1043
1083
|
}
|
|
1044
1084
|
else {
|
|
1045
1085
|
logger.warn(`[WeCom] Image validation failed`);
|
|
1046
|
-
await
|
|
1086
|
+
await dispatchMessage({
|
|
1047
1087
|
channelId, content: '[图片验证失败]',
|
|
1048
1088
|
chatType, peerId, messageId: msgId, replyContext,
|
|
1049
1089
|
});
|
|
@@ -1051,13 +1091,13 @@ export class WecomChannel {
|
|
|
1051
1091
|
}
|
|
1052
1092
|
catch (error) {
|
|
1053
1093
|
logger.error('[WeCom] Failed to download image:', error);
|
|
1054
|
-
await
|
|
1094
|
+
await dispatchMessage({
|
|
1055
1095
|
channelId, content: '[图片下载失败]',
|
|
1056
1096
|
chatType, peerId, messageId: msgId, replyContext,
|
|
1057
1097
|
});
|
|
1058
1098
|
}
|
|
1059
1099
|
}
|
|
1060
|
-
async handleFileMessage(body, channelId, chatType, peerId, msgId, replyContext) {
|
|
1100
|
+
async handleFileMessage(body, channelId, chatType, peerId, msgId, replyContext, dispatchMessage = this.messageHandler) {
|
|
1061
1101
|
const fileUrl = body.file?.url;
|
|
1062
1102
|
const aeskey = body.file?.aeskey;
|
|
1063
1103
|
const callbackFileName = body.file?.filename
|
|
@@ -1066,7 +1106,7 @@ export class WecomChannel {
|
|
|
1066
1106
|
const displayFileName = callbackFileName || 'file';
|
|
1067
1107
|
if (!fileUrl) {
|
|
1068
1108
|
logger.warn('[WeCom] File message without url');
|
|
1069
|
-
await
|
|
1109
|
+
await dispatchMessage({
|
|
1070
1110
|
channelId, content: `[文件下载失败:缺少下载链接] ${displayFileName}`,
|
|
1071
1111
|
chatType, peerId, messageId: msgId, replyContext,
|
|
1072
1112
|
});
|
|
@@ -1079,7 +1119,7 @@ export class WecomChannel {
|
|
|
1079
1119
|
? await this.projectPathProvider(channelId)
|
|
1080
1120
|
: process.cwd();
|
|
1081
1121
|
const { filePath } = saveToUploads(media.buffer, fileName, projectPath);
|
|
1082
|
-
await
|
|
1122
|
+
await dispatchMessage({
|
|
1083
1123
|
channelId,
|
|
1084
1124
|
content: `用户发送了文件:${fileName}\n文件已保存到:${filePath}\n请使用 Read 工具读取并分析文件内容。`,
|
|
1085
1125
|
chatType, peerId, messageId: msgId, replyContext,
|
|
@@ -1087,17 +1127,17 @@ export class WecomChannel {
|
|
|
1087
1127
|
}
|
|
1088
1128
|
catch (error) {
|
|
1089
1129
|
logger.error('[WeCom] Failed to download file:', error);
|
|
1090
|
-
await
|
|
1130
|
+
await dispatchMessage({
|
|
1091
1131
|
channelId, content: `[文件下载失败] ${displayFileName}`,
|
|
1092
1132
|
chatType, peerId, messageId: msgId, replyContext,
|
|
1093
1133
|
});
|
|
1094
1134
|
}
|
|
1095
1135
|
}
|
|
1096
|
-
async handleVideoMessage(body, channelId, chatType, peerId, msgId, replyContext) {
|
|
1136
|
+
async handleVideoMessage(body, channelId, chatType, peerId, msgId, replyContext, dispatchMessage = this.messageHandler) {
|
|
1097
1137
|
const videoUrl = body.video?.url;
|
|
1098
1138
|
const aeskey = body.video?.aeskey;
|
|
1099
1139
|
if (!videoUrl) {
|
|
1100
|
-
await
|
|
1140
|
+
await dispatchMessage({
|
|
1101
1141
|
channelId, content: '[视频下载失败:缺少下载链接]',
|
|
1102
1142
|
chatType, peerId, messageId: msgId, replyContext,
|
|
1103
1143
|
});
|
|
@@ -1110,7 +1150,7 @@ export class WecomChannel {
|
|
|
1110
1150
|
: process.cwd();
|
|
1111
1151
|
const fileName = `video_${Date.now()}.mp4`;
|
|
1112
1152
|
const { filePath } = saveToUploads(media.buffer, fileName, projectPath);
|
|
1113
|
-
await
|
|
1153
|
+
await dispatchMessage({
|
|
1114
1154
|
channelId,
|
|
1115
1155
|
content: `用户发送了视频:${fileName}\n文件已保存到:${filePath}`,
|
|
1116
1156
|
chatType, peerId, messageId: msgId, replyContext,
|
|
@@ -1118,16 +1158,16 @@ export class WecomChannel {
|
|
|
1118
1158
|
}
|
|
1119
1159
|
catch (error) {
|
|
1120
1160
|
logger.error('[WeCom] Failed to download video:', error);
|
|
1121
|
-
await
|
|
1161
|
+
await dispatchMessage({
|
|
1122
1162
|
channelId, content: '[视频下载失败]',
|
|
1123
1163
|
chatType, peerId, messageId: msgId, replyContext,
|
|
1124
1164
|
});
|
|
1125
1165
|
}
|
|
1126
1166
|
}
|
|
1127
|
-
async handleMixedMessage(body, channelId, chatType, peerId, msgId, replyContext) {
|
|
1167
|
+
async handleMixedMessage(body, channelId, chatType, peerId, msgId, replyContext, dispatchMessage = this.messageHandler) {
|
|
1128
1168
|
const msgItems = body.mixed?.msg_item;
|
|
1129
1169
|
if (!Array.isArray(msgItems)) {
|
|
1130
|
-
await
|
|
1170
|
+
await dispatchMessage({
|
|
1131
1171
|
channelId, content: '[不支持的图文混排格式]',
|
|
1132
1172
|
chatType, peerId, messageId: msgId, replyContext,
|
|
1133
1173
|
});
|
|
@@ -1152,7 +1192,7 @@ export class WecomChannel {
|
|
|
1152
1192
|
}
|
|
1153
1193
|
}
|
|
1154
1194
|
const prompt = text.trim() || (images.length > 0 ? '用户发送了一张图片,请分析这张图片的内容。' : '[空消息]');
|
|
1155
|
-
await
|
|
1195
|
+
await dispatchMessage({
|
|
1156
1196
|
channelId, content: prompt, chatType,
|
|
1157
1197
|
peerId, messageId: msgId,
|
|
1158
1198
|
images: images.length > 0 ? images : undefined,
|
|
@@ -112,7 +112,7 @@ export async function cmdAgent(args) {
|
|
|
112
112
|
assertEcSingleLine(args[nameIndex + 1], '--name');
|
|
113
113
|
}
|
|
114
114
|
const formatJson = getArgValue(args, '--format') === 'json';
|
|
115
|
-
const commands = new Set(['list', 'show', 'new', 'initialize', 'enable', 'disable', 'get', 'set', '
|
|
115
|
+
const commands = new Set(['list', 'show', 'new', 'initialize', 'enable', 'disable', 'get', 'set', 'welcome', 'rename', 'ready', 'reload', 'delete', 'host']);
|
|
116
116
|
if (sub === 'create') {
|
|
117
117
|
const error = { ok: false, code: 'INVALID_COMMAND', error: '`ec agent create` is not a command; use `ec agent new`.' };
|
|
118
118
|
if (formatJson)
|
|
@@ -136,9 +136,6 @@ Commands:
|
|
|
136
136
|
disable <aid> 停用 agent
|
|
137
137
|
get <aid> <key> 读取单个配置字段(支持点路径)
|
|
138
138
|
set <aid> <key> <val> 修改单个配置字段(支持点路径)
|
|
139
|
-
persona show 查看当前 Agent 的 persona.md
|
|
140
|
-
persona --text <text> 用文本设置当前 Agent 的 persona.md
|
|
141
|
-
persona --file <path> 用 .md/.txt 文件设置当前 Agent 的 persona.md
|
|
142
139
|
welcome show 查看 Agent 自主准备的 Bootstrap welcome 文案
|
|
143
140
|
welcome --text <text> 保存 Agent 自主准备的 Bootstrap welcome 文案
|
|
144
141
|
rename <aid> <name> 修改 agent.md 中的显示名称
|
|
@@ -157,7 +154,6 @@ Options:
|
|
|
157
154
|
ec agent enable mybot.agentid.pub
|
|
158
155
|
ec agent get mybot.agentid.pub active_baseagent
|
|
159
156
|
ec agent set mybot.agentid.pub active_baseagent codex
|
|
160
|
-
ec agent persona --text "你是一名严谨的诊断工程师。"
|
|
161
157
|
ec agent rename mybot.agentid.pub "New Name"
|
|
162
158
|
ec agent ready mybot.agentid.pub
|
|
163
159
|
ec agent delete mybot.agentid.pub --purge`);
|
|
@@ -211,10 +207,10 @@ Options:
|
|
|
211
207
|
}
|
|
212
208
|
return;
|
|
213
209
|
}
|
|
214
|
-
const { agentList, agentShow, agentCreateNonInteractive, agentReload, agentEnable, agentDisable, agentGet, agentSet,
|
|
210
|
+
const { agentList, agentShow, agentCreateNonInteractive, agentReload, agentEnable, agentDisable, agentGet, agentSet, agentWelcome, agentRename, agentDelete, agentReady, runManagedAgentOperation, } = await import('./agent.js');
|
|
215
211
|
const { parseAgentOwnerArgs, parseAgentTags, resolveAgentCreatePlan, validateAgentCreatePlan } = await import('./agent-create.js');
|
|
216
212
|
// host 走 status.auth 授权(与 ec status 同门),不经过 agent.op 的子命令映射。
|
|
217
|
-
if (process.env.EVOLCORE_SESSION_ID && !wantsHelp(args) && !new Set(['get', 'set', '
|
|
213
|
+
if (process.env.EVOLCORE_SESSION_ID && !wantsHelp(args) && !new Set(['get', 'set', 'welcome', 'ready', 'host']).has(sub)) {
|
|
218
214
|
const result = await runManagedAgentOperation(args);
|
|
219
215
|
if (!result.ok) {
|
|
220
216
|
if (formatJson)
|
|
@@ -587,85 +583,6 @@ Options:
|
|
|
587
583
|
}
|
|
588
584
|
return;
|
|
589
585
|
}
|
|
590
|
-
// --- get ---
|
|
591
|
-
if (sub === 'persona') {
|
|
592
|
-
if (wantsHelp(args)) {
|
|
593
|
-
console.log(`用法: ec agent persona show [--format json]
|
|
594
|
-
ec agent persona --text <text> [--format json]
|
|
595
|
-
ec agent persona --file <path> [--format json]
|
|
596
|
-
|
|
597
|
-
读取或设置当前 Agent 的 persona.md。--file 只接受 .md/.txt 文本文件。`);
|
|
598
|
-
return;
|
|
599
|
-
}
|
|
600
|
-
const formatSuffix = args.length >= 3
|
|
601
|
-
&& args.at(-2) === '--format'
|
|
602
|
-
&& args.at(-1) === 'json';
|
|
603
|
-
const commandArgs = formatSuffix ? args.slice(0, -2) : args;
|
|
604
|
-
const personaArgs = commandArgs.slice(1);
|
|
605
|
-
const invalid = (error) => {
|
|
606
|
-
const result = { ok: false, code: 'INVALID_ARGS', error };
|
|
607
|
-
if (formatJson)
|
|
608
|
-
console.log(JSON.stringify(result));
|
|
609
|
-
else
|
|
610
|
-
console.error(`❌ ${result.error}`);
|
|
611
|
-
process.exitCode = 1;
|
|
612
|
-
return;
|
|
613
|
-
};
|
|
614
|
-
if (!formatSuffix && args.includes('--format')) {
|
|
615
|
-
invalid('persona 仅支持末尾的 --format json');
|
|
616
|
-
return;
|
|
617
|
-
}
|
|
618
|
-
let text;
|
|
619
|
-
let file;
|
|
620
|
-
if (personaArgs.length === 1 && personaArgs[0] === 'show') {
|
|
621
|
-
// show is the only read form; no payload is accepted.
|
|
622
|
-
}
|
|
623
|
-
else if (personaArgs.length === 2 && personaArgs[0] === '--text') {
|
|
624
|
-
text = personaArgs[1];
|
|
625
|
-
if (text === undefined) {
|
|
626
|
-
invalid('persona --text 缺少参数');
|
|
627
|
-
return;
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
else if (personaArgs.length === 2 && personaArgs[0] === '--file') {
|
|
631
|
-
file = personaArgs[1];
|
|
632
|
-
if (!file || file.startsWith('-')) {
|
|
633
|
-
invalid('persona --file 缺少有效路径');
|
|
634
|
-
return;
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
else {
|
|
638
|
-
invalid('用法: ec agent persona show | --text <text> | --file <path>');
|
|
639
|
-
return;
|
|
640
|
-
}
|
|
641
|
-
const taskAid = process.env.EVOLCORE_SESSION_ID ? (readTaskRuntimeContextFromEnv()?.selfAid || '') : '';
|
|
642
|
-
const aid = taskAid || process.env.EVOLCORE_SELF_AID || '';
|
|
643
|
-
if (!aid) {
|
|
644
|
-
const result = { ok: false, code: 'INVALID_ARGS', error: '无法确定当前 Agent AID' };
|
|
645
|
-
if (formatJson)
|
|
646
|
-
console.log(JSON.stringify(result));
|
|
647
|
-
else
|
|
648
|
-
console.error(`❌ ${result.error}`);
|
|
649
|
-
process.exitCode = 1;
|
|
650
|
-
return;
|
|
651
|
-
}
|
|
652
|
-
const result = await agentPersona(aid, { text, file, argv: args });
|
|
653
|
-
if (!result.ok) {
|
|
654
|
-
if (formatJson)
|
|
655
|
-
console.log(JSON.stringify(result));
|
|
656
|
-
else
|
|
657
|
-
console.error(`❌ ${result.error}`);
|
|
658
|
-
process.exitCode = 1;
|
|
659
|
-
return;
|
|
660
|
-
}
|
|
661
|
-
if (formatJson)
|
|
662
|
-
console.log(JSON.stringify(result, null, 2));
|
|
663
|
-
else if (result.saved)
|
|
664
|
-
console.log(`✓ ${aid} persona.md 已保存`);
|
|
665
|
-
else
|
|
666
|
-
console.log(result.content ?? '(persona.md 不存在)');
|
|
667
|
-
return;
|
|
668
|
-
}
|
|
669
586
|
if (sub === 'welcome') {
|
|
670
587
|
let text;
|
|
671
588
|
try {
|
package/dist/cli/agent-create.js
CHANGED
|
@@ -3,13 +3,14 @@ import { randomBytes, randomUUID, createHash } from 'crypto';
|
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import readline from 'readline';
|
|
5
5
|
import { parse } from 'yaml';
|
|
6
|
-
import { resolvePaths, aunPath as defaultAunPath, agentConfig, agentDataDir,
|
|
6
|
+
import { resolvePaths, aunPath as defaultAunPath, agentConfig, agentDataDir, agentSoulDir, SOUL_PERSONA_FILE, aidLocalDir, agentMdPath } from '../paths.js';
|
|
7
7
|
import { loadDefaults, loadAgent, saveAgent, ensureAgentDirSkeleton } from '../config-store.js';
|
|
8
8
|
import { ConfigTarget, assertAgentAidAvailable, write as cfgWrite, ensureFile as cfgEnsure, read as cfgRead } from '../config/config-manager.js';
|
|
9
9
|
import { daemonUnavailableMessage, queryDaemon } from './help.js';
|
|
10
10
|
import { ipcQuery } from '../ipc.js';
|
|
11
11
|
import { CONFIG_SCHEMA_VERSION } from '../types.js';
|
|
12
12
|
import { ensureInitialRoleRegistry } from '../config/role-service.js';
|
|
13
|
+
import { isSoulPlaceholder } from '../core/soul.js';
|
|
13
14
|
import { getCodexAppServerAvailability } from '../agents/codex-runner.js';
|
|
14
15
|
import { AUTO_BASEAGENT_CANDIDATES, BASEAGENT_CANDIDATES, detectAvailableBaseagents, } from '../agents/baseagent-availability.js';
|
|
15
16
|
import { agentProjectRootFromDefaults, deriveAgentProjectPath } from '../utils/project-path.js';
|
|
@@ -237,6 +238,19 @@ function saveInitialBehavior(aid, baseagent) {
|
|
|
237
238
|
};
|
|
238
239
|
const sel = { self: aid };
|
|
239
240
|
const existingBehavior = cfgRead(ConfigTarget.Agent, sel) || {};
|
|
241
|
+
// 新建 Agent 默认开启 app-v1 联系人准入:陌生人纯文本转成 friend.request.v1
|
|
242
|
+
// 交 Owner 审核,而不是静默丢弃。已有的 access 策略(含 --force 重建)原样保留。
|
|
243
|
+
if (!existingBehavior.access) {
|
|
244
|
+
behavior.access = {
|
|
245
|
+
contactAdmission: 'app-v1',
|
|
246
|
+
allowInternalContacts: true,
|
|
247
|
+
allowExternalContacts: false,
|
|
248
|
+
allowAllContacts: false,
|
|
249
|
+
allowedAids: [],
|
|
250
|
+
deniedAids: [],
|
|
251
|
+
requestLimit: { maxTimes: 600, coolDown: 60 * 60 },
|
|
252
|
+
};
|
|
253
|
+
}
|
|
240
254
|
cfgEnsure(ConfigTarget.Agent, sel);
|
|
241
255
|
cfgWrite(ConfigTarget.Agent, { ...existingBehavior, ...behavior }, sel);
|
|
242
256
|
}
|
|
@@ -1093,8 +1107,8 @@ export function validateInitializationPlan(plan) {
|
|
|
1093
1107
|
if (plan.chatmode !== undefined) {
|
|
1094
1108
|
if (!plan.chatmode || typeof plan.chatmode !== 'object' || Array.isArray(plan.chatmode)
|
|
1095
1109
|
|| Object.entries(plan.chatmode).some(([scope, value]) => !['private', 'group', 'nothuman'].includes(scope)
|
|
1096
|
-
|| !['interactive', 'proactive'].includes(value))) {
|
|
1097
|
-
failure('INVALID_ARGS', 'chatmode must contain
|
|
1110
|
+
|| !['interactive', 'proactive', ...(scope === 'private' ? ['paactive'] : [])].includes(value))) {
|
|
1111
|
+
failure('INVALID_ARGS', 'chatmode must contain private/group/nothuman values; paactive is private AUN only');
|
|
1098
1112
|
}
|
|
1099
1113
|
}
|
|
1100
1114
|
if (plan.avatarFile !== undefined && plan.avatarUrl !== undefined)
|
|
@@ -1756,8 +1770,10 @@ export class AgentInitializationService {
|
|
|
1756
1770
|
ensureAgentDirSkeleton(p.aid);
|
|
1757
1771
|
ensureInitialRoleRegistry(p.aid);
|
|
1758
1772
|
if (p.persona !== undefined) {
|
|
1759
|
-
|
|
1760
|
-
|
|
1773
|
+
// 创建时给的 persona 落进 soul 的性格分册,未填写的骨架允许替换。
|
|
1774
|
+
const file = path.join(agentSoulDir(p.aid), SOUL_PERSONA_FILE);
|
|
1775
|
+
const current = fs.existsSync(file) ? fs.readFileSync(file, 'utf8') : '';
|
|
1776
|
+
if (current !== p.persona && !isSoulPlaceholder(SOUL_PERSONA_FILE, current))
|
|
1761
1777
|
failure('INITIALIZE_PLAN_CONFLICT');
|
|
1762
1778
|
fs.writeFileSync(file, p.persona, { encoding: 'utf8', mode: 0o600 });
|
|
1763
1779
|
}
|
|
@@ -1889,7 +1905,7 @@ export class AgentInitializationService {
|
|
|
1889
1905
|
saveInitialization(r);
|
|
1890
1906
|
}
|
|
1891
1907
|
this.phase(r, 'activating');
|
|
1892
|
-
if (p.persona !== undefined && fs.readFileSync(path.join(
|
|
1908
|
+
if (p.persona !== undefined && fs.readFileSync(path.join(agentSoulDir(p.aid), SOUL_PERSONA_FILE), 'utf8') !== p.persona) {
|
|
1893
1909
|
failure('INITIALIZE_PLAN_CONFLICT');
|
|
1894
1910
|
}
|
|
1895
1911
|
r.activationPrepared = true;
|
package/dist/cli/agent.js
CHANGED
|
@@ -2,7 +2,7 @@ import fs from 'fs';
|
|
|
2
2
|
import { getOwners } from '../core/ownership/owner-resolver.js';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import { SESSION_ID_ENV } from '../product.js';
|
|
5
|
-
import { resolvePaths, agentMdPath as getAgentMdPathFromPaths,
|
|
5
|
+
import { resolvePaths, agentMdPath as getAgentMdPathFromPaths, agentWelcomePath, aunPath as defaultAunPath } from '../paths.js';
|
|
6
6
|
import { loadDefaults, loadAllAgents, loadAgent, saveAgent, ensureAgentDirSkeleton } from '../config-store.js';
|
|
7
7
|
import { assertAgentAidAvailable, assertAgentModelConfigured, resolveEffective, initConfigManager } from '../config/config-manager.js';
|
|
8
8
|
import { resolveRuntimeBaseagentModelSelection } from '../agents/baseagent.js';
|
|
@@ -510,84 +510,6 @@ export async function agentSet(aid, key, rawValue, options = {}) {
|
|
|
510
510
|
catch { }
|
|
511
511
|
return { ok: true, aid, key, value, reloaded };
|
|
512
512
|
}
|
|
513
|
-
export const AGENT_PERSONA_MAX_BYTES = 64 * 1024;
|
|
514
|
-
export function validatePersonaContent(content) {
|
|
515
|
-
if (content.includes('\0'))
|
|
516
|
-
return 'persona 只能包含文本内容';
|
|
517
|
-
if (Buffer.byteLength(content, 'utf8') > AGENT_PERSONA_MAX_BYTES) {
|
|
518
|
-
return `persona 不能超过 ${AGENT_PERSONA_MAX_BYTES} bytes`;
|
|
519
|
-
}
|
|
520
|
-
return null;
|
|
521
|
-
}
|
|
522
|
-
function readPersonaSource(file) {
|
|
523
|
-
const resolved = path.resolve(file);
|
|
524
|
-
if (!/\.(?:md|txt)$/i.test(resolved)) {
|
|
525
|
-
return { ok: false, code: 'INVALID_ARGS', error: '--file 只接受 .md 或 .txt 文本文件' };
|
|
526
|
-
}
|
|
527
|
-
try {
|
|
528
|
-
const stat = fs.statSync(resolved);
|
|
529
|
-
if (!stat.isFile())
|
|
530
|
-
return { ok: false, code: 'INVALID_ARGS', error: `--file 必须指向普通文件: ${resolved}` };
|
|
531
|
-
const content = fs.readFileSync(resolved, 'utf8');
|
|
532
|
-
const error = validatePersonaContent(content);
|
|
533
|
-
return error ? { ok: false, code: 'INVALID_ARGS', error } : { ok: true, content };
|
|
534
|
-
}
|
|
535
|
-
catch (e) {
|
|
536
|
-
return { ok: false, code: 'READ_FAILED', error: `无法读取 --file: ${e?.message || e}` };
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
/** Read or replace the current Agent's personal/persona.md. */
|
|
540
|
-
export async function agentPersona(aid, options = {}) {
|
|
541
|
-
try {
|
|
542
|
-
assertAgentAidAvailable(aid);
|
|
543
|
-
}
|
|
544
|
-
catch (error) {
|
|
545
|
-
return { ok: false, code: 'CONTROL_AID_RESERVED', error: error.message };
|
|
546
|
-
}
|
|
547
|
-
if (options.text !== undefined && options.file !== undefined)
|
|
548
|
-
return { ok: false, code: 'INVALID_ARGS', error: '--text 与 --file 不能同时使用' };
|
|
549
|
-
const managedSession = !!process.env.EVOLCORE_SESSION_ID && !options.trustedLocal;
|
|
550
|
-
let text = options.text;
|
|
551
|
-
if (options.file !== undefined && !managedSession) {
|
|
552
|
-
const source = readPersonaSource(options.file);
|
|
553
|
-
if (!source.ok)
|
|
554
|
-
return source;
|
|
555
|
-
text = source.content;
|
|
556
|
-
}
|
|
557
|
-
if (text !== undefined) {
|
|
558
|
-
const error = validatePersonaContent(text);
|
|
559
|
-
if (error)
|
|
560
|
-
return { ok: false, code: 'INVALID_ARGS', error };
|
|
561
|
-
}
|
|
562
|
-
const managedArgs = options.text !== undefined
|
|
563
|
-
? ['persona', '--text', text]
|
|
564
|
-
: options.file !== undefined
|
|
565
|
-
? ['persona', '--file', options.file]
|
|
566
|
-
: ['persona', 'show'];
|
|
567
|
-
if (managedSession) {
|
|
568
|
-
const managed = await runManagedAgentOperation(options.argv ?? managedArgs);
|
|
569
|
-
if (!managed.ok)
|
|
570
|
-
return managed;
|
|
571
|
-
return { ok: true, aid, content: managed.content ?? null, ...(managed.path ? { path: managed.path } : {}), ...(managed.saved ? { saved: true } : {}) };
|
|
572
|
-
}
|
|
573
|
-
const personaPath = path.join(agentPersonalDir(aid), 'persona.md');
|
|
574
|
-
if (text === undefined) {
|
|
575
|
-
try {
|
|
576
|
-
return { ok: true, aid, content: fs.existsSync(personaPath) ? fs.readFileSync(personaPath, 'utf8') : null, path: personaPath };
|
|
577
|
-
}
|
|
578
|
-
catch (e) {
|
|
579
|
-
return { ok: false, code: 'READ_FAILED', error: e?.message || String(e) };
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
try {
|
|
583
|
-
fs.mkdirSync(path.dirname(personaPath), { recursive: true });
|
|
584
|
-
fs.writeFileSync(personaPath, text, 'utf8');
|
|
585
|
-
return { ok: true, aid, content: text, path: personaPath, saved: true };
|
|
586
|
-
}
|
|
587
|
-
catch (e) {
|
|
588
|
-
return { ok: false, code: 'WRITE_FAILED', error: e?.message || String(e) };
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
513
|
/** Read or replace the current Agent's self-prepared Bootstrap welcome template. */
|
|
592
514
|
export async function agentWelcome(aid, options = {}) {
|
|
593
515
|
try {
|
package/dist/cli/aun-commands.js
CHANGED
|
@@ -3565,6 +3565,7 @@ async function runManagedSend(argv, formatJson) {
|
|
|
3565
3565
|
...(typeof result.detail_code === 'string' ? { detail_code: result.detail_code } : {}),
|
|
3566
3566
|
...(typeof result.retryable === 'boolean' ? { retryable: result.retryable } : {}),
|
|
3567
3567
|
...(typeof result.sent === 'boolean' ? { sent: result.sent } : {}),
|
|
3568
|
+
...(result.contact_request ? { contact_request: result.contact_request } : {}),
|
|
3568
3569
|
});
|
|
3569
3570
|
if (formatJson)
|
|
3570
3571
|
console.log(JSON.stringify(result));
|
package/dist/cli/config.js
CHANGED
|
@@ -202,7 +202,7 @@ async function runManagedBatchGet(fields, rest, formatJson) {
|
|
|
202
202
|
}
|
|
203
203
|
renderConfigExecution(response.result, formatJson);
|
|
204
204
|
}
|
|
205
|
-
const HELP =
|
|
205
|
+
const HELP = `用法: ec config <command> [options]
|
|
206
206
|
|
|
207
207
|
Fields:
|
|
208
208
|
get <field> [<field> ...] one or more fields (batch)
|