evolcore 0.0.41-test.0 → 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 +62 -0
- package/dist/agents/baseagent-availability.js +1 -1
- package/dist/agents/baseagent.js +88 -49
- package/dist/agents/claude-runner.js +177 -92
- package/dist/agents/codex-runner.js +146 -71
- package/dist/agents/ecagent-runner.js +1 -1
- package/dist/agents/gemini-runner.js +1 -1
- 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/group/fs-download.js +39 -0
- package/dist/aun/group/identity.js +36 -21
- package/dist/aun/group/operations.js +5 -0
- package/dist/aun/menu/client.js +27 -0
- package/dist/aun/msg/managed-operation.js +68 -7
- package/dist/aun/msg/p2p.js +8 -8
- package/dist/aun/service-proxy.js +53 -12
- package/dist/channels/aun.js +633 -32
- package/dist/channels/daemon.js +15 -1
- 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 +48 -36
- package/dist/cli/daemon-commands.js +679 -697
- package/dist/cli/fs-command.js +64 -2
- package/dist/cli/index.js +72 -5
- package/dist/cli/init-channel.js +1 -1
- package/dist/cli/init.js +75 -1
- package/dist/cli/managed-command-guard.js +17 -1
- package/dist/cli/model.js +40 -40
- package/dist/cli/provider-command.js +57 -0
- package/dist/cli/proxy-command.js +92 -0
- package/dist/cli/restart-monitor.js +4 -2
- package/dist/cli/role.js +85 -0
- package/dist/cli/stats.js +10 -3
- package/dist/cli/task-context.js +19 -0
- package/dist/config/access-policy.js +7 -2
- package/dist/config/boot-log.js +39 -1
- package/dist/config/config-field-policy.js +17 -39
- package/dist/config/config-manager.js +183 -44
- package/dist/config/config-operation-service.js +5 -19
- package/dist/config/contact-book-store.js +47 -21
- package/dist/config/contact-book.js +18 -12
- package/dist/config/contact-operation-service.js +3 -4
- package/dist/config/contact-request-service.js +11 -0
- package/dist/config/daemon-services.js +11 -0
- package/dist/config/gateway-config.js +88 -594
- package/dist/config/owner-config.js +2 -2
- package/dist/config/peer-role-resolver.js +15 -12
- package/dist/config/provider-ipc-service.js +132 -0
- package/dist/config/provider-menu-request.js +58 -0
- package/dist/config/providers-config.js +12 -7
- package/dist/config/providers-import.js +3 -21
- package/dist/config/providers-management.js +78 -5
- package/dist/config/resolved-config-op.js +11 -1
- package/dist/config/role-command-service.js +166 -0
- package/dist/config/role-request-service.js +193 -0
- package/dist/config/schema-migration.js +1000 -25
- package/dist/config-store.js +89 -4
- package/dist/contracts/ecweb-instance.js +41 -0
- package/dist/contracts/ecweb-service-protocol.js +4 -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 +194 -24
- package/dist/core/auth/agent-delegation.js +6 -3
- package/dist/core/auth/auth-gateway.js +67 -2
- package/dist/core/auth/authorization-audit.js +58 -11
- package/dist/core/auth/delegation-authorization.js +5 -2
- package/dist/core/auth/operation-authorizer.js +43 -6
- package/dist/core/auth/operation-catalog.js +45 -7
- package/dist/core/channel-loader.js +2 -0
- package/dist/core/command/agent-control.js +260 -21
- package/dist/core/command/agent-storage-menu.js +5 -3
- package/dist/core/command/cli-intent-parser.js +8 -3
- package/dist/core/command/command-handler.js +112 -154
- package/dist/core/command/connect-menu.js +11 -3
- package/dist/core/command/data-root-resolver.js +5 -4
- package/dist/core/command/memory-slash.js +16 -8
- package/dist/core/command/menu-catalog.js +10 -6
- package/dist/core/command/menu-handler.js +106 -73
- package/dist/core/command/menu-protocol.js +15 -1
- package/dist/core/command/provider-menu.js +46 -0
- package/dist/core/command/role-menu.js +147 -30
- package/dist/core/command/slash-handler.js +125 -255
- package/dist/core/daemon-control.js +26 -27
- package/dist/core/event-catalog.js +10 -0
- package/dist/core/evolagent-registry.js +7 -5
- package/dist/core/evolagent.js +10 -8
- package/dist/core/file-integrity/store.js +11 -0
- package/dist/core/handoff/ipc-registration.js +3 -0
- package/dist/core/inference/text-inference.js +31 -40
- package/dist/core/initialization/service.js +491 -0
- package/dist/core/ipc-registration.js +40 -24
- package/dist/core/memory/consolidation-context.js +51 -5
- package/dist/core/memory/consolidation-ops-records.js +96 -1
- package/dist/core/memory/consolidation-trigger.js +208 -191
- package/dist/core/memory/consolidation.js +333 -35
- package/dist/core/memory/index-manager.js +27 -5
- package/dist/core/memory/memory-admin.js +45 -5
- package/dist/core/memory/memory-writer.js +163 -18
- package/dist/core/memory/relation-idle-monitor.js +119 -58
- package/dist/core/memory/relation-sweep.js +55 -45
- package/dist/core/message/aun-ipc-sender.js +81 -69
- package/dist/core/message/im-renderer.js +25 -4
- package/dist/core/message/message-admission.js +89 -4
- package/dist/core/message/message-bridge.js +66 -21
- package/dist/core/message/response-engine.js +108 -35
- package/dist/core/model/catalog-service.js +5 -3
- package/dist/core/model/config-scope.js +29 -71
- package/dist/core/model/field-scope.js +1 -1
- package/dist/core/model/model-catalog.js +30 -41
- package/dist/core/model/model-diagnostics.js +4 -3
- package/dist/core/model/model-fallback.js +10 -7
- package/dist/core/model/model-permission.js +3 -2
- package/dist/core/ownership/owner-resolver.js +772 -158
- package/dist/core/permission/approval-gateway.js +103 -403
- package/dist/core/permission/ec-command-parser.js +62 -6
- package/dist/core/permission/index.js +1 -0
- package/dist/core/permission/permission-result.js +78 -0
- package/dist/core/permission/sandbox-runtime.js +18 -1
- package/dist/core/permission/tool-policy.js +21 -46
- package/dist/core/relation/peer-identity.js +64 -1
- package/dist/core/role/runtime-policy.js +72 -13
- package/dist/core/session/session-capsule.js +1 -1
- package/dist/core/session/session-idle-monitor.js +1 -1
- package/dist/core/session/session-manager.js +20 -0
- package/dist/core/session/session-renew.js +3 -3
- package/dist/core/skill/index-generator.js +15 -5
- package/dist/core/system-session/memory.js +43 -8
- package/dist/core/thread/thread-service.js +19 -6
- package/dist/directory/owner-directory-admission.js +95 -0
- package/dist/directory/owner-directory-authorization.js +309 -0
- package/dist/directory/owner-directory-cache.js +635 -0
- package/dist/eck/kit-renderer.js +2 -2
- package/dist/ecweb/basic-settings-service.js +33 -40
- package/dist/ecweb/init-menu.js +32 -0
- package/dist/ecweb/message-context-service.js +110 -0
- package/dist/index.js +93 -19
- package/dist/ipc.js +247 -29
- package/dist/paths.js +7 -0
- package/dist/proxy/command.js +122 -0
- package/dist/proxy/ipc-service.js +68 -0
- package/dist/proxy/manager.js +484 -0
- package/dist/proxy/service-supervisor.js +603 -0
- package/dist/response-system/engines/v1/proactive-flow.js +16 -6
- 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/cross-platform.js +14 -0
- package/dist/utils/ecweb-supervisor.js +258 -83
- package/dist/utils/error-utils.js +26 -2
- package/dist/utils/logger.js +92 -6
- package/dist/utils/package-version-info.js +4 -2
- 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/channels/aun.md +9 -0
- 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 +28 -7
- package/kits/docs/evolcore/contact.md +3 -0
- package/kits/docs/evolcore/fs.md +11 -0
- package/kits/docs/evolcore/group.md +1 -1
- package/kits/docs/evolcore/memory-architecture.md +2 -2
- package/kits/docs/evolcore/memory-consolidation.md +32 -8
- package/kits/docs/evolcore/memory.md +1 -1
- package/kits/docs/evolcore/menu-protocol.md +4 -0
- package/kits/docs/evolcore/model.md +23 -20
- package/kits/docs/evolcore/msg.md +4 -7
- package/kits/docs/evolcore/provider.md +50 -0
- package/kits/docs/identity/AID_PROFILE_SPEC.md +52 -17
- package/kits/migrations/migrate-contact-book-v2.mjs +30 -11
- package/kits/rules/01-overview.md +3 -0
- package/kits/rules/04-relation.md +1 -1
- package/kits/schemas/_meta.json +37 -4
- package/kits/schemas/agent-config.schema.13.json +8 -3
- package/kits/schemas/agent-config.schema.16.json +891 -0
- package/kits/schemas/daemon.schema.9.json +366 -0
- package/kits/schemas/defaults.schema.5.json +406 -127
- package/kits/schemas/relation-config.schema.11.json +277 -0
- package/kits/schemas/role-config.schema.1.json +7 -7
- package/kits/skills/.switches.json +4 -0
- package/kits/skills/ec-agent-create/SKILL.md +3 -0
- package/kits/skills/ec-identity/SKILL.md +2 -2
- package/kits/skills/ec-service-proxy/SKILL.md +118 -0
- package/kits/skills/ec-skill/scripts/skill.mjs +6 -0
- package/kits/skills/personal-assistant/SKILL.md +176 -0
- package/kits/skills/personal-assistant/references/01-workspace-spec.md +333 -0
- package/kits/skills/personal-assistant/references/02-bootstrap.md +205 -0
- package/kits/skills/personal-assistant/references/03-data-flow-and-gaps.md +177 -0
- package/kits/skills/personal-assistant/references/04-frontend-contract.md +439 -0
- package/kits/skills/personal-assistant/references/05-directory-reference.md +292 -0
- package/kits/skills/personal-assistant/references/06-render-config.md +350 -0
- package/kits/skills/personal-assistant/schema/workspace.schema.json +85 -0
- package/kits/skills/personal-assistant/schema/workspace.v1.json +66 -0
- package/kits/skills/personal-assistant/scripts/archive.mjs +154 -0
- package/kits/skills/personal-assistant/scripts/check.mjs +114 -0
- package/kits/skills/personal-assistant/scripts/index-rebuild.mjs +252 -0
- package/kits/skills/personal-assistant/scripts/ingest.mjs +344 -0
- package/kits/skills/personal-assistant/scripts/init.mjs +270 -0
- package/kits/skills/personal-assistant/scripts/lib/apply.mjs +92 -0
- package/kits/skills/personal-assistant/scripts/lib/schema.mjs +96 -0
- package/kits/skills/personal-assistant/scripts/lib/time.mjs +28 -0
- package/kits/skills/personal-assistant/scripts/migrate.mjs +172 -0
- package/kits/skills/personal-assistant/scripts/search.mjs +172 -0
- package/kits/skills/personal-assistant/scripts/verify.mjs +196 -0
- package/kits/skills/personal-assistant/templates/INDEX.md.tpl +24 -0
- package/kits/skills/personal-assistant/templates/README.md.tpl +108 -0
- package/kits/skills/personal-assistant/triggers/ingest-daily.json +23 -0
- package/kits/skills/personal-assistant/triggers/memory-consolidate.json +23 -0
- package/kits/skills/personal-assistant/triggers/report-daily.json +23 -0
- package/kits/skills/personal-assistant/triggers/report-weekly.json +23 -0
- package/kits/skills/thread-ops/SKILL.md +5 -0
- package/kits/templates/memory-consolidation/forget.md +19 -6
- package/kits/templates/memory-consolidation/notes.md +1 -1
- package/kits/templates/memory-consolidation/profile.md +2 -2
- package/kits/templates/memory-consolidation/promote.md +20 -3
- package/kits/templates/roles/member.json +8 -1
- package/kits/templates/system-fragments/baseagent.md +2 -2
- package/kits/templates/system-fragments/memory.md +4 -4
- package/kits/templates/system-fragments/venue.md +1 -1
- package/package.json +7 -3
- package/dist/core/message/create-status.js +0 -96
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "evolcore",
|
|
3
|
-
"version": "0.0.41-test.
|
|
3
|
+
"version": "0.0.41-test.2",
|
|
4
4
|
"description": "AI Agent gateway connecting Claude, Codex, Gemini, and the bundled ecagent runner to messaging channels with multi-project session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -49,19 +49,23 @@
|
|
|
49
49
|
"start": "node dist/index.js",
|
|
50
50
|
"test": "npm run build && vitest run",
|
|
51
51
|
"test:watch": "vitest",
|
|
52
|
+
"test:directory-read": "node --import tsx --test tests/directory-authoritative-read.node.ts",
|
|
53
|
+
"test:owner-directory-cache": "node --import tsx --test tests/owner-directory-cache.node.ts",
|
|
54
|
+
"test:owner-directory-authorization": "node --import tsx --test tests/owner-directory-authorization.node.ts",
|
|
55
|
+
"test:owner-directory-admission": "node --import tsx --test tests/owner-directory-admission.node.ts",
|
|
52
56
|
"test:hooks": "tsx test-sdk-hooks.ts",
|
|
53
57
|
"verify:request-identity": "npm run build && node scripts/verify-request-identity.mjs",
|
|
54
58
|
"prepublishOnly": "npm test"
|
|
55
59
|
},
|
|
56
60
|
"dependencies": {
|
|
57
|
-
"@agentunion/fastaun": "0.5.
|
|
61
|
+
"@agentunion/fastaun": "0.5.28",
|
|
58
62
|
"@anthropic-ai/claude-agent-sdk": "0.3.300",
|
|
59
63
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
60
64
|
"ajv": "^8.20.0",
|
|
61
65
|
"chokidar": "^5.0.0",
|
|
62
66
|
"cron-parser": "^5.5.0",
|
|
63
67
|
"dotenv": "^17.4.2",
|
|
64
|
-
"ec-web": "0.0.41-test.
|
|
68
|
+
"ec-web": "0.0.41-test.2",
|
|
65
69
|
"ignore": "7.0.5",
|
|
66
70
|
"image-type": "^6.0.0",
|
|
67
71
|
"partial-json": "0.1.7",
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { randomUUID } from 'node:crypto';
|
|
4
|
-
import { creationOwnershipBinding } from '../ownership/owner-resolver.js';
|
|
5
|
-
const FILE = 'create-status.json';
|
|
6
|
-
export function readCreateStatus(agentDir) {
|
|
7
|
-
try {
|
|
8
|
-
const raw = fs.readFileSync(path.join(agentDir, FILE), 'utf-8');
|
|
9
|
-
return JSON.parse(raw);
|
|
10
|
-
}
|
|
11
|
-
catch {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
/** 删除构建进度文件(agent 删除时清理)。非 purge 删除只移除 config.json,
|
|
16
|
-
* 故需显式清理本文件,避免目录残留陈旧进度。 */
|
|
17
|
-
export function removeCreateStatus(agentDir) {
|
|
18
|
-
try {
|
|
19
|
-
fs.rmSync(path.join(agentDir, FILE), { force: true });
|
|
20
|
-
}
|
|
21
|
-
catch { /* ignore */ }
|
|
22
|
-
}
|
|
23
|
-
/** 构建进度写入器。每次状态变更原子落盘(写临时文件 + rename)。 */
|
|
24
|
-
export class CreateStatusWriter {
|
|
25
|
-
agentDir;
|
|
26
|
-
status;
|
|
27
|
-
creationId = randomUUID();
|
|
28
|
-
constructor(agentDir, aid, context) {
|
|
29
|
-
this.agentDir = agentDir;
|
|
30
|
-
const now = Date.now();
|
|
31
|
-
this.status = { aid, creationId: this.creationId, ...context, status: 'in_progress', currentPhase: null, steps: [], error: null, startedAt: now, updatedAt: now };
|
|
32
|
-
fs.mkdirSync(agentDir, { recursive: true });
|
|
33
|
-
this.flush(true);
|
|
34
|
-
}
|
|
35
|
-
begin(phase) {
|
|
36
|
-
this.status.currentPhase = phase;
|
|
37
|
-
this.status.steps.push({ phase, state: 'in_progress', ts: Date.now() });
|
|
38
|
-
this.flush();
|
|
39
|
-
}
|
|
40
|
-
done(phase, detail) { this.mark(phase, 'done', detail); }
|
|
41
|
-
warn(phase, detail) { this.mark(phase, 'warn', detail); }
|
|
42
|
-
/** Immutable correlation; a later CLI bind/transfer must not replace it. */
|
|
43
|
-
setOwnershipBinding(binding) {
|
|
44
|
-
const expected = creationOwnershipBinding({
|
|
45
|
-
operation: binding.operation, operation_id: binding.operationId,
|
|
46
|
-
sub_aid: binding.subjectAid, owner_aid: binding.ownerAid,
|
|
47
|
-
base_relation_version: binding.baseRelationVersion, target_relation_version: binding.targetRelationVersion,
|
|
48
|
-
status: 'pending',
|
|
49
|
-
}, this.status.aid, this.status.ownerAid ?? '');
|
|
50
|
-
if (!this.status.requesterAid || binding.source !== 'agent_create' || !expected) {
|
|
51
|
-
throw new Error('Creation Ownership binding does not match the creation request');
|
|
52
|
-
}
|
|
53
|
-
if (this.status.ownershipBinding) {
|
|
54
|
-
if (this.status.ownershipBinding.operationId !== binding.operationId) {
|
|
55
|
-
throw new Error('Creation Ownership binding is already recorded');
|
|
56
|
-
}
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
if (this.status.status !== 'in_progress')
|
|
60
|
-
throw new Error('Agent creation has already finished');
|
|
61
|
-
this.status.ownershipBinding = expected;
|
|
62
|
-
this.flush();
|
|
63
|
-
}
|
|
64
|
-
finishReady() { this.status.status = 'ready'; this.status.currentPhase = null; this.flush(); }
|
|
65
|
-
finishFailed(phase, error) {
|
|
66
|
-
this.mark(phase, 'failed', error);
|
|
67
|
-
this.status.status = 'failed';
|
|
68
|
-
this.status.error = error;
|
|
69
|
-
this.status.currentPhase = null;
|
|
70
|
-
this.flush();
|
|
71
|
-
}
|
|
72
|
-
mark(phase, state, detail) {
|
|
73
|
-
const step = [...this.status.steps].reverse().find(s => s.phase === phase);
|
|
74
|
-
if (step) {
|
|
75
|
-
step.state = state;
|
|
76
|
-
if (detail)
|
|
77
|
-
step.detail = detail;
|
|
78
|
-
step.ts = Date.now();
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
this.status.steps.push({ phase, state, detail, ts: Date.now() });
|
|
82
|
-
}
|
|
83
|
-
this.flush();
|
|
84
|
-
}
|
|
85
|
-
flush(initial = false) {
|
|
86
|
-
// A failed worker or a deleted Agent must not overwrite a newer creation.
|
|
87
|
-
if (!initial && readCreateStatus(this.agentDir)?.creationId !== this.creationId) {
|
|
88
|
-
throw new Error('Agent creation record was removed or replaced');
|
|
89
|
-
}
|
|
90
|
-
this.status.updatedAt = Date.now();
|
|
91
|
-
const file = path.join(this.agentDir, FILE);
|
|
92
|
-
const tmp = `${file}.tmp`;
|
|
93
|
-
fs.writeFileSync(tmp, JSON.stringify(this.status, null, 2));
|
|
94
|
-
fs.renameSync(tmp, file);
|
|
95
|
-
}
|
|
96
|
-
}
|