@evomap/evolver-proxy 2.0.0-beta.0 → 2.0.0-beta.2
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/dist/bin/evolver-llm-proxy.js +0 -0
- package/dist/bin/evolver-proxy.js +4 -0
- package/dist/bin/proxySettings.d.ts +2 -0
- package/dist/bin/proxySettings.js +8 -1
- package/dist/daemon/collaborationFacade.d.ts +56 -0
- package/dist/daemon/collaborationFacade.js +877 -0
- package/dist/daemon/proxyDaemon.d.ts +3 -0
- package/dist/daemon/proxyDaemon.js +111 -0
- package/dist/daemon/selectHub.js +17 -1
- package/dist/private/adapterLoader.d.ts +6 -1
- package/dist/private/adapterLoader.js +14 -3
- package/dist/router/messagesRoute.d.ts +13 -0
- package/dist/router/messagesRoute.js +56 -0
- package/dist/sync/engine.d.ts +6 -5
- package/dist/sync/engine.js +102 -58
- package/package.json +4 -3
|
File without changes
|
|
@@ -59,6 +59,7 @@ async function main() {
|
|
|
59
59
|
if (!proxySettingsState.url)
|
|
60
60
|
return;
|
|
61
61
|
publishProxySettings({
|
|
62
|
+
env: process.env,
|
|
62
63
|
record: {
|
|
63
64
|
url: proxySettingsState.url,
|
|
64
65
|
token: ipcToken,
|
|
@@ -104,6 +105,9 @@ export function proxyUsage() {
|
|
|
104
105
|
' EVOMAP_HUB_URL=<private hub url>',
|
|
105
106
|
' EVOMAP_ENTERPRISE_TOKEN=<token>',
|
|
106
107
|
'',
|
|
108
|
+
'Hub URL precedence:',
|
|
109
|
+
' A2A_HUB_URL -> EVOMAP_HUB_URL -> EVOLVER_DEFAULT_HUB_URL -> https://evomap.ai',
|
|
110
|
+
'',
|
|
107
111
|
'Useful options are configured through env or EVOLVER_ENV_FILE:',
|
|
108
112
|
' EVOLVER_IPC_PORT, EVOLVER_IPC_TOKEN, EVOLVER_PROXY_SETTINGS_FILE',
|
|
109
113
|
' EVOLVER_SELF_UPDATE, EVOLVER_LLM_TRACE_CAPTURE_BODIES',
|
|
@@ -8,8 +8,10 @@ export interface ProxySettingsRecord {
|
|
|
8
8
|
export interface PublishProxySettingsOptions {
|
|
9
9
|
settingsPath?: string;
|
|
10
10
|
homeDir?: string;
|
|
11
|
+
env?: Record<string, string | undefined>;
|
|
11
12
|
record: ProxySettingsRecord;
|
|
12
13
|
}
|
|
13
14
|
export declare function defaultProxySettingsPath(homeDir?: string): string;
|
|
15
|
+
export declare function resolveProxySettingsPath(env?: Record<string, string | undefined>, homeDir?: string): string;
|
|
14
16
|
export declare function publishProxySettings(options: PublishProxySettingsOptions): boolean;
|
|
15
17
|
export declare function proxySettingsMatch(settingsPath: string, record: ProxySettingsRecord): boolean;
|
|
@@ -5,8 +5,15 @@ import { dirname, join } from 'node:path';
|
|
|
5
5
|
export function defaultProxySettingsPath(homeDir = homedir()) {
|
|
6
6
|
return join(homeDir, '.evolver', 'settings.json');
|
|
7
7
|
}
|
|
8
|
+
export function resolveProxySettingsPath(env = {}, homeDir = homedir()) {
|
|
9
|
+
const explicit = env['EVOLVER_PROXY_SETTINGS_FILE']?.trim();
|
|
10
|
+
if (explicit)
|
|
11
|
+
return explicit;
|
|
12
|
+
const settingsDir = env['EVOLVER_SETTINGS_DIR']?.trim() || join(homeDir, '.evolver');
|
|
13
|
+
return join(settingsDir, 'settings.json');
|
|
14
|
+
}
|
|
8
15
|
export function publishProxySettings(options) {
|
|
9
|
-
const settingsPath = options.settingsPath ??
|
|
16
|
+
const settingsPath = options.settingsPath ?? resolveProxySettingsPath(options.env, options.homeDir);
|
|
10
17
|
const record = options.record;
|
|
11
18
|
if (!record.token.trim())
|
|
12
19
|
return false;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { hub, mailbox } from '@evomap/evolver-core';
|
|
2
|
+
export interface CollaborationFacadeDeps {
|
|
3
|
+
store: mailbox.MailboxStore;
|
|
4
|
+
hub: hub.HubCapability;
|
|
5
|
+
runtimeNamespace?: string;
|
|
6
|
+
operationTimeoutMs?: number;
|
|
7
|
+
now: () => number;
|
|
8
|
+
notifyOutbound: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare class CollaborationFacade {
|
|
11
|
+
private readonly deps;
|
|
12
|
+
private readonly pendingClaims;
|
|
13
|
+
private readonly pendingCompletes;
|
|
14
|
+
private readonly pendingDmSends;
|
|
15
|
+
private readonly pendingSubscriptions;
|
|
16
|
+
constructor(deps: CollaborationFacadeDeps);
|
|
17
|
+
handle(ctx: mailbox.IpcRouteContext): Promise<boolean>;
|
|
18
|
+
/** Completes V1 durable task intents replayed by SyncEngine after a restart or transient Hub failure. */
|
|
19
|
+
handleOutboundSucceeded(envelope: mailbox.Envelope, handlerResult: unknown): void;
|
|
20
|
+
/** Maps a Public Hub task result echo onto the same durable row as the facade-generated result. */
|
|
21
|
+
normalizeInboundEnvelope(envelope: mailbox.Envelope): mailbox.Envelope;
|
|
22
|
+
/** Caches a sanitized terminal result for durable task intents failed by SyncEngine. */
|
|
23
|
+
handleOutboundTerminal(envelope: mailbox.Envelope, error: unknown): void;
|
|
24
|
+
private taskSubscribe;
|
|
25
|
+
private taskUnsubscribe;
|
|
26
|
+
private taskList;
|
|
27
|
+
private taskClaim;
|
|
28
|
+
private taskComplete;
|
|
29
|
+
private taskMetrics;
|
|
30
|
+
private dmSend;
|
|
31
|
+
private dmPoll;
|
|
32
|
+
private mailboxPoll;
|
|
33
|
+
private mailboxAck;
|
|
34
|
+
private dmList;
|
|
35
|
+
private ensureTaskIntent;
|
|
36
|
+
private executeClaim;
|
|
37
|
+
private executeComplete;
|
|
38
|
+
private activeCompleteIntent;
|
|
39
|
+
private facadeIntentForResult;
|
|
40
|
+
private finalizeClaim;
|
|
41
|
+
private finalizeComplete;
|
|
42
|
+
private enqueueTaskResult;
|
|
43
|
+
private recordMetricOnce;
|
|
44
|
+
private recordTerminalIntentFailure;
|
|
45
|
+
private cacheTerminalIntentFailure;
|
|
46
|
+
private completeIntent;
|
|
47
|
+
private enqueue;
|
|
48
|
+
private getOrStart;
|
|
49
|
+
private messages;
|
|
50
|
+
private dmMessages;
|
|
51
|
+
private timeoutMs;
|
|
52
|
+
private loadMetrics;
|
|
53
|
+
private updateMetrics;
|
|
54
|
+
private observeReceivedTasks;
|
|
55
|
+
private recordCompletion;
|
|
56
|
+
}
|