@yawlabs/ctxlint 0.14.0 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@
4
4
  # Version-pinned so a checkout at `rev: vX.Y.Z` runs exactly that release
5
5
  # of ctxlint — matches the pinning done by `ctxlint init`. release.sh keeps
6
6
  # this in sync with package.json on each bump.
7
- entry: npx @yawlabs/ctxlint@0.14.0 --strict
7
+ entry: npx @yawlabs/ctxlint@0.14.1 --strict
8
8
  language: node
9
9
  always_run: true
10
10
  pass_filenames: false
package/dist/index.js CHANGED
@@ -25932,13 +25932,16 @@ var require_data = __commonJS({
25932
25932
  }
25933
25933
  });
25934
25934
 
25935
- // node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js
25935
+ // node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/utils.js
25936
25936
  var require_utils = __commonJS({
25937
- "node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js"(exports, module) {
25937
+ "node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/utils.js"(exports, module) {
25938
25938
  "use strict";
25939
25939
  init_define_WEB_FIRST_SEGMENTS();
25940
25940
  var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
25941
25941
  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);
25942
+ var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
25943
+ var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
25944
+ var isPathCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);
25942
25945
  function stringArrayToHexStripped(input) {
25943
25946
  let acc = "";
25944
25947
  let code = 0;
@@ -26131,27 +26134,77 @@ var require_utils = __commonJS({
26131
26134
  }
26132
26135
  return output.join("");
26133
26136
  }
26134
- function normalizeComponentEncoding(component, esc2) {
26135
- const func = esc2 !== true ? escape : unescape;
26136
- if (component.scheme !== void 0) {
26137
- component.scheme = func(component.scheme);
26138
- }
26139
- if (component.userinfo !== void 0) {
26140
- component.userinfo = func(component.userinfo);
26141
- }
26142
- if (component.host !== void 0) {
26143
- component.host = func(component.host);
26137
+ var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
26138
+ var HOST_DELIM_RE = /[@/?#:]/g;
26139
+ var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
26140
+ function reescapeHostDelimiters(host, isIP) {
26141
+ const re2 = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE;
26142
+ re2.lastIndex = 0;
26143
+ return host.replace(re2, (ch) => HOST_DELIMS[ch]);
26144
+ }
26145
+ function normalizePercentEncoding(input, decodeUnreserved = false) {
26146
+ if (input.indexOf("%") === -1) {
26147
+ return input;
26144
26148
  }
26145
- if (component.path !== void 0) {
26146
- component.path = func(component.path);
26149
+ let output = "";
26150
+ for (let i2 = 0; i2 < input.length; i2++) {
26151
+ if (input[i2] === "%" && i2 + 2 < input.length) {
26152
+ const hex3 = input.slice(i2 + 1, i2 + 3);
26153
+ if (isHexPair(hex3)) {
26154
+ const normalizedHex = hex3.toUpperCase();
26155
+ const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
26156
+ if (decodeUnreserved && isUnreserved(decoded)) {
26157
+ output += decoded;
26158
+ } else {
26159
+ output += "%" + normalizedHex;
26160
+ }
26161
+ i2 += 2;
26162
+ continue;
26163
+ }
26164
+ }
26165
+ output += input[i2];
26147
26166
  }
26148
- if (component.query !== void 0) {
26149
- component.query = func(component.query);
26167
+ return output;
26168
+ }
26169
+ function normalizePathEncoding(input) {
26170
+ let output = "";
26171
+ for (let i2 = 0; i2 < input.length; i2++) {
26172
+ if (input[i2] === "%" && i2 + 2 < input.length) {
26173
+ const hex3 = input.slice(i2 + 1, i2 + 3);
26174
+ if (isHexPair(hex3)) {
26175
+ const normalizedHex = hex3.toUpperCase();
26176
+ const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
26177
+ if (decoded !== "." && isUnreserved(decoded)) {
26178
+ output += decoded;
26179
+ } else {
26180
+ output += "%" + normalizedHex;
26181
+ }
26182
+ i2 += 2;
26183
+ continue;
26184
+ }
26185
+ }
26186
+ if (isPathCharacter(input[i2])) {
26187
+ output += input[i2];
26188
+ } else {
26189
+ output += escape(input[i2]);
26190
+ }
26150
26191
  }
26151
- if (component.fragment !== void 0) {
26152
- component.fragment = func(component.fragment);
26192
+ return output;
26193
+ }
26194
+ function escapePreservingEscapes(input) {
26195
+ let output = "";
26196
+ for (let i2 = 0; i2 < input.length; i2++) {
26197
+ if (input[i2] === "%" && i2 + 2 < input.length) {
26198
+ const hex3 = input.slice(i2 + 1, i2 + 3);
26199
+ if (isHexPair(hex3)) {
26200
+ output += "%" + hex3.toUpperCase();
26201
+ i2 += 2;
26202
+ continue;
26203
+ }
26204
+ }
26205
+ output += escape(input[i2]);
26153
26206
  }
26154
- return component;
26207
+ return output;
26155
26208
  }
26156
26209
  function recomposeAuthority(component) {
26157
26210
  const uriTokens = [];
@@ -26166,7 +26219,7 @@ var require_utils = __commonJS({
26166
26219
  if (ipV6res.isIPV6 === true) {
26167
26220
  host = `[${ipV6res.escapedHost}]`;
26168
26221
  } else {
26169
- host = component.host;
26222
+ host = reescapeHostDelimiters(host, false);
26170
26223
  }
26171
26224
  }
26172
26225
  uriTokens.push(host);
@@ -26180,7 +26233,10 @@ var require_utils = __commonJS({
26180
26233
  module.exports = {
26181
26234
  nonSimpleDomain,
26182
26235
  recomposeAuthority,
26183
- normalizeComponentEncoding,
26236
+ reescapeHostDelimiters,
26237
+ normalizePercentEncoding,
26238
+ normalizePathEncoding,
26239
+ escapePreservingEscapes,
26184
26240
  removeDotSegments,
26185
26241
  isIPv4,
26186
26242
  isUUID,
@@ -26190,9 +26246,9 @@ var require_utils = __commonJS({
26190
26246
  }
26191
26247
  });
26192
26248
 
26193
- // node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js
26249
+ // node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/schemes.js
26194
26250
  var require_schemes = __commonJS({
26195
- "node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js"(exports, module) {
26251
+ "node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/schemes.js"(exports, module) {
26196
26252
  "use strict";
26197
26253
  init_define_WEB_FIRST_SEGMENTS();
26198
26254
  var { isUUID } = require_utils();
@@ -26401,17 +26457,17 @@ var require_schemes = __commonJS({
26401
26457
  }
26402
26458
  });
26403
26459
 
26404
- // node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js
26460
+ // node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/index.js
26405
26461
  var require_fast_uri = __commonJS({
26406
- "node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js"(exports, module) {
26462
+ "node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/index.js"(exports, module) {
26407
26463
  "use strict";
26408
26464
  init_define_WEB_FIRST_SEGMENTS();
26409
- var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils();
26465
+ var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
26410
26466
  var { SCHEMES, getSchemeHandler } = require_schemes();
26411
26467
  function normalize3(uri, options) {
26412
26468
  if (typeof uri === "string") {
26413
26469
  uri = /** @type {T} */
26414
- serialize(parse4(uri, options), options);
26470
+ normalizeString(uri, options);
26415
26471
  } else if (typeof uri === "object") {
26416
26472
  uri = /** @type {T} */
26417
26473
  parse4(serialize(uri, options), options);
@@ -26478,19 +26534,9 @@ var require_fast_uri = __commonJS({
26478
26534
  return target;
26479
26535
  }
26480
26536
  function equal(uriA, uriB, options) {
26481
- if (typeof uriA === "string") {
26482
- uriA = unescape(uriA);
26483
- uriA = serialize(normalizeComponentEncoding(parse4(uriA, options), true), { ...options, skipEscape: true });
26484
- } else if (typeof uriA === "object") {
26485
- uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true });
26486
- }
26487
- if (typeof uriB === "string") {
26488
- uriB = unescape(uriB);
26489
- uriB = serialize(normalizeComponentEncoding(parse4(uriB, options), true), { ...options, skipEscape: true });
26490
- } else if (typeof uriB === "object") {
26491
- uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true });
26492
- }
26493
- return uriA.toLowerCase() === uriB.toLowerCase();
26537
+ const normalizedA = normalizeComparableURI(uriA, options);
26538
+ const normalizedB = normalizeComparableURI(uriB, options);
26539
+ return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA.toLowerCase() === normalizedB.toLowerCase();
26494
26540
  }
26495
26541
  function serialize(cmpts, opts) {
26496
26542
  const component = {
@@ -26515,12 +26561,12 @@ var require_fast_uri = __commonJS({
26515
26561
  if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
26516
26562
  if (component.path !== void 0) {
26517
26563
  if (!options.skipEscape) {
26518
- component.path = escape(component.path);
26564
+ component.path = escapePreservingEscapes(component.path);
26519
26565
  if (component.scheme !== void 0) {
26520
26566
  component.path = component.path.split("%3A").join(":");
26521
26567
  }
26522
26568
  } else {
26523
- component.path = unescape(component.path);
26569
+ component.path = normalizePercentEncoding(component.path);
26524
26570
  }
26525
26571
  }
26526
26572
  if (options.reference !== "suffix" && component.scheme) {
@@ -26555,7 +26601,16 @@ var require_fast_uri = __commonJS({
26555
26601
  return uriTokens.join("");
26556
26602
  }
26557
26603
  var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
26558
- function parse4(uri, opts) {
26604
+ function getParseError(parsed, matches) {
26605
+ if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
26606
+ return 'URI path must start with "/" when authority is present.';
26607
+ }
26608
+ if (typeof parsed.port === "number" && (parsed.port < 0 || parsed.port > 65535)) {
26609
+ return "URI port is malformed.";
26610
+ }
26611
+ return void 0;
26612
+ }
26613
+ function parseWithStatus(uri, opts) {
26559
26614
  const options = Object.assign({}, opts);
26560
26615
  const parsed = {
26561
26616
  scheme: void 0,
@@ -26566,6 +26621,7 @@ var require_fast_uri = __commonJS({
26566
26621
  query: void 0,
26567
26622
  fragment: void 0
26568
26623
  };
26624
+ let malformedAuthorityOrPort = false;
26569
26625
  let isIP = false;
26570
26626
  if (options.reference === "suffix") {
26571
26627
  if (options.scheme) {
@@ -26586,6 +26642,11 @@ var require_fast_uri = __commonJS({
26586
26642
  if (isNaN(parsed.port)) {
26587
26643
  parsed.port = matches[5];
26588
26644
  }
26645
+ const parseError = getParseError(parsed, matches);
26646
+ if (parseError !== void 0) {
26647
+ parsed.error = parsed.error || parseError;
26648
+ malformedAuthorityOrPort = true;
26649
+ }
26589
26650
  if (parsed.host) {
26590
26651
  const ipv4result = isIPv4(parsed.host);
26591
26652
  if (ipv4result === false) {
@@ -26624,14 +26685,18 @@ var require_fast_uri = __commonJS({
26624
26685
  parsed.scheme = unescape(parsed.scheme);
26625
26686
  }
26626
26687
  if (parsed.host !== void 0) {
26627
- parsed.host = unescape(parsed.host);
26688
+ parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP);
26628
26689
  }
26629
26690
  }
26630
26691
  if (parsed.path) {
26631
- parsed.path = escape(unescape(parsed.path));
26692
+ parsed.path = normalizePathEncoding(parsed.path);
26632
26693
  }
26633
26694
  if (parsed.fragment) {
26634
- parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
26695
+ try {
26696
+ parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
26697
+ } catch {
26698
+ parsed.error = parsed.error || "URI malformed";
26699
+ }
26635
26700
  }
26636
26701
  }
26637
26702
  if (schemeHandler && schemeHandler.parse) {
@@ -26640,7 +26705,29 @@ var require_fast_uri = __commonJS({
26640
26705
  } else {
26641
26706
  parsed.error = parsed.error || "URI can not be parsed.";
26642
26707
  }
26643
- return parsed;
26708
+ return { parsed, malformedAuthorityOrPort };
26709
+ }
26710
+ function parse4(uri, opts) {
26711
+ return parseWithStatus(uri, opts).parsed;
26712
+ }
26713
+ function normalizeString(uri, opts) {
26714
+ return normalizeStringWithStatus(uri, opts).normalized;
26715
+ }
26716
+ function normalizeStringWithStatus(uri, opts) {
26717
+ const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
26718
+ return {
26719
+ normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),
26720
+ malformedAuthorityOrPort
26721
+ };
26722
+ }
26723
+ function normalizeComparableURI(uri, opts) {
26724
+ if (typeof uri === "string") {
26725
+ const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts);
26726
+ return malformedAuthorityOrPort ? void 0 : normalized;
26727
+ }
26728
+ if (typeof uri === "object") {
26729
+ return serialize(uri, opts);
26730
+ }
26644
26731
  }
26645
26732
  var fastUri = {
26646
26733
  SCHEMES,
@@ -46327,7 +46414,7 @@ import { readFileSync as readFileSync7 } from "node:fs";
46327
46414
  import { resolve as resolve12, dirname as dirname6 } from "node:path";
46328
46415
  import { fileURLToPath as fileURLToPath2 } from "node:url";
46329
46416
  function loadVersion() {
46330
- if (true) return "0.13.3";
46417
+ if (true) return "0.14.0";
46331
46418
  const __dir = dirname6(fileURLToPath2(import.meta.url));
46332
46419
  const pkgPath = resolve12(__dir, "../package.json");
46333
46420
  const pkg = JSON.parse(readFileSync7(pkgPath, "utf-8"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yawlabs/ctxlint",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "mcpName": "io.github.YawLabs/ctxlint",
5
5
  "description": "Lint your AI agent context files, MCP server configs, and session data against your actual codebase",
6
6
  "bin": {
@@ -110,9 +110,13 @@
110
110
  "esbuild"
111
111
  ],
112
112
  "overrides": {
113
- "hono": "^4.12.14",
113
+ "hono": "^4.12.21",
114
114
  "@hono/node-server": "^1.19.13",
115
- "vite": "^8.0.8"
115
+ "vite": "^8.0.8",
116
+ "fast-uri": "^3.1.2",
117
+ "postcss": "^8.5.10",
118
+ "qs": "^6.15.2",
119
+ "ip-address": "^10.1.1"
116
120
  }
117
121
  }
118
122
  }