@cratis/pi 7.147.0 → 7.147.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.
@@ -141,8 +141,15 @@ function pathFrom(root, value) {
141
141
  return resolve(root, path);
142
142
  }
143
143
 
144
+ function firstCodeSpan(text) {
145
+ return /`([^`]+)`/.exec(text)?.[1];
146
+ }
147
+
148
+ const looksLikePath = value => !/\s/.test(value) && (value.includes('/') || /\.[A-Za-z0-9]+$/.test(value));
149
+
144
150
  function readPaths(sections, root, context) {
145
- const paths = bullets(sections.get('Files to read')).map(item => ({ ...item, text: clean(item.text) }))
151
+ const paths = bullets(sections.get('Files to read'))
152
+ .map(item => ({ ...item, text: firstCodeSpan(item.text) ?? clean(item.text) }))
146
153
  .filter(item => !absent(item.text));
147
154
  for (const item of paths) {
148
155
  const path = pathFrom(root, item.text);
@@ -164,6 +171,7 @@ function watchRows(rows, context) {
164
171
  function unreadResults(section, root, context) {
165
172
  for (const item of bullets(section)) {
166
173
  for (const match of item.text.matchAll(/`([^`]+)`/g)) {
174
+ if (!looksLikePath(match[1])) continue;
167
175
  const path = pathFrom(root, match[1]);
168
176
  if (!path || !existsSync(path)) context.warning('result-missing', `Unread result path does not exist: ${match[1]}.`, item.line);
169
177
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/pi",
3
- "version": "7.147.0",
3
+ "version": "7.147.1",
4
4
  "description": "Configuration-aware Cratis AI integration for Pi",
5
5
  "type": "module",
6
6
  "files": [