poe-code 3.0.127 → 3.0.129
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/cli/commands/pipeline.js +53 -5
- package/dist/cli/commands/pipeline.js.map +1 -1
- package/dist/cli/constants.d.ts +1 -1
- package/dist/cli/constants.js +1 -0
- package/dist/cli/constants.js.map +1 -1
- package/dist/cli/program.js +42 -0
- package/dist/cli/program.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6267 -2816
- package/dist/index.js.map +4 -4
- package/dist/prompts/fix-vulnerabilities.md +18 -0
- package/dist/prompts/github-issue-comment-created.md +16 -0
- package/dist/prompts/github-issue-opened.md +9 -0
- package/dist/prompts/github-pull-request-opened.md +10 -0
- package/dist/prompts/github-pull-request-synchronized.md +8 -0
- package/dist/prompts/update-dependencies.md +4 -0
- package/dist/prompts/update-documentation.md +4 -0
- package/dist/providers/claude-code.js +322 -68
- package/dist/providers/claude-code.js.map +4 -4
- package/dist/providers/codex.js +322 -68
- package/dist/providers/codex.js.map +4 -4
- package/dist/providers/kimi.js +322 -68
- package/dist/providers/kimi.js.map +4 -4
- package/dist/providers/opencode.js +322 -68
- package/dist/providers/opencode.js.map +4 -4
- package/dist/providers/poe-agent.js +2 -1
- package/dist/providers/poe-agent.js.map +2 -2
- package/dist/sdk/pipeline.d.ts +1 -1
- package/dist/sdk/pipeline.js.map +1 -1
- package/dist/templates/pipeline/SKILL_plan.md +33 -17
- package/dist/templates/pipeline/steps.yaml.hbs +16 -4
- package/package.json +16 -8
|
@@ -24,6 +24,62 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
mod
|
|
25
25
|
));
|
|
26
26
|
|
|
27
|
+
// node_modules/sisteransi/src/index.js
|
|
28
|
+
var require_src = __commonJS({
|
|
29
|
+
"node_modules/sisteransi/src/index.js"(exports, module) {
|
|
30
|
+
"use strict";
|
|
31
|
+
var ESC = "\x1B";
|
|
32
|
+
var CSI = `${ESC}[`;
|
|
33
|
+
var beep = "\x07";
|
|
34
|
+
var cursor = {
|
|
35
|
+
to(x, y) {
|
|
36
|
+
if (!y) return `${CSI}${x + 1}G`;
|
|
37
|
+
return `${CSI}${y + 1};${x + 1}H`;
|
|
38
|
+
},
|
|
39
|
+
move(x, y) {
|
|
40
|
+
let ret = "";
|
|
41
|
+
if (x < 0) ret += `${CSI}${-x}D`;
|
|
42
|
+
else if (x > 0) ret += `${CSI}${x}C`;
|
|
43
|
+
if (y < 0) ret += `${CSI}${-y}A`;
|
|
44
|
+
else if (y > 0) ret += `${CSI}${y}B`;
|
|
45
|
+
return ret;
|
|
46
|
+
},
|
|
47
|
+
up: (count = 1) => `${CSI}${count}A`,
|
|
48
|
+
down: (count = 1) => `${CSI}${count}B`,
|
|
49
|
+
forward: (count = 1) => `${CSI}${count}C`,
|
|
50
|
+
backward: (count = 1) => `${CSI}${count}D`,
|
|
51
|
+
nextLine: (count = 1) => `${CSI}E`.repeat(count),
|
|
52
|
+
prevLine: (count = 1) => `${CSI}F`.repeat(count),
|
|
53
|
+
left: `${CSI}G`,
|
|
54
|
+
hide: `${CSI}?25l`,
|
|
55
|
+
show: `${CSI}?25h`,
|
|
56
|
+
save: `${ESC}7`,
|
|
57
|
+
restore: `${ESC}8`
|
|
58
|
+
};
|
|
59
|
+
var scroll = {
|
|
60
|
+
up: (count = 1) => `${CSI}S`.repeat(count),
|
|
61
|
+
down: (count = 1) => `${CSI}T`.repeat(count)
|
|
62
|
+
};
|
|
63
|
+
var erase = {
|
|
64
|
+
screen: `${CSI}2J`,
|
|
65
|
+
up: (count = 1) => `${CSI}1J`.repeat(count),
|
|
66
|
+
down: (count = 1) => `${CSI}J`.repeat(count),
|
|
67
|
+
line: `${CSI}2K`,
|
|
68
|
+
lineEnd: `${CSI}K`,
|
|
69
|
+
lineStart: `${CSI}1K`,
|
|
70
|
+
lines(count) {
|
|
71
|
+
let clear = "";
|
|
72
|
+
for (let i = 0; i < count; i++)
|
|
73
|
+
clear += this.line + (i < count - 1 ? cursor.up() : "");
|
|
74
|
+
if (count)
|
|
75
|
+
clear += cursor.left;
|
|
76
|
+
return clear;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
module.exports = { cursor, scroll, erase, beep };
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
27
83
|
// src/templates/python/env.hbs
|
|
28
84
|
var require_env = __commonJS({
|
|
29
85
|
"src/templates/python/env.hbs"(exports, module) {
|
|
@@ -82,7 +138,8 @@ var CODEX_MODELS = [
|
|
|
82
138
|
var DEFAULT_CODEX_MODEL = CODEX_MODELS[0];
|
|
83
139
|
var KIMI_MODELS = [
|
|
84
140
|
"novitaai/kimi-k2.5",
|
|
85
|
-
"novitaai/kimi-k2-thinking"
|
|
141
|
+
"novitaai/kimi-k2-thinking",
|
|
142
|
+
"novitaai/kimi-k2.5-fw"
|
|
86
143
|
];
|
|
87
144
|
var DEFAULT_KIMI_MODEL = KIMI_MODELS[0];
|
|
88
145
|
var PROVIDER_NAME = "poe";
|
|
@@ -545,6 +602,24 @@ import chalk2 from "chalk";
|
|
|
545
602
|
// packages/design-system/src/components/text.ts
|
|
546
603
|
import chalk3 from "chalk";
|
|
547
604
|
|
|
605
|
+
// packages/design-system/src/internal/output-format.ts
|
|
606
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
607
|
+
var VALID_FORMATS = /* @__PURE__ */ new Set(["terminal", "markdown", "json"]);
|
|
608
|
+
var formatStorage = new AsyncLocalStorage();
|
|
609
|
+
var cached;
|
|
610
|
+
function resolveOutputFormat(env = process.env) {
|
|
611
|
+
const scoped = formatStorage.getStore();
|
|
612
|
+
if (scoped) {
|
|
613
|
+
return scoped;
|
|
614
|
+
}
|
|
615
|
+
if (cached) {
|
|
616
|
+
return cached;
|
|
617
|
+
}
|
|
618
|
+
const raw = env.OUTPUT_FORMAT?.toLowerCase();
|
|
619
|
+
cached = VALID_FORMATS.has(raw) ? raw : "terminal";
|
|
620
|
+
return cached;
|
|
621
|
+
}
|
|
622
|
+
|
|
548
623
|
// packages/design-system/src/internal/theme-detect.ts
|
|
549
624
|
function detectThemeFromEnv(env) {
|
|
550
625
|
const apple = env.APPLE_INTERFACE_STYLE;
|
|
@@ -596,80 +671,225 @@ function getTheme(env) {
|
|
|
596
671
|
import chalk4 from "chalk";
|
|
597
672
|
var symbols = {
|
|
598
673
|
get info() {
|
|
674
|
+
const format = resolveOutputFormat();
|
|
675
|
+
if (format === "json") return "info";
|
|
676
|
+
if (format === "markdown") return "(i)";
|
|
599
677
|
return chalk4.magenta("\u25CF");
|
|
600
678
|
},
|
|
601
679
|
get success() {
|
|
680
|
+
const format = resolveOutputFormat();
|
|
681
|
+
if (format === "json") return "success";
|
|
682
|
+
if (format === "markdown") return "[ok]";
|
|
602
683
|
return chalk4.magenta("\u25C6");
|
|
603
684
|
},
|
|
604
685
|
get resolved() {
|
|
605
|
-
const
|
|
606
|
-
return
|
|
686
|
+
const format = resolveOutputFormat();
|
|
687
|
+
if (format === "json") return "resolved";
|
|
688
|
+
if (format === "markdown") return ">";
|
|
689
|
+
return getTheme().resolvedSymbol;
|
|
607
690
|
},
|
|
608
691
|
get errorResolved() {
|
|
609
|
-
const
|
|
610
|
-
return
|
|
692
|
+
const format = resolveOutputFormat();
|
|
693
|
+
if (format === "json") return "error";
|
|
694
|
+
if (format === "markdown") return "[!]";
|
|
695
|
+
return getTheme().errorSymbol;
|
|
696
|
+
},
|
|
697
|
+
get bar() {
|
|
698
|
+
const format = resolveOutputFormat();
|
|
699
|
+
if (format === "json") return "";
|
|
700
|
+
if (format === "markdown") return "|";
|
|
701
|
+
return "\u2502";
|
|
611
702
|
},
|
|
612
|
-
bar: "\u2502",
|
|
613
703
|
cornerTopRight: "\u256E",
|
|
614
704
|
cornerBottomRight: "\u256F",
|
|
615
|
-
warning
|
|
616
|
-
|
|
617
|
-
|
|
705
|
+
get warning() {
|
|
706
|
+
const format = resolveOutputFormat();
|
|
707
|
+
if (format === "json") return "warning";
|
|
708
|
+
if (format === "markdown") return "[!]";
|
|
709
|
+
return "\u25B2";
|
|
710
|
+
},
|
|
711
|
+
get active() {
|
|
712
|
+
const format = resolveOutputFormat();
|
|
713
|
+
if (format === "json") return "active";
|
|
714
|
+
if (format === "markdown") return "[x]";
|
|
715
|
+
return "\u25C6";
|
|
716
|
+
},
|
|
717
|
+
get inactive() {
|
|
718
|
+
const format = resolveOutputFormat();
|
|
719
|
+
if (format === "json") return "inactive";
|
|
720
|
+
if (format === "markdown") return "[ ]";
|
|
721
|
+
return "\u25CB";
|
|
722
|
+
}
|
|
618
723
|
};
|
|
619
724
|
|
|
620
725
|
// packages/design-system/src/components/logger.ts
|
|
621
|
-
import
|
|
726
|
+
import chalk6 from "chalk";
|
|
727
|
+
|
|
728
|
+
// packages/design-system/src/prompts/primitives/log.ts
|
|
622
729
|
import chalk5 from "chalk";
|
|
623
730
|
|
|
624
|
-
// packages/design-system/src/internal/
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
731
|
+
// packages/design-system/src/internal/strip-ansi.ts
|
|
732
|
+
function stripAnsi(value) {
|
|
733
|
+
return value.replace(/\u001b\[[0-9;]*m/g, "");
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
// packages/design-system/src/prompts/primitives/log.ts
|
|
737
|
+
function writeTerminalMessage(msg, {
|
|
738
|
+
symbol = chalk5.gray("\u2502"),
|
|
739
|
+
secondarySymbol = chalk5.gray("\u2502"),
|
|
740
|
+
spacing: spacing2 = 1,
|
|
741
|
+
withGuide = true
|
|
742
|
+
} = {}) {
|
|
743
|
+
const lines = [];
|
|
744
|
+
const showGuide = withGuide !== false;
|
|
745
|
+
const contentLines = msg.split("\n");
|
|
746
|
+
const prefix = showGuide ? `${symbol} ` : "";
|
|
747
|
+
const continuationPrefix = showGuide ? `${secondarySymbol} ` : "";
|
|
748
|
+
const emptyGuide = showGuide ? secondarySymbol : "";
|
|
749
|
+
for (let index = 0; index < spacing2; index += 1) {
|
|
750
|
+
lines.push(emptyGuide);
|
|
751
|
+
}
|
|
752
|
+
if (contentLines.length === 0) {
|
|
753
|
+
process.stdout.write("\n");
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
756
|
+
const [firstLine = "", ...continuationLines] = contentLines;
|
|
757
|
+
if (firstLine.length > 0) {
|
|
758
|
+
lines.push(`${prefix}${firstLine}`);
|
|
759
|
+
} else {
|
|
760
|
+
lines.push(showGuide ? symbol : "");
|
|
630
761
|
}
|
|
631
|
-
const
|
|
632
|
-
|
|
633
|
-
|
|
762
|
+
for (const line of continuationLines) {
|
|
763
|
+
if (line.length > 0) {
|
|
764
|
+
lines.push(`${continuationPrefix}${line}`);
|
|
765
|
+
continue;
|
|
766
|
+
}
|
|
767
|
+
lines.push(emptyGuide);
|
|
768
|
+
}
|
|
769
|
+
process.stdout.write(`${lines.join("\n")}
|
|
770
|
+
`);
|
|
771
|
+
}
|
|
772
|
+
function message(msg, options) {
|
|
773
|
+
const format = resolveOutputFormat();
|
|
774
|
+
if (format === "markdown") {
|
|
775
|
+
process.stdout.write(`- ${stripAnsi(msg)}
|
|
776
|
+
`);
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
779
|
+
if (format === "json") {
|
|
780
|
+
process.stdout.write(
|
|
781
|
+
`${JSON.stringify({ level: "message", message: stripAnsi(msg) })}
|
|
782
|
+
`
|
|
783
|
+
);
|
|
784
|
+
return;
|
|
785
|
+
}
|
|
786
|
+
writeTerminalMessage(msg, options);
|
|
787
|
+
}
|
|
788
|
+
function info(msg) {
|
|
789
|
+
const format = resolveOutputFormat();
|
|
790
|
+
if (format === "markdown") {
|
|
791
|
+
process.stdout.write(`- **info:** ${stripAnsi(msg)}
|
|
792
|
+
`);
|
|
793
|
+
return;
|
|
794
|
+
}
|
|
795
|
+
if (format === "json") {
|
|
796
|
+
process.stdout.write(
|
|
797
|
+
`${JSON.stringify({ level: "info", message: stripAnsi(msg) })}
|
|
798
|
+
`
|
|
799
|
+
);
|
|
800
|
+
return;
|
|
801
|
+
}
|
|
802
|
+
message(msg, { symbol: symbols.info });
|
|
803
|
+
}
|
|
804
|
+
function success(msg) {
|
|
805
|
+
const format = resolveOutputFormat();
|
|
806
|
+
if (format === "markdown") {
|
|
807
|
+
process.stdout.write(`- **success:** ${stripAnsi(msg)}
|
|
808
|
+
`);
|
|
809
|
+
return;
|
|
810
|
+
}
|
|
811
|
+
if (format === "json") {
|
|
812
|
+
process.stdout.write(
|
|
813
|
+
`${JSON.stringify({ level: "success", message: stripAnsi(msg) })}
|
|
814
|
+
`
|
|
815
|
+
);
|
|
816
|
+
return;
|
|
817
|
+
}
|
|
818
|
+
message(msg, { symbol: symbols.success });
|
|
819
|
+
}
|
|
820
|
+
function warn(msg) {
|
|
821
|
+
const format = resolveOutputFormat();
|
|
822
|
+
if (format === "markdown") {
|
|
823
|
+
process.stdout.write(`- **warning:** ${stripAnsi(msg)}
|
|
824
|
+
`);
|
|
825
|
+
return;
|
|
826
|
+
}
|
|
827
|
+
if (format === "json") {
|
|
828
|
+
process.stdout.write(
|
|
829
|
+
`${JSON.stringify({ level: "warn", message: stripAnsi(msg) })}
|
|
830
|
+
`
|
|
831
|
+
);
|
|
832
|
+
return;
|
|
833
|
+
}
|
|
834
|
+
message(msg, { symbol: chalk5.yellow("\u25B2") });
|
|
634
835
|
}
|
|
836
|
+
function error(msg) {
|
|
837
|
+
const format = resolveOutputFormat();
|
|
838
|
+
if (format === "markdown") {
|
|
839
|
+
process.stdout.write(`- **error:** ${stripAnsi(msg)}
|
|
840
|
+
`);
|
|
841
|
+
return;
|
|
842
|
+
}
|
|
843
|
+
if (format === "json") {
|
|
844
|
+
process.stdout.write(
|
|
845
|
+
`${JSON.stringify({ level: "error", message: stripAnsi(msg) })}
|
|
846
|
+
`
|
|
847
|
+
);
|
|
848
|
+
return;
|
|
849
|
+
}
|
|
850
|
+
message(msg, { symbol: chalk5.red("\u25A0") });
|
|
851
|
+
}
|
|
852
|
+
var log = {
|
|
853
|
+
info,
|
|
854
|
+
success,
|
|
855
|
+
message,
|
|
856
|
+
warn,
|
|
857
|
+
error
|
|
858
|
+
};
|
|
635
859
|
|
|
636
860
|
// packages/design-system/src/components/logger.ts
|
|
637
861
|
function createLogger(emitter) {
|
|
638
|
-
const emit = (level,
|
|
862
|
+
const emit = (level, message2) => {
|
|
639
863
|
if (emitter) {
|
|
640
|
-
emitter(
|
|
641
|
-
return;
|
|
642
|
-
}
|
|
643
|
-
if (resolveOutputFormat() !== "terminal") {
|
|
644
|
-
process.stdout.write(message + "\n");
|
|
864
|
+
emitter(message2);
|
|
645
865
|
return;
|
|
646
866
|
}
|
|
647
867
|
if (level === "success") {
|
|
648
|
-
log.
|
|
868
|
+
log.success(message2);
|
|
649
869
|
return;
|
|
650
870
|
}
|
|
651
871
|
if (level === "warn") {
|
|
652
|
-
log.warn(
|
|
872
|
+
log.warn(message2);
|
|
653
873
|
return;
|
|
654
874
|
}
|
|
655
875
|
if (level === "error") {
|
|
656
|
-
log.error(
|
|
876
|
+
log.error(message2);
|
|
657
877
|
return;
|
|
658
878
|
}
|
|
659
|
-
log.
|
|
879
|
+
log.info(message2);
|
|
660
880
|
};
|
|
661
881
|
return {
|
|
662
|
-
info(
|
|
663
|
-
emit("info",
|
|
882
|
+
info(message2) {
|
|
883
|
+
emit("info", message2);
|
|
664
884
|
},
|
|
665
|
-
success(
|
|
666
|
-
emit("success",
|
|
885
|
+
success(message2) {
|
|
886
|
+
emit("success", message2);
|
|
667
887
|
},
|
|
668
|
-
warn(
|
|
669
|
-
emit("warn",
|
|
888
|
+
warn(message2) {
|
|
889
|
+
emit("warn", message2);
|
|
670
890
|
},
|
|
671
|
-
error(
|
|
672
|
-
emit("error",
|
|
891
|
+
error(message2) {
|
|
892
|
+
emit("error", message2);
|
|
673
893
|
},
|
|
674
894
|
resolved(label, value) {
|
|
675
895
|
if (emitter) {
|
|
@@ -687,12 +907,12 @@ function createLogger(emitter) {
|
|
|
687
907
|
log.message(`${label}
|
|
688
908
|
${value}`, { symbol: symbols.errorResolved });
|
|
689
909
|
},
|
|
690
|
-
message(
|
|
910
|
+
message(message2, symbol) {
|
|
691
911
|
if (emitter) {
|
|
692
|
-
emitter(
|
|
912
|
+
emitter(message2);
|
|
693
913
|
return;
|
|
694
914
|
}
|
|
695
|
-
log.message(
|
|
915
|
+
log.message(message2, { symbol: symbol ?? chalk6.gray("\u2502") });
|
|
696
916
|
}
|
|
697
917
|
};
|
|
698
918
|
}
|
|
@@ -702,18 +922,52 @@ var logger = createLogger();
|
|
|
702
922
|
import { Table } from "console-table-printer";
|
|
703
923
|
|
|
704
924
|
// packages/design-system/src/acp/components.ts
|
|
705
|
-
import
|
|
706
|
-
var AGENT_PREFIX = `${
|
|
925
|
+
import chalk7 from "chalk";
|
|
926
|
+
var AGENT_PREFIX = `${chalk7.green.bold("\u2713")} agent: `;
|
|
707
927
|
|
|
708
928
|
// packages/design-system/src/prompts/index.ts
|
|
929
|
+
import chalk14 from "chalk";
|
|
709
930
|
import * as clack from "@clack/prompts";
|
|
710
|
-
|
|
931
|
+
|
|
932
|
+
// packages/design-system/src/prompts/primitives/cancel.ts
|
|
933
|
+
import chalk8 from "chalk";
|
|
934
|
+
|
|
935
|
+
// node_modules/@clack/core/dist/index.mjs
|
|
936
|
+
var import_sisteransi = __toESM(require_src(), 1);
|
|
937
|
+
import { stdout as R, stdin as q } from "node:process";
|
|
938
|
+
import * as k from "node:readline";
|
|
939
|
+
import ot from "node:readline";
|
|
940
|
+
import { ReadStream as J } from "node:tty";
|
|
941
|
+
var P = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu");
|
|
942
|
+
var ct = new RegExp("\\p{M}+", "gu");
|
|
943
|
+
var pt = { limit: 1 / 0, ellipsis: "" };
|
|
944
|
+
var ft = { limit: 1 / 0, ellipsis: "", ellipsisWidth: 0 };
|
|
945
|
+
var j = "\x07";
|
|
946
|
+
var Q = "[";
|
|
947
|
+
var dt = "]";
|
|
948
|
+
var U = `${dt}8;;`;
|
|
949
|
+
var et = new RegExp(`(?:\\${Q}(?<code>\\d+)m|\\${U}(?<uri>.*)${j})`, "y");
|
|
950
|
+
var At = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
951
|
+
var _ = { actions: new Set(At), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" }, withGuide: true };
|
|
952
|
+
var bt = globalThis.process.platform.startsWith("win");
|
|
953
|
+
|
|
954
|
+
// packages/design-system/src/prompts/primitives/intro.ts
|
|
955
|
+
import chalk9 from "chalk";
|
|
956
|
+
|
|
957
|
+
// packages/design-system/src/prompts/primitives/note.ts
|
|
958
|
+
import chalk10 from "chalk";
|
|
959
|
+
|
|
960
|
+
// packages/design-system/src/prompts/primitives/outro.ts
|
|
961
|
+
import chalk11 from "chalk";
|
|
962
|
+
|
|
963
|
+
// packages/design-system/src/prompts/primitives/spinner.ts
|
|
964
|
+
import chalk13 from "chalk";
|
|
711
965
|
|
|
712
966
|
// packages/design-system/src/static/spinner.ts
|
|
713
|
-
import
|
|
967
|
+
import chalk12 from "chalk";
|
|
714
968
|
|
|
715
969
|
// packages/design-system/src/static/menu.ts
|
|
716
|
-
import
|
|
970
|
+
import chalk15 from "chalk";
|
|
717
971
|
|
|
718
972
|
// packages/agent-spawn/src/acp/spawn.ts
|
|
719
973
|
import { spawn as spawnChildProcess3 } from "node:child_process";
|
|
@@ -1133,28 +1387,28 @@ function resolvePath(rawPath, homeDir, pathMapper) {
|
|
|
1133
1387
|
}
|
|
1134
1388
|
|
|
1135
1389
|
// packages/config-mutations/src/fs-utils.ts
|
|
1136
|
-
function isNotFound(
|
|
1137
|
-
return typeof
|
|
1390
|
+
function isNotFound(error2) {
|
|
1391
|
+
return typeof error2 === "object" && error2 !== null && "code" in error2 && error2.code === "ENOENT";
|
|
1138
1392
|
}
|
|
1139
1393
|
async function readFileIfExists(fs, target) {
|
|
1140
1394
|
try {
|
|
1141
1395
|
return await fs.readFile(target, "utf8");
|
|
1142
|
-
} catch (
|
|
1143
|
-
if (isNotFound(
|
|
1396
|
+
} catch (error2) {
|
|
1397
|
+
if (isNotFound(error2)) {
|
|
1144
1398
|
return null;
|
|
1145
1399
|
}
|
|
1146
|
-
throw
|
|
1400
|
+
throw error2;
|
|
1147
1401
|
}
|
|
1148
1402
|
}
|
|
1149
1403
|
async function pathExists(fs, target) {
|
|
1150
1404
|
try {
|
|
1151
1405
|
await fs.stat(target);
|
|
1152
1406
|
return true;
|
|
1153
|
-
} catch (
|
|
1154
|
-
if (isNotFound(
|
|
1407
|
+
} catch (error2) {
|
|
1408
|
+
if (isNotFound(error2)) {
|
|
1155
1409
|
return false;
|
|
1156
1410
|
}
|
|
1157
|
-
throw
|
|
1411
|
+
throw error2;
|
|
1158
1412
|
}
|
|
1159
1413
|
}
|
|
1160
1414
|
function createTimestamp() {
|
|
@@ -1362,14 +1616,14 @@ async function applyRemoveFile(mutation, context, options) {
|
|
|
1362
1616
|
outcome: { changed: true, effect: "delete", detail: "delete" },
|
|
1363
1617
|
details
|
|
1364
1618
|
};
|
|
1365
|
-
} catch (
|
|
1366
|
-
if (isNotFound(
|
|
1619
|
+
} catch (error2) {
|
|
1620
|
+
if (isNotFound(error2)) {
|
|
1367
1621
|
return {
|
|
1368
1622
|
outcome: { changed: false, effect: "none", detail: "noop" },
|
|
1369
1623
|
details
|
|
1370
1624
|
};
|
|
1371
1625
|
}
|
|
1372
|
-
throw
|
|
1626
|
+
throw error2;
|
|
1373
1627
|
}
|
|
1374
1628
|
}
|
|
1375
1629
|
async function applyChmod(mutation, context, options) {
|
|
@@ -1402,14 +1656,14 @@ async function applyChmod(mutation, context, options) {
|
|
|
1402
1656
|
outcome: { changed: true, effect: "chmod", detail: "update" },
|
|
1403
1657
|
details
|
|
1404
1658
|
};
|
|
1405
|
-
} catch (
|
|
1406
|
-
if (isNotFound(
|
|
1659
|
+
} catch (error2) {
|
|
1660
|
+
if (isNotFound(error2)) {
|
|
1407
1661
|
return {
|
|
1408
1662
|
outcome: { changed: false, effect: "none", detail: "noop" },
|
|
1409
1663
|
details
|
|
1410
1664
|
};
|
|
1411
1665
|
}
|
|
1412
|
-
throw
|
|
1666
|
+
throw error2;
|
|
1413
1667
|
}
|
|
1414
1668
|
}
|
|
1415
1669
|
async function applyBackup(mutation, context, options) {
|
|
@@ -1654,10 +1908,10 @@ async function applyTemplateMerge(mutation, context, options, formatName) {
|
|
|
1654
1908
|
let templateDoc;
|
|
1655
1909
|
try {
|
|
1656
1910
|
templateDoc = format.parse(rendered);
|
|
1657
|
-
} catch (
|
|
1911
|
+
} catch (error2) {
|
|
1658
1912
|
throw new Error(
|
|
1659
|
-
`Failed to parse rendered template "${mutation.templateId}" as ${formatName.toUpperCase()}: ${
|
|
1660
|
-
{ cause:
|
|
1913
|
+
`Failed to parse rendered template "${mutation.templateId}" as ${formatName.toUpperCase()}: ${error2}`,
|
|
1914
|
+
{ cause: error2 }
|
|
1661
1915
|
);
|
|
1662
1916
|
}
|
|
1663
1917
|
const rawContent = await readFileIfExists(context.fs, targetPath);
|
|
@@ -1718,16 +1972,16 @@ async function executeMutation(mutation, context, options) {
|
|
|
1718
1972
|
const { outcome, details } = await applyMutation(mutation, context, options);
|
|
1719
1973
|
context.observers?.onComplete?.(details, outcome);
|
|
1720
1974
|
return { outcome, details };
|
|
1721
|
-
} catch (
|
|
1975
|
+
} catch (error2) {
|
|
1722
1976
|
context.observers?.onError?.(
|
|
1723
1977
|
{
|
|
1724
1978
|
kind: mutation.kind,
|
|
1725
1979
|
label: mutation.label ?? mutation.kind,
|
|
1726
1980
|
targetPath: void 0
|
|
1727
1981
|
},
|
|
1728
|
-
|
|
1982
|
+
error2
|
|
1729
1983
|
);
|
|
1730
|
-
throw
|
|
1984
|
+
throw error2;
|
|
1731
1985
|
}
|
|
1732
1986
|
}
|
|
1733
1987
|
|
|
@@ -1745,8 +1999,8 @@ async function runServiceInstall(definition, context) {
|
|
|
1745
1999
|
try {
|
|
1746
2000
|
await definition.check.run(checkContext);
|
|
1747
2001
|
context.logger(`${definition.summary} already installed.`);
|
|
1748
|
-
} catch (
|
|
1749
|
-
const detail =
|
|
2002
|
+
} catch (error2) {
|
|
2003
|
+
const detail = error2 instanceof Error ? error2.message : String(error2);
|
|
1750
2004
|
context.logger(`${definition.summary} not detected: ${detail}`);
|
|
1751
2005
|
needsInstall = true;
|
|
1752
2006
|
}
|
|
@@ -1881,7 +2135,7 @@ function createInstallRunner(definition) {
|
|
|
1881
2135
|
await runServiceInstall(definition, {
|
|
1882
2136
|
isDryRun: context.logger.context.dryRun,
|
|
1883
2137
|
runCommand: context.command.runCommand,
|
|
1884
|
-
logger: (
|
|
2138
|
+
logger: (message2) => context.logger.verbose(message2),
|
|
1885
2139
|
platform: context.env.platform
|
|
1886
2140
|
});
|
|
1887
2141
|
};
|