evolcore 0.0.41 → 0.0.42
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 +36 -0
- package/bin/codex-managed-hook.mjs +9 -5
- package/dist/agents/baseagent.js +156 -16
- package/dist/agents/claude-runner.js +10 -3
- package/dist/agents/codex/catalog.js +8 -4
- package/dist/agents/codex-runner.js +236 -59
- package/dist/agents/ecagent-runner.js +82 -13
- package/dist/aun/aid/agentmd.js +106 -27
- package/dist/aun/aid/client.js +1 -1
- package/dist/aun/aid/control-aid.js +65 -13
- package/dist/aun/aid/identity.js +70 -4
- package/dist/aun/aid/index.js +2 -2
- package/dist/aun/service-proxy.js +25 -1
- package/dist/channels/aun.js +242 -209
- package/dist/channels/dingtalk.js +1 -1
- package/dist/channels/feishu.js +1 -1
- package/dist/channels/qqbot.js +1 -1
- package/dist/channels/wechat.js +1 -1
- package/dist/channels/wecom.js +1 -1
- package/dist/cli/agent-command.js +183 -3
- package/dist/cli/agent-create.js +92 -86
- package/dist/cli/agent.js +136 -1
- package/dist/cli/aun-commands.js +137 -35
- package/dist/cli/bench.js +8 -2
- package/dist/cli/command-log.js +1 -1
- package/dist/cli/daemon-commands.js +235 -51
- package/dist/cli/debug-mode.js +1 -1
- package/dist/cli/directory.js +170 -0
- package/dist/cli/index.js +40 -30
- package/dist/cli/init-channel.js +4 -4
- package/dist/cli/init.js +47 -32
- package/dist/cli/managed-command-guard.js +4 -1
- package/dist/cli/model.js +27 -18
- package/dist/cli/pa-workspace-command.js +191 -0
- package/dist/cli/{contact.js → peer.js} +19 -25
- package/dist/cli/restart-monitor.js +11 -4
- package/dist/cli/thread-command.js +47 -18
- package/dist/cli/version.js +18 -18
- package/dist/config/access-policy.js +29 -12
- package/dist/config/boot-log.js +65 -10
- package/dist/config/builtin-roles.js +2 -4
- package/dist/config/config-field-policy.js +3 -0
- package/dist/config/config-manager.js +28 -20
- package/dist/config/{contact-bind-code.js → peer-bind-code.js} +6 -6
- package/dist/config/{contact-book-store.js → peer-book-store.js} +75 -75
- package/dist/config/{contact-book-v2-startup.js → peer-book-v2-startup.js} +2 -2
- package/dist/config/{contact-book.js → peer-book.js} +47 -47
- package/dist/config/peer-operation-service.js +132 -0
- package/dist/config/{contact-request-service.js → peer-request-service.js} +90 -90
- package/dist/config/peer-role-resolver.js +3 -3
- package/dist/config/providers-config.js +17 -8
- package/dist/config/providers.js +1 -1
- package/dist/config/schema-migration.js +336 -39
- package/dist/core/agent-application-service.js +8 -2
- package/dist/core/agent-create-status.js +4 -5
- package/dist/core/agent-ipc-registration.js +5 -4
- package/dist/core/agent-runtime.js +30 -17
- package/dist/core/auth/operation-authorizer.js +0 -24
- package/dist/core/auth/operation-catalog.js +4 -20
- package/dist/core/baseagent-loader.js +27 -3
- package/dist/core/bootstrap-service.js +5 -22
- package/dist/core/capability/capability-manager.js +52 -35
- package/dist/core/channel-loader.js +43 -2
- package/dist/core/channel-runtime.js +2 -2
- package/dist/core/command/agent-control.js +54 -18
- package/dist/core/command/command-handler.js +92 -72
- package/dist/core/command/connect-menu.js +35 -42
- package/dist/core/command/daemon-diagnostics.js +41 -5
- package/dist/core/command/data-root-error.js +10 -0
- package/dist/core/command/data-root-resolver.js +53 -13
- package/dist/core/command/menu-catalog.js +1 -0
- package/dist/core/command/menu-handler.js +163 -65
- package/dist/core/command/menu-protocol.js +52 -0
- package/dist/core/command/pa-workspace-calendar.js +223 -0
- package/dist/core/command/pa-workspace-store.js +459 -0
- package/dist/core/command/role-menu.js +2 -2
- package/dist/core/command/slash-gate.js +1 -1
- package/dist/core/command/slash-handler.js +57 -41
- package/dist/core/daemon-lifecycle.js +90 -31
- package/dist/core/evolagent.js +6 -10
- package/dist/core/handoff/runtime.js +11 -4
- package/dist/core/host-snapshot.js +208 -0
- package/dist/core/initialization/service.js +152 -20
- package/dist/core/ipc-registration.js +33 -4
- package/dist/core/memory/batch-meta.js +27 -0
- package/dist/core/memory/consolidation-ops-records.js +44 -1
- package/dist/core/memory/consolidation.js +169 -27
- package/dist/core/message/aun-ipc-sender.js +2 -8
- package/dist/core/message/im-renderer.js +56 -3
- package/dist/core/message/message-admission.js +121 -124
- package/dist/core/message/message-bridge.js +38 -54
- package/dist/core/message/message-queue.js +7 -0
- package/dist/core/message/outbound.js +34 -9
- package/dist/core/message/response-engine.js +154 -73
- package/dist/core/model/catalog-service.js +1 -1
- package/dist/core/model/config-scope.js +2 -2
- package/dist/core/model/model-catalog.js +5 -4
- package/dist/core/model/model-diagnostics.js +6 -5
- package/dist/core/model/model-fallback.js +3 -6
- package/dist/core/model/model-permission.js +1 -1
- package/dist/core/ownership/owner-resolver.js +9 -9
- package/dist/core/permission/approval-gateway.js +1 -1
- package/dist/core/permission/ec-command-parser.js +2 -2
- package/dist/core/permission/tool-canonical.js +96 -46
- package/dist/core/permission/tool-error-code.js +41 -0
- package/dist/core/permission/tool-policy.js +71 -47
- package/dist/core/role/runtime-policy.js +1 -1
- package/dist/core/session/session-idle-monitor.js +10 -0
- package/dist/core/session/session-manager.js +2 -4
- package/dist/core/session/session-title.js +36 -8
- package/dist/core/system-session/memory.js +2 -7
- package/dist/core/thread/command-parser.js +6 -2
- package/dist/core/thread/ipc-operation.js +51 -36
- package/dist/core/thread/thread-operation.js +29 -61
- package/dist/core/thread/thread-service.js +57 -13
- package/dist/directory/canonical-digest.js +54 -0
- package/dist/directory/owner-directory-admission.js +114 -43
- package/dist/directory/owner-directory-agentmd-sync.js +89 -0
- package/dist/directory/owner-directory-cache.js +847 -459
- package/dist/directory/owner-directory-markdown.js +272 -0
- package/dist/directory/owner-directory-query-operation.js +195 -0
- package/dist/directory/owner-directory-remark-operation.js +147 -0
- package/dist/directory/owner-directory-remarks.js +145 -0
- package/dist/directory/owner-directory-scope.js +55 -0
- package/dist/directory/owner-directory-search.js +148 -0
- package/dist/directory/owner-directory-store.js +227 -0
- package/dist/eck/kit-renderer.js +1 -0
- package/dist/ecweb/basic-settings-service.js +4 -1
- package/dist/ecweb/message-context-service.js +13 -9
- package/dist/index.js +195 -37
- package/dist/ipc.js +86 -22
- package/dist/paths.js +11 -8
- package/dist/product.js +2 -0
- package/dist/proxy/manager.js +13 -2
- package/dist/proxy/service-supervisor.js +8 -1
- package/dist/trigger/history.js +23 -0
- package/dist/trigger/scheduler.js +3 -0
- package/dist/utils/atomic-write.js +21 -0
- package/dist/utils/cross-platform.js +35 -0
- package/dist/utils/ecweb-supervisor.js +42 -0
- package/dist/utils/error-utils.js +2 -1
- package/dist/utils/evolcore-version.js +19 -0
- package/dist/utils/host-info.js +242 -5
- package/dist/utils/instance-registry.js +28 -6
- package/dist/utils/logger.js +59 -14
- package/dist/utils/machine-info.js +46 -0
- package/dist/utils/process-introspect.js +166 -2
- package/dist/utils/startup-trace.js +245 -0
- package/ecagent/dist/agent-loop.js +27 -13
- package/ecagent/dist/harness/agent-harness.js +3 -3
- package/ecagent/dist/harness/types.d.ts +1 -0
- package/ecagent/dist/types.d.ts +1 -0
- package/kits/docs/INDEX.md +1 -1
- package/kits/docs/aun/AUN/346/266/210/346/201/257/347/261/273/345/236/213/344/270/216/345/261/236/346/200/247.md +72 -0
- package/kits/docs/evolcore/INDEX.md +3 -2
- package/kits/docs/evolcore/agent-create.md +17 -27
- package/kits/docs/evolcore/agent.md +4 -1
- package/kits/docs/evolcore/aid.md +3 -1
- package/kits/docs/evolcore/config.md +16 -5
- package/kits/docs/evolcore/ctl.md +9 -0
- package/kits/docs/evolcore/ec-capabilities.md +19 -0
- package/kits/docs/evolcore/memory-consolidation-batches.md +79 -5
- package/kits/docs/evolcore/menu-exec-schema-commands.md +2 -1
- package/kits/docs/evolcore/menu-protocol.md +1 -0
- package/kits/docs/evolcore/model.md +13 -4
- package/kits/docs/evolcore/msg.md +1 -1
- package/kits/docs/evolcore/pa-workspace.md +51 -0
- package/kits/docs/evolcore/peer.md +73 -0
- package/kits/docs/evolcore/thread-chain.md +4 -1
- package/kits/eck_manifest.json +21 -0
- package/kits/rules/06-channel.md +1 -1
- package/kits/schemas/_meta.json +12 -1
- package/kits/schemas/agent-config.schema.16.json +6 -0
- package/kits/schemas/agent-config.schema.17.json +897 -0
- package/kits/schemas/daemon.schema.9.json +8 -1
- package/kits/skills/ec-agent-create/SKILL.md +2 -2
- package/kits/skills/ec-identity/SKILL.md +45 -27
- package/kits/skills/ec-service-proxy/SKILL.md +7 -2
- package/kits/skills/personal-assistant/references/03-data-flow-and-gaps.md +4 -5
- package/kits/skills/thread-ops/SKILL.md +11 -11
- package/kits/templates/bootstrap-welcome.md +3 -15
- package/kits/templates/message-fragments/item.md +1 -1
- package/kits/templates/system-fragments/bootstrap.md +24 -23
- package/kits/templates/system-fragments/commands.md +12 -5
- package/kits/templates/system-fragments/thread.md +18 -3
- package/package.json +6 -4
- package/dist/config/contact-operation-service.js +0 -235
- package/dist/directory/owner-directory-authorization.js +0 -309
- package/kits/docs/evolcore/contact.md +0 -78
- /package/dist/config/{contact-alias.js → peer-alias.js} +0 -0
package/dist/aun/aid/identity.js
CHANGED
|
@@ -182,6 +182,39 @@ export async function aidListVerified(aunPath) {
|
|
|
182
182
|
}
|
|
183
183
|
return list;
|
|
184
184
|
}
|
|
185
|
+
/**
|
|
186
|
+
* AIDStore.register({ owner }) submits the initial bind on new identities.
|
|
187
|
+
* Reused identities need a read-only fresh preflight so retries do not submit
|
|
188
|
+
* a duplicate invitation or silently target a different Owner.
|
|
189
|
+
*/
|
|
190
|
+
export async function aidEnsureOwnerBinding(client, aid, ownerAid) {
|
|
191
|
+
const owner = ownerAid.trim().toLowerCase();
|
|
192
|
+
if (!isValidAid(owner))
|
|
193
|
+
throw Object.assign(new Error('Owner must be a valid AID'), { code: 'INVALID_OWNER' });
|
|
194
|
+
const current = await client.checkOwnershipConsensus(aid, true);
|
|
195
|
+
if (current.status === 'consensus') {
|
|
196
|
+
if (current.sub_aid === aid && current.owner_aid === owner && current.lock === 'locked')
|
|
197
|
+
return undefined;
|
|
198
|
+
throw Object.assign(new Error('AID is already bound to a different Owner'), { code: 'OWNER_ALREADY_BOUND' });
|
|
199
|
+
}
|
|
200
|
+
if (current.status === 'single_sided') {
|
|
201
|
+
if (current.sub_aid === aid && current.owner_md?.owner_aid === owner && current.lock === 'unlocked')
|
|
202
|
+
return undefined;
|
|
203
|
+
throw Object.assign(new Error('AID has a pending Owner binding for a different Owner'), { code: 'OWNER_BIND_PENDING' });
|
|
204
|
+
}
|
|
205
|
+
if (current.status !== 'unbound' && current.status !== 'released') {
|
|
206
|
+
throw Object.assign(new Error(current.reason || `Ownership status is ${current.status}`), {
|
|
207
|
+
code: current.code || 'OWNER_BIND_STATE_UNAVAILABLE',
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
const binding = await client.bindOwneraid(owner);
|
|
211
|
+
if (binding.status === 'error' || binding.status === 'rejected' || binding.status === 'stopped') {
|
|
212
|
+
throw Object.assign(new Error(binding.reason || `Owner binding ${binding.status}`), {
|
|
213
|
+
code: binding.code || 'OWNER_BIND_INCOMPLETE',
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
return binding;
|
|
217
|
+
}
|
|
185
218
|
export async function aidCreate(aid, opts) {
|
|
186
219
|
const aunPath = opts?.aunPath ?? defaultAunPath();
|
|
187
220
|
const aidDir = path.join(aunPath, 'AIDs', aid);
|
|
@@ -192,12 +225,20 @@ export async function aidCreate(aid, opts) {
|
|
|
192
225
|
if (verifyResult.ok) {
|
|
193
226
|
// 身份有效:加载并认证,返回已认证的 client
|
|
194
227
|
const store = await getAidStore({ slotId: SLOT.cli, aunPath });
|
|
228
|
+
let client;
|
|
195
229
|
try {
|
|
196
|
-
|
|
230
|
+
client = await loadClient(store, aid);
|
|
197
231
|
const auth = await client.authenticate();
|
|
232
|
+
if (opts?.owner?.trim()) {
|
|
233
|
+
await aidEnsureOwnerBinding(client, aid, opts.owner);
|
|
234
|
+
}
|
|
198
235
|
return { aid, alreadyExisted: true, gateway: String(auth?.gateway ?? ''), client, store };
|
|
199
236
|
}
|
|
200
237
|
catch (e) {
|
|
238
|
+
try {
|
|
239
|
+
await client?.close();
|
|
240
|
+
}
|
|
241
|
+
catch { /* preserve original error */ }
|
|
201
242
|
store.close();
|
|
202
243
|
throw e;
|
|
203
244
|
}
|
|
@@ -212,14 +253,39 @@ export async function aidCreate(aid, opts) {
|
|
|
212
253
|
}
|
|
213
254
|
// --force:先尝试 authenticate 恢复证书
|
|
214
255
|
const recoverStore = await getAidStore({ slotId: SLOT.cli, aunPath });
|
|
256
|
+
let recoverClient;
|
|
257
|
+
let recoverGateway = '';
|
|
215
258
|
try {
|
|
216
|
-
|
|
259
|
+
recoverClient = await loadClient(recoverStore, aid);
|
|
217
260
|
const auth = await recoverClient.authenticate();
|
|
218
|
-
|
|
261
|
+
recoverGateway = String(auth?.gateway ?? '');
|
|
219
262
|
}
|
|
220
263
|
catch {
|
|
264
|
+
try {
|
|
265
|
+
await recoverClient?.close();
|
|
266
|
+
}
|
|
267
|
+
catch { /* ignore cleanup failure */ }
|
|
221
268
|
recoverStore.close();
|
|
222
269
|
fs.rmSync(aidDir, { recursive: true, force: true });
|
|
270
|
+
recoverClient = undefined;
|
|
271
|
+
// Authentication recovery failed, so the legacy --force recovery path
|
|
272
|
+
// may recreate the identity below.
|
|
273
|
+
}
|
|
274
|
+
if (recoverClient) {
|
|
275
|
+
try {
|
|
276
|
+
if (opts?.owner?.trim()) {
|
|
277
|
+
await aidEnsureOwnerBinding(recoverClient, aid, opts.owner);
|
|
278
|
+
}
|
|
279
|
+
return { aid, alreadyExisted: true, gateway: recoverGateway, client: recoverClient, store: recoverStore };
|
|
280
|
+
}
|
|
281
|
+
catch (error) {
|
|
282
|
+
try {
|
|
283
|
+
await recoverClient.close();
|
|
284
|
+
}
|
|
285
|
+
catch { /* ignore cleanup failure */ }
|
|
286
|
+
recoverStore.close();
|
|
287
|
+
throw error;
|
|
288
|
+
}
|
|
223
289
|
}
|
|
224
290
|
}
|
|
225
291
|
// 新注册流程:AIDStore.register → downloadCaRoot → load → authenticate
|
|
@@ -329,7 +395,7 @@ export async function aidCreateIdentityOnly(aid, opts) {
|
|
|
329
395
|
if (!gateway)
|
|
330
396
|
throw discoveryError instanceof Error ? discoveryError : new Error(String(discoveryError));
|
|
331
397
|
const flow = new RegisterFlow({ keystore, crypto: new CryptoProvider(), verifySsl: true });
|
|
332
|
-
keystore.saveMetadata(target, { identity_type: 'agent', identity_exttype: '' });
|
|
398
|
+
keystore.saveMetadata(target, { identity_type: opts?.type?.trim() || 'agent', identity_exttype: '' });
|
|
333
399
|
const registered = await flow.registerAid(gateway, target);
|
|
334
400
|
// Follow AIDStore.register's public persistence contract. In particular,
|
|
335
401
|
// registerAid can return a recovered certificate for an existing keypair.
|
package/dist/aun/aid/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { AgentMdVersionUnavailableError, AgentMdVersionConflictError } from './agentmd.js';
|
|
2
2
|
export { AGENT_TAG_MAX_LENGTH, validateAgentTag, validateAgentTags, } from './agentmd.js';
|
|
3
|
-
export { isValidAid, aidList, aidListVerified, aidCreate, aidShow, aidDelete, aidLookup, verifySignAbility, probePkiRecoverability, appendAidLifecycle, readAidLifecycle } from './identity.js';
|
|
4
|
-
export { AGENT_TYPES, DEFAULT_AGENT_DESCRIPTION, DEFAULT_AGENT_TYPE, normalizeAgentType, validateAgentType, buildInitialAgentMd, validateAgentMdFrontmatter, agentmdGet, agentmdPut, agentmdSet, agentmdSync, invalidateAgentDisplayName, parseAgentDisplayName, refreshAgentDisplayName, resolveAgentDisplayName, stripAgentMdSignature, updateAgentMdFrontmatterAvatar, updateAgentMdFrontmatterFieldValue, updateAgentMdFrontmatterName, } from './agentmd.js';
|
|
3
|
+
export { isValidAid, aidList, aidListVerified, aidCreate, aidCreateIdentityOnly, aidEnsureOwnerBinding, aidShow, aidDelete, aidLookup, verifySignAbility, probePkiRecoverability, appendAidLifecycle, readAidLifecycle } from './identity.js';
|
|
4
|
+
export { AGENT_TYPES, DEFAULT_AGENT_DESCRIPTION, DEFAULT_AGENT_TYPE, normalizeAgentType, validateAgentType, buildInitialAgentMd, buildOwnershipStatement, validateAgentMdFrontmatter, agentmdGet, agentmdPut, agentmdPutInitializationProfile, agentmdSet, agentmdSync, invalidateAgentDisplayName, parseAgentDisplayName, refreshAgentDisplayName, resolveAgentDisplayName, stripAgentMdSignature, updateAgentMdFrontmatterAvatar, updateAgentMdFrontmatterFieldValue, updateAgentMdFrontmatterName, } from './agentmd.js';
|
|
5
5
|
export { MIN_AUN_CORE_SDK, AUN_CORE_SDK_PKG, isAunSdkVersionOk, resolveAunCoreSdkPkg, ensureAunSdk, isAunSdkReady, downloadCaRoot, suppressSdkLogs, } from './client.js';
|
|
6
6
|
export { getAidStore, loadClient, loadAid, AidLoadError, SLOT } from './store.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AUN Service Proxy 集成 — 把本地 HTTP/WS 服务通过控制 AID 暴露到 AUN 网络。
|
|
3
3
|
*
|
|
4
|
-
* 访问入口:https://{
|
|
4
|
+
* 访问入口:https://{daemon-aid}.{issuer}/proxy/{serviceName}/...
|
|
5
5
|
* proxy-server 剥掉 {serviceName} 前缀后,把剩余 path 经隧道转发,
|
|
6
6
|
* ServiceProxyClient 真实 HTTP/WS 回连本地 endpoint(反向代理)。
|
|
7
7
|
*
|
|
@@ -127,6 +127,30 @@ async function resolveEndpoint(svc) {
|
|
|
127
127
|
logger.warn(`${LOG} 服务 "${svc.name}" 未配置有效 proxy.source,跳过`);
|
|
128
128
|
return null;
|
|
129
129
|
}
|
|
130
|
+
/** Probe the local service root without exposing the local endpoint to callers. */
|
|
131
|
+
export async function probeServiceRoot(service) {
|
|
132
|
+
const endpoint = await resolveEndpoint(service);
|
|
133
|
+
if (!endpoint)
|
|
134
|
+
return { accessState: 'unresolved' };
|
|
135
|
+
try {
|
|
136
|
+
const root = new URL('/', endpoint);
|
|
137
|
+
if (root.protocol === 'ws:')
|
|
138
|
+
root.protocol = 'http:';
|
|
139
|
+
if (root.protocol === 'wss:')
|
|
140
|
+
root.protocol = 'https:';
|
|
141
|
+
const response = await fetch(root, {
|
|
142
|
+
signal: AbortSignal.timeout(1500),
|
|
143
|
+
redirect: 'manual',
|
|
144
|
+
});
|
|
145
|
+
return {
|
|
146
|
+
accessState: response.status >= 200 && response.status < 400 ? 'available' : 'unavailable',
|
|
147
|
+
statusCode: response.status,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
return { accessState: 'unavailable' };
|
|
152
|
+
}
|
|
153
|
+
}
|
|
130
154
|
/**
|
|
131
155
|
* 启动 Service Proxy。挂在控制 AUNChannel 上,常驻反向代理隧道。
|
|
132
156
|
* 返回 handle 供关停;没有启用服务时返回 null。endpoint 发现和隧道启动在后台执行,
|