apple-notes-mcp 2.15.12 → 2.15.13

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.
Files changed (2) hide show
  1. package/build/index.js +80 -24
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -3110,9 +3110,9 @@ var require_data = __commonJS({
3110
3110
  }
3111
3111
  });
3112
3112
 
3113
- // node_modules/.pnpm/fast-uri@3.1.8/node_modules/fast-uri/lib/utils.js
3113
+ // node_modules/.pnpm/fast-uri@3.1.9/node_modules/fast-uri/lib/utils.js
3114
3114
  var require_utils = __commonJS({
3115
- "node_modules/.pnpm/fast-uri@3.1.8/node_modules/fast-uri/lib/utils.js"(exports, module) {
3115
+ "node_modules/.pnpm/fast-uri@3.1.9/node_modules/fast-uri/lib/utils.js"(exports, module) {
3116
3116
  "use strict";
3117
3117
  var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
3118
3118
  var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
@@ -3344,6 +3344,37 @@ var require_utils = __commonJS({
3344
3344
  }
3345
3345
  return output2.join("");
3346
3346
  }
3347
+ function removeDotSegmentsRelative(path10) {
3348
+ if (path10 === "" || path10[0] === "/") {
3349
+ return removeDotSegments(path10);
3350
+ }
3351
+ const segments = path10.split("/");
3352
+ const last = segments.length - 1;
3353
+ const output2 = [];
3354
+ let trailingDirectory = false;
3355
+ for (let i = 0; i <= last; i++) {
3356
+ const segment = segments[i];
3357
+ if (segment === "." || segment === "..") {
3358
+ if (segment === "..") {
3359
+ if (output2.length !== 0 && output2[output2.length - 1] !== "..") {
3360
+ output2.pop();
3361
+ } else {
3362
+ output2.push("..");
3363
+ }
3364
+ }
3365
+ trailingDirectory = i === last;
3366
+ } else {
3367
+ output2.push(segment);
3368
+ }
3369
+ }
3370
+ if (trailingDirectory && output2[output2.length - 1] !== "..") {
3371
+ output2.push("");
3372
+ }
3373
+ if (output2.length === 0 || output2[0] === "" || output2[0].includes(":")) {
3374
+ output2.unshift(".");
3375
+ }
3376
+ return output2.join("/");
3377
+ }
3347
3378
  var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
3348
3379
  var HOST_DELIM_RE = /[@/?#:]/g;
3349
3380
  var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
@@ -3604,6 +3635,7 @@ var require_utils = __commonJS({
3604
3635
  encodeFragment,
3605
3636
  escapePreservingEscapes,
3606
3637
  removeDotSegments,
3638
+ removeDotSegmentsRelative,
3607
3639
  isIPv4,
3608
3640
  isUUID,
3609
3641
  normalizeIPv6,
@@ -3612,9 +3644,9 @@ var require_utils = __commonJS({
3612
3644
  }
3613
3645
  });
3614
3646
 
3615
- // node_modules/.pnpm/fast-uri@3.1.8/node_modules/fast-uri/lib/schemes.js
3647
+ // node_modules/.pnpm/fast-uri@3.1.9/node_modules/fast-uri/lib/schemes.js
3616
3648
  var require_schemes = __commonJS({
3617
- "node_modules/.pnpm/fast-uri@3.1.8/node_modules/fast-uri/lib/schemes.js"(exports, module) {
3649
+ "node_modules/.pnpm/fast-uri@3.1.9/node_modules/fast-uri/lib/schemes.js"(exports, module) {
3618
3650
  "use strict";
3619
3651
  var { isUUID } = require_utils();
3620
3652
  var URN_REG = /^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu;
@@ -3823,20 +3855,22 @@ var require_schemes = __commonJS({
3823
3855
  }
3824
3856
  });
3825
3857
 
3826
- // node_modules/.pnpm/fast-uri@3.1.8/node_modules/fast-uri/index.js
3858
+ // node_modules/.pnpm/fast-uri@3.1.9/node_modules/fast-uri/index.js
3827
3859
  var require_fast_uri = __commonJS({
3828
- "node_modules/.pnpm/fast-uri@3.1.8/node_modules/fast-uri/index.js"(exports, module) {
3860
+ "node_modules/.pnpm/fast-uri@3.1.9/node_modules/fast-uri/index.js"(exports, module) {
3829
3861
  "use strict";
3830
- var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
3862
+ var { normalizeIPv6, removeDotSegments, removeDotSegmentsRelative, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
3831
3863
  var { SCHEMES, getSchemeHandler } = require_schemes();
3832
3864
  var VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u;
3833
3865
  var MALFORMED_SCHEME_ERROR = "URI scheme is malformed.";
3834
- function decodeValidScheme(scheme) {
3835
- const decodedScheme = unescape(String(scheme));
3836
- if (!VALID_SCHEME.test(decodedScheme)) {
3866
+ var MALFORMED_HOST_ERROR = "URI host is malformed.";
3867
+ var FORBIDDEN_DOMAIN_HOST_CHARACTER = /[\0-\x20"#/:<>?@[\\\]^`{|}\x7F]/u;
3868
+ function validateScheme(scheme) {
3869
+ const stringScheme = String(scheme);
3870
+ if (!VALID_SCHEME.test(stringScheme)) {
3837
3871
  throw new TypeError(MALFORMED_SCHEME_ERROR);
3838
3872
  }
3839
- return decodedScheme;
3873
+ return stringScheme;
3840
3874
  }
3841
3875
  function normalize(uri, options) {
3842
3876
  if (typeof uri === "string") {
@@ -3873,6 +3907,9 @@ var require_fast_uri = __commonJS({
3873
3907
  const resolvedSchemeHandler = getSchemeHandler(options && options.scheme || resolved.scheme);
3874
3908
  const resolvedHost = resolved.host;
3875
3909
  const resolvedHostIsIP = resolvedHost !== void 0 && resolvedHost !== "" && (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6);
3910
+ if (hasForbiddenDomainHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP)) {
3911
+ throw new Error(MALFORMED_HOST_ERROR);
3912
+ }
3876
3913
  canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP);
3877
3914
  const encodedASCIIHost = resolvedHost && resolvedHost.indexOf("%") !== -1 && !new RegExp("\\P{ASCII}", "u").test(resolvedHost);
3878
3915
  if (resolved.error && !encodedASCIIHost) {
@@ -3914,14 +3951,15 @@ var require_fast_uri = __commonJS({
3914
3951
  if (relative5.path[0] === "/") {
3915
3952
  target.path = removeDotSegments(relative5.path);
3916
3953
  } else {
3917
- if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) {
3954
+ const baseHasAuthority = base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0;
3955
+ if (baseHasAuthority && !base.path) {
3918
3956
  target.path = "/" + relative5.path;
3919
3957
  } else if (!base.path) {
3920
3958
  target.path = relative5.path;
3921
3959
  } else {
3922
3960
  target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative5.path;
3923
3961
  }
3924
- target.path = removeDotSegments(target.path);
3962
+ target.path = base.scheme === void 0 && !baseHasAuthority && target.path[0] !== "/" ? removeDotSegmentsRelative(target.path) : removeDotSegments(target.path);
3925
3963
  }
3926
3964
  target.query = relative5.query;
3927
3965
  }
@@ -3959,12 +3997,13 @@ var require_fast_uri = __commonJS({
3959
3997
  const options = Object.assign({}, opts);
3960
3998
  const uriTokens = [];
3961
3999
  if (component2.scheme) {
3962
- component2.scheme = decodeValidScheme(component2.scheme);
4000
+ component2.scheme = validateScheme(component2.scheme);
3963
4001
  }
3964
4002
  const schemeHandler = getSchemeHandler(options.scheme || component2.scheme);
3965
4003
  if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component2, options);
3966
4004
  const hasAuthority = component2.userinfo !== void 0 || component2.host !== void 0 || component2.port !== void 0;
3967
- const pathNoScheme = !options.skipEscape && component2.scheme === void 0 && !hasAuthority;
4005
+ const schemelessReference = (component2.scheme === void 0 || options.reference === "suffix") && !hasAuthority;
4006
+ const pathNoScheme = !options.skipEscape && schemelessReference;
3968
4007
  if (component2.path !== void 0) {
3969
4008
  if (!options.skipEscape) {
3970
4009
  component2.path = serializePathEncoding(component2.path, pathNoScheme);
@@ -3973,7 +4012,7 @@ var require_fast_uri = __commonJS({
3973
4012
  }
3974
4013
  }
3975
4014
  if (options.reference !== "suffix" && component2.scheme) {
3976
- component2.scheme = decodeValidScheme(component2.scheme);
4015
+ component2.scheme = validateScheme(component2.scheme);
3977
4016
  uriTokens.push(component2.scheme, ":");
3978
4017
  }
3979
4018
  const authority = recomposeAuthority(component2);
@@ -3989,9 +4028,9 @@ var require_fast_uri = __commonJS({
3989
4028
  if (component2.path !== void 0) {
3990
4029
  let s = component2.path;
3991
4030
  if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
3992
- s = removeDotSegments(s);
4031
+ s = schemelessReference && s[0] !== "/" ? removeDotSegmentsRelative(s) : removeDotSegments(s);
3993
4032
  }
3994
- if (pathNoScheme) {
4033
+ if (schemelessReference) {
3995
4034
  s = serializePathEncoding(s, true);
3996
4035
  }
3997
4036
  if (authority === void 0 && s[0] === "/" && s[1] === "/") {
@@ -4038,16 +4077,34 @@ var require_fast_uri = __commonJS({
4038
4077
  return hasMalformedPercentEncoding(matches[3]) || host !== void 0 && !isIPLiteral(host) && hasMalformedPercentEncoding(host) || hasMalformedPercentEncoding(matches[6]) || hasMalformedPercentEncoding(matches[7]) || hasMalformedPercentEncoding(matches[8]);
4039
4078
  }
4040
4079
  function canonicalizeHost(parsed2, options, schemeHandler, isIP) {
4080
+ if (hasForbiddenDomainHost(parsed2, options, schemeHandler, isIP)) {
4081
+ parsed2.error = parsed2.error || MALFORMED_HOST_ERROR;
4082
+ return true;
4083
+ }
4041
4084
  if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed2.host && !isIPLiteral(parsed2.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed2.host)) {
4085
+ let url2;
4042
4086
  try {
4043
- parsed2.host = new URL("http://" + parsed2.host).hostname;
4087
+ url2 = new URL("http://" + parsed2.host);
4044
4088
  } catch (e) {
4045
4089
  parsed2.error = parsed2.error || "Host's domain name can not be converted to ASCII: " + e;
4046
4090
  return true;
4047
4091
  }
4092
+ if (!isHostOnlyURL(url2)) {
4093
+ parsed2.error = parsed2.error || MALFORMED_HOST_ERROR;
4094
+ return true;
4095
+ }
4096
+ parsed2.host = url2.hostname;
4048
4097
  }
4049
4098
  return false;
4050
4099
  }
4100
+ function hasForbiddenDomainHost(parsed2, options, schemeHandler, isIP) {
4101
+ return Boolean(
4102
+ parsed2.host && isIP === false && !isIPLiteral(parsed2.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && FORBIDDEN_DOMAIN_HOST_CHARACTER.test(parsed2.host)
4103
+ );
4104
+ }
4105
+ function isHostOnlyURL(url2) {
4106
+ return url2.username === "" && url2.password === "" && url2.port === "" && url2.pathname === "/" && url2.search === "" && url2.hash === "" && url2.hostname !== "";
4107
+ }
4051
4108
  function parseWithStatus(uri, opts) {
4052
4109
  const options = Object.assign({}, opts);
4053
4110
  const parsed2 = {
@@ -4102,9 +4159,8 @@ var require_fast_uri = __commonJS({
4102
4159
  parsed2.query = matches[7];
4103
4160
  parsed2.fragment = matches[8];
4104
4161
  if (parsed2.scheme !== void 0) {
4105
- const decodedScheme = unescape(parsed2.scheme);
4106
- if (VALID_SCHEME.test(decodedScheme)) {
4107
- parsed2.scheme = decodedScheme.toLowerCase();
4162
+ if (VALID_SCHEME.test(parsed2.scheme)) {
4163
+ parsed2.scheme = parsed2.scheme.toLowerCase();
4108
4164
  } else {
4109
4165
  parsed2.error = parsed2.error || MALFORMED_SCHEME_ERROR;
4110
4166
  malformedScheme = true;
@@ -4132,7 +4188,7 @@ var require_fast_uri = __commonJS({
4132
4188
  malformedIPLiteral = hasIPLiteralBracket && (!bracketedIPLiteral || ipv6result.error === true);
4133
4189
  parsed2.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase();
4134
4190
  if (malformedIPLiteral) {
4135
- parsed2.error = parsed2.error || "URI host is malformed.";
4191
+ parsed2.error = parsed2.error || MALFORMED_HOST_ERROR;
4136
4192
  malformedAuthorityOrPort = true;
4137
4193
  }
4138
4194
  } else {
@@ -4160,7 +4216,7 @@ var require_fast_uri = __commonJS({
4160
4216
  if (!isIP) {
4161
4217
  host = normalizePercentEncoding(host.toLowerCase());
4162
4218
  }
4163
- parsed2.host = reescapeHostDelimiters(host, isIP);
4219
+ parsed2.host = isIP || options.scheme !== "null" ? reescapeHostDelimiters(host, isIP) : host;
4164
4220
  }
4165
4221
  if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
4166
4222
  if (parsed2.path) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apple-notes-mcp",
3
- "version": "2.15.12",
3
+ "version": "2.15.13",
4
4
  "description": "MCP server for Apple Notes - read, search, create, edit, organize, and export notes on macOS via Claude and other AI assistants",
5
5
  "type": "module",
6
6
  "main": "build/index.js",