stringray-ai 1.0.37 โ 1.0.39
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.
- package/dist/plugin/architectural-integrity.d.ts +21 -0
- package/dist/plugin/architectural-integrity.d.ts.map +1 -0
- package/dist/plugin/architectural-integrity.js +81 -0
- package/dist/plugin/architectural-integrity.js.map +1 -0
- package/dist/plugin/boot-orchestrator.d.ts +100 -0
- package/dist/plugin/boot-orchestrator.d.ts.map +1 -0
- package/dist/plugin/boot-orchestrator.js +606 -0
- package/dist/plugin/boot-orchestrator.js.map +1 -0
- package/dist/plugin/codex-injector.d.ts +72 -0
- package/dist/plugin/codex-injector.d.ts.map +1 -0
- package/dist/plugin/codex-injector.js +387 -0
- package/dist/plugin/codex-injector.js.map +1 -0
- package/dist/plugin/delegation/index.d.ts +16 -0
- package/dist/plugin/delegation/index.d.ts.map +1 -0
- package/dist/plugin/delegation/index.js +13 -0
- package/dist/plugin/delegation/index.js.map +1 -0
- package/dist/plugin/delegation/session-coordinator.d.ts +121 -0
- package/dist/plugin/delegation/session-coordinator.d.ts.map +1 -0
- package/dist/plugin/delegation/session-coordinator.js +346 -0
- package/dist/plugin/delegation/session-coordinator.js.map +1 -0
- package/dist/plugin/index.d.ts +3 -0
- package/dist/plugin/index.d.ts.map +1 -0
- package/dist/plugin/index.js +3 -0
- package/dist/plugin/index.js.map +1 -0
- package/dist/plugin/monitoring/memory-monitor.d.ts +113 -0
- package/dist/plugin/monitoring/memory-monitor.d.ts.map +1 -0
- package/dist/plugin/monitoring/memory-monitor.js +283 -0
- package/dist/plugin/monitoring/memory-monitor.js.map +1 -0
- package/dist/plugin/postprocessor/PostProcessor.d.ts +90 -0
- package/dist/plugin/postprocessor/PostProcessor.d.ts.map +1 -0
- package/dist/plugin/postprocessor/PostProcessor.js +631 -0
- package/dist/plugin/postprocessor/PostProcessor.js.map +1 -0
- package/dist/plugin/postprocessor/analysis/FailureAnalysisEngine.d.ts +40 -0
- package/dist/plugin/postprocessor/analysis/FailureAnalysisEngine.d.ts.map +1 -0
- package/dist/plugin/postprocessor/analysis/FailureAnalysisEngine.js +244 -0
- package/dist/plugin/postprocessor/analysis/FailureAnalysisEngine.js.map +1 -0
- package/dist/plugin/postprocessor/autofix/AutoFixEngine.d.ts +50 -0
- package/dist/plugin/postprocessor/autofix/AutoFixEngine.d.ts.map +1 -0
- package/dist/plugin/postprocessor/autofix/AutoFixEngine.js +246 -0
- package/dist/plugin/postprocessor/autofix/AutoFixEngine.js.map +1 -0
- package/dist/plugin/postprocessor/autofix/FixValidator.d.ts +27 -0
- package/dist/plugin/postprocessor/autofix/FixValidator.d.ts.map +1 -0
- package/dist/plugin/postprocessor/autofix/FixValidator.js +158 -0
- package/dist/plugin/postprocessor/autofix/FixValidator.js.map +1 -0
- package/dist/plugin/postprocessor/config.d.ts +7 -0
- package/dist/plugin/postprocessor/config.d.ts.map +1 -0
- package/dist/plugin/postprocessor/config.js +66 -0
- package/dist/plugin/postprocessor/config.js.map +1 -0
- package/dist/plugin/postprocessor/escalation/EscalationEngine.d.ts +73 -0
- package/dist/plugin/postprocessor/escalation/EscalationEngine.d.ts.map +1 -0
- package/dist/plugin/postprocessor/escalation/EscalationEngine.js +249 -0
- package/dist/plugin/postprocessor/escalation/EscalationEngine.js.map +1 -0
- package/dist/plugin/postprocessor/monitoring/MonitoringEngine.d.ts +19 -0
- package/dist/plugin/postprocessor/monitoring/MonitoringEngine.d.ts.map +1 -0
- package/dist/plugin/postprocessor/monitoring/MonitoringEngine.js +120 -0
- package/dist/plugin/postprocessor/monitoring/MonitoringEngine.js.map +1 -0
- package/dist/plugin/postprocessor/redeploy/RedeployCoordinator.d.ts +92 -0
- package/dist/plugin/postprocessor/redeploy/RedeployCoordinator.d.ts.map +1 -0
- package/dist/plugin/postprocessor/redeploy/RedeployCoordinator.js +319 -0
- package/dist/plugin/postprocessor/redeploy/RedeployCoordinator.js.map +1 -0
- package/dist/plugin/postprocessor/success/SuccessHandler.d.ts +61 -0
- package/dist/plugin/postprocessor/success/SuccessHandler.d.ts.map +1 -0
- package/dist/plugin/postprocessor/success/SuccessHandler.js +148 -0
- package/dist/plugin/postprocessor/success/SuccessHandler.js.map +1 -0
- package/dist/plugin/postprocessor/triggers/APITrigger.d.ts +13 -0
- package/dist/plugin/postprocessor/triggers/APITrigger.d.ts.map +1 -0
- package/dist/plugin/postprocessor/triggers/APITrigger.js +20 -0
- package/dist/plugin/postprocessor/triggers/APITrigger.js.map +1 -0
- package/dist/plugin/postprocessor/triggers/GitHookTrigger.d.ts +17 -0
- package/dist/plugin/postprocessor/triggers/GitHookTrigger.d.ts.map +1 -0
- package/dist/plugin/postprocessor/triggers/GitHookTrigger.js +285 -0
- package/dist/plugin/postprocessor/triggers/GitHookTrigger.js.map +1 -0
- package/dist/plugin/postprocessor/triggers/WebhookTrigger.d.ts +13 -0
- package/dist/plugin/postprocessor/triggers/WebhookTrigger.d.ts.map +1 -0
- package/dist/plugin/postprocessor/triggers/WebhookTrigger.js +21 -0
- package/dist/plugin/postprocessor/triggers/WebhookTrigger.js.map +1 -0
- package/dist/plugin/postprocessor/types.d.ts +198 -0
- package/dist/plugin/postprocessor/types.d.ts.map +1 -0
- package/dist/plugin/postprocessor/types.js +5 -0
- package/dist/plugin/postprocessor/types.js.map +1 -0
- package/dist/plugin/security/security-auditor.d.ts +57 -0
- package/dist/plugin/security/security-auditor.d.ts.map +1 -0
- package/dist/plugin/security/security-auditor.js +583 -0
- package/dist/plugin/security/security-auditor.js.map +1 -0
- package/dist/plugin/security/security-hardener.d.ts +63 -0
- package/dist/plugin/security/security-hardener.d.ts.map +1 -0
- package/dist/plugin/security/security-hardener.js +181 -0
- package/dist/plugin/security/security-hardener.js.map +1 -0
- package/dist/plugin/security/security-headers.d.ts +52 -0
- package/dist/plugin/security/security-headers.d.ts.map +1 -0
- package/dist/plugin/security/security-headers.js +118 -0
- package/dist/plugin/security/security-headers.js.map +1 -0
- package/dist/plugin/session/session-cleanup-manager.d.ts +118 -0
- package/dist/plugin/session/session-cleanup-manager.d.ts.map +1 -0
- package/dist/plugin/session/session-cleanup-manager.js +324 -0
- package/dist/plugin/session/session-cleanup-manager.js.map +1 -0
- package/dist/plugin/session/session-monitor.d.ts +99 -0
- package/dist/plugin/session/session-monitor.d.ts.map +1 -0
- package/dist/plugin/session/session-monitor.js +363 -0
- package/dist/plugin/session/session-monitor.js.map +1 -0
- package/dist/plugin/session/session-state-manager.d.ts +142 -0
- package/dist/plugin/session/session-state-manager.d.ts.map +1 -0
- package/dist/plugin/session/session-state-manager.js +504 -0
- package/dist/plugin/session/session-state-manager.js.map +1 -0
- package/dist/plugin/strray-activation.d.ts +18 -0
- package/dist/plugin/strray-activation.d.ts.map +1 -0
- package/dist/plugin/strray-activation.js +114 -0
- package/dist/plugin/strray-activation.js.map +1 -0
- package/dist/plugin/validation/report-content-validator.d.ts +43 -0
- package/dist/plugin/validation/report-content-validator.d.ts.map +1 -0
- package/dist/plugin/validation/report-content-validator.js +219 -0
- package/dist/plugin/validation/report-content-validator.js.map +1 -0
- package/package.json +1 -1
- package/scripts/test-complex-orchestration.mjs +1 -1
- package/scripts/test-simple-prompt.mjs +1 -1
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Success Handler for Post-Processor
|
|
3
|
+
* Handles successful completion, cleanup, and success confirmation
|
|
4
|
+
*/
|
|
5
|
+
export class SuccessHandler {
|
|
6
|
+
config;
|
|
7
|
+
constructor(config = {}) {
|
|
8
|
+
this.config = {
|
|
9
|
+
successConfirmation: true,
|
|
10
|
+
cleanupEnabled: true,
|
|
11
|
+
notificationEnabled: true,
|
|
12
|
+
metricsCollection: true,
|
|
13
|
+
...config,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Handle successful completion of the post-processor loop
|
|
18
|
+
*/
|
|
19
|
+
async handleSuccess(context, result, monitoringResults) {
|
|
20
|
+
console.log(`๐ Post-processor completed successfully for commit ${context.commitSha}`);
|
|
21
|
+
const metrics = this.collectSuccessMetrics(result, monitoringResults);
|
|
22
|
+
// Success confirmation
|
|
23
|
+
if (this.config.successConfirmation) {
|
|
24
|
+
await this.confirmSuccess(context, result);
|
|
25
|
+
}
|
|
26
|
+
// Send success notifications
|
|
27
|
+
if (this.config.notificationEnabled) {
|
|
28
|
+
await this.sendSuccessNotifications(context, result, metrics);
|
|
29
|
+
}
|
|
30
|
+
// Cleanup resources
|
|
31
|
+
if (this.config.cleanupEnabled) {
|
|
32
|
+
await this.performCleanup(context);
|
|
33
|
+
}
|
|
34
|
+
// Log success metrics
|
|
35
|
+
if (this.config.metricsCollection) {
|
|
36
|
+
this.logSuccessMetrics(metrics);
|
|
37
|
+
}
|
|
38
|
+
return metrics;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Confirm that the success is legitimate
|
|
42
|
+
*/
|
|
43
|
+
async confirmSuccess(context, result) {
|
|
44
|
+
console.log("๐ Confirming deployment success...");
|
|
45
|
+
// In a real system, this would perform additional health checks
|
|
46
|
+
// - API endpoint availability
|
|
47
|
+
// - Database connectivity
|
|
48
|
+
// - Performance metrics validation
|
|
49
|
+
// - User acceptance testing
|
|
50
|
+
// For now, simulate confirmation
|
|
51
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
52
|
+
console.log("โ
Deployment success confirmed");
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Send success notifications
|
|
56
|
+
*/
|
|
57
|
+
async sendSuccessNotifications(context, result, metrics) {
|
|
58
|
+
const message = {
|
|
59
|
+
title: "CI/CD Pipeline Success",
|
|
60
|
+
commit: context.commitSha,
|
|
61
|
+
attempts: result.attempts,
|
|
62
|
+
duration: metrics.totalDuration,
|
|
63
|
+
fixesApplied: metrics.fixesApplied,
|
|
64
|
+
timestamp: new Date().toISOString(),
|
|
65
|
+
};
|
|
66
|
+
console.log("๐ข Success Notification:", JSON.stringify(message, null, 2));
|
|
67
|
+
// In a real system, this would send notifications to:
|
|
68
|
+
// - Slack/Teams channels
|
|
69
|
+
// - Email notifications
|
|
70
|
+
// - Dashboard updates
|
|
71
|
+
// - Monitoring systems
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Perform cleanup after successful completion
|
|
75
|
+
*/
|
|
76
|
+
async performCleanup(context) {
|
|
77
|
+
console.log("๐งน Performing post-success cleanup...");
|
|
78
|
+
// In a real system, this would:
|
|
79
|
+
// - Clean up temporary files
|
|
80
|
+
// - Reset monitoring states
|
|
81
|
+
// - Archive logs
|
|
82
|
+
// - Update deployment records
|
|
83
|
+
// - Notify downstream systems
|
|
84
|
+
console.log("โ
Cleanup completed");
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Collect comprehensive success metrics
|
|
88
|
+
*/
|
|
89
|
+
collectSuccessMetrics(result, monitoringResults) {
|
|
90
|
+
const fixesApplied = result.fixesApplied?.length || 0;
|
|
91
|
+
const monitoringChecks = monitoringResults.length;
|
|
92
|
+
const redeployments = result.attempts - 1; // First attempt is initial, rest are redeploys
|
|
93
|
+
return {
|
|
94
|
+
totalDuration: result.duration || 0,
|
|
95
|
+
attempts: result.attempts,
|
|
96
|
+
fixesApplied,
|
|
97
|
+
monitoringChecks,
|
|
98
|
+
redeployments: Math.max(0, redeployments),
|
|
99
|
+
timestamp: new Date(),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Log success metrics for analysis
|
|
104
|
+
*/
|
|
105
|
+
logSuccessMetrics(metrics) {
|
|
106
|
+
console.log("๐ Success Metrics:");
|
|
107
|
+
console.log(` Total Duration: ${metrics.totalDuration}ms`);
|
|
108
|
+
console.log(` Attempts: ${metrics.attempts}`);
|
|
109
|
+
console.log(` Fixes Applied: ${metrics.fixesApplied}`);
|
|
110
|
+
console.log(` Monitoring Checks: ${metrics.monitoringChecks}`);
|
|
111
|
+
console.log(` Redeployments: ${metrics.redeployments}`);
|
|
112
|
+
// In a real system, this would send metrics to:
|
|
113
|
+
// - Prometheus/Grafana
|
|
114
|
+
// - Application monitoring
|
|
115
|
+
// - Business intelligence systems
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Generate success summary report
|
|
119
|
+
*/
|
|
120
|
+
generateSuccessReport(context, result, metrics) {
|
|
121
|
+
return `
|
|
122
|
+
Post-Processor Success Report
|
|
123
|
+
=============================
|
|
124
|
+
|
|
125
|
+
Commit: ${context.commitSha}
|
|
126
|
+
Repository: ${context.repository}
|
|
127
|
+
Branch: ${context.branch}
|
|
128
|
+
Author: ${context.author}
|
|
129
|
+
|
|
130
|
+
Results:
|
|
131
|
+
- Status: SUCCESS
|
|
132
|
+
- Attempts: ${result.attempts}
|
|
133
|
+
- Duration: ${metrics.totalDuration}ms
|
|
134
|
+
- Fixes Applied: ${metrics.fixesApplied}
|
|
135
|
+
- Monitoring Checks: ${metrics.monitoringChecks}
|
|
136
|
+
- Redeployments: ${metrics.redeployments}
|
|
137
|
+
|
|
138
|
+
Timestamp: ${metrics.timestamp.toISOString()}
|
|
139
|
+
`;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Get success statistics
|
|
143
|
+
*/
|
|
144
|
+
getStats() {
|
|
145
|
+
return { ...this.config };
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=SuccessHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuccessHandler.js","sourceRoot":"","sources":["../../../../src/postprocessor/success/SuccessHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAoBH,MAAM,OAAO,cAAc;IACjB,MAAM,CAAgB;IAE9B,YAAY,SAAiC,EAAE;QAC7C,IAAI,CAAC,MAAM,GAAG;YACZ,mBAAmB,EAAE,IAAI;YACzB,cAAc,EAAE,IAAI;YACpB,mBAAmB,EAAE,IAAI;YACzB,iBAAiB,EAAE,IAAI;YACvB,GAAG,MAAM;SACV,CAAC;IACJ,CAAC;IAED;;OA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Context } from "../types.js";
|
|
6
|
+
export declare class APITrigger {
|
|
7
|
+
private postProcessor;
|
|
8
|
+
private initialized;
|
|
9
|
+
constructor(postProcessor: PostProcessor);
|
|
10
|
+
initialize(): Promise<void>;
|
|
11
|
+
triggerPostProcessor(context: PostProcessorContext): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=APITrigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"APITrigger.d.ts","sourceRoot":"","sources":["../../../../src/postprocessor/triggers/APITrigger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,qBAAa,UAAU;IAGT,OAAO,CAAC,aAAa;IAFjC,OAAO,CAAC,WAAW,CAAS;gBAER,aAAa,EAAE,aAAa;IAE1C,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAM3B,oBAAoB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;CAGzE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Trigger for Post-Processor
|
|
3
|
+
*/
|
|
4
|
+
export class APITrigger {
|
|
5
|
+
postProcessor;
|
|
6
|
+
initialized = false;
|
|
7
|
+
constructor(postProcessor) {
|
|
8
|
+
this.postProcessor = postProcessor;
|
|
9
|
+
}
|
|
10
|
+
async initialize() {
|
|
11
|
+
if (this.initialized)
|
|
12
|
+
return;
|
|
13
|
+
// API endpoint initialization would go here
|
|
14
|
+
this.initialized = true;
|
|
15
|
+
}
|
|
16
|
+
async triggerPostProcessor(context) {
|
|
17
|
+
await this.postProcessor.executePostProcessorLoop(context);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=APITrigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"APITrigger.js","sourceRoot":"","sources":["../../../../src/postprocessor/triggers/APITrigger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,MAAM,OAAO,UAAU;IAGD;IAFZ,WAAW,GAAG,KAAK,CAAC;IAE5B,YAAoB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAEpD,KAAK,CAAC,UAAU;QACd,IAAI,IAAI,CAAC,WAAW;YAAE,OAAO;QAC7B,4CAA4C;QAC5C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,OAA6B;QACtD,MAAM,IAAI,CAAC,aAAa,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAC7D,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git Hook Trigger for Post-Processor
|
|
3
|
+
*/
|
|
4
|
+
import { PostProcessor } from "../PostProcessor.js";
|
|
5
|
+
import { PostProcessorContext } from "../types.js";
|
|
6
|
+
export declare class GitHookTrigger {
|
|
7
|
+
private postProcessor;
|
|
8
|
+
private initialized;
|
|
9
|
+
constructor(postProcessor: PostProcessor);
|
|
10
|
+
initialize(): Promise<void>;
|
|
11
|
+
private installHook;
|
|
12
|
+
private generateHookScript;
|
|
13
|
+
private activateGitHooks;
|
|
14
|
+
private backupExistingHook;
|
|
15
|
+
triggerPostProcessor(context: PostProcessorContext): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=GitHookTrigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GitHookTrigger.d.ts","sourceRoot":"","sources":["../../../../src/postprocessor/triggers/GitHookTrigger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAKnD,qBAAa,cAAc;IAGb,OAAO,CAAC,aAAa;IAFjC,OAAO,CAAC,WAAW,CAAS;gBAER,aAAa,EAAE,aAAa;IAE1C,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IA6BjC,OAAO,CAAC,WAAW;IAiBnB,OAAO,CAAC,kBAAkB;IAuM1B,OAAO,CAAC,gBAAgB;IA8BxB,OAAO,CAAC,kBAAkB;IAapB,oBAAoB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;CAGzE"}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git Hook Trigger for Post-Processor
|
|
3
|
+
*/
|
|
4
|
+
import * as fs from "fs";
|
|
5
|
+
import * as path from "path";
|
|
6
|
+
export class GitHookTrigger {
|
|
7
|
+
postProcessor;
|
|
8
|
+
initialized = false;
|
|
9
|
+
constructor(postProcessor) {
|
|
10
|
+
this.postProcessor = postProcessor;
|
|
11
|
+
}
|
|
12
|
+
async initialize() {
|
|
13
|
+
if (this.initialized)
|
|
14
|
+
return;
|
|
15
|
+
const hooksDir = path.join(process.cwd(), ".opencode", "hooks");
|
|
16
|
+
const gitHooksDir = path.join(process.cwd(), ".git", "hooks");
|
|
17
|
+
const postCommitHook = path.join(hooksDir, "post-commit");
|
|
18
|
+
const postPushHook = path.join(hooksDir, "post-push");
|
|
19
|
+
// Ensure our hooks directory exists
|
|
20
|
+
if (!fs.existsSync(hooksDir)) {
|
|
21
|
+
fs.mkdirSync(hooksDir, { recursive: true });
|
|
22
|
+
}
|
|
23
|
+
// Ensure .git/hooks directory exists (should exist in git repo)
|
|
24
|
+
if (!fs.existsSync(gitHooksDir)) {
|
|
25
|
+
console.warn("โ ๏ธ .git/hooks directory not found - not a git repository or hooks disabled");
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
// Install hooks in our directory first
|
|
29
|
+
this.installHook(postCommitHook, "post-commit");
|
|
30
|
+
this.installHook(postPushHook, "post-push");
|
|
31
|
+
// Create symlinks in .git/hooks to activate them
|
|
32
|
+
this.activateGitHooks(gitHooksDir, postCommitHook, postPushHook);
|
|
33
|
+
this.initialized = true;
|
|
34
|
+
}
|
|
35
|
+
installHook(hookPath, hookType) {
|
|
36
|
+
const hookContent = this.generateHookScript(hookType);
|
|
37
|
+
// Check if hook already exists and has our content
|
|
38
|
+
if (fs.existsSync(hookPath)) {
|
|
39
|
+
const existing = fs.readFileSync(hookPath, "utf8");
|
|
40
|
+
if (existing.includes("postprocessor-trigger")) {
|
|
41
|
+
return; // Already installed
|
|
42
|
+
}
|
|
43
|
+
// Backup existing hook
|
|
44
|
+
fs.renameSync(hookPath, `${hookPath}.backup`);
|
|
45
|
+
}
|
|
46
|
+
fs.writeFileSync(hookPath, hookContent);
|
|
47
|
+
fs.chmodSync(hookPath, "755");
|
|
48
|
+
}
|
|
49
|
+
generateHookScript(hookType) {
|
|
50
|
+
const isPushHook = hookType === "post-push";
|
|
51
|
+
return `#!/bin/bash
|
|
52
|
+
# StringRay Post-Processor ${hookType} Hook
|
|
53
|
+
# Automatically triggers post-processor after ${hookType}
|
|
54
|
+
|
|
55
|
+
# Get hook type from script name
|
|
56
|
+
HOOK_NAME=$(basename "$0")
|
|
57
|
+
COMMIT_SHA=""
|
|
58
|
+
|
|
59
|
+
if [ "$HOOK_NAME" = "post-commit" ]; then
|
|
60
|
+
# Light monitoring for local commits - just basic validation
|
|
61
|
+
COMMIT_SHA=$(git rev-parse HEAD)
|
|
62
|
+
MONITORING_LEVEL="basic"
|
|
63
|
+
elif [ "$HOOK_NAME" = "post-push" ]; then
|
|
64
|
+
# Full monitoring for pushes - comprehensive validation
|
|
65
|
+
# For push hooks, we need to parse the pushed refs from stdin
|
|
66
|
+
while read local_ref local_sha remote_ref remote_sha; do
|
|
67
|
+
if [ "$local_sha" != "0000000000000000000000000000000000000000" ]; then
|
|
68
|
+
COMMIT_SHA=$local_sha
|
|
69
|
+
break
|
|
70
|
+
fi
|
|
71
|
+
done
|
|
72
|
+
MONITORING_LEVEL="full"
|
|
73
|
+
else
|
|
74
|
+
COMMIT_SHA=$(git rev-parse HEAD)
|
|
75
|
+
MONITORING_LEVEL="basic"
|
|
76
|
+
fi
|
|
77
|
+
|
|
78
|
+
if [ -z "$COMMIT_SHA" ]; then
|
|
79
|
+
echo "Warning: Could not determine commit SHA for post-processor"
|
|
80
|
+
exit 0
|
|
81
|
+
fi
|
|
82
|
+
|
|
83
|
+
# Get repository info
|
|
84
|
+
REPO="strray-framework/stringray" # Placeholder for now
|
|
85
|
+
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
86
|
+
AUTHOR=$(git log -1 --pretty=format:'%an <%ae>')
|
|
87
|
+
|
|
88
|
+
# Get changed files (different logic for commit vs push)
|
|
89
|
+
if [ "$HOOK_NAME" = "post-commit" ]; then
|
|
90
|
+
FILES=$(git diff --name-only HEAD~1 2>/dev/null || git diff --name-only --cached)
|
|
91
|
+
else
|
|
92
|
+
FILES=$(git log --name-only --oneline -1 $COMMIT_SHA | tail -n +2)
|
|
93
|
+
fi
|
|
94
|
+
|
|
95
|
+
# Trigger post-processor asynchronously (don't block git operations)
|
|
96
|
+
(
|
|
97
|
+
cd "$(dirname "$0")/../.." # Navigate to project root
|
|
98
|
+
|
|
99
|
+
# Find the StringRay plugin in node_modules or current project (development)
|
|
100
|
+
STRRAY_PLUGIN=""
|
|
101
|
+
if [ -d "node_modules/strray-framework" ]; then
|
|
102
|
+
STRRAY_PLUGIN="node_modules/strray-framework"
|
|
103
|
+
elif [ -d "node_modules/@strray/strray-framework" ]; then
|
|
104
|
+
STRRAY_PLUGIN="node_modules/@strray/strray-framework"
|
|
105
|
+
elif [ -d "node_modules/oh-my-opencode/plugins/strray-framework" ]; then
|
|
106
|
+
STRRAY_PLUGIN="node_modules/oh-my-opencode/plugins/strray-framework"
|
|
107
|
+
elif [ -f "dist/postprocessor/PostProcessor.js" ]; then
|
|
108
|
+
# Development mode - use current project
|
|
109
|
+
STRRAY_PLUGIN="."
|
|
110
|
+
fi
|
|
111
|
+
|
|
112
|
+
if command -v node >/dev/null 2>&1 && [ -n "$STRRAY_PLUGIN" ]; then
|
|
113
|
+
# Call a separate script to avoid bash variable issues
|
|
114
|
+
export COMMIT_SHA="$COMMIT_SHA"
|
|
115
|
+
export REPO="$REPO"
|
|
116
|
+
export BRANCH="$BRANCH"
|
|
117
|
+
export AUTHOR="$AUTHOR"
|
|
118
|
+
export STRRAY_PLUGIN="$STRRAY_PLUGIN"
|
|
119
|
+
export MONITORING_LEVEL="$MONITORING_LEVEL"
|
|
120
|
+
export IS_FULL_MONITORING="$([ "$MONITORING_LEVEL" = "full" ] && echo "true" || echo "false")"
|
|
121
|
+
|
|
122
|
+
# Run appropriate monitoring based on hook type
|
|
123
|
+
if [ "$HOOK_NAME" = "post-commit" ]; then
|
|
124
|
+
# LIGHT MONITORING: Quick validation, don't block git workflow
|
|
125
|
+
# Timeout: 2 seconds max, log metrics for monitoring
|
|
126
|
+
START_TIME=\$(date +%s)
|
|
127
|
+
timeout 2 node -e "
|
|
128
|
+
(async () => {
|
|
129
|
+
try {
|
|
130
|
+
// Use import resolver to avoid hardcoded dist paths
|
|
131
|
+
const { importResolver } = await import('./utils/import-resolver.js');
|
|
132
|
+
const { LightweightValidator } = await importResolver.importModule('postprocessor/validation/LightweightValidator');
|
|
133
|
+
|
|
134
|
+
const validator = new LightweightValidator();
|
|
135
|
+
const result = await validator.validate();
|
|
136
|
+
|
|
137
|
+
if (result.warnings.length > 0) {
|
|
138
|
+
console.log('โ ๏ธ ' + result.warnings.length + ' warning(s) found:');
|
|
139
|
+
result.warnings.forEach(w => console.log(' ' + w));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (!result.passed) {
|
|
143
|
+
console.log('โ ' + result.errors.length + ' error(s) found:');
|
|
144
|
+
result.errors.forEach(e => console.log(' ' + e));
|
|
145
|
+
process.exit(1);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
console.log('โ
Post-commit: Validation passed in ' + result.duration + 'ms');
|
|
149
|
+
} catch (error) {
|
|
150
|
+
console.error('โ Post-commit validation failed:', error instanceof Error ? error.message : String(error));
|
|
151
|
+
process.exit(1);
|
|
152
|
+
}
|
|
153
|
+
})();
|
|
154
|
+
" 2>/dev/null
|
|
155
|
+
EXIT_CODE=\$?
|
|
156
|
+
END_TIME=\$(date +%s)
|
|
157
|
+
DURATION=\$((END_TIME - START_TIME))
|
|
158
|
+
|
|
159
|
+
# Log metrics for monitoring (convert to milliseconds)
|
|
160
|
+
DURATION_MS=\$((DURATION * 1000))
|
|
161
|
+
echo "HOOK_METRICS: post-commit duration=\${DURATION_MS}ms exit_code=\${EXIT_CODE}" >&2
|
|
162
|
+
|
|
163
|
+
# Record metrics using metrics collector (direct import for reliability)
|
|
164
|
+
node -e "
|
|
165
|
+
(async () => {
|
|
166
|
+
try {
|
|
167
|
+
const { HookMetricsCollector } = await import('./dist/postprocessor/validation/HookMetricsCollector.js');
|
|
168
|
+
const collector = new HookMetricsCollector();
|
|
169
|
+
collector.recordMetrics('post-commit', \${DURATION_MS}, \${EXIT_CODE});
|
|
170
|
+
} catch (error) {
|
|
171
|
+
// Silently fail if metrics collection fails
|
|
172
|
+
}
|
|
173
|
+
})();
|
|
174
|
+
" 2>/dev/null || true
|
|
175
|
+
|
|
176
|
+
[ \$EXIT_CODE -eq 0 ] && exit 0 || exit 1
|
|
177
|
+
else
|
|
178
|
+
# FULL MONITORING: Comprehensive analysis for post-push
|
|
179
|
+
# Timeout: 5 minutes max, comprehensive CI/CD validation
|
|
180
|
+
START_TIME=\$(date +%s)
|
|
181
|
+
timeout 300 node -e "
|
|
182
|
+
(async () => {
|
|
183
|
+
try {
|
|
184
|
+
console.log('๐ Post-push: Comprehensive validation initiated');
|
|
185
|
+
// Use import resolver for environment-aware imports
|
|
186
|
+
const { importResolver } = await import('./utils/import-resolver.js');
|
|
187
|
+
const { ComprehensiveValidator } = await importResolver.importModule('postprocessor/validation/ComprehensiveValidator');
|
|
188
|
+
|
|
189
|
+
const validator = new ComprehensiveValidator();
|
|
190
|
+
const result = await validator.validate();
|
|
191
|
+
|
|
192
|
+
if (result.warnings.length > 0) {
|
|
193
|
+
console.log('โ ๏ธ ' + result.warnings.length + ' warning(s) found:');
|
|
194
|
+
result.warnings.forEach(w => console.log(' ' + w));
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (!result.passed) {
|
|
198
|
+
console.log('โ ' + result.errors.length + ' error(s) found:');
|
|
199
|
+
result.errors.forEach(e => console.log(' ' + e));
|
|
200
|
+
process.exit(1);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (result.testResults) {
|
|
204
|
+
console.log('๐งช Tests: ' + result.testResults.passed + '/' + result.testResults.total + ' passed');
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
console.log('โ
Post-push: Comprehensive validation passed in ' + result.duration + 'ms');
|
|
208
|
+
} catch (error) {
|
|
209
|
+
console.error('โ Post-push validation failed:', error instanceof Error ? error.message : String(error));
|
|
210
|
+
process.exit(1);
|
|
211
|
+
}
|
|
212
|
+
})();
|
|
213
|
+
" 2>/dev/null
|
|
214
|
+
EXIT_CODE=\$?
|
|
215
|
+
END_TIME=\$(date +%s)
|
|
216
|
+
DURATION=\$((END_TIME - START_TIME))
|
|
217
|
+
|
|
218
|
+
# Log comprehensive metrics for monitoring (convert to milliseconds)
|
|
219
|
+
DURATION_MS=\$((DURATION * 1000))
|
|
220
|
+
echo "HOOK_METRICS: post-push duration=\${DURATION_MS}ms exit_code=\${EXIT_CODE}" >&2
|
|
221
|
+
|
|
222
|
+
# Record metrics using metrics collector (direct import for reliability)
|
|
223
|
+
node -e "
|
|
224
|
+
(async () => {
|
|
225
|
+
try {
|
|
226
|
+
const { HookMetricsCollector } = await import('./dist/postprocessor/validation/HookMetricsCollector.js');
|
|
227
|
+
const collector = new HookMetricsCollector();
|
|
228
|
+
collector.recordMetrics('post-push', \${DURATION_MS}, \${EXIT_CODE});
|
|
229
|
+
} catch (error) {
|
|
230
|
+
// Silently fail if metrics collection fails
|
|
231
|
+
}
|
|
232
|
+
})();
|
|
233
|
+
" 2>/dev/null || true
|
|
234
|
+
|
|
235
|
+
[ \$EXIT_CODE -eq 0 ] && exit 0 || exit 1
|
|
236
|
+
fi
|
|
237
|
+
else
|
|
238
|
+
echo "Warning: StringRay plugin not found or Node.js not available, skipping post-processor"
|
|
239
|
+
fi
|
|
240
|
+
)
|
|
241
|
+
|
|
242
|
+
# Don't wait for background process
|
|
243
|
+
exit 0
|
|
244
|
+
`;
|
|
245
|
+
}
|
|
246
|
+
activateGitHooks(gitHooksDir, postCommitHook, postPushHook) {
|
|
247
|
+
try {
|
|
248
|
+
// Define the target hook paths in .git/hooks
|
|
249
|
+
const gitPostCommitHook = path.join(gitHooksDir, "post-commit");
|
|
250
|
+
const gitPostPushHook = path.join(gitHooksDir, "post-push");
|
|
251
|
+
// Create relative symlinks from .git/hooks to our hooks
|
|
252
|
+
const relativePostCommit = path.relative(gitHooksDir, postCommitHook);
|
|
253
|
+
const relativePostPush = path.relative(gitHooksDir, postPushHook);
|
|
254
|
+
// Handle existing hooks by backing them up
|
|
255
|
+
this.backupExistingHook(gitPostCommitHook);
|
|
256
|
+
this.backupExistingHook(gitPostPushHook);
|
|
257
|
+
// Create symlinks to activate our hooks
|
|
258
|
+
fs.symlinkSync(relativePostCommit, gitPostCommitHook);
|
|
259
|
+
fs.symlinkSync(relativePostPush, gitPostPushHook);
|
|
260
|
+
}
|
|
261
|
+
catch (error) {
|
|
262
|
+
console.error("โ Failed to activate git hooks:", error);
|
|
263
|
+
console.log("๐ก To activate manually, run:");
|
|
264
|
+
console.log(` ln -s "../../.opencode/hooks/post-commit" ".git/hooks/post-commit"`);
|
|
265
|
+
console.log(` ln -s "../../.opencode/hooks/post-push" ".git/hooks/post-push"`);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
backupExistingHook(hookPath) {
|
|
269
|
+
if (fs.existsSync(hookPath)) {
|
|
270
|
+
const existing = fs.readFileSync(hookPath, "utf8");
|
|
271
|
+
if (!existing.includes("postprocessor-trigger")) {
|
|
272
|
+
// Backup non-postprocessor hooks
|
|
273
|
+
fs.renameSync(hookPath, `${hookPath}.backup`);
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
// Remove our existing symlink
|
|
277
|
+
fs.unlinkSync(hookPath);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
async triggerPostProcessor(context) {
|
|
282
|
+
await this.postProcessor.executePostProcessorLoop(context);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
//# sourceMappingURL=GitHookTrigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GitHookTrigger.js","sourceRoot":"","sources":["../../../../src/postprocessor/triggers/GitHookTrigger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAG7B,MAAM,OAAO,cAAc;IAGL;IAFZ,WAAW,GAAG,KAAK,CAAC;IAE5B,YAAoB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAEpD,KAAK,CAAC,UAAU;QACd,IAAI,IAAI,CAAC,WAAW;YAAE,OAAO;QAE7B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;QAChE,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QAC9D,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;QAC1D,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QAEtD,oCAAoC;QACpC,IAAI,CAA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rF,OAAO,CAAC,GAAG,CAAC,mEAAmE,CAAC,CAAC;QACnF,CAAC;IACH,CAAC;IAEO,kBAAkB,CAAC,QAAgB;QACzC,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5B,MAAM,QAAQ,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YACnD,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,CAAC;gBAChD,iCAAiC;gBACjC,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,GAAG,QAAQ,SAAS,CAAC,CAAC;YAChD,CAAC;iBAAM,CAAC;gBACN,8BAA8B;gBAC9B,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;IACH,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,OAA6B;QACtD,MAAM,IAAI,CAAC,aAAa,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAC7D,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Webhook Trigger for Post-Processor
|
|
3
|
+
*/
|
|
4
|
+
import { PostProcessor } from "../PostProcessor.js";
|
|
5
|
+
import { PostProcessorContext } from "../types.js";
|
|
6
|
+
export declare class WebhookTrigger {
|
|
7
|
+
private postProcessor;
|
|
8
|
+
private initialized;
|
|
9
|
+
constructor(postProcessor: PostProcessor);
|
|
10
|
+
initialize(): Promise<void>;
|
|
11
|
+
triggerPostProcessor(context: PostProcessorContext): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=WebhookTrigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebhookTrigger.d.ts","sourceRoot":"","sources":["../../../../src/postprocessor/triggers/WebhookTrigger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,qBAAa,cAAc;IAGb,OAAO,CAAC,aAAa;IAFjC,OAAO,CAAC,WAAW,CAAS;gBAER,aAAa,EAAE,aAAa;IAE1C,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAO3B,oBAAoB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;CAGzE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Webhook Trigger for Post-Processor
|
|
3
|
+
*/
|
|
4
|
+
export class WebhookTrigger {
|
|
5
|
+
postProcessor;
|
|
6
|
+
initialized = false;
|
|
7
|
+
constructor(postProcessor) {
|
|
8
|
+
this.postProcessor = postProcessor;
|
|
9
|
+
}
|
|
10
|
+
async initialize() {
|
|
11
|
+
if (this.initialized)
|
|
12
|
+
return;
|
|
13
|
+
// Webhook initialization would go here
|
|
14
|
+
// For now, this is a placeholder
|
|
15
|
+
this.initialized = true;
|
|
16
|
+
}
|
|
17
|
+
async triggerPostProcessor(context) {
|
|
18
|
+
await this.postProcessor.executePostProcessorLoop(context);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=WebhookTrigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebhookTrigger.js","sourceRoot":"","sources":["../../../../src/postprocessor/triggers/WebhookTrigger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,MAAM,OAAO,cAAc;IAGL;IAFZ,WAAW,GAAG,KAAK,CAAC;IAE5B,YAAoB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAEpD,KAAK,CAAC,UAAU;QACd,IAAI,IAAI,CAAC,WAAW;YAAE,OAAO;QAC7B,uCAAuC;QACvC,iCAAiC;QACjC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,OAA6B;QACtD,MAAM,IAAI,CAAC,aAAa,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAC7D,CAAC;CACF"}
|