@prmichaelsen/acp-visualizer 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 (180) hide show
  1. package/README.md +68 -0
  2. package/agent/commands/acp.clarification-address.md +417 -0
  3. package/agent/commands/acp.clarification-capture.md +386 -0
  4. package/agent/commands/acp.clarification-create.md +437 -0
  5. package/agent/commands/acp.clarifications-research.md +326 -0
  6. package/agent/commands/acp.command-create.md +432 -0
  7. package/agent/commands/acp.design-create.md +286 -0
  8. package/agent/commands/acp.design-reference.md +355 -0
  9. package/agent/commands/acp.handoff.md +270 -0
  10. package/agent/commands/acp.index.md +423 -0
  11. package/agent/commands/acp.init.md +546 -0
  12. package/agent/commands/acp.package-create.md +895 -0
  13. package/agent/commands/acp.package-info.md +212 -0
  14. package/agent/commands/acp.package-install.md +539 -0
  15. package/agent/commands/acp.package-list.md +280 -0
  16. package/agent/commands/acp.package-publish.md +541 -0
  17. package/agent/commands/acp.package-remove.md +293 -0
  18. package/agent/commands/acp.package-search.md +307 -0
  19. package/agent/commands/acp.package-update.md +361 -0
  20. package/agent/commands/acp.package-validate.md +540 -0
  21. package/agent/commands/acp.pattern-create.md +386 -0
  22. package/agent/commands/acp.plan.md +587 -0
  23. package/agent/commands/acp.proceed.md +882 -0
  24. package/agent/commands/acp.project-create.md +675 -0
  25. package/agent/commands/acp.project-info.md +312 -0
  26. package/agent/commands/acp.project-list.md +226 -0
  27. package/agent/commands/acp.project-remove.md +379 -0
  28. package/agent/commands/acp.project-set.md +227 -0
  29. package/agent/commands/acp.project-update.md +307 -0
  30. package/agent/commands/acp.projects-restore.md +228 -0
  31. package/agent/commands/acp.projects-sync.md +347 -0
  32. package/agent/commands/acp.report.md +407 -0
  33. package/agent/commands/acp.resume.md +239 -0
  34. package/agent/commands/acp.sessions.md +301 -0
  35. package/agent/commands/acp.status.md +293 -0
  36. package/agent/commands/acp.sync.md +364 -0
  37. package/agent/commands/acp.task-create.md +500 -0
  38. package/agent/commands/acp.update.md +302 -0
  39. package/agent/commands/acp.validate.md +466 -0
  40. package/agent/commands/acp.version-check-for-updates.md +276 -0
  41. package/agent/commands/acp.version-check.md +191 -0
  42. package/agent/commands/acp.version-update.md +289 -0
  43. package/agent/commands/command.template.md +339 -0
  44. package/agent/commands/git.commit.md +526 -0
  45. package/agent/commands/git.init.md +514 -0
  46. package/agent/commands/tanstack-cloudflare.deploy.md +272 -0
  47. package/agent/commands/tanstack-cloudflare.tail.md +275 -0
  48. package/agent/design/.gitkeep +0 -0
  49. package/agent/design/design.template.md +154 -0
  50. package/agent/design/local.dashboard-layout-routing.md +288 -0
  51. package/agent/design/local.data-model-yaml-parsing.md +310 -0
  52. package/agent/design/local.search-filtering.md +331 -0
  53. package/agent/design/local.server-api-auto-refresh.md +235 -0
  54. package/agent/design/local.table-tree-views.md +299 -0
  55. package/agent/design/local.visualizer-requirements.md +349 -0
  56. package/agent/design/requirements.template.md +387 -0
  57. package/agent/index/.gitkeep +0 -0
  58. package/agent/index/acp.core.yaml +137 -0
  59. package/agent/index/local.main.template.yaml +37 -0
  60. package/agent/manifest.template.yaml +13 -0
  61. package/agent/manifest.yaml +302 -0
  62. package/agent/milestones/.gitkeep +0 -0
  63. package/agent/milestones/milestone-1-project-scaffold-data-pipeline.md +67 -0
  64. package/agent/milestones/milestone-1-{title}.template.md +206 -0
  65. package/agent/milestones/milestone-2-dashboard-views-interaction.md +79 -0
  66. package/agent/package.template.yaml +86 -0
  67. package/agent/patterns/.gitkeep +0 -0
  68. package/agent/patterns/bootstrap.template.md +1237 -0
  69. package/agent/patterns/pattern.template.md +382 -0
  70. package/agent/patterns/tanstack-cloudflare.acl-permissions.md +332 -0
  71. package/agent/patterns/tanstack-cloudflare.action-bar-item.md +416 -0
  72. package/agent/patterns/tanstack-cloudflare.api-route-handlers.md +401 -0
  73. package/agent/patterns/tanstack-cloudflare.auth-session-management.md +387 -0
  74. package/agent/patterns/tanstack-cloudflare.card-and-list.md +271 -0
  75. package/agent/patterns/tanstack-cloudflare.chat-engine.md +353 -0
  76. package/agent/patterns/tanstack-cloudflare.confirmation-tokens.md +346 -0
  77. package/agent/patterns/tanstack-cloudflare.durable-objects-websocket.md +516 -0
  78. package/agent/patterns/tanstack-cloudflare.email-service.md +431 -0
  79. package/agent/patterns/tanstack-cloudflare.expander.md +98 -0
  80. package/agent/patterns/tanstack-cloudflare.fcm-push.md +115 -0
  81. package/agent/patterns/tanstack-cloudflare.firebase-anonymous-sessions.md +441 -0
  82. package/agent/patterns/tanstack-cloudflare.firebase-auth.md +348 -0
  83. package/agent/patterns/tanstack-cloudflare.firebase-firestore.md +550 -0
  84. package/agent/patterns/tanstack-cloudflare.firebase-storage.md +369 -0
  85. package/agent/patterns/tanstack-cloudflare.form-controls.md +145 -0
  86. package/agent/patterns/tanstack-cloudflare.global-search-context.md +93 -0
  87. package/agent/patterns/tanstack-cloudflare.image-carousel.md +126 -0
  88. package/agent/patterns/tanstack-cloudflare.library-services.md +553 -0
  89. package/agent/patterns/tanstack-cloudflare.lightbox.md +169 -0
  90. package/agent/patterns/tanstack-cloudflare.markdown-content.md +115 -0
  91. package/agent/patterns/tanstack-cloudflare.mention-suggestions.md +98 -0
  92. package/agent/patterns/tanstack-cloudflare.modal.md +156 -0
  93. package/agent/patterns/tanstack-cloudflare.nextjs-to-tanstack-routing.md +461 -0
  94. package/agent/patterns/tanstack-cloudflare.notifications-engine.md +151 -0
  95. package/agent/patterns/tanstack-cloudflare.oauth-token-refresh.md +90 -0
  96. package/agent/patterns/tanstack-cloudflare.og-metadata.md +296 -0
  97. package/agent/patterns/tanstack-cloudflare.pagination.md +442 -0
  98. package/agent/patterns/tanstack-cloudflare.pill-input.md +220 -0
  99. package/agent/patterns/tanstack-cloudflare.provider-adapter.md +401 -0
  100. package/agent/patterns/tanstack-cloudflare.rate-limiting.md +323 -0
  101. package/agent/patterns/tanstack-cloudflare.scheduled-tasks.md +338 -0
  102. package/agent/patterns/tanstack-cloudflare.searchable-settings.md +375 -0
  103. package/agent/patterns/tanstack-cloudflare.slide-over.md +129 -0
  104. package/agent/patterns/tanstack-cloudflare.ssr-preload.md +571 -0
  105. package/agent/patterns/tanstack-cloudflare.third-party-api-integration.md +508 -0
  106. package/agent/patterns/tanstack-cloudflare.toast-system.md +142 -0
  107. package/agent/patterns/tanstack-cloudflare.unified-header.md +280 -0
  108. package/agent/patterns/tanstack-cloudflare.user-scoped-collections.md +628 -0
  109. package/agent/patterns/tanstack-cloudflare.websocket-manager.md +237 -0
  110. package/agent/patterns/tanstack-cloudflare.wrangler-configuration.md +358 -0
  111. package/agent/patterns/tanstack-cloudflare.zod-schema-validation.md +336 -0
  112. package/agent/progress.template.yaml +161 -0
  113. package/agent/progress.yaml +145 -0
  114. package/agent/schemas/package.schema.yaml +276 -0
  115. package/agent/scripts/acp.common.sh +1781 -0
  116. package/agent/scripts/acp.install.sh +333 -0
  117. package/agent/scripts/acp.package-create.sh +924 -0
  118. package/agent/scripts/acp.package-info.sh +288 -0
  119. package/agent/scripts/acp.package-install.sh +893 -0
  120. package/agent/scripts/acp.package-list.sh +311 -0
  121. package/agent/scripts/acp.package-publish.sh +420 -0
  122. package/agent/scripts/acp.package-remove.sh +348 -0
  123. package/agent/scripts/acp.package-search.sh +156 -0
  124. package/agent/scripts/acp.package-update.sh +517 -0
  125. package/agent/scripts/acp.package-validate.sh +1018 -0
  126. package/agent/scripts/acp.uninstall.sh +85 -0
  127. package/agent/scripts/acp.version-check-for-updates.sh +98 -0
  128. package/agent/scripts/acp.version-check.sh +47 -0
  129. package/agent/scripts/acp.version-update.sh +176 -0
  130. package/agent/scripts/acp.yaml-parser.sh +985 -0
  131. package/agent/scripts/acp.yaml-validate.sh +205 -0
  132. package/agent/tasks/.gitkeep +0 -0
  133. package/agent/tasks/milestone-1-project-scaffold-data-pipeline/task-1-initialize-tanstack-start-project.md +210 -0
  134. package/agent/tasks/milestone-1-project-scaffold-data-pipeline/task-2-implement-data-model-yaml-parser.md +294 -0
  135. package/agent/tasks/milestone-1-project-scaffold-data-pipeline/task-3-build-server-api-data-loading.md +193 -0
  136. package/agent/tasks/milestone-1-project-scaffold-data-pipeline/task-4-add-auto-refresh-sse.md +262 -0
  137. package/agent/tasks/milestone-2-dashboard-views-interaction/task-10-polish-integration-testing.md +156 -0
  138. package/agent/tasks/milestone-2-dashboard-views-interaction/task-5-build-dashboard-layout-routing.md +178 -0
  139. package/agent/tasks/milestone-2-dashboard-views-interaction/task-6-build-overview-page.md +141 -0
  140. package/agent/tasks/milestone-2-dashboard-views-interaction/task-7-implement-milestone-table-view.md +153 -0
  141. package/agent/tasks/milestone-2-dashboard-views-interaction/task-8-implement-milestone-tree-view.md +174 -0
  142. package/agent/tasks/milestone-2-dashboard-views-interaction/task-9-implement-search-filtering.md +233 -0
  143. package/agent/tasks/task-1-{title}.template.md +244 -0
  144. package/bin/visualize.mjs +84 -0
  145. package/package.json +48 -0
  146. package/src/components/ExtraFieldsBadge.tsx +15 -0
  147. package/src/components/FilterBar.tsx +33 -0
  148. package/src/components/Header.tsx +23 -0
  149. package/src/components/MilestoneTable.tsx +167 -0
  150. package/src/components/MilestoneTree.tsx +84 -0
  151. package/src/components/ProgressBar.tsx +20 -0
  152. package/src/components/SearchInput.tsx +22 -0
  153. package/src/components/Sidebar.tsx +54 -0
  154. package/src/components/StatusBadge.tsx +23 -0
  155. package/src/components/StatusDot.tsx +12 -0
  156. package/src/components/TaskList.tsx +36 -0
  157. package/src/components/ViewToggle.tsx +31 -0
  158. package/src/lib/config.ts +8 -0
  159. package/src/lib/file-watcher.ts +43 -0
  160. package/src/lib/search.ts +48 -0
  161. package/src/lib/types.ts +73 -0
  162. package/src/lib/useAutoRefresh.ts +31 -0
  163. package/src/lib/useCollapse.ts +31 -0
  164. package/src/lib/useFilteredData.ts +55 -0
  165. package/src/lib/yaml-loader-real.spec.ts +47 -0
  166. package/src/lib/yaml-loader.spec.ts +201 -0
  167. package/src/lib/yaml-loader.ts +265 -0
  168. package/src/routeTree.gen.ts +140 -0
  169. package/src/router.tsx +10 -0
  170. package/src/routes/__root.tsx +75 -0
  171. package/src/routes/api/watch.ts +29 -0
  172. package/src/routes/index.tsx +115 -0
  173. package/src/routes/milestones.tsx +50 -0
  174. package/src/routes/search.tsx +84 -0
  175. package/src/routes/tasks.tsx +63 -0
  176. package/src/services/progress-database.service.ts +46 -0
  177. package/src/styles.css +25 -0
  178. package/tsconfig.json +24 -0
  179. package/vite.config.ts +16 -0
  180. package/vitest.config.ts +27 -0
@@ -0,0 +1,348 @@
1
+ #!/bin/bash
2
+
3
+ # Agent Context Protocol (ACP) Package Remove Script
4
+ # Removes installed ACP packages and updates manifest
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
+ AUTO_CONFIRM=false
18
+ KEEP_MODIFIED=false
19
+ GLOBAL_MODE=false
20
+
21
+ while [[ $# -gt 0 ]]; do
22
+ case $1 in
23
+ --global|-g)
24
+ GLOBAL_MODE=true
25
+ shift
26
+ ;;
27
+ -y|--yes)
28
+ AUTO_CONFIRM=true
29
+ shift
30
+ ;;
31
+ --keep-modified)
32
+ KEEP_MODIFIED=true
33
+ shift
34
+ ;;
35
+ *)
36
+ PACKAGE_NAME="$1"
37
+ shift
38
+ ;;
39
+ esac
40
+ done
41
+
42
+ # Check if package name provided
43
+ if [ -z "$PACKAGE_NAME" ]; then
44
+ echo "${RED}Error: Package name required${NC}"
45
+ echo "Usage: $0 [options] <package-name>"
46
+ echo ""
47
+ echo "Options:"
48
+ echo " --global, -g Remove global package"
49
+ echo " -y, --yes Skip confirmation prompts"
50
+ echo " --keep-modified Keep locally modified files"
51
+ echo ""
52
+ echo "Example: $0 firebase"
53
+ echo "Example: $0 --global firebase"
54
+ echo "Example: $0 --keep-modified firebase"
55
+ exit 1
56
+ fi
57
+
58
+ echo "${BLUE}📦 ACP Package Remover${NC}"
59
+ echo "========================================"
60
+ echo ""
61
+
62
+ # Determine manifest file based on mode
63
+ if [ "$GLOBAL_MODE" = true ]; then
64
+ MANIFEST_FILE="$HOME/.acp/manifest.yaml"
65
+ echo "${BLUE}Removing global package: $PACKAGE_NAME${NC}"
66
+ echo ""
67
+ else
68
+ MANIFEST_FILE="./agent/manifest.yaml"
69
+ echo "${BLUE}Removing package: $PACKAGE_NAME${NC}"
70
+ echo ""
71
+ fi
72
+
73
+ # Check if manifest exists
74
+ if [ ! -f "$MANIFEST_FILE" ]; then
75
+ if [ "$GLOBAL_MODE" = true ]; then
76
+ die "No global manifest found. No global packages installed."
77
+ else
78
+ die "No manifest found. No packages installed."
79
+ fi
80
+ fi
81
+
82
+ # Source YAML parser
83
+ source_yaml_parser
84
+
85
+ # Check if package is installed
86
+ if ! package_exists "$PACKAGE_NAME"; then
87
+ die "Package not installed: $PACKAGE_NAME"
88
+ fi
89
+
90
+ # Get package info
91
+ version=$(awk -v pkg="$PACKAGE_NAME" '
92
+ $0 ~ "^ " pkg ":" { in_pkg=1; next }
93
+ in_pkg && /^ [a-z]/ { in_pkg=0 }
94
+ in_pkg && /^ package_version:/ { print $2; exit }
95
+ ' "$MANIFEST_FILE")
96
+
97
+ echo "Package: ${GREEN}$PACKAGE_NAME${NC} ($version)"
98
+ echo ""
99
+
100
+ # Get installed files
101
+ patterns_files=$(awk -v pkg="$PACKAGE_NAME" '
102
+ BEGIN { in_pkg=0; in_patterns=0 }
103
+ $0 ~ "^ " pkg ":" { in_pkg=1; next }
104
+ in_pkg && /^ [a-z]/ { in_pkg=0 }
105
+ in_pkg && /^ patterns:/ { in_patterns=1; next }
106
+ in_patterns && /^ [a-z]/ { in_patterns=0 }
107
+ in_patterns && /^ - name:/ { print $3 }
108
+ ' "$MANIFEST_FILE")
109
+
110
+ commands_files=$(awk -v pkg="$PACKAGE_NAME" '
111
+ BEGIN { in_pkg=0; in_commands=0 }
112
+ $0 ~ "^ " pkg ":" { in_pkg=1; next }
113
+ in_pkg && /^ [a-z]/ { in_pkg=0 }
114
+ in_pkg && /^ commands:/ { in_commands=1; next }
115
+ in_commands && /^ [a-z]/ { in_commands=0 }
116
+ in_commands && /^ - name:/ { print $3 }
117
+ ' "$MANIFEST_FILE")
118
+
119
+ designs_files=$(awk -v pkg="$PACKAGE_NAME" '
120
+ BEGIN { in_pkg=0; in_designs=0 }
121
+ $0 ~ "^ " pkg ":" { in_pkg=1; next }
122
+ in_pkg && /^ [a-z]/ { in_pkg=0 }
123
+ in_pkg && /^ designs:/ { in_designs=1; next }
124
+ in_designs && /^ [a-z]/ { in_designs=0 }
125
+ in_designs && /^ - name:/ { print $3 }
126
+ ' "$MANIFEST_FILE")
127
+
128
+ indices_files=$(awk -v pkg="$PACKAGE_NAME" '
129
+ BEGIN { in_pkg=0; in_indices=0 }
130
+ $0 ~ "^ " pkg ":" { in_pkg=1; next }
131
+ in_pkg && /^ [a-z]/ { in_pkg=0 }
132
+ in_pkg && /^ indices:/ { in_indices=1; next }
133
+ in_indices && /^ [a-z]/ { in_indices=0 }
134
+ in_indices && /^ - name:/ { print $3 }
135
+ ' "$MANIFEST_FILE")
136
+
137
+ # Get template files with their target paths (name|target)
138
+ template_file_entries=$(awk -v pkg="$PACKAGE_NAME" '
139
+ BEGIN { in_pkg=0; in_files=0; name="" }
140
+ $0 ~ "^ " pkg ":" { in_pkg=1; next }
141
+ in_pkg && /^ [a-z]/ { in_pkg=0 }
142
+ in_pkg && /^ files:$/ { in_files=1; next }
143
+ in_files && /^ [a-z]/ { in_files=0 }
144
+ in_files && /^ - name:/ { name=$3 }
145
+ in_files && /^ target:/ { $1=""; gsub(/^ +/, ""); print name "|" $0 }
146
+ ' "$MANIFEST_FILE")
147
+
148
+ # Count files (handle empty strings properly)
149
+ if [ -n "$patterns_files" ]; then
150
+ patterns_count=$(echo "$patterns_files" | wc -l)
151
+ else
152
+ patterns_count=0
153
+ fi
154
+
155
+ if [ -n "$commands_files" ]; then
156
+ commands_count=$(echo "$commands_files" | wc -l)
157
+ else
158
+ commands_count=0
159
+ fi
160
+
161
+ if [ -n "$designs_files" ]; then
162
+ designs_count=$(echo "$designs_files" | wc -l)
163
+ else
164
+ designs_count=0
165
+ fi
166
+
167
+ if [ -n "$indices_files" ]; then
168
+ indices_count=$(echo "$indices_files" | wc -l)
169
+ else
170
+ indices_count=0
171
+ fi
172
+
173
+ if [ -n "$template_file_entries" ]; then
174
+ template_files_count=$(echo "$template_file_entries" | wc -l)
175
+ else
176
+ template_files_count=0
177
+ fi
178
+
179
+ total_files=$((patterns_count + commands_count + designs_count + indices_count + template_files_count))
180
+
181
+ echo "${YELLOW}⚠️ This will remove:${NC}"
182
+ [ "$patterns_count" -gt 0 ] && echo " - $patterns_count pattern(s)"
183
+ [ "$commands_count" -gt 0 ] && echo " - $commands_count command(s)"
184
+ [ "$designs_count" -gt 0 ] && echo " - $designs_count design(s)"
185
+ [ "$indices_count" -gt 0 ] && echo " - $indices_count index file(s)"
186
+ [ "$template_files_count" -gt 0 ] && echo " - $template_files_count file(s) (installed to project)"
187
+ echo ""
188
+ echo "Total: $total_files file(s)"
189
+ echo ""
190
+
191
+ # Check for modified files
192
+ modified_files=()
193
+ for file in $patterns_files; do
194
+ if is_file_modified "$PACKAGE_NAME" "patterns" "$file"; then
195
+ modified_files+=("patterns/$file")
196
+ fi
197
+ done
198
+
199
+ for file in $commands_files; do
200
+ if is_file_modified "$PACKAGE_NAME" "commands" "$file"; then
201
+ modified_files+=("commands/$file")
202
+ fi
203
+ done
204
+
205
+ for file in $designs_files; do
206
+ if is_file_modified "$PACKAGE_NAME" "design" "$file"; then
207
+ modified_files+=("design/$file")
208
+ fi
209
+ done
210
+
211
+ for file in $indices_files; do
212
+ if is_file_modified "$PACKAGE_NAME" "indices" "$file"; then
213
+ modified_files+=("index/$file")
214
+ fi
215
+ done
216
+
217
+ # Check template files for modifications
218
+ while IFS='|' read -r _fname _ftarget; do
219
+ [ -z "$_fname" ] && continue
220
+ if [ -n "$_ftarget" ] && is_template_file_modified "$PACKAGE_NAME" "$_fname" "$_ftarget"; then
221
+ modified_files+=("files/$_fname → $_ftarget")
222
+ fi
223
+ done <<< "$template_file_entries"
224
+
225
+ if [ ${#modified_files[@]} -gt 0 ]; then
226
+ echo "${YELLOW}⚠️ Modified files detected:${NC}"
227
+ for file in "${modified_files[@]}"; do
228
+ echo " - $file"
229
+ done
230
+ echo ""
231
+
232
+ if [ "$KEEP_MODIFIED" = true ]; then
233
+ echo "Modified files will be kept (--keep-modified)"
234
+ echo ""
235
+ fi
236
+ fi
237
+
238
+ # Confirm removal
239
+ if [ "$AUTO_CONFIRM" = false ]; then
240
+ read -p "Remove package '$PACKAGE_NAME'? (y/N) " -n 1 -r
241
+ echo
242
+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
243
+ echo "Removal cancelled"
244
+ exit 0
245
+ fi
246
+ fi
247
+
248
+ echo ""
249
+ echo "Removing files..."
250
+
251
+ # Remove files
252
+ removed_count=0
253
+ kept_count=0
254
+
255
+ for file in $patterns_files; do
256
+ if printf '%s\n' "${modified_files[@]}" | grep -q "^patterns/$file$" && [ "$KEEP_MODIFIED" = true ]; then
257
+ echo " ${YELLOW}⊙${NC} Kept patterns/$file (modified)"
258
+ kept_count=$((kept_count + 1))
259
+ else
260
+ if [ -f "agent/patterns/$file" ]; then
261
+ rm "agent/patterns/$file"
262
+ echo " ${GREEN}✓${NC} Removed patterns/$file"
263
+ removed_count=$((removed_count + 1))
264
+ fi
265
+ fi
266
+ done
267
+
268
+ for file in $commands_files; do
269
+ if printf '%s\n' "${modified_files[@]}" | grep -q "^commands/$file$" && [ "$KEEP_MODIFIED" = true ]; then
270
+ echo " ${YELLOW}⊙${NC} Kept commands/$file (modified)"
271
+ kept_count=$((kept_count + 1))
272
+ else
273
+ if [ -f "agent/commands/$file" ]; then
274
+ rm "agent/commands/$file"
275
+ echo " ${GREEN}✓${NC} Removed commands/$file"
276
+ removed_count=$((removed_count + 1))
277
+ fi
278
+ fi
279
+ done
280
+
281
+ for file in $designs_files; do
282
+ if printf '%s\n' "${modified_files[@]}" | grep -q "^design/$file$" && [ "$KEEP_MODIFIED" = true ]; then
283
+ echo " ${YELLOW}⊙${NC} Kept design/$file (modified)"
284
+ kept_count=$((kept_count + 1))
285
+ else
286
+ if [ -f "agent/design/$file" ]; then
287
+ rm "agent/design/$file"
288
+ echo " ${GREEN}✓${NC} Removed design/$file"
289
+ removed_count=$((removed_count + 1))
290
+ fi
291
+ fi
292
+ done
293
+
294
+ for file in $indices_files; do
295
+ if printf '%s\n' "${modified_files[@]}" | grep -q "^index/$file$" && [ "$KEEP_MODIFIED" = true ]; then
296
+ echo " ${YELLOW}⊙${NC} Kept index/$file (modified)"
297
+ kept_count=$((kept_count + 1))
298
+ else
299
+ if [ -f "agent/index/$file" ]; then
300
+ rm "agent/index/$file"
301
+ echo " ${GREEN}✓${NC} Removed index/$file"
302
+ removed_count=$((removed_count + 1))
303
+ fi
304
+ fi
305
+ done
306
+
307
+ # Remove template files (installed at target paths)
308
+ while IFS='|' read -r _fname _ftarget; do
309
+ [ -z "$_fname" ] && continue
310
+ if printf '%s\n' "${modified_files[@]}" | grep -q "^files/$_fname" && [ "$KEEP_MODIFIED" = true ]; then
311
+ echo " ${YELLOW}⊙${NC} Kept $_ftarget (modified)"
312
+ kept_count=$((kept_count + 1))
313
+ else
314
+ if [ -f "$_ftarget" ]; then
315
+ rm "$_ftarget"
316
+ echo " ${GREEN}✓${NC} Removed $_ftarget (from files/$_fname)"
317
+ removed_count=$((removed_count + 1))
318
+ fi
319
+ fi
320
+ done <<< "$template_file_entries"
321
+
322
+ # Remove package from manifest
323
+ echo ""
324
+ echo "Updating manifest..."
325
+
326
+ temp_file=$(mktemp)
327
+ awk -v pkg="$PACKAGE_NAME" '
328
+ BEGIN { in_pkg=0; skip=0 }
329
+ $0 ~ "^ " pkg ":" { in_pkg=1; skip=1; next }
330
+ in_pkg && /^ [a-z]/ && /:$/ { in_pkg=0; skip=0 }
331
+ in_pkg { next }
332
+ !skip { print }
333
+ ' "$MANIFEST_FILE" > "$temp_file"
334
+
335
+ mv "$temp_file" "$MANIFEST_FILE"
336
+
337
+ # Update manifest timestamp
338
+ update_manifest_timestamp
339
+
340
+ echo "${GREEN}✓${NC} Manifest updated"
341
+ echo ""
342
+ echo "${GREEN}✅ Removal complete!${NC}"
343
+ echo ""
344
+ echo "Removed: $removed_count file(s)"
345
+ if [ $kept_count -gt 0 ]; then
346
+ echo "Kept: $kept_count file(s) (modified)"
347
+ fi
348
+ echo ""
@@ -0,0 +1,156 @@
1
+ #!/bin/bash
2
+
3
+ # Agent Context Protocol (ACP) Package Search Script
4
+ # Search for ACP packages on GitHub using the GitHub API
5
+
6
+ # Note: set -e disabled because while loop runs in subshell
7
+ # and some commands may return non-zero without being errors
8
+ # set -e
9
+
10
+ # Source common utilities
11
+ SCRIPT_DIR="$(dirname "$0")"
12
+ . "${SCRIPT_DIR}/acp.common.sh"
13
+
14
+ # Initialize colors
15
+ init_colors
16
+
17
+ # Parse arguments
18
+ QUERY=""
19
+ TAG=""
20
+ USER=""
21
+ ORG=""
22
+ SORT="stars"
23
+ LIMIT=10
24
+
25
+ while [[ $# -gt 0 ]]; do
26
+ case $1 in
27
+ --tag)
28
+ TAG="$2"
29
+ shift 2
30
+ ;;
31
+ --user)
32
+ USER="$2"
33
+ shift 2
34
+ ;;
35
+ --org)
36
+ ORG="$2"
37
+ shift 2
38
+ ;;
39
+ --sort)
40
+ SORT="$2"
41
+ shift 2
42
+ ;;
43
+ --limit)
44
+ LIMIT="$2"
45
+ shift 2
46
+ ;;
47
+ *)
48
+ QUERY="$1"
49
+ shift
50
+ ;;
51
+ esac
52
+ done
53
+
54
+ echo "${BLUE}🔍 ACP Package Search${NC}"
55
+ echo "========================================"
56
+ echo ""
57
+
58
+ # Build search query
59
+ # Always filter by topic:acp-package to ensure only actual ACP packages are returned
60
+ if [ -n "$QUERY" ]; then
61
+ SEARCH_QUERY="${QUERY}+topic:acp-package"
62
+ else
63
+ SEARCH_QUERY="topic:acp-package"
64
+ fi
65
+
66
+ if [ -n "$TAG" ]; then
67
+ SEARCH_QUERY="$SEARCH_QUERY+topic:$TAG"
68
+ fi
69
+
70
+ if [ -n "$USER" ]; then
71
+ SEARCH_QUERY="$SEARCH_QUERY+user:$USER"
72
+ fi
73
+
74
+ if [ -n "$ORG" ]; then
75
+ SEARCH_QUERY="$SEARCH_QUERY+org:$ORG"
76
+ fi
77
+
78
+ info "Searching GitHub for: $SEARCH_QUERY"
79
+ info "Sort by: $SORT"
80
+ info "Limit: $LIMIT"
81
+ echo ""
82
+
83
+ # Search GitHub repositories
84
+ GITHUB_API="https://api.github.com/search/repositories"
85
+ SEARCH_URL="${GITHUB_API}?q=${SEARCH_QUERY}&sort=${SORT}&per_page=${LIMIT}"
86
+
87
+ # Make API request
88
+ RESPONSE=$(curl -s -H "Accept: application/vnd.github+json" "$SEARCH_URL")
89
+
90
+ # Check for API errors
91
+ if echo "$RESPONSE" | grep -q '"message"'; then
92
+ ERROR_MSG=$(echo "$RESPONSE" | grep -o '"message":"[^"]*"' | cut -d'"' -f4)
93
+ die "GitHub API error: $ERROR_MSG"
94
+ fi
95
+
96
+ # Parse results (handle spaces in JSON)
97
+ TOTAL_COUNT=$(echo "$RESPONSE" | grep -o '"total_count"[: ]*[0-9]*' | grep -o '[0-9]*$')
98
+
99
+ if [ -z "$TOTAL_COUNT" ] || [ "$TOTAL_COUNT" -eq 0 ]; then
100
+ echo "${YELLOW}No packages found matching your search${NC}"
101
+ echo ""
102
+ echo "Try:"
103
+ echo " - Broader search terms"
104
+ echo " - Different tags"
105
+ echo " - Removing filters"
106
+ exit 0
107
+ fi
108
+
109
+ echo "${GREEN}📦 Found $TOTAL_COUNT package(s)${NC}"
110
+ echo ""
111
+
112
+ # Parse and display each result
113
+ REPO_COUNT=0
114
+
115
+ echo "$RESPONSE" | grep -o '"full_name": "[^"]*"' | cut -d'"' -f4 | while read -r full_name; do
116
+ REPO_COUNT=$((REPO_COUNT + 1))
117
+
118
+ # Extract repo info from response
119
+ REPO_DATA=$(echo "$RESPONSE" | grep -A 20 "\"full_name\":\"$full_name\"")
120
+
121
+ DESCRIPTION=$(echo "$REPO_DATA" | grep -o '"description"[: ]*"[^"]*"' | head -1 | sed 's/"description"[: ]*"//' | sed 's/"$//')
122
+ STARS=$(echo "$REPO_DATA" | grep -o '"stargazers_count"[: ]*[0-9]*' | head -1 | grep -o '[0-9]*$')
123
+ URL="https://github.com/$full_name"
124
+
125
+ # Fetch package.yaml to get version and tags
126
+ PACKAGE_YAML_URL="https://raw.githubusercontent.com/$full_name/main/package.yaml"
127
+ PACKAGE_YAML=$(curl -s "$PACKAGE_YAML_URL" 2>/dev/null)
128
+
129
+ if [ -n "$PACKAGE_YAML" ]; then
130
+ VERSION=$(echo "$PACKAGE_YAML" | awk '/^version:/ {print $2; exit}')
131
+ PACKAGE_NAME=$(echo "$PACKAGE_YAML" | awk '/^name:/ {print $2; exit}')
132
+ TAGS=$(echo "$PACKAGE_YAML" | awk '/^tags:/,/^[a-z]/ {if (/^ - /) {gsub(/^ - /, ""); print}}' | tr '\n' ', ' | sed 's/,$//')
133
+ else
134
+ VERSION="unknown"
135
+ PACKAGE_NAME=$(echo "$full_name" | cut -d'/' -f2)
136
+ TAGS=""
137
+ fi
138
+
139
+ # Display result
140
+ echo "${GREEN}$REPO_COUNT. $PACKAGE_NAME${NC} (${BLUE}$VERSION${NC}) ⭐ $STARS"
141
+ echo " $URL"
142
+ if [ -n "$DESCRIPTION" ] && [ "$DESCRIPTION" != "null" ]; then
143
+ echo " $DESCRIPTION"
144
+ fi
145
+ if [ -n "$TAGS" ]; then
146
+ echo " Tags: $TAGS"
147
+ fi
148
+ echo " Install: ./agent/scripts/acp.package-install.sh --repo $URL.git"
149
+ echo ""
150
+ done
151
+
152
+ echo "Showing $REPO_COUNT of $TOTAL_COUNT result(s)"
153
+ echo ""
154
+ echo "To install a package:"
155
+ echo " ./agent/scripts/acp.package-install.sh --repo <repository-url>"
156
+ echo ""