grounder 0.2.0 → 0.4.0

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.
Files changed (165) hide show
  1. package/README.md +179 -66
  2. package/dist/agents/claude.d.ts +1 -0
  3. package/dist/agents/claude.d.ts.map +1 -1
  4. package/dist/agents/claude.js +37 -13
  5. package/dist/agents/claude.js.map +1 -1
  6. package/dist/agents/cursor.d.ts +1 -0
  7. package/dist/agents/cursor.d.ts.map +1 -1
  8. package/dist/agents/cursor.js +37 -13
  9. package/dist/agents/cursor.js.map +1 -1
  10. package/dist/agents/hook-runtime.d.ts +65 -21
  11. package/dist/agents/hook-runtime.d.ts.map +1 -1
  12. package/dist/agents/hook-runtime.js +172 -31
  13. package/dist/agents/hook-runtime.js.map +1 -1
  14. package/dist/agents/index.d.ts +18 -0
  15. package/dist/agents/index.d.ts.map +1 -1
  16. package/dist/agents/index.js +27 -4
  17. package/dist/agents/index.js.map +1 -1
  18. package/dist/agents/install-command.d.ts +35 -0
  19. package/dist/agents/install-command.d.ts.map +1 -0
  20. package/dist/agents/install-command.js +65 -0
  21. package/dist/agents/install-command.js.map +1 -0
  22. package/dist/agents/types.d.ts +19 -1
  23. package/dist/agents/types.d.ts.map +1 -1
  24. package/dist/cli.js +62 -60
  25. package/dist/cli.js.map +1 -1
  26. package/dist/commands/apply-agent-installs.d.ts +34 -0
  27. package/dist/commands/apply-agent-installs.d.ts.map +1 -0
  28. package/dist/commands/apply-agent-installs.js +137 -0
  29. package/dist/commands/apply-agent-installs.js.map +1 -0
  30. package/dist/commands/doctor.d.ts.map +1 -1
  31. package/dist/commands/doctor.js +278 -60
  32. package/dist/commands/doctor.js.map +1 -1
  33. package/dist/commands/handoff/list.d.ts +15 -7
  34. package/dist/commands/handoff/list.d.ts.map +1 -1
  35. package/dist/commands/handoff/list.js +21 -13
  36. package/dist/commands/handoff/list.js.map +1 -1
  37. package/dist/commands/handoff/peek.d.ts +5 -2
  38. package/dist/commands/handoff/peek.d.ts.map +1 -1
  39. package/dist/commands/handoff/peek.js +47 -6
  40. package/dist/commands/handoff/peek.js.map +1 -1
  41. package/dist/commands/handoff.d.ts.map +1 -1
  42. package/dist/commands/handoff.js +5 -0
  43. package/dist/commands/handoff.js.map +1 -1
  44. package/dist/commands/migrate.d.ts +23 -0
  45. package/dist/commands/migrate.d.ts.map +1 -0
  46. package/dist/commands/migrate.js +104 -0
  47. package/dist/commands/migrate.js.map +1 -0
  48. package/dist/commands/note/list.d.ts +28 -0
  49. package/dist/commands/note/list.d.ts.map +1 -0
  50. package/dist/commands/note/list.js +72 -0
  51. package/dist/commands/note/list.js.map +1 -0
  52. package/dist/commands/note.d.ts.map +1 -1
  53. package/dist/commands/note.js +6 -1
  54. package/dist/commands/note.js.map +1 -1
  55. package/dist/commands/output.d.ts +27 -0
  56. package/dist/commands/output.d.ts.map +1 -0
  57. package/dist/commands/output.js +51 -0
  58. package/dist/commands/output.js.map +1 -0
  59. package/dist/commands/package-version-notice.d.ts +18 -0
  60. package/dist/commands/package-version-notice.d.ts.map +1 -0
  61. package/dist/commands/package-version-notice.js +39 -0
  62. package/dist/commands/package-version-notice.js.map +1 -0
  63. package/dist/commands/path/logs.d.ts +1 -1
  64. package/dist/commands/path/logs.d.ts.map +1 -1
  65. package/dist/commands/path/logs.js +6 -1
  66. package/dist/commands/path/logs.js.map +1 -1
  67. package/dist/commands/path/notes.d.ts +1 -1
  68. package/dist/commands/path/notes.d.ts.map +1 -1
  69. package/dist/commands/path/notes.js +6 -1
  70. package/dist/commands/path/notes.js.map +1 -1
  71. package/dist/commands/path/plans.d.ts +7 -0
  72. package/dist/commands/path/plans.d.ts.map +1 -0
  73. package/dist/commands/path/plans.js +22 -0
  74. package/dist/commands/path/plans.js.map +1 -0
  75. package/dist/commands/plan/list.d.ts +31 -0
  76. package/dist/commands/plan/list.d.ts.map +1 -0
  77. package/dist/commands/plan/list.js +75 -0
  78. package/dist/commands/plan/list.js.map +1 -0
  79. package/dist/commands/plan.d.ts +34 -0
  80. package/dist/commands/plan.d.ts.map +1 -0
  81. package/dist/commands/plan.js +121 -0
  82. package/dist/commands/plan.js.map +1 -0
  83. package/dist/commands/repo/init.d.ts.map +1 -1
  84. package/dist/commands/repo/init.js +12 -1
  85. package/dist/commands/repo/init.js.map +1 -1
  86. package/dist/commands/status.d.ts +1 -1
  87. package/dist/commands/status.d.ts.map +1 -1
  88. package/dist/commands/status.js +62 -18
  89. package/dist/commands/status.js.map +1 -1
  90. package/dist/commands/upgrade-banner.d.ts +9 -0
  91. package/dist/commands/upgrade-banner.d.ts.map +1 -0
  92. package/dist/commands/upgrade-banner.js +27 -0
  93. package/dist/commands/upgrade-banner.js.map +1 -0
  94. package/dist/commands/vault/init.d.ts.map +1 -1
  95. package/dist/commands/vault/init.js +18 -29
  96. package/dist/commands/vault/init.js.map +1 -1
  97. package/dist/connector/repo.d.ts +2 -0
  98. package/dist/connector/repo.d.ts.map +1 -1
  99. package/dist/connector/repo.js +12 -1
  100. package/dist/connector/repo.js.map +1 -1
  101. package/dist/connector/state.d.ts +86 -0
  102. package/dist/connector/state.d.ts.map +1 -0
  103. package/dist/connector/state.js +171 -0
  104. package/dist/connector/state.js.map +1 -0
  105. package/dist/connector/unsupported-schema.d.ts +9 -0
  106. package/dist/connector/unsupported-schema.d.ts.map +1 -0
  107. package/dist/connector/unsupported-schema.js +14 -0
  108. package/dist/connector/unsupported-schema.js.map +1 -0
  109. package/dist/connector/vault.d.ts +2 -0
  110. package/dist/connector/vault.d.ts.map +1 -1
  111. package/dist/connector/vault.js +6 -1
  112. package/dist/connector/vault.js.map +1 -1
  113. package/dist/help.d.ts +45 -0
  114. package/dist/help.d.ts.map +1 -0
  115. package/dist/help.js +368 -0
  116. package/dist/help.js.map +1 -0
  117. package/dist/util/fs.d.ts +6 -0
  118. package/dist/util/fs.d.ts.map +1 -1
  119. package/dist/util/fs.js +15 -1
  120. package/dist/util/fs.js.map +1 -1
  121. package/dist/util/hash.d.ts +3 -0
  122. package/dist/util/hash.d.ts.map +1 -0
  123. package/dist/util/hash.js +6 -0
  124. package/dist/util/hash.js.map +1 -0
  125. package/dist/util/parse-args.d.ts.map +1 -1
  126. package/dist/util/parse-args.js +11 -2
  127. package/dist/util/parse-args.js.map +1 -1
  128. package/dist/util/path.d.ts +10 -0
  129. package/dist/util/path.d.ts.map +1 -1
  130. package/dist/util/path.js +31 -0
  131. package/dist/util/path.js.map +1 -1
  132. package/dist/util/plan-name.d.ts +10 -0
  133. package/dist/util/plan-name.d.ts.map +1 -0
  134. package/dist/util/plan-name.js +18 -0
  135. package/dist/util/plan-name.js.map +1 -0
  136. package/dist/util/semver.d.ts +10 -0
  137. package/dist/util/semver.d.ts.map +1 -0
  138. package/dist/util/semver.js +40 -0
  139. package/dist/util/semver.js.map +1 -0
  140. package/dist/vault/layout.d.ts +2 -0
  141. package/dist/vault/layout.d.ts.map +1 -1
  142. package/dist/vault/layout.js +4 -0
  143. package/dist/vault/layout.js.map +1 -1
  144. package/dist/vault/list-notes.d.ts +15 -0
  145. package/dist/vault/list-notes.d.ts.map +1 -0
  146. package/dist/vault/list-notes.js +44 -0
  147. package/dist/vault/list-notes.js.map +1 -0
  148. package/dist/vault/list-plans.d.ts +11 -0
  149. package/dist/vault/list-plans.d.ts.map +1 -0
  150. package/dist/vault/list-plans.js +40 -0
  151. package/dist/vault/list-plans.js.map +1 -0
  152. package/dist/vault/write-plan.d.ts +28 -0
  153. package/dist/vault/write-plan.d.ts.map +1 -0
  154. package/dist/vault/write-plan.js +61 -0
  155. package/dist/vault/write-plan.js.map +1 -0
  156. package/package.json +5 -3
  157. package/templates/agents/claude/commands/grounder-note.md +25 -3
  158. package/templates/agents/claude/commands/grounder-plan.md +69 -0
  159. package/templates/agents/claude/commands/grounder-task-handoff.md +3 -3
  160. package/templates/agents/claude/commands/grounder-task.md +5 -3
  161. package/templates/agents/cursor/commands/grounder-note.md +26 -4
  162. package/templates/agents/cursor/commands/grounder-plan.md +69 -0
  163. package/templates/agents/cursor/commands/grounder-task-handoff.md +4 -4
  164. package/templates/agents/cursor/commands/grounder-task.md +6 -4
  165. package/templates/vault/plan.md +16 -0
@@ -1,11 +1,33 @@
1
1
  Save a note to the Obsidian vault for this project.
2
2
 
3
- Run from the linked project folder or any subdirectory beneath it:
3
+ Distill the instruction after `/grounder-note` into a clean note body — not a chat transcript.
4
+ Do not dump tool traces, full conversation, or false starts.
4
5
 
5
- npx grounder note "<user text>"
6
+ **Special case: the instruction asks to view existing notes, not write one** (`list`, `list 3 oldest`, `show notes`, etc.) → run `{{GROUNDER_CLI}} note list --limit <N>` (N = count named, else 5; ignore order words like "oldest" — output is always newest-first, never resort or relabel it) and stop — no note write. Relay the CLI stdout as-is (it already includes the count header).
6
7
 
7
- The vault is outside the workspace — approve shell permissions if Cursor prompts you.
8
+ Rules:
9
+ - Default → distill the args into a clean note body
10
+ - Exact wording marked to keep (quoted, "save exactly:"/"verbatim:", or a fenced block) → use that verbatim instead, unmodified
11
+ - Empty args → distill the central point of the current thread instead
12
+
13
+ Then run from the linked project folder or any subdirectory beneath it:
14
+
15
+ {{GROUNDER_CLI}} note "<body>"
16
+
17
+ Optional short title slug (filename):
18
+
19
+ {{GROUNDER_CLI}} note --title <slug> "<body>"
20
+
21
+ For multi-line bodies, prefer a shell heredoc so quoting does not break:
22
+
23
+ ```bash
24
+ {{GROUNDER_CLI}} note "$(cat <<'EOF'
25
+
26
+ EOF
27
+ )"
28
+ ```
29
+
30
+ Run {{GROUNDER_CLI}} with `required_permissions: ["all"]` (vault is outside the workspace).
8
31
 
9
- Use the text after `/grounder-note` as the note body.
10
32
  Do not compute vault paths or write files yourself — the CLI handles it.
11
33
  Report the CLI output path from stdout to the user.
@@ -0,0 +1,69 @@
1
+ Write a named, updatable plan document to the Obsidian vault for this project.
2
+
3
+ Distill the instruction after `/grounder-plan` into a structured plan — not a chat transcript.
4
+ Do not dump tool traces, full conversation, or false starts.
5
+
6
+ Build a markdown body with these sections:
7
+
8
+ ```markdown
9
+ # Plan: <title>
10
+
11
+ ## Goal
12
+
13
+
14
+ ## Steps
15
+ 1. …
16
+ 2. …
17
+
18
+ ## Decisions / open questions
19
+ - …
20
+
21
+ ## Status
22
+
23
+ ```
24
+
25
+ **Special case: the instruction asks to view existing plans, not name a new topic** (`list`, `list 3 oldest`, `show plans`, etc.) → run `{{GROUNDER_CLI}} plan list --limit <N>` (N = count named, else 5; ignore order words like "oldest" — output is always newest-first, never resort or relabel it) and stop — no plan write, no title. Relay the CLI stdout as-is (it already includes the count header).
26
+
27
+ Otherwise, resolve the target, then **state it plainly before writing** — `Updating plan at <path>.` or `Creating new plan titled <title>.` This is a visible record, not a blocking confirmation — updates overwrite with no `--force`, so get the match right.
28
+
29
+ **1. Known path** (attached/open in chat, or printed by an earlier `grounder plan` this conversation) → update it directly.
30
+
31
+ **2. No path, but update intent** (e.g. "update/continue/revise the plan", or a name that sounds like an existing one) → look it up first:
32
+
33
+ ```bash
34
+ {{GROUNDER_CLI}} plan list --limit 5
35
+ ```
36
+
37
+ CLI output starts with a count header, then each result as a numbered two-line block — `N. ` + title (filename stem) on the first line, the absolute path indented beneath it.
38
+
39
+ A match counts only if its title actually corresponds to what the user named — not just "it's the only plan in the project." No name given and exactly one plan exists → that counts too. If the user refers to a plan by the number shown in *this* listing (e.g. "update plan 2"), that counts as a match too — resolve it to the path from this same output, don't reuse a number from an earlier listing in the conversation (it's positional, not a stable id, and can shift if plans changed since). Otherwise (no match, several matches, or a name/number that doesn't correspond to any existing plan) → ask; never guess.
40
+
41
+ Cases 1 and 2 (update) — run:
42
+
43
+ ```bash
44
+ {{GROUNDER_CLI}} plan "$(cat <<'EOF'
45
+ # Plan: …
46
+
47
+ EOF
48
+ )" --path <path>
49
+ ```
50
+
51
+ `--path` must resolve under this project's `plans/` dir; it always overwrites (no `--force`).
52
+
53
+ **3. No path, no update intent → genuinely new plan.** Derive a `--title` (the user's explicit name, else a short kebab-case slug from the plan's title/goal) and write immediately — don't ask about the name itself.
54
+
55
+ ```bash
56
+ {{GROUNDER_CLI}} plan "$(cat <<'EOF'
57
+ # Plan: …
58
+
59
+ EOF
60
+ )" --title <name>
61
+ ```
62
+
63
+ If `--title` collides with an existing plan (non-zero exit; stderr names the conflict), ask: overwrite (`--force`) or a different name. `--force` only resolves that collision — **never** use it to update a plan you meant to target with `--path`.
64
+
65
+ Run from the linked project folder or any subdirectory beneath it.
66
+ Run {{GROUNDER_CLI}} with `required_permissions: ["all"]` (vault is outside the workspace).
67
+
68
+ Do not compute vault paths or write files yourself — the CLI handles it.
69
+ Report the exact path the CLI prints on stdout — it confirms the real outcome, not just the intent.
@@ -32,23 +32,23 @@ Rules:
32
32
 
33
33
  Then run from the linked project folder or any subdirectory beneath it:
34
34
 
35
- npx grounder handoff "<body>"
35
+ {{GROUNDER_CLI}} handoff "<body>"
36
36
 
37
37
  Optional short title slug (filename + frontmatter):
38
38
 
39
- npx grounder handoff --title <slug> "<body>"
39
+ {{GROUNDER_CLI}} handoff --title <slug> "<body>"
40
40
 
41
41
  For multi-line bodies, prefer a shell heredoc so quoting does not break:
42
42
 
43
43
  ```bash
44
- npx grounder handoff "$(cat <<'EOF'
44
+ {{GROUNDER_CLI}} handoff "$(cat <<'EOF'
45
45
  # Handoff: …
46
46
 
47
47
  EOF
48
48
  )"
49
49
  ```
50
50
 
51
- The vault is outside the workspace — approve shell permissions if Cursor prompts you.
51
+ Run {{GROUNDER_CLI}} with `required_permissions: ["all"]` (vault is outside the workspace).
52
52
 
53
53
  Do not compute vault paths or write files yourself — the CLI handles it.
54
54
  Report the CLI output path from stdout to the user.
@@ -2,19 +2,21 @@ Hydrate this session from the latest vault handoff and repo truth.
2
2
 
3
3
  Read-only — do not write to the vault. Do not invent vault paths.
4
4
 
5
- From the linked project folder or any subdirectory beneath it:
5
+ **Special case: the instruction asks to view existing handoffs, not hydrate** (`list`, `list 3 oldest`, `show handoffs`, etc.) → run `{{GROUNDER_CLI}} handoff list --limit <N>` (N = count named, else 5; ignore order words like "oldest" — output is always newest-first, never resort or relabel it) and stop — no hydrate, no `AGENTS.md`, no “start work.” Relay the CLI stdout as-is (it already includes the count header).
6
+
7
+ Otherwise, from the linked project folder or any subdirectory beneath it:
6
8
 
7
9
  1. Get the current handoff (skips empty/unreadable files, same pick as the session-start teaser):
8
10
 
9
- npx grounder handoff list --head
11
+ {{GROUNDER_CLI}} handoff list --head
10
12
 
11
13
  2. If empty: tell the user there are no handoffs yet, then read repo `AGENTS.md` only and proceed.
12
14
 
13
- 3. Otherwise, read that file. If the user names a specific session instead, run `npx grounder handoff list --limit 5` and read the path they mean.
15
+ 3. Otherwise, read that file. If the user names a specific session instead: `{{GROUNDER_CLI}} handoff list --limit 5` match name/index to the indented path in *this* listing (positional, not a stable id). Miss → once with `--limit 50` (*that* listing only). Still miss → tell the user and stop — no guessed hydrate.
14
16
 
15
17
  4. Read repo `AGENTS.md` (project conventions and constraints).
16
18
 
17
19
  5. Summarize briefly what is next (from the handoff `## Next` section when present), then start work.
18
20
 
19
- The vault is outside the workspace — approve shell permissions if Cursor prompts you.
21
+ Run {{GROUNDER_CLI}} with `required_permissions: ["all"]` (vault is outside the workspace).
20
22
  Use free-text after `/grounder-task` as optional focus (session name, index, or task hint).
@@ -0,0 +1,16 @@
1
+ <!-- Reference shape for /grounder-plan. Not installed or filled by the CLI — slash commands embed this structure. -->
2
+
3
+ # Plan: <title>
4
+
5
+ ## Goal
6
+
7
+
8
+ ## Steps
9
+ 1. …
10
+ 2. …
11
+
12
+ ## Decisions / open questions
13
+ - …
14
+
15
+ ## Status
16
+