@mjasnikovs/pi-task 0.12.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.
|
@@ -199,6 +199,13 @@ export function summarizeToolArgs(toolName, args) {
|
|
|
199
199
|
if (toolName === 'bash' && typeof a.command === 'string') {
|
|
200
200
|
return a.command.replace(/\s+/g, ' ').trim();
|
|
201
201
|
}
|
|
202
|
+
if (toolName === 'pi-worker-docs' &&
|
|
203
|
+
typeof a.module === 'string' &&
|
|
204
|
+
typeof a.query === 'string') {
|
|
205
|
+
const q = a.query.replace(/\s+/g, ' ').trim();
|
|
206
|
+
const truncated = q.length > 60 ? q.slice(0, 59) + '…' : q;
|
|
207
|
+
return `${a.module} "${truncated}"`;
|
|
208
|
+
}
|
|
202
209
|
if (typeof a.file_path === 'string')
|
|
203
210
|
return a.file_path;
|
|
204
211
|
if (typeof a.path === 'string')
|
package/dist/task/parsers.js
CHANGED
|
@@ -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.
|
|
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",
|