spets 0.1.70 → 0.1.72
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 +19 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -945,19 +945,31 @@ function buildClarifyPrompt(params) {
|
|
|
945
945
|
parts.push("");
|
|
946
946
|
const hasPreviousDecisions = params.previousDecisions && params.previousDecisions.length > 0;
|
|
947
947
|
if (hasPreviousDecisions) {
|
|
948
|
-
parts.push("## Previous Decisions");
|
|
948
|
+
parts.push("## Previous Decisions (ALREADY RESOLVED)");
|
|
949
|
+
parts.push("");
|
|
950
|
+
parts.push("The user has already made the following decisions. These are FINAL - do NOT ask about them again:");
|
|
949
951
|
parts.push("");
|
|
950
952
|
for (const entry of params.previousDecisions) {
|
|
951
953
|
const selectedOption = entry.decision.options.find((o) => o.id === entry.answer.selectedOptionId);
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
954
|
+
let label;
|
|
955
|
+
if (entry.answer.selectedOptionId === "ai") {
|
|
956
|
+
label = `AI recommendation (${entry.decision.aiRecommendation?.optionId})`;
|
|
957
|
+
} else if (selectedOption) {
|
|
958
|
+
label = selectedOption.label;
|
|
959
|
+
} else {
|
|
960
|
+
label = `Custom decision: "${entry.answer.selectedOptionId}"`;
|
|
961
|
+
}
|
|
962
|
+
parts.push(`\u2705 **${entry.decision.decision}**: ${label}`);
|
|
963
|
+
if (entry.answer.customInput && entry.answer.customInput !== entry.answer.selectedOptionId) {
|
|
964
|
+
parts.push(` User's note: ${entry.answer.customInput}`);
|
|
956
965
|
}
|
|
957
966
|
parts.push("");
|
|
958
967
|
}
|
|
959
|
-
parts.push("
|
|
960
|
-
parts.push("
|
|
968
|
+
parts.push("Review each previous decision:");
|
|
969
|
+
parts.push("- If the user made a clear choice (even with custom text) \u2192 decision is RESOLVED");
|
|
970
|
+
parts.push('- If the user asked a question or requested clarification (e.g., "what does this mean?", "explain more") \u2192 re-ask with better explanation');
|
|
971
|
+
parts.push("");
|
|
972
|
+
parts.push('If all decisions are truly resolved and no new decisions needed, output `"ready": true`.');
|
|
961
973
|
parts.push("");
|
|
962
974
|
} else {
|
|
963
975
|
parts.push("## Your Task");
|