toolcraft 0.0.891 → 0.0.893

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/composition.json CHANGED
@@ -138,7 +138,7 @@
138
138
  },
139
139
  {
140
140
  "name": "toolcraft",
141
- "version": "0.0.891",
141
+ "version": "0.0.893",
142
142
  "license": "MIT"
143
143
  },
144
144
  {
@@ -148,7 +148,7 @@
148
148
  },
149
149
  {
150
150
  "name": "toolcraft-schema",
151
- "version": "0.0.891",
151
+ "version": "0.0.893",
152
152
  "license": "MIT"
153
153
  },
154
154
  {
@@ -138,7 +138,7 @@
138
138
  },
139
139
  {
140
140
  "name": "toolcraft",
141
- "version": "0.0.891",
141
+ "version": "0.0.893",
142
142
  "license": "MIT"
143
143
  },
144
144
  {
@@ -148,7 +148,7 @@
148
148
  },
149
149
  {
150
150
  "name": "toolcraft-schema",
151
- "version": "0.0.891",
151
+ "version": "0.0.893",
152
152
  "license": "MIT"
153
153
  },
154
154
  {
@@ -1,2 +1,4 @@
1
1
  export { renderMarkdown } from "toolcraft-design/render-markdown";
2
2
  export type { RenderOptions } from "toolcraft-design/render-markdown";
3
+ export { parse } from "toolcraft-design/terminal-markdown/parser";
4
+ export type { MdNode } from "toolcraft-design/terminal-markdown/ast";
@@ -1 +1,2 @@
1
1
  export { renderMarkdown } from "toolcraft-design/render-markdown";
2
+ export { parse } from "toolcraft-design/terminal-markdown/parser";
@@ -8,8 +8,8 @@
8
8
  "arch": "x64",
9
9
  "libc": "glibc",
10
10
  "minimumLibc": "2.31",
11
- "size": 17064,
12
- "sha256": "7e0b6e24f5e49a0a058e3d95c2aee8b438a753d4f36052537b91084a81ef0d53"
11
+ "size": 17056,
12
+ "sha256": "a4989676ef0b0ab2d6b6a25e9f789c0242a340892e88d319f592ce2e7b4159ca"
13
13
  }
14
14
  ],
15
15
  "build": {
@@ -39,8 +39,8 @@
39
39
  },
40
40
  "compiler": {
41
41
  "path": "/usr/bin/cc",
42
- "sha256": "1b99826121ae6682a634e5efe09bd3e3df58ce58e0b28f849114ab5b89139c26",
43
- "version": "x86_64-linux-gnu-gcc-13 (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0\nCopyright (C) 2023 Free Software Foundation, Inc.\nThis is free software; see the source for copying conditions. There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
42
+ "sha256": "864711037b900acdb7a449cf48d912cefa935b527fb60c767ccb956779e66136",
43
+ "version": "x86_64-linux-gnu-gcc-15 (Ubuntu 15.2.0-16ubuntu1) 15.2.0\nCopyright (C) 2025 Free Software Foundation, Inc.\nThis is free software; see the source for copying conditions. There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
44
44
  }
45
45
  }
46
46
  }
@@ -8,7 +8,7 @@
8
8
  },
9
9
  {
10
10
  "name": "toolcraft-schema",
11
- "version": "0.0.891",
11
+ "version": "0.0.893",
12
12
  "license": "MIT"
13
13
  }
14
14
  ]
@@ -519,10 +519,10 @@ function parseInlineCode(input, start, offsets) {
519
519
  return null;
520
520
  }
521
521
  function normalizeInlineCodeValue(value) {
522
+ value = value.replace(/\r\n?|\n/g, " ");
522
523
  if (value.length >= 2 &&
523
524
  value.startsWith(" ") &&
524
525
  value.endsWith(" ") &&
525
- (value[1] === "`" || value[value.length - 2] === "`") &&
526
526
  value.trim().length > 0) {
527
527
  return value.slice(1, -1);
528
528
  }
@@ -618,6 +618,10 @@ function parseLinkDestination(input, openParenIndex) {
618
618
  let depth = 1;
619
619
  let quote = null;
620
620
  let index = openParenIndex + 1;
621
+ while (isAsciiWhitespace(input[index]))
622
+ index += 1;
623
+ const destinationStart = index;
624
+ let angleDestination = false;
621
625
  while (index < input.length) {
622
626
  const char = input[index];
623
627
  if (quote !== null) {
@@ -635,6 +639,19 @@ function parseLinkDestination(input, openParenIndex) {
635
639
  index += 2;
636
640
  continue;
637
641
  }
642
+ if (index === destinationStart && char === "<") {
643
+ angleDestination = true;
644
+ index += 1;
645
+ continue;
646
+ }
647
+ if (angleDestination) {
648
+ if (char === "\n" || char === "\r" || char === "<")
649
+ return null;
650
+ if (char === ">")
651
+ angleDestination = false;
652
+ index += 1;
653
+ continue;
654
+ }
638
655
  if (char === '"' || char === "'") {
639
656
  quote = char;
640
657
  index += 1;
@@ -662,26 +679,24 @@ function parseLinkDestination(input, openParenIndex) {
662
679
  }
663
680
  function parseLinkDestinationContent(content) {
664
681
  const trimmedEnd = trimAsciiWhitespaceEndIndex(content);
665
- if (trimmedEnd === 0) {
666
- return { url: "" };
667
- }
682
+ let url = trimAsciiWhitespace(content.slice(0, trimmedEnd));
683
+ let title;
668
684
  const quote = content[trimmedEnd - 1];
669
685
  if (quote === '"' || quote === "'") {
670
686
  const titleStart = findTrailingQuotedSegmentStart(content, trimmedEnd, quote);
671
687
  if (titleStart !== -1) {
672
688
  let separatorStart = titleStart;
673
- while (separatorStart > 0 && isAsciiWhitespace(content[separatorStart - 1])) {
689
+ while (separatorStart > 0 && isAsciiWhitespace(content[separatorStart - 1]))
674
690
  separatorStart -= 1;
675
- }
676
691
  if (separatorStart < titleStart) {
677
- return {
678
- url: decodeEscapes(trimAsciiWhitespace(content.slice(0, separatorStart))),
679
- title: decodeEscapes(content.slice(titleStart + 1, trimmedEnd - 1))
680
- };
692
+ url = trimAsciiWhitespace(content.slice(0, separatorStart));
693
+ title = decodeEscapes(content.slice(titleStart + 1, trimmedEnd - 1));
681
694
  }
682
695
  }
683
696
  }
684
- return { url: decodeEscapes(trimAsciiWhitespace(content.slice(0, trimmedEnd))) };
697
+ if (url.startsWith("<") && url.endsWith(">"))
698
+ url = url.slice(1, -1);
699
+ return { url: decodeEscapes(url), ...(title === undefined ? {} : { title }) };
685
700
  }
686
701
  function findTrailingQuotedSegmentStart(content, end, quote) {
687
702
  let index = end - 2;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toolcraft-schema",
3
- "version": "0.0.891",
3
+ "version": "0.0.893",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toolcraft",
3
- "version": "0.0.891",
3
+ "version": "0.0.893",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -177,7 +177,7 @@
177
177
  "saxes"
178
178
  ],
179
179
  "optionalDependencies": {
180
- "toolcraft-schema": "0.0.891",
180
+ "toolcraft-schema": "0.0.893",
181
181
  "toolcraft-design": "*",
182
182
  "@poe-code/frontmatter": "*",
183
183
  "@poe-code/agent-mcp-config": "*",