@vfarcic/dot-ai 0.15.0 → 0.17.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"answer-question.d.ts","sourceRoot":"","sources":["../../src/tools/answer-question.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAMhD,eAAO,MAAM,wBAAwB,mBAAmB,CAAC;AACzD,eAAO,MAAM,+BAA+B,8HAA4H,CAAC;AAGzK,eAAO,MAAM,gCAAgC;;;;CAI5C,CAAC;
|
|
1
|
+
{"version":3,"file":"answer-question.d.ts","sourceRoot":"","sources":["../../src/tools/answer-question.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAMhD,eAAO,MAAM,wBAAwB,mBAAmB,CAAC;AACzD,eAAO,MAAM,+BAA+B,8HAA4H,CAAC;AAGzK,eAAO,MAAM,gCAAgC;;;;CAI5C,CAAC;AAygBF;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAAE,EAC7G,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CAAC,CAmTxD"}
|
|
@@ -154,22 +154,45 @@ function validateAnswer(answer, question) {
|
|
|
154
154
|
return null;
|
|
155
155
|
}
|
|
156
156
|
/**
|
|
157
|
-
* Get
|
|
157
|
+
* Get stage-specific instructions for different stages
|
|
158
158
|
*/
|
|
159
|
-
function
|
|
159
|
+
function getStageSpecificInstructions(stage) {
|
|
160
160
|
switch (stage) {
|
|
161
161
|
case 'required':
|
|
162
|
-
return '
|
|
162
|
+
return 'STAGE: REQUIRED - All questions must be answered before proceeding. No skipping allowed.';
|
|
163
163
|
case 'basic':
|
|
164
|
-
return '
|
|
164
|
+
return 'STAGE: BASIC - These questions can be skipped. User can provide answers or say "skip" to proceed to advanced stage.';
|
|
165
165
|
case 'advanced':
|
|
166
|
-
return '
|
|
166
|
+
return 'STAGE: ADVANCED - These questions can be skipped. User can provide answers or say "skip" to proceed to open stage.';
|
|
167
167
|
case 'open':
|
|
168
|
-
return '
|
|
168
|
+
return 'STAGE: OPEN - Final configuration stage. User can provide additional requirements or say "N/A" to proceed to manifest generation.';
|
|
169
169
|
default:
|
|
170
|
-
return 'Present questions to the user and wait for their response.';
|
|
170
|
+
return 'STAGE: UNKNOWN - Present questions to the user and wait for their response.';
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
+
/**
|
|
174
|
+
* Get enhanced anti-cascade agent instructions for stage responses
|
|
175
|
+
*/
|
|
176
|
+
function getAgentInstructions(stage) {
|
|
177
|
+
const antiCascadeRule = 'CRITICAL ANTI-CASCADE RULE: When user says "skip" for ANY stage, only skip THAT specific stage and present the NEXT stage questions to the user. NEVER automatically skip multiple stages in sequence.';
|
|
178
|
+
const mandatoryWorkflow = `
|
|
179
|
+
MANDATORY CLIENT AGENT WORKFLOW:
|
|
180
|
+
1. Present these questions to the user in natural language
|
|
181
|
+
2. Wait for explicit user response
|
|
182
|
+
3. If user provides answers: call answerQuestion with their specific answers
|
|
183
|
+
4. If user says "skip": call answerQuestion with empty answers object ({})
|
|
184
|
+
5. NEVER call answerQuestion without receiving user input first
|
|
185
|
+
6. NEVER assume what the user wants for subsequent stages`;
|
|
186
|
+
const strictConstraints = `
|
|
187
|
+
STRICT BEHAVIORAL CONSTRAINTS:
|
|
188
|
+
- DO NOT call answerQuestion automatically
|
|
189
|
+
- DO NOT assume user wants to proceed to manifest generation
|
|
190
|
+
- DO NOT call answerQuestion with empty open stage answers unless user explicitly provides them
|
|
191
|
+
- DO NOT interpret "skip" as "automatically proceed to next stage"
|
|
192
|
+
- MUST present each stage's questions individually and wait for user response`;
|
|
193
|
+
const stageSpecific = getStageSpecificInstructions(stage);
|
|
194
|
+
return `${antiCascadeRule}\n${mandatoryWorkflow}\n${strictConstraints}\n\n${stageSpecific}`;
|
|
195
|
+
}
|
|
173
196
|
/**
|
|
174
197
|
* Determine current stage based on solution state
|
|
175
198
|
*/
|
|
@@ -321,7 +344,7 @@ function getStageGuidance(stage) {
|
|
|
321
344
|
case 'advanced':
|
|
322
345
|
return 'Answer questions in this stage or skip to proceed to the open stage. Do NOT try to generate manifests yet.';
|
|
323
346
|
case 'open':
|
|
324
|
-
return 'Use "N/A" if you have no additional requirements. Complete this stage before generating manifests.
|
|
347
|
+
return 'Use "N/A" if you have no additional requirements. Complete this stage before generating manifests.';
|
|
325
348
|
default:
|
|
326
349
|
return 'Please provide answers for this stage.';
|
|
327
350
|
}
|