@markjaquith/agency 1.8.3 → 1.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markjaquith/agency",
3
- "version": "1.8.3",
3
+ "version": "1.8.4",
4
4
  "description": "Manages personal agents files",
5
5
  "keywords": [
6
6
  "agents",
@@ -367,5 +367,37 @@ describe("emit command", () => {
367
367
  // This is the key assertion - the symlink target should be filtered too
368
368
  expect(lastCall!.args).toContain("AGENTS.md")
369
369
  })
370
+
371
+ test("expands injected dot-directory globs into filter paths", async () => {
372
+ await checkoutBranch(tempDir, "main")
373
+ await createBranch(tempDir, "agency--dotdir-test")
374
+
375
+ await Bun.spawn(["mkdir", "-p", join(tempDir, ".agents", "foo")], {
376
+ stdout: "pipe",
377
+ stderr: "pipe",
378
+ }).exited
379
+
380
+ await Bun.write(
381
+ join(tempDir, "agency.json"),
382
+ JSON.stringify({
383
+ version: 1,
384
+ injectedFiles: [".agents/**"],
385
+ template: "test",
386
+ createdAt: new Date().toISOString(),
387
+ }),
388
+ )
389
+ await Bun.write(join(tempDir, ".agents", "foo", "bar.whatever"), "test\n")
390
+ await addAndCommit(
391
+ tempDir,
392
+ ["agency.json", ".agents/foo/bar.whatever"],
393
+ "Add template dot-directory file",
394
+ )
395
+
396
+ await runTestEffectWithMockFilterRepo(emit({ silent: true }))
397
+
398
+ const lastCall = getLastCapturedFilterRepoCall()
399
+ expect(lastCall).toBeDefined()
400
+ expect(lastCall!.args).toContain(".agents/foo/bar.whatever")
401
+ })
370
402
  })
371
403
  })
@@ -97,10 +97,12 @@ describe("expandGlobs", () => {
97
97
  await mkdir(join(tempDir, "plans"))
98
98
  await mkdir(join(tempDir, "plans", "sub"))
99
99
  await mkdir(join(tempDir, "other"))
100
+ await mkdir(join(tempDir, ".agents", "foo"), { recursive: true })
100
101
 
101
102
  await writeFile(join(tempDir, "plans", "foo.md"), "foo")
102
103
  await writeFile(join(tempDir, "plans", "sub", "bar.md"), "bar")
103
104
  await writeFile(join(tempDir, "other", "baz.md"), "baz")
105
+ await writeFile(join(tempDir, ".agents", "foo", "bar.whatever"), "dot")
104
106
  await writeFile(join(tempDir, "root.txt"), "root")
105
107
  })
106
108
 
@@ -151,4 +153,9 @@ describe("expandGlobs", () => {
151
153
  ["plans/foo.md", "plans/sub/bar.md", "other/baz.md"].sort(),
152
154
  )
153
155
  })
156
+
157
+ test("expands glob patterns inside dot-directories", async () => {
158
+ const files = await expandGlobs([".agents/**"], tempDir)
159
+ expect(files).toEqual([".agents/foo/bar.whatever"])
160
+ })
154
161
  })
package/src/utils/glob.ts CHANGED
@@ -38,7 +38,7 @@ export async function expandGlobs(
38
38
  if (isGlobPattern(pattern)) {
39
39
  // Expand glob pattern
40
40
  const glob = new Bun.Glob(pattern)
41
- for await (const file of glob.scan({ cwd })) {
41
+ for await (const file of glob.scan({ cwd, dot: true })) {
42
42
  files.add(file)
43
43
  }
44
44
  } else {