@agentplaneorg/core 0.1.1 → 0.1.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"task-readme.d.ts","sourceRoot":"","sources":["../src/task-readme.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAQF,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,CAYlE;AAiED,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CA8BlF;AAED,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3F"}
1
+ {"version":3,"file":"task-readme.d.ts","sourceRoot":"","sources":["../src/task-readme.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAqBF,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,CAYlE;AAiED,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CA8BlF;AAED,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3F"}
@@ -2,11 +2,25 @@ import { parse as parseYaml } from "yaml";
2
2
  function isRecord(value) {
3
3
  return !!value && typeof value === "object" && !Array.isArray(value);
4
4
  }
5
+ function stripLeadingFrontmatterBlocks(body) {
6
+ let next = body.replaceAll("\r\n", "\n");
7
+ while (true) {
8
+ const trimmed = next.replace(/^\n+/, "");
9
+ if (!trimmed.startsWith("---\n"))
10
+ break;
11
+ const end = trimmed.indexOf("\n---\n", 4);
12
+ if (end === -1)
13
+ break;
14
+ next = trimmed.slice(end + 5);
15
+ }
16
+ return next;
17
+ }
5
18
  function splitFrontmatter(markdown) {
6
19
  const match = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/.exec(markdown);
7
20
  if (!match)
8
21
  return { frontmatterText: null, body: markdown };
9
- return { frontmatterText: match[1] ?? null, body: markdown.slice(match[0].length) };
22
+ const body = stripLeadingFrontmatterBlocks(markdown.slice(match[0].length));
23
+ return { frontmatterText: match[1] ?? null, body };
10
24
  }
11
25
  export function parseTaskReadme(markdown) {
12
26
  const { frontmatterText, body } = splitFrontmatter(markdown);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentplaneorg/core",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Core utilities and models for the Agent Plane CLI.",
5
5
  "keywords": [
6
6
  "agentplane",