forked from paperclipai/paperclip
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.test.ts
More file actions
63 lines (54 loc) · 2.57 KB
/
Copy pathindex.test.ts
File metadata and controls
63 lines (54 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { expect, test } from "vitest";
import {
createHermesGatewayServerAdapter,
createHermesLocalServerAdapter,
createServerAdapter,
hermesGatewayType,
} from "./index.js";
import { createServerAdapter as createGatewayServerAdapterFromSubpath } from "./gateway/index.js";
test("root package export exposes Paperclip external adapter entrypoint", () => {
const adapter = createServerAdapter();
expect(adapter.type).toBe("hermes_local");
expect(typeof adapter.execute).toBe("function");
expect(typeof adapter.testEnvironment).toBe("function");
expect(typeof adapter.sessionCodec?.deserialize).toBe("function");
expect(adapter.sessionManagement?.nativeContextManagement).toBe("confirmed");
expect(adapter.supportsLocalAgentJwt).toBe(true);
expect(adapter.supportsInstructionsBundle).toBe(true);
expect(adapter.instructionsPathKey).toBe("instructionsFilePath");
expect(adapter.getRuntimeCommandSpec?.({ command: "hermes-dev" })).toMatchObject({
command: "hermes-dev",
detectCommand: "hermes-dev",
installCommand: null,
});
expect(typeof adapter.detectModel).toBe("function");
expect(typeof adapter.getConfigSchema).toBe("function");
});
test("root package export keeps explicit local and gateway adapter factories", () => {
const localAdapter = createHermesLocalServerAdapter();
const gatewayAdapter = createHermesGatewayServerAdapter();
expect(localAdapter.type).toBe("hermes_local");
expect(gatewayAdapter.type).toBe("hermes_gateway");
expect(hermesGatewayType).toBe("hermes_gateway");
expect(gatewayAdapter.supportsLocalAgentJwt).toBe(true);
expect(gatewayAdapter.supportsInstructionsBundle).toBe(false);
});
test("gateway subpath export exposes the Hermes Gateway adapter entrypoint", () => {
const adapter = createGatewayServerAdapterFromSubpath();
expect(adapter.type).toBe("hermes_gateway");
expect(typeof adapter.execute).toBe("function");
expect(typeof adapter.testEnvironment).toBe("function");
expect(typeof adapter.sessionCodec?.deserialize).toBe("function");
expect(adapter.sessionManagement?.nativeContextManagement).toBe("confirmed");
expect(typeof adapter.getConfigSchema).toBe("function");
});
test("Hermes adapter exposes bundled Paperclip task bridge skill", async () => {
const adapter = createServerAdapter();
const snapshot = await adapter.listSkills?.({
adapterType: "hermes_local",
agentId: "11111111-1111-4111-8111-111111111111",
companyId: "22222222-2222-4222-8222-222222222222",
config: {},
});
expect(snapshot?.entries.some((entry) => entry.runtimeName === "paperclip-task-bridge")).toBe(true);
});