Elffuss BraidHub

kikocis/continue public

Merge branch 'main' into mermaid-diagrams-2
Changeset5e92b78eb714c39924fa8eeed956d3f8c1aa35aa9f68a28f64f2cbff622083f3
Authoruinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-07-09 08:48 +05:30
Committeruinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-07-09 08:48 +05:30
Parents101d05b5ea8c, d3432ada2b04

Browse the files at this changeset

74 files changed

added .github/workflows/compliance.yaml +197 −0
@@ -0,0 +1,197 @@
1+name: PR Compliance Checks
2+
3+on:
4+ pull_request:
5+ types: [opened, synchronize, reopened, ready_for_review]
6+ branches: [main]
7+ workflow_dispatch:
8+
9+concurrency:
10+ group: ${{ github.workflow }}-${{ github.ref }}
11+ cancel-in-progress: true
12+
13+jobs:
14+ conventional-commits:
15+ name: Validate Conventional Commits (Warning Only)
16+ runs-on: ubuntu-latest
17+ if: ${{ !github.event.pull_request.draft }}
18+ continue-on-error: true
19+ permissions:
20+ pull-requests: write
21+ issues: write
22+ contents: read
23+ steps:
24+ - name: Checkout code
25+ uses: actions/checkout@v4
26+ with:
27+ fetch-depth: 0
28+
29+ - name: Validate conventional commits
30+ id: commitlint
31+ uses: wagoid/commitlint-github-action@v6
32+ with:
33+ configFile: .commitlintrc.warning.json
34+ continue-on-error: true
35+
36+ - name: Add commit message guidance comment
37+ if: steps.commitlint.outcome == 'failure'
38+ uses: actions/github-script@v7
39+ with:
40+ script: |
41+ const { data: comments } = await github.rest.issues.listComments({
42+ owner: context.repo.owner,
43+ repo: context.repo.repo,
44+ issue_number: context.issue.number,
45+ });
46+
47+ const botComment = comments.find(comment =>
48+ comment.user.type === 'Bot' &&
49+ comment.body.includes('Conventional Commit Format')
50+ );
51+
52+ if (!botComment) {
53+ await github.rest.issues.createComment({
54+ owner: context.repo.owner,
55+ repo: context.repo.repo,
56+ issue_number: context.issue.number,
57+ body: [
58+ "## ⚠️ Conventional Commit Format",
59+ "",
60+ "Your commit messages don't follow the conventional commit format, but **this won't block your PR from being merged**. We recommend downloading [this extension](https://marketplace.visualstudio.com/items?itemName=vivaxy.vscode-conventional-commits) if you are using VS Code.",
61+ "",
62+ "### Expected Format:",
63+ "```",
64+ "<type>[optional scope]: <description>",
65+ "",
66+ "[optional body]",
67+ "",
68+ "[optional footer(s)]",
69+ "```",
70+ "",
71+ "### Examples:",
72+ "- `feat: add changelog generation support`",
73+ "- `fix: resolve login redirect issue`",
74+ "- `docs: update README with new instructions`",
75+ "- `chore: update dependencies`",
76+ "",
77+ "### Valid Types:",
78+ "`feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`",
79+ "",
80+ "This helps with:",
81+ "- 📝 Automatic changelog generation",
82+ "- 🚀 Automated semantic versioning",
83+ "- 📊 Better project history tracking",
84+ "",
85+ "*This is a non-blocking warning - your PR can still be merged without fixing this.*"
86+ ].join('\n')
87+ });
88+ }
89+
90+ security-audit:
91+ name: Security Audit
92+ runs-on: ubuntu-latest
93+ if: ${{ !github.event.pull_request.draft }}
94+ permissions:
95+ security-events: write
96+ contents: read
97+ steps:
98+ - name: Checkout code
99+ uses: actions/checkout@v4
100+
101+ - name: Setup Node.js
102+ uses: actions/setup-node@v4
103+ with:
104+ node-version-file: ".nvmrc"
105+ cache: "npm"
106+
107+ - name: Install dependencies
108+ run: npm ci
109+
110+ - name: Fix vulnerabilities
111+ run: npm audit fix
112+
113+ - name: Run npm audit
114+ run: npm audit --audit-level=moderate
115+
116+ - name: Initialize CodeQL
117+ uses: github/codeql-action/init@v3
118+ with:
119+ languages: javascript
120+
121+ - name: Perform CodeQL Analysis
122+ uses: github/codeql-action/analyze@v3
123+
124+ # Use this for any files that we want to be certain exist
125+ # Basically creates a forcing function to discuss were anyone to want to remove them
126+ file-validation:
127+ name: Required Files Check
128+ runs-on: ubuntu-latest
129+ if: ${{ !github.event.pull_request.draft }}
130+ steps:
131+ - name: Checkout code
132+ uses: actions/checkout@v4
133+
134+ - name: Check required files
135+ run: |
136+ required_files=(
137+ "package.json"
138+ "package-lock.json"
139+ "README.md"
140+ "LICENSE"
141+ ".gitignore"
142+ "tsconfig.json"
143+ "SECURITY.md"
144+ "CONTRIBUTING.md"
145+ ".nvmrc"
146+ ".prettierrc"
147+ ".prettierignore"
148+ )
149+
150+ missing_files=()
151+ for file in "${required_files[@]}"; do
152+ if [[ ! -f "$file" ]]; then
153+ missing_files+=("$file")
154+ fi
155+ done
156+
157+ if [[ ${#missing_files[@]} -gt 0 ]]; then
158+ echo "❌ Missing required files:"
159+ printf '%s\n' "${missing_files[@]}"
160+ exit 1
161+ else
162+ echo "✅ All required files present"
163+ fi
164+
165+ compliance-summary:
166+ name: Compliance Summary
167+ runs-on: ubuntu-latest
168+ needs: [conventional-commits, security-audit, file-validation]
169+ if: always() && !github.event.pull_request.draft
170+ steps:
171+ - name: Check compliance status
172+ run: |
173+ echo "## 🔍 Compliance Check Results" >> $GITHUB_STEP_SUMMARY
174+ echo "" >> $GITHUB_STEP_SUMMARY
175+
176+ if [[ "${{ needs.conventional-commits.result }}" == "success" ]]; then
177+ echo "✅ Conventional Commits: PASSED" >> $GITHUB_STEP_SUMMARY
178+ elif [[ "${{ needs.conventional-commits.result }}" == "failure" ]]; then
179+ echo "⚠️ Conventional Commits: WARNING (non-blocking)" >> $GITHUB_STEP_SUMMARY
180+ else
181+ echo "❌ Conventional Commits: SKIPPED" >> $GITHUB_STEP_SUMMARY
182+ fi
183+
184+ if [[ "${{ needs.security-audit.result }}" == "success" ]]; then
185+ echo "✅ Security Audit: PASSED" >> $GITHUB_STEP_SUMMARY
186+ else
187+ echo "❌ Security Audit: FAILED" >> $GITHUB_STEP_SUMMARY
188+ fi
189+
190+ if [[ "${{ needs.file-validation.result }}" == "success" ]]; then
191+ echo "✅ File Validation: PASSED" >> $GITHUB_STEP_SUMMARY
192+ else
193+ echo "❌ File Validation: FAILED" >> $GITHUB_STEP_SUMMARY
194+ fi
195+
196+ echo "" >> $GITHUB_STEP_SUMMARY
197+ echo "📊 **Overall Status**: ${{ job.status }}" >> $GITHUB_STEP_SUMMARY
modified core/config/load.ts +2 −0
@@ -643,6 +643,7 @@
643643 template: llm.template,
644644 completionOptions: llm.completionOptions,
645645 baseAgentSystemMessage: llm.baseAgentSystemMessage,
646+ basePlanSystemMessage: llm.basePlanSystemMessage,
646647 baseChatSystemMessage: llm.baseChatSystemMessage,
647648 requestOptions: llm.requestOptions,
648649 promptTemplates: serializePromptTemplates(llm.promptTemplates),
@@ -650,6 +651,7 @@
650651 roles: llm.roles,
651652 configurationStatus: llm.getConfigurationStatus(),
652653 apiKeyLocation: llm.apiKeyLocation,
654+ envSecretLocations: llm.envSecretLocations,
653655 };
654656 }
655657
modified core/config/types.ts +2 −0
@@ -1004,6 +1004,8 @@
10041004 type: "stdio";
10051005 command: string;
10061006 args: string[];
1007+ env?: Record<string, string>;
1008+ cwd?: string;
10071009 }
10081010
10091011 interface WebSocketOptions {
modified core/config/yaml/loadYaml.ts +1 −0
@@ -69,6 +69,7 @@
6969 command: server.command,
7070 args: server.args ?? [],
7171 env: server.env,
72+ cwd: server.cwd,
7273 } as any, // TODO: Fix the mcpServers types in config-yaml (discriminated union)
7374 timeout: server.connectionTimeout,
7475 };
added core/config/yaml/loadYaml.vitest.ts +128 −0
@@ -0,0 +1,128 @@
1+import { describe, it, expect } from "vitest";
2+import {
3+ validateConfigYaml,
4+ AssistantUnrolledNonNullable,
5+} from "@continuedev/config-yaml";
6+
7+describe("MCP Server cwd configuration", () => {
8+ describe("YAML schema validation", () => {
9+ it("should accept valid MCP server with cwd", () => {
10+ const config: AssistantUnrolledNonNullable = {
11+ name: "test-assistant",
12+ version: "1.0.0",
13+ mcpServers: [
14+ {
15+ name: "test-server",
16+ command: "node",
17+ args: ["server.js"],
18+ env: { NODE_ENV: "production" },
19+ cwd: "/path/to/project",
20+ connectionTimeout: 5000,
21+ },
22+ ],
23+ };
24+
25+ const errors = validateConfigYaml(config);
26+ expect(errors).toHaveLength(0);
27+ });
28+
29+ it("should accept MCP server without cwd", () => {
30+ const config: AssistantUnrolledNonNullable = {
31+ name: "test-assistant",
32+ version: "1.0.0",
33+ mcpServers: [
34+ {
35+ name: "test-server",
36+ command: "python",
37+ args: ["-m", "server"],
38+ },
39+ ],
40+ };
41+
42+ const errors = validateConfigYaml(config);
43+ expect(errors).toHaveLength(0);
44+ });
45+
46+ it("should accept relative paths in cwd", () => {
47+ const config: AssistantUnrolledNonNullable = {
48+ name: "test-assistant",
49+ version: "1.0.0",
50+ mcpServers: [
51+ {
52+ name: "test-server",
53+ command: "cargo",
54+ args: ["run"],
55+ cwd: "./rust-project",
56+ },
57+ ],
58+ };
59+
60+ const errors = validateConfigYaml(config);
61+ expect(errors).toHaveLength(0);
62+ });
63+
64+ it("should accept empty string cwd", () => {
65+ const config: AssistantUnrolledNonNullable = {
66+ name: "test-assistant",
67+ version: "1.0.0",
68+ mcpServers: [
69+ {
70+ name: "test-server",
71+ command: "deno",
72+ args: ["run", "server.ts"],
73+ cwd: "",
74+ },
75+ ],
76+ };
77+
78+ const errors = validateConfigYaml(config);
79+ expect(errors).toHaveLength(0);
80+ });
81+ });
82+
83+ describe("MCP server configuration examples", () => {
84+ it("should support common MCP server patterns with cwd", () => {
85+ const configs = [
86+ {
87+ name: "Local project MCP server",
88+ server: {
89+ name: "project-mcp",
90+ command: "npm",
91+ args: ["run", "mcp-server"],
92+ cwd: "/Users/developer/my-project",
93+ },
94+ },
95+ {
96+ name: "Python MCP with virtual environment",
97+ server: {
98+ name: "python-mcp",
99+ command: "python",
100+ args: ["-m", "my_mcp_server"],
101+ env: { PYTHONPATH: "./src" },
102+ cwd: "/home/user/python-project",
103+ },
104+ },
105+ {
106+ name: "Relative path MCP server",
107+ server: {
108+ name: "relative-mcp",
109+ command: "node",
110+ args: ["index.js"],
111+ cwd: "../mcp-servers/filesystem",
112+ },
113+ },
114+ ];
115+
116+ configs.forEach(({ name, server }) => {
117+ const config: AssistantUnrolledNonNullable = {
118+ name: "test-assistant",
119+ version: "1.0.0",
120+ mcpServers: [server],
121+ };
122+
123+ const errors = validateConfigYaml(config);
124+ expect(errors).toHaveLength(0);
125+ });
126+ });
127+ });
128+});
modified core/config/yaml/models.ts +7 −0
@@ -63,6 +63,7 @@
6363 template: model.promptTemplates?.chat,
6464 promptTemplates: model.promptTemplates,
6565 baseAgentSystemMessage: model.chatOptions?.baseAgentSystemMessage,
66+ basePlanSystemMessage: model.chatOptions?.basePlanSystemMessage,
6667 baseChatSystemMessage: model.chatOptions?.baseSystemMessage,
6768 capabilities: {
6869 tools: model.capabilities?.includes("tool_use"),
@@ -126,6 +127,12 @@
126127 if ("profile" in env && typeof env.profile === "string") {
127128 options.profile = env.profile;
128129 }
130+ if ("accessKeyId" in env && typeof env.accessKeyId === "string") {
131+ options.accessKeyId = env.accessKeyId;
132+ }
133+ if ("secretAccessKey" in env && typeof env.secretAccessKey === "string") {
134+ options.secretAccessKey = env.secretAccessKey;
135+ }
129136 if ("modelArn" in env && typeof env.modelArn === "string") {
130137 options.modelArn = env.modelArn;
131138 }
modified core/context/mcp/MCPConnection.ts +1 −0
@@ -329,6 +329,7 @@
329329 command,
330330 args,
331331 env,
332+ cwd: options.transport.cwd,
332333 stderr: "pipe",
333334 });
334335
modified core/context/mcp/MCPConnection.vitest.ts +22 −0
@@ -1,6 +1,7 @@
11 import { Client } from "@modelcontextprotocol/sdk/client/index.js";
22 import { beforeEach, describe, expect, it, vi } from "vitest";
33 import MCPConnection from "./MCPConnection";
4+import { StdioOptions } from "../../index.d.js";
45
56 describe("MCPConnection", () => {
67 beforeEach(() => {
@@ -25,6 +26,27 @@
2526 expect(conn.status).toBe("not-connected");
2627 });
2728
29+ it("should create instance with stdio transport including cwd", () => {
30+ const options = {
31+ name: "test-mcp",
32+ id: "test-id",
33+ transport: {
34+ type: "stdio" as const,
35+ command: "test-cmd",
36+ args: ["--test"],
37+ env: { TEST: "true" },
38+ cwd: "/path/to/working/directory",
39+ },
40+ };
41+
42+ const conn = new MCPConnection(options);
43+ expect(conn).toBeInstanceOf(MCPConnection);
44+ expect(conn.status).toBe("not-connected");
45+ if (conn.options.transport.type === "stdio") {
46+ expect(conn.options.transport.cwd).toBe("/path/to/working/directory");
47+ }
48+ });
49+
2850 it("should create instance with websocket transport", () => {
2951 const options = {
3052 name: "test-mcp",
modified core/index.d.ts +12 −3
@@ -428,7 +428,7 @@
428428 completion: string;
429429 }
430430
431-export type MessageModes = "chat" | "agent";
431+export type MessageModes = "chat" | "agent" | "plan";
432432
433433 export type ToolStatus =
434434 | "generating"
@@ -568,6 +568,7 @@
568568 title?: string;
569569 uniqueId?: string;
570570 baseAgentSystemMessage?: string;
571+ basePlanSystemMessage?: string;
571572 baseChatSystemMessage?: string;
572573 autocompleteOptions?: Partial<TabAutocompleteOptions>;
573574 contextLength?: number;
@@ -583,6 +584,7 @@
583584
584585 // continueProperties
585586 apiKeyLocation?: string;
587+ envSecretLocations?: Record<string, string>;
586588 apiBase?: string;
587589 orgScopeId?: string | null;
588590
@@ -611,6 +613,8 @@
611613 // AWS options
612614 profile?: string;
613615 modelArn?: string;
616+ accessKeyId?: string;
617+ secretAccessKey?: string;
614618
615619 // AWS and VertexAI Options
616620 region?: string;
@@ -1082,6 +1086,7 @@
10821086
10831087 apiBase?: string;
10841088 apiKeyLocation?: string;
1089+ envSecretLocations?: Record<string, string>;
10851090 orgScopeId?: string | null;
10861091
10871092 onPremProxyUrl?: string | null;
@@ -1091,6 +1096,7 @@
10911096 template?: TemplateType;
10921097 completionOptions?: BaseCompletionOptions;
10931098 baseAgentSystemMessage?: string;
1099+ basePlanSystemMessage?: string;
10941100 baseChatSystemMessage?: string;
10951101 requestOptions?: RequestOptions;
10961102 promptTemplates?: { [key: string]: string };
@@ -1162,6 +1168,7 @@
11621168 command: string;
11631169 args: string[];
11641170 env?: Record<string, string>;
1171+ cwd?: string;
11651172 requestOptions?: RequestOptions;
11661173 }
11671174
@@ -1636,9 +1643,11 @@
16361643
16371644 export type RuleSource =
16381645 | "default-chat"
1646+ | "default-plan"
16391647 | "default-agent"
1640- | "model-chat-options"
1641- | "model-agent-options"
1648+ | "model-options-chat"
1649+ | "model-options-plan"
1650+ | "model-options-agent"
16421651 | "rules-block"
16431652 | "json-systemMessage"
16441653 | ".continuerules";
modified core/llm/constants.ts +1 −0
@@ -15,6 +15,7 @@
1515 export enum LLMConfigurationStatuses {
1616 VALID = "valid",
1717 MISSING_API_KEY = "missing-api-key",
18+ MISSING_ENV_SECRET = "missing-env-secret",
1819 }
1920
2021 export {
modified core/llm/defaultSystemMessages.ts +15 −4
@@ -1,7 +1,4 @@
1-export const DEFAULT_CHAT_SYSTEM_MESSAGE_URL =
2- "https://github.com/continuedev/continue/blob/main/core/llm/defaultSystemMessages.ts";
3-
4-export const DEFAULT_AGENT_SYSTEM_MESSAGE_URL =
1+export const DEFAULT_SYSTEM_MESSAGES_URL =
52 "https://github.com/continuedev/continue/blob/main/core/llm/defaultSystemMessages.ts";
63
74 export const CODEBLOCK_FORMATTING_INSTRUCTIONS = `\
@@ -66,3 +63,17 @@
6663
6764 ${CODEBLOCK_FORMATTING_INSTRUCTIONS}
6865 </important_rules>`;
66+
67+// The note about read-only tools is for MCP servers
68+// For now, all MCP tools are included so model can decide if they are read-only
69+export const DEFAULT_PLAN_SYSTEM_MESSAGE = `\
70+<important_rules>
71+ You are in plan mode, in which you help the user understand and construct a plan.
72+ Only use read-only tools. Do not use any tools that would write to non-temporary files.
73+ If the user wants to make changes, offer that they can switch to Agent mode to give you access to write tools to make the suggested updates.
74+
75+${CODEBLOCK_FORMATTING_INSTRUCTIONS}
76+${EDIT_CODE_INSTRUCTIONS}
77+
78+ In plan mode, only write code when directly suggesting changes. Prioritize understanding and developing a plan.
79+</important_rules>`;
modified core/llm/index.ts +8 −0
@@ -141,6 +141,7 @@
141141
142142 title?: string;
143143 baseChatSystemMessage?: string;
144+ basePlanSystemMessage?: string;
144145 baseAgentSystemMessage?: string;
145146 contextLength: number;
146147 maxStopWords?: number | undefined;
@@ -155,6 +156,7 @@
155156
156157 // continueProperties
157158 apiKeyLocation?: string;
159+ envSecretLocations?: Record<string, string>;
158160 apiBase?: string;
159161 orgScopeId?: string | null;
160162
@@ -172,6 +174,8 @@
172174 accountId?: string;
173175 aiGatewaySlug?: string;
174176 profile?: string | undefined;
177+ accessKeyId?: string;
178+ secretAccessKey?: string;
175179
176180 // For IBM watsonx
177181 deploymentId?: string;
@@ -209,6 +213,7 @@
209213 this.title = options.title;
210214 this.uniqueId = options.uniqueId ?? "None";
211215 this.baseAgentSystemMessage = options.baseAgentSystemMessage;
216+ this.basePlanSystemMessage = options.basePlanSystemMessage;
212217 this.baseChatSystemMessage = options.baseChatSystemMessage;
213218 this.contextLength =
214219 options.contextLength ?? llmInfo?.contextLength ?? DEFAULT_CONTEXT_LENGTH;
@@ -246,6 +251,7 @@
246251
247252 // continueProperties
248253 this.apiKeyLocation = options.apiKeyLocation;
254+ this.envSecretLocations = options.envSecretLocations;
249255 this.orgScopeId = options.orgScopeId;
250256 this.apiBase = options.apiBase;
251257
@@ -270,6 +276,8 @@
270276 this.region = options.region;
271277 this.projectId = options.projectId;
272278 this.profile = options.profile;
279+ this.accessKeyId = options.accessKeyId;
280+ this.secretAccessKey = options.secretAccessKey;
273281
274282 this.openaiAdapter = this.createOpenAiAdapter();
275283
modified core/llm/llms/Bedrock.ts +11 −8
@@ -71,11 +71,7 @@
7171 if (!options.apiBase) {
7272 this.apiBase = `https://bedrock-runtime.${options.region}.amazonaws.com`;
7373 }
74- if (options.profile) {
75- this.profile = options.profile;
76- } else {
77- this.profile = "bedrock";
78- }
74+
7975 this.requestOptions = {
8076 region: options.region,
8177 headers: {},
@@ -609,17 +605,24 @@
609605 }
610606
611607 private async _getCredentials() {
608+ if (this.accessKeyId && this.secretAccessKey) {
609+ return {
610+ accessKeyId: this.accessKeyId,
611+ secretAccessKey: this.secretAccessKey,
612+ };
613+ }
614+ const profile = this.profile ?? "bedrock";
612615 try {
613616 return await fromNodeProviderChain({
614- profile: this.profile,
617+ profile: profile,
615618 ignoreCache: true,
616619 })();
617620 } catch (e) {
618621 console.warn(
619- `AWS profile with name ${this.profile} not found in ~/.aws/credentials, using default profile`,
622+ `AWS profile with name ${profile} not found in ~/.aws/credentials, using default profile`,
620623 );
621- return await fromNodeProviderChain()();
622624 }
625+ return await fromNodeProviderChain()();
623626 }
624627
625628 // EMBED //
modified core/llm/llms/index.ts +4 −4
@@ -8,7 +8,6 @@
88 LLMOptions,
99 } from "../..";
1010 import { renderTemplatedString } from "../../util/handlebars/renderTemplatedString";
11-import { DEFAULT_CHAT_SYSTEM_MESSAGE } from "../defaultSystemMessages";
1211 import { BaseLLM } from "../index";
1312 import Anthropic from "./Anthropic";
1413 import Asksage from "./Asksage";
@@ -141,9 +140,9 @@
141140
142141 let baseChatSystemMessage: string | undefined = undefined;
143142 if (desc.systemMessage !== undefined) {
144- baseChatSystemMessage = DEFAULT_CHAT_SYSTEM_MESSAGE;
145- baseChatSystemMessage += "\n\n";
146- baseChatSystemMessage += await renderTemplatedString(
143+ // baseChatSystemMessage = DEFAULT_CHAT_SYSTEM_MESSAGE;
144+ // baseChatSystemMessage += "\n\n";
145+ baseChatSystemMessage = await renderTemplatedString(
147146 Handlebars,
148147 desc.systemMessage,
149148 {},
@@ -163,6 +162,7 @@
163162 cls.defaultOptions?.completionOptions?.maxTokens,
164163 },
165164 baseChatSystemMessage,
165+ basePlanSystemMessage: baseChatSystemMessage,
166166 baseAgentSystemMessage: baseChatSystemMessage,
167167 logger: llmLogger,
168168 uniqueId,
modified core/llm/llms/stubs/ContinueProxy.ts +17 −4
@@ -40,6 +40,7 @@
4040 this.apiType = undefined;
4141 this.actualApiBase = options.apiBase;
4242 this.apiKeyLocation = options.apiKeyLocation;
43+ this.envSecretLocations = options.envSecretLocations;
4344 this.orgScopeId = options.orgScopeId;
4445 this.onPremProxyUrl = options.onPremProxyUrl;
4546 if (this.onPremProxyUrl) {
@@ -60,6 +61,7 @@
6061 protected extraBodyProperties(): Record<string, any> {
6162 const continueProperties: ContinueProperties = {
6263 apiKeyLocation: this.apiKeyLocation,
64+ envSecretLocations: this.envSecretLocations,
6365 apiBase: this.actualApiBase,
6466 orgScopeId: this.orgScopeId ?? null,
6567 env: this.configEnv,
@@ -70,13 +72,24 @@
7072 }
7173
7274 getConfigurationStatus() {
73- if (!this.apiKeyLocation) {
75+ if (!this.apiKeyLocation && !this.envSecretLocations) {
7476 return LLMConfigurationStatuses.VALID;
7577 }
7678
77- const secretLocation = decodeSecretLocation(this.apiKeyLocation);
78- if (secretLocation.secretType === SecretType.NotFound) {
79- return LLMConfigurationStatuses.MISSING_API_KEY;
79+ if (this.apiKeyLocation) {
80+ const secretLocation = decodeSecretLocation(this.apiKeyLocation);
81+ if (secretLocation.secretType === SecretType.NotFound) {
82+ return LLMConfigurationStatuses.MISSING_API_KEY;
83+ }
84+ }
85+
86+ if (this.envSecretLocations) {
87+ for (const secretLocation of Object.values(this.envSecretLocations)) {
88+ const decoded = decodeSecretLocation(secretLocation);
89+ if (decoded.secretType === SecretType.NotFound) {
90+ return LLMConfigurationStatuses.MISSING_ENV_SECRET;
91+ }
92+ }
8093 }
8194
8295 return LLMConfigurationStatuses.VALID;
modified core/llm/toolSupport.ts +3 −0
@@ -19,6 +19,7 @@
1919 "claude-3-7",
2020 "claude-3.7",
2121 "claude-sonnet-4",
22+ "claude-4-sonnet",
2223 "gpt-4",
2324 "o3",
2425 "gemini",
@@ -33,6 +34,7 @@
3334 "claude-3-7",
3435 "claude-3.7",
3536 "claude-sonnet-4",
37+ "claude-4-sonnet",
3638 "claude-opus-4",
3739 ].some((part) => model.toLowerCase().startsWith(part))
3840 ) {
@@ -95,6 +97,7 @@
9597 "claude-3-7-sonnet",
9698 "claude-3.7-sonnet",
9799 "claude-sonnet-4",
100+ "claude-4-sonnet",
98101 "claude-opus-4",
99102 "nova-lite",
100103 "nova-pro",
modified core/tools/definitions/searchAndReplaceInFile.ts +5 −1
@@ -56,7 +56,11 @@
5656 * Include just the changing lines, and a few surrounding lines if needed for uniqueness.
5757 * Do not include long runs of unchanging lines in SEARCH/REPLACE blocks.
5858 * Each line must be complete. Never truncate lines mid-way through as this can cause matching failures.
59-4. Special operations:
59+4. Splitting up tool calls:
60+ * When making multiple closely related edits to the same file, you should try to use multiple SEARCH/REPLACE blocks in a single tool call, rather than making multiple separate tool calls
61+ * If you need to make follow up edits or group your work into logical segments, it is okay to perform additional tool calls
62+ * DO NOT make back-to-back tool calls. Instead interleave with brief explanation of what each will do. For example, instead of [explanation, tool call, tool call] you should do [explanation, tool call, explanation, tool call]
63+5. Special operations:
6064 * To move code: Use two SEARCH/REPLACE blocks (one to delete from original + one to insert at new location)
6165 * To delete code: Use empty REPLACE section
6266
modified core/tools/implementations/fetchUrlContent.ts +29 −1
@@ -1,6 +1,34 @@
11 import { ToolImpl } from ".";
22 import { getUrlContextItems } from "../../context/providers/URLContextProvider";
33
4+const DEFAULT_FETCH_URL_CHAR_LIMIT = 20000;
5+
46 export const fetchUrlContentImpl: ToolImpl = async (args, extras) => {
5- return getUrlContextItems(args.url, extras.fetch);
7+ const contextItems = await getUrlContextItems(args.url, extras.fetch);
8+
9+ // Track truncated content
10+ const truncatedUrls: string[] = [];
11+
12+ // Check and truncate each context item
13+ const processedItems = contextItems.map((item) => {
14+ if (item.content.length > DEFAULT_FETCH_URL_CHAR_LIMIT) {
15+ truncatedUrls.push(args.url);
16+ return {
17+ ...item,
18+ content: item.content.substring(0, DEFAULT_FETCH_URL_CHAR_LIMIT),
19+ };
20+ }
21+ return item;
22+ });
23+
24+ // Add truncation warning if needed
25+ if (truncatedUrls.length > 0) {
26+ processedItems.push({
27+ name: "URL content truncation warning",
28+ description: "Informs that URL content was truncated",
29+ content: `The content from ${truncatedUrls.join(", ")} was truncated because it exceeded the ${DEFAULT_FETCH_URL_CHAR_LIMIT} character limit. If you need more content, consider fetching specific sections or using a more targeted approach.`,
30+ });
31+ }
32+
33+ return processedItems;
634 };
added core/tools/implementations/fetchUrlContent.vitest.ts +91 −0
@@ -0,0 +1,91 @@
1+import { expect, test, vi } from "vitest";
2+import { fetchUrlContentImpl } from "./fetchUrlContent";
3+
4+vi.mock("../../context/providers/URLContextProvider", () => ({
5+ getUrlContextItems: vi.fn(),
6+}));
7+
8+import { ToolExtras } from "../..";
9+import { getUrlContextItems } from "../../context/providers/URLContextProvider";
10+const mockExtras = {
11+ fetch: vi.fn() as any,
12+ ide: {} as any,
13+} as unknown as ToolExtras;
14+
15+test("fetchUrlContent should not truncate content under character limit", async () => {
16+ const shortContent = "This is a short content";
17+ const mockContextItems = [
18+ {
19+ name: "Test URL",
20+ description: "Test URL description",
21+ content: shortContent,
22+ },
23+ ];
24+
25+ (getUrlContextItems as any).mockResolvedValue(mockContextItems);
26+
27+ const result = await fetchUrlContentImpl(
28+ { url: "https://example.com" },
29+ mockExtras,
30+ );
31+
32+ expect(result).toHaveLength(1);
33+ expect(result[0].content).toBe(shortContent);
34+});
35+
36+test("fetchUrlContent should truncate content exceeding character limit", async () => {
37+ const DEFAULT_FETCH_URL_CHAR_LIMIT = 20000;
38+ // Create a string exceeding the character limit
39+ const longContent = "a".repeat(DEFAULT_FETCH_URL_CHAR_LIMIT + 1000);
40+ const mockContextItems = [
41+ {
42+ name: "Test URL",
43+ description: "Test URL description",
44+ content: longContent,
45+ },
46+ ];
47+
48+ (getUrlContextItems as any).mockResolvedValue(mockContextItems);
49+
50+ const result = await fetchUrlContentImpl(
51+ { url: "https://example.com" },
52+ mockExtras,
53+ );
54+
55+ expect(result).toHaveLength(2); // Original item + warning
56+ expect(result[0].content.length).toBe(DEFAULT_FETCH_URL_CHAR_LIMIT);
57+ expect(result[1].name).toBe("URL content truncation warning");
58+ expect(result[1].content).toContain("was truncated");
59+ expect(result[1].content).toContain("20000 character limit");
60+});
61+
62+test("fetchUrlContent should add truncation warning with multiple truncated items", async () => {
63+ const DEFAULT_FETCH_URL_CHAR_LIMIT = 20000;
64+ // Create strings exceeding the character limit
65+ const longContent1 = "a".repeat(DEFAULT_FETCH_URL_CHAR_LIMIT + 500);
66+ const longContent2 = "b".repeat(DEFAULT_FETCH_URL_CHAR_LIMIT + 1000);
67+ const mockContextItems = [
68+ {
69+ name: "Test URL 1",
70+ description: "Test URL description 1",
71+ content: longContent1,
72+ },
73+ {
74+ name: "Test URL 2",
75+ description: "Test URL description 2",
76+ content: longContent2,
77+ },
78+ ];
79+
80+ (getUrlContextItems as any).mockResolvedValue(mockContextItems);
81+
82+ const result = await fetchUrlContentImpl(
83+ { url: "https://example.com" },
84+ mockExtras,
85+ );
86+
87+ expect(result).toHaveLength(3); // Two original items + warning
88+ expect(result[0].content.length).toBe(DEFAULT_FETCH_URL_CHAR_LIMIT);
89+ expect(result[1].content.length).toBe(DEFAULT_FETCH_URL_CHAR_LIMIT);
90+ expect(result[2].name).toBe("URL content truncation warning");
91+});
modified core/tools/implementations/lsTool.ts +38 −9
@@ -2,30 +2,59 @@
22 import { walkDir } from "../../indexing/walkDir";
33 import { resolveRelativePathInDir } from "../../util/ideUtils";
44
5+export function resolveLsToolDirPath(dirPath: string | undefined) {
6+ if (!dirPath || dirPath === ".") {
7+ return "/";
8+ }
9+ if (dirPath.startsWith(".")) {
10+ return dirPath.slice(1);
11+ }
12+ return dirPath.replace(/\\/g, "/");
13+}
14+
15+const MAX_LS_TOOL_LINES = 200;
16+
517 export const lsToolImpl: ToolImpl = async (args, extras) => {
6- const uri = await resolveRelativePathInDir(args.dirPath, extras.ide);
18+ const dirPath = resolveLsToolDirPath(args?.dirPath);
19+ const uri = await resolveRelativePathInDir(dirPath, extras.ide);
720 if (!uri) {
821 throw new Error(
9- `Directory ${args.dirPath} not found. Make sure to use forward-slash paths. Do not use e.g. "."`,
22+ `Directory ${args.dirPath} not found. Make sure to use forward-slash paths`,
1023 );
1124 }
1225
1326 const entries = await walkDir(uri, extras.ide, {
1427 returnRelativeUrisPaths: true,
1528 include: "both",
16- recursive: args.recursive ?? false,
29+ recursive: args?.recursive ?? false,
1730 });
1831
19- const content =
20- entries.length > 0
21- ? entries.join("\n")
22- : `No files/folders found in ${args.dirPath}`;
32+ const lines = entries.slice(0, MAX_LS_TOOL_LINES);
2333
24- return [
34+ let content =
35+ lines.length > 0
36+ ? lines.join("\n")
37+ : `No files/folders found in ${dirPath}`;
38+
39+ const contextItems = [
2540 {
2641 name: "File/folder list",
27- description: `Files/folders in ${args.dirPath}`,
42+ description: `Files/folders in ${dirPath}`,
2843 content,
2944 },
3045 ];
46+
47+ if (entries.length > MAX_LS_TOOL_LINES) {
48+ let warningContent = `${entries.length - MAX_LS_TOOL_LINES} ls entries were truncated`;
49+ if (args?.recursive) {
50+ warningContent += ". Try using a non-recursive search";
51+ }
52+ contextItems.push({
53+ name: "ls truncation warning",
54+ description: "Informs the model that ls results were truncated",
55+ content: warningContent,
56+ });
57+ }
58+
59+ return contextItems;
3160 };
added core/tools/implementations/lsTool.vitest.ts +96 −0
@@ -0,0 +1,96 @@
1+import { expect, test, vi } from "vitest";
2+import { ToolExtras } from "../..";
3+import * as walkDirModule from "../../indexing/walkDir";
4+import { lsToolImpl, resolveLsToolDirPath } from "./lsTool";
5+
6+vi.mock("../../indexing/walkDir");
7+
8+const mockExtras = {
9+ ide: {
10+ fileExists: async (path: string) => true,
11+ getWorkspaceDirs: async () => ["dir1"],
12+ },
13+} as unknown as ToolExtras;
14+
15+test("resolveLsToolDirPath handles undefined path", () => {
16+ expect(resolveLsToolDirPath(undefined)).toBe("/");
17+});
18+
19+test("resolveLsToolDirPath handles empty string", () => {
20+ expect(resolveLsToolDirPath("")).toBe("/");
21+});
22+
23+test("resolveLsToolDirPath handles dot", () => {
24+ expect(resolveLsToolDirPath(".")).toBe("/");
25+});
26+
27+test("resolveLsToolDirPath handles dot relative", () => {
28+ expect(resolveLsToolDirPath("./hi")).toBe("/hi");
29+});
30+
31+test("resolveLsToolDirPath normalizes backslashes to forward slashes", () => {
32+ expect(resolveLsToolDirPath("path\\to\\dir")).toBe("path/to/dir");
33+});
34+
35+test("resolveLsToolDirPath preserves forward slashes", () => {
36+ expect(resolveLsToolDirPath("path/to/dir")).toBe("path/to/dir");
37+});
38+
39+test("lsToolImpl truncates output when entries exceed MAX_LS_TOOL_LINES", async () => {
40+ // Generate more than MAX_LS_TOOL_LINES entries (which is 200)
41+ const mockEntries = Array.from({ length: 250 }, (_, i) => `file${i}.txt`);
42+
43+ // Mock walkDir to return our large array
44+ vi.spyOn(walkDirModule, "walkDir").mockResolvedValue(mockEntries);
45+
46+ const result = await lsToolImpl(
47+ { dirPath: "testDir", recursive: true },
48+ mockExtras,
49+ );
50+
51+ // Check that the result contains the truncation message
52+ expect(result.length).toBe(2);
53+ expect(result[0].content).toContain("file1.txt");
54+ expect(result[0].content).toContain("file199.txt");
55+ expect(result[1].content).toContain("Try using a non-recursive search");
56+ expect(result[1].content).toContain("50 ls entries were truncated");
57+
58+ // Check that only MAX_LS_TOOL_LINES entries are included
59+ const contentLines = result[0].content.split("\n");
60+ // Account for the truncation message line
61+ expect(contentLines.length).toBe(200);
62+
63+ // Check the suggestion to use non-recursive search is included
64+ expect(result[1].content).toContain("Try using a non-recursive search");
65+});
66+
67+test("lsToolImpl shows truncation message without suggestion for non-recursive search", async () => {
68+ // Generate more than MAX_LS_TOOL_LINES entries
69+ const mockEntries = Array.from({ length: 250 }, (_, i) => `file${i}.txt`);
70+
71+ // Mock walkDir to return our large array
72+ vi.spyOn(walkDirModule, "walkDir").mockResolvedValue(mockEntries);
73+
74+ const result = await lsToolImpl(
75+ { dirPath: "testDir", recursive: false },
76+ mockExtras,
77+ );
78+
79+ // Check that the result contains the truncation message
80+ expect(result.length).toBe(2);
81+ expect(result[1].content).toContain("50 ls entries were truncated");
82+
83+ // Check that the suggestion to use non-recursive search is NOT included
84+ expect(result[1].content).not.toContain("Try using a non-recursive search");
85+});
86+
87+test("lsToolImpl shows message when no files are found", async () => {
88+ // Mock walkDir to return empty array
89+ vi.spyOn(walkDirModule, "walkDir").mockResolvedValue([]);
90+
91+ const result = await lsToolImpl({ dirPath: "emptyDir" }, mockExtras);
92+
93+ // Check that the result contains the "no files found" message
94+ expect(result.length).toBe(1);
95+ expect(result[0].content).toBe("No files/folders found in emptyDir");
96+});
modified core/tools/implementations/searchWeb.ts +30 −2
@@ -1,8 +1,36 @@
1+import { ToolImpl } from ".";
12 import { fetchSearchResults } from "../../context/providers/WebContextProvider";
23
3-import { ToolImpl } from ".";
4+const DEFAULT_WEB_SEARCH_CHAR_LIMIT = 8000;
45
56 export const searchWebImpl: ToolImpl = async (args, extras) => {
67 const webResults = await fetchSearchResults(args.query, 5, extras.fetch);
7- return webResults;
8+
9+ // Track truncated results
10+ const truncatedResults: string[] = [];
11+
12+ // Check and truncate each result
13+ const processedResults = webResults.map((result, index) => {
14+ if (result.content.length > DEFAULT_WEB_SEARCH_CHAR_LIMIT) {
15+ truncatedResults.push(
16+ result.name || result.description || `Result #${index + 1}`,
17+ );
18+ return {
19+ ...result,
20+ content: result.content.substring(0, DEFAULT_WEB_SEARCH_CHAR_LIMIT),
21+ };
22+ }
23+ return result;
24+ });
25+
26+ // Add truncation warning if needed
27+ if (truncatedResults.length > 0) {
28+ processedResults.push({
29+ name: "Web search truncation warning",
30+ description: "Informs that search results were truncated",
31+ content: `The content from the following search results was truncated because it exceeded the ${DEFAULT_WEB_SEARCH_CHAR_LIMIT} character limit: ${truncatedResults.join(", ")}. For more detailed information, consider refining your search query.`,
32+ });
33+ }
34+
35+ return processedResults;
836 };
added core/tools/implementations/searchWeb.vitest.ts +107 −0
@@ -0,0 +1,107 @@
1+import { expect, test, vi } from "vitest";
2+import { searchWebImpl } from "./searchWeb";
3+
4+// Mock the fetchSearchResults function
5+vi.mock("../../context/providers/WebContextProvider", () => ({
6+ fetchSearchResults: vi.fn(),
7+}));
8+const mockExtras = {
9+ fetch: vi.fn() as any,
10+ ide: {} as any,
11+} as unknown as ToolExtras;
12+
13+import { ToolExtras } from "../..";
14+import { fetchSearchResults } from "../../context/providers/WebContextProvider";
15+
16+test("searchWeb should not truncate results under character limit", async () => {
17+ const shortContent = "This is a short search result content";
18+ const mockSearchResults = [
19+ {
20+ name: "Result 1",
21+ description: "Search result description 1",
22+ content: shortContent,
23+ },
24+ {
25+ name: "Result 2",
26+ description: "Search result description 2",
27+ content: shortContent,
28+ },
29+ ];
30+
31+ (fetchSearchResults as any).mockResolvedValue(mockSearchResults);
32+
33+ const result = await searchWebImpl({ query: "test query" }, mockExtras);
34+
35+ expect(result).toHaveLength(2);
36+ expect(result[0].content).toBe(shortContent);
37+ expect(result[1].content).toBe(shortContent);
38+});
39+
40+test("searchWeb should truncate results exceeding character limit", async () => {
41+ const DEFAULT_WEB_SEARCH_CHAR_LIMIT = 8000;
42+ // Create a string exceeding the character limit
43+ const longContent = "a".repeat(DEFAULT_WEB_SEARCH_CHAR_LIMIT + 1000);
44+ const shortContent = "This is a short search result content";
45+ const mockSearchResults = [
46+ {
47+ name: "Result 1",
48+ description: "Search result description 1",
49+ content: longContent,
50+ },
51+ {
52+ name: "Result 2",
53+ description: "Search result description 2",
54+ content: shortContent,
55+ },
56+ ];
57+
58+ (fetchSearchResults as any).mockResolvedValue(mockSearchResults);
59+
60+ const result = await searchWebImpl({ query: "test query" }, mockExtras);
61+
62+ expect(result).toHaveLength(3); // Two results + warning
63+ expect(result[0].content.length).toBe(DEFAULT_WEB_SEARCH_CHAR_LIMIT);
64+ expect(result[1].content).toBe(shortContent);
65+ expect(result[2].name).toBe("Web search truncation warning");
66+ expect(result[2].content).toContain("truncated");
67+ expect(result[2].content).toContain("Result 1");
68+ expect(result[2].content).not.toContain("Result 2");
69+});
70+
71+test("searchWeb should include all truncated results in the warning", async () => {
72+ const DEFAULT_WEB_SEARCH_CHAR_LIMIT = 8000;
73+ // Create strings exceeding the character limit
74+ const longContent1 = "a".repeat(DEFAULT_WEB_SEARCH_CHAR_LIMIT + 500);
75+ const longContent2 = "b".repeat(DEFAULT_WEB_SEARCH_CHAR_LIMIT + 1000);
76+ const shortContent = "This is a short search result content";
77+ const mockSearchResults = [
78+ {
79+ name: "Result 1",
80+ description: "Search result description 1",
81+ content: longContent1,
82+ },
83+ {
84+ name: "Result 2",
85+ description: "Search result description 2",
86+ content: longContent2,
87+ },
88+ {
89+ name: "Result 3",
90+ description: "Search result description 3",
91+ content: shortContent,
92+ },
93+ ];
94+
95+ (fetchSearchResults as any).mockResolvedValue(mockSearchResults);
96+
97+ const result = await searchWebImpl({ query: "test query" }, mockExtras);
98+
99+ expect(result).toHaveLength(4); // Three results + warning
100+ expect(result[0].content.length).toBe(DEFAULT_WEB_SEARCH_CHAR_LIMIT);
101+ expect(result[1].content.length).toBe(DEFAULT_WEB_SEARCH_CHAR_LIMIT);
102+ expect(result[2].content).toBe(shortContent);
103+ expect(result[3].name).toBe("Web search truncation warning");
104+ expect(result[3].content).toContain("Result 1");
105+ expect(result[3].content).toContain("Result 2");
106+ expect(result[3].content).not.toContain("Result 3");
107+});
modified core/tools/implementations/viewDiff.ts +26 −2
@@ -1,15 +1,39 @@
11 import { ToolImpl } from ".";
2+import { ContextItem } from "../..";
23 import { getDiffsFromCache } from "../../autocomplete/snippets/gitDiffCache";
34
5+export const DEFAULT_GIT_DIFF_LINE_LIMIT = 5000;
6+
47 export const viewDiffImpl: ToolImpl = async (args, extras) => {
58 const diffs = await getDiffsFromCache(extras.ide); // const diffs = await extras.ide.getDiff(true);
69 // TODO includeUnstaged should be an option
710
8- return [
11+ const combinedDiff = diffs.join("\n");
12+ const diffLines = combinedDiff.split("\n");
13+
14+ let truncated = false;
15+ let processedDiff = combinedDiff;
16+
17+ if (diffLines.length > DEFAULT_GIT_DIFF_LINE_LIMIT) {
18+ truncated = true;
19+ processedDiff = diffLines.slice(0, DEFAULT_GIT_DIFF_LINE_LIMIT).join("\n");
20+ }
21+
22+ const contextItems: ContextItem[] = [
923 {
1024 name: "Diff",
1125 description: "The current git diff",
12- content: diffs.join("\n"),
26+ content: processedDiff,
1327 },
1428 ];
29+
30+ if (truncated) {
31+ contextItems.push({
32+ name: "Diff truncation warning",
33+ description: "Informs that git diff was truncated",
34+ content: `The git diff was truncated because it exceeded ${DEFAULT_GIT_DIFF_LINE_LIMIT} lines. Consider viewing specific files or focusing on smaller changes.`,
35+ });
36+ }
37+
38+ return contextItems;
1539 };
added core/tools/implementations/viewDiff.vitest.ts +87 −0
@@ -0,0 +1,87 @@
1+import { expect, test, vi } from "vitest";
2+import { DEFAULT_GIT_DIFF_LINE_LIMIT, viewDiffImpl } from "./viewDiff";
3+
4+// Mock the getDiffsFromCache function
5+vi.mock("../../autocomplete/snippets/gitDiffCache", () => ({
6+ getDiffsFromCache: vi.fn(),
7+}));
8+
9+import { ToolExtras } from "../..";
10+import { getDiffsFromCache } from "../../autocomplete/snippets/gitDiffCache";
11+const mockExtras = {
12+ fetch: vi.fn() as any,
13+ ide: {} as any,
14+} as unknown as ToolExtras;
15+
16+test("viewDiff should not truncate diffs under line limit", async () => {
17+ // Create a small diff with just a few lines
18+ const smallDiff = [
19+ "diff --git a/file1.txt b/file1.txt",
20+ "index 1234..5678 100644",
21+ "--- a/file1.txt",
22+ "+++ b/file1.txt",
23+ "@@ -1,3 +1,4 @@",
24+ " line1",
25+ "-line2",
26+ "+line2 modified",
27+ "+line3 added",
28+ ];
29+
30+ (getDiffsFromCache as any).mockResolvedValue(smallDiff);
31+
32+ const result = await viewDiffImpl({}, mockExtras);
33+
34+ expect(result).toHaveLength(1); // Just the diff, no warning
35+ expect(result[0].name).toBe("Diff");
36+ expect(result[0].content).toBe(smallDiff.join("\n"));
37+});
38+
39+test("viewDiff should truncate diffs exceeding line limit", async () => {
40+ // Create a large diff that exceeds the line limit
41+ const largeDiffLines = Array(DEFAULT_GIT_DIFF_LINE_LIMIT + 1000).fill(
42+ "line content",
43+ );
44+ const largeDiff = [
45+ "diff --git a/file1.txt b/file1.txt",
46+ "index 1234..5678 100644",
47+ ...largeDiffLines,
48+ ];
49+
50+ (getDiffsFromCache as any).mockResolvedValue([largeDiff.join("\n")]);
51+
52+ const result = await viewDiffImpl({}, mockExtras);
53+
54+ expect(result).toHaveLength(2); // Diff + warning
55+
56+ // Count the number of lines in the result
57+ const resultLines = result[0].content.split("\n");
58+ expect(resultLines.length).toBe(DEFAULT_GIT_DIFF_LINE_LIMIT);
59+
60+ // Check the warning
61+ expect(result[1].name).toBe("Diff truncation warning");
62+ expect(result[1].content).toContain("truncated");
63+ expect(result[1].content).toContain(`${DEFAULT_GIT_DIFF_LINE_LIMIT} lines`);
64+});
65+
66+test("viewDiff should handle multiple diffs correctly", async () => {
67+ const DEFAULT_GIT_DIFF_LINE_LIMIT = 5000;
68+
69+ // Create multiple diffs that together exceed the line limit
70+ const diff1Lines = Array(3000).fill("diff1 line");
71+ const diff2Lines = Array(3000).fill("diff2 line");
72+ const diff1 = diff1Lines.join("\n");
73+ const diff2 = diff2Lines.join("\n");
74+
75+ (getDiffsFromCache as any).mockResolvedValue([diff1, diff2]);
76+
77+ const result = await viewDiffImpl({}, mockExtras);
78+
79+ expect(result).toHaveLength(2); // Diff + warning
80+
81+ // Count the number of lines in the result
82+ const resultLines = result[0].content.split("\n");
83+ expect(resultLines.length).toBe(DEFAULT_GIT_DIFF_LINE_LIMIT);
84+
85+ // Check the warning
86+ expect(result[1].name).toBe("Diff truncation warning");
87+});
modified core/tools/index.ts +6 −7
@@ -39,14 +39,13 @@
3939 params: ConfigDependentToolParams,
4040 ): Tool[] => [
4141 requestRuleTool(params),
42+ // Search and replace is now generally available
43+ searchAndReplaceInFileTool,
44+ // Keep edit file tool available for models that need it
45+ editFileTool,
4246 ...(params.enableExperimentalTools
43- ? [
44- searchAndReplaceInFileTool,
45- viewRepoMapTool,
46- viewSubdirectoryTool,
47- codebaseTool,
48- ]
49- : [editFileTool]),
47+ ? [viewRepoMapTool, viewSubdirectoryTool, codebaseTool]
48+ : []),
5049 ];
5150
5251 export const getToolsForIde = async (ide: IDE): Promise<Tool[]> =>
modified docs/docs/customize/deep-dives/mcp.mdx +13 −2
@@ -110,6 +110,7 @@
110110 - `type` (optional): The type of the MCP server: `sse`, `stdio`, `streamable-http`
111111 - `args` (optional): Arguments to pass to the command.
112112 - `env` (optional): Secrets to be injected into the command as environment variables.
113+- `cwd` (optional): Working directory to run the command in. Can be absolute or relative path.
113114
114115 ### Transport Types
115116
@@ -132,12 +133,22 @@
132133
133134 ```yaml
134135 mcpServers:
135- - name: Name
136+ - name: SQLite Server
136137 type: stdio
137138 command: npx
138139 args:
139140 - "@modelcontextprotocol/server-sqlite"
140- - "/path/to/your/database.db"
141+ - "./database.db"
142+ cwd: "/path/to/project"
143+
144+ - name: Local Project Server
145+ command: npm
146+ args:
147+ - "run"
148+ - "mcp-server"
149+ cwd: "./my-project"
150+ env:
151+ NODE_ENV: "production"
141152 ```
142153
143154 #### Streamable HTTP Transport
modified docs/docs/customize/yaml-migration.mdx +1 −0
@@ -288,6 +288,7 @@
288288 - `command` (**required**): The command used to start the server.
289289 - `args`: An optional array of arguments for the command.
290290 - `env`: An optional map of environment variables for the server process.
291+- `cwd`: An optional working directory to run the command in. Can be absolute or relative path.
291292
292293 **Before**
293294
modified docs/docs/reference.mdx +5 −1
@@ -384,6 +384,7 @@
384384 - `command` (**required**): The command used to start the server.
385385 - `args`: An optional array of arguments for the command.
386386 - `env`: An optional map of environment variables for the server process.
387+- `cwd`: An optional working directory to run the command in. Can be absolute or relative path.
387388 - `connectionTimeout`: An optional connection timeout number to the server in milliseconds.
388389
389390 **Example:**
@@ -395,7 +396,10 @@
395396 args:
396397 - mcp-server-sqlite
397398 - --db-path
398- - /Users/NAME/test.db
399+ - ./test.db
400+ cwd: /Users/NAME/project
401+ env:
402+ NODE_ENV: production
399403 ```
400404
401405 ### `data`
modified extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/error/ContinueErrorService.kt +8 −1
@@ -21,6 +21,7 @@
2121 init {
2222 Sentry.init { config ->
2323 config.dsn = SENTRY_DSN
24+ config.environment = recognizeEnvironment()
2425 config.isSendDefaultPii = false
2526 config.setTag("ide_version", ApplicationInfo.getInstance().build.asString())
2627 config.setTag("jcef_supported", JBCefApp.isSupported().toString())
@@ -45,6 +46,12 @@
4546 private const val PLUGIN_ID = "com.github.continuedev.continueintellijextension"
4647 private const val SENTRY_DSN =
4748 "https://fe99934dcdc537d84209893a3f96a196@o4505462064283648.ingest.us.sentry.io/4508184596054016"
48- }
4949
50+ private fun recognizeEnvironment() =
51+ when {
52+ System.getProperty("robot-server.port") != null -> "e2e"
53+ System.getProperty("idea.is.internal").toBoolean() -> "dev"
54+ else -> "production"
55+ }
56+ }
5057 }
No newline at the end of the file
modified extensions/vscode/config_schema.json +21 −1
@@ -359,8 +359,18 @@
359359 "description": "The AWS security profile to use",
360360 "type": "string"
361361 },
362+ "accessKeyId": {
363+ "title": "Access Key ID",
364+ "description": "AWS access key id (can be used together with secretAccessKey in place of profile)",
365+ "type": "string"
366+ },
367+ "secretAccessKey": {
368+ "title": "Secret Access Key",
369+ "description": "AWS secret access key (can be used together with secretAccessKey in place of profile)",
370+ "type": "string"
371+ },
362372 "modelArn": {
363- "title": "Profile",
373+ "title": "Model ARN",
364374 "description": "The AWS arn for the imported model",
365375 "type": "string"
366376 },
@@ -2903,6 +2913,16 @@
29032913 "title": "Profile",
29042914 "description": "The AWS security profile to use",
29052915 "type": "string"
2916+ },
2917+ "accessKeyId": {
2918+ "title": "Access Key ID",
2919+ "description": "AWS access key id (can be used together with secretAccessKey in place of profile)",
2920+ "type": "string"
2921+ },
2922+ "secretAccessKey": {
2923+ "title": "Secret Access Key",
2924+ "description": "AWS secret access key (can be used together with secretAccessKey in place of profile)",
2925+ "type": "string"
29062926 }
29072927 },
29082928 "required": ["provider"],
modified extensions/vscode/e2e/tests/GUI.test.ts +0 −14
@@ -357,20 +357,6 @@
357357 await messageInput.sendKeys(Key.ENTER);
358358 await messageInput.sendKeys(Key.ENTER);
359359
360- // Open the context items peek
361- const contextItemsPeek = await GUISelectors.getContextItemsPeek(view);
362- await contextItemsPeek.click();
363-
364- await TestUtils.waitForSuccess(async () => {
365- const firstContextItemInPeek =
366- await GUISelectors.getFirstContextItemsPeekItem(view);
367- await firstContextItemInPeek.click();
368-
369- // Check that item is there with correct name
370- const description = await firstContextItemInPeek.getText();
371- expect(description).to.include("Terminal");
372- });
373-
374360 // Check that the contents match what we expect (repeated back by the mock LLM)
375361 await TestUtils.waitForSuccess(() => {
376362 return GUISelectors.getThreadMessageByText(
modified extensions/vscode/package-lock.json +0 −0

Not shown: the file is larger than the hub shows, or this page holds as much as it shows. View the file.

modified extensions/vscode/package.json +1 −1
@@ -2,7 +2,7 @@
22 "name": "continue",
33 "icon": "media/icon.png",
44 "author": "Continue Dev, Inc",
5- "version": "1.1.57",
5+ "version": "1.1.59",
66 "repository": {
77 "type": "git",
88 "url": "https://github.com/continuedev/continue"
modified extensions/vscode/src/diff/vertical/handler.ts +21 −3
@@ -174,9 +174,12 @@
174174 // Clear deletion buffer
175175 await this.insertDeletionBuffer();
176176
177- await this.reapplyWithMyersDiff(diffLines);
178-
179- const range = new vscode.Range(this.startLine, 0, this.startLine, 0);
177+ const myersDiffs = await this.reapplyWithMyersDiff(diffLines);
178+
179+ // Scroll to the first diff
180+ const scrollToLine =
181+ this.getFirstChangedLine(myersDiffs) ?? this.startLine;
182+ const range = new vscode.Range(scrollToLine, 0, scrollToLine, 0);
180183 this.editor.revealRange(range, vscode.TextEditorRevealType.Default);
181184
182185 this.options.onStatusUpdate(
@@ -370,6 +373,8 @@
370373
371374 this.editorToVerticalDiffCodeLens.set(this.fileUri, codeLensBlocks);
372375 this.refreshCodeLens();
376+
377+ return myersDiffs;
373378 }
374379
375380 private async insertDeletionBuffer() {
@@ -550,4 +555,17 @@
550555
551556 this.refreshCodeLens();
552557 }
558+
559+ /**
560+ * Gets the first line number that was changed in a diff
561+ */
562+ private getFirstChangedLine(diff: DiffLine[]): number | null {
563+ for (let i = 0; i < diff.length; i++) {
564+ const item = diff[i];
565+ if (item.type === "old" || item.type === "new") {
566+ return this.startLine + i;
567+ }
568+ }
569+ return null;
570+ }
553571 }
modified extensions/vscode/src/stubs/WorkOsAuthProvider.ts +22 −22
@@ -77,6 +77,7 @@
7777 { promise: Promise<string>; cancel: EventEmitter<void> }
7878 >();
7979 private _refreshInterval: NodeJS.Timeout | null = null;
80+ private _isRefreshing = false;
8081
8182 private static EXPIRATION_TIME_MS = 1000 * 60 * 15; // 15 minutes
8283 private static REFRESH_INTERVAL_MS = 1000 * 60 * 10; // 10 minutes
@@ -100,11 +101,11 @@
100101 this.secretStorage = new SecretStorage(context);
101102
102103 // Immediately refresh any existing sessions
103- this.refreshSessions();
104+ void this.refreshSessions();
104105
105106 // Set up a regular interval to refresh tokens
106107 this._refreshInterval = setInterval(() => {
107- this.refreshSessions();
108+ void this.refreshSessions();
108109 }, WorkOsAuthProvider.REFRESH_INTERVAL_MS);
109110 }
110111
@@ -182,10 +183,18 @@
182183 }
183184
184185 async refreshSessions() {
186+ // Prevent concurrent refresh operations
187+ if (this._isRefreshing) {
188+ return;
189+ }
190+
185191 try {
192+ this._isRefreshing = true;
186193 await this._refreshSessions();
187194 } catch (e) {
188195 console.error(`Error refreshing sessions: ${e}`);
196+ } finally {
197+ this._isRefreshing = false;
189198 }
190199 }
191200
@@ -198,12 +207,9 @@
198207 const finalSessions = [];
199208 for (const session of sessions) {
200209 try {
201- // For expired tokens, don't use retries - if refresh fails, we drop the session
202- const refreshMethod = this.jwtIsExpiredOrInvalid(session.accessToken)
203- ? this._refreshSession.bind(this) // Direct refresh for expired tokens
204- : this._refreshSessionWithRetry.bind(this); // Retry for valid tokens
205-
206- const newSession = await refreshMethod(session.refreshToken);
210+ const newSession = await this._refreshSessionWithRetry(
211+ session.refreshToken,
212+ );
207213 finalSessions.push({
208214 ...session,
209215 accessToken: newSession.accessToken,
@@ -232,7 +238,6 @@
232238 private async _refreshSessionWithRetry(
233239 refreshToken: string,
234240 attempt = 1,
235- maxAttempts = 3,
236241 baseDelay = 1000,
237242 ): Promise<{
238243 accessToken: string;
@@ -242,30 +247,25 @@
242247 try {
243248 return await this._refreshSession(refreshToken);
244249 } catch (error: any) {
245- // Don't retry for auth errors (401 Unauthorized) or if we've reached max attempts
250+ // Don't retry for auth errors
246251 if (
247252 error.message?.includes("401") ||
248253 error.message?.includes("Invalid refresh token") ||
249- error.message?.includes("Unauthorized") ||
250- attempt >= maxAttempts
254+ error.message?.includes("Unauthorized")
251255 ) {
252256 throw error;
253257 }
254258
255259 // For network errors or transient server issues, retry with backoff
256260 // Calculate exponential backoff delay with jitter
257- const delay =
258- baseDelay * Math.pow(2, attempt - 1) * (0.5 + Math.random() * 0.5);
261+ const delay = Math.min(
262+ baseDelay * Math.pow(2, attempt - 1) * (0.5 + Math.random() * 0.5),
263+ 2 * 60 * 1000, // 2 minutes
264+ );
259265
260- // Schedule retry after delay
261266 return new Promise((resolve, reject) => {
262267 setTimeout(() => {
263- this._refreshSessionWithRetry(
264- refreshToken,
265- attempt + 1,
266- maxAttempts,
267- baseDelay,
268- )
268+ this._refreshSessionWithRetry(refreshToken, attempt + 1, baseDelay)
269269 .then(resolve)
270270 .catch(reject);
271271 }, delay);
@@ -360,7 +360,7 @@
360360
361361 return session;
362362 } catch (e) {
363- window.showErrorMessage(`Sign in failed: ${e}`);
363+ void window.showErrorMessage(`Sign in failed: ${e}`);
364364 throw e;
365365 }
366366 }
modified extensions/vscode/src/stubs/WorkOsAuthProvider.vitest.ts +2 −2
@@ -641,7 +641,7 @@
641641 }
642642 });
643643
644-it("should remove expired tokens when refresh fails", async () => {
644+it("should remove expired tokens when refresh fails with a 401 error", async () => {
645645 // Mock Date.now to return a time that makes tokens appear expired
646646 const originalDateNow = Date.now;
647647 const futureTime = Date.now() + 7200000; // 2 hours in the future
@@ -675,7 +675,7 @@
675675 global.setInterval = vi.fn().mockReturnValue(123 as any);
676676
677677 // Refresh will fail with network error
678- fetchMock.mockRejectedValueOnce(new Error("Network error"));
678+ fetchMock.mockRejectedValueOnce(new Error("401"));
679679
680680 // Setup storage
681681 mockSecretStorageGet.mockResolvedValue(JSON.stringify([expiredSession]));
modified gui/src/components/ModeSelect/ModeIcon.tsx +7 −1
@@ -1,4 +1,8 @@
1-import { ChatBubbleLeftIcon, SparklesIcon } from "@heroicons/react/24/outline";
1+import {
2+ ChatBubbleLeftIcon,
3+ SparklesIcon,
4+ SwatchIcon,
5+} from "@heroicons/react/24/outline";
26 import { MessageModes } from "core";
37
48 interface ModeIconProps {
@@ -13,6 +17,8 @@
1317 switch (mode) {
1418 case "agent":
1519 return <SparklesIcon className={className} />;
20+ case "plan":
21+ return <SwatchIcon className={className} />;
1622 case "chat":
1723 return <ChatBubbleLeftIcon className={className} />;
1824 }
modified gui/src/components/ModeSelect/ModeSelect.tsx +59 −6
@@ -1,4 +1,8 @@
1-import { CheckIcon, ChevronDownIcon } from "@heroicons/react/24/outline";
1+import {
2+ CheckIcon,
3+ ChevronDownIcon,
4+ InformationCircleIcon,
5+} from "@heroicons/react/24/outline";
26 import { MessageModes } from "core";
37 import { modelSupportsTools } from "core/llm/autodetect";
48 import { useCallback, useEffect, useMemo } from "react";
@@ -6,6 +10,7 @@
610 import { selectSelectedChatModel } from "../../redux/slices/configSlice";
711 import { setMode } from "../../redux/slices/sessionSlice";
812 import { getFontSize, getMetaKeyLabel } from "../../util";
13+import { ToolTip } from "../gui/Tooltip";
914 import { useMainEditor } from "../mainInput/TipTapEditor";
1015 import { Listbox, ListboxButton, ListboxOption, ListboxOptions } from "../ui";
1116 import { ModeIcon } from "./ModeIcon";
@@ -27,13 +32,19 @@
2732 if (!selectedModel) {
2833 return;
2934 }
30- if (mode === "agent" && !agentModeSupported) {
35+ if (mode !== "chat" && !agentModeSupported) {
3136 dispatch(setMode("chat"));
3237 }
3338 }, [mode, agentModeSupported, dispatch, selectedModel]);
3439
3540 const cycleMode = useCallback(() => {
36- dispatch(setMode(mode === "chat" ? "agent" : "chat"));
41+ if (mode === "chat") {
42+ dispatch(setMode("plan"));
43+ } else if (mode === "plan") {
44+ dispatch(setMode("agent"));
45+ } else {
46+ dispatch(setMode("chat"));
47+ }
3748 // Only focus main editor if another one doesn't already have focus
3849 if (!document.activeElement?.classList?.contains("ProseMirror")) {
3950 mainEditor?.commands.focus();
@@ -74,7 +85,7 @@
7485 >
7586 <ModeIcon mode={mode} />
7687 <span className="hidden sm:block">
77- {mode.charAt(0).toUpperCase() + mode.slice(1)}
88+ {mode === "chat" ? "Chat" : mode === "agent" ? "Agent" : "Plan"}
7889 </span>
7990 <ChevronDownIcon
8091 className="h-2 w-2 flex-shrink-0"
@@ -94,7 +105,35 @@
94105 </div>
95106 {mode === "chat" && <CheckIcon className="ml-auto h-3 w-3" />}
96107 </ListboxOption>
97-
108+ <ListboxOption
109+ value="plan"
110+ disabled={!agentModeSupported}
111+ className={"gap-1"}
112+ >
113+ <div className="flex flex-row items-center gap-1.5">
114+ <ModeIcon mode="plan" />
115+ <span className="">Plan</span>
116+ <InformationCircleIcon
117+ data-tooltip-id="plan-tip"
118+ className="h-2.5 w-2.5 flex-shrink-0"
119+ />
120+ <ToolTip
121+ id="plan-tip"
122+ style={{
123+ zIndex: 200001,
124+ }}
125+ >
126+ In Plan mode, only read-only and MCP tools are enabled
127+ </ToolTip>
128+ </div>
129+ {agentModeSupported ? (
130+ <CheckIcon
131+ className={`ml-auto h-3 w-3 ${mode === "plan" ? "" : "opacity-0"}`}
132+ />
133+ ) : (
134+ <span>(Not supported)</span>
135+ )}
136+ </ListboxOption>
98137 <ListboxOption
99138 value="agent"
100139 disabled={!agentModeSupported}
@@ -103,9 +142,23 @@
103142 <div className="flex flex-row items-center gap-1.5">
104143 <ModeIcon mode="agent" />
105144 <span className="">Agent</span>
145+ <InformationCircleIcon
146+ data-tooltip-id="agent-tip"
147+ className="h-2.5 w-2.5 flex-shrink-0"
148+ />
149+ <ToolTip
150+ id="agent-tip"
151+ style={{
152+ zIndex: 200001,
153+ }}
154+ >
155+ All tools are enabled based on policies
156+ </ToolTip>
106157 </div>
107158 {agentModeSupported ? (
108- mode === "agent" && <CheckIcon className="ml-auto h-3 w-3" />
159+ <CheckIcon
160+ className={`ml-auto h-3 w-3 ${mode === "agent" ? "" : "opacity-0"}`}
161+ />
109162 ) : (
110163 <span>(Not supported)</span>
111164 )}
modified gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/ToolbarButtonWithTooltip.tsx +9 −10
@@ -1,6 +1,5 @@
11 import { ReactNode, useMemo } from "react";
2-import { Tooltip } from "react-tooltip";
3-import { getFontSize } from "../../../util";
2+import { ToolTip } from "../../gui/Tooltip";
43
54 interface ToolbarButtonWithTooltipProps {
65 onClick: () => void;
@@ -22,20 +21,20 @@
2221
2322 return (
2423 <>
25- <button
26- onClick={onClick}
27- style={{
28- fontSize: `${getFontSize() - 2}px`,
24+ <div
25+ onClick={(e) => {
26+ e.stopPropagation();
27+ onClick();
2928 }}
3029 data-tooltip-id={tooltipId}
3130 data-testid={testId}
32- className="text-foreground flex items-center border-none bg-transparent px-0.5 outline-none hover:cursor-pointer hover:brightness-125"
31+ className="hover:description-muted/30 cursor-pointer select-none rounded bg-transparent px-1 py-0.5 hover:opacity-80"
3332 >
3433 {children}
35- </button>
36- <Tooltip id={tooltipId} place="top">
34+ </div>
35+ <ToolTip id={tooltipId} place="top">
3736 {tooltipContent}
38- </Tooltip>
37+ </ToolTip>
3938 </>
4039 );
4140 }
modified gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx +0 −1
@@ -219,7 +219,6 @@
219219 if (isGeneratingCodeBlock) {
220220 return (
221221 <span className="text-lightgray inline-flex items-center gap-2 text-right">
222- {!isExpanded ? `${numLines} line${plural}` : "Generating"}{" "}
223222 <div>
224223 <Spinner />
225224 </div>
modified gui/src/components/gui/Switch.tsx +6 −2
@@ -7,6 +7,7 @@
77 text: string;
88 size?: number;
99 showIfToggled?: ReactNode;
10+ disabled?: boolean;
1011 };
1112
1213 const ToggleSwitch: React.FC<ToggleSwitchProps> = ({
@@ -15,15 +16,18 @@
1516 text,
1617 size = 16,
1718 showIfToggled,
19+ disabled = false,
1820 }) => {
1921 return (
20- <div className="flex cursor-pointer select-none items-center justify-between gap-3">
22+ <div
23+ className={`flex select-none items-center justify-between gap-3 ${disabled ? "cursor-not-allowed" : "cursor-pointer"}`}
24+ >
2125 <span className="truncate-right">{text}</span>
2226 <div className="flex flex-row items-center gap-1">
2327 {isToggled && !!showIfToggled && showIfToggled}
2428 <div
2529 className={`border-vsc-input-border bg-vsc-input-background flex items-center rounded-full border border-solid`}
26- onClick={onToggle}
30+ onClick={disabled ? undefined : onToggle}
2731 style={{
2832 height: size,
2933 width: size * 2,
modified gui/src/components/mainInput/Lump/sections/RulesSection.tsx +32 −15
@@ -7,9 +7,8 @@
77 import { RuleWithSource } from "core";
88 import {
99 DEFAULT_AGENT_SYSTEM_MESSAGE,
10- DEFAULT_AGENT_SYSTEM_MESSAGE_URL,
1110 DEFAULT_CHAT_SYSTEM_MESSAGE,
12- DEFAULT_CHAT_SYSTEM_MESSAGE_URL,
11+ DEFAULT_SYSTEM_MESSAGES_URL,
1312 } from "core/llm/defaultSystemMessages";
1413 import { useContext, useMemo } from "react";
1514 import { useAuth } from "../../../../context/Auth";
@@ -52,10 +51,12 @@
5251 ideMessenger.post("openFile", {
5352 path: rule.ruleFile,
5453 });
55- } else if (rule.source === "default-chat" && mode === "chat") {
56- ideMessenger.post("openUrl", DEFAULT_CHAT_SYSTEM_MESSAGE_URL);
57- } else if (rule.source === "default-agent" && mode === "agent") {
58- ideMessenger.post("openUrl", DEFAULT_AGENT_SYSTEM_MESSAGE_URL);
54+ } else if (
55+ rule.source === "default-chat" ||
56+ rule.source === "default-plan" ||
57+ rule.source === "default-agent"
58+ ) {
59+ ideMessenger.post("openUrl", DEFAULT_SYSTEM_MESSAGES_URL);
5960 } else {
6061 ideMessenger.post("config/openProfile", {
6162 profileId: undefined,
@@ -81,9 +82,11 @@
8182 return "Default agent system message";
8283 } else if (rule.source === "json-systemMessage") {
8384 return "JSON systemMessage)";
84- } else if (rule.source === "model-agent-options") {
85+ } else if (rule.source === "model-options-agent") {
8586 return "Base System Agent Message";
86- } else if (rule.source === "model-chat-options") {
87+ } else if (rule.source === "model-options-plan") {
88+ return "Base System Plan Message";
89+ } else if (rule.source === "model-options-chat") {
8790 return "Base System Chat Message";
8891 } else {
8992 return "Assistant rule";
@@ -215,11 +218,24 @@
215218 }
216219 }
217220
218- if (mode === "agent") {
221+ if (mode === "chat") {
222+ if (config.selectedModelByRole.chat?.baseChatSystemMessage) {
223+ rules.unshift({
224+ rule: config.selectedModelByRole.chat?.baseChatSystemMessage,
225+ source: "model-options-chat",
226+ });
227+ } else {
228+ rules.unshift({
229+ rule: DEFAULT_CHAT_SYSTEM_MESSAGE,
230+ source: "default-chat",
231+ });
232+ }
233+ } else if (mode === "agent") {
234+ // agent
219235 if (config.selectedModelByRole.chat?.baseAgentSystemMessage) {
220236 rules.unshift({
221237 rule: config.selectedModelByRole.chat?.baseAgentSystemMessage,
222- source: "model-agent-options",
238+ source: "model-options-agent",
223239 });
224240 } else {
225241 rules.unshift({
@@ -228,15 +244,16 @@
228244 });
229245 }
230246 } else {
231- if (config.selectedModelByRole.chat?.baseChatSystemMessage) {
247+ // plan
248+ if (config.selectedModelByRole.chat?.basePlanSystemMessage) {
232249 rules.unshift({
233- rule: config.selectedModelByRole.chat?.baseChatSystemMessage,
234- source: "model-chat-options",
250+ rule: config.selectedModelByRole.chat?.basePlanSystemMessage,
251+ source: "model-options-plan",
235252 });
236253 } else {
237254 rules.unshift({
238- rule: DEFAULT_CHAT_SYSTEM_MESSAGE,
239- source: "default-chat",
255+ rule: DEFAULT_AGENT_SYSTEM_MESSAGE,
256+ source: "default-agent",
240257 });
241258 }
242259 }
modified gui/src/components/mainInput/Lump/sections/tool-policies/ToolPoliciesSection.tsx +66 −28
@@ -1,3 +1,4 @@
1+import { InformationCircleIcon } from "@heroicons/react/24/outline";
12 import { Tool } from "core";
23 import { useMemo } from "react";
34 import { useAppDispatch, useAppSelector } from "../../../../../redux/hooks";
@@ -6,7 +7,26 @@
67 import ToggleSwitch from "../../../../gui/Switch";
78 import ToolPolicyItem from "./ToolPolicyItem";
89
10+interface ModeBadgeProps {
11+ text: string;
12+ icon: React.ReactNode;
13+ onClick: () => void;
14+ isSelected: boolean;
15+}
16+const ModeBadge = ({ text, onClick, isSelected, icon }: ModeBadgeProps) => {
17+ return (
18+ <div
19+ className="flex flex-1 items-center justify-center gap-1.5 text-sm"
20+ onClick={isSelected ? undefined : onClick}
21+ >
22+ {icon}
23+ {text}
24+ </div>
25+ );
26+};
27+
928 export const ToolPoliciesSection = () => {
29+ const mode = useAppSelector((state) => state.session.mode);
1030 const availableTools = useAppSelector((state) => state.config.config.tools);
1131 const toolGroupSettings = useAppSelector(
1232 (store) => store.ui.toolGroupSettings,
@@ -39,38 +59,56 @@
3959 );
4060 }, [availableTools]);
4161
62+ const allToolsOff = mode === "chat";
63+
64+ const message =
65+ mode === "chat"
66+ ? "All tools are disabled in Chat mode"
67+ : mode === "plan"
68+ ? "Plan mode: only read-only and MCP tools"
69+ : "Agent mode: all tool policies apply";
70+
4271 return (
4372 <>
44- {toolsByGroup.map(([groupName, tools]) => (
45- <div key={groupName} className="mt-2 flex flex-col pr-1">
46- <div className="flex flex-row items-center justify-between px-1">
47- <h3
48- className="m-0 p-0 font-bold"
49- style={{
50- fontSize: fontSize(-2),
51- }}
52- >
53- {groupName}
54- </h3>
55- <ToggleSwitch
56- isToggled={toolGroupSettings[groupName] !== "exclude"}
57- onToggle={() => dispatch(toggleToolGroupSetting(groupName))}
58- text=""
59- size={10}
60- />
61- </div>
62- <div className={`relative flex flex-col p-1`}>
63- {tools.map((tool) => (
64- <ToolPolicyItem
65- key={tool.uri + tool.function.name}
66- tool={tool}
67- duplicatesDetected={duplicateDetection[tool.function.name]}
68- excluded={toolGroupSettings[groupName] === "exclude"}
73+ <div className="mb-3 px-1">
74+ <InformationCircleIcon className="text-description-muted mr-1.5 inline-block h-2.5 w-2.5 flex-shrink-0" />
75+ <span className="text-description text-xs italic">{message}</span>
76+ </div>
77+ {toolsByGroup.map(([groupName, tools]) => {
78+ const isGroupEnabled =
79+ !allToolsOff && toolGroupSettings[groupName] !== "exclude";
80+ return (
81+ <div key={groupName} className="mt-2 flex flex-col pr-1">
82+ <div className="flex flex-row items-center justify-between px-1">
83+ <h3
84+ className="m-0 p-0 font-bold"
85+ style={{
86+ fontSize: fontSize(-2),
87+ }}
88+ >
89+ {groupName}
90+ </h3>
91+ <ToggleSwitch
92+ isToggled={isGroupEnabled}
93+ onToggle={() => dispatch(toggleToolGroupSetting(groupName))}
94+ text=""
95+ size={10}
96+ disabled={allToolsOff}
6997 />
70- ))}
98+ </div>
99+ <div className={`relative flex flex-col p-1`}>
100+ {tools.map((tool) => (
101+ <ToolPolicyItem
102+ key={tool.uri + tool.function.name}
103+ tool={tool}
104+ duplicatesDetected={duplicateDetection[tool.function.name]}
105+ isGroupEnabled={isGroupEnabled}
106+ />
107+ ))}
108+ </div>
71109 </div>
72- </div>
73- ))}
110+ );
111+ })}
74112 </>
75113 );
76114 };
modified gui/src/components/mainInput/Lump/sections/tool-policies/ToolPolicyItem.tsx +21 −8
@@ -3,6 +3,7 @@
33 InformationCircleIcon,
44 } from "@heroicons/react/24/outline";
55 import { Tool } from "core";
6+import { BUILT_IN_GROUP_NAME } from "core/tools/builtIn";
67 import { useEffect, useMemo, useState } from "react";
78 import { useDispatch } from "react-redux";
89 import { useAppSelector } from "../../../../../redux/hooks";
@@ -16,7 +17,7 @@
1617 interface ToolDropdownItemProps {
1718 tool: Tool;
1819 duplicatesDetected: boolean;
19- excluded: boolean;
20+ isGroupEnabled: boolean;
2021 }
2122
2223 function ToolPolicyItem(props: ToolDropdownItemProps) {
@@ -25,6 +26,7 @@
2526 (state) => state.ui.toolSettings[props.tool.function.name],
2627 );
2728 const [isExpanded, setIsExpanded] = useState(false);
29+ const mode = useAppSelector((state) => state.session.mode);
2830
2931 useEffect(() => {
3032 if (!policy) {
@@ -44,6 +46,12 @@
4446
4547 const fontSize = useFontSize(-2);
4648
49+ const disabled =
50+ !props.isGroupEnabled ||
51+ (mode === "plan" &&
52+ props.tool.group === BUILT_IN_GROUP_NAME &&
53+ !props.tool.readonly);
54+
4755 if (!policy) {
4856 return null;
4957 }
@@ -106,16 +114,21 @@
106114 </span>
107115 </div>
108116 </div>
117+
109118 <div
110- className={`flex w-8 flex-row items-center justify-end gap-2 px-2 py-0.5 sm:w-16 ${props.excluded ? "cursor-not-allowed" : "hover:bg-list-active hover:text-list-active-foreground cursor-pointer"}`}
119+ className={`flex w-8 flex-row items-center justify-end gap-2 px-2 py-0.5 sm:w-16 ${disabled ? "cursor-not-allowed" : "hover:bg-list-active hover:text-list-active-foreground cursor-pointer"}`}
111120 data-testid={`tool-policy-item-${props.tool.function.name}`}
112- onClick={(e) => {
113- dispatch(toggleToolSetting(props.tool.function.name));
114- e.stopPropagation();
115- e.preventDefault();
116- }}
121+ onClick={
122+ disabled
123+ ? undefined
124+ : (e) => {
125+ dispatch(toggleToolSetting(props.tool.function.name));
126+ e.stopPropagation();
127+ e.preventDefault();
128+ }
129+ }
117130 >
118- {props.excluded || policy === "disabled" ? (
131+ {disabled || policy === "disabled" ? (
119132 <>
120133 <span className="text-lightgray sm:hidden">Off</span>
121134 <span className="text-lightgray hidden sm:inline-block">
modified gui/src/components/mainInput/belowMainInput/RulesPeek.tsx +4 −2
@@ -19,9 +19,11 @@
1919 return "Default Chat";
2020 case "default-agent":
2121 return "Default Agent";
22- case "model-chat-options":
22+ case "model-options-chat":
2323 return "Model Chat Options";
24- case "model-agent-options":
24+ case "model-options-plan":
25+ return "Model Plan Options";
26+ case "model-options-agent":
2527 return "Model Agent Options";
2628 case "rules-block":
2729 return "Rules Block";
modified gui/src/pages/config/ModelRoleSelector.tsx +19 −6
@@ -119,19 +119,32 @@
119119 {[...models]
120120 .sort((a, b) => a.title.localeCompare(b.title))
121121 .map((option, idx) => {
122- const showMissingApiKeyMsg =
122+ const isConfigInvalid =
123+ option.configurationStatus !==
124+ LLMConfigurationStatuses.VALID;
125+ let invalidMessage = "(Invalid config)";
126+ if (
123127 option.configurationStatus ===
124- LLMConfigurationStatuses.MISSING_API_KEY;
128+ LLMConfigurationStatuses.MISSING_ENV_SECRET
129+ ) {
130+ invalidMessage = "(Missing env secret)";
131+ }
132+ if (
133+ option.configurationStatus ===
134+ LLMConfigurationStatuses.MISSING_API_KEY
135+ ) {
136+ invalidMessage = "(Missing API Key)";
137+ }
125138
126139 return (
127140 <ListboxOption
128141 key={idx}
129142 value={option.title}
130- disabled={showMissingApiKeyMsg}
143+ disabled={isConfigInvalid}
131144 onMouseEnter={() => setHoveredIdx(idx)}
132145 onMouseLeave={() => setHoveredIdx(null)}
133146 onClick={(e: any) =>
134- handleOptionClick(showMissingApiKeyMsg, e)
147+ handleOptionClick(isConfigInvalid, e)
135148 }
136149 className=""
137150 >
@@ -144,9 +157,9 @@
144157 style={{ fontSize: fontSize(-3) }}
145158 >
146159 {option.title}
147- {showMissingApiKeyMsg && (
160+ {isConfigInvalid && (
148161 <span className="ml-2 text-[10px] italic">
149- (Missing API key)
162+ {invalidMessage}
150163 </span>
151164 )}
152165 </span>
modified gui/src/pages/gui/Chat.tsx +9 −9
@@ -33,6 +33,7 @@
3333 selectCurrentToolCallApplyState,
3434 } from "../../redux/selectors/selectCurrentToolCall";
3535 import {
36+ cancelToolCall,
3637 newSession,
3738 updateToolCallOutput,
3839 } from "../../redux/slices/sessionSlice";
@@ -108,7 +109,6 @@
108109 (state) => state.config.config.ui?.showChatScrollbar,
109110 );
110111 const codeToEdit = useAppSelector((state) => state.editModeState.codeToEdit);
111- const toolCallState = useAppSelector(selectCurrentToolCall);
112112 const mode = useAppSelector((store) => store.session.mode);
113113 const isInEdit = useAppSelector((store) => store.session.isInEdit);
114114
@@ -147,6 +147,7 @@
147147 isStreaming,
148148 );
149149
150+ const currentToolCallState = useAppSelector(selectCurrentToolCall);
150151 const currentToolCallApplyState = useAppSelector(
151152 selectCurrentToolCallApplyState,
152153 );
@@ -158,20 +159,19 @@
158159 index?: number,
159160 editorToClearOnSend?: Editor,
160161 ) => {
161- if (toolCallState?.status === "generated") {
162- return console.error(
163- "Cannot submit message while awaiting tool confirmation",
162+ if (currentToolCallState) {
163+ dispatch(
164+ cancelToolCall({
165+ toolCallId: currentToolCallState.toolCallId,
166+ }),
164167 );
165168 }
166169 if (
167170 currentToolCallApplyState &&
168171 currentToolCallApplyState.status !== "closed"
169172 ) {
170- return console.error(
171- "Cannot submit message while awaiting tool call apply",
172- );
173+ ideMessenger.post("rejectDiff", currentToolCallApplyState);
173174 }
174-
175175 const model = isInEdit
176176 ? (selectedModels?.edit ?? selectedModels?.chat)
177177 : selectedModels?.chat;
@@ -241,7 +241,7 @@
241241 mode,
242242 isInEdit,
243243 codeToEdit,
244- toolCallState,
244+ currentToolCallState,
245245 currentToolCallApplyState,
246246 ],
247247 );
modified gui/src/pages/gui/ToolCallDiv/EditFile.tsx +2 −3
@@ -6,15 +6,14 @@
66 changes: string;
77 historyIndex: number;
88 toolCallId?: string;
9- expandCodeblocks?: boolean;
109 };
1110
1211 export function EditFile(props: EditToolCallProps) {
13- if (!props.relativeFilePath || !props.changes) {
12+ if (!props.relativeFilePath) {
1413 return null;
1514 }
1615
17- const src = `\`\`\`${getMarkdownLanguageTagForFile(props.relativeFilePath ?? "test.txt")} ${props.relativeFilePath}\n${props.changes}\n\`\`\``;
16+ const src = `\`\`\`${getMarkdownLanguageTagForFile(props.relativeFilePath)} ${props.relativeFilePath}\n${props.changes}\n\`\`\``;
1817
1918 return (
2019 <StyledMarkdownPreview
modified gui/src/pages/gui/ToolCallDiv/FunctionSpecificToolCallDiv.tsx +0 −1
@@ -36,7 +36,6 @@
3636 case BuiltInToolNames.SearchAndReplaceInFile:
3737 return (
3838 <EditFile
39- expandCodeblocks
4039 relativeFilePath={args.filepath ?? ""}
4140 changes={args.diff ?? ""}
4241 toolCallId={toolCall.id}
modified gui/src/pages/gui/ToolCallDiv/ToolCall.tsx +1 −1
@@ -27,7 +27,7 @@
2727
2828 return (
2929 <>
30- <div className="flex flex-col justify-center p-4 pb-0">
30+ <div className="flex flex-col justify-center p-4 pb-1">
3131 <div className="mb-4 flex flex-col">
3232 <div className="flex flex-row items-center justify-between gap-1.5">
3333 <div className="flex min-w-0 flex-row items-center gap-2">
modified gui/src/pages/gui/ToolCallDiv/ToolCallArgs.tsx +9 −21
@@ -1,6 +1,5 @@
11 import { CodeBracketIcon } from "@heroicons/react/24/outline";
2-import { useMemo } from "react";
3-import { ToolTip } from "../../../components/gui/Tooltip";
2+import { ToolbarButtonWithTooltip } from "../../../components/StyledMarkdownPreview/StepContainerPreToolbar/ToolbarButtonWithTooltip";
43
54 interface ArgsToggleIconProps {
65 isShowing: boolean;
@@ -13,26 +12,15 @@
1312 setIsShowing,
1413 toolCallId,
1514 }: ArgsToggleIconProps) => {
16- const argsTooltipId = useMemo(() => {
17- return "args-hover-" + toolCallId;
18- }, [toolCallId]);
19-
2015 return (
21- <>
22- <div
23- data-tooltip-id={argsTooltipId}
24- onClick={(e) => {
25- e.stopPropagation();
26- setIsShowing(!isShowing);
27- }}
28- className={`hover:description-muted/30 cursor-pointer select-none rounded px-1 py-0.5 hover:opacity-80 ${isShowing ? "bg-description-muted/30" : "bg-transparent"}`}
29- >
30- <CodeBracketIcon className="h-3 w-3 flex-shrink-0 opacity-60" />
31- </div>
32- <ToolTip id={argsTooltipId}>
33- {isShowing ? "Hide args" : "Show args"}
34- </ToolTip>
35- </>
16+ <ToolbarButtonWithTooltip
17+ tooltipContent={isShowing ? "Hide args" : "Show args"}
18+ onClick={() => {
19+ setIsShowing(!isShowing);
20+ }}
21+ >
22+ <CodeBracketIcon className="h-3 w-3 flex-shrink-0 opacity-60" />
23+ </ToolbarButtonWithTooltip>
3624 );
3725 };
3826
modified gui/src/pages/gui/ToolCallDiv/ToolTruncateHistoryIcon.tsx +3 −1
@@ -19,9 +19,11 @@
1919 }, [history]);
2020 const dispatch = useAppDispatch();
2121 const { mainEditor } = useMainEditor();
22+
2223 if (historyIndex === lastMessageIndex) {
2324 return null;
2425 }
26+
2527 return (
2628 <ToolbarButtonWithTooltip
2729 tooltipContent={isStreaming ? "" : "Trim chat to this message"}
@@ -38,7 +40,7 @@
3840 }}
3941 >
4042 <BarsArrowUpIcon
41- className={`h-3 w-3 flex-shrink-0 ${isStreaming ? "cursor-not-allowed" : "cursor-pointer"}`}
43+ className={`h-3 w-3 flex-shrink-0 opacity-60 ${isStreaming ? "cursor-not-allowed" : ""}`}
4244 />
4345 </ToolbarButtonWithTooltip>
4446 );
modified gui/src/pages/gui/ToolCallDiv/index.tsx +16 −0
@@ -85,6 +85,22 @@
8585 );
8686 }
8787
88+ // Trying this out while it's an experimental feature
89+ // Obviously missing the truncate and args buttons
90+ // All the info from args is displayed here
91+ // But we'd need a nicer place to put the truncate button and the X icon when tool call fails
92+ if (
93+ props.toolCall.function?.name === BuiltInToolNames.SearchAndReplaceInFile
94+ ) {
95+ return (
96+ <FunctionSpecificToolCallDiv
97+ toolCall={props.toolCall}
98+ toolCallState={props.toolCallState}
99+ historyIndex={props.historyIndex}
100+ />
101+ );
102+ }
103+
88104 return (
89105 <ToolCallDisplay
90106 icon={getStatusIcon(props.toolCallState.status)}
modified gui/src/pages/gui/chat-tests/Chat.test.tsx +16 −4
@@ -15,7 +15,7 @@
1515
1616 test("should be able to toggle modes", async () => {
1717 await renderWithProviders(<Chat />);
18- await getElementByText("Chat");
18+ await getElementByText("Agent");
1919
2020 // Simulate cmd+. keyboard shortcut to toggle modes
2121 act(() => {
@@ -27,8 +27,8 @@
2727 );
2828 });
2929
30- // Check that it switched to Agent mode
31- await getElementByText("Agent");
30+ // Check that it switched to Chat mode
31+ await getElementByText("Chat");
3232
3333 act(() => {
3434 document.dispatchEvent(
@@ -39,7 +39,19 @@
3939 );
4040 });
4141
42- await getElementByText("Chat");
42+ // Check that it switched to Plan mode
43+ await getElementByText("Plan");
44+
45+ act(() => {
46+ document.dispatchEvent(
47+ new KeyboardEvent("keydown", {
48+ key: ".",
49+ metaKey: true, // cmd key on Mac
50+ }),
51+ );
52+ });
53+
54+ await getElementByText("Agent");
4355 });
4456
4557 test("should send a message and receive a response", async () => {
modified gui/src/redux/selectors/selectActiveTools.ts +9 −4
@@ -1,5 +1,6 @@
11 import { createSelector } from "@reduxjs/toolkit";
22 import { Tool } from "core";
3+import { BUILT_IN_GROUP_NAME } from "core/tools/builtIn";
34 import { RootState } from "../store";
45
56 export const selectActiveTools = createSelector(
@@ -12,14 +13,18 @@
1213 (mode, tools, policies, groupPolicies): Tool[] => {
1314 if (mode === "chat") {
1415 return [];
15- } else if (mode === "agent") {
16- return tools.filter(
16+ } else {
17+ const enabledTools = tools.filter(
1718 (tool) =>
1819 policies[tool.function.name] !== "disabled" &&
1920 groupPolicies[tool.group] !== "exclude",
2021 );
21- } else {
22- return [];
22+ if (mode === "plan") {
23+ return enabledTools.filter(
24+ (t) => t.group !== BUILT_IN_GROUP_NAME || t.readonly,
25+ );
26+ }
27+ return enabledTools;
2328 }
2429 },
2530 );
added gui/src/redux/slices/sessionSlice.test.ts +418 −0
@@ -0,0 +1,418 @@
1+import { ChatMessage } from "core";
2+import { renderChatMessage } from "core/util/messageContent";
3+import { v4 as uuidv4 } from "uuid";
4+import { beforeEach, describe, expect, it, vi } from "vitest";
5+import { addToolCallDeltaToState } from "../../util/toolCallState";
6+import { ChatHistoryItemWithMessageId, sessionSlice } from "./sessionSlice";
7+
8+// Mock dependencies
9+vi.mock("uuid");
10+vi.mock("core/util/messageContent");
11+vi.mock("../../util/toolCallState");
12+
13+const mockUuidv4 = vi.mocked(uuidv4);
14+const mockRenderChatMessage = vi.mocked(renderChatMessage);
15+const mockAddToolCallDeltaToState = vi.mocked(addToolCallDeltaToState);
16+
17+describe("sessionSlice streamUpdate", () => {
18+ beforeEach(() => {
19+ // Reset mocks before each test
20+ vi.clearAllMocks();
21+
22+ // Mock uuidv4 to return predictable values
23+ let callCount = 0;
24+ mockUuidv4.mockImplementation(() => `mock-uuid-${++callCount}`);
25+
26+ // Mock renderChatMessage to return content as is
27+ mockRenderChatMessage.mockImplementation((message: ChatMessage) => {
28+ if (typeof message.content === "string") {
29+ return message.content;
30+ }
31+ return "";
32+ });
33+
34+ // Mock addToolCallDeltaToState
35+ mockAddToolCallDeltaToState.mockImplementation((delta, state) => {
36+ return {
37+ status: "generating" as const,
38+ toolCall: {
39+ id: delta.id || "mock-tool-id",
40+ type: "function" as const,
41+ function: {
42+ name: delta.function?.name || "mock-function",
43+ arguments: delta.function?.arguments || "{}",
44+ },
45+ },
46+ toolCallId: delta.id || "mock-tool-id",
47+ parsedArgs: {},
48+ };
49+ });
50+ });
51+
52+ const createInitialState = () => ({
53+ lastSessionId: undefined,
54+ allSessionMetadata: [],
55+ history: [
56+ {
57+ message: {
58+ role: "user" as const,
59+ content: "This is a test.",
60+ id: "initial-user-message",
61+ },
62+ contextItems: [],
63+ },
64+ ] as ChatHistoryItemWithMessageId[],
65+ isStreaming: false,
66+ title: "Test Session",
67+ id: "test-session-id",
68+ streamAborter: new AbortController(),
69+ symbols: {},
70+ mode: "chat" as const,
71+ isInEdit: false,
72+ codeBlockApplyStates: {
73+ states: [],
74+ curIndex: 0,
75+ },
76+ newestToolbarPreviewForInput: {},
77+ isSessionMetadataLoading: false,
78+ });
79+
80+ describe("Basic Chat Message", () => {
81+ it("should append assistant message to history", () => {
82+ const initialState = createInitialState();
83+ const action = {
84+ type: "session/streamUpdate",
85+ payload: [
86+ {
87+ role: "assistant" as const,
88+ content: "Here is a response to your message without thinking.",
89+ },
90+ ],
91+ };
92+
93+ const newState = sessionSlice.reducer(initialState, action);
94+
95+ expect(newState.history).toHaveLength(2);
96+ expect(newState.history[1].message.role).toBe("assistant");
97+ expect(newState.history[1].message.content).toBe(
98+ "Here is a response to your message without thinking.",
99+ );
100+ expect(newState.history[1].message.id).toBe("mock-uuid-1");
101+ expect(newState.history[1].contextItems).toEqual([]);
102+ });
103+ });
104+
105+ describe("Chat Message With Thinking", () => {
106+ it("should split thinking and assistant content correctly", () => {
107+ const initialState = createInitialState();
108+ const action = {
109+ type: "session/streamUpdate",
110+ payload: [
111+ {
112+ role: "assistant" as const,
113+ content:
114+ "<think>I should send the user a response.</think> Here is a response to your message with thinking.",
115+ },
116+ ],
117+ };
118+
119+ const newState = sessionSlice.reducer(initialState, action);
120+
121+ expect(newState.history).toHaveLength(2);
122+
123+ // Check reasoning
124+ expect(newState.history[0].reasoning?.text).toBe(
125+ "I should send the user a response.",
126+ );
127+
128+ // Check assistant message
129+ expect(newState.history[1].message.role).toBe("assistant");
130+ expect(newState.history[1].message.content).toBe(
131+ "Here is a response to your message with thinking.",
132+ );
133+ expect(newState.history[1].message.id).toBe("mock-uuid-1");
134+ });
135+ });
136+
137+ describe("Tool Call With Response", () => {
138+ it("should handle tool call followed by tool response and assistant message", () => {
139+ const initialState = createInitialState();
140+ const toolCallAction = {
141+ type: "session/streamUpdate",
142+ payload: [
143+ {
144+ role: "assistant" as const,
145+ content: "<think>I should use a tool call.</think>",
146+ toolCalls: [
147+ {
148+ id: "1234",
149+ type: "function" as const,
150+ function: {
151+ name: "builtin_ls",
152+ arguments: '{"dirPath":".","recursive":false}',
153+ },
154+ },
155+ ],
156+ },
157+ ],
158+ };
159+
160+ let newState = sessionSlice.reducer(initialState, toolCallAction);
161+ expect(newState.history).toHaveLength(2);
162+
163+ // Check reasoning
164+ expect(newState.history[0].reasoning?.text).toBe(
165+ "I should use a tool call.",
166+ );
167+
168+ // Check generating message
169+ expect(newState.history[1].message.role).toBe("assistant");
170+ expect(newState.history[1].message.content).toBe("");
171+ expect(newState.history[1].toolCallState?.status).toBe("generating");
172+ expect(newState.history[1].toolCallState?.toolCallId).toBe("1234");
173+
174+ const toolResponseAction = {
175+ type: "session/streamUpdate",
176+ payload: [
177+ {
178+ role: "tool" as const,
179+ toolCallId: "1234",
180+ content: "foo.txt\nbar.txt\nexample.php",
181+ },
182+ {
183+ role: "assistant" as const,
184+ content: "I see, the tool found 3 files.",
185+ },
186+ ],
187+ };
188+ newState = sessionSlice.reducer(newState, toolResponseAction);
189+ expect(newState.history).toHaveLength(4);
190+
191+ // Check tool message
192+ expect(newState.history[2].message.role).toBe("tool");
193+ expect(newState.history[2].message.content).toBe(
194+ "foo.txt\nbar.txt\nexample.php",
195+ );
196+ expect((newState.history[2].message as any).toolCallId).toBe("1234");
197+
198+ // Check final assistant message
199+ expect(newState.history[3].message.role).toBe("assistant");
200+ expect(newState.history[3].message.content).toBe(
201+ "I see, the tool found 3 files.",
202+ );
203+ });
204+ });
205+
206+ describe("Tool Call With Streaming Response", () => {
207+ it("should handle streaming assistant response after tool call", () => {
208+ const initialState = createInitialState();
209+ const toolCallAction = {
210+ type: "session/streamUpdate",
211+ payload: [
212+ {
213+ role: "assistant" as const,
214+ content: "<think>I should use a tool call.</think>",
215+ toolCalls: [
216+ {
217+ id: "1234",
218+ type: "function" as const,
219+ function: {
220+ name: "builtin_ls",
221+ arguments: '{"dirPath":".","recursive":false}',
222+ },
223+ },
224+ ],
225+ },
226+ ],
227+ };
228+
229+ let newState = sessionSlice.reducer(initialState, toolCallAction);
230+ expect(newState.history).toHaveLength(2);
231+
232+ // Check reasoning
233+ expect(newState.history[0].reasoning?.text).toBe(
234+ "I should use a tool call.",
235+ );
236+
237+ // Check generating message
238+ expect(newState.history[1].message.role).toBe("assistant");
239+ expect(newState.history[1].message.content).toBe("");
240+ expect(newState.history[1].toolCallState?.status).toBe("generating");
241+ expect(newState.history[1].toolCallState?.toolCallId).toBe("1234");
242+
243+ const toolResponseAction = {
244+ type: "session/streamUpdate",
245+ payload: [
246+ {
247+ role: "tool" as const,
248+ toolCallId: "1234",
249+ content: "foo.txt\nbar.txt\nexample.php",
250+ },
251+ {
252+ role: "assistant" as const,
253+ content: "<think>",
254+ },
255+ {
256+ role: "assistant" as const,
257+ content: "Good, ",
258+ },
259+ {
260+ role: "assistant" as const,
261+ content: "I received a list",
262+ },
263+ {
264+ role: "assistant" as const,
265+ content: " of files.",
266+ },
267+ {
268+ role: "assistant" as const,
269+ content: "</think>",
270+ },
271+ {
272+ role: "assistant" as const,
273+ content: "\n",
274+ },
275+ {
276+ role: "assistant" as const,
277+ content: "I see, ",
278+ },
279+ {
280+ role: "assistant" as const,
281+ content: "the tool ",
282+ },
283+ {
284+ role: "assistant" as const,
285+ content: "found 3 ",
286+ },
287+ {
288+ role: "assistant" as const,
289+ content: "files.",
290+ },
291+ ],
292+ };
293+
294+ newState = sessionSlice.reducer(newState, toolResponseAction);
295+
296+ expect(newState.history).toHaveLength(4);
297+
298+ // Check tool message
299+ expect(newState.history[2].message.role).toBe("tool");
300+ expect(newState.history[2].message.content).toBe(
301+ "foo.txt\nbar.txt\nexample.php",
302+ );
303+
304+ // Check response message
305+ expect(newState.history[3].message.role).toBe("assistant");
306+ expect(newState.history[3].message.content).toBe(
307+ "I see, the tool found 3 files.",
308+ );
309+ expect(newState.history[3].reasoning?.text).toBe(
310+ "Good, I received a list of files.",
311+ );
312+ expect(newState.history[3].reasoning?.active).toBe(false);
313+ });
314+ });
315+
316+ describe("Edge Cases", () => {
317+ it("should handle empty history gracefully", () => {
318+ const initialState = createInitialState();
319+ initialState.history = [];
320+
321+ const action = {
322+ type: "session/streamUpdate",
323+ payload: [
324+ {
325+ role: "assistant" as const,
326+ content: "Hello",
327+ },
328+ ],
329+ };
330+
331+ const newState = sessionSlice.reducer(initialState, action);
332+
333+ // Should not crash and history should remain empty
334+ expect(newState.history).toHaveLength(0);
335+ });
336+
337+ it("should handle redacted thinking messages", () => {
338+ const initialState = createInitialState();
339+ const action = {
340+ type: "session/streamUpdate",
341+ payload: [
342+ {
343+ role: "thinking" as const,
344+ content: "This should be hidden",
345+ redactedThinking: true,
346+ },
347+ ],
348+ };
349+
350+ const newState = sessionSlice.reducer(initialState, action);
351+
352+ expect(newState.history).toHaveLength(2);
353+ expect(newState.history[1].message.role).toBe("thinking");
354+ expect(newState.history[1].message.content).toBe(
355+ "internal reasoning is hidden due to safety reasons",
356+ );
357+ expect((newState.history[1].message as any).redactedThinking).toBe(true);
358+ });
359+
360+ it("should handle signature updates for thinking messages", () => {
361+ const initialState = createInitialState();
362+ // First add a thinking message
363+ initialState.history.push({
364+ message: {
365+ role: "thinking",
366+ content: "Some thinking",
367+ id: "thinking-message",
368+ },
369+ contextItems: [],
370+ });
371+
372+ const action = {
373+ type: "session/streamUpdate",
374+ payload: [
375+ {
376+ role: "thinking" as const,
377+ signature: "test-signature",
378+ },
379+ ],
380+ };
381+
382+ const newState = sessionSlice.reducer(initialState, action);
383+
384+ expect(newState.history).toHaveLength(2);
385+ expect((newState.history[1].message as any).signature).toBe(
386+ "test-signature",
387+ );
388+ });
389+
390+ it("should accumulate content for same role messages", () => {
391+ const initialState = createInitialState();
392+ // Add an assistant message first
393+ initialState.history.push({
394+ message: {
395+ role: "assistant",
396+ content: "Hello ",
397+ id: "assistant-message",
398+ },
399+ contextItems: [],
400+ });
401+
402+ const action = {
403+ type: "session/streamUpdate",
404+ payload: [
405+ {
406+ role: "assistant" as const,
407+ content: "world!",
408+ },
409+ ],
410+ };
411+
412+ const newState = sessionSlice.reducer(initialState, action);
413+
414+ expect(newState.history).toHaveLength(2);
415+ expect(newState.history[1].message.content).toBe("Hello world!");
416+ });
417+ });
418+});
modified gui/src/redux/slices/sessionSlice.ts +125 −46
@@ -8,6 +8,7 @@
88 import { JSONContent } from "@tiptap/react";
99 import {
1010 ApplyState,
11+ AssistantChatMessage,
1112 ChatHistoryItem,
1213 ChatMessage,
1314 ContextItem,
@@ -18,6 +19,7 @@
1819 RuleWithSource,
1920 Session,
2021 SessionMetadata,
22+ ThinkingChatMessage,
2123 Tool,
2224 } from "core";
2325 import { NEW_SESSION_TITLE } from "core/util/constants";
@@ -72,7 +74,7 @@
7274 id: uuidv4(),
7375 streamAborter: new AbortController(),
7476 symbols: {},
75- mode: "chat",
77+ mode: "agent",
7678 isInEdit: false,
7779 codeBlockApplyStates: {
7880 states: [],
@@ -330,12 +332,10 @@
330332 streamUpdate: (state, action: PayloadAction<ChatMessage[]>) => {
331333 if (state.history.length) {
332334 for (const message of action.payload) {
333- const lastItem = state.history[state.history.length - 1];
334- const lastMessage = lastItem.message;
335+ let lastItem = state.history[state.history.length - 1];
336+ let lastMessage = lastItem.message;
335337
336338 if (message.role === "thinking" && message.redactedThinking) {
337- console.log("add redacted_thinking blocks");
338-
339339 state.history.push({
340340 message: {
341341 role: "thinking",
@@ -348,6 +348,74 @@
348348 continue;
349349 }
350350
351+ const messageContent = message.content
352+ ? renderChatMessage(message)
353+ : "";
354+
355+ // OpenAI-compatible models in agent mode sometimes send
356+ // all of their data in one message, so we handle that case early.
357+ if (messageContent) {
358+ const thinkMatches = messageContent.match(
359+ /<think>([\s\S]*)<\/think>([\s\S]*)/,
360+ );
361+ if (thinkMatches) {
362+ // The order that they seem to consistently use is:
363+ //
364+ // <think>Thinking text</think>
365+ // Text to show to the user
366+
367+ lastItem.reasoning = {
368+ text: thinkMatches[1].trim(),
369+ startAt: Date.now(),
370+ endAt: Date.now(),
371+ active: false,
372+ };
373+
374+ // This is the chat message that we should show to the user.
375+ // We always need to push this even if it is empty,
376+ // because we cannot attach tool calls to a Thinking message.
377+ // That would break `messageHasToolCallId`.
378+ state.history.push({
379+ message: {
380+ role: "assistant",
381+ content: thinkMatches[2].trim(),
382+ id: uuidv4(),
383+ },
384+ contextItems: [],
385+ });
386+ lastItem = state.history[state.history.length - 1];
387+ lastMessage = lastItem.message;
388+
389+ if (
390+ (message.role === "assistant" || message.role === "thinking") &&
391+ message.toolCalls?.[0]
392+ ) {
393+ // Only support one tool call for now.
394+ // There are further changes required throughout the system
395+ // to support multiple tool calls in a single message from
396+ // OpenAI-compatible providers.
397+ const toolCallDelta = message.toolCalls[0];
398+ const newToolCallState = addToolCallDeltaToState(
399+ toolCallDelta,
400+ lastItem.toolCallState,
401+ );
402+ lastItem.toolCallState = newToolCallState;
403+ // We know this is one of these two types because we just added it
404+ const curMessage = lastMessage as
405+ | AssistantChatMessage
406+ | ThinkingChatMessage;
407+ if (curMessage.toolCalls) {
408+ curMessage.toolCalls.push(newToolCallState.toolCall);
409+ } else {
410+ curMessage.toolCalls = [newToolCallState.toolCall];
411+ }
412+ }
413+
414+ return;
415+ }
416+ }
417+
418+ // The remainder of this function handles streaming messages
351419 if (
352420 lastMessage.role !== message.role ||
353421 // This is for when a tool call comes immediately before/after tool call
@@ -363,7 +431,7 @@
363431 const historyItem: ChatHistoryItemWithMessageId = {
364432 message: {
365433 ...message,
366- content: renderChatMessage(message),
434+ content: "",
367435 id: uuidv4(),
368436 },
369437 contextItems: [],
@@ -376,51 +444,62 @@
376444 );
377445 }
378446 state.history.push(historyItem);
379- } else {
380- // Add to the existing message
381- if (message.content) {
382- const messageContent = renderChatMessage(message);
383- if (messageContent.includes("<think>")) {
384- lastItem.reasoning = {
385- startAt: Date.now(),
386- active: true,
387- text: messageContent.replace("<think>", "").trim(),
388- };
389- } else if (
390- lastItem.reasoning?.active &&
391- messageContent.includes("</think>")
447+ lastItem = state.history[state.history.length - 1];
448+ lastMessage = lastItem.message;
449+ }
450+
451+ // Add to the existing message
452+ if (messageContent) {
453+ if (messageContent.includes("<think>")) {
454+ lastItem.reasoning = {
455+ startAt: Date.now(),
456+ active: true,
457+ text: messageContent.replace("<think>", "").trim(),
458+ };
459+ } else if (
460+ lastItem.reasoning?.active &&
461+ messageContent.includes("</think>")
462+ ) {
463+ const [reasoningEnd, answerStart] =
464+ messageContent.split("</think>");
465+ lastItem.reasoning.text += reasoningEnd.trimEnd();
466+ lastItem.reasoning.active = false;
467+ lastItem.reasoning.endAt = Date.now();
468+ lastMessage.content += answerStart.trimStart();
469+ } else if (lastItem.reasoning?.active) {
470+ if (
471+ lastItem.reasoning.text.length > 0 ||
472+ messageContent.trim().length > 0
392473 ) {
393- const [reasoningEnd, answerStart] =
394- messageContent.split("</think>");
395- lastItem.reasoning.text += reasoningEnd.trimEnd();
396- lastItem.reasoning.active = false;
397- lastItem.reasoning.endAt = Date.now();
398- lastMessage.content += answerStart.trimStart();
399- } else if (lastItem.reasoning?.active) {
400474 lastItem.reasoning.text += messageContent;
401- } else {
402- // Note this only works because new message above
403- // was already rendered from parts to string
404- lastMessage.content += messageContent;
405475 }
406- } else if (message.role === "thinking" && message.signature) {
407- if (lastMessage.role === "thinking") {
408- lastMessage.signature = message.signature;
476+ } else {
477+ // Note this only works because new message above
478+ // was already rendered from parts to string
479+ if (
480+ lastMessage.content.length > 0 ||
481+ messageContent.trim().length > 0
482+ ) {
483+ lastMessage.content += messageContent;
409484 }
410- } else if (
411- message.role === "assistant" &&
412- message.toolCalls?.[0] &&
413- lastMessage.role === "assistant"
414- ) {
415- // Intentionally only supporting one tool call for now.
416- const toolCallDelta = message.toolCalls[0];
417- const newToolCallState = addToolCallDeltaToState(
418- toolCallDelta,
419- lastItem.toolCallState,
420- );
421- lastItem.toolCallState = newToolCallState;
422- lastMessage.toolCalls = [newToolCallState.toolCall];
423485 }
486+ } else if (message.role === "thinking" && message.signature) {
487+ if (lastMessage.role === "thinking") {
488+ lastMessage.signature = message.signature;
489+ }
490+ } else if (
491+ message.role === "assistant" &&
492+ message.toolCalls?.[0] &&
493+ lastMessage.role === "assistant"
494+ ) {
495+ // Intentionally only supporting one tool call for now.
496+ const toolCallDelta = message.toolCalls[0];
497+ const newToolCallState = addToolCallDeltaToState(
498+ toolCallDelta,
499+ lastItem.toolCallState,
500+ );
501+ lastItem.toolCallState = newToolCallState;
502+ lastMessage.toolCalls = [newToolCallState.toolCall];
424503 }
425504 }
426505 }
modified gui/src/redux/thunks/edit.ts +35 −38
@@ -75,52 +75,49 @@
7575
7676 export const exitEdit = createAsyncThunk<
7777 void,
78- { goToMode?: MessageModes; openNewSession?: boolean },
78+ { openNewSession?: boolean },
7979 ThunkApiType
80->(
81- "edit/exit",
82- async ({ goToMode, openNewSession }, { dispatch, extra, getState }) => {
83- const state = getState();
84- const codeToEdit = state.editModeState.codeToEdit;
85- const isInEdit = state.session.isInEdit;
86- const previousModeEditorContent =
87- state.editModeState.previousModeEditorContent;
80+>("edit/exit", async ({ openNewSession }, { dispatch, extra, getState }) => {
81+ const state = getState();
82+ const codeToEdit = state.editModeState.codeToEdit;
83+ const isInEdit = state.session.isInEdit;
84+ const previousModeEditorContent =
85+ state.editModeState.previousModeEditorContent;
8886
89- if (!isInEdit) {
90- return;
91- }
87+ if (!isInEdit) {
88+ return;
89+ }
9290
93- if (codeToEdit[0] && state.editModeState.applyState.numDiffs) {
94- extra.ideMessenger.post("rejectDiff", {
95- filepath: codeToEdit[0].filepath,
96- });
97- }
91+ if (codeToEdit[0] && state.editModeState.applyState.numDiffs) {
92+ extra.ideMessenger.post("rejectDiff", {
93+ filepath: codeToEdit[0].filepath,
94+ });
95+ }
9896
99- extra.ideMessenger.post("edit/clearDecorations", undefined);
97+ extra.ideMessenger.post("edit/clearDecorations", undefined);
10098
101- dispatch(clearCodeToEdit());
102- dispatch(updateEditStateApplyState(INITIAL_EDIT_APPLY_STATE));
103- dispatch(setIsInEdit(false));
99+ dispatch(clearCodeToEdit());
100+ dispatch(updateEditStateApplyState(INITIAL_EDIT_APPLY_STATE));
101+ dispatch(setIsInEdit(false));
104102
105- // Restore the previous editor content if available
106- if (previousModeEditorContent) {
107- dispatch(setMainEditorContentTrigger(previousModeEditorContent));
108- dispatch(setPreviousModeEditorContent(undefined));
109- }
103+ // Restore the previous editor content if available
104+ if (previousModeEditorContent) {
105+ dispatch(setMainEditorContentTrigger(previousModeEditorContent));
106+ dispatch(setPreviousModeEditorContent(undefined));
107+ }
110108
111- if (openNewSession || state.editModeState.lastNonEditSessionWasEmpty) {
112- dispatch(newSession());
113- } else {
114- await dispatch(
115- loadLastSession({
116- saveCurrentSession: false,
117- }),
118- );
119- }
109+ if (openNewSession || state.editModeState.lastNonEditSessionWasEmpty) {
110+ dispatch(newSession());
111+ } else {
112+ await dispatch(
113+ loadLastSession({
114+ saveCurrentSession: false,
115+ }),
116+ );
117+ }
120118
121- dispatch(setMode(goToMode ?? state.editModeState.returnToMode));
122- },
123-);
119+ dispatch(setMode(state.editModeState.returnToMode));
120+});
124121
125122 export const enterEdit = createAsyncThunk<
126123 void,
modified gui/src/redux/thunks/streamNormalInput.ts +61 −18
@@ -1,7 +1,8 @@
11 import { createAsyncThunk, unwrapResult } from "@reduxjs/toolkit";
2-import { LLMFullCompletionOptions } from "core";
2+import { LLMFullCompletionOptions, ModelDescription, Tool } from "core";
33 import { modelSupportsTools } from "core/llm/autodetect";
44 import { ToCoreProtocol } from "core/protocol";
5+import { BuiltInToolNames } from "core/tools/builtIn";
56 import { selectActiveTools } from "../selectors/selectActiveTools";
67 import { selectCurrentToolCall } from "../selectors/selectCurrentToolCall";
78 import { selectSelectedChatModel } from "../slices/configSlice";
@@ -21,6 +22,49 @@
2122 } from "../util/constructMessages";
2223 import { callCurrentTool } from "./callCurrentTool";
2324
25+/**
26+ * Filters tools based on the selected model's capabilities.
27+ * Returns either the edit file tool or search and replace tool, but not both.
28+ */
29+function filterToolsForModel(
30+ tools: Tool[],
31+ selectedModel: ModelDescription,
32+): Tool[] {
33+ const editFileTool = tools.find(
34+ (tool) => tool.function.name === BuiltInToolNames.EditExistingFile,
35+ );
36+ const searchAndReplaceTool = tools.find(
37+ (tool) => tool.function.name === BuiltInToolNames.SearchAndReplaceInFile,
38+ );
39+
40+ // If we don't have both tools, return tools as-is
41+ if (!editFileTool || !searchAndReplaceTool) {
42+ return tools;
43+ }
44+
45+ // Determine which tool to use based on the model
46+ const shouldUseFindReplace = shouldUseFindReplaceEdits(selectedModel);
47+
48+ // Filter out the unwanted tool
49+ return tools.filter((tool) => {
50+ if (tool.function.name === BuiltInToolNames.EditExistingFile) {
51+ return !shouldUseFindReplace;
52+ }
53+ if (tool.function.name === BuiltInToolNames.SearchAndReplaceInFile) {
54+ return shouldUseFindReplace;
55+ }
56+ return true;
57+ });
58+}
59+
60+/**
61+ * Determines whether to use search and replace tool instead of edit file
62+ * Right now we only know that this is reliable with Claude models
63+ */
64+function shouldUseFindReplaceEdits(model: ModelDescription): boolean {
65+ return model.model.includes("claude");
66+}
67+
2468 export const streamNormalInput = createAsyncThunk<
2569 void,
2670 {
@@ -37,8 +81,9 @@
3781 throw new Error("No chat model selected");
3882 }
3983
40- // Get tools
41- const activeTools = selectActiveTools(state);
84+ // Get tools and filter them based on the selected model
85+ const allActiveTools = selectActiveTools(state);
86+ const activeTools = filterToolsForModel(allActiveTools, selectedChatModel);
4287 const toolsSupported = modelSupportsTools(selectedChatModel);
4388
4489 // Construct completion options
@@ -115,21 +160,19 @@
115160 dispatch(addPromptCompletionPair([next.value]));
116161
117162 try {
118- if (state.session.mode === "chat" || state.session.mode === "agent") {
119- extra.ideMessenger.post("devdata/log", {
120- name: "chatInteraction",
121- data: {
122- prompt: next.value.prompt,
123- completion: next.value.completion,
124- modelProvider: selectedChatModel.underlyingProviderName,
125- modelTitle: selectedChatModel.title,
126- sessionId: state.session.id,
127- ...(state.session.mode === "agent" && {
128- tools: activeTools.map((tool) => tool.function.name),
129- }),
130- },
131- });
132- }
163+ extra.ideMessenger.post("devdata/log", {
164+ name: "chatInteraction",
165+ data: {
166+ prompt: next.value.prompt,
167+ completion: next.value.completion,
168+ modelProvider: selectedChatModel.underlyingProviderName,
169+ modelTitle: selectedChatModel.title,
170+ sessionId: state.session.id,
171+ ...(!!activeTools.length && {
172+ tools: activeTools.map((tool) => tool.function.name),
173+ }),
174+ },
175+ });
133176 // else if (state.session.mode === "edit") {
134177 // extra.ideMessenger.post("devdata/log", {
135178 // name: "editInteraction",
modified gui/src/redux/thunks/streamThunkWrapper.tsx +1 −1
@@ -17,7 +17,7 @@
1717 try {
1818 await runStream();
1919 const state = getState();
20- if (state.session.mode === "chat" || state.session.mode === "agent") {
20+ if (!state.session.isInEdit) {
2121 await dispatch(
2222 saveCurrentSession({
2323 openNewSession: false,
modified gui/src/redux/util/constructMessages.test.ts +13 −1
@@ -12,6 +12,7 @@
1212 import {
1313 DEFAULT_AGENT_SYSTEM_MESSAGE,
1414 DEFAULT_CHAT_SYSTEM_MESSAGE,
15+ DEFAULT_PLAN_SYSTEM_MESSAGE,
1516 } from "core/llm/defaultSystemMessages";
1617 import { renderChatMessage } from "core/util/messageContent";
1718 import { beforeEach, describe, expect, test, vi } from "vitest";
@@ -90,8 +91,9 @@
9091
9192 test("getBaseSystemMessage should return the correct system message based on mode", () => {
9293 const mockModel = {
93- baseAgentSystemMessage: "Custom Agent System Message",
9494 baseChatSystemMessage: "Custom Chat System Message",
95+ basePlanSystemMessage: "Custom Plan System Message",
96+ baseAgentSystemMessage: "Custom Agent System Message",
9597 } as ModelDescription;
9698
9799 // Test agent mode with custom message
@@ -99,6 +101,11 @@
99101 "Custom Agent System Message",
100102 );
101103
104+ // Test plan mode with custom message
105+ expect(getBaseSystemMessage("plan", mockModel)).toBe(
106+ "Custom Plan System Message",
107+ );
108+
102109 // Test chat mode with custom message
103110 expect(getBaseSystemMessage("chat", mockModel)).toBe(
104111 "Custom Chat System Message",
@@ -109,6 +116,11 @@
109116 DEFAULT_AGENT_SYSTEM_MESSAGE,
110117 );
111118
119+ // Test agent mode with default message
120+ expect(getBaseSystemMessage("plan", {} as ModelDescription)).toBe(
121+ DEFAULT_PLAN_SYSTEM_MESSAGE,
122+ );
123+
112124 // Test chat mode with default message
113125 expect(getBaseSystemMessage("chat", {} as ModelDescription)).toBe(
114126 DEFAULT_CHAT_SYSTEM_MESSAGE,
modified gui/src/redux/util/constructMessages.ts +3 −0
@@ -11,6 +11,7 @@
1111 import {
1212 DEFAULT_AGENT_SYSTEM_MESSAGE,
1313 DEFAULT_CHAT_SYSTEM_MESSAGE,
14+ DEFAULT_PLAN_SYSTEM_MESSAGE,
1415 } from "core/llm/defaultSystemMessages";
1516 import { chatMessageIsEmpty } from "core/llm/messages";
1617 import { getSystemMessageWithRules } from "core/llm/rules/getSystemMessageWithRules";
@@ -167,6 +168,8 @@
167168 ): string {
168169 if (messageMode === "agent") {
169170 return model.baseAgentSystemMessage ?? DEFAULT_AGENT_SYSTEM_MESSAGE;
171+ } else if (messageMode === "plan") {
172+ return model.basePlanSystemMessage ?? DEFAULT_PLAN_SYSTEM_MESSAGE;
170173 } else {
171174 return model.baseChatSystemMessage ?? DEFAULT_CHAT_SYSTEM_MESSAGE;
172175 }
modified packages/config-yaml/package.json +1 −1
@@ -1,6 +1,6 @@
11 {
22 "name": "@continuedev/config-yaml",
3- "version": "1.0.95",
3+ "version": "1.0.96",
44 "description": "",
55 "main": "dist/index.js",
66 "types": "dist/index.d.ts",
modified packages/config-yaml/src/load/clientRender.ts +24 −2
@@ -133,7 +133,27 @@
133133 const apiKeyLocation = getUnrenderedSecretLocation(
134134 config.models[i]?.apiKey,
135135 );
136- if (apiKeyLocation) {
136+ const encodedApiKeyLocation = apiKeyLocation
137+ ? encodeSecretLocation(apiKeyLocation)
138+ : undefined;
139+
140+ let encodedEnvSecretLocations: Record<string, string> | undefined =
141+ undefined;
142+ if (config.models[i]?.env) {
143+ Object.entries(config.models[i]?.env!).forEach(([key, value]) => {
144+ if (typeof value === "string") {
145+ const secretLocation = getUnrenderedSecretLocation(value);
146+ if (secretLocation) {
147+ encodedEnvSecretLocations = {
148+ ...encodedEnvSecretLocations,
149+ [key]: encodeSecretLocation(secretLocation),
150+ };
151+ }
152+ }
153+ });
154+ }
155+
156+ if (encodedApiKeyLocation || encodedEnvSecretLocations) {
137157 config.models[i] = {
138158 ...config.models[i],
139159 name: config.models[i]?.name ?? "",
@@ -143,7 +163,8 @@
143163 config.models[i]?.provider ?? "",
144164 config.models[i]?.model ?? "",
145165 ),
146- apiKeyLocation: encodeSecretLocation(apiKeyLocation),
166+ apiKeyLocation: encodedApiKeyLocation,
167+ envSecretLocations: encodedEnvSecretLocations,
147168 orgScopeId,
148169 onPremProxyUrl,
149170 apiKey: undefined,
@@ -158,6 +179,7 @@
158179 /** The additional properties that are added to the otherwise OpenAI-compatible body when requesting a Continue proxy */
159180 export const continuePropertiesSchema = z.object({
160181 apiKeyLocation: z.string().optional(),
182+ envSecretLocations: z.record(z.string(), z.string()).optional(),
161183 apiBase: z.string().optional(),
162184 orgScopeId: z.string().nullable(),
163185 env: z.record(z.string(), z.any()).optional(),
modified packages/config-yaml/src/load/unroll.ts +181 −84
@@ -24,7 +24,7 @@
2424 packageIdentifierToShorthandSlug,
2525 useProxyForUnrenderedSecrets,
2626 } from "./clientRender.js";
27-import { getBlockType } from "./getBlockType.js";
27+import { BlockType, getBlockType } from "./getBlockType.js";
2828
2929 export function parseConfigYaml(configYaml: string): ConfigYaml {
3030 try {
@@ -322,12 +322,15 @@
322322 "name" | "version" | "rules" | "schema" | "metadata"
323323 >)[] = ["models", "context", "data", "mcpServers", "prompts", "docs"];
324324
325- // For each section, replace "uses/with" blocks with the real thing
326- for (const section of sections) {
327- if (assistant[section]) {
328- const sectionBlocks: any[] = [];
325+ // Process all sections in parallel
326+ const sectionPromises = sections.map(async (section) => {
327+ if (!assistant[section]) {
328+ return { section, blocks: null };
329+ }
329330
330- for (const unrolledBlock of assistant[section]) {
331+ // Process all blocks in this section in parallel
332+ const blockPromises = assistant[section].map(
333+ async (unrolledBlock, index) => {
331334 // "uses/with" block
332335 if ("uses" in unrolledBlock) {
333336 try {
@@ -338,10 +341,13 @@
338341 );
339342 const block = blockConfigYaml[section]?.[0];
340343 if (block) {
341- sectionBlocks.push(
342- mergeOverrides(block, unrolledBlock.override ?? {}),
343- );
344+ return {
345+ index,
346+ block: mergeOverrides(block, unrolledBlock.override ?? {}),
347+ error: null,
348+ };
344349 }
350+ return { index, block: null, error: null };
345351 } catch (err) {
346352 let msg = "";
347353 if (
@@ -353,99 +359,190 @@
353359 msg = `${(err as Error).message}.\n> ${JSON.stringify(unrolledBlock.uses)}`;
354360 }
355361
356- errors.push({
357- fatal: false,
358- message: msg,
359- });
360-
361362 console.error(
362363 `Failed to unroll block ${JSON.stringify(unrolledBlock.uses)}: ${(err as Error).message}`,
363364 );
364- sectionBlocks.push(null);
365+
366+ return {
367+ index,
368+ block: null,
369+ error: {
370+ fatal: false,
371+ message: msg,
372+ },
373+ };
365374 }
366375 } else {
367376 // Normal block
368- sectionBlocks.push(unrolledBlock);
377+ return { index, block: unrolledBlock, error: null };
369378 }
370- }
379+ },
380+ );
381+
382+ const blockResults = await Promise.all(blockPromises);
383+
384+ // Collect errors and maintain order
385+ const sectionBlocks: any[] = [];
386+ const sectionErrors: ConfigValidationError[] = [];
371387
372- unrolledAssistant[section] = sectionBlocks;
388+ for (const result of blockResults) {
389+ if (result.error) {
390+ sectionErrors.push(result.error);
391+ }
392+ sectionBlocks[result.index] = result.block;
373393 }
374- }
375394
376- // Rules are a bit different because they can be strings, so handle separately
377- if (assistant.rules) {
378- const rules: (Rule | null)[] = [];
379- for (const rule of assistant.rules) {
380- if (typeof rule === "string" || !("uses" in rule)) {
381- rules.push(rule);
382- } else if ("uses" in rule) {
383- try {
384- const blockConfigYaml = await resolveBlock(
385- decodePackageIdentifier(rule.uses),
386- rule.with,
387- registry,
388- );
389- const block = blockConfigYaml.rules?.[0];
390- if (block) {
391- rules.push(block);
395+ return { section, blocks: sectionBlocks, errors: sectionErrors };
396+ });
397+
398+ // Process rules in parallel
399+ const rulesPromise = assistant.rules
400+ ? (async () => {
401+ const rulePromises = assistant.rules!.map(async (rule, index) => {
402+ if (typeof rule === "string" || !("uses" in rule)) {
403+ return { index, rule, error: null };
404+ } else if ("uses" in rule) {
405+ try {
406+ const blockConfigYaml = await resolveBlock(
407+ decodePackageIdentifier(rule.uses),
408+ rule.with,
409+ registry,
410+ );
411+ const block = blockConfigYaml.rules?.[0];
412+ return { index, rule: block || null, error: null };
413+ } catch (err) {
414+ console.error(
415+ `Failed to unroll block ${rule.uses}: ${(err as Error).message}`,
416+ );
417+
418+ return {
419+ index,
420+ rule: null,
421+ error: {
422+ fatal: false,
423+ message: `${(err as Error).message}:\n${rule.uses}`,
424+ },
425+ };
426+ }
427+ }
428+ return { index, rule: null, error: null };
429+ });
430+
431+ const ruleResults = await Promise.all(rulePromises);
432+
433+ const rules: (Rule | null)[] = [];
434+ const ruleErrors: ConfigValidationError[] = [];
435+
436+ for (const result of ruleResults) {
437+ if (result.error) {
438+ ruleErrors.push(result.error);
392439 }
393- } catch (err) {
394- errors.push({
395- fatal: false,
396- message: `${(err as Error).message}:\n${rule.uses}`,
397- });
398-
399- console.error(
400- `Failed to unroll block ${rule.uses}: ${(err as Error).message}`,
401- );
402- rules.push(null);
440+ rules[result.index] = result.rule;
403441 }
404- }
442+
443+ return { rules, errors: ruleErrors };
444+ })()
445+ : Promise.resolve({ rules: undefined, errors: [] });
446+
447+ // Process injected blocks in parallel
448+ const injectedBlocksPromise = injectBlocks
449+ ? (async () => {
450+ const injectedBlockPromises = injectBlocks.map(async (injectBlock) => {
451+ try {
452+ const blockConfigYaml = await registry.getContent(injectBlock);
453+ const parsedBlock = parseMarkdownRuleOrConfigYaml(
454+ blockConfigYaml,
455+ injectBlock,
456+ );
457+ const blockType = getBlockType(parsedBlock);
458+ const resolvedBlock = await resolveBlock(
459+ injectBlock,
460+ undefined,
461+ registry,
462+ );
463+
464+ return {
465+ blockType,
466+ resolvedBlock,
467+ error: null,
468+ };
469+ } catch (err) {
470+ let msg = "";
471+ if (injectBlock.uriType === "file") {
472+ msg = `${(err as Error).message}.\n> ${injectBlock.filePath}`;
473+ } else {
474+ msg = `${(err as Error).message}.\n> ${injectBlock.fullSlug}`;
475+ }
476+
477+ console.error(
478+ `Failed to unroll block ${JSON.stringify(injectBlock)}: ${(err as Error).message}`,
479+ );
480+
481+ return {
482+ blockType: null,
483+ resolvedBlock: null,
484+ error: {
485+ fatal: false,
486+ message: msg,
487+ },
488+ };
489+ }
490+ });
491+
492+ const injectedResults = await Promise.all(injectedBlockPromises);
493+ const injectedErrors: ConfigValidationError[] = [];
494+ const injectedBlocks: { blockType: string; resolvedBlock: any }[] = [];
495+
496+ for (const result of injectedResults) {
497+ if (result.error) {
498+ injectedErrors.push(result.error);
499+ } else if (result.blockType && result.resolvedBlock) {
500+ injectedBlocks.push({
501+ blockType: result.blockType,
502+ resolvedBlock: result.resolvedBlock,
503+ });
504+ }
505+ }
506+
507+ return { injectedBlocks, errors: injectedErrors };
508+ })()
509+ : Promise.resolve({ injectedBlocks: [], errors: [] });
510+
511+ // Wait for all parallel operations to complete
512+ const [sectionResults, rulesResult, injectedResult] = await Promise.all([
513+ Promise.all(sectionPromises),
514+ rulesPromise,
515+ injectedBlocksPromise,
516+ ]);
517+
518+ // Collect all errors
519+ for (const sectionResult of sectionResults) {
520+ if (sectionResult.errors) {
521+ errors.push(...sectionResult.errors);
405522 }
523+ }
524+ errors.push(...rulesResult.errors);
525+ errors.push(...injectedResult.errors);
526+
527+ // Assign section results
528+ for (const sectionResult of sectionResults) {
529+ if (sectionResult.blocks) {
530+ unrolledAssistant[sectionResult.section] = sectionResult.blocks;
531+ }
532+ }
406533
407- unrolledAssistant.rules = rules;
534+ // Assign rules result
535+ if (rulesResult.rules) {
536+ unrolledAssistant.rules = rulesResult.rules;
408537 }
409538
410539 // Add injected blocks
411- for (const injectBlock of injectBlocks ?? []) {
412- try {
413- const blockConfigYaml = await registry.getContent(injectBlock);
414- const parsedBlock = parseMarkdownRuleOrConfigYaml(
415- blockConfigYaml,
416- injectBlock,
417- );
418- const blockType = getBlockType(parsedBlock);
419- const resolvedBlock = await resolveBlock(
420- injectBlock,
421- undefined,
422- registry,
423- );
424-
425- if (blockType) {
426- if (!unrolledAssistant[blockType]) {
427- unrolledAssistant[blockType] = [];
428- }
429- unrolledAssistant[blockType]?.push(
430- ...(resolvedBlock[blockType] as any),
431- );
432- }
433- } catch (err) {
434- let msg = "";
435- if (injectBlock.uriType === "file") {
436- msg = `${(err as Error).message}.\n> ${injectBlock.filePath}`;
437- } else {
438- msg = `${(err as Error).message}.\n> ${injectBlock.fullSlug}`;
439- }
440- errors.push({
441- fatal: false,
442- message: msg,
443- });
444-
445- console.error(
446- `Failed to unroll block ${JSON.stringify(injectBlock)}: ${(err as Error).message}`,
447- );
540+ for (const { blockType, resolvedBlock } of injectedResult.injectedBlocks) {
541+ const key = blockType as BlockType;
542+ if (!unrolledAssistant[key]) {
543+ unrolledAssistant[key] = [];
448544 }
545+ unrolledAssistant[key]?.push(...((resolvedBlock[blockType] ?? []) as any));
449546 }
450547
451548 const configResult: ConfigResult<AssistantUnrolled> = {
modified packages/config-yaml/src/schemas/index.ts +1 −0
@@ -22,6 +22,7 @@
2222 faviconUrl: z.string().optional(),
2323 args: z.array(z.string()).optional(),
2424 env: z.record(z.string()).optional(),
25+ cwd: z.string().optional(),
2526 connectionTimeout: z.number().gt(0).optional(),
2627 requestOptions: requestOptionsSchema.optional(),
2728 });
modified packages/config-yaml/src/schemas/models.ts +5 −2
@@ -85,6 +85,7 @@
8585 export const chatOptionsSchema = z.object({
8686 baseSystemMessage: z.string().optional(),
8787 baseAgentSystemMessage: z.string().optional(),
88+ basePlanSystemMessage: z.string().optional(),
8889 });
8990 export type ChatOptions = z.infer<typeof chatOptionsSchema>;
9091
@@ -154,7 +155,8 @@
154155 z.object({
155156 ...baseModelFields,
156157 provider: z.literal("continue-proxy"),
157- apiKeyLocation: z.string(),
158+ apiKeyLocation: z.string().optional(),
159+ envSecretLocations: z.record(z.string(), z.string()).optional(),
158160 orgScopeId: z.string().nullable(),
159161 onPremProxyUrl: z.string().nullable(),
160162 }),
@@ -169,7 +171,8 @@
169171 .object({
170172 ...baseModelFields,
171173 provider: z.literal("continue-proxy"),
172- apiKeyLocation: z.string(),
174+ apiKeyLocation: z.string().optional(),
175+ envSecretLocations: z.record(z.string(), z.string()).optional(),
173176 })
174177 .partial(),
175178 z
modified packages/continue-sdk/typescript/src/createOpenAIClient.ts +3 −2
@@ -71,14 +71,15 @@
7171 );
7272 }
7373
74- if (!("apiKeyLocation" in modelConfig)) {
74+ if (!("apiKeyLocation" in modelConfig) && !("envSecretLocations" in modelConfig)) {
7575 throw new Error(
76- `Model ${modelName} does not have an apiKeyLocation defined`,
76+ `Model ${modelName} does not have an apiKeyLocation or envSecretLocations defined`,
7777 );
7878 }
7979
8080 const continueProperties: ContinueProperties = {
8181 apiKeyLocation: modelConfig.apiKeyLocation,
82+ envSecretLocations: modelConfig.envSecretLocations,
8283 orgScopeId: organizationId ?? null,
8384 };
8485
modified packages/openai-adapters/package-lock.json +1718 −193
@@ -9,6 +9,8 @@
99 "version": "1.0.44",
1010 "license": "Apache-2.0",
1111 "dependencies": {
12+ "@aws-sdk/client-bedrock-runtime": "^3.842.0",
13+ "@aws-sdk/credential-providers": "^3.840.0",
1214 "@continuedev/config-types": "^1.0.5",
1315 "@continuedev/config-yaml": "^1.0.51",
1416 "@continuedev/fetch": "^1.0.15",
@@ -42,6 +44,827 @@
4244 "node": ">=6.0.0"
4345 }
4446 },
47+ "node_modules/@aws-crypto/crc32": {
48+ "version": "5.2.0",
49+ "resolved": "https://registry.npmjs.org/@aws-crypto/crc32/-/crc32-5.2.0.tgz",
50+ "integrity": "sha512-nLbCWqQNgUiwwtFsen1AdzAtvuLRsQS8rYgMuxCrdKf9kOssamGLuPwyTY9wyYblNr9+1XM8v6zoDTPPSIeANg==",
51+ "license": "Apache-2.0",
52+ "dependencies": {
53+ "@aws-crypto/util": "^5.2.0",
54+ "@aws-sdk/types": "^3.222.0",
55+ "tslib": "^2.6.2"
56+ },
57+ "engines": {
58+ "node": ">=16.0.0"
59+ }
60+ },
61+ "node_modules/@aws-crypto/sha256-browser": {
62+ "version": "5.2.0",
63+ "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-5.2.0.tgz",
64+ "integrity": "sha512-AXfN/lGotSQwu6HNcEsIASo7kWXZ5HYWvfOmSNKDsEqC4OashTp8alTmaz+F7TC2L083SFv5RdB+qU3Vs1kZqw==",
65+ "license": "Apache-2.0",
66+ "dependencies": {
67+ "@aws-crypto/sha256-js": "^5.2.0",
68+ "@aws-crypto/supports-web-crypto": "^5.2.0",
69+ "@aws-crypto/util": "^5.2.0",
70+ "@aws-sdk/types": "^3.222.0",
71+ "@aws-sdk/util-locate-window": "^3.0.0",
72+ "@smithy/util-utf8": "^2.0.0",
73+ "tslib": "^2.6.2"
74+ }
75+ },
76+ "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/is-array-buffer": {
77+ "version": "2.2.0",
78+ "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz",
79+ "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==",
80+ "license": "Apache-2.0",
81+ "dependencies": {
82+ "tslib": "^2.6.2"
83+ },
84+ "engines": {
85+ "node": ">=14.0.0"
86+ }
87+ },
88+ "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/util-buffer-from": {
89+ "version": "2.2.0",
90+ "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz",
91+ "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==",
92+ "license": "Apache-2.0",
93+ "dependencies": {
94+ "@smithy/is-array-buffer": "^2.2.0",
95+ "tslib": "^2.6.2"
96+ },
97+ "engines": {
98+ "node": ">=14.0.0"
99+ }
100+ },
101+ "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/util-utf8": {
102+ "version": "2.3.0",
103+ "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz",
104+ "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==",
105+ "license": "Apache-2.0",
106+ "dependencies": {
107+ "@smithy/util-buffer-from": "^2.2.0",
108+ "tslib": "^2.6.2"
109+ },
110+ "engines": {
111+ "node": ">=14.0.0"
112+ }
113+ },
114+ "node_modules/@aws-crypto/sha256-js": {
115+ "version": "5.2.0",
116+ "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-5.2.0.tgz",
117+ "integrity": "sha512-FFQQyu7edu4ufvIZ+OadFpHHOt+eSTBaYaki44c+akjg7qZg9oOQeLlk77F6tSYqjDAFClrHJk9tMf0HdVyOvA==",
118+ "license": "Apache-2.0",
119+ "dependencies": {
120+ "@aws-crypto/util": "^5.2.0",
121+ "@aws-sdk/types": "^3.222.0",
122+ "tslib": "^2.6.2"
123+ },
124+ "engines": {
125+ "node": ">=16.0.0"
126+ }
127+ },
128+ "node_modules/@aws-crypto/supports-web-crypto": {
129+ "version": "5.2.0",
130+ "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-5.2.0.tgz",
131+ "integrity": "sha512-iAvUotm021kM33eCdNfwIN//F77/IADDSs58i+MDaOqFrVjZo9bAal0NK7HurRuWLLpF1iLX7gbWrjHjeo+YFg==",
132+ "license": "Apache-2.0",
133+ "dependencies": {
134+ "tslib": "^2.6.2"
135+ }
136+ },
137+ "node_modules/@aws-crypto/util": {
138+ "version": "5.2.0",
139+ "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-5.2.0.tgz",
140+ "integrity": "sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ==",
141+ "license": "Apache-2.0",
142+ "dependencies": {
143+ "@aws-sdk/types": "^3.222.0",
144+ "@smithy/util-utf8": "^2.0.0",
145+ "tslib": "^2.6.2"
146+ }
147+ },
148+ "node_modules/@aws-crypto/util/node_modules/@smithy/is-array-buffer": {
149+ "version": "2.2.0",
150+ "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz",
151+ "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==",
152+ "license": "Apache-2.0",
153+ "dependencies": {
154+ "tslib": "^2.6.2"
155+ },
156+ "engines": {
157+ "node": ">=14.0.0"
158+ }
159+ },
160+ "node_modules/@aws-crypto/util/node_modules/@smithy/util-buffer-from": {
161+ "version": "2.2.0",
162+ "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz",
163+ "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==",
164+ "license": "Apache-2.0",
165+ "dependencies": {
166+ "@smithy/is-array-buffer": "^2.2.0",
167+ "tslib": "^2.6.2"
168+ },
169+ "engines": {
170+ "node": ">=14.0.0"
171+ }
172+ },
173+ "node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8": {
174+ "version": "2.3.0",
175+ "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz",
176+ "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==",
177+ "license": "Apache-2.0",
178+ "dependencies": {
179+ "@smithy/util-buffer-from": "^2.2.0",
180+ "tslib": "^2.6.2"
181+ },
182+ "engines": {
183+ "node": ">=14.0.0"
184+ }
185+ },
186+ "node_modules/@aws-sdk/client-bedrock-runtime": {
187+ "version": "3.842.0",
188+ "resolved": "https://registry.npmjs.org/@aws-sdk/client-bedrock-runtime/-/client-bedrock-runtime-3.842.0.tgz",
189+ "integrity": "sha512-CrGuU9YGqYZPm2hjjqJYC5+HMjky/HuvlUmboFDdpH96mwm/RrUQAO6sXYojeUPy9ceidUiHd3HskqvpiMTl2Q==",
190+ "license": "Apache-2.0",
191+ "dependencies": {
192+ "@aws-crypto/sha256-browser": "5.2.0",
193+ "@aws-crypto/sha256-js": "5.2.0",
194+ "@aws-sdk/core": "3.840.0",
195+ "@aws-sdk/credential-provider-node": "3.840.0",
196+ "@aws-sdk/eventstream-handler-node": "3.840.0",
197+ "@aws-sdk/middleware-eventstream": "3.840.0",
198+ "@aws-sdk/middleware-host-header": "3.840.0",
199+ "@aws-sdk/middleware-logger": "3.840.0",
200+ "@aws-sdk/middleware-recursion-detection": "3.840.0",
201+ "@aws-sdk/middleware-user-agent": "3.840.0",
202+ "@aws-sdk/middleware-websocket": "3.840.0",
203+ "@aws-sdk/region-config-resolver": "3.840.0",
204+ "@aws-sdk/token-providers": "3.840.0",
205+ "@aws-sdk/types": "3.840.0",
206+ "@aws-sdk/util-endpoints": "3.840.0",
207+ "@aws-sdk/util-user-agent-browser": "3.840.0",
208+ "@aws-sdk/util-user-agent-node": "3.840.0",
209+ "@smithy/config-resolver": "^4.1.4",
210+ "@smithy/core": "^3.6.0",
211+ "@smithy/eventstream-serde-browser": "^4.0.4",
212+ "@smithy/eventstream-serde-config-resolver": "^4.1.2",
213+ "@smithy/eventstream-serde-node": "^4.0.4",
214+ "@smithy/fetch-http-handler": "^5.0.4",
215+ "@smithy/hash-node": "^4.0.4",
216+ "@smithy/invalid-dependency": "^4.0.4",
217+ "@smithy/middleware-content-length": "^4.0.4",
218+ "@smithy/middleware-endpoint": "^4.1.13",
219+ "@smithy/middleware-retry": "^4.1.14",
220+ "@smithy/middleware-serde": "^4.0.8",
221+ "@smithy/middleware-stack": "^4.0.4",
222+ "@smithy/node-config-provider": "^4.1.3",
223+ "@smithy/node-http-handler": "^4.0.6",
224+ "@smithy/protocol-http": "^5.1.2",
225+ "@smithy/smithy-client": "^4.4.5",
226+ "@smithy/types": "^4.3.1",
227+ "@smithy/url-parser": "^4.0.4",
228+ "@smithy/util-base64": "^4.0.0",
229+ "@smithy/util-body-length-browser": "^4.0.0",
230+ "@smithy/util-body-length-node": "^4.0.0",
231+ "@smithy/util-defaults-mode-browser": "^4.0.21",
232+ "@smithy/util-defaults-mode-node": "^4.0.21",
233+ "@smithy/util-endpoints": "^3.0.6",
234+ "@smithy/util-middleware": "^4.0.4",
235+ "@smithy/util-retry": "^4.0.6",
236+ "@smithy/util-stream": "^4.2.2",
237+ "@smithy/util-utf8": "^4.0.0",
238+ "@types/uuid": "^9.0.1",
239+ "tslib": "^2.6.2",
240+ "uuid": "^9.0.1"
241+ },
242+ "engines": {
243+ "node": ">=18.0.0"
244+ }
245+ },
246+ "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/uuid": {
247+ "version": "9.0.1",
248+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz",
249+ "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==",
250+ "funding": [
251+ "https://github.com/sponsors/broofa",
252+ "https://github.com/sponsors/ctavan"
253+ ],
254+ "license": "MIT",
255+ "bin": {
256+ "uuid": "dist/bin/uuid"
257+ }
258+ },
259+ "node_modules/@aws-sdk/client-cognito-identity": {
260+ "version": "3.840.0",
261+ "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.840.0.tgz",
262+ "integrity": "sha512-0sn/X63Xqqh5D1FYmdSHiS9SkDzTitoGO++/8IFik4xf/jpn4ZQkIoDPvpxFZcLvebMuUa6jAQs4ap4RusKGkg==",
263+ "license": "Apache-2.0",
264+ "dependencies": {
265+ "@aws-crypto/sha256-browser": "5.2.0",
266+ "@aws-crypto/sha256-js": "5.2.0",
267+ "@aws-sdk/core": "3.840.0",
268+ "@aws-sdk/credential-provider-node": "3.840.0",
269+ "@aws-sdk/middleware-host-header": "3.840.0",
270+ "@aws-sdk/middleware-logger": "3.840.0",
271+ "@aws-sdk/middleware-recursion-detection": "3.840.0",
272+ "@aws-sdk/middleware-user-agent": "3.840.0",
273+ "@aws-sdk/region-config-resolver": "3.840.0",
274+ "@aws-sdk/types": "3.840.0",
275+ "@aws-sdk/util-endpoints": "3.840.0",
276+ "@aws-sdk/util-user-agent-browser": "3.840.0",
277+ "@aws-sdk/util-user-agent-node": "3.840.0",
278+ "@smithy/config-resolver": "^4.1.4",
279+ "@smithy/core": "^3.6.0",
280+ "@smithy/fetch-http-handler": "^5.0.4",
281+ "@smithy/hash-node": "^4.0.4",
282+ "@smithy/invalid-dependency": "^4.0.4",
283+ "@smithy/middleware-content-length": "^4.0.4",
284+ "@smithy/middleware-endpoint": "^4.1.13",
285+ "@smithy/middleware-retry": "^4.1.14",
286+ "@smithy/middleware-serde": "^4.0.8",
287+ "@smithy/middleware-stack": "^4.0.4",
288+ "@smithy/node-config-provider": "^4.1.3",
289+ "@smithy/node-http-handler": "^4.0.6",
290+ "@smithy/protocol-http": "^5.1.2",
291+ "@smithy/smithy-client": "^4.4.5",
292+ "@smithy/types": "^4.3.1",
293+ "@smithy/url-parser": "^4.0.4",
294+ "@smithy/util-base64": "^4.0.0",
295+ "@smithy/util-body-length-browser": "^4.0.0",
296+ "@smithy/util-body-length-node": "^4.0.0",
297+ "@smithy/util-defaults-mode-browser": "^4.0.21",
298+ "@smithy/util-defaults-mode-node": "^4.0.21",
299+ "@smithy/util-endpoints": "^3.0.6",
300+ "@smithy/util-middleware": "^4.0.4",
301+ "@smithy/util-retry": "^4.0.6",
302+ "@smithy/util-utf8": "^4.0.0",
303+ "tslib": "^2.6.2"
304+ },
305+ "engines": {
306+ "node": ">=18.0.0"
307+ }
308+ },
309+ "node_modules/@aws-sdk/client-sso": {
310+ "version": "3.840.0",
311+ "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.840.0.tgz",
312+ "integrity": "sha512-3Zp+FWN2hhmKdpS0Ragi5V2ZPsZNScE3jlbgoJjzjI/roHZqO+e3/+XFN4TlM0DsPKYJNp+1TAjmhxN6rOnfYA==",
313+ "license": "Apache-2.0",
314+ "dependencies": {
315+ "@aws-crypto/sha256-browser": "5.2.0",
316+ "@aws-crypto/sha256-js": "5.2.0",
317+ "@aws-sdk/core": "3.840.0",
318+ "@aws-sdk/middleware-host-header": "3.840.0",
319+ "@aws-sdk/middleware-logger": "3.840.0",
320+ "@aws-sdk/middleware-recursion-detection": "3.840.0",
321+ "@aws-sdk/middleware-user-agent": "3.840.0",
322+ "@aws-sdk/region-config-resolver": "3.840.0",
323+ "@aws-sdk/types": "3.840.0",
324+ "@aws-sdk/util-endpoints": "3.840.0",
325+ "@aws-sdk/util-user-agent-browser": "3.840.0",
326+ "@aws-sdk/util-user-agent-node": "3.840.0",
327+ "@smithy/config-resolver": "^4.1.4",
328+ "@smithy/core": "^3.6.0",
329+ "@smithy/fetch-http-handler": "^5.0.4",
330+ "@smithy/hash-node": "^4.0.4",
331+ "@smithy/invalid-dependency": "^4.0.4",
332+ "@smithy/middleware-content-length": "^4.0.4",
333+ "@smithy/middleware-endpoint": "^4.1.13",
334+ "@smithy/middleware-retry": "^4.1.14",
335+ "@smithy/middleware-serde": "^4.0.8",
336+ "@smithy/middleware-stack": "^4.0.4",
337+ "@smithy/node-config-provider": "^4.1.3",
338+ "@smithy/node-http-handler": "^4.0.6",
339+ "@smithy/protocol-http": "^5.1.2",
340+ "@smithy/smithy-client": "^4.4.5",
341+ "@smithy/types": "^4.3.1",
342+ "@smithy/url-parser": "^4.0.4",
343+ "@smithy/util-base64": "^4.0.0",
344+ "@smithy/util-body-length-browser": "^4.0.0",
345+ "@smithy/util-body-length-node": "^4.0.0",
346+ "@smithy/util-defaults-mode-browser": "^4.0.21",
347+ "@smithy/util-defaults-mode-node": "^4.0.21",
348+ "@smithy/util-endpoints": "^3.0.6",
349+ "@smithy/util-middleware": "^4.0.4",
350+ "@smithy/util-retry": "^4.0.6",
351+ "@smithy/util-utf8": "^4.0.0",
352+ "tslib": "^2.6.2"
353+ },
354+ "engines": {
355+ "node": ">=18.0.0"
356+ }
357+ },
358+ "node_modules/@aws-sdk/core": {
359+ "version": "3.840.0",
360+ "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.840.0.tgz",
361+ "integrity": "sha512-x3Zgb39tF1h2XpU+yA4OAAQlW6LVEfXNlSedSYJ7HGKXqA/E9h3rWQVpYfhXXVVsLdYXdNw5KBUkoAoruoZSZA==",
362+ "license": "Apache-2.0",
363+ "dependencies": {
364+ "@aws-sdk/types": "3.840.0",
365+ "@aws-sdk/xml-builder": "3.821.0",
366+ "@smithy/core": "^3.6.0",
367+ "@smithy/node-config-provider": "^4.1.3",
368+ "@smithy/property-provider": "^4.0.4",
369+ "@smithy/protocol-http": "^5.1.2",
370+ "@smithy/signature-v4": "^5.1.2",
371+ "@smithy/smithy-client": "^4.4.5",
372+ "@smithy/types": "^4.3.1",
373+ "@smithy/util-base64": "^4.0.0",
374+ "@smithy/util-body-length-browser": "^4.0.0",
375+ "@smithy/util-middleware": "^4.0.4",
376+ "@smithy/util-utf8": "^4.0.0",
377+ "fast-xml-parser": "4.4.1",
378+ "tslib": "^2.6.2"
379+ },
380+ "engines": {
381+ "node": ">=18.0.0"
382+ }
383+ },
384+ "node_modules/@aws-sdk/credential-provider-cognito-identity": {
385+ "version": "3.840.0",
386+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.840.0.tgz",
387+ "integrity": "sha512-p1RaMVd6+6ruYjKsWRCZT/jWhrYfDKbXY+/ScIYTvcaOOf9ArMtVnhFk3egewrC7kPXFGRYhg2GPmxRotNYMng==",
388+ "license": "Apache-2.0",
389+ "dependencies": {
390+ "@aws-sdk/client-cognito-identity": "3.840.0",
391+ "@aws-sdk/types": "3.840.0",
392+ "@smithy/property-provider": "^4.0.4",
393+ "@smithy/types": "^4.3.1",
394+ "tslib": "^2.6.2"
395+ },
396+ "engines": {
397+ "node": ">=18.0.0"
398+ }
399+ },
400+ "node_modules/@aws-sdk/credential-provider-env": {
401+ "version": "3.840.0",
402+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.840.0.tgz",
403+ "integrity": "sha512-EzF6VcJK7XvQ/G15AVEfJzN2mNXU8fcVpXo4bRyr1S6t2q5zx6UPH/XjDbn18xyUmOq01t+r8gG+TmHEVo18fA==",
404+ "license": "Apache-2.0",
405+ "dependencies": {
406+ "@aws-sdk/core": "3.840.0",
407+ "@aws-sdk/types": "3.840.0",
408+ "@smithy/property-provider": "^4.0.4",
409+ "@smithy/types": "^4.3.1",
410+ "tslib": "^2.6.2"
411+ },
412+ "engines": {
413+ "node": ">=18.0.0"
414+ }
415+ },
416+ "node_modules/@aws-sdk/credential-provider-http": {
417+ "version": "3.840.0",
418+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.840.0.tgz",
419+ "integrity": "sha512-wbnUiPGLVea6mXbUh04fu+VJmGkQvmToPeTYdHE8eRZq3NRDi3t3WltT+jArLBKD/4NppRpMjf2ju4coMCz91g==",
420+ "license": "Apache-2.0",
421+ "dependencies": {
422+ "@aws-sdk/core": "3.840.0",
423+ "@aws-sdk/types": "3.840.0",
424+ "@smithy/fetch-http-handler": "^5.0.4",
425+ "@smithy/node-http-handler": "^4.0.6",
426+ "@smithy/property-provider": "^4.0.4",
427+ "@smithy/protocol-http": "^5.1.2",
428+ "@smithy/smithy-client": "^4.4.5",
429+ "@smithy/types": "^4.3.1",
430+ "@smithy/util-stream": "^4.2.2",
431+ "tslib": "^2.6.2"
432+ },
433+ "engines": {
434+ "node": ">=18.0.0"
435+ }
436+ },
437+ "node_modules/@aws-sdk/credential-provider-ini": {
438+ "version": "3.840.0",
439+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.840.0.tgz",
440+ "integrity": "sha512-7F290BsWydShHb+7InXd+IjJc3mlEIm9I0R57F/Pjl1xZB69MdkhVGCnuETWoBt4g53ktJd6NEjzm/iAhFXFmw==",
441+ "license": "Apache-2.0",
442+ "dependencies": {
443+ "@aws-sdk/core": "3.840.0",
444+ "@aws-sdk/credential-provider-env": "3.840.0",
445+ "@aws-sdk/credential-provider-http": "3.840.0",
446+ "@aws-sdk/credential-provider-process": "3.840.0",
447+ "@aws-sdk/credential-provider-sso": "3.840.0",
448+ "@aws-sdk/credential-provider-web-identity": "3.840.0",
449+ "@aws-sdk/nested-clients": "3.840.0",
450+ "@aws-sdk/types": "3.840.0",
451+ "@smithy/credential-provider-imds": "^4.0.6",
452+ "@smithy/property-provider": "^4.0.4",
453+ "@smithy/shared-ini-file-loader": "^4.0.4",
454+ "@smithy/types": "^4.3.1",
455+ "tslib": "^2.6.2"
456+ },
457+ "engines": {
458+ "node": ">=18.0.0"
459+ }
460+ },
461+ "node_modules/@aws-sdk/credential-provider-node": {
462+ "version": "3.840.0",
463+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.840.0.tgz",
464+ "integrity": "sha512-KufP8JnxA31wxklLm63evUPSFApGcH8X86z3mv9SRbpCm5ycgWIGVCTXpTOdgq6rPZrwT9pftzv2/b4mV/9clg==",
465+ "license": "Apache-2.0",
466+ "dependencies": {
467+ "@aws-sdk/credential-provider-env": "3.840.0",
468+ "@aws-sdk/credential-provider-http": "3.840.0",
469+ "@aws-sdk/credential-provider-ini": "3.840.0",
470+ "@aws-sdk/credential-provider-process": "3.840.0",
471+ "@aws-sdk/credential-provider-sso": "3.840.0",
472+ "@aws-sdk/credential-provider-web-identity": "3.840.0",
473+ "@aws-sdk/types": "3.840.0",
474+ "@smithy/credential-provider-imds": "^4.0.6",
475+ "@smithy/property-provider": "^4.0.4",
476+ "@smithy/shared-ini-file-loader": "^4.0.4",
477+ "@smithy/types": "^4.3.1",
478+ "tslib": "^2.6.2"
479+ },
480+ "engines": {
481+ "node": ">=18.0.0"
482+ }
483+ },
484+ "node_modules/@aws-sdk/credential-provider-process": {
485+ "version": "3.840.0",
486+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.840.0.tgz",
487+ "integrity": "sha512-HkDQWHy8tCI4A0Ps2NVtuVYMv9cB4y/IuD/TdOsqeRIAT12h8jDb98BwQPNLAImAOwOWzZJ8Cu0xtSpX7CQhMw==",
488+ "license": "Apache-2.0",
489+ "dependencies": {
490+ "@aws-sdk/core": "3.840.0",
491+ "@aws-sdk/types": "3.840.0",
492+ "@smithy/property-provider": "^4.0.4",
493+ "@smithy/shared-ini-file-loader": "^4.0.4",
494+ "@smithy/types": "^4.3.1",
495+ "tslib": "^2.6.2"
496+ },
497+ "engines": {
498+ "node": ">=18.0.0"
499+ }
500+ },
501+ "node_modules/@aws-sdk/credential-provider-sso": {
502+ "version": "3.840.0",
503+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.840.0.tgz",
504+ "integrity": "sha512-2qgdtdd6R0Z1y0KL8gzzwFUGmhBHSUx4zy85L2XV1CXhpRNwV71SVWJqLDVV5RVWVf9mg50Pm3AWrUC0xb0pcA==",
505+ "license": "Apache-2.0",
506+ "dependencies": {
507+ "@aws-sdk/client-sso": "3.840.0",
508+ "@aws-sdk/core": "3.840.0",
509+ "@aws-sdk/token-providers": "3.840.0",
510+ "@aws-sdk/types": "3.840.0",
511+ "@smithy/property-provider": "^4.0.4",
512+ "@smithy/shared-ini-file-loader": "^4.0.4",
513+ "@smithy/types": "^4.3.1",
514+ "tslib": "^2.6.2"
515+ },
516+ "engines": {
517+ "node": ">=18.0.0"
518+ }
519+ },
520+ "node_modules/@aws-sdk/credential-provider-web-identity": {
521+ "version": "3.840.0",
522+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.840.0.tgz",
523+ "integrity": "sha512-dpEeVXG8uNZSmVXReE4WP0lwoioX2gstk4RnUgrdUE3YaPq8A+hJiVAyc3h+cjDeIqfbsQbZm9qFetKC2LF9dQ==",
524+ "license": "Apache-2.0",
525+ "dependencies": {
526+ "@aws-sdk/core": "3.840.0",
527+ "@aws-sdk/nested-clients": "3.840.0",
528+ "@aws-sdk/types": "3.840.0",
529+ "@smithy/property-provider": "^4.0.4",
530+ "@smithy/types": "^4.3.1",
531+ "tslib": "^2.6.2"
532+ },
533+ "engines": {
534+ "node": ">=18.0.0"
535+ }
536+ },
537+ "node_modules/@aws-sdk/credential-providers": {
538+ "version": "3.840.0",
539+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.840.0.tgz",
540+ "integrity": "sha512-+CxYdGd+uM4NZ9VUvFTU1c/H61qhDB4q362k8xKU+bz24g//LDQ5Mpwksv8OUD1en44v4fUwgZ4SthPZMs+eFQ==",
541+ "license": "Apache-2.0",
542+ "dependencies": {
543+ "@aws-sdk/client-cognito-identity": "3.840.0",
544+ "@aws-sdk/core": "3.840.0",
545+ "@aws-sdk/credential-provider-cognito-identity": "3.840.0",
546+ "@aws-sdk/credential-provider-env": "3.840.0",
547+ "@aws-sdk/credential-provider-http": "3.840.0",
548+ "@aws-sdk/credential-provider-ini": "3.840.0",
549+ "@aws-sdk/credential-provider-node": "3.840.0",
550+ "@aws-sdk/credential-provider-process": "3.840.0",
551+ "@aws-sdk/credential-provider-sso": "3.840.0",
552+ "@aws-sdk/credential-provider-web-identity": "3.840.0",
553+ "@aws-sdk/nested-clients": "3.840.0",
554+ "@aws-sdk/types": "3.840.0",
555+ "@smithy/config-resolver": "^4.1.4",
556+ "@smithy/core": "^3.6.0",
557+ "@smithy/credential-provider-imds": "^4.0.6",
558+ "@smithy/node-config-provider": "^4.1.3",
559+ "@smithy/property-provider": "^4.0.4",
560+ "@smithy/types": "^4.3.1",
561+ "tslib": "^2.6.2"
562+ },
563+ "engines": {
564+ "node": ">=18.0.0"
565+ }
566+ },
567+ "node_modules/@aws-sdk/eventstream-handler-node": {
568+ "version": "3.840.0",
569+ "resolved": "https://registry.npmjs.org/@aws-sdk/eventstream-handler-node/-/eventstream-handler-node-3.840.0.tgz",
570+ "integrity": "sha512-m/zVrSSAEHq+6h4sy0JUEBScB1pGgs/1+iRVhfzfbnf+/gTr4ut2jRq4tDiNEX9pQ1oFVvw+ntPua5qfquQeRQ==",
571+ "license": "Apache-2.0",
572+ "dependencies": {
573+ "@aws-sdk/types": "3.840.0",
574+ "@smithy/eventstream-codec": "^4.0.4",
575+ "@smithy/types": "^4.3.1",
576+ "tslib": "^2.6.2"
577+ },
578+ "engines": {
579+ "node": ">=18.0.0"
580+ }
581+ },
582+ "node_modules/@aws-sdk/middleware-eventstream": {
583+ "version": "3.840.0",
584+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-eventstream/-/middleware-eventstream-3.840.0.tgz",
585+ "integrity": "sha512-4khgf7AjJ4llh3aiNmZ+x4PGl4vkKNxRHn0xTgi6Iw1J3SChsF2mnNaLXK8hoXeydx756rw+JhqOuZH91i5l4w==",
586+ "license": "Apache-2.0",
587+ "dependencies": {
588+ "@aws-sdk/types": "3.840.0",
589+ "@smithy/protocol-http": "^5.1.2",
590+ "@smithy/types": "^4.3.1",
591+ "tslib": "^2.6.2"
592+ },
593+ "engines": {
594+ "node": ">=18.0.0"
595+ }
596+ },
597+ "node_modules/@aws-sdk/middleware-host-header": {
598+ "version": "3.840.0",
599+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.840.0.tgz",
600+ "integrity": "sha512-ub+hXJAbAje94+Ya6c6eL7sYujoE8D4Bumu1NUI8TXjUhVVn0HzVWQjpRLshdLsUp1AW7XyeJaxyajRaJQ8+Xg==",
601+ "license": "Apache-2.0",
602+ "dependencies": {
603+ "@aws-sdk/types": "3.840.0",
604+ "@smithy/protocol-http": "^5.1.2",
605+ "@smithy/types": "^4.3.1",
606+ "tslib": "^2.6.2"
607+ },
608+ "engines": {
609+ "node": ">=18.0.0"
610+ }
611+ },
612+ "node_modules/@aws-sdk/middleware-logger": {
613+ "version": "3.840.0",
614+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.840.0.tgz",
615+ "integrity": "sha512-lSV8FvjpdllpGaRspywss4CtXV8M7NNNH+2/j86vMH+YCOZ6fu2T/TyFd/tHwZ92vDfHctWkRbQxg0bagqwovA==",
616+ "license": "Apache-2.0",
617+ "dependencies": {
618+ "@aws-sdk/types": "3.840.0",
619+ "@smithy/types": "^4.3.1",
620+ "tslib": "^2.6.2"
621+ },
622+ "engines": {
623+ "node": ">=18.0.0"
624+ }
625+ },
626+ "node_modules/@aws-sdk/middleware-recursion-detection": {
627+ "version": "3.840.0",
628+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.840.0.tgz",
629+ "integrity": "sha512-Gu7lGDyfddyhIkj1Z1JtrY5NHb5+x/CRiB87GjaSrKxkDaydtX2CU977JIABtt69l9wLbcGDIQ+W0uJ5xPof7g==",
630+ "license": "Apache-2.0",
631+ "dependencies": {
632+ "@aws-sdk/types": "3.840.0",
633+ "@smithy/protocol-http": "^5.1.2",
634+ "@smithy/types": "^4.3.1",
635+ "tslib": "^2.6.2"
636+ },
637+ "engines": {
638+ "node": ">=18.0.0"
639+ }
640+ },
641+ "node_modules/@aws-sdk/middleware-user-agent": {
642+ "version": "3.840.0",
643+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.840.0.tgz",
644+ "integrity": "sha512-hiiMf7BP5ZkAFAvWRcK67Mw/g55ar7OCrvrynC92hunx/xhMkrgSLM0EXIZ1oTn3uql9kH/qqGF0nqsK6K555A==",
645+ "license": "Apache-2.0",
646+ "dependencies": {
647+ "@aws-sdk/core": "3.840.0",
648+ "@aws-sdk/types": "3.840.0",
649+ "@aws-sdk/util-endpoints": "3.840.0",
650+ "@smithy/core": "^3.6.0",
651+ "@smithy/protocol-http": "^5.1.2",
652+ "@smithy/types": "^4.3.1",
653+ "tslib": "^2.6.2"
654+ },
655+ "engines": {
656+ "node": ">=18.0.0"
657+ }
658+ },
659+ "node_modules/@aws-sdk/middleware-websocket": {
660+ "version": "3.840.0",
661+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-websocket/-/middleware-websocket-3.840.0.tgz",
662+ "integrity": "sha512-v9jJD1zjKMUg8iEZlFP5TLY7+DdwKodLgkNtls34+LMRbW+7Bue+H3gPi1VML5sks2o/+PJ6fz58Wo3bXZ8XHA==",
663+ "license": "Apache-2.0",
664+ "dependencies": {
665+ "@aws-sdk/types": "3.840.0",
666+ "@aws-sdk/util-format-url": "3.840.0",
667+ "@smithy/eventstream-codec": "^4.0.4",
668+ "@smithy/eventstream-serde-browser": "^4.0.4",
669+ "@smithy/fetch-http-handler": "^5.0.4",
670+ "@smithy/protocol-http": "^5.1.2",
671+ "@smithy/signature-v4": "^5.1.2",
672+ "@smithy/types": "^4.3.1",
673+ "@smithy/util-hex-encoding": "^4.0.0",
674+ "tslib": "^2.6.2"
675+ },
676+ "engines": {
677+ "node": ">= 14.0.0"
678+ }
679+ },
680+ "node_modules/@aws-sdk/nested-clients": {
681+ "version": "3.840.0",
682+ "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.840.0.tgz",
683+ "integrity": "sha512-LXYYo9+n4hRqnRSIMXLBb+BLz+cEmjMtTudwK1BF6Bn2RfdDv29KuyeDRrPCS3TwKl7ZKmXUmE9n5UuHAPfBpA==",
684+ "license": "Apache-2.0",
685+ "dependencies": {
686+ "@aws-crypto/sha256-browser": "5.2.0",
687+ "@aws-crypto/sha256-js": "5.2.0",
688+ "@aws-sdk/core": "3.840.0",
689+ "@aws-sdk/middleware-host-header": "3.840.0",
690+ "@aws-sdk/middleware-logger": "3.840.0",
691+ "@aws-sdk/middleware-recursion-detection": "3.840.0",
692+ "@aws-sdk/middleware-user-agent": "3.840.0",
693+ "@aws-sdk/region-config-resolver": "3.840.0",
694+ "@aws-sdk/types": "3.840.0",
695+ "@aws-sdk/util-endpoints": "3.840.0",
696+ "@aws-sdk/util-user-agent-browser": "3.840.0",
697+ "@aws-sdk/util-user-agent-node": "3.840.0",
698+ "@smithy/config-resolver": "^4.1.4",
699+ "@smithy/core": "^3.6.0",
700+ "@smithy/fetch-http-handler": "^5.0.4",
701+ "@smithy/hash-node": "^4.0.4",
702+ "@smithy/invalid-dependency": "^4.0.4",
703+ "@smithy/middleware-content-length": "^4.0.4",
704+ "@smithy/middleware-endpoint": "^4.1.13",
705+ "@smithy/middleware-retry": "^4.1.14",
706+ "@smithy/middleware-serde": "^4.0.8",
707+ "@smithy/middleware-stack": "^4.0.4",
708+ "@smithy/node-config-provider": "^4.1.3",
709+ "@smithy/node-http-handler": "^4.0.6",
710+ "@smithy/protocol-http": "^5.1.2",
711+ "@smithy/smithy-client": "^4.4.5",
712+ "@smithy/types": "^4.3.1",
713+ "@smithy/url-parser": "^4.0.4",
714+ "@smithy/util-base64": "^4.0.0",
715+ "@smithy/util-body-length-browser": "^4.0.0",
716+ "@smithy/util-body-length-node": "^4.0.0",
717+ "@smithy/util-defaults-mode-browser": "^4.0.21",
718+ "@smithy/util-defaults-mode-node": "^4.0.21",
719+ "@smithy/util-endpoints": "^3.0.6",
720+ "@smithy/util-middleware": "^4.0.4",
721+ "@smithy/util-retry": "^4.0.6",
722+ "@smithy/util-utf8": "^4.0.0",
723+ "tslib": "^2.6.2"
724+ },
725+ "engines": {
726+ "node": ">=18.0.0"
727+ }
728+ },
729+ "node_modules/@aws-sdk/region-config-resolver": {
730+ "version": "3.840.0",
731+ "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.840.0.tgz",
732+ "integrity": "sha512-Qjnxd/yDv9KpIMWr90ZDPtRj0v75AqGC92Lm9+oHXZ8p1MjG5JE2CW0HL8JRgK9iKzgKBL7pPQRXI8FkvEVfrA==",
733+ "license": "Apache-2.0",
734+ "dependencies": {
735+ "@aws-sdk/types": "3.840.0",
736+ "@smithy/node-config-provider": "^4.1.3",
737+ "@smithy/types": "^4.3.1",
738+ "@smithy/util-config-provider": "^4.0.0",
739+ "@smithy/util-middleware": "^4.0.4",
740+ "tslib": "^2.6.2"
741+ },
742+ "engines": {
743+ "node": ">=18.0.0"
744+ }
745+ },
746+ "node_modules/@aws-sdk/token-providers": {
747+ "version": "3.840.0",
748+ "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.840.0.tgz",
749+ "integrity": "sha512-6BuTOLTXvmgwjK7ve7aTg9JaWFdM5UoMolLVPMyh3wTv9Ufalh8oklxYHUBIxsKkBGO2WiHXytveuxH6tAgTYg==",
750+ "license": "Apache-2.0",
751+ "dependencies": {
752+ "@aws-sdk/core": "3.840.0",
753+ "@aws-sdk/nested-clients": "3.840.0",
754+ "@aws-sdk/types": "3.840.0",
755+ "@smithy/property-provider": "^4.0.4",
756+ "@smithy/shared-ini-file-loader": "^4.0.4",
757+ "@smithy/types": "^4.3.1",
758+ "tslib": "^2.6.2"
759+ },
760+ "engines": {
761+ "node": ">=18.0.0"
762+ }
763+ },
764+ "node_modules/@aws-sdk/types": {
765+ "version": "3.840.0",
766+ "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.840.0.tgz",
767+ "integrity": "sha512-xliuHaUFZxEx1NSXeLLZ9Dyu6+EJVQKEoD+yM+zqUo3YDZ7medKJWY6fIOKiPX/N7XbLdBYwajb15Q7IL8KkeA==",
768+ "license": "Apache-2.0",
769+ "dependencies": {
770+ "@smithy/types": "^4.3.1",
771+ "tslib": "^2.6.2"
772+ },
773+ "engines": {
774+ "node": ">=18.0.0"
775+ }
776+ },
777+ "node_modules/@aws-sdk/util-endpoints": {
778+ "version": "3.840.0",
779+ "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.840.0.tgz",
780+ "integrity": "sha512-eqE9ROdg/Kk0rj3poutyRCFauPDXIf/WSvCqFiRDDVi6QOnCv/M0g2XW8/jSvkJlOyaXkNCptapIp6BeeFFGYw==",
781+ "license": "Apache-2.0",
782+ "dependencies": {
783+ "@aws-sdk/types": "3.840.0",
784+ "@smithy/types": "^4.3.1",
785+ "@smithy/util-endpoints": "^3.0.6",
786+ "tslib": "^2.6.2"
787+ },
788+ "engines": {
789+ "node": ">=18.0.0"
790+ }
791+ },
792+ "node_modules/@aws-sdk/util-format-url": {
793+ "version": "3.840.0",
794+ "resolved": "https://registry.npmjs.org/@aws-sdk/util-format-url/-/util-format-url-3.840.0.tgz",
795+ "integrity": "sha512-VB1PWyI1TQPiPvg4w7tgUGGQER1xxXPNUqfh3baxUSFi1Oh8wHrDnFywkxLm3NMmgDmnLnSZ5Q326qAoyqKLSg==",
796+ "license": "Apache-2.0",
797+ "dependencies": {
798+ "@aws-sdk/types": "3.840.0",
799+ "@smithy/querystring-builder": "^4.0.4",
800+ "@smithy/types": "^4.3.1",
801+ "tslib": "^2.6.2"
802+ },
803+ "engines": {
804+ "node": ">=18.0.0"
805+ }
806+ },
807+ "node_modules/@aws-sdk/util-locate-window": {
808+ "version": "3.804.0",
809+ "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.804.0.tgz",
810+ "integrity": "sha512-zVoRfpmBVPodYlnMjgVjfGoEZagyRF5IPn3Uo6ZvOZp24chnW/FRstH7ESDHDDRga4z3V+ElUQHKpFDXWyBW5A==",
811+ "license": "Apache-2.0",
812+ "dependencies": {
813+ "tslib": "^2.6.2"
814+ },
815+ "engines": {
816+ "node": ">=18.0.0"
817+ }
818+ },
819+ "node_modules/@aws-sdk/util-user-agent-browser": {
820+ "version": "3.840.0",
821+ "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.840.0.tgz",
822+ "integrity": "sha512-JdyZM3EhhL4PqwFpttZu1afDpPJCCc3eyZOLi+srpX11LsGj6sThf47TYQN75HT1CarZ7cCdQHGzP2uy3/xHfQ==",
823+ "license": "Apache-2.0",
824+ "dependencies": {
825+ "@aws-sdk/types": "3.840.0",
826+ "@smithy/types": "^4.3.1",
827+ "bowser": "^2.11.0",
828+ "tslib": "^2.6.2"
829+ }
830+ },
831+ "node_modules/@aws-sdk/util-user-agent-node": {
832+ "version": "3.840.0",
833+ "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.840.0.tgz",
834+ "integrity": "sha512-Fy5JUEDQU1tPm2Yw/YqRYYc27W5+QD/J4mYvQvdWjUGZLB5q3eLFMGD35Uc28ZFoGMufPr4OCxK/bRfWROBRHQ==",
835+ "license": "Apache-2.0",
836+ "dependencies": {
837+ "@aws-sdk/middleware-user-agent": "3.840.0",
838+ "@aws-sdk/types": "3.840.0",
839+ "@smithy/node-config-provider": "^4.1.3",
840+ "@smithy/types": "^4.3.1",
841+ "tslib": "^2.6.2"
842+ },
843+ "engines": {
844+ "node": ">=18.0.0"
845+ },
846+ "peerDependencies": {
847+ "aws-crt": ">=1.0.0"
848+ },
849+ "peerDependenciesMeta": {
850+ "aws-crt": {
851+ "optional": true
852+ }
853+ }
854+ },
855+ "node_modules/@aws-sdk/xml-builder": {
856+ "version": "3.821.0",
857+ "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.821.0.tgz",
858+ "integrity": "sha512-DIIotRnefVL6DiaHtO6/21DhJ4JZnnIwdNbpwiAhdt/AVbttcE4yw925gsjur0OGv5BTYXQXU3YnANBYnZjuQA==",
859+ "license": "Apache-2.0",
860+ "dependencies": {
861+ "@smithy/types": "^4.3.1",
862+ "tslib": "^2.6.2"
863+ },
864+ "engines": {
865+ "node": ">=18.0.0"
866+ }
867+ },
45868 "node_modules/@babel/code-frame": {
46869 "version": "7.24.7",
47870 "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz",
@@ -761,265 +1584,915 @@
7611584 "jest-get-type": "^29.6.3"
7621585 },
7631586 "engines": {
764- "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
1587+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
1588+ }
1589+ },
1590+ "node_modules/@jest/fake-timers": {
1591+ "version": "29.7.0",
1592+ "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz",
1593+ "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==",
1594+ "dev": true,
1595+ "peer": true,
1596+ "dependencies": {
1597+ "@jest/types": "^29.6.3",
1598+ "@sinonjs/fake-timers": "^10.0.2",
1599+ "@types/node": "*",
1600+ "jest-message-util": "^29.7.0",
1601+ "jest-mock": "^29.7.0",
1602+ "jest-util": "^29.7.0"
1603+ },
1604+ "engines": {
1605+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
1606+ }
1607+ },
1608+ "node_modules/@jest/globals": {
1609+ "version": "29.7.0",
1610+ "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz",
1611+ "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==",
1612+ "dev": true,
1613+ "peer": true,
1614+ "dependencies": {
1615+ "@jest/environment": "^29.7.0",
1616+ "@jest/expect": "^29.7.0",
1617+ "@jest/types": "^29.6.3",
1618+ "jest-mock": "^29.7.0"
1619+ },
1620+ "engines": {
1621+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
1622+ }
1623+ },
1624+ "node_modules/@jest/reporters": {
1625+ "version": "29.7.0",
1626+ "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz",
1627+ "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==",
1628+ "dev": true,
1629+ "peer": true,
1630+ "dependencies": {
1631+ "@bcoe/v8-coverage": "^0.2.3",
1632+ "@jest/console": "^29.7.0",
1633+ "@jest/test-result": "^29.7.0",
1634+ "@jest/transform": "^29.7.0",
1635+ "@jest/types": "^29.6.3",
1636+ "@jridgewell/trace-mapping": "^0.3.18",
1637+ "@types/node": "*",
1638+ "chalk": "^4.0.0",
1639+ "collect-v8-coverage": "^1.0.0",
1640+ "exit": "^0.1.2",
1641+ "glob": "^7.1.3",
1642+ "graceful-fs": "^4.2.9",
1643+ "istanbul-lib-coverage": "^3.0.0",
1644+ "istanbul-lib-instrument": "^6.0.0",
1645+ "istanbul-lib-report": "^3.0.0",
1646+ "istanbul-lib-source-maps": "^4.0.0",
1647+ "istanbul-reports": "^3.1.3",
1648+ "jest-message-util": "^29.7.0",
1649+ "jest-util": "^29.7.0",
1650+ "jest-worker": "^29.7.0",
1651+ "slash": "^3.0.0",
1652+ "string-length": "^4.0.1",
1653+ "strip-ansi": "^6.0.0",
1654+ "v8-to-istanbul": "^9.0.1"
1655+ },
1656+ "engines": {
1657+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
1658+ },
1659+ "peerDependencies": {
1660+ "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0"
1661+ },
1662+ "peerDependenciesMeta": {
1663+ "node-notifier": {
1664+ "optional": true
1665+ }
1666+ }
1667+ },
1668+ "node_modules/@jest/schemas": {
1669+ "version": "29.6.3",
1670+ "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz",
1671+ "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==",
1672+ "dev": true,
1673+ "dependencies": {
1674+ "@sinclair/typebox": "^0.27.8"
1675+ },
1676+ "engines": {
1677+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
1678+ }
1679+ },
1680+ "node_modules/@jest/source-map": {
1681+ "version": "29.6.3",
1682+ "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz",
1683+ "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==",
1684+ "dev": true,
1685+ "peer": true,
1686+ "dependencies": {
1687+ "@jridgewell/trace-mapping": "^0.3.18",
1688+ "callsites": "^3.0.0",
1689+ "graceful-fs": "^4.2.9"
1690+ },
1691+ "engines": {
1692+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
1693+ }
1694+ },
1695+ "node_modules/@jest/test-result": {
1696+ "version": "29.7.0",
1697+ "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz",
1698+ "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==",
1699+ "dev": true,
1700+ "peer": true,
1701+ "dependencies": {
1702+ "@jest/console": "^29.7.0",
1703+ "@jest/types": "^29.6.3",
1704+ "@types/istanbul-lib-coverage": "^2.0.0",
1705+ "collect-v8-coverage": "^1.0.0"
1706+ },
1707+ "engines": {
1708+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
1709+ }
1710+ },
1711+ "node_modules/@jest/test-sequencer": {
1712+ "version": "29.7.0",
1713+ "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz",
1714+ "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==",
1715+ "dev": true,
1716+ "peer": true,
1717+ "dependencies": {
1718+ "@jest/test-result": "^29.7.0",
1719+ "graceful-fs": "^4.2.9",
1720+ "jest-haste-map": "^29.7.0",
1721+ "slash": "^3.0.0"
1722+ },
1723+ "engines": {
1724+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
1725+ }
1726+ },
1727+ "node_modules/@jest/transform": {
1728+ "version": "29.7.0",
1729+ "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz",
1730+ "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==",
1731+ "dev": true,
1732+ "peer": true,
1733+ "dependencies": {
1734+ "@babel/core": "^7.11.6",
1735+ "@jest/types": "^29.6.3",
1736+ "@jridgewell/trace-mapping": "^0.3.18",
1737+ "babel-plugin-istanbul": "^6.1.1",
1738+ "chalk": "^4.0.0",
1739+ "convert-source-map": "^2.0.0",
1740+ "fast-json-stable-stringify": "^2.1.0",
1741+ "graceful-fs": "^4.2.9",
1742+ "jest-haste-map": "^29.7.0",
1743+ "jest-regex-util": "^29.6.3",
1744+ "jest-util": "^29.7.0",
1745+ "micromatch": "^4.0.4",
1746+ "pirates": "^4.0.4",
1747+ "slash": "^3.0.0",
1748+ "write-file-atomic": "^4.0.2"
1749+ },
1750+ "engines": {
1751+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
1752+ }
1753+ },
1754+ "node_modules/@jest/types": {
1755+ "version": "29.6.3",
1756+ "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz",
1757+ "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==",
1758+ "dev": true,
1759+ "dependencies": {
1760+ "@jest/schemas": "^29.6.3",
1761+ "@types/istanbul-lib-coverage": "^2.0.0",
1762+ "@types/istanbul-reports": "^3.0.0",
1763+ "@types/node": "*",
1764+ "@types/yargs": "^17.0.8",
1765+ "chalk": "^4.0.0"
1766+ },
1767+ "engines": {
1768+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
1769+ }
1770+ },
1771+ "node_modules/@jridgewell/gen-mapping": {
1772+ "version": "0.3.5",
1773+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz",
1774+ "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==",
1775+ "dev": true,
1776+ "peer": true,
1777+ "dependencies": {
1778+ "@jridgewell/set-array": "^1.2.1",
1779+ "@jridgewell/sourcemap-codec": "^1.4.10",
1780+ "@jridgewell/trace-mapping": "^0.3.24"
1781+ },
1782+ "engines": {
1783+ "node": ">=6.0.0"
1784+ }
1785+ },
1786+ "node_modules/@jridgewell/resolve-uri": {
1787+ "version": "3.1.2",
1788+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
1789+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
1790+ "dev": true,
1791+ "engines": {
1792+ "node": ">=6.0.0"
1793+ }
1794+ },
1795+ "node_modules/@jridgewell/set-array": {
1796+ "version": "1.2.1",
1797+ "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz",
1798+ "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==",
1799+ "dev": true,
1800+ "peer": true,
1801+ "engines": {
1802+ "node": ">=6.0.0"
1803+ }
1804+ },
1805+ "node_modules/@jridgewell/sourcemap-codec": {
1806+ "version": "1.5.0",
1807+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz",
1808+ "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==",
1809+ "dev": true
1810+ },
1811+ "node_modules/@jridgewell/trace-mapping": {
1812+ "version": "0.3.25",
1813+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz",
1814+ "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==",
1815+ "dev": true,
1816+ "peer": true,
1817+ "dependencies": {
1818+ "@jridgewell/resolve-uri": "^3.1.0",
1819+ "@jridgewell/sourcemap-codec": "^1.4.14"
1820+ }
1821+ },
1822+ "node_modules/@sinclair/typebox": {
1823+ "version": "0.27.8",
1824+ "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz",
1825+ "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==",
1826+ "dev": true
1827+ },
1828+ "node_modules/@sinonjs/commons": {
1829+ "version": "3.0.1",
1830+ "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz",
1831+ "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==",
1832+ "dev": true,
1833+ "peer": true,
1834+ "dependencies": {
1835+ "type-detect": "4.0.8"
1836+ }
1837+ },
1838+ "node_modules/@sinonjs/fake-timers": {
1839+ "version": "10.3.0",
1840+ "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz",
1841+ "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==",
1842+ "dev": true,
1843+ "peer": true,
1844+ "dependencies": {
1845+ "@sinonjs/commons": "^3.0.0"
1846+ }
1847+ },
1848+ "node_modules/@smithy/abort-controller": {
1849+ "version": "4.0.4",
1850+ "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.0.4.tgz",
1851+ "integrity": "sha512-gJnEjZMvigPDQWHrW3oPrFhQtkrgqBkyjj3pCIdF3A5M6vsZODG93KNlfJprv6bp4245bdT32fsHK4kkH3KYDA==",
1852+ "license": "Apache-2.0",
1853+ "dependencies": {
1854+ "@smithy/types": "^4.3.1",
1855+ "tslib": "^2.6.2"
1856+ },
1857+ "engines": {
1858+ "node": ">=18.0.0"
1859+ }
1860+ },
1861+ "node_modules/@smithy/config-resolver": {
1862+ "version": "4.1.4",
1863+ "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.1.4.tgz",
1864+ "integrity": "sha512-prmU+rDddxHOH0oNcwemL+SwnzcG65sBF2yXRO7aeXIn/xTlq2pX7JLVbkBnVLowHLg4/OL4+jBmv9hVrVGS+w==",
1865+ "license": "Apache-2.0",
1866+ "dependencies": {
1867+ "@smithy/node-config-provider": "^4.1.3",
1868+ "@smithy/types": "^4.3.1",
1869+ "@smithy/util-config-provider": "^4.0.0",
1870+ "@smithy/util-middleware": "^4.0.4",
1871+ "tslib": "^2.6.2"
1872+ },
1873+ "engines": {
1874+ "node": ">=18.0.0"
1875+ }
1876+ },
1877+ "node_modules/@smithy/core": {
1878+ "version": "3.6.0",
1879+ "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.6.0.tgz",
1880+ "integrity": "sha512-Pgvfb+TQ4wUNLyHzvgCP4aYZMh16y7GcfF59oirRHcgGgkH1e/s9C0nv/v3WP+Quymyr5je71HeFQCwh+44XLg==",
1881+ "license": "Apache-2.0",
1882+ "dependencies": {
1883+ "@smithy/middleware-serde": "^4.0.8",
1884+ "@smithy/protocol-http": "^5.1.2",
1885+ "@smithy/types": "^4.3.1",
1886+ "@smithy/util-base64": "^4.0.0",
1887+ "@smithy/util-body-length-browser": "^4.0.0",
1888+ "@smithy/util-middleware": "^4.0.4",
1889+ "@smithy/util-stream": "^4.2.2",
1890+ "@smithy/util-utf8": "^4.0.0",
1891+ "tslib": "^2.6.2"
1892+ },
1893+ "engines": {
1894+ "node": ">=18.0.0"
1895+ }
1896+ },
1897+ "node_modules/@smithy/credential-provider-imds": {
1898+ "version": "4.0.6",
1899+ "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.0.6.tgz",
1900+ "integrity": "sha512-hKMWcANhUiNbCJouYkZ9V3+/Qf9pteR1dnwgdyzR09R4ODEYx8BbUysHwRSyex4rZ9zapddZhLFTnT4ZijR4pw==",
1901+ "license": "Apache-2.0",
1902+ "dependencies": {
1903+ "@smithy/node-config-provider": "^4.1.3",
1904+ "@smithy/property-provider": "^4.0.4",
1905+ "@smithy/types": "^4.3.1",
1906+ "@smithy/url-parser": "^4.0.4",
1907+ "tslib": "^2.6.2"
1908+ },
1909+ "engines": {
1910+ "node": ">=18.0.0"
1911+ }
1912+ },
1913+ "node_modules/@smithy/eventstream-codec": {
1914+ "version": "4.0.4",
1915+ "resolved": "https://registry.npmjs.org/@smithy/eventstream-codec/-/eventstream-codec-4.0.4.tgz",
1916+ "integrity": "sha512-7XoWfZqWb/QoR/rAU4VSi0mWnO2vu9/ltS6JZ5ZSZv0eovLVfDfu0/AX4ub33RsJTOth3TiFWSHS5YdztvFnig==",
1917+ "license": "Apache-2.0",
1918+ "dependencies": {
1919+ "@aws-crypto/crc32": "5.2.0",
1920+ "@smithy/types": "^4.3.1",
1921+ "@smithy/util-hex-encoding": "^4.0.0",
1922+ "tslib": "^2.6.2"
1923+ },
1924+ "engines": {
1925+ "node": ">=18.0.0"
1926+ }
1927+ },
1928+ "node_modules/@smithy/eventstream-serde-browser": {
1929+ "version": "4.0.4",
1930+ "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-browser/-/eventstream-serde-browser-4.0.4.tgz",
1931+ "integrity": "sha512-3fb/9SYaYqbpy/z/H3yIi0bYKyAa89y6xPmIqwr2vQiUT2St+avRt8UKwsWt9fEdEasc5d/V+QjrviRaX1JRFA==",
1932+ "license": "Apache-2.0",
1933+ "dependencies": {
1934+ "@smithy/eventstream-serde-universal": "^4.0.4",
1935+ "@smithy/types": "^4.3.1",
1936+ "tslib": "^2.6.2"
1937+ },
1938+ "engines": {
1939+ "node": ">=18.0.0"
1940+ }
1941+ },
1942+ "node_modules/@smithy/eventstream-serde-config-resolver": {
1943+ "version": "4.1.2",
1944+ "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-config-resolver/-/eventstream-serde-config-resolver-4.1.2.tgz",
1945+ "integrity": "sha512-JGtambizrWP50xHgbzZI04IWU7LdI0nh/wGbqH3sJesYToMi2j/DcoElqyOcqEIG/D4tNyxgRuaqBXWE3zOFhQ==",
1946+ "license": "Apache-2.0",
1947+ "dependencies": {
1948+ "@smithy/types": "^4.3.1",
1949+ "tslib": "^2.6.2"
1950+ },
1951+ "engines": {
1952+ "node": ">=18.0.0"
1953+ }
1954+ },
1955+ "node_modules/@smithy/eventstream-serde-node": {
1956+ "version": "4.0.4",
1957+ "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-node/-/eventstream-serde-node-4.0.4.tgz",
1958+ "integrity": "sha512-RD6UwNZ5zISpOWPuhVgRz60GkSIp0dy1fuZmj4RYmqLVRtejFqQ16WmfYDdoSoAjlp1LX+FnZo+/hkdmyyGZ1w==",
1959+ "license": "Apache-2.0",
1960+ "dependencies": {
1961+ "@smithy/eventstream-serde-universal": "^4.0.4",
1962+ "@smithy/types": "^4.3.1",
1963+ "tslib": "^2.6.2"
1964+ },
1965+ "engines": {
1966+ "node": ">=18.0.0"
1967+ }
1968+ },
1969+ "node_modules/@smithy/eventstream-serde-universal": {
1970+ "version": "4.0.4",
1971+ "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-universal/-/eventstream-serde-universal-4.0.4.tgz",
1972+ "integrity": "sha512-UeJpOmLGhq1SLox79QWw/0n2PFX+oPRE1ZyRMxPIaFEfCqWaqpB7BU9C8kpPOGEhLF7AwEqfFbtwNxGy4ReENA==",
1973+ "license": "Apache-2.0",
1974+ "dependencies": {
1975+ "@smithy/eventstream-codec": "^4.0.4",
1976+ "@smithy/types": "^4.3.1",
1977+ "tslib": "^2.6.2"
1978+ },
1979+ "engines": {
1980+ "node": ">=18.0.0"
1981+ }
1982+ },
1983+ "node_modules/@smithy/fetch-http-handler": {
1984+ "version": "5.0.4",
1985+ "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.0.4.tgz",
1986+ "integrity": "sha512-AMtBR5pHppYMVD7z7G+OlHHAcgAN7v0kVKEpHuTO4Gb199Gowh0taYi9oDStFeUhetkeP55JLSVlTW1n9rFtUw==",
1987+ "license": "Apache-2.0",
1988+ "dependencies": {
1989+ "@smithy/protocol-http": "^5.1.2",
1990+ "@smithy/querystring-builder": "^4.0.4",
1991+ "@smithy/types": "^4.3.1",
1992+ "@smithy/util-base64": "^4.0.0",
1993+ "tslib": "^2.6.2"
1994+ },
1995+ "engines": {
1996+ "node": ">=18.0.0"
1997+ }
1998+ },
1999+ "node_modules/@smithy/hash-node": {
2000+ "version": "4.0.4",
2001+ "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.0.4.tgz",
2002+ "integrity": "sha512-qnbTPUhCVnCgBp4z4BUJUhOEkVwxiEi1cyFM+Zj6o+aY8OFGxUQleKWq8ltgp3dujuhXojIvJWdoqpm6dVO3lQ==",
2003+ "license": "Apache-2.0",
2004+ "dependencies": {
2005+ "@smithy/types": "^4.3.1",
2006+ "@smithy/util-buffer-from": "^4.0.0",
2007+ "@smithy/util-utf8": "^4.0.0",
2008+ "tslib": "^2.6.2"
2009+ },
2010+ "engines": {
2011+ "node": ">=18.0.0"
2012+ }
2013+ },
2014+ "node_modules/@smithy/invalid-dependency": {
2015+ "version": "4.0.4",
2016+ "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.0.4.tgz",
2017+ "integrity": "sha512-bNYMi7WKTJHu0gn26wg8OscncTt1t2b8KcsZxvOv56XA6cyXtOAAAaNP7+m45xfppXfOatXF3Sb1MNsLUgVLTw==",
2018+ "license": "Apache-2.0",
2019+ "dependencies": {
2020+ "@smithy/types": "^4.3.1",
2021+ "tslib": "^2.6.2"
2022+ },
2023+ "engines": {
2024+ "node": ">=18.0.0"
2025+ }
2026+ },
2027+ "node_modules/@smithy/is-array-buffer": {
2028+ "version": "4.0.0",
2029+ "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.0.0.tgz",
2030+ "integrity": "sha512-saYhF8ZZNoJDTvJBEWgeBccCg+yvp1CX+ed12yORU3NilJScfc6gfch2oVb4QgxZrGUx3/ZJlb+c/dJbyupxlw==",
2031+ "license": "Apache-2.0",
2032+ "dependencies": {
2033+ "tslib": "^2.6.2"
2034+ },
2035+ "engines": {
2036+ "node": ">=18.0.0"
2037+ }
2038+ },
2039+ "node_modules/@smithy/middleware-content-length": {
2040+ "version": "4.0.4",
2041+ "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.0.4.tgz",
2042+ "integrity": "sha512-F7gDyfI2BB1Kc+4M6rpuOLne5LOcEknH1n6UQB69qv+HucXBR1rkzXBnQTB2q46sFy1PM/zuSJOB532yc8bg3w==",
2043+ "license": "Apache-2.0",
2044+ "dependencies": {
2045+ "@smithy/protocol-http": "^5.1.2",
2046+ "@smithy/types": "^4.3.1",
2047+ "tslib": "^2.6.2"
2048+ },
2049+ "engines": {
2050+ "node": ">=18.0.0"
2051+ }
2052+ },
2053+ "node_modules/@smithy/middleware-endpoint": {
2054+ "version": "4.1.13",
2055+ "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.1.13.tgz",
2056+ "integrity": "sha512-xg3EHV/Q5ZdAO5b0UiIMj3RIOCobuS40pBBODguUDVdko6YK6QIzCVRrHTogVuEKglBWqWenRnZ71iZnLL3ZAQ==",
2057+ "license": "Apache-2.0",
2058+ "dependencies": {
2059+ "@smithy/core": "^3.6.0",
2060+ "@smithy/middleware-serde": "^4.0.8",
2061+ "@smithy/node-config-provider": "^4.1.3",
2062+ "@smithy/shared-ini-file-loader": "^4.0.4",
2063+ "@smithy/types": "^4.3.1",
2064+ "@smithy/url-parser": "^4.0.4",
2065+ "@smithy/util-middleware": "^4.0.4",
2066+ "tslib": "^2.6.2"
2067+ },
2068+ "engines": {
2069+ "node": ">=18.0.0"
2070+ }
2071+ },
2072+ "node_modules/@smithy/middleware-retry": {
2073+ "version": "4.1.14",
2074+ "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.1.14.tgz",
2075+ "integrity": "sha512-eoXaLlDGpKvdmvt+YBfRXE7HmIEtFF+DJCbTPwuLunP0YUnrydl+C4tS+vEM0+nyxXrX3PSUFqC+lP1+EHB1Tw==",
2076+ "license": "Apache-2.0",
2077+ "dependencies": {
2078+ "@smithy/node-config-provider": "^4.1.3",
2079+ "@smithy/protocol-http": "^5.1.2",
2080+ "@smithy/service-error-classification": "^4.0.6",
2081+ "@smithy/smithy-client": "^4.4.5",
2082+ "@smithy/types": "^4.3.1",
2083+ "@smithy/util-middleware": "^4.0.4",
2084+ "@smithy/util-retry": "^4.0.6",
2085+ "tslib": "^2.6.2",
2086+ "uuid": "^9.0.1"
2087+ },
2088+ "engines": {
2089+ "node": ">=18.0.0"
2090+ }
2091+ },
2092+ "node_modules/@smithy/middleware-retry/node_modules/uuid": {
2093+ "version": "9.0.1",
2094+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz",
2095+ "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==",
2096+ "funding": [
2097+ "https://github.com/sponsors/broofa",
2098+ "https://github.com/sponsors/ctavan"
2099+ ],
2100+ "license": "MIT",
2101+ "bin": {
2102+ "uuid": "dist/bin/uuid"
2103+ }
2104+ },
2105+ "node_modules/@smithy/middleware-serde": {
2106+ "version": "4.0.8",
2107+ "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.0.8.tgz",
2108+ "integrity": "sha512-iSSl7HJoJaGyMIoNn2B7czghOVwJ9nD7TMvLhMWeSB5vt0TnEYyRRqPJu/TqW76WScaNvYYB8nRoiBHR9S1Ddw==",
2109+ "license": "Apache-2.0",
2110+ "dependencies": {
2111+ "@smithy/protocol-http": "^5.1.2",
2112+ "@smithy/types": "^4.3.1",
2113+ "tslib": "^2.6.2"
2114+ },
2115+ "engines": {
2116+ "node": ">=18.0.0"
2117+ }
2118+ },
2119+ "node_modules/@smithy/middleware-stack": {
2120+ "version": "4.0.4",
2121+ "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.0.4.tgz",
2122+ "integrity": "sha512-kagK5ggDrBUCCzI93ft6DjteNSfY8Ulr83UtySog/h09lTIOAJ/xUSObutanlPT0nhoHAkpmW9V5K8oPyLh+QA==",
2123+ "license": "Apache-2.0",
2124+ "dependencies": {
2125+ "@smithy/types": "^4.3.1",
2126+ "tslib": "^2.6.2"
2127+ },
2128+ "engines": {
2129+ "node": ">=18.0.0"
2130+ }
2131+ },
2132+ "node_modules/@smithy/node-config-provider": {
2133+ "version": "4.1.3",
2134+ "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.1.3.tgz",
2135+ "integrity": "sha512-HGHQr2s59qaU1lrVH6MbLlmOBxadtzTsoO4c+bF5asdgVik3I8o7JIOzoeqWc5MjVa+vD36/LWE0iXKpNqooRw==",
2136+ "license": "Apache-2.0",
2137+ "dependencies": {
2138+ "@smithy/property-provider": "^4.0.4",
2139+ "@smithy/shared-ini-file-loader": "^4.0.4",
2140+ "@smithy/types": "^4.3.1",
2141+ "tslib": "^2.6.2"
2142+ },
2143+ "engines": {
2144+ "node": ">=18.0.0"
2145+ }
2146+ },
2147+ "node_modules/@smithy/node-http-handler": {
2148+ "version": "4.0.6",
2149+ "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.0.6.tgz",
2150+ "integrity": "sha512-NqbmSz7AW2rvw4kXhKGrYTiJVDHnMsFnX4i+/FzcZAfbOBauPYs2ekuECkSbtqaxETLLTu9Rl/ex6+I2BKErPA==",
2151+ "license": "Apache-2.0",
2152+ "dependencies": {
2153+ "@smithy/abort-controller": "^4.0.4",
2154+ "@smithy/protocol-http": "^5.1.2",
2155+ "@smithy/querystring-builder": "^4.0.4",
2156+ "@smithy/types": "^4.3.1",
2157+ "tslib": "^2.6.2"
2158+ },
2159+ "engines": {
2160+ "node": ">=18.0.0"
2161+ }
2162+ },
2163+ "node_modules/@smithy/property-provider": {
2164+ "version": "4.0.4",
2165+ "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.0.4.tgz",
2166+ "integrity": "sha512-qHJ2sSgu4FqF4U/5UUp4DhXNmdTrgmoAai6oQiM+c5RZ/sbDwJ12qxB1M6FnP+Tn/ggkPZf9ccn4jqKSINaquw==",
2167+ "license": "Apache-2.0",
2168+ "dependencies": {
2169+ "@smithy/types": "^4.3.1",
2170+ "tslib": "^2.6.2"
2171+ },
2172+ "engines": {
2173+ "node": ">=18.0.0"
2174+ }
2175+ },
2176+ "node_modules/@smithy/protocol-http": {
2177+ "version": "5.1.2",
2178+ "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.1.2.tgz",
2179+ "integrity": "sha512-rOG5cNLBXovxIrICSBm95dLqzfvxjEmuZx4KK3hWwPFHGdW3lxY0fZNXfv2zebfRO7sJZ5pKJYHScsqopeIWtQ==",
2180+ "license": "Apache-2.0",
2181+ "dependencies": {
2182+ "@smithy/types": "^4.3.1",
2183+ "tslib": "^2.6.2"
2184+ },
2185+ "engines": {
2186+ "node": ">=18.0.0"
2187+ }
2188+ },
2189+ "node_modules/@smithy/querystring-builder": {
2190+ "version": "4.0.4",
2191+ "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.0.4.tgz",
2192+ "integrity": "sha512-SwREZcDnEYoh9tLNgMbpop+UTGq44Hl9tdj3rf+yeLcfH7+J8OXEBaMc2kDxtyRHu8BhSg9ADEx0gFHvpJgU8w==",
2193+ "license": "Apache-2.0",
2194+ "dependencies": {
2195+ "@smithy/types": "^4.3.1",
2196+ "@smithy/util-uri-escape": "^4.0.0",
2197+ "tslib": "^2.6.2"
2198+ },
2199+ "engines": {
2200+ "node": ">=18.0.0"
2201+ }
2202+ },
2203+ "node_modules/@smithy/querystring-parser": {
2204+ "version": "4.0.4",
2205+ "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.0.4.tgz",
2206+ "integrity": "sha512-6yZf53i/qB8gRHH/l2ZwUG5xgkPgQF15/KxH0DdXMDHjesA9MeZje/853ifkSY0x4m5S+dfDZ+c4x439PF0M2w==",
2207+ "license": "Apache-2.0",
2208+ "dependencies": {
2209+ "@smithy/types": "^4.3.1",
2210+ "tslib": "^2.6.2"
2211+ },
2212+ "engines": {
2213+ "node": ">=18.0.0"
2214+ }
2215+ },
2216+ "node_modules/@smithy/service-error-classification": {
2217+ "version": "4.0.6",
2218+ "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.0.6.tgz",
2219+ "integrity": "sha512-RRoTDL//7xi4tn5FrN2NzH17jbgmnKidUqd4KvquT0954/i6CXXkh1884jBiunq24g9cGtPBEXlU40W6EpNOOg==",
2220+ "license": "Apache-2.0",
2221+ "dependencies": {
2222+ "@smithy/types": "^4.3.1"
2223+ },
2224+ "engines": {
2225+ "node": ">=18.0.0"
2226+ }
2227+ },
2228+ "node_modules/@smithy/shared-ini-file-loader": {
2229+ "version": "4.0.4",
2230+ "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.0.4.tgz",
2231+ "integrity": "sha512-63X0260LoFBjrHifPDs+nM9tV0VMkOTl4JRMYNuKh/f5PauSjowTfvF3LogfkWdcPoxsA9UjqEOgjeYIbhb7Nw==",
2232+ "license": "Apache-2.0",
2233+ "dependencies": {
2234+ "@smithy/types": "^4.3.1",
2235+ "tslib": "^2.6.2"
2236+ },
2237+ "engines": {
2238+ "node": ">=18.0.0"
2239+ }
2240+ },
2241+ "node_modules/@smithy/signature-v4": {
2242+ "version": "5.1.2",
2243+ "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.1.2.tgz",
2244+ "integrity": "sha512-d3+U/VpX7a60seHziWnVZOHuEgJlclufjkS6zhXvxcJgkJq4UWdH5eOBLzHRMx6gXjsdT9h6lfpmLzbrdupHgQ==",
2245+ "license": "Apache-2.0",
2246+ "dependencies": {
2247+ "@smithy/is-array-buffer": "^4.0.0",
2248+ "@smithy/protocol-http": "^5.1.2",
2249+ "@smithy/types": "^4.3.1",
2250+ "@smithy/util-hex-encoding": "^4.0.0",
2251+ "@smithy/util-middleware": "^4.0.4",
2252+ "@smithy/util-uri-escape": "^4.0.0",
2253+ "@smithy/util-utf8": "^4.0.0",
2254+ "tslib": "^2.6.2"
2255+ },
2256+ "engines": {
2257+ "node": ">=18.0.0"
2258+ }
2259+ },
2260+ "node_modules/@smithy/smithy-client": {
2261+ "version": "4.4.5",
2262+ "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.4.5.tgz",
2263+ "integrity": "sha512-+lynZjGuUFJaMdDYSTMnP/uPBBXXukVfrJlP+1U/Dp5SFTEI++w6NMga8DjOENxecOF71V9Z2DllaVDYRnGlkg==",
2264+ "license": "Apache-2.0",
2265+ "dependencies": {
2266+ "@smithy/core": "^3.6.0",
2267+ "@smithy/middleware-endpoint": "^4.1.13",
2268+ "@smithy/middleware-stack": "^4.0.4",
2269+ "@smithy/protocol-http": "^5.1.2",
2270+ "@smithy/types": "^4.3.1",
2271+ "@smithy/util-stream": "^4.2.2",
2272+ "tslib": "^2.6.2"
2273+ },
2274+ "engines": {
2275+ "node": ">=18.0.0"
7652276 }
7662277 },
767- "node_modules/@jest/fake-timers": {
768- "version": "29.7.0",
769- "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz",
770- "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==",
771- "dev": true,
772- "peer": true,
2278+ "node_modules/@smithy/types": {
2279+ "version": "4.3.1",
2280+ "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.3.1.tgz",
2281+ "integrity": "sha512-UqKOQBL2x6+HWl3P+3QqFD4ncKq0I8Nuz9QItGv5WuKuMHuuwlhvqcZCoXGfc+P1QmfJE7VieykoYYmrOoFJxA==",
2282+ "license": "Apache-2.0",
7732283 "dependencies": {
774- "@jest/types": "^29.6.3",
775- "@sinonjs/fake-timers": "^10.0.2",
776- "@types/node": "*",
777- "jest-message-util": "^29.7.0",
778- "jest-mock": "^29.7.0",
779- "jest-util": "^29.7.0"
2284+ "tslib": "^2.6.2"
7802285 },
7812286 "engines": {
782- "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
2287+ "node": ">=18.0.0"
7832288 }
7842289 },
785- "node_modules/@jest/globals": {
786- "version": "29.7.0",
787- "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz",
788- "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==",
789- "dev": true,
790- "peer": true,
2290+ "node_modules/@smithy/url-parser": {
2291+ "version": "4.0.4",
2292+ "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.0.4.tgz",
2293+ "integrity": "sha512-eMkc144MuN7B0TDA4U2fKs+BqczVbk3W+qIvcoCY6D1JY3hnAdCuhCZODC+GAeaxj0p6Jroz4+XMUn3PCxQQeQ==",
2294+ "license": "Apache-2.0",
7912295 "dependencies": {
792- "@jest/environment": "^29.7.0",
793- "@jest/expect": "^29.7.0",
794- "@jest/types": "^29.6.3",
795- "jest-mock": "^29.7.0"
2296+ "@smithy/querystring-parser": "^4.0.4",
2297+ "@smithy/types": "^4.3.1",
2298+ "tslib": "^2.6.2"
7962299 },
7972300 "engines": {
798- "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
2301+ "node": ">=18.0.0"
7992302 }
8002303 },
801- "node_modules/@jest/reporters": {
802- "version": "29.7.0",
803- "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz",
804- "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==",
805- "dev": true,
806- "peer": true,
2304+ "node_modules/@smithy/util-base64": {
2305+ "version": "4.0.0",
2306+ "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.0.0.tgz",
2307+ "integrity": "sha512-CvHfCmO2mchox9kjrtzoHkWHxjHZzaFojLc8quxXY7WAAMAg43nuxwv95tATVgQFNDwd4M9S1qFzj40Ul41Kmg==",
2308+ "license": "Apache-2.0",
8072309 "dependencies": {
808- "@bcoe/v8-coverage": "^0.2.3",
809- "@jest/console": "^29.7.0",
810- "@jest/test-result": "^29.7.0",
811- "@jest/transform": "^29.7.0",
812- "@jest/types": "^29.6.3",
813- "@jridgewell/trace-mapping": "^0.3.18",
814- "@types/node": "*",
815- "chalk": "^4.0.0",
816- "collect-v8-coverage": "^1.0.0",
817- "exit": "^0.1.2",
818- "glob": "^7.1.3",
819- "graceful-fs": "^4.2.9",
820- "istanbul-lib-coverage": "^3.0.0",
821- "istanbul-lib-instrument": "^6.0.0",
822- "istanbul-lib-report": "^3.0.0",
823- "istanbul-lib-source-maps": "^4.0.0",
824- "istanbul-reports": "^3.1.3",
825- "jest-message-util": "^29.7.0",
826- "jest-util": "^29.7.0",
827- "jest-worker": "^29.7.0",
828- "slash": "^3.0.0",
829- "string-length": "^4.0.1",
830- "strip-ansi": "^6.0.0",
831- "v8-to-istanbul": "^9.0.1"
2310+ "@smithy/util-buffer-from": "^4.0.0",
2311+ "@smithy/util-utf8": "^4.0.0",
2312+ "tslib": "^2.6.2"
8322313 },
8332314 "engines": {
834- "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
835- },
836- "peerDependencies": {
837- "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0"
838- },
839- "peerDependenciesMeta": {
840- "node-notifier": {
841- "optional": true
842- }
2315+ "node": ">=18.0.0"
8432316 }
8442317 },
845- "node_modules/@jest/schemas": {
846- "version": "29.6.3",
847- "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz",
848- "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==",
849- "dev": true,
2318+ "node_modules/@smithy/util-body-length-browser": {
2319+ "version": "4.0.0",
2320+ "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.0.0.tgz",
2321+ "integrity": "sha512-sNi3DL0/k64/LO3A256M+m3CDdG6V7WKWHdAiBBMUN8S3hK3aMPhwnPik2A/a2ONN+9doY9UxaLfgqsIRg69QA==",
2322+ "license": "Apache-2.0",
8502323 "dependencies": {
851- "@sinclair/typebox": "^0.27.8"
2324+ "tslib": "^2.6.2"
8522325 },
8532326 "engines": {
854- "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
2327+ "node": ">=18.0.0"
8552328 }
8562329 },
857- "node_modules/@jest/source-map": {
858- "version": "29.6.3",
859- "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz",
860- "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==",
861- "dev": true,
862- "peer": true,
2330+ "node_modules/@smithy/util-body-length-node": {
2331+ "version": "4.0.0",
2332+ "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.0.0.tgz",
2333+ "integrity": "sha512-q0iDP3VsZzqJyje8xJWEJCNIu3lktUGVoSy1KB0UWym2CL1siV3artm+u1DFYTLejpsrdGyCSWBdGNjJzfDPjg==",
2334+ "license": "Apache-2.0",
8632335 "dependencies": {
864- "@jridgewell/trace-mapping": "^0.3.18",
865- "callsites": "^3.0.0",
866- "graceful-fs": "^4.2.9"
2336+ "tslib": "^2.6.2"
8672337 },
8682338 "engines": {
869- "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
2339+ "node": ">=18.0.0"
8702340 }
8712341 },
872- "node_modules/@jest/test-result": {
873- "version": "29.7.0",
874- "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz",
875- "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==",
876- "dev": true,
877- "peer": true,
2342+ "node_modules/@smithy/util-buffer-from": {
2343+ "version": "4.0.0",
2344+ "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.0.0.tgz",
2345+ "integrity": "sha512-9TOQ7781sZvddgO8nxueKi3+yGvkY35kotA0Y6BWRajAv8jjmigQ1sBwz0UX47pQMYXJPahSKEKYFgt+rXdcug==",
2346+ "license": "Apache-2.0",
8782347 "dependencies": {
879- "@jest/console": "^29.7.0",
880- "@jest/types": "^29.6.3",
881- "@types/istanbul-lib-coverage": "^2.0.0",
882- "collect-v8-coverage": "^1.0.0"
2348+ "@smithy/is-array-buffer": "^4.0.0",
2349+ "tslib": "^2.6.2"
8832350 },
8842351 "engines": {
885- "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
2352+ "node": ">=18.0.0"
8862353 }
8872354 },
888- "node_modules/@jest/test-sequencer": {
889- "version": "29.7.0",
890- "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz",
891- "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==",
892- "dev": true,
893- "peer": true,
2355+ "node_modules/@smithy/util-config-provider": {
2356+ "version": "4.0.0",
2357+ "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.0.0.tgz",
2358+ "integrity": "sha512-L1RBVzLyfE8OXH+1hsJ8p+acNUSirQnWQ6/EgpchV88G6zGBTDPdXiiExei6Z1wR2RxYvxY/XLw6AMNCCt8H3w==",
2359+ "license": "Apache-2.0",
8942360 "dependencies": {
895- "@jest/test-result": "^29.7.0",
896- "graceful-fs": "^4.2.9",
897- "jest-haste-map": "^29.7.0",
898- "slash": "^3.0.0"
2361+ "tslib": "^2.6.2"
8992362 },
9002363 "engines": {
901- "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
2364+ "node": ">=18.0.0"
9022365 }
9032366 },
904- "node_modules/@jest/transform": {
905- "version": "29.7.0",
906- "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz",
907- "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==",
908- "dev": true,
909- "peer": true,
2367+ "node_modules/@smithy/util-defaults-mode-browser": {
2368+ "version": "4.0.21",
2369+ "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.0.21.tgz",
2370+ "integrity": "sha512-wM0jhTytgXu3wzJoIqpbBAG5U6BwiubZ6QKzSbP7/VbmF1v96xlAbX2Am/mz0Zep0NLvLh84JT0tuZnk3wmYQA==",
2371+ "license": "Apache-2.0",
9102372 "dependencies": {
911- "@babel/core": "^7.11.6",
912- "@jest/types": "^29.6.3",
913- "@jridgewell/trace-mapping": "^0.3.18",
914- "babel-plugin-istanbul": "^6.1.1",
915- "chalk": "^4.0.0",
916- "convert-source-map": "^2.0.0",
917- "fast-json-stable-stringify": "^2.1.0",
918- "graceful-fs": "^4.2.9",
919- "jest-haste-map": "^29.7.0",
920- "jest-regex-util": "^29.6.3",
921- "jest-util": "^29.7.0",
922- "micromatch": "^4.0.4",
923- "pirates": "^4.0.4",
924- "slash": "^3.0.0",
925- "write-file-atomic": "^4.0.2"
2373+ "@smithy/property-provider": "^4.0.4",
2374+ "@smithy/smithy-client": "^4.4.5",
2375+ "@smithy/types": "^4.3.1",
2376+ "bowser": "^2.11.0",
2377+ "tslib": "^2.6.2"
9262378 },
9272379 "engines": {
928- "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
2380+ "node": ">=18.0.0"
9292381 }
9302382 },
931- "node_modules/@jest/types": {
932- "version": "29.6.3",
933- "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz",
934- "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==",
935- "dev": true,
2383+ "node_modules/@smithy/util-defaults-mode-node": {
2384+ "version": "4.0.21",
2385+ "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.0.21.tgz",
2386+ "integrity": "sha512-/F34zkoU0GzpUgLJydHY8Rxu9lBn8xQC/s/0M0U9lLBkYbA1htaAFjWYJzpzsbXPuri5D1H8gjp2jBum05qBrA==",
2387+ "license": "Apache-2.0",
9362388 "dependencies": {
937- "@jest/schemas": "^29.6.3",
938- "@types/istanbul-lib-coverage": "^2.0.0",
939- "@types/istanbul-reports": "^3.0.0",
940- "@types/node": "*",
941- "@types/yargs": "^17.0.8",
942- "chalk": "^4.0.0"
2389+ "@smithy/config-resolver": "^4.1.4",
2390+ "@smithy/credential-provider-imds": "^4.0.6",
2391+ "@smithy/node-config-provider": "^4.1.3",
2392+ "@smithy/property-provider": "^4.0.4",
2393+ "@smithy/smithy-client": "^4.4.5",
2394+ "@smithy/types": "^4.3.1",
2395+ "tslib": "^2.6.2"
9432396 },
9442397 "engines": {
945- "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
2398+ "node": ">=18.0.0"
9462399 }
9472400 },
948- "node_modules/@jridgewell/gen-mapping": {
949- "version": "0.3.5",
950- "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz",
951- "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==",
952- "dev": true,
953- "peer": true,
2401+ "node_modules/@smithy/util-endpoints": {
2402+ "version": "3.0.6",
2403+ "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.0.6.tgz",
2404+ "integrity": "sha512-YARl3tFL3WgPuLzljRUnrS2ngLiUtkwhQtj8PAL13XZSyUiNLQxwG3fBBq3QXFqGFUXepIN73pINp3y8c2nBmA==",
2405+ "license": "Apache-2.0",
9542406 "dependencies": {
955- "@jridgewell/set-array": "^1.2.1",
956- "@jridgewell/sourcemap-codec": "^1.4.10",
957- "@jridgewell/trace-mapping": "^0.3.24"
2407+ "@smithy/node-config-provider": "^4.1.3",
2408+ "@smithy/types": "^4.3.1",
2409+ "tslib": "^2.6.2"
9582410 },
9592411 "engines": {
960- "node": ">=6.0.0"
2412+ "node": ">=18.0.0"
9612413 }
9622414 },
963- "node_modules/@jridgewell/resolve-uri": {
964- "version": "3.1.2",
965- "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
966- "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
967- "dev": true,
2415+ "node_modules/@smithy/util-hex-encoding": {
2416+ "version": "4.0.0",
2417+ "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.0.0.tgz",
2418+ "integrity": "sha512-Yk5mLhHtfIgW2W2WQZWSg5kuMZCVbvhFmC7rV4IO2QqnZdbEFPmQnCcGMAX2z/8Qj3B9hYYNjZOhWym+RwhePw==",
2419+ "license": "Apache-2.0",
2420+ "dependencies": {
2421+ "tslib": "^2.6.2"
2422+ },
9682423 "engines": {
969- "node": ">=6.0.0"
2424+ "node": ">=18.0.0"
9702425 }
9712426 },
972- "node_modules/@jridgewell/set-array": {
973- "version": "1.2.1",
974- "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz",
975- "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==",
976- "dev": true,
977- "peer": true,
2427+ "node_modules/@smithy/util-middleware": {
2428+ "version": "4.0.4",
2429+ "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.0.4.tgz",
2430+ "integrity": "sha512-9MLKmkBmf4PRb0ONJikCbCwORACcil6gUWojwARCClT7RmLzF04hUR4WdRprIXal7XVyrddadYNfp2eF3nrvtQ==",
2431+ "license": "Apache-2.0",
2432+ "dependencies": {
2433+ "@smithy/types": "^4.3.1",
2434+ "tslib": "^2.6.2"
2435+ },
9782436 "engines": {
979- "node": ">=6.0.0"
2437+ "node": ">=18.0.0"
9802438 }
9812439 },
982- "node_modules/@jridgewell/sourcemap-codec": {
983- "version": "1.5.0",
984- "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz",
985- "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==",
986- "dev": true
987- },
988- "node_modules/@jridgewell/trace-mapping": {
989- "version": "0.3.25",
990- "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz",
991- "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==",
992- "dev": true,
993- "peer": true,
2440+ "node_modules/@smithy/util-retry": {
2441+ "version": "4.0.6",
2442+ "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.0.6.tgz",
2443+ "integrity": "sha512-+YekoF2CaSMv6zKrA6iI/N9yva3Gzn4L6n35Luydweu5MMPYpiGZlWqehPHDHyNbnyaYlz/WJyYAZnC+loBDZg==",
2444+ "license": "Apache-2.0",
9942445 "dependencies": {
995- "@jridgewell/resolve-uri": "^3.1.0",
996- "@jridgewell/sourcemap-codec": "^1.4.14"
2446+ "@smithy/service-error-classification": "^4.0.6",
2447+ "@smithy/types": "^4.3.1",
2448+ "tslib": "^2.6.2"
2449+ },
2450+ "engines": {
2451+ "node": ">=18.0.0"
9972452 }
9982453 },
999- "node_modules/@sinclair/typebox": {
1000- "version": "0.27.8",
1001- "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz",
1002- "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==",
1003- "dev": true
2454+ "node_modules/@smithy/util-stream": {
2455+ "version": "4.2.2",
2456+ "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.2.2.tgz",
2457+ "integrity": "sha512-aI+GLi7MJoVxg24/3J1ipwLoYzgkB4kUfogZfnslcYlynj3xsQ0e7vk4TnTro9hhsS5PvX1mwmkRqqHQjwcU7w==",
2458+ "license": "Apache-2.0",
2459+ "dependencies": {
2460+ "@smithy/fetch-http-handler": "^5.0.4",
2461+ "@smithy/node-http-handler": "^4.0.6",
2462+ "@smithy/types": "^4.3.1",
2463+ "@smithy/util-base64": "^4.0.0",
2464+ "@smithy/util-buffer-from": "^4.0.0",
2465+ "@smithy/util-hex-encoding": "^4.0.0",
2466+ "@smithy/util-utf8": "^4.0.0",
2467+ "tslib": "^2.6.2"
2468+ },
2469+ "engines": {
2470+ "node": ">=18.0.0"
2471+ }
10042472 },
1005- "node_modules/@sinonjs/commons": {
1006- "version": "3.0.1",
1007- "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz",
1008- "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==",
1009- "dev": true,
1010- "peer": true,
2473+ "node_modules/@smithy/util-uri-escape": {
2474+ "version": "4.0.0",
2475+ "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.0.0.tgz",
2476+ "integrity": "sha512-77yfbCbQMtgtTylO9itEAdpPXSog3ZxMe09AEhm0dU0NLTalV70ghDZFR+Nfi1C60jnJoh/Re4090/DuZh2Omg==",
2477+ "license": "Apache-2.0",
10112478 "dependencies": {
1012- "type-detect": "4.0.8"
2479+ "tslib": "^2.6.2"
2480+ },
2481+ "engines": {
2482+ "node": ">=18.0.0"
10132483 }
10142484 },
1015- "node_modules/@sinonjs/fake-timers": {
1016- "version": "10.3.0",
1017- "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz",
1018- "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==",
1019- "dev": true,
1020- "peer": true,
2485+ "node_modules/@smithy/util-utf8": {
2486+ "version": "4.0.0",
2487+ "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.0.0.tgz",
2488+ "integrity": "sha512-b+zebfKCfRdgNJDknHCob3O7FpeYQN6ZG6YLExMcasDHsCXlsXCEuiPZeLnJLpwa5dvPetGlnGCiMHuLwGvFow==",
2489+ "license": "Apache-2.0",
10212490 "dependencies": {
1022- "@sinonjs/commons": "^3.0.0"
2491+ "@smithy/util-buffer-from": "^4.0.0",
2492+ "tslib": "^2.6.2"
2493+ },
2494+ "engines": {
2495+ "node": ">=18.0.0"
10232496 }
10242497 },
10252498 "node_modules/@tsconfig/node10": {
@@ -1173,6 +2646,12 @@
11732646 "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==",
11742647 "dev": true
11752648 },
2649+ "node_modules/@types/uuid": {
2650+ "version": "9.0.8",
2651+ "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz",
2652+ "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==",
2653+ "license": "MIT"
2654+ },
11762655 "node_modules/@types/yargs": {
11772656 "version": "17.0.32",
11782657 "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz",
@@ -1446,6 +2925,12 @@
14462925 "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
14472926 "dev": true
14482927 },
2928+ "node_modules/bowser": {
2929+ "version": "2.11.0",
2930+ "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz",
2931+ "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==",
2932+ "license": "MIT"
2933+ },
14492934 "node_modules/brace-expansion": {
14502935 "version": "1.1.11",
14512936 "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@@ -2004,6 +3489,28 @@
20043489 "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
20053490 "dev": true
20063491 },
3492+ "node_modules/fast-xml-parser": {
3493+ "version": "4.4.1",
3494+ "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz",
3495+ "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==",
3496+ "funding": [
3497+ {
3498+ "type": "github",
3499+ "url": "https://github.com/sponsors/NaturalIntelligence"
3500+ },
3501+ {
3502+ "type": "paypal",
3503+ "url": "https://paypal.me/naturalintelligence"
3504+ }
3505+ ],
3506+ "license": "MIT",
3507+ "dependencies": {
3508+ "strnum": "^1.0.5"
3509+ },
3510+ "bin": {
3511+ "fxparser": "src/cli/cli.js"
3512+ }
3513+ },
20073514 "node_modules/fb-watchman": {
20083515 "version": "2.0.2",
20093516 "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz",
@@ -3974,6 +5481,18 @@
39745481 "url": "https://github.com/sponsors/sindresorhus"
39755482 }
39765483 },
5484+ "node_modules/strnum": {
5485+ "version": "1.1.2",
5486+ "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.1.2.tgz",
5487+ "integrity": "sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA==",
5488+ "funding": [
5489+ {
5490+ "type": "github",
5491+ "url": "https://github.com/sponsors/NaturalIntelligence"
5492+ }
5493+ ],
5494+ "license": "MIT"
5495+ },
39775496 "node_modules/supports-color": {
39785497 "version": "7.2.0",
39795498 "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
@@ -4151,6 +5670,12 @@
41515670 }
41525671 }
41535672 },
5673+ "node_modules/tslib": {
5674+ "version": "2.8.1",
5675+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
5676+ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
5677+ "license": "0BSD"
5678+ },
41545679 "node_modules/type-detect": {
41555680 "version": "4.0.8",
41565681 "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
modified packages/openai-adapters/package.json +3 −1
@@ -1,6 +1,6 @@
11 {
22 "name": "@continuedev/openai-adapters",
3- "version": "1.0.44",
3+ "version": "1.0.45",
44 "description": "",
55 "main": "dist/index.js",
66 "types": "dist/index.d.ts",
@@ -12,6 +12,8 @@
1212 "author": "Nate Sesti and Ty Dunn",
1313 "license": "Apache-2.0",
1414 "dependencies": {
15+ "@aws-sdk/client-bedrock-runtime": "^3.842.0",
16+ "@aws-sdk/credential-providers": "^3.840.0",
1517 "@continuedev/config-types": "^1.0.5",
1618 "@continuedev/config-yaml": "^1.0.51",
1719 "@continuedev/fetch": "^1.0.15",
added packages/openai-adapters/src/apis/Bedrock.ts +691 −0
@@ -0,0 +1,691 @@
1+import {
2+ BedrockRuntimeClient,
3+ ContentBlock,
4+ ConversationRole,
5+ ConverseStreamCommand,
6+ ConverseStreamCommandInput,
7+ ImageFormat,
8+ InvokeModelCommand,
9+ Message,
10+ ToolConfiguration,
11+} from "@aws-sdk/client-bedrock-runtime";
12+import { OpenAI } from "openai/index";
13+import { v4 as uuidv4 } from "uuid";
14+
15+import {
16+ ChatCompletion,
17+ ChatCompletionChunk,
18+ ChatCompletionCreateParams,
19+ ChatCompletionCreateParamsNonStreaming,
20+ ChatCompletionCreateParamsStreaming,
21+ ChatCompletionMessageToolCall,
22+ Completion,
23+ CompletionCreateParamsNonStreaming,
24+ CompletionCreateParamsStreaming,
25+ CreateEmbeddingResponse,
26+ EmbeddingCreateParams,
27+ Model,
28+} from "openai/resources/index";
29+
30+import { fromNodeProviderChain } from "@aws-sdk/credential-providers";
31+import { BedrockConfig } from "../types.js";
32+import { chatChunk, chatChunkFromDelta, embedding, rerank } from "../util.js";
33+import { safeParseArgs } from "../util/parseArgs.js";
34+import {
35+ BaseLlmApi,
36+ CreateRerankResponse,
37+ FimCreateParamsStreaming,
38+ RerankCreateParams,
39+} from "./base.js";
40+
41+// Utility function to get or generate UUID for prompt caching
42+function getSecureID(): string {
43+ // Adding a type declaration for the static property
44+ if (!(getSecureID as any).uuid) {
45+ (getSecureID as any).uuid = crypto.randomUUID();
46+ }
47+ return `<!-- SID: ${(getSecureID as any).uuid} -->`;
48+}
49+
50+/**
51+ * Interface for tool use state tracking
52+ */
53+interface ToolUseState {
54+ toolUseId: string;
55+ name: string;
56+ input: string;
57+}
58+
59+export class BedrockApi implements BaseLlmApi {
60+ private _currentToolResponse: Partial<ToolUseState> | null = null;
61+
62+ constructor(protected config: BedrockConfig) {
63+ if (config.env?.accessKeyId || config?.env?.secretAccessKey) {
64+ if (!config.env?.accessKeyId) {
65+ throw new Error(
66+ "accessKeyId is required for Bedrock API. Only found secretAccessKey",
67+ );
68+ }
69+ if (!config.env?.secretAccessKey) {
70+ throw new Error(
71+ "secretAccessKey is required for Bedrock API. Only found accessKeyId",
72+ );
73+ }
74+ }
75+ }
76+
77+ async getCreds() {
78+ if (this.config?.env?.accessKeyId && this.config?.env?.secretAccessKey) {
79+ return {
80+ accessKeyId: this.config.env.accessKeyId,
81+ secretAccessKey: this.config.env.secretAccessKey,
82+ };
83+ }
84+ const profile = this.config.env.profile ?? "bedrock";
85+ try {
86+ return await fromNodeProviderChain({
87+ profile: profile,
88+ ignoreCache: true,
89+ })();
90+ } catch (e) {
91+ console.warn(
92+ `AWS profile with name ${profile} not found in ~/.aws/credentials, using default profile`,
93+ );
94+ }
95+ return await fromNodeProviderChain()();
96+ }
97+ async getClient(): Promise<BedrockRuntimeClient> {
98+ const creds = await this.getCreds();
99+ return new BedrockRuntimeClient({
100+ region: this.config.env.region,
101+ credentials: creds,
102+ });
103+ }
104+
105+ private _oaiPartToBedrockPart(
106+ part:
107+ | OpenAI.Chat.Completions.ChatCompletionContentPart
108+ | OpenAI.Chat.Completions.ChatCompletionContentPartRefusal,
109+ ): ContentBlock {
110+ switch (part.type) {
111+ case "refusal":
112+ return {
113+ text: part.refusal,
114+ };
115+ case "text":
116+ return {
117+ text: part.text,
118+ };
119+ case "input_audio":
120+ throw new Error("Unsupported part type: input_audio");
121+ case "image_url":
122+ default:
123+ try {
124+ const [mimeType, base64Data] = part.image_url.url.split(",");
125+ const format = mimeType.split("/")[1]?.split(";")[0] || "jpeg";
126+ if (
127+ format === ImageFormat.JPEG ||
128+ format === ImageFormat.PNG ||
129+ format === ImageFormat.WEBP ||
130+ format === ImageFormat.GIF
131+ ) {
132+ return {
133+ image: {
134+ format,
135+ source: {
136+ bytes: Uint8Array.from(Buffer.from(base64Data, "base64")),
137+ },
138+ },
139+ };
140+ } else {
141+ console.warn(
142+ `Bedrock: skipping unsupported image part format: ${format}`,
143+ );
144+ return { text: "[Unsupported image format]" };
145+ }
146+ } catch (error) {
147+ console.warn("Bedrock: failed to process image part", error);
148+ return { text: "[Failed to process image]" };
149+ }
150+ }
151+ }
152+
153+ private _convertMessages(
154+ oaiMessages: OpenAI.Chat.Completions.ChatCompletionMessageParam[],
155+ availableTools: Set<string>,
156+ ): Message[] {
157+ let currentRole: "user" | "assistant" = "user";
158+ let currentBlocks: ContentBlock[] = [];
159+ const converted: Message[] = [];
160+ const hasAddedToolCallIds = new Set<string>();
161+
162+ const pushCurrentMessage = () => {
163+ if (currentBlocks.length > 0) {
164+ converted.push({
165+ role: currentRole,
166+ content: currentBlocks,
167+ });
168+ currentBlocks = [];
169+ }
170+ };
171+
172+ const nonSystemMessages = oaiMessages.filter((m) => m.role !== "system");
173+
174+ for (let idx = 0; idx < nonSystemMessages.length; idx++) {
175+ const message = nonSystemMessages[idx];
176+
177+ if (message.role === "user" || message.role === "tool") {
178+ // Detect conversational turn change
179+ if (currentRole !== ConversationRole.USER) {
180+ pushCurrentMessage();
181+ currentRole = ConversationRole.USER;
182+ }
183+
184+ // USER messages
185+ if (message.role === "user") {
186+ const content = message.content;
187+ if (content) {
188+ if (typeof content === "string") {
189+ currentBlocks.push({ text: content });
190+ } else {
191+ content.forEach((part) => {
192+ currentBlocks.push(this._oaiPartToBedrockPart(part));
193+ });
194+ }
195+ }
196+ }
197+ // TOOL messages
198+ else if (message.role === "tool") {
199+ const trimmedContent =
200+ typeof message.content === "string"
201+ ? message.content.trim()
202+ : message.content
203+ .map((c) => c.text)
204+ .join("\n")
205+ .trim();
206+
207+ if (hasAddedToolCallIds.has(message.tool_call_id)) {
208+ currentBlocks.push({
209+ toolResult: {
210+ toolUseId: message.tool_call_id,
211+ content: [
212+ {
213+ text: trimmedContent || "No tool output",
214+ },
215+ ],
216+ },
217+ });
218+ } else {
219+ currentBlocks.push({
220+ text: `Tool call output for Tool Call ID ${message.tool_call_id}:\n\n${trimmedContent || "No tool output"}`,
221+ });
222+ }
223+ }
224+ } else if (message.role === "assistant") {
225+ // Detect conversational turn change
226+ if (currentRole !== ConversationRole.ASSISTANT) {
227+ pushCurrentMessage();
228+ currentRole = ConversationRole.ASSISTANT;
229+ }
230+
231+ // ASSISTANT messages
232+ if (typeof message.content === "string") {
233+ const trimmedText = message.content.trim();
234+ if (trimmedText) {
235+ currentBlocks.push({ text: trimmedText });
236+ }
237+ } else {
238+ message.content?.forEach((part) => {
239+ const text = part.type === "text" ? part.text : part.refusal;
240+ const trimmedText = text.trim();
241+ if (trimmedText) {
242+ currentBlocks.push({ text: trimmedText });
243+ }
244+ });
245+ }
246+
247+ // TOOL CALLS
248+ if (message.tool_calls) {
249+ for (const toolCall of message.tool_calls) {
250+ if (toolCall.id && toolCall.function?.name) {
251+ if (availableTools.has(toolCall.function.name)) {
252+ currentBlocks.push({
253+ toolUse: {
254+ toolUseId: toolCall.id,
255+ name: toolCall.function.name,
256+ input: safeParseArgs(
257+ toolCall.function.arguments,
258+ `Call: ${toolCall.function.name} ${toolCall.id}`,
259+ ),
260+ },
261+ });
262+ hasAddedToolCallIds.add(toolCall.id);
263+ } else {
264+ const toolCallText = `Assistant tool call:\nTool name: ${toolCall.function.name}\nTool Call ID: ${toolCall.id}\nArguments: ${toolCall.function?.arguments ?? "{}"}`;
265+ currentBlocks.push({
266+ text: toolCallText,
267+ });
268+ }
269+ }
270+ }
271+ }
272+ }
273+ }
274+
275+ if (currentBlocks.length > 0) {
276+ pushCurrentMessage();
277+ }
278+
279+ // If caching is enabled, add cache points
280+ // if (this.config.cacheBehavior?.cacheConversation) {
281+ // this._addCachingToLastTwoUserMessages(converted);
282+ // }
283+
284+ return converted;
285+ }
286+
287+ private _addCachingToLastTwoUserMessages(converted: Message[]) {
288+ let numCached = 0;
289+ for (let i = converted.length - 1; i >= 0; i--) {
290+ const message = converted[i];
291+ if (message.role === "user") {
292+ message.content?.forEach((block) => {
293+ if (block.text) {
294+ block.text += getSecureID();
295+ }
296+ });
297+ message.content?.push({ cachePoint: { type: "default" } });
298+ numCached++;
299+ }
300+ if (numCached === 2) {
301+ break;
302+ }
303+ }
304+ }
305+
306+ private _convertBody(
307+ oaiBody: ChatCompletionCreateParams,
308+ ): ConverseStreamCommandInput {
309+ // Extract system message
310+ const systemMessage =
311+ oaiBody.messages.find((msg) => msg.role === "system")?.content || "";
312+
313+ const systemMessageText =
314+ typeof systemMessage === "string"
315+ ? systemMessage
316+ : systemMessage
317+ .map((part) =>
318+ part.type === "text" ? part.text : "[Non-text content]",
319+ )
320+ .join(" ");
321+
322+ // Check for tools
323+ const availableTools = new Set<string>();
324+ let toolConfig: ToolConfiguration | undefined = undefined;
325+
326+ if (oaiBody.tools && oaiBody.tools.length > 0) {
327+ toolConfig = {
328+ tools: oaiBody.tools.map((tool) => ({
329+ toolSpec: {
330+ name: tool.function.name,
331+ description: tool.function.description,
332+ inputSchema: {
333+ json: tool.function.parameters,
334+ },
335+ },
336+ })),
337+ } as ToolConfiguration;
338+
339+ // Add cache point if needed
340+ // if (this.config.cacheBehavior?.cacheSystemMessage) {
341+ // toolConfig!.tools!.push({ cachePoint: { type: "default" } });
342+ // }
343+
344+ oaiBody.tools.forEach((tool) => {
345+ availableTools.add(tool.function.name);
346+ });
347+ }
348+
349+ // Convert messages
350+ const convertedMessages = this._convertMessages(
351+ oaiBody.messages,
352+ availableTools,
353+ );
354+
355+ // Build final request body
356+ const body: any = {
357+ modelId: oaiBody.model,
358+ messages: convertedMessages,
359+ inferenceConfig: {
360+ temperature: oaiBody.temperature,
361+ topP: oaiBody.top_p,
362+ maxTokens: oaiBody.max_tokens,
363+ stopSequences: Array.isArray(oaiBody.stop)
364+ ? oaiBody.stop.filter((s) => s.trim() !== "").slice(0, 4)
365+ : oaiBody.stop
366+ ? [oaiBody.stop].filter((s) => s.trim() !== "")
367+ : undefined,
368+ },
369+ };
370+
371+ // Add system message if present
372+ if (systemMessageText) {
373+ body.system = false // this.config.cacheBehavior?.cacheSystemMessage // TODO
374+ ? [{ text: systemMessageText }, { cachePoint: { type: "default" } }]
375+ : [{ text: systemMessageText }];
376+ }
377+
378+ // Add tool config if present
379+ if (toolConfig) {
380+ body.toolConfig = toolConfig;
381+ }
382+
383+ // Add reasoning if needed
384+ // TODO REASONING
385+ // if (this.c) {
386+ // body.additionalModelRequestFields = {
387+ // thinking: {
388+ // type: "enabled",
389+ // budget_tokens:
390+ // oaiBody.additionalModelRequestFields.reasoningBudgetTokens,
391+ // },
392+ // };
393+ // }
394+
395+ return body;
396+ }
397+
398+ async chatCompletionNonStream(
399+ body: ChatCompletionCreateParamsNonStreaming,
400+ signal: AbortSignal,
401+ ): Promise<ChatCompletion> {
402+ let completion = "";
403+ const toolCalls: ChatCompletionMessageToolCall[] = [];
404+
405+ for await (const chunk of this.chatCompletionStream(
406+ {
407+ ...body,
408+ stream: true,
409+ },
410+ signal,
411+ )) {
412+ if (chunk.choices[0].delta.content) {
413+ completion += chunk.choices[0].delta.content;
414+ }
415+ // TODO tool calls not supported
416+ }
417+
418+ return {
419+ id: uuidv4(),
420+ object: "chat.completion",
421+ model: body.model,
422+ created: Date.now(),
423+ choices: [
424+ {
425+ index: 0,
426+ logprobs: null,
427+ finish_reason: "stop",
428+ message: {
429+ role: "assistant",
430+ content: completion,
431+ tool_calls: toolCalls.length > 0 ? toolCalls : undefined,
432+ refusal: null,
433+ },
434+ },
435+ ],
436+ usage: undefined,
437+ };
438+ }
439+
440+ async *chatCompletionStream(
441+ body: ChatCompletionCreateParamsStreaming,
442+ signal: AbortSignal,
443+ ): AsyncGenerator<ChatCompletionChunk> {
444+ const requestBody = this._convertBody(body);
445+
446+ try {
447+ const command = new ConverseStreamCommand({
448+ ...requestBody,
449+ });
450+
451+ const client = await this.getClient();
452+ const response = await client.send(command, { abortSignal: signal });
453+
454+ if (!response?.stream) {
455+ throw new Error("No stream received from Bedrock API");
456+ }
457+
458+ this._currentToolResponse = null;
459+
460+ for await (const chunk of response.stream) {
461+ if (chunk.contentBlockDelta?.delta) {
462+ const delta: any = chunk.contentBlockDelta.delta;
463+
464+ // Handle text content
465+ if (delta.text) {
466+ yield chatChunk({
467+ content: delta.text,
468+ model: body.model,
469+ });
470+ continue;
471+ }
472+
473+ // Handle thinking content (if reasoning enabled)
474+ if (delta.reasoningContent?.text) {
475+ // TODO reasoning
476+ // Reasoning is not directly supported in OpenAI format,
477+ // but we could add it as a special message
478+ continue;
479+ }
480+
481+ // Handle tool use
482+ if (delta.toolUse?.input && this._currentToolResponse) {
483+ if (this._currentToolResponse.input === undefined) {
484+ this._currentToolResponse.input = "";
485+ }
486+ this._currentToolResponse.input += delta.toolUse.input;
487+ continue;
488+ }
489+ }
490+
491+ if (chunk.contentBlockStart?.start) {
492+ const start: any = chunk.contentBlockStart.start;
493+
494+ // Handle tool start
495+ const toolUse = start.toolUse;
496+ if (toolUse?.toolUseId && toolUse?.name) {
497+ this._currentToolResponse = {
498+ toolUseId: toolUse.toolUseId,
499+ name: toolUse.name,
500+ input: "",
501+ };
502+ }
503+ continue;
504+ }
505+
506+ if (chunk.contentBlockStop) {
507+ // End of a content block
508+ if (this._currentToolResponse) {
509+ yield chatChunkFromDelta({
510+ model: body.model,
511+ delta: {
512+ tool_calls: [
513+ {
514+ index: 0,
515+ id: this._currentToolResponse.toolUseId,
516+ type: "function",
517+ function: {
518+ name: this._currentToolResponse.name,
519+ arguments: this._currentToolResponse.input,
520+ },
521+ },
522+ ],
523+ },
524+ });
525+ this._currentToolResponse = null;
526+ }
527+ continue;
528+ }
529+ }
530+ } catch (error) {
531+ this._currentToolResponse = null;
532+ if (error instanceof Error) {
533+ if ("code" in error) {
534+ throw new Error(
535+ `AWS Bedrock stream error (${(error as any).code}): ${error.message}`,
536+ );
537+ }
538+ throw new Error(`Error processing Bedrock stream: ${error.message}`);
539+ }
540+ throw new Error(
541+ "Error processing Bedrock stream: Unknown error occurred",
542+ );
543+ }
544+ }
545+
546+ completionNonStream(
547+ body: CompletionCreateParamsNonStreaming,
548+ ): Promise<Completion> {
549+ throw new Error("Bedrock does not support completions API");
550+ }
551+
552+ completionStream(
553+ body: CompletionCreateParamsStreaming,
554+ ): AsyncGenerator<Completion> {
555+ throw new Error("Bedrock does not support completions API");
556+ }
557+
558+ fimStream(
559+ body: FimCreateParamsStreaming,
560+ ): AsyncGenerator<ChatCompletionChunk> {
561+ throw new Error("Bedrock does not support FIM directly");
562+ }
563+
564+ private async getInvokeModelResponseBody(model: string, jsonBody: object) {
565+ const payload = {
566+ body: JSON.stringify(jsonBody),
567+ modelId: model,
568+ accept: "*/*",
569+ contentType: "application/json",
570+ };
571+ const command = new InvokeModelCommand(payload);
572+ const client = await this.getClient();
573+ const response = await client.send(command);
574+ if (!response.body) {
575+ throw new Error("No response body");
576+ }
577+ const decoder = new TextDecoder();
578+ const decoded = decoder.decode(response.body);
579+ return JSON.parse(decoded);
580+ }
581+
582+ private getEmbedTexts(body: EmbeddingCreateParams): string[] {
583+ const texts: string[] = [];
584+ if (typeof body.input === "string") {
585+ texts.push(body.input);
586+ } else if (body.input.length > 0) {
587+ const firstVal = body.input[0];
588+ if (Array.isArray(firstVal)) {
589+ throw new Error("Unsupported embeddings type received: number[][]");
590+ }
591+ if (typeof firstVal === "string") {
592+ texts.push(...(body.input as string[]));
593+ } else {
594+ throw new Error("Unsupported embeddings type received: number[]");
595+ }
596+ }
597+ return texts;
598+ }
599+
600+ async embed(body: EmbeddingCreateParams): Promise<CreateEmbeddingResponse> {
601+ const texts = this.getEmbedTexts(body);
602+
603+ let embeddings: number[][];
604+ if (body.model.startsWith("cohere")) {
605+ const payload = {
606+ texts,
607+ input_type: "search_document",
608+ truncate: "END",
609+ };
610+ const output = await this.getInvokeModelResponseBody(body.model, payload);
611+ embeddings = [output.embedding];
612+ } else if (body.model.startsWith("amazon.titan-embed")) {
613+ embeddings = await Promise.all(
614+ texts.map(async (text) => {
615+ const payload = {
616+ inputText: text,
617+ };
618+ const output = await this.getInvokeModelResponseBody(
619+ body.model,
620+ payload,
621+ );
622+ return output.embeddings || [];
623+ }),
624+ );
625+ } else {
626+ throw new Error(`Unsupported model: ${body.model}`);
627+ }
628+
629+ return embedding({
630+ data: embeddings,
631+ model: body.model,
632+ usage: {
633+ prompt_tokens: 0,
634+ total_tokens: 0,
635+ },
636+ });
637+ }
638+
639+ async rerank(body: RerankCreateParams): Promise<CreateRerankResponse> {
640+ if (!body.query || !body.documents.length) {
641+ throw new Error("Query and chunks must not be empty");
642+ }
643+
644+ // Base payload for both models
645+ const payload: any = {
646+ query: body.query,
647+ documents: body.documents,
648+ top_n: body.top_k ?? body.documents.length,
649+ };
650+
651+ // Add api_version for Cohere model
652+ if (body.model.startsWith("cohere.rerank")) {
653+ payload.api_version = 2;
654+ }
655+
656+ try {
657+ const responseBody = await this.getInvokeModelResponseBody(
658+ body.model,
659+ payload,
660+ );
661+ const scores = responseBody.results
662+ .sort((a: any, b: any) => a.index - b.index)
663+ .map((result: any) => result.relevance_score);
664+
665+ return rerank({
666+ model: body.model,
667+ usage: {
668+ total_tokens: 0,
669+ },
670+ data: scores,
671+ });
672+ } catch (error) {
673+ if (error instanceof Error) {
674+ if ("code" in error) {
675+ // AWS SDK specific errors
676+ throw new Error(
677+ `AWS Bedrock rerank error (${(error as any).code}): ${error.message}`,
678+ );
679+ }
680+ throw new Error(`Error in BedrockReranker.rerank: ${error.message}`);
681+ }
682+ throw new Error(
683+ "Error in BedrockReranker.rerank: Unknown error occurred",
684+ );
685+ }
686+ }
687+
688+ list(): Promise<Model[]> {
689+ throw new Error("Method not implemented.");
690+ }
691+}
modified packages/openai-adapters/src/index.ts +3 −0
@@ -2,6 +2,7 @@
22 import { z } from "zod";
33 import { AnthropicApi } from "./apis/Anthropic.js";
44 import { AzureApi } from "./apis/Azure.js";
5+import { BedrockApi } from "./apis/Bedrock.js";
56 import { CohereApi } from "./apis/Cohere.js";
67 import { DeepSeekApi } from "./apis/DeepSeek.js";
78 import { GeminiApi } from "./apis/Gemini.js";
@@ -34,6 +35,8 @@
3435 return new OpenAIApi(config);
3536 case "azure":
3637 return new AzureApi(config);
38+ case "bedrock":
39+ return new BedrockApi(config);
3740 case "cohere":
3841 return new CohereApi(config);
3942 case "anthropic":
modified packages/openai-adapters/src/types.ts +16 −0
@@ -71,6 +71,21 @@
7171 });
7272 export type DeepseekConfig = z.infer<typeof DeepseekConfigSchema>;
7373
74+export const BedrockConfigSchema = OpenAIConfigSchema.extend({
75+ provider: z.literal("bedrock"),
76+ // cacheBehavior: z.object({
77+ // cacheSystemMessage: z.boolean().optional(),
78+ // cacheConversation: z.boolean().optional(),
79+ // }).optional(),
80+ env: z.object({
81+ region: z.string().optional(),
82+ accessKeyId: z.string().optional(),
83+ secretAccessKey: z.string().optional(),
84+ profile: z.string().optional(),
85+ }),
86+});
87+export type BedrockConfig = z.infer<typeof BedrockConfigSchema>;
88+
7489 export const LlamastackConfigSchema = OpenAIConfigSchema.extend({
7590 provider: z.literal("llamastack"),
7691 });
@@ -142,6 +157,7 @@
142157 // Discriminated union
143158 export const LLMConfigSchema = z.discriminatedUnion("provider", [
144159 OpenAIConfigSchema,
160+ BedrockConfigSchema,
145161 MoonshotConfigSchema,
146162 DeepseekConfigSchema,
147163 CohereConfigSchema,