evolcore 0.0.43-test.1 → 0.0.43-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 +24 -1
- package/README.md +22 -0
- package/dist/agents/claude-runner.js +26 -2
- package/dist/agents/codex/app-server-client.js +12 -0
- package/dist/agents/codex-runner.js +49 -8
- package/dist/agents/ecagent-runner.js +26 -9
- package/dist/agents/gemini-runner.js +15 -12
- package/dist/agents/tool-time-context.js +55 -0
- package/dist/aun/menu/client.js +1 -1
- package/dist/aun/model-headers.js +17 -0
- package/dist/aun/msg/p2p.js +3 -0
- package/dist/channels/aun.js +484 -43
- package/dist/channels/builtin-plugins.js +16 -11
- package/dist/channels/dingtalk.js +83 -31
- package/dist/channels/feishu.js +29 -13
- package/dist/channels/qqbot.js +32 -11
- package/dist/channels/wechat.js +13 -3
- package/dist/channels/wecom.js +67 -27
- package/dist/cli/agent-command.js +3 -86
- package/dist/cli/agent-create.js +22 -6
- package/dist/cli/agent.js +1 -79
- package/dist/cli/aun-commands.js +1 -0
- package/dist/cli/config.js +1 -1
- package/dist/cli/daemon-commands.js +47 -2
- package/dist/cli/data-command.js +9 -1
- package/dist/cli/debug-mode.js +1 -1
- package/dist/cli/diag.js +1 -1
- package/dist/cli/directory.js +77 -64
- package/dist/cli/getmeta-command.js +1 -1
- package/dist/cli/index.js +79 -22
- package/dist/cli/init.js +1 -23
- package/dist/cli/link-rules.js +1 -1
- package/dist/cli/managed-command-guard.js +0 -1
- package/dist/cli/pa-workspace-command.js +36 -2
- package/dist/cli/peer.js +1 -1
- package/dist/cli/restart-monitor.js +17 -3
- package/dist/cli/role.js +1 -1
- package/dist/cli/session-command.js +1 -1
- package/dist/cli/stats.js +2 -2
- package/dist/cli/thread-command.js +1 -1
- package/dist/cli/watch-msg.js +1 -1
- package/dist/config/access-policy.js +1 -0
- package/dist/config/config-field-policy.js +2 -2
- package/dist/config/config-manager.js +7 -0
- package/dist/config/role-schema.js +4 -3
- package/dist/config/role-service.js +3 -3
- package/dist/config-store.js +75 -4
- package/dist/core/agent-ipc-registration.js +16 -59
- package/dist/core/auth/authorization-audit.js +52 -14
- package/dist/core/auth/operation-authorizer.js +0 -11
- package/dist/core/auth/operation-catalog.js +0 -18
- package/dist/core/channel-loader.js +152 -16
- package/dist/core/command/agent-control.js +2 -1
- package/dist/core/command/cli-intent-parser.js +0 -8
- package/dist/core/command/command-handler.js +17 -46
- package/dist/core/command/connect-menu.js +7 -3
- package/dist/core/command/menu-catalog.js +3 -2
- package/dist/core/command/menu-handler.js +51 -8
- package/dist/core/command/menu-protocol.js +20 -0
- package/dist/core/command/slash-handler.js +101 -40
- package/dist/core/daemon-file-cache.js +3 -3
- package/dist/core/evolagent-registry.js +5 -4
- package/dist/core/evolagent.js +5 -8
- package/dist/core/handoff/argv-parse.js +115 -0
- package/dist/core/handoff/ipc-registration.js +1 -1
- package/dist/core/ipc-registration.js +19 -2
- package/dist/core/memory/consolidation.js +8 -1
- package/dist/core/memory/relation-sweep.js +20 -8
- package/dist/core/message/aun-ipc-sender.js +28 -1
- package/dist/core/message/contact-admission.js +548 -0
- package/dist/core/message/im-renderer.js +69 -10
- package/dist/core/message/message-admission.js +28 -3
- package/dist/core/message/message-bridge.js +46 -5
- package/dist/core/message/message-utils.js +0 -5
- package/dist/core/message/peer-mode.js +44 -10
- package/dist/core/message/response-engine.js +268 -69
- package/dist/core/message/retry-scheduler.js +4 -0
- package/dist/core/permission/ec-command-parser.js +1 -28
- package/dist/core/permission/readonly-shell-query.js +34 -8
- package/dist/core/permission/tool-policy.js +50 -5
- package/dist/core/role/runtime-policy.js +14 -2
- package/dist/core/session/session-manager.js +9 -1
- package/dist/core/soul.js +66 -0
- package/dist/core/system-session/memory.js +2 -2
- package/dist/directory/contact-admission-paths.js +9 -0
- package/dist/directory/owner-directory-admission.js +128 -29
- package/dist/directory/owner-directory-cache.js +364 -50
- package/dist/directory/owner-directory-identity.js +60 -0
- package/dist/directory/owner-directory-markdown.js +120 -47
- package/dist/directory/owner-directory-policy.js +108 -0
- package/dist/directory/owner-directory-query-operation.js +219 -32
- package/dist/directory/owner-directory-remarks.js +29 -2
- package/dist/directory/owner-directory-search.js +50 -18
- package/dist/directory/owner-directory-store.js +150 -30
- package/dist/eck/kit-renderer.js +12 -5
- package/dist/eck/manifest-engine.js +55 -6
- package/dist/eck/message-renderer.js +5 -2
- package/dist/eck/paactive-context.js +45 -0
- package/dist/ecweb/basic-settings-service.js +2 -2
- package/dist/ecweb/message-context-service.js +24 -16
- package/dist/index.js +9 -5
- package/dist/ipc.js +1 -1
- package/dist/paths.js +26 -0
- package/dist/response-system/config-resolver.js +1 -1
- package/dist/response-system/engines/v1/index.js +4 -1
- package/dist/response-system/engines/v1/paactive-flow.js +18 -0
- package/dist/response-system/modes/single-session/index.js +7 -2
- package/dist/trigger/scheduler.js +3 -5
- package/dist/trigger/validation.js +4 -0
- package/dist/utils/error-utils.js +5 -2
- package/dist/utils/logger.js +13 -4
- package/dist/utils/npm-ops.js +2 -2
- package/dist/utils/windows-autostart.js +1 -1
- package/ecagent/dist/agent-loop.js +43 -1
- package/kits/docs/INDEX.md +1 -0
- package/kits/docs/context-assembly.md +21 -6
- package/kits/docs/eck_templates/INDEX.template.md +1 -2
- package/kits/docs/evolcore/INDEX.md +1 -1
- package/kits/docs/evolcore/agent-create.md +5 -5
- package/kits/docs/evolcore/agent.md +4 -9
- package/kits/docs/evolcore/directory.md +137 -0
- package/kits/docs/evolcore/menu-protocol.md +55 -0
- package/kits/docs/evolcore/response.md +7 -1
- package/kits/docs/evolcore/tool-authorization.md +1 -1
- package/kits/docs/evolcore/trigger.md +4 -0
- package/kits/docs/prompt-loading-architecture.md +6 -2
- package/kits/eck_manifest.auxiliary.json +1 -0
- package/kits/eck_manifest.json +57 -4
- package/kits/eck_manifest.memory.json +67 -3
- package/kits/eck_manifest.paactive.json +528 -0
- package/kits/eck_message_manifest.paactive.json +233 -0
- package/kits/rules/01-overview.md +2 -2
- package/kits/rules/03-identity.md +10 -9
- package/kits/rules/05-venue.md +2 -4
- package/kits/rules/06-channel.md +1 -1
- package/kits/schemas/_meta.json +31 -3
- package/kits/schemas/agent-config.schema.18.json +5 -0
- package/kits/schemas/agent-config.schema.19.json +924 -0
- package/kits/schemas/relation-config.schema.12.json +289 -0
- package/kits/schemas/role-config.schema.2.json +215 -0
- package/kits/skills/ec-skill/scripts/cli.mjs +3 -2
- package/kits/skills/ec-trigger/SKILL.md +4 -4
- package/kits/skills/personal-assistant/SKILL.md +109 -53
- package/kits/skills/personal-assistant/references/02-bootstrap.md +73 -30
- package/kits/skills/personal-assistant/scripts/clean.mjs +35 -18
- package/kits/skills/personal-assistant/scripts/init.mjs +41 -2
- package/kits/skills/personal-assistant/scripts/lib/persona.mjs +185 -0
- package/kits/skills/personal-assistant/scripts/migrate.mjs +55 -4
- package/kits/skills/personal-assistant/scripts/pa.mjs +173 -0
- package/kits/skills/personal-assistant/scripts/uninstall.mjs +130 -0
- package/kits/skills/personal-assistant/templates/persona-section.md +3 -3
- package/kits/templates/message-fragments/handoff-request-to-target.md +1 -1
- package/kits/templates/message-fragments/paactive/item.md +3 -0
- package/kits/templates/soul/00-GUIDE.md +61 -0
- package/kits/templates/soul/01-identity.md +5 -0
- package/kits/templates/soul/02-persona.md +11 -0
- package/kits/templates/soul/03-duties.md +5 -0
- package/kits/templates/soul/04-working-style.md +5 -0
- package/kits/templates/system-fragments/bootstrap.md +7 -7
- package/kits/templates/system-fragments/commands.md +3 -2
- package/kits/templates/system-fragments/directory-contacts.md +9 -0
- package/kits/templates/system-fragments/memory.md +1 -1
- package/kits/templates/system-fragments/paactive/channel.md +25 -0
- package/kits/templates/system-fragments/paactive/reply.md +25 -0
- package/kits/templates/system-fragments/paactive/session.md +32 -0
- package/kits/templates/system-fragments/personal-assistant.md +65 -0
- package/package.json +3 -2
- package/dist/cli/handoff-command.js +0 -353
- package/dist/directory/owner-directory-remark-operation.js +0 -147
- package/kits/docs/evolcore/self-summary.md +0 -29
|
@@ -15,6 +15,7 @@ import { EventBus } from '../core/event-bus.js';
|
|
|
15
15
|
import { resolveGlobalPkg } from '../utils/npm-ops.js';
|
|
16
16
|
import { ensureFreshPackageVersionInfo } from '../utils/package-version-info.js';
|
|
17
17
|
import { ecwebVersionRequirementError, resolveEcwebLaunchCommand } from '../ecweb/runtime/launch.js';
|
|
18
|
+
import { stopEcwebForRestart } from '../ecweb/runtime/lifecycle.js';
|
|
18
19
|
import { resolveEcwebExternalUrl, fetchRemotePairingCode, buildEcwebPairingUrl } from '../ecweb/pairing.js';
|
|
19
20
|
import { isHostChinese } from '../utils/locale.js';
|
|
20
21
|
import { scanInstances, cleanupInstances, findOrphanProcesses } from '../utils/instance-registry.js';
|
|
@@ -32,7 +33,7 @@ import { inspectDataMigrationRequirement } from '../core/data-migration.js';
|
|
|
32
33
|
import { readHostInfo, readVersionInfo } from '../utils/host-info.js';
|
|
33
34
|
import { queryStatusActivity, queryStatusActivityByAgent } from '../stats/query.js';
|
|
34
35
|
import { listCodexAppServerProcesses, unregisterCodexAppServerProcess } from '../agents/codex/app-server-registry.js';
|
|
35
|
-
import { DEFAULT_ECWEB_PORT, ecwebService, setEcwebEnabled } from '../config/daemon-services.js';
|
|
36
|
+
import { DEFAULT_ECWEB_PORT, ecwebService, serviceRuntimeMode, setEcwebEnabled } from '../config/daemon-services.js';
|
|
36
37
|
import { checkCodexProjectPath, inspectCodexManagedHook, ensureCodexManagedHook, runCodexHookLaunchDiagnostic, } from '../agents/codex/diagnostics.js';
|
|
37
38
|
import { formatClaudeSandboxDependencies, formatCodexSandboxAvailability, inspectClaudeSandboxDependencies, inspectCodexSandboxAvailability, probeClaudeSandboxDependencies, probeCodexSandboxAvailability, } from '../core/permission/sandbox-runtime.js';
|
|
38
39
|
const execFileAsync = promisify(execFile);
|
|
@@ -809,6 +810,11 @@ export async function cmdStart(opts = {}) {
|
|
|
809
810
|
trace.finish(launched.ok);
|
|
810
811
|
return;
|
|
811
812
|
}
|
|
813
|
+
trace.mark('cli.stopStaleEcweb');
|
|
814
|
+
if (!await stopManagedEcweb(p)) {
|
|
815
|
+
trace.finish(false);
|
|
816
|
+
return;
|
|
817
|
+
}
|
|
812
818
|
trace.mark('cli.spawnDaemon');
|
|
813
819
|
trace.setMeta('traceId', traceId);
|
|
814
820
|
console.log('🚀 Starting EvolCore...');
|
|
@@ -1154,6 +1160,12 @@ export async function cmdStop() {
|
|
|
1154
1160
|
}
|
|
1155
1161
|
const aliveMains = status.mains.filter(m => m.alive);
|
|
1156
1162
|
if (aliveMains.length === 0 && runtimeOrphans.length === 0) {
|
|
1163
|
+
trace.mark('cli.stopEcweb');
|
|
1164
|
+
if (!await stopManagedEcweb(p)) {
|
|
1165
|
+
trace.finish(false);
|
|
1166
|
+
printStopSummary(trace, cmdStartedAt, false);
|
|
1167
|
+
return;
|
|
1168
|
+
}
|
|
1157
1169
|
trace.discard();
|
|
1158
1170
|
console.log('⚠ EvolCore is not running');
|
|
1159
1171
|
return;
|
|
@@ -1175,6 +1187,14 @@ export async function cmdStop() {
|
|
|
1175
1187
|
process.exitCode = 1;
|
|
1176
1188
|
return;
|
|
1177
1189
|
}
|
|
1190
|
+
// The daemon may not have adopted a legacy ECWeb whose instance record
|
|
1191
|
+
// disappeared. Stop that verified listener even after the daemon exits.
|
|
1192
|
+
trace.mark('cli.stopEcweb');
|
|
1193
|
+
if (!await stopManagedEcweb(p)) {
|
|
1194
|
+
trace.finish(false);
|
|
1195
|
+
printStopSummary(trace, cmdStartedAt, false);
|
|
1196
|
+
return;
|
|
1197
|
+
}
|
|
1178
1198
|
// stopPid already observed every process leave the process table, so the
|
|
1179
1199
|
// records can be cleaned immediately (same reasoning as restart-monitor).
|
|
1180
1200
|
trace.mark('cli.cleanupInstances');
|
|
@@ -1529,6 +1549,14 @@ function renderStatusOverview(snapshot) {
|
|
|
1529
1549
|
else {
|
|
1530
1550
|
console.log(snapshot.channels.source === 'daemon' ? ' 无其他渠道' : ' 状态不可用');
|
|
1531
1551
|
}
|
|
1552
|
+
for (const channel of snapshot.channels.items) {
|
|
1553
|
+
if (channel.reason)
|
|
1554
|
+
console.log(` ${channel.name}: ${channel.status} [${channel.reason.code}] ${channel.reason.message}`);
|
|
1555
|
+
}
|
|
1556
|
+
for (const provider of snapshot.channels.providers) {
|
|
1557
|
+
if (provider.reason)
|
|
1558
|
+
console.log(` ${statusChannelLabel(provider.channelType)} provider: ${provider.status} [${provider.reason.code}] ${provider.reason.message}`);
|
|
1559
|
+
}
|
|
1532
1560
|
if (snapshot.triggers?.source === 'runtime+history') {
|
|
1533
1561
|
console.log('\n触发器');
|
|
1534
1562
|
renderStatusTable(['启用', '今日执行', '今日失败'], [[
|
|
@@ -1760,12 +1788,14 @@ async function collectStatusSnapshot() {
|
|
|
1760
1788
|
},
|
|
1761
1789
|
channels: {
|
|
1762
1790
|
source: statusAvailable ? 'daemon' : 'unavailable',
|
|
1791
|
+
providers: statusResponse?.channelRuntime?.providers ?? [],
|
|
1763
1792
|
items: Object.entries(statusResponse?.channels ?? {})
|
|
1764
1793
|
.filter(([, channel]) => channel?.channelType !== 'aun')
|
|
1765
1794
|
.map(([name, channel]) => ({
|
|
1766
1795
|
name, type: channel?.channelType ?? name,
|
|
1767
1796
|
status: channel?.status ?? (channel?.connected ? 'connected' : 'disconnected'),
|
|
1768
1797
|
connected: channel?.connected ?? false,
|
|
1798
|
+
...(channel?.reason ? { reason: channel.reason } : {}),
|
|
1769
1799
|
})),
|
|
1770
1800
|
},
|
|
1771
1801
|
controlAid: statusResponse?.controlAid ?? null,
|
|
@@ -2864,7 +2894,7 @@ async function cmdWatchAid() {
|
|
|
2864
2894
|
// 标记生成:[明文/密文|自主/响应](紫色=工具渲染标记)
|
|
2865
2895
|
const mkTags = (encrypt, chatmode) => {
|
|
2866
2896
|
const enc = encrypt ? '密文' : '明文';
|
|
2867
|
-
const mode = chatmode === 'proactive' ? '自主' : '响应';
|
|
2897
|
+
const mode = chatmode === 'paactive' ? 'PA' : chatmode === 'proactive' ? '自主' : '响应';
|
|
2868
2898
|
return `${MAGENTA}[${enc}|${mode}]${RST}`;
|
|
2869
2899
|
};
|
|
2870
2900
|
let msgPreview = '';
|
|
@@ -3344,6 +3374,21 @@ export function stopCodexAppServerOrphans() {
|
|
|
3344
3374
|
}
|
|
3345
3375
|
return killed;
|
|
3346
3376
|
}
|
|
3377
|
+
/** Stop managed ECWeb, including verified listeners without instance records. */
|
|
3378
|
+
async function stopManagedEcweb(p) {
|
|
3379
|
+
try {
|
|
3380
|
+
const service = ecwebService(loadDaemonConfig().services);
|
|
3381
|
+
if (service && serviceRuntimeMode(service) === 'managed') {
|
|
3382
|
+
await stopEcwebForRestart(p, service.port ?? DEFAULT_ECWEB_PORT, console.log);
|
|
3383
|
+
}
|
|
3384
|
+
return true;
|
|
3385
|
+
}
|
|
3386
|
+
catch (error) {
|
|
3387
|
+
console.error(`❌ ECWeb 清理失败:${error instanceof Error ? error.message : String(error)}`);
|
|
3388
|
+
process.exitCode = 1;
|
|
3389
|
+
return false;
|
|
3390
|
+
}
|
|
3391
|
+
}
|
|
3347
3392
|
/** 若 ecweb 在运行则杀掉并确认 pid/端口都已释放。 */
|
|
3348
3393
|
async function stopEcwebIfRunning(p) {
|
|
3349
3394
|
const port = ecwebService(loadDaemonConfig().services)?.port ?? DEFAULT_ECWEB_PORT;
|
package/dist/cli/data-command.js
CHANGED
|
@@ -79,10 +79,18 @@ async function waitForMaintenanceWindow() {
|
|
|
79
79
|
throw new Error(`cannot begin migration while runtime remains active (main=${runtime.mainCount}, restart-monitor=${runtime.monitorPids.length}, ipc=${ipc})`);
|
|
80
80
|
}
|
|
81
81
|
export async function cmdData(args) {
|
|
82
|
-
|
|
82
|
+
const sub = args[0];
|
|
83
|
+
// 无参/求助 → 用法并 exit 0(用户主动查用法,不是错误)。
|
|
84
|
+
if (!sub || wantsHelp(args)) {
|
|
83
85
|
console.log('用法: ec data migrate --dry-run | --apply [migration-id] | --verify [migration-id]');
|
|
84
86
|
return;
|
|
85
87
|
}
|
|
88
|
+
if (sub !== 'migrate') {
|
|
89
|
+
console.error(`未知子命令: ${sub}`);
|
|
90
|
+
console.error('用法: ec data migrate --dry-run | --apply [migration-id] | --verify [migration-id]');
|
|
91
|
+
process.exitCode = 1;
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
86
94
|
const root = resolveRoot();
|
|
87
95
|
if (args.includes('--dry-run')) {
|
|
88
96
|
if (args.length !== 2)
|
package/dist/cli/debug-mode.js
CHANGED
|
@@ -134,7 +134,7 @@ export async function resolveDebugContext(args) {
|
|
|
134
134
|
const ctxWithoutEpoch = { ...runtimeContext, daemonRuntimeEpoch: undefined };
|
|
135
135
|
Object.assign(process.env, buildTaskRuntimeEnv(ctxWithoutEpoch));
|
|
136
136
|
process.env[AGENT_DELEGATION_TOKEN_ENV] = token;
|
|
137
|
-
//
|
|
137
|
+
// peer / directory / fs 等命令只读 EVOLCORE_SELF_AID,不走 taskRuntimeContext,单独注入
|
|
138
138
|
if (runtimeContext.selfAid)
|
|
139
139
|
process.env.EVOLCORE_SELF_AID = runtimeContext.selfAid;
|
|
140
140
|
}
|
package/dist/cli/diag.js
CHANGED
|
@@ -5,7 +5,7 @@ import { parseDiagArgs } from '../core/command/diag-service.js';
|
|
|
5
5
|
import { wantsHelp } from './help.js';
|
|
6
6
|
export async function cmdDiag(args) {
|
|
7
7
|
if (wantsHelp(args)) {
|
|
8
|
-
console.log('
|
|
8
|
+
console.log('用法: ec diag <问题描述> [--owner <daemonOwner-aid>] [--format json]\n ec diag stop [--format json]\n未指定 --owner 时联系本机 Control AID 的协议 Owner;有效诊断期间再次执行会追加到原 case。');
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
11
|
const argv = ['diag', ...args];
|
package/dist/cli/directory.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { resolvePaths } from '../paths.js';
|
|
2
2
|
import { daemonUnavailableMessage, getArgValue, isHelpFlag, queryDaemon, wantsHelp } from './help.js';
|
|
3
3
|
import { AGENT_DELEGATION_TOKEN_ENV, readDelegationCredential } from '../core/auth/agent-delegation.js';
|
|
4
|
-
import { DirectoryRemarkError, executeDirectoryRemarkCommand, resolveDirectoryRemarkCommand, } from '../directory/owner-directory-remark-operation.js';
|
|
5
4
|
import { DirectoryQueryError, executeDirectoryQueryCommand, resolveDirectoryQueryCommand, } from '../directory/owner-directory-query-operation.js';
|
|
6
|
-
const QUERY_ACTIONS = new Set(['find', 'show', 'list']);
|
|
5
|
+
const QUERY_ACTIONS = new Set(['find', 'show', 'list', 'refresh', 'blocked']);
|
|
7
6
|
/**
|
|
8
7
|
* `ec directory ...`
|
|
9
8
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* 只读查询 + 重算注入。**备注不走命令**:它是一个 frontmatter markdown 文件,由 Agent
|
|
10
|
+
* 直接读写自己目录下的 `<agent>/directory/remarks/<联系人AID>.md`,改完再
|
|
11
|
+
* `ec directory refresh` 让 `directory.md` 重算。
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* 不给命令的理由:备注只落在自己的 agent 目录里,没有跨目录写入需求,
|
|
14
|
+
* 包一层 CLI + daemon IPC 只是把「写一个文件」变复杂。
|
|
14
15
|
*/
|
|
15
16
|
export async function cmdDirectory(args) {
|
|
16
17
|
if (args.length === 0 || isHelpFlag(args[0]) || wantsHelp(args)) {
|
|
@@ -18,31 +19,27 @@ export async function cmdDirectory(args) {
|
|
|
18
19
|
return;
|
|
19
20
|
}
|
|
20
21
|
const action = args[0];
|
|
21
|
-
|
|
22
|
-
if (!isRemark && !QUERY_ACTIONS.has(action)) {
|
|
22
|
+
if (!QUERY_ACTIONS.has(action)) {
|
|
23
23
|
console.error(`❌ 未知子命令: ${action}`);
|
|
24
24
|
printHelp();
|
|
25
25
|
process.exitCode = 1;
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
28
|
const json = getArgValue(args, '--format') === 'json';
|
|
29
|
-
const argv = isRemark ? args.slice(1) : args;
|
|
30
29
|
try {
|
|
31
30
|
const result = process.env.EVOLCORE_SESSION_ID
|
|
32
|
-
? await runManaged(
|
|
33
|
-
: await runLocal(
|
|
31
|
+
? await runManaged(args, json)
|
|
32
|
+
: await runLocal(args);
|
|
34
33
|
output(result, json);
|
|
35
34
|
}
|
|
36
35
|
catch (error) {
|
|
37
|
-
const known = error instanceof
|
|
36
|
+
const known = error instanceof DirectoryQueryError;
|
|
38
37
|
console.error(`❌ ${known ? error.message : (error instanceof Error ? error.message : String(error))}`);
|
|
39
38
|
process.exitCode = 1;
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
|
-
async function runLocal(argv
|
|
43
|
-
return
|
|
44
|
-
? executeDirectoryRemarkCommand(resolveDirectoryRemarkCommand(argv))
|
|
45
|
-
: executeDirectoryQueryCommand(resolveDirectoryQueryCommand(argv));
|
|
41
|
+
async function runLocal(argv) {
|
|
42
|
+
return executeDirectoryQueryCommand(resolveDirectoryQueryCommand(argv));
|
|
46
43
|
}
|
|
47
44
|
function output(result, json) {
|
|
48
45
|
if (!result.ok) {
|
|
@@ -66,18 +63,42 @@ function output(result, json) {
|
|
|
66
63
|
console.log('(先做了一次同步)');
|
|
67
64
|
return;
|
|
68
65
|
}
|
|
69
|
-
case 'show':
|
|
70
|
-
|
|
66
|
+
case 'show': {
|
|
67
|
+
// 按名字命中多条时全部列出,先给一行汇总,避免把第一条误当成唯一答案。
|
|
68
|
+
if (result.entries.length > 1) {
|
|
69
|
+
console.log(`按${result.matchedBy === 'name' ? '名字' : 'AID'}命中 ${result.entries.length} 条,逐条列出:`);
|
|
70
|
+
}
|
|
71
|
+
for (const entry of result.entries) {
|
|
72
|
+
if (result.entries.length === 1)
|
|
73
|
+
console.log(JSON.stringify(entry, null, 2));
|
|
74
|
+
else {
|
|
75
|
+
console.log('---');
|
|
76
|
+
console.log(JSON.stringify(entry, null, 2));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (result.truncated)
|
|
80
|
+
console.log(`(另有 ${result.truncated} 条同名未列出,加 --limit 或按 AID 精确查)`);
|
|
81
|
+
if (result.synced)
|
|
82
|
+
console.log('(先做了一次同步)');
|
|
71
83
|
return;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
84
|
+
}
|
|
85
|
+
case 'refresh': {
|
|
86
|
+
console.log(result.pulled
|
|
87
|
+
? `已拉取最新名录${typeof result.total === 'number' ? `(${result.total} 条)` : ''},directory.md 已重算`
|
|
88
|
+
: '没有可用连接,未拉取;本地名录已按当前备注重算');
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
case 'blocked': {
|
|
92
|
+
if (result.entries.length === 0)
|
|
93
|
+
console.log('(没有被拉黑的主体)');
|
|
94
|
+
for (const entry of result.entries) {
|
|
95
|
+
const name = typeof entry.name === 'string' ? entry.name : '';
|
|
96
|
+
console.log([name || entry.aid, entry.aid, entry.type ?? '', entry.source]
|
|
97
|
+
.filter(Boolean).join(' | '));
|
|
80
98
|
}
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
case 'list': {
|
|
81
102
|
if (result.entries.length === 0)
|
|
82
103
|
console.log('(没有条目)');
|
|
83
104
|
for (const entry of result.entries) {
|
|
@@ -87,20 +108,6 @@ function output(result, json) {
|
|
|
87
108
|
}
|
|
88
109
|
return;
|
|
89
110
|
}
|
|
90
|
-
case 'get':
|
|
91
|
-
if (!result.remark)
|
|
92
|
-
console.log('(无备注)');
|
|
93
|
-
else
|
|
94
|
-
console.log(JSON.stringify(result.remark, null, 2));
|
|
95
|
-
return;
|
|
96
|
-
case 'set':
|
|
97
|
-
console.log(`已写入备注${result.regenerated ? ',directory.md 已重算' : ''}`);
|
|
98
|
-
return;
|
|
99
|
-
case 'rm':
|
|
100
|
-
console.log(result.removed
|
|
101
|
-
? `已删除备注${result.regenerated ? ',directory.md 已重算' : ''}`
|
|
102
|
-
: '该联系人没有备注');
|
|
103
|
-
return;
|
|
104
111
|
}
|
|
105
112
|
}
|
|
106
113
|
function printHit(hit) {
|
|
@@ -114,55 +121,61 @@ function printHit(hit) {
|
|
|
114
121
|
const exact = hit.score >= 1000 ? ' [精确匹配]' : '';
|
|
115
122
|
console.log(`${cells.join(' | ')}${exact}`);
|
|
116
123
|
}
|
|
117
|
-
async function runManaged(argv,
|
|
124
|
+
async function runManaged(argv, json) {
|
|
118
125
|
const sessionId = process.env.EVOLCORE_SESSION_ID;
|
|
119
126
|
const delegationToken = readDelegationCredential();
|
|
120
127
|
if (!delegationToken) {
|
|
121
|
-
throw new
|
|
128
|
+
throw new DirectoryQueryError('DELEGATION_REQUIRED', `${AGENT_DELEGATION_TOKEN_ENV} is not set for the active task`);
|
|
122
129
|
}
|
|
123
130
|
const { response, transportError } = await queryDaemon(resolvePaths().socket, {
|
|
124
131
|
type: 'directory.op',
|
|
125
|
-
argv:
|
|
132
|
+
argv: ['directory', ...argv],
|
|
126
133
|
sessionId,
|
|
127
134
|
delegationToken,
|
|
128
|
-
},
|
|
135
|
+
}, 15_000);
|
|
129
136
|
if (!response) {
|
|
130
|
-
throw new
|
|
137
|
+
throw new DirectoryQueryError('DAEMON_UNAVAILABLE', daemonUnavailableMessage(transportError, 'Unable to connect to the evolcore daemon'));
|
|
131
138
|
}
|
|
132
139
|
if (!response.ok || !response.result) {
|
|
133
|
-
throw new
|
|
140
|
+
throw new DirectoryQueryError(response.code || 'DIRECTORY_OPERATION_FAILED', response.error || 'directory operation failed');
|
|
134
141
|
}
|
|
135
142
|
void json;
|
|
136
143
|
return response.result;
|
|
137
144
|
}
|
|
138
145
|
function printHelp() {
|
|
139
|
-
console.log(
|
|
140
|
-
ec directory find <query> --self <agent-aid> [--type <type>] [--scope internal|external|all] [--limit <n>]
|
|
141
|
-
ec directory show <contact-aid
|
|
142
|
-
ec directory list --self <agent-aid> [--type <type>] [--scope internal|external|all]
|
|
143
|
-
|
|
144
|
-
ec directory
|
|
145
|
-
ec directory remark set <contact-aid> --self <agent-aid> [--remark <text>] [--body <text> | --body-file <path>]
|
|
146
|
-
ec directory remark rm <contact-aid> --self <agent-aid>
|
|
147
|
-
ec directory remark list --self <agent-aid>
|
|
146
|
+
console.log(`用法:
|
|
147
|
+
ec directory find <query> --self <agent-aid> [--type <type>] [--scope internal|external|all] [--owner <aid|unbound>] [--limit <n>]
|
|
148
|
+
ec directory show <contact-aid|名字> --self <agent-aid> [--limit <n>]
|
|
149
|
+
ec directory list --self <agent-aid> [--type <type>] [--scope internal|external|all] [--owner <aid|unbound>] [--limit <n>]
|
|
150
|
+
ec directory refresh --self <agent-aid>
|
|
151
|
+
ec directory blocked --self <agent-aid>
|
|
148
152
|
|
|
149
153
|
find:
|
|
150
154
|
按 AID、名字、备注、描述匹配。查询串按空格切成多个词,要求全部命中。
|
|
151
155
|
默认查全部(含外部条目);--scope internal 只看内部,--scope external 只看外部。
|
|
152
156
|
本地没有匹配时会触发一次有界同步再查一遍(B 方案)。
|
|
153
157
|
|
|
154
|
-
show
|
|
158
|
+
show:接受 AID 或名字。按名字匹配显示名、远端备注名与本地称呼(精确等于),
|
|
159
|
+
同名多条时全部列出。返回完整记录(描述不截断)。
|
|
155
160
|
list:列出条目,默认只列内部联系人。
|
|
161
|
+
--owner <aid|unbound>:find / list 都支持,按条目的归属 Owner 过滤;unbound 只列无归属条目。
|
|
162
|
+
|
|
163
|
+
refresh:拉一次最新名录并重算 directory.md / identity.json。拉取需要 channel 在线;
|
|
164
|
+
没有连接时只做本地重算——手工改完备注后用它把改动刷进名录。
|
|
165
|
+
|
|
166
|
+
blocked:列出被拉黑的主体,合并两个来源——名录的 blocked_aids(Owner 侧,跨 Agent 生效)
|
|
167
|
+
与 peers.json 的 blocked(本端,只对本 agent 生效)。source 字段标明来源。
|
|
168
|
+
|
|
169
|
+
备注不走命令:直接读写自己目录下的 <agent>/directory/remarks/<联系人AID>.md
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
aid: <联系人AID>
|
|
173
|
+
remark: <称呼>
|
|
174
|
+
updated_at: <unix 秒>
|
|
175
|
+
---
|
|
156
176
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
---
|
|
160
|
-
aid: <contact-aid>
|
|
161
|
-
remark: <覆盖远端备注名>
|
|
162
|
-
updated_at: <unix 秒>
|
|
163
|
-
---
|
|
164
|
-
<正文,覆盖远端描述>
|
|
165
|
-
--self 指定被维护备注的 Agent;set / rm 之后会重算该 Agent 的 directory.md。
|
|
177
|
+
<正文>
|
|
178
|
+
文件名必须与 aid 一致;remark 与正文可只写一个。改完调 ec directory refresh。
|
|
166
179
|
|
|
167
180
|
选项:
|
|
168
181
|
--self <agent-aid> 目标 Agent,缺省取 EVOLCORE_SELF_AID
|
|
@@ -4,7 +4,7 @@ import { resolvePaths, agentThreadIndexPath, agentTriggersDir } from '../paths.j
|
|
|
4
4
|
import { scanChatDirs, readLastJsonlLine, } from '../core/session/session-fs-store.js';
|
|
5
5
|
import { isMainTopicId } from '../core/thread/topic-id.js';
|
|
6
6
|
const HELP_TEXT = `
|
|
7
|
-
ec getmeta <id> [选项]
|
|
7
|
+
用法: ec getmeta <id> [选项]
|
|
8
8
|
|
|
9
9
|
按任意一种标识查询本地会话或触发器的完整元数据(不经过 daemon,直接读存档)。
|
|
10
10
|
|
package/dist/cli/index.js
CHANGED
|
@@ -18,15 +18,16 @@ import { isInitCancelledError, printInitCancelHint } from './init-cancel.js';
|
|
|
18
18
|
import { assertManagedTopLevelCommandAllowed, ManagedCommandNotAllowedError } from './managed-command-guard.js';
|
|
19
19
|
import { resolveDebugContext, stripAsSessionArgs } from './debug-mode.js';
|
|
20
20
|
const MAIN_HELP = `用法: ec <command> [选项]
|
|
21
|
+
ec 显示本帮助(等同 ec --help / ec -h)
|
|
21
22
|
|
|
22
23
|
服务:
|
|
23
24
|
init 初始化默认配置、owner、控制 AID 与 EC Web
|
|
24
|
-
start
|
|
25
|
+
start 启动服务(不指定命令时不再自动启动)
|
|
25
26
|
stop 停止服务
|
|
26
27
|
restart 重启服务并检查更新
|
|
27
|
-
upgrade 检查 EvolCore、EC Web 和 FASTAUN
|
|
28
|
-
update
|
|
29
|
-
status
|
|
28
|
+
upgrade 检查 EvolCore、EC Web 和 FASTAUN 是否有更新(只查询,不安装)
|
|
29
|
+
update 受理或复用唯一更新任务并异步执行(update status 查询进度)
|
|
30
|
+
status 查看运行状态(含 --format json 结构化快照)
|
|
30
31
|
logs 持续查看 daemon 日志
|
|
31
32
|
watch 打开日志、AID、消息或 EC Web 监控
|
|
32
33
|
|
|
@@ -36,10 +37,11 @@ Agent 与会话:
|
|
|
36
37
|
queue 查询或操作 agent 消息队列
|
|
37
38
|
session 按 ec 会话 id 查询本地 session 存档(含 agentSessionId)
|
|
38
39
|
getmeta 按会话 id / threadId / agentSessionId 查询会话元数据
|
|
40
|
+
thread 话题链:对端话题的列表、历史、摘要与索引维护
|
|
41
|
+
memory 记忆:写 note、整理正式记忆、触发整理会话
|
|
39
42
|
task 恢复暂停或异常中断的会话任务
|
|
40
43
|
trigger 管理定时与事件触发器
|
|
41
44
|
proxy 查询和管理 daemon 服务代理
|
|
42
|
-
handoff 查询和完成跨会话回流
|
|
43
45
|
pa-workspace 绑定 PA 工作区并维护入口导航
|
|
44
46
|
model 查看或设置模型与推理强度
|
|
45
47
|
response 查看或设置响应模式
|
|
@@ -53,7 +55,9 @@ AUN:
|
|
|
53
55
|
rpc 调用底层 AUN RPC
|
|
54
56
|
menu-client 向远程 daemon 发送标准 Menu 请求
|
|
55
57
|
diag 邀请远程诊断 Agent,或 stop 撤销诊断授权
|
|
56
|
-
|
|
58
|
+
peer 联系人黑名单与已登记对端查询
|
|
59
|
+
directory 名录查询:按 AID、名字、备注检索联系人
|
|
60
|
+
role 关系角色提升申请与审批
|
|
57
61
|
net AUN 网络链路诊断
|
|
58
62
|
|
|
59
63
|
配置与诊断:
|
|
@@ -61,12 +65,14 @@ AUN:
|
|
|
61
65
|
provider 管理 daemon 级 Provider 注册表与 JSON 导入
|
|
62
66
|
ability 按 AID 管理能力插件、运行、发布和作业
|
|
63
67
|
stats Token 用量与费用统计
|
|
68
|
+
skill EC 技能管理:加载、安装、启停与索引刷新
|
|
64
69
|
diagnose 检查启动环境
|
|
65
70
|
version 显示组件版本
|
|
66
71
|
mv 迁移项目目录和会话路径
|
|
67
72
|
|
|
68
73
|
维护命令:
|
|
69
|
-
data migrate
|
|
74
|
+
data 数据迁移(data migrate,显式维护窗口)
|
|
75
|
+
integrity 文件完整性台账:check / seal / query / list
|
|
70
76
|
mode 切换开发源码与 npm 包运行模式
|
|
71
77
|
restart-monitor 运行 daemon 重启监控器
|
|
72
78
|
bench AUN 消息性能基准测试
|
|
@@ -94,20 +100,64 @@ function printLifecycleHelp(command) {
|
|
|
94
100
|
};
|
|
95
101
|
console.log(help[command]);
|
|
96
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* 拒绝命令不认识的参数。
|
|
105
|
+
*
|
|
106
|
+
* `ec stop --hel` 这类打错字的输入此前会被静默忽略并照常执行——对 stop/restart
|
|
107
|
+
* 这种破坏性命令意味着「以为在查帮助,实际把服务停了」。这里按白名单收口:
|
|
108
|
+
* boolean 选项只允许出现一次,取值选项必须紧跟一个值。
|
|
109
|
+
*/
|
|
110
|
+
function readFlagValue(args, flag) {
|
|
111
|
+
const eqPrefix = `${flag}=`;
|
|
112
|
+
const inline = args.find(token => token.startsWith(eqPrefix));
|
|
113
|
+
if (inline !== undefined)
|
|
114
|
+
return inline.slice(eqPrefix.length);
|
|
115
|
+
return getArgValue(args, flag);
|
|
116
|
+
}
|
|
117
|
+
function rejectUnknownFlags(cmd, args, booleanFlags, valueFlags = []) {
|
|
118
|
+
const booleans = new Set(booleanFlags);
|
|
119
|
+
const values = new Set(valueFlags);
|
|
120
|
+
for (let index = 0; index < args.length; index++) {
|
|
121
|
+
const token = args[index];
|
|
122
|
+
if (!token.startsWith('-')) {
|
|
123
|
+
console.error(`❌ ${cmd} 不接受位置参数: ${token}`);
|
|
124
|
+
console.error(`用法: ec ${cmd} [选项],运行 ec ${cmd} --help 查看完整参数`);
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
const eq = token.indexOf('=');
|
|
128
|
+
const name = eq >= 0 ? token.slice(0, eq) : token;
|
|
129
|
+
if (booleans.has(name)) {
|
|
130
|
+
if (eq >= 0) {
|
|
131
|
+
console.error(`❌ ${name} 不接受取值`);
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
if (values.has(name)) {
|
|
137
|
+
if (eq >= 0)
|
|
138
|
+
continue;
|
|
139
|
+
const value = args[index + 1];
|
|
140
|
+
if (value === undefined || value.startsWith('-')) {
|
|
141
|
+
console.error(`❌ ${name} 需要一个值`);
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
index++;
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
console.error(`❌ 未知参数: ${token}`);
|
|
148
|
+
console.error(`用法: ec ${cmd} [选项],运行 ec ${cmd} --help 查看完整参数`);
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
97
153
|
// Suppress Node.js ExperimentalWarning (e.g. SQLite) from cluttering CLI output
|
|
98
154
|
process.removeAllListeners('warning');
|
|
99
155
|
process.on('warning', (w) => { if (w.name === 'ExperimentalWarning')
|
|
100
156
|
return; process.stderr.write((w.stack ?? String(w)) + '\n'); });
|
|
101
157
|
export async function main(args) {
|
|
102
|
-
//
|
|
103
|
-
//
|
|
104
|
-
|
|
105
|
-
if (args.length === 0 && process.env.EVOLCORE_SESSION_ID) {
|
|
106
|
-
console.log(MAIN_HELP);
|
|
107
|
-
process.exitCode = 1;
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
const cmd = args[0] || 'start';
|
|
158
|
+
// 裸跑 `ec` 一律等于 `ec --help` / `ec -h`:只打印帮助,不启动 daemon。
|
|
159
|
+
// 启动服务必须显式 `ec start`,托管与非托管环境行为一致。
|
|
160
|
+
const cmd = args[0] || 'help';
|
|
111
161
|
// 调试路径:--as-session <sessionId> 注入托管会话身份,必须在白名单检查之前
|
|
112
162
|
await resolveDebugContext(args);
|
|
113
163
|
// 注入完成后剥除 --as-session <sessionId> 两个参数,避免子命令把它们当作未知参数
|
|
@@ -255,7 +305,11 @@ export async function main(args) {
|
|
|
255
305
|
break;
|
|
256
306
|
}
|
|
257
307
|
{
|
|
258
|
-
|
|
308
|
+
if (!rejectUnknownFlags('start', strippedArgs.slice(1), ['--foreground', '--diagnose', '-d', '--debug'], ['--as-mode'])) {
|
|
309
|
+
process.exitCode = 1;
|
|
310
|
+
break;
|
|
311
|
+
}
|
|
312
|
+
const asModeRaw = readFlagValue(strippedArgs, '--as-mode');
|
|
259
313
|
if (asModeRaw !== undefined && asModeRaw !== 'dev' && asModeRaw !== 'install') {
|
|
260
314
|
console.error(`❌ --as-mode 只接受 dev 或 install,收到: ${asModeRaw}`);
|
|
261
315
|
process.exitCode = 1;
|
|
@@ -274,6 +328,10 @@ export async function main(args) {
|
|
|
274
328
|
printLifecycleHelp('stop');
|
|
275
329
|
break;
|
|
276
330
|
}
|
|
331
|
+
if (!rejectUnknownFlags('stop', strippedArgs.slice(1), [])) {
|
|
332
|
+
process.exitCode = 1;
|
|
333
|
+
break;
|
|
334
|
+
}
|
|
277
335
|
await cmdStop();
|
|
278
336
|
break;
|
|
279
337
|
case 'restart':
|
|
@@ -281,6 +339,10 @@ export async function main(args) {
|
|
|
281
339
|
printLifecycleHelp('restart');
|
|
282
340
|
break;
|
|
283
341
|
}
|
|
342
|
+
if (!rejectUnknownFlags('restart', strippedArgs.slice(1), ['--clear', '--diagnose', '-d'])) {
|
|
343
|
+
process.exitCode = 1;
|
|
344
|
+
break;
|
|
345
|
+
}
|
|
284
346
|
await cmdRestart({ clear: strippedArgs.includes('--clear'), diagnose: strippedArgs.includes('--diagnose') || strippedArgs.includes('-d') });
|
|
285
347
|
break;
|
|
286
348
|
case 'upgrade':
|
|
@@ -507,11 +569,6 @@ export async function main(args) {
|
|
|
507
569
|
await (await import('./aun-commands.js')).cmdMsg(strippedArgs.slice(1));
|
|
508
570
|
break;
|
|
509
571
|
}
|
|
510
|
-
case 'handoff': {
|
|
511
|
-
const { cmdHandoff } = await import('./handoff-command.js');
|
|
512
|
-
await cmdHandoff(strippedArgs.slice(1));
|
|
513
|
-
break;
|
|
514
|
-
}
|
|
515
572
|
case 'thread': {
|
|
516
573
|
const { runThreadCommand } = await import('./thread-command.js');
|
|
517
574
|
await runThreadCommand(strippedArgs.slice(1));
|
package/dist/cli/init.js
CHANGED
|
@@ -5,7 +5,7 @@ import readline from 'readline';
|
|
|
5
5
|
import { resolvePaths, ensureDataDirs } from '../paths.js';
|
|
6
6
|
import { commandExists } from '../utils/cross-platform.js';
|
|
7
7
|
import { scanInstances } from '../utils/instance-registry.js';
|
|
8
|
-
import { saveDefaultsSafe,
|
|
8
|
+
import { saveDefaultsSafe, loadDaemonConfig, saveDaemonConfig } from '../config-store.js';
|
|
9
9
|
import { DEFAULT_ECWEB_PORT, ecwebService, setEcwebEnabled } from '../config/daemon-services.js';
|
|
10
10
|
import { ensureControlAgentMd, generateControlAid, resolveControlAidDomain, submitControlAidRegistration, } from '../aun/aid/control-aid.js';
|
|
11
11
|
import { isValidAid } from '../aun/aid/validation.js';
|
|
@@ -500,12 +500,6 @@ export async function cmdInit(options) {
|
|
|
500
500
|
}
|
|
501
501
|
/** 补全控制 AID + owner(可单独调用,不走 baseagent 向导)。 */
|
|
502
502
|
export async function initTail(options = {}) {
|
|
503
|
-
// 提示创建 agent(两分支汇合后执行一次)
|
|
504
|
-
const { agents } = loadAllAgents();
|
|
505
|
-
if (agents.length === 0) {
|
|
506
|
-
console.log('\n提示:尚无 agent,运行以下命令创建:');
|
|
507
|
-
console.log(' ec agent new <aid>.example.com');
|
|
508
|
-
}
|
|
509
503
|
// 控制 AID:daemon 进程身份。缺失则生成并写回 daemon.json(幂等:已存在则跳过)。
|
|
510
504
|
const daemonConfig = loadDaemonConfig();
|
|
511
505
|
let controlAidReady = !!daemonConfig.aid;
|
|
@@ -619,10 +613,6 @@ export async function initTail(options = {}) {
|
|
|
619
613
|
}
|
|
620
614
|
console.log(`✓ 已配置进程级管理者: ${ownerAid}`);
|
|
621
615
|
}
|
|
622
|
-
if (daemonConfigForOwners.aid) {
|
|
623
|
-
console.log('\n协议 Owner 绑定:启动后运行 ec aid bind <ownerAid>。');
|
|
624
|
-
console.log('使用 ec aid bind status 查看绑定状态。');
|
|
625
|
-
}
|
|
626
616
|
return true;
|
|
627
617
|
}
|
|
628
618
|
async function handleEcwebPrompt() {
|
|
@@ -661,19 +651,7 @@ export async function initTail(options = {}) {
|
|
|
661
651
|
console.log('\n✓ EvolCore 初始化完成');
|
|
662
652
|
const finalCfg = loadDaemonConfig();
|
|
663
653
|
console.log(` 控制 AID: ${finalCfg.aid || '(未配置)'}`);
|
|
664
|
-
console.log(' 协议 Owner: 启动后使用 ec aid bind status 核验');
|
|
665
654
|
console.log(` ECWeb 自启动: ${ecwebService(finalCfg.services)?.enabled ? '已启用' : '已禁用'}`);
|
|
666
|
-
const { agents: finalAgents } = loadAllAgents();
|
|
667
|
-
if (finalAgents.length === 0) {
|
|
668
|
-
console.log('\n📌 下一步:创建 agent');
|
|
669
|
-
console.log(' ec agent new <your-aid>.example.com');
|
|
670
|
-
console.log(' ec init feishu # 绑定飞书');
|
|
671
|
-
console.log(' ec start # 启动服务');
|
|
672
|
-
}
|
|
673
|
-
else {
|
|
674
|
-
console.log(`\n✓ 已有 ${finalAgents.length} 个 agent,可直接运行:`);
|
|
675
|
-
console.log(' ec start');
|
|
676
|
-
}
|
|
677
655
|
return controlAidReady;
|
|
678
656
|
}
|
|
679
657
|
/**
|
package/dist/cli/link-rules.js
CHANGED
|
@@ -79,7 +79,7 @@ function cleanEmptyParents(dir) {
|
|
|
79
79
|
}
|
|
80
80
|
// ── 子命令 ──
|
|
81
81
|
function showHelp() {
|
|
82
|
-
console.log(
|
|
82
|
+
console.log(`用法: ec link-rules <subcommand> [baseagent] [--dir <path>]
|
|
83
83
|
|
|
84
84
|
Subcommands:
|
|
85
85
|
connect Connect ECK rules to a project directory (default: cwd)
|
|
@@ -15,7 +15,6 @@ const MANAGED_TASK_COMMANDS = new Set([
|
|
|
15
15
|
'group',
|
|
16
16
|
// Managed log reads are routed through a bounded, daemon-authorized IPC query.
|
|
17
17
|
'logs',
|
|
18
|
-
'handoff',
|
|
19
18
|
// `memory` only works inside a managed task: both subcommands require
|
|
20
19
|
// EVOLCORE_SESSION_ID and authorize through their daemon IPC entrypoints.
|
|
21
20
|
'memory',
|