@prmichaelsen/remember-mcp 2.7.11 → 3.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 (101) hide show
  1. package/.env.example +6 -0
  2. package/AGENT.md +224 -21
  3. package/CHANGELOG.md +155 -915
  4. package/README.md +130 -1
  5. package/agent/commands/acp.command-create.md +372 -0
  6. package/agent/commands/acp.design-create.md +224 -0
  7. package/agent/commands/acp.init.md +39 -5
  8. package/agent/commands/acp.package-create.md +894 -0
  9. package/agent/commands/acp.package-info.md +211 -0
  10. package/agent/commands/acp.package-install.md +206 -33
  11. package/agent/commands/acp.package-list.md +279 -0
  12. package/agent/commands/acp.package-publish.md +540 -0
  13. package/agent/commands/acp.package-remove.md +292 -0
  14. package/agent/commands/acp.package-search.md +306 -0
  15. package/agent/commands/acp.package-update.md +360 -0
  16. package/agent/commands/acp.package-validate.md +539 -0
  17. package/agent/commands/acp.pattern-create.md +326 -0
  18. package/agent/commands/acp.plan.md +552 -0
  19. package/agent/commands/acp.proceed.md +111 -86
  20. package/agent/commands/acp.project-create.md +672 -0
  21. package/agent/commands/acp.project-list.md +224 -0
  22. package/agent/commands/acp.project-set.md +226 -0
  23. package/agent/commands/acp.report.md +2 -0
  24. package/agent/commands/acp.resume.md +237 -0
  25. package/agent/commands/acp.sync.md +55 -15
  26. package/agent/commands/acp.task-create.md +390 -0
  27. package/agent/commands/acp.validate.md +61 -10
  28. package/agent/commands/acp.version-check-for-updates.md +5 -5
  29. package/agent/commands/acp.version-check.md +6 -6
  30. package/agent/commands/acp.version-update.md +6 -6
  31. package/agent/commands/command.template.md +43 -0
  32. package/agent/commands/git.commit.md +5 -3
  33. package/agent/design/soft-delete-system.md +291 -0
  34. package/agent/manifest.template.yaml +13 -0
  35. package/agent/milestones/milestone-13-soft-delete-system.md +306 -0
  36. package/agent/package.template.yaml +36 -0
  37. package/agent/progress.template.yaml +3 -0
  38. package/agent/progress.yaml +238 -6
  39. package/agent/scripts/acp.common.sh +1536 -0
  40. package/agent/scripts/{install.sh → acp.install.sh} +82 -26
  41. package/agent/scripts/acp.package-create.sh +925 -0
  42. package/agent/scripts/acp.package-info.sh +270 -0
  43. package/agent/scripts/acp.package-install.sh +596 -0
  44. package/agent/scripts/acp.package-list.sh +263 -0
  45. package/agent/scripts/acp.package-publish.sh +420 -0
  46. package/agent/scripts/acp.package-remove.sh +272 -0
  47. package/agent/scripts/acp.package-search.sh +156 -0
  48. package/agent/scripts/acp.package-update.sh +438 -0
  49. package/agent/scripts/acp.package-validate.sh +855 -0
  50. package/agent/scripts/acp.project-list.sh +121 -0
  51. package/agent/scripts/acp.project-set.sh +138 -0
  52. package/agent/scripts/{uninstall.sh → acp.uninstall.sh} +25 -15
  53. package/agent/scripts/{check-for-updates.sh → acp.version-check-for-updates.sh} +24 -14
  54. package/agent/scripts/{version.sh → acp.version-check.sh} +20 -8
  55. package/agent/scripts/{update.sh → acp.version-update.sh} +44 -25
  56. package/agent/scripts/acp.yaml-parser.sh +853 -0
  57. package/agent/scripts/acp.yaml-validate.sh +205 -0
  58. package/agent/tasks/task-68-fix-missing-space-properties.md +192 -0
  59. package/agent/tasks/task-69-add-comprehensive-tool-debugging.md +454 -0
  60. package/agent/tasks/task-70-add-soft-delete-schema-fields.md +165 -0
  61. package/agent/tasks/task-71-implement-delete-confirmation-flow.md +257 -0
  62. package/agent/tasks/task-72-add-deleted-filter-to-search-tools.md +18 -0
  63. package/agent/tasks/task-73-update-relationship-handling.md +18 -0
  64. package/agent/tasks/task-74-add-unit-tests-soft-delete.md +18 -0
  65. package/agent/tasks/task-75-update-documentation-changelog.md +26 -0
  66. package/dist/config.d.ts +18 -0
  67. package/dist/server-factory.js +788 -355
  68. package/dist/server.js +788 -355
  69. package/dist/tools/delete-memory.d.ts +5 -30
  70. package/dist/tools/find-similar.d.ts +8 -1
  71. package/dist/tools/query-memory.d.ts +8 -1
  72. package/dist/tools/search-memory.d.ts +6 -0
  73. package/dist/tools/search-relationship.d.ts +8 -1
  74. package/dist/types/memory.d.ts +8 -0
  75. package/dist/types/space-memory.d.ts +3 -0
  76. package/dist/utils/debug.d.ts +52 -0
  77. package/dist/utils/debug.spec.d.ts +5 -0
  78. package/dist/utils/weaviate-filters.d.ts +19 -0
  79. package/dist/weaviate/client.d.ts +1 -1
  80. package/package.json +1 -1
  81. package/src/config.ts +33 -0
  82. package/src/tools/confirm.ts +113 -8
  83. package/src/tools/create-relationship.ts +14 -1
  84. package/src/tools/delete-memory.ts +91 -63
  85. package/src/tools/find-similar.ts +30 -5
  86. package/src/tools/publish.ts +19 -1
  87. package/src/tools/query-memory.ts +18 -5
  88. package/src/tools/query-space.ts +36 -3
  89. package/src/tools/search-memory.ts +18 -5
  90. package/src/tools/search-relationship.ts +19 -5
  91. package/src/tools/search-space.ts +36 -3
  92. package/src/tools/update-memory.ts +8 -0
  93. package/src/types/memory.ts +11 -0
  94. package/src/types/space-memory.ts +5 -0
  95. package/src/utils/debug.spec.ts +257 -0
  96. package/src/utils/debug.ts +138 -0
  97. package/src/utils/weaviate-filters.ts +28 -1
  98. package/src/weaviate/client.ts +47 -3
  99. package/src/weaviate/schema.ts +17 -0
  100. package/src/weaviate/space-schema.spec.ts +5 -2
  101. package/src/weaviate/space-schema.ts +17 -5
@@ -0,0 +1,438 @@
1
+ #!/bin/bash
2
+
3
+ # Agent Context Protocol (ACP) Package Update Script
4
+ # Updates installed ACP packages to their latest versions
5
+
6
+ set -e
7
+
8
+ # Source common utilities
9
+ SCRIPT_DIR="$(dirname "$0")"
10
+ . "${SCRIPT_DIR}/acp.common.sh"
11
+
12
+ # Initialize colors
13
+ init_colors
14
+
15
+ # Parse arguments
16
+ PACKAGE_NAME=""
17
+ CHECK_ONLY=false
18
+ SKIP_MODIFIED=false
19
+ FORCE=false
20
+ AUTO_CONFIRM=false
21
+ GLOBAL_MODE=false
22
+
23
+ while [[ $# -gt 0 ]]; do
24
+ case $1 in
25
+ --global|-g)
26
+ GLOBAL_MODE=true
27
+ shift
28
+ ;;
29
+ --check)
30
+ CHECK_ONLY=true
31
+ shift
32
+ ;;
33
+ --skip-modified)
34
+ SKIP_MODIFIED=true
35
+ shift
36
+ ;;
37
+ --force)
38
+ FORCE=true
39
+ shift
40
+ ;;
41
+ -y|--yes)
42
+ AUTO_CONFIRM=true
43
+ shift
44
+ ;;
45
+ *)
46
+ PACKAGE_NAME="$1"
47
+ shift
48
+ ;;
49
+ esac
50
+ done
51
+
52
+ # Check if experimental feature is already installed
53
+ is_experimental_installed() {
54
+ local file_name="$1"
55
+ local file_type="$2"
56
+ local package_name="$3"
57
+
58
+ # Check manifest to see if this file is already installed
59
+ local installed=$(awk -v pkg="$package_name" -v type="$file_type" -v fname="$file_name" '
60
+ BEGIN { in_pkg=0; in_type=0 }
61
+ $0 ~ "^ " pkg ":" { in_pkg=1; next }
62
+ in_pkg && /^ [a-z]/ { in_pkg=0 }
63
+ in_pkg && $0 ~ "^ " type ":" { in_type=1; next }
64
+ in_type && /^ [a-z]/ { in_type=0 }
65
+ in_type && /^ - name:/ && $3 == fname { print "found"; exit }
66
+ ' "$MANIFEST_FILE")
67
+
68
+ if [ -n "$installed" ]; then
69
+ return 0 # Already installed
70
+ fi
71
+
72
+ return 1 # Not installed
73
+ }
74
+
75
+ # Check if feature graduated from experimental to stable
76
+ check_graduation() {
77
+ local file_name="$1"
78
+ local file_type="$2"
79
+ local package_name="$3"
80
+ local package_yaml_path="$4"
81
+
82
+ # Check if was experimental in manifest
83
+ local was_experimental=$(awk -v pkg="$package_name" -v type="$file_type" -v fname="$file_name" '
84
+ BEGIN { in_pkg=0; in_type=0; in_file=0 }
85
+ $0 ~ "^ " pkg ":" { in_pkg=1; next }
86
+ in_pkg && /^ [a-z]/ { in_pkg=0 }
87
+ in_pkg && $0 ~ "^ " type ":" { in_type=1; next }
88
+ in_type && /^ [a-z]/ { in_type=0 }
89
+ in_type && /^ - name:/ && $3 == fname { in_file=1; next }
90
+ in_file && /^ - name:/ { in_file=0 }
91
+ in_file && /^ experimental:/ { print $2; exit }
92
+ ' "$MANIFEST_FILE")
93
+
94
+ # Check if is experimental in new package.yaml
95
+ local is_experimental=$(grep -A 1000 "^ ${file_type}:" "$package_yaml_path" 2>/dev/null | grep -A 2 "name: ${file_name}" | grep "^ *experimental: true" | grep -v "^[[:space:]]*#" | head -1)
96
+
97
+ if [ "$was_experimental" = "true" ] && [ -z "$is_experimental" ]; then
98
+ return 0 # Graduated
99
+ fi
100
+
101
+ return 1 # Not graduated
102
+ }
103
+
104
+ # Check for updates for a package
105
+ # Usage: check_package_for_updates "package_name"
106
+ # Returns: 0 if updates available, 1 if up to date
107
+ check_package_for_updates() {
108
+ local package_name="$1"
109
+
110
+ # Get current version and source from manifest
111
+ local current_version
112
+ current_version=$(awk -v pkg="$package_name" '
113
+ $0 ~ "^ " pkg ":" { in_pkg=1; next }
114
+ in_pkg && /^ [a-z]/ { in_pkg=0 }
115
+ in_pkg && /^ package_version:/ { print $2; exit }
116
+ ' "$MANIFEST_FILE")
117
+
118
+ local source_url
119
+ source_url=$(awk -v pkg="$package_name" '
120
+ $0 ~ "^ " pkg ":" { in_pkg=1; next }
121
+ in_pkg && /^ [a-z]/ { in_pkg=0 }
122
+ in_pkg && /^ source:/ { print $2; exit }
123
+ ' "$MANIFEST_FILE")
124
+
125
+ if [ -z "$current_version" ] || [ -z "$source_url" ]; then
126
+ warn "Could not read package metadata for $package_name"
127
+ return 1
128
+ fi
129
+
130
+ info "Checking $package_name ($current_version)..."
131
+
132
+ # Clone repository to temp location
133
+ local temp_dir
134
+ temp_dir=$(mktemp -d)
135
+ trap "rm -rf $temp_dir" RETURN
136
+
137
+ if ! git clone --depth 1 "$source_url" "$temp_dir" &>/dev/null; then
138
+ warn "Failed to clone repository for $package_name"
139
+ return 1
140
+ fi
141
+
142
+ # Get remote version
143
+ local remote_version
144
+ if [ -f "$temp_dir/package.yaml" ]; then
145
+ remote_version=$(awk '/^version:/ {print $2; exit}' "$temp_dir/package.yaml")
146
+ else
147
+ warn "No package.yaml found in repository"
148
+ return 1
149
+ fi
150
+
151
+ # Compare versions
152
+ local comparison
153
+ comparison=$(compare_versions "$current_version" "$remote_version")
154
+
155
+ if [ "$comparison" = "newer" ]; then
156
+ echo " ${GREEN}✓${NC} Update available: $current_version → $remote_version"
157
+ return 0
158
+ else
159
+ echo " ${GREEN}✓${NC} Up to date: $current_version"
160
+ return 1
161
+ fi
162
+ }
163
+
164
+ # Update a package
165
+ # Usage: update_package "package_name"
166
+ update_package() {
167
+ local package_name="$1"
168
+
169
+ echo "${BLUE}Updating $package_name...${NC}"
170
+
171
+ # Get package info from manifest
172
+ local source_url
173
+ source_url=$(awk -v pkg="$package_name" '
174
+ $0 ~ "^ " pkg ":" { in_pkg=1; next }
175
+ in_pkg && /^ [a-z]/ { in_pkg=0 }
176
+ in_pkg && /^ source:/ { print $2; exit }
177
+ ' "$MANIFEST_FILE")
178
+
179
+ # Clone latest version
180
+ local temp_dir
181
+ temp_dir=$(mktemp -d)
182
+ trap "rm -rf $temp_dir" RETURN
183
+
184
+ if ! git clone --depth 1 "$source_url" "$temp_dir" &>/dev/null; then
185
+ die "Failed to clone repository"
186
+ fi
187
+
188
+ # Parse new package metadata
189
+ parse_package_metadata "$temp_dir"
190
+ local new_commit
191
+ new_commit=$(get_commit_hash "$temp_dir")
192
+
193
+ # Get list of installed files from manifest
194
+ local updated_count=0
195
+ local skipped_count=0
196
+ local modified_files=()
197
+
198
+ # Check for modified files first
199
+ for file_type in patterns commands design; do
200
+ local files
201
+ files=$(awk -v pkg="$package_name" -v type="$file_type" '
202
+ BEGIN { in_pkg=0; in_type=0 }
203
+ $0 ~ "^ " pkg ":" { in_pkg=1; next }
204
+ in_pkg && /^ [a-z]/ { in_pkg=0 }
205
+ in_pkg && $0 ~ "^ " type ":" { in_type=1; next }
206
+ in_type && /^ [a-z]/ { in_type=0 }
207
+ in_type && /^ - name:/ { print $3 }
208
+ ' "$MANIFEST_FILE")
209
+
210
+ for file_name in $files; do
211
+ if is_file_modified "$package_name" "$file_type" "$file_name"; then
212
+ modified_files+=("$file_type/$file_name")
213
+ fi
214
+ done
215
+ done
216
+
217
+ # Handle modified files
218
+ if [ ${#modified_files[@]} -gt 0 ] && [ "$FORCE" = false ]; then
219
+ echo ""
220
+ echo "${YELLOW}⚠️ Modified files detected:${NC}"
221
+ for file in "${modified_files[@]}"; do
222
+ echo " - $file"
223
+ done
224
+ echo ""
225
+
226
+ if [ "$SKIP_MODIFIED" = true ]; then
227
+ echo "Will skip modified files (--skip-modified)"
228
+ elif [ "$AUTO_CONFIRM" = false ]; then
229
+ read -p "Overwrite modified files? (y/N) " -n 1 -r
230
+ echo
231
+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
232
+ SKIP_MODIFIED=true
233
+ echo "Skipping modified files"
234
+ fi
235
+ fi
236
+ echo ""
237
+ fi
238
+
239
+ # Update files
240
+ for file_type in patterns commands design; do
241
+ local files
242
+ files=$(awk -v pkg="$package_name" -v type="$file_type" '
243
+ BEGIN { in_pkg=0; in_type=0 }
244
+ $0 ~ "^ " pkg ":" { in_pkg=1; next }
245
+ in_pkg && /^ [a-z]/ { in_pkg=0 }
246
+ in_pkg && $0 ~ "^ " type ":" { in_type=1; next }
247
+ in_type && /^ [a-z]/ { in_type=0 }
248
+ in_type && /^ - name:/ { print $3 }
249
+ ' "$MANIFEST_FILE")
250
+
251
+ for file_name in $files; do
252
+ # Check if file should be skipped due to local modifications
253
+ if [ "$SKIP_MODIFIED" = true ]; then
254
+ if printf '%s\n' "${modified_files[@]}" | grep -q "^${file_type}/${file_name}$"; then
255
+ echo " ${YELLOW}⊘${NC} Skipped $file_type/$file_name (modified locally)"
256
+ ((skipped_count++))
257
+ continue
258
+ fi
259
+ fi
260
+
261
+ # Check if file exists in new version
262
+ if [ ! -f "$temp_dir/agent/$file_type/$file_name" ]; then
263
+ warn "File no longer exists in package: $file_type/$file_name"
264
+ ((skipped_count++))
265
+ continue
266
+ fi
267
+
268
+ # Check if this is a new experimental feature
269
+ local is_experimental=$(grep -A 1000 "^ ${file_type}:" "$temp_dir/package.yaml" 2>/dev/null | grep -A 2 "name: ${file_name}" | grep "^ *experimental: true" | grep -v "^[[:space:]]*#" | head -1)
270
+
271
+ if [ -n "$is_experimental" ]; then
272
+ # This is an experimental feature
273
+ if ! is_experimental_installed "$file_name" "$file_type" "$package_name"; then
274
+ # Not installed, skip it
275
+ echo " ${DIM}⊘${NC} Skipping new experimental: $file_type/$file_name (use --experimental with install to add)"
276
+ ((skipped_count++))
277
+ continue
278
+ fi
279
+ # Already installed, update it
280
+ echo " ${YELLOW}↻${NC} Updating experimental: $file_type/$file_name"
281
+ else
282
+ # Check if graduated from experimental to stable
283
+ if check_graduation "$file_name" "$file_type" "$package_name" "$temp_dir/package.yaml"; then
284
+ echo " ${GREEN}🎓${NC} Graduated to stable: $file_type/$file_name"
285
+ fi
286
+ echo " ${BLUE}↻${NC} Updating: $file_type/$file_name"
287
+ fi
288
+
289
+ # Copy file
290
+ cp "$temp_dir/agent/$file_type/$file_name" "agent/$file_type/"
291
+
292
+ # Get new version and checksum
293
+ local new_version
294
+ new_version=$(get_file_version "$temp_dir/package.yaml" "$file_type" "$file_name")
295
+ local new_checksum
296
+ new_checksum=$(calculate_checksum "agent/$file_type/$file_name")
297
+
298
+ # Update manifest (including experimental status)
299
+ update_file_in_manifest "$package_name" "$file_type" "$file_name" "$new_version" "$new_checksum"
300
+
301
+ # Update experimental flag in manifest if needed
302
+ if [ -n "$is_experimental" ]; then
303
+ # Still experimental, ensure flag is set
304
+ sed -i "/packages:/{:a;N;/name: ${file_name}/!ba;s/\(name: ${file_name}\)/\1\n experimental: true/;}" "$MANIFEST_FILE" 2>/dev/null || true
305
+ elif check_graduation "$file_name" "$file_type" "$package_name" "$temp_dir/package.yaml"; then
306
+ # Graduated, remove experimental flag
307
+ sed -i "/name: ${file_name}/{N;s/\n *experimental: true//;}" "$MANIFEST_FILE" 2>/dev/null || true
308
+ fi
309
+
310
+ echo " ${GREEN}✓${NC} Updated $file_type/$file_name (v$new_version)"
311
+ ((updated_count++))
312
+ done
313
+ done
314
+
315
+ # Update package metadata in manifest
316
+ local timestamp
317
+ timestamp=$(get_timestamp)
318
+
319
+ # Update using awk
320
+ local temp_file
321
+ temp_file=$(mktemp)
322
+
323
+ awk -v pkg="$package_name" -v ver="$PACKAGE_VERSION" -v commit="$new_commit" -v ts="$timestamp" '
324
+ BEGIN { in_pkg=0 }
325
+ $0 ~ "^ " pkg ":" { in_pkg=1; print; next }
326
+ in_pkg && /^ [a-z]/ { in_pkg=0; print; next }
327
+ in_pkg && /^ package_version:/ { print " package_version: " ver; next }
328
+ in_pkg && /^ commit:/ { print " commit: " commit; next }
329
+ in_pkg && /^ updated_at:/ { print " updated_at: " ts; next }
330
+ { print }
331
+ ' "$MANIFEST_FILE" > "$temp_file"
332
+
333
+ mv "$temp_file" "$MANIFEST_FILE"
334
+
335
+ # Update manifest timestamp
336
+ update_manifest_timestamp
337
+
338
+ echo ""
339
+ success "Updated $package_name: $updated_count file(s)"
340
+ if [ $skipped_count -gt 0 ]; then
341
+ echo " Skipped: $skipped_count file(s)"
342
+ fi
343
+ }
344
+
345
+ # Main script execution
346
+ echo "${BLUE}📦 ACP Package Updater${NC}"
347
+ echo "========================================"
348
+ echo ""
349
+
350
+ # Determine manifest file based on mode
351
+ if [ "$GLOBAL_MODE" = true ]; then
352
+ MANIFEST_FILE="$HOME/.acp/manifest.yaml"
353
+ echo "${BLUE}Updating global packages...${NC}"
354
+ echo ""
355
+ else
356
+ MANIFEST_FILE="./agent/manifest.yaml"
357
+ echo "${BLUE}Updating packages...${NC}"
358
+ echo ""
359
+ fi
360
+
361
+ # Check if manifest exists
362
+ if [ ! -f "$MANIFEST_FILE" ]; then
363
+ if [ "$GLOBAL_MODE" = true ]; then
364
+ die "No global manifest found. No global packages installed."
365
+ else
366
+ die "No manifest found. No packages installed."
367
+ fi
368
+ fi
369
+
370
+ # Source YAML parser
371
+ source_yaml_parser
372
+
373
+ # Get list of installed packages
374
+ INSTALLED_PACKAGES=$(awk '/^ [a-z]/ && !/^ / && /:$/ {gsub(/:/, ""); print $1}' "$MANIFEST_FILE")
375
+
376
+ if [ -z "$INSTALLED_PACKAGES" ]; then
377
+ echo "${YELLOW}No packages installed${NC}"
378
+ exit 0
379
+ fi
380
+
381
+ # If no package specified, update all
382
+ if [ -z "$PACKAGE_NAME" ]; then
383
+ echo "Checking all packages for updates..."
384
+ echo ""
385
+
386
+ UPDATES_AVAILABLE=false
387
+ for pkg in $INSTALLED_PACKAGES; do
388
+ if check_package_for_updates "$pkg"; then
389
+ UPDATES_AVAILABLE=true
390
+ fi
391
+ done
392
+
393
+ if [ "$UPDATES_AVAILABLE" = false ]; then
394
+ echo "${GREEN}✓${NC} All packages are up to date"
395
+ exit 0
396
+ fi
397
+
398
+ if [ "$CHECK_ONLY" = true ]; then
399
+ echo ""
400
+ echo "To update all packages: $0"
401
+ echo "To update specific package: $0 <package-name>"
402
+ exit 0
403
+ fi
404
+
405
+ # Update all packages
406
+ echo ""
407
+ if [ "$AUTO_CONFIRM" = false ]; then
408
+ read -p "Update all packages? (y/N) " -n 1 -r
409
+ echo
410
+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
411
+ echo "Update cancelled"
412
+ exit 0
413
+ fi
414
+ fi
415
+
416
+ echo ""
417
+ for pkg in $INSTALLED_PACKAGES; do
418
+ update_package "$pkg"
419
+ echo ""
420
+ done
421
+ else
422
+ # Update specific package
423
+ if ! echo "$INSTALLED_PACKAGES" | grep -q "^${PACKAGE_NAME}$"; then
424
+ die "Package not installed: $PACKAGE_NAME"
425
+ fi
426
+
427
+ if check_package_for_updates "$PACKAGE_NAME"; then
428
+ if [ "$CHECK_ONLY" = false ]; then
429
+ echo ""
430
+ update_package "$PACKAGE_NAME"
431
+ fi
432
+ else
433
+ echo "${GREEN}✓${NC} Package is up to date"
434
+ fi
435
+ fi
436
+
437
+ echo ""
438
+ echo "${GREEN}✅ Update complete!${NC}"