evolclaw 3.2.0 → 3.3.0
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 +17 -0
- package/README.md +1 -2
- package/dist/agents/{resolve.js → baseagent.js} +34 -5
- package/dist/agents/claude-runner.js +120 -27
- package/dist/agents/codex-app-server-client.js +364 -0
- package/dist/agents/codex-runner.js +1069 -141
- package/dist/agents/gemini-runner.js +2 -2
- package/dist/agents/runner-types.js +28 -0
- package/dist/aun/aid/store.js +1 -1
- package/dist/aun/storage/download.js +1 -1
- package/dist/aun/storage/upload.js +13 -1
- package/dist/channels/aun.js +406 -293
- package/dist/channels/dingtalk.js +77 -140
- package/dist/channels/feishu.js +97 -150
- package/dist/channels/qqbot.js +75 -138
- package/dist/channels/wechat.js +75 -136
- package/dist/channels/wecom.js +75 -138
- package/dist/cli/agent.js +8 -5
- package/dist/cli/index.js +177 -44
- package/dist/cli/init.js +33 -6
- package/dist/cli/model.js +1 -1
- package/dist/cli/stats.js +558 -0
- package/dist/cli/version.js +87 -0
- package/dist/cli/watch-msg.js +5 -2
- package/dist/config-store.js +12 -6
- package/dist/core/channel-loader.js +84 -82
- package/dist/core/command-handler.js +473 -114
- package/dist/core/evolagent-registry.js +1 -0
- package/dist/core/evolagent.js +1 -1
- package/dist/core/interaction-router.js +8 -0
- package/dist/core/message/command-handler-agent-control.js +63 -1
- package/dist/core/message/im-renderer.js +35 -13
- package/dist/core/message/items-formatter.js +9 -1
- package/dist/core/message/message-bridge.js +49 -21
- package/dist/core/message/message-log.js +1 -0
- package/dist/core/message/message-processor.js +295 -35
- package/dist/core/message/message-queue.js +2 -2
- package/dist/core/message/pending-hints.js +232 -0
- package/dist/core/message/response-depth.js +56 -0
- package/dist/core/model/model-catalog.js +1 -1
- package/dist/core/model/model-scope.js +2 -2
- package/dist/core/permission.js +9 -12
- package/dist/core/relation/peer-identity.js +16 -1
- package/dist/core/session/adapters/codex-session-file-adapter.js +4 -2
- package/dist/core/session/session-manager.js +27 -13
- package/dist/core/session/session-title.js +26 -0
- package/dist/core/stats/billing.js +151 -0
- package/dist/core/stats/budget.js +93 -0
- package/dist/core/stats/db.js +314 -0
- package/dist/core/stats/eck-vars.js +84 -0
- package/dist/core/stats/index.js +10 -0
- package/dist/core/stats/normalizer.js +78 -0
- package/dist/core/stats/query.js +760 -0
- package/dist/core/stats/writer.js +115 -0
- package/dist/core/trigger/manager.js +34 -0
- package/dist/core/trigger/parser.js +9 -3
- package/dist/core/trigger/scheduler.js +20 -17
- package/dist/{agents → eck}/manifest-engine.js +20 -1
- package/dist/{agents → eck}/message-renderer.js +24 -1
- package/dist/index.js +130 -8
- package/dist/ipc.js +17 -1
- package/dist/utils/cross-platform.js +23 -5
- package/dist/utils/ecweb-pair.js +20 -0
- package/dist/utils/stats.js +14 -0
- package/kits/docs/evolclaw/INDEX.md +3 -1
- package/kits/docs/evolclaw/fs-architecture.md +1215 -0
- package/kits/docs/evolclaw/fs.md +131 -0
- package/kits/docs/evolclaw/group-fs.md +209 -0
- package/kits/docs/evolclaw/stats.md +70 -0
- package/kits/docs/venues/aun-group.md +29 -6
- package/kits/docs/venues/group.md +5 -4
- package/kits/eck_manifest.json +12 -0
- package/kits/eck_message_manifest.json +30 -3
- package/kits/rules/05-venue.md +1 -1
- package/kits/templates/message-fragments/inject-default.md +2 -0
- package/kits/templates/system-fragments/response-depth.md +16 -0
- package/package.json +4 -4
- package/dist/agents/baseagent-normalize.js +0 -19
- package/dist/core/relation/peer-key.js +0 -16
- package/dist/evolclaw-config.js +0 -11
- package/dist/utils/channel-helpers.js +0 -46
- /package/dist/core/{cache/file-cache.js → daemon-file-cache.js} +0 -0
- /package/dist/{agents → eck}/kit-renderer.js +0 -0
|
@@ -13,7 +13,7 @@ import { createInterface } from 'readline';
|
|
|
13
13
|
import fs from 'fs';
|
|
14
14
|
import path from 'path';
|
|
15
15
|
import os from 'os';
|
|
16
|
-
import { resolveGoogleConfig } from './
|
|
16
|
+
import { resolveGoogleConfig } from './baseagent.js';
|
|
17
17
|
import { commandExists } from '../utils/cross-platform.js';
|
|
18
18
|
import { GeminiSessionFileAdapter } from '../core/session/adapters/gemini-session-file-adapter.js';
|
|
19
19
|
import { logger } from '../utils/logger.js';
|
|
@@ -41,7 +41,7 @@ const GEMINI_MODELS = [
|
|
|
41
41
|
// ── Gemini Runner ──
|
|
42
42
|
export class GeminiRunner {
|
|
43
43
|
name = 'gemini';
|
|
44
|
-
capabilities = { clear: true, compact: false, fork: false };
|
|
44
|
+
capabilities = { clear: true, compact: false, fork: false, askUserQuestion: false, planApproval: false, fileRewind: 'unsupported' };
|
|
45
45
|
resolved;
|
|
46
46
|
model;
|
|
47
47
|
activeProcesses = new Map();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// ── 类型守卫 ──
|
|
2
|
+
export function hasModelSwitcher(agent) {
|
|
3
|
+
return typeof agent.setModel === 'function' && typeof agent.listModels === 'function';
|
|
4
|
+
}
|
|
5
|
+
export function hasPermissionController(agent) {
|
|
6
|
+
return typeof agent.setMode === 'function' && typeof agent.listModes === 'function';
|
|
7
|
+
}
|
|
8
|
+
export function hasCompact(agent) {
|
|
9
|
+
return typeof agent.compact === 'function';
|
|
10
|
+
}
|
|
11
|
+
// ── Token usage helper functions ──
|
|
12
|
+
export function numericToken(value) {
|
|
13
|
+
return typeof value === 'number' && Number.isFinite(value) ? value : 0;
|
|
14
|
+
}
|
|
15
|
+
export function contextTokensForUsage(usage, isClaudeModel) {
|
|
16
|
+
if (!usage)
|
|
17
|
+
return 0;
|
|
18
|
+
if (!isClaudeModel)
|
|
19
|
+
return numericToken(usage.input_tokens);
|
|
20
|
+
return numericToken(usage.input_tokens)
|
|
21
|
+
+ numericToken(usage.cache_creation_input_tokens)
|
|
22
|
+
+ numericToken(usage.cache_read_input_tokens);
|
|
23
|
+
}
|
|
24
|
+
export function usageForContext(usage) {
|
|
25
|
+
const iterations = Array.isArray(usage?.iterations) ? usage.iterations : undefined;
|
|
26
|
+
const lastIteration = iterations?.slice().reverse().find(it => contextTokensForUsage(it, true) > 0);
|
|
27
|
+
return lastIteration ?? usage;
|
|
28
|
+
}
|
package/dist/aun/aid/store.js
CHANGED
|
@@ -39,7 +39,7 @@ export class AidLoadError extends Error {
|
|
|
39
39
|
*/
|
|
40
40
|
export async function getAidStore(opts) {
|
|
41
41
|
const { aunPath: defaultAunPath } = await import('../../paths.js');
|
|
42
|
-
const { loadEvolclawConfig } = await import('../../
|
|
42
|
+
const { loadEvolclawConfig } = await import('../../config-store.js');
|
|
43
43
|
const { AIDStore } = await import('@agentunion/fastaun');
|
|
44
44
|
const aunPath = opts.aunPath ?? defaultAunPath();
|
|
45
45
|
const encryptionSeed = loadEvolclawConfig().aun?.encryptionSeed
|
|
@@ -11,7 +11,7 @@ export async function storageDownload(aid, url, localPath, opts) {
|
|
|
11
11
|
const ownerAid = cleaned.slice(0, slashIdx);
|
|
12
12
|
const objectKey = cleaned.slice(slashIdx + 1);
|
|
13
13
|
const ticketResult = await rpcCall(aid, 'storage.create_download_ticket', {
|
|
14
|
-
|
|
14
|
+
owner_aid: ownerAid,
|
|
15
15
|
object_key: objectKey,
|
|
16
16
|
}, { aunPath: opts?.aunPath });
|
|
17
17
|
if (!ticketResult.ok) {
|
|
@@ -27,9 +27,21 @@ export async function storageUpload(aid, localFile, remotePath, opts) {
|
|
|
27
27
|
const completeResult = await rpcCall(aid, 'storage.complete_upload', {
|
|
28
28
|
object_key: remotePath,
|
|
29
29
|
sha256,
|
|
30
|
+
is_private: !(opts?.isPublic),
|
|
30
31
|
}, { aunPath: opts?.aunPath });
|
|
31
32
|
if (!completeResult.ok) {
|
|
32
33
|
return { ok: false, objectKey: remotePath, error: JSON.stringify(completeResult.error) };
|
|
33
34
|
}
|
|
34
|
-
|
|
35
|
+
// 公开上传时获取可访问的 URL
|
|
36
|
+
let publicUrl;
|
|
37
|
+
if (opts?.isPublic) {
|
|
38
|
+
const ticketResult = await rpcCall(aid, 'storage.create_download_ticket', {
|
|
39
|
+
object_key: remotePath,
|
|
40
|
+
expire_in_seconds: 86400 * 30, // 30天
|
|
41
|
+
}, { aunPath: opts?.aunPath });
|
|
42
|
+
if (ticketResult.ok) {
|
|
43
|
+
publicUrl = `https://${aid}/storage/${remotePath}`;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return { ok: true, objectKey: remotePath, publicUrl };
|
|
35
47
|
}
|