genaicode 0.9.3 → 0.9.5
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/ai-service/anthropic.js +4 -1
- package/dist/ai-service/anthropic.js.map +1 -1
- package/dist/ai-service/common.js +1 -1
- package/dist/ai-service/common.js.map +1 -1
- package/dist/ai-service/openai.js +1 -1
- package/dist/ai-service/openai.js.map +1 -1
- package/dist/ai-service/service-configurations.js +1 -1
- package/dist/ai-service/service-configurations.js.map +1 -1
- package/dist/files/cache-file.d.ts +4 -1
- package/dist/files/cache-file.js.map +1 -1
- package/dist/files/file-id-utils.d.ts +7 -0
- package/dist/files/file-id-utils.js +25 -0
- package/dist/files/file-id-utils.js.map +1 -0
- package/dist/files/read-files.js +8 -8
- package/dist/files/read-files.js.map +1 -1
- package/dist/files/source-code-tree.js +3 -3
- package/dist/files/source-code-tree.js.map +1 -1
- package/dist/files/source-code-types.d.ts +21 -3
- package/dist/files/summary-cache.d.ts +3 -2
- package/dist/files/summary-cache.js +1 -1
- package/dist/files/summary-cache.js.map +1 -1
- package/dist/main/common/content-bus-types.d.ts +1 -1
- package/dist/main/common/content-bus.js +1 -1
- package/dist/main/common/content-bus.js.map +1 -1
- package/dist/main/config-schema.js +1 -1
- package/dist/main/config-schema.js.map +1 -1
- package/dist/main/ui/frontend/assets/{index-CSR1NiB_.js → index-Dizqxzws.js} +226 -187
- package/dist/main/ui/frontend/index.html +1 -1
- package/dist/prompt/ai-service-fallback.js +5 -1
- package/dist/prompt/ai-service-fallback.js.map +1 -1
- package/dist/prompt/function-calling.js +8 -1
- package/dist/prompt/function-calling.js.map +1 -1
- package/dist/prompt/function-defs/ask-question.d.ts +3 -0
- package/dist/prompt/function-defs/ask-question.js +43 -1
- package/dist/prompt/function-defs/ask-question.js.map +1 -1
- package/dist/prompt/function-defs/context-compression.d.ts +25 -5
- package/dist/prompt/function-defs/context-compression.js +23 -8
- package/dist/prompt/function-defs/context-compression.js.map +1 -1
- package/dist/prompt/function-defs/conversation-graph.d.ts +33 -0
- package/dist/prompt/function-defs/conversation-graph.js +110 -0
- package/dist/prompt/function-defs/conversation-graph.js.map +1 -0
- package/dist/prompt/function-defs/extract-file-fragments.d.ts +27 -0
- package/dist/prompt/function-defs/extract-file-fragments.js +36 -0
- package/dist/prompt/function-defs/extract-file-fragments.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/ask-question-handler.d.ts +2 -0
- package/dist/prompt/steps/step-ask-question/ask-question-handler.js +12 -0
- package/dist/prompt/steps/step-ask-question/ask-question-handler.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/code-generation.js +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/code-generation.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/file-request-utils.d.ts +47 -0
- package/dist/prompt/steps/step-ask-question/handlers/file-request-utils.js +114 -0
- package/dist/prompt/steps/step-ask-question/handlers/file-request-utils.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-code-generation.d.ts +4 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-code-generation.js +169 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-code-generation.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-confirm-code-generation.d.ts +2 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-confirm-code-generation.js +40 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-confirm-code-generation.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-context-compression.js +2 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-context-compression.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-context-optimization.d.ts +2 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-context-optimization.js +34 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-context-optimization.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-conversation-graph.d.ts +12 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-conversation-graph.js +243 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-conversation-graph.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-create-file.d.ts +2 -2
- package/dist/prompt/steps/step-ask-question/handlers/handle-create-file.js +5 -3
- package/dist/prompt/steps/step-ask-question/handlers/handle-create-file.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-end-conversation.js +2 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-end-conversation.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-genaicode-help.js +2 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-genaicode-help.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-generate-image.js +2 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-generate-image.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-lint.d.ts +6 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-lint.js +105 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-lint.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-perform-analysis.js +4 -5
- package/dist/prompt/steps/step-ask-question/handlers/handle-perform-analysis.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-pull-app-context.js +2 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-pull-app-context.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-push-app-context.js +2 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-push-app-context.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-reasoning-inference.js +3 -3
- package/dist/prompt/steps/step-ask-question/handlers/handle-reasoning-inference.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-remove-files-from-context.d.ts +2 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-remove-files-from-context.js +88 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-remove-files-from-context.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-files-content.d.ts +8 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-files-content.js +136 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-files-content.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-files-fragments.d.ts +8 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-files-fragments.js +173 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-files-fragments.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-permissions.d.ts +2 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-permissions.js +71 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-permissions.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-search-code.d.ts +0 -3
- package/dist/prompt/steps/step-ask-question/handlers/handle-search-code.js +2 -3
- package/dist/prompt/steps/step-ask-question/handlers/handle-search-code.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-send-message.js +2 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-send-message.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-update-file.d.ts +2 -2
- package/dist/prompt/steps/step-ask-question/handlers/handle-update-file.js +6 -4
- package/dist/prompt/steps/step-ask-question/handlers/handle-update-file.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/request-files-content.js +7 -3
- package/dist/prompt/steps/step-ask-question/handlers/request-files-content.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/step-ask-question-handlers.d.ts +3 -0
- package/dist/prompt/steps/step-ask-question/step-ask-question-handlers.js +5 -0
- package/dist/prompt/steps/step-ask-question/step-ask-question-handlers.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/step-ask-question-types.d.ts +13 -2
- package/dist/prompt/steps/step-ask-question/step-ask-question.d.ts +21 -0
- package/dist/prompt/steps/step-ask-question/step-ask-question.js +30 -71
- package/dist/prompt/steps/step-ask-question/step-ask-question.js.map +1 -1
- package/dist/prompt/steps/step-codegen-planning.js +1 -3
- package/dist/prompt/steps/step-codegen-planning.js.map +1 -1
- package/dist/prompt/steps/step-context-compression.d.ts +1 -1
- package/dist/prompt/steps/step-context-compression.js +130 -34
- package/dist/prompt/steps/step-context-compression.js.map +1 -1
- package/dist/prompt/steps/step-context-optimization.js +7 -68
- package/dist/prompt/steps/step-context-optimization.js.map +1 -1
- package/dist/prompt/steps/step-generate-codegen-summary.js +1 -3
- package/dist/prompt/steps/step-generate-codegen-summary.js.map +1 -1
- package/dist/prompt/steps/step-history-update.js +1 -3
- package/dist/prompt/steps/step-history-update.js.map +1 -1
- package/dist/prompt/steps/step-process-file-updates.js +0 -3
- package/dist/prompt/steps/step-process-file-updates.js.map +1 -1
- package/dist/prompt/steps/step-summarization.d.ts +2 -1
- package/dist/prompt/steps/step-summarization.js +6 -5
- package/dist/prompt/steps/step-summarization.js.map +1 -1
- package/dist/prompt/steps/step-verify-patch.js +1 -3
- package/dist/prompt/steps/step-verify-patch.js.map +1 -1
- package/dist/prompt/systemprompt.js +5 -3
- package/dist/prompt/systemprompt.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { putAssistantMessage, putSystemMessage, putUserMessage } from '../../../../main/common/content-bus.js';
|
|
2
|
+
import { ModelType } from '../../../../ai-service/common-types.js';
|
|
3
|
+
import { getFunctionDefs } from '../../../function-calling.js';
|
|
4
|
+
import { registerActionHandler } from '../step-ask-question-handlers.js';
|
|
5
|
+
import { getActionHandler } from '../ask-question-handler.js';
|
|
6
|
+
import { askUserForConfirmationWithAnswer } from '../../../../main/common/user-actions.js';
|
|
7
|
+
export const CONVERSATION_GRAPH_PROMPT = `# Conversation Graph Guide
|
|
8
|
+
|
|
9
|
+
A conversation graph is a flexible structure for managing complex interactions. It consists of nodes (conversation states) connected by edges (transitions).
|
|
10
|
+
|
|
11
|
+
## Core Components
|
|
12
|
+
|
|
13
|
+
1. **Nodes (States)**
|
|
14
|
+
- Each node represents a distinct state in the conversation
|
|
15
|
+
- Contains:
|
|
16
|
+
- id: Unique identifier
|
|
17
|
+
- actionType: The action to perform
|
|
18
|
+
- instruction: Internal guidance for execution
|
|
19
|
+
|
|
20
|
+
2. **Edges (Transitions)**
|
|
21
|
+
- Connect nodes to define possible conversation flows
|
|
22
|
+
- Contains:
|
|
23
|
+
- sourceNode: Starting point
|
|
24
|
+
- targetNode: Destination
|
|
25
|
+
- instruction: Condition for transition
|
|
26
|
+
|
|
27
|
+
## Key Concepts
|
|
28
|
+
|
|
29
|
+
- **State Management**: Nodes capture the current state and required action
|
|
30
|
+
- **Flow Control**: Edges determine how the conversation can progress
|
|
31
|
+
- **Flexibility**: Support for various conversation patterns and flows
|
|
32
|
+
- **Context Awareness**: Each node operates with awareness of the conversation state
|
|
33
|
+
|
|
34
|
+
## Implementation Notes
|
|
35
|
+
|
|
36
|
+
- Nodes should be self-contained and focused
|
|
37
|
+
- Edges should have clear, evaluatable conditions
|
|
38
|
+
- Any node can connect to any other node if logically appropriate
|
|
39
|
+
- Nodes and edges must formulate a direct acyclic graph (DAG)
|
|
40
|
+
|
|
41
|
+
## Technical Details
|
|
42
|
+
|
|
43
|
+
Nodes require:
|
|
44
|
+
- Unique ID for reference
|
|
45
|
+
- Valid action type
|
|
46
|
+
- Clear execution instructions
|
|
47
|
+
|
|
48
|
+
Edges require:
|
|
49
|
+
- Valid source and target node IDs
|
|
50
|
+
- Clear transition conditions
|
|
51
|
+
|
|
52
|
+
# Let's get started!
|
|
53
|
+
|
|
54
|
+
0. Read and understand the conersation we had so far (context).
|
|
55
|
+
1. Think about the big picture of the upcoming conversation flow and the desired outcome.
|
|
56
|
+
2. Define the entry node to start the upcoming conversation.
|
|
57
|
+
3. Create nodes with reasoning, action type, and instructions.
|
|
58
|
+
4. Connect nodes with edges to define the conversation flow.
|
|
59
|
+
`;
|
|
60
|
+
export const getEdgeEvaluationPrompt = (currentNode, outgoingEdges) => {
|
|
61
|
+
return `We are evaluating the outgoing edges from the current node(${currentNode.id}):
|
|
62
|
+
|
|
63
|
+
${outgoingEdges.map((edge) => `- ${edge.targetNode}: ${edge.instruction}`).join('\n')}
|
|
64
|
+
|
|
65
|
+
Select the correct edge, or terminate if the conversation should stop.`;
|
|
66
|
+
};
|
|
67
|
+
registerActionHandler('conversationGraph', handleConversationGraph);
|
|
68
|
+
/**
|
|
69
|
+
* Handles the conversationGraph action by:
|
|
70
|
+
* 1. Generating a conversationGraph function call
|
|
71
|
+
* 2. Extracting nodes and edges from the response
|
|
72
|
+
* 3. Traversing the graph and executing actions
|
|
73
|
+
* 4. Returning appropriate ActionResult
|
|
74
|
+
*/
|
|
75
|
+
export async function handleConversationGraph({ askQuestionCall, prompt, options, generateContentFn, generateImageFn, waitIfPaused, }) {
|
|
76
|
+
try {
|
|
77
|
+
const userConfirmation = await askUserForConfirmationWithAnswer('The assistant wants to perform a conversation graph. Do you want to proceed?', 'Run conversation graph', 'Decline', true, options);
|
|
78
|
+
if (!userConfirmation.confirmed) {
|
|
79
|
+
putSystemMessage('Conversation graph declined.');
|
|
80
|
+
return {
|
|
81
|
+
breakLoop: false,
|
|
82
|
+
items: [
|
|
83
|
+
{
|
|
84
|
+
assistant: {
|
|
85
|
+
type: 'assistant',
|
|
86
|
+
text: askQuestionCall.args?.message ?? '',
|
|
87
|
+
},
|
|
88
|
+
user: {
|
|
89
|
+
type: 'user',
|
|
90
|
+
text: 'Declined conversation graph. ' + userConfirmation.answer,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
putSystemMessage('Generating conversation graph...');
|
|
97
|
+
// Generate the conversationGraph function call
|
|
98
|
+
const [conversationGraphCall] = (await generateContentFn([
|
|
99
|
+
...prompt,
|
|
100
|
+
{
|
|
101
|
+
type: 'assistant',
|
|
102
|
+
text: askQuestionCall.args?.message ?? '',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
type: 'user',
|
|
106
|
+
text: CONVERSATION_GRAPH_PROMPT,
|
|
107
|
+
},
|
|
108
|
+
], getFunctionDefs(), 'conversationGraph', 0.7, ModelType.DEFAULT, options));
|
|
109
|
+
prompt.push({
|
|
110
|
+
type: 'assistant',
|
|
111
|
+
text: askQuestionCall.args?.message ?? '',
|
|
112
|
+
functionCalls: [conversationGraphCall],
|
|
113
|
+
}, {
|
|
114
|
+
type: 'user',
|
|
115
|
+
functionResponses: [
|
|
116
|
+
{
|
|
117
|
+
name: 'conversationGraph',
|
|
118
|
+
call_id: conversationGraphCall.id,
|
|
119
|
+
content: '',
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
});
|
|
123
|
+
const { entryNode, nodes, edges } = conversationGraphCall.args;
|
|
124
|
+
putSystemMessage('Starting conversation graph traversal.', {
|
|
125
|
+
entryNode,
|
|
126
|
+
nodes,
|
|
127
|
+
edges,
|
|
128
|
+
});
|
|
129
|
+
// Start with the first node
|
|
130
|
+
let currentNode = nodes.find((node) => node.id === entryNode);
|
|
131
|
+
if (!currentNode) {
|
|
132
|
+
return {
|
|
133
|
+
breakLoop: false,
|
|
134
|
+
items: [
|
|
135
|
+
{
|
|
136
|
+
assistant: {
|
|
137
|
+
type: 'assistant',
|
|
138
|
+
text: askQuestionCall.args?.message ?? '',
|
|
139
|
+
},
|
|
140
|
+
user: {
|
|
141
|
+
type: 'user',
|
|
142
|
+
text: 'Error occurred during conversation graph execution.',
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
// Track visited nodes to prevent cycles
|
|
149
|
+
const visitedNodes = new Set();
|
|
150
|
+
let iteration = 0;
|
|
151
|
+
const MAX_ITERATIONS = 50; // Safeguard against infinite loops
|
|
152
|
+
while (currentNode && iteration < MAX_ITERATIONS) {
|
|
153
|
+
iteration++;
|
|
154
|
+
visitedNodes.add(currentNode.id);
|
|
155
|
+
// Execute the current node
|
|
156
|
+
putSystemMessage(`Executing node ${currentNode.id}`, currentNode);
|
|
157
|
+
const [sendMessage] = (await generateContentFn(prompt, getFunctionDefs(), 'sendMessage', 0.7, ModelType.CHEAP, options));
|
|
158
|
+
if (sendMessage.args?.message) {
|
|
159
|
+
putAssistantMessage(sendMessage.args.message, sendMessage.args);
|
|
160
|
+
}
|
|
161
|
+
const currentNodeHandler = getActionHandler(currentNode.actionType);
|
|
162
|
+
const nodeResult = await currentNodeHandler({
|
|
163
|
+
askQuestionCall: {
|
|
164
|
+
name: 'askQuestion',
|
|
165
|
+
args: {
|
|
166
|
+
message: sendMessage.args?.message ?? '',
|
|
167
|
+
actionType: currentNode.actionType,
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
prompt,
|
|
171
|
+
options,
|
|
172
|
+
generateContentFn,
|
|
173
|
+
generateImageFn,
|
|
174
|
+
waitIfPaused,
|
|
175
|
+
});
|
|
176
|
+
const lastItem = nodeResult.items.slice(-1)[0];
|
|
177
|
+
if (lastItem?.user?.text) {
|
|
178
|
+
putUserMessage(lastItem.user.text, undefined, undefined, undefined, lastItem.user);
|
|
179
|
+
}
|
|
180
|
+
prompt.push(...nodeResult.items.map(({ assistant, user }) => [assistant, user]).flat());
|
|
181
|
+
// Move to the next node
|
|
182
|
+
const outgoingEdges = edges.filter((edge) => edge.sourceNode === currentNode.id);
|
|
183
|
+
const [evaluateEdge] = (await generateContentFn([
|
|
184
|
+
...prompt,
|
|
185
|
+
{
|
|
186
|
+
type: 'user',
|
|
187
|
+
text: getEdgeEvaluationPrompt(currentNode, outgoingEdges),
|
|
188
|
+
},
|
|
189
|
+
], getFunctionDefs(), 'evaluateEdge', 0.7, ModelType.CHEAP, options));
|
|
190
|
+
if (!evaluateEdge.args?.shouldTerminate) {
|
|
191
|
+
putSystemMessage('Conversation graph traversal terminated.');
|
|
192
|
+
break;
|
|
193
|
+
}
|
|
194
|
+
const outgoingEdge = outgoingEdges.find((edge) => edge.targetNode === evaluateEdge.args?.selectedEdge?.targetNode);
|
|
195
|
+
if (!outgoingEdge) {
|
|
196
|
+
putSystemMessage(`No valid outgoing edge found from node ${currentNode.id}.`);
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
// Find next node
|
|
200
|
+
const nextNode = nodes.find((node) => node.id === outgoingEdge.targetNode);
|
|
201
|
+
if (!nextNode) {
|
|
202
|
+
putSystemMessage(`Target node ${outgoingEdge.targetNode} not found.`);
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
// Check for cycles
|
|
206
|
+
if (visitedNodes.has(nextNode.id)) {
|
|
207
|
+
putSystemMessage(`Cycle detected at node ${nextNode.id}. Stopping traversal.`);
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
currentNode = nextNode;
|
|
211
|
+
}
|
|
212
|
+
if (iteration >= MAX_ITERATIONS) {
|
|
213
|
+
putSystemMessage('Maximum iterations reached. Stopping traversal.');
|
|
214
|
+
}
|
|
215
|
+
putSystemMessage('Conversation graph traversal completed.');
|
|
216
|
+
prompt.push({
|
|
217
|
+
type: 'assistant',
|
|
218
|
+
text: 'Conversation graph traversal completed.',
|
|
219
|
+
}, {
|
|
220
|
+
type: 'user',
|
|
221
|
+
text: 'Lets continue the conversation.',
|
|
222
|
+
});
|
|
223
|
+
return {
|
|
224
|
+
breakLoop: false,
|
|
225
|
+
items: [],
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
catch (error) {
|
|
229
|
+
putSystemMessage('Error during conversation graph execution', { error });
|
|
230
|
+
prompt.push({
|
|
231
|
+
type: 'assistant',
|
|
232
|
+
text: 'An error occurred during conversation graph execution.', // TODO: Prompt user for message
|
|
233
|
+
}, {
|
|
234
|
+
type: 'user',
|
|
235
|
+
text: 'Lets continue the conversation.', // TODO: Prompt user for message
|
|
236
|
+
});
|
|
237
|
+
return {
|
|
238
|
+
breakLoop: false,
|
|
239
|
+
items: [],
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
//# sourceMappingURL=handle-conversation-graph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle-conversation-graph.js","sourceRoot":"","sources":["../../../../../src/prompt/steps/step-ask-question/handlers/handle-conversation-graph.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAC/G,OAAO,EAAgB,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAO/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,gCAAgC,EAAE,MAAM,yCAAyC,CAAC;AAE3F,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDxC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,WAA6B,EAAE,aAAiC,EAAE,EAAE;IAC1G,OAAO,8DAA8D,WAAW,CAAC,EAAE;;EAEnF,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;uEAEd,CAAC;AACxE,CAAC,CAAC;AAEF,qBAAqB,CAAC,mBAAmB,EAAE,uBAAuB,CAAC,CAAC;AAEpE;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,EAC5C,eAAe,EACf,MAAM,EACN,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,YAAY,GACO;IACnB,IAAI,CAAC;QACH,MAAM,gBAAgB,GAAG,MAAM,gCAAgC,CAC7D,8EAA8E,EAC9E,wBAAwB,EACxB,SAAS,EACT,IAAI,EACJ,OAAO,CACR,C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CAAiC;SACxC,CACF,CAAC;QAEF,OAAO;YACL,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,EAAE;SACV,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,gBAAgB,CAAC,2CAA2C,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAEzE,MAAM,CAAC,IAAI,CACT;YACE,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,wDAAwD,EAAE,gCAAgC;SACjG,EACD;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,iCAAiC,EAAE,gCAAgC;SAC1E,CACF,CAAC;QAEF,OAAO;YACL,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,EAAE;SACV,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
1
|
+
import { ActionHandlerProps, ActionResult } from '../step-ask-question-types.js';
|
|
2
|
+
export declare function handleCreateFile({ askQuestionCall, options, prompt, generateContentFn, }: ActionHandlerProps): Promise<ActionResult>;
|
|
@@ -5,7 +5,9 @@ import { ModelType } from '../../../../ai-service/common-types.js';
|
|
|
5
5
|
import { askUserForConfirmationWithAnswer } from '../../../../main/common/user-actions.js';
|
|
6
6
|
import { putSystemMessage, putUserMessage } from '../../../../main/common/content-bus.js';
|
|
7
7
|
import { refreshFiles } from '../../../../files/find-files.js';
|
|
8
|
-
|
|
8
|
+
import { registerActionHandler } from '../step-ask-question-handlers.js';
|
|
9
|
+
registerActionHandler('createFile', handleCreateFile);
|
|
10
|
+
export async function handleCreateFile({ askQuestionCall, options, prompt, generateContentFn, }) {
|
|
9
11
|
putSystemMessage('File creation requested.', askQuestionCall);
|
|
10
12
|
// First confirmation: Ask user if they want to proceed with content generation
|
|
11
13
|
const generateConfirmation = await askUserForConfirmationWithAnswer('The assistant suggests generating content for a new file. Do you want to proceed with content generation?', 'Generate content', 'Cancel content generation', false, options);
|
|
@@ -29,7 +31,7 @@ export const handleCreateFile = async ({ askQuestionCall, options, prompt, gener
|
|
|
29
31
|
if (generateConfirmation.answer) {
|
|
30
32
|
putUserMessage(generateConfirmation.answer);
|
|
31
33
|
}
|
|
32
|
-
putSystemMessage('Content generation started.'
|
|
34
|
+
putSystemMessage('Content generation started.');
|
|
33
35
|
const [createFileCall] = (await generateContentFn([
|
|
34
36
|
...prompt,
|
|
35
37
|
{
|
|
@@ -153,5 +155,5 @@ export const handleCreateFile = async ({ askQuestionCall, options, prompt, gener
|
|
|
153
155
|
],
|
|
154
156
|
};
|
|
155
157
|
}
|
|
156
|
-
}
|
|
158
|
+
}
|
|
157
159
|
//# sourceMappingURL=handle-create-file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle-create-file.js","sourceRoot":"","sources":["../../../../../src/prompt/steps/step-ask-question/handlers/handle-create-file.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,4DAA4D,CAAC;AAE3G,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,yCAAyC,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAC1F,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"handle-create-file.js","sourceRoot":"","sources":["../../../../../src/prompt/steps/step-ask-question/handlers/handle-create-file.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,4DAA4D,CAAC;AAE3G,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/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AAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;wBACnG,iBAAiB,EAAE;4BACjB;gCACE,IAAI,EAAE,YAAY;gCAClB,OAAO,EAAE,cAAc,CAAC,EAAE;gCAC1B,OAAO,EAAE,EAAE;6BACZ;yBACF;qBACF;iBACF;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE;gBACL;oBACE,SAAS,EAAE;wBACT,IAAI,EAAE,WAAW;wBACjB,IAAI,EAAE,eAAe,CAAC,IAAK,CAAC,OAAO;wBACnC,aAAa,EAAE,CAAC,cAAc,CAAC;qBAChC;oBACD,IAAI,EAAE;wBACJ,IAAI,EAAE,MAAM;wBACZ,IAAI,EACF,0BAA0B;4BAC1B,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,iBAAiB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;4BAChE,4CAA4C;4BAC5C,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;wBAC5D,iBAAiB,EAAE;4BACjB;gCACE,IAAI,EAAE,YAAY;gCAClB,OAAO,EAAE,cAAc,CAAC,EAAE;gCAC1B,OAAO,EAAE,EAAE;6BACZ;yBACF;qBACF;iBACF;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { putSystemMessage } from '../../../../main/common/content-bus.js';
|
|
2
2
|
import { askUserForConfirmationWithAnswer } from '../../../../main/common/user-actions.js';
|
|
3
|
+
import { registerActionHandler } from '../step-ask-question-handlers.js';
|
|
4
|
+
registerActionHandler('endConversation', handleEndConversation);
|
|
3
5
|
export async function handleEndConversation({ askQuestionCall, options }) {
|
|
4
6
|
const userConfirmation = await askUserForConfirmationWithAnswer('Do you want to end the conversation?', 'End conversation', 'Continue conversation', true, options);
|
|
5
7
|
if (!userConfirmation.confirmed) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle-end-conversation.js","sourceRoot":"","sources":["../../../../../src/prompt/steps/step-ask-question/handlers/handle-end-conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,gCAAgC,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"handle-end-conversation.js","sourceRoot":"","sources":["../../../../../src/prompt/steps/step-ask-question/handlers/handle-end-conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,gCAAgC,EAAE,MAAM,yCAAyC,CAAC;AAC3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAGzE,qBAAqB,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,CAAC;AAEhE,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,EAAE,eAAe,EAAE,OAAO,EAAsB;IAC1F,MAAM,gBAAgB,GAAG,MAAM,gCAAgC,CAC7D,sCAAsC,EACtC,kBAAkB,EAClB,uBAAuB,EACvB,IAAI,EACJ,OAAO,CACR,CAAC;IAEF,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC;QAChC,OAAO;YACL,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE;gBACL;oBACE,SAAS,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,eAAe,CAAC,IAAI,EAAE,OAAO,IAAI,EAAE,EAAE;oBAC3E,IAAI,EAAE;wBACJ,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,gBAAgB,CAAC,MAAM,IAAI,6CAA6C;qBAC/E;iBACF;aACF;SACF,CAAC;IACJ,CAAC;IAED,gBAAgB,CAAC,yDAAyD,CAAC,CAAC;IAC5E,OAAO;QACL,SAAS,EAAE,IAAI;QACf,KAAK,EAAE;YACL;gBACE,SAAS,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,eAAe,CAAC,IAAI,EAAE,OAAO,IAAI,EAAE,EAAE;gBAC3E,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,4BAA4B,EAAE;aAC3D;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -3,6 +3,8 @@ import { getFunctionDefs } from '../../../function-calling.js';
|
|
|
3
3
|
import { putAssistantMessage } from '../../../../main/common/content-bus.js';
|
|
4
4
|
import { askUserForInput } from '../../../../main/common/user-actions.js';
|
|
5
5
|
import { GENAICODE_HELP_DOCUMENT } from '../../../../help-docs/genaicode-help-document.js';
|
|
6
|
+
import { registerActionHandler } from '../step-ask-question-handlers.js';
|
|
7
|
+
registerActionHandler('genaicodeHelp', handleGenaicodeHelp);
|
|
6
8
|
/**
|
|
7
9
|
* Handler for the help action. This handler is responsible for:
|
|
8
10
|
* 1. Reading the documentation file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle-genaicode-help.js","sourceRoot":"","sources":["../../../../../src/prompt/steps/step-ask-question/handlers/handle-genaicode-help.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;
|
|
1
|
+
{"version":3,"file":"handle-genaicode-help.js","sourceRoot":"","sources":["../../../../../src/prompt/steps/step-ask-question/handlers/handle-genaicode-help.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAA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AAiB,CAAC,IAAI,EAAE,OAAO,IAAI,EAAE;wBAC3C,aAAa,EAAE,CAAC,iBAAiB,CAAC;qBACnC;oBACD,IAAI,EAAE;wBACJ,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,QAAQ,CAAC,MAAM;wBACrB,iBAAiB,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,iBAAiB,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;qBAC3F;iBACF;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;QAC/C,OAAO;YACL,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE;gBACL;oBACE,SAAS,EAAE;wBACT,IAAI,EAAE,WAAW;wBACjB,IAAI,EAAE,eAAe,CAAC,IAAI,EAAE,OAAO,IAAI,qBAAqB;qBAC7D;oBACD,IAAI,EAAE;wBACJ,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,oIAAoI;qBAC3I;iBACF;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,KAAK,UAAU,oBAAoB,CAAC,iBAA0D,EAAE,MAAoB;IAClH,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,MAAM,iBAAiB,CAClD;QACE;YACE,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,iIAAiI;SACxI;QACD;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE;;;QAGN,uBAAuB;;CAE9B;SACM;QACD,GAAG,MAAM;KACV,EACD,eAAe,EAAE,EACjB,eAAe,EACf,GAAG,EACH,SAAS,CAAC,KAAK,CAChB,CAAkD,CAAC;IAEpD,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -4,6 +4,8 @@ import { executeStepGenerateImage } from '../../step-generate-image.js';
|
|
|
4
4
|
import { getFunctionDefs } from '../../../function-calling.js';
|
|
5
5
|
import { ModelType } from '../../../../ai-service/common-types.js';
|
|
6
6
|
import { getTempBuffer } from '../../../../files/temp-buffer.js';
|
|
7
|
+
import { registerActionHandler } from '../step-ask-question-handlers.js';
|
|
8
|
+
registerActionHandler('generateImage', handleGenerateImage);
|
|
7
9
|
export async function handleGenerateImage({ askQuestionCall, options, generateContentFn, prompt, generateImageFn, }) {
|
|
8
10
|
if (!options.imagen) {
|
|
9
11
|
putSystemMessage('Image generation is not enabled. Please enable it using --imagen parameter.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle-generate-image.js","sourceRoot":"","sources":["../../../../../src/prompt/steps/step-ask-question/handlers/handle-generate-image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAE/F,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"handle-generate-image.js","sourceRoot":"","sources":["../../../../../src/prompt/steps/step-ask-question/handlers/handle-generate-image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAE/F,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO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;gBACE,SAAS,EAAE;oBACT,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,eAAe,CAAC,IAAI,EAAE,OAAO,IAAI,EAAE;oBACzC,aAAa,EAAE,CAAC,iBAAiB,CAAC;iBACnC;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,aAAa,CAAC,MAAM;oBAC1B,MAAM,EAAE,CAAC,SAAS,CAAC;oBACnB,iBAAiB,EAAE,CAAC,EAAE,IAAI,EAAE,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,iBAAiB,CAAC,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;iBACzG;aACF;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ActionHandlerProps, ActionResult } from '../step-ask-question-types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Handles the lint action by executing the lint command and processing its results.
|
|
4
|
+
* If the lint command fails, it will ask for user confirmation to continue with code generation.
|
|
5
|
+
*/
|
|
6
|
+
export declare function handleLint({ askQuestionCall }: ActionHandlerProps): Promise<ActionResult>;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { exec } from 'child_process';
|
|
2
|
+
import { promisify } from 'util';
|
|
3
|
+
import { putSystemMessage } from '../../../../main/common/content-bus.js';
|
|
4
|
+
import { rcConfig } from '../../../../main/config.js';
|
|
5
|
+
import { registerActionHandler } from '../step-ask-question-handlers.js';
|
|
6
|
+
const execPromise = promisify(exec);
|
|
7
|
+
registerActionHandler('lint', handleLint);
|
|
8
|
+
/**
|
|
9
|
+
* Handles the lint action by executing the lint command and processing its results.
|
|
10
|
+
* If the lint command fails, it will ask for user confirmation to continue with code generation.
|
|
11
|
+
*/
|
|
12
|
+
export async function handleLint({ askQuestionCall }) {
|
|
13
|
+
if (!rcConfig.lintCommand) {
|
|
14
|
+
return {
|
|
15
|
+
breakLoop: false,
|
|
16
|
+
items: [
|
|
17
|
+
{
|
|
18
|
+
assistant: {
|
|
19
|
+
type: 'assistant',
|
|
20
|
+
text: askQuestionCall.args?.message ?? '',
|
|
21
|
+
functionCalls: [{ name: 'lint', id: askQuestionCall.id + '_lint' }],
|
|
22
|
+
},
|
|
23
|
+
user: {
|
|
24
|
+
type: 'user',
|
|
25
|
+
text: 'Lint command not configured. Skipping lint check.',
|
|
26
|
+
functionResponses: [
|
|
27
|
+
{
|
|
28
|
+
name: 'lint',
|
|
29
|
+
call_id: askQuestionCall.id + '_lint',
|
|
30
|
+
content: JSON.stringify({ error: 'Lint command not configured' }),
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
let lintResult;
|
|
39
|
+
try {
|
|
40
|
+
putSystemMessage(`Executing lint command: ${rcConfig.lintCommand}`);
|
|
41
|
+
await execPromise(rcConfig.lintCommand, { cwd: rcConfig.rootDir });
|
|
42
|
+
lintResult = {
|
|
43
|
+
success: true,
|
|
44
|
+
};
|
|
45
|
+
return {
|
|
46
|
+
breakLoop: false,
|
|
47
|
+
lintResult,
|
|
48
|
+
items: [
|
|
49
|
+
{
|
|
50
|
+
assistant: {
|
|
51
|
+
type: 'assistant',
|
|
52
|
+
text: askQuestionCall.args?.message ?? '',
|
|
53
|
+
functionCalls: [{ name: 'lint', id: askQuestionCall.id + '_lint' }],
|
|
54
|
+
},
|
|
55
|
+
user: {
|
|
56
|
+
type: 'user',
|
|
57
|
+
text: 'Lint command executed successfully, no issues found.',
|
|
58
|
+
functionResponses: [
|
|
59
|
+
{
|
|
60
|
+
name: 'lint',
|
|
61
|
+
call_id: askQuestionCall.id + '_lint',
|
|
62
|
+
content: JSON.stringify(lintResult),
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
const { stdout, stderr } = error;
|
|
72
|
+
lintResult = {
|
|
73
|
+
success: false,
|
|
74
|
+
stdout,
|
|
75
|
+
stderr,
|
|
76
|
+
};
|
|
77
|
+
// User confirmed to continue despite lint errors
|
|
78
|
+
return {
|
|
79
|
+
breakLoop: false,
|
|
80
|
+
lintResult,
|
|
81
|
+
items: [
|
|
82
|
+
{
|
|
83
|
+
assistant: {
|
|
84
|
+
type: 'assistant',
|
|
85
|
+
text: askQuestionCall.args?.message ?? '',
|
|
86
|
+
functionCalls: [{ name: 'lint', id: askQuestionCall.id + '_lint' }],
|
|
87
|
+
},
|
|
88
|
+
user: {
|
|
89
|
+
type: 'user',
|
|
90
|
+
text: 'Lint command failed, please analyze the output.',
|
|
91
|
+
data: { stdout, stderr },
|
|
92
|
+
functionResponses: [
|
|
93
|
+
{
|
|
94
|
+
name: 'lint',
|
|
95
|
+
call_id: askQuestionCall.id + '_lint',
|
|
96
|
+
content: JSON.stringify(lintResult),
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=handle-lint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle-lint.js","sourceRoot":"","sources":["../../../../../src/prompt/steps/step-ask-question/handlers/handle-lint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,MAAM,WAAW,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAEpC,qBAAqB,CAAC,MAAM,EAAE,UAAU,CAAC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,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC;qBACpE;oBACD,IAAI,EAAE;wBACJ,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,sDAAsD;wBAC5D,iBAAiB,EAAE;4BACjB;gCACE,IAAI,EAAE,MAAM;gCACZ,OAAO,EAAE,eAAe,CAAC,EAAE,GAAG,OAAO;gCACrC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC;6BACpC;yBACF;qBACF;iBACF;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAA2C,CAAC;QAEvE,UAAU,GAAG;YACX,OAAO,EAAE,KAAK;YACd,MAAM;YACN,MAAM;SACP,CAAC;QAEF,iDAAiD;QACjD,OAAO;YACL,SAAS,EAAE,KAAK;YAChB,UAAU;YACV,KAAK,EAAE;gBACL;oBACE,SAAS,EAAE;wBACT,IAAI,EAAE,WAAW;wBACjB,IAAI,EAAE,eAAe,CAAC,IAAI,EAAE,OAAO,IAAI,EAAE;wBACzC,aAAa,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,eAAe,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC;qBACpE;oBACD,IAAI,EAAE;wBACJ,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,iDAAiD;wBACvD,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;wBACxB,iBAAiB,EAAE;4BACjB;gCACE,IAAI,EAAE,MAAM;gCACZ,OAAO,EAAE,eAAe,CAAC,EAAE,GAAG,OAAO;gCACrC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC;6BACpC;yBACF;qBACF;iBACF;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -2,8 +2,9 @@ import { ModelType } from '../../../../ai-service/common-types.js';
|
|
|
2
2
|
import { putAssistantMessage, putSystemMessage } from '../../../../main/common/content-bus.js';
|
|
3
3
|
import { performAnalysis } from '../../../function-defs/perform-analysis.js';
|
|
4
4
|
import { analysisResult } from '../../../function-defs/analysis-result.js';
|
|
5
|
-
import { validateAndRecoverSingleResult } from '../../step-validate-recover.js';
|
|
6
5
|
import { askUserForInput } from '../../../../main/common/user-actions.js';
|
|
6
|
+
import { registerActionHandler } from '../step-ask-question-handlers.js';
|
|
7
|
+
registerActionHandler('performAnalysis', handlePerformAnalysis);
|
|
7
8
|
/**
|
|
8
9
|
* Handles the performAnalysis action by executing analysis with enhanced context
|
|
9
10
|
* and processing the results.
|
|
@@ -76,8 +77,7 @@ async function getPerformAnalysisCall(generateContentFn, prompt, functionDefs, o
|
|
|
76
77
|
ModelType.CHEAP,
|
|
77
78
|
options,
|
|
78
79
|
];
|
|
79
|
-
|
|
80
|
-
performAnalysisResult = await validateAndRecoverSingleResult(performAnalysisRequest, performAnalysisResult, generateContentFn);
|
|
80
|
+
const performAnalysisResult = await generateContentFn(...performAnalysisRequest);
|
|
81
81
|
return performAnalysisResult.find((call) => call.name === 'performAnalysis');
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
@@ -92,8 +92,7 @@ async function executeAnalysis(generateContentFn, prompt, functionDefs, options)
|
|
|
92
92
|
ModelType.DEFAULT,
|
|
93
93
|
options,
|
|
94
94
|
];
|
|
95
|
-
|
|
96
|
-
analysisResult = await validateAndRecoverSingleResult(analysisRequest, analysisResult, generateContentFn);
|
|
95
|
+
const analysisResult = await generateContentFn(...analysisRequest);
|
|
97
96
|
return analysisResult.find((call) => call.name === 'analysisResult');
|
|
98
97
|
}
|
|
99
98
|
//# sourceMappingURL=handle-perform-analysis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle-perform-analysis.js","sourceRoot":"","sources":["../../../../../src/prompt/steps/step-ask-question/handlers/handle-perform-analysis.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAOnE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"handle-perform-analysis.js","sourceRoot":"","sources":["../../../../../src/prompt/steps/step-ask-question/handlers/handle-perform-analysis.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAOnE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAE3E,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,qBAAqB,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,CAAC;AAEhE;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,EAC1C,eAAe,EACf,MAAM,EACN,OAAO,EACP,iBAAiB,EACjB,YAAY,GACO;IACnB,MAAM,YAAY,GAAkB,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;IAEtE,IAAI,CAAC;QACH,iBAAiB;QACjB,MAAM,YAAY,EAAE,CAAC;QAErB,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,eAAe,CAAC,IAAI,EAAE,OAAO,IAAI,EAAE;SAC1C,CAAC,CAAC;QAEH,kDAAkD;QAClD,MAAM,sBAAsB,GAAG,MAAM,sBAAsB,CAAC,iBAAiB,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;QAE9G,IAAI,CAAC,sBAAsB,EAAE,IAAI,EAAE,CAAC;YAClC,gBAAg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AC,GAAG,eAAe,CAAC,CAAC;IACnE,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,gBAAgB,CAAmC,CAAC;AACzG,CAAC"}
|
|
@@ -2,6 +2,8 @@ import { ModelType } from '../../../../ai-service/common-types.js';
|
|
|
2
2
|
import { getContextValue } from '../../../../main/common/app-context-bus.js';
|
|
3
3
|
import { putSystemMessage } from '../../../../main/common/content-bus.js';
|
|
4
4
|
import { getFunctionDefs } from '../../../function-calling.js';
|
|
5
|
+
import { registerActionHandler } from '../step-ask-question-handlers.js';
|
|
6
|
+
registerActionHandler('pullAppContext', handlePullAppContext);
|
|
5
7
|
/**
|
|
6
8
|
* Handler for pullAppContext action
|
|
7
9
|
* Retrieves context value from the content-bus system and includes it in the conversation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle-pull-app-context.js","sourceRoot":"","sources":["../../../../../src/prompt/steps/step-ask-question/handlers/handle-pull-app-context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"handle-pull-app-context.js","sourceRoot":"","sources":["../../../../../src/prompt/steps/step-ask-question/handlers/handle-pull-app-context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;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,KAAK;SACjB,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CACT;YACE,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,GAAG,WAAW,GAAG,UAAU,EAAE;YACnC,aAAa,EAAE,CAAC,kBAAkB,CAAC;SACpC,EACD;YACE,IAAI,EAAE,MAAM;YACZ,iBAAiB,EAAE;gBACjB;oBACE,IAAI,EAAE,gBAAgB;oBACtB,OAAO,EAAE,kBAAkB,CAAC,EAAE;oBAC9B,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;iBACrF;aACF;SACF,CACF,CAAC;QAEF,oDAAoD;QACpD,OAAO;YACL,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,EAAE;SACV,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,wDAAwD;QACxD,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC;QACvF,gBAAgB,CAAC,0BAA0B,EAAE;YAC3C,UAAU,EAAE,GAAG;YACf,KAAK,EAAE,YAAY;YACnB,MAAM;YACN,SAAS,EAAE,KAAK;SACjB,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CACT;YACE,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,uCAAuC,GAAG,MAAM,YAAY,EAAE;SACrE,EACD;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,2BAA2B;SAClC,CACF,CAAC;QAEF,OAAO;YACL,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,EAAE;SACV,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -2,6 +2,8 @@ import { ModelType } from '../../../../ai-service/common-types.js';
|
|
|
2
2
|
import { setContextValue } from '../../../../main/common/app-context-bus.js';
|
|
3
3
|
import { putSystemMessage } from '../../../../main/common/content-bus.js';
|
|
4
4
|
import { getFunctionDefs } from '../../../function-calling.js';
|
|
5
|
+
import { registerActionHandler } from '../step-ask-question-handlers.js';
|
|
6
|
+
registerActionHandler('pushAppContext', handlePushAppContext);
|
|
5
7
|
/**
|
|
6
8
|
* Handler for pushAppContext action
|
|
7
9
|
* Updates context value in the content-bus system with proper validation and error handling
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle-push-app-context.js","sourceRoot":"","sources":["../../../../../src/prompt/steps/step-ask-question/handlers/handle-push-app-context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"handle-push-app-context.js","sourceRoot":"","sources":["../../../../../src/prompt/steps/step-ask-question/handlers/handle-push-app-context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAGzE,qBAAqB,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAC;AAE9D;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,EACzC,iBAAiB,EACjB,MAAM,EACN,OAAO,GACY;IACnB,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;IAExC,MAAM,CAAC,kBAAkB,CAAC,GAAG,CAAC,MAAM,iBAAiB,CACnD,MAAM,EACN,eAAe,E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UAAU,EAAE;YAClC,aAAa,EAAE,CAAC,kBAAkB,CAAC;SACpC,EACD;YACE,IAAI,EAAE,MAAM;YACZ,iBAAiB,EAAE,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,kBAAkB,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;SAC7F,CACF,CAAC;QAEF,oDAAoD;QACpD,OAAO;YACL,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,EAAE;SACV,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,qDAAqD;QACrD,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC;QACvF,gBAAgB,CAAC,2BAA2B,YAAY,EAAE,CAAC,CAAC;QAE5D,MAAM,CAAC,IAAI,CACT;YACE,IAAI,EAAE,WAAW;YACjB,aAAa,EAAE,CAAC,kBAAkB,CAAC;SACpC,EACD;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,wBAAwB;YAC9B,iBAAiB,EAAE;gBACjB;oBACE,IAAI,EAAE,gBAAgB;oBACtB,OAAO,EAAE,kBAAkB,CAAC,EAAE;oBAC9B,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC;wBACtB,UAAU,EAAE,GAAG;wBACf,KAAK,EAAE,YAAY;wBACnB,MAAM;wBACN,SAAS,EAAE,KAAK;qBACjB,CAAC;iBACH;aACF;SACF,CACF,CAAC;QAEF,OAAO;YACL,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,EAAE;SACV,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ModelType } from '../../../../ai-service/common-types.js';
|
|
2
2
|
import { putSystemMessage } from '../../../../main/common/content-bus.js';
|
|
3
3
|
import { getFunctionDefs } from '../../../function-calling.js';
|
|
4
|
-
import { validateAndRecoverSingleResult } from '../../step-validate-recover.js';
|
|
5
4
|
import { getContextSourceCode } from '../../../../files/source-code-utils.js';
|
|
5
|
+
import { registerActionHandler } from '../step-ask-question-handlers.js';
|
|
6
|
+
registerActionHandler('reasoningInference', handleReasoningInference);
|
|
6
7
|
/**
|
|
7
8
|
* Handler for the reasoningInference action.
|
|
8
9
|
* This handler is designed to work with models that don't support function calling
|
|
@@ -25,8 +26,7 @@ export async function handleReasoningInference({ askQuestionCall, prompt, genera
|
|
|
25
26
|
ModelType.CHEAP,
|
|
26
27
|
options,
|
|
27
28
|
];
|
|
28
|
-
const
|
|
29
|
-
const [reasoningInferenceCall] = (await validateAndRecoverSingleResult(request, result, generateContentFn));
|
|
29
|
+
const [reasoningInferenceCall] = (await generateContentFn(...request));
|
|
30
30
|
if (!reasoningInferenceCall?.args?.prompt) {
|
|
31
31
|
putSystemMessage('Failed to get valid reasoningInference request');
|
|
32
32
|
prompt.push({
|