Changesets · Branches · Tags · Compare
| Changeset | 5e92b78eb714c39924fa8eeed956d3f8c1aa35aa9f68a28f64f2cbff622083f3 |
|---|---|
| Author | uinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-07-09 08:48 +05:30 |
| Committer | uinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-07-09 08:48 +05:30 |
| Parents | 101d05b5ea8c, d3432ada2b04 |
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 @@ | ||
| 643 | 643 | template: llm.template, |
| 644 | 644 | completionOptions: llm.completionOptions, |
| 645 | 645 | baseAgentSystemMessage: llm.baseAgentSystemMessage, |
| 646 | + basePlanSystemMessage: llm.basePlanSystemMessage, | |
| 646 | 647 | baseChatSystemMessage: llm.baseChatSystemMessage, |
| 647 | 648 | requestOptions: llm.requestOptions, |
| 648 | 649 | promptTemplates: serializePromptTemplates(llm.promptTemplates), |
| @@ -650,6 +651,7 @@ | ||
| 650 | 651 | roles: llm.roles, |
| 651 | 652 | configurationStatus: llm.getConfigurationStatus(), |
| 652 | 653 | apiKeyLocation: llm.apiKeyLocation, |
| 654 | + envSecretLocations: llm.envSecretLocations, | |
| 653 | 655 | }; |
| 654 | 656 | } |
| 655 | 657 |
modified core/config/types.ts +2 −0
| @@ -1004,6 +1004,8 @@ | ||
| 1004 | 1004 | type: "stdio"; |
| 1005 | 1005 | command: string; |
| 1006 | 1006 | args: string[]; |
| 1007 | + env?: Record<string, string>; | |
| 1008 | + cwd?: string; | |
| 1007 | 1009 | } |
| 1008 | 1010 | |
| 1009 | 1011 | interface WebSocketOptions { |
modified core/config/yaml/loadYaml.ts +1 −0
| @@ -69,6 +69,7 @@ | ||
| 69 | 69 | command: server.command, |
| 70 | 70 | args: server.args ?? [], |
| 71 | 71 | env: server.env, |
| 72 | + cwd: server.cwd, | |
| 72 | 73 | } as any, // TODO: Fix the mcpServers types in config-yaml (discriminated union) |
| 73 | 74 | timeout: server.connectionTimeout, |
| 74 | 75 | }; |
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 @@ | ||
| 63 | 63 | template: model.promptTemplates?.chat, |
| 64 | 64 | promptTemplates: model.promptTemplates, |
| 65 | 65 | baseAgentSystemMessage: model.chatOptions?.baseAgentSystemMessage, |
| 66 | + basePlanSystemMessage: model.chatOptions?.basePlanSystemMessage, | |
| 66 | 67 | baseChatSystemMessage: model.chatOptions?.baseSystemMessage, |
| 67 | 68 | capabilities: { |
| 68 | 69 | tools: model.capabilities?.includes("tool_use"), |
| @@ -126,6 +127,12 @@ | ||
| 126 | 127 | if ("profile" in env && typeof env.profile === "string") { |
| 127 | 128 | options.profile = env.profile; |
| 128 | 129 | } |
| 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 | + } | |
| 129 | 136 | if ("modelArn" in env && typeof env.modelArn === "string") { |
| 130 | 137 | options.modelArn = env.modelArn; |
| 131 | 138 | } |
modified core/context/mcp/MCPConnection.ts +1 −0
| @@ -329,6 +329,7 @@ | ||
| 329 | 329 | command, |
| 330 | 330 | args, |
| 331 | 331 | env, |
| 332 | + cwd: options.transport.cwd, | |
| 332 | 333 | stderr: "pipe", |
| 333 | 334 | }); |
| 334 | 335 |
modified core/context/mcp/MCPConnection.vitest.ts +22 −0
| @@ -1,6 +1,7 @@ | ||
| 1 | 1 | import { Client } from "@modelcontextprotocol/sdk/client/index.js"; |
| 2 | 2 | import { beforeEach, describe, expect, it, vi } from "vitest"; |
| 3 | 3 | import MCPConnection from "./MCPConnection"; |
| 4 | +import { StdioOptions } from "../../index.d.js"; | |
| 4 | 5 | |
| 5 | 6 | describe("MCPConnection", () => { |
| 6 | 7 | beforeEach(() => { |
| @@ -25,6 +26,27 @@ | ||
| 25 | 26 | expect(conn.status).toBe("not-connected"); |
| 26 | 27 | }); |
| 27 | 28 | |
| 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 | + | |
| 28 | 50 | it("should create instance with websocket transport", () => { |
| 29 | 51 | const options = { |
| 30 | 52 | name: "test-mcp", |
modified core/index.d.ts +12 −3
| @@ -428,7 +428,7 @@ | ||
| 428 | 428 | completion: string; |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | -export type MessageModes = "chat" | "agent"; | |
| 431 | +export type MessageModes = "chat" | "agent" | "plan"; | |
| 432 | 432 | |
| 433 | 433 | export type ToolStatus = |
| 434 | 434 | | "generating" |
| @@ -568,6 +568,7 @@ | ||
| 568 | 568 | title?: string; |
| 569 | 569 | uniqueId?: string; |
| 570 | 570 | baseAgentSystemMessage?: string; |
| 571 | + basePlanSystemMessage?: string; | |
| 571 | 572 | baseChatSystemMessage?: string; |
| 572 | 573 | autocompleteOptions?: Partial<TabAutocompleteOptions>; |
| 573 | 574 | contextLength?: number; |
| @@ -583,6 +584,7 @@ | ||
| 583 | 584 | |
| 584 | 585 | // continueProperties |
| 585 | 586 | apiKeyLocation?: string; |
| 587 | + envSecretLocations?: Record<string, string>; | |
| 586 | 588 | apiBase?: string; |
| 587 | 589 | orgScopeId?: string | null; |
| 588 | 590 | |
| @@ -611,6 +613,8 @@ | ||
| 611 | 613 | // AWS options |
| 612 | 614 | profile?: string; |
| 613 | 615 | modelArn?: string; |
| 616 | + accessKeyId?: string; | |
| 617 | + secretAccessKey?: string; | |
| 614 | 618 | |
| 615 | 619 | // AWS and VertexAI Options |
| 616 | 620 | region?: string; |
| @@ -1082,6 +1086,7 @@ | ||
| 1082 | 1086 | |
| 1083 | 1087 | apiBase?: string; |
| 1084 | 1088 | apiKeyLocation?: string; |
| 1089 | + envSecretLocations?: Record<string, string>; | |
| 1085 | 1090 | orgScopeId?: string | null; |
| 1086 | 1091 | |
| 1087 | 1092 | onPremProxyUrl?: string | null; |
| @@ -1091,6 +1096,7 @@ | ||
| 1091 | 1096 | template?: TemplateType; |
| 1092 | 1097 | completionOptions?: BaseCompletionOptions; |
| 1093 | 1098 | baseAgentSystemMessage?: string; |
| 1099 | + basePlanSystemMessage?: string; | |
| 1094 | 1100 | baseChatSystemMessage?: string; |
| 1095 | 1101 | requestOptions?: RequestOptions; |
| 1096 | 1102 | promptTemplates?: { [key: string]: string }; |
| @@ -1162,6 +1168,7 @@ | ||
| 1162 | 1168 | command: string; |
| 1163 | 1169 | args: string[]; |
| 1164 | 1170 | env?: Record<string, string>; |
| 1171 | + cwd?: string; | |
| 1165 | 1172 | requestOptions?: RequestOptions; |
| 1166 | 1173 | } |
| 1167 | 1174 | |
| @@ -1636,9 +1643,11 @@ | ||
| 1636 | 1643 | |
| 1637 | 1644 | export type RuleSource = |
| 1638 | 1645 | | "default-chat" |
| 1646 | + | "default-plan" | |
| 1639 | 1647 | | "default-agent" |
| 1640 | - | "model-chat-options" | |
| 1641 | - | "model-agent-options" | |
| 1648 | + | "model-options-chat" | |
| 1649 | + | "model-options-plan" | |
| 1650 | + | "model-options-agent" | |
| 1642 | 1651 | | "rules-block" |
| 1643 | 1652 | | "json-systemMessage" |
| 1644 | 1653 | | ".continuerules"; |
modified core/llm/constants.ts +1 −0
| @@ -15,6 +15,7 @@ | ||
| 15 | 15 | export enum LLMConfigurationStatuses { |
| 16 | 16 | VALID = "valid", |
| 17 | 17 | MISSING_API_KEY = "missing-api-key", |
| 18 | + MISSING_ENV_SECRET = "missing-env-secret", | |
| 18 | 19 | } |
| 19 | 20 | |
| 20 | 21 | 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 = | |
| 5 | 2 | "https://github.com/continuedev/continue/blob/main/core/llm/defaultSystemMessages.ts"; |
| 6 | 3 | |
| 7 | 4 | export const CODEBLOCK_FORMATTING_INSTRUCTIONS = `\ |
| @@ -66,3 +63,17 @@ | ||
| 66 | 63 | |
| 67 | 64 | ${CODEBLOCK_FORMATTING_INSTRUCTIONS} |
| 68 | 65 | </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 @@ | ||
| 141 | 141 | |
| 142 | 142 | title?: string; |
| 143 | 143 | baseChatSystemMessage?: string; |
| 144 | + basePlanSystemMessage?: string; | |
| 144 | 145 | baseAgentSystemMessage?: string; |
| 145 | 146 | contextLength: number; |
| 146 | 147 | maxStopWords?: number | undefined; |
| @@ -155,6 +156,7 @@ | ||
| 155 | 156 | |
| 156 | 157 | // continueProperties |
| 157 | 158 | apiKeyLocation?: string; |
| 159 | + envSecretLocations?: Record<string, string>; | |
| 158 | 160 | apiBase?: string; |
| 159 | 161 | orgScopeId?: string | null; |
| 160 | 162 | |
| @@ -172,6 +174,8 @@ | ||
| 172 | 174 | accountId?: string; |
| 173 | 175 | aiGatewaySlug?: string; |
| 174 | 176 | profile?: string | undefined; |
| 177 | + accessKeyId?: string; | |
| 178 | + secretAccessKey?: string; | |
| 175 | 179 | |
| 176 | 180 | // For IBM watsonx |
| 177 | 181 | deploymentId?: string; |
| @@ -209,6 +213,7 @@ | ||
| 209 | 213 | this.title = options.title; |
| 210 | 214 | this.uniqueId = options.uniqueId ?? "None"; |
| 211 | 215 | this.baseAgentSystemMessage = options.baseAgentSystemMessage; |
| 216 | + this.basePlanSystemMessage = options.basePlanSystemMessage; | |
| 212 | 217 | this.baseChatSystemMessage = options.baseChatSystemMessage; |
| 213 | 218 | this.contextLength = |
| 214 | 219 | options.contextLength ?? llmInfo?.contextLength ?? DEFAULT_CONTEXT_LENGTH; |
| @@ -246,6 +251,7 @@ | ||
| 246 | 251 | |
| 247 | 252 | // continueProperties |
| 248 | 253 | this.apiKeyLocation = options.apiKeyLocation; |
| 254 | + this.envSecretLocations = options.envSecretLocations; | |
| 249 | 255 | this.orgScopeId = options.orgScopeId; |
| 250 | 256 | this.apiBase = options.apiBase; |
| 251 | 257 | |
| @@ -270,6 +276,8 @@ | ||
| 270 | 276 | this.region = options.region; |
| 271 | 277 | this.projectId = options.projectId; |
| 272 | 278 | this.profile = options.profile; |
| 279 | + this.accessKeyId = options.accessKeyId; | |
| 280 | + this.secretAccessKey = options.secretAccessKey; | |
| 273 | 281 | |
| 274 | 282 | this.openaiAdapter = this.createOpenAiAdapter(); |
| 275 | 283 |
modified core/llm/llms/Bedrock.ts +11 −8
| @@ -71,11 +71,7 @@ | ||
| 71 | 71 | if (!options.apiBase) { |
| 72 | 72 | this.apiBase = `https://bedrock-runtime.${options.region}.amazonaws.com`; |
| 73 | 73 | } |
| 74 | - if (options.profile) { | |
| 75 | - this.profile = options.profile; | |
| 76 | - } else { | |
| 77 | - this.profile = "bedrock"; | |
| 78 | - } | |
| 74 | + | |
| 79 | 75 | this.requestOptions = { |
| 80 | 76 | region: options.region, |
| 81 | 77 | headers: {}, |
| @@ -609,17 +605,24 @@ | ||
| 609 | 605 | } |
| 610 | 606 | |
| 611 | 607 | 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"; | |
| 612 | 615 | try { |
| 613 | 616 | return await fromNodeProviderChain({ |
| 614 | - profile: this.profile, | |
| 617 | + profile: profile, | |
| 615 | 618 | ignoreCache: true, |
| 616 | 619 | })(); |
| 617 | 620 | } catch (e) { |
| 618 | 621 | 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`, | |
| 620 | 623 | ); |
| 621 | - return await fromNodeProviderChain()(); | |
| 622 | 624 | } |
| 625 | + return await fromNodeProviderChain()(); | |
| 623 | 626 | } |
| 624 | 627 | |
| 625 | 628 | // EMBED // |
modified core/llm/llms/index.ts +4 −4
| @@ -8,7 +8,6 @@ | ||
| 8 | 8 | LLMOptions, |
| 9 | 9 | } from "../.."; |
| 10 | 10 | import { renderTemplatedString } from "../../util/handlebars/renderTemplatedString"; |
| 11 | -import { DEFAULT_CHAT_SYSTEM_MESSAGE } from "../defaultSystemMessages"; | |
| 12 | 11 | import { BaseLLM } from "../index"; |
| 13 | 12 | import Anthropic from "./Anthropic"; |
| 14 | 13 | import Asksage from "./Asksage"; |
| @@ -141,9 +140,9 @@ | ||
| 141 | 140 | |
| 142 | 141 | let baseChatSystemMessage: string | undefined = undefined; |
| 143 | 142 | 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( | |
| 147 | 146 | Handlebars, |
| 148 | 147 | desc.systemMessage, |
| 149 | 148 | {}, |
| @@ -163,6 +162,7 @@ | ||
| 163 | 162 | cls.defaultOptions?.completionOptions?.maxTokens, |
| 164 | 163 | }, |
| 165 | 164 | baseChatSystemMessage, |
| 165 | + basePlanSystemMessage: baseChatSystemMessage, | |
| 166 | 166 | baseAgentSystemMessage: baseChatSystemMessage, |
| 167 | 167 | logger: llmLogger, |
| 168 | 168 | uniqueId, |
modified core/llm/llms/stubs/ContinueProxy.ts +17 −4
| @@ -40,6 +40,7 @@ | ||
| 40 | 40 | this.apiType = undefined; |
| 41 | 41 | this.actualApiBase = options.apiBase; |
| 42 | 42 | this.apiKeyLocation = options.apiKeyLocation; |
| 43 | + this.envSecretLocations = options.envSecretLocations; | |
| 43 | 44 | this.orgScopeId = options.orgScopeId; |
| 44 | 45 | this.onPremProxyUrl = options.onPremProxyUrl; |
| 45 | 46 | if (this.onPremProxyUrl) { |
| @@ -60,6 +61,7 @@ | ||
| 60 | 61 | protected extraBodyProperties(): Record<string, any> { |
| 61 | 62 | const continueProperties: ContinueProperties = { |
| 62 | 63 | apiKeyLocation: this.apiKeyLocation, |
| 64 | + envSecretLocations: this.envSecretLocations, | |
| 63 | 65 | apiBase: this.actualApiBase, |
| 64 | 66 | orgScopeId: this.orgScopeId ?? null, |
| 65 | 67 | env: this.configEnv, |
| @@ -70,13 +72,24 @@ | ||
| 70 | 72 | } |
| 71 | 73 | |
| 72 | 74 | getConfigurationStatus() { |
| 73 | - if (!this.apiKeyLocation) { | |
| 75 | + if (!this.apiKeyLocation && !this.envSecretLocations) { | |
| 74 | 76 | return LLMConfigurationStatuses.VALID; |
| 75 | 77 | } |
| 76 | 78 | |
| 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 | + } | |
| 80 | 93 | } |
| 81 | 94 | |
| 82 | 95 | return LLMConfigurationStatuses.VALID; |
modified core/llm/toolSupport.ts +3 −0
| @@ -19,6 +19,7 @@ | ||
| 19 | 19 | "claude-3-7", |
| 20 | 20 | "claude-3.7", |
| 21 | 21 | "claude-sonnet-4", |
| 22 | + "claude-4-sonnet", | |
| 22 | 23 | "gpt-4", |
| 23 | 24 | "o3", |
| 24 | 25 | "gemini", |
| @@ -33,6 +34,7 @@ | ||
| 33 | 34 | "claude-3-7", |
| 34 | 35 | "claude-3.7", |
| 35 | 36 | "claude-sonnet-4", |
| 37 | + "claude-4-sonnet", | |
| 36 | 38 | "claude-opus-4", |
| 37 | 39 | ].some((part) => model.toLowerCase().startsWith(part)) |
| 38 | 40 | ) { |
| @@ -95,6 +97,7 @@ | ||
| 95 | 97 | "claude-3-7-sonnet", |
| 96 | 98 | "claude-3.7-sonnet", |
| 97 | 99 | "claude-sonnet-4", |
| 100 | + "claude-4-sonnet", | |
| 98 | 101 | "claude-opus-4", |
| 99 | 102 | "nova-lite", |
| 100 | 103 | "nova-pro", |
modified core/tools/definitions/searchAndReplaceInFile.ts +5 −1
| @@ -56,7 +56,11 @@ | ||
| 56 | 56 | * Include just the changing lines, and a few surrounding lines if needed for uniqueness. |
| 57 | 57 | * Do not include long runs of unchanging lines in SEARCH/REPLACE blocks. |
| 58 | 58 | * 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: | |
| 60 | 64 | * To move code: Use two SEARCH/REPLACE blocks (one to delete from original + one to insert at new location) |
| 61 | 65 | * To delete code: Use empty REPLACE section |
| 62 | 66 |
modified core/tools/implementations/fetchUrlContent.ts +29 −1
| @@ -1,6 +1,34 @@ | ||
| 1 | 1 | import { ToolImpl } from "."; |
| 2 | 2 | import { getUrlContextItems } from "../../context/providers/URLContextProvider"; |
| 3 | 3 | |
| 4 | +const DEFAULT_FETCH_URL_CHAR_LIMIT = 20000; | |
| 5 | + | |
| 4 | 6 | 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; | |
| 6 | 34 | }; |
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 @@ | ||
| 2 | 2 | import { walkDir } from "../../indexing/walkDir"; |
| 3 | 3 | import { resolveRelativePathInDir } from "../../util/ideUtils"; |
| 4 | 4 | |
| 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 | + | |
| 5 | 17 | 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); | |
| 7 | 20 | if (!uri) { |
| 8 | 21 | 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`, | |
| 10 | 23 | ); |
| 11 | 24 | } |
| 12 | 25 | |
| 13 | 26 | const entries = await walkDir(uri, extras.ide, { |
| 14 | 27 | returnRelativeUrisPaths: true, |
| 15 | 28 | include: "both", |
| 16 | - recursive: args.recursive ?? false, | |
| 29 | + recursive: args?.recursive ?? false, | |
| 17 | 30 | }); |
| 18 | 31 | |
| 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); | |
| 23 | 33 | |
| 24 | - return [ | |
| 34 | + let content = | |
| 35 | + lines.length > 0 | |
| 36 | + ? lines.join("\n") | |
| 37 | + : `No files/folders found in ${dirPath}`; | |
| 38 | + | |
| 39 | + const contextItems = [ | |
| 25 | 40 | { |
| 26 | 41 | name: "File/folder list", |
| 27 | - description: `Files/folders in ${args.dirPath}`, | |
| 42 | + description: `Files/folders in ${dirPath}`, | |
| 28 | 43 | content, |
| 29 | 44 | }, |
| 30 | 45 | ]; |
| 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; | |
| 31 | 60 | }; |
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 "."; | |
| 1 | 2 | import { fetchSearchResults } from "../../context/providers/WebContextProvider"; |
| 2 | 3 | |
| 3 | -import { ToolImpl } from "."; | |
| 4 | +const DEFAULT_WEB_SEARCH_CHAR_LIMIT = 8000; | |
| 4 | 5 | |
| 5 | 6 | export const searchWebImpl: ToolImpl = async (args, extras) => { |
| 6 | 7 | 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; | |
| 8 | 36 | }; |
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 @@ | ||
| 1 | 1 | import { ToolImpl } from "."; |
| 2 | +import { ContextItem } from "../.."; | |
| 2 | 3 | import { getDiffsFromCache } from "../../autocomplete/snippets/gitDiffCache"; |
| 3 | 4 | |
| 5 | +export const DEFAULT_GIT_DIFF_LINE_LIMIT = 5000; | |
| 6 | + | |
| 4 | 7 | export const viewDiffImpl: ToolImpl = async (args, extras) => { |
| 5 | 8 | const diffs = await getDiffsFromCache(extras.ide); // const diffs = await extras.ide.getDiff(true); |
| 6 | 9 | // TODO includeUnstaged should be an option |
| 7 | 10 | |
| 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[] = [ | |
| 9 | 23 | { |
| 10 | 24 | name: "Diff", |
| 11 | 25 | description: "The current git diff", |
| 12 | - content: diffs.join("\n"), | |
| 26 | + content: processedDiff, | |
| 13 | 27 | }, |
| 14 | 28 | ]; |
| 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; | |
| 15 | 39 | }; |
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 @@ | ||
| 39 | 39 | params: ConfigDependentToolParams, |
| 40 | 40 | ): Tool[] => [ |
| 41 | 41 | 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, | |
| 42 | 46 | ...(params.enableExperimentalTools |
| 43 | - ? [ | |
| 44 | - searchAndReplaceInFileTool, | |
| 45 | - viewRepoMapTool, | |
| 46 | - viewSubdirectoryTool, | |
| 47 | - codebaseTool, | |
| 48 | - ] | |
| 49 | - : [editFileTool]), | |
| 47 | + ? [viewRepoMapTool, viewSubdirectoryTool, codebaseTool] | |
| 48 | + : []), | |
| 50 | 49 | ]; |
| 51 | 50 | |
| 52 | 51 | export const getToolsForIde = async (ide: IDE): Promise<Tool[]> => |
modified docs/docs/customize/deep-dives/mcp.mdx +13 −2
| @@ -110,6 +110,7 @@ | ||
| 110 | 110 | - `type` (optional): The type of the MCP server: `sse`, `stdio`, `streamable-http` |
| 111 | 111 | - `args` (optional): Arguments to pass to the command. |
| 112 | 112 | - `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. | |
| 113 | 114 | |
| 114 | 115 | ### Transport Types |
| 115 | 116 | |
| @@ -132,12 +133,22 @@ | ||
| 132 | 133 | |
| 133 | 134 | ```yaml |
| 134 | 135 | mcpServers: |
| 135 | - - name: Name | |
| 136 | + - name: SQLite Server | |
| 136 | 137 | type: stdio |
| 137 | 138 | command: npx |
| 138 | 139 | args: |
| 139 | 140 | - "@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" | |
| 141 | 152 | ``` |
| 142 | 153 | |
| 143 | 154 | #### Streamable HTTP Transport |
modified docs/docs/customize/yaml-migration.mdx +1 −0
| @@ -288,6 +288,7 @@ | ||
| 288 | 288 | - `command` (**required**): The command used to start the server. |
| 289 | 289 | - `args`: An optional array of arguments for the command. |
| 290 | 290 | - `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. | |
| 291 | 292 | |
| 292 | 293 | **Before** |
| 293 | 294 |
modified docs/docs/reference.mdx +5 −1
| @@ -384,6 +384,7 @@ | ||
| 384 | 384 | - `command` (**required**): The command used to start the server. |
| 385 | 385 | - `args`: An optional array of arguments for the command. |
| 386 | 386 | - `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. | |
| 387 | 388 | - `connectionTimeout`: An optional connection timeout number to the server in milliseconds. |
| 388 | 389 | |
| 389 | 390 | **Example:** |
| @@ -395,7 +396,10 @@ | ||
| 395 | 396 | args: |
| 396 | 397 | - mcp-server-sqlite |
| 397 | 398 | - --db-path |
| 398 | - - /Users/NAME/test.db | |
| 399 | + - ./test.db | |
| 400 | + cwd: /Users/NAME/project | |
| 401 | + env: | |
| 402 | + NODE_ENV: production | |
| 399 | 403 | ``` |
| 400 | 404 | |
| 401 | 405 | ### `data` |
modified extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/error/ContinueErrorService.kt +8 −1
| @@ -21,6 +21,7 @@ | ||
| 21 | 21 | init { |
| 22 | 22 | Sentry.init { config -> |
| 23 | 23 | config.dsn = SENTRY_DSN |
| 24 | + config.environment = recognizeEnvironment() | |
| 24 | 25 | config.isSendDefaultPii = false |
| 25 | 26 | config.setTag("ide_version", ApplicationInfo.getInstance().build.asString()) |
| 26 | 27 | config.setTag("jcef_supported", JBCefApp.isSupported().toString()) |
| @@ -45,6 +46,12 @@ | ||
| 45 | 46 | private const val PLUGIN_ID = "com.github.continuedev.continueintellijextension" |
| 46 | 47 | private const val SENTRY_DSN = |
| 47 | 48 | "https://fe99934dcdc537d84209893a3f96a196@o4505462064283648.ingest.us.sentry.io/4508184596054016" |
| 48 | - } | |
| 49 | 49 | |
| 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 | + } | |
| 50 | 57 | } |
| No newline at the end of the file |
modified extensions/vscode/config_schema.json +21 −1
| @@ -359,8 +359,18 @@ | ||
| 359 | 359 | "description": "The AWS security profile to use", |
| 360 | 360 | "type": "string" |
| 361 | 361 | }, |
| 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 | + }, | |
| 362 | 372 | "modelArn": { |
| 363 | - "title": "Profile", | |
| 373 | + "title": "Model ARN", | |
| 364 | 374 | "description": "The AWS arn for the imported model", |
| 365 | 375 | "type": "string" |
| 366 | 376 | }, |
| @@ -2903,6 +2913,16 @@ | ||
| 2903 | 2913 | "title": "Profile", |
| 2904 | 2914 | "description": "The AWS security profile to use", |
| 2905 | 2915 | "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" | |
| 2906 | 2926 | } |
| 2907 | 2927 | }, |
| 2908 | 2928 | "required": ["provider"], |
modified extensions/vscode/e2e/tests/GUI.test.ts +0 −14
| @@ -357,20 +357,6 @@ | ||
| 357 | 357 | await messageInput.sendKeys(Key.ENTER); |
| 358 | 358 | await messageInput.sendKeys(Key.ENTER); |
| 359 | 359 | |
| 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 | - | |
| 374 | 360 | // Check that the contents match what we expect (repeated back by the mock LLM) |
| 375 | 361 | await TestUtils.waitForSuccess(() => { |
| 376 | 362 | 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 @@ | ||
| 2 | 2 | "name": "continue", |
| 3 | 3 | "icon": "media/icon.png", |
| 4 | 4 | "author": "Continue Dev, Inc", |
| 5 | - "version": "1.1.57", | |
| 5 | + "version": "1.1.59", | |
| 6 | 6 | "repository": { |
| 7 | 7 | "type": "git", |
| 8 | 8 | "url": "https://github.com/continuedev/continue" |
modified extensions/vscode/src/diff/vertical/handler.ts +21 −3
| @@ -174,9 +174,12 @@ | ||
| 174 | 174 | // Clear deletion buffer |
| 175 | 175 | await this.insertDeletionBuffer(); |
| 176 | 176 | |
| 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); | |
| 180 | 183 | this.editor.revealRange(range, vscode.TextEditorRevealType.Default); |
| 181 | 184 | |
| 182 | 185 | this.options.onStatusUpdate( |
| @@ -370,6 +373,8 @@ | ||
| 370 | 373 | |
| 371 | 374 | this.editorToVerticalDiffCodeLens.set(this.fileUri, codeLensBlocks); |
| 372 | 375 | this.refreshCodeLens(); |
| 376 | + | |
| 377 | + return myersDiffs; | |
| 373 | 378 | } |
| 374 | 379 | |
| 375 | 380 | private async insertDeletionBuffer() { |
| @@ -550,4 +555,17 @@ | ||
| 550 | 555 | |
| 551 | 556 | this.refreshCodeLens(); |
| 552 | 557 | } |
| 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 | + } | |
| 553 | 571 | } |
modified extensions/vscode/src/stubs/WorkOsAuthProvider.ts +22 −22
| @@ -77,6 +77,7 @@ | ||
| 77 | 77 | { promise: Promise<string>; cancel: EventEmitter<void> } |
| 78 | 78 | >(); |
| 79 | 79 | private _refreshInterval: NodeJS.Timeout | null = null; |
| 80 | + private _isRefreshing = false; | |
| 80 | 81 | |
| 81 | 82 | private static EXPIRATION_TIME_MS = 1000 * 60 * 15; // 15 minutes |
| 82 | 83 | private static REFRESH_INTERVAL_MS = 1000 * 60 * 10; // 10 minutes |
| @@ -100,11 +101,11 @@ | ||
| 100 | 101 | this.secretStorage = new SecretStorage(context); |
| 101 | 102 | |
| 102 | 103 | // Immediately refresh any existing sessions |
| 103 | - this.refreshSessions(); | |
| 104 | + void this.refreshSessions(); | |
| 104 | 105 | |
| 105 | 106 | // Set up a regular interval to refresh tokens |
| 106 | 107 | this._refreshInterval = setInterval(() => { |
| 107 | - this.refreshSessions(); | |
| 108 | + void this.refreshSessions(); | |
| 108 | 109 | }, WorkOsAuthProvider.REFRESH_INTERVAL_MS); |
| 109 | 110 | } |
| 110 | 111 | |
| @@ -182,10 +183,18 @@ | ||
| 182 | 183 | } |
| 183 | 184 | |
| 184 | 185 | async refreshSessions() { |
| 186 | + // Prevent concurrent refresh operations | |
| 187 | + if (this._isRefreshing) { | |
| 188 | + return; | |
| 189 | + } | |
| 190 | + | |
| 185 | 191 | try { |
| 192 | + this._isRefreshing = true; | |
| 186 | 193 | await this._refreshSessions(); |
| 187 | 194 | } catch (e) { |
| 188 | 195 | console.error(`Error refreshing sessions: ${e}`); |
| 196 | + } finally { | |
| 197 | + this._isRefreshing = false; | |
| 189 | 198 | } |
| 190 | 199 | } |
| 191 | 200 | |
| @@ -198,12 +207,9 @@ | ||
| 198 | 207 | const finalSessions = []; |
| 199 | 208 | for (const session of sessions) { |
| 200 | 209 | 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 | + ); | |
| 207 | 213 | finalSessions.push({ |
| 208 | 214 | ...session, |
| 209 | 215 | accessToken: newSession.accessToken, |
| @@ -232,7 +238,6 @@ | ||
| 232 | 238 | private async _refreshSessionWithRetry( |
| 233 | 239 | refreshToken: string, |
| 234 | 240 | attempt = 1, |
| 235 | - maxAttempts = 3, | |
| 236 | 241 | baseDelay = 1000, |
| 237 | 242 | ): Promise<{ |
| 238 | 243 | accessToken: string; |
| @@ -242,30 +247,25 @@ | ||
| 242 | 247 | try { |
| 243 | 248 | return await this._refreshSession(refreshToken); |
| 244 | 249 | } 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 | |
| 246 | 251 | if ( |
| 247 | 252 | error.message?.includes("401") || |
| 248 | 253 | error.message?.includes("Invalid refresh token") || |
| 249 | - error.message?.includes("Unauthorized") || | |
| 250 | - attempt >= maxAttempts | |
| 254 | + error.message?.includes("Unauthorized") | |
| 251 | 255 | ) { |
| 252 | 256 | throw error; |
| 253 | 257 | } |
| 254 | 258 | |
| 255 | 259 | // For network errors or transient server issues, retry with backoff |
| 256 | 260 | // 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 | + ); | |
| 259 | 265 | |
| 260 | - // Schedule retry after delay | |
| 261 | 266 | return new Promise((resolve, reject) => { |
| 262 | 267 | setTimeout(() => { |
| 263 | - this._refreshSessionWithRetry( | |
| 264 | - refreshToken, | |
| 265 | - attempt + 1, | |
| 266 | - maxAttempts, | |
| 267 | - baseDelay, | |
| 268 | - ) | |
| 268 | + this._refreshSessionWithRetry(refreshToken, attempt + 1, baseDelay) | |
| 269 | 269 | .then(resolve) |
| 270 | 270 | .catch(reject); |
| 271 | 271 | }, delay); |
| @@ -360,7 +360,7 @@ | ||
| 360 | 360 | |
| 361 | 361 | return session; |
| 362 | 362 | } catch (e) { |
| 363 | - window.showErrorMessage(`Sign in failed: ${e}`); | |
| 363 | + void window.showErrorMessage(`Sign in failed: ${e}`); | |
| 364 | 364 | throw e; |
| 365 | 365 | } |
| 366 | 366 | } |
modified extensions/vscode/src/stubs/WorkOsAuthProvider.vitest.ts +2 −2
| @@ -641,7 +641,7 @@ | ||
| 641 | 641 | } |
| 642 | 642 | }); |
| 643 | 643 | |
| 644 | -it("should remove expired tokens when refresh fails", async () => { | |
| 644 | +it("should remove expired tokens when refresh fails with a 401 error", async () => { | |
| 645 | 645 | // Mock Date.now to return a time that makes tokens appear expired |
| 646 | 646 | const originalDateNow = Date.now; |
| 647 | 647 | const futureTime = Date.now() + 7200000; // 2 hours in the future |
| @@ -675,7 +675,7 @@ | ||
| 675 | 675 | global.setInterval = vi.fn().mockReturnValue(123 as any); |
| 676 | 676 | |
| 677 | 677 | // Refresh will fail with network error |
| 678 | - fetchMock.mockRejectedValueOnce(new Error("Network error")); | |
| 678 | + fetchMock.mockRejectedValueOnce(new Error("401")); | |
| 679 | 679 | |
| 680 | 680 | // Setup storage |
| 681 | 681 | 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"; | |
| 2 | 6 | import { MessageModes } from "core"; |
| 3 | 7 | |
| 4 | 8 | interface ModeIconProps { |
| @@ -13,6 +17,8 @@ | ||
| 13 | 17 | switch (mode) { |
| 14 | 18 | case "agent": |
| 15 | 19 | return <SparklesIcon className={className} />; |
| 20 | + case "plan": | |
| 21 | + return <SwatchIcon className={className} />; | |
| 16 | 22 | case "chat": |
| 17 | 23 | return <ChatBubbleLeftIcon className={className} />; |
| 18 | 24 | } |
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"; | |
| 2 | 6 | import { MessageModes } from "core"; |
| 3 | 7 | import { modelSupportsTools } from "core/llm/autodetect"; |
| 4 | 8 | import { useCallback, useEffect, useMemo } from "react"; |
| @@ -6,6 +10,7 @@ | ||
| 6 | 10 | import { selectSelectedChatModel } from "../../redux/slices/configSlice"; |
| 7 | 11 | import { setMode } from "../../redux/slices/sessionSlice"; |
| 8 | 12 | import { getFontSize, getMetaKeyLabel } from "../../util"; |
| 13 | +import { ToolTip } from "../gui/Tooltip"; | |
| 9 | 14 | import { useMainEditor } from "../mainInput/TipTapEditor"; |
| 10 | 15 | import { Listbox, ListboxButton, ListboxOption, ListboxOptions } from "../ui"; |
| 11 | 16 | import { ModeIcon } from "./ModeIcon"; |
| @@ -27,13 +32,19 @@ | ||
| 27 | 32 | if (!selectedModel) { |
| 28 | 33 | return; |
| 29 | 34 | } |
| 30 | - if (mode === "agent" && !agentModeSupported) { | |
| 35 | + if (mode !== "chat" && !agentModeSupported) { | |
| 31 | 36 | dispatch(setMode("chat")); |
| 32 | 37 | } |
| 33 | 38 | }, [mode, agentModeSupported, dispatch, selectedModel]); |
| 34 | 39 | |
| 35 | 40 | 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 | + } | |
| 37 | 48 | // Only focus main editor if another one doesn't already have focus |
| 38 | 49 | if (!document.activeElement?.classList?.contains("ProseMirror")) { |
| 39 | 50 | mainEditor?.commands.focus(); |
| @@ -74,7 +85,7 @@ | ||
| 74 | 85 | > |
| 75 | 86 | <ModeIcon mode={mode} /> |
| 76 | 87 | <span className="hidden sm:block"> |
| 77 | - {mode.charAt(0).toUpperCase() + mode.slice(1)} | |
| 88 | + {mode === "chat" ? "Chat" : mode === "agent" ? "Agent" : "Plan"} | |
| 78 | 89 | </span> |
| 79 | 90 | <ChevronDownIcon |
| 80 | 91 | className="h-2 w-2 flex-shrink-0" |
| @@ -94,7 +105,35 @@ | ||
| 94 | 105 | </div> |
| 95 | 106 | {mode === "chat" && <CheckIcon className="ml-auto h-3 w-3" />} |
| 96 | 107 | </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> | |
| 98 | 137 | <ListboxOption |
| 99 | 138 | value="agent" |
| 100 | 139 | disabled={!agentModeSupported} |
| @@ -103,9 +142,23 @@ | ||
| 103 | 142 | <div className="flex flex-row items-center gap-1.5"> |
| 104 | 143 | <ModeIcon mode="agent" /> |
| 105 | 144 | <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> | |
| 106 | 157 | </div> |
| 107 | 158 | {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 | + /> | |
| 109 | 162 | ) : ( |
| 110 | 163 | <span>(Not supported)</span> |
| 111 | 164 | )} |
modified gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/ToolbarButtonWithTooltip.tsx +9 −10
| @@ -1,6 +1,5 @@ | ||
| 1 | 1 | import { ReactNode, useMemo } from "react"; |
| 2 | -import { Tooltip } from "react-tooltip"; | |
| 3 | -import { getFontSize } from "../../../util"; | |
| 2 | +import { ToolTip } from "../../gui/Tooltip"; | |
| 4 | 3 | |
| 5 | 4 | interface ToolbarButtonWithTooltipProps { |
| 6 | 5 | onClick: () => void; |
| @@ -22,20 +21,20 @@ | ||
| 22 | 21 | |
| 23 | 22 | return ( |
| 24 | 23 | <> |
| 25 | - <button | |
| 26 | - onClick={onClick} | |
| 27 | - style={{ | |
| 28 | - fontSize: `${getFontSize() - 2}px`, | |
| 24 | + <div | |
| 25 | + onClick={(e) => { | |
| 26 | + e.stopPropagation(); | |
| 27 | + onClick(); | |
| 29 | 28 | }} |
| 30 | 29 | data-tooltip-id={tooltipId} |
| 31 | 30 | 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" | |
| 33 | 32 | > |
| 34 | 33 | {children} |
| 35 | - </button> | |
| 36 | - <Tooltip id={tooltipId} place="top"> | |
| 34 | + </div> | |
| 35 | + <ToolTip id={tooltipId} place="top"> | |
| 37 | 36 | {tooltipContent} |
| 38 | - </Tooltip> | |
| 37 | + </ToolTip> | |
| 39 | 38 | </> |
| 40 | 39 | ); |
| 41 | 40 | } |
modified gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx +0 −1
| @@ -219,7 +219,6 @@ | ||
| 219 | 219 | if (isGeneratingCodeBlock) { |
| 220 | 220 | return ( |
| 221 | 221 | <span className="text-lightgray inline-flex items-center gap-2 text-right"> |
| 222 | - {!isExpanded ? `${numLines} line${plural}` : "Generating"}{" "} | |
| 223 | 222 | <div> |
| 224 | 223 | <Spinner /> |
| 225 | 224 | </div> |
modified gui/src/components/gui/Switch.tsx +6 −2
| @@ -7,6 +7,7 @@ | ||
| 7 | 7 | text: string; |
| 8 | 8 | size?: number; |
| 9 | 9 | showIfToggled?: ReactNode; |
| 10 | + disabled?: boolean; | |
| 10 | 11 | }; |
| 11 | 12 | |
| 12 | 13 | const ToggleSwitch: React.FC<ToggleSwitchProps> = ({ |
| @@ -15,15 +16,18 @@ | ||
| 15 | 16 | text, |
| 16 | 17 | size = 16, |
| 17 | 18 | showIfToggled, |
| 19 | + disabled = false, | |
| 18 | 20 | }) => { |
| 19 | 21 | 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 | + > | |
| 21 | 25 | <span className="truncate-right">{text}</span> |
| 22 | 26 | <div className="flex flex-row items-center gap-1"> |
| 23 | 27 | {isToggled && !!showIfToggled && showIfToggled} |
| 24 | 28 | <div |
| 25 | 29 | 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} | |
| 27 | 31 | style={{ |
| 28 | 32 | height: size, |
| 29 | 33 | width: size * 2, |
modified gui/src/components/mainInput/Lump/sections/RulesSection.tsx +32 −15
| @@ -7,9 +7,8 @@ | ||
| 7 | 7 | import { RuleWithSource } from "core"; |
| 8 | 8 | import { |
| 9 | 9 | DEFAULT_AGENT_SYSTEM_MESSAGE, |
| 10 | - DEFAULT_AGENT_SYSTEM_MESSAGE_URL, | |
| 11 | 10 | DEFAULT_CHAT_SYSTEM_MESSAGE, |
| 12 | - DEFAULT_CHAT_SYSTEM_MESSAGE_URL, | |
| 11 | + DEFAULT_SYSTEM_MESSAGES_URL, | |
| 13 | 12 | } from "core/llm/defaultSystemMessages"; |
| 14 | 13 | import { useContext, useMemo } from "react"; |
| 15 | 14 | import { useAuth } from "../../../../context/Auth"; |
| @@ -52,10 +51,12 @@ | ||
| 52 | 51 | ideMessenger.post("openFile", { |
| 53 | 52 | path: rule.ruleFile, |
| 54 | 53 | }); |
| 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); | |
| 59 | 60 | } else { |
| 60 | 61 | ideMessenger.post("config/openProfile", { |
| 61 | 62 | profileId: undefined, |
| @@ -81,9 +82,11 @@ | ||
| 81 | 82 | return "Default agent system message"; |
| 82 | 83 | } else if (rule.source === "json-systemMessage") { |
| 83 | 84 | return "JSON systemMessage)"; |
| 84 | - } else if (rule.source === "model-agent-options") { | |
| 85 | + } else if (rule.source === "model-options-agent") { | |
| 85 | 86 | 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") { | |
| 87 | 90 | return "Base System Chat Message"; |
| 88 | 91 | } else { |
| 89 | 92 | return "Assistant rule"; |
| @@ -215,11 +218,24 @@ | ||
| 215 | 218 | } |
| 216 | 219 | } |
| 217 | 220 | |
| 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 | |
| 219 | 235 | if (config.selectedModelByRole.chat?.baseAgentSystemMessage) { |
| 220 | 236 | rules.unshift({ |
| 221 | 237 | rule: config.selectedModelByRole.chat?.baseAgentSystemMessage, |
| 222 | - source: "model-agent-options", | |
| 238 | + source: "model-options-agent", | |
| 223 | 239 | }); |
| 224 | 240 | } else { |
| 225 | 241 | rules.unshift({ |
| @@ -228,15 +244,16 @@ | ||
| 228 | 244 | }); |
| 229 | 245 | } |
| 230 | 246 | } else { |
| 231 | - if (config.selectedModelByRole.chat?.baseChatSystemMessage) { | |
| 247 | + // plan | |
| 248 | + if (config.selectedModelByRole.chat?.basePlanSystemMessage) { | |
| 232 | 249 | rules.unshift({ |
| 233 | - rule: config.selectedModelByRole.chat?.baseChatSystemMessage, | |
| 234 | - source: "model-chat-options", | |
| 250 | + rule: config.selectedModelByRole.chat?.basePlanSystemMessage, | |
| 251 | + source: "model-options-plan", | |
| 235 | 252 | }); |
| 236 | 253 | } else { |
| 237 | 254 | rules.unshift({ |
| 238 | - rule: DEFAULT_CHAT_SYSTEM_MESSAGE, | |
| 239 | - source: "default-chat", | |
| 255 | + rule: DEFAULT_AGENT_SYSTEM_MESSAGE, | |
| 256 | + source: "default-agent", | |
| 240 | 257 | }); |
| 241 | 258 | } |
| 242 | 259 | } |
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"; | |
| 1 | 2 | import { Tool } from "core"; |
| 2 | 3 | import { useMemo } from "react"; |
| 3 | 4 | import { useAppDispatch, useAppSelector } from "../../../../../redux/hooks"; |
| @@ -6,7 +7,26 @@ | ||
| 6 | 7 | import ToggleSwitch from "../../../../gui/Switch"; |
| 7 | 8 | import ToolPolicyItem from "./ToolPolicyItem"; |
| 8 | 9 | |
| 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 | + | |
| 9 | 28 | export const ToolPoliciesSection = () => { |
| 29 | + const mode = useAppSelector((state) => state.session.mode); | |
| 10 | 30 | const availableTools = useAppSelector((state) => state.config.config.tools); |
| 11 | 31 | const toolGroupSettings = useAppSelector( |
| 12 | 32 | (store) => store.ui.toolGroupSettings, |
| @@ -39,38 +59,56 @@ | ||
| 39 | 59 | ); |
| 40 | 60 | }, [availableTools]); |
| 41 | 61 | |
| 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 | + | |
| 42 | 71 | return ( |
| 43 | 72 | <> |
| 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} | |
| 69 | 97 | /> |
| 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> | |
| 71 | 109 | </div> |
| 72 | - </div> | |
| 73 | - ))} | |
| 110 | + ); | |
| 111 | + })} | |
| 74 | 112 | </> |
| 75 | 113 | ); |
| 76 | 114 | }; |
modified gui/src/components/mainInput/Lump/sections/tool-policies/ToolPolicyItem.tsx +21 −8
| @@ -3,6 +3,7 @@ | ||
| 3 | 3 | InformationCircleIcon, |
| 4 | 4 | } from "@heroicons/react/24/outline"; |
| 5 | 5 | import { Tool } from "core"; |
| 6 | +import { BUILT_IN_GROUP_NAME } from "core/tools/builtIn"; | |
| 6 | 7 | import { useEffect, useMemo, useState } from "react"; |
| 7 | 8 | import { useDispatch } from "react-redux"; |
| 8 | 9 | import { useAppSelector } from "../../../../../redux/hooks"; |
| @@ -16,7 +17,7 @@ | ||
| 16 | 17 | interface ToolDropdownItemProps { |
| 17 | 18 | tool: Tool; |
| 18 | 19 | duplicatesDetected: boolean; |
| 19 | - excluded: boolean; | |
| 20 | + isGroupEnabled: boolean; | |
| 20 | 21 | } |
| 21 | 22 | |
| 22 | 23 | function ToolPolicyItem(props: ToolDropdownItemProps) { |
| @@ -25,6 +26,7 @@ | ||
| 25 | 26 | (state) => state.ui.toolSettings[props.tool.function.name], |
| 26 | 27 | ); |
| 27 | 28 | const [isExpanded, setIsExpanded] = useState(false); |
| 29 | + const mode = useAppSelector((state) => state.session.mode); | |
| 28 | 30 | |
| 29 | 31 | useEffect(() => { |
| 30 | 32 | if (!policy) { |
| @@ -44,6 +46,12 @@ | ||
| 44 | 46 | |
| 45 | 47 | const fontSize = useFontSize(-2); |
| 46 | 48 | |
| 49 | + const disabled = | |
| 50 | + !props.isGroupEnabled || | |
| 51 | + (mode === "plan" && | |
| 52 | + props.tool.group === BUILT_IN_GROUP_NAME && | |
| 53 | + !props.tool.readonly); | |
| 54 | + | |
| 47 | 55 | if (!policy) { |
| 48 | 56 | return null; |
| 49 | 57 | } |
| @@ -106,16 +114,21 @@ | ||
| 106 | 114 | </span> |
| 107 | 115 | </div> |
| 108 | 116 | </div> |
| 117 | + | |
| 109 | 118 | <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"}`} | |
| 111 | 120 | 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 | + } | |
| 117 | 130 | > |
| 118 | - {props.excluded || policy === "disabled" ? ( | |
| 131 | + {disabled || policy === "disabled" ? ( | |
| 119 | 132 | <> |
| 120 | 133 | <span className="text-lightgray sm:hidden">Off</span> |
| 121 | 134 | <span className="text-lightgray hidden sm:inline-block"> |
modified gui/src/components/mainInput/belowMainInput/RulesPeek.tsx +4 −2
| @@ -19,9 +19,11 @@ | ||
| 19 | 19 | return "Default Chat"; |
| 20 | 20 | case "default-agent": |
| 21 | 21 | return "Default Agent"; |
| 22 | - case "model-chat-options": | |
| 22 | + case "model-options-chat": | |
| 23 | 23 | return "Model Chat Options"; |
| 24 | - case "model-agent-options": | |
| 24 | + case "model-options-plan": | |
| 25 | + return "Model Plan Options"; | |
| 26 | + case "model-options-agent": | |
| 25 | 27 | return "Model Agent Options"; |
| 26 | 28 | case "rules-block": |
| 27 | 29 | return "Rules Block"; |
modified gui/src/pages/config/ModelRoleSelector.tsx +19 −6
| @@ -119,19 +119,32 @@ | ||
| 119 | 119 | {[...models] |
| 120 | 120 | .sort((a, b) => a.title.localeCompare(b.title)) |
| 121 | 121 | .map((option, idx) => { |
| 122 | - const showMissingApiKeyMsg = | |
| 122 | + const isConfigInvalid = | |
| 123 | + option.configurationStatus !== | |
| 124 | + LLMConfigurationStatuses.VALID; | |
| 125 | + let invalidMessage = "(Invalid config)"; | |
| 126 | + if ( | |
| 123 | 127 | 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 | + } | |
| 125 | 138 | |
| 126 | 139 | return ( |
| 127 | 140 | <ListboxOption |
| 128 | 141 | key={idx} |
| 129 | 142 | value={option.title} |
| 130 | - disabled={showMissingApiKeyMsg} | |
| 143 | + disabled={isConfigInvalid} | |
| 131 | 144 | onMouseEnter={() => setHoveredIdx(idx)} |
| 132 | 145 | onMouseLeave={() => setHoveredIdx(null)} |
| 133 | 146 | onClick={(e: any) => |
| 134 | - handleOptionClick(showMissingApiKeyMsg, e) | |
| 147 | + handleOptionClick(isConfigInvalid, e) | |
| 135 | 148 | } |
| 136 | 149 | className="" |
| 137 | 150 | > |
| @@ -144,9 +157,9 @@ | ||
| 144 | 157 | style={{ fontSize: fontSize(-3) }} |
| 145 | 158 | > |
| 146 | 159 | {option.title} |
| 147 | - {showMissingApiKeyMsg && ( | |
| 160 | + {isConfigInvalid && ( | |
| 148 | 161 | <span className="ml-2 text-[10px] italic"> |
| 149 | - (Missing API key) | |
| 162 | + {invalidMessage} | |
| 150 | 163 | </span> |
| 151 | 164 | )} |
| 152 | 165 | </span> |
modified gui/src/pages/gui/Chat.tsx +9 −9
| @@ -33,6 +33,7 @@ | ||
| 33 | 33 | selectCurrentToolCallApplyState, |
| 34 | 34 | } from "../../redux/selectors/selectCurrentToolCall"; |
| 35 | 35 | import { |
| 36 | + cancelToolCall, | |
| 36 | 37 | newSession, |
| 37 | 38 | updateToolCallOutput, |
| 38 | 39 | } from "../../redux/slices/sessionSlice"; |
| @@ -108,7 +109,6 @@ | ||
| 108 | 109 | (state) => state.config.config.ui?.showChatScrollbar, |
| 109 | 110 | ); |
| 110 | 111 | const codeToEdit = useAppSelector((state) => state.editModeState.codeToEdit); |
| 111 | - const toolCallState = useAppSelector(selectCurrentToolCall); | |
| 112 | 112 | const mode = useAppSelector((store) => store.session.mode); |
| 113 | 113 | const isInEdit = useAppSelector((store) => store.session.isInEdit); |
| 114 | 114 | |
| @@ -147,6 +147,7 @@ | ||
| 147 | 147 | isStreaming, |
| 148 | 148 | ); |
| 149 | 149 | |
| 150 | + const currentToolCallState = useAppSelector(selectCurrentToolCall); | |
| 150 | 151 | const currentToolCallApplyState = useAppSelector( |
| 151 | 152 | selectCurrentToolCallApplyState, |
| 152 | 153 | ); |
| @@ -158,20 +159,19 @@ | ||
| 158 | 159 | index?: number, |
| 159 | 160 | editorToClearOnSend?: Editor, |
| 160 | 161 | ) => { |
| 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 | + }), | |
| 164 | 167 | ); |
| 165 | 168 | } |
| 166 | 169 | if ( |
| 167 | 170 | currentToolCallApplyState && |
| 168 | 171 | currentToolCallApplyState.status !== "closed" |
| 169 | 172 | ) { |
| 170 | - return console.error( | |
| 171 | - "Cannot submit message while awaiting tool call apply", | |
| 172 | - ); | |
| 173 | + ideMessenger.post("rejectDiff", currentToolCallApplyState); | |
| 173 | 174 | } |
| 174 | - | |
| 175 | 175 | const model = isInEdit |
| 176 | 176 | ? (selectedModels?.edit ?? selectedModels?.chat) |
| 177 | 177 | : selectedModels?.chat; |
| @@ -241,7 +241,7 @@ | ||
| 241 | 241 | mode, |
| 242 | 242 | isInEdit, |
| 243 | 243 | codeToEdit, |
| 244 | - toolCallState, | |
| 244 | + currentToolCallState, | |
| 245 | 245 | currentToolCallApplyState, |
| 246 | 246 | ], |
| 247 | 247 | ); |
modified gui/src/pages/gui/ToolCallDiv/EditFile.tsx +2 −3
| @@ -6,15 +6,14 @@ | ||
| 6 | 6 | changes: string; |
| 7 | 7 | historyIndex: number; |
| 8 | 8 | toolCallId?: string; |
| 9 | - expandCodeblocks?: boolean; | |
| 10 | 9 | }; |
| 11 | 10 | |
| 12 | 11 | export function EditFile(props: EditToolCallProps) { |
| 13 | - if (!props.relativeFilePath || !props.changes) { | |
| 12 | + if (!props.relativeFilePath) { | |
| 14 | 13 | return null; |
| 15 | 14 | } |
| 16 | 15 | |
| 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\`\`\``; | |
| 18 | 17 | |
| 19 | 18 | return ( |
| 20 | 19 | <StyledMarkdownPreview |
modified gui/src/pages/gui/ToolCallDiv/FunctionSpecificToolCallDiv.tsx +0 −1
| @@ -36,7 +36,6 @@ | ||
| 36 | 36 | case BuiltInToolNames.SearchAndReplaceInFile: |
| 37 | 37 | return ( |
| 38 | 38 | <EditFile |
| 39 | - expandCodeblocks | |
| 40 | 39 | relativeFilePath={args.filepath ?? ""} |
| 41 | 40 | changes={args.diff ?? ""} |
| 42 | 41 | toolCallId={toolCall.id} |
modified gui/src/pages/gui/ToolCallDiv/ToolCall.tsx +1 −1
| @@ -27,7 +27,7 @@ | ||
| 27 | 27 | |
| 28 | 28 | return ( |
| 29 | 29 | <> |
| 30 | - <div className="flex flex-col justify-center p-4 pb-0"> | |
| 30 | + <div className="flex flex-col justify-center p-4 pb-1"> | |
| 31 | 31 | <div className="mb-4 flex flex-col"> |
| 32 | 32 | <div className="flex flex-row items-center justify-between gap-1.5"> |
| 33 | 33 | <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 @@ | ||
| 1 | 1 | 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"; | |
| 4 | 3 | |
| 5 | 4 | interface ArgsToggleIconProps { |
| 6 | 5 | isShowing: boolean; |
| @@ -13,26 +12,15 @@ | ||
| 13 | 12 | setIsShowing, |
| 14 | 13 | toolCallId, |
| 15 | 14 | }: ArgsToggleIconProps) => { |
| 16 | - const argsTooltipId = useMemo(() => { | |
| 17 | - return "args-hover-" + toolCallId; | |
| 18 | - }, [toolCallId]); | |
| 19 | - | |
| 20 | 15 | 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> | |
| 36 | 24 | ); |
| 37 | 25 | }; |
| 38 | 26 |
modified gui/src/pages/gui/ToolCallDiv/ToolTruncateHistoryIcon.tsx +3 −1
| @@ -19,9 +19,11 @@ | ||
| 19 | 19 | }, [history]); |
| 20 | 20 | const dispatch = useAppDispatch(); |
| 21 | 21 | const { mainEditor } = useMainEditor(); |
| 22 | + | |
| 22 | 23 | if (historyIndex === lastMessageIndex) { |
| 23 | 24 | return null; |
| 24 | 25 | } |
| 26 | + | |
| 25 | 27 | return ( |
| 26 | 28 | <ToolbarButtonWithTooltip |
| 27 | 29 | tooltipContent={isStreaming ? "" : "Trim chat to this message"} |
| @@ -38,7 +40,7 @@ | ||
| 38 | 40 | }} |
| 39 | 41 | > |
| 40 | 42 | <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" : ""}`} | |
| 42 | 44 | /> |
| 43 | 45 | </ToolbarButtonWithTooltip> |
| 44 | 46 | ); |
modified gui/src/pages/gui/ToolCallDiv/index.tsx +16 −0
| @@ -85,6 +85,22 @@ | ||
| 85 | 85 | ); |
| 86 | 86 | } |
| 87 | 87 | |
| 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 | + | |
| 88 | 104 | return ( |
| 89 | 105 | <ToolCallDisplay |
| 90 | 106 | icon={getStatusIcon(props.toolCallState.status)} |
modified gui/src/pages/gui/chat-tests/Chat.test.tsx +16 −4
| @@ -15,7 +15,7 @@ | ||
| 15 | 15 | |
| 16 | 16 | test("should be able to toggle modes", async () => { |
| 17 | 17 | await renderWithProviders(<Chat />); |
| 18 | - await getElementByText("Chat"); | |
| 18 | + await getElementByText("Agent"); | |
| 19 | 19 | |
| 20 | 20 | // Simulate cmd+. keyboard shortcut to toggle modes |
| 21 | 21 | act(() => { |
| @@ -27,8 +27,8 @@ | ||
| 27 | 27 | ); |
| 28 | 28 | }); |
| 29 | 29 | |
| 30 | - // Check that it switched to Agent mode | |
| 31 | - await getElementByText("Agent"); | |
| 30 | + // Check that it switched to Chat mode | |
| 31 | + await getElementByText("Chat"); | |
| 32 | 32 | |
| 33 | 33 | act(() => { |
| 34 | 34 | document.dispatchEvent( |
| @@ -39,7 +39,19 @@ | ||
| 39 | 39 | ); |
| 40 | 40 | }); |
| 41 | 41 | |
| 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"); | |
| 43 | 55 | }); |
| 44 | 56 | |
| 45 | 57 | test("should send a message and receive a response", async () => { |
modified gui/src/redux/selectors/selectActiveTools.ts +9 −4
| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | import { createSelector } from "@reduxjs/toolkit"; |
| 2 | 2 | import { Tool } from "core"; |
| 3 | +import { BUILT_IN_GROUP_NAME } from "core/tools/builtIn"; | |
| 3 | 4 | import { RootState } from "../store"; |
| 4 | 5 | |
| 5 | 6 | export const selectActiveTools = createSelector( |
| @@ -12,14 +13,18 @@ | ||
| 12 | 13 | (mode, tools, policies, groupPolicies): Tool[] => { |
| 13 | 14 | if (mode === "chat") { |
| 14 | 15 | return []; |
| 15 | - } else if (mode === "agent") { | |
| 16 | - return tools.filter( | |
| 16 | + } else { | |
| 17 | + const enabledTools = tools.filter( | |
| 17 | 18 | (tool) => |
| 18 | 19 | policies[tool.function.name] !== "disabled" && |
| 19 | 20 | groupPolicies[tool.group] !== "exclude", |
| 20 | 21 | ); |
| 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; | |
| 23 | 28 | } |
| 24 | 29 | }, |
| 25 | 30 | ); |
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 @@ | ||
| 8 | 8 | import { JSONContent } from "@tiptap/react"; |
| 9 | 9 | import { |
| 10 | 10 | ApplyState, |
| 11 | + AssistantChatMessage, | |
| 11 | 12 | ChatHistoryItem, |
| 12 | 13 | ChatMessage, |
| 13 | 14 | ContextItem, |
| @@ -18,6 +19,7 @@ | ||
| 18 | 19 | RuleWithSource, |
| 19 | 20 | Session, |
| 20 | 21 | SessionMetadata, |
| 22 | + ThinkingChatMessage, | |
| 21 | 23 | Tool, |
| 22 | 24 | } from "core"; |
| 23 | 25 | import { NEW_SESSION_TITLE } from "core/util/constants"; |
| @@ -72,7 +74,7 @@ | ||
| 72 | 74 | id: uuidv4(), |
| 73 | 75 | streamAborter: new AbortController(), |
| 74 | 76 | symbols: {}, |
| 75 | - mode: "chat", | |
| 77 | + mode: "agent", | |
| 76 | 78 | isInEdit: false, |
| 77 | 79 | codeBlockApplyStates: { |
| 78 | 80 | states: [], |
| @@ -330,12 +332,10 @@ | ||
| 330 | 332 | streamUpdate: (state, action: PayloadAction<ChatMessage[]>) => { |
| 331 | 333 | if (state.history.length) { |
| 332 | 334 | 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; | |
| 335 | 337 | |
| 336 | 338 | if (message.role === "thinking" && message.redactedThinking) { |
| 337 | - console.log("add redacted_thinking blocks"); | |
| 338 | - | |
| 339 | 339 | state.history.push({ |
| 340 | 340 | message: { |
| 341 | 341 | role: "thinking", |
| @@ -348,6 +348,74 @@ | ||
| 348 | 348 | continue; |
| 349 | 349 | } |
| 350 | 350 | |
| 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 | |
| 351 | 419 | if ( |
| 352 | 420 | lastMessage.role !== message.role || |
| 353 | 421 | // This is for when a tool call comes immediately before/after tool call |
| @@ -363,7 +431,7 @@ | ||
| 363 | 431 | const historyItem: ChatHistoryItemWithMessageId = { |
| 364 | 432 | message: { |
| 365 | 433 | ...message, |
| 366 | - content: renderChatMessage(message), | |
| 434 | + content: "", | |
| 367 | 435 | id: uuidv4(), |
| 368 | 436 | }, |
| 369 | 437 | contextItems: [], |
| @@ -376,51 +444,62 @@ | ||
| 376 | 444 | ); |
| 377 | 445 | } |
| 378 | 446 | 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 | |
| 392 | 473 | ) { |
| 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) { | |
| 400 | 474 | 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; | |
| 405 | 475 | } |
| 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; | |
| 409 | 484 | } |
| 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]; | |
| 423 | 485 | } |
| 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]; | |
| 424 | 503 | } |
| 425 | 504 | } |
| 426 | 505 | } |
modified gui/src/redux/thunks/edit.ts +35 −38
| @@ -75,52 +75,49 @@ | ||
| 75 | 75 | |
| 76 | 76 | export const exitEdit = createAsyncThunk< |
| 77 | 77 | void, |
| 78 | - { goToMode?: MessageModes; openNewSession?: boolean }, | |
| 78 | + { openNewSession?: boolean }, | |
| 79 | 79 | 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; | |
| 88 | 86 | |
| 89 | - if (!isInEdit) { | |
| 90 | - return; | |
| 91 | - } | |
| 87 | + if (!isInEdit) { | |
| 88 | + return; | |
| 89 | + } | |
| 92 | 90 | |
| 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 | + } | |
| 98 | 96 | |
| 99 | - extra.ideMessenger.post("edit/clearDecorations", undefined); | |
| 97 | + extra.ideMessenger.post("edit/clearDecorations", undefined); | |
| 100 | 98 | |
| 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)); | |
| 104 | 102 | |
| 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 | + } | |
| 110 | 108 | |
| 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 | + } | |
| 120 | 118 | |
| 121 | - dispatch(setMode(goToMode ?? state.editModeState.returnToMode)); | |
| 122 | - }, | |
| 123 | -); | |
| 119 | + dispatch(setMode(state.editModeState.returnToMode)); | |
| 120 | +}); | |
| 124 | 121 | |
| 125 | 122 | export const enterEdit = createAsyncThunk< |
| 126 | 123 | void, |
modified gui/src/redux/thunks/streamNormalInput.ts +61 −18
| @@ -1,7 +1,8 @@ | ||
| 1 | 1 | import { createAsyncThunk, unwrapResult } from "@reduxjs/toolkit"; |
| 2 | -import { LLMFullCompletionOptions } from "core"; | |
| 2 | +import { LLMFullCompletionOptions, ModelDescription, Tool } from "core"; | |
| 3 | 3 | import { modelSupportsTools } from "core/llm/autodetect"; |
| 4 | 4 | import { ToCoreProtocol } from "core/protocol"; |
| 5 | +import { BuiltInToolNames } from "core/tools/builtIn"; | |
| 5 | 6 | import { selectActiveTools } from "../selectors/selectActiveTools"; |
| 6 | 7 | import { selectCurrentToolCall } from "../selectors/selectCurrentToolCall"; |
| 7 | 8 | import { selectSelectedChatModel } from "../slices/configSlice"; |
| @@ -21,6 +22,49 @@ | ||
| 21 | 22 | } from "../util/constructMessages"; |
| 22 | 23 | import { callCurrentTool } from "./callCurrentTool"; |
| 23 | 24 | |
| 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 | + | |
| 24 | 68 | export const streamNormalInput = createAsyncThunk< |
| 25 | 69 | void, |
| 26 | 70 | { |
| @@ -37,8 +81,9 @@ | ||
| 37 | 81 | throw new Error("No chat model selected"); |
| 38 | 82 | } |
| 39 | 83 | |
| 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); | |
| 42 | 87 | const toolsSupported = modelSupportsTools(selectedChatModel); |
| 43 | 88 | |
| 44 | 89 | // Construct completion options |
| @@ -115,21 +160,19 @@ | ||
| 115 | 160 | dispatch(addPromptCompletionPair([next.value])); |
| 116 | 161 | |
| 117 | 162 | 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 | + }); | |
| 133 | 176 | // else if (state.session.mode === "edit") { |
| 134 | 177 | // extra.ideMessenger.post("devdata/log", { |
| 135 | 178 | // name: "editInteraction", |
modified gui/src/redux/thunks/streamThunkWrapper.tsx +1 −1
| @@ -17,7 +17,7 @@ | ||
| 17 | 17 | try { |
| 18 | 18 | await runStream(); |
| 19 | 19 | const state = getState(); |
| 20 | - if (state.session.mode === "chat" || state.session.mode === "agent") { | |
| 20 | + if (!state.session.isInEdit) { | |
| 21 | 21 | await dispatch( |
| 22 | 22 | saveCurrentSession({ |
| 23 | 23 | openNewSession: false, |
modified gui/src/redux/util/constructMessages.test.ts +13 −1
| @@ -12,6 +12,7 @@ | ||
| 12 | 12 | import { |
| 13 | 13 | DEFAULT_AGENT_SYSTEM_MESSAGE, |
| 14 | 14 | DEFAULT_CHAT_SYSTEM_MESSAGE, |
| 15 | + DEFAULT_PLAN_SYSTEM_MESSAGE, | |
| 15 | 16 | } from "core/llm/defaultSystemMessages"; |
| 16 | 17 | import { renderChatMessage } from "core/util/messageContent"; |
| 17 | 18 | import { beforeEach, describe, expect, test, vi } from "vitest"; |
| @@ -90,8 +91,9 @@ | ||
| 90 | 91 | |
| 91 | 92 | test("getBaseSystemMessage should return the correct system message based on mode", () => { |
| 92 | 93 | const mockModel = { |
| 93 | - baseAgentSystemMessage: "Custom Agent System Message", | |
| 94 | 94 | baseChatSystemMessage: "Custom Chat System Message", |
| 95 | + basePlanSystemMessage: "Custom Plan System Message", | |
| 96 | + baseAgentSystemMessage: "Custom Agent System Message", | |
| 95 | 97 | } as ModelDescription; |
| 96 | 98 | |
| 97 | 99 | // Test agent mode with custom message |
| @@ -99,6 +101,11 @@ | ||
| 99 | 101 | "Custom Agent System Message", |
| 100 | 102 | ); |
| 101 | 103 | |
| 104 | + // Test plan mode with custom message | |
| 105 | + expect(getBaseSystemMessage("plan", mockModel)).toBe( | |
| 106 | + "Custom Plan System Message", | |
| 107 | + ); | |
| 108 | + | |
| 102 | 109 | // Test chat mode with custom message |
| 103 | 110 | expect(getBaseSystemMessage("chat", mockModel)).toBe( |
| 104 | 111 | "Custom Chat System Message", |
| @@ -109,6 +116,11 @@ | ||
| 109 | 116 | DEFAULT_AGENT_SYSTEM_MESSAGE, |
| 110 | 117 | ); |
| 111 | 118 | |
| 119 | + // Test agent mode with default message | |
| 120 | + expect(getBaseSystemMessage("plan", {} as ModelDescription)).toBe( | |
| 121 | + DEFAULT_PLAN_SYSTEM_MESSAGE, | |
| 122 | + ); | |
| 123 | + | |
| 112 | 124 | // Test chat mode with default message |
| 113 | 125 | expect(getBaseSystemMessage("chat", {} as ModelDescription)).toBe( |
| 114 | 126 | DEFAULT_CHAT_SYSTEM_MESSAGE, |
modified gui/src/redux/util/constructMessages.ts +3 −0
| @@ -11,6 +11,7 @@ | ||
| 11 | 11 | import { |
| 12 | 12 | DEFAULT_AGENT_SYSTEM_MESSAGE, |
| 13 | 13 | DEFAULT_CHAT_SYSTEM_MESSAGE, |
| 14 | + DEFAULT_PLAN_SYSTEM_MESSAGE, | |
| 14 | 15 | } from "core/llm/defaultSystemMessages"; |
| 15 | 16 | import { chatMessageIsEmpty } from "core/llm/messages"; |
| 16 | 17 | import { getSystemMessageWithRules } from "core/llm/rules/getSystemMessageWithRules"; |
| @@ -167,6 +168,8 @@ | ||
| 167 | 168 | ): string { |
| 168 | 169 | if (messageMode === "agent") { |
| 169 | 170 | return model.baseAgentSystemMessage ?? DEFAULT_AGENT_SYSTEM_MESSAGE; |
| 171 | + } else if (messageMode === "plan") { | |
| 172 | + return model.basePlanSystemMessage ?? DEFAULT_PLAN_SYSTEM_MESSAGE; | |
| 170 | 173 | } else { |
| 171 | 174 | return model.baseChatSystemMessage ?? DEFAULT_CHAT_SYSTEM_MESSAGE; |
| 172 | 175 | } |
modified packages/config-yaml/package.json +1 −1
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "name": "@continuedev/config-yaml", |
| 3 | - "version": "1.0.95", | |
| 3 | + "version": "1.0.96", | |
| 4 | 4 | "description": "", |
| 5 | 5 | "main": "dist/index.js", |
| 6 | 6 | "types": "dist/index.d.ts", |
modified packages/config-yaml/src/load/clientRender.ts +24 −2
| @@ -133,7 +133,27 @@ | ||
| 133 | 133 | const apiKeyLocation = getUnrenderedSecretLocation( |
| 134 | 134 | config.models[i]?.apiKey, |
| 135 | 135 | ); |
| 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) { | |
| 137 | 157 | config.models[i] = { |
| 138 | 158 | ...config.models[i], |
| 139 | 159 | name: config.models[i]?.name ?? "", |
| @@ -143,7 +163,8 @@ | ||
| 143 | 163 | config.models[i]?.provider ?? "", |
| 144 | 164 | config.models[i]?.model ?? "", |
| 145 | 165 | ), |
| 146 | - apiKeyLocation: encodeSecretLocation(apiKeyLocation), | |
| 166 | + apiKeyLocation: encodedApiKeyLocation, | |
| 167 | + envSecretLocations: encodedEnvSecretLocations, | |
| 147 | 168 | orgScopeId, |
| 148 | 169 | onPremProxyUrl, |
| 149 | 170 | apiKey: undefined, |
| @@ -158,6 +179,7 @@ | ||
| 158 | 179 | /** The additional properties that are added to the otherwise OpenAI-compatible body when requesting a Continue proxy */ |
| 159 | 180 | export const continuePropertiesSchema = z.object({ |
| 160 | 181 | apiKeyLocation: z.string().optional(), |
| 182 | + envSecretLocations: z.record(z.string(), z.string()).optional(), | |
| 161 | 183 | apiBase: z.string().optional(), |
| 162 | 184 | orgScopeId: z.string().nullable(), |
| 163 | 185 | env: z.record(z.string(), z.any()).optional(), |
modified packages/config-yaml/src/load/unroll.ts +181 −84
| @@ -24,7 +24,7 @@ | ||
| 24 | 24 | packageIdentifierToShorthandSlug, |
| 25 | 25 | useProxyForUnrenderedSecrets, |
| 26 | 26 | } from "./clientRender.js"; |
| 27 | -import { getBlockType } from "./getBlockType.js"; | |
| 27 | +import { BlockType, getBlockType } from "./getBlockType.js"; | |
| 28 | 28 | |
| 29 | 29 | export function parseConfigYaml(configYaml: string): ConfigYaml { |
| 30 | 30 | try { |
| @@ -322,12 +322,15 @@ | ||
| 322 | 322 | "name" | "version" | "rules" | "schema" | "metadata" |
| 323 | 323 | >)[] = ["models", "context", "data", "mcpServers", "prompts", "docs"]; |
| 324 | 324 | |
| 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 | + } | |
| 329 | 330 | |
| 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) => { | |
| 331 | 334 | // "uses/with" block |
| 332 | 335 | if ("uses" in unrolledBlock) { |
| 333 | 336 | try { |
| @@ -338,10 +341,13 @@ | ||
| 338 | 341 | ); |
| 339 | 342 | const block = blockConfigYaml[section]?.[0]; |
| 340 | 343 | 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 | + }; | |
| 344 | 349 | } |
| 350 | + return { index, block: null, error: null }; | |
| 345 | 351 | } catch (err) { |
| 346 | 352 | let msg = ""; |
| 347 | 353 | if ( |
| @@ -353,99 +359,190 @@ | ||
| 353 | 359 | msg = `${(err as Error).message}.\n> ${JSON.stringify(unrolledBlock.uses)}`; |
| 354 | 360 | } |
| 355 | 361 | |
| 356 | - errors.push({ | |
| 357 | - fatal: false, | |
| 358 | - message: msg, | |
| 359 | - }); | |
| 360 | - | |
| 361 | 362 | console.error( |
| 362 | 363 | `Failed to unroll block ${JSON.stringify(unrolledBlock.uses)}: ${(err as Error).message}`, |
| 363 | 364 | ); |
| 364 | - sectionBlocks.push(null); | |
| 365 | + | |
| 366 | + return { | |
| 367 | + index, | |
| 368 | + block: null, | |
| 369 | + error: { | |
| 370 | + fatal: false, | |
| 371 | + message: msg, | |
| 372 | + }, | |
| 373 | + }; | |
| 365 | 374 | } |
| 366 | 375 | } else { |
| 367 | 376 | // Normal block |
| 368 | - sectionBlocks.push(unrolledBlock); | |
| 377 | + return { index, block: unrolledBlock, error: null }; | |
| 369 | 378 | } |
| 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[] = []; | |
| 371 | 387 | |
| 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; | |
| 373 | 393 | } |
| 374 | - } | |
| 375 | 394 | |
| 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); | |
| 392 | 439 | } |
| 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; | |
| 403 | 441 | } |
| 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); | |
| 405 | 522 | } |
| 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 | + } | |
| 406 | 533 | |
| 407 | - unrolledAssistant.rules = rules; | |
| 534 | + // Assign rules result | |
| 535 | + if (rulesResult.rules) { | |
| 536 | + unrolledAssistant.rules = rulesResult.rules; | |
| 408 | 537 | } |
| 409 | 538 | |
| 410 | 539 | // 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] = []; | |
| 448 | 544 | } |
| 545 | + unrolledAssistant[key]?.push(...((resolvedBlock[blockType] ?? []) as any)); | |
| 449 | 546 | } |
| 450 | 547 | |
| 451 | 548 | const configResult: ConfigResult<AssistantUnrolled> = { |
modified packages/config-yaml/src/schemas/index.ts +1 −0
| @@ -22,6 +22,7 @@ | ||
| 22 | 22 | faviconUrl: z.string().optional(), |
| 23 | 23 | args: z.array(z.string()).optional(), |
| 24 | 24 | env: z.record(z.string()).optional(), |
| 25 | + cwd: z.string().optional(), | |
| 25 | 26 | connectionTimeout: z.number().gt(0).optional(), |
| 26 | 27 | requestOptions: requestOptionsSchema.optional(), |
| 27 | 28 | }); |
modified packages/config-yaml/src/schemas/models.ts +5 −2
| @@ -85,6 +85,7 @@ | ||
| 85 | 85 | export const chatOptionsSchema = z.object({ |
| 86 | 86 | baseSystemMessage: z.string().optional(), |
| 87 | 87 | baseAgentSystemMessage: z.string().optional(), |
| 88 | + basePlanSystemMessage: z.string().optional(), | |
| 88 | 89 | }); |
| 89 | 90 | export type ChatOptions = z.infer<typeof chatOptionsSchema>; |
| 90 | 91 | |
| @@ -154,7 +155,8 @@ | ||
| 154 | 155 | z.object({ |
| 155 | 156 | ...baseModelFields, |
| 156 | 157 | provider: z.literal("continue-proxy"), |
| 157 | - apiKeyLocation: z.string(), | |
| 158 | + apiKeyLocation: z.string().optional(), | |
| 159 | + envSecretLocations: z.record(z.string(), z.string()).optional(), | |
| 158 | 160 | orgScopeId: z.string().nullable(), |
| 159 | 161 | onPremProxyUrl: z.string().nullable(), |
| 160 | 162 | }), |
| @@ -169,7 +171,8 @@ | ||
| 169 | 171 | .object({ |
| 170 | 172 | ...baseModelFields, |
| 171 | 173 | provider: z.literal("continue-proxy"), |
| 172 | - apiKeyLocation: z.string(), | |
| 174 | + apiKeyLocation: z.string().optional(), | |
| 175 | + envSecretLocations: z.record(z.string(), z.string()).optional(), | |
| 173 | 176 | }) |
| 174 | 177 | .partial(), |
| 175 | 178 | z |
modified packages/continue-sdk/typescript/src/createOpenAIClient.ts +3 −2
| @@ -71,14 +71,15 @@ | ||
| 71 | 71 | ); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if (!("apiKeyLocation" in modelConfig)) { | |
| 74 | + if (!("apiKeyLocation" in modelConfig) && !("envSecretLocations" in modelConfig)) { | |
| 75 | 75 | throw new Error( |
| 76 | - `Model ${modelName} does not have an apiKeyLocation defined`, | |
| 76 | + `Model ${modelName} does not have an apiKeyLocation or envSecretLocations defined`, | |
| 77 | 77 | ); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | const continueProperties: ContinueProperties = { |
| 81 | 81 | apiKeyLocation: modelConfig.apiKeyLocation, |
| 82 | + envSecretLocations: modelConfig.envSecretLocations, | |
| 82 | 83 | orgScopeId: organizationId ?? null, |
| 83 | 84 | }; |
| 84 | 85 |
modified packages/openai-adapters/package-lock.json +1718 −193
| @@ -9,6 +9,8 @@ | ||
| 9 | 9 | "version": "1.0.44", |
| 10 | 10 | "license": "Apache-2.0", |
| 11 | 11 | "dependencies": { |
| 12 | + "@aws-sdk/client-bedrock-runtime": "^3.842.0", | |
| 13 | + "@aws-sdk/credential-providers": "^3.840.0", | |
| 12 | 14 | "@continuedev/config-types": "^1.0.5", |
| 13 | 15 | "@continuedev/config-yaml": "^1.0.51", |
| 14 | 16 | "@continuedev/fetch": "^1.0.15", |
| @@ -42,6 +44,827 @@ | ||
| 42 | 44 | "node": ">=6.0.0" |
| 43 | 45 | } |
| 44 | 46 | }, |
| 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 | + }, | |
| 45 | 868 | "node_modules/@babel/code-frame": { |
| 46 | 869 | "version": "7.24.7", |
| 47 | 870 | "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", |
| @@ -761,265 +1584,915 @@ | ||
| 761 | 1584 | "jest-get-type": "^29.6.3" |
| 762 | 1585 | }, |
| 763 | 1586 | "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" | |
| 765 | 2276 | } |
| 766 | 2277 | }, |
| 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", | |
| 773 | 2283 | "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" | |
| 780 | 2285 | }, |
| 781 | 2286 | "engines": { |
| 782 | - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" | |
| 2287 | + "node": ">=18.0.0" | |
| 783 | 2288 | } |
| 784 | 2289 | }, |
| 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", | |
| 791 | 2295 | "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" | |
| 796 | 2299 | }, |
| 797 | 2300 | "engines": { |
| 798 | - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" | |
| 2301 | + "node": ">=18.0.0" | |
| 799 | 2302 | } |
| 800 | 2303 | }, |
| 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", | |
| 807 | 2309 | "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" | |
| 832 | 2313 | }, |
| 833 | 2314 | "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" | |
| 843 | 2316 | } |
| 844 | 2317 | }, |
| 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", | |
| 850 | 2323 | "dependencies": { |
| 851 | - "@sinclair/typebox": "^0.27.8" | |
| 2324 | + "tslib": "^2.6.2" | |
| 852 | 2325 | }, |
| 853 | 2326 | "engines": { |
| 854 | - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" | |
| 2327 | + "node": ">=18.0.0" | |
| 855 | 2328 | } |
| 856 | 2329 | }, |
| 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", | |
| 863 | 2335 | "dependencies": { |
| 864 | - "@jridgewell/trace-mapping": "^0.3.18", | |
| 865 | - "callsites": "^3.0.0", | |
| 866 | - "graceful-fs": "^4.2.9" | |
| 2336 | + "tslib": "^2.6.2" | |
| 867 | 2337 | }, |
| 868 | 2338 | "engines": { |
| 869 | - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" | |
| 2339 | + "node": ">=18.0.0" | |
| 870 | 2340 | } |
| 871 | 2341 | }, |
| 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", | |
| 878 | 2347 | "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" | |
| 883 | 2350 | }, |
| 884 | 2351 | "engines": { |
| 885 | - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" | |
| 2352 | + "node": ">=18.0.0" | |
| 886 | 2353 | } |
| 887 | 2354 | }, |
| 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", | |
| 894 | 2360 | "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" | |
| 899 | 2362 | }, |
| 900 | 2363 | "engines": { |
| 901 | - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" | |
| 2364 | + "node": ">=18.0.0" | |
| 902 | 2365 | } |
| 903 | 2366 | }, |
| 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", | |
| 910 | 2372 | "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" | |
| 926 | 2378 | }, |
| 927 | 2379 | "engines": { |
| 928 | - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" | |
| 2380 | + "node": ">=18.0.0" | |
| 929 | 2381 | } |
| 930 | 2382 | }, |
| 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", | |
| 936 | 2388 | "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" | |
| 943 | 2396 | }, |
| 944 | 2397 | "engines": { |
| 945 | - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" | |
| 2398 | + "node": ">=18.0.0" | |
| 946 | 2399 | } |
| 947 | 2400 | }, |
| 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", | |
| 954 | 2406 | "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" | |
| 958 | 2410 | }, |
| 959 | 2411 | "engines": { |
| 960 | - "node": ">=6.0.0" | |
| 2412 | + "node": ">=18.0.0" | |
| 961 | 2413 | } |
| 962 | 2414 | }, |
| 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 | + }, | |
| 968 | 2423 | "engines": { |
| 969 | - "node": ">=6.0.0" | |
| 2424 | + "node": ">=18.0.0" | |
| 970 | 2425 | } |
| 971 | 2426 | }, |
| 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 | + }, | |
| 978 | 2436 | "engines": { |
| 979 | - "node": ">=6.0.0" | |
| 2437 | + "node": ">=18.0.0" | |
| 980 | 2438 | } |
| 981 | 2439 | }, |
| 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", | |
| 994 | 2445 | "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" | |
| 997 | 2452 | } |
| 998 | 2453 | }, |
| 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 | + } | |
| 1004 | 2472 | }, |
| 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", | |
| 1011 | 2478 | "dependencies": { |
| 1012 | - "type-detect": "4.0.8" | |
| 2479 | + "tslib": "^2.6.2" | |
| 2480 | + }, | |
| 2481 | + "engines": { | |
| 2482 | + "node": ">=18.0.0" | |
| 1013 | 2483 | } |
| 1014 | 2484 | }, |
| 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", | |
| 1021 | 2490 | "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" | |
| 1023 | 2496 | } |
| 1024 | 2497 | }, |
| 1025 | 2498 | "node_modules/@tsconfig/node10": { |
| @@ -1173,6 +2646,12 @@ | ||
| 1173 | 2646 | "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", |
| 1174 | 2647 | "dev": true |
| 1175 | 2648 | }, |
| 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 | + }, | |
| 1176 | 2655 | "node_modules/@types/yargs": { |
| 1177 | 2656 | "version": "17.0.32", |
| 1178 | 2657 | "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", |
| @@ -1446,6 +2925,12 @@ | ||
| 1446 | 2925 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", |
| 1447 | 2926 | "dev": true |
| 1448 | 2927 | }, |
| 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 | + }, | |
| 1449 | 2934 | "node_modules/brace-expansion": { |
| 1450 | 2935 | "version": "1.1.11", |
| 1451 | 2936 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", |
| @@ -2004,6 +3489,28 @@ | ||
| 2004 | 3489 | "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", |
| 2005 | 3490 | "dev": true |
| 2006 | 3491 | }, |
| 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 | + }, | |
| 2007 | 3514 | "node_modules/fb-watchman": { |
| 2008 | 3515 | "version": "2.0.2", |
| 2009 | 3516 | "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", |
| @@ -3974,6 +5481,18 @@ | ||
| 3974 | 5481 | "url": "https://github.com/sponsors/sindresorhus" |
| 3975 | 5482 | } |
| 3976 | 5483 | }, |
| 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 | + }, | |
| 3977 | 5496 | "node_modules/supports-color": { |
| 3978 | 5497 | "version": "7.2.0", |
| 3979 | 5498 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", |
| @@ -4151,6 +5670,12 @@ | ||
| 4151 | 5670 | } |
| 4152 | 5671 | } |
| 4153 | 5672 | }, |
| 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 | + }, | |
| 4154 | 5679 | "node_modules/type-detect": { |
| 4155 | 5680 | "version": "4.0.8", |
| 4156 | 5681 | "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 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "name": "@continuedev/openai-adapters", |
| 3 | - "version": "1.0.44", | |
| 3 | + "version": "1.0.45", | |
| 4 | 4 | "description": "", |
| 5 | 5 | "main": "dist/index.js", |
| 6 | 6 | "types": "dist/index.d.ts", |
| @@ -12,6 +12,8 @@ | ||
| 12 | 12 | "author": "Nate Sesti and Ty Dunn", |
| 13 | 13 | "license": "Apache-2.0", |
| 14 | 14 | "dependencies": { |
| 15 | + "@aws-sdk/client-bedrock-runtime": "^3.842.0", | |
| 16 | + "@aws-sdk/credential-providers": "^3.840.0", | |
| 15 | 17 | "@continuedev/config-types": "^1.0.5", |
| 16 | 18 | "@continuedev/config-yaml": "^1.0.51", |
| 17 | 19 | "@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 @@ | ||
| 2 | 2 | import { z } from "zod"; |
| 3 | 3 | import { AnthropicApi } from "./apis/Anthropic.js"; |
| 4 | 4 | import { AzureApi } from "./apis/Azure.js"; |
| 5 | +import { BedrockApi } from "./apis/Bedrock.js"; | |
| 5 | 6 | import { CohereApi } from "./apis/Cohere.js"; |
| 6 | 7 | import { DeepSeekApi } from "./apis/DeepSeek.js"; |
| 7 | 8 | import { GeminiApi } from "./apis/Gemini.js"; |
| @@ -34,6 +35,8 @@ | ||
| 34 | 35 | return new OpenAIApi(config); |
| 35 | 36 | case "azure": |
| 36 | 37 | return new AzureApi(config); |
| 38 | + case "bedrock": | |
| 39 | + return new BedrockApi(config); | |
| 37 | 40 | case "cohere": |
| 38 | 41 | return new CohereApi(config); |
| 39 | 42 | case "anthropic": |
modified packages/openai-adapters/src/types.ts +16 −0
| @@ -71,6 +71,21 @@ | ||
| 71 | 71 | }); |
| 72 | 72 | export type DeepseekConfig = z.infer<typeof DeepseekConfigSchema>; |
| 73 | 73 | |
| 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 | + | |
| 74 | 89 | export const LlamastackConfigSchema = OpenAIConfigSchema.extend({ |
| 75 | 90 | provider: z.literal("llamastack"), |
| 76 | 91 | }); |
| @@ -142,6 +157,7 @@ | ||
| 142 | 157 | // Discriminated union |
| 143 | 158 | export const LLMConfigSchema = z.discriminatedUnion("provider", [ |
| 144 | 159 | OpenAIConfigSchema, |
| 160 | + BedrockConfigSchema, | |
| 145 | 161 | MoonshotConfigSchema, |
| 146 | 162 | DeepseekConfigSchema, |
| 147 | 163 | CohereConfigSchema, |