copilot-hub 0.1.8 → 0.1.10
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 +1 -1
- package/scripts/dist/daemon.mjs +1 -0
- package/scripts/dist/service.mjs +29 -13
- package/scripts/src/daemon.mts +1 -0
- package/scripts/src/service.mts +30 -13
package/package.json
CHANGED
package/scripts/dist/daemon.mjs
CHANGED
package/scripts/dist/service.mjs
CHANGED
|
@@ -434,6 +434,7 @@ function runChecked(command, args, { stdio = "pipe", allowFailure = false } = {}
|
|
|
434
434
|
cwd: repoRoot,
|
|
435
435
|
shell: false,
|
|
436
436
|
stdio,
|
|
437
|
+
windowsHide: true,
|
|
437
438
|
encoding: "utf8",
|
|
438
439
|
env: process.env,
|
|
439
440
|
});
|
|
@@ -471,25 +472,40 @@ function isNotFoundMessage(value) {
|
|
|
471
472
|
message.includes("n'existe pas"));
|
|
472
473
|
}
|
|
473
474
|
function isAccessDeniedMessage(value) {
|
|
474
|
-
const
|
|
475
|
-
if (!
|
|
475
|
+
const simplified = simplifyMessageForMatch(value);
|
|
476
|
+
if (!simplified) {
|
|
476
477
|
return false;
|
|
477
478
|
}
|
|
478
|
-
|
|
479
|
+
if (simplified.includes("access is denied")) {
|
|
480
|
+
return true;
|
|
481
|
+
}
|
|
482
|
+
if (simplified.includes("acces refuse")) {
|
|
483
|
+
return true;
|
|
484
|
+
}
|
|
485
|
+
return simplified.includes("refus") && simplified.includes("acc");
|
|
479
486
|
}
|
|
480
487
|
function isRegistryValueNotFoundMessage(value) {
|
|
481
|
-
const
|
|
482
|
-
if (!
|
|
488
|
+
const simplified = simplifyMessageForMatch(value);
|
|
489
|
+
if (!simplified) {
|
|
483
490
|
return false;
|
|
484
491
|
}
|
|
485
|
-
return (
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
492
|
+
return (simplified.includes("unable to find the specified registry key or value") ||
|
|
493
|
+
simplified.includes("the system was unable to find the specified registry key or value") ||
|
|
494
|
+
simplified.includes("impossible de trouver") ||
|
|
495
|
+
simplified.includes("n'a pas trouve") ||
|
|
496
|
+
simplified.includes("n a pas trouve") ||
|
|
497
|
+
simplified.includes("la cle ou la valeur de registre specifiee") ||
|
|
498
|
+
simplified.includes("introuvable"));
|
|
499
|
+
}
|
|
500
|
+
function simplifyMessageForMatch(value) {
|
|
501
|
+
return String(value ?? "")
|
|
502
|
+
.toLowerCase()
|
|
503
|
+
.normalize("NFKD")
|
|
504
|
+
.replace(/[\u0300-\u036f]/g, "")
|
|
505
|
+
.replace(/\uFFFD/g, "")
|
|
506
|
+
.replace(/[?]/g, "'")
|
|
507
|
+
.replace(/\s+/g, " ")
|
|
508
|
+
.trim();
|
|
493
509
|
}
|
|
494
510
|
function getErrorMessage(error) {
|
|
495
511
|
if (error instanceof Error && error.message) {
|
package/scripts/src/daemon.mts
CHANGED
package/scripts/src/service.mts
CHANGED
|
@@ -532,6 +532,7 @@ function runChecked(command, args, { stdio = "pipe", allowFailure = false } = {}
|
|
|
532
532
|
cwd: repoRoot,
|
|
533
533
|
shell: false,
|
|
534
534
|
stdio,
|
|
535
|
+
windowsHide: true,
|
|
535
536
|
encoding: "utf8",
|
|
536
537
|
env: process.env,
|
|
537
538
|
});
|
|
@@ -577,30 +578,46 @@ function isNotFoundMessage(value) {
|
|
|
577
578
|
}
|
|
578
579
|
|
|
579
580
|
function isAccessDeniedMessage(value) {
|
|
580
|
-
const
|
|
581
|
-
if (!
|
|
581
|
+
const simplified = simplifyMessageForMatch(value);
|
|
582
|
+
if (!simplified) {
|
|
582
583
|
return false;
|
|
583
584
|
}
|
|
584
|
-
|
|
585
|
+
if (simplified.includes("access is denied")) {
|
|
586
|
+
return true;
|
|
587
|
+
}
|
|
588
|
+
if (simplified.includes("acces refuse")) {
|
|
589
|
+
return true;
|
|
590
|
+
}
|
|
591
|
+
return simplified.includes("refus") && simplified.includes("acc");
|
|
585
592
|
}
|
|
586
593
|
|
|
587
594
|
function isRegistryValueNotFoundMessage(value) {
|
|
588
|
-
const
|
|
589
|
-
if (!
|
|
595
|
+
const simplified = simplifyMessageForMatch(value);
|
|
596
|
+
if (!simplified) {
|
|
590
597
|
return false;
|
|
591
598
|
}
|
|
592
599
|
return (
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
message.includes("introuvable")
|
|
600
|
+
simplified.includes("unable to find the specified registry key or value") ||
|
|
601
|
+
simplified.includes("the system was unable to find the specified registry key or value") ||
|
|
602
|
+
simplified.includes("impossible de trouver") ||
|
|
603
|
+
simplified.includes("n'a pas trouve") ||
|
|
604
|
+
simplified.includes("n a pas trouve") ||
|
|
605
|
+
simplified.includes("la cle ou la valeur de registre specifiee") ||
|
|
606
|
+
simplified.includes("introuvable")
|
|
601
607
|
);
|
|
602
608
|
}
|
|
603
609
|
|
|
610
|
+
function simplifyMessageForMatch(value) {
|
|
611
|
+
return String(value ?? "")
|
|
612
|
+
.toLowerCase()
|
|
613
|
+
.normalize("NFKD")
|
|
614
|
+
.replace(/[\u0300-\u036f]/g, "")
|
|
615
|
+
.replace(/\uFFFD/g, "")
|
|
616
|
+
.replace(/[?]/g, "'")
|
|
617
|
+
.replace(/\s+/g, " ")
|
|
618
|
+
.trim();
|
|
619
|
+
}
|
|
620
|
+
|
|
604
621
|
function getErrorMessage(error) {
|
|
605
622
|
if (error instanceof Error && error.message) {
|
|
606
623
|
return error.message;
|