MCPcopy Create free account
hub / github.com/anomalyco/opencode / create

Function create

packages/opencode/src/control-plane/adapters/worktree.ts:45–60  ·  view source on GitHub ↗
(info, _env, _from, context)

Source from the content-addressed store, hash-verified

43 }
44 },
45 async create(info, _env, _from, context) {
46 const { AppRuntime, Worktree } = await loadWorktree()
47 const config = decodeWorktreeConfig(info)
48 await AppRuntime.runPromise(
49 provideContext(
50 Worktree.Service.use((svc) =>
51 svc.createFromInfo({
52 name: config.name,
53 directory: config.directory,
54 ...(config.branch ? { branch: config.branch } : {}),
55 }),
56 ),
57 context,
58 ),
59 )
60 },
61 async list(context) {
62 const { AppRuntime, Worktree } = await loadWorktree()
63 const ctx = requireInstance(context)

Callers

nothing calls this directly

Calls 3

loadWorktreeFunction · 0.85
provideContextFunction · 0.85
useMethod · 0.45

Tested by

no test coverage detected