@hasnatools/skills 0.1.7 → 0.1.8
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/index.js +46 -28
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -21953,6 +21953,35 @@ async function marketplaceCommand(options = {}) {
|
|
|
21953
21953
|
var import_prompts2 = __toESM(require_prompts3(), 1);
|
|
21954
21954
|
var indigo2 = source_default.hex("#6366f1");
|
|
21955
21955
|
var indigoBold = source_default.hex("#6366f1").bold;
|
|
21956
|
+
async function submitFeedback(type, title, description) {
|
|
21957
|
+
const spinner = ora("Submitting feedback...").start();
|
|
21958
|
+
try {
|
|
21959
|
+
const res = await makeApiRequest("/feedback", {
|
|
21960
|
+
method: "POST",
|
|
21961
|
+
body: JSON.stringify({
|
|
21962
|
+
type,
|
|
21963
|
+
title,
|
|
21964
|
+
description,
|
|
21965
|
+
page: "cli"
|
|
21966
|
+
})
|
|
21967
|
+
});
|
|
21968
|
+
if (!res.ok) {
|
|
21969
|
+
const data = await res.json();
|
|
21970
|
+
spinner.fail("Failed to submit feedback");
|
|
21971
|
+
console.log(source_default.red(" " + (data.error || "Unknown error")));
|
|
21972
|
+
return false;
|
|
21973
|
+
}
|
|
21974
|
+
spinner.succeed("Feedback submitted!");
|
|
21975
|
+
console.log();
|
|
21976
|
+
console.log(indigo2(" Thank you for your feedback! \uD83D\uDE4F"));
|
|
21977
|
+
console.log(source_default.dim(" We'll review it and get back to you if needed."));
|
|
21978
|
+
return true;
|
|
21979
|
+
} catch (error) {
|
|
21980
|
+
spinner.fail("Failed to submit feedback");
|
|
21981
|
+
console.log(source_default.red(" " + (error instanceof Error ? error.message : "Network error")));
|
|
21982
|
+
return false;
|
|
21983
|
+
}
|
|
21984
|
+
}
|
|
21956
21985
|
async function feedbackCommand(options = {}) {
|
|
21957
21986
|
console.log();
|
|
21958
21987
|
console.log(indigoBold("\uD83D\uDCDD Submit Feedback"));
|
|
@@ -21964,6 +21993,17 @@ async function feedbackCommand(options = {}) {
|
|
|
21964
21993
|
console.log();
|
|
21965
21994
|
return;
|
|
21966
21995
|
}
|
|
21996
|
+
if (options.type && options.title && options.message) {
|
|
21997
|
+
const validTypes = ["bug", "feature", "improvement", "other"];
|
|
21998
|
+
if (!validTypes.includes(options.type)) {
|
|
21999
|
+
console.log(source_default.red(" Invalid type. Must be one of: " + validTypes.join(", ")));
|
|
22000
|
+
console.log();
|
|
22001
|
+
return;
|
|
22002
|
+
}
|
|
22003
|
+
await submitFeedback(options.type, options.title, options.message);
|
|
22004
|
+
console.log();
|
|
22005
|
+
return;
|
|
22006
|
+
}
|
|
21967
22007
|
const response = await import_prompts2.default([
|
|
21968
22008
|
{
|
|
21969
22009
|
type: "select",
|
|
@@ -21975,7 +22015,7 @@ async function feedbackCommand(options = {}) {
|
|
|
21975
22015
|
{ title: "\uD83D\uDCA1 Improvement", value: "improvement" },
|
|
21976
22016
|
{ title: "\uD83D\uDCAC Other", value: "other" }
|
|
21977
22017
|
],
|
|
21978
|
-
initial: options.type === "bug" ? 0 : options.type === "feature" ? 1 : 0
|
|
22018
|
+
initial: options.type === "bug" ? 0 : options.type === "feature" ? 1 : options.type === "improvement" ? 2 : options.type === "other" ? 3 : 0
|
|
21979
22019
|
},
|
|
21980
22020
|
{
|
|
21981
22021
|
type: "text",
|
|
@@ -21997,31 +22037,7 @@ async function feedbackCommand(options = {}) {
|
|
|
21997
22037
|
Feedback cancelled.`));
|
|
21998
22038
|
return;
|
|
21999
22039
|
}
|
|
22000
|
-
|
|
22001
|
-
try {
|
|
22002
|
-
const res = await makeApiRequest("/feedback", {
|
|
22003
|
-
method: "POST",
|
|
22004
|
-
body: JSON.stringify({
|
|
22005
|
-
type: response.type,
|
|
22006
|
-
title: response.title,
|
|
22007
|
-
description: response.description,
|
|
22008
|
-
page: "cli"
|
|
22009
|
-
})
|
|
22010
|
-
});
|
|
22011
|
-
if (!res.ok) {
|
|
22012
|
-
const data = await res.json();
|
|
22013
|
-
spinner.fail("Failed to submit feedback");
|
|
22014
|
-
console.log(source_default.red(" " + (data.error || "Unknown error")));
|
|
22015
|
-
return;
|
|
22016
|
-
}
|
|
22017
|
-
spinner.succeed("Feedback submitted!");
|
|
22018
|
-
console.log();
|
|
22019
|
-
console.log(indigo2(" Thank you for your feedback! \uD83D\uDE4F"));
|
|
22020
|
-
console.log(source_default.dim(" We'll review it and get back to you if needed."));
|
|
22021
|
-
} catch (error) {
|
|
22022
|
-
spinner.fail("Failed to submit feedback");
|
|
22023
|
-
console.log(source_default.red(" " + (error instanceof Error ? error.message : "Network error")));
|
|
22024
|
-
}
|
|
22040
|
+
await submitFeedback(response.type, response.title, response.description);
|
|
22025
22041
|
console.log();
|
|
22026
22042
|
}
|
|
22027
22043
|
|
|
@@ -22101,9 +22117,11 @@ program2.command("logs <skill>").description("View execution logs for a skill").
|
|
|
22101
22117
|
tail: parseInt(options.tail, 10)
|
|
22102
22118
|
});
|
|
22103
22119
|
});
|
|
22104
|
-
program2.command("feedback").description("Submit feedback, bug reports, or feature requests").option("-t, --type <type>", "Feedback type (bug, feature, improvement, other)").action((options) => {
|
|
22120
|
+
program2.command("feedback").description("Submit feedback, bug reports, or feature requests").option("-t, --type <type>", "Feedback type (bug, feature, improvement, other)").option("--title <title>", "Feedback title (required for non-interactive mode)").option("-m, --message <message>", "Feedback description (required for non-interactive mode)").action((options) => {
|
|
22105
22121
|
feedbackCommand({
|
|
22106
|
-
type: options.type
|
|
22122
|
+
type: options.type,
|
|
22123
|
+
title: options.title,
|
|
22124
|
+
message: options.message
|
|
22107
22125
|
});
|
|
22108
22126
|
});
|
|
22109
22127
|
program2.addHelpText("after", `
|