MCPcopy Create free account
hub / github.com/cortexkit/magic-context / main

Function main

tests/docker/fixtures/aimock-opencode.cjs:15–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13const port = parseInt(process.env.AIMOCK_PORT || "4010", 10);
14
15async function main() {
16 const mock = new LLMock({ port });
17
18 // Catch-all fixture: respond to any chat-completion request with a
19 // short text reply. Predicate returns true unconditionally so we
20 // don't depend on sequenceIndex bookkeeping (OpenCode may issue
21 // multiple requests per session: model-list probe, chat completion,
22 // possibly a follow-up).
23 mock.on(
24 { predicate: () => true },
25 {
26 content: "hello",
27 },
28 );
29
30 await mock.start();
31 console.log(`aimock-opencode listening on http://127.0.0.1:${port}`);
32}
33
34main().catch((err) => {
35 console.error("aimock-opencode failed to start:", err);

Callers 1

Calls 1

startMethod · 0.65

Tested by

no test coverage detected