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

Function deps

packages/cli/src/lib/opencode-detect.test.ts:14–32  ·  view source on GitHub ↗
(
    existing: Set<string>,
    platform: NodeJS.Platform = "darwin",
    onPath: (b: string) => string | null = () => null,
)

Source from the content-addressed store, hash-verified

12// Build hermetic deps over a virtual set of "existing" paths and a fixed OS, so
13// no host filesystem / real `opencode` install can leak into the result.
14function deps(
15 existing: Set<string>,
16 platform: NodeJS.Platform = "darwin",
17 onPath: (b: string) => string | null = () => null,
18): DetectDeps {
19 return {
20 exists: (p) => existing.has(p),
21 home: HOME,
22 platform,
23 env: {
24 APPDATA: join(HOME, "AppData", "Roaming"),
25 LOCALAPPDATA: join(HOME, "AppData", "Local"),
26 USERPROFILE: HOME,
27 XDG_CONFIG_HOME: join(HOME, ".config"),
28 XDG_DATA_HOME: join(HOME, ".local", "share"),
29 },
30 onPath,
31 };
32}
33
34describe("detectOpenCode", () => {
35 it("exposes exactly the three Desktop channel appIds", () => {

Callers 1

Calls 1

hasMethod · 0.80

Tested by

no test coverage detected