spets 0.1.76 → 0.1.78
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 +42 -23
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -272,9 +272,9 @@ type="checkpoint", checkpoint="clarify":
|
|
|
272
272
|
- GOTO step 2
|
|
273
273
|
|
|
274
274
|
type="checkpoint", checkpoint="approve":
|
|
275
|
-
- READ \`specPath\`, summarize to user
|
|
276
|
-
- ASK user:
|
|
277
|
-
- RUN matching \`onComplete\`
|
|
275
|
+
- READ \`specPath\`, summarize key points to user
|
|
276
|
+
- ASK user using AskUserQuestion with options: Approve / Revise / Reject / Stop
|
|
277
|
+
- RUN matching \`onComplete\` based on user's choice
|
|
278
278
|
- GOTO step 2
|
|
279
279
|
|
|
280
280
|
type="complete" or "error":
|
|
@@ -320,9 +320,9 @@ type="checkpoint", checkpoint="clarify":
|
|
|
320
320
|
- GOTO step 2
|
|
321
321
|
|
|
322
322
|
type="checkpoint", checkpoint="approve":
|
|
323
|
-
- READ \`specPath\`, summarize to user
|
|
324
|
-
- ASK user:
|
|
325
|
-
- RUN matching \`onComplete\`
|
|
323
|
+
- READ \`specPath\`, summarize key points to user
|
|
324
|
+
- ASK user using AskUserQuestion with options: Approve / Revise / Reject / Stop
|
|
325
|
+
- RUN matching \`onComplete\` based on user's choice
|
|
326
326
|
- GOTO step 2
|
|
327
327
|
|
|
328
328
|
type="complete" or "error":
|
|
@@ -363,9 +363,9 @@ type="checkpoint", checkpoint="clarify":
|
|
|
363
363
|
- GOTO step 2
|
|
364
364
|
|
|
365
365
|
type="checkpoint", checkpoint="approve":
|
|
366
|
-
- READ \`specPath\`, summarize to user
|
|
367
|
-
- ASK user:
|
|
368
|
-
- RUN matching \`onComplete\`
|
|
366
|
+
- READ \`specPath\`, summarize key points to user
|
|
367
|
+
- ASK user using AskUserQuestion with options: Approve / Revise / Reject / Stop
|
|
368
|
+
- RUN matching \`onComplete\` based on user's choice
|
|
369
369
|
- GOTO step 2
|
|
370
370
|
|
|
371
371
|
type="complete" or "error":
|
|
@@ -945,36 +945,55 @@ 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 (All Resolved)");
|
|
949
949
|
parts.push("");
|
|
950
|
-
parts.push("The user has responded to previous decisions.
|
|
950
|
+
parts.push("The user has responded to all previous decisions. Each response below is **already resolved** unless the user explicitly asked for clarification.");
|
|
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
|
+
let description = "";
|
|
955
956
|
if (entry.answer.selectedOptionId === "ai") {
|
|
956
|
-
|
|
957
|
+
const aiOption = entry.decision.options.find((o) => o.id === "ai");
|
|
958
|
+
label = "AI recommendation";
|
|
959
|
+
if (aiOption?.recommendation) {
|
|
960
|
+
const recommended = entry.decision.options.find((o) => o.id === aiOption.recommendation);
|
|
961
|
+
description = recommended ? ` (${recommended.label})` : "";
|
|
962
|
+
}
|
|
957
963
|
} else if (selectedOption) {
|
|
958
|
-
label =
|
|
964
|
+
label = selectedOption.label;
|
|
965
|
+
description = selectedOption.description ? ` - ${selectedOption.description}` : "";
|
|
959
966
|
} else {
|
|
960
|
-
label =
|
|
967
|
+
label = entry.answer.selectedOptionId;
|
|
968
|
+
}
|
|
969
|
+
const hasCustomInput = entry.answer.customInput && entry.answer.customInput.trim().length > 0;
|
|
970
|
+
parts.push(`### ${entry.decision.decision} [RESOLVED]`);
|
|
971
|
+
parts.push(`**Selected:** ${label}${description}`);
|
|
972
|
+
if (hasCustomInput) {
|
|
973
|
+
parts.push(`**User comment:** "${entry.answer.customInput}"`);
|
|
961
974
|
}
|
|
962
|
-
parts.push(`**Q: ${entry.decision.decision}**`);
|
|
963
|
-
parts.push(`\u2192 ${label}`);
|
|
964
975
|
parts.push("");
|
|
965
976
|
}
|
|
966
977
|
parts.push("## Your Task");
|
|
967
978
|
parts.push("");
|
|
968
|
-
parts.push("
|
|
979
|
+
parts.push("All decisions above are marked [RESOLVED] by default. Analyze each user response semantically:");
|
|
969
980
|
parts.push("");
|
|
970
|
-
parts.push(
|
|
971
|
-
parts.push(
|
|
981
|
+
parts.push("**RESOLVED (proceed with this choice):**");
|
|
982
|
+
parts.push("- User selected an option (any option selection = resolved)");
|
|
983
|
+
parts.push('- Approval expressions: "ok", "okay", "good", "great", "fine", "sure", "yes", "\uB3D9\uC758", "\uC88B\uC544", "\uADF8\uB807\uAC8C \uD574", "\u3147\u3147"');
|
|
984
|
+
parts.push("- Short affirmations or no comment at all");
|
|
972
985
|
parts.push("");
|
|
973
|
-
parts.push("
|
|
974
|
-
parts.push('-
|
|
975
|
-
parts.push(
|
|
986
|
+
parts.push("**NEEDS CLARIFICATION (re-ask with better explanation):**");
|
|
987
|
+
parts.push('- Explicit questions: "\uBB50\uC57C?", "what does X mean?", "\uBB34\uC2A8 \uB73B\uC774\uC57C?", "can you explain?"');
|
|
988
|
+
parts.push(`- Confusion expressions: "\uC774\uD574 \uC548 \uB428", "I don't understand", "\uC124\uBA85\uD574\uC918", "\uC798 \uBAA8\uB974\uACA0\uC5B4"`);
|
|
989
|
+
parts.push('- Requests for more info: "\uB354 \uC54C\uB824\uC918", "tell me more", "\uC608\uC2DC \uC788\uC5B4?"');
|
|
976
990
|
parts.push("");
|
|
977
|
-
parts.push("**
|
|
991
|
+
parts.push("**CRITICAL RULE: When in doubt, treat as RESOLVED.**");
|
|
992
|
+
parts.push("Do NOT re-ask unless user EXPLICITLY expressed confusion or asked a question.");
|
|
993
|
+
parts.push("");
|
|
994
|
+
parts.push("Then output:");
|
|
995
|
+
parts.push('- If ALL resolved \u2192 `{"ready": true, "decisions": [], "summary": "Proceeding with: [list chosen options]"}`');
|
|
996
|
+
parts.push("- If ANY needs clarification \u2192 Re-ask ONLY those with clearer explanations and examples");
|
|
978
997
|
parts.push("");
|
|
979
998
|
} else {
|
|
980
999
|
parts.push("## Your Task");
|