@elizaos/autonomous 2.0.0-alpha.13 → 2.0.0-alpha.14
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/.turbo/turbo-build.log +12 -26
- package/dist/packages/autonomous/src/actions/emote.d.ts.map +1 -1
- package/dist/packages/autonomous/src/actions/restart.d.ts.map +1 -1
- package/dist/packages/autonomous/src/actions/restart.js +0 -1
- package/dist/packages/autonomous/src/actions/send-message.d.ts.map +1 -1
- package/dist/packages/autonomous/src/actions/switch-stream-source.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/agent-lifecycle-routes.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/agent-lifecycle-routes.js +1 -1
- package/dist/packages/autonomous/src/api/apps-routes.d.ts +1 -1
- package/dist/packages/autonomous/src/api/apps-routes.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/character-routes.js +1 -1
- package/dist/packages/autonomous/src/api/cloud-billing-routes.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/cloud-compat-routes.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/cloud-status-routes.d.ts +1 -1
- package/dist/packages/autonomous/src/api/cloud-status-routes.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/index.d.ts +16 -16
- package/dist/packages/autonomous/src/api/index.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/index.js +15 -15
- package/dist/packages/autonomous/src/api/knowledge-service-loader.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/memory-routes.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/memory-routes.js +1 -1
- package/dist/packages/autonomous/src/api/parse-action-block.d.ts +2 -2
- package/dist/packages/autonomous/src/api/parse-action-block.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/provider-switch-config.d.ts +1 -1
- package/dist/packages/autonomous/src/api/provider-switch-config.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/sandbox-routes.js +1 -1
- package/dist/packages/autonomous/src/api/server.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/server.js +75 -68
- package/dist/packages/autonomous/src/api/stream-routes.d.ts +1 -1
- package/dist/packages/autonomous/src/api/stream-routes.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/stream-routes.js +3 -2
- package/dist/packages/autonomous/src/api/training-routes.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/training-routes.js +1 -1
- package/dist/packages/autonomous/src/api/trigger-routes.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/trigger-routes.js +6 -2
- package/dist/packages/autonomous/src/api/wallet-evm-balance.d.ts.map +1 -1
- package/dist/packages/autonomous/src/api/wallet-evm-balance.js +2 -1
- package/dist/packages/autonomous/src/cli/index.d.ts.map +1 -1
- package/dist/packages/autonomous/src/config/index.d.ts +1 -1
- package/dist/packages/autonomous/src/config/index.d.ts.map +1 -1
- package/dist/packages/autonomous/src/config/index.js +1 -1
- package/dist/packages/autonomous/src/index.d.ts +1 -1
- package/dist/packages/autonomous/src/index.d.ts.map +1 -1
- package/dist/packages/autonomous/src/index.js +1 -1
- package/dist/packages/autonomous/src/providers/simple-mode.d.ts.map +1 -1
- package/dist/packages/autonomous/src/providers/simple-mode.js +0 -1
- package/dist/packages/autonomous/src/runtime/eliza.d.ts.map +1 -1
- package/dist/packages/autonomous/src/runtime/eliza.js +12 -25
- package/dist/packages/autonomous/src/runtime/milady-plugin.d.ts.map +1 -1
- package/dist/packages/autonomous/src/server/index.d.ts +2 -2
- package/dist/packages/autonomous/src/server/index.d.ts.map +1 -1
- package/dist/packages/autonomous/src/server/index.js +1 -1
- package/dist/packages/autonomous/src/services/agent-export.d.ts.map +1 -1
- package/dist/packages/autonomous/src/services/agent-export.js +53 -43
- package/dist/packages/autonomous/src/services/index.d.ts +4 -4
- package/dist/packages/autonomous/src/services/index.d.ts.map +1 -1
- package/dist/packages/autonomous/src/services/index.js +4 -4
- package/dist/packages/autonomous/src/services/whatsapp-pairing.d.ts.map +1 -1
- package/dist/packages/autonomous/src/services/whatsapp-pairing.js +1 -1
- package/dist/packages/autonomous/src/triggers/runtime.d.ts.map +1 -1
- package/dist/packages/autonomous/src/triggers/runtime.js +2 -0
- package/package.json +5 -5
- package/src/actions/emote.ts +4 -1
- package/src/actions/restart.ts +4 -1
- package/src/actions/send-message.ts +9 -1
- package/src/actions/switch-stream-source.ts +7 -1
- package/src/api/agent-lifecycle-routes.ts +1 -10
- package/src/api/apps-routes.ts +2 -5
- package/src/api/character-routes.ts +1 -1
- package/src/api/cloud-billing-routes.ts +3 -1
- package/src/api/cloud-compat-routes.ts +3 -1
- package/src/api/cloud-status-routes.ts +4 -3
- package/src/api/index.ts +29 -33
- package/src/api/knowledge-service-loader.ts +9 -3
- package/src/api/memory-routes.ts +4 -1
- package/src/api/parse-action-block.ts +2 -4
- package/src/api/provider-switch-config.ts +1 -1
- package/src/api/sandbox-routes.ts +2 -1
- package/src/api/server.ts +105 -104
- package/src/api/stream-routes.ts +14 -7
- package/src/api/training-routes.ts +4 -1
- package/src/api/trigger-routes.ts +10 -4
- package/src/api/wallet-evm-balance.ts +2 -1
- package/src/cli/index.ts +3 -1
- package/src/cloud/cloud-manager.test.ts +9 -9
- package/src/config/index.ts +1 -1
- package/src/index.ts +1 -1
- package/src/providers/simple-mode.ts +0 -1
- package/src/runtime/cloud-onboarding.ts +5 -3
- package/src/runtime/eliza.ts +20 -28
- package/src/runtime/milady-plugin.ts +1 -4
- package/src/server/index.ts +2 -6
- package/src/services/agent-export.ts +44 -33
- package/src/services/index.ts +4 -4
- package/src/services/whatsapp-pairing.ts +5 -2
- package/src/triggers/runtime.ts +17 -3
- package/test/api/agent-admin-routes.test.ts +15 -9
- package/test/api/agent-lifecycle-routes.test.ts +18 -9
- package/test/api/agent-transfer-routes.test.ts +18 -9
- package/test/api/apps-routes.test.ts +7 -9
- package/test/api/auth-routes.test.ts +7 -7
- package/test/api/bug-report-routes.test.ts +5 -5
- package/test/api/knowledge-routes.test.ts +4 -4
- package/test/api/memory-routes.test.ts +4 -4
- package/test/api/models-routes.test.ts +9 -7
- package/test/api/nfa-routes.test.ts +6 -6
- package/test/api/permissions-routes.test.ts +5 -5
- package/test/api/registry-routes.test.ts +6 -6
- package/test/api/signal-routes.test.ts +6 -6
- package/test/api/subscription-routes.test.ts +4 -4
- package/test/api/trigger-routes.test.ts +4 -4
- package/test/api/wallet-routes.observability.test.ts +1 -1
- package/test/api/wallet-routes.test.ts +1 -1
- package/test/diagnostics/integration-observability.test.ts +1 -1
- package/test/security/audit-log.test.ts +6 -8
- package/test/security/network-policy.test.ts +3 -3
- package/test/services/version-compat.test.ts +23 -19
- package/tsconfig.json +1 -5
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { describe,
|
|
2
|
-
import {
|
|
3
|
-
createMockIncomingMessage,
|
|
4
|
-
createMockHttpResponse,
|
|
5
|
-
} from "../../src/test-support/test-helpers";
|
|
1
|
+
import { describe, expect, test, vi } from "vitest";
|
|
6
2
|
import type {
|
|
7
|
-
AppsRouteContext,
|
|
8
3
|
AppManagerLike,
|
|
4
|
+
AppsRouteContext,
|
|
9
5
|
PluginManagerLike,
|
|
10
6
|
} from "../../src/api/apps-routes";
|
|
11
7
|
import { handleAppsRoutes } from "../../src/api/apps-routes";
|
|
8
|
+
import {
|
|
9
|
+
createMockHttpResponse,
|
|
10
|
+
createMockIncomingMessage,
|
|
11
|
+
} from "../../src/test-support/test-helpers";
|
|
12
12
|
|
|
13
13
|
function buildPluginManager(
|
|
14
14
|
overrides: Partial<PluginManagerLike> = {},
|
|
@@ -67,9 +67,7 @@ function buildAppManager(
|
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
function buildCtx(
|
|
71
|
-
overrides: Partial<AppsRouteContext> = {},
|
|
72
|
-
): AppsRouteContext {
|
|
70
|
+
function buildCtx(overrides: Partial<AppsRouteContext> = {}): AppsRouteContext {
|
|
73
71
|
const { res } = createMockHttpResponse();
|
|
74
72
|
return {
|
|
75
73
|
req: createMockIncomingMessage({ method: "GET", url: "/" }),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
|
|
2
|
+
import type { AuthRouteContext } from "../../src/api/auth-routes";
|
|
3
|
+
import { handleAuthRoutes } from "../../src/api/auth-routes";
|
|
2
4
|
import {
|
|
3
|
-
createMockIncomingMessage,
|
|
4
5
|
createMockHttpResponse,
|
|
6
|
+
createMockIncomingMessage,
|
|
5
7
|
} from "../../src/test-support/test-helpers";
|
|
6
|
-
import { handleAuthRoutes } from "../../src/api/auth-routes";
|
|
7
|
-
import type { AuthRouteContext } from "../../src/api/auth-routes";
|
|
8
8
|
|
|
9
9
|
let envBackup: string | undefined;
|
|
10
10
|
|
|
@@ -25,7 +25,7 @@ function buildCtx(
|
|
|
25
25
|
): AuthRouteContext & { getStatus: () => number; getJson: () => unknown } {
|
|
26
26
|
const { res, getStatus, getJson } = createMockHttpResponse();
|
|
27
27
|
const req = createMockIncomingMessage({ method, url: pathname });
|
|
28
|
-
(req
|
|
28
|
+
Object.assign(req, { socket: { remoteAddress: "127.0.0.1" } });
|
|
29
29
|
const ctx = {
|
|
30
30
|
req,
|
|
31
31
|
res,
|
|
@@ -46,10 +46,10 @@ function buildCtx(
|
|
|
46
46
|
rateLimitPairing: () => true,
|
|
47
47
|
getPairingExpiresAt: () => Date.now() + 60_000,
|
|
48
48
|
clearPairing: vi.fn(),
|
|
49
|
+
getStatus,
|
|
50
|
+
getJson,
|
|
49
51
|
...overrides,
|
|
50
52
|
} as AuthRouteContext & { getStatus: () => number; getJson: () => unknown };
|
|
51
|
-
(ctx as any).getStatus = getStatus;
|
|
52
|
-
(ctx as any).getJson = getJson;
|
|
53
53
|
return ctx;
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { describe,
|
|
2
|
-
import {
|
|
3
|
-
createMockIncomingMessage,
|
|
4
|
-
createMockHttpResponse,
|
|
5
|
-
} from "../../src/test-support/test-helpers";
|
|
1
|
+
import { describe, expect, test, vi } from "vitest";
|
|
6
2
|
import {
|
|
7
3
|
handleBugReportRoutes,
|
|
8
4
|
rateLimitBugReport,
|
|
@@ -10,6 +6,10 @@ import {
|
|
|
10
6
|
sanitize,
|
|
11
7
|
} from "../../src/api/bug-report-routes";
|
|
12
8
|
import type { RouteRequestContext } from "../../src/api/route-helpers";
|
|
9
|
+
import {
|
|
10
|
+
createMockHttpResponse,
|
|
11
|
+
createMockIncomingMessage,
|
|
12
|
+
} from "../../src/test-support/test-helpers";
|
|
13
13
|
|
|
14
14
|
function buildCtx(
|
|
15
15
|
overrides: Partial<RouteRequestContext> = {},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { describe,
|
|
1
|
+
import { describe, expect, test, vi } from "vitest";
|
|
2
|
+
import type { KnowledgeRouteContext } from "../../src/api/knowledge-routes";
|
|
3
|
+
import { handleKnowledgeRoutes } from "../../src/api/knowledge-routes";
|
|
2
4
|
import {
|
|
3
|
-
createMockIncomingMessage,
|
|
4
5
|
createMockHttpResponse,
|
|
6
|
+
createMockIncomingMessage,
|
|
5
7
|
} from "../../src/test-support/test-helpers";
|
|
6
|
-
import { handleKnowledgeRoutes } from "../../src/api/knowledge-routes";
|
|
7
|
-
import type { KnowledgeRouteContext } from "../../src/api/knowledge-routes";
|
|
8
8
|
|
|
9
9
|
function buildCtx(
|
|
10
10
|
method: string,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { describe,
|
|
1
|
+
import { describe, expect, test, vi } from "vitest";
|
|
2
|
+
import type { MemoryRouteContext } from "../../src/api/memory-routes";
|
|
3
|
+
import { handleMemoryRoutes } from "../../src/api/memory-routes";
|
|
2
4
|
import {
|
|
3
|
-
createMockIncomingMessage,
|
|
4
5
|
createMockHttpResponse,
|
|
6
|
+
createMockIncomingMessage,
|
|
5
7
|
} from "../../src/test-support/test-helpers";
|
|
6
|
-
import { handleMemoryRoutes } from "../../src/api/memory-routes";
|
|
7
|
-
import type { MemoryRouteContext } from "../../src/api/memory-routes";
|
|
8
8
|
|
|
9
9
|
function buildCtx(
|
|
10
10
|
method: string,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { describe,
|
|
1
|
+
import { describe, expect, test, vi } from "vitest";
|
|
2
|
+
import type { ModelsRouteContext } from "../../src/api/models-routes";
|
|
3
|
+
import { handleModelsRoutes } from "../../src/api/models-routes";
|
|
2
4
|
import {
|
|
3
|
-
createMockIncomingMessage,
|
|
4
5
|
createMockHttpResponse,
|
|
6
|
+
createMockIncomingMessage,
|
|
5
7
|
} from "../../src/test-support/test-helpers";
|
|
6
|
-
import { handleModelsRoutes } from "../../src/api/models-routes";
|
|
7
|
-
import type { ModelsRouteContext } from "../../src/api/models-routes";
|
|
8
8
|
|
|
9
9
|
function buildCtx(
|
|
10
10
|
method: string,
|
|
@@ -24,7 +24,9 @@ function buildCtx(
|
|
|
24
24
|
r.writeHead(status);
|
|
25
25
|
r.end(JSON.stringify(data));
|
|
26
26
|
}),
|
|
27
|
-
providerCachePath: vi.fn(
|
|
27
|
+
providerCachePath: vi.fn(
|
|
28
|
+
(provider: string) => `/tmp/cache/${provider}.json`,
|
|
29
|
+
),
|
|
28
30
|
getOrFetchProvider: vi.fn(async (provider: string) => [
|
|
29
31
|
{ id: `${provider}/model-a`, name: "Model A" },
|
|
30
32
|
]),
|
|
@@ -37,13 +39,13 @@ function buildCtx(
|
|
|
37
39
|
readDir: vi.fn(() => []),
|
|
38
40
|
unlinkFile: vi.fn(),
|
|
39
41
|
joinPath: vi.fn((left: string, right: string) => `${left}/${right}`),
|
|
42
|
+
getStatus,
|
|
43
|
+
getJson,
|
|
40
44
|
...overrides,
|
|
41
45
|
} as ModelsRouteContext & {
|
|
42
46
|
getStatus: () => number;
|
|
43
47
|
getJson: () => unknown;
|
|
44
48
|
};
|
|
45
|
-
(ctx as any).getStatus = getStatus;
|
|
46
|
-
(ctx as any).getJson = getJson;
|
|
47
49
|
return ctx;
|
|
48
50
|
}
|
|
49
51
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { describe,
|
|
1
|
+
import { describe, expect, test, vi } from "vitest";
|
|
2
|
+
import type { NfaRouteContext } from "../../src/api/nfa-routes";
|
|
3
|
+
import { handleNfaRoutes } from "../../src/api/nfa-routes";
|
|
2
4
|
import {
|
|
3
|
-
createMockIncomingMessage,
|
|
4
5
|
createMockHttpResponse,
|
|
6
|
+
createMockIncomingMessage,
|
|
5
7
|
} from "../../src/test-support/test-helpers";
|
|
6
|
-
import { handleNfaRoutes } from "../../src/api/nfa-routes";
|
|
7
|
-
import type { NfaRouteContext } from "../../src/api/nfa-routes";
|
|
8
8
|
|
|
9
9
|
function buildCtx(
|
|
10
10
|
method: string,
|
|
@@ -26,13 +26,13 @@ function buildCtx(
|
|
|
26
26
|
r.writeHead(status);
|
|
27
27
|
r.end(JSON.stringify({ error: msg }));
|
|
28
28
|
}),
|
|
29
|
+
getStatus,
|
|
30
|
+
getJson,
|
|
29
31
|
...overrides,
|
|
30
32
|
} as NfaRouteContext & {
|
|
31
33
|
getStatus: () => number;
|
|
32
34
|
getJson: () => unknown;
|
|
33
35
|
};
|
|
34
|
-
(ctx as any).getStatus = getStatus;
|
|
35
|
-
(ctx as any).getJson = getJson;
|
|
36
36
|
return ctx;
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { describe,
|
|
1
|
+
import { describe, expect, test, vi } from "vitest";
|
|
2
|
+
import type { PermissionRouteContext } from "../../src/api/permissions-routes";
|
|
3
|
+
import { handlePermissionRoutes } from "../../src/api/permissions-routes";
|
|
2
4
|
import {
|
|
3
|
-
createMockIncomingMessage,
|
|
4
5
|
createMockHttpResponse,
|
|
6
|
+
createMockIncomingMessage,
|
|
5
7
|
} from "../../src/test-support/test-helpers";
|
|
6
|
-
import { handlePermissionRoutes } from "../../src/api/permissions-routes";
|
|
7
|
-
import type { PermissionRouteContext } from "../../src/api/permissions-routes";
|
|
8
8
|
|
|
9
9
|
function buildCtx(
|
|
10
10
|
method: string,
|
|
@@ -107,7 +107,7 @@ describe("permissions-routes", () => {
|
|
|
107
107
|
const ctx = buildCtx("PUT", "/api/permissions/shell", {
|
|
108
108
|
readJsonBody: vi.fn(async () => ({ enabled: true })),
|
|
109
109
|
state: {
|
|
110
|
-
runtime: {} as
|
|
110
|
+
runtime: {} as import("@elizaos/core").AgentRuntime,
|
|
111
111
|
config: { features: {} },
|
|
112
112
|
shellEnabled: false,
|
|
113
113
|
},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { describe,
|
|
1
|
+
import { describe, expect, test, vi } from "vitest";
|
|
2
|
+
import type { RegistryRouteContext } from "../../src/api/registry-routes";
|
|
3
|
+
import { handleRegistryRoutes } from "../../src/api/registry-routes";
|
|
2
4
|
import {
|
|
3
|
-
createMockIncomingMessage,
|
|
4
5
|
createMockHttpResponse,
|
|
6
|
+
createMockIncomingMessage,
|
|
5
7
|
} from "../../src/test-support/test-helpers";
|
|
6
|
-
import { handleRegistryRoutes } from "../../src/api/registry-routes";
|
|
7
|
-
import type { RegistryRouteContext } from "../../src/api/registry-routes";
|
|
8
8
|
|
|
9
9
|
function buildCtx(
|
|
10
10
|
method: string,
|
|
@@ -37,13 +37,13 @@ function buildCtx(
|
|
|
37
37
|
getLoadedPluginNames: () => [],
|
|
38
38
|
getBundledPluginIds: () => new Set<string>(),
|
|
39
39
|
classifyRegistryPluginRelease: () => "compatible",
|
|
40
|
+
getStatus,
|
|
41
|
+
getJson,
|
|
40
42
|
...overrides,
|
|
41
43
|
} as RegistryRouteContext & {
|
|
42
44
|
getStatus: () => number;
|
|
43
45
|
getJson: () => unknown;
|
|
44
46
|
};
|
|
45
|
-
(ctx as any).getStatus = getStatus;
|
|
46
|
-
(ctx as any).getJson = getJson;
|
|
47
47
|
return ctx;
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { describe,
|
|
2
|
-
import {
|
|
3
|
-
createMockIncomingMessage,
|
|
4
|
-
createMockHttpResponse,
|
|
5
|
-
} from "../../src/test-support/test-helpers";
|
|
1
|
+
import { describe, expect, test, vi } from "vitest";
|
|
6
2
|
import type {
|
|
7
|
-
SignalRouteState,
|
|
8
3
|
SignalRouteDeps,
|
|
4
|
+
SignalRouteState,
|
|
9
5
|
} from "../../src/api/signal-routes";
|
|
10
6
|
import { handleSignalRoute } from "../../src/api/signal-routes";
|
|
7
|
+
import {
|
|
8
|
+
createMockHttpResponse,
|
|
9
|
+
createMockIncomingMessage,
|
|
10
|
+
} from "../../src/test-support/test-helpers";
|
|
11
11
|
|
|
12
12
|
function buildState(
|
|
13
13
|
overrides: Partial<SignalRouteState> = {},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { describe,
|
|
1
|
+
import { describe, expect, test, vi } from "vitest";
|
|
2
|
+
import type { SubscriptionRouteContext } from "../../src/api/subscription-routes";
|
|
3
|
+
import { handleSubscriptionRoutes } from "../../src/api/subscription-routes";
|
|
2
4
|
import {
|
|
3
|
-
createMockIncomingMessage,
|
|
4
5
|
createMockHttpResponse,
|
|
6
|
+
createMockIncomingMessage,
|
|
5
7
|
} from "../../src/test-support/test-helpers";
|
|
6
|
-
import type { SubscriptionRouteContext } from "../../src/api/subscription-routes";
|
|
7
|
-
import { handleSubscriptionRoutes } from "../../src/api/subscription-routes";
|
|
8
8
|
|
|
9
9
|
function buildCtx(
|
|
10
10
|
overrides: Partial<SubscriptionRouteContext> = {},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { describe,
|
|
1
|
+
import { describe, expect, test, vi } from "vitest";
|
|
2
|
+
import type { TriggerRouteContext } from "../../src/api/trigger-routes";
|
|
3
|
+
import { handleTriggerRoutes } from "../../src/api/trigger-routes";
|
|
2
4
|
import {
|
|
3
|
-
createMockIncomingMessage,
|
|
4
5
|
createMockHttpResponse,
|
|
6
|
+
createMockIncomingMessage,
|
|
5
7
|
} from "../../src/test-support/test-helpers";
|
|
6
|
-
import type { TriggerRouteContext } from "../../src/api/trigger-routes";
|
|
7
|
-
import { handleTriggerRoutes } from "../../src/api/trigger-routes";
|
|
8
8
|
|
|
9
9
|
function buildCtx(
|
|
10
10
|
overrides: Partial<TriggerRouteContext> = {},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
2
|
-
import type { MiladyConfig } from "../../src/config/config";
|
|
3
2
|
import {
|
|
4
3
|
handleWalletRoutes,
|
|
5
4
|
type WalletRouteDependencies,
|
|
6
5
|
} from "../../src/api/wallet-routes";
|
|
6
|
+
import type { MiladyConfig } from "../../src/config/config";
|
|
7
7
|
|
|
8
8
|
const { createSpanMock, spanSuccessMock, spanFailureMock } = vi.hoisted(() => ({
|
|
9
9
|
createSpanMock: vi.fn(),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
|
|
2
|
-
import type { MiladyConfig } from "../../src/config/config";
|
|
3
2
|
import {
|
|
4
3
|
handleWalletRoutes,
|
|
5
4
|
type WalletRouteDependencies,
|
|
6
5
|
} from "../../src/api/wallet-routes";
|
|
6
|
+
import type { MiladyConfig } from "../../src/config/config";
|
|
7
7
|
|
|
8
8
|
const ENV_KEYS = [
|
|
9
9
|
"ALCHEMY_API_KEY",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { beforeEach, describe, expect, test, vi } from "vitest";
|
|
2
2
|
import {
|
|
3
|
-
SandboxAuditLog,
|
|
4
|
-
queryAuditFeed,
|
|
5
|
-
getAuditFeedSize,
|
|
6
|
-
subscribeAuditFeed,
|
|
7
3
|
__resetAuditFeedForTests,
|
|
8
4
|
AUDIT_EVENT_TYPES,
|
|
9
5
|
AUDIT_SEVERITIES,
|
|
6
|
+
getAuditFeedSize,
|
|
7
|
+
queryAuditFeed,
|
|
8
|
+
SandboxAuditLog,
|
|
9
|
+
subscribeAuditFeed,
|
|
10
10
|
} from "../../src/security/audit-log";
|
|
11
11
|
|
|
12
12
|
beforeEach(() => {
|
|
@@ -59,9 +59,7 @@ describe("SandboxAuditLog", () => {
|
|
|
59
59
|
|
|
60
60
|
test("recordTokenReplacement creates outbound entry", () => {
|
|
61
61
|
const log = createLog();
|
|
62
|
-
log.recordTokenReplacement("outbound", "https://api.example.com", [
|
|
63
|
-
"tok1",
|
|
64
|
-
]);
|
|
62
|
+
log.recordTokenReplacement("outbound", "https://api.example.com", ["tok1"]);
|
|
65
63
|
const recent = log.getRecent(1);
|
|
66
64
|
expect(recent[0].type).toBe("secret_token_replacement_outbound");
|
|
67
65
|
expect(recent[0].severity).toBe("info");
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { describe,
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
decodeIpv6MappedHex,
|
|
4
4
|
isBlockedPrivateOrLinkLocalIp,
|
|
5
5
|
isLoopbackHost,
|
|
6
6
|
normalizeHostLike,
|
|
7
|
-
|
|
7
|
+
normalizeIpForPolicy,
|
|
8
8
|
} from "../../src/security/network-policy";
|
|
9
9
|
|
|
10
10
|
describe("network-policy", () => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { describe,
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
AI_PROVIDER_PLUGINS,
|
|
4
4
|
compareSemver,
|
|
5
|
-
versionSatisfies,
|
|
6
5
|
diagnoseNoAIProvider,
|
|
7
|
-
|
|
6
|
+
parseSemver,
|
|
7
|
+
versionSatisfies,
|
|
8
8
|
} from "../../src/services/version-compat";
|
|
9
9
|
|
|
10
10
|
describe("parseSemver", () => {
|
|
@@ -17,9 +17,7 @@ describe("parseSemver", () => {
|
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
test("parses a nightly pre-release", () => {
|
|
20
|
-
expect(parseSemver("2.0.0-nightly.20260208")).toEqual([
|
|
21
|
-
2, 0, 0, 20260208,
|
|
22
|
-
]);
|
|
20
|
+
expect(parseSemver("2.0.0-nightly.20260208")).toEqual([2, 0, 0, 20260208]);
|
|
23
21
|
});
|
|
24
22
|
|
|
25
23
|
test("returns null for unparseable version", () => {
|
|
@@ -95,23 +93,29 @@ describe("diagnoseNoAIProvider", () => {
|
|
|
95
93
|
});
|
|
96
94
|
|
|
97
95
|
test("detects version skew signature in failed plugins", () => {
|
|
98
|
-
const result = diagnoseNoAIProvider(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
96
|
+
const result = diagnoseNoAIProvider(
|
|
97
|
+
[],
|
|
98
|
+
[
|
|
99
|
+
{
|
|
100
|
+
name: "@elizaos/plugin-openai",
|
|
101
|
+
error: "does not provide an export named 'MAX_EMBEDDING_TOKENS'",
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
);
|
|
104
105
|
expect(result).toContain("Version skew detected");
|
|
105
106
|
expect(result).toContain("@elizaos/plugin-openai");
|
|
106
107
|
});
|
|
107
108
|
|
|
108
109
|
test("returns generic failure message for non-version-skew errors", () => {
|
|
109
|
-
const result = diagnoseNoAIProvider(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
const result = diagnoseNoAIProvider(
|
|
111
|
+
[],
|
|
112
|
+
[
|
|
113
|
+
{
|
|
114
|
+
name: "@elizaos/plugin-openai",
|
|
115
|
+
error: "Connection refused",
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
);
|
|
115
119
|
expect(result).toContain("All AI provider plugins failed to load");
|
|
116
120
|
expect(result).toContain("Connection refused");
|
|
117
121
|
});
|