@frontmcp/utils 1.11.1 → 1.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/crypto/encrypted-blob.mjs +1 -1
- package/browser/crypto/hmac-signing.mjs +1 -3
- package/browser/crypto/key-persistence/factory.mjs +2 -2
- package/browser/crypto/key-persistence/key-persistence.mjs +2 -2
- package/browser/crypto/pkce/pkce.mjs +1 -1
- package/browser/crypto/secret-persistence/persistence.mjs +3 -3
- package/browser/storage/adapters/filesystem.mjs +3 -3
- package/browser/storage/adapters/indexeddb.mjs +1 -1
- package/browser/storage/adapters/localstorage.mjs +2 -2
- package/browser/storage/encrypted-typed-storage.mjs +1 -1
- package/crypto/key-persistence/key-persistence.d.ts +1 -1
- package/esm/index.mjs +1 -1
- package/index.js +1 -1
- package/llm/llm-tool-handlers.d.ts +1 -1
- package/package.json +3 -3
- package/storage/adapters/filesystem.d.ts +1 -1
- package/storage/adapters/indexeddb.d.ts +1 -1
- package/storage/adapters/localstorage.d.ts +1 -1
- package/storage/encrypted-typed-storage.d.ts +2 -2
- package/storage/typed-storage.d.ts +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// libs/utils/src/crypto/encrypted-blob.ts
|
|
2
|
-
import {
|
|
2
|
+
import { base64urlDecode, base64urlEncode, decryptAesGcm, encryptAesGcm, randomBytes } from "./index.mjs";
|
|
3
3
|
var textEncoder = new TextEncoder();
|
|
4
4
|
var textDecoder = new TextDecoder();
|
|
5
5
|
var EncryptedBlobError = class extends Error {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
// libs/utils/src/crypto/hmac-signing.ts
|
|
2
|
-
import { hmacSha256 } from "./index.mjs";
|
|
3
|
-
import { base64urlEncode, base64urlDecode } from "./index.mjs";
|
|
4
|
-
import { timingSafeEqual } from "./index.mjs";
|
|
2
|
+
import { base64urlDecode, base64urlEncode, hmacSha256, timingSafeEqual } from "./index.mjs";
|
|
5
3
|
function computeSignature(data, secret) {
|
|
6
4
|
const encoder = new TextEncoder();
|
|
7
5
|
const keyBytes = encoder.encode(secret);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// libs/utils/src/crypto/key-persistence/factory.ts
|
|
2
|
-
import { isNode, isBrowser } from "../runtime.mjs";
|
|
3
2
|
import { cryptoProvider } from "../browser.mjs";
|
|
4
3
|
import { MemoryStorageAdapter } from "../../storage/adapters/memory.mjs";
|
|
4
|
+
import { base64urlDecode, base64urlEncode, randomBytes } from "../index.mjs";
|
|
5
|
+
import { isBrowser, isNode } from "../runtime.mjs";
|
|
5
6
|
import { KeyPersistence } from "./key-persistence.mjs";
|
|
6
|
-
import { randomBytes, base64urlEncode, base64urlDecode } from "../index.mjs";
|
|
7
7
|
var DEFAULT_BASE_DIR = ".frontmcp/keys";
|
|
8
8
|
var LS_HKDF_IKM = new TextEncoder().encode("frontmcp:localstorage:v1");
|
|
9
9
|
var INSTALL_SALT_KEY = "__frontmcp_internal__:install_salt";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// libs/utils/src/crypto/key-persistence/key-persistence.ts
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { base64urlEncode, randomBytes } from "../index.mjs";
|
|
3
|
+
import { isAsymmetricKeyData, isSecretKeyData, validateKeyData } from "./schemas.mjs";
|
|
4
4
|
var KeyPersistence = class {
|
|
5
5
|
storage;
|
|
6
6
|
cache = /* @__PURE__ */ new Map();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// libs/utils/src/crypto/pkce/pkce.ts
|
|
2
|
-
import { randomBytes, sha256
|
|
2
|
+
import { base64urlEncode, randomBytes, sha256 } from "../index.mjs";
|
|
3
3
|
var MIN_CODE_VERIFIER_LENGTH = 43;
|
|
4
4
|
var MAX_CODE_VERIFIER_LENGTH = 128;
|
|
5
5
|
var DEFAULT_CODE_VERIFIER_LENGTH = 64;
|
|
@@ -9,10 +9,10 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
// libs/utils/src/crypto/secret-persistence/persistence.ts
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { getCwd, getEnv } from "../../env/browser-env.mjs";
|
|
13
|
+
import { base64urlEncode, randomBytes } from "../index.mjs";
|
|
14
|
+
import { mkdir, readFile, rename, unlink, writeFile } from "../../fs/index.mjs";
|
|
14
15
|
import { validateSecretData } from "./schema.mjs";
|
|
15
|
-
import { getEnv, getCwd } from "../../env/browser-env.mjs";
|
|
16
16
|
function getPath() {
|
|
17
17
|
return __require("path");
|
|
18
18
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// libs/utils/src/storage/adapters/filesystem.ts
|
|
2
|
-
import {
|
|
2
|
+
import { bytesToHex, randomBytes } from "../../crypto/index.mjs";
|
|
3
|
+
import { ensureDir, fileExists, mkdir, readdir, readJSON, rename, unlink, writeFile } from "../../fs/index.mjs";
|
|
3
4
|
import { StorageOperationError } from "../errors.mjs";
|
|
4
5
|
import { globToRegex } from "../utils/pattern.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { randomBytes, bytesToHex } from "../../crypto/index.mjs";
|
|
6
|
+
import { BaseStorageAdapter } from "./base.mjs";
|
|
7
7
|
var FileSystemStorageAdapter = class extends BaseStorageAdapter {
|
|
8
8
|
backendName = "filesystem";
|
|
9
9
|
baseDir;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// libs/utils/src/storage/adapters/indexeddb.ts
|
|
2
|
-
import { BaseStorageAdapter } from "./base.mjs";
|
|
3
2
|
import { matchesPattern } from "../utils/pattern.mjs";
|
|
3
|
+
import { BaseStorageAdapter } from "./base.mjs";
|
|
4
4
|
var IndexedDBStorageAdapter = class extends BaseStorageAdapter {
|
|
5
5
|
backendName = "indexeddb";
|
|
6
6
|
dbName;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// libs/utils/src/storage/adapters/localstorage.ts
|
|
2
|
-
import {
|
|
3
|
-
import { encryptAesGcm, decryptAesGcm, randomBytes, base64urlEncode, base64urlDecode } from "../../crypto/index.mjs";
|
|
2
|
+
import { base64urlDecode, base64urlEncode, decryptAesGcm, encryptAesGcm, randomBytes } from "../../crypto/index.mjs";
|
|
4
3
|
import { matchesPattern } from "../utils/pattern.mjs";
|
|
4
|
+
import { BaseStorageAdapter } from "./base.mjs";
|
|
5
5
|
var LocalStorageAdapter = class extends BaseStorageAdapter {
|
|
6
6
|
backendName = "localstorage";
|
|
7
7
|
prefix;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// libs/utils/src/storage/encrypted-typed-storage.ts
|
|
2
|
-
import {
|
|
2
|
+
import { base64urlDecode, base64urlEncode, decryptAesGcm, encryptAesGcm, hkdfSha256, randomBytes } from "../crypto/index.mjs";
|
|
3
3
|
import { EncryptedStorageError } from "./errors.mjs";
|
|
4
4
|
var textEncoder = new TextEncoder();
|
|
5
5
|
var textDecoder = new TextDecoder();
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module @frontmcp/utils/key-persistence
|
|
8
8
|
*/
|
|
9
9
|
import type { StorageAdapter } from '../../storage/types';
|
|
10
|
-
import type { AnyKeyData,
|
|
10
|
+
import type { AnyKeyData, AsymmetricKeyData, CreateSecretOptions, KeyPersistenceOptions, SecretKeyData } from './types';
|
|
11
11
|
/**
|
|
12
12
|
* KeyPersistence provides a unified API for storing and retrieving
|
|
13
13
|
* cryptographic keys with any storage backend.
|