evolcore 0.0.43-test.4 → 0.0.43-test.5
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 +46 -0
- package/bin/ecmsg.js +354 -91
- package/dist/agents/codex-runner.js +12 -17
- package/dist/aun/aid/agentmd.js +25 -0
- package/dist/aun/aid/control-aid.js +15 -0
- package/dist/aun/aid/identity.js +8 -0
- package/dist/aun/aid/ownership-operation.js +12 -3
- package/dist/channels/aun.js +30 -17
- package/dist/channels/daemon.js +2 -2
- package/dist/cli/agent-create.js +4 -2
- package/dist/cli/aid-bind-command.js +3 -0
- package/dist/cli/aun-commands.js +10 -3
- package/dist/cli/code-stats.js +451 -213
- package/dist/cli/ctl-command.js +1 -3
- package/dist/cli/daemon-commands.js +12 -3
- package/dist/cli/directory.js +3 -1
- package/dist/cli/ecmsg-gateway.js +204 -0
- package/dist/cli/index.js +6 -0
- package/dist/cli/init.js +45 -13
- package/dist/cli/provider-command.js +82 -5
- package/dist/cli/restart-monitor.js +11 -19
- package/dist/cli/stats.js +8 -1
- package/dist/cli/task-context.js +3 -0
- package/dist/config/boot-log.js +12 -1
- package/dist/config/config-manager.js +4 -13
- package/dist/config/daemon-services.js +1 -0
- package/dist/config/peer-role-resolver.js +5 -5
- package/dist/config/provider-identity-migration.js +202 -0
- package/dist/config/provider-identity.js +37 -0
- package/dist/config/provider-ipc-service.js +40 -3
- package/dist/config/provider-local-sync.js +153 -0
- package/dist/config/providers-config.js +32 -4
- package/dist/config/providers-management.js +144 -68
- package/dist/config/providers.js +4 -1
- package/dist/config/schema-migration.js +67 -3
- package/dist/core/agent-runtime.js +4 -2
- package/dist/core/auth/auth-gateway.js +5 -3
- package/dist/core/auth/delegation-diagnostics.js +6 -2
- package/dist/core/auth/operation-authorizer.js +3 -1
- package/dist/core/auth/operation-catalog.js +6 -4
- package/dist/core/command/cli-intent-parser.js +2 -1
- package/dist/core/command/command-handler.js +11 -6
- package/dist/core/command/menu-protocol.js +4 -2
- package/dist/core/command/provider-menu.js +4 -2
- package/dist/core/command/role-menu.js +2 -2
- package/dist/core/command/slash-handler.js +52 -16
- package/dist/core/handoff/runtime.js +9 -3
- package/dist/core/initialization/service.js +4 -3
- package/dist/core/message/aun-ipc-sender.js +81 -3
- package/dist/core/message/message-admission.js +2 -0
- package/dist/core/message/response-engine.js +23 -23
- package/dist/core/message/send-options.js +40 -0
- package/dist/core/message/send-routing.js +310 -0
- package/dist/core/ownership/owner-resolver.js +111 -8
- package/dist/core/permission/ec-command-parser.js +148 -15
- package/dist/core/permission/readonly-shell-query.js +66 -7
- package/dist/core/permission/tool-error-code.js +13 -1
- package/dist/core/permission/tool-policy.js +74 -20
- package/dist/core/relation/same-owner-proof.js +131 -0
- package/dist/core/session/session-idle-monitor.js +94 -16
- package/dist/core/session/session-manager.js +69 -16
- package/dist/core/thread/thread-route.js +5 -2
- package/dist/directory/owner-directory-cache.js +686 -97
- package/dist/directory/owner-directory-markdown.js +146 -36
- package/dist/directory/owner-directory-query-operation.js +2 -2
- package/dist/directory/owner-directory-scope.js +12 -0
- package/dist/directory/owner-directory-search.js +5 -1
- package/dist/directory/owner-directory-store.js +28 -0
- package/dist/ecweb/basic-settings-service.js +15 -1
- package/dist/ecweb/message-context-service.js +2 -2
- package/dist/ecweb/providers-service.js +3 -1
- package/dist/ecweb/runtime/lifecycle.js +18 -9
- package/dist/ecweb/runtime/supervisor.js +76 -24
- package/dist/index.js +4 -0
- package/dist/paths.js +2 -1
- package/dist/proxy/manager.js +2 -0
- package/dist/proxy/service-supervisor.js +2 -2
- package/dist/response-system/engines/v1/proactive-flow.js +4 -0
- package/dist/trigger/application-service.js +1 -0
- package/dist/trigger/event-source.js +4 -0
- package/dist/trigger/feedback.js +26 -2
- package/dist/trigger/scheduler.js +3 -3
- package/dist/trigger/system-definitions.js +2 -2
- package/dist/trigger/validation.js +4 -0
- package/dist/utils/autostart.js +2 -2
- package/dist/utils/cross-platform.js +36 -8
- package/dist/utils/public-suffix.js +5811 -0
- package/dist/utils/windows-autostart.js +41 -7
- package/ecagent/dist/harness/env/nodejs.js +46 -2
- package/kits/docs/aun/ABILITY_CALLING.md +3 -3
- package/kits/docs/channels/aun.md +1 -1
- package/kits/docs/channels/feishu.md +2 -2
- package/kits/docs/context-assembly.md +20 -4
- package/kits/docs/evolcore/INDEX.md +2 -1
- package/kits/docs/evolcore/agent.md +2 -2
- package/kits/docs/evolcore/aid.md +8 -2
- package/kits/docs/evolcore/ctl.md +13 -4
- package/kits/docs/evolcore/directory.md +48 -15
- package/kits/docs/evolcore/group.md +6 -6
- package/kits/docs/evolcore/memory-consolidation.md +1 -1
- package/kits/docs/evolcore/menu-protocol.md +32 -3
- package/kits/docs/evolcore/msg.md +28 -27
- package/kits/docs/evolcore/provider.md +39 -5
- package/kits/docs/evolcore/response.md +1 -1
- package/kits/docs/evolcore/thread-chain.md +11 -13
- package/kits/docs/evolcore/tool-authorization.md +17 -0
- package/kits/docs/evolcore/trigger.md +2 -2
- package/kits/docs/identity/ROLE_DETAIL.md +1 -1
- package/kits/docs/prompt-loading-architecture.md +30 -20
- package/kits/eck_manifest.auxiliary.json +5 -5
- package/kits/eck_manifest.json +28 -28
- package/kits/eck_manifest.memory.json +18 -18
- package/kits/rules/01-overview.md +1 -1
- package/kits/rules/06-channel.md +3 -3
- package/kits/schemas/_meta.json +7 -1
- package/kits/schemas/providers.schema.2.json +74 -0
- package/kits/schemas/role-registry.schema.1.json +1 -1
- package/kits/skills/ec-agent-create/SKILL.md +1 -0
- package/kits/skills/ec-service-proxy/SKILL.md +3 -10
- package/kits/skills/ec-trigger/SKILL.md +5 -5
- package/kits/skills/ec-trigger/references/examples.md +1 -1
- package/kits/templates/system-fragments/channel.md +5 -5
- package/kits/templates/system-fragments/commands.md +3 -2
- package/kits/templates/system-fragments/directory-contacts.md +10 -3
- package/kits/templates/system-fragments/personal-assistant.md +22 -3
- package/kits/templates/system-fragments/reply.md +47 -28
- package/kits/templates/system-fragments/session.md +2 -9
- package/kits/templates/system-fragments/thread.md +5 -5
- package/package.json +2 -3
|
@@ -243,6 +243,27 @@ function taskOwnership(xml, runtimeRoot) {
|
|
|
243
243
|
&& !/<Enabled>\s*false\s*<\/Enabled>/i.test(xml);
|
|
244
244
|
return { managed, current };
|
|
245
245
|
}
|
|
246
|
+
function orphanedTaskMatches(xml, runtimeRoot) {
|
|
247
|
+
const actions = xmlBlocks(xml, 'Actions');
|
|
248
|
+
const entries = actions.length === 1 ? xmlBlocks(actions[0], 'Exec') : [];
|
|
249
|
+
if (entries.length !== 1 || actions[0].replace(/<Exec(?:\s[^>]*)?>[\s\S]*?<\/Exec>/i, '').trim())
|
|
250
|
+
return false;
|
|
251
|
+
const command = xmlElement(entries[0], 'Command');
|
|
252
|
+
const args = xmlElement(entries[0], 'Arguments');
|
|
253
|
+
if (!command || !args
|
|
254
|
+
|| normalizeWindowsPath(command) !== normalizeWindowsPath(powershellPath())
|
|
255
|
+
|| normalizeCommandLine(args) !== normalizeCommandLine(taskArguments(wrapperPath(runtimeRoot))))
|
|
256
|
+
return false;
|
|
257
|
+
return [wrapperPath(runtimeRoot), ...['', '_', '__'].map(suffix => statePath(runtimeRoot) + suffix)].every(file => {
|
|
258
|
+
try {
|
|
259
|
+
fs.lstatSync(file);
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
catch (error) {
|
|
263
|
+
return error.code === 'ENOENT';
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}
|
|
246
267
|
function probeWindowsTask(runtimeRoot, action = '启用') {
|
|
247
268
|
const result = runSchtasks(['/Query', '/TN', WINDOWS_AUTOSTART_TASK_NAME, '/XML']);
|
|
248
269
|
if (result.status === 0) {
|
|
@@ -533,7 +554,7 @@ function disableWindowsAutostart(runtimeRoot) {
|
|
|
533
554
|
: {}),
|
|
534
555
|
};
|
|
535
556
|
}
|
|
536
|
-
export function configureWindowsAutostart(enabled, runtimeRoot) {
|
|
557
|
+
export function configureWindowsAutostart(enabled, runtimeRoot, options = {}) {
|
|
537
558
|
if (!isWindows()) {
|
|
538
559
|
return {
|
|
539
560
|
ok: !enabled,
|
|
@@ -562,12 +583,18 @@ export function configureWindowsAutostart(enabled, runtimeRoot) {
|
|
|
562
583
|
error: previousTask.error,
|
|
563
584
|
};
|
|
564
585
|
}
|
|
565
|
-
|
|
586
|
+
const repairingTask = previousTask.state === 'installed' && !previousTask.managed
|
|
587
|
+
&& orphanedTaskMatches(previousTask.xml, absoluteRoot)
|
|
588
|
+
&& options.confirmedTaskXml === previousTask.xml;
|
|
589
|
+
if (previousTask.state === 'installed' && !previousTask.managed && !repairingTask) {
|
|
566
590
|
return {
|
|
567
591
|
ok: false,
|
|
568
592
|
enabled: false,
|
|
569
593
|
nonFatal: true,
|
|
570
|
-
error: `已存在同名计划任务 \\${WINDOWS_AUTOSTART_TASK_NAME}
|
|
594
|
+
error: `已存在同名计划任务 \\${WINDOWS_AUTOSTART_TASK_NAME},无法确认属于当前 EvolCore 安装;为避免覆盖已停止配置。`,
|
|
595
|
+
...(orphanedTaskMatches(previousTask.xml, absoluteRoot)
|
|
596
|
+
? { repairTask: { xml: previousTask.xml, wrapperPath: scriptPath } }
|
|
597
|
+
: {}),
|
|
571
598
|
};
|
|
572
599
|
}
|
|
573
600
|
let previousWrapper;
|
|
@@ -656,6 +683,12 @@ export function configureWindowsAutostart(enabled, runtimeRoot) {
|
|
|
656
683
|
error: `启动脚本 ${scriptPath} 已存在但不属于 EvolCore;为避免覆盖已停止配置。`,
|
|
657
684
|
};
|
|
658
685
|
}
|
|
686
|
+
if (repairingTask) {
|
|
687
|
+
const latest = probeWindowsTask(absoluteRoot);
|
|
688
|
+
if (latest.state !== 'installed' || latest.xml !== options.confirmedTaskXml || !orphanedTaskMatches(latest.xml, absoluteRoot)) {
|
|
689
|
+
return { ok: false, enabled: false, error: '确认后计划任务或本地文件已变化,已取消重建;请重新检查并确认。' };
|
|
690
|
+
}
|
|
691
|
+
}
|
|
659
692
|
try {
|
|
660
693
|
writeWrapper(scriptPath, desiredContent);
|
|
661
694
|
}
|
|
@@ -671,7 +704,7 @@ export function configureWindowsAutostart(enabled, runtimeRoot) {
|
|
|
671
704
|
}
|
|
672
705
|
const taskBeforeCreate = probeWindowsTask(absoluteRoot);
|
|
673
706
|
if (taskBeforeCreate.state === 'error') {
|
|
674
|
-
const restoreError = restoreWrapperUnlessNeeded(scriptPath, previousWrapper, previousTask.state === 'installed' || (existingRun.state === 'installed' && existingRun.managed));
|
|
707
|
+
const restoreError = restoreWrapperUnlessNeeded(scriptPath, previousWrapper, (!repairingTask && previousTask.state === 'installed') || (existingRun.state === 'installed' && existingRun.managed));
|
|
675
708
|
const rollbackSuffix = restoreError ? `;恢复原启动脚本失败:${restoreError}` : '';
|
|
676
709
|
return {
|
|
677
710
|
ok: false,
|
|
@@ -680,7 +713,8 @@ export function configureWindowsAutostart(enabled, runtimeRoot) {
|
|
|
680
713
|
error: `创建计划任务前的复核失败:${taskBeforeCreate.error}${rollbackSuffix}`,
|
|
681
714
|
};
|
|
682
715
|
}
|
|
683
|
-
if (taskBeforeCreate.state
|
|
716
|
+
if ((repairingTask && (taskBeforeCreate.state !== 'installed' || taskBeforeCreate.xml !== options.confirmedTaskXml))
|
|
717
|
+
|| (taskBeforeCreate.state === 'installed' && !taskBeforeCreate.managed)) {
|
|
684
718
|
const restoreError = restoreWrapperUnlessNeeded(scriptPath, previousWrapper, existingRun.state === 'installed' && existingRun.managed);
|
|
685
719
|
const rollbackSuffix = restoreError ? `;恢复原启动脚本失败:${restoreError}` : '';
|
|
686
720
|
return {
|
|
@@ -727,9 +761,9 @@ export function configureWindowsAutostart(enabled, runtimeRoot) {
|
|
|
727
761
|
error: `${taskError}${fallbackError}${rollbackSuffix}`,
|
|
728
762
|
};
|
|
729
763
|
}
|
|
730
|
-
const restoreError = restoreWrapperUnlessNeeded(scriptPath, previousWrapper, taskBeforeCreate.state === 'installed' || (existingRun.state === 'installed' && existingRun.managed));
|
|
764
|
+
const restoreError = restoreWrapperUnlessNeeded(scriptPath, previousWrapper, (!repairingTask && taskBeforeCreate.state === 'installed') || (existingRun.state === 'installed' && existingRun.managed));
|
|
731
765
|
const rollbackSuffix = restoreError ? `;恢复原启动脚本失败:${restoreError}` : '';
|
|
732
|
-
const previousBackend = taskBeforeCreate.state === 'installed'
|
|
766
|
+
const previousBackend = !repairingTask && taskBeforeCreate.state === 'installed'
|
|
733
767
|
? 'task'
|
|
734
768
|
: existingRun.state === 'installed' && existingRun.managed
|
|
735
769
|
? 'user-run'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
|
-
import { constants, createReadStream } from "node:fs";
|
|
3
|
+
import { constants, createReadStream, readdirSync, readFileSync } from "node:fs";
|
|
4
4
|
import { access, appendFile, lstat, mkdir, mkdtemp, readdir, readFile, realpath, rm, writeFile, } from "node:fs/promises";
|
|
5
5
|
import { tmpdir } from "node:os";
|
|
6
6
|
import { isAbsolute, join, resolve } from "node:path";
|
|
@@ -210,6 +210,36 @@ function killProcessTree(pid) {
|
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
+
/** Pipe closure is not an exit acknowledgement for the other group members. */
|
|
214
|
+
async function waitForLinuxProcessGroupExit(groupId) {
|
|
215
|
+
const deadline = performance.now() + 2000;
|
|
216
|
+
while (true) {
|
|
217
|
+
let running = false;
|
|
218
|
+
for (const entry of readdirSync("/proc")) {
|
|
219
|
+
if (!/^\d+$/.test(entry))
|
|
220
|
+
continue;
|
|
221
|
+
let stat;
|
|
222
|
+
try {
|
|
223
|
+
stat = readFileSync(`/proc/${entry}/stat`, "utf8");
|
|
224
|
+
}
|
|
225
|
+
catch (error) {
|
|
226
|
+
if (["ENOENT", "ESRCH"].includes(error.code ?? ""))
|
|
227
|
+
continue;
|
|
228
|
+
throw error;
|
|
229
|
+
}
|
|
230
|
+
const fields = stat.slice(stat.lastIndexOf(")") + 2).split(" ");
|
|
231
|
+
if (Number(fields[2]) === groupId && fields[0] !== "Z" && fields[0] !== "X") {
|
|
232
|
+
running = true;
|
|
233
|
+
break;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
if (!running)
|
|
237
|
+
return;
|
|
238
|
+
if (performance.now() >= deadline)
|
|
239
|
+
throw new Error("Signalled process group did not exit within 2000ms");
|
|
240
|
+
await new Promise(resolve => setTimeout(resolve, 10));
|
|
241
|
+
}
|
|
242
|
+
}
|
|
213
243
|
export class NodeExecutionEnv {
|
|
214
244
|
constructor(options) {
|
|
215
245
|
this.cwd = options.cwd;
|
|
@@ -366,9 +396,23 @@ export class NodeExecutionEnv {
|
|
|
366
396
|
processExited = true;
|
|
367
397
|
releaseOutput();
|
|
368
398
|
});
|
|
369
|
-
child.on("close", (code) => {
|
|
399
|
+
child.on("close", async (code) => {
|
|
400
|
+
// Cleanup may outlive the command deadline; retain the reason that
|
|
401
|
+
// closed the execution rather than timing out an aborted cleanup.
|
|
402
|
+
if (timeoutId)
|
|
403
|
+
clearTimeout(timeoutId);
|
|
370
404
|
stdout += pendingStdout;
|
|
371
405
|
stderr += pendingStderr;
|
|
406
|
+
if (interrupted && process.platform === "linux" && child?.pid) {
|
|
407
|
+
try {
|
|
408
|
+
await waitForLinuxProcessGroupExit(child.pid);
|
|
409
|
+
}
|
|
410
|
+
catch (error) {
|
|
411
|
+
const cause = toError(error);
|
|
412
|
+
settle(err(new ExecutionError("unknown", cause.message, cause)));
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
372
416
|
if (callbackError) {
|
|
373
417
|
settle(err(callbackError));
|
|
374
418
|
return;
|
|
@@ -100,14 +100,14 @@ Agent 可以用该说明理解 Provider 特有的调用流程,但它仍是远
|
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
```text
|
|
103
|
-
|
|
103
|
+
ecmsg send --to <provider-aid> --payload-file <discover-json-file> --encrypt yes --return required --timeout 5s --format json
|
|
104
104
|
```
|
|
105
105
|
|
|
106
106
|
window_seconds 范围为 1–30,payload ttl 必须等于窗口,`--timeout` 取同一窗口。发送时补入 sent_at。Core 在窗口结束前保留各认证来源设备的结果,首条返回不结束等待;结果位于 responses / request.responses,逐项读取 responsePayload.result.capabilities,条目使用 path。设备身份取 responseDeviceId,不信任 payload 自报的 devices。零回包是 pending,不能据此确认全部设备离线。
|
|
107
107
|
|
|
108
108
|
## 原始 payload
|
|
109
109
|
|
|
110
|
-
`
|
|
110
|
+
`ecmsg send --payload` 直接透传 JSON,不为 Ability 添加 `text`、`chatmode` 或其它聊天字段。
|
|
111
111
|
Windows 或复杂 JSON 优先使用 `--payload-file`:通过文件工具把原始 UTF-8 JSON 写入当前会话
|
|
112
112
|
`$TMPDIR`,再单独执行发送。PowerShell 路径用 `"$env:TMPDIR/obs_payload.json"`,Git Bash 用
|
|
113
113
|
`"$TMPDIR/obs_payload.json"`;文件内容不加 Shell 转义。该选项与 `--payload` 及位置文本互斥,
|
|
@@ -228,7 +228,7 @@ Provider 还可能发送 Ability `role=ack` 表示已受理调用。EvolCore 将
|
|
|
228
228
|
默认等待时间为 60 秒,可由调用方传入 `--timeout` 覆盖。例如:
|
|
229
229
|
|
|
230
230
|
```text
|
|
231
|
-
|
|
231
|
+
ecmsg send --to <provider-aid> --payload '<camera-call-json>' --device-id <provider-device-id> --encrypt yes --return required --timeout 120s --format json
|
|
232
232
|
```
|
|
233
233
|
|
|
234
234
|
上述请求实际使用顶层 `message.send.ttl=120`。正 TTL 消息只保存在 AUN 消息服务内存中,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# AUN 渠道
|
|
2
2
|
|
|
3
3
|
> 知识性文档:AUN 渠道的配置、参数与特有机制。**不依赖当前会话渠道**——任意会话都可按需 Read。
|
|
4
|
-
> 运行时回复方式由共用 `[reply]` 段按实际 chatMode 决定;active 的 `[channel]` 补充文件、链接、@ 等能力。AUN 主动发送使用托管的 `
|
|
4
|
+
> 运行时回复方式由共用 `[reply]` 段按实际 chatMode 决定;active 的 `[channel]` 补充文件、链接、@ 等能力。AUN 主动发送使用托管的 `ecmsg send`。
|
|
5
5
|
> 群聊使用 `evolcore/group.md`;群文件使用 `evolcore/fs.md`。
|
|
6
6
|
|
|
7
7
|
## 概述
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# 飞书渠道
|
|
2
2
|
|
|
3
3
|
> 知识性文档:飞书渠道的配置、参数与特有机制。**不依赖当前会话渠道**——任意会话都可按需 Read(在 aun 会话里也可查飞书)。
|
|
4
|
-
> 运行时回复方式由共用 `[reply]` 段按实际 chatMode 决定:interactive 由 evolcore 自动投递普通输出,proactive 用 `
|
|
4
|
+
> 运行时回复方式由共用 `[reply]` 段按实际 chatMode 决定:interactive 由 evolcore 自动投递普通输出,proactive 用 `ecmsg send` 正式回复;active 的 `[channel]` 补充文件等能力。
|
|
5
5
|
|
|
6
6
|
## 概述
|
|
7
7
|
|
|
@@ -53,4 +53,4 @@ agent 级(config.json 顶层)相关开关:
|
|
|
53
53
|
- **合并转发解析**:飞书的 `merge_forward` 消息会被自动展开为文本注入上下文(含"以下是引用的原消息"包裹)。
|
|
54
54
|
- **交互卡片**:命令和交互请求可使用飞书卡片发送;卡片按钮**仅发起者可操作**,他人点击返回提示。
|
|
55
55
|
- **身份体系**:对端以 `user_id` 标识,关系层 peerKey 形如 `feishu#ou_xxx`。
|
|
56
|
-
- **自动回复**:飞书是非 aun 渠道,回复由 evolcore
|
|
56
|
+
- **自动回复**:飞书是非 aun 渠道,回复由 evolcore 自动完成;主动回复用 `ecmsg send '<text>'`。
|
|
@@ -303,13 +303,17 @@ coding 场景(无 channel/无身份)下,`chatType`、`channel`、`selfAid`
|
|
|
303
303
|
|
|
304
304
|
常规段均要求 `lifecycle=active`,下表的其它条件在此基础上叠加;Bootstrap 引导与共用回复段单独列出完整条件。
|
|
305
305
|
|
|
306
|
-
| order | id | 类型 | 加载条件(when) |
|
|
306
|
+
| order | id | 类型 | 加载条件(when) | 模板渲染 |
|
|
307
307
|
|-------|----|----|------------------|--------|
|
|
308
308
|
| 10 | rules | 目录 `$KITS_RULES` | active | ✗ |
|
|
309
309
|
| 15 | bootstrap-guide | `bootstrap.md` | lifecycle=bootstrapping | ✓ |
|
|
310
310
|
| 20 | identity-layer | fragment | active 且 chatType≠null | ✓ |
|
|
311
|
+
| 20.5 | skills-builtin | `$AGENT_DIR/skills/.index-builtin.md` | active(缺文件则跳过) | ✗ |
|
|
312
|
+
| 20.6 | skills-local | `$AGENT_DIR/skills/.index-local.md` | active(缺文件则跳过) | ✗ |
|
|
311
313
|
| 21 | soul | 目录 `$PERSONAL_DIR/soul`(`*.md`) | active 且 chatType≠null | ✗ |
|
|
312
|
-
|
|
|
314
|
+
| 28 | owner-directory | `$AGENT_DIR/directory/directory.md` | active 且 hasOwnerDirectory=true | ✗ |
|
|
315
|
+
| 29.4 | contacts-profile | fragment | active 且 hasOwnerDirectory=true 且 isPersonalAssistant≠true | ✓ |
|
|
316
|
+
| 29.5 | pa-profile | fragment | active 且 hasOwnerDirectory=true 且 isPersonalAssistant=true | ✓ |
|
|
313
317
|
| 30 | relation-layer | fragment | active 且 chatType∈{private,group} | ✓ |
|
|
314
318
|
| 35 | memory | `$KITS_FRAGMENTS/memory.md` | active 且 memoryEnableRelation≠false | ✓ |
|
|
315
319
|
| 36 | agent-memory | `$PERSONAL_DIR/memory/MEMORY.md` | active 且 memoryEnableAgent≠false | ✗ |
|
|
@@ -318,18 +322,30 @@ coding 场景(无 channel/无身份)下,`chatType`、`channel`、`selfAid`
|
|
|
318
322
|
| 40 | venue-fragment | fragment | active 且 chatType≠null | ✓ |
|
|
319
323
|
| 41 | venue-chattype | `$KITS_DOCS/venues/{{chatType}}.md` | active 且 chatType≠null | ✗ |
|
|
320
324
|
| 42 | venue-channel-chattype | `$KITS_DOCS/venues/{{channel}}-{{chatType}}.md` | active 且 chatType≠null | ✗ |
|
|
325
|
+
| 42.5 | group-history | fragment | active 且 channel=aun 且 chatType=group 且 groupHistoryAvailable=true | ✓ |
|
|
321
326
|
| 43.2 | relation-group-rules | `$RELATIONS_DIR/{{peerKey}}/rules.md` | active 且 groupRulesPath≠null | ✗ |
|
|
322
327
|
| 44 | venue-client | `$KITS_DOCS/venues/client-{{clientType}}.md` | active 且 clientType≠null | ✗ |
|
|
328
|
+
| 46 | thread | fragment | active 且 chatType∈{private,group} | ✗ |
|
|
323
329
|
| 49 | reply-contract | `reply.md` | channel≠null 且 lifecycle∈{active,bootstrapping} | ✓ |
|
|
324
330
|
| 50 | channel-layer | fragment | active 且 channel≠null | ✓ |
|
|
325
331
|
| 55 | commands | fragment | active 且 channel≠null | ✓ |
|
|
326
332
|
| 60 | session | fragment | active | ✓ |
|
|
327
333
|
| 70 | baseagent | fragment | active 且 baseAgent≠null | ✓ |
|
|
334
|
+
| 75 | bash-description | fragment | baseAgent∈{claude,ecagent} 且 lifecycle∈{active,bootstrapping} | ✓ |
|
|
328
335
|
| 80 | managed-runtime-notice | fragment | active | ✓ |
|
|
329
336
|
|
|
330
337
|
Bootstrap 只加载引导与有渠道时的最小通信上下文 `[reply]`,不加载完整身份/关系/渠道能力、个人记忆或普通任务命令。
|
|
331
338
|
`[reply]` 展示 selfAid、peerId、peerType、channel、chatType、chatMode;未知身份显示 unknown,回复方式只取运行时已解析的 chatMode,不从身份或私聊场景重新推断。命令经当前会话 delegated sender / daemon IPC 发送,遵守现有身份、目标、话题与加密约束。
|
|
332
|
-
`needsInjection`
|
|
339
|
+
`needsInjection` 仅是是否进行模板渲染的布尔开关,不是变量白名单,也不是注入开关:为 `false` 的段照样进上下文,只是内容原样输出、不展开 `{{...}}`。
|
|
340
|
+
|
|
341
|
+
### `description` 的用法
|
|
342
|
+
|
|
343
|
+
`description` 不是正文摘要,是 **section 的名字**——用来在对话里口头对指「哪一段」,以及作为每个文件内容的标题行出现在上下文里。写作口径:
|
|
344
|
+
|
|
345
|
+
- 写概念名(`身份层`、`对端记忆`、`群规则`),不写里面讲了什么,不写生效条件,不写维护者须知。
|
|
346
|
+
- 同一 `id` 在三份 manifest 里用同一个名字(`soul`、`memory` 这类段在不同会话侧重不同,但名字不跟着变)。
|
|
347
|
+
- 不写模板变量:`description` 不经过 `renderTemplate`,`{{...}}` 会原样输出。
|
|
348
|
+
- 目录段每个文件都带一次标题,名字越短越好。
|
|
333
349
|
|
|
334
350
|
> **v3 移除的段**:`order 22` working-memory、`23` preferences、`34` relation-working-memory、`35` peer-profile、`36.5` owner-working-memory 已从 manifest 删除。这些内容分别由 `memory-tags.md` 里的状态标签与 `profile` 标签的记忆取代。详见 `docs/memory/memory-system-v3.md`。
|
|
335
351
|
|
|
@@ -364,7 +380,7 @@ $KITS_DOCS/venues/ 通用环境文档(随包发布,只读
|
|
|
364
380
|
<system-reminder>
|
|
365
381
|
EvolCore Context Kit documents are shown below.
|
|
366
382
|
|
|
367
|
-
Contenu de <展示路径> (<id — description>):
|
|
383
|
+
Contenu de <展示路径> (<id — description>): ← description 即上文说的 section 名字
|
|
368
384
|
|
|
369
385
|
<文件内容>
|
|
370
386
|
|
|
@@ -36,7 +36,8 @@ Windows 上 Codex 托管任务出现 `helper_sandbox_lock_failed`、`SetNamedSec
|
|
|
36
36
|
|
|
37
37
|
| 命令集 | 用途 | 触发词 | 适用场景 | 文档 |
|
|
38
38
|
|--------|------|--------|----------|------|
|
|
39
|
-
| `
|
|
39
|
+
| `ecmsg` | **发送消息的统一入口**(当前会话 / `--thread` 跨话题 / `--to` 指定对端) | 回复/发消息/发文件/发链接/payload/加密/跨话题 | 有对端(peerId) | `msg.md` |
|
|
40
|
+
| `ec msg` | 私聊消息底层命令(宿主终端与历史兼容);托管会话内的发送用 `ecmsg` | 回复/发消息/拉取/撤回/查在线/payload-file/请求等待/结果查询/request_id/call_id | 有对端(peerId) | `msg.md` |
|
|
40
41
|
| `ec thread` | 话题管理与话题链 | 话题/thread/跨会话/委托/话题链/ThreadOrigin/summary/删除话题 | 有对端(私聊或群聊) | `thread-chain.md` |
|
|
41
42
|
| `ec group` | 群聊收发与群管理 | 群发/建群/本地群历史/邀请/踢人/退群/群成员/角色/封禁/屏蔽/成员状态/规则/@提及模式/协作 | AUN 群;可从私聊发起协作 | `group.md`;协作流程用 `ec-group-collaboration` 技能 |
|
|
42
43
|
| `/invites` / `ec group invites` | 收到群邀请、Owner 卡片审核与恢复 | 入群邀请/接受邀请/拒绝邀请/审核卡片/待处理邀请 | 当前 Agent Owner 的 AUN 私聊 | `group.md` |
|
|
@@ -36,7 +36,7 @@ ec agent new <aid> [--initialize] ...
|
|
|
36
36
|
|
|
37
37
|
# 创建 agent 并进入 Bootstrap
|
|
38
38
|
ec agent new <aid> --bootstrap [--non-interactive] \
|
|
39
|
-
[--project <路径>] [--baseagent claude|codex|gemini|ecagent] \
|
|
39
|
+
[--project <路径>] [--baseagent claude|codex|gemini|ecagent] [--provider <id>] \
|
|
40
40
|
[--owner <aid>] [--name "<显示名>"] [--description "<text>"] \
|
|
41
41
|
[--tags '<json-array>'] \
|
|
42
42
|
[--dry-run] [--force]
|
|
@@ -46,7 +46,7 @@ ec agent new <aid> --non-interactive ...
|
|
|
46
46
|
|
|
47
47
|
# 显式指定一次性初始化(隐含 --non-interactive)
|
|
48
48
|
ec agent new <aid> --initialize \
|
|
49
|
-
--project <路径> --baseagent <claude|codex|gemini|ecagent> \
|
|
49
|
+
--project <路径> --baseagent <claude|codex|gemini|ecagent> [--provider <id>] \
|
|
50
50
|
--owner <aid> --name "<显示名>" --description "<text>" \
|
|
51
51
|
--tags '<json-array>' [--persona-file <path> | --persona-text <text>] \
|
|
52
52
|
[--wait <seconds>] [--dry-run]
|
|
@@ -64,9 +64,11 @@ SDK 不持久化 Ownership task/WAL;`OwnershipTaskResult` 只是本次调用
|
|
|
64
64
|
ec aid bind status --subject <接收方本地AID> --format json
|
|
65
65
|
ec aid bind accept <operationId> --subject <接收方本地AID> --format json
|
|
66
66
|
ec aid bind reject <operationId> --subject <接收方本地AID> --reason '用户拒绝' --format json
|
|
67
|
+
ec aid bind reject --reset <ownerAid> --subject <发起绑定的本地AgentAID> --format json
|
|
67
68
|
```
|
|
68
69
|
|
|
69
70
|
`--subject` 始终指定执行审批的本地 AID。省略时,独立 CLI 使用 daemon Control AID,托管会话使用当前 self AID。
|
|
71
|
+
`reject --reset` 清除指定本地 Agent 对指定 Owner 的自动邀约拒绝记录,返回 `rejectionReset.ownerAid/cleared`,重复清除无副作用,并记录 `EC_OWNERSHIP` 的 `rejection.reset`。它沿用绑定变更的授权,只清本地记录及对应的拒绝任务投影,不发送邀约、不改变协议关系,也不重置当前进程的一次自动提交限制;需要立即重试时显式执行 `ec aid bind <ownerAid>`。尚未挂载 SDK client 的本地 Agent 也可通过获准管理入口清除此记录。
|
|
70
72
|
例如 B 请求由 A 担任 Owner,在 A 上确认时应选 `--subject A`。A 的状态中 `requests` 展示 SDK 已验证的
|
|
71
73
|
待确认绑定任务,包括 `operation_id`、`sub_aid`、`owner_aid`、`requester_aid`、本端 `local_role` 和关系版本。
|
|
72
74
|
本端既可以是拟任 Owner,也可以是接受 Owner 绑定的 sub;转让请求也通过这个入口审批,解绑和未验证请求不通过该入口。
|
|
@@ -137,9 +139,13 @@ Owner 目录同步在连接可用时建立单条核验和暂态故障退避链
|
|
|
137
139
|
|
|
138
140
|
Ownership 任务事件、修改本地 Owner 配置、相关名片或 Owner 关系材料变更只失效缓存,不主动发起复核。连接首次就绪、断线恢复和缓存到期均不触发提前刷新;下次实际消息、查询或授权需要 Owner 时才等待核验。相同任务事件和连接通知去重,无关对端、普通文件变更不触发失效。远端 Owner 的 Storage 事件只在本机确实收到时生效,不能假定事件完整覆盖远端变化。Owner 绑定提交前及修改 Owner 的授权仍要求显式核验成功。
|
|
139
141
|
|
|
140
|
-
|
|
142
|
+
生命周期有效的普通 Agent(包括已经 `active` 的存量 Agent)在 AUN 连接就绪后,优先取根级 `config.json.owner`,缺失时兼容旧 `owners` 数组的首个非空 AID;沿用首个配置 Owner 的选择规则,不向数组内所有 AID 发送邀约。没有绑定目标或生命周期无效时静默跳过。存在绑定目标且新鲜协议状态为 `unbound`、`released` 或 `single_sided` 时,每个 Agent 对同一 Owner 在本进程内最多自动提交一次绑定邀约,`active` 不再阻断启动补绑定。已有协议共识时不提交,也不自动转让 Owner。提交前记录 INFO 日志 `Submitting configured Owner binding invitation`,包含主体、目标 Owner 和协议状态;提交结果与失败继续记录 `EC_OWNERSHIP` 的 `bind.result` / `bind.failed`。等待确认、提交失败或回执不明均不定时重发,断线重连和渠道重建也不会再次提交;需要重发时显式执行绑定命令。自动尝试记录只保存在内存,不持久化;进程重启后重新检查并允许再自动提交一次。
|
|
141
143
|
|
|
142
|
-
|
|
144
|
+
普通 Agent 的创建、手动绑定、启动补绑定和转让,在提交关系修改前实时读取目标 Owner 的远端已验签名片,要求名片 AID 匹配且 `type: human`;非 human 返回 `INVALID_OWNER`,无法读取、未验签、类型缺失或名片不匹配返回 `OWNER_IDENTITY_UNAVAILABLE`。接受绑定或转让邀约也执行此限制;当前进程没有请求投影时,先从历史消息定位原请求的目标用于类型预检,原请求真实性及固定参与方仍由 SDK 在提交时核验。拒绝邀约不受目标类型限制。该限制面向普通 Agent,不把 daemon Control AID 的身份规则改成 Agent 规则,也不追溯修改已有协议关系。
|
|
145
|
+
|
|
146
|
+
整批删除旧配置后的冷启动不依赖静态 Owner 回退。普通入站、出站(包括持久发件箱)和敏感操作在实际需要时等待协议核验;核验前、查询失败或确认 `unbound/released` 时不授予 Owner 准入。敏感操作核验成功后按新鲜协议关系重建授权角色,避免沿用冷启动时的访客身份。不新增启动预刷新或定时重试。
|
|
147
|
+
|
|
148
|
+
每次提交前重读配置并检查连接是否仍有效。查询失败不消耗自动提交机会、不安排定时重试,可在后续连接就绪时重新检查。收到 SDK 验证的绑定拒绝事件或明确拒绝回执后,按 Agent 和 Owner 持久化拒绝记录;进程重启后也不再自动向该 Owner 发邀约。拒绝记录仅限制自动邀约,仍可显式执行绑定命令重新发起。超时、网络错误和其它失败不作为拒绝持久化。只有当前锁定、未失效且核验时间不超过 5 分钟的协议共识确认绑定后,才在同一次原子配置修改中整批删除根级标量 `owner` 和整个 `owners[]`,数组内其它旧值也一并删除,不单独安排过渡;其它配置字段保留。提交邀约或等待审批时保留两个字段。清理兼容字段不会撤销当前已核验的协议 Owner;后续冷启动通过协议核验恢复 Owner。
|
|
143
149
|
|
|
144
150
|
根级 `config.json.owner/owners` 在初次 Ownership 绑定前兼容现有 Owner 执行来源,同时作为绑定目标。Ownership 2.1 达成共识后,Owner 角色、权限校验、有效 Owner 列表和运行时配置投影只读取协议核验结果;手动重新写入这些配置字段不会恢复 Owner 权限。暂态故障容错仅使用本进程已成功核验的关系,配置值不能替代协议核验;尚未建立协议关系时仍保留兼容 Owner 行为。
|
|
145
151
|
|
|
@@ -21,21 +21,30 @@ H 类拒绝保留 `policyCode=h_class_protection`、`executed=false` 和原始
|
|
|
21
21
|
取消则另记 `cancelled`、`abortSource`;若拒绝与取消同时发生,两种事实均保留。
|
|
22
22
|
预期中断不发送普通错误或旧任务的最终回复,但原始会话及 runner 诊断仍保留工具结果和关闭流后的丢弃事件计数。
|
|
23
23
|
|
|
24
|
+
## 闲置触发(聊天斜杠命令)
|
|
25
|
+
|
|
26
|
+
- `/loop`:查看持久开关及待执行的单次提示词;回显为单行,不显示会话 ID。
|
|
27
|
+
- `/loop on [seconds]`:开启持久闲置触发,默认 300 秒,可设 30–86400 秒;每次普通任务结束后重新计时。
|
|
28
|
+
- `/loop <提示词>`:当前会话连续闲置 300 秒后执行提示词一次,不立即提交模型,也不修改持久开关。
|
|
29
|
+
- 新的单次提示词替换上一条待执行提示词;已有任务运行或新任务到达时,从任务结束后重新计时。
|
|
30
|
+
- `/loop off`:关闭持久触发并取消尚未入队的单次提示词;已经开始的任务不受影响。
|
|
31
|
+
- 持久开关按主会话 `relation-main` / 独立话题 `topic-session` 存储;单次请求始终只绑定发起时的确切会话。
|
|
32
|
+
- 单次请求保留原请求者和加密方式,执行时重新校验权限,不继承单次 `/fa` 提权;会话删除或替换后不转投新会话。
|
|
33
|
+
- 单次请求最多入队一次,入队失败不重发;已入队任务由原任务恢复机制处理,不另起一次任务。
|
|
34
|
+
|
|
24
35
|
## 会话名称
|
|
25
36
|
|
|
26
37
|
```bash
|
|
27
38
|
ec ctl name <新名称>
|
|
28
39
|
```
|
|
29
40
|
|
|
30
|
-
##
|
|
41
|
+
## 文件
|
|
31
42
|
|
|
32
43
|
```bash
|
|
33
|
-
ec ctl send '<text>' # 主动发送文本(proactive 模式)
|
|
34
44
|
ec ctl file [channel] <path> # 发送项目内文件
|
|
35
45
|
```
|
|
36
46
|
|
|
37
|
-
>
|
|
38
|
-
> `ec ctl send` 只在拿不到自己的 AID 时兜底——它自动继承当前会话的 AID 和对端。
|
|
47
|
+
> 发消息用 `ecmsg send`(见 msg.md)。`ec ctl` 只负责本表所列的会话工具。
|
|
39
48
|
|
|
40
49
|
## 消息队列
|
|
41
50
|
|
|
@@ -13,7 +13,7 @@ Agent 侧可以查询或向 Owner 发送入录申请,不能直接增删名录
|
|
|
13
13
|
命令与 `ec skill` 对齐:**`list` 列举/过滤,`info` 看单条详情**。
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
ec directory list [<关键词>...] [--filter '<kw1,kw2>']... [--type <type>] [--scope internal|external|all] [--owner <aid|unbound>] [--limit <n>] [--page <n>] [--format json]
|
|
16
|
+
ec directory list [<关键词>...] [--filter '<kw1,kw2>']... [--type <type>] [--scope internal|external|pa-team|all] [--owner <aid|unbound>] [--limit <n>] [--page <n>] [--format json]
|
|
17
17
|
ec directory info <contact-aid|名字> [--limit <n>] [--format json]
|
|
18
18
|
ec directory refresh [--format json]
|
|
19
19
|
ec directory blocked [--format json]
|
|
@@ -58,9 +58,13 @@ Evol App 中处理该申请,并把目标加入联系人名录、允许本 Agen
|
|
|
58
58
|
多个 `--filter` 之间为 AND**;
|
|
59
59
|
- 位置参数(`list 张三 采购`):保留旧 `find` 的语义,多个词**同时命中**(AND)。
|
|
60
60
|
|
|
61
|
-
其它过滤:`--type`、`--scope internal|external|all`(默认 `all
|
|
61
|
+
其它过滤:`--type`、`--scope internal|external|pa-team|all`(默认 `all`;`pa-team`
|
|
62
|
+
只列 `open_pa_context` 里且已核验的成员)、
|
|
62
63
|
`--owner <aid|unbound>`(按条目归属过滤,`unbound` 只列没有 `owner_aid` 的条目)。
|
|
63
64
|
|
|
65
|
+
**黑名单**:`blocked_aids` 里的主体不会出现在注入的 `directory.md` 里,也不该被
|
|
66
|
+
主动联系;名单本身用 `ec directory blocked` 查。
|
|
67
|
+
|
|
64
68
|
**分页**:默认每页 20 条,上限 100。`--limit` / `--page` 可调;JSON 结果带
|
|
65
69
|
`page` / `limit` / `total` / `hasMore`。
|
|
66
70
|
|
|
@@ -184,22 +188,51 @@ updated_at: <unix 秒>
|
|
|
184
188
|
|
|
185
189
|
### 备注怎样体现在注入内容里
|
|
186
190
|
|
|
187
|
-
`directory.md`
|
|
191
|
+
`directory.md` 按**注意力预算**分层:谁需要被认真读(载描述),谁只需要认得名字。
|
|
192
|
+
|
|
193
|
+
行形态有三种:
|
|
188
194
|
|
|
189
195
|
| 形态 | 内容 | 用于 |
|
|
190
196
|
|---|---|---|
|
|
191
|
-
| `full` | 名字 \| AID \| 类型 \| 备注名 \| 描述 \| 备注:… |
|
|
192
|
-
| `
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
197
|
+
| `full` | 名字 \| AID \| 类型 \| 备注名 \| 描述 \| 备注:… | PA Team |
|
|
198
|
+
| `name_with_aid` | 名字 \| 备注名 \| AID | 内部联系人(PA Team 之外) |
|
|
199
|
+
| `name_no_aid` | 名字 \| 备注名 | 外部 Agent / 外部人类 / 加入的群 / 其他 / 白名单 |
|
|
200
|
+
|
|
201
|
+
### 八个分组
|
|
202
|
+
|
|
203
|
+
| 顺序 | 分组 | 判据 | 形态 |
|
|
204
|
+
|---|---|---|---|
|
|
205
|
+
| 固定 | Owner / 个人助理 / 我 | 顶层身份块 + 自己 | 名字 \| 备注名 \| AID |
|
|
206
|
+
| 1 | **PA Team** | `aid ∈ open_pa_context` 且 `ownership_status=owned` | `full` |
|
|
207
|
+
| 2 | 内部联系人(其余) | 内部且不在 PA Team | `name_with_aid` |
|
|
208
|
+
| 3 | 外部 Agent | `classifyEntry` = `external_agent` | `name_no_aid` |
|
|
209
|
+
| 4 | 外部人类 | `classifyEntry` = `external_human` | `name_no_aid` |
|
|
210
|
+
| 5 | 加入的群 | `type=group` | `name_no_aid` |
|
|
211
|
+
| 6 | 其他 | 类型未知 / 归属未核实 / 无 owner | `name_no_aid`,附「不要主动联系」 |
|
|
212
|
+
| 7 | 白名单 | `allowedAids` 命中且不在 1–6 组 | `name_no_aid` |
|
|
213
|
+
|
|
214
|
+
**PA Team 判据**:服务端在 `contacts.json` 顶层下发 `open_pa_context`(AID 数组)。
|
|
215
|
+
判据是**这个列表**,不再看 `exttype` 前缀。成员必须同时满足 `ownership_status=owned`,
|
|
216
|
+
否则落到「其他」组——进了列表不等于绕过归属核验。
|
|
217
|
+
|
|
218
|
+
- 列表里出现但 `entries` 中不存在的 AID 会被丢弃并记 WARN(团队清单先于名录同步时
|
|
219
|
+
两边短暂不一致,不能因此报错)。
|
|
220
|
+
- **PA Team 最多加载 100 人**:前 100 人按 `full` 渲染,超出部分降级为 `name_no_aid`
|
|
221
|
+
单列,并在组提示里写明「当前加载 N 人,其余 M 人仅列名」。
|
|
222
|
+
|
|
223
|
+
**内部联系人(其余)**是 PA Team 的兜底分支:默认配置下所有内部 owned 成员都在
|
|
224
|
+
PA Team 里,该组为空、不渲染;Owner 手动把某人移出团队清单后,他才出现在这里。
|
|
225
|
+
|
|
226
|
+
**白名单**是**准入控制清单**,不是联系人分组:命中的主体本来就能入站,这里只是让 PA
|
|
227
|
+
知道"有这么个通道"。因此白名单成员可能**根本不在联系人清单里**——那种情况下只给名字,
|
|
228
|
+
不展示 AID 与描述。与 1–6 组去重,一个人只出现一次。
|
|
229
|
+
|
|
230
|
+
**其他组**:`type` 不在协议 8 种之内(如 `ai`)、`type=agent` 但 `ownership_status !== 'owned'`、
|
|
231
|
+
或没有 `owner_aid` 的条目。只注入名字与备注名,不展示 AID、类型与描述,并明确提示
|
|
232
|
+
“不要主动联系”。完整字段用 `ec directory list` 现查。
|
|
233
|
+
|
|
234
|
+
**降级**:任一分组超预算时,`full` 行降级为两列、`name_with_aid` 行去掉 AID,
|
|
235
|
+
仍放不下才从尾部整行省略,并汇总一行「其余 N 条已省略」。
|
|
203
236
|
|
|
204
237
|
## 输出与错误
|
|
205
238
|
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
17
|
# 文本(含空格/换行/特殊字符时用引号包起来;纯短词可不包,但多空格会被压成一个)
|
|
18
|
-
|
|
18
|
+
ecmsg send '<text>' [--encrypt yes|no|auto] # 在群会话里即群内公开发送
|
|
19
19
|
|
|
20
20
|
# 文件(--as image|video|voice|file)
|
|
21
|
-
|
|
21
|
+
ecmsg send --file <path> [--as <type>] [--text '<说明>']
|
|
22
22
|
|
|
23
23
|
# 自定义 payload
|
|
24
|
-
|
|
24
|
+
ecmsg send --payload '<json>'
|
|
25
25
|
|
|
26
26
|
# 查询本地群历史(只读,不调用 Gateway,不推进 group pull/ack 游标)
|
|
27
27
|
ec group history <from> <group-id> [--limit <N>] [--thread <main|all|id>] [--format json]
|
|
@@ -38,13 +38,13 @@ ec group ack <from> <group-id> <seq> [--app <name>]
|
|
|
38
38
|
- `--mention-all` — @ 所有人
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
ecmsg send '@bob 看下 PR' --mention 'bob.agentid.pub'
|
|
42
|
+
ecmsg send '通知' --mention 'alice.agentid.pub,bob.agentid.pub'
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
> 正文恰好以 `--` 开头:带空格的(如 `"--file 是正文"`)会被正确识别为正文;
|
|
46
46
|
> 若正文**精确等于**某个 flag 名(如要发送文本 `--encrypt`),用 `--` 分隔:
|
|
47
|
-
> `
|
|
47
|
+
> `ecmsg send -- --encrypt`
|
|
48
48
|
|
|
49
49
|
发送选项还包括:
|
|
50
50
|
|
|
@@ -304,7 +304,7 @@ daemon 按整理会话的模式校验 `--scope`:
|
|
|
304
304
|
|
|
305
305
|
## 十、session.md 的注入
|
|
306
306
|
|
|
307
|
-
整理会话也加载 `$KITS_FRAGMENTS/session.md`,但其中的 proactive 行为约束(群聊要不要响应、首次调用工具前先发言、每 N 次调用汇报进展、`
|
|
307
|
+
整理会话也加载 `$KITS_FRAGMENTS/session.md`,但其中的 proactive 行为约束(群聊要不要响应、首次调用工具前先发言、每 N 次调用汇报进展、`ecmsg send` 语法速查)**不会渲染**。
|
|
308
308
|
|
|
309
309
|
原因:整理会话由触发器创建,`peerType` 是 `system`、`chatType` 是 `private`。`resolveChatModeForPeer` 对 system 对端有硬约束,返回 `interactive`,而 proactive 那段的条件是 `{{?chatMode=proactive}}`,所以整块跳过。已实测确认。
|
|
310
310
|
|
|
@@ -236,9 +236,38 @@ Menu Protocol 是 EvolCore 在 AUN `message.send` 之上建立的**应用层协
|
|
|
236
236
|
|
|
237
237
|
主机 Agent 初始化通过 `menu.action`、`name="agent"`、`action="initialize"` 调用。参数可平铺在
|
|
238
238
|
`args` 中,也可放入 `args.plan`;`aid` 必须与计划中的 AID 一致。`project` 可省略或为空,Core 会按普通
|
|
239
|
-
Agent 创建规则解析主机默认项目;显式项目路径优先。可选的 `
|
|
240
|
-
|
|
241
|
-
`
|
|
239
|
+
Agent 创建规则解析主机默认项目;显式项目路径优先。可选的 `provider` 用于固定所选 `baseagent` 的 Provider,
|
|
240
|
+
可放在 `args.provider` 或 `args.plan.provider`;同时提供时 `plan.provider` 优先。Provider 必须支持该 Base Agent,
|
|
241
|
+
并会随冻结计划持久化。可选的 `model` 必须存在于所选 Provider(未指定 Provider 时为当前默认 Provider)的可见模型目录;
|
|
242
|
+
指定非 `auto` 的 `effort` 时必须同时指定 `model`,且强度必须在当前模型目录支持的范围内。`effort="auto"`
|
|
243
|
+
不写入强度覆盖。远程调用沿用现有控制面权限校验。
|
|
244
|
+
|
|
245
|
+
示例:
|
|
246
|
+
|
|
247
|
+
```json
|
|
248
|
+
{
|
|
249
|
+
"type": "menu.action",
|
|
250
|
+
"id": "<uuid>",
|
|
251
|
+
"name": "agent",
|
|
252
|
+
"action": "initialize",
|
|
253
|
+
"args": {
|
|
254
|
+
"plan": {
|
|
255
|
+
"aid": "helper.agentid.pub",
|
|
256
|
+
"project": "C:/agents/helper",
|
|
257
|
+
"baseagent": "codex",
|
|
258
|
+
"provider": "gateway",
|
|
259
|
+
"ownerAid": "owner.agentid.pub",
|
|
260
|
+
"name": "Helper",
|
|
261
|
+
"description": "协助处理项目开发任务",
|
|
262
|
+
"type": "agent",
|
|
263
|
+
"tags": ["coding"]
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
`action="create"` 的旧式创建入口同样可在 `args.provider` 指定 Provider;`initialize: true` 一步初始化入口也接受
|
|
270
|
+
该字段。Provider 必须支持 `args.baseagent`;未指定时沿用当前配置解析规则。
|
|
242
271
|
|
|
243
272
|
失败后用同一 action 和 `{ aid, resume: true }` 恢复已保存计划。恢复不接受新计划字段,只使用原操作主体、AID
|
|
244
273
|
和持久化计划;其他主体无法接管。
|