complete
codebolt.fileUpdateIntent.complete(id: undefined, closedBy: undefined): Promise<FileUpdateIntent>
Marks a file update intent as completed.
Parameters
id(unknown): The unique identifier of the file update intent.closedBy(unknown): Agent ID completing the intent.
Returns
Promise<[FileUpdateIntent](/docs/reference/type-reference/codeboltjs/interfaces/FileUpdateIntent)>: A promise that resolves with the completed intent.
Examples
Example 1: Complete Intent
const completed = await codebolt.fileUpdateIntent.complete(
'intent-id-123',
'agent-456'
);
console.log('Intent completed:', completed.status === 'completed');
Example 2: Complete After Work
async function doWork(intentId) {
try {
// Perform the actual file modifications
await modifyFiles();
// Mark intent as completed
await codebolt.fileUpdateIntent.complete(intentId, 'agent-456');
console.log('Work completed successfully');
} catch (error) {
// Handle error and consider cancelling instead
console.error('Work failed:', error);
}
}
Notes
- Always complete intents when work is done
- Releases file locks for other agents
- Cannot be undone (use with caution)