agent-watch 1.0.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 (77) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/LICENSE +21 -0
  3. package/README.md +95 -0
  4. package/dist/cli-nMe9-VkJ.d.ts +1 -0
  5. package/dist/cli.cjs +770 -0
  6. package/dist/cli.cjs.map +1 -0
  7. package/dist/cli.d.ts +3 -0
  8. package/dist/cli.d.ts.map +1 -0
  9. package/dist/cli.js +771 -0
  10. package/dist/cli.js.map +1 -0
  11. package/dist/commands/init.d.ts +2 -0
  12. package/dist/commands/init.d.ts.map +1 -0
  13. package/dist/commands/run.d.ts +5 -0
  14. package/dist/commands/run.d.ts.map +1 -0
  15. package/dist/config.d.ts +31 -0
  16. package/dist/config.d.ts.map +1 -0
  17. package/dist/constants.d.ts +21 -0
  18. package/dist/constants.d.ts.map +1 -0
  19. package/dist/detect-BMnM34-m.cjs +177 -0
  20. package/dist/detect-BMnM34-m.cjs.map +1 -0
  21. package/dist/detect-BWGm1KGQ.js +122 -0
  22. package/dist/detect-BWGm1KGQ.js.map +1 -0
  23. package/dist/detect-B_DDBj5N.cjs +182 -0
  24. package/dist/detect-B_DDBj5N.cjs.map +1 -0
  25. package/dist/detect-CPW1RRIq.js +117 -0
  26. package/dist/detect-CPW1RRIq.js.map +1 -0
  27. package/dist/detect-Dii2e4wf.cjs +174 -0
  28. package/dist/detect-Dii2e4wf.cjs.map +1 -0
  29. package/dist/detect-Pkaqn3YG.js +120 -0
  30. package/dist/detect-Pkaqn3YG.js.map +1 -0
  31. package/dist/detect.d.ts +16 -0
  32. package/dist/detect.d.ts.map +1 -0
  33. package/dist/hooks.d.ts +13 -0
  34. package/dist/hooks.d.ts.map +1 -0
  35. package/dist/index-CXIlEXUx.d.ts +51 -0
  36. package/dist/index.cjs +13 -0
  37. package/dist/index.cjs.map +1 -0
  38. package/dist/index.d.cts +5 -0
  39. package/dist/index.d.ts +5 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.js +3 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/logger-BNjXChov.js +164 -0
  44. package/dist/logger-BNjXChov.js.map +1 -0
  45. package/dist/logger-CdAUnlsG.cjs +271 -0
  46. package/dist/logger-CdAUnlsG.cjs.map +1 -0
  47. package/dist/logger-hSIaaw_k.js +166 -0
  48. package/dist/logger-hSIaaw_k.js.map +1 -0
  49. package/dist/logger-oq2Z7oYf.cjs +269 -0
  50. package/dist/logger-oq2Z7oYf.cjs.map +1 -0
  51. package/dist/sessions-90kmJrQI.js +360 -0
  52. package/dist/sessions-90kmJrQI.js.map +1 -0
  53. package/dist/sessions-Bmk48zTI.js +311 -0
  54. package/dist/sessions-Bmk48zTI.js.map +1 -0
  55. package/dist/sessions-BpNk9YjU.cjs +431 -0
  56. package/dist/sessions-BpNk9YjU.cjs.map +1 -0
  57. package/dist/sessions-CkCQikpl.cjs +444 -0
  58. package/dist/sessions-CkCQikpl.cjs.map +1 -0
  59. package/dist/sessions-Cy-_zIh6.js +315 -0
  60. package/dist/sessions-Cy-_zIh6.js.map +1 -0
  61. package/dist/sessions-DZgPENb6.cjs +434 -0
  62. package/dist/sessions-DZgPENb6.cjs.map +1 -0
  63. package/dist/sessions-_HBb3nIW.cjs +495 -0
  64. package/dist/sessions-_HBb3nIW.cjs.map +1 -0
  65. package/dist/sessions-tBeR9gKG.js +308 -0
  66. package/dist/sessions-tBeR9gKG.js.map +1 -0
  67. package/dist/utils/copilot.d.ts +27 -0
  68. package/dist/utils/copilot.d.ts.map +1 -0
  69. package/dist/utils/git.d.ts +35 -0
  70. package/dist/utils/git.d.ts.map +1 -0
  71. package/dist/utils/gitignore.d.ts +5 -0
  72. package/dist/utils/gitignore.d.ts.map +1 -0
  73. package/dist/utils/logger.d.ts +14 -0
  74. package/dist/utils/logger.d.ts.map +1 -0
  75. package/dist/utils/sessions.d.ts +48 -0
  76. package/dist/utils/sessions.d.ts.map +1 -0
  77. package/package.json +79 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,39 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.0] - 2026-02-15
9
+
10
+ ### Added
11
+
12
+ - Initial release of agent-watch
13
+ - CLI tool for keeping AI agent configuration files in sync with your codebase
14
+ - Interactive setup command `agent-watch init` with guided configuration
15
+ - Git hook integration with auto-detection for:
16
+ - Lefthook
17
+ - Husky
18
+ - Direct `.git/hooks/` installation
19
+ - Support for multiple AI agent configuration files:
20
+ - `CLAUDE.md` (Claude Code)
21
+ - `.github/copilot-instructions.md` and `copilot-instructions.md` (GitHub Copilot)
22
+ - `AGENTS.md` / `agents.md` (Generic)
23
+ - `.cursorrules` / `.cursor/rules` (Cursor)
24
+ - `.windsurfrules` (Windsurf)
25
+ - `.clinerules` (Cline)
26
+ - Git context gathering from:
27
+ - Commit messages
28
+ - Changed files
29
+ - AI chat sessions (GitHub Copilot CLI support)
30
+ - Smart filtering to skip runs when only documentation/config files are modified
31
+ - Configurable hook triggers (post-commit or pre-push)
32
+ - Programmatic API for library usage:
33
+ - `loadConfig()` - Load agent-watch configuration
34
+ - `detectAgentFiles()` - Auto-detect agent files in project
35
+ - `KNOWN_AGENT_FILES` - List of supported agent file patterns
36
+ - Idempotent hook installation (safe to re-run)
37
+ - Configuration file `.agent-watch.json` for project settings
38
+
39
+ [1.0.0]: https://github.com/surnr/agent-watch/releases/tag/v1.0.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Agent Watch Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,95 @@
1
+ # Agent Watch
2
+
3
+ CLI tool that uses git hooks to keep your AI agent configuration files in sync with your codebase. It watches for commits or pushes, gathers context from git changes and chat sessions, and automatically updates your agent files.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g agent-watch
9
+ ```
10
+
11
+ Or run directly:
12
+
13
+ ```bash
14
+ npx agent-watch init
15
+ ```
16
+
17
+ ## Quick start
18
+
19
+ ```bash
20
+ cd your-project
21
+ agent-watch init
22
+ ```
23
+
24
+ The `init` command walks you through an interactive setup:
25
+
26
+ 1. **Select agent files** - auto-detects existing files and lets you pick which ones to manage (space to toggle, enter to confirm)
27
+ 2. **Git context** - choose whether to use commit messages and chat sessions when updating files
28
+ 3. **Hook trigger** - pick when to run: after `git commit` or before `git push`
29
+ 4. **AI agents** - select which agent integrations to enable (GitHub Copilot CLI, more coming)
30
+
31
+ Your choices are saved to `.agent-watch.json` in the project root.
32
+
33
+ ## Supported agent files
34
+
35
+ | File | Agent |
36
+ | --------------------------------- | -------------- |
37
+ | `CLAUDE.md` | Claude Code |
38
+ | `.github/copilot-instructions.md` | GitHub Copilot |
39
+ | `copilot-instructions.md` | GitHub Copilot |
40
+ | `AGENTS.md` / `agents.md` | Generic |
41
+ | `.cursorrules` / `.cursor/rules` | Cursor |
42
+ | `.windsurfrules` | Windsurf |
43
+ | `.clinerules` | Cline |
44
+
45
+ ## How it works
46
+
47
+ After running `agent-watch init`:
48
+
49
+ - A git hook is installed (or instructions are provided if you use lefthook/husky)
50
+ - On each commit or push (depending on your config), agent-watch gathers context from:
51
+ - Changed files in the commit
52
+ - Git commit messages
53
+ - Chat sessions from supported AI tools
54
+ - It uses this context to update your selected agent configuration files
55
+
56
+ **Smart filtering**: agent-watch automatically skips running when only documentation or config files are modified (like README.md, .gitignore, lock files, etc.), keeping your workflow fast.
57
+
58
+ ## Configuration
59
+
60
+ The `.agent-watch.json` config file:
61
+
62
+ ```json
63
+ {
64
+ "version": 1,
65
+ "agentFiles": ["CLAUDE.md", ".github/copilot-instructions.md"],
66
+ "useGitContext": true,
67
+ "hookTrigger": "commit",
68
+ "agents": ["github-copilot-cli"]
69
+ }
70
+ ```
71
+
72
+ ## Git hook integration
73
+
74
+ agent-watch detects your existing hook manager:
75
+
76
+ - **Lefthook** - prints the config to add to `lefthook.yml`
77
+ - **Husky** - prints the `npx husky add` command to run
78
+ - **No hook manager** - installs directly to `.git/hooks/`
79
+
80
+ The hook is idempotent and can be safely re-run.
81
+
82
+ ## Programmatic API
83
+
84
+ You can also use agent-watch as a library:
85
+
86
+ ```ts
87
+ import { loadConfig, detectAgentFiles, KNOWN_AGENT_FILES } from "agent-watch"
88
+
89
+ const config = loadConfig("./my-project")
90
+ const files = detectAgentFiles("./my-project")
91
+ ```
92
+
93
+ ## License
94
+
95
+ MIT
@@ -0,0 +1 @@
1
+ export { };