spets 0.1.74 → 0.1.76
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 -50
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -945,37 +945,36 @@ 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 to Review");
|
|
949
949
|
parts.push("");
|
|
950
|
-
parts.push("The user has
|
|
950
|
+
parts.push("The user has responded to previous decisions. Review each one:");
|
|
951
951
|
parts.push("");
|
|
952
952
|
for (const entry of params.previousDecisions) {
|
|
953
953
|
const selectedOption = entry.decision.options.find((o) => o.id === entry.answer.selectedOptionId);
|
|
954
954
|
let label;
|
|
955
955
|
if (entry.answer.selectedOptionId === "ai") {
|
|
956
|
-
label = `AI recommendation
|
|
956
|
+
label = `Selected: AI recommendation`;
|
|
957
957
|
} else if (selectedOption) {
|
|
958
|
-
label = selectedOption.label
|
|
958
|
+
label = `Selected: ${selectedOption.label}`;
|
|
959
959
|
} else {
|
|
960
|
-
label = `
|
|
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}`);
|
|
960
|
+
label = `User's response: "${entry.answer.selectedOptionId}"`;
|
|
965
961
|
}
|
|
962
|
+
parts.push(`**Q: ${entry.decision.decision}**`);
|
|
963
|
+
parts.push(`\u2192 ${label}`);
|
|
966
964
|
parts.push("");
|
|
967
965
|
}
|
|
968
|
-
parts.push("
|
|
966
|
+
parts.push("## Your Task");
|
|
969
967
|
parts.push("");
|
|
970
|
-
parts.push(
|
|
971
|
-
parts.push("2. If user selected an option or gave custom input \u2192 that decision is DONE");
|
|
972
|
-
parts.push('3. NEVER ask the same question with different wording (e.g., "option IDs" vs "ID display" = SAME topic)');
|
|
973
|
-
parts.push("4. If user asked for clarification \u2192 explain better and re-ask THAT SPECIFIC decision only");
|
|
968
|
+
parts.push("Review each response above and determine:");
|
|
974
969
|
parts.push("");
|
|
975
|
-
parts.push(
|
|
976
|
-
parts.push("
|
|
977
|
-
parts.push(
|
|
978
|
-
parts.push("
|
|
970
|
+
parts.push('1. **RESOLVED**: User gave a clear preference (selected option, said "good/great/fine/ok", or gave specific direction)');
|
|
971
|
+
parts.push(`2. **NEEDS CLARIFICATION**: User asked a question ("what does X mean?", "can you explain?", "I don't understand")`);
|
|
972
|
+
parts.push("");
|
|
973
|
+
parts.push("Then output:");
|
|
974
|
+
parts.push('- If ALL resolved \u2192 `{"ready": true, "decisions": [], "summary": "..."}`');
|
|
975
|
+
parts.push("- If ANY needs clarification \u2192 Re-ask ONLY those specific questions with better explanations");
|
|
976
|
+
parts.push("");
|
|
977
|
+
parts.push("**IMPORTANT**: Do NOT ask new questions about the same topics. Only re-ask if user explicitly asked for clarification.");
|
|
979
978
|
parts.push("");
|
|
980
979
|
} else {
|
|
981
980
|
parts.push("## Your Task");
|
|
@@ -985,39 +984,36 @@ function buildClarifyPrompt(params) {
|
|
|
985
984
|
parts.push("2. User preference matters");
|
|
986
985
|
parts.push("3. Tradeoffs need to be considered");
|
|
987
986
|
parts.push("");
|
|
987
|
+
parts.push("## Output Format");
|
|
988
|
+
parts.push("");
|
|
989
|
+
parts.push("```json");
|
|
990
|
+
parts.push("{");
|
|
991
|
+
parts.push(' "ready": false,');
|
|
992
|
+
parts.push(' "decisions": [');
|
|
993
|
+
parts.push(" {");
|
|
994
|
+
parts.push(' "id": "d1",');
|
|
995
|
+
parts.push(' "decision": "What needs to be decided",');
|
|
996
|
+
parts.push(' "why": "Why this decision matters",');
|
|
997
|
+
parts.push(' "options": [');
|
|
998
|
+
parts.push(' { "id": "opt1", "label": "Option A", "description": "...", "tradeoffs": "..." },');
|
|
999
|
+
parts.push(' { "id": "opt2", "label": "Option B", "description": "...", "tradeoffs": "..." },');
|
|
1000
|
+
parts.push(' { "id": "ai", "label": "Recommended", "description": "AI recommendation", "recommendation": "opt1", "reason": "..." }');
|
|
1001
|
+
parts.push(" ]");
|
|
1002
|
+
parts.push(" }");
|
|
1003
|
+
parts.push(" ]");
|
|
1004
|
+
parts.push("}");
|
|
1005
|
+
parts.push("```");
|
|
1006
|
+
parts.push("");
|
|
1007
|
+
parts.push("If all clear to proceed:");
|
|
1008
|
+
parts.push("```json");
|
|
1009
|
+
parts.push('{ "ready": true, "decisions": [], "summary": "How we will proceed" }');
|
|
1010
|
+
parts.push("```");
|
|
1011
|
+
parts.push("");
|
|
1012
|
+
parts.push("**Important:**");
|
|
1013
|
+
parts.push("- Output ONLY the JSON, no other text.");
|
|
1014
|
+
parts.push("- Every decision MUST have at least 2 concrete options.");
|
|
1015
|
+
parts.push('- Every decision MUST include "ai" option (labeled "Recommended") as the last choice.');
|
|
988
1016
|
}
|
|
989
|
-
parts.push("## Output Format");
|
|
990
|
-
parts.push("");
|
|
991
|
-
parts.push("For each decision, provide options with descriptions and tradeoffs.");
|
|
992
|
-
parts.push('Always include "ai" as the last option with your recommendation.');
|
|
993
|
-
parts.push("");
|
|
994
|
-
parts.push("```json");
|
|
995
|
-
parts.push("{");
|
|
996
|
-
parts.push(' "ready": false,');
|
|
997
|
-
parts.push(' "decisions": [');
|
|
998
|
-
parts.push(" {");
|
|
999
|
-
parts.push(' "id": "d1",');
|
|
1000
|
-
parts.push(' "decision": "What needs to be decided",');
|
|
1001
|
-
parts.push(' "why": "Why this decision matters",');
|
|
1002
|
-
parts.push(' "options": [');
|
|
1003
|
-
parts.push(' { "id": "opt1", "label": "Option A", "description": "...", "tradeoffs": "..." },');
|
|
1004
|
-
parts.push(' { "id": "opt2", "label": "Option B", "description": "...", "tradeoffs": "..." },');
|
|
1005
|
-
parts.push(' { "id": "ai", "label": "Let AI decide", "description": "AI chooses based on context", "recommendation": "opt1", "reason": "..." }');
|
|
1006
|
-
parts.push(" ]");
|
|
1007
|
-
parts.push(" }");
|
|
1008
|
-
parts.push(" ]");
|
|
1009
|
-
parts.push("}");
|
|
1010
|
-
parts.push("```");
|
|
1011
|
-
parts.push("");
|
|
1012
|
-
parts.push("If all clear to proceed:");
|
|
1013
|
-
parts.push("```json");
|
|
1014
|
-
parts.push('{ "ready": true, "decisions": [], "summary": "How we will proceed" }');
|
|
1015
|
-
parts.push("```");
|
|
1016
|
-
parts.push("");
|
|
1017
|
-
parts.push("**Important:**");
|
|
1018
|
-
parts.push("- Output ONLY the JSON, no other text.");
|
|
1019
|
-
parts.push("- Every decision MUST have at least 2 concrete options with descriptions and tradeoffs.");
|
|
1020
|
-
parts.push('- Every decision MUST include "ai" option as the last choice.');
|
|
1021
1017
|
parts.push("");
|
|
1022
1018
|
return parts.join("\n");
|
|
1023
1019
|
}
|