evolcore 0.0.43-test.1 → 0.0.43-test.3
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 -1
- 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 +39 -15
- package/dist/agents/gemini-runner.js +15 -12
- package/dist/agents/tool-time-context.js +55 -0
- package/dist/aun/aid/agentmd.js +21 -1
- package/dist/aun/menu/client.js +1 -1
- package/dist/aun/model-headers.js +17 -0
- package/dist/aun/msg/p2p.js +7 -2
- package/dist/channels/aun.js +522 -50
- package/dist/channels/builtin-plugins.js +16 -11
- package/dist/channels/daemon.js +4 -0
- 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 +20 -6
- package/dist/cli/agent.js +1 -79
- package/dist/cli/aun-commands.js +18 -19
- 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 +149 -91
- 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 +3 -2
- 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/task-context.js +3 -1
- package/dist/cli/thread-command.js +1 -1
- package/dist/cli/watch-msg.js +1 -1
- package/dist/config/builtin-role-templates.js +2 -2
- package/dist/config/builtin-roles.js +2 -1
- package/dist/config/config-field-policy.js +7 -2
- package/dist/config/config-manager.js +32 -10
- package/dist/config/peer-role-resolver.js +23 -1
- package/dist/config/role-schema.js +29 -4
- package/dist/config/role-service.js +12 -7
- package/dist/config/role-store.js +30 -8
- package/dist/config-store.js +75 -4
- package/dist/core/agent-ipc-registration.js +16 -59
- package/dist/core/auth/auth-gateway.js +14 -4
- package/dist/core/auth/authorization-audit.js +52 -14
- package/dist/core/auth/operation-authorizer.js +17 -11
- package/dist/core/auth/operation-catalog.js +5 -13
- package/dist/core/channel-loader.js +152 -16
- package/dist/core/channel-runtime.js +5 -0
- package/dist/core/command/agent-control.js +2 -1
- package/dist/core/command/agentmd-menu-request.js +50 -0
- package/dist/core/command/agentmd-menu.js +156 -0
- package/dist/core/command/cli-intent-parser.js +0 -8
- package/dist/core/command/command-handler.js +47 -40
- package/dist/core/command/connect-menu.js +7 -3
- package/dist/core/command/menu-catalog.js +16 -2
- package/dist/core/command/menu-handler.js +107 -14
- package/dist/core/command/menu-protocol.js +28 -0
- package/dist/core/command/role-menu.js +23 -9
- package/dist/core/command/slash-handler.js +139 -51
- package/dist/core/daemon-file-cache.js +3 -3
- package/dist/core/daemon-lifecycle.js +9 -1
- package/dist/core/evolagent-registry.js +5 -4
- package/dist/core/evolagent.js +10 -12
- 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/lifecycle-notice.js +185 -0
- 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 +35 -2
- package/dist/core/message/contact-admission.js +530 -0
- package/dist/core/message/im-renderer.js +111 -16
- package/dist/core/message/message-admission.js +29 -54
- package/dist/core/message/message-bridge.js +62 -8
- package/dist/core/message/message-utils.js +9 -5
- package/dist/core/message/peer-mode.js +55 -13
- package/dist/core/message/response-engine.js +298 -78
- package/dist/core/message/retry-scheduler.js +4 -0
- package/dist/core/ownership/owner-resolver.js +72 -34
- package/dist/core/permission/ec-command-parser.js +25 -38
- package/dist/core/permission/readonly-shell-query.js +34 -8
- package/dist/core/permission/tool-policy.js +50 -5
- package/dist/core/relation/pa-team.js +127 -0
- package/dist/core/role/runtime-policy.js +18 -5
- 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/core/thread/thread-service.js +6 -4
- package/dist/directory/contact-admission-paths.js +9 -0
- package/dist/directory/owner-directory-admission.js +125 -29
- package/dist/directory/owner-directory-cache.js +554 -58
- package/dist/directory/owner-directory-identity.js +60 -0
- package/dist/directory/owner-directory-markdown.js +154 -58
- package/dist/directory/owner-directory-policy.js +108 -0
- package/dist/directory/owner-directory-query-operation.js +399 -90
- package/dist/directory/owner-directory-remarks.js +29 -2
- package/dist/directory/owner-directory-request-operation.js +76 -0
- package/dist/directory/owner-directory-scope.js +35 -4
- package/dist/directory/owner-directory-search.js +118 -33
- package/dist/directory/owner-directory-store.js +117 -30
- package/dist/directory/owner-directory-text.js +60 -0
- package/dist/eck/kit-renderer.js +18 -8
- package/dist/eck/manifest-engine.js +55 -6
- package/dist/ecweb/basic-settings-service.js +2 -2
- package/dist/ecweb/message-context-service.js +28 -16
- package/dist/index.js +20 -5
- package/dist/ipc.js +1 -1
- package/dist/paths.js +29 -1
- package/dist/product.js +1 -0
- package/dist/response-system/config-resolver.js +1 -1
- package/dist/response-system/engines/v1/index.js +2 -1
- package/dist/response-system/modes/single-session/index.js +7 -2
- package/dist/trigger/scheduler.js +7 -4
- package/dist/trigger/validation.js +4 -0
- package/dist/utils/error-utils.js +12 -7
- 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/README.md +18 -0
- package/ecagent/dist/agent-loop.js +43 -1
- package/ecagent/dist/harness/agent-harness.d.ts +2 -0
- package/ecagent/dist/harness/agent-harness.js +24 -8
- package/ecagent/dist/harness/compaction/compaction.js +3 -0
- package/ecagent/dist/harness/types.d.ts +1 -0
- package/kits/docs/INDEX.md +1 -0
- package/kits/docs/channels/aun.md +1 -1
- package/kits/docs/context-assembly.md +21 -6
- package/kits/docs/eck_templates/INDEX.template.md +1 -2
- package/kits/docs/evolcore/INDEX.md +4 -1
- package/kits/docs/evolcore/agent-create.md +5 -5
- package/kits/docs/evolcore/agent.md +4 -9
- package/kits/docs/evolcore/directory.md +227 -0
- package/kits/docs/evolcore/ecweb-lifecycle.md +26 -0
- package/kits/docs/evolcore/file-navigation.md +265 -0
- package/kits/docs/evolcore/menu-protocol.md +55 -0
- package/kits/docs/evolcore/msg.md +1 -0
- package/kits/docs/evolcore/peer.md +2 -1
- package/kits/docs/evolcore/response.md +7 -1
- package/kits/docs/evolcore/task.md +2 -0
- package/kits/docs/evolcore/tool-authorization.md +1 -1
- package/kits/docs/evolcore/trigger.md +4 -0
- package/kits/docs/identity/ROLE_DETAIL.md +2 -0
- package/kits/docs/prompt-loading-architecture.md +6 -2
- package/kits/eck_manifest.auxiliary.json +1 -0
- package/kits/eck_manifest.json +64 -7
- package/kits/eck_manifest.memory.json +93 -4
- 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 +44 -3
- package/kits/schemas/agent-config.schema.18.json +5 -0
- package/kits/schemas/agent-config.schema.19.json +924 -0
- package/kits/schemas/agent-config.schema.20.json +925 -0
- package/kits/schemas/relation-config.schema.12.json +289 -0
- package/kits/schemas/relation-config.schema.13.json +289 -0
- package/kits/schemas/role-config.schema.2.json +215 -0
- package/kits/schemas/role-config.schema.3.json +1038 -0
- package/kits/schemas/role-registry.schema.1.json +3 -2
- 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/soul/00-GUIDE.md +39 -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/channel.md +2 -2
- 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/personal-assistant.md +50 -0
- package/kits/templates/system-fragments/reply.md +7 -0
- package/kits/templates/system-fragments/session.md +6 -2
- package/package.json +3 -2
- 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
|
@@ -2,28 +2,69 @@ import { loadSchema } from '../../config/schema-registry.js';
|
|
|
2
2
|
import { resolveEffective } from '../../config/config-manager.js';
|
|
3
3
|
import { resolveRuntimeStringField } from '../role/runtime-policy.js';
|
|
4
4
|
import { isManagementRole } from '../../config/builtin-roles.js';
|
|
5
|
+
import { resolveAgentLifecycle } from '../../config/lifecycle.js';
|
|
6
|
+
export const CHAT_MODES = ['interactive', 'proactive', 'paactive'];
|
|
7
|
+
export function isChatMode(value) {
|
|
8
|
+
return CHAT_MODES.includes(value);
|
|
9
|
+
}
|
|
10
|
+
/** PA output is supported only in active AUN human Owner conversations. */
|
|
11
|
+
export function supportsPaactive(params) {
|
|
12
|
+
const channelType = params.channelType ?? params.peerKey?.split('#')[0];
|
|
13
|
+
return channelType === 'aun'
|
|
14
|
+
&& params.chatType === 'private'
|
|
15
|
+
&& normalizePeerType(params.peerType) === 'human'
|
|
16
|
+
&& params.role === 'owner'
|
|
17
|
+
&& (params.lifecycle === undefined || params.lifecycle === 'active')
|
|
18
|
+
&& (params.sessionType === undefined || params.sessionType === 'main');
|
|
19
|
+
}
|
|
20
|
+
/** Keep unsupported inherited PA settings from becoming output-as-reply mode. */
|
|
21
|
+
export function chatModeForScene(value, params) {
|
|
22
|
+
if (params.chatType === 'group' || normalizePeerType(params.peerType) === 'group')
|
|
23
|
+
return 'proactive';
|
|
24
|
+
if (value === 'paactive' && supportsPaactive(params))
|
|
25
|
+
return value;
|
|
26
|
+
if (value === 'interactive' || value === 'proactive')
|
|
27
|
+
return value;
|
|
28
|
+
if (value === 'paactive') {
|
|
29
|
+
const kind = normalizePeerType(params.peerType);
|
|
30
|
+
if (kind === 'system' || kind === 'service')
|
|
31
|
+
return 'interactive';
|
|
32
|
+
if (kind === 'agent'
|
|
33
|
+
|| isPrivateChatmodeRoleLocked(chatmodeFieldForPeer(params.chatType, params.peerType), params.role))
|
|
34
|
+
return 'proactive';
|
|
35
|
+
}
|
|
36
|
+
const fallback = chatmodeFactoryDefaults()[chatmodeFieldForPeer(params.chatType, params.peerType)];
|
|
37
|
+
return fallback === 'paactive' ? 'interactive' : fallback;
|
|
38
|
+
}
|
|
5
39
|
/** Resolve the effective chat mode from the ConfigManager layering context. */
|
|
6
40
|
export function resolveChatMode(params) {
|
|
7
41
|
let configured;
|
|
42
|
+
let lifecycle = params.lifecycle;
|
|
8
43
|
try {
|
|
9
|
-
|
|
44
|
+
const effective = resolveEffective({
|
|
10
45
|
self: params.self,
|
|
11
46
|
peerKey: params.peerKey,
|
|
12
|
-
}, { cache: true })
|
|
47
|
+
}, { cache: true });
|
|
48
|
+
configured = effective.chatmode;
|
|
49
|
+
if (lifecycle === undefined)
|
|
50
|
+
lifecycle = resolveAgentLifecycle(effective);
|
|
13
51
|
}
|
|
14
52
|
catch {
|
|
15
53
|
configured = undefined;
|
|
16
54
|
}
|
|
17
55
|
const kind = normalizePeerType(params.peerType);
|
|
56
|
+
// Group conversations always use proactive delivery; interactive and
|
|
57
|
+
// paactive are private-chat presentation modes.
|
|
58
|
+
if (params.chatType === 'group' || kind === 'group')
|
|
59
|
+
return 'proactive';
|
|
18
60
|
// 运行时硬约束(非配置项):system/service 始终 interactive;agent 始终 proactive
|
|
19
61
|
if (kind === 'system' || kind === 'service')
|
|
20
62
|
return 'interactive';
|
|
21
63
|
if (kind === 'agent')
|
|
22
64
|
return 'proactive';
|
|
23
65
|
const field = chatmodeFieldForPeer(params.chatType, params.peerType);
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
// 关系级或 agent 级把 chatmode.private 写成 interactive 都不生效。
|
|
66
|
+
// 人类私聊的基础角色门槛:owner/admin 才解析分层配置;
|
|
67
|
+
// paactive 另由 supportsPaactive 限定为 owner,其余角色直接 proactive。
|
|
27
68
|
if (isPrivateChatmodeRoleLocked(field, params.role))
|
|
28
69
|
return 'proactive';
|
|
29
70
|
const decision = resolveRuntimeStringField({
|
|
@@ -33,13 +74,11 @@ export function resolveChatMode(params) {
|
|
|
33
74
|
configuredValue: configured?.[field],
|
|
34
75
|
});
|
|
35
76
|
const effectiveValue = decision.effectiveValue;
|
|
36
|
-
return effectiveValue
|
|
37
|
-
? effectiveValue
|
|
38
|
-
: chatmodeFactoryDefaults()[field];
|
|
77
|
+
return chatModeForScene(effectiveValue, { ...params, lifecycle });
|
|
39
78
|
}
|
|
40
79
|
/**
|
|
41
80
|
* 人类私聊(chatmode.private)是否被角色锁定为 proactive。
|
|
42
|
-
* owner/admin
|
|
81
|
+
* interactive 需要 owner/admin;paactive 在此基础上另由 supportsPaactive 限定为 owner。
|
|
43
82
|
*/
|
|
44
83
|
export function isPrivateChatmodeRoleLocked(field, role) {
|
|
45
84
|
return field === 'private' && !isManagementRole(role);
|
|
@@ -66,6 +105,7 @@ export function resolveChatModeForField(params) {
|
|
|
66
105
|
...params,
|
|
67
106
|
chatType: params.field === 'group' ? 'group' : 'private',
|
|
68
107
|
peerType: params.field === 'nothuman' ? 'agent' : 'human',
|
|
108
|
+
channelType: params.channelType ?? params.peerKey?.split('#')[0] ?? 'aun',
|
|
69
109
|
});
|
|
70
110
|
}
|
|
71
111
|
export function normalizePeerType(value) {
|
|
@@ -93,7 +133,7 @@ export function isSystemOrServicePeer(peerType) {
|
|
|
93
133
|
}
|
|
94
134
|
/**
|
|
95
135
|
* 解析某会话对端的 chatMode。优先级(高→低):
|
|
96
|
-
* 1.
|
|
136
|
+
* 1. 群聊固定 proactive;私聊 system/service 对端始终 interactive(非配置项)
|
|
97
137
|
* 2. 合并后的 chatmode 场景表 `configured`(chatmode.{private|group|nothuman})——
|
|
98
138
|
* 关系级与 agent 级同名字典,已由 ConfigManager 按 x-merge:dict 逐键合并
|
|
99
139
|
* 3. schema 出厂默认表 `chatmodeFactoryDefaults()`
|
|
@@ -103,6 +143,8 @@ export function isSystemOrServicePeer(peerType) {
|
|
|
103
143
|
*/
|
|
104
144
|
export function resolveChatModeForPeer(params) {
|
|
105
145
|
const kind = normalizePeerType(params.peerType);
|
|
146
|
+
if (params.chatType === 'group' || kind === 'group')
|
|
147
|
+
return 'proactive';
|
|
106
148
|
// 运行时硬约束(非配置项):system/service 对端始终同步交互;agent 对端始终主动响应
|
|
107
149
|
if (kind === 'system' || kind === 'service')
|
|
108
150
|
return 'interactive';
|
|
@@ -110,7 +152,7 @@ export function resolveChatModeForPeer(params) {
|
|
|
110
152
|
return 'proactive';
|
|
111
153
|
// 合并后的场景表 → 出厂默认表
|
|
112
154
|
const field = chatmodeFieldForPeer(params.chatType, params.peerType);
|
|
113
|
-
return params.configured?.[field]
|
|
155
|
+
return chatModeForScene(params.configured?.[field], params);
|
|
114
156
|
}
|
|
115
157
|
/**
|
|
116
158
|
* chatMode 出厂默认表 —— 唯一来源是 agent-config schema 的 chatmode.default
|
|
@@ -129,10 +171,10 @@ export function chatmodeFactoryDefaults() {
|
|
|
129
171
|
}
|
|
130
172
|
export function chatmodeFieldForPeer(chatType, peerType) {
|
|
131
173
|
const kind = normalizePeerType(peerType);
|
|
132
|
-
if (kind === 'system' || kind === 'service')
|
|
133
|
-
return 'private';
|
|
134
174
|
if (chatType === 'group' || kind === 'group')
|
|
135
175
|
return 'group';
|
|
176
|
+
if (kind === 'system' || kind === 'service')
|
|
177
|
+
return 'private';
|
|
136
178
|
if (kind === 'agent' || kind === 'unknown')
|
|
137
179
|
return 'nothuman';
|
|
138
180
|
return 'private';
|