From f501c93faff947ab0779604def75dee7efacd228 Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Mon, 23 Dec 2024 22:28:10 -0800 Subject: [PATCH 1/7] Add the current time to the system prompt --- src/core/Cline.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/core/Cline.ts b/src/core/Cline.ts index cc1062d..343393f 100644 --- a/src/core/Cline.ts +++ b/src/core/Cline.ts @@ -2462,6 +2462,22 @@ export class Cline { 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) { details += `\n\n# Current Working Directory (${cwd.toPosix()}) Files\n` const isDesktop = arePathsEqual(cwd, path.join(os.homedir(), "Desktop")) From d9e2bac127c2ccfb57e734d1108e22a8f67d8033 Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Mon, 23 Dec 2024 22:28:22 -0800 Subject: [PATCH 2/7] Add tests and changeset --- .changeset/ninety-candles-wave.md | 5 +++ src/core/__tests__/Cline.test.ts | 64 +++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 .changeset/ninety-candles-wave.md diff --git a/.changeset/ninety-candles-wave.md b/.changeset/ninety-candles-wave.md new file mode 100644 index 0000000..fa81796 --- /dev/null +++ b/.changeset/ninety-candles-wave.md @@ -0,0 +1,5 @@ +--- +"roo-cline": patch +--- + +Add the current time to the system prompt diff --git a/src/core/__tests__/Cline.test.ts b/src/core/__tests__/Cline.test.ts index ed755bd..b131fbd 100644 --- a/src/core/__tests__/Cline.test.ts +++ b/src/core/__tests__/Cline.test.ts @@ -353,4 +353,68 @@ describe('Cline', () => { }).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 + }); + }); }); From 4fba53c6b0bbc4411409d6642c904579c552320a Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Tue, 24 Dec 2024 11:53:05 -0800 Subject: [PATCH 3/7] Update README --- README.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 1c81e98..f3735b4 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,17 @@ # Roo-Cline -A fork of Cline, an autonomous coding agent, tweaked for more speed and flexibility. It’s 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. It’s been mainly writing itself recently, with a light touch of human guidance here and there. ## 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 - Sound effects for feedback - Option to use a larger 1280x800 browser - Quick prompt copying from history - OpenRouter compression support +- Includes current time in the system prompt - 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 ## Disclaimer @@ -85,7 +82,7 @@ Subscribe to our [Github releases](https://github.com/RooVetGit/Roo-Cline/releas --- -# Cline (prev. Claude Dev) – \#1 on OpenRouter +# Cline (prev. Claude Dev) – [#1 on OpenRouter](https://openrouter.ai/)

@@ -95,7 +92,7 @@ Subscribe to our [Github releases](https://github.com/RooVetGit/Roo-Cline/releas
-Download on VS Marketplace +Download on VS Marketplace Join the Discord @@ -120,10 +117,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. - 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. -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] -> 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 +128,7 @@ Thanks to [Claude 3.5 Sonnet's agentic coding capabilities](https://www-cdn.ant ### 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. From 2c8aec64c8c1639d3486b6a6f84882e8e08872c9 Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Tue, 24 Dec 2024 11:54:38 -0800 Subject: [PATCH 4/7] Update changeset --- .changeset/ninety-candles-wave.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/ninety-candles-wave.md b/.changeset/ninety-candles-wave.md index fa81796..4ddc78b 100644 --- a/.changeset/ninety-candles-wave.md +++ b/.changeset/ninety-candles-wave.md @@ -2,4 +2,4 @@ "roo-cline": patch --- -Add the current time to the system prompt +Add the current time to the system prompt and improve browser screenshot quality (thanks @libertyteeth!) From 4670d6b2a98963ef18a9b7f56f1421b0328f34d9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 24 Dec 2024 19:58:55 +0000 Subject: [PATCH 5/7] changeset version bump --- .changeset/ninety-candles-wave.md | 5 ----- CHANGELOG.md | 6 ++++++ package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) delete mode 100644 .changeset/ninety-candles-wave.md diff --git a/.changeset/ninety-candles-wave.md b/.changeset/ninety-candles-wave.md deleted file mode 100644 index 4ddc78b..0000000 --- a/.changeset/ninety-candles-wave.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"roo-cline": patch ---- - -Add the current time to the system prompt and improve browser screenshot quality (thanks @libertyteeth!) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcf32af..bf55197 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Roo Cline Changelog +## 2.2.27 + +### Patch Changes + +- Add the current time to the system prompt and improve browser screenshot quality (thanks @libertyteeth!) + ## [2.2.26] - Tweaks to preferred language (thanks @yongjer) diff --git a/package-lock.json b/package-lock.json index 08f42c3..295b1a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "roo-cline", - "version": "2.2.26", + "version": "2.2.27", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "roo-cline", - "version": "2.2.26", + "version": "2.2.27", "dependencies": { "@anthropic-ai/bedrock-sdk": "^0.10.2", "@anthropic-ai/sdk": "^0.26.0", diff --git a/package.json b/package.json index 044f697..b6feee5 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "Roo Cline", "description": "A fork of Cline, an autonomous coding agent, with some added experimental configuration and automation features.", "publisher": "RooVeterinaryInc", - "version": "2.2.26", + "version": "2.2.27", "icon": "assets/icons/rocket.png", "galleryBanner": { "color": "#617A91", From 0c398cce9a543d24467e62fbb675ad3bd30c5834 Mon Sep 17 00:00:00 2001 From: R00-B0T Date: Tue, 24 Dec 2024 19:59:32 +0000 Subject: [PATCH 6/7] Updating CHANGELOG.md format --- CHANGELOG.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf55197..9402b4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,6 @@ # Roo Cline Changelog -## 2.2.27 - -### Patch Changes +## [2.2.27] - Add the current time to the system prompt and improve browser screenshot quality (thanks @libertyteeth!) From e3c2830d902d047c1966d924cc0b059fe8430c07 Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Tue, 24 Dec 2024 12:02:49 -0800 Subject: [PATCH 7/7] Update README.md We don't currently have releases and the changelog link is broken --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index f3735b4..5d3f696 100644 --- a/README.md +++ b/README.md @@ -77,9 +77,6 @@ Once your merge is successful: -## 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](https://openrouter.ai/)