strray-ai 1.3.5 → 1.4.17

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 (211) hide show
  1. package/.opencode/OpenCode.json +8 -0
  2. package/.opencode/agents/analyzer.yml +0 -1
  3. package/.opencode/agents/architect.yml +0 -1
  4. package/.opencode/agents/bug-triage-specialist.yml +0 -1
  5. package/.opencode/agents/code-reviewer.yml +0 -1
  6. package/.opencode/agents/enforcer.yml +0 -1
  7. package/.opencode/agents/explore.yml +0 -1
  8. package/.opencode/agents/librarian.yml +0 -1
  9. package/.opencode/agents/multimodal-looker.yml +0 -1
  10. package/.opencode/agents/oracle.yml +0 -1
  11. package/.opencode/agents/orchestrator.yml +0 -1
  12. package/.opencode/agents/refactorer.yml +0 -1
  13. package/.opencode/agents/security-auditor.yml +0 -1
  14. package/.opencode/agents/test-architect.yml +0 -1
  15. package/.opencode/commands/framework-compliance-audit.md +1 -1
  16. package/.opencode/commands/mode-switch.md +3 -3
  17. package/.opencode/enforcer-config.json +2 -2
  18. package/.opencode/hooks/post-commit.backup +193 -0
  19. package/.opencode/hooks/post-push.backup +193 -0
  20. package/.opencode/init.sh +37 -133
  21. package/.opencode/package.json +4 -4
  22. package/.opencode/{plugin → plugins}/strray-codex-injection.ts +0 -1
  23. package/.opencode/skills/api-design/SKILL.md +1 -1
  24. package/.opencode/skills/architecture-patterns/SKILL.md +1 -1
  25. package/.opencode/skills/code-review/SKILL.md +1 -1
  26. package/.opencode/skills/git-workflow/SKILL.md +1 -1
  27. package/.opencode/skills/librarian/SKILL.md +1 -1
  28. package/.opencode/skills/performance-optimization/SKILL.md +1 -1
  29. package/.opencode/skills/project-analysis/SKILL.md +1 -1
  30. package/.opencode/skills/refactoring-strategies/SKILL.md +1 -1
  31. package/.opencode/skills/security-audit/SKILL.md +1 -1
  32. package/.opencode/skills/testing-best-practices/SKILL.md +1 -1
  33. package/.opencode/skills/testing-strategy/SKILL.md +1 -1
  34. package/.opencode/skills/ui-ux-design/SKILL.md +1 -1
  35. package/.opencode/state/backups/state-backup-2026-01-23T23-26-14-304Z.json +2 -2
  36. package/.opencode/state/backups/state-backup-2026-01-23T23-27-08-124Z.json +2 -2
  37. package/.opencode/state/backups/state-backup-2026-01-23T23-27-58-116Z.json +2 -2
  38. package/.opencode/state/backups/state-backup-2026-01-23T23-28-47-868Z.json +2 -2
  39. package/.opencode/state/backups/state-backup-2026-01-23T23-42-55-206Z.json +2 -2
  40. package/.opencode/state/backups/state-backup-2026-01-23T23-43-25-458Z.json +2 -2
  41. package/.opencode/state/backups/state-backup-2026-01-23T23-43-36-730Z.json +2 -2
  42. package/.opencode/state/backups/state-backup-2026-01-23T23-47-54-481Z.json +2 -2
  43. package/.opencode/state/backups/state-backup-2026-01-23T23-48-02-226Z.json +2 -2
  44. package/.opencode/state/backups/state-backup-2026-01-23T23-48-25-109Z.json +2 -2
  45. package/.opencode/state/state.json +101 -1833
  46. package/.opencode/state/state.json.broken +2436 -0
  47. package/.opencode/strray/codex.json +1 -1
  48. package/.opencode/strray/features.json +1 -10
  49. package/.strray/codex.json +2 -2
  50. package/AGENTS.md +2770 -0
  51. package/README.md +260 -745
  52. package/dist/agents/analyzer.d.ts +10 -0
  53. package/dist/agents/analyzer.d.ts.map +1 -0
  54. package/dist/agents/analyzer.js +142 -0
  55. package/dist/agents/analyzer.js.map +1 -0
  56. package/dist/agents/index.d.ts +3 -1
  57. package/dist/agents/index.d.ts.map +1 -1
  58. package/dist/agents/index.js +5 -1
  59. package/dist/agents/index.js.map +1 -1
  60. package/dist/agents/librarian-agents-updater.d.ts +21 -0
  61. package/dist/agents/librarian-agents-updater.d.ts.map +1 -0
  62. package/dist/agents/librarian-agents-updater.js +221 -0
  63. package/dist/agents/librarian-agents-updater.js.map +1 -0
  64. package/dist/agents/librarian.d.ts.map +1 -1
  65. package/dist/agents/librarian.js +8 -1
  66. package/dist/agents/librarian.js.map +1 -1
  67. package/dist/agents/multimodal-looker.d.ts +10 -0
  68. package/dist/agents/multimodal-looker.d.ts.map +1 -0
  69. package/dist/agents/multimodal-looker.js +95 -0
  70. package/dist/agents/multimodal-looker.js.map +1 -0
  71. package/dist/cli/index.js +14 -11
  72. package/dist/cli/index.js.map +1 -1
  73. package/dist/core/boot-orchestrator.d.ts.map +1 -1
  74. package/dist/core/boot-orchestrator.js +22 -1
  75. package/dist/core/boot-orchestrator.js.map +1 -1
  76. package/dist/core/codex-injector.d.ts +1 -1
  77. package/dist/core/codex-injector.js +1 -1
  78. package/dist/core/config-loader.d.ts +1 -14
  79. package/dist/core/config-loader.d.ts.map +1 -1
  80. package/dist/core/config-loader.js +1 -23
  81. package/dist/core/config-loader.js.map +1 -1
  82. package/dist/core/features-config.d.ts +0 -9
  83. package/dist/core/features-config.d.ts.map +1 -1
  84. package/dist/core/features-config.js +0 -12
  85. package/dist/core/features-config.js.map +1 -1
  86. package/dist/core/model-router.d.ts.map +1 -1
  87. package/dist/core/model-router.js +13 -4
  88. package/dist/core/model-router.js.map +1 -1
  89. package/dist/core/orchestrator.d.ts +5 -0
  90. package/dist/core/orchestrator.d.ts.map +1 -1
  91. package/dist/core/orchestrator.js +65 -5
  92. package/dist/core/orchestrator.js.map +1 -1
  93. package/dist/core/strray-activation.d.ts +1 -1
  94. package/dist/core/strray-activation.js +10 -1
  95. package/dist/core/strray-activation.js.map +1 -1
  96. package/dist/core/strray-init.d.ts +1 -1
  97. package/dist/core/strray-init.js +4 -4
  98. package/dist/core/strray-init.js.map +1 -1
  99. package/dist/enforcement/rule-enforcer.d.ts +13 -0
  100. package/dist/enforcement/rule-enforcer.d.ts.map +1 -1
  101. package/dist/enforcement/rule-enforcer.js +117 -0
  102. package/dist/enforcement/rule-enforcer.js.map +1 -1
  103. package/dist/mcps/agent-resolver.d.ts +47 -0
  104. package/dist/mcps/agent-resolver.d.ts.map +1 -0
  105. package/dist/mcps/agent-resolver.js +119 -0
  106. package/dist/mcps/agent-resolver.js.map +1 -0
  107. package/dist/mcps/boot-orchestrator.server.js +2 -2
  108. package/dist/mcps/boot-orchestrator.server.js.map +1 -1
  109. package/dist/mcps/enhanced-orchestrator.server.d.ts +1 -1
  110. package/dist/mcps/enhanced-orchestrator.server.js +1 -1
  111. package/dist/mcps/framework-compliance-audit.server.js +1 -1
  112. package/dist/mcps/framework-compliance-audit.server.js.map +1 -1
  113. package/dist/mcps/mcp-client.d.ts +6 -0
  114. package/dist/mcps/mcp-client.d.ts.map +1 -1
  115. package/dist/mcps/mcp-client.js +90 -17
  116. package/dist/mcps/mcp-client.js.map +1 -1
  117. package/dist/orchestrator/universal-registry-bridge.d.ts +86 -0
  118. package/dist/orchestrator/universal-registry-bridge.d.ts.map +1 -0
  119. package/dist/orchestrator/universal-registry-bridge.js +247 -0
  120. package/dist/orchestrator/universal-registry-bridge.js.map +1 -0
  121. package/dist/plugin/strray-codex-injection.d.ts.map +1 -1
  122. package/dist/plugin/strray-codex-injection.js +231 -26
  123. package/dist/plugin/strray-codex-injection.js.map +1 -1
  124. package/dist/postprocessor/PostProcessor.d.ts.map +1 -1
  125. package/dist/postprocessor/PostProcessor.js +36 -5
  126. package/dist/postprocessor/PostProcessor.js.map +1 -1
  127. package/dist/postprocessor/triggers/GitHookTrigger.js +2 -2
  128. package/dist/processors/agents-md-validation-processor.d.ts +64 -0
  129. package/dist/processors/agents-md-validation-processor.d.ts.map +1 -0
  130. package/dist/processors/agents-md-validation-processor.js +211 -0
  131. package/dist/processors/agents-md-validation-processor.js.map +1 -0
  132. package/dist/processors/processor-manager.d.ts +10 -0
  133. package/dist/processors/processor-manager.d.ts.map +1 -1
  134. package/dist/processors/processor-manager.js +95 -1
  135. package/dist/processors/processor-manager.js.map +1 -1
  136. package/dist/processors/test-auto-creation-processor.d.ts +17 -0
  137. package/dist/processors/test-auto-creation-processor.d.ts.map +1 -0
  138. package/dist/processors/test-auto-creation-processor.js +293 -0
  139. package/dist/processors/test-auto-creation-processor.js.map +1 -0
  140. package/dist/processors/version-compliance-processor.d.ts +113 -0
  141. package/dist/processors/version-compliance-processor.d.ts.map +1 -0
  142. package/dist/processors/version-compliance-processor.js +349 -0
  143. package/dist/processors/version-compliance-processor.js.map +1 -0
  144. package/dist/scripts/integration.d.ts +17 -0
  145. package/dist/scripts/integration.d.ts.map +1 -0
  146. package/dist/scripts/integration.js +212 -0
  147. package/dist/scripts/integration.js.map +1 -0
  148. package/dist/security/examples.js +1 -1
  149. package/dist/security/examples.js.map +1 -1
  150. package/dist/security/security-auditor.d.ts.map +1 -1
  151. package/dist/security/security-auditor.js +1 -5
  152. package/dist/security/security-auditor.js.map +1 -1
  153. package/dist/security/security-middleware.js +2 -2
  154. package/dist/security/security-middleware.js.map +1 -1
  155. package/dist/utils/import-resolver.js +7 -7
  156. package/dist/utils/import-resolver.js.map +1 -1
  157. package/dist/utils/token-manager.d.ts.map +1 -1
  158. package/dist/utils/token-manager.js +1 -2
  159. package/dist/utils/token-manager.js.map +1 -1
  160. package/opencode.json +5 -1
  161. package/package.json +24 -10
  162. package/scripts/mjs/monitor-framework-orchestration.mjs +355 -0
  163. package/scripts/mjs/monitor-package.mjs +1 -1
  164. package/scripts/mjs/run-simulations.mjs +1 -1
  165. package/scripts/mjs/test-ci-cd-integration.mjs +3 -3
  166. package/scripts/mjs/test-complex-orchestration.mjs +3 -2
  167. package/scripts/mjs/test-configuration-validation.mjs +7 -7
  168. package/scripts/mjs/test-consumer-readiness.mjs +32 -37
  169. package/scripts/mjs/test-consumer-validation.mjs +55 -72
  170. package/scripts/mjs/test-final-consumer-validation.mjs +48 -52
  171. package/scripts/mjs/test-mcp-functionality.mjs +123 -38
  172. package/scripts/mjs/test-postinstall-files.mjs +17 -17
  173. package/scripts/mjs/test-simple-prompt.mjs +1 -1
  174. package/scripts/mjs/test-skills-comprehensive.mjs +20 -10
  175. package/scripts/mjs/test-skills-mcp-integration.mjs +3 -3
  176. package/scripts/mjs/test-stringray-plugin.mjs +1 -1
  177. package/scripts/mjs/trigger-and-monitor-framework.mjs +219 -0
  178. package/scripts/mjs/verify-orchestration.mjs +178 -0
  179. package/scripts/mjs/verify-pipeline-end-to-end.mjs +237 -0
  180. package/scripts/mjs/verify-plugin-paths.mjs +4 -4
  181. package/scripts/node/cleanup-doc-versions.js +6 -6
  182. package/scripts/node/debug-plugin.cjs +1 -1
  183. package/scripts/node/enforce-agents-md.js +423 -0
  184. package/scripts/node/enforce-version-compliance.sh +14 -135
  185. package/scripts/node/enforce-version-compliance.sh.bak +143 -0
  186. package/scripts/node/enforce-version-compliance.ts +125 -0
  187. package/scripts/node/postinstall.cjs +62 -37
  188. package/scripts/node/prepare-consumer.cjs +2 -3
  189. package/scripts/node/setup-ci-paths.cjs +1 -1
  190. package/scripts/node/setup-dev.cjs +3 -3
  191. package/scripts/node/setup.cjs +8 -8
  192. package/scripts/node/test-plugin-comprehensive.js +5 -5
  193. package/scripts/node/universal-version-manager.js +14 -16
  194. package/scripts/node/validate-oh-my-opencode-integration.cjs +11 -4
  195. package/scripts/node/validate-postinstall-config.js +8 -24
  196. package/.opencode/command/dependency-audit.md +0 -184
  197. package/.opencode/command/lint.md +0 -11
  198. package/.opencode/logs/strray-init-20260201-165724.log +0 -40
  199. package/.opencode/logs/strray-init-20260201-171744.log +0 -40
  200. package/.opencode/logs/strray-plugin-2026-02-01.log +0 -352
  201. package/.opencode/oh-my-opencode.json +0 -108
  202. package/.opencode/package-lock.json +0 -31
  203. package/.opencode/scripts/config-integration-tests.sh +0 -159
  204. package/.opencode/scripts/config-loader.sh +0 -153
  205. package/.opencode/scripts/hook-consolidation-tests.sh +0 -193
  206. package/.opencode/scripts/job-summary-logger.sh +0 -11
  207. package/.opencode/scripts/model-validator.sh +0 -178
  208. package/.opencode/scripts/simple-validation.sh +0 -96
  209. package/.opencode/scripts/validate-codex.py +0 -78
  210. /package/.opencode/agents/{document-writer.yml → archive/document-writer.yml} +0 -0
  211. /package/.opencode/agents/{frontend-ui-ux-engineer.yml → archive/frontend-ui-ux-engineer.yml} +0 -0
@@ -0,0 +1,8 @@
1
+ {
2
+ "plugin": "./dist/plugin/plugins/strray-codex-injection.js",
3
+ "agents": [
4
+ "enforcer",
5
+ "architect",
6
+ "orchestrator"
7
+ ]
8
+ }
@@ -1,7 +1,6 @@
1
1
  name: analyzer
2
2
  description: "System Analyzer agent for comprehensive log analysis, performance monitoring, and continuous improvement recommendations"
3
3
  version: "1.0.0"
4
- model: openrouter/xai-grok-2-1212-fast-1
5
4
  mode: subagent
6
5
 
7
6
  # Analysis Configuration
@@ -1,7 +1,6 @@
1
1
  name: architect
2
2
  description: "Architect agent for design and architecture validation"
3
3
  version: "1.0.0"
4
- model: openrouter/xai-grok-2-1212-fast-1
5
4
  mode: subagent
6
5
 
7
6
  # State Management Configuration
@@ -1,7 +1,6 @@
1
1
  name: bug-triage-specialist
2
2
  description: "Bug triage specialist agent for systematic error investigation and surgical fixes"
3
3
  version: "1.0.0"
4
- model: openrouter/xai-grok-2-1212-fast-1
5
4
  mode: subagent
6
5
 
7
6
  # Error Handling Configuration
@@ -1,7 +1,6 @@
1
1
  name: code-reviewer
2
2
  description: "Code reviewer agent for quality assessment and compliance validation"
3
3
  version: "1.0.0"
4
- model: openrouter/xai-grok-2-1212-fast-1
5
4
  mode: subagent
6
5
 
7
6
  # Logging Configuration
@@ -1,7 +1,6 @@
1
1
  name: enforcer
2
2
  description: "Enforcer agent for codex compliance and error prevention"
3
3
  version: "1.0.0"
4
- model: openrouter/xai-grok-2-1212-fast-1
5
4
  mode: subagent
6
5
 
7
6
  # Logging Configuration
@@ -1,7 +1,6 @@
1
1
  name: explore
2
2
  description: "Fast codebase exploration and pattern analysis specialist"
3
3
  version: "1.0.0"
4
- model: openrouter/xai-grok-2-1212-fast-1
5
4
 
6
5
  # Logging Configuration
7
6
  logging:
@@ -1,7 +1,6 @@
1
1
  name: librarian
2
2
  description: "Codebase and documentation search specialist"
3
3
  version: "1.0.0"
4
- model: openrouter/xai-grok-2-1212-fast-1
5
4
 
6
5
  # Logging Configuration
7
6
  logging:
@@ -1,7 +1,6 @@
1
1
  name: multimodal-looker
2
2
  description: "Multimodal file analysis and interpretation specialist for images, diagrams, PDFs, and media files"
3
3
  version: "1.0.0"
4
- model: openrouter/xai-grok-2-1212-fast-1
5
4
 
6
5
  # Logging Configuration
7
6
  logging:
@@ -1,7 +1,6 @@
1
1
  name: oracle
2
2
  description: "Strategic guidance and complex problem-solving specialist for architectural decisions"
3
3
  version: "1.0.0"
4
- model: openrouter/xai-grok-2-1212-fast-1
5
4
 
6
5
  # Logging Configuration
7
6
  logging:
@@ -1,7 +1,6 @@
1
1
  name: orchestrator
2
2
  description: "Orchestrator agent for workflow coordination and task delegation"
3
3
  version: "2.0.0"
4
- model: openrouter/xai-grok-2-1212-fast-1
5
4
  mode: primary
6
5
 
7
6
  # State Management Configuration
@@ -1,7 +1,6 @@
1
1
  name: refactorer
2
2
  description: "Refactorer agent for technical debt elimination and surgical code improvements"
3
3
  version: "1.0.0"
4
- model: openrouter/xai-grok-2-1212-fast-1
5
4
  mode: subagent
6
5
 
7
6
  # Error Handling Configuration
@@ -1,7 +1,6 @@
1
1
  name: security-auditor
2
2
  description: "Security auditor agent for vulnerability detection and compliance"
3
3
  version: "1.0.0"
4
- model: openrouter/xai-grok-2-1212-fast-1
5
4
  mode: subagent
6
5
 
7
6
  # Logging Configuration
@@ -1,7 +1,6 @@
1
1
  name: test-architect
2
2
  description: "Test architect agent for comprehensive testing strategy and validation"
3
3
  version: "1.0.0"
4
- model: openrouter/xai-grok-2-1212-fast-1
5
4
  mode: subagent
6
5
 
7
6
  # Logging Configuration
@@ -17,7 +17,7 @@ COMPLIANCE_SCORES=()
17
17
  # 1. Configuration Integrity Check
18
18
 
19
19
  echo "⚙️ Checking framework configuration integrity..."
20
- if [ -f ".opencode/enforcer-config.json" ] && [ -f ".opencode/oh-my-opencode.json" ]; then
20
+ if [ -f ".opencode/enforcer-config.json" ] && [ -f ".opencode/OpenCode.json" ]; then
21
21
  echo "✅ Framework configurations present"
22
22
  COMPLIANCE_SCORES+=("configuration_integrity:PASS")
23
23
  else
@@ -9,14 +9,14 @@ description: Switch between full (8 agents) and lite (4 agents) modes dynamicall
9
9
 
10
10
  # Dynamically switches between full and lite agent configurations
11
11
 
12
- CONFIG_FILE="oh-my-opencode.json"
12
+ CONFIG_FILE="OpenCode.json"
13
13
  ENFORCER_CONFIG_FILE="enforcer-config.json"
14
14
 
15
15
  # Function to display current mode
16
16
 
17
17
  show_current_mode() {
18
- if [ -f ".opencode/oh-my-opencode.json" ]; then
19
- DISABLED_COUNT=$(jq '.disabled_agents | length' .opencode/oh-my-opencode.json)
18
+ if [ -f ".opencode/OpenCode.json" ]; then
19
+ DISABLED_COUNT=$(jq '.disabled_agents | length' .opencode/OpenCode.json)
20
20
  if [ "$DISABLED_COUNT" -eq 0 ]; then
21
21
  CURRENT_MODE="full"
22
22
  echo "🎯 Current Mode: $CURRENT_MODE"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "framework": "StringRay 1.0.0",
3
- "version": "1.3.5",
3
+ "version": "1.4.17",
4
4
  "description": "Codex-compliant framework configuration for Credible UI project",
5
5
  "thresholds": {
6
6
  "bundleSize": {
@@ -182,7 +182,7 @@
182
182
  }
183
183
  },
184
184
  "codex": {
185
- "version": "1.3.5",
185
+ "version": "1.4.17",
186
186
  "terms": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 24, 29, 32, 38, 42, 43],
187
187
  "principles": [
188
188
  "progressive-prod-ready-code",
@@ -0,0 +1,193 @@
1
+ #!/bin/bash
2
+ # StrRay Post-Processor post-commit Hook
3
+ # Automatically triggers post-processor after post-commit
4
+
5
+ # Get hook type from script name
6
+ HOOK_NAME=$(basename "$0")
7
+ COMMIT_SHA=""
8
+
9
+ if [ "$HOOK_NAME" = "post-commit" ]; then
10
+ # Light monitoring for local commits - just basic validation
11
+ COMMIT_SHA=$(git rev-parse HEAD)
12
+ MONITORING_LEVEL="basic"
13
+ elif [ "$HOOK_NAME" = "post-push" ]; then
14
+ # Full monitoring for pushes - comprehensive validation
15
+ # For push hooks, we need to parse the pushed refs from stdin
16
+ while read local_ref local_sha remote_ref remote_sha; do
17
+ if [ "$local_sha" != "0000000000000000000000000000000000000000" ]; then
18
+ COMMIT_SHA=$local_sha
19
+ break
20
+ fi
21
+ done
22
+ MONITORING_LEVEL="full"
23
+ else
24
+ COMMIT_SHA=$(git rev-parse HEAD)
25
+ MONITORING_LEVEL="basic"
26
+ fi
27
+
28
+ if [ -z "$COMMIT_SHA" ]; then
29
+ echo "Warning: Could not determine commit SHA for post-processor"
30
+ exit 0
31
+ fi
32
+
33
+ # Get repository info
34
+ REPO="strray-framework/stringray" # Placeholder for now
35
+ BRANCH=$(git rev-parse --abbrev-ref HEAD)
36
+ AUTHOR=$(git log -1 --pretty=format:'%an <%ae>')
37
+
38
+ # Get changed files (different logic for commit vs push)
39
+ if [ "$HOOK_NAME" = "post-commit" ]; then
40
+ FILES=$(git diff --name-only HEAD~1 2>/dev/null || git diff --name-only --cached)
41
+ else
42
+ FILES=$(git log --name-only --oneline -1 $COMMIT_SHA | tail -n +2)
43
+ fi
44
+
45
+ # Trigger post-processor asynchronously (don't block git operations)
46
+ (
47
+ cd "$(dirname "$0")/../.." # Navigate to project root
48
+
49
+ # Find the StrRay plugin in node_modules or current project (development)
50
+ STRRAY_PLUGIN=""
51
+ if [ -d "node_modules/strray-framework" ]; then
52
+ STRRAY_PLUGIN="node_modules/strray-framework"
53
+ elif [ -d "node_modules/@strray/strray-framework" ]; then
54
+ STRRAY_PLUGIN="node_modules/@strray/strray-framework"
55
+ elif [ -d "node_modules/oh-my-opencode/plugins/strray-framework" ]; then
56
+ STRRAY_PLUGIN="node_modules/oh-my-opencode/plugins/strray-framework"
57
+ elif [ -f "dist/postprocessor/PostProcessor.js" ]; then
58
+ # Development mode - use current project
59
+ STRRAY_PLUGIN="."
60
+ fi
61
+
62
+ if command -v node >/dev/null 2>&1 && [ -n "$STRRAY_PLUGIN" ]; then
63
+ # Call a separate script to avoid bash variable issues
64
+ export COMMIT_SHA="$COMMIT_SHA"
65
+ export REPO="$REPO"
66
+ export BRANCH="$BRANCH"
67
+ export AUTHOR="$AUTHOR"
68
+ export STRRAY_PLUGIN="$STRRAY_PLUGIN"
69
+ export MONITORING_LEVEL="$MONITORING_LEVEL"
70
+ export IS_FULL_MONITORING="$([ "$MONITORING_LEVEL" = "full" ] && echo "true" || echo "false")"
71
+
72
+ # Run appropriate monitoring based on hook type
73
+ if [ "$HOOK_NAME" = "post-commit" ]; then
74
+ # LIGHT MONITORING: Quick validation, don't block git workflow
75
+ # Timeout: 2 seconds max, log metrics for monitoring
76
+ START_TIME=$(date +%s)
77
+ timeout 2 node -e "
78
+ (async () => {
79
+ try {
80
+ // Use import resolver to avoid hardcoded dist paths
81
+ const { importResolver } = await import('./utils/import-resolver.js');
82
+ const { LightweightValidator } = await importResolver.importModule('postprocessor/validation/LightweightValidator');
83
+
84
+ const validator = new LightweightValidator();
85
+ const result = await validator.validate();
86
+
87
+ if (result.warnings.length > 0) {
88
+ console.log('⚠️ ' + result.warnings.length + ' warning(s) found:');
89
+ result.warnings.forEach(w => console.log(' ' + w));
90
+ }
91
+
92
+ if (!result.passed) {
93
+ console.log('❌ ' + result.errors.length + ' error(s) found:');
94
+ result.errors.forEach(e => console.log(' ' + e));
95
+ process.exit(1);
96
+ }
97
+
98
+ console.log('✅ Post-commit: Validation passed in ' + result.duration + 'ms');
99
+ } catch (error) {
100
+ console.error('❌ Post-commit validation failed:', error instanceof Error ? error.message : String(error));
101
+ process.exit(1);
102
+ }
103
+ })();
104
+ " 2>/dev/null
105
+ EXIT_CODE=$?
106
+ END_TIME=$(date +%s)
107
+ DURATION=$((END_TIME - START_TIME))
108
+
109
+ # Log metrics for monitoring (convert to milliseconds)
110
+ DURATION_MS=$((DURATION * 1000))
111
+ echo "HOOK_METRICS: post-commit duration=${DURATION_MS}ms exit_code=${EXIT_CODE}" >&2
112
+
113
+ # Record metrics using metrics collector (direct import for reliability)
114
+ node -e "
115
+ (async () => {
116
+ try {
117
+ const { HookMetricsCollector } = await import('./dist/postprocessor/validation/HookMetricsCollector.js');
118
+ const collector = new HookMetricsCollector();
119
+ collector.recordMetrics('post-commit', ${DURATION_MS}, ${EXIT_CODE});
120
+ } catch (error) {
121
+ // Silently fail if metrics collection fails
122
+ }
123
+ })();
124
+ " 2>/dev/null || true
125
+
126
+ [ $EXIT_CODE -eq 0 ] && exit 0 || exit 1
127
+ else
128
+ # FULL MONITORING: Comprehensive analysis for post-push
129
+ # Timeout: 5 minutes max, comprehensive CI/CD validation
130
+ START_TIME=$(date +%s)
131
+ timeout 300 node -e "
132
+ (async () => {
133
+ try {
134
+ console.log('🚀 Post-push: Comprehensive validation initiated');
135
+ // Use import resolver for environment-aware imports
136
+ const { importResolver } = await import('./utils/import-resolver.js');
137
+ const { ComprehensiveValidator } = await importResolver.importModule('postprocessor/validation/ComprehensiveValidator');
138
+
139
+ const validator = new ComprehensiveValidator();
140
+ const result = await validator.validate();
141
+
142
+ if (result.warnings.length > 0) {
143
+ console.log('⚠️ ' + result.warnings.length + ' warning(s) found:');
144
+ result.warnings.forEach(w => console.log(' ' + w));
145
+ }
146
+
147
+ if (!result.passed) {
148
+ console.log('❌ ' + result.errors.length + ' error(s) found:');
149
+ result.errors.forEach(e => console.log(' ' + e));
150
+ process.exit(1);
151
+ }
152
+
153
+ if (result.testResults) {
154
+ console.log('🧪 Tests: ' + result.testResults.passed + '/' + result.testResults.total + ' passed');
155
+ }
156
+
157
+ console.log('✅ Post-push: Comprehensive validation passed in ' + result.duration + 'ms');
158
+ } catch (error) {
159
+ console.error('❌ Post-push validation failed:', error instanceof Error ? error.message : String(error));
160
+ process.exit(1);
161
+ }
162
+ })();
163
+ " 2>/dev/null
164
+ EXIT_CODE=$?
165
+ END_TIME=$(date +%s)
166
+ DURATION=$((END_TIME - START_TIME))
167
+
168
+ # Log comprehensive metrics for monitoring (convert to milliseconds)
169
+ DURATION_MS=$((DURATION * 1000))
170
+ echo "HOOK_METRICS: post-push duration=${DURATION_MS}ms exit_code=${EXIT_CODE}" >&2
171
+
172
+ # Record metrics using metrics collector (direct import for reliability)
173
+ node -e "
174
+ (async () => {
175
+ try {
176
+ const { HookMetricsCollector } = await import('./dist/postprocessor/validation/HookMetricsCollector.js');
177
+ const collector = new HookMetricsCollector();
178
+ collector.recordMetrics('post-push', ${DURATION_MS}, ${EXIT_CODE});
179
+ } catch (error) {
180
+ // Silently fail if metrics collection fails
181
+ }
182
+ })();
183
+ " 2>/dev/null || true
184
+
185
+ [ $EXIT_CODE -eq 0 ] && exit 0 || exit 1
186
+ fi
187
+ else
188
+ echo "Warning: StrRay plugin not found or Node.js not available, skipping post-processor"
189
+ fi
190
+ )
191
+
192
+ # Don't wait for background process
193
+ exit 0
@@ -0,0 +1,193 @@
1
+ #!/bin/bash
2
+ # StrRay Post-Processor post-push Hook
3
+ # Automatically triggers post-processor after post-push
4
+
5
+ # Get hook type from script name
6
+ HOOK_NAME=$(basename "$0")
7
+ COMMIT_SHA=""
8
+
9
+ if [ "$HOOK_NAME" = "post-commit" ]; then
10
+ # Light monitoring for local commits - just basic validation
11
+ COMMIT_SHA=$(git rev-parse HEAD)
12
+ MONITORING_LEVEL="basic"
13
+ elif [ "$HOOK_NAME" = "post-push" ]; then
14
+ # Full monitoring for pushes - comprehensive validation
15
+ # For push hooks, we need to parse the pushed refs from stdin
16
+ while read local_ref local_sha remote_ref remote_sha; do
17
+ if [ "$local_sha" != "0000000000000000000000000000000000000000" ]; then
18
+ COMMIT_SHA=$local_sha
19
+ break
20
+ fi
21
+ done
22
+ MONITORING_LEVEL="full"
23
+ else
24
+ COMMIT_SHA=$(git rev-parse HEAD)
25
+ MONITORING_LEVEL="basic"
26
+ fi
27
+
28
+ if [ -z "$COMMIT_SHA" ]; then
29
+ echo "Warning: Could not determine commit SHA for post-processor"
30
+ exit 0
31
+ fi
32
+
33
+ # Get repository info
34
+ REPO="strray-framework/stringray" # Placeholder for now
35
+ BRANCH=$(git rev-parse --abbrev-ref HEAD)
36
+ AUTHOR=$(git log -1 --pretty=format:'%an <%ae>')
37
+
38
+ # Get changed files (different logic for commit vs push)
39
+ if [ "$HOOK_NAME" = "post-commit" ]; then
40
+ FILES=$(git diff --name-only HEAD~1 2>/dev/null || git diff --name-only --cached)
41
+ else
42
+ FILES=$(git log --name-only --oneline -1 $COMMIT_SHA | tail -n +2)
43
+ fi
44
+
45
+ # Trigger post-processor asynchronously (don't block git operations)
46
+ (
47
+ cd "$(dirname "$0")/../.." # Navigate to project root
48
+
49
+ # Find the StrRay plugin in node_modules or current project (development)
50
+ STRRAY_PLUGIN=""
51
+ if [ -d "node_modules/strray-framework" ]; then
52
+ STRRAY_PLUGIN="node_modules/strray-framework"
53
+ elif [ -d "node_modules/@strray/strray-framework" ]; then
54
+ STRRAY_PLUGIN="node_modules/@strray/strray-framework"
55
+ elif [ -d "node_modules/oh-my-opencode/plugins/strray-framework" ]; then
56
+ STRRAY_PLUGIN="node_modules/oh-my-opencode/plugins/strray-framework"
57
+ elif [ -f "dist/postprocessor/PostProcessor.js" ]; then
58
+ # Development mode - use current project
59
+ STRRAY_PLUGIN="."
60
+ fi
61
+
62
+ if command -v node >/dev/null 2>&1 && [ -n "$STRRAY_PLUGIN" ]; then
63
+ # Call a separate script to avoid bash variable issues
64
+ export COMMIT_SHA="$COMMIT_SHA"
65
+ export REPO="$REPO"
66
+ export BRANCH="$BRANCH"
67
+ export AUTHOR="$AUTHOR"
68
+ export STRRAY_PLUGIN="$STRRAY_PLUGIN"
69
+ export MONITORING_LEVEL="$MONITORING_LEVEL"
70
+ export IS_FULL_MONITORING="$([ "$MONITORING_LEVEL" = "full" ] && echo "true" || echo "false")"
71
+
72
+ # Run appropriate monitoring based on hook type
73
+ if [ "$HOOK_NAME" = "post-commit" ]; then
74
+ # LIGHT MONITORING: Quick validation, don't block git workflow
75
+ # Timeout: 2 seconds max, log metrics for monitoring
76
+ START_TIME=$(date +%s)
77
+ timeout 2 node -e "
78
+ (async () => {
79
+ try {
80
+ // Use import resolver to avoid hardcoded dist paths
81
+ const { importResolver } = await import('./utils/import-resolver.js');
82
+ const { LightweightValidator } = await importResolver.importModule('postprocessor/validation/LightweightValidator');
83
+
84
+ const validator = new LightweightValidator();
85
+ const result = await validator.validate();
86
+
87
+ if (result.warnings.length > 0) {
88
+ console.log('⚠️ ' + result.warnings.length + ' warning(s) found:');
89
+ result.warnings.forEach(w => console.log(' ' + w));
90
+ }
91
+
92
+ if (!result.passed) {
93
+ console.log('❌ ' + result.errors.length + ' error(s) found:');
94
+ result.errors.forEach(e => console.log(' ' + e));
95
+ process.exit(1);
96
+ }
97
+
98
+ console.log('✅ Post-commit: Validation passed in ' + result.duration + 'ms');
99
+ } catch (error) {
100
+ console.error('❌ Post-commit validation failed:', error instanceof Error ? error.message : String(error));
101
+ process.exit(1);
102
+ }
103
+ })();
104
+ " 2>/dev/null
105
+ EXIT_CODE=$?
106
+ END_TIME=$(date +%s)
107
+ DURATION=$((END_TIME - START_TIME))
108
+
109
+ # Log metrics for monitoring (convert to milliseconds)
110
+ DURATION_MS=$((DURATION * 1000))
111
+ echo "HOOK_METRICS: post-commit duration=${DURATION_MS}ms exit_code=${EXIT_CODE}" >&2
112
+
113
+ # Record metrics using metrics collector (direct import for reliability)
114
+ node -e "
115
+ (async () => {
116
+ try {
117
+ const { HookMetricsCollector } = await import('./dist/postprocessor/validation/HookMetricsCollector.js');
118
+ const collector = new HookMetricsCollector();
119
+ collector.recordMetrics('post-commit', ${DURATION_MS}, ${EXIT_CODE});
120
+ } catch (error) {
121
+ // Silently fail if metrics collection fails
122
+ }
123
+ })();
124
+ " 2>/dev/null || true
125
+
126
+ [ $EXIT_CODE -eq 0 ] && exit 0 || exit 1
127
+ else
128
+ # FULL MONITORING: Comprehensive analysis for post-push
129
+ # Timeout: 5 minutes max, comprehensive CI/CD validation
130
+ START_TIME=$(date +%s)
131
+ timeout 300 node -e "
132
+ (async () => {
133
+ try {
134
+ console.log('🚀 Post-push: Comprehensive validation initiated');
135
+ // Use import resolver for environment-aware imports
136
+ const { importResolver } = await import('./utils/import-resolver.js');
137
+ const { ComprehensiveValidator } = await importResolver.importModule('postprocessor/validation/ComprehensiveValidator');
138
+
139
+ const validator = new ComprehensiveValidator();
140
+ const result = await validator.validate();
141
+
142
+ if (result.warnings.length > 0) {
143
+ console.log('⚠️ ' + result.warnings.length + ' warning(s) found:');
144
+ result.warnings.forEach(w => console.log(' ' + w));
145
+ }
146
+
147
+ if (!result.passed) {
148
+ console.log('❌ ' + result.errors.length + ' error(s) found:');
149
+ result.errors.forEach(e => console.log(' ' + e));
150
+ process.exit(1);
151
+ }
152
+
153
+ if (result.testResults) {
154
+ console.log('🧪 Tests: ' + result.testResults.passed + '/' + result.testResults.total + ' passed');
155
+ }
156
+
157
+ console.log('✅ Post-push: Comprehensive validation passed in ' + result.duration + 'ms');
158
+ } catch (error) {
159
+ console.error('❌ Post-push validation failed:', error instanceof Error ? error.message : String(error));
160
+ process.exit(1);
161
+ }
162
+ })();
163
+ " 2>/dev/null
164
+ EXIT_CODE=$?
165
+ END_TIME=$(date +%s)
166
+ DURATION=$((END_TIME - START_TIME))
167
+
168
+ # Log comprehensive metrics for monitoring (convert to milliseconds)
169
+ DURATION_MS=$((DURATION * 1000))
170
+ echo "HOOK_METRICS: post-push duration=${DURATION_MS}ms exit_code=${EXIT_CODE}" >&2
171
+
172
+ # Record metrics using metrics collector (direct import for reliability)
173
+ node -e "
174
+ (async () => {
175
+ try {
176
+ const { HookMetricsCollector } = await import('./dist/postprocessor/validation/HookMetricsCollector.js');
177
+ const collector = new HookMetricsCollector();
178
+ collector.recordMetrics('post-push', ${DURATION_MS}, ${EXIT_CODE});
179
+ } catch (error) {
180
+ // Silently fail if metrics collection fails
181
+ }
182
+ })();
183
+ " 2>/dev/null || true
184
+
185
+ [ $EXIT_CODE -eq 0 ] && exit 0 || exit 1
186
+ fi
187
+ else
188
+ echo "Warning: StrRay plugin not found or Node.js not available, skipping post-processor"
189
+ fi
190
+ )
191
+
192
+ # Don't wait for background process
193
+ exit 0