evolcore 0.0.47 → 0.0.48
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 +56 -1
- package/bin/ec-build.mjs +86 -0
- package/dist/agent-template/jobs.js +12 -4
- package/dist/agent-template/runtime.js +139 -39
- package/dist/agent-template/service.js +66 -13
- package/dist/agents/baseagent.js +60 -20
- package/dist/agents/claude-runner.js +34 -17
- package/dist/agents/codex-runner.js +31 -16
- package/dist/agents/ecagent-runner.js +7 -4
- package/dist/agents/gemini-runner.js +5 -2
- package/dist/agents/runner-types.js +5 -21
- package/dist/aun/aid/agentmd.js +5 -1
- package/dist/aun/service-proxy.js +4 -2
- package/dist/build-identity.json +1 -0
- package/dist/channels/aun.js +81 -24
- package/dist/channels/daemon.js +9 -25
- package/dist/cli/aun-commands.js +86 -51
- package/dist/cli/code-stats.js +19 -8
- package/dist/cli/command-log.js +1 -1
- package/dist/cli/daemon-commands.js +44 -43
- package/dist/cli/directory.js +7 -1
- package/dist/cli/ecmsg-gateway.js +5 -2
- package/dist/cli/index.js +2 -8
- package/dist/cli/init-channel.js +4 -6
- package/dist/cli/init.js +72 -50
- package/dist/cli/invoke-command.js +1 -1
- package/dist/cli/provider-command.js +74 -13
- package/dist/cli/role.js +61 -17
- package/dist/cli/stats.js +3 -3
- package/dist/cli/thread-command.js +16 -51
- package/dist/config/boot-log.js +3 -9
- package/dist/config/builtin-roles.js +5 -7
- package/dist/config/config-manager.js +2 -6
- package/dist/config/daemon-services.js +30 -3
- package/dist/config/gateway-config.js +2 -2
- package/dist/config/invoke-ipc-service.js +6 -4
- package/dist/config/peer-bind-code.js +3 -4
- package/dist/config/peer-book-store.js +62 -229
- package/dist/config/peer-book.js +26 -27
- package/dist/config/peer-role-resolver.js +16 -1
- package/dist/config/provider-identity-migration.js +4 -1
- package/dist/config/provider-ipc-service.js +56 -11
- package/dist/config/provider-menu-request.js +24 -5
- package/dist/config/provider-templates.js +127 -0
- package/dist/config/providers-config.js +59 -8
- package/dist/config/providers-management.js +467 -49
- package/dist/config/role-command-service.js +248 -1
- package/dist/config/schema-migration.js +105 -4
- package/dist/core/agent-application-service.js +6 -1
- package/dist/core/agent-runtime.js +4 -0
- package/dist/core/auth/agent-delegation.js +2 -1
- package/dist/core/auth/auth-gateway.js +2 -1
- package/dist/core/auth/delegation-authorization.js +3 -0
- package/dist/core/auth/operation-authorizer.js +25 -0
- package/dist/core/auth/operation-catalog.js +28 -64
- package/dist/core/capability/providers/codex-capability-provider.js +7 -8
- package/dist/core/channel-loader.js +18 -0
- package/dist/core/command/agent-control.js +32 -0
- package/dist/core/command/command-handler.js +81 -85
- package/dist/core/command/menu-catalog.js +1 -0
- package/dist/core/command/menu-handler.js +61 -149
- package/dist/core/command/menu-protocol.js +7 -1
- package/dist/core/command/provider-menu.js +13 -3
- package/dist/core/command/role-menu.js +47 -23
- package/dist/core/command/slash-handler.js +26 -43
- package/dist/core/command/team-workspace-items.js +81 -12
- package/dist/core/command/team-workspace-team.js +9 -71
- package/dist/core/command/topic-slash.js +9 -30
- package/dist/core/daemon-bootstrap.js +8 -1
- package/dist/core/daemon-control.js +7 -7
- package/dist/core/evolagent-registry.js +14 -1
- package/dist/core/file-integrity/store.js +2 -0
- package/dist/core/handoff/runtime.js +37 -1
- package/dist/core/inference/text-inference.js +3 -1
- package/dist/core/initialization/service.js +11 -6
- package/dist/core/interaction-router.js +3 -0
- package/dist/core/invoke/executors/text.js +72 -19
- package/dist/core/ipc-registration.js +2 -1
- package/dist/core/message/aun-ipc-sender.js +165 -55
- package/dist/core/message/im-renderer.js +1 -1
- package/dist/core/message/message-bridge.js +51 -334
- package/dist/core/message/message-log.js +5 -0
- package/dist/core/message/message-queue.js +22 -0
- package/dist/core/message/message-utils.js +8 -0
- package/dist/core/message/response-engine.js +429 -116
- package/dist/core/message/send-routing.js +5 -1
- package/dist/core/model/catalog-service.js +31 -11
- package/dist/core/model/model-capabilities.js +22 -4
- package/dist/core/model/model-catalog.js +1 -0
- package/dist/core/ownership/owner-resolver.js +328 -50
- package/dist/core/permission/protected-paths.js +6 -6
- package/dist/core/relation/peer-identity.js +23 -1
- package/dist/core/relation/same-owner-proof.js +81 -112
- package/dist/core/session/adapters/codex-session-file-adapter.js +96 -15
- package/dist/core/session/session-file-health.js +13 -7
- package/dist/core/session/session-fs-store.js +91 -35
- package/dist/core/session/session-manager.js +68 -24
- package/dist/core/session/session-mapper.js +14 -34
- package/dist/core/session/session-transcript.js +5 -1
- package/dist/core/task/task-activity-store.js +84 -0
- package/dist/core/task/task-recovery-service.js +12 -0
- package/dist/core/thread/command-parser.js +7 -12
- package/dist/core/thread/thread-context-storage.js +3 -2
- package/dist/core/thread/thread-operation.js +2 -13
- package/dist/core/thread/thread-service.js +15 -46
- package/dist/directory/owner-directory-admission.js +1 -1
- package/dist/directory/owner-directory-cache.js +45 -28
- package/dist/directory/owner-directory-markdown.js +13 -1
- package/dist/directory/owner-directory-query-operation.js +29 -3
- package/dist/directory/owner-directory-remarks.js +11 -3
- package/dist/eck/message-renderer.js +84 -24
- package/dist/ecweb/basic-settings-service.js +3 -1
- package/dist/ecweb/message-context-service.js +1 -1
- package/dist/ecweb/pairing.js +4 -3
- package/dist/ecweb/providers-service.js +26 -1
- package/dist/ecweb/runtime/lifecycle.js +18 -8
- package/dist/ecweb/runtime/proxy-access.js +74 -0
- package/dist/ecweb/runtime/supervisor.js +4 -2
- package/dist/event-center/registry.js +13 -2
- package/dist/event-center/runtime.js +103 -11
- package/dist/event-center/script-runner.js +5 -5
- package/dist/index.js +92 -59
- package/dist/ipc.js +13 -2
- package/dist/outputs/events.js +62 -0
- package/dist/outputs/protocol.js +102 -0
- package/dist/outputs/service.js +279 -0
- package/dist/paths.js +3 -0
- package/dist/proxy/manager.js +43 -13
- package/dist/services/index.js +89 -4
- package/dist/services/ipc-operation.js +4 -15
- package/dist/services/pack-manager.js +12 -1
- package/dist/services/router.js +21 -6
- package/dist/services/script-runner.js +5 -4
- package/dist/services/validation.js +1 -1
- package/dist/stats/budget.js +1 -1
- package/dist/stats/db.js +19 -0
- package/dist/stats/index.js +1 -1
- package/dist/stats/{price-resolver.js → model-resolver.js} +305 -24
- package/dist/stats/normalizer.js +2 -0
- package/dist/stats/query.js +35 -27
- package/dist/stats/role-budget.js +5 -2
- package/dist/stats/writer.js +10 -6
- package/dist/trigger/audit.js +7 -0
- package/dist/trigger/authorization.js +105 -11
- package/dist/trigger/feedback.js +10 -0
- package/dist/trigger/history.js +37 -11
- package/dist/trigger/ipc-service.js +12 -1
- package/dist/trigger/manager.js +1 -0
- package/dist/trigger/scheduler.js +7 -5
- package/dist/trigger/script-executor.js +2 -1
- package/dist/trigger/script-sandbox.js +9 -3
- package/dist/trigger/validation.js +22 -0
- package/dist/utils/cross-platform.js +73 -26
- package/dist/utils/error-dict.json +94 -4
- package/dist/utils/error-utils.js +27 -4
- package/dist/utils/evolcore-version.js +36 -65
- package/dist/utils/msg-diag.js +1 -0
- package/dist/utils/process-introspect.js +12 -7
- package/dist/utils/process-tree.js +50 -2
- package/dist/utils/windows-shell-trust.js +2 -0
- package/dist/workbench/protocol.js +80 -0
- package/dist/workbench/service.js +359 -0
- package/ecagent/dist/types.d.ts +6 -2
- package/kits/docs/context-assembly.md +1 -1
- package/kits/docs/evolcore/INDEX.md +2 -2
- package/kits/docs/evolcore/config.md +12 -0
- package/kits/docs/evolcore/directory.md +22 -3
- package/kits/docs/evolcore/ecweb-lifecycle.md +15 -0
- package/kits/docs/evolcore/model.md +10 -0
- package/kits/docs/evolcore/peer.md +19 -65
- package/kits/docs/evolcore/provider.md +123 -3
- package/kits/docs/evolcore/role.md +80 -0
- package/kits/docs/evolcore/services.md +6 -6
- package/kits/docs/evolcore/team-workspace.md +1 -1
- package/kits/docs/evolcore/thread-chain.md +14 -15
- package/kits/docs/evolcore/tool-authorization.md +5 -0
- package/kits/docs/evolcore/trigger.md +10 -0
- package/kits/eck_message_manifest.json +12 -0
- package/kits/provider-templates.json +1213 -0
- package/kits/rules/04-relation.md +3 -3
- package/kits/schemas/_meta.json +14 -2
- package/kits/schemas/contact-book.schema.4.json +52 -0
- package/kits/schemas/providers.schema.3.json +200 -0
- package/kits/skills/.switches.json +4 -0
- package/kits/skills/ability/references/calling.md +1 -1
- package/kits/skills/ec-group/SKILL.md +2 -2
- package/kits/skills/ec-identity/SKILL.md +19 -72
- package/kits/skills/ec-provider/SKILL.md +221 -0
- package/kits/skills/ec-provider/scripts/check-model.mjs +80 -0
- package/kits/skills/ec-trigger/SKILL.md +1 -1
- package/kits/skills/thread-ops/SKILL.md +34 -21
- package/kits/templates/message-fragments/group-batch-item.md +1 -1
- package/kits/templates/message-fragments/group-batch.md +1 -1
- package/kits/templates/message-fragments/inject-default.md +1 -1
- package/kits/templates/message-fragments/interrupt-insert.md +1 -0
- package/kits/templates/message-fragments/item-group.md +1 -1
- package/kits/templates/message-fragments/item-private.md +1 -1
- package/kits/templates/message-fragments/thread-context.md +1 -1
- package/kits/templates/message-fragments/trigger-session.md +1 -1
- package/kits/templates/message-fragments/trigger-thread-check.md +1 -1
- package/kits/templates/roles/admin.json +2 -19
- package/kits/templates/roles/member.json +0 -3
- package/kits/templates/system-fragments/baseagent.md +6 -0
- package/kits/templates/system-fragments/commands.md +3 -3
- package/kits/templates/system-fragments/managed-runtime.md +1 -1
- package/kits/templates/system-fragments/relation.md +1 -1
- package/kits/templates/system-fragments/thread.md +6 -5
- package/package.json +6 -4
- package/scripts/agent-template/inspect.mjs +4 -1
- package/scripts/agent-template/shared/common.mjs +2 -3
- package/scripts/agent-template/shared/template-contract.mjs +2 -1
- package/scripts/agent-template/shared/template-package.mjs +9 -2
- package/scripts/agent-template/shared/template-runtime.mjs +20 -5
- package/scripts/agent-template/team-pack.mjs +6 -3
- package/dist/cli/peer.js +0 -127
- package/dist/config/peer-operation-service.js +0 -132
- package/dist/config/peer-request-service.js +0 -532
- package/dist/core/command/connect-menu.js +0 -624
|
@@ -247,10 +247,14 @@ export function resolveSendRoute(input, session, deps = {}) {
|
|
|
247
247
|
checkEveryMs = DEFAULT_CROSS_TOPIC_CHECK_EVERY_MS;
|
|
248
248
|
checkEveryDefaulted = true;
|
|
249
249
|
}
|
|
250
|
+
else if (input.checkEvery.trim().toLowerCase() === 'none') {
|
|
251
|
+
// 显式不建复查:checkEveryMs 保持 undefined(≠ 未指定,不走默认周期)。
|
|
252
|
+
checkEveryMs = undefined;
|
|
253
|
+
}
|
|
250
254
|
else {
|
|
251
255
|
const parsed = parseDurationToMs(input.checkEvery);
|
|
252
256
|
if (parsed === null) {
|
|
253
|
-
return fail('INVALID_ARGUMENT', `--check-every 时长非法:${input.checkEvery}`, '合法格式:5m、30m、2h、1d');
|
|
257
|
+
return fail('INVALID_ARGUMENT', `--check-every 时长非法:${input.checkEvery}`, '合法格式:5m、30m、2h、1d、none');
|
|
254
258
|
}
|
|
255
259
|
checkEveryMs = parsed;
|
|
256
260
|
}
|
|
@@ -17,7 +17,8 @@ export const CATALOG_ROUTE_TIMEOUT_MS = 15_000;
|
|
|
17
17
|
* v4:统一缺失 effort 元数据时的 transport fallback,并记录来源。
|
|
18
18
|
* v5:持久化 provider 原始目录,避免相同 provider/path 的不同服务风格相互污染。
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
// v7: directory, service protocol and effective credentials identify persisted snapshots too.
|
|
21
|
+
export const CATALOG_SNAPSHOT_VERSION = 7;
|
|
21
22
|
export const CONFIGURABLE_EFFORTS = ['low', 'medium', 'high', 'xhigh', 'max'];
|
|
22
23
|
export const TRANSPORT_EFFORTS = {
|
|
23
24
|
claude: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
@@ -38,16 +39,16 @@ function stable(value) {
|
|
|
38
39
|
export const catalogHash = (value) => createHash('sha256').update(stable(value)).digest('hex');
|
|
39
40
|
export function catalogContextKey(context) {
|
|
40
41
|
const headers = Object.fromEntries(Object.entries(context.headers ?? {}).map(([k, v]) => [k.toLowerCase(), v]));
|
|
42
|
+
const catalog = { baseUrl: context.catalogBaseUrl, path: context.catalogPath,
|
|
43
|
+
service: context.serviceType ?? context.providerServiceType, style: context.style };
|
|
41
44
|
if (context.providerId)
|
|
42
45
|
return catalogHash({ providerId: context.providerId, baseUrl: context.baseUrl?.replace(/\/+$/, ''),
|
|
43
|
-
apiKey: context.apiKey, headers, queryParams: context.queryParams ?? {}, configUnavailable: context.configUnavailable });
|
|
46
|
+
catalog, apiKey: context.apiKey, headers, queryParams: context.queryParams ?? {}, configUnavailable: context.configUnavailable });
|
|
44
47
|
return catalogHash({ scope: context.scope, baseagent: context.baseagent, provider: context.provider,
|
|
45
48
|
baseUrl: context.baseUrl?.replace(/\/+$/, ''), apiKey: context.apiKey, authType: context.authType,
|
|
46
|
-
headers, queryParams: context.queryParams ?? {}, configUnavailable: context.configUnavailable });
|
|
49
|
+
catalog, headers, queryParams: context.queryParams ?? {}, configUnavailable: context.configUnavailable });
|
|
47
50
|
}
|
|
48
51
|
export function catalogStorageKey(context) {
|
|
49
|
-
if (context.providerId)
|
|
50
|
-
return catalogHash({ providerId: context.providerId, path: context.catalogPath ?? context.baseUrl?.replace(/\?.*$/u, '') ?? '' });
|
|
51
52
|
return catalogContextKey(context);
|
|
52
53
|
}
|
|
53
54
|
const strings = (value) => Array.isArray(value)
|
|
@@ -91,8 +92,10 @@ export function parseModelList(json, _url) {
|
|
|
91
92
|
...(strings(item?.protocols ?? item?.supported_protocols) ? { protocols: strings(item.protocols ?? item.supported_protocols) } : {}),
|
|
92
93
|
...(typeof item?.capabilities?.tool_calling === 'boolean' ? { supportsTools: item.capabilities.tool_calling } : {}),
|
|
93
94
|
// 网关显式给出的 context_window 优先;缺失时用后缀声明的窗口兜底。
|
|
94
|
-
...(typeof (item?.context_window ?? item?.contextWindow) === 'number'
|
|
95
|
-
|
|
95
|
+
...(typeof (item?.context_window ?? item?.contextWindow) === 'number'
|
|
96
|
+
? { contextWindow: item.context_window ?? item.contextWindow, contextWindowSource: 'provider-catalog' }
|
|
97
|
+
: parsed.contextWindow !== undefined
|
|
98
|
+
? { contextWindow: parsed.contextWindow, contextWindowSource: 'explicit-suffix' } : {}),
|
|
96
99
|
...(typeof item?.max_output_tokens === 'number' ? { maxOutputTokens: item.max_output_tokens } : {}),
|
|
97
100
|
});
|
|
98
101
|
}
|
|
@@ -173,8 +176,11 @@ export function catalogEfforts(snapshot, model, baseagent) {
|
|
|
173
176
|
return entry ? configurableEfforts(baseagent, entry.reasoningLevels) : [];
|
|
174
177
|
}
|
|
175
178
|
export function assertCatalogSelectable(snapshot) {
|
|
176
|
-
|
|
177
|
-
|
|
179
|
+
const failure = snapshot.diagnostics.find(d => d.code === 'AUTH_FAILED');
|
|
180
|
+
if (failure)
|
|
181
|
+
throw Object.assign(new Error('模型网关鉴权失败(401/403),请检查当前连接凭据'), {
|
|
182
|
+
...(failure.status === 401 ? { code: 'PROVIDER_CREDENTIAL_INVALID' } : {}), status: failure.status,
|
|
183
|
+
});
|
|
178
184
|
}
|
|
179
185
|
class GatewayError extends Error {
|
|
180
186
|
status;
|
|
@@ -186,9 +192,23 @@ class GatewayError extends Error {
|
|
|
186
192
|
async function gatewayModels(context, fetcher) {
|
|
187
193
|
const configuredStyle = context.style ?? context.baseagent;
|
|
188
194
|
const style = configuredStyle === 'anthropic' ? 'claude' : configuredStyle === 'openai-responses' ? 'codex' : configuredStyle;
|
|
195
|
+
// 目录地址独立于 API 地址:provider 可声明 catalogBaseUrl(API 与目录不同路径)。
|
|
196
|
+
const listBaseUrl = context.catalogBaseUrl ?? context.baseUrl;
|
|
197
|
+
const providerUrls = [appendRequestPath(listBaseUrl, 'models', context.queryParams)];
|
|
198
|
+
// 兜底:有些网关的 API 子路径不提供目录(如 DeepSeek 官方 /anthropic/models 返回 404,
|
|
199
|
+
// 目录只在根 /models)。同一 origin 下再试一次根路径,失败再落到下面的 404 处理。
|
|
200
|
+
if (context.providerId) {
|
|
201
|
+
try {
|
|
202
|
+
const parsedBase = new URL(listBaseUrl);
|
|
203
|
+
if (parsedBase.pathname && parsedBase.pathname !== '/') {
|
|
204
|
+
providerUrls.push(appendRequestPath(parsedBase.origin, 'models', context.queryParams));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
catch { /* baseUrl 非法时保持单候选,交给后面的错误处理 */ }
|
|
208
|
+
}
|
|
189
209
|
const urls = [...new Set(style === 'gemini' || context.providerId
|
|
190
|
-
?
|
|
191
|
-
: [appendV1RequestPath(
|
|
210
|
+
? providerUrls
|
|
211
|
+
: [appendV1RequestPath(listBaseUrl, 'models', context.queryParams), appendRequestPath(listBaseUrl, 'models', context.queryParams)])];
|
|
192
212
|
let last;
|
|
193
213
|
for (const url of urls) {
|
|
194
214
|
try {
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { findModelSpec } from '../../stats/
|
|
1
|
+
import { findModelSpec } from '../../stats/model-resolver.js';
|
|
2
2
|
import { resolveCatalogModel } from './catalog-service.js';
|
|
3
3
|
import { parseModelId } from './context-window-suffix.js';
|
|
4
|
+
/** Shared large-model compaction cap, passed through each runner's native controls. */
|
|
5
|
+
export const EVOLCORE_AUTO_COMPACT_WINDOW_TOKENS = 550_000;
|
|
6
|
+
/** Claude Code --autocompact accepts 100k–1M tokens. */
|
|
7
|
+
export const CLAUDE_AUTO_COMPACT_MIN_TOKENS = 100_000;
|
|
8
|
+
export const CLAUDE_AUTO_COMPACT_MAX_TOKENS = 1_000_000;
|
|
4
9
|
export function resolveModelCapabilities(evolcoreHome, modelId, options) {
|
|
5
10
|
const model = options.catalog ? resolveCatalogModel(options.catalog, modelId) : modelId;
|
|
6
11
|
const entry = options.catalog?.models.find(candidate => candidate.id === model);
|
|
@@ -31,7 +36,20 @@ export function resolveModelCapabilities(evolcoreHome, modelId, options) {
|
|
|
31
36
|
maxOutputTokensSource: output[1],
|
|
32
37
|
};
|
|
33
38
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
/** Shared threshold; callers retain their runner-specific rules for sending it. */
|
|
40
|
+
export function evolcoreAutoCompactTokens(contextWindow, extraReserveTokens = 0) {
|
|
41
|
+
const reserve = Math.max(extraReserveTokens, Math.min(10_000, Math.floor(contextWindow * 0.05)));
|
|
42
|
+
return Math.min(EVOLCORE_AUTO_COMPACT_WINDOW_TOKENS, Math.max(1, contextWindow - reserve));
|
|
43
|
+
}
|
|
44
|
+
export function resolveCatalogAutoCompactPolicy(catalog, model) {
|
|
45
|
+
if (!catalog || catalog.source !== 'gateway')
|
|
46
|
+
return undefined;
|
|
47
|
+
const canonical = resolveCatalogModel(catalog, model);
|
|
48
|
+
const entry = catalog.models.find(candidate => candidate.id === canonical);
|
|
49
|
+
const contextWindow = entry?.contextWindow;
|
|
50
|
+
if (entry?.contextWindowSource !== 'provider-catalog'
|
|
51
|
+
|| typeof contextWindow !== 'number' || !Number.isFinite(contextWindow) || contextWindow < 1)
|
|
52
|
+
return undefined;
|
|
53
|
+
const windowTokens = Math.floor(contextWindow);
|
|
54
|
+
return { contextWindow: windowTokens, autoCompactTokens: evolcoreAutoCompactTokens(windowTokens) };
|
|
37
55
|
}
|
|
@@ -155,6 +155,7 @@ export function resolveCatalogContext(self, ba) {
|
|
|
155
155
|
providerId: provider.providerId,
|
|
156
156
|
providerServiceType: provider.serviceType,
|
|
157
157
|
catalogPath: provider.catalogPath,
|
|
158
|
+
catalogBaseUrl: provider.catalogBaseUrl,
|
|
158
159
|
style: provider.style,
|
|
159
160
|
baseUrl: provider.baseUrl,
|
|
160
161
|
apiKey: provider.apiKey,
|