evolcore 0.0.20 → 0.0.22
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 +65 -0
- package/README.md +58 -9
- package/bin/codex-managed-hook.mjs +3 -0
- package/bin/install-codex-managed-hooks.mjs +3 -1
- package/dist/agents/baseagent.js +10 -6
- package/dist/agents/claude-runner.js +393 -108
- package/dist/agents/codex-app-server-client.js +41 -7
- package/dist/agents/codex-runner.js +1292 -220
- package/dist/agents/ecagent-runner.js +171 -61
- package/dist/agents/gemini-runner.js +130 -30
- package/dist/agents/request-identity.js +25 -0
- package/dist/agents/runner-types.js +19 -0
- package/dist/aun/aid/agentmd.js +59 -2
- package/dist/aun/aid/identity.js +4 -1
- package/dist/aun/aid/index.js +1 -1
- package/dist/aun/msg/group.js +72 -6
- package/dist/aun/msg/history.js +213 -36
- package/dist/aun/msg/managed-operation.js +58 -9
- package/dist/aun/msg/p2p.js +5 -0
- package/dist/aun/outbox.js +189 -80
- package/dist/aun/service-proxy.js +43 -25
- package/dist/channels/aun.js +618 -123
- package/dist/channels/daemon.js +6 -1
- package/dist/cli/agent-command.js +4 -3
- package/dist/cli/agent.js +66 -56
- package/dist/cli/aun-commands.js +177 -42
- package/dist/cli/command-log.js +10 -11
- package/dist/cli/contact.js +1 -0
- package/dist/cli/daemon-commands.js +98 -123
- package/dist/cli/init.js +27 -15
- package/dist/cli/task-context.js +50 -0
- package/dist/cli/trigger-command.js +14 -5
- package/dist/cli/watch-logs.js +10 -3
- package/dist/config/builtin-roles.js +1 -0
- package/dist/config/config-field-policy.js +19 -5
- package/dist/config/config-manager.js +167 -22
- package/dist/config/contact-book-store.js +25 -3
- package/dist/config/contact-operation-service.js +32 -1
- package/dist/config/contact-request-service.js +44 -0
- package/dist/config/daemon-services.js +186 -0
- package/dist/config/gateway-config.js +20 -9
- package/dist/config/role-service.js +54 -3
- package/dist/config/schema-migration.js +550 -0
- package/dist/config-store.js +151 -9
- package/dist/core/agent-application-service.js +279 -0
- package/dist/core/audit/log-integrity.js +102 -0
- package/dist/core/auth/agent-delegation.js +43 -1
- package/dist/core/auth/auth-gateway.js +41 -4
- package/dist/core/auth/authorization-audit.js +216 -8
- package/dist/core/auth/operation-authorizer.js +41 -1
- package/dist/core/auth/operation-catalog.js +9 -1
- package/dist/core/bootstrap-messages.js +8 -0
- package/dist/core/bootstrap-service.js +99 -27
- package/dist/core/causation/aun-association.js +7 -4
- package/dist/core/command/agent-control.js +56 -16
- package/dist/core/command/command-handler.js +311 -44
- package/dist/core/command/connect-menu.js +3 -4
- package/dist/core/command/group-menu.js +5 -7
- package/dist/core/command/menu-handler.js +288 -80
- package/dist/core/command/menu-protocol.js +1 -1
- package/dist/core/command/role-menu.js +21 -11
- package/dist/core/command/slash-gate.js +85 -18
- package/dist/core/command/slash-handler.js +377 -36
- package/dist/core/data-migration.js +11 -1
- package/dist/core/event-catalog.js +37 -0
- package/dist/core/evolagent.js +4 -0
- package/dist/core/handoff/dispatcher.js +4 -0
- package/dist/core/handoff/runtime.js +33 -3
- package/dist/core/handoff/store.js +32 -9
- package/dist/core/inference/text-inference.js +7 -15
- package/dist/core/message/im-renderer.js +90 -87
- package/dist/core/message/{inbound-admission.js → message-admission.js} +51 -1
- package/dist/core/message/message-bridge.js +184 -12
- package/dist/core/message/message-log.js +47 -7
- package/dist/core/message/message-queue.js +227 -16
- package/dist/core/message/message-utils.js +12 -5
- package/dist/core/message/response-engine.js +658 -109
- package/dist/core/message/send-receipt.js +1 -0
- package/dist/core/message/stream-debouncer.js +9 -2
- package/dist/core/model/model-catalog.js +23 -15
- package/dist/core/model/model-diagnostics.js +28 -10
- package/dist/core/permission/approval-gateway.js +180 -6
- package/dist/core/permission/ec-command-parser.js +627 -69
- package/dist/core/permission/mode.js +18 -3
- package/dist/core/{protected-paths.js → permission/protected-paths.js} +27 -14
- package/dist/core/permission/readonly-shell-query.js +263 -9
- package/dist/core/permission/sandbox-runtime.js +159 -1
- package/dist/core/permission/tool-error-code.js +12 -0
- package/dist/core/permission/tool-policy.js +618 -23
- package/dist/core/session/session-fs-store.js +154 -5
- package/dist/core/session/session-manager.js +329 -30
- package/dist/core/session/session-renew.js +37 -13
- package/dist/core/session/session-turn-coordinator.js +16 -5
- package/dist/eck/kit-renderer.js +1 -1
- package/dist/index.js +316 -50
- package/dist/ipc.js +459 -29
- package/dist/paths.js +82 -7
- package/dist/response-system/context-builder.js +1 -7
- package/dist/response-system/engines/v1/proactive-flow.js +7 -2
- package/dist/stats/price-resolver.js +4 -0
- package/dist/trigger/anomaly-store.js +1 -0
- package/dist/trigger/feedback.js +70 -7
- package/dist/trigger/history.js +79 -4
- package/dist/trigger/legacy-session-history.js +2 -2
- package/dist/trigger/parser.js +13 -3
- package/dist/trigger/scheduler.js +20 -3
- package/dist/trigger/validation.js +6 -1
- package/dist/utils/atomic-write.js +27 -0
- package/dist/utils/ecweb-utils.js +16 -2
- package/dist/utils/error-utils.js +4 -1
- package/dist/utils/logger.js +30 -6
- package/dist/utils/process-tree-stats.js +24 -4
- package/dist/utils/process-tree-worker.js +31 -0
- package/dist/utils/project-path.js +1 -2
- package/dist/utils/tool-summary.js +59 -0
- package/dist/utils/windows-shell-trust.js +201 -0
- package/kits/docs/INDEX.md +1 -1
- package/kits/docs/evolcore/INDEX.md +3 -3
- package/kits/docs/evolcore/agent-create.md +146 -0
- package/kits/docs/evolcore/agent.md +6 -0
- package/kits/docs/evolcore/contact.md +7 -1
- package/kits/docs/evolcore/group-collaboration.md +251 -0
- package/kits/docs/evolcore/group-rules.md +1 -19
- package/kits/docs/evolcore/group.md +3 -1
- package/kits/docs/evolcore/msg.md +16 -0
- package/kits/docs/evolcore/trigger.md +6 -3
- package/kits/docs/prompt-loading-architecture.md +6 -0
- package/kits/eck_message_manifest.json +6 -6
- package/kits/schemas/_meta.json +7 -4
- package/kits/schemas/agent-config.schema.11.json +13 -0
- package/kits/schemas/agent-config.schema.12.json +427 -0
- package/kits/schemas/daemon.schema.5.json +0 -1
- package/kits/schemas/daemon.schema.6.json +131 -0
- package/kits/schemas/defaults.schema.5.json +15 -3
- package/kits/schemas/migrations/README.md +3 -1
- package/kits/schemas/relation-config.schema.8.json +13 -0
- package/kits/schemas/role-config.schema.1.json +1 -2
- package/kits/schemas/single-session.schema.3.json +32 -0
- package/kits/templates/message-fragments/item.md +1 -1
- package/kits/templates/roles/admin.json +1 -0
- package/kits/templates/roles/member.json +1 -0
- package/kits/templates/roles/visitor.json +1 -0
- package/kits/templates/system-fragments/bootstrap.md +2 -1
- package/kits/templates/system-fragments/commands.md +2 -2
- package/package.json +6 -3
- package/skills/eclink/SKILL.md +2 -0
- package/dist/config/aun-gateway-config.js +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { spawn } from 'child_process';
|
|
2
2
|
import readline from 'readline';
|
|
3
3
|
import { logger } from '../utils/logger.js';
|
|
4
|
-
import { buildHClassGuardCommand } from '../core/permission/sandbox-runtime.js';
|
|
4
|
+
import { buildHClassGuardCommand, collectSandboxGuardDiagnostics, summarizeBubblewrapArgsForLog, summarizeSandboxGuardDiagnostics, } from '../core/permission/sandbox-runtime.js';
|
|
5
5
|
import { resolveCodexLaunchCommand } from '../utils/codex-cli.js';
|
|
6
6
|
import { createHash } from 'crypto';
|
|
7
7
|
import { sanitizeShellExecutionEnvironment } from '../core/permission/shell-environment.js';
|
|
@@ -9,6 +9,7 @@ import fs from 'fs';
|
|
|
9
9
|
import path from 'path';
|
|
10
10
|
import { ensureProcessManagedTempDir } from '../cli/task-context.js';
|
|
11
11
|
import { getPackageRoot, resolvePaths } from '../paths.js';
|
|
12
|
+
import { killProcess } from '../utils/cross-platform.js';
|
|
12
13
|
import { registerCodexAppServerProcess, unregisterCodexAppServerProcess, } from '../utils/codex-app-server-registry.js';
|
|
13
14
|
const BUILT_IN_CODEX_PROVIDER_IDS = new Set(['openai']);
|
|
14
15
|
function tomlProviderKey(value) {
|
|
@@ -126,6 +127,14 @@ export class CodexAppServerClient {
|
|
|
126
127
|
...(options?.effort ? { effort: options.effort } : {}),
|
|
127
128
|
});
|
|
128
129
|
}
|
|
130
|
+
async turnSteer(threadId, expectedTurnId, input, additionalContext) {
|
|
131
|
+
return this.request('turn/steer', {
|
|
132
|
+
threadId,
|
|
133
|
+
expectedTurnId,
|
|
134
|
+
input,
|
|
135
|
+
...(additionalContext ? { additionalContext } : {}),
|
|
136
|
+
});
|
|
137
|
+
}
|
|
129
138
|
toTurnSandboxPolicy(sandbox) {
|
|
130
139
|
if (!sandbox)
|
|
131
140
|
return undefined;
|
|
@@ -332,7 +341,10 @@ export class CodexAppServerClient {
|
|
|
332
341
|
}
|
|
333
342
|
// 优雅关闭:先关闭 stdin,然后发送 SIGTERM,等待进程退出
|
|
334
343
|
proc.stdin.end();
|
|
335
|
-
|
|
344
|
+
if (process.platform === 'win32' && proc.pid)
|
|
345
|
+
killProcess(proc.pid, false);
|
|
346
|
+
else
|
|
347
|
+
proc.kill('SIGTERM');
|
|
336
348
|
// 等待进程退出,最多等待 5 秒
|
|
337
349
|
await new Promise((resolve) => {
|
|
338
350
|
let exited = false;
|
|
@@ -341,7 +353,10 @@ export class CodexAppServerClient {
|
|
|
341
353
|
return;
|
|
342
354
|
logger.warn('[CodexAppServer] Process did not exit after SIGTERM, sending SIGKILL');
|
|
343
355
|
try {
|
|
344
|
-
|
|
356
|
+
if (process.platform === 'win32' && proc.pid)
|
|
357
|
+
killProcess(proc.pid, true);
|
|
358
|
+
else
|
|
359
|
+
proc.kill('SIGKILL');
|
|
345
360
|
}
|
|
346
361
|
catch { }
|
|
347
362
|
resolve();
|
|
@@ -410,8 +425,11 @@ export class CodexAppServerClient {
|
|
|
410
425
|
let command = launchCommand.command;
|
|
411
426
|
let commandArgs = launchCommand.args;
|
|
412
427
|
if (process.platform === 'linux') {
|
|
428
|
+
const guardRoot = resolvePaths().root;
|
|
429
|
+
const preflightDiagnostics = collectSandboxGuardDiagnostics(guardRoot);
|
|
430
|
+
logger.info(`[CodexAppServer] H-class guard preflight ${JSON.stringify(summarizeSandboxGuardDiagnostics(preflightDiagnostics))}`);
|
|
413
431
|
const managedRequirements = this.ensureManagedHookRuntime();
|
|
414
|
-
const guardedCommand = buildHClassGuardCommand(command, commandArgs,
|
|
432
|
+
const guardedCommand = buildHClassGuardCommand(command, commandArgs, guardRoot, {
|
|
415
433
|
managedCodexRequirements: managedRequirements,
|
|
416
434
|
});
|
|
417
435
|
if (!guardedCommand) {
|
|
@@ -419,6 +437,11 @@ export class CodexAppServerClient {
|
|
|
419
437
|
}
|
|
420
438
|
command = guardedCommand.command;
|
|
421
439
|
commandArgs = guardedCommand.args;
|
|
440
|
+
const launchDiagnostics = collectSandboxGuardDiagnostics(guardRoot);
|
|
441
|
+
logger.info(`[CodexAppServer] H-class guard launch ${JSON.stringify({
|
|
442
|
+
...summarizeBubblewrapArgsForLog(commandArgs),
|
|
443
|
+
diagnostics: summarizeSandboxGuardDiagnostics(launchDiagnostics),
|
|
444
|
+
})}`);
|
|
422
445
|
}
|
|
423
446
|
this.proc = spawn(command, commandArgs, {
|
|
424
447
|
cwd: this.options.cwd,
|
|
@@ -605,7 +628,10 @@ export class CodexAppServerClient {
|
|
|
605
628
|
// second command or changing the hook's behavior.
|
|
606
629
|
if (!command || !hook || /[\r\n;&|<>]/.test(command))
|
|
607
630
|
return false;
|
|
608
|
-
|
|
631
|
+
const commandWithoutSocket = command
|
|
632
|
+
.replace(/\s+%EVOLCORE_INSTANCE_SOCKET%\s*$/i, '')
|
|
633
|
+
.trim();
|
|
634
|
+
return commandWithoutSocket.replace(/["']+$/, '').endsWith(hook);
|
|
609
635
|
};
|
|
610
636
|
const managedHookLoaded = Array.isArray(preToolUse)
|
|
611
637
|
&& preToolUse.some(group => {
|
|
@@ -757,8 +783,16 @@ export class CodexAppServerClient {
|
|
|
757
783
|
this.pending.delete(messageId);
|
|
758
784
|
if (message.error) {
|
|
759
785
|
const detail = typeof message.error?.message === 'string' ? message.error.message : JSON.stringify(message.error);
|
|
760
|
-
|
|
761
|
-
|
|
786
|
+
// The CLI's one-time bubblewrap configuration warning is process-wide
|
|
787
|
+
// startup noise, not evidence about this RPC. Do not append it to an
|
|
788
|
+
// unrelated request failure such as thread/resume.
|
|
789
|
+
const stderrLines = this.stderrBuffer.filter(line => !/could not find bubblewrap on PATH/i.test(line));
|
|
790
|
+
const stderr = stderrLines.length ? `\n${stderrLines.join('\n')}` : '';
|
|
791
|
+
const error = new Error(`${pending.method} failed: ${detail}${stderr}`);
|
|
792
|
+
if (/no rollout found for thread id/i.test(detail)) {
|
|
793
|
+
error.code = 'CODEX_ROLLOUT_NOT_FOUND';
|
|
794
|
+
}
|
|
795
|
+
pending.reject(error);
|
|
762
796
|
return;
|
|
763
797
|
}
|
|
764
798
|
pending.resolve(message.result ?? null);
|