@miller-tech/uap 1.8.1 → 1.10.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 (202) hide show
  1. package/README.md +285 -642
  2. package/config/chat_template.jinja +76 -0
  3. package/config/lora-finetune.yaml +82 -0
  4. package/config/model-profiles/claude-haiku-3.5.json +62 -0
  5. package/config/model-profiles/claude-opus-4.6.json +63 -0
  6. package/config/model-profiles/claude-sonnet-4.6.json +63 -0
  7. package/config/model-profiles/gemini-2.5-flash.json +62 -0
  8. package/config/model-profiles/gemini-2.5-pro.json +62 -0
  9. package/config/model-profiles/generic.json +54 -0
  10. package/config/model-profiles/glm-5.json +61 -0
  11. package/config/model-profiles/gpt-4.1.json +64 -0
  12. package/config/model-profiles/gpt-4o.json +64 -0
  13. package/config/model-profiles/gpt-o3.json +61 -0
  14. package/config/model-profiles/kimi-k2.5.json +70 -0
  15. package/config/model-profiles/llama.json +86 -0
  16. package/config/model-profiles/qwen35.json +218 -0
  17. package/dist/.tsbuildinfo +1 -1
  18. package/dist/bin/cli.js +78 -9
  19. package/dist/bin/cli.js.map +1 -1
  20. package/dist/bin/llama-server-optimize.js +0 -10
  21. package/dist/bin/llama-server-optimize.js.map +1 -1
  22. package/dist/bin/policy.js +11 -195
  23. package/dist/bin/policy.js.map +1 -1
  24. package/dist/cli/dashboard.d.ts.map +1 -1
  25. package/dist/cli/dashboard.js +14 -14
  26. package/dist/cli/dashboard.js.map +1 -1
  27. package/dist/cli/generate.d.ts +0 -7
  28. package/dist/cli/generate.d.ts.map +1 -1
  29. package/dist/cli/generate.js +10 -22
  30. package/dist/cli/generate.js.map +1 -1
  31. package/dist/cli/hooks.d.ts +1 -1
  32. package/dist/cli/hooks.d.ts.map +1 -1
  33. package/dist/cli/hooks.js +371 -0
  34. package/dist/cli/hooks.js.map +1 -1
  35. package/dist/cli/init.d.ts.map +1 -1
  36. package/dist/cli/init.js +120 -3
  37. package/dist/cli/init.js.map +1 -1
  38. package/dist/cli/memory.d.ts.map +1 -1
  39. package/dist/cli/memory.js +43 -109
  40. package/dist/cli/memory.js.map +1 -1
  41. package/dist/cli/model.d.ts.map +1 -1
  42. package/dist/cli/model.js +8 -25
  43. package/dist/cli/model.js.map +1 -1
  44. package/dist/cli/patterns.d.ts.map +1 -1
  45. package/dist/cli/patterns.js +11 -9
  46. package/dist/cli/patterns.js.map +1 -1
  47. package/dist/cli/policy.d.ts.map +1 -1
  48. package/dist/cli/policy.js +165 -1
  49. package/dist/cli/policy.js.map +1 -1
  50. package/dist/cli/rtk-validation.d.ts +0 -4
  51. package/dist/cli/rtk-validation.d.ts.map +1 -1
  52. package/dist/cli/rtk-validation.js +5 -23
  53. package/dist/cli/rtk-validation.js.map +1 -1
  54. package/dist/cli/schema-diff.d.ts.map +1 -1
  55. package/dist/cli/schema-diff.js +25 -16
  56. package/dist/cli/schema-diff.js.map +1 -1
  57. package/dist/cli/setup-wizard.d.ts.map +1 -1
  58. package/dist/cli/setup-wizard.js +13 -9
  59. package/dist/cli/setup-wizard.js.map +1 -1
  60. package/dist/cli/setup.d.ts.map +1 -1
  61. package/dist/cli/setup.js +3 -4
  62. package/dist/cli/setup.js.map +1 -1
  63. package/dist/cli/visualize.d.ts +6 -13
  64. package/dist/cli/visualize.d.ts.map +1 -1
  65. package/dist/cli/visualize.js +35 -64
  66. package/dist/cli/visualize.js.map +1 -1
  67. package/dist/cli/worktree.d.ts.map +1 -1
  68. package/dist/cli/worktree.js +12 -13
  69. package/dist/cli/worktree.js.map +1 -1
  70. package/dist/coordination/adaptive-patterns.d.ts.map +1 -1
  71. package/dist/coordination/adaptive-patterns.js +7 -3
  72. package/dist/coordination/adaptive-patterns.js.map +1 -1
  73. package/dist/coordination/deploy-batcher.d.ts.map +1 -1
  74. package/dist/coordination/deploy-batcher.js +8 -8
  75. package/dist/coordination/deploy-batcher.js.map +1 -1
  76. package/dist/dashboard/data-service.d.ts.map +1 -1
  77. package/dist/dashboard/data-service.js +12 -13
  78. package/dist/dashboard/data-service.js.map +1 -1
  79. package/dist/dashboard/server.d.ts.map +1 -1
  80. package/dist/dashboard/server.js +23 -8
  81. package/dist/dashboard/server.js.map +1 -1
  82. package/dist/index.d.ts +4 -4
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js +3 -3
  85. package/dist/index.js.map +1 -1
  86. package/dist/mcp-router/executor/client.d.ts +0 -6
  87. package/dist/mcp-router/executor/client.d.ts.map +1 -1
  88. package/dist/mcp-router/executor/client.js +1 -27
  89. package/dist/mcp-router/executor/client.js.map +1 -1
  90. package/dist/mcp-router/index.d.ts +1 -1
  91. package/dist/mcp-router/index.d.ts.map +1 -1
  92. package/dist/mcp-router/index.js.map +1 -1
  93. package/dist/mcp-router/output-compressor.js +114 -112
  94. package/dist/mcp-router/output-compressor.js.map +1 -1
  95. package/dist/mcp-router/types.d.ts +0 -5
  96. package/dist/mcp-router/types.d.ts.map +1 -1
  97. package/dist/memory/backends/github.d.ts.map +1 -1
  98. package/dist/memory/backends/github.js +21 -13
  99. package/dist/memory/backends/github.js.map +1 -1
  100. package/dist/memory/context-pruner.d.ts +2 -9
  101. package/dist/memory/context-pruner.d.ts.map +1 -1
  102. package/dist/memory/context-pruner.js +5 -22
  103. package/dist/memory/context-pruner.js.map +1 -1
  104. package/dist/memory/correction-propagator.d.ts.map +1 -1
  105. package/dist/memory/correction-propagator.js +19 -19
  106. package/dist/memory/correction-propagator.js.map +1 -1
  107. package/dist/memory/dynamic-retrieval.d.ts.map +1 -1
  108. package/dist/memory/dynamic-retrieval.js +263 -132
  109. package/dist/memory/dynamic-retrieval.js.map +1 -1
  110. package/dist/memory/embeddings.d.ts.map +1 -1
  111. package/dist/memory/embeddings.js +2 -15
  112. package/dist/memory/embeddings.js.map +1 -1
  113. package/dist/memory/hierarchical-memory.d.ts.map +1 -1
  114. package/dist/memory/hierarchical-memory.js +6 -0
  115. package/dist/memory/hierarchical-memory.js.map +1 -1
  116. package/dist/memory/knowledge-graph.d.ts.map +1 -1
  117. package/dist/memory/knowledge-graph.js +2 -1
  118. package/dist/memory/knowledge-graph.js.map +1 -1
  119. package/dist/memory/memory-consolidator.d.ts +1 -0
  120. package/dist/memory/memory-consolidator.d.ts.map +1 -1
  121. package/dist/memory/memory-consolidator.js +27 -3
  122. package/dist/memory/memory-consolidator.js.map +1 -1
  123. package/dist/memory/predictive-memory.d.ts +9 -1
  124. package/dist/memory/predictive-memory.d.ts.map +1 -1
  125. package/dist/memory/predictive-memory.js +77 -1
  126. package/dist/memory/predictive-memory.js.map +1 -1
  127. package/dist/memory/serverless-qdrant.d.ts +1 -0
  128. package/dist/memory/serverless-qdrant.d.ts.map +1 -1
  129. package/dist/memory/serverless-qdrant.js +3 -9
  130. package/dist/memory/serverless-qdrant.js.map +1 -1
  131. package/dist/memory/short-term/schema.d.ts.map +1 -1
  132. package/dist/memory/short-term/schema.js +44 -6
  133. package/dist/memory/short-term/schema.js.map +1 -1
  134. package/dist/memory/short-term/sqlite.d.ts +4 -3
  135. package/dist/memory/short-term/sqlite.d.ts.map +1 -1
  136. package/dist/memory/short-term/sqlite.js +3 -12
  137. package/dist/memory/short-term/sqlite.js.map +1 -1
  138. package/dist/memory/speculative-cache.js +2 -2
  139. package/dist/memory/speculative-cache.js.map +1 -1
  140. package/dist/models/executor.d.ts +21 -0
  141. package/dist/models/executor.d.ts.map +1 -1
  142. package/dist/models/executor.js +116 -4
  143. package/dist/models/executor.js.map +1 -1
  144. package/dist/models/planner.d.ts +1 -0
  145. package/dist/models/planner.d.ts.map +1 -1
  146. package/dist/models/planner.js +13 -1
  147. package/dist/models/planner.js.map +1 -1
  148. package/dist/policies/enforced-tool-router.d.ts +3 -1
  149. package/dist/policies/enforced-tool-router.d.ts.map +1 -1
  150. package/dist/policies/enforced-tool-router.js.map +1 -1
  151. package/dist/tasks/service.d.ts +1 -0
  152. package/dist/tasks/service.d.ts.map +1 -1
  153. package/dist/tasks/service.js +10 -6
  154. package/dist/tasks/service.js.map +1 -1
  155. package/dist/telemetry/session-telemetry.d.ts.map +1 -1
  156. package/dist/telemetry/session-telemetry.js +73 -17
  157. package/dist/telemetry/session-telemetry.js.map +1 -1
  158. package/dist/types/config.d.ts +377 -263
  159. package/dist/types/config.d.ts.map +1 -1
  160. package/dist/types/config.js +13 -67
  161. package/dist/types/config.js.map +1 -1
  162. package/dist/utils/config-loader.d.ts +34 -0
  163. package/dist/utils/config-loader.d.ts.map +1 -0
  164. package/dist/utils/config-loader.js +93 -0
  165. package/dist/utils/config-loader.js.map +1 -0
  166. package/dist/utils/lazy-imports.d.ts +18 -0
  167. package/dist/utils/lazy-imports.d.ts.map +1 -0
  168. package/dist/utils/lazy-imports.js +39 -0
  169. package/dist/utils/lazy-imports.js.map +1 -0
  170. package/dist/utils/stopwords.d.ts +12 -0
  171. package/dist/utils/stopwords.d.ts.map +1 -0
  172. package/dist/utils/stopwords.js +196 -0
  173. package/dist/utils/stopwords.js.map +1 -0
  174. package/dist/utils/string-similarity.d.ts +10 -3
  175. package/dist/utils/string-similarity.d.ts.map +1 -1
  176. package/dist/utils/string-similarity.js +49 -25
  177. package/dist/utils/string-similarity.js.map +1 -1
  178. package/docs/INDEX.md +35 -34
  179. package/package.json +13 -14
  180. package/scripts/maintenance/publish-npm.sh +82 -0
  181. package/scripts/maintenance/publish.sh +29 -0
  182. package/scripts/maintenance/update-droids.py +93 -0
  183. package/scripts/maintenance/update-skills.py +148 -0
  184. package/scripts/maintenance/update-uap-compliance.sh +45 -0
  185. package/scripts/maintenance/validate-skills.py +83 -0
  186. package/scripts/maintenance/verify-compliance.sh +117 -0
  187. package/scripts/setup/install-cloakbrowser.ts +14 -0
  188. package/scripts/setup/install-desktop.sh +105 -0
  189. package/scripts/setup/install-rtk.sh +184 -0
  190. package/scripts/setup/install-web.sh +73 -0
  191. package/scripts/setup/setup.sh +375 -0
  192. package/scripts/validate-build.sh +62 -0
  193. package/scripts/version-bump.sh +130 -0
  194. package/tools/agents/scripts/migrate_memory_to_qdrant.py +1 -1
  195. /package/docs/{BENCHMARK_GAPS_AND_PLAN.md → archive/BENCHMARK_GAPS_AND_PLAN.md} +0 -0
  196. /package/docs/{MODEL_ROUTING_IMPLEMENTATION_SUMMARY.md → archive/MODEL_ROUTING_IMPLEMENTATION_SUMMARY.md} +0 -0
  197. /package/docs/{MODEL_ROUTING_OPTIMIZATION_PLAN.md → archive/MODEL_ROUTING_OPTIMIZATION_PLAN.md} +0 -0
  198. /package/docs/{PARALLELISM_GAPS_AND_OPTIONS.md → archive/PARALLELISM_GAPS_AND_OPTIONS.md} +0 -0
  199. /package/docs/{POLICY_GATE_IMPLEMENTATION.md → archive/POLICY_GATE_IMPLEMENTATION.md} +0 -0
  200. /package/docs/{UAP_OPTIMIZATION_PLAN.md → archive/UAP_OPTIMIZATION_PLAN.md} +0 -0
  201. /package/docs/{opencode-integration-guide.md → archive/opencode-integration-guide.md} +0 -0
  202. /package/docs/{opencode-integration-quickref.md → archive/opencode-integration-quickref.md} +0 -0
@@ -0,0 +1,375 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # Colors
5
+ GREEN='\033[0;32m'
6
+ YELLOW='\033[1;33m'
7
+ RED='\033[0;31m'
8
+ BLUE='\033[0;34m'
9
+ NC='\033[0m' # No Color
10
+
11
+ # Configuration
12
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
13
+ PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
14
+ HOOKS_DIR="${PROJECT_ROOT}/.git/hooks"
15
+
16
+ echo -e "${BLUE}🔧 Universal Agent Memory - Complete Setup${NC}"
17
+ echo "================================================"
18
+ echo ""
19
+
20
+ # ============================================================================
21
+ # DEPENDENCY CHECKS
22
+ # ============================================================================
23
+
24
+ echo -e "${BLUE}Checking dependencies...${NC}"
25
+ echo ""
26
+
27
+ MISSING_DEPS=()
28
+ RECOMMENDED_DEPS=()
29
+
30
+ # Required dependencies
31
+ echo -e "${YELLOW}Required dependencies:${NC}"
32
+
33
+ if ! command -v node &> /dev/null; then
34
+ echo -e " ${RED}✗${NC} Node.js (>= 18.0.0)"
35
+ MISSING_DEPS+=("Node.js >= 18.0.0")
36
+ else
37
+ NODE_VERSION=$(node -v | cut -d'v' -f2 | cut -d'.' -f1)
38
+ if [ "$NODE_VERSION" -lt 18 ]; then
39
+ echo -e " ${RED}✗${NC} Node.js (>= 18.0.0, found $(node -v))"
40
+ MISSING_DEPS+=("Node.js >= 18.0.0")
41
+ else
42
+ echo -e " ${GREEN}✓${NC} Node.js $(node -v)"
43
+ fi
44
+ fi
45
+
46
+ if ! command -v npm &> /dev/null; then
47
+ echo -e " ${RED}✗${NC} npm"
48
+ MISSING_DEPS+=("npm")
49
+ else
50
+ echo -e " ${GREEN}✓${NC} npm $(npm -v)"
51
+ fi
52
+
53
+ if ! command -v git &> /dev/null; then
54
+ echo -e " ${RED}✗${NC} git"
55
+ MISSING_DEPS+=("git")
56
+ else
57
+ echo -e " ${GREEN}✓${NC} git $(git --version | cut -d' ' -f3)"
58
+ fi
59
+
60
+ if ! command -v npx &> /dev/null; then
61
+ echo -e " ${RED}✗${NC} npx"
62
+ MISSING_DEPS+=("npx")
63
+ else
64
+ echo -e " ${GREEN}✓${NC} npx"
65
+ fi
66
+
67
+ echo ""
68
+ echo -e "${YELLOW}Recommended dependencies (optional but useful):${NC}"
69
+
70
+ if command -v docker &> /dev/null; then
71
+ echo -e " ${GREEN}✓${NC} Docker (enables local Qdrant for semantic search)"
72
+ else
73
+ echo -e " ${YELLOW}⚠${NC} Docker (install for local Qdrant: `curl -fsSL https://get.docker.com | sh`)"
74
+ RECOMMENDED_DEPS+=("Docker")
75
+ fi
76
+
77
+ if command -v python3 &> /dev/null; then
78
+ PYTHON_VERSION=$(python3 --version | cut -d' ' -f2)
79
+ echo -e " ${GREEN}✓${NC} Python 3 (${PYTHON_VERSION}) (enables Pattern RAG)"
80
+ else
81
+ echo -e " ${YELLOW}⚠${NC} Python 3 (install for Pattern RAG: `brew install python` or `apt install python3`)"
82
+ RECOMMENDED_DEPS+=("Python 3")
83
+ fi
84
+
85
+ if command -v pre-commit &> /dev/null; then
86
+ echo -e " ${GREEN}✓${NC} pre-commit (enables advanced git hooks)"
87
+ else
88
+ echo -e " ${YELLOW}⚠${NC} pre-commit (install for advanced hooks: `pip install pre-commit`)"
89
+ fi
90
+
91
+ echo ""
92
+
93
+ # ============================================================================
94
+ # INSTALLATION
95
+ # ============================================================================
96
+
97
+ if [ ${#MISSING_DEPS[@]} -gt 0 ]; then
98
+ echo -e "${RED}❌ Missing required dependencies:${NC}"
99
+ for dep in "${MISSING_DEPS[@]}"; do
100
+ echo -e " - ${dep}"
101
+ done
102
+ echo ""
103
+ echo "Please install the missing dependencies and run this script again."
104
+ echo ""
105
+ echo "Quick install commands:"
106
+ echo " # macOS:"
107
+ echo " brew install node git python docker"
108
+ echo ""
109
+ echo " # Ubuntu/Debian:"
110
+ echo " curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -"
111
+ echo " sudo apt-get install -y nodejs python3 docker.io"
112
+ echo ""
113
+ echo " # Windows (using winget):"
114
+ echo " winget install OpenJS.NodeJS.LTS"
115
+ echo " winget install Git.Git"
116
+ echo " winget install Python.Python.3.12"
117
+ echo " winget install Docker.DockerDesktop"
118
+ echo ""
119
+ exit 1
120
+ fi
121
+
122
+ # Install npm dependencies
123
+ echo -e "${BLUE}Installing npm dependencies...${NC}"
124
+ cd "$PROJECT_ROOT"
125
+
126
+ if [ ! -d "node_modules" ]; then
127
+ npm install
128
+ echo -e "${GREEN}✓${NC} npm dependencies installed"
129
+ else
130
+ echo -e "${GREEN}✓${NC} npm dependencies already installed (skipping)"
131
+ fi
132
+
133
+ # Build TypeScript
134
+ echo ""
135
+ echo -e "${BLUE}Building TypeScript...${NC}"
136
+ npm run build
137
+ if [ $? -eq 0 ]; then
138
+ echo -e "${GREEN}✓${NC} TypeScript build completed"
139
+ else
140
+ echo -e "${RED}✗${NC} TypeScript build failed"
141
+ exit 1
142
+ fi
143
+
144
+ # ============================================================================
145
+ # GIT HOOKS SETUP
146
+ # ============================================================================
147
+
148
+ echo ""
149
+ echo -e "${BLUE}Setting up git hooks...${NC}"
150
+
151
+ # Create hooks directory if it doesn't exist
152
+ if [ ! -d "$HOOKS_DIR" ]; then
153
+ echo -e " ${YELLOW}⚠${NC} Not a git repository, skipping hooks setup"
154
+ else
155
+ # Create hooks directory
156
+ mkdir -p "$HOOKS_DIR"
157
+
158
+ # Pre-commit hook - enforces worktree usage and code quality
159
+ cat > "${HOOKS_DIR}/pre-commit" << 'HOOKEOF'
160
+ #!/usr/bin/env bash
161
+ # UAP Pre-Commit Hook — Enforces worktree usage and code quality
162
+ set -euo pipefail
163
+
164
+ RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[0;33m'; NC='\033[0m'
165
+ fail() { echo -e "${RED}[PRE-COMMIT] BLOCKED: $1${NC}"; exit 1; }
166
+ warn() { echo -e "${YELLOW}[PRE-COMMIT] WARNING: $1${NC}"; }
167
+ ok() { echo -e "${GREEN}[PRE-COMMIT] $1${NC}"; }
168
+
169
+ PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
170
+
171
+ # Gate 1: Worktree Enforcement — NO EXCEPTIONS
172
+ UAP_CONFIG="${PROJECT_ROOT}/.uap.json"
173
+ WORKTREE_ENABLED="true"
174
+ if [[ -f "$UAP_CONFIG" ]] && command -v python3 &>/dev/null; then
175
+ WORKTREE_ENABLED=$(python3 -c "
176
+ import json
177
+ try:
178
+ c = json.load(open('$UAP_CONFIG'))
179
+ print('true' if c.get('template',{}).get('sections',{}).get('worktreeWorkflow', True) else 'false')
180
+ except: print('true')
181
+ " 2>/dev/null || echo "true")
182
+ fi
183
+
184
+ if [[ "$WORKTREE_ENABLED" == "true" ]]; then
185
+ CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "unknown")
186
+ GIT_COMMON_DIR=$(git rev-parse --git-common-dir 2>/dev/null || echo "")
187
+ GIT_DIR=$(git rev-parse --git-dir 2>/dev/null || echo "")
188
+ IS_WORKTREE="false"
189
+ if [[ "$GIT_DIR" != "$GIT_COMMON_DIR" ]]; then IS_WORKTREE="true"; fi
190
+
191
+ if [[ "$IS_WORKTREE" == "false" && ("$CURRENT_BRANCH" == "main" || "$CURRENT_BRANCH" == "master") ]]; then
192
+ fail "Direct commits to '$CURRENT_BRANCH' are prohibited. No exceptions.
193
+ Use a worktree: uap worktree create <slug>
194
+ Then work in: .worktrees/<id>-<slug>/
195
+ Version bumps must be done on the feature branch before merging.
196
+ See: policies/worktree-enforcement.md"
197
+ fi
198
+ ok "Worktree check passed"
199
+ fi
200
+
201
+ # Gate 2: No secrets in staged files
202
+ STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM 2>/dev/null || echo "")
203
+ for file in $STAGED_FILES; do
204
+ case "$file" in
205
+ .env|.env.*|*.pem|*.key|credentials.json|*secret*|*.p12)
206
+ fail "Potential secret file staged: $file";;
207
+ esac
208
+ done
209
+ ok "Secret scan passed"
210
+
211
+ # Gate 3: No debug code (warning only)
212
+ TS_STAGED=$(echo "$STAGED_FILES" | grep '\.ts$' || true)
213
+ if [[ -n "$TS_STAGED" ]]; then
214
+ for file in $TS_STAGED; do
215
+ if [[ -f "$file" ]]; then
216
+ MATCHES=$(git diff --cached -U0 -- "$file" 2>/dev/null | grep '^+' | grep -n 'console\.log\|debugger;' | head -3 || true)
217
+ if [[ -n "$MATCHES" ]]; then
218
+ warn "Debug code in ${file}: ${MATCHES}"
219
+ fi
220
+ fi
221
+ done
222
+ fi
223
+
224
+ ok "All pre-commit gates passed"
225
+ HOOKEOF
226
+ chmod +x "${HOOKS_DIR}/pre-commit"
227
+ echo " ✓ Created pre-commit hook"
228
+
229
+ # Commit-msg hook - validates commit messages
230
+ cat > "${HOOKS_DIR}/commit-msg" << 'EOF'
231
+ #!/bin/bash
232
+ #
233
+ # UAP Commit-msg Hook
234
+ #
235
+ # Ensures commit messages follow conventional commits format:
236
+ # - feat: New feature
237
+ # - fix: Bug fix
238
+ # - docs: Documentation
239
+ # - style: Formatting
240
+ # - refactor: Code refactoring
241
+ # - test: Tests
242
+ # - chore: Maintenance
243
+ #
244
+
245
+ COMMIT_MSG_FILE=$1
246
+ COMMIT_MSG=$(cat "$COMMIT_MSG_FILE")
247
+
248
+ # Skip if commit is empty or merge commit
249
+ if [[ -z "$COMMIT_MSG" ]] || [[ "$COMMIT_MSG" == "Merge"* ]]; then
250
+ exit 0
251
+ fi
252
+
253
+ # Check for conventional commit format
254
+ if echo "$COMMIT_MSG" | grep -qE "^(feat|fix|docs|style|refactor|test|chore|perf|ci|build|revert)(\([a-z-]+\))?: .+"; then
255
+ echo "✓ Commit message format valid"
256
+ exit 0
257
+ else
258
+ echo "Warning: Commit message doesn't follow conventional commits format."
259
+ echo "Recommended format: type(scope): description"
260
+ echo "Types: feat, fix, docs, style, refactor, test, chore, perf, ci, build, revert"
261
+ echo ""
262
+ echo "Examples:"
263
+ echo " feat: Add worktree creation command"
264
+ echo " fix(api): Resolve memory database path issue"
265
+ echo " docs: Update README with setup instructions"
266
+ echo ""
267
+ echo "Continue with commit? [y/N] "
268
+ read -r response
269
+ if [[ "$response" =~ ^(yes|y|Y)$ ]]; then
270
+ exit 0
271
+ else
272
+ echo "Commit aborted. Please edit your commit message."
273
+ exit 1
274
+ fi
275
+ fi
276
+ EOF
277
+ chmod +x "${HOOKS_DIR}/commit-msg"
278
+ echo " ✓ Created commit-msg hook"
279
+
280
+ # Pre-push hook - runs tests before pushing
281
+ cat > "${HOOKS_DIR}/pre-push" << 'EOF'
282
+ #!/bin/bash
283
+ #
284
+ # UAP Pre-push Hook
285
+ #
286
+ # Runs tests before pushing to remote
287
+ #
288
+
289
+ echo "Running tests before push..."
290
+ if npm test 2>&1 | tail -5; then
291
+ if [ ${PIPESTATUS[0]} -eq 0 ]; then
292
+ echo "✓ All tests passed"
293
+ exit 0
294
+ fi
295
+ fi
296
+
297
+ echo "Error: Tests failed. Fix tests before pushing."
298
+ exit 1
299
+ EOF
300
+ chmod +x "${HOOKS_DIR}/pre-push"
301
+ echo " ✓ Created pre-push hook"
302
+
303
+ echo ""
304
+ echo -e "${GREEN}✓${NC} Git hooks configured successfully"
305
+ fi
306
+
307
+ # ============================================================================
308
+ # OPTIONAL: CREATE .GITCHRCL (for GitHub CLI)
309
+ # ============================================================================
310
+
311
+ if command -v gh &> /dev/null; then
312
+ echo ""
313
+ echo -e "${BLUE}GitHub CLI detected. Setting up default PR template...${NC}"
314
+
315
+ if [ ! -f "${PROJECT_ROOT}/.github/pull_request_template.md" ]; then
316
+ mkdir -p "${PROJECT_ROOT}/.github"
317
+ cat > "${PROJECT_ROOT}/.github/pull_request_template.md" << 'EOF'
318
+ <!-- UAP Worktree PR Template -->
319
+ ## Summary
320
+ <!-- Describe what this PR does -->
321
+
322
+ ## Changes
323
+ <!-- List key changes -->
324
+ -
325
+
326
+ ## Testing
327
+ <!-- How did you test this? -->
328
+ - [ ] Tests pass: `npm test`
329
+ - [ ] Linting passes: `npm run lint`
330
+ - [ ] Manually tested (if applicable)
331
+
332
+ ## Related Issue
333
+ <!-- Link to related issue if any -->
334
+ Closes #
335
+
336
+ ---
337
+ <!-- UAP - Created via worktree: uap worktree pr -->
338
+ EOF
339
+ echo " ✓ Created PR template"
340
+ fi
341
+ fi
342
+
343
+ # ============================================================================
344
+ # SETUP COMPLETE
345
+ # ============================================================================
346
+
347
+ echo ""
348
+ echo -e "${GREEN}✅ Setup complete!${NC}"
349
+ echo ""
350
+
351
+ if [ ${#RECOMMENDED_DEPS[@]} -gt 0 ]; then
352
+ echo -e "${YELLOW}Recommended: Install missing optional dependencies${NC}"
353
+ for dep in "${RECOMMENDED_DEPS[@]}"; do
354
+ echo " - ${dep}"
355
+ done
356
+ echo ""
357
+ echo "You can install these later. Core functionality will work without them."
358
+ echo ""
359
+ fi
360
+
361
+ echo -e "${BLUE}Next steps:${NC}"
362
+ echo ""
363
+ echo "1. Initialize UAP in your project:"
364
+ echo " npx universal-agent-protocol init"
365
+ echo ""
366
+ echo "2. Review the generated CLAUDE.md"
367
+ echo ""
368
+ echo "3. Start working - your AI assistant will follow the workflows!"
369
+ echo ""
370
+ echo "Optional: Set up cloud memory backends"
371
+ echo " export GITHUB_TOKEN=your_token"
372
+ echo " export QDRANT_API_KEY=your_key"
373
+ echo " export QDRANT_URL=your_url"
374
+ echo ""
375
+ echo "Documentation: https://github.com/DammianMiller/universal-agent-protocol"
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env bash
2
+ # UAP Pre-Edit Build Gate
3
+ # Run before and after editing TypeScript files to ensure build integrity.
4
+ #
5
+ # Usage:
6
+ # bash scripts/validate-build.sh # Quick: tsc --noEmit only
7
+ # bash scripts/validate-build.sh --full # Full: tsc build + lint check
8
+ #
9
+ # Exit codes:
10
+ # 0 = build passes (safe to edit / edit was clean)
11
+ # 1 = build fails (do NOT proceed with more edits; fix first)
12
+
13
+ set -euo pipefail
14
+
15
+ PROJECT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
16
+ MODE="${1:-quick}"
17
+
18
+ RED='\033[0;31m'
19
+ GREEN='\033[0;32m'
20
+ YELLOW='\033[0;33m'
21
+ NC='\033[0m'
22
+
23
+ log_ok() { echo -e "${GREEN}[BUILD-GATE] $1${NC}"; }
24
+ log_fail() { echo -e "${RED}[BUILD-GATE] $1${NC}"; }
25
+ log_warn() { echo -e "${YELLOW}[BUILD-GATE] $1${NC}"; }
26
+
27
+ cd "$PROJECT_DIR"
28
+
29
+ if [[ "$MODE" == "--full" ]]; then
30
+ echo -e "${YELLOW}[BUILD-GATE] Running full build validation...${NC}"
31
+
32
+ # Step 1: Full TypeScript compilation
33
+ if npm run build 2>&1; then
34
+ log_ok "TypeScript build passed"
35
+ else
36
+ log_fail "TypeScript build FAILED - fix errors before continuing"
37
+ exit 1
38
+ fi
39
+
40
+ # Step 2: Lint check (if available)
41
+ if command -v npx &>/dev/null && [[ -f ".eslintrc.json" || -f ".eslintrc.cjs" || -f ".eslintrc.js" || -f "eslint.config.js" || -f "eslint.config.mjs" ]]; then
42
+ if npx eslint src/ --quiet 2>&1; then
43
+ log_ok "Lint check passed"
44
+ else
45
+ log_warn "Lint warnings detected (non-blocking)"
46
+ fi
47
+ fi
48
+
49
+ log_ok "Full build validation passed"
50
+ else
51
+ echo -e "${YELLOW}[BUILD-GATE] Running quick type check...${NC}"
52
+
53
+ # Quick mode: type-check only (no emit), faster than full build
54
+ if npx tsc --noEmit 2>&1; then
55
+ log_ok "Type check passed"
56
+ else
57
+ log_fail "Type check FAILED - fix errors before continuing"
58
+ exit 1
59
+ fi
60
+
61
+ log_ok "Quick validation passed"
62
+ fi
@@ -0,0 +1,130 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+
4
+ # version-bump.sh — Automated semver version bump with validation
5
+ #
6
+ # Usage:
7
+ # ./scripts/version-bump.sh patch # fix, chore, refactor, etc.
8
+ # ./scripts/version-bump.sh minor # feat (new functionality)
9
+ # ./scripts/version-bump.sh major # breaking changes
10
+ #
11
+ # What it does:
12
+ # 1. Validates working tree is clean
13
+ # 2. Runs tests and build
14
+ # 3. Bumps version in package.json
15
+ # 4. Prepends dated entry to CHANGELOG.md
16
+ # 5. Commits package.json + CHANGELOG.md
17
+ # 6. Creates git tag vX.Y.Z
18
+
19
+ LEVEL="${1:-}"
20
+
21
+ if [[ -z "$LEVEL" ]]; then
22
+ echo "Usage: $0 <patch|minor|major>"
23
+ echo ""
24
+ echo " patch — bug fixes, chores, refactors (X.Y.Z+1)"
25
+ echo " minor — new features (X.Y+1.0)"
26
+ echo " major — breaking changes (X+1.0.0)"
27
+ exit 1
28
+ fi
29
+
30
+ if [[ "$LEVEL" != "patch" && "$LEVEL" != "minor" && "$LEVEL" != "major" ]]; then
31
+ echo "Error: level must be 'patch', 'minor', or 'major' (got '$LEVEL')"
32
+ exit 1
33
+ fi
34
+
35
+ # 1. Validate working tree is clean
36
+ if [[ -n "$(git status --porcelain)" ]]; then
37
+ echo "Error: working tree is not clean. Commit or stash changes first."
38
+ echo ""
39
+ git status --short
40
+ exit 1
41
+ fi
42
+
43
+ # Get current version before bump
44
+ OLD_VERSION=$(node -p "require('./package.json').version")
45
+ echo "Current version: $OLD_VERSION"
46
+
47
+ # 2. Run tests and build to confirm project is healthy
48
+ echo ""
49
+ echo "Running tests..."
50
+ npm test -- --run 2>&1 || {
51
+ echo "Error: tests failed. Fix tests before bumping version."
52
+ exit 1
53
+ }
54
+
55
+ echo ""
56
+ echo "Running build..."
57
+ npm run build 2>&1 || {
58
+ echo "Error: build failed. Fix build before bumping version."
59
+ exit 1
60
+ }
61
+
62
+ # 2b. Restore clean tree (tests may create temp files like test droids)
63
+ git checkout -- . 2>/dev/null || true
64
+ git clean -fd .factory/droids/test-droid-* 2>/dev/null || true
65
+
66
+ # 3. Bump version in package.json (no git tag yet — we do it after changelog)
67
+ npm version "$LEVEL" --no-git-tag-version > /dev/null 2>&1
68
+
69
+ NEW_VERSION=$(node -p "require('./package.json').version")
70
+ echo ""
71
+ echo "Version bump: $OLD_VERSION -> $NEW_VERSION ($LEVEL)"
72
+
73
+ # 4. Prepend dated entry to CHANGELOG.md
74
+ DATE=$(date +%Y-%m-%d)
75
+ CHANGELOG_ENTRY="## v${NEW_VERSION} (${DATE})"
76
+
77
+ # Get commit messages since last tag for the changelog body
78
+ LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
79
+ if [[ -n "$LAST_TAG" ]]; then
80
+ COMMITS=$(git log "${LAST_TAG}..HEAD" --pretty=format:"- %s" --no-merges 2>/dev/null || echo "")
81
+ else
82
+ COMMITS=$(git log --pretty=format:"- %s" --no-merges -10 2>/dev/null || echo "")
83
+ fi
84
+
85
+ if [[ -z "$COMMITS" ]]; then
86
+ COMMITS="- Version bump"
87
+ fi
88
+
89
+ # Build the new changelog section
90
+ CHANGELOG_SECTION="${CHANGELOG_ENTRY}
91
+
92
+ ${COMMITS}
93
+ "
94
+
95
+ # Prepend to CHANGELOG.md (after the # Changelog header)
96
+ if [[ -f "CHANGELOG.md" ]]; then
97
+ # Insert after the first line (# Changelog header)
98
+ HEADER=$(head -1 CHANGELOG.md)
99
+ BODY=$(tail -n +2 CHANGELOG.md)
100
+ cat > CHANGELOG.md <<EOF
101
+ ${HEADER}
102
+
103
+ ${CHANGELOG_SECTION}
104
+ ${BODY}
105
+ EOF
106
+ else
107
+ cat > CHANGELOG.md <<EOF
108
+ # Changelog
109
+
110
+ ${CHANGELOG_SECTION}
111
+ EOF
112
+ fi
113
+
114
+ echo "Updated CHANGELOG.md with v${NEW_VERSION} entry"
115
+
116
+ # 5. Stage and commit
117
+ git add package.json package-lock.json CHANGELOG.md 2>/dev/null || git add package.json CHANGELOG.md
118
+ git commit -m "chore: bump version to ${NEW_VERSION}"
119
+
120
+ # 6. Create git tag
121
+ git tag -a "v${NEW_VERSION}" -m "Release v${NEW_VERSION}"
122
+
123
+ echo ""
124
+ echo "Done: v${NEW_VERSION}"
125
+ echo " - package.json updated"
126
+ echo " - CHANGELOG.md updated"
127
+ echo " - Committed: chore: bump version to ${NEW_VERSION}"
128
+ echo " - Tagged: v${NEW_VERSION}"
129
+ echo ""
130
+ echo "To push: git push && git push --tags"
@@ -25,7 +25,7 @@ try:
25
25
  except ImportError as e:
26
26
  print(f"Error: Missing required packages: {e}")
27
27
  print("\nPlease install dependencies:")
28
- print(" cd /home/cogtek/dev/miller-tech/universal-agent-memory")
28
+ print(" cd /home/cogtek/dev/miller-tech/universal-agent-protocol")
29
29
  print(" agents/.venv/bin/pip install sentence-transformers qdrant-client")
30
30
  print("\nThen run:")
31
31
  print(" agents/.venv/bin/python agents/scripts/migrate_memory_to_qdrant.py")