universal-agent-memory 0.1.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 (96) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +321 -0
  3. package/dist/analyzers/index.d.ts +3 -0
  4. package/dist/analyzers/index.d.ts.map +1 -0
  5. package/dist/analyzers/index.js +373 -0
  6. package/dist/analyzers/index.js.map +1 -0
  7. package/dist/bin/cli.d.ts +3 -0
  8. package/dist/bin/cli.d.ts.map +1 -0
  9. package/dist/bin/cli.js +119 -0
  10. package/dist/bin/cli.js.map +1 -0
  11. package/dist/cli/analyze.d.ts +7 -0
  12. package/dist/cli/analyze.d.ts.map +1 -0
  13. package/dist/cli/analyze.js +103 -0
  14. package/dist/cli/analyze.js.map +1 -0
  15. package/dist/cli/droids.d.ts +9 -0
  16. package/dist/cli/droids.d.ts.map +1 -0
  17. package/dist/cli/droids.js +227 -0
  18. package/dist/cli/droids.js.map +1 -0
  19. package/dist/cli/generate.d.ts +9 -0
  20. package/dist/cli/generate.d.ts.map +1 -0
  21. package/dist/cli/generate.js +203 -0
  22. package/dist/cli/generate.js.map +1 -0
  23. package/dist/cli/init.d.ts +12 -0
  24. package/dist/cli/init.d.ts.map +1 -0
  25. package/dist/cli/init.js +260 -0
  26. package/dist/cli/init.js.map +1 -0
  27. package/dist/cli/memory.d.ts +15 -0
  28. package/dist/cli/memory.d.ts.map +1 -0
  29. package/dist/cli/memory.js +274 -0
  30. package/dist/cli/memory.js.map +1 -0
  31. package/dist/cli/sync.d.ts +7 -0
  32. package/dist/cli/sync.d.ts.map +1 -0
  33. package/dist/cli/sync.js +26 -0
  34. package/dist/cli/sync.js.map +1 -0
  35. package/dist/cli/worktree.d.ts +9 -0
  36. package/dist/cli/worktree.d.ts.map +1 -0
  37. package/dist/cli/worktree.js +175 -0
  38. package/dist/cli/worktree.js.map +1 -0
  39. package/dist/generators/claude-md.d.ts +3 -0
  40. package/dist/generators/claude-md.d.ts.map +1 -0
  41. package/dist/generators/claude-md.js +643 -0
  42. package/dist/generators/claude-md.js.map +1 -0
  43. package/dist/index.d.ts +4 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +4 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/memory/backends/base.d.ts +18 -0
  48. package/dist/memory/backends/base.d.ts.map +1 -0
  49. package/dist/memory/backends/base.js +2 -0
  50. package/dist/memory/backends/base.js.map +1 -0
  51. package/dist/memory/backends/factory.d.ts +4 -0
  52. package/dist/memory/backends/factory.d.ts.map +1 -0
  53. package/dist/memory/backends/factory.js +52 -0
  54. package/dist/memory/backends/factory.js.map +1 -0
  55. package/dist/memory/backends/github.d.ts +22 -0
  56. package/dist/memory/backends/github.d.ts.map +1 -0
  57. package/dist/memory/backends/github.js +118 -0
  58. package/dist/memory/backends/github.js.map +1 -0
  59. package/dist/memory/backends/qdrant-cloud.d.ts +19 -0
  60. package/dist/memory/backends/qdrant-cloud.d.ts.map +1 -0
  61. package/dist/memory/backends/qdrant-cloud.js +111 -0
  62. package/dist/memory/backends/qdrant-cloud.js.map +1 -0
  63. package/dist/memory/prepopulate.d.ts +76 -0
  64. package/dist/memory/prepopulate.d.ts.map +1 -0
  65. package/dist/memory/prepopulate.js +815 -0
  66. package/dist/memory/prepopulate.js.map +1 -0
  67. package/dist/memory/short-term/factory.d.ts +23 -0
  68. package/dist/memory/short-term/factory.d.ts.map +1 -0
  69. package/dist/memory/short-term/factory.js +28 -0
  70. package/dist/memory/short-term/factory.js.map +1 -0
  71. package/dist/memory/short-term/indexeddb.d.ts +25 -0
  72. package/dist/memory/short-term/indexeddb.d.ts.map +1 -0
  73. package/dist/memory/short-term/indexeddb.js +64 -0
  74. package/dist/memory/short-term/indexeddb.js.map +1 -0
  75. package/dist/memory/short-term/sqlite.d.ts +40 -0
  76. package/dist/memory/short-term/sqlite.d.ts.map +1 -0
  77. package/dist/memory/short-term/sqlite.js +136 -0
  78. package/dist/memory/short-term/sqlite.js.map +1 -0
  79. package/dist/types/analysis.d.ts +82 -0
  80. package/dist/types/analysis.d.ts.map +1 -0
  81. package/dist/types/analysis.js +2 -0
  82. package/dist/types/analysis.js.map +1 -0
  83. package/dist/types/config.d.ts +923 -0
  84. package/dist/types/config.d.ts.map +1 -0
  85. package/dist/types/config.js +97 -0
  86. package/dist/types/config.js.map +1 -0
  87. package/dist/types/index.d.ts +3 -0
  88. package/dist/types/index.d.ts.map +1 -0
  89. package/dist/types/index.js +3 -0
  90. package/dist/types/index.js.map +1 -0
  91. package/dist/utils/merge-claude-md.d.ts +15 -0
  92. package/dist/utils/merge-claude-md.d.ts.map +1 -0
  93. package/dist/utils/merge-claude-md.js +149 -0
  94. package/dist/utils/merge-claude-md.js.map +1 -0
  95. package/package.json +90 -0
  96. package/templates/CLAUDE.template.md +632 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Dammian Miller
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,321 @@
1
+ # Universal Agent Memory
2
+
3
+ Universal AI agent memory system for Claude Code, Factory.AI, VSCode, OpenCode, and web-based LLMs.
4
+
5
+ Provides:
6
+ - **CLAUDE.md template system** with automatic project analysis and generation
7
+ - **Memory system** with flexible backends:
8
+ - **Desktop**: SQLite short-term + local Qdrant or cloud backends
9
+ - **Web**: IndexedDB short-term + GitHub/Qdrant Cloud long-term
10
+ - **Git worktree workflow** automation for isolated development
11
+ - **Cross-platform compatibility** for all major AI coding assistants (desktop and web)
12
+
13
+ ## Installation
14
+
15
+ ### Desktop (CLI)
16
+
17
+ ```bash
18
+ # Automatic installer with Docker detection
19
+ bash <(curl -fsSL https://raw.githubusercontent.com/DammianMiller/universal-agent-memory/main/scripts/install-desktop.sh)
20
+
21
+ # Or manually with npm
22
+ npm install -g @universal-agent-memory/cli
23
+
24
+ # Or use npx
25
+ npx @universal-agent-memory/cli init --desktop
26
+ ```
27
+
28
+ ### Web Browsers (claude.ai, factory.ai)
29
+
30
+ ```bash
31
+ # Quick web setup
32
+ bash <(curl -fsSL https://raw.githubusercontent.com/DammianMiller/universal-agent-memory/main/scripts/install-web.sh)
33
+
34
+ # Or manually
35
+ npx @universal-agent-memory/cli init --web
36
+ ```
37
+
38
+ Web installations use:
39
+ - **IndexedDB** for short-term memory (replaces SQLite)
40
+ - **GitHub** or **Qdrant Cloud** for long-term memory (opt-in via env vars)
41
+
42
+ ## Quick Start
43
+
44
+ ```bash
45
+ # Desktop initialization (default)
46
+ uam init --desktop
47
+
48
+ # Web initialization (for claude.ai, factory.ai)
49
+ uam init --web
50
+
51
+ # Interactive mode (asks questions)
52
+ uam init --interactive
53
+
54
+ # Or with specific options
55
+ uam init --platform factory --with-memory --with-worktrees
56
+ ```
57
+
58
+ This will:
59
+ 1. Analyze your project structure
60
+ 2. Generate a customized `CLAUDE.md`
61
+ 3. Set up platform-specific directories (`.factory/`, `.claude/`, etc.)
62
+ 4. Optionally configure memory system and worktree workflow
63
+
64
+ ## Commands
65
+
66
+ ### Initialize Project
67
+
68
+ ```bash
69
+ uam init [options]
70
+
71
+ Options:
72
+ -p, --platform <platforms...> Target platforms (claude, factory, vscode, opencode, claudeWeb, factoryWeb, all)
73
+ --desktop Desktop mode (SQLite + local Qdrant)
74
+ --web Web mode (IndexedDB + cloud backends)
75
+ --interactive Interactive setup with prompts
76
+ --with-memory Set up memory system
77
+ --with-worktrees Set up git worktree workflow
78
+ --force Overwrite existing configuration
79
+ ```
80
+
81
+ ### Analyze Project
82
+
83
+ ```bash
84
+ uam analyze [options]
85
+
86
+ Options:
87
+ -o, --output <format> Output format (json, yaml, md)
88
+ --save Save analysis to file
89
+ ```
90
+
91
+ ### Generate Files
92
+
93
+ ```bash
94
+ uam generate [options]
95
+
96
+ Options:
97
+ -f, --force Overwrite without confirmation
98
+ -d, --dry-run Preview without writing
99
+ -p, --platform Generate for specific platform only
100
+ ```
101
+
102
+ **Smart Merging**: When a `CLAUDE.md` or `AGENT.md` file already exists, the CLI will offer to:
103
+ - **Merge** (recommended): Updates standard sections while preserving your custom sections
104
+ - **Overwrite**: Replace the entire file with newly generated content
105
+ - **Cancel/Skip**: Leave the existing file unchanged
106
+
107
+ The merge strategy:
108
+ - Updates the preamble (project name, description) from new analysis
109
+ - Replaces standard sections (Memory System, Browser Usage, Quick Reference, etc.) with updated versions
110
+ - Preserves any custom sections you've added
111
+ - Appends custom sections at the end of the file
112
+
113
+ ### Memory Management
114
+
115
+ ```bash
116
+ # Check status
117
+ uam memory status
118
+
119
+ # Start memory services (Qdrant)
120
+ uam memory start
121
+
122
+ # Stop services
123
+ uam memory stop
124
+
125
+ # Query long-term memory
126
+ uam memory query "search term" --limit 10
127
+
128
+ # Store a memory
129
+ uam memory store "lesson learned" --tags "tag1,tag2" --importance 8
130
+ ```
131
+
132
+ ### Git Worktrees
133
+
134
+ ```bash
135
+ # Create new worktree
136
+ uam worktree create my-feature
137
+
138
+ # List worktrees
139
+ uam worktree list
140
+
141
+ # Create PR from worktree
142
+ uam worktree pr 001
143
+
144
+ # Cleanup after merge
145
+ uam worktree cleanup 001
146
+ ```
147
+
148
+ ### Droids/Agents
149
+
150
+ ```bash
151
+ # List available droids
152
+ uam droids list
153
+
154
+ # Add a new droid
155
+ uam droids add my-droid --template code-reviewer
156
+
157
+ # Import from another platform
158
+ uam droids import ~/.claude/agents/
159
+ ```
160
+
161
+ ### Platform Sync
162
+
163
+ ```bash
164
+ # Sync between platforms
165
+ uam sync --from claude --to factory
166
+ ```
167
+
168
+ ## Configuration
169
+
170
+ Configuration is stored in `.uam.json`:
171
+
172
+ ```json
173
+ {
174
+ "$schema": "https://raw.githubusercontent.com/DammianMiller/universal-agent-memory/main/schema.json",
175
+ "version": "1.0.0",
176
+ "project": {
177
+ "name": "my-project",
178
+ "description": "Project description",
179
+ "defaultBranch": "main"
180
+ },
181
+ "platform": "claudeCode",
182
+ "platforms": {
183
+ "claudeCode": { "enabled": true },
184
+ "claudeWeb": { "enabled": false },
185
+ "factory": { "enabled": true },
186
+ "factoryWeb": { "enabled": false },
187
+ "vscode": { "enabled": false },
188
+ "opencode": { "enabled": false }
189
+ },
190
+ "memory": {
191
+ "shortTerm": {
192
+ "enabled": true,
193
+ "path": "./agents/data/memory/short_term.db",
194
+ "maxEntries": 50,
195
+ "webDatabase": "agentContext",
196
+ "forceDesktop": false
197
+ },
198
+ "longTerm": {
199
+ "enabled": true,
200
+ "provider": "qdrant",
201
+ "endpoint": "localhost:6333",
202
+ "collection": "agent_memory",
203
+ "github": {
204
+ "enabled": false,
205
+ "repo": "owner/repo",
206
+ "path": ".uam/memory"
207
+ },
208
+ "qdrantCloud": {
209
+ "enabled": false,
210
+ "url": "https://xxxxx.aws.cloud.qdrant.io:6333",
211
+ "collection": "agent_memory"
212
+ }
213
+ }
214
+ },
215
+ "worktrees": {
216
+ "enabled": true,
217
+ "directory": ".worktrees",
218
+ "branchPrefix": "feature/"
219
+ }
220
+ }
221
+ ```
222
+
223
+ ## Platform Support
224
+
225
+ | Platform | Environment | Context File | Agents | Commands |
226
+ |----------|-------------|--------------|--------|----------|
227
+ | Claude Code | Desktop | `CLAUDE.md` | `.claude/agents/` | `.claude/commands/` |
228
+ | claude.ai | Web | `CLAUDE.md` | Project context | N/A |
229
+ | Factory.AI | Desktop | `CLAUDE.md` | `.factory/droids/` | `.factory/commands/` |
230
+ | factory.ai | Web | `CLAUDE.md` | Project context | N/A |
231
+ | VSCode | Desktop | `CLAUDE.md` | Extension-based | Tasks |
232
+ | OpenCode | Desktop | `opencode.json` | `.opencode/agent/` | `.opencode/command/` |
233
+
234
+ ## Built-in Droid Templates
235
+
236
+ - `code-reviewer` - Reviews diffs for correctness and risks
237
+ - `security-reviewer` - Finds security issues in code
238
+ - `performance-reviewer` - Identifies performance bottlenecks
239
+ - `test-writer` - Generates unit tests
240
+
241
+ ## Memory System
242
+
243
+ ### Desktop Environments
244
+
245
+ #### Short-term Memory (SQLite)
246
+
247
+ Stores the last 50 actions/observations for immediate context. Automatically pruned.
248
+
249
+ Location: `./agents/data/memory/short_term.db`
250
+
251
+ #### Long-term Memory
252
+
253
+ **Local Qdrant** (requires Docker):
254
+ ```bash
255
+ uam memory start
256
+ ```
257
+
258
+ **GitHub Backend** (opt-in):
259
+ ```bash
260
+ export GITHUB_TOKEN=your_token
261
+ # Stores memories as JSON files in git repository
262
+ ```
263
+
264
+ **Qdrant Cloud** (opt-in, 1GB free tier):
265
+ ```bash
266
+ export QDRANT_API_KEY=your_key
267
+ export QDRANT_URL=https://xxxxx.aws.cloud.qdrant.io:6333
268
+ ```
269
+
270
+ ### Web Environments (claude.ai, factory.ai)
271
+
272
+ #### Short-term Memory (IndexedDB)
273
+
274
+ Browser-native storage for recent context. Per-project isolation with automatic pruning.
275
+
276
+ Database: `agentContext/memories`
277
+
278
+ #### Long-term Memory (Cloud Backends)
279
+
280
+ Requires environment variables for opt-in:
281
+
282
+ **GitHub**:
283
+ ```bash
284
+ export GITHUB_TOKEN=your_token
285
+ ```
286
+
287
+ **Qdrant Cloud** (1GB free tier):
288
+ ```bash
289
+ export QDRANT_API_KEY=your_key
290
+ export QDRANT_URL=https://xxxxx.aws.cloud.qdrant.io:6333
291
+ ```
292
+
293
+ ### What Memory Stores
294
+
295
+ Vector database for semantic search of past learnings:
296
+ - Discoveries about environment/capabilities
297
+ - Successful strategies
298
+ - Failed approaches to avoid
299
+ - Important facts learned
300
+
301
+ ## Development
302
+
303
+ ```bash
304
+ # Clone and install
305
+ git clone https://github.com/DammianMiller/universal-agent-memory.git
306
+ cd universal-agent-memory
307
+ npm install
308
+
309
+ # Build
310
+ npm run build
311
+
312
+ # Run locally
313
+ npm start -- init
314
+
315
+ # Run tests
316
+ npm test
317
+ ```
318
+
319
+ ## License
320
+
321
+ MIT
@@ -0,0 +1,3 @@
1
+ import type { ProjectAnalysis } from '../types/index.js';
2
+ export declare function analyzeProject(cwd: string): Promise<ProjectAnalysis>;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/analyzers/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CA8D1E"}