@hasna/contacts 0.6.35 → 0.6.36
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/README.md +10 -1
- package/dist/cli/commands/advanced.d.ts.map +1 -1
- package/dist/cli/index.js +1934 -533
- package/dist/db/database.d.ts +1 -1
- package/dist/db/database.d.ts.map +1 -1
- package/dist/db/paths.d.ts +12 -0
- package/dist/db/paths.d.ts.map +1 -1
- package/dist/index.js +192 -52
- package/dist/lib/vault.d.ts +5 -1
- package/dist/lib/vault.d.ts.map +1 -1
- package/dist/mcp/handlers/advanced.d.ts.map +1 -1
- package/dist/mcp/index.js +715 -264
- package/dist/mcp/tools.d.ts +3 -3
- package/dist/server/index.js +728 -286
- package/hasna.contract.json +1 -1
- package/package.json +4 -2
package/dist/server/index.js
CHANGED
|
@@ -87,43 +87,169 @@ class SqliteAdapter {
|
|
|
87
87
|
}
|
|
88
88
|
var init_sqlite_adapter = () => {};
|
|
89
89
|
|
|
90
|
-
//
|
|
91
|
-
import {
|
|
90
|
+
// node_modules/.pnpm/@hasna+paths@0.2.2/node_modules/@hasna/paths/dist/index.js
|
|
91
|
+
import { homedir } from "os";
|
|
92
92
|
import { join } from "path";
|
|
93
|
+
function assertApp(app) {
|
|
94
|
+
if (typeof app !== "string" || app.length === 0) {
|
|
95
|
+
throw new TypeError("paths: app must be a non-empty string");
|
|
96
|
+
}
|
|
97
|
+
if (!APP_SLUG_RE.test(app)) {
|
|
98
|
+
throw new TypeError(`paths: invalid app slug "${app}" \u2014 expected lowercase kebab-case ([a-z0-9]+(-[a-z0-9]+)*)`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function assertKind(kind) {
|
|
102
|
+
if (!PATH_KINDS.includes(kind)) {
|
|
103
|
+
throw new TypeError(`paths: invalid path kind "${kind}" \u2014 expected one of ${PATH_KINDS.join(", ")}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function envOf(options) {
|
|
107
|
+
return options.env ?? process.env;
|
|
108
|
+
}
|
|
109
|
+
function envValue(options, kind) {
|
|
110
|
+
const value = envOf(options)[KIND_ENV[kind]];
|
|
111
|
+
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
112
|
+
}
|
|
113
|
+
function isMacOS(platform) {
|
|
114
|
+
return platform === "darwin";
|
|
115
|
+
}
|
|
116
|
+
function baseDir(kind, options) {
|
|
117
|
+
assertKind(kind);
|
|
118
|
+
const override = envValue(options, kind);
|
|
119
|
+
if (override)
|
|
120
|
+
return override;
|
|
121
|
+
const home = options.home ?? homedir();
|
|
122
|
+
const platform = options.platform ?? process.platform;
|
|
123
|
+
if (isMacOS(platform)) {
|
|
124
|
+
switch (kind) {
|
|
125
|
+
case "config":
|
|
126
|
+
case "data":
|
|
127
|
+
return join(home, "Library", "Application Support", "Hasna");
|
|
128
|
+
case "cache":
|
|
129
|
+
return join(home, "Library", "Caches", "Hasna");
|
|
130
|
+
case "state":
|
|
131
|
+
return join(home, "Library", "Logs", "Hasna");
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
switch (kind) {
|
|
135
|
+
case "config":
|
|
136
|
+
return join(home, ".config", "hasna");
|
|
137
|
+
case "data":
|
|
138
|
+
return join(home, ".local", "share", "hasna");
|
|
139
|
+
case "state":
|
|
140
|
+
return join(home, ".local", "state", "hasna");
|
|
141
|
+
case "cache":
|
|
142
|
+
return join(home, ".cache", "hasna");
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
function resolvePath(kind, options) {
|
|
146
|
+
assertKind(kind);
|
|
147
|
+
assertApp(options.app);
|
|
148
|
+
const appSegment = options.internal === true ? join("internal", options.app) : options.app;
|
|
149
|
+
return join(baseDir(kind, options), appSegment);
|
|
150
|
+
}
|
|
151
|
+
function dataDir(options) {
|
|
152
|
+
return resolvePath("data", options);
|
|
153
|
+
}
|
|
154
|
+
function stateDir(options) {
|
|
155
|
+
return resolvePath("state", options);
|
|
156
|
+
}
|
|
157
|
+
var PATH_KINDS, KIND_ENV, APP_SLUG_RE;
|
|
158
|
+
var init_dist = __esm(() => {
|
|
159
|
+
PATH_KINDS = ["config", "data", "state", "cache"];
|
|
160
|
+
KIND_ENV = {
|
|
161
|
+
config: "HASNA_CONFIG_HOME",
|
|
162
|
+
data: "HASNA_DATA_HOME",
|
|
163
|
+
state: "HASNA_STATE_HOME",
|
|
164
|
+
cache: "HASNA_CACHE_HOME"
|
|
165
|
+
};
|
|
166
|
+
APP_SLUG_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
// src/db/paths.ts
|
|
170
|
+
import { chmodSync, copyFileSync, cpSync, existsSync, mkdirSync, readdirSync, statSync } from "fs";
|
|
171
|
+
import { homedir as homedir2 } from "os";
|
|
172
|
+
import { join as join2 } from "path";
|
|
93
173
|
function ensurePrivateDir(dir) {
|
|
94
174
|
if (!existsSync(dir))
|
|
95
175
|
mkdirSync(dir, { recursive: true, mode: 448 });
|
|
96
176
|
chmodSync(dir, 448);
|
|
97
177
|
}
|
|
178
|
+
function home() {
|
|
179
|
+
return process.env["HOME"] || process.env["USERPROFILE"] || homedir2();
|
|
180
|
+
}
|
|
181
|
+
function hasContent(dir) {
|
|
182
|
+
if (!existsSync(dir))
|
|
183
|
+
return false;
|
|
184
|
+
try {
|
|
185
|
+
return readdirSync(dir).length > 0;
|
|
186
|
+
} catch {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
function adoptLegacy(source, target) {
|
|
191
|
+
if (!hasContent(source) || hasContent(target))
|
|
192
|
+
return;
|
|
193
|
+
ensurePrivateDir(target);
|
|
194
|
+
for (const entry of readdirSync(source)) {
|
|
195
|
+
if (entry === ".vault-session")
|
|
196
|
+
continue;
|
|
197
|
+
if (entry === "{backups,images,documents}")
|
|
198
|
+
continue;
|
|
199
|
+
const oldPath = join2(source, entry);
|
|
200
|
+
const newPath = join2(target, entry);
|
|
201
|
+
const st = statSync(oldPath);
|
|
202
|
+
if (st.isDirectory()) {
|
|
203
|
+
cpSync(oldPath, newPath, { recursive: true });
|
|
204
|
+
chmodSync(newPath, 448);
|
|
205
|
+
} else if (st.isFile()) {
|
|
206
|
+
copyFileSync(oldPath, newPath);
|
|
207
|
+
chmodSync(newPath, 384);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
98
211
|
function getDataDir() {
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
212
|
+
const base = home();
|
|
213
|
+
const target = dataDir({ app: "contacts", home: base });
|
|
214
|
+
if (!checkedDataTargets.has(target)) {
|
|
215
|
+
adoptLegacy(join2(base, ".hasna", "contacts"), target);
|
|
216
|
+
adoptLegacy(join2(base, ".contacts"), target);
|
|
217
|
+
checkedDataTargets.add(target);
|
|
218
|
+
}
|
|
219
|
+
ensurePrivateDir(target);
|
|
220
|
+
return target;
|
|
221
|
+
}
|
|
222
|
+
function getStateDir() {
|
|
223
|
+
const base = home();
|
|
224
|
+
const target = stateDir({ app: "contacts", home: base });
|
|
225
|
+
if (!checkedStateTargets.has(target)) {
|
|
226
|
+
if (!hasContent(target)) {
|
|
227
|
+
const legacySession = join2(base, ".hasna", "contacts", ".vault-session");
|
|
228
|
+
if (existsSync(legacySession)) {
|
|
229
|
+
ensurePrivateDir(target);
|
|
230
|
+
const targetSession = join2(target, ".vault-session");
|
|
231
|
+
copyFileSync(legacySession, targetSession);
|
|
232
|
+
chmodSync(targetSession, 384);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
checkedStateTargets.add(target);
|
|
236
|
+
}
|
|
237
|
+
ensurePrivateDir(target);
|
|
238
|
+
return target;
|
|
118
239
|
}
|
|
119
240
|
function getDbPath() {
|
|
120
241
|
if (process.env["HASNA_CONTACTS_DB_PATH"])
|
|
121
242
|
return process.env["HASNA_CONTACTS_DB_PATH"];
|
|
122
243
|
if (process.env["CONTACTS_DB_PATH"])
|
|
123
244
|
return process.env["CONTACTS_DB_PATH"];
|
|
124
|
-
return
|
|
245
|
+
return join2(getDataDir(), "contacts.db");
|
|
125
246
|
}
|
|
126
|
-
var
|
|
247
|
+
var checkedDataTargets, checkedStateTargets;
|
|
248
|
+
var init_paths = __esm(() => {
|
|
249
|
+
init_dist();
|
|
250
|
+
checkedDataTargets = new Set;
|
|
251
|
+
checkedStateTargets = new Set;
|
|
252
|
+
});
|
|
127
253
|
|
|
128
254
|
// src/db/database.ts
|
|
129
255
|
var exports_database = {};
|
|
@@ -131,6 +257,7 @@ __export(exports_database, {
|
|
|
131
257
|
uuid: () => uuid,
|
|
132
258
|
resetDatabase: () => resetDatabase,
|
|
133
259
|
now: () => now,
|
|
260
|
+
getStateDir: () => getStateDir,
|
|
134
261
|
getDbPath: () => getDbPath,
|
|
135
262
|
getDatabase: () => getDatabase,
|
|
136
263
|
getDataDir: () => getDataDir
|
|
@@ -1800,7 +1927,113 @@ var init_contacts = __esm(() => {
|
|
|
1800
1927
|
init_project_memberships2();
|
|
1801
1928
|
});
|
|
1802
1929
|
|
|
1803
|
-
// node_modules/
|
|
1930
|
+
// node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/index.js
|
|
1931
|
+
var require_content_type = __commonJS((exports) => {
|
|
1932
|
+
/*!
|
|
1933
|
+
* content-type
|
|
1934
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
1935
|
+
* MIT Licensed
|
|
1936
|
+
*/
|
|
1937
|
+
var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g;
|
|
1938
|
+
var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/;
|
|
1939
|
+
var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
|
|
1940
|
+
var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g;
|
|
1941
|
+
var QUOTE_REGEXP = /([\\"])/g;
|
|
1942
|
+
var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
|
|
1943
|
+
exports.format = format;
|
|
1944
|
+
exports.parse = parse;
|
|
1945
|
+
function format(obj) {
|
|
1946
|
+
if (!obj || typeof obj !== "object") {
|
|
1947
|
+
throw new TypeError("argument obj is required");
|
|
1948
|
+
}
|
|
1949
|
+
var parameters = obj.parameters;
|
|
1950
|
+
var type = obj.type;
|
|
1951
|
+
if (!type || !TYPE_REGEXP.test(type)) {
|
|
1952
|
+
throw new TypeError("invalid type");
|
|
1953
|
+
}
|
|
1954
|
+
var string = type;
|
|
1955
|
+
if (parameters && typeof parameters === "object") {
|
|
1956
|
+
var param;
|
|
1957
|
+
var params = Object.keys(parameters).sort();
|
|
1958
|
+
for (var i = 0;i < params.length; i++) {
|
|
1959
|
+
param = params[i];
|
|
1960
|
+
if (!TOKEN_REGEXP.test(param)) {
|
|
1961
|
+
throw new TypeError("invalid parameter name");
|
|
1962
|
+
}
|
|
1963
|
+
string += "; " + param + "=" + qstring(parameters[param]);
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
return string;
|
|
1967
|
+
}
|
|
1968
|
+
function parse(string) {
|
|
1969
|
+
if (!string) {
|
|
1970
|
+
throw new TypeError("argument string is required");
|
|
1971
|
+
}
|
|
1972
|
+
var header = typeof string === "object" ? getcontenttype(string) : string;
|
|
1973
|
+
if (typeof header !== "string") {
|
|
1974
|
+
throw new TypeError("argument string is required to be a string");
|
|
1975
|
+
}
|
|
1976
|
+
var index = header.indexOf(";");
|
|
1977
|
+
var type = index !== -1 ? header.slice(0, index).trim() : header.trim();
|
|
1978
|
+
if (!TYPE_REGEXP.test(type)) {
|
|
1979
|
+
throw new TypeError("invalid media type");
|
|
1980
|
+
}
|
|
1981
|
+
var obj = new ContentType(type.toLowerCase());
|
|
1982
|
+
if (index !== -1) {
|
|
1983
|
+
var key;
|
|
1984
|
+
var match;
|
|
1985
|
+
var value;
|
|
1986
|
+
PARAM_REGEXP.lastIndex = index;
|
|
1987
|
+
while (match = PARAM_REGEXP.exec(header)) {
|
|
1988
|
+
if (match.index !== index) {
|
|
1989
|
+
throw new TypeError("invalid parameter format");
|
|
1990
|
+
}
|
|
1991
|
+
index += match[0].length;
|
|
1992
|
+
key = match[1].toLowerCase();
|
|
1993
|
+
value = match[2];
|
|
1994
|
+
if (value.charCodeAt(0) === 34) {
|
|
1995
|
+
value = value.slice(1, -1);
|
|
1996
|
+
if (value.indexOf("\\") !== -1) {
|
|
1997
|
+
value = value.replace(QESC_REGEXP, "$1");
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
obj.parameters[key] = value;
|
|
2001
|
+
}
|
|
2002
|
+
if (index !== header.length) {
|
|
2003
|
+
throw new TypeError("invalid parameter format");
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
return obj;
|
|
2007
|
+
}
|
|
2008
|
+
function getcontenttype(obj) {
|
|
2009
|
+
var header;
|
|
2010
|
+
if (typeof obj.getHeader === "function") {
|
|
2011
|
+
header = obj.getHeader("content-type");
|
|
2012
|
+
} else if (typeof obj.headers === "object") {
|
|
2013
|
+
header = obj.headers && obj.headers["content-type"];
|
|
2014
|
+
}
|
|
2015
|
+
if (typeof header !== "string") {
|
|
2016
|
+
throw new TypeError("content-type header is missing from object");
|
|
2017
|
+
}
|
|
2018
|
+
return header;
|
|
2019
|
+
}
|
|
2020
|
+
function qstring(val) {
|
|
2021
|
+
var str = String(val);
|
|
2022
|
+
if (TOKEN_REGEXP.test(str)) {
|
|
2023
|
+
return str;
|
|
2024
|
+
}
|
|
2025
|
+
if (str.length > 0 && !TEXT_REGEXP.test(str)) {
|
|
2026
|
+
throw new TypeError("invalid parameter value");
|
|
2027
|
+
}
|
|
2028
|
+
return '"' + str.replace(QUOTE_REGEXP, "\\$1") + '"';
|
|
2029
|
+
}
|
|
2030
|
+
function ContentType(type) {
|
|
2031
|
+
this.parameters = Object.create(null);
|
|
2032
|
+
this.type = type;
|
|
2033
|
+
}
|
|
2034
|
+
});
|
|
2035
|
+
|
|
2036
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js
|
|
1804
2037
|
var require_code = __commonJS((exports) => {
|
|
1805
2038
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1806
2039
|
exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = undefined;
|
|
@@ -1954,7 +2187,7 @@ var require_code = __commonJS((exports) => {
|
|
|
1954
2187
|
exports.regexpCode = regexpCode;
|
|
1955
2188
|
});
|
|
1956
2189
|
|
|
1957
|
-
// node_modules/ajv/dist/compile/codegen/scope.js
|
|
2190
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/scope.js
|
|
1958
2191
|
var require_scope = __commonJS((exports) => {
|
|
1959
2192
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1960
2193
|
exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = undefined;
|
|
@@ -2100,7 +2333,7 @@ var require_scope = __commonJS((exports) => {
|
|
|
2100
2333
|
exports.ValueScope = ValueScope;
|
|
2101
2334
|
});
|
|
2102
2335
|
|
|
2103
|
-
// node_modules/ajv/dist/compile/codegen/index.js
|
|
2336
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js
|
|
2104
2337
|
var require_codegen = __commonJS((exports) => {
|
|
2105
2338
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2106
2339
|
exports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = undefined;
|
|
@@ -2810,7 +3043,7 @@ var require_codegen = __commonJS((exports) => {
|
|
|
2810
3043
|
}
|
|
2811
3044
|
});
|
|
2812
3045
|
|
|
2813
|
-
// node_modules/ajv/dist/compile/util.js
|
|
3046
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/util.js
|
|
2814
3047
|
var require_util = __commonJS((exports) => {
|
|
2815
3048
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2816
3049
|
exports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = undefined;
|
|
@@ -2974,7 +3207,7 @@ var require_util = __commonJS((exports) => {
|
|
|
2974
3207
|
exports.checkStrictMode = checkStrictMode;
|
|
2975
3208
|
});
|
|
2976
3209
|
|
|
2977
|
-
// node_modules/ajv/dist/compile/names.js
|
|
3210
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/names.js
|
|
2978
3211
|
var require_names = __commonJS((exports) => {
|
|
2979
3212
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2980
3213
|
var codegen_1 = require_codegen();
|
|
@@ -2999,7 +3232,7 @@ var require_names = __commonJS((exports) => {
|
|
|
2999
3232
|
exports.default = names;
|
|
3000
3233
|
});
|
|
3001
3234
|
|
|
3002
|
-
// node_modules/ajv/dist/compile/errors.js
|
|
3235
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/errors.js
|
|
3003
3236
|
var require_errors = __commonJS((exports) => {
|
|
3004
3237
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3005
3238
|
exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = undefined;
|
|
@@ -3117,7 +3350,7 @@ var require_errors = __commonJS((exports) => {
|
|
|
3117
3350
|
}
|
|
3118
3351
|
});
|
|
3119
3352
|
|
|
3120
|
-
// node_modules/ajv/dist/compile/validate/boolSchema.js
|
|
3353
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/boolSchema.js
|
|
3121
3354
|
var require_boolSchema = __commonJS((exports) => {
|
|
3122
3355
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3123
3356
|
exports.boolOrEmptySchema = exports.topBoolOrEmptySchema = undefined;
|
|
@@ -3165,7 +3398,7 @@ var require_boolSchema = __commonJS((exports) => {
|
|
|
3165
3398
|
}
|
|
3166
3399
|
});
|
|
3167
3400
|
|
|
3168
|
-
// node_modules/ajv/dist/compile/rules.js
|
|
3401
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/rules.js
|
|
3169
3402
|
var require_rules = __commonJS((exports) => {
|
|
3170
3403
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3171
3404
|
exports.getRules = exports.isJSONType = undefined;
|
|
@@ -3193,7 +3426,7 @@ var require_rules = __commonJS((exports) => {
|
|
|
3193
3426
|
exports.getRules = getRules;
|
|
3194
3427
|
});
|
|
3195
3428
|
|
|
3196
|
-
// node_modules/ajv/dist/compile/validate/applicability.js
|
|
3429
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/applicability.js
|
|
3197
3430
|
var require_applicability = __commonJS((exports) => {
|
|
3198
3431
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3199
3432
|
exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = undefined;
|
|
@@ -3213,7 +3446,7 @@ var require_applicability = __commonJS((exports) => {
|
|
|
3213
3446
|
exports.shouldUseRule = shouldUseRule;
|
|
3214
3447
|
});
|
|
3215
3448
|
|
|
3216
|
-
// node_modules/ajv/dist/compile/validate/dataType.js
|
|
3449
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/dataType.js
|
|
3217
3450
|
var require_dataType = __commonJS((exports) => {
|
|
3218
3451
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3219
3452
|
exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = undefined;
|
|
@@ -3394,7 +3627,7 @@ var require_dataType = __commonJS((exports) => {
|
|
|
3394
3627
|
}
|
|
3395
3628
|
});
|
|
3396
3629
|
|
|
3397
|
-
// node_modules/ajv/dist/compile/validate/defaults.js
|
|
3630
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/defaults.js
|
|
3398
3631
|
var require_defaults = __commonJS((exports) => {
|
|
3399
3632
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3400
3633
|
exports.assignDefaults = undefined;
|
|
@@ -3428,7 +3661,7 @@ var require_defaults = __commonJS((exports) => {
|
|
|
3428
3661
|
}
|
|
3429
3662
|
});
|
|
3430
3663
|
|
|
3431
|
-
// node_modules/ajv/dist/vocabularies/code.js
|
|
3664
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/code.js
|
|
3432
3665
|
var require_code2 = __commonJS((exports) => {
|
|
3433
3666
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3434
3667
|
exports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = undefined;
|
|
@@ -3557,7 +3790,7 @@ var require_code2 = __commonJS((exports) => {
|
|
|
3557
3790
|
exports.validateUnion = validateUnion;
|
|
3558
3791
|
});
|
|
3559
3792
|
|
|
3560
|
-
// node_modules/ajv/dist/compile/validate/keyword.js
|
|
3793
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/keyword.js
|
|
3561
3794
|
var require_keyword = __commonJS((exports) => {
|
|
3562
3795
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3563
3796
|
exports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = undefined;
|
|
@@ -3672,7 +3905,7 @@ var require_keyword = __commonJS((exports) => {
|
|
|
3672
3905
|
exports.validateKeywordUsage = validateKeywordUsage;
|
|
3673
3906
|
});
|
|
3674
3907
|
|
|
3675
|
-
// node_modules/ajv/dist/compile/validate/subschema.js
|
|
3908
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/subschema.js
|
|
3676
3909
|
var require_subschema = __commonJS((exports) => {
|
|
3677
3910
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3678
3911
|
exports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = undefined;
|
|
@@ -3752,7 +3985,7 @@ var require_subschema = __commonJS((exports) => {
|
|
|
3752
3985
|
exports.extendSubschemaMode = extendSubschemaMode;
|
|
3753
3986
|
});
|
|
3754
3987
|
|
|
3755
|
-
// node_modules/fast-deep-equal/index.js
|
|
3988
|
+
// node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
|
|
3756
3989
|
var require_fast_deep_equal = __commonJS((exports, module) => {
|
|
3757
3990
|
module.exports = function equal(a, b) {
|
|
3758
3991
|
if (a === b)
|
|
@@ -3794,7 +4027,7 @@ var require_fast_deep_equal = __commonJS((exports, module) => {
|
|
|
3794
4027
|
};
|
|
3795
4028
|
});
|
|
3796
4029
|
|
|
3797
|
-
// node_modules/json-schema-traverse/index.js
|
|
4030
|
+
// node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js
|
|
3798
4031
|
var require_json_schema_traverse = __commonJS((exports, module) => {
|
|
3799
4032
|
var traverse = module.exports = function(schema, opts, cb) {
|
|
3800
4033
|
if (typeof opts == "function") {
|
|
@@ -3877,7 +4110,7 @@ var require_json_schema_traverse = __commonJS((exports, module) => {
|
|
|
3877
4110
|
}
|
|
3878
4111
|
});
|
|
3879
4112
|
|
|
3880
|
-
// node_modules/ajv/dist/compile/resolve.js
|
|
4113
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/resolve.js
|
|
3881
4114
|
var require_resolve = __commonJS((exports) => {
|
|
3882
4115
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3883
4116
|
exports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = undefined;
|
|
@@ -4030,7 +4263,7 @@ var require_resolve = __commonJS((exports) => {
|
|
|
4030
4263
|
exports.getSchemaRefs = getSchemaRefs;
|
|
4031
4264
|
});
|
|
4032
4265
|
|
|
4033
|
-
// node_modules/ajv/dist/compile/validate/index.js
|
|
4266
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/index.js
|
|
4034
4267
|
var require_validate = __commonJS((exports) => {
|
|
4035
4268
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4036
4269
|
exports.getData = exports.KeywordCxt = exports.validateFunctionCode = undefined;
|
|
@@ -4535,7 +4768,7 @@ var require_validate = __commonJS((exports) => {
|
|
|
4535
4768
|
exports.getData = getData;
|
|
4536
4769
|
});
|
|
4537
4770
|
|
|
4538
|
-
// node_modules/ajv/dist/runtime/validation_error.js
|
|
4771
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/validation_error.js
|
|
4539
4772
|
var require_validation_error = __commonJS((exports) => {
|
|
4540
4773
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4541
4774
|
|
|
@@ -4549,7 +4782,7 @@ var require_validation_error = __commonJS((exports) => {
|
|
|
4549
4782
|
exports.default = ValidationError;
|
|
4550
4783
|
});
|
|
4551
4784
|
|
|
4552
|
-
// node_modules/ajv/dist/compile/ref_error.js
|
|
4785
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/ref_error.js
|
|
4553
4786
|
var require_ref_error = __commonJS((exports) => {
|
|
4554
4787
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4555
4788
|
var resolve_1 = require_resolve();
|
|
@@ -4564,7 +4797,7 @@ var require_ref_error = __commonJS((exports) => {
|
|
|
4564
4797
|
exports.default = MissingRefError;
|
|
4565
4798
|
});
|
|
4566
4799
|
|
|
4567
|
-
// node_modules/ajv/dist/compile/index.js
|
|
4800
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/index.js
|
|
4568
4801
|
var require_compile = __commonJS((exports) => {
|
|
4569
4802
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4570
4803
|
exports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = undefined;
|
|
@@ -4785,7 +5018,7 @@ var require_compile = __commonJS((exports) => {
|
|
|
4785
5018
|
}
|
|
4786
5019
|
});
|
|
4787
5020
|
|
|
4788
|
-
// node_modules/ajv/dist/refs/data.json
|
|
5021
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/data.json
|
|
4789
5022
|
var require_data = __commonJS((exports, module) => {
|
|
4790
5023
|
module.exports = {
|
|
4791
5024
|
$id: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
|
|
@@ -5575,7 +5808,7 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
5575
5808
|
module.exports.fastUri = fastUri;
|
|
5576
5809
|
});
|
|
5577
5810
|
|
|
5578
|
-
// node_modules/ajv/dist/runtime/uri.js
|
|
5811
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/uri.js
|
|
5579
5812
|
var require_uri = __commonJS((exports) => {
|
|
5580
5813
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5581
5814
|
var uri = require_fast_uri();
|
|
@@ -5583,7 +5816,7 @@ var require_uri = __commonJS((exports) => {
|
|
|
5583
5816
|
exports.default = uri;
|
|
5584
5817
|
});
|
|
5585
5818
|
|
|
5586
|
-
// node_modules/ajv/dist/core.js
|
|
5819
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/core.js
|
|
5587
5820
|
var require_core = __commonJS((exports) => {
|
|
5588
5821
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5589
5822
|
exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = undefined;
|
|
@@ -5694,7 +5927,7 @@ var require_core = __commonJS((exports) => {
|
|
|
5694
5927
|
constructor(opts = {}) {
|
|
5695
5928
|
this.schemas = {};
|
|
5696
5929
|
this.refs = {};
|
|
5697
|
-
this.formats =
|
|
5930
|
+
this.formats = Object.create(null);
|
|
5698
5931
|
this._compilations = new Set;
|
|
5699
5932
|
this._loading = {};
|
|
5700
5933
|
this._cache = new Map;
|
|
@@ -6176,7 +6409,7 @@ var require_core = __commonJS((exports) => {
|
|
|
6176
6409
|
}
|
|
6177
6410
|
});
|
|
6178
6411
|
|
|
6179
|
-
// node_modules/ajv/dist/vocabularies/core/id.js
|
|
6412
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js
|
|
6180
6413
|
var require_id = __commonJS((exports) => {
|
|
6181
6414
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6182
6415
|
var def = {
|
|
@@ -6188,7 +6421,7 @@ var require_id = __commonJS((exports) => {
|
|
|
6188
6421
|
exports.default = def;
|
|
6189
6422
|
});
|
|
6190
6423
|
|
|
6191
|
-
// node_modules/ajv/dist/vocabularies/core/ref.js
|
|
6424
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js
|
|
6192
6425
|
var require_ref = __commonJS((exports) => {
|
|
6193
6426
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6194
6427
|
exports.callRef = exports.getValidate = undefined;
|
|
@@ -6307,7 +6540,7 @@ var require_ref = __commonJS((exports) => {
|
|
|
6307
6540
|
exports.default = def;
|
|
6308
6541
|
});
|
|
6309
6542
|
|
|
6310
|
-
// node_modules/ajv/dist/vocabularies/core/index.js
|
|
6543
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js
|
|
6311
6544
|
var require_core2 = __commonJS((exports) => {
|
|
6312
6545
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6313
6546
|
var id_1 = require_id();
|
|
@@ -6325,7 +6558,7 @@ var require_core2 = __commonJS((exports) => {
|
|
|
6325
6558
|
exports.default = core2;
|
|
6326
6559
|
});
|
|
6327
6560
|
|
|
6328
|
-
// node_modules/ajv/dist/vocabularies/validation/limitNumber.js
|
|
6561
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js
|
|
6329
6562
|
var require_limitNumber = __commonJS((exports) => {
|
|
6330
6563
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6331
6564
|
var codegen_1 = require_codegen();
|
|
@@ -6354,7 +6587,7 @@ var require_limitNumber = __commonJS((exports) => {
|
|
|
6354
6587
|
exports.default = def;
|
|
6355
6588
|
});
|
|
6356
6589
|
|
|
6357
|
-
// node_modules/ajv/dist/vocabularies/validation/multipleOf.js
|
|
6590
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js
|
|
6358
6591
|
var require_multipleOf = __commonJS((exports) => {
|
|
6359
6592
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6360
6593
|
var codegen_1 = require_codegen();
|
|
@@ -6379,7 +6612,7 @@ var require_multipleOf = __commonJS((exports) => {
|
|
|
6379
6612
|
exports.default = def;
|
|
6380
6613
|
});
|
|
6381
6614
|
|
|
6382
|
-
// node_modules/ajv/dist/runtime/ucs2length.js
|
|
6615
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/ucs2length.js
|
|
6383
6616
|
var require_ucs2length = __commonJS((exports) => {
|
|
6384
6617
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6385
6618
|
function ucs2length(str) {
|
|
@@ -6402,7 +6635,7 @@ var require_ucs2length = __commonJS((exports) => {
|
|
|
6402
6635
|
ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default';
|
|
6403
6636
|
});
|
|
6404
6637
|
|
|
6405
|
-
// node_modules/ajv/dist/vocabularies/validation/limitLength.js
|
|
6638
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js
|
|
6406
6639
|
var require_limitLength = __commonJS((exports) => {
|
|
6407
6640
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6408
6641
|
var codegen_1 = require_codegen();
|
|
@@ -6431,7 +6664,7 @@ var require_limitLength = __commonJS((exports) => {
|
|
|
6431
6664
|
exports.default = def;
|
|
6432
6665
|
});
|
|
6433
6666
|
|
|
6434
|
-
// node_modules/ajv/dist/vocabularies/validation/pattern.js
|
|
6667
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/pattern.js
|
|
6435
6668
|
var require_pattern = __commonJS((exports) => {
|
|
6436
6669
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6437
6670
|
var code_1 = require_code2();
|
|
@@ -6465,7 +6698,7 @@ var require_pattern = __commonJS((exports) => {
|
|
|
6465
6698
|
exports.default = def;
|
|
6466
6699
|
});
|
|
6467
6700
|
|
|
6468
|
-
// node_modules/ajv/dist/vocabularies/validation/limitProperties.js
|
|
6701
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js
|
|
6469
6702
|
var require_limitProperties = __commonJS((exports) => {
|
|
6470
6703
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6471
6704
|
var codegen_1 = require_codegen();
|
|
@@ -6491,7 +6724,7 @@ var require_limitProperties = __commonJS((exports) => {
|
|
|
6491
6724
|
exports.default = def;
|
|
6492
6725
|
});
|
|
6493
6726
|
|
|
6494
|
-
// node_modules/ajv/dist/vocabularies/validation/required.js
|
|
6727
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js
|
|
6495
6728
|
var require_required = __commonJS((exports) => {
|
|
6496
6729
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6497
6730
|
var code_1 = require_code2();
|
|
@@ -6570,7 +6803,7 @@ var require_required = __commonJS((exports) => {
|
|
|
6570
6803
|
exports.default = def;
|
|
6571
6804
|
});
|
|
6572
6805
|
|
|
6573
|
-
// node_modules/ajv/dist/vocabularies/validation/limitItems.js
|
|
6806
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js
|
|
6574
6807
|
var require_limitItems = __commonJS((exports) => {
|
|
6575
6808
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6576
6809
|
var codegen_1 = require_codegen();
|
|
@@ -6596,7 +6829,7 @@ var require_limitItems = __commonJS((exports) => {
|
|
|
6596
6829
|
exports.default = def;
|
|
6597
6830
|
});
|
|
6598
6831
|
|
|
6599
|
-
// node_modules/ajv/dist/runtime/equal.js
|
|
6832
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js
|
|
6600
6833
|
var require_equal = __commonJS((exports) => {
|
|
6601
6834
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6602
6835
|
var equal = require_fast_deep_equal();
|
|
@@ -6604,7 +6837,7 @@ var require_equal = __commonJS((exports) => {
|
|
|
6604
6837
|
exports.default = equal;
|
|
6605
6838
|
});
|
|
6606
6839
|
|
|
6607
|
-
// node_modules/ajv/dist/vocabularies/validation/uniqueItems.js
|
|
6840
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js
|
|
6608
6841
|
var require_uniqueItems = __commonJS((exports) => {
|
|
6609
6842
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6610
6843
|
var dataType_1 = require_dataType();
|
|
@@ -6668,7 +6901,7 @@ var require_uniqueItems = __commonJS((exports) => {
|
|
|
6668
6901
|
exports.default = def;
|
|
6669
6902
|
});
|
|
6670
6903
|
|
|
6671
|
-
// node_modules/ajv/dist/vocabularies/validation/const.js
|
|
6904
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/const.js
|
|
6672
6905
|
var require_const = __commonJS((exports) => {
|
|
6673
6906
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6674
6907
|
var codegen_1 = require_codegen();
|
|
@@ -6694,7 +6927,7 @@ var require_const = __commonJS((exports) => {
|
|
|
6694
6927
|
exports.default = def;
|
|
6695
6928
|
});
|
|
6696
6929
|
|
|
6697
|
-
// node_modules/ajv/dist/vocabularies/validation/enum.js
|
|
6930
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/enum.js
|
|
6698
6931
|
var require_enum = __commonJS((exports) => {
|
|
6699
6932
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6700
6933
|
var codegen_1 = require_codegen();
|
|
@@ -6740,7 +6973,7 @@ var require_enum = __commonJS((exports) => {
|
|
|
6740
6973
|
exports.default = def;
|
|
6741
6974
|
});
|
|
6742
6975
|
|
|
6743
|
-
// node_modules/ajv/dist/vocabularies/validation/index.js
|
|
6976
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js
|
|
6744
6977
|
var require_validation = __commonJS((exports) => {
|
|
6745
6978
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6746
6979
|
var limitNumber_1 = require_limitNumber();
|
|
@@ -6770,7 +7003,7 @@ var require_validation = __commonJS((exports) => {
|
|
|
6770
7003
|
exports.default = validation;
|
|
6771
7004
|
});
|
|
6772
7005
|
|
|
6773
|
-
// node_modules/ajv/dist/vocabularies/applicator/additionalItems.js
|
|
7006
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js
|
|
6774
7007
|
var require_additionalItems = __commonJS((exports) => {
|
|
6775
7008
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6776
7009
|
exports.validateAdditionalItems = undefined;
|
|
@@ -6820,7 +7053,7 @@ var require_additionalItems = __commonJS((exports) => {
|
|
|
6820
7053
|
exports.default = def;
|
|
6821
7054
|
});
|
|
6822
7055
|
|
|
6823
|
-
// node_modules/ajv/dist/vocabularies/applicator/items.js
|
|
7056
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items.js
|
|
6824
7057
|
var require_items = __commonJS((exports) => {
|
|
6825
7058
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6826
7059
|
exports.validateTuple = undefined;
|
|
@@ -6874,7 +7107,7 @@ var require_items = __commonJS((exports) => {
|
|
|
6874
7107
|
exports.default = def;
|
|
6875
7108
|
});
|
|
6876
7109
|
|
|
6877
|
-
// node_modules/ajv/dist/vocabularies/applicator/prefixItems.js
|
|
7110
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js
|
|
6878
7111
|
var require_prefixItems = __commonJS((exports) => {
|
|
6879
7112
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6880
7113
|
var items_1 = require_items();
|
|
@@ -6888,7 +7121,7 @@ var require_prefixItems = __commonJS((exports) => {
|
|
|
6888
7121
|
exports.default = def;
|
|
6889
7122
|
});
|
|
6890
7123
|
|
|
6891
|
-
// node_modules/ajv/dist/vocabularies/applicator/items2020.js
|
|
7124
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js
|
|
6892
7125
|
var require_items2020 = __commonJS((exports) => {
|
|
6893
7126
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6894
7127
|
var codegen_1 = require_codegen();
|
|
@@ -6920,7 +7153,7 @@ var require_items2020 = __commonJS((exports) => {
|
|
|
6920
7153
|
exports.default = def;
|
|
6921
7154
|
});
|
|
6922
7155
|
|
|
6923
|
-
// node_modules/ajv/dist/vocabularies/applicator/contains.js
|
|
7156
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/contains.js
|
|
6924
7157
|
var require_contains = __commonJS((exports) => {
|
|
6925
7158
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6926
7159
|
var codegen_1 = require_codegen();
|
|
@@ -7011,7 +7244,7 @@ var require_contains = __commonJS((exports) => {
|
|
|
7011
7244
|
exports.default = def;
|
|
7012
7245
|
});
|
|
7013
7246
|
|
|
7014
|
-
// node_modules/ajv/dist/vocabularies/applicator/dependencies.js
|
|
7247
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js
|
|
7015
7248
|
var require_dependencies = __commonJS((exports) => {
|
|
7016
7249
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7017
7250
|
exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = undefined;
|
|
@@ -7096,7 +7329,7 @@ var require_dependencies = __commonJS((exports) => {
|
|
|
7096
7329
|
exports.default = def;
|
|
7097
7330
|
});
|
|
7098
7331
|
|
|
7099
|
-
// node_modules/ajv/dist/vocabularies/applicator/propertyNames.js
|
|
7332
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js
|
|
7100
7333
|
var require_propertyNames = __commonJS((exports) => {
|
|
7101
7334
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7102
7335
|
var codegen_1 = require_codegen();
|
|
@@ -7136,7 +7369,7 @@ var require_propertyNames = __commonJS((exports) => {
|
|
|
7136
7369
|
exports.default = def;
|
|
7137
7370
|
});
|
|
7138
7371
|
|
|
7139
|
-
// node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js
|
|
7372
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js
|
|
7140
7373
|
var require_additionalProperties = __commonJS((exports) => {
|
|
7141
7374
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7142
7375
|
var code_1 = require_code2();
|
|
@@ -7239,7 +7472,7 @@ var require_additionalProperties = __commonJS((exports) => {
|
|
|
7239
7472
|
exports.default = def;
|
|
7240
7473
|
});
|
|
7241
7474
|
|
|
7242
|
-
// node_modules/ajv/dist/vocabularies/applicator/properties.js
|
|
7475
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/properties.js
|
|
7243
7476
|
var require_properties = __commonJS((exports) => {
|
|
7244
7477
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7245
7478
|
var validate_1 = require_validate();
|
|
@@ -7294,7 +7527,7 @@ var require_properties = __commonJS((exports) => {
|
|
|
7294
7527
|
exports.default = def;
|
|
7295
7528
|
});
|
|
7296
7529
|
|
|
7297
|
-
// node_modules/ajv/dist/vocabularies/applicator/patternProperties.js
|
|
7530
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js
|
|
7298
7531
|
var require_patternProperties = __commonJS((exports) => {
|
|
7299
7532
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7300
7533
|
var code_1 = require_code2();
|
|
@@ -7365,7 +7598,7 @@ var require_patternProperties = __commonJS((exports) => {
|
|
|
7365
7598
|
exports.default = def;
|
|
7366
7599
|
});
|
|
7367
7600
|
|
|
7368
|
-
// node_modules/ajv/dist/vocabularies/applicator/not.js
|
|
7601
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/not.js
|
|
7369
7602
|
var require_not = __commonJS((exports) => {
|
|
7370
7603
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7371
7604
|
var util_1 = require_util();
|
|
@@ -7393,7 +7626,7 @@ var require_not = __commonJS((exports) => {
|
|
|
7393
7626
|
exports.default = def;
|
|
7394
7627
|
});
|
|
7395
7628
|
|
|
7396
|
-
// node_modules/ajv/dist/vocabularies/applicator/anyOf.js
|
|
7629
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js
|
|
7397
7630
|
var require_anyOf = __commonJS((exports) => {
|
|
7398
7631
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7399
7632
|
var code_1 = require_code2();
|
|
@@ -7407,7 +7640,7 @@ var require_anyOf = __commonJS((exports) => {
|
|
|
7407
7640
|
exports.default = def;
|
|
7408
7641
|
});
|
|
7409
7642
|
|
|
7410
|
-
// node_modules/ajv/dist/vocabularies/applicator/oneOf.js
|
|
7643
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js
|
|
7411
7644
|
var require_oneOf = __commonJS((exports) => {
|
|
7412
7645
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7413
7646
|
var codegen_1 = require_codegen();
|
|
@@ -7462,7 +7695,7 @@ var require_oneOf = __commonJS((exports) => {
|
|
|
7462
7695
|
exports.default = def;
|
|
7463
7696
|
});
|
|
7464
7697
|
|
|
7465
|
-
// node_modules/ajv/dist/vocabularies/applicator/allOf.js
|
|
7698
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js
|
|
7466
7699
|
var require_allOf = __commonJS((exports) => {
|
|
7467
7700
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7468
7701
|
var util_1 = require_util();
|
|
@@ -7486,7 +7719,7 @@ var require_allOf = __commonJS((exports) => {
|
|
|
7486
7719
|
exports.default = def;
|
|
7487
7720
|
});
|
|
7488
7721
|
|
|
7489
|
-
// node_modules/ajv/dist/vocabularies/applicator/if.js
|
|
7722
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/if.js
|
|
7490
7723
|
var require_if = __commonJS((exports) => {
|
|
7491
7724
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7492
7725
|
var codegen_1 = require_codegen();
|
|
@@ -7552,7 +7785,7 @@ var require_if = __commonJS((exports) => {
|
|
|
7552
7785
|
exports.default = def;
|
|
7553
7786
|
});
|
|
7554
7787
|
|
|
7555
|
-
// node_modules/ajv/dist/vocabularies/applicator/thenElse.js
|
|
7788
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js
|
|
7556
7789
|
var require_thenElse = __commonJS((exports) => {
|
|
7557
7790
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7558
7791
|
var util_1 = require_util();
|
|
@@ -7567,7 +7800,7 @@ var require_thenElse = __commonJS((exports) => {
|
|
|
7567
7800
|
exports.default = def;
|
|
7568
7801
|
});
|
|
7569
7802
|
|
|
7570
|
-
// node_modules/ajv/dist/vocabularies/applicator/index.js
|
|
7803
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/index.js
|
|
7571
7804
|
var require_applicator = __commonJS((exports) => {
|
|
7572
7805
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7573
7806
|
var additionalItems_1 = require_additionalItems();
|
|
@@ -7610,7 +7843,7 @@ var require_applicator = __commonJS((exports) => {
|
|
|
7610
7843
|
exports.default = getApplicator;
|
|
7611
7844
|
});
|
|
7612
7845
|
|
|
7613
|
-
// node_modules/ajv/dist/vocabularies/format/format.js
|
|
7846
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js
|
|
7614
7847
|
var require_format = __commonJS((exports) => {
|
|
7615
7848
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7616
7849
|
var codegen_1 = require_codegen();
|
|
@@ -7697,7 +7930,7 @@ var require_format = __commonJS((exports) => {
|
|
|
7697
7930
|
exports.default = def;
|
|
7698
7931
|
});
|
|
7699
7932
|
|
|
7700
|
-
// node_modules/ajv/dist/vocabularies/format/index.js
|
|
7933
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js
|
|
7701
7934
|
var require_format2 = __commonJS((exports) => {
|
|
7702
7935
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7703
7936
|
var format_1 = require_format();
|
|
@@ -7705,7 +7938,7 @@ var require_format2 = __commonJS((exports) => {
|
|
|
7705
7938
|
exports.default = format;
|
|
7706
7939
|
});
|
|
7707
7940
|
|
|
7708
|
-
// node_modules/ajv/dist/vocabularies/metadata.js
|
|
7941
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js
|
|
7709
7942
|
var require_metadata = __commonJS((exports) => {
|
|
7710
7943
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7711
7944
|
exports.contentVocabulary = exports.metadataVocabulary = undefined;
|
|
@@ -7725,7 +7958,7 @@ var require_metadata = __commonJS((exports) => {
|
|
|
7725
7958
|
];
|
|
7726
7959
|
});
|
|
7727
7960
|
|
|
7728
|
-
// node_modules/ajv/dist/vocabularies/draft7.js
|
|
7961
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft7.js
|
|
7729
7962
|
var require_draft7 = __commonJS((exports) => {
|
|
7730
7963
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7731
7964
|
var core_1 = require_core2();
|
|
@@ -7744,7 +7977,7 @@ var require_draft7 = __commonJS((exports) => {
|
|
|
7744
7977
|
exports.default = draft7Vocabularies;
|
|
7745
7978
|
});
|
|
7746
7979
|
|
|
7747
|
-
// node_modules/ajv/dist/vocabularies/discriminator/types.js
|
|
7980
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js
|
|
7748
7981
|
var require_types = __commonJS((exports) => {
|
|
7749
7982
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7750
7983
|
exports.DiscrError = undefined;
|
|
@@ -7755,7 +7988,7 @@ var require_types = __commonJS((exports) => {
|
|
|
7755
7988
|
})(DiscrError || (exports.DiscrError = DiscrError = {}));
|
|
7756
7989
|
});
|
|
7757
7990
|
|
|
7758
|
-
// node_modules/ajv/dist/vocabularies/discriminator/index.js
|
|
7991
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js
|
|
7759
7992
|
var require_discriminator = __commonJS((exports) => {
|
|
7760
7993
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7761
7994
|
var codegen_1 = require_codegen();
|
|
@@ -7857,7 +8090,7 @@ var require_discriminator = __commonJS((exports) => {
|
|
|
7857
8090
|
exports.default = def;
|
|
7858
8091
|
});
|
|
7859
8092
|
|
|
7860
|
-
// node_modules/ajv/dist/refs/json-schema-draft-07.json
|
|
8093
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-draft-07.json
|
|
7861
8094
|
var require_json_schema_draft_07 = __commonJS((exports, module) => {
|
|
7862
8095
|
module.exports = {
|
|
7863
8096
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
@@ -8012,7 +8245,7 @@ var require_json_schema_draft_07 = __commonJS((exports, module) => {
|
|
|
8012
8245
|
};
|
|
8013
8246
|
});
|
|
8014
8247
|
|
|
8015
|
-
// node_modules/ajv/dist/ajv.js
|
|
8248
|
+
// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/ajv.js
|
|
8016
8249
|
var require_ajv = __commonJS((exports, module) => {
|
|
8017
8250
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8018
8251
|
exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = undefined;
|
|
@@ -8080,7 +8313,7 @@ var require_ajv = __commonJS((exports, module) => {
|
|
|
8080
8313
|
} });
|
|
8081
8314
|
});
|
|
8082
8315
|
|
|
8083
|
-
// node_modules/ajv-formats/dist/formats.js
|
|
8316
|
+
// node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.20.0/node_modules/ajv-formats/dist/formats.js
|
|
8084
8317
|
var require_formats = __commonJS((exports) => {
|
|
8085
8318
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8086
8319
|
exports.formatNames = exports.fastFormats = exports.fullFormats = undefined;
|
|
@@ -8257,7 +8490,7 @@ var require_formats = __commonJS((exports) => {
|
|
|
8257
8490
|
}
|
|
8258
8491
|
});
|
|
8259
8492
|
|
|
8260
|
-
// node_modules/ajv-formats/dist/limit.js
|
|
8493
|
+
// node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.20.0/node_modules/ajv-formats/dist/limit.js
|
|
8261
8494
|
var require_limit = __commonJS((exports) => {
|
|
8262
8495
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8263
8496
|
exports.formatLimitDefinition = undefined;
|
|
@@ -8326,7 +8559,7 @@ var require_limit = __commonJS((exports) => {
|
|
|
8326
8559
|
exports.default = formatLimitPlugin;
|
|
8327
8560
|
});
|
|
8328
8561
|
|
|
8329
|
-
// node_modules/ajv-formats/dist/index.js
|
|
8562
|
+
// node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.20.0/node_modules/ajv-formats/dist/index.js
|
|
8330
8563
|
var require_dist = __commonJS((exports, module) => {
|
|
8331
8564
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8332
8565
|
var formats_1 = require_formats();
|
|
@@ -9529,7 +9762,7 @@ var init_cloud = __esm(() => {
|
|
|
9529
9762
|
init_database();
|
|
9530
9763
|
init_contacts();
|
|
9531
9764
|
import { existsSync as existsSync9 } from "fs";
|
|
9532
|
-
import { join as
|
|
9765
|
+
import { join as join9, resolve as resolve2, relative } from "path";
|
|
9533
9766
|
|
|
9534
9767
|
// src/db/companies.ts
|
|
9535
9768
|
init_types();
|
|
@@ -10355,8 +10588,8 @@ async function exportContacts(format, contacts) {
|
|
|
10355
10588
|
// src/lib/images.ts
|
|
10356
10589
|
init_database();
|
|
10357
10590
|
import { existsSync as existsSync3, mkdirSync as mkdirSync3, copyFileSync as copyFileSync2, unlinkSync, readdirSync as readdirSync2, readFileSync, writeFileSync } from "fs";
|
|
10358
|
-
import { join as
|
|
10359
|
-
var IMAGES_DIR =
|
|
10591
|
+
import { join as join3, extname, basename } from "path";
|
|
10592
|
+
var IMAGES_DIR = join3(getDataDir(), "images");
|
|
10360
10593
|
function ensureImagesDir() {
|
|
10361
10594
|
if (!existsSync3(IMAGES_DIR))
|
|
10362
10595
|
mkdirSync3(IMAGES_DIR, { recursive: true });
|
|
@@ -10373,14 +10606,14 @@ function saveImage(entityId, source, options) {
|
|
|
10373
10606
|
const ext2 = base64Match[1] === "jpeg" ? "jpg" : base64Match[1];
|
|
10374
10607
|
const data = Buffer.from(base64Match[2], "base64");
|
|
10375
10608
|
const filename2 = `${entityId}.${ext2}`;
|
|
10376
|
-
writeFileSync(
|
|
10609
|
+
writeFileSync(join3(IMAGES_DIR, filename2), data);
|
|
10377
10610
|
return filename2;
|
|
10378
10611
|
}
|
|
10379
10612
|
if (!existsSync3(source) && /^[A-Za-z0-9+/=\n\r]+$/.test(source.trim()) && source.length > 100) {
|
|
10380
10613
|
const ext2 = options?.format || "jpg";
|
|
10381
10614
|
const data = Buffer.from(source.trim(), "base64");
|
|
10382
10615
|
const filename2 = `${entityId}.${ext2}`;
|
|
10383
|
-
writeFileSync(
|
|
10616
|
+
writeFileSync(join3(IMAGES_DIR, filename2), data);
|
|
10384
10617
|
return filename2;
|
|
10385
10618
|
}
|
|
10386
10619
|
if (!existsSync3(source)) {
|
|
@@ -10392,14 +10625,14 @@ function saveImage(entityId, source, options) {
|
|
|
10392
10625
|
throw new Error(`Unsupported image format: ${ext}. Supported: ${validExts.join(", ")}`);
|
|
10393
10626
|
}
|
|
10394
10627
|
const filename = `${entityId}.${ext === "jpeg" ? "jpg" : ext}`;
|
|
10395
|
-
copyFileSync2(source,
|
|
10628
|
+
copyFileSync2(source, join3(IMAGES_DIR, filename));
|
|
10396
10629
|
return filename;
|
|
10397
10630
|
}
|
|
10398
10631
|
function getImagePath(entityId) {
|
|
10399
10632
|
ensureImagesDir();
|
|
10400
10633
|
const files = readdirSync2(IMAGES_DIR);
|
|
10401
10634
|
const match = files.find((f) => f.startsWith(`${entityId}.`));
|
|
10402
|
-
return match ?
|
|
10635
|
+
return match ? join3(IMAGES_DIR, match) : null;
|
|
10403
10636
|
}
|
|
10404
10637
|
function getImageAsBase64(entityId) {
|
|
10405
10638
|
const path = getImagePath(entityId);
|
|
@@ -10416,7 +10649,7 @@ function deleteImage(entityId) {
|
|
|
10416
10649
|
let deleted = false;
|
|
10417
10650
|
for (const f of files) {
|
|
10418
10651
|
if (f.startsWith(`${entityId}.`)) {
|
|
10419
|
-
unlinkSync(
|
|
10652
|
+
unlinkSync(join3(IMAGES_DIR, f));
|
|
10420
10653
|
deleted = true;
|
|
10421
10654
|
}
|
|
10422
10655
|
}
|
|
@@ -10428,20 +10661,31 @@ function listImages() {
|
|
|
10428
10661
|
return files.map((f) => ({
|
|
10429
10662
|
entity_id: basename(f, extname(f)),
|
|
10430
10663
|
filename: f,
|
|
10431
|
-
path:
|
|
10664
|
+
path: join3(IMAGES_DIR, f)
|
|
10432
10665
|
}));
|
|
10433
10666
|
}
|
|
10434
10667
|
|
|
10435
10668
|
// src/lib/vault.ts
|
|
10436
10669
|
init_database();
|
|
10437
10670
|
import { existsSync as existsSync4, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync4, unlinkSync as unlinkSync2 } from "fs";
|
|
10438
|
-
import { join as
|
|
10671
|
+
import { join as join4 } from "path";
|
|
10439
10672
|
import { createCipheriv, createDecipheriv, randomBytes, pbkdf2Sync, createHash as createHash2 } from "crypto";
|
|
10440
|
-
var VAULT_DIR = getDataDir();
|
|
10441
|
-
var VAULT_CONFIG = join3(VAULT_DIR, "vault.json");
|
|
10442
|
-
var VAULT_SESSION = join3(VAULT_DIR, ".vault-session");
|
|
10443
|
-
var DOCUMENTS_DIR = join3(VAULT_DIR, "documents");
|
|
10444
10673
|
var SESSION_TTL_MS = 30 * 60 * 1000;
|
|
10674
|
+
function getVaultDir() {
|
|
10675
|
+
return getDataDir();
|
|
10676
|
+
}
|
|
10677
|
+
function getVaultConfigPath() {
|
|
10678
|
+
return join4(getDataDir(), "vault.json");
|
|
10679
|
+
}
|
|
10680
|
+
function getVaultSessionPath() {
|
|
10681
|
+
return join4(getStateDir(), ".vault-session");
|
|
10682
|
+
}
|
|
10683
|
+
function getDocumentsDir() {
|
|
10684
|
+
const dir = join4(getDataDir(), "documents");
|
|
10685
|
+
if (!existsSync4(dir))
|
|
10686
|
+
mkdirSync4(dir, { recursive: true });
|
|
10687
|
+
return dir;
|
|
10688
|
+
}
|
|
10445
10689
|
var _derivedKey = null;
|
|
10446
10690
|
function deriveKey(passphrase, salt) {
|
|
10447
10691
|
return pbkdf2Sync(passphrase, salt, 1e5, 32, "sha512");
|
|
@@ -10451,16 +10695,17 @@ function saveSession(key) {
|
|
|
10451
10695
|
key: key.toString("hex"),
|
|
10452
10696
|
expires_at: new Date(Date.now() + SESSION_TTL_MS).toISOString()
|
|
10453
10697
|
};
|
|
10454
|
-
writeFileSync2(
|
|
10698
|
+
writeFileSync2(getVaultSessionPath(), JSON.stringify(session), { mode: 384 });
|
|
10455
10699
|
}
|
|
10456
10700
|
function loadSession() {
|
|
10457
|
-
|
|
10701
|
+
const sessionPath = getVaultSessionPath();
|
|
10702
|
+
if (!existsSync4(sessionPath))
|
|
10458
10703
|
return null;
|
|
10459
10704
|
try {
|
|
10460
|
-
const session = JSON.parse(readFileSync2(
|
|
10705
|
+
const session = JSON.parse(readFileSync2(sessionPath, "utf-8"));
|
|
10461
10706
|
if (new Date(session.expires_at).getTime() < Date.now()) {
|
|
10462
10707
|
try {
|
|
10463
|
-
unlinkSync2(
|
|
10708
|
+
unlinkSync2(sessionPath);
|
|
10464
10709
|
} catch {}
|
|
10465
10710
|
return null;
|
|
10466
10711
|
}
|
|
@@ -10471,30 +10716,30 @@ function loadSession() {
|
|
|
10471
10716
|
}
|
|
10472
10717
|
function clearSession() {
|
|
10473
10718
|
try {
|
|
10474
|
-
if (existsSync4(
|
|
10475
|
-
unlinkSync2(
|
|
10719
|
+
if (existsSync4(getVaultSessionPath()))
|
|
10720
|
+
unlinkSync2(getVaultSessionPath());
|
|
10476
10721
|
} catch {}
|
|
10477
10722
|
}
|
|
10478
10723
|
function initVault(passphrase) {
|
|
10479
|
-
|
|
10480
|
-
|
|
10481
|
-
|
|
10482
|
-
|
|
10724
|
+
const vaultDir = getVaultDir();
|
|
10725
|
+
if (!existsSync4(vaultDir))
|
|
10726
|
+
mkdirSync4(vaultDir, { recursive: true });
|
|
10727
|
+
mkdirSync4(getDocumentsDir(), { recursive: true });
|
|
10483
10728
|
const salt = randomBytes(32);
|
|
10484
10729
|
const key = deriveKey(passphrase, salt);
|
|
10485
10730
|
const keyHash = createHash2("sha256").update(key).digest("hex");
|
|
10486
10731
|
const config = { salt: salt.toString("hex"), key_hash: keyHash, created_at: new Date().toISOString() };
|
|
10487
|
-
writeFileSync2(
|
|
10732
|
+
writeFileSync2(getVaultConfigPath(), JSON.stringify(config, null, 2));
|
|
10488
10733
|
_derivedKey = key;
|
|
10489
10734
|
saveSession(key);
|
|
10490
10735
|
}
|
|
10491
10736
|
function isVaultInitialized() {
|
|
10492
|
-
return existsSync4(
|
|
10737
|
+
return existsSync4(getVaultConfigPath());
|
|
10493
10738
|
}
|
|
10494
10739
|
function unlockVault(passphrase) {
|
|
10495
|
-
if (!existsSync4(
|
|
10740
|
+
if (!existsSync4(getVaultConfigPath()))
|
|
10496
10741
|
throw new Error("Vault not initialized. Run 'contacts vault init' first.");
|
|
10497
|
-
const config = JSON.parse(readFileSync2(
|
|
10742
|
+
const config = JSON.parse(readFileSync2(getVaultConfigPath(), "utf-8"));
|
|
10498
10743
|
const salt = Buffer.from(config.salt, "hex");
|
|
10499
10744
|
const key = deriveKey(passphrase, salt);
|
|
10500
10745
|
const keyHash = createHash2("sha256").update(key).digest("hex");
|
|
@@ -10549,21 +10794,52 @@ function decrypt(ciphertext, iv) {
|
|
|
10549
10794
|
return decrypted;
|
|
10550
10795
|
}
|
|
10551
10796
|
function storeFile(sourcePath, entityId) {
|
|
10552
|
-
|
|
10553
|
-
|
|
10797
|
+
const documentsDir = getDocumentsDir();
|
|
10798
|
+
if (!existsSync4(documentsDir))
|
|
10799
|
+
mkdirSync4(documentsDir, { recursive: true });
|
|
10554
10800
|
const ext = sourcePath.split(".").pop() || "bin";
|
|
10555
|
-
const destPath =
|
|
10801
|
+
const destPath = join4(documentsDir, `${entityId}.${ext}`);
|
|
10556
10802
|
const data = readFileSync2(sourcePath);
|
|
10557
10803
|
writeFileSync2(destPath, data);
|
|
10558
10804
|
return destPath;
|
|
10559
10805
|
}
|
|
10560
|
-
|
|
10561
|
-
|
|
10562
|
-
|
|
10563
|
-
|
|
10806
|
+
|
|
10807
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.js
|
|
10808
|
+
var import_content_type = __toESM(require_content_type(), 1);
|
|
10809
|
+
function mediaTypeEssence(header) {
|
|
10810
|
+
if (!header) {
|
|
10811
|
+
return;
|
|
10812
|
+
}
|
|
10813
|
+
try {
|
|
10814
|
+
return import_content_type.default.parse(header).type;
|
|
10815
|
+
} catch {
|
|
10816
|
+
const essence = (header.split(";", 1)[0] ?? "").trim().toLowerCase();
|
|
10817
|
+
if (essence === "" || header.slice(essence.length).includes(",")) {
|
|
10818
|
+
return;
|
|
10819
|
+
}
|
|
10820
|
+
return essence;
|
|
10821
|
+
}
|
|
10822
|
+
}
|
|
10823
|
+
function isJsonContentType(header) {
|
|
10824
|
+
if (header === "application/json") {
|
|
10825
|
+
return true;
|
|
10826
|
+
}
|
|
10827
|
+
return mediaTypeEssence(header) === "application/json";
|
|
10828
|
+
}
|
|
10829
|
+
|
|
10830
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sseKeepAlive.js
|
|
10831
|
+
var DEFAULT_SSE_KEEP_ALIVE_MS = 15000;
|
|
10832
|
+
var MAX_TIMER_DELAY_MS = 2 ** 31 - 1;
|
|
10833
|
+
function armSseKeepAlive(intervalMs, onTick) {
|
|
10834
|
+
if (!Number.isFinite(intervalMs) || intervalMs < 1) {
|
|
10835
|
+
return;
|
|
10836
|
+
}
|
|
10837
|
+
const timer = setInterval(onTick, Math.min(intervalMs, MAX_TIMER_DELAY_MS));
|
|
10838
|
+
timer.unref?.();
|
|
10839
|
+
return timer;
|
|
10564
10840
|
}
|
|
10565
10841
|
|
|
10566
|
-
// node_modules/zod/v4/core/core.js
|
|
10842
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/core.js
|
|
10567
10843
|
var NEVER = Object.freeze({
|
|
10568
10844
|
status: "aborted"
|
|
10569
10845
|
});
|
|
@@ -10623,7 +10899,7 @@ function config(newConfig) {
|
|
|
10623
10899
|
Object.assign(globalConfig, newConfig);
|
|
10624
10900
|
return globalConfig;
|
|
10625
10901
|
}
|
|
10626
|
-
// node_modules/zod/v4/core/util.js
|
|
10902
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/util.js
|
|
10627
10903
|
var exports_util = {};
|
|
10628
10904
|
__export(exports_util, {
|
|
10629
10905
|
unwrapMessage: () => unwrapMessage,
|
|
@@ -11137,7 +11413,7 @@ class Class {
|
|
|
11137
11413
|
constructor(..._args) {}
|
|
11138
11414
|
}
|
|
11139
11415
|
|
|
11140
|
-
// node_modules/zod/v4/core/errors.js
|
|
11416
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/errors.js
|
|
11141
11417
|
var initializer = (inst, def) => {
|
|
11142
11418
|
inst.name = "$ZodError";
|
|
11143
11419
|
Object.defineProperty(inst, "_zod", {
|
|
@@ -11211,7 +11487,7 @@ function formatError(error, _mapper) {
|
|
|
11211
11487
|
return fieldErrors;
|
|
11212
11488
|
}
|
|
11213
11489
|
|
|
11214
|
-
// node_modules/zod/v4/core/parse.js
|
|
11490
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/parse.js
|
|
11215
11491
|
var _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
11216
11492
|
const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
|
|
11217
11493
|
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
@@ -11262,7 +11538,7 @@ var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
11262
11538
|
} : { success: true, data: result.value };
|
|
11263
11539
|
};
|
|
11264
11540
|
var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
11265
|
-
// node_modules/zod/v4/core/regexes.js
|
|
11541
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/regexes.js
|
|
11266
11542
|
var cuid = /^[cC][^\s-]{8,}$/;
|
|
11267
11543
|
var cuid2 = /^[0-9a-z]+$/;
|
|
11268
11544
|
var ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
|
|
@@ -11320,7 +11596,7 @@ var _null = /null/i;
|
|
|
11320
11596
|
var lowercase = /^[^A-Z]*$/;
|
|
11321
11597
|
var uppercase = /^[^a-z]*$/;
|
|
11322
11598
|
|
|
11323
|
-
// node_modules/zod/v4/core/checks.js
|
|
11599
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/checks.js
|
|
11324
11600
|
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
11325
11601
|
var _a;
|
|
11326
11602
|
inst._zod ?? (inst._zod = {});
|
|
@@ -11704,7 +11980,7 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
|
|
|
11704
11980
|
};
|
|
11705
11981
|
});
|
|
11706
11982
|
|
|
11707
|
-
// node_modules/zod/v4/core/doc.js
|
|
11983
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/doc.js
|
|
11708
11984
|
class Doc {
|
|
11709
11985
|
constructor(args = []) {
|
|
11710
11986
|
this.content = [];
|
|
@@ -11742,14 +12018,14 @@ class Doc {
|
|
|
11742
12018
|
}
|
|
11743
12019
|
}
|
|
11744
12020
|
|
|
11745
|
-
// node_modules/zod/v4/core/versions.js
|
|
12021
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/versions.js
|
|
11746
12022
|
var version = {
|
|
11747
12023
|
major: 4,
|
|
11748
12024
|
minor: 0,
|
|
11749
12025
|
patch: 0
|
|
11750
12026
|
};
|
|
11751
12027
|
|
|
11752
|
-
// node_modules/zod/v4/core/schemas.js
|
|
12028
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/schemas.js
|
|
11753
12029
|
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
11754
12030
|
var _a;
|
|
11755
12031
|
inst ?? (inst = {});
|
|
@@ -12980,7 +13256,7 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
12980
13256
|
payload.issues.push(issue(_iss));
|
|
12981
13257
|
}
|
|
12982
13258
|
}
|
|
12983
|
-
// node_modules/zod/v4/locales/en.js
|
|
13259
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/locales/en.js
|
|
12984
13260
|
var parsedType = (data) => {
|
|
12985
13261
|
const t = typeof data;
|
|
12986
13262
|
switch (t) {
|
|
@@ -13097,7 +13373,7 @@ function en_default() {
|
|
|
13097
13373
|
localeError: error()
|
|
13098
13374
|
};
|
|
13099
13375
|
}
|
|
13100
|
-
// node_modules/zod/v4/core/registries.js
|
|
13376
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/registries.js
|
|
13101
13377
|
var $output = Symbol("ZodOutput");
|
|
13102
13378
|
var $input = Symbol("ZodInput");
|
|
13103
13379
|
|
|
@@ -13147,7 +13423,7 @@ function registry() {
|
|
|
13147
13423
|
return new $ZodRegistry;
|
|
13148
13424
|
}
|
|
13149
13425
|
var globalRegistry = /* @__PURE__ */ registry();
|
|
13150
|
-
// node_modules/zod/v4/core/api.js
|
|
13426
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/api.js
|
|
13151
13427
|
function _string(Class2, params) {
|
|
13152
13428
|
return new Class2({
|
|
13153
13429
|
type: "string",
|
|
@@ -13582,7 +13858,7 @@ function _refine(Class2, fn, _params) {
|
|
|
13582
13858
|
});
|
|
13583
13859
|
return schema;
|
|
13584
13860
|
}
|
|
13585
|
-
// node_modules/zod/v4/core/to-json-schema.js
|
|
13861
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/to-json-schema.js
|
|
13586
13862
|
class JSONSchemaGenerator {
|
|
13587
13863
|
constructor(params) {
|
|
13588
13864
|
this.counter = 0;
|
|
@@ -14334,7 +14610,7 @@ function isTransforming(_schema, _ctx) {
|
|
|
14334
14610
|
}
|
|
14335
14611
|
throw new Error(`Unknown schema type: ${def.type}`);
|
|
14336
14612
|
}
|
|
14337
|
-
// node_modules/zod/v4/classic/iso.js
|
|
14613
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/iso.js
|
|
14338
14614
|
var exports_iso = {};
|
|
14339
14615
|
__export(exports_iso, {
|
|
14340
14616
|
time: () => time2,
|
|
@@ -14375,7 +14651,7 @@ function duration2(params) {
|
|
|
14375
14651
|
return _isoDuration(ZodISODuration, params);
|
|
14376
14652
|
}
|
|
14377
14653
|
|
|
14378
|
-
// node_modules/zod/v4/classic/errors.js
|
|
14654
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/errors.js
|
|
14379
14655
|
var initializer2 = (inst, issues) => {
|
|
14380
14656
|
$ZodError.init(inst, issues);
|
|
14381
14657
|
inst.name = "ZodError";
|
|
@@ -14404,13 +14680,13 @@ var ZodRealError = $constructor("ZodError", initializer2, {
|
|
|
14404
14680
|
Parent: Error
|
|
14405
14681
|
});
|
|
14406
14682
|
|
|
14407
|
-
// node_modules/zod/v4/classic/parse.js
|
|
14683
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/parse.js
|
|
14408
14684
|
var parse3 = /* @__PURE__ */ _parse(ZodRealError);
|
|
14409
14685
|
var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
14410
14686
|
var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
14411
14687
|
var safeParseAsync2 = /* @__PURE__ */ _safeParseAsync(ZodRealError);
|
|
14412
14688
|
|
|
14413
|
-
// node_modules/zod/v4/classic/schemas.js
|
|
14689
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/schemas.js
|
|
14414
14690
|
var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
14415
14691
|
$ZodType.init(inst, def);
|
|
14416
14692
|
inst.def = def;
|
|
@@ -15015,10 +15291,10 @@ function superRefine(fn) {
|
|
|
15015
15291
|
function preprocess(fn, schema) {
|
|
15016
15292
|
return pipe(transform(fn), schema);
|
|
15017
15293
|
}
|
|
15018
|
-
// node_modules/zod/v4/classic/external.js
|
|
15294
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/external.js
|
|
15019
15295
|
config(en_default());
|
|
15020
15296
|
|
|
15021
|
-
// node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
15297
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
15022
15298
|
var LATEST_PROTOCOL_VERSION = "2025-11-25";
|
|
15023
15299
|
var DEFAULT_NEGOTIATED_PROTOCOL_VERSION = "2025-03-26";
|
|
15024
15300
|
var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
|
|
@@ -15028,7 +15304,7 @@ var AssertObjectSchema = custom((v) => v !== null && (typeof v === "object" || t
|
|
|
15028
15304
|
var ProgressTokenSchema = union([string2(), number2().int()]);
|
|
15029
15305
|
var CursorSchema = string2();
|
|
15030
15306
|
var TaskCreationParamsSchema = looseObject({
|
|
15031
|
-
ttl:
|
|
15307
|
+
ttl: number2().optional(),
|
|
15032
15308
|
pollInterval: number2().optional()
|
|
15033
15309
|
});
|
|
15034
15310
|
var TaskMetadataSchema = object({
|
|
@@ -15182,7 +15458,8 @@ var ClientCapabilitiesSchema = object({
|
|
|
15182
15458
|
roots: object({
|
|
15183
15459
|
listChanged: boolean2().optional()
|
|
15184
15460
|
}).optional(),
|
|
15185
|
-
tasks: ClientTasksCapabilitySchema.optional()
|
|
15461
|
+
tasks: ClientTasksCapabilitySchema.optional(),
|
|
15462
|
+
extensions: record(string2(), AssertObjectSchema).optional()
|
|
15186
15463
|
});
|
|
15187
15464
|
var InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
15188
15465
|
protocolVersion: string2(),
|
|
@@ -15208,7 +15485,8 @@ var ServerCapabilitiesSchema = object({
|
|
|
15208
15485
|
tools: object({
|
|
15209
15486
|
listChanged: boolean2().optional()
|
|
15210
15487
|
}).optional(),
|
|
15211
|
-
tasks: ServerTasksCapabilitySchema.optional()
|
|
15488
|
+
tasks: ServerTasksCapabilitySchema.optional(),
|
|
15489
|
+
extensions: record(string2(), AssertObjectSchema).optional()
|
|
15212
15490
|
});
|
|
15213
15491
|
var InitializeResultSchema = ResultSchema.extend({
|
|
15214
15492
|
protocolVersion: string2(),
|
|
@@ -15323,6 +15601,7 @@ var ResourceSchema = object({
|
|
|
15323
15601
|
uri: string2(),
|
|
15324
15602
|
description: optional(string2()),
|
|
15325
15603
|
mimeType: optional(string2()),
|
|
15604
|
+
size: optional(number2()),
|
|
15326
15605
|
annotations: AnnotationsSchema.optional(),
|
|
15327
15606
|
_meta: optional(looseObject({}))
|
|
15328
15607
|
});
|
|
@@ -15862,17 +16141,19 @@ class UrlElicitationRequiredError extends McpError {
|
|
|
15862
16141
|
}
|
|
15863
16142
|
}
|
|
15864
16143
|
|
|
15865
|
-
// node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js
|
|
16144
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js
|
|
15866
16145
|
class WebStandardStreamableHTTPServerTransport {
|
|
15867
16146
|
constructor(options = {}) {
|
|
15868
16147
|
this._started = false;
|
|
15869
16148
|
this._hasHandledRequest = false;
|
|
15870
16149
|
this._streamMapping = new Map;
|
|
15871
16150
|
this._requestToStreamMapping = new Map;
|
|
16151
|
+
this._resumableStreams = new Set;
|
|
15872
16152
|
this._requestResponseMap = new Map;
|
|
15873
16153
|
this._initialized = false;
|
|
15874
16154
|
this._enableJsonResponse = false;
|
|
15875
16155
|
this._standaloneSseStreamId = "_GET_stream";
|
|
16156
|
+
this._closed = false;
|
|
15876
16157
|
this.sessionIdGenerator = options.sessionIdGenerator;
|
|
15877
16158
|
this._enableJsonResponse = options.enableJsonResponse ?? false;
|
|
15878
16159
|
this._eventStore = options.eventStore;
|
|
@@ -15882,6 +16163,22 @@ class WebStandardStreamableHTTPServerTransport {
|
|
|
15882
16163
|
this._allowedOrigins = options.allowedOrigins;
|
|
15883
16164
|
this._enableDnsRebindingProtection = options.enableDnsRebindingProtection ?? false;
|
|
15884
16165
|
this._retryInterval = options.retryInterval;
|
|
16166
|
+
this._keepAliveMs = options.keepAliveMs ?? DEFAULT_SSE_KEEP_ALIVE_MS;
|
|
16167
|
+
}
|
|
16168
|
+
startKeepAlive(controller, encoder) {
|
|
16169
|
+
if (this._closed)
|
|
16170
|
+
return;
|
|
16171
|
+
const timer = armSseKeepAlive(this._keepAliveMs, () => {
|
|
16172
|
+
try {
|
|
16173
|
+
controller.enqueue(encoder.encode(`: keepalive
|
|
16174
|
+
|
|
16175
|
+
`));
|
|
16176
|
+
} catch {
|
|
16177
|
+
if (timer !== undefined)
|
|
16178
|
+
clearInterval(timer);
|
|
16179
|
+
}
|
|
16180
|
+
});
|
|
16181
|
+
return timer;
|
|
15885
16182
|
}
|
|
15886
16183
|
async start() {
|
|
15887
16184
|
if (this._started) {
|
|
@@ -15929,6 +16226,9 @@ class WebStandardStreamableHTTPServerTransport {
|
|
|
15929
16226
|
return;
|
|
15930
16227
|
}
|
|
15931
16228
|
async handleRequest(req, options) {
|
|
16229
|
+
if (this._closed) {
|
|
16230
|
+
return this.createJsonErrorResponse(404, -32001, "Session not found");
|
|
16231
|
+
}
|
|
15932
16232
|
if (!this.sessionIdGenerator && this._hasHandledRequest) {
|
|
15933
16233
|
throw new Error("Stateless transport cannot be reused across requests. Create a new transport per request.");
|
|
15934
16234
|
}
|
|
@@ -15968,6 +16268,7 @@ data:
|
|
|
15968
16268
|
`;
|
|
15969
16269
|
}
|
|
15970
16270
|
controller.enqueue(encoder.encode(primingEvent));
|
|
16271
|
+
this._resumableStreams.add(streamId);
|
|
15971
16272
|
}
|
|
15972
16273
|
async handleGetRequest(req) {
|
|
15973
16274
|
const acceptHeader = req.headers.get("accept");
|
|
@@ -15995,18 +16296,25 @@ data:
|
|
|
15995
16296
|
}
|
|
15996
16297
|
const encoder = new TextEncoder;
|
|
15997
16298
|
let streamController;
|
|
16299
|
+
let keepAliveTimer = undefined;
|
|
15998
16300
|
const readable = new ReadableStream({
|
|
15999
16301
|
start: (controller) => {
|
|
16000
16302
|
streamController = controller;
|
|
16001
16303
|
},
|
|
16002
16304
|
cancel: () => {
|
|
16003
|
-
|
|
16305
|
+
if (keepAliveTimer !== undefined) {
|
|
16306
|
+
clearInterval(keepAliveTimer);
|
|
16307
|
+
}
|
|
16308
|
+
if (this._streamMapping.get(this._standaloneSseStreamId)?.controller === streamController) {
|
|
16309
|
+
this._streamMapping.delete(this._standaloneSseStreamId);
|
|
16310
|
+
}
|
|
16004
16311
|
}
|
|
16005
16312
|
});
|
|
16006
16313
|
const headers = {
|
|
16007
16314
|
"Content-Type": "text/event-stream",
|
|
16008
16315
|
"Cache-Control": "no-cache, no-transform",
|
|
16009
|
-
Connection: "keep-alive"
|
|
16316
|
+
Connection: "keep-alive",
|
|
16317
|
+
"X-Accel-Buffering": "no"
|
|
16010
16318
|
};
|
|
16011
16319
|
if (this.sessionId !== undefined) {
|
|
16012
16320
|
headers["mcp-session-id"] = this.sessionId;
|
|
@@ -16015,12 +16323,16 @@ data:
|
|
|
16015
16323
|
controller: streamController,
|
|
16016
16324
|
encoder,
|
|
16017
16325
|
cleanup: () => {
|
|
16326
|
+
if (keepAliveTimer !== undefined) {
|
|
16327
|
+
clearInterval(keepAliveTimer);
|
|
16328
|
+
}
|
|
16018
16329
|
this._streamMapping.delete(this._standaloneSseStreamId);
|
|
16019
16330
|
try {
|
|
16020
16331
|
streamController.close();
|
|
16021
16332
|
} catch {}
|
|
16022
16333
|
}
|
|
16023
16334
|
});
|
|
16335
|
+
keepAliveTimer = this.startKeepAlive(streamController, encoder);
|
|
16024
16336
|
return new Response(readable, { headers });
|
|
16025
16337
|
}
|
|
16026
16338
|
async replayEvents(lastEventId) {
|
|
@@ -16044,20 +16356,33 @@ data:
|
|
|
16044
16356
|
const headers = {
|
|
16045
16357
|
"Content-Type": "text/event-stream",
|
|
16046
16358
|
"Cache-Control": "no-cache, no-transform",
|
|
16047
|
-
Connection: "keep-alive"
|
|
16359
|
+
Connection: "keep-alive",
|
|
16360
|
+
"X-Accel-Buffering": "no"
|
|
16048
16361
|
};
|
|
16049
16362
|
if (this.sessionId !== undefined) {
|
|
16050
16363
|
headers["mcp-session-id"] = this.sessionId;
|
|
16051
16364
|
}
|
|
16052
16365
|
const encoder = new TextEncoder;
|
|
16053
16366
|
let streamController;
|
|
16367
|
+
let keepAliveTimer = undefined;
|
|
16368
|
+
let replayedStreamId = undefined;
|
|
16369
|
+
let cancelled = false;
|
|
16054
16370
|
const readable = new ReadableStream({
|
|
16055
16371
|
start: (controller) => {
|
|
16056
16372
|
streamController = controller;
|
|
16057
16373
|
},
|
|
16058
|
-
cancel: () => {
|
|
16374
|
+
cancel: () => {
|
|
16375
|
+
cancelled = true;
|
|
16376
|
+
if (keepAliveTimer !== undefined) {
|
|
16377
|
+
clearInterval(keepAliveTimer);
|
|
16378
|
+
}
|
|
16379
|
+
if (replayedStreamId !== undefined && this._streamMapping.get(replayedStreamId)?.controller === streamController) {
|
|
16380
|
+
this._streamMapping.delete(replayedStreamId);
|
|
16381
|
+
}
|
|
16382
|
+
}
|
|
16059
16383
|
});
|
|
16060
|
-
const
|
|
16384
|
+
const replayedEventIds = new Set;
|
|
16385
|
+
replayedStreamId = await this._eventStore.replayEventsAfter(lastEventId, {
|
|
16061
16386
|
send: async (eventId, message) => {
|
|
16062
16387
|
const success = this.writeSSEEvent(streamController, encoder, message, eventId);
|
|
16063
16388
|
if (!success) {
|
|
@@ -16065,19 +16390,34 @@ data:
|
|
|
16065
16390
|
try {
|
|
16066
16391
|
streamController.close();
|
|
16067
16392
|
} catch {}
|
|
16393
|
+
} else {
|
|
16394
|
+
replayedEventIds.add(eventId);
|
|
16068
16395
|
}
|
|
16069
16396
|
}
|
|
16070
16397
|
});
|
|
16398
|
+
if (this._closed || cancelled) {
|
|
16399
|
+
try {
|
|
16400
|
+
streamController.close();
|
|
16401
|
+
} catch {}
|
|
16402
|
+
return this.createJsonErrorResponse(404, -32001, "Session not found");
|
|
16403
|
+
}
|
|
16404
|
+
this._streamMapping.get(replayedStreamId)?.cleanup();
|
|
16071
16405
|
this._streamMapping.set(replayedStreamId, {
|
|
16072
16406
|
controller: streamController,
|
|
16073
16407
|
encoder,
|
|
16408
|
+
replayedEventIds,
|
|
16074
16409
|
cleanup: () => {
|
|
16410
|
+
if (keepAliveTimer !== undefined) {
|
|
16411
|
+
clearInterval(keepAliveTimer);
|
|
16412
|
+
}
|
|
16075
16413
|
this._streamMapping.delete(replayedStreamId);
|
|
16076
16414
|
try {
|
|
16077
16415
|
streamController.close();
|
|
16078
16416
|
} catch {}
|
|
16079
16417
|
}
|
|
16080
16418
|
});
|
|
16419
|
+
this._resumableStreams.add(replayedStreamId);
|
|
16420
|
+
keepAliveTimer = this.startKeepAlive(streamController, encoder);
|
|
16081
16421
|
return new Response(readable, { headers });
|
|
16082
16422
|
} catch (error2) {
|
|
16083
16423
|
this.onerror?.(error2);
|
|
@@ -16127,7 +16467,7 @@ data:
|
|
|
16127
16467
|
return this.createJsonErrorResponse(406, -32000, "Not Acceptable: Client must accept both application/json and text/event-stream");
|
|
16128
16468
|
}
|
|
16129
16469
|
const ct = req.headers.get("content-type");
|
|
16130
|
-
if (!ct
|
|
16470
|
+
if (!isJsonContentType(ct)) {
|
|
16131
16471
|
this.onerror?.(new Error("Unsupported Media Type: Content-Type must be application/json"));
|
|
16132
16472
|
return this.createJsonErrorResponse(415, -32000, "Unsupported Media Type: Content-Type must be application/json");
|
|
16133
16473
|
}
|
|
@@ -16157,6 +16497,9 @@ data:
|
|
|
16157
16497
|
this.onerror?.(new Error("Parse error: Invalid JSON-RPC message"));
|
|
16158
16498
|
return this.createJsonErrorResponse(400, -32700, "Parse error: Invalid JSON-RPC message");
|
|
16159
16499
|
}
|
|
16500
|
+
if (this._closed) {
|
|
16501
|
+
return this.createJsonErrorResponse(404, -32001, "Session not found");
|
|
16502
|
+
}
|
|
16160
16503
|
const isInitializationRequest = messages.some(isInitializeRequest);
|
|
16161
16504
|
if (isInitializationRequest) {
|
|
16162
16505
|
if (this._initialized && this.sessionId !== undefined) {
|
|
@@ -16183,6 +16526,9 @@ data:
|
|
|
16183
16526
|
return protocolError;
|
|
16184
16527
|
}
|
|
16185
16528
|
}
|
|
16529
|
+
if (this._closed) {
|
|
16530
|
+
return this.createJsonErrorResponse(404, -32001, "Session not found");
|
|
16531
|
+
}
|
|
16186
16532
|
const hasRequests = messages.some(isJSONRPCRequest);
|
|
16187
16533
|
if (!hasRequests) {
|
|
16188
16534
|
for (const message of messages) {
|
|
@@ -16213,18 +16559,25 @@ data:
|
|
|
16213
16559
|
}
|
|
16214
16560
|
const encoder = new TextEncoder;
|
|
16215
16561
|
let streamController;
|
|
16562
|
+
let keepAliveTimer = undefined;
|
|
16216
16563
|
const readable = new ReadableStream({
|
|
16217
16564
|
start: (controller) => {
|
|
16218
16565
|
streamController = controller;
|
|
16219
16566
|
},
|
|
16220
16567
|
cancel: () => {
|
|
16221
|
-
|
|
16568
|
+
if (keepAliveTimer !== undefined) {
|
|
16569
|
+
clearInterval(keepAliveTimer);
|
|
16570
|
+
}
|
|
16571
|
+
if (this._streamMapping.get(streamId)?.controller === streamController) {
|
|
16572
|
+
this._streamMapping.delete(streamId);
|
|
16573
|
+
}
|
|
16222
16574
|
}
|
|
16223
16575
|
});
|
|
16224
16576
|
const headers = {
|
|
16225
16577
|
"Content-Type": "text/event-stream",
|
|
16226
|
-
"Cache-Control": "no-cache",
|
|
16227
|
-
Connection: "keep-alive"
|
|
16578
|
+
"Cache-Control": "no-cache, no-transform",
|
|
16579
|
+
Connection: "keep-alive",
|
|
16580
|
+
"X-Accel-Buffering": "no"
|
|
16228
16581
|
};
|
|
16229
16582
|
if (this.sessionId !== undefined) {
|
|
16230
16583
|
headers["mcp-session-id"] = this.sessionId;
|
|
@@ -16235,6 +16588,9 @@ data:
|
|
|
16235
16588
|
controller: streamController,
|
|
16236
16589
|
encoder,
|
|
16237
16590
|
cleanup: () => {
|
|
16591
|
+
if (keepAliveTimer !== undefined) {
|
|
16592
|
+
clearInterval(keepAliveTimer);
|
|
16593
|
+
}
|
|
16238
16594
|
this._streamMapping.delete(streamId);
|
|
16239
16595
|
try {
|
|
16240
16596
|
streamController.close();
|
|
@@ -16244,19 +16600,33 @@ data:
|
|
|
16244
16600
|
this._requestToStreamMapping.set(message.id, streamId);
|
|
16245
16601
|
}
|
|
16246
16602
|
}
|
|
16247
|
-
|
|
16248
|
-
|
|
16249
|
-
|
|
16250
|
-
|
|
16251
|
-
|
|
16252
|
-
|
|
16253
|
-
|
|
16254
|
-
|
|
16255
|
-
|
|
16256
|
-
|
|
16257
|
-
|
|
16603
|
+
try {
|
|
16604
|
+
await this.writePrimingEvent(streamController, encoder, streamId, clientProtocolVersion);
|
|
16605
|
+
for (const message of messages) {
|
|
16606
|
+
let closeSSEStream;
|
|
16607
|
+
let closeStandaloneSSEStream;
|
|
16608
|
+
if (isJSONRPCRequest(message) && this._eventStore && clientProtocolVersion >= "2025-11-25") {
|
|
16609
|
+
closeSSEStream = () => {
|
|
16610
|
+
this.closeSSEStream(message.id);
|
|
16611
|
+
};
|
|
16612
|
+
closeStandaloneSSEStream = () => {
|
|
16613
|
+
this.closeStandaloneSSEStream();
|
|
16614
|
+
};
|
|
16615
|
+
}
|
|
16616
|
+
this.onmessage?.(message, { authInfo: options?.authInfo, requestInfo, closeSSEStream, closeStandaloneSSEStream });
|
|
16258
16617
|
}
|
|
16259
|
-
|
|
16618
|
+
} catch (error2) {
|
|
16619
|
+
this._streamMapping.get(streamId)?.cleanup();
|
|
16620
|
+
this._resumableStreams.delete(streamId);
|
|
16621
|
+
for (const message of messages) {
|
|
16622
|
+
if (isJSONRPCRequest(message)) {
|
|
16623
|
+
this._requestToStreamMapping.delete(message.id);
|
|
16624
|
+
}
|
|
16625
|
+
}
|
|
16626
|
+
throw error2;
|
|
16627
|
+
}
|
|
16628
|
+
if (this._streamMapping.get(streamId)?.controller === streamController) {
|
|
16629
|
+
keepAliveTimer = this.startKeepAlive(streamController, encoder);
|
|
16260
16630
|
}
|
|
16261
16631
|
return new Response(readable, { status: 200, headers });
|
|
16262
16632
|
} catch (error2) {
|
|
@@ -16273,9 +16643,12 @@ data:
|
|
|
16273
16643
|
if (protocolError) {
|
|
16274
16644
|
return protocolError;
|
|
16275
16645
|
}
|
|
16276
|
-
|
|
16277
|
-
|
|
16278
|
-
|
|
16646
|
+
try {
|
|
16647
|
+
await Promise.resolve(this._onsessionclosed?.(this.sessionId));
|
|
16648
|
+
return new Response(null, { status: 200 });
|
|
16649
|
+
} finally {
|
|
16650
|
+
await this.close();
|
|
16651
|
+
}
|
|
16279
16652
|
}
|
|
16280
16653
|
validateSession(req) {
|
|
16281
16654
|
if (this.sessionIdGenerator === undefined) {
|
|
@@ -16305,11 +16678,16 @@ data:
|
|
|
16305
16678
|
return;
|
|
16306
16679
|
}
|
|
16307
16680
|
async close() {
|
|
16681
|
+
if (this._closed) {
|
|
16682
|
+
return;
|
|
16683
|
+
}
|
|
16684
|
+
this._closed = true;
|
|
16308
16685
|
this._streamMapping.forEach(({ cleanup }) => {
|
|
16309
16686
|
cleanup();
|
|
16310
16687
|
});
|
|
16311
16688
|
this._streamMapping.clear();
|
|
16312
16689
|
this._requestResponseMap.clear();
|
|
16690
|
+
this._resumableStreams.clear();
|
|
16313
16691
|
this.onclose?.();
|
|
16314
16692
|
}
|
|
16315
16693
|
closeSSEStream(requestId) {
|
|
@@ -16344,7 +16722,7 @@ data:
|
|
|
16344
16722
|
if (standaloneSse === undefined) {
|
|
16345
16723
|
return;
|
|
16346
16724
|
}
|
|
16347
|
-
if (standaloneSse.controller && standaloneSse.encoder) {
|
|
16725
|
+
if (standaloneSse.controller && standaloneSse.encoder && (eventId === undefined || !standaloneSse.replayedEventIds?.has(eventId))) {
|
|
16348
16726
|
this.writeSSEEvent(standaloneSse.controller, standaloneSse.encoder, message, eventId);
|
|
16349
16727
|
}
|
|
16350
16728
|
return;
|
|
@@ -16353,13 +16731,19 @@ data:
|
|
|
16353
16731
|
if (!streamId) {
|
|
16354
16732
|
throw new Error(`No connection established for request ID: ${String(requestId)}`);
|
|
16355
16733
|
}
|
|
16356
|
-
|
|
16357
|
-
if (!this._enableJsonResponse
|
|
16734
|
+
let stream = this._streamMapping.get(streamId);
|
|
16735
|
+
if (!this._enableJsonResponse) {
|
|
16358
16736
|
let eventId;
|
|
16359
16737
|
if (this._eventStore) {
|
|
16360
16738
|
eventId = await this._eventStore.storeEvent(streamId, message);
|
|
16739
|
+
stream = this._streamMapping.get(streamId);
|
|
16740
|
+
}
|
|
16741
|
+
if (stream?.controller && stream?.encoder && (eventId === undefined || !stream.replayedEventIds?.has(eventId))) {
|
|
16742
|
+
const written = this.writeSSEEvent(stream.controller, stream.encoder, message, eventId);
|
|
16743
|
+
if (written && eventId !== undefined) {
|
|
16744
|
+
this._resumableStreams.add(streamId);
|
|
16745
|
+
}
|
|
16361
16746
|
}
|
|
16362
|
-
this.writeSSEEvent(stream.controller, stream.encoder, message, eventId);
|
|
16363
16747
|
}
|
|
16364
16748
|
if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {
|
|
16365
16749
|
this._requestResponseMap.set(requestId, message);
|
|
@@ -16367,6 +16751,25 @@ data:
|
|
|
16367
16751
|
const allResponsesReady = relatedIds.every((id) => this._requestResponseMap.has(id));
|
|
16368
16752
|
if (allResponsesReady) {
|
|
16369
16753
|
if (!stream) {
|
|
16754
|
+
if (this._closed) {
|
|
16755
|
+
for (const id of relatedIds) {
|
|
16756
|
+
this._requestResponseMap.delete(id);
|
|
16757
|
+
this._requestToStreamMapping.delete(id);
|
|
16758
|
+
}
|
|
16759
|
+
return;
|
|
16760
|
+
}
|
|
16761
|
+
if (!this._enableJsonResponse && this._eventStore && this._resumableStreams.has(streamId)) {
|
|
16762
|
+
for (const id of relatedIds) {
|
|
16763
|
+
this._requestResponseMap.delete(id);
|
|
16764
|
+
this._requestToStreamMapping.delete(id);
|
|
16765
|
+
}
|
|
16766
|
+
this._resumableStreams.delete(streamId);
|
|
16767
|
+
return;
|
|
16768
|
+
}
|
|
16769
|
+
for (const id of relatedIds) {
|
|
16770
|
+
this._requestResponseMap.delete(id);
|
|
16771
|
+
this._requestToStreamMapping.delete(id);
|
|
16772
|
+
}
|
|
16370
16773
|
throw new Error(`No connection established for request ID: ${String(requestId)}`);
|
|
16371
16774
|
}
|
|
16372
16775
|
if (this._enableJsonResponse && stream.resolveJson) {
|
|
@@ -16389,6 +16792,7 @@ data:
|
|
|
16389
16792
|
this._requestResponseMap.delete(id);
|
|
16390
16793
|
this._requestToStreamMapping.delete(id);
|
|
16391
16794
|
}
|
|
16795
|
+
this._resumableStreams.delete(streamId);
|
|
16392
16796
|
}
|
|
16393
16797
|
}
|
|
16394
16798
|
}
|
|
@@ -16444,9 +16848,9 @@ function startMcpHttpServer(options) {
|
|
|
16444
16848
|
|
|
16445
16849
|
// src/mcp/index.ts
|
|
16446
16850
|
import { readFileSync as readFileSync5 } from "fs";
|
|
16447
|
-
import { join as
|
|
16851
|
+
import { join as join7 } from "path";
|
|
16448
16852
|
|
|
16449
|
-
// node_modules/zod/v3/external.js
|
|
16853
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js
|
|
16450
16854
|
var exports_external = {};
|
|
16451
16855
|
__export(exports_external, {
|
|
16452
16856
|
void: () => voidType,
|
|
@@ -16558,7 +16962,7 @@ __export(exports_external, {
|
|
|
16558
16962
|
BRAND: () => BRAND
|
|
16559
16963
|
});
|
|
16560
16964
|
|
|
16561
|
-
// node_modules/zod/v3/helpers/util.js
|
|
16965
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js
|
|
16562
16966
|
var util;
|
|
16563
16967
|
(function(util2) {
|
|
16564
16968
|
util2.assertEqual = (_) => {};
|
|
@@ -16689,7 +17093,7 @@ var getParsedType2 = (data) => {
|
|
|
16689
17093
|
}
|
|
16690
17094
|
};
|
|
16691
17095
|
|
|
16692
|
-
// node_modules/zod/v3/ZodError.js
|
|
17096
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js
|
|
16693
17097
|
var ZodIssueCode = util.arrayToEnum([
|
|
16694
17098
|
"invalid_type",
|
|
16695
17099
|
"invalid_literal",
|
|
@@ -16808,7 +17212,7 @@ ZodError2.create = (issues) => {
|
|
|
16808
17212
|
return error2;
|
|
16809
17213
|
};
|
|
16810
17214
|
|
|
16811
|
-
// node_modules/zod/v3/locales/en.js
|
|
17215
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js
|
|
16812
17216
|
var errorMap = (issue2, _ctx) => {
|
|
16813
17217
|
let message;
|
|
16814
17218
|
switch (issue2.code) {
|
|
@@ -16911,7 +17315,7 @@ var errorMap = (issue2, _ctx) => {
|
|
|
16911
17315
|
};
|
|
16912
17316
|
var en_default2 = errorMap;
|
|
16913
17317
|
|
|
16914
|
-
// node_modules/zod/v3/errors.js
|
|
17318
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js
|
|
16915
17319
|
var overrideErrorMap = en_default2;
|
|
16916
17320
|
function setErrorMap(map) {
|
|
16917
17321
|
overrideErrorMap = map;
|
|
@@ -16919,7 +17323,7 @@ function setErrorMap(map) {
|
|
|
16919
17323
|
function getErrorMap() {
|
|
16920
17324
|
return overrideErrorMap;
|
|
16921
17325
|
}
|
|
16922
|
-
// node_modules/zod/v3/helpers/parseUtil.js
|
|
17326
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
16923
17327
|
var makeIssue = (params) => {
|
|
16924
17328
|
const { data, path, errorMaps, issueData } = params;
|
|
16925
17329
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -17025,14 +17429,14 @@ var isAborted = (x) => x.status === "aborted";
|
|
|
17025
17429
|
var isDirty = (x) => x.status === "dirty";
|
|
17026
17430
|
var isValid = (x) => x.status === "valid";
|
|
17027
17431
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
17028
|
-
// node_modules/zod/v3/helpers/errorUtil.js
|
|
17432
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js
|
|
17029
17433
|
var errorUtil;
|
|
17030
17434
|
(function(errorUtil2) {
|
|
17031
17435
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
17032
17436
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
17033
17437
|
})(errorUtil || (errorUtil = {}));
|
|
17034
17438
|
|
|
17035
|
-
// node_modules/zod/v3/types.js
|
|
17439
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
|
|
17036
17440
|
class ParseInputLazyPath {
|
|
17037
17441
|
constructor(parent, value, path, key) {
|
|
17038
17442
|
this._cachedPath = [];
|
|
@@ -20419,7 +20823,7 @@ var coerce = {
|
|
|
20419
20823
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
20420
20824
|
};
|
|
20421
20825
|
var NEVER2 = INVALID;
|
|
20422
|
-
// node_modules/zod/v4/mini/schemas.js
|
|
20826
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/mini/schemas.js
|
|
20423
20827
|
var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
|
|
20424
20828
|
if (!inst._zod)
|
|
20425
20829
|
throw new Error("Uninitialized schema in ZodMiniType.");
|
|
@@ -20461,7 +20865,7 @@ function object2(shape, params) {
|
|
|
20461
20865
|
};
|
|
20462
20866
|
return new ZodMiniObject(def);
|
|
20463
20867
|
}
|
|
20464
|
-
// node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
|
|
20868
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
|
|
20465
20869
|
function isZ4Schema(s) {
|
|
20466
20870
|
const schema = s;
|
|
20467
20871
|
return !!schema._zod;
|
|
@@ -20545,17 +20949,34 @@ function normalizeObjectSchema(schema) {
|
|
|
20545
20949
|
}
|
|
20546
20950
|
return;
|
|
20547
20951
|
}
|
|
20952
|
+
function getDotPath(path) {
|
|
20953
|
+
if (path.length === 0) {
|
|
20954
|
+
return "object root";
|
|
20955
|
+
}
|
|
20956
|
+
return path.reduce((acc, seg, index) => {
|
|
20957
|
+
if (index === 0) {
|
|
20958
|
+
return String(seg);
|
|
20959
|
+
}
|
|
20960
|
+
if (typeof seg === "number") {
|
|
20961
|
+
return `${acc}[${seg}]`;
|
|
20962
|
+
}
|
|
20963
|
+
return `${acc}.${seg}`;
|
|
20964
|
+
}, "");
|
|
20965
|
+
}
|
|
20548
20966
|
function getParseErrorMessage(error2) {
|
|
20549
20967
|
if (error2 && typeof error2 === "object") {
|
|
20968
|
+
if ("issues" in error2 && Array.isArray(error2.issues) && error2.issues.length > 0) {
|
|
20969
|
+
return error2.issues.map((i) => {
|
|
20970
|
+
if (!i.path?.length) {
|
|
20971
|
+
return i.message;
|
|
20972
|
+
}
|
|
20973
|
+
return `${i.message} at ${getDotPath(i.path)}`;
|
|
20974
|
+
}).join(`
|
|
20975
|
+
`);
|
|
20976
|
+
}
|
|
20550
20977
|
if ("message" in error2 && typeof error2.message === "string") {
|
|
20551
20978
|
return error2.message;
|
|
20552
20979
|
}
|
|
20553
|
-
if ("issues" in error2 && Array.isArray(error2.issues) && error2.issues.length > 0) {
|
|
20554
|
-
const firstIssue = error2.issues[0];
|
|
20555
|
-
if (firstIssue && typeof firstIssue === "object" && "message" in firstIssue) {
|
|
20556
|
-
return String(firstIssue.message);
|
|
20557
|
-
}
|
|
20558
|
-
}
|
|
20559
20980
|
try {
|
|
20560
20981
|
return JSON.stringify(error2);
|
|
20561
20982
|
} catch {
|
|
@@ -20605,12 +21026,12 @@ function getLiteralValue(schema) {
|
|
|
20605
21026
|
return;
|
|
20606
21027
|
}
|
|
20607
21028
|
|
|
20608
|
-
// node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
|
|
21029
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
|
|
20609
21030
|
function isTerminal(status) {
|
|
20610
21031
|
return status === "completed" || status === "failed" || status === "cancelled";
|
|
20611
21032
|
}
|
|
20612
21033
|
|
|
20613
|
-
// node_modules/zod-to-json-schema/dist/esm/Options.js
|
|
21034
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js
|
|
20614
21035
|
var ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
|
|
20615
21036
|
var defaultOptions = {
|
|
20616
21037
|
name: undefined,
|
|
@@ -20643,7 +21064,7 @@ var getDefaultOptions = (options) => typeof options === "string" ? {
|
|
|
20643
21064
|
...defaultOptions,
|
|
20644
21065
|
...options
|
|
20645
21066
|
};
|
|
20646
|
-
// node_modules/zod-to-json-schema/dist/esm/Refs.js
|
|
21067
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Refs.js
|
|
20647
21068
|
var getRefs = (options) => {
|
|
20648
21069
|
const _options = getDefaultOptions(options);
|
|
20649
21070
|
const currentPath = _options.name !== undefined ? [..._options.basePath, _options.definitionPath, _options.name] : _options.basePath;
|
|
@@ -20662,7 +21083,7 @@ var getRefs = (options) => {
|
|
|
20662
21083
|
]))
|
|
20663
21084
|
};
|
|
20664
21085
|
};
|
|
20665
|
-
// node_modules/zod-to-json-schema/dist/esm/errorMessages.js
|
|
21086
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
|
|
20666
21087
|
function addErrorMessage(res, key, errorMessage, refs) {
|
|
20667
21088
|
if (!refs?.errorMessages)
|
|
20668
21089
|
return;
|
|
@@ -20677,7 +21098,7 @@ function setResponseValueAndErrors(res, key, value, errorMessage, refs) {
|
|
|
20677
21098
|
res[key] = value;
|
|
20678
21099
|
addErrorMessage(res, key, errorMessage, refs);
|
|
20679
21100
|
}
|
|
20680
|
-
// node_modules/zod-to-json-schema/dist/esm/getRelativePath.js
|
|
21101
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js
|
|
20681
21102
|
var getRelativePath = (pathA, pathB) => {
|
|
20682
21103
|
let i = 0;
|
|
20683
21104
|
for (;i < pathA.length && i < pathB.length; i++) {
|
|
@@ -20686,7 +21107,7 @@ var getRelativePath = (pathA, pathB) => {
|
|
|
20686
21107
|
}
|
|
20687
21108
|
return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/");
|
|
20688
21109
|
};
|
|
20689
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/any.js
|
|
21110
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/any.js
|
|
20690
21111
|
function parseAnyDef(refs) {
|
|
20691
21112
|
if (refs.target !== "openAi") {
|
|
20692
21113
|
return {};
|
|
@@ -20702,7 +21123,7 @@ function parseAnyDef(refs) {
|
|
|
20702
21123
|
};
|
|
20703
21124
|
}
|
|
20704
21125
|
|
|
20705
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/array.js
|
|
21126
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/array.js
|
|
20706
21127
|
function parseArrayDef(def, refs) {
|
|
20707
21128
|
const res = {
|
|
20708
21129
|
type: "array"
|
|
@@ -20726,7 +21147,7 @@ function parseArrayDef(def, refs) {
|
|
|
20726
21147
|
return res;
|
|
20727
21148
|
}
|
|
20728
21149
|
|
|
20729
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
|
|
21150
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
|
|
20730
21151
|
function parseBigintDef(def, refs) {
|
|
20731
21152
|
const res = {
|
|
20732
21153
|
type: "integer",
|
|
@@ -20772,24 +21193,24 @@ function parseBigintDef(def, refs) {
|
|
|
20772
21193
|
return res;
|
|
20773
21194
|
}
|
|
20774
21195
|
|
|
20775
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
|
|
21196
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
|
|
20776
21197
|
function parseBooleanDef() {
|
|
20777
21198
|
return {
|
|
20778
21199
|
type: "boolean"
|
|
20779
21200
|
};
|
|
20780
21201
|
}
|
|
20781
21202
|
|
|
20782
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
|
|
21203
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
|
|
20783
21204
|
function parseBrandedDef(_def, refs) {
|
|
20784
21205
|
return parseDef(_def.type._def, refs);
|
|
20785
21206
|
}
|
|
20786
21207
|
|
|
20787
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
|
|
21208
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
|
|
20788
21209
|
var parseCatchDef = (def, refs) => {
|
|
20789
21210
|
return parseDef(def.innerType._def, refs);
|
|
20790
21211
|
};
|
|
20791
21212
|
|
|
20792
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/date.js
|
|
21213
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/date.js
|
|
20793
21214
|
function parseDateDef(def, refs, overrideDateStrategy) {
|
|
20794
21215
|
const strategy = overrideDateStrategy ?? refs.dateStrategy;
|
|
20795
21216
|
if (Array.isArray(strategy)) {
|
|
@@ -20834,7 +21255,7 @@ var integerDateParser = (def, refs) => {
|
|
|
20834
21255
|
return res;
|
|
20835
21256
|
};
|
|
20836
21257
|
|
|
20837
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/default.js
|
|
21258
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/default.js
|
|
20838
21259
|
function parseDefaultDef(_def, refs) {
|
|
20839
21260
|
return {
|
|
20840
21261
|
...parseDef(_def.innerType._def, refs),
|
|
@@ -20842,12 +21263,12 @@ function parseDefaultDef(_def, refs) {
|
|
|
20842
21263
|
};
|
|
20843
21264
|
}
|
|
20844
21265
|
|
|
20845
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
|
|
21266
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
|
|
20846
21267
|
function parseEffectsDef(_def, refs) {
|
|
20847
21268
|
return refs.effectStrategy === "input" ? parseDef(_def.schema._def, refs) : parseAnyDef(refs);
|
|
20848
21269
|
}
|
|
20849
21270
|
|
|
20850
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
|
|
21271
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
|
|
20851
21272
|
function parseEnumDef(def) {
|
|
20852
21273
|
return {
|
|
20853
21274
|
type: "string",
|
|
@@ -20855,7 +21276,7 @@ function parseEnumDef(def) {
|
|
|
20855
21276
|
};
|
|
20856
21277
|
}
|
|
20857
21278
|
|
|
20858
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
|
|
21279
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
|
|
20859
21280
|
var isJsonSchema7AllOfType = (type) => {
|
|
20860
21281
|
if ("type" in type && type.type === "string")
|
|
20861
21282
|
return false;
|
|
@@ -20897,7 +21318,7 @@ function parseIntersectionDef(def, refs) {
|
|
|
20897
21318
|
} : undefined;
|
|
20898
21319
|
}
|
|
20899
21320
|
|
|
20900
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
|
|
21321
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
|
|
20901
21322
|
function parseLiteralDef(def, refs) {
|
|
20902
21323
|
const parsedType2 = typeof def.value;
|
|
20903
21324
|
if (parsedType2 !== "bigint" && parsedType2 !== "number" && parsedType2 !== "boolean" && parsedType2 !== "string") {
|
|
@@ -20917,7 +21338,7 @@ function parseLiteralDef(def, refs) {
|
|
|
20917
21338
|
};
|
|
20918
21339
|
}
|
|
20919
21340
|
|
|
20920
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/string.js
|
|
21341
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
|
|
20921
21342
|
var emojiRegex2 = undefined;
|
|
20922
21343
|
var zodPatterns = {
|
|
20923
21344
|
cuid: /^[cC][^\s-]{8,}$/,
|
|
@@ -21214,7 +21635,7 @@ function stringifyRegExpWithFlags(regex, refs) {
|
|
|
21214
21635
|
return pattern;
|
|
21215
21636
|
}
|
|
21216
21637
|
|
|
21217
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/record.js
|
|
21638
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
|
|
21218
21639
|
function parseRecordDef(def, refs) {
|
|
21219
21640
|
if (refs.target === "openAi") {
|
|
21220
21641
|
console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
|
|
@@ -21266,7 +21687,7 @@ function parseRecordDef(def, refs) {
|
|
|
21266
21687
|
return schema;
|
|
21267
21688
|
}
|
|
21268
21689
|
|
|
21269
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/map.js
|
|
21690
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/map.js
|
|
21270
21691
|
function parseMapDef(def, refs) {
|
|
21271
21692
|
if (refs.mapStrategy === "record") {
|
|
21272
21693
|
return parseRecordDef(def, refs);
|
|
@@ -21291,7 +21712,7 @@ function parseMapDef(def, refs) {
|
|
|
21291
21712
|
};
|
|
21292
21713
|
}
|
|
21293
21714
|
|
|
21294
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
|
|
21715
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
|
|
21295
21716
|
function parseNativeEnumDef(def) {
|
|
21296
21717
|
const object3 = def.values;
|
|
21297
21718
|
const actualKeys = Object.keys(def.values).filter((key) => {
|
|
@@ -21305,7 +21726,7 @@ function parseNativeEnumDef(def) {
|
|
|
21305
21726
|
};
|
|
21306
21727
|
}
|
|
21307
21728
|
|
|
21308
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/never.js
|
|
21729
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/never.js
|
|
21309
21730
|
function parseNeverDef(refs) {
|
|
21310
21731
|
return refs.target === "openAi" ? undefined : {
|
|
21311
21732
|
not: parseAnyDef({
|
|
@@ -21315,7 +21736,7 @@ function parseNeverDef(refs) {
|
|
|
21315
21736
|
};
|
|
21316
21737
|
}
|
|
21317
21738
|
|
|
21318
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/null.js
|
|
21739
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/null.js
|
|
21319
21740
|
function parseNullDef(refs) {
|
|
21320
21741
|
return refs.target === "openApi3" ? {
|
|
21321
21742
|
enum: ["null"],
|
|
@@ -21325,7 +21746,7 @@ function parseNullDef(refs) {
|
|
|
21325
21746
|
};
|
|
21326
21747
|
}
|
|
21327
21748
|
|
|
21328
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/union.js
|
|
21749
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/union.js
|
|
21329
21750
|
var primitiveMappings = {
|
|
21330
21751
|
ZodString: "string",
|
|
21331
21752
|
ZodNumber: "number",
|
|
@@ -21393,7 +21814,7 @@ var asAnyOf = (def, refs) => {
|
|
|
21393
21814
|
return anyOf.length ? { anyOf } : undefined;
|
|
21394
21815
|
};
|
|
21395
21816
|
|
|
21396
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
|
|
21817
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
|
|
21397
21818
|
function parseNullableDef(def, refs) {
|
|
21398
21819
|
if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(def.innerType._def.typeName) && (!def.innerType._def.checks || !def.innerType._def.checks.length)) {
|
|
21399
21820
|
if (refs.target === "openApi3") {
|
|
@@ -21425,7 +21846,7 @@ function parseNullableDef(def, refs) {
|
|
|
21425
21846
|
return base && { anyOf: [base, { type: "null" }] };
|
|
21426
21847
|
}
|
|
21427
21848
|
|
|
21428
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/number.js
|
|
21849
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/number.js
|
|
21429
21850
|
function parseNumberDef(def, refs) {
|
|
21430
21851
|
const res = {
|
|
21431
21852
|
type: "number"
|
|
@@ -21474,7 +21895,7 @@ function parseNumberDef(def, refs) {
|
|
|
21474
21895
|
return res;
|
|
21475
21896
|
}
|
|
21476
21897
|
|
|
21477
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/object.js
|
|
21898
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/object.js
|
|
21478
21899
|
function parseObjectDef(def, refs) {
|
|
21479
21900
|
const forceOptionalIntoNullable = refs.target === "openAi";
|
|
21480
21901
|
const result = {
|
|
@@ -21544,7 +21965,7 @@ function safeIsOptional(schema) {
|
|
|
21544
21965
|
}
|
|
21545
21966
|
}
|
|
21546
21967
|
|
|
21547
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
|
|
21968
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
|
|
21548
21969
|
var parseOptionalDef = (def, refs) => {
|
|
21549
21970
|
if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
|
|
21550
21971
|
return parseDef(def.innerType._def, refs);
|
|
@@ -21563,7 +21984,7 @@ var parseOptionalDef = (def, refs) => {
|
|
|
21563
21984
|
} : parseAnyDef(refs);
|
|
21564
21985
|
};
|
|
21565
21986
|
|
|
21566
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
|
|
21987
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
|
|
21567
21988
|
var parsePipelineDef = (def, refs) => {
|
|
21568
21989
|
if (refs.pipeStrategy === "input") {
|
|
21569
21990
|
return parseDef(def.in._def, refs);
|
|
@@ -21583,12 +22004,12 @@ var parsePipelineDef = (def, refs) => {
|
|
|
21583
22004
|
};
|
|
21584
22005
|
};
|
|
21585
22006
|
|
|
21586
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
|
|
22007
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
|
|
21587
22008
|
function parsePromiseDef(def, refs) {
|
|
21588
22009
|
return parseDef(def.type._def, refs);
|
|
21589
22010
|
}
|
|
21590
22011
|
|
|
21591
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/set.js
|
|
22012
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/set.js
|
|
21592
22013
|
function parseSetDef(def, refs) {
|
|
21593
22014
|
const items = parseDef(def.valueType._def, {
|
|
21594
22015
|
...refs,
|
|
@@ -21608,7 +22029,7 @@ function parseSetDef(def, refs) {
|
|
|
21608
22029
|
return schema;
|
|
21609
22030
|
}
|
|
21610
22031
|
|
|
21611
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
|
|
22032
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
|
|
21612
22033
|
function parseTupleDef(def, refs) {
|
|
21613
22034
|
if (def.rest) {
|
|
21614
22035
|
return {
|
|
@@ -21636,24 +22057,24 @@ function parseTupleDef(def, refs) {
|
|
|
21636
22057
|
}
|
|
21637
22058
|
}
|
|
21638
22059
|
|
|
21639
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
|
|
22060
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
|
|
21640
22061
|
function parseUndefinedDef(refs) {
|
|
21641
22062
|
return {
|
|
21642
22063
|
not: parseAnyDef(refs)
|
|
21643
22064
|
};
|
|
21644
22065
|
}
|
|
21645
22066
|
|
|
21646
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
|
|
22067
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
|
|
21647
22068
|
function parseUnknownDef(refs) {
|
|
21648
22069
|
return parseAnyDef(refs);
|
|
21649
22070
|
}
|
|
21650
22071
|
|
|
21651
|
-
// node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
|
|
22072
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
|
|
21652
22073
|
var parseReadonlyDef = (def, refs) => {
|
|
21653
22074
|
return parseDef(def.innerType._def, refs);
|
|
21654
22075
|
};
|
|
21655
22076
|
|
|
21656
|
-
// node_modules/zod-to-json-schema/dist/esm/selectParser.js
|
|
22077
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/selectParser.js
|
|
21657
22078
|
var selectParser = (def, typeName, refs) => {
|
|
21658
22079
|
switch (typeName) {
|
|
21659
22080
|
case ZodFirstPartyTypeKind.ZodString:
|
|
@@ -21731,7 +22152,7 @@ var selectParser = (def, typeName, refs) => {
|
|
|
21731
22152
|
}
|
|
21732
22153
|
};
|
|
21733
22154
|
|
|
21734
|
-
// node_modules/zod-to-json-schema/dist/esm/parseDef.js
|
|
22155
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseDef.js
|
|
21735
22156
|
function parseDef(def, refs, forceResolution = false) {
|
|
21736
22157
|
const seenItem = refs.seen.get(def);
|
|
21737
22158
|
if (refs.override) {
|
|
@@ -21786,7 +22207,7 @@ var addMeta = (def, refs, jsonSchema) => {
|
|
|
21786
22207
|
}
|
|
21787
22208
|
return jsonSchema;
|
|
21788
22209
|
};
|
|
21789
|
-
// node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
|
|
22210
|
+
// node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
|
|
21790
22211
|
var zodToJsonSchema = (schema, options) => {
|
|
21791
22212
|
const refs = getRefs(options);
|
|
21792
22213
|
let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name2, schema2]) => ({
|
|
@@ -21846,7 +22267,7 @@ var zodToJsonSchema = (schema, options) => {
|
|
|
21846
22267
|
}
|
|
21847
22268
|
return combined;
|
|
21848
22269
|
};
|
|
21849
|
-
// node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
|
|
22270
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
|
|
21850
22271
|
function mapMiniTarget(t) {
|
|
21851
22272
|
if (!t)
|
|
21852
22273
|
return "draft-7";
|
|
@@ -21888,7 +22309,7 @@ function parseWithCompat(schema, data) {
|
|
|
21888
22309
|
return result.data;
|
|
21889
22310
|
}
|
|
21890
22311
|
|
|
21891
|
-
// node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
|
|
22312
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
|
|
21892
22313
|
var DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;
|
|
21893
22314
|
|
|
21894
22315
|
class Protocol {
|
|
@@ -22092,6 +22513,10 @@ class Protocol {
|
|
|
22092
22513
|
this._progressHandlers.clear();
|
|
22093
22514
|
this._taskProgressTokens.clear();
|
|
22094
22515
|
this._pendingDebouncedNotifications.clear();
|
|
22516
|
+
for (const info of this._timeoutInfo.values()) {
|
|
22517
|
+
clearTimeout(info.timeoutId);
|
|
22518
|
+
}
|
|
22519
|
+
this._timeoutInfo.clear();
|
|
22095
22520
|
for (const controller of this._requestHandlerAbortControllers.values()) {
|
|
22096
22521
|
controller.abort();
|
|
22097
22522
|
}
|
|
@@ -22222,7 +22647,9 @@ class Protocol {
|
|
|
22222
22647
|
await capturedTransport?.send(errorResponse);
|
|
22223
22648
|
}
|
|
22224
22649
|
}).catch((error2) => this._onerror(new Error(`Failed to send response: ${error2}`))).finally(() => {
|
|
22225
|
-
this._requestHandlerAbortControllers.
|
|
22650
|
+
if (this._requestHandlerAbortControllers.get(request.id) === abortController) {
|
|
22651
|
+
this._requestHandlerAbortControllers.delete(request.id);
|
|
22652
|
+
}
|
|
22226
22653
|
});
|
|
22227
22654
|
}
|
|
22228
22655
|
_onprogress(notification) {
|
|
@@ -22723,7 +23150,7 @@ function mergeCapabilities(base, additional) {
|
|
|
22723
23150
|
return result;
|
|
22724
23151
|
}
|
|
22725
23152
|
|
|
22726
|
-
// node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
|
|
23153
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
|
|
22727
23154
|
var import_ajv = __toESM(require_ajv(), 1);
|
|
22728
23155
|
var import_ajv_formats = __toESM(require_dist(), 1);
|
|
22729
23156
|
function createDefaultAjvInstance() {
|
|
@@ -22763,7 +23190,7 @@ class AjvJsonSchemaValidator {
|
|
|
22763
23190
|
}
|
|
22764
23191
|
}
|
|
22765
23192
|
|
|
22766
|
-
// node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js
|
|
23193
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js
|
|
22767
23194
|
class ExperimentalServerTasks {
|
|
22768
23195
|
constructor(_server) {
|
|
22769
23196
|
this._server = _server;
|
|
@@ -22841,7 +23268,7 @@ class ExperimentalServerTasks {
|
|
|
22841
23268
|
}
|
|
22842
23269
|
}
|
|
22843
23270
|
|
|
22844
|
-
// node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
|
|
23271
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
|
|
22845
23272
|
function assertToolsCallTaskCapability(requests, method, entityName) {
|
|
22846
23273
|
if (!requests) {
|
|
22847
23274
|
throw new Error(`${entityName} does not support task creation (required for ${method})`);
|
|
@@ -22876,7 +23303,7 @@ function assertClientRequestTaskCapability(requests, method, entityName) {
|
|
|
22876
23303
|
}
|
|
22877
23304
|
}
|
|
22878
23305
|
|
|
22879
|
-
// node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
|
|
23306
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
|
|
22880
23307
|
class Server extends Protocol {
|
|
22881
23308
|
constructor(_serverInfo, options) {
|
|
22882
23309
|
super(options);
|
|
@@ -22924,16 +23351,7 @@ class Server extends Protocol {
|
|
|
22924
23351
|
if (!methodSchema) {
|
|
22925
23352
|
throw new Error("Schema is missing a method literal");
|
|
22926
23353
|
}
|
|
22927
|
-
|
|
22928
|
-
if (isZ4Schema(methodSchema)) {
|
|
22929
|
-
const v4Schema = methodSchema;
|
|
22930
|
-
const v4Def = v4Schema._zod?.def;
|
|
22931
|
-
methodValue = v4Def?.value ?? v4Schema.value;
|
|
22932
|
-
} else {
|
|
22933
|
-
const v3Schema = methodSchema;
|
|
22934
|
-
const legacyDef = v3Schema._def;
|
|
22935
|
-
methodValue = legacyDef?.value ?? v3Schema.value;
|
|
22936
|
-
}
|
|
23354
|
+
const methodValue = getLiteralValue(methodSchema);
|
|
22937
23355
|
if (typeof methodValue !== "string") {
|
|
22938
23356
|
throw new Error("Schema method literal must be a string");
|
|
22939
23357
|
}
|
|
@@ -23209,7 +23627,7 @@ class Server extends Protocol {
|
|
|
23209
23627
|
}
|
|
23210
23628
|
}
|
|
23211
23629
|
|
|
23212
|
-
// node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js
|
|
23630
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js
|
|
23213
23631
|
var COMPLETABLE_SYMBOL = Symbol.for("mcp.completable");
|
|
23214
23632
|
function isCompletable(schema) {
|
|
23215
23633
|
return !!schema && typeof schema === "object" && COMPLETABLE_SYMBOL in schema;
|
|
@@ -23223,7 +23641,7 @@ var McpZodTypeKind;
|
|
|
23223
23641
|
McpZodTypeKind2["Completable"] = "McpCompletable";
|
|
23224
23642
|
})(McpZodTypeKind || (McpZodTypeKind = {}));
|
|
23225
23643
|
|
|
23226
|
-
// node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js
|
|
23644
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js
|
|
23227
23645
|
var TOOL_NAME_REGEX = /^[A-Za-z0-9._-]{1,128}$/;
|
|
23228
23646
|
function validateToolName(name) {
|
|
23229
23647
|
const warnings = [];
|
|
@@ -23281,7 +23699,7 @@ function validateAndWarnToolName(name) {
|
|
|
23281
23699
|
return result.isValid;
|
|
23282
23700
|
}
|
|
23283
23701
|
|
|
23284
|
-
// node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js
|
|
23702
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js
|
|
23285
23703
|
class ExperimentalMcpServerTasks {
|
|
23286
23704
|
constructor(_mcpServer) {
|
|
23287
23705
|
this._mcpServer = _mcpServer;
|
|
@@ -23295,7 +23713,7 @@ class ExperimentalMcpServerTasks {
|
|
|
23295
23713
|
return mcpServerInternal._createRegisteredTool(name, config2.title, config2.description, config2.inputSchema, config2.outputSchema, config2.annotations, execution, config2._meta, handler);
|
|
23296
23714
|
}
|
|
23297
23715
|
}
|
|
23298
|
-
// node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
|
|
23716
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
|
|
23299
23717
|
class McpServer {
|
|
23300
23718
|
constructor(serverInfo, options) {
|
|
23301
23719
|
this._registeredResources = {};
|
|
@@ -23879,6 +24297,9 @@ class McpServer {
|
|
|
23879
24297
|
annotations = rest.shift();
|
|
23880
24298
|
}
|
|
23881
24299
|
} else if (typeof firstArg === "object" && firstArg !== null) {
|
|
24300
|
+
if (Object.values(firstArg).some((v) => typeof v === "object" && v !== null)) {
|
|
24301
|
+
throw new Error(`Tool ${name} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);
|
|
24302
|
+
}
|
|
23882
24303
|
annotations = rest.shift();
|
|
23883
24304
|
}
|
|
23884
24305
|
}
|
|
@@ -23971,6 +24392,9 @@ function getZodSchemaObject(schema) {
|
|
|
23971
24392
|
if (isZodRawShapeCompat(schema)) {
|
|
23972
24393
|
return objectFromShape(schema);
|
|
23973
24394
|
}
|
|
24395
|
+
if (!isZodSchemaInstance(schema)) {
|
|
24396
|
+
throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");
|
|
24397
|
+
}
|
|
23974
24398
|
return schema;
|
|
23975
24399
|
}
|
|
23976
24400
|
function promptArgumentsFromSchema(schema) {
|
|
@@ -24015,12 +24439,22 @@ var EMPTY_COMPLETION_RESULT = {
|
|
|
24015
24439
|
}
|
|
24016
24440
|
};
|
|
24017
24441
|
|
|
24018
|
-
// node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
24442
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
24019
24443
|
import process2 from "process";
|
|
24020
24444
|
|
|
24021
|
-
// node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
|
|
24445
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
|
|
24446
|
+
var STDIO_DEFAULT_MAX_BUFFER_SIZE = 10 * 1024 * 1024;
|
|
24447
|
+
|
|
24022
24448
|
class ReadBuffer {
|
|
24449
|
+
constructor(options) {
|
|
24450
|
+
this._maxBufferSize = options?.maxBufferSize ?? STDIO_DEFAULT_MAX_BUFFER_SIZE;
|
|
24451
|
+
}
|
|
24023
24452
|
append(chunk) {
|
|
24453
|
+
const newSize = (this._buffer?.length ?? 0) + chunk.length;
|
|
24454
|
+
if (newSize > this._maxBufferSize) {
|
|
24455
|
+
this.clear();
|
|
24456
|
+
throw new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);
|
|
24457
|
+
}
|
|
24024
24458
|
this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk;
|
|
24025
24459
|
}
|
|
24026
24460
|
readMessage() {
|
|
@@ -24048,20 +24482,25 @@ function serializeMessage(message) {
|
|
|
24048
24482
|
`;
|
|
24049
24483
|
}
|
|
24050
24484
|
|
|
24051
|
-
// node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
24485
|
+
// node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
24052
24486
|
class StdioServerTransport {
|
|
24053
|
-
constructor(_stdin = process2.stdin, _stdout = process2.stdout) {
|
|
24487
|
+
constructor(_stdin = process2.stdin, _stdout = process2.stdout, options) {
|
|
24054
24488
|
this._stdin = _stdin;
|
|
24055
24489
|
this._stdout = _stdout;
|
|
24056
|
-
this._readBuffer = new ReadBuffer;
|
|
24057
24490
|
this._started = false;
|
|
24058
24491
|
this._ondata = (chunk) => {
|
|
24059
|
-
|
|
24060
|
-
|
|
24492
|
+
try {
|
|
24493
|
+
this._readBuffer.append(chunk);
|
|
24494
|
+
this.processReadBuffer();
|
|
24495
|
+
} catch (error2) {
|
|
24496
|
+
this.onerror?.(error2);
|
|
24497
|
+
this.close().catch(() => {});
|
|
24498
|
+
}
|
|
24061
24499
|
};
|
|
24062
24500
|
this._onerror = (error2) => {
|
|
24063
24501
|
this.onerror?.(error2);
|
|
24064
24502
|
};
|
|
24503
|
+
this._readBuffer = new ReadBuffer({ maxBufferSize: options?.maxBufferSize });
|
|
24065
24504
|
}
|
|
24066
24505
|
async start() {
|
|
24067
24506
|
if (this._started) {
|
|
@@ -24107,9 +24546,9 @@ class StdioServerTransport {
|
|
|
24107
24546
|
}
|
|
24108
24547
|
|
|
24109
24548
|
// src/lib/connector.ts
|
|
24110
|
-
import { join as
|
|
24549
|
+
import { join as join5 } from "path";
|
|
24111
24550
|
import { existsSync as existsSync5, readFileSync as readFileSync3 } from "fs";
|
|
24112
|
-
import { homedir } from "os";
|
|
24551
|
+
import { homedir as homedir3 } from "os";
|
|
24113
24552
|
|
|
24114
24553
|
class ConnectorNotInstalledError extends Error {
|
|
24115
24554
|
connectorName;
|
|
@@ -24177,9 +24616,9 @@ async function runConnector(name, args, opts = {}) {
|
|
|
24177
24616
|
}
|
|
24178
24617
|
function getConnectorTokenPath(name, profile = "default") {
|
|
24179
24618
|
const bases = [
|
|
24180
|
-
|
|
24181
|
-
|
|
24182
|
-
|
|
24619
|
+
join5(homedir3(), ".connectors", `connect-${name}`, "profiles", profile, "tokens.json"),
|
|
24620
|
+
join5(homedir3(), ".connect", `connect-${name}`, "profiles", profile, "tokens.json"),
|
|
24621
|
+
join5(homedir3(), ".connect", `connect-${name}`, "tokens.json")
|
|
24183
24622
|
];
|
|
24184
24623
|
for (const p of bases) {
|
|
24185
24624
|
if (existsSync5(p))
|
|
@@ -29417,6 +29856,7 @@ Only include fields that are actually visible in the document. Return valid JSON
|
|
|
29417
29856
|
}
|
|
29418
29857
|
|
|
29419
29858
|
// src/mcp/handlers/advanced.ts
|
|
29859
|
+
import { join as join6 } from "path";
|
|
29420
29860
|
var json3 = (v) => ({
|
|
29421
29861
|
content: [{ type: "text", text: JSON.stringify(v, null, 2) }]
|
|
29422
29862
|
});
|
|
@@ -29578,8 +30018,9 @@ var advancedHandlers = {
|
|
|
29578
30018
|
const { contact_id, image, format } = a;
|
|
29579
30019
|
await store.getContact(contact_id);
|
|
29580
30020
|
const filename = await store.saveImage(contact_id, image, { format });
|
|
29581
|
-
|
|
29582
|
-
|
|
30021
|
+
const avatarUrl = join6(getImagesDir(), filename);
|
|
30022
|
+
await store.updateContact(contact_id, { avatar_url: avatarUrl });
|
|
30023
|
+
return json3({ ok: true, contact_id, filename, avatar_url: avatarUrl });
|
|
29583
30024
|
},
|
|
29584
30025
|
get_contact_photo: async (a) => {
|
|
29585
30026
|
const { contact_id } = a;
|
|
@@ -29601,8 +30042,9 @@ var advancedHandlers = {
|
|
|
29601
30042
|
const { company_id, image, format } = a;
|
|
29602
30043
|
await store.getCompany(company_id);
|
|
29603
30044
|
const filename = await store.saveImage(company_id, image, { format });
|
|
29604
|
-
|
|
29605
|
-
|
|
30045
|
+
const logoUrl = join6(getImagesDir(), filename);
|
|
30046
|
+
await store.updateCompany(company_id, { logo_url: logoUrl });
|
|
30047
|
+
return json3({ ok: true, company_id, filename, logo_url: logoUrl });
|
|
29606
30048
|
},
|
|
29607
30049
|
get_company_logo: async (a) => {
|
|
29608
30050
|
const { company_id } = a;
|
|
@@ -31373,10 +31815,10 @@ var TOOL_DEFINITIONS = [
|
|
|
31373
31815
|
{ name: "get_deal_team", description: "Get the full buying committee for a deal with contact names and roles.", inputSchema: { type: "object", properties: { deal_id: { type: "string" } }, required: ["deal_id"] } },
|
|
31374
31816
|
{ name: "get_coverage_gaps", description: "Identify coverage gaps in a company account \u2014 missing economic buyer, technical evaluator, or org chart relationships.", inputSchema: { type: "object", properties: { company_id: { type: "string" } }, required: ["company_id"] } },
|
|
31375
31817
|
{ name: "get_recent_contact_events", description: "Polling fallback for change events \u2014 returns recent activity log entries, optionally filtered by event type or date.", inputSchema: { type: "object", properties: { since: { type: "string", description: "ISO 8601 datetime \u2014 only events after this date" }, event_types: { type: "array", items: { type: "string" } } } } },
|
|
31376
|
-
{ name: "set_contact_photo", description: "Set a contact's profile photo. Provide either a local file path or base64-encoded image data (with or without data URI prefix). Stores image in
|
|
31818
|
+
{ name: "set_contact_photo", description: "Set a contact's profile photo. Provide either a local file path or base64-encoded image data (with or without data URI prefix). Stores image in the XDG data root images dir and updates avatar_url. Supported formats: jpg, png, gif, webp, svg, avif.", inputSchema: { type: "object", properties: { contact_id: { type: "string" }, image: { type: "string", description: "File path (e.g. /tmp/photo.jpg) OR base64 data (e.g. data:image/png;base64,...) OR raw base64 string" }, format: { type: "string", description: "Image format hint when using raw base64 (jpg, png, webp). Not needed for file paths or data URIs." } }, required: ["contact_id", "image"] } },
|
|
31377
31819
|
{ name: "get_contact_photo", description: "Get a contact's profile photo as base64 data URI. Returns null if no photo is set.", inputSchema: { type: "object", properties: { contact_id: { type: "string" } }, required: ["contact_id"] } },
|
|
31378
31820
|
{ name: "delete_contact_photo", description: "Remove a contact's profile photo.", inputSchema: { type: "object", properties: { contact_id: { type: "string" } }, required: ["contact_id"] } },
|
|
31379
|
-
{ name: "set_company_logo", description: "Set a company's logo image. Provide either a local file path or base64-encoded image data. Stores image in
|
|
31821
|
+
{ name: "set_company_logo", description: "Set a company's logo image. Provide either a local file path or base64-encoded image data. Stores image in the XDG data root images dir and updates logo_url.", inputSchema: { type: "object", properties: { company_id: { type: "string" }, image: { type: "string", description: "File path or base64 data" }, format: { type: "string", description: "Image format hint for raw base64" } }, required: ["company_id", "image"] } },
|
|
31380
31822
|
{ name: "get_company_logo", description: "Get a company's logo as base64 data URI.", inputSchema: { type: "object", properties: { company_id: { type: "string" } }, required: ["company_id"] } },
|
|
31381
31823
|
{ name: "delete_company_logo", description: "Remove a company's logo image.", inputSchema: { type: "object", properties: { company_id: { type: "string" } }, required: ["company_id"] } },
|
|
31382
31824
|
{ name: "set_sensitivity", description: "Set a contact's sensitivity level (normal, confidential, restricted). Restricted contacts are hidden from list/search unless explicitly requested.", inputSchema: { type: "object", properties: { contact_id: { type: "string" }, sensitivity: { type: "string", enum: ["normal", "confidential", "restricted"] } }, required: ["contact_id", "sensitivity"] } },
|
|
@@ -31384,7 +31826,7 @@ var TOOL_DEFINITIONS = [
|
|
|
31384
31826
|
{ name: "vault_unlock", description: "Unlock the vault for this session with a passphrase.", inputSchema: { type: "object", properties: { passphrase: { type: "string" } }, required: ["passphrase"] } },
|
|
31385
31827
|
{ name: "vault_lock", description: "Lock the vault, clearing the encryption key from memory.", inputSchema: { type: "object", properties: {} } },
|
|
31386
31828
|
{ name: "vault_status", description: "Check vault initialization and lock status.", inputSchema: { type: "object", properties: {} } },
|
|
31387
|
-
{ name: "add_document", description: "Store a document for a contact (passport, tax_id, medical_record, etc.). Text values are encrypted; file attachments are stored plain so agents can read them. Vault must be unlocked.", inputSchema: { type: "object", properties: { contact_id: { type: "string" }, doc_type: { type: "string", enum: [...DOCUMENT_TYPES] }, label: { type: "string" }, value: { type: "string", description: "Plaintext value (will be encrypted in DB)" }, file_path: { type: "string", description: "File to attach \u2014 stored PLAIN in
|
|
31829
|
+
{ name: "add_document", description: "Store a document for a contact (passport, tax_id, medical_record, etc.). Text values are encrypted; file attachments are stored plain so agents can read them. Vault must be unlocked.", inputSchema: { type: "object", properties: { contact_id: { type: "string" }, doc_type: { type: "string", enum: [...DOCUMENT_TYPES] }, label: { type: "string" }, value: { type: "string", description: "Plaintext value (will be encrypted in DB)" }, file_path: { type: "string", description: "File to attach \u2014 stored PLAIN in the XDG data root documents dir for agent access" }, metadata: { type: "object" }, expires_at: { type: "string" } }, required: ["contact_id", "doc_type", "value"] } },
|
|
31388
31830
|
{ name: "list_documents", description: "List documents for a contact (metadata only \u2014 no decryption needed). Returns file_path for attachments so agents can read them directly.", inputSchema: { type: "object", properties: { contact_id: { type: "string" } }, required: ["contact_id"] } },
|
|
31389
31831
|
{ name: "get_document", description: "Get a document with decrypted value and file_path. Vault must be unlocked for the text value; file is always accessible.", inputSchema: { type: "object", properties: { document_id: { type: "string" } }, required: ["document_id"] } },
|
|
31390
31832
|
{ name: "get_document_file", description: "Get the plain file path for a document attachment. Agents can read this file directly \u2014 it is NOT encrypted. Returns null if no file attached.", inputSchema: { type: "object", properties: { document_id: { type: "string" } }, required: ["document_id"] } },
|
|
@@ -31494,7 +31936,7 @@ function registerContactsStorageTools(server) {
|
|
|
31494
31936
|
// src/mcp/index.ts
|
|
31495
31937
|
function getServerVersion() {
|
|
31496
31938
|
try {
|
|
31497
|
-
const packageJsonPath =
|
|
31939
|
+
const packageJsonPath = join7(import.meta.dir, "..", "..", "package.json");
|
|
31498
31940
|
const pkg2 = JSON.parse(readFileSync5(packageJsonPath, "utf8"));
|
|
31499
31941
|
return pkg2.version ?? "0.0.0";
|
|
31500
31942
|
} catch {
|
|
@@ -34457,7 +34899,7 @@ async function handleV1Request(req, url) {
|
|
|
34457
34899
|
|
|
34458
34900
|
// src/lib/package-version.ts
|
|
34459
34901
|
import { existsSync as existsSync8, readFileSync as readFileSync7 } from "fs";
|
|
34460
|
-
import { dirname as dirname2, join as
|
|
34902
|
+
import { dirname as dirname2, join as join8 } from "path";
|
|
34461
34903
|
import { fileURLToPath } from "url";
|
|
34462
34904
|
var cached3 = null;
|
|
34463
34905
|
function getPackageVersion() {
|
|
@@ -34466,7 +34908,7 @@ function getPackageVersion() {
|
|
|
34466
34908
|
try {
|
|
34467
34909
|
let dir = dirname2(fileURLToPath(import.meta.url));
|
|
34468
34910
|
for (let i = 0;i < 8; i++) {
|
|
34469
|
-
const pkgPath =
|
|
34911
|
+
const pkgPath = join8(dir, "package.json");
|
|
34470
34912
|
if (existsSync8(pkgPath)) {
|
|
34471
34913
|
const pkg2 = JSON.parse(readFileSync7(pkgPath, "utf8"));
|
|
34472
34914
|
if (pkg2.name === "@hasna/contacts" && pkg2.version) {
|
|
@@ -35052,7 +35494,7 @@ function buildV1OpenApiDocument(version2 = getPackageVersion()) {
|
|
|
35052
35494
|
|
|
35053
35495
|
// src/server/serve.ts
|
|
35054
35496
|
init_cloud();
|
|
35055
|
-
var DASHBOARD_DIST =
|
|
35497
|
+
var DASHBOARD_DIST = join9(import.meta.dir, "../../dashboard/dist");
|
|
35056
35498
|
var DEFAULT_REST_HOST = "127.0.0.1";
|
|
35057
35499
|
function json6(data, status = 200) {
|
|
35058
35500
|
return new Response(JSON.stringify(data), {
|
|
@@ -35085,9 +35527,9 @@ function requireScope(req, scope, options) {
|
|
|
35085
35527
|
function isResponse(value) {
|
|
35086
35528
|
return value instanceof Response;
|
|
35087
35529
|
}
|
|
35088
|
-
function privateFileHeaders(
|
|
35530
|
+
function privateFileHeaders(contentType2) {
|
|
35089
35531
|
return {
|
|
35090
|
-
...
|
|
35532
|
+
...contentType2 ? { "Content-Type": contentType2 } : {},
|
|
35091
35533
|
"Cache-Control": "private, no-store",
|
|
35092
35534
|
"X-Content-Type-Options": "nosniff"
|
|
35093
35535
|
};
|
|
@@ -35095,8 +35537,8 @@ function privateFileHeaders(contentType) {
|
|
|
35095
35537
|
function isSafeEntityId(id) {
|
|
35096
35538
|
return /^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$/.test(id) && !id.includes("..") && !id.includes("/");
|
|
35097
35539
|
}
|
|
35098
|
-
function isPathInside(
|
|
35099
|
-
const base = resolve2(
|
|
35540
|
+
function isPathInside(baseDir2, filePath) {
|
|
35541
|
+
const base = resolve2(baseDir2);
|
|
35100
35542
|
const file = resolve2(filePath);
|
|
35101
35543
|
const rel = relative(base, file);
|
|
35102
35544
|
return rel === "" || !!rel && !rel.startsWith("..") && !rel.startsWith("/") && !rel.includes("..\\");
|
|
@@ -35368,15 +35810,15 @@ async function handleImages(req, _url2, segments, options) {
|
|
|
35368
35810
|
const principal = requireScope(req, "images:write", options);
|
|
35369
35811
|
if (isResponse(principal))
|
|
35370
35812
|
return principal;
|
|
35371
|
-
const
|
|
35372
|
-
if (
|
|
35813
|
+
const contentType2 = req.headers.get("content-type") || "";
|
|
35814
|
+
if (contentType2.includes("multipart/form-data")) {
|
|
35373
35815
|
const formData = await req.formData();
|
|
35374
35816
|
const file = formData.get("image");
|
|
35375
35817
|
if (!file)
|
|
35376
35818
|
return apiError("No image file in form data");
|
|
35377
35819
|
const ext = file.name?.split(".").pop() || "jpg";
|
|
35378
35820
|
const buffer = Buffer.from(await file.arrayBuffer());
|
|
35379
|
-
const tmpPath =
|
|
35821
|
+
const tmpPath = join9(getImagesDir(), `_upload_${entityId}.${ext}`);
|
|
35380
35822
|
const { writeFileSync: wfs } = await import("fs");
|
|
35381
35823
|
wfs(tmpPath, buffer);
|
|
35382
35824
|
try {
|
|
@@ -35497,8 +35939,8 @@ function createContactsRequestHandler(options = {}) {
|
|
|
35497
35939
|
if (isResponse(principal)) {
|
|
35498
35940
|
response = principal;
|
|
35499
35941
|
} else {
|
|
35500
|
-
const filePath =
|
|
35501
|
-
response = serveStaticFile(filePath) ?? serveStaticFile(
|
|
35942
|
+
const filePath = join9(DASHBOARD_DIST, url.pathname === "/" ? "index.html" : url.pathname);
|
|
35943
|
+
response = serveStaticFile(filePath) ?? serveStaticFile(join9(DASHBOARD_DIST, "index.html")) ?? new Response("Not Found", { status: 404 });
|
|
35502
35944
|
}
|
|
35503
35945
|
}
|
|
35504
35946
|
} catch (err2) {
|