@pmelab/gtd 20.0.0 → 20.0.1

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gtd",
3
- "version": "20.0.0",
3
+ "version": "20.0.1",
4
4
  "description": "Drive the gtd loop inside Claude Code: agent turns run as subagents, gtd decides every beat",
5
5
  "author": {
6
6
  "name": "Philipp Melab"
@@ -1,5 +1,3 @@
1
- import { isAbsolute, relative, resolve } from "node:path"
2
-
3
1
  import { globMatches } from "../../src/replay/Glob.js"
4
2
 
5
3
  export type AccessDef = { read: string[] | null; write: string[] | null }
@@ -12,10 +10,19 @@ const WRITE: Record<string, string> = {
12
10
  NotebookEdit: "notebook_path",
13
11
  }
14
12
 
13
+ // Hand-rolled because a hooks module may not import `node:path`.
14
+ const segments = (p: string): string[] =>
15
+ p.split("/").reduce<string[]>((out, s) => {
16
+ if (s === "..") out.pop()
17
+ else if (s && s !== ".") out.push(s)
18
+ return out
19
+ }, [])
20
+
15
21
  // Repo-relative form of a path; undefined when it lies outside the repo.
16
22
  const inRepo = (p: string, root: string): string | undefined => {
17
- const rel = relative(root, isAbsolute(p) ? p : resolve(root, p))
18
- return rel === ".." || rel.startsWith("../") || isAbsolute(rel) ? undefined : rel
23
+ const base = segments(root)
24
+ const target = segments(p.startsWith("/") ? p : `${root}/${p}`)
25
+ return base.every((s, i) => target[i] === s) ? target.slice(base.length).join("/") : undefined
19
26
  }
20
27
 
21
28
  const deny = (verb: string, path: string, globs: string[]) =>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pmelab/gtd",
3
- "version": "20.0.0",
3
+ "version": "20.0.1",
4
4
  "private": false,
5
5
  "description": "Git-aware CLI that emits the next prompt for an autonomous coding agent based on the current repository state",
6
6
  "bin": {