@launch11/srgical 0.0.6 → 0.0.7
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.
|
@@ -93,6 +93,9 @@ function buildReadiness(messages, nextStepSummary) {
|
|
|
93
93
|
const userMessages = meaningfulMessages.filter((message) => message.role === "user");
|
|
94
94
|
const assistantMessages = meaningfulMessages.filter((message) => message.role === "assistant" &&
|
|
95
95
|
!studio_session_1.DEFAULT_STUDIO_MESSAGES.some((defaultMessage) => defaultMessage.content === message.content));
|
|
96
|
+
const substantiveUserMessages = userMessages.filter((message) => message.content.trim().length >= 48);
|
|
97
|
+
const substantiveAssistantMessages = assistantMessages.filter((message) => message.content.trim().length >= 80);
|
|
98
|
+
const userTranscript = userMessages.map((message) => message.content.toLowerCase()).join("\n");
|
|
96
99
|
const transcript = meaningfulMessages.map((message) => message.content.toLowerCase()).join("\n");
|
|
97
100
|
const checks = [
|
|
98
101
|
{
|
|
@@ -117,13 +120,21 @@ function buildReadiness(messages, nextStepSummary) {
|
|
|
117
120
|
}
|
|
118
121
|
];
|
|
119
122
|
const score = checks.filter((check) => check.passed).length;
|
|
120
|
-
const
|
|
123
|
+
const commitmentCaptured = /(^|\b)(yes|agreed|approved|go with that|use that|let'?s do that|write (it|that|the pack)|capture that|lock it in|sounds right|that seam works)\b/.test(userTranscript);
|
|
124
|
+
const readyToWrite = score === checks.length &&
|
|
125
|
+
substantiveUserMessages.length >= 2 &&
|
|
126
|
+
substantiveAssistantMessages.length >= 2 &&
|
|
127
|
+
commitmentCaptured;
|
|
128
|
+
const missingLabels = checks.filter((check) => !check.passed).map((check) => check.label);
|
|
129
|
+
if (!commitmentCaptured) {
|
|
130
|
+
missingLabels.push("Explicit go-ahead captured");
|
|
131
|
+
}
|
|
121
132
|
return {
|
|
122
133
|
checks,
|
|
123
134
|
score,
|
|
124
135
|
total: checks.length,
|
|
125
136
|
readyToWrite,
|
|
126
|
-
missingLabels
|
|
137
|
+
missingLabels
|
|
127
138
|
};
|
|
128
139
|
}
|
|
129
140
|
async function countPresentDocs(paths) {
|