evolcore 0.0.35 → 0.0.37
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 +42 -0
- package/README.md +6 -0
- package/bin/install-codex-managed-hooks.mjs +20 -3
- package/dist/agents/baseagent-availability.js +1 -1
- package/dist/agents/baseagent.js +88 -0
- package/dist/agents/claude-runner.js +59 -12
- package/dist/agents/codex/app-server-client.js +18 -1
- package/dist/agents/codex-runner.js +262 -21
- package/dist/agents/ecagent-runner.js +47 -11
- package/dist/agents/gemini-runner.js +36 -12
- package/dist/aun/aid/client.js +4 -3
- package/dist/aun/aid/control-aid.js +270 -8
- package/dist/aun/aid/identity.js +6 -3
- package/dist/aun/aid/ownership-operation.js +58 -0
- package/dist/aun/aid/store.js +1 -0
- package/dist/aun/group/fs-download.js +67 -2
- package/dist/aun/group/history.js +20 -5
- package/dist/aun/group/operations.js +8 -2
- package/dist/aun/menu/client.js +39 -2
- package/dist/aun/menu/transport.js +1 -1
- package/dist/aun/msg/history.js +43 -4
- package/dist/aun/msg/managed-operation.js +30 -53
- package/dist/aun/msg/p2p.js +51 -15
- package/dist/aun/outbox.js +4 -0
- package/dist/channels/aun.js +260 -73
- package/dist/channels/daemon.js +6 -4
- package/dist/channels/feishu.js +3 -0
- package/dist/cli/agent-command.js +161 -223
- package/dist/cli/agent-create.js +190 -223
- package/dist/cli/agent.js +3 -1
- package/dist/cli/aid-bind-command.js +53 -0
- package/dist/cli/aun-commands.js +384 -91
- package/dist/cli/bench.js +1 -1
- package/dist/cli/cli-argv.js +74 -0
- package/dist/cli/daemon-commands.js +105 -74
- package/dist/cli/diag.js +1 -1
- package/dist/cli/fs-command.js +18 -19
- package/dist/cli/getmeta-command.js +159 -6
- package/dist/cli/index.js +6 -12
- package/dist/cli/init-channel.js +8 -55
- package/dist/cli/init.js +125 -218
- package/dist/cli/queue-command.js +11 -8
- package/dist/cli/restart-monitor.js +177 -85
- package/dist/cli/session-command.js +1 -1
- package/dist/cli/stats.js +7 -5
- package/dist/cli/thread-command.js +103 -30
- package/dist/cli/trigger-command.js +1 -1
- package/dist/cli/watch-msg-diag.js +1 -0
- package/dist/config/access-policy.js +2 -2
- package/dist/config/boot-log.js +14 -11
- package/dist/config/config-field-policy.js +9 -1
- package/dist/config/config-manager.js +176 -90
- package/dist/config/config-operation-service.js +7 -14
- package/dist/config/contact-book-store.js +142 -26
- package/dist/config/contact-book.js +4 -2
- package/dist/config/lifecycle.js +1 -1
- package/dist/config/owner-config.js +96 -0
- package/dist/config/peer-role-resolver.js +12 -18
- package/dist/config/providers-config.js +382 -0
- package/dist/config/providers-import.js +74 -0
- package/dist/config/providers-management.js +328 -0
- package/dist/config/providers.js +22 -0
- package/dist/config/resolved-config-op.js +17 -14
- package/dist/config/snapshot.js +28 -16
- package/dist/config-store.js +18 -14
- package/dist/core/agent-ipc-registration.js +21 -63
- package/dist/core/agent-runtime.js +16 -5
- package/dist/core/auth/agent-delegation.js +199 -25
- package/dist/core/auth/auth-gateway.js +44 -2
- package/dist/core/auth/authorization-denial.js +1 -1
- package/dist/core/auth/debug-context.js +2 -1
- package/dist/core/auth/delegation-authorization.js +2 -2
- package/dist/core/auth/delegation-diagnostics.js +4 -1
- package/dist/core/auth/operation-authorizer.js +10 -1
- package/dist/core/auth/operation-catalog.js +19 -1
- package/dist/core/bootstrap-service.js +43 -20
- package/dist/core/channel-loader.js +0 -1
- package/dist/core/channel-runtime.js +30 -4
- package/dist/core/command/agent-control.js +196 -37
- package/dist/core/command/cli-intent-parser.js +60 -4
- package/dist/core/command/command-handler.js +212 -60
- package/dist/core/command/connect-menu.js +1 -0
- package/dist/core/command/diag-service.js +5 -4
- package/dist/core/command/file-search.js +368 -0
- package/dist/core/command/menu-catalog.js +2 -1
- package/dist/core/command/menu-handler.js +292 -107
- package/dist/core/command/menu-protocol.js +23 -0
- package/dist/core/command/role-menu.js +7 -19
- package/dist/core/command/skill-slash.js +130 -25
- package/dist/core/command/slash-handler.js +101 -53
- package/dist/core/command/topic-slash.js +16 -5
- package/dist/core/daemon-bootstrap.js +7 -1
- package/dist/core/daemon-control.js +19 -1
- package/dist/core/daemon-lifecycle.js +2 -1
- package/dist/core/event-catalog.js +2 -0
- package/dist/core/evolagent-registry.js +13 -2
- package/dist/core/evolagent.js +3 -6
- package/dist/core/handoff/ipc-registration.js +2 -2
- package/dist/core/handoff/runtime.js +40 -6
- package/dist/core/handoff/store.js +1 -0
- package/dist/core/inference/text-inference.js +95 -6
- package/dist/core/ipc-registration.js +43 -24
- package/dist/core/memory/consolidation-context.js +4 -1
- package/dist/core/memory/consolidation.js +25 -14
- package/dist/core/message/aun-ipc-sender.js +296 -88
- package/dist/core/message/aun-request-registry.js +226 -0
- package/dist/core/message/create-status.js +33 -4
- package/dist/core/message/message-bridge.js +62 -13
- package/dist/core/message/message-log.js +0 -1
- package/dist/core/message/message-queue.js +4 -1
- package/dist/core/message/message-utils.js +8 -1
- package/dist/core/message/peer-mode.js +17 -9
- package/dist/core/message/response-engine.js +266 -124
- package/dist/core/message/retry-scheduler.js +11 -8
- package/dist/core/model/catalog-service.js +60 -18
- package/dist/core/model/model-catalog.js +112 -9
- package/dist/core/model/model-fallback.js +94 -26
- package/dist/core/ownership/owner-resolver.js +687 -0
- package/dist/core/permission/approval-gateway.js +196 -62
- package/dist/core/permission/ec-command-parser.js +138 -25
- package/dist/core/permission/filesystem-approval-scope.js +141 -0
- package/dist/core/permission/protected-paths.js +14 -1
- package/dist/core/permission/sandbox-runtime.js +171 -18
- package/dist/core/permission/tool-policy.js +13 -2
- package/dist/core/role/runtime-policy.js +3 -4
- package/dist/core/session/session-idle-monitor.js +10 -8
- package/dist/core/session/session-manager.js +72 -45
- package/dist/core/session/session-mapper.js +18 -7
- package/dist/core/session/session-renew.js +5 -4
- package/dist/core/session/session-title.js +2 -1
- package/dist/core/session/session-turn-coordinator.js +4 -2
- package/dist/core/skill/index-generator.js +2 -16
- package/dist/core/task/task-recovery-service.js +15 -2
- package/dist/core/thread/command-parser.js +28 -13
- package/dist/core/thread/index.js +1 -0
- package/dist/core/thread/ipc-operation.js +11 -8
- package/dist/core/thread/thread-operation.js +79 -44
- package/dist/core/thread/thread-route.js +54 -6
- package/dist/core/thread/thread-service.js +236 -45
- package/dist/core/thread/topic-id.js +248 -0
- package/dist/eck/kit-renderer.js +1 -1
- package/dist/eck/message-renderer.js +12 -2
- package/dist/index.js +50 -27
- package/dist/ipc.js +59 -6
- package/dist/paths.js +1 -0
- package/dist/product.js +1 -0
- package/dist/response-system/engines/v1/proactive-flow.js +10 -3
- package/dist/stats/db.js +8 -0
- package/dist/stats/writer.js +26 -4
- package/dist/trigger/authorization.js +48 -3
- package/dist/trigger/feedback.js +28 -10
- package/dist/trigger/ipc-service.js +86 -10
- package/dist/trigger/local-files.js +55 -23
- package/dist/trigger/scheduler.js +57 -11
- package/dist/trigger/system-definitions.js +1 -0
- package/dist/trigger/validation.js +44 -15
- package/dist/utils/aid-bind.js +17 -297
- package/dist/utils/avatar-upload.js +16 -4
- package/dist/utils/cross-platform.js +115 -36
- package/dist/utils/ecweb-supervisor.js +1 -1
- package/dist/utils/ecweb-utils.js +8 -1
- package/dist/utils/error-utils.js +44 -6
- package/dist/utils/instance-registry.js +12 -2
- package/dist/utils/npm-ops.js +102 -27
- package/dist/utils/package-version-info.js +72 -27
- package/dist/utils/restart-safety.js +50 -0
- package/dist/utils/upgrade-jobs.js +304 -0
- package/dist/utils/windows-autostart.js +17 -10
- package/kits/docs/INDEX.md +5 -0
- package/kits/docs/aun/ABILITY_CALLING.md +239 -0
- package/kits/docs/evolcore/INDEX.md +14 -3
- package/kits/docs/evolcore/agent-create.md +55 -141
- package/kits/docs/evolcore/agent.md +38 -16
- package/kits/docs/evolcore/aid.md +34 -0
- package/kits/docs/evolcore/config.md +20 -1
- package/kits/docs/evolcore/event.md +2 -2
- package/kits/docs/evolcore/fs.md +18 -2
- package/kits/docs/evolcore/group-collaboration.md +13 -246
- package/kits/docs/evolcore/group.md +2 -1
- package/kits/docs/evolcore/memory-consolidation-batches.md +1 -1
- package/kits/docs/evolcore/menu-protocol.md +65 -1
- package/kits/docs/evolcore/msg.md +64 -2
- package/kits/docs/evolcore/skill.md +86 -0
- package/kits/docs/evolcore/stats.md +6 -0
- package/kits/docs/evolcore/task.md +2 -0
- package/kits/docs/evolcore/thread-chain.md +145 -51
- package/kits/docs/evolcore/trigger.md +48 -3
- package/kits/eck_manifest.json +21 -0
- package/kits/eck_message_manifest.json +4 -4
- package/kits/migrations/migrate-role-config-v5.mjs +20 -7
- package/kits/rules/01-overview.md +2 -1
- package/kits/rules/03-identity.md +3 -1
- package/kits/rules/04-relation.md +1 -1
- package/kits/rules/07-memory-and-thread.md +1 -1
- package/kits/schemas/_meta.json +16 -1
- package/kits/schemas/agent-config.schema.13.json +44 -2
- package/kits/schemas/contact-book.schema.3.json +5 -0
- package/kits/schemas/daemon.schema.6.json +3 -1
- package/kits/schemas/daemon.schema.8.json +329 -0
- package/kits/schemas/defaults.schema.5.json +39 -3
- package/kits/schemas/providers.schema.1.json +76 -0
- package/kits/schemas/relation-config.schema.9.json +5 -1
- package/kits/skills/.switches.json +28 -0
- package/kits/skills/aid-ability/SKILL.md +214 -0
- package/kits/skills/ec-agent-create/SKILL.md +162 -0
- package/kits/skills/ec-group/SKILL.md +2 -1
- package/kits/skills/ec-group-collaboration/SKILL.md +228 -0
- package/kits/skills/ec-identity/SKILL.md +143 -0
- package/kits/skills/ec-skill/scripts/cli.mjs +36 -3
- package/kits/skills/ec-skill/scripts/skill.mjs +202 -15
- package/kits/skills/ec-trigger/SKILL.md +167 -0
- package/kits/skills/ec-trigger/references/examples.md +153 -0
- package/kits/skills/thread-ops/SKILL.md +108 -420
- package/kits/templates/message-fragments/thread-context.md +1 -2
- package/kits/templates/message-fragments/trigger-thread-check.md +1 -1
- package/kits/templates/roles/member.json +1 -1
- package/kits/templates/roles/visitor.json +1 -0
- package/kits/templates/system-fragments/bootstrap.md +1 -0
- package/kits/templates/system-fragments/channel.md +2 -1
- package/kits/templates/system-fragments/commands.md +5 -4
- package/kits/templates/system-fragments/identity.md +2 -0
- package/kits/templates/system-fragments/session.md +1 -1
- package/kits/templates/system-fragments/venue.md +1 -1
- package/package.json +4 -3
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* `execution.memoryMode` 会经 session.metadata 透传到渲染层与 ipc 的权限校验。
|
|
10
10
|
*/
|
|
11
11
|
import fs from 'fs';
|
|
12
|
+
import { getPrimaryOwner, ownerResolver } from '../ownership/owner-resolver.js';
|
|
12
13
|
import path from 'path';
|
|
13
14
|
import { agentDir, resolveRoot } from '../../paths.js';
|
|
14
15
|
import { serializeConsolidationContext } from './consolidation-context.js';
|
|
@@ -16,6 +17,7 @@ import { assertSystemSessionLaunchable } from '../system-session/registry.js';
|
|
|
16
17
|
import { resolveAgentLifecycle } from '../../config/lifecycle.js';
|
|
17
18
|
import { ensureSessionRuntimeDir } from '../../cli/task-context.js';
|
|
18
19
|
import { formatChannelKey } from '../channel-loader.js';
|
|
20
|
+
import { isTopicThreadId } from '../thread/topic-id.js';
|
|
19
21
|
import { logger } from '../../utils/logger.js';
|
|
20
22
|
import { appendOpsRecord, feedbackFilePath, readFeedbackText } from './consolidation-ops-records.js';
|
|
21
23
|
import { updateBatchMeta } from './batch-meta.js';
|
|
@@ -76,10 +78,13 @@ export async function launchConsolidation(channel, params) {
|
|
|
76
78
|
const selfAid = effectiveCtx.selfAid;
|
|
77
79
|
if (!selfAid)
|
|
78
80
|
throw new Error('无法确定当前 agent AID(selfAid 为空)');
|
|
81
|
+
const baseagent = effectiveCtx.baseagent?.trim();
|
|
82
|
+
if (!baseagent)
|
|
83
|
+
throw new Error(`无法确定记忆整理会话的 baseagent(agent=${selfAid})`);
|
|
79
84
|
// 系统会话标记:类型 / subtype 必须已注册,runner 必须受支持(Gemini 拒绝)。
|
|
80
85
|
// 放在认领 processing 之前,拒绝时不留副作用。
|
|
81
86
|
const systemSession = { type: 'memory', subtype: mode };
|
|
82
|
-
assertSystemSessionLaunchable(systemSession,
|
|
87
|
+
assertSystemSessionLaunchable(systemSession, baseagent);
|
|
83
88
|
const blockedReason = consolidationBlockedReason(selfAid);
|
|
84
89
|
if (blockedReason)
|
|
85
90
|
throw new Error(blockedReason);
|
|
@@ -129,7 +134,6 @@ export async function launchConsolidation(channel, params) {
|
|
|
129
134
|
restorePendingNotes(memoryDir);
|
|
130
135
|
throw error;
|
|
131
136
|
}
|
|
132
|
-
const baseagent = effectiveCtx.baseagent ?? 'claude';
|
|
133
137
|
const now = Date.now();
|
|
134
138
|
const scopeTag = params.scopeOverride ? `-${params.scopeOverride}` : '';
|
|
135
139
|
const kind = `memory-consolidate-${mode}${scopeTag}`;
|
|
@@ -141,8 +145,9 @@ export async function launchConsolidation(channel, params) {
|
|
|
141
145
|
channelId: effectiveCtx.peerId,
|
|
142
146
|
channelType: effectiveCtx.channel,
|
|
143
147
|
peerId: effectiveCtx.peerId,
|
|
144
|
-
|
|
145
|
-
|
|
148
|
+
// 主话题的规范 id 不是话题会话:反馈落到该关系的主话题,线上形态不带 thread_id。
|
|
149
|
+
session: isTopicThreadId(effectiveCtx.threadId) ? 'thread' : 'main',
|
|
150
|
+
...(isTopicThreadId(effectiveCtx.threadId) ? { threadId: effectiveCtx.threadId } : {}),
|
|
146
151
|
delivery: { chatType: effectiveCtx.chatType ?? 'private' },
|
|
147
152
|
} : undefined;
|
|
148
153
|
const projectPath = params.projectPath ?? path.join(resolveRoot(), 'agents', selfAid);
|
|
@@ -202,7 +207,7 @@ export async function launchConsolidation(channel, params) {
|
|
|
202
207
|
logger.warn(`[Memory] 整理会话未正常结束(mode=${mode},outcome=${r.outcome}): ${r.error ?? ''}`);
|
|
203
208
|
}
|
|
204
209
|
});
|
|
205
|
-
logger.info(`[Memory] 已拉起整理会话(mode=${mode},triggeredBy=${triggeredBy},` +
|
|
210
|
+
logger.info(`[Memory] 已拉起整理会话(mode=${mode},triggeredBy=${triggeredBy},baseagent=${baseagent},` +
|
|
206
211
|
`selfAid=${selfAid}${effectiveCtx.peerKey ? `,peerKey=${effectiveCtx.peerKey}` : ''}` +
|
|
207
212
|
`${executionSessionId ? `,session=${executionSessionId}` : ''})`);
|
|
208
213
|
return {
|
|
@@ -455,7 +460,8 @@ export function createConsolidationSessionFinalizer({ sessionManager, getAgent,
|
|
|
455
460
|
const { collectCandidates, isDueForReview, deferCandidate } = await import('./staleness.js');
|
|
456
461
|
const selfAid = session.selfAID;
|
|
457
462
|
if (selfAid) {
|
|
458
|
-
const
|
|
463
|
+
const agent = getAgent(selfAid);
|
|
464
|
+
const memoryConfig = agent?.config.memory;
|
|
459
465
|
const thresholds = { forgetAfterDays: memoryConfig?.forgetAfterDays ?? 3 };
|
|
460
466
|
const now = Date.now();
|
|
461
467
|
const affectedScopes = collectAffectedScopes(batchDir);
|
|
@@ -478,8 +484,8 @@ export function createConsolidationSessionFinalizer({ sessionManager, getAgent,
|
|
|
478
484
|
continue;
|
|
479
485
|
}
|
|
480
486
|
if (due > 0) {
|
|
481
|
-
const ownerAid = memoryConfig ?
|
|
482
|
-
const taskCtx = { selfAid, peerKey: meta.peerKey };
|
|
487
|
+
const ownerAid = memoryConfig ? getPrimaryOwner(selfAid) : undefined;
|
|
488
|
+
const taskCtx = { selfAid, peerKey: meta.peerKey, baseagent: agent?.baseagent };
|
|
483
489
|
void enqueueConsolidation({
|
|
484
490
|
taskCtx,
|
|
485
491
|
mode: 'forget',
|
|
@@ -592,7 +598,7 @@ export function createConsolidationFeedbackSender(getChannel) {
|
|
|
592
598
|
const threadId = origin.threadId;
|
|
593
599
|
const chatType = origin.delivery?.chatType;
|
|
594
600
|
const replyContext = {};
|
|
595
|
-
if (threadId)
|
|
601
|
+
if (isTopicThreadId(threadId))
|
|
596
602
|
replyContext.threadId = threadId;
|
|
597
603
|
if (chatType)
|
|
598
604
|
replyContext.delivery = { chatType };
|
|
@@ -799,12 +805,14 @@ export function registerConsolidationLaunchExecutor({ ipcServer, enqueueConsolid
|
|
|
799
805
|
}
|
|
800
806
|
export function registerConsolidationCheckExecutor({ ipcServer, agentRegistry, enqueueConsolidation, }) {
|
|
801
807
|
ipcServer.setConsolidationCheckExecutor(async ({ selfAid }) => {
|
|
802
|
-
const
|
|
808
|
+
const agent = agentRegistry.get(selfAid);
|
|
809
|
+
const agentConfig = agent?.config;
|
|
803
810
|
if (agentConfig?.memory?.enableRelation === false)
|
|
804
811
|
return { launched: [] };
|
|
805
812
|
if (consolidationBlockedReason(selfAid))
|
|
806
813
|
return { launched: [] };
|
|
807
|
-
|
|
814
|
+
await ownerResolver.refresh(selfAid);
|
|
815
|
+
const ownerAid = getPrimaryOwner(selfAid);
|
|
808
816
|
const agentCount = agentRegistry.runnableAgents().length;
|
|
809
817
|
const relationsDir = path.join(agentDir(selfAid), 'relations');
|
|
810
818
|
let relationCount = 0;
|
|
@@ -828,11 +836,11 @@ export function registerConsolidationCheckExecutor({ ipcServer, agentRegistry, e
|
|
|
828
836
|
const taskCtx = {
|
|
829
837
|
selfAid,
|
|
830
838
|
peerKey: candidate.peerKey,
|
|
831
|
-
baseagent:
|
|
839
|
+
baseagent: agent?.baseagent,
|
|
832
840
|
sessionId: undefined,
|
|
833
841
|
};
|
|
834
842
|
try {
|
|
835
|
-
await enqueueConsolidation({
|
|
843
|
+
const result = await enqueueConsolidation({
|
|
836
844
|
taskCtx,
|
|
837
845
|
mode: candidate.mode,
|
|
838
846
|
triggeredBy: 'periodic-trigger',
|
|
@@ -840,6 +848,8 @@ export function registerConsolidationCheckExecutor({ ipcServer, agentRegistry, e
|
|
|
840
848
|
forgetAfterDays: agentConfig?.memory?.forgetAfterDays,
|
|
841
849
|
...(candidate.scope ? { scopeOverride: candidate.scope } : {}),
|
|
842
850
|
});
|
|
851
|
+
if (!result)
|
|
852
|
+
continue;
|
|
843
853
|
launched.push({ mode: candidate.mode, ...(candidate.peerKey ? { peerKey: candidate.peerKey } : {}) });
|
|
844
854
|
}
|
|
845
855
|
catch (error) {
|
|
@@ -865,7 +875,8 @@ export function registerRelationConsolidationEvents({ eventBus, agentRegistry, r
|
|
|
865
875
|
const memoryConfig = agentRegistry.get(taskCtx.selfAid)?.config?.memory;
|
|
866
876
|
if (memoryConfig?.enableRelation === false)
|
|
867
877
|
return;
|
|
868
|
-
|
|
878
|
+
await ownerResolver.refresh(taskCtx.selfAid);
|
|
879
|
+
const ownerAid = getPrimaryOwner(taskCtx.selfAid);
|
|
869
880
|
await enqueueConsolidation({
|
|
870
881
|
taskCtx,
|
|
871
882
|
mode: 'notes',
|