claude-mem-opencode 0.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.
Files changed (59) hide show
  1. package/README.md +391 -0
  2. package/dist/bundle/claude-mem-opencode.js +542 -0
  3. package/dist/bundle/index.d.ts +13 -0
  4. package/dist/bundle/index.d.ts.map +1 -0
  5. package/dist/bundle/index.js.map +1 -0
  6. package/dist/bundle/package.json +10 -0
  7. package/dist/bundle/skill/SKILL.md +118 -0
  8. package/dist/bundle/skill/operations/search.md +178 -0
  9. package/dist/bundle/skill/operations/timeline.md +269 -0
  10. package/dist/bundle/skill/operations/workflow.md +375 -0
  11. package/dist/cli.d.ts +6 -0
  12. package/dist/cli.d.ts.map +1 -0
  13. package/dist/cli.js +164 -0
  14. package/dist/cli.js.map +1 -0
  15. package/dist/integration/context-injector.d.ts +19 -0
  16. package/dist/integration/context-injector.d.ts.map +1 -0
  17. package/dist/integration/context-injector.js +47 -0
  18. package/dist/integration/context-injector.js.map +1 -0
  19. package/dist/integration/event-listeners.d.ts +41 -0
  20. package/dist/integration/event-listeners.d.ts.map +1 -0
  21. package/dist/integration/event-listeners.js +156 -0
  22. package/dist/integration/event-listeners.js.map +1 -0
  23. package/dist/integration/index.d.ts +66 -0
  24. package/dist/integration/index.d.ts.map +1 -0
  25. package/dist/integration/index.js +127 -0
  26. package/dist/integration/index.js.map +1 -0
  27. package/dist/integration/session-mapper.d.ts +39 -0
  28. package/dist/integration/session-mapper.d.ts.map +1 -0
  29. package/dist/integration/session-mapper.js +63 -0
  30. package/dist/integration/session-mapper.js.map +1 -0
  31. package/dist/integration/test.d.ts +6 -0
  32. package/dist/integration/test.d.ts.map +1 -0
  33. package/dist/integration/test.js +73 -0
  34. package/dist/integration/test.js.map +1 -0
  35. package/dist/integration/utils/logger.d.ts +15 -0
  36. package/dist/integration/utils/logger.d.ts.map +1 -0
  37. package/dist/integration/utils/logger.js +26 -0
  38. package/dist/integration/utils/logger.js.map +1 -0
  39. package/dist/integration/utils/privacy.d.ts +32 -0
  40. package/dist/integration/utils/privacy.d.ts.map +1 -0
  41. package/dist/integration/utils/privacy.js +62 -0
  42. package/dist/integration/utils/privacy.js.map +1 -0
  43. package/dist/integration/utils/project-name.d.ts +16 -0
  44. package/dist/integration/utils/project-name.d.ts.map +1 -0
  45. package/dist/integration/utils/project-name.js +28 -0
  46. package/dist/integration/utils/project-name.js.map +1 -0
  47. package/dist/integration/version-checker.d.ts +52 -0
  48. package/dist/integration/version-checker.d.ts.map +1 -0
  49. package/dist/integration/version-checker.js +121 -0
  50. package/dist/integration/version-checker.js.map +1 -0
  51. package/dist/integration/worker-client.d.ts +94 -0
  52. package/dist/integration/worker-client.d.ts.map +1 -0
  53. package/dist/integration/worker-client.js +188 -0
  54. package/dist/integration/worker-client.js.map +1 -0
  55. package/dist/test.d.ts +6 -0
  56. package/dist/test.d.ts.map +1 -0
  57. package/dist/test.js +73 -0
  58. package/dist/test.js.map +1 -0
  59. package/package.json +69 -0
@@ -0,0 +1,178 @@
1
+ # Search Operation
2
+
3
+ Search compressed memories using natural language queries.
4
+
5
+ ## Description
6
+
7
+ The search operation allows you to query your coding history stored in claude-mem. It returns compressed memories relevant to your query, providing ~10x token efficiency compared to storing full tool outputs.
8
+
9
+ ## Parameters
10
+
11
+ | Parameter | Type | Required | Description |
12
+ |-----------|------|-----------|-------------|
13
+ | query | string | Yes | Natural language search query |
14
+ | type | string | No | Filter by tool type: `all`, `bash`, `code`, `file`, `web`, `grep` (default: `all`) |
15
+ | limit | number | No | Maximum number of results (default: 10) |
16
+
17
+ ## Type Filters
18
+
19
+ - `all` - All tool types
20
+ - `bash` - Bash command executions
21
+ - `code` - Code-related operations
22
+ - `file` - File read/write operations
23
+ - `web` - Web fetch operations
24
+ - `grep` - Grep/search operations
25
+
26
+ ## Examples
27
+
28
+ ### Basic Search
29
+
30
+ **Query**: "authentication"
31
+
32
+ **Returns**:
33
+ ```
34
+ Found 5 memories:
35
+
36
+ 1. bash - Created AuthContext.ts
37
+ Implemented JWT authentication with user context
38
+ Timestamp: 2025-01-02T10:30:00Z
39
+
40
+ 2. read - Updated auth.ts
41
+ Modified authentication logic to include token validation
42
+ Timestamp: 2025-01-02T11:15:00Z
43
+
44
+ 3. bash - npm install jsonwebtoken
45
+ Installed JWT library for authentication
46
+ Timestamp: 2025-01-02T10:25:00Z
47
+ ```
48
+
49
+ ### Type-Filtered Search
50
+
51
+ **Query**: "setup database" (type: `bash`)
52
+
53
+ **Returns**:
54
+ ```
55
+ Found 3 bash memories:
56
+
57
+ 1. npm install prisma @prisma/client
58
+ Installed Prisma ORM and client
59
+ Timestamp: 2025-01-01T15:20:00Z
60
+
61
+ 2. npx prisma init
62
+ Initialized Prisma configuration
63
+ Timestamp: 2025-01-01T15:25:00Z
64
+
65
+ 3. npx prisma migrate dev
66
+ Ran database migrations
67
+ Timestamp: 2025-01-01T16:00:00Z
68
+ ```
69
+
70
+ ### Limited Search
71
+
72
+ **Query**: "API" (limit: 3)
73
+
74
+ **Returns**:
75
+ ```
76
+ Found 15 memories (showing 3):
77
+
78
+ 1. code - Created API routes
79
+ Implemented REST API endpoints for user management
80
+ Timestamp: 2025-01-02T09:00:00Z
81
+
82
+ 2. web - Fetched API docs
83
+ Retrieved external API documentation for reference
84
+ Timestamp: 2025-01-02T09:30:00Z
85
+
86
+ 3. file - Updated API types
87
+ Modified TypeScript types for API responses
88
+ Timestamp: 2025-01-02T10:00:00Z
89
+ ```
90
+
91
+ ## Response Format
92
+
93
+ ### Successful Response
94
+
95
+ ```json
96
+ {
97
+ "results": [
98
+ {
99
+ "id": 123,
100
+ "toolName": "bash",
101
+ "summary": "Created AuthContext.ts with JWT implementation",
102
+ "timestamp": 1704214200000,
103
+ "projectId": "auth-project"
104
+ }
105
+ ],
106
+ "total": 15,
107
+ "query": "authentication",
108
+ "type": "all"
109
+ }
110
+ ```
111
+
112
+ ### Empty Results
113
+
114
+ ```json
115
+ {
116
+ "results": [],
117
+ "total": 0,
118
+ "query": "nonexistent-unique-term-xyz123",
119
+ "type": "all"
120
+ }
121
+ ```
122
+
123
+ ## Error Handling
124
+
125
+ | Error | Cause | Solution |
126
+ |-------|--------|----------|
127
+ | Worker not available | claude-mem worker not running | Start worker: `claude-mem worker start` |
128
+ | Invalid query | Query is empty or too long | Provide a valid search query |
129
+ | Invalid type | Type filter is not recognized | Use: all, bash, code, file, web, grep |
130
+
131
+ ## Best Practices
132
+
133
+ 1. **Use specific queries**
134
+ - Good: "authentication JWT token validation"
135
+ - Bad: "auth stuff"
136
+
137
+ 2. **Leverage type filters**
138
+ - "Show me bash commands for setup" → type: bash
139
+ - "Find file operations for feature X" → type: file
140
+
141
+ 3. **Limit results when relevant**
142
+ - Use limit: 5 for quick overview
143
+ - Use default for comprehensive results
144
+
145
+ 4. **Combine with timeline context**
146
+ - First get timeline: "What's the context for last session?"
147
+ - Then search: "Show me authentication work from yesterday"
148
+
149
+ ## Usage Patterns
150
+
151
+ ### Pattern 1: Feature Exploration
152
+
153
+ 1. Search: "What did we do for X feature?"
154
+ 2. Review results
155
+ 3. Drill down: "Show me bash commands for X"
156
+ 4. Get details: "Find file operations in X"
157
+
158
+ ### Pattern 2: Debugging Help
159
+
160
+ 1. Search: "When did we modify Y file?"
161
+ 2. Get context: "What was context before changing Y?"
162
+ 3. Review changes: "Show me all operations around Y"
163
+
164
+ ### Pattern 3: Setup Reference
165
+
166
+ 1. Search: "How did we set up database?"
167
+ 2. Get all bash commands: type: bash
168
+ 3. Find configurations: "database configuration" type: file
169
+
170
+ ## Performance
171
+
172
+ - **Search speed**: < 100ms for typical queries
173
+ - **Result size**: ~50 tokens per memory (compressed)
174
+ - **Efficiency**: ~10x vs. full tool outputs
175
+
176
+ ## API Reference
177
+
178
+ See [API_CONTRACT.md](../../../docs/API_CONTRACT.md) for full API specification.
@@ -0,0 +1,269 @@
1
+ # Timeline Operation
2
+
3
+ Get compressed context from a specific timeframe or session.
4
+
5
+ ## Description
6
+
7
+ The timeline operation retrieves compressed memories from specific sessions or time ranges. This helps you understand the context of when and how features were implemented.
8
+
9
+ ## Parameters
10
+
11
+ | Parameter | Type | Required | Description |
12
+ |-----------|------|-----------|-------------|
13
+ | timeframe | string | No | Time range: `last-session`, `last-hour`, `last-day`, `last-week`, `all` |
14
+ | sessionId | string | No | Specific session ID (ULID) |
15
+ | project | string | No | Project name to filter by |
16
+ | limit | number | No | Maximum number of memories to return (default: 20) |
17
+
18
+ ## Timeframe Options
19
+
20
+ - `last-session` - Memories from most recent session
21
+ - `last-hour` - Memories from last hour
22
+ - `last-day` - Memories from last 24 hours
23
+ - `last-week` - Memories from last 7 days
24
+ - `all` - All memories (use with project filter)
25
+
26
+ ## Examples
27
+
28
+ ### Get Last Session Context
29
+
30
+ **Query**: "What did we do in the last session?"
31
+
32
+ **Operation**: timeframe: `last-session`
33
+
34
+ **Returns**:
35
+ ```
36
+ Session Context: 2025-01-02 14:30 - 15:45
37
+
38
+ Found 12 memories:
39
+
40
+ 1. bash - Created new feature branch
41
+ git checkout -b feature/user-auth
42
+ Timestamp: 2025-01-02T14:30:00Z
43
+
44
+ 2. file - Created auth directory
45
+ mkdir src/auth
46
+ Timestamp: 2025-01-02T14:31:00Z
47
+
48
+ 3. read - Examined existing auth utilities
49
+ Reviewed AuthContext.ts from shared package
50
+ Timestamp: 2025-01-02T14:35:00Z
51
+
52
+ 4. bash - Installed dependencies
53
+ npm install jsonwebtoken bcrypt
54
+ Timestamp: 2025-01-02T14:40:00Z
55
+
56
+ 5. code - Implemented login function
57
+ Created login handler with JWT generation
58
+ Timestamp: 2025-01-02T14:45:00Z
59
+
60
+ ... (7 more memories)
61
+ ```
62
+
63
+ ### Get Last Day Context
64
+
65
+ **Query**: "What did we work on yesterday?"
66
+
67
+ **Operation**: timeframe: `last-day`
68
+
69
+ **Returns**:
70
+ ```
71
+ Context from Last 24 Hours (2025-01-01 - 2025-01-02)
72
+
73
+ Found 45 memories:
74
+
75
+ [Shows all memories grouped by session]
76
+ Session 1 (2025-01-01 10:00 - 12:00): 15 memories
77
+ Session 2 (2025-01-01 14:00 - 16:00): 20 memories
78
+ Session 3 (2025-01-02 09:00 - 11:00): 10 memories
79
+ ```
80
+
81
+ ### Get Specific Session Context
82
+
83
+ **Query**: "What was the context for session 01HABC123...?"
84
+
85
+ **Operation**: sessionId: `01HABC123DEF456GHI789`
86
+
87
+ **Returns**:
88
+ ```
89
+ Session: 01HABC123DEF456GHI789
90
+ Time: 2025-01-02 09:00 - 10:30
91
+ Project: auth-project
92
+
93
+ Found 18 memories:
94
+
95
+ 1. bash - Created feature branch
96
+ ...
97
+ 2. file - Modified user routes
98
+ ...
99
+ ... (16 more memories)
100
+ ```
101
+
102
+ ### Get Project Timeline
103
+
104
+ **Query**: "Show me timeline for authentication project"
105
+
106
+ **Operation**: project: `auth-project`, timeframe: `all`
107
+
108
+ **Returns**:
109
+ ```
110
+ Project Timeline: auth-project
111
+
112
+ Found 120 memories across 8 sessions:
113
+
114
+ [Chronological timeline]
115
+ 2025-01-01 10:00-12:00 (Session 1): Setup project structure
116
+ 2025-01-01 14:00-16:00 (Session 2): Implement login
117
+ 2025-01-02 09:00-11:00 (Session 3): Add token validation
118
+ ...
119
+ ```
120
+
121
+ ### Get Limited Context
122
+
123
+ **Query**: "Show me last 5 operations"
124
+
125
+ **Operation**: timeframe: `last-session`, limit: 5
126
+
127
+ **Returns**:
128
+ ```
129
+ Last 5 Memories:
130
+
131
+ 1. bash - Fixed login bug
132
+ Timestamp: 2025-01-02T15:40:00Z
133
+
134
+ 2. read - Reviewed error logs
135
+ Timestamp: 2025-01-02T15:35:00Z
136
+
137
+ 3. web - Fetched JWT documentation
138
+ Timestamp: 2025-01-02T15:30:00Z
139
+
140
+ 4. code - Updated error handling
141
+ Timestamp: 2025-01-02T15:25:00Z
142
+
143
+ 5. bash - Restarted server
144
+ Timestamp: 2025-01-02T15:20:00Z
145
+ ```
146
+
147
+ ## Response Format
148
+
149
+ ### Successful Response
150
+
151
+ ```json
152
+ {
153
+ "results": [
154
+ {
155
+ "id": 123,
156
+ "toolName": "bash",
157
+ "summary": "Created AuthContext.ts with JWT implementation",
158
+ "timestamp": 1704214200000,
159
+ "sessionId": "01HABC123DEF456GHI789",
160
+ "projectId": "auth-project"
161
+ }
162
+ ],
163
+ "total": 12,
164
+ "timeframe": "last-session",
165
+ "contextSummary": "Implemented user authentication with JWT tokens across 5 files"
166
+ }
167
+ ```
168
+
169
+ ### Context Grouped by Session
170
+
171
+ ```json
172
+ {
173
+ "grouped": [
174
+ {
175
+ "sessionId": "01HABC123DEF456GHI789",
176
+ "startTime": 1704214200000,
177
+ "endTime": 1704218100000,
178
+ "memories": 12,
179
+ "summary": "Implemented login and registration"
180
+ }
181
+ ],
182
+ "totalSessions": 3,
183
+ "totalMemories": 45
184
+ }
185
+ ```
186
+
187
+ ## Use Cases
188
+
189
+ ### Use Case 1: Debugging
190
+
191
+ **Scenario**: You're debugging an issue and need to understand recent changes.
192
+
193
+ **Query**: "What did we do in the last hour?"
194
+
195
+ **Benefit**: Quickly see recent operations to identify what might have caused the issue.
196
+
197
+ ### Use Case 2: Feature Documentation
198
+
199
+ **Scenario**: You need to document how a feature was implemented.
200
+
201
+ **Query**: "Show me timeline for authentication feature" + filter by project
202
+
203
+ **Benefit**: Get chronological view of implementation steps.
204
+
205
+ ### Use Case 3: Context Recovery
206
+
207
+ **Scenario**: You lost context and need to catch up on a feature.
208
+
209
+ **Query**: "What was the context before we added OAuth?"
210
+
211
+ **Benefit**: Understand what was done before a specific change.
212
+
213
+ ### Use Case 4: Session Review
214
+
215
+ **Scenario**: You want to review what was accomplished in a specific session.
216
+
217
+ **Query**: "Show me context for session [ID]"
218
+
219
+ **Benefit**: Detailed view of one session's work.
220
+
221
+ ## Error Handling
222
+
223
+ | Error | Cause | Solution |
224
+ |-------|--------|----------|
225
+ | No memories found | Timeframe has no memories | Try different timeframe or check if memories exist |
226
+ | Invalid sessionId | Session ID not found | Verify session ID is correct |
227
+ | Invalid timeframe | Timeframe not recognized | Use: last-session, last-hour, last-day, last-week, all |
228
+ | Worker not available | claude-mem worker not running | Start worker: `claude-mem worker start` |
229
+
230
+ ## Best Practices
231
+
232
+ 1. **Start broad, then narrow**
233
+ - First: "What did we work on yesterday?" (last-day)
234
+ - Then: "Show me last session" (last-session)
235
+ - Finally: Specific session ID
236
+
237
+ 2. **Use project filters**
238
+ - Combine with project: "Show me timeline for auth-project"
239
+ - Reduces noise from other projects
240
+
241
+ 3. **Limit for quick overviews**
242
+ - Use limit: 10 for quick summary
243
+ - Remove limit for full context
244
+
245
+ 4. **Combine with search**
246
+ - First get timeline: "What's the context for last session?"
247
+ - Then search: "Find all bash commands in that session"
248
+
249
+ ## Performance
250
+
251
+ - **Memory retrieval**: < 200ms for typical timeframes
252
+ - **Session grouping**: < 500ms for multiple sessions
253
+ - **Token efficiency**: ~10x vs. full session context
254
+
255
+ ## Integration with Search
256
+
257
+ Timeline and search operations complement each other:
258
+
259
+ 1. **Timeline** gives chronological context
260
+ 2. **Search** finds specific information
261
+
262
+ **Example workflow**:
263
+ 1. Get timeline: "What did we work on yesterday?"
264
+ 2. Identify relevant sessions
265
+ 3. Search within sessions: "Find all database operations from those sessions"
266
+
267
+ ## API Reference
268
+
269
+ See [API_CONTRACT.md](../../../docs/API_CONTRACT.md) for full API specification.