MCPcopy
hub / github.com/anomalyco/opencode / directories

Function directories

packages/opencode/test/project/project-directory.test.ts:19–35  ·  view source on GitHub ↗
(projectID: ProjectV2.ID)

Source from the content-addressed store, hash-verified

17const it = testEffect(LayerNode.compile(LayerNode.group([Project.node, Database.node, CrossSpawnSpawner.node])))
18
19function directories(projectID: ProjectV2.ID) {
20 return Database.Service.use(({ db }) =>
21 db
22 .select()
23 .from(ProjectDirectoryTable)
24 .where(eq(ProjectDirectoryTable.project_id, projectID))
25 .all()
26 .pipe(
27 Effect.orDie,
28 Effect.map((rows) =>
29 rows
30 .map((row) => ({ directory: row.directory, strategy: row.strategy ?? undefined }))
31 .toSorted((a, b) => a.directory.localeCompare(b.directory)),
32 ),
33 ),
34 )
35}
36
37describe("Project directory persistence", () => {
38 it.live("stores the first opened checkout directory", () =>

Callers 1

Calls 6

eqFunction · 0.85
useMethod · 0.45
allMethod · 0.45
whereMethod · 0.45
fromMethod · 0.45
selectMethod · 0.45

Tested by

no test coverage detected