@mjasnikovs/pi-task 0.13.0 → 0.13.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.
@@ -210,18 +210,20 @@ export function validateSpecShape(spec) {
210
210
  }
211
211
  // ─── Title derivation ────────────────────────────────────────────────────────
212
212
  export function deriveTitle(refined) {
213
+ const stripBold = (s) => s.replace(/^\*+|\*+$/g, '').trim();
214
+ const truncate = (s) => (s.length > 119 ? s.slice(0, 119) + '…' : s);
213
215
  const lines = refined.split('\n');
214
216
  for (let i = 0; i < lines.length; i++) {
215
- const stripped = lines[i].trim().replace(/^#+\s+/, '');
217
+ const stripped = stripBold(lines[i].trim().replace(/^#+\s+/, ''));
216
218
  if (/^GOAL\s*:?\s*$/i.test(stripped)) {
217
219
  for (let j = i + 1; j < lines.length; j++) {
218
220
  const line = lines[j].trim();
219
221
  if (line.length === 0)
220
222
  continue;
221
- const headerCheck = line.replace(/^#+\s+/, '');
223
+ const headerCheck = stripBold(line.replace(/^#+\s+/, ''));
222
224
  if (/^(CONSTRAINTS|KNOWN-UNKNOWNS)\s*:?\s*$/i.test(headerCheck))
223
225
  break;
224
- return line;
226
+ return truncate(line);
225
227
  }
226
228
  break;
227
229
  }
@@ -230,10 +232,10 @@ export function deriveTitle(refined) {
230
232
  let line = raw.trim();
231
233
  if (line.length === 0)
232
234
  continue;
233
- line = line.replace(/^#+\s+/, '').replace(/^GOAL\s*:?\s*/i, '');
235
+ line = stripBold(line.replace(/^#+\s+/, '')).replace(/^GOAL\s*:?\s*/i, '');
234
236
  if (line.length === 0)
235
237
  continue;
236
- return line;
238
+ return truncate(line);
237
239
  }
238
240
  return '(untitled)';
239
241
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjasnikovs/pi-task",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "Deterministic spec-orchestration for local models, with a bundled real-time remote web view and web/docs/fetch/worker subagent tools.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",