pumuki 6.3.336 → 6.3.338
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pumuki",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.338",
|
|
4
4
|
"description": "Enterprise-grade AST Intelligence System with multi-platform support (iOS, Android, Backend, Frontend) and Feature-First + DDD + Clean Architecture enforcement. Includes dynamic violations API for intelligent querying.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -8,6 +8,7 @@ struct DialogConfig {
|
|
|
8
8
|
let disableButton: String
|
|
9
9
|
let muteButton: String
|
|
10
10
|
let keepButton: String
|
|
11
|
+
let timeoutSeconds: Double
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
func parseArguments() -> DialogConfig {
|
|
@@ -18,13 +19,20 @@ func parseArguments() -> DialogConfig {
|
|
|
18
19
|
}
|
|
19
20
|
return args[index + 1]
|
|
20
21
|
}
|
|
22
|
+
func readDouble(_ key: String, fallback: Double) -> Double {
|
|
23
|
+
guard let value = Double(read(key, fallback: String(fallback))), value > 0 else {
|
|
24
|
+
return fallback
|
|
25
|
+
}
|
|
26
|
+
return value
|
|
27
|
+
}
|
|
21
28
|
return DialogConfig(
|
|
22
29
|
title: read("--title", fallback: "Pumuki bloqueado"),
|
|
23
30
|
cause: read("--cause", fallback: "Bloqueo detectado."),
|
|
24
31
|
remediation: read("--remediation", fallback: "Corrige el bloqueo y vuelve a ejecutar."),
|
|
25
32
|
disableButton: read("--disable-button", fallback: "Desactivar"),
|
|
26
33
|
muteButton: read("--mute-button", fallback: "Silenciar 30 min"),
|
|
27
|
-
keepButton: read("--keep-button", fallback: "Mantener activas")
|
|
34
|
+
keepButton: read("--keep-button", fallback: "Mantener activas"),
|
|
35
|
+
timeoutSeconds: readDouble("--timeout-seconds", fallback: 15)
|
|
28
36
|
)
|
|
29
37
|
}
|
|
30
38
|
|
|
@@ -69,6 +77,13 @@ final class DialogAppDelegate: NSObject, NSApplicationDelegate {
|
|
|
69
77
|
alert.addButton(withTitle: config.muteButton)
|
|
70
78
|
alert.addButton(withTitle: config.disableButton)
|
|
71
79
|
|
|
80
|
+
DispatchQueue.main.asyncAfter(deadline: .now() + config.timeoutSeconds) {
|
|
81
|
+
if alert.window.isVisible {
|
|
82
|
+
alert.window.orderOut(nil)
|
|
83
|
+
NSApp.stopModal(withCode: .alertFirstButtonReturn)
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
72
87
|
let response = alert.runModal()
|
|
73
88
|
let choice: String
|
|
74
89
|
switch response {
|
|
@@ -199,13 +199,48 @@ const formatCauseFix = (cause: BlockedCause): string =>
|
|
|
199
199
|
'Corrige la violación indicada con regla, fichero y línea, y vuelve a intentar el commit.'
|
|
200
200
|
);
|
|
201
201
|
|
|
202
|
+
const normalizeRuleCode = (ruleId: string): string =>
|
|
203
|
+
ruleId
|
|
204
|
+
.replace(/^skills\./u, 'SKILLS_')
|
|
205
|
+
.replace(/[.-]/gu, '_')
|
|
206
|
+
.toUpperCase();
|
|
207
|
+
|
|
208
|
+
const isGenericCauseFix = (value?: string): boolean =>
|
|
209
|
+
!value ||
|
|
210
|
+
/corrige la violaci[oó]n indicada/i.test(value) ||
|
|
211
|
+
/corrige las violaciones listadas/i.test(value);
|
|
212
|
+
|
|
213
|
+
const extractNestedSkillRuleId = (message: string): string | null =>
|
|
214
|
+
message.match(/\b(skills\.[a-z0-9_.-]+)\b/iu)?.[1] ?? null;
|
|
215
|
+
|
|
216
|
+
const normalizeDisplayCause = (cause: BlockedCause): BlockedCause => {
|
|
217
|
+
if (isSkillCause(cause) || isSkillsContractCause(cause)) {
|
|
218
|
+
return cause;
|
|
219
|
+
}
|
|
220
|
+
const nestedSkillRuleId = extractNestedSkillRuleId(cause.message);
|
|
221
|
+
if (!nestedSkillRuleId) {
|
|
222
|
+
return cause;
|
|
223
|
+
}
|
|
224
|
+
const nestedFile = extractMessageField(cause.message, 'file');
|
|
225
|
+
const nestedRemediation = extractMessageField(cause.message, 'remediation');
|
|
226
|
+
return {
|
|
227
|
+
...cause,
|
|
228
|
+
code: normalizeRuleCode(nestedSkillRuleId),
|
|
229
|
+
ruleId: nestedSkillRuleId,
|
|
230
|
+
file: nestedFile ?? cause.file,
|
|
231
|
+
remediation: isGenericCauseFix(cause.remediation)
|
|
232
|
+
? nestedRemediation ?? cause.remediation
|
|
233
|
+
: cause.remediation,
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
|
|
202
237
|
export const resolvePrioritizedBlockingCauses = (
|
|
203
238
|
causes: Extract<PumukiCriticalNotificationEvent, { kind: 'gate.blocked' }>['blockingCauses']
|
|
204
239
|
): ReadonlyArray<BlockedCause> => {
|
|
205
240
|
if (!causes || causes.length === 0) {
|
|
206
241
|
return [];
|
|
207
242
|
}
|
|
208
|
-
return
|
|
243
|
+
return causes.map(normalizeDisplayCause).sort((left, right) => {
|
|
209
244
|
const leftSkill = isSkillCause(left);
|
|
210
245
|
const rightSkill = isSkillCause(right);
|
|
211
246
|
if (leftSkill !== rightSkill) {
|