evolcore 0.0.41-test.1 → 0.0.41-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 +49 -36
- package/dist/agents/baseagent.js +68 -6
- package/dist/agents/codex-runner.js +62 -43
- package/dist/aun/aid/agentmd.js +98 -11
- package/dist/aun/aid/client.js +1 -1
- package/dist/aun/aid/control-aid.js +26 -2
- package/dist/aun/aid/identity.js +91 -0
- package/dist/aun/aid/index.js +1 -1
- package/dist/aun/aid/managed-operation.js +1 -1
- package/dist/aun/aid/ownership-operation.js +23 -22
- package/dist/aun/menu/client.js +27 -0
- package/dist/aun/msg/p2p.js +3 -8
- package/dist/aun/service-proxy.js +17 -0
- package/dist/channels/aun.js +321 -34
- package/dist/cli/agent-command.js +5 -2
- package/dist/cli/agent-create.js +991 -233
- package/dist/cli/agent.js +49 -10
- package/dist/cli/aid-bind-command.js +48 -19
- package/dist/cli/aun-commands.js +44 -16
- package/dist/cli/daemon-commands.js +1 -0
- package/dist/cli/index.js +24 -1
- package/dist/cli/init-channel.js +1 -1
- package/dist/cli/init.js +75 -1
- package/dist/cli/managed-command-guard.js +13 -1
- package/dist/cli/provider-command.js +57 -0
- package/dist/cli/restart-monitor.js +4 -2
- package/dist/cli/stats.js +10 -3
- package/dist/cli/task-context.js +19 -0
- package/dist/config/boot-log.js +3 -2
- package/dist/config/config-field-policy.js +12 -7
- package/dist/config/config-manager.js +138 -6
- package/dist/config/owner-config.js +2 -2
- package/dist/config/peer-role-resolver.js +2 -1
- package/dist/config/provider-ipc-service.js +132 -0
- package/dist/config/provider-menu-request.js +58 -0
- package/dist/config/providers-management.js +78 -5
- package/dist/config/resolved-config-op.js +8 -1
- package/dist/config/schema-migration.js +322 -8
- package/dist/config-store.js +10 -1
- package/dist/contracts/ecweb-service-protocol.js +2 -1
- package/dist/core/agent-application-service.js +60 -11
- package/dist/core/agent-create-status.js +203 -0
- package/dist/core/agent-creation-claim.js +177 -0
- package/dist/core/agent-ipc-registration.js +39 -18
- package/dist/core/agent-runtime.js +193 -23
- package/dist/core/auth/agent-delegation.js +4 -2
- package/dist/core/auth/auth-gateway.js +66 -1
- package/dist/core/auth/authorization-audit.js +41 -5
- package/dist/core/auth/delegation-authorization.js +2 -1
- package/dist/core/auth/operation-authorizer.js +28 -6
- package/dist/core/auth/operation-catalog.js +14 -1
- package/dist/core/channel-loader.js +2 -0
- package/dist/core/command/agent-control.js +257 -14
- package/dist/core/command/cli-intent-parser.js +6 -2
- package/dist/core/command/command-handler.js +64 -55
- package/dist/core/command/memory-slash.js +1 -1
- package/dist/core/command/menu-catalog.js +5 -0
- package/dist/core/command/menu-handler.js +64 -18
- package/dist/core/command/menu-protocol.js +15 -1
- package/dist/core/command/provider-menu.js +46 -0
- package/dist/core/command/slash-handler.js +2 -1
- package/dist/core/daemon-control.js +18 -13
- package/dist/core/event-catalog.js +10 -0
- package/dist/core/evolagent-registry.js +3 -1
- package/dist/core/evolagent.js +8 -6
- package/dist/core/file-integrity/store.js +11 -0
- package/dist/core/handoff/ipc-registration.js +3 -0
- package/dist/core/initialization/service.js +491 -0
- package/dist/core/ipc-registration.js +34 -22
- package/dist/core/memory/consolidation-ops-records.js +95 -0
- package/dist/core/memory/consolidation-trigger.js +19 -2
- package/dist/core/memory/consolidation.js +19 -8
- package/dist/core/memory/memory-admin.js +1 -1
- package/dist/core/memory/relation-sweep.js +11 -6
- package/dist/core/message/aun-ipc-sender.js +73 -67
- package/dist/core/message/im-renderer.js +18 -0
- package/dist/core/message/message-bridge.js +35 -3
- package/dist/core/message/response-engine.js +32 -28
- package/dist/core/model/catalog-service.js +1 -1
- package/dist/core/model/config-scope.js +5 -7
- package/dist/core/ownership/owner-resolver.js +755 -143
- package/dist/core/permission/approval-gateway.js +103 -403
- package/dist/core/permission/ec-command-parser.js +32 -4
- package/dist/core/permission/index.js +1 -0
- package/dist/core/permission/permission-result.js +78 -0
- package/dist/core/permission/tool-policy.js +7 -43
- package/dist/core/system-session/memory.js +37 -7
- package/dist/directory/owner-directory-cache.js +2 -2
- package/dist/ecweb/init-menu.js +32 -0
- package/dist/index.js +17 -5
- package/dist/ipc.js +85 -25
- package/dist/paths.js +3 -0
- package/dist/proxy/manager.js +6 -7
- package/dist/trigger/authorization.js +27 -17
- package/dist/trigger/feedback.js +2 -3
- package/dist/trigger/ipc-service.js +105 -78
- package/dist/trigger/local-files.js +2 -1
- package/dist/trigger/manager.js +5 -3
- package/dist/trigger/scheduler.js +88 -6
- package/dist/utils/atomic-write.js +28 -0
- package/dist/utils/error-utils.js +24 -0
- package/dist/utils/logger.js +68 -1
- package/dist/utils/welcome.js +1 -1
- package/kits/docs/INDEX.md +1 -0
- package/kits/docs/aun/SDK.md +4 -1
- package/kits/docs/evolcore/INDEX.md +1 -0
- package/kits/docs/evolcore/agent.md +8 -1
- package/kits/docs/evolcore/aid.md +67 -17
- package/kits/docs/evolcore/config.md +11 -1
- package/kits/docs/evolcore/group.md +1 -1
- package/kits/docs/evolcore/provider.md +50 -0
- package/kits/docs/identity/AID_PROFILE_SPEC.md +52 -17
- package/kits/rules/01-overview.md +3 -0
- package/kits/rules/04-relation.md +1 -1
- package/kits/schemas/_meta.json +2 -2
- package/kits/schemas/agent-config.schema.16.json +3 -3
- package/kits/schemas/relation-config.schema.11.json +17 -0
- package/kits/skills/.switches.json +8 -0
- package/kits/skills/ec-agent-create/SKILL.md +3 -0
- package/kits/skills/ec-identity/SKILL.md +2 -2
- package/kits/skills/ec-skill/scripts/skill.mjs +6 -0
- package/kits/skills/ec-trigger/SKILL.md +5 -13
- package/kits/skills/thread-ops/SKILL.md +5 -0
- package/kits/templates/system-fragments/venue.md +1 -1
- package/package.json +3 -3
- package/dist/core/memory/forget-log.js +0 -96
- package/dist/core/message/create-status.js +0 -96
|
@@ -21,7 +21,7 @@ import { createDecisionInferenceProvider, createTextInferenceProvider } from '..
|
|
|
21
21
|
import { StreamIdleMonitor } from './stream-idle-monitor.js';
|
|
22
22
|
import { logger } from '../../utils/logger.js';
|
|
23
23
|
import { isHostChinese } from '../../utils/locale.js';
|
|
24
|
-
import { ExecutionTimeoutError, OrphanedTargetSessionError, isExecutionFailure, getErrorMessage, getErrorRawText, getToolResultErrorText, classifyError, normalizeCoreErrorReason, normalizeCoreErrorSubtype, ErrorType, ERROR_PREFIX, isInfraError, isAbortTerminalReason, prefixErrorType, isRetryableError, isContextTooLongText, isPolicyRejectedError } from '../../utils/error-utils.js';
|
|
24
|
+
import { ExecutionTimeoutError, OrphanedTargetSessionError, UnattendedInputRequiredError, isExecutionFailure, getErrorMessage, getErrorRawText, getToolResultErrorText, classifyError, normalizeCoreErrorReason, normalizeCoreErrorSubtype, ErrorType, ERROR_PREFIX, isInfraError, isAbortTerminalReason, prefixErrorType, isRetryableError, isContextTooLongText, isPolicyRejectedError } from '../../utils/error-utils.js';
|
|
25
25
|
import { readEvolcoreRuntimeFlavor, tagErrorTextWithEvolcoreVersion } from '../../utils/evolcore-version.js';
|
|
26
26
|
import { describeProactiveSendCommandFailure, isExactEvolcoreSendCommandForSession, isThreadRoutedEvolcoreSendCommand, parseCodexToolCommand, resolveCodexShellCarrierArgv, resolveCodexShellCarrierString, } from '../permission/ec-command-parser.js';
|
|
27
27
|
import { resolveThreadRouteTarget } from '../thread/thread-route.js';
|
|
@@ -2623,7 +2623,7 @@ export class ResponseEngine {
|
|
|
2623
2623
|
* them immediately before every Runner invocation, including retries.
|
|
2624
2624
|
*/
|
|
2625
2625
|
async assertCurrentFullAccessExecutionAuthorization(authorization, agent) {
|
|
2626
|
-
await refreshOwnershipForAuthorization(authorization.agentAid, { allowTransient: true });
|
|
2626
|
+
await refreshOwnershipForAuthorization(authorization.agentAid, { allowTransient: true, includeDaemon: true });
|
|
2627
2627
|
if (authorization.permissionMode !== 'fullaccess'
|
|
2628
2628
|
|| authorization.processRole !== 'fullaccess-run'
|
|
2629
2629
|
|| authorization.dataScope !== 'daemon'
|
|
@@ -2658,13 +2658,6 @@ export class ResponseEngine {
|
|
|
2658
2658
|
resolveTriggerExecutionIdentity(message, selfAid) {
|
|
2659
2659
|
if (message.source !== 'trigger' || !message.triggerMeta?.triggerId)
|
|
2660
2660
|
return undefined;
|
|
2661
|
-
// 跨话题复查(target_session 投递):本轮是"T2 侧 agent 被自己的复查通知唤醒",
|
|
2662
|
-
// 身份就是 T2 会话自身的对端,与普通入站消息一致。
|
|
2663
|
-
// 若沿用 originPeerId(来源话题 T1 的对端),整个轮次的角色与权限都会错位。
|
|
2664
|
-
if (message.triggerMeta.reviewKind === 'cross-thread-review'
|
|
2665
|
-
|| message.triggerMeta.labels?.kind === 'cross-thread-review') {
|
|
2666
|
-
return undefined;
|
|
2667
|
-
}
|
|
2668
2661
|
const actorId = message.triggerMeta.originPeerId;
|
|
2669
2662
|
const channelType = message.triggerMeta.originChannelType;
|
|
2670
2663
|
const originChannelKey = message.triggerMeta.originChannelKey;
|
|
@@ -2996,10 +2989,7 @@ export class ResponseEngine {
|
|
|
2996
2989
|
const triggerExecutionIdentity = this.resolveTriggerExecutionIdentity(message, selfAidForAccess);
|
|
2997
2990
|
const handoffExecutionIdentity = this.resolveHandoffOriginExecutionIdentity(message, selfAidForAccess);
|
|
2998
2991
|
const executionIdentity = triggerExecutionIdentity ?? handoffExecutionIdentity;
|
|
2999
|
-
|
|
3000
|
-
const isCrossThreadReview = message.triggerMeta?.reviewKind === 'cross-thread-review'
|
|
3001
|
-
|| message.triggerMeta?.labels?.kind === 'cross-thread-review';
|
|
3002
|
-
if (message.source === 'trigger' && !triggerExecutionIdentity && !isCrossThreadReview) {
|
|
2992
|
+
if (message.source === 'trigger' && !triggerExecutionIdentity) {
|
|
3003
2993
|
logger.warn(`[ResponseEngine] Trigger execution identity missing: trigger=${message.triggerMeta?.triggerId ?? '<none>'}`);
|
|
3004
2994
|
const channelInfo = this.resolveChannelInfo(accessChannelKey);
|
|
3005
2995
|
if (channelInfo) {
|
|
@@ -3615,15 +3605,7 @@ export class ResponseEngine {
|
|
|
3615
3605
|
// operator. Keep the historical private-chat fallback (where channelId
|
|
3616
3606
|
// is the peer identity for AUN), but fail closed for group messages that
|
|
3617
3607
|
// arrive without a sender/operator ID.
|
|
3618
|
-
|
|
3619
|
-
// 按 T2 会话自身的对端算(resolveTriggerExecutionIdentity 对这类投递返回 undefined),
|
|
3620
|
-
// 私聊即 channelId;否则 actor 落成伪身份,在唤醒话题里连本条复查都管不了。
|
|
3621
|
-
const isCrossThreadReviewTurn = message.source === 'trigger'
|
|
3622
|
-
&& (message.triggerMeta?.reviewKind === 'cross-thread-review'
|
|
3623
|
-
|| message.triggerMeta?.labels?.kind === 'cross-thread-review');
|
|
3624
|
-
const turnPeerId = isCrossThreadReviewTurn && configChatType === 'private'
|
|
3625
|
-
? message.channelId
|
|
3626
|
-
: peerIdRaw;
|
|
3608
|
+
const turnPeerId = peerIdRaw;
|
|
3627
3609
|
const configActorId = authorizationIdentity?.actorId
|
|
3628
3610
|
?? (turnPeerId || (configChatType === 'private' ? message.channelId : undefined));
|
|
3629
3611
|
const peerKeyId = authorizationIdentity?.actorId ?? (session.chatType === 'group'
|
|
@@ -3667,11 +3649,13 @@ export class ResponseEngine {
|
|
|
3667
3649
|
?? (peerRoleDetail
|
|
3668
3650
|
? (peerRoleDetail.effectiveRole ?? 'none')
|
|
3669
3651
|
: (session.identity?.role ?? 'none'));
|
|
3652
|
+
let effectiveAgentConfigError;
|
|
3670
3653
|
const effectiveAgentConfig = (() => {
|
|
3671
3654
|
try {
|
|
3672
3655
|
return resolveEffective({ self: selfAid || undefined, peerKey }, { cache: true });
|
|
3673
3656
|
}
|
|
3674
3657
|
catch (e) {
|
|
3658
|
+
effectiveAgentConfigError = e;
|
|
3675
3659
|
logger.warn(`[ResponseEngine] resolveEffective failed: ${e instanceof Error ? e.message : String(e)}`);
|
|
3676
3660
|
return undefined;
|
|
3677
3661
|
}
|
|
@@ -4067,8 +4051,22 @@ export class ResponseEngine {
|
|
|
4067
4051
|
return;
|
|
4068
4052
|
}
|
|
4069
4053
|
}
|
|
4070
|
-
// ──
|
|
4054
|
+
// ── 模型取 Agent/defaults 配置;缺失时不回落 runner 的隐式默认值 ──
|
|
4071
4055
|
{
|
|
4056
|
+
if (effectiveAgentConfigError) {
|
|
4057
|
+
this.touchAgentActivity(channelKey);
|
|
4058
|
+
adapter.send(envelope, {
|
|
4059
|
+
kind: 'system.error',
|
|
4060
|
+
text: isHostChinese()
|
|
4061
|
+
? '⚠️ 无法读取当前 Agent 的模型配置,请管理员检查配置读取错误日志后重试。'
|
|
4062
|
+
: '⚠️ Cannot read this Agent\'s model configuration. Ask an administrator to check the configuration error log and retry.',
|
|
4063
|
+
subtype: 'model_config_unreadable',
|
|
4064
|
+
recoverable: true,
|
|
4065
|
+
}).catch(() => { });
|
|
4066
|
+
adapter.send(envelope, { kind: 'status.completed', metadata: { durationMs: 0 } }).catch(() => { });
|
|
4067
|
+
this.publishTriggerExecutionFailure(message, 'model_config_unreadable');
|
|
4068
|
+
return;
|
|
4069
|
+
}
|
|
4072
4070
|
const modelBaseagent = normalizeBaseagent(agent.name).canonical;
|
|
4073
4071
|
const agentModel = effectiveAgentConfig?.baseagents?.[modelBaseagent]?.model;
|
|
4074
4072
|
const triggerModel = message.triggerMeta?.modelOverride;
|
|
@@ -4563,7 +4561,7 @@ export class ResponseEngine {
|
|
|
4563
4561
|
action: 'owner_approval',
|
|
4564
4562
|
requestId: permissionEvent.requestId,
|
|
4565
4563
|
toolName: permissionEvent.toolName,
|
|
4566
|
-
message: '
|
|
4564
|
+
message: '等待审批',
|
|
4567
4565
|
expiresAt: permissionEvent.expiresAt,
|
|
4568
4566
|
},
|
|
4569
4567
|
};
|
|
@@ -4580,7 +4578,7 @@ export class ResponseEngine {
|
|
|
4580
4578
|
if (permissionEvent.state === 'approved') {
|
|
4581
4579
|
await adapter.send(executionEnvelope, {
|
|
4582
4580
|
kind: 'status.progress',
|
|
4583
|
-
metadata: { activityType: 'progress', state: 'processing', text: '
|
|
4581
|
+
metadata: { activityType: 'progress', state: 'processing', text: '审批已批准,继续执行' },
|
|
4584
4582
|
});
|
|
4585
4583
|
return;
|
|
4586
4584
|
}
|
|
@@ -4596,6 +4594,12 @@ export class ResponseEngine {
|
|
|
4596
4594
|
errorType: `permission_${permissionEvent.reason}`,
|
|
4597
4595
|
message: permissionEvent.message,
|
|
4598
4596
|
requestId: permissionEvent.requestId,
|
|
4597
|
+
decisionSource: permissionEvent.decisionSource,
|
|
4598
|
+
policyCode: permissionEvent.policyCode,
|
|
4599
|
+
errorDetailCode: permissionEvent.errorDetailCode,
|
|
4600
|
+
approverOperatorId: permissionEvent.approverOperatorId,
|
|
4601
|
+
approverChannelKey: permissionEvent.approverChannelKey,
|
|
4602
|
+
approverPrincipalId: permissionEvent.approverPrincipalId,
|
|
4599
4603
|
},
|
|
4600
4604
|
});
|
|
4601
4605
|
}
|
|
@@ -4760,7 +4764,7 @@ export class ResponseEngine {
|
|
|
4760
4764
|
|| !message.triggerMeta.authorizedBy) {
|
|
4761
4765
|
throw new Error('fullaccess Trigger override lacks trusted scheduler identity or approval provenance');
|
|
4762
4766
|
}
|
|
4763
|
-
await refreshOwnershipForAuthorization(selfAid, { allowTransient: true });
|
|
4767
|
+
await refreshOwnershipForAuthorization(selfAid, { allowTransient: true, includeDaemon: true });
|
|
4764
4768
|
const currentOwners = new Set(getDaemonOwners());
|
|
4765
4769
|
if (!currentOwners.has(message.triggerMeta.authorizedBy)) {
|
|
4766
4770
|
throw new Error('fullaccess Trigger approval is no longer owned');
|
|
@@ -5673,7 +5677,7 @@ export class ResponseEngine {
|
|
|
5673
5677
|
if (permissionContext.approvalInteractionPolicy === 'deny') {
|
|
5674
5678
|
logger.info(`[AsyncQuestions] no interactive recipient for unattended task: session=${session.id}`);
|
|
5675
5679
|
if (blocking)
|
|
5676
|
-
throw new
|
|
5680
|
+
throw new UnattendedInputRequiredError();
|
|
5677
5681
|
return;
|
|
5678
5682
|
}
|
|
5679
5683
|
if (blocking) {
|
|
@@ -6754,7 +6758,7 @@ export class ResponseEngine {
|
|
|
6754
6758
|
else {
|
|
6755
6759
|
logger.error(`[${message.channel}] Error:`, error);
|
|
6756
6760
|
}
|
|
6757
|
-
const errorType = prefixErrorType(ERROR_PREFIX.INFRA, errType);
|
|
6761
|
+
const errorType = prefixErrorType(errType === ErrorType.INPUT_REQUIRED ? ERROR_PREFIX.AGENT : ERROR_PREFIX.INFRA, errType);
|
|
6758
6762
|
// 用户主动打断:流被掐断抛出的异常不是真正的失败。打断发生时 source
|
|
6759
6763
|
// (message-queue / slash-handler)已发过 task:interrupted(它填充了
|
|
6760
6764
|
// interruptedSessions,isUserInterrupt 才会为真),stats 侧已据此收尾任务。
|
|
@@ -369,7 +369,7 @@ export class ModelCatalogService {
|
|
|
369
369
|
return { ...previous, freshness: 'stale', diagnostics: [...diagnostics, { code: 'STALE_CACHE', message: '使用同一连接的最近成功目录' }] };
|
|
370
370
|
if (context.providerId)
|
|
371
371
|
return this.make(context, 'gateway', 'fallback', [], diagnostics);
|
|
372
|
-
if (!context.configUnavailable && this.options.native) {
|
|
372
|
+
if (!context.configUnavailable && !diagnostics.some(diagnostic => diagnostic.code === 'AUTH_FAILED') && this.options.native) {
|
|
373
373
|
try {
|
|
374
374
|
const native = await this.options.native(context);
|
|
375
375
|
if (native !== null) {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* 详见 docs/config/
|
|
16
16
|
*/
|
|
17
17
|
import { formatPeerKey, parsePeerKey } from '../relation/peer-identity.js';
|
|
18
|
-
import { ConfigTarget, read, write, ensureFile, } from '../../config/config-manager.js';
|
|
18
|
+
import { ConfigTarget, read, write, ensureFile, resolveEffective, } from '../../config/config-manager.js';
|
|
19
19
|
import { resolveRuntimePermissionMode } from '../role/runtime-policy.js';
|
|
20
20
|
export class ModelScopeError extends Error {
|
|
21
21
|
code;
|
|
@@ -69,14 +69,12 @@ export function determineScope(sel) {
|
|
|
69
69
|
return 'global';
|
|
70
70
|
}
|
|
71
71
|
// ── baseagent 解析 ───────────────────────────────────────────────────────
|
|
72
|
-
/**
|
|
72
|
+
/** Read the Agent's active backend, including an inherited defaults selection. */
|
|
73
73
|
export function activeBaseagent(self) {
|
|
74
74
|
try {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return b.active_baseagent;
|
|
79
|
-
}
|
|
75
|
+
const b = resolveEffective({ self }, { cache: true });
|
|
76
|
+
if (b?.active_baseagent)
|
|
77
|
+
return b.active_baseagent;
|
|
80
78
|
}
|
|
81
79
|
catch { /* fall through */ }
|
|
82
80
|
return 'claude';
|