evolcore 0.0.19 → 0.0.21
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 +43 -1
- package/README.md +60 -9
- package/bin/install-codex-managed-hooks.mjs +61 -0
- package/dist/agents/baseagent.js +10 -6
- package/dist/agents/claude-runner.js +383 -111
- package/dist/agents/codex-app-server-client.js +10 -2
- package/dist/agents/codex-runner.js +405 -137
- package/dist/agents/ecagent-runner.js +174 -63
- package/dist/agents/gemini-runner.js +130 -30
- package/dist/agents/request-identity.js +25 -0
- package/dist/agents/runner-types.js +19 -0
- package/dist/aun/aid/agentmd.js +66 -2
- package/dist/aun/aid/identity.js +4 -1
- package/dist/aun/aid/index.js +1 -1
- package/dist/aun/msg/group.js +86 -9
- package/dist/aun/msg/history.js +213 -36
- package/dist/aun/msg/managed-operation.js +58 -9
- package/dist/aun/msg/p2p.js +26 -11
- package/dist/aun/outbox.js +295 -68
- package/dist/aun/service-proxy.js +43 -25
- package/dist/channels/aun.js +1004 -273
- package/dist/channels/daemon.js +6 -1
- package/dist/cli/agent-command.js +4 -3
- package/dist/cli/agent.js +66 -56
- package/dist/cli/aun-commands.js +177 -42
- package/dist/cli/command-log.js +10 -11
- package/dist/cli/contact.js +1 -0
- package/dist/cli/daemon-commands.js +81 -121
- package/dist/cli/index.js +1 -0
- package/dist/cli/init.js +76 -24
- package/dist/cli/restart-monitor.js +3 -3
- package/dist/cli/task-context.js +46 -0
- package/dist/cli/trigger-command.js +1 -1
- package/dist/cli/watch-logs.js +10 -3
- package/dist/config/builtin-roles.js +1 -0
- package/dist/config/config-field-policy.js +16 -5
- package/dist/config/config-manager.js +226 -24
- package/dist/config/config-operation-service.js +1 -2
- package/dist/config/contact-operation-service.js +32 -1
- package/dist/config/contact-request-service.js +44 -0
- package/dist/config/daemon-services.js +186 -0
- package/dist/config/gateway-config.js +29 -16
- package/dist/config/lifecycle.js +16 -5
- package/dist/config/role-service.js +54 -3
- package/dist/config/schema-migration.js +550 -0
- package/dist/config-store.js +161 -12
- package/dist/core/agent-application-service.js +279 -0
- package/dist/core/audit/log-integrity.js +102 -0
- package/dist/core/auth/agent-delegation.js +31 -1
- package/dist/core/auth/auth-gateway.js +33 -4
- package/dist/core/auth/authorization-audit.js +155 -4
- package/dist/core/auth/operation-authorizer.js +41 -1
- package/dist/core/auth/operation-catalog.js +9 -1
- package/dist/core/bootstrap-messages.js +2 -2
- package/dist/core/bootstrap-service.js +27 -38
- package/dist/core/causation/aun-association.js +7 -4
- package/dist/core/channel-loader.js +0 -2
- package/dist/core/command/agent-control.js +56 -16
- package/dist/core/command/command-handler.js +290 -44
- package/dist/core/command/connect-menu.js +3 -4
- package/dist/core/command/group-menu.js +5 -7
- package/dist/core/command/menu-handler.js +279 -80
- package/dist/core/command/role-menu.js +21 -11
- package/dist/core/command/slash-gate.js +85 -18
- package/dist/core/command/slash-handler.js +350 -32
- package/dist/core/event-catalog.js +5 -0
- package/dist/core/evolagent.js +9 -4
- package/dist/core/handoff/dispatcher.js +4 -0
- package/dist/core/handoff/runtime.js +10 -0
- package/dist/core/handoff/store.js +32 -9
- package/dist/core/inference/text-inference.js +7 -15
- package/dist/core/message/im-renderer.js +83 -84
- package/dist/core/message/{inbound-admission.js → message-admission.js} +51 -1
- package/dist/core/message/message-bridge.js +124 -10
- package/dist/core/message/message-log.js +14 -7
- package/dist/core/message/message-queue.js +206 -16
- package/dist/core/message/message-utils.js +12 -5
- package/dist/core/message/response-engine.js +495 -72
- package/dist/core/message/send-receipt.js +1 -0
- package/dist/core/message/stream-debouncer.js +9 -2
- package/dist/core/model/model-catalog.js +23 -15
- package/dist/core/model/model-diagnostics.js +28 -10
- package/dist/core/permission/approval-gateway.js +180 -6
- package/dist/core/permission/ec-command-parser.js +465 -56
- package/dist/core/permission/mode.js +18 -3
- package/dist/core/{protected-paths.js → permission/protected-paths.js} +17 -5
- package/dist/core/permission/readonly-shell-query.js +263 -9
- package/dist/core/permission/sandbox-runtime.js +205 -13
- package/dist/core/permission/tool-policy.js +673 -62
- package/dist/core/relation/peer-identity.js +18 -0
- package/dist/core/session/session-fs-store.js +154 -5
- package/dist/core/session/session-manager.js +299 -30
- package/dist/core/session/session-renew.js +19 -12
- package/dist/core/session/session-turn-coordinator.js +11 -4
- package/dist/eck/kit-renderer.js +18 -9
- package/dist/index.js +283 -65
- package/dist/ipc.js +374 -24
- package/dist/paths.js +64 -7
- package/dist/response-system/context-builder.js +1 -7
- package/dist/trigger/anomaly-store.js +1 -0
- package/dist/trigger/feedback.js +56 -5
- package/dist/trigger/history.js +79 -4
- package/dist/trigger/legacy-session-history.js +2 -2
- package/dist/trigger/parser.js +3 -2
- package/dist/trigger/validation.js +6 -1
- package/dist/utils/atomic-write.js +27 -0
- package/dist/utils/ecweb-utils.js +16 -2
- package/dist/utils/error-utils.js +4 -1
- package/dist/utils/logger.js +21 -2
- package/dist/utils/process-tree-stats.js +24 -4
- package/dist/utils/process-tree-worker.js +31 -0
- package/dist/utils/project-path.js +1 -2
- package/dist/utils/stats.js +52 -18
- package/dist/utils/welcome.js +2 -2
- package/kits/docs/INDEX.md +1 -1
- package/kits/docs/evolcore/INDEX.md +1 -1
- package/kits/docs/evolcore/contact.md +7 -1
- package/kits/docs/evolcore/msg.md +16 -0
- package/kits/rules/01-overview.md +1 -1
- package/kits/rules/03-identity.md +1 -1
- package/kits/rules/05-venue.md +1 -1
- package/kits/schemas/_meta.json +10 -5
- package/kits/schemas/agent-config.schema.10.json +2 -1
- package/kits/schemas/agent-config.schema.11.json +421 -0
- package/kits/schemas/daemon.schema.5.json +135 -0
- package/kits/schemas/daemon.schema.6.json +131 -0
- package/kits/schemas/defaults.schema.5.json +119 -0
- package/kits/schemas/migrations/README.md +3 -1
- package/kits/schemas/relation-config.schema.8.json +13 -0
- package/kits/schemas/role-config.schema.1.json +1 -2
- package/kits/schemas/single-session.schema.3.json +32 -0
- package/kits/templates/roles/admin.json +1 -0
- package/kits/templates/roles/member.json +1 -0
- package/kits/templates/roles/visitor.json +1 -0
- package/package.json +7 -3
- package/skills/eclink/SKILL.md +2 -0
|
@@ -5,7 +5,6 @@ import { isTransientProtocolMessage, messageLogPath } from '../message/message-l
|
|
|
5
5
|
import { readAllJsonlLines } from './session-fs-store.js';
|
|
6
6
|
import { ResponseModeRegistry } from '../../response-system/registry.js';
|
|
7
7
|
import { registerBuiltinModes } from '../../response-system/modes/index.js';
|
|
8
|
-
import { resolveEffectiveResponseModeConfig } from '../../response-system/config-resolver.js';
|
|
9
8
|
import { normalizeBaseagent } from '../../agents/baseagent.js';
|
|
10
9
|
const DEFAULT_AFTER_HOURS = 24;
|
|
11
10
|
const DEFAULT_FALLBACK = 'continue';
|
|
@@ -230,23 +229,31 @@ export class SessionRenewService {
|
|
|
230
229
|
}, { cache: true, expand: true });
|
|
231
230
|
}
|
|
232
231
|
resolveAuxiliaryConfig(config, baseagent) {
|
|
233
|
-
const resolved = resolveEffectiveResponseModeConfig(this.responseModeRegistry, config);
|
|
234
|
-
const rawModel = resolved.modeConfig.auxiliaryModel;
|
|
235
232
|
const canonicalBaseagent = normalizeBaseagent(baseagent).canonical;
|
|
236
|
-
const
|
|
237
|
-
?
|
|
238
|
-
:
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
233
|
+
const baseagentConfig = canonicalBaseagent !== 'unknown'
|
|
234
|
+
? config.baseagents?.[canonicalBaseagent]
|
|
235
|
+
: undefined;
|
|
236
|
+
const rawBaseagentConfig = baseagentConfig && typeof baseagentConfig === 'object'
|
|
237
|
+
? baseagentConfig
|
|
238
|
+
: undefined;
|
|
239
|
+
// Auxiliary inference is owned exclusively by the selected baseagent. Old
|
|
240
|
+
// response-mode bucket values must be migrated before they can take effect.
|
|
241
|
+
const configuredMode = typeof config.responseMode === 'string' && config.responseMode.trim()
|
|
242
|
+
? config.responseMode.trim()
|
|
243
|
+
: undefined;
|
|
244
|
+
const responseMode = configuredMode && this.responseModeRegistry.has(configuredMode)
|
|
245
|
+
? configuredMode
|
|
246
|
+
: this.responseModeRegistry.getPreferredId() ?? 'single-session';
|
|
247
|
+
const rawModel = rawBaseagentConfig?.auxiliaryModel;
|
|
248
|
+
const rawEffort = rawBaseagentConfig?.auxiliaryEffort;
|
|
249
|
+
const model = typeof rawModel === 'string' && rawModel.trim()
|
|
250
|
+
? rawModel.trim()
|
|
243
251
|
: undefined;
|
|
244
|
-
const rawEffort = resolved.modeConfig.auxiliaryEffort;
|
|
245
252
|
const effort = typeof rawEffort === 'string' && AUXILIARY_EFFORTS.has(rawEffort)
|
|
246
253
|
? rawEffort
|
|
247
254
|
: undefined;
|
|
248
255
|
return {
|
|
249
|
-
responseMode
|
|
256
|
+
responseMode,
|
|
250
257
|
model,
|
|
251
258
|
effort,
|
|
252
259
|
invalidEffort: rawEffort !== undefined && effort === undefined,
|
|
@@ -208,9 +208,16 @@ export class SessionTurnCoordinator {
|
|
|
208
208
|
return true;
|
|
209
209
|
}
|
|
210
210
|
async persist(session, state) {
|
|
211
|
-
const
|
|
212
|
-
session.metadata = metadata;
|
|
213
|
-
this.states.set(session.id,
|
|
214
|
-
|
|
211
|
+
const next = cloneTurnMetadata(state);
|
|
212
|
+
session.metadata = { ...(session.metadata ?? {}), turnState: next };
|
|
213
|
+
this.states.set(session.id, next);
|
|
214
|
+
if (typeof this.sessionManager.updateTurnState === 'function') {
|
|
215
|
+
await this.sessionManager.updateTurnState(session.id, next);
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
// Compatibility for minimal test doubles and pre-patch adapters. Real
|
|
219
|
+
// SessionManager instances always expose updateTurnState.
|
|
220
|
+
await this.sessionManager.updateSession(session.id, { metadata: { turnState: next } });
|
|
221
|
+
}
|
|
215
222
|
}
|
|
216
223
|
}
|
package/dist/eck/kit-renderer.js
CHANGED
|
@@ -4,6 +4,7 @@ import { isEckSnapshotsEnabled } from '../config-store.js';
|
|
|
4
4
|
import { eckDebugDir } from '../paths.js';
|
|
5
5
|
import { logger } from '../utils/logger.js';
|
|
6
6
|
import { clearRoleStoreCache } from '../config/role-store.js';
|
|
7
|
+
import { resolveAgentLifecycle } from '../config/lifecycle.js';
|
|
7
8
|
import { loadManifest, loadManifestMeta, invalidateManifestCache, evaluateWhen, renderTemplate, renderLoopSection, resolvePathWithDiag, loadSectionFiles, loadChildTemplate, buildPathMappings, shortenPath, } from './manifest-engine.js';
|
|
8
9
|
const DEFAULT_MANIFEST_FILE = 'eck_manifest.json';
|
|
9
10
|
// ── Caches ──
|
|
@@ -58,7 +59,15 @@ export function renderKitSections(ctx, manifestFile = DEFAULT_MANIFEST_FILE) {
|
|
|
58
59
|
const meta = loadManifestMeta(manifestFile);
|
|
59
60
|
const fileParts = [];
|
|
60
61
|
const fragmentParts = [];
|
|
61
|
-
|
|
62
|
+
// Legacy callers may omit lifecycle; preserve the same active default used
|
|
63
|
+
// by agent configuration normalization while leaving explicit invalid
|
|
64
|
+
// values untouched for fail-closed manifest conditions.
|
|
65
|
+
const resolvedLifecycle = resolveAgentLifecycle({ lifecycle: ctx.vars.lifecycle });
|
|
66
|
+
const vars = resolvedLifecycle === null
|
|
67
|
+
? ctx.vars
|
|
68
|
+
: { ...ctx.vars, lifecycle: resolvedLifecycle };
|
|
69
|
+
const renderCtx = { ...ctx, vars };
|
|
70
|
+
const pathMappings = buildPathMappings(vars);
|
|
62
71
|
const sessionCache = getSessionCache(ctx.sessionId);
|
|
63
72
|
const diagnostics = [];
|
|
64
73
|
// 总闸计数(跨所有段累计)
|
|
@@ -78,7 +87,7 @@ export function renderKitSections(ctx, manifestFile = DEFAULT_MANIFEST_FILE) {
|
|
|
78
87
|
if (capReached) {
|
|
79
88
|
diag.skippedByTotalCap = true;
|
|
80
89
|
// 仅当该段本会命中时才计入"未加载"集合(enabled 且 when 通过)
|
|
81
|
-
if (section.enabled !== false && evaluateWhen(section.when,
|
|
90
|
+
if (section.enabled !== false && evaluateWhen(section.when, vars)) {
|
|
82
91
|
diag.whenPassed = true;
|
|
83
92
|
skippedByCap.push(section.id);
|
|
84
93
|
}
|
|
@@ -90,21 +99,21 @@ export function renderKitSections(ctx, manifestFile = DEFAULT_MANIFEST_FILE) {
|
|
|
90
99
|
diagnostics.push(diag);
|
|
91
100
|
continue;
|
|
92
101
|
}
|
|
93
|
-
diag.whenPassed = evaluateWhen(section.when,
|
|
102
|
+
diag.whenPassed = evaluateWhen(section.when, vars);
|
|
94
103
|
if (!diag.whenPassed) {
|
|
95
104
|
diag.resolveStatus = 'skipped-when';
|
|
96
105
|
diagnostics.push(diag);
|
|
97
106
|
continue;
|
|
98
107
|
}
|
|
99
108
|
if (rawPath) {
|
|
100
|
-
const r = resolvePathWithDiag(rawPath,
|
|
109
|
+
const r = resolvePathWithDiag(rawPath, vars);
|
|
101
110
|
diag.resolvedPath = r.resolved;
|
|
102
111
|
diag.resolveStatus = r.status;
|
|
103
112
|
if (r.unresolvedTokens.length > 0)
|
|
104
113
|
diag.unresolvedTokens = r.unresolvedTokens;
|
|
105
114
|
}
|
|
106
115
|
const overflowOut = {};
|
|
107
|
-
const files = loadSectionFiles(section,
|
|
116
|
+
const files = loadSectionFiles(section, vars, sessionCache, overflowOut);
|
|
108
117
|
diag.fileCount = files.length;
|
|
109
118
|
if (overflowOut.value)
|
|
110
119
|
diag.dirOverflow = overflowOut.value;
|
|
@@ -124,7 +133,7 @@ export function renderKitSections(ctx, manifestFile = DEFAULT_MANIFEST_FILE) {
|
|
|
124
133
|
capReached = true;
|
|
125
134
|
break;
|
|
126
135
|
}
|
|
127
|
-
const content = renderSectionContent(section, rawContent,
|
|
136
|
+
const content = renderSectionContent(section, rawContent, vars);
|
|
128
137
|
if (!content.trim()) {
|
|
129
138
|
diag.emptyContent = true;
|
|
130
139
|
continue;
|
|
@@ -151,7 +160,7 @@ export function renderKitSections(ctx, manifestFile = DEFAULT_MANIFEST_FILE) {
|
|
|
151
160
|
}
|
|
152
161
|
diag.used = anyUsed;
|
|
153
162
|
// 本段触发总闸但一个文件都没用上 → 也算"未加载"
|
|
154
|
-
if (capReached && !anyUsed && evaluateWhen(section.when,
|
|
163
|
+
if (capReached && !anyUsed && evaluateWhen(section.when, vars)) {
|
|
155
164
|
diag.skippedByTotalCap = true;
|
|
156
165
|
diag.whenPassed = true;
|
|
157
166
|
skippedByCap.push(section.id);
|
|
@@ -169,7 +178,7 @@ export function renderKitSections(ctx, manifestFile = DEFAULT_MANIFEST_FILE) {
|
|
|
169
178
|
? `<system-reminder>\nEvolCore Context Kit documents are shown below.\n\n${body}\n\nIMPORTANT: Use this context when it affects the current interaction.\n</system-reminder>`
|
|
170
179
|
: '';
|
|
171
180
|
const fragmentsOutput = fragmentParts.length > 0 ? fragmentParts.join('\n\n') : '';
|
|
172
|
-
writeDebugFiles(
|
|
181
|
+
writeDebugFiles(renderCtx, output, fragmentsOutput, diagnostics);
|
|
173
182
|
return output;
|
|
174
183
|
}
|
|
175
184
|
export function cleanEckDebug() {
|
|
@@ -245,7 +254,7 @@ const PARAM_DESCRIPTIONS = {
|
|
|
245
254
|
proactiveSendTargetLabel: 'proactive 发送目标标签(对方/群里)',
|
|
246
255
|
readonly: '是否只读模式',
|
|
247
256
|
evolcoreMode: 'evolcore 运行模式(dev=源码仓库可直接修改 | install=全局安装包只读)',
|
|
248
|
-
baseAgent: 'base agent 规范值(claude/codex/gemini/
|
|
257
|
+
baseAgent: 'base agent 规范值(claude/codex/gemini/ecagent)',
|
|
249
258
|
baseAgentName: 'base agent 显示名',
|
|
250
259
|
baseAgentModel: 'base agent 引擎底座模型(evolcore 作用域无配置时的兜底)',
|
|
251
260
|
effectiveModel: '当前实际生效模型(关系级 > agent级 > 全局 优先级解析结果)',
|