@jakejarvis/acai 0.1.1 → 0.2.0
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.mjs +12 -2
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -2667,9 +2667,11 @@ async function ensureProvider(provider) {
|
|
|
2667
2667
|
* Generate a commit message using the given provider's CLI.
|
|
2668
2668
|
*/
|
|
2669
2669
|
async function generateCommitMessage(provider, opts) {
|
|
2670
|
-
const { diff, stat, files, commitLog, model, instructions } = opts;
|
|
2670
|
+
const { diff, stat, files, commitLog, model, instructions, log } = opts;
|
|
2671
2671
|
const systemPrompt = buildSystemPrompt(commitLog, instructions);
|
|
2672
2672
|
const userPrompt = buildUserPrompt(diff, stat, files);
|
|
2673
|
+
log?.(`System prompt:\n${systemPrompt}`);
|
|
2674
|
+
log?.(`User prompt:\n${userPrompt}`);
|
|
2673
2675
|
const args = provider.buildArgs({
|
|
2674
2676
|
userPrompt,
|
|
2675
2677
|
systemPrompt,
|
|
@@ -2683,6 +2685,7 @@ async function generateCommitMessage(provider, opts) {
|
|
|
2683
2685
|
"pipe"
|
|
2684
2686
|
] }
|
|
2685
2687
|
});
|
|
2688
|
+
log?.(`Raw response:\n${stdout}${stderr ? `\nStderr:\n${stderr}` : ""}`);
|
|
2686
2689
|
if (exitCode !== 0) throw new Error(`${provider.name} exited with code ${exitCode}\n${stderr || stdout}`);
|
|
2687
2690
|
return provider.parseOutput(stdout);
|
|
2688
2691
|
}
|
|
@@ -2703,6 +2706,10 @@ const options = {
|
|
|
2703
2706
|
type: "boolean",
|
|
2704
2707
|
short: "y"
|
|
2705
2708
|
},
|
|
2709
|
+
verbose: {
|
|
2710
|
+
type: "boolean",
|
|
2711
|
+
short: "v"
|
|
2712
|
+
},
|
|
2706
2713
|
help: {
|
|
2707
2714
|
type: "boolean",
|
|
2708
2715
|
short: "h"
|
|
@@ -2718,6 +2725,7 @@ function parseConfig() {
|
|
|
2718
2725
|
provider: values.provider ?? process.env.ACAI_PROVIDER ?? DEFAULT_PROVIDER,
|
|
2719
2726
|
model: values.model ?? process.env.ACAI_MODEL ?? "",
|
|
2720
2727
|
yolo: values.yolo ?? false,
|
|
2728
|
+
verbose: values.verbose ?? false,
|
|
2721
2729
|
help: values.help ?? false
|
|
2722
2730
|
};
|
|
2723
2731
|
}
|
|
@@ -2732,6 +2740,7 @@ Options:
|
|
|
2732
2740
|
-m, --model <model> Model to use (default: provider-specific)
|
|
2733
2741
|
Can also set ACAI_MODEL env var
|
|
2734
2742
|
-y, --yolo Stage all changes and commit without confirmation
|
|
2743
|
+
-v, --verbose Print prompts sent to the provider and raw responses
|
|
2735
2744
|
-h, --help Show this help message
|
|
2736
2745
|
|
|
2737
2746
|
Examples:
|
|
@@ -2942,7 +2951,8 @@ async function main() {
|
|
|
2942
2951
|
files,
|
|
2943
2952
|
commitLog,
|
|
2944
2953
|
model,
|
|
2945
|
-
instructions
|
|
2954
|
+
instructions,
|
|
2955
|
+
log: config.verbose ? (msg) => R$1.message(import_picocolors.default.dim(msg)) : void 0
|
|
2946
2956
|
});
|
|
2947
2957
|
} catch (e) {
|
|
2948
2958
|
s.stop("Failed");
|