@frontmcp/plugin-remember 1.9.0 → 1.9.1-rc.1
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/esm/index.mjs
CHANGED
|
@@ -654,8 +654,9 @@ var RememberAccessor = class {
|
|
|
654
654
|
}
|
|
655
655
|
/** The entry stored under `storageKey`, if readable and unexpired; an expired one is deleted. */
|
|
656
656
|
async readEntry(storageKey, scope) {
|
|
657
|
-
const
|
|
658
|
-
if (!
|
|
657
|
+
const stored = await this.store.getValue(storageKey);
|
|
658
|
+
if (!stored) return void 0;
|
|
659
|
+
const raw = typeof stored === "string" ? stored : JSON.stringify(stored);
|
|
659
660
|
const entry = this.encryptionEnabled ? await deserializeAndDecrypt(raw, this.getKeySource(scope)) : this.parseEntry(raw);
|
|
660
661
|
if (!entry) return void 0;
|
|
661
662
|
if (entry.expiresAt && Date.now() > entry.expiresAt) {
|
|
@@ -913,7 +914,7 @@ var RememberRedisProvider = class {
|
|
|
913
914
|
}
|
|
914
915
|
}
|
|
915
916
|
const fullKey = this.keyPrefix + key;
|
|
916
|
-
const strValue =
|
|
917
|
+
const strValue = JSON.stringify(value);
|
|
917
918
|
if (ttlSeconds !== void 0 && ttlSeconds > 0) {
|
|
918
919
|
await this.client.set(fullKey, strValue, "EX", ttlSeconds);
|
|
919
920
|
} else {
|
|
@@ -928,7 +929,7 @@ var RememberRedisProvider = class {
|
|
|
928
929
|
*/
|
|
929
930
|
async setIfAbsent(key, value, ttlSeconds) {
|
|
930
931
|
const fullKey = this.keyPrefix + key;
|
|
931
|
-
const strValue =
|
|
932
|
+
const strValue = JSON.stringify(value);
|
|
932
933
|
const result = ttlSeconds !== void 0 && ttlSeconds > 0 ? await this.client.set(fullKey, strValue, "EX", ttlSeconds, "NX") : await this.client.set(fullKey, strValue, "NX");
|
|
933
934
|
return result === "OK";
|
|
934
935
|
}
|
|
@@ -1005,8 +1006,11 @@ RememberRedisProvider = __decorateClass([
|
|
|
1005
1006
|
|
|
1006
1007
|
// plugins/plugin-remember/src/providers/remember-vercel-kv.provider.ts
|
|
1007
1008
|
import { Provider as Provider4, ProviderScope as ProviderScope4 } from "@frontmcp/sdk";
|
|
1009
|
+
import { getEnv } from "@frontmcp/utils";
|
|
1008
1010
|
var RememberVercelKvProvider = class {
|
|
1009
|
-
|
|
1011
|
+
createClient;
|
|
1012
|
+
connection;
|
|
1013
|
+
client;
|
|
1010
1014
|
keyPrefix;
|
|
1011
1015
|
defaultTTL;
|
|
1012
1016
|
constructor(options = {}) {
|
|
@@ -1018,17 +1022,23 @@ var RememberVercelKvProvider = class {
|
|
|
1018
1022
|
`RememberVercelKvProvider: Both 'url' and 'token' must be provided together, or neither. Received: url=${hasUrl ? "provided" : "missing"}, token=${hasToken ? "provided" : "missing"}`
|
|
1019
1023
|
);
|
|
1020
1024
|
}
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
url: options.url,
|
|
1024
|
-
token: options.token
|
|
1025
|
-
});
|
|
1026
|
-
} else {
|
|
1027
|
-
this.kv = vercelKv.kv;
|
|
1028
|
-
}
|
|
1025
|
+
this.createClient = vercelKv.createClient;
|
|
1026
|
+
this.connection = { url: options.url, token: options.token };
|
|
1029
1027
|
this.keyPrefix = options.keyPrefix ?? "remember:";
|
|
1030
1028
|
this.defaultTTL = options.defaultTTL;
|
|
1031
1029
|
}
|
|
1030
|
+
/** Built on first use, like the module's `kv` singleton, which would JSON-parse what it reads. */
|
|
1031
|
+
get kv() {
|
|
1032
|
+
if (!this.client) {
|
|
1033
|
+
const url = this.connection.url ?? getEnv("KV_REST_API_URL");
|
|
1034
|
+
const token = this.connection.token ?? getEnv("KV_REST_API_TOKEN");
|
|
1035
|
+
if (!url || !token) {
|
|
1036
|
+
throw new Error("RememberVercelKvProvider: pass url and token, or set KV_REST_API_URL and KV_REST_API_TOKEN.");
|
|
1037
|
+
}
|
|
1038
|
+
this.client = this.createClient({ url, token, automaticDeserialization: false });
|
|
1039
|
+
}
|
|
1040
|
+
return this.client;
|
|
1041
|
+
}
|
|
1032
1042
|
prefixKey(key) {
|
|
1033
1043
|
return `${this.keyPrefix}${key}`;
|
|
1034
1044
|
}
|
|
@@ -1037,7 +1047,7 @@ var RememberVercelKvProvider = class {
|
|
|
1037
1047
|
*/
|
|
1038
1048
|
async setValue(key, value, ttlSeconds) {
|
|
1039
1049
|
const fullKey = this.prefixKey(key);
|
|
1040
|
-
const strValue =
|
|
1050
|
+
const strValue = JSON.stringify(value);
|
|
1041
1051
|
const ttl = ttlSeconds ?? this.defaultTTL;
|
|
1042
1052
|
if (ttl && ttl > 0) {
|
|
1043
1053
|
await this.kv.set(fullKey, strValue, { ex: ttl });
|
|
@@ -1053,7 +1063,7 @@ var RememberVercelKvProvider = class {
|
|
|
1053
1063
|
*/
|
|
1054
1064
|
async setIfAbsent(key, value, ttlSeconds) {
|
|
1055
1065
|
const fullKey = this.prefixKey(key);
|
|
1056
|
-
const strValue =
|
|
1066
|
+
const strValue = JSON.stringify(value);
|
|
1057
1067
|
const ttl = ttlSeconds ?? this.defaultTTL;
|
|
1058
1068
|
const result = ttl && ttl > 0 ? await this.kv.set(fullKey, strValue, { nx: true, ex: ttl }) : await this.kv.set(fullKey, strValue, { nx: true });
|
|
1059
1069
|
return result === "OK";
|
|
@@ -1064,15 +1074,12 @@ var RememberVercelKvProvider = class {
|
|
|
1064
1074
|
async getValue(key, defaultValue) {
|
|
1065
1075
|
const fullKey = this.prefixKey(key);
|
|
1066
1076
|
const raw = await this.kv.get(fullKey);
|
|
1067
|
-
if (raw === null
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
return raw;
|
|
1073
|
-
}
|
|
1077
|
+
if (raw === null) return defaultValue;
|
|
1078
|
+
try {
|
|
1079
|
+
return JSON.parse(raw);
|
|
1080
|
+
} catch {
|
|
1081
|
+
return raw;
|
|
1074
1082
|
}
|
|
1075
|
-
return raw;
|
|
1076
1083
|
}
|
|
1077
1084
|
/**
|
|
1078
1085
|
* Delete a key.
|
|
@@ -1106,7 +1113,7 @@ var RememberVercelKvProvider = class {
|
|
|
1106
1113
|
for (const key of keys) {
|
|
1107
1114
|
result.push(key.slice(this.keyPrefix.length));
|
|
1108
1115
|
}
|
|
1109
|
-
} while (cursor !== 0);
|
|
1116
|
+
} while (String(cursor) !== "0");
|
|
1110
1117
|
} catch {
|
|
1111
1118
|
try {
|
|
1112
1119
|
const keys = await this.kv.keys(searchPattern);
|
package/esm/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontmcp/plugin-remember",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.1-rc.1",
|
|
4
4
|
"description": "Remember plugin for FrontMCP - encrypted session memory with approval system for secure tool authorization",
|
|
5
5
|
"author": "AgentFront <info@agentfront.dev>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@frontmcp/sdk": "1.9.
|
|
53
|
-
"@frontmcp/utils": "1.9.
|
|
52
|
+
"@frontmcp/sdk": "1.9.1-rc.1",
|
|
53
|
+
"@frontmcp/utils": "1.9.1-rc.1",
|
|
54
54
|
"ioredis": "^5.8.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@frontmcp/lazy-zod": "1.9.
|
|
57
|
+
"@frontmcp/lazy-zod": "1.9.1-rc.1",
|
|
58
58
|
"@vercel/kv": "^2.0.0 || ^3.0.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependenciesMeta": {
|
package/index.js
CHANGED
|
@@ -673,8 +673,9 @@ var RememberAccessor = class {
|
|
|
673
673
|
}
|
|
674
674
|
/** The entry stored under `storageKey`, if readable and unexpired; an expired one is deleted. */
|
|
675
675
|
async readEntry(storageKey, scope) {
|
|
676
|
-
const
|
|
677
|
-
if (!
|
|
676
|
+
const stored = await this.store.getValue(storageKey);
|
|
677
|
+
if (!stored) return void 0;
|
|
678
|
+
const raw = typeof stored === "string" ? stored : JSON.stringify(stored);
|
|
678
679
|
const entry = this.encryptionEnabled ? await deserializeAndDecrypt(raw, this.getKeySource(scope)) : this.parseEntry(raw);
|
|
679
680
|
if (!entry) return void 0;
|
|
680
681
|
if (entry.expiresAt && Date.now() > entry.expiresAt) {
|
|
@@ -932,7 +933,7 @@ var RememberRedisProvider = class {
|
|
|
932
933
|
}
|
|
933
934
|
}
|
|
934
935
|
const fullKey = this.keyPrefix + key;
|
|
935
|
-
const strValue =
|
|
936
|
+
const strValue = JSON.stringify(value);
|
|
936
937
|
if (ttlSeconds !== void 0 && ttlSeconds > 0) {
|
|
937
938
|
await this.client.set(fullKey, strValue, "EX", ttlSeconds);
|
|
938
939
|
} else {
|
|
@@ -947,7 +948,7 @@ var RememberRedisProvider = class {
|
|
|
947
948
|
*/
|
|
948
949
|
async setIfAbsent(key, value, ttlSeconds) {
|
|
949
950
|
const fullKey = this.keyPrefix + key;
|
|
950
|
-
const strValue =
|
|
951
|
+
const strValue = JSON.stringify(value);
|
|
951
952
|
const result = ttlSeconds !== void 0 && ttlSeconds > 0 ? await this.client.set(fullKey, strValue, "EX", ttlSeconds, "NX") : await this.client.set(fullKey, strValue, "NX");
|
|
952
953
|
return result === "OK";
|
|
953
954
|
}
|
|
@@ -1024,8 +1025,11 @@ RememberRedisProvider = __decorateClass([
|
|
|
1024
1025
|
|
|
1025
1026
|
// plugins/plugin-remember/src/providers/remember-vercel-kv.provider.ts
|
|
1026
1027
|
var import_sdk5 = require("@frontmcp/sdk");
|
|
1028
|
+
var import_utils3 = require("@frontmcp/utils");
|
|
1027
1029
|
var RememberVercelKvProvider = class {
|
|
1028
|
-
|
|
1030
|
+
createClient;
|
|
1031
|
+
connection;
|
|
1032
|
+
client;
|
|
1029
1033
|
keyPrefix;
|
|
1030
1034
|
defaultTTL;
|
|
1031
1035
|
constructor(options = {}) {
|
|
@@ -1037,17 +1041,23 @@ var RememberVercelKvProvider = class {
|
|
|
1037
1041
|
`RememberVercelKvProvider: Both 'url' and 'token' must be provided together, or neither. Received: url=${hasUrl ? "provided" : "missing"}, token=${hasToken ? "provided" : "missing"}`
|
|
1038
1042
|
);
|
|
1039
1043
|
}
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
url: options.url,
|
|
1043
|
-
token: options.token
|
|
1044
|
-
});
|
|
1045
|
-
} else {
|
|
1046
|
-
this.kv = vercelKv.kv;
|
|
1047
|
-
}
|
|
1044
|
+
this.createClient = vercelKv.createClient;
|
|
1045
|
+
this.connection = { url: options.url, token: options.token };
|
|
1048
1046
|
this.keyPrefix = options.keyPrefix ?? "remember:";
|
|
1049
1047
|
this.defaultTTL = options.defaultTTL;
|
|
1050
1048
|
}
|
|
1049
|
+
/** Built on first use, like the module's `kv` singleton, which would JSON-parse what it reads. */
|
|
1050
|
+
get kv() {
|
|
1051
|
+
if (!this.client) {
|
|
1052
|
+
const url = this.connection.url ?? (0, import_utils3.getEnv)("KV_REST_API_URL");
|
|
1053
|
+
const token = this.connection.token ?? (0, import_utils3.getEnv)("KV_REST_API_TOKEN");
|
|
1054
|
+
if (!url || !token) {
|
|
1055
|
+
throw new Error("RememberVercelKvProvider: pass url and token, or set KV_REST_API_URL and KV_REST_API_TOKEN.");
|
|
1056
|
+
}
|
|
1057
|
+
this.client = this.createClient({ url, token, automaticDeserialization: false });
|
|
1058
|
+
}
|
|
1059
|
+
return this.client;
|
|
1060
|
+
}
|
|
1051
1061
|
prefixKey(key) {
|
|
1052
1062
|
return `${this.keyPrefix}${key}`;
|
|
1053
1063
|
}
|
|
@@ -1056,7 +1066,7 @@ var RememberVercelKvProvider = class {
|
|
|
1056
1066
|
*/
|
|
1057
1067
|
async setValue(key, value, ttlSeconds) {
|
|
1058
1068
|
const fullKey = this.prefixKey(key);
|
|
1059
|
-
const strValue =
|
|
1069
|
+
const strValue = JSON.stringify(value);
|
|
1060
1070
|
const ttl = ttlSeconds ?? this.defaultTTL;
|
|
1061
1071
|
if (ttl && ttl > 0) {
|
|
1062
1072
|
await this.kv.set(fullKey, strValue, { ex: ttl });
|
|
@@ -1072,7 +1082,7 @@ var RememberVercelKvProvider = class {
|
|
|
1072
1082
|
*/
|
|
1073
1083
|
async setIfAbsent(key, value, ttlSeconds) {
|
|
1074
1084
|
const fullKey = this.prefixKey(key);
|
|
1075
|
-
const strValue =
|
|
1085
|
+
const strValue = JSON.stringify(value);
|
|
1076
1086
|
const ttl = ttlSeconds ?? this.defaultTTL;
|
|
1077
1087
|
const result = ttl && ttl > 0 ? await this.kv.set(fullKey, strValue, { nx: true, ex: ttl }) : await this.kv.set(fullKey, strValue, { nx: true });
|
|
1078
1088
|
return result === "OK";
|
|
@@ -1083,15 +1093,12 @@ var RememberVercelKvProvider = class {
|
|
|
1083
1093
|
async getValue(key, defaultValue) {
|
|
1084
1094
|
const fullKey = this.prefixKey(key);
|
|
1085
1095
|
const raw = await this.kv.get(fullKey);
|
|
1086
|
-
if (raw === null
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
return raw;
|
|
1092
|
-
}
|
|
1096
|
+
if (raw === null) return defaultValue;
|
|
1097
|
+
try {
|
|
1098
|
+
return JSON.parse(raw);
|
|
1099
|
+
} catch {
|
|
1100
|
+
return raw;
|
|
1093
1101
|
}
|
|
1094
|
-
return raw;
|
|
1095
1102
|
}
|
|
1096
1103
|
/**
|
|
1097
1104
|
* Delete a key.
|
|
@@ -1125,7 +1132,7 @@ var RememberVercelKvProvider = class {
|
|
|
1125
1132
|
for (const key of keys) {
|
|
1126
1133
|
result.push(key.slice(this.keyPrefix.length));
|
|
1127
1134
|
}
|
|
1128
|
-
} while (cursor !== 0);
|
|
1135
|
+
} while (String(cursor) !== "0");
|
|
1129
1136
|
} catch {
|
|
1130
1137
|
try {
|
|
1131
1138
|
const keys = await this.kv.keys(searchPattern);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontmcp/plugin-remember",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.1-rc.1",
|
|
4
4
|
"description": "Remember plugin for FrontMCP - encrypted session memory with approval system for secure tool authorization",
|
|
5
5
|
"author": "AgentFront <info@agentfront.dev>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@frontmcp/sdk": "1.9.
|
|
53
|
-
"@frontmcp/utils": "1.9.
|
|
52
|
+
"@frontmcp/sdk": "1.9.1-rc.1",
|
|
53
|
+
"@frontmcp/utils": "1.9.1-rc.1",
|
|
54
54
|
"ioredis": "^5.8.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@frontmcp/lazy-zod": "1.9.
|
|
57
|
+
"@frontmcp/lazy-zod": "1.9.1-rc.1",
|
|
58
58
|
"@vercel/kv": "^2.0.0 || ^3.0.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependenciesMeta": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remember-accessor.provider.d.ts","sourceRoot":"","sources":["../../src/providers/remember-accessor.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,eAAe,EACpB,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AAKvB,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AA8BzE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAKa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAyB;IAC/C,O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GAAE;QAAE,KAAK,CAAC,EAAE,aAAa,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IA8B/G;;;;;OAKG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,GAAG,SAAS,CAS/B;IAMD;;OAEG;IACH,OAAO,CAAC,eAAe;IAIvB;;;;;;;;OAQG;IACH,OAAO,KAAK,iBAAiB,GAQ5B;IAED;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,sBAAsB;IAmB9B;;;;;OAKG;IACH,OAAO,KAAK,QAAQ,GAEnB;IAED;;;;;;;OAOG;IACH,OAAO,CAAC,gBAAgB;IA4BxB;;OAEG;IACH,OAAO,CAAC,YAAY;IAYpB,iGAAiG;YACnF,SAAS;
|
|
1
|
+
{"version":3,"file":"remember-accessor.provider.d.ts","sourceRoot":"","sources":["../../src/providers/remember-accessor.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,eAAe,EACpB,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AAKvB,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AA8BzE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAKa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAyB;IAC/C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAkB;IACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwB;IAC/C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAU;gBAG1C,KAAK,EAAE,sBAAsB,EAC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MAAM,GAAG,SAAS,CAS/B;IAMD;;OAEG;IACH,OAAO,CAAC,eAAe;IAIvB;;;;;;;;OAQG;IACH,OAAO,KAAK,iBAAiB,GAQ5B;IAED;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,sBAAsB;IAmB9B;;;;;OAKG;IACH,OAAO,KAAK,QAAQ,GAEnB;IAED;;;;;;;OAOG;IACH,OAAO,CAAC,gBAAgB;IA4BxB;;OAEG;IACH,OAAO,CAAC,YAAY;IAYpB,iGAAiG;YACnF,SAAS;IAkBvB;;OAEG;IACH,OAAO,CAAC,UAAU;CAOnB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,sBAAsB,EAC7B,GAAG,EAAE,eAAe,EACpB,MAAM,EAAE,qBAAqB,EAC7B,MAAM,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,GAC9C,gBAAgB,CAElB"}
|
|
@@ -17,10 +17,14 @@ export interface RememberVercelKvProviderOptions {
|
|
|
17
17
|
* Provides serverless-compatible, edge-ready storage.
|
|
18
18
|
*/
|
|
19
19
|
export default class RememberVercelKvProvider implements RememberStoreInterface {
|
|
20
|
-
private
|
|
20
|
+
private readonly createClient;
|
|
21
|
+
private readonly connection;
|
|
22
|
+
private client?;
|
|
21
23
|
private readonly keyPrefix;
|
|
22
24
|
private readonly defaultTTL?;
|
|
23
25
|
constructor(options?: RememberVercelKvProviderOptions);
|
|
26
|
+
/** Built on first use, like the module's `kv` singleton, which would JSON-parse what it reads. */
|
|
27
|
+
private get kv();
|
|
24
28
|
private prefixKey;
|
|
25
29
|
/**
|
|
26
30
|
* Store a value with optional TTL.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remember-vercel-kv.provider.d.ts","sourceRoot":"","sources":["../../src/providers/remember-vercel-kv.provider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remember-vercel-kv.provider.d.ts","sourceRoot":"","sources":["../../src/providers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