feat: initialize experimental agent repo

This commit is contained in:
2026-06-30 14:03:49 +08:00
commit e83ac54a9e
75 changed files with 11690 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
import { describe, expect, it } from "bun:test";
import {
getRuntimeSessionContext,
removeRuntimeSessionContext,
setRuntimeSessionContext,
} from "../../src/runtime/sessionContext.js";
describe("runtime session context", () => {
it("stores local context in process memory", () => {
setRuntimeSessionContext({
actorKey: "actor-1",
allowLearningWrite: true,
clientSessionId: "chat-session-1",
learningMode: "interactive",
network: "fengyang",
projectId: "project-id-1",
projectKey: "project-1",
sessionId: "runtime-session-1",
traceId: "trace-1",
});
const runtimeContext = getRuntimeSessionContext("runtime-session-1");
expect(runtimeContext?.clientSessionId).toBe("chat-session-1");
expect(runtimeContext?.network).toBe("fengyang");
expect(runtimeContext?.sessionId).toBe("runtime-session-1");
removeRuntimeSessionContext("runtime-session-1");
expect(getRuntimeSessionContext("runtime-session-1")).toBeNull();
});
});