-
Notifications
You must be signed in to change notification settings - Fork 340
Centralize frontmatter parsing + parse frontmatter with yaml library #728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| import * as fs from "node:fs"; | ||
| import * as os from "node:os"; | ||
| import * as path from "node:path"; | ||
| import { parseFrontmatter } from "@mariozechner/pi-coding-agent"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is ~ok, but I think since this is an example a handrolled function is fine if you want to revert this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that's fine. Whatever built-in stuff we can offer to extensions, we should, so they can stay "dependency-less" for as long as possible.
…matter-utils-lib # Conflicts: # packages/coding-agent/src/modes/interactive/interactive-mode.ts
Resolve conflicts keeping yaml-based frontmatter parser with generic type support.
Resolve version conflict by taking ^0.46.0 versions while keeping the new photon-node dependency for image processing.
|
Cheers! |
- Add OpenAI Codex official support entry - Add pi-internal:// URL scheme - Add ctx.shutdown() fix (#756) - Add OpenAI Codex retry logic (#733) - Add third-party contributions: - #702 by @aliou (custom tool HTML export) - #728 by @richardgill (frontmatter parsing, SelectList fix) - #747 by @kaofelix (tree filter shortcuts) - #752 by @richardgill (keymap expansion)
Problem: When porting my claude code skills to pi I had some multi-line descriptions. Pi only parsed the first line which is
"|".There are several similar frontmatter functions in the codebase (each was slightly different)
I've consolidated into a single function and used the yaml library to parse the yaml (see below for library choice background).
Finally, the Select component didn't handle multi line descriptions well, so I updated the component to replace new lines with spaces.
I've made a few decisions in here that might not be your preference - if so, just let me know and I can fix them for you 👍
Appendix:
Example with multi line value:
SKILL.md:Yaml library picks (a little 'deep researched', but looks good to me)
yamlis 0 deps and reasonably recently published.yamljs-yamlv4confboxultramatterfront-mattergray-matteryaml-front-matter