Merge remote-tracking branch 'origin/main' into file_system_watcher

This commit is contained in:
Matt Rubens
2024-12-24 14:07:02 -08:00
6 changed files with 95 additions and 17 deletions

View File

@@ -1,5 +1,9 @@
# Roo Cline Changelog # Roo Cline Changelog
## [2.2.27]
- Add the current time to the system prompt and improve browser screenshot quality (thanks @libertyteeth!)
## [2.2.26] ## [2.2.26]
- Tweaks to preferred language (thanks @yongjer) - Tweaks to preferred language (thanks @yongjer)

View File

@@ -1,20 +1,17 @@
# Roo-Cline # Roo-Cline
A fork of Cline, an autonomous coding agent, tweaked for more speed and flexibility. Its been mainly writing itself recently, with a light touch of human guidance here and there. A fork of Cline, an autonomous coding agent, with some additional experimental features. Its been mainly writing itself recently, with a light touch of human guidance here and there.
## Features ## Features
- Automatically approve commands, browsing, file writing, and MCP tools
- Faster, more targeted edits via diffs (even on big files)
- Detects and fixes missing code chunks
- `.clinerules` for project-specific instructions
- Drag and drop images into chats - Drag and drop images into chats
- Sound effects for feedback - Sound effects for feedback
- Option to use a larger 1280x800 browser - Option to use a larger 1280x800 browser
- Quick prompt copying from history - Quick prompt copying from history
- OpenRouter compression support - OpenRouter compression support
- Includes current time in the system prompt
- Language selection for Cline's communication (English, Japanese, Spanish, French, German, and more) - Language selection for Cline's communication (English, Japanese, Spanish, French, German, and more)
- Support for newer Gemini models (gemini-exp-1206, gemini-2.0-flash-exp, gemini-2.0-flash-thinking-exp-1219) and Meta 3, 3.1, and 3.2 models via AWS Bedrock - Support for Meta 3, 3.1, and 3.2 models via AWS Bedrock
- Runs alongside the original Cline - Runs alongside the original Cline
## Disclaimer ## Disclaimer
@@ -80,12 +77,9 @@ Once your merge is successful:
</details> </details>
## Stay Updated!
Subscribe to our [Github releases](https://github.com/RooVetGit/Roo-Cline/releases) to keep up with the latest updates! You can also view our [CHANGELOG.md](Roo-Cline/CHANGELOG.md) for more details.
--- ---
# Cline (prev. Claude Dev) \#1 on OpenRouter # Cline (prev. Claude Dev) [#1 on OpenRouter](https://openrouter.ai/)
<p align="center"> <p align="center">
<img src="https://media.githubusercontent.com/media/cline/cline/main/assets/docs/demo.gif" width="100%" /> <img src="https://media.githubusercontent.com/media/cline/cline/main/assets/docs/demo.gif" width="100%" />
@@ -95,7 +89,7 @@ Subscribe to our [Github releases](https://github.com/RooVetGit/Roo-Cline/releas
<table> <table>
<tbody> <tbody>
<td align="center"> <td align="center">
<a href="https://marketplace.visualstudio.com/items?itemName=RooVeterinaryInc.roo-cline" target="_blank"><strong>Download on VS Marketplace</strong></a> <a href="https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev" target="_blank"><strong>Download on VS Marketplace</strong></a>
</td> </td>
<td align="center"> <td align="center">
<a href="https://discord.gg/cline" target="_blank"><strong>Join the Discord</strong></a> <a href="https://discord.gg/cline" target="_blank"><strong>Join the Discord</strong></a>
@@ -120,10 +114,10 @@ Thanks to [Claude 3.5 Sonnet's agentic coding capabilities](https://www-cdn.ant
- Create and edit files + monitor linter/compiler errors along the way, letting him proactively fix issues like missing imports and syntax errors on his own. - Create and edit files + monitor linter/compiler errors along the way, letting him proactively fix issues like missing imports and syntax errors on his own.
- Execute commands directly in your terminal and monitor their output as he works, letting him e.g., react to dev server issues after editing a file. - Execute commands directly in your terminal and monitor their output as he works, letting him e.g., react to dev server issues after editing a file.
- For web development tasks, Cline can launch the site in a headless browser, click, type, scroll, and capture screenshots + console logs, allowing him to fix runtime errors and visual bugs. - For web development tasks, Cline can launch the site in a headless browser, click, type, scroll, and capture screenshots + console logs, allowing him to fix runtime errors and visual bugs.
4. When a task is completed, Cline will present the result to you with a terminal command like `open -a "Google Chrome" index.html`, which you run with a click of a button. 4. When a task is completed, Cline will present the result to you with a terminal command like `open -a "Google Chrome" index.html`, which you run with a click of a button.
> [!TIP] > [!TIP]
> Use the `CMD/CTRL + Shift + P` shortcut to open the command palette and type "Cline: Open In New Tab" to open the extension as a tab in your editor. This lets you use Cline side-by-side with your file explorer, and see how he changes your workspace more clearly. > Use the `CMD/CTRL + Shift + P` shortcut to open the command palette and type "Cline: Open In New Tab" to open the extension as a tab in your editor. This lets you use Cline side-by-side with your file explorer, and see how he changes your workspace more clearly.
--- ---
@@ -131,7 +125,7 @@ Thanks to [Claude 3.5 Sonnet's agentic coding capabilities](https://www-cdn.ant
### Use any API and Model ### Use any API and Model
Cline supports API providers like OpenRouter, Anthropic, OpenAI, Google Gemini, AWS Bedrock, Azure, and GCP Vertex. You can also configure any OpenAI compatible API, or use a local model through LM Studio/Ollama. If you're using OpenRouter, the extension fetches their latest model list, allowing you to use the newest models as soon as they're available. The extension also now supports Amazon Nova and Meta Llama (3, 3.1, and 3.2) models via AWS Bedrock. Cline supports API providers like OpenRouter, Anthropic, OpenAI, Google Gemini, AWS Bedrock, Azure, and GCP Vertex. You can also configure any OpenAI compatible API, or use a local model through LM Studio/Ollama. If you're using OpenRouter, the extension fetches their latest model list, allowing you to use the newest models as soon as they're available.
The extension also keeps track of total tokens and API usage cost for the entire task loop and individual requests, keeping you informed of spend every step of the way. The extension also keeps track of total tokens and API usage cost for the entire task loop and individual requests, keeping you informed of spend every step of the way.

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "roo-cline", "name": "roo-cline",
"version": "2.2.26", "version": "2.2.27",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "roo-cline", "name": "roo-cline",
"version": "2.2.26", "version": "2.2.27",
"dependencies": { "dependencies": {
"@anthropic-ai/bedrock-sdk": "^0.10.2", "@anthropic-ai/bedrock-sdk": "^0.10.2",
"@anthropic-ai/sdk": "^0.26.0", "@anthropic-ai/sdk": "^0.26.0",

View File

@@ -3,7 +3,7 @@
"displayName": "Roo Cline", "displayName": "Roo Cline",
"description": "A fork of Cline, an autonomous coding agent, with some added experimental configuration and automation features.", "description": "A fork of Cline, an autonomous coding agent, with some added experimental configuration and automation features.",
"publisher": "RooVeterinaryInc", "publisher": "RooVeterinaryInc",
"version": "2.2.26", "version": "2.2.27",
"icon": "assets/icons/rocket.png", "icon": "assets/icons/rocket.png",
"galleryBanner": { "galleryBanner": {
"color": "#617A91", "color": "#617A91",

View File

@@ -2462,6 +2462,22 @@ export class Cline {
details += terminalDetails details += terminalDetails
} }
// Add current time information with timezone
const now = new Date()
const formatter = new Intl.DateTimeFormat(undefined, {
year: 'numeric',
month: 'numeric',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
hour12: true
})
const timeZone = formatter.resolvedOptions().timeZone
const timeZoneOffset = -now.getTimezoneOffset() / 60 // Convert to hours and invert sign to match conventional notation
const timeZoneOffsetStr = `${timeZoneOffset >= 0 ? '+' : ''}${timeZoneOffset}:00`
details += `\n\n# Current Time\n${formatter.format(now)} (${timeZone}, UTC${timeZoneOffsetStr})`
if (includeFileDetails) { if (includeFileDetails) {
details += `\n\n# Current Working Directory (${cwd.toPosix()}) Files\n` details += `\n\n# Current Working Directory (${cwd.toPosix()}) Files\n`
const isDesktop = arePathsEqual(cwd, path.join(os.homedir(), "Desktop")) const isDesktop = arePathsEqual(cwd, path.join(os.homedir(), "Desktop"))

View File

@@ -356,4 +356,68 @@ describe('Cline', () => {
}).toThrow('Either historyItem or task/images must be provided'); }).toThrow('Either historyItem or task/images must be provided');
}); });
}); });
describe('getEnvironmentDetails', () => {
let originalDate: DateConstructor;
let mockDate: Date;
beforeEach(() => {
originalDate = global.Date;
const fixedTime = new Date('2024-01-01T12:00:00Z');
mockDate = new Date(fixedTime);
mockDate.getTimezoneOffset = jest.fn().mockReturnValue(420); // UTC-7
class MockDate extends Date {
constructor() {
super();
return mockDate;
}
static override now() {
return mockDate.getTime();
}
}
global.Date = MockDate as DateConstructor;
// Create a proper mock of Intl.DateTimeFormat
const mockDateTimeFormat = {
resolvedOptions: () => ({
timeZone: 'America/Los_Angeles'
}),
format: () => '1/1/2024, 5:00:00 AM'
};
const MockDateTimeFormat = function(this: any) {
return mockDateTimeFormat;
} as any;
MockDateTimeFormat.prototype = mockDateTimeFormat;
MockDateTimeFormat.supportedLocalesOf = jest.fn().mockReturnValue(['en-US']);
global.Intl.DateTimeFormat = MockDateTimeFormat;
});
afterEach(() => {
global.Date = originalDate;
});
it('should include timezone information in environment details', async () => {
const cline = new Cline(
mockProvider,
mockApiConfig,
undefined,
false,
undefined,
'test task'
);
const details = await cline['getEnvironmentDetails'](false);
// Verify timezone information is present and formatted correctly
expect(details).toContain('America/Los_Angeles');
expect(details).toMatch(/UTC-7:00/); // Fixed offset for America/Los_Angeles
expect(details).toContain('# Current Time');
expect(details).toMatch(/1\/1\/2024.*5:00:00 AM.*\(America\/Los_Angeles, UTC-7:00\)/); // Full time string format
});
});
}); });