evolcore 0.0.25 → 0.0.26
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 +607 -565
- package/LICENSE +21 -21
- package/README.md +455 -455
- package/bin/codex-managed-acl.ps1 +160 -160
- package/bin/codex-managed-hook.mjs +208 -208
- package/bin/ec-safe-output.js +327 -327
- package/bin/ec.js +40 -29
- package/bin/install-codex-managed-hooks.mjs +582 -555
- package/dist/agents/baseagent.js +96 -46
- package/dist/agents/claude-runner.js +50 -12
- package/dist/agents/codex/app-server-client.js +13 -5
- package/dist/agents/codex/catalog.js +1 -1
- package/dist/agents/codex/diagnostics.js +34 -1
- package/dist/agents/codex-runner.js +121 -38
- package/dist/agents/ecagent-runner.js +4 -9
- package/dist/agents/gemini-runner.js +2 -7
- package/dist/agents/runner-types.js +25 -17
- package/dist/aun/aid/agentmd.js +81 -8
- package/dist/aun/aid/client.js +1 -1
- package/dist/aun/aid/identity.js +1 -1
- package/dist/aun/aid/index.js +1 -1
- package/dist/aun/aid/store.js +17 -13
- package/dist/aun/menu-client.js +74 -0
- package/dist/aun/msg/group.js +1 -1
- package/dist/aun/msg/managed-operation.js +1 -1
- package/dist/aun/msg/p2p.js +6 -1
- package/dist/aun/msg/upload.js +30 -22
- package/dist/channels/aun.js +329 -94
- package/dist/cli/agent-command.js +105 -84
- package/dist/cli/agent-create.js +112 -10
- package/dist/cli/agent.js +16 -5
- package/dist/cli/aun-commands.js +297 -296
- package/dist/cli/bench.js +20 -20
- package/dist/cli/config.js +47 -28
- package/dist/cli/contact.js +70 -13
- package/dist/cli/ctl-command.js +22 -22
- package/dist/cli/daemon-commands.js +105 -40
- package/dist/cli/diag.js +31 -0
- package/dist/cli/fs-command.js +67 -67
- package/dist/cli/handoff-command.js +41 -9
- package/dist/cli/index.js +83 -77
- package/dist/cli/link-rules.js +21 -21
- package/dist/cli/managed-command-guard.js +3 -0
- package/dist/cli/menu-client.js +46 -31
- package/dist/cli/net-check.js +22 -22
- package/dist/cli/queue-command.js +29 -29
- package/dist/cli/response.js +30 -30
- package/dist/cli/restart-monitor.js +87 -40
- package/dist/cli/stats.js +51 -51
- package/dist/cli/trigger-command.js +56 -56
- package/dist/config/builtin-roles.js +1 -0
- package/dist/config/config-operation-service.js +145 -0
- package/dist/config/contact-operation-service.js +96 -7
- package/dist/config/resolved-config-op.js +27 -7
- package/dist/core/agent-application-service.js +2 -1
- package/dist/core/auth/authorization-audit.js +20 -12
- package/dist/core/auth/operation-authorizer.js +25 -4
- package/dist/core/auth/operation-catalog.js +35 -4
- package/dist/core/auth/remote-access-store.js +40 -1
- package/dist/core/bootstrap-service.js +1 -1
- package/dist/core/command/command-handler.js +83 -26
- package/dist/core/command/diag-service.js +118 -0
- package/dist/core/command/menu-catalog.js +12 -3
- package/dist/core/command/menu-handler.js +47 -26
- package/dist/core/command/menu-protocol.js +5 -0
- package/dist/core/command/menu-token-store.js +41 -8
- package/dist/core/command/slash-gate.js +34 -4
- package/dist/core/command/slash-handler.js +86 -21
- package/dist/core/handoff/runtime.js +205 -27
- package/dist/core/handoff/store.js +193 -4
- package/dist/core/message/im-renderer.js +72 -21
- package/dist/core/message/message-bridge.js +69 -9
- package/dist/core/message/message-queue.js +26 -0
- package/dist/core/message/message-utils.js +1 -0
- package/dist/core/message/response-engine.js +47 -28
- package/dist/core/model/catalog-service.js +79 -49
- package/dist/core/model/context-window-suffix.js +33 -0
- package/dist/core/model/model-catalog.js +1 -1
- package/dist/core/model/model-permission.js +12 -3
- package/dist/core/permission/ec-command-parser.js +51 -12
- package/dist/core/permission/sandbox-runtime.js +36 -14
- package/dist/core/permission/tool-policy.js +2 -1
- package/dist/index.js +280 -163
- package/dist/ipc.js +54 -2
- package/dist/response-system/engines/v1/proactive-flow.js +59 -2
- package/dist/stats/billing.js +41 -15
- package/dist/stats/db.js +159 -159
- package/dist/stats/eck-vars.js +9 -9
- package/dist/stats/price-resolver.js +28 -10
- package/dist/stats/query.js +139 -139
- package/dist/stats/role-budget.js +6 -6
- package/dist/stats/writer.js +51 -51
- package/dist/utils/cross-platform.js +30 -1
- package/dist/utils/error-dict.json +160 -160
- package/dist/utils/error-utils.js +21 -0
- package/dist/utils/evolcore-version.js +129 -0
- package/dist/utils/logger.js +3 -1
- package/dist/utils/macos-autostart.js +22 -22
- package/dist/utils/model-prices.jsonl +23 -23
- package/dist/utils/npm-ops.js +176 -35
- package/dist/utils/welcome.js +22 -22
- package/ecagent/LICENSE +21 -21
- package/ecagent/NOTICE +11 -11
- package/ecagent/README.md +61 -61
- package/ecagent/dist/harness/compaction/branch-summarization.js +30 -30
- package/ecagent/dist/harness/compaction/compaction.js +83 -83
- package/ecagent/dist/harness/messages.js +7 -7
- package/kits/docs/GUIDE.md +20 -20
- package/kits/docs/INDEX.md +66 -66
- package/kits/docs/aun/CHEATSHEET.md +19 -19
- package/kits/docs/aun/SYNC_PROTOCOL.md +15 -15
- package/kits/docs/channels/aun.md +56 -56
- package/kits/docs/channels/feishu.md +56 -56
- package/kits/docs/context-assembly.md +364 -364
- package/kits/docs/eck_templates/GUIDE.template.md +22 -22
- package/kits/docs/eck_templates/INDEX.template.md +28 -28
- package/kits/docs/eck_templates/path-registry.template.md +33 -33
- package/kits/docs/eck_templates/runtime.template.md +19 -19
- package/kits/docs/evolcore/INDEX.md +71 -71
- package/kits/docs/evolcore/agent-create.md +170 -165
- package/kits/docs/evolcore/agent.md +66 -66
- package/kits/docs/evolcore/aid.md +60 -60
- package/kits/docs/evolcore/codex-windows-sandbox.md +146 -146
- package/kits/docs/evolcore/config.md +202 -195
- package/kits/docs/evolcore/contact.md +75 -68
- package/kits/docs/evolcore/ctl.md +46 -46
- package/kits/docs/evolcore/event.md +216 -216
- package/kits/docs/evolcore/fs-architecture.md +1215 -1215
- package/kits/docs/evolcore/fs.md +110 -110
- package/kits/docs/evolcore/group-collaboration.md +243 -243
- package/kits/docs/evolcore/group-fs.md +17 -17
- package/kits/docs/evolcore/group-rules.md +251 -251
- package/kits/docs/evolcore/group.md +152 -152
- package/kits/docs/evolcore/menu-client.md +42 -34
- package/kits/docs/evolcore/model.md +50 -50
- package/kits/docs/evolcore/msg.md +166 -165
- package/kits/docs/evolcore/response.md +75 -75
- package/kits/docs/evolcore/rpc.md +37 -37
- package/kits/docs/evolcore/self-summary.md +29 -29
- package/kits/docs/evolcore/stats.md +83 -83
- package/kits/docs/evolcore/storage.md +50 -50
- package/kits/docs/evolcore/trigger.md +575 -575
- package/kits/docs/identity/AID_PROFILE_SPEC.md +26 -26
- package/kits/docs/identity/PATH_OPS.md +16 -16
- package/kits/docs/identity/ROLE_DETAIL.md +25 -25
- package/kits/docs/identity/identity-tools.md +26 -26
- package/kits/docs/path-registry.md +62 -62
- package/kits/docs/prompt-loading-architecture.md +269 -269
- package/kits/docs/venues/aun-group.md +45 -45
- package/kits/docs/venues/aun-private.md +10 -10
- package/kits/docs/venues/client-desktop.md +10 -10
- package/kits/docs/venues/client-mobile.md +10 -10
- package/kits/docs/venues/feishu-group.md +13 -13
- package/kits/docs/venues/feishu-private.md +9 -9
- package/kits/docs/venues/group.md +37 -25
- package/kits/docs/venues/private.md +10 -10
- package/kits/eck_manifest.auxiliary.json +43 -43
- package/kits/eck_manifest.json +190 -190
- package/kits/eck_message_manifest.json +74 -74
- package/kits/migrations/README-role-config-v4.md +32 -32
- package/kits/migrations/migrate-contact-book-v2.mjs +748 -748
- package/kits/migrations/migrate-role-config-v4.mjs +614 -614
- package/kits/migrations/migrate-role-config-v5.mjs +365 -365
- package/kits/migrations/rename-config-file.mjs +99 -99
- package/kits/rules/01-overview.md +162 -162
- package/kits/rules/02-navigation.md +96 -96
- package/kits/rules/03-identity.md +36 -36
- package/kits/rules/04-relation.md +75 -75
- package/kits/rules/05-venue.md +60 -60
- package/kits/rules/06-channel.md +63 -63
- package/kits/schemas/_meta.json +53 -53
- package/kits/schemas/agent-config.schema.1.json +177 -177
- package/kits/schemas/agent-config.schema.10.json +395 -395
- package/kits/schemas/agent-config.schema.11.json +421 -421
- package/kits/schemas/agent-config.schema.12.json +427 -427
- package/kits/schemas/agent-config.schema.2.json +239 -239
- package/kits/schemas/agent-config.schema.3.json +119 -119
- package/kits/schemas/agent-config.schema.4.json +208 -208
- package/kits/schemas/agent-config.schema.5.json +326 -326
- package/kits/schemas/agent-config.schema.6.json +322 -322
- package/kits/schemas/agent-config.schema.7.json +303 -303
- package/kits/schemas/agent-config.schema.8.json +304 -304
- package/kits/schemas/agent-config.schema.9.json +364 -364
- package/kits/schemas/contact-book.schema.1.json +36 -36
- package/kits/schemas/contact-book.schema.2.json +43 -43
- package/kits/schemas/contact-book.schema.3.json +67 -67
- package/kits/schemas/daemon.schema.1.json +91 -91
- package/kits/schemas/daemon.schema.2.json +101 -101
- package/kits/schemas/daemon.schema.3.json +123 -123
- package/kits/schemas/daemon.schema.4.json +136 -136
- package/kits/schemas/daemon.schema.5.json +135 -135
- package/kits/schemas/daemon.schema.6.json +131 -131
- package/kits/schemas/defaults.schema.1.json +81 -81
- package/kits/schemas/defaults.schema.2.json +85 -85
- package/kits/schemas/defaults.schema.3.json +73 -73
- package/kits/schemas/defaults.schema.4.json +107 -107
- package/kits/schemas/defaults.schema.5.json +119 -119
- package/kits/schemas/menu-exec-schema-commands.md +208 -208
- package/kits/schemas/migrations/README.md +30 -30
- package/kits/schemas/relation-config.schema.1.json +158 -158
- package/kits/schemas/relation-config.schema.2.json +73 -73
- package/kits/schemas/relation-config.schema.3.json +50 -50
- package/kits/schemas/relation-config.schema.4.json +47 -47
- package/kits/schemas/relation-config.schema.5.json +47 -47
- package/kits/schemas/relation-config.schema.6.json +46 -46
- package/kits/schemas/relation-config.schema.7.json +59 -59
- package/kits/schemas/relation-config.schema.8.json +103 -103
- package/kits/schemas/role-config.schema.1.json +201 -201
- package/kits/schemas/role-registry.schema.1.json +35 -35
- package/kits/schemas/single-session.schema.1.json +31 -31
- package/kits/schemas/single-session.schema.2.json +57 -57
- package/kits/schemas/single-session.schema.3.json +32 -32
- package/kits/templates/bootstrap-welcome.md +17 -17
- package/kits/templates/message-fragments/handoff-context-to-target.md +9 -9
- package/kits/templates/message-fragments/handoff-request-to-target.md +19 -19
- package/kits/templates/message-fragments/handoff-response-to-origin.md +9 -9
- package/kits/templates/message-fragments/inject-default.md +2 -2
- package/kits/templates/message-fragments/item.md +2 -2
- package/kits/templates/roles/admin.json +92 -92
- package/kits/templates/roles/member.json +96 -96
- package/kits/templates/roles/owner.json +9 -9
- package/kits/templates/roles/visitor.json +85 -85
- package/kits/templates/system-fragments/baseagent.md +14 -14
- package/kits/templates/system-fragments/bootstrap.md +31 -29
- package/kits/templates/system-fragments/channel.md +64 -64
- package/kits/templates/system-fragments/commands.md +28 -28
- package/kits/templates/system-fragments/identity.md +13 -13
- package/kits/templates/system-fragments/relation.md +19 -19
- package/kits/templates/system-fragments/session.md +59 -59
- package/kits/templates/system-fragments/venue.md +31 -31
- package/package.json +100 -98
|
@@ -90,37 +90,37 @@ export function prepareBranchEntries(entries, tokenBudget = 0) {
|
|
|
90
90
|
}
|
|
91
91
|
return { messages, fileOps, totalTokens };
|
|
92
92
|
}
|
|
93
|
-
const BRANCH_SUMMARY_PREAMBLE = `The user explored a different conversation branch before returning here.
|
|
94
|
-
Summary of that exploration:
|
|
95
|
-
|
|
93
|
+
const BRANCH_SUMMARY_PREAMBLE = `The user explored a different conversation branch before returning here.
|
|
94
|
+
Summary of that exploration:
|
|
95
|
+
|
|
96
96
|
`;
|
|
97
|
-
const BRANCH_SUMMARY_PROMPT = `Create a structured summary of this conversation branch for context when returning later.
|
|
98
|
-
|
|
99
|
-
Use this EXACT format:
|
|
100
|
-
|
|
101
|
-
## Goal
|
|
102
|
-
[What was the user trying to accomplish in this branch?]
|
|
103
|
-
|
|
104
|
-
## Constraints & Preferences
|
|
105
|
-
- [Any constraints, preferences, or requirements mentioned]
|
|
106
|
-
- [Or "(none)" if none were mentioned]
|
|
107
|
-
|
|
108
|
-
## Progress
|
|
109
|
-
### Done
|
|
110
|
-
- [x] [Completed tasks/changes]
|
|
111
|
-
|
|
112
|
-
### In Progress
|
|
113
|
-
- [ ] [Work that was started but not finished]
|
|
114
|
-
|
|
115
|
-
### Blocked
|
|
116
|
-
- [Issues preventing progress, if any]
|
|
117
|
-
|
|
118
|
-
## Key Decisions
|
|
119
|
-
- **[Decision]**: [Brief rationale]
|
|
120
|
-
|
|
121
|
-
## Next Steps
|
|
122
|
-
1. [What should happen next to continue this work]
|
|
123
|
-
|
|
97
|
+
const BRANCH_SUMMARY_PROMPT = `Create a structured summary of this conversation branch for context when returning later.
|
|
98
|
+
|
|
99
|
+
Use this EXACT format:
|
|
100
|
+
|
|
101
|
+
## Goal
|
|
102
|
+
[What was the user trying to accomplish in this branch?]
|
|
103
|
+
|
|
104
|
+
## Constraints & Preferences
|
|
105
|
+
- [Any constraints, preferences, or requirements mentioned]
|
|
106
|
+
- [Or "(none)" if none were mentioned]
|
|
107
|
+
|
|
108
|
+
## Progress
|
|
109
|
+
### Done
|
|
110
|
+
- [x] [Completed tasks/changes]
|
|
111
|
+
|
|
112
|
+
### In Progress
|
|
113
|
+
- [ ] [Work that was started but not finished]
|
|
114
|
+
|
|
115
|
+
### Blocked
|
|
116
|
+
- [Issues preventing progress, if any]
|
|
117
|
+
|
|
118
|
+
## Key Decisions
|
|
119
|
+
- **[Decision]**: [Brief rationale]
|
|
120
|
+
|
|
121
|
+
## Next Steps
|
|
122
|
+
1. [What should happen next to continue this work]
|
|
123
|
+
|
|
124
124
|
Keep each section concise. Preserve exact file paths, function names, and error messages.`;
|
|
125
125
|
/** Generate a summary for abandoned branch entries. */
|
|
126
126
|
export async function generateBranchSummary(entries, options) {
|
|
@@ -281,78 +281,78 @@ export function findCutPoint(entries, startIndex, endIndex, keepRecentTokens) {
|
|
|
281
281
|
isSplitTurn: !isUserMessage && turnStartIndex !== -1,
|
|
282
282
|
};
|
|
283
283
|
}
|
|
284
|
-
export const SUMMARIZATION_SYSTEM_PROMPT = `You are a context summarization assistant. Your task is to read a conversation between a user and an AI assistant, then produce a structured summary following the exact format specified.
|
|
285
|
-
|
|
284
|
+
export const SUMMARIZATION_SYSTEM_PROMPT = `You are a context summarization assistant. Your task is to read a conversation between a user and an AI assistant, then produce a structured summary following the exact format specified.
|
|
285
|
+
|
|
286
286
|
Do NOT continue the conversation. Do NOT respond to any questions in the conversation. ONLY output the structured summary.`;
|
|
287
|
-
const SUMMARIZATION_PROMPT = `The messages above are a conversation to summarize. Create a structured context checkpoint summary that another LLM will use to continue the work.
|
|
288
|
-
|
|
289
|
-
Use this EXACT format:
|
|
290
|
-
|
|
291
|
-
## Goal
|
|
292
|
-
[What is the user trying to accomplish? Can be multiple items if the session covers different tasks.]
|
|
293
|
-
|
|
294
|
-
## Constraints & Preferences
|
|
295
|
-
- [Any constraints, preferences, or requirements mentioned by user]
|
|
296
|
-
- [Or "(none)" if none were mentioned]
|
|
297
|
-
|
|
298
|
-
## Progress
|
|
299
|
-
### Done
|
|
300
|
-
- [x] [Completed tasks/changes]
|
|
301
|
-
|
|
302
|
-
### In Progress
|
|
303
|
-
- [ ] [Current work]
|
|
304
|
-
|
|
305
|
-
### Blocked
|
|
306
|
-
- [Issues preventing progress, if any]
|
|
307
|
-
|
|
308
|
-
## Key Decisions
|
|
309
|
-
- **[Decision]**: [Brief rationale]
|
|
310
|
-
|
|
311
|
-
## Next Steps
|
|
312
|
-
1. [Ordered list of what should happen next]
|
|
313
|
-
|
|
314
|
-
## Critical Context
|
|
315
|
-
- [Any data, examples, or references needed to continue]
|
|
316
|
-
- [Or "(none)" if not applicable]
|
|
317
|
-
|
|
287
|
+
const SUMMARIZATION_PROMPT = `The messages above are a conversation to summarize. Create a structured context checkpoint summary that another LLM will use to continue the work.
|
|
288
|
+
|
|
289
|
+
Use this EXACT format:
|
|
290
|
+
|
|
291
|
+
## Goal
|
|
292
|
+
[What is the user trying to accomplish? Can be multiple items if the session covers different tasks.]
|
|
293
|
+
|
|
294
|
+
## Constraints & Preferences
|
|
295
|
+
- [Any constraints, preferences, or requirements mentioned by user]
|
|
296
|
+
- [Or "(none)" if none were mentioned]
|
|
297
|
+
|
|
298
|
+
## Progress
|
|
299
|
+
### Done
|
|
300
|
+
- [x] [Completed tasks/changes]
|
|
301
|
+
|
|
302
|
+
### In Progress
|
|
303
|
+
- [ ] [Current work]
|
|
304
|
+
|
|
305
|
+
### Blocked
|
|
306
|
+
- [Issues preventing progress, if any]
|
|
307
|
+
|
|
308
|
+
## Key Decisions
|
|
309
|
+
- **[Decision]**: [Brief rationale]
|
|
310
|
+
|
|
311
|
+
## Next Steps
|
|
312
|
+
1. [Ordered list of what should happen next]
|
|
313
|
+
|
|
314
|
+
## Critical Context
|
|
315
|
+
- [Any data, examples, or references needed to continue]
|
|
316
|
+
- [Or "(none)" if not applicable]
|
|
317
|
+
|
|
318
318
|
Keep each section concise. Preserve exact file paths, function names, and error messages.`;
|
|
319
|
-
const UPDATE_SUMMARIZATION_PROMPT = `The messages above are NEW conversation messages to incorporate into the existing summary provided in <previous-summary> tags.
|
|
320
|
-
|
|
321
|
-
Update the existing structured summary with new information. RULES:
|
|
322
|
-
- PRESERVE all existing information from the previous summary
|
|
323
|
-
- ADD new progress, decisions, and context from the new messages
|
|
324
|
-
- UPDATE the Progress section: move items from "In Progress" to "Done" when completed
|
|
325
|
-
- UPDATE "Next Steps" based on what was accomplished
|
|
326
|
-
- PRESERVE exact file paths, function names, and error messages
|
|
327
|
-
- If something is no longer relevant, you may remove it
|
|
328
|
-
|
|
329
|
-
Use this EXACT format:
|
|
330
|
-
|
|
331
|
-
## Goal
|
|
332
|
-
[Preserve existing goals, add new ones if the task expanded]
|
|
333
|
-
|
|
334
|
-
## Constraints & Preferences
|
|
335
|
-
- [Preserve existing, add new ones discovered]
|
|
336
|
-
|
|
337
|
-
## Progress
|
|
338
|
-
### Done
|
|
339
|
-
- [x] [Include previously done items AND newly completed items]
|
|
340
|
-
|
|
341
|
-
### In Progress
|
|
342
|
-
- [ ] [Current work - update based on progress]
|
|
343
|
-
|
|
344
|
-
### Blocked
|
|
345
|
-
- [Current blockers - remove if resolved]
|
|
346
|
-
|
|
347
|
-
## Key Decisions
|
|
348
|
-
- **[Decision]**: [Brief rationale] (preserve all previous, add new)
|
|
349
|
-
|
|
350
|
-
## Next Steps
|
|
351
|
-
1. [Update based on current state]
|
|
352
|
-
|
|
353
|
-
## Critical Context
|
|
354
|
-
- [Preserve important context, add new if needed]
|
|
355
|
-
|
|
319
|
+
const UPDATE_SUMMARIZATION_PROMPT = `The messages above are NEW conversation messages to incorporate into the existing summary provided in <previous-summary> tags.
|
|
320
|
+
|
|
321
|
+
Update the existing structured summary with new information. RULES:
|
|
322
|
+
- PRESERVE all existing information from the previous summary
|
|
323
|
+
- ADD new progress, decisions, and context from the new messages
|
|
324
|
+
- UPDATE the Progress section: move items from "In Progress" to "Done" when completed
|
|
325
|
+
- UPDATE "Next Steps" based on what was accomplished
|
|
326
|
+
- PRESERVE exact file paths, function names, and error messages
|
|
327
|
+
- If something is no longer relevant, you may remove it
|
|
328
|
+
|
|
329
|
+
Use this EXACT format:
|
|
330
|
+
|
|
331
|
+
## Goal
|
|
332
|
+
[Preserve existing goals, add new ones if the task expanded]
|
|
333
|
+
|
|
334
|
+
## Constraints & Preferences
|
|
335
|
+
- [Preserve existing, add new ones discovered]
|
|
336
|
+
|
|
337
|
+
## Progress
|
|
338
|
+
### Done
|
|
339
|
+
- [x] [Include previously done items AND newly completed items]
|
|
340
|
+
|
|
341
|
+
### In Progress
|
|
342
|
+
- [ ] [Current work - update based on progress]
|
|
343
|
+
|
|
344
|
+
### Blocked
|
|
345
|
+
- [Current blockers - remove if resolved]
|
|
346
|
+
|
|
347
|
+
## Key Decisions
|
|
348
|
+
- **[Decision]**: [Brief rationale] (preserve all previous, add new)
|
|
349
|
+
|
|
350
|
+
## Next Steps
|
|
351
|
+
1. [Update based on current state]
|
|
352
|
+
|
|
353
|
+
## Critical Context
|
|
354
|
+
- [Preserve important context, add new if needed]
|
|
355
|
+
|
|
356
356
|
Keep each section concise. Preserve exact file paths, function names, and error messages.`;
|
|
357
357
|
/** Generate or update a conversation summary for compaction. */
|
|
358
358
|
export async function generateSummary(currentMessages, models, model, reserveTokens, signal, customInstructions, previousSummary, thinkingLevel) {
|
|
@@ -451,19 +451,19 @@ export function prepareCompaction(pathEntries, settings) {
|
|
|
451
451
|
settings,
|
|
452
452
|
});
|
|
453
453
|
}
|
|
454
|
-
const TURN_PREFIX_SUMMARIZATION_PROMPT = `This is the PREFIX of a turn that was too large to keep. The SUFFIX (recent work) is retained.
|
|
455
|
-
|
|
456
|
-
Summarize the prefix to provide context for the retained suffix:
|
|
457
|
-
|
|
458
|
-
## Original Request
|
|
459
|
-
[What did the user ask for in this turn?]
|
|
460
|
-
|
|
461
|
-
## Early Progress
|
|
462
|
-
- [Key decisions and work done in the prefix]
|
|
463
|
-
|
|
464
|
-
## Context for Suffix
|
|
465
|
-
- [Information needed to understand the retained recent work]
|
|
466
|
-
|
|
454
|
+
const TURN_PREFIX_SUMMARIZATION_PROMPT = `This is the PREFIX of a turn that was too large to keep. The SUFFIX (recent work) is retained.
|
|
455
|
+
|
|
456
|
+
Summarize the prefix to provide context for the retained suffix:
|
|
457
|
+
|
|
458
|
+
## Original Request
|
|
459
|
+
[What did the user ask for in this turn?]
|
|
460
|
+
|
|
461
|
+
## Early Progress
|
|
462
|
+
- [Key decisions and work done in the prefix]
|
|
463
|
+
|
|
464
|
+
## Context for Suffix
|
|
465
|
+
- [Information needed to understand the retained recent work]
|
|
466
|
+
|
|
467
467
|
Be concise. Focus on what's needed to understand the kept suffix.`;
|
|
468
468
|
export { serializeConversation } from "./utils.js";
|
|
469
469
|
/** Generate compaction summary data from prepared session history. */
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export const COMPACTION_SUMMARY_PREFIX = `The conversation history before this point was compacted into the following summary:
|
|
2
|
-
|
|
3
|
-
<summary>
|
|
1
|
+
export const COMPACTION_SUMMARY_PREFIX = `The conversation history before this point was compacted into the following summary:
|
|
2
|
+
|
|
3
|
+
<summary>
|
|
4
4
|
`;
|
|
5
|
-
export const COMPACTION_SUMMARY_SUFFIX = `
|
|
5
|
+
export const COMPACTION_SUMMARY_SUFFIX = `
|
|
6
6
|
</summary>`;
|
|
7
|
-
export const BRANCH_SUMMARY_PREFIX = `The following is a summary of a branch that this conversation came back from:
|
|
8
|
-
|
|
9
|
-
<summary>
|
|
7
|
+
export const BRANCH_SUMMARY_PREFIX = `The following is a summary of a branch that this conversation came back from:
|
|
8
|
+
|
|
9
|
+
<summary>
|
|
10
10
|
`;
|
|
11
11
|
export const BRANCH_SUMMARY_SUFFIX = `</summary>`;
|
|
12
12
|
export function bashExecutionToText(msg) {
|
package/kits/docs/GUIDE.md
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
# 文档查阅指南
|
|
2
|
-
|
|
3
|
-
## 查阅流程
|
|
4
|
-
|
|
5
|
-
1. 先看 `$KITS_RULES`(自动加载的 6 个规则文件 01-06)了解机制骨架
|
|
6
|
-
2. 需要详细信息时,按 `INDEX.md` 找到对应文档路径
|
|
7
|
-
3. Read 对应文档
|
|
8
|
-
|
|
9
|
-
## 路径解析
|
|
10
|
-
|
|
11
|
-
文档中用 `$名称` 引用路径。解析步骤:
|
|
12
|
-
1. 查 `$KITS_RULES/02-navigation.md` 的路径体系速查表
|
|
13
|
-
2. 如需完整定义,Read `$KITS_DOCS/path-registry.md`
|
|
14
|
-
3. 如需运行时实际值,Read `$ECK/path-registry.md`
|
|
15
|
-
|
|
16
|
-
## 不要做的事
|
|
17
|
-
|
|
18
|
-
- 不要一次性加载所有文档——按需逐个 Read
|
|
19
|
-
- 不要猜测路径——查注册表
|
|
20
|
-
- 不要在当前会话输出对外消息——用 CLI
|
|
1
|
+
# 文档查阅指南
|
|
2
|
+
|
|
3
|
+
## 查阅流程
|
|
4
|
+
|
|
5
|
+
1. 先看 `$KITS_RULES`(自动加载的 6 个规则文件 01-06)了解机制骨架
|
|
6
|
+
2. 需要详细信息时,按 `INDEX.md` 找到对应文档路径
|
|
7
|
+
3. Read 对应文档
|
|
8
|
+
|
|
9
|
+
## 路径解析
|
|
10
|
+
|
|
11
|
+
文档中用 `$名称` 引用路径。解析步骤:
|
|
12
|
+
1. 查 `$KITS_RULES/02-navigation.md` 的路径体系速查表
|
|
13
|
+
2. 如需完整定义,Read `$KITS_DOCS/path-registry.md`
|
|
14
|
+
3. 如需运行时实际值,Read `$ECK/path-registry.md`
|
|
15
|
+
|
|
16
|
+
## 不要做的事
|
|
17
|
+
|
|
18
|
+
- 不要一次性加载所有文档——按需逐个 Read
|
|
19
|
+
- 不要猜测路径——查注册表
|
|
20
|
+
- 不要在当前会话输出对外消息——用 CLI
|
package/kits/docs/INDEX.md
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
# EvolCore 文档索引
|
|
2
|
-
|
|
3
|
-
本文件是 `$KITS_DOCS` 下所有文档的索引。
|
|
4
|
-
|
|
5
|
-
## 路径与机制
|
|
6
|
-
|
|
7
|
-
| 文档 | 路径 | 说明 |
|
|
8
|
-
|------|------|------|
|
|
9
|
-
| 查阅指南 | `GUIDE.md` | 文档查阅流程 |
|
|
10
|
-
| 路径定义 | `path-registry.md` | 所有预定义路径及派生规则 |
|
|
11
|
-
| 上下文组装机制 | `context-assembly.md` | manifest 装配机制:when 条件/合并覆盖/模板渲染/运行时变量/调试输出 |
|
|
12
|
-
|
|
13
|
-
## AUN 协议
|
|
14
|
-
|
|
15
|
-
| 文档 | 路径 | 说明 |
|
|
16
|
-
|------|------|------|
|
|
17
|
-
| 速查表 | `aun/CHEATSHEET.md` | AUN 协议命名空间与常用操作速查 |
|
|
18
|
-
| 同步协议 | `aun/SYNC_PROTOCOL.md` | 上游协议同步 SOP |
|
|
19
|
-
|
|
20
|
-
## EvolCore 命令
|
|
21
|
-
|
|
22
|
-
所有 `ec` 命令集的专属目录(用途/触发词/适用场景/文档)见 `evolcore/INDEX.md`。
|
|
23
|
-
运行时由 `commands` fragment 按场景注入精简能力卡。
|
|
24
|
-
|
|
25
|
-
| 文档 | 路径 | 说明 |
|
|
26
|
-
|------|------|------|
|
|
27
|
-
| 命令集目录 | `evolcore/INDEX.md` | msg/group/agent/aid/storage/ctl/rpc/bench 全集索引 |
|
|
28
|
-
| 联系人命令 | `evolcore/contact.md` | Contact Book 添加申请、拉黑与托管会话权限边界 |
|
|
29
|
-
|
|
30
|
-
## 身份
|
|
31
|
-
|
|
32
|
-
| 文档 | 路径 | 说明 |
|
|
33
|
-
|------|------|------|
|
|
34
|
-
| 身份工具 | `identity/identity-tools.md` | 身份识别与环境层工具 |
|
|
35
|
-
| 角色详情 | `identity/ROLE_DETAIL.md` | 角色与场景详细规则 |
|
|
36
|
-
| AID 档案规范 | `identity/AID_PROFILE_SPEC.md` | AID 档案格式规范 |
|
|
37
|
-
| 路径运维 | `identity/PATH_OPS.md` | 路径运维操作 |
|
|
38
|
-
|
|
39
|
-
## 渠道(知识文档·按需加载,不依赖当前渠道)
|
|
40
|
-
|
|
41
|
-
| 文档 | 路径 | 说明 |
|
|
42
|
-
|------|------|------|
|
|
43
|
-
| AUN 渠道 | `channels/aun.md` | AUN 渠道配置、参数与特有机制(网关发现/E2EE/群 ID/证书链) |
|
|
44
|
-
| 飞书渠道 | `channels/feishu.md` | 飞书渠道配置、参数与特有机制(appId/合并转发/卡片/user_id) |
|
|
45
|
-
|
|
46
|
-
## 触发器
|
|
47
|
-
|
|
48
|
-
| 文档 | 路径 | 说明 |
|
|
49
|
-
|------|------|------|
|
|
50
|
-
| Trigger 命令手册 | `evolcore/trigger.md` | 使用 `create` 创建并管理、运行定时与事件 trigger;`set` 为兼容别名 |
|
|
51
|
-
| EventBus 事件目录 | `evolcore/event.md` | event source 可监听事件、payload、filter 与循环防护规则 |
|
|
52
|
-
|
|
53
|
-
## ECK 模板
|
|
54
|
-
|
|
55
|
-
| 文档 | 路径 | 说明 |
|
|
56
|
-
|------|------|------|
|
|
57
|
-
| 运行时配置模板 | `eck_templates/runtime.template.md` | agent 运行时配置模板 |
|
|
58
|
-
| 路径注册表模板 | `eck_templates/path-registry.template.md` | 路径实例模板 |
|
|
59
|
-
| 索引模板 | `eck_templates/INDEX.template.md` | agent 级索引模板 |
|
|
60
|
-
| 指南模板 | `eck_templates/GUIDE.template.md` | agent 级查阅指南模板 |
|
|
61
|
-
|
|
62
|
-
## Base Agent
|
|
63
|
-
|
|
64
|
-
| 文档 | 路径 | 说明 |
|
|
65
|
-
|------|------|------|
|
|
66
|
-
| Claude Code 日志 | `baseagent/cc-logs.md` | CC 会话日志查阅(找完整对话/工具调用/注入) |
|
|
1
|
+
# EvolCore 文档索引
|
|
2
|
+
|
|
3
|
+
本文件是 `$KITS_DOCS` 下所有文档的索引。
|
|
4
|
+
|
|
5
|
+
## 路径与机制
|
|
6
|
+
|
|
7
|
+
| 文档 | 路径 | 说明 |
|
|
8
|
+
|------|------|------|
|
|
9
|
+
| 查阅指南 | `GUIDE.md` | 文档查阅流程 |
|
|
10
|
+
| 路径定义 | `path-registry.md` | 所有预定义路径及派生规则 |
|
|
11
|
+
| 上下文组装机制 | `context-assembly.md` | manifest 装配机制:when 条件/合并覆盖/模板渲染/运行时变量/调试输出 |
|
|
12
|
+
|
|
13
|
+
## AUN 协议
|
|
14
|
+
|
|
15
|
+
| 文档 | 路径 | 说明 |
|
|
16
|
+
|------|------|------|
|
|
17
|
+
| 速查表 | `aun/CHEATSHEET.md` | AUN 协议命名空间与常用操作速查 |
|
|
18
|
+
| 同步协议 | `aun/SYNC_PROTOCOL.md` | 上游协议同步 SOP |
|
|
19
|
+
|
|
20
|
+
## EvolCore 命令
|
|
21
|
+
|
|
22
|
+
所有 `ec` 命令集的专属目录(用途/触发词/适用场景/文档)见 `evolcore/INDEX.md`。
|
|
23
|
+
运行时由 `commands` fragment 按场景注入精简能力卡。
|
|
24
|
+
|
|
25
|
+
| 文档 | 路径 | 说明 |
|
|
26
|
+
|------|------|------|
|
|
27
|
+
| 命令集目录 | `evolcore/INDEX.md` | msg/group/agent/aid/storage/ctl/rpc/bench 全集索引 |
|
|
28
|
+
| 联系人命令 | `evolcore/contact.md` | Contact Book 添加申请、拉黑与托管会话权限边界 |
|
|
29
|
+
|
|
30
|
+
## 身份
|
|
31
|
+
|
|
32
|
+
| 文档 | 路径 | 说明 |
|
|
33
|
+
|------|------|------|
|
|
34
|
+
| 身份工具 | `identity/identity-tools.md` | 身份识别与环境层工具 |
|
|
35
|
+
| 角色详情 | `identity/ROLE_DETAIL.md` | 角色与场景详细规则 |
|
|
36
|
+
| AID 档案规范 | `identity/AID_PROFILE_SPEC.md` | AID 档案格式规范 |
|
|
37
|
+
| 路径运维 | `identity/PATH_OPS.md` | 路径运维操作 |
|
|
38
|
+
|
|
39
|
+
## 渠道(知识文档·按需加载,不依赖当前渠道)
|
|
40
|
+
|
|
41
|
+
| 文档 | 路径 | 说明 |
|
|
42
|
+
|------|------|------|
|
|
43
|
+
| AUN 渠道 | `channels/aun.md` | AUN 渠道配置、参数与特有机制(网关发现/E2EE/群 ID/证书链) |
|
|
44
|
+
| 飞书渠道 | `channels/feishu.md` | 飞书渠道配置、参数与特有机制(appId/合并转发/卡片/user_id) |
|
|
45
|
+
|
|
46
|
+
## 触发器
|
|
47
|
+
|
|
48
|
+
| 文档 | 路径 | 说明 |
|
|
49
|
+
|------|------|------|
|
|
50
|
+
| Trigger 命令手册 | `evolcore/trigger.md` | 使用 `create` 创建并管理、运行定时与事件 trigger;`set` 为兼容别名 |
|
|
51
|
+
| EventBus 事件目录 | `evolcore/event.md` | event source 可监听事件、payload、filter 与循环防护规则 |
|
|
52
|
+
|
|
53
|
+
## ECK 模板
|
|
54
|
+
|
|
55
|
+
| 文档 | 路径 | 说明 |
|
|
56
|
+
|------|------|------|
|
|
57
|
+
| 运行时配置模板 | `eck_templates/runtime.template.md` | agent 运行时配置模板 |
|
|
58
|
+
| 路径注册表模板 | `eck_templates/path-registry.template.md` | 路径实例模板 |
|
|
59
|
+
| 索引模板 | `eck_templates/INDEX.template.md` | agent 级索引模板 |
|
|
60
|
+
| 指南模板 | `eck_templates/GUIDE.template.md` | agent 级查阅指南模板 |
|
|
61
|
+
|
|
62
|
+
## Base Agent
|
|
63
|
+
|
|
64
|
+
| 文档 | 路径 | 说明 |
|
|
65
|
+
|------|------|------|
|
|
66
|
+
| Claude Code 日志 | `baseagent/cc-logs.md` | CC 会话日志查阅(找完整对话/工具调用/注入) |
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
# AUN 协议速查表
|
|
2
|
-
|
|
3
|
-
## 命名空间
|
|
4
|
-
|
|
5
|
-
| 命名空间 | 作用 |
|
|
6
|
-
|---|---|
|
|
7
|
-
| `auth.*` | AID 创建、认证、JWT |
|
|
8
|
-
| `message.*` | 点对点消息收发 |
|
|
9
|
-
| `group.*` | 群组生命周期、群消息 |
|
|
10
|
-
| `storage.*` | 文件上传下载 |
|
|
11
|
-
| `stream.*` | 实时流(语音/视频/token) |
|
|
12
|
-
| `meta.*` | ping、状态、信任根查询 |
|
|
13
|
-
| `nameservice.*` | AID 名字注册查询 |
|
|
14
|
-
| `custody.*` | AID 托管 |
|
|
15
|
-
| `peer.*` / `relay.*` | 直连/中继认证 |
|
|
16
|
-
|
|
17
|
-
## Group 使用入口
|
|
18
|
-
|
|
19
|
-
日常群操作使用 `ec group`,详见 `evolcore/group.md`。群文件使用 `ec fs`,详见 `evolcore/fs.md`。
|
|
1
|
+
# AUN 协议速查表
|
|
2
|
+
|
|
3
|
+
## 命名空间
|
|
4
|
+
|
|
5
|
+
| 命名空间 | 作用 |
|
|
6
|
+
|---|---|
|
|
7
|
+
| `auth.*` | AID 创建、认证、JWT |
|
|
8
|
+
| `message.*` | 点对点消息收发 |
|
|
9
|
+
| `group.*` | 群组生命周期、群消息 |
|
|
10
|
+
| `storage.*` | 文件上传下载 |
|
|
11
|
+
| `stream.*` | 实时流(语音/视频/token) |
|
|
12
|
+
| `meta.*` | ping、状态、信任根查询 |
|
|
13
|
+
| `nameservice.*` | AID 名字注册查询 |
|
|
14
|
+
| `custody.*` | AID 托管 |
|
|
15
|
+
| `peer.*` / `relay.*` | 直连/中继认证 |
|
|
16
|
+
|
|
17
|
+
## Group 使用入口
|
|
18
|
+
|
|
19
|
+
日常群操作使用 `ec group`,详见 `evolcore/group.md`。群文件使用 `ec fs`,详见 `evolcore/fs.md`。
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
# AUN 协议同步 SOP
|
|
2
|
-
|
|
3
|
-
<!-- TODO: 填充上游协议同步流程 -->
|
|
4
|
-
|
|
5
|
-
## 同步时机
|
|
6
|
-
|
|
7
|
-
- AUN SDK 有新版本发布时
|
|
8
|
-
- 协议文档有重大变更时
|
|
9
|
-
|
|
10
|
-
## 同步步骤
|
|
11
|
-
|
|
12
|
-
1. 拉取上游最新协议文档
|
|
13
|
-
2. 对比本地认知包与上游差异
|
|
14
|
-
3. 更新 `$KITS_RULES/04-aun.md` 和 `$KITS_DOCS/aun/` 下相关文档
|
|
15
|
-
4. 更新索引
|
|
1
|
+
# AUN 协议同步 SOP
|
|
2
|
+
|
|
3
|
+
<!-- TODO: 填充上游协议同步流程 -->
|
|
4
|
+
|
|
5
|
+
## 同步时机
|
|
6
|
+
|
|
7
|
+
- AUN SDK 有新版本发布时
|
|
8
|
+
- 协议文档有重大变更时
|
|
9
|
+
|
|
10
|
+
## 同步步骤
|
|
11
|
+
|
|
12
|
+
1. 拉取上游最新协议文档
|
|
13
|
+
2. 对比本地认知包与上游差异
|
|
14
|
+
3. 更新 `$KITS_RULES/04-aun.md` 和 `$KITS_DOCS/aun/` 下相关文档
|
|
15
|
+
4. 更新索引
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
# AUN 渠道
|
|
2
|
-
|
|
3
|
-
> 知识性文档:AUN 渠道的配置、参数与特有机制。**不依赖当前会话渠道**——任意会话都可按需 Read。
|
|
4
|
-
> 运行时"怎么发消息"由注入的 `[channel]` 段决定(aun 渠道用 `ec msg send` / `ec group send`),不在本文。
|
|
5
|
-
> 群聊使用 `evolcore/group.md`;群文件使用 `evolcore/fs.md`。
|
|
6
|
-
|
|
7
|
-
## 概述
|
|
8
|
-
|
|
9
|
-
AUN 渠道把 agent 接入 AUN(Agent Union Network),对端以 **AID** 为身份标识(既是身份也是地址)。evolcore 通过 AUN SDK(`@agentunion/fastaun`)维护到 Gateway 的 WebSocket 长连接,支持私聊、群聊、文件、E2EE 加密。
|
|
10
|
-
|
|
11
|
-
## 配置
|
|
12
|
-
|
|
13
|
-
AUN 渠道是**隐式**的——它不写在 `channels[]` 数组里,而是从 agent 自身的 AID 自动创建。一个 agent 就是一个 AID,启动时 evolcore 用顶层 `aid` 字段隐式构造唯一的 aun 实例(`channel-loader.ts`)。所以真实的 agent config.json 里 `channels` 数组通常是空的(飞书等非 aun 渠道才往里加)。
|
|
14
|
-
|
|
15
|
-
### agent 配置(`agents/<aid>/config.json`)
|
|
16
|
-
|
|
17
|
-
```json
|
|
18
|
-
{
|
|
19
|
-
"$schema_version": 1,
|
|
20
|
-
"aid": "myagent.agentid.pub",
|
|
21
|
-
"enabled": true,
|
|
22
|
-
"owners": ["owner.agentid.pub"],
|
|
23
|
-
"channels": [],
|
|
24
|
-
"active_baseagent": "claude"
|
|
25
|
-
}
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
| 字段 | 说明 |
|
|
29
|
-
|------|------|
|
|
30
|
-
| `aid` | agent 的 AID,**即 aun 渠道身份**(隐式创建,无需在 channels[] 声明) |
|
|
31
|
-
| `enabled` | agent 是否启用 |
|
|
32
|
-
| `owners` | owner 的 **AID** 列表(最高权限);首个 owner 用于首次连接发欢迎消息 |
|
|
33
|
-
| `admins` | admin 的 AID 列表 |
|
|
34
|
-
| `channels` | 非 aun 渠道(飞书等)的实例数组;aun 不在此 |
|
|
35
|
-
|
|
36
|
-
> `owners`/`admins` 用 **AID**,不是渠道原生 ID。
|
|
37
|
-
|
|
38
|
-
### AUN keystore seed
|
|
39
|
-
|
|
40
|
-
AUN keystore seed 由 EvolCore 使用固定应用值管理,不再提供配置项或环境变量入口。
|
|
41
|
-
检测到历史自定义值时 daemon 会拒绝启动并提示联系管理人员,避免用错误值加载现有身份。
|
|
42
|
-
|
|
43
|
-
> Gateway 不在配置里手填:连接时从 AID 自动发现(见下)。Keystore 默认落在 `$EVOLCORE_HOME`。
|
|
44
|
-
|
|
45
|
-
## 特有机制
|
|
46
|
-
|
|
47
|
-
- **隐式创建**:aun 渠道由顶层 `aid` 派生,无独立配置实例;这是它与飞书等渠道最大的不同。
|
|
48
|
-
- **网关发现**:连接前查询 `https://<aid>/.well-known/aun-gateway` 获取网关地址(AID 本身即域名);per-agent 流程不提供手填 gateway 的入口,发现失败即连接失败。
|
|
49
|
-
- **身份与信任**:每条入站消息携带发送者 AID,经四级 X.509 证书链(Root CA → Registry CA → Issuer CA → Agent)验签。
|
|
50
|
-
- **agent.md 缓存**:对端名片 `https://<aid>/agent.md` 由 **AUN SDK 自动拉取并缓存**(`AgentMdManager`,带 ETag/TTL,默认 1 天内不重复探测)。缓存落在 **`$EVOLCORE_HOME/AIDs/<aid>/`**,每个 AID 两个文件:`agent.md`(带签名正文)+ `agentmd.json`(元数据:etag/last_modified/checked_at/verify_status)。本端与对端的 agent.md 都缓存于此。
|
|
51
|
-
- 关系层另存一份**派生**的精简身份 `relations/<peerKey>/peer-identity.json`(type/isAgent/name),由 evolcore 从 agent.md 提取,不是 agent.md 本体。
|
|
52
|
-
- **E2EE 加密**:可选端到端加密,回复默认跟随对端消息加密状态(密文回密文,明文回明文);keystore seed 由 EvolCore 固定管理。
|
|
53
|
-
- **断线重连**:SDK 内置退避策略自动重连。实时连接状态用 `ec watch aid` 查看(`ec aid` 是身份/证书管理,不显示连接状态)。
|
|
54
|
-
- **群 ID 格式**:当前协议规范使用 `g-{slug}.issuer-domain` canonical 形式,输入也可接受本域简写 `g-{slug}` 或兼容形式 `g-{slug}@issuer-domain`。历史会话里可能仍出现 `group.{issuer}/{group_no}` 一类旧格式,运行时需兼容读取。
|
|
55
|
-
- **群 @ 处理策略**:`mention_mode=disabled|mention-only` 是群级配置,只决定哪些群消息进入 Agent LLM 上下文,不影响 AUN 协议层投递;被过滤消息仍应本地存档。
|
|
56
|
-
- **身份体系**:对端以 AID 标识,关系层 peerKey 形如 `aun#alice.aid.pub`。
|
|
1
|
+
# AUN 渠道
|
|
2
|
+
|
|
3
|
+
> 知识性文档:AUN 渠道的配置、参数与特有机制。**不依赖当前会话渠道**——任意会话都可按需 Read。
|
|
4
|
+
> 运行时"怎么发消息"由注入的 `[channel]` 段决定(aun 渠道用 `ec msg send` / `ec group send`),不在本文。
|
|
5
|
+
> 群聊使用 `evolcore/group.md`;群文件使用 `evolcore/fs.md`。
|
|
6
|
+
|
|
7
|
+
## 概述
|
|
8
|
+
|
|
9
|
+
AUN 渠道把 agent 接入 AUN(Agent Union Network),对端以 **AID** 为身份标识(既是身份也是地址)。evolcore 通过 AUN SDK(`@agentunion/fastaun`)维护到 Gateway 的 WebSocket 长连接,支持私聊、群聊、文件、E2EE 加密。
|
|
10
|
+
|
|
11
|
+
## 配置
|
|
12
|
+
|
|
13
|
+
AUN 渠道是**隐式**的——它不写在 `channels[]` 数组里,而是从 agent 自身的 AID 自动创建。一个 agent 就是一个 AID,启动时 evolcore 用顶层 `aid` 字段隐式构造唯一的 aun 实例(`channel-loader.ts`)。所以真实的 agent config.json 里 `channels` 数组通常是空的(飞书等非 aun 渠道才往里加)。
|
|
14
|
+
|
|
15
|
+
### agent 配置(`agents/<aid>/config.json`)
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"$schema_version": 1,
|
|
20
|
+
"aid": "myagent.agentid.pub",
|
|
21
|
+
"enabled": true,
|
|
22
|
+
"owners": ["owner.agentid.pub"],
|
|
23
|
+
"channels": [],
|
|
24
|
+
"active_baseagent": "claude"
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
| 字段 | 说明 |
|
|
29
|
+
|------|------|
|
|
30
|
+
| `aid` | agent 的 AID,**即 aun 渠道身份**(隐式创建,无需在 channels[] 声明) |
|
|
31
|
+
| `enabled` | agent 是否启用 |
|
|
32
|
+
| `owners` | owner 的 **AID** 列表(最高权限);首个 owner 用于首次连接发欢迎消息 |
|
|
33
|
+
| `admins` | admin 的 AID 列表 |
|
|
34
|
+
| `channels` | 非 aun 渠道(飞书等)的实例数组;aun 不在此 |
|
|
35
|
+
|
|
36
|
+
> `owners`/`admins` 用 **AID**,不是渠道原生 ID。
|
|
37
|
+
|
|
38
|
+
### AUN keystore seed
|
|
39
|
+
|
|
40
|
+
AUN keystore seed 由 EvolCore 使用固定应用值管理,不再提供配置项或环境变量入口。
|
|
41
|
+
检测到历史自定义值时 daemon 会拒绝启动并提示联系管理人员,避免用错误值加载现有身份。
|
|
42
|
+
|
|
43
|
+
> Gateway 不在配置里手填:连接时从 AID 自动发现(见下)。Keystore 默认落在 `$EVOLCORE_HOME`。
|
|
44
|
+
|
|
45
|
+
## 特有机制
|
|
46
|
+
|
|
47
|
+
- **隐式创建**:aun 渠道由顶层 `aid` 派生,无独立配置实例;这是它与飞书等渠道最大的不同。
|
|
48
|
+
- **网关发现**:连接前查询 `https://<aid>/.well-known/aun-gateway` 获取网关地址(AID 本身即域名);per-agent 流程不提供手填 gateway 的入口,发现失败即连接失败。
|
|
49
|
+
- **身份与信任**:每条入站消息携带发送者 AID,经四级 X.509 证书链(Root CA → Registry CA → Issuer CA → Agent)验签。
|
|
50
|
+
- **agent.md 缓存**:对端名片 `https://<aid>/agent.md` 由 **AUN SDK 自动拉取并缓存**(`AgentMdManager`,带 ETag/TTL,默认 1 天内不重复探测)。缓存落在 **`$EVOLCORE_HOME/AIDs/<aid>/`**,每个 AID 两个文件:`agent.md`(带签名正文)+ `agentmd.json`(元数据:etag/last_modified/checked_at/verify_status)。本端与对端的 agent.md 都缓存于此。
|
|
51
|
+
- 关系层另存一份**派生**的精简身份 `relations/<peerKey>/peer-identity.json`(type/isAgent/name),由 evolcore 从 agent.md 提取,不是 agent.md 本体。
|
|
52
|
+
- **E2EE 加密**:可选端到端加密,回复默认跟随对端消息加密状态(密文回密文,明文回明文);keystore seed 由 EvolCore 固定管理。
|
|
53
|
+
- **断线重连**:SDK 内置退避策略自动重连。实时连接状态用 `ec watch aid` 查看(`ec aid` 是身份/证书管理,不显示连接状态)。
|
|
54
|
+
- **群 ID 格式**:当前协议规范使用 `g-{slug}.issuer-domain` canonical 形式,输入也可接受本域简写 `g-{slug}` 或兼容形式 `g-{slug}@issuer-domain`。历史会话里可能仍出现 `group.{issuer}/{group_no}` 一类旧格式,运行时需兼容读取。
|
|
55
|
+
- **群 @ 处理策略**:`mention_mode=disabled|mention-only` 是群级配置,只决定哪些群消息进入 Agent LLM 上下文,不影响 AUN 协议层投递;被过滤消息仍应本地存档。
|
|
56
|
+
- **身份体系**:对端以 AID 标识,关系层 peerKey 形如 `aun#alice.aid.pub`。
|