Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replacing Node's Buffer with npm's buffer package. #1306

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"@radix-ui/react-tooltip": "^1.1.6",
"@tabler/icons-react": "^2.14.0",
"axios": "^1.3.4",
"buffer": "^6.0.3",
"chrono-node": "^2.7.7",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
Expand Down
1 change: 1 addition & 0 deletions src/LLMProviders/brevilabsClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { turnOffPlus, turnOnPlus } from "@/plusUtils";
import { getSettings } from "@/settings/model";
import { extractErrorDetail } from "@/utils";
import { Notice } from "obsidian";
import { Buffer } from "buffer";

export interface BrocaResponse {
response: {
Expand Down
1 change: 1 addition & 0 deletions src/components/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { FileParserManager } from "@/tools/FileParserManager";
import { err2String, formatDateTime } from "@/utils";
import { Notice, TFile } from "obsidian";
import React, { useCallback, useContext, useEffect, useRef, useState } from "react";
import { Buffer } from "buffer";

interface ChatProps {
sharedState: SharedState;
Expand Down
1 change: 1 addition & 0 deletions src/encryptionService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ global.TextDecoder = TextDecoder as any;
import { encryptAllKeys, getDecryptedKey, getEncryptedKey } from "@/encryptionService";
import { type CopilotSettings } from "@/settings/model";
import { Platform } from "obsidian";
import { Buffer } from "buffer";

// Mock window.btoa and window.atob for base64 encoding/decoding
global.btoa = jest.fn().mockImplementation((str) => Buffer.from(str).toString("base64"));
Expand Down
1 change: 1 addition & 0 deletions src/encryptionService.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { type CopilotSettings } from "@/settings/model";
import { Platform } from "obsidian";
import { Buffer } from "buffer";

// @ts-ignore
let safeStorageInternal: Electron.SafeStorage | null = null;
Expand Down
1 change: 1 addition & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { BaseChain, RetrievalQAChain } from "langchain/chains";
import moment from "moment";
import { MarkdownView, Notice, TFile, Vault, requestUrl } from "obsidian";
import { CustomModel } from "./aiParams";
import { Buffer } from "buffer";

// Add custom error type at the top of the file
interface APIError extends Error {
Expand Down