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

Method create

packages/e2e-tests/src/harness.ts:78–97  ·  view source on GitHub ↗
(options: TestHarnessOptions = {})

Source from the content-addressed store, hash-verified

76 }
77
78 static async create(options: TestHarnessOptions = {}): Promise<TestHarness> {
79 const mock = new MockProvider();
80 const { baseURL } = await mock.start();
81
82 // Always install a default so unexpected extra requests don't 500.
83 mock.setDefault(options.mockDefault ?? DEFAULT_MOCK_RESPONSE);
84
85 const spawnOpts: SpawnOptions = {
86 mockProviderURL: baseURL,
87 magicContextConfig: options.magicContextConfig,
88 openCodeConfigExtra: options.openCodeConfigExtra,
89 modelContextLimit: options.modelContextLimit,
90 };
91 const opencode = await spawnOpencode(spawnOpts);
92
93 const sdk = await import("@opencode-ai/sdk");
94 const client = sdk.createOpencodeClient({ baseUrl: opencode.url }) as unknown as SdkClient;
95
96 return new TestHarness(mock, opencode, client);
97 }
98
99 /** Create a session bound to the isolated workdir. Throws on failure. */
100 async createSession(): Promise<string> {

Callers 15

reviewUserMemoriesFunction · 0.45
runMemoryMigrationFunction · 0.45
runSidekickFunction · 0.45
compileSmartNoteCheckFunction · 0.45
verifyOneBatchFunction · 0.45
refreshOnePrimerFunction · 0.45
confirmReadOnlyFunction · 0.45
runRetrospectiveTaskFunction · 0.45
runAgenticTaskFunction · 0.45
classifyOneChunkFunction · 0.45
mapOneBatchFunction · 0.45
runHistorianPromptFunction · 0.45

Calls 3

startMethod · 0.95
setDefaultMethod · 0.95
spawnOpencodeFunction · 0.90

Tested by 1

withPiHarnessFunction · 0.36