|
|
@@ -44,7 +44,7 @@ function testLayer(
|
|
|
)
|
|
|
return AppNodeBuilder.build(LayerNode.group([Config.node, EventV2.node]), [
|
|
|
[Location.node, locationLayer],
|
|
|
- [Global.node, Global.layerWith({ config: globalDirectory })],
|
|
|
+ [Global.node, Global.layerWith({ config: globalDirectory, home: path.join(globalDirectory, "home") })],
|
|
|
...(watcher ? ([[Watcher.node, watcher]] as const) : []),
|
|
|
])
|
|
|
}
|
|
|
@@ -112,6 +112,7 @@ describe("Config", () => {
|
|
|
info: new Config.Info({ model: selection("openrouter/openai/gpt-5") }),
|
|
|
}),
|
|
|
new Config.Directory({ type: "directory", path: AbsolutePath.make("/skills") }),
|
|
|
+ new Config.AgentsDirectory({ type: "agents", path: AbsolutePath.make("/agents") }),
|
|
|
new Config.Document({ type: "document", info: new Config.Info({}) }),
|
|
|
new Config.Document({
|
|
|
type: "document",
|
|
|
@@ -848,11 +849,19 @@ describe("Config", () => {
|
|
|
const root = path.join(tmp.path, "repo")
|
|
|
const parent = path.join(root, "packages")
|
|
|
const directory = path.join(parent, "app")
|
|
|
+ const globalAgents = path.join(global, "home", ".agents")
|
|
|
+ const globalClaude = path.join(global, "home", ".claude")
|
|
|
return Effect.gen(function* () {
|
|
|
yield* Effect.promise(async () => {
|
|
|
await fs.mkdir(global, { recursive: true })
|
|
|
+ await fs.mkdir(globalAgents, { recursive: true })
|
|
|
+ await fs.mkdir(globalClaude, { recursive: true })
|
|
|
await fs.mkdir(directory, { recursive: true })
|
|
|
+ await fs.mkdir(path.join(root, ".agents"), { recursive: true })
|
|
|
+ await fs.mkdir(path.join(root, ".claude"), { recursive: true })
|
|
|
await fs.mkdir(path.join(root, ".opencode"), { recursive: true })
|
|
|
+ await fs.mkdir(path.join(directory, ".agents"), { recursive: true })
|
|
|
+ await fs.mkdir(path.join(directory, ".claude"), { recursive: true })
|
|
|
await fs.mkdir(path.join(directory, ".opencode"), { recursive: true })
|
|
|
await Promise.all([
|
|
|
fs.writeFile(path.join(tmp.path, "opencode.json"), JSON.stringify({ $schema: "outside" })),
|
|
|
@@ -878,6 +887,16 @@ describe("Config", () => {
|
|
|
AbsolutePath.make(path.join(root, ".opencode")),
|
|
|
AbsolutePath.make(path.join(directory, ".opencode")),
|
|
|
])
|
|
|
+ expect(entries.filter((entry) => entry.type === "agents").map((entry) => entry.path)).toEqual([
|
|
|
+ AbsolutePath.make(globalAgents),
|
|
|
+ AbsolutePath.make(path.join(directory, ".agents")),
|
|
|
+ AbsolutePath.make(path.join(root, ".agents")),
|
|
|
+ ])
|
|
|
+ expect(entries.filter((entry) => entry.type === "claude").map((entry) => entry.path)).toEqual([
|
|
|
+ AbsolutePath.make(globalClaude),
|
|
|
+ AbsolutePath.make(path.join(directory, ".claude")),
|
|
|
+ AbsolutePath.make(path.join(root, ".claude")),
|
|
|
+ ])
|
|
|
expect(documents.map((document) => document.info.$schema)).toEqual([
|
|
|
"global",
|
|
|
"root",
|
|
|
@@ -887,6 +906,12 @@ describe("Config", () => {
|
|
|
"directory-dot",
|
|
|
])
|
|
|
expect(entries.map((entry) => (entry.type === "document" ? entry.info.$schema : entry.path))).toEqual([
|
|
|
+ AbsolutePath.make(globalClaude),
|
|
|
+ AbsolutePath.make(path.join(directory, ".claude")),
|
|
|
+ AbsolutePath.make(path.join(root, ".claude")),
|
|
|
+ AbsolutePath.make(globalAgents),
|
|
|
+ AbsolutePath.make(path.join(directory, ".agents")),
|
|
|
+ AbsolutePath.make(path.join(root, ".agents")),
|
|
|
"global",
|
|
|
AbsolutePath.make(global),
|
|
|
"root",
|