superbee 0.4.6-pre.2 → 0.4.6-pre.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@ import path from "node:path";
5
5
 
6
6
  // ../core/src/path-fold.ts
7
7
  function foldPath(path2) {
8
- return path2.normalize("NFC").toLowerCase().toUpperCase().toLowerCase().normalize("NFC");
8
+ return path2.normalize("NFD").toLowerCase().toUpperCase().toLowerCase().normalize("NFC");
9
9
  }
10
10
 
11
11
  // ../core/src/errors.ts
@@ -3665,6 +3665,8 @@ function extractMarkdownLinkSpans(source, options = {}) {
3665
3665
  const body = options.skipCode ? maskMarkdownCode(source) : source;
3666
3666
  const out = [];
3667
3667
  let textOpen = -1;
3668
+ let codeOpen = -1;
3669
+ let masked;
3668
3670
  let afterClose;
3669
3671
  let hrefFirst;
3670
3672
  let hrefRest;
@@ -3683,6 +3685,7 @@ function extractMarkdownLinkSpans(source, options = {}) {
3683
3685
  image
3684
3686
  });
3685
3687
  textOpen = -1;
3688
+ codeOpen = -1;
3686
3689
  afterClose = void 0;
3687
3690
  hrefFirst = void 0;
3688
3691
  hrefRest = void 0;
@@ -3703,10 +3706,22 @@ function extractMarkdownLinkSpans(source, options = {}) {
3703
3706
  afterClose = void 0;
3704
3707
  }
3705
3708
  if (textOpen >= 0 && char === "]") {
3706
- afterClose = { open: textOpen, close: cursor };
3709
+ const open = codeOpen >= 0 && masked[cursor] !== "]" ? codeOpen : textOpen;
3710
+ afterClose = { open, close: cursor };
3707
3711
  textOpen = -1;
3712
+ codeOpen = -1;
3713
+ }
3714
+ if (char === "[") {
3715
+ if (textOpen >= 0 && !options.skipCode) {
3716
+ masked ??= maskMarkdownCode(source);
3717
+ if (masked[cursor] !== "[" && masked[textOpen] === "[") {
3718
+ codeOpen = cursor;
3719
+ continue;
3720
+ }
3721
+ }
3722
+ textOpen = cursor;
3723
+ codeOpen = -1;
3708
3724
  }
3709
- if (char === "[" && textOpen < 0) textOpen = cursor;
3710
3725
  }
3711
3726
  return out;
3712
3727
  }
@@ -4716,9 +4731,14 @@ async function acquireFilesystemIdentityLock(key, identity, options = {}) {
4716
4731
  return claimLockPath(path.join(lockRoot, `${key}.lock`), owner, waitMs, pollMs, policy);
4717
4732
  }
4718
4733
 
4734
+ // ../core/src/path-fold.ts
4735
+ function foldPath(path4) {
4736
+ return path4.normalize("NFD").toLowerCase().toUpperCase().toLowerCase().normalize("NFC");
4737
+ }
4738
+
4719
4739
  // ../core/src/identity-fold.ts
4720
4740
  function foldSegment(segment) {
4721
- return segment.normalize("NFKD").toLowerCase().toUpperCase().toLowerCase();
4741
+ return foldPath(segment).normalize("NFD");
4722
4742
  }
4723
4743
 
4724
4744
  // ../core/src/filesystem-temp-name.ts
@@ -4790,7 +4810,10 @@ async function existingAnchor(resolved) {
4790
4810
  async function foldedPhysicalRoot(root) {
4791
4811
  const { anchor, tail } = await existingAnchor(path2.resolve(root));
4792
4812
  const anchorSegments = anchor.split(path2.sep).filter((segment, index) => index === 0 || segment !== "");
4793
- return [...anchorSegments, ...tail].map(foldSegment).join("/");
4813
+ return [...anchorSegments, ...tail].map(foldRootSegment).join("/");
4814
+ }
4815
+ function foldRootSegment(segment) {
4816
+ return segment.normalize("NFKD").toLowerCase().toUpperCase().toLowerCase();
4794
4817
  }
4795
4818
  async function identityKey(root, rel) {
4796
4819
  const foldedRel = relSegments(rel).map(foldSegment).join("/");
@@ -6595,58 +6618,6 @@ function isTerminal(kind, frontmatter2) {
6595
6618
  return false;
6596
6619
  }
6597
6620
 
6598
- // ../core/src/query-selection.ts
6599
- function applyQuerySelectionFilters(rows, params, kinds = []) {
6600
- let out = rows;
6601
- const byGoverns = new Map(kinds.map((kind) => [kind.governs, kind]));
6602
- if (params.field) {
6603
- const eq = params.field.indexOf("=");
6604
- if (eq > 0) {
6605
- const key = params.field.slice(0, eq).trim();
6606
- const values = params.field.slice(eq + 1).split(",").map((value) => value.trim()).filter(Boolean);
6607
- out = out.filter((row) => {
6608
- if (key !== PROGRESS_STATUS_FIELD) {
6609
- return values.some((value) => matchesFilter(row, { fields: { [key]: value } }));
6610
- }
6611
- const kind = byGoverns.get(String(row.frontmatter.type ?? ""));
6612
- if (!kind) return false;
6613
- const raw = readKindField(params.okfVersion, kind, row.frontmatter, key);
6614
- const actual = raw === void 0 || raw === null ? [] : (Array.isArray(raw) ? raw : [raw]).map((value) => String(value));
6615
- return values.some((value) => actual.includes(value));
6616
- });
6617
- }
6618
- }
6619
- if (params.open) {
6620
- out = out.filter((row) => {
6621
- const kind = byGoverns.get(String(row.frontmatter.type ?? ""));
6622
- return !kind || !isTerminal(kind, row.frontmatter);
6623
- });
6624
- }
6625
- const count = out.length;
6626
- if (typeof params.limit === "number" && params.limit > 0) {
6627
- out = out.slice(0, params.limit);
6628
- }
6629
- return { rows: out, count };
6630
- }
6631
-
6632
- // ../core/src/kinds-load.ts
6633
- async function loadKinds(bundle) {
6634
- const warnings = [];
6635
- const docs = await query2(bundle, { prefix: CONVENTIONS_PREFIX, type: CONVENTION_TYPE }, {
6636
- onSkip: ({ id, reason }) => warnings.push({
6637
- code: "KIND_CONVENTION_MALFORMED",
6638
- message: isPermissionDeniedSkip({ reason }) ? `skipped kind convention '${id}' that could not be read: ${reason}` : `skipped kind convention '${id}' with unparseable frontmatter: ${reason}`,
6639
- field: id,
6640
- severity: "warning"
6641
- })
6642
- });
6643
- const okfVersion = await readBundleOkfVersion2(bundle).catch((error) => {
6644
- if (!(error instanceof MalformedDocumentError)) throw error;
6645
- return void 0;
6646
- });
6647
- return buildKindRegistry(docs, warnings, { okfVersion });
6648
- }
6649
-
6650
6621
  // ../core/src/page.ts
6651
6622
  var PAGE_REGISTRY_PREFIX = "pages-registry/";
6652
6623
  var PAGE_ENTRY_PREFIX = "pages/";
@@ -6719,6 +6690,58 @@ function parseRegistration(id, frontmatter2) {
6719
6690
  };
6720
6691
  }
6721
6692
 
6693
+ // ../core/src/query-selection.ts
6694
+ function applyQuerySelectionFilters(rows, params, kinds = []) {
6695
+ let out = rows;
6696
+ const byGoverns = new Map(kinds.map((kind) => [kind.governs, kind]));
6697
+ if (params.field) {
6698
+ const eq = params.field.indexOf("=");
6699
+ if (eq > 0) {
6700
+ const key = params.field.slice(0, eq).trim();
6701
+ const values = params.field.slice(eq + 1).split(",").map((value) => value.trim()).filter(Boolean);
6702
+ out = out.filter((row) => {
6703
+ if (key !== PROGRESS_STATUS_FIELD) {
6704
+ return values.some((value) => matchesFilter(row, { fields: { [key]: value } }));
6705
+ }
6706
+ const kind = byGoverns.get(String(row.frontmatter.type ?? ""));
6707
+ if (!kind) return false;
6708
+ const raw = readKindField(params.okfVersion, kind, row.frontmatter, key);
6709
+ const actual = raw === void 0 || raw === null ? [] : (Array.isArray(raw) ? raw : [raw]).map((value) => String(value));
6710
+ return values.some((value) => actual.includes(value));
6711
+ });
6712
+ }
6713
+ }
6714
+ if (params.open) {
6715
+ out = out.filter((row) => {
6716
+ const kind = byGoverns.get(String(row.frontmatter.type ?? ""));
6717
+ return !kind || !isTerminal(kind, row.frontmatter);
6718
+ });
6719
+ }
6720
+ const count = out.length;
6721
+ if (typeof params.limit === "number" && params.limit > 0) {
6722
+ out = out.slice(0, params.limit);
6723
+ }
6724
+ return { rows: out, count };
6725
+ }
6726
+
6727
+ // ../core/src/kinds-load.ts
6728
+ async function loadKinds(bundle) {
6729
+ const warnings = [];
6730
+ const docs = await query2(bundle, { prefix: CONVENTIONS_PREFIX, type: CONVENTION_TYPE }, {
6731
+ onSkip: ({ id, reason }) => warnings.push({
6732
+ code: "KIND_CONVENTION_MALFORMED",
6733
+ message: isPermissionDeniedSkip({ reason }) ? `skipped kind convention '${id}' that could not be read: ${reason}` : `skipped kind convention '${id}' with unparseable frontmatter: ${reason}`,
6734
+ field: id,
6735
+ severity: "warning"
6736
+ })
6737
+ });
6738
+ const okfVersion = await readBundleOkfVersion2(bundle).catch((error) => {
6739
+ if (!(error instanceof MalformedDocumentError)) throw error;
6740
+ return void 0;
6741
+ });
6742
+ return buildKindRegistry(docs, warnings, { okfVersion });
6743
+ }
6744
+
6722
6745
  // ../core/src/query-order.ts
6723
6746
  function meaningfulChangeOrderKey(id, frontmatter2, okfVersion) {
6724
6747
  const value = meaningfulChangeTimeValue(frontmatter2);
@@ -31626,6 +31626,8 @@ function extractMarkdownLinkSpans(source, options = {}) {
31626
31626
  const body = options.skipCode ? maskMarkdownCode(source) : source;
31627
31627
  const out = [];
31628
31628
  let textOpen = -1;
31629
+ let codeOpen = -1;
31630
+ let masked;
31629
31631
  let afterClose;
31630
31632
  let hrefFirst;
31631
31633
  let hrefRest;
@@ -31644,6 +31646,7 @@ function extractMarkdownLinkSpans(source, options = {}) {
31644
31646
  image
31645
31647
  });
31646
31648
  textOpen = -1;
31649
+ codeOpen = -1;
31647
31650
  afterClose = void 0;
31648
31651
  hrefFirst = void 0;
31649
31652
  hrefRest = void 0;
@@ -31664,10 +31667,22 @@ function extractMarkdownLinkSpans(source, options = {}) {
31664
31667
  afterClose = void 0;
31665
31668
  }
31666
31669
  if (textOpen >= 0 && char === "]") {
31667
- afterClose = { open: textOpen, close: cursor };
31670
+ const open = codeOpen >= 0 && masked[cursor] !== "]" ? codeOpen : textOpen;
31671
+ afterClose = { open, close: cursor };
31668
31672
  textOpen = -1;
31673
+ codeOpen = -1;
31674
+ }
31675
+ if (char === "[") {
31676
+ if (textOpen >= 0 && !options.skipCode) {
31677
+ masked ??= maskMarkdownCode(source);
31678
+ if (masked[cursor] !== "[" && masked[textOpen] === "[") {
31679
+ codeOpen = cursor;
31680
+ continue;
31681
+ }
31682
+ }
31683
+ textOpen = cursor;
31684
+ codeOpen = -1;
31669
31685
  }
31670
- if (char === "[" && textOpen < 0) textOpen = cursor;
31671
31686
  }
31672
31687
  return out;
31673
31688
  }
@@ -32677,9 +32692,14 @@ async function acquireFilesystemIdentityLock(key, identity, options = {}) {
32677
32692
  return claimLockPath(path.join(lockRoot, `${key}.lock`), owner, waitMs, pollMs, policy);
32678
32693
  }
32679
32694
 
32695
+ // ../core/src/path-fold.ts
32696
+ function foldPath(path6) {
32697
+ return path6.normalize("NFD").toLowerCase().toUpperCase().toLowerCase().normalize("NFC");
32698
+ }
32699
+
32680
32700
  // ../core/src/identity-fold.ts
32681
32701
  function foldSegment(segment) {
32682
- return segment.normalize("NFKD").toLowerCase().toUpperCase().toLowerCase();
32702
+ return foldPath(segment).normalize("NFD");
32683
32703
  }
32684
32704
 
32685
32705
  // ../core/src/filesystem-temp-name.ts
@@ -32751,7 +32771,10 @@ async function existingAnchor(resolved) {
32751
32771
  async function foldedPhysicalRoot(root) {
32752
32772
  const { anchor, tail } = await existingAnchor(path2.resolve(root));
32753
32773
  const anchorSegments = anchor.split(path2.sep).filter((segment, index2) => index2 === 0 || segment !== "");
32754
- return [...anchorSegments, ...tail].map(foldSegment).join("/");
32774
+ return [...anchorSegments, ...tail].map(foldRootSegment).join("/");
32775
+ }
32776
+ function foldRootSegment(segment) {
32777
+ return segment.normalize("NFKD").toLowerCase().toUpperCase().toLowerCase();
32755
32778
  }
32756
32779
  async function identityKey(root, rel) {
32757
32780
  const foldedRel = relSegments(rel).map(foldSegment).join("/");
@@ -34586,58 +34609,6 @@ function isTerminal(kind2, frontmatter2) {
34586
34609
  return false;
34587
34610
  }
34588
34611
 
34589
- // ../core/src/query-selection.ts
34590
- function applyQuerySelectionFilters(rows, params, kinds = []) {
34591
- let out = rows;
34592
- const byGoverns = new Map(kinds.map((kind2) => [kind2.governs, kind2]));
34593
- if (params.field) {
34594
- const eq = params.field.indexOf("=");
34595
- if (eq > 0) {
34596
- const key = params.field.slice(0, eq).trim();
34597
- const values = params.field.slice(eq + 1).split(",").map((value) => value.trim()).filter(Boolean);
34598
- out = out.filter((row) => {
34599
- if (key !== PROGRESS_STATUS_FIELD) {
34600
- return values.some((value) => matchesFilter(row, { fields: { [key]: value } }));
34601
- }
34602
- const kind2 = byGoverns.get(String(row.frontmatter.type ?? ""));
34603
- if (!kind2) return false;
34604
- const raw = readKindField(params.okfVersion, kind2, row.frontmatter, key);
34605
- const actual = raw === void 0 || raw === null ? [] : (Array.isArray(raw) ? raw : [raw]).map((value) => String(value));
34606
- return values.some((value) => actual.includes(value));
34607
- });
34608
- }
34609
- }
34610
- if (params.open) {
34611
- out = out.filter((row) => {
34612
- const kind2 = byGoverns.get(String(row.frontmatter.type ?? ""));
34613
- return !kind2 || !isTerminal(kind2, row.frontmatter);
34614
- });
34615
- }
34616
- const count = out.length;
34617
- if (typeof params.limit === "number" && params.limit > 0) {
34618
- out = out.slice(0, params.limit);
34619
- }
34620
- return { rows: out, count };
34621
- }
34622
-
34623
- // ../core/src/kinds-load.ts
34624
- async function loadKinds(bundle) {
34625
- const warnings = [];
34626
- const docs = await query2(bundle, { prefix: CONVENTIONS_PREFIX, type: CONVENTION_TYPE }, {
34627
- onSkip: ({ id, reason }) => warnings.push({
34628
- code: "KIND_CONVENTION_MALFORMED",
34629
- message: isPermissionDeniedSkip({ reason }) ? `skipped kind convention '${id}' that could not be read: ${reason}` : `skipped kind convention '${id}' with unparseable frontmatter: ${reason}`,
34630
- field: id,
34631
- severity: "warning"
34632
- })
34633
- });
34634
- const okfVersion = await readBundleOkfVersion2(bundle).catch((error) => {
34635
- if (!(error instanceof MalformedDocumentError)) throw error;
34636
- return void 0;
34637
- });
34638
- return buildKindRegistry(docs, warnings, { okfVersion });
34639
- }
34640
-
34641
34612
  // ../core/src/page.ts
34642
34613
  var PAGE_REGISTRY_PREFIX = "pages-registry/";
34643
34614
  var PAGE_ENTRY_PREFIX = "pages/";
@@ -34719,6 +34690,58 @@ function parseRegistration(id, frontmatter2) {
34719
34690
  };
34720
34691
  }
34721
34692
 
34693
+ // ../core/src/query-selection.ts
34694
+ function applyQuerySelectionFilters(rows, params, kinds = []) {
34695
+ let out = rows;
34696
+ const byGoverns = new Map(kinds.map((kind2) => [kind2.governs, kind2]));
34697
+ if (params.field) {
34698
+ const eq = params.field.indexOf("=");
34699
+ if (eq > 0) {
34700
+ const key = params.field.slice(0, eq).trim();
34701
+ const values = params.field.slice(eq + 1).split(",").map((value) => value.trim()).filter(Boolean);
34702
+ out = out.filter((row) => {
34703
+ if (key !== PROGRESS_STATUS_FIELD) {
34704
+ return values.some((value) => matchesFilter(row, { fields: { [key]: value } }));
34705
+ }
34706
+ const kind2 = byGoverns.get(String(row.frontmatter.type ?? ""));
34707
+ if (!kind2) return false;
34708
+ const raw = readKindField(params.okfVersion, kind2, row.frontmatter, key);
34709
+ const actual = raw === void 0 || raw === null ? [] : (Array.isArray(raw) ? raw : [raw]).map((value) => String(value));
34710
+ return values.some((value) => actual.includes(value));
34711
+ });
34712
+ }
34713
+ }
34714
+ if (params.open) {
34715
+ out = out.filter((row) => {
34716
+ const kind2 = byGoverns.get(String(row.frontmatter.type ?? ""));
34717
+ return !kind2 || !isTerminal(kind2, row.frontmatter);
34718
+ });
34719
+ }
34720
+ const count = out.length;
34721
+ if (typeof params.limit === "number" && params.limit > 0) {
34722
+ out = out.slice(0, params.limit);
34723
+ }
34724
+ return { rows: out, count };
34725
+ }
34726
+
34727
+ // ../core/src/kinds-load.ts
34728
+ async function loadKinds(bundle) {
34729
+ const warnings = [];
34730
+ const docs = await query2(bundle, { prefix: CONVENTIONS_PREFIX, type: CONVENTION_TYPE }, {
34731
+ onSkip: ({ id, reason }) => warnings.push({
34732
+ code: "KIND_CONVENTION_MALFORMED",
34733
+ message: isPermissionDeniedSkip({ reason }) ? `skipped kind convention '${id}' that could not be read: ${reason}` : `skipped kind convention '${id}' with unparseable frontmatter: ${reason}`,
34734
+ field: id,
34735
+ severity: "warning"
34736
+ })
34737
+ });
34738
+ const okfVersion = await readBundleOkfVersion2(bundle).catch((error) => {
34739
+ if (!(error instanceof MalformedDocumentError)) throw error;
34740
+ return void 0;
34741
+ });
34742
+ return buildKindRegistry(docs, warnings, { okfVersion });
34743
+ }
34744
+
34722
34745
  // ../markdown-renderer/src/static.tsx
34723
34746
  var import_server = __toESM(require_server_node(), 1);
34724
34747