evolcore 0.0.45 → 0.0.47
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 +113 -0
- package/bin/ecmsg.js +33 -23
- package/dist/ability/application-service.js +1 -2
- package/dist/ability/package.js +28 -0
- package/dist/agent-template/jobs.js +158 -36
- package/dist/agent-template/runtime.js +401 -34
- package/dist/agent-template/service.js +764 -369
- package/dist/agent-template/tool-runner.js +35 -17
- package/dist/agent-template/types.js +7 -4
- package/dist/agents/baseagent.js +10 -9
- package/dist/agents/claude-runner.js +22 -6
- package/dist/agents/codex/app-server-client.js +34 -27
- package/dist/agents/codex/diagnostics.js +18 -1
- package/dist/agents/codex-runner.js +3 -1
- package/dist/agents/ecagent-runner.js +3 -1
- package/dist/agents/gemini-runner.js +2 -1
- package/dist/aun/group/fs-download.js +1 -1
- package/dist/aun/menu/client.js +142 -182
- package/dist/aun/rpc/client.js +33 -17
- package/dist/aun/service-proxy.js +6 -23
- package/dist/channels/aun.js +675 -120
- package/dist/channels/daemon.js +1 -1
- package/dist/cli/agent-create.js +37 -10
- package/dist/cli/agent-template.js +105 -84
- package/dist/cli/agent.js +31 -18
- package/dist/cli/daemon-commands.js +42 -56
- package/dist/cli/daemon-lifecycle-client.js +55 -19
- package/dist/cli/directory.js +12 -4
- package/dist/cli/ecmsg-gateway.js +5 -2
- package/dist/cli/events-command.js +2 -1
- package/dist/cli/init-channel.js +2 -2
- package/dist/cli/init.js +57 -21
- package/dist/cli/integrity-command.js +2 -0
- package/dist/cli/managed-command-guard.js +20 -1
- package/dist/cli/menu-client.js +7 -5
- package/dist/cli/restart-monitor.js +135 -46
- package/dist/cli/services-command.js +28 -5
- package/dist/cli/task-context.js +83 -15
- package/dist/cli/upgrade-command.js +4 -2
- package/dist/config/config-field-policy.js +24 -0
- package/dist/config/config-manager.js +49 -19
- package/dist/config/peer-book-store.js +167 -127
- package/dist/config/peer-role-resolver.js +24 -4
- package/dist/config/provider-identity-migration.js +158 -6
- package/dist/config/provider-identity.js +10 -4
- package/dist/config/provider-ipc-service.js +10 -2
- package/dist/config/provider-local-sync.js +2 -2
- package/dist/config/providers-config.js +95 -10
- package/dist/config/providers-import.js +4 -6
- package/dist/config/providers.js +14 -3
- package/dist/config/role-store.js +1 -1
- package/dist/config/schema-migration.js +123 -16
- package/dist/config/schema-registry.js +6 -2
- package/dist/config-store.js +9 -1
- package/dist/core/agent-application-service.js +56 -29
- package/dist/core/agent-create-status.js +3 -1
- package/dist/core/agent-creation-claim.js +1 -0
- package/dist/core/agent-ipc-registration.js +2 -2
- package/dist/core/agent-reload-coordinator.js +38 -1
- package/dist/core/agent-runtime.js +91 -43
- package/dist/core/auth/agent-delegation.js +13 -3
- package/dist/core/auth/delegation-diagnostics.js +56 -15
- package/dist/core/auth/operation-authorizer.js +2 -2
- package/dist/core/auth/operation-catalog.js +3 -3
- package/dist/core/bootstrap-service.js +3 -0
- package/dist/core/capability/capability-manager.js +3 -1
- package/dist/core/channel-loader.js +29 -3
- package/dist/core/channel-runtime.js +1 -1
- package/dist/core/command/agent-control.js +6 -5
- package/dist/core/command/agent-template-menu.js +32 -97
- package/dist/core/command/eventcenter-menu.js +61 -13
- package/dist/core/command/menu-catalog.js +11 -4
- package/dist/core/command/menu-handler.js +39 -12
- package/dist/core/command/menu-protocol.js +8 -16
- package/dist/core/command/skill-slash.js +6 -2
- package/dist/core/command/slash-handler.js +4 -6
- package/dist/core/command/team-workspace-bootstrap.js +1 -2
- package/dist/core/command/team-workspace-management-store.js +83 -0
- package/dist/core/command/team-workspace-management.js +1 -2
- package/dist/core/command/team-workspace-team.js +26 -3
- package/dist/core/daemon-bootstrap.js +11 -9
- package/dist/core/daemon-control.js +4 -7
- package/dist/core/daemon-lifecycle.js +189 -143
- package/dist/core/evolagent-registry.js +50 -2
- package/dist/core/evolagent.js +2 -1
- package/dist/core/file-integrity/read.js +9 -16
- package/dist/core/file-integrity/store.js +94 -34
- package/dist/core/handoff/dispatcher.js +33 -7
- package/dist/core/handoff/runtime.js +8 -0
- package/dist/core/host-snapshot.js +9 -4
- package/dist/core/inference/text-inference.js +12 -2
- package/dist/core/initialization/service.js +22 -4
- package/dist/core/invoke/invoke-service.js +24 -3
- package/dist/core/ipc-registration.js +7 -3
- package/dist/core/memory/consolidation.js +6 -6
- package/dist/core/message/aun-ipc-sender.js +109 -7
- package/dist/core/message/contact-admission.js +6 -2
- package/dist/core/message/message-bridge.js +13 -0
- package/dist/core/message/message-queue.js +131 -30
- package/dist/core/message/pending-hints.js +8 -0
- package/dist/core/message/response-engine.js +48 -2
- package/dist/core/message/send-routing.js +3 -12
- package/dist/core/model/catalog-service.js +13 -0
- package/dist/core/model/model-catalog.js +57 -18
- package/dist/core/ownership/owner-resolver.js +27 -10
- package/dist/core/pack-auth.js +163 -31
- package/dist/core/pack-install.js +42 -1
- package/dist/{services/ledger.js → core/pack-ledger.js} +17 -6
- package/dist/core/permission/ec-command-parser.js +3 -1
- package/dist/core/permission/shell-environment.js +23 -0
- package/dist/core/rate-window.js +6 -1
- package/dist/core/relation/peer-identity.js +5 -1
- package/dist/core/relation/same-owner-proof.js +2 -1
- package/dist/core/session/adapters/claude-session-file-adapter.js +1 -1
- package/dist/core/session/session-file-health.js +36 -7
- package/dist/core/session/session-idle-monitor.js +0 -1
- package/dist/core/session/session-manager.js +14 -0
- package/dist/core/session/session-title.js +26 -6
- package/dist/core/skill/index-generator.js +3 -4
- package/dist/core/task/task-image-resources.js +1 -1
- package/dist/core/thread/thread-service.js +0 -1
- package/dist/core/thread/topic-id.js +8 -0
- package/dist/directory/owner-directory-admission.js +17 -0
- package/dist/directory/owner-directory-cache.js +3 -1
- package/dist/directory/owner-directory-markdown.js +145 -23
- package/dist/directory/owner-directory-policy.js +23 -0
- package/dist/directory/owner-directory-query-operation.js +20 -6
- package/dist/directory/owner-directory-search.js +47 -0
- package/dist/eck/message-renderer.js +171 -32
- package/dist/ecweb/basic-settings-service.js +7 -3
- package/dist/ecweb/providers-service.js +17 -10
- package/dist/ecweb/runtime/lifecycle.js +65 -16
- package/dist/ecweb/runtime/supervisor.js +79 -50
- package/dist/event-center/admission-materializer.js +1 -1
- package/dist/event-center/bus-gate.js +48 -4
- package/dist/event-center/bus-host.js +3 -3
- package/dist/event-center/center-config.js +57 -28
- package/dist/event-center/dispatcher.js +8 -0
- package/dist/event-center/event-log.js +69 -27
- package/dist/event-center/index-generator.js +6 -1
- package/dist/event-center/ipc-operation.js +66 -25
- package/dist/event-center/pack-loader.js +12 -55
- package/dist/event-center/pack-manager.js +5 -3
- package/dist/event-center/registry.js +48 -52
- package/dist/event-center/runtime.js +219 -81
- package/dist/event-center/script-runner.js +18 -7
- package/dist/event-center/types.js +9 -1
- package/dist/event-center/validation.js +33 -4
- package/dist/index.js +132 -75
- package/dist/ipc.js +35 -8
- package/dist/product.js +1 -0
- package/dist/proxy/manager.js +52 -11
- package/dist/proxy/service-supervisor.js +265 -67
- package/dist/services/dispatcher.js +26 -3
- package/dist/services/idempotency.js +128 -0
- package/dist/services/identity.js +3 -27
- package/dist/services/index-generator.js +5 -1
- package/dist/services/index.js +244 -45
- package/dist/services/ipc-operation.js +164 -20
- package/dist/services/pack-manager.js +37 -9
- package/dist/services/router.js +100 -31
- package/dist/services/script-runner.js +15 -4
- package/dist/services/service-payload.js +50 -2
- package/dist/services/validation.js +107 -3
- package/dist/trigger/scheduler.js +18 -4
- package/dist/trigger/script-sandbox.js +39 -2
- package/dist/trigger/state.js +7 -0
- package/dist/utils/aid-bind.js +155 -18
- package/dist/utils/atomic-write.js +3 -3
- package/dist/utils/cross-platform.js +59 -16
- package/dist/utils/error-utils.js +26 -1
- package/dist/utils/instance-registry.js +94 -35
- package/dist/utils/process-introspect.js +187 -27
- package/dist/utils/project-path.js +47 -3
- package/dist/utils/upgrade-jobs.js +4 -4
- package/dist/utils/windows-shell-trust.js +174 -68
- package/kits/docs/context-assembly.md +3 -3
- package/kits/docs/evolcore/agent.md +28 -10
- package/kits/docs/evolcore/aid.md +3 -1
- package/kits/docs/evolcore/config.md +22 -0
- package/kits/docs/evolcore/directory.md +46 -12
- package/kits/docs/evolcore/event-center.md +6 -6
- package/kits/docs/evolcore/group-collaboration.md +1 -1
- package/kits/docs/evolcore/menu-client.md +7 -5
- package/kits/docs/evolcore/menu-protocol.md +5 -3
- package/kits/docs/evolcore/msg.md +10 -3
- package/kits/docs/evolcore/provider.md +17 -5
- package/kits/docs/evolcore/services.md +145 -12
- package/kits/docs/evolcore/thread-chain.md +17 -9
- package/kits/docs/prompt-loading-architecture.md +4 -4
- package/kits/eck_message_manifest.json +46 -3
- package/kits/rules/04-relation.md +10 -2
- package/kits/rules/06-channel.md +2 -1
- package/kits/schemas/providers.schema.2.json +1 -0
- package/kits/skills/ec-group/SKILL.md +4 -0
- package/kits/skills/ec-skill/scripts/cli.mjs +1 -1
- package/kits/skills/ec-skill/scripts/skill.mjs +13 -2
- package/kits/skills/thread-ops/SKILL.md +8 -5
- package/kits/templates/message-fragments/group-batch-item.md +3 -0
- package/kits/templates/message-fragments/group-batch.md +1 -0
- package/kits/templates/message-fragments/item-group.md +4 -0
- package/kits/templates/message-fragments/item-private.md +4 -0
- package/kits/templates/message-fragments/thread-context.md +1 -1
- package/kits/templates/system-fragments/commands.md +5 -5
- package/kits/templates/system-fragments/managed-runtime.md +1 -1
- package/kits/templates/system-fragments/relation.md +11 -7
- package/package.json +3 -2
- package/scripts/agent-template/index.mjs +9 -4
- package/scripts/agent-template/inspect.mjs +16 -9
- package/scripts/agent-template/shared/plan.mjs +3 -33
- package/scripts/agent-template/shared/template-contract.mjs +186 -3
- package/scripts/agent-template/shared/template-package.mjs +119 -10
- package/scripts/agent-template/shared/template-runtime.mjs +49 -6
- package/scripts/agent-template/shared/template.mjs +5 -5
- package/scripts/agent-template/team-pack.mjs +245 -0
- package/scripts/agent-template/team-preview.mjs +111 -0
- package/scripts/aid-batch/identity-batch.mjs +143 -0
- package/dist/ability/versions.js +0 -32
- package/dist/aun/model-headers.js +0 -17
- package/dist/channels/builtin-plugins.js +0 -19
- package/dist/core/command/team-workspace-initializer.js +0 -2
- package/dist/core/command/team-workspace-job-store.js +0 -88
- package/dist/core/command/team-workspace-management-service.js +0 -2
- package/dist/core/contact-bind-registry.js +0 -27
- package/dist/event-center/ledger.js +0 -52
- package/dist/services/reply.js +0 -55
- package/kits/templates/message-fragments/item.md +0 -3
- package/scripts/agent-template/pack.mjs +0 -169
package/dist/proxy/manager.js
CHANGED
|
@@ -2,7 +2,7 @@ import crypto from 'node:crypto';
|
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import chokidar from 'chokidar';
|
|
5
|
-
import { DEFAULT_ECWEB_PORT, serviceRuntimeMode } from '../config/daemon-services.js';
|
|
5
|
+
import { DEFAULT_ECWEB_PORT, SERVICE_STARTUP_TIMEOUT_MS, serviceRuntimeMode } from '../config/daemon-services.js';
|
|
6
6
|
import { ConfigTarget, mutateConfig, onConfigWrite } from '../config/config-manager.js';
|
|
7
7
|
import { loadDaemonConfig } from '../config-store.js';
|
|
8
8
|
import { resolvePaths } from '../paths.js';
|
|
@@ -73,6 +73,7 @@ export class ServiceProxyManager {
|
|
|
73
73
|
activeProxyNames = [];
|
|
74
74
|
applyQueue = Promise.resolve();
|
|
75
75
|
stopped = false;
|
|
76
|
+
stopPromise;
|
|
76
77
|
instanceWatcher;
|
|
77
78
|
instanceApplyTimer;
|
|
78
79
|
proxyTransport = {
|
|
@@ -89,7 +90,18 @@ export class ServiceProxyManager {
|
|
|
89
90
|
this.supervisor = new ServiceSupervisor(defaultLogger);
|
|
90
91
|
}
|
|
91
92
|
async start() {
|
|
92
|
-
this.settleInitialPublication
|
|
93
|
+
if (!this.settleInitialPublication && this.options.startupTrace) {
|
|
94
|
+
const complete = this.options.startupTrace.startTask('daemon.serviceProxyReady');
|
|
95
|
+
// Bound observation of incomplete startup without making available
|
|
96
|
+
// endpoints wait. Later publications still update the runtime status.
|
|
97
|
+
const timer = setTimeout(() => this.settleInitialPublication?.('failed'), SERVICE_STARTUP_TIMEOUT_MS);
|
|
98
|
+
timer.unref?.();
|
|
99
|
+
this.settleInitialPublication = status => {
|
|
100
|
+
clearTimeout(timer);
|
|
101
|
+
this.settleInitialPublication = undefined;
|
|
102
|
+
complete(status);
|
|
103
|
+
};
|
|
104
|
+
}
|
|
93
105
|
try {
|
|
94
106
|
await this.startRuntime();
|
|
95
107
|
}
|
|
@@ -125,28 +137,51 @@ export class ServiceProxyManager {
|
|
|
125
137
|
}, 250);
|
|
126
138
|
this.instanceApplyTimer.unref?.();
|
|
127
139
|
});
|
|
140
|
+
// ignoreInitial can absorb an instance created while the watcher builds
|
|
141
|
+
// its inventory. Reconcile once that inventory is ready to close the gap
|
|
142
|
+
// between the initial endpoint snapshot and change notifications.
|
|
143
|
+
this.instanceWatcher.on('ready', () => {
|
|
144
|
+
if (this.stopped)
|
|
145
|
+
return;
|
|
146
|
+
void this.scheduleApply().catch(error => {
|
|
147
|
+
defaultLogger.warn('[ServiceProxy] initial instance reconciliation failed: ' + String(error));
|
|
148
|
+
});
|
|
149
|
+
});
|
|
128
150
|
this.applyQueue = this.applyQueue.then(async () => {
|
|
129
151
|
if (!this.stopped)
|
|
130
152
|
await this.supervisor.start(loadDaemonConfig().services ?? []);
|
|
131
153
|
});
|
|
132
154
|
await this.scheduleApply();
|
|
133
155
|
}
|
|
134
|
-
|
|
156
|
+
stop() {
|
|
135
157
|
this.settleInitialPublication?.('cancelled');
|
|
158
|
+
if (this.stopPromise)
|
|
159
|
+
return this.stopPromise;
|
|
136
160
|
if (this.stopped)
|
|
137
|
-
return;
|
|
161
|
+
return Promise.resolve();
|
|
138
162
|
this.stopped = true;
|
|
139
163
|
this.removeConfigListener?.();
|
|
140
164
|
this.removeConfigListener = undefined;
|
|
141
165
|
if (this.instanceApplyTimer)
|
|
142
166
|
clearTimeout(this.instanceApplyTimer);
|
|
143
167
|
this.instanceApplyTimer = undefined;
|
|
144
|
-
|
|
168
|
+
const watcher = this.instanceWatcher;
|
|
145
169
|
this.instanceWatcher = undefined;
|
|
146
|
-
|
|
147
|
-
this.activeProxy?.stop();
|
|
170
|
+
const proxy = this.activeProxy;
|
|
148
171
|
this.activeProxy = null;
|
|
149
|
-
|
|
172
|
+
// Cancel service readiness before joining applyQueue: reconciliation may
|
|
173
|
+
// itself be queued behind a service's long startup health check.
|
|
174
|
+
this.stopPromise = Promise.allSettled([
|
|
175
|
+
this.supervisor.stop(),
|
|
176
|
+
Promise.resolve().then(() => proxy?.stop()),
|
|
177
|
+
Promise.resolve().then(() => watcher?.close()),
|
|
178
|
+
this.applyQueue.catch(() => { }),
|
|
179
|
+
]).then(results => {
|
|
180
|
+
const failure = results.find(result => result.status === 'rejected');
|
|
181
|
+
if (failure?.status === 'rejected')
|
|
182
|
+
throw failure.reason;
|
|
183
|
+
}).finally(() => { this.stopPromise = undefined; });
|
|
184
|
+
return this.stopPromise;
|
|
150
185
|
}
|
|
151
186
|
async execute(request) {
|
|
152
187
|
if (!request || typeof request !== 'object' || !request.operation) {
|
|
@@ -467,7 +502,11 @@ export class ServiceProxyManager {
|
|
|
467
502
|
void handle.ready.then(result => {
|
|
468
503
|
if (this.stopped || this.activeProxy !== handle)
|
|
469
504
|
return;
|
|
470
|
-
|
|
505
|
+
// Missing local instances can still be starting. Keep their initial
|
|
506
|
+
// observation open while publishing the endpoints already available.
|
|
507
|
+
if (result.registered === desired.length || (result.registered > 0 && !result.gatewayRegistered)) {
|
|
508
|
+
this.settleInitialPublication?.(result.gatewayRegistered ? 'ok' : 'failed');
|
|
509
|
+
}
|
|
471
510
|
this.activeProxySignature = hash({ publication,
|
|
472
511
|
endpoints: Object.fromEntries(desired.map(service => [service.name, handle.endpoints[service.name] ?? null])),
|
|
473
512
|
});
|
|
@@ -485,8 +524,10 @@ export class ServiceProxyManager {
|
|
|
485
524
|
timer.unref?.();
|
|
486
525
|
return;
|
|
487
526
|
}
|
|
488
|
-
|
|
489
|
-
this.proxyTransport.
|
|
527
|
+
const missing = desired.filter(service => !handle.endpoints[service.name]).map(service => service.name);
|
|
528
|
+
this.proxyTransport.state = result.gatewayRegistered && missing.length === 0 ? 'active' : 'degraded';
|
|
529
|
+
this.proxyTransport.error = !result.gatewayRegistered ? 'Gateway registration has not been confirmed'
|
|
530
|
+
: missing.length ? 'local service endpoints pending: ' + missing.join(', ') : undefined;
|
|
490
531
|
void this.scheduleApply().catch(error => defaultLogger.warn('[ServiceProxy] endpoint reconciliation failed: ' + String(error)));
|
|
491
532
|
}).catch(error => {
|
|
492
533
|
if (this.stopped || this.activeProxy !== handle)
|